From d77b0192600f43519fc12712ae5fe717306c2334 Mon Sep 17 00:00:00 2001 From: "Isaac.Tang" Date: Wed, 15 Jan 2025 11:37:07 +0800 Subject: [PATCH 1/6] feat(sdk): update api orders --- .../pkg/generate/futures/order/api_order.go | 2 +- .../order/types_cancel_all_orders_v3_req.go | 4 +- sdk/golang/pkg/generate/version.go | 2 +- .../collection-Abandoned Endpoints.json | 556 +- sdk/postman/collection-REST.json | 7435 ++- .../generate/futures/order/api_order.py | 2 +- .../order/model_cancel_all_orders_v3_req.py | 6 +- .../kucoin_universal_sdk/generate/version.py | 2 +- spec/apis.csv | 164 +- spec/original/meta.json | 53301 ++++++++-------- spec/rest/api/openapi-account-account.json | 2364 +- spec/rest/api/openapi-account-deposit.json | 334 +- spec/rest/api/openapi-account-subaccount.json | 720 +- spec/rest/api/openapi-account-transfer.json | 294 +- spec/rest/api/openapi-account-withdrawal.json | 326 +- spec/rest/api/openapi-broker-ndbroker.json | 1388 +- spec/rest/api/openapi-futures-market.json | 2462 +- spec/rest/api/openapi-futures-order.json | 4330 +- spec/rest/api/openapi-futures-positions.json | 1078 +- spec/rest/api/openapi-margin-credit.json | 682 +- spec/rest/api/openapi-margin-debit.json | 222 +- spec/rest/api/openapi-margin-order.json | 4234 +- spec/rest/api/openapi-spot-market.json | 11028 ++-- spec/rest/api/openapi-spot-order.json | 10396 +-- spec/rest/entry/openapi-account.json | 4080 +- spec/rest/entry/openapi-broker.json | 1388 +- spec/rest/entry/openapi-futures.json | 9576 +-- spec/rest/entry/openapi-margin.json | 5542 +- spec/rest/entry/openapi-spot.json | 22964 +++---- spec/ws.csv | 18 +- spec/ws/openapi-futures-private.json | 1588 +- spec/ws/openapi-futures-public.json | 226 +- spec/ws/openapi-spot-public.json | 1034 +- 33 files changed, 74027 insertions(+), 73721 deletions(-) diff --git a/sdk/golang/pkg/generate/futures/order/api_order.go b/sdk/golang/pkg/generate/futures/order/api_order.go index f13d7801..27d419a1 100644 --- a/sdk/golang/pkg/generate/futures/order/api_order.go +++ b/sdk/golang/pkg/generate/futures/order/api_order.go @@ -258,7 +258,7 @@ type OrderAPI interface { // | API-CHANNEL | PRIVATE | // | API-PERMISSION | FUTURES | // | API-RATE-LIMIT-POOL | FUTURES | - // | API-RATE-LIMIT | 30 | + // | API-RATE-LIMIT | 10 | // +---------------------+---------+ CancelAllOrdersV3(req *CancelAllOrdersV3Req, ctx context.Context) (*CancelAllOrdersV3Resp, error) } diff --git a/sdk/golang/pkg/generate/futures/order/types_cancel_all_orders_v3_req.go b/sdk/golang/pkg/generate/futures/order/types_cancel_all_orders_v3_req.go index 2a8b51cc..25da1092 100644 --- a/sdk/golang/pkg/generate/futures/order/types_cancel_all_orders_v3_req.go +++ b/sdk/golang/pkg/generate/futures/order/types_cancel_all_orders_v3_req.go @@ -4,7 +4,7 @@ package order // CancelAllOrdersV3Req struct for CancelAllOrdersV3Req type CancelAllOrdersV3Req struct { - // Cancel all limit orders for a specific contract only, If not specified, all the limit orders will be deleted, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) + // Cancel all limit orders for a specific symbol only, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) Symbol *string `json:"symbol,omitempty" url:"symbol,omitempty"` } @@ -36,7 +36,7 @@ func NewCancelAllOrdersV3ReqBuilder() *CancelAllOrdersV3ReqBuilder { return &CancelAllOrdersV3ReqBuilder{obj: NewCancelAllOrdersV3ReqWithDefaults()} } -// Cancel all limit orders for a specific contract only, If not specified, all the limit orders will be deleted, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) +// Cancel all limit orders for a specific symbol only, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) func (builder *CancelAllOrdersV3ReqBuilder) SetSymbol(value string) *CancelAllOrdersV3ReqBuilder { builder.obj.Symbol = &value return builder diff --git a/sdk/golang/pkg/generate/version.go b/sdk/golang/pkg/generate/version.go index e85b7c0d..8eff68e3 100644 --- a/sdk/golang/pkg/generate/version.go +++ b/sdk/golang/pkg/generate/version.go @@ -2,5 +2,5 @@ package generate const ( SdkVersion = "v1.0.0" - SdkGenerateDate = "2024-12-30" + SdkGenerateDate = "2025-01-15" ) diff --git a/sdk/postman/collection-Abandoned Endpoints.json b/sdk/postman/collection-Abandoned Endpoints.json index 014c9d08..30997643 100644 --- a/sdk/postman/collection-Abandoned Endpoints.json +++ b/sdk/postman/collection-Abandoned Endpoints.json @@ -1258,9 +1258,9 @@ "name": "Orders", "item": [ { - "name": "Cancel Order By OrderId - Old", + "name": "Add Order - Old", "request": { - "method": "DELETE", + "method": "POST", "header": [], "url": { "raw": "", @@ -1271,25 +1271,26 @@ "path": [ "api", "v1", - "orders", - "{{orderId}}" + "orders" ], - "query": [ - { - "key": "symbol", - "value": "BTC-USDT", - "description": "symbol" - } - ] + "query": [] }, - "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470343)\n\n:::tip[]\nIt is recommended to use the **DELETE /api/v1/hf/orders/{orderId}** endpoint instead of this endpoint\n:::\n\n:::info[Description]\nThis endpoint can be used to cancel a spot order by orderId.\nThis endpoint only sends cancellation requests. The results of the requests must be obtained by checking the order status or subscribing to websocket.\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| cancelledOrderIds | array | Refer to the schema section of cancelledOrderIds |\n\n---\n", - "body": {} + "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470333)\n\n:::tip[]\nIt is recommended to use the **POST /api/v1/hf/orders** endpoint instead of this endpoint\n:::\n\n:::info[Description]\nPlace order to the Spot trading system, you can place two major types of orders: limit and market. Orders can only be placed if your account has sufficient funds. Once an order is placed, your funds will be put on hold for the duration of the order. The amount of funds on hold depends on the order type and parameters specified.\n:::\n\n:::tip[Tips]\nPlease note that once your order enters the order book, the system will freeze the handling fees for the order ahead of time.\n\nBefore placing orders, please be sure to fully understand the meaning of the parameters for each trading pair.\n:::\n\n:::tip[Tips]\nThe maximum number of active orders per account is 2000, with a maximum of 200 active orders per trading pair.(including stop orders).\n:::\n\n**Public order placement request parameters**\n\n| Param | Type | Mandatory | Description |\n| --------- | ------ | --------- | ----------- |\n| clientOid | String | Yes | clientOid, the unique identifier created by the client, use of UUID, with a maximum length of 128 bits. |\n| side | String | Yes | **buy** or **sell** |\n| symbol | String | Yes | symbol, e.g. ETH-BTC |\n| type | String | No | **limit** or **market** (default is **limit**) |\n| remark | String | No | remark, length cannot exceed 50 characters (ASCII) |\n| stp | String | No | self trade prevention, **CN**, **CO**, **CB** or **DC** |\n| tradeType | String | No | The type of trading : **TRADE**(Spot Trade), **MARGIN_TRADE** (Margin Trade). Default is **TRADE**. **Note: To improve the system performance and to accelerate order placing and processing, KuCoin has added a new interface for order placing of margin. For traders still using the current interface, please move to the new one as soon as possible. The current one will no longer accept margin orders by May 1st, 2021 (UTC). At the time, KuCoin will notify users via the announcement, please pay attention to it.** |\n\n##### Additional Request Parameters Required by `limit` Orders\n\n| Param | Type | Mandatory | Description |\n| ----------- | ------- | --------- | ------------ |\n| price | String | Yes | Specify price for currency |\n| size | String | Yes | Specify quantity for currency |\n| timeInForce | String | No | Order timing strategy `GTC`, `GTT`, `IOC`, `FOK` (The default is `GTC`) |\n| cancelAfter | long | No | Cancel after `n` seconds,the order timing strategy is `GTT` |\n| postOnly | boolean | No | passive order labels, this is disabled when the order timing strategy is `IOC` or `FOK` |\n| hidden | boolean | No | Hidden or not (not shown in order book) |\n| iceberg | boolean | No | Whether or not only visible portions of orders are shown in iceberg orders |\n| visibleSize | String | No | Maximum visible quantity in iceberg orders |\n\n##### Additional request parameters required by `market` orders\n\n| Param | Type | Mandatory | Description |\n| ----- | ------ | --------- | ------------------------------------------ |\n| size | String | No | (Select one out of two: `size` or `funds`) |\n| funds | String | No | (Select one out of two: `size` or `funds`) |\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| clientOid | string | Client Order Id,The ClientOid field is a unique ID created by the user(we recommend using a UUID), and can only contain numbers, letters, underscores (_), and hyphens (-). This field is returned when order information is obtained. You can use clientOid to tag your orders. ClientOid is different from the order ID created by the service provider. Please do not initiate requests using the same clientOid. The maximum length for the ClientOid is 40 characters.

Please remember the orderId created by the service provider, it used to check for updates in order status. |\n| side | string | specify if the order is to 'buy' or 'sell' |\n| symbol | string | symbol |\n| type | string | specify if the order is an 'limit' order or 'market' order.

The type of order you specify when you place your order determines whether or not you need to request other parameters and also affects the execution of the matching engine.

When placing a limit order, you must specify a price and size. The system will try to match the order according to market price or a price better than market price. If the order cannot be immediately matched, it will stay in the order book until it is matched or the user cancels.

Unlike limit orders, the price for market orders fluctuates with market prices. When placing a market order, you do not need to specify a price, you only need to specify a quantity. Market orders are filled immediately and will not enter the order book. All market orders are takers and a taker fee will be charged. |\n| remark | string | Order placement remarks, length cannot exceed 20 characters (ASCII) |\n| stp | string | [Self Trade Prevention](https://www.kucoin.com/docs-new/doc-338146) is divided into four strategies: CN, CO, CB , and DC |\n| price | string | Specify price for order

When placing a limit order, the price must be based on priceIncrement for the trading pair. The price increment (priceIncrement) is the price precision for the trading pair. For example, for the BTC-USDT trading pair, the priceIncrement is 0.00001000. So the price for your orders cannot be less than 0.00001000 and must be a multiple of priceIncrement. Otherwise, the order will return an invalid priceIncrement error. |\n| size | string | Specify quantity for order

When **type** is limit, size refers to the amount of trading targets (the asset name written in front) for the trading pair. Teh Size must be based on the baseIncrement of the trading pair. The baseIncrement represents the precision for the trading pair. The size of an order must be a positive-integer multiple of baseIncrement and must be between baseMinSize and baseMaxSize.

When **type** is market, select one out of two: size or funds |\n| timeInForce | string | [Time in force](https://www.kucoin.com/docs-new/doc-338146) is a special strategy used during trading |\n| postOnly | boolean | passive order labels, this is disabled when the order timing strategy is IOC or FOK |\n| hidden | boolean | Hidden or not (not shown in order book) |\n| iceberg | boolean | Whether or not only visible portions of orders are shown in iceberg orders |\n| visibleSize | string | Maximum visible quantity in iceberg orders |\n| cancelAfter | integer | Cancel after n seconds,the order timing strategy is GTT |\n| funds | string | When **type** is market, select one out of two: size or funds |\n| tradeType | string | The type of trading : **TRADE**(Spot Trade), **MARGIN_TRADE** (Margin Trade). Default is **TRADE**. **Note: To improve the system performance and to accelerate order placing and processing, KuCoin has added a new interface for order placing of margin. For traders still using the current interface, please move to the new one as soon as possible. The current one will no longer accept margin orders by May 1st, 2021 (UTC). At the time, KuCoin will notify users via the announcement, please pay attention to it.** |\n\n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| orderId | string | The unique order id generated by the trading system,which can be used later for further actions such as canceling the order. |\n\n---\n", + "body": { + "mode": "raw", + "raw": "//limit order\n{\n \"type\": \"limit\",\n \"symbol\": \"BTC-USDT\",\n \"side\": \"buy\",\n \"price\": \"50000\",\n \"size\": \"0.00001\",\n \"clientOid\": \"5c52e11203aa677f33e493fb\",\n \"remark\": \"order remarks\"\n}\n\n//market order 1\n// {\n// \"type\": \"market\",\n// \"symbol\": \"BTC-USDT\",\n// \"side\": \"buy\",\n// \"size\": \"0.00001\",\n// \"clientOid\": \"5c52e11203aa677f33e493fc\",\n// \"remark\": \"order remarks\"\n// }\n\n//market order 2\n// {\n// \"type\": \"market\",\n// \"symbol\": \"BTC-USDT\",\n// \"side\": \"buy\",\n// \"funds\": \"1\",\n// \"clientOid\": \"5c52e11203aa677f33e493fc\",\n// \"remark\": \"order remarks\"\n// }\n", + "options": { + "raw": { + "language": "json" + } + } + } }, "response": [ { "name": "Successful Response", "originalRequest": { - "method": "DELETE", + "method": "POST", "header": [], "url": { "raw": "", @@ -1300,16 +1301,9 @@ "path": [ "api", "v1", - "orders", - "{{orderId}}" + "orders" ], - "query": [ - { - "key": "symbol", - "value": "BTC-USDT", - "description": "symbol" - } - ] + "query": [] } }, "status": "OK", @@ -1342,14 +1336,14 @@ } ], "cookie": [], - "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"cancelledOrderIds\": [\n \"674a97dfef434f0007efc431\"\n ]\n }\n}" + "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"orderId\": \"674a8635b38d120007709c0f\"\n }\n}" } ] }, { - "name": "Get Orders List - Old", + "name": "Add Order Test - Old", "request": { - "method": "GET", + "method": "POST", "header": [], "url": { "raw": "", @@ -1360,64 +1354,27 @@ "path": [ "api", "v1", - "orders" + "orders", + "test" ], - "query": [ - { - "key": "symbol", - "value": "BTC-USDT", - "description": "symbol" - }, - { - "key": "status", - "value": null, - "description": "active or done(done as default), Only list orders with a specific status ." - }, - { - "key": "side", - "value": null, - "description": "buy or sell" - }, - { - "key": "type", - "value": null, - "description": "limit, market, limit_stop or market_stop" - }, - { - "key": "tradeType", - "value": null, - "description": "The type of trading:TRADE - Spot Trading(TRADE as default), MARGIN_TRADE - Cross Margin Trading, MARGIN_ISOLATED_TRADE - Isolated Margin Trading." - }, - { - "key": "startAt", - "value": null, - "description": "Start time (milisecond)" - }, - { - "key": "endAt", - "value": null, - "description": "End time (milisecond)" - }, - { - "key": "currentPage", - "value": null, - "description": "Current request page." - }, - { - "key": "pageSize", - "value": null, - "description": "Number of results per request. Minimum is 10, maximum is 500." - } - ] + "query": [] }, - "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470346)\n\n:::tip[]\nIt is recommended to use the **GET /api/v1/hf/orders/active** endpoint instead of this endpoint\n:::\n\n:::info[Description]\nRequest via this endpoint to get your current order list. The return value is the data after Pagination, sorted in descending order according to time.\n:::\n\n:::tip[Tips]\nWhen you query orders in active status, there is no time limit. However, when you query orders in done status, the start and end time range cannot exceed 7* 24 hours. An error will occur if the specified time window exceeds the range. If you specify the end time only, the system will automatically calculate the start time as end time minus 7*24 hours, and vice versa.\n\nThe history for cancelled orders is only kept for one month. The history for Filled orders is only kept for six month.\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| currentPage | integer | |\n| pageSize | integer | |\n| totalNum | integer | |\n| totalPage | integer | |\n| items | array | Refer to the schema section of items |\n\n**root.data.items Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| id | string | |\n| symbol | string | |\n| opType | string | |\n| type | string | |\n| side | string | |\n| price | string | |\n| size | string | |\n| funds | string | |\n| dealFunds | string | |\n| dealSize | string | |\n| fee | string | |\n| feeCurrency | string | |\n| stp | string | |\n| stop | string | |\n| stopTriggered | boolean | |\n| stopPrice | string | |\n| timeInForce | string | |\n| postOnly | boolean | |\n| hidden | boolean | |\n| iceberg | boolean | |\n| visibleSize | string | |\n| cancelAfter | integer | |\n| channel | string | |\n| clientOid | string | |\n| remark | string | |\n| tags | string | |\n| isActive | boolean | |\n| cancelExist | boolean | |\n| createdAt | integer | |\n| tradeType | string | |\n\n---\n", - "body": {} + "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470341)\n\n:::tip[]\nIt is recommended to use the **POST /api/v1/hf/orders/test** endpoint instead of this endpoint\n:::\n\n:::info[Description]\nOrder test endpoint, the request parameters and return parameters of this endpoint are exactly the same as the order endpoint, and can be used to verify whether the signature is correct and other operations. After placing an order, the order will not enter the matching system, and the order cannot be queried.\n:::\n\n:::tip[Tips]\nPlease note that once your order enters the order book, the system will freeze the handling fees for the order ahead of time.\n\nBefore placing orders, please be sure to fully understand the meaning of the parameters for each trading pair.\n:::\n\n:::tip[Tips]\nThe maximum number of active orders per account is 2000, with a maximum of 200 active orders per trading pair.(including stop orders).\n:::\n\n**Public order placement request parameters**\n\n| Param | Type | Mandatory | Description |\n| --------- | ------ | --------- | ----------- |\n| clientOid | String | Yes | clientOid, the unique identifier created by the client, use of UUID, with a maximum length of 128 bits. |\n| side | String | Yes | **buy** or **sell** |\n| symbol | String | Yes | symbol, e.g. ETH-BTC |\n| type | String | No | **limit** or **market** (default is **limit**) |\n| remark | String | No | remark, length cannot exceed 50 characters (ASCII) |\n| stp | String | No | self trade prevention, **CN**, **CO**, **CB** or **DC** |\n| tradeType | String | No | The type of trading : **TRADE**(Spot Trade), **MARGIN_TRADE** (Margin Trade). Default is **TRADE**. **Note: To improve the system performance and to accelerate order placing and processing, KuCoin has added a new interface for order placing of margin. For traders still using the current interface, please move to the new one as soon as possible. The current one will no longer accept margin orders by May 1st, 2021 (UTC). At the time, KuCoin will notify users via the announcement, please pay attention to it.** |\n\n##### Additional Request Parameters Required by `limit` Orders\n\n| Param | Type | Mandatory | Description |\n| ----------- | ------- | --------- | ------------ |\n| price | String | Yes | Specify price for currency |\n| size | String | Yes | Specify quantity for currency |\n| timeInForce | String | No | Order timing strategy `GTC`, `GTT`, `IOC`, `FOK` (The default is `GTC`) |\n| cancelAfter | long | No | Cancel after `n` seconds,the order timing strategy is `GTT` |\n| postOnly | boolean | No | passive order labels, this is disabled when the order timing strategy is `IOC` or `FOK` |\n| hidden | boolean | No | Hidden or not (not shown in order book) |\n| iceberg | boolean | No | Whether or not only visible portions of orders are shown in iceberg orders |\n| visibleSize | String | No | Maximum visible quantity in iceberg orders |\n\n##### Additional request parameters required by `market` orders\n\n| Param | Type | Mandatory | Description |\n| ----- | ------ | --------- | ------------------------------------------ |\n| size | String | No | (Select one out of two: `size` or `funds`) |\n| funds | String | No | (Select one out of two: `size` or `funds`) |\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| clientOid | string | Client Order Id,The ClientOid field is a unique ID created by the user(we recommend using a UUID), and can only contain numbers, letters, underscores (_), and hyphens (-). This field is returned when order information is obtained. You can use clientOid to tag your orders. ClientOid is different from the order ID created by the service provider. Please do not initiate requests using the same clientOid. The maximum length for the ClientOid is 40 characters.

Please remember the orderId created by the service provider, it used to check for updates in order status. |\n| side | string | specify if the order is to 'buy' or 'sell' |\n| symbol | string | symbol |\n| type | string | specify if the order is an 'limit' order or 'market' order.

The type of order you specify when you place your order determines whether or not you need to request other parameters and also affects the execution of the matching engine.

When placing a limit order, you must specify a price and size. The system will try to match the order according to market price or a price better than market price. If the order cannot be immediately matched, it will stay in the order book until it is matched or the user cancels.

Unlike limit orders, the price for market orders fluctuates with market prices. When placing a market order, you do not need to specify a price, you only need to specify a quantity. Market orders are filled immediately and will not enter the order book. All market orders are takers and a taker fee will be charged. |\n| remark | string | Order placement remarks, length cannot exceed 20 characters (ASCII) |\n| stp | string | [Self Trade Prevention](https://www.kucoin.com/docs-new/doc-338146) is divided into four strategies: CN, CO, CB , and DC |\n| price | string | Specify price for order

When placing a limit order, the price must be based on priceIncrement for the trading pair. The price increment (priceIncrement) is the price precision for the trading pair. For example, for the BTC-USDT trading pair, the priceIncrement is 0.00001000. So the price for your orders cannot be less than 0.00001000 and must be a multiple of priceIncrement. Otherwise, the order will return an invalid priceIncrement error. |\n| size | string | Specify quantity for order

When **type** is limit, size refers to the amount of trading targets (the asset name written in front) for the trading pair. Teh Size must be based on the baseIncrement of the trading pair. The baseIncrement represents the precision for the trading pair. The size of an order must be a positive-integer multiple of baseIncrement and must be between baseMinSize and baseMaxSize.

When **type** is market, select one out of two: size or funds |\n| timeInForce | string | [Time in force](https://www.kucoin.com/docs-new/doc-338146) is a special strategy used during trading |\n| postOnly | boolean | passive order labels, this is disabled when the order timing strategy is IOC or FOK |\n| hidden | boolean | Hidden or not (not shown in order book) |\n| iceberg | boolean | Whether or not only visible portions of orders are shown in iceberg orders |\n| visibleSize | string | Maximum visible quantity in iceberg orders |\n| cancelAfter | integer | Cancel after n seconds,the order timing strategy is GTT |\n| funds | string | When **type** is market, select one out of two: size or funds |\n| tradeType | string | The type of trading : **TRADE**(Spot Trade), **MARGIN_TRADE** (Margin Trade). Default is **TRADE**. **Note: To improve the system performance and to accelerate order placing and processing, KuCoin has added a new interface for order placing of margin. For traders still using the current interface, please move to the new one as soon as possible. The current one will no longer accept margin orders by May 1st, 2021 (UTC). At the time, KuCoin will notify users via the announcement, please pay attention to it.** |\n\n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| orderId | string | The unique order id generated by the trading system,which can be used later for further actions such as canceling the order. |\n\n---\n", + "body": { + "mode": "raw", + "raw": "//limit order\n{\n \"type\": \"limit\",\n \"symbol\": \"BTC-USDT\",\n \"side\": \"buy\",\n \"price\": \"50000\",\n \"size\": \"0.00001\",\n \"clientOid\": \"5c52e11203aa677f33e493fb\",\n \"remark\": \"order remarks\"\n}\n\n//market order 1\n// {\n// \"type\": \"market\",\n// \"symbol\": \"BTC-USDT\",\n// \"side\": \"buy\",\n// \"size\": \"0.00001\",\n// \"clientOid\": \"5c52e11203aa677f33e493fc\",\n// \"remark\": \"order remarks\"\n// }\n\n//market order 2\n// {\n// \"type\": \"market\",\n// \"symbol\": \"BTC-USDT\",\n// \"side\": \"buy\",\n// \"funds\": \"1\",\n// \"clientOid\": \"5c52e11203aa677f33e493fc\",\n// \"remark\": \"order remarks\"\n// }\n", + "options": { + "raw": { + "language": "json" + } + } + } }, "response": [ { "name": "Successful Response", "originalRequest": { - "method": "GET", + "method": "POST", "header": [], "url": { "raw": "", @@ -1428,55 +1385,10 @@ "path": [ "api", "v1", - "orders" + "orders", + "test" ], - "query": [ - { - "key": "symbol", - "value": "BTC-USDT", - "description": "symbol" - }, - { - "key": "status", - "value": null, - "description": "active or done(done as default), Only list orders with a specific status ." - }, - { - "key": "side", - "value": null, - "description": "buy or sell" - }, - { - "key": "type", - "value": null, - "description": "limit, market, limit_stop or market_stop" - }, - { - "key": "tradeType", - "value": null, - "description": "The type of trading:TRADE - Spot Trading(TRADE as default), MARGIN_TRADE - Cross Margin Trading, MARGIN_ISOLATED_TRADE - Isolated Margin Trading." - }, - { - "key": "startAt", - "value": null, - "description": "Start time (milisecond)" - }, - { - "key": "endAt", - "value": null, - "description": "End time (milisecond)" - }, - { - "key": "currentPage", - "value": null, - "description": "Current request page." - }, - { - "key": "pageSize", - "value": null, - "description": "Number of results per request. Minimum is 10, maximum is 500." - } - ] + "query": [] } }, "status": "OK", @@ -1509,14 +1421,14 @@ } ], "cookie": [], - "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"currentPage\": 1,\n \"pageSize\": 50,\n \"totalNum\": 1,\n \"totalPage\": 1,\n \"items\": [\n {\n \"id\": \"674a9a872033a50007e2790d\",\n \"symbol\": \"BTC-USDT\",\n \"opType\": \"DEAL\",\n \"type\": \"limit\",\n \"side\": \"buy\",\n \"price\": \"50000\",\n \"size\": \"0.00001\",\n \"funds\": \"0\",\n \"dealFunds\": \"0\",\n \"dealSize\": \"0\",\n \"fee\": \"0\",\n \"feeCurrency\": \"USDT\",\n \"stp\": \"\",\n \"stop\": \"\",\n \"stopTriggered\": false,\n \"stopPrice\": \"0\",\n \"timeInForce\": \"GTC\",\n \"postOnly\": false,\n \"hidden\": false,\n \"iceberg\": false,\n \"visibleSize\": \"0\",\n \"cancelAfter\": 0,\n \"channel\": \"API\",\n \"clientOid\": \"5c52e11203aa677f33e4923fb\",\n \"remark\": \"order remarks\",\n \"tags\": null,\n \"isActive\": false,\n \"cancelExist\": true,\n \"createdAt\": 1732942471752,\n \"tradeType\": \"TRADE\"\n }\n ]\n }\n}" + "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"orderId\": \"674a8776291d9e00074f1edf\"\n }\n}" } ] }, { - "name": "Get Recent Orders List - Old", + "name": "Batch Add Orders - Old", "request": { - "method": "GET", + "method": "POST", "header": [], "url": { "raw": "", @@ -1527,30 +1439,27 @@ "path": [ "api", "v1", - "limit", - "orders" + "orders", + "multi" ], - "query": [ - { - "key": "currentPage", - "value": null, - "description": "Current request page." - }, - { - "key": "pageSize", - "value": null, - "description": "Number of results per request. Minimum is 10, maximum is 500." - } - ] + "query": [] }, - "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470347)\n\n:::tip[]\nIt is recommended to use the **GET /api/v1/hf/orders/active** endpoint instead of this endpoint\n:::\n\n:::info[Description]\nRequest via this endpoint to get 1000 orders in the last 24 hours. The return value is the data after Pagination, sorted in descending order according to time.\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | array | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| id | string | |\n| symbol | string | |\n| opType | string | |\n| type | string | |\n| side | string | |\n| price | string | |\n| size | string | |\n| funds | string | |\n| dealFunds | string | |\n| dealSize | string | |\n| fee | string | |\n| feeCurrency | string | |\n| stp | string | |\n| stop | string | |\n| stopTriggered | boolean | |\n| stopPrice | string | |\n| timeInForce | string | |\n| postOnly | boolean | |\n| hidden | boolean | |\n| iceberg | boolean | |\n| visibleSize | string | |\n| cancelAfter | integer | |\n| channel | string | |\n| clientOid | string | |\n| remark | string | |\n| tags | string | |\n| isActive | boolean | |\n| cancelExist | boolean | |\n| createdAt | integer | |\n| tradeType | string | |\n\n---\n", - "body": {} + "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470342)\n\n:::tip[]\nIt is recommended to use the **POST /api/v1/hf/orders/multi** endpoint instead of this endpoint\n:::\n\n:::info[Description]\nRequest via this endpoint to place 5 orders at the same time. The order type must be a limit order of the same symbol.\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| orderList | array | Refer to the schema section of orderList |\n| symbol | string | |\n\n**root.orderList Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| clientOid | string | Client Order Id,The ClientOid field is a unique ID created by the user(we recommend using a UUID), and can only contain numbers, letters, underscores (_), and hyphens (-). This field is returned when order information is obtained. You can use clientOid to tag your orders. ClientOid is different from the order ID created by the service provider. Please do not initiate requests using the same clientOid. The maximum length for the ClientOid is 40 characters.

Please remember the orderId created by the service provider, it used to check for updates in order status. |\n| side | string | specify if the order is to 'buy' or 'sell' |\n| symbol | string | symbol |\n| type | string | only limit (default is limit) |\n| remark | string | Order placement remarks, length cannot exceed 20 characters (ASCII) |\n| stp | string | [Self Trade Prevention](https://www.kucoin.com/docs-new/doc-338146) is divided into four strategies: CN, CO, CB , and DC |\n| price | string | Specify price for order

When placing a limit order, the price must be based on priceIncrement for the trading pair. The price increment (priceIncrement) is the price precision for the trading pair. For example, for the BTC-USDT trading pair, the priceIncrement is 0.00001000. So the price for your orders cannot be less than 0.00001000 and must be a multiple of priceIncrement. Otherwise, the order will return an invalid priceIncrement error. |\n| size | string | Specify quantity for order

When **type** is limit, size refers to the amount of trading targets (the asset name written in front) for the trading pair. Teh Size must be based on the baseIncrement of the trading pair. The baseIncrement represents the precision for the trading pair. The size of an order must be a positive-integer multiple of baseIncrement and must be between baseMinSize and baseMaxSize.

When **type** is market, select one out of two: size or funds |\n| timeInForce | string | [Time in force](https://www.kucoin.com/docs-new/doc-338146) is a special strategy used during trading |\n| postOnly | boolean | passive order labels, this is disabled when the order timing strategy is IOC or FOK |\n| hidden | boolean | Hidden or not (not shown in order book) |\n| iceberg | boolean | Whether or not only visible portions of orders are shown in iceberg orders |\n| visibleSize | string | Maximum visible quantity in iceberg orders |\n| cancelAfter | integer | Cancel after n seconds,the order timing strategy is GTT |\n| tradeType | string | The type of trading : **TRADE**(Spot Trade) |\n| stop | string | Either loss or entry. Requires stopPrice to be defined |\n| stopPrice | string | Stop price, Need to be defined if stop is specified. |\n\n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| data | array | Refer to the schema section of data |\n\n**root.data.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| symbol | string | |\n| type | string | |\n| side | string | |\n| price | string | |\n| size | string | |\n| funds | string | |\n| stp | string | |\n| stop | string | |\n| stopPrice | string | |\n| timeInForce | string | |\n| cancelAfter | integer | |\n| postOnly | boolean | |\n| hidden | boolean | |\n| iceberge | boolean | |\n| iceberg | boolean | |\n| visibleSize | string | |\n| channel | string | |\n| id | string | |\n| status | string | |\n| failMsg | string | |\n| clientOid | string | |\n\n---\n", + "body": { + "mode": "raw", + "raw": "{\n \"symbol\": \"BTC-USDT\",\n \"orderList\": [\n {\n \"clientOid\": \"3d07008668054da6b3cb12e432c2b13a\",\n \"side\": \"buy\",\n \"type\": \"limit\",\n \"price\": \"50000\",\n \"size\": \"0.0001\"\n },\n {\n \"clientOid\": \"37245dbe6e134b5c97732bfb36cd4a9d\",\n \"side\": \"buy\",\n \"type\": \"limit\",\n \"price\": \"49999\",\n \"size\": \"0.0001\"\n }\n ]\n}", + "options": { + "raw": { + "language": "json" + } + } + } }, "response": [ { "name": "Successful Response", "originalRequest": { - "method": "GET", + "method": "POST", "header": [], "url": { "raw": "", @@ -1561,21 +1470,10 @@ "path": [ "api", "v1", - "limit", - "orders" + "orders", + "multi" ], - "query": [ - { - "key": "currentPage", - "value": null, - "description": "Current request page." - }, - { - "key": "pageSize", - "value": null, - "description": "Number of results per request. Minimum is 10, maximum is 500." - } - ] + "query": [] } }, "status": "OK", @@ -1608,14 +1506,14 @@ } ], "cookie": [], - "body": "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"id\": \"674a9a872033a50007e2790d\",\n \"symbol\": \"BTC-USDT\",\n \"opType\": \"DEAL\",\n \"type\": \"limit\",\n \"side\": \"buy\",\n \"price\": \"50000\",\n \"size\": \"0.00001\",\n \"funds\": \"0\",\n \"dealFunds\": \"0\",\n \"dealSize\": \"0\",\n \"fee\": \"0\",\n \"feeCurrency\": \"USDT\",\n \"stp\": \"\",\n \"stop\": \"\",\n \"stopTriggered\": false,\n \"stopPrice\": \"0\",\n \"timeInForce\": \"GTC\",\n \"postOnly\": false,\n \"hidden\": false,\n \"iceberg\": false,\n \"visibleSize\": \"0\",\n \"cancelAfter\": 0,\n \"channel\": \"API\",\n \"clientOid\": \"5c52e11203aa677f33e4923fb\",\n \"remark\": \"order remarks\",\n \"tags\": null,\n \"isActive\": false,\n \"cancelExist\": true,\n \"createdAt\": 1732942471752,\n \"tradeType\": \"TRADE\"\n }\n ]\n}" + "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"data\": [\n {\n \"symbol\": \"BTC-USDT\",\n \"type\": \"limit\",\n \"side\": \"buy\",\n \"price\": \"50000\",\n \"size\": \"0.0001\",\n \"funds\": null,\n \"stp\": \"\",\n \"stop\": \"\",\n \"stopPrice\": null,\n \"timeInForce\": \"GTC\",\n \"cancelAfter\": 0,\n \"postOnly\": false,\n \"hidden\": false,\n \"iceberge\": false,\n \"iceberg\": false,\n \"visibleSize\": null,\n \"channel\": \"API\",\n \"id\": \"674a97dfef434f0007efc431\",\n \"status\": \"success\",\n \"failMsg\": null,\n \"clientOid\": \"3d07008668054da6b3cb12e432c2b13a\"\n },\n {\n \"symbol\": \"BTC-USDT\",\n \"type\": \"limit\",\n \"side\": \"buy\",\n \"price\": \"49999\",\n \"size\": \"0.0001\",\n \"funds\": null,\n \"stp\": \"\",\n \"stop\": \"\",\n \"stopPrice\": null,\n \"timeInForce\": \"GTC\",\n \"cancelAfter\": 0,\n \"postOnly\": false,\n \"hidden\": false,\n \"iceberge\": false,\n \"iceberg\": false,\n \"visibleSize\": null,\n \"channel\": \"API\",\n \"id\": \"674a97dffb378b00077b9c20\",\n \"status\": \"fail\",\n \"failMsg\": \"Balance insufficient!\",\n \"clientOid\": \"37245dbe6e134b5c97732bfb36cd4a9d\"\n }\n ]\n }\n}" } ] }, { - "name": "Get Order By OrderId - Old", + "name": "Cancel Order By OrderId - Old", "request": { - "method": "GET", + "method": "DELETE", "header": [], "url": { "raw": "", @@ -1629,16 +1527,22 @@ "orders", "{{orderId}}" ], - "query": [] + "query": [ + { + "key": "symbol", + "value": "BTC-USDT", + "description": "symbol" + } + ] }, - "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470348)\n\n:::tip[]\nIt is recommended to use the **GET /api/v1/hf/orders/{orderId}** endpoint instead of this endpoint\n:::\n\n:::info[Description]\nRequest via this endpoint to get a single order info by order ID.\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| id | string | |\n| symbol | string | |\n| opType | string | |\n| type | string | |\n| side | string | |\n| price | string | |\n| size | string | |\n| funds | string | |\n| dealFunds | string | |\n| dealSize | string | |\n| fee | string | |\n| feeCurrency | string | |\n| stp | string | |\n| stop | string | |\n| stopTriggered | boolean | |\n| stopPrice | string | |\n| timeInForce | string | |\n| postOnly | boolean | |\n| hidden | boolean | |\n| iceberg | boolean | |\n| visibleSize | string | |\n| cancelAfter | integer | |\n| channel | string | |\n| clientOid | string | |\n| remark | string | |\n| tags | string | |\n| isActive | boolean | |\n| cancelExist | boolean | |\n| createdAt | integer | |\n| tradeType | string | |\n\n---\n", + "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470343)\n\n:::tip[]\nIt is recommended to use the **DELETE /api/v1/hf/orders/{orderId}** endpoint instead of this endpoint\n:::\n\n:::info[Description]\nThis endpoint can be used to cancel a spot order by orderId.\nThis endpoint only sends cancellation requests. The results of the requests must be obtained by checking the order status or subscribing to websocket.\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| cancelledOrderIds | array | Refer to the schema section of cancelledOrderIds |\n\n---\n", "body": {} }, "response": [ { "name": "Successful Response", "originalRequest": { - "method": "GET", + "method": "DELETE", "header": [], "url": { "raw": "", @@ -1652,7 +1556,13 @@ "orders", "{{orderId}}" ], - "query": [] + "query": [ + { + "key": "symbol", + "value": "BTC-USDT", + "description": "symbol" + } + ] } }, "status": "OK", @@ -1685,14 +1595,14 @@ } ], "cookie": [], - "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"id\": \"674a97dfef434f0007efc431\",\n \"symbol\": \"BTC-USDT\",\n \"opType\": \"DEAL\",\n \"type\": \"limit\",\n \"side\": \"buy\",\n \"price\": \"50000\",\n \"size\": \"0.0001\",\n \"funds\": \"0\",\n \"dealFunds\": \"0\",\n \"dealSize\": \"0\",\n \"fee\": \"0\",\n \"feeCurrency\": \"USDT\",\n \"stp\": \"\",\n \"stop\": \"\",\n \"stopTriggered\": false,\n \"stopPrice\": \"0\",\n \"timeInForce\": \"GTC\",\n \"postOnly\": false,\n \"hidden\": false,\n \"iceberg\": false,\n \"visibleSize\": \"0\",\n \"cancelAfter\": 0,\n \"channel\": \"API\",\n \"clientOid\": \"3d07008668054da6b3cb12e432c2b13a\",\n \"remark\": null,\n \"tags\": null,\n \"isActive\": false,\n \"cancelExist\": true,\n \"createdAt\": 1732941791518,\n \"tradeType\": \"TRADE\"\n }\n}" + "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"cancelledOrderIds\": [\n \"674a97dfef434f0007efc431\"\n ]\n }\n}" } ] }, { - "name": "Get Order By ClientOid - Old", + "name": "Cancel Order By ClientOid - Old", "request": { - "method": "GET", + "method": "DELETE", "header": [], "url": { "raw": "", @@ -1707,16 +1617,22 @@ "client-order", "{{clientOid}}" ], - "query": [] + "query": [ + { + "key": "symbol", + "value": "BTC-USDT", + "description": "symbol" + } + ] }, - "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470349)\n\n:::tip[]\nIt is recommended to use the **GET /api/v1/hf/orders/client-order/{clientOid}** endpoint instead of this endpoint\n:::\n\n:::info[Description]\nRequest via this interface to check the information of a single active order via clientOid. The system will prompt that the order does not exists if the order does not exist or has been settled.\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| id | string | |\n| symbol | string | |\n| opType | string | |\n| type | string | |\n| side | string | |\n| price | string | |\n| size | string | |\n| funds | string | |\n| dealFunds | string | |\n| dealSize | string | |\n| fee | string | |\n| feeCurrency | string | |\n| stp | string | |\n| stop | string | |\n| stopTriggered | boolean | |\n| stopPrice | string | |\n| timeInForce | string | |\n| postOnly | boolean | |\n| hidden | boolean | |\n| iceberg | boolean | |\n| visibleSize | string | |\n| cancelAfter | integer | |\n| channel | string | |\n| clientOid | string | |\n| remark | string | |\n| tags | string | |\n| isActive | boolean | |\n| cancelExist | boolean | |\n| createdAt | integer | |\n| tradeType | string | |\n\n---\n", + "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470344)\n\n:::tip[]\nIt is recommended to use the **DELETE /api/v1/hf/orders/client-order/{clientOid}** endpoint instead of this endpoint\n:::\n\n:::info[Description]\nThis endpoint can be used to cancel a spot order by clientOid.\nThis endpoint only sends cancellation requests. The results of the requests must be obtained by checking the order status or subscribing to websocket.\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| clientOid | string | Client Order Id,unique identifier created by the user |\n| cancelledOrderId | string | |\n| cancelledOcoOrderIds | string | |\n\n---\n", "body": {} }, "response": [ { "name": "Successful Response", "originalRequest": { - "method": "GET", + "method": "DELETE", "header": [], "url": { "raw": "", @@ -1731,7 +1647,13 @@ "client-order", "{{clientOid}}" ], - "query": [] + "query": [ + { + "key": "symbol", + "value": "BTC-USDT", + "description": "symbol" + } + ] } }, "status": "OK", @@ -1764,7 +1686,7 @@ } ], "cookie": [], - "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"id\": \"674a97dfef434f0007efc431\",\n \"symbol\": \"BTC-USDT\",\n \"opType\": \"DEAL\",\n \"type\": \"limit\",\n \"side\": \"buy\",\n \"price\": \"50000\",\n \"size\": \"0.0001\",\n \"funds\": \"0\",\n \"dealFunds\": \"0\",\n \"dealSize\": \"0\",\n \"fee\": \"0\",\n \"feeCurrency\": \"USDT\",\n \"stp\": \"\",\n \"stop\": \"\",\n \"stopTriggered\": false,\n \"stopPrice\": \"0\",\n \"timeInForce\": \"GTC\",\n \"postOnly\": false,\n \"hidden\": false,\n \"iceberg\": false,\n \"visibleSize\": \"0\",\n \"cancelAfter\": 0,\n \"channel\": \"API\",\n \"clientOid\": \"3d07008668054da6b3cb12e432c2b13a\",\n \"remark\": null,\n \"tags\": null,\n \"isActive\": false,\n \"cancelExist\": true,\n \"createdAt\": 1732941791518,\n \"tradeType\": \"TRADE\"\n }\n}" + "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"cancelledOrderId\": \"674a9a872033a50007e2790d\",\n \"clientOid\": \"5c52e11203aa677f33e4923fb\",\n \"cancelledOcoOrderIds\": null\n }\n}" } ] }, @@ -1866,7 +1788,7 @@ ] }, { - "name": "Get Trade History - Old", + "name": "Get Orders List - Old", "request": { "method": "GET", "header": [], @@ -1879,7 +1801,7 @@ "path": [ "api", "v1", - "fills" + "orders" ], "query": [ { @@ -1888,19 +1810,19 @@ "description": "symbol" }, { - "key": "orderId", + "key": "status", "value": null, - "description": "The unique order id generated by the trading system (If orderId is specified,please ignore the other query parameters)" + "description": "active or done(done as default), Only list orders with a specific status ." }, { "key": "side", "value": null, - "description": "specify if the order is to 'buy' or 'sell'" + "description": "buy or sell" }, { "key": "type", "value": null, - "description": "limit, market, limit_stop or market_stop\n" + "description": "limit, market, limit_stop or market_stop" }, { "key": "tradeType", @@ -1909,12 +1831,12 @@ }, { "key": "startAt", - "value": "1728663338000", + "value": null, "description": "Start time (milisecond)" }, { "key": "endAt", - "value": "1728692138000", + "value": null, "description": "End time (milisecond)" }, { @@ -1929,7 +1851,7 @@ } ] }, - "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470350)\n\n:::tip[]\nIt is recommended to use the **GET /api/v1/hf/fills** endpoint instead of this endpoint\n:::\n\n:::info[Description]\nRequest via this endpoint to get the recent fills.\nThe return value is the data after Pagination, sorted in descending order according to time.\n:::\n\n:::tip[Tips]\nThe system allows you to retrieve data up to one week (start from the last day by default). If the time period of the queried data exceeds one week (time range from the start time to end time exceeded 7*24 hours), the system will prompt to remind you that you have exceeded the time limit. If you only specified the start time, the system will automatically calculate the end time (end time = start time + 7 * 24 hours). On the contrary, if you only specified the end time, the system will calculate the start time (start time= end time - 7 * 24 hours) the same way.\n\nThe total number of items retrieved cannot exceed 50,000. If it is exceeded, please shorten the query time range.\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| currentPage | integer | |\n| pageSize | integer | |\n| totalNum | integer | |\n| totalPage | integer | |\n| items | array | Refer to the schema section of items |\n\n**root.data.items Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| symbol | string | symbol |\n| tradeId | string | |\n| orderId | string | The unique order id generated by the trading system |\n| counterOrderId | string | Counterparty order Id |\n| side | string | Buy or sell |\n| liquidity | string | Liquidity type: taker or maker |\n| forceTaker | boolean | |\n| price | string | Order price |\n| size | string | Order size |\n| funds | string | Order Funds |\n| fee | string | [Handling fees](https://www.kucoin.com/docs-new/api-5327739) |\n| feeRate | string | Fee rate
|\n| feeCurrency | string | currency used to calculate trading fee |\n| stop | string | Take Profit and Stop Loss type, currently HFT does not support the Take Profit and Stop Loss type, so it is empty |\n| tradeType | string | Trade type, redundancy param |\n| type | string | Specify if the order is an 'limit' order or 'market' order. |\n| createdAt | integer | |\n\n---\n", + "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470346)\n\n:::tip[]\nIt is recommended to use the **GET /api/v1/hf/orders/active** endpoint instead of this endpoint\n:::\n\n:::info[Description]\nRequest via this endpoint to get your current order list. The return value is the data after Pagination, sorted in descending order according to time.\n:::\n\n:::tip[Tips]\nWhen you query orders in active status, there is no time limit. However, when you query orders in done status, the start and end time range cannot exceed 7* 24 hours. An error will occur if the specified time window exceeds the range. If you specify the end time only, the system will automatically calculate the start time as end time minus 7*24 hours, and vice versa.\n\nThe history for cancelled orders is only kept for one month. The history for Filled orders is only kept for six month.\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| currentPage | integer | |\n| pageSize | integer | |\n| totalNum | integer | |\n| totalPage | integer | |\n| items | array | Refer to the schema section of items |\n\n**root.data.items Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| id | string | |\n| symbol | string | |\n| opType | string | |\n| type | string | |\n| side | string | |\n| price | string | |\n| size | string | |\n| funds | string | |\n| dealFunds | string | |\n| dealSize | string | |\n| fee | string | |\n| feeCurrency | string | |\n| stp | string | |\n| stop | string | |\n| stopTriggered | boolean | |\n| stopPrice | string | |\n| timeInForce | string | |\n| postOnly | boolean | |\n| hidden | boolean | |\n| iceberg | boolean | |\n| visibleSize | string | |\n| cancelAfter | integer | |\n| channel | string | |\n| clientOid | string | |\n| remark | string | |\n| tags | string | |\n| isActive | boolean | |\n| cancelExist | boolean | |\n| createdAt | integer | |\n| tradeType | string | |\n\n---\n", "body": {} }, "response": [ @@ -1947,7 +1869,7 @@ "path": [ "api", "v1", - "fills" + "orders" ], "query": [ { @@ -1956,19 +1878,19 @@ "description": "symbol" }, { - "key": "orderId", + "key": "status", "value": null, - "description": "The unique order id generated by the trading system (If orderId is specified,please ignore the other query parameters)" + "description": "active or done(done as default), Only list orders with a specific status ." }, { "key": "side", "value": null, - "description": "specify if the order is to 'buy' or 'sell'" + "description": "buy or sell" }, { "key": "type", "value": null, - "description": "limit, market, limit_stop or market_stop\n" + "description": "limit, market, limit_stop or market_stop" }, { "key": "tradeType", @@ -1977,12 +1899,12 @@ }, { "key": "startAt", - "value": "1728663338000", + "value": null, "description": "Start time (milisecond)" }, { "key": "endAt", - "value": "1728692138000", + "value": null, "description": "End time (milisecond)" }, { @@ -2028,12 +1950,12 @@ } ], "cookie": [], - "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"currentPage\": 1,\n \"pageSize\": 50,\n \"totalNum\": 1,\n \"totalPage\": 1,\n \"items\": [\n {\n \"symbol\": \"DOGE-USDT\",\n \"tradeId\": \"10862827223795713\",\n \"orderId\": \"6745698ef4f1200007c561a8\",\n \"counterOrderId\": \"6745695ef15b270007ac5076\",\n \"side\": \"buy\",\n \"liquidity\": \"taker\",\n \"forceTaker\": false,\n \"price\": \"0.40739\",\n \"size\": \"10\",\n \"funds\": \"4.0739\",\n \"fee\": \"0.0040739\",\n \"feeRate\": \"0.001\",\n \"feeCurrency\": \"USDT\",\n \"stop\": \"\",\n \"tradeType\": \"TRADE\",\n \"type\": \"market\",\n \"createdAt\": 1732602254928\n }\n ]\n }\n}" + "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"currentPage\": 1,\n \"pageSize\": 50,\n \"totalNum\": 1,\n \"totalPage\": 1,\n \"items\": [\n {\n \"id\": \"674a9a872033a50007e2790d\",\n \"symbol\": \"BTC-USDT\",\n \"opType\": \"DEAL\",\n \"type\": \"limit\",\n \"side\": \"buy\",\n \"price\": \"50000\",\n \"size\": \"0.00001\",\n \"funds\": \"0\",\n \"dealFunds\": \"0\",\n \"dealSize\": \"0\",\n \"fee\": \"0\",\n \"feeCurrency\": \"USDT\",\n \"stp\": \"\",\n \"stop\": \"\",\n \"stopTriggered\": false,\n \"stopPrice\": \"0\",\n \"timeInForce\": \"GTC\",\n \"postOnly\": false,\n \"hidden\": false,\n \"iceberg\": false,\n \"visibleSize\": \"0\",\n \"cancelAfter\": 0,\n \"channel\": \"API\",\n \"clientOid\": \"5c52e11203aa677f33e4923fb\",\n \"remark\": \"order remarks\",\n \"tags\": null,\n \"isActive\": false,\n \"cancelExist\": true,\n \"createdAt\": 1732942471752,\n \"tradeType\": \"TRADE\"\n }\n ]\n }\n}" } ] }, { - "name": "Get Recent Trade History - Old", + "name": "Get Recent Orders List - Old", "request": { "method": "GET", "header": [], @@ -2047,7 +1969,7 @@ "api", "v1", "limit", - "fills" + "orders" ], "query": [ { @@ -2062,7 +1984,7 @@ } ] }, - "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470351)\n\n:::tip[]\nIt is recommended to use the **GET /api/v1/hf/fills** endpoint instead of this endpoint\n:::\n\n:::info[Description]\nRequest via this endpoint to get a list of 1000 fills in the last 24 hours. The return value is the data after Pagination, sorted in descending order according to time.\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | array | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| symbol | string | |\n| tradeId | string | |\n| orderId | string | |\n| counterOrderId | string | |\n| side | string | |\n| liquidity | string | |\n| forceTaker | boolean | |\n| price | string | |\n| size | string | |\n| funds | string | |\n| fee | string | |\n| feeRate | string | |\n| feeCurrency | string | |\n| stop | string | |\n| tradeType | string | |\n| type | string | |\n| createdAt | integer | |\n\n---\n", + "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470347)\n\n:::tip[]\nIt is recommended to use the **GET /api/v1/hf/orders/active** endpoint instead of this endpoint\n:::\n\n:::info[Description]\nRequest via this endpoint to get 1000 orders in the last 24 hours. The return value is the data after Pagination, sorted in descending order according to time.\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | array | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| id | string | |\n| symbol | string | |\n| opType | string | |\n| type | string | |\n| side | string | |\n| price | string | |\n| size | string | |\n| funds | string | |\n| dealFunds | string | |\n| dealSize | string | |\n| fee | string | |\n| feeCurrency | string | |\n| stp | string | |\n| stop | string | |\n| stopTriggered | boolean | |\n| stopPrice | string | |\n| timeInForce | string | |\n| postOnly | boolean | |\n| hidden | boolean | |\n| iceberg | boolean | |\n| visibleSize | string | |\n| cancelAfter | integer | |\n| channel | string | |\n| clientOid | string | |\n| remark | string | |\n| tags | string | |\n| isActive | boolean | |\n| cancelExist | boolean | |\n| createdAt | integer | |\n| tradeType | string | |\n\n---\n", "body": {} }, "response": [ @@ -2081,7 +2003,7 @@ "api", "v1", "limit", - "fills" + "orders" ], "query": [ { @@ -2127,14 +2049,14 @@ } ], "cookie": [], - "body": "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"symbol\": \"BTC-USDT\",\n \"tradeId\": \"11732720444522497\",\n \"orderId\": \"674aab24754b1e00077dbc69\",\n \"counterOrderId\": \"674aab1fb26bfb0007a18b67\",\n \"side\": \"buy\",\n \"liquidity\": \"taker\",\n \"forceTaker\": false,\n \"price\": \"96999.6\",\n \"size\": \"0.00001\",\n \"funds\": \"0.969996\",\n \"fee\": \"0.000969996\",\n \"feeRate\": \"0.001\",\n \"feeCurrency\": \"USDT\",\n \"stop\": \"\",\n \"tradeType\": \"TRADE\",\n \"type\": \"limit\",\n \"createdAt\": 1732946724082\n }\n ]\n}" + "body": "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"id\": \"674a9a872033a50007e2790d\",\n \"symbol\": \"BTC-USDT\",\n \"opType\": \"DEAL\",\n \"type\": \"limit\",\n \"side\": \"buy\",\n \"price\": \"50000\",\n \"size\": \"0.00001\",\n \"funds\": \"0\",\n \"dealFunds\": \"0\",\n \"dealSize\": \"0\",\n \"fee\": \"0\",\n \"feeCurrency\": \"USDT\",\n \"stp\": \"\",\n \"stop\": \"\",\n \"stopTriggered\": false,\n \"stopPrice\": \"0\",\n \"timeInForce\": \"GTC\",\n \"postOnly\": false,\n \"hidden\": false,\n \"iceberg\": false,\n \"visibleSize\": \"0\",\n \"cancelAfter\": 0,\n \"channel\": \"API\",\n \"clientOid\": \"5c52e11203aa677f33e4923fb\",\n \"remark\": \"order remarks\",\n \"tags\": null,\n \"isActive\": false,\n \"cancelExist\": true,\n \"createdAt\": 1732942471752,\n \"tradeType\": \"TRADE\"\n }\n ]\n}" } ] }, { - "name": "Cancel Order By ClientOid - Old", + "name": "Get Order By OrderId - Old", "request": { - "method": "DELETE", + "method": "GET", "header": [], "url": { "raw": "", @@ -2145,26 +2067,19 @@ "path": [ "api", "v1", - "order", - "client-order", - "{{clientOid}}" + "orders", + "{{orderId}}" ], - "query": [ - { - "key": "symbol", - "value": "BTC-USDT", - "description": "symbol" - } - ] + "query": [] }, - "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470344)\n\n:::tip[]\nIt is recommended to use the **DELETE /api/v1/hf/orders/client-order/{clientOid}** endpoint instead of this endpoint\n:::\n\n:::info[Description]\nThis endpoint can be used to cancel a spot order by clientOid.\nThis endpoint only sends cancellation requests. The results of the requests must be obtained by checking the order status or subscribing to websocket.\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| clientOid | string | Client Order Id,unique identifier created by the user |\n| cancelledOrderId | string | |\n| cancelledOcoOrderIds | string | |\n\n---\n", + "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470348)\n\n:::tip[]\nIt is recommended to use the **GET /api/v1/hf/orders/{orderId}** endpoint instead of this endpoint\n:::\n\n:::info[Description]\nRequest via this endpoint to get a single order info by order ID.\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| id | string | |\n| symbol | string | |\n| opType | string | |\n| type | string | |\n| side | string | |\n| price | string | |\n| size | string | |\n| funds | string | |\n| dealFunds | string | |\n| dealSize | string | |\n| fee | string | |\n| feeCurrency | string | |\n| stp | string | |\n| stop | string | |\n| stopTriggered | boolean | |\n| stopPrice | string | |\n| timeInForce | string | |\n| postOnly | boolean | |\n| hidden | boolean | |\n| iceberg | boolean | |\n| visibleSize | string | |\n| cancelAfter | integer | |\n| channel | string | |\n| clientOid | string | |\n| remark | string | |\n| tags | string | |\n| isActive | boolean | |\n| cancelExist | boolean | |\n| createdAt | integer | |\n| tradeType | string | |\n\n---\n", "body": {} }, "response": [ { "name": "Successful Response", "originalRequest": { - "method": "DELETE", + "method": "GET", "header": [], "url": { "raw": "", @@ -2175,17 +2090,10 @@ "path": [ "api", "v1", - "order", - "client-order", - "{{clientOid}}" + "orders", + "{{orderId}}" ], - "query": [ - { - "key": "symbol", - "value": "BTC-USDT", - "description": "symbol" - } - ] + "query": [] } }, "status": "OK", @@ -2218,14 +2126,14 @@ } ], "cookie": [], - "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"cancelledOrderId\": \"674a9a872033a50007e2790d\",\n \"clientOid\": \"5c52e11203aa677f33e4923fb\",\n \"cancelledOcoOrderIds\": null\n }\n}" + "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"id\": \"674a97dfef434f0007efc431\",\n \"symbol\": \"BTC-USDT\",\n \"opType\": \"DEAL\",\n \"type\": \"limit\",\n \"side\": \"buy\",\n \"price\": \"50000\",\n \"size\": \"0.0001\",\n \"funds\": \"0\",\n \"dealFunds\": \"0\",\n \"dealSize\": \"0\",\n \"fee\": \"0\",\n \"feeCurrency\": \"USDT\",\n \"stp\": \"\",\n \"stop\": \"\",\n \"stopTriggered\": false,\n \"stopPrice\": \"0\",\n \"timeInForce\": \"GTC\",\n \"postOnly\": false,\n \"hidden\": false,\n \"iceberg\": false,\n \"visibleSize\": \"0\",\n \"cancelAfter\": 0,\n \"channel\": \"API\",\n \"clientOid\": \"3d07008668054da6b3cb12e432c2b13a\",\n \"remark\": null,\n \"tags\": null,\n \"isActive\": false,\n \"cancelExist\": true,\n \"createdAt\": 1732941791518,\n \"tradeType\": \"TRADE\"\n }\n}" } ] }, { - "name": "Add Order - Old", + "name": "Get Order By ClientOid - Old", "request": { - "method": "POST", + "method": "GET", "header": [], "url": { "raw": "", @@ -2236,26 +2144,20 @@ "path": [ "api", "v1", - "orders" + "order", + "client-order", + "{{clientOid}}" ], "query": [] }, - "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470333)\n\n:::tip[]\nIt is recommended to use the **POST /api/v1/hf/orders** endpoint instead of this endpoint\n:::\n\n:::info[Description]\nPlace order to the Spot trading system, you can place two major types of orders: limit and market. Orders can only be placed if your account has sufficient funds. Once an order is placed, your funds will be put on hold for the duration of the order. The amount of funds on hold depends on the order type and parameters specified.\n:::\n\n:::tip[Tips]\nPlease note that once your order enters the order book, the system will freeze the handling fees for the order ahead of time.\n\nBefore placing orders, please be sure to fully understand the meaning of the parameters for each trading pair.\n:::\n\n:::tip[Tips]\nThe maximum number of active orders per account is 2000, with a maximum of 200 active orders per trading pair.(including stop orders).\n:::\n\n**Public order placement request parameters**\n\n| Param | Type | Mandatory | Description |\n| --------- | ------ | --------- | ----------- |\n| clientOid | String | Yes | clientOid, the unique identifier created by the client, use of UUID, with a maximum length of 128 bits. |\n| side | String | Yes | **buy** or **sell** |\n| symbol | String | Yes | symbol, e.g. ETH-BTC |\n| type | String | No | **limit** or **market** (default is **limit**) |\n| remark | String | No | remark, length cannot exceed 50 characters (ASCII) |\n| stp | String | No | self trade prevention, **CN**, **CO**, **CB** or **DC** |\n| tradeType | String | No | The type of trading : **TRADE**(Spot Trade), **MARGIN_TRADE** (Margin Trade). Default is **TRADE**. **Note: To improve the system performance and to accelerate order placing and processing, KuCoin has added a new interface for order placing of margin. For traders still using the current interface, please move to the new one as soon as possible. The current one will no longer accept margin orders by May 1st, 2021 (UTC). At the time, KuCoin will notify users via the announcement, please pay attention to it.** |\n\n##### Additional Request Parameters Required by `limit` Orders\n\n| Param | Type | Mandatory | Description |\n| ----------- | ------- | --------- | ------------ |\n| price | String | Yes | Specify price for currency |\n| size | String | Yes | Specify quantity for currency |\n| timeInForce | String | No | Order timing strategy `GTC`, `GTT`, `IOC`, `FOK` (The default is `GTC`) |\n| cancelAfter | long | No | Cancel after `n` seconds,the order timing strategy is `GTT` |\n| postOnly | boolean | No | passive order labels, this is disabled when the order timing strategy is `IOC` or `FOK` |\n| hidden | boolean | No | Hidden or not (not shown in order book) |\n| iceberg | boolean | No | Whether or not only visible portions of orders are shown in iceberg orders |\n| visibleSize | String | No | Maximum visible quantity in iceberg orders |\n\n##### Additional request parameters required by `market` orders\n\n| Param | Type | Mandatory | Description |\n| ----- | ------ | --------- | ------------------------------------------ |\n| size | String | No | (Select one out of two: `size` or `funds`) |\n| funds | String | No | (Select one out of two: `size` or `funds`) |\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| clientOid | string | Client Order Id,The ClientOid field is a unique ID created by the user(we recommend using a UUID), and can only contain numbers, letters, underscores (_), and hyphens (-). This field is returned when order information is obtained. You can use clientOid to tag your orders. ClientOid is different from the order ID created by the service provider. Please do not initiate requests using the same clientOid. The maximum length for the ClientOid is 40 characters.

Please remember the orderId created by the service provider, it used to check for updates in order status. |\n| side | string | specify if the order is to 'buy' or 'sell' |\n| symbol | string | symbol |\n| type | string | specify if the order is an 'limit' order or 'market' order.

The type of order you specify when you place your order determines whether or not you need to request other parameters and also affects the execution of the matching engine.

When placing a limit order, you must specify a price and size. The system will try to match the order according to market price or a price better than market price. If the order cannot be immediately matched, it will stay in the order book until it is matched or the user cancels.

Unlike limit orders, the price for market orders fluctuates with market prices. When placing a market order, you do not need to specify a price, you only need to specify a quantity. Market orders are filled immediately and will not enter the order book. All market orders are takers and a taker fee will be charged. |\n| remark | string | Order placement remarks, length cannot exceed 20 characters (ASCII) |\n| stp | string | [Self Trade Prevention](https://www.kucoin.com/docs-new/doc-338146) is divided into four strategies: CN, CO, CB , and DC |\n| price | string | Specify price for order

When placing a limit order, the price must be based on priceIncrement for the trading pair. The price increment (priceIncrement) is the price precision for the trading pair. For example, for the BTC-USDT trading pair, the priceIncrement is 0.00001000. So the price for your orders cannot be less than 0.00001000 and must be a multiple of priceIncrement. Otherwise, the order will return an invalid priceIncrement error. |\n| size | string | Specify quantity for order

When **type** is limit, size refers to the amount of trading targets (the asset name written in front) for the trading pair. Teh Size must be based on the baseIncrement of the trading pair. The baseIncrement represents the precision for the trading pair. The size of an order must be a positive-integer multiple of baseIncrement and must be between baseMinSize and baseMaxSize.

When **type** is market, select one out of two: size or funds |\n| timeInForce | string | [Time in force](https://www.kucoin.com/docs-new/doc-338146) is a special strategy used during trading |\n| postOnly | boolean | passive order labels, this is disabled when the order timing strategy is IOC or FOK |\n| hidden | boolean | Hidden or not (not shown in order book) |\n| iceberg | boolean | Whether or not only visible portions of orders are shown in iceberg orders |\n| visibleSize | string | Maximum visible quantity in iceberg orders |\n| cancelAfter | integer | Cancel after n seconds,the order timing strategy is GTT |\n| funds | string | When **type** is market, select one out of two: size or funds |\n| tradeType | string | The type of trading : **TRADE**(Spot Trade), **MARGIN_TRADE** (Margin Trade). Default is **TRADE**. **Note: To improve the system performance and to accelerate order placing and processing, KuCoin has added a new interface for order placing of margin. For traders still using the current interface, please move to the new one as soon as possible. The current one will no longer accept margin orders by May 1st, 2021 (UTC). At the time, KuCoin will notify users via the announcement, please pay attention to it.** |\n\n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| orderId | string | The unique order id generated by the trading system,which can be used later for further actions such as canceling the order. |\n\n---\n", - "body": { - "mode": "raw", - "raw": "//limit order\n{\n \"type\": \"limit\",\n \"symbol\": \"BTC-USDT\",\n \"side\": \"buy\",\n \"price\": \"50000\",\n \"size\": \"0.00001\",\n \"clientOid\": \"5c52e11203aa677f33e493fb\",\n \"remark\": \"order remarks\"\n}\n\n//market order 1\n// {\n// \"type\": \"market\",\n// \"symbol\": \"BTC-USDT\",\n// \"side\": \"buy\",\n// \"size\": \"0.00001\",\n// \"clientOid\": \"5c52e11203aa677f33e493fc\",\n// \"remark\": \"order remarks\"\n// }\n\n//market order 2\n// {\n// \"type\": \"market\",\n// \"symbol\": \"BTC-USDT\",\n// \"side\": \"buy\",\n// \"funds\": \"1\",\n// \"clientOid\": \"5c52e11203aa677f33e493fc\",\n// \"remark\": \"order remarks\"\n// }\n", - "options": { - "raw": { - "language": "json" - } - } - } + "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470349)\n\n:::tip[]\nIt is recommended to use the **GET /api/v1/hf/orders/client-order/{clientOid}** endpoint instead of this endpoint\n:::\n\n:::info[Description]\nRequest via this interface to check the information of a single active order via clientOid. The system will prompt that the order does not exists if the order does not exist or has been settled.\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| id | string | |\n| symbol | string | |\n| opType | string | |\n| type | string | |\n| side | string | |\n| price | string | |\n| size | string | |\n| funds | string | |\n| dealFunds | string | |\n| dealSize | string | |\n| fee | string | |\n| feeCurrency | string | |\n| stp | string | |\n| stop | string | |\n| stopTriggered | boolean | |\n| stopPrice | string | |\n| timeInForce | string | |\n| postOnly | boolean | |\n| hidden | boolean | |\n| iceberg | boolean | |\n| visibleSize | string | |\n| cancelAfter | integer | |\n| channel | string | |\n| clientOid | string | |\n| remark | string | |\n| tags | string | |\n| isActive | boolean | |\n| cancelExist | boolean | |\n| createdAt | integer | |\n| tradeType | string | |\n\n---\n", + "body": {} }, "response": [ { "name": "Successful Response", "originalRequest": { - "method": "POST", + "method": "GET", "header": [], "url": { "raw": "", @@ -2266,7 +2168,9 @@ "path": [ "api", "v1", - "orders" + "order", + "client-order", + "{{clientOid}}" ], "query": [] } @@ -2301,14 +2205,14 @@ } ], "cookie": [], - "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"orderId\": \"674a8635b38d120007709c0f\"\n }\n}" + "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"id\": \"674a97dfef434f0007efc431\",\n \"symbol\": \"BTC-USDT\",\n \"opType\": \"DEAL\",\n \"type\": \"limit\",\n \"side\": \"buy\",\n \"price\": \"50000\",\n \"size\": \"0.0001\",\n \"funds\": \"0\",\n \"dealFunds\": \"0\",\n \"dealSize\": \"0\",\n \"fee\": \"0\",\n \"feeCurrency\": \"USDT\",\n \"stp\": \"\",\n \"stop\": \"\",\n \"stopTriggered\": false,\n \"stopPrice\": \"0\",\n \"timeInForce\": \"GTC\",\n \"postOnly\": false,\n \"hidden\": false,\n \"iceberg\": false,\n \"visibleSize\": \"0\",\n \"cancelAfter\": 0,\n \"channel\": \"API\",\n \"clientOid\": \"3d07008668054da6b3cb12e432c2b13a\",\n \"remark\": null,\n \"tags\": null,\n \"isActive\": false,\n \"cancelExist\": true,\n \"createdAt\": 1732941791518,\n \"tradeType\": \"TRADE\"\n }\n}" } ] }, { - "name": "Batch Add Orders - Old", + "name": "Get Trade History - Old", "request": { - "method": "POST", + "method": "GET", "header": [], "url": { "raw": "", @@ -2319,27 +2223,64 @@ "path": [ "api", "v1", - "orders", - "multi" + "fills" ], - "query": [] - }, - "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470342)\n\n:::tip[]\nIt is recommended to use the **POST /api/v1/hf/orders/multi** endpoint instead of this endpoint\n:::\n\n:::info[Description]\nRequest via this endpoint to place 5 orders at the same time. The order type must be a limit order of the same symbol.\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| orderList | array | Refer to the schema section of orderList |\n| symbol | string | |\n\n**root.orderList Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| clientOid | string | Client Order Id,The ClientOid field is a unique ID created by the user(we recommend using a UUID), and can only contain numbers, letters, underscores (_), and hyphens (-). This field is returned when order information is obtained. You can use clientOid to tag your orders. ClientOid is different from the order ID created by the service provider. Please do not initiate requests using the same clientOid. The maximum length for the ClientOid is 40 characters.

Please remember the orderId created by the service provider, it used to check for updates in order status. |\n| side | string | specify if the order is to 'buy' or 'sell' |\n| symbol | string | symbol |\n| type | string | only limit (default is limit) |\n| remark | string | Order placement remarks, length cannot exceed 20 characters (ASCII) |\n| stp | string | [Self Trade Prevention](https://www.kucoin.com/docs-new/doc-338146) is divided into four strategies: CN, CO, CB , and DC |\n| price | string | Specify price for order

When placing a limit order, the price must be based on priceIncrement for the trading pair. The price increment (priceIncrement) is the price precision for the trading pair. For example, for the BTC-USDT trading pair, the priceIncrement is 0.00001000. So the price for your orders cannot be less than 0.00001000 and must be a multiple of priceIncrement. Otherwise, the order will return an invalid priceIncrement error. |\n| size | string | Specify quantity for order

When **type** is limit, size refers to the amount of trading targets (the asset name written in front) for the trading pair. Teh Size must be based on the baseIncrement of the trading pair. The baseIncrement represents the precision for the trading pair. The size of an order must be a positive-integer multiple of baseIncrement and must be between baseMinSize and baseMaxSize.

When **type** is market, select one out of two: size or funds |\n| timeInForce | string | [Time in force](https://www.kucoin.com/docs-new/doc-338146) is a special strategy used during trading |\n| postOnly | boolean | passive order labels, this is disabled when the order timing strategy is IOC or FOK |\n| hidden | boolean | Hidden or not (not shown in order book) |\n| iceberg | boolean | Whether or not only visible portions of orders are shown in iceberg orders |\n| visibleSize | string | Maximum visible quantity in iceberg orders |\n| cancelAfter | integer | Cancel after n seconds,the order timing strategy is GTT |\n| tradeType | string | The type of trading : **TRADE**(Spot Trade) |\n| stop | string | Either loss or entry. Requires stopPrice to be defined |\n| stopPrice | string | Stop price, Need to be defined if stop is specified. |\n\n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| data | array | Refer to the schema section of data |\n\n**root.data.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| symbol | string | |\n| type | string | |\n| side | string | |\n| price | string | |\n| size | string | |\n| funds | string | |\n| stp | string | |\n| stop | string | |\n| stopPrice | string | |\n| timeInForce | string | |\n| cancelAfter | integer | |\n| postOnly | boolean | |\n| hidden | boolean | |\n| iceberge | boolean | |\n| iceberg | boolean | |\n| visibleSize | string | |\n| channel | string | |\n| id | string | |\n| status | string | |\n| failMsg | string | |\n| clientOid | string | |\n\n---\n", - "body": { - "mode": "raw", - "raw": "{\n \"symbol\": \"BTC-USDT\",\n \"orderList\": [\n {\n \"clientOid\": \"3d07008668054da6b3cb12e432c2b13a\",\n \"side\": \"buy\",\n \"type\": \"limit\",\n \"price\": \"50000\",\n \"size\": \"0.0001\"\n },\n {\n \"clientOid\": \"37245dbe6e134b5c97732bfb36cd4a9d\",\n \"side\": \"buy\",\n \"type\": \"limit\",\n \"price\": \"49999\",\n \"size\": \"0.0001\"\n }\n ]\n}", - "options": { - "raw": { - "language": "json" + "query": [ + { + "key": "symbol", + "value": "BTC-USDT", + "description": "symbol" + }, + { + "key": "orderId", + "value": null, + "description": "The unique order id generated by the trading system (If orderId is specified,please ignore the other query parameters)" + }, + { + "key": "side", + "value": null, + "description": "specify if the order is to 'buy' or 'sell'" + }, + { + "key": "type", + "value": null, + "description": "limit, market, limit_stop or market_stop\n" + }, + { + "key": "tradeType", + "value": null, + "description": "The type of trading:TRADE - Spot Trading(TRADE as default), MARGIN_TRADE - Cross Margin Trading, MARGIN_ISOLATED_TRADE - Isolated Margin Trading." + }, + { + "key": "startAt", + "value": "1728663338000", + "description": "Start time (milisecond)" + }, + { + "key": "endAt", + "value": "1728692138000", + "description": "End time (milisecond)" + }, + { + "key": "currentPage", + "value": null, + "description": "Current request page." + }, + { + "key": "pageSize", + "value": null, + "description": "Number of results per request. Minimum is 10, maximum is 500." } - } - } + ] + }, + "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470350)\n\n:::tip[]\nIt is recommended to use the **GET /api/v1/hf/fills** endpoint instead of this endpoint\n:::\n\n:::info[Description]\nRequest via this endpoint to get the recent fills.\nThe return value is the data after Pagination, sorted in descending order according to time.\n:::\n\n:::tip[Tips]\nThe system allows you to retrieve data up to one week (start from the last day by default). If the time period of the queried data exceeds one week (time range from the start time to end time exceeded 7*24 hours), the system will prompt to remind you that you have exceeded the time limit. If you only specified the start time, the system will automatically calculate the end time (end time = start time + 7 * 24 hours). On the contrary, if you only specified the end time, the system will calculate the start time (start time= end time - 7 * 24 hours) the same way.\n\nThe total number of items retrieved cannot exceed 50,000. If it is exceeded, please shorten the query time range.\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| currentPage | integer | |\n| pageSize | integer | |\n| totalNum | integer | |\n| totalPage | integer | |\n| items | array | Refer to the schema section of items |\n\n**root.data.items Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| symbol | string | symbol |\n| tradeId | string | |\n| orderId | string | The unique order id generated by the trading system |\n| counterOrderId | string | Counterparty order Id |\n| side | string | Buy or sell |\n| liquidity | string | Liquidity type: taker or maker |\n| forceTaker | boolean | |\n| price | string | Order price |\n| size | string | Order size |\n| funds | string | Order Funds |\n| fee | string | [Handling fees](https://www.kucoin.com/docs-new/api-5327739) |\n| feeRate | string | Fee rate
|\n| feeCurrency | string | currency used to calculate trading fee |\n| stop | string | Take Profit and Stop Loss type, currently HFT does not support the Take Profit and Stop Loss type, so it is empty |\n| tradeType | string | Trade type, redundancy param |\n| type | string | Specify if the order is an 'limit' order or 'market' order. |\n| createdAt | integer | |\n\n---\n", + "body": {} }, "response": [ { "name": "Successful Response", "originalRequest": { - "method": "POST", + "method": "GET", "header": [], "url": { "raw": "", @@ -2350,10 +2291,55 @@ "path": [ "api", "v1", - "orders", - "multi" + "fills" ], - "query": [] + "query": [ + { + "key": "symbol", + "value": "BTC-USDT", + "description": "symbol" + }, + { + "key": "orderId", + "value": null, + "description": "The unique order id generated by the trading system (If orderId is specified,please ignore the other query parameters)" + }, + { + "key": "side", + "value": null, + "description": "specify if the order is to 'buy' or 'sell'" + }, + { + "key": "type", + "value": null, + "description": "limit, market, limit_stop or market_stop\n" + }, + { + "key": "tradeType", + "value": null, + "description": "The type of trading:TRADE - Spot Trading(TRADE as default), MARGIN_TRADE - Cross Margin Trading, MARGIN_ISOLATED_TRADE - Isolated Margin Trading." + }, + { + "key": "startAt", + "value": "1728663338000", + "description": "Start time (milisecond)" + }, + { + "key": "endAt", + "value": "1728692138000", + "description": "End time (milisecond)" + }, + { + "key": "currentPage", + "value": null, + "description": "Current request page." + }, + { + "key": "pageSize", + "value": null, + "description": "Number of results per request. Minimum is 10, maximum is 500." + } + ] } }, "status": "OK", @@ -2386,14 +2372,14 @@ } ], "cookie": [], - "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"data\": [\n {\n \"symbol\": \"BTC-USDT\",\n \"type\": \"limit\",\n \"side\": \"buy\",\n \"price\": \"50000\",\n \"size\": \"0.0001\",\n \"funds\": null,\n \"stp\": \"\",\n \"stop\": \"\",\n \"stopPrice\": null,\n \"timeInForce\": \"GTC\",\n \"cancelAfter\": 0,\n \"postOnly\": false,\n \"hidden\": false,\n \"iceberge\": false,\n \"iceberg\": false,\n \"visibleSize\": null,\n \"channel\": \"API\",\n \"id\": \"674a97dfef434f0007efc431\",\n \"status\": \"success\",\n \"failMsg\": null,\n \"clientOid\": \"3d07008668054da6b3cb12e432c2b13a\"\n },\n {\n \"symbol\": \"BTC-USDT\",\n \"type\": \"limit\",\n \"side\": \"buy\",\n \"price\": \"49999\",\n \"size\": \"0.0001\",\n \"funds\": null,\n \"stp\": \"\",\n \"stop\": \"\",\n \"stopPrice\": null,\n \"timeInForce\": \"GTC\",\n \"cancelAfter\": 0,\n \"postOnly\": false,\n \"hidden\": false,\n \"iceberge\": false,\n \"iceberg\": false,\n \"visibleSize\": null,\n \"channel\": \"API\",\n \"id\": \"674a97dffb378b00077b9c20\",\n \"status\": \"fail\",\n \"failMsg\": \"Balance insufficient!\",\n \"clientOid\": \"37245dbe6e134b5c97732bfb36cd4a9d\"\n }\n ]\n }\n}" + "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"currentPage\": 1,\n \"pageSize\": 50,\n \"totalNum\": 1,\n \"totalPage\": 1,\n \"items\": [\n {\n \"symbol\": \"DOGE-USDT\",\n \"tradeId\": \"10862827223795713\",\n \"orderId\": \"6745698ef4f1200007c561a8\",\n \"counterOrderId\": \"6745695ef15b270007ac5076\",\n \"side\": \"buy\",\n \"liquidity\": \"taker\",\n \"forceTaker\": false,\n \"price\": \"0.40739\",\n \"size\": \"10\",\n \"funds\": \"4.0739\",\n \"fee\": \"0.0040739\",\n \"feeRate\": \"0.001\",\n \"feeCurrency\": \"USDT\",\n \"stop\": \"\",\n \"tradeType\": \"TRADE\",\n \"type\": \"market\",\n \"createdAt\": 1732602254928\n }\n ]\n }\n}" } ] }, { - "name": "Add Order Test - Old", + "name": "Get Recent Trade History - Old", "request": { - "method": "POST", + "method": "GET", "header": [], "url": { "raw": "", @@ -2404,27 +2390,30 @@ "path": [ "api", "v1", - "orders", - "test" + "limit", + "fills" ], - "query": [] - }, - "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470341)\n\n:::tip[]\nIt is recommended to use the **POST /api/v1/hf/orders/test** endpoint instead of this endpoint\n:::\n\n:::info[Description]\nOrder test endpoint, the request parameters and return parameters of this endpoint are exactly the same as the order endpoint, and can be used to verify whether the signature is correct and other operations. After placing an order, the order will not enter the matching system, and the order cannot be queried.\n:::\n\n:::tip[Tips]\nPlease note that once your order enters the order book, the system will freeze the handling fees for the order ahead of time.\n\nBefore placing orders, please be sure to fully understand the meaning of the parameters for each trading pair.\n:::\n\n:::tip[Tips]\nThe maximum number of active orders per account is 2000, with a maximum of 200 active orders per trading pair.(including stop orders).\n:::\n\n**Public order placement request parameters**\n\n| Param | Type | Mandatory | Description |\n| --------- | ------ | --------- | ----------- |\n| clientOid | String | Yes | clientOid, the unique identifier created by the client, use of UUID, with a maximum length of 128 bits. |\n| side | String | Yes | **buy** or **sell** |\n| symbol | String | Yes | symbol, e.g. ETH-BTC |\n| type | String | No | **limit** or **market** (default is **limit**) |\n| remark | String | No | remark, length cannot exceed 50 characters (ASCII) |\n| stp | String | No | self trade prevention, **CN**, **CO**, **CB** or **DC** |\n| tradeType | String | No | The type of trading : **TRADE**(Spot Trade), **MARGIN_TRADE** (Margin Trade). Default is **TRADE**. **Note: To improve the system performance and to accelerate order placing and processing, KuCoin has added a new interface for order placing of margin. For traders still using the current interface, please move to the new one as soon as possible. The current one will no longer accept margin orders by May 1st, 2021 (UTC). At the time, KuCoin will notify users via the announcement, please pay attention to it.** |\n\n##### Additional Request Parameters Required by `limit` Orders\n\n| Param | Type | Mandatory | Description |\n| ----------- | ------- | --------- | ------------ |\n| price | String | Yes | Specify price for currency |\n| size | String | Yes | Specify quantity for currency |\n| timeInForce | String | No | Order timing strategy `GTC`, `GTT`, `IOC`, `FOK` (The default is `GTC`) |\n| cancelAfter | long | No | Cancel after `n` seconds,the order timing strategy is `GTT` |\n| postOnly | boolean | No | passive order labels, this is disabled when the order timing strategy is `IOC` or `FOK` |\n| hidden | boolean | No | Hidden or not (not shown in order book) |\n| iceberg | boolean | No | Whether or not only visible portions of orders are shown in iceberg orders |\n| visibleSize | String | No | Maximum visible quantity in iceberg orders |\n\n##### Additional request parameters required by `market` orders\n\n| Param | Type | Mandatory | Description |\n| ----- | ------ | --------- | ------------------------------------------ |\n| size | String | No | (Select one out of two: `size` or `funds`) |\n| funds | String | No | (Select one out of two: `size` or `funds`) |\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| clientOid | string | Client Order Id,The ClientOid field is a unique ID created by the user(we recommend using a UUID), and can only contain numbers, letters, underscores (_), and hyphens (-). This field is returned when order information is obtained. You can use clientOid to tag your orders. ClientOid is different from the order ID created by the service provider. Please do not initiate requests using the same clientOid. The maximum length for the ClientOid is 40 characters.

Please remember the orderId created by the service provider, it used to check for updates in order status. |\n| side | string | specify if the order is to 'buy' or 'sell' |\n| symbol | string | symbol |\n| type | string | specify if the order is an 'limit' order or 'market' order.

The type of order you specify when you place your order determines whether or not you need to request other parameters and also affects the execution of the matching engine.

When placing a limit order, you must specify a price and size. The system will try to match the order according to market price or a price better than market price. If the order cannot be immediately matched, it will stay in the order book until it is matched or the user cancels.

Unlike limit orders, the price for market orders fluctuates with market prices. When placing a market order, you do not need to specify a price, you only need to specify a quantity. Market orders are filled immediately and will not enter the order book. All market orders are takers and a taker fee will be charged. |\n| remark | string | Order placement remarks, length cannot exceed 20 characters (ASCII) |\n| stp | string | [Self Trade Prevention](https://www.kucoin.com/docs-new/doc-338146) is divided into four strategies: CN, CO, CB , and DC |\n| price | string | Specify price for order

When placing a limit order, the price must be based on priceIncrement for the trading pair. The price increment (priceIncrement) is the price precision for the trading pair. For example, for the BTC-USDT trading pair, the priceIncrement is 0.00001000. So the price for your orders cannot be less than 0.00001000 and must be a multiple of priceIncrement. Otherwise, the order will return an invalid priceIncrement error. |\n| size | string | Specify quantity for order

When **type** is limit, size refers to the amount of trading targets (the asset name written in front) for the trading pair. Teh Size must be based on the baseIncrement of the trading pair. The baseIncrement represents the precision for the trading pair. The size of an order must be a positive-integer multiple of baseIncrement and must be between baseMinSize and baseMaxSize.

When **type** is market, select one out of two: size or funds |\n| timeInForce | string | [Time in force](https://www.kucoin.com/docs-new/doc-338146) is a special strategy used during trading |\n| postOnly | boolean | passive order labels, this is disabled when the order timing strategy is IOC or FOK |\n| hidden | boolean | Hidden or not (not shown in order book) |\n| iceberg | boolean | Whether or not only visible portions of orders are shown in iceberg orders |\n| visibleSize | string | Maximum visible quantity in iceberg orders |\n| cancelAfter | integer | Cancel after n seconds,the order timing strategy is GTT |\n| funds | string | When **type** is market, select one out of two: size or funds |\n| tradeType | string | The type of trading : **TRADE**(Spot Trade), **MARGIN_TRADE** (Margin Trade). Default is **TRADE**. **Note: To improve the system performance and to accelerate order placing and processing, KuCoin has added a new interface for order placing of margin. For traders still using the current interface, please move to the new one as soon as possible. The current one will no longer accept margin orders by May 1st, 2021 (UTC). At the time, KuCoin will notify users via the announcement, please pay attention to it.** |\n\n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| orderId | string | The unique order id generated by the trading system,which can be used later for further actions such as canceling the order. |\n\n---\n", - "body": { - "mode": "raw", - "raw": "//limit order\n{\n \"type\": \"limit\",\n \"symbol\": \"BTC-USDT\",\n \"side\": \"buy\",\n \"price\": \"50000\",\n \"size\": \"0.00001\",\n \"clientOid\": \"5c52e11203aa677f33e493fb\",\n \"remark\": \"order remarks\"\n}\n\n//market order 1\n// {\n// \"type\": \"market\",\n// \"symbol\": \"BTC-USDT\",\n// \"side\": \"buy\",\n// \"size\": \"0.00001\",\n// \"clientOid\": \"5c52e11203aa677f33e493fc\",\n// \"remark\": \"order remarks\"\n// }\n\n//market order 2\n// {\n// \"type\": \"market\",\n// \"symbol\": \"BTC-USDT\",\n// \"side\": \"buy\",\n// \"funds\": \"1\",\n// \"clientOid\": \"5c52e11203aa677f33e493fc\",\n// \"remark\": \"order remarks\"\n// }\n", - "options": { - "raw": { - "language": "json" + "query": [ + { + "key": "currentPage", + "value": null, + "description": "Current request page." + }, + { + "key": "pageSize", + "value": null, + "description": "Number of results per request. Minimum is 10, maximum is 500." } - } - } + ] + }, + "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470351)\n\n:::tip[]\nIt is recommended to use the **GET /api/v1/hf/fills** endpoint instead of this endpoint\n:::\n\n:::info[Description]\nRequest via this endpoint to get a list of 1000 fills in the last 24 hours. The return value is the data after Pagination, sorted in descending order according to time.\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | array | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| symbol | string | |\n| tradeId | string | |\n| orderId | string | |\n| counterOrderId | string | |\n| side | string | |\n| liquidity | string | |\n| forceTaker | boolean | |\n| price | string | |\n| size | string | |\n| funds | string | |\n| fee | string | |\n| feeRate | string | |\n| feeCurrency | string | |\n| stop | string | |\n| tradeType | string | |\n| type | string | |\n| createdAt | integer | |\n\n---\n", + "body": {} }, "response": [ { "name": "Successful Response", "originalRequest": { - "method": "POST", + "method": "GET", "header": [], "url": { "raw": "", @@ -2435,10 +2424,21 @@ "path": [ "api", "v1", - "orders", - "test" + "limit", + "fills" ], - "query": [] + "query": [ + { + "key": "currentPage", + "value": null, + "description": "Current request page." + }, + { + "key": "pageSize", + "value": null, + "description": "Number of results per request. Minimum is 10, maximum is 500." + } + ] } }, "status": "OK", @@ -2471,7 +2471,7 @@ } ], "cookie": [], - "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"orderId\": \"674a8776291d9e00074f1edf\"\n }\n}" + "body": "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"symbol\": \"BTC-USDT\",\n \"tradeId\": \"11732720444522497\",\n \"orderId\": \"674aab24754b1e00077dbc69\",\n \"counterOrderId\": \"674aab1fb26bfb0007a18b67\",\n \"side\": \"buy\",\n \"liquidity\": \"taker\",\n \"forceTaker\": false,\n \"price\": \"96999.6\",\n \"size\": \"0.00001\",\n \"funds\": \"0.969996\",\n \"fee\": \"0.000969996\",\n \"feeRate\": \"0.001\",\n \"feeCurrency\": \"USDT\",\n \"stop\": \"\",\n \"tradeType\": \"TRADE\",\n \"type\": \"limit\",\n \"createdAt\": 1732946724082\n }\n ]\n}" } ] } @@ -3106,7 +3106,7 @@ "type": "text/javascript", "packages": {}, "exec": [ - "function extractPathVariable(str) {\n const regex = /^\\{\\{(.+?)\\}\\}$/;\n const match = str.match(regex);\n if (match) {\n return match[1];\n }\n return null;\n}\n\nfunction hasAnyFieldEmpty(obj) {\n for (const key in obj) {\n if (obj[key] === \"\" || obj[key] === null || obj[key] === undefined) {\n return true;\n }\n }\n return false;\n}\n\nfunction sign(text, secret) {\n const hash = CryptoJS.HmacSHA256(text, secret);\n return CryptoJS.enc.Base64.stringify(hash)\n}\n\nfunction auth(apiKey, method, url, data) {\n if (hasAnyFieldEmpty(apiKey)) {\n console.warn('The API key-related information is not configured; only the public channel API is accessible.')\n return {'User-Agent': `Kucoin-Universal-Postman-SDK/`}\n }\n\n const timestamp = Date.now();\n const text = timestamp + method.toUpperCase() + url + data;\n const signature = sign(text, apiKey.secret);\n return {\n 'KC-API-KEY': apiKey.key,\n 'KC-API-SIGN': signature,\n 'KC-API-TIMESTAMP': timestamp.toString(),\n 'KC-API-PASSPHRASE': sign(apiKey.passphrase || '', apiKey.secret),\n 'Content-Type': 'application/json',\n 'User-Agent': `Kucoin-Universal-Postman-SDK/`,\n 'KC-API-KEY-VERSION': 2,\n };\n}\n\nlet key = pm.environment.get('API_KEY')\nlet secret = pm.environment.get('API_SECRET')\nlet passphrase = pm.environment.get('API_PASSPHRASE')\n\nlet url = pm.request.url.getPathWithQuery()\nlet method = pm.request.method\nlet body = pm.request.body ? pm.request.body.toString() : ''\n\nfor (const index in pm.request.url.path) {\n path = pm.request.url.path[index]\n pathVar = extractPathVariable(path)\n if (pathVar != null) {\n let collectionVariable = pm.collectionVariables.get(pathVar);\n if (collectionVariable != null) {\n url = url.replace(path, collectionVariable)\n } else {\n console.warn('no path variable set: ' + path)\n }\n }\n}\n\nheader = auth({ key: key, passphrase: passphrase, secret: secret }, method, url, body)\n\nfor (const [headerName, headerValue] of Object.entries(header)) {\n pm.request.headers.add({ key: headerName, value: headerValue })\n}" + "function extractPathVariable(str) {\n const regex = /^\\{\\{(.+?)\\}\\}$/;\n const match = str.match(regex);\n if (match) {\n return match[1];\n }\n return null;\n}\n\nfunction hasAnyFieldEmpty(obj) {\n for (const key in obj) {\n if (obj[key] === \"\" || obj[key] === null || obj[key] === undefined) {\n return true;\n }\n }\n return false;\n}\n\nfunction sign(text, secret) {\n const hash = CryptoJS.HmacSHA256(text, secret);\n return CryptoJS.enc.Base64.stringify(hash)\n}\n\nfunction auth(apiKey, method, url, data) {\n if (hasAnyFieldEmpty(apiKey)) {\n console.warn('The API key-related information is not configured; only the public channel API is accessible.')\n return {'User-Agent': `Kucoin-Universal-Postman-SDK/v1.0.0`}\n }\n\n const timestamp = Date.now();\n const text = timestamp + method.toUpperCase() + url + data;\n const signature = sign(text, apiKey.secret);\n return {\n 'KC-API-KEY': apiKey.key,\n 'KC-API-SIGN': signature,\n 'KC-API-TIMESTAMP': timestamp.toString(),\n 'KC-API-PASSPHRASE': sign(apiKey.passphrase || '', apiKey.secret),\n 'Content-Type': 'application/json',\n 'User-Agent': `Kucoin-Universal-Postman-SDK/v1.0.0`,\n 'KC-API-KEY-VERSION': 2,\n };\n}\n\nlet key = pm.environment.get('API_KEY')\nlet secret = pm.environment.get('API_SECRET')\nlet passphrase = pm.environment.get('API_PASSPHRASE')\n\nlet url = pm.request.url.getPathWithQuery()\nlet method = pm.request.method\nlet body = pm.request.body ? pm.request.body.toString() : ''\n\nfor (const index in pm.request.url.path) {\n path = pm.request.url.path[index]\n pathVar = extractPathVariable(path)\n if (pathVar != null) {\n let collectionVariable = pm.collectionVariables.get(pathVar);\n if (collectionVariable != null) {\n url = url.replace(path, collectionVariable)\n } else {\n console.warn('no path variable set: ' + path)\n }\n }\n}\n\nheader = auth({ key: key, passphrase: passphrase, secret: secret }, method, url, body)\n\nfor (const [headerName, headerValue] of Object.entries(header)) {\n pm.request.headers.add({ key: headerName, value: headerValue })\n}" ] } }, diff --git a/sdk/postman/collection-REST.json b/sdk/postman/collection-REST.json index 9baf32ca..e74e73f6 100644 --- a/sdk/postman/collection-REST.json +++ b/sdk/postman/collection-REST.json @@ -88,7 +88,7 @@ ] }, { - "name": "Get Account Type - Spot ", + "name": "Get Apikey Info", "request": { "method": "GET", "header": [], @@ -101,13 +101,12 @@ "path": [ "api", "v1", - "hf", - "accounts", - "opened" + "user", + "api-key" ], "query": [] }, - "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470120)\n\n:::info[Description]\nThis interface determines whether the current user is a spot high-frequency user or a spot low-frequency user.\n:::\n\n:::tip[Tips]\nThis interface is a compatibility interface left over from the old version upgrade. Only some old users need to use it (high frequency will be opened before 2024 and trade_hf has been used). Most user do not need to use this interface. When the return is true, you need to use trade_hf to transfer assets and query assets When the return is false, you need to use trade to transfer assets and query assets.\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | boolean | Spot account type. True means the current user is a high-frequency spot user, False means the current user is a low-frequency spot user |\n\n---\n", + "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470130)\n\n:::info[Description]\nGet the information of the api key. Use the api key pending to be checked to call the endpoint. Both master and sub user's api key are applicable.\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| remark | string | Remarks |\n| apiKey | string | Apikey |\n| apiVersion | integer | API Version |\n| permission | string | [Permissions](https://www.kucoin.com/docs-new/doc-338144), possible values: General, Spot, Margin, Futures, InnerTransfer, Transfer, Earn |\n| ipWhitelist | string | IP whitelist

|\n| createdAt | integer | Apikey create time |\n| uid | integer | Account UID |\n| isMaster | boolean | Whether it is the master account. |\n| subName | string | Sub Name, There is no such param for the master account |\n\n---\n", "body": {} }, "response": [ @@ -125,9 +124,8 @@ "path": [ "api", "v1", - "hf", - "accounts", - "opened" + "user", + "api-key" ], "query": [] } @@ -162,12 +160,12 @@ } ], "cookie": [], - "body": "{\n \"code\": \"200000\",\n \"data\": false\n}" + "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"remark\": \"account1\",\n \"apiKey\": \"6705f5c311545b000157d3eb\",\n \"apiVersion\": 3,\n \"permission\": \"General,Futures,Spot,Earn,InnerTransfer,Transfer,Margin\",\n \"ipWhitelist\": \"203.**.154,103.**.34\",\n \"createdAt\": 1728443843000,\n \"uid\": 165111215,\n \"isMaster\": true\n }\n}" } ] }, { - "name": "Get Account Ledgers - Spot/Margin", + "name": "Get Account Type - Spot ", "request": { "method": "GET", "header": [], @@ -180,48 +178,13 @@ "path": [ "api", "v1", + "hf", "accounts", - "ledgers" + "opened" ], - "query": [ - { - "key": "currency", - "value": "BTC", - "description": "Currency ( you can choose more than one currency). You can specify 10 currencies at most for one time. If not specified, all currencies will be inquired by default." - }, - { - "key": "direction", - "value": "in", - "description": "direction: in, out" - }, - { - "key": "bizType", - "value": "TRANSFER", - "description": "Type: DEPOSIT -deposit, WITHDRAW -withdraw, TRANSFER -transfer, SUB_TRANSFER -subaccount transfer,TRADE_EXCHANGE -trade, MARGIN_EXCHANGE -margin trade, KUCOIN_BONUS -bonus, BROKER_TRANSFER -Broker transfer record" - }, - { - "key": "startAt", - "value": "1728663338000", - "description": "Start time (milisecond)" - }, - { - "key": "endAt", - "value": "1728692138000", - "description": "End time (milisecond)" - }, - { - "key": "currentPage", - "value": "1", - "description": "Current request page." - }, - { - "key": "pageSize", - "value": "50", - "description": "Number of results per request. Minimum is 10, maximum is 500." - } - ] + "query": [] }, - "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470121)\n\n:::info[Description]\nThis interface is for transaction records from all types of your accounts, supporting inquiry of various currencies. Items are paginated and sorted to show the latest first. See the Pagination section for retrieving additional entries after the first page.\n:::\n\n:::tip[Tips]\nthe start and end time range cannot exceed 24 hours. An error will occur if the specified time window exceeds the range. If you specify the end time only, the system will automatically calculate the start time as end time minus 24 hours, and vice versa.\n:::\n\n:::tip[Tips]\nSupport to obtain 1 year historical data, if need to obtain longer historical data, please submit a ticket: https://kucoin.zendesk.com/hc/en-us/requests/new\n:::\n\n**context**\n\nIf the returned value under bizType is “trade exchange”, the additional info. (such as order ID and trade ID, trading pair, etc.) of the trade will be returned in field context.\n\n**BizType Description**\n\n| Field | Description |\n| ------ | ---------- |\n| Assets Transferred in After Upgrading | Assets Transferred in After V1 to V2 Upgrading |\n| Deposit | Deposit |\n| Withdrawal | Withdrawal |\n| Transfer | Transfer |\n| Trade_Exchange | Trade |\n| Vote for Coin | Vote for Coin |\n| KuCoin Bonus | KuCoin Bonus |\n| Referral Bonus | Referral Bonus |\n| Rewards | Activities Rewards |\n| Distribution | Distribution, such as get GAS by holding NEO |\n| Airdrop/Fork | Airdrop/Fork |\n| Other rewards | Other rewards, except Vote, Airdrop, Fork |\n| Fee Rebate | Fee Rebate |\n| Buy Crypto | Use credit card to buy crypto |\n| Sell Crypto | Use credit card to sell crypto |\n| Public Offering Purchase | Public Offering Purchase for Spotlight |\n| Send red envelope | Send red envelope |\n| Open red envelope | Open red envelope |\n| Staking | Staking |\n| LockDrop Vesting | LockDrop Vesting |\n| Staking Profits | Staking Profits |\n| Redemption | Redemption |\n| Refunded Fees | Refunded Fees |\n| KCS Pay Fees | KCS Pay Fees |\n| Margin Trade | Margin Trade |\n| Loans | Loans |\n| Borrowings | Borrowings |\n| Debt Repayment | Debt Repayment |\n| Loans Repaid | Loans Repaid |\n| Lendings | Lendings |\n| Pool transactions | Pool-X transactions |\n| Instant Exchange | Instant Exchange |\n| Sub Account Transfer | Sub-account transfer |\n| Liquidation Fees | Liquidation Fees |\n| Soft Staking Profits | Soft Staking Profits |\n| Voting Earnings | Voting Earnings on Pool-X |\n| Redemption of Voting | Redemption of Voting on Pool-X |\n| Convert to KCS | Convert to KCS |\n| BROKER_TRANSFER | Broker transfer record |\n\n\n\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| currentPage | integer | current page |\n| pageSize | integer | page size |\n| totalNum | integer | total number |\n| totalPage | integer | total page |\n| items | array | Refer to the schema section of items |\n\n**root.data.items Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| id | string | unique id |\n| currency | string | The currency of an account |\n| amount | string | The total amount of assets (fees included) involved in assets changes such as transaction, withdrawal and bonus distribution. |\n| fee | string | Fees generated in transaction, withdrawal, etc. |\n| balance | string | Remaining funds after the transaction. |\n| accountType | string | The account type of the master user: MAIN, TRADE, MARGIN or CONTRACT. |\n| bizType | string | Business type leading to the changes in funds, such as exchange, withdrawal, deposit, KUCOIN_BONUS, REFERRAL_BONUS, Lendings etc. |\n| direction | string | Side, out or in |\n| createdAt | integer | Time of the event |\n| context | string | Business related information such as order ID, serial No., etc. |\n\n---\n", + "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470120)\n\n:::info[Description]\nThis interface determines whether the current user is a spot high-frequency user or a spot low-frequency user.\n:::\n\n:::tip[Tips]\nThis interface is a compatibility interface left over from the old version upgrade. Only some old users need to use it (high frequency will be opened before 2024 and trade_hf has been used). Most user do not need to use this interface. When the return is true, you need to use trade_hf to transfer assets and query assets When the return is false, you need to use trade to transfer assets and query assets.\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | boolean | Spot account type. True means the current user is a high-frequency spot user, False means the current user is a low-frequency spot user |\n\n---\n", "body": {} }, "response": [ @@ -239,46 +202,11 @@ "path": [ "api", "v1", + "hf", "accounts", - "ledgers" + "opened" ], - "query": [ - { - "key": "currency", - "value": "BTC", - "description": "Currency ( you can choose more than one currency). You can specify 10 currencies at most for one time. If not specified, all currencies will be inquired by default." - }, - { - "key": "direction", - "value": "in", - "description": "direction: in, out" - }, - { - "key": "bizType", - "value": "TRANSFER", - "description": "Type: DEPOSIT -deposit, WITHDRAW -withdraw, TRANSFER -transfer, SUB_TRANSFER -subaccount transfer,TRADE_EXCHANGE -trade, MARGIN_EXCHANGE -margin trade, KUCOIN_BONUS -bonus, BROKER_TRANSFER -Broker transfer record" - }, - { - "key": "startAt", - "value": "1728663338000", - "description": "Start time (milisecond)" - }, - { - "key": "endAt", - "value": "1728692138000", - "description": "End time (milisecond)" - }, - { - "key": "currentPage", - "value": "1", - "description": "Current request page." - }, - { - "key": "pageSize", - "value": "50", - "description": "Number of results per request. Minimum is 10, maximum is 500." - } - ] + "query": [] } }, "status": "OK", @@ -311,12 +239,12 @@ } ], "cookie": [], - "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"currentPage\": 1,\n \"pageSize\": 50,\n \"totalNum\": 1,\n \"totalPage\": 1,\n \"items\": [\n {\n \"id\": \"265329987780896\",\n \"currency\": \"USDT\",\n \"amount\": \"0.01\",\n \"fee\": \"0\",\n \"balance\": \"0\",\n \"accountType\": \"TRADE\",\n \"bizType\": \"SUB_TRANSFER\",\n \"direction\": \"out\",\n \"createdAt\": 1728658481484,\n \"context\": \"\"\n }\n ]\n }\n}" + "body": "{\n \"code\": \"200000\",\n \"data\": false\n}" } ] }, { - "name": "Get Account Ledgers - Trade_hf", + "name": "Get Account List - Spot", "request": { "method": "GET", "header": [], @@ -329,49 +257,22 @@ "path": [ "api", "v1", - "hf", - "accounts", - "ledgers" + "accounts" ], "query": [ { "key": "currency", - "value": "BTC", - "description": "Currency ( you can choose more than one currency). You can specify 10 currencies at most for one time. If not specified, all currencies will be inquired by default." - }, - { - "key": "direction", - "value": "in", - "description": "direction: in, out" - }, - { - "key": "bizType", - "value": "TRANSFER", - "description": "Transaction type: TRANSFER-transfer funds,TRADE_EXCHANGE-Trade" - }, - { - "key": "lastId", - "value": "254062248624417", - "description": "The id of the last set of data from the previous batch of data. By default, the latest information is given." - }, - { - "key": "limit", - "value": "100", - "description": "Default100,Max200" - }, - { - "key": "startAt", - "value": "1728663338000", - "description": "Start time (milisecond)" + "value": "USDT", + "description": "currency" }, { - "key": "endAt", - "value": "1728692138000", - "description": "End time (milisecond)" + "key": "type", + "value": "main", + "description": "Account type main、trade" } ] }, - "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470122)\n\n:::info[Description]\nThis API endpoint returns all transfer (in and out) records in high-frequency trading account and supports multi-coin queries. The query results are sorted in descending order by createdAt and id.\n:::\n\n\n\n:::tip[Tips]\nIf lastId is configured, the information obtained < lastId. Otherwise, it will go back to the latest information.\n\nYou can only obtain data from within a 3 _ 24 hour time range (i.e., from 3 _ 24 hours ago up to now) If you specify a time range that exceeds this limit, the system will default to data from within 3 * 24 hours.\n:::\n\n**context**\n\nIf the bizType is TRADE_EXCHANGE, the context field will include additional transaction information (order id, transaction id, and trading pair).\n\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | array | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| id | string | Unique id |\n| currency | string | currency |\n| amount | string | Change in funds balance |\n| fee | string | Deposit or withdrawal fee |\n| tax | string | |\n| balance | string | Total balance of funds after change |\n| accountType | string | Master account type TRADE_HF |\n| bizType | string | Trnasaction type,such as TRANSFER, TRADE_EXCHANGE, etc. |\n| direction | string | Direction of transfer( out or in) |\n| createdAt | string | Created time |\n| context | string | Core transaction parameter |\n\n---\n", + "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470125)\n\n:::info[Description]\nGet a list of accounts. Please Deposit to the main account firstly, then transfer the funds to the trade account via Inner Transfer before transaction.\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | array | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| id | string | Account ID |\n| currency | string | Currency |\n| type | string | Account type:,main、trade、isolated(abandon)、margin(abandon)
|\n| balance | string | Total funds in the account |\n| available | string | Funds available to withdraw or trade |\n| holds | string | Funds on hold (not available for use) |\n\n---\n", "body": {} }, "response": [ @@ -389,45 +290,18 @@ "path": [ "api", "v1", - "hf", - "accounts", - "ledgers" + "accounts" ], "query": [ { "key": "currency", - "value": "BTC", - "description": "Currency ( you can choose more than one currency). You can specify 10 currencies at most for one time. If not specified, all currencies will be inquired by default." - }, - { - "key": "direction", - "value": "in", - "description": "direction: in, out" - }, - { - "key": "bizType", - "value": "TRANSFER", - "description": "Transaction type: TRANSFER-transfer funds,TRADE_EXCHANGE-Trade" - }, - { - "key": "lastId", - "value": "254062248624417", - "description": "The id of the last set of data from the previous batch of data. By default, the latest information is given." - }, - { - "key": "limit", - "value": "100", - "description": "Default100,Max200" - }, - { - "key": "startAt", - "value": "1728663338000", - "description": "Start time (milisecond)" + "value": "USDT", + "description": "currency" }, { - "key": "endAt", - "value": "1728692138000", - "description": "End time (milisecond)" + "key": "type", + "value": "main", + "description": "Account type main、trade" } ] } @@ -462,12 +336,12 @@ } ], "cookie": [], - "body": "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"id\": \"254062248624417\",\n \"currency\": \"USDT\",\n \"amount\": \"1.59760080\",\n \"fee\": \"0.00159920\",\n \"tax\": \"0\",\n \"balance\": \"26.73759503\",\n \"accountType\": \"TRADE_HF\",\n \"bizType\": \"TRADE_EXCHANGE\",\n \"direction\": \"in\",\n \"createdAt\": \"1728443957539\",\n \"context\": \"{\\\"symbol\\\":\\\"KCS-USDT\\\",\\\"orderId\\\":\\\"6705f6350dc7210007d6a36d\\\",\\\"tradeId\\\":\\\"10046097631627265\\\"}\"\n }\n ]\n}" + "body": "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"id\": \"548674591753\",\n \"currency\": \"USDT\",\n \"type\": \"trade\",\n \"balance\": \"26.66759503\",\n \"available\": \"26.66759503\",\n \"holds\": \"0\"\n },\n {\n \"id\": \"63355cd156298d0001b66e61\",\n \"currency\": \"USDT\",\n \"type\": \"main\",\n \"balance\": \"0.01\",\n \"available\": \"0.01\",\n \"holds\": \"0\"\n }\n ]\n}" } ] }, { - "name": "Get Account Ledgers - Margin_hf", + "name": "Get Account Detail - Spot", "request": { "method": "GET", "header": [], @@ -479,51 +353,13 @@ ], "path": [ "api", - "v3", - "hf", - "margin", - "account", - "ledgers" + "v1", + "accounts", + "{{accountId}}" ], - "query": [ - { - "key": "currency", - "value": "BTC", - "description": "currency, optional,can select more than one,separate with commas,select no more than 10 currencys,the default will be to query for all currencys if left empty" - }, - { - "key": "direction", - "value": "in", - "description": "direction: in, out" - }, - { - "key": "bizType", - "value": "TRANSFER", - "description": "Transaction type: TRANSFER- transfer funds, MARGIN_EXCHANGE - cross margin trade, ISOLATED_EXCHANGE - isolated margin trade, LIQUIDATION - liquidation, ASSERT_RETURN - forced liquidation asset return" - }, - { - "key": "lastId", - "value": "254062248624417", - "description": "The id of the last set of data from the previous batch of data. By default, the latest information is given." - }, - { - "key": "limit", - "value": "100", - "description": "Default100,Max200" - }, - { - "key": "startAt", - "value": "1728663338000", - "description": "Start time (milisecond)" - }, - { - "key": "endAt", - "value": "1728692138000", - "description": "End time (milisecond)" - } - ] + "query": [] }, - "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470123)\n\n:::info[Description]\nThis API endpoint returns all transfer (in and out) records in high-frequency margin trading account and supports multi-coin queries. The query results are sorted in descending order by createdAt and id.\n:::\n\n\n:::tip[Tips]\nIf lastId is configured, the information obtained < lastId. Otherwise, it will go back to the latest information.\n\nYou can only obtain data from within a 3 _ 24 hour time range (i.e., from 3 _ 24 hours ago up to now) If you specify a time range that exceeds this limit, the system will default to data from within 3 * 24 hours.\n\nIf bizType is MARGIN_EXCHANGE or ISOLATED_EXCHANGE, the context field will contain additional information about the transaction (order id, transaction id, transaction pair).\n:::\n\n\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | array | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| id | integer | |\n| currency | string | currency |\n| amount | string | Change in funds balance |\n| fee | string | Deposit or withdrawal fee |\n| balance | string | Total balance of funds after change |\n| accountType | string | Master account type TRADE_HF |\n| bizType | string | Trnasaction type,such as TRANSFER, TRADE_EXCHANGE, etc. |\n| direction | string | Direction of transfer( out or in) |\n| createdAt | integer | Ledger creation time |\n| context | string | Core transaction parameter |\n| tax | string | |\n\n---\n", + "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470126)\n\n:::info[Description]\nget Information for a single spot account. Use this endpoint when you know the accountId.\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| currency | string | The currency of the account |\n| balance | string | Total funds in the account |\n| available | string | Funds available to withdraw or trade |\n| holds | string | Funds on hold (not available for use) |\n\n---\n", "body": {} }, "response": [ @@ -540,49 +376,11 @@ ], "path": [ "api", - "v3", - "hf", - "margin", - "account", - "ledgers" + "v1", + "accounts", + "{{accountId}}" ], - "query": [ - { - "key": "currency", - "value": "BTC", - "description": "currency, optional,can select more than one,separate with commas,select no more than 10 currencys,the default will be to query for all currencys if left empty" - }, - { - "key": "direction", - "value": "in", - "description": "direction: in, out" - }, - { - "key": "bizType", - "value": "TRANSFER", - "description": "Transaction type: TRANSFER- transfer funds, MARGIN_EXCHANGE - cross margin trade, ISOLATED_EXCHANGE - isolated margin trade, LIQUIDATION - liquidation, ASSERT_RETURN - forced liquidation asset return" - }, - { - "key": "lastId", - "value": "254062248624417", - "description": "The id of the last set of data from the previous batch of data. By default, the latest information is given." - }, - { - "key": "limit", - "value": "100", - "description": "Default100,Max200" - }, - { - "key": "startAt", - "value": "1728663338000", - "description": "Start time (milisecond)" - }, - { - "key": "endAt", - "value": "1728692138000", - "description": "End time (milisecond)" - } - ] + "query": [] } }, "status": "OK", @@ -615,12 +413,12 @@ } ], "cookie": [], - "body": "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"id\": 1949641706720,\n \"currency\": \"USDT\",\n \"amount\": \"0.01000000\",\n \"fee\": \"0.00000000\",\n \"balance\": \"0.01000000\",\n \"accountType\": \"MARGIN_V2\",\n \"bizType\": \"TRANSFER\",\n \"direction\": \"in\",\n \"createdAt\": 1728664091208,\n \"context\": \"{}\",\n \"tax\": \"0.00000000\"\n }\n ]\n}" + "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"currency\": \"USDT\",\n \"balance\": \"26.66759503\",\n \"available\": \"26.66759503\",\n \"holds\": \"0\"\n }\n}" } ] }, { - "name": "Get Account Ledgers - Futures", + "name": "Get Account - Cross Margin", "request": { "method": "GET", "header": [], @@ -628,52 +426,28 @@ "raw": "", "protocol": "https", "host": [ - "{{futures_endpoint}}" + "{{spot_endpoint}}" ], "path": [ "api", - "v1", - "transaction-history" + "v3", + "margin", + "accounts" ], "query": [ { - "key": "currency", - "value": "XBT", - "description": "Currency of transaction history, XBT or USDT" - }, - { - "key": "type", - "value": "Transferin", - "description": "Type RealisedPNL-Realised profit and loss, Deposit-Deposit, Withdrawal-withdraw, Transferin-Transfer in, TransferOut-Transfer out" - }, - { - "key": "offset", - "value": "254062248624417", - "description": "Start offset. Generally, the only attribute of the last returned result of the previous request is used, and the first page is returned by default" - }, - { - "key": "forward", - "value": "false", - "description": "This parameter functions to judge whether the lookup is forward or not. True means “yes” and False means “no”. This parameter is set as true by default" - }, - { - "key": "maxCount", - "value": "50", - "description": "Displayed size per page. The default size is 50" - }, - { - "key": "startAt", - "value": "1728663338000", - "description": "Start time (milisecond)" + "key": "quoteCurrency", + "value": "USDT", + "description": "quote currency, currently only supports USDT, KCS, BTC, USDT as default" }, { - "key": "endAt", - "value": "1728692138000", - "description": "End time (milisecond)" + "key": "queryType", + "value": "MARGIN", + "description": "Query account type (default MARGIN), MARGIN - only query low frequency cross margin account, MARGIN_V2-only query high frequency cross margin account, ALL - consistent aggregate query with the web side" } ] }, - "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470124)\n\n:::info[Description]\nThis interface can query the ledger records of the futures business line\n:::\n\n\n\n:::tip[Tips]\nIf there are open positions, the status of the first page returned will be Pending, indicating the realised profit and loss in the current 8-hour settlement period. Please specify the minimum offset number of the current page into the offset field to turn the page.\n:::\n\n:::tip[Tips]\nSupplementary instructions for startAt and endAt: startAt must be less than endAt; and the interval cannot exceed 1 day; only one field is allowed, and if only one field is passed, another field will be automatically added or subtracted by the system 1 day to complete\n:::\n\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| dataList | array | Refer to the schema section of dataList |\n| hasMore | boolean | Is it the last page. If it is false, it means it is the last page, and if it is true, it means need to turn the page. |\n\n**root.data.dataList Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| time | integer | ledger time |\n| type | string | Type: RealisedPNL, Deposit, Withdrawal, TransferIn, TransferOut |\n| amount | number | Transaction amount |\n| fee | number | Fee |\n| accountEquity | number | Account equity |\n| status | string | Status: Completed, Pending |\n| remark | string | Ticker symbol of the contract |\n| offset | integer | Offset |\n| currency | string | Currency |\n\n---\n", + "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470127)\n\n:::info[Description]\nRequest via this endpoint to get the info of the cross margin account.\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| totalAssetOfQuoteCurrency | string | Total Assets in Quote Currency |\n| totalLiabilityOfQuoteCurrency | string | Total Liability in Quote Currency |\n| debtRatio | string | debt ratio |\n| status | string | Position status; EFFECTIVE-effective, BANKRUPTCY-bankruptcy liquidation, LIQUIDATION-closing, REPAY-repayment, BORROW borrowing |\n| accounts | array | Refer to the schema section of accounts |\n\n**root.data.accounts Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| currency | string | currency |\n| total | string | Total Assets |\n| available | string | Account available assets (total assets - frozen) |\n| hold | string | Account frozen assets |\n| liability | string | Liabilities |\n| maxBorrowSize | string | The user's remaining maximum loan amount |\n| borrowEnabled | boolean | Support borrow or not |\n| transferInEnabled | boolean | Support transfer or not |\n\n---\n", "body": {} }, "response": [ @@ -686,48 +460,24 @@ "raw": "", "protocol": "https", "host": [ - "{{futures_endpoint}}" + "{{spot_endpoint}}" ], "path": [ "api", - "v1", - "transaction-history" + "v3", + "margin", + "accounts" ], "query": [ { - "key": "currency", - "value": "XBT", - "description": "Currency of transaction history, XBT or USDT" - }, - { - "key": "type", - "value": "Transferin", - "description": "Type RealisedPNL-Realised profit and loss, Deposit-Deposit, Withdrawal-withdraw, Transferin-Transfer in, TransferOut-Transfer out" - }, - { - "key": "offset", - "value": "254062248624417", - "description": "Start offset. Generally, the only attribute of the last returned result of the previous request is used, and the first page is returned by default" - }, - { - "key": "forward", - "value": "false", - "description": "This parameter functions to judge whether the lookup is forward or not. True means “yes” and False means “no”. This parameter is set as true by default" - }, - { - "key": "maxCount", - "value": "50", - "description": "Displayed size per page. The default size is 50" - }, - { - "key": "startAt", - "value": "1728663338000", - "description": "Start time (milisecond)" + "key": "quoteCurrency", + "value": "USDT", + "description": "quote currency, currently only supports USDT, KCS, BTC, USDT as default" }, { - "key": "endAt", - "value": "1728692138000", - "description": "End time (milisecond)" + "key": "queryType", + "value": "MARGIN", + "description": "Query account type (default MARGIN), MARGIN - only query low frequency cross margin account, MARGIN_V2-only query high frequency cross margin account, ALL - consistent aggregate query with the web side" } ] } @@ -762,12 +512,12 @@ } ], "cookie": [], - "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"dataList\": [\n {\n \"time\": 1728665747000,\n \"type\": \"TransferIn\",\n \"amount\": 0.01,\n \"fee\": 0.0,\n \"accountEquity\": 14.02924938,\n \"status\": \"Completed\",\n \"remark\": \"Transferred from High-Frequency Trading Account\",\n \"offset\": 51360793,\n \"currency\": \"USDT\"\n },\n {\n \"time\": 1728648000000,\n \"type\": \"RealisedPNL\",\n \"amount\": 0.00630042,\n \"fee\": 0.0,\n \"accountEquity\": 20.0,\n \"status\": \"Completed\",\n \"remark\": \"XBTUSDTM\",\n \"offset\": 51352430,\n \"currency\": \"USDT\"\n }\n ],\n \"hasMore\": false\n }\n}" + "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"totalAssetOfQuoteCurrency\": \"0.02\",\n \"totalLiabilityOfQuoteCurrency\": \"0\",\n \"debtRatio\": \"0\",\n \"status\": \"EFFECTIVE\",\n \"accounts\": [\n {\n \"currency\": \"USDT\",\n \"total\": \"0.02\",\n \"available\": \"0.02\",\n \"hold\": \"0\",\n \"liability\": \"0\",\n \"maxBorrowSize\": \"0\",\n \"borrowEnabled\": true,\n \"transferInEnabled\": true\n }\n ]\n }\n}" } ] }, { - "name": "Get Account List - Spot", + "name": "Get Account - Isolated Margin", "request": { "method": "GET", "header": [], @@ -779,23 +529,29 @@ ], "path": [ "api", - "v1", + "v3", + "isolated", "accounts" ], "query": [ { - "key": "currency", + "key": "symbol", + "value": null, + "description": "For isolated trading pairs, query all without passing" + }, + { + "key": "quoteCurrency", "value": "USDT", - "description": "currency" + "description": "quote currency, currently only supports USDT, KCS, BTC, USDT as default" }, { - "key": "type", - "value": "main", - "description": "Account type main、trade" + "key": "queryType", + "value": "ISOLATED", + "description": "Query account type (default ISOLATED), ISOLATED- - only query low frequency isolated margin account, ISOLATED_V2-only query high frequency isolated margin account, ALL - consistent aggregate query with the web side" } ] }, - "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470125)\n\n:::info[Description]\nGet a list of accounts. Please Deposit to the main account firstly, then transfer the funds to the trade account via Inner Transfer before transaction.\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | array | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| id | string | Account ID |\n| currency | string | Currency |\n| type | string | Account type:,main、trade、isolated(abandon)、margin(abandon)
|\n| balance | string | Total funds in the account |\n| available | string | Funds available to withdraw or trade |\n| holds | string | Funds on hold (not available for use) |\n\n---\n", + "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470128)\n\n:::info[Description]\nRequest via this endpoint to get the info of the isolated margin account.\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| totalAssetOfQuoteCurrency | string | Total Assets in Quote Currency |\n| totalLiabilityOfQuoteCurrency | string | Total Liability in Quote Currency |\n| timestamp | integer | timestamp |\n| assets | array | Refer to the schema section of assets |\n\n**root.data.assets Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| symbol | string | Symbol |\n| status | string | Position status; EFFECTIVE-effective, BANKRUPTCY-bankruptcy liquidation, LIQUIDATION-closing, REPAY-repayment, BORROW borrowing |\n| debtRatio | string | debt ratio |\n| baseAsset | object | Refer to the schema section of baseAsset |\n| quoteAsset | object | Refer to the schema section of quoteAsset |\n\n**root.data.assets.baseAsset Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| currency | string | currency |\n| borrowEnabled | boolean | Support borrow or not |\n| transferInEnabled | boolean | Support transfer or not |\n| liability | string | Liabilities |\n| total | string | Total Assets |\n| available | string | Account available assets (total assets - frozen) |\n| hold | string | Account frozen assets |\n| maxBorrowSize | string | The user's remaining maximum loan amount |\n\n**root.data.assets.baseAsset.quoteAsset Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| currency | string | currency |\n| borrowEnabled | boolean | Support borrow or not |\n| transferInEnabled | boolean | Support transfer or not |\n| liability | string | Liabilities |\n| total | string | Total Assets |\n| available | string | Account available assets (total assets - frozen) |\n| hold | string | Account frozen assets |\n| maxBorrowSize | string | The user's remaining maximum loan amount |\n\n---\n", "body": {} }, "response": [ @@ -812,19 +568,25 @@ ], "path": [ "api", - "v1", + "v3", + "isolated", "accounts" ], "query": [ { - "key": "currency", + "key": "symbol", + "value": null, + "description": "For isolated trading pairs, query all without passing" + }, + { + "key": "quoteCurrency", "value": "USDT", - "description": "currency" + "description": "quote currency, currently only supports USDT, KCS, BTC, USDT as default" }, { - "key": "type", - "value": "main", - "description": "Account type main、trade" + "key": "queryType", + "value": "ISOLATED", + "description": "Query account type (default ISOLATED), ISOLATED- - only query low frequency isolated margin account, ISOLATED_V2-only query high frequency isolated margin account, ALL - consistent aggregate query with the web side" } ] } @@ -859,12 +621,12 @@ } ], "cookie": [], - "body": "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"id\": \"548674591753\",\n \"currency\": \"USDT\",\n \"type\": \"trade\",\n \"balance\": \"26.66759503\",\n \"available\": \"26.66759503\",\n \"holds\": \"0\"\n },\n {\n \"id\": \"63355cd156298d0001b66e61\",\n \"currency\": \"USDT\",\n \"type\": \"main\",\n \"balance\": \"0.01\",\n \"available\": \"0.01\",\n \"holds\": \"0\"\n }\n ]\n}" + "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"totalAssetOfQuoteCurrency\": \"0.01\",\n \"totalLiabilityOfQuoteCurrency\": \"0\",\n \"timestamp\": 1728725465994,\n \"assets\": [\n {\n \"symbol\": \"BTC-USDT\",\n \"status\": \"EFFECTIVE\",\n \"debtRatio\": \"0\",\n \"baseAsset\": {\n \"currency\": \"BTC\",\n \"borrowEnabled\": true,\n \"transferInEnabled\": true,\n \"liability\": \"0\",\n \"total\": \"0\",\n \"available\": \"0\",\n \"hold\": \"0\",\n \"maxBorrowSize\": \"0\"\n },\n \"quoteAsset\": {\n \"currency\": \"USDT\",\n \"borrowEnabled\": true,\n \"transferInEnabled\": true,\n \"liability\": \"0\",\n \"total\": \"0.01\",\n \"available\": \"0.01\",\n \"hold\": \"0\",\n \"maxBorrowSize\": \"0\"\n }\n }\n ]\n }\n}" } ] }, { - "name": "Get Account Detail - Spot", + "name": "Get Account - Futures", "request": { "method": "GET", "header": [], @@ -872,17 +634,22 @@ "raw": "", "protocol": "https", "host": [ - "{{spot_endpoint}}" + "{{futures_endpoint}}" ], "path": [ "api", "v1", - "accounts", - "{{accountId}}" + "account-overview" ], - "query": [] + "query": [ + { + "key": "currency", + "value": "", + "description": "Currecny, Default XBT" + } + ] }, - "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470126)\n\n:::info[Description]\nget Information for a single spot account. Use this endpoint when you know the accountId.\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| currency | string | The currency of the account |\n| balance | string | Total funds in the account |\n| available | string | Funds available to withdraw or trade |\n| holds | string | Funds on hold (not available for use) |\n\n---\n", + "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470129)\n\n:::info[Description]\nRequest via this endpoint to get the info of the futures account.\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| accountEquity | number | Account equity = marginBalance + Unrealised PNL |\n| unrealisedPNL | number | Unrealised profit and loss |\n| marginBalance | number | Margin balance = positionMargin + orderMargin + frozenFunds + availableBalance - unrealisedPNL |\n| positionMargin | number | Position margin |\n| orderMargin | number | Order margin |\n| frozenFunds | number | Frozen funds for out-transfer |\n| availableBalance | number | Available balance |\n| currency | string | Currency |\n| riskRatio | number | Cross margin risk rate |\n\n---\n", "body": {} }, "response": [ @@ -895,15 +662,20 @@ "raw": "", "protocol": "https", "host": [ - "{{spot_endpoint}}" + "{{futures_endpoint}}" ], "path": [ "api", "v1", - "accounts", - "{{accountId}}" + "account-overview" ], - "query": [] + "query": [ + { + "key": "currency", + "value": "", + "description": "Currecny, Default XBT" + } + ] } }, "status": "OK", @@ -936,12 +708,12 @@ } ], "cookie": [], - "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"currency\": \"USDT\",\n \"balance\": \"26.66759503\",\n \"available\": \"26.66759503\",\n \"holds\": \"0\"\n }\n}" + "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"currency\": \"USDT\",\n \"accountEquity\": 48.921913718,\n \"unrealisedPNL\": 1.59475,\n \"marginBalance\": 47.548728628,\n \"positionMargin\": 34.1577964733,\n \"orderMargin\": 0,\n \"frozenFunds\": 0,\n \"availableBalance\": 14.7876172447,\n \"riskRatio\": 0.0090285199\n }\n}" } ] }, { - "name": "Get Account - Cross Margin", + "name": "Get Account Ledgers - Spot/Margin", "request": { "method": "GET", "header": [], @@ -953,24 +725,49 @@ ], "path": [ "api", - "v3", - "margin", - "accounts" + "v1", + "accounts", + "ledgers" ], "query": [ { - "key": "quoteCurrency", - "value": "USDT", - "description": "quote currency, currently only supports USDT, KCS, BTC, USDT as default" + "key": "currency", + "value": "BTC", + "description": "Currency ( you can choose more than one currency). You can specify 10 currencies at most for one time. If not specified, all currencies will be inquired by default." }, { - "key": "queryType", - "value": "MARGIN", - "description": "Query account type (default MARGIN), MARGIN - only query low frequency cross margin account, MARGIN_V2-only query high frequency cross margin account, ALL - consistent aggregate query with the web side" + "key": "direction", + "value": "in", + "description": "direction: in, out" + }, + { + "key": "bizType", + "value": "TRANSFER", + "description": "Type: DEPOSIT -deposit, WITHDRAW -withdraw, TRANSFER -transfer, SUB_TRANSFER -subaccount transfer,TRADE_EXCHANGE -trade, MARGIN_EXCHANGE -margin trade, KUCOIN_BONUS -bonus, BROKER_TRANSFER -Broker transfer record" + }, + { + "key": "startAt", + "value": "1728663338000", + "description": "Start time (milisecond)" + }, + { + "key": "endAt", + "value": "1728692138000", + "description": "End time (milisecond)" + }, + { + "key": "currentPage", + "value": "1", + "description": "Current request page." + }, + { + "key": "pageSize", + "value": "50", + "description": "Number of results per request. Minimum is 10, maximum is 500." } ] }, - "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470127)\n\n:::info[Description]\nRequest via this endpoint to get the info of the cross margin account.\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| totalAssetOfQuoteCurrency | string | Total Assets in Quote Currency |\n| totalLiabilityOfQuoteCurrency | string | Total Liability in Quote Currency |\n| debtRatio | string | debt ratio |\n| status | string | Position status; EFFECTIVE-effective, BANKRUPTCY-bankruptcy liquidation, LIQUIDATION-closing, REPAY-repayment, BORROW borrowing |\n| accounts | array | Refer to the schema section of accounts |\n\n**root.data.accounts Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| currency | string | currency |\n| total | string | Total Assets |\n| available | string | Account available assets (total assets - frozen) |\n| hold | string | Account frozen assets |\n| liability | string | Liabilities |\n| maxBorrowSize | string | The user's remaining maximum loan amount |\n| borrowEnabled | boolean | Support borrow or not |\n| transferInEnabled | boolean | Support transfer or not |\n\n---\n", + "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470121)\n\n:::info[Description]\nThis interface is for transaction records from all types of your accounts, supporting inquiry of various currencies. Items are paginated and sorted to show the latest first. See the Pagination section for retrieving additional entries after the first page.\n:::\n\n:::tip[Tips]\nthe start and end time range cannot exceed 24 hours. An error will occur if the specified time window exceeds the range. If you specify the end time only, the system will automatically calculate the start time as end time minus 24 hours, and vice versa.\n:::\n\n:::tip[Tips]\nSupport to obtain 1 year historical data, if need to obtain longer historical data, please submit a ticket: https://kucoin.zendesk.com/hc/en-us/requests/new\n:::\n\n**context**\n\nIf the returned value under bizType is “trade exchange”, the additional info. (such as order ID and trade ID, trading pair, etc.) of the trade will be returned in field context.\n\n**BizType Description**\n\n| Field | Description |\n| ------ | ---------- |\n| Assets Transferred in After Upgrading | Assets Transferred in After V1 to V2 Upgrading |\n| Deposit | Deposit |\n| Withdrawal | Withdrawal |\n| Transfer | Transfer |\n| Trade_Exchange | Trade |\n| Vote for Coin | Vote for Coin |\n| KuCoin Bonus | KuCoin Bonus |\n| Referral Bonus | Referral Bonus |\n| Rewards | Activities Rewards |\n| Distribution | Distribution, such as get GAS by holding NEO |\n| Airdrop/Fork | Airdrop/Fork |\n| Other rewards | Other rewards, except Vote, Airdrop, Fork |\n| Fee Rebate | Fee Rebate |\n| Buy Crypto | Use credit card to buy crypto |\n| Sell Crypto | Use credit card to sell crypto |\n| Public Offering Purchase | Public Offering Purchase for Spotlight |\n| Send red envelope | Send red envelope |\n| Open red envelope | Open red envelope |\n| Staking | Staking |\n| LockDrop Vesting | LockDrop Vesting |\n| Staking Profits | Staking Profits |\n| Redemption | Redemption |\n| Refunded Fees | Refunded Fees |\n| KCS Pay Fees | KCS Pay Fees |\n| Margin Trade | Margin Trade |\n| Loans | Loans |\n| Borrowings | Borrowings |\n| Debt Repayment | Debt Repayment |\n| Loans Repaid | Loans Repaid |\n| Lendings | Lendings |\n| Pool transactions | Pool-X transactions |\n| Instant Exchange | Instant Exchange |\n| Sub Account Transfer | Sub-account transfer |\n| Liquidation Fees | Liquidation Fees |\n| Soft Staking Profits | Soft Staking Profits |\n| Voting Earnings | Voting Earnings on Pool-X |\n| Redemption of Voting | Redemption of Voting on Pool-X |\n| Convert to KCS | Convert to KCS |\n| BROKER_TRANSFER | Broker transfer record |\n\n\n\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| currentPage | integer | current page |\n| pageSize | integer | page size |\n| totalNum | integer | total number |\n| totalPage | integer | total page |\n| items | array | Refer to the schema section of items |\n\n**root.data.items Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| id | string | unique id |\n| currency | string | The currency of an account |\n| amount | string | The total amount of assets (fees included) involved in assets changes such as transaction, withdrawal and bonus distribution. |\n| fee | string | Fees generated in transaction, withdrawal, etc. |\n| balance | string | Remaining funds after the transaction. |\n| accountType | string | The account type of the master user: MAIN, TRADE, MARGIN or CONTRACT. |\n| bizType | string | Business type leading to the changes in funds, such as exchange, withdrawal, deposit, KUCOIN_BONUS, REFERRAL_BONUS, Lendings etc. |\n| direction | string | Side, out or in |\n| createdAt | integer | Time of the event |\n| context | string | Business related information such as order ID, serial No., etc. |\n\n---\n", "body": {} }, "response": [ @@ -987,20 +784,45 @@ ], "path": [ "api", - "v3", - "margin", - "accounts" + "v1", + "accounts", + "ledgers" ], "query": [ { - "key": "quoteCurrency", - "value": "USDT", - "description": "quote currency, currently only supports USDT, KCS, BTC, USDT as default" - }, - { - "key": "queryType", - "value": "MARGIN", - "description": "Query account type (default MARGIN), MARGIN - only query low frequency cross margin account, MARGIN_V2-only query high frequency cross margin account, ALL - consistent aggregate query with the web side" + "key": "currency", + "value": "BTC", + "description": "Currency ( you can choose more than one currency). You can specify 10 currencies at most for one time. If not specified, all currencies will be inquired by default." + }, + { + "key": "direction", + "value": "in", + "description": "direction: in, out" + }, + { + "key": "bizType", + "value": "TRANSFER", + "description": "Type: DEPOSIT -deposit, WITHDRAW -withdraw, TRANSFER -transfer, SUB_TRANSFER -subaccount transfer,TRADE_EXCHANGE -trade, MARGIN_EXCHANGE -margin trade, KUCOIN_BONUS -bonus, BROKER_TRANSFER -Broker transfer record" + }, + { + "key": "startAt", + "value": "1728663338000", + "description": "Start time (milisecond)" + }, + { + "key": "endAt", + "value": "1728692138000", + "description": "End time (milisecond)" + }, + { + "key": "currentPage", + "value": "1", + "description": "Current request page." + }, + { + "key": "pageSize", + "value": "50", + "description": "Number of results per request. Minimum is 10, maximum is 500." } ] } @@ -1035,12 +857,163 @@ } ], "cookie": [], - "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"totalAssetOfQuoteCurrency\": \"0.02\",\n \"totalLiabilityOfQuoteCurrency\": \"0\",\n \"debtRatio\": \"0\",\n \"status\": \"EFFECTIVE\",\n \"accounts\": [\n {\n \"currency\": \"USDT\",\n \"total\": \"0.02\",\n \"available\": \"0.02\",\n \"hold\": \"0\",\n \"liability\": \"0\",\n \"maxBorrowSize\": \"0\",\n \"borrowEnabled\": true,\n \"transferInEnabled\": true\n }\n ]\n }\n}" + "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"currentPage\": 1,\n \"pageSize\": 50,\n \"totalNum\": 1,\n \"totalPage\": 1,\n \"items\": [\n {\n \"id\": \"265329987780896\",\n \"currency\": \"USDT\",\n \"amount\": \"0.01\",\n \"fee\": \"0\",\n \"balance\": \"0\",\n \"accountType\": \"TRADE\",\n \"bizType\": \"SUB_TRANSFER\",\n \"direction\": \"out\",\n \"createdAt\": 1728658481484,\n \"context\": \"\"\n }\n ]\n }\n}" } ] }, { - "name": "Get Account - Isolated Margin", + "name": "Get Account Ledgers - Trade_hf", + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "", + "protocol": "https", + "host": [ + "{{spot_endpoint}}" + ], + "path": [ + "api", + "v1", + "hf", + "accounts", + "ledgers" + ], + "query": [ + { + "key": "currency", + "value": "BTC", + "description": "Currency ( you can choose more than one currency). You can specify 10 currencies at most for one time. If not specified, all currencies will be inquired by default." + }, + { + "key": "direction", + "value": "in", + "description": "direction: in, out" + }, + { + "key": "bizType", + "value": "TRANSFER", + "description": "Transaction type: TRANSFER-transfer funds,TRADE_EXCHANGE-Trade" + }, + { + "key": "lastId", + "value": "254062248624417", + "description": "The id of the last set of data from the previous batch of data. By default, the latest information is given." + }, + { + "key": "limit", + "value": "100", + "description": "Default100,Max200" + }, + { + "key": "startAt", + "value": "1728663338000", + "description": "Start time (milisecond)" + }, + { + "key": "endAt", + "value": "1728692138000", + "description": "End time (milisecond)" + } + ] + }, + "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470122)\n\n:::info[Description]\nThis API endpoint returns all transfer (in and out) records in high-frequency trading account and supports multi-coin queries. The query results are sorted in descending order by createdAt and id.\n:::\n\n\n\n:::tip[Tips]\nIf lastId is configured, the information obtained < lastId. Otherwise, it will go back to the latest information.\n\nYou can only obtain data from within a 3 _ 24 hour time range (i.e., from 3 _ 24 hours ago up to now) If you specify a time range that exceeds this limit, the system will default to data from within 3 * 24 hours.\n:::\n\n**context**\n\nIf the bizType is TRADE_EXCHANGE, the context field will include additional transaction information (order id, transaction id, and trading pair).\n\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | array | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| id | string | Unique id |\n| currency | string | currency |\n| amount | string | Change in funds balance |\n| fee | string | Deposit or withdrawal fee |\n| tax | string | |\n| balance | string | Total balance of funds after change |\n| accountType | string | Master account type TRADE_HF |\n| bizType | string | Trnasaction type,such as TRANSFER, TRADE_EXCHANGE, etc. |\n| direction | string | Direction of transfer( out or in) |\n| createdAt | string | Created time |\n| context | string | Core transaction parameter |\n\n---\n", + "body": {} + }, + "response": [ + { + "name": "Successful Response", + "originalRequest": { + "method": "GET", + "header": [], + "url": { + "raw": "", + "protocol": "https", + "host": [ + "{{spot_endpoint}}" + ], + "path": [ + "api", + "v1", + "hf", + "accounts", + "ledgers" + ], + "query": [ + { + "key": "currency", + "value": "BTC", + "description": "Currency ( you can choose more than one currency). You can specify 10 currencies at most for one time. If not specified, all currencies will be inquired by default." + }, + { + "key": "direction", + "value": "in", + "description": "direction: in, out" + }, + { + "key": "bizType", + "value": "TRANSFER", + "description": "Transaction type: TRANSFER-transfer funds,TRADE_EXCHANGE-Trade" + }, + { + "key": "lastId", + "value": "254062248624417", + "description": "The id of the last set of data from the previous batch of data. By default, the latest information is given." + }, + { + "key": "limit", + "value": "100", + "description": "Default100,Max200" + }, + { + "key": "startAt", + "value": "1728663338000", + "description": "Start time (milisecond)" + }, + { + "key": "endAt", + "value": "1728692138000", + "description": "End time (milisecond)" + } + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json", + "name": "Content-Type", + "description": { + "content": "", + "type": "text/plain" + } + }, + { + "key": "gw-ratelimit-remaining", + "value": 1997, + "name": "gw-ratelimit-remaining" + }, + { + "key": "gw-ratelimit-limit", + "value": 2000, + "name": "gw-ratelimit-limit" + }, + { + "key": "gw-ratelimit-reset", + "value": 29990, + "name": "gw-ratelimit-reset" + } + ], + "cookie": [], + "body": "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"id\": \"254062248624417\",\n \"currency\": \"USDT\",\n \"amount\": \"1.59760080\",\n \"fee\": \"0.00159920\",\n \"tax\": \"0\",\n \"balance\": \"26.73759503\",\n \"accountType\": \"TRADE_HF\",\n \"bizType\": \"TRADE_EXCHANGE\",\n \"direction\": \"in\",\n \"createdAt\": \"1728443957539\",\n \"context\": \"{\\\"symbol\\\":\\\"KCS-USDT\\\",\\\"orderId\\\":\\\"6705f6350dc7210007d6a36d\\\",\\\"tradeId\\\":\\\"10046097631627265\\\"}\"\n }\n ]\n}" + } + ] + }, + { + "name": "Get Account Ledgers - Margin_hf", "request": { "method": "GET", "header": [], @@ -1053,35 +1026,334 @@ "path": [ "api", "v3", - "isolated", - "accounts" + "hf", + "margin", + "account", + "ledgers" ], "query": [ { - "key": "symbol", - "value": null, - "description": "For isolated trading pairs, query all without passing" + "key": "currency", + "value": "BTC", + "description": "currency, optional,can select more than one,separate with commas,select no more than 10 currencys,the default will be to query for all currencys if left empty" }, { - "key": "quoteCurrency", - "value": "USDT", - "description": "quote currency, currently only supports USDT, KCS, BTC, USDT as default" + "key": "direction", + "value": "in", + "description": "direction: in, out" }, { - "key": "queryType", - "value": "ISOLATED", - "description": "Query account type (default ISOLATED), ISOLATED- - only query low frequency isolated margin account, ISOLATED_V2-only query high frequency isolated margin account, ALL - consistent aggregate query with the web side" + "key": "bizType", + "value": "TRANSFER", + "description": "Transaction type: TRANSFER- transfer funds, MARGIN_EXCHANGE - cross margin trade, ISOLATED_EXCHANGE - isolated margin trade, LIQUIDATION - liquidation, ASSERT_RETURN - forced liquidation asset return" + }, + { + "key": "lastId", + "value": "254062248624417", + "description": "The id of the last set of data from the previous batch of data. By default, the latest information is given." + }, + { + "key": "limit", + "value": "100", + "description": "Default100,Max200" + }, + { + "key": "startAt", + "value": "1728663338000", + "description": "Start time (milisecond)" + }, + { + "key": "endAt", + "value": "1728692138000", + "description": "End time (milisecond)" + } + ] + }, + "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470123)\n\n:::info[Description]\nThis API endpoint returns all transfer (in and out) records in high-frequency margin trading account and supports multi-coin queries. The query results are sorted in descending order by createdAt and id.\n:::\n\n\n:::tip[Tips]\nIf lastId is configured, the information obtained < lastId. Otherwise, it will go back to the latest information.\n\nYou can only obtain data from within a 3 _ 24 hour time range (i.e., from 3 _ 24 hours ago up to now) If you specify a time range that exceeds this limit, the system will default to data from within 3 * 24 hours.\n\nIf bizType is MARGIN_EXCHANGE or ISOLATED_EXCHANGE, the context field will contain additional information about the transaction (order id, transaction id, transaction pair).\n:::\n\n\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | array | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| id | integer | |\n| currency | string | currency |\n| amount | string | Change in funds balance |\n| fee | string | Deposit or withdrawal fee |\n| balance | string | Total balance of funds after change |\n| accountType | string | Master account type TRADE_HF |\n| bizType | string | Trnasaction type,such as TRANSFER, TRADE_EXCHANGE, etc. |\n| direction | string | Direction of transfer( out or in) |\n| createdAt | integer | Ledger creation time |\n| context | string | Core transaction parameter |\n| tax | string | |\n\n---\n", + "body": {} + }, + "response": [ + { + "name": "Successful Response", + "originalRequest": { + "method": "GET", + "header": [], + "url": { + "raw": "", + "protocol": "https", + "host": [ + "{{spot_endpoint}}" + ], + "path": [ + "api", + "v3", + "hf", + "margin", + "account", + "ledgers" + ], + "query": [ + { + "key": "currency", + "value": "BTC", + "description": "currency, optional,can select more than one,separate with commas,select no more than 10 currencys,the default will be to query for all currencys if left empty" + }, + { + "key": "direction", + "value": "in", + "description": "direction: in, out" + }, + { + "key": "bizType", + "value": "TRANSFER", + "description": "Transaction type: TRANSFER- transfer funds, MARGIN_EXCHANGE - cross margin trade, ISOLATED_EXCHANGE - isolated margin trade, LIQUIDATION - liquidation, ASSERT_RETURN - forced liquidation asset return" + }, + { + "key": "lastId", + "value": "254062248624417", + "description": "The id of the last set of data from the previous batch of data. By default, the latest information is given." + }, + { + "key": "limit", + "value": "100", + "description": "Default100,Max200" + }, + { + "key": "startAt", + "value": "1728663338000", + "description": "Start time (milisecond)" + }, + { + "key": "endAt", + "value": "1728692138000", + "description": "End time (milisecond)" + } + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json", + "name": "Content-Type", + "description": { + "content": "", + "type": "text/plain" + } + }, + { + "key": "gw-ratelimit-remaining", + "value": 1997, + "name": "gw-ratelimit-remaining" + }, + { + "key": "gw-ratelimit-limit", + "value": 2000, + "name": "gw-ratelimit-limit" + }, + { + "key": "gw-ratelimit-reset", + "value": 29990, + "name": "gw-ratelimit-reset" + } + ], + "cookie": [], + "body": "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"id\": 1949641706720,\n \"currency\": \"USDT\",\n \"amount\": \"0.01000000\",\n \"fee\": \"0.00000000\",\n \"balance\": \"0.01000000\",\n \"accountType\": \"MARGIN_V2\",\n \"bizType\": \"TRANSFER\",\n \"direction\": \"in\",\n \"createdAt\": 1728664091208,\n \"context\": \"{}\",\n \"tax\": \"0.00000000\"\n }\n ]\n}" + } + ] + }, + { + "name": "Get Account Ledgers - Futures", + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "", + "protocol": "https", + "host": [ + "{{futures_endpoint}}" + ], + "path": [ + "api", + "v1", + "transaction-history" + ], + "query": [ + { + "key": "currency", + "value": "XBT", + "description": "Currency of transaction history, XBT or USDT" + }, + { + "key": "type", + "value": "Transferin", + "description": "Type RealisedPNL-Realised profit and loss, Deposit-Deposit, Withdrawal-withdraw, Transferin-Transfer in, TransferOut-Transfer out" + }, + { + "key": "offset", + "value": "254062248624417", + "description": "Start offset. Generally, the only attribute of the last returned result of the previous request is used, and the first page is returned by default" + }, + { + "key": "forward", + "value": "false", + "description": "This parameter functions to judge whether the lookup is forward or not. True means “yes” and False means “no”. This parameter is set as true by default" + }, + { + "key": "maxCount", + "value": "50", + "description": "Displayed size per page. The default size is 50" + }, + { + "key": "startAt", + "value": "1728663338000", + "description": "Start time (milisecond)" + }, + { + "key": "endAt", + "value": "1728692138000", + "description": "End time (milisecond)" + } + ] + }, + "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470124)\n\n:::info[Description]\nThis interface can query the ledger records of the futures business line\n:::\n\n\n\n:::tip[Tips]\nIf there are open positions, the status of the first page returned will be Pending, indicating the realised profit and loss in the current 8-hour settlement period. Please specify the minimum offset number of the current page into the offset field to turn the page.\n:::\n\n:::tip[Tips]\nSupplementary instructions for startAt and endAt: startAt must be less than endAt; and the interval cannot exceed 1 day; only one field is allowed, and if only one field is passed, another field will be automatically added or subtracted by the system 1 day to complete\n:::\n\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| dataList | array | Refer to the schema section of dataList |\n| hasMore | boolean | Is it the last page. If it is false, it means it is the last page, and if it is true, it means need to turn the page. |\n\n**root.data.dataList Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| time | integer | ledger time |\n| type | string | Type: RealisedPNL, Deposit, Withdrawal, TransferIn, TransferOut |\n| amount | number | Transaction amount |\n| fee | number | Fee |\n| accountEquity | number | Account equity |\n| status | string | Status: Completed, Pending |\n| remark | string | Ticker symbol of the contract |\n| offset | integer | Offset |\n| currency | string | Currency |\n\n---\n", + "body": {} + }, + "response": [ + { + "name": "Successful Response", + "originalRequest": { + "method": "GET", + "header": [], + "url": { + "raw": "", + "protocol": "https", + "host": [ + "{{futures_endpoint}}" + ], + "path": [ + "api", + "v1", + "transaction-history" + ], + "query": [ + { + "key": "currency", + "value": "XBT", + "description": "Currency of transaction history, XBT or USDT" + }, + { + "key": "type", + "value": "Transferin", + "description": "Type RealisedPNL-Realised profit and loss, Deposit-Deposit, Withdrawal-withdraw, Transferin-Transfer in, TransferOut-Transfer out" + }, + { + "key": "offset", + "value": "254062248624417", + "description": "Start offset. Generally, the only attribute of the last returned result of the previous request is used, and the first page is returned by default" + }, + { + "key": "forward", + "value": "false", + "description": "This parameter functions to judge whether the lookup is forward or not. True means “yes” and False means “no”. This parameter is set as true by default" + }, + { + "key": "maxCount", + "value": "50", + "description": "Displayed size per page. The default size is 50" + }, + { + "key": "startAt", + "value": "1728663338000", + "description": "Start time (milisecond)" + }, + { + "key": "endAt", + "value": "1728692138000", + "description": "End time (milisecond)" + } + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json", + "name": "Content-Type", + "description": { + "content": "", + "type": "text/plain" + } + }, + { + "key": "gw-ratelimit-remaining", + "value": 1997, + "name": "gw-ratelimit-remaining" + }, + { + "key": "gw-ratelimit-limit", + "value": 2000, + "name": "gw-ratelimit-limit" + }, + { + "key": "gw-ratelimit-reset", + "value": 29990, + "name": "gw-ratelimit-reset" + } + ], + "cookie": [], + "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"dataList\": [\n {\n \"time\": 1728665747000,\n \"type\": \"TransferIn\",\n \"amount\": 0.01,\n \"fee\": 0.0,\n \"accountEquity\": 14.02924938,\n \"status\": \"Completed\",\n \"remark\": \"Transferred from High-Frequency Trading Account\",\n \"offset\": 51360793,\n \"currency\": \"USDT\"\n },\n {\n \"time\": 1728648000000,\n \"type\": \"RealisedPNL\",\n \"amount\": 0.00630042,\n \"fee\": 0.0,\n \"accountEquity\": 20.0,\n \"status\": \"Completed\",\n \"remark\": \"XBTUSDTM\",\n \"offset\": 51352430,\n \"currency\": \"USDT\"\n }\n ],\n \"hasMore\": false\n }\n}" + } + ] + } + ], + "description": "" + }, + { + "name": "Sub Account", + "item": [ + { + "name": "Add SubAccount", + "request": { + "method": "POST", + "header": [], + "url": { + "raw": "", + "protocol": "https", + "host": [ + "{{spot_endpoint}}" + ], + "path": [ + "api", + "v2", + "sub", + "user", + "created" + ], + "query": [] + }, + "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470135)\n\n:::info[Description]\nThis endpoint can be used to create sub-accounts.\n:::\n\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| password | string | Password(7-24 characters, must contain letters and numbers, cannot only contain numbers or include special characters) |\n| remarks | string | Remarks(1~24 characters) |\n| subName | string | Sub-account name(must contain 7-32 characters, at least one number and one letter. Cannot contain any spaces.) |\n| access | string | Permission (types include Spot, Futures, Margin permissions, which can be used alone or in combination). |\n\n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| uid | integer | Sub-account UID |\n| subName | string | Sub-account name |\n| remarks | string | Remarks |\n| access | string | Permission |\n\n---\n", + "body": { + "mode": "raw", + "raw": "{\n \"password\": \"1234567\",\n \"remarks\": \"TheRemark\",\n \"subName\": \"Name1234567\",\n \"access\": \"Spot\"\n}", + "options": { + "raw": { + "language": "json" } - ] - }, - "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470128)\n\n:::info[Description]\nRequest via this endpoint to get the info of the isolated margin account.\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| totalAssetOfQuoteCurrency | string | Total Assets in Quote Currency |\n| totalLiabilityOfQuoteCurrency | string | Total Liability in Quote Currency |\n| timestamp | integer | timestamp |\n| assets | array | Refer to the schema section of assets |\n\n**root.data.assets Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| symbol | string | Symbol |\n| status | string | Position status; EFFECTIVE-effective, BANKRUPTCY-bankruptcy liquidation, LIQUIDATION-closing, REPAY-repayment, BORROW borrowing |\n| debtRatio | string | debt ratio |\n| baseAsset | object | Refer to the schema section of baseAsset |\n| quoteAsset | object | Refer to the schema section of quoteAsset |\n\n**root.data.assets.baseAsset Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| currency | string | currency |\n| borrowEnabled | boolean | Support borrow or not |\n| transferInEnabled | boolean | Support transfer or not |\n| liability | string | Liabilities |\n| total | string | Total Assets |\n| available | string | Account available assets (total assets - frozen) |\n| hold | string | Account frozen assets |\n| maxBorrowSize | string | The user's remaining maximum loan amount |\n\n**root.data.assets.baseAsset.quoteAsset Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| currency | string | currency |\n| borrowEnabled | boolean | Support borrow or not |\n| transferInEnabled | boolean | Support transfer or not |\n| liability | string | Liabilities |\n| total | string | Total Assets |\n| available | string | Account available assets (total assets - frozen) |\n| hold | string | Account frozen assets |\n| maxBorrowSize | string | The user's remaining maximum loan amount |\n\n---\n", - "body": {} + } + } }, "response": [ { "name": "Successful Response", "originalRequest": { - "method": "GET", + "method": "POST", "header": [], "url": { "raw": "", @@ -1091,27 +1363,12 @@ ], "path": [ "api", - "v3", - "isolated", - "accounts" + "v2", + "sub", + "user", + "created" ], - "query": [ - { - "key": "symbol", - "value": null, - "description": "For isolated trading pairs, query all without passing" - }, - { - "key": "quoteCurrency", - "value": "USDT", - "description": "quote currency, currently only supports USDT, KCS, BTC, USDT as default" - }, - { - "key": "queryType", - "value": "ISOLATED", - "description": "Query account type (default ISOLATED), ISOLATED- - only query low frequency isolated margin account, ISOLATED_V2-only query high frequency isolated margin account, ALL - consistent aggregate query with the web side" - } - ] + "query": [] } }, "status": "OK", @@ -1144,61 +1401,63 @@ } ], "cookie": [], - "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"totalAssetOfQuoteCurrency\": \"0.01\",\n \"totalLiabilityOfQuoteCurrency\": \"0\",\n \"timestamp\": 1728725465994,\n \"assets\": [\n {\n \"symbol\": \"BTC-USDT\",\n \"status\": \"EFFECTIVE\",\n \"debtRatio\": \"0\",\n \"baseAsset\": {\n \"currency\": \"BTC\",\n \"borrowEnabled\": true,\n \"transferInEnabled\": true,\n \"liability\": \"0\",\n \"total\": \"0\",\n \"available\": \"0\",\n \"hold\": \"0\",\n \"maxBorrowSize\": \"0\"\n },\n \"quoteAsset\": {\n \"currency\": \"USDT\",\n \"borrowEnabled\": true,\n \"transferInEnabled\": true,\n \"liability\": \"0\",\n \"total\": \"0.01\",\n \"available\": \"0.01\",\n \"hold\": \"0\",\n \"maxBorrowSize\": \"0\"\n }\n }\n ]\n }\n}" + "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"currentPage\": 1,\n \"pageSize\": 10,\n \"totalNum\": 1,\n \"totalPage\": 1,\n \"items\": [\n {\n \"userId\": \"63743f07e0c5230001761d08\",\n \"uid\": 169579801,\n \"subName\": \"testapi6\",\n \"status\": 2,\n \"type\": 0,\n \"access\": \"All\",\n \"createdAt\": 1668562696000,\n \"remarks\": \"remarks\",\n \"tradeTypes\": [\n \"Spot\",\n \"Futures\",\n \"Margin\"\n ],\n \"openedTradeTypes\": [\n \"Spot\"\n ],\n \"hostedStatus\": null\n }\n ]\n }\n}" } ] }, { - "name": "Get Account - Futures", + "name": "Add SubAccount Margin Permission", "request": { - "method": "GET", + "method": "POST", "header": [], "url": { "raw": "", "protocol": "https", "host": [ - "{{futures_endpoint}}" + "{{spot_endpoint}}" ], "path": [ "api", - "v1", - "account-overview" + "v3", + "sub", + "user", + "margin", + "enable" ], - "query": [ - { - "key": "currency", - "value": "", - "description": "Currecny, Default XBT" - } - ] + "query": [] }, - "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470129)\n\n:::info[Description]\nRequest via this endpoint to get the info of the futures account.\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| accountEquity | number | Account equity = marginBalance + Unrealised PNL |\n| unrealisedPNL | number | Unrealised profit and loss |\n| marginBalance | number | Margin balance = positionMargin + orderMargin + frozenFunds + availableBalance - unrealisedPNL |\n| positionMargin | number | Position margin |\n| orderMargin | number | Order margin |\n| frozenFunds | number | Frozen funds for out-transfer |\n| availableBalance | number | Available balance |\n| currency | string | Currency |\n| riskRatio | number | Cross margin risk rate |\n\n---\n", - "body": {} + "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470331)\n\n:::info[Description]\nThis endpoint can be used to add sub-accounts Margin permission. Before using this endpoints, you need to ensure that the master account apikey has Margin permissions and the Margin function has been activated.\n:::\n\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| uid | string | Sub account UID |\n\n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | string | |\n\n---\n", + "body": { + "mode": "raw", + "raw": "{\n \"uid\": \"169579801\"\n}", + "options": { + "raw": { + "language": "json" + } + } + } }, "response": [ { "name": "Successful Response", "originalRequest": { - "method": "GET", + "method": "POST", "header": [], "url": { "raw": "", "protocol": "https", "host": [ - "{{futures_endpoint}}" + "{{spot_endpoint}}" ], "path": [ "api", - "v1", - "account-overview" + "v3", + "sub", + "user", + "margin", + "enable" ], - "query": [ - { - "key": "currency", - "value": "", - "description": "Currecny, Default XBT" - } - ] + "query": [] } }, "status": "OK", @@ -1231,14 +1490,14 @@ } ], "cookie": [], - "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"currency\": \"USDT\",\n \"accountEquity\": 48.921913718,\n \"unrealisedPNL\": 1.59475,\n \"marginBalance\": 47.548728628,\n \"positionMargin\": 34.1577964733,\n \"orderMargin\": 0,\n \"frozenFunds\": 0,\n \"availableBalance\": 14.7876172447,\n \"riskRatio\": 0.0090285199\n }\n}" + "body": "{\n \"code\": \"200000\",\n \"data\": null\n}" } ] }, { - "name": "Get Apikey Info", + "name": "Add SubAccount Futures Permission", "request": { - "method": "GET", + "method": "POST", "header": [], "url": { "raw": "", @@ -1248,20 +1507,30 @@ ], "path": [ "api", - "v1", + "v3", + "sub", "user", - "api-key" + "futures", + "enable" ], "query": [] }, - "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470130)\n\n:::info[Description]\nGet the information of the api key. Use the api key pending to be checked to call the endpoint. Both master and sub user's api key are applicable.\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| remark | string | Remarks |\n| apiKey | string | Apikey |\n| apiVersion | integer | API Version |\n| permission | string | [Permissions](https://www.kucoin.com/docs-new/doc-338144), possible values: General, Spot, Margin, Futures, InnerTransfer, Transfer, Earn |\n| ipWhitelist | string | IP whitelist

|\n| createdAt | integer | Apikey create time |\n| uid | integer | Account UID |\n| isMaster | boolean | Whether it is the master account. |\n| subName | string | Sub Name, There is no such param for the master account |\n\n---\n", - "body": {} + "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470332)\n\n:::info[Description]\nThis endpoint can be used to add sub-accounts Futures permission. Before using this endpoints, you need to ensure that the master account apikey has Futures permissions and the Futures function has been activated.\n:::\n\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| uid | string | Sub account UID |\n\n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | boolean | |\n\n---\n", + "body": { + "mode": "raw", + "raw": "{\n \"uid\": \"169579801\"\n}", + "options": { + "raw": { + "language": "json" + } + } + } }, "response": [ { "name": "Successful Response", "originalRequest": { - "method": "GET", + "method": "POST", "header": [], "url": { "raw": "", @@ -1271,9 +1540,11 @@ ], "path": [ "api", - "v1", + "v3", + "sub", "user", - "api-key" + "futures", + "enable" ], "query": [] } @@ -1308,16 +1579,10 @@ } ], "cookie": [], - "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"remark\": \"account1\",\n \"apiKey\": \"6705f5c311545b000157d3eb\",\n \"apiVersion\": 3,\n \"permission\": \"General,Futures,Spot,Earn,InnerTransfer,Transfer,Margin\",\n \"ipWhitelist\": \"203.**.154,103.**.34\",\n \"createdAt\": 1728443843000,\n \"uid\": 165111215,\n \"isMaster\": true\n }\n}" + "body": "{\n \"code\": \"200000\",\n \"data\": null\n}" } ] - } - ], - "description": "" - }, - { - "name": "Sub Account", - "item": [ + }, { "name": "Get SubAccount List - Summary Info", "request": { @@ -1689,96 +1954,15 @@ "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"summary\": {\n \"accountEquityTotal\": 103.899081508,\n \"unrealisedPNLTotal\": 38.81075,\n \"marginBalanceTotal\": 65.336985668,\n \"positionMarginTotal\": 68.9588320683,\n \"orderMarginTotal\": 0,\n \"frozenFundsTotal\": 0,\n \"availableBalanceTotal\": 67.2492494397,\n \"currency\": \"USDT\"\n },\n \"accounts\": [\n {\n \"accountName\": \"Name1234567\",\n \"accountEquity\": 0,\n \"unrealisedPNL\": 0,\n \"marginBalance\": 0,\n \"positionMargin\": 0,\n \"orderMargin\": 0,\n \"frozenFunds\": 0,\n \"availableBalance\": 0,\n \"currency\": \"USDT\"\n },\n {\n \"accountName\": \"LTkucoin1491\",\n \"accountEquity\": 0,\n \"unrealisedPNL\": 0,\n \"marginBalance\": 0,\n \"positionMargin\": 0,\n \"orderMargin\": 0,\n \"frozenFunds\": 0,\n \"availableBalance\": 0,\n \"currency\": \"USDT\"\n },\n {\n \"accountName\": \"manage112233\",\n \"accountEquity\": 0,\n \"unrealisedPNL\": 0,\n \"marginBalance\": 0,\n \"positionMargin\": 0,\n \"orderMargin\": 0,\n \"frozenFunds\": 0,\n \"availableBalance\": 0,\n \"currency\": \"USDT\"\n },\n {\n \"accountName\": \"testapi6\",\n \"accountEquity\": 27.30545128,\n \"unrealisedPNL\": 22.549,\n \"marginBalance\": 4.75645128,\n \"positionMargin\": 24.1223749975,\n \"orderMargin\": 0,\n \"frozenFunds\": 0,\n \"availableBalance\": 25.7320762825,\n \"currency\": \"USDT\"\n },\n {\n \"accountName\": \"main\",\n \"accountEquity\": 76.593630228,\n \"unrealisedPNL\": 16.26175,\n \"marginBalance\": 60.580534388,\n \"positionMargin\": 44.8364570708,\n \"orderMargin\": 0,\n \"frozenFunds\": 0,\n \"availableBalance\": 41.5171731572,\n \"currency\": \"USDT\"\n }\n ]\n }\n}" } ] - }, - { - "name": "Add SubAccount", - "request": { - "method": "POST", - "header": [], - "url": { - "raw": "", - "protocol": "https", - "host": [ - "{{spot_endpoint}}" - ], - "path": [ - "api", - "v2", - "sub", - "user", - "created" - ], - "query": [] - }, - "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470135)\n\n:::info[Description]\nThis endpoint can be used to create sub-accounts.\n:::\n\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| password | string | Password(7-24 characters, must contain letters and numbers, cannot only contain numbers or include special characters) |\n| remarks | string | Remarks(1~24 characters) |\n| subName | string | Sub-account name(must contain 7-32 characters, at least one number and one letter. Cannot contain any spaces.) |\n| access | string | Permission (types include Spot, Futures, Margin permissions, which can be used alone or in combination). |\n\n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| uid | integer | Sub-account UID |\n| subName | string | Sub-account name |\n| remarks | string | Remarks |\n| access | string | Permission |\n\n---\n", - "body": { - "mode": "raw", - "raw": "{\n \"password\": \"1234567\",\n \"remarks\": \"TheRemark\",\n \"subName\": \"Name1234567\",\n \"access\": \"Spot\"\n}", - "options": { - "raw": { - "language": "json" - } - } - } - }, - "response": [ - { - "name": "Successful Response", - "originalRequest": { - "method": "POST", - "header": [], - "url": { - "raw": "", - "protocol": "https", - "host": [ - "{{spot_endpoint}}" - ], - "path": [ - "api", - "v2", - "sub", - "user", - "created" - ], - "query": [] - } - }, - "status": "OK", - "code": 200, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "Content-Type", - "value": "application/json", - "name": "Content-Type", - "description": { - "content": "", - "type": "text/plain" - } - }, - { - "key": "gw-ratelimit-remaining", - "value": 1997, - "name": "gw-ratelimit-remaining" - }, - { - "key": "gw-ratelimit-limit", - "value": 2000, - "name": "gw-ratelimit-limit" - }, - { - "key": "gw-ratelimit-reset", - "value": 29990, - "name": "gw-ratelimit-reset" - } - ], - "cookie": [], - "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"currentPage\": 1,\n \"pageSize\": 10,\n \"totalNum\": 1,\n \"totalPage\": 1,\n \"items\": [\n {\n \"userId\": \"63743f07e0c5230001761d08\",\n \"uid\": 169579801,\n \"subName\": \"testapi6\",\n \"status\": 2,\n \"type\": 0,\n \"access\": \"All\",\n \"createdAt\": 1668562696000,\n \"remarks\": \"remarks\",\n \"tradeTypes\": [\n \"Spot\",\n \"Futures\",\n \"Margin\"\n ],\n \"openedTradeTypes\": [\n \"Spot\"\n ],\n \"hostedStatus\": null\n }\n ]\n }\n}" - } - ] - }, + } + ], + "description": "" + }, + { + "name": "Sub Account API", + "item": [ { - "name": "Add SubAccount Margin Permission", + "name": "Add SubAccount API", "request": { "method": "POST", "header": [], @@ -1790,18 +1974,16 @@ ], "path": [ "api", - "v3", + "v1", "sub", - "user", - "margin", - "enable" + "api-key" ], "query": [] }, - "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470331)\n\n:::info[Description]\nThis endpoint can be used to add sub-accounts Margin permission. Before using this endpoints, you need to ensure that the master account apikey has Margin permissions and the Margin function has been activated.\n:::\n\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| uid | string | Sub account UID |\n\n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | string | |\n\n---\n", + "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470138)\n\n:::info[Description]\nThis endpoint can be used to create APIs for sub-accounts.\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| passphrase | string | Password(Must contain 7-32 characters. Cannot contain any spaces.) |\n| remark | string | Remarks(1~24 characters) |\n| permission | string | [Permissions](https://www.kucoin.com/docs-new/doc-338144)(Only General、Spot、Futures、Margin、InnerTransfer(Flex Transfer) permissions can be set, such as \"General, Trade\". The default is \"General\") |\n| ipWhitelist | string | IP whitelist(You may add up to 20 IPs. Use a halfwidth comma to each IP) |\n| expire | string | API expiration time; Never expire(default)-1,30Day30,90Day90,180Day180,360Day360 |\n| subName | string | Sub-account name, create sub account name of API Key. |\n\n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| subName | string | Sub-account name |\n| remark | string | Remarks |\n| apiKey | string | API Key |\n| apiSecret | string | API Secret Key
|\n| apiVersion | integer | API Version |\n| passphrase | string | Password |\n| permission | string | [Permissions](https://www.kucoin.com/docs-new/doc-338144) |\n| ipWhitelist | string | IP whitelist |\n| createdAt | integer | Time of the event |\n\n---\n", "body": { "mode": "raw", - "raw": "{\n \"uid\": \"169579801\"\n}", + "raw": "{\n \"subName\": \"testapi6\",\n \"passphrase\": \"11223344\",\n \"remark\": \"TheRemark\",\n \"permission\": \"General,Spot,Futures\"\n}", "options": { "raw": { "language": "json" @@ -1823,11 +2005,9 @@ ], "path": [ "api", - "v3", + "v1", "sub", - "user", - "margin", - "enable" + "api-key" ], "query": [] } @@ -1862,12 +2042,12 @@ } ], "cookie": [], - "body": "{\n \"code\": \"200000\",\n \"data\": null\n}" + "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"subName\": \"testapi6\",\n \"remark\": \"TheRemark\",\n \"apiKey\": \"670621e3a25958000159c82f\",\n \"apiSecret\": \"46fd8974******896f005b2340\",\n \"apiVersion\": 3,\n \"passphrase\": \"11223344\",\n \"permission\": \"General,Futures\",\n \"createdAt\": 1728455139000\n }\n}" } ] }, { - "name": "Add SubAccount Futures Permission", + "name": "Modify SubAccount API", "request": { "method": "POST", "header": [], @@ -1879,18 +2059,17 @@ ], "path": [ "api", - "v3", + "v1", "sub", - "user", - "futures", - "enable" + "api-key", + "update" ], "query": [] }, - "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470332)\n\n:::info[Description]\nThis endpoint can be used to add sub-accounts Futures permission. Before using this endpoints, you need to ensure that the master account apikey has Futures permissions and the Futures function has been activated.\n:::\n\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| uid | string | Sub account UID |\n\n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | boolean | |\n\n---\n", + "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470139)\n\n:::info[Description]\nThis endpoint can be used to modify sub-account APIs.\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| passphrase | string | Password(Must contain 7-32 characters. Cannot contain any spaces.) |\n| permission | string | [Permissions](https://www.kucoin.com/docs-new/doc-338144)(Only General、Spot、Futures、Margin、InnerTransfer(Flex Transfer) permissions can be set, such as \"General, Trade\". The default is \"General\") |\n| ipWhitelist | string | IP whitelist(You may add up to 20 IPs. Use a halfwidth comma to each IP) |\n| expire | string | API expiration time; Never expire(default)-1,30Day30,90Day90,180Day180,360Day360 |\n| subName | string | Sub-account name, create sub account name of API Key. |\n| apiKey | string | API-Key(Sub-account APIKey) |\n\n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| subName | string | Sub-account name |\n| apiKey | string | API Key |\n| permission | string | [Permissions](https://www.kucoin.com/docs-new/doc-338144) |\n| ipWhitelist | string | IP whitelist |\n\n---\n", "body": { "mode": "raw", - "raw": "{\n \"uid\": \"169579801\"\n}", + "raw": "{\n \"subName\": \"testapi6\",\n \"apiKey\": \"670621e3a25958000159c82f\",\n \"passphrase\": \"11223344\",\n \"permission\": \"General,Spot,Futures\"\n}", "options": { "raw": { "language": "json" @@ -1912,11 +2091,10 @@ ], "path": [ "api", - "v3", + "v1", "sub", - "user", - "futures", - "enable" + "api-key", + "update" ], "query": [] } @@ -1951,16 +2129,10 @@ } ], "cookie": [], - "body": "{\n \"code\": \"200000\",\n \"data\": null\n}" + "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"subName\": \"testapi6\",\n \"apiKey\": \"670621e3a25958000159c82f\",\n \"permission\": \"General,Futures,Spot\"\n }\n}" } ] - } - ], - "description": "" - }, - { - "name": "Sub Account API", - "item": [ + }, { "name": "Get SubAccount API List", "request": { @@ -2168,9 +2340,15 @@ "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"subName\": \"testapi6\",\n \"apiKey\": \"670621e3a25958000159c82f\"\n }\n}" } ] - }, + } + ], + "description": "" + }, + { + "name": "Deposit", + "item": [ { - "name": "Add SubAccount API", + "name": "Add Deposit Address(V3)", "request": { "method": "POST", "header": [], @@ -2182,16 +2360,16 @@ ], "path": [ "api", - "v1", - "sub", - "api-key" + "v3", + "deposit-address", + "create" ], "query": [] }, - "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470138)\n\n:::info[Description]\nThis endpoint can be used to create APIs for sub-accounts.\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| passphrase | string | Password(Must contain 7-32 characters. Cannot contain any spaces.) |\n| remark | string | Remarks(1~24 characters) |\n| permission | string | [Permissions](https://www.kucoin.com/docs-new/doc-338144)(Only General、Spot、Futures、Margin、InnerTransfer(Flex Transfer) permissions can be set, such as \"General, Trade\". The default is \"General\") |\n| ipWhitelist | string | IP whitelist(You may add up to 20 IPs. Use a halfwidth comma to each IP) |\n| expire | string | API expiration time; Never expire(default)-1,30Day30,90Day90,180Day180,360Day360 |\n| subName | string | Sub-account name, create sub account name of API Key. |\n\n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| subName | string | Sub-account name |\n| remark | string | Remarks |\n| apiKey | string | API Key |\n| apiSecret | string | API Secret Key
|\n| apiVersion | integer | API Version |\n| passphrase | string | Password |\n| permission | string | [Permissions](https://www.kucoin.com/docs-new/doc-338144) |\n| ipWhitelist | string | IP whitelist |\n| createdAt | integer | Time of the event |\n\n---\n", + "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470142)\n\n:::info[Description]\nRequest via this endpoint to create a deposit address for a currency you intend to deposit.\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| currency | string | currency |\n| chain | string | The chainId of currency, e.g. The available value for USDT are OMNI, ERC20, TRC20, default is ERC20. The available value for BTC are Native, Segwit, TRC20, the parameters are bech32, btc, trx, default is Native. This only apply for multi-chain currency, and there is no need for single chain currency. |\n| to | string | Deposit account type: main (funding account), trade (spot trading account), the default is main |\n| amount | string | Deposit amount. This parameter is only used when applying for invoices on the Lightning Network. This parameter is invalid if it is not passed through the Lightning Network. |\n\n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| address | string | Deposit address |\n| memo | string | Address remark. If there’s no remark, it is empty. When you withdraw from other platforms to the KuCoin, you need to fill in memo(tag). If you do not fill memo (tag), your deposit may not be available, please be cautious. |\n| chainId | string | The chainId of currency |\n| to | string | Deposit account type: main (funding account), trade (spot trading account) |\n| expirationDate | integer | Expiration time, Lightning network expiration time, non-Lightning network this field is invalid |\n| currency | string | currency |\n| chainName | string | The chainName of currency |\n\n---\n", "body": { "mode": "raw", - "raw": "{\n \"subName\": \"testapi6\",\n \"passphrase\": \"11223344\",\n \"remark\": \"TheRemark\",\n \"permission\": \"General,Spot,Futures\"\n}", + "raw": "{\n \"currency\": \"TON\",\n \"chain\": \"ton\",\n \"to\": \"trade\"\n}", "options": { "raw": { "language": "json" @@ -2213,9 +2391,9 @@ ], "path": [ "api", - "v1", - "sub", - "api-key" + "v3", + "deposit-address", + "create" ], "query": [] } @@ -2250,103 +2428,10 @@ } ], "cookie": [], - "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"subName\": \"testapi6\",\n \"remark\": \"TheRemark\",\n \"apiKey\": \"670621e3a25958000159c82f\",\n \"apiSecret\": \"46fd8974******896f005b2340\",\n \"apiVersion\": 3,\n \"passphrase\": \"11223344\",\n \"permission\": \"General,Futures\",\n \"createdAt\": 1728455139000\n }\n}" + "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"address\": \"EQCA1BI4QRZ8qYmskSRDzJmkucGodYRTZCf_b9hckjla6dZl\",\n \"memo\": \"2090821203\",\n \"chainId\": \"ton\",\n \"to\": \"TRADE\",\n \"expirationDate\": 0,\n \"currency\": \"TON\",\n \"chainName\": \"TON\"\n }\n}" } ] }, - { - "name": "Modify SubAccount API", - "request": { - "method": "POST", - "header": [], - "url": { - "raw": "", - "protocol": "https", - "host": [ - "{{spot_endpoint}}" - ], - "path": [ - "api", - "v1", - "sub", - "api-key", - "update" - ], - "query": [] - }, - "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470139)\n\n:::info[Description]\nThis endpoint can be used to modify sub-account APIs.\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| passphrase | string | Password(Must contain 7-32 characters. Cannot contain any spaces.) |\n| permission | string | [Permissions](https://www.kucoin.com/docs-new/doc-338144)(Only General、Spot、Futures、Margin、InnerTransfer(Flex Transfer) permissions can be set, such as \"General, Trade\". The default is \"General\") |\n| ipWhitelist | string | IP whitelist(You may add up to 20 IPs. Use a halfwidth comma to each IP) |\n| expire | string | API expiration time; Never expire(default)-1,30Day30,90Day90,180Day180,360Day360 |\n| subName | string | Sub-account name, create sub account name of API Key. |\n| apiKey | string | API-Key(Sub-account APIKey) |\n\n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| subName | string | Sub-account name |\n| apiKey | string | API Key |\n| permission | string | [Permissions](https://www.kucoin.com/docs-new/doc-338144) |\n| ipWhitelist | string | IP whitelist |\n\n---\n", - "body": { - "mode": "raw", - "raw": "{\n \"subName\": \"testapi6\",\n \"apiKey\": \"670621e3a25958000159c82f\",\n \"passphrase\": \"11223344\",\n \"permission\": \"General,Spot,Futures\"\n}", - "options": { - "raw": { - "language": "json" - } - } - } - }, - "response": [ - { - "name": "Successful Response", - "originalRequest": { - "method": "POST", - "header": [], - "url": { - "raw": "", - "protocol": "https", - "host": [ - "{{spot_endpoint}}" - ], - "path": [ - "api", - "v1", - "sub", - "api-key", - "update" - ], - "query": [] - } - }, - "status": "OK", - "code": 200, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "Content-Type", - "value": "application/json", - "name": "Content-Type", - "description": { - "content": "", - "type": "text/plain" - } - }, - { - "key": "gw-ratelimit-remaining", - "value": 1997, - "name": "gw-ratelimit-remaining" - }, - { - "key": "gw-ratelimit-limit", - "value": 2000, - "name": "gw-ratelimit-limit" - }, - { - "key": "gw-ratelimit-reset", - "value": 29990, - "name": "gw-ratelimit-reset" - } - ], - "cookie": [], - "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"subName\": \"testapi6\",\n \"apiKey\": \"670621e3a25958000159c82f\",\n \"permission\": \"General,Futures,Spot\"\n }\n}" - } - ] - } - ], - "description": "" - }, - { - "name": "Deposit", - "item": [ { "name": "Get Deposit Address(V3)", "request": { @@ -2510,122 +2595,7 @@ { "name": "Successful Response", "originalRequest": { - "method": "GET", - "header": [], - "url": { - "raw": "", - "protocol": "https", - "host": [ - "{{spot_endpoint}}" - ], - "path": [ - "api", - "v1", - "deposits" - ], - "query": [ - { - "key": "currency", - "value": "", - "description": "currency" - }, - { - "key": "status", - "value": "SUCCESS", - "description": "Status. Available value: PROCESSING, SUCCESS, and FAILURE" - }, - { - "key": "startAt", - "value": "1728663338000", - "description": "Start time (milisecond)" - }, - { - "key": "endAt", - "value": "1728692138000", - "description": "End time (milisecond)" - }, - { - "key": "currentPage", - "value": "1", - "description": "Current request page." - }, - { - "key": "pageSize", - "value": "50", - "description": "Number of results per request. Minimum is 10, maximum is 500." - } - ] - } - }, - "status": "OK", - "code": 200, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "Content-Type", - "value": "application/json", - "name": "Content-Type", - "description": { - "content": "", - "type": "text/plain" - } - }, - { - "key": "gw-ratelimit-remaining", - "value": 1997, - "name": "gw-ratelimit-remaining" - }, - { - "key": "gw-ratelimit-limit", - "value": 2000, - "name": "gw-ratelimit-limit" - }, - { - "key": "gw-ratelimit-reset", - "value": 29990, - "name": "gw-ratelimit-reset" - } - ], - "cookie": [], - "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"currentPage\": 1,\n \"pageSize\": 50,\n \"totalNum\": 5,\n \"totalPage\": 1,\n \"items\": [\n {\n \"currency\": \"USDT\",\n \"chain\": \"\",\n \"status\": \"SUCCESS\",\n \"address\": \"a435*****@gmail.com\",\n \"memo\": \"\",\n \"isInner\": true,\n \"amount\": \"1.00000000\",\n \"fee\": \"0.00000000\",\n \"walletTxId\": null,\n \"createdAt\": 1728555875000,\n \"updatedAt\": 1728555875000,\n \"remark\": \"\",\n \"arrears\": false\n },\n {\n \"currency\": \"USDT\",\n \"chain\": \"trx\",\n \"status\": \"SUCCESS\",\n \"address\": \"TSv3L1fS7******X4nLP6rqNxYz\",\n \"memo\": \"\",\n \"isInner\": true,\n \"amount\": \"6.00000000\",\n \"fee\": \"0.00000000\",\n \"walletTxId\": null,\n \"createdAt\": 1721730920000,\n \"updatedAt\": 1721730920000,\n \"remark\": \"\",\n \"arrears\": false\n }\n ]\n }\n}" - } - ] - }, - { - "name": "Add Deposit Address(V3)", - "request": { - "method": "POST", - "header": [], - "url": { - "raw": "", - "protocol": "https", - "host": [ - "{{spot_endpoint}}" - ], - "path": [ - "api", - "v3", - "deposit-address", - "create" - ], - "query": [] - }, - "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470142)\n\n:::info[Description]\nRequest via this endpoint to create a deposit address for a currency you intend to deposit.\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| currency | string | currency |\n| chain | string | The chainId of currency, e.g. The available value for USDT are OMNI, ERC20, TRC20, default is ERC20. The available value for BTC are Native, Segwit, TRC20, the parameters are bech32, btc, trx, default is Native. This only apply for multi-chain currency, and there is no need for single chain currency. |\n| to | string | Deposit account type: main (funding account), trade (spot trading account), the default is main |\n| amount | string | Deposit amount. This parameter is only used when applying for invoices on the Lightning Network. This parameter is invalid if it is not passed through the Lightning Network. |\n\n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| address | string | Deposit address |\n| memo | string | Address remark. If there’s no remark, it is empty. When you withdraw from other platforms to the KuCoin, you need to fill in memo(tag). If you do not fill memo (tag), your deposit may not be available, please be cautious. |\n| chainId | string | The chainId of currency |\n| to | string | Deposit account type: main (funding account), trade (spot trading account) |\n| expirationDate | integer | Expiration time, Lightning network expiration time, non-Lightning network this field is invalid |\n| currency | string | currency |\n| chainName | string | The chainName of currency |\n\n---\n", - "body": { - "mode": "raw", - "raw": "{\n \"currency\": \"TON\",\n \"chain\": \"ton\",\n \"to\": \"trade\"\n}", - "options": { - "raw": { - "language": "json" - } - } - } - }, - "response": [ - { - "name": "Successful Response", - "originalRequest": { - "method": "POST", + "method": "GET", "header": [], "url": { "raw": "", @@ -2635,11 +2605,41 @@ ], "path": [ "api", - "v3", - "deposit-address", - "create" + "v1", + "deposits" ], - "query": [] + "query": [ + { + "key": "currency", + "value": "", + "description": "currency" + }, + { + "key": "status", + "value": "SUCCESS", + "description": "Status. Available value: PROCESSING, SUCCESS, and FAILURE" + }, + { + "key": "startAt", + "value": "1728663338000", + "description": "Start time (milisecond)" + }, + { + "key": "endAt", + "value": "1728692138000", + "description": "End time (milisecond)" + }, + { + "key": "currentPage", + "value": "1", + "description": "Current request page." + }, + { + "key": "pageSize", + "value": "50", + "description": "Number of results per request. Minimum is 10, maximum is 500." + } + ] } }, "status": "OK", @@ -2672,7 +2672,7 @@ } ], "cookie": [], - "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"address\": \"EQCA1BI4QRZ8qYmskSRDzJmkucGodYRTZCf_b9hckjla6dZl\",\n \"memo\": \"2090821203\",\n \"chainId\": \"ton\",\n \"to\": \"TRADE\",\n \"expirationDate\": 0,\n \"currency\": \"TON\",\n \"chainName\": \"TON\"\n }\n}" + "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"currentPage\": 1,\n \"pageSize\": 50,\n \"totalNum\": 5,\n \"totalPage\": 1,\n \"items\": [\n {\n \"currency\": \"USDT\",\n \"chain\": \"\",\n \"status\": \"SUCCESS\",\n \"address\": \"a435*****@gmail.com\",\n \"memo\": \"\",\n \"isInner\": true,\n \"amount\": \"1.00000000\",\n \"fee\": \"0.00000000\",\n \"walletTxId\": null,\n \"createdAt\": 1728555875000,\n \"updatedAt\": 1728555875000,\n \"remark\": \"\",\n \"arrears\": false\n },\n {\n \"currency\": \"USDT\",\n \"chain\": \"trx\",\n \"status\": \"SUCCESS\",\n \"address\": \"TSv3L1fS7******X4nLP6rqNxYz\",\n \"memo\": \"\",\n \"isInner\": true,\n \"amount\": \"6.00000000\",\n \"fee\": \"0.00000000\",\n \"walletTxId\": null,\n \"createdAt\": 1721730920000,\n \"updatedAt\": 1721730920000,\n \"remark\": \"\",\n \"arrears\": false\n }\n ]\n }\n}" } ] } @@ -2781,6 +2781,89 @@ } ] }, + { + "name": "Withdraw(V3)", + "request": { + "method": "POST", + "header": [], + "url": { + "raw": "", + "protocol": "https", + "host": [ + "{{spot_endpoint}}" + ], + "path": [ + "api", + "v3", + "withdrawals" + ], + "query": [] + }, + "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470146)\n\n:::info[Description]\nUse this interface to withdraw the specified currency\n:::\n\n:::tip[Tips]\nOn the WEB end, you can open the switch of specified favorite addresses for withdrawal, and when it is turned on, it will verify whether your withdrawal address(including chain) is a favorite address(it is case sensitive); if it fails validation, it will respond with the error message {\"msg\":\"Already set withdraw whitelist, this address is not favorite address\",\"code\":\"260325\"}.\n:::\n\n\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| currency | string | currency |\n| chain | string | The chainId of currency, For a currency with multiple chains, it is recommended to specify chain parameter instead of using the default chain; you can query the chainId through the response of the GET /api/v3/currencies/{currency} interface. |\n| amount | integer | Withdrawal amount, a positive number which is a multiple of the amount precision |\n| memo | string | Address remark. If there’s no remark, it is empty. When you withdraw from other platforms to the KuCoin, you need to fill in memo(tag). If you do not fill memo (tag), your deposit may not be available, please be cautious. |\n| isInner | boolean | Internal withdrawal or not. Default : false |\n| remark | string | remark |\n| feeDeductType | string | Withdrawal fee deduction type: INTERNAL or EXTERNAL or not specified

1. INTERNAL- deduct the transaction fees from your withdrawal amount
2. EXTERNAL- deduct the transaction fees from your main account
3. If you don't specify the feeDeductType parameter, when the balance in your main account is sufficient to support the withdrawal, the system will initially deduct the transaction fees from your main account. But if the balance in your main account is not sufficient to support the withdrawal, the system will deduct the fees from your withdrawal amount. For example: Suppose you are going to withdraw 1 BTC from the KuCoin platform (transaction fee: 0.0001BTC), if the balance in your main account is insufficient, the system will deduct the transaction fees from your withdrawal amount. In this case, you will be receiving 0.9999BTC. |\n| toAddress | string | Withdrawal address |\n| withdrawType | string | Withdrawal type, ADDRESS (withdrawal address), UID, MAIL (email), PHONE (mobile phone number). Note: If you withdraw by uid/mail/phone, there will have rate limited: 3 times/10 seconds, 50 times/24 hours (calculated on a rolling basis based on the first request time) |\n\n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| withdrawalId | string | Withdrawal id, a unique ID for a withdrawal |\n\n---\n", + "body": { + "mode": "raw", + "raw": "{\n \"currency\": \"USDT\",\n \"toAddress\": \"TKFRQXSDcY****GmLrjJggwX8\",\n \"amount\": 3,\n \"withdrawType\": \"ADDRESS\",\n \"chain\": \"trx\",\n \"isInner\": true,\n \"remark\": \"this is Remark\"\n}", + "options": { + "raw": { + "language": "json" + } + } + } + }, + "response": [ + { + "name": "Successful Response", + "originalRequest": { + "method": "POST", + "header": [], + "url": { + "raw": "", + "protocol": "https", + "host": [ + "{{spot_endpoint}}" + ], + "path": [ + "api", + "v3", + "withdrawals" + ], + "query": [] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json", + "name": "Content-Type", + "description": { + "content": "", + "type": "text/plain" + } + }, + { + "key": "gw-ratelimit-remaining", + "value": 1997, + "name": "gw-ratelimit-remaining" + }, + { + "key": "gw-ratelimit-limit", + "value": 2000, + "name": "gw-ratelimit-limit" + }, + { + "key": "gw-ratelimit-reset", + "value": 29990, + "name": "gw-ratelimit-reset" + } + ], + "cookie": [], + "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"withdrawalId\": \"670deec84d64da0007d7c946\"\n }\n}" + } + ] + }, { "name": "Cancel Withdrawal", "request": { @@ -2994,89 +3077,6 @@ "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"currentPage\": 1,\n \"pageSize\": 50,\n \"totalNum\": 5,\n \"totalPage\": 1,\n \"items\": [\n {\n \"currency\": \"USDT\",\n \"chain\": \"\",\n \"status\": \"SUCCESS\",\n \"address\": \"a435*****@gmail.com\",\n \"memo\": \"\",\n \"isInner\": true,\n \"amount\": \"1.00000000\",\n \"fee\": \"0.00000000\",\n \"walletTxId\": null,\n \"createdAt\": 1728555875000,\n \"updatedAt\": 1728555875000,\n \"remark\": \"\",\n \"arrears\": false\n },\n {\n \"currency\": \"USDT\",\n \"chain\": \"trx\",\n \"status\": \"SUCCESS\",\n \"address\": \"TSv3L1fS7******X4nLP6rqNxYz\",\n \"memo\": \"\",\n \"isInner\": true,\n \"amount\": \"6.00000000\",\n \"fee\": \"0.00000000\",\n \"walletTxId\": null,\n \"createdAt\": 1721730920000,\n \"updatedAt\": 1721730920000,\n \"remark\": \"\",\n \"arrears\": false\n }\n ]\n }\n}" } ] - }, - { - "name": "Withdraw(V3)", - "request": { - "method": "POST", - "header": [], - "url": { - "raw": "", - "protocol": "https", - "host": [ - "{{spot_endpoint}}" - ], - "path": [ - "api", - "v3", - "withdrawals" - ], - "query": [] - }, - "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470146)\n\n:::info[Description]\nUse this interface to withdraw the specified currency\n:::\n\n:::tip[Tips]\nOn the WEB end, you can open the switch of specified favorite addresses for withdrawal, and when it is turned on, it will verify whether your withdrawal address(including chain) is a favorite address(it is case sensitive); if it fails validation, it will respond with the error message {\"msg\":\"Already set withdraw whitelist, this address is not favorite address\",\"code\":\"260325\"}.\n:::\n\n\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| currency | string | currency |\n| chain | string | The chainId of currency, For a currency with multiple chains, it is recommended to specify chain parameter instead of using the default chain; you can query the chainId through the response of the GET /api/v3/currencies/{currency} interface. |\n| amount | integer | Withdrawal amount, a positive number which is a multiple of the amount precision |\n| memo | string | Address remark. If there’s no remark, it is empty. When you withdraw from other platforms to the KuCoin, you need to fill in memo(tag). If you do not fill memo (tag), your deposit may not be available, please be cautious. |\n| isInner | boolean | Internal withdrawal or not. Default : false |\n| remark | string | remark |\n| feeDeductType | string | Withdrawal fee deduction type: INTERNAL or EXTERNAL or not specified

1. INTERNAL- deduct the transaction fees from your withdrawal amount
2. EXTERNAL- deduct the transaction fees from your main account
3. If you don't specify the feeDeductType parameter, when the balance in your main account is sufficient to support the withdrawal, the system will initially deduct the transaction fees from your main account. But if the balance in your main account is not sufficient to support the withdrawal, the system will deduct the fees from your withdrawal amount. For example: Suppose you are going to withdraw 1 BTC from the KuCoin platform (transaction fee: 0.0001BTC), if the balance in your main account is insufficient, the system will deduct the transaction fees from your withdrawal amount. In this case, you will be receiving 0.9999BTC. |\n| toAddress | string | Withdrawal address |\n| withdrawType | string | Withdrawal type, ADDRESS (withdrawal address), UID, MAIL (email), PHONE (mobile phone number). Note: If you withdraw by uid/mail/phone, there will have rate limited: 3 times/10 seconds, 50 times/24 hours (calculated on a rolling basis based on the first request time) |\n\n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| withdrawalId | string | Withdrawal id, a unique ID for a withdrawal |\n\n---\n", - "body": { - "mode": "raw", - "raw": "{\n \"currency\": \"USDT\",\n \"toAddress\": \"TKFRQXSDcY****GmLrjJggwX8\",\n \"amount\": 3,\n \"withdrawType\": \"ADDRESS\",\n \"chain\": \"trx\",\n \"isInner\": true,\n \"remark\": \"this is Remark\"\n}", - "options": { - "raw": { - "language": "json" - } - } - } - }, - "response": [ - { - "name": "Successful Response", - "originalRequest": { - "method": "POST", - "header": [], - "url": { - "raw": "", - "protocol": "https", - "host": [ - "{{spot_endpoint}}" - ], - "path": [ - "api", - "v3", - "withdrawals" - ], - "query": [] - } - }, - "status": "OK", - "code": 200, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "Content-Type", - "value": "application/json", - "name": "Content-Type", - "description": { - "content": "", - "type": "text/plain" - } - }, - { - "key": "gw-ratelimit-remaining", - "value": 1997, - "name": "gw-ratelimit-remaining" - }, - { - "key": "gw-ratelimit-limit", - "value": 2000, - "name": "gw-ratelimit-limit" - }, - { - "key": "gw-ratelimit-reset", - "value": 29990, - "name": "gw-ratelimit-reset" - } - ], - "cookie": [], - "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"withdrawalId\": \"670deec84d64da0007d7c946\"\n }\n}" - } - ] } ], "description": "" @@ -3085,9 +3085,9 @@ "name": "Transfer", "item": [ { - "name": "Flex Transfer", + "name": "Get Transfer Quotas", "request": { - "method": "POST", + "method": "GET", "header": [], "url": { "raw": "", @@ -3097,28 +3097,36 @@ ], "path": [ "api", - "v3", + "v1", "accounts", - "universal-transfer" + "transferable" ], - "query": [] - }, - "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470147)\n\n:::info[Description]\nThis interface can be used for transfers between master and sub accounts and inner transfers\n:::\n\n\n\nThe API Key needs to have universal transfer permission when calling.\n\nSupport internal transfer,do not support transfers between sub-accounts.\n\nSupport transfer between master and sub accounts (only applicable to master account APIKey).\n\nMARGIN_V2 only supports internal transfers between MARGIN and does not support transfers between master and sub accounts.\n\nISOLATED_V2 only supports internal transfers between ISOLATED and does not support transfers between master and sub accounts.\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| clientOid | string | Unique order id created by users to identify their orders, e.g. UUID, with a maximum length of 128 bits |\n| currency | string | currency |\n| amount | string | Transfer amount, the amount is a positive integer multiple of the currency precision. |\n| fromUserId | string | Transfer out UserId, This is required when transferring sub-account to master-account. It is optional for internal transfers. |\n| fromAccountType | string | Account type:MAIN、TRADE、CONTRACT、MARGIN、ISOLATED、MARGIN_V2、ISOLATED_V2 |\n| fromAccountTag | string | Symbol, required when the account type is ISOLATED or ISOLATED_V2, for example: BTC-USDT |\n| type | string | Transfer type:INTERNAL(Transfer within account)、PARENT_TO_SUB(Transfer from master-account to sub-account),SUB_TO_PARENT(Transfer from sub-account to master-account) |\n| toUserId | string | Transfer in UserId, This is required when transferring master-account to sub-account. It is optional for internal transfers. |\n| toAccountType | string | Account type:MAIN、TRADE、CONTRACT、MARGIN、ISOLATED、MARGIN_V2、ISOLATED_V2 |\n| toAccountTag | string | Symbol, required when the account type is ISOLATED or ISOLATED_V2, for example: BTC-USDT |\n\n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| orderId | string | Transfer order ID |\n\n---\n", - "body": { - "mode": "raw", - "raw": "//transfer from master-account to sub-account\n{\n \"clientOid\": \"64ccc0f164781800010d8c09\",\n \"type\": \"PARENT_TO_SUB\",\n \"currency\": \"USDT\",\n \"amount\": \"0.01\",\n \"fromAccountType\": \"TRADE\",\n \"toUserId\": \"63743f07e0c5230001761d08\",\n \"toAccountType\": \"TRADE\"\n}\n\n//transfer from sub-account to master-account\n// {\n// \"clientOid\": \"64ccc0f164781800010d8c09\",\n// \"type\": \"SUB_TO_PARENT\",\n// \"currency\": \"BTC\",\n// \"amount\": 1,\n// \"fromUserId\": \"62f5f5d4d72aaf000122707e\",\n// \"fromAccountType\": \"TRADE\",\n// \"toAccountType\": \"CONTRACT\"\n// }\n\n// internal transfer\n// {\n// \"clientOid\": \"53666633336123\",\n// \"type\": \"INTERNAL\",\n// \"currency\": \"BTC\",\n// \"amount\": 0.0003,\n// \"fromAccountType\": \"TRADE\",\n// \"toAccountType\": \"MAIN\"\n// }\n\n\n\n\n\n", - "options": { - "raw": { - "language": "json" + "query": [ + { + "key": "currency", + "value": "", + "description": "currency" + }, + { + "key": "type", + "value": "MAIN", + "description": "The account type:MAIN、TRADE、MARGIN、ISOLATED" + }, + { + "key": "tag", + "value": null, + "description": "Trading pair, required when the account type is ISOLATED; other types are not passed, e.g.: BTC-USDT" } - } - } + ] + }, + "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470148)\n\n:::info[Description]\nThis endpoint returns the transferable balance of a specified account.\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| currency | string | Currency |\n| balance | string | Total funds in an account. |\n| available | string | Funds available to withdraw or trade. |\n| holds | string | Funds on hold (not available for use). |\n| transferable | string | Funds available to transfer. |\n\n---\n", + "body": {} }, "response": [ { "name": "Successful Response", "originalRequest": { - "method": "POST", + "method": "GET", "header": [], "url": { "raw": "", @@ -3128,11 +3136,27 @@ ], "path": [ "api", - "v3", + "v1", "accounts", - "universal-transfer" + "transferable" ], - "query": [] + "query": [ + { + "key": "currency", + "value": "", + "description": "currency" + }, + { + "key": "type", + "value": "MAIN", + "description": "The account type:MAIN、TRADE、MARGIN、ISOLATED" + }, + { + "key": "tag", + "value": null, + "description": "Trading pair, required when the account type is ISOLATED; other types are not passed, e.g.: BTC-USDT" + } + ] } }, "status": "OK", @@ -3165,14 +3189,14 @@ } ], "cookie": [], - "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"orderId\": \"6705f7248c6954000733ecac\"\n }\n}" + "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"currency\": \"USDT\",\n \"balance\": \"10.5\",\n \"available\": \"10.5\",\n \"holds\": \"0\",\n \"transferable\": \"10.5\"\n }\n}" } ] }, { - "name": "Get Transfer Quotas", + "name": "Flex Transfer", "request": { - "method": "GET", + "method": "POST", "header": [], "url": { "raw": "", @@ -3182,36 +3206,28 @@ ], "path": [ "api", - "v1", + "v3", "accounts", - "transferable" + "universal-transfer" ], - "query": [ - { - "key": "currency", - "value": "", - "description": "currency" - }, - { - "key": "type", - "value": "MAIN", - "description": "The account type:MAIN、TRADE、MARGIN、ISOLATED" - }, - { - "key": "tag", - "value": null, - "description": "Trading pair, required when the account type is ISOLATED; other types are not passed, e.g.: BTC-USDT" - } - ] + "query": [] }, - "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470148)\n\n:::info[Description]\nThis endpoint returns the transferable balance of a specified account.\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| currency | string | Currency |\n| balance | string | Total funds in an account. |\n| available | string | Funds available to withdraw or trade. |\n| holds | string | Funds on hold (not available for use). |\n| transferable | string | Funds available to transfer. |\n\n---\n", - "body": {} + "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470147)\n\n:::info[Description]\nThis interface can be used for transfers between master and sub accounts and inner transfers\n:::\n\n\n\nThe API Key needs to have universal transfer permission when calling.\n\nSupport internal transfer,do not support transfers between sub-accounts.\n\nSupport transfer between master and sub accounts (only applicable to master account APIKey).\n\nMARGIN_V2 only supports internal transfers between MARGIN and does not support transfers between master and sub accounts.\n\nISOLATED_V2 only supports internal transfers between ISOLATED and does not support transfers between master and sub accounts.\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| clientOid | string | Unique order id created by users to identify their orders, e.g. UUID, with a maximum length of 128 bits |\n| currency | string | currency |\n| amount | string | Transfer amount, the amount is a positive integer multiple of the currency precision. |\n| fromUserId | string | Transfer out UserId, This is required when transferring sub-account to master-account. It is optional for internal transfers. |\n| fromAccountType | string | Account type:MAIN、TRADE、CONTRACT、MARGIN、ISOLATED、MARGIN_V2、ISOLATED_V2 |\n| fromAccountTag | string | Symbol, required when the account type is ISOLATED or ISOLATED_V2, for example: BTC-USDT |\n| type | string | Transfer type:INTERNAL(Transfer within account)、PARENT_TO_SUB(Transfer from master-account to sub-account),SUB_TO_PARENT(Transfer from sub-account to master-account) |\n| toUserId | string | Transfer in UserId, This is required when transferring master-account to sub-account. It is optional for internal transfers. |\n| toAccountType | string | Account type:MAIN、TRADE、CONTRACT、MARGIN、ISOLATED、MARGIN_V2、ISOLATED_V2 |\n| toAccountTag | string | Symbol, required when the account type is ISOLATED or ISOLATED_V2, for example: BTC-USDT |\n\n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| orderId | string | Transfer order ID |\n\n---\n", + "body": { + "mode": "raw", + "raw": "//transfer from master-account to sub-account\n{\n \"clientOid\": \"64ccc0f164781800010d8c09\",\n \"type\": \"PARENT_TO_SUB\",\n \"currency\": \"USDT\",\n \"amount\": \"0.01\",\n \"fromAccountType\": \"TRADE\",\n \"toUserId\": \"63743f07e0c5230001761d08\",\n \"toAccountType\": \"TRADE\"\n}\n\n//transfer from sub-account to master-account\n// {\n// \"clientOid\": \"64ccc0f164781800010d8c09\",\n// \"type\": \"SUB_TO_PARENT\",\n// \"currency\": \"BTC\",\n// \"amount\": 1,\n// \"fromUserId\": \"62f5f5d4d72aaf000122707e\",\n// \"fromAccountType\": \"TRADE\",\n// \"toAccountType\": \"CONTRACT\"\n// }\n\n// internal transfer\n// {\n// \"clientOid\": \"53666633336123\",\n// \"type\": \"INTERNAL\",\n// \"currency\": \"BTC\",\n// \"amount\": 0.0003,\n// \"fromAccountType\": \"TRADE\",\n// \"toAccountType\": \"MAIN\"\n// }\n\n\n\n\n\n", + "options": { + "raw": { + "language": "json" + } + } + } }, "response": [ { "name": "Successful Response", "originalRequest": { - "method": "GET", + "method": "POST", "header": [], "url": { "raw": "", @@ -3221,27 +3237,11 @@ ], "path": [ "api", - "v1", + "v3", "accounts", - "transferable" + "universal-transfer" ], - "query": [ - { - "key": "currency", - "value": "", - "description": "currency" - }, - { - "key": "type", - "value": "MAIN", - "description": "The account type:MAIN、TRADE、MARGIN、ISOLATED" - }, - { - "key": "tag", - "value": null, - "description": "Trading pair, required when the account type is ISOLATED; other types are not passed, e.g.: BTC-USDT" - } - ] + "query": [] } }, "status": "OK", @@ -3274,7 +3274,7 @@ } ], "cookie": [], - "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"currency\": \"USDT\",\n \"balance\": \"10.5\",\n \"available\": \"10.5\",\n \"holds\": \"0\",\n \"transferable\": \"10.5\"\n }\n}" + "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"orderId\": \"6705f7248c6954000733ecac\"\n }\n}" } ] } @@ -3558,7 +3558,7 @@ "name": "Market Data", "item": [ { - "name": "Get All Currencies", + "name": "Get Announcements", "request": { "method": "GET", "header": [], @@ -3571,97 +3571,42 @@ "path": [ "api", "v3", - "currencies" + "announcements" ], - "query": [] - }, - "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470152)\n\n:::info[Description]\nRequest via this endpoint to get the currency list. Not all currencies currently can be used for trading.\n:::\n\n:::tip[Tips]\n**CURRENCY CODES**\n\nCurrency codes will conform to the ISO 4217 standard where possible. Currencies which have or had no representation in ISO 4217 may use a custom code.\n\n\n| Code | Description |\n| --- | --- |\n| BTC | Bitcoin |\n| ETH | Ethereum |\n| KCS | Kucoin Shares |\n\nFor a coin, the \"**currency**\" is a fixed value and works as the only recognized identity of the coin. As the \"**name**\", \"**fullnane**\" and \"**precision**\" of a coin are modifiable values, when the \"name\" of a coin is changed, you should use \"**currency**\" to get the coin.\n\nFor example: The \"**currency**\" of XRB is \"XRB\", if the \"**name**\" of XRB is changed into \"**Nano**\", you should use \"XRB\" (the currency of XRB) to search the coin.\n:::\n\n\n\n\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | array | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| currency | string | A unique currency code that will never change |\n| name | string | Currency name, will change after renaming |\n| fullName | string | Full name of a currency, will change after renaming |\n| precision | integer | Currency precision |\n| confirms | integer | Number of block confirmations |\n| contractAddress | string | Contract address |\n| isMarginEnabled | boolean | Support margin or not |\n| isDebitEnabled | boolean | Support debit or not |\n| chains | array | Refer to the schema section of chains |\n\n**root.data.chains Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| chainName | string | chain name of currency |\n| withdrawalMinSize | string | Minimum withdrawal amount |\n| depositMinSize | string | Minimum deposit amount |\n| withdrawFeeRate | string | withdraw fee rate |\n| withdrawalMinFee | string | Minimum fees charged for withdrawal |\n| isWithdrawEnabled | boolean | Support withdrawal or not |\n| isDepositEnabled | boolean | Support deposit or not |\n| confirms | integer | Number of block confirmations |\n| preConfirms | integer | The number of blocks (confirmations) for advance on-chain verification |\n| contractAddress | string | Contract address |\n| withdrawPrecision | integer | Withdrawal precision bit, indicating the maximum supported length after the decimal point of the withdrawal amount |\n| maxWithdraw | string | Maximum amount of single withdrawal |\n| maxDeposit | string | Maximum amount of single deposit (only applicable to Lightning Network) |\n| needTag | boolean | whether memo/tag is needed |\n| chainId | string | chain id of currency |\n| depositFeeRate | string | deposit fee rate (some currencies have this param, the default is empty) |\n| withdrawMaxFee | string | withdraw max fee(some currencies have this param, the default is empty) |\n| depositTierFee | string | |\n\n---\n", - "body": {} - }, - "response": [ - { - "name": "Successful Response", - "originalRequest": { - "method": "GET", - "header": [], - "url": { - "raw": "", - "protocol": "https", - "host": [ - "{{spot_endpoint}}" - ], - "path": [ - "api", - "v3", - "currencies" - ], - "query": [] - } - }, - "status": "OK", - "code": 200, - "_postman_previewlanguage": "json", - "header": [ + "query": [ { - "key": "Content-Type", - "value": "application/json", - "name": "Content-Type", - "description": { - "content": "", - "type": "text/plain" - } + "key": "currentPage", + "value": "1", + "description": "page number" }, { - "key": "gw-ratelimit-remaining", - "value": 1997, - "name": "gw-ratelimit-remaining" + "key": "pageSize", + "value": "50", + "description": "page Size" }, { - "key": "gw-ratelimit-limit", - "value": 2000, - "name": "gw-ratelimit-limit" + "key": "annType", + "value": "latest-announcements", + "description": "Announcement types: latest-announcements , activities (latest activities), new-listings (new currency online), product-updates (product updates), vip (institutions and VIPs), maintenance-updates (system maintenance), product -updates (product news), delistings (currency offline), others, api-campaigns (API user activities), default : latest-announcements" }, { - "key": "gw-ratelimit-reset", - "value": 29990, - "name": "gw-ratelimit-reset" - } - ], - "cookie": [], - "body": "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"currency\": \"BTC\",\n \"name\": \"BTC\",\n \"fullName\": \"Bitcoin\",\n \"precision\": 8,\n \"confirms\": null,\n \"contractAddress\": null,\n \"isMarginEnabled\": true,\n \"isDebitEnabled\": true,\n \"chains\": [\n {\n \"chainName\": \"BTC\",\n \"withdrawalMinSize\": \"0.001\",\n \"depositMinSize\": \"0.0002\",\n \"withdrawFeeRate\": \"0\",\n \"withdrawalMinFee\": \"0.0005\",\n \"isWithdrawEnabled\": true,\n \"isDepositEnabled\": true,\n \"confirms\": 3,\n \"preConfirms\": 1,\n \"contractAddress\": \"\",\n \"withdrawPrecision\": 8,\n \"maxWithdraw\": null,\n \"maxDeposit\": null,\n \"needTag\": false,\n \"chainId\": \"btc\"\n },\n {\n \"chainName\": \"Lightning Network\",\n \"withdrawalMinSize\": \"0.00001\",\n \"depositMinSize\": \"0.00001\",\n \"withdrawFeeRate\": \"0\",\n \"withdrawalMinFee\": \"0.000015\",\n \"isWithdrawEnabled\": true,\n \"isDepositEnabled\": true,\n \"confirms\": 1,\n \"preConfirms\": 1,\n \"contractAddress\": \"\",\n \"withdrawPrecision\": 8,\n \"maxWithdraw\": null,\n \"maxDeposit\": \"0.03\",\n \"needTag\": false,\n \"chainId\": \"btcln\"\n },\n {\n \"chainName\": \"KCC\",\n \"withdrawalMinSize\": \"0.0008\",\n \"depositMinSize\": null,\n \"withdrawFeeRate\": \"0\",\n \"withdrawalMinFee\": \"0.00002\",\n \"isWithdrawEnabled\": true,\n \"isDepositEnabled\": true,\n \"confirms\": 20,\n \"preConfirms\": 20,\n \"contractAddress\": \"0xfa93c12cd345c658bc4644d1d4e1b9615952258c\",\n \"withdrawPrecision\": 8,\n \"maxWithdraw\": null,\n \"maxDeposit\": null,\n \"needTag\": false,\n \"chainId\": \"kcc\"\n },\n {\n \"chainName\": \"BTC-Segwit\",\n \"withdrawalMinSize\": \"0.0008\",\n \"depositMinSize\": \"0.0002\",\n \"withdrawFeeRate\": \"0\",\n \"withdrawalMinFee\": \"0.0005\",\n \"isWithdrawEnabled\": false,\n \"isDepositEnabled\": true,\n \"confirms\": 2,\n \"preConfirms\": 2,\n \"contractAddress\": \"\",\n \"withdrawPrecision\": 8,\n \"maxWithdraw\": null,\n \"maxDeposit\": null,\n \"needTag\": false,\n \"chainId\": \"bech32\"\n }\n ]\n },\n {\n \"currency\": \"BTCP\",\n \"name\": \"BTCP\",\n \"fullName\": \"Bitcoin Private\",\n \"precision\": 8,\n \"confirms\": null,\n \"contractAddress\": null,\n \"isMarginEnabled\": false,\n \"isDebitEnabled\": false,\n \"chains\": [\n {\n \"chainName\": \"BTCP\",\n \"withdrawalMinSize\": \"0.100000\",\n \"depositMinSize\": null,\n \"withdrawFeeRate\": \"0\",\n \"withdrawalMinFee\": \"0.010000\",\n \"isWithdrawEnabled\": false,\n \"isDepositEnabled\": false,\n \"confirms\": 6,\n \"preConfirms\": 6,\n \"contractAddress\": \"\",\n \"withdrawPrecision\": 8,\n \"maxWithdraw\": null,\n \"maxDeposit\": null,\n \"needTag\": false,\n \"chainId\": \"btcp\"\n }\n ]\n }\n ]\n}" - } - ] - }, - { - "name": "Get Fiat Price", - "request": { - "method": "GET", - "header": [], - "url": { - "raw": "", - "protocol": "https", - "host": [ - "{{spot_endpoint}}" - ], - "path": [ - "api", - "v1", - "prices" - ], - "query": [ + "key": "lang", + "value": "en_US", + "description": "Language type, the default is en_US, the specific value parameters are as follows" + }, { - "key": "base", - "value": "", - "description": "Ticker symbol of a base currency,eg.USD,EUR. Default is USD" + "key": "startTime", + "value": "1729594043000", + "description": "Announcement online start time (milliseconds)" }, { - "key": "currencies", - "value": "", - "description": "Comma-separated cryptocurrencies to be converted into fiat, e.g.: BTC,ETH, etc. Default to return the fiat price of all currencies." + "key": "endTime", + "value": "1729697729000", + "description": "Announcement online end time (milliseconds)" } ] }, - "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470153)\n\n:::info[Description]\nRequest via this endpoint to get the fiat price of the currencies for the available trading pairs.\n:::\n\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| AGLD | string | |\n| DFI | string | |\n| PYTHUP | string | |\n| ISLM | string | |\n| NEAR | string | |\n| AIOZ | string | |\n| AUDIO | string | |\n| BBL | string | |\n| WLD | string | |\n| HNT | string | |\n| ETHFI | string | |\n| DMAIL | string | |\n| OPUP | string | |\n| VET3S | string | |\n| MANA3S | string | |\n| TIDAL | string | |\n| HALO | string | |\n| OPUL | string | |\n| MANA3L | string | |\n| DGB | string | |\n| AA | string | |\n| BCH | string | |\n| GMEE | string | |\n| JST | string | |\n| PBUX | string | |\n| AR | string | |\n| SEI | string | |\n| PSTAKE | string | |\n| LMWR | string | |\n| UNFIDOWN | string | |\n| BB | string | |\n| JTO | string | |\n| WEMIX | string | |\n| G | string | |\n| MARSH | string | |\n| BN | string | |\n| FLIP | string | |\n| FLR | string | |\n| BIGTIME | string | |\n| FLY | string | |\n| T | string | |\n| W | string | |\n| BDX | string | |\n| BABYDOGE | string | |\n| SFP | string | |\n| DIA | string | |\n| ISME | string | |\n| LYM | string | |\n| VET3L | string | |\n| JUP | string | |\n| LYX | string | |\n| AIEPK | string | |\n| SILLY | string | |\n| SCPT | string | |\n| WOO | string | |\n| BLUR | string | |\n| STRK | string | |\n| BFC | string | |\n| DC | string | |\n| KARATE | string | |\n| SUSHI3L | string | |\n| NETVR | string | |\n| WAVES | string | |\n| LITH | string | |\n| HAPI | string | |\n| SUSHI3S | string | |\n| CEEK | string | |\n| FLOKI | string | |\n| SHR | string | |\n| SAND | string | |\n| TURT | string | |\n| UMA | string | |\n| BEPRO | string | |\n| SCRT | string | |\n| TUSD | string | |\n| COOKIE | string | |\n| LRDS | string | |\n| SIN | string | |\n| OAS | string | |\n| ROOT | string | |\n| ADA3L | string | |\n| TIAUP | string | |\n| HTR | string | |\n| UNB | string | |\n| UNA | string | |\n| HARD | string | |\n| G3 | string | |\n| ADA3S | string | |\n| MYRO | string | |\n| HTX | string | |\n| FT | string | |\n| BTCDOWN | string | |\n| UNI | string | |\n| FX | string | |\n| OBI | string | |\n| UNO | string | |\n| WRX | string | |\n| TIADOWN | string | |\n| ETHDOWN | string | |\n| WELL | string | |\n| SWFTC | string | |\n| SKL | string | |\n| UOS | string | |\n| AIPAD | string | |\n| BRETT | string | |\n| SKY | string | |\n| FRM | string | |\n| VISION | string | |\n| LENDS | string | |\n| SLF | string | |\n| BULL | string | |\n| FLOW | string | |\n| ODDZ | string | |\n| SLN | string | |\n| UPO | string | |\n| SLP | string | |\n| ID | string | |\n| SLIM | string | |\n| SPOT | string | |\n| DOP | string | |\n| ISSP | string | |\n| UQC | string | |\n| IO | string | |\n| DOT | string | |\n| 1INCH | string | |\n| SMH | string | |\n| MAK | string | |\n| TOKO | string | |\n| TURBO | string | |\n| UNFI | string | |\n| MAN | string | |\n| EVER | string | |\n| FTM | string | |\n| SHRAP | string | |\n| MAV | string | |\n| MAX | string | |\n| DPR | string | |\n| FTT | string | |\n| ARKM | string | |\n| ATOM | string | |\n| PENDLE | string | |\n| QUICK | string | |\n| BLZ | string | |\n| BOBA | string | |\n| MBL | string | |\n| OFN | string | |\n| UNIO | string | |\n| SNS | string | |\n| SNX | string | |\n| NXRA | string | |\n| TAIKO | string | |\n| AVAX3L | string | |\n| L3 | string | |\n| API3 | string | |\n| XRP3S | string | |\n| QKC | string | |\n| AVAX3S | string | |\n| ROSE | string | |\n| SATS | string | |\n| BMX | string | |\n| PORTAL | string | |\n| TOMI | string | |\n| XRP3L | string | |\n| SOL | string | |\n| SON | string | |\n| BNC | string | |\n| SOCIAL | string | |\n| CGPT | string | |\n| CELR | string | |\n| BNB | string | |\n| OGN | string | |\n| CELO | string | |\n| AUCTION | string | |\n| MANTA | string | |\n| LAYER | string | |\n| AERO | string | |\n| CETUS | string | |\n| LL | string | |\n| SPA | string | |\n| PYTHDOWN | string | |\n| NEIROCTO | string | |\n| UTK | string | |\n| GMRX | string | |\n| BOB | string | |\n| HOTCROSS | string | |\n| AERGO | string | |\n| MOCA | string | |\n| SQD | string | |\n| MV | string | |\n| BNB3L | string | |\n| BNB3S | string | |\n| GALAX3L | string | |\n| KAI | string | |\n| SQR | string | |\n| GALAX3S | string | |\n| EGLD | string | |\n| ZBCN | string | |\n| KAS | string | |\n| MEW | string | |\n| PUNDIX | string | |\n| LOOKS | string | |\n| FXS | string | |\n| BOSON | string | |\n| BRISE | string | |\n| AEVO | string | |\n| FLUX | string | |\n| PRCL | string | |\n| UNFIUP | string | |\n| SEIDOWN | string | |\n| DOAI | string | |\n| QNT | string | |\n| REDO | string | |\n| STRIKE | string | |\n| ETHW | string | |\n| OM | string | |\n| OP | string | |\n| WHALE | string | |\n| 1CAT | string | |\n| NEON | string | |\n| GTAI | string | |\n| SSV | string | |\n| ETH2 | string | |\n| KCS | string | |\n| ARPA | string | |\n| ARTFI | string | |\n| BRL | string | |\n| ALEX | string | |\n| STG | string | |\n| SHIB | string | |\n| IOTX | string | |\n| OLE | string | |\n| KDA | string | |\n| CERE | string | |\n| DOCK | string | |\n| STX | string | |\n| OLT | string | |\n| QI | string | |\n| SDAO | string | |\n| BLAST | string | |\n| LINK3S | string | |\n| IOST | string | |\n| SUI | string | |\n| CAKE | string | |\n| BSW | string | |\n| OMG | string | |\n| VOLT | string | |\n| LINK3L | string | |\n| GEEQ | string | |\n| PYUSD | string | |\n| SUN | string | |\n| TOWER | string | |\n| BTC | string | |\n| IOTA | string | |\n| REEF | string | |\n| TRIAS | string | |\n| KEY | string | |\n| ETH3L | string | |\n| BTT | string | |\n| ONE | string | |\n| RENDER | string | |\n| ETH3S | string | |\n| ANKR | string | |\n| ALGO | string | |\n| SYLO | string | |\n| ZCX | string | |\n| SD | string | |\n| ONT | string | |\n| MJT | string | |\n| DYM | string | |\n| DYP | string | |\n| BAKEUP | string | |\n| OOE | string | |\n| ZELIX | string | |\n| DOGE3L | string | |\n| ARTY | string | |\n| QORPO | string | |\n| ICE | string | |\n| NOTAI | string | |\n| DOGE3S | string | |\n| NAKA | string | |\n| GALAX | string | |\n| MKR | string | |\n| DODO | string | |\n| ICP | string | |\n| ZEC | string | |\n| ZEE | string | |\n| ICX | string | |\n| KMNO | string | |\n| TT | string | |\n| DOT3L | string | |\n| XAI | string | |\n| ZEN | string | |\n| DOGE | string | |\n| ALPHA | string | |\n| DUSK | string | |\n| DOT3S | string | |\n| SXP | string | |\n| HBAR | string | |\n| SYNT | string | |\n| ZEX | string | |\n| BONDLY | string | |\n| MLK | string | |\n| KICKS | string | |\n| PEPE | string | |\n| OUSD | string | |\n| LUNCDOWN | string | |\n| DOGS | string | |\n| REV3L | string | |\n| CTSI | string | |\n| C98 | string | |\n| OSMO | string | |\n| NTRN | string | |\n| CFX2S | string | |\n| SYN | string | |\n| VIDT | string | |\n| SYS | string | |\n| GAS | string | |\n| BOME | string | |\n| COMBO | string | |\n| XCH | string | |\n| VR | string | |\n| CFX2L | string | |\n| VSYS | string | |\n| PANDORA | string | |\n| THETA | string | |\n| XCN | string | |\n| NEXG | string | |\n| MELOS | string | |\n| XCV | string | |\n| ORN | string | |\n| WLKN | string | |\n| AAVE | string | |\n| MNT | string | |\n| BONK | string | |\n| PERP | string | |\n| XDC | string | |\n| MNW | string | |\n| XDB | string | |\n| BOND | string | |\n| SUIA | string | |\n| MOG | string | |\n| SUTER | string | |\n| TIME | string | |\n| RACA | string | |\n| BICO | string | |\n| MON | string | |\n| SWEAT | string | |\n| MOXIE | string | |\n| BABYBNB | string | |\n| IGU | string | |\n| HMSTR | string | |\n| XEC | string | |\n| MONI | string | |\n| XR | string | |\n| PEOPLE | string | |\n| PUMLX | string | |\n| ZIL | string | |\n| WLDDOWN | string | |\n| VAI | string | |\n| XEN | string | |\n| MPC | string | |\n| XEM | string | |\n| JASMY3S | string | |\n| OTK | string | |\n| TRAC | string | |\n| DFYN | string | |\n| BIDP | string | |\n| JASMY3L | string | |\n| INJDOWN | string | |\n| KLV | string | |\n| WAXL | string | |\n| TRBDOWN | string | |\n| BCH3L | string | |\n| GMT3S | string | |\n| KMD | string | |\n| BCH3S | string | |\n| ECOX | string | |\n| AAVE3S | string | |\n| GMT3L | string | |\n| EPIK | string | |\n| SUIP | string | |\n| AAVE3L | string | |\n| ZK | string | |\n| ZKF | string | |\n| OMNIA | string | |\n| ZKJ | string | |\n| ZKL | string | |\n| GAFI | string | |\n| CARV | string | |\n| KNC | string | |\n| CATS | string | |\n| PROM | string | |\n| ALEPH | string | |\n| PONKE | string | |\n| OVR | string | |\n| CATI | string | |\n| ORDER | string | |\n| GFT | string | |\n| BIFI | string | |\n| GGC | string | |\n| GGG | string | |\n| DAPPX | string | |\n| SUKU | string | |\n| ULTI | string | |\n| CREDI | string | |\n| ERTHA | string | |\n| FURY | string | |\n| KARRAT | string | |\n| MOBILE | string | |\n| SIDUS | string | |\n| NAVI | string | |\n| TAO | string | |\n| USDJ | string | |\n| MTL | string | |\n| VET | string | |\n| FITFI | string | |\n| USDT | string | |\n| OXT | string | |\n| CANDY | string | |\n| USDP | string | |\n| MTS | string | |\n| TADA | string | |\n| MTV | string | |\n| NAVX | string | |\n| ILV | string | |\n| VINU | string | |\n| GHX | string | |\n| EDU | string | |\n| HYVE | string | |\n| BTC3L | string | |\n| ANYONE | string | |\n| BEAT | string | |\n| KING | string | |\n| CREAM | string | |\n| CAS | string | |\n| IMX | string | |\n| CAT | string | |\n| BTC3S | string | |\n| USDE | string | |\n| USDD | string | |\n| CWAR | string | |\n| USDC | string | |\n| KRL | string | |\n| INJ | string | |\n| GAME | string | |\n| TRIBL | string | |\n| XLM | string | |\n| TRBUP | string | |\n| VRADOWN | string | |\n| SUPER | string | |\n| EIGEN | string | |\n| IOI | string | |\n| KSM | string | |\n| CCD | string | |\n| EGO | string | |\n| EGP | string | |\n| MXC | string | |\n| TEL | string | |\n| MOVR | string | |\n| XMR | string | |\n| MXM | string | |\n| OORT | string | |\n| GLM | string | |\n| RAY | string | |\n| XTAG | string | |\n| GLQ | string | |\n| CWEB | string | |\n| REVU | string | |\n| REVV | string | |\n| ZRO | string | |\n| XNL | string | |\n| XNO | string | |\n| SAROS | string | |\n| KACE | string | |\n| ZRX | string | |\n| WLTH | string | |\n| ATOM3L | string | |\n| GMM | string | |\n| BEER | string | |\n| GMT | string | |\n| HEART | string | |\n| GMX | string | |\n| ABBC | string | |\n| OMNI | string | |\n| ATOM3S | string | |\n| IRL | string | |\n| CFG | string | |\n| WSDM | string | |\n| GNS | string | |\n| VANRY | string | |\n| CFX | string | |\n| GRAIL | string | |\n| BEFI | string | |\n| VELO | string | |\n| XPR | string | |\n| DOVI | string | |\n| ACE | string | |\n| ACH | string | |\n| ISP | string | |\n| XCAD | string | |\n| MINA | string | |\n| TIA | string | |\n| DRIFT | string | |\n| ACQ | string | |\n| ACS | string | |\n| MIND | string | |\n| STORE | string | |\n| REN | string | |\n| ELA | string | |\n| DREAMS | string | |\n| ADA | string | |\n| ELF | string | |\n| REQ | string | |\n| STORJ | string | |\n| LADYS | string | |\n| PAXG | string | |\n| REZ | string | |\n| XRD | string | |\n| CHO | string | |\n| CHR | string | |\n| ADS | string | |\n| CHZ | string | |\n| ADX | string | |\n| XRP | string | |\n| JASMY | string | |\n| KAGI | string | |\n| FIDA | string | |\n| PBR | string | |\n| AEG | string | |\n| H2O | string | |\n| CHMB | string | |\n| SAND3L | string | |\n| PBX | string | |\n| SOLVE | string | |\n| DECHAT | string | |\n| GARI | string | |\n| SHIB2L | string | |\n| SHIB2S | string | |\n| ENA | string | |\n| VEMP | string | |\n| ENJ | string | |\n| AFG | string | |\n| RATS | string | |\n| GRT | string | |\n| FORWARD | string | |\n| TFUEL | string | |\n| ENS | string | |\n| KASDOWN | string | |\n| XTM | string | |\n| DEGEN | string | |\n| TLM | string | |\n| DYDXDOWN | string | |\n| CKB | string | |\n| LUNC | string | |\n| AURORA | string | |\n| LUNA | string | |\n| XTZ | string | |\n| ELON | string | |\n| DMTR | string | |\n| EOS | string | |\n| GST | string | |\n| FORT | string | |\n| FLAME | string | |\n| PATEX | string | |\n| DEEP | string | |\n| ID3L | string | |\n| GTC | string | |\n| ID3S | string | |\n| RIO | string | |\n| CLH | string | |\n| BURGER | string | |\n| VRA | string | |\n| SUNDOG | string | |\n| GTT | string | |\n| INJUP | string | |\n| CPOOL | string | |\n| EPX | string | |\n| CLV | string | |\n| FEAR | string | |\n| MEME | string | |\n| ROOBEE | string | |\n| DEFI | string | |\n| TOKEN | string | |\n| GRAPE | string | |\n| KASUP | string | |\n| XWG | string | |\n| SKEY | string | |\n| SFUND | string | |\n| EQX | string | |\n| ORDIUP | string | |\n| TON | string | |\n| DEGO | string | |\n| IZI | string | |\n| ERG | string | |\n| ERN | string | |\n| VENOM | string | |\n| VOXEL | string | |\n| RLC | string | |\n| PHA | string | |\n| DYDXUP | string | |\n| APE3S | string | |\n| ORBS | string | |\n| OPDOWN | string | |\n| ESE | string | |\n| APE3L | string | |\n| HMND | string | |\n| COQ | string | |\n| AURY | string | |\n| CULT | string | |\n| AKT | string | |\n| GLMR | string | |\n| XYM | string | |\n| ORAI | string | |\n| XYO | string | |\n| ETC | string | |\n| LAI | string | |\n| PIP | string | |\n| ETH | string | |\n| NEO | string | |\n| RMV | string | |\n| KLAY | string | |\n| PIT | string | |\n| TARA | string | |\n| KALT | string | |\n| PIX | string | |\n| ETN | string | |\n| CSIX | string | |\n| TRADE | string | |\n| MAVIA | string | |\n| HIGH | string | |\n| TRB | string | |\n| ORDI | string | |\n| TRVL | string | |\n| AMB | string | |\n| TRU | string | |\n| LOGX | string | |\n| FINC | string | |\n| INFRA | string | |\n| NATIX | string | |\n| NFP | string | |\n| TRY | string | |\n| TRX | string | |\n| LBP | string | |\n| LBR | string | |\n| EUL | string | |\n| NFT | string | |\n| SEIUP | string | |\n| PUFFER | string | |\n| EUR | string | |\n| ORCA | string | |\n| NEAR3L | string | |\n| AMP | string | |\n| XDEFI | string | |\n| HIFI | string | |\n| TRUF | string | |\n| AITECH | string | |\n| AMU | string | |\n| USTC | string | |\n| KNGL | string | |\n| FOXY | string | |\n| NGC | string | |\n| TENET | string | |\n| NEAR3S | string | |\n| MAHA | string | |\n| NGL | string | |\n| TST | string | |\n| HIPPO | string | |\n| AXS3S | string | |\n| CRO | string | |\n| ZPAY | string | |\n| MNDE | string | |\n| CRV | string | |\n| SWASH | string | |\n| AXS3L | string | |\n| VERSE | string | |\n| RPK | string | |\n| RPL | string | |\n| AZERO | string | |\n| SOUL | string | |\n| VXV | string | |\n| LDO | string | |\n| MAGIC | string | |\n| ALICE | string | |\n| SEAM | string | |\n| PLU | string | |\n| AOG | string | |\n| SMOLE | string | |\n| EWT | string | |\n| TSUGT | string | |\n| PMG | string | |\n| OPAI | string | |\n| LOCUS | string | |\n| CTA | string | |\n| NIM | string | |\n| CTC | string | |\n| APE | string | |\n| MERL | string | |\n| JAM | string | |\n| CTI | string | |\n| APP | string | |\n| APT | string | |\n| WLDUP | string | |\n| ZEND | string | |\n| FIRE | string | |\n| DENT | string | |\n| PYTH | string | |\n| LFT | string | |\n| DPET | string | |\n| ORDIDOWN | string | |\n| KPOL | string | |\n| ETHUP | string | |\n| BAND | string | |\n| POL | string | |\n| ASTR | string | |\n| NKN | string | |\n| RSR | string | |\n| DVPN | string | |\n| TWT | string | |\n| ARB | string | |\n| CVC | string | |\n| ARC | string | |\n| XETA | string | |\n| MTRG | string | |\n| LOKA | string | |\n| LPOOL | string | |\n| TURBOS | string | |\n| CVX | string | |\n| ARX | string | |\n| MPLX | string | |\n| SUSHI | string | |\n| NLK | string | |\n| PEPE2 | string | |\n| WBTC | string | |\n| SUI3L | string | |\n| CWS | string | |\n| SUI3S | string | |\n| INSP | string | |\n| MANA | string | |\n| VRTX | string | |\n| CSPR | string | |\n| ATA | string | |\n| OPEN | string | |\n| HAI | string | |\n| NMR | string | |\n| ATH | string | |\n| LIT | string | |\n| TLOS | string | |\n| TNSR | string | |\n| CXT | string | |\n| POLYX | string | |\n| ZERO | string | |\n| ROUTE | string | |\n| LOOM | string | |\n| PRE | string | |\n| VRAUP | string | |\n| HBB | string | |\n| RVN | string | |\n| PRQ | string | |\n| ONDO | string | |\n| PEPEDOWN | string | |\n| WOOP | string | |\n| LUNCUP | string | |\n| KAVA | string | |\n| LKI | string | |\n| AVA | string | |\n| NOM | string | |\n| MAPO | string | |\n| PEPEUP | string | |\n| STRAX | string | |\n| NOT | string | |\n| ZERC | string | |\n| BCUT | string | |\n| MASA | string | |\n| WAN | string | |\n| WAT | string | |\n| WAX | string | |\n| MASK | string | |\n| EOS3L | string | |\n| IDEA | string | |\n| EOS3S | string | |\n| YFI | string | |\n| MOODENG | string | |\n| XCUR | string | |\n| HYDRA | string | |\n| POPCAT | string | |\n| LQTY | string | |\n| PIXEL | string | |\n| LMR | string | |\n| ZETA | string | |\n| YGG | string | |\n| AXS | string | |\n| BCHSV | string | |\n| NRN | string | |\n| FTON | string | |\n| COMP | string | |\n| XPRT | string | |\n| HFT | string | |\n| UXLINK | string | |\n| STAMP | string | |\n| RUNE | string | |\n| ZEUS | string | |\n| LTC3L | string | |\n| DAPP | string | |\n| FORTH | string | |\n| ALPINE | string | |\n| SENSO | string | |\n| LTC3S | string | |\n| DEXE | string | |\n| GOAL | string | |\n| AVAX | string | |\n| LISTA | string | |\n| AMPL | string | |\n| WORK | string | |\n| BRWL | string | |\n| BANANA | string | |\n| PUSH | string | |\n| WEN | string | |\n| NEIRO | string | |\n| BTCUP | string | |\n| SOL3S | string | |\n| BRAWL | string | |\n| LAY3R | string | |\n| LPT | string | |\n| GODS | string | |\n| SAND3S | string | |\n| RDNT | string | |\n| SOL3L | string | |\n| NIBI | string | |\n| NUM | string | |\n| PYR | string | |\n| DAG | string | |\n| DAI | string | |\n| HIP | string | |\n| DAO | string | |\n| AVAIL | string | |\n| DAR | string | |\n| FET | string | |\n| FCON | string | |\n| XAVA | string | |\n| LRC | string | |\n| UNI3S | string | |\n| POKT | string | |\n| DASH | string | |\n| BAKEDOWN | string | |\n| POLC | string | |\n| CIRUS | string | |\n| UNI3L | string | |\n| NWC | string | |\n| POLK | string | |\n| LSD | string | |\n| MARS4 | string | |\n| LSK | string | |\n| BLOCK | string | |\n| ANALOS | string | |\n| SAFE | string | |\n| DCK | string | |\n| LSS | string | |\n| DCR | string | |\n| LIKE | string | |\n| DATA | string | |\n| WIF | string | |\n| BLOK | string | |\n| LTC | string | |\n| METIS | string | |\n| WIN | string | |\n| HLG | string | |\n| LTO | string | |\n| DYDX | string | |\n| ARB3S | string | |\n| MUBI | string | |\n| ARB3L | string | |\n| RBTC1 | string | |\n| POND | string | |\n| LINA | string | |\n| MYRIA | string | |\n| LINK | string | |\n| QTUM | string | |\n| TUNE | string | |\n| UFO | string | |\n| CYBER | string | |\n| WILD | string | |\n| POLS | string | |\n| NYM | string | |\n| FIL | string | |\n| BAL | string | |\n| SCA | string | |\n| STND | string | |\n| WMTX | string | |\n| SCLP | string | |\n| MANEKI | string | |\n| BAT | string | |\n| AKRO | string | |\n| FTM3L | string | |\n| BAX | string | |\n| FTM3S | string | |\n| COTI | string | |\n\n---\n", + "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470157)\n\n:::info[Description]\nThis interface can obtain the latest news announcements, and the default page search is for announcements within a month.\n:::\n\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| totalNum | integer | Total Number |\n| items | array | Refer to the schema section of items |\n| currentPage | integer | Current page |\n| pageSize | integer | Page size |\n| totalPage | integer | Total Page |\n\n**root.data.items Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| annId | integer | Announcement ID |\n| annTitle | string | Announcement title |\n| annType | array | Refer to the schema section of annType |\n| annDesc | string | Announcement description |\n| cTime | integer | Announcement release time, Unix millisecond timestamp format |\n| language | string | language type |\n| annUrl | string | Announcement link |\n\n---\n", "body": {} }, "response": [ @@ -3678,19 +3623,39 @@ ], "path": [ "api", - "v1", - "prices" + "v3", + "announcements" ], "query": [ { - "key": "base", - "value": "", - "description": "Ticker symbol of a base currency,eg.USD,EUR. Default is USD" + "key": "currentPage", + "value": "1", + "description": "page number" }, { - "key": "currencies", - "value": "", - "description": "Comma-separated cryptocurrencies to be converted into fiat, e.g.: BTC,ETH, etc. Default to return the fiat price of all currencies." + "key": "pageSize", + "value": "50", + "description": "page Size" + }, + { + "key": "annType", + "value": "latest-announcements", + "description": "Announcement types: latest-announcements , activities (latest activities), new-listings (new currency online), product-updates (product updates), vip (institutions and VIPs), maintenance-updates (system maintenance), product -updates (product news), delistings (currency offline), others, api-campaigns (API user activities), default : latest-announcements" + }, + { + "key": "lang", + "value": "en_US", + "description": "Language type, the default is en_US, the specific value parameters are as follows" + }, + { + "key": "startTime", + "value": "1729594043000", + "description": "Announcement online start time (milliseconds)" + }, + { + "key": "endTime", + "value": "1729697729000", + "description": "Announcement online end time (milliseconds)" } ] } @@ -3725,12 +3690,12 @@ } ], "cookie": [], - "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"AGLD\": \"1.1174410000000001\",\n \"DFI\": \"0.0168915500000000\",\n \"PYTHUP\": \"0.0397880960000000\",\n \"ISLM\": \"0.0606196750000000\",\n \"NEAR\": \"4.7185395500000000\",\n \"AIOZ\": \"0.4862867350000000\",\n \"AUDIO\": \"0.1219390000000000\",\n \"BBL\": \"0.0067766100000000\",\n \"WLD\": \"2.2893547500000000\",\n \"HNT\": \"5.8990489999999984\",\n \"ETHFI\": \"1.5892050000000000\",\n \"DMAIL\": \"0.2726636000000000\",\n \"OPUP\": \"0.0986506500000000\",\n \"VET3S\": \"0.0003700448850000\",\n \"MANA3S\": \"0.0006056970000000\",\n \"TIDAL\": \"0.0001154422500000\",\n \"HALO\": \"0.0058270850000000\",\n \"OPUL\": \"0.0839480050000000\",\n \"MANA3L\": \"0.0029569407900000\",\n \"DGB\": \"0.0066556705000000\",\n \"AA\": \"0.2406796000000000\",\n \"BCH\": \"366.2167999999996484\",\n \"GMEE\": \"0.0113333305000000\",\n \"JST\": \"0.0302348750000000\",\n \"PBUX\": \"0.0208795550000000\",\n \"AR\": \"18.5457224999999909\",\n \"SEI\": \"0.4332832500000000\",\n \"PSTAKE\": \"0.0493153300000000\",\n \"LMWR\": \"0.1618190500000000\",\n \"UNFIDOWN\": \"0.0062058955000000\",\n \"BB\": \"0.3245376500000000\",\n \"JTO\": \"2.1239375000000002\",\n \"WEMIX\": \"0.7916040000000000\",\n \"G\": \"0.0324037900000000\",\n \"MARSH\": \"0.0617591050000000\",\n \"BN\": \"0.0036961510000000\",\n \"FLIP\": \"1.0976509000000000\",\n \"FLR\": \"0.0144827550000000\",\n \"BIGTIME\": \"0.1238780300000000\",\n \"FLY\": \"0.0005157420000000\",\n \"T\": \"0.0233483200000000\",\n \"W\": \"0.2865566500000000\",\n \"BDX\": \"0.0774012800000000\",\n \"BABYDOGE\": \"0.0000000029375305\",\n \"SFP\": \"0.7256370000000000\",\n \"DIA\": \"0.9179408000000000\",\n \"ISME\": \"0.0022388800000000\",\n \"LYM\": \"0.0010155919500000\",\n \"VET3L\": \"0.0000289755050000\",\n \"JUP\": \"0.8230882500000000\",\n \"LYX\": \"1.4501745500000001\",\n \"AIEPK\": \"0.0050094940000000\",\n \"SILLY\": \"0.0159420250000000\",\n \"SCPT\": \"0.0122038950000000\",\n \"WOO\": \"0.1796601250000000\",\n \"BLUR\": \"0.2462768000000000\",\n \"STRK\": \"0.3963117450000000\",\n \"BFC\": \"0.0383608100000000\",\n \"DC\": \"0.0003097450500000\",\n \"KARATE\": \"0.0007296350000000\",\n \"SUSHI3L\": \"0.5115441000000000\",\n \"NETVR\": \"0.0976111700000000\",\n \"WAVES\": \"1.0806594000000000\",\n \"LITH\": \"0.0001520239500000\",\n \"HAPI\": \"8.6533711499999987\",\n \"SUSHI3S\": \"1.2752620500000000\",\n \"CEEK\": \"0.0294852500000000\",\n \"FLOKI\": \"0.0001414292500000\",\n \"SHR\": \"0.0012463765000000\",\n \"SAND\": \"0.2566616050000000\",\n \"TURT\": \"0.0020889550000000\",\n \"UMA\": \"2.5207390000000000\",\n \"BEPRO\": \"0.0003955021500000\",\n \"SCRT\": \"0.1995002000000000\",\n \"TUSD\": \"0.9945025000000000\",\n \"COOKIE\": \"0.0220089900000000\",\n \"LRDS\": \"0.6218889000000000\",\n \"SIN\": \"0.0033633175000000\",\n \"OAS\": \"0.0331933950000000\",\n \"ROOT\": \"0.0183108400000000\",\n \"ADA3L\": \"0.0046396790000000\",\n \"TIAUP\": \"0.1228385500000000\",\n \"HTR\": \"0.0353023400000000\",\n \"UNB\": \"0.0003837080500000\",\n \"UNA\": \"0.0164917500000000\",\n \"HARD\": \"0.1087056200000000\",\n \"G3\": \"0.0502648550000000\",\n \"ADA3S\": \"0.0006191202850000\",\n \"MYRO\": \"0.1071863800000000\",\n \"HTX\": \"0.0000013693150000\",\n \"FT\": \"0.3585206500000000\",\n \"BTCDOWN\": \"0.1065467000000000\",\n \"UNI\": \"7.3571195999999993\",\n \"FX\": \"0.1379310000000000\",\n \"OBI\": \"0.0079030465000000\",\n \"UNO\": \"0.0137131400000000\",\n \"WRX\": \"0.1221389000000000\",\n \"TIADOWN\": \"0.0000914642450000\",\n \"ETHDOWN\": \"0.1306346500000000\",\n \"WELL\": \"0.0471244260000000\",\n \"SWFTC\": \"0.0028966509500000\",\n \"SKL\": \"0.0362418700000000\",\n \"UOS\": \"0.0867765900000000\",\n \"AIPAD\": \"0.0478660550000000\",\n \"BRETT\": \"0.1037481000000000\",\n \"SKY\": \"0.0520139800000000\",\n \"FRM\": \"0.0153123400000000\",\n \"VISION\": \"0.0014451770500000\",\n \"LENDS\": \"0.0047276350000000\",\n \"SLF\": \"0.3318340000000000\",\n \"BULL\": \"0.0023988000000000\",\n \"FLOW\": \"0.5372312500000000\",\n \"ODDZ\": \"0.0063368300000000\",\n \"SLN\": \"0.2804597000000000\",\n \"UPO\": \"0.0440779500000000\",\n \"SLP\": \"0.0023997995000000\",\n \"ID\": \"0.3718140000000000\",\n \"SLIM\": \"0.0906446550000000\",\n \"SPOT\": \"0.0021289350000000\",\n \"DOP\": \"0.0023028480000000\",\n \"ISSP\": \"0.0000874562500000\",\n \"UQC\": \"3.2339822000000003\",\n \"IO\": \"1.8185902499999999\",\n \"DOT\": \"4.2022978000000005\",\n \"1INCH\": \"0.2645676500000000\",\n \"SMH\": \"0.3448275000000000\",\n \"MAK\": \"0.0396701550000000\",\n \"TOKO\": \"0.0005923037000000\",\n \"TURBO\": \"0.0108085930000000\",\n \"UNFI\": \"2.8555714999999996\",\n \"MAN\": \"0.0210764565000000\",\n \"EVER\": \"0.0332733550000000\",\n \"FTM\": \"0.7259068650000000\",\n \"SHRAP\": \"0.0476361700000000\",\n \"MAV\": \"0.1738130500000000\",\n \"MAX\": \"0.2864966800000000\",\n \"DPR\": \"0.0018240875000000\",\n \"FTT\": \"2.0559715000000002\",\n \"ARKM\": \"1.7444273499999999\",\n \"ATOM\": \"4.2954512000000002\",\n \"PENDLE\": \"4.1554212500000007\",\n \"QUICK\": \"0.0365317250000000\",\n \"BLZ\": \"0.1217191100000000\",\n \"BOBA\": \"0.2014092450000000\",\n \"MBL\": \"0.0027856065000000\",\n \"OFN\": \"0.1252373500000000\",\n \"UNIO\": \"0.0025487250000000\",\n \"SNS\": \"0.0200899500000000\",\n \"SNX\": \"1.4282854999999999\",\n \"NXRA\": \"0.0272763550000000\",\n \"TAIKO\": \"1.4392800000000001\",\n \"AVAX3L\": \"0.1410875109550000\",\n \"L3\": \"0.0608395650000000\",\n \"API3\": \"1.3728132500000001\",\n \"XRP3S\": \"0.0028095945000000\",\n \"QKC\": \"0.0085157400000000\",\n \"AVAX3S\": \"0.5148424500000000\",\n \"ROSE\": \"0.0693453100000000\",\n \"SATS\": \"0.0000002701648500\",\n \"BMX\": \"0.3100449000000000\",\n \"PORTAL\": \"0.2811593500000000\",\n \"TOMI\": \"0.0309045400000000\",\n \"XRP3L\": \"2.1586201500000002\",\n \"SOL\": \"151.7250995000003583\",\n \"SON\": \"0.0002421788500000\",\n \"BNC\": \"0.1882058500000000\",\n \"SOCIAL\": \"0.0026486750000000\",\n \"CGPT\": \"0.1305147100000000\",\n \"CELR\": \"0.0127736100000000\",\n \"BNB\": \"591.0973035000118935\",\n \"OGN\": \"0.0852573500000000\",\n \"CELO\": \"0.7711142500000000\",\n \"AUCTION\": \"13.1634150000000014\",\n \"MANTA\": \"0.7564216000000000\",\n \"LAYER\": \"0.0372713550000000\",\n \"AERO\": \"1.3783104999999999\",\n \"CETUS\": \"0.1808295400000000\",\n \"LL\": \"0.0201199350000000\",\n \"SPA\": \"0.0067426270000000\",\n \"PYTHDOWN\": \"0.0011834080000000\",\n \"NEIROCTO\": \"0.0019964013000000\",\n \"UTK\": \"0.0365217300000000\",\n \"GMRX\": \"0.0007386305000000\",\n \"BOB\": \"0.0000380619595000\",\n \"HOTCROSS\": \"0.0056491740000000\",\n \"AERGO\": \"0.1007595950000000\",\n \"MOCA\": \"0.0783608000000000\",\n \"SQD\": \"0.0380809500000000\",\n \"MV\": \"0.0081359300000000\",\n \"BNB3L\": \"0.2761618500000000\",\n \"BNB3S\": \"0.0008545725000000\",\n \"GALAX3L\": \"0.0057571999600000\",\n \"KAI\": \"0.0020080954500000\",\n \"SQR\": \"0.0470764500000000\",\n \"GALAX3S\": \"0.1933033000000000\",\n \"EGLD\": \"25.5272299999999713\",\n \"ZBCN\": \"0.0010404795000000\",\n \"KAS\": \"0.1216691350000000\",\n \"MEW\": \"0.0086176890000000\",\n \"PUNDIX\": \"0.4130933500000000\",\n \"LOOKS\": \"0.0392803500000000\",\n \"FXS\": \"1.9060465000000000\",\n \"BOSON\": \"0.2732633000000000\",\n \"BRISE\": \"0.0000000860569500\",\n \"AEVO\": \"0.3388305000000000\",\n \"FLUX\": \"0.5276360500000000\",\n \"PRCL\": \"0.1969015000000000\",\n \"UNFIUP\": \"0.0011654170000000\",\n \"SEIDOWN\": \"0.0442778500000000\",\n \"DOAI\": \"0.0052363805000000\",\n \"QNT\": \"65.4312679999998206\",\n \"REDO\": \"0.2837580500000000\",\n \"STRIKE\": \"6.8225869999999997\",\n \"ETHW\": \"3.2418782499999998\",\n \"OM\": \"1.5396797750000000\",\n \"OP\": \"1.6911539999999999\",\n \"WHALE\": \"0.8134930500000000\",\n \"1CAT\": \"0.0018460765000000\",\n \"NEON\": \"0.4446775500000000\",\n \"GTAI\": \"0.7786105000000000\",\n \"SSV\": \"21.2393749999999841\",\n \"ETH2\": \"2601.6678843156403923\",\n \"KCS\": \"8.7646155000000020\",\n \"ARPA\": \"0.0393882960000000\",\n \"ARTFI\": \"0.0141029450000000\",\n \"BRL\": \"0.1742807323452485\",\n \"ALEX\": \"0.0924537500000000\",\n \"STG\": \"0.2943527500000000\",\n \"SHIB\": \"0.0000178060925000\",\n \"IOTX\": \"0.0394202800000000\",\n \"OLE\": \"0.0171414250000000\",\n \"KDA\": \"0.5653172000000000\",\n \"CERE\": \"0.0022548720000000\",\n \"DOCK\": \"0.0018990500000000\",\n \"STX\": \"1.8157916500000000\",\n \"OLT\": \"0.0007596200000000\",\n \"QI\": \"0.0131754090000000\",\n \"SDAO\": \"0.2748625000000000\",\n \"BLAST\": \"0.0087636160000000\",\n \"LINK3S\": \"0.0000702948350000\",\n \"IOST\": \"0.0049745115000000\",\n \"SUI\": \"2.0589700000000000\",\n \"CAKE\": \"1.7941024999999999\",\n \"BSW\": \"0.0586706500000000\",\n \"OMG\": \"0.2597700500000000\",\n \"VOLT\": \"0.0000002716641000\",\n \"LINK3L\": \"1.3408292499999999\",\n \"GEEQ\": \"0.0385607100000000\",\n \"PYUSD\": \"0.9988003500000000\",\n \"SUN\": \"0.0186106900000000\",\n \"TOWER\": \"0.0014812590000000\",\n \"BTC\": \"67133.4165000832051564\",\n \"IOTA\": \"0.1189405000000000\",\n \"REEF\": \"0.0019960015000000\",\n \"TRIAS\": \"3.3683149999999998\",\n \"KEY\": \"0.0037594713240047\",\n \"ETH3L\": \"0.0003305946200000\",\n \"BTT\": \"0.0000009117439000\",\n \"ONE\": \"0.0132003965000000\",\n \"RENDER\": \"5.2263854999999995\",\n \"ETH3S\": \"0.5517240000000000\",\n \"ANKR\": \"0.0264867500000000\",\n \"ALGO\": \"0.1188405500000000\",\n \"SYLO\": \"0.0007600198000000\",\n \"ZCX\": \"0.0784707450000000\",\n \"SD\": \"0.3851073500000000\",\n \"ONT\": \"0.1877960550000000\",\n \"MJT\": \"0.0132433750000000\",\n \"DYM\": \"1.6659666000000001\",\n \"DYP\": \"0.0205397250000000\",\n \"BAKEUP\": \"0.0389894955000000\",\n \"OOE\": \"0.0079360300000000\",\n \"ZELIX\": \"0.0000649675000000\",\n \"DOGE3L\": \"0.3837080500000000\",\n \"ARTY\": \"0.3980009000000000\",\n \"QORPO\": \"0.1204297550000000\",\n \"ICE\": \"0.0051504235000000\",\n \"NOTAI\": \"0.0000892753400000\",\n \"DOGE3S\": \"0.2291853500000000\",\n \"NAKA\": \"1.0695649500000000\",\n \"GALAX\": \"0.0212893500000000\",\n \"MKR\": \"1245.8767500000163833\",\n \"DODO\": \"0.1152423500000000\",\n \"ICP\": \"7.6731615000000027\",\n \"ZEC\": \"35.9400209999999543\",\n \"ZEE\": \"0.0065767100000000\",\n \"ICX\": \"0.1383308000000000\",\n \"KMNO\": \"0.0921499020000000\",\n \"TT\": \"0.0033883050000000\",\n \"DOT3L\": \"0.1454272500000000\",\n \"XAI\": \"0.2038980000000000\",\n \"ZEN\": \"8.0149905000000007\",\n \"DOGE\": \"0.1213093150000000\",\n \"ALPHA\": \"0.0567416150000000\",\n \"DUSK\": \"0.1964517250000000\",\n \"DOT3S\": \"0.0053613180000000\",\n \"SXP\": \"0.2538730000000000\",\n \"HBAR\": \"0.0510044850000000\",\n \"SYNT\": \"0.0467166300000000\",\n \"ZEX\": \"0.0571714000000000\",\n \"BONDLY\": \"0.0022208890000000\",\n \"MLK\": \"0.2080859050000000\",\n \"KICKS\": \"0.0001301249050000\",\n \"PEPE\": \"0.0000100249850000\",\n \"OUSD\": \"0.9982006500000000\",\n \"LUNCDOWN\": \"0.0000733333150000\",\n \"DOGS\": \"0.0007086455000000\",\n \"REV3L\": \"0.0094672640000000\",\n \"CTSI\": \"0.1257371000000000\",\n \"C98\": \"0.1219390000000000\",\n \"OSMO\": \"0.5370313500000000\",\n \"NTRN\": \"0.3869064500000000\",\n \"CFX2S\": \"0.0084757600000000\",\n \"SYN\": \"0.5636180500000000\",\n \"VIDT\": \"0.0308745550000000\",\n \"SYS\": \"0.0997501000000000\",\n \"GAS\": \"4.3029474500000008\",\n \"BOME\": \"0.0087336310000000\",\n \"COMBO\": \"0.4068964500000000\",\n \"XCH\": \"14.9825050000000010\",\n \"VR\": \"0.0063538215000000\",\n \"CFX2L\": \"0.0499660045000000\",\n \"VSYS\": \"0.0005201398000000\",\n \"PANDORA\": \"1629.2949450001102772\",\n \"THETA\": \"1.2461766000000000\",\n \"XCN\": \"0.0012699647000000\",\n \"NEXG\": \"0.0039180400000000\",\n \"MELOS\": \"0.0021244372500000\",\n \"XCV\": \"0.0013253370000000\",\n \"ORN\": \"0.8797599000000000\",\n \"WLKN\": \"0.0010624685000000\",\n \"AAVE\": \"154.2708259999996162\",\n \"MNT\": \"0.6168914000000000\",\n \"BONK\": \"0.0000227296295000\",\n \"PERP\": \"0.6037979500000000\",\n \"XDC\": \"0.0276361750000000\",\n \"MNW\": \"0.3681158500000000\",\n \"XDB\": \"0.0002578710000000\",\n \"BOND\": \"1.5662165000000000\",\n \"SUIA\": \"0.0809595000000000\",\n \"MOG\": \"0.0000019330330000\",\n \"SUTER\": \"0.0001840079500000\",\n \"TIME\": \"16.2648634999999969\",\n \"RACA\": \"0.0001949025000000\",\n \"BICO\": \"0.2021988500000000\",\n \"MON\": \"0.1066466500000000\",\n \"SWEAT\": \"0.0063718125000000\",\n \"MOXIE\": \"0.0022088950000000\",\n \"BABYBNB\": \"0.0289755050000000\",\n \"IGU\": \"0.0050674650000000\",\n \"HMSTR\": \"0.0037990995000000\",\n \"XEC\": \"0.0000354722550000\",\n \"MONI\": \"0.0058470750000000\",\n \"XR\": \"0.2374812000000000\",\n \"PEOPLE\": \"0.0796601500000000\",\n \"PUMLX\": \"0.0054572700000000\",\n \"ZIL\": \"0.0145927000000000\",\n \"WLDDOWN\": \"0.2089954500000000\",\n \"VAI\": \"0.0799999800000000\",\n \"XEN\": \"0.0000000839580000\",\n \"MPC\": \"0.1001499000000000\",\n \"XEM\": \"0.0176951480000000\",\n \"JASMY3S\": \"0.0019670160000000\",\n \"OTK\": \"0.0290464695000000\",\n \"TRAC\": \"0.4521738000000000\",\n \"DFYN\": \"0.0070664650000000\",\n \"BIDP\": \"0.0001939030000000\",\n \"JASMY3L\": \"0.0001653772700000\",\n \"INJDOWN\": \"0.0000194902500000\",\n \"KLV\": \"0.0019310340000000\",\n \"WAXL\": \"0.7858069000000000\",\n \"TRBDOWN\": \"0.0023138425000000\",\n \"BCH3L\": \"4.6390663064999996\",\n \"GMT3S\": \"0.0000457771000000\",\n \"KMD\": \"0.2493752500000000\",\n \"BCH3S\": \"0.9634180500000000\",\n \"ECOX\": \"0.0987506000000000\",\n \"AAVE3S\": \"0.0560719500000000\",\n \"GMT3L\": \"0.0053983694650000\",\n \"EPIK\": \"0.0045857060000000\",\n \"SUIP\": \"0.1067565950000000\",\n \"AAVE3L\": \"0.3638687346200000\",\n \"ZK\": \"0.1262368500000000\",\n \"ZKF\": \"0.0008595700000000\",\n \"OMNIA\": \"0.7624186000000000\",\n \"ZKJ\": \"1.1124435000000000\",\n \"ZKL\": \"0.1255372000000000\",\n \"GAFI\": \"3.0634675000000001\",\n \"CARV\": \"0.8703646000000000\",\n \"KNC\": \"0.4433782000000000\",\n \"CATS\": \"0.0000599700000000\",\n \"PROM\": \"5.2833570000000006\",\n \"ALEPH\": \"0.1756121500000000\",\n \"PONKE\": \"0.3958020000000000\",\n \"OVR\": \"0.1553223000000000\",\n \"CATI\": \"0.4105146400000000\",\n \"ORDER\": \"0.1183008200000000\",\n \"GFT\": \"0.0166616650000000\",\n \"BIFI\": \"0.0020489750000000\",\n \"GGC\": \"6.9965029985000000\",\n \"GGG\": \"0.0403798000000000\",\n \"DAPPX\": \"0.0043788095000000\",\n \"SUKU\": \"0.0618790450000000\",\n \"ULTI\": \"0.0168015950000000\",\n \"CREDI\": \"0.0192903500000000\",\n \"ERTHA\": \"0.0010014990000000\",\n \"FURY\": \"0.1405297000000000\",\n \"KARRAT\": \"0.5577210000000000\",\n \"MOBILE\": \"0.0009005495000000\",\n \"SIDUS\": \"0.0037671155000000\",\n \"NAVI\": \"0.1254672350000000\",\n \"TAO\": \"583.4081500000051807\",\n \"USDJ\": \"1.1386304000000001\",\n \"MTL\": \"0.9563216000000000\",\n \"VET\": \"0.0225387250000000\",\n \"FITFI\": \"0.0036421780000000\",\n \"USDT\": \"0.9995000000000000\",\n \"OXT\": \"0.0695652000000000\",\n \"CANDY\": \"0.0005597200000000\",\n \"USDP\": \"0.9932031500000000\",\n \"MTS\": \"0.0027516235000000\",\n \"TADA\": \"0.0283858000000000\",\n \"MTV\": \"0.0006559718500000\",\n \"NAVX\": \"0.1342228550000000\",\n \"ILV\": \"35.6771524999999671\",\n \"VINU\": \"0.0000000109045450\",\n \"GHX\": \"0.0903548000000000\",\n \"EDU\": \"0.5167415000000000\",\n \"HYVE\": \"0.0137331300000000\",\n \"BTC3L\": \"0.0058620675000000\",\n \"ANYONE\": \"0.9015490000000000\",\n \"BEAT\": \"0.0012593700000000\",\n \"KING\": \"0.0004821588000000\",\n \"CREAM\": \"15.6541689999999973\",\n \"CAS\": \"0.0038590695000000\",\n \"IMX\": \"1.4944524000000000\",\n \"CAT\": \"0.0000256981445000\",\n \"BTC3S\": \"0.0014142925000000\",\n \"USDE\": \"0.9985005000000000\",\n \"USDD\": \"1.0000997000000000\",\n \"CWAR\": \"0.0037981000000000\",\n \"USDC\": \"0.9997998500000000\",\n \"KRL\": \"0.3543127550000000\",\n \"INJ\": \"21.7691100000000194\",\n \"GAME\": \"0.0139630150000000\",\n \"TRIBL\": \"1.0994500000000000\",\n \"XLM\": \"0.0948525500000000\",\n \"TRBUP\": \"0.0012293850000000\",\n \"VRADOWN\": \"0.0013433280000000\",\n \"SUPER\": \"1.2853570000000000\",\n \"EIGEN\": \"3.1536223999999999\",\n \"IOI\": \"0.0146926500000000\",\n \"KSM\": \"17.5212350000000129\",\n \"CCD\": \"0.0034832575000000\",\n \"EGO\": \"0.0093553200000000\",\n \"EGP\": \"2.7946019999999998\",\n \"MXC\": \"0.0066866550000000\",\n \"TEL\": \"0.0014432780000000\",\n \"MOVR\": \"9.1340307000000027\",\n \"XMR\": \"155.5421899999990755\",\n \"MXM\": \"0.0092853550000000\",\n \"OORT\": \"0.1099949750000000\",\n \"GLM\": \"0.3231383500000000\",\n \"RAY\": \"2.0228880499999998\",\n \"XTAG\": \"0.0218190850000000\",\n \"GLQ\": \"0.0854572500000000\",\n \"CWEB\": \"0.0038480750000000\",\n \"REVU\": \"0.0105047450000000\",\n \"REVV\": \"0.0039760110000000\",\n \"ZRO\": \"3.7952014499999994\",\n \"XNL\": \"0.0093853050000000\",\n \"XNO\": \"0.8496749500000000\",\n \"SAROS\": \"0.0019290350000000\",\n \"KACE\": \"2.1165411999999998\",\n \"ZRX\": \"0.3186406000000000\",\n \"WLTH\": \"0.0374312750000000\",\n \"ATOM3L\": \"0.0321719060000000\",\n \"GMM\": \"0.0001497251000000\",\n \"BEER\": \"0.0000138670630000\",\n \"GMT\": \"0.1275362000000000\",\n \"HEART\": \"0.0159920000000000\",\n \"GMX\": \"22.7186349999999882\",\n \"ABBC\": \"0.0061769100000000\",\n \"OMNI\": \"8.9235359999999970\",\n \"ATOM3S\": \"0.0007945225400000\",\n \"IRL\": \"0.0099650150000000\",\n \"CFG\": \"0.3248375000000000\",\n \"WSDM\": \"0.0139830050000000\",\n \"GNS\": \"1.8390800000000001\",\n \"VANRY\": \"0.0809295150000000\",\n \"CFX\": \"0.1595202000000000\",\n \"GRAIL\": \"817.1212349999937891\",\n \"BEFI\": \"0.0175712100000000\",\n \"VELO\": \"0.0132043945000000\",\n \"XPR\": \"0.0008077959000000\",\n \"DOVI\": \"0.0584707500000000\",\n \"ACE\": \"0.0021349320000000\",\n \"ACH\": \"0.0190534685000000\",\n \"ISP\": \"0.0012161916000000\",\n \"XCAD\": \"0.2834582000000000\",\n \"MINA\": \"0.5630183500000000\",\n \"TIA\": \"5.9318325999999999\",\n \"DRIFT\": \"0.4350823500000000\",\n \"ACQ\": \"0.0056981495000000\",\n \"ACS\": \"0.0014917537500000\",\n \"MIND\": \"0.0018920535000000\",\n \"STORE\": \"0.0062358805000000\",\n \"REN\": \"0.0351224300000000\",\n \"ELA\": \"1.7282354500000000\",\n \"DREAMS\": \"0.0002498750000000\",\n \"ADA\": \"0.3463267500000000\",\n \"ELF\": \"0.3777110500000000\",\n \"REQ\": \"0.0959919800000000\",\n \"STORJ\": \"0.5662167500000000\",\n \"LADYS\": \"0.0000000837581000\",\n \"PAXG\": \"2697.9303600003123340\",\n \"REZ\": \"0.0409795000000000\",\n \"XRD\": \"0.0157821050000000\",\n \"CHO\": \"0.0205097400000000\",\n \"CHR\": \"0.1769115000000000\",\n \"ADS\": \"0.1889055000000000\",\n \"CHZ\": \"0.0738030800000000\",\n \"ADX\": \"0.1575212000000000\",\n \"XRP\": \"0.5525036100000000\",\n \"JASMY\": \"0.0188615645000000\",\n \"KAGI\": \"0.1834582250000000\",\n \"FIDA\": \"0.2282858000000000\",\n \"PBR\": \"0.0291953950000000\",\n \"AEG\": \"0.0093453250000000\",\n \"H2O\": \"0.1610194500000000\",\n \"CHMB\": \"0.0001715641750000\",\n \"SAND3L\": \"0.0015447972150000\",\n \"PBX\": \"0.0006879558500000\",\n \"SOLVE\": \"0.0084557700000000\",\n \"DECHAT\": \"0.1512243500000000\",\n \"GARI\": \"0.0076861550000000\",\n \"SHIB2L\": \"1.1996998499999999\",\n \"SHIB2S\": \"0.0240879500000000\",\n \"ENA\": \"0.3942028000000000\",\n \"VEMP\": \"0.0029335325000000\",\n \"ENJ\": \"0.1467266000000000\",\n \"AFG\": \"0.0072163900000000\",\n \"RATS\": \"0.0001211593900000\",\n \"GRT\": \"0.1646076550000000\",\n \"FORWARD\": \"0.0012873560000000\",\n \"TFUEL\": \"0.0598800450000000\",\n \"ENS\": \"17.0634640000000052\",\n \"KASDOWN\": \"0.0258770550000000\",\n \"XTM\": \"0.0251074400000000\",\n \"DEGEN\": \"0.0084857550000000\",\n \"TLM\": \"0.0100449750000000\",\n \"DYDXDOWN\": \"0.1042598440000000\",\n \"CKB\": \"0.0146026950000000\",\n \"LUNC\": \"0.0000889255150000\",\n \"AURORA\": \"0.1204397500000000\",\n \"LUNA\": \"0.3624187000000000\",\n \"XTZ\": \"0.6776610000000000\",\n \"ELON\": \"0.0000001410294500\",\n \"DMTR\": \"0.0891554000000000\",\n \"EOS\": \"0.4759619000000000\",\n \"GST\": \"0.0118940500000000\",\n \"FORT\": \"0.1155422000000000\",\n \"FLAME\": \"0.0247076400000000\",\n \"PATEX\": \"0.9605195000000000\",\n \"DEEP\": \"0.0328885475000000\",\n \"ID3L\": \"0.0016201895000000\",\n \"GTC\": \"0.6625685500000000\",\n \"ID3S\": \"0.0071674145000000\",\n \"RIO\": \"0.7616190000000000\",\n \"CLH\": \"0.0008555720000000\",\n \"BURGER\": \"0.4016990500000000\",\n \"VRA\": \"0.0029765110000000\",\n \"SUNDOG\": \"0.2173912500000000\",\n \"GTT\": \"0.0002038980000000\",\n \"INJUP\": \"0.2327835500000000\",\n \"CPOOL\": \"0.1557720750000000\",\n \"EPX\": \"0.0000740629500000\",\n \"CLV\": \"0.0329835000000000\",\n \"FEAR\": \"0.0560519600000000\",\n \"MEME\": \"0.0124847545000000\",\n \"ROOBEE\": \"0.0004520738500000\",\n \"DEFI\": \"0.0192903500000000\",\n \"TOKEN\": \"0.0477361200000000\",\n \"GRAPE\": \"0.0020599695000000\",\n \"KASUP\": \"0.3996001000000000\",\n \"XWG\": \"0.0003843077500000\",\n \"SKEY\": \"0.0621289200000000\",\n \"SFUND\": \"1.3243375000000000\",\n \"EQX\": \"0.0032823580000000\",\n \"ORDIUP\": \"0.0548315705000000\",\n \"TON\": \"5.1857058499999995\",\n \"DEGO\": \"2.2667660500000001\",\n \"IZI\": \"0.0088455750000000\",\n \"ERG\": \"0.6605695500000000\",\n \"ERN\": \"1.9255367500000001\",\n \"VENOM\": \"0.0817591000000000\",\n \"VOXEL\": \"0.1497251000000000\",\n \"RLC\": \"1.4649671500000000\",\n \"PHA\": \"0.1093453000000000\",\n \"DYDXUP\": \"0.0112573685000000\",\n \"APE3S\": \"0.0008475760000000\",\n \"ORBS\": \"0.0288955450000000\",\n \"OPDOWN\": \"0.6758619000000000\",\n \"ESE\": \"0.0139130400000000\",\n \"APE3L\": \"0.1339330000000000\",\n \"HMND\": \"0.0982208650000000\",\n \"COQ\": \"0.0000014432780000\",\n \"AURY\": \"0.3340329000000000\",\n \"CULT\": \"0.0000028025980000\",\n \"AKT\": \"2.4642672500000001\",\n \"GLMR\": \"0.1606196500000000\",\n \"XYM\": \"0.0142528700000000\",\n \"ORAI\": \"6.1769100000000012\",\n \"XYO\": \"0.0058680645000000\",\n \"ETC\": \"18.8458723500000169\",\n \"LAI\": \"0.0142828550000000\",\n \"PIP\": \"0.0178310800000000\",\n \"ETH\": \"2607.6655149998362673\",\n \"NEO\": \"10.3575186499999991\",\n \"RMV\": \"0.0081659150000000\",\n \"KLAY\": \"0.1251374000000000\",\n \"PIT\": \"0.0000000003268365\",\n \"TARA\": \"0.0043978000000000\",\n \"KALT\": \"0.1128735350000000\",\n \"PIX\": \"0.0001023687900000\",\n \"ETN\": \"0.0021579205000000\",\n \"CSIX\": \"0.0141729100000000\",\n \"TRADE\": \"0.4708644500000000\",\n \"MAVIA\": \"1.3592200500000001\",\n \"HIGH\": \"1.3043474999999999\",\n \"TRB\": \"62.5387150000000006\",\n \"ORDI\": \"35.7421200000000126\",\n \"TRVL\": \"0.0373643085000000\",\n \"AMB\": \"0.0059670150000000\",\n \"TRU\": \"0.0762018800000000\",\n \"LOGX\": \"0.0271963950000000\",\n \"FINC\": \"0.0362018900000000\",\n \"INFRA\": \"0.1978010500000000\",\n \"NATIX\": \"0.0008729633000000\",\n \"NFP\": \"0.2152923000000000\",\n \"TRY\": \"0.0292166033323590\",\n \"TRX\": \"0.1597201000000000\",\n \"LBP\": \"0.0001243378000000\",\n \"LBR\": \"0.0595702000000000\",\n \"EUL\": \"2.9735125000000000\",\n \"NFT\": \"0.0000004077960000\",\n \"SEIUP\": \"0.0478110825000000\",\n \"PUFFER\": \"0.3676161000000000\",\n \"EUR\": \"1.0811249323958897\",\n \"ORCA\": \"2.0664662499999999\",\n \"NEAR3L\": \"0.0117010765350000\",\n \"AMP\": \"0.0038330825000000\",\n \"XDEFI\": \"0.0472563600000000\",\n \"HIFI\": \"0.4947525000000000\",\n \"TRUF\": \"0.0459570100000000\",\n \"AITECH\": \"0.1045477000000000\",\n \"AMU\": \"0.0043978000000000\",\n \"USTC\": \"0.0214692600000000\",\n \"KNGL\": \"0.0499750000000000\",\n \"FOXY\": \"0.0102686631000000\",\n \"NGC\": \"0.0147935995000000\",\n \"TENET\": \"0.0043278350000000\",\n \"NEAR3S\": \"0.0072553705000000\",\n \"MAHA\": \"1.1904045000000000\",\n \"NGL\": \"0.0701748950000000\",\n \"TST\": \"0.0080359800000000\",\n \"HIPPO\": \"0.0104447750000000\",\n \"AXS3S\": \"0.0308705570000000\",\n \"CRO\": \"0.0781409100000000\",\n \"ZPAY\": \"0.0050574700000000\",\n \"MNDE\": \"0.1026786350000000\",\n \"CRV\": \"0.2534732000000000\",\n \"SWASH\": \"0.0056271850000000\",\n \"AXS3L\": \"0.0106388779000000\",\n \"VERSE\": \"0.0001803098000000\",\n \"RPK\": \"0.0049975000000000\",\n \"RPL\": \"10.9745099999999958\",\n \"AZERO\": \"0.3789104500000000\",\n \"SOUL\": \"0.0534332700000000\",\n \"VXV\": \"0.2619689500000000\",\n \"LDO\": \"1.0885554500000000\",\n \"MAGIC\": \"0.3390304000000000\",\n \"ALICE\": \"1.0324835000000000\",\n \"SEAM\": \"1.1933030499999999\",\n \"PLU\": \"1.9300345000000001\",\n \"AOG\": \"0.0031224380000000\",\n \"SMOLE\": \"0.0000387806000000\",\n \"EWT\": \"1.1094450000000000\",\n \"TSUGT\": \"0.0029185400000000\",\n \"PMG\": \"0.0800599500000000\",\n \"OPAI\": \"0.0006826585000000\",\n \"LOCUS\": \"0.0216591650000000\",\n \"CTA\": \"0.0825087250000000\",\n \"NIM\": \"0.0013673160000000\",\n \"CTC\": \"0.4033982000000000\",\n \"APE\": \"0.7035480500000000\",\n \"MERL\": \"0.2720639000000000\",\n \"JAM\": \"0.0004770613500000\",\n \"CTI\": \"0.0130314810000000\",\n \"APP\": \"0.0021989000000000\",\n \"APT\": \"9.9947001500000000\",\n \"WLDUP\": \"0.0093043455000000\",\n \"ZEND\": \"0.1280759300000000\",\n \"FIRE\": \"0.9113441000000000\",\n \"DENT\": \"0.0008630682500000\",\n \"PYTH\": \"0.3390603850000000\",\n \"LFT\": \"0.0155322300000000\",\n \"DPET\": \"0.0319040400000000\",\n \"ORDIDOWN\": \"0.3788105000000000\",\n \"KPOL\": \"0.0029175405000000\",\n \"ETHUP\": \"8.4971493000000032\",\n \"BAND\": \"1.0939527500000001\",\n \"POL\": \"0.3656171000000000\",\n \"ASTR\": \"0.0582608550000000\",\n \"NKN\": \"0.0691654000000000\",\n \"RSR\": \"0.0068055955000000\",\n \"DVPN\": \"0.0005979009000000\",\n \"TWT\": \"1.1119437500000000\",\n \"ARB\": \"0.5510243500000000\",\n \"CVC\": \"0.1409801746501747\",\n \"ARC\": \"0.0300849500000000\",\n \"XETA\": \"0.0022888550000000\",\n \"MTRG\": \"0.4007995000000000\",\n \"LOKA\": \"0.1867066000000000\",\n \"LPOOL\": \"0.0660069800000000\",\n \"TURBOS\": \"0.0034812585000000\",\n \"CVX\": \"1.7816087499999999\",\n \"ARX\": \"0.0007556220000000\",\n \"MPLX\": \"0.4355221300000000\",\n \"SUSHI\": \"0.7011492500000000\",\n \"NLK\": \"0.0114442750000000\",\n \"PEPE2\": \"0.0000000313843000\",\n \"WBTC\": \"66881.4425499645548419\",\n \"SUI3L\": \"0.0211204345000000\",\n \"CWS\": \"0.1927036000000000\",\n \"SUI3S\": \"0.0000579110300000\",\n \"INSP\": \"0.0264167850000000\",\n \"MANA\": \"0.2945026750000000\",\n \"VRTX\": \"0.0641679000000000\",\n \"CSPR\": \"0.0116441750000000\",\n \"ATA\": \"0.0785007300000000\",\n \"OPEN\": \"0.0080049955000000\",\n \"HAI\": \"0.0448275750000000\",\n \"NMR\": \"14.7436245000000072\",\n \"ATH\": \"0.0540929400000000\",\n \"LIT\": \"0.6282857000000000\",\n \"TLOS\": \"0.3263467450000000\",\n \"TNSR\": \"0.3662168000000000\",\n \"CXT\": \"0.0871364100000000\",\n \"POLYX\": \"0.2346826000000000\",\n \"ZERO\": \"0.0002507745500000\",\n \"ROUTE\": \"0.0610694500000000\",\n \"LOOM\": \"0.0580009850000000\",\n \"PRE\": \"0.0078680640000000\",\n \"VRAUP\": \"0.0134652640000000\",\n \"HBB\": \"0.0714742450000000\",\n \"RVN\": \"0.0165017450000000\",\n \"PRQ\": \"0.0715741950000000\",\n \"ONDO\": \"0.7134930750000000\",\n \"PEPEDOWN\": \"0.0000155022450000\",\n \"WOOP\": \"0.0020179905000000\",\n \"LUNCUP\": \"0.0168355780000000\",\n \"KAVA\": \"0.3522238000000000\",\n \"LKI\": \"0.0104187880000000\",\n \"AVA\": \"0.4857570000000000\",\n \"NOM\": \"0.0233883000000000\",\n \"MAPO\": \"0.0089015470000000\",\n \"PEPEUP\": \"0.0114252845000000\",\n \"STRAX\": \"0.0487156300000000\",\n \"NOT\": \"0.0078670645000000\",\n \"ZERC\": \"0.1108245600000000\",\n \"BCUT\": \"0.0255672100000000\",\n \"MASA\": \"0.0691354150000000\",\n \"WAN\": \"0.1785077544737212\",\n \"WAT\": \"0.0003273762300000\",\n \"WAX\": \"0.0327636100000000\",\n \"MASK\": \"2.2259864500000002\",\n \"EOS3L\": \"0.0002122138400000\",\n \"IDEA\": \"0.0005887055000000\",\n \"EOS3S\": \"0.0034472755000000\",\n \"YFI\": \"4919.4290549999908843\",\n \"MOODENG\": \"0.0774612500000000\",\n \"XCUR\": \"0.0048845565000000\",\n \"HYDRA\": \"0.2225886500000000\",\n \"POPCAT\": \"1.3382305500000000\",\n \"LQTY\": \"0.7848074000000000\",\n \"PIXEL\": \"0.1406596350000000\",\n \"LMR\": \"0.0145437245000000\",\n \"ZETA\": \"0.5997999500000000\",\n \"YGG\": \"0.4717640000000000\",\n \"AXS\": \"4.6006985000000006\",\n \"BCHSV\": \"49.8250749999999370\",\n \"NRN\": \"0.0395802000000000\",\n \"FTON\": \"0.0091954000000000\",\n \"COMP\": \"43.6581599999999881\",\n \"XPRT\": \"0.1819090000000000\",\n \"HFT\": \"0.1443278000000000\",\n \"UXLINK\": \"0.5085456000000000\",\n \"STAMP\": \"0.0335032400000000\",\n \"RUNE\": \"4.9233370999999996\",\n \"ZEUS\": \"0.2587705500000000\",\n \"LTC3L\": \"1.8294848000000001\",\n \"DAPP\": \"0.1763118000000000\",\n \"FORTH\": \"2.9508238500000004\",\n \"ALPINE\": \"1.5322335000000000\",\n \"SENSO\": \"0.0328835500000000\",\n \"LTC3S\": \"0.0006986505000000\",\n \"DEXE\": \"8.3795081500000028\",\n \"GOAL\": \"0.0175912000000000\",\n \"AVAX\": \"27.5602130000000058\",\n \"LISTA\": \"0.3782108000000000\",\n \"AMPL\": \"1.3743124999999999\",\n \"WORK\": \"0.1384307500000000\",\n \"BRWL\": \"0.0017391300000000\",\n \"BANANA\": \"57.1314200000001362\",\n \"PUSH\": \"0.0750624500000000\",\n \"WEN\": \"0.0001015492000000\",\n \"NEIRO\": \"0.0879560000000000\",\n \"BTCUP\": \"34.7711057499999789\",\n \"SOL3S\": \"0.0007816090000000\",\n \"BRAWL\": \"0.0004776610500000\",\n \"LAY3R\": \"0.2161918500000000\",\n \"LPT\": \"11.9304317999999945\",\n \"GODS\": \"0.1807096000000000\",\n \"SAND3S\": \"4.6152911999999992\",\n \"RDNT\": \"0.0640679500000000\",\n \"SOL3L\": \"1.8351913752850000\",\n \"NIBI\": \"0.0653772950000000\",\n \"NUM\": \"0.0436181800000000\",\n \"PYR\": \"2.5590198499999997\",\n \"DAG\": \"0.0226176855000000\",\n \"DAI\": \"0.9989006596042375\",\n \"HIP\": \"0.0034982500000000\",\n \"DAO\": \"0.2848575000000000\",\n \"AVAIL\": \"0.1300929210000000\",\n \"DAR\": \"0.1512243500000000\",\n \"FET\": \"1.3760116500000000\",\n \"FCON\": \"0.0001197600900000\",\n \"XAVA\": \"0.3789104500000000\",\n \"LRC\": \"0.1208395500000000\",\n \"UNI3S\": \"0.0000653573050000\",\n \"PZP\": \"0.0599600050000000\",\n \"POKT\": \"0.0424787500000000\",\n \"DASH\": \"23.6881500000000109\",\n \"BAKEDOWN\": \"0.0003324636850000\",\n \"POLC\": \"0.0061389290000000\",\n \"DBR\": \"0.0377671070000000\",\n \"CIRUS\": \"0.0055772100000000\",\n \"UNI3L\": \"0.0993921490650000\",\n \"NWC\": \"0.0681659000000000\",\n \"POLK\": \"0.0142628650000000\",\n \"LSD\": \"0.9420287500000000\",\n \"MARS4\": \"0.0005878059500000\",\n \"LSK\": \"0.8080957500000000\",\n \"BLOCK\": \"0.0261869000000000\",\n \"ANALOS\": \"0.0000446776500000\",\n \"SAFE\": \"0.8779608000000000\",\n \"DCK\": \"0.0234082900000000\",\n \"LSS\": \"0.0562718500000000\",\n \"DCR\": \"12.4337799999999929\",\n \"LIKE\": \"0.0559720000000000\",\n \"DATA\": \"0.0361819000000000\",\n \"WIF\": \"2.5696145499999999\",\n \"BLOK\": \"0.0006546725000000\",\n \"LTC\": \"71.6261690000000611\",\n \"METIS\": \"42.0289750000000612\",\n \"WIN\": \"0.0000868365600000\",\n \"HLG\": \"0.0018790600000000\",\n \"LTO\": \"0.1166116650000000\",\n \"DYDX\": \"0.9341327000000000\",\n \"ARB3S\": \"0.0509025360000000\",\n \"MUBI\": \"0.0303848000000000\",\n \"ARB3L\": \"0.0025917035000000\",\n \"RBTC1\": \"0.0000039480250000\",\n \"POND\": \"0.0118640650000000\",\n \"LINA\": \"0.0037771105000000\",\n \"MYRIA\": \"0.0025337325000000\",\n \"LINK\": \"11.0244849999999944\",\n \"QTUM\": \"2.4262016723130069\",\n \"TUNE\": \"0.0148025950000000\",\n \"UFO\": \"0.0000006479758500\",\n \"CYBER\": \"2.8755615000000001\",\n \"WILD\": \"0.2433782500000000\",\n \"POLS\": \"0.2809594500000000\",\n \"NYM\": \"0.0719640000000000\",\n \"FIL\": \"3.6786597500000005\",\n \"BAL\": \"2.0099945000000000\",\n \"SCA\": \"0.3999999000000000\",\n \"STND\": \"0.0133123405000000\",\n \"WMTX\": \"0.2138930000000000\",\n \"SCLP\": \"0.1545227000000000\",\n \"MANEKI\": \"0.0073963000000000\",\n \"BAT\": \"0.1721139000000000\",\n \"AKRO\": \"0.0042302838000000\",\n \"FTM3L\": \"8.2574692000000024\",\n \"BAX\": \"0.0000709645000000\",\n \"FTM3S\": \"0.0000255072400000\",\n \"COTI\": \"0.0951524000000000\"\n }\n}" + "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"totalNum\": 195,\n \"totalPage\": 13,\n \"currentPage\": 1,\n \"pageSize\": 15,\n \"items\": [\n {\n \"annId\": 129045,\n \"annTitle\": \"KuCoin Isolated Margin Adds the Scroll (SCR) Trading Pair\",\n \"annType\": [\n \"latest-announcements\"\n ],\n \"annDesc\": \"To enrich the variety of assets available, KuCoin’s Isolated Margin Trading platform has added the Scroll (SCR) asset and trading pair.\",\n \"cTime\": 1729594043000,\n \"language\": \"en_US\",\n \"annUrl\": \"https://www.kucoin.com/announcement/kucoin-isolated-margin-adds-scr?lang=en_US\"\n },\n {\n \"annId\": 129001,\n \"annTitle\": \"DAPP-30D Fixed Promotion, Enjoy an APR of 200%!​\",\n \"annType\": [\n \"latest-announcements\",\n \"activities\"\n ],\n \"annDesc\": \"KuCoin Earn will be launching the DAPP Fixed Promotion at 10:00:00 on October 22, 2024 (UTC). The available product is “DAPP-30D'' with an APR of 200%.\",\n \"cTime\": 1729588460000,\n \"language\": \"en_US\",\n \"annUrl\": \"https://www.kucoin.com/announcement/dapp-30d-fixed-promotion-enjoy?lang=en_US\"\n },\n {\n \"annId\": 128581,\n \"annTitle\": \"NAYM (NAYM) Gets Listed on KuCoin! World Premiere!\",\n \"annType\": [\n \"latest-announcements\",\n \"new-listings\"\n ],\n \"annDesc\": \"Trading: 11:00 on October 22, 2024 (UTC)\",\n \"cTime\": 1729497729000,\n \"language\": \"en_US\",\n \"annUrl\": \"https://www.kucoin.com/announcement/en-naym-naym-gets-listed-on-kucoin-world-premiere?lang=en_US\"\n }\n ]\n }\n}" } ] }, { - "name": "Get All Symbols", + "name": "Get Currency", "request": { "method": "GET", "header": [], @@ -3742,18 +3707,19 @@ ], "path": [ "api", - "v2", - "symbols" + "v3", + "currencies", + "{{currency}}" ], "query": [ { - "key": "market", + "key": "chain", "value": "", - "description": "[The trading market](https://www.kucoin.com/docs-new/api-222921786)" + "description": "Support for querying the chain of currency, e.g. The available value for USDT are OMNI, ERC20, TRC20. This only apply for multi-chain currency, and there is no need for single chain currency." } ] }, - "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470154)\n\n:::info[Description]\nRequest via this endpoint to get a list of available currency pairs for trading. If you want to get the market information of the trading symbol, please use Get All Tickers.\n:::\n\n\n:::tip[Tips]\npriceIncrement and quoteIncrement may be adjusted in the future. We will notify you by email and site notifications before adjustment.\n:::\n\n| Order Type | Follow the rules of minFunds |\n| --- | --- |\n| Limit Buy | [Order Amount * Order Price] >= minFunds |\n| Limit Sell | [Order Amount * Order Price] >= minFunds |\n| Market Buy | Order Value >= minFunds |\n| Market Sell | [Order Amount * Last Price of Base Currency] >= minFunds |\n\nNote:\n\n- API market buy orders (by amount) valued at [Order Amount * Last Price of Base Currency] < minFunds will be rejected.\n- API market sell orders (by value) valued at < minFunds will be rejected.\n- Take profit and stop loss orders at market or limit prices will be rejected when triggered.\n\n\n\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | array | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| symbol | string | unique code of a symbol, it would not change after renaming |\n| name | string | Name of trading pairs, it would change after renaming |\n| baseCurrency | string | Base currency,e.g. BTC. |\n| quoteCurrency | string | Quote currency,e.g. USDT. |\n| feeCurrency | string | The currency of charged fees. |\n| market | string | The trading market. |\n| baseMinSize | string | The minimum order quantity requried to place an order. |\n| quoteMinSize | string | The minimum order funds required to place a market order. |\n| baseMaxSize | string | The maximum order size required to place an order. |\n| quoteMaxSize | string | The maximum order funds required to place a market order. |\n| baseIncrement | string | Quantity increment: The quantity for an order must be a positive integer multiple of this increment. Here, the size refers to the quantity of the base currency for the order. For example, for the ETH-USDT trading pair, if the baseIncrement is 0.0000001, the order quantity can be 1.0000001 but not 1.00000001. |\n| quoteIncrement | string | Quote increment: The funds for a market order must be a positive integer multiple of this increment. The funds refer to the quote currency amount. For example, for the ETH-USDT trading pair, if the quoteIncrement is 0.000001, the amount of USDT for the order can be 3000.000001 but not 3000.0000001. |\n| priceIncrement | string | Price increment: The price of an order must be a positive integer multiple of this increment. For example, for the ETH-USDT trading pair, if the priceIncrement is 0.01, the order price can be 3000.01 but not 3000.001.

specifies the min order price as well as the price increment.This also applies to quote currency. |\n| priceLimitRate | string | Threshold for price portection |\n| minFunds | string | the minimum trading amounts |\n| isMarginEnabled | boolean | Available for margin or not. |\n| enableTrading | boolean | Available for transaction or not. |\n| feeCategory | integer | [Fee Type](https://www.kucoin.com/vip/privilege) |\n| makerFeeCoefficient | string | The maker fee coefficient. The actual fee needs to be multiplied by this coefficient to get the final fee. Most currencies have a coefficient of 1. If set to 0, it means no fee |\n| takerFeeCoefficient | string | The taker fee coefficient. The actual fee needs to be multiplied by this coefficient to get the final fee. Most currencies have a coefficient of 1. If set to 0, it means no fee |\n| st | boolean | Whether it is an [Special Treatment](https://www.kucoin.com/legal/special-treatment) symbol |\n\n---\n", + "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470155)\n\n:::info[Description]\nRequest via this endpoint to get the currency details of a specified currency\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| currency | string | A unique currency code that will never change |\n| name | string | Currency name, will change after renaming |\n| fullName | string | Full name of a currency, will change after renaming |\n| precision | integer | Currency precision |\n| confirms | integer | Number of block confirmations |\n| contractAddress | string | Contract address |\n| isMarginEnabled | boolean | Support margin or not |\n| isDebitEnabled | boolean | Support debit or not |\n| chains | array | Refer to the schema section of chains |\n\n**root.data.chains Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| chainName | string | chain name of currency |\n| withdrawalMinSize | string | Minimum withdrawal amount |\n| depositMinSize | string | Minimum deposit amount |\n| withdrawFeeRate | string | withdraw fee rate |\n| withdrawalMinFee | string | Minimum fees charged for withdrawal |\n| isWithdrawEnabled | boolean | Support withdrawal or not |\n| isDepositEnabled | boolean | Support deposit or not |\n| confirms | integer | Number of block confirmations |\n| preConfirms | integer | The number of blocks (confirmations) for advance on-chain verification |\n| contractAddress | string | Contract address |\n| withdrawPrecision | integer | Withdrawal precision bit, indicating the maximum supported length after the decimal point of the withdrawal amount |\n| maxWithdraw | number | Maximum amount of single withdrawal |\n| maxDeposit | string | Maximum amount of single deposit (only applicable to Lightning Network) |\n| needTag | boolean | whether memo/tag is needed |\n| chainId | string | chain id of currency |\n\n---\n", "body": {} }, "response": [ @@ -3770,14 +3736,15 @@ ], "path": [ "api", - "v2", - "symbols" + "v3", + "currencies", + "{{currency}}" ], "query": [ { - "key": "market", + "key": "chain", "value": "", - "description": "[The trading market](https://www.kucoin.com/docs-new/api-222921786)" + "description": "Support for querying the chain of currency, e.g. The available value for USDT are OMNI, ERC20, TRC20. This only apply for multi-chain currency, and there is no need for single chain currency." } ] } @@ -3812,12 +3779,12 @@ } ], "cookie": [], - "body": "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"symbol\": \"BTC-USDT\",\n \"name\": \"BTC-USDT\",\n \"baseCurrency\": \"BTC\",\n \"quoteCurrency\": \"USDT\",\n \"feeCurrency\": \"USDT\",\n \"market\": \"USDS\",\n \"baseMinSize\": \"0.00001\",\n \"quoteMinSize\": \"0.1\",\n \"baseMaxSize\": \"10000000000\",\n \"quoteMaxSize\": \"99999999\",\n \"baseIncrement\": \"0.00000001\",\n \"quoteIncrement\": \"0.000001\",\n \"priceIncrement\": \"0.1\",\n \"priceLimitRate\": \"0.1\",\n \"minFunds\": \"0.1\",\n \"isMarginEnabled\": true,\n \"enableTrading\": true,\n \"feeCategory\": 1,\n \"makerFeeCoefficient\": \"1.00\",\n \"takerFeeCoefficient\": \"1.00\",\n \"st\": false\n }\n ]\n}" + "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"currency\": \"BTC\",\n \"name\": \"BTC\",\n \"fullName\": \"Bitcoin\",\n \"precision\": 8,\n \"confirms\": null,\n \"contractAddress\": null,\n \"isMarginEnabled\": true,\n \"isDebitEnabled\": true,\n \"chains\": [\n {\n \"chainName\": \"BTC\",\n \"withdrawalMinSize\": \"0.001\",\n \"depositMinSize\": \"0.0002\",\n \"withdrawFeeRate\": \"0\",\n \"withdrawalMinFee\": \"0.0005\",\n \"isWithdrawEnabled\": true,\n \"isDepositEnabled\": true,\n \"confirms\": 3,\n \"preConfirms\": 1,\n \"contractAddress\": \"\",\n \"withdrawPrecision\": 8,\n \"maxWithdraw\": null,\n \"maxDeposit\": null,\n \"needTag\": false,\n \"chainId\": \"btc\"\n },\n {\n \"chainName\": \"Lightning Network\",\n \"withdrawalMinSize\": \"0.00001\",\n \"depositMinSize\": \"0.00001\",\n \"withdrawFeeRate\": \"0\",\n \"withdrawalMinFee\": \"0.000015\",\n \"isWithdrawEnabled\": true,\n \"isDepositEnabled\": true,\n \"confirms\": 1,\n \"preConfirms\": 1,\n \"contractAddress\": \"\",\n \"withdrawPrecision\": 8,\n \"maxWithdraw\": null,\n \"maxDeposit\": \"0.03\",\n \"needTag\": false,\n \"chainId\": \"btcln\"\n },\n {\n \"chainName\": \"KCC\",\n \"withdrawalMinSize\": \"0.0008\",\n \"depositMinSize\": null,\n \"withdrawFeeRate\": \"0\",\n \"withdrawalMinFee\": \"0.00002\",\n \"isWithdrawEnabled\": true,\n \"isDepositEnabled\": true,\n \"confirms\": 20,\n \"preConfirms\": 20,\n \"contractAddress\": \"0xfa93c12cd345c658bc4644d1d4e1b9615952258c\",\n \"withdrawPrecision\": 8,\n \"maxWithdraw\": null,\n \"maxDeposit\": null,\n \"needTag\": false,\n \"chainId\": \"kcc\"\n },\n {\n \"chainName\": \"BTC-Segwit\",\n \"withdrawalMinSize\": \"0.0008\",\n \"depositMinSize\": \"0.0002\",\n \"withdrawFeeRate\": \"0\",\n \"withdrawalMinFee\": \"0.0005\",\n \"isWithdrawEnabled\": false,\n \"isDepositEnabled\": true,\n \"confirms\": 2,\n \"preConfirms\": 2,\n \"contractAddress\": \"\",\n \"withdrawPrecision\": 8,\n \"maxWithdraw\": null,\n \"maxDeposit\": null,\n \"needTag\": false,\n \"chainId\": \"bech32\"\n }\n ]\n }\n}" } ] }, { - "name": "Get Currency", + "name": "Get All Currencies", "request": { "method": "GET", "header": [], @@ -3828,20 +3795,13 @@ "{{spot_endpoint}}" ], "path": [ - "api", - "v3", - "currencies", - "{{currency}}" - ], - "query": [ - { - "key": "chain", - "value": "", - "description": "Support for querying the chain of currency, e.g. The available value for USDT are OMNI, ERC20, TRC20. This only apply for multi-chain currency, and there is no need for single chain currency." - } - ] + "api", + "v3", + "currencies" + ], + "query": [] }, - "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470155)\n\n:::info[Description]\nRequest via this endpoint to get the currency details of a specified currency\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| currency | string | A unique currency code that will never change |\n| name | string | Currency name, will change after renaming |\n| fullName | string | Full name of a currency, will change after renaming |\n| precision | integer | Currency precision |\n| confirms | integer | Number of block confirmations |\n| contractAddress | string | Contract address |\n| isMarginEnabled | boolean | Support margin or not |\n| isDebitEnabled | boolean | Support debit or not |\n| chains | array | Refer to the schema section of chains |\n\n**root.data.chains Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| chainName | string | chain name of currency |\n| withdrawalMinSize | string | Minimum withdrawal amount |\n| depositMinSize | string | Minimum deposit amount |\n| withdrawFeeRate | string | withdraw fee rate |\n| withdrawalMinFee | string | Minimum fees charged for withdrawal |\n| isWithdrawEnabled | boolean | Support withdrawal or not |\n| isDepositEnabled | boolean | Support deposit or not |\n| confirms | integer | Number of block confirmations |\n| preConfirms | integer | The number of blocks (confirmations) for advance on-chain verification |\n| contractAddress | string | Contract address |\n| withdrawPrecision | integer | Withdrawal precision bit, indicating the maximum supported length after the decimal point of the withdrawal amount |\n| maxWithdraw | number | Maximum amount of single withdrawal |\n| maxDeposit | string | Maximum amount of single deposit (only applicable to Lightning Network) |\n| needTag | boolean | whether memo/tag is needed |\n| chainId | string | chain id of currency |\n\n---\n", + "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470152)\n\n:::info[Description]\nRequest via this endpoint to get the currency list. Not all currencies currently can be used for trading.\n:::\n\n:::tip[Tips]\n**CURRENCY CODES**\n\nCurrency codes will conform to the ISO 4217 standard where possible. Currencies which have or had no representation in ISO 4217 may use a custom code.\n\n\n| Code | Description |\n| --- | --- |\n| BTC | Bitcoin |\n| ETH | Ethereum |\n| KCS | Kucoin Shares |\n\nFor a coin, the \"**currency**\" is a fixed value and works as the only recognized identity of the coin. As the \"**name**\", \"**fullnane**\" and \"**precision**\" of a coin are modifiable values, when the \"name\" of a coin is changed, you should use \"**currency**\" to get the coin.\n\nFor example: The \"**currency**\" of XRB is \"XRB\", if the \"**name**\" of XRB is changed into \"**Nano**\", you should use \"XRB\" (the currency of XRB) to search the coin.\n:::\n\n\n\n\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | array | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| currency | string | A unique currency code that will never change |\n| name | string | Currency name, will change after renaming |\n| fullName | string | Full name of a currency, will change after renaming |\n| precision | integer | Currency precision |\n| confirms | integer | Number of block confirmations |\n| contractAddress | string | Contract address |\n| isMarginEnabled | boolean | Support margin or not |\n| isDebitEnabled | boolean | Support debit or not |\n| chains | array | Refer to the schema section of chains |\n\n**root.data.chains Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| chainName | string | chain name of currency |\n| withdrawalMinSize | string | Minimum withdrawal amount |\n| depositMinSize | string | Minimum deposit amount |\n| withdrawFeeRate | string | withdraw fee rate |\n| withdrawalMinFee | string | Minimum fees charged for withdrawal |\n| isWithdrawEnabled | boolean | Support withdrawal or not |\n| isDepositEnabled | boolean | Support deposit or not |\n| confirms | integer | Number of block confirmations |\n| preConfirms | integer | The number of blocks (confirmations) for advance on-chain verification |\n| contractAddress | string | Contract address |\n| withdrawPrecision | integer | Withdrawal precision bit, indicating the maximum supported length after the decimal point of the withdrawal amount |\n| maxWithdraw | string | Maximum amount of single withdrawal |\n| maxDeposit | string | Maximum amount of single deposit (only applicable to Lightning Network) |\n| needTag | boolean | whether memo/tag is needed |\n| chainId | string | chain id of currency |\n| depositFeeRate | string | deposit fee rate (some currencies have this param, the default is empty) |\n| withdrawMaxFee | string | withdraw max fee(some currencies have this param, the default is empty) |\n| depositTierFee | string | |\n\n---\n", "body": {} }, "response": [ @@ -3859,16 +3819,9 @@ "path": [ "api", "v3", - "currencies", - "{{currency}}" + "currencies" ], - "query": [ - { - "key": "chain", - "value": "", - "description": "Support for querying the chain of currency, e.g. The available value for USDT are OMNI, ERC20, TRC20. This only apply for multi-chain currency, and there is no need for single chain currency." - } - ] + "query": [] } }, "status": "OK", @@ -3901,12 +3854,12 @@ } ], "cookie": [], - "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"currency\": \"BTC\",\n \"name\": \"BTC\",\n \"fullName\": \"Bitcoin\",\n \"precision\": 8,\n \"confirms\": null,\n \"contractAddress\": null,\n \"isMarginEnabled\": true,\n \"isDebitEnabled\": true,\n \"chains\": [\n {\n \"chainName\": \"BTC\",\n \"withdrawalMinSize\": \"0.001\",\n \"depositMinSize\": \"0.0002\",\n \"withdrawFeeRate\": \"0\",\n \"withdrawalMinFee\": \"0.0005\",\n \"isWithdrawEnabled\": true,\n \"isDepositEnabled\": true,\n \"confirms\": 3,\n \"preConfirms\": 1,\n \"contractAddress\": \"\",\n \"withdrawPrecision\": 8,\n \"maxWithdraw\": null,\n \"maxDeposit\": null,\n \"needTag\": false,\n \"chainId\": \"btc\"\n },\n {\n \"chainName\": \"Lightning Network\",\n \"withdrawalMinSize\": \"0.00001\",\n \"depositMinSize\": \"0.00001\",\n \"withdrawFeeRate\": \"0\",\n \"withdrawalMinFee\": \"0.000015\",\n \"isWithdrawEnabled\": true,\n \"isDepositEnabled\": true,\n \"confirms\": 1,\n \"preConfirms\": 1,\n \"contractAddress\": \"\",\n \"withdrawPrecision\": 8,\n \"maxWithdraw\": null,\n \"maxDeposit\": \"0.03\",\n \"needTag\": false,\n \"chainId\": \"btcln\"\n },\n {\n \"chainName\": \"KCC\",\n \"withdrawalMinSize\": \"0.0008\",\n \"depositMinSize\": null,\n \"withdrawFeeRate\": \"0\",\n \"withdrawalMinFee\": \"0.00002\",\n \"isWithdrawEnabled\": true,\n \"isDepositEnabled\": true,\n \"confirms\": 20,\n \"preConfirms\": 20,\n \"contractAddress\": \"0xfa93c12cd345c658bc4644d1d4e1b9615952258c\",\n \"withdrawPrecision\": 8,\n \"maxWithdraw\": null,\n \"maxDeposit\": null,\n \"needTag\": false,\n \"chainId\": \"kcc\"\n },\n {\n \"chainName\": \"BTC-Segwit\",\n \"withdrawalMinSize\": \"0.0008\",\n \"depositMinSize\": \"0.0002\",\n \"withdrawFeeRate\": \"0\",\n \"withdrawalMinFee\": \"0.0005\",\n \"isWithdrawEnabled\": false,\n \"isDepositEnabled\": true,\n \"confirms\": 2,\n \"preConfirms\": 2,\n \"contractAddress\": \"\",\n \"withdrawPrecision\": 8,\n \"maxWithdraw\": null,\n \"maxDeposit\": null,\n \"needTag\": false,\n \"chainId\": \"bech32\"\n }\n ]\n }\n}" + "body": "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"currency\": \"BTC\",\n \"name\": \"BTC\",\n \"fullName\": \"Bitcoin\",\n \"precision\": 8,\n \"confirms\": null,\n \"contractAddress\": null,\n \"isMarginEnabled\": true,\n \"isDebitEnabled\": true,\n \"chains\": [\n {\n \"chainName\": \"BTC\",\n \"withdrawalMinSize\": \"0.001\",\n \"depositMinSize\": \"0.0002\",\n \"withdrawFeeRate\": \"0\",\n \"withdrawalMinFee\": \"0.0005\",\n \"isWithdrawEnabled\": true,\n \"isDepositEnabled\": true,\n \"confirms\": 3,\n \"preConfirms\": 1,\n \"contractAddress\": \"\",\n \"withdrawPrecision\": 8,\n \"maxWithdraw\": null,\n \"maxDeposit\": null,\n \"needTag\": false,\n \"chainId\": \"btc\"\n },\n {\n \"chainName\": \"Lightning Network\",\n \"withdrawalMinSize\": \"0.00001\",\n \"depositMinSize\": \"0.00001\",\n \"withdrawFeeRate\": \"0\",\n \"withdrawalMinFee\": \"0.000015\",\n \"isWithdrawEnabled\": true,\n \"isDepositEnabled\": true,\n \"confirms\": 1,\n \"preConfirms\": 1,\n \"contractAddress\": \"\",\n \"withdrawPrecision\": 8,\n \"maxWithdraw\": null,\n \"maxDeposit\": \"0.03\",\n \"needTag\": false,\n \"chainId\": \"btcln\"\n },\n {\n \"chainName\": \"KCC\",\n \"withdrawalMinSize\": \"0.0008\",\n \"depositMinSize\": null,\n \"withdrawFeeRate\": \"0\",\n \"withdrawalMinFee\": \"0.00002\",\n \"isWithdrawEnabled\": true,\n \"isDepositEnabled\": true,\n \"confirms\": 20,\n \"preConfirms\": 20,\n \"contractAddress\": \"0xfa93c12cd345c658bc4644d1d4e1b9615952258c\",\n \"withdrawPrecision\": 8,\n \"maxWithdraw\": null,\n \"maxDeposit\": null,\n \"needTag\": false,\n \"chainId\": \"kcc\"\n },\n {\n \"chainName\": \"BTC-Segwit\",\n \"withdrawalMinSize\": \"0.0008\",\n \"depositMinSize\": \"0.0002\",\n \"withdrawFeeRate\": \"0\",\n \"withdrawalMinFee\": \"0.0005\",\n \"isWithdrawEnabled\": false,\n \"isDepositEnabled\": true,\n \"confirms\": 2,\n \"preConfirms\": 2,\n \"contractAddress\": \"\",\n \"withdrawPrecision\": 8,\n \"maxWithdraw\": null,\n \"maxDeposit\": null,\n \"needTag\": false,\n \"chainId\": \"bech32\"\n }\n ]\n },\n {\n \"currency\": \"BTCP\",\n \"name\": \"BTCP\",\n \"fullName\": \"Bitcoin Private\",\n \"precision\": 8,\n \"confirms\": null,\n \"contractAddress\": null,\n \"isMarginEnabled\": false,\n \"isDebitEnabled\": false,\n \"chains\": [\n {\n \"chainName\": \"BTCP\",\n \"withdrawalMinSize\": \"0.100000\",\n \"depositMinSize\": null,\n \"withdrawFeeRate\": \"0\",\n \"withdrawalMinFee\": \"0.010000\",\n \"isWithdrawEnabled\": false,\n \"isDepositEnabled\": false,\n \"confirms\": 6,\n \"preConfirms\": 6,\n \"contractAddress\": \"\",\n \"withdrawPrecision\": 8,\n \"maxWithdraw\": null,\n \"maxDeposit\": null,\n \"needTag\": false,\n \"chainId\": \"btcp\"\n }\n ]\n }\n ]\n}" } ] }, { - "name": "Get Server Time", + "name": "Get Symbol ", "request": { "method": "GET", "header": [], @@ -3918,12 +3871,13 @@ ], "path": [ "api", - "v1", - "timestamp" + "v2", + "symbols", + "{{symbol}}" ], "query": [] }, - "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470156)\n\n:::info[Description]\nGet the server time.\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | integer | ServerTime(millisecond) |\n\n---\n", + "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470159)\n\n:::info[Description]\nRequest via this endpoint to get detail currency pairs for trading. If you want to get the market information of the trading symbol, please use Get All Tickers.\n:::\n\n\n- The baseMinSize and baseMaxSize fields define the min and max order size.\n- The priceIncrement field specifies the min order price as well as the price increment.This also applies to quote currency.\n\nThe order price must be a positive integer multiple of this priceIncrement (i.e. if the increment is 0.01, the 0.001 and 0.021 order prices would be rejected).\n\npriceIncrement and quoteIncrement may be adjusted in the future. We will notify you by email and site notifications before adjustment.\n\n| Order Type | Follow the rules of minFunds |\n| ------ | ---------- |\n| Limit Buy\t | [Order Amount * Order Price] >= minFunds |\n| Limit Sell | [Order Amount * Order Price] >= minFunds |\n| Market Buy | Order Value >= minFunds |\n| Market Sell | [Order Amount * Last Price of Base Currency] >= minFunds |\n\nNote:\n- API market buy orders (by amount) valued at (Order Amount * Last Price of Base Currency) < minFunds will be rejected.\n- API market sell orders (by value) valued at < minFunds will be rejected.\n- Take profit and stop loss orders at market or limit prices will be rejected when triggered.\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| symbol | string | unique code of a symbol, it would not change after renaming |\n| name | string | Name of trading pairs, it would change after renaming |\n| baseCurrency | string | Base currency,e.g. BTC. |\n| quoteCurrency | string | Quote currency,e.g. USDT. |\n| feeCurrency | string | The currency of charged fees. |\n| market | string | The trading market. |\n| baseMinSize | string | The minimum order quantity requried to place an order. |\n| quoteMinSize | string | The minimum order funds required to place a market order. |\n| baseMaxSize | string | The maximum order size required to place an order. |\n| quoteMaxSize | string | The maximum order funds required to place a market order. |\n| baseIncrement | string | Quantity increment: The quantity for an order must be a positive integer multiple of this increment. Here, the size refers to the quantity of the base currency for the order. For example, for the ETH-USDT trading pair, if the baseIncrement is 0.0000001, the order quantity can be 1.0000001 but not 1.00000001. |\n| quoteIncrement | string | Quote increment: The funds for a market order must be a positive integer multiple of this increment. The funds refer to the quote currency amount. For example, for the ETH-USDT trading pair, if the quoteIncrement is 0.000001, the amount of USDT for the order can be 3000.000001 but not 3000.0000001. |\n| priceIncrement | string | Price increment: The price of an order must be a positive integer multiple of this increment. For example, for the ETH-USDT trading pair, if the priceIncrement is 0.01, the order price can be 3000.01 but not 3000.001. |\n| priceLimitRate | string | Threshold for price portection |\n| minFunds | string | the minimum trading amounts |\n| isMarginEnabled | boolean | Available for margin or not. |\n| enableTrading | boolean | Available for transaction or not. |\n| feeCategory | integer | [Fee Type](https://www.kucoin.com/vip/privilege) |\n| makerFeeCoefficient | string | The maker fee coefficient. The actual fee needs to be multiplied by this coefficient to get the final fee. Most currencies have a coefficient of 1. If set to 0, it means no fee |\n| takerFeeCoefficient | string | The taker fee coefficient. The actual fee needs to be multiplied by this coefficient to get the final fee. Most currencies have a coefficient of 1. If set to 0, it means no fee |\n| st | boolean | |\n\n---\n", "body": {} }, "response": [ @@ -3940,8 +3894,9 @@ ], "path": [ "api", - "v1", - "timestamp" + "v2", + "symbols", + "{{symbol}}" ], "query": [] } @@ -3976,12 +3931,12 @@ } ], "cookie": [], - "body": "{\n \"code\": \"200000\",\n \"data\": 1729100692873\n}" + "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"symbol\": \"BTC-USDT\",\n \"name\": \"BTC-USDT\",\n \"baseCurrency\": \"BTC\",\n \"quoteCurrency\": \"USDT\",\n \"feeCurrency\": \"USDT\",\n \"market\": \"USDS\",\n \"baseMinSize\": \"0.00001\",\n \"quoteMinSize\": \"0.1\",\n \"baseMaxSize\": \"10000000000\",\n \"quoteMaxSize\": \"99999999\",\n \"baseIncrement\": \"0.00000001\",\n \"quoteIncrement\": \"0.000001\",\n \"priceIncrement\": \"0.1\",\n \"priceLimitRate\": \"0.1\",\n \"minFunds\": \"0.1\",\n \"isMarginEnabled\": true,\n \"enableTrading\": true,\n \"feeCategory\": 1,\n \"makerFeeCoefficient\": \"1.00\",\n \"takerFeeCoefficient\": \"1.00\",\n \"st\": false\n }\n}" } ] }, { - "name": "Get Announcements", + "name": "Get All Symbols", "request": { "method": "GET", "header": [], @@ -3993,43 +3948,18 @@ ], "path": [ "api", - "v3", - "announcements" + "v2", + "symbols" ], "query": [ { - "key": "currentPage", - "value": "1", - "description": "page number" - }, - { - "key": "pageSize", - "value": "50", - "description": "page Size" - }, - { - "key": "annType", - "value": "latest-announcements", - "description": "Announcement types: latest-announcements , activities (latest activities), new-listings (new currency online), product-updates (product updates), vip (institutions and VIPs), maintenance-updates (system maintenance), product -updates (product news), delistings (currency offline), others, api-campaigns (API user activities), default : latest-announcements" - }, - { - "key": "lang", - "value": "en_US", - "description": "Language type, the default is en_US, the specific value parameters are as follows" - }, - { - "key": "startTime", - "value": "1729594043000", - "description": "Announcement online start time (milliseconds)" - }, - { - "key": "endTime", - "value": "1729697729000", - "description": "Announcement online end time (milliseconds)" + "key": "market", + "value": "", + "description": "[The trading market](https://www.kucoin.com/docs-new/api-222921786)" } ] }, - "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470157)\n\n:::info[Description]\nThis interface can obtain the latest news announcements, and the default page search is for announcements within a month.\n:::\n\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| totalNum | integer | Total Number |\n| items | array | Refer to the schema section of items |\n| currentPage | integer | Current page |\n| pageSize | integer | Page size |\n| totalPage | integer | Total Page |\n\n**root.data.items Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| annId | integer | Announcement ID |\n| annTitle | string | Announcement title |\n| annType | array | Refer to the schema section of annType |\n| annDesc | string | Announcement description |\n| cTime | integer | Announcement release time, Unix millisecond timestamp format |\n| language | string | language type |\n| annUrl | string | Announcement link |\n\n---\n", + "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470154)\n\n:::info[Description]\nRequest via this endpoint to get a list of available currency pairs for trading. If you want to get the market information of the trading symbol, please use Get All Tickers.\n:::\n\n\n:::tip[Tips]\npriceIncrement and quoteIncrement may be adjusted in the future. We will notify you by email and site notifications before adjustment.\n:::\n\n| Order Type | Follow the rules of minFunds |\n| --- | --- |\n| Limit Buy | [Order Amount * Order Price] >= minFunds |\n| Limit Sell | [Order Amount * Order Price] >= minFunds |\n| Market Buy | Order Value >= minFunds |\n| Market Sell | [Order Amount * Last Price of Base Currency] >= minFunds |\n\nNote:\n\n- API market buy orders (by amount) valued at [Order Amount * Last Price of Base Currency] < minFunds will be rejected.\n- API market sell orders (by value) valued at < minFunds will be rejected.\n- Take profit and stop loss orders at market or limit prices will be rejected when triggered.\n\n\n\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | array | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| symbol | string | unique code of a symbol, it would not change after renaming |\n| name | string | Name of trading pairs, it would change after renaming |\n| baseCurrency | string | Base currency,e.g. BTC. |\n| quoteCurrency | string | Quote currency,e.g. USDT. |\n| feeCurrency | string | The currency of charged fees. |\n| market | string | The trading market. |\n| baseMinSize | string | The minimum order quantity requried to place an order. |\n| quoteMinSize | string | The minimum order funds required to place a market order. |\n| baseMaxSize | string | The maximum order size required to place an order. |\n| quoteMaxSize | string | The maximum order funds required to place a market order. |\n| baseIncrement | string | Quantity increment: The quantity for an order must be a positive integer multiple of this increment. Here, the size refers to the quantity of the base currency for the order. For example, for the ETH-USDT trading pair, if the baseIncrement is 0.0000001, the order quantity can be 1.0000001 but not 1.00000001. |\n| quoteIncrement | string | Quote increment: The funds for a market order must be a positive integer multiple of this increment. The funds refer to the quote currency amount. For example, for the ETH-USDT trading pair, if the quoteIncrement is 0.000001, the amount of USDT for the order can be 3000.000001 but not 3000.0000001. |\n| priceIncrement | string | Price increment: The price of an order must be a positive integer multiple of this increment. For example, for the ETH-USDT trading pair, if the priceIncrement is 0.01, the order price can be 3000.01 but not 3000.001.

specifies the min order price as well as the price increment.This also applies to quote currency. |\n| priceLimitRate | string | Threshold for price portection |\n| minFunds | string | the minimum trading amounts |\n| isMarginEnabled | boolean | Available for margin or not. |\n| enableTrading | boolean | Available for transaction or not. |\n| feeCategory | integer | [Fee Type](https://www.kucoin.com/vip/privilege) |\n| makerFeeCoefficient | string | The maker fee coefficient. The actual fee needs to be multiplied by this coefficient to get the final fee. Most currencies have a coefficient of 1. If set to 0, it means no fee |\n| takerFeeCoefficient | string | The taker fee coefficient. The actual fee needs to be multiplied by this coefficient to get the final fee. Most currencies have a coefficient of 1. If set to 0, it means no fee |\n| st | boolean | Whether it is an [Special Treatment](https://www.kucoin.com/legal/special-treatment) symbol |\n\n---\n", "body": {} }, "response": [ @@ -4046,39 +3976,14 @@ ], "path": [ "api", - "v3", - "announcements" + "v2", + "symbols" ], "query": [ { - "key": "currentPage", - "value": "1", - "description": "page number" - }, - { - "key": "pageSize", - "value": "50", - "description": "page Size" - }, - { - "key": "annType", - "value": "latest-announcements", - "description": "Announcement types: latest-announcements , activities (latest activities), new-listings (new currency online), product-updates (product updates), vip (institutions and VIPs), maintenance-updates (system maintenance), product -updates (product news), delistings (currency offline), others, api-campaigns (API user activities), default : latest-announcements" - }, - { - "key": "lang", - "value": "en_US", - "description": "Language type, the default is en_US, the specific value parameters are as follows" - }, - { - "key": "startTime", - "value": "1729594043000", - "description": "Announcement online start time (milliseconds)" - }, - { - "key": "endTime", - "value": "1729697729000", - "description": "Announcement online end time (milliseconds)" + "key": "market", + "value": "", + "description": "[The trading market](https://www.kucoin.com/docs-new/api-222921786)" } ] } @@ -4113,12 +4018,12 @@ } ], "cookie": [], - "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"totalNum\": 195,\n \"totalPage\": 13,\n \"currentPage\": 1,\n \"pageSize\": 15,\n \"items\": [\n {\n \"annId\": 129045,\n \"annTitle\": \"KuCoin Isolated Margin Adds the Scroll (SCR) Trading Pair\",\n \"annType\": [\n \"latest-announcements\"\n ],\n \"annDesc\": \"To enrich the variety of assets available, KuCoin’s Isolated Margin Trading platform has added the Scroll (SCR) asset and trading pair.\",\n \"cTime\": 1729594043000,\n \"language\": \"en_US\",\n \"annUrl\": \"https://www.kucoin.com/announcement/kucoin-isolated-margin-adds-scr?lang=en_US\"\n },\n {\n \"annId\": 129001,\n \"annTitle\": \"DAPP-30D Fixed Promotion, Enjoy an APR of 200%!​\",\n \"annType\": [\n \"latest-announcements\",\n \"activities\"\n ],\n \"annDesc\": \"KuCoin Earn will be launching the DAPP Fixed Promotion at 10:00:00 on October 22, 2024 (UTC). The available product is “DAPP-30D'' with an APR of 200%.\",\n \"cTime\": 1729588460000,\n \"language\": \"en_US\",\n \"annUrl\": \"https://www.kucoin.com/announcement/dapp-30d-fixed-promotion-enjoy?lang=en_US\"\n },\n {\n \"annId\": 128581,\n \"annTitle\": \"NAYM (NAYM) Gets Listed on KuCoin! World Premiere!\",\n \"annType\": [\n \"latest-announcements\",\n \"new-listings\"\n ],\n \"annDesc\": \"Trading: 11:00 on October 22, 2024 (UTC)\",\n \"cTime\": 1729497729000,\n \"language\": \"en_US\",\n \"annUrl\": \"https://www.kucoin.com/announcement/en-naym-naym-gets-listed-on-kucoin-world-premiere?lang=en_US\"\n }\n ]\n }\n}" + "body": "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"symbol\": \"BTC-USDT\",\n \"name\": \"BTC-USDT\",\n \"baseCurrency\": \"BTC\",\n \"quoteCurrency\": \"USDT\",\n \"feeCurrency\": \"USDT\",\n \"market\": \"USDS\",\n \"baseMinSize\": \"0.00001\",\n \"quoteMinSize\": \"0.1\",\n \"baseMaxSize\": \"10000000000\",\n \"quoteMaxSize\": \"99999999\",\n \"baseIncrement\": \"0.00000001\",\n \"quoteIncrement\": \"0.000001\",\n \"priceIncrement\": \"0.1\",\n \"priceLimitRate\": \"0.1\",\n \"minFunds\": \"0.1\",\n \"isMarginEnabled\": true,\n \"enableTrading\": true,\n \"feeCategory\": 1,\n \"makerFeeCoefficient\": \"1.00\",\n \"takerFeeCoefficient\": \"1.00\",\n \"st\": false\n }\n ]\n}" } ] }, { - "name": "Get Service Status", + "name": "Get Ticker", "request": { "method": "GET", "header": [], @@ -4131,11 +4036,19 @@ "path": [ "api", "v1", - "status" + "market", + "orderbook", + "level1" ], - "query": [] + "query": [ + { + "key": "symbol", + "value": "BTC-USDT", + "description": "symbol" + } + ] }, - "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470158)\n\n:::info[Description]\nGet the service status\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| status | string | Status of service: open:normal transaction, close:Stop Trading/Maintenance, cancelonly:can only cancel the order but not place order |\n| msg | string | Remark for operation |\n\n---\n", + "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470160)\n\n:::info[Description]\nRequest via this endpoint to get Level 1 Market Data. The returned value includes the best bid price and size, the best ask price and size as well as the last traded price and the last traded size.\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| time | integer | timestamp |\n| sequence | string | Sequence |\n| price | string | Last traded price |\n| size | string | Last traded size |\n| bestBid | string | Best bid price |\n| bestBidSize | string | Best bid size |\n| bestAsk | string | Best ask price |\n| bestAskSize | string | Best ask size |\n\n---\n", "body": {} }, "response": [ @@ -4153,9 +4066,17 @@ "path": [ "api", "v1", - "status" + "market", + "orderbook", + "level1" ], - "query": [] + "query": [ + { + "key": "symbol", + "value": "BTC-USDT", + "description": "symbol" + } + ] } }, "status": "OK", @@ -4188,12 +4109,12 @@ } ], "cookie": [], - "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"status\": \"open\",\n \"msg\": \"\"\n }\n}" + "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"time\": 1729172965609,\n \"sequence\": \"14609309753\",\n \"price\": \"67269\",\n \"size\": \"0.000025\",\n \"bestBid\": \"67267.5\",\n \"bestBidSize\": \"0.000025\",\n \"bestAsk\": \"67267.6\",\n \"bestAskSize\": \"1.24808993\"\n }\n}" } ] }, { - "name": "Get Symbol ", + "name": "Get All Tickers", "request": { "method": "GET", "header": [], @@ -4205,13 +4126,13 @@ ], "path": [ "api", - "v2", - "symbols", - "{{symbol}}" + "v1", + "market", + "allTickers" ], "query": [] }, - "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470159)\n\n:::info[Description]\nRequest via this endpoint to get detail currency pairs for trading. If you want to get the market information of the trading symbol, please use Get All Tickers.\n:::\n\n\n- The baseMinSize and baseMaxSize fields define the min and max order size.\n- The priceIncrement field specifies the min order price as well as the price increment.This also applies to quote currency.\n\nThe order price must be a positive integer multiple of this priceIncrement (i.e. if the increment is 0.01, the 0.001 and 0.021 order prices would be rejected).\n\npriceIncrement and quoteIncrement may be adjusted in the future. We will notify you by email and site notifications before adjustment.\n\n| Order Type | Follow the rules of minFunds |\n| ------ | ---------- |\n| Limit Buy\t | [Order Amount * Order Price] >= minFunds |\n| Limit Sell | [Order Amount * Order Price] >= minFunds |\n| Market Buy | Order Value >= minFunds |\n| Market Sell | [Order Amount * Last Price of Base Currency] >= minFunds |\n\nNote:\n- API market buy orders (by amount) valued at (Order Amount * Last Price of Base Currency) < minFunds will be rejected.\n- API market sell orders (by value) valued at < minFunds will be rejected.\n- Take profit and stop loss orders at market or limit prices will be rejected when triggered.\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| symbol | string | unique code of a symbol, it would not change after renaming |\n| name | string | Name of trading pairs, it would change after renaming |\n| baseCurrency | string | Base currency,e.g. BTC. |\n| quoteCurrency | string | Quote currency,e.g. USDT. |\n| feeCurrency | string | The currency of charged fees. |\n| market | string | The trading market. |\n| baseMinSize | string | The minimum order quantity requried to place an order. |\n| quoteMinSize | string | The minimum order funds required to place a market order. |\n| baseMaxSize | string | The maximum order size required to place an order. |\n| quoteMaxSize | string | The maximum order funds required to place a market order. |\n| baseIncrement | string | Quantity increment: The quantity for an order must be a positive integer multiple of this increment. Here, the size refers to the quantity of the base currency for the order. For example, for the ETH-USDT trading pair, if the baseIncrement is 0.0000001, the order quantity can be 1.0000001 but not 1.00000001. |\n| quoteIncrement | string | Quote increment: The funds for a market order must be a positive integer multiple of this increment. The funds refer to the quote currency amount. For example, for the ETH-USDT trading pair, if the quoteIncrement is 0.000001, the amount of USDT for the order can be 3000.000001 but not 3000.0000001. |\n| priceIncrement | string | Price increment: The price of an order must be a positive integer multiple of this increment. For example, for the ETH-USDT trading pair, if the priceIncrement is 0.01, the order price can be 3000.01 but not 3000.001. |\n| priceLimitRate | string | Threshold for price portection |\n| minFunds | string | the minimum trading amounts |\n| isMarginEnabled | boolean | Available for margin or not. |\n| enableTrading | boolean | Available for transaction or not. |\n| feeCategory | integer | [Fee Type](https://www.kucoin.com/vip/privilege) |\n| makerFeeCoefficient | string | The maker fee coefficient. The actual fee needs to be multiplied by this coefficient to get the final fee. Most currencies have a coefficient of 1. If set to 0, it means no fee |\n| takerFeeCoefficient | string | The taker fee coefficient. The actual fee needs to be multiplied by this coefficient to get the final fee. Most currencies have a coefficient of 1. If set to 0, it means no fee |\n| st | boolean | |\n\n---\n", + "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470167)\n\n:::info[Description]\nRequest market tickers for all the trading pairs in the market (including 24h volume), takes a snapshot every 2 seconds.\n\nOn the rare occasion that we will change the currency name, if you still want the changed symbol name, you can use the symbolName field instead of the symbol field via “Get Symbols List” endpoint.\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| time | integer | timestamp |\n| ticker | array | Refer to the schema section of ticker |\n\n**root.data.ticker Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| symbol | string | Symbol |\n| symbolName | string | Name of trading pairs, it would change after renaming |\n| buy | string | Best bid price |\n| bestBidSize | string | Best bid size |\n| sell | string | Best ask price |\n| bestAskSize | string | Best ask size |\n| changeRate | string | 24h change rate |\n| changePrice | string | 24h change price |\n| high | string | Highest price in 24h |\n| low | string | Lowest price in 24h |\n| vol | string | 24h volume, executed based on base currency |\n| volValue | string | 24h traded amount |\n| last | string | Last traded price |\n| averagePrice | string | Average trading price in the last 24 hours |\n| takerFeeRate | string | Basic Taker Fee |\n| makerFeeRate | string | Basic Maker Fee |\n| takerCoefficient | string | The taker fee coefficient. The actual fee needs to be multiplied by this coefficient to get the final fee. Most currencies have a coefficient of 1. If set to 0, it means no fee |\n| makerCoefficient | string | The maker fee coefficient. The actual fee needs to be multiplied by this coefficient to get the final fee. Most currencies have a coefficient of 1. If set to 0, it means no fee |\n\n---\n", "body": {} }, "response": [ @@ -4228,9 +4149,9 @@ ], "path": [ "api", - "v2", - "symbols", - "{{symbol}}" + "v1", + "market", + "allTickers" ], "query": [] } @@ -4265,12 +4186,12 @@ } ], "cookie": [], - "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"symbol\": \"BTC-USDT\",\n \"name\": \"BTC-USDT\",\n \"baseCurrency\": \"BTC\",\n \"quoteCurrency\": \"USDT\",\n \"feeCurrency\": \"USDT\",\n \"market\": \"USDS\",\n \"baseMinSize\": \"0.00001\",\n \"quoteMinSize\": \"0.1\",\n \"baseMaxSize\": \"10000000000\",\n \"quoteMaxSize\": \"99999999\",\n \"baseIncrement\": \"0.00000001\",\n \"quoteIncrement\": \"0.000001\",\n \"priceIncrement\": \"0.1\",\n \"priceLimitRate\": \"0.1\",\n \"minFunds\": \"0.1\",\n \"isMarginEnabled\": true,\n \"enableTrading\": true,\n \"feeCategory\": 1,\n \"makerFeeCoefficient\": \"1.00\",\n \"takerFeeCoefficient\": \"1.00\",\n \"st\": false\n }\n}" + "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"time\": 1729173207043,\n \"ticker\": [\n {\n \"symbol\": \"BTC-USDT\",\n \"symbolName\": \"BTC-USDT\",\n \"buy\": \"67192.5\",\n \"bestBidSize\": \"0.000025\",\n \"sell\": \"67192.6\",\n \"bestAskSize\": \"1.24949204\",\n \"changeRate\": \"-0.0014\",\n \"changePrice\": \"-98.5\",\n \"high\": \"68321.4\",\n \"low\": \"66683.3\",\n \"vol\": \"1836.03034612\",\n \"volValue\": \"124068431.06726933\",\n \"last\": \"67193\",\n \"averagePrice\": \"67281.21437289\",\n \"takerFeeRate\": \"0.001\",\n \"makerFeeRate\": \"0.001\",\n \"takerCoefficient\": \"1\",\n \"makerCoefficient\": \"1\"\n }\n ]\n }\n}" } ] }, { - "name": "Get Ticker", + "name": "Get Trade History", "request": { "method": "GET", "header": [], @@ -4284,8 +4205,7 @@ "api", "v1", "market", - "orderbook", - "level1" + "histories" ], "query": [ { @@ -4295,7 +4215,7 @@ } ] }, - "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470160)\n\n:::info[Description]\nRequest via this endpoint to get Level 1 Market Data. The returned value includes the best bid price and size, the best ask price and size as well as the last traded price and the last traded size.\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| time | integer | timestamp |\n| sequence | string | Sequence |\n| price | string | Last traded price |\n| size | string | Last traded size |\n| bestBid | string | Best bid price |\n| bestBidSize | string | Best bid size |\n| bestAsk | string | Best ask price |\n| bestAskSize | string | Best ask size |\n\n---\n", + "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470162)\n\n:::info[Description]\nRequest via this endpoint to get the trade history of the specified symbol, the returned quantity is the last 100 transaction records.\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | array | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| sequence | string | Sequence number |\n| price | string | Filled price |\n| size | string | Filled amount |\n| side | string | Filled side, The trade side indicates the taker order side. A taker order is the order that was matched with orders opened on the order book. |\n| time | integer | Filled timestamp(nanosecond) |\n\n---\n", "body": {} }, "response": [ @@ -4314,8 +4234,7 @@ "api", "v1", "market", - "orderbook", - "level1" + "histories" ], "query": [ { @@ -4356,12 +4275,12 @@ } ], "cookie": [], - "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"time\": 1729172965609,\n \"sequence\": \"14609309753\",\n \"price\": \"67269\",\n \"size\": \"0.000025\",\n \"bestBid\": \"67267.5\",\n \"bestBidSize\": \"0.000025\",\n \"bestAsk\": \"67267.6\",\n \"bestAskSize\": \"1.24808993\"\n }\n}" + "body": "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"sequence\": \"10976028003549185\",\n \"price\": \"67122\",\n \"size\": \"0.000025\",\n \"side\": \"buy\",\n \"time\": 1729177117877000000\n },\n {\n \"sequence\": \"10976028003549188\",\n \"price\": \"67122\",\n \"size\": \"0.01792257\",\n \"side\": \"buy\",\n \"time\": 1729177117877000000\n },\n {\n \"sequence\": \"10976028003549191\",\n \"price\": \"67122.9\",\n \"size\": \"0.05654289\",\n \"side\": \"buy\",\n \"time\": 1729177117877000000\n }\n ]\n}" } ] }, { - "name": "Get 24hr Stats", + "name": "Get Klines", "request": { "method": "GET", "header": [], @@ -4375,17 +4294,32 @@ "api", "v1", "market", - "stats" + "candles" ], "query": [ { "key": "symbol", "value": "BTC-USDT", - "description": "symbol" + "description": " symbol" + }, + { + "key": "type", + "value": "1min", + "description": "Type of candlestick patterns: 1min, 3min, 5min, 15min, 30min, 1hour, 2hour, 4hour, 6hour, 8hour, 12hour, 1day, 1week, 1month" + }, + { + "key": "startAt", + "value": "1566703297", + "description": "Start time (second), default is 0" + }, + { + "key": "endAt", + "value": "1566789757", + "description": "End time (second), default is 0" } ] }, - "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470161)\n\n:::info[Description]\nRequest via this endpoint to get the statistics of the specified ticker in the last 24 hours.\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| time | integer | timestamp |\n| symbol | string | Symbol |\n| buy | string | Best bid price
|\n| sell | string | Best ask price |\n| changeRate | string | 24h change rate |\n| changePrice | string | 24h change price |\n| high | string | Highest price in 24h |\n| low | string | Lowest price in 24h |\n| vol | string | 24h volume, executed based on base currency |\n| volValue | string | 24h traded amount |\n| last | string | Last traded price |\n| averagePrice | string | Average trading price in the last 24 hours |\n| takerFeeRate | string | Basic Taker Fee |\n| makerFeeRate | string | Basic Maker Fee |\n| takerCoefficient | string | The taker fee coefficient. The actual fee needs to be multiplied by this coefficient to get the final fee. Most currencies have a coefficient of 1. If set to 0, it means no fee |\n| makerCoefficient | string | The maker fee coefficient. The actual fee needs to be multiplied by this coefficient to get the final fee. Most currencies have a coefficient of 1. If set to 0, it means no fee |\n\n---\n", + "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470163)\n\n:::info[Description]\nGet the Kline of the symbol. Data are returned in grouped buckets based on requested type.\nFor each query, the system would return at most 1500 pieces of data. To obtain more data, please page the data by time.\n:::\n\n:::tip[Tips]\nKlines data may be incomplete. No data is published for intervals where there are no ticks.\n:::\n\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | array | Refer to the schema section of data |\n\n---\n", "body": {} }, "response": [ @@ -4404,13 +4338,28 @@ "api", "v1", "market", - "stats" + "candles" ], "query": [ { "key": "symbol", "value": "BTC-USDT", - "description": "symbol" + "description": " symbol" + }, + { + "key": "type", + "value": "1min", + "description": "Type of candlestick patterns: 1min, 3min, 5min, 15min, 30min, 1hour, 2hour, 4hour, 6hour, 8hour, 12hour, 1day, 1week, 1month" + }, + { + "key": "startAt", + "value": "1566703297", + "description": "Start time (second), default is 0" + }, + { + "key": "endAt", + "value": "1566789757", + "description": "End time (second), default is 0" } ] } @@ -4445,12 +4394,12 @@ } ], "cookie": [], - "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"time\": 1729175612158,\n \"symbol\": \"BTC-USDT\",\n \"buy\": \"66982.4\",\n \"sell\": \"66982.5\",\n \"changeRate\": \"-0.0114\",\n \"changePrice\": \"-778.1\",\n \"high\": \"68107.7\",\n \"low\": \"66683.3\",\n \"vol\": \"1738.02898182\",\n \"volValue\": \"117321982.415978333\",\n \"last\": \"66981.5\",\n \"averagePrice\": \"67281.21437289\",\n \"takerFeeRate\": \"0.001\",\n \"makerFeeRate\": \"0.001\",\n \"takerCoefficient\": \"1\",\n \"makerCoefficient\": \"1\"\n }\n}" + "body": "{\n \"code\": \"200000\",\n \"data\": [\n [\n \"1566789720\",\n \"10411.5\",\n \"10401.9\",\n \"10411.5\",\n \"10396.3\",\n \"29.11357276\",\n \"302889.301529914\"\n ],\n [\n \"1566789660\",\n \"10416\",\n \"10411.5\",\n \"10422.3\",\n \"10411.5\",\n \"15.61781842\",\n \"162703.708997029\"\n ],\n [\n \"1566789600\",\n \"10408.6\",\n \"10416\",\n \"10416\",\n \"10405.4\",\n \"12.45584973\",\n \"129666.51508559\"\n ]\n ]\n}" } ] }, { - "name": "Get Trade History", + "name": "Get Part OrderBook", "request": { "method": "GET", "header": [], @@ -4464,7 +4413,8 @@ "api", "v1", "market", - "histories" + "orderbook", + "level2_{size}" ], "query": [ { @@ -4474,7 +4424,7 @@ } ] }, - "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470162)\n\n:::info[Description]\nRequest via this endpoint to get the trade history of the specified symbol, the returned quantity is the last 100 transaction records.\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | array | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| sequence | string | Sequence number |\n| price | string | Filled price |\n| size | string | Filled amount |\n| side | string | Filled side, The trade side indicates the taker order side. A taker order is the order that was matched with orders opened on the order book. |\n| time | integer | Filled timestamp(nanosecond) |\n\n---\n", + "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470165)\n\n:::info[Description]\nQuery for part orderbook depth data. (aggregated by price)\n\nYou are recommended to request via this endpoint as the system reponse would be faster and cosume less traffic.\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| time | integer | Timestamp(millisecond) |\n| sequence | string | Sequence number |\n| bids | array | Refer to the schema section of bids |\n| asks | array | Refer to the schema section of asks |\n\n---\n", "body": {} }, "response": [ @@ -4493,7 +4443,8 @@ "api", "v1", "market", - "histories" + "orderbook", + "level2_{size}" ], "query": [ { @@ -4534,12 +4485,12 @@ } ], "cookie": [], - "body": "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"sequence\": \"10976028003549185\",\n \"price\": \"67122\",\n \"size\": \"0.000025\",\n \"side\": \"buy\",\n \"time\": 1729177117877000000\n },\n {\n \"sequence\": \"10976028003549188\",\n \"price\": \"67122\",\n \"size\": \"0.01792257\",\n \"side\": \"buy\",\n \"time\": 1729177117877000000\n },\n {\n \"sequence\": \"10976028003549191\",\n \"price\": \"67122.9\",\n \"size\": \"0.05654289\",\n \"side\": \"buy\",\n \"time\": 1729177117877000000\n }\n ]\n}" + "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"time\": 1729176273859,\n \"sequence\": \"14610502970\",\n \"bids\": [\n [\n \"66976.4\",\n \"0.69109872\"\n ],\n [\n \"66976.3\",\n \"0.14377\"\n ]\n ],\n \"asks\": [\n [\n \"66976.5\",\n \"0.05408199\"\n ],\n [\n \"66976.8\",\n \"0.0005\"\n ]\n ]\n }\n}" } ] }, { - "name": "Get Klines", + "name": "Get Full OrderBook", "request": { "method": "GET", "header": [], @@ -4551,34 +4502,20 @@ ], "path": [ "api", - "v1", + "v3", "market", - "candles" + "orderbook", + "level2" ], "query": [ { "key": "symbol", "value": "BTC-USDT", - "description": " symbol" - }, - { - "key": "type", - "value": "1min", - "description": "Type of candlestick patterns: 1min, 3min, 5min, 15min, 30min, 1hour, 2hour, 4hour, 6hour, 8hour, 12hour, 1day, 1week, 1month" - }, - { - "key": "startAt", - "value": "1566703297", - "description": "Start time (second), default is 0" - }, - { - "key": "endAt", - "value": "1566789757", - "description": "End time (second), default is 0" + "description": "symbol" } ] }, - "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470163)\n\n:::info[Description]\nGet the Kline of the symbol. Data are returned in grouped buckets based on requested type.\nFor each query, the system would return at most 1500 pieces of data. To obtain more data, please page the data by time.\n:::\n\n:::tip[Tips]\nKlines data may be incomplete. No data is published for intervals where there are no ticks.\n:::\n\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | array | Refer to the schema section of data |\n\n---\n", + "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470164)\n\n:::info[Description]\nQuery for Full orderbook depth data. (aggregated by price)\n\nIt is generally used by professional traders because it uses more server resources and traffic, and we have strict access rate limit control.\n\nTo maintain up-to-date Order Book, please use Websocket incremental feed after retrieving the OrderBook.\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| time | integer | Timestamp(millisecond) |\n| sequence | string | Sequence number |\n| bids | array | Refer to the schema section of bids |\n| asks | array | Refer to the schema section of asks |\n\n---\n", "body": {} }, "response": [ @@ -4595,30 +4532,16 @@ ], "path": [ "api", - "v1", + "v3", "market", - "candles" + "orderbook", + "level2" ], "query": [ { "key": "symbol", "value": "BTC-USDT", - "description": " symbol" - }, - { - "key": "type", - "value": "1min", - "description": "Type of candlestick patterns: 1min, 3min, 5min, 15min, 30min, 1hour, 2hour, 4hour, 6hour, 8hour, 12hour, 1day, 1week, 1month" - }, - { - "key": "startAt", - "value": "1566703297", - "description": "Start time (second), default is 0" - }, - { - "key": "endAt", - "value": "1566789757", - "description": "End time (second), default is 0" + "description": "symbol" } ] } @@ -4653,12 +4576,12 @@ } ], "cookie": [], - "body": "{\n \"code\": \"200000\",\n \"data\": [\n [\n \"1566789720\",\n \"10411.5\",\n \"10401.9\",\n \"10411.5\",\n \"10396.3\",\n \"29.11357276\",\n \"302889.301529914\"\n ],\n [\n \"1566789660\",\n \"10416\",\n \"10411.5\",\n \"10422.3\",\n \"10411.5\",\n \"15.61781842\",\n \"162703.708997029\"\n ],\n [\n \"1566789600\",\n \"10408.6\",\n \"10416\",\n \"10416\",\n \"10405.4\",\n \"12.45584973\",\n \"129666.51508559\"\n ]\n ]\n}" + "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"time\": 1729176273859,\n \"sequence\": \"14610502970\",\n \"bids\": [\n [\n \"66976.4\",\n \"0.69109872\"\n ],\n [\n \"66976.3\",\n \"0.14377\"\n ]\n ],\n \"asks\": [\n [\n \"66976.5\",\n \"0.05408199\"\n ],\n [\n \"66976.8\",\n \"0.0005\"\n ]\n ]\n }\n}" } ] }, { - "name": "Get Full OrderBook", + "name": "Get Fiat Price", "request": { "method": "GET", "header": [], @@ -4670,20 +4593,23 @@ ], "path": [ "api", - "v3", - "market", - "orderbook", - "level2" + "v1", + "prices" ], "query": [ { - "key": "symbol", - "value": "BTC-USDT", - "description": "symbol" + "key": "base", + "value": "", + "description": "Ticker symbol of a base currency,eg.USD,EUR. Default is USD" + }, + { + "key": "currencies", + "value": "", + "description": "Comma-separated cryptocurrencies to be converted into fiat, e.g.: BTC,ETH, etc. Default to return the fiat price of all currencies." } ] }, - "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470164)\n\n:::info[Description]\nQuery for Full orderbook depth data. (aggregated by price)\n\nIt is generally used by professional traders because it uses more server resources and traffic, and we have strict access rate limit control.\n\nTo maintain up-to-date Order Book, please use Websocket incremental feed after retrieving the OrderBook.\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| time | integer | Timestamp(millisecond) |\n| sequence | string | Sequence number |\n| bids | array | Refer to the schema section of bids |\n| asks | array | Refer to the schema section of asks |\n\n---\n", + "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470153)\n\n:::info[Description]\nRequest via this endpoint to get the fiat price of the currencies for the available trading pairs.\n:::\n\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| AGLD | string | |\n| DFI | string | |\n| PYTHUP | string | |\n| ISLM | string | |\n| NEAR | string | |\n| AIOZ | string | |\n| AUDIO | string | |\n| BBL | string | |\n| WLD | string | |\n| HNT | string | |\n| ETHFI | string | |\n| DMAIL | string | |\n| OPUP | string | |\n| VET3S | string | |\n| MANA3S | string | |\n| TIDAL | string | |\n| HALO | string | |\n| OPUL | string | |\n| MANA3L | string | |\n| DGB | string | |\n| AA | string | |\n| BCH | string | |\n| GMEE | string | |\n| JST | string | |\n| PBUX | string | |\n| AR | string | |\n| SEI | string | |\n| PSTAKE | string | |\n| LMWR | string | |\n| UNFIDOWN | string | |\n| BB | string | |\n| JTO | string | |\n| WEMIX | string | |\n| G | string | |\n| MARSH | string | |\n| BN | string | |\n| FLIP | string | |\n| FLR | string | |\n| BIGTIME | string | |\n| FLY | string | |\n| T | string | |\n| W | string | |\n| BDX | string | |\n| BABYDOGE | string | |\n| SFP | string | |\n| DIA | string | |\n| ISME | string | |\n| LYM | string | |\n| VET3L | string | |\n| JUP | string | |\n| LYX | string | |\n| AIEPK | string | |\n| SILLY | string | |\n| SCPT | string | |\n| WOO | string | |\n| BLUR | string | |\n| STRK | string | |\n| BFC | string | |\n| DC | string | |\n| KARATE | string | |\n| SUSHI3L | string | |\n| NETVR | string | |\n| WAVES | string | |\n| LITH | string | |\n| HAPI | string | |\n| SUSHI3S | string | |\n| CEEK | string | |\n| FLOKI | string | |\n| SHR | string | |\n| SAND | string | |\n| TURT | string | |\n| UMA | string | |\n| BEPRO | string | |\n| SCRT | string | |\n| TUSD | string | |\n| COOKIE | string | |\n| LRDS | string | |\n| SIN | string | |\n| OAS | string | |\n| ROOT | string | |\n| ADA3L | string | |\n| TIAUP | string | |\n| HTR | string | |\n| UNB | string | |\n| UNA | string | |\n| HARD | string | |\n| G3 | string | |\n| ADA3S | string | |\n| MYRO | string | |\n| HTX | string | |\n| FT | string | |\n| BTCDOWN | string | |\n| UNI | string | |\n| FX | string | |\n| OBI | string | |\n| UNO | string | |\n| WRX | string | |\n| TIADOWN | string | |\n| ETHDOWN | string | |\n| WELL | string | |\n| SWFTC | string | |\n| SKL | string | |\n| UOS | string | |\n| AIPAD | string | |\n| BRETT | string | |\n| SKY | string | |\n| FRM | string | |\n| VISION | string | |\n| LENDS | string | |\n| SLF | string | |\n| BULL | string | |\n| FLOW | string | |\n| ODDZ | string | |\n| SLN | string | |\n| UPO | string | |\n| SLP | string | |\n| ID | string | |\n| SLIM | string | |\n| SPOT | string | |\n| DOP | string | |\n| ISSP | string | |\n| UQC | string | |\n| IO | string | |\n| DOT | string | |\n| 1INCH | string | |\n| SMH | string | |\n| MAK | string | |\n| TOKO | string | |\n| TURBO | string | |\n| UNFI | string | |\n| MAN | string | |\n| EVER | string | |\n| FTM | string | |\n| SHRAP | string | |\n| MAV | string | |\n| MAX | string | |\n| DPR | string | |\n| FTT | string | |\n| ARKM | string | |\n| ATOM | string | |\n| PENDLE | string | |\n| QUICK | string | |\n| BLZ | string | |\n| BOBA | string | |\n| MBL | string | |\n| OFN | string | |\n| UNIO | string | |\n| SNS | string | |\n| SNX | string | |\n| NXRA | string | |\n| TAIKO | string | |\n| AVAX3L | string | |\n| L3 | string | |\n| API3 | string | |\n| XRP3S | string | |\n| QKC | string | |\n| AVAX3S | string | |\n| ROSE | string | |\n| SATS | string | |\n| BMX | string | |\n| PORTAL | string | |\n| TOMI | string | |\n| XRP3L | string | |\n| SOL | string | |\n| SON | string | |\n| BNC | string | |\n| SOCIAL | string | |\n| CGPT | string | |\n| CELR | string | |\n| BNB | string | |\n| OGN | string | |\n| CELO | string | |\n| AUCTION | string | |\n| MANTA | string | |\n| LAYER | string | |\n| AERO | string | |\n| CETUS | string | |\n| LL | string | |\n| SPA | string | |\n| PYTHDOWN | string | |\n| NEIROCTO | string | |\n| UTK | string | |\n| GMRX | string | |\n| BOB | string | |\n| HOTCROSS | string | |\n| AERGO | string | |\n| MOCA | string | |\n| SQD | string | |\n| MV | string | |\n| BNB3L | string | |\n| BNB3S | string | |\n| GALAX3L | string | |\n| KAI | string | |\n| SQR | string | |\n| GALAX3S | string | |\n| EGLD | string | |\n| ZBCN | string | |\n| KAS | string | |\n| MEW | string | |\n| PUNDIX | string | |\n| LOOKS | string | |\n| FXS | string | |\n| BOSON | string | |\n| BRISE | string | |\n| AEVO | string | |\n| FLUX | string | |\n| PRCL | string | |\n| UNFIUP | string | |\n| SEIDOWN | string | |\n| DOAI | string | |\n| QNT | string | |\n| REDO | string | |\n| STRIKE | string | |\n| ETHW | string | |\n| OM | string | |\n| OP | string | |\n| WHALE | string | |\n| 1CAT | string | |\n| NEON | string | |\n| GTAI | string | |\n| SSV | string | |\n| ETH2 | string | |\n| KCS | string | |\n| ARPA | string | |\n| ARTFI | string | |\n| BRL | string | |\n| ALEX | string | |\n| STG | string | |\n| SHIB | string | |\n| IOTX | string | |\n| OLE | string | |\n| KDA | string | |\n| CERE | string | |\n| DOCK | string | |\n| STX | string | |\n| OLT | string | |\n| QI | string | |\n| SDAO | string | |\n| BLAST | string | |\n| LINK3S | string | |\n| IOST | string | |\n| SUI | string | |\n| CAKE | string | |\n| BSW | string | |\n| OMG | string | |\n| VOLT | string | |\n| LINK3L | string | |\n| GEEQ | string | |\n| PYUSD | string | |\n| SUN | string | |\n| TOWER | string | |\n| BTC | string | |\n| IOTA | string | |\n| REEF | string | |\n| TRIAS | string | |\n| KEY | string | |\n| ETH3L | string | |\n| BTT | string | |\n| ONE | string | |\n| RENDER | string | |\n| ETH3S | string | |\n| ANKR | string | |\n| ALGO | string | |\n| SYLO | string | |\n| ZCX | string | |\n| SD | string | |\n| ONT | string | |\n| MJT | string | |\n| DYM | string | |\n| DYP | string | |\n| BAKEUP | string | |\n| OOE | string | |\n| ZELIX | string | |\n| DOGE3L | string | |\n| ARTY | string | |\n| QORPO | string | |\n| ICE | string | |\n| NOTAI | string | |\n| DOGE3S | string | |\n| NAKA | string | |\n| GALAX | string | |\n| MKR | string | |\n| DODO | string | |\n| ICP | string | |\n| ZEC | string | |\n| ZEE | string | |\n| ICX | string | |\n| KMNO | string | |\n| TT | string | |\n| DOT3L | string | |\n| XAI | string | |\n| ZEN | string | |\n| DOGE | string | |\n| ALPHA | string | |\n| DUSK | string | |\n| DOT3S | string | |\n| SXP | string | |\n| HBAR | string | |\n| SYNT | string | |\n| ZEX | string | |\n| BONDLY | string | |\n| MLK | string | |\n| KICKS | string | |\n| PEPE | string | |\n| OUSD | string | |\n| LUNCDOWN | string | |\n| DOGS | string | |\n| REV3L | string | |\n| CTSI | string | |\n| C98 | string | |\n| OSMO | string | |\n| NTRN | string | |\n| CFX2S | string | |\n| SYN | string | |\n| VIDT | string | |\n| SYS | string | |\n| GAS | string | |\n| BOME | string | |\n| COMBO | string | |\n| XCH | string | |\n| VR | string | |\n| CFX2L | string | |\n| VSYS | string | |\n| PANDORA | string | |\n| THETA | string | |\n| XCN | string | |\n| NEXG | string | |\n| MELOS | string | |\n| XCV | string | |\n| ORN | string | |\n| WLKN | string | |\n| AAVE | string | |\n| MNT | string | |\n| BONK | string | |\n| PERP | string | |\n| XDC | string | |\n| MNW | string | |\n| XDB | string | |\n| BOND | string | |\n| SUIA | string | |\n| MOG | string | |\n| SUTER | string | |\n| TIME | string | |\n| RACA | string | |\n| BICO | string | |\n| MON | string | |\n| SWEAT | string | |\n| MOXIE | string | |\n| BABYBNB | string | |\n| IGU | string | |\n| HMSTR | string | |\n| XEC | string | |\n| MONI | string | |\n| XR | string | |\n| PEOPLE | string | |\n| PUMLX | string | |\n| ZIL | string | |\n| WLDDOWN | string | |\n| VAI | string | |\n| XEN | string | |\n| MPC | string | |\n| XEM | string | |\n| JASMY3S | string | |\n| OTK | string | |\n| TRAC | string | |\n| DFYN | string | |\n| BIDP | string | |\n| JASMY3L | string | |\n| INJDOWN | string | |\n| KLV | string | |\n| WAXL | string | |\n| TRBDOWN | string | |\n| BCH3L | string | |\n| GMT3S | string | |\n| KMD | string | |\n| BCH3S | string | |\n| ECOX | string | |\n| AAVE3S | string | |\n| GMT3L | string | |\n| EPIK | string | |\n| SUIP | string | |\n| AAVE3L | string | |\n| ZK | string | |\n| ZKF | string | |\n| OMNIA | string | |\n| ZKJ | string | |\n| ZKL | string | |\n| GAFI | string | |\n| CARV | string | |\n| KNC | string | |\n| CATS | string | |\n| PROM | string | |\n| ALEPH | string | |\n| PONKE | string | |\n| OVR | string | |\n| CATI | string | |\n| ORDER | string | |\n| GFT | string | |\n| BIFI | string | |\n| GGC | string | |\n| GGG | string | |\n| DAPPX | string | |\n| SUKU | string | |\n| ULTI | string | |\n| CREDI | string | |\n| ERTHA | string | |\n| FURY | string | |\n| KARRAT | string | |\n| MOBILE | string | |\n| SIDUS | string | |\n| NAVI | string | |\n| TAO | string | |\n| USDJ | string | |\n| MTL | string | |\n| VET | string | |\n| FITFI | string | |\n| USDT | string | |\n| OXT | string | |\n| CANDY | string | |\n| USDP | string | |\n| MTS | string | |\n| TADA | string | |\n| MTV | string | |\n| NAVX | string | |\n| ILV | string | |\n| VINU | string | |\n| GHX | string | |\n| EDU | string | |\n| HYVE | string | |\n| BTC3L | string | |\n| ANYONE | string | |\n| BEAT | string | |\n| KING | string | |\n| CREAM | string | |\n| CAS | string | |\n| IMX | string | |\n| CAT | string | |\n| BTC3S | string | |\n| USDE | string | |\n| USDD | string | |\n| CWAR | string | |\n| USDC | string | |\n| KRL | string | |\n| INJ | string | |\n| GAME | string | |\n| TRIBL | string | |\n| XLM | string | |\n| TRBUP | string | |\n| VRADOWN | string | |\n| SUPER | string | |\n| EIGEN | string | |\n| IOI | string | |\n| KSM | string | |\n| CCD | string | |\n| EGO | string | |\n| EGP | string | |\n| MXC | string | |\n| TEL | string | |\n| MOVR | string | |\n| XMR | string | |\n| MXM | string | |\n| OORT | string | |\n| GLM | string | |\n| RAY | string | |\n| XTAG | string | |\n| GLQ | string | |\n| CWEB | string | |\n| REVU | string | |\n| REVV | string | |\n| ZRO | string | |\n| XNL | string | |\n| XNO | string | |\n| SAROS | string | |\n| KACE | string | |\n| ZRX | string | |\n| WLTH | string | |\n| ATOM3L | string | |\n| GMM | string | |\n| BEER | string | |\n| GMT | string | |\n| HEART | string | |\n| GMX | string | |\n| ABBC | string | |\n| OMNI | string | |\n| ATOM3S | string | |\n| IRL | string | |\n| CFG | string | |\n| WSDM | string | |\n| GNS | string | |\n| VANRY | string | |\n| CFX | string | |\n| GRAIL | string | |\n| BEFI | string | |\n| VELO | string | |\n| XPR | string | |\n| DOVI | string | |\n| ACE | string | |\n| ACH | string | |\n| ISP | string | |\n| XCAD | string | |\n| MINA | string | |\n| TIA | string | |\n| DRIFT | string | |\n| ACQ | string | |\n| ACS | string | |\n| MIND | string | |\n| STORE | string | |\n| REN | string | |\n| ELA | string | |\n| DREAMS | string | |\n| ADA | string | |\n| ELF | string | |\n| REQ | string | |\n| STORJ | string | |\n| LADYS | string | |\n| PAXG | string | |\n| REZ | string | |\n| XRD | string | |\n| CHO | string | |\n| CHR | string | |\n| ADS | string | |\n| CHZ | string | |\n| ADX | string | |\n| XRP | string | |\n| JASMY | string | |\n| KAGI | string | |\n| FIDA | string | |\n| PBR | string | |\n| AEG | string | |\n| H2O | string | |\n| CHMB | string | |\n| SAND3L | string | |\n| PBX | string | |\n| SOLVE | string | |\n| DECHAT | string | |\n| GARI | string | |\n| SHIB2L | string | |\n| SHIB2S | string | |\n| ENA | string | |\n| VEMP | string | |\n| ENJ | string | |\n| AFG | string | |\n| RATS | string | |\n| GRT | string | |\n| FORWARD | string | |\n| TFUEL | string | |\n| ENS | string | |\n| KASDOWN | string | |\n| XTM | string | |\n| DEGEN | string | |\n| TLM | string | |\n| DYDXDOWN | string | |\n| CKB | string | |\n| LUNC | string | |\n| AURORA | string | |\n| LUNA | string | |\n| XTZ | string | |\n| ELON | string | |\n| DMTR | string | |\n| EOS | string | |\n| GST | string | |\n| FORT | string | |\n| FLAME | string | |\n| PATEX | string | |\n| DEEP | string | |\n| ID3L | string | |\n| GTC | string | |\n| ID3S | string | |\n| RIO | string | |\n| CLH | string | |\n| BURGER | string | |\n| VRA | string | |\n| SUNDOG | string | |\n| GTT | string | |\n| INJUP | string | |\n| CPOOL | string | |\n| EPX | string | |\n| CLV | string | |\n| FEAR | string | |\n| MEME | string | |\n| ROOBEE | string | |\n| DEFI | string | |\n| TOKEN | string | |\n| GRAPE | string | |\n| KASUP | string | |\n| XWG | string | |\n| SKEY | string | |\n| SFUND | string | |\n| EQX | string | |\n| ORDIUP | string | |\n| TON | string | |\n| DEGO | string | |\n| IZI | string | |\n| ERG | string | |\n| ERN | string | |\n| VENOM | string | |\n| VOXEL | string | |\n| RLC | string | |\n| PHA | string | |\n| DYDXUP | string | |\n| APE3S | string | |\n| ORBS | string | |\n| OPDOWN | string | |\n| ESE | string | |\n| APE3L | string | |\n| HMND | string | |\n| COQ | string | |\n| AURY | string | |\n| CULT | string | |\n| AKT | string | |\n| GLMR | string | |\n| XYM | string | |\n| ORAI | string | |\n| XYO | string | |\n| ETC | string | |\n| LAI | string | |\n| PIP | string | |\n| ETH | string | |\n| NEO | string | |\n| RMV | string | |\n| KLAY | string | |\n| PIT | string | |\n| TARA | string | |\n| KALT | string | |\n| PIX | string | |\n| ETN | string | |\n| CSIX | string | |\n| TRADE | string | |\n| MAVIA | string | |\n| HIGH | string | |\n| TRB | string | |\n| ORDI | string | |\n| TRVL | string | |\n| AMB | string | |\n| TRU | string | |\n| LOGX | string | |\n| FINC | string | |\n| INFRA | string | |\n| NATIX | string | |\n| NFP | string | |\n| TRY | string | |\n| TRX | string | |\n| LBP | string | |\n| LBR | string | |\n| EUL | string | |\n| NFT | string | |\n| SEIUP | string | |\n| PUFFER | string | |\n| EUR | string | |\n| ORCA | string | |\n| NEAR3L | string | |\n| AMP | string | |\n| XDEFI | string | |\n| HIFI | string | |\n| TRUF | string | |\n| AITECH | string | |\n| AMU | string | |\n| USTC | string | |\n| KNGL | string | |\n| FOXY | string | |\n| NGC | string | |\n| TENET | string | |\n| NEAR3S | string | |\n| MAHA | string | |\n| NGL | string | |\n| TST | string | |\n| HIPPO | string | |\n| AXS3S | string | |\n| CRO | string | |\n| ZPAY | string | |\n| MNDE | string | |\n| CRV | string | |\n| SWASH | string | |\n| AXS3L | string | |\n| VERSE | string | |\n| RPK | string | |\n| RPL | string | |\n| AZERO | string | |\n| SOUL | string | |\n| VXV | string | |\n| LDO | string | |\n| MAGIC | string | |\n| ALICE | string | |\n| SEAM | string | |\n| PLU | string | |\n| AOG | string | |\n| SMOLE | string | |\n| EWT | string | |\n| TSUGT | string | |\n| PMG | string | |\n| OPAI | string | |\n| LOCUS | string | |\n| CTA | string | |\n| NIM | string | |\n| CTC | string | |\n| APE | string | |\n| MERL | string | |\n| JAM | string | |\n| CTI | string | |\n| APP | string | |\n| APT | string | |\n| WLDUP | string | |\n| ZEND | string | |\n| FIRE | string | |\n| DENT | string | |\n| PYTH | string | |\n| LFT | string | |\n| DPET | string | |\n| ORDIDOWN | string | |\n| KPOL | string | |\n| ETHUP | string | |\n| BAND | string | |\n| POL | string | |\n| ASTR | string | |\n| NKN | string | |\n| RSR | string | |\n| DVPN | string | |\n| TWT | string | |\n| ARB | string | |\n| CVC | string | |\n| ARC | string | |\n| XETA | string | |\n| MTRG | string | |\n| LOKA | string | |\n| LPOOL | string | |\n| TURBOS | string | |\n| CVX | string | |\n| ARX | string | |\n| MPLX | string | |\n| SUSHI | string | |\n| NLK | string | |\n| PEPE2 | string | |\n| WBTC | string | |\n| SUI3L | string | |\n| CWS | string | |\n| SUI3S | string | |\n| INSP | string | |\n| MANA | string | |\n| VRTX | string | |\n| CSPR | string | |\n| ATA | string | |\n| OPEN | string | |\n| HAI | string | |\n| NMR | string | |\n| ATH | string | |\n| LIT | string | |\n| TLOS | string | |\n| TNSR | string | |\n| CXT | string | |\n| POLYX | string | |\n| ZERO | string | |\n| ROUTE | string | |\n| LOOM | string | |\n| PRE | string | |\n| VRAUP | string | |\n| HBB | string | |\n| RVN | string | |\n| PRQ | string | |\n| ONDO | string | |\n| PEPEDOWN | string | |\n| WOOP | string | |\n| LUNCUP | string | |\n| KAVA | string | |\n| LKI | string | |\n| AVA | string | |\n| NOM | string | |\n| MAPO | string | |\n| PEPEUP | string | |\n| STRAX | string | |\n| NOT | string | |\n| ZERC | string | |\n| BCUT | string | |\n| MASA | string | |\n| WAN | string | |\n| WAT | string | |\n| WAX | string | |\n| MASK | string | |\n| EOS3L | string | |\n| IDEA | string | |\n| EOS3S | string | |\n| YFI | string | |\n| MOODENG | string | |\n| XCUR | string | |\n| HYDRA | string | |\n| POPCAT | string | |\n| LQTY | string | |\n| PIXEL | string | |\n| LMR | string | |\n| ZETA | string | |\n| YGG | string | |\n| AXS | string | |\n| BCHSV | string | |\n| NRN | string | |\n| FTON | string | |\n| COMP | string | |\n| XPRT | string | |\n| HFT | string | |\n| UXLINK | string | |\n| STAMP | string | |\n| RUNE | string | |\n| ZEUS | string | |\n| LTC3L | string | |\n| DAPP | string | |\n| FORTH | string | |\n| ALPINE | string | |\n| SENSO | string | |\n| LTC3S | string | |\n| DEXE | string | |\n| GOAL | string | |\n| AVAX | string | |\n| LISTA | string | |\n| AMPL | string | |\n| WORK | string | |\n| BRWL | string | |\n| BANANA | string | |\n| PUSH | string | |\n| WEN | string | |\n| NEIRO | string | |\n| BTCUP | string | |\n| SOL3S | string | |\n| BRAWL | string | |\n| LAY3R | string | |\n| LPT | string | |\n| GODS | string | |\n| SAND3S | string | |\n| RDNT | string | |\n| SOL3L | string | |\n| NIBI | string | |\n| NUM | string | |\n| PYR | string | |\n| DAG | string | |\n| DAI | string | |\n| HIP | string | |\n| DAO | string | |\n| AVAIL | string | |\n| DAR | string | |\n| FET | string | |\n| FCON | string | |\n| XAVA | string | |\n| LRC | string | |\n| UNI3S | string | |\n| POKT | string | |\n| DASH | string | |\n| BAKEDOWN | string | |\n| POLC | string | |\n| CIRUS | string | |\n| UNI3L | string | |\n| NWC | string | |\n| POLK | string | |\n| LSD | string | |\n| MARS4 | string | |\n| LSK | string | |\n| BLOCK | string | |\n| ANALOS | string | |\n| SAFE | string | |\n| DCK | string | |\n| LSS | string | |\n| DCR | string | |\n| LIKE | string | |\n| DATA | string | |\n| WIF | string | |\n| BLOK | string | |\n| LTC | string | |\n| METIS | string | |\n| WIN | string | |\n| HLG | string | |\n| LTO | string | |\n| DYDX | string | |\n| ARB3S | string | |\n| MUBI | string | |\n| ARB3L | string | |\n| RBTC1 | string | |\n| POND | string | |\n| LINA | string | |\n| MYRIA | string | |\n| LINK | string | |\n| QTUM | string | |\n| TUNE | string | |\n| UFO | string | |\n| CYBER | string | |\n| WILD | string | |\n| POLS | string | |\n| NYM | string | |\n| FIL | string | |\n| BAL | string | |\n| SCA | string | |\n| STND | string | |\n| WMTX | string | |\n| SCLP | string | |\n| MANEKI | string | |\n| BAT | string | |\n| AKRO | string | |\n| FTM3L | string | |\n| BAX | string | |\n| FTM3S | string | |\n| COTI | string | |\n\n---\n", "body": {} }, "response": [ @@ -4700,16 +4626,19 @@ ], "path": [ "api", - "v3", - "market", - "orderbook", - "level2" + "v1", + "prices" ], "query": [ { - "key": "symbol", - "value": "BTC-USDT", - "description": "symbol" + "key": "base", + "value": "", + "description": "Ticker symbol of a base currency,eg.USD,EUR. Default is USD" + }, + { + "key": "currencies", + "value": "", + "description": "Comma-separated cryptocurrencies to be converted into fiat, e.g.: BTC,ETH, etc. Default to return the fiat price of all currencies." } ] } @@ -4744,12 +4673,12 @@ } ], "cookie": [], - "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"time\": 1729176273859,\n \"sequence\": \"14610502970\",\n \"bids\": [\n [\n \"66976.4\",\n \"0.69109872\"\n ],\n [\n \"66976.3\",\n \"0.14377\"\n ]\n ],\n \"asks\": [\n [\n \"66976.5\",\n \"0.05408199\"\n ],\n [\n \"66976.8\",\n \"0.0005\"\n ]\n ]\n }\n}" + "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"AGLD\": \"1.1174410000000001\",\n \"DFI\": \"0.0168915500000000\",\n \"PYTHUP\": \"0.0397880960000000\",\n \"ISLM\": \"0.0606196750000000\",\n \"NEAR\": \"4.7185395500000000\",\n \"AIOZ\": \"0.4862867350000000\",\n \"AUDIO\": \"0.1219390000000000\",\n \"BBL\": \"0.0067766100000000\",\n \"WLD\": \"2.2893547500000000\",\n \"HNT\": \"5.8990489999999984\",\n \"ETHFI\": \"1.5892050000000000\",\n \"DMAIL\": \"0.2726636000000000\",\n \"OPUP\": \"0.0986506500000000\",\n \"VET3S\": \"0.0003700448850000\",\n \"MANA3S\": \"0.0006056970000000\",\n \"TIDAL\": \"0.0001154422500000\",\n \"HALO\": \"0.0058270850000000\",\n \"OPUL\": \"0.0839480050000000\",\n \"MANA3L\": \"0.0029569407900000\",\n \"DGB\": \"0.0066556705000000\",\n \"AA\": \"0.2406796000000000\",\n \"BCH\": \"366.2167999999996484\",\n \"GMEE\": \"0.0113333305000000\",\n \"JST\": \"0.0302348750000000\",\n \"PBUX\": \"0.0208795550000000\",\n \"AR\": \"18.5457224999999909\",\n \"SEI\": \"0.4332832500000000\",\n \"PSTAKE\": \"0.0493153300000000\",\n \"LMWR\": \"0.1618190500000000\",\n \"UNFIDOWN\": \"0.0062058955000000\",\n \"BB\": \"0.3245376500000000\",\n \"JTO\": \"2.1239375000000002\",\n \"WEMIX\": \"0.7916040000000000\",\n \"G\": \"0.0324037900000000\",\n \"MARSH\": \"0.0617591050000000\",\n \"BN\": \"0.0036961510000000\",\n \"FLIP\": \"1.0976509000000000\",\n \"FLR\": \"0.0144827550000000\",\n \"BIGTIME\": \"0.1238780300000000\",\n \"FLY\": \"0.0005157420000000\",\n \"T\": \"0.0233483200000000\",\n \"W\": \"0.2865566500000000\",\n \"BDX\": \"0.0774012800000000\",\n \"BABYDOGE\": \"0.0000000029375305\",\n \"SFP\": \"0.7256370000000000\",\n \"DIA\": \"0.9179408000000000\",\n \"ISME\": \"0.0022388800000000\",\n \"LYM\": \"0.0010155919500000\",\n \"VET3L\": \"0.0000289755050000\",\n \"JUP\": \"0.8230882500000000\",\n \"LYX\": \"1.4501745500000001\",\n \"AIEPK\": \"0.0050094940000000\",\n \"SILLY\": \"0.0159420250000000\",\n \"SCPT\": \"0.0122038950000000\",\n \"WOO\": \"0.1796601250000000\",\n \"BLUR\": \"0.2462768000000000\",\n \"STRK\": \"0.3963117450000000\",\n \"BFC\": \"0.0383608100000000\",\n \"DC\": \"0.0003097450500000\",\n \"KARATE\": \"0.0007296350000000\",\n \"SUSHI3L\": \"0.5115441000000000\",\n \"NETVR\": \"0.0976111700000000\",\n \"WAVES\": \"1.0806594000000000\",\n \"LITH\": \"0.0001520239500000\",\n \"HAPI\": \"8.6533711499999987\",\n \"SUSHI3S\": \"1.2752620500000000\",\n \"CEEK\": \"0.0294852500000000\",\n \"FLOKI\": \"0.0001414292500000\",\n \"SHR\": \"0.0012463765000000\",\n \"SAND\": \"0.2566616050000000\",\n \"TURT\": \"0.0020889550000000\",\n \"UMA\": \"2.5207390000000000\",\n \"BEPRO\": \"0.0003955021500000\",\n \"SCRT\": \"0.1995002000000000\",\n \"TUSD\": \"0.9945025000000000\",\n \"COOKIE\": \"0.0220089900000000\",\n \"LRDS\": \"0.6218889000000000\",\n \"SIN\": \"0.0033633175000000\",\n \"OAS\": \"0.0331933950000000\",\n \"ROOT\": \"0.0183108400000000\",\n \"ADA3L\": \"0.0046396790000000\",\n \"TIAUP\": \"0.1228385500000000\",\n \"HTR\": \"0.0353023400000000\",\n \"UNB\": \"0.0003837080500000\",\n \"UNA\": \"0.0164917500000000\",\n \"HARD\": \"0.1087056200000000\",\n \"G3\": \"0.0502648550000000\",\n \"ADA3S\": \"0.0006191202850000\",\n \"MYRO\": \"0.1071863800000000\",\n \"HTX\": \"0.0000013693150000\",\n \"FT\": \"0.3585206500000000\",\n \"BTCDOWN\": \"0.1065467000000000\",\n \"UNI\": \"7.3571195999999993\",\n \"FX\": \"0.1379310000000000\",\n \"OBI\": \"0.0079030465000000\",\n \"UNO\": \"0.0137131400000000\",\n \"WRX\": \"0.1221389000000000\",\n \"TIADOWN\": \"0.0000914642450000\",\n \"ETHDOWN\": \"0.1306346500000000\",\n \"WELL\": \"0.0471244260000000\",\n \"SWFTC\": \"0.0028966509500000\",\n \"SKL\": \"0.0362418700000000\",\n \"UOS\": \"0.0867765900000000\",\n \"AIPAD\": \"0.0478660550000000\",\n \"BRETT\": \"0.1037481000000000\",\n \"SKY\": \"0.0520139800000000\",\n \"FRM\": \"0.0153123400000000\",\n \"VISION\": \"0.0014451770500000\",\n \"LENDS\": \"0.0047276350000000\",\n \"SLF\": \"0.3318340000000000\",\n \"BULL\": \"0.0023988000000000\",\n \"FLOW\": \"0.5372312500000000\",\n \"ODDZ\": \"0.0063368300000000\",\n \"SLN\": \"0.2804597000000000\",\n \"UPO\": \"0.0440779500000000\",\n \"SLP\": \"0.0023997995000000\",\n \"ID\": \"0.3718140000000000\",\n \"SLIM\": \"0.0906446550000000\",\n \"SPOT\": \"0.0021289350000000\",\n \"DOP\": \"0.0023028480000000\",\n \"ISSP\": \"0.0000874562500000\",\n \"UQC\": \"3.2339822000000003\",\n \"IO\": \"1.8185902499999999\",\n \"DOT\": \"4.2022978000000005\",\n \"1INCH\": \"0.2645676500000000\",\n \"SMH\": \"0.3448275000000000\",\n \"MAK\": \"0.0396701550000000\",\n \"TOKO\": \"0.0005923037000000\",\n \"TURBO\": \"0.0108085930000000\",\n \"UNFI\": \"2.8555714999999996\",\n \"MAN\": \"0.0210764565000000\",\n \"EVER\": \"0.0332733550000000\",\n \"FTM\": \"0.7259068650000000\",\n \"SHRAP\": \"0.0476361700000000\",\n \"MAV\": \"0.1738130500000000\",\n \"MAX\": \"0.2864966800000000\",\n \"DPR\": \"0.0018240875000000\",\n \"FTT\": \"2.0559715000000002\",\n \"ARKM\": \"1.7444273499999999\",\n \"ATOM\": \"4.2954512000000002\",\n \"PENDLE\": \"4.1554212500000007\",\n \"QUICK\": \"0.0365317250000000\",\n \"BLZ\": \"0.1217191100000000\",\n \"BOBA\": \"0.2014092450000000\",\n \"MBL\": \"0.0027856065000000\",\n \"OFN\": \"0.1252373500000000\",\n \"UNIO\": \"0.0025487250000000\",\n \"SNS\": \"0.0200899500000000\",\n \"SNX\": \"1.4282854999999999\",\n \"NXRA\": \"0.0272763550000000\",\n \"TAIKO\": \"1.4392800000000001\",\n \"AVAX3L\": \"0.1410875109550000\",\n \"L3\": \"0.0608395650000000\",\n \"API3\": \"1.3728132500000001\",\n \"XRP3S\": \"0.0028095945000000\",\n \"QKC\": \"0.0085157400000000\",\n \"AVAX3S\": \"0.5148424500000000\",\n \"ROSE\": \"0.0693453100000000\",\n \"SATS\": \"0.0000002701648500\",\n \"BMX\": \"0.3100449000000000\",\n \"PORTAL\": \"0.2811593500000000\",\n \"TOMI\": \"0.0309045400000000\",\n \"XRP3L\": \"2.1586201500000002\",\n \"SOL\": \"151.7250995000003583\",\n \"SON\": \"0.0002421788500000\",\n \"BNC\": \"0.1882058500000000\",\n \"SOCIAL\": \"0.0026486750000000\",\n \"CGPT\": \"0.1305147100000000\",\n \"CELR\": \"0.0127736100000000\",\n \"BNB\": \"591.0973035000118935\",\n \"OGN\": \"0.0852573500000000\",\n \"CELO\": \"0.7711142500000000\",\n \"AUCTION\": \"13.1634150000000014\",\n \"MANTA\": \"0.7564216000000000\",\n \"LAYER\": \"0.0372713550000000\",\n \"AERO\": \"1.3783104999999999\",\n \"CETUS\": \"0.1808295400000000\",\n \"LL\": \"0.0201199350000000\",\n \"SPA\": \"0.0067426270000000\",\n \"PYTHDOWN\": \"0.0011834080000000\",\n \"NEIROCTO\": \"0.0019964013000000\",\n \"UTK\": \"0.0365217300000000\",\n \"GMRX\": \"0.0007386305000000\",\n \"BOB\": \"0.0000380619595000\",\n \"HOTCROSS\": \"0.0056491740000000\",\n \"AERGO\": \"0.1007595950000000\",\n \"MOCA\": \"0.0783608000000000\",\n \"SQD\": \"0.0380809500000000\",\n \"MV\": \"0.0081359300000000\",\n \"BNB3L\": \"0.2761618500000000\",\n \"BNB3S\": \"0.0008545725000000\",\n \"GALAX3L\": \"0.0057571999600000\",\n \"KAI\": \"0.0020080954500000\",\n \"SQR\": \"0.0470764500000000\",\n \"GALAX3S\": \"0.1933033000000000\",\n \"EGLD\": \"25.5272299999999713\",\n \"ZBCN\": \"0.0010404795000000\",\n \"KAS\": \"0.1216691350000000\",\n \"MEW\": \"0.0086176890000000\",\n \"PUNDIX\": \"0.4130933500000000\",\n \"LOOKS\": \"0.0392803500000000\",\n \"FXS\": \"1.9060465000000000\",\n \"BOSON\": \"0.2732633000000000\",\n \"BRISE\": \"0.0000000860569500\",\n \"AEVO\": \"0.3388305000000000\",\n \"FLUX\": \"0.5276360500000000\",\n \"PRCL\": \"0.1969015000000000\",\n \"UNFIUP\": \"0.0011654170000000\",\n \"SEIDOWN\": \"0.0442778500000000\",\n \"DOAI\": \"0.0052363805000000\",\n \"QNT\": \"65.4312679999998206\",\n \"REDO\": \"0.2837580500000000\",\n \"STRIKE\": \"6.8225869999999997\",\n \"ETHW\": \"3.2418782499999998\",\n \"OM\": \"1.5396797750000000\",\n \"OP\": \"1.6911539999999999\",\n \"WHALE\": \"0.8134930500000000\",\n \"1CAT\": \"0.0018460765000000\",\n \"NEON\": \"0.4446775500000000\",\n \"GTAI\": \"0.7786105000000000\",\n \"SSV\": \"21.2393749999999841\",\n \"ETH2\": \"2601.6678843156403923\",\n \"KCS\": \"8.7646155000000020\",\n \"ARPA\": \"0.0393882960000000\",\n \"ARTFI\": \"0.0141029450000000\",\n \"BRL\": \"0.1742807323452485\",\n \"ALEX\": \"0.0924537500000000\",\n \"STG\": \"0.2943527500000000\",\n \"SHIB\": \"0.0000178060925000\",\n \"IOTX\": \"0.0394202800000000\",\n \"OLE\": \"0.0171414250000000\",\n \"KDA\": \"0.5653172000000000\",\n \"CERE\": \"0.0022548720000000\",\n \"DOCK\": \"0.0018990500000000\",\n \"STX\": \"1.8157916500000000\",\n \"OLT\": \"0.0007596200000000\",\n \"QI\": \"0.0131754090000000\",\n \"SDAO\": \"0.2748625000000000\",\n \"BLAST\": \"0.0087636160000000\",\n \"LINK3S\": \"0.0000702948350000\",\n \"IOST\": \"0.0049745115000000\",\n \"SUI\": \"2.0589700000000000\",\n \"CAKE\": \"1.7941024999999999\",\n \"BSW\": \"0.0586706500000000\",\n \"OMG\": \"0.2597700500000000\",\n \"VOLT\": \"0.0000002716641000\",\n \"LINK3L\": \"1.3408292499999999\",\n \"GEEQ\": \"0.0385607100000000\",\n \"PYUSD\": \"0.9988003500000000\",\n \"SUN\": \"0.0186106900000000\",\n \"TOWER\": \"0.0014812590000000\",\n \"BTC\": \"67133.4165000832051564\",\n \"IOTA\": \"0.1189405000000000\",\n \"REEF\": \"0.0019960015000000\",\n \"TRIAS\": \"3.3683149999999998\",\n \"KEY\": \"0.0037594713240047\",\n \"ETH3L\": \"0.0003305946200000\",\n \"BTT\": \"0.0000009117439000\",\n \"ONE\": \"0.0132003965000000\",\n \"RENDER\": \"5.2263854999999995\",\n \"ETH3S\": \"0.5517240000000000\",\n \"ANKR\": \"0.0264867500000000\",\n \"ALGO\": \"0.1188405500000000\",\n \"SYLO\": \"0.0007600198000000\",\n \"ZCX\": \"0.0784707450000000\",\n \"SD\": \"0.3851073500000000\",\n \"ONT\": \"0.1877960550000000\",\n \"MJT\": \"0.0132433750000000\",\n \"DYM\": \"1.6659666000000001\",\n \"DYP\": \"0.0205397250000000\",\n \"BAKEUP\": \"0.0389894955000000\",\n \"OOE\": \"0.0079360300000000\",\n \"ZELIX\": \"0.0000649675000000\",\n \"DOGE3L\": \"0.3837080500000000\",\n \"ARTY\": \"0.3980009000000000\",\n \"QORPO\": \"0.1204297550000000\",\n \"ICE\": \"0.0051504235000000\",\n \"NOTAI\": \"0.0000892753400000\",\n \"DOGE3S\": \"0.2291853500000000\",\n \"NAKA\": \"1.0695649500000000\",\n \"GALAX\": \"0.0212893500000000\",\n \"MKR\": \"1245.8767500000163833\",\n \"DODO\": \"0.1152423500000000\",\n \"ICP\": \"7.6731615000000027\",\n \"ZEC\": \"35.9400209999999543\",\n \"ZEE\": \"0.0065767100000000\",\n \"ICX\": \"0.1383308000000000\",\n \"KMNO\": \"0.0921499020000000\",\n \"TT\": \"0.0033883050000000\",\n \"DOT3L\": \"0.1454272500000000\",\n \"XAI\": \"0.2038980000000000\",\n \"ZEN\": \"8.0149905000000007\",\n \"DOGE\": \"0.1213093150000000\",\n \"ALPHA\": \"0.0567416150000000\",\n \"DUSK\": \"0.1964517250000000\",\n \"DOT3S\": \"0.0053613180000000\",\n \"SXP\": \"0.2538730000000000\",\n \"HBAR\": \"0.0510044850000000\",\n \"SYNT\": \"0.0467166300000000\",\n \"ZEX\": \"0.0571714000000000\",\n \"BONDLY\": \"0.0022208890000000\",\n \"MLK\": \"0.2080859050000000\",\n \"KICKS\": \"0.0001301249050000\",\n \"PEPE\": \"0.0000100249850000\",\n \"OUSD\": \"0.9982006500000000\",\n \"LUNCDOWN\": \"0.0000733333150000\",\n \"DOGS\": \"0.0007086455000000\",\n \"REV3L\": \"0.0094672640000000\",\n \"CTSI\": \"0.1257371000000000\",\n \"C98\": \"0.1219390000000000\",\n \"OSMO\": \"0.5370313500000000\",\n \"NTRN\": \"0.3869064500000000\",\n \"CFX2S\": \"0.0084757600000000\",\n \"SYN\": \"0.5636180500000000\",\n \"VIDT\": \"0.0308745550000000\",\n \"SYS\": \"0.0997501000000000\",\n \"GAS\": \"4.3029474500000008\",\n \"BOME\": \"0.0087336310000000\",\n \"COMBO\": \"0.4068964500000000\",\n \"XCH\": \"14.9825050000000010\",\n \"VR\": \"0.0063538215000000\",\n \"CFX2L\": \"0.0499660045000000\",\n \"VSYS\": \"0.0005201398000000\",\n \"PANDORA\": \"1629.2949450001102772\",\n \"THETA\": \"1.2461766000000000\",\n \"XCN\": \"0.0012699647000000\",\n \"NEXG\": \"0.0039180400000000\",\n \"MELOS\": \"0.0021244372500000\",\n \"XCV\": \"0.0013253370000000\",\n \"ORN\": \"0.8797599000000000\",\n \"WLKN\": \"0.0010624685000000\",\n \"AAVE\": \"154.2708259999996162\",\n \"MNT\": \"0.6168914000000000\",\n \"BONK\": \"0.0000227296295000\",\n \"PERP\": \"0.6037979500000000\",\n \"XDC\": \"0.0276361750000000\",\n \"MNW\": \"0.3681158500000000\",\n \"XDB\": \"0.0002578710000000\",\n \"BOND\": \"1.5662165000000000\",\n \"SUIA\": \"0.0809595000000000\",\n \"MOG\": \"0.0000019330330000\",\n \"SUTER\": \"0.0001840079500000\",\n \"TIME\": \"16.2648634999999969\",\n \"RACA\": \"0.0001949025000000\",\n \"BICO\": \"0.2021988500000000\",\n \"MON\": \"0.1066466500000000\",\n \"SWEAT\": \"0.0063718125000000\",\n \"MOXIE\": \"0.0022088950000000\",\n \"BABYBNB\": \"0.0289755050000000\",\n \"IGU\": \"0.0050674650000000\",\n \"HMSTR\": \"0.0037990995000000\",\n \"XEC\": \"0.0000354722550000\",\n \"MONI\": \"0.0058470750000000\",\n \"XR\": \"0.2374812000000000\",\n \"PEOPLE\": \"0.0796601500000000\",\n \"PUMLX\": \"0.0054572700000000\",\n \"ZIL\": \"0.0145927000000000\",\n \"WLDDOWN\": \"0.2089954500000000\",\n \"VAI\": \"0.0799999800000000\",\n \"XEN\": \"0.0000000839580000\",\n \"MPC\": \"0.1001499000000000\",\n \"XEM\": \"0.0176951480000000\",\n \"JASMY3S\": \"0.0019670160000000\",\n \"OTK\": \"0.0290464695000000\",\n \"TRAC\": \"0.4521738000000000\",\n \"DFYN\": \"0.0070664650000000\",\n \"BIDP\": \"0.0001939030000000\",\n \"JASMY3L\": \"0.0001653772700000\",\n \"INJDOWN\": \"0.0000194902500000\",\n \"KLV\": \"0.0019310340000000\",\n \"WAXL\": \"0.7858069000000000\",\n \"TRBDOWN\": \"0.0023138425000000\",\n \"BCH3L\": \"4.6390663064999996\",\n \"GMT3S\": \"0.0000457771000000\",\n \"KMD\": \"0.2493752500000000\",\n \"BCH3S\": \"0.9634180500000000\",\n \"ECOX\": \"0.0987506000000000\",\n \"AAVE3S\": \"0.0560719500000000\",\n \"GMT3L\": \"0.0053983694650000\",\n \"EPIK\": \"0.0045857060000000\",\n \"SUIP\": \"0.1067565950000000\",\n \"AAVE3L\": \"0.3638687346200000\",\n \"ZK\": \"0.1262368500000000\",\n \"ZKF\": \"0.0008595700000000\",\n \"OMNIA\": \"0.7624186000000000\",\n \"ZKJ\": \"1.1124435000000000\",\n \"ZKL\": \"0.1255372000000000\",\n \"GAFI\": \"3.0634675000000001\",\n \"CARV\": \"0.8703646000000000\",\n \"KNC\": \"0.4433782000000000\",\n \"CATS\": \"0.0000599700000000\",\n \"PROM\": \"5.2833570000000006\",\n \"ALEPH\": \"0.1756121500000000\",\n \"PONKE\": \"0.3958020000000000\",\n \"OVR\": \"0.1553223000000000\",\n \"CATI\": \"0.4105146400000000\",\n \"ORDER\": \"0.1183008200000000\",\n \"GFT\": \"0.0166616650000000\",\n \"BIFI\": \"0.0020489750000000\",\n \"GGC\": \"6.9965029985000000\",\n \"GGG\": \"0.0403798000000000\",\n \"DAPPX\": \"0.0043788095000000\",\n \"SUKU\": \"0.0618790450000000\",\n \"ULTI\": \"0.0168015950000000\",\n \"CREDI\": \"0.0192903500000000\",\n \"ERTHA\": \"0.0010014990000000\",\n \"FURY\": \"0.1405297000000000\",\n \"KARRAT\": \"0.5577210000000000\",\n \"MOBILE\": \"0.0009005495000000\",\n \"SIDUS\": \"0.0037671155000000\",\n \"NAVI\": \"0.1254672350000000\",\n \"TAO\": \"583.4081500000051807\",\n \"USDJ\": \"1.1386304000000001\",\n \"MTL\": \"0.9563216000000000\",\n \"VET\": \"0.0225387250000000\",\n \"FITFI\": \"0.0036421780000000\",\n \"USDT\": \"0.9995000000000000\",\n \"OXT\": \"0.0695652000000000\",\n \"CANDY\": \"0.0005597200000000\",\n \"USDP\": \"0.9932031500000000\",\n \"MTS\": \"0.0027516235000000\",\n \"TADA\": \"0.0283858000000000\",\n \"MTV\": \"0.0006559718500000\",\n \"NAVX\": \"0.1342228550000000\",\n \"ILV\": \"35.6771524999999671\",\n \"VINU\": \"0.0000000109045450\",\n \"GHX\": \"0.0903548000000000\",\n \"EDU\": \"0.5167415000000000\",\n \"HYVE\": \"0.0137331300000000\",\n \"BTC3L\": \"0.0058620675000000\",\n \"ANYONE\": \"0.9015490000000000\",\n \"BEAT\": \"0.0012593700000000\",\n \"KING\": \"0.0004821588000000\",\n \"CREAM\": \"15.6541689999999973\",\n \"CAS\": \"0.0038590695000000\",\n \"IMX\": \"1.4944524000000000\",\n \"CAT\": \"0.0000256981445000\",\n \"BTC3S\": \"0.0014142925000000\",\n \"USDE\": \"0.9985005000000000\",\n \"USDD\": \"1.0000997000000000\",\n \"CWAR\": \"0.0037981000000000\",\n \"USDC\": \"0.9997998500000000\",\n \"KRL\": \"0.3543127550000000\",\n \"INJ\": \"21.7691100000000194\",\n \"GAME\": \"0.0139630150000000\",\n \"TRIBL\": \"1.0994500000000000\",\n \"XLM\": \"0.0948525500000000\",\n \"TRBUP\": \"0.0012293850000000\",\n \"VRADOWN\": \"0.0013433280000000\",\n \"SUPER\": \"1.2853570000000000\",\n \"EIGEN\": \"3.1536223999999999\",\n \"IOI\": \"0.0146926500000000\",\n \"KSM\": \"17.5212350000000129\",\n \"CCD\": \"0.0034832575000000\",\n \"EGO\": \"0.0093553200000000\",\n \"EGP\": \"2.7946019999999998\",\n \"MXC\": \"0.0066866550000000\",\n \"TEL\": \"0.0014432780000000\",\n \"MOVR\": \"9.1340307000000027\",\n \"XMR\": \"155.5421899999990755\",\n \"MXM\": \"0.0092853550000000\",\n \"OORT\": \"0.1099949750000000\",\n \"GLM\": \"0.3231383500000000\",\n \"RAY\": \"2.0228880499999998\",\n \"XTAG\": \"0.0218190850000000\",\n \"GLQ\": \"0.0854572500000000\",\n \"CWEB\": \"0.0038480750000000\",\n \"REVU\": \"0.0105047450000000\",\n \"REVV\": \"0.0039760110000000\",\n \"ZRO\": \"3.7952014499999994\",\n \"XNL\": \"0.0093853050000000\",\n \"XNO\": \"0.8496749500000000\",\n \"SAROS\": \"0.0019290350000000\",\n \"KACE\": \"2.1165411999999998\",\n \"ZRX\": \"0.3186406000000000\",\n \"WLTH\": \"0.0374312750000000\",\n \"ATOM3L\": \"0.0321719060000000\",\n \"GMM\": \"0.0001497251000000\",\n \"BEER\": \"0.0000138670630000\",\n \"GMT\": \"0.1275362000000000\",\n \"HEART\": \"0.0159920000000000\",\n \"GMX\": \"22.7186349999999882\",\n \"ABBC\": \"0.0061769100000000\",\n \"OMNI\": \"8.9235359999999970\",\n \"ATOM3S\": \"0.0007945225400000\",\n \"IRL\": \"0.0099650150000000\",\n \"CFG\": \"0.3248375000000000\",\n \"WSDM\": \"0.0139830050000000\",\n \"GNS\": \"1.8390800000000001\",\n \"VANRY\": \"0.0809295150000000\",\n \"CFX\": \"0.1595202000000000\",\n \"GRAIL\": \"817.1212349999937891\",\n \"BEFI\": \"0.0175712100000000\",\n \"VELO\": \"0.0132043945000000\",\n \"XPR\": \"0.0008077959000000\",\n \"DOVI\": \"0.0584707500000000\",\n \"ACE\": \"0.0021349320000000\",\n \"ACH\": \"0.0190534685000000\",\n \"ISP\": \"0.0012161916000000\",\n \"XCAD\": \"0.2834582000000000\",\n \"MINA\": \"0.5630183500000000\",\n \"TIA\": \"5.9318325999999999\",\n \"DRIFT\": \"0.4350823500000000\",\n \"ACQ\": \"0.0056981495000000\",\n \"ACS\": \"0.0014917537500000\",\n \"MIND\": \"0.0018920535000000\",\n \"STORE\": \"0.0062358805000000\",\n \"REN\": \"0.0351224300000000\",\n \"ELA\": \"1.7282354500000000\",\n \"DREAMS\": \"0.0002498750000000\",\n \"ADA\": \"0.3463267500000000\",\n \"ELF\": \"0.3777110500000000\",\n \"REQ\": \"0.0959919800000000\",\n \"STORJ\": \"0.5662167500000000\",\n \"LADYS\": \"0.0000000837581000\",\n \"PAXG\": \"2697.9303600003123340\",\n \"REZ\": \"0.0409795000000000\",\n \"XRD\": \"0.0157821050000000\",\n \"CHO\": \"0.0205097400000000\",\n \"CHR\": \"0.1769115000000000\",\n \"ADS\": \"0.1889055000000000\",\n \"CHZ\": \"0.0738030800000000\",\n \"ADX\": \"0.1575212000000000\",\n \"XRP\": \"0.5525036100000000\",\n \"JASMY\": \"0.0188615645000000\",\n \"KAGI\": \"0.1834582250000000\",\n \"FIDA\": \"0.2282858000000000\",\n \"PBR\": \"0.0291953950000000\",\n \"AEG\": \"0.0093453250000000\",\n \"H2O\": \"0.1610194500000000\",\n \"CHMB\": \"0.0001715641750000\",\n \"SAND3L\": \"0.0015447972150000\",\n \"PBX\": \"0.0006879558500000\",\n \"SOLVE\": \"0.0084557700000000\",\n \"DECHAT\": \"0.1512243500000000\",\n \"GARI\": \"0.0076861550000000\",\n \"SHIB2L\": \"1.1996998499999999\",\n \"SHIB2S\": \"0.0240879500000000\",\n \"ENA\": \"0.3942028000000000\",\n \"VEMP\": \"0.0029335325000000\",\n \"ENJ\": \"0.1467266000000000\",\n \"AFG\": \"0.0072163900000000\",\n \"RATS\": \"0.0001211593900000\",\n \"GRT\": \"0.1646076550000000\",\n \"FORWARD\": \"0.0012873560000000\",\n \"TFUEL\": \"0.0598800450000000\",\n \"ENS\": \"17.0634640000000052\",\n \"KASDOWN\": \"0.0258770550000000\",\n \"XTM\": \"0.0251074400000000\",\n \"DEGEN\": \"0.0084857550000000\",\n \"TLM\": \"0.0100449750000000\",\n \"DYDXDOWN\": \"0.1042598440000000\",\n \"CKB\": \"0.0146026950000000\",\n \"LUNC\": \"0.0000889255150000\",\n \"AURORA\": \"0.1204397500000000\",\n \"LUNA\": \"0.3624187000000000\",\n \"XTZ\": \"0.6776610000000000\",\n \"ELON\": \"0.0000001410294500\",\n \"DMTR\": \"0.0891554000000000\",\n \"EOS\": \"0.4759619000000000\",\n \"GST\": \"0.0118940500000000\",\n \"FORT\": \"0.1155422000000000\",\n \"FLAME\": \"0.0247076400000000\",\n \"PATEX\": \"0.9605195000000000\",\n \"DEEP\": \"0.0328885475000000\",\n \"ID3L\": \"0.0016201895000000\",\n \"GTC\": \"0.6625685500000000\",\n \"ID3S\": \"0.0071674145000000\",\n \"RIO\": \"0.7616190000000000\",\n \"CLH\": \"0.0008555720000000\",\n \"BURGER\": \"0.4016990500000000\",\n \"VRA\": \"0.0029765110000000\",\n \"SUNDOG\": \"0.2173912500000000\",\n \"GTT\": \"0.0002038980000000\",\n \"INJUP\": \"0.2327835500000000\",\n \"CPOOL\": \"0.1557720750000000\",\n \"EPX\": \"0.0000740629500000\",\n \"CLV\": \"0.0329835000000000\",\n \"FEAR\": \"0.0560519600000000\",\n \"MEME\": \"0.0124847545000000\",\n \"ROOBEE\": \"0.0004520738500000\",\n \"DEFI\": \"0.0192903500000000\",\n \"TOKEN\": \"0.0477361200000000\",\n \"GRAPE\": \"0.0020599695000000\",\n \"KASUP\": \"0.3996001000000000\",\n \"XWG\": \"0.0003843077500000\",\n \"SKEY\": \"0.0621289200000000\",\n \"SFUND\": \"1.3243375000000000\",\n \"EQX\": \"0.0032823580000000\",\n \"ORDIUP\": \"0.0548315705000000\",\n \"TON\": \"5.1857058499999995\",\n \"DEGO\": \"2.2667660500000001\",\n \"IZI\": \"0.0088455750000000\",\n \"ERG\": \"0.6605695500000000\",\n \"ERN\": \"1.9255367500000001\",\n \"VENOM\": \"0.0817591000000000\",\n \"VOXEL\": \"0.1497251000000000\",\n \"RLC\": \"1.4649671500000000\",\n \"PHA\": \"0.1093453000000000\",\n \"DYDXUP\": \"0.0112573685000000\",\n \"APE3S\": \"0.0008475760000000\",\n \"ORBS\": \"0.0288955450000000\",\n \"OPDOWN\": \"0.6758619000000000\",\n \"ESE\": \"0.0139130400000000\",\n \"APE3L\": \"0.1339330000000000\",\n \"HMND\": \"0.0982208650000000\",\n \"COQ\": \"0.0000014432780000\",\n \"AURY\": \"0.3340329000000000\",\n \"CULT\": \"0.0000028025980000\",\n \"AKT\": \"2.4642672500000001\",\n \"GLMR\": \"0.1606196500000000\",\n \"XYM\": \"0.0142528700000000\",\n \"ORAI\": \"6.1769100000000012\",\n \"XYO\": \"0.0058680645000000\",\n \"ETC\": \"18.8458723500000169\",\n \"LAI\": \"0.0142828550000000\",\n \"PIP\": \"0.0178310800000000\",\n \"ETH\": \"2607.6655149998362673\",\n \"NEO\": \"10.3575186499999991\",\n \"RMV\": \"0.0081659150000000\",\n \"KLAY\": \"0.1251374000000000\",\n \"PIT\": \"0.0000000003268365\",\n \"TARA\": \"0.0043978000000000\",\n \"KALT\": \"0.1128735350000000\",\n \"PIX\": \"0.0001023687900000\",\n \"ETN\": \"0.0021579205000000\",\n \"CSIX\": \"0.0141729100000000\",\n \"TRADE\": \"0.4708644500000000\",\n \"MAVIA\": \"1.3592200500000001\",\n \"HIGH\": \"1.3043474999999999\",\n \"TRB\": \"62.5387150000000006\",\n \"ORDI\": \"35.7421200000000126\",\n \"TRVL\": \"0.0373643085000000\",\n \"AMB\": \"0.0059670150000000\",\n \"TRU\": \"0.0762018800000000\",\n \"LOGX\": \"0.0271963950000000\",\n \"FINC\": \"0.0362018900000000\",\n \"INFRA\": \"0.1978010500000000\",\n \"NATIX\": \"0.0008729633000000\",\n \"NFP\": \"0.2152923000000000\",\n \"TRY\": \"0.0292166033323590\",\n \"TRX\": \"0.1597201000000000\",\n \"LBP\": \"0.0001243378000000\",\n \"LBR\": \"0.0595702000000000\",\n \"EUL\": \"2.9735125000000000\",\n \"NFT\": \"0.0000004077960000\",\n \"SEIUP\": \"0.0478110825000000\",\n \"PUFFER\": \"0.3676161000000000\",\n \"EUR\": \"1.0811249323958897\",\n \"ORCA\": \"2.0664662499999999\",\n \"NEAR3L\": \"0.0117010765350000\",\n \"AMP\": \"0.0038330825000000\",\n \"XDEFI\": \"0.0472563600000000\",\n \"HIFI\": \"0.4947525000000000\",\n \"TRUF\": \"0.0459570100000000\",\n \"AITECH\": \"0.1045477000000000\",\n \"AMU\": \"0.0043978000000000\",\n \"USTC\": \"0.0214692600000000\",\n \"KNGL\": \"0.0499750000000000\",\n \"FOXY\": \"0.0102686631000000\",\n \"NGC\": \"0.0147935995000000\",\n \"TENET\": \"0.0043278350000000\",\n \"NEAR3S\": \"0.0072553705000000\",\n \"MAHA\": \"1.1904045000000000\",\n \"NGL\": \"0.0701748950000000\",\n \"TST\": \"0.0080359800000000\",\n \"HIPPO\": \"0.0104447750000000\",\n \"AXS3S\": \"0.0308705570000000\",\n \"CRO\": \"0.0781409100000000\",\n \"ZPAY\": \"0.0050574700000000\",\n \"MNDE\": \"0.1026786350000000\",\n \"CRV\": \"0.2534732000000000\",\n \"SWASH\": \"0.0056271850000000\",\n \"AXS3L\": \"0.0106388779000000\",\n \"VERSE\": \"0.0001803098000000\",\n \"RPK\": \"0.0049975000000000\",\n \"RPL\": \"10.9745099999999958\",\n \"AZERO\": \"0.3789104500000000\",\n \"SOUL\": \"0.0534332700000000\",\n \"VXV\": \"0.2619689500000000\",\n \"LDO\": \"1.0885554500000000\",\n \"MAGIC\": \"0.3390304000000000\",\n \"ALICE\": \"1.0324835000000000\",\n \"SEAM\": \"1.1933030499999999\",\n \"PLU\": \"1.9300345000000001\",\n \"AOG\": \"0.0031224380000000\",\n \"SMOLE\": \"0.0000387806000000\",\n \"EWT\": \"1.1094450000000000\",\n \"TSUGT\": \"0.0029185400000000\",\n \"PMG\": \"0.0800599500000000\",\n \"OPAI\": \"0.0006826585000000\",\n \"LOCUS\": \"0.0216591650000000\",\n \"CTA\": \"0.0825087250000000\",\n \"NIM\": \"0.0013673160000000\",\n \"CTC\": \"0.4033982000000000\",\n \"APE\": \"0.7035480500000000\",\n \"MERL\": \"0.2720639000000000\",\n \"JAM\": \"0.0004770613500000\",\n \"CTI\": \"0.0130314810000000\",\n \"APP\": \"0.0021989000000000\",\n \"APT\": \"9.9947001500000000\",\n \"WLDUP\": \"0.0093043455000000\",\n \"ZEND\": \"0.1280759300000000\",\n \"FIRE\": \"0.9113441000000000\",\n \"DENT\": \"0.0008630682500000\",\n \"PYTH\": \"0.3390603850000000\",\n \"LFT\": \"0.0155322300000000\",\n \"DPET\": \"0.0319040400000000\",\n \"ORDIDOWN\": \"0.3788105000000000\",\n \"KPOL\": \"0.0029175405000000\",\n \"ETHUP\": \"8.4971493000000032\",\n \"BAND\": \"1.0939527500000001\",\n \"POL\": \"0.3656171000000000\",\n \"ASTR\": \"0.0582608550000000\",\n \"NKN\": \"0.0691654000000000\",\n \"RSR\": \"0.0068055955000000\",\n \"DVPN\": \"0.0005979009000000\",\n \"TWT\": \"1.1119437500000000\",\n \"ARB\": \"0.5510243500000000\",\n \"CVC\": \"0.1409801746501747\",\n \"ARC\": \"0.0300849500000000\",\n \"XETA\": \"0.0022888550000000\",\n \"MTRG\": \"0.4007995000000000\",\n \"LOKA\": \"0.1867066000000000\",\n \"LPOOL\": \"0.0660069800000000\",\n \"TURBOS\": \"0.0034812585000000\",\n \"CVX\": \"1.7816087499999999\",\n \"ARX\": \"0.0007556220000000\",\n \"MPLX\": \"0.4355221300000000\",\n \"SUSHI\": \"0.7011492500000000\",\n \"NLK\": \"0.0114442750000000\",\n \"PEPE2\": \"0.0000000313843000\",\n \"WBTC\": \"66881.4425499645548419\",\n \"SUI3L\": \"0.0211204345000000\",\n \"CWS\": \"0.1927036000000000\",\n \"SUI3S\": \"0.0000579110300000\",\n \"INSP\": \"0.0264167850000000\",\n \"MANA\": \"0.2945026750000000\",\n \"VRTX\": \"0.0641679000000000\",\n \"CSPR\": \"0.0116441750000000\",\n \"ATA\": \"0.0785007300000000\",\n \"OPEN\": \"0.0080049955000000\",\n \"HAI\": \"0.0448275750000000\",\n \"NMR\": \"14.7436245000000072\",\n \"ATH\": \"0.0540929400000000\",\n \"LIT\": \"0.6282857000000000\",\n \"TLOS\": \"0.3263467450000000\",\n \"TNSR\": \"0.3662168000000000\",\n \"CXT\": \"0.0871364100000000\",\n \"POLYX\": \"0.2346826000000000\",\n \"ZERO\": \"0.0002507745500000\",\n \"ROUTE\": \"0.0610694500000000\",\n \"LOOM\": \"0.0580009850000000\",\n \"PRE\": \"0.0078680640000000\",\n \"VRAUP\": \"0.0134652640000000\",\n \"HBB\": \"0.0714742450000000\",\n \"RVN\": \"0.0165017450000000\",\n \"PRQ\": \"0.0715741950000000\",\n \"ONDO\": \"0.7134930750000000\",\n \"PEPEDOWN\": \"0.0000155022450000\",\n \"WOOP\": \"0.0020179905000000\",\n \"LUNCUP\": \"0.0168355780000000\",\n \"KAVA\": \"0.3522238000000000\",\n \"LKI\": \"0.0104187880000000\",\n \"AVA\": \"0.4857570000000000\",\n \"NOM\": \"0.0233883000000000\",\n \"MAPO\": \"0.0089015470000000\",\n \"PEPEUP\": \"0.0114252845000000\",\n \"STRAX\": \"0.0487156300000000\",\n \"NOT\": \"0.0078670645000000\",\n \"ZERC\": \"0.1108245600000000\",\n \"BCUT\": \"0.0255672100000000\",\n \"MASA\": \"0.0691354150000000\",\n \"WAN\": \"0.1785077544737212\",\n \"WAT\": \"0.0003273762300000\",\n \"WAX\": \"0.0327636100000000\",\n \"MASK\": \"2.2259864500000002\",\n \"EOS3L\": \"0.0002122138400000\",\n \"IDEA\": \"0.0005887055000000\",\n \"EOS3S\": \"0.0034472755000000\",\n \"YFI\": \"4919.4290549999908843\",\n \"MOODENG\": \"0.0774612500000000\",\n \"XCUR\": \"0.0048845565000000\",\n \"HYDRA\": \"0.2225886500000000\",\n \"POPCAT\": \"1.3382305500000000\",\n \"LQTY\": \"0.7848074000000000\",\n \"PIXEL\": \"0.1406596350000000\",\n \"LMR\": \"0.0145437245000000\",\n \"ZETA\": \"0.5997999500000000\",\n \"YGG\": \"0.4717640000000000\",\n \"AXS\": \"4.6006985000000006\",\n \"BCHSV\": \"49.8250749999999370\",\n \"NRN\": \"0.0395802000000000\",\n \"FTON\": \"0.0091954000000000\",\n \"COMP\": \"43.6581599999999881\",\n \"XPRT\": \"0.1819090000000000\",\n \"HFT\": \"0.1443278000000000\",\n \"UXLINK\": \"0.5085456000000000\",\n \"STAMP\": \"0.0335032400000000\",\n \"RUNE\": \"4.9233370999999996\",\n \"ZEUS\": \"0.2587705500000000\",\n \"LTC3L\": \"1.8294848000000001\",\n \"DAPP\": \"0.1763118000000000\",\n \"FORTH\": \"2.9508238500000004\",\n \"ALPINE\": \"1.5322335000000000\",\n \"SENSO\": \"0.0328835500000000\",\n \"LTC3S\": \"0.0006986505000000\",\n \"DEXE\": \"8.3795081500000028\",\n \"GOAL\": \"0.0175912000000000\",\n \"AVAX\": \"27.5602130000000058\",\n \"LISTA\": \"0.3782108000000000\",\n \"AMPL\": \"1.3743124999999999\",\n \"WORK\": \"0.1384307500000000\",\n \"BRWL\": \"0.0017391300000000\",\n \"BANANA\": \"57.1314200000001362\",\n \"PUSH\": \"0.0750624500000000\",\n \"WEN\": \"0.0001015492000000\",\n \"NEIRO\": \"0.0879560000000000\",\n \"BTCUP\": \"34.7711057499999789\",\n \"SOL3S\": \"0.0007816090000000\",\n \"BRAWL\": \"0.0004776610500000\",\n \"LAY3R\": \"0.2161918500000000\",\n \"LPT\": \"11.9304317999999945\",\n \"GODS\": \"0.1807096000000000\",\n \"SAND3S\": \"4.6152911999999992\",\n \"RDNT\": \"0.0640679500000000\",\n \"SOL3L\": \"1.8351913752850000\",\n \"NIBI\": \"0.0653772950000000\",\n \"NUM\": \"0.0436181800000000\",\n \"PYR\": \"2.5590198499999997\",\n \"DAG\": \"0.0226176855000000\",\n \"DAI\": \"0.9989006596042375\",\n \"HIP\": \"0.0034982500000000\",\n \"DAO\": \"0.2848575000000000\",\n \"AVAIL\": \"0.1300929210000000\",\n \"DAR\": \"0.1512243500000000\",\n \"FET\": \"1.3760116500000000\",\n \"FCON\": \"0.0001197600900000\",\n \"XAVA\": \"0.3789104500000000\",\n \"LRC\": \"0.1208395500000000\",\n \"UNI3S\": \"0.0000653573050000\",\n \"PZP\": \"0.0599600050000000\",\n \"POKT\": \"0.0424787500000000\",\n \"DASH\": \"23.6881500000000109\",\n \"BAKEDOWN\": \"0.0003324636850000\",\n \"POLC\": \"0.0061389290000000\",\n \"DBR\": \"0.0377671070000000\",\n \"CIRUS\": \"0.0055772100000000\",\n \"UNI3L\": \"0.0993921490650000\",\n \"NWC\": \"0.0681659000000000\",\n \"POLK\": \"0.0142628650000000\",\n \"LSD\": \"0.9420287500000000\",\n \"MARS4\": \"0.0005878059500000\",\n \"LSK\": \"0.8080957500000000\",\n \"BLOCK\": \"0.0261869000000000\",\n \"ANALOS\": \"0.0000446776500000\",\n \"SAFE\": \"0.8779608000000000\",\n \"DCK\": \"0.0234082900000000\",\n \"LSS\": \"0.0562718500000000\",\n \"DCR\": \"12.4337799999999929\",\n \"LIKE\": \"0.0559720000000000\",\n \"DATA\": \"0.0361819000000000\",\n \"WIF\": \"2.5696145499999999\",\n \"BLOK\": \"0.0006546725000000\",\n \"LTC\": \"71.6261690000000611\",\n \"METIS\": \"42.0289750000000612\",\n \"WIN\": \"0.0000868365600000\",\n \"HLG\": \"0.0018790600000000\",\n \"LTO\": \"0.1166116650000000\",\n \"DYDX\": \"0.9341327000000000\",\n \"ARB3S\": \"0.0509025360000000\",\n \"MUBI\": \"0.0303848000000000\",\n \"ARB3L\": \"0.0025917035000000\",\n \"RBTC1\": \"0.0000039480250000\",\n \"POND\": \"0.0118640650000000\",\n \"LINA\": \"0.0037771105000000\",\n \"MYRIA\": \"0.0025337325000000\",\n \"LINK\": \"11.0244849999999944\",\n \"QTUM\": \"2.4262016723130069\",\n \"TUNE\": \"0.0148025950000000\",\n \"UFO\": \"0.0000006479758500\",\n \"CYBER\": \"2.8755615000000001\",\n \"WILD\": \"0.2433782500000000\",\n \"POLS\": \"0.2809594500000000\",\n \"NYM\": \"0.0719640000000000\",\n \"FIL\": \"3.6786597500000005\",\n \"BAL\": \"2.0099945000000000\",\n \"SCA\": \"0.3999999000000000\",\n \"STND\": \"0.0133123405000000\",\n \"WMTX\": \"0.2138930000000000\",\n \"SCLP\": \"0.1545227000000000\",\n \"MANEKI\": \"0.0073963000000000\",\n \"BAT\": \"0.1721139000000000\",\n \"AKRO\": \"0.0042302838000000\",\n \"FTM3L\": \"8.2574692000000024\",\n \"BAX\": \"0.0000709645000000\",\n \"FTM3S\": \"0.0000255072400000\",\n \"COTI\": \"0.0951524000000000\"\n }\n}" } ] }, { - "name": "Get Part OrderBook", + "name": "Get 24hr Stats", "request": { "method": "GET", "header": [], @@ -4763,8 +4692,7 @@ "api", "v1", "market", - "orderbook", - "level2_{size}" + "stats" ], "query": [ { @@ -4774,7 +4702,7 @@ } ] }, - "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470165)\n\n:::info[Description]\nQuery for part orderbook depth data. (aggregated by price)\n\nYou are recommended to request via this endpoint as the system reponse would be faster and cosume less traffic.\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| time | integer | Timestamp(millisecond) |\n| sequence | string | Sequence number |\n| bids | array | Refer to the schema section of bids |\n| asks | array | Refer to the schema section of asks |\n\n---\n", + "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470161)\n\n:::info[Description]\nRequest via this endpoint to get the statistics of the specified ticker in the last 24 hours.\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| time | integer | timestamp |\n| symbol | string | Symbol |\n| buy | string | Best bid price
|\n| sell | string | Best ask price |\n| changeRate | string | 24h change rate |\n| changePrice | string | 24h change price |\n| high | string | Highest price in 24h |\n| low | string | Lowest price in 24h |\n| vol | string | 24h volume, executed based on base currency |\n| volValue | string | 24h traded amount |\n| last | string | Last traded price |\n| averagePrice | string | Average trading price in the last 24 hours |\n| takerFeeRate | string | Basic Taker Fee |\n| makerFeeRate | string | Basic Maker Fee |\n| takerCoefficient | string | The taker fee coefficient. The actual fee needs to be multiplied by this coefficient to get the final fee. Most currencies have a coefficient of 1. If set to 0, it means no fee |\n| makerCoefficient | string | The maker fee coefficient. The actual fee needs to be multiplied by this coefficient to get the final fee. Most currencies have a coefficient of 1. If set to 0, it means no fee |\n\n---\n", "body": {} }, "response": [ @@ -4793,8 +4721,7 @@ "api", "v1", "market", - "orderbook", - "level2_{size}" + "stats" ], "query": [ { @@ -4835,7 +4762,7 @@ } ], "cookie": [], - "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"time\": 1729176273859,\n \"sequence\": \"14610502970\",\n \"bids\": [\n [\n \"66976.4\",\n \"0.69109872\"\n ],\n [\n \"66976.3\",\n \"0.14377\"\n ]\n ],\n \"asks\": [\n [\n \"66976.5\",\n \"0.05408199\"\n ],\n [\n \"66976.8\",\n \"0.0005\"\n ]\n ]\n }\n}" + "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"time\": 1729175612158,\n \"symbol\": \"BTC-USDT\",\n \"buy\": \"66982.4\",\n \"sell\": \"66982.5\",\n \"changeRate\": \"-0.0114\",\n \"changePrice\": \"-778.1\",\n \"high\": \"68107.7\",\n \"low\": \"66683.3\",\n \"vol\": \"1738.02898182\",\n \"volValue\": \"117321982.415978333\",\n \"last\": \"66981.5\",\n \"averagePrice\": \"67281.21437289\",\n \"takerFeeRate\": \"0.001\",\n \"makerFeeRate\": \"0.001\",\n \"takerCoefficient\": \"1\",\n \"makerCoefficient\": \"1\"\n }\n}" } ] }, @@ -4915,7 +4842,7 @@ ] }, { - "name": "Get All Tickers", + "name": "Get Server Time", "request": { "method": "GET", "header": [], @@ -4928,12 +4855,11 @@ "path": [ "api", "v1", - "market", - "allTickers" + "timestamp" ], "query": [] }, - "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470167)\n\n:::info[Description]\nRequest market tickers for all the trading pairs in the market (including 24h volume), takes a snapshot every 2 seconds.\n\nOn the rare occasion that we will change the currency name, if you still want the changed symbol name, you can use the symbolName field instead of the symbol field via “Get Symbols List” endpoint.\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| time | integer | timestamp |\n| ticker | array | Refer to the schema section of ticker |\n\n**root.data.ticker Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| symbol | string | Symbol |\n| symbolName | string | Name of trading pairs, it would change after renaming |\n| buy | string | Best bid price |\n| bestBidSize | string | Best bid size |\n| sell | string | Best ask price |\n| bestAskSize | string | Best ask size |\n| changeRate | string | 24h change rate |\n| changePrice | string | 24h change price |\n| high | string | Highest price in 24h |\n| low | string | Lowest price in 24h |\n| vol | string | 24h volume, executed based on base currency |\n| volValue | string | 24h traded amount |\n| last | string | Last traded price |\n| averagePrice | string | Average trading price in the last 24 hours |\n| takerFeeRate | string | Basic Taker Fee |\n| makerFeeRate | string | Basic Maker Fee |\n| takerCoefficient | string | The taker fee coefficient. The actual fee needs to be multiplied by this coefficient to get the final fee. Most currencies have a coefficient of 1. If set to 0, it means no fee |\n| makerCoefficient | string | The maker fee coefficient. The actual fee needs to be multiplied by this coefficient to get the final fee. Most currencies have a coefficient of 1. If set to 0, it means no fee |\n\n---\n", + "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470156)\n\n:::info[Description]\nGet the server time.\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | integer | ServerTime(millisecond) |\n\n---\n", "body": {} }, "response": [ @@ -4951,8 +4877,7 @@ "path": [ "api", "v1", - "market", - "allTickers" + "timestamp" ], "query": [] } @@ -4987,20 +4912,14 @@ } ], "cookie": [], - "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"time\": 1729173207043,\n \"ticker\": [\n {\n \"symbol\": \"BTC-USDT\",\n \"symbolName\": \"BTC-USDT\",\n \"buy\": \"67192.5\",\n \"bestBidSize\": \"0.000025\",\n \"sell\": \"67192.6\",\n \"bestAskSize\": \"1.24949204\",\n \"changeRate\": \"-0.0014\",\n \"changePrice\": \"-98.5\",\n \"high\": \"68321.4\",\n \"low\": \"66683.3\",\n \"vol\": \"1836.03034612\",\n \"volValue\": \"124068431.06726933\",\n \"last\": \"67193\",\n \"averagePrice\": \"67281.21437289\",\n \"takerFeeRate\": \"0.001\",\n \"makerFeeRate\": \"0.001\",\n \"takerCoefficient\": \"1\",\n \"makerCoefficient\": \"1\"\n }\n ]\n }\n}" + "body": "{\n \"code\": \"200000\",\n \"data\": 1729100692873\n}" } ] - } - ], - "description": "" - }, - { - "name": "Orders", - "item": [ + }, { - "name": "Batch Add Orders", + "name": "Get Service Status", "request": { - "method": "POST", + "method": "GET", "header": [], "url": { "raw": "", @@ -5011,28 +4930,18 @@ "path": [ "api", "v1", - "hf", - "orders", - "multi" + "status" ], "query": [] }, - "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470168)\n\n:::info[Description]\nThis endpoint supports sequential batch order placement from a single endpoint. A maximum of 20 orders can be placed simultaneously.\n:::\n\n\n\n:::tip[Tips]\nThis endpoint only supports order placement requests. To obtain the results of the order placement, you will need to check the order status or subscribe to websocket to obtain information about he order.\n:::\n\n:::tip[Tips]\nPlease note that once your order enters the order book, the system will freeze the handling fees for the order ahead of time.\n\nBefore placing orders, please be sure to fully understand the meaning of the parameters for each trading pair.\n:::\n\n:::tip[Tips]\nThe maximum number of active orders per account is 2000, with a maximum of 200 active orders per trading pair.\n:::\n\n**Public order placement request parameters**\n\n| Param | Type | Mandatory | Description |\n| --------- | ------ | --------- | ----------- |\n| clientOid | String | No | Client Order Id,unique identifier created by the user, the use of UUID is recommended |\n| symbol | String | Yes | symbol |\n| type | String | Yes | Order type `limit` and `market` |\n| side | String | Yes | `buy` or `sell` |\n| stp | String | No | self trade prevention is divided into four strategies: `CN`, `CO`, `CB` , and `DC` |\n| tags | String | No | Order tag, length cannot exceed `20` characters (ASCII) |\n| remark | String | No | Order placement remarks, length cannot exceed `20` characters (ASCII) |\n\n**Additional Request Parameters Required by `limit` Orders**\n\n| Param | Type | Mandatory | Description |\n| ----------- | ------- | --------- | ----------- |\n| price | String | Yes | Specify price for currency |\n| size | String | Yes | Specify quantity for currency |\n| timeInForce | String | No | Order timing strategy `GTC`, `GTT`, `IOC`, `FOK` (The default is `GTC`) |\n| cancelAfter | long | No | Cancel after `n` seconds,the order timing strategy is `GTT` |\n| postOnly | boolean | No | passive order labels, this is disabled when the order timing strategy is `IOC` or `FOK` |\n| hidden | boolean | No | Hidden or not (not shown in order book) |\n| iceberg | boolean | No | Whether or not only visible portions of orders are shown in iceberg orders |\n| visibleSize | String | No | Maximum visible quantity in iceberg orders |\n\n**Additional request parameters required by `market` orders**\n\n| Param | Type | Mandatory | Description |\n| ----- | ------ | --------- | ------------------------------------------ |\n| size | String | No | (Select one out of two: `size` or `funds`) |\n| funds | String | No | (Select one out of two: `size` or `funds`) |\n\n\n**Hold**\n\nFor limit price purchase orders, we will hold the amount of funds (price * size) required for your purchase order. Similarly, for limit price sell orders, we will also hold you sell order assets. When the transaction is executed, the service fees will be calculated. If you cancel a portion of a filled or unfilled order, then the remaining funds or amounts will be released and returned to your account. For market price buy/sell orders that require specific funds, we will hold the required funds in from your account. If only the size is specified, we may freeze (usually for a very short amount of time) all of the funds in your account prior to the order being filled or cancelled.\n\n\n**Order Lifecycle**\n\nWhen an order placement request is successful (the matching engine receives the order) or denied (due to there being insufficient funds or illegal parameter values, etc.), the system will respond to the HTTP request. When an order is successfully placed, the order ID is returned. The order will be matched, which could result in it being fully or partially filled. When an order is fully or partially filled, the remaining portions of the order will be in an active state awaiting to be matched (this does not include IOC orders). Orders that are fully or partially filled(already cancelled) will be put into the “done” state.\n\nUsers that have subscribed to the Market Data Channel can use the order ID (orderId) and client ID (clientOid) to identify messages.\n\n**Price Protection Mechanisms**\n\nPrice protection mechanisms ae enabled for order placements. Rules are detailed below:\n\n- If the spot trading market order/limit order placed by the user can be directly matched with an order in the current order book, the system will judge whether deviation between the price corresponding to the transaction depth and the spread exceeds the threshold value (the threshold value can be obtained using the symbol API endpoint);\n\n- If it is exceeded, for limit orders, the order will be directly cancelled;\n\n- If it is a market order, then the system will partially execute the order. The execution limit will be the order size within the price range corresponding to the threshold value. The remaining orders will not be filled.\n\nFor example: if the threshold value is 10%, when a user places a market price purchase order in the KCS/USDT trading market for 10,000 USDT (the selling price is currently 1.20000), the system will determine that after the order is completely filled, the final price will be 1.40000. (1.40000-1.20000)/1.20000=16.7%>10%. The threshold value is 1.32000. The user’s market price purchase order will be filled only to a maximum of 1.32000. The remaining order portions will not be matched with orders in the order book. Note: this feature may not be able to determine depth with complete accuracy. If your order is not completely filled, it may be because the portion exceeding the threshold value was not filled.\n\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| orderList | array | Refer to the schema section of orderList |\n\n**root.orderList Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| clientOid | string | Client Order Id,The ClientOid field is a unique ID created by the user(we recommend using a UUID), and can only contain numbers, letters, underscores (_), and hyphens (-). This field is returned when order information is obtained. You can use clientOid to tag your orders. ClientOid is different from the order ID created by the service provider. Please do not initiate requests using the same clientOid. The maximum length for the ClientOid is 40 characters.
|\n| symbol | string | symbol |\n| type | string | Specify if the order is an 'limit' order or 'market' order. |\n| timeInForce | string | [Time in force](https://www.kucoin.com/docs-new/doc-338146) is a special strategy used during trading |\n| side | string | Specify if the order is to 'buy' or 'sell' |\n| price | string | Specify price for order |\n| size | string | Specify quantity for order

When **type** is limit, select one out of two: size or funds, size refers to the amount of trading targets (the asset name written in front) for the trading pair. Teh Size must be based on the baseIncrement of the trading pair. The baseIncrement represents the precision for the trading pair. The size of an order must be a positive-integer multiple of baseIncrement and must be between baseMinSize and baseMaxSize.

When **type** is market, select one out of two: size or funds |\n| stp | string | [Self Trade Prevention](https://www.kucoin.com/docs-new/doc-338146) is divided into four strategies: CN, CO, CB , and DC |\n| cancelAfter | integer | Cancel after n seconds,the order timing strategy is GTT |\n| postOnly | boolean | passive order labels, this is disabled when the order timing strategy is IOC or FOK |\n| hidden | boolean | [Hidden order](https://www.kucoin.com/docs-new/doc-338146) or not (not shown in order book) |\n| iceberg | boolean | Whether or not only visible portions of orders are shown in [Iceberg orders](https://www.kucoin.com/docs-new/doc-338146) |\n| visibleSize | string | Maximum visible quantity in iceberg orders |\n| tags | string | Order tag, length cannot exceed 20 characters (ASCII) |\n| remark | string | Order placement remarks, length cannot exceed 20 characters (ASCII) |\n| funds | string | When **type** is market, select one out of two: size or funds |\n\n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | array | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| orderId | string | The unique order id generated by the trading system,which can be used later for further actions such as canceling the order. |\n| clientOid | string | The user self-defined order id. |\n| success | boolean | Add order success/failure |\n| failMsg | string | error message |\n\n---\n", - "body": { - "mode": "raw", - "raw": "{\n \"orderList\": [\n {\n \"clientOid\": \"client order id 12\",\n \"symbol\": \"BTC-USDT\",\n \"type\": \"limit\",\n \"side\": \"buy\",\n \"price\": \"30000\",\n \"size\": \"0.00001\"\n },\n {\n \"clientOid\": \"client order id 13\",\n \"symbol\": \"ETH-USDT\",\n \"type\": \"limit\",\n \"side\": \"sell\",\n \"price\": \"2000\",\n \"size\": \"0.00001\"\n }\n ]\n}", - "options": { - "raw": { - "language": "json" - } - } - } + "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470158)\n\n:::info[Description]\nGet the service status\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| status | string | Status of service: open:normal transaction, close:Stop Trading/Maintenance, cancelonly:can only cancel the order but not place order |\n| msg | string | Remark for operation |\n\n---\n", + "body": {} }, "response": [ { "name": "Successful Response", "originalRequest": { - "method": "POST", + "method": "GET", "header": [], "url": { "raw": "", @@ -5043,9 +4952,7 @@ "path": [ "api", "v1", - "hf", - "orders", - "multi" + "status" ], "query": [] } @@ -5080,12 +4987,18 @@ } ], "cookie": [], - "body": "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"orderId\": \"6710d8336afcdb0007319c27\",\n \"clientOid\": \"client order id 12\",\n \"success\": true\n },\n {\n \"success\": false,\n \"failMsg\": \"The order funds should more then 0.1 USDT.\"\n }\n ]\n}" + "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"status\": \"open\",\n \"msg\": \"\"\n }\n}" } ] - }, + } + ], + "description": "" + }, + { + "name": "Orders", + "item": [ { - "name": "Batch Add Orders Sync", + "name": "Add Order", "request": { "method": "POST", "header": [], @@ -5099,16 +5012,14 @@ "api", "v1", "hf", - "orders", - "multi", - "sync" + "orders" ], "query": [] }, - "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470169)\n\n:::info[Description]\nThis endpoint supports sequential batch order placement from a single endpoint. A maximum of 20 orders can be placed simultaneously.\n\nThe difference between this interface and \"Batch Add Orders\" is that this interface will synchronously return the order information after the order matching is completed.\n\nFor higher latency requirements, please select the \"Batch Add Orders\" interface. If there is a requirement for returning data integrity, please select this interface\n:::\n\n\n\n:::tip[Tips]\nThis endpoint only supports order placement requests. To obtain the results of the order placement, you will need to check the order status or subscribe to websocket to obtain information about he order.\n:::\n\n:::tip[Tips]\nPlease note that once your order enters the order book, the system will freeze the handling fees for the order ahead of time.\n\nBefore placing orders, please be sure to fully understand the meaning of the parameters for each trading pair.\n:::\n\n:::tip[Tips]\nThe maximum number of active orders per account is 2000, with a maximum of 200 active orders per trading pair.\n:::\n\n**Public order placement request parameters**\n\n| Param | Type | Mandatory | Description |\n| --------- | ------ | --------- | ----------- |\n| clientOid | String | No | Client Order Id,unique identifier created by the user, the use of UUID is recommended |\n| symbol | String | Yes | symbol |\n| type | String | Yes | Order type `limit` and `market` |\n| side | String | Yes | `buy` or `sell` |\n| stp | String | No | self trade prevention is divided into four strategies: `CN`, `CO`, `CB` , and `DC` |\n| tags | String | No | Order tag, length cannot exceed `20` characters (ASCII) |\n| remark | String | No | Order placement remarks, length cannot exceed `20` characters (ASCII) |\n\n**Additional Request Parameters Required by `limit` Orders**\n\n| Param | Type | Mandatory | Description |\n| ----------- | ------- | --------- | ----------- |\n| price | String | Yes | Specify price for currency |\n| size | String | Yes | Specify quantity for currency |\n| timeInForce | String | No | Order timing strategy `GTC`, `GTT`, `IOC`, `FOK` (The default is `GTC`) |\n| cancelAfter | long | No | Cancel after `n` seconds,the order timing strategy is `GTT` |\n| postOnly | boolean | No | passive order labels, this is disabled when the order timing strategy is `IOC` or `FOK` |\n| hidden | boolean | No | Hidden or not (not shown in order book) |\n| iceberg | boolean | No | Whether or not only visible portions of orders are shown in iceberg orders |\n| visibleSize | String | No | Maximum visible quantity in iceberg orders |\n\n**Additional request parameters required by `market` orders**\n\n| Param | Type | Mandatory | Description |\n| ----- | ------ | --------- | ------------------------------------------ |\n| size | String | No | (Select one out of two: `size` or `funds`) |\n| funds | String | No | (Select one out of two: `size` or `funds`) |\n\n\n**Hold**\n\nFor limit price purchase orders, we will hold the amount of funds (price * size) required for your purchase order. Similarly, for limit price sell orders, we will also hold you sell order assets. When the transaction is executed, the service fees will be calculated. If you cancel a portion of a filled or unfilled order, then the remaining funds or amounts will be released and returned to your account. For market price buy/sell orders that require specific funds, we will hold the required funds in from your account. If only the size is specified, we may freeze (usually for a very short amount of time) all of the funds in your account prior to the order being filled or cancelled.\n\n\n**Order Lifecycle**\n\nWhen an order placement request is successful (the matching engine receives the order) or denied (due to there being insufficient funds or illegal parameter values, etc.), the system will respond to the HTTP request. When an order is successfully placed, the order ID is returned. The order will be matched, which could result in it being fully or partially filled. When an order is fully or partially filled, the remaining portions of the order will be in an active state awaiting to be matched (this does not include IOC orders). Orders that are fully or partially filled(already cancelled) will be put into the “done” state.\n\nUsers that have subscribed to the Market Data Channel can use the order ID (orderId) and client ID (clientOid) to identify messages.\n\n**Price Protection Mechanisms**\n\nPrice protection mechanisms ae enabled for order placements. Rules are detailed below:\n\n- If the spot trading market order/limit order placed by the user can be directly matched with an order in the current order book, the system will judge whether deviation between the price corresponding to the transaction depth and the spread exceeds the threshold value (the threshold value can be obtained using the symbol API endpoint);\n\n- If it is exceeded, for limit orders, the order will be directly cancelled;\n\n- If it is a market order, then the system will partially execute the order. The execution limit will be the order size within the price range corresponding to the threshold value. The remaining orders will not be filled.\n\nFor example: if the threshold value is 10%, when a user places a market price purchase order in the KCS/USDT trading market for 10,000 USDT (the selling price is currently 1.20000), the system will determine that after the order is completely filled, the final price will be 1.40000. (1.40000-1.20000)/1.20000=16.7%>10%. The threshold value is 1.32000. The user’s market price purchase order will be filled only to a maximum of 1.32000. The remaining order portions will not be matched with orders in the order book. Note: this feature may not be able to determine depth with complete accuracy. If your order is not completely filled, it may be because the portion exceeding the threshold value was not filled.\n\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| orderList | array | Refer to the schema section of orderList |\n\n**root.orderList Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| clientOid | string | Client Order Id,The ClientOid field is a unique ID created by the user(we recommend using a UUID), and can only contain numbers, letters, underscores (_), and hyphens (-). This field is returned when order information is obtained. You can use clientOid to tag your orders. ClientOid is different from the order ID created by the service provider. Please do not initiate requests using the same clientOid. The maximum length for the ClientOid is 40 characters.
|\n| symbol | string | symbol |\n| type | string | Specify if the order is an 'limit' order or 'market' order. |\n| timeInForce | string | [Time in force](https://www.kucoin.com/docs-new/doc-338146) is a special strategy used during trading |\n| side | string | Specify if the order is to 'buy' or 'sell' |\n| price | string | Specify price for order |\n| size | string | Specify quantity for order

When **type** is limit, select one out of two: size or funds, size refers to the amount of trading targets (the asset name written in front) for the trading pair. Teh Size must be based on the baseIncrement of the trading pair. The baseIncrement represents the precision for the trading pair. The size of an order must be a positive-integer multiple of baseIncrement and must be between baseMinSize and baseMaxSize.

When **type** is market, select one out of two: size or funds |\n| stp | string | [Self Trade Prevention](https://www.kucoin.com/docs-new/doc-338146) is divided into four strategies: CN, CO, CB , and DC |\n| cancelAfter | integer | Cancel after n seconds,the order timing strategy is GTT |\n| postOnly | boolean | passive order labels, this is disabled when the order timing strategy is IOC or FOK |\n| hidden | boolean | [Hidden order](https://www.kucoin.com/docs-new/doc-338146) or not (not shown in order book) |\n| iceberg | boolean | Whether or not only visible portions of orders are shown in [Iceberg orders](https://www.kucoin.com/docs-new/doc-338146) |\n| visibleSize | string | Maximum visible quantity in iceberg orders |\n| tags | string | Order tag, length cannot exceed 20 characters (ASCII) |\n| remark | string | Order placement remarks, length cannot exceed 20 characters (ASCII) |\n| funds | string | When **type** is market, select one out of two: size or funds |\n\n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | array | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| orderId | string | The unique order id generated by the trading system,which can be used later for further actions such as canceling the order. |\n| clientOid | string | The user self-defined order id. |\n| orderTime | integer | |\n| originSize | string | original order size |\n| dealSize | string | deal size |\n| remainSize | string | remain size |\n| canceledSize | string | Cumulative canceled size |\n| status | string | Order Status. open:order is active; done:order has been completed |\n| matchTime | integer | |\n| success | boolean | Add order success/failure |\n| failMsg | string | error message |\n\n---\n", + "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470188)\n\n:::info[Description]\nPlace order to the Spot trading system, you can place two major types of orders: limit and market. Orders can only be placed if your account has sufficient funds. Once an order is placed, your funds will be put on hold for the duration of the order. The amount of funds on hold depends on the order type and parameters specified.\n:::\n\n:::tip[Tips]\nPlease note that once your order enters the order book, the system will freeze the handling fees for the order ahead of time.\n\nBefore placing orders, please be sure to fully understand the meaning of the parameters for each trading pair.\n:::\n\n:::tip[Tips]\nThe maximum number of active orders per account is 2000, with a maximum of 200 active orders per trading pair.\n:::\n\n\n**Public order placement request parameters**\n\n| Param | Type | Mandatory | Description |\n| --------- | ------ | --------- | ----------- |\n| clientOid | String | No | Client Order Id,unique identifier created by the user, the use of UUID is recommended |\n| symbol | String | Yes | symbol |\n| type | String | Yes | Order type `limit` and `market` |\n| side | String | Yes | `buy` or `sell` |\n| stp | String | No | self trade prevention is divided into four strategies: `CN`, `CO`, `CB` , and `DC` |\n| tags | String | No | Order tag, length cannot exceed `20` characters (ASCII) |\n| remark | String | No | Order placement remarks, length cannot exceed `20` characters (ASCII) |\n\n**Additional Request Parameters Required by `limit` Orders**\n\n| Param | Type | Mandatory | Description |\n| ----------- | ------- | --------- | ----------- |\n| price | String | Yes | Specify price for currency |\n| size | String | Yes | Specify quantity for currency |\n| timeInForce | String | No | Order timing strategy `GTC`, `GTT`, `IOC`, `FOK` (The default is `GTC`) |\n| cancelAfter | long | No | Cancel after `n` seconds,the order timing strategy is `GTT` |\n| postOnly | boolean | No | passive order labels, this is disabled when the order timing strategy is `IOC` or `FOK` |\n| hidden | boolean | No | Hidden or not (not shown in order book) |\n| iceberg | boolean | No | Whether or not only visible portions of orders are shown in iceberg orders |\n| visibleSize | String | No | Maximum visible quantity in iceberg orders |\n\n**Additional request parameters required by `market` orders**\n\n| Param | Type | Mandatory | Description |\n| ----- | ------ | --------- | ------------------------------------------ |\n| size | String | No | (Select one out of two: `size` or `funds`) |\n| funds | String | No | (Select one out of two: `size` or `funds`) |\n\n\n\n**Hold**\n\nFor limit price purchase orders, we will hold the amount of funds (price * size) required for your purchase order. Similarly, for limit price sell orders, we will also hold you sell order assets. When the transaction is executed, the service fees will be calculated. If you cancel a portion of a filled or unfilled order, then the remaining funds or amounts will be released and returned to your account. For market price buy/sell orders that require specific funds, we will hold the required funds in from your account. If only the size is specified, we may freeze (usually for a very short amount of time) all of the funds in your account prior to the order being filled or cancelled.\n\n\n**Order Lifecycle**\n\nWhen an order placement request is successful (the matching engine receives the order) or denied (due to there being insufficient funds or illegal parameter values, etc.), the system will respond to the HTTP request. When an order is successfully placed, the order ID is returned. The order will be matched, which could result in it being fully or partially filled. When an order is fully or partially filled, the remaining portions of the order will be in an active state awaiting to be matched (this does not include IOC orders). Orders that are fully or partially filled(already cancelled) will be put into the “done” state.\n\nUsers that have subscribed to the Market Data Channel can use the order ID (orderId) and client ID (clientOid) to identify messages.\n\n**Price Protection Mechanisms**\n\nPrice protection mechanisms ae enabled for order placements. Rules are detailed below:\n\n- If the spot trading market order/limit order placed by the user can be directly matched with an order in the current order book, the system will judge whether deviation between the price corresponding to the transaction depth and the spread exceeds the threshold value (the threshold value can be obtained using the symbol API endpoint);\n\n- If it is exceeded, for limit orders, the order will be directly cancelled;\n\n- If it is a market order, then the system will partially execute the order. The execution limit will be the order size within the price range corresponding to the threshold value. The remaining orders will not be filled.\n\nFor example: if the threshold value is 10%, when a user places a market price purchase order in the KCS/USDT trading market for 10,000 USDT (the selling price is currently 1.20000), the system will determine that after the order is completely filled, the final price will be 1.40000. (1.40000-1.20000)/1.20000=16.7%>10%. The threshold value is 1.32000. The user’s market price purchase order will be filled only to a maximum of 1.32000. The remaining order portions will not be matched with orders in the order book. Note: this feature may not be able to determine depth with complete accuracy. If your order is not completely filled, it may be because the portion exceeding the threshold value was not filled.\n\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| clientOid | string | Client Order Id,The ClientOid field is a unique ID created by the user(we recommend using a UUID), and can only contain numbers, letters, underscores (_), and hyphens (-). This field is returned when order information is obtained. You can use clientOid to tag your orders. ClientOid is different from the order ID created by the service provider. Please do not initiate requests using the same clientOid. The maximum length for the ClientOid is 40 characters.

Please remember the orderId created by the service provider, it used to check for updates in order status. |\n| side | string | specify if the order is to 'buy' or 'sell' |\n| symbol | string | symbol |\n| type | string | specify if the order is an 'limit' order or 'market' order.

The type of order you specify when you place your order determines whether or not you need to request other parameters and also affects the execution of the matching engine.

When placing a limit order, you must specify a price and size. The system will try to match the order according to market price or a price better than market price. If the order cannot be immediately matched, it will stay in the order book until it is matched or the user cancels.

Unlike limit orders, the price for market orders fluctuates with market prices. When placing a market order, you do not need to specify a price, you only need to specify a quantity. Market orders are filled immediately and will not enter the order book. All market orders are takers and a taker fee will be charged. |\n| remark | string | Order placement remarks, length cannot exceed 20 characters (ASCII) |\n| stp | string | [Self Trade Prevention](https://www.kucoin.com/docs-new/doc-338146) is divided into four strategies: CN, CO, CB , and DC |\n| price | string | Specify price for order

When placing a limit order, the price must be based on priceIncrement for the trading pair. The price increment (priceIncrement) is the price precision for the trading pair. For example, for the BTC-USDT trading pair, the priceIncrement is 0.00001000. So the price for your orders cannot be less than 0.00001000 and must be a multiple of priceIncrement. Otherwise, the order will return an invalid priceIncrement error. |\n| size | string | Specify quantity for order

When **type** is limit, size refers to the amount of trading targets (the asset name written in front) for the trading pair. Teh Size must be based on the baseIncrement of the trading pair. The baseIncrement represents the precision for the trading pair. The size of an order must be a positive-integer multiple of baseIncrement and must be between baseMinSize and baseMaxSize.

When **type** is market, select one out of two: size or funds |\n| timeInForce | string | [Time in force](https://www.kucoin.com/docs-new/doc-338146) is a special strategy used during trading |\n| postOnly | boolean | passive order labels, this is disabled when the order timing strategy is IOC or FOK |\n| hidden | boolean | [Hidden order](https://www.kucoin.com/docs-new/doc-338146) or not (not shown in order book) |\n| iceberg | boolean | Whether or not only visible portions of orders are shown in [Iceberg orders](https://www.kucoin.com/docs-new/doc-338146) |\n| visibleSize | string | Maximum visible quantity in iceberg orders |\n| tags | string | Order tag, length cannot exceed 20 characters (ASCII) |\n| cancelAfter | integer | Cancel after n seconds,the order timing strategy is GTT |\n| funds | string | When **type** is market, select one out of two: size or funds |\n\n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| orderId | string | The unique order id generated by the trading system,which can be used later for further actions such as canceling the order. |\n| clientOid | string | The user self-defined order id. |\n\n---\n", "body": { "mode": "raw", - "raw": "{\n \"orderList\": [\n {\n \"clientOid\": \"client order id 13\",\n \"symbol\": \"BTC-USDT\",\n \"type\": \"limit\",\n \"side\": \"buy\",\n \"price\": \"30000\",\n \"size\": \"0.00001\"\n },\n {\n \"clientOid\": \"client order id 14\",\n \"symbol\": \"ETH-USDT\",\n \"type\": \"limit\",\n \"side\": \"sell\",\n \"price\": \"2000\",\n \"size\": \"0.00001\"\n }\n ]\n}", + "raw": "//limit order\n{\n \"type\": \"limit\",\n \"symbol\": \"BTC-USDT\",\n \"side\": \"buy\",\n \"price\": \"50000\",\n \"size\": \"0.00001\",\n \"clientOid\": \"5c52e11203aa677f33e493fb\",\n \"remark\": \"order remarks\"\n}\n\n//market order 1\n// {\n// \"type\": \"market\",\n// \"symbol\": \"BTC-USDT\",\n// \"side\": \"buy\",\n// \"size\": \"0.00001\",\n// \"clientOid\": \"5c52e11203aa677f33e493fc\",\n// \"remark\": \"order remarks\"\n// }\n\n//market order 2\n// {\n// \"type\": \"market\",\n// \"symbol\": \"BTC-USDT\",\n// \"side\": \"buy\",\n// \"funds\": \"1\",\n// \"clientOid\": \"5c52e11203aa677f33e493fc\",\n// \"remark\": \"order remarks\"\n// }\n", "options": { "raw": { "language": "json" @@ -5132,9 +5043,7 @@ "api", "v1", "hf", - "orders", - "multi", - "sync" + "orders" ], "query": [] } @@ -5169,7 +5078,7 @@ } ], "cookie": [], - "body": "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"orderId\": \"6711195e5584bc0007bd5aef\",\n \"clientOid\": \"client order id 13\",\n \"orderTime\": 1729173854299,\n \"originSize\": \"0.00001\",\n \"dealSize\": \"0\",\n \"remainSize\": \"0.00001\",\n \"canceledSize\": \"0\",\n \"status\": \"open\",\n \"matchTime\": 1729173854326,\n \"success\": true\n },\n {\n \"success\": false,\n \"failMsg\": \"The order funds should more then 0.1 USDT.\"\n }\n ]\n}" + "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"orderId\": \"670fd33bf9406e0007ab3945\",\n \"clientOid\": \"5c52e11203aa677f33e493fb\"\n }\n}" } ] }, @@ -5261,7 +5170,7 @@ ] }, { - "name": "Modify Order", + "name": "Add Order Test", "request": { "method": "POST", "header": [], @@ -5276,14 +5185,14 @@ "v1", "hf", "orders", - "alter" + "test" ], "query": [] }, - "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470171)\n\n:::info[Description]\nThis interface can modify the price and quantity of the order according to orderId or clientOid.\n\nThe implementation of this interface is: cancel the order and place a new order on the same trading pair, and return the modification result to the client synchronously\n\nWhen the quantity of the new order updated by the user is less than the filled quantity of this order, the order will be considered as completed, and the order will be cancelled, and no new order will be placed\n:::\n\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| clientOid | string | The old client order id,orderId and clientOid must choose one |\n| symbol | string | symbol |\n| orderId | string | The old order id, orderId and clientOid must choose one |\n| newPrice | string | The modified price of the new order, newPrice and newSize must choose one |\n| newSize | string | The modified size of the new order, newPrice and newSize must choose one |\n\n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| newOrderId | string | The new order id |\n| clientOid | string | The original client order id |\n\n---\n", + "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470187)\n\n:::info[Description]\nOrder test endpoint, the request parameters and return parameters of this endpoint are exactly the same as the order endpoint, and can be used to verify whether the signature is correct and other operations. After placing an order, the order will not enter the matching system, and the order cannot be queried.\n:::\n\n:::tip[Tips]\nPlease note that once your order enters the order book, the system will freeze the handling fees for the order ahead of time.\n\nBefore placing orders, please be sure to fully understand the meaning of the parameters for each trading pair.\n:::\n\n:::tip[Tips]\nThe maximum number of active orders per account is 2000, with a maximum of 200 active orders per trading pair.\n:::\n\n\n**Public order placement request parameters**\n\n| Param | Type | Mandatory | Description |\n| --------- | ------ | --------- | ----------- |\n| clientOid | String | No | Client Order Id,unique identifier created by the user, the use of UUID is recommended |\n| symbol | String | Yes | symbol |\n| type | String | Yes | Order type `limit` and `market` |\n| side | String | Yes | `buy` or `sell` |\n| stp | String | No | self trade prevention is divided into four strategies: `CN`, `CO`, `CB` , and `DC` |\n| tags | String | No | Order tag, length cannot exceed `20` characters (ASCII) |\n| remark | String | No | Order placement remarks, length cannot exceed `20` characters (ASCII) |\n\n**Additional Request Parameters Required by `limit` Orders**\n\n| Param | Type | Mandatory | Description |\n| ----------- | ------- | --------- | ----------- |\n| price | String | Yes | Specify price for currency |\n| size | String | Yes | Specify quantity for currency |\n| timeInForce | String | No | Order timing strategy `GTC`, `GTT`, `IOC`, `FOK` (The default is `GTC`) |\n| cancelAfter | long | No | Cancel after `n` seconds,the order timing strategy is `GTT` |\n| postOnly | boolean | No | passive order labels, this is disabled when the order timing strategy is `IOC` or `FOK` |\n| hidden | boolean | No | Hidden or not (not shown in order book) |\n| iceberg | boolean | No | Whether or not only visible portions of orders are shown in iceberg orders |\n| visibleSize | String | No | Maximum visible quantity in iceberg orders |\n\n**Additional request parameters required by `market` orders**\n\n| Param | Type | Mandatory | Description |\n| ----- | ------ | --------- | ------------------------------------------ |\n| size | String | No | (Select one out of two: `size` or `funds`) |\n| funds | String | No | (Select one out of two: `size` or `funds`) |\n\n\n**Hold**\n\nFor limit price purchase orders, we will hold the amount of funds (price * size) required for your purchase order. Similarly, for limit price sell orders, we will also hold you sell order assets. When the transaction is executed, the service fees will be calculated. If you cancel a portion of a filled or unfilled order, then the remaining funds or amounts will be released and returned to your account. For market price buy/sell orders that require specific funds, we will hold the required funds in from your account. If only the size is specified, we may freeze (usually for a very short amount of time) all of the funds in your account prior to the order being filled or cancelled.\n\n\n**Order Lifecycle**\n\nWhen an order placement request is successful (the matching engine receives the order) or denied (due to there being insufficient funds or illegal parameter values, etc.), the system will respond to the HTTP request. When an order is successfully placed, the order ID is returned. The order will be matched, which could result in it being fully or partially filled. When an order is fully or partially filled, the remaining portions of the order will be in an active state awaiting to be matched (this does not include IOC orders). Orders that are fully or partially filled(already cancelled) will be put into the “done” state.\n\nUsers that have subscribed to the Market Data Channel can use the order ID (orderId) and client ID (clientOid) to identify messages.\n\n**Price Protection Mechanisms**\n\nPrice protection mechanisms ae enabled for order placements. Rules are detailed below:\n\n- If the spot trading market order/limit order placed by the user can be directly matched with an order in the current order book, the system will judge whether deviation between the price corresponding to the transaction depth and the spread exceeds the threshold value (the threshold value can be obtained using the symbol API endpoint);\n\n- If it is exceeded, for limit orders, the order will be directly cancelled;\n\n- If it is a market order, then the system will partially execute the order. The execution limit will be the order size within the price range corresponding to the threshold value. The remaining orders will not be filled.\n\nFor example: if the threshold value is 10%, when a user places a market price purchase order in the KCS/USDT trading market for 10,000 USDT (the selling price is currently 1.20000), the system will determine that after the order is completely filled, the final price will be 1.40000. (1.40000-1.20000)/1.20000=16.7%>10%. The threshold value is 1.32000. The user’s market price purchase order will be filled only to a maximum of 1.32000. The remaining order portions will not be matched with orders in the order book. Note: this feature may not be able to determine depth with complete accuracy. If your order is not completely filled, it may be because the portion exceeding the threshold value was not filled.\n\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| clientOid | string | Client Order Id,The ClientOid field is a unique ID created by the user(we recommend using a UUID), and can only contain numbers, letters, underscores (_), and hyphens (-). This field is returned when order information is obtained. You can use clientOid to tag your orders. ClientOid is different from the order ID created by the service provider. Please do not initiate requests using the same clientOid. The maximum length for the ClientOid is 40 characters.

Please remember the orderId created by the service provider, it used to check for updates in order status. |\n| side | string | specify if the order is to 'buy' or 'sell' |\n| symbol | string | symbol |\n| type | string | specify if the order is an 'limit' order or 'market' order.

The type of order you specify when you place your order determines whether or not you need to request other parameters and also affects the execution of the matching engine.

When placing a limit order, you must specify a price and size. The system will try to match the order according to market price or a price better than market price. If the order cannot be immediately matched, it will stay in the order book until it is matched or the user cancels.

Unlike limit orders, the price for market orders fluctuates with market prices. When placing a market order, you do not need to specify a price, you only need to specify a quantity. Market orders are filled immediately and will not enter the order book. All market orders are takers and a taker fee will be charged. |\n| remark | string | Order placement remarks, length cannot exceed 20 characters (ASCII) |\n| stp | string | [Self Trade Prevention](https://www.kucoin.com/docs-new/doc-338146) is divided into four strategies: CN, CO, CB , and DC |\n| price | string | Specify price for order

When placing a limit order, the price must be based on priceIncrement for the trading pair. The price increment (priceIncrement) is the price precision for the trading pair. For example, for the BTC-USDT trading pair, the priceIncrement is 0.00001000. So the price for your orders cannot be less than 0.00001000 and must be a multiple of priceIncrement. Otherwise, the order will return an invalid priceIncrement error. |\n| size | string | Specify quantity for order

When **type** is limit, size refers to the amount of trading targets (the asset name written in front) for the trading pair. Teh Size must be based on the baseIncrement of the trading pair. The baseIncrement represents the precision for the trading pair. The size of an order must be a positive-integer multiple of baseIncrement and must be between baseMinSize and baseMaxSize.

When **type** is market, select one out of two: size or funds |\n| timeInForce | string | [Time in force](https://www.kucoin.com/docs-new/doc-338146) is a special strategy used during trading |\n| postOnly | boolean | passive order labels, this is disabled when the order timing strategy is IOC or FOK |\n| hidden | boolean | [Hidden order](https://www.kucoin.com/docs-new/doc-338146) or not (not shown in order book) |\n| iceberg | boolean | Whether or not only visible portions of orders are shown in [Iceberg orders](https://www.kucoin.com/docs-new/doc-338146) |\n| visibleSize | string | Maximum visible quantity in iceberg orders |\n| tags | string | Order tag, length cannot exceed 20 characters (ASCII) |\n| cancelAfter | integer | Cancel after n seconds,the order timing strategy is GTT |\n| funds | string | When **type** is market, select one out of two: size or funds |\n\n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| orderId | string | The unique order id generated by the trading system,which can be used later for further actions such as canceling the order. |\n| clientOid | string | The user self-defined order id. |\n\n---\n", "body": { "mode": "raw", - "raw": "{\n \"symbol\": \"BTC-USDT\",\n \"orderId\": \"670fd33bf9406e0007ab3945\",\n \"newPrice\": \"30000\",\n \"newSize\": \"0.0001\"\n}", + "raw": "//limit order\n{\n \"type\": \"limit\",\n \"symbol\": \"BTC-USDT\",\n \"side\": \"buy\",\n \"price\": \"50000\",\n \"size\": \"0.00001\",\n \"clientOid\": \"5c52e11203aa677f33e493f\",\n \"remark\": \"order remarks\"\n}\n\n//market order 1\n// {\n// \"type\": \"market\",\n// \"symbol\": \"BTC-USDT\",\n// \"side\": \"buy\",\n// \"size\": \"0.00001\",\n// \"clientOid\": \"5c52e11203aa677f33e493fc\",\n// \"remark\": \"order remarks\",\n// }\n\n//market order 2\n// {\n// \"type\": \"market\",\n// \"symbol\": \"BTC-USDT\",\n// \"side\": \"buy\",\n// \"funds\": \"1\",\n// \"clientOid\": \"5c52e11203aa677f33e493fc\",\n// \"remark\": \"order remarks\",\n// }\n", "options": { "raw": { "language": "json" @@ -5308,7 +5217,7 @@ "v1", "hf", "orders", - "alter" + "test" ], "query": [] } @@ -5343,14 +5252,14 @@ } ], "cookie": [], - "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"newOrderId\": \"67112258f9406e0007408827\",\n \"clientOid\": \"client order id 12\"\n }\n}" + "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"orderId\": \"670fd33bf9406e0007ab3945\",\n \"clientOid\": \"5c52e11203aa677f33e493fb\"\n }\n}" } ] }, { - "name": "Get DCP", + "name": "Batch Add Orders", "request": { - "method": "GET", + "method": "POST", "header": [], "url": { "raw": "", @@ -5363,19 +5272,26 @@ "v1", "hf", "orders", - "dead-cancel-all", - "query" + "multi" ], "query": [] }, - "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470172)\n\n:::info[Description]\nGet Disconnection Protect(Deadman Swich)Through this interface, you can query the settings of automatic order cancellation\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| timeout | integer | Auto cancel order trigger setting time, the unit is second. range: timeout=-1 (meaning unset) or 5 <= timeout <= 86400 |\n| symbols | string | List of trading pairs. Separated by commas, empty means all trading pairs |\n| currentTime | integer | System current time (in seconds) |\n| triggerTime | integer | Trigger cancellation time (in seconds) |\n\n---\n", - "body": {} + "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470168)\n\n:::info[Description]\nThis endpoint supports sequential batch order placement from a single endpoint. A maximum of 20 orders can be placed simultaneously.\n:::\n\n\n\n:::tip[Tips]\nThis endpoint only supports order placement requests. To obtain the results of the order placement, you will need to check the order status or subscribe to websocket to obtain information about he order.\n:::\n\n:::tip[Tips]\nPlease note that once your order enters the order book, the system will freeze the handling fees for the order ahead of time.\n\nBefore placing orders, please be sure to fully understand the meaning of the parameters for each trading pair.\n:::\n\n:::tip[Tips]\nThe maximum number of active orders per account is 2000, with a maximum of 200 active orders per trading pair.\n:::\n\n**Public order placement request parameters**\n\n| Param | Type | Mandatory | Description |\n| --------- | ------ | --------- | ----------- |\n| clientOid | String | No | Client Order Id,unique identifier created by the user, the use of UUID is recommended |\n| symbol | String | Yes | symbol |\n| type | String | Yes | Order type `limit` and `market` |\n| side | String | Yes | `buy` or `sell` |\n| stp | String | No | self trade prevention is divided into four strategies: `CN`, `CO`, `CB` , and `DC` |\n| tags | String | No | Order tag, length cannot exceed `20` characters (ASCII) |\n| remark | String | No | Order placement remarks, length cannot exceed `20` characters (ASCII) |\n\n**Additional Request Parameters Required by `limit` Orders**\n\n| Param | Type | Mandatory | Description |\n| ----------- | ------- | --------- | ----------- |\n| price | String | Yes | Specify price for currency |\n| size | String | Yes | Specify quantity for currency |\n| timeInForce | String | No | Order timing strategy `GTC`, `GTT`, `IOC`, `FOK` (The default is `GTC`) |\n| cancelAfter | long | No | Cancel after `n` seconds,the order timing strategy is `GTT` |\n| postOnly | boolean | No | passive order labels, this is disabled when the order timing strategy is `IOC` or `FOK` |\n| hidden | boolean | No | Hidden or not (not shown in order book) |\n| iceberg | boolean | No | Whether or not only visible portions of orders are shown in iceberg orders |\n| visibleSize | String | No | Maximum visible quantity in iceberg orders |\n\n**Additional request parameters required by `market` orders**\n\n| Param | Type | Mandatory | Description |\n| ----- | ------ | --------- | ------------------------------------------ |\n| size | String | No | (Select one out of two: `size` or `funds`) |\n| funds | String | No | (Select one out of two: `size` or `funds`) |\n\n\n**Hold**\n\nFor limit price purchase orders, we will hold the amount of funds (price * size) required for your purchase order. Similarly, for limit price sell orders, we will also hold you sell order assets. When the transaction is executed, the service fees will be calculated. If you cancel a portion of a filled or unfilled order, then the remaining funds or amounts will be released and returned to your account. For market price buy/sell orders that require specific funds, we will hold the required funds in from your account. If only the size is specified, we may freeze (usually for a very short amount of time) all of the funds in your account prior to the order being filled or cancelled.\n\n\n**Order Lifecycle**\n\nWhen an order placement request is successful (the matching engine receives the order) or denied (due to there being insufficient funds or illegal parameter values, etc.), the system will respond to the HTTP request. When an order is successfully placed, the order ID is returned. The order will be matched, which could result in it being fully or partially filled. When an order is fully or partially filled, the remaining portions of the order will be in an active state awaiting to be matched (this does not include IOC orders). Orders that are fully or partially filled(already cancelled) will be put into the “done” state.\n\nUsers that have subscribed to the Market Data Channel can use the order ID (orderId) and client ID (clientOid) to identify messages.\n\n**Price Protection Mechanisms**\n\nPrice protection mechanisms ae enabled for order placements. Rules are detailed below:\n\n- If the spot trading market order/limit order placed by the user can be directly matched with an order in the current order book, the system will judge whether deviation between the price corresponding to the transaction depth and the spread exceeds the threshold value (the threshold value can be obtained using the symbol API endpoint);\n\n- If it is exceeded, for limit orders, the order will be directly cancelled;\n\n- If it is a market order, then the system will partially execute the order. The execution limit will be the order size within the price range corresponding to the threshold value. The remaining orders will not be filled.\n\nFor example: if the threshold value is 10%, when a user places a market price purchase order in the KCS/USDT trading market for 10,000 USDT (the selling price is currently 1.20000), the system will determine that after the order is completely filled, the final price will be 1.40000. (1.40000-1.20000)/1.20000=16.7%>10%. The threshold value is 1.32000. The user’s market price purchase order will be filled only to a maximum of 1.32000. The remaining order portions will not be matched with orders in the order book. Note: this feature may not be able to determine depth with complete accuracy. If your order is not completely filled, it may be because the portion exceeding the threshold value was not filled.\n\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| orderList | array | Refer to the schema section of orderList |\n\n**root.orderList Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| clientOid | string | Client Order Id,The ClientOid field is a unique ID created by the user(we recommend using a UUID), and can only contain numbers, letters, underscores (_), and hyphens (-). This field is returned when order information is obtained. You can use clientOid to tag your orders. ClientOid is different from the order ID created by the service provider. Please do not initiate requests using the same clientOid. The maximum length for the ClientOid is 40 characters.
|\n| symbol | string | symbol |\n| type | string | Specify if the order is an 'limit' order or 'market' order. |\n| timeInForce | string | [Time in force](https://www.kucoin.com/docs-new/doc-338146) is a special strategy used during trading |\n| side | string | Specify if the order is to 'buy' or 'sell' |\n| price | string | Specify price for order |\n| size | string | Specify quantity for order

When **type** is limit, select one out of two: size or funds, size refers to the amount of trading targets (the asset name written in front) for the trading pair. Teh Size must be based on the baseIncrement of the trading pair. The baseIncrement represents the precision for the trading pair. The size of an order must be a positive-integer multiple of baseIncrement and must be between baseMinSize and baseMaxSize.

When **type** is market, select one out of two: size or funds |\n| stp | string | [Self Trade Prevention](https://www.kucoin.com/docs-new/doc-338146) is divided into four strategies: CN, CO, CB , and DC |\n| cancelAfter | integer | Cancel after n seconds,the order timing strategy is GTT |\n| postOnly | boolean | passive order labels, this is disabled when the order timing strategy is IOC or FOK |\n| hidden | boolean | [Hidden order](https://www.kucoin.com/docs-new/doc-338146) or not (not shown in order book) |\n| iceberg | boolean | Whether or not only visible portions of orders are shown in [Iceberg orders](https://www.kucoin.com/docs-new/doc-338146) |\n| visibleSize | string | Maximum visible quantity in iceberg orders |\n| tags | string | Order tag, length cannot exceed 20 characters (ASCII) |\n| remark | string | Order placement remarks, length cannot exceed 20 characters (ASCII) |\n| funds | string | When **type** is market, select one out of two: size or funds |\n\n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | array | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| orderId | string | The unique order id generated by the trading system,which can be used later for further actions such as canceling the order. |\n| clientOid | string | The user self-defined order id. |\n| success | boolean | Add order success/failure |\n| failMsg | string | error message |\n\n---\n", + "body": { + "mode": "raw", + "raw": "{\n \"orderList\": [\n {\n \"clientOid\": \"client order id 12\",\n \"symbol\": \"BTC-USDT\",\n \"type\": \"limit\",\n \"side\": \"buy\",\n \"price\": \"30000\",\n \"size\": \"0.00001\"\n },\n {\n \"clientOid\": \"client order id 13\",\n \"symbol\": \"ETH-USDT\",\n \"type\": \"limit\",\n \"side\": \"sell\",\n \"price\": \"2000\",\n \"size\": \"0.00001\"\n }\n ]\n}", + "options": { + "raw": { + "language": "json" + } + } + } }, "response": [ { "name": "Successful Response", "originalRequest": { - "method": "GET", + "method": "POST", "header": [], "url": { "raw": "", @@ -5388,8 +5304,7 @@ "v1", "hf", "orders", - "dead-cancel-all", - "query" + "multi" ], "query": [] } @@ -5424,12 +5339,12 @@ } ], "cookie": [], - "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"timeout\": 5,\n \"symbols\": \"BTC-USDT,ETH-USDT\",\n \"currentTime\": 1729241305,\n \"triggerTime\": 1729241308\n }\n}" + "body": "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"orderId\": \"6710d8336afcdb0007319c27\",\n \"clientOid\": \"client order id 12\",\n \"success\": true\n },\n {\n \"success\": false,\n \"failMsg\": \"The order funds should more then 0.1 USDT.\"\n }\n ]\n}" } ] }, { - "name": "Set DCP", + "name": "Batch Add Orders Sync", "request": { "method": "POST", "header": [], @@ -5444,14 +5359,15 @@ "v1", "hf", "orders", - "dead-cancel-all" + "multi", + "sync" ], "query": [] }, - "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470173)\n\n:::info[Description]\nSet Disconnection Protect(Deadman Swich)Through this interface, Call this interface to automatically cancel all orders of the set trading pair after the specified time. If this interface is not called again for renewal or cancellation before the set time, the system will help the user to cancel the order of the corresponding trading pair. Otherwise it will not.\n:::\n\n:::tip[Tips]\nThe order cancellation delay is between 0 and 10 seconds, and the order will not be canceled in real time. When the system cancels the order, if the transaction pair status is no longer operable to cancel the order, it will not cancel the order\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| timeout | integer | Auto cancel order trigger setting time, the unit is second. range: timeout=-1 (meaning unset) or 5 <= timeout <= 86400. For example, timeout=5 means that the order will be automatically canceled if no user request is received for more than 5 seconds. When this parameter is changed, the previous setting will be overwritten. |\n| symbols | string | List of trading pairs. When this parameter is not empty, separate it with commas and support up to 50 trading pairs. Empty means all trading pairs. When this parameter is changed, the previous setting will be overwritten. |\n\n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| currentTime | integer | System current time (in seconds) |\n| triggerTime | integer | Trigger cancellation time (in seconds) |\n\n---\n", + "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470169)\n\n:::info[Description]\nThis endpoint supports sequential batch order placement from a single endpoint. A maximum of 20 orders can be placed simultaneously.\n\nThe difference between this interface and \"Batch Add Orders\" is that this interface will synchronously return the order information after the order matching is completed.\n\nFor higher latency requirements, please select the \"Batch Add Orders\" interface. If there is a requirement for returning data integrity, please select this interface\n:::\n\n\n\n:::tip[Tips]\nThis endpoint only supports order placement requests. To obtain the results of the order placement, you will need to check the order status or subscribe to websocket to obtain information about he order.\n:::\n\n:::tip[Tips]\nPlease note that once your order enters the order book, the system will freeze the handling fees for the order ahead of time.\n\nBefore placing orders, please be sure to fully understand the meaning of the parameters for each trading pair.\n:::\n\n:::tip[Tips]\nThe maximum number of active orders per account is 2000, with a maximum of 200 active orders per trading pair.\n:::\n\n**Public order placement request parameters**\n\n| Param | Type | Mandatory | Description |\n| --------- | ------ | --------- | ----------- |\n| clientOid | String | No | Client Order Id,unique identifier created by the user, the use of UUID is recommended |\n| symbol | String | Yes | symbol |\n| type | String | Yes | Order type `limit` and `market` |\n| side | String | Yes | `buy` or `sell` |\n| stp | String | No | self trade prevention is divided into four strategies: `CN`, `CO`, `CB` , and `DC` |\n| tags | String | No | Order tag, length cannot exceed `20` characters (ASCII) |\n| remark | String | No | Order placement remarks, length cannot exceed `20` characters (ASCII) |\n\n**Additional Request Parameters Required by `limit` Orders**\n\n| Param | Type | Mandatory | Description |\n| ----------- | ------- | --------- | ----------- |\n| price | String | Yes | Specify price for currency |\n| size | String | Yes | Specify quantity for currency |\n| timeInForce | String | No | Order timing strategy `GTC`, `GTT`, `IOC`, `FOK` (The default is `GTC`) |\n| cancelAfter | long | No | Cancel after `n` seconds,the order timing strategy is `GTT` |\n| postOnly | boolean | No | passive order labels, this is disabled when the order timing strategy is `IOC` or `FOK` |\n| hidden | boolean | No | Hidden or not (not shown in order book) |\n| iceberg | boolean | No | Whether or not only visible portions of orders are shown in iceberg orders |\n| visibleSize | String | No | Maximum visible quantity in iceberg orders |\n\n**Additional request parameters required by `market` orders**\n\n| Param | Type | Mandatory | Description |\n| ----- | ------ | --------- | ------------------------------------------ |\n| size | String | No | (Select one out of two: `size` or `funds`) |\n| funds | String | No | (Select one out of two: `size` or `funds`) |\n\n\n**Hold**\n\nFor limit price purchase orders, we will hold the amount of funds (price * size) required for your purchase order. Similarly, for limit price sell orders, we will also hold you sell order assets. When the transaction is executed, the service fees will be calculated. If you cancel a portion of a filled or unfilled order, then the remaining funds or amounts will be released and returned to your account. For market price buy/sell orders that require specific funds, we will hold the required funds in from your account. If only the size is specified, we may freeze (usually for a very short amount of time) all of the funds in your account prior to the order being filled or cancelled.\n\n\n**Order Lifecycle**\n\nWhen an order placement request is successful (the matching engine receives the order) or denied (due to there being insufficient funds or illegal parameter values, etc.), the system will respond to the HTTP request. When an order is successfully placed, the order ID is returned. The order will be matched, which could result in it being fully or partially filled. When an order is fully or partially filled, the remaining portions of the order will be in an active state awaiting to be matched (this does not include IOC orders). Orders that are fully or partially filled(already cancelled) will be put into the “done” state.\n\nUsers that have subscribed to the Market Data Channel can use the order ID (orderId) and client ID (clientOid) to identify messages.\n\n**Price Protection Mechanisms**\n\nPrice protection mechanisms ae enabled for order placements. Rules are detailed below:\n\n- If the spot trading market order/limit order placed by the user can be directly matched with an order in the current order book, the system will judge whether deviation between the price corresponding to the transaction depth and the spread exceeds the threshold value (the threshold value can be obtained using the symbol API endpoint);\n\n- If it is exceeded, for limit orders, the order will be directly cancelled;\n\n- If it is a market order, then the system will partially execute the order. The execution limit will be the order size within the price range corresponding to the threshold value. The remaining orders will not be filled.\n\nFor example: if the threshold value is 10%, when a user places a market price purchase order in the KCS/USDT trading market for 10,000 USDT (the selling price is currently 1.20000), the system will determine that after the order is completely filled, the final price will be 1.40000. (1.40000-1.20000)/1.20000=16.7%>10%. The threshold value is 1.32000. The user’s market price purchase order will be filled only to a maximum of 1.32000. The remaining order portions will not be matched with orders in the order book. Note: this feature may not be able to determine depth with complete accuracy. If your order is not completely filled, it may be because the portion exceeding the threshold value was not filled.\n\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| orderList | array | Refer to the schema section of orderList |\n\n**root.orderList Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| clientOid | string | Client Order Id,The ClientOid field is a unique ID created by the user(we recommend using a UUID), and can only contain numbers, letters, underscores (_), and hyphens (-). This field is returned when order information is obtained. You can use clientOid to tag your orders. ClientOid is different from the order ID created by the service provider. Please do not initiate requests using the same clientOid. The maximum length for the ClientOid is 40 characters.
|\n| symbol | string | symbol |\n| type | string | Specify if the order is an 'limit' order or 'market' order. |\n| timeInForce | string | [Time in force](https://www.kucoin.com/docs-new/doc-338146) is a special strategy used during trading |\n| side | string | Specify if the order is to 'buy' or 'sell' |\n| price | string | Specify price for order |\n| size | string | Specify quantity for order

When **type** is limit, select one out of two: size or funds, size refers to the amount of trading targets (the asset name written in front) for the trading pair. Teh Size must be based on the baseIncrement of the trading pair. The baseIncrement represents the precision for the trading pair. The size of an order must be a positive-integer multiple of baseIncrement and must be between baseMinSize and baseMaxSize.

When **type** is market, select one out of two: size or funds |\n| stp | string | [Self Trade Prevention](https://www.kucoin.com/docs-new/doc-338146) is divided into four strategies: CN, CO, CB , and DC |\n| cancelAfter | integer | Cancel after n seconds,the order timing strategy is GTT |\n| postOnly | boolean | passive order labels, this is disabled when the order timing strategy is IOC or FOK |\n| hidden | boolean | [Hidden order](https://www.kucoin.com/docs-new/doc-338146) or not (not shown in order book) |\n| iceberg | boolean | Whether or not only visible portions of orders are shown in [Iceberg orders](https://www.kucoin.com/docs-new/doc-338146) |\n| visibleSize | string | Maximum visible quantity in iceberg orders |\n| tags | string | Order tag, length cannot exceed 20 characters (ASCII) |\n| remark | string | Order placement remarks, length cannot exceed 20 characters (ASCII) |\n| funds | string | When **type** is market, select one out of two: size or funds |\n\n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | array | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| orderId | string | The unique order id generated by the trading system,which can be used later for further actions such as canceling the order. |\n| clientOid | string | The user self-defined order id. |\n| orderTime | integer | |\n| originSize | string | original order size |\n| dealSize | string | deal size |\n| remainSize | string | remain size |\n| canceledSize | string | Cumulative canceled size |\n| status | string | Order Status. open:order is active; done:order has been completed |\n| matchTime | integer | |\n| success | boolean | Add order success/failure |\n| failMsg | string | error message |\n\n---\n", "body": { "mode": "raw", - "raw": "{\n \"timeout\": 5,\n \"symbols\": \"BTC-USDT,ETH-USDT\"\n}", + "raw": "{\n \"orderList\": [\n {\n \"clientOid\": \"client order id 13\",\n \"symbol\": \"BTC-USDT\",\n \"type\": \"limit\",\n \"side\": \"buy\",\n \"price\": \"30000\",\n \"size\": \"0.00001\"\n },\n {\n \"clientOid\": \"client order id 14\",\n \"symbol\": \"ETH-USDT\",\n \"type\": \"limit\",\n \"side\": \"sell\",\n \"price\": \"2000\",\n \"size\": \"0.00001\"\n }\n ]\n}", "options": { "raw": { "language": "json" @@ -5476,7 +5392,8 @@ "v1", "hf", "orders", - "dead-cancel-all" + "multi", + "sync" ], "query": [] } @@ -5511,7 +5428,7 @@ } ], "cookie": [], - "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"currentTime\": 1729656588,\n \"triggerTime\": 1729656593\n }\n}" + "body": "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"orderId\": \"6711195e5584bc0007bd5aef\",\n \"clientOid\": \"client order id 13\",\n \"orderTime\": 1729173854299,\n \"originSize\": \"0.00001\",\n \"dealSize\": \"0\",\n \"remainSize\": \"0.00001\",\n \"canceledSize\": \"0\",\n \"status\": \"open\",\n \"matchTime\": 1729173854326,\n \"success\": true\n },\n {\n \"success\": false,\n \"failMsg\": \"The order funds should more then 0.1 USDT.\"\n }\n ]\n}" } ] }, @@ -5607,7 +5524,7 @@ ] }, { - "name": "Cancel Stop Order By OrderId", + "name": "Cancel Order By OrderId Sync", "request": { "method": "DELETE", "header": [], @@ -5620,12 +5537,20 @@ "path": [ "api", "v1", - "stop-order", + "hf", + "orders", + "sync", "{{orderId}}" ], - "query": [] + "query": [ + { + "key": "symbol", + "value": "BTC-USDT", + "description": "symbol" + } + ] }, - "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470335)\n\n:::info[Description]\nRequest via this endpoint to cancel a single stop order previously placed.\n\nYou will receive cancelledOrderIds field once the system has received the cancellation request. The cancellation request will be processed by the matching engine in sequence. To know if the request is processed (successfully or not), you may check the order status or the update message from the websocket pushes.\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| cancelledOrderIds | array | Refer to the schema section of cancelledOrderIds |\n\n---\n", + "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470185)\n\n:::info[Description]\nThis endpoint can be used to cancel a spot order by orderId.\n\nThe difference between this interface and \"Cancel Order By OrderId\" is that this interface will synchronously return the order information after the order canceling is completed.\n\nFor higher latency requirements, please select the \"Cancel Order By OrderId\" interface. If there is a requirement for returning data integrity, please select this interface\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| orderId | string | order id |\n| originSize | string | original order size |\n| dealSize | string | deal size |\n| remainSize | string | remain size |\n| canceledSize | string | Cumulative canceled size |\n| status | string | Order Status. open:order is active; done:order has been completed |\n\n---\n", "body": {} }, "response": [ @@ -5643,10 +5568,18 @@ "path": [ "api", "v1", - "stop-order", + "hf", + "orders", + "sync", "{{orderId}}" ], - "query": [] + "query": [ + { + "key": "symbol", + "value": "BTC-USDT", + "description": "symbol" + } + ] } }, "status": "OK", @@ -5679,12 +5612,12 @@ } ], "cookie": [], - "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"cancelledOrderIds\": [\n \"671124f9365ccb00073debd4\"\n ]\n }\n}" + "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"orderId\": \"671128ee365ccb0007534d45\",\n \"originSize\": \"0.00001\",\n \"dealSize\": \"0\",\n \"remainSize\": \"0\",\n \"canceledSize\": \"0.00001\",\n \"status\": \"done\"\n }\n}" } ] }, { - "name": "Cancel All Orders By Symbol", + "name": "Cancel Order By ClientOid", "request": { "method": "DELETE", "header": [], @@ -5698,7 +5631,9 @@ "api", "v1", "hf", - "orders" + "orders", + "client-order", + "{{clientOid}}" ], "query": [ { @@ -5708,7 +5643,7 @@ } ] }, - "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470175)\n\n:::info[Description]\nThis endpoint can cancel all spot orders for specific symbol.\nThis endpoint only sends cancellation requests. The results of the requests must be obtained by checking the order status or subscribing to websocket.\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | string | |\n\n---\n", + "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470184)\n\n:::info[Description]\nThis endpoint can be used to cancel a spot order by clientOid.\nThis endpoint only sends cancellation requests. The results of the requests must be obtained by checking the order status or subscribing to websocket.\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| clientOid | string | Client Order Id,unique identifier created by the user |\n\n---\n", "body": {} }, "response": [ @@ -5727,7 +5662,9 @@ "api", "v1", "hf", - "orders" + "orders", + "client-order", + "{{clientOid}}" ], "query": [ { @@ -5768,12 +5705,12 @@ } ], "cookie": [], - "body": "{\n \"code\": \"200000\",\n \"data\": \"success\"\n}" + "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"clientOid\": \"5c52e11203aa677f33e493fb\"\n }\n}" } ] }, { - "name": "Cancel All Orders", + "name": "Cancel Order By ClientOid Sync", "request": { "method": "DELETE", "header": [], @@ -5788,11 +5725,19 @@ "v1", "hf", "orders", - "cancelAll" + "sync", + "client-order", + "{{clientOid}}" ], - "query": [] + "query": [ + { + "key": "symbol", + "value": "BTC-USDT", + "description": "symbol" + } + ] }, - "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470176)\n\n:::info[Description]\nThis endpoint can cancel all spot orders for all symbol.\nThis endpoint only sends cancellation requests. The results of the requests must be obtained by checking the order status or subscribing to websocket.\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| succeedSymbols | array | Refer to the schema section of succeedSymbols |\n| failedSymbols | array | Refer to the schema section of failedSymbols |\n\n**root.data.failedSymbols Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| symbol | string | symbol |\n| error | string | error message |\n\n---\n", + "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470186)\n\n:::info[Description]\nThis endpoint can be used to cancel a spot order by clientOid.\n\nThe difference between this interface and \"Cancel Order By ClientOid\" is that this interface will synchronously return the order information after the order canceling is completed.\n\nFor higher latency requirements, please select the \"Cancel Order By ClientOid\" interface. If there is a requirement for returning data integrity, please select this interface\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| clientOid | string | Client Order Id,unique identifier created by the user |\n| originSize | string | original order size |\n| dealSize | string | deal size |\n| remainSize | string | remain size |\n| canceledSize | string | Cumulative canceled size |\n| status | string | Order Status. open:order is active; done:order has been completed |\n\n---\n", "body": {} }, "response": [ @@ -5812,9 +5757,17 @@ "v1", "hf", "orders", - "cancelAll" + "sync", + "client-order", + "{{clientOid}}" ], - "query": [] + "query": [ + { + "key": "symbol", + "value": "BTC-USDT", + "description": "symbol" + } + ] } }, "status": "OK", @@ -5847,12 +5800,12 @@ } ], "cookie": [], - "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"succeedSymbols\": [\n \"ETH-USDT\",\n \"BTC-USDT\"\n ],\n \"failedSymbols\": []\n }\n}" + "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"clientOid\": \"5c52e11203aa677f33e493fb\",\n \"originSize\": \"0.00001\",\n \"dealSize\": \"0\",\n \"remainSize\": \"0\",\n \"canceledSize\": \"0.00001\",\n \"status\": \"done\"\n }\n}" } ] }, { - "name": "Cancel OCO Order By OrderId", + "name": "Cancel Partial Order", "request": { "method": "DELETE", "header": [], @@ -5864,14 +5817,26 @@ ], "path": [ "api", - "v3", - "oco", - "order", + "v1", + "hf", + "orders", + "cancel", "{{orderId}}" ], - "query": [] + "query": [ + { + "key": "symbol", + "value": "BTC-USDT", + "description": "symbol" + }, + { + "key": "cancelSize", + "value": "0.00001", + "description": "The size you want cancel" + } + ] }, - "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470354)\n\n:::info[Description]\nRequest via this endpoint to cancel a single oco order previously placed.\n\nYou will receive cancelledOrderIds field once the system has received the cancellation request. The cancellation request will be processed by the matching engine in sequence. To know if the request is processed (successfully or not), you may check the order status or the update message from the pushes.\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| cancelledOrderIds | array | Refer to the schema section of cancelledOrderIds |\n\n---\n", + "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470183)\n\n:::info[Description]\nThis interface can cancel the specified quantity of the order according to the orderId.\nThe order execution order is: price first, time first, this interface will not change the queue order\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| orderId | string | order id |\n| cancelSize | string | The size you canceled |\n\n---\n", "body": {} }, "response": [ @@ -5888,12 +5853,24 @@ ], "path": [ "api", - "v3", - "oco", - "order", + "v1", + "hf", + "orders", + "cancel", "{{orderId}}" ], - "query": [] + "query": [ + { + "key": "symbol", + "value": "BTC-USDT", + "description": "symbol" + }, + { + "key": "cancelSize", + "value": "0.00001", + "description": "The size you want cancel" + } + ] } }, "status": "OK", @@ -5926,14 +5903,14 @@ } ], "cookie": [], - "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"cancelledOrderIds\": [\n \"vs93gpqc6kkmkk57003gok16\",\n \"vs93gpqc6kkmkk57003gok17\"\n ]\n }\n}" + "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"orderId\": \"6711f73c1ef16c000717bb31\",\n \"cancelSize\": \"0.00001\"\n }\n}" } ] }, { - "name": "Get Symbols With Open Order", + "name": "Cancel All Orders By Symbol", "request": { - "method": "GET", + "method": "DELETE", "header": [], "url": { "raw": "", @@ -5945,20 +5922,24 @@ "api", "v1", "hf", - "orders", - "active", - "symbols" + "orders" ], - "query": [] + "query": [ + { + "key": "symbol", + "value": "BTC-USDT", + "description": "symbol" + } + ] }, - "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470177)\n\n:::info[Description]\nThis interface can query all spot symbol that has active orders\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| symbols | array | Refer to the schema section of symbols |\n\n---\n", + "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470175)\n\n:::info[Description]\nThis endpoint can cancel all spot orders for specific symbol.\nThis endpoint only sends cancellation requests. The results of the requests must be obtained by checking the order status or subscribing to websocket.\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | string | |\n\n---\n", "body": {} }, "response": [ { "name": "Successful Response", "originalRequest": { - "method": "GET", + "method": "DELETE", "header": [], "url": { "raw": "", @@ -5970,11 +5951,15 @@ "api", "v1", "hf", - "orders", - "active", - "symbols" + "orders" ], - "query": [] + "query": [ + { + "key": "symbol", + "value": "BTC-USDT", + "description": "symbol" + } + ] } }, "status": "OK", @@ -6007,14 +5992,14 @@ } ], "cookie": [], - "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"symbols\": [\n \"ETH-USDT\",\n \"BTC-USDT\"\n ]\n }\n}" + "body": "{\n \"code\": \"200000\",\n \"data\": \"success\"\n}" } ] }, { - "name": "Get Open Orders", + "name": "Cancel All Orders", "request": { - "method": "GET", + "method": "DELETE", "header": [], "url": { "raw": "", @@ -6027,24 +6012,18 @@ "v1", "hf", "orders", - "active" + "cancelAll" ], - "query": [ - { - "key": "symbol", - "value": "BTC-USDT", - "description": "symbol" - } - ] + "query": [] }, - "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470178)\n\n:::info[Description]\nThis interface is to obtain all Spot active order lists, and the return value of the active order interface is the paged data of all uncompleted order lists. The returned data is sorted in descending order according to the latest update time of the order.\n\nAfter the user successfully places an order, the order is in Active state, and the user can use inOrderBook to determine whether the order has entered the order. Canceled or fully filled orders are marked as completed Done status.\n:::\n\n:::tip[Tips]\nFor high-frequency trading users, we recommend locally caching, maintaining your own order records, and using market data streams to update your order information in real time.\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | array | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| id | string | The unique order id generated by the trading system |\n| symbol | string | symbol |\n| opType | string | |\n| type | string | Specify if the order is an 'limit' order or 'market' order. |\n| side | string | Buy or sell |\n| price | string | Order price |\n| size | string | Order size |\n| funds | string | Order Funds |\n| dealSize | string | Number of filled transactions |\n| dealFunds | string | Funds of filled transactions |\n| fee | string | [Handling fees](https://www.kucoin.com/docs-new/api-5327739) |\n| feeCurrency | string | currency used to calculate trading fee |\n| stp | string | [Self Trade Prevention](https://www.kucoin.com/docs-new/api-5176570) |\n| timeInForce | string | Time in force |\n| postOnly | boolean | Whether its a postOnly order. |\n| hidden | boolean | Whether its a hidden order. |\n| iceberg | boolean | Whether its a iceberg order. |\n| visibleSize | string | Visible size of iceberg order in order book. |\n| cancelAfter | integer | A GTT timeInForce that expires in n seconds |\n| channel | string | |\n| clientOid | string | Client Order Id,unique identifier created by the user |\n| remark | string | Order placement remarks |\n| tags | string | Order tag |\n| cancelExist | boolean | Whether there is a cancellation record for the order. |\n| createdAt | integer | |\n| lastUpdatedAt | integer | |\n| tradeType | string | Trade type, redundancy param |\n| inOrderBook | boolean | Whether to enter the orderbook: true: enter the orderbook; false: not enter the orderbook |\n| cancelledSize | string | Number of canceled transactions |\n| cancelledFunds | string | Funds of canceled transactions |\n| remainSize | string | Number of remain transactions |\n| remainFunds | string | Funds of remain transactions |\n| tax | string | Users in some regions need query this field |\n| active | boolean | Order status: true-The status of the order isactive; false-The status of the order is done |\n\n---\n", + "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470176)\n\n:::info[Description]\nThis endpoint can cancel all spot orders for all symbol.\nThis endpoint only sends cancellation requests. The results of the requests must be obtained by checking the order status or subscribing to websocket.\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| succeedSymbols | array | Refer to the schema section of succeedSymbols |\n| failedSymbols | array | Refer to the schema section of failedSymbols |\n\n**root.data.failedSymbols Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| symbol | string | symbol |\n| error | string | error message |\n\n---\n", "body": {} }, "response": [ { "name": "Successful Response", "originalRequest": { - "method": "GET", + "method": "DELETE", "header": [], "url": { "raw": "", @@ -6057,15 +6036,9 @@ "v1", "hf", "orders", - "active" + "cancelAll" ], - "query": [ - { - "key": "symbol", - "value": "BTC-USDT", - "description": "symbol" - } - ] + "query": [] } }, "status": "OK", @@ -6098,14 +6071,14 @@ } ], "cookie": [], - "body": "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"id\": \"67120bbef094e200070976f6\",\n \"clientOid\": \"5c52e11203aa677f33e493fb\",\n \"symbol\": \"BTC-USDT\",\n \"opType\": \"DEAL\",\n \"type\": \"limit\",\n \"side\": \"buy\",\n \"price\": \"50000\",\n \"size\": \"0.00001\",\n \"funds\": \"0.5\",\n \"dealSize\": \"0\",\n \"dealFunds\": \"0\",\n \"fee\": \"0\",\n \"feeCurrency\": \"USDT\",\n \"stp\": null,\n \"timeInForce\": \"GTC\",\n \"postOnly\": false,\n \"hidden\": false,\n \"iceberg\": false,\n \"visibleSize\": \"0\",\n \"cancelAfter\": 0,\n \"channel\": \"API\",\n \"remark\": \"order remarks\",\n \"tags\": \"order tags\",\n \"cancelExist\": false,\n \"tradeType\": \"TRADE\",\n \"inOrderBook\": true,\n \"cancelledSize\": \"0\",\n \"cancelledFunds\": \"0\",\n \"remainSize\": \"0.00001\",\n \"remainFunds\": \"0.5\",\n \"tax\": \"0\",\n \"active\": true,\n \"createdAt\": 1729235902748,\n \"lastUpdatedAt\": 1729235909862\n }\n ]\n}" + "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"succeedSymbols\": [\n \"ETH-USDT\",\n \"BTC-USDT\"\n ],\n \"failedSymbols\": []\n }\n}" } ] }, { - "name": "Get Stop Orders List", + "name": "Modify Order", "request": { - "method": "GET", + "method": "POST", "header": [], "url": { "raw": "", @@ -6116,11 +6089,13 @@ "path": [ "api", "v1", - "stop-order" + "hf", + "orders", + "alter" ], "query": [] }, - "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470338)\n\n:::info[Description]\nRequest via this endpoint to get your current untriggered stop order list. Items are paginated and sorted to show the latest first. See the Pagination section for retrieving additional entries after the first page.\n\n:::\n\n\n:::tip[Example]\n```json\n{\n \"currentPage\": 1,\n \"pageSize\": 50,\n \"totalNum\": 1,\n \"totalPage\": 1,\n \"items\": [\n {\n \"id\": \"vs8hoo8kqjnklv4m0038lrfq\",\n \"symbol\": \"KCS-USDT\",\n \"userId\": \"60fe4956c43cbc0006562c2c\",\n \"status\": \"NEW\",\n \"type\": \"limit\",\n \"side\": \"buy\",\n \"price\": \"0.01000000000000000000\",\n \"size\": \"0.01000000000000000000\",\n \"funds\": null,\n \"stp\": null,\n \"timeInForce\": \"GTC\",\n \"cancelAfter\": -1,\n \"postOnly\": false,\n \"hidden\": false,\n \"iceberg\": false,\n \"visibleSize\": null,\n \"channel\": \"API\",\n \"clientOid\": \"404814a0fb4311eb9098acde48001122\",\n \"remark\": null,\n \"tags\": null,\n \"orderTime\": 1628755183702150167,\n \"domainId\": \"kucoin\",\n \"tradeSource\": \"USER\",\n \"tradeType\": \"TRADE\",\n \"feeCurrency\": \"USDT\",\n \"takerFeeRate\": \"0.00200000000000000000\",\n \"makerFeeRate\": \"0.00200000000000000000\",\n \"createdAt\": 1628755183704,\n \"stop\": \"loss\",\n \"stopTriggerTime\": null,\n \"stopPrice\": \"10.00000000000000000000\"\n }\n ]\n}\n```\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| symbol | string | Only list orders for a specific symbol |\n| side | string | buy or sell |\n| type | string | limit, market, limit_stop or market_stop |\n| tradeType | string | The type of trading : TRADE(Spot), MARGIN_TRADE (Cross Margin), MARGIN_ISOLATED_TRADE (Isolated Margin). Default is TRADE |\n| startAt | number | Start time (milisecond) |\n| endAt | number | End time (milisecond) |\n| currentPage | integer | current page |\n| orderIds | string | comma seperated order ID list |\n| pageSize | integer | page size |\n| stop | string | Order type: stop: stop loss order, oco: oco order |\n\n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| currentPage | integer | current page id |\n| pageSize | integer | |\n| totalNum | integer | the stop order count |\n| totalPage | integer | total page count of the list |\n| items | array | Refer to the schema section of items |\n\n**root.data.items Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| id | string | Order ID, the ID of an order. |\n| symbol | string | Symbol name |\n| userId | string | User ID |\n| status | string | Order status, include NEW, TRIGGERED |\n| type | string | Order type,limit, market, limit_stop or market_stop |\n| side | string | transaction direction,include buy and sell |\n| price | string | order price |\n| size | string | order quantity |\n| funds | string | order funds |\n| stp | string | |\n| timeInForce | string | time InForce,include GTC,GTT,IOC,FOK |\n| cancelAfter | integer | cancel orders after n seconds,requires timeInForce to be GTT |\n| postOnly | boolean | postOnly |\n| hidden | boolean | hidden order |\n| iceberg | boolean | Iceberg order |\n| visibleSize | string | displayed quantity for iceberg order |\n| channel | string | order source |\n| clientOid | string | user-entered order unique mark |\n| remark | string | Remarks at stop order creation |\n| tags | string | tag order source |\n| orderTime | integer | Time of place a stop order, accurate to nanoseconds |\n| domainId | string | domainId, e.g: kucoin |\n| tradeSource | string | trade source: USER(Order by user), MARGIN_SYSTEM(Order by margin system) |\n| tradeType | string | The type of trading : TRADE(Spot), MARGIN_TRADE (Cross Margin), MARGIN_ISOLATED_TRADE (Isolated Margin). |\n| feeCurrency | string | The currency of the fee |\n| takerFeeRate | string | Fee Rate of taker |\n| makerFeeRate | string | Fee Rate of maker |\n| createdAt | integer | order creation time |\n| stop | string | Stop order type, include loss and entry |\n| stopTriggerTime | integer | The trigger time of the stop order |\n| stopPrice | string | stop price |\n\n---\n", + "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470171)\n\n:::info[Description]\nThis interface can modify the price and quantity of the order according to orderId or clientOid.\n\nThe implementation of this interface is: cancel the order and place a new order on the same trading pair, and return the modification result to the client synchronously\n\nWhen the quantity of the new order updated by the user is less than the filled quantity of this order, the order will be considered as completed, and the order will be cancelled, and no new order will be placed\n:::\n\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| clientOid | string | The old client order id,orderId and clientOid must choose one |\n| symbol | string | symbol |\n| orderId | string | The old order id, orderId and clientOid must choose one |\n| newPrice | string | The modified price of the new order, newPrice and newSize must choose one |\n| newSize | string | The modified size of the new order, newPrice and newSize must choose one |\n\n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| newOrderId | string | The new order id |\n| clientOid | string | The original client order id |\n\n---\n", "body": { "mode": "raw", "raw": "{\n \"symbol\": \"BTC-USDT\",\n \"orderId\": \"670fd33bf9406e0007ab3945\",\n \"newPrice\": \"30000\",\n \"newSize\": \"0.0001\"\n}", @@ -6135,7 +6110,7 @@ { "name": "Successful Response", "originalRequest": { - "method": "GET", + "method": "POST", "header": [], "url": { "raw": "", @@ -6146,7 +6121,9 @@ "path": [ "api", "v1", - "stop-order" + "hf", + "orders", + "alter" ], "query": [] } @@ -6181,12 +6158,12 @@ } ], "cookie": [], - "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"currentPage\": 1,\n \"pageSize\": 50,\n \"totalNum\": 1,\n \"totalPage\": 1,\n \"items\": [\n {\n \"id\": \"vs8hoo8kqjnklv4m0038lrfq\",\n \"symbol\": \"KCS-USDT\",\n \"userId\": \"60fe4956c43cbc0006562c2c\",\n \"status\": \"NEW\",\n \"type\": \"limit\",\n \"side\": \"buy\",\n \"price\": \"0.01000000000000000000\",\n \"size\": \"0.01000000000000000000\",\n \"funds\": null,\n \"stp\": null,\n \"timeInForce\": \"GTC\",\n \"cancelAfter\": -1,\n \"postOnly\": false,\n \"hidden\": false,\n \"iceberg\": false,\n \"visibleSize\": null,\n \"channel\": \"API\",\n \"clientOid\": \"404814a0fb4311eb9098acde48001122\",\n \"remark\": null,\n \"tags\": null,\n \"orderTime\": 1628755183702150100,\n \"domainId\": \"kucoin\",\n \"tradeSource\": \"USER\",\n \"tradeType\": \"TRADE\",\n \"feeCurrency\": \"USDT\",\n \"takerFeeRate\": \"0.00200000000000000000\",\n \"makerFeeRate\": \"0.00200000000000000000\",\n \"createdAt\": 1628755183704,\n \"stop\": \"loss\",\n \"stopTriggerTime\": null,\n \"stopPrice\": \"10.00000000000000000000\"\n }\n ]\n }\n}" + "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"newOrderId\": \"67112258f9406e0007408827\",\n \"clientOid\": \"client order id 12\"\n }\n}" } ] }, { - "name": "Get Closed Orders", + "name": "Get Order By OrderId", "request": { "method": "GET", "header": [], @@ -6201,47 +6178,17 @@ "v1", "hf", "orders", - "done" + "{{orderId}}" ], "query": [ { "key": "symbol", "value": "BTC-USDT", "description": "symbol" - }, - { - "key": "side", - "value": null, - "description": "specify if the order is to 'buy' or 'sell'" - }, - { - "key": "type", - "value": null, - "description": "specify if the order is an 'limit' order or 'market' order. " - }, - { - "key": "lastId", - "value": "254062248624417", - "description": "The id of the last set of data from the previous batch of data. By default, the latest information is given.\nlastId is used to filter data and paginate. If lastId is not entered, the default is a maximum of 100 returned data items. The return results include lastId,which can be used as a query parameter to look up new data from the next page." - }, - { - "key": "limit", - "value": "20", - "description": "Default20,Max100" - }, - { - "key": "startAt", - "value": "1728663338000", - "description": "Start time (milisecond)" - }, - { - "key": "endAt", - "value": "1728692138000", - "description": "End time (milisecond)" } ] }, - "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470179)\n\n:::info[Description]\nThis interface is to obtain all Spot Closed order lists, and the return value of the active order interface is the paged data of all uncompleted order lists. The returned data is sorted in descending order according to the latest update time of the order.\n\nAfter the user successfully places an order, the order is in Active state, and the user can use inOrderBook to determine whether the order has entered the order. Canceled or fully filled orders are marked as completed Done status.\n:::\n\n:::tip[Tips]\nIf the order is not an active order, you can only get data within the time range of 3 _ 24 hours (ie: from the current time to 3 _ 24 hours ago). If the time range is exceeded, the system will query the data within the time range of 3 * 24 hours by default.\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| lastId | integer | The id of the last set of data from the previous batch of data. By default, the latest information is given.
lastId is used to filter data and paginate. If lastId is not entered, the default is a maximum of 100 returned data items. The return results include lastId,which can be used as a query parameter to look up new data from the next page. |\n| items | array | Refer to the schema section of items |\n\n**root.data.items Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| id | string | The unique order id generated by the trading system |\n| symbol | string | symbol |\n| opType | string | |\n| type | string | Specify if the order is an 'limit' order or 'market' order. |\n| side | string | Buy or sell |\n| price | string | Order price |\n| size | string | Order size |\n| funds | string | Order Funds |\n| dealSize | string | Number of filled transactions |\n| dealFunds | string | Funds of filled transactions |\n| fee | string | [Handling fees](https://www.kucoin.com/docs-new/api-5327739) |\n| feeCurrency | string | currency used to calculate trading fee |\n| stp | string | [Self Trade Prevention](https://www.kucoin.com/docs-new/api-5176570) |\n| timeInForce | string | Time in force |\n| postOnly | boolean | Whether its a postOnly order. |\n| hidden | boolean | Whether its a hidden order. |\n| iceberg | boolean | Whether its a iceberg order. |\n| visibleSize | string | Visible size of iceberg order in order book. |\n| cancelAfter | integer | A GTT timeInForce that expires in n seconds |\n| channel | string | |\n| clientOid | string | Client Order Id,unique identifier created by the user |\n| remark | string | Order placement remarks |\n| tags | string | Order tag |\n| cancelExist | boolean | Whether there is a cancellation record for the order. |\n| createdAt | integer | |\n| lastUpdatedAt | integer | |\n| tradeType | string | Trade type, redundancy param |\n| inOrderBook | boolean | Whether to enter the orderbook: true: enter the orderbook; false: not enter the orderbook |\n| cancelledSize | string | Number of canceled transactions |\n| cancelledFunds | string | Funds of canceled transactions |\n| remainSize | string | Number of remain transactions |\n| remainFunds | string | Funds of remain transactions |\n| tax | string | Users in some regions need query this field |\n| active | boolean | Order status: true-The status of the order isactive; false-The status of the order is done |\n\n---\n", + "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470181)\n\n:::info[Description]\nThis endpoint can be used to obtain information for a single Spot order using the order id.\n\nAfter the user successfully places an order, the order is in Active state, and the user can use inOrderBook to determine whether the order has entered the order. Canceled or fully filled orders are marked as completed Done status.\n:::\n\n:::tip[Tips]\nIf the order is not an active order, you can only get data within the time range of 3 _ 24 hours (ie: from the current time to 3 _ 24 hours ago). If the time range is exceeded, the system will query the data within the time range of 3 * 24 hours by default.\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| id | string | The unique order id generated by the trading system |\n| symbol | string | symbol |\n| opType | string | |\n| type | string | Specify if the order is an 'limit' order or 'market' order. |\n| side | string | Buy or sell |\n| price | string | Order price |\n| size | string | Order size |\n| funds | string | Order Funds |\n| dealSize | string | Number of filled transactions |\n| dealFunds | string | Funds of filled transactions |\n| fee | string | [Handling fees](https://www.kucoin.com/docs-new/api-5327739) |\n| feeCurrency | string | currency used to calculate trading fee |\n| stp | string | [Self Trade Prevention](https://www.kucoin.com/docs-new/api-5176570) |\n| timeInForce | string | Time in force |\n| postOnly | boolean | Whether its a postOnly order. |\n| hidden | boolean | Whether its a hidden order. |\n| iceberg | boolean | Whether its a iceberg order. |\n| visibleSize | string | Visible size of iceberg order in order book. |\n| cancelAfter | integer | A GTT timeInForce that expires in n seconds |\n| channel | string | |\n| clientOid | string | Client Order Id,unique identifier created by the user |\n| remark | string | Order placement remarks |\n| tags | string | Order tag |\n| cancelExist | boolean | Whether there is a cancellation record for the order. |\n| createdAt | integer | |\n| lastUpdatedAt | integer | |\n| tradeType | string | Trade type, redundancy param |\n| inOrderBook | boolean | Whether to enter the orderbook: true: enter the orderbook; false: not enter the orderbook |\n| cancelledSize | string | Number of canceled transactions |\n| cancelledFunds | string | Funds of canceled transactions |\n| remainSize | string | Number of remain transactions |\n| remainFunds | string | Funds of remain transactions |\n| tax | string | Users in some regions need query this field |\n| active | boolean | Order status: true-The status of the order isactive; false-The status of the order is done |\n\n---\n", "body": {} }, "response": [ @@ -6261,43 +6208,13 @@ "v1", "hf", "orders", - "done" + "{{orderId}}" ], "query": [ { "key": "symbol", "value": "BTC-USDT", "description": "symbol" - }, - { - "key": "side", - "value": null, - "description": "specify if the order is to 'buy' or 'sell'" - }, - { - "key": "type", - "value": null, - "description": "specify if the order is an 'limit' order or 'market' order. " - }, - { - "key": "lastId", - "value": "254062248624417", - "description": "The id of the last set of data from the previous batch of data. By default, the latest information is given.\nlastId is used to filter data and paginate. If lastId is not entered, the default is a maximum of 100 returned data items. The return results include lastId,which can be used as a query parameter to look up new data from the next page." - }, - { - "key": "limit", - "value": "20", - "description": "Default20,Max100" - }, - { - "key": "startAt", - "value": "1728663338000", - "description": "Start time (milisecond)" - }, - { - "key": "endAt", - "value": "1728692138000", - "description": "End time (milisecond)" } ] } @@ -6332,12 +6249,12 @@ } ], "cookie": [], - "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"lastId\": 19814995255305,\n \"items\": [\n {\n \"id\": \"6717422bd51c29000775ea03\",\n \"clientOid\": \"5c52e11203aa677f33e493fb\",\n \"symbol\": \"BTC-USDT\",\n \"opType\": \"DEAL\",\n \"type\": \"limit\",\n \"side\": \"buy\",\n \"price\": \"70000\",\n \"size\": \"0.00001\",\n \"funds\": \"0.7\",\n \"dealSize\": \"0.00001\",\n \"dealFunds\": \"0.677176\",\n \"remainSize\": \"0\",\n \"remainFunds\": \"0.022824\",\n \"cancelledSize\": \"0\",\n \"cancelledFunds\": \"0\",\n \"fee\": \"0.000677176\",\n \"feeCurrency\": \"USDT\",\n \"stp\": null,\n \"timeInForce\": \"GTC\",\n \"postOnly\": false,\n \"hidden\": false,\n \"iceberg\": false,\n \"visibleSize\": \"0\",\n \"cancelAfter\": 0,\n \"channel\": \"API\",\n \"remark\": \"order remarks\",\n \"tags\": null,\n \"cancelExist\": false,\n \"tradeType\": \"TRADE\",\n \"inOrderBook\": false,\n \"active\": false,\n \"tax\": \"0\",\n \"createdAt\": 1729577515444,\n \"lastUpdatedAt\": 1729577515481\n }\n ]\n }\n}" + "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"id\": \"6717422bd51c29000775ea03\",\n \"clientOid\": \"5c52e11203aa677f33e493fb\",\n \"symbol\": \"BTC-USDT\",\n \"opType\": \"DEAL\",\n \"type\": \"limit\",\n \"side\": \"buy\",\n \"price\": \"70000\",\n \"size\": \"0.00001\",\n \"funds\": \"0.7\",\n \"dealSize\": \"0.00001\",\n \"dealFunds\": \"0.677176\",\n \"remainSize\": \"0\",\n \"remainFunds\": \"0.022824\",\n \"cancelledSize\": \"0\",\n \"cancelledFunds\": \"0\",\n \"fee\": \"0.000677176\",\n \"feeCurrency\": \"USDT\",\n \"stp\": null,\n \"timeInForce\": \"GTC\",\n \"postOnly\": false,\n \"hidden\": false,\n \"iceberg\": false,\n \"visibleSize\": \"0\",\n \"cancelAfter\": 0,\n \"channel\": \"API\",\n \"remark\": \"order remarks\",\n \"tags\": null,\n \"cancelExist\": false,\n \"tradeType\": \"TRADE\",\n \"inOrderBook\": false,\n \"active\": false,\n \"tax\": \"0\",\n \"createdAt\": 1729577515444,\n \"lastUpdatedAt\": 1729577515481\n }\n}" } ] }, { - "name": "Get Stop Order By OrderId", + "name": "Get Order By ClientOid", "request": { "method": "GET", "header": [], @@ -6350,12 +6267,20 @@ "path": [ "api", "v1", - "stop-order", - "{{orderId}}" + "hf", + "orders", + "client-order", + "{{clientOid}}" ], - "query": [] + "query": [ + { + "key": "symbol", + "value": "BTC-USDT", + "description": "symbol" + } + ] }, - "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470339)\n\n:::info[Description]\nRequest via this interface to get a stop order information via the order ID.\n\n:::\n\n\n:::tip[Example]\n```json\n{\n \"id\": \"vs8hoo8q2ceshiue003b67c0\",\n \"symbol\": \"KCS-USDT\",\n \"userId\": \"60fe4956c43cbc0006562c2c\",\n \"status\": \"NEW\",\n \"type\": \"limit\",\n \"side\": \"buy\",\n \"price\": \"0.01000000000000000000\",\n \"size\": \"0.01000000000000000000\",\n \"funds\": null,\n \"stp\": null,\n \"timeInForce\": \"GTC\",\n \"cancelAfter\": -1,\n \"postOnly\": false,\n \"hidden\": false,\n \"iceberg\": false,\n \"visibleSize\": null,\n \"channel\": \"API\",\n \"clientOid\": \"40e0eb9efe6311eb8e58acde48001122\",\n \"remark\": null,\n \"tags\": null,\n \"orderTime\": 1629098781127530345,\n \"domainId\": \"kucoin\",\n \"tradeSource\": \"USER\",\n \"tradeType\": \"TRADE\",\n \"feeCurrency\": \"USDT\",\n \"takerFeeRate\": \"0.00200000000000000000\",\n \"makerFeeRate\": \"0.00200000000000000000\",\n \"createdAt\": 1629098781128,\n \"stop\": \"loss\",\n \"stopTriggerTime\": null,\n \"stopPrice\": \"10.00000000000000000000\"\n}\n```\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| symbol | string | Only list orders for a specific symbol |\n| side | string | buy or sell |\n| type | string | limit, market, limit_stop or market_stop |\n| tradeType | string | The type of trading : TRADE(Spot), MARGIN_TRADE (Cross Margin), MARGIN_ISOLATED_TRADE (Isolated Margin). Default is TRADE |\n| startAt | number | Start time (milisecond) |\n| endAt | number | End time (milisecond) |\n| currentPage | integer | current page |\n| orderIds | string | comma seperated order ID list |\n| pageSize | integer | page size |\n| stop | string | Order type: stop: stop loss order, oco: oco order |\n\n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| data | object | Refer to the schema section of data |\n| code | string | return status code |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| id | string | Order ID, the ID of an order. |\n| symbol | string | Symbol name |\n| userId | string | User ID |\n| status | string | Order status, include NEW, TRIGGERED |\n| type | string | Order type,limit, market, limit_stop or market_stop |\n| side | string | transaction direction,include buy and sell |\n| price | string | order price |\n| size | string | order quantity |\n| funds | string | order funds |\n| stp | string | |\n| timeInForce | string | time InForce,include GTC,GTT,IOC,FOK |\n| cancelAfter | integer | cancel orders after n seconds,requires timeInForce to be GTT |\n| postOnly | boolean | postOnly |\n| hidden | boolean | hidden order |\n| iceberg | boolean | Iceberg order |\n| visibleSize | string | displayed quantity for iceberg order |\n| channel | string | order source |\n| clientOid | string | user-entered order unique mark |\n| remark | string | Remarks at stop order creation |\n| tags | string | tag order source |\n| domainId | string | domainId, e.g: kucoin |\n| tradeSource | string | trade source: USER(Order by user), MARGIN_SYSTEM(Order by margin system) |\n| tradeType | string | The type of trading : TRADE(Spot), MARGIN_TRADE (Cross Margin), MARGIN_ISOLATED_TRADE (Isolated Margin). |\n| feeCurrency | string | The currency of the fee |\n| takerFeeRate | string | Fee Rate of taker |\n| makerFeeRate | string | Fee Rate of maker |\n| createdAt | integer | order creation time |\n| stop | string | Stop order type, include loss and entry |\n| stopTriggerTime | integer | The trigger time of the stop order |\n| stopPrice | string | stop price |\n| orderTime | integer | Time of place a stop order, accurate to nanoseconds |\n\n---\n", + "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470182)\n\n:::info[Description]\nThis endpoint can be used to obtain information for a single Spot order using the client order id.\n\nAfter the user successfully places an order, the order is in Active state, and the user can use inOrderBook to determine whether the order has entered the order. Canceled or fully filled orders are marked as completed Done status.\n:::\n\n:::tip[Tips]\nIf the order is not an active order, you can only get data within the time range of 3 _ 24 hours (ie: from the current time to 3 _ 24 hours ago). If the time range is exceeded, the system will query the data within the time range of 3 * 24 hours by default.\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| id | string | The unique order id generated by the trading system |\n| symbol | string | symbol |\n| opType | string | |\n| type | string | Specify if the order is an 'limit' order or 'market' order. |\n| side | string | Buy or sell |\n| price | string | Order price |\n| size | string | Order size |\n| funds | string | Order Funds |\n| dealSize | string | Number of filled transactions |\n| dealFunds | string | Funds of filled transactions |\n| fee | string | [Handling fees](https://www.kucoin.com/docs-new/api-5327739) |\n| feeCurrency | string | currency used to calculate trading fee |\n| stp | string | [Self Trade Prevention](https://www.kucoin.com/docs-new/api-5176570) |\n| timeInForce | string | Time in force |\n| postOnly | boolean | Whether its a postOnly order. |\n| hidden | boolean | Whether its a hidden order. |\n| iceberg | boolean | Whether its a iceberg order. |\n| visibleSize | string | Visible size of iceberg order in order book. |\n| cancelAfter | integer | A GTT timeInForce that expires in n seconds |\n| channel | string | |\n| clientOid | string | Client Order Id,unique identifier created by the user |\n| remark | string | Order placement remarks |\n| tags | string | Order tag |\n| cancelExist | boolean | Whether there is a cancellation record for the order. |\n| createdAt | integer | |\n| lastUpdatedAt | integer | |\n| tradeType | string | Trade type, redundancy param |\n| inOrderBook | boolean | Whether to enter the orderbook: true: enter the orderbook; false: not enter the orderbook |\n| cancelledSize | string | Number of canceled transactions |\n| cancelledFunds | string | Funds of canceled transactions |\n| remainSize | string | Number of remain transactions |\n| remainFunds | string | Funds of remain transactions |\n| tax | string | Users in some regions need query this field |\n| active | boolean | Order status: true-The status of the order isactive; false-The status of the order is done |\n\n---\n", "body": {} }, "response": [ @@ -6373,10 +6298,18 @@ "path": [ "api", "v1", - "stop-order", - "{{orderId}}" + "hf", + "orders", + "client-order", + "{{clientOid}}" ], - "query": [] + "query": [ + { + "key": "symbol", + "value": "BTC-USDT", + "description": "symbol" + } + ] } }, "status": "OK", @@ -6409,12 +6342,12 @@ } ], "cookie": [], - "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"id\": \"vs8hoo8q2ceshiue003b67c0\",\n \"symbol\": \"KCS-USDT\",\n \"userId\": \"60fe4956c43cbc0006562c2c\",\n \"status\": \"NEW\",\n \"type\": \"limit\",\n \"side\": \"buy\",\n \"price\": \"0.01000000000000000000\",\n \"size\": \"0.01000000000000000000\",\n \"funds\": null,\n \"stp\": null,\n \"timeInForce\": \"GTC\",\n \"cancelAfter\": -1,\n \"postOnly\": false,\n \"hidden\": false,\n \"iceberg\": false,\n \"visibleSize\": null,\n \"channel\": \"API\",\n \"clientOid\": \"40e0eb9efe6311eb8e58acde48001122\",\n \"remark\": null,\n \"tags\": null,\n \"orderTime\": 1629098781127530200,\n \"domainId\": \"kucoin\",\n \"tradeSource\": \"USER\",\n \"tradeType\": \"TRADE\",\n \"feeCurrency\": \"USDT\",\n \"takerFeeRate\": \"0.00200000000000000000\",\n \"makerFeeRate\": \"0.00200000000000000000\",\n \"createdAt\": 1629098781128,\n \"stop\": \"loss\",\n \"stopTriggerTime\": null,\n \"stopPrice\": \"10.00000000000000000000\"\n }\n}" + "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"id\": \"6717422bd51c29000775ea03\",\n \"clientOid\": \"5c52e11203aa677f33e493fb\",\n \"symbol\": \"BTC-USDT\",\n \"opType\": \"DEAL\",\n \"type\": \"limit\",\n \"side\": \"buy\",\n \"price\": \"70000\",\n \"size\": \"0.00001\",\n \"funds\": \"0.7\",\n \"dealSize\": \"0.00001\",\n \"dealFunds\": \"0.677176\",\n \"remainSize\": \"0\",\n \"remainFunds\": \"0.022824\",\n \"cancelledSize\": \"0\",\n \"cancelledFunds\": \"0\",\n \"fee\": \"0.000677176\",\n \"feeCurrency\": \"USDT\",\n \"stp\": null,\n \"timeInForce\": \"GTC\",\n \"postOnly\": false,\n \"hidden\": false,\n \"iceberg\": false,\n \"visibleSize\": \"0\",\n \"cancelAfter\": 0,\n \"channel\": \"API\",\n \"remark\": \"order remarks\",\n \"tags\": null,\n \"cancelExist\": false,\n \"tradeType\": \"TRADE\",\n \"inOrderBook\": false,\n \"active\": false,\n \"tax\": \"0\",\n \"createdAt\": 1729577515444,\n \"lastUpdatedAt\": 1729577515481\n }\n}" } ] }, { - "name": "Get Stop Order By ClientOid", + "name": "Get Symbols With Open Order", "request": { "method": "GET", "header": [], @@ -6427,23 +6360,14 @@ "path": [ "api", "v1", - "stop-order", - "queryOrderByClientOid" + "hf", + "orders", + "active", + "symbols" ], - "query": [ - { - "key": "clientOid", - "value": null, - "description": "The client order id" - }, - { - "key": "symbol", - "value": null, - "description": "symbol name" - } - ] + "query": [] }, - "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470340)\n\n:::info[Description]\nRequest via this interface to get a stop order information via the clientOid.\n\n:::\n\n\n:::tip[Example]\n```json\n{\n \"id\": \"vs8hoo8q2ceshiue003b67c0\",\n \"symbol\": \"KCS-USDT\",\n \"userId\": \"60fe4956c43cbc0006562c2c\",\n \"status\": \"NEW\",\n \"type\": \"limit\",\n \"side\": \"buy\",\n \"price\": \"0.01000000000000000000\",\n \"size\": \"0.01000000000000000000\",\n \"funds\": null,\n \"stp\": null,\n \"timeInForce\": \"GTC\",\n \"cancelAfter\": -1,\n \"postOnly\": false,\n \"hidden\": false,\n \"iceberg\": false,\n \"visibleSize\": null,\n \"channel\": \"API\",\n \"clientOid\": \"40e0eb9efe6311eb8e58acde48001122\",\n \"remark\": null,\n \"tags\": null,\n \"orderTime\": 1629098781127530345,\n \"domainId\": \"kucoin\",\n \"tradeSource\": \"USER\",\n \"tradeType\": \"TRADE\",\n \"feeCurrency\": \"USDT\",\n \"takerFeeRate\": \"0.00200000000000000000\",\n \"makerFeeRate\": \"0.00200000000000000000\",\n \"createdAt\": 1629098781128,\n \"stop\": \"loss\",\n \"stopTriggerTime\": null,\n \"stopPrice\": \"10.00000000000000000000\"\n}\n```\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| symbol | string | Only list orders for a specific symbol |\n| side | string | buy or sell |\n| type | string | limit, market, limit_stop or market_stop |\n| tradeType | string | The type of trading : TRADE(Spot), MARGIN_TRADE (Cross Margin), MARGIN_ISOLATED_TRADE (Isolated Margin). Default is TRADE |\n| startAt | integer | Start time (milisecond) |\n| endAt | integer | End time (milisecond) |\n| currentPage | integer | current page |\n| orderIds | string | comma seperated order ID list |\n| pageSize | integer | page size |\n| stop | string | Order type: stop: stop loss order, oco: oco order |\n\n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | the return code |\n| data | array | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| id | string | Order ID, the ID of an order. |\n| symbol | string | Symbol name |\n| userId | string | User ID |\n| status | string | Order status, include NEW, TRIGGERED |\n| type | string | Order type,limit, market, limit_stop or market_stop |\n| side | string | transaction direction,include buy and sell |\n| price | string | order price |\n| size | string | order quantity |\n| funds | string | order funds |\n| stp | string | |\n| timeInForce | string | time InForce,include GTC,GTT,IOC,FOK |\n| cancelAfter | integer | cancel orders after n seconds,requires timeInForce to be GTT |\n| postOnly | boolean | postOnly |\n| hidden | boolean | hidden order |\n| iceberg | boolean | Iceberg order |\n| visibleSize | string | displayed quantity for iceberg order |\n| channel | string | order source |\n| clientOid | string | user-entered order unique mark |\n| remark | string | Remarks at stop order creation |\n| tags | string | tag order source |\n| domainId | string | domainId, e.g: kucoin |\n| tradeSource | string | trade source: USER(Order by user), MARGIN_SYSTEM(Order by margin system) |\n| tradeType | string | The type of trading : TRADE(Spot), MARGIN_TRADE (Cross Margin), MARGIN_ISOLATED_TRADE (Isolated Margin). |\n| feeCurrency | string | The currency of the fee |\n| takerFeeRate | string | Fee Rate of taker |\n| makerFeeRate | string | Fee Rate of maker |\n| createdAt | integer | order creation time |\n| stop | string | Stop order type, include loss and entry |\n| stopTriggerTime | integer | The trigger time of the stop order |\n| stopPrice | string | stop price |\n| orderTime | integer | Time of place a stop order, accurate to nanoseconds |\n\n---\n", + "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470177)\n\n:::info[Description]\nThis interface can query all spot symbol that has active orders\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| symbols | array | Refer to the schema section of symbols |\n\n---\n", "body": {} }, "response": [ @@ -6461,21 +6385,12 @@ "path": [ "api", "v1", - "stop-order", - "queryOrderByClientOid" + "hf", + "orders", + "active", + "symbols" ], - "query": [ - { - "key": "clientOid", - "value": null, - "description": "The client order id" - }, - { - "key": "symbol", - "value": null, - "description": "symbol name" - } - ] + "query": [] } }, "status": "OK", @@ -6508,14 +6423,14 @@ } ], "cookie": [], - "body": "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"id\": \"vs8hoo8os561f5np0032vngj\",\n \"symbol\": \"KCS-USDT\",\n \"userId\": \"60fe4956c43cbc0006562c2c\",\n \"status\": \"NEW\",\n \"type\": \"limit\",\n \"side\": \"buy\",\n \"price\": \"0.01000000000000000000\",\n \"size\": \"0.01000000000000000000\",\n \"funds\": null,\n \"stp\": null,\n \"timeInForce\": \"GTC\",\n \"cancelAfter\": -1,\n \"postOnly\": false,\n \"hidden\": false,\n \"iceberg\": false,\n \"visibleSize\": null,\n \"channel\": \"API\",\n \"clientOid\": \"2b700942b5db41cebe578cff48960e09\",\n \"remark\": null,\n \"tags\": null,\n \"orderTime\": 1629020492834532600,\n \"domainId\": \"kucoin\",\n \"tradeSource\": \"USER\",\n \"tradeType\": \"TRADE\",\n \"feeCurrency\": \"USDT\",\n \"takerFeeRate\": \"0.00200000000000000000\",\n \"makerFeeRate\": \"0.00200000000000000000\",\n \"createdAt\": 1629020492837,\n \"stop\": \"loss\",\n \"stopTriggerTime\": null,\n \"stopPrice\": \"1.00000000000000000000\"\n }\n ]\n}" + "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"symbols\": [\n \"ETH-USDT\",\n \"BTC-USDT\"\n ]\n }\n}" } ] }, { - "name": "Batch Cancel Stop Orders", + "name": "Get Open Orders", "request": { - "method": "DELETE", + "method": "GET", "header": [], "url": { "raw": "", @@ -6526,35 +6441,26 @@ "path": [ "api", "v1", - "stop-order", - "cancel" + "hf", + "orders", + "active" ], "query": [ { "key": "symbol", - "value": null, - "description": "Cancel the open order for the specified symbol" - }, - { - "key": "tradeType", - "value": null, - "description": "The type of trading : TRADE(Spot), MARGIN_TRADE (Cross Margin), MARGIN_ISOLATED_TRADE (Isolated Margin). Default is TRADE" - }, - { - "key": "orderIds", - "value": null, - "description": "Comma seperated order IDs." + "value": "BTC-USDT", + "description": "symbol" } ] }, - "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470337)\n\n:::info[Description]\nRequest via this interface to cancel a batch of stop orders.\n\nThe count of orderId in the parameter now is not limited.\n\nAn example is:\n ```/api/v1/stop-order/cancel?symbol=ETH-BTC&tradeType=TRADE&orderIds=5bd6e9286d99522a52e458de,5bd6e9286d99522a52e458df```\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| cancelledOrderIds | array | Refer to the schema section of cancelledOrderIds |\n\n---\n", + "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470178)\n\n:::info[Description]\nThis interface is to obtain all Spot active order lists, and the return value of the active order interface is the paged data of all uncompleted order lists. The returned data is sorted in descending order according to the latest update time of the order.\n\nAfter the user successfully places an order, the order is in Active state, and the user can use inOrderBook to determine whether the order has entered the order. Canceled or fully filled orders are marked as completed Done status.\n:::\n\n:::tip[Tips]\nFor high-frequency trading users, we recommend locally caching, maintaining your own order records, and using market data streams to update your order information in real time.\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | array | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| id | string | The unique order id generated by the trading system |\n| symbol | string | symbol |\n| opType | string | |\n| type | string | Specify if the order is an 'limit' order or 'market' order. |\n| side | string | Buy or sell |\n| price | string | Order price |\n| size | string | Order size |\n| funds | string | Order Funds |\n| dealSize | string | Number of filled transactions |\n| dealFunds | string | Funds of filled transactions |\n| fee | string | [Handling fees](https://www.kucoin.com/docs-new/api-5327739) |\n| feeCurrency | string | currency used to calculate trading fee |\n| stp | string | [Self Trade Prevention](https://www.kucoin.com/docs-new/api-5176570) |\n| timeInForce | string | Time in force |\n| postOnly | boolean | Whether its a postOnly order. |\n| hidden | boolean | Whether its a hidden order. |\n| iceberg | boolean | Whether its a iceberg order. |\n| visibleSize | string | Visible size of iceberg order in order book. |\n| cancelAfter | integer | A GTT timeInForce that expires in n seconds |\n| channel | string | |\n| clientOid | string | Client Order Id,unique identifier created by the user |\n| remark | string | Order placement remarks |\n| tags | string | Order tag |\n| cancelExist | boolean | Whether there is a cancellation record for the order. |\n| createdAt | integer | |\n| lastUpdatedAt | integer | |\n| tradeType | string | Trade type, redundancy param |\n| inOrderBook | boolean | Whether to enter the orderbook: true: enter the orderbook; false: not enter the orderbook |\n| cancelledSize | string | Number of canceled transactions |\n| cancelledFunds | string | Funds of canceled transactions |\n| remainSize | string | Number of remain transactions |\n| remainFunds | string | Funds of remain transactions |\n| tax | string | Users in some regions need query this field |\n| active | boolean | Order status: true-The status of the order isactive; false-The status of the order is done |\n\n---\n", "body": {} }, "response": [ { "name": "Successful Response", "originalRequest": { - "method": "DELETE", + "method": "GET", "header": [], "url": { "raw": "", @@ -6565,24 +6471,15 @@ "path": [ "api", "v1", - "stop-order", - "cancel" + "hf", + "orders", + "active" ], "query": [ { "key": "symbol", - "value": null, - "description": "Cancel the open order for the specified symbol" - }, - { - "key": "tradeType", - "value": null, - "description": "The type of trading : TRADE(Spot), MARGIN_TRADE (Cross Margin), MARGIN_ISOLATED_TRADE (Isolated Margin). Default is TRADE" - }, - { - "key": "orderIds", - "value": null, - "description": "Comma seperated order IDs." + "value": "BTC-USDT", + "description": "symbol" } ] } @@ -6617,14 +6514,14 @@ } ], "cookie": [], - "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"cancelledOrderIds\": [\n \"671124f9365ccb00073debd4\"\n ]\n }\n}" + "body": "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"id\": \"67120bbef094e200070976f6\",\n \"clientOid\": \"5c52e11203aa677f33e493fb\",\n \"symbol\": \"BTC-USDT\",\n \"opType\": \"DEAL\",\n \"type\": \"limit\",\n \"side\": \"buy\",\n \"price\": \"50000\",\n \"size\": \"0.00001\",\n \"funds\": \"0.5\",\n \"dealSize\": \"0\",\n \"dealFunds\": \"0\",\n \"fee\": \"0\",\n \"feeCurrency\": \"USDT\",\n \"stp\": null,\n \"timeInForce\": \"GTC\",\n \"postOnly\": false,\n \"hidden\": false,\n \"iceberg\": false,\n \"visibleSize\": \"0\",\n \"cancelAfter\": 0,\n \"channel\": \"API\",\n \"remark\": \"order remarks\",\n \"tags\": \"order tags\",\n \"cancelExist\": false,\n \"tradeType\": \"TRADE\",\n \"inOrderBook\": true,\n \"cancelledSize\": \"0\",\n \"cancelledFunds\": \"0\",\n \"remainSize\": \"0.00001\",\n \"remainFunds\": \"0.5\",\n \"tax\": \"0\",\n \"active\": true,\n \"createdAt\": 1729235902748,\n \"lastUpdatedAt\": 1729235909862\n }\n ]\n}" } ] }, { - "name": "Batch Cancel OCO Order", + "name": "Get Closed Orders", "request": { - "method": "DELETE", + "method": "GET", "header": [], "url": { "raw": "", @@ -6634,31 +6531,57 @@ ], "path": [ "api", - "v3", - "oco", - "orders" + "v1", + "hf", + "orders", + "done" ], "query": [ - { - "key": "orderIds", - "value": "674c388172cf2800072ee746,674c38bdfd8300000795167e", - "description": "Specify the order id, there can be multiple orders, separated by commas. If not passed, all oco orders will be canceled by default." - }, { "key": "symbol", "value": "BTC-USDT", - "description": "trading pair. If not passed, the oco orders of all symbols will be canceled by default." + "description": "symbol" + }, + { + "key": "side", + "value": null, + "description": "specify if the order is to 'buy' or 'sell'" + }, + { + "key": "type", + "value": null, + "description": "specify if the order is an 'limit' order or 'market' order. " + }, + { + "key": "lastId", + "value": "254062248624417", + "description": "The id of the last set of data from the previous batch of data. By default, the latest information is given.\nlastId is used to filter data and paginate. If lastId is not entered, the default is a maximum of 100 returned data items. The return results include lastId,which can be used as a query parameter to look up new data from the next page." + }, + { + "key": "limit", + "value": "20", + "description": "Default20,Max100" + }, + { + "key": "startAt", + "value": "1728663338000", + "description": "Start time (milisecond)" + }, + { + "key": "endAt", + "value": "1728692138000", + "description": "End time (milisecond)" } ] }, - "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470356)\n\n:::info[Description]\nThis interface can batch cancel OCO orders through orderIds.\n\nYou will receive cancelledOrderIds field once the system has received the cancellation request. The cancellation request will be processed by the matching engine in sequence. To know if the request is processed (successfully or not), you may check the order status or the update message from the pushes.\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| cancelledOrderIds | array | Refer to the schema section of cancelledOrderIds |\n\n---\n", + "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470179)\n\n:::info[Description]\nThis interface is to obtain all Spot Closed order lists, and the return value of the active order interface is the paged data of all uncompleted order lists. The returned data is sorted in descending order according to the latest update time of the order.\n\nAfter the user successfully places an order, the order is in Active state, and the user can use inOrderBook to determine whether the order has entered the order. Canceled or fully filled orders are marked as completed Done status.\n:::\n\n:::tip[Tips]\nIf the order is not an active order, you can only get data within the time range of 3 _ 24 hours (ie: from the current time to 3 _ 24 hours ago). If the time range is exceeded, the system will query the data within the time range of 3 * 24 hours by default.\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| lastId | integer | The id of the last set of data from the previous batch of data. By default, the latest information is given.
lastId is used to filter data and paginate. If lastId is not entered, the default is a maximum of 100 returned data items. The return results include lastId,which can be used as a query parameter to look up new data from the next page. |\n| items | array | Refer to the schema section of items |\n\n**root.data.items Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| id | string | The unique order id generated by the trading system |\n| symbol | string | symbol |\n| opType | string | |\n| type | string | Specify if the order is an 'limit' order or 'market' order. |\n| side | string | Buy or sell |\n| price | string | Order price |\n| size | string | Order size |\n| funds | string | Order Funds |\n| dealSize | string | Number of filled transactions |\n| dealFunds | string | Funds of filled transactions |\n| fee | string | [Handling fees](https://www.kucoin.com/docs-new/api-5327739) |\n| feeCurrency | string | currency used to calculate trading fee |\n| stp | string | [Self Trade Prevention](https://www.kucoin.com/docs-new/api-5176570) |\n| timeInForce | string | Time in force |\n| postOnly | boolean | Whether its a postOnly order. |\n| hidden | boolean | Whether its a hidden order. |\n| iceberg | boolean | Whether its a iceberg order. |\n| visibleSize | string | Visible size of iceberg order in order book. |\n| cancelAfter | integer | A GTT timeInForce that expires in n seconds |\n| channel | string | |\n| clientOid | string | Client Order Id,unique identifier created by the user |\n| remark | string | Order placement remarks |\n| tags | string | Order tag |\n| cancelExist | boolean | Whether there is a cancellation record for the order. |\n| createdAt | integer | |\n| lastUpdatedAt | integer | |\n| tradeType | string | Trade type, redundancy param |\n| inOrderBook | boolean | Whether to enter the orderbook: true: enter the orderbook; false: not enter the orderbook |\n| cancelledSize | string | Number of canceled transactions |\n| cancelledFunds | string | Funds of canceled transactions |\n| remainSize | string | Number of remain transactions |\n| remainFunds | string | Funds of remain transactions |\n| tax | string | Users in some regions need query this field |\n| active | boolean | Order status: true-The status of the order isactive; false-The status of the order is done |\n\n---\n", "body": {} }, "response": [ { "name": "Successful Response", "originalRequest": { - "method": "DELETE", + "method": "GET", "header": [], "url": { "raw": "", @@ -6668,20 +6591,46 @@ ], "path": [ "api", - "v3", - "oco", - "orders" + "v1", + "hf", + "orders", + "done" ], "query": [ - { - "key": "orderIds", - "value": "674c388172cf2800072ee746,674c38bdfd8300000795167e", - "description": "Specify the order id, there can be multiple orders, separated by commas. If not passed, all oco orders will be canceled by default." - }, { "key": "symbol", "value": "BTC-USDT", - "description": "trading pair. If not passed, the oco orders of all symbols will be canceled by default." + "description": "symbol" + }, + { + "key": "side", + "value": null, + "description": "specify if the order is to 'buy' or 'sell'" + }, + { + "key": "type", + "value": null, + "description": "specify if the order is an 'limit' order or 'market' order. " + }, + { + "key": "lastId", + "value": "254062248624417", + "description": "The id of the last set of data from the previous batch of data. By default, the latest information is given.\nlastId is used to filter data and paginate. If lastId is not entered, the default is a maximum of 100 returned data items. The return results include lastId,which can be used as a query parameter to look up new data from the next page." + }, + { + "key": "limit", + "value": "20", + "description": "Default20,Max100" + }, + { + "key": "startAt", + "value": "1728663338000", + "description": "Start time (milisecond)" + }, + { + "key": "endAt", + "value": "1728692138000", + "description": "End time (milisecond)" } ] } @@ -6716,7 +6665,7 @@ } ], "cookie": [], - "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"cancelledOrderIds\": [\n \"vs93gpqc750mkk57003gok6i\",\n \"vs93gpqc750mkk57003gok6j\",\n \"vs93gpqc75c39p83003tnriu\",\n \"vs93gpqc75c39p83003tnriv\"\n ]\n }\n}" + "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"lastId\": 19814995255305,\n \"items\": [\n {\n \"id\": \"6717422bd51c29000775ea03\",\n \"clientOid\": \"5c52e11203aa677f33e493fb\",\n \"symbol\": \"BTC-USDT\",\n \"opType\": \"DEAL\",\n \"type\": \"limit\",\n \"side\": \"buy\",\n \"price\": \"70000\",\n \"size\": \"0.00001\",\n \"funds\": \"0.7\",\n \"dealSize\": \"0.00001\",\n \"dealFunds\": \"0.677176\",\n \"remainSize\": \"0\",\n \"remainFunds\": \"0.022824\",\n \"cancelledSize\": \"0\",\n \"cancelledFunds\": \"0\",\n \"fee\": \"0.000677176\",\n \"feeCurrency\": \"USDT\",\n \"stp\": null,\n \"timeInForce\": \"GTC\",\n \"postOnly\": false,\n \"hidden\": false,\n \"iceberg\": false,\n \"visibleSize\": \"0\",\n \"cancelAfter\": 0,\n \"channel\": \"API\",\n \"remark\": \"order remarks\",\n \"tags\": null,\n \"cancelExist\": false,\n \"tradeType\": \"TRADE\",\n \"inOrderBook\": false,\n \"active\": false,\n \"tax\": \"0\",\n \"createdAt\": 1729577515444,\n \"lastUpdatedAt\": 1729577515481\n }\n ]\n }\n}" } ] }, @@ -6875,14 +6824,95 @@ } ], "cookie": [], - "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"items\": [\n {\n \"id\": 19814995255305,\n \"orderId\": \"6717422bd51c29000775ea03\",\n \"counterOrderId\": \"67174228135f9e000709da8c\",\n \"tradeId\": 11029373945659392,\n \"symbol\": \"BTC-USDT\",\n \"side\": \"buy\",\n \"liquidity\": \"taker\",\n \"type\": \"limit\",\n \"forceTaker\": false,\n \"price\": \"67717.6\",\n \"size\": \"0.00001\",\n \"funds\": \"0.677176\",\n \"fee\": \"0.000677176\",\n \"feeRate\": \"0.001\",\n \"feeCurrency\": \"USDT\",\n \"stop\": \"\",\n \"tradeType\": \"TRADE\",\n \"taxRate\": \"0\",\n \"tax\": \"0\",\n \"createdAt\": 1729577515473\n }\n ],\n \"lastId\": 19814995255305\n }\n}" + "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"items\": [\n {\n \"id\": 19814995255305,\n \"orderId\": \"6717422bd51c29000775ea03\",\n \"counterOrderId\": \"67174228135f9e000709da8c\",\n \"tradeId\": 11029373945659392,\n \"symbol\": \"BTC-USDT\",\n \"side\": \"buy\",\n \"liquidity\": \"taker\",\n \"type\": \"limit\",\n \"forceTaker\": false,\n \"price\": \"67717.6\",\n \"size\": \"0.00001\",\n \"funds\": \"0.677176\",\n \"fee\": \"0.000677176\",\n \"feeRate\": \"0.001\",\n \"feeCurrency\": \"USDT\",\n \"stop\": \"\",\n \"tradeType\": \"TRADE\",\n \"taxRate\": \"0\",\n \"tax\": \"0\",\n \"createdAt\": 1729577515473\n }\n ],\n \"lastId\": 19814995255305\n }\n}" + } + ] + }, + { + "name": "Get DCP", + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "", + "protocol": "https", + "host": [ + "{{spot_endpoint}}" + ], + "path": [ + "api", + "v1", + "hf", + "orders", + "dead-cancel-all", + "query" + ], + "query": [] + }, + "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470172)\n\n:::info[Description]\nGet Disconnection Protect(Deadman Swich)Through this interface, you can query the settings of automatic order cancellation\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| timeout | integer | Auto cancel order trigger setting time, the unit is second. range: timeout=-1 (meaning unset) or 5 <= timeout <= 86400 |\n| symbols | string | List of trading pairs. Separated by commas, empty means all trading pairs |\n| currentTime | integer | System current time (in seconds) |\n| triggerTime | integer | Trigger cancellation time (in seconds) |\n\n---\n", + "body": {} + }, + "response": [ + { + "name": "Successful Response", + "originalRequest": { + "method": "GET", + "header": [], + "url": { + "raw": "", + "protocol": "https", + "host": [ + "{{spot_endpoint}}" + ], + "path": [ + "api", + "v1", + "hf", + "orders", + "dead-cancel-all", + "query" + ], + "query": [] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json", + "name": "Content-Type", + "description": { + "content": "", + "type": "text/plain" + } + }, + { + "key": "gw-ratelimit-remaining", + "value": 1997, + "name": "gw-ratelimit-remaining" + }, + { + "key": "gw-ratelimit-limit", + "value": 2000, + "name": "gw-ratelimit-limit" + }, + { + "key": "gw-ratelimit-reset", + "value": 29990, + "name": "gw-ratelimit-reset" + } + ], + "cookie": [], + "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"timeout\": 5,\n \"symbols\": \"BTC-USDT,ETH-USDT\",\n \"currentTime\": 1729241305,\n \"triggerTime\": 1729241308\n }\n}" } ] }, { - "name": "Get OCO Order By OrderId", + "name": "Set DCP", "request": { - "method": "GET", + "method": "POST", "header": [], "url": { "raw": "", @@ -6892,21 +6922,29 @@ ], "path": [ "api", - "v3", - "oco", - "order", - "{{orderId}}" + "v1", + "hf", + "orders", + "dead-cancel-all" ], "query": [] }, - "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470357)\n\n:::info[Description]\nRequest via this interface to get a oco order information via the order ID.\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| symbol | string | symbol |\n| clientOid | string | Client Order Id |\n| orderId | string | The unique order id generated by the trading system,which can be used later for further actions such as canceling the order. |\n| orderTime | integer | Order placement time, milliseconds |\n| status | string | Order status: NEW: New, DONE: Completed, TRIGGERED: Triggered, CANCELLED: Cancelled |\n\n---\n", - "body": {} + "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470173)\n\n:::info[Description]\nSet Disconnection Protect(Deadman Swich)Through this interface, Call this interface to automatically cancel all orders of the set trading pair after the specified time. If this interface is not called again for renewal or cancellation before the set time, the system will help the user to cancel the order of the corresponding trading pair. Otherwise it will not.\n:::\n\n:::tip[Tips]\nThe order cancellation delay is between 0 and 10 seconds, and the order will not be canceled in real time. When the system cancels the order, if the transaction pair status is no longer operable to cancel the order, it will not cancel the order\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| timeout | integer | Auto cancel order trigger setting time, the unit is second. range: timeout=-1 (meaning unset) or 5 <= timeout <= 86400. For example, timeout=5 means that the order will be automatically canceled if no user request is received for more than 5 seconds. When this parameter is changed, the previous setting will be overwritten. |\n| symbols | string | List of trading pairs. When this parameter is not empty, separate it with commas and support up to 50 trading pairs. Empty means all trading pairs. When this parameter is changed, the previous setting will be overwritten. |\n\n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| currentTime | integer | System current time (in seconds) |\n| triggerTime | integer | Trigger cancellation time (in seconds) |\n\n---\n", + "body": { + "mode": "raw", + "raw": "{\n \"timeout\": 5,\n \"symbols\": \"BTC-USDT,ETH-USDT\"\n}", + "options": { + "raw": { + "language": "json" + } + } + } }, "response": [ { "name": "Successful Response", "originalRequest": { - "method": "GET", + "method": "POST", "header": [], "url": { "raw": "", @@ -6916,10 +6954,10 @@ ], "path": [ "api", - "v3", - "oco", - "order", - "{{orderId}}" + "v1", + "hf", + "orders", + "dead-cancel-all" ], "query": [] } @@ -6954,14 +6992,14 @@ } ], "cookie": [], - "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"orderId\": \"674c3b6e688dea0007c7bab2\",\n \"symbol\": \"BTC-USDT\",\n \"clientOid\": \"5c52e1203aa6f37f1e493fb\",\n \"orderTime\": 1733049198863,\n \"status\": \"NEW\"\n }\n}" + "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"currentTime\": 1729656588,\n \"triggerTime\": 1729656593\n }\n}" } ] }, { - "name": "Get OCO Order List", + "name": "Add Stop Order", "request": { - "method": "GET", + "method": "POST", "header": [], "url": { "raw": "", @@ -6971,51 +7009,27 @@ ], "path": [ "api", - "v3", - "oco", - "orders" + "v1", + "stop-order" ], - "query": [ - { - "key": "symbol", - "value": null, - "description": "symbol" - }, - { - "key": "startAt", - "value": null, - "description": "Start time (milliseconds)" - }, - { - "key": "endAt", - "value": null, - "description": "End time (milliseconds)" - }, - { - "key": "orderIds", - "value": null, - "description": "Specify orderId collection, up to 500 orders\n" - }, - { - "key": "pageSize", - "value": null, - "description": "Size per page, minimum value 10, maximum value 500" - }, - { - "key": "currentPage", - "value": null, - "description": "Page number, minimum value 1\n" - } - ] + "query": [] }, - "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470360)\n\n:::info[Description]\nRequest via this endpoint to get your current OCO order list. Items are paginated and sorted to show the latest first. See the Pagination section for retrieving additional entries after the first page.\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| currentPage | integer | |\n| pageSize | integer | |\n| totalNum | integer | |\n| totalPage | integer | |\n| items | array | Refer to the schema section of items |\n\n**root.data.items Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| orderId | string | The unique order id generated by the trading system,which can be used later for further actions such as canceling the order. |\n| symbol | string | symbol |\n| clientOid | string | Client Order Id |\n| orderTime | integer | Order placement time, milliseconds |\n| status | string | Order status: NEW: New, DONE: Completed, TRIGGERED: Triggered, CANCELLED: Cancelled |\n\n---\n", - "body": {} + "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470334)\n\n:::info[Description]\nPlace stop order to the Spot trading system. The maximum untriggered stop orders for a single trading pair in one account is 20.\n:::\n\n\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| clientOid | string | Client Order Id,The ClientOid field is a unique ID created by the user(we recommend using a UUID), and can only contain numbers, letters, underscores (_), and hyphens (-). This field is returned when order information is obtained. You can use clientOid to tag your orders. ClientOid is different from the order ID created by the service provider. Please do not initiate requests using the same clientOid. The maximum length for the ClientOid is 40 characters.

Please remember the orderId created by the service provider, it used to check for updates in order status. |\n| side | string | specify if the order is to 'buy' or 'sell' |\n| symbol | string | symbol |\n| type | string | specify if the order is an 'limit' order or 'market' order.

The type of order you specify when you place your order determines whether or not you need to request other parameters and also affects the execution of the matching engine.

When placing a limit order, you must specify a price and size. The system will try to match the order according to market price or a price better than market price. If the order cannot be immediately matched, it will stay in the order book until it is matched or the user cancels.

Unlike limit orders, the price for market orders fluctuates with market prices. When placing a market order, you do not need to specify a price, you only need to specify a quantity. Market orders are filled immediately and will not enter the order book. All market orders are takers and a taker fee will be charged. |\n| remark | string | Order placement remarks, length cannot exceed 20 characters (ASCII) |\n| stp | string | [Self Trade Prevention](https://www.kucoin.com/docs-new/doc-338146) is divided into four strategies: CN, CO, CB , and DC |\n| price | string | Specify price for order, not need for market order.

When placing a limit order, the price must be based on priceIncrement for the trading pair. The price increment (priceIncrement) is the price precision for the trading pair. For example, for the BTC-USDT trading pair, the priceIncrement is 0.00001000. So the price for your orders cannot be less than 0.00001000 and must be a multiple of priceIncrement. Otherwise, the order will return an invalid priceIncrement error. |\n| size | string | Specify quantity for order

When **type** is limit, size refers to the amount of trading targets (the asset name written in front) for the trading pair. Teh Size must be based on the baseIncrement of the trading pair. The baseIncrement represents the precision for the trading pair. The size of an order must be a positive-integer multiple of baseIncrement and must be between baseMinSize and baseMaxSize.

When **type** is market, select one out of two: size or funds |\n| timeInForce | string | [Time in force](https://www.kucoin.com/docs-new/doc-338146) is a special strategy used during trading. Required for limit orders. |\n| postOnly | boolean | passive order labels, this is disabled when the order timing strategy is IOC or FOK if **type** is limit. |\n| hidden | boolean | [Hidden order](https://www.kucoin.com/docs-new/doc-338146) or not (not shown in order book) |\n| iceberg | boolean | Whether or not only visible portions of orders are shown in [Iceberg orders](https://www.kucoin.com/docs-new/doc-338146) |\n| visibleSize | string | When **type** is limit, this is Maximum visible quantity in iceberg orders. |\n| cancelAfter | integer | Cancel after n seconds,the order timing strategy is GTT when **type** is limit. |\n| funds | string | When **type** is market, select one out of two: size or funds |\n| stopPrice | string | The trigger price. |\n| tradeType | string | The type of trading : TRADE(Spot), MARGIN_TRADE (Cross Margin), MARGIN_ISOLATED_TRADE (Isolated Margin). Default is TRADE |\n\n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| orderId | string | The unique order id generated by the trading system,which can be used later for further actions such as canceling the order. |\n| clientOid | string | The user self-defined order id. |\n\n---\n", + "body": { + "mode": "raw", + "raw": "//limit order\n{\n \"type\": \"limit\",\n \"symbol\": \"BTC-USDT\",\n \"side\": \"buy\",\n \"price\": \"50000\",\n \"size\": \"0.00001\",\n \"clientOid\": \"5c52e11203aa677f33e493fb\",\n \"remark\": \"order remarks\"\n}\n\n//market order 1\n// {\n// \"type\": \"market\",\n// \"symbol\": \"BTC-USDT\",\n// \"side\": \"buy\",\n// \"size\": \"0.00001\",\n// \"clientOid\": \"5c52e11203aa677f33e493fc\",\n// \"remark\": \"order remarks\"\n// }\n\n//market order 2\n// {\n// \"type\": \"market\",\n// \"symbol\": \"BTC-USDT\",\n// \"side\": \"buy\",\n// \"funds\": \"1\",\n// \"clientOid\": \"5c52e11203aa677f33e493fc\",\n// \"remark\": \"order remarks\"\n// }\n", + "options": { + "raw": { + "language": "json" + } + } + } }, "response": [ { "name": "Successful Response", "originalRequest": { - "method": "GET", + "method": "POST", "header": [], "url": { "raw": "", @@ -7025,42 +7039,10 @@ ], "path": [ "api", - "v3", - "oco", - "orders" + "v1", + "stop-order" ], - "query": [ - { - "key": "symbol", - "value": null, - "description": "symbol" - }, - { - "key": "startAt", - "value": null, - "description": "Start time (milliseconds)" - }, - { - "key": "endAt", - "value": null, - "description": "End time (milliseconds)" - }, - { - "key": "orderIds", - "value": null, - "description": "Specify orderId collection, up to 500 orders\n" - }, - { - "key": "pageSize", - "value": null, - "description": "Size per page, minimum value 10, maximum value 500" - }, - { - "key": "currentPage", - "value": null, - "description": "Page number, minimum value 1\n" - } - ] + "query": [] } }, "status": "OK", @@ -7093,14 +7075,14 @@ } ], "cookie": [], - "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"currentPage\": 1,\n \"pageSize\": 50,\n \"totalNum\": 1,\n \"totalPage\": 1,\n \"items\": [\n {\n \"orderId\": \"674c3cfa72cf2800072ee7ce\",\n \"symbol\": \"BTC-USDT\",\n \"clientOid\": \"5c52e1203aa6f3g7f1e493fb\",\n \"orderTime\": 1733049594803,\n \"status\": \"NEW\"\n }\n ]\n }\n}" + "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"orderId\": \"670fd33bf9406e0007ab3945\",\n \"clientOid\": \"5c52e11203aa677f33e493fb\"\n }\n}" } ] }, { - "name": "Get OCO Order Detail By OrderId", + "name": "Cancel Stop Order By ClientOid", "request": { - "method": "GET", + "method": "DELETE", "header": [], "url": { "raw": "", @@ -7110,22 +7092,31 @@ ], "path": [ "api", - "v3", - "oco", - "order", - "details", - "{{orderId}}" + "v1", + "stop-order", + "cancelOrderByClientOid" ], - "query": [] + "query": [ + { + "key": "symbol", + "value": "BTC-USDT", + "description": "symbol" + }, + { + "key": "clientOid", + "value": "689ff597f4414061aa819cc414836abd", + "description": "Unique order id created by users to identify their orders" + } + ] }, - "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470359)\n\n:::info[Description]\nRequest via this interface to get a oco order detail via the order ID.\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| orderId | string | The unique order id generated by the trading system,which can be used later for further actions such as canceling the order. |\n| symbol | string | symbol |\n| clientOid | string | Client Order Id |\n| orderTime | integer | Order placement time, milliseconds |\n| status | string | Order status: NEW: New, DONE: Completed, TRIGGERED: Triggered, CANCELLED: Cancelled |\n| orders | array | Refer to the schema section of orders |\n\n**root.data.orders Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| id | string | |\n| symbol | string | |\n| side | string | |\n| price | string | |\n| stopPrice | string | |\n| size | string | |\n| status | string | |\n\n---\n", + "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470336)\n\n:::info[Description]\nThis endpoint can be used to cancel a spot order by clientOid.\nThis endpoint only sends cancellation requests. The results of the requests must be obtained by checking the order status or subscribing to websocket.\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| clientOid | string | Client Order Id,unique identifier created by the user |\n| cancelledOrderId | string | Unique ID of the cancelled order |\n\n---\n", "body": {} }, "response": [ { "name": "Successful Response", "originalRequest": { - "method": "GET", + "method": "DELETE", "header": [], "url": { "raw": "", @@ -7135,13 +7126,22 @@ ], "path": [ "api", - "v3", - "oco", - "order", - "details", - "{{orderId}}" + "v1", + "stop-order", + "cancelOrderByClientOid" ], - "query": [] + "query": [ + { + "key": "symbol", + "value": "BTC-USDT", + "description": "symbol" + }, + { + "key": "clientOid", + "value": "689ff597f4414061aa819cc414836abd", + "description": "Unique order id created by users to identify their orders" + } + ] } }, "status": "OK", @@ -7174,14 +7174,14 @@ } ], "cookie": [], - "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"orderId\": \"674c3b6e688dea0007c7bab2\",\n \"symbol\": \"BTC-USDT\",\n \"clientOid\": \"5c52e1203aa6f37f1e493fb\",\n \"orderTime\": 1733049198863,\n \"status\": \"NEW\",\n \"orders\": [\n {\n \"id\": \"vs93gpqc7dn6h3fa003sfelj\",\n \"symbol\": \"BTC-USDT\",\n \"side\": \"buy\",\n \"price\": \"94000.00000000000000000000\",\n \"stopPrice\": \"94000.00000000000000000000\",\n \"size\": \"0.10000000000000000000\",\n \"status\": \"NEW\"\n },\n {\n \"id\": \"vs93gpqc7dn6h3fa003sfelk\",\n \"symbol\": \"BTC-USDT\",\n \"side\": \"buy\",\n \"price\": \"96000.00000000000000000000\",\n \"stopPrice\": \"98000.00000000000000000000\",\n \"size\": \"0.10000000000000000000\",\n \"status\": \"NEW\"\n }\n ]\n }\n}" + "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"cancelledOrderId\": \"vs8hoo8ksc8mario0035a74n\",\n \"clientOid\": \"689ff597f4414061aa819cc414836abd\"\n }\n}" } ] }, { - "name": "Get Order By OrderId", + "name": "Cancel Stop Order By OrderId", "request": { - "method": "GET", + "method": "DELETE", "header": [], "url": { "raw": "", @@ -7192,26 +7192,19 @@ "path": [ "api", "v1", - "hf", - "orders", + "stop-order", "{{orderId}}" ], - "query": [ - { - "key": "symbol", - "value": "BTC-USDT", - "description": "symbol" - } - ] + "query": [] }, - "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470181)\n\n:::info[Description]\nThis endpoint can be used to obtain information for a single Spot order using the order id.\n\nAfter the user successfully places an order, the order is in Active state, and the user can use inOrderBook to determine whether the order has entered the order. Canceled or fully filled orders are marked as completed Done status.\n:::\n\n:::tip[Tips]\nIf the order is not an active order, you can only get data within the time range of 3 _ 24 hours (ie: from the current time to 3 _ 24 hours ago). If the time range is exceeded, the system will query the data within the time range of 3 * 24 hours by default.\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| id | string | The unique order id generated by the trading system |\n| symbol | string | symbol |\n| opType | string | |\n| type | string | Specify if the order is an 'limit' order or 'market' order. |\n| side | string | Buy or sell |\n| price | string | Order price |\n| size | string | Order size |\n| funds | string | Order Funds |\n| dealSize | string | Number of filled transactions |\n| dealFunds | string | Funds of filled transactions |\n| fee | string | [Handling fees](https://www.kucoin.com/docs-new/api-5327739) |\n| feeCurrency | string | currency used to calculate trading fee |\n| stp | string | [Self Trade Prevention](https://www.kucoin.com/docs-new/api-5176570) |\n| timeInForce | string | Time in force |\n| postOnly | boolean | Whether its a postOnly order. |\n| hidden | boolean | Whether its a hidden order. |\n| iceberg | boolean | Whether its a iceberg order. |\n| visibleSize | string | Visible size of iceberg order in order book. |\n| cancelAfter | integer | A GTT timeInForce that expires in n seconds |\n| channel | string | |\n| clientOid | string | Client Order Id,unique identifier created by the user |\n| remark | string | Order placement remarks |\n| tags | string | Order tag |\n| cancelExist | boolean | Whether there is a cancellation record for the order. |\n| createdAt | integer | |\n| lastUpdatedAt | integer | |\n| tradeType | string | Trade type, redundancy param |\n| inOrderBook | boolean | Whether to enter the orderbook: true: enter the orderbook; false: not enter the orderbook |\n| cancelledSize | string | Number of canceled transactions |\n| cancelledFunds | string | Funds of canceled transactions |\n| remainSize | string | Number of remain transactions |\n| remainFunds | string | Funds of remain transactions |\n| tax | string | Users in some regions need query this field |\n| active | boolean | Order status: true-The status of the order isactive; false-The status of the order is done |\n\n---\n", + "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470335)\n\n:::info[Description]\nRequest via this endpoint to cancel a single stop order previously placed.\n\nYou will receive cancelledOrderIds field once the system has received the cancellation request. The cancellation request will be processed by the matching engine in sequence. To know if the request is processed (successfully or not), you may check the order status or the update message from the websocket pushes.\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| cancelledOrderIds | array | Refer to the schema section of cancelledOrderIds |\n\n---\n", "body": {} }, "response": [ { "name": "Successful Response", "originalRequest": { - "method": "GET", + "method": "DELETE", "header": [], "url": { "raw": "", @@ -7222,17 +7215,10 @@ "path": [ "api", "v1", - "hf", - "orders", + "stop-order", "{{orderId}}" ], - "query": [ - { - "key": "symbol", - "value": "BTC-USDT", - "description": "symbol" - } - ] + "query": [] } }, "status": "OK", @@ -7265,14 +7251,14 @@ } ], "cookie": [], - "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"id\": \"6717422bd51c29000775ea03\",\n \"clientOid\": \"5c52e11203aa677f33e493fb\",\n \"symbol\": \"BTC-USDT\",\n \"opType\": \"DEAL\",\n \"type\": \"limit\",\n \"side\": \"buy\",\n \"price\": \"70000\",\n \"size\": \"0.00001\",\n \"funds\": \"0.7\",\n \"dealSize\": \"0.00001\",\n \"dealFunds\": \"0.677176\",\n \"remainSize\": \"0\",\n \"remainFunds\": \"0.022824\",\n \"cancelledSize\": \"0\",\n \"cancelledFunds\": \"0\",\n \"fee\": \"0.000677176\",\n \"feeCurrency\": \"USDT\",\n \"stp\": null,\n \"timeInForce\": \"GTC\",\n \"postOnly\": false,\n \"hidden\": false,\n \"iceberg\": false,\n \"visibleSize\": \"0\",\n \"cancelAfter\": 0,\n \"channel\": \"API\",\n \"remark\": \"order remarks\",\n \"tags\": null,\n \"cancelExist\": false,\n \"tradeType\": \"TRADE\",\n \"inOrderBook\": false,\n \"active\": false,\n \"tax\": \"0\",\n \"createdAt\": 1729577515444,\n \"lastUpdatedAt\": 1729577515481\n }\n}" + "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"cancelledOrderIds\": [\n \"671124f9365ccb00073debd4\"\n ]\n }\n}" } ] }, { - "name": "Get OCO Order By ClientOid", + "name": "Batch Cancel Stop Orders", "request": { - "method": "GET", + "method": "DELETE", "header": [], "url": { "raw": "", @@ -7282,21 +7268,36 @@ ], "path": [ "api", - "v3", - "oco", - "client-order", - "{{clientOid}}" + "v1", + "stop-order", + "cancel" ], - "query": [] + "query": [ + { + "key": "symbol", + "value": null, + "description": "Cancel the open order for the specified symbol" + }, + { + "key": "tradeType", + "value": null, + "description": "The type of trading : TRADE(Spot), MARGIN_TRADE (Cross Margin), MARGIN_ISOLATED_TRADE (Isolated Margin). Default is TRADE" + }, + { + "key": "orderIds", + "value": null, + "description": "Comma seperated order IDs." + } + ] }, - "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470358)\n\n:::info[Description]\nRequest via this interface to get a oco order information via the client order ID.\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| symbol | string | symbol |\n| clientOid | string | Client Order Id |\n| orderId | string | The unique order id generated by the trading system,which can be used later for further actions such as canceling the order. |\n| orderTime | integer | Order placement time, milliseconds |\n| status | string | Order status: NEW: New, DONE: Completed, TRIGGERED: Triggered, CANCELLED: Cancelled |\n\n---\n", + "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470337)\n\n:::info[Description]\nRequest via this interface to cancel a batch of stop orders.\n\nThe count of orderId in the parameter now is not limited.\n\nAn example is:\n ```/api/v1/stop-order/cancel?symbol=ETH-BTC&tradeType=TRADE&orderIds=5bd6e9286d99522a52e458de,5bd6e9286d99522a52e458df```\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| cancelledOrderIds | array | Refer to the schema section of cancelledOrderIds |\n\n---\n", "body": {} }, "response": [ { "name": "Successful Response", "originalRequest": { - "method": "GET", + "method": "DELETE", "header": [], "url": { "raw": "", @@ -7306,12 +7307,27 @@ ], "path": [ "api", - "v3", - "oco", - "client-order", - "{{clientOid}}" + "v1", + "stop-order", + "cancel" ], - "query": [] + "query": [ + { + "key": "symbol", + "value": null, + "description": "Cancel the open order for the specified symbol" + }, + { + "key": "tradeType", + "value": null, + "description": "The type of trading : TRADE(Spot), MARGIN_TRADE (Cross Margin), MARGIN_ISOLATED_TRADE (Isolated Margin). Default is TRADE" + }, + { + "key": "orderIds", + "value": null, + "description": "Comma seperated order IDs." + } + ] } }, "status": "OK", @@ -7344,12 +7360,12 @@ } ], "cookie": [], - "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"orderId\": \"674c3cfa72cf2800072ee7ce\",\n \"symbol\": \"BTC-USDT\",\n \"clientOid\": \"5c52e1203aa6f3g7f1e493fb\",\n \"orderTime\": 1733049594803,\n \"status\": \"NEW\"\n }\n}" + "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"cancelledOrderIds\": [\n \"671124f9365ccb00073debd4\"\n ]\n }\n}" } ] }, { - "name": "Get Order By ClientOid", + "name": "Get Stop Orders List", "request": { "method": "GET", "header": [], @@ -7362,21 +7378,20 @@ "path": [ "api", "v1", - "hf", - "orders", - "client-order", - "{{clientOid}}" + "stop-order" ], - "query": [ - { - "key": "symbol", - "value": "BTC-USDT", - "description": "symbol" - } - ] + "query": [] }, - "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470182)\n\n:::info[Description]\nThis endpoint can be used to obtain information for a single Spot order using the client order id.\n\nAfter the user successfully places an order, the order is in Active state, and the user can use inOrderBook to determine whether the order has entered the order. Canceled or fully filled orders are marked as completed Done status.\n:::\n\n:::tip[Tips]\nIf the order is not an active order, you can only get data within the time range of 3 _ 24 hours (ie: from the current time to 3 _ 24 hours ago). If the time range is exceeded, the system will query the data within the time range of 3 * 24 hours by default.\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| id | string | The unique order id generated by the trading system |\n| symbol | string | symbol |\n| opType | string | |\n| type | string | Specify if the order is an 'limit' order or 'market' order. |\n| side | string | Buy or sell |\n| price | string | Order price |\n| size | string | Order size |\n| funds | string | Order Funds |\n| dealSize | string | Number of filled transactions |\n| dealFunds | string | Funds of filled transactions |\n| fee | string | [Handling fees](https://www.kucoin.com/docs-new/api-5327739) |\n| feeCurrency | string | currency used to calculate trading fee |\n| stp | string | [Self Trade Prevention](https://www.kucoin.com/docs-new/api-5176570) |\n| timeInForce | string | Time in force |\n| postOnly | boolean | Whether its a postOnly order. |\n| hidden | boolean | Whether its a hidden order. |\n| iceberg | boolean | Whether its a iceberg order. |\n| visibleSize | string | Visible size of iceberg order in order book. |\n| cancelAfter | integer | A GTT timeInForce that expires in n seconds |\n| channel | string | |\n| clientOid | string | Client Order Id,unique identifier created by the user |\n| remark | string | Order placement remarks |\n| tags | string | Order tag |\n| cancelExist | boolean | Whether there is a cancellation record for the order. |\n| createdAt | integer | |\n| lastUpdatedAt | integer | |\n| tradeType | string | Trade type, redundancy param |\n| inOrderBook | boolean | Whether to enter the orderbook: true: enter the orderbook; false: not enter the orderbook |\n| cancelledSize | string | Number of canceled transactions |\n| cancelledFunds | string | Funds of canceled transactions |\n| remainSize | string | Number of remain transactions |\n| remainFunds | string | Funds of remain transactions |\n| tax | string | Users in some regions need query this field |\n| active | boolean | Order status: true-The status of the order isactive; false-The status of the order is done |\n\n---\n", - "body": {} + "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470338)\n\n:::info[Description]\nRequest via this endpoint to get your current untriggered stop order list. Items are paginated and sorted to show the latest first. See the Pagination section for retrieving additional entries after the first page.\n\n:::\n\n\n:::tip[Example]\n```json\n{\n \"currentPage\": 1,\n \"pageSize\": 50,\n \"totalNum\": 1,\n \"totalPage\": 1,\n \"items\": [\n {\n \"id\": \"vs8hoo8kqjnklv4m0038lrfq\",\n \"symbol\": \"KCS-USDT\",\n \"userId\": \"60fe4956c43cbc0006562c2c\",\n \"status\": \"NEW\",\n \"type\": \"limit\",\n \"side\": \"buy\",\n \"price\": \"0.01000000000000000000\",\n \"size\": \"0.01000000000000000000\",\n \"funds\": null,\n \"stp\": null,\n \"timeInForce\": \"GTC\",\n \"cancelAfter\": -1,\n \"postOnly\": false,\n \"hidden\": false,\n \"iceberg\": false,\n \"visibleSize\": null,\n \"channel\": \"API\",\n \"clientOid\": \"404814a0fb4311eb9098acde48001122\",\n \"remark\": null,\n \"tags\": null,\n \"orderTime\": 1628755183702150167,\n \"domainId\": \"kucoin\",\n \"tradeSource\": \"USER\",\n \"tradeType\": \"TRADE\",\n \"feeCurrency\": \"USDT\",\n \"takerFeeRate\": \"0.00200000000000000000\",\n \"makerFeeRate\": \"0.00200000000000000000\",\n \"createdAt\": 1628755183704,\n \"stop\": \"loss\",\n \"stopTriggerTime\": null,\n \"stopPrice\": \"10.00000000000000000000\"\n }\n ]\n}\n```\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| symbol | string | Only list orders for a specific symbol |\n| side | string | buy or sell |\n| type | string | limit, market, limit_stop or market_stop |\n| tradeType | string | The type of trading : TRADE(Spot), MARGIN_TRADE (Cross Margin), MARGIN_ISOLATED_TRADE (Isolated Margin). Default is TRADE |\n| startAt | number | Start time (milisecond) |\n| endAt | number | End time (milisecond) |\n| currentPage | integer | current page |\n| orderIds | string | comma seperated order ID list |\n| pageSize | integer | page size |\n| stop | string | Order type: stop: stop loss order, oco: oco order |\n\n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| currentPage | integer | current page id |\n| pageSize | integer | |\n| totalNum | integer | the stop order count |\n| totalPage | integer | total page count of the list |\n| items | array | Refer to the schema section of items |\n\n**root.data.items Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| id | string | Order ID, the ID of an order. |\n| symbol | string | Symbol name |\n| userId | string | User ID |\n| status | string | Order status, include NEW, TRIGGERED |\n| type | string | Order type,limit, market, limit_stop or market_stop |\n| side | string | transaction direction,include buy and sell |\n| price | string | order price |\n| size | string | order quantity |\n| funds | string | order funds |\n| stp | string | |\n| timeInForce | string | time InForce,include GTC,GTT,IOC,FOK |\n| cancelAfter | integer | cancel orders after n seconds,requires timeInForce to be GTT |\n| postOnly | boolean | postOnly |\n| hidden | boolean | hidden order |\n| iceberg | boolean | Iceberg order |\n| visibleSize | string | displayed quantity for iceberg order |\n| channel | string | order source |\n| clientOid | string | user-entered order unique mark |\n| remark | string | Remarks at stop order creation |\n| tags | string | tag order source |\n| orderTime | integer | Time of place a stop order, accurate to nanoseconds |\n| domainId | string | domainId, e.g: kucoin |\n| tradeSource | string | trade source: USER(Order by user), MARGIN_SYSTEM(Order by margin system) |\n| tradeType | string | The type of trading : TRADE(Spot), MARGIN_TRADE (Cross Margin), MARGIN_ISOLATED_TRADE (Isolated Margin). |\n| feeCurrency | string | The currency of the fee |\n| takerFeeRate | string | Fee Rate of taker |\n| makerFeeRate | string | Fee Rate of maker |\n| createdAt | integer | order creation time |\n| stop | string | Stop order type, include loss and entry |\n| stopTriggerTime | integer | The trigger time of the stop order |\n| stopPrice | string | stop price |\n\n---\n", + "body": { + "mode": "raw", + "raw": "{\n \"symbol\": \"BTC-USDT\",\n \"orderId\": \"670fd33bf9406e0007ab3945\",\n \"newPrice\": \"30000\",\n \"newSize\": \"0.0001\"\n}", + "options": { + "raw": { + "language": "json" + } + } + } }, "response": [ { @@ -7393,18 +7408,9 @@ "path": [ "api", "v1", - "hf", - "orders", - "client-order", - "{{clientOid}}" + "stop-order" ], - "query": [ - { - "key": "symbol", - "value": "BTC-USDT", - "description": "symbol" - } - ] + "query": [] } }, "status": "OK", @@ -7437,14 +7443,14 @@ } ], "cookie": [], - "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"id\": \"6717422bd51c29000775ea03\",\n \"clientOid\": \"5c52e11203aa677f33e493fb\",\n \"symbol\": \"BTC-USDT\",\n \"opType\": \"DEAL\",\n \"type\": \"limit\",\n \"side\": \"buy\",\n \"price\": \"70000\",\n \"size\": \"0.00001\",\n \"funds\": \"0.7\",\n \"dealSize\": \"0.00001\",\n \"dealFunds\": \"0.677176\",\n \"remainSize\": \"0\",\n \"remainFunds\": \"0.022824\",\n \"cancelledSize\": \"0\",\n \"cancelledFunds\": \"0\",\n \"fee\": \"0.000677176\",\n \"feeCurrency\": \"USDT\",\n \"stp\": null,\n \"timeInForce\": \"GTC\",\n \"postOnly\": false,\n \"hidden\": false,\n \"iceberg\": false,\n \"visibleSize\": \"0\",\n \"cancelAfter\": 0,\n \"channel\": \"API\",\n \"remark\": \"order remarks\",\n \"tags\": null,\n \"cancelExist\": false,\n \"tradeType\": \"TRADE\",\n \"inOrderBook\": false,\n \"active\": false,\n \"tax\": \"0\",\n \"createdAt\": 1729577515444,\n \"lastUpdatedAt\": 1729577515481\n }\n}" + "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"currentPage\": 1,\n \"pageSize\": 50,\n \"totalNum\": 1,\n \"totalPage\": 1,\n \"items\": [\n {\n \"id\": \"vs8hoo8kqjnklv4m0038lrfq\",\n \"symbol\": \"KCS-USDT\",\n \"userId\": \"60fe4956c43cbc0006562c2c\",\n \"status\": \"NEW\",\n \"type\": \"limit\",\n \"side\": \"buy\",\n \"price\": \"0.01000000000000000000\",\n \"size\": \"0.01000000000000000000\",\n \"funds\": null,\n \"stp\": null,\n \"timeInForce\": \"GTC\",\n \"cancelAfter\": -1,\n \"postOnly\": false,\n \"hidden\": false,\n \"iceberg\": false,\n \"visibleSize\": null,\n \"channel\": \"API\",\n \"clientOid\": \"404814a0fb4311eb9098acde48001122\",\n \"remark\": null,\n \"tags\": null,\n \"orderTime\": 1628755183702150100,\n \"domainId\": \"kucoin\",\n \"tradeSource\": \"USER\",\n \"tradeType\": \"TRADE\",\n \"feeCurrency\": \"USDT\",\n \"takerFeeRate\": \"0.00200000000000000000\",\n \"makerFeeRate\": \"0.00200000000000000000\",\n \"createdAt\": 1628755183704,\n \"stop\": \"loss\",\n \"stopTriggerTime\": null,\n \"stopPrice\": \"10.00000000000000000000\"\n }\n ]\n }\n}" } ] }, { - "name": "Cancel OCO Order By ClientOid", + "name": "Get Stop Order By OrderId", "request": { - "method": "DELETE", + "method": "GET", "header": [], "url": { "raw": "", @@ -7454,21 +7460,20 @@ ], "path": [ "api", - "v3", - "oco", - "client-order", - "{{clientOid}}" + "v1", + "stop-order", + "{{orderId}}" ], "query": [] }, - "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470355)\n\n:::info[Description]\nRequest via this interface to cancel a stop order via the clientOid.\n\nYou will receive cancelledOrderIds field once the system has received the cancellation request. The cancellation request will be processed by the matching engine in sequence. To know if the request is processed (successfully or not), you may check the order status or the update message from the pushes.\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| cancelledOrderIds | array | Refer to the schema section of cancelledOrderIds |\n\n---\n", + "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470339)\n\n:::info[Description]\nRequest via this interface to get a stop order information via the order ID.\n\n:::\n\n\n:::tip[Example]\n```json\n{\n \"id\": \"vs8hoo8q2ceshiue003b67c0\",\n \"symbol\": \"KCS-USDT\",\n \"userId\": \"60fe4956c43cbc0006562c2c\",\n \"status\": \"NEW\",\n \"type\": \"limit\",\n \"side\": \"buy\",\n \"price\": \"0.01000000000000000000\",\n \"size\": \"0.01000000000000000000\",\n \"funds\": null,\n \"stp\": null,\n \"timeInForce\": \"GTC\",\n \"cancelAfter\": -1,\n \"postOnly\": false,\n \"hidden\": false,\n \"iceberg\": false,\n \"visibleSize\": null,\n \"channel\": \"API\",\n \"clientOid\": \"40e0eb9efe6311eb8e58acde48001122\",\n \"remark\": null,\n \"tags\": null,\n \"orderTime\": 1629098781127530345,\n \"domainId\": \"kucoin\",\n \"tradeSource\": \"USER\",\n \"tradeType\": \"TRADE\",\n \"feeCurrency\": \"USDT\",\n \"takerFeeRate\": \"0.00200000000000000000\",\n \"makerFeeRate\": \"0.00200000000000000000\",\n \"createdAt\": 1629098781128,\n \"stop\": \"loss\",\n \"stopTriggerTime\": null,\n \"stopPrice\": \"10.00000000000000000000\"\n}\n```\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| symbol | string | Only list orders for a specific symbol |\n| side | string | buy or sell |\n| type | string | limit, market, limit_stop or market_stop |\n| tradeType | string | The type of trading : TRADE(Spot), MARGIN_TRADE (Cross Margin), MARGIN_ISOLATED_TRADE (Isolated Margin). Default is TRADE |\n| startAt | number | Start time (milisecond) |\n| endAt | number | End time (milisecond) |\n| currentPage | integer | current page |\n| orderIds | string | comma seperated order ID list |\n| pageSize | integer | page size |\n| stop | string | Order type: stop: stop loss order, oco: oco order |\n\n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| data | object | Refer to the schema section of data |\n| code | string | return status code |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| id | string | Order ID, the ID of an order. |\n| symbol | string | Symbol name |\n| userId | string | User ID |\n| status | string | Order status, include NEW, TRIGGERED |\n| type | string | Order type,limit, market, limit_stop or market_stop |\n| side | string | transaction direction,include buy and sell |\n| price | string | order price |\n| size | string | order quantity |\n| funds | string | order funds |\n| stp | string | |\n| timeInForce | string | time InForce,include GTC,GTT,IOC,FOK |\n| cancelAfter | integer | cancel orders after n seconds,requires timeInForce to be GTT |\n| postOnly | boolean | postOnly |\n| hidden | boolean | hidden order |\n| iceberg | boolean | Iceberg order |\n| visibleSize | string | displayed quantity for iceberg order |\n| channel | string | order source |\n| clientOid | string | user-entered order unique mark |\n| remark | string | Remarks at stop order creation |\n| tags | string | tag order source |\n| domainId | string | domainId, e.g: kucoin |\n| tradeSource | string | trade source: USER(Order by user), MARGIN_SYSTEM(Order by margin system) |\n| tradeType | string | The type of trading : TRADE(Spot), MARGIN_TRADE (Cross Margin), MARGIN_ISOLATED_TRADE (Isolated Margin). |\n| feeCurrency | string | The currency of the fee |\n| takerFeeRate | string | Fee Rate of taker |\n| makerFeeRate | string | Fee Rate of maker |\n| createdAt | integer | order creation time |\n| stop | string | Stop order type, include loss and entry |\n| stopTriggerTime | integer | The trigger time of the stop order |\n| stopPrice | string | stop price |\n| orderTime | integer | Time of place a stop order, accurate to nanoseconds |\n\n---\n", "body": {} }, "response": [ { "name": "Successful Response", "originalRequest": { - "method": "DELETE", + "method": "GET", "header": [], "url": { "raw": "", @@ -7478,10 +7483,9 @@ ], "path": [ "api", - "v3", - "oco", - "client-order", - "{{clientOid}}" + "v1", + "stop-order", + "{{orderId}}" ], "query": [] } @@ -7516,14 +7520,14 @@ } ], "cookie": [], - "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"cancelledOrderIds\": [\n \"vs93gpqc6r0mkk57003gok3h\",\n \"vs93gpqc6r0mkk57003gok3i\"\n ]\n }\n}" + "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"id\": \"vs8hoo8q2ceshiue003b67c0\",\n \"symbol\": \"KCS-USDT\",\n \"userId\": \"60fe4956c43cbc0006562c2c\",\n \"status\": \"NEW\",\n \"type\": \"limit\",\n \"side\": \"buy\",\n \"price\": \"0.01000000000000000000\",\n \"size\": \"0.01000000000000000000\",\n \"funds\": null,\n \"stp\": null,\n \"timeInForce\": \"GTC\",\n \"cancelAfter\": -1,\n \"postOnly\": false,\n \"hidden\": false,\n \"iceberg\": false,\n \"visibleSize\": null,\n \"channel\": \"API\",\n \"clientOid\": \"40e0eb9efe6311eb8e58acde48001122\",\n \"remark\": null,\n \"tags\": null,\n \"orderTime\": 1629098781127530200,\n \"domainId\": \"kucoin\",\n \"tradeSource\": \"USER\",\n \"tradeType\": \"TRADE\",\n \"feeCurrency\": \"USDT\",\n \"takerFeeRate\": \"0.00200000000000000000\",\n \"makerFeeRate\": \"0.00200000000000000000\",\n \"createdAt\": 1629098781128,\n \"stop\": \"loss\",\n \"stopTriggerTime\": null,\n \"stopPrice\": \"10.00000000000000000000\"\n }\n}" } ] }, { - "name": "Cancel Partial Order", + "name": "Get Stop Order By ClientOid", "request": { - "method": "DELETE", + "method": "GET", "header": [], "url": { "raw": "", @@ -7534,32 +7538,30 @@ "path": [ "api", "v1", - "hf", - "orders", - "cancel", - "{{orderId}}" + "stop-order", + "queryOrderByClientOid" ], "query": [ { - "key": "symbol", - "value": "BTC-USDT", - "description": "symbol" + "key": "clientOid", + "value": null, + "description": "The client order id" }, { - "key": "cancelSize", - "value": "0.00001", - "description": "The size you want cancel" + "key": "symbol", + "value": null, + "description": "symbol name" } ] }, - "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470183)\n\n:::info[Description]\nThis interface can cancel the specified quantity of the order according to the orderId.\nThe order execution order is: price first, time first, this interface will not change the queue order\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| orderId | string | order id |\n| cancelSize | string | The size you canceled |\n\n---\n", + "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470340)\n\n:::info[Description]\nRequest via this interface to get a stop order information via the clientOid.\n\n:::\n\n\n:::tip[Example]\n```json\n{\n \"id\": \"vs8hoo8q2ceshiue003b67c0\",\n \"symbol\": \"KCS-USDT\",\n \"userId\": \"60fe4956c43cbc0006562c2c\",\n \"status\": \"NEW\",\n \"type\": \"limit\",\n \"side\": \"buy\",\n \"price\": \"0.01000000000000000000\",\n \"size\": \"0.01000000000000000000\",\n \"funds\": null,\n \"stp\": null,\n \"timeInForce\": \"GTC\",\n \"cancelAfter\": -1,\n \"postOnly\": false,\n \"hidden\": false,\n \"iceberg\": false,\n \"visibleSize\": null,\n \"channel\": \"API\",\n \"clientOid\": \"40e0eb9efe6311eb8e58acde48001122\",\n \"remark\": null,\n \"tags\": null,\n \"orderTime\": 1629098781127530345,\n \"domainId\": \"kucoin\",\n \"tradeSource\": \"USER\",\n \"tradeType\": \"TRADE\",\n \"feeCurrency\": \"USDT\",\n \"takerFeeRate\": \"0.00200000000000000000\",\n \"makerFeeRate\": \"0.00200000000000000000\",\n \"createdAt\": 1629098781128,\n \"stop\": \"loss\",\n \"stopTriggerTime\": null,\n \"stopPrice\": \"10.00000000000000000000\"\n}\n```\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| symbol | string | Only list orders for a specific symbol |\n| side | string | buy or sell |\n| type | string | limit, market, limit_stop or market_stop |\n| tradeType | string | The type of trading : TRADE(Spot), MARGIN_TRADE (Cross Margin), MARGIN_ISOLATED_TRADE (Isolated Margin). Default is TRADE |\n| startAt | integer | Start time (milisecond) |\n| endAt | integer | End time (milisecond) |\n| currentPage | integer | current page |\n| orderIds | string | comma seperated order ID list |\n| pageSize | integer | page size |\n| stop | string | Order type: stop: stop loss order, oco: oco order |\n\n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | the return code |\n| data | array | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| id | string | Order ID, the ID of an order. |\n| symbol | string | Symbol name |\n| userId | string | User ID |\n| status | string | Order status, include NEW, TRIGGERED |\n| type | string | Order type,limit, market, limit_stop or market_stop |\n| side | string | transaction direction,include buy and sell |\n| price | string | order price |\n| size | string | order quantity |\n| funds | string | order funds |\n| stp | string | |\n| timeInForce | string | time InForce,include GTC,GTT,IOC,FOK |\n| cancelAfter | integer | cancel orders after n seconds,requires timeInForce to be GTT |\n| postOnly | boolean | postOnly |\n| hidden | boolean | hidden order |\n| iceberg | boolean | Iceberg order |\n| visibleSize | string | displayed quantity for iceberg order |\n| channel | string | order source |\n| clientOid | string | user-entered order unique mark |\n| remark | string | Remarks at stop order creation |\n| tags | string | tag order source |\n| domainId | string | domainId, e.g: kucoin |\n| tradeSource | string | trade source: USER(Order by user), MARGIN_SYSTEM(Order by margin system) |\n| tradeType | string | The type of trading : TRADE(Spot), MARGIN_TRADE (Cross Margin), MARGIN_ISOLATED_TRADE (Isolated Margin). |\n| feeCurrency | string | The currency of the fee |\n| takerFeeRate | string | Fee Rate of taker |\n| makerFeeRate | string | Fee Rate of maker |\n| createdAt | integer | order creation time |\n| stop | string | Stop order type, include loss and entry |\n| stopTriggerTime | integer | The trigger time of the stop order |\n| stopPrice | string | stop price |\n| orderTime | integer | Time of place a stop order, accurate to nanoseconds |\n\n---\n", "body": {} }, "response": [ { "name": "Successful Response", "originalRequest": { - "method": "DELETE", + "method": "GET", "header": [], "url": { "raw": "", @@ -7570,21 +7572,19 @@ "path": [ "api", "v1", - "hf", - "orders", - "cancel", - "{{orderId}}" + "stop-order", + "queryOrderByClientOid" ], "query": [ { - "key": "symbol", - "value": "BTC-USDT", - "description": "symbol" + "key": "clientOid", + "value": null, + "description": "The client order id" }, { - "key": "cancelSize", - "value": "0.00001", - "description": "The size you want cancel" + "key": "symbol", + "value": null, + "description": "symbol name" } ] } @@ -7619,14 +7619,14 @@ } ], "cookie": [], - "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"orderId\": \"6711f73c1ef16c000717bb31\",\n \"cancelSize\": \"0.00001\"\n }\n}" + "body": "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"id\": \"vs8hoo8os561f5np0032vngj\",\n \"symbol\": \"KCS-USDT\",\n \"userId\": \"60fe4956c43cbc0006562c2c\",\n \"status\": \"NEW\",\n \"type\": \"limit\",\n \"side\": \"buy\",\n \"price\": \"0.01000000000000000000\",\n \"size\": \"0.01000000000000000000\",\n \"funds\": null,\n \"stp\": null,\n \"timeInForce\": \"GTC\",\n \"cancelAfter\": -1,\n \"postOnly\": false,\n \"hidden\": false,\n \"iceberg\": false,\n \"visibleSize\": null,\n \"channel\": \"API\",\n \"clientOid\": \"2b700942b5db41cebe578cff48960e09\",\n \"remark\": null,\n \"tags\": null,\n \"orderTime\": 1629020492834532600,\n \"domainId\": \"kucoin\",\n \"tradeSource\": \"USER\",\n \"tradeType\": \"TRADE\",\n \"feeCurrency\": \"USDT\",\n \"takerFeeRate\": \"0.00200000000000000000\",\n \"makerFeeRate\": \"0.00200000000000000000\",\n \"createdAt\": 1629020492837,\n \"stop\": \"loss\",\n \"stopTriggerTime\": null,\n \"stopPrice\": \"1.00000000000000000000\"\n }\n ]\n}" } ] }, { - "name": "Cancel Order By ClientOid", + "name": "Add OCO Order", "request": { - "method": "DELETE", + "method": "POST", "header": [], "url": { "raw": "", @@ -7636,28 +7636,28 @@ ], "path": [ "api", - "v1", - "hf", - "orders", - "client-order", - "{{clientOid}}" + "v3", + "oco", + "order" ], - "query": [ - { - "key": "symbol", - "value": "BTC-USDT", - "description": "symbol" - } - ] + "query": [] }, - "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470184)\n\n:::info[Description]\nThis endpoint can be used to cancel a spot order by clientOid.\nThis endpoint only sends cancellation requests. The results of the requests must be obtained by checking the order status or subscribing to websocket.\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| clientOid | string | Client Order Id,unique identifier created by the user |\n\n---\n", - "body": {} + "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470353)\n\n:::info[Description]\nPlace OCO order to the Spot trading system\n:::\n\n:::tip[Tips]\nThe maximum untriggered stop orders for a single trading pair in one account is 20.\n:::\n\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| clientOid | string | Client Order Id,The ClientOid field is a unique ID created by the user(we recommend using a UUID), and can only contain numbers, letters, underscores (_), and hyphens (-). This field is returned when order information is obtained. You can use clientOid to tag your orders. ClientOid is different from the order ID created by the service provider. Please do not initiate requests using the same clientOid. The maximum length for the ClientOid is 40 characters.

Please remember the orderId created by the service provider, it used to check for updates in order status. |\n| side | string | specify if the order is to 'buy' or 'sell' |\n| symbol | string | symbol |\n| remark | string | Order placement remarks, length cannot exceed 20 characters (ASCII) |\n| price | string | Specify price for order |\n| size | string | Specify quantity for order |\n| stopPrice | string | trigger price. |\n| limitPrice | string | The limit order price after take-profit and stop-loss are triggered. |\n| tradeType | string | Transaction Type, currently only supports TRADE (spot transactions), the default is TRADE |\n\n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| orderId | string | The unique order id generated by the trading system,which can be used later for further actions such as canceling the order. |\n\n---\n", + "body": { + "mode": "raw", + "raw": "{\n \"symbol\": \"BTC-USDT\",\n \"side\": \"buy\",\n \"price\": \"94000\",\n \"size\": \"0.1\",\n \"clientOid\": \"5c52e11203aa67f1e493fb\",\n \"stopPrice\": \"98000\",\n \"limitPrice\": \"96000\",\n \"remark\": \"this is remark\",\n \"tradeType\": \"TRADE\"\n}", + "options": { + "raw": { + "language": "json" + } + } + } }, "response": [ { "name": "Successful Response", "originalRequest": { - "method": "DELETE", + "method": "POST", "header": [], "url": { "raw": "", @@ -7667,19 +7667,11 @@ ], "path": [ "api", - "v1", - "hf", - "orders", - "client-order", - "{{clientOid}}" + "v3", + "oco", + "order" ], - "query": [ - { - "key": "symbol", - "value": "BTC-USDT", - "description": "symbol" - } - ] + "query": [] } }, "status": "OK", @@ -7712,12 +7704,12 @@ } ], "cookie": [], - "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"clientOid\": \"5c52e11203aa677f33e493fb\"\n }\n}" + "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"orderId\": \"674c316e688dea0007c7b986\"\n }\n}" } ] }, { - "name": "Cancel Stop Order By ClientOid", + "name": "Cancel OCO Order By OrderId", "request": { "method": "DELETE", "header": [], @@ -7729,24 +7721,14 @@ ], "path": [ "api", - "v1", - "stop-order", - "cancelOrderByClientOid" + "v3", + "oco", + "order", + "{{orderId}}" ], - "query": [ - { - "key": "symbol", - "value": "BTC-USDT", - "description": "symbol" - }, - { - "key": "clientOid", - "value": "689ff597f4414061aa819cc414836abd", - "description": "Unique order id created by users to identify their orders" - } - ] + "query": [] }, - "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470336)\n\n:::info[Description]\nThis endpoint can be used to cancel a spot order by clientOid.\nThis endpoint only sends cancellation requests. The results of the requests must be obtained by checking the order status or subscribing to websocket.\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| clientOid | string | Client Order Id,unique identifier created by the user |\n| cancelledOrderId | string | Unique ID of the cancelled order |\n\n---\n", + "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470354)\n\n:::info[Description]\nRequest via this endpoint to cancel a single oco order previously placed.\n\nYou will receive cancelledOrderIds field once the system has received the cancellation request. The cancellation request will be processed by the matching engine in sequence. To know if the request is processed (successfully or not), you may check the order status or the update message from the pushes.\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| cancelledOrderIds | array | Refer to the schema section of cancelledOrderIds |\n\n---\n", "body": {} }, "response": [ @@ -7763,22 +7745,12 @@ ], "path": [ "api", - "v1", - "stop-order", - "cancelOrderByClientOid" + "v3", + "oco", + "order", + "{{orderId}}" ], - "query": [ - { - "key": "symbol", - "value": "BTC-USDT", - "description": "symbol" - }, - { - "key": "clientOid", - "value": "689ff597f4414061aa819cc414836abd", - "description": "Unique order id created by users to identify their orders" - } - ] + "query": [] } }, "status": "OK", @@ -7811,12 +7783,12 @@ } ], "cookie": [], - "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"cancelledOrderId\": \"vs8hoo8ksc8mario0035a74n\",\n \"clientOid\": \"689ff597f4414061aa819cc414836abd\"\n }\n}" + "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"cancelledOrderIds\": [\n \"vs93gpqc6kkmkk57003gok16\",\n \"vs93gpqc6kkmkk57003gok17\"\n ]\n }\n}" } ] }, { - "name": "Cancel Order By OrderId Sync", + "name": "Cancel OCO Order By ClientOid", "request": { "method": "DELETE", "header": [], @@ -7828,21 +7800,14 @@ ], "path": [ "api", - "v1", - "hf", - "orders", - "sync", - "{{orderId}}" - ], - "query": [ - { - "key": "symbol", - "value": "BTC-USDT", - "description": "symbol" - } - ] + "v3", + "oco", + "client-order", + "{{clientOid}}" + ], + "query": [] }, - "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470185)\n\n:::info[Description]\nThis endpoint can be used to cancel a spot order by orderId.\n\nThe difference between this interface and \"Cancel Order By OrderId\" is that this interface will synchronously return the order information after the order canceling is completed.\n\nFor higher latency requirements, please select the \"Cancel Order By OrderId\" interface. If there is a requirement for returning data integrity, please select this interface\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| orderId | string | order id |\n| originSize | string | original order size |\n| dealSize | string | deal size |\n| remainSize | string | remain size |\n| canceledSize | string | Cumulative canceled size |\n| status | string | Order Status. open:order is active; done:order has been completed |\n\n---\n", + "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470355)\n\n:::info[Description]\nRequest via this interface to cancel a stop order via the clientOid.\n\nYou will receive cancelledOrderIds field once the system has received the cancellation request. The cancellation request will be processed by the matching engine in sequence. To know if the request is processed (successfully or not), you may check the order status or the update message from the pushes.\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| cancelledOrderIds | array | Refer to the schema section of cancelledOrderIds |\n\n---\n", "body": {} }, "response": [ @@ -7859,19 +7824,12 @@ ], "path": [ "api", - "v1", - "hf", - "orders", - "sync", - "{{orderId}}" + "v3", + "oco", + "client-order", + "{{clientOid}}" ], - "query": [ - { - "key": "symbol", - "value": "BTC-USDT", - "description": "symbol" - } - ] + "query": [] } }, "status": "OK", @@ -7904,12 +7862,12 @@ } ], "cookie": [], - "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"orderId\": \"671128ee365ccb0007534d45\",\n \"originSize\": \"0.00001\",\n \"dealSize\": \"0\",\n \"remainSize\": \"0\",\n \"canceledSize\": \"0.00001\",\n \"status\": \"done\"\n }\n}" + "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"cancelledOrderIds\": [\n \"vs93gpqc6r0mkk57003gok3h\",\n \"vs93gpqc6r0mkk57003gok3i\"\n ]\n }\n}" } ] }, { - "name": "Cancel Order By ClientOid Sync", + "name": "Batch Cancel OCO Order", "request": { "method": "DELETE", "header": [], @@ -7921,22 +7879,24 @@ ], "path": [ "api", - "v1", - "hf", - "orders", - "sync", - "client-order", - "{{clientOid}}" + "v3", + "oco", + "orders" ], "query": [ + { + "key": "orderIds", + "value": "674c388172cf2800072ee746,674c38bdfd8300000795167e", + "description": "Specify the order id, there can be multiple orders, separated by commas. If not passed, all oco orders will be canceled by default." + }, { "key": "symbol", "value": "BTC-USDT", - "description": "symbol" + "description": "trading pair. If not passed, the oco orders of all symbols will be canceled by default." } ] }, - "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470186)\n\n:::info[Description]\nThis endpoint can be used to cancel a spot order by clientOid.\n\nThe difference between this interface and \"Cancel Order By ClientOid\" is that this interface will synchronously return the order information after the order canceling is completed.\n\nFor higher latency requirements, please select the \"Cancel Order By ClientOid\" interface. If there is a requirement for returning data integrity, please select this interface\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| clientOid | string | Client Order Id,unique identifier created by the user |\n| originSize | string | original order size |\n| dealSize | string | deal size |\n| remainSize | string | remain size |\n| canceledSize | string | Cumulative canceled size |\n| status | string | Order Status. open:order is active; done:order has been completed |\n\n---\n", + "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470356)\n\n:::info[Description]\nThis interface can batch cancel OCO orders through orderIds.\n\nYou will receive cancelledOrderIds field once the system has received the cancellation request. The cancellation request will be processed by the matching engine in sequence. To know if the request is processed (successfully or not), you may check the order status or the update message from the pushes.\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| cancelledOrderIds | array | Refer to the schema section of cancelledOrderIds |\n\n---\n", "body": {} }, "response": [ @@ -7953,18 +7913,20 @@ ], "path": [ "api", - "v1", - "hf", - "orders", - "sync", - "client-order", - "{{clientOid}}" + "v3", + "oco", + "orders" ], "query": [ + { + "key": "orderIds", + "value": "674c388172cf2800072ee746,674c38bdfd8300000795167e", + "description": "Specify the order id, there can be multiple orders, separated by commas. If not passed, all oco orders will be canceled by default." + }, { "key": "symbol", "value": "BTC-USDT", - "description": "symbol" + "description": "trading pair. If not passed, the oco orders of all symbols will be canceled by default." } ] } @@ -7999,14 +7961,14 @@ } ], "cookie": [], - "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"clientOid\": \"5c52e11203aa677f33e493fb\",\n \"originSize\": \"0.00001\",\n \"dealSize\": \"0\",\n \"remainSize\": \"0\",\n \"canceledSize\": \"0.00001\",\n \"status\": \"done\"\n }\n}" + "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"cancelledOrderIds\": [\n \"vs93gpqc750mkk57003gok6i\",\n \"vs93gpqc750mkk57003gok6j\",\n \"vs93gpqc75c39p83003tnriu\",\n \"vs93gpqc75c39p83003tnriv\"\n ]\n }\n}" } ] }, { - "name": "Add Order Test", + "name": "Get OCO Order By OrderId", "request": { - "method": "POST", + "method": "GET", "header": [], "url": { "raw": "", @@ -8016,29 +7978,21 @@ ], "path": [ "api", - "v1", - "hf", - "orders", - "test" + "v3", + "oco", + "order", + "{{orderId}}" ], "query": [] }, - "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470187)\n\n:::info[Description]\nOrder test endpoint, the request parameters and return parameters of this endpoint are exactly the same as the order endpoint, and can be used to verify whether the signature is correct and other operations. After placing an order, the order will not enter the matching system, and the order cannot be queried.\n:::\n\n:::tip[Tips]\nPlease note that once your order enters the order book, the system will freeze the handling fees for the order ahead of time.\n\nBefore placing orders, please be sure to fully understand the meaning of the parameters for each trading pair.\n:::\n\n:::tip[Tips]\nThe maximum number of active orders per account is 2000, with a maximum of 200 active orders per trading pair.\n:::\n\n\n**Public order placement request parameters**\n\n| Param | Type | Mandatory | Description |\n| --------- | ------ | --------- | ----------- |\n| clientOid | String | No | Client Order Id,unique identifier created by the user, the use of UUID is recommended |\n| symbol | String | Yes | symbol |\n| type | String | Yes | Order type `limit` and `market` |\n| side | String | Yes | `buy` or `sell` |\n| stp | String | No | self trade prevention is divided into four strategies: `CN`, `CO`, `CB` , and `DC` |\n| tags | String | No | Order tag, length cannot exceed `20` characters (ASCII) |\n| remark | String | No | Order placement remarks, length cannot exceed `20` characters (ASCII) |\n\n**Additional Request Parameters Required by `limit` Orders**\n\n| Param | Type | Mandatory | Description |\n| ----------- | ------- | --------- | ----------- |\n| price | String | Yes | Specify price for currency |\n| size | String | Yes | Specify quantity for currency |\n| timeInForce | String | No | Order timing strategy `GTC`, `GTT`, `IOC`, `FOK` (The default is `GTC`) |\n| cancelAfter | long | No | Cancel after `n` seconds,the order timing strategy is `GTT` |\n| postOnly | boolean | No | passive order labels, this is disabled when the order timing strategy is `IOC` or `FOK` |\n| hidden | boolean | No | Hidden or not (not shown in order book) |\n| iceberg | boolean | No | Whether or not only visible portions of orders are shown in iceberg orders |\n| visibleSize | String | No | Maximum visible quantity in iceberg orders |\n\n**Additional request parameters required by `market` orders**\n\n| Param | Type | Mandatory | Description |\n| ----- | ------ | --------- | ------------------------------------------ |\n| size | String | No | (Select one out of two: `size` or `funds`) |\n| funds | String | No | (Select one out of two: `size` or `funds`) |\n\n\n**Hold**\n\nFor limit price purchase orders, we will hold the amount of funds (price * size) required for your purchase order. Similarly, for limit price sell orders, we will also hold you sell order assets. When the transaction is executed, the service fees will be calculated. If you cancel a portion of a filled or unfilled order, then the remaining funds or amounts will be released and returned to your account. For market price buy/sell orders that require specific funds, we will hold the required funds in from your account. If only the size is specified, we may freeze (usually for a very short amount of time) all of the funds in your account prior to the order being filled or cancelled.\n\n\n**Order Lifecycle**\n\nWhen an order placement request is successful (the matching engine receives the order) or denied (due to there being insufficient funds or illegal parameter values, etc.), the system will respond to the HTTP request. When an order is successfully placed, the order ID is returned. The order will be matched, which could result in it being fully or partially filled. When an order is fully or partially filled, the remaining portions of the order will be in an active state awaiting to be matched (this does not include IOC orders). Orders that are fully or partially filled(already cancelled) will be put into the “done” state.\n\nUsers that have subscribed to the Market Data Channel can use the order ID (orderId) and client ID (clientOid) to identify messages.\n\n**Price Protection Mechanisms**\n\nPrice protection mechanisms ae enabled for order placements. Rules are detailed below:\n\n- If the spot trading market order/limit order placed by the user can be directly matched with an order in the current order book, the system will judge whether deviation between the price corresponding to the transaction depth and the spread exceeds the threshold value (the threshold value can be obtained using the symbol API endpoint);\n\n- If it is exceeded, for limit orders, the order will be directly cancelled;\n\n- If it is a market order, then the system will partially execute the order. The execution limit will be the order size within the price range corresponding to the threshold value. The remaining orders will not be filled.\n\nFor example: if the threshold value is 10%, when a user places a market price purchase order in the KCS/USDT trading market for 10,000 USDT (the selling price is currently 1.20000), the system will determine that after the order is completely filled, the final price will be 1.40000. (1.40000-1.20000)/1.20000=16.7%>10%. The threshold value is 1.32000. The user’s market price purchase order will be filled only to a maximum of 1.32000. The remaining order portions will not be matched with orders in the order book. Note: this feature may not be able to determine depth with complete accuracy. If your order is not completely filled, it may be because the portion exceeding the threshold value was not filled.\n\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| clientOid | string | Client Order Id,The ClientOid field is a unique ID created by the user(we recommend using a UUID), and can only contain numbers, letters, underscores (_), and hyphens (-). This field is returned when order information is obtained. You can use clientOid to tag your orders. ClientOid is different from the order ID created by the service provider. Please do not initiate requests using the same clientOid. The maximum length for the ClientOid is 40 characters.

Please remember the orderId created by the service provider, it used to check for updates in order status. |\n| side | string | specify if the order is to 'buy' or 'sell' |\n| symbol | string | symbol |\n| type | string | specify if the order is an 'limit' order or 'market' order.

The type of order you specify when you place your order determines whether or not you need to request other parameters and also affects the execution of the matching engine.

When placing a limit order, you must specify a price and size. The system will try to match the order according to market price or a price better than market price. If the order cannot be immediately matched, it will stay in the order book until it is matched or the user cancels.

Unlike limit orders, the price for market orders fluctuates with market prices. When placing a market order, you do not need to specify a price, you only need to specify a quantity. Market orders are filled immediately and will not enter the order book. All market orders are takers and a taker fee will be charged. |\n| remark | string | Order placement remarks, length cannot exceed 20 characters (ASCII) |\n| stp | string | [Self Trade Prevention](https://www.kucoin.com/docs-new/doc-338146) is divided into four strategies: CN, CO, CB , and DC |\n| price | string | Specify price for order

When placing a limit order, the price must be based on priceIncrement for the trading pair. The price increment (priceIncrement) is the price precision for the trading pair. For example, for the BTC-USDT trading pair, the priceIncrement is 0.00001000. So the price for your orders cannot be less than 0.00001000 and must be a multiple of priceIncrement. Otherwise, the order will return an invalid priceIncrement error. |\n| size | string | Specify quantity for order

When **type** is limit, size refers to the amount of trading targets (the asset name written in front) for the trading pair. Teh Size must be based on the baseIncrement of the trading pair. The baseIncrement represents the precision for the trading pair. The size of an order must be a positive-integer multiple of baseIncrement and must be between baseMinSize and baseMaxSize.

When **type** is market, select one out of two: size or funds |\n| timeInForce | string | [Time in force](https://www.kucoin.com/docs-new/doc-338146) is a special strategy used during trading |\n| postOnly | boolean | passive order labels, this is disabled when the order timing strategy is IOC or FOK |\n| hidden | boolean | [Hidden order](https://www.kucoin.com/docs-new/doc-338146) or not (not shown in order book) |\n| iceberg | boolean | Whether or not only visible portions of orders are shown in [Iceberg orders](https://www.kucoin.com/docs-new/doc-338146) |\n| visibleSize | string | Maximum visible quantity in iceberg orders |\n| tags | string | Order tag, length cannot exceed 20 characters (ASCII) |\n| cancelAfter | integer | Cancel after n seconds,the order timing strategy is GTT |\n| funds | string | When **type** is market, select one out of two: size or funds |\n\n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| orderId | string | The unique order id generated by the trading system,which can be used later for further actions such as canceling the order. |\n| clientOid | string | The user self-defined order id. |\n\n---\n", - "body": { - "mode": "raw", - "raw": "//limit order\n{\n \"type\": \"limit\",\n \"symbol\": \"BTC-USDT\",\n \"side\": \"buy\",\n \"price\": \"50000\",\n \"size\": \"0.00001\",\n \"clientOid\": \"5c52e11203aa677f33e493f\",\n \"remark\": \"order remarks\"\n}\n\n//market order 1\n// {\n// \"type\": \"market\",\n// \"symbol\": \"BTC-USDT\",\n// \"side\": \"buy\",\n// \"size\": \"0.00001\",\n// \"clientOid\": \"5c52e11203aa677f33e493fc\",\n// \"remark\": \"order remarks\",\n// }\n\n//market order 2\n// {\n// \"type\": \"market\",\n// \"symbol\": \"BTC-USDT\",\n// \"side\": \"buy\",\n// \"funds\": \"1\",\n// \"clientOid\": \"5c52e11203aa677f33e493fc\",\n// \"remark\": \"order remarks\",\n// }\n", - "options": { - "raw": { - "language": "json" - } - } - } + "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470357)\n\n:::info[Description]\nRequest via this interface to get a oco order information via the order ID.\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| symbol | string | symbol |\n| clientOid | string | Client Order Id |\n| orderId | string | The unique order id generated by the trading system,which can be used later for further actions such as canceling the order. |\n| orderTime | integer | Order placement time, milliseconds |\n| status | string | Order status: NEW: New, DONE: Completed, TRIGGERED: Triggered, CANCELLED: Cancelled |\n\n---\n", + "body": {} }, "response": [ { "name": "Successful Response", "originalRequest": { - "method": "POST", + "method": "GET", "header": [], "url": { "raw": "", @@ -8048,10 +8002,10 @@ ], "path": [ "api", - "v1", - "hf", - "orders", - "test" + "v3", + "oco", + "order", + "{{orderId}}" ], "query": [] } @@ -8086,14 +8040,14 @@ } ], "cookie": [], - "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"orderId\": \"670fd33bf9406e0007ab3945\",\n \"clientOid\": \"5c52e11203aa677f33e493fb\"\n }\n}" + "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"orderId\": \"674c3b6e688dea0007c7bab2\",\n \"symbol\": \"BTC-USDT\",\n \"clientOid\": \"5c52e1203aa6f37f1e493fb\",\n \"orderTime\": 1733049198863,\n \"status\": \"NEW\"\n }\n}" } ] }, { - "name": "Add Order", + "name": "Get OCO Order By ClientOid", "request": { - "method": "POST", + "method": "GET", "header": [], "url": { "raw": "", @@ -8103,28 +8057,21 @@ ], "path": [ "api", - "v1", - "hf", - "orders" + "v3", + "oco", + "client-order", + "{{clientOid}}" ], "query": [] }, - "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470188)\n\n:::info[Description]\nPlace order to the Spot trading system, you can place two major types of orders: limit and market. Orders can only be placed if your account has sufficient funds. Once an order is placed, your funds will be put on hold for the duration of the order. The amount of funds on hold depends on the order type and parameters specified.\n:::\n\n:::tip[Tips]\nPlease note that once your order enters the order book, the system will freeze the handling fees for the order ahead of time.\n\nBefore placing orders, please be sure to fully understand the meaning of the parameters for each trading pair.\n:::\n\n:::tip[Tips]\nThe maximum number of active orders per account is 2000, with a maximum of 200 active orders per trading pair.\n:::\n\n\n**Public order placement request parameters**\n\n| Param | Type | Mandatory | Description |\n| --------- | ------ | --------- | ----------- |\n| clientOid | String | No | Client Order Id,unique identifier created by the user, the use of UUID is recommended |\n| symbol | String | Yes | symbol |\n| type | String | Yes | Order type `limit` and `market` |\n| side | String | Yes | `buy` or `sell` |\n| stp | String | No | self trade prevention is divided into four strategies: `CN`, `CO`, `CB` , and `DC` |\n| tags | String | No | Order tag, length cannot exceed `20` characters (ASCII) |\n| remark | String | No | Order placement remarks, length cannot exceed `20` characters (ASCII) |\n\n**Additional Request Parameters Required by `limit` Orders**\n\n| Param | Type | Mandatory | Description |\n| ----------- | ------- | --------- | ----------- |\n| price | String | Yes | Specify price for currency |\n| size | String | Yes | Specify quantity for currency |\n| timeInForce | String | No | Order timing strategy `GTC`, `GTT`, `IOC`, `FOK` (The default is `GTC`) |\n| cancelAfter | long | No | Cancel after `n` seconds,the order timing strategy is `GTT` |\n| postOnly | boolean | No | passive order labels, this is disabled when the order timing strategy is `IOC` or `FOK` |\n| hidden | boolean | No | Hidden or not (not shown in order book) |\n| iceberg | boolean | No | Whether or not only visible portions of orders are shown in iceberg orders |\n| visibleSize | String | No | Maximum visible quantity in iceberg orders |\n\n**Additional request parameters required by `market` orders**\n\n| Param | Type | Mandatory | Description |\n| ----- | ------ | --------- | ------------------------------------------ |\n| size | String | No | (Select one out of two: `size` or `funds`) |\n| funds | String | No | (Select one out of two: `size` or `funds`) |\n\n\n\n**Hold**\n\nFor limit price purchase orders, we will hold the amount of funds (price * size) required for your purchase order. Similarly, for limit price sell orders, we will also hold you sell order assets. When the transaction is executed, the service fees will be calculated. If you cancel a portion of a filled or unfilled order, then the remaining funds or amounts will be released and returned to your account. For market price buy/sell orders that require specific funds, we will hold the required funds in from your account. If only the size is specified, we may freeze (usually for a very short amount of time) all of the funds in your account prior to the order being filled or cancelled.\n\n\n**Order Lifecycle**\n\nWhen an order placement request is successful (the matching engine receives the order) or denied (due to there being insufficient funds or illegal parameter values, etc.), the system will respond to the HTTP request. When an order is successfully placed, the order ID is returned. The order will be matched, which could result in it being fully or partially filled. When an order is fully or partially filled, the remaining portions of the order will be in an active state awaiting to be matched (this does not include IOC orders). Orders that are fully or partially filled(already cancelled) will be put into the “done” state.\n\nUsers that have subscribed to the Market Data Channel can use the order ID (orderId) and client ID (clientOid) to identify messages.\n\n**Price Protection Mechanisms**\n\nPrice protection mechanisms ae enabled for order placements. Rules are detailed below:\n\n- If the spot trading market order/limit order placed by the user can be directly matched with an order in the current order book, the system will judge whether deviation between the price corresponding to the transaction depth and the spread exceeds the threshold value (the threshold value can be obtained using the symbol API endpoint);\n\n- If it is exceeded, for limit orders, the order will be directly cancelled;\n\n- If it is a market order, then the system will partially execute the order. The execution limit will be the order size within the price range corresponding to the threshold value. The remaining orders will not be filled.\n\nFor example: if the threshold value is 10%, when a user places a market price purchase order in the KCS/USDT trading market for 10,000 USDT (the selling price is currently 1.20000), the system will determine that after the order is completely filled, the final price will be 1.40000. (1.40000-1.20000)/1.20000=16.7%>10%. The threshold value is 1.32000. The user’s market price purchase order will be filled only to a maximum of 1.32000. The remaining order portions will not be matched with orders in the order book. Note: this feature may not be able to determine depth with complete accuracy. If your order is not completely filled, it may be because the portion exceeding the threshold value was not filled.\n\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| clientOid | string | Client Order Id,The ClientOid field is a unique ID created by the user(we recommend using a UUID), and can only contain numbers, letters, underscores (_), and hyphens (-). This field is returned when order information is obtained. You can use clientOid to tag your orders. ClientOid is different from the order ID created by the service provider. Please do not initiate requests using the same clientOid. The maximum length for the ClientOid is 40 characters.

Please remember the orderId created by the service provider, it used to check for updates in order status. |\n| side | string | specify if the order is to 'buy' or 'sell' |\n| symbol | string | symbol |\n| type | string | specify if the order is an 'limit' order or 'market' order.

The type of order you specify when you place your order determines whether or not you need to request other parameters and also affects the execution of the matching engine.

When placing a limit order, you must specify a price and size. The system will try to match the order according to market price or a price better than market price. If the order cannot be immediately matched, it will stay in the order book until it is matched or the user cancels.

Unlike limit orders, the price for market orders fluctuates with market prices. When placing a market order, you do not need to specify a price, you only need to specify a quantity. Market orders are filled immediately and will not enter the order book. All market orders are takers and a taker fee will be charged. |\n| remark | string | Order placement remarks, length cannot exceed 20 characters (ASCII) |\n| stp | string | [Self Trade Prevention](https://www.kucoin.com/docs-new/doc-338146) is divided into four strategies: CN, CO, CB , and DC |\n| price | string | Specify price for order

When placing a limit order, the price must be based on priceIncrement for the trading pair. The price increment (priceIncrement) is the price precision for the trading pair. For example, for the BTC-USDT trading pair, the priceIncrement is 0.00001000. So the price for your orders cannot be less than 0.00001000 and must be a multiple of priceIncrement. Otherwise, the order will return an invalid priceIncrement error. |\n| size | string | Specify quantity for order

When **type** is limit, size refers to the amount of trading targets (the asset name written in front) for the trading pair. Teh Size must be based on the baseIncrement of the trading pair. The baseIncrement represents the precision for the trading pair. The size of an order must be a positive-integer multiple of baseIncrement and must be between baseMinSize and baseMaxSize.

When **type** is market, select one out of two: size or funds |\n| timeInForce | string | [Time in force](https://www.kucoin.com/docs-new/doc-338146) is a special strategy used during trading |\n| postOnly | boolean | passive order labels, this is disabled when the order timing strategy is IOC or FOK |\n| hidden | boolean | [Hidden order](https://www.kucoin.com/docs-new/doc-338146) or not (not shown in order book) |\n| iceberg | boolean | Whether or not only visible portions of orders are shown in [Iceberg orders](https://www.kucoin.com/docs-new/doc-338146) |\n| visibleSize | string | Maximum visible quantity in iceberg orders |\n| tags | string | Order tag, length cannot exceed 20 characters (ASCII) |\n| cancelAfter | integer | Cancel after n seconds,the order timing strategy is GTT |\n| funds | string | When **type** is market, select one out of two: size or funds |\n\n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| orderId | string | The unique order id generated by the trading system,which can be used later for further actions such as canceling the order. |\n| clientOid | string | The user self-defined order id. |\n\n---\n", - "body": { - "mode": "raw", - "raw": "//limit order\n{\n \"type\": \"limit\",\n \"symbol\": \"BTC-USDT\",\n \"side\": \"buy\",\n \"price\": \"50000\",\n \"size\": \"0.00001\",\n \"clientOid\": \"5c52e11203aa677f33e493fb\",\n \"remark\": \"order remarks\"\n}\n\n//market order 1\n// {\n// \"type\": \"market\",\n// \"symbol\": \"BTC-USDT\",\n// \"side\": \"buy\",\n// \"size\": \"0.00001\",\n// \"clientOid\": \"5c52e11203aa677f33e493fc\",\n// \"remark\": \"order remarks\"\n// }\n\n//market order 2\n// {\n// \"type\": \"market\",\n// \"symbol\": \"BTC-USDT\",\n// \"side\": \"buy\",\n// \"funds\": \"1\",\n// \"clientOid\": \"5c52e11203aa677f33e493fc\",\n// \"remark\": \"order remarks\"\n// }\n", - "options": { - "raw": { - "language": "json" - } - } - } + "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470358)\n\n:::info[Description]\nRequest via this interface to get a oco order information via the client order ID.\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| symbol | string | symbol |\n| clientOid | string | Client Order Id |\n| orderId | string | The unique order id generated by the trading system,which can be used later for further actions such as canceling the order. |\n| orderTime | integer | Order placement time, milliseconds |\n| status | string | Order status: NEW: New, DONE: Completed, TRIGGERED: Triggered, CANCELLED: Cancelled |\n\n---\n", + "body": {} }, "response": [ { "name": "Successful Response", "originalRequest": { - "method": "POST", + "method": "GET", "header": [], "url": { "raw": "", @@ -8134,9 +8081,10 @@ ], "path": [ "api", - "v1", - "hf", - "orders" + "v3", + "oco", + "client-order", + "{{clientOid}}" ], "query": [] } @@ -8171,14 +8119,14 @@ } ], "cookie": [], - "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"orderId\": \"670fd33bf9406e0007ab3945\",\n \"clientOid\": \"5c52e11203aa677f33e493fb\"\n }\n}" + "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"orderId\": \"674c3cfa72cf2800072ee7ce\",\n \"symbol\": \"BTC-USDT\",\n \"clientOid\": \"5c52e1203aa6f3g7f1e493fb\",\n \"orderTime\": 1733049594803,\n \"status\": \"NEW\"\n }\n}" } ] }, { - "name": "Add OCO Order", + "name": "Get OCO Order Detail By OrderId", "request": { - "method": "POST", + "method": "GET", "header": [], "url": { "raw": "", @@ -8190,26 +8138,20 @@ "api", "v3", "oco", - "order" + "order", + "details", + "{{orderId}}" ], "query": [] }, - "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470353)\n\n:::info[Description]\nPlace OCO order to the Spot trading system\n:::\n\n:::tip[Tips]\nThe maximum untriggered stop orders for a single trading pair in one account is 20.\n:::\n\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| clientOid | string | Client Order Id,The ClientOid field is a unique ID created by the user(we recommend using a UUID), and can only contain numbers, letters, underscores (_), and hyphens (-). This field is returned when order information is obtained. You can use clientOid to tag your orders. ClientOid is different from the order ID created by the service provider. Please do not initiate requests using the same clientOid. The maximum length for the ClientOid is 40 characters.

Please remember the orderId created by the service provider, it used to check for updates in order status. |\n| side | string | specify if the order is to 'buy' or 'sell' |\n| symbol | string | symbol |\n| remark | string | Order placement remarks, length cannot exceed 20 characters (ASCII) |\n| price | string | Specify price for order |\n| size | string | Specify quantity for order |\n| stopPrice | string | trigger price. |\n| limitPrice | string | The limit order price after take-profit and stop-loss are triggered. |\n| tradeType | string | Transaction Type, currently only supports TRADE (spot transactions), the default is TRADE |\n\n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| orderId | string | The unique order id generated by the trading system,which can be used later for further actions such as canceling the order. |\n\n---\n", - "body": { - "mode": "raw", - "raw": "{\n \"symbol\": \"BTC-USDT\",\n \"side\": \"buy\",\n \"price\": \"94000\",\n \"size\": \"0.1\",\n \"clientOid\": \"5c52e11203aa67f1e493fb\",\n \"stopPrice\": \"98000\",\n \"limitPrice\": \"96000\",\n \"remark\": \"this is remark\",\n \"tradeType\": \"TRADE\"\n}", - "options": { - "raw": { - "language": "json" - } - } - } + "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470359)\n\n:::info[Description]\nRequest via this interface to get a oco order detail via the order ID.\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| orderId | string | The unique order id generated by the trading system,which can be used later for further actions such as canceling the order. |\n| symbol | string | symbol |\n| clientOid | string | Client Order Id |\n| orderTime | integer | Order placement time, milliseconds |\n| status | string | Order status: NEW: New, DONE: Completed, TRIGGERED: Triggered, CANCELLED: Cancelled |\n| orders | array | Refer to the schema section of orders |\n\n**root.data.orders Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| id | string | |\n| symbol | string | |\n| side | string | |\n| price | string | |\n| stopPrice | string | |\n| size | string | |\n| status | string | |\n\n---\n", + "body": {} }, "response": [ { "name": "Successful Response", "originalRequest": { - "method": "POST", + "method": "GET", "header": [], "url": { "raw": "", @@ -8221,7 +8163,9 @@ "api", "v3", "oco", - "order" + "order", + "details", + "{{orderId}}" ], "query": [] } @@ -8256,14 +8200,14 @@ } ], "cookie": [], - "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"orderId\": \"674c316e688dea0007c7b986\"\n }\n}" + "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"orderId\": \"674c3b6e688dea0007c7bab2\",\n \"symbol\": \"BTC-USDT\",\n \"clientOid\": \"5c52e1203aa6f37f1e493fb\",\n \"orderTime\": 1733049198863,\n \"status\": \"NEW\",\n \"orders\": [\n {\n \"id\": \"vs93gpqc7dn6h3fa003sfelj\",\n \"symbol\": \"BTC-USDT\",\n \"side\": \"buy\",\n \"price\": \"94000.00000000000000000000\",\n \"stopPrice\": \"94000.00000000000000000000\",\n \"size\": \"0.10000000000000000000\",\n \"status\": \"NEW\"\n },\n {\n \"id\": \"vs93gpqc7dn6h3fa003sfelk\",\n \"symbol\": \"BTC-USDT\",\n \"side\": \"buy\",\n \"price\": \"96000.00000000000000000000\",\n \"stopPrice\": \"98000.00000000000000000000\",\n \"size\": \"0.10000000000000000000\",\n \"status\": \"NEW\"\n }\n ]\n }\n}" } ] }, { - "name": "Add Stop Order", + "name": "Get OCO Order List", "request": { - "method": "POST", + "method": "GET", "header": [], "url": { "raw": "", @@ -8273,27 +8217,51 @@ ], "path": [ "api", - "v1", - "stop-order" + "v3", + "oco", + "orders" ], - "query": [] - }, - "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470334)\n\n:::info[Description]\nPlace stop order to the Spot trading system. The maximum untriggered stop orders for a single trading pair in one account is 20.\n:::\n\n\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| clientOid | string | Client Order Id,The ClientOid field is a unique ID created by the user(we recommend using a UUID), and can only contain numbers, letters, underscores (_), and hyphens (-). This field is returned when order information is obtained. You can use clientOid to tag your orders. ClientOid is different from the order ID created by the service provider. Please do not initiate requests using the same clientOid. The maximum length for the ClientOid is 40 characters.

Please remember the orderId created by the service provider, it used to check for updates in order status. |\n| side | string | specify if the order is to 'buy' or 'sell' |\n| symbol | string | symbol |\n| type | string | specify if the order is an 'limit' order or 'market' order.

The type of order you specify when you place your order determines whether or not you need to request other parameters and also affects the execution of the matching engine.

When placing a limit order, you must specify a price and size. The system will try to match the order according to market price or a price better than market price. If the order cannot be immediately matched, it will stay in the order book until it is matched or the user cancels.

Unlike limit orders, the price for market orders fluctuates with market prices. When placing a market order, you do not need to specify a price, you only need to specify a quantity. Market orders are filled immediately and will not enter the order book. All market orders are takers and a taker fee will be charged. |\n| remark | string | Order placement remarks, length cannot exceed 20 characters (ASCII) |\n| stp | string | [Self Trade Prevention](https://www.kucoin.com/docs-new/doc-338146) is divided into four strategies: CN, CO, CB , and DC |\n| price | string | Specify price for order, not need for market order.

When placing a limit order, the price must be based on priceIncrement for the trading pair. The price increment (priceIncrement) is the price precision for the trading pair. For example, for the BTC-USDT trading pair, the priceIncrement is 0.00001000. So the price for your orders cannot be less than 0.00001000 and must be a multiple of priceIncrement. Otherwise, the order will return an invalid priceIncrement error. |\n| size | string | Specify quantity for order

When **type** is limit, size refers to the amount of trading targets (the asset name written in front) for the trading pair. Teh Size must be based on the baseIncrement of the trading pair. The baseIncrement represents the precision for the trading pair. The size of an order must be a positive-integer multiple of baseIncrement and must be between baseMinSize and baseMaxSize.

When **type** is market, select one out of two: size or funds |\n| timeInForce | string | [Time in force](https://www.kucoin.com/docs-new/doc-338146) is a special strategy used during trading. Required for limit orders. |\n| postOnly | boolean | passive order labels, this is disabled when the order timing strategy is IOC or FOK if **type** is limit. |\n| hidden | boolean | [Hidden order](https://www.kucoin.com/docs-new/doc-338146) or not (not shown in order book) |\n| iceberg | boolean | Whether or not only visible portions of orders are shown in [Iceberg orders](https://www.kucoin.com/docs-new/doc-338146) |\n| visibleSize | string | When **type** is limit, this is Maximum visible quantity in iceberg orders. |\n| cancelAfter | integer | Cancel after n seconds,the order timing strategy is GTT when **type** is limit. |\n| funds | string | When **type** is market, select one out of two: size or funds |\n| stopPrice | string | The trigger price. |\n| tradeType | string | The type of trading : TRADE(Spot), MARGIN_TRADE (Cross Margin), MARGIN_ISOLATED_TRADE (Isolated Margin). Default is TRADE |\n\n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| orderId | string | The unique order id generated by the trading system,which can be used later for further actions such as canceling the order. |\n| clientOid | string | The user self-defined order id. |\n\n---\n", - "body": { - "mode": "raw", - "raw": "//limit order\n{\n \"type\": \"limit\",\n \"symbol\": \"BTC-USDT\",\n \"side\": \"buy\",\n \"price\": \"50000\",\n \"size\": \"0.00001\",\n \"clientOid\": \"5c52e11203aa677f33e493fb\",\n \"remark\": \"order remarks\"\n}\n\n//market order 1\n// {\n// \"type\": \"market\",\n// \"symbol\": \"BTC-USDT\",\n// \"side\": \"buy\",\n// \"size\": \"0.00001\",\n// \"clientOid\": \"5c52e11203aa677f33e493fc\",\n// \"remark\": \"order remarks\"\n// }\n\n//market order 2\n// {\n// \"type\": \"market\",\n// \"symbol\": \"BTC-USDT\",\n// \"side\": \"buy\",\n// \"funds\": \"1\",\n// \"clientOid\": \"5c52e11203aa677f33e493fc\",\n// \"remark\": \"order remarks\"\n// }\n", - "options": { - "raw": { - "language": "json" + "query": [ + { + "key": "symbol", + "value": null, + "description": "symbol" + }, + { + "key": "startAt", + "value": null, + "description": "Start time (milliseconds)" + }, + { + "key": "endAt", + "value": null, + "description": "End time (milliseconds)" + }, + { + "key": "orderIds", + "value": null, + "description": "Specify orderId collection, up to 500 orders\n" + }, + { + "key": "pageSize", + "value": null, + "description": "Size per page, minimum value 10, maximum value 500" + }, + { + "key": "currentPage", + "value": null, + "description": "Page number, minimum value 1\n" } - } - } + ] + }, + "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470360)\n\n:::info[Description]\nRequest via this endpoint to get your current OCO order list. Items are paginated and sorted to show the latest first. See the Pagination section for retrieving additional entries after the first page.\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| currentPage | integer | |\n| pageSize | integer | |\n| totalNum | integer | |\n| totalPage | integer | |\n| items | array | Refer to the schema section of items |\n\n**root.data.items Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| orderId | string | The unique order id generated by the trading system,which can be used later for further actions such as canceling the order. |\n| symbol | string | symbol |\n| clientOid | string | Client Order Id |\n| orderTime | integer | Order placement time, milliseconds |\n| status | string | Order status: NEW: New, DONE: Completed, TRIGGERED: Triggered, CANCELLED: Cancelled |\n\n---\n", + "body": {} }, "response": [ { "name": "Successful Response", "originalRequest": { - "method": "POST", + "method": "GET", "header": [], "url": { "raw": "", @@ -8303,10 +8271,42 @@ ], "path": [ "api", - "v1", - "stop-order" + "v3", + "oco", + "orders" ], - "query": [] + "query": [ + { + "key": "symbol", + "value": null, + "description": "symbol" + }, + { + "key": "startAt", + "value": null, + "description": "Start time (milliseconds)" + }, + { + "key": "endAt", + "value": null, + "description": "End time (milliseconds)" + }, + { + "key": "orderIds", + "value": null, + "description": "Specify orderId collection, up to 500 orders\n" + }, + { + "key": "pageSize", + "value": null, + "description": "Size per page, minimum value 10, maximum value 500" + }, + { + "key": "currentPage", + "value": null, + "description": "Page number, minimum value 1\n" + } + ] } }, "status": "OK", @@ -8339,7 +8339,7 @@ } ], "cookie": [], - "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"orderId\": \"670fd33bf9406e0007ab3945\",\n \"clientOid\": \"5c52e11203aa677f33e493fb\"\n }\n}" + "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"currentPage\": 1,\n \"pageSize\": 50,\n \"totalNum\": 1,\n \"totalPage\": 1,\n \"items\": [\n {\n \"orderId\": \"674c3cfa72cf2800072ee7ce\",\n \"symbol\": \"BTC-USDT\",\n \"clientOid\": \"5c52e1203aa6f3g7f1e493fb\",\n \"orderTime\": 1733049594803,\n \"status\": \"NEW\"\n }\n ]\n }\n}" } ] } @@ -8850,9 +8850,9 @@ "name": "Orders", "item": [ { - "name": "Cancel Order By OrderId", + "name": "Add Order", "request": { - "method": "DELETE", + "method": "POST", "header": [], "url": { "raw": "", @@ -8865,25 +8865,26 @@ "v3", "hf", "margin", - "orders", - "{{orderId}}" + "order" ], - "query": [ - { - "key": "symbol", - "value": "BTC-USDT", - "description": "symbol" - } - ] + "query": [] }, - "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470195)\n\n:::info[Description]\nThis endpoint can be used to cancel a margin order by orderId.\nThis endpoint only sends cancellation requests. The results of the requests must be obtained by checking the order status or subscribing to websocket.\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| orderId | string | order id |\n\n---\n", - "body": {} + "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470204)\n\n:::info[Description]\nPlace order to the Cross-margin or Isolated-margin trading system, you can place two major types of orders: limit and market. Orders can only be placed if your account has sufficient funds. Once an order is placed, your funds will be put on hold for the duration of the order. The amount of funds on hold depends on the order type and parameters specified.\n:::\n\n:::tip[Tips]\nPlease note that once your order enters the order book, the system will freeze the handling fees for the order ahead of time.\n\nBefore placing orders, please be sure to fully understand the meaning of the parameters for each trading pair.\n:::\n\n:::tip[Tips]\nThe maximum number of active orders per account is 2000, with a maximum of 200 active orders per trading pair.\n:::\n\n\n**Public order placement request parameters**\n\n| Param | Type | Mandatory | Description |\n| --------- | ------ | --------- | ----------- |\n| clientOid | String | Yes | Client Order Id,unique identifier created by the user, the use of UUID is recommended |\n| symbol | String | Yes | symbol |\n| side | String | Yes | `buy` or `sell` |\n| type | String | No | Order type `limit` and `market`, defult is limit |\n| stp | String | No | self trade prevention is divided into four strategies: `CN`, `CO`, `CB` , and `DC` |\n| isIsolated | boolean | No | true - isolated margin ,false - cross margin. defult as false |\n| autoBorrow | boolean | No | When Margin Account has inefficient balance, our system autoborrows inefficient assets and opens positions according to the lowest market interest rate. |\n| autoRepay | boolean | No | AutoPay allows returning borrowed assets when you close a position. Our system automatically triggers the repayment and the maximum repayment amount equals to the filled-order amount. |\n\n**Additional Request Parameters Required by `limit` Orders**\n\n| Param | Type | Mandatory | Description |\n| ----------- | ------- | --------- | ----------- |\n| price | String | Yes | Specify price for currency |\n| size | String | Yes | Specify quantity for currency |\n| timeInForce | String | No | Order timing strategy `GTC`, `GTT`, `IOC`, `FOK` (The default is `GTC`) |\n| cancelAfter | long | No | Cancel after `n` seconds,the order timing strategy is `GTT` |\n| postOnly | boolean | No | passive order labels, this is disabled when the order timing strategy is `IOC` or `FOK` |\n| hidden | boolean | No | Hidden or not (not shown in order book) |\n| iceberg | boolean | No | Whether or not only visible portions of orders are shown in iceberg orders |\n| visibleSize | String | No | Maximum visible quantity in iceberg orders |\n\n**Additional request parameters required by `market` orders**\n\n| Param | Type | Mandatory | Description |\n| ----- | ------ | --------- | ------------------------------------------ |\n| size | String | No | (Select one out of two: `size` or `funds`) |\n| funds | String | No | (Select one out of two: `size` or `funds`) |\n\n\n**Hold**\n\nFor limit price purchase orders, we will hold the amount of funds (price * size) required for your purchase order. Similarly, for limit price sell orders, we will also hold you sell order assets. When the transaction is executed, the service fees will be calculated. If you cancel a portion of a filled or unfilled order, then the remaining funds or amounts will be released and returned to your account. For market price buy/sell orders that require specific funds, we will hold the required funds in from your account. If only the size is specified, we may freeze (usually for a very short amount of time) all of the funds in your account prior to the order being filled or cancelled.\n\n\n**Order Lifecycle**\n\nWhen an order placement request is successful (the matching engine receives the order) or denied (due to there being insufficient funds or illegal parameter values, etc.), the system will respond to the HTTP request. When an order is successfully placed, the order ID is returned. The order will be matched, which could result in it being fully or partially filled. When an order is fully or partially filled, the remaining portions of the order will be in an active state awaiting to be matched (this does not include IOC orders). Orders that are fully or partially filled(already cancelled) will be put into the “done” state.\n\nUsers that have subscribed to the Market Data Channel can use the order ID (orderId) and client ID (clientOid) to identify messages.\n\n**Price Protection Mechanisms**\n\nPrice protection mechanisms ae enabled for order placements. Rules are detailed below:\n\n- If the spot trading market order/limit order placed by the user can be directly matched with an order in the current order book, the system will judge whether deviation between the price corresponding to the transaction depth and the spread exceeds the threshold value (the threshold value can be obtained using the symbol API endpoint);\n\n- If it is exceeded, for limit orders, the order will be directly cancelled;\n\n- If it is a market order, then the system will partially execute the order. The execution limit will be the order size within the price range corresponding to the threshold value. The remaining orders will not be filled.\n\nFor example: if the threshold value is 10%, when a user places a market price purchase order in the KCS/USDT trading market for 10,000 USDT (the selling price is currently 1.20000), the system will determine that after the order is completely filled, the final price will be 1.40000. (1.40000-1.20000)/1.20000=16.7%>10%. The threshold value is 1.32000. The user’s market price purchase order will be filled only to a maximum of 1.32000. The remaining order portions will not be matched with orders in the order book. Note: this feature may not be able to determine depth with complete accuracy. If your order is not completely filled, it may be because the portion exceeding the threshold value was not filled.\n\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| clientOid | string | Client Order Id,The ClientOid field is a unique ID created by the user(we recommend using a UUID), and can only contain numbers, letters, underscores (_), and hyphens (-). This field is returned when order information is obtained. You can use clientOid to tag your orders. ClientOid is different from the order ID created by the service provider. Please do not initiate requests using the same clientOid. The maximum length for the ClientOid is 40 characters.

Please remember the orderId created by the service provider, it used to check for updates in order status. |\n| side | string | specify if the order is to 'buy' or 'sell' |\n| symbol | string | symbol |\n| type | string | specify if the order is an 'limit' order or 'market' order.

The type of order you specify when you place your order determines whether or not you need to request other parameters and also affects the execution of the matching engine.

When placing a limit order, you must specify a price and size. The system will try to match the order according to market price or a price better than market price. If the order cannot be immediately matched, it will stay in the order book until it is matched or the user cancels.

Unlike limit orders, the price for market orders fluctuates with market prices. When placing a market order, you do not need to specify a price, you only need to specify a quantity. Market orders are filled immediately and will not enter the order book. All market orders are takers and a taker fee will be charged. |\n| stp | string | [Self Trade Prevention](https://www.kucoin.com/docs-new/doc-338146) is divided into these strategies: CN, CO, CB , and DC |\n| price | string | Specify price for order

When placing a limit order, the price must be based on priceIncrement for the trading pair. The price increment (priceIncrement) is the price precision for the trading pair. For example, for the BTC-USDT trading pair, the priceIncrement is 0.00001000. So the price for your orders cannot be less than 0.00001000 and must be a multiple of priceIncrement. Otherwise, the order will return an invalid priceIncrement error. |\n| size | string | Specify quantity for order

When **type** is limit, size refers to the amount of trading targets (the asset name written in front) for the trading pair. Teh Size must be based on the baseIncrement of the trading pair. The baseIncrement represents the precision for the trading pair. The size of an order must be a positive-integer multiple of baseIncrement and must be between baseMinSize and baseMaxSize.

When **type** is market, select one out of two: size or funds |\n| timeInForce | string | [Time in force](https://www.kucoin.com/docs-new/api-5176570) is a special strategy used during trading |\n| postOnly | boolean | passive order labels, this is disabled when the order timing strategy is IOC or FOK |\n| hidden | boolean | [Hidden order](https://www.kucoin.com/docs-new/doc-338146) or not (not shown in order book) |\n| iceberg | boolean | Whether or not only visible portions of orders are shown in [Iceberg orders](https://www.kucoin.com/docs-new/doc-338146) |\n| visibleSize | string | Maximum visible quantity in iceberg orders |\n| cancelAfter | integer | Cancel after n seconds,the order timing strategy is GTT |\n| funds | string | When **type** is market, select one out of two: size or funds |\n| isIsolated | boolean | true - isolated margin ,false - cross margin. defult as false |\n| autoBorrow | boolean | When Margin Account has inefficient balance, our system autoborrows inefficient assets and opens positions according to the lowest market interest rate. |\n| autoRepay | boolean | AutoPay allows returning borrowed assets when you close a position. Our system automatically triggers the repayment and the maximum repayment amount equals to the filled-order amount. |\n\n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| orderId | string | The unique order id generated by the trading system,which can be used later for further actions such as canceling the order. |\n| loanApplyId | string | Borrow order id. The field is returned only after placing the order under the mode of Auto-Borrow. |\n| borrowSize | string | Borrowed amount. The field is returned only after placing the order under the mode of Auto-Borrow. |\n| clientOid | string | The user self-defined order id. |\n\n---\n", + "body": { + "mode": "raw", + "raw": "//limit order\n{\n \"type\": \"limit\",\n \"symbol\": \"BTC-USDT\",\n \"side\": \"buy\",\n \"price\": \"50000\",\n \"size\": \"0.00001\",\n \"clientOid\": \"5c52e11203aa677f33e493fb\",\n \"remark\": \"order remarks\"\n}\n\n//market order 1\n// {\n// \"type\": \"market\",\n// \"symbol\": \"BTC-USDT\",\n// \"side\": \"buy\",\n// \"size\": \"0.00001\",\n// \"clientOid\": \"5c52e11203aa677f33e493fc\",\n// \"remark\": \"order remarks\"\n// }\n\n//market order 2\n// {\n// \"type\": \"market\",\n// \"symbol\": \"BTC-USDT\",\n// \"side\": \"buy\",\n// \"funds\": \"1\",\n// \"clientOid\": \"5c52e11203aa677f33e493fc\",\n// \"remark\": \"order remarks\"\n// }\n", + "options": { + "raw": { + "language": "json" + } + } + } }, "response": [ { "name": "Successful Response", "originalRequest": { - "method": "DELETE", + "method": "POST", "header": [], "url": { "raw": "", @@ -8896,16 +8897,9 @@ "v3", "hf", "margin", - "orders", - "{{orderId}}" + "order" ], - "query": [ - { - "key": "symbol", - "value": "BTC-USDT", - "description": "symbol" - } - ] + "query": [] } }, "status": "OK", @@ -8938,14 +8932,14 @@ } ], "cookie": [], - "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"orderId\": \"671663e02188630007e21c9c\"\n }\n}" + "body": "{\n \"success\": true,\n \"code\": \"200000\",\n \"data\": {\n \"orderId\": \"671663e02188630007e21c9c\",\n \"clientOid\": \"5c52e11203aa677f33e1493fb\",\n \"borrowSize\": \"10.2\",\n \"loanApplyId\": \"600656d9a33ac90009de4f6f\"\n }\n}" } ] }, { - "name": "Get Symbols With Open Order", + "name": "Add Order Test", "request": { - "method": "GET", + "method": "POST", "header": [], "url": { "raw": "", @@ -8959,25 +8953,26 @@ "hf", "margin", "order", - "active", - "symbols" + "test" ], - "query": [ - { - "key": "tradeType", - "value": "MARGIN_TRADE", - "description": "Cross Margin: MARGIN_TRADE, Isolated Margin: MARGIN_ISOLATED_TRADE\n" - } - ] + "query": [] }, - "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470196)\n\n:::info[Description]\nThis interface can query all Margin symbol that has active orders\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| symbolSize | integer | Symbol Size |\n| symbols | array | Refer to the schema section of symbols |\n\n---\n", - "body": {} + "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470205)\n\n:::info[Description]\nOrder test endpoint, the request parameters and return parameters of this endpoint are exactly the same as the order endpoint, and can be used to verify whether the signature is correct and other operations. After placing an order, the order will not enter the matching system, and the order cannot be queried.\n:::\n\n:::tip[Tips]\nPlease note that once your order enters the order book, the system will freeze the handling fees for the order ahead of time.\n\nBefore placing orders, please be sure to fully understand the meaning of the parameters for each trading pair.\n:::\n\n:::tip[Tips]\nThe maximum number of active orders per account is 2000, with a maximum of 200 active orders per trading pair.\n:::\n\n\n**Public order placement request parameters**\n\n| Param | Type | Mandatory | Description |\n| --------- | ------ | --------- | ----------- |\n| clientOid | String | Yes | Client Order Id,unique identifier created by the user, the use of UUID is recommended |\n| symbol | String | Yes | symbol |\n| side | String | Yes | `buy` or `sell` |\n| type | String | No | Order type `limit` and `market`, defult is limit |\n| stp | String | No | self trade prevention is divided into four strategies: `CN`, `CO`, `CB` , and `DC` |\n| isIsolated | boolean | No | true - isolated margin ,false - cross margin. defult as false |\n| autoBorrow | boolean | No | When Margin Account has inefficient balance, our system autoborrows inefficient assets and opens positions according to the lowest market interest rate. |\n| autoRepay | boolean | No | AutoPay allows returning borrowed assets when you close a position. Our system automatically triggers the repayment and the maximum repayment amount equals to the filled-order amount. |\n\n**Additional Request Parameters Required by `limit` Orders**\n\n| Param | Type | Mandatory | Description |\n| ----------- | ------- | --------- | ----------- |\n| price | String | Yes | Specify price for currency |\n| size | String | Yes | Specify quantity for currency |\n| timeInForce | String | No | Order timing strategy `GTC`, `GTT`, `IOC`, `FOK` (The default is `GTC`) |\n| cancelAfter | long | No | Cancel after `n` seconds,the order timing strategy is `GTT` |\n| postOnly | boolean | No | passive order labels, this is disabled when the order timing strategy is `IOC` or `FOK` |\n| hidden | boolean | No | Hidden or not (not shown in order book) |\n| iceberg | boolean | No | Whether or not only visible portions of orders are shown in iceberg orders |\n| visibleSize | String | No | Maximum visible quantity in iceberg orders |\n\n**Additional request parameters required by `market` orders**\n\n| Param | Type | Mandatory | Description |\n| ----- | ------ | --------- | ------------------------------------------ |\n| size | String | No | (Select one out of two: `size` or `funds`) |\n| funds | String | No | (Select one out of two: `size` or `funds`) |\n\n\n**Hold**\n\nFor limit price purchase orders, we will hold the amount of funds (price * size) required for your purchase order. Similarly, for limit price sell orders, we will also hold you sell order assets. When the transaction is executed, the service fees will be calculated. If you cancel a portion of a filled or unfilled order, then the remaining funds or amounts will be released and returned to your account. For market price buy/sell orders that require specific funds, we will hold the required funds in from your account. If only the size is specified, we may freeze (usually for a very short amount of time) all of the funds in your account prior to the order being filled or cancelled.\n\n\n**Order Lifecycle**\n\nWhen an order placement request is successful (the matching engine receives the order) or denied (due to there being insufficient funds or illegal parameter values, etc.), the system will respond to the HTTP request. When an order is successfully placed, the order ID is returned. The order will be matched, which could result in it being fully or partially filled. When an order is fully or partially filled, the remaining portions of the order will be in an active state awaiting to be matched (this does not include IOC orders). Orders that are fully or partially filled(already cancelled) will be put into the “done” state.\n\nUsers that have subscribed to the Market Data Channel can use the order ID (orderId) and client ID (clientOid) to identify messages.\n\n**Price Protection Mechanisms**\n\nPrice protection mechanisms ae enabled for order placements. Rules are detailed below:\n\n- If the spot trading market order/limit order placed by the user can be directly matched with an order in the current order book, the system will judge whether deviation between the price corresponding to the transaction depth and the spread exceeds the threshold value (the threshold value can be obtained using the symbol API endpoint);\n\n- If it is exceeded, for limit orders, the order will be directly cancelled;\n\n- If it is a market order, then the system will partially execute the order. The execution limit will be the order size within the price range corresponding to the threshold value. The remaining orders will not be filled.\n\nFor example: if the threshold value is 10%, when a user places a market price purchase order in the KCS/USDT trading market for 10,000 USDT (the selling price is currently 1.20000), the system will determine that after the order is completely filled, the final price will be 1.40000. (1.40000-1.20000)/1.20000=16.7%>10%. The threshold value is 1.32000. The user’s market price purchase order will be filled only to a maximum of 1.32000. The remaining order portions will not be matched with orders in the order book. Note: this feature may not be able to determine depth with complete accuracy. If your order is not completely filled, it may be because the portion exceeding the threshold value was not filled.\n\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| clientOid | string | Client Order Id,The ClientOid field is a unique ID created by the user(we recommend using a UUID), and can only contain numbers, letters, underscores (_), and hyphens (-). This field is returned when order information is obtained. You can use clientOid to tag your orders. ClientOid is different from the order ID created by the service provider. Please do not initiate requests using the same clientOid. The maximum length for the ClientOid is 40 characters.

Please remember the orderId created by the service provider, it used to check for updates in order status. |\n| side | string | specify if the order is to 'buy' or 'sell' |\n| symbol | string | symbol |\n| type | string | specify if the order is an 'limit' order or 'market' order.

The type of order you specify when you place your order determines whether or not you need to request other parameters and also affects the execution of the matching engine.

When placing a limit order, you must specify a price and size. The system will try to match the order according to market price or a price better than market price. If the order cannot be immediately matched, it will stay in the order book until it is matched or the user cancels.

Unlike limit orders, the price for market orders fluctuates with market prices. When placing a market order, you do not need to specify a price, you only need to specify a quantity. Market orders are filled immediately and will not enter the order book. All market orders are takers and a taker fee will be charged. |\n| stp | string | [Self Trade Prevention](https://www.kucoin.com/docs-new/doc-338146) is divided into these strategies: CN, CO, CB , and DC |\n| price | string | Specify price for order

When placing a limit order, the price must be based on priceIncrement for the trading pair. The price increment (priceIncrement) is the price precision for the trading pair. For example, for the BTC-USDT trading pair, the priceIncrement is 0.00001000. So the price for your orders cannot be less than 0.00001000 and must be a multiple of priceIncrement. Otherwise, the order will return an invalid priceIncrement error. |\n| size | string | Specify quantity for order

When **type** is limit, size refers to the amount of trading targets (the asset name written in front) for the trading pair. Teh Size must be based on the baseIncrement of the trading pair. The baseIncrement represents the precision for the trading pair. The size of an order must be a positive-integer multiple of baseIncrement and must be between baseMinSize and baseMaxSize.

When **type** is market, select one out of two: size or funds |\n| timeInForce | string | [Time in force](https://www.kucoin.com/docs-new/api-5176570) is a special strategy used during trading |\n| postOnly | boolean | passive order labels, this is disabled when the order timing strategy is IOC or FOK |\n| hidden | boolean | [Hidden order](https://www.kucoin.com/docs-new/doc-338146) or not (not shown in order book) |\n| iceberg | boolean | Whether or not only visible portions of orders are shown in [Iceberg orders](https://www.kucoin.com/docs-new/doc-338146) |\n| visibleSize | string | Maximum visible quantity in iceberg orders |\n| cancelAfter | integer | Cancel after n seconds,the order timing strategy is GTT |\n| funds | string | When **type** is market, select one out of two: size or funds |\n| isIsolated | boolean | true - isolated margin ,false - cross margin. defult as false |\n| autoBorrow | boolean | When Margin Account has inefficient balance, our system autoborrows inefficient assets and opens positions according to the lowest market interest rate. |\n| autoRepay | boolean | AutoPay allows returning borrowed assets when you close a position. Our system automatically triggers the repayment and the maximum repayment amount equals to the filled-order amount. |\n\n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| orderId | string | The unique order id generated by the trading system,which can be used later for further actions such as canceling the order. |\n| loanApplyId | string | Borrowed amount. The field is returned only after placing the order under the mode of Auto-Borrow. |\n| borrowSize | number | ID of the borrowing response. The field is returned only after placing the order under the mode of Auto-Borrow. |\n| clientOid | string | The user self-defined order id. |\n\n---\n", + "body": { + "mode": "raw", + "raw": "//limit order\n{\n \"type\": \"limit\",\n \"symbol\": \"BTC-USDT\",\n \"side\": \"buy\",\n \"price\": \"50000\",\n \"size\": \"0.00001\",\n \"clientOid\": \"5c52e11203aa677f33e493fb\",\n \"remark\": \"order remarks\"\n}\n\n//market order 1\n// {\n// \"type\": \"market\",\n// \"symbol\": \"BTC-USDT\",\n// \"side\": \"buy\",\n// \"size\": \"0.00001\",\n// \"clientOid\": \"5c52e11203aa677f33e493fc\",\n// \"remark\": \"order remarks\"\n// }\n\n//market order 2\n// {\n// \"type\": \"market\",\n// \"symbol\": \"BTC-USDT\",\n// \"side\": \"buy\",\n// \"funds\": \"1\",\n// \"clientOid\": \"5c52e11203aa677f33e493fc\",\n// \"remark\": \"order remarks\"\n// }\n", + "options": { + "raw": { + "language": "json" + } + } + } }, "response": [ { "name": "Successful Response", "originalRequest": { - "method": "GET", + "method": "POST", "header": [], "url": { "raw": "", @@ -8991,16 +8986,9 @@ "hf", "margin", "order", - "active", - "symbols" + "test" ], - "query": [ - { - "key": "tradeType", - "value": "MARGIN_TRADE", - "description": "Cross Margin: MARGIN_TRADE, Isolated Margin: MARGIN_ISOLATED_TRADE\n" - } - ] + "query": [] } }, "status": "OK", @@ -9033,12 +9021,12 @@ } ], "cookie": [], - "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"symbolSize\": 1,\n \"symbols\": [\n \"BTC-USDT\"\n ]\n }\n}" + "body": "{\n \"success\": true,\n \"code\": \"200000\",\n \"data\": {\n \"orderId\": \"5bd6e9286d99522a52e458de\",\n \"clientOid\": \"5c52e11203aa677f33e493fb\",\n \"borrowSize\": 10.2,\n \"loanApplyId\": \"600656d9a33ac90009de4f6f\"\n }\n}" } ] }, { - "name": "Cancel All Orders By Symbol", + "name": "Cancel Order By OrderId", "request": { "method": "DELETE", "header": [], @@ -9053,22 +9041,18 @@ "v3", "hf", "margin", - "orders" + "orders", + "{{orderId}}" ], "query": [ { "key": "symbol", "value": "BTC-USDT", "description": "symbol" - }, - { - "key": "tradeType", - "value": "MARGIN_TRADE", - "description": "Transaction type: MARGIN_TRADE - cross margin trade, MARGIN_ISOLATED_TRADE - isolated margin trade" } ] }, - "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470197)\n\n:::info[Description]\nThis interface can cancel all open Margin orders by symbol\nThis endpoint only sends cancellation requests. The results of the requests must be obtained by checking the order status or subscribing to websocket.\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | string | |\n\n---\n", + "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470195)\n\n:::info[Description]\nThis endpoint can be used to cancel a margin order by orderId.\nThis endpoint only sends cancellation requests. The results of the requests must be obtained by checking the order status or subscribing to websocket.\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| orderId | string | order id |\n\n---\n", "body": {} }, "response": [ @@ -9088,18 +9072,14 @@ "v3", "hf", "margin", - "orders" + "orders", + "{{orderId}}" ], "query": [ { "key": "symbol", "value": "BTC-USDT", "description": "symbol" - }, - { - "key": "tradeType", - "value": "MARGIN_TRADE", - "description": "Transaction type: MARGIN_TRADE - cross margin trade, MARGIN_ISOLATED_TRADE - isolated margin trade" } ] } @@ -9134,14 +9114,14 @@ } ], "cookie": [], - "body": "{\n \"code\": \"200000\",\n \"data\": \"success\"\n}" + "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"orderId\": \"671663e02188630007e21c9c\"\n }\n}" } ] }, { - "name": "Get Open Orders", + "name": "Cancel Order By ClientOid", "request": { - "method": "GET", + "method": "DELETE", "header": [], "url": { "raw": "", @@ -9155,29 +9135,25 @@ "hf", "margin", "orders", - "active" + "client-order", + "{{clientOid}}" ], "query": [ { "key": "symbol", "value": "BTC-USDT", "description": "symbol" - }, - { - "key": "tradeType", - "value": "MARGIN_TRADE", - "description": "Order type: MARGIN_TRADE - cross margin trading order, MARGIN_ISOLATED_TRADE - isolated margin trading order" } ] }, - "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470198)\n\n:::info[Description]\nThis interface is to obtain all Margin active order lists, and the return value of the active order interface is the paged data of all uncompleted order lists. The returned data is sorted in descending order according to the latest update time of the order.\n\nAfter the user successfully places an order, the order is in Active state, and the user can use inOrderBook to determine whether the order has entered the order. Canceled or fully filled orders are marked as completed Done status.\n:::\n\n:::tip[Tips]\nFor high-frequency trading users, we recommend locally caching, maintaining your own order records, and using market data streams to update your order information in real time.\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | array | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| id | string | The unique order id generated by the trading system |\n| symbol | string | symbol |\n| opType | string | |\n| type | string | Specify if the order is an 'limit' order or 'market' order. |\n| side | string | Buy or sell |\n| price | string | Order price |\n| size | string | Order size |\n| funds | string | Order Funds |\n| dealSize | string | Number of filled transactions |\n| dealFunds | string | Funds of filled transactions |\n| fee | string | trading fee |\n| feeCurrency | string | currency used to calculate trading fee |\n| stp | string | [Self Trade Prevention](https://www.kucoin.com/docs-new/doc-338146) is divided into these strategies: CN, CO, CB , and DC |\n| stop | string | |\n| stopTriggered | boolean | |\n| stopPrice | string | |\n| timeInForce | string | Time in force |\n| postOnly | boolean | Whether its a postOnly order. |\n| hidden | boolean | Whether its a hidden order. |\n| iceberg | boolean | Whether its a iceberg order. |\n| visibleSize | string | Visible size of iceberg order in order book. |\n| cancelAfter | integer | A GTT timeInForce that expires in n seconds |\n| channel | string | |\n| clientOid | string | Client Order Id,unique identifier created by the user |\n| remark | string | Order placement remarks |\n| tags | string | Order tag |\n| cancelExist | boolean | Whether there is a cancellation record for the order. |\n| createdAt | integer | |\n| lastUpdatedAt | integer | |\n| tradeType | string | Trade type, redundancy param |\n| inOrderBook | boolean | Whether to enter the orderbook: true: enter the orderbook; false: not enter the orderbook |\n| cancelledSize | string | Number of canceled transactions |\n| cancelledFunds | string | Funds of canceled transactions |\n| remainSize | string | Number of remain transactions |\n| remainFunds | string | Funds of remain transactions |\n| tax | string | Users in some regions need query this field |\n| active | boolean | Order status: true-The status of the order isactive; false-The status of the order is done |\n\n---\n", + "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470201)\n\n:::info[Description]\nThis endpoint can be used to cancel a margin order by clientOid.\nThis endpoint only sends cancellation requests. The results of the requests must be obtained by checking the order status or subscribing to websocket.\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| clientOid | string | Client Order Id,unique identifier created by the user |\n\n---\n", "body": {} }, "response": [ { "name": "Successful Response", "originalRequest": { - "method": "GET", + "method": "DELETE", "header": [], "url": { "raw": "", @@ -9191,18 +9167,14 @@ "hf", "margin", "orders", - "active" + "client-order", + "{{clientOid}}" ], "query": [ { "key": "symbol", "value": "BTC-USDT", "description": "symbol" - }, - { - "key": "tradeType", - "value": "MARGIN_TRADE", - "description": "Order type: MARGIN_TRADE - cross margin trading order, MARGIN_ISOLATED_TRADE - isolated margin trading order" } ] } @@ -9237,14 +9209,14 @@ } ], "cookie": [], - "body": "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"id\": \"671667306afcdb000723107f\",\n \"clientOid\": \"5c52e11203aa677f33e493fb\",\n \"symbol\": \"BTC-USDT\",\n \"opType\": \"DEAL\",\n \"type\": \"limit\",\n \"side\": \"buy\",\n \"price\": \"50000\",\n \"size\": \"0.00001\",\n \"funds\": \"0.5\",\n \"dealSize\": \"0\",\n \"dealFunds\": \"0\",\n \"remainSize\": \"0.00001\",\n \"remainFunds\": \"0.5\",\n \"cancelledSize\": \"0\",\n \"cancelledFunds\": \"0\",\n \"fee\": \"0\",\n \"feeCurrency\": \"USDT\",\n \"stp\": null,\n \"stop\": null,\n \"stopTriggered\": false,\n \"stopPrice\": \"0\",\n \"timeInForce\": \"GTC\",\n \"postOnly\": false,\n \"hidden\": false,\n \"iceberg\": false,\n \"visibleSize\": \"0\",\n \"cancelAfter\": 0,\n \"channel\": \"API\",\n \"remark\": null,\n \"tags\": null,\n \"cancelExist\": false,\n \"tradeType\": \"MARGIN_TRADE\",\n \"inOrderBook\": true,\n \"active\": true,\n \"tax\": \"0\",\n \"createdAt\": 1729521456248,\n \"lastUpdatedAt\": 1729521460940\n }\n ]\n}" + "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"clientOid\": \"5c52e11203aa677f33e1493fb\"\n }\n}" } ] }, { - "name": "Get Closed Orders", + "name": "Cancel All Orders By Symbol", "request": { - "method": "GET", + "method": "DELETE", "header": [], "url": { "raw": "", @@ -9257,8 +9229,7 @@ "v3", "hf", "margin", - "orders", - "done" + "orders" ], "query": [ { @@ -9270,47 +9241,17 @@ "key": "tradeType", "value": "MARGIN_TRADE", "description": "Transaction type: MARGIN_TRADE - cross margin trade, MARGIN_ISOLATED_TRADE - isolated margin trade" - }, - { - "key": "side", - "value": null, - "description": "specify if the order is to 'buy' or 'sell'" - }, - { - "key": "type", - "value": null, - "description": "specify if the order is an 'limit' order or 'market' order. " - }, - { - "key": "lastId", - "value": "254062248624417", - "description": "The id of the last set of data from the previous batch of data. By default, the latest information is given.\nlastId is used to filter data and paginate. If lastId is not entered, the default is a maximum of 100 returned data items. The return results include lastId,which can be used as a query parameter to look up new data from the next page." - }, - { - "key": "limit", - "value": "20", - "description": "Default20,Max100" - }, - { - "key": "startAt", - "value": "1728663338000", - "description": "Start time (milisecond)" - }, - { - "key": "endAt", - "value": "1728692138000", - "description": "End time (milisecond)" } ] }, - "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470199)\n\n:::info[Description]\nThis interface is to obtain all Margin Closed order lists, and the return value of the active order interface is the paged data of all uncompleted order lists. The returned data is sorted in descending order according to the latest update time of the order.\n\nAfter the user successfully places an order, the order is in Active state, and the user can use inOrderBook to determine whether the order has entered the order. Canceled or fully filled orders are marked as completed Done status.\n:::\n\n:::tip[Tips]\nIf the order is not an active order, you can only get data within the time range of 3 _ 24 hours (ie: from the current time to 3 _ 24 hours ago). If the time range is exceeded, the system will query the data within the time range of 3 * 24 hours by default.\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| lastId | integer | The id of the last set of data from the previous batch of data. By default, the latest information is given.
lastId is used to filter data and paginate. If lastId is not entered, the default is a maximum of 100 returned data items. The return results include lastId,which can be used as a query parameter to look up new data from the next page. |\n| items | array | Refer to the schema section of items |\n\n**root.data.items Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| id | string | The unique order id generated by the trading system |\n| symbol | string | symbol |\n| opType | string | |\n| type | string | Specify if the order is an 'limit' order or 'market' order. |\n| side | string | Buy or sell |\n| price | string | Order price |\n| size | string | Order size |\n| funds | string | Order Funds |\n| dealSize | string | Number of filled transactions |\n| dealFunds | string | Funds of filled transactions |\n| fee | string | [Handling fees](https://www.kucoin.com/docs-new/api-5327739) |\n| feeCurrency | string | currency used to calculate trading fee |\n| stp | string | [Self Trade Prevention](https://www.kucoin.com/docs-new/doc-338146) is divided into these strategies: CN, CO, CB , and DC |\n| stop | string | |\n| stopTriggered | boolean | |\n| stopPrice | string | |\n| timeInForce | string | Time in force |\n| postOnly | boolean | Whether its a postOnly order. |\n| hidden | boolean | Whether its a hidden order. |\n| iceberg | boolean | Whether its a iceberg order. |\n| visibleSize | string | Visible size of iceberg order in order book. |\n| cancelAfter | integer | A GTT timeInForce that expires in n seconds |\n| channel | string | |\n| clientOid | string | Client Order Id,unique identifier created by the user |\n| remark | string | Order placement remarks |\n| tags | string | Order tag |\n| cancelExist | boolean | Whether there is a cancellation record for the order. |\n| createdAt | integer | |\n| lastUpdatedAt | integer | |\n| tradeType | string | Trade type, redundancy param |\n| inOrderBook | boolean | Whether to enter the orderbook: true: enter the orderbook; false: not enter the orderbook |\n| cancelledSize | string | Number of canceled transactions |\n| cancelledFunds | string | Funds of canceled transactions |\n| remainSize | string | Number of remain transactions |\n| remainFunds | string | Funds of remain transactions |\n| tax | string | Users in some regions need query this field |\n| active | boolean | Order status: true-The status of the order isactive; false-The status of the order is done |\n\n---\n", + "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470197)\n\n:::info[Description]\nThis interface can cancel all open Margin orders by symbol\nThis endpoint only sends cancellation requests. The results of the requests must be obtained by checking the order status or subscribing to websocket.\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | string | |\n\n---\n", "body": {} }, "response": [ { "name": "Successful Response", "originalRequest": { - "method": "GET", + "method": "DELETE", "header": [], "url": { "raw": "", @@ -9323,8 +9264,7 @@ "v3", "hf", "margin", - "orders", - "done" + "orders" ], "query": [ { @@ -9336,36 +9276,6 @@ "key": "tradeType", "value": "MARGIN_TRADE", "description": "Transaction type: MARGIN_TRADE - cross margin trade, MARGIN_ISOLATED_TRADE - isolated margin trade" - }, - { - "key": "side", - "value": null, - "description": "specify if the order is to 'buy' or 'sell'" - }, - { - "key": "type", - "value": null, - "description": "specify if the order is an 'limit' order or 'market' order. " - }, - { - "key": "lastId", - "value": "254062248624417", - "description": "The id of the last set of data from the previous batch of data. By default, the latest information is given.\nlastId is used to filter data and paginate. If lastId is not entered, the default is a maximum of 100 returned data items. The return results include lastId,which can be used as a query parameter to look up new data from the next page." - }, - { - "key": "limit", - "value": "20", - "description": "Default20,Max100" - }, - { - "key": "startAt", - "value": "1728663338000", - "description": "Start time (milisecond)" - }, - { - "key": "endAt", - "value": "1728692138000", - "description": "End time (milisecond)" } ] } @@ -9400,12 +9310,12 @@ } ], "cookie": [], - "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"lastId\": 136112949351,\n \"items\": [\n {\n \"id\": \"6716491f6afcdb00078365c8\",\n \"clientOid\": \"5c52e11203aa677f33e493fb\",\n \"symbol\": \"BTC-USDT\",\n \"opType\": \"DEAL\",\n \"type\": \"limit\",\n \"side\": \"buy\",\n \"price\": \"50000\",\n \"size\": \"0.00001\",\n \"funds\": \"0.5\",\n \"dealSize\": \"0\",\n \"dealFunds\": \"0\",\n \"remainSize\": \"0\",\n \"remainFunds\": \"0\",\n \"cancelledSize\": \"0.00001\",\n \"cancelledFunds\": \"0.5\",\n \"fee\": \"0\",\n \"feeCurrency\": \"USDT\",\n \"stp\": null,\n \"stop\": null,\n \"stopTriggered\": false,\n \"stopPrice\": \"0\",\n \"timeInForce\": \"GTC\",\n \"postOnly\": false,\n \"hidden\": false,\n \"iceberg\": false,\n \"visibleSize\": \"0\",\n \"cancelAfter\": 0,\n \"channel\": \"API\",\n \"remark\": null,\n \"tags\": null,\n \"cancelExist\": true,\n \"tradeType\": \"MARGIN_TRADE\",\n \"inOrderBook\": false,\n \"active\": false,\n \"tax\": \"0\",\n \"createdAt\": 1729513759162,\n \"lastUpdatedAt\": 1729521126597\n }\n ]\n }\n}" + "body": "{\n \"code\": \"200000\",\n \"data\": \"success\"\n}" } ] }, { - "name": "Get Trade History", + "name": "Get Symbols With Open Order", "request": { "method": "GET", "header": [], @@ -9420,57 +9330,19 @@ "v3", "hf", "margin", - "fills" + "order", + "active", + "symbols" ], "query": [ - { - "key": "symbol", - "value": "BTC-USDT", - "description": "symbol" - }, { "key": "tradeType", "value": "MARGIN_TRADE", - "description": "Trade type: MARGIN_TRADE - cross margin trade, MARGIN_ISOLATED_TRADE - isolated margin trade" - }, - { - "key": "orderId", - "value": null, - "description": "The unique order id generated by the trading system\n(If orderId is specified,please ignore the other query parameters)" - }, - { - "key": "side", - "value": null, - "description": "specify if the order is to 'buy' or 'sell'" - }, - { - "key": "type", - "value": null, - "description": "specify if the order is an 'limit' order or 'market' order. " - }, - { - "key": "lastId", - "value": "254062248624417", - "description": "The id of the last set of data from the previous batch of data. By default, the latest information is given.\nlastId is used to filter data and paginate. If lastId is not entered, the default is a maximum of 100 returned data items. The return results include lastId,which can be used as a query parameter to look up new data from the next page." - }, - { - "key": "limit", - "value": "100", - "description": "Default100,Max200" - }, - { - "key": "startAt", - "value": "1728663338000", - "description": "Start time (milisecond)" - }, - { - "key": "endAt", - "value": "1728692138000", - "description": "End time (milisecond)" + "description": "Cross Margin: MARGIN_TRADE, Isolated Margin: MARGIN_ISOLATED_TRADE\n" } ] }, - "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470200)\n\n:::info[Description]\nThis endpoint can be used to obtain a list of the latest Margin transaction details. \nThe returned data is sorted in descending order according to the latest update time of the order.\n:::\n\n:::tip[Tips]\nIf the order is not an active order, you can only get data within the time range of 3 _ 24 hours (ie: from the current time to 3 _ 24 hours ago). If the time range is exceeded, the system will query the data within the time range of 3 * 24 hours by default.\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| items | array | Refer to the schema section of items |\n| lastId | integer | The id of the last set of data from the previous batch of data. By default, the latest information is given.
lastId is used to filter data and paginate. If lastId is not entered, the default is a maximum of 100 returned data items. The return results include lastId,which can be used as a query parameter to look up new data from the next page. |\n\n**root.data.items Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| id | integer | Id of transaction detail |\n| symbol | string | symbol |\n| tradeId | integer | Trade Id, symbol latitude increment |\n| orderId | string | The unique order id generated by the trading system |\n| counterOrderId | string | Counterparty order Id |\n| side | string | Buy or sell |\n| liquidity | string | Liquidity type: taker or maker |\n| forceTaker | boolean | |\n| price | string | Order price |\n| size | string | Order size |\n| funds | string | Order Funds |\n| fee | string | [Handling fees](https://www.kucoin.com/docs-new/api-5327739) |\n| feeRate | string | Fee rate
|\n| feeCurrency | string | currency used to calculate trading fee |\n| stop | string | Take Profit and Stop Loss type, currently HFT does not support the Take Profit and Stop Loss type, so it is empty |\n| tradeType | string | Trade type, redundancy param |\n| tax | string | Users in some regions need query this field |\n| taxRate | string | Tax Rate, Users in some regions need query this field |\n| type | string | Specify if the order is an 'limit' order or 'market' order. |\n| createdAt | integer | |\n\n---\n", + "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470196)\n\n:::info[Description]\nThis interface can query all Margin symbol that has active orders\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| symbolSize | integer | Symbol Size |\n| symbols | array | Refer to the schema section of symbols |\n\n---\n", "body": {} }, "response": [ @@ -9490,53 +9362,15 @@ "v3", "hf", "margin", - "fills" + "order", + "active", + "symbols" ], "query": [ - { - "key": "symbol", - "value": "BTC-USDT", - "description": "symbol" - }, { "key": "tradeType", "value": "MARGIN_TRADE", - "description": "Trade type: MARGIN_TRADE - cross margin trade, MARGIN_ISOLATED_TRADE - isolated margin trade" - }, - { - "key": "orderId", - "value": null, - "description": "The unique order id generated by the trading system\n(If orderId is specified,please ignore the other query parameters)" - }, - { - "key": "side", - "value": null, - "description": "specify if the order is to 'buy' or 'sell'" - }, - { - "key": "type", - "value": null, - "description": "specify if the order is an 'limit' order or 'market' order. " - }, - { - "key": "lastId", - "value": "254062248624417", - "description": "The id of the last set of data from the previous batch of data. By default, the latest information is given.\nlastId is used to filter data and paginate. If lastId is not entered, the default is a maximum of 100 returned data items. The return results include lastId,which can be used as a query parameter to look up new data from the next page." - }, - { - "key": "limit", - "value": "100", - "description": "Default100,Max200" - }, - { - "key": "startAt", - "value": "1728663338000", - "description": "Start time (milisecond)" - }, - { - "key": "endAt", - "value": "1728692138000", - "description": "End time (milisecond)" + "description": "Cross Margin: MARGIN_TRADE, Isolated Margin: MARGIN_ISOLATED_TRADE\n" } ] } @@ -9571,14 +9405,14 @@ } ], "cookie": [], - "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"items\": [\n {\n \"id\": 137891621991,\n \"symbol\": \"BTC-USDT\",\n \"tradeId\": 11040911994273793,\n \"orderId\": \"671868085584bc0007d85f46\",\n \"counterOrderId\": \"67186805b7cbdf00071621f9\",\n \"side\": \"buy\",\n \"liquidity\": \"taker\",\n \"forceTaker\": false,\n \"price\": \"67141.6\",\n \"size\": \"0.00001\",\n \"funds\": \"0.671416\",\n \"fee\": \"0.000671416\",\n \"feeRate\": \"0.001\",\n \"feeCurrency\": \"USDT\",\n \"stop\": \"\",\n \"tradeType\": \"MARGIN_TRADE\",\n \"tax\": \"0\",\n \"taxRate\": \"0\",\n \"type\": \"limit\",\n \"createdAt\": 1729652744998\n }\n ],\n \"lastId\": 137891621991\n }\n}" + "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"symbolSize\": 1,\n \"symbols\": [\n \"BTC-USDT\"\n ]\n }\n}" } ] }, { - "name": "Cancel Order By ClientOid", + "name": "Get Open Orders", "request": { - "method": "DELETE", + "method": "GET", "header": [], "url": { "raw": "", @@ -9592,25 +9426,29 @@ "hf", "margin", "orders", - "client-order", - "{{clientOid}}" + "active" ], "query": [ { "key": "symbol", "value": "BTC-USDT", "description": "symbol" + }, + { + "key": "tradeType", + "value": "MARGIN_TRADE", + "description": "Order type: MARGIN_TRADE - cross margin trading order, MARGIN_ISOLATED_TRADE - isolated margin trading order" } ] }, - "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470201)\n\n:::info[Description]\nThis endpoint can be used to cancel a margin order by clientOid.\nThis endpoint only sends cancellation requests. The results of the requests must be obtained by checking the order status or subscribing to websocket.\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| clientOid | string | Client Order Id,unique identifier created by the user |\n\n---\n", + "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470198)\n\n:::info[Description]\nThis interface is to obtain all Margin active order lists, and the return value of the active order interface is the paged data of all uncompleted order lists. The returned data is sorted in descending order according to the latest update time of the order.\n\nAfter the user successfully places an order, the order is in Active state, and the user can use inOrderBook to determine whether the order has entered the order. Canceled or fully filled orders are marked as completed Done status.\n:::\n\n:::tip[Tips]\nFor high-frequency trading users, we recommend locally caching, maintaining your own order records, and using market data streams to update your order information in real time.\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | array | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| id | string | The unique order id generated by the trading system |\n| symbol | string | symbol |\n| opType | string | |\n| type | string | Specify if the order is an 'limit' order or 'market' order. |\n| side | string | Buy or sell |\n| price | string | Order price |\n| size | string | Order size |\n| funds | string | Order Funds |\n| dealSize | string | Number of filled transactions |\n| dealFunds | string | Funds of filled transactions |\n| fee | string | trading fee |\n| feeCurrency | string | currency used to calculate trading fee |\n| stp | string | [Self Trade Prevention](https://www.kucoin.com/docs-new/doc-338146) is divided into these strategies: CN, CO, CB , and DC |\n| stop | string | |\n| stopTriggered | boolean | |\n| stopPrice | string | |\n| timeInForce | string | Time in force |\n| postOnly | boolean | Whether its a postOnly order. |\n| hidden | boolean | Whether its a hidden order. |\n| iceberg | boolean | Whether its a iceberg order. |\n| visibleSize | string | Visible size of iceberg order in order book. |\n| cancelAfter | integer | A GTT timeInForce that expires in n seconds |\n| channel | string | |\n| clientOid | string | Client Order Id,unique identifier created by the user |\n| remark | string | Order placement remarks |\n| tags | string | Order tag |\n| cancelExist | boolean | Whether there is a cancellation record for the order. |\n| createdAt | integer | |\n| lastUpdatedAt | integer | |\n| tradeType | string | Trade type, redundancy param |\n| inOrderBook | boolean | Whether to enter the orderbook: true: enter the orderbook; false: not enter the orderbook |\n| cancelledSize | string | Number of canceled transactions |\n| cancelledFunds | string | Funds of canceled transactions |\n| remainSize | string | Number of remain transactions |\n| remainFunds | string | Funds of remain transactions |\n| tax | string | Users in some regions need query this field |\n| active | boolean | Order status: true-The status of the order isactive; false-The status of the order is done |\n\n---\n", "body": {} }, "response": [ { "name": "Successful Response", "originalRequest": { - "method": "DELETE", + "method": "GET", "header": [], "url": { "raw": "", @@ -9624,14 +9462,18 @@ "hf", "margin", "orders", - "client-order", - "{{clientOid}}" + "active" ], "query": [ { "key": "symbol", "value": "BTC-USDT", "description": "symbol" + }, + { + "key": "tradeType", + "value": "MARGIN_TRADE", + "description": "Order type: MARGIN_TRADE - cross margin trading order, MARGIN_ISOLATED_TRADE - isolated margin trading order" } ] } @@ -9666,12 +9508,12 @@ } ], "cookie": [], - "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"clientOid\": \"5c52e11203aa677f33e1493fb\"\n }\n}" + "body": "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"id\": \"671667306afcdb000723107f\",\n \"clientOid\": \"5c52e11203aa677f33e493fb\",\n \"symbol\": \"BTC-USDT\",\n \"opType\": \"DEAL\",\n \"type\": \"limit\",\n \"side\": \"buy\",\n \"price\": \"50000\",\n \"size\": \"0.00001\",\n \"funds\": \"0.5\",\n \"dealSize\": \"0\",\n \"dealFunds\": \"0\",\n \"remainSize\": \"0.00001\",\n \"remainFunds\": \"0.5\",\n \"cancelledSize\": \"0\",\n \"cancelledFunds\": \"0\",\n \"fee\": \"0\",\n \"feeCurrency\": \"USDT\",\n \"stp\": null,\n \"stop\": null,\n \"stopTriggered\": false,\n \"stopPrice\": \"0\",\n \"timeInForce\": \"GTC\",\n \"postOnly\": false,\n \"hidden\": false,\n \"iceberg\": false,\n \"visibleSize\": \"0\",\n \"cancelAfter\": 0,\n \"channel\": \"API\",\n \"remark\": null,\n \"tags\": null,\n \"cancelExist\": false,\n \"tradeType\": \"MARGIN_TRADE\",\n \"inOrderBook\": true,\n \"active\": true,\n \"tax\": \"0\",\n \"createdAt\": 1729521456248,\n \"lastUpdatedAt\": 1729521460940\n }\n ]\n}" } ] }, { - "name": "Get Order By OrderId", + "name": "Get Closed Orders", "request": { "method": "GET", "header": [], @@ -9687,17 +9529,52 @@ "hf", "margin", "orders", - "{{orderId}}" + "done" ], "query": [ { "key": "symbol", "value": "BTC-USDT", "description": "symbol" + }, + { + "key": "tradeType", + "value": "MARGIN_TRADE", + "description": "Transaction type: MARGIN_TRADE - cross margin trade, MARGIN_ISOLATED_TRADE - isolated margin trade" + }, + { + "key": "side", + "value": null, + "description": "specify if the order is to 'buy' or 'sell'" + }, + { + "key": "type", + "value": null, + "description": "specify if the order is an 'limit' order or 'market' order. " + }, + { + "key": "lastId", + "value": "254062248624417", + "description": "The id of the last set of data from the previous batch of data. By default, the latest information is given.\nlastId is used to filter data and paginate. If lastId is not entered, the default is a maximum of 100 returned data items. The return results include lastId,which can be used as a query parameter to look up new data from the next page." + }, + { + "key": "limit", + "value": "20", + "description": "Default20,Max100" + }, + { + "key": "startAt", + "value": "1728663338000", + "description": "Start time (milisecond)" + }, + { + "key": "endAt", + "value": "1728692138000", + "description": "End time (milisecond)" } ] }, - "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470202)\n\n:::info[Description]\nThis endpoint can be used to obtain information for a single Margin order using the order id.\n\nAfter the user successfully places an order, the order is in Active state, and the user can use inOrderBook to determine whether the order has entered the order. Canceled or fully filled orders are marked as completed Done status.\n:::\n\n:::tip[Tips]\nIf the order is not an active order, you can only get data within the time range of 3 _ 24 hours (ie: from the current time to 3 _ 24 hours ago). If the time range is exceeded, the system will query the data within the time range of 3 * 24 hours by default.\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| id | string | The unique order id generated by the trading system |\n| symbol | string | symbol |\n| opType | string | |\n| type | string | Specify if the order is an 'limit' order or 'market' order. |\n| side | string | Buy or sell |\n| price | string | Order price |\n| size | string | Order size |\n| funds | string | Order Funds |\n| dealSize | string | Number of filled transactions |\n| dealFunds | string | Funds of filled transactions |\n| fee | string | [Handling fees](https://www.kucoin.com/docs-new/api-5327739) |\n| feeCurrency | string | currency used to calculate trading fee |\n| stp | string | [Self Trade Prevention](https://www.kucoin.com/docs-new/doc-338146) is divided into these strategies: CN, CO, CB , and DC |\n| stop | string | |\n| stopTriggered | boolean | |\n| stopPrice | string | |\n| timeInForce | string | Time in force |\n| postOnly | boolean | Whether its a postOnly order. |\n| hidden | boolean | Whether its a hidden order. |\n| iceberg | boolean | Whether its a iceberg order. |\n| visibleSize | string | Visible size of iceberg order in order book. |\n| cancelAfter | integer | A GTT timeInForce that expires in n seconds |\n| channel | string | |\n| clientOid | string | Client Order Id,unique identifier created by the user |\n| remark | string | Order placement remarks |\n| tags | string | Order tag |\n| cancelExist | boolean | Whether there is a cancellation record for the order. |\n| createdAt | integer | |\n| lastUpdatedAt | integer | |\n| tradeType | string | Trade type, redundancy param |\n| inOrderBook | boolean | Whether to enter the orderbook: true: enter the orderbook; false: not enter the orderbook |\n| cancelledSize | string | Number of canceled transactions |\n| cancelledFunds | string | Funds of canceled transactions |\n| remainSize | string | Number of remain transactions |\n| remainFunds | string | Funds of remain transactions |\n| tax | string | Users in some regions need query this field |\n| active | boolean | Order status: true-The status of the order isactive; false-The status of the order is done |\n\n---\n", + "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470199)\n\n:::info[Description]\nThis interface is to obtain all Margin Closed order lists, and the return value of the active order interface is the paged data of all uncompleted order lists. The returned data is sorted in descending order according to the latest update time of the order.\n\nAfter the user successfully places an order, the order is in Active state, and the user can use inOrderBook to determine whether the order has entered the order. Canceled or fully filled orders are marked as completed Done status.\n:::\n\n:::tip[Tips]\nIf the order is not an active order, you can only get data within the time range of 3 _ 24 hours (ie: from the current time to 3 _ 24 hours ago). If the time range is exceeded, the system will query the data within the time range of 3 * 24 hours by default.\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| lastId | integer | The id of the last set of data from the previous batch of data. By default, the latest information is given.
lastId is used to filter data and paginate. If lastId is not entered, the default is a maximum of 100 returned data items. The return results include lastId,which can be used as a query parameter to look up new data from the next page. |\n| items | array | Refer to the schema section of items |\n\n**root.data.items Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| id | string | The unique order id generated by the trading system |\n| symbol | string | symbol |\n| opType | string | |\n| type | string | Specify if the order is an 'limit' order or 'market' order. |\n| side | string | Buy or sell |\n| price | string | Order price |\n| size | string | Order size |\n| funds | string | Order Funds |\n| dealSize | string | Number of filled transactions |\n| dealFunds | string | Funds of filled transactions |\n| fee | string | [Handling fees](https://www.kucoin.com/docs-new/api-5327739) |\n| feeCurrency | string | currency used to calculate trading fee |\n| stp | string | [Self Trade Prevention](https://www.kucoin.com/docs-new/doc-338146) is divided into these strategies: CN, CO, CB , and DC |\n| stop | string | |\n| stopTriggered | boolean | |\n| stopPrice | string | |\n| timeInForce | string | Time in force |\n| postOnly | boolean | Whether its a postOnly order. |\n| hidden | boolean | Whether its a hidden order. |\n| iceberg | boolean | Whether its a iceberg order. |\n| visibleSize | string | Visible size of iceberg order in order book. |\n| cancelAfter | integer | A GTT timeInForce that expires in n seconds |\n| channel | string | |\n| clientOid | string | Client Order Id,unique identifier created by the user |\n| remark | string | Order placement remarks |\n| tags | string | Order tag |\n| cancelExist | boolean | Whether there is a cancellation record for the order. |\n| createdAt | integer | |\n| lastUpdatedAt | integer | |\n| tradeType | string | Trade type, redundancy param |\n| inOrderBook | boolean | Whether to enter the orderbook: true: enter the orderbook; false: not enter the orderbook |\n| cancelledSize | string | Number of canceled transactions |\n| cancelledFunds | string | Funds of canceled transactions |\n| remainSize | string | Number of remain transactions |\n| remainFunds | string | Funds of remain transactions |\n| tax | string | Users in some regions need query this field |\n| active | boolean | Order status: true-The status of the order isactive; false-The status of the order is done |\n\n---\n", "body": {} }, "response": [ @@ -9718,13 +9595,48 @@ "hf", "margin", "orders", - "{{orderId}}" + "done" ], "query": [ { "key": "symbol", "value": "BTC-USDT", "description": "symbol" + }, + { + "key": "tradeType", + "value": "MARGIN_TRADE", + "description": "Transaction type: MARGIN_TRADE - cross margin trade, MARGIN_ISOLATED_TRADE - isolated margin trade" + }, + { + "key": "side", + "value": null, + "description": "specify if the order is to 'buy' or 'sell'" + }, + { + "key": "type", + "value": null, + "description": "specify if the order is an 'limit' order or 'market' order. " + }, + { + "key": "lastId", + "value": "254062248624417", + "description": "The id of the last set of data from the previous batch of data. By default, the latest information is given.\nlastId is used to filter data and paginate. If lastId is not entered, the default is a maximum of 100 returned data items. The return results include lastId,which can be used as a query parameter to look up new data from the next page." + }, + { + "key": "limit", + "value": "20", + "description": "Default20,Max100" + }, + { + "key": "startAt", + "value": "1728663338000", + "description": "Start time (milisecond)" + }, + { + "key": "endAt", + "value": "1728692138000", + "description": "End time (milisecond)" } ] } @@ -9759,12 +9671,12 @@ } ], "cookie": [], - "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"id\": \"671667306afcdb000723107f\",\n \"symbol\": \"BTC-USDT\",\n \"opType\": \"DEAL\",\n \"type\": \"limit\",\n \"side\": \"buy\",\n \"price\": \"50000\",\n \"size\": \"0.00001\",\n \"funds\": \"0.5\",\n \"dealSize\": \"0\",\n \"dealFunds\": \"0\",\n \"fee\": \"0\",\n \"feeCurrency\": \"USDT\",\n \"stp\": null,\n \"stop\": null,\n \"stopTriggered\": false,\n \"stopPrice\": \"0\",\n \"timeInForce\": \"GTC\",\n \"postOnly\": false,\n \"hidden\": false,\n \"iceberg\": false,\n \"visibleSize\": \"0\",\n \"cancelAfter\": 0,\n \"channel\": \"API\",\n \"clientOid\": \"5c52e11203aa677f33e493fb\",\n \"remark\": null,\n \"tags\": null,\n \"cancelExist\": false,\n \"createdAt\": 1729521456248,\n \"lastUpdatedAt\": 1729651011877,\n \"tradeType\": \"MARGIN_TRADE\",\n \"inOrderBook\": true,\n \"cancelledSize\": \"0\",\n \"cancelledFunds\": \"0\",\n \"remainSize\": \"0.00001\",\n \"remainFunds\": \"0.5\",\n \"tax\": \"0\",\n \"active\": true\n }\n}" + "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"lastId\": 136112949351,\n \"items\": [\n {\n \"id\": \"6716491f6afcdb00078365c8\",\n \"clientOid\": \"5c52e11203aa677f33e493fb\",\n \"symbol\": \"BTC-USDT\",\n \"opType\": \"DEAL\",\n \"type\": \"limit\",\n \"side\": \"buy\",\n \"price\": \"50000\",\n \"size\": \"0.00001\",\n \"funds\": \"0.5\",\n \"dealSize\": \"0\",\n \"dealFunds\": \"0\",\n \"remainSize\": \"0\",\n \"remainFunds\": \"0\",\n \"cancelledSize\": \"0.00001\",\n \"cancelledFunds\": \"0.5\",\n \"fee\": \"0\",\n \"feeCurrency\": \"USDT\",\n \"stp\": null,\n \"stop\": null,\n \"stopTriggered\": false,\n \"stopPrice\": \"0\",\n \"timeInForce\": \"GTC\",\n \"postOnly\": false,\n \"hidden\": false,\n \"iceberg\": false,\n \"visibleSize\": \"0\",\n \"cancelAfter\": 0,\n \"channel\": \"API\",\n \"remark\": null,\n \"tags\": null,\n \"cancelExist\": true,\n \"tradeType\": \"MARGIN_TRADE\",\n \"inOrderBook\": false,\n \"active\": false,\n \"tax\": \"0\",\n \"createdAt\": 1729513759162,\n \"lastUpdatedAt\": 1729521126597\n }\n ]\n }\n}" } ] }, { - "name": "Get Order By ClientOid", + "name": "Get Trade History", "request": { "method": "GET", "header": [], @@ -9779,19 +9691,57 @@ "v3", "hf", "margin", - "orders", - "client-order", - "{{clientOid}}" + "fills" ], "query": [ { "key": "symbol", "value": "BTC-USDT", "description": "symbol" + }, + { + "key": "tradeType", + "value": "MARGIN_TRADE", + "description": "Trade type: MARGIN_TRADE - cross margin trade, MARGIN_ISOLATED_TRADE - isolated margin trade" + }, + { + "key": "orderId", + "value": null, + "description": "The unique order id generated by the trading system\n(If orderId is specified,please ignore the other query parameters)" + }, + { + "key": "side", + "value": null, + "description": "specify if the order is to 'buy' or 'sell'" + }, + { + "key": "type", + "value": null, + "description": "specify if the order is an 'limit' order or 'market' order. " + }, + { + "key": "lastId", + "value": "254062248624417", + "description": "The id of the last set of data from the previous batch of data. By default, the latest information is given.\nlastId is used to filter data and paginate. If lastId is not entered, the default is a maximum of 100 returned data items. The return results include lastId,which can be used as a query parameter to look up new data from the next page." + }, + { + "key": "limit", + "value": "100", + "description": "Default100,Max200" + }, + { + "key": "startAt", + "value": "1728663338000", + "description": "Start time (milisecond)" + }, + { + "key": "endAt", + "value": "1728692138000", + "description": "End time (milisecond)" } ] }, - "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470203)\n\n:::info[Description]\nThis endpoint can be used to obtain information for a single Margin order using the client order id.\n\nAfter the user successfully places an order, the order is in Active state, and the user can use inOrderBook to determine whether the order has entered the order. Canceled or fully filled orders are marked as completed Done status.\n:::\n\n:::tip[Tips]\nIf the order is not an active order, you can only get data within the time range of 3 _ 24 hours (ie: from the current time to 3 _ 24 hours ago). If the time range is exceeded, the system will query the data within the time range of 3 * 24 hours by default.\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| id | string | The unique order id generated by the trading system |\n| symbol | string | symbol |\n| opType | string | |\n| type | string | Specify if the order is an 'limit' order or 'market' order. |\n| side | string | Buy or sell |\n| price | string | Order price |\n| size | string | Order size |\n| funds | string | Order Funds |\n| dealSize | string | Number of filled transactions |\n| dealFunds | string | Funds of filled transactions |\n| fee | string | [Handling fees](https://www.kucoin.com/docs-new/api-5327739) |\n| feeCurrency | string | currency used to calculate trading fee |\n| stp | string | [Self Trade Prevention](https://www.kucoin.com/docs-new/doc-338146) is divided into these strategies: CN, CO, CB , and DC |\n| stop | string | |\n| stopTriggered | boolean | |\n| stopPrice | string | |\n| timeInForce | string | Time in force |\n| postOnly | boolean | Whether its a postOnly order. |\n| hidden | boolean | Whether its a hidden order. |\n| iceberg | boolean | Whether its a iceberg order. |\n| visibleSize | string | Visible size of iceberg order in order book. |\n| cancelAfter | integer | A GTT timeInForce that expires in n seconds |\n| channel | string | |\n| clientOid | string | Client Order Id,unique identifier created by the user |\n| remark | string | Order placement remarks |\n| tags | string | Order tag |\n| cancelExist | boolean | Whether there is a cancellation record for the order. |\n| createdAt | integer | |\n| lastUpdatedAt | integer | |\n| tradeType | string | Trade type, redundancy param |\n| inOrderBook | boolean | Whether to enter the orderbook: true: enter the orderbook; false: not enter the orderbook |\n| cancelledSize | string | Number of canceled transactions |\n| cancelledFunds | string | Funds of canceled transactions |\n| remainSize | string | Number of remain transactions |\n| remainFunds | string | Funds of remain transactions |\n| tax | string | Users in some regions need query this field |\n| active | boolean | Order status: true-The status of the order isactive; false-The status of the order is done |\n\n---\n", + "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470200)\n\n:::info[Description]\nThis endpoint can be used to obtain a list of the latest Margin transaction details. \nThe returned data is sorted in descending order according to the latest update time of the order.\n:::\n\n:::tip[Tips]\nIf the order is not an active order, you can only get data within the time range of 3 _ 24 hours (ie: from the current time to 3 _ 24 hours ago). If the time range is exceeded, the system will query the data within the time range of 3 * 24 hours by default.\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| items | array | Refer to the schema section of items |\n| lastId | integer | The id of the last set of data from the previous batch of data. By default, the latest information is given.
lastId is used to filter data and paginate. If lastId is not entered, the default is a maximum of 100 returned data items. The return results include lastId,which can be used as a query parameter to look up new data from the next page. |\n\n**root.data.items Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| id | integer | Id of transaction detail |\n| symbol | string | symbol |\n| tradeId | integer | Trade Id, symbol latitude increment |\n| orderId | string | The unique order id generated by the trading system |\n| counterOrderId | string | Counterparty order Id |\n| side | string | Buy or sell |\n| liquidity | string | Liquidity type: taker or maker |\n| forceTaker | boolean | |\n| price | string | Order price |\n| size | string | Order size |\n| funds | string | Order Funds |\n| fee | string | [Handling fees](https://www.kucoin.com/docs-new/api-5327739) |\n| feeRate | string | Fee rate
|\n| feeCurrency | string | currency used to calculate trading fee |\n| stop | string | Take Profit and Stop Loss type, currently HFT does not support the Take Profit and Stop Loss type, so it is empty |\n| tradeType | string | Trade type, redundancy param |\n| tax | string | Users in some regions need query this field |\n| taxRate | string | Tax Rate, Users in some regions need query this field |\n| type | string | Specify if the order is an 'limit' order or 'market' order. |\n| createdAt | integer | |\n\n---\n", "body": {} }, "response": [ @@ -9811,15 +9761,53 @@ "v3", "hf", "margin", - "orders", - "client-order", - "{{clientOid}}" + "fills" ], "query": [ { "key": "symbol", "value": "BTC-USDT", "description": "symbol" + }, + { + "key": "tradeType", + "value": "MARGIN_TRADE", + "description": "Trade type: MARGIN_TRADE - cross margin trade, MARGIN_ISOLATED_TRADE - isolated margin trade" + }, + { + "key": "orderId", + "value": null, + "description": "The unique order id generated by the trading system\n(If orderId is specified,please ignore the other query parameters)" + }, + { + "key": "side", + "value": null, + "description": "specify if the order is to 'buy' or 'sell'" + }, + { + "key": "type", + "value": null, + "description": "specify if the order is an 'limit' order or 'market' order. " + }, + { + "key": "lastId", + "value": "254062248624417", + "description": "The id of the last set of data from the previous batch of data. By default, the latest information is given.\nlastId is used to filter data and paginate. If lastId is not entered, the default is a maximum of 100 returned data items. The return results include lastId,which can be used as a query parameter to look up new data from the next page." + }, + { + "key": "limit", + "value": "100", + "description": "Default100,Max200" + }, + { + "key": "startAt", + "value": "1728663338000", + "description": "Start time (milisecond)" + }, + { + "key": "endAt", + "value": "1728692138000", + "description": "End time (milisecond)" } ] } @@ -9854,14 +9842,14 @@ } ], "cookie": [], - "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"id\": \"671667306afcdb000723107f\",\n \"symbol\": \"BTC-USDT\",\n \"opType\": \"DEAL\",\n \"type\": \"limit\",\n \"side\": \"buy\",\n \"price\": \"50000\",\n \"size\": \"0.00001\",\n \"funds\": \"0.5\",\n \"dealSize\": \"0\",\n \"dealFunds\": \"0\",\n \"fee\": \"0\",\n \"feeCurrency\": \"USDT\",\n \"stp\": null,\n \"stop\": null,\n \"stopTriggered\": false,\n \"stopPrice\": \"0\",\n \"timeInForce\": \"GTC\",\n \"postOnly\": false,\n \"hidden\": false,\n \"iceberg\": false,\n \"visibleSize\": \"0\",\n \"cancelAfter\": 0,\n \"channel\": \"API\",\n \"clientOid\": \"5c52e11203aa677f33e493fb\",\n \"remark\": null,\n \"tags\": null,\n \"cancelExist\": false,\n \"createdAt\": 1729521456248,\n \"lastUpdatedAt\": 1729651011877,\n \"tradeType\": \"MARGIN_TRADE\",\n \"inOrderBook\": true,\n \"cancelledSize\": \"0\",\n \"cancelledFunds\": \"0\",\n \"remainSize\": \"0.00001\",\n \"remainFunds\": \"0.5\",\n \"tax\": \"0\",\n \"active\": true\n }\n}" + "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"items\": [\n {\n \"id\": 137891621991,\n \"symbol\": \"BTC-USDT\",\n \"tradeId\": 11040911994273793,\n \"orderId\": \"671868085584bc0007d85f46\",\n \"counterOrderId\": \"67186805b7cbdf00071621f9\",\n \"side\": \"buy\",\n \"liquidity\": \"taker\",\n \"forceTaker\": false,\n \"price\": \"67141.6\",\n \"size\": \"0.00001\",\n \"funds\": \"0.671416\",\n \"fee\": \"0.000671416\",\n \"feeRate\": \"0.001\",\n \"feeCurrency\": \"USDT\",\n \"stop\": \"\",\n \"tradeType\": \"MARGIN_TRADE\",\n \"tax\": \"0\",\n \"taxRate\": \"0\",\n \"type\": \"limit\",\n \"createdAt\": 1729652744998\n }\n ],\n \"lastId\": 137891621991\n }\n}" } ] }, { - "name": "Add Order", + "name": "Get Order By OrderId", "request": { - "method": "POST", + "method": "GET", "header": [], "url": { "raw": "", @@ -9874,26 +9862,25 @@ "v3", "hf", "margin", - "order" + "orders", + "{{orderId}}" ], - "query": [] - }, - "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470204)\n\n:::info[Description]\nPlace order to the Cross-margin or Isolated-margin trading system, you can place two major types of orders: limit and market. Orders can only be placed if your account has sufficient funds. Once an order is placed, your funds will be put on hold for the duration of the order. The amount of funds on hold depends on the order type and parameters specified.\n:::\n\n:::tip[Tips]\nPlease note that once your order enters the order book, the system will freeze the handling fees for the order ahead of time.\n\nBefore placing orders, please be sure to fully understand the meaning of the parameters for each trading pair.\n:::\n\n:::tip[Tips]\nThe maximum number of active orders per account is 2000, with a maximum of 200 active orders per trading pair.\n:::\n\n\n**Public order placement request parameters**\n\n| Param | Type | Mandatory | Description |\n| --------- | ------ | --------- | ----------- |\n| clientOid | String | Yes | Client Order Id,unique identifier created by the user, the use of UUID is recommended |\n| symbol | String | Yes | symbol |\n| side | String | Yes | `buy` or `sell` |\n| type | String | No | Order type `limit` and `market`, defult is limit |\n| stp | String | No | self trade prevention is divided into four strategies: `CN`, `CO`, `CB` , and `DC` |\n| isIsolated | boolean | No | true - isolated margin ,false - cross margin. defult as false |\n| autoBorrow | boolean | No | When Margin Account has inefficient balance, our system autoborrows inefficient assets and opens positions according to the lowest market interest rate. |\n| autoRepay | boolean | No | AutoPay allows returning borrowed assets when you close a position. Our system automatically triggers the repayment and the maximum repayment amount equals to the filled-order amount. |\n\n**Additional Request Parameters Required by `limit` Orders**\n\n| Param | Type | Mandatory | Description |\n| ----------- | ------- | --------- | ----------- |\n| price | String | Yes | Specify price for currency |\n| size | String | Yes | Specify quantity for currency |\n| timeInForce | String | No | Order timing strategy `GTC`, `GTT`, `IOC`, `FOK` (The default is `GTC`) |\n| cancelAfter | long | No | Cancel after `n` seconds,the order timing strategy is `GTT` |\n| postOnly | boolean | No | passive order labels, this is disabled when the order timing strategy is `IOC` or `FOK` |\n| hidden | boolean | No | Hidden or not (not shown in order book) |\n| iceberg | boolean | No | Whether or not only visible portions of orders are shown in iceberg orders |\n| visibleSize | String | No | Maximum visible quantity in iceberg orders |\n\n**Additional request parameters required by `market` orders**\n\n| Param | Type | Mandatory | Description |\n| ----- | ------ | --------- | ------------------------------------------ |\n| size | String | No | (Select one out of two: `size` or `funds`) |\n| funds | String | No | (Select one out of two: `size` or `funds`) |\n\n\n**Hold**\n\nFor limit price purchase orders, we will hold the amount of funds (price * size) required for your purchase order. Similarly, for limit price sell orders, we will also hold you sell order assets. When the transaction is executed, the service fees will be calculated. If you cancel a portion of a filled or unfilled order, then the remaining funds or amounts will be released and returned to your account. For market price buy/sell orders that require specific funds, we will hold the required funds in from your account. If only the size is specified, we may freeze (usually for a very short amount of time) all of the funds in your account prior to the order being filled or cancelled.\n\n\n**Order Lifecycle**\n\nWhen an order placement request is successful (the matching engine receives the order) or denied (due to there being insufficient funds or illegal parameter values, etc.), the system will respond to the HTTP request. When an order is successfully placed, the order ID is returned. The order will be matched, which could result in it being fully or partially filled. When an order is fully or partially filled, the remaining portions of the order will be in an active state awaiting to be matched (this does not include IOC orders). Orders that are fully or partially filled(already cancelled) will be put into the “done” state.\n\nUsers that have subscribed to the Market Data Channel can use the order ID (orderId) and client ID (clientOid) to identify messages.\n\n**Price Protection Mechanisms**\n\nPrice protection mechanisms ae enabled for order placements. Rules are detailed below:\n\n- If the spot trading market order/limit order placed by the user can be directly matched with an order in the current order book, the system will judge whether deviation between the price corresponding to the transaction depth and the spread exceeds the threshold value (the threshold value can be obtained using the symbol API endpoint);\n\n- If it is exceeded, for limit orders, the order will be directly cancelled;\n\n- If it is a market order, then the system will partially execute the order. The execution limit will be the order size within the price range corresponding to the threshold value. The remaining orders will not be filled.\n\nFor example: if the threshold value is 10%, when a user places a market price purchase order in the KCS/USDT trading market for 10,000 USDT (the selling price is currently 1.20000), the system will determine that after the order is completely filled, the final price will be 1.40000. (1.40000-1.20000)/1.20000=16.7%>10%. The threshold value is 1.32000. The user’s market price purchase order will be filled only to a maximum of 1.32000. The remaining order portions will not be matched with orders in the order book. Note: this feature may not be able to determine depth with complete accuracy. If your order is not completely filled, it may be because the portion exceeding the threshold value was not filled.\n\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| clientOid | string | Client Order Id,The ClientOid field is a unique ID created by the user(we recommend using a UUID), and can only contain numbers, letters, underscores (_), and hyphens (-). This field is returned when order information is obtained. You can use clientOid to tag your orders. ClientOid is different from the order ID created by the service provider. Please do not initiate requests using the same clientOid. The maximum length for the ClientOid is 40 characters.

Please remember the orderId created by the service provider, it used to check for updates in order status. |\n| side | string | specify if the order is to 'buy' or 'sell' |\n| symbol | string | symbol |\n| type | string | specify if the order is an 'limit' order or 'market' order.

The type of order you specify when you place your order determines whether or not you need to request other parameters and also affects the execution of the matching engine.

When placing a limit order, you must specify a price and size. The system will try to match the order according to market price or a price better than market price. If the order cannot be immediately matched, it will stay in the order book until it is matched or the user cancels.

Unlike limit orders, the price for market orders fluctuates with market prices. When placing a market order, you do not need to specify a price, you only need to specify a quantity. Market orders are filled immediately and will not enter the order book. All market orders are takers and a taker fee will be charged. |\n| stp | string | [Self Trade Prevention](https://www.kucoin.com/docs-new/doc-338146) is divided into these strategies: CN, CO, CB , and DC |\n| price | string | Specify price for order

When placing a limit order, the price must be based on priceIncrement for the trading pair. The price increment (priceIncrement) is the price precision for the trading pair. For example, for the BTC-USDT trading pair, the priceIncrement is 0.00001000. So the price for your orders cannot be less than 0.00001000 and must be a multiple of priceIncrement. Otherwise, the order will return an invalid priceIncrement error. |\n| size | string | Specify quantity for order

When **type** is limit, size refers to the amount of trading targets (the asset name written in front) for the trading pair. Teh Size must be based on the baseIncrement of the trading pair. The baseIncrement represents the precision for the trading pair. The size of an order must be a positive-integer multiple of baseIncrement and must be between baseMinSize and baseMaxSize.

When **type** is market, select one out of two: size or funds |\n| timeInForce | string | [Time in force](https://www.kucoin.com/docs-new/api-5176570) is a special strategy used during trading |\n| postOnly | boolean | passive order labels, this is disabled when the order timing strategy is IOC or FOK |\n| hidden | boolean | [Hidden order](https://www.kucoin.com/docs-new/doc-338146) or not (not shown in order book) |\n| iceberg | boolean | Whether or not only visible portions of orders are shown in [Iceberg orders](https://www.kucoin.com/docs-new/doc-338146) |\n| visibleSize | string | Maximum visible quantity in iceberg orders |\n| cancelAfter | integer | Cancel after n seconds,the order timing strategy is GTT |\n| funds | string | When **type** is market, select one out of two: size or funds |\n| isIsolated | boolean | true - isolated margin ,false - cross margin. defult as false |\n| autoBorrow | boolean | When Margin Account has inefficient balance, our system autoborrows inefficient assets and opens positions according to the lowest market interest rate. |\n| autoRepay | boolean | AutoPay allows returning borrowed assets when you close a position. Our system automatically triggers the repayment and the maximum repayment amount equals to the filled-order amount. |\n\n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| orderId | string | The unique order id generated by the trading system,which can be used later for further actions such as canceling the order. |\n| loanApplyId | string | Borrow order id. The field is returned only after placing the order under the mode of Auto-Borrow. |\n| borrowSize | string | Borrowed amount. The field is returned only after placing the order under the mode of Auto-Borrow. |\n| clientOid | string | The user self-defined order id. |\n\n---\n", - "body": { - "mode": "raw", - "raw": "//limit order\n{\n \"type\": \"limit\",\n \"symbol\": \"BTC-USDT\",\n \"side\": \"buy\",\n \"price\": \"50000\",\n \"size\": \"0.00001\",\n \"clientOid\": \"5c52e11203aa677f33e493fb\",\n \"remark\": \"order remarks\"\n}\n\n//market order 1\n// {\n// \"type\": \"market\",\n// \"symbol\": \"BTC-USDT\",\n// \"side\": \"buy\",\n// \"size\": \"0.00001\",\n// \"clientOid\": \"5c52e11203aa677f33e493fc\",\n// \"remark\": \"order remarks\"\n// }\n\n//market order 2\n// {\n// \"type\": \"market\",\n// \"symbol\": \"BTC-USDT\",\n// \"side\": \"buy\",\n// \"funds\": \"1\",\n// \"clientOid\": \"5c52e11203aa677f33e493fc\",\n// \"remark\": \"order remarks\"\n// }\n", - "options": { - "raw": { - "language": "json" + "query": [ + { + "key": "symbol", + "value": "BTC-USDT", + "description": "symbol" } - } - } + ] + }, + "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470202)\n\n:::info[Description]\nThis endpoint can be used to obtain information for a single Margin order using the order id.\n\nAfter the user successfully places an order, the order is in Active state, and the user can use inOrderBook to determine whether the order has entered the order. Canceled or fully filled orders are marked as completed Done status.\n:::\n\n:::tip[Tips]\nIf the order is not an active order, you can only get data within the time range of 3 _ 24 hours (ie: from the current time to 3 _ 24 hours ago). If the time range is exceeded, the system will query the data within the time range of 3 * 24 hours by default.\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| id | string | The unique order id generated by the trading system |\n| symbol | string | symbol |\n| opType | string | |\n| type | string | Specify if the order is an 'limit' order or 'market' order. |\n| side | string | Buy or sell |\n| price | string | Order price |\n| size | string | Order size |\n| funds | string | Order Funds |\n| dealSize | string | Number of filled transactions |\n| dealFunds | string | Funds of filled transactions |\n| fee | string | [Handling fees](https://www.kucoin.com/docs-new/api-5327739) |\n| feeCurrency | string | currency used to calculate trading fee |\n| stp | string | [Self Trade Prevention](https://www.kucoin.com/docs-new/doc-338146) is divided into these strategies: CN, CO, CB , and DC |\n| stop | string | |\n| stopTriggered | boolean | |\n| stopPrice | string | |\n| timeInForce | string | Time in force |\n| postOnly | boolean | Whether its a postOnly order. |\n| hidden | boolean | Whether its a hidden order. |\n| iceberg | boolean | Whether its a iceberg order. |\n| visibleSize | string | Visible size of iceberg order in order book. |\n| cancelAfter | integer | A GTT timeInForce that expires in n seconds |\n| channel | string | |\n| clientOid | string | Client Order Id,unique identifier created by the user |\n| remark | string | Order placement remarks |\n| tags | string | Order tag |\n| cancelExist | boolean | Whether there is a cancellation record for the order. |\n| createdAt | integer | |\n| lastUpdatedAt | integer | |\n| tradeType | string | Trade type, redundancy param |\n| inOrderBook | boolean | Whether to enter the orderbook: true: enter the orderbook; false: not enter the orderbook |\n| cancelledSize | string | Number of canceled transactions |\n| cancelledFunds | string | Funds of canceled transactions |\n| remainSize | string | Number of remain transactions |\n| remainFunds | string | Funds of remain transactions |\n| tax | string | Users in some regions need query this field |\n| active | boolean | Order status: true-The status of the order isactive; false-The status of the order is done |\n\n---\n", + "body": {} }, "response": [ { "name": "Successful Response", "originalRequest": { - "method": "POST", + "method": "GET", "header": [], "url": { "raw": "", @@ -9906,9 +9893,16 @@ "v3", "hf", "margin", - "order" + "orders", + "{{orderId}}" ], - "query": [] + "query": [ + { + "key": "symbol", + "value": "BTC-USDT", + "description": "symbol" + } + ] } }, "status": "OK", @@ -9941,14 +9935,14 @@ } ], "cookie": [], - "body": "{\n \"success\": true,\n \"code\": \"200000\",\n \"data\": {\n \"orderId\": \"671663e02188630007e21c9c\",\n \"clientOid\": \"5c52e11203aa677f33e1493fb\",\n \"borrowSize\": \"10.2\",\n \"loanApplyId\": \"600656d9a33ac90009de4f6f\"\n }\n}" + "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"id\": \"671667306afcdb000723107f\",\n \"symbol\": \"BTC-USDT\",\n \"opType\": \"DEAL\",\n \"type\": \"limit\",\n \"side\": \"buy\",\n \"price\": \"50000\",\n \"size\": \"0.00001\",\n \"funds\": \"0.5\",\n \"dealSize\": \"0\",\n \"dealFunds\": \"0\",\n \"fee\": \"0\",\n \"feeCurrency\": \"USDT\",\n \"stp\": null,\n \"stop\": null,\n \"stopTriggered\": false,\n \"stopPrice\": \"0\",\n \"timeInForce\": \"GTC\",\n \"postOnly\": false,\n \"hidden\": false,\n \"iceberg\": false,\n \"visibleSize\": \"0\",\n \"cancelAfter\": 0,\n \"channel\": \"API\",\n \"clientOid\": \"5c52e11203aa677f33e493fb\",\n \"remark\": null,\n \"tags\": null,\n \"cancelExist\": false,\n \"createdAt\": 1729521456248,\n \"lastUpdatedAt\": 1729651011877,\n \"tradeType\": \"MARGIN_TRADE\",\n \"inOrderBook\": true,\n \"cancelledSize\": \"0\",\n \"cancelledFunds\": \"0\",\n \"remainSize\": \"0.00001\",\n \"remainFunds\": \"0.5\",\n \"tax\": \"0\",\n \"active\": true\n }\n}" } ] }, { - "name": "Add Order Test", + "name": "Get Order By ClientOid", "request": { - "method": "POST", + "method": "GET", "header": [], "url": { "raw": "", @@ -9961,27 +9955,26 @@ "v3", "hf", "margin", - "order", - "test" + "orders", + "client-order", + "{{clientOid}}" ], - "query": [] - }, - "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470205)\n\n:::info[Description]\nOrder test endpoint, the request parameters and return parameters of this endpoint are exactly the same as the order endpoint, and can be used to verify whether the signature is correct and other operations. After placing an order, the order will not enter the matching system, and the order cannot be queried.\n:::\n\n:::tip[Tips]\nPlease note that once your order enters the order book, the system will freeze the handling fees for the order ahead of time.\n\nBefore placing orders, please be sure to fully understand the meaning of the parameters for each trading pair.\n:::\n\n:::tip[Tips]\nThe maximum number of active orders per account is 2000, with a maximum of 200 active orders per trading pair.\n:::\n\n\n**Public order placement request parameters**\n\n| Param | Type | Mandatory | Description |\n| --------- | ------ | --------- | ----------- |\n| clientOid | String | Yes | Client Order Id,unique identifier created by the user, the use of UUID is recommended |\n| symbol | String | Yes | symbol |\n| side | String | Yes | `buy` or `sell` |\n| type | String | No | Order type `limit` and `market`, defult is limit |\n| stp | String | No | self trade prevention is divided into four strategies: `CN`, `CO`, `CB` , and `DC` |\n| isIsolated | boolean | No | true - isolated margin ,false - cross margin. defult as false |\n| autoBorrow | boolean | No | When Margin Account has inefficient balance, our system autoborrows inefficient assets and opens positions according to the lowest market interest rate. |\n| autoRepay | boolean | No | AutoPay allows returning borrowed assets when you close a position. Our system automatically triggers the repayment and the maximum repayment amount equals to the filled-order amount. |\n\n**Additional Request Parameters Required by `limit` Orders**\n\n| Param | Type | Mandatory | Description |\n| ----------- | ------- | --------- | ----------- |\n| price | String | Yes | Specify price for currency |\n| size | String | Yes | Specify quantity for currency |\n| timeInForce | String | No | Order timing strategy `GTC`, `GTT`, `IOC`, `FOK` (The default is `GTC`) |\n| cancelAfter | long | No | Cancel after `n` seconds,the order timing strategy is `GTT` |\n| postOnly | boolean | No | passive order labels, this is disabled when the order timing strategy is `IOC` or `FOK` |\n| hidden | boolean | No | Hidden or not (not shown in order book) |\n| iceberg | boolean | No | Whether or not only visible portions of orders are shown in iceberg orders |\n| visibleSize | String | No | Maximum visible quantity in iceberg orders |\n\n**Additional request parameters required by `market` orders**\n\n| Param | Type | Mandatory | Description |\n| ----- | ------ | --------- | ------------------------------------------ |\n| size | String | No | (Select one out of two: `size` or `funds`) |\n| funds | String | No | (Select one out of two: `size` or `funds`) |\n\n\n**Hold**\n\nFor limit price purchase orders, we will hold the amount of funds (price * size) required for your purchase order. Similarly, for limit price sell orders, we will also hold you sell order assets. When the transaction is executed, the service fees will be calculated. If you cancel a portion of a filled or unfilled order, then the remaining funds or amounts will be released and returned to your account. For market price buy/sell orders that require specific funds, we will hold the required funds in from your account. If only the size is specified, we may freeze (usually for a very short amount of time) all of the funds in your account prior to the order being filled or cancelled.\n\n\n**Order Lifecycle**\n\nWhen an order placement request is successful (the matching engine receives the order) or denied (due to there being insufficient funds or illegal parameter values, etc.), the system will respond to the HTTP request. When an order is successfully placed, the order ID is returned. The order will be matched, which could result in it being fully or partially filled. When an order is fully or partially filled, the remaining portions of the order will be in an active state awaiting to be matched (this does not include IOC orders). Orders that are fully or partially filled(already cancelled) will be put into the “done” state.\n\nUsers that have subscribed to the Market Data Channel can use the order ID (orderId) and client ID (clientOid) to identify messages.\n\n**Price Protection Mechanisms**\n\nPrice protection mechanisms ae enabled for order placements. Rules are detailed below:\n\n- If the spot trading market order/limit order placed by the user can be directly matched with an order in the current order book, the system will judge whether deviation between the price corresponding to the transaction depth and the spread exceeds the threshold value (the threshold value can be obtained using the symbol API endpoint);\n\n- If it is exceeded, for limit orders, the order will be directly cancelled;\n\n- If it is a market order, then the system will partially execute the order. The execution limit will be the order size within the price range corresponding to the threshold value. The remaining orders will not be filled.\n\nFor example: if the threshold value is 10%, when a user places a market price purchase order in the KCS/USDT trading market for 10,000 USDT (the selling price is currently 1.20000), the system will determine that after the order is completely filled, the final price will be 1.40000. (1.40000-1.20000)/1.20000=16.7%>10%. The threshold value is 1.32000. The user’s market price purchase order will be filled only to a maximum of 1.32000. The remaining order portions will not be matched with orders in the order book. Note: this feature may not be able to determine depth with complete accuracy. If your order is not completely filled, it may be because the portion exceeding the threshold value was not filled.\n\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| clientOid | string | Client Order Id,The ClientOid field is a unique ID created by the user(we recommend using a UUID), and can only contain numbers, letters, underscores (_), and hyphens (-). This field is returned when order information is obtained. You can use clientOid to tag your orders. ClientOid is different from the order ID created by the service provider. Please do not initiate requests using the same clientOid. The maximum length for the ClientOid is 40 characters.

Please remember the orderId created by the service provider, it used to check for updates in order status. |\n| side | string | specify if the order is to 'buy' or 'sell' |\n| symbol | string | symbol |\n| type | string | specify if the order is an 'limit' order or 'market' order.

The type of order you specify when you place your order determines whether or not you need to request other parameters and also affects the execution of the matching engine.

When placing a limit order, you must specify a price and size. The system will try to match the order according to market price or a price better than market price. If the order cannot be immediately matched, it will stay in the order book until it is matched or the user cancels.

Unlike limit orders, the price for market orders fluctuates with market prices. When placing a market order, you do not need to specify a price, you only need to specify a quantity. Market orders are filled immediately and will not enter the order book. All market orders are takers and a taker fee will be charged. |\n| stp | string | [Self Trade Prevention](https://www.kucoin.com/docs-new/doc-338146) is divided into these strategies: CN, CO, CB , and DC |\n| price | string | Specify price for order

When placing a limit order, the price must be based on priceIncrement for the trading pair. The price increment (priceIncrement) is the price precision for the trading pair. For example, for the BTC-USDT trading pair, the priceIncrement is 0.00001000. So the price for your orders cannot be less than 0.00001000 and must be a multiple of priceIncrement. Otherwise, the order will return an invalid priceIncrement error. |\n| size | string | Specify quantity for order

When **type** is limit, size refers to the amount of trading targets (the asset name written in front) for the trading pair. Teh Size must be based on the baseIncrement of the trading pair. The baseIncrement represents the precision for the trading pair. The size of an order must be a positive-integer multiple of baseIncrement and must be between baseMinSize and baseMaxSize.

When **type** is market, select one out of two: size or funds |\n| timeInForce | string | [Time in force](https://www.kucoin.com/docs-new/api-5176570) is a special strategy used during trading |\n| postOnly | boolean | passive order labels, this is disabled when the order timing strategy is IOC or FOK |\n| hidden | boolean | [Hidden order](https://www.kucoin.com/docs-new/doc-338146) or not (not shown in order book) |\n| iceberg | boolean | Whether or not only visible portions of orders are shown in [Iceberg orders](https://www.kucoin.com/docs-new/doc-338146) |\n| visibleSize | string | Maximum visible quantity in iceberg orders |\n| cancelAfter | integer | Cancel after n seconds,the order timing strategy is GTT |\n| funds | string | When **type** is market, select one out of two: size or funds |\n| isIsolated | boolean | true - isolated margin ,false - cross margin. defult as false |\n| autoBorrow | boolean | When Margin Account has inefficient balance, our system autoborrows inefficient assets and opens positions according to the lowest market interest rate. |\n| autoRepay | boolean | AutoPay allows returning borrowed assets when you close a position. Our system automatically triggers the repayment and the maximum repayment amount equals to the filled-order amount. |\n\n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| orderId | string | The unique order id generated by the trading system,which can be used later for further actions such as canceling the order. |\n| loanApplyId | string | Borrowed amount. The field is returned only after placing the order under the mode of Auto-Borrow. |\n| borrowSize | number | ID of the borrowing response. The field is returned only after placing the order under the mode of Auto-Borrow. |\n| clientOid | string | The user self-defined order id. |\n\n---\n", - "body": { - "mode": "raw", - "raw": "//limit order\n{\n \"type\": \"limit\",\n \"symbol\": \"BTC-USDT\",\n \"side\": \"buy\",\n \"price\": \"50000\",\n \"size\": \"0.00001\",\n \"clientOid\": \"5c52e11203aa677f33e493fb\",\n \"remark\": \"order remarks\"\n}\n\n//market order 1\n// {\n// \"type\": \"market\",\n// \"symbol\": \"BTC-USDT\",\n// \"side\": \"buy\",\n// \"size\": \"0.00001\",\n// \"clientOid\": \"5c52e11203aa677f33e493fc\",\n// \"remark\": \"order remarks\"\n// }\n\n//market order 2\n// {\n// \"type\": \"market\",\n// \"symbol\": \"BTC-USDT\",\n// \"side\": \"buy\",\n// \"funds\": \"1\",\n// \"clientOid\": \"5c52e11203aa677f33e493fc\",\n// \"remark\": \"order remarks\"\n// }\n", - "options": { - "raw": { - "language": "json" + "query": [ + { + "key": "symbol", + "value": "BTC-USDT", + "description": "symbol" } - } - } + ] + }, + "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470203)\n\n:::info[Description]\nThis endpoint can be used to obtain information for a single Margin order using the client order id.\n\nAfter the user successfully places an order, the order is in Active state, and the user can use inOrderBook to determine whether the order has entered the order. Canceled or fully filled orders are marked as completed Done status.\n:::\n\n:::tip[Tips]\nIf the order is not an active order, you can only get data within the time range of 3 _ 24 hours (ie: from the current time to 3 _ 24 hours ago). If the time range is exceeded, the system will query the data within the time range of 3 * 24 hours by default.\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| id | string | The unique order id generated by the trading system |\n| symbol | string | symbol |\n| opType | string | |\n| type | string | Specify if the order is an 'limit' order or 'market' order. |\n| side | string | Buy or sell |\n| price | string | Order price |\n| size | string | Order size |\n| funds | string | Order Funds |\n| dealSize | string | Number of filled transactions |\n| dealFunds | string | Funds of filled transactions |\n| fee | string | [Handling fees](https://www.kucoin.com/docs-new/api-5327739) |\n| feeCurrency | string | currency used to calculate trading fee |\n| stp | string | [Self Trade Prevention](https://www.kucoin.com/docs-new/doc-338146) is divided into these strategies: CN, CO, CB , and DC |\n| stop | string | |\n| stopTriggered | boolean | |\n| stopPrice | string | |\n| timeInForce | string | Time in force |\n| postOnly | boolean | Whether its a postOnly order. |\n| hidden | boolean | Whether its a hidden order. |\n| iceberg | boolean | Whether its a iceberg order. |\n| visibleSize | string | Visible size of iceberg order in order book. |\n| cancelAfter | integer | A GTT timeInForce that expires in n seconds |\n| channel | string | |\n| clientOid | string | Client Order Id,unique identifier created by the user |\n| remark | string | Order placement remarks |\n| tags | string | Order tag |\n| cancelExist | boolean | Whether there is a cancellation record for the order. |\n| createdAt | integer | |\n| lastUpdatedAt | integer | |\n| tradeType | string | Trade type, redundancy param |\n| inOrderBook | boolean | Whether to enter the orderbook: true: enter the orderbook; false: not enter the orderbook |\n| cancelledSize | string | Number of canceled transactions |\n| cancelledFunds | string | Funds of canceled transactions |\n| remainSize | string | Number of remain transactions |\n| remainFunds | string | Funds of remain transactions |\n| tax | string | Users in some regions need query this field |\n| active | boolean | Order status: true-The status of the order isactive; false-The status of the order is done |\n\n---\n", + "body": {} }, "response": [ { "name": "Successful Response", "originalRequest": { - "method": "POST", + "method": "GET", "header": [], "url": { "raw": "", @@ -9994,10 +9987,17 @@ "v3", "hf", "margin", - "order", - "test" + "orders", + "client-order", + "{{clientOid}}" ], - "query": [] + "query": [ + { + "key": "symbol", + "value": "BTC-USDT", + "description": "symbol" + } + ] } }, "status": "OK", @@ -10030,7 +10030,7 @@ } ], "cookie": [], - "body": "{\n \"success\": true,\n \"code\": \"200000\",\n \"data\": {\n \"orderId\": \"5bd6e9286d99522a52e458de\",\n \"clientOid\": \"5c52e11203aa677f33e493fb\",\n \"borrowSize\": 10.2,\n \"loanApplyId\": \"600656d9a33ac90009de4f6f\"\n }\n}" + "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"id\": \"671667306afcdb000723107f\",\n \"symbol\": \"BTC-USDT\",\n \"opType\": \"DEAL\",\n \"type\": \"limit\",\n \"side\": \"buy\",\n \"price\": \"50000\",\n \"size\": \"0.00001\",\n \"funds\": \"0.5\",\n \"dealSize\": \"0\",\n \"dealFunds\": \"0\",\n \"fee\": \"0\",\n \"feeCurrency\": \"USDT\",\n \"stp\": null,\n \"stop\": null,\n \"stopTriggered\": false,\n \"stopPrice\": \"0\",\n \"timeInForce\": \"GTC\",\n \"postOnly\": false,\n \"hidden\": false,\n \"iceberg\": false,\n \"visibleSize\": \"0\",\n \"cancelAfter\": 0,\n \"channel\": \"API\",\n \"clientOid\": \"5c52e11203aa677f33e493fb\",\n \"remark\": null,\n \"tags\": null,\n \"cancelExist\": false,\n \"createdAt\": 1729521456248,\n \"lastUpdatedAt\": 1729651011877,\n \"tradeType\": \"MARGIN_TRADE\",\n \"inOrderBook\": true,\n \"cancelledSize\": \"0\",\n \"cancelledFunds\": \"0\",\n \"remainSize\": \"0.00001\",\n \"remainFunds\": \"0.5\",\n \"tax\": \"0\",\n \"active\": true\n }\n}" } ] } @@ -10284,6 +10284,91 @@ } ] }, + { + "name": "Repay", + "request": { + "method": "POST", + "header": [], + "url": { + "raw": "", + "protocol": "https", + "host": [ + "{{spot_endpoint}}" + ], + "path": [ + "api", + "v3", + "margin", + "repay" + ], + "query": [] + }, + "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470210)\n\n:::info[Description]\nThis API endpoint is used to initiate an application for cross or isolated margin repayment.\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| currency | string | currency |\n| size | number | Borrow amount |\n| symbol | string | symbol, mandatory for isolated margin account |\n| isIsolated | boolean | true-isolated, false-cross; default is false |\n| isHf | boolean | true: high frequency borrowing, false: low frequency borrowing; default false |\n\n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| timestamp | integer | |\n| orderNo | string | Repay Order Id |\n| actualSize | string | Actual repay amount |\n\n---\n", + "body": { + "mode": "raw", + "raw": "{\n \"currency\": \"USDT\",\n \"size\": 10\n}", + "options": { + "raw": { + "language": "json" + } + } + } + }, + "response": [ + { + "name": "Successful Response", + "originalRequest": { + "method": "POST", + "header": [], + "url": { + "raw": "", + "protocol": "https", + "host": [ + "{{spot_endpoint}}" + ], + "path": [ + "api", + "v3", + "margin", + "repay" + ], + "query": [] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json", + "name": "Content-Type", + "description": { + "content": "", + "type": "text/plain" + } + }, + { + "key": "gw-ratelimit-remaining", + "value": 1997, + "name": "gw-ratelimit-remaining" + }, + { + "key": "gw-ratelimit-limit", + "value": 2000, + "name": "gw-ratelimit-limit" + }, + { + "key": "gw-ratelimit-reset", + "value": 29990, + "name": "gw-ratelimit-reset" + } + ], + "cookie": [], + "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"timestamp\": 1729655606816,\n \"orderNo\": \"671873361d5bd400075096ad\",\n \"actualSize\": \"10\"\n }\n}" + } + ] + }, { "name": "Get Repay History", "request": { @@ -10553,94 +10638,9 @@ { "key": "pageSize", "value": null, - "description": "Number of results per page. Default is 50, minimum is 10, maximum is 500" - } - ] - } - }, - "status": "OK", - "code": 200, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "Content-Type", - "value": "application/json", - "name": "Content-Type", - "description": { - "content": "", - "type": "text/plain" - } - }, - { - "key": "gw-ratelimit-remaining", - "value": 1997, - "name": "gw-ratelimit-remaining" - }, - { - "key": "gw-ratelimit-limit", - "value": 2000, - "name": "gw-ratelimit-limit" - }, - { - "key": "gw-ratelimit-reset", - "value": 29990, - "name": "gw-ratelimit-reset" - } - ], - "cookie": [], - "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"timestamp\": 1729665170701,\n \"currentPage\": 1,\n \"pageSize\": 50,\n \"totalNum\": 3,\n \"totalPage\": 1,\n \"items\": [\n {\n \"currency\": \"USDT\",\n \"dayRatio\": \"0.000296\",\n \"interestAmount\": \"0.00000001\",\n \"createdTime\": 1729663213375\n },\n {\n \"currency\": \"USDT\",\n \"dayRatio\": \"0.000296\",\n \"interestAmount\": \"0.00000001\",\n \"createdTime\": 1729659618802\n },\n {\n \"currency\": \"USDT\",\n \"dayRatio\": \"0.000296\",\n \"interestAmount\": \"0.00000001\",\n \"createdTime\": 1729656028077\n }\n ]\n }\n}" - } - ] - }, - { - "name": "Repay", - "request": { - "method": "POST", - "header": [], - "url": { - "raw": "", - "protocol": "https", - "host": [ - "{{spot_endpoint}}" - ], - "path": [ - "api", - "v3", - "margin", - "repay" - ], - "query": [] - }, - "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470210)\n\n:::info[Description]\nThis API endpoint is used to initiate an application for cross or isolated margin repayment.\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| currency | string | currency |\n| size | number | Borrow amount |\n| symbol | string | symbol, mandatory for isolated margin account |\n| isIsolated | boolean | true-isolated, false-cross; default is false |\n| isHf | boolean | true: high frequency borrowing, false: low frequency borrowing; default false |\n\n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| timestamp | integer | |\n| orderNo | string | Repay Order Id |\n| actualSize | string | Actual repay amount |\n\n---\n", - "body": { - "mode": "raw", - "raw": "{\n \"currency\": \"USDT\",\n \"size\": 10\n}", - "options": { - "raw": { - "language": "json" - } - } - } - }, - "response": [ - { - "name": "Successful Response", - "originalRequest": { - "method": "POST", - "header": [], - "url": { - "raw": "", - "protocol": "https", - "host": [ - "{{spot_endpoint}}" - ], - "path": [ - "api", - "v3", - "margin", - "repay" - ], - "query": [] + "description": "Number of results per page. Default is 50, minimum is 10, maximum is 500" + } + ] } }, "status": "OK", @@ -10673,7 +10673,7 @@ } ], "cookie": [], - "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"timestamp\": 1729655606816,\n \"orderNo\": \"671873361d5bd400075096ad\",\n \"actualSize\": \"10\"\n }\n}" + "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"timestamp\": 1729665170701,\n \"currentPage\": 1,\n \"pageSize\": 50,\n \"totalNum\": 3,\n \"totalPage\": 1,\n \"items\": [\n {\n \"currency\": \"USDT\",\n \"dayRatio\": \"0.000296\",\n \"interestAmount\": \"0.00000001\",\n \"createdTime\": 1729663213375\n },\n {\n \"currency\": \"USDT\",\n \"dayRatio\": \"0.000296\",\n \"interestAmount\": \"0.00000001\",\n \"createdTime\": 1729659618802\n },\n {\n \"currency\": \"USDT\",\n \"dayRatio\": \"0.000296\",\n \"interestAmount\": \"0.00000001\",\n \"createdTime\": 1729656028077\n }\n ]\n }\n}" } ] }, @@ -10858,7 +10858,7 @@ ] }, { - "name": "Get Purchase Orders", + "name": "Get Loan Market Interest Rate", "request": { "method": "GET", "header": [], @@ -10871,38 +10871,18 @@ "path": [ "api", "v3", - "purchase", - "orders" + "project", + "marketInterestRate" ], "query": [ { "key": "currency", - "value": null, + "value": "USDT", "description": "currency" - }, - { - "key": "status", - "value": null, - "description": "DONE-completed; PENDING-settling" - }, - { - "key": "purchaseOrderNo", - "value": null, - "description": "" - }, - { - "key": "currentPage", - "value": null, - "description": "Current page; default is 1" - }, - { - "key": "pageSize", - "value": null, - "description": "Page size; 1<=pageSize<=100; default is 50" } ] }, - "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470213)\n\n:::info[Description]\nThis API endpoint provides pagination query for the purchase orders.\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| currentPage | integer | Current Page |\n| pageSize | integer | Page Size |\n| totalNum | integer | Total Number |\n| totalPage | integer | Total Page |\n| items | array | Refer to the schema section of items |\n\n**root.data.items Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| currency | string | Currency |\n| purchaseOrderNo | string | Purchase order id |\n| purchaseSize | string | Total purchase size |\n| matchSize | string | Executed size |\n| interestRate | string | Target annualized interest rate |\n| incomeSize | string | Redeemed amount |\n| applyTime | integer | Time of purchase |\n| status | string | Status: DONE-completed; PENDING-settling |\n\n---\n", + "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470215)\n\n:::info[Description]\nThis API endpoint is used to get the interest rates of the margin lending market over the past 7 days.\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | array | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| time | string | Time: YYYYMMDDHH00 |\n| marketInterestRate | string | Market lending rate |\n\n---\n", "body": {} }, "response": [ @@ -10920,34 +10900,14 @@ "path": [ "api", "v3", - "purchase", - "orders" + "project", + "marketInterestRate" ], "query": [ { "key": "currency", - "value": null, + "value": "USDT", "description": "currency" - }, - { - "key": "status", - "value": null, - "description": "DONE-completed; PENDING-settling" - }, - { - "key": "purchaseOrderNo", - "value": null, - "description": "" - }, - { - "key": "currentPage", - "value": null, - "description": "Current page; default is 1" - }, - { - "key": "pageSize", - "value": null, - "description": "Page size; 1<=pageSize<=100; default is 50" } ] } @@ -10982,14 +10942,14 @@ } ], "cookie": [], - "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"currentPage\": 1,\n \"pageSize\": 10,\n \"totalNum\": 1,\n \"totalPage\": 1,\n \"items\": [\n {\n \"currency\": \"BTC\",\n \"purchaseOrderNo\": \"671bb15a3b3f930007880bae\",\n \"purchaseSize\": \"0.001\",\n \"matchSize\": \"0\",\n \"interestRate\": \"0.1\",\n \"incomeSize\": \"0\",\n \"applyTime\": 1729868122172,\n \"status\": \"PENDING\"\n }\n ]\n }\n}" + "body": "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"time\": \"202410170000\",\n \"marketInterestRate\": \"0.005\"\n },\n {\n \"time\": \"202410170100\",\n \"marketInterestRate\": \"0.005\"\n }\n ]\n}" } ] }, { - "name": "Get Redeem Orders", + "name": "Purchase", "request": { - "method": "GET", + "method": "POST", "header": [], "url": { "raw": "", @@ -11000,45 +10960,26 @@ "path": [ "api", "v3", - "redeem", - "orders" + "purchase" ], - "query": [ - { - "key": "currency", - "value": null, - "description": "currency" - }, - { - "key": "status", - "value": null, - "description": "DONE-completed; PENDING-settling" - }, - { - "key": "redeemOrderNo", - "value": null, - "description": "Redeem order id" - }, - { - "key": "currentPage", - "value": null, - "description": "Current page; default is 1" - }, - { - "key": "pageSize", - "value": null, - "description": "Page size; 1<=pageSize<=100; default is 50" - } - ] + "query": [] }, - "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470214)\n\n:::info[Description]\nThis API endpoint provides pagination query for the redeem orders.\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| currentPage | integer | Current Page |\n| pageSize | integer | Page Size |\n| totalNum | integer | Total Number |\n| totalPage | integer | Total Page |\n| items | array | Refer to the schema section of items |\n\n**root.data.items Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| currency | string | Currency |\n| purchaseOrderNo | string | Purchase order id |\n| redeemOrderNo | string | Redeem order id |\n| redeemSize | string | Redemption size |\n| receiptSize | string | Redeemed size |\n| applyTime | string | Time of redeem |\n| status | string | Status: DONE-completed; PENDING-settling |\n\n---\n", - "body": {} + "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470216)\n\n:::info[Description]\nInvest credit in the market and earn interest,Please ensure that the funds are in the main(funding) account\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| currency | string | Currency |\n| size | string | purchase amount |\n| interestRate | string | purchase interest rate |\n\n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| orderNo | string | Purchase order id |\n\n---\n", + "body": { + "mode": "raw", + "raw": "{\n \"currency\": \"BTC\",\n \"size\": \"0.001\",\n \"interestRate\": \"0.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + } }, "response": [ { "name": "Successful Response", "originalRequest": { - "method": "GET", + "method": "POST", "header": [], "url": { "raw": "", @@ -11049,36 +10990,9 @@ "path": [ "api", "v3", - "redeem", - "orders" + "purchase" ], - "query": [ - { - "key": "currency", - "value": null, - "description": "currency" - }, - { - "key": "status", - "value": null, - "description": "DONE-completed; PENDING-settling" - }, - { - "key": "redeemOrderNo", - "value": null, - "description": "Redeem order id" - }, - { - "key": "currentPage", - "value": null, - "description": "Current page; default is 1" - }, - { - "key": "pageSize", - "value": null, - "description": "Page size; 1<=pageSize<=100; default is 50" - } - ] + "query": [] } }, "status": "OK", @@ -11111,14 +11025,14 @@ } ], "cookie": [], - "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"currentPage\": 1,\n \"pageSize\": 10,\n \"totalNum\": 1,\n \"totalPage\": 1,\n \"items\": [\n {\n \"currency\": \"BTC\",\n \"purchaseOrderNo\": \"671bafa804c26d000773c533\",\n \"redeemOrderNo\": \"671bb01004c26d000773c55c\",\n \"redeemSize\": \"0.001\",\n \"receiptSize\": \"0.001\",\n \"applyTime\": null,\n \"status\": \"DONE\"\n }\n ]\n }\n}" + "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"orderNo\": \"671bafa804c26d000773c533\"\n }\n}" } ] }, { - "name": "Get Loan Market Interest Rate", + "name": "Modify Purchase", "request": { - "method": "GET", + "method": "POST", "header": [], "url": { "raw": "", @@ -11129,25 +11043,28 @@ "path": [ "api", "v3", - "project", - "marketInterestRate" + "lend", + "purchase", + "update" ], - "query": [ - { - "key": "currency", - "value": "USDT", - "description": "currency" - } - ] + "query": [] }, - "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470215)\n\n:::info[Description]\nThis API endpoint is used to get the interest rates of the margin lending market over the past 7 days.\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | array | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| time | string | Time: YYYYMMDDHH00 |\n| marketInterestRate | string | Market lending rate |\n\n---\n", - "body": {} + "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470217)\n\n:::info[Description]\nThis API endpoint is used to update the interest rates of subscription orders, which will take effect at the beginning of the next hour.,Please ensure that the funds are in the main(funding) account\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| currency | string | Currency |\n| interestRate | string | Modified purchase interest rate |\n| purchaseOrderNo | string | Purchase order id |\n\n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | string | |\n\n---\n", + "body": { + "mode": "raw", + "raw": "{\n \"currency\": \"BTC\",\n \"purchaseOrderNo\": \"671bafa804c26d000773c533\",\n \"interestRate\": \"0.09\"\n}", + "options": { + "raw": { + "language": "json" + } + } + } }, "response": [ { "name": "Successful Response", "originalRequest": { - "method": "GET", + "method": "POST", "header": [], "url": { "raw": "", @@ -11158,16 +11075,11 @@ "path": [ "api", "v3", - "project", - "marketInterestRate" + "lend", + "purchase", + "update" ], - "query": [ - { - "key": "currency", - "value": "USDT", - "description": "currency" - } - ] + "query": [] } }, "status": "OK", @@ -11200,14 +11112,14 @@ } ], "cookie": [], - "body": "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"time\": \"202410170000\",\n \"marketInterestRate\": \"0.005\"\n },\n {\n \"time\": \"202410170100\",\n \"marketInterestRate\": \"0.005\"\n }\n ]\n}" + "body": "{\n \"code\": \"200000\",\n \"data\": null\n}" } ] }, { - "name": "Purchase", + "name": "Get Purchase Orders", "request": { - "method": "POST", + "method": "GET", "header": [], "url": { "raw": "", @@ -11218,26 +11130,45 @@ "path": [ "api", "v3", - "purchase" + "purchase", + "orders" ], - "query": [] - }, - "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470216)\n\n:::info[Description]\nInvest credit in the market and earn interest,Please ensure that the funds are in the main(funding) account\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| currency | string | Currency |\n| size | string | purchase amount |\n| interestRate | string | purchase interest rate |\n\n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| orderNo | string | Purchase order id |\n\n---\n", - "body": { - "mode": "raw", - "raw": "{\n \"currency\": \"BTC\",\n \"size\": \"0.001\",\n \"interestRate\": \"0.1\"\n}", - "options": { - "raw": { - "language": "json" + "query": [ + { + "key": "currency", + "value": null, + "description": "currency" + }, + { + "key": "status", + "value": null, + "description": "DONE-completed; PENDING-settling" + }, + { + "key": "purchaseOrderNo", + "value": null, + "description": "" + }, + { + "key": "currentPage", + "value": null, + "description": "Current page; default is 1" + }, + { + "key": "pageSize", + "value": null, + "description": "Page size; 1<=pageSize<=100; default is 50" } - } - } + ] + }, + "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470213)\n\n:::info[Description]\nThis API endpoint provides pagination query for the purchase orders.\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| currentPage | integer | Current Page |\n| pageSize | integer | Page Size |\n| totalNum | integer | Total Number |\n| totalPage | integer | Total Page |\n| items | array | Refer to the schema section of items |\n\n**root.data.items Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| currency | string | Currency |\n| purchaseOrderNo | string | Purchase order id |\n| purchaseSize | string | Total purchase size |\n| matchSize | string | Executed size |\n| interestRate | string | Target annualized interest rate |\n| incomeSize | string | Redeemed amount |\n| applyTime | integer | Time of purchase |\n| status | string | Status: DONE-completed; PENDING-settling |\n\n---\n", + "body": {} }, "response": [ { "name": "Successful Response", "originalRequest": { - "method": "POST", + "method": "GET", "header": [], "url": { "raw": "", @@ -11248,9 +11179,36 @@ "path": [ "api", "v3", - "purchase" + "purchase", + "orders" ], - "query": [] + "query": [ + { + "key": "currency", + "value": null, + "description": "currency" + }, + { + "key": "status", + "value": null, + "description": "DONE-completed; PENDING-settling" + }, + { + "key": "purchaseOrderNo", + "value": null, + "description": "" + }, + { + "key": "currentPage", + "value": null, + "description": "Current page; default is 1" + }, + { + "key": "pageSize", + "value": null, + "description": "Page size; 1<=pageSize<=100; default is 50" + } + ] } }, "status": "OK", @@ -11283,12 +11241,12 @@ } ], "cookie": [], - "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"orderNo\": \"671bafa804c26d000773c533\"\n }\n}" + "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"currentPage\": 1,\n \"pageSize\": 10,\n \"totalNum\": 1,\n \"totalPage\": 1,\n \"items\": [\n {\n \"currency\": \"BTC\",\n \"purchaseOrderNo\": \"671bb15a3b3f930007880bae\",\n \"purchaseSize\": \"0.001\",\n \"matchSize\": \"0\",\n \"interestRate\": \"0.1\",\n \"incomeSize\": \"0\",\n \"applyTime\": 1729868122172,\n \"status\": \"PENDING\"\n }\n ]\n }\n}" } ] }, { - "name": "Modify Purchase", + "name": "Redeem", "request": { "method": "POST", "header": [], @@ -11301,16 +11259,14 @@ "path": [ "api", "v3", - "lend", - "purchase", - "update" + "redeem" ], "query": [] }, - "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470217)\n\n:::info[Description]\nThis API endpoint is used to update the interest rates of subscription orders, which will take effect at the beginning of the next hour.,Please ensure that the funds are in the main(funding) account\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| currency | string | Currency |\n| interestRate | string | Modified purchase interest rate |\n| purchaseOrderNo | string | Purchase order id |\n\n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | string | |\n\n---\n", + "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470218)\n\n:::info[Description]\nRedeem your loan order\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| currency | string | Currency |\n| size | string | Redemption amount |\n| purchaseOrderNo | string | Purchase order id |\n\n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| orderNo | string | Redeem order id |\n\n---\n", "body": { "mode": "raw", - "raw": "{\n \"currency\": \"BTC\",\n \"purchaseOrderNo\": \"671bafa804c26d000773c533\",\n \"interestRate\": \"0.09\"\n}", + "raw": "{\n \"currency\": \"BTC\",\n \"size\": \"0.001\",\n \"purchaseOrderNo\": \"671bafa804c26d000773c533\"\n}", "options": { "raw": { "language": "json" @@ -11333,9 +11289,7 @@ "path": [ "api", "v3", - "lend", - "purchase", - "update" + "redeem" ], "query": [] } @@ -11370,14 +11324,14 @@ } ], "cookie": [], - "body": "{\n \"code\": \"200000\",\n \"data\": null\n}" + "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"orderNo\": \"671bafa804c26d000773c533\"\n }\n}" } ] }, { - "name": "Redeem", + "name": "Get Redeem Orders", "request": { - "method": "POST", + "method": "GET", "header": [], "url": { "raw": "", @@ -11388,26 +11342,45 @@ "path": [ "api", "v3", - "redeem" + "redeem", + "orders" ], - "query": [] - }, - "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470218)\n\n:::info[Description]\nRedeem your loan order\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| currency | string | Currency |\n| size | string | Redemption amount |\n| purchaseOrderNo | string | Purchase order id |\n\n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| orderNo | string | Redeem order id |\n\n---\n", - "body": { - "mode": "raw", - "raw": "{\n \"currency\": \"BTC\",\n \"size\": \"0.001\",\n \"purchaseOrderNo\": \"671bafa804c26d000773c533\"\n}", - "options": { - "raw": { - "language": "json" + "query": [ + { + "key": "currency", + "value": null, + "description": "currency" + }, + { + "key": "status", + "value": null, + "description": "DONE-completed; PENDING-settling" + }, + { + "key": "redeemOrderNo", + "value": null, + "description": "Redeem order id" + }, + { + "key": "currentPage", + "value": null, + "description": "Current page; default is 1" + }, + { + "key": "pageSize", + "value": null, + "description": "Page size; 1<=pageSize<=100; default is 50" } - } - } + ] + }, + "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470214)\n\n:::info[Description]\nThis API endpoint provides pagination query for the redeem orders.\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| currentPage | integer | Current Page |\n| pageSize | integer | Page Size |\n| totalNum | integer | Total Number |\n| totalPage | integer | Total Page |\n| items | array | Refer to the schema section of items |\n\n**root.data.items Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| currency | string | Currency |\n| purchaseOrderNo | string | Purchase order id |\n| redeemOrderNo | string | Redeem order id |\n| redeemSize | string | Redemption size |\n| receiptSize | string | Redeemed size |\n| applyTime | string | Time of redeem |\n| status | string | Status: DONE-completed; PENDING-settling |\n\n---\n", + "body": {} }, "response": [ { "name": "Successful Response", "originalRequest": { - "method": "POST", + "method": "GET", "header": [], "url": { "raw": "", @@ -11418,9 +11391,36 @@ "path": [ "api", "v3", - "redeem" + "redeem", + "orders" ], - "query": [] + "query": [ + { + "key": "currency", + "value": null, + "description": "currency" + }, + { + "key": "status", + "value": null, + "description": "DONE-completed; PENDING-settling" + }, + { + "key": "redeemOrderNo", + "value": null, + "description": "Redeem order id" + }, + { + "key": "currentPage", + "value": null, + "description": "Current page; default is 1" + }, + { + "key": "pageSize", + "value": null, + "description": "Page size; 1<=pageSize<=100; default is 50" + } + ] } }, "status": "OK", @@ -11453,7 +11453,7 @@ } ], "cookie": [], - "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"orderNo\": \"671bafa804c26d000773c533\"\n }\n}" + "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"currentPage\": 1,\n \"pageSize\": 10,\n \"totalNum\": 1,\n \"totalPage\": 1,\n \"items\": [\n {\n \"currency\": \"BTC\",\n \"purchaseOrderNo\": \"671bafa804c26d000773c533\",\n \"redeemOrderNo\": \"671bb01004c26d000773c55c\",\n \"redeemSize\": \"0.001\",\n \"receiptSize\": \"0.001\",\n \"applyTime\": null,\n \"status\": \"DONE\"\n }\n ]\n }\n}" } ] } @@ -11585,7 +11585,7 @@ "name": "Market Data", "item": [ { - "name": "Get All Symbols", + "name": "Get Symbol", "request": { "method": "GET", "header": [], @@ -11599,11 +11599,11 @@ "api", "v1", "contracts", - "active" + "{{symbol}}" ], "query": [] }, - "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470220)\n\n:::info[Description]\nGet detailed information of all contracts that can be traded. This API will return a list of tradable contracts, including some key parameters of the contract such as the symbol name, tick size, mark price,etc.\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | 200000 is for success, other is error |\n| data | array | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| symbol | string | Symbol |\n| rootSymbol | string | Contract group |\n| type | string | Type of the contract |\n| firstOpenDate | integer | First Open Date(millisecond) |\n| expireDate | integer | Expiration date(millisecond). Null means it will never expire |\n| settleDate | integer | Settlement date(millisecond). Null indicates that automatic settlement is not supported |\n| baseCurrency | string | Base currency |\n| quoteCurrency | string | Quote currency |\n| settleCurrency | string | Currency used to clear and settle the trades |\n| maxOrderQty | integer | Maximum order quantity |\n| maxPrice | number | Maximum order price |\n| lotSize | integer | Minimum lot size |\n| tickSize | number | Minimum price changes |\n| indexPriceTickSize | number | Index price of tick size |\n| multiplier | number | The basic unit of the contract API is lots. For the number of coins in each lot, please refer to the param multiplier. For example, for XBTUSDTM, multiplier=0.001, which corresponds to the value of each XBTUSDTM contract being 0.001 BTC. There is also a special case. All coin-swap contracts, such as each XBTUSDM contract, correspond to 1 USD. |\n| initialMargin | number | Initial margin requirement |\n| maintainMargin | number | Maintenance margin requirement |\n| maxRiskLimit | integer | Maximum risk limit (unit: XBT) |\n| minRiskLimit | integer | Minimum risk limit (unit: XBT) |\n| riskStep | integer | Risk limit increment value (unit: XBT) |\n| makerFeeRate | number | Maker fee rate |\n| takerFeeRate | number | Taker fee rate |\n| takerFixFee | number | Deprecated param |\n| makerFixFee | number | Deprecated param |\n| settlementFee | number | Settlement fee |\n| isDeleverage | boolean | Enabled ADL or not |\n| isQuanto | boolean | Deprecated param |\n| isInverse | boolean | Whether it is a reverse contract |\n| markMethod | string | Marking method |\n| fairMethod | string | Fair price marking method, The Futures contract is null |\n| fundingBaseSymbol | string | Ticker symbol of the based currency |\n| fundingQuoteSymbol | string | Ticker symbol of the quote currency |\n| fundingRateSymbol | string | Funding rate symbol |\n| indexSymbol | string | Index symbol |\n| settlementSymbol | string | Settlement Symbol |\n| status | string | Contract status |\n| fundingFeeRate | number | Funding fee rate |\n| predictedFundingFeeRate | number | Predicted funding fee rate |\n| fundingRateGranularity | integer | Funding interval(millisecond) |\n| openInterest | string | Open interest |\n| turnoverOf24h | number | 24-hour turnover |\n| volumeOf24h | number | 24-hour volume |\n| markPrice | number | Mark price |\n| indexPrice | number | Index price |\n| lastTradePrice | number | Last trade price |\n| nextFundingRateTime | integer | Next funding rate time(millisecond) |\n| maxLeverage | integer | Maximum leverage |\n| sourceExchanges | array | Refer to the schema section of sourceExchanges |\n| premiumsSymbol1M | string | Premium index symbol(1 minute) |\n| premiumsSymbol8H | string | Premium index symbol(8 hours) |\n| fundingBaseSymbol1M | string | Base currency interest rate symbol(1 minute) |\n| fundingQuoteSymbol1M | string | Quote currency interest rate symbol(1 minute) |\n| lowPrice | number | 24-hour lowest price |\n| highPrice | number | 24-hour highest price |\n| priceChgPct | number | 24-hour price change% |\n| priceChg | number | 24-hour price change |\n| k | number | |\n| m | number | |\n| f | number | |\n| mmrLimit | number | |\n| mmrLevConstant | number | |\n| supportCross | boolean | Whether support Cross Margin |\n\n---\n", + "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470221)\n\n:::info[Description]\nGet information of specified contracts that can be traded. This API will return a list of tradable contracts, including some key parameters of the contract such as the symbol name, tick size, mark price,etc.\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | 200000 is for success, other is error |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| symbol | string | Symbol |\n| rootSymbol | string | Contract group |\n| type | string | Type of the contract |\n| firstOpenDate | integer | First Open Date(millisecond) |\n| expireDate | integer | Expiration date(millisecond). Null means it will never expire |\n| settleDate | integer | Settlement date(millisecond). Null indicates that automatic settlement is not supported |\n| baseCurrency | string | Base currency |\n| quoteCurrency | string | Quote currency |\n| settleCurrency | string | Currency used to clear and settle the trades |\n| maxOrderQty | integer | Maximum order quantity |\n| maxPrice | number | Maximum order price |\n| lotSize | integer | Minimum lot size |\n| tickSize | number | Minimum price changes |\n| indexPriceTickSize | number | Index price of tick size |\n| multiplier | number | The basic unit of the contract API is lots. For the number of coins in each lot, please refer to the param multiplier. For example, for XBTUSDTM, multiplier=0.001, which corresponds to the value of each XBTUSDTM contract being 0.001 BTC. There is also a special case. All coin-swap contracts, such as each XBTUSDM contract, correspond to 1 USD. |\n| initialMargin | number | Initial margin requirement |\n| maintainMargin | number | Maintenance margin requirement |\n| maxRiskLimit | integer | Maximum risk limit (unit: XBT) |\n| minRiskLimit | integer | Minimum risk limit (unit: XBT) |\n| riskStep | integer | Risk limit increment value (unit: XBT) |\n| makerFeeRate | number | Maker fee rate |\n| takerFeeRate | number | Taker fee rate |\n| takerFixFee | number | Deprecated param |\n| makerFixFee | number | Deprecated param |\n| settlementFee | number | Settlement fee |\n| isDeleverage | boolean | Enabled ADL or not |\n| isQuanto | boolean | Deprecated param |\n| isInverse | boolean | Whether it is a reverse contract |\n| markMethod | string | Marking method |\n| fairMethod | string | Fair price marking method, The Futures contract is null |\n| fundingBaseSymbol | string | Ticker symbol of the based currency |\n| fundingQuoteSymbol | string | Ticker symbol of the quote currency |\n| fundingRateSymbol | string | Funding rate symbol |\n| indexSymbol | string | Index symbol |\n| settlementSymbol | string | Settlement Symbol |\n| status | string | Contract status |\n| fundingFeeRate | number | Funding fee rate |\n| predictedFundingFeeRate | number | Predicted funding fee rate |\n| fundingRateGranularity | integer | Funding interval(millisecond) |\n| openInterest | string | Open interest |\n| turnoverOf24h | number | 24-hour turnover |\n| volumeOf24h | number | 24-hour volume |\n| markPrice | number | Mark price |\n| indexPrice | number | Index price |\n| lastTradePrice | number | Last trade price |\n| nextFundingRateTime | integer | Next funding rate time(millisecond) |\n| maxLeverage | integer | Maximum leverage |\n| sourceExchanges | array | Refer to the schema section of sourceExchanges |\n| premiumsSymbol1M | string | Premium index symbol(1 minute) |\n| premiumsSymbol8H | string | Premium index symbol(8 hours) |\n| fundingBaseSymbol1M | string | Base currency interest rate symbol(1 minute) |\n| fundingQuoteSymbol1M | string | Quote currency interest rate symbol(1 minute) |\n| lowPrice | number | 24-hour lowest price |\n| highPrice | number | 24-hour highest price |\n| priceChgPct | number | 24-hour price change% |\n| priceChg | number | 24-hour price change |\n| k | number | |\n| m | number | |\n| f | number | |\n| mmrLimit | number | |\n| mmrLevConstant | number | |\n| supportCross | boolean | Whether support Cross Margin |\n\n---\n", "body": {} }, "response": [ @@ -11622,7 +11622,7 @@ "api", "v1", "contracts", - "active" + "{{symbol}}" ], "query": [] } @@ -11657,12 +11657,12 @@ } ], "cookie": [], - "body": "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"symbol\": \"XBTUSDTM\",\n \"rootSymbol\": \"USDT\",\n \"type\": \"FFWCSX\",\n \"firstOpenDate\": 1585555200000,\n \"expireDate\": null,\n \"settleDate\": null,\n \"baseCurrency\": \"XBT\",\n \"quoteCurrency\": \"USDT\",\n \"settleCurrency\": \"USDT\",\n \"maxOrderQty\": 1000000,\n \"maxPrice\": 1000000.0,\n \"lotSize\": 1,\n \"tickSize\": 0.1,\n \"indexPriceTickSize\": 0.01,\n \"multiplier\": 0.001,\n \"initialMargin\": 0.008,\n \"maintainMargin\": 0.004,\n \"maxRiskLimit\": 100000,\n \"minRiskLimit\": 100000,\n \"riskStep\": 50000,\n \"makerFeeRate\": 0.0002,\n \"takerFeeRate\": 0.0006,\n \"takerFixFee\": 0.0,\n \"makerFixFee\": 0.0,\n \"settlementFee\": null,\n \"isDeleverage\": true,\n \"isQuanto\": true,\n \"isInverse\": false,\n \"markMethod\": \"FairPrice\",\n \"fairMethod\": \"FundingRate\",\n \"fundingBaseSymbol\": \".XBTINT8H\",\n \"fundingQuoteSymbol\": \".USDTINT8H\",\n \"fundingRateSymbol\": \".XBTUSDTMFPI8H\",\n \"indexSymbol\": \".KXBTUSDT\",\n \"settlementSymbol\": \"\",\n \"status\": \"Open\",\n \"fundingFeeRate\": 0.000153,\n \"predictedFundingFeeRate\": 8e-05,\n \"fundingRateGranularity\": 28800000,\n \"openInterest\": \"6384957\",\n \"turnoverOf24h\": 578840222.0999069,\n \"volumeOf24h\": 8274.432,\n \"markPrice\": 69732.33,\n \"indexPrice\": 69732.32,\n \"lastTradePrice\": 69732,\n \"nextFundingRateTime\": 21265941,\n \"maxLeverage\": 125,\n \"sourceExchanges\": [\n \"okex\",\n \"binance\",\n \"kucoin\",\n \"bybit\",\n \"bitmart\",\n \"gateio\"\n ],\n \"premiumsSymbol1M\": \".XBTUSDTMPI\",\n \"premiumsSymbol8H\": \".XBTUSDTMPI8H\",\n \"fundingBaseSymbol1M\": \".XBTINT\",\n \"fundingQuoteSymbol1M\": \".USDTINT\",\n \"lowPrice\": 68817.5,\n \"highPrice\": 71615.8,\n \"priceChgPct\": 0.0006,\n \"priceChg\": 48.0,\n \"k\": 490.0,\n \"m\": 300.0,\n \"f\": 1.3,\n \"mmrLimit\": 0.3,\n \"mmrLevConstant\": 125.0,\n \"supportCross\": true\n }\n ]\n}" + "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"symbol\": \"XBTUSDM\",\n \"rootSymbol\": \"XBT\",\n \"type\": \"FFWCSX\",\n \"firstOpenDate\": 1552638575000,\n \"expireDate\": null,\n \"settleDate\": null,\n \"baseCurrency\": \"XBT\",\n \"quoteCurrency\": \"USD\",\n \"settleCurrency\": \"XBT\",\n \"maxOrderQty\": 10000000,\n \"maxPrice\": 1000000.0,\n \"lotSize\": 1,\n \"tickSize\": 0.1,\n \"indexPriceTickSize\": 0.1,\n \"multiplier\": -1.0,\n \"initialMargin\": 0.014,\n \"maintainMargin\": 0.007,\n \"maxRiskLimit\": 1,\n \"minRiskLimit\": 1,\n \"riskStep\": 0,\n \"makerFeeRate\": 0.0002,\n \"takerFeeRate\": 0.0006,\n \"takerFixFee\": 0.0,\n \"makerFixFee\": 0.0,\n \"settlementFee\": null,\n \"isDeleverage\": true,\n \"isQuanto\": false,\n \"isInverse\": true,\n \"markMethod\": \"FairPrice\",\n \"fairMethod\": \"FundingRate\",\n \"fundingBaseSymbol\": \".XBTINT8H\",\n \"fundingQuoteSymbol\": \".USDINT8H\",\n \"fundingRateSymbol\": \".XBTUSDMFPI8H\",\n \"indexSymbol\": \".BXBT\",\n \"settlementSymbol\": null,\n \"status\": \"Open\",\n \"fundingFeeRate\": 0.000175,\n \"predictedFundingFeeRate\": 0.000176,\n \"fundingRateGranularity\": 28800000,\n \"openInterest\": \"61725904\",\n \"turnoverOf24h\": 209.56303473,\n \"volumeOf24h\": 14354731.0,\n \"markPrice\": 68336.7,\n \"indexPrice\": 68335.29,\n \"lastTradePrice\": 68349.3,\n \"nextFundingRateTime\": 17402942,\n \"maxLeverage\": 75,\n \"sourceExchanges\": [\n \"kraken\",\n \"bitstamp\",\n \"crypto\"\n ],\n \"premiumsSymbol1M\": \".XBTUSDMPI\",\n \"premiumsSymbol8H\": \".XBTUSDMPI8H\",\n \"fundingBaseSymbol1M\": \".XBTINT\",\n \"fundingQuoteSymbol1M\": \".USDINT\",\n \"lowPrice\": 67436.7,\n \"highPrice\": 69471.8,\n \"priceChgPct\": 0.0097,\n \"priceChg\": 658.7,\n \"k\": 2645000.0,\n \"m\": 1640000.0,\n \"f\": 1.3,\n \"mmrLimit\": 0.3,\n \"mmrLevConstant\": 75.0,\n \"supportCross\": true\n }\n}" } ] }, { - "name": "Get Symbol", + "name": "Get All Symbols", "request": { "method": "GET", "header": [], @@ -11676,11 +11676,11 @@ "api", "v1", "contracts", - "{{symbol}}" + "active" ], "query": [] }, - "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470221)\n\n:::info[Description]\nGet information of specified contracts that can be traded. This API will return a list of tradable contracts, including some key parameters of the contract such as the symbol name, tick size, mark price,etc.\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | 200000 is for success, other is error |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| symbol | string | Symbol |\n| rootSymbol | string | Contract group |\n| type | string | Type of the contract |\n| firstOpenDate | integer | First Open Date(millisecond) |\n| expireDate | integer | Expiration date(millisecond). Null means it will never expire |\n| settleDate | integer | Settlement date(millisecond). Null indicates that automatic settlement is not supported |\n| baseCurrency | string | Base currency |\n| quoteCurrency | string | Quote currency |\n| settleCurrency | string | Currency used to clear and settle the trades |\n| maxOrderQty | integer | Maximum order quantity |\n| maxPrice | number | Maximum order price |\n| lotSize | integer | Minimum lot size |\n| tickSize | number | Minimum price changes |\n| indexPriceTickSize | number | Index price of tick size |\n| multiplier | number | The basic unit of the contract API is lots. For the number of coins in each lot, please refer to the param multiplier. For example, for XBTUSDTM, multiplier=0.001, which corresponds to the value of each XBTUSDTM contract being 0.001 BTC. There is also a special case. All coin-swap contracts, such as each XBTUSDM contract, correspond to 1 USD. |\n| initialMargin | number | Initial margin requirement |\n| maintainMargin | number | Maintenance margin requirement |\n| maxRiskLimit | integer | Maximum risk limit (unit: XBT) |\n| minRiskLimit | integer | Minimum risk limit (unit: XBT) |\n| riskStep | integer | Risk limit increment value (unit: XBT) |\n| makerFeeRate | number | Maker fee rate |\n| takerFeeRate | number | Taker fee rate |\n| takerFixFee | number | Deprecated param |\n| makerFixFee | number | Deprecated param |\n| settlementFee | number | Settlement fee |\n| isDeleverage | boolean | Enabled ADL or not |\n| isQuanto | boolean | Deprecated param |\n| isInverse | boolean | Whether it is a reverse contract |\n| markMethod | string | Marking method |\n| fairMethod | string | Fair price marking method, The Futures contract is null |\n| fundingBaseSymbol | string | Ticker symbol of the based currency |\n| fundingQuoteSymbol | string | Ticker symbol of the quote currency |\n| fundingRateSymbol | string | Funding rate symbol |\n| indexSymbol | string | Index symbol |\n| settlementSymbol | string | Settlement Symbol |\n| status | string | Contract status |\n| fundingFeeRate | number | Funding fee rate |\n| predictedFundingFeeRate | number | Predicted funding fee rate |\n| fundingRateGranularity | integer | Funding interval(millisecond) |\n| openInterest | string | Open interest |\n| turnoverOf24h | number | 24-hour turnover |\n| volumeOf24h | number | 24-hour volume |\n| markPrice | number | Mark price |\n| indexPrice | number | Index price |\n| lastTradePrice | number | Last trade price |\n| nextFundingRateTime | integer | Next funding rate time(millisecond) |\n| maxLeverage | integer | Maximum leverage |\n| sourceExchanges | array | Refer to the schema section of sourceExchanges |\n| premiumsSymbol1M | string | Premium index symbol(1 minute) |\n| premiumsSymbol8H | string | Premium index symbol(8 hours) |\n| fundingBaseSymbol1M | string | Base currency interest rate symbol(1 minute) |\n| fundingQuoteSymbol1M | string | Quote currency interest rate symbol(1 minute) |\n| lowPrice | number | 24-hour lowest price |\n| highPrice | number | 24-hour highest price |\n| priceChgPct | number | 24-hour price change% |\n| priceChg | number | 24-hour price change |\n| k | number | |\n| m | number | |\n| f | number | |\n| mmrLimit | number | |\n| mmrLevConstant | number | |\n| supportCross | boolean | Whether support Cross Margin |\n\n---\n", + "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470220)\n\n:::info[Description]\nGet detailed information of all contracts that can be traded. This API will return a list of tradable contracts, including some key parameters of the contract such as the symbol name, tick size, mark price,etc.\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | 200000 is for success, other is error |\n| data | array | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| symbol | string | Symbol |\n| rootSymbol | string | Contract group |\n| type | string | Type of the contract |\n| firstOpenDate | integer | First Open Date(millisecond) |\n| expireDate | integer | Expiration date(millisecond). Null means it will never expire |\n| settleDate | integer | Settlement date(millisecond). Null indicates that automatic settlement is not supported |\n| baseCurrency | string | Base currency |\n| quoteCurrency | string | Quote currency |\n| settleCurrency | string | Currency used to clear and settle the trades |\n| maxOrderQty | integer | Maximum order quantity |\n| maxPrice | number | Maximum order price |\n| lotSize | integer | Minimum lot size |\n| tickSize | number | Minimum price changes |\n| indexPriceTickSize | number | Index price of tick size |\n| multiplier | number | The basic unit of the contract API is lots. For the number of coins in each lot, please refer to the param multiplier. For example, for XBTUSDTM, multiplier=0.001, which corresponds to the value of each XBTUSDTM contract being 0.001 BTC. There is also a special case. All coin-swap contracts, such as each XBTUSDM contract, correspond to 1 USD. |\n| initialMargin | number | Initial margin requirement |\n| maintainMargin | number | Maintenance margin requirement |\n| maxRiskLimit | integer | Maximum risk limit (unit: XBT) |\n| minRiskLimit | integer | Minimum risk limit (unit: XBT) |\n| riskStep | integer | Risk limit increment value (unit: XBT) |\n| makerFeeRate | number | Maker fee rate |\n| takerFeeRate | number | Taker fee rate |\n| takerFixFee | number | Deprecated param |\n| makerFixFee | number | Deprecated param |\n| settlementFee | number | Settlement fee |\n| isDeleverage | boolean | Enabled ADL or not |\n| isQuanto | boolean | Deprecated param |\n| isInverse | boolean | Whether it is a reverse contract |\n| markMethod | string | Marking method |\n| fairMethod | string | Fair price marking method, The Futures contract is null |\n| fundingBaseSymbol | string | Ticker symbol of the based currency |\n| fundingQuoteSymbol | string | Ticker symbol of the quote currency |\n| fundingRateSymbol | string | Funding rate symbol |\n| indexSymbol | string | Index symbol |\n| settlementSymbol | string | Settlement Symbol |\n| status | string | Contract status |\n| fundingFeeRate | number | Funding fee rate |\n| predictedFundingFeeRate | number | Predicted funding fee rate |\n| fundingRateGranularity | integer | Funding interval(millisecond) |\n| openInterest | string | Open interest |\n| turnoverOf24h | number | 24-hour turnover |\n| volumeOf24h | number | 24-hour volume |\n| markPrice | number | Mark price |\n| indexPrice | number | Index price |\n| lastTradePrice | number | Last trade price |\n| nextFundingRateTime | integer | Next funding rate time(millisecond) |\n| maxLeverage | integer | Maximum leverage |\n| sourceExchanges | array | Refer to the schema section of sourceExchanges |\n| premiumsSymbol1M | string | Premium index symbol(1 minute) |\n| premiumsSymbol8H | string | Premium index symbol(8 hours) |\n| fundingBaseSymbol1M | string | Base currency interest rate symbol(1 minute) |\n| fundingQuoteSymbol1M | string | Quote currency interest rate symbol(1 minute) |\n| lowPrice | number | 24-hour lowest price |\n| highPrice | number | 24-hour highest price |\n| priceChgPct | number | 24-hour price change% |\n| priceChg | number | 24-hour price change |\n| k | number | |\n| m | number | |\n| f | number | |\n| mmrLimit | number | |\n| mmrLevConstant | number | |\n| supportCross | boolean | Whether support Cross Margin |\n\n---\n", "body": {} }, "response": [ @@ -11699,7 +11699,7 @@ "api", "v1", "contracts", - "{{symbol}}" + "active" ], "query": [] } @@ -11734,7 +11734,7 @@ } ], "cookie": [], - "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"symbol\": \"XBTUSDM\",\n \"rootSymbol\": \"XBT\",\n \"type\": \"FFWCSX\",\n \"firstOpenDate\": 1552638575000,\n \"expireDate\": null,\n \"settleDate\": null,\n \"baseCurrency\": \"XBT\",\n \"quoteCurrency\": \"USD\",\n \"settleCurrency\": \"XBT\",\n \"maxOrderQty\": 10000000,\n \"maxPrice\": 1000000.0,\n \"lotSize\": 1,\n \"tickSize\": 0.1,\n \"indexPriceTickSize\": 0.1,\n \"multiplier\": -1.0,\n \"initialMargin\": 0.014,\n \"maintainMargin\": 0.007,\n \"maxRiskLimit\": 1,\n \"minRiskLimit\": 1,\n \"riskStep\": 0,\n \"makerFeeRate\": 0.0002,\n \"takerFeeRate\": 0.0006,\n \"takerFixFee\": 0.0,\n \"makerFixFee\": 0.0,\n \"settlementFee\": null,\n \"isDeleverage\": true,\n \"isQuanto\": false,\n \"isInverse\": true,\n \"markMethod\": \"FairPrice\",\n \"fairMethod\": \"FundingRate\",\n \"fundingBaseSymbol\": \".XBTINT8H\",\n \"fundingQuoteSymbol\": \".USDINT8H\",\n \"fundingRateSymbol\": \".XBTUSDMFPI8H\",\n \"indexSymbol\": \".BXBT\",\n \"settlementSymbol\": null,\n \"status\": \"Open\",\n \"fundingFeeRate\": 0.000175,\n \"predictedFundingFeeRate\": 0.000176,\n \"fundingRateGranularity\": 28800000,\n \"openInterest\": \"61725904\",\n \"turnoverOf24h\": 209.56303473,\n \"volumeOf24h\": 14354731.0,\n \"markPrice\": 68336.7,\n \"indexPrice\": 68335.29,\n \"lastTradePrice\": 68349.3,\n \"nextFundingRateTime\": 17402942,\n \"maxLeverage\": 75,\n \"sourceExchanges\": [\n \"kraken\",\n \"bitstamp\",\n \"crypto\"\n ],\n \"premiumsSymbol1M\": \".XBTUSDMPI\",\n \"premiumsSymbol8H\": \".XBTUSDMPI8H\",\n \"fundingBaseSymbol1M\": \".XBTINT\",\n \"fundingQuoteSymbol1M\": \".USDINT\",\n \"lowPrice\": 67436.7,\n \"highPrice\": 69471.8,\n \"priceChgPct\": 0.0097,\n \"priceChg\": 658.7,\n \"k\": 2645000.0,\n \"m\": 1640000.0,\n \"f\": 1.3,\n \"mmrLimit\": 0.3,\n \"mmrLevConstant\": 75.0,\n \"supportCross\": true\n }\n}" + "body": "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"symbol\": \"XBTUSDTM\",\n \"rootSymbol\": \"USDT\",\n \"type\": \"FFWCSX\",\n \"firstOpenDate\": 1585555200000,\n \"expireDate\": null,\n \"settleDate\": null,\n \"baseCurrency\": \"XBT\",\n \"quoteCurrency\": \"USDT\",\n \"settleCurrency\": \"USDT\",\n \"maxOrderQty\": 1000000,\n \"maxPrice\": 1000000.0,\n \"lotSize\": 1,\n \"tickSize\": 0.1,\n \"indexPriceTickSize\": 0.01,\n \"multiplier\": 0.001,\n \"initialMargin\": 0.008,\n \"maintainMargin\": 0.004,\n \"maxRiskLimit\": 100000,\n \"minRiskLimit\": 100000,\n \"riskStep\": 50000,\n \"makerFeeRate\": 0.0002,\n \"takerFeeRate\": 0.0006,\n \"takerFixFee\": 0.0,\n \"makerFixFee\": 0.0,\n \"settlementFee\": null,\n \"isDeleverage\": true,\n \"isQuanto\": true,\n \"isInverse\": false,\n \"markMethod\": \"FairPrice\",\n \"fairMethod\": \"FundingRate\",\n \"fundingBaseSymbol\": \".XBTINT8H\",\n \"fundingQuoteSymbol\": \".USDTINT8H\",\n \"fundingRateSymbol\": \".XBTUSDTMFPI8H\",\n \"indexSymbol\": \".KXBTUSDT\",\n \"settlementSymbol\": \"\",\n \"status\": \"Open\",\n \"fundingFeeRate\": 0.000153,\n \"predictedFundingFeeRate\": 8e-05,\n \"fundingRateGranularity\": 28800000,\n \"openInterest\": \"6384957\",\n \"turnoverOf24h\": 578840222.0999069,\n \"volumeOf24h\": 8274.432,\n \"markPrice\": 69732.33,\n \"indexPrice\": 69732.32,\n \"lastTradePrice\": 69732,\n \"nextFundingRateTime\": 21265941,\n \"maxLeverage\": 125,\n \"sourceExchanges\": [\n \"okex\",\n \"binance\",\n \"kucoin\",\n \"bybit\",\n \"bitmart\",\n \"gateio\"\n ],\n \"premiumsSymbol1M\": \".XBTUSDTMPI\",\n \"premiumsSymbol8H\": \".XBTUSDTMPI8H\",\n \"fundingBaseSymbol1M\": \".XBTINT\",\n \"fundingQuoteSymbol1M\": \".USDTINT\",\n \"lowPrice\": 68817.5,\n \"highPrice\": 71615.8,\n \"priceChgPct\": 0.0006,\n \"priceChg\": 48.0,\n \"k\": 490.0,\n \"m\": 300.0,\n \"f\": 1.3,\n \"mmrLimit\": 0.3,\n \"mmrLevConstant\": 125.0,\n \"supportCross\": true\n }\n ]\n}" } ] }, @@ -12009,131 +12009,12 @@ "query": [ { "key": "symbol", - "value": "XBTUSDM", - "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) " - } - ] - }, - "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470225)\n\n:::info[Discription]\nQuery for part orderbook depth data. (aggregated by price)\n\nYou are recommended to request via this endpoint as the system reponse would be faster and cosume less traffic.\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| sequence | integer | Sequence number |\n| symbol | string | Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) |\n| bids | array | Refer to the schema section of bids |\n| asks | array | Refer to the schema section of asks |\n| ts | integer | Timestamp(nanosecond) |\n\n---\n", - "body": {} - }, - "response": [ - { - "name": "Successful Response", - "originalRequest": { - "method": "GET", - "header": [], - "url": { - "raw": "", - "protocol": "https", - "host": [ - "{{futures_endpoint}}" - ], - "path": [ - "api", - "v1", - "level2", - "depth{size}" - ], - "query": [ - { - "key": "symbol", - "value": "XBTUSDM", - "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) " - } - ] - } - }, - "status": "OK", - "code": 200, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "Content-Type", - "value": "application/json", - "name": "Content-Type", - "description": { - "content": "", - "type": "text/plain" - } - }, - { - "key": "gw-ratelimit-remaining", - "value": 1997, - "name": "gw-ratelimit-remaining" - }, - { - "key": "gw-ratelimit-limit", - "value": 2000, - "name": "gw-ratelimit-limit" - }, - { - "key": "gw-ratelimit-reset", - "value": 29990, - "name": "gw-ratelimit-reset" - } - ], - "cookie": [], - "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"sequence\": 1697895963339,\n \"symbol\": \"XBTUSDM\",\n \"bids\": [\n [\n 66968,\n 2\n ],\n [\n 66964.8,\n 25596\n ]\n ],\n \"asks\": [\n [\n 66968.1,\n 13501\n ],\n [\n 66968.7,\n 2032\n ]\n ],\n \"ts\": 1729168101216000000\n }\n}" - } - ] - }, - { - "name": "Get Interest Rate Index", - "request": { - "method": "GET", - "header": [], - "url": { - "raw": "", - "protocol": "https", - "host": [ - "{{futures_endpoint}}" - ], - "path": [ - "api", - "v1", - "interest", - "query" - ], - "query": [ - { - "key": "symbol", - "value": "", - "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: fundingBaseSymbol, fundingQuoteSymbol, fundingBaseSymbol1M, fundingQuoteSymbol1M](https://www.kucoin.com/docs-new/api-3470220) " - }, - { - "key": "startAt", - "value": "1728663338000", - "description": "Start time (milisecond)" - }, - { - "key": "endAt", - "value": "1728692138000", - "description": "End time (milisecond)" - }, - { - "key": "reverse", - "value": "true", - "description": "This parameter functions to judge whether the lookup is reverse. True means “yes”. False means no. This parameter is set as True by default." - }, - { - "key": "offset", - "value": "254062248624417", - "description": "Start offset. The unique attribute of the last returned result of the last request. The data of the first page will be returned by default." - }, - { - "key": "forward", - "value": "true", - "description": "This parameter functions to judge whether the lookup is forward or not. True means “yes” and False means “no”. This parameter is set as true by default" - }, - { - "key": "maxCount", - "value": "10", - "description": "Max record count. The default record count is 10, The maximum length cannot exceed 100" + "value": "XBTUSDM", + "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) " } ] }, - "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470226)\n\n:::info[Discription]\nGet interest rate Index.\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| dataList | array | Refer to the schema section of dataList |\n| hasMore | boolean | Whether there are more pages |\n\n**root.data.dataList Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| symbol | string | Symbol of the contract, Please refer to [Get Symbol endpoint: fundingBaseSymbol, fundingQuoteSymbol, fundingBaseSymbol1M, fundingQuoteSymbol1M](https://www.kucoin.com/docs-new/api-3470220) |\n| granularity | integer | Granularity (milisecond) |\n| timePoint | integer | Timestamp(milisecond) |\n| value | number | Interest rate value |\n\n---\n", + "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470225)\n\n:::info[Discription]\nQuery for part orderbook depth data. (aggregated by price)\n\nYou are recommended to request via this endpoint as the system reponse would be faster and cosume less traffic.\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| sequence | integer | Sequence number |\n| symbol | string | Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) |\n| bids | array | Refer to the schema section of bids |\n| asks | array | Refer to the schema section of asks |\n| ts | integer | Timestamp(nanosecond) |\n\n---\n", "body": {} }, "response": [ @@ -12151,44 +12032,14 @@ "path": [ "api", "v1", - "interest", - "query" + "level2", + "depth{size}" ], "query": [ { "key": "symbol", - "value": "", - "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: fundingBaseSymbol, fundingQuoteSymbol, fundingBaseSymbol1M, fundingQuoteSymbol1M](https://www.kucoin.com/docs-new/api-3470220) " - }, - { - "key": "startAt", - "value": "1728663338000", - "description": "Start time (milisecond)" - }, - { - "key": "endAt", - "value": "1728692138000", - "description": "End time (milisecond)" - }, - { - "key": "reverse", - "value": "true", - "description": "This parameter functions to judge whether the lookup is reverse. True means “yes”. False means no. This parameter is set as True by default." - }, - { - "key": "offset", - "value": "254062248624417", - "description": "Start offset. The unique attribute of the last returned result of the last request. The data of the first page will be returned by default." - }, - { - "key": "forward", - "value": "true", - "description": "This parameter functions to judge whether the lookup is forward or not. True means “yes” and False means “no”. This parameter is set as true by default" - }, - { - "key": "maxCount", - "value": "10", - "description": "Max record count. The default record count is 10, The maximum length cannot exceed 100" + "value": "XBTUSDM", + "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) " } ] } @@ -12223,12 +12074,12 @@ } ], "cookie": [], - "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"dataList\": [\n {\n \"symbol\": \".XBTINT\",\n \"granularity\": 60000,\n \"timePoint\": 1728692100000,\n \"value\": 0.0003\n },\n {\n \"symbol\": \".XBTINT\",\n \"granularity\": 60000,\n \"timePoint\": 1728692040000,\n \"value\": 0.0003\n }\n ],\n \"hasMore\": true\n }\n}" + "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"sequence\": 1697895963339,\n \"symbol\": \"XBTUSDM\",\n \"bids\": [\n [\n 66968,\n 2\n ],\n [\n 66964.8,\n 25596\n ]\n ],\n \"asks\": [\n [\n 66968.1,\n 13501\n ],\n [\n 66968.7,\n 2032\n ]\n ],\n \"ts\": 1729168101216000000\n }\n}" } ] }, { - "name": "Get Premium Index", + "name": "Get Trade History", "request": { "method": "GET", "header": [], @@ -12241,48 +12092,18 @@ "path": [ "api", "v1", - "premium", - "query" + "trade", + "history" ], "query": [ { "key": "symbol", - "value": "", - "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: premiumsSymbol1M, premiumsSymbol8H](https://www.kucoin.com/docs-new/api-3470220) " - }, - { - "key": "startAt", - "value": "1728663338000", - "description": "Start time (milisecond)" - }, - { - "key": "endAt", - "value": "1728692138000", - "description": "End time (milisecond)" - }, - { - "key": "reverse", - "value": "true", - "description": "This parameter functions to judge whether the lookup is reverse. True means “yes”. False means no. This parameter is set as True by default." - }, - { - "key": "offset", - "value": "254062248624417", - "description": "Start offset. The unique attribute of the last returned result of the last request. The data of the first page will be returned by default." - }, - { - "key": "forward", - "value": "true", - "description": "This parameter functions to judge whether the lookup is forward or not. True means “yes” and False means “no”. This parameter is set as true by default" - }, - { - "key": "maxCount", - "value": "10", - "description": "Max record count. The default record count is 10, The maximum length cannot exceed 100" + "value": "XBTUSDM", + "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) " } ] }, - "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470227)\n\n:::info[Discription]\nSubmit request to get premium index.\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| dataList | array | Refer to the schema section of dataList |\n| hasMore | boolean | Whether there are more pages |\n\n**root.data.dataList Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| symbol | string | Symbol of the contract, Please refer to [Get Symbol endpoint: premiumsSymbol1M, premiumsSymbol8H](https://www.kucoin.com/docs-new/api-3470220) |\n| granularity | integer | Granularity(milisecond) |\n| timePoint | integer | Timestamp(milisecond) |\n| value | number | Premium index |\n\n---\n", + "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470232)\n\n:::info[Discription]\nRequest via this endpoint to get the trade history of the specified symbol, the returned quantity is the last 100 transaction records.\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | array | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| sequence | integer | Sequence number |\n| contractId | integer | Deprecated param |\n| tradeId | string | Transaction ID |\n| makerOrderId | string | Maker order ID |\n| takerOrderId | string | Taker order ID |\n| ts | integer | Filled timestamp(nanosecond) |\n| size | integer | Filled amount |\n| price | string | Filled price |\n| side | string | Filled side, The trade side indicates the taker order side. A taker order is the order that was matched with orders opened on the order book. |\n\n---\n", "body": {} }, "response": [ @@ -12300,44 +12121,14 @@ "path": [ "api", "v1", - "premium", - "query" + "trade", + "history" ], "query": [ { "key": "symbol", - "value": "", - "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: premiumsSymbol1M, premiumsSymbol8H](https://www.kucoin.com/docs-new/api-3470220) " - }, - { - "key": "startAt", - "value": "1728663338000", - "description": "Start time (milisecond)" - }, - { - "key": "endAt", - "value": "1728692138000", - "description": "End time (milisecond)" - }, - { - "key": "reverse", - "value": "true", - "description": "This parameter functions to judge whether the lookup is reverse. True means “yes”. False means no. This parameter is set as True by default." - }, - { - "key": "offset", - "value": "254062248624417", - "description": "Start offset. The unique attribute of the last returned result of the last request. The data of the first page will be returned by default." - }, - { - "key": "forward", - "value": "true", - "description": "This parameter functions to judge whether the lookup is forward or not. True means “yes” and False means “no”. This parameter is set as true by default" - }, - { - "key": "maxCount", - "value": "10", - "description": "Max record count. The default record count is 10, The maximum length cannot exceed 100" + "value": "XBTUSDM", + "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) " } ] } @@ -12372,12 +12163,12 @@ } ], "cookie": [], - "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"hasMore\": true,\n \"dataList\": [\n {\n \"symbol\": \".XBTUSDTMPI\",\n \"granularity\": 60000,\n \"timePoint\": 1730558040000,\n \"value\": 6e-05\n },\n {\n \"symbol\": \".XBTUSDTMPI\",\n \"granularity\": 60000,\n \"timePoint\": 1730557980000,\n \"value\": -2.5e-05\n }\n ]\n }\n}" + "body": "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"sequence\": 1697915257909,\n \"contractId\": 1,\n \"tradeId\": \"1697915257909\",\n \"makerOrderId\": \"236679665752801280\",\n \"takerOrderId\": \"236679667975745536\",\n \"ts\": 1729242032152000000,\n \"size\": 1,\n \"price\": \"67878\",\n \"side\": \"sell\"\n },\n {\n \"sequence\": 1697915257749,\n \"contractId\": 1,\n \"tradeId\": \"1697915257749\",\n \"makerOrderId\": \"236679660971245570\",\n \"takerOrderId\": \"236679665400492032\",\n \"ts\": 1729242031535000000,\n \"size\": 1,\n \"price\": \"67867.8\",\n \"side\": \"sell\"\n },\n {\n \"sequence\": 1697915257701,\n \"contractId\": 1,\n \"tradeId\": \"1697915257701\",\n \"makerOrderId\": \"236679660971245570\",\n \"takerOrderId\": \"236679661919211521\",\n \"ts\": 1729242030932000000,\n \"size\": 1,\n \"price\": \"67867.8\",\n \"side\": \"sell\"\n }\n ]\n}" } ] }, { - "name": "Get 24hr Stats", + "name": "Get Klines", "request": { "method": "GET", "header": [], @@ -12390,11 +12181,33 @@ "path": [ "api", "v1", - "trade-statistics" + "kline", + "query" ], - "query": [] + "query": [ + { + "key": "symbol", + "value": "", + "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol, indexSymbol, premiumsSymbol1M, premiumsSymbol8H](https://www.kucoin.com/docs-new/api-3470220) " + }, + { + "key": "granularity", + "value": "", + "description": "Type of candlestick patterns(minute)" + }, + { + "key": "from", + "value": "1728552342000", + "description": "Start time (milisecond)" + }, + { + "key": "to", + "value": "1729243542000", + "description": "End time (milisecond)" + } + ] }, - "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470228)\n\n:::info[Discription]\nGet the statistics of the platform futures trading volume in the last 24 hours.\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| turnoverOf24h | number | 24-hour platform Futures trading volume. Unit is USD |\n\n---\n", + "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470234)\n\n:::info[Description]\nGet the Kline of the symbol. Data are returned in grouped buckets based on requested type.\nFor each query, the system would return at most 500 pieces of data. To obtain more data, please page the data by time.\n:::\n\n:::tip[Tips]\nKlines data may be incomplete. No data is published for intervals where there are no ticks.\n\nIf the specified start/end time and the time granularity exceeds the maximum size allowed for a single request, the system will only return 500 pieces of data for your request. If you want to get fine-grained data in a larger time range, you will need to specify the time ranges and make multiple requests for multiple times.\n\nIf you’ve specified only the start time in your request, the system will return 500 pieces of data from the specified start time to the current time of the system; If only the end time is specified, the system will return 500 pieces of data closest to the end time; If neither the start time nor the end time is specified, the system will return the 500 pieces of data closest to the current time of the system.\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | array | Refer to the schema section of data |\n\n---\n", "body": {} }, "response": [ @@ -12412,9 +12225,31 @@ "path": [ "api", "v1", - "trade-statistics" + "kline", + "query" ], - "query": [] + "query": [ + { + "key": "symbol", + "value": "", + "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol, indexSymbol, premiumsSymbol1M, premiumsSymbol8H](https://www.kucoin.com/docs-new/api-3470220) " + }, + { + "key": "granularity", + "value": "", + "description": "Type of candlestick patterns(minute)" + }, + { + "key": "from", + "value": "1728552342000", + "description": "Start time (milisecond)" + }, + { + "key": "to", + "value": "1729243542000", + "description": "End time (milisecond)" + } + ] } }, "status": "OK", @@ -12447,12 +12282,12 @@ } ], "cookie": [], - "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"turnoverOf24h\": 1115573341.3273683\n }\n}" + "body": "{\n \"code\": \"200000\",\n \"data\": [\n [\n 1728576000000,\n 60791.1,\n 61035,\n 58940,\n 60300,\n 5501167\n ],\n [\n 1728604800000,\n 60299.9,\n 60924.1,\n 60077.4,\n 60666.1,\n 1220980\n ],\n [\n 1728633600000,\n 60665.7,\n 62436.8,\n 60650.1,\n 62255.1,\n 3386359\n ]\n ]\n}" } ] }, { - "name": "Get Server Time", + "name": "Get Mark Price", "request": { "method": "GET", "header": [], @@ -12465,11 +12300,13 @@ "path": [ "api", "v1", - "timestamp" + "mark-price", + "{{symbol}}", + "current" ], "query": [] }, - "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470229)\n\n:::info[Discription]\nGet the API server time. This is the Unix timestamp.\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | integer | ServerTime(millisecond) |\n\n---\n", + "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470233)\n\n:::info[Discription]\nGet current mark price\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| symbol | string | Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) |\n| granularity | integer | Granularity (milisecond) |\n| timePoint | integer | Time point (milisecond) |\n| value | number | Mark price |\n| indexPrice | number | Index price |\n\n---\n", "body": {} }, "response": [ @@ -12487,7 +12324,9 @@ "path": [ "api", "v1", - "timestamp" + "mark-price", + "{{symbol}}", + "current" ], "query": [] } @@ -12522,12 +12361,12 @@ } ], "cookie": [], - "body": "{\n \"code\": \"200000\",\n \"data\": 1729260030774\n}" + "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"symbol\": \"XBTUSDTM\",\n \"granularity\": 1000,\n \"timePoint\": 1729254307000,\n \"value\": 67687.08,\n \"indexPrice\": 67683.58\n }\n}" } ] }, { - "name": "Get Service Status", + "name": "Get Spot Index Price", "request": { "method": "GET", "header": [], @@ -12540,11 +12379,48 @@ "path": [ "api", "v1", - "status" + "index", + "query" ], - "query": [] + "query": [ + { + "key": "symbol", + "value": "", + "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: indexSymbol](https://www.kucoin.com/docs-new/api-3470220) " + }, + { + "key": "startAt", + "value": null, + "description": "Start time (milisecond)" + }, + { + "key": "endAt", + "value": null, + "description": "End time (milisecond)" + }, + { + "key": "reverse", + "value": null, + "description": "This parameter functions to judge whether the lookup is reverse. True means “yes”. False means no. This parameter is set as True by default." + }, + { + "key": "offset", + "value": null, + "description": "Start offset. The unique attribute of the last returned result of the last request. The data of the first page will be returned by default." + }, + { + "key": "forward", + "value": null, + "description": "This parameter functions to judge whether the lookup is forward or not. True means “yes” and False means “no”. This parameter is set as true by default" + }, + { + "key": "maxCount", + "value": null, + "description": "Max record count. The default record count is 10, The maximum length cannot exceed 100" + } + ] }, - "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470230)\n\n:::info[Discription]\nGet the service status.\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| msg | string | |\n| status | string | Status of service: open:normal transaction, close:Stop Trading/Maintenance, cancelonly:can only cancel the order but not place order |\n\n---\n", + "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470231)\n\n:::info[Discription]\nGet Spot Index price\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| dataList | array | Refer to the schema section of dataList |\n| hasMore | boolean | Whether there are more pages |\n\n**root.data.dataList Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| symbol | string | Symbol of the contract, Please refer to [Get Symbol endpoint: indexSymbol](https://www.kucoin.com/docs-new/api-3470220) |\n| granularity | integer | Granularity (milisecond) |\n| timePoint | integer | Timestamp (milisecond) |\n| value | number | Index Value |\n| decomposionList | array | Refer to the schema section of decomposionList |\n\n**root.data.dataList.decomposionList Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| exchange | string | Exchange |\n| price | number | Price |\n| weight | number | Weight |\n\n---\n", "body": {} }, "response": [ @@ -12562,9 +12438,46 @@ "path": [ "api", "v1", - "status" + "index", + "query" ], - "query": [] + "query": [ + { + "key": "symbol", + "value": "", + "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: indexSymbol](https://www.kucoin.com/docs-new/api-3470220) " + }, + { + "key": "startAt", + "value": null, + "description": "Start time (milisecond)" + }, + { + "key": "endAt", + "value": null, + "description": "End time (milisecond)" + }, + { + "key": "reverse", + "value": null, + "description": "This parameter functions to judge whether the lookup is reverse. True means “yes”. False means no. This parameter is set as True by default." + }, + { + "key": "offset", + "value": null, + "description": "Start offset. The unique attribute of the last returned result of the last request. The data of the first page will be returned by default." + }, + { + "key": "forward", + "value": null, + "description": "This parameter functions to judge whether the lookup is forward or not. True means “yes” and False means “no”. This parameter is set as true by default" + }, + { + "key": "maxCount", + "value": null, + "description": "Max record count. The default record count is 10, The maximum length cannot exceed 100" + } + ] } }, "status": "OK", @@ -12597,12 +12510,12 @@ } ], "cookie": [], - "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"msg\": \"\",\n \"status\": \"open\"\n }\n}" + "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"hasMore\": true,\n \"dataList\": [\n {\n \"symbol\": \".KXBTUSDT\",\n \"granularity\": 1000,\n \"timePoint\": 1730557515000,\n \"value\": 69202.94,\n \"decomposionList\": [\n {\n \"exchange\": \"gateio\",\n \"price\": 69209.27,\n \"weight\": 0.0533\n },\n {\n \"exchange\": \"bitmart\",\n \"price\": 69230.77,\n \"weight\": 0.0128\n },\n {\n \"exchange\": \"okex\",\n \"price\": 69195.34,\n \"weight\": 0.11\n },\n {\n \"exchange\": \"bybit\",\n \"price\": 69190.33,\n \"weight\": 0.0676\n },\n {\n \"exchange\": \"binance\",\n \"price\": 69204.55,\n \"weight\": 0.6195\n },\n {\n \"exchange\": \"kucoin\",\n \"price\": 69202.91,\n \"weight\": 0.1368\n }\n ]\n },\n {\n \"symbol\": \".KXBTUSDT\",\n \"granularity\": 1000,\n \"timePoint\": 1730557514000,\n \"value\": 69204.98,\n \"decomposionList\": [\n {\n \"exchange\": \"gateio\",\n \"price\": 69212.71,\n \"weight\": 0.0808\n },\n {\n \"exchange\": \"bitmart\",\n \"price\": 69230.77,\n \"weight\": 0.0134\n },\n {\n \"exchange\": \"okex\",\n \"price\": 69195.49,\n \"weight\": 0.0536\n },\n {\n \"exchange\": \"bybit\",\n \"price\": 69195.97,\n \"weight\": 0.0921\n },\n {\n \"exchange\": \"binance\",\n \"price\": 69204.56,\n \"weight\": 0.5476\n },\n {\n \"exchange\": \"kucoin\",\n \"price\": 69207.8,\n \"weight\": 0.2125\n }\n ]\n }\n ]\n }\n}" } ] }, { - "name": "Get Spot Index Price", + "name": "Get Interest Rate Index", "request": { "method": "GET", "header": [], @@ -12615,48 +12528,48 @@ "path": [ "api", "v1", - "index", + "interest", "query" ], "query": [ { "key": "symbol", "value": "", - "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: indexSymbol](https://www.kucoin.com/docs-new/api-3470220) " + "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: fundingBaseSymbol, fundingQuoteSymbol, fundingBaseSymbol1M, fundingQuoteSymbol1M](https://www.kucoin.com/docs-new/api-3470220) " }, { "key": "startAt", - "value": null, + "value": "1728663338000", "description": "Start time (milisecond)" }, { "key": "endAt", - "value": null, + "value": "1728692138000", "description": "End time (milisecond)" }, { "key": "reverse", - "value": null, + "value": "true", "description": "This parameter functions to judge whether the lookup is reverse. True means “yes”. False means no. This parameter is set as True by default." }, { "key": "offset", - "value": null, + "value": "254062248624417", "description": "Start offset. The unique attribute of the last returned result of the last request. The data of the first page will be returned by default." }, { "key": "forward", - "value": null, + "value": "true", "description": "This parameter functions to judge whether the lookup is forward or not. True means “yes” and False means “no”. This parameter is set as true by default" }, { "key": "maxCount", - "value": null, + "value": "10", "description": "Max record count. The default record count is 10, The maximum length cannot exceed 100" } ] }, - "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470231)\n\n:::info[Discription]\nGet Spot Index price\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| dataList | array | Refer to the schema section of dataList |\n| hasMore | boolean | Whether there are more pages |\n\n**root.data.dataList Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| symbol | string | Symbol of the contract, Please refer to [Get Symbol endpoint: indexSymbol](https://www.kucoin.com/docs-new/api-3470220) |\n| granularity | integer | Granularity (milisecond) |\n| timePoint | integer | Timestamp (milisecond) |\n| value | number | Index Value |\n| decomposionList | array | Refer to the schema section of decomposionList |\n\n**root.data.dataList.decomposionList Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| exchange | string | Exchange |\n| price | number | Price |\n| weight | number | Weight |\n\n---\n", + "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470226)\n\n:::info[Discription]\nGet interest rate Index.\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| dataList | array | Refer to the schema section of dataList |\n| hasMore | boolean | Whether there are more pages |\n\n**root.data.dataList Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| symbol | string | Symbol of the contract, Please refer to [Get Symbol endpoint: fundingBaseSymbol, fundingQuoteSymbol, fundingBaseSymbol1M, fundingQuoteSymbol1M](https://www.kucoin.com/docs-new/api-3470220) |\n| granularity | integer | Granularity (milisecond) |\n| timePoint | integer | Timestamp(milisecond) |\n| value | number | Interest rate value |\n\n---\n", "body": {} }, "response": [ @@ -12674,43 +12587,43 @@ "path": [ "api", "v1", - "index", + "interest", "query" ], "query": [ { "key": "symbol", "value": "", - "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: indexSymbol](https://www.kucoin.com/docs-new/api-3470220) " + "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: fundingBaseSymbol, fundingQuoteSymbol, fundingBaseSymbol1M, fundingQuoteSymbol1M](https://www.kucoin.com/docs-new/api-3470220) " }, { "key": "startAt", - "value": null, + "value": "1728663338000", "description": "Start time (milisecond)" }, { "key": "endAt", - "value": null, + "value": "1728692138000", "description": "End time (milisecond)" }, { "key": "reverse", - "value": null, + "value": "true", "description": "This parameter functions to judge whether the lookup is reverse. True means “yes”. False means no. This parameter is set as True by default." }, { "key": "offset", - "value": null, + "value": "254062248624417", "description": "Start offset. The unique attribute of the last returned result of the last request. The data of the first page will be returned by default." }, { "key": "forward", - "value": null, + "value": "true", "description": "This parameter functions to judge whether the lookup is forward or not. True means “yes” and False means “no”. This parameter is set as true by default" }, { "key": "maxCount", - "value": null, + "value": "10", "description": "Max record count. The default record count is 10, The maximum length cannot exceed 100" } ] @@ -12746,12 +12659,12 @@ } ], "cookie": [], - "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"hasMore\": true,\n \"dataList\": [\n {\n \"symbol\": \".KXBTUSDT\",\n \"granularity\": 1000,\n \"timePoint\": 1730557515000,\n \"value\": 69202.94,\n \"decomposionList\": [\n {\n \"exchange\": \"gateio\",\n \"price\": 69209.27,\n \"weight\": 0.0533\n },\n {\n \"exchange\": \"bitmart\",\n \"price\": 69230.77,\n \"weight\": 0.0128\n },\n {\n \"exchange\": \"okex\",\n \"price\": 69195.34,\n \"weight\": 0.11\n },\n {\n \"exchange\": \"bybit\",\n \"price\": 69190.33,\n \"weight\": 0.0676\n },\n {\n \"exchange\": \"binance\",\n \"price\": 69204.55,\n \"weight\": 0.6195\n },\n {\n \"exchange\": \"kucoin\",\n \"price\": 69202.91,\n \"weight\": 0.1368\n }\n ]\n },\n {\n \"symbol\": \".KXBTUSDT\",\n \"granularity\": 1000,\n \"timePoint\": 1730557514000,\n \"value\": 69204.98,\n \"decomposionList\": [\n {\n \"exchange\": \"gateio\",\n \"price\": 69212.71,\n \"weight\": 0.0808\n },\n {\n \"exchange\": \"bitmart\",\n \"price\": 69230.77,\n \"weight\": 0.0134\n },\n {\n \"exchange\": \"okex\",\n \"price\": 69195.49,\n \"weight\": 0.0536\n },\n {\n \"exchange\": \"bybit\",\n \"price\": 69195.97,\n \"weight\": 0.0921\n },\n {\n \"exchange\": \"binance\",\n \"price\": 69204.56,\n \"weight\": 0.5476\n },\n {\n \"exchange\": \"kucoin\",\n \"price\": 69207.8,\n \"weight\": 0.2125\n }\n ]\n }\n ]\n }\n}" + "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"dataList\": [\n {\n \"symbol\": \".XBTINT\",\n \"granularity\": 60000,\n \"timePoint\": 1728692100000,\n \"value\": 0.0003\n },\n {\n \"symbol\": \".XBTINT\",\n \"granularity\": 60000,\n \"timePoint\": 1728692040000,\n \"value\": 0.0003\n }\n ],\n \"hasMore\": true\n }\n}" } ] }, { - "name": "Get Trade History", + "name": "Get Premium Index", "request": { "method": "GET", "header": [], @@ -12764,18 +12677,48 @@ "path": [ "api", "v1", - "trade", - "history" + "premium", + "query" ], "query": [ { "key": "symbol", - "value": "XBTUSDM", - "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) " + "value": "", + "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: premiumsSymbol1M, premiumsSymbol8H](https://www.kucoin.com/docs-new/api-3470220) " + }, + { + "key": "startAt", + "value": "1728663338000", + "description": "Start time (milisecond)" + }, + { + "key": "endAt", + "value": "1728692138000", + "description": "End time (milisecond)" + }, + { + "key": "reverse", + "value": "true", + "description": "This parameter functions to judge whether the lookup is reverse. True means “yes”. False means no. This parameter is set as True by default." + }, + { + "key": "offset", + "value": "254062248624417", + "description": "Start offset. The unique attribute of the last returned result of the last request. The data of the first page will be returned by default." + }, + { + "key": "forward", + "value": "true", + "description": "This parameter functions to judge whether the lookup is forward or not. True means “yes” and False means “no”. This parameter is set as true by default" + }, + { + "key": "maxCount", + "value": "10", + "description": "Max record count. The default record count is 10, The maximum length cannot exceed 100" } ] }, - "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470232)\n\n:::info[Discription]\nRequest via this endpoint to get the trade history of the specified symbol, the returned quantity is the last 100 transaction records.\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | array | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| sequence | integer | Sequence number |\n| contractId | integer | Deprecated param |\n| tradeId | string | Transaction ID |\n| makerOrderId | string | Maker order ID |\n| takerOrderId | string | Taker order ID |\n| ts | integer | Filled timestamp(nanosecond) |\n| size | integer | Filled amount |\n| price | string | Filled price |\n| side | string | Filled side, The trade side indicates the taker order side. A taker order is the order that was matched with orders opened on the order book. |\n\n---\n", + "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470227)\n\n:::info[Discription]\nSubmit request to get premium index.\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| dataList | array | Refer to the schema section of dataList |\n| hasMore | boolean | Whether there are more pages |\n\n**root.data.dataList Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| symbol | string | Symbol of the contract, Please refer to [Get Symbol endpoint: premiumsSymbol1M, premiumsSymbol8H](https://www.kucoin.com/docs-new/api-3470220) |\n| granularity | integer | Granularity(milisecond) |\n| timePoint | integer | Timestamp(milisecond) |\n| value | number | Premium index |\n\n---\n", "body": {} }, "response": [ @@ -12793,14 +12736,44 @@ "path": [ "api", "v1", - "trade", - "history" + "premium", + "query" ], "query": [ { "key": "symbol", - "value": "XBTUSDM", - "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) " + "value": "", + "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: premiumsSymbol1M, premiumsSymbol8H](https://www.kucoin.com/docs-new/api-3470220) " + }, + { + "key": "startAt", + "value": "1728663338000", + "description": "Start time (milisecond)" + }, + { + "key": "endAt", + "value": "1728692138000", + "description": "End time (milisecond)" + }, + { + "key": "reverse", + "value": "true", + "description": "This parameter functions to judge whether the lookup is reverse. True means “yes”. False means no. This parameter is set as True by default." + }, + { + "key": "offset", + "value": "254062248624417", + "description": "Start offset. The unique attribute of the last returned result of the last request. The data of the first page will be returned by default." + }, + { + "key": "forward", + "value": "true", + "description": "This parameter functions to judge whether the lookup is forward or not. True means “yes” and False means “no”. This parameter is set as true by default" + }, + { + "key": "maxCount", + "value": "10", + "description": "Max record count. The default record count is 10, The maximum length cannot exceed 100" } ] } @@ -12835,12 +12808,12 @@ } ], "cookie": [], - "body": "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"sequence\": 1697915257909,\n \"contractId\": 1,\n \"tradeId\": \"1697915257909\",\n \"makerOrderId\": \"236679665752801280\",\n \"takerOrderId\": \"236679667975745536\",\n \"ts\": 1729242032152000000,\n \"size\": 1,\n \"price\": \"67878\",\n \"side\": \"sell\"\n },\n {\n \"sequence\": 1697915257749,\n \"contractId\": 1,\n \"tradeId\": \"1697915257749\",\n \"makerOrderId\": \"236679660971245570\",\n \"takerOrderId\": \"236679665400492032\",\n \"ts\": 1729242031535000000,\n \"size\": 1,\n \"price\": \"67867.8\",\n \"side\": \"sell\"\n },\n {\n \"sequence\": 1697915257701,\n \"contractId\": 1,\n \"tradeId\": \"1697915257701\",\n \"makerOrderId\": \"236679660971245570\",\n \"takerOrderId\": \"236679661919211521\",\n \"ts\": 1729242030932000000,\n \"size\": 1,\n \"price\": \"67867.8\",\n \"side\": \"sell\"\n }\n ]\n}" + "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"hasMore\": true,\n \"dataList\": [\n {\n \"symbol\": \".XBTUSDTMPI\",\n \"granularity\": 60000,\n \"timePoint\": 1730558040000,\n \"value\": 6e-05\n },\n {\n \"symbol\": \".XBTUSDTMPI\",\n \"granularity\": 60000,\n \"timePoint\": 1730557980000,\n \"value\": -2.5e-05\n }\n ]\n }\n}" } ] }, { - "name": "Get Mark Price", + "name": "Get 24hr Stats", "request": { "method": "GET", "header": [], @@ -12853,13 +12826,11 @@ "path": [ "api", "v1", - "mark-price", - "{{symbol}}", - "current" + "trade-statistics" ], "query": [] }, - "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470233)\n\n:::info[Discription]\nGet current mark price\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| symbol | string | Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) |\n| granularity | integer | Granularity (milisecond) |\n| timePoint | integer | Time point (milisecond) |\n| value | number | Mark price |\n| indexPrice | number | Index price |\n\n---\n", + "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470228)\n\n:::info[Discription]\nGet the statistics of the platform futures trading volume in the last 24 hours.\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| turnoverOf24h | number | 24-hour platform Futures trading volume. Unit is USD |\n\n---\n", "body": {} }, "response": [ @@ -12877,9 +12848,7 @@ "path": [ "api", "v1", - "mark-price", - "{{symbol}}", - "current" + "trade-statistics" ], "query": [] } @@ -12914,12 +12883,12 @@ } ], "cookie": [], - "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"symbol\": \"XBTUSDTM\",\n \"granularity\": 1000,\n \"timePoint\": 1729254307000,\n \"value\": 67687.08,\n \"indexPrice\": 67683.58\n }\n}" + "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"turnoverOf24h\": 1115573341.3273683\n }\n}" } ] }, { - "name": "Get Klines", + "name": "Get Server Time", "request": { "method": "GET", "header": [], @@ -12932,33 +12901,11 @@ "path": [ "api", "v1", - "kline", - "query" + "timestamp" ], - "query": [ - { - "key": "symbol", - "value": "", - "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol, indexSymbol, premiumsSymbol1M, premiumsSymbol8H](https://www.kucoin.com/docs-new/api-3470220) " - }, - { - "key": "granularity", - "value": "", - "description": "Type of candlestick patterns(minute)" - }, - { - "key": "from", - "value": "1728552342000", - "description": "Start time (milisecond)" - }, - { - "key": "to", - "value": "1729243542000", - "description": "End time (milisecond)" - } - ] + "query": [] }, - "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470234)\n\n:::info[Description]\nGet the Kline of the symbol. Data are returned in grouped buckets based on requested type.\nFor each query, the system would return at most 500 pieces of data. To obtain more data, please page the data by time.\n:::\n\n:::tip[Tips]\nKlines data may be incomplete. No data is published for intervals where there are no ticks.\n\nIf the specified start/end time and the time granularity exceeds the maximum size allowed for a single request, the system will only return 500 pieces of data for your request. If you want to get fine-grained data in a larger time range, you will need to specify the time ranges and make multiple requests for multiple times.\n\nIf you’ve specified only the start time in your request, the system will return 500 pieces of data from the specified start time to the current time of the system; If only the end time is specified, the system will return 500 pieces of data closest to the end time; If neither the start time nor the end time is specified, the system will return the 500 pieces of data closest to the current time of the system.\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | array | Refer to the schema section of data |\n\n---\n", + "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470229)\n\n:::info[Discription]\nGet the API server time. This is the Unix timestamp.\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | integer | ServerTime(millisecond) |\n\n---\n", "body": {} }, "response": [ @@ -12976,31 +12923,9 @@ "path": [ "api", "v1", - "kline", - "query" + "timestamp" ], - "query": [ - { - "key": "symbol", - "value": "", - "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol, indexSymbol, premiumsSymbol1M, premiumsSymbol8H](https://www.kucoin.com/docs-new/api-3470220) " - }, - { - "key": "granularity", - "value": "", - "description": "Type of candlestick patterns(minute)" - }, - { - "key": "from", - "value": "1728552342000", - "description": "Start time (milisecond)" - }, - { - "key": "to", - "value": "1729243542000", - "description": "End time (milisecond)" - } - ] + "query": [] } }, "status": "OK", @@ -13033,20 +12958,14 @@ } ], "cookie": [], - "body": "{\n \"code\": \"200000\",\n \"data\": [\n [\n 1728576000000,\n 60791.1,\n 61035,\n 58940,\n 60300,\n 5501167\n ],\n [\n 1728604800000,\n 60299.9,\n 60924.1,\n 60077.4,\n 60666.1,\n 1220980\n ],\n [\n 1728633600000,\n 60665.7,\n 62436.8,\n 60650.1,\n 62255.1,\n 3386359\n ]\n ]\n}" + "body": "{\n \"code\": \"200000\",\n \"data\": 1729260030774\n}" } ] - } - ], - "description": "" - }, - { - "name": "Orders", - "item": [ + }, { - "name": "Add Order", + "name": "Get Service Status", "request": { - "method": "POST", + "method": "GET", "header": [], "url": { "raw": "", @@ -13057,26 +12976,18 @@ "path": [ "api", "v1", - "orders" + "status" ], "query": [] }, - "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470235)\n\n:::info[Description]\nPlace order to the futures trading system, you can place two major types of orders: limit and market. Orders can only be placed if your account has sufficient funds. Once an order is placed, your funds will be put on hold for the duration of the order. The amount of funds on hold depends on the order type and parameters specified.\n:::\n\n:::tip[Tips]\nThe maximum limit orders for a single contract is 100 per account, and the maximum stop orders for a single contract is 200 per account.\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| clientOid | string | Unique order id created by users to identify their orders, the maximum length cannot exceed 40, e.g. UUID, Only allows numbers, characters, underline(_), and separator(-) |\n| side | string | specify if the order is to 'buy' or 'sell' |\n| symbol | string | Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) |\n| leverage | integer | Used to calculate the margin to be frozen for the order. If you are to close the position, this parameter is not required. |\n| type | string | specify if the order is an 'limit' order or 'market' order |\n| remark | string | remark for the order, length cannot exceed 100 utf8 characters |\n| stop | string | Either 'down' or 'up'. If stop is used,parameter stopPrice and stopPriceType also need to be provieded. |\n| stopPriceType | string | Either 'TP', 'IP' or 'MP', Need to be defined if stop is specified. |\n| stopPrice | string | Need to be defined if stop is specified. |\n| reduceOnly | boolean | A mark to reduce the position size only. Set to false by default. Need to set the position size when reduceOnly is true. If set to true, only the orders reducing the position size will be executed. If the reduce-only order size exceeds the position size, the extra size will be canceled. |\n| closeOrder | boolean | A mark to close the position. Set to false by default. If closeOrder is set to true, the system will close the position and the position size will become 0. Side, Size and Leverage fields can be left empty and the system will determine the side and size automatically. |\n| forceHold | boolean | A mark to forcely hold the funds for an order, even though it's an order to reduce the position size. This helps the order stay on the order book and not get canceled when the position size changes. Set to false by default. The system will forcely freeze certain amount of funds for this order, including orders whose direction is opposite to the current positions. This feature is to ensure that the order won’t be canceled by the matching engine in such a circumstance that not enough funds are frozen for the order. |\n| stp | string | [Self Trade Prevention](https://www.kucoin.com/docs-new/doc-338146) is divided into these strategies: CN, CO, CB. Not supported DC at the moment. |\n| marginMode | string | Margin mode: ISOLATED, CROSS, default: ISOLATED |\n| price | string | Required for type is 'limit' order, indicating the operating price |\n| size | integer | **Choose one of size, qty, valueQty**, Order size (Lot), must be a positive integer. The quantity unit of coin-swap contracts is size(lot), and other units are not supported. |\n| timeInForce | string | Optional for type is 'limit' order, [Time in force](https://www.kucoin.com/docs-new/doc-338146) is a special strategy used during trading, default is GTC |\n| postOnly | boolean | Optional for type is 'limit' order, post only flag, invalid when timeInForce is IOC. When postOnly is true, not allowed choose hidden or iceberg. The post-only flag ensures that the trader always pays the maker fee and provides liquidity to the order book. If any part of the order is going to pay taker fee, the order will be fully rejected. |\n| hidden | boolean | Optional for type is 'limit' order, orders not displaying in order book. When hidden chose, not allowed choose postOnly. |\n| iceberg | boolean | Optional for type is 'limit' order, Only visible portion of the order is displayed in the order book. When iceberg chose, not allowed choose postOnly. |\n| visibleSize | string | Optional for type is 'limit' order, The maximum visible size of an iceberg order. please place order in size (lots), The units of qty (base currency) and valueQty (value) are not supported. |\n| qty | string | **Choose one of size, qty, valueQty**, Order size (Base currency) must be an integer multiple of the multiplier. The unit of the quantity of coin-swap is size(lot), which is not supported |\n| valueQty | string | **Choose one of size, qty, valueQty**, Order size (Value), USDS-Swap correspond to USDT or USDC. The unit of the quantity of coin-swap is size(lot), which is not supported |\n\n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| orderId | string | The unique order id generated by the trading system,which can be used later for further actions such as canceling the order. |\n| clientOid | string | The user self-defined order id. |\n\n---\n", - "body": { - "mode": "raw", - "raw": "{\n \"clientOid\": \"5c52e11203aa677f33e493fb\",\n \"side\": \"buy\",\n \"symbol\": \"XBTUSDTM\",\n \"leverage\": 3,\n \"type\": \"limit\",\n \"remark\": \"order remarks\",\n \"reduceOnly\": false,\n \"marginMode\": \"ISOLATED\",\n \"price\": \"0.1\",\n \"size\": 1,\n \"timeInForce\": \"GTC\"\n}", - "options": { - "raw": { - "language": "json" - } - } - } + "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470230)\n\n:::info[Discription]\nGet the service status.\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| msg | string | |\n| status | string | Status of service: open:normal transaction, close:Stop Trading/Maintenance, cancelonly:can only cancel the order but not place order |\n\n---\n", + "body": {} }, "response": [ { "name": "Successful Response", "originalRequest": { - "method": "POST", + "method": "GET", "header": [], "url": { "raw": "", @@ -13087,7 +12998,7 @@ "path": [ "api", "v1", - "orders" + "status" ], "query": [] } @@ -13122,14 +13033,20 @@ } ], "cookie": [], - "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"orderId\": \"234125150956625920\",\n \"clientOid\": \"5c52e11203aa677f33e493fb\"\n }\n}" + "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"msg\": \"\",\n \"status\": \"open\"\n }\n}" } ] - }, + } + ], + "description": "" + }, + { + "name": "Orders", + "item": [ { - "name": "Get Trade History", + "name": "Add Order", "request": { - "method": "GET", + "method": "POST", "header": [], "url": { "raw": "", @@ -13140,64 +13057,26 @@ "path": [ "api", "v1", - "fills" + "orders" ], - "query": [ - { - "key": "orderId", - "value": "236655147005071361", - "description": "List fills for a specific order only (If you specify orderId, other parameters can be ignored)" - }, - { - "key": "symbol", - "value": null, - "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) " - }, - { - "key": "side", - "value": null, - "description": "Order side" - }, - { - "key": "type", - "value": null, - "description": "Order Type" - }, - { - "key": "tradeTypes", - "value": null, - "description": "Transaction type: trade, adl, liquid, settlement. Supports querying multiple types at the same time, separated by commas. Query all type when empty" - }, - { - "key": "startAt", - "value": null, - "description": "Start time (milisecond)" - }, - { - "key": "endAt", - "value": null, - "description": "End time (milisecond)" - }, - { - "key": "currentPage", - "value": null, - "description": "Current request page, The default currentPage is 1" - }, - { - "key": "pageSize", - "value": null, - "description": "pageSize, The default pageSize is 50, The maximum cannot exceed 1000" - } - ] + "query": [] }, - "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470248)\n\n:::info[Description]\nGet a list of recent fills. If you need to get your recent trade history with low latency, please query endpoint Get List of Orders Completed in 24h. The requested data is not real-time.\n:::\n\n**Data Time Range**\n\nThe system allows you to retrieve data up to one week (start from the last day by default). If the time period of the queried data exceeds one week (time range from the start time to end time exceeded 24*7 hours), the system will prompt to remind you that you have exceeded the time limit. If you only specified the start time, the system will automatically calculate the end time (end time = start time + 24 hours). On the contrary, if you only specified the end time, the system will calculate the start time (start time= end time - 24 hours) the same way.\n\n**Fee**\n\nOrders on KuCoin Futures platform are classified into two types, taker and maker. A taker order matches other resting orders on the exchange order book, and gets executed immediately after order entry. A maker order, on the contrary, stays on the exchange order book and awaits to be matched. Taker orders will be charged taker fees, while maker orders will receive maker rebates. Please note that market orders, iceberg orders and hidden orders are always charged taker fees.\n\nThe system will pre-freeze a predicted taker fee when you place an order.The liquidity field indicates if the fill was charged taker or maker fees.\n\nThe system will pre-freeze the predicted fees (including the maintenance margin needed for the position, entry fees and fees to close positions) if you added the position, and will not pre-freeze fees if you reduced the position. After the order is executed, if you added positions, the system will deduct entry fees from your balance, if you closed positions, the system will deduct the close fees.\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| currentPage | integer | |\n| pageSize | integer | |\n| totalNum | integer | |\n| totalPage | integer | |\n| items | array | Refer to the schema section of items |\n\n**root.data.items Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| symbol | string | Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) |\n| tradeId | string | Trade ID
|\n| orderId | string | Order ID
|\n| side | string | Transaction side |\n| liquidity | string | Liquidity- taker or maker |\n| forceTaker | boolean | Whether to force processing as a taker
|\n| price | string | Filled price |\n| size | integer | Filled amount |\n| value | string | Order value |\n| openFeePay | string | Opening transaction fee |\n| closeFeePay | string | Closing transaction fee |\n| stop | string | A mark to the stop order type |\n| feeRate | string | Fee Rate |\n| fixFee | string | Fixed fees(Deprecated field, no actual use of the value field) |\n| feeCurrency | string | Charging currency |\n| tradeTime | integer | trade time in nanosecond |\n| subTradeType | string | Deprecated field, no actual use of the value field |\n| marginMode | string | Margin mode: ISOLATED (isolated), CROSS (cross margin). |\n| settleCurrency | string | Settle Currency |\n| displayType | string | Order Type |\n| fee | string | |\n| orderType | string | Order type |\n| tradeType | string | Trade type (trade, liquid, adl or settlement)
|\n| createdAt | integer | Time the order created
|\n\n---\n", - "body": {} + "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470235)\n\n:::info[Description]\nPlace order to the futures trading system, you can place two major types of orders: limit and market. Orders can only be placed if your account has sufficient funds. Once an order is placed, your funds will be put on hold for the duration of the order. The amount of funds on hold depends on the order type and parameters specified.\n:::\n\n:::tip[Tips]\nThe maximum limit orders for a single contract is 100 per account, and the maximum stop orders for a single contract is 200 per account.\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| clientOid | string | Unique order id created by users to identify their orders, the maximum length cannot exceed 40, e.g. UUID, Only allows numbers, characters, underline(_), and separator(-) |\n| side | string | specify if the order is to 'buy' or 'sell' |\n| symbol | string | Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) |\n| leverage | integer | Used to calculate the margin to be frozen for the order. If you are to close the position, this parameter is not required. |\n| type | string | specify if the order is an 'limit' order or 'market' order |\n| remark | string | remark for the order, length cannot exceed 100 utf8 characters |\n| stop | string | Either 'down' or 'up'. If stop is used,parameter stopPrice and stopPriceType also need to be provieded. |\n| stopPriceType | string | Either 'TP', 'IP' or 'MP', Need to be defined if stop is specified. |\n| stopPrice | string | Need to be defined if stop is specified. |\n| reduceOnly | boolean | A mark to reduce the position size only. Set to false by default. Need to set the position size when reduceOnly is true. If set to true, only the orders reducing the position size will be executed. If the reduce-only order size exceeds the position size, the extra size will be canceled. |\n| closeOrder | boolean | A mark to close the position. Set to false by default. If closeOrder is set to true, the system will close the position and the position size will become 0. Side, Size and Leverage fields can be left empty and the system will determine the side and size automatically. |\n| forceHold | boolean | A mark to forcely hold the funds for an order, even though it's an order to reduce the position size. This helps the order stay on the order book and not get canceled when the position size changes. Set to false by default. The system will forcely freeze certain amount of funds for this order, including orders whose direction is opposite to the current positions. This feature is to ensure that the order won’t be canceled by the matching engine in such a circumstance that not enough funds are frozen for the order. |\n| stp | string | [Self Trade Prevention](https://www.kucoin.com/docs-new/doc-338146) is divided into these strategies: CN, CO, CB. Not supported DC at the moment. |\n| marginMode | string | Margin mode: ISOLATED, CROSS, default: ISOLATED |\n| price | string | Required for type is 'limit' order, indicating the operating price |\n| size | integer | **Choose one of size, qty, valueQty**, Order size (Lot), must be a positive integer. The quantity unit of coin-swap contracts is size(lot), and other units are not supported. |\n| timeInForce | string | Optional for type is 'limit' order, [Time in force](https://www.kucoin.com/docs-new/doc-338146) is a special strategy used during trading, default is GTC |\n| postOnly | boolean | Optional for type is 'limit' order, post only flag, invalid when timeInForce is IOC. When postOnly is true, not allowed choose hidden or iceberg. The post-only flag ensures that the trader always pays the maker fee and provides liquidity to the order book. If any part of the order is going to pay taker fee, the order will be fully rejected. |\n| hidden | boolean | Optional for type is 'limit' order, orders not displaying in order book. When hidden chose, not allowed choose postOnly. |\n| iceberg | boolean | Optional for type is 'limit' order, Only visible portion of the order is displayed in the order book. When iceberg chose, not allowed choose postOnly. |\n| visibleSize | string | Optional for type is 'limit' order, The maximum visible size of an iceberg order. please place order in size (lots), The units of qty (base currency) and valueQty (value) are not supported. |\n| qty | string | **Choose one of size, qty, valueQty**, Order size (Base currency) must be an integer multiple of the multiplier. The unit of the quantity of coin-swap is size(lot), which is not supported |\n| valueQty | string | **Choose one of size, qty, valueQty**, Order size (Value), USDS-Swap correspond to USDT or USDC. The unit of the quantity of coin-swap is size(lot), which is not supported |\n\n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| orderId | string | The unique order id generated by the trading system,which can be used later for further actions such as canceling the order. |\n| clientOid | string | The user self-defined order id. |\n\n---\n", + "body": { + "mode": "raw", + "raw": "{\n \"clientOid\": \"5c52e11203aa677f33e493fb\",\n \"side\": \"buy\",\n \"symbol\": \"XBTUSDTM\",\n \"leverage\": 3,\n \"type\": \"limit\",\n \"remark\": \"order remarks\",\n \"reduceOnly\": false,\n \"marginMode\": \"ISOLATED\",\n \"price\": \"0.1\",\n \"size\": 1,\n \"timeInForce\": \"GTC\"\n}", + "options": { + "raw": { + "language": "json" + } + } + } }, "response": [ { "name": "Successful Response", "originalRequest": { - "method": "GET", + "method": "POST", "header": [], "url": { "raw": "", @@ -13208,55 +13087,9 @@ "path": [ "api", "v1", - "fills" + "orders" ], - "query": [ - { - "key": "orderId", - "value": "236655147005071361", - "description": "List fills for a specific order only (If you specify orderId, other parameters can be ignored)" - }, - { - "key": "symbol", - "value": null, - "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) " - }, - { - "key": "side", - "value": null, - "description": "Order side" - }, - { - "key": "type", - "value": null, - "description": "Order Type" - }, - { - "key": "tradeTypes", - "value": null, - "description": "Transaction type: trade, adl, liquid, settlement. Supports querying multiple types at the same time, separated by commas. Query all type when empty" - }, - { - "key": "startAt", - "value": null, - "description": "Start time (milisecond)" - }, - { - "key": "endAt", - "value": null, - "description": "End time (milisecond)" - }, - { - "key": "currentPage", - "value": null, - "description": "Current request page, The default currentPage is 1" - }, - { - "key": "pageSize", - "value": null, - "description": "pageSize, The default pageSize is 50, The maximum cannot exceed 1000" - } - ] + "query": [] } }, "status": "OK", @@ -13289,12 +13122,12 @@ } ], "cookie": [], - "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"currentPage\": 1,\n \"pageSize\": 50,\n \"totalNum\": 2,\n \"totalPage\": 1,\n \"items\": [\n {\n \"symbol\": \"XBTUSDTM\",\n \"tradeId\": \"1784277229880\",\n \"orderId\": \"236317213710184449\",\n \"side\": \"buy\",\n \"liquidity\": \"taker\",\n \"forceTaker\": false,\n \"price\": \"67430.9\",\n \"size\": 1,\n \"value\": \"67.4309\",\n \"openFeePay\": \"0.04045854\",\n \"closeFeePay\": \"0\",\n \"stop\": \"\",\n \"feeRate\": \"0.00060\",\n \"fixFee\": \"0\",\n \"feeCurrency\": \"USDT\",\n \"marginMode\": \"ISOLATED\",\n \"settleCurrency\": \"USDT\",\n \"fee\": \"0.04045854\",\n \"orderType\": \"market\",\n \"displayType\": \"market\",\n \"tradeType\": \"trade\",\n \"subTradeType\": null,\n \"tradeTime\": 1729155616320000000,\n \"createdAt\": 1729155616493\n },\n {\n \"symbol\": \"XBTUSDTM\",\n \"tradeId\": \"1784277132002\",\n \"orderId\": \"236317094436728832\",\n \"side\": \"buy\",\n \"liquidity\": \"taker\",\n \"forceTaker\": false,\n \"price\": \"67445\",\n \"size\": 1,\n \"value\": \"67.445\",\n \"openFeePay\": \"0\",\n \"closeFeePay\": \"0.040467\",\n \"stop\": \"\",\n \"feeRate\": \"0.00060\",\n \"fixFee\": \"0\",\n \"feeCurrency\": \"USDT\",\n \"marginMode\": \"ISOLATED\",\n \"settleCurrency\": \"USDT\",\n \"fee\": \"0.040467\",\n \"orderType\": \"market\",\n \"displayType\": \"market\",\n \"tradeType\": \"trade\",\n \"subTradeType\": null,\n \"tradeTime\": 1729155587944000000,\n \"createdAt\": 1729155588104\n }\n ]\n }\n}" + "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"orderId\": \"234125150956625920\",\n \"clientOid\": \"5c52e11203aa677f33e493fb\"\n }\n}" } ] }, { - "name": "Batch Add Orders", + "name": "Add Order Test", "request": { "method": "POST", "header": [], @@ -13308,14 +13141,14 @@ "api", "v1", "orders", - "multi" + "test" ], "query": [] }, - "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470236)\n\n:::info[Description]\nPlace multiple order to the futures trading system, you can place two major types of orders: limit and market. Orders can only be placed if your account has sufficient funds. Once an order is placed, your funds will be put on hold for the duration of the order. The amount of funds on hold depends on the order type and parameters specified.\nYou can place up to 20 orders at one time, including limit orders, market orders, and stop orders\n\nPlease be noted that the system would hold the fees from the orders entered the orderbook in advance.\n\nDo NOT include extra spaces in JSON strings.\n\nPlace Order Limit\nThe maximum limit orders for a single contract is 100 per account, and the maximum stop orders for a single contract is 50 per account.\n:::\n\n:::tip[Tips]\n- The maximum limit orders for a single contract is 100 per account, and the maximum stop orders for a single contract is 50 per account.\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| clientOid | string | Unique order id created by users to identify their orders, the maximum length cannot exceed 40, e.g. UUID, Only allows numbers, characters, underline(_), and separator(-) |\n| side | string | specify if the order is to 'buy' or 'sell' |\n| symbol | string | Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-221752070) |\n| leverage | integer | Used to calculate the margin to be frozen for the order. If you are to close the position, this parameter is not required. |\n| type | string | specify if the order is an 'limit' order or 'market' order |\n| remark | string | remark for the order, length cannot exceed 100 utf8 characters |\n| stop | string | Either 'down' or 'up'. If stop is used,parameter stopPrice and stopPriceType also need to be provieded. |\n| stopPriceType | string | Either 'TP', 'IP' or 'MP', Need to be defined if stop is specified. |\n| stopPrice | string | Need to be defined if stop is specified. |\n| reduceOnly | boolean | A mark to reduce the position size only. Set to false by default. Need to set the position size when reduceOnly is true. If set to true, only the orders reducing the position size will be executed. If the reduce-only order size exceeds the position size, the extra size will be canceled. |\n| closeOrder | boolean | A mark to close the position. Set to false by default. If closeOrder is set to true, the system will close the position and the position size will become 0. Side, Size and Leverage fields can be left empty and the system will determine the side and size automatically. |\n| forceHold | boolean | A mark to forcely hold the funds for an order, even though it's an order to reduce the position size. This helps the order stay on the order book and not get canceled when the position size changes. Set to false by default. The system will forcely freeze certain amount of funds for this order, including orders whose direction is opposite to the current positions. This feature is to ensure that the order won’t be canceled by the matching engine in such a circumstance that not enough funds are frozen for the order. |\n| stp | string | [Self Trade Prevention](https://www.kucoin.com/docs-new/doc-338146) is divided into these strategies: CN, CO, CB. Not supported DC at the moment. |\n| marginMode | string | Margin mode: ISOLATED, CROSS, default: ISOLATED |\n| price | string | Required for type is 'limit' order, indicating the operating price |\n| size | integer | **Choose one of size, qty, valueQty**, Order size (Lot), must be a positive integer. The quantity unit of coin-swap contracts is size(lot), and other units are not supported. |\n| timeInForce | string | Optional for type is 'limit' order, [Time in force](https://www.kucoin.com/docs-new/doc-338146) is a special strategy used during trading, default is GTC |\n| postOnly | boolean | Optional for type is 'limit' order, post only flag, invalid when timeInForce is IOC. When postOnly is true, not allowed choose hidden or iceberg. The post-only flag ensures that the trader always pays the maker fee and provides liquidity to the order book. If any part of the order is going to pay taker fee, the order will be fully rejected. |\n| hidden | boolean | Optional for type is 'limit' order, orders not displaying in order book. When hidden chose, not allowed choose postOnly. |\n| iceberg | boolean | Optional for type is 'limit' order, Only visible portion of the order is displayed in the order book. When iceberg chose, not allowed choose postOnly. |\n| visibleSize | string | Optional for type is 'limit' order, The maximum visible size of an iceberg order. please place order in size (lots), The units of qty (base currency) and valueQty (value) are not supported. |\n| qty | string | **Choose one of size, qty, valueQty**, Order size (Base currency) must be an integer multiple of the multiplier. The unit of the quantity of coin-swap is size(lot), which is not supported |\n| valueQty | string | **Choose one of size, qty, valueQty**, Order size (Value), USDS-Swap correspond to USDT or USDC. The unit of the quantity of coin-swap is size(lot), which is not supported |\n\n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | array | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| orderId | string | The unique order id generated by the trading system,which can be used later for further actions such as canceling the order. |\n| clientOid | string | Unique order id created by users to identify their orders, the maximum length cannot exceed 40, e.g. UUID, Only allows numbers, characters, underline(_), and separator(-) |\n| symbol | string | Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) |\n| code | string | |\n| msg | string | |\n\n---\n", + "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470238)\n\n:::info[Description]\nOrder test endpoint, the request parameters and return parameters of this endpoint are exactly the same as the order endpoint, and can be used to verify whether the signature is correct and other operations. After placing an order, the order will not enter the matching system, and the order cannot be queried.\n:::\n\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| clientOid | string | Unique order id created by users to identify their orders, the maximum length cannot exceed 40, e.g. UUID, Only allows numbers, characters, underline(_), and separator(-) |\n| side | string | specify if the order is to 'buy' or 'sell' |\n| symbol | string | Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) |\n| leverage | integer | Used to calculate the margin to be frozen for the order. If you are to close the position, this parameter is not required. |\n| type | string | specify if the order is an 'limit' order or 'market' order |\n| remark | string | remark for the order, length cannot exceed 100 utf8 characters |\n| stop | string | Either 'down' or 'up'. If stop is used,parameter stopPrice and stopPriceType also need to be provieded. |\n| stopPriceType | string | Either 'TP', 'IP' or 'MP', Need to be defined if stop is specified. |\n| stopPrice | string | Need to be defined if stop is specified. |\n| reduceOnly | boolean | A mark to reduce the position size only. Set to false by default. Need to set the position size when reduceOnly is true. If set to true, only the orders reducing the position size will be executed. If the reduce-only order size exceeds the position size, the extra size will be canceled. |\n| closeOrder | boolean | A mark to close the position. Set to false by default. If closeOrder is set to true, the system will close the position and the position size will become 0. Side, Size and Leverage fields can be left empty and the system will determine the side and size automatically. |\n| forceHold | boolean | A mark to forcely hold the funds for an order, even though it's an order to reduce the position size. This helps the order stay on the order book and not get canceled when the position size changes. Set to false by default. The system will forcely freeze certain amount of funds for this order, including orders whose direction is opposite to the current positions. This feature is to ensure that the order won’t be canceled by the matching engine in such a circumstance that not enough funds are frozen for the order. |\n| stp | string | [Self Trade Prevention](https://www.kucoin.com/docs-new/doc-338146) is divided into these strategies: CN, CO, CB. Not supported DC at the moment. |\n| marginMode | string | Margin mode: ISOLATED, CROSS, default: ISOLATED |\n| price | string | Required for type is 'limit' order, indicating the operating price |\n| size | integer | **Choose one of size, qty, valueQty**, Order size (Lot), must be a positive integer. The quantity unit of coin-swap contracts is size(lot), and other units are not supported. |\n| timeInForce | string | Optional for type is 'limit' order, [Time in force](https://www.kucoin.com/docs-new/doc-338146) is a special strategy used during trading, default is GTC |\n| postOnly | boolean | Optional for type is 'limit' order, post only flag, invalid when timeInForce is IOC. When postOnly is true, not allowed choose hidden or iceberg. The post-only flag ensures that the trader always pays the maker fee and provides liquidity to the order book. If any part of the order is going to pay taker fee, the order will be fully rejected. |\n| hidden | boolean | Optional for type is 'limit' order, orders not displaying in order book. When hidden chose, not allowed choose postOnly. |\n| iceberg | boolean | Optional for type is 'limit' order, Only visible portion of the order is displayed in the order book. When iceberg chose, not allowed choose postOnly. |\n| visibleSize | string | Optional for type is 'limit' order, The maximum visible size of an iceberg order. please place order in size (lots), The units of qty (base currency) and valueQty (value) are not supported. |\n| qty | string | **Choose one of size, qty, valueQty**, Order size (Base currency) must be an integer multiple of the multiplier. The unit of the quantity of coin-swap is size(lot), which is not supported |\n| valueQty | string | **Choose one of size, qty, valueQty**, Order size (Value), USDS-Swap correspond to USDT or USDC. The unit of the quantity of coin-swap is size(lot), which is not supported |\n\n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| orderId | string | The unique order id generated by the trading system,which can be used later for further actions such as canceling the order. |\n| clientOid | string | The user self-defined order id. |\n\n---\n", "body": { "mode": "raw", - "raw": "[\n {\n \"clientOid\": \"5c52e11203aa677f33e493fb\",\n \"side\": \"buy\",\n \"symbol\": \"XBTUSDTM\",\n \"leverage\": 3,\n \"type\": \"limit\",\n \"remark\": \"order remarks\",\n \"reduceOnly\": false,\n \"marginMode\": \"ISOLATED\",\n \"price\": \"0.1\",\n \"size\": 1,\n \"timeInForce\": \"GTC\"\n },\n {\n \"clientOid\": \"5c52e11203aa677f33e493fc\",\n \"side\": \"buy\",\n \"symbol\": \"XBTUSDTM\",\n \"leverage\": 3,\n \"type\": \"limit\",\n \"remark\": \"order remarks\",\n \"reduceOnly\": false,\n \"marginMode\": \"ISOLATED\",\n \"price\": \"0.1\",\n \"size\": 1,\n \"timeInForce\": \"GTC\"\n }\n]", + "raw": "{\n \"clientOid\": \"5c52e11203aa677f33e493fb\",\n \"side\": \"buy\",\n \"symbol\": \"XBTUSDTM\",\n \"leverage\": 3,\n \"type\": \"limit\",\n \"remark\": \"order remarks\",\n \"reduceOnly\": false,\n \"marginMode\": \"ISOLATED\",\n \"price\": \"0.1\",\n \"size\": 1,\n \"timeInForce\": \"GTC\"\n}", "options": { "raw": { "language": "json" @@ -13339,7 +13172,7 @@ "api", "v1", "orders", - "multi" + "test" ], "query": [] } @@ -13374,14 +13207,14 @@ } ], "cookie": [], - "body": "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"orderId\": \"235919387779985408\",\n \"clientOid\": \"5c52e11203aa677f33e493fb\",\n \"symbol\": \"XBTUSDTM\",\n \"code\": \"200000\",\n \"msg\": \"success\"\n },\n {\n \"orderId\": \"235919387855482880\",\n \"clientOid\": \"5c52e11203aa677f33e493fc\",\n \"symbol\": \"XBTUSDTM\",\n \"code\": \"200000\",\n \"msg\": \"success\"\n }\n ]\n}" + "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"orderId\": \"234125150956625920\",\n \"clientOid\": \"5c52e11203aa677f33e493fb\"\n }\n}" } ] }, { - "name": "Get Recent Trade History", + "name": "Batch Add Orders", "request": { - "method": "GET", + "method": "POST", "header": [], "url": { "raw": "", @@ -13392,24 +13225,27 @@ "path": [ "api", "v1", - "recentFills" + "orders", + "multi" ], - "query": [ - { - "key": "symbol", - "value": "XBTUSDTM", - "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) " - } - ] + "query": [] }, - "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470249)\n\n:::info[Description]\nGet a list of recent 1000 fills in the last 24 hours. If you need to get your recent traded order history with low latency, you may query this endpoint.\n\nIf you need to get your recent traded order history with low latency, you may query this endpoint.\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | array | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| symbol | string | Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) |\n| tradeId | string | Trade ID
|\n| orderId | string | Order ID
|\n| side | string | Transaction side
|\n| liquidity | string | Liquidity- taker or maker
|\n| forceTaker | boolean | Whether to force processing as a taker
|\n| price | string | Filled price
|\n| size | integer | Filled amount
|\n| value | string | Order value
|\n| openFeePay | string | Opening transaction fee
|\n| closeFeePay | string | Closing transaction fee
|\n| stop | string | A mark to the stop order type
|\n| feeRate | string | Fee Rate |\n| fixFee | string | Fixed fees(Deprecated field, no actual use of the value field)
|\n| feeCurrency | string | Charging currency
|\n| tradeTime | integer | trade time in nanosecond
|\n| subTradeType | string | Deprecated field, no actual use of the value field |\n| marginMode | string | Margin mode: ISOLATED (isolated), CROSS (cross margin).
|\n| displayType | string | Order Type |\n| fee | string | Transaction fee
|\n| settleCurrency | string | Settle Currency |\n| orderType | string | Order type
|\n| tradeType | string | Trade type (trade, liquid, cancel, adl or settlement)
|\n| createdAt | integer | Time the order created
|\n\n---\n", - "body": {} + "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470236)\n\n:::info[Description]\nPlace multiple order to the futures trading system, you can place two major types of orders: limit and market. Orders can only be placed if your account has sufficient funds. Once an order is placed, your funds will be put on hold for the duration of the order. The amount of funds on hold depends on the order type and parameters specified.\nYou can place up to 20 orders at one time, including limit orders, market orders, and stop orders\n\nPlease be noted that the system would hold the fees from the orders entered the orderbook in advance.\n\nDo NOT include extra spaces in JSON strings.\n\nPlace Order Limit\nThe maximum limit orders for a single contract is 100 per account, and the maximum stop orders for a single contract is 50 per account.\n:::\n\n:::tip[Tips]\n- The maximum limit orders for a single contract is 100 per account, and the maximum stop orders for a single contract is 50 per account.\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| clientOid | string | Unique order id created by users to identify their orders, the maximum length cannot exceed 40, e.g. UUID, Only allows numbers, characters, underline(_), and separator(-) |\n| side | string | specify if the order is to 'buy' or 'sell' |\n| symbol | string | Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-221752070) |\n| leverage | integer | Used to calculate the margin to be frozen for the order. If you are to close the position, this parameter is not required. |\n| type | string | specify if the order is an 'limit' order or 'market' order |\n| remark | string | remark for the order, length cannot exceed 100 utf8 characters |\n| stop | string | Either 'down' or 'up'. If stop is used,parameter stopPrice and stopPriceType also need to be provieded. |\n| stopPriceType | string | Either 'TP', 'IP' or 'MP', Need to be defined if stop is specified. |\n| stopPrice | string | Need to be defined if stop is specified. |\n| reduceOnly | boolean | A mark to reduce the position size only. Set to false by default. Need to set the position size when reduceOnly is true. If set to true, only the orders reducing the position size will be executed. If the reduce-only order size exceeds the position size, the extra size will be canceled. |\n| closeOrder | boolean | A mark to close the position. Set to false by default. If closeOrder is set to true, the system will close the position and the position size will become 0. Side, Size and Leverage fields can be left empty and the system will determine the side and size automatically. |\n| forceHold | boolean | A mark to forcely hold the funds for an order, even though it's an order to reduce the position size. This helps the order stay on the order book and not get canceled when the position size changes. Set to false by default. The system will forcely freeze certain amount of funds for this order, including orders whose direction is opposite to the current positions. This feature is to ensure that the order won’t be canceled by the matching engine in such a circumstance that not enough funds are frozen for the order. |\n| stp | string | [Self Trade Prevention](https://www.kucoin.com/docs-new/doc-338146) is divided into these strategies: CN, CO, CB. Not supported DC at the moment. |\n| marginMode | string | Margin mode: ISOLATED, CROSS, default: ISOLATED |\n| price | string | Required for type is 'limit' order, indicating the operating price |\n| size | integer | **Choose one of size, qty, valueQty**, Order size (Lot), must be a positive integer. The quantity unit of coin-swap contracts is size(lot), and other units are not supported. |\n| timeInForce | string | Optional for type is 'limit' order, [Time in force](https://www.kucoin.com/docs-new/doc-338146) is a special strategy used during trading, default is GTC |\n| postOnly | boolean | Optional for type is 'limit' order, post only flag, invalid when timeInForce is IOC. When postOnly is true, not allowed choose hidden or iceberg. The post-only flag ensures that the trader always pays the maker fee and provides liquidity to the order book. If any part of the order is going to pay taker fee, the order will be fully rejected. |\n| hidden | boolean | Optional for type is 'limit' order, orders not displaying in order book. When hidden chose, not allowed choose postOnly. |\n| iceberg | boolean | Optional for type is 'limit' order, Only visible portion of the order is displayed in the order book. When iceberg chose, not allowed choose postOnly. |\n| visibleSize | string | Optional for type is 'limit' order, The maximum visible size of an iceberg order. please place order in size (lots), The units of qty (base currency) and valueQty (value) are not supported. |\n| qty | string | **Choose one of size, qty, valueQty**, Order size (Base currency) must be an integer multiple of the multiplier. The unit of the quantity of coin-swap is size(lot), which is not supported |\n| valueQty | string | **Choose one of size, qty, valueQty**, Order size (Value), USDS-Swap correspond to USDT or USDC. The unit of the quantity of coin-swap is size(lot), which is not supported |\n\n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | array | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| orderId | string | The unique order id generated by the trading system,which can be used later for further actions such as canceling the order. |\n| clientOid | string | Unique order id created by users to identify their orders, the maximum length cannot exceed 40, e.g. UUID, Only allows numbers, characters, underline(_), and separator(-) |\n| symbol | string | Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) |\n| code | string | |\n| msg | string | |\n\n---\n", + "body": { + "mode": "raw", + "raw": "[\n {\n \"clientOid\": \"5c52e11203aa677f33e493fb\",\n \"side\": \"buy\",\n \"symbol\": \"XBTUSDTM\",\n \"leverage\": 3,\n \"type\": \"limit\",\n \"remark\": \"order remarks\",\n \"reduceOnly\": false,\n \"marginMode\": \"ISOLATED\",\n \"price\": \"0.1\",\n \"size\": 1,\n \"timeInForce\": \"GTC\"\n },\n {\n \"clientOid\": \"5c52e11203aa677f33e493fc\",\n \"side\": \"buy\",\n \"symbol\": \"XBTUSDTM\",\n \"leverage\": 3,\n \"type\": \"limit\",\n \"remark\": \"order remarks\",\n \"reduceOnly\": false,\n \"marginMode\": \"ISOLATED\",\n \"price\": \"0.1\",\n \"size\": 1,\n \"timeInForce\": \"GTC\"\n }\n]", + "options": { + "raw": { + "language": "json" + } + } + } }, "response": [ { "name": "Successful Response", "originalRequest": { - "method": "GET", + "method": "POST", "header": [], "url": { "raw": "", @@ -13420,15 +13256,10 @@ "path": [ "api", "v1", - "recentFills" + "orders", + "multi" ], - "query": [ - { - "key": "symbol", - "value": "XBTUSDTM", - "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) " - } - ] + "query": [] } }, "status": "OK", @@ -13461,7 +13292,7 @@ } ], "cookie": [], - "body": "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"symbol\": \"XBTUSDTM\",\n \"tradeId\": \"1784277229880\",\n \"orderId\": \"236317213710184449\",\n \"side\": \"buy\",\n \"liquidity\": \"taker\",\n \"forceTaker\": false,\n \"price\": \"67430.9\",\n \"size\": 1,\n \"value\": \"67.4309\",\n \"openFeePay\": \"0.04045854\",\n \"closeFeePay\": \"0\",\n \"stop\": \"\",\n \"feeRate\": \"0.00060\",\n \"fixFee\": \"0\",\n \"feeCurrency\": \"USDT\",\n \"marginMode\": \"ISOLATED\",\n \"fee\": \"0.04045854\",\n \"settleCurrency\": \"USDT\",\n \"orderType\": \"market\",\n \"displayType\": \"market\",\n \"tradeType\": \"trade\",\n \"subTradeType\": null,\n \"tradeTime\": 1729155616320000000,\n \"createdAt\": 1729155616493\n },\n {\n \"symbol\": \"XBTUSDTM\",\n \"tradeId\": \"1784277132002\",\n \"orderId\": \"236317094436728832\",\n \"side\": \"buy\",\n \"liquidity\": \"taker\",\n \"forceTaker\": false,\n \"price\": \"67445\",\n \"size\": 1,\n \"value\": \"67.445\",\n \"openFeePay\": \"0\",\n \"closeFeePay\": \"0.040467\",\n \"stop\": \"\",\n \"feeRate\": \"0.00060\",\n \"fixFee\": \"0\",\n \"feeCurrency\": \"USDT\",\n \"marginMode\": \"ISOLATED\",\n \"fee\": \"0.040467\",\n \"settleCurrency\": \"USDT\",\n \"orderType\": \"market\",\n \"displayType\": \"market\",\n \"tradeType\": \"trade\",\n \"subTradeType\": null,\n \"tradeTime\": 1729155587944000000,\n \"createdAt\": 1729155588104\n }\n ]\n}" + "body": "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"orderId\": \"235919387779985408\",\n \"clientOid\": \"5c52e11203aa677f33e493fb\",\n \"symbol\": \"XBTUSDTM\",\n \"code\": \"200000\",\n \"msg\": \"success\"\n },\n {\n \"orderId\": \"235919387855482880\",\n \"clientOid\": \"5c52e11203aa677f33e493fc\",\n \"symbol\": \"XBTUSDTM\",\n \"code\": \"200000\",\n \"msg\": \"success\"\n }\n ]\n}" } ] }, @@ -13549,9 +13380,9 @@ ] }, { - "name": "Get Open Order Value", + "name": "Cancel Order By OrderId", "request": { - "method": "GET", + "method": "DELETE", "header": [], "url": { "raw": "", @@ -13562,24 +13393,19 @@ "path": [ "api", "v1", - "openOrderStatistics" + "orders", + "{{orderId}}" ], - "query": [ - { - "key": "symbol", - "value": "XBTUSDTM", - "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) " - } - ] + "query": [] }, - "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470250)\n\n:::info[Description]\nYou can query this endpoint to get the the total number and value of the all your active orders.\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| openOrderBuySize | integer | Total number of the unexecuted buy orders
|\n| openOrderSellSize | integer | Total number of the unexecuted sell orders
|\n| openOrderBuyCost | string | Value of all the unexecuted buy orders
|\n| openOrderSellCost | string | Value of all the unexecuted sell orders
|\n| settleCurrency | string | settlement currency
|\n\n---\n", + "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470239)\n\n:::info[Description]\nCancel an order (including a stop order).\n\nYou will receive success message once the system has received the cancellation request. The cancellation request will be processed by matching engine in sequence. To know if the request has been processed, you may check the order status or update message from the websocket pushes.\n\nThe `orderId` is the server-assigned order id, not the specified clientOid.\n\nIf the order can not be canceled (already filled or previously canceled, etc), then an error response will indicate the reason in the message field.\n:::\n\n**API KEY PERMISSIONS**\nThis endpoint requires the Futures Trading permission.\n\n**REQUEST URL**\nThis endpoint support Futures URL\n\n**REQUEST RATE LIMIT**\nFutures weight:1\n\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| cancelledOrderIds | array | Refer to the schema section of cancelledOrderIds |\n\n---\n", "body": {} }, "response": [ { "name": "Successful Response", "originalRequest": { - "method": "GET", + "method": "DELETE", "header": [], "url": { "raw": "", @@ -13590,15 +13416,10 @@ "path": [ "api", "v1", - "openOrderStatistics" + "orders", + "{{orderId}}" ], - "query": [ - { - "key": "symbol", - "value": "XBTUSDTM", - "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) " - } - ] + "query": [] } }, "status": "OK", @@ -13631,14 +13452,14 @@ } ], "cookie": [], - "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"openOrderBuySize\": 1,\n \"openOrderSellSize\": 0,\n \"openOrderBuyCost\": \"0.0001\",\n \"openOrderSellCost\": \"0\",\n \"settleCurrency\": \"USDT\"\n }\n}" + "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"cancelledOrderIds\": [\n \"235303670076489728\"\n ]\n }\n}" } ] }, { - "name": "Add Order Test", + "name": "Cancel Order By ClientOid", "request": { - "method": "POST", + "method": "DELETE", "header": [], "url": { "raw": "", @@ -13650,26 +13471,25 @@ "api", "v1", "orders", - "test" + "client-order", + "{{clientOid}}" ], - "query": [] - }, - "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470238)\n\n:::info[Description]\nOrder test endpoint, the request parameters and return parameters of this endpoint are exactly the same as the order endpoint, and can be used to verify whether the signature is correct and other operations. After placing an order, the order will not enter the matching system, and the order cannot be queried.\n:::\n\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| clientOid | string | Unique order id created by users to identify their orders, the maximum length cannot exceed 40, e.g. UUID, Only allows numbers, characters, underline(_), and separator(-) |\n| side | string | specify if the order is to 'buy' or 'sell' |\n| symbol | string | Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) |\n| leverage | integer | Used to calculate the margin to be frozen for the order. If you are to close the position, this parameter is not required. |\n| type | string | specify if the order is an 'limit' order or 'market' order |\n| remark | string | remark for the order, length cannot exceed 100 utf8 characters |\n| stop | string | Either 'down' or 'up'. If stop is used,parameter stopPrice and stopPriceType also need to be provieded. |\n| stopPriceType | string | Either 'TP', 'IP' or 'MP', Need to be defined if stop is specified. |\n| stopPrice | string | Need to be defined if stop is specified. |\n| reduceOnly | boolean | A mark to reduce the position size only. Set to false by default. Need to set the position size when reduceOnly is true. If set to true, only the orders reducing the position size will be executed. If the reduce-only order size exceeds the position size, the extra size will be canceled. |\n| closeOrder | boolean | A mark to close the position. Set to false by default. If closeOrder is set to true, the system will close the position and the position size will become 0. Side, Size and Leverage fields can be left empty and the system will determine the side and size automatically. |\n| forceHold | boolean | A mark to forcely hold the funds for an order, even though it's an order to reduce the position size. This helps the order stay on the order book and not get canceled when the position size changes. Set to false by default. The system will forcely freeze certain amount of funds for this order, including orders whose direction is opposite to the current positions. This feature is to ensure that the order won’t be canceled by the matching engine in such a circumstance that not enough funds are frozen for the order. |\n| stp | string | [Self Trade Prevention](https://www.kucoin.com/docs-new/doc-338146) is divided into these strategies: CN, CO, CB. Not supported DC at the moment. |\n| marginMode | string | Margin mode: ISOLATED, CROSS, default: ISOLATED |\n| price | string | Required for type is 'limit' order, indicating the operating price |\n| size | integer | **Choose one of size, qty, valueQty**, Order size (Lot), must be a positive integer. The quantity unit of coin-swap contracts is size(lot), and other units are not supported. |\n| timeInForce | string | Optional for type is 'limit' order, [Time in force](https://www.kucoin.com/docs-new/doc-338146) is a special strategy used during trading, default is GTC |\n| postOnly | boolean | Optional for type is 'limit' order, post only flag, invalid when timeInForce is IOC. When postOnly is true, not allowed choose hidden or iceberg. The post-only flag ensures that the trader always pays the maker fee and provides liquidity to the order book. If any part of the order is going to pay taker fee, the order will be fully rejected. |\n| hidden | boolean | Optional for type is 'limit' order, orders not displaying in order book. When hidden chose, not allowed choose postOnly. |\n| iceberg | boolean | Optional for type is 'limit' order, Only visible portion of the order is displayed in the order book. When iceberg chose, not allowed choose postOnly. |\n| visibleSize | string | Optional for type is 'limit' order, The maximum visible size of an iceberg order. please place order in size (lots), The units of qty (base currency) and valueQty (value) are not supported. |\n| qty | string | **Choose one of size, qty, valueQty**, Order size (Base currency) must be an integer multiple of the multiplier. The unit of the quantity of coin-swap is size(lot), which is not supported |\n| valueQty | string | **Choose one of size, qty, valueQty**, Order size (Value), USDS-Swap correspond to USDT or USDC. The unit of the quantity of coin-swap is size(lot), which is not supported |\n\n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| orderId | string | The unique order id generated by the trading system,which can be used later for further actions such as canceling the order. |\n| clientOid | string | The user self-defined order id. |\n\n---\n", - "body": { - "mode": "raw", - "raw": "{\n \"clientOid\": \"5c52e11203aa677f33e493fb\",\n \"side\": \"buy\",\n \"symbol\": \"XBTUSDTM\",\n \"leverage\": 3,\n \"type\": \"limit\",\n \"remark\": \"order remarks\",\n \"reduceOnly\": false,\n \"marginMode\": \"ISOLATED\",\n \"price\": \"0.1\",\n \"size\": 1,\n \"timeInForce\": \"GTC\"\n}", - "options": { - "raw": { - "language": "json" + "query": [ + { + "key": "symbol", + "value": "XBTUSDTM", + "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) " } - } - } + ] + }, + "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470240)\n\n:::info[Description]\nCancel an order (including a stop order).\n\nYou will receive success message once the system has received the cancellation request. The cancellation request will be processed by matching engine in sequence. To know if the request has been processed, you may check the order status or update message from the pushes.\n\nResponse the ID created by the client (clientOid).\n\nIf the order can not be canceled (already filled or previously canceled, etc), then an error response will indicate the reason in the message field.\n:::\n\n**API KEY PERMISSIONS**\nThis endpoint requires the Futures Trading permission.\n\n**REQUEST URL**\nThis endpoint support Futures URL\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| clientOid | string | |\n\n---\n", + "body": {} }, "response": [ { "name": "Successful Response", "originalRequest": { - "method": "POST", + "method": "DELETE", "header": [], "url": { "raw": "", @@ -13681,9 +13501,16 @@ "api", "v1", "orders", - "test" + "client-order", + "{{clientOid}}" ], - "query": [] + "query": [ + { + "key": "symbol", + "value": "XBTUSDTM", + "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) " + } + ] } }, "status": "OK", @@ -13716,12 +13543,12 @@ } ], "cookie": [], - "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"orderId\": \"234125150956625920\",\n \"clientOid\": \"5c52e11203aa677f33e493fb\"\n }\n}" + "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"clientOid\": \"017485b0-2957-4681-8a14-5d46b35aee0d\"\n }\n}" } ] }, { - "name": "Cancel Order By OrderId", + "name": "Batch Cancel Orders", "request": { "method": "DELETE", "header": [], @@ -13735,12 +13562,20 @@ "api", "v1", "orders", - "{{orderId}}" + "multi-cancel" ], "query": [] }, - "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470239)\n\n:::info[Description]\nCancel an order (including a stop order).\n\nYou will receive success message once the system has received the cancellation request. The cancellation request will be processed by matching engine in sequence. To know if the request has been processed, you may check the order status or update message from the websocket pushes.\n\nThe `orderId` is the server-assigned order id, not the specified clientOid.\n\nIf the order can not be canceled (already filled or previously canceled, etc), then an error response will indicate the reason in the message field.\n:::\n\n**API KEY PERMISSIONS**\nThis endpoint requires the Futures Trading permission.\n\n**REQUEST URL**\nThis endpoint support Futures URL\n\n**REQUEST RATE LIMIT**\nFutures weight:1\n\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| cancelledOrderIds | array | Refer to the schema section of cancelledOrderIds |\n\n---\n", - "body": {} + "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470241)\n\n:::info[Description]\nUsing this endpoint, orders can be canceled in batches, If there are both normal orders and conditional orders with the same clientOid (it is not recommended to use the same clientOrderId), when cancelling orders in batches by clientOid, normal orders will be canceled and conditional orders will be retained.\n\nSupports batch cancellation of orders by orderId or clientOid. When orderIdsList and clientOidsList are used at the same time, orderIdsList shall prevail. A maximum of 10 orders can be canceled at a time.\n\nWhen using orderId to cancel order, the response will return the orderId.\nWhen using clientOid to cancel order, the response will return the clientOid.\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| orderIdsList | array | Refer to the schema section of orderIdsList |\n| clientOidsList | array | Refer to the schema section of clientOidsList |\n\n**root.clientOidsList Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| symbol | string | Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) |\n| clientOid | string | |\n\n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | array | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| orderId | string | |\n| clientOid | string | |\n| code | string | |\n| msg | string | |\n\n---\n", + "body": { + "mode": "raw", + "raw": "{\n \"orderIdsList\":\n [\n \"250445104152670209\",\n \"250445181751463936\"\n ]\n}\n\n\n//{\n// \"clientOidsList\":\n// [\n// {\n// \"symbol\": \"XRPUSDTM\",\n// \"clientOid\": \"5c52e11203aa1677f133e493fb\"\n// },\n// {\n// \"symbol\": \"ETHUSDTM\",\n// \"clientOid\": \"5c52214e112\"\n// }\n// ]\n//}\n", + "options": { + "raw": { + "language": "json" + } + } + } }, "response": [ { @@ -13758,7 +13593,7 @@ "api", "v1", "orders", - "{{orderId}}" + "multi-cancel" ], "query": [] } @@ -13793,12 +13628,12 @@ } ], "cookie": [], - "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"cancelledOrderIds\": [\n \"235303670076489728\"\n ]\n }\n}" + "body": "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"orderId\": \"250445104152670209\",\n \"clientOid\": null,\n \"code\": \"200\",\n \"msg\": \"success\"\n },\n {\n \"orderId\": \"250445181751463936\",\n \"clientOid\": null,\n \"code\": \"200\",\n \"msg\": \"success\"\n }\n ]\n}\n\n//{\n// \"code\": \"200000\",\n// \"data\": [\n// {\n// \"orderId\": null,\n// \"clientOid\": \"5c52e11203aa1677f133e493fb\",\n// \"code\": \"200\",\n// \"msg\": \"success\"\n// },\n// {\n// \"orderId\": null,\n// \"clientOid\": \"5c52214e112\",\n// \"code\": \"200\",\n// \"msg\": \"success\"\n// }\n// ]\n//}" } ] }, { - "name": "Cancel Order By ClientOid", + "name": "Cancel All Orders", "request": { "method": "DELETE", "header": [], @@ -13810,20 +13645,18 @@ ], "path": [ "api", - "v1", - "orders", - "client-order", - "{{clientOid}}" + "v3", + "orders" ], "query": [ { "key": "symbol", "value": "XBTUSDTM", - "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) " + "description": "Cancel all limit orders for a specific symbol only, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) " } ] }, - "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470240)\n\n:::info[Description]\nCancel an order (including a stop order).\n\nYou will receive success message once the system has received the cancellation request. The cancellation request will be processed by matching engine in sequence. To know if the request has been processed, you may check the order status or update message from the pushes.\n\nResponse the ID created by the client (clientOid).\n\nIf the order can not be canceled (already filled or previously canceled, etc), then an error response will indicate the reason in the message field.\n:::\n\n**API KEY PERMISSIONS**\nThis endpoint requires the Futures Trading permission.\n\n**REQUEST URL**\nThis endpoint support Futures URL\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| clientOid | string | |\n\n---\n", + "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470242)\n\n:::info[Description]\nUsing this endpoint, all open orders (excluding stop orders) can be canceled in batches.\n\nThe response is a list of orderIDs of the canceled orders.\n:::\n\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| cancelledOrderIds | array | Refer to the schema section of cancelledOrderIds |\n\n---\n", "body": {} }, "response": [ @@ -13840,16 +13673,14 @@ ], "path": [ "api", - "v1", - "orders", - "client-order", - "{{clientOid}}" + "v3", + "orders" ], "query": [ { "key": "symbol", "value": "XBTUSDTM", - "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) " + "description": "Cancel all limit orders for a specific symbol only, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) " } ] } @@ -13884,12 +13715,12 @@ } ], "cookie": [], - "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"clientOid\": \"017485b0-2957-4681-8a14-5d46b35aee0d\"\n }\n}" + "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"cancelledOrderIds\": [\n \"235919172150824960\",\n \"235919172150824961\"\n ]\n }\n}" } ] }, { - "name": "Batch Cancel Orders", + "name": "Cancel All Stop orders", "request": { "method": "DELETE", "header": [], @@ -13902,21 +13733,18 @@ "path": [ "api", "v1", - "orders", - "multi-cancel" + "stopOrders" ], - "query": [] - }, - "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470241)\n\n:::info[Description]\nUsing this endpoint, orders can be canceled in batches, If there are both normal orders and conditional orders with the same clientOid (it is not recommended to use the same clientOrderId), when cancelling orders in batches by clientOid, normal orders will be canceled and conditional orders will be retained.\n\nSupports batch cancellation of orders by orderId or clientOid. When orderIdsList and clientOidsList are used at the same time, orderIdsList shall prevail. A maximum of 10 orders can be canceled at a time.\n\nWhen using orderId to cancel order, the response will return the orderId.\nWhen using clientOid to cancel order, the response will return the clientOid.\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| orderIdsList | array | Refer to the schema section of orderIdsList |\n| clientOidsList | array | Refer to the schema section of clientOidsList |\n\n**root.clientOidsList Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| symbol | string | Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) |\n| clientOid | string | |\n\n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | array | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| orderId | string | |\n| clientOid | string | |\n| code | string | |\n| msg | string | |\n\n---\n", - "body": { - "mode": "raw", - "raw": "{\n \"orderIdsList\":\n [\n \"250445104152670209\",\n \"250445181751463936\"\n ]\n}\n\n\n//{\n// \"clientOidsList\":\n// [\n// {\n// \"symbol\": \"XRPUSDTM\",\n// \"clientOid\": \"5c52e11203aa1677f133e493fb\"\n// },\n// {\n// \"symbol\": \"ETHUSDTM\",\n// \"clientOid\": \"5c52214e112\"\n// }\n// ]\n//}\n", - "options": { - "raw": { - "language": "json" + "query": [ + { + "key": "symbol", + "value": "XBTUSDTM", + "description": "Cancel all limit orders for a specific contract only, If not specified, all the limit orders will be deleted, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) " } - } - } + ] + }, + "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470243)\n\n:::info[Description]\nUsing this endpoint, all untriggered stop orders can be canceled in batches.\n\nSupports batch cancellation of untriggered stop orders by symbol. Cancel all all untriggered stop orders for a specific contract symbol only , If not specified, all the all untriggered stop orders will be canceled.\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| cancelledOrderIds | array | Refer to the schema section of cancelledOrderIds |\n\n---\n", + "body": {} }, "response": [ { @@ -13933,10 +13761,15 @@ "path": [ "api", "v1", - "orders", - "multi-cancel" + "stopOrders" ], - "query": [] + "query": [ + { + "key": "symbol", + "value": "XBTUSDTM", + "description": "Cancel all limit orders for a specific contract only, If not specified, all the limit orders will be deleted, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) " + } + ] } }, "status": "OK", @@ -13969,14 +13802,14 @@ } ], "cookie": [], - "body": "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"orderId\": \"250445104152670209\",\n \"clientOid\": null,\n \"code\": \"200\",\n \"msg\": \"success\"\n },\n {\n \"orderId\": \"250445181751463936\",\n \"clientOid\": null,\n \"code\": \"200\",\n \"msg\": \"success\"\n }\n ]\n}\n\n//{\n// \"code\": \"200000\",\n// \"data\": [\n// {\n// \"orderId\": null,\n// \"clientOid\": \"5c52e11203aa1677f133e493fb\",\n// \"code\": \"200\",\n// \"msg\": \"success\"\n// },\n// {\n// \"orderId\": null,\n// \"clientOid\": \"5c52214e112\",\n// \"code\": \"200\",\n// \"msg\": \"success\"\n// }\n// ]\n//}" + "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"cancelledOrderIds\": [\n \"235919172150824960\",\n \"235919172150824961\"\n ]\n }\n}" } ] }, { - "name": "Cancel All Orders", + "name": "Get Order By OrderId", "request": { - "method": "DELETE", + "method": "GET", "header": [], "url": { "raw": "", @@ -13986,25 +13819,20 @@ ], "path": [ "api", - "v3", - "orders" + "v1", + "orders", + "{{order-id}}" ], - "query": [ - { - "key": "symbol", - "value": "XBTUSDTM", - "description": "Cancel all limit orders for a specific contract only, If not specified, all the limit orders will be deleted, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) " - } - ] + "query": [] }, - "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470242)\n\n:::info[Description]\nUsing this endpoint, all open orders (excluding stop orders) can be canceled in batches.\n\nThe response is a list of orderIDs of the canceled orders.\n:::\n\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| cancelledOrderIds | array | Refer to the schema section of cancelledOrderIds |\n\n---\n", + "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470245)\n\n:::info[Description]\nGet a single order by order id (including a stop order).\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| id | string | Order ID |\n| symbol | string | Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) |\n| type | string | Order type, market order or limit order |\n| side | string | Transaction side |\n| price | string | Order price |\n| size | integer | Order quantity |\n| value | string | Order value
|\n| dealValue | string | Executed size of funds
|\n| dealSize | integer | Executed quantity
|\n| stp | string | [Self Trade Prevention](https://www.kucoin.com/docs-new/doc-338146) is divided into these strategies: CN, CO, CB. Not supported DC at the moment. |\n| stop | string | Stop order type (stop limit or stop market)
|\n| stopPriceType | string | Trigger price type of stop orders |\n| stopTriggered | boolean | Mark to show whether the stop order is triggered |\n| stopPrice | number | Trigger price of stop orders |\n| timeInForce | string | Time in force policy type
|\n| postOnly | boolean | Mark of post only
|\n| hidden | boolean | Mark of the hidden order
|\n| iceberg | boolean | Mark of the iceberg order
|\n| leverage | string | Leverage of the order
|\n| forceHold | boolean | A mark to forcely hold the funds for an order
|\n| closeOrder | boolean | A mark to close the position
|\n| visibleSize | integer | Visible size of the iceberg order
|\n| clientOid | string | Unique order id created by users to identify their orders
|\n| remark | string | Remark |\n| tags | string | tag order source
|\n| isActive | boolean | Mark of the active orders
|\n| cancelExist | boolean | Mark of the canceled orders
|\n| createdAt | integer | Time the order created
|\n| updatedAt | integer | last update time
|\n| endAt | integer | Order Endtime |\n| orderTime | integer | Order create time in nanosecond
|\n| settleCurrency | string | settlement currency
|\n| marginMode | string | Margin mode: ISOLATED (isolated), CROSS (cross margin).
|\n| avgDealPrice | string | Average transaction price, forward contract average transaction price = sum (transaction value) / sum (transaction quantity), reverse contract average transaction price = sum (transaction quantity) / sum (transaction value). Transaction quantity = lots * multiplier
|\n| filledSize | integer | Value of the executed orders
|\n| filledValue | string | Executed order quantity
|\n| status | string | order status: “open” or “done”
|\n| reduceOnly | boolean | A mark to reduce the position size only
|\n\n---\n", "body": {} }, "response": [ { "name": "Successful Response", "originalRequest": { - "method": "DELETE", + "method": "GET", "header": [], "url": { "raw": "", @@ -14014,16 +13842,11 @@ ], "path": [ "api", - "v3", - "orders" + "v1", + "orders", + "{{order-id}}" ], - "query": [ - { - "key": "symbol", - "value": "XBTUSDTM", - "description": "Cancel all limit orders for a specific contract only, If not specified, all the limit orders will be deleted, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) " - } - ] + "query": [] } }, "status": "OK", @@ -14056,14 +13879,14 @@ } ], "cookie": [], - "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"cancelledOrderIds\": [\n \"235919172150824960\",\n \"235919172150824961\"\n ]\n }\n}" + "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"id\": \"236655147005071361\",\n \"symbol\": \"XBTUSDTM\",\n \"type\": \"limit\",\n \"side\": \"buy\",\n \"price\": \"0.1\",\n \"size\": 1,\n \"value\": \"0.0001\",\n \"dealValue\": \"0\",\n \"dealSize\": 0,\n \"stp\": \"\",\n \"stop\": \"\",\n \"stopPriceType\": \"\",\n \"stopTriggered\": false,\n \"stopPrice\": null,\n \"timeInForce\": \"GTC\",\n \"postOnly\": false,\n \"hidden\": false,\n \"iceberg\": false,\n \"leverage\": \"3\",\n \"forceHold\": false,\n \"closeOrder\": false,\n \"visibleSize\": 0,\n \"clientOid\": \"5c52e11203aa677f33e493fb\",\n \"remark\": null,\n \"tags\": \"\",\n \"isActive\": true,\n \"cancelExist\": false,\n \"createdAt\": 1729236185949,\n \"updatedAt\": 1729236185949,\n \"endAt\": null,\n \"orderTime\": 1729236185885647952,\n \"settleCurrency\": \"USDT\",\n \"marginMode\": \"ISOLATED\",\n \"avgDealPrice\": \"0\",\n \"filledSize\": 0,\n \"filledValue\": \"0\",\n \"status\": \"open\",\n \"reduceOnly\": false\n }\n}" } ] }, { - "name": "Cancel All Stop orders", + "name": "Get Order By ClientOid", "request": { - "method": "DELETE", + "method": "GET", "header": [], "url": { "raw": "", @@ -14074,24 +13897,25 @@ "path": [ "api", "v1", - "stopOrders" + "orders", + "byClientOid" ], "query": [ { - "key": "symbol", - "value": "XBTUSDTM", - "description": "Cancel all limit orders for a specific contract only, If not specified, all the limit orders will be deleted, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) " + "key": "clientOid", + "value": "5c52e11203aa677f33e493fb", + "description": "The user self-defined order id." } ] }, - "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470243)\n\n:::info[Description]\nUsing this endpoint, all untriggered stop orders can be canceled in batches.\n\nSupports batch cancellation of untriggered stop orders by symbol. Cancel all all untriggered stop orders for a specific contract symbol only , If not specified, all the all untriggered stop orders will be canceled.\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| cancelledOrderIds | array | Refer to the schema section of cancelledOrderIds |\n\n---\n", + "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470352)\n\n:::info[Description]\nGet a single order by client order id (including a stop order).\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| id | string | Order ID |\n| symbol | string | Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) |\n| type | string | Order type, market order or limit order |\n| side | string | Transaction side |\n| price | string | Order price |\n| size | integer | Order quantity |\n| value | string | Order value
|\n| dealValue | string | Executed size of funds
|\n| dealSize | integer | Executed quantity
|\n| stp | string | [Self Trade Prevention](https://www.kucoin.com/docs-new/doc-338146) is divided into these strategies: CN, CO, CB. Not supported DC at the moment. |\n| stop | string | Stop order type (stop limit or stop market)
|\n| stopPriceType | string | Trigger price type of stop orders |\n| stopTriggered | boolean | Mark to show whether the stop order is triggered |\n| stopPrice | number | Trigger price of stop orders |\n| timeInForce | string | Time in force policy type
|\n| postOnly | boolean | Mark of post only
|\n| hidden | boolean | Mark of the hidden order
|\n| iceberg | boolean | Mark of the iceberg order
|\n| leverage | string | Leverage of the order
|\n| forceHold | boolean | A mark to forcely hold the funds for an order
|\n| closeOrder | boolean | A mark to close the position
|\n| visibleSize | integer | Visible size of the iceberg order
|\n| clientOid | string | Unique order id created by users to identify their orders
|\n| remark | string | Remark |\n| tags | string | tag order source
|\n| isActive | boolean | Mark of the active orders
|\n| cancelExist | boolean | Mark of the canceled orders
|\n| createdAt | integer | Time the order created
|\n| updatedAt | integer | last update time
|\n| endAt | integer | Order Endtime |\n| orderTime | integer | Order create time in nanosecond
|\n| settleCurrency | string | settlement currency
|\n| marginMode | string | Margin mode: ISOLATED (isolated), CROSS (cross margin).
|\n| avgDealPrice | string | Average transaction price, forward contract average transaction price = sum (transaction value) / sum (transaction quantity), reverse contract average transaction price = sum (transaction quantity) / sum (transaction value). Transaction quantity = lots * multiplier
|\n| filledSize | integer | Value of the executed orders
|\n| filledValue | string | Executed order quantity
|\n| status | string | order status: “open” or “done”
|\n| reduceOnly | boolean | A mark to reduce the position size only
|\n\n---\n", "body": {} }, "response": [ { "name": "Successful Response", "originalRequest": { - "method": "DELETE", + "method": "GET", "header": [], "url": { "raw": "", @@ -14102,13 +13926,14 @@ "path": [ "api", "v1", - "stopOrders" + "orders", + "byClientOid" ], "query": [ { - "key": "symbol", - "value": "XBTUSDTM", - "description": "Cancel all limit orders for a specific contract only, If not specified, all the limit orders will be deleted, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) " + "key": "clientOid", + "value": "5c52e11203aa677f33e493fb", + "description": "The user self-defined order id." } ] } @@ -14143,7 +13968,7 @@ } ], "cookie": [], - "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"cancelledOrderIds\": [\n \"235919172150824960\",\n \"235919172150824961\"\n ]\n }\n}" + "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"id\": \"250444645610336256\",\n \"symbol\": \"XRPUSDTM\",\n \"type\": \"limit\",\n \"side\": \"buy\",\n \"price\": \"0.1\",\n \"size\": 1,\n \"value\": \"1\",\n \"dealValue\": \"0\",\n \"dealSize\": 0,\n \"stp\": \"\",\n \"stop\": \"\",\n \"stopPriceType\": \"\",\n \"stopTriggered\": false,\n \"stopPrice\": null,\n \"timeInForce\": \"GTC\",\n \"postOnly\": false,\n \"hidden\": false,\n \"iceberg\": false,\n \"leverage\": \"3\",\n \"forceHold\": false,\n \"closeOrder\": false,\n \"visibleSize\": 0,\n \"clientOid\": \"5c52e11203aa677f33e493fb\",\n \"remark\": null,\n \"tags\": \"\",\n \"isActive\": true,\n \"cancelExist\": false,\n \"createdAt\": 1732523858568,\n \"updatedAt\": 1732523858568,\n \"endAt\": null,\n \"orderTime\": 1732523858550892322,\n \"settleCurrency\": \"USDT\",\n \"marginMode\": \"ISOLATED\",\n \"avgDealPrice\": \"0\",\n \"filledSize\": 0,\n \"filledValue\": \"0\",\n \"status\": \"open\",\n \"reduceOnly\": false\n }\n}" } ] }, @@ -14305,7 +14130,7 @@ ] }, { - "name": "Get Order By OrderId", + "name": "Get Recent Closed Orders", "request": { "method": "GET", "header": [], @@ -14318,12 +14143,134 @@ "path": [ "api", "v1", - "orders", - "{{order-id}}" + "recentDoneOrders" ], - "query": [] + "query": [ + { + "key": "symbol", + "value": "XBTUSDTM", + "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) " + } + ] + }, + "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470246)\n\n:::info[Description]\nGet a list of recent 1000 closed orders in the last 24 hours.\n\nIf you need to get your recent traded order history with low latency, you may query this endpoint.\n\n\nAny limit order on the exchange order book is in active status. Orders removed from the order book will be marked with done status. After an order becomes done, there may be a few milliseconds latency before it’s fully settled.\n\nYou can check the orders in any status. If the status parameter is not specified, orders of done status will be returned by default.\n\nWhen you query orders in active status, there is no time limit. However, when you query orders in done status, the start and end time range cannot exceed 24*7 hours. An error will occur if the specified time window exceeds the range. If you specify the end time only, the system will automatically calculate the start time as end time minus 24 hours, and vice versa.\n\n**POLLING**\nFor high-volume trading, it is highly recommended that you maintain your own list of open orders and use one of the streaming market data feeds to keep it updated. You should poll the open orders endpoint to obtain the current state of any open order.\n\nIf you need to get your recent trade history with low latency, you may query the endpoint Get List of Orders Completed in 24h.\n:::\n\n**API KEY PERMISSIONS**\nThis endpoint requires the General permission.\n\n**REQUEST URL**\nThis endpoint support Futures URL\n\n**REQUEST RATE LIMIT**\nFutures weight:2\n\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | array | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| id | string | Order ID |\n| symbol | string | Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) |\n| type | string | Order type, market order or limit order |\n| side | string | Transaction side |\n| price | string | Order price |\n| size | integer | Order quantity |\n| value | string | Order value
|\n| dealValue | string | Executed size of funds
|\n| dealSize | integer | Executed quantity
|\n| stp | string | self trade prevention |\n| stop | string | Stop order type (stop limit or stop market)
|\n| stopPriceType | string | Trigger price type of stop orders
|\n| stopTriggered | boolean | Mark to show whether the stop order is triggered |\n| stopPrice | integer | Trigger price of stop orders
|\n| timeInForce | string | Time in force policy type
|\n| postOnly | boolean | Mark of post only
|\n| hidden | boolean | Mark of the hidden order
|\n| iceberg | boolean | Mark of the iceberg order
|\n| leverage | string | Leverage of the order
|\n| forceHold | boolean | A mark to forcely hold the funds for an order
|\n| closeOrder | boolean | A mark to close the position
|\n| visibleSize | integer | Visible size of the iceberg order
|\n| clientOid | string | Unique order id created by users to identify their orders
|\n| remark | string | Remark of the order
|\n| tags | string | tag order source
|\n| isActive | boolean | Mark of the active orders
|\n| cancelExist | boolean | Mark of the canceled orders
|\n| createdAt | integer | Time the order created
|\n| updatedAt | integer | last update time
|\n| endAt | integer | End time
|\n| orderTime | integer | Order create time in nanosecond
|\n| settleCurrency | string | settlement currency
|\n| marginMode | string | Margin mode: ISOLATED (isolated), CROSS (cross margin).
|\n| avgDealPrice | string | Average transaction price, forward contract average transaction price = sum (transaction value) / sum (transaction quantity), reverse contract average transaction price = sum (transaction quantity) / sum (transaction value). Transaction quantity = lots * multiplier
|\n| filledSize | integer | Value of the executed orders
|\n| filledValue | string | Executed order quantity
|\n| status | string | order status: “open” or “done”
|\n| reduceOnly | boolean | A mark to reduce the position size only
|\n\n---\n", + "body": {} + }, + "response": [ + { + "name": "Successful Response", + "originalRequest": { + "method": "GET", + "header": [], + "url": { + "raw": "", + "protocol": "https", + "host": [ + "{{futures_endpoint}}" + ], + "path": [ + "api", + "v1", + "recentDoneOrders" + ], + "query": [ + { + "key": "symbol", + "value": "XBTUSDTM", + "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) " + } + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json", + "name": "Content-Type", + "description": { + "content": "", + "type": "text/plain" + } + }, + { + "key": "gw-ratelimit-remaining", + "value": 1997, + "name": "gw-ratelimit-remaining" + }, + { + "key": "gw-ratelimit-limit", + "value": 2000, + "name": "gw-ratelimit-limit" + }, + { + "key": "gw-ratelimit-reset", + "value": 29990, + "name": "gw-ratelimit-reset" + } + ], + "cookie": [], + "body": "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"id\": \"236387137732231168\",\n \"symbol\": \"XRPUSDTM\",\n \"type\": \"market\",\n \"side\": \"buy\",\n \"price\": \"0\",\n \"size\": 1,\n \"value\": \"5.51\",\n \"dealValue\": \"5.511\",\n \"dealSize\": 1,\n \"stp\": \"\",\n \"stop\": \"\",\n \"stopPriceType\": \"\",\n \"stopTriggered\": false,\n \"stopPrice\": null,\n \"timeInForce\": \"GTC\",\n \"postOnly\": false,\n \"hidden\": false,\n \"iceberg\": false,\n \"leverage\": \"10.0\",\n \"forceHold\": false,\n \"closeOrder\": false,\n \"visibleSize\": 0,\n \"clientOid\": \"16698fe6-2746-4aeb-a7fa-61f633ab6090\",\n \"remark\": null,\n \"tags\": \"\",\n \"isActive\": false,\n \"cancelExist\": false,\n \"createdAt\": 1729172287496,\n \"updatedAt\": 1729172287568,\n \"endAt\": 1729172287568,\n \"orderTime\": 1729172287496950800,\n \"settleCurrency\": \"USDT\",\n \"marginMode\": \"ISOLATED\",\n \"avgDealPrice\": \"0.5511\",\n \"filledSize\": 1,\n \"filledValue\": \"5.511\",\n \"status\": \"done\",\n \"reduceOnly\": false\n },\n {\n \"id\": \"236317213710184449\",\n \"symbol\": \"XBTUSDTM\",\n \"type\": \"market\",\n \"side\": \"buy\",\n \"price\": \"0\",\n \"size\": 1,\n \"value\": \"67.4309\",\n \"dealValue\": \"67.4309\",\n \"dealSize\": 1,\n \"stp\": \"\",\n \"stop\": \"\",\n \"stopPriceType\": \"\",\n \"stopTriggered\": false,\n \"stopPrice\": null,\n \"timeInForce\": \"GTC\",\n \"postOnly\": false,\n \"hidden\": false,\n \"iceberg\": false,\n \"leverage\": \"3\",\n \"forceHold\": false,\n \"closeOrder\": false,\n \"visibleSize\": 0,\n \"clientOid\": \"5c52e11203aa677f33e493fb\",\n \"remark\": null,\n \"tags\": \"\",\n \"isActive\": false,\n \"cancelExist\": false,\n \"createdAt\": 1729155616310,\n \"updatedAt\": 1729155616324,\n \"endAt\": 1729155616324,\n \"orderTime\": 1729155616310180400,\n \"settleCurrency\": \"USDT\",\n \"marginMode\": \"ISOLATED\",\n \"avgDealPrice\": \"67430.9\",\n \"filledSize\": 1,\n \"filledValue\": \"67.4309\",\n \"status\": \"done\",\n \"reduceOnly\": false\n },\n {\n \"id\": \"236317094436728832\",\n \"symbol\": \"XBTUSDTM\",\n \"type\": \"market\",\n \"side\": \"buy\",\n \"price\": \"0\",\n \"size\": 1,\n \"value\": \"67.445\",\n \"dealValue\": \"67.445\",\n \"dealSize\": 1,\n \"stp\": \"\",\n \"stop\": \"\",\n \"stopPriceType\": \"\",\n \"stopTriggered\": false,\n \"stopPrice\": null,\n \"timeInForce\": \"GTC\",\n \"postOnly\": false,\n \"hidden\": false,\n \"iceberg\": false,\n \"leverage\": \"3\",\n \"forceHold\": false,\n \"closeOrder\": false,\n \"visibleSize\": 0,\n \"clientOid\": \"5c52e11203aa677f33e493fb\",\n \"remark\": null,\n \"tags\": \"\",\n \"isActive\": false,\n \"cancelExist\": false,\n \"createdAt\": 1729155587873,\n \"updatedAt\": 1729155587946,\n \"endAt\": 1729155587946,\n \"orderTime\": 1729155587873332000,\n \"settleCurrency\": \"USDT\",\n \"marginMode\": \"ISOLATED\",\n \"avgDealPrice\": \"67445.0\",\n \"filledSize\": 1,\n \"filledValue\": \"67.445\",\n \"status\": \"done\",\n \"reduceOnly\": false\n }\n ]\n}" + } + ] + }, + { + "name": "Get Stop Order List", + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "", + "protocol": "https", + "host": [ + "{{futures_endpoint}}" + ], + "path": [ + "api", + "v1", + "stopOrders" + ], + "query": [ + { + "key": "symbol", + "value": "XBTUSDTM", + "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) " + }, + { + "key": "side", + "value": null, + "description": "buy or sell" + }, + { + "key": "type", + "value": null, + "description": "limit, market" + }, + { + "key": "startAt", + "value": null, + "description": "Start time (milisecond)" + }, + { + "key": "endAt", + "value": null, + "description": "End time (milisecond)" + }, + { + "key": "currentPage", + "value": null, + "description": "Current request page, The default currentPage is 1" + }, + { + "key": "pageSize", + "value": null, + "description": "pageSize, The default pageSize is 50, The maximum cannot exceed 1000" + } + ] }, - "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470245)\n\n:::info[Description]\nGet a single order by order id (including a stop order).\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| id | string | Order ID |\n| symbol | string | Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) |\n| type | string | Order type, market order or limit order |\n| side | string | Transaction side |\n| price | string | Order price |\n| size | integer | Order quantity |\n| value | string | Order value
|\n| dealValue | string | Executed size of funds
|\n| dealSize | integer | Executed quantity
|\n| stp | string | [Self Trade Prevention](https://www.kucoin.com/docs-new/doc-338146) is divided into these strategies: CN, CO, CB. Not supported DC at the moment. |\n| stop | string | Stop order type (stop limit or stop market)
|\n| stopPriceType | string | Trigger price type of stop orders |\n| stopTriggered | boolean | Mark to show whether the stop order is triggered |\n| stopPrice | number | Trigger price of stop orders |\n| timeInForce | string | Time in force policy type
|\n| postOnly | boolean | Mark of post only
|\n| hidden | boolean | Mark of the hidden order
|\n| iceberg | boolean | Mark of the iceberg order
|\n| leverage | string | Leverage of the order
|\n| forceHold | boolean | A mark to forcely hold the funds for an order
|\n| closeOrder | boolean | A mark to close the position
|\n| visibleSize | integer | Visible size of the iceberg order
|\n| clientOid | string | Unique order id created by users to identify their orders
|\n| remark | string | Remark |\n| tags | string | tag order source
|\n| isActive | boolean | Mark of the active orders
|\n| cancelExist | boolean | Mark of the canceled orders
|\n| createdAt | integer | Time the order created
|\n| updatedAt | integer | last update time
|\n| endAt | integer | Order Endtime |\n| orderTime | integer | Order create time in nanosecond
|\n| settleCurrency | string | settlement currency
|\n| marginMode | string | Margin mode: ISOLATED (isolated), CROSS (cross margin).
|\n| avgDealPrice | string | Average transaction price, forward contract average transaction price = sum (transaction value) / sum (transaction quantity), reverse contract average transaction price = sum (transaction quantity) / sum (transaction value). Transaction quantity = lots * multiplier
|\n| filledSize | integer | Value of the executed orders
|\n| filledValue | string | Executed order quantity
|\n| status | string | order status: “open” or “done”
|\n| reduceOnly | boolean | A mark to reduce the position size only
|\n\n---\n", + "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470247)\n\n:::info[Description]\nGet the un-triggered stop orders list. Stop orders that have been triggered can be queried through the general order interface\n:::\n\nAny limit order on the exchange order book is in active status. Orders removed from the order book will be marked with done status. After an order becomes done, there may be a few milliseconds latency before it’s fully settled.\n\nYou can check the orders in any status. If the status parameter is not specified, orders of done status will be returned by default.\n\nWhen you query orders in active status, there is no time limit. However, when you query orders in done status, the start and end time range cannot exceed 24*7 hours. An error will occur if the specified time window exceeds the range. If you specify the end time only, the system will automatically calculate the start time as end time minus 24 hours, and vice versa.\n\nPOLLING\nFor high-volume trading, it is highly recommended that you maintain your own list of open orders and use one of the streaming market data feeds to keep it updated. You should poll the open orders endpoint to obtain the current state of any open order.\n\nIf you need to get your recent trade history with low latency, you may query the endpoint Get List of Orders Completed in 24h.\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| currentPage | integer | Current request page, The default currentPage is 1 |\n| pageSize | integer | pageSize, The default pageSize is 50, The maximum cannot exceed 1000 |\n| totalNum | integer | |\n| totalPage | integer | |\n| items | array | Refer to the schema section of items |\n\n**root.data.items Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| id | string | Order ID |\n| symbol | string | Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) |\n| type | string | Order type, market order or limit order
|\n| side | string | Transaction side |\n| price | string | Order price |\n| size | integer | Order quantity |\n| value | string | Order value |\n| dealValue | string | Executed size of funds
|\n| dealSize | integer | Executed quantity |\n| stp | string | self trade prevention |\n| stop | string | Stop order type (stop limit or stop market) |\n| stopPriceType | string | Trigger price type of stop orders |\n| stopTriggered | boolean | Mark to show whether the stop order is triggered |\n| stopPrice | string | Trigger price of stop orders |\n| timeInForce | string | Time in force policy type |\n| postOnly | boolean | Mark of post only |\n| hidden | boolean | Mark of the hidden order |\n| iceberg | boolean | Mark of the iceberg order |\n| leverage | string | Leverage of the order |\n| forceHold | boolean | A mark to forcely hold the funds for an order |\n| closeOrder | boolean | A mark to close the position |\n| visibleSize | integer | Visible size of the iceberg order |\n| clientOid | string | Unique order id created by users to identify their orders |\n| remark | string | Remark of the order |\n| tags | string | tag order source |\n| isActive | boolean | Mark of the active orders |\n| cancelExist | boolean | Mark of the canceled orders |\n| createdAt | integer | Time the order created |\n| updatedAt | integer | last update time |\n| endAt | integer | End time |\n| orderTime | integer | Order create time in nanosecond |\n| settleCurrency | string | settlement currency |\n| marginMode | string | Margin mode: ISOLATED (isolated), CROSS (cross margin). |\n| avgDealPrice | string | Average transaction price, forward contract average transaction price = sum (transaction value) / sum (transaction quantity), reverse contract average transaction price = sum (transaction quantity) / sum (transaction value). Transaction quantity = lots * multiplier |\n| filledSize | integer | Value of the executed orders |\n| filledValue | string | Executed order quantity |\n| status | string | order status: “open” or “done” |\n| reduceOnly | boolean | A mark to reduce the position size only |\n\n---\n", "body": {} }, "response": [ @@ -14341,10 +14288,45 @@ "path": [ "api", "v1", - "orders", - "{{order-id}}" + "stopOrders" ], - "query": [] + "query": [ + { + "key": "symbol", + "value": "XBTUSDTM", + "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) " + }, + { + "key": "side", + "value": null, + "description": "buy or sell" + }, + { + "key": "type", + "value": null, + "description": "limit, market" + }, + { + "key": "startAt", + "value": null, + "description": "Start time (milisecond)" + }, + { + "key": "endAt", + "value": null, + "description": "End time (milisecond)" + }, + { + "key": "currentPage", + "value": null, + "description": "Current request page, The default currentPage is 1" + }, + { + "key": "pageSize", + "value": null, + "description": "pageSize, The default pageSize is 50, The maximum cannot exceed 1000" + } + ] } }, "status": "OK", @@ -14377,12 +14359,12 @@ } ], "cookie": [], - "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"id\": \"236655147005071361\",\n \"symbol\": \"XBTUSDTM\",\n \"type\": \"limit\",\n \"side\": \"buy\",\n \"price\": \"0.1\",\n \"size\": 1,\n \"value\": \"0.0001\",\n \"dealValue\": \"0\",\n \"dealSize\": 0,\n \"stp\": \"\",\n \"stop\": \"\",\n \"stopPriceType\": \"\",\n \"stopTriggered\": false,\n \"stopPrice\": null,\n \"timeInForce\": \"GTC\",\n \"postOnly\": false,\n \"hidden\": false,\n \"iceberg\": false,\n \"leverage\": \"3\",\n \"forceHold\": false,\n \"closeOrder\": false,\n \"visibleSize\": 0,\n \"clientOid\": \"5c52e11203aa677f33e493fb\",\n \"remark\": null,\n \"tags\": \"\",\n \"isActive\": true,\n \"cancelExist\": false,\n \"createdAt\": 1729236185949,\n \"updatedAt\": 1729236185949,\n \"endAt\": null,\n \"orderTime\": 1729236185885647952,\n \"settleCurrency\": \"USDT\",\n \"marginMode\": \"ISOLATED\",\n \"avgDealPrice\": \"0\",\n \"filledSize\": 0,\n \"filledValue\": \"0\",\n \"status\": \"open\",\n \"reduceOnly\": false\n }\n}" + "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"currentPage\": 1,\n \"pageSize\": 50,\n \"totalNum\": 1,\n \"totalPage\": 1,\n \"items\": [\n {\n \"id\": \"230181737576050688\",\n \"symbol\": \"PEOPLEUSDTM\",\n \"type\": \"limit\",\n \"side\": \"buy\",\n \"price\": \"0.05\",\n \"size\": 10,\n \"value\": \"5\",\n \"dealValue\": \"0\",\n \"dealSize\": 0,\n \"stp\": \"\",\n \"stop\": \"\",\n \"stopPriceType\": \"\",\n \"stopTriggered\": false,\n \"stopPrice\": null,\n \"timeInForce\": \"GTC\",\n \"postOnly\": false,\n \"hidden\": false,\n \"iceberg\": false,\n \"leverage\": \"1\",\n \"forceHold\": false,\n \"closeOrder\": false,\n \"visibleSize\": 0,\n \"clientOid\": \"5a80bd847f1811ef8a7faa665a37b3d7\",\n \"remark\": null,\n \"tags\": \"\",\n \"isActive\": true,\n \"cancelExist\": false,\n \"createdAt\": 1727692804813,\n \"updatedAt\": 1727692804813,\n \"endAt\": null,\n \"orderTime\": 1727692804808418000,\n \"settleCurrency\": \"USDT\",\n \"marginMode\": \"ISOLATED\",\n \"avgDealPrice\": \"0\",\n \"filledSize\": 0,\n \"filledValue\": \"0\",\n \"status\": \"open\",\n \"reduceOnly\": false\n }\n ]\n }\n}" } ] }, { - "name": "Get Order By ClientOid", + "name": "Get Open Order Value", "request": { "method": "GET", "header": [], @@ -14395,18 +14377,17 @@ "path": [ "api", "v1", - "orders", - "byClientOid" + "openOrderStatistics" ], "query": [ { - "key": "clientOid", - "value": "5c52e11203aa677f33e493fb", - "description": "The user self-defined order id." + "key": "symbol", + "value": "XBTUSDTM", + "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) " } ] }, - "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470352)\n\n:::info[Description]\nGet a single order by client order id (including a stop order).\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| id | string | Order ID |\n| symbol | string | Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) |\n| type | string | Order type, market order or limit order |\n| side | string | Transaction side |\n| price | string | Order price |\n| size | integer | Order quantity |\n| value | string | Order value
|\n| dealValue | string | Executed size of funds
|\n| dealSize | integer | Executed quantity
|\n| stp | string | [Self Trade Prevention](https://www.kucoin.com/docs-new/doc-338146) is divided into these strategies: CN, CO, CB. Not supported DC at the moment. |\n| stop | string | Stop order type (stop limit or stop market)
|\n| stopPriceType | string | Trigger price type of stop orders |\n| stopTriggered | boolean | Mark to show whether the stop order is triggered |\n| stopPrice | number | Trigger price of stop orders |\n| timeInForce | string | Time in force policy type
|\n| postOnly | boolean | Mark of post only
|\n| hidden | boolean | Mark of the hidden order
|\n| iceberg | boolean | Mark of the iceberg order
|\n| leverage | string | Leverage of the order
|\n| forceHold | boolean | A mark to forcely hold the funds for an order
|\n| closeOrder | boolean | A mark to close the position
|\n| visibleSize | integer | Visible size of the iceberg order
|\n| clientOid | string | Unique order id created by users to identify their orders
|\n| remark | string | Remark |\n| tags | string | tag order source
|\n| isActive | boolean | Mark of the active orders
|\n| cancelExist | boolean | Mark of the canceled orders
|\n| createdAt | integer | Time the order created
|\n| updatedAt | integer | last update time
|\n| endAt | integer | Order Endtime |\n| orderTime | integer | Order create time in nanosecond
|\n| settleCurrency | string | settlement currency
|\n| marginMode | string | Margin mode: ISOLATED (isolated), CROSS (cross margin).
|\n| avgDealPrice | string | Average transaction price, forward contract average transaction price = sum (transaction value) / sum (transaction quantity), reverse contract average transaction price = sum (transaction quantity) / sum (transaction value). Transaction quantity = lots * multiplier
|\n| filledSize | integer | Value of the executed orders
|\n| filledValue | string | Executed order quantity
|\n| status | string | order status: “open” or “done”
|\n| reduceOnly | boolean | A mark to reduce the position size only
|\n\n---\n", + "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470250)\n\n:::info[Description]\nYou can query this endpoint to get the the total number and value of the all your active orders.\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| openOrderBuySize | integer | Total number of the unexecuted buy orders
|\n| openOrderSellSize | integer | Total number of the unexecuted sell orders
|\n| openOrderBuyCost | string | Value of all the unexecuted buy orders
|\n| openOrderSellCost | string | Value of all the unexecuted sell orders
|\n| settleCurrency | string | settlement currency
|\n\n---\n", "body": {} }, "response": [ @@ -14424,14 +14405,13 @@ "path": [ "api", "v1", - "orders", - "byClientOid" + "openOrderStatistics" ], "query": [ { - "key": "clientOid", - "value": "5c52e11203aa677f33e493fb", - "description": "The user self-defined order id." + "key": "symbol", + "value": "XBTUSDTM", + "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) " } ] } @@ -14466,12 +14446,12 @@ } ], "cookie": [], - "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"id\": \"250444645610336256\",\n \"symbol\": \"XRPUSDTM\",\n \"type\": \"limit\",\n \"side\": \"buy\",\n \"price\": \"0.1\",\n \"size\": 1,\n \"value\": \"1\",\n \"dealValue\": \"0\",\n \"dealSize\": 0,\n \"stp\": \"\",\n \"stop\": \"\",\n \"stopPriceType\": \"\",\n \"stopTriggered\": false,\n \"stopPrice\": null,\n \"timeInForce\": \"GTC\",\n \"postOnly\": false,\n \"hidden\": false,\n \"iceberg\": false,\n \"leverage\": \"3\",\n \"forceHold\": false,\n \"closeOrder\": false,\n \"visibleSize\": 0,\n \"clientOid\": \"5c52e11203aa677f33e493fb\",\n \"remark\": null,\n \"tags\": \"\",\n \"isActive\": true,\n \"cancelExist\": false,\n \"createdAt\": 1732523858568,\n \"updatedAt\": 1732523858568,\n \"endAt\": null,\n \"orderTime\": 1732523858550892322,\n \"settleCurrency\": \"USDT\",\n \"marginMode\": \"ISOLATED\",\n \"avgDealPrice\": \"0\",\n \"filledSize\": 0,\n \"filledValue\": \"0\",\n \"status\": \"open\",\n \"reduceOnly\": false\n }\n}" + "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"openOrderBuySize\": 1,\n \"openOrderSellSize\": 0,\n \"openOrderBuyCost\": \"0.0001\",\n \"openOrderSellCost\": \"0\",\n \"settleCurrency\": \"USDT\"\n }\n}" } ] }, { - "name": "Get Recent Closed Orders", + "name": "Get Recent Trade History", "request": { "method": "GET", "header": [], @@ -14484,7 +14464,7 @@ "path": [ "api", "v1", - "recentDoneOrders" + "recentFills" ], "query": [ { @@ -14494,7 +14474,7 @@ } ] }, - "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470246)\n\n:::info[Description]\nGet a list of recent 1000 closed orders in the last 24 hours.\n\nIf you need to get your recent traded order history with low latency, you may query this endpoint.\n\n\nAny limit order on the exchange order book is in active status. Orders removed from the order book will be marked with done status. After an order becomes done, there may be a few milliseconds latency before it’s fully settled.\n\nYou can check the orders in any status. If the status parameter is not specified, orders of done status will be returned by default.\n\nWhen you query orders in active status, there is no time limit. However, when you query orders in done status, the start and end time range cannot exceed 24*7 hours. An error will occur if the specified time window exceeds the range. If you specify the end time only, the system will automatically calculate the start time as end time minus 24 hours, and vice versa.\n\n**POLLING**\nFor high-volume trading, it is highly recommended that you maintain your own list of open orders and use one of the streaming market data feeds to keep it updated. You should poll the open orders endpoint to obtain the current state of any open order.\n\nIf you need to get your recent trade history with low latency, you may query the endpoint Get List of Orders Completed in 24h.\n:::\n\n**API KEY PERMISSIONS**\nThis endpoint requires the General permission.\n\n**REQUEST URL**\nThis endpoint support Futures URL\n\n**REQUEST RATE LIMIT**\nFutures weight:2\n\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | array | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| id | string | Order ID |\n| symbol | string | Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) |\n| type | string | Order type, market order or limit order |\n| side | string | Transaction side |\n| price | string | Order price |\n| size | integer | Order quantity |\n| value | string | Order value
|\n| dealValue | string | Executed size of funds
|\n| dealSize | integer | Executed quantity
|\n| stp | string | self trade prevention |\n| stop | string | Stop order type (stop limit or stop market)
|\n| stopPriceType | string | Trigger price type of stop orders
|\n| stopTriggered | boolean | Mark to show whether the stop order is triggered |\n| stopPrice | integer | Trigger price of stop orders
|\n| timeInForce | string | Time in force policy type
|\n| postOnly | boolean | Mark of post only
|\n| hidden | boolean | Mark of the hidden order
|\n| iceberg | boolean | Mark of the iceberg order
|\n| leverage | string | Leverage of the order
|\n| forceHold | boolean | A mark to forcely hold the funds for an order
|\n| closeOrder | boolean | A mark to close the position
|\n| visibleSize | integer | Visible size of the iceberg order
|\n| clientOid | string | Unique order id created by users to identify their orders
|\n| remark | string | Remark of the order
|\n| tags | string | tag order source
|\n| isActive | boolean | Mark of the active orders
|\n| cancelExist | boolean | Mark of the canceled orders
|\n| createdAt | integer | Time the order created
|\n| updatedAt | integer | last update time
|\n| endAt | integer | End time
|\n| orderTime | integer | Order create time in nanosecond
|\n| settleCurrency | string | settlement currency
|\n| marginMode | string | Margin mode: ISOLATED (isolated), CROSS (cross margin).
|\n| avgDealPrice | string | Average transaction price, forward contract average transaction price = sum (transaction value) / sum (transaction quantity), reverse contract average transaction price = sum (transaction quantity) / sum (transaction value). Transaction quantity = lots * multiplier
|\n| filledSize | integer | Value of the executed orders
|\n| filledValue | string | Executed order quantity
|\n| status | string | order status: “open” or “done”
|\n| reduceOnly | boolean | A mark to reduce the position size only
|\n\n---\n", + "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470249)\n\n:::info[Description]\nGet a list of recent 1000 fills in the last 24 hours. If you need to get your recent traded order history with low latency, you may query this endpoint.\n\nIf you need to get your recent traded order history with low latency, you may query this endpoint.\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | array | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| symbol | string | Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) |\n| tradeId | string | Trade ID
|\n| orderId | string | Order ID
|\n| side | string | Transaction side
|\n| liquidity | string | Liquidity- taker or maker
|\n| forceTaker | boolean | Whether to force processing as a taker
|\n| price | string | Filled price
|\n| size | integer | Filled amount
|\n| value | string | Order value
|\n| openFeePay | string | Opening transaction fee
|\n| closeFeePay | string | Closing transaction fee
|\n| stop | string | A mark to the stop order type
|\n| feeRate | string | Fee Rate |\n| fixFee | string | Fixed fees(Deprecated field, no actual use of the value field)
|\n| feeCurrency | string | Charging currency
|\n| tradeTime | integer | trade time in nanosecond
|\n| subTradeType | string | Deprecated field, no actual use of the value field |\n| marginMode | string | Margin mode: ISOLATED (isolated), CROSS (cross margin).
|\n| displayType | string | Order Type |\n| fee | string | Transaction fee
|\n| settleCurrency | string | Settle Currency |\n| orderType | string | Order type
|\n| tradeType | string | Trade type (trade, liquid, cancel, adl or settlement)
|\n| createdAt | integer | Time the order created
|\n\n---\n", "body": {} }, "response": [ @@ -14512,7 +14492,7 @@ "path": [ "api", "v1", - "recentDoneOrders" + "recentFills" ], "query": [ { @@ -14553,12 +14533,12 @@ } ], "cookie": [], - "body": "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"id\": \"236387137732231168\",\n \"symbol\": \"XRPUSDTM\",\n \"type\": \"market\",\n \"side\": \"buy\",\n \"price\": \"0\",\n \"size\": 1,\n \"value\": \"5.51\",\n \"dealValue\": \"5.511\",\n \"dealSize\": 1,\n \"stp\": \"\",\n \"stop\": \"\",\n \"stopPriceType\": \"\",\n \"stopTriggered\": false,\n \"stopPrice\": null,\n \"timeInForce\": \"GTC\",\n \"postOnly\": false,\n \"hidden\": false,\n \"iceberg\": false,\n \"leverage\": \"10.0\",\n \"forceHold\": false,\n \"closeOrder\": false,\n \"visibleSize\": 0,\n \"clientOid\": \"16698fe6-2746-4aeb-a7fa-61f633ab6090\",\n \"remark\": null,\n \"tags\": \"\",\n \"isActive\": false,\n \"cancelExist\": false,\n \"createdAt\": 1729172287496,\n \"updatedAt\": 1729172287568,\n \"endAt\": 1729172287568,\n \"orderTime\": 1729172287496950800,\n \"settleCurrency\": \"USDT\",\n \"marginMode\": \"ISOLATED\",\n \"avgDealPrice\": \"0.5511\",\n \"filledSize\": 1,\n \"filledValue\": \"5.511\",\n \"status\": \"done\",\n \"reduceOnly\": false\n },\n {\n \"id\": \"236317213710184449\",\n \"symbol\": \"XBTUSDTM\",\n \"type\": \"market\",\n \"side\": \"buy\",\n \"price\": \"0\",\n \"size\": 1,\n \"value\": \"67.4309\",\n \"dealValue\": \"67.4309\",\n \"dealSize\": 1,\n \"stp\": \"\",\n \"stop\": \"\",\n \"stopPriceType\": \"\",\n \"stopTriggered\": false,\n \"stopPrice\": null,\n \"timeInForce\": \"GTC\",\n \"postOnly\": false,\n \"hidden\": false,\n \"iceberg\": false,\n \"leverage\": \"3\",\n \"forceHold\": false,\n \"closeOrder\": false,\n \"visibleSize\": 0,\n \"clientOid\": \"5c52e11203aa677f33e493fb\",\n \"remark\": null,\n \"tags\": \"\",\n \"isActive\": false,\n \"cancelExist\": false,\n \"createdAt\": 1729155616310,\n \"updatedAt\": 1729155616324,\n \"endAt\": 1729155616324,\n \"orderTime\": 1729155616310180400,\n \"settleCurrency\": \"USDT\",\n \"marginMode\": \"ISOLATED\",\n \"avgDealPrice\": \"67430.9\",\n \"filledSize\": 1,\n \"filledValue\": \"67.4309\",\n \"status\": \"done\",\n \"reduceOnly\": false\n },\n {\n \"id\": \"236317094436728832\",\n \"symbol\": \"XBTUSDTM\",\n \"type\": \"market\",\n \"side\": \"buy\",\n \"price\": \"0\",\n \"size\": 1,\n \"value\": \"67.445\",\n \"dealValue\": \"67.445\",\n \"dealSize\": 1,\n \"stp\": \"\",\n \"stop\": \"\",\n \"stopPriceType\": \"\",\n \"stopTriggered\": false,\n \"stopPrice\": null,\n \"timeInForce\": \"GTC\",\n \"postOnly\": false,\n \"hidden\": false,\n \"iceberg\": false,\n \"leverage\": \"3\",\n \"forceHold\": false,\n \"closeOrder\": false,\n \"visibleSize\": 0,\n \"clientOid\": \"5c52e11203aa677f33e493fb\",\n \"remark\": null,\n \"tags\": \"\",\n \"isActive\": false,\n \"cancelExist\": false,\n \"createdAt\": 1729155587873,\n \"updatedAt\": 1729155587946,\n \"endAt\": 1729155587946,\n \"orderTime\": 1729155587873332000,\n \"settleCurrency\": \"USDT\",\n \"marginMode\": \"ISOLATED\",\n \"avgDealPrice\": \"67445.0\",\n \"filledSize\": 1,\n \"filledValue\": \"67.445\",\n \"status\": \"done\",\n \"reduceOnly\": false\n }\n ]\n}" + "body": "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"symbol\": \"XBTUSDTM\",\n \"tradeId\": \"1784277229880\",\n \"orderId\": \"236317213710184449\",\n \"side\": \"buy\",\n \"liquidity\": \"taker\",\n \"forceTaker\": false,\n \"price\": \"67430.9\",\n \"size\": 1,\n \"value\": \"67.4309\",\n \"openFeePay\": \"0.04045854\",\n \"closeFeePay\": \"0\",\n \"stop\": \"\",\n \"feeRate\": \"0.00060\",\n \"fixFee\": \"0\",\n \"feeCurrency\": \"USDT\",\n \"marginMode\": \"ISOLATED\",\n \"fee\": \"0.04045854\",\n \"settleCurrency\": \"USDT\",\n \"orderType\": \"market\",\n \"displayType\": \"market\",\n \"tradeType\": \"trade\",\n \"subTradeType\": null,\n \"tradeTime\": 1729155616320000000,\n \"createdAt\": 1729155616493\n },\n {\n \"symbol\": \"XBTUSDTM\",\n \"tradeId\": \"1784277132002\",\n \"orderId\": \"236317094436728832\",\n \"side\": \"buy\",\n \"liquidity\": \"taker\",\n \"forceTaker\": false,\n \"price\": \"67445\",\n \"size\": 1,\n \"value\": \"67.445\",\n \"openFeePay\": \"0\",\n \"closeFeePay\": \"0.040467\",\n \"stop\": \"\",\n \"feeRate\": \"0.00060\",\n \"fixFee\": \"0\",\n \"feeCurrency\": \"USDT\",\n \"marginMode\": \"ISOLATED\",\n \"fee\": \"0.040467\",\n \"settleCurrency\": \"USDT\",\n \"orderType\": \"market\",\n \"displayType\": \"market\",\n \"tradeType\": \"trade\",\n \"subTradeType\": null,\n \"tradeTime\": 1729155587944000000,\n \"createdAt\": 1729155588104\n }\n ]\n}" } ] }, { - "name": "Get Stop Order List", + "name": "Get Trade History", "request": { "method": "GET", "header": [], @@ -14571,23 +14551,33 @@ "path": [ "api", "v1", - "stopOrders" + "fills" ], "query": [ + { + "key": "orderId", + "value": "236655147005071361", + "description": "List fills for a specific order only (If you specify orderId, other parameters can be ignored)" + }, { "key": "symbol", - "value": "XBTUSDTM", + "value": null, "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) " }, { "key": "side", "value": null, - "description": "buy or sell" + "description": "Order side" }, { "key": "type", "value": null, - "description": "limit, market" + "description": "Order Type" + }, + { + "key": "tradeTypes", + "value": null, + "description": "Transaction type: trade, adl, liquid, settlement. Supports querying multiple types at the same time, separated by commas. Query all type when empty" }, { "key": "startAt", @@ -14611,7 +14601,7 @@ } ] }, - "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470247)\n\n:::info[Description]\nGet the un-triggered stop orders list. Stop orders that have been triggered can be queried through the general order interface\n:::\n\nAny limit order on the exchange order book is in active status. Orders removed from the order book will be marked with done status. After an order becomes done, there may be a few milliseconds latency before it’s fully settled.\n\nYou can check the orders in any status. If the status parameter is not specified, orders of done status will be returned by default.\n\nWhen you query orders in active status, there is no time limit. However, when you query orders in done status, the start and end time range cannot exceed 24*7 hours. An error will occur if the specified time window exceeds the range. If you specify the end time only, the system will automatically calculate the start time as end time minus 24 hours, and vice versa.\n\nPOLLING\nFor high-volume trading, it is highly recommended that you maintain your own list of open orders and use one of the streaming market data feeds to keep it updated. You should poll the open orders endpoint to obtain the current state of any open order.\n\nIf you need to get your recent trade history with low latency, you may query the endpoint Get List of Orders Completed in 24h.\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| currentPage | integer | Current request page, The default currentPage is 1 |\n| pageSize | integer | pageSize, The default pageSize is 50, The maximum cannot exceed 1000 |\n| totalNum | integer | |\n| totalPage | integer | |\n| items | array | Refer to the schema section of items |\n\n**root.data.items Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| id | string | Order ID |\n| symbol | string | Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) |\n| type | string | Order type, market order or limit order
|\n| side | string | Transaction side |\n| price | string | Order price |\n| size | integer | Order quantity |\n| value | string | Order value |\n| dealValue | string | Executed size of funds
|\n| dealSize | integer | Executed quantity |\n| stp | string | self trade prevention |\n| stop | string | Stop order type (stop limit or stop market) |\n| stopPriceType | string | Trigger price type of stop orders |\n| stopTriggered | boolean | Mark to show whether the stop order is triggered |\n| stopPrice | string | Trigger price of stop orders |\n| timeInForce | string | Time in force policy type |\n| postOnly | boolean | Mark of post only |\n| hidden | boolean | Mark of the hidden order |\n| iceberg | boolean | Mark of the iceberg order |\n| leverage | string | Leverage of the order |\n| forceHold | boolean | A mark to forcely hold the funds for an order |\n| closeOrder | boolean | A mark to close the position |\n| visibleSize | integer | Visible size of the iceberg order |\n| clientOid | string | Unique order id created by users to identify their orders |\n| remark | string | Remark of the order |\n| tags | string | tag order source |\n| isActive | boolean | Mark of the active orders |\n| cancelExist | boolean | Mark of the canceled orders |\n| createdAt | integer | Time the order created |\n| updatedAt | integer | last update time |\n| endAt | integer | End time |\n| orderTime | integer | Order create time in nanosecond |\n| settleCurrency | string | settlement currency |\n| marginMode | string | Margin mode: ISOLATED (isolated), CROSS (cross margin). |\n| avgDealPrice | string | Average transaction price, forward contract average transaction price = sum (transaction value) / sum (transaction quantity), reverse contract average transaction price = sum (transaction quantity) / sum (transaction value). Transaction quantity = lots * multiplier |\n| filledSize | integer | Value of the executed orders |\n| filledValue | string | Executed order quantity |\n| status | string | order status: “open” or “done” |\n| reduceOnly | boolean | A mark to reduce the position size only |\n\n---\n", + "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470248)\n\n:::info[Description]\nGet a list of recent fills. If you need to get your recent trade history with low latency, please query endpoint Get List of Orders Completed in 24h. The requested data is not real-time.\n:::\n\n**Data Time Range**\n\nThe system allows you to retrieve data up to one week (start from the last day by default). If the time period of the queried data exceeds one week (time range from the start time to end time exceeded 24*7 hours), the system will prompt to remind you that you have exceeded the time limit. If you only specified the start time, the system will automatically calculate the end time (end time = start time + 24 hours). On the contrary, if you only specified the end time, the system will calculate the start time (start time= end time - 24 hours) the same way.\n\n**Fee**\n\nOrders on KuCoin Futures platform are classified into two types, taker and maker. A taker order matches other resting orders on the exchange order book, and gets executed immediately after order entry. A maker order, on the contrary, stays on the exchange order book and awaits to be matched. Taker orders will be charged taker fees, while maker orders will receive maker rebates. Please note that market orders, iceberg orders and hidden orders are always charged taker fees.\n\nThe system will pre-freeze a predicted taker fee when you place an order.The liquidity field indicates if the fill was charged taker or maker fees.\n\nThe system will pre-freeze the predicted fees (including the maintenance margin needed for the position, entry fees and fees to close positions) if you added the position, and will not pre-freeze fees if you reduced the position. After the order is executed, if you added positions, the system will deduct entry fees from your balance, if you closed positions, the system will deduct the close fees.\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| currentPage | integer | |\n| pageSize | integer | |\n| totalNum | integer | |\n| totalPage | integer | |\n| items | array | Refer to the schema section of items |\n\n**root.data.items Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| symbol | string | Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) |\n| tradeId | string | Trade ID
|\n| orderId | string | Order ID
|\n| side | string | Transaction side |\n| liquidity | string | Liquidity- taker or maker |\n| forceTaker | boolean | Whether to force processing as a taker
|\n| price | string | Filled price |\n| size | integer | Filled amount |\n| value | string | Order value |\n| openFeePay | string | Opening transaction fee |\n| closeFeePay | string | Closing transaction fee |\n| stop | string | A mark to the stop order type |\n| feeRate | string | Fee Rate |\n| fixFee | string | Fixed fees(Deprecated field, no actual use of the value field) |\n| feeCurrency | string | Charging currency |\n| tradeTime | integer | trade time in nanosecond |\n| subTradeType | string | Deprecated field, no actual use of the value field |\n| marginMode | string | Margin mode: ISOLATED (isolated), CROSS (cross margin). |\n| settleCurrency | string | Settle Currency |\n| displayType | string | Order Type |\n| fee | string | |\n| orderType | string | Order type |\n| tradeType | string | Trade type (trade, liquid, adl or settlement)
|\n| createdAt | integer | Time the order created
|\n\n---\n", "body": {} }, "response": [ @@ -14629,23 +14619,33 @@ "path": [ "api", "v1", - "stopOrders" + "fills" ], "query": [ + { + "key": "orderId", + "value": "236655147005071361", + "description": "List fills for a specific order only (If you specify orderId, other parameters can be ignored)" + }, { "key": "symbol", - "value": "XBTUSDTM", + "value": null, "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) " }, { "key": "side", "value": null, - "description": "buy or sell" + "description": "Order side" }, { "key": "type", "value": null, - "description": "limit, market" + "description": "Order Type" + }, + { + "key": "tradeTypes", + "value": null, + "description": "Transaction type: trade, adl, liquid, settlement. Supports querying multiple types at the same time, separated by commas. Query all type when empty" }, { "key": "startAt", @@ -14700,7 +14700,7 @@ } ], "cookie": [], - "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"currentPage\": 1,\n \"pageSize\": 50,\n \"totalNum\": 1,\n \"totalPage\": 1,\n \"items\": [\n {\n \"id\": \"230181737576050688\",\n \"symbol\": \"PEOPLEUSDTM\",\n \"type\": \"limit\",\n \"side\": \"buy\",\n \"price\": \"0.05\",\n \"size\": 10,\n \"value\": \"5\",\n \"dealValue\": \"0\",\n \"dealSize\": 0,\n \"stp\": \"\",\n \"stop\": \"\",\n \"stopPriceType\": \"\",\n \"stopTriggered\": false,\n \"stopPrice\": null,\n \"timeInForce\": \"GTC\",\n \"postOnly\": false,\n \"hidden\": false,\n \"iceberg\": false,\n \"leverage\": \"1\",\n \"forceHold\": false,\n \"closeOrder\": false,\n \"visibleSize\": 0,\n \"clientOid\": \"5a80bd847f1811ef8a7faa665a37b3d7\",\n \"remark\": null,\n \"tags\": \"\",\n \"isActive\": true,\n \"cancelExist\": false,\n \"createdAt\": 1727692804813,\n \"updatedAt\": 1727692804813,\n \"endAt\": null,\n \"orderTime\": 1727692804808418000,\n \"settleCurrency\": \"USDT\",\n \"marginMode\": \"ISOLATED\",\n \"avgDealPrice\": \"0\",\n \"filledSize\": 0,\n \"filledValue\": \"0\",\n \"status\": \"open\",\n \"reduceOnly\": false\n }\n ]\n }\n}" + "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"currentPage\": 1,\n \"pageSize\": 50,\n \"totalNum\": 2,\n \"totalPage\": 1,\n \"items\": [\n {\n \"symbol\": \"XBTUSDTM\",\n \"tradeId\": \"1784277229880\",\n \"orderId\": \"236317213710184449\",\n \"side\": \"buy\",\n \"liquidity\": \"taker\",\n \"forceTaker\": false,\n \"price\": \"67430.9\",\n \"size\": 1,\n \"value\": \"67.4309\",\n \"openFeePay\": \"0.04045854\",\n \"closeFeePay\": \"0\",\n \"stop\": \"\",\n \"feeRate\": \"0.00060\",\n \"fixFee\": \"0\",\n \"feeCurrency\": \"USDT\",\n \"marginMode\": \"ISOLATED\",\n \"settleCurrency\": \"USDT\",\n \"fee\": \"0.04045854\",\n \"orderType\": \"market\",\n \"displayType\": \"market\",\n \"tradeType\": \"trade\",\n \"subTradeType\": null,\n \"tradeTime\": 1729155616320000000,\n \"createdAt\": 1729155616493\n },\n {\n \"symbol\": \"XBTUSDTM\",\n \"tradeId\": \"1784277132002\",\n \"orderId\": \"236317094436728832\",\n \"side\": \"buy\",\n \"liquidity\": \"taker\",\n \"forceTaker\": false,\n \"price\": \"67445\",\n \"size\": 1,\n \"value\": \"67.445\",\n \"openFeePay\": \"0\",\n \"closeFeePay\": \"0.040467\",\n \"stop\": \"\",\n \"feeRate\": \"0.00060\",\n \"fixFee\": \"0\",\n \"feeCurrency\": \"USDT\",\n \"marginMode\": \"ISOLATED\",\n \"settleCurrency\": \"USDT\",\n \"fee\": \"0.040467\",\n \"orderType\": \"market\",\n \"displayType\": \"market\",\n \"tradeType\": \"trade\",\n \"subTradeType\": null,\n \"tradeTime\": 1729155587944000000,\n \"createdAt\": 1729155588104\n }\n ]\n }\n}" } ] } @@ -14711,7 +14711,7 @@ "name": "Positions", "item": [ { - "name": "Get Max Open Size", + "name": "Get Margin Mode", "request": { "method": "GET", "header": [], @@ -14724,27 +14724,18 @@ "path": [ "api", "v2", - "getMaxOpenSize" + "position", + "getMarginMode" ], "query": [ { "key": "symbol", - "value": null, + "value": "XBTUSDTM", "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) " - }, - { - "key": "price", - "value": null, - "description": "Order price\n" - }, - { - "key": "leverage", - "value": null, - "description": "Leverage\n" } ] }, - "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470251)\n\n:::info[Description]\nGet Maximum Open Position Size.\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| symbol | string | Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) |\n| maxBuyOpenSize | integer | Maximum buy size
|\n| maxSellOpenSize | integer | Maximum buy size
|\n\n---\n", + "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470259)\n\n:::info[Description]\nThis interface can query the margin mode of the current symbol.\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| symbol | string | Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) |\n| marginMode | string | Margin mode: ISOLATED (isolated), CROSS (cross margin). |\n\n---\n", "body": {} }, "response": [ @@ -14762,23 +14753,14 @@ "path": [ "api", "v2", - "getMaxOpenSize" + "position", + "getMarginMode" ], "query": [ { "key": "symbol", - "value": null, + "value": "XBTUSDTM", "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) " - }, - { - "key": "price", - "value": null, - "description": "Order price\n" - }, - { - "key": "leverage", - "value": null, - "description": "Leverage\n" } ] } @@ -14813,14 +14795,14 @@ } ], "cookie": [], - "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"symbol\": \"XBTUSDTM\",\n \"maxBuyOpenSize\": 0,\n \"maxSellOpenSize\": 0\n }\n}" + "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"symbol\": \"XBTUSDTM\",\n \"marginMode\": \"ISOLATED\"\n }\n}" } ] }, { - "name": "Get Isolated Margin Risk Limit", + "name": "Switch Margin Mode", "request": { - "method": "GET", + "method": "POST", "header": [], "url": { "raw": "", @@ -14830,21 +14812,28 @@ ], "path": [ "api", - "v1", - "contracts", - "risk-limit", - "{{symbol}}" + "v2", + "position", + "changeMarginMode" ], "query": [] }, - "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470263)\n\n:::info[Description]\nThis interface can be used to obtain information about risk limit level of a specific contract(Only valid for isolated Margin).\n:::\n\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | array | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| symbol | string | Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) |\n| level | integer | level
|\n| maxRiskLimit | integer | Upper limit USDT(includes)
|\n| minRiskLimit | integer | Lower limit USDT
|\n| maxLeverage | integer | Max leverage
|\n| initialMargin | number | Initial margin rate
|\n| maintainMargin | number | Maintenance margin rate
|\n\n---\n", - "body": {} + "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470262)\n\n:::info[Description]\nModify the margin mode of the current symbol.\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| symbol | string | Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) |\n| marginMode | string | Modified margin model: ISOLATED (isolated), CROSS (cross margin). |\n\n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| symbol | string | Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) |\n| marginMode | string | Margin mode: ISOLATED (isolated), CROSS (cross margin). |\n\n---\n", + "body": { + "mode": "raw", + "raw": "{\n \"symbol\": \"XBTUSDTM\",\n \"marginMode\": \"ISOLATED\"\n}", + "options": { + "raw": { + "language": "json" + } + } + } }, "response": [ { "name": "Successful Response", "originalRequest": { - "method": "GET", + "method": "POST", "header": [], "url": { "raw": "", @@ -14854,10 +14843,9 @@ ], "path": [ "api", - "v1", - "contracts", - "risk-limit", - "{{symbol}}" + "v2", + "position", + "changeMarginMode" ], "query": [] } @@ -14892,12 +14880,12 @@ } ], "cookie": [], - "body": "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"symbol\": \"XBTUSDTM\",\n \"level\": 1,\n \"maxRiskLimit\": 100000,\n \"minRiskLimit\": 0,\n \"maxLeverage\": 125,\n \"initialMargin\": 0.008,\n \"maintainMargin\": 0.004\n },\n {\n \"symbol\": \"XBTUSDTM\",\n \"level\": 2,\n \"maxRiskLimit\": 500000,\n \"minRiskLimit\": 100000,\n \"maxLeverage\": 100,\n \"initialMargin\": 0.01,\n \"maintainMargin\": 0.005\n },\n {\n \"symbol\": \"XBTUSDTM\",\n \"level\": 3,\n \"maxRiskLimit\": 1000000,\n \"minRiskLimit\": 500000,\n \"maxLeverage\": 75,\n \"initialMargin\": 0.014,\n \"maintainMargin\": 0.007\n },\n {\n \"symbol\": \"XBTUSDTM\",\n \"level\": 4,\n \"maxRiskLimit\": 2000000,\n \"minRiskLimit\": 1000000,\n \"maxLeverage\": 50,\n \"initialMargin\": 0.02,\n \"maintainMargin\": 0.01\n },\n {\n \"symbol\": \"XBTUSDTM\",\n \"level\": 5,\n \"maxRiskLimit\": 3000000,\n \"minRiskLimit\": 2000000,\n \"maxLeverage\": 30,\n \"initialMargin\": 0.034,\n \"maintainMargin\": 0.017\n },\n {\n \"symbol\": \"XBTUSDTM\",\n \"level\": 6,\n \"maxRiskLimit\": 5000000,\n \"minRiskLimit\": 3000000,\n \"maxLeverage\": 20,\n \"initialMargin\": 0.05,\n \"maintainMargin\": 0.025\n },\n {\n \"symbol\": \"XBTUSDTM\",\n \"level\": 7,\n \"maxRiskLimit\": 8000000,\n \"minRiskLimit\": 5000000,\n \"maxLeverage\": 10,\n \"initialMargin\": 0.1,\n \"maintainMargin\": 0.05\n },\n {\n \"symbol\": \"XBTUSDTM\",\n \"level\": 8,\n \"maxRiskLimit\": 12000000,\n \"minRiskLimit\": 8000000,\n \"maxLeverage\": 5,\n \"initialMargin\": 0.2,\n \"maintainMargin\": 0.1\n },\n {\n \"symbol\": \"XBTUSDTM\",\n \"level\": 9,\n \"maxRiskLimit\": 20000000,\n \"minRiskLimit\": 12000000,\n \"maxLeverage\": 4,\n \"initialMargin\": 0.25,\n \"maintainMargin\": 0.125\n },\n {\n \"symbol\": \"XBTUSDTM\",\n \"level\": 10,\n \"maxRiskLimit\": 30000000,\n \"minRiskLimit\": 20000000,\n \"maxLeverage\": 3,\n \"initialMargin\": 0.334,\n \"maintainMargin\": 0.167\n },\n {\n \"symbol\": \"XBTUSDTM\",\n \"level\": 11,\n \"maxRiskLimit\": 40000000,\n \"minRiskLimit\": 30000000,\n \"maxLeverage\": 2,\n \"initialMargin\": 0.5,\n \"maintainMargin\": 0.25\n },\n {\n \"symbol\": \"XBTUSDTM\",\n \"level\": 12,\n \"maxRiskLimit\": 50000000,\n \"minRiskLimit\": 40000000,\n \"maxLeverage\": 1,\n \"initialMargin\": 1.0,\n \"maintainMargin\": 0.5\n }\n ]\n}" + "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"symbol\": \"XBTUSDTM\",\n \"marginMode\": \"ISOLATED\"\n }\n}" } ] }, { - "name": "Get Position Details", + "name": "Get Max Open Size", "request": { "method": "GET", "header": [], @@ -14909,18 +14897,28 @@ ], "path": [ "api", - "v1", - "position" + "v2", + "getMaxOpenSize" ], "query": [ { "key": "symbol", "value": null, "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) " + }, + { + "key": "price", + "value": null, + "description": "Order price\n" + }, + { + "key": "leverage", + "value": null, + "description": "Leverage\n" } ] }, - "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470252)\n\n:::info[Description]\nGet the position details of a specified position.\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| id | string | Position ID
|\n| symbol | string | Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) |\n| crossMode | boolean | Whether it is cross margin. |\n| delevPercentage | number | ADL ranking percentile
|\n| openingTimestamp | integer | Open time
|\n| currentTimestamp | integer | Current timestamp
|\n| currentQty | integer | Current postion quantity
|\n| currentCost | number | Current postion value
|\n| currentComm | number | Current commission
|\n| unrealisedCost | number | Unrealised value
|\n| realisedGrossCost | number | Accumulated realised gross profit value
|\n| realisedCost | number | Current realised position value
|\n| isOpen | boolean | Opened position or not
|\n| markPrice | number | Mark price
|\n| markValue | number | Mark Value
|\n| posCost | number | Position value
|\n| posInit | number | Inital margin Cross = opening value/cross leverage; isolated = accumulation of initial margin for each transaction
|\n| posMargin | number | Bankruptcy cost Cross = mark value * imr; Isolated = position margin (accumulation of initial margin, additional margin, generated funding fees, etc.)
|\n| realisedGrossPnl | number | Accumulated realised gross profit value
|\n| realisedPnl | number | Realised profit and loss
|\n| unrealisedPnl | number | Unrealised profit and loss
|\n| unrealisedPnlPcnt | number | Profit-loss ratio of the position
|\n| unrealisedRoePcnt | number | Rate of return on investment
|\n| avgEntryPrice | number | Average entry price
|\n| liquidationPrice | number | Liquidation price For Cross Margin, you can refer to the liquidationPrice, and the liquidation is based on the risk rate.
|\n| bankruptPrice | number | Bankruptcy price For Cross Margin, you can refer to the bankruptPrice, and the liquidation is based on the risk rate.
|\n| settleCurrency | string | Currency used to clear and settle the trades
|\n| isInverse | boolean | Reverse contract or not
|\n| marginMode | string | Margin Mode: CROSS,ISOLATED
|\n| positionSide | string | Position Side
|\n| leverage | number | Leverage |\n| autoDeposit | boolean | Auto deposit margin or not **Only applicable to Isolated Margin**
|\n| maintMarginReq | number | Maintenance margin requirement **Only applicable to Isolated Margin**
|\n| riskLimit | integer | Risk limit **Only applicable to Isolated Margin**
|\n| realLeverage | number | Leverage of the order **Only applicable to Isolated Margin**
|\n| posCross | number | added margin **Only applicable to Isolated Margin**
|\n| posCrossMargin | integer | Additional margin calls (automatic, manual, adjusted risk limits) **Only applicable to Isolated Margin**
|\n| posComm | number | Bankruptcy cost **Only applicable to Isolated Margin**
|\n| posCommCommon | number | Part of bankruptcy cost (positioning, add margin) **Only applicable to Isolated Margin**
|\n| posLoss | number | Funding fees paid out **Only applicable to Isolated Margin**
|\n| posFunding | number | The current remaining unsettled funding fee for the position **Only applicable to Isolated Margin**
|\n| posMaint | number | Maintenance margin **Only applicable to Isolated Margin**
|\n| maintMargin | number | Position margin **Only applicable to Isolated Margin**
|\n| maintainMargin | number | Maintenance margin rate **Only applicable to Isolated Margin**
|\n\n---\n", + "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470251)\n\n:::info[Description]\nGet Maximum Open Position Size.\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| symbol | string | Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) |\n| maxBuyOpenSize | integer | Maximum buy size
|\n| maxSellOpenSize | integer | Maximum buy size
|\n\n---\n", "body": {} }, "response": [ @@ -14937,14 +14935,24 @@ ], "path": [ "api", - "v1", - "position" + "v2", + "getMaxOpenSize" ], "query": [ { "key": "symbol", "value": null, "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) " + }, + { + "key": "price", + "value": null, + "description": "Order price\n" + }, + { + "key": "leverage", + "value": null, + "description": "Leverage\n" } ] } @@ -14979,14 +14987,14 @@ } ], "cookie": [], - "body": "//ISOLATED MARGIN\n{\n \"code\": \"200000\",\n \"data\": {\n \"id\": \"500000000000988255\",\n \"symbol\": \"XBTUSDTM\",\n \"autoDeposit\": false,\n \"crossMode\": false,\n \"maintMarginReq\": 0.005,\n \"riskLimit\": 500000,\n \"realLeverage\": 2.88,\n \"delevPercentage\": 0.18,\n \"openingTimestamp\": 1729155616322,\n \"currentTimestamp\": 1729482542135,\n \"currentQty\": 1,\n \"currentCost\": 67.4309,\n \"currentComm\": 0.01925174,\n \"unrealisedCost\": 67.4309,\n \"realisedGrossCost\": 0.0,\n \"realisedCost\": 0.01925174,\n \"isOpen\": true,\n \"markPrice\": 68900.7,\n \"markValue\": 68.9007,\n \"posCost\": 67.4309,\n \"posCross\": 0.01645214,\n \"posCrossMargin\": 0,\n \"posInit\": 22.4769666644,\n \"posComm\": 0.0539546299,\n \"posCommCommon\": 0.0539447199,\n \"posLoss\": 0.03766885,\n \"posMargin\": 22.5097045843,\n \"posFunding\": -0.0212068,\n \"posMaint\": 0.3931320569,\n \"maintMargin\": 23.9795045843,\n \"realisedGrossPnl\": 0.0,\n \"realisedPnl\": -0.06166534,\n \"unrealisedPnl\": 1.4698,\n \"unrealisedPnlPcnt\": 0.0218,\n \"unrealisedRoePcnt\": 0.0654,\n \"avgEntryPrice\": 67430.9,\n \"liquidationPrice\": 45314.33,\n \"bankruptPrice\": 44975.16,\n \"settleCurrency\": \"USDT\",\n \"maintainMargin\": 0.005,\n \"riskLimitLevel\": 2,\n \"marginMode\": \"ISOLATED\",\n \"positionSide\": \"BOTH\",\n \"leverage\": 2.88\n }\n}\n\n//CROSS MARGIN\n//{\n// \"code\": \"200000\",\n// \"data\": {\n// \"id\": \"500000000001046430\",\n// \"symbol\": \"ETHUSDM\",\n// \"crossMode\": true,\n// \"delevPercentage\": 0.71,\n// \"openingTimestamp\": 1730635780702,\n// \"currentTimestamp\": 1730636040926,\n// \"currentQty\": 1,\n// \"currentCost\": -0.0004069805,\n// \"currentComm\": 2.441e-7,\n// \"unrealisedCost\": -0.0004069805,\n// \"realisedGrossCost\": 0,\n// \"realisedCost\": 2.441e-7,\n// \"isOpen\": true,\n// \"markPrice\": 2454.12,\n// \"markValue\": -0.000407478,\n// \"posCost\": -0.0004069805,\n// \"posInit\": 0.0000406981,\n// \"posMargin\": 0.0000407478,\n// \"realisedGrossPnl\": 0,\n// \"realisedPnl\": -2.441e-7,\n// \"unrealisedPnl\": -4.975e-7,\n// \"unrealisedPnlPcnt\": -0.0012,\n// \"unrealisedRoePcnt\": -0.0122,\n// \"avgEntryPrice\": 2457.12,\n// \"liquidationPrice\": 1429.96,\n// \"bankruptPrice\": 1414.96,\n// \"settleCurrency\": \"ETH\",\n// \"isInverse\": true,\n// \"marginMode\": \"CROSS\",\n// \"positionSide\": \"BOTH\",\n// \"leverage\": 10\n// }\n//}" + "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"symbol\": \"XBTUSDTM\",\n \"maxBuyOpenSize\": 0,\n \"maxSellOpenSize\": 0\n }\n}" } ] }, { - "name": "Modify Isolated Margin Risk Limit", + "name": "Get Position Details", "request": { - "method": "POST", + "method": "GET", "header": [], "url": { "raw": "", @@ -14997,28 +15005,24 @@ "path": [ "api", "v1", - "position", - "risk-limit-level", - "change" + "position" ], - "query": [] - }, - "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470264)\n\n:::info[Description]\nThis interface is for the adjustment of the risk limit level(Only valid for isolated Margin). To adjust the level will cancel the open order, the response can only indicate whether the submit of the adjustment request is successful or not. The result of the adjustment can be achieved by WebSocket information: Position Change Events\n\n:::\n\n\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| symbol | string | Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) |\n| level | integer | level |\n\n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | boolean | To adjust the level will cancel the open order, the response can only indicate whether the submit of the adjustment request is successful or not.
|\n\n---\n", - "body": { - "mode": "raw", - "raw": "{\n \"symbol\" : \"XBTUSDTM\",\n \"level\" : 2\n}", - "options": { - "raw": { - "language": "json" + "query": [ + { + "key": "symbol", + "value": null, + "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) " } - } - } + ] + }, + "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470252)\n\n:::info[Description]\nGet the position details of a specified position.\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| id | string | Position ID
|\n| symbol | string | Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) |\n| crossMode | boolean | Whether it is cross margin. |\n| delevPercentage | number | ADL ranking percentile
|\n| openingTimestamp | integer | Open time
|\n| currentTimestamp | integer | Current timestamp
|\n| currentQty | integer | Current postion quantity
|\n| currentCost | number | Current postion value
|\n| currentComm | number | Current commission
|\n| unrealisedCost | number | Unrealised value
|\n| realisedGrossCost | number | Accumulated realised gross profit value
|\n| realisedCost | number | Current realised position value
|\n| isOpen | boolean | Opened position or not
|\n| markPrice | number | Mark price
|\n| markValue | number | Mark Value
|\n| posCost | number | Position value
|\n| posInit | number | Inital margin Cross = opening value/cross leverage; isolated = accumulation of initial margin for each transaction
|\n| posMargin | number | Bankruptcy cost Cross = mark value * imr; Isolated = position margin (accumulation of initial margin, additional margin, generated funding fees, etc.)
|\n| realisedGrossPnl | number | Accumulated realised gross profit value
|\n| realisedPnl | number | Realised profit and loss
|\n| unrealisedPnl | number | Unrealised profit and loss
|\n| unrealisedPnlPcnt | number | Profit-loss ratio of the position
|\n| unrealisedRoePcnt | number | Rate of return on investment
|\n| avgEntryPrice | number | Average entry price
|\n| liquidationPrice | number | Liquidation price For Cross Margin, you can refer to the liquidationPrice, and the liquidation is based on the risk rate.
|\n| bankruptPrice | number | Bankruptcy price For Cross Margin, you can refer to the bankruptPrice, and the liquidation is based on the risk rate.
|\n| settleCurrency | string | Currency used to clear and settle the trades
|\n| isInverse | boolean | Reverse contract or not
|\n| marginMode | string | Margin Mode: CROSS,ISOLATED
|\n| positionSide | string | Position Side
|\n| leverage | number | Leverage |\n| autoDeposit | boolean | Auto deposit margin or not **Only applicable to Isolated Margin**
|\n| maintMarginReq | number | Maintenance margin requirement **Only applicable to Isolated Margin**
|\n| riskLimit | integer | Risk limit **Only applicable to Isolated Margin**
|\n| realLeverage | number | Leverage of the order **Only applicable to Isolated Margin**
|\n| posCross | number | added margin **Only applicable to Isolated Margin**
|\n| posCrossMargin | integer | Additional margin calls (automatic, manual, adjusted risk limits) **Only applicable to Isolated Margin**
|\n| posComm | number | Bankruptcy cost **Only applicable to Isolated Margin**
|\n| posCommCommon | number | Part of bankruptcy cost (positioning, add margin) **Only applicable to Isolated Margin**
|\n| posLoss | number | Funding fees paid out **Only applicable to Isolated Margin**
|\n| posFunding | number | The current remaining unsettled funding fee for the position **Only applicable to Isolated Margin**
|\n| posMaint | number | Maintenance margin **Only applicable to Isolated Margin**
|\n| maintMargin | number | Position margin **Only applicable to Isolated Margin**
|\n| maintainMargin | number | Maintenance margin rate **Only applicable to Isolated Margin**
|\n\n---\n", + "body": {} }, "response": [ { "name": "Successful Response", "originalRequest": { - "method": "POST", + "method": "GET", "header": [], "url": { "raw": "", @@ -15029,11 +15033,15 @@ "path": [ "api", "v1", - "position", - "risk-limit-level", - "change" + "position" ], - "query": [] + "query": [ + { + "key": "symbol", + "value": null, + "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) " + } + ] } }, "status": "OK", @@ -15066,7 +15074,7 @@ } ], "cookie": [], - "body": "{\n \"code\": \"200000\",\n \"data\": true\n}" + "body": "//ISOLATED MARGIN\n{\n \"code\": \"200000\",\n \"data\": {\n \"id\": \"500000000000988255\",\n \"symbol\": \"XBTUSDTM\",\n \"autoDeposit\": false,\n \"crossMode\": false,\n \"maintMarginReq\": 0.005,\n \"riskLimit\": 500000,\n \"realLeverage\": 2.88,\n \"delevPercentage\": 0.18,\n \"openingTimestamp\": 1729155616322,\n \"currentTimestamp\": 1729482542135,\n \"currentQty\": 1,\n \"currentCost\": 67.4309,\n \"currentComm\": 0.01925174,\n \"unrealisedCost\": 67.4309,\n \"realisedGrossCost\": 0.0,\n \"realisedCost\": 0.01925174,\n \"isOpen\": true,\n \"markPrice\": 68900.7,\n \"markValue\": 68.9007,\n \"posCost\": 67.4309,\n \"posCross\": 0.01645214,\n \"posCrossMargin\": 0,\n \"posInit\": 22.4769666644,\n \"posComm\": 0.0539546299,\n \"posCommCommon\": 0.0539447199,\n \"posLoss\": 0.03766885,\n \"posMargin\": 22.5097045843,\n \"posFunding\": -0.0212068,\n \"posMaint\": 0.3931320569,\n \"maintMargin\": 23.9795045843,\n \"realisedGrossPnl\": 0.0,\n \"realisedPnl\": -0.06166534,\n \"unrealisedPnl\": 1.4698,\n \"unrealisedPnlPcnt\": 0.0218,\n \"unrealisedRoePcnt\": 0.0654,\n \"avgEntryPrice\": 67430.9,\n \"liquidationPrice\": 45314.33,\n \"bankruptPrice\": 44975.16,\n \"settleCurrency\": \"USDT\",\n \"maintainMargin\": 0.005,\n \"riskLimitLevel\": 2,\n \"marginMode\": \"ISOLATED\",\n \"positionSide\": \"BOTH\",\n \"leverage\": 2.88\n }\n}\n\n//CROSS MARGIN\n//{\n// \"code\": \"200000\",\n// \"data\": {\n// \"id\": \"500000000001046430\",\n// \"symbol\": \"ETHUSDM\",\n// \"crossMode\": true,\n// \"delevPercentage\": 0.71,\n// \"openingTimestamp\": 1730635780702,\n// \"currentTimestamp\": 1730636040926,\n// \"currentQty\": 1,\n// \"currentCost\": -0.0004069805,\n// \"currentComm\": 2.441e-7,\n// \"unrealisedCost\": -0.0004069805,\n// \"realisedGrossCost\": 0,\n// \"realisedCost\": 2.441e-7,\n// \"isOpen\": true,\n// \"markPrice\": 2454.12,\n// \"markValue\": -0.000407478,\n// \"posCost\": -0.0004069805,\n// \"posInit\": 0.0000406981,\n// \"posMargin\": 0.0000407478,\n// \"realisedGrossPnl\": 0,\n// \"realisedPnl\": -2.441e-7,\n// \"unrealisedPnl\": -4.975e-7,\n// \"unrealisedPnlPcnt\": -0.0012,\n// \"unrealisedRoePcnt\": -0.0122,\n// \"avgEntryPrice\": 2457.12,\n// \"liquidationPrice\": 1429.96,\n// \"bankruptPrice\": 1414.96,\n// \"settleCurrency\": \"ETH\",\n// \"isInverse\": true,\n// \"marginMode\": \"CROSS\",\n// \"positionSide\": \"BOTH\",\n// \"leverage\": 10\n// }\n//}" } ] }, @@ -15285,9 +15293,9 @@ ] }, { - "name": "Remove Isolated Margin", + "name": "Get Max Withdraw Margin", "request": { - "method": "POST", + "method": "GET", "header": [], "url": { "raw": "", @@ -15299,26 +15307,24 @@ "api", "v1", "margin", - "withdrawMargin" + "maxWithdrawMargin" ], - "query": [] - }, - "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470256)\n\n:::info[Description]\nRemove Isolated Margin Manually.\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| symbol | string | Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) |\n| withdrawAmount | string | The size of the position that can be deposited. If it is USDT-margin, it represents the amount of USDT. If it is coin-margin, this value represents the number of coins
|\n\n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | string | The size of the position deposited. If it is USDT-margin, it represents the amount of USDT. If it is coin-margin, this value represents the number of coins
|\n\n---\n", - "body": { - "mode": "raw", - "raw": "{\n \"symbol\": \"XBTUSDTM\",\n \"withdrawAmount\": \"0.0000001\"\n}", - "options": { - "raw": { - "language": "json" + "query": [ + { + "key": "symbol", + "value": null, + "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) " } - } - } + ] + }, + "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470258)\n\n:::info[Description]\nThis interface can query the maximum amount of margin that the current position supports withdrawal.\n:::\n\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | string | The size of the position that can be deposited. If it is USDT-margin, it represents the amount of USDT. If it is coin-margin, this value represents the number of coins
|\n\n---\n", + "body": {} }, "response": [ { "name": "Successful Response", "originalRequest": { - "method": "POST", + "method": "GET", "header": [], "url": { "raw": "", @@ -15330,9 +15336,15 @@ "api", "v1", "margin", - "withdrawMargin" + "maxWithdrawMargin" ], - "query": [] + "query": [ + { + "key": "symbol", + "value": null, + "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) " + } + ] } }, "status": "OK", @@ -15365,14 +15377,14 @@ } ], "cookie": [], - "body": "{\n \"code\": \"200000\",\n \"data\": \"0.1\"\n}" + "body": "{\n \"code\": \"200000\",\n \"data\": \"21.1135719252\"\n}" } ] }, { - "name": "Add Isolated Margin", + "name": "Get Cross Margin Leverage", "request": { - "method": "POST", + "method": "GET", "header": [], "url": { "raw": "", @@ -15382,29 +15394,25 @@ ], "path": [ "api", - "v1", - "position", - "margin", - "deposit-margin" + "v2", + "getCrossUserLeverage" ], - "query": [] - }, - "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470257)\n\n:::info[Description]\nAdd Isolated Margin Manually.\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| symbol | string | Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) |\n| margin | number | Margin amount (min. margin amount≥0.00001667XBT) |\n| bizNo | string | A unique ID generated by the user, to ensure the operation is processed by the system only once, The maximum length cannot exceed 36 |\n\n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| id | string | Position ID |\n| symbol | string | Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) |\n| autoDeposit | boolean | Auto deposit margin or not |\n| maintMarginReq | number | Maintenance margin requirement

|\n| riskLimit | integer | Risk limit
|\n| realLeverage | number | Leverage o the order |\n| crossMode | boolean | Cross mode or not |\n| delevPercentage | number | ADL ranking percentile |\n| openingTimestamp | integer | Open time |\n| currentTimestamp | integer | Current timestamp
|\n| currentQty | integer | Current postion quantity |\n| currentCost | number | Current postion value |\n| currentComm | number | Current commission |\n| unrealisedCost | number | Unrealised value |\n| realisedGrossCost | number | Accumulated realised gross profit value |\n| realisedCost | number | Current realised position value |\n| isOpen | boolean | Opened position or not |\n| markPrice | number | Mark price |\n| markValue | number | Mark value
|\n| posCost | number | Position value |\n| posCross | number | added margin |\n| posInit | number | Leverage margin |\n| posComm | number | Bankruptcy cost |\n| posLoss | number | Funding fees paid out |\n| posMargin | number | Position margin |\n| posMaint | number | Maintenance margin |\n| maintMargin | number | Position margin |\n| realisedGrossPnl | number | Accumulated realised gross profit value |\n| realisedPnl | number | Realised profit and loss |\n| unrealisedPnl | number | Unrealised profit and loss |\n| unrealisedPnlPcnt | number | Profit-loss ratio of the position |\n| unrealisedRoePcnt | number | Rate of return on investment |\n| avgEntryPrice | number | Average entry price |\n| liquidationPrice | number | Liquidation price |\n| bankruptPrice | number | Bankruptcy price |\n| userId | integer | userId |\n| settleCurrency | string | Currency used to clear and settle the trades |\n\n---\n", - "body": { - "mode": "raw", - "raw": "{\n \"symbol\": \"string\",\n \"margin\": 0,\n \"bizNo\": \"string\"\n}", - "options": { - "raw": { - "language": "json" + "query": [ + { + "key": "symbol", + "value": "XBTUSDTM", + "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) " } - } - } + ] + }, + "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470260)\n\n:::info[Description]\nThis interface can query the current symbol’s cross-margin leverage multiple.\n:::\n\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| symbol | string | Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) |\n| leverage | string | Leverage multiple |\n\n---\n", + "body": {} }, "response": [ { "name": "Successful Response", "originalRequest": { - "method": "POST", + "method": "GET", "header": [], "url": { "raw": "", @@ -15414,12 +15422,16 @@ ], "path": [ "api", - "v1", - "position", - "margin", - "deposit-margin" + "v2", + "getCrossUserLeverage" ], - "query": [] + "query": [ + { + "key": "symbol", + "value": "XBTUSDTM", + "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) " + } + ] } }, "status": "OK", @@ -15452,14 +15464,14 @@ } ], "cookie": [], - "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"id\": \"6200c9b83aecfb000152ddcd\",\n \"symbol\": \"XBTUSDTM\",\n \"autoDeposit\": false,\n \"maintMarginReq\": 0.005,\n \"riskLimit\": 500000,\n \"realLeverage\": 18.72,\n \"crossMode\": false,\n \"delevPercentage\": 0.66,\n \"openingTimestamp\": 1646287090131,\n \"currentTimestamp\": 1646295055021,\n \"currentQty\": 1,\n \"currentCost\": 43.388,\n \"currentComm\": 0.0260328,\n \"unrealisedCost\": 43.388,\n \"realisedGrossCost\": 0,\n \"realisedCost\": 0.0260328,\n \"isOpen\": true,\n \"markPrice\": 43536.65,\n \"markValue\": 43.53665,\n \"posCost\": 43.388,\n \"posCross\": 2.4985e-05,\n \"posInit\": 2.1694,\n \"posComm\": 0.02733446,\n \"posLoss\": 0,\n \"posMargin\": 2.19675944,\n \"posMaint\": 0.24861326,\n \"maintMargin\": 2.34540944,\n \"realisedGrossPnl\": 0,\n \"realisedPnl\": -0.0260328,\n \"unrealisedPnl\": 0.14865,\n \"unrealisedPnlPcnt\": 0.0034,\n \"unrealisedRoePcnt\": 0.0685,\n \"avgEntryPrice\": 43388,\n \"liquidationPrice\": 41440,\n \"bankruptPrice\": 41218,\n \"userId\": 1234321123,\n \"settleCurrency\": \"USDT\"\n }\n}" + "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"symbol\": \"XBTUSDTM\",\n \"leverage\": \"3\"\n }\n}" } ] }, { - "name": "Get Max Withdraw Margin", + "name": "Modify Cross Margin Leverage", "request": { - "method": "GET", + "method": "POST", "header": [], "url": { "raw": "", @@ -15469,26 +15481,27 @@ ], "path": [ "api", - "v1", - "margin", - "maxWithdrawMargin" + "v2", + "changeCrossUserLeverage" ], - "query": [ - { - "key": "symbol", - "value": null, - "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) " - } - ] + "query": [] }, - "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470258)\n\n:::info[Description]\nThis interface can query the maximum amount of margin that the current position supports withdrawal.\n:::\n\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | string | The size of the position that can be deposited. If it is USDT-margin, it represents the amount of USDT. If it is coin-margin, this value represents the number of coins
|\n\n---\n", - "body": {} + "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470261)\n\n:::info[Description]\nThis interface can modify the current symbol’s cross-margin leverage multiple.\n:::\n\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| symbol | string | Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) |\n| leverage | string | Leverage multiple |\n\n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| symbol | string | |\n| leverage | string | |\n\n---\n", + "body": { + "mode": "raw", + "raw": "{\n \"symbol\": \"XBTUSDTM\",\n \"leverage\" : \"10\"\n}", + "options": { + "raw": { + "language": "json" + } + } + } }, "response": [ { "name": "Successful Response", "originalRequest": { - "method": "GET", + "method": "POST", "header": [], "url": { "raw": "", @@ -15498,17 +15511,10 @@ ], "path": [ "api", - "v1", - "margin", - "maxWithdrawMargin" + "v2", + "changeCrossUserLeverage" ], - "query": [ - { - "key": "symbol", - "value": null, - "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) " - } - ] + "query": [] } }, "status": "OK", @@ -15541,14 +15547,14 @@ } ], "cookie": [], - "body": "{\n \"code\": \"200000\",\n \"data\": \"21.1135719252\"\n}" + "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"symbol\": \"XBTUSDTM\",\n \"leverage\": \"3\"\n }\n}" } ] }, { - "name": "Get Margin Mode", + "name": "Add Isolated Margin", "request": { - "method": "GET", + "method": "POST", "header": [], "url": { "raw": "", @@ -15558,26 +15564,29 @@ ], "path": [ "api", - "v2", + "v1", "position", - "getMarginMode" + "margin", + "deposit-margin" ], - "query": [ - { - "key": "symbol", - "value": "XBTUSDTM", - "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) " - } - ] + "query": [] }, - "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470259)\n\n:::info[Description]\nThis interface can query the margin mode of the current symbol.\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| symbol | string | Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) |\n| marginMode | string | Margin mode: ISOLATED (isolated), CROSS (cross margin). |\n\n---\n", - "body": {} + "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470257)\n\n:::info[Description]\nAdd Isolated Margin Manually.\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| symbol | string | Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) |\n| margin | number | Margin amount (min. margin amount≥0.00001667XBT) |\n| bizNo | string | A unique ID generated by the user, to ensure the operation is processed by the system only once, The maximum length cannot exceed 36 |\n\n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| id | string | Position ID |\n| symbol | string | Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) |\n| autoDeposit | boolean | Auto deposit margin or not |\n| maintMarginReq | number | Maintenance margin requirement

|\n| riskLimit | integer | Risk limit
|\n| realLeverage | number | Leverage o the order |\n| crossMode | boolean | Cross mode or not |\n| delevPercentage | number | ADL ranking percentile |\n| openingTimestamp | integer | Open time |\n| currentTimestamp | integer | Current timestamp
|\n| currentQty | integer | Current postion quantity |\n| currentCost | number | Current postion value |\n| currentComm | number | Current commission |\n| unrealisedCost | number | Unrealised value |\n| realisedGrossCost | number | Accumulated realised gross profit value |\n| realisedCost | number | Current realised position value |\n| isOpen | boolean | Opened position or not |\n| markPrice | number | Mark price |\n| markValue | number | Mark value
|\n| posCost | number | Position value |\n| posCross | number | added margin |\n| posInit | number | Leverage margin |\n| posComm | number | Bankruptcy cost |\n| posLoss | number | Funding fees paid out |\n| posMargin | number | Position margin |\n| posMaint | number | Maintenance margin |\n| maintMargin | number | Position margin |\n| realisedGrossPnl | number | Accumulated realised gross profit value |\n| realisedPnl | number | Realised profit and loss |\n| unrealisedPnl | number | Unrealised profit and loss |\n| unrealisedPnlPcnt | number | Profit-loss ratio of the position |\n| unrealisedRoePcnt | number | Rate of return on investment |\n| avgEntryPrice | number | Average entry price |\n| liquidationPrice | number | Liquidation price |\n| bankruptPrice | number | Bankruptcy price |\n| userId | integer | userId |\n| settleCurrency | string | Currency used to clear and settle the trades |\n\n---\n", + "body": { + "mode": "raw", + "raw": "{\n \"symbol\": \"string\",\n \"margin\": 0,\n \"bizNo\": \"string\"\n}", + "options": { + "raw": { + "language": "json" + } + } + } }, "response": [ { "name": "Successful Response", "originalRequest": { - "method": "GET", + "method": "POST", "header": [], "url": { "raw": "", @@ -15587,17 +15596,12 @@ ], "path": [ "api", - "v2", + "v1", "position", - "getMarginMode" + "margin", + "deposit-margin" ], - "query": [ - { - "key": "symbol", - "value": "XBTUSDTM", - "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) " - } - ] + "query": [] } }, "status": "OK", @@ -15630,14 +15634,14 @@ } ], "cookie": [], - "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"symbol\": \"XBTUSDTM\",\n \"marginMode\": \"ISOLATED\"\n }\n}" + "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"id\": \"6200c9b83aecfb000152ddcd\",\n \"symbol\": \"XBTUSDTM\",\n \"autoDeposit\": false,\n \"maintMarginReq\": 0.005,\n \"riskLimit\": 500000,\n \"realLeverage\": 18.72,\n \"crossMode\": false,\n \"delevPercentage\": 0.66,\n \"openingTimestamp\": 1646287090131,\n \"currentTimestamp\": 1646295055021,\n \"currentQty\": 1,\n \"currentCost\": 43.388,\n \"currentComm\": 0.0260328,\n \"unrealisedCost\": 43.388,\n \"realisedGrossCost\": 0,\n \"realisedCost\": 0.0260328,\n \"isOpen\": true,\n \"markPrice\": 43536.65,\n \"markValue\": 43.53665,\n \"posCost\": 43.388,\n \"posCross\": 2.4985e-05,\n \"posInit\": 2.1694,\n \"posComm\": 0.02733446,\n \"posLoss\": 0,\n \"posMargin\": 2.19675944,\n \"posMaint\": 0.24861326,\n \"maintMargin\": 2.34540944,\n \"realisedGrossPnl\": 0,\n \"realisedPnl\": -0.0260328,\n \"unrealisedPnl\": 0.14865,\n \"unrealisedPnlPcnt\": 0.0034,\n \"unrealisedRoePcnt\": 0.0685,\n \"avgEntryPrice\": 43388,\n \"liquidationPrice\": 41440,\n \"bankruptPrice\": 41218,\n \"userId\": 1234321123,\n \"settleCurrency\": \"USDT\"\n }\n}" } ] }, { - "name": "Get Cross Margin Leverage", + "name": "Remove Isolated Margin", "request": { - "method": "GET", + "method": "POST", "header": [], "url": { "raw": "", @@ -15647,25 +15651,28 @@ ], "path": [ "api", - "v2", - "getCrossUserLeverage" + "v1", + "margin", + "withdrawMargin" ], - "query": [ - { - "key": "symbol", - "value": "XBTUSDTM", - "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) " - } - ] + "query": [] }, - "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470260)\n\n:::info[Description]\nThis interface can query the current symbol’s cross-margin leverage multiple.\n:::\n\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| symbol | string | Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) |\n| leverage | string | Leverage multiple |\n\n---\n", - "body": {} + "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470256)\n\n:::info[Description]\nRemove Isolated Margin Manually.\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| symbol | string | Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) |\n| withdrawAmount | string | The size of the position that can be deposited. If it is USDT-margin, it represents the amount of USDT. If it is coin-margin, this value represents the number of coins
|\n\n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | string | The size of the position deposited. If it is USDT-margin, it represents the amount of USDT. If it is coin-margin, this value represents the number of coins
|\n\n---\n", + "body": { + "mode": "raw", + "raw": "{\n \"symbol\": \"XBTUSDTM\",\n \"withdrawAmount\": \"0.0000001\"\n}", + "options": { + "raw": { + "language": "json" + } + } + } }, "response": [ { "name": "Successful Response", "originalRequest": { - "method": "GET", + "method": "POST", "header": [], "url": { "raw": "", @@ -15675,16 +15682,11 @@ ], "path": [ "api", - "v2", - "getCrossUserLeverage" + "v1", + "margin", + "withdrawMargin" ], - "query": [ - { - "key": "symbol", - "value": "XBTUSDTM", - "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) " - } - ] + "query": [] } }, "status": "OK", @@ -15717,14 +15719,14 @@ } ], "cookie": [], - "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"symbol\": \"XBTUSDTM\",\n \"leverage\": \"3\"\n }\n}" + "body": "{\n \"code\": \"200000\",\n \"data\": \"0.1\"\n}" } ] }, { - "name": "Modify Cross Margin Leverage", + "name": "Get Isolated Margin Risk Limit", "request": { - "method": "POST", + "method": "GET", "header": [], "url": { "raw": "", @@ -15734,27 +15736,21 @@ ], "path": [ "api", - "v2", - "changeCrossUserLeverage" + "v1", + "contracts", + "risk-limit", + "{{symbol}}" ], "query": [] }, - "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470261)\n\n:::info[Description]\nThis interface can modify the current symbol’s cross-margin leverage multiple.\n:::\n\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| symbol | string | Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) |\n| leverage | string | Leverage multiple |\n\n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| symbol | string | |\n| leverage | string | |\n\n---\n", - "body": { - "mode": "raw", - "raw": "{\n \"symbol\": \"XBTUSDTM\",\n \"leverage\" : \"10\"\n}", - "options": { - "raw": { - "language": "json" - } - } - } + "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470263)\n\n:::info[Description]\nThis interface can be used to obtain information about risk limit level of a specific contract(Only valid for isolated Margin).\n:::\n\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | array | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| symbol | string | Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) |\n| level | integer | level
|\n| maxRiskLimit | integer | Upper limit USDT(includes)
|\n| minRiskLimit | integer | Lower limit USDT
|\n| maxLeverage | integer | Max leverage
|\n| initialMargin | number | Initial margin rate
|\n| maintainMargin | number | Maintenance margin rate
|\n\n---\n", + "body": {} }, "response": [ { "name": "Successful Response", "originalRequest": { - "method": "POST", + "method": "GET", "header": [], "url": { "raw": "", @@ -15764,8 +15760,10 @@ ], "path": [ "api", - "v2", - "changeCrossUserLeverage" + "v1", + "contracts", + "risk-limit", + "{{symbol}}" ], "query": [] } @@ -15800,12 +15798,12 @@ } ], "cookie": [], - "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"symbol\": \"XBTUSDTM\",\n \"leverage\": \"3\"\n }\n}" + "body": "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"symbol\": \"XBTUSDTM\",\n \"level\": 1,\n \"maxRiskLimit\": 100000,\n \"minRiskLimit\": 0,\n \"maxLeverage\": 125,\n \"initialMargin\": 0.008,\n \"maintainMargin\": 0.004\n },\n {\n \"symbol\": \"XBTUSDTM\",\n \"level\": 2,\n \"maxRiskLimit\": 500000,\n \"minRiskLimit\": 100000,\n \"maxLeverage\": 100,\n \"initialMargin\": 0.01,\n \"maintainMargin\": 0.005\n },\n {\n \"symbol\": \"XBTUSDTM\",\n \"level\": 3,\n \"maxRiskLimit\": 1000000,\n \"minRiskLimit\": 500000,\n \"maxLeverage\": 75,\n \"initialMargin\": 0.014,\n \"maintainMargin\": 0.007\n },\n {\n \"symbol\": \"XBTUSDTM\",\n \"level\": 4,\n \"maxRiskLimit\": 2000000,\n \"minRiskLimit\": 1000000,\n \"maxLeverage\": 50,\n \"initialMargin\": 0.02,\n \"maintainMargin\": 0.01\n },\n {\n \"symbol\": \"XBTUSDTM\",\n \"level\": 5,\n \"maxRiskLimit\": 3000000,\n \"minRiskLimit\": 2000000,\n \"maxLeverage\": 30,\n \"initialMargin\": 0.034,\n \"maintainMargin\": 0.017\n },\n {\n \"symbol\": \"XBTUSDTM\",\n \"level\": 6,\n \"maxRiskLimit\": 5000000,\n \"minRiskLimit\": 3000000,\n \"maxLeverage\": 20,\n \"initialMargin\": 0.05,\n \"maintainMargin\": 0.025\n },\n {\n \"symbol\": \"XBTUSDTM\",\n \"level\": 7,\n \"maxRiskLimit\": 8000000,\n \"minRiskLimit\": 5000000,\n \"maxLeverage\": 10,\n \"initialMargin\": 0.1,\n \"maintainMargin\": 0.05\n },\n {\n \"symbol\": \"XBTUSDTM\",\n \"level\": 8,\n \"maxRiskLimit\": 12000000,\n \"minRiskLimit\": 8000000,\n \"maxLeverage\": 5,\n \"initialMargin\": 0.2,\n \"maintainMargin\": 0.1\n },\n {\n \"symbol\": \"XBTUSDTM\",\n \"level\": 9,\n \"maxRiskLimit\": 20000000,\n \"minRiskLimit\": 12000000,\n \"maxLeverage\": 4,\n \"initialMargin\": 0.25,\n \"maintainMargin\": 0.125\n },\n {\n \"symbol\": \"XBTUSDTM\",\n \"level\": 10,\n \"maxRiskLimit\": 30000000,\n \"minRiskLimit\": 20000000,\n \"maxLeverage\": 3,\n \"initialMargin\": 0.334,\n \"maintainMargin\": 0.167\n },\n {\n \"symbol\": \"XBTUSDTM\",\n \"level\": 11,\n \"maxRiskLimit\": 40000000,\n \"minRiskLimit\": 30000000,\n \"maxLeverage\": 2,\n \"initialMargin\": 0.5,\n \"maintainMargin\": 0.25\n },\n {\n \"symbol\": \"XBTUSDTM\",\n \"level\": 12,\n \"maxRiskLimit\": 50000000,\n \"minRiskLimit\": 40000000,\n \"maxLeverage\": 1,\n \"initialMargin\": 1.0,\n \"maintainMargin\": 0.5\n }\n ]\n}" } ] }, { - "name": "Switch Margin Mode", + "name": "Modify Isolated Margin Risk Limit", "request": { "method": "POST", "header": [], @@ -15817,16 +15815,17 @@ ], "path": [ "api", - "v2", + "v1", "position", - "changeMarginMode" + "risk-limit-level", + "change" ], "query": [] }, - "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470262)\n\n:::info[Description]\nModify the margin mode of the current symbol.\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| symbol | string | Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) |\n| marginMode | string | Modified margin model: ISOLATED (isolated), CROSS (cross margin). |\n\n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| symbol | string | Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) |\n| marginMode | string | Margin mode: ISOLATED (isolated), CROSS (cross margin). |\n\n---\n", + "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470264)\n\n:::info[Description]\nThis interface is for the adjustment of the risk limit level(Only valid for isolated Margin). To adjust the level will cancel the open order, the response can only indicate whether the submit of the adjustment request is successful or not. The result of the adjustment can be achieved by WebSocket information: Position Change Events\n\n:::\n\n\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| symbol | string | Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) |\n| level | integer | level |\n\n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | boolean | To adjust the level will cancel the open order, the response can only indicate whether the submit of the adjustment request is successful or not.
|\n\n---\n", "body": { "mode": "raw", - "raw": "{\n \"symbol\": \"XBTUSDTM\",\n \"marginMode\": \"ISOLATED\"\n}", + "raw": "{\n \"symbol\" : \"XBTUSDTM\",\n \"level\" : 2\n}", "options": { "raw": { "language": "json" @@ -15848,9 +15847,10 @@ ], "path": [ "api", - "v2", + "v1", "position", - "changeMarginMode" + "risk-limit-level", + "change" ], "query": [] } @@ -15885,7 +15885,7 @@ } ], "cookie": [], - "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"symbol\": \"XBTUSDTM\",\n \"marginMode\": \"ISOLATED\"\n }\n}" + "body": "{\n \"code\": \"200000\",\n \"data\": true\n}" } ] } @@ -16137,7 +16137,7 @@ } ] }, - "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470267)\n\n:::info[Description]\nSubmit request to get the funding history.\n:::\n\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| dataList | array | Refer to the schema section of dataList |\n| hasMore | boolean | Whether there are more pages
|\n\n**root.data.dataList Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| id | integer | id |\n| symbol | string | Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) |\n| timePoint | integer | Time point (milisecond)
|\n| fundingRate | number | Funding rate
|\n| markPrice | number | Mark price
|\n| positionQty | integer | Position size |\n| positionCost | number | Position value at settlement period
|\n| funding | number | Settled funding fees. A positive number means that the user received the funding fee, and vice versa.
|\n| settleCurrency | string | settlement currency
|\n| context | string | context |\n| marginMode | string | Margin mode: ISOLATED (isolated), CROSS (cross margin). |\n\n---\n", + "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470267)\n\n:::info[Description]\nSubmit request to get the funding history.\n:::\n\n:::tip[Tips]\nThe **from time** and **to time** range cannot exceed 3 month. An error will occur if the specified time window exceeds the range. \n\nIf only **from time** is entered, the default **to time** is the current time. If it exceeds 3 months, an error will be reported.\n\nIf only **to time** is entered, the system will automatically calculate the start time as end time minus 3month.\n:::\n\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| dataList | array | Refer to the schema section of dataList |\n| hasMore | boolean | Whether there are more pages
|\n\n**root.data.dataList Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| id | integer | id |\n| symbol | string | Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) |\n| timePoint | integer | Time point (milisecond)
|\n| fundingRate | number | Funding rate
|\n| markPrice | number | Mark price
|\n| positionQty | integer | Position size |\n| positionCost | number | Position value at settlement period
|\n| funding | number | Settled funding fees. A positive number means that the user received the funding fee, and vice versa.
|\n| settleCurrency | string | settlement currency
|\n| context | string | context |\n| marginMode | string | Margin mode: ISOLATED (isolated), CROSS (cross margin). |\n\n---\n", "body": {} }, "response": [ @@ -17377,11 +17377,6 @@ { "name": "Broker", "item": [ - { - "name": "Beginners", - "item": [], - "description": "" - }, { "name": "API Broker", "item": [ @@ -17505,7 +17500,7 @@ "name": "Exchange Broker", "item": [ { - "name": "Get Broker Rebate", + "name": "Get Broker Info", "request": { "method": "GET", "header": [], @@ -17520,19 +17515,18 @@ "v1", "broker", "nd", - "rebase", - "download" + "info" ], "query": [ { "key": "begin", - "value": "20240610", - "description": "Start time, for example: 20240610" + "value": "20240510", + "description": "Start time, for example: 20230110" }, { "key": "end", "value": "20241010", - "description": "End time, for example: 20241010 (query data with a maximum interval of 6 months)\n" + "description": "End time, for example: 20230210 (query data with a maximum interval of 6 months)\n" }, { "key": "tradeType", @@ -17541,7 +17535,7 @@ } ] }, - "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470281)\n\n:::info[Description]\nThis interface supports downloading Broker rebate orders\n:::\n\n### Excel Response\n\n| Param | Description | Example |\n| ------------------- | ----------------- |--------- |\n| Date | Date | 2024/9/1 |\n| BrokerUID | Broker's UID | 3243241 |\n| AffiliateUID | Affiliate's UID | 2354546 |\n| UID | User's UID | 6345466 |\n| BizLine | Business Line(Spot、Futures) | Spot |\n| Volume | Volume | 0 |\n| TotalCommission | Total Commission = BrokerCommission + UserCommission + AffiliateCommission | 0 |\n| BrokerCommission | Broker Commission | 0 |\n| UserCommission | User Commission | 0 |\n| AffiliateCommission | Affiliate Commission | 0 |\n\n\n\n\n\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| url | string | Rebate order file (link is valid for 1 day) |\n\n---\n", + "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470282)\n\n:::info[Description]\nThis endpoint supports querying the basic information of the current Broker\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| accountSize | integer | Number of sub-accounts created |\n| maxAccountSize | integer | The maximum number of sub-accounts allowed to be created, null means no limit |\n| level | integer | Broker level |\n\n---\n", "body": {} }, "response": [ @@ -17561,19 +17555,18 @@ "v1", "broker", "nd", - "rebase", - "download" + "info" ], "query": [ { "key": "begin", - "value": "20240610", - "description": "Start time, for example: 20240610" + "value": "20240510", + "description": "Start time, for example: 20230110" }, { "key": "end", "value": "20241010", - "description": "End time, for example: 20241010 (query data with a maximum interval of 6 months)\n" + "description": "End time, for example: 20230210 (query data with a maximum interval of 6 months)\n" }, { "key": "tradeType", @@ -17613,14 +17606,14 @@ } ], "cookie": [], - "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"url\": \"https://kc-v2-promotion.s3.ap-northeast-1.amazonaws.com/broker/671aec522593f600019766d0_file.csv?X-Amz-Security-Token=IQo*********2cd90f14efb\"\n }\n}" + "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"accountSize\": 0,\n \"maxAccountSize\": null,\n \"level\": 0\n }\n}" } ] }, { - "name": "Get Broker Info", + "name": "Add SubAccount", "request": { - "method": "GET", + "method": "POST", "header": [], "url": { "raw": "", @@ -17633,34 +17626,26 @@ "v1", "broker", "nd", - "info" + "account" ], - "query": [ - { - "key": "begin", - "value": "20240510", - "description": "Start time, for example: 20230110" - }, - { - "key": "end", - "value": "20241010", - "description": "End time, for example: 20230210 (query data with a maximum interval of 6 months)\n" - }, - { - "key": "tradeType", - "value": "1", - "description": "Transaction type, 1: spot 2: futures" - } - ] + "query": [] }, - "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470282)\n\n:::info[Description]\nThis endpoint supports querying the basic information of the current Broker\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| accountSize | integer | Number of sub-accounts created |\n| maxAccountSize | integer | The maximum number of sub-accounts allowed to be created, null means no limit |\n| level | integer | Broker level |\n\n---\n", - "body": {} + "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470290)\n\n:::info[Description]\nThis endpoint supports Broker users to create sub-accounts\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| accountName | string | Sub Account Name, Note that this name is unique across the exchange. It is recommended to add a special identifier to prevent name duplication. |\n\n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| accountName | string | Sub-Account name
|\n| uid | string | Sub-Account UID |\n| createdAt | integer | Creation time, unix timestamp (milliseconds) |\n| level | integer | Subaccount VIP level |\n\n---\n", + "body": { + "mode": "raw", + "raw": "{\n \"accountName\": \"Account1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + } }, "response": [ { "name": "Successful Response", "originalRequest": { - "method": "GET", + "method": "POST", "header": [], "url": { "raw": "", @@ -17673,25 +17658,9 @@ "v1", "broker", "nd", - "info" + "account" ], - "query": [ - { - "key": "begin", - "value": "20240510", - "description": "Start time, for example: 20230110" - }, - { - "key": "end", - "value": "20241010", - "description": "End time, for example: 20230210 (query data with a maximum interval of 6 months)\n" - }, - { - "key": "tradeType", - "value": "1", - "description": "Transaction type, 1: spot 2: futures" - } - ] + "query": [] } }, "status": "OK", @@ -17724,7 +17693,7 @@ } ], "cookie": [], - "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"accountSize\": 0,\n \"maxAccountSize\": null,\n \"level\": 0\n }\n}" + "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"accountName\": \"Account15\",\n \"uid\": \"226383154\",\n \"createdAt\": 1729819381908,\n \"level\": 0\n }\n}" } ] }, @@ -17840,9 +17809,9 @@ ] }, { - "name": "Get SubAccount API", + "name": "Add SubAccount API", "request": { - "method": "GET", + "method": "POST", "header": [], "url": { "raw": "", @@ -17858,27 +17827,24 @@ "account", "apikey" ], - "query": [ - { - "key": "uid", - "value": "226383154", - "description": "Sub-account UID" - }, - { - "key": "apiKey", - "value": "671afb36cee20f00015cfaf1", - "description": "Sub-account apiKey\n" - } - ] + "query": [] }, - "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470284)\n\n:::info[Description]\nThis interface supports querying the Broker’s sub-account APIKEY\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | array | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| uid | string | Sub-Account UID |\n| label | string | apikey remarks |\n| apiKey | string | apiKey |\n| apiVersion | integer | apiVersion |\n| permissions | array | Refer to the schema section of permissions |\n| ipWhitelist | array | Refer to the schema section of ipWhitelist |\n| createdAt | integer | Creation time, unix timestamp (milliseconds) |\n\n---\n", - "body": {} + "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470291)\n\n:::info[Description]\nThis interface supports the creation of Broker sub-account APIKEY\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| uid | string | Subaccount UID |\n| passphrase | string | API passphrase |\n| ipWhitelist | array | Refer to the schema section of ipWhitelist |\n| permissions | array | Refer to the schema section of permissions |\n| label | string | apikey remarks (length 4~32)
|\n\n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| uid | string | Sub-Account UID |\n| label | string | apikey remarks |\n| apiKey | string | apiKey |\n| secretKey | string | secretKey |\n| apiVersion | integer | apiVersion |\n| permissions | array | Refer to the schema section of permissions |\n| ipWhitelist | array | Refer to the schema section of ipWhitelist |\n| createdAt | integer | Creation time, unix timestamp (milliseconds) |\n\n---\n", + "body": { + "mode": "raw", + "raw": "{\n \"uid\": \"226383154\",\n \"passphrase\": \"11223344\",\n \"ipWhitelist\": [\n \"127.0.0.1\",\"123.123.123.123\"\n ],\n \"permissions\": [\n \"general\",\"spot\"\n ],\n \"label\": \"This is remarks\"\n}", + "options": { + "raw": { + "language": "json" + } + } + } }, "response": [ { "name": "Successful Response", "originalRequest": { - "method": "GET", + "method": "POST", "header": [], "url": { "raw": "", @@ -17894,18 +17860,7 @@ "account", "apikey" ], - "query": [ - { - "key": "uid", - "value": "226383154", - "description": "Sub-account UID" - }, - { - "key": "apiKey", - "value": "671afb36cee20f00015cfaf1", - "description": "Sub-account apiKey\n" - } - ] + "query": [] } }, "status": "OK", @@ -17938,12 +17893,12 @@ } ], "cookie": [], - "body": "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"uid\": \"226383154\",\n \"label\": \"This is remarks\",\n \"apiKey\": \"671afb36cee20f00015cfaf1\",\n \"apiVersion\": 3,\n \"permissions\": [\n \"General\",\n \"Spot\"\n ],\n \"ipWhitelist\": [\n \"127.**.1\",\n \"203.**.154\"\n ],\n \"createdAt\": 1729821494000\n }\n ]\n}" + "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"uid\": \"226383154\",\n \"label\": \"This is remarks\",\n \"apiKey\": \"671afb36cee20f00015cfaf1\",\n \"secretKey\": \"d694df2******5bae05b96\",\n \"apiVersion\": 3,\n \"permissions\": [\n \"General\",\n \"Spot\"\n ],\n \"ipWhitelist\": [\n \"127.0.0.1\",\n \"123.123.123.123\"\n ],\n \"createdAt\": 1729821494000\n }\n}" } ] }, { - "name": "Get Deposit List", + "name": "Get SubAccount API", "request": { "method": "GET", "header": [], @@ -17956,45 +17911,25 @@ "path": [ "api", "v1", - "asset", - "ndbroker", - "deposit", - "list" + "broker", + "nd", + "account", + "apikey" ], "query": [ { - "key": "currency", - "value": "USDT", - "description": "currency" - }, - { - "key": "status", - "value": "SUCCESS", - "description": "Status. Available value: PROCESSING, SUCCESS, FAILURE" - }, - { - "key": "hash", - "value": null, - "description": "hash" - }, - { - "key": "startTimestamp", - "value": null, - "description": "Start time (milisecond)" - }, - { - "key": "endTimestamp", - "value": null, - "description": "End time (milisecond),Default sorting in descending order" + "key": "uid", + "value": "226383154", + "description": "Sub-account UID" }, { - "key": "limit", - "value": "100", - "description": "Maximum number of returned items, maximum 1000, default 1000" + "key": "apiKey", + "value": "671afb36cee20f00015cfaf1", + "description": "Sub-account apiKey\n" } ] }, - "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470285)\n\n:::info[Description]\nThis endpoint can obtain the deposit records of each sub-account under the ND Broker.\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| success | boolean | |\n| code | string | |\n| msg | string | |\n| retry | boolean | |\n| data | array | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| uid | number | deposit uid |\n| hash | string | hash |\n| address | string | Deposit address |\n| memo | string | Address remark. If there’s no remark, it is empty. When you withdraw from other platforms to the KuCoin, you need to fill in memo(tag). If you do not fill memo (tag), your deposit may not be available, please be cautious. |\n| amount | string | Deposit amount |\n| fee | string | Fees charged for deposit |\n| currency | string | currency |\n| isInner | boolean | Internal deposit or not |\n| walletTxId | string | Wallet Txid |\n| status | string | Status. Available value: PROCESSING, SUCCESS, FAILURE |\n| remark | string | remark |\n| chain | string | chain name of currency |\n| createdAt | integer | Creation time of the database record |\n| updatedAt | integer | Update time of the database record |\n\n---\n", + "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470284)\n\n:::info[Description]\nThis interface supports querying the Broker’s sub-account APIKEY\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | array | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| uid | string | Sub-Account UID |\n| label | string | apikey remarks |\n| apiKey | string | apiKey |\n| apiVersion | integer | apiVersion |\n| permissions | array | Refer to the schema section of permissions |\n| ipWhitelist | array | Refer to the schema section of ipWhitelist |\n| createdAt | integer | Creation time, unix timestamp (milliseconds) |\n\n---\n", "body": {} }, "response": [ @@ -18012,41 +17947,21 @@ "path": [ "api", "v1", - "asset", - "ndbroker", - "deposit", - "list" + "broker", + "nd", + "account", + "apikey" ], "query": [ { - "key": "currency", - "value": "USDT", - "description": "currency" - }, - { - "key": "status", - "value": "SUCCESS", - "description": "Status. Available value: PROCESSING, SUCCESS, FAILURE" - }, - { - "key": "hash", - "value": null, - "description": "hash" - }, - { - "key": "startTimestamp", - "value": null, - "description": "Start time (milisecond)" - }, - { - "key": "endTimestamp", - "value": null, - "description": "End time (milisecond),Default sorting in descending order" + "key": "uid", + "value": "226383154", + "description": "Sub-account UID" }, { - "key": "limit", - "value": "100", - "description": "Maximum number of returned items, maximum 1000, default 1000" + "key": "apiKey", + "value": "671afb36cee20f00015cfaf1", + "description": "Sub-account apiKey\n" } ] } @@ -18081,14 +17996,14 @@ } ], "cookie": [], - "body": "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"uid\": 165111215,\n \"hash\": \"6724e363a492800007ec602b\",\n \"address\": \"xxxxxxx@gmail.com\",\n \"memo\": \"\",\n \"amount\": \"3.0\",\n \"fee\": \"0.0\",\n \"currency\": \"USDT\",\n \"isInner\": true,\n \"walletTxId\": \"bbbbbbbbb\",\n \"status\": \"SUCCESS\",\n \"chain\": \"\",\n \"remark\": \"\",\n \"createdAt\": 1730470760000,\n \"updatedAt\": 1730470760000\n }\n ]\n}" + "body": "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"uid\": \"226383154\",\n \"label\": \"This is remarks\",\n \"apiKey\": \"671afb36cee20f00015cfaf1\",\n \"apiVersion\": 3,\n \"permissions\": [\n \"General\",\n \"Spot\"\n ],\n \"ipWhitelist\": [\n \"127.**.1\",\n \"203.**.154\"\n ],\n \"createdAt\": 1729821494000\n }\n ]\n}" } ] }, { - "name": "Get Transfer History", + "name": "Modify SubAccount API", "request": { - "method": "GET", + "method": "POST", "header": [], "url": { "raw": "", @@ -18098,28 +18013,30 @@ ], "path": [ "api", - "v3", + "v1", "broker", "nd", - "transfer", - "detail" + "account", + "update-apikey" ], - "query": [ - { - "key": "orderId", - "value": "671b4600c1e3dd000726866d", - "description": "Transfer Order ID" - } - ] + "query": [] }, - "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470286)\n\n:::info[Description]\nThis endpoint supports querying transfer records of the broker itself and its created sub-accounts.\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| orderId | string | Transfer Order ID |\n| currency | string | Currency |\n| amount | string | Transfer Amount |\n| fromUid | integer | UID of the user transferring out |\n| fromAccountType | string | From Account Type:Account Type: MAIN, TRADE, CONTRACT, MARGIN, ISOLATED |\n| fromAccountTag | string | Trading pair, required if the account type is ISOLATED, e.g., BTC-USDT |\n| toUid | integer | UID of the user transferring in |\n| toAccountType | string | Account Type:Account Type: MAIN, TRADE, CONTRACT, MARGIN, ISOLATED |\n| toAccountTag | string | To Trading pair, required if the account type is ISOLATED, e.g., BTC-USDT |\n| status | string | Status: PROCESSING (processing), SUCCESS (successful), FAILURE (failed) |\n| reason | string | Failure Reason |\n| createdAt | integer | Creation Time (Unix timestamp in milliseconds) |\n\n---\n", - "body": {} + "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470292)\n\n:::info[Description]\nThis interface supports modify the Broker’s sub-account APIKEY\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| uid | string | Subaccount UID |\n| ipWhitelist | array | Refer to the schema section of ipWhitelist |\n| permissions | array | Refer to the schema section of permissions |\n| label | string | apikey remarks (length 4~32)
|\n| apiKey | string | Subaccount apiKey |\n\n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| uid | string | Sub-Account UID |\n| label | string | apikey remarks |\n| apiKey | string | apiKey |\n| apiVersion | integer | apiVersion |\n| permissions | array | Refer to the schema section of permissions |\n| ipWhitelist | array | Refer to the schema section of ipWhitelist |\n| createdAt | integer | Creation time, unix timestamp (milliseconds) |\n\n---\n", + "body": { + "mode": "raw", + "raw": "{\n \"uid\": \"226383154\",\n \"apiKey\": \"671afb36cee20f00015cfaf1\",\n \"ipWhitelist\": [\n \"127.0.0.1\",\n \"123.123.123.123\"\n ],\n \"permissions\": [\n \"general\",\n \"spot\"\n ],\n \"label\": \"This is remarks\"\n}", + "options": { + "raw": { + "language": "json" + } + } + } }, "response": [ { "name": "Successful Response", "originalRequest": { - "method": "GET", + "method": "POST", "header": [], "url": { "raw": "", @@ -18129,19 +18046,13 @@ ], "path": [ "api", - "v3", + "v1", "broker", "nd", - "transfer", - "detail" + "account", + "update-apikey" ], - "query": [ - { - "key": "orderId", - "value": "671b4600c1e3dd000726866d", - "description": "Transfer Order ID" - } - ] + "query": [] } }, "status": "OK", @@ -18174,14 +18085,14 @@ } ], "cookie": [], - "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"orderId\": \"671b4600c1e3dd000726866d\",\n \"currency\": \"USDT\",\n \"amount\": \"1\",\n \"fromUid\": 165111215,\n \"fromAccountType\": \"MAIN\",\n \"fromAccountTag\": \"DEFAULT\",\n \"toUid\": 226383154,\n \"toAccountType\": \"MAIN\",\n \"toAccountTag\": \"DEFAULT\",\n \"status\": \"SUCCESS\",\n \"reason\": null,\n \"createdAt\": 1729840640000\n }\n}" + "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"uid\": \"226383154\",\n \"label\": \"This is remarks\",\n \"apiKey\": \"671afb36cee20f00015cfaf1\",\n \"apiVersion\": 3,\n \"permissions\": [\n \"General\",\n \"Spot\"\n ],\n \"ipWhitelist\": [\n \"127.**.1\",\n \"123.**.123\"\n ],\n \"createdAt\": 1729821494000\n }\n}" } ] }, { - "name": "Get Withdraw Detail", + "name": "Delete SubAccount API", "request": { - "method": "GET", + "method": "DELETE", "header": [], "url": { "raw": "", @@ -18191,28 +18102,33 @@ ], "path": [ "api", - "v3", + "v1", "broker", "nd", - "withdraw", - "detail" + "account", + "apikey" ], "query": [ { - "key": "withdrawalId", - "value": "66617a2***3c9a", - "description": "Withdrawal ID" + "key": "uid", + "value": "226383154", + "description": "Sub-account UID" + }, + { + "key": "apiKey", + "value": "671afb36cee20f00015cfaf1", + "description": "Sub-account apiKey\n" } ] }, - "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470287)\n\n:::info[Description]\nThis endpoint supports querying the withdrawal records of sub-accounts created by a Broker (excluding main account of nd broker).\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| data | object | Refer to the schema section of data |\n| code | string | |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| id | string | Withdrawal ID |\n| chain | string | chain id of currency |\n| walletTxId | string | Wallet Transaction ID |\n| uid | integer | UID |\n| updatedAt | integer | Update Time (milliseconds) |\n| amount | string | Amount |\n| memo | string | Memo |\n| fee | string | Fee |\n| address | string | Address |\n| remark | string | Remark |\n| isInner | boolean | Is Internal (true or false) |\n| currency | string | Currency |\n| status | string | Status (PROCESSING, WALLET_PROCESSING, REVIEW, SUCCESS, FAILURE) |\n| createdAt | integer | Creation Time (milliseconds) |\n\n---\n", + "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470289)\n\n:::info[Description]\nThis interface supports deleting Broker’s sub-account APIKEY\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | boolean | |\n\n---\n", "body": {} }, "response": [ { "name": "Successful Response", "originalRequest": { - "method": "GET", + "method": "DELETE", "header": [], "url": { "raw": "", @@ -18222,17 +18138,22 @@ ], "path": [ "api", - "v3", + "v1", "broker", "nd", - "withdraw", - "detail" + "account", + "apikey" ], "query": [ { - "key": "withdrawalId", - "value": "66617a2***3c9a", - "description": "Withdrawal ID" + "key": "uid", + "value": "226383154", + "description": "Sub-account UID" + }, + { + "key": "apiKey", + "value": "671afb36cee20f00015cfaf1", + "description": "Sub-account apiKey\n" } ] } @@ -18267,14 +18188,14 @@ } ], "cookie": [], - "body": "{\n \"data\": {\n \"id\": \"66617a2***3c9a\",\n \"chain\": \"ton\",\n \"walletTxId\": \"AJ***eRI=\",\n \"uid\": 157267400,\n \"amount\": \"1.00000000\",\n \"memo\": \"7025734\",\n \"fee\": \"0.00000000\",\n \"address\": \"EQDn***dKbGzr\",\n \"remark\": \"\",\n \"isInner\": false,\n \"currency\": \"USDT\",\n \"status\": \"SUCCESS\",\n \"createdAt\": 1717664288000,\n \"updatedAt\": 1717664375000\n },\n \"code\": \"200000\"\n}" + "body": "{\n \"code\": \"200000\",\n \"data\": true\n}" } ] }, { - "name": "Get Deposit Detail", + "name": "Transfer", "request": { - "method": "GET", + "method": "POST", "header": [], "url": { "raw": "", @@ -18284,33 +18205,29 @@ ], "path": [ "api", - "v3", + "v1", "broker", "nd", - "deposit", - "detail" + "transfer" ], - "query": [ - { - "key": "currency", - "value": "USDT", - "description": "Currency" - }, - { - "key": "hash", - "value": "30bb0e0b***4156c5188", - "description": "Hash Value" - } - ] + "query": [] }, - "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470288)\n\n:::info[Description]\nThis endpoint supports querying the deposit record of sub-accounts created by a Broker (excluding main account of nd broker)\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| data | object | Refer to the schema section of data |\n| code | string | |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| chain | string | chain id of currency |\n| hash | string | Hash |\n| walletTxId | string | Wallet Transaction ID |\n| uid | integer | UID |\n| updatedAt | integer | Update Time (milliseconds) |\n| amount | string | Amount |\n| memo | string | Memo |\n| fee | string | Fee |\n| address | string | Address |\n| remark | string | Remark |\n| isInner | boolean | Is Internal (true or false) |\n| currency | string | Currency |\n| status | string | Status (PROCESSING, SUCCESS, FAILURE) |\n| createdAt | integer | Creation Time (milliseconds) |\n\n---\n", - "body": {} + "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470293)\n\n:::info[Description]\nThis endpoint supports fund transfer between Broker account and Broker sub-accounts.\n\nPlease be aware that withdrawal from sub-account is not directly supported. Broker has to transfer funds from broker sub-account to broker account to initiate the withdrawals.\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| currency | string | Currency |\n| amount | string | Transfer Amount (must be a positive integer in the currency's precision) |\n| direction | string | Fund transfer direction: OUT (Broker account is transferred to Broker sub-account), IN (Broker sub-account is transferred to Broker account) |\n| accountType | string | Broker account types: MAIN (Funding account), TRADE (Spot trading account) |\n| specialUid | string | Broker subaccount uid, must be the Broker subaccount created by the current Broker user. |\n| specialAccountType | string | Broker sub-account types: MAIN (Funding account), TRADE (Spot trading account) |\n| clientOid | string | Client Order Id, The unique identifier created by the client. It is recommended to use UUID. The maximum length is 128 bits. |\n\n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| orderId | string | |\n\n---\n", + "body": { + "mode": "raw", + "raw": "{\n \"currency\": \"USDT\",\n \"amount\": \"1\",\n \"clientOid\": \"e6c24d23-6bc2-401b-bf9e-55e2daddfbc1\",\n \"direction\": \"OUT\",\n \"accountType\": \"MAIN\",\n \"specialUid\": \"226383154\",\n \"specialAccountType\": \"MAIN\"\n}", + "options": { + "raw": { + "language": "json" + } + } + } }, "response": [ { "name": "Successful Response", "originalRequest": { - "method": "GET", + "method": "POST", "header": [], "url": { "raw": "", @@ -18320,24 +18237,12 @@ ], "path": [ "api", - "v3", + "v1", "broker", "nd", - "deposit", - "detail" + "transfer" ], - "query": [ - { - "key": "currency", - "value": "USDT", - "description": "Currency" - }, - { - "key": "hash", - "value": "30bb0e0b***4156c5188", - "description": "Hash Value" - } - ] + "query": [] } }, "status": "OK", @@ -18370,14 +18275,14 @@ } ], "cookie": [], - "body": "{\n \"data\": {\n \"chain\": \"trx\",\n \"hash\": \"30bb0e0b***4156c5188\",\n \"walletTxId\": \"30bb0***610d1030f\",\n \"uid\": 201496341,\n \"updatedAt\": 1713429174000,\n \"amount\": \"8.5\",\n \"memo\": \"\",\n \"fee\": \"0.0\",\n \"address\": \"THLPzUrbd1o***vP7d\",\n \"remark\": \"Deposit\",\n \"isInner\": false,\n \"currency\": \"USDT\",\n \"status\": \"SUCCESS\",\n \"createdAt\": 1713429173000\n },\n \"code\": \"200000\"\n}" + "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"orderId\": \"671b4600c1e3dd000726866d\"\n }\n}" } ] }, { - "name": "Delete SubAccount API", + "name": "Get Transfer History", "request": { - "method": "DELETE", + "method": "GET", "header": [], "url": { "raw": "", @@ -18387,33 +18292,28 @@ ], "path": [ "api", - "v1", + "v3", "broker", "nd", - "account", - "apikey" + "transfer", + "detail" ], "query": [ { - "key": "uid", - "value": "226383154", - "description": "Sub-account UID" - }, - { - "key": "apiKey", - "value": "671afb36cee20f00015cfaf1", - "description": "Sub-account apiKey\n" + "key": "orderId", + "value": "671b4600c1e3dd000726866d", + "description": "Transfer Order ID" } ] }, - "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470289)\n\n:::info[Description]\nThis interface supports deleting Broker’s sub-account APIKEY\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | boolean | |\n\n---\n", + "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470286)\n\n:::info[Description]\nThis endpoint supports querying transfer records of the broker itself and its created sub-accounts.\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| orderId | string | Transfer Order ID |\n| currency | string | Currency |\n| amount | string | Transfer Amount |\n| fromUid | integer | UID of the user transferring out |\n| fromAccountType | string | From Account Type:Account Type: MAIN, TRADE, CONTRACT, MARGIN, ISOLATED |\n| fromAccountTag | string | Trading pair, required if the account type is ISOLATED, e.g., BTC-USDT |\n| toUid | integer | UID of the user transferring in |\n| toAccountType | string | Account Type:Account Type: MAIN, TRADE, CONTRACT, MARGIN, ISOLATED |\n| toAccountTag | string | To Trading pair, required if the account type is ISOLATED, e.g., BTC-USDT |\n| status | string | Status: PROCESSING (processing), SUCCESS (successful), FAILURE (failed) |\n| reason | string | Failure Reason |\n| createdAt | integer | Creation Time (Unix timestamp in milliseconds) |\n\n---\n", "body": {} }, "response": [ { "name": "Successful Response", "originalRequest": { - "method": "DELETE", + "method": "GET", "header": [], "url": { "raw": "", @@ -18423,22 +18323,17 @@ ], "path": [ "api", - "v1", + "v3", "broker", "nd", - "account", - "apikey" + "transfer", + "detail" ], "query": [ { - "key": "uid", - "value": "226383154", - "description": "Sub-account UID" - }, - { - "key": "apiKey", - "value": "671afb36cee20f00015cfaf1", - "description": "Sub-account apiKey\n" + "key": "orderId", + "value": "671b4600c1e3dd000726866d", + "description": "Transfer Order ID" } ] } @@ -18467,52 +18362,76 @@ "name": "gw-ratelimit-limit" }, { - "key": "gw-ratelimit-reset", - "value": 29990, - "name": "gw-ratelimit-reset" + "key": "gw-ratelimit-reset", + "value": 29990, + "name": "gw-ratelimit-reset" + } + ], + "cookie": [], + "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"orderId\": \"671b4600c1e3dd000726866d\",\n \"currency\": \"USDT\",\n \"amount\": \"1\",\n \"fromUid\": 165111215,\n \"fromAccountType\": \"MAIN\",\n \"fromAccountTag\": \"DEFAULT\",\n \"toUid\": 226383154,\n \"toAccountType\": \"MAIN\",\n \"toAccountTag\": \"DEFAULT\",\n \"status\": \"SUCCESS\",\n \"reason\": null,\n \"createdAt\": 1729840640000\n }\n}" + } + ] + }, + { + "name": "Get Deposit List", + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "", + "protocol": "https", + "host": [ + "{{broker_endpoint}}" + ], + "path": [ + "api", + "v1", + "asset", + "ndbroker", + "deposit", + "list" + ], + "query": [ + { + "key": "currency", + "value": "USDT", + "description": "currency" + }, + { + "key": "status", + "value": "SUCCESS", + "description": "Status. Available value: PROCESSING, SUCCESS, FAILURE" + }, + { + "key": "hash", + "value": null, + "description": "hash" + }, + { + "key": "startTimestamp", + "value": null, + "description": "Start time (milisecond)" + }, + { + "key": "endTimestamp", + "value": null, + "description": "End time (milisecond),Default sorting in descending order" + }, + { + "key": "limit", + "value": "100", + "description": "Maximum number of returned items, maximum 1000, default 1000" } - ], - "cookie": [], - "body": "{\n \"code\": \"200000\",\n \"data\": true\n}" - } - ] - }, - { - "name": "Add SubAccount", - "request": { - "method": "POST", - "header": [], - "url": { - "raw": "", - "protocol": "https", - "host": [ - "{{broker_endpoint}}" - ], - "path": [ - "api", - "v1", - "broker", - "nd", - "account" - ], - "query": [] + ] }, - "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470290)\n\n:::info[Description]\nThis endpoint supports Broker users to create sub-accounts\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| accountName | string | Sub Account Name, Note that this name is unique across the exchange. It is recommended to add a special identifier to prevent name duplication. |\n\n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| accountName | string | Sub-Account name
|\n| uid | string | Sub-Account UID |\n| createdAt | integer | Creation time, unix timestamp (milliseconds) |\n| level | integer | Subaccount VIP level |\n\n---\n", - "body": { - "mode": "raw", - "raw": "{\n \"accountName\": \"Account1\"\n}", - "options": { - "raw": { - "language": "json" - } - } - } + "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470285)\n\n:::info[Description]\nThis endpoint can obtain the deposit records of each sub-account under the ND Broker.\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| success | boolean | |\n| code | string | |\n| msg | string | |\n| retry | boolean | |\n| data | array | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| uid | number | deposit uid |\n| hash | string | hash |\n| address | string | Deposit address |\n| memo | string | Address remark. If there’s no remark, it is empty. When you withdraw from other platforms to the KuCoin, you need to fill in memo(tag). If you do not fill memo (tag), your deposit may not be available, please be cautious. |\n| amount | string | Deposit amount |\n| fee | string | Fees charged for deposit |\n| currency | string | currency |\n| isInner | boolean | Internal deposit or not |\n| walletTxId | string | Wallet Txid |\n| status | string | Status. Available value: PROCESSING, SUCCESS, FAILURE |\n| remark | string | remark |\n| chain | string | chain name of currency |\n| createdAt | integer | Creation time of the database record |\n| updatedAt | integer | Update time of the database record |\n\n---\n", + "body": {} }, "response": [ { "name": "Successful Response", "originalRequest": { - "method": "POST", + "method": "GET", "header": [], "url": { "raw": "", @@ -18523,11 +18442,43 @@ "path": [ "api", "v1", - "broker", - "nd", - "account" + "asset", + "ndbroker", + "deposit", + "list" ], - "query": [] + "query": [ + { + "key": "currency", + "value": "USDT", + "description": "currency" + }, + { + "key": "status", + "value": "SUCCESS", + "description": "Status. Available value: PROCESSING, SUCCESS, FAILURE" + }, + { + "key": "hash", + "value": null, + "description": "hash" + }, + { + "key": "startTimestamp", + "value": null, + "description": "Start time (milisecond)" + }, + { + "key": "endTimestamp", + "value": null, + "description": "End time (milisecond),Default sorting in descending order" + }, + { + "key": "limit", + "value": "100", + "description": "Maximum number of returned items, maximum 1000, default 1000" + } + ] } }, "status": "OK", @@ -18560,14 +18511,14 @@ } ], "cookie": [], - "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"accountName\": \"Account15\",\n \"uid\": \"226383154\",\n \"createdAt\": 1729819381908,\n \"level\": 0\n }\n}" + "body": "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"uid\": 165111215,\n \"hash\": \"6724e363a492800007ec602b\",\n \"address\": \"xxxxxxx@gmail.com\",\n \"memo\": \"\",\n \"amount\": \"3.0\",\n \"fee\": \"0.0\",\n \"currency\": \"USDT\",\n \"isInner\": true,\n \"walletTxId\": \"bbbbbbbbb\",\n \"status\": \"SUCCESS\",\n \"chain\": \"\",\n \"remark\": \"\",\n \"createdAt\": 1730470760000,\n \"updatedAt\": 1730470760000\n }\n ]\n}" } ] }, { - "name": "Add SubAccount API", + "name": "Get Deposit Detail", "request": { - "method": "POST", + "method": "GET", "header": [], "url": { "raw": "", @@ -18577,30 +18528,33 @@ ], "path": [ "api", - "v1", + "v3", "broker", "nd", - "account", - "apikey" + "deposit", + "detail" ], - "query": [] - }, - "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470291)\n\n:::info[Description]\nThis interface supports the creation of Broker sub-account APIKEY\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| uid | string | Subaccount UID |\n| passphrase | string | API passphrase |\n| ipWhitelist | array | Refer to the schema section of ipWhitelist |\n| permissions | array | Refer to the schema section of permissions |\n| label | string | apikey remarks (length 4~32)
|\n\n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| uid | string | Sub-Account UID |\n| label | string | apikey remarks |\n| apiKey | string | apiKey |\n| secretKey | string | secretKey |\n| apiVersion | integer | apiVersion |\n| permissions | array | Refer to the schema section of permissions |\n| ipWhitelist | array | Refer to the schema section of ipWhitelist |\n| createdAt | integer | Creation time, unix timestamp (milliseconds) |\n\n---\n", - "body": { - "mode": "raw", - "raw": "{\n \"uid\": \"226383154\",\n \"passphrase\": \"11223344\",\n \"ipWhitelist\": [\n \"127.0.0.1\",\"123.123.123.123\"\n ],\n \"permissions\": [\n \"general\",\"spot\"\n ],\n \"label\": \"This is remarks\"\n}", - "options": { - "raw": { - "language": "json" + "query": [ + { + "key": "currency", + "value": "USDT", + "description": "Currency" + }, + { + "key": "hash", + "value": "30bb0e0b***4156c5188", + "description": "Hash Value" } - } - } + ] + }, + "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470288)\n\n:::info[Description]\nThis endpoint supports querying the deposit record of sub-accounts created by a Broker (excluding main account of nd broker)\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| data | object | Refer to the schema section of data |\n| code | string | |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| chain | string | chain id of currency |\n| hash | string | Hash |\n| walletTxId | string | Wallet Transaction ID |\n| uid | integer | UID |\n| updatedAt | integer | Update Time (milliseconds) |\n| amount | string | Amount |\n| memo | string | Memo |\n| fee | string | Fee |\n| address | string | Address |\n| remark | string | Remark |\n| isInner | boolean | Is Internal (true or false) |\n| currency | string | Currency |\n| status | string | Status (PROCESSING, SUCCESS, FAILURE) |\n| createdAt | integer | Creation Time (milliseconds) |\n\n---\n", + "body": {} }, "response": [ { "name": "Successful Response", "originalRequest": { - "method": "POST", + "method": "GET", "header": [], "url": { "raw": "", @@ -18610,13 +18564,24 @@ ], "path": [ "api", - "v1", + "v3", "broker", "nd", - "account", - "apikey" + "deposit", + "detail" ], - "query": [] + "query": [ + { + "key": "currency", + "value": "USDT", + "description": "Currency" + }, + { + "key": "hash", + "value": "30bb0e0b***4156c5188", + "description": "Hash Value" + } + ] } }, "status": "OK", @@ -18649,14 +18614,14 @@ } ], "cookie": [], - "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"uid\": \"226383154\",\n \"label\": \"This is remarks\",\n \"apiKey\": \"671afb36cee20f00015cfaf1\",\n \"secretKey\": \"d694df2******5bae05b96\",\n \"apiVersion\": 3,\n \"permissions\": [\n \"General\",\n \"Spot\"\n ],\n \"ipWhitelist\": [\n \"127.0.0.1\",\n \"123.123.123.123\"\n ],\n \"createdAt\": 1729821494000\n }\n}" + "body": "{\n \"data\": {\n \"chain\": \"trx\",\n \"hash\": \"30bb0e0b***4156c5188\",\n \"walletTxId\": \"30bb0***610d1030f\",\n \"uid\": 201496341,\n \"updatedAt\": 1713429174000,\n \"amount\": \"8.5\",\n \"memo\": \"\",\n \"fee\": \"0.0\",\n \"address\": \"THLPzUrbd1o***vP7d\",\n \"remark\": \"Deposit\",\n \"isInner\": false,\n \"currency\": \"USDT\",\n \"status\": \"SUCCESS\",\n \"createdAt\": 1713429173000\n },\n \"code\": \"200000\"\n}" } ] }, { - "name": "Modify SubAccount API", + "name": "Get Withdraw Detail", "request": { - "method": "POST", + "method": "GET", "header": [], "url": { "raw": "", @@ -18666,30 +18631,28 @@ ], "path": [ "api", - "v1", + "v3", "broker", "nd", - "account", - "update-apikey" + "withdraw", + "detail" ], - "query": [] - }, - "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470292)\n\n:::info[Description]\nThis interface supports modify the Broker’s sub-account APIKEY\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| uid | string | Subaccount UID |\n| ipWhitelist | array | Refer to the schema section of ipWhitelist |\n| permissions | array | Refer to the schema section of permissions |\n| label | string | apikey remarks (length 4~32)
|\n| apiKey | string | Subaccount apiKey |\n\n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| uid | string | Sub-Account UID |\n| label | string | apikey remarks |\n| apiKey | string | apiKey |\n| apiVersion | integer | apiVersion |\n| permissions | array | Refer to the schema section of permissions |\n| ipWhitelist | array | Refer to the schema section of ipWhitelist |\n| createdAt | integer | Creation time, unix timestamp (milliseconds) |\n\n---\n", - "body": { - "mode": "raw", - "raw": "{\n \"uid\": \"226383154\",\n \"apiKey\": \"671afb36cee20f00015cfaf1\",\n \"ipWhitelist\": [\n \"127.0.0.1\",\n \"123.123.123.123\"\n ],\n \"permissions\": [\n \"general\",\n \"spot\"\n ],\n \"label\": \"This is remarks\"\n}", - "options": { - "raw": { - "language": "json" + "query": [ + { + "key": "withdrawalId", + "value": "66617a2***3c9a", + "description": "Withdrawal ID" } - } - } + ] + }, + "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470287)\n\n:::info[Description]\nThis endpoint supports querying the withdrawal records of sub-accounts created by a Broker (excluding main account of nd broker).\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| data | object | Refer to the schema section of data |\n| code | string | |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| id | string | Withdrawal ID |\n| chain | string | chain id of currency |\n| walletTxId | string | Wallet Transaction ID |\n| uid | integer | UID |\n| updatedAt | integer | Update Time (milliseconds) |\n| amount | string | Amount |\n| memo | string | Memo |\n| fee | string | Fee |\n| address | string | Address |\n| remark | string | Remark |\n| isInner | boolean | Is Internal (true or false) |\n| currency | string | Currency |\n| status | string | Status (PROCESSING, WALLET_PROCESSING, REVIEW, SUCCESS, FAILURE) |\n| createdAt | integer | Creation Time (milliseconds) |\n\n---\n", + "body": {} }, "response": [ { "name": "Successful Response", "originalRequest": { - "method": "POST", + "method": "GET", "header": [], "url": { "raw": "", @@ -18699,13 +18662,19 @@ ], "path": [ "api", - "v1", + "v3", "broker", "nd", - "account", - "update-apikey" + "withdraw", + "detail" ], - "query": [] + "query": [ + { + "key": "withdrawalId", + "value": "66617a2***3c9a", + "description": "Withdrawal ID" + } + ] } }, "status": "OK", @@ -18738,14 +18707,14 @@ } ], "cookie": [], - "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"uid\": \"226383154\",\n \"label\": \"This is remarks\",\n \"apiKey\": \"671afb36cee20f00015cfaf1\",\n \"apiVersion\": 3,\n \"permissions\": [\n \"General\",\n \"Spot\"\n ],\n \"ipWhitelist\": [\n \"127.**.1\",\n \"123.**.123\"\n ],\n \"createdAt\": 1729821494000\n }\n}" + "body": "{\n \"data\": {\n \"id\": \"66617a2***3c9a\",\n \"chain\": \"ton\",\n \"walletTxId\": \"AJ***eRI=\",\n \"uid\": 157267400,\n \"amount\": \"1.00000000\",\n \"memo\": \"7025734\",\n \"fee\": \"0.00000000\",\n \"address\": \"EQDn***dKbGzr\",\n \"remark\": \"\",\n \"isInner\": false,\n \"currency\": \"USDT\",\n \"status\": \"SUCCESS\",\n \"createdAt\": 1717664288000,\n \"updatedAt\": 1717664375000\n },\n \"code\": \"200000\"\n}" } ] }, { - "name": "Transfer", + "name": "Get Broker Rebate", "request": { - "method": "POST", + "method": "GET", "header": [], "url": { "raw": "", @@ -18758,26 +18727,35 @@ "v1", "broker", "nd", - "transfer" + "rebase", + "download" ], - "query": [] - }, - "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470293)\n\n:::info[Description]\nThis endpoint supports fund transfer between Broker account and Broker sub-accounts.\n\nPlease be aware that withdrawal from sub-account is not directly supported. Broker has to transfer funds from broker sub-account to broker account to initiate the withdrawals.\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| currency | string | Currency |\n| amount | string | Transfer Amount (must be a positive integer in the currency's precision) |\n| direction | string | Fund transfer direction: OUT (Broker account is transferred to Broker sub-account), IN (Broker sub-account is transferred to Broker account) |\n| accountType | string | Broker account types: MAIN (Funding account), TRADE (Spot trading account) |\n| specialUid | string | Broker subaccount uid, must be the Broker subaccount created by the current Broker user. |\n| specialAccountType | string | Broker sub-account types: MAIN (Funding account), TRADE (Spot trading account) |\n| clientOid | string | Client Order Id, The unique identifier created by the client. It is recommended to use UUID. The maximum length is 128 bits. |\n\n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| orderId | string | |\n\n---\n", - "body": { - "mode": "raw", - "raw": "{\n \"currency\": \"USDT\",\n \"amount\": \"1\",\n \"clientOid\": \"e6c24d23-6bc2-401b-bf9e-55e2daddfbc1\",\n \"direction\": \"OUT\",\n \"accountType\": \"MAIN\",\n \"specialUid\": \"226383154\",\n \"specialAccountType\": \"MAIN\"\n}", - "options": { - "raw": { - "language": "json" + "query": [ + { + "key": "begin", + "value": "20240610", + "description": "Start time, for example: 20240610" + }, + { + "key": "end", + "value": "20241010", + "description": "End time, for example: 20241010 (query data with a maximum interval of 6 months)\n" + }, + { + "key": "tradeType", + "value": "1", + "description": "Transaction type, 1: spot 2: futures" } - } - } + ] + }, + "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470281)\n\n:::info[Description]\nThis interface supports downloading Broker rebate orders\n:::\n\n### Excel Response\n\n| Param | Description | Example |\n| ------------------- | ----------------- |--------- |\n| Date | Date | 2024/9/1 |\n| BrokerUID | Broker's UID | 3243241 |\n| AffiliateUID | Affiliate's UID | 2354546 |\n| UID | User's UID | 6345466 |\n| BizLine | Business Line(Spot、Futures) | Spot |\n| Volume | Volume | 0 |\n| TotalCommission | Total Commission = BrokerCommission + UserCommission + AffiliateCommission | 0 |\n| BrokerCommission | Broker Commission | 0 |\n| UserCommission | User Commission | 0 |\n| AffiliateCommission | Affiliate Commission | 0 |\n\n\n\n\n\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| url | string | Rebate order file (link is valid for 1 day) |\n\n---\n", + "body": {} }, "response": [ { "name": "Successful Response", "originalRequest": { - "method": "POST", + "method": "GET", "header": [], "url": { "raw": "", @@ -18790,9 +18768,26 @@ "v1", "broker", "nd", - "transfer" + "rebase", + "download" ], - "query": [] + "query": [ + { + "key": "begin", + "value": "20240610", + "description": "Start time, for example: 20240610" + }, + { + "key": "end", + "value": "20241010", + "description": "End time, for example: 20241010 (query data with a maximum interval of 6 months)\n" + }, + { + "key": "tradeType", + "value": "1", + "description": "Transaction type, 1: spot 2: futures" + } + ] } }, "status": "OK", @@ -18825,7 +18820,7 @@ } ], "cookie": [], - "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"orderId\": \"671b4600c1e3dd000726866d\"\n }\n}" + "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"url\": \"https://kc-v2-promotion.s3.ap-northeast-1.amazonaws.com/broker/671aec522593f600019766d0_file.csv?X-Amz-Security-Token=IQo*********2cd90f14efb\"\n }\n}" } ] } @@ -18841,7 +18836,7 @@ "type": "text/javascript", "packages": {}, "exec": [ - "\nfunction extractPathVariable(str) {\n const regex = /^\\{\\{(.+?)\\}\\}$/;\n const match = str.match(regex);\n if (match) {\n return match[1];\n }\n return null;\n}\n\nfunction hasAnyFieldEmpty(obj) {\n for (const key in obj) {\n if (obj[key] === \"\" || obj[key] === null || obj[key] === undefined) {\n return true;\n }\n }\n return false;\n}\n\nfunction sign(text, secret) {\n const hash = CryptoJS.HmacSHA256(text, secret);\n return CryptoJS.enc.Base64.stringify(hash)\n}\n\nfunction auth(apiKey, method, url, data) {\n if (hasAnyFieldEmpty(apiKey)) {\n console.warn('The API key-related (or broker-related) information is not configured. Please check the fields in the environment variables.')\n return {'User-Agent': `Kucoin-Universal-Postman-SDK/`}\n }\n\n\n const timestamp = Date.now();\n const text = timestamp + method.toUpperCase() + url + data;\n const signature = sign(text, apiKey.secret);\n const brokerText = timestamp + apiKey.partner + apiKey.key;\n const brokerSignature = sign(brokerText, apiKey.brokerKey);\n return {\n 'KC-API-KEY': apiKey.key,\n 'KC-API-SIGN': signature,\n 'KC-API-TIMESTAMP': timestamp.toString(),\n 'KC-API-PASSPHRASE': sign(apiKey.passphrase || '', apiKey.secret),\n 'Content-Type': 'application/json',\n 'User-Agent': `Kucoin-Universal-Postman-SDK/`,\n 'KC-API-KEY-VERSION': 2,\n 'KC-API-PARTNER': apiKey.partner,\n 'KC-BROKER-NAME': apiKey.brokerName,\n 'KC-API-PARTNER-VERIFY': 'true',\n 'KC-API-PARTNER-SIGN': brokerSignature,\n };\n}\n\nlet key = pm.environment.get('API_KEY')\nlet secret = pm.environment.get('API_SECRET')\nlet passphrase = pm.environment.get('API_PASSPHRASE')\n\nlet brokerName = pm.environment.get('BROKER_NAME')\nlet partner = pm.environment.get('BROKER_PARTNER')\nlet brokerKey = pm.environment.get('BROKER_KEY')\n\nlet url = pm.request.url.getPathWithQuery()\nlet method = pm.request.method\nlet body = pm.request.body ? pm.request.body.toString() : ''\n\nfor (const index in pm.request.url.path) {\n path = pm.request.url.path[index]\n pathVar = extractPathVariable(path)\n if (pathVar != null) {\n let collectionVariable = pm.collectionVariables.get(pathVar);\n if (collectionVariable != null) {\n url = url.replace(path, collectionVariable)\n } else {\n console.warn('no path variable set: ' + path)\n }\n }\n}\n\nheader = auth({\n key: key, passphrase: passphrase, secret: secret, brokerName: brokerName, partner: partner, brokerKey: brokerKey\n}, method, url, body)\n\nfor (const [headerName, headerValue] of Object.entries(header)) {\n pm.request.headers.add({ key: headerName, value: headerValue })\n}" + "\nfunction extractPathVariable(str) {\n const regex = /^\\{\\{(.+?)\\}\\}$/;\n const match = str.match(regex);\n if (match) {\n return match[1];\n }\n return null;\n}\n\nfunction hasAnyFieldEmpty(obj) {\n for (const key in obj) {\n if (obj[key] === \"\" || obj[key] === null || obj[key] === undefined) {\n return true;\n }\n }\n return false;\n}\n\nfunction sign(text, secret) {\n const hash = CryptoJS.HmacSHA256(text, secret);\n return CryptoJS.enc.Base64.stringify(hash)\n}\n\nfunction auth(apiKey, method, url, data) {\n if (hasAnyFieldEmpty(apiKey)) {\n console.warn('The API key-related (or broker-related) information is not configured. Please check the fields in the environment variables.')\n return {'User-Agent': `Kucoin-Universal-Postman-SDK/v1.0.0`}\n }\n\n\n const timestamp = Date.now();\n const text = timestamp + method.toUpperCase() + url + data;\n const signature = sign(text, apiKey.secret);\n const brokerText = timestamp + apiKey.partner + apiKey.key;\n const brokerSignature = sign(brokerText, apiKey.brokerKey);\n return {\n 'KC-API-KEY': apiKey.key,\n 'KC-API-SIGN': signature,\n 'KC-API-TIMESTAMP': timestamp.toString(),\n 'KC-API-PASSPHRASE': sign(apiKey.passphrase || '', apiKey.secret),\n 'Content-Type': 'application/json',\n 'User-Agent': `Kucoin-Universal-Postman-SDK/v1.0.0`,\n 'KC-API-KEY-VERSION': 2,\n 'KC-API-PARTNER': apiKey.partner,\n 'KC-BROKER-NAME': apiKey.brokerName,\n 'KC-API-PARTNER-VERIFY': 'true',\n 'KC-API-PARTNER-SIGN': brokerSignature,\n };\n}\n\nlet key = pm.environment.get('API_KEY')\nlet secret = pm.environment.get('API_SECRET')\nlet passphrase = pm.environment.get('API_PASSPHRASE')\n\nlet brokerName = pm.environment.get('BROKER_NAME')\nlet partner = pm.environment.get('BROKER_PARTNER')\nlet brokerKey = pm.environment.get('BROKER_KEY')\n\nlet url = pm.request.url.getPathWithQuery()\nlet method = pm.request.method\nlet body = pm.request.body ? pm.request.body.toString() : ''\n\nfor (const index in pm.request.url.path) {\n path = pm.request.url.path[index]\n pathVar = extractPathVariable(path)\n if (pathVar != null) {\n let collectionVariable = pm.collectionVariables.get(pathVar);\n if (collectionVariable != null) {\n url = url.replace(path, collectionVariable)\n } else {\n console.warn('no path variable set: ' + path)\n }\n }\n}\n\nheader = auth({\n key: key, passphrase: passphrase, secret: secret, brokerName: brokerName, partner: partner, brokerKey: brokerKey\n}, method, url, body)\n\nfor (const [headerName, headerValue] of Object.entries(header)) {\n pm.request.headers.add({ key: headerName, value: headerValue })\n}" ] } }, @@ -18903,7 +18898,7 @@ "type": "text/javascript", "packages": {}, "exec": [ - "function extractPathVariable(str) {\n const regex = /^\\{\\{(.+?)\\}\\}$/;\n const match = str.match(regex);\n if (match) {\n return match[1];\n }\n return null;\n}\n\nfunction hasAnyFieldEmpty(obj) {\n for (const key in obj) {\n if (obj[key] === \"\" || obj[key] === null || obj[key] === undefined) {\n return true;\n }\n }\n return false;\n}\n\nfunction sign(text, secret) {\n const hash = CryptoJS.HmacSHA256(text, secret);\n return CryptoJS.enc.Base64.stringify(hash)\n}\n\nfunction auth(apiKey, method, url, data) {\n if (hasAnyFieldEmpty(apiKey)) {\n console.warn('The API key-related information is not configured; only the public channel API is accessible.')\n return {'User-Agent': `Kucoin-Universal-Postman-SDK/`}\n }\n\n const timestamp = Date.now();\n const text = timestamp + method.toUpperCase() + url + data;\n const signature = sign(text, apiKey.secret);\n return {\n 'KC-API-KEY': apiKey.key,\n 'KC-API-SIGN': signature,\n 'KC-API-TIMESTAMP': timestamp.toString(),\n 'KC-API-PASSPHRASE': sign(apiKey.passphrase || '', apiKey.secret),\n 'Content-Type': 'application/json',\n 'User-Agent': `Kucoin-Universal-Postman-SDK/`,\n 'KC-API-KEY-VERSION': 2,\n };\n}\n\nlet key = pm.environment.get('API_KEY')\nlet secret = pm.environment.get('API_SECRET')\nlet passphrase = pm.environment.get('API_PASSPHRASE')\n\nlet url = pm.request.url.getPathWithQuery()\nlet method = pm.request.method\nlet body = pm.request.body ? pm.request.body.toString() : ''\n\nfor (const index in pm.request.url.path) {\n path = pm.request.url.path[index]\n pathVar = extractPathVariable(path)\n if (pathVar != null) {\n let collectionVariable = pm.collectionVariables.get(pathVar);\n if (collectionVariable != null) {\n url = url.replace(path, collectionVariable)\n } else {\n console.warn('no path variable set: ' + path)\n }\n }\n}\n\nheader = auth({ key: key, passphrase: passphrase, secret: secret }, method, url, body)\n\nfor (const [headerName, headerValue] of Object.entries(header)) {\n pm.request.headers.add({ key: headerName, value: headerValue })\n}" + "function extractPathVariable(str) {\n const regex = /^\\{\\{(.+?)\\}\\}$/;\n const match = str.match(regex);\n if (match) {\n return match[1];\n }\n return null;\n}\n\nfunction hasAnyFieldEmpty(obj) {\n for (const key in obj) {\n if (obj[key] === \"\" || obj[key] === null || obj[key] === undefined) {\n return true;\n }\n }\n return false;\n}\n\nfunction sign(text, secret) {\n const hash = CryptoJS.HmacSHA256(text, secret);\n return CryptoJS.enc.Base64.stringify(hash)\n}\n\nfunction auth(apiKey, method, url, data) {\n if (hasAnyFieldEmpty(apiKey)) {\n console.warn('The API key-related information is not configured; only the public channel API is accessible.')\n return {'User-Agent': `Kucoin-Universal-Postman-SDK/v1.0.0`}\n }\n\n const timestamp = Date.now();\n const text = timestamp + method.toUpperCase() + url + data;\n const signature = sign(text, apiKey.secret);\n return {\n 'KC-API-KEY': apiKey.key,\n 'KC-API-SIGN': signature,\n 'KC-API-TIMESTAMP': timestamp.toString(),\n 'KC-API-PASSPHRASE': sign(apiKey.passphrase || '', apiKey.secret),\n 'Content-Type': 'application/json',\n 'User-Agent': `Kucoin-Universal-Postman-SDK/v1.0.0`,\n 'KC-API-KEY-VERSION': 2,\n };\n}\n\nlet key = pm.environment.get('API_KEY')\nlet secret = pm.environment.get('API_SECRET')\nlet passphrase = pm.environment.get('API_PASSPHRASE')\n\nlet url = pm.request.url.getPathWithQuery()\nlet method = pm.request.method\nlet body = pm.request.body ? pm.request.body.toString() : ''\n\nfor (const index in pm.request.url.path) {\n path = pm.request.url.path[index]\n pathVar = extractPathVariable(path)\n if (pathVar != null) {\n let collectionVariable = pm.collectionVariables.get(pathVar);\n if (collectionVariable != null) {\n url = url.replace(path, collectionVariable)\n } else {\n console.warn('no path variable set: ' + path)\n }\n }\n}\n\nheader = auth({ key: key, passphrase: passphrase, secret: secret }, method, url, body)\n\nfor (const [headerName, headerValue] of Object.entries(header)) {\n pm.request.headers.add({ key: headerName, value: headerValue })\n}" ] } }, diff --git a/sdk/python/kucoin_universal_sdk/generate/futures/order/api_order.py b/sdk/python/kucoin_universal_sdk/generate/futures/order/api_order.py index ecf2acc2..c5d1aacb 100644 --- a/sdk/python/kucoin_universal_sdk/generate/futures/order/api_order.py +++ b/sdk/python/kucoin_universal_sdk/generate/futures/order/api_order.py @@ -382,7 +382,7 @@ def cancel_all_orders_v3(self, req: CancelAllOrdersV3Req, | API-CHANNEL | PRIVATE | | API-PERMISSION | FUTURES | | API-RATE-LIMIT-POOL | FUTURES | - | API-RATE-LIMIT | 30 | + | API-RATE-LIMIT | 10 | +---------------------+---------+ """ pass diff --git a/sdk/python/kucoin_universal_sdk/generate/futures/order/model_cancel_all_orders_v3_req.py b/sdk/python/kucoin_universal_sdk/generate/futures/order/model_cancel_all_orders_v3_req.py index 1ab329f0..c345cb28 100644 --- a/sdk/python/kucoin_universal_sdk/generate/futures/order/model_cancel_all_orders_v3_req.py +++ b/sdk/python/kucoin_universal_sdk/generate/futures/order/model_cancel_all_orders_v3_req.py @@ -15,13 +15,13 @@ class CancelAllOrdersV3Req(BaseModel): CancelAllOrdersV3Req Attributes: - symbol (str): Cancel all limit orders for a specific contract only, If not specified, all the limit orders will be deleted, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) + symbol (str): Cancel all limit orders for a specific symbol only, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) """ symbol: Optional[str] = Field( default=None, description= - "Cancel all limit orders for a specific contract only, If not specified, all the limit orders will be deleted, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) " + "Cancel all limit orders for a specific symbol only, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) " ) __properties: ClassVar[List[str]] = ["symbol"] @@ -70,7 +70,7 @@ def __init__(self): def set_symbol(self, value: str) -> CancelAllOrdersV3ReqBuilder: """ - Cancel all limit orders for a specific contract only, If not specified, all the limit orders will be deleted, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) + Cancel all limit orders for a specific symbol only, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) """ self.obj['symbol'] = value return self diff --git a/sdk/python/kucoin_universal_sdk/generate/version.py b/sdk/python/kucoin_universal_sdk/generate/version.py index f09ff019..162e5f47 100644 --- a/sdk/python/kucoin_universal_sdk/generate/version.py +++ b/sdk/python/kucoin_universal_sdk/generate/version.py @@ -1,2 +1,2 @@ sdk_version = "v1.0.0" -sdk_generate_date = "2024-12-30" +sdk_generate_date = "2025-01-15" diff --git a/spec/apis.csv b/spec/apis.csv index a9eb5a6c..7c98119e 100644 --- a/spec/apis.csv +++ b/spec/apis.csv @@ -1,47 +1,47 @@ service,subservice,path,method,name account,account,/api/v2/user-info,get,Get Account Summary Info +account,account,/api/v1/user/api-key,get,Get Apikey Info account,account,/api/v1/hf/accounts/opened,get,Get Account Type - Spot -account,account,/api/v1/accounts/ledgers,get,Get Account Ledgers - Spot/Margin -account,account,/api/v1/hf/accounts/ledgers,get,Get Account Ledgers - Trade_hf -account,account,/api/v3/hf/margin/account/ledgers,get,Get Account Ledgers - Margin_hf -account,account,/api/v1/transaction-history,get,Get Account Ledgers - Futures account,account,/api/v1/accounts,get,Get Account List - Spot account,account,/api/v1/accounts/{accountId},get,Get Account Detail - Spot account,account,/api/v3/margin/accounts,get,Get Account - Cross Margin account,account,/api/v3/isolated/accounts,get,Get Account - Isolated Margin account,account,/api/v1/account-overview,get,Get Account - Futures -account,account,/api/v1/user/api-key,get,Get Apikey Info +account,account,/api/v1/accounts/ledgers,get,Get Account Ledgers - Spot/Margin +account,account,/api/v1/hf/accounts/ledgers,get,Get Account Ledgers - Trade_hf +account,account,/api/v3/hf/margin/account/ledgers,get,Get Account Ledgers - Margin_hf +account,account,/api/v1/transaction-history,get,Get Account Ledgers - Futures account,account,/api/v1/margin/account,get,Get Account Detail - Margin account,account,/api/v1/isolated/accounts,get,Get Account List - Isolated Margin - V1 account,account,/api/v1/isolated/account/{symbol},get,Get Account Detail - Isolated Margin - V1 +account,subaccount,/api/v2/sub/user/created,post,Add SubAccount +account,subaccount,/api/v3/sub/user/margin/enable,post,Add SubAccount Margin Permission +account,subaccount,/api/v3/sub/user/futures/enable,post,Add SubAccount Futures Permission account,subaccount,/api/v2/sub/user,get,Get SubAccount List - Summary Info account,subaccount,/api/v1/sub-accounts/{subUserId},get,Get SubAccount Detail - Balance account,subaccount,/api/v2/sub-accounts,get,Get SubAccount List - Spot Balance(V2) account,subaccount,/api/v1/account-overview-all,get,Get SubAccount List - Futures Balance(V2) -account,subaccount,/api/v2/sub/user/created,post,Add SubAccount -account,subaccount,/api/v3/sub/user/margin/enable,post,Add SubAccount Margin Permission -account,subaccount,/api/v3/sub/user/futures/enable,post,Add SubAccount Futures Permission -account,subaccount,/api/v1/sub/api-key,get,Get SubAccount API List -account,subaccount,/api/v1/sub/api-key,delete,Delete SubAccount API account,subaccount,/api/v1/sub/api-key,post,Add SubAccount API account,subaccount,/api/v1/sub/api-key/update,post,Modify SubAccount API +account,subaccount,/api/v1/sub/api-key,get,Get SubAccount API List +account,subaccount,/api/v1/sub/api-key,delete,Delete SubAccount API account,subaccount,/api/v1/sub/user,get,Get SubAccount List - Summary Info(V1) account,subaccount,/api/v1/sub-accounts,get,Get SubAccount List - Spot Balance(V1) +account,deposit,/api/v3/deposit-address/create,post,Add Deposit Address(V3) account,deposit,/api/v3/deposit-addresses,get,Get Deposit Address(V3) account,deposit,/api/v1/deposits,get,Get Deposit History -account,deposit,/api/v3/deposit-address/create,post,Add Deposit Address(V3) account,deposit,/api/v2/deposit-addresses,get,Get Deposit Addresses(V2) account,deposit,/api/v1/deposit-addresses,get,Get Deposit Addresses - V1 account,deposit,/api/v1/hist-deposits,get,Get Deposit History - Old account,deposit,/api/v1/deposit-addresses,post,Add Deposit Address - V1 account,withdrawal,/api/v1/withdrawals/quotas,get,Get Withdrawal Quotas +account,withdrawal,/api/v3/withdrawals,post,Withdraw(V3) account,withdrawal,/api/v1/withdrawals/{withdrawalId},delete,Cancel Withdrawal account,withdrawal,/api/v1/withdrawals,get,Get Withdrawal History -account,withdrawal,/api/v3/withdrawals,post,Withdraw(V3) account,withdrawal,/api/v1/hist-withdrawals,get,Get Withdrawal History - Old account,withdrawal,/api/v1/withdrawals,post,Withdraw - V1 -account,transfer,/api/v3/accounts/universal-transfer,post,Flex Transfer account,transfer,/api/v1/accounts/transferable,get,Get Transfer Quotas +account,transfer,/api/v3/accounts/universal-transfer,post,Flex Transfer account,transfer,/api/v2/accounts/sub-transfer,post,SubAccount Transfer account,transfer,/api/v2/accounts/inner-transfer,post,Inner Transfer account,transfer,/api/v3/transfer-out,post,Futures Account Transfer Out @@ -50,153 +50,153 @@ account,transfer,/api/v1/transfer-list,get,Get Futures Account Transfer Out Ledg account,fee,/api/v1/base-fee,get,Get Basic Fee - Spot/Margin account,fee,/api/v1/trade-fees,get,Get Actual Fee - Spot/Margin account,fee,/api/v1/trade-fees,get,Get Actual Fee - Futures -spot,market,/api/v3/currencies,get,Get All Currencies -spot,market,/api/v1/prices,get,Get Fiat Price -spot,market,/api/v2/symbols,get,Get All Symbols -spot,market,/api/v3/currencies/{currency},get,Get Currency -spot,market,/api/v1/timestamp,get,Get Server Time spot,market,/api/v3/announcements,get,Get Announcements -spot,market,/api/v1/status,get,Get Service Status +spot,market,/api/v3/currencies/{currency},get,Get Currency +spot,market,/api/v3/currencies,get,Get All Currencies spot,market,/api/v2/symbols/{symbol},get,Get Symbol +spot,market,/api/v2/symbols,get,Get All Symbols spot,market,/api/v1/market/orderbook/level1,get,Get Ticker -spot,market,/api/v1/market/stats,get,Get 24hr Stats +spot,market,/api/v1/market/allTickers,get,Get All Tickers spot,market,/api/v1/market/histories,get,Get Trade History spot,market,/api/v1/market/candles,get,Get Klines -spot,market,/api/v3/market/orderbook/level2,get,Get Full OrderBook spot,market,/api/v1/market/orderbook/level2_{size},get,Get Part OrderBook +spot,market,/api/v3/market/orderbook/level2,get,Get Full OrderBook +spot,market,/api/v1/prices,get,Get Fiat Price +spot,market,/api/v1/market/stats,get,Get 24hr Stats spot,market,/api/v1/markets,get,Get Market List -spot,market,/api/v1/market/allTickers,get,Get All Tickers +spot,market,/api/v1/timestamp,get,Get Server Time +spot,market,/api/v1/status,get,Get Service Status spot,market,/api/v1/bullet-public,post,Get Public Token - Spot/Margin spot,market,/api/v1/bullet-private,post,Get Private Token - Spot/Margin +spot,order,/api/v1/hf/orders,post,Add Order +spot,order,/api/v1/hf/orders/sync,post,Add Order Sync +spot,order,/api/v1/hf/orders/test,post,Add Order Test spot,order,/api/v1/hf/orders/multi,post,Batch Add Orders spot,order,/api/v1/hf/orders/multi/sync,post,Batch Add Orders Sync -spot,order,/api/v1/hf/orders/sync,post,Add Order Sync -spot,order,/api/v1/hf/orders/alter,post,Modify Order -spot,order,/api/v1/hf/orders/dead-cancel-all/query,get,Get DCP -spot,order,/api/v1/hf/orders/dead-cancel-all,post,Set DCP spot,order,/api/v1/hf/orders/{orderId},delete,Cancel Order By OrderId -spot,order,/api/v1/stop-order/{orderId},delete,Cancel Stop Order By OrderId +spot,order,/api/v1/hf/orders/sync/{orderId},delete,Cancel Order By OrderId Sync +spot,order,/api/v1/hf/orders/client-order/{clientOid},delete,Cancel Order By ClientOid +spot,order,/api/v1/hf/orders/sync/client-order/{clientOid},delete,Cancel Order By ClientOid Sync +spot,order,/api/v1/hf/orders/cancel/{orderId},delete,Cancel Partial Order spot,order,/api/v1/hf/orders,delete,Cancel All Orders By Symbol spot,order,/api/v1/hf/orders/cancelAll,delete,Cancel All Orders -spot,order,/api/v3/oco/order/{orderId},delete,Cancel OCO Order By OrderId +spot,order,/api/v1/hf/orders/alter,post,Modify Order +spot,order,/api/v1/hf/orders/{orderId},get,Get Order By OrderId +spot,order,/api/v1/hf/orders/client-order/{clientOid},get,Get Order By ClientOid spot,order,/api/v1/hf/orders/active/symbols,get,Get Symbols With Open Order spot,order,/api/v1/hf/orders/active,get,Get Open Orders -spot,order,/api/v1/stop-order,get,Get Stop Orders List spot,order,/api/v1/hf/orders/done,get,Get Closed Orders +spot,order,/api/v1/hf/fills,get,Get Trade History +spot,order,/api/v1/hf/orders/dead-cancel-all/query,get,Get DCP +spot,order,/api/v1/hf/orders/dead-cancel-all,post,Set DCP +spot,order,/api/v1/stop-order,post,Add Stop Order +spot,order,/api/v1/stop-order/cancelOrderByClientOid,delete,Cancel Stop Order By ClientOid +spot,order,/api/v1/stop-order/{orderId},delete,Cancel Stop Order By OrderId +spot,order,/api/v1/stop-order/cancel,delete,Batch Cancel Stop Orders +spot,order,/api/v1/stop-order,get,Get Stop Orders List spot,order,/api/v1/stop-order/{orderId},get,Get Stop Order By OrderId spot,order,/api/v1/stop-order/queryOrderByClientOid,get,Get Stop Order By ClientOid -spot,order,/api/v1/stop-order/cancel,delete,Batch Cancel Stop Orders +spot,order,/api/v3/oco/order,post,Add OCO Order +spot,order,/api/v3/oco/order/{orderId},delete,Cancel OCO Order By OrderId +spot,order,/api/v3/oco/client-order/{clientOid},delete,Cancel OCO Order By ClientOid spot,order,/api/v3/oco/orders,delete,Batch Cancel OCO Order -spot,order,/api/v1/hf/fills,get,Get Trade History spot,order,/api/v3/oco/order/{orderId},get,Get OCO Order By OrderId -spot,order,/api/v3/oco/orders,get,Get OCO Order List -spot,order,/api/v3/oco/order/details/{orderId},get,Get OCO Order Detail By OrderId -spot,order,/api/v1/hf/orders/{orderId},get,Get Order By OrderId spot,order,/api/v3/oco/client-order/{clientOid},get,Get OCO Order By ClientOid -spot,order,/api/v1/hf/orders/client-order/{clientOid},get,Get Order By ClientOid -spot,order,/api/v3/oco/client-order/{clientOid},delete,Cancel OCO Order By ClientOid -spot,order,/api/v1/hf/orders/cancel/{orderId},delete,Cancel Partial Order -spot,order,/api/v1/hf/orders/client-order/{clientOid},delete,Cancel Order By ClientOid -spot,order,/api/v1/stop-order/cancelOrderByClientOid,delete,Cancel Stop Order By ClientOid -spot,order,/api/v1/hf/orders/sync/{orderId},delete,Cancel Order By OrderId Sync -spot,order,/api/v1/hf/orders/sync/client-order/{clientOid},delete,Cancel Order By ClientOid Sync -spot,order,/api/v1/hf/orders/test,post,Add Order Test -spot,order,/api/v1/hf/orders,post,Add Order -spot,order,/api/v3/oco/order,post,Add OCO Order -spot,order,/api/v1/stop-order,post,Add Stop Order +spot,order,/api/v3/oco/order/details/{orderId},get,Get OCO Order Detail By OrderId +spot,order,/api/v3/oco/orders,get,Get OCO Order List +spot,order,/api/v1/orders,post,Add Order - Old +spot,order,/api/v1/orders/test,post,Add Order Test - Old +spot,order,/api/v1/orders/multi,post,Batch Add Orders - Old spot,order,/api/v1/orders/{orderId},delete,Cancel Order By OrderId - Old +spot,order,/api/v1/order/client-order/{clientOid},delete,Cancel Order By ClientOid - Old +spot,order,/api/v1/orders,delete,Batch Cancel Order - Old spot,order,/api/v1/orders,get,Get Orders List - Old spot,order,/api/v1/limit/orders,get,Get Recent Orders List - Old spot,order,/api/v1/orders/{orderId},get,Get Order By OrderId - Old spot,order,/api/v1/order/client-order/{clientOid},get,Get Order By ClientOid - Old -spot,order,/api/v1/orders,delete,Batch Cancel Order - Old spot,order,/api/v1/fills,get,Get Trade History - Old spot,order,/api/v1/limit/fills,get,Get Recent Trade History - Old -spot,order,/api/v1/order/client-order/{clientOid},delete,Cancel Order By ClientOid - Old -spot,order,/api/v1/orders,post,Add Order - Old -spot,order,/api/v1/orders/multi,post,Batch Add Orders - Old -spot,order,/api/v1/orders/test,post,Add Order Test - Old margin,market,/api/v3/margin/symbols,get,Get Symbols - Cross Margin margin,market,/api/v1/margin/config,get,Get Margin Config margin,market,/api/v3/etf/info,get,Get ETF Info margin,market,/api/v3/mark-price/all-symbols,get,Get Mark Price List margin,market,/api/v1/mark-price/{symbol}/current,get,Get Mark Price Detail margin,market,/api/v1/isolated/symbols,get,Get Symbols - Isolated Margin +margin,order,/api/v3/hf/margin/order,post,Add Order +margin,order,/api/v3/hf/margin/order/test,post,Add Order Test margin,order,/api/v3/hf/margin/orders/{orderId},delete,Cancel Order By OrderId -margin,order,/api/v3/hf/margin/order/active/symbols,get,Get Symbols With Open Order +margin,order,/api/v3/hf/margin/orders/client-order/{clientOid},delete,Cancel Order By ClientOid margin,order,/api/v3/hf/margin/orders,delete,Cancel All Orders By Symbol +margin,order,/api/v3/hf/margin/order/active/symbols,get,Get Symbols With Open Order margin,order,/api/v3/hf/margin/orders/active,get,Get Open Orders margin,order,/api/v3/hf/margin/orders/done,get,Get Closed Orders margin,order,/api/v3/hf/margin/fills,get,Get Trade History -margin,order,/api/v3/hf/margin/orders/client-order/{clientOid},delete,Cancel Order By ClientOid margin,order,/api/v3/hf/margin/orders/{orderId},get,Get Order By OrderId margin,order,/api/v3/hf/margin/orders/client-order/{clientOid},get,Get Order By ClientOid -margin,order,/api/v3/hf/margin/order,post,Add Order -margin,order,/api/v3/hf/margin/order/test,post,Add Order Test margin,order,/api/v1/margin/order,post,Add Order - V1 margin,order,/api/v1/margin/order/test,post,Add Order Test - V1 margin,debit,/api/v3/margin/borrow,post,Borrow margin,debit,/api/v3/margin/borrow,get,Get Borrow History +margin,debit,/api/v3/margin/repay,post,Repay margin,debit,/api/v3/margin/repay,get,Get Repay History margin,debit,/api/v3/margin/interest,get,Get Interest History -margin,debit,/api/v3/margin/repay,post,Repay margin,debit,/api/v3/position/update-user-leverage,post,Modify Leverage margin,credit,/api/v3/project/list,get,Get Loan Market -margin,credit,/api/v3/purchase/orders,get,Get Purchase Orders -margin,credit,/api/v3/redeem/orders,get,Get Redeem Orders margin,credit,/api/v3/project/marketInterestRate,get,Get Loan Market Interest Rate margin,credit,/api/v3/purchase,post,Purchase margin,credit,/api/v3/lend/purchase/update,post,Modify Purchase +margin,credit,/api/v3/purchase/orders,get,Get Purchase Orders margin,credit,/api/v3/redeem,post,Redeem +margin,credit,/api/v3/redeem/orders,get,Get Redeem Orders margin,risklimit,/api/v3/margin/currencies,get,Get Margin Risk Limit -futures,market,/api/v1/contracts/active,get,Get All Symbols futures,market,/api/v1/contracts/{symbol},get,Get Symbol +futures,market,/api/v1/contracts/active,get,Get All Symbols futures,market,/api/v1/ticker,get,Get Ticker futures,market,/api/v1/allTickers,get,Get All Tickers futures,market,/api/v1/level2/snapshot,get,Get Full OrderBook futures,market,/api/v1/level2/depth{size},get,Get Part OrderBook +futures,market,/api/v1/trade/history,get,Get Trade History +futures,market,/api/v1/kline/query,get,Get Klines +futures,market,/api/v1/mark-price/{symbol}/current,get,Get Mark Price +futures,market,/api/v1/index/query,get,Get Spot Index Price futures,market,/api/v1/interest/query,get,Get Interest Rate Index futures,market,/api/v1/premium/query,get,Get Premium Index futures,market,/api/v1/trade-statistics,get,Get 24hr Stats futures,market,/api/v1/timestamp,get,Get Server Time futures,market,/api/v1/status,get,Get Service Status -futures,market,/api/v1/index/query,get,Get Spot Index Price -futures,market,/api/v1/trade/history,get,Get Trade History -futures,market,/api/v1/mark-price/{symbol}/current,get,Get Mark Price -futures,market,/api/v1/kline/query,get,Get Klines -futures,market,/api/v1/bullet-private,post,Get Private Token - Futures futures,market,/api/v1/bullet-public,post,Get Public Token - Futures +futures,market,/api/v1/bullet-private,post,Get Private Token - Futures futures,order,/api/v1/orders,post,Add Order -futures,order,/api/v1/fills,get,Get Trade History +futures,order,/api/v1/orders/test,post,Add Order Test futures,order,/api/v1/orders/multi,post,Batch Add Orders -futures,order,/api/v1/recentFills,get,Get Recent Trade History futures,order,/api/v1/st-orders,post,Add Take Profit And Stop Loss Order -futures,order,/api/v1/openOrderStatistics,get,Get Open Order Value -futures,order,/api/v1/orders/test,post,Add Order Test futures,order,/api/v1/orders/{orderId},delete,Cancel Order By OrderId futures,order,/api/v1/orders/client-order/{clientOid},delete,Cancel Order By ClientOid futures,order,/api/v1/orders/multi-cancel,delete,Batch Cancel Orders futures,order,/api/v3/orders,delete,Cancel All Orders futures,order,/api/v1/stopOrders,delete,Cancel All Stop orders -futures,order,/api/v1/orders,get,Get Order List futures,order,/api/v1/orders/{order-id},get,Get Order By OrderId futures,order,/api/v1/orders/byClientOid,get,Get Order By ClientOid +futures,order,/api/v1/orders,get,Get Order List futures,order,/api/v1/recentDoneOrders,get,Get Recent Closed Orders futures,order,/api/v1/stopOrders,get,Get Stop Order List +futures,order,/api/v1/openOrderStatistics,get,Get Open Order Value +futures,order,/api/v1/recentFills,get,Get Recent Trade History +futures,order,/api/v1/fills,get,Get Trade History futures,order,/api/v1/orders,delete,Cancel All Orders - V1 +futures,positions,/api/v2/position/getMarginMode,get,Get Margin Mode +futures,positions,/api/v2/position/changeMarginMode,post,Switch Margin Mode futures,positions,/api/v2/getMaxOpenSize,get,Get Max Open Size -futures,positions,/api/v1/contracts/risk-limit/{symbol},get,Get Isolated Margin Risk Limit futures,positions,/api/v1/position,get,Get Position Details -futures,positions,/api/v1/position/risk-limit-level/change,post,Modify Isolated Margin Risk Limit futures,positions,/api/v1/positions,get,Get Position List futures,positions,/api/v1/history-positions,get,Get Positions History -futures,positions,/api/v1/margin/withdrawMargin,post,Remove Isolated Margin -futures,positions,/api/v1/position/margin/deposit-margin,post,Add Isolated Margin futures,positions,/api/v1/margin/maxWithdrawMargin,get,Get Max Withdraw Margin -futures,positions,/api/v2/position/getMarginMode,get,Get Margin Mode futures,positions,/api/v2/getCrossUserLeverage,get,Get Cross Margin Leverage futures,positions,/api/v2/changeCrossUserLeverage,post,Modify Cross Margin Leverage -futures,positions,/api/v2/position/changeMarginMode,post,Switch Margin Mode +futures,positions,/api/v1/position/margin/deposit-margin,post,Add Isolated Margin +futures,positions,/api/v1/margin/withdrawMargin,post,Remove Isolated Margin +futures,positions,/api/v1/contracts/risk-limit/{symbol},get,Get Isolated Margin Risk Limit +futures,positions,/api/v1/position/risk-limit-level/change,post,Modify Isolated Margin Risk Limit futures,positions,/api/v1/position/margin/auto-deposit-status,post,Modify Isolated Margin Auto-Deposit Status futures,fundingfees,/api/v1/funding-rate/{symbol}/current,get,Get Current Funding Rate futures,fundingfees,/api/v1/contract/funding-rates,get,Get Public Funding History @@ -214,16 +214,16 @@ viplending,viplending,/api/v1/otc-loan/loan,get,Get Account Detail viplending,viplending,/api/v1/otc-loan/accounts,get,Get Accounts affiliate,affiliate,/api/v2/affiliate/inviter/statistics,get,Get Account broker,apibroker,/api/v1/broker/api/rebase/download,get,Get Broker Rebate -broker,ndbroker,/api/v1/broker/nd/rebase/download,get,Get Broker Rebate broker,ndbroker,/api/v1/broker/nd/info,get,Get Broker Info -broker,ndbroker,/api/v1/broker/nd/account,get,Get SubAccount -broker,ndbroker,/api/v1/broker/nd/account/apikey,get,Get SubAccount API -broker,ndbroker,/api/v1/asset/ndbroker/deposit/list,get,Get Deposit List -broker,ndbroker,/api/v3/broker/nd/transfer/detail,get,Get Transfer History -broker,ndbroker,/api/v3/broker/nd/withdraw/detail,get,Get Withdraw Detail -broker,ndbroker,/api/v3/broker/nd/deposit/detail,get,Get Deposit Detail -broker,ndbroker,/api/v1/broker/nd/account/apikey,delete,Delete SubAccount API broker,ndbroker,/api/v1/broker/nd/account,post,Add SubAccount +broker,ndbroker,/api/v1/broker/nd/account,get,Get SubAccount broker,ndbroker,/api/v1/broker/nd/account/apikey,post,Add SubAccount API +broker,ndbroker,/api/v1/broker/nd/account/apikey,get,Get SubAccount API broker,ndbroker,/api/v1/broker/nd/account/update-apikey,post,Modify SubAccount API +broker,ndbroker,/api/v1/broker/nd/account/apikey,delete,Delete SubAccount API broker,ndbroker,/api/v1/broker/nd/transfer,post,Transfer +broker,ndbroker,/api/v3/broker/nd/transfer/detail,get,Get Transfer History +broker,ndbroker,/api/v1/asset/ndbroker/deposit/list,get,Get Deposit List +broker,ndbroker,/api/v3/broker/nd/deposit/detail,get,Get Deposit Detail +broker,ndbroker,/api/v3/broker/nd/withdraw/detail,get,Get Withdraw Detail +broker,ndbroker,/api/v1/broker/nd/rebase/download,get,Get Broker Rebate diff --git a/spec/original/meta.json b/spec/original/meta.json index 5a45118b..f674d8a1 100644 --- a/spec/original/meta.json +++ b/spec/original/meta.json @@ -150,20 +150,20 @@ } }, { - "name": "Get Account Type - Spot ", + "name": "Get Apikey Info", "api": { - "id": "3470120", + "id": "3470130", "method": "get", - "path": "/api/v1/hf/accounts/opened", + "path": "/api/v1/user/api-key", "parameters": { - "path": [], "query": [], + "path": [], "cookie": [], "header": [] }, "responses": [ { - "id": "10084", + "id": "10094", "code": 200, "name": "OK", "headers": [], @@ -174,8 +174,55 @@ "type": "string" }, "data": { - "type": "boolean", - "description": "Spot account type. True means the current user is a high-frequency spot user, False means the current user is a low-frequency spot user" + "type": "object", + "properties": { + "remark": { + "type": "string", + "description": "Remarks" + }, + "apiKey": { + "type": "string", + "description": "Apikey" + }, + "apiVersion": { + "type": "integer", + "description": "API Version" + }, + "permission": { + "type": "string", + "description": "[Permissions](apidog://link/pages/338144), possible values: General, Spot, Margin, Futures, InnerTransfer, Transfer, Earn" + }, + "ipWhitelist": { + "type": "string", + "description": "IP whitelist\n\n" + }, + "createdAt": { + "type": "integer", + "description": "Apikey create time", + "format": "int64" + }, + "uid": { + "type": "integer", + "description": "Account UID" + }, + "isMaster": { + "type": "boolean", + "description": "Whether it is the master account." + }, + "subName": { + "type": "string", + "description": "Sub Name, There is no such param for the master account" + } + }, + "required": [ + "remark", + "apiKey", + "apiVersion", + "permission", + "createdAt", + "uid", + "isMaster" + ] } }, "required": [ @@ -191,8 +238,8 @@ "responseExamples": [ { "name": "Success", - "data": "{\"code\":\"200000\",\"data\":false}", - "responseId": 10084, + "data": "{\n \"code\": \"200000\",\n \"data\": {\n \"remark\": \"account1\",\n \"apiKey\": \"6705f5c311545b000157d3eb\",\n \"apiVersion\": 3,\n \"permission\": \"General,Futures,Spot,Earn,InnerTransfer,Transfer,Margin\",\n \"ipWhitelist\": \"203.**.154,103.**.34\",\n \"createdAt\": 1728443843000,\n \"uid\": 165111215,\n \"isMaster\": true\n }\n}", + "responseId": 10094, "ordering": 1 } ], @@ -205,129 +252,25 @@ }, "mediaType": "" }, - "description": ":::info[Description]\nThis interface determines whether the current user is a spot high-frequency user or a spot low-frequency user.\n:::\n\n:::tip[Tips]\nThis interface is a compatibility interface left over from the old version upgrade. Only some old users need to use it (high frequency will be opened before 2024 and trade_hf has been used). Most user do not need to use this interface. When the return is true, you need to use trade_hf to transfer assets and query assets When the return is false, you need to use trade to transfer assets and query assets.\n:::", - "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"General\",\"api-rate-limit-pool\":\"Spot\",\"sdk-service\":\"Account\",\"sdk-sub-service\":\"Account\",\"sdk-method-name\":\"getSpotAccountType\",\"sdk-method-description\":\"This interface determines whether the current user is a spot high-frequency user or a spot low-frequency user.\",\"api-rate-limit\":30}" + "description": ":::info[Description]\nGet the information of the api key. Use the api key pending to be checked to call the endpoint. Both master and sub user's api key are applicable.\n:::", + "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"General\",\"api-rate-limit-pool\":\"Management\",\"sdk-service\":\"Account\",\"sdk-sub-service\":\"Account\",\"sdk-method-name\":\"getApikeyInfo\",\"sdk-method-description\":\"Get the information of the api key. Use the api key pending to be checked to call the endpoint. Both master and sub user's api key are applicable.\",\"api-rate-limit\":20}" } }, { - "name": "Get Account Ledgers - Spot/Margin", + "name": "Get Account Type - Spot ", "api": { - "id": "3470121", + "id": "3470120", "method": "get", - "path": "/api/v1/accounts/ledgers", + "path": "/api/v1/hf/accounts/opened", "parameters": { - "query": [ - { - "id": "8YpRjfgiQY", - "name": "currency", - "required": false, - "description": "Currency ( you can choose more than one currency). You can specify 10 currencies at most for one time. If not specified, all currencies will be inquired by default.", - "example": "BTC", - "type": "string", - "enable": true - }, - { - "id": "iwlQIVyBkb", - "name": "direction", - "required": false, - "description": "direction: in, out", - "example": "in", - "type": "string", - "schema": { - "type": "string", - "enum": [ - "in", - "out" - ], - "x-api-enum": [ - { - "value": "in", - "name": "", - "description": "" - }, - { - "value": "out", - "name": "", - "description": "" - } - ] - }, - "enable": true - }, - { - "id": "79t7ddnYAv", - "name": "bizType", - "required": false, - "description": "Type: DEPOSIT -deposit, WITHDRAW -withdraw, TRANSFER -transfer, SUB_TRANSFER -subaccount transfer,TRADE_EXCHANGE -trade, MARGIN_EXCHANGE -margin trade, KUCOIN_BONUS -bonus, BROKER_TRANSFER -Broker transfer record", - "example": "TRANSFER", - "type": "string", - "schema": { - "type": "string" - }, - "enable": true - }, - { - "id": "nRkUqJX2U6", - "name": "startAt", - "required": false, - "description": "Start time (milisecond)", - "example": "1728663338000", - "type": "integer", - "schema": { - "type": "integer", - "format": "int64" - }, - "enable": true - }, - { - "id": "rqSOV202LJ", - "name": "endAt", - "required": false, - "description": "End time (milisecond)", - "example": "1728692138000", - "type": "integer", - "schema": { - "type": "integer", - "format": "int64" - }, - "enable": true - }, - { - "id": "IcB8BHGcnb", - "name": "currentPage", - "required": false, - "description": "Current request page.", - "example": "1", - "type": "integer", - "schema": { - "type": "integer", - "default": 1 - }, - "enable": true - }, - { - "id": "7E4tpNduF3", - "name": "pageSize", - "required": false, - "description": "Number of results per request. Minimum is 10, maximum is 500.", - "example": "50", - "type": "integer", - "schema": { - "type": "integer", - "default": 50, - "minimum": 10, - "maximum": 500 - }, - "enable": true - } - ], "path": [], + "query": [], "cookie": [], "header": [] }, "responses": [ { - "id": "10085", + "id": "10084", "code": 200, "name": "OK", "headers": [], @@ -338,81 +281,8 @@ "type": "string" }, "data": { - "type": "object", - "properties": { - "currentPage": { - "type": "integer", - "description": "current page" - }, - "pageSize": { - "type": "integer", - "description": "page size" - }, - "totalNum": { - "type": "integer", - "description": "total number" - }, - "totalPage": { - "type": "integer", - "description": "total page" - }, - "items": { - "type": "array", - "items": { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "unique id" - }, - "currency": { - "type": "string", - "description": "The currency of an account" - }, - "amount": { - "type": "string", - "description": "The total amount of assets (fees included) involved in assets changes such as transaction, withdrawal and bonus distribution." - }, - "fee": { - "type": "string", - "description": "Fees generated in transaction, withdrawal, etc." - }, - "balance": { - "type": "string", - "description": "Remaining funds after the transaction." - }, - "accountType": { - "type": "string", - "description": "The account type of the master user: MAIN, TRADE, MARGIN or CONTRACT." - }, - "bizType": { - "type": "string", - "description": "Business type leading to the changes in funds, such as exchange, withdrawal, deposit, KUCOIN_BONUS, REFERRAL_BONUS, Lendings etc." - }, - "direction": { - "type": "string", - "description": "Side, out or in" - }, - "createdAt": { - "type": "integer", - "description": "Time of the event", - "format": "int64" - }, - "context": { - "type": "string", - "description": "Business related information such as order ID, serial No., etc." - } - } - } - } - }, - "required": [ - "currentPage", - "pageSize", - "totalNum", - "totalPage", - "items" - ] + "type": "boolean", + "description": "Spot account type. True means the current user is a high-frequency spot user, False means the current user is a low-frequency spot user" } }, "required": [ @@ -428,8 +298,8 @@ "responseExamples": [ { "name": "Success", - "data": "{\n \"code\": \"200000\",\n \"data\": {\n \"currentPage\": 1,\n \"pageSize\": 50,\n \"totalNum\": 1,\n \"totalPage\": 1,\n \"items\": [\n {\n \"id\": \"265329987780896\",\n \"currency\": \"USDT\",\n \"amount\": \"0.01\",\n \"fee\": \"0\",\n \"balance\": \"0\",\n \"accountType\": \"TRADE\",\n \"bizType\": \"SUB_TRANSFER\",\n \"direction\": \"out\",\n \"createdAt\": 1728658481484,\n \"context\": \"\"\n }\n ]\n }\n}", - "responseId": 10085, + "data": "{\"code\":\"200000\",\"data\":false}", + "responseId": 10084, "ordering": 1 } ], @@ -442,136 +312,54 @@ }, "mediaType": "" }, - "description": ":::info[Description]\nThis interface is for transaction records from all types of your accounts, supporting inquiry of various currencies. Items are paginated and sorted to show the latest first. See the Pagination section for retrieving additional entries after the first page.\n:::\n\n:::tip[Tips]\nthe start and end time range cannot exceed 24 hours. An error will occur if the specified time window exceeds the range. If you specify the end time only, the system will automatically calculate the start time as end time minus 24 hours, and vice versa.\n:::\n\n:::tip[Tips]\nSupport to obtain 1 year historical data, if need to obtain longer historical data, please submit a ticket: https://kucoin.zendesk.com/hc/en-us/requests/new\n:::\n\n**context**\n\nIf the returned value under bizType is “trade exchange”, the additional info. (such as order ID and trade ID, trading pair, etc.) of the trade will be returned in field context.\n\n**BizType Description**\n\n| Field | Description |\n| ------ | ---------- |\n| Assets Transferred in After Upgrading | Assets Transferred in After V1 to V2 Upgrading |\n| Deposit | Deposit |\n| Withdrawal | Withdrawal |\n| Transfer | Transfer |\n| Trade_Exchange | Trade |\n| Vote for Coin | Vote for Coin |\n| KuCoin Bonus | KuCoin Bonus |\n| Referral Bonus | Referral Bonus |\n| Rewards | Activities Rewards |\n| Distribution | Distribution, such as get GAS by holding NEO |\n| Airdrop/Fork | Airdrop/Fork |\n| Other rewards | Other rewards, except Vote, Airdrop, Fork |\n| Fee Rebate | Fee Rebate |\n| Buy Crypto | Use credit card to buy crypto |\n| Sell Crypto | Use credit card to sell crypto |\n| Public Offering Purchase | Public Offering Purchase for Spotlight |\n| Send red envelope | Send red envelope |\n| Open red envelope | Open red envelope |\n| Staking | Staking |\n| LockDrop Vesting | LockDrop Vesting |\n| Staking Profits | Staking Profits |\n| Redemption | Redemption |\n| Refunded Fees | Refunded Fees |\n| KCS Pay Fees | KCS Pay Fees |\n| Margin Trade | Margin Trade |\n| Loans | Loans |\n| Borrowings | Borrowings |\n| Debt Repayment | Debt Repayment |\n| Loans Repaid | Loans Repaid |\n| Lendings | Lendings |\n| Pool transactions | Pool-X transactions |\n| Instant Exchange | Instant Exchange |\n| Sub Account Transfer | Sub-account transfer |\n| Liquidation Fees | Liquidation Fees |\n| Soft Staking Profits | Soft Staking Profits |\n| Voting Earnings | Voting Earnings on Pool-X |\n| Redemption of Voting | Redemption of Voting on Pool-X |\n| Convert to KCS | Convert to KCS |\n| BROKER_TRANSFER | Broker transfer record |\n\n\n", - "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"General\",\"api-rate-limit-pool\":\"Management\",\"sdk-service\":\"Account\",\"sdk-sub-service\":\"Account\",\"sdk-method-name\":\"getSpotLedger\",\"sdk-method-description\":\"This interface is for transaction records from all types of your accounts, supporting inquiry of various currencies. Items are paginated and sorted to show the latest first. See the Pagination section for retrieving additional entries after the first page.\",\"api-rate-limit\":2}" + "description": ":::info[Description]\nThis interface determines whether the current user is a spot high-frequency user or a spot low-frequency user.\n:::\n\n:::tip[Tips]\nThis interface is a compatibility interface left over from the old version upgrade. Only some old users need to use it (high frequency will be opened before 2024 and trade_hf has been used). Most user do not need to use this interface. When the return is true, you need to use trade_hf to transfer assets and query assets When the return is false, you need to use trade to transfer assets and query assets.\n:::", + "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"General\",\"api-rate-limit-pool\":\"Spot\",\"sdk-service\":\"Account\",\"sdk-sub-service\":\"Account\",\"sdk-method-name\":\"getSpotAccountType\",\"sdk-method-description\":\"This interface determines whether the current user is a spot high-frequency user or a spot low-frequency user.\",\"api-rate-limit\":30}" } }, { - "name": "Get Account Ledgers - Trade_hf", + "name": "Get Account List - Spot", "api": { - "id": "3470122", + "id": "3470125", "method": "get", - "path": "/api/v1/hf/accounts/ledgers", + "path": "/api/v1/accounts", "parameters": { "query": [ { - "id": "8YpRjfgiQY", + "id": "RczLsmHFq3", "name": "currency", "required": false, - "description": "Currency ( you can choose more than one currency). You can specify 10 currencies at most for one time. If not specified, all currencies will be inquired by default.", - "example": "BTC", - "type": "string", - "enable": true - }, - { - "id": "iwlQIVyBkb", - "name": "direction", - "required": false, - "description": "direction: in, out", - "example": "in", + "description": "currency", + "example": "USDT", "type": "string", - "schema": { - "type": "string", - "enum": [ - "in", - "out" - ], - "x-api-enum": [ - { - "value": "in", - "name": "", - "description": "" - }, - { - "value": "out", - "name": "", - "description": "" - } - ] - }, "enable": true }, { - "id": "79t7ddnYAv", - "name": "bizType", + "id": "RHGp3FAE9z", + "name": "type", "required": false, - "description": "Transaction type: TRANSFER-transfer funds,TRADE_EXCHANGE-Trade", - "example": "TRANSFER", + "description": "Account type main、trade", + "example": "main", "type": "string", "schema": { "type": "string", "enum": [ - "TRADE_EXCHANGE", - "TRANSFER" + "main", + "trade" ], "x-api-enum": [ { - "value": "TRADE_EXCHANGE", - "name": "", - "description": "" + "value": "main", + "name": "main", + "description": "Funding account" }, { - "value": "TRANSFER", - "name": "", - "description": "" + "value": "trade", + "name": "trade", + "description": "Spot account" } ] }, "enable": true - }, - { - "id": "pPnKFH2DlI", - "name": "lastId", - "required": false, - "description": "The id of the last set of data from the previous batch of data. By default, the latest information is given.", - "example": "254062248624417", - "type": "integer", - "schema": { - "type": "integer", - "format": "int64" - }, - "enable": true - }, - { - "id": "TJwaZEZ59O", - "name": "limit", - "required": false, - "description": "Default100,Max200", - "example": "100", - "type": "integer", - "schema": { - "type": "integer", - "default": 100, - "maximum": 200, - "minimum": 1 - }, - "enable": true - }, - { - "id": "nRkUqJX2U6", - "name": "startAt", - "required": false, - "description": "Start time (milisecond)", - "example": "1728663338000", - "type": "integer", - "schema": { - "type": "integer", - "format": "int64" - }, - "enable": true - }, - { - "id": "rqSOV202LJ", - "name": "endAt", - "required": false, - "description": "End time (milisecond)", - "example": "1728692138000", - "type": "integer", - "schema": { - "type": "integer", - "format": "int64" - }, - "enable": true } ], "path": [], @@ -580,7 +368,7 @@ }, "responses": [ { - "id": "10086", + "id": "10089", "code": 200, "name": "OK", "headers": [], @@ -597,76 +385,52 @@ "properties": { "id": { "type": "string", - "description": "Unique id" + "description": "Account ID" }, "currency": { "type": "string", - "description": "currency" - }, - "amount": { - "type": "string", - "description": "Change in funds balance" - }, - "fee": { - "type": "string", - "description": "Deposit or withdrawal fee" - }, - "tax": { - "type": "string" - }, - "balance": { - "type": "string", - "description": "Total balance of funds after change" - }, - "accountType": { - "type": "string", - "description": "Master account type TRADE_HF" - }, - "bizType": { - "type": "string", - "description": "Trnasaction type,such as TRANSFER, TRADE_EXCHANGE, etc." + "description": "Currency" }, - "direction": { + "type": { "type": "string", - "description": "Direction of transfer( out or in)", + "description": "Account type:,main、trade、isolated(abandon)、margin(abandon)\n", "enum": [ - "in", - "out" + "main", + "trade" ], "x-api-enum": [ { - "value": "in", - "name": "", - "description": "" + "value": "main", + "name": "main", + "description": "Funding account" }, { - "value": "out", - "name": "", - "description": "" + "value": "trade", + "name": "trade", + "description": "Spot account" } ] }, - "createdAt": { + "balance": { "type": "string", - "description": "Created time" + "description": "Total funds in the account" }, - "context": { + "available": { "type": "string", - "description": "Core transaction parameter" + "description": "Funds available to withdraw or trade" + }, + "holds": { + "type": "string", + "description": "Funds on hold (not available for use)" } }, "required": [ "id", "currency", - "amount", - "fee", - "tax", + "type", "balance", - "accountType", - "bizType", - "direction", - "createdAt", - "context" + "available", + "holds" ] } } @@ -684,15 +448,9 @@ "responseExamples": [ { "name": "Success", - "data": "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"id\": \"254062248624417\",\n \"currency\": \"USDT\",\n \"amount\": \"1.59760080\",\n \"fee\": \"0.00159920\",\n \"tax\": \"0\",\n \"balance\": \"26.73759503\",\n \"accountType\": \"TRADE_HF\",\n \"bizType\": \"TRADE_EXCHANGE\",\n \"direction\": \"in\",\n \"createdAt\": \"1728443957539\",\n \"context\": \"{\\\"symbol\\\":\\\"KCS-USDT\\\",\\\"orderId\\\":\\\"6705f6350dc7210007d6a36d\\\",\\\"tradeId\\\":\\\"10046097631627265\\\"}\"\n }\n ]\n}", - "responseId": 10086, + "data": "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"id\": \"548674591753\",\n \"currency\": \"USDT\",\n \"type\": \"trade\",\n \"balance\": \"26.66759503\",\n \"available\": \"26.66759503\",\n \"holds\": \"0\"\n },\n {\n \"id\": \"63355cd156298d0001b66e61\",\n \"currency\": \"USDT\",\n \"type\": \"main\",\n \"balance\": \"0.01\",\n \"available\": \"0.01\",\n \"holds\": \"0\"\n }\n ]\n}", + "responseId": 10089, "ordering": 1 - }, - { - "name": "KCS DEDUCTION FEES", - "data": "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"id\": \"284494946713889\",\n \"currency\": \"BTC\",\n \"amount\": \"0.00004585\",\n \"fee\": \"0.00000000\",\n \"tax\": \"0\",\n \"balance\": \"0.00092103\",\n \"accountType\": \"TRADE_HF\",\n \"bizType\": \"TRADE_EXCHANGE\",\n \"direction\": \"in\",\n \"createdAt\": \"1729004451665\",\n \"context\": \"{\\\"symbol\\\":\\\"BTC-USDT\\\",\\\"orderId\\\":\\\"670e83a3640ce3000736aace\\\",\\\"tradeId\\\":\\\"10946063166095361\\\"}\"\n },\n {\n \"id\": \"284494946713888\",\n \"currency\": \"USDT\",\n \"amount\": \"3.00023007\",\n \"fee\": \"0.00299723\",\n \"tax\": \"0\",\n \"balance\": \"31.40074009\",\n \"accountType\": \"TRADE_HF\",\n \"bizType\": \"TRADE_EXCHANGE\",\n \"direction\": \"out\",\n \"createdAt\": \"1729004451665\",\n \"context\": \"{\\\"symbol\\\":\\\"BTC-USDT\\\",\\\"orderId\\\":\\\"670e83a3640ce3000736aace\\\",\\\"tradeId\\\":\\\"10946063166095361\\\"}\"\n },\n {\n \"id\": \"284494428832032\",\n \"currency\": \"USDT\",\n \"amount\": \"0.00499782\",\n \"fee\": \"0.00000000\",\n \"tax\": \"0\",\n \"balance\": \"34.40097016\",\n \"accountType\": \"TRADE_HF\",\n \"bizType\": \"RETURNED_FEES\",\n \"direction\": \"in\",\n \"createdAt\": \"1729004444549\",\n \"context\": \"{}\"\n },\n {\n \"id\": \"284494423736608\",\n \"currency\": \"KCS\",\n \"amount\": \"0.00047428\",\n \"fee\": \"0.00000000\",\n \"tax\": \"0\",\n \"balance\": \"17.36207049\",\n \"accountType\": \"TRADE_HF\",\n \"bizType\": \"DEDUCTION_FEES\",\n \"direction\": \"out\",\n \"createdAt\": \"1729004444468\",\n \"context\": \"{}\"\n }\n ]\n}", - "responseId": 10086, - "ordering": 2 } ], "requestBody": { @@ -704,129 +462,34 @@ }, "mediaType": "" }, - "description": ":::info[Description]\nThis API endpoint returns all transfer (in and out) records in high-frequency trading account and supports multi-coin queries. The query results are sorted in descending order by createdAt and id.\n:::\n\n\n\n:::tip[Tips]\nIf lastId is configured, the information obtained < lastId. Otherwise, it will go back to the latest information.\n\nYou can only obtain data from within a 3 _ 24 hour time range (i.e., from 3 _ 24 hours ago up to now) If you specify a time range that exceeds this limit, the system will default to data from within 3 * 24 hours.\n:::\n\n**context**\n\nIf the bizType is TRADE_EXCHANGE, the context field will include additional transaction information (order id, transaction id, and trading pair).\n", - "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"General\",\"api-rate-limit-pool\":\"Spot\",\"sdk-service\":\"Account\",\"sdk-sub-service\":\"Account\",\"sdk-method-name\":\"getSpotHFLedger\",\"sdk-method-description\":\"This API endpoint returns all transfer (in and out) records in high-frequency trading account and supports multi-coin queries. The query results are sorted in descending order by createdAt and id.\",\"api-rate-limit\":2}" + "description": ":::info[Description]\nGet a list of accounts. Please Deposit to the main account firstly, then transfer the funds to the trade account via Inner Transfer before transaction.\n:::", + "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"General\",\"api-rate-limit-pool\":\"Management\",\"sdk-service\":\"Account\",\"sdk-sub-service\":\"Account\",\"sdk-method-name\":\"getSpotAccountList\",\"sdk-method-description\":\"Get a list of accounts. Please Deposit to the main account firstly, then transfer the funds to the trade account via Inner Transfer before transaction.\",\"api-rate-limit\":5}" } }, { - "name": "Get Account Ledgers - Margin_hf", + "name": "Get Account Detail - Spot", "api": { - "id": "3470123", + "id": "3470126", "method": "get", - "path": "/api/v3/hf/margin/account/ledgers", + "path": "/api/v1/accounts/{accountId}", "parameters": { - "query": [ - { - "id": "8YpRjfgiQY", - "name": "currency", - "required": false, - "description": "currency, optional,can select more than one,separate with commas,select no more than 10 currencys,the default will be to query for all currencys if left empty", - "example": "BTC", - "type": "string", - "enable": true - }, + "path": [ { - "id": "iwlQIVyBkb", - "name": "direction", - "required": false, - "description": "direction: in, out", - "example": "in", - "type": "string", - "schema": { - "type": "string", - "enum": [ - "in", - "out" - ], - "x-api-enum": [ - { - "value": "in", - "name": "", - "description": "" - }, - { - "value": "out", - "name": "", - "description": "" - } - ] - }, - "enable": true - }, - { - "id": "79t7ddnYAv", - "name": "bizType", - "required": false, - "description": "Transaction type: TRANSFER- transfer funds, MARGIN_EXCHANGE - cross margin trade, ISOLATED_EXCHANGE - isolated margin trade, LIQUIDATION - liquidation, ASSERT_RETURN - forced liquidation asset return", - "example": "TRANSFER", - "type": "string", - "schema": { - "type": "string" - }, - "enable": true - }, - { - "id": "pPnKFH2DlI", - "name": "lastId", - "required": false, - "description": "The id of the last set of data from the previous batch of data. By default, the latest information is given.", - "example": "254062248624417", - "type": "integer", - "schema": { - "type": "integer", - "format": "int64" - }, - "enable": true - }, - { - "id": "TJwaZEZ59O", - "name": "limit", - "required": false, - "description": "Default100,Max200", - "example": "100", - "type": "integer", - "schema": { - "type": "integer", - "default": 100, - "maximum": 200, - "minimum": 1 - }, - "enable": true - }, - { - "id": "nRkUqJX2U6", - "name": "startAt", - "required": false, - "description": "Start time (milisecond)", - "example": "1728663338000", - "type": "integer", - "schema": { - "type": "integer", - "format": "int64" - }, - "enable": true - }, - { - "id": "rqSOV202LJ", - "name": "endAt", - "required": false, - "description": "End time (milisecond)", - "example": "1728692138000", - "type": "integer", - "schema": { - "type": "integer", - "format": "int64" - }, - "enable": true + "id": "accountId#0", + "name": "accountId", + "required": true, + "description": "Path parameter. Account ID", + "example": "548674591753", + "type": "string" } ], - "path": [], + "query": [], "cookie": [], "header": [] }, "responses": [ { - "id": "10087", + "id": "10090", "code": 200, "name": "OK", "headers": [], @@ -837,56 +500,31 @@ "type": "string" }, "data": { - "type": "array", - "items": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int64" - }, - "currency": { - "type": "string", - "description": "currency" - }, - "amount": { - "type": "string", - "description": "Change in funds balance" - }, - "fee": { - "type": "string", - "description": "Deposit or withdrawal fee" - }, - "balance": { - "type": "string", - "description": "Total balance of funds after change" - }, - "accountType": { - "type": "string", - "description": "Master account type TRADE_HF" - }, - "bizType": { - "type": "string", - "description": "Trnasaction type,such as TRANSFER, TRADE_EXCHANGE, etc." - }, - "direction": { - "type": "string", - "description": "Direction of transfer( out or in)" - }, - "createdAt": { - "type": "integer", - "description": "Ledger creation time", - "format": "int64" - }, - "context": { - "type": "string", - "description": "Core transaction parameter" - }, - "tax": { - "type": "string" - } + "type": "object", + "properties": { + "currency": { + "type": "string", + "description": "The currency of the account" + }, + "balance": { + "type": "string", + "description": "Total funds in the account" + }, + "available": { + "type": "string", + "description": "Funds available to withdraw or trade" + }, + "holds": { + "type": "string", + "description": "Funds on hold (not available for use)" } - } + }, + "required": [ + "currency", + "balance", + "available", + "holds" + ] } }, "required": [ @@ -902,8 +540,8 @@ "responseExamples": [ { "name": "Success", - "data": "{\"code\":\"200000\",\"data\":[{\"id\":1949641706720,\"currency\":\"USDT\",\"amount\":\"0.01000000\",\"fee\":\"0.00000000\",\"balance\":\"0.01000000\",\"accountType\":\"MARGIN_V2\",\"bizType\":\"TRANSFER\",\"direction\":\"in\",\"createdAt\":1728664091208,\"context\":\"{}\",\"tax\":\"0.00000000\"}]}", - "responseId": 10087, + "data": "{\"code\":\"200000\",\"data\":{\"currency\":\"USDT\",\"balance\":\"26.66759503\",\"available\":\"26.66759503\",\"holds\":\"0\"}}", + "responseId": 10090, "ordering": 1 } ], @@ -916,113 +554,94 @@ }, "mediaType": "" }, - "description": ":::info[Description]\nThis API endpoint returns all transfer (in and out) records in high-frequency margin trading account and supports multi-coin queries. The query results are sorted in descending order by createdAt and id.\n:::\n\n\n:::tip[Tips]\nIf lastId is configured, the information obtained < lastId. Otherwise, it will go back to the latest information.\n\nYou can only obtain data from within a 3 _ 24 hour time range (i.e., from 3 _ 24 hours ago up to now) If you specify a time range that exceeds this limit, the system will default to data from within 3 * 24 hours.\n\nIf bizType is MARGIN_EXCHANGE or ISOLATED_EXCHANGE, the context field will contain additional information about the transaction (order id, transaction id, transaction pair).\n:::\n\n", - "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"General\",\"api-rate-limit-pool\":\"Spot\",\"sdk-service\":\"Account\",\"sdk-sub-service\":\"Account\",\"sdk-method-name\":\"getMarginHFLedger\",\"sdk-method-description\":\"This API endpoint returns all transfer (in and out) records in high-frequency margin trading account and supports multi-coin queries. The query results are sorted in descending order by createdAt and id.\",\"api-rate-limit\":2}" + "description": ":::info[Description]\nget Information for a single spot account. Use this endpoint when you know the accountId.\n:::", + "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"General\",\"api-rate-limit-pool\":\"Management\",\"sdk-service\":\"Account\",\"sdk-sub-service\":\"Account\",\"sdk-method-name\":\"getSpotAccountDetail\",\"sdk-method-description\":\"get Information for a single spot account. Use this endpoint when you know the accountId.\",\"api-rate-limit\":5}" } }, { - "name": "Get Account Ledgers - Futures", + "name": "Get Account - Cross Margin", "api": { - "id": "3470124", + "id": "3470127", "method": "get", - "path": "/api/v1/transaction-history", + "path": "/api/v3/margin/accounts", "parameters": { + "path": [], "query": [ { - "id": "cYqa8zbNGo", - "name": "currency", - "required": false, - "description": "Currency of transaction history, XBT or USDT", - "example": "XBT", - "type": "string", - "enable": true - }, - { - "id": "79t7ddnYAv", - "name": "type", + "id": "PjWvwo4LmP", + "name": "quoteCurrency", "required": false, - "description": "Type RealisedPNL-Realised profit and loss, Deposit-Deposit, Withdrawal-withdraw, Transferin-Transfer in, TransferOut-Transfer out", - "example": "Transferin", + "description": "quote currency, currently only supports USDT, KCS, BTC, USDT as default", + "example": "USDT", "type": "string", "schema": { - "type": "string" - }, - "enable": true - }, - { - "id": "pPnKFH2DlI", - "name": "offset", - "required": false, - "description": "Start offset. Generally, the only attribute of the last returned result of the previous request is used, and the first page is returned by default", - "example": "254062248624417", - "type": "integer", - "schema": { - "type": "integer", - "format": "int64" - }, - "enable": true - }, - { - "id": "Y9kMltt1Nl", - "name": "forward", - "required": false, - "description": "This parameter functions to judge whether the lookup is forward or not. True means “yes” and False means “no”. This parameter is set as true by default", - "example": "false", - "type": "boolean", - "schema": { - "type": "boolean", - "default": true - }, - "enable": true - }, - { - "id": "TJwaZEZ59O", - "name": "maxCount", - "required": false, - "description": "Displayed size per page. The default size is 50", - "example": "50", - "type": "integer", - "schema": { - "type": "integer", - "default": 50, - "format": "int64" - }, - "enable": true - }, - { - "id": "nRkUqJX2U6", - "name": "startAt", - "required": false, - "description": "Start time (milisecond)", - "example": "1728663338000", - "type": "integer", - "schema": { - "type": "integer", - "format": "int64" - }, - "enable": true + "type": "string", + "default": "USDT", + "enum": [ + "USDT", + "KCS", + "BTC" + ], + "x-api-enum": [ + { + "value": "USDT", + "name": "", + "description": "" + }, + { + "value": "KCS", + "name": "", + "description": "" + }, + { + "value": "BTC", + "name": "", + "description": "" + } + ] + } }, { - "id": "rqSOV202LJ", - "name": "endAt", + "id": "waIqv5MOOW", + "name": "queryType", "required": false, - "description": "End time (milisecond)", - "example": "1728692138000", - "type": "integer", + "description": "Query account type (default MARGIN), MARGIN - only query low frequency cross margin account, MARGIN_V2-only query high frequency cross margin account, ALL - consistent aggregate query with the web side", + "example": "MARGIN", + "type": "string", "schema": { - "type": "integer", - "format": "int64" - }, - "enable": true + "type": "string", + "default": "MARGIN", + "enum": [ + "MARGIN", + "MARGIN_V2", + "ALL" + ], + "x-api-enum": [ + { + "value": "MARGIN", + "name": "", + "description": "" + }, + { + "value": "MARGIN_V2", + "name": "", + "description": "" + }, + { + "value": "ALL", + "name": "", + "description": "" + } + ] + } } ], - "path": [], "cookie": [], "header": [] }, "responses": [ { - "id": "10088", + "id": "10091", "code": 200, "name": "OK", "headers": [], @@ -1035,70 +654,114 @@ "data": { "type": "object", "properties": { - "dataList": { + "totalAssetOfQuoteCurrency": { + "type": "string", + "description": "Total Assets in Quote Currency" + }, + "totalLiabilityOfQuoteCurrency": { + "type": "string", + "description": "Total Liability in Quote Currency" + }, + "debtRatio": { + "type": "string", + "description": "debt ratio" + }, + "status": { + "type": "string", + "description": "Position status; EFFECTIVE-effective, BANKRUPTCY-bankruptcy liquidation, LIQUIDATION-closing, REPAY-repayment, BORROW borrowing", + "enum": [ + "EFFECTIVE", + "BANKRUPTCY", + "LIQUIDATION", + "REPAY", + "BORROW" + ], + "x-api-enum": [ + { + "value": "EFFECTIVE", + "name": "EFFECTIVE", + "description": "Effective" + }, + { + "value": "BANKRUPTCY", + "name": "BANKRUPTCY", + "description": "Bankruptcy liquidation" + }, + { + "value": "LIQUIDATION", + "name": "LIQUIDATION", + "description": "Closing" + }, + { + "value": "REPAY", + "name": "REPAY", + "description": "Repayment" + }, + { + "value": "BORROW", + "name": "BORROW", + "description": "Borrowing" + } + ] + }, + "accounts": { "type": "array", "items": { "type": "object", "properties": { - "time": { - "type": "integer", - "description": "ledger time", - "format": "int64" - }, - "type": { + "currency": { "type": "string", - "description": "Type: RealisedPNL, Deposit, Withdrawal, TransferIn, TransferOut" + "description": "currency" }, - "amount": { - "type": "number", - "description": "Transaction amount" + "total": { + "type": "string", + "description": "Total Assets" }, - "fee": { - "type": "number", - "description": "Fee" + "available": { + "type": "string", + "description": "Account available assets (total assets - frozen)" }, - "accountEquity": { - "type": "number", - "description": "Account equity" + "hold": { + "type": "string", + "description": "Account frozen assets" }, - "status": { + "liability": { "type": "string", - "description": "Status: Completed, Pending" + "description": "Liabilities" }, - "remark": { + "maxBorrowSize": { "type": "string", - "description": "Ticker symbol of the contract" + "description": "The user's remaining maximum loan amount" }, - "offset": { - "type": "integer", - "description": "Offset" + "borrowEnabled": { + "type": "boolean", + "description": "Support borrow or not" }, - "currency": { - "type": "string", - "description": "Currency" + "transferInEnabled": { + "type": "boolean", + "description": "Support transfer or not" } }, "required": [ - "time", - "type", - "amount", - "fee", - "accountEquity", - "status", - "remark", - "offset", - "currency" + "currency", + "total", + "available", + "hold", + "liability", + "maxBorrowSize", + "borrowEnabled", + "transferInEnabled" ] - } - }, - "hasMore": { - "type": "boolean", - "description": "Is it the last page. If it is false, it means it is the last page, and if it is true, it means need to turn the page." + }, + "description": "Margin account list" } }, "required": [ - "dataList", - "hasMore" + "totalAssetOfQuoteCurrency", + "totalLiabilityOfQuoteCurrency", + "debtRatio", + "status", + "accounts" ] } }, @@ -1115,8 +778,8 @@ "responseExamples": [ { "name": "Success", - "data": "{\n \"code\": \"200000\",\n \"data\": {\n \"dataList\": [\n {\n \"time\": 1728665747000,\n \"type\": \"TransferIn\",\n \"amount\": 0.01,\n \"fee\": 0.0,\n \"accountEquity\": 14.02924938,\n \"status\": \"Completed\",\n \"remark\": \"Transferred from High-Frequency Trading Account\",\n \"offset\": 51360793,\n \"currency\": \"USDT\"\n },\n {\n \"time\": 1728648000000,\n \"type\": \"RealisedPNL\",\n \"amount\": 0.00630042,\n \"fee\": 0.0,\n \"accountEquity\": 20.0,\n \"status\": \"Completed\",\n \"remark\": \"XBTUSDTM\",\n \"offset\": 51352430,\n \"currency\": \"USDT\"\n }\n ],\n \"hasMore\": false\n }\n}", - "responseId": 10088, + "data": "{\n \"code\": \"200000\",\n \"data\": {\n \"totalAssetOfQuoteCurrency\": \"0.02\",\n \"totalLiabilityOfQuoteCurrency\": \"0\",\n \"debtRatio\": \"0\",\n \"status\": \"EFFECTIVE\",\n \"accounts\": [\n {\n \"currency\": \"USDT\",\n \"total\": \"0.02\",\n \"available\": \"0.02\",\n \"hold\": \"0\",\n \"liability\": \"0\",\n \"maxBorrowSize\": \"0\",\n \"borrowEnabled\": true,\n \"transferInEnabled\": true\n }\n ]\n }\n}", + "responseId": 10091, "ordering": 1 } ], @@ -1129,536 +792,56 @@ }, "mediaType": "" }, - "description": ":::info[Description]\nThis interface can query the ledger records of the futures business line\n:::\n\n\n\n:::tip[Tips]\nIf there are open positions, the status of the first page returned will be Pending, indicating the realised profit and loss in the current 8-hour settlement period. Please specify the minimum offset number of the current page into the offset field to turn the page.\n:::\n\n:::tip[Tips]\nSupplementary instructions for startAt and endAt: startAt must be less than endAt; and the interval cannot exceed 1 day; only one field is allowed, and if only one field is passed, another field will be automatically added or subtracted by the system 1 day to complete\n:::\n", - "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Futures\",\"api-channel\":\"Private\",\"api-permission\":\"General\",\"api-rate-limit-pool\":\"Futures\",\"sdk-service\":\"Account\",\"sdk-sub-service\":\"Account\",\"sdk-method-name\":\"getFuturesLedger\",\"sdk-method-description\":\"This interface can query the ledger records of the futures business line\",\"api-rate-limit\":2}" + "description": ":::info[Description]\nRequest via this endpoint to get the info of the cross margin account.\n:::", + "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"General\",\"api-rate-limit-pool\":\"Spot\",\"sdk-service\":\"Account\",\"sdk-sub-service\":\"Account\",\"sdk-method-name\":\"getCrossMarginAccount\",\"sdk-method-description\":\"Request via this endpoint to get the info of the cross margin account.\",\"api-rate-limit\":15}" } }, { - "name": "Get Account List - Spot", + "name": "Get Account - Isolated Margin", "api": { - "id": "3470125", + "id": "3470128", "method": "get", - "path": "/api/v1/accounts", + "path": "/api/v3/isolated/accounts", "parameters": { "query": [ { - "id": "RczLsmHFq3", - "name": "currency", + "id": "0GJu6LYq3T", + "name": "symbol", "required": false, - "description": "currency", - "example": "USDT", + "description": "For isolated trading pairs, query all without passing", "type": "string", "enable": true }, { - "id": "RHGp3FAE9z", - "name": "type", + "id": "PjWvwo4LmP", + "name": "quoteCurrency", "required": false, - "description": "Account type main、trade", - "example": "main", + "description": "quote currency, currently only supports USDT, KCS, BTC, USDT as default", + "example": "USDT", "type": "string", "schema": { "type": "string", + "default": "USDT", "enum": [ - "main", - "trade" + "USDT", + "KCS", + "BTC" ], "x-api-enum": [ { - "value": "main", - "name": "main", - "description": "Funding account" + "value": "USDT", + "name": "", + "description": "" }, { - "value": "trade", - "name": "trade", - "description": "Spot account" - } - ] - }, - "enable": true - } - ], - "path": [], - "cookie": [], - "header": [] - }, - "responses": [ - { - "id": "10089", - "code": 200, - "name": "OK", - "headers": [], - "jsonSchema": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "data": { - "type": "array", - "items": { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "Account ID" - }, - "currency": { - "type": "string", - "description": "Currency" - }, - "type": { - "type": "string", - "description": "Account type:,main、trade、isolated(abandon)、margin(abandon)\n", - "enum": [ - "main", - "trade" - ], - "x-api-enum": [ - { - "value": "main", - "name": "main", - "description": "Funding account" - }, - { - "value": "trade", - "name": "trade", - "description": "Spot account" - } - ] - }, - "balance": { - "type": "string", - "description": "Total funds in the account" - }, - "available": { - "type": "string", - "description": "Funds available to withdraw or trade" - }, - "holds": { - "type": "string", - "description": "Funds on hold (not available for use)" - } - }, - "required": [ - "id", - "currency", - "type", - "balance", - "available", - "holds" - ] - } - } - }, - "required": [ - "code", - "data" - ] - }, - "description": "", - "contentType": "json", - "mediaType": "" - } - ], - "responseExamples": [ - { - "name": "Success", - "data": "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"id\": \"548674591753\",\n \"currency\": \"USDT\",\n \"type\": \"trade\",\n \"balance\": \"26.66759503\",\n \"available\": \"26.66759503\",\n \"holds\": \"0\"\n },\n {\n \"id\": \"63355cd156298d0001b66e61\",\n \"currency\": \"USDT\",\n \"type\": \"main\",\n \"balance\": \"0.01\",\n \"available\": \"0.01\",\n \"holds\": \"0\"\n }\n ]\n}", - "responseId": 10089, - "ordering": 1 - } - ], - "requestBody": { - "type": "none", - "parameters": [], - "jsonSchema": { - "type": "object", - "properties": {} - }, - "mediaType": "" - }, - "description": ":::info[Description]\nGet a list of accounts. Please Deposit to the main account firstly, then transfer the funds to the trade account via Inner Transfer before transaction.\n:::", - "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"General\",\"api-rate-limit-pool\":\"Management\",\"sdk-service\":\"Account\",\"sdk-sub-service\":\"Account\",\"sdk-method-name\":\"getSpotAccountList\",\"sdk-method-description\":\"Get a list of accounts. Please Deposit to the main account firstly, then transfer the funds to the trade account via Inner Transfer before transaction.\",\"api-rate-limit\":5}" - } - }, - { - "name": "Get Account Detail - Spot", - "api": { - "id": "3470126", - "method": "get", - "path": "/api/v1/accounts/{accountId}", - "parameters": { - "path": [ - { - "id": "accountId#0", - "name": "accountId", - "required": true, - "description": "Path parameter. Account ID", - "example": "548674591753", - "type": "string" - } - ], - "query": [], - "cookie": [], - "header": [] - }, - "responses": [ - { - "id": "10090", - "code": 200, - "name": "OK", - "headers": [], - "jsonSchema": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "data": { - "type": "object", - "properties": { - "currency": { - "type": "string", - "description": "The currency of the account" - }, - "balance": { - "type": "string", - "description": "Total funds in the account" - }, - "available": { - "type": "string", - "description": "Funds available to withdraw or trade" - }, - "holds": { - "type": "string", - "description": "Funds on hold (not available for use)" - } - }, - "required": [ - "currency", - "balance", - "available", - "holds" - ] - } - }, - "required": [ - "code", - "data" - ] - }, - "description": "", - "contentType": "json", - "mediaType": "" - } - ], - "responseExamples": [ - { - "name": "Success", - "data": "{\"code\":\"200000\",\"data\":{\"currency\":\"USDT\",\"balance\":\"26.66759503\",\"available\":\"26.66759503\",\"holds\":\"0\"}}", - "responseId": 10090, - "ordering": 1 - } - ], - "requestBody": { - "type": "none", - "parameters": [], - "jsonSchema": { - "type": "object", - "properties": {} - }, - "mediaType": "" - }, - "description": ":::info[Description]\nget Information for a single spot account. Use this endpoint when you know the accountId.\n:::", - "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"General\",\"api-rate-limit-pool\":\"Management\",\"sdk-service\":\"Account\",\"sdk-sub-service\":\"Account\",\"sdk-method-name\":\"getSpotAccountDetail\",\"sdk-method-description\":\"get Information for a single spot account. Use this endpoint when you know the accountId.\",\"api-rate-limit\":5}" - } - }, - { - "name": "Get Account - Cross Margin", - "api": { - "id": "3470127", - "method": "get", - "path": "/api/v3/margin/accounts", - "parameters": { - "path": [], - "query": [ - { - "id": "PjWvwo4LmP", - "name": "quoteCurrency", - "required": false, - "description": "quote currency, currently only supports USDT, KCS, BTC, USDT as default", - "example": "USDT", - "type": "string", - "schema": { - "type": "string", - "default": "USDT", - "enum": [ - "USDT", - "KCS", - "BTC" - ], - "x-api-enum": [ - { - "value": "USDT", - "name": "", - "description": "" - }, - { - "value": "KCS", - "name": "", - "description": "" - }, - { - "value": "BTC", - "name": "", - "description": "" - } - ] - } - }, - { - "id": "waIqv5MOOW", - "name": "queryType", - "required": false, - "description": "Query account type (default MARGIN), MARGIN - only query low frequency cross margin account, MARGIN_V2-only query high frequency cross margin account, ALL - consistent aggregate query with the web side", - "example": "MARGIN", - "type": "string", - "schema": { - "type": "string", - "default": "MARGIN", - "enum": [ - "MARGIN", - "MARGIN_V2", - "ALL" - ], - "x-api-enum": [ - { - "value": "MARGIN", - "name": "", - "description": "" - }, - { - "value": "MARGIN_V2", - "name": "", - "description": "" - }, - { - "value": "ALL", - "name": "", - "description": "" - } - ] - } - } - ], - "cookie": [], - "header": [] - }, - "responses": [ - { - "id": "10091", - "code": 200, - "name": "OK", - "headers": [], - "jsonSchema": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "data": { - "type": "object", - "properties": { - "totalAssetOfQuoteCurrency": { - "type": "string", - "description": "Total Assets in Quote Currency" - }, - "totalLiabilityOfQuoteCurrency": { - "type": "string", - "description": "Total Liability in Quote Currency" - }, - "debtRatio": { - "type": "string", - "description": "debt ratio" - }, - "status": { - "type": "string", - "description": "Position status; EFFECTIVE-effective, BANKRUPTCY-bankruptcy liquidation, LIQUIDATION-closing, REPAY-repayment, BORROW borrowing", - "enum": [ - "EFFECTIVE", - "BANKRUPTCY", - "LIQUIDATION", - "REPAY", - "BORROW" - ], - "x-api-enum": [ - { - "value": "EFFECTIVE", - "name": "EFFECTIVE", - "description": "Effective" - }, - { - "value": "BANKRUPTCY", - "name": "BANKRUPTCY", - "description": "Bankruptcy liquidation" - }, - { - "value": "LIQUIDATION", - "name": "LIQUIDATION", - "description": "Closing" - }, - { - "value": "REPAY", - "name": "REPAY", - "description": "Repayment" - }, - { - "value": "BORROW", - "name": "BORROW", - "description": "Borrowing" - } - ] - }, - "accounts": { - "type": "array", - "items": { - "type": "object", - "properties": { - "currency": { - "type": "string", - "description": "currency" - }, - "total": { - "type": "string", - "description": "Total Assets" - }, - "available": { - "type": "string", - "description": "Account available assets (total assets - frozen)" - }, - "hold": { - "type": "string", - "description": "Account frozen assets" - }, - "liability": { - "type": "string", - "description": "Liabilities" - }, - "maxBorrowSize": { - "type": "string", - "description": "The user's remaining maximum loan amount" - }, - "borrowEnabled": { - "type": "boolean", - "description": "Support borrow or not" - }, - "transferInEnabled": { - "type": "boolean", - "description": "Support transfer or not" - } - }, - "required": [ - "currency", - "total", - "available", - "hold", - "liability", - "maxBorrowSize", - "borrowEnabled", - "transferInEnabled" - ] - }, - "description": "Margin account list" - } - }, - "required": [ - "totalAssetOfQuoteCurrency", - "totalLiabilityOfQuoteCurrency", - "debtRatio", - "status", - "accounts" - ] - } - }, - "required": [ - "code", - "data" - ] - }, - "description": "", - "contentType": "json", - "mediaType": "" - } - ], - "responseExamples": [ - { - "name": "Success", - "data": "{\n \"code\": \"200000\",\n \"data\": {\n \"totalAssetOfQuoteCurrency\": \"0.02\",\n \"totalLiabilityOfQuoteCurrency\": \"0\",\n \"debtRatio\": \"0\",\n \"status\": \"EFFECTIVE\",\n \"accounts\": [\n {\n \"currency\": \"USDT\",\n \"total\": \"0.02\",\n \"available\": \"0.02\",\n \"hold\": \"0\",\n \"liability\": \"0\",\n \"maxBorrowSize\": \"0\",\n \"borrowEnabled\": true,\n \"transferInEnabled\": true\n }\n ]\n }\n}", - "responseId": 10091, - "ordering": 1 - } - ], - "requestBody": { - "type": "none", - "parameters": [], - "jsonSchema": { - "type": "object", - "properties": {} - }, - "mediaType": "" - }, - "description": ":::info[Description]\nRequest via this endpoint to get the info of the cross margin account.\n:::", - "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"General\",\"api-rate-limit-pool\":\"Spot\",\"sdk-service\":\"Account\",\"sdk-sub-service\":\"Account\",\"sdk-method-name\":\"getCrossMarginAccount\",\"sdk-method-description\":\"Request via this endpoint to get the info of the cross margin account.\",\"api-rate-limit\":15}" - } - }, - { - "name": "Get Account - Isolated Margin", - "api": { - "id": "3470128", - "method": "get", - "path": "/api/v3/isolated/accounts", - "parameters": { - "query": [ - { - "id": "0GJu6LYq3T", - "name": "symbol", - "required": false, - "description": "For isolated trading pairs, query all without passing", - "type": "string", - "enable": true - }, - { - "id": "PjWvwo4LmP", - "name": "quoteCurrency", - "required": false, - "description": "quote currency, currently only supports USDT, KCS, BTC, USDT as default", - "example": "USDT", - "type": "string", - "schema": { - "type": "string", - "default": "USDT", - "enum": [ - "USDT", - "KCS", - "BTC" - ], - "x-api-enum": [ - { - "value": "USDT", - "name": "", - "description": "" - }, - { - "value": "KCS", - "name": "", - "description": "" - }, - { - "value": "BTC", - "name": "", - "description": "" + "value": "KCS", + "name": "", + "description": "" + }, + { + "value": "BTC", + "name": "", + "description": "" } ] }, @@ -2061,149 +1244,113 @@ } }, { - "name": "Get Apikey Info", + "name": "Get Account Ledgers - Spot/Margin", "api": { - "id": "3470130", + "id": "3470121", "method": "get", - "path": "/api/v1/user/api-key", + "path": "/api/v1/accounts/ledgers", "parameters": { - "query": [], - "path": [], - "cookie": [], - "header": [] - }, - "responses": [ - { - "id": "10094", - "code": 200, - "name": "OK", - "headers": [], - "jsonSchema": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "data": { - "type": "object", - "properties": { - "remark": { - "type": "string", - "description": "Remarks" - }, - "apiKey": { - "type": "string", - "description": "Apikey" - }, - "apiVersion": { - "type": "integer", - "description": "API Version" - }, - "permission": { - "type": "string", - "description": "[Permissions](apidog://link/pages/338144), possible values: General, Spot, Margin, Futures, InnerTransfer, Transfer, Earn" - }, - "ipWhitelist": { - "type": "string", - "description": "IP whitelist\n\n" - }, - "createdAt": { - "type": "integer", - "description": "Apikey create time", - "format": "int64" - }, - "uid": { - "type": "integer", - "description": "Account UID" - }, - "isMaster": { - "type": "boolean", - "description": "Whether it is the master account." - }, - "subName": { - "type": "string", - "description": "Sub Name, There is no such param for the master account" - } + "query": [ + { + "id": "8YpRjfgiQY", + "name": "currency", + "required": false, + "description": "Currency ( you can choose more than one currency). You can specify 10 currencies at most for one time. If not specified, all currencies will be inquired by default.", + "example": "BTC", + "type": "string", + "enable": true + }, + { + "id": "iwlQIVyBkb", + "name": "direction", + "required": false, + "description": "direction: in, out", + "example": "in", + "type": "string", + "schema": { + "type": "string", + "enum": [ + "in", + "out" + ], + "x-api-enum": [ + { + "value": "in", + "name": "", + "description": "" }, - "required": [ - "remark", - "apiKey", - "apiVersion", - "permission", - "createdAt", - "uid", - "isMaster" - ] - } + { + "value": "out", + "name": "", + "description": "" + } + ] }, - "required": [ - "code", - "data" - ] + "enable": true }, - "description": "", - "contentType": "json", - "mediaType": "" - } - ], - "responseExamples": [ - { - "name": "Success", - "data": "{\n \"code\": \"200000\",\n \"data\": {\n \"remark\": \"account1\",\n \"apiKey\": \"6705f5c311545b000157d3eb\",\n \"apiVersion\": 3,\n \"permission\": \"General,Futures,Spot,Earn,InnerTransfer,Transfer,Margin\",\n \"ipWhitelist\": \"203.**.154,103.**.34\",\n \"createdAt\": 1728443843000,\n \"uid\": 165111215,\n \"isMaster\": true\n }\n}", - "responseId": 10094, - "ordering": 1 - } - ], - "requestBody": { - "type": "none", - "parameters": [], - "jsonSchema": { - "type": "object", - "properties": {} - }, - "mediaType": "" - }, - "description": ":::info[Description]\nGet the information of the api key. Use the api key pending to be checked to call the endpoint. Both master and sub user's api key are applicable.\n:::", - "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"General\",\"api-rate-limit-pool\":\"Management\",\"sdk-service\":\"Account\",\"sdk-sub-service\":\"Account\",\"sdk-method-name\":\"getApikeyInfo\",\"sdk-method-description\":\"Get the information of the api key. Use the api key pending to be checked to call the endpoint. Both master and sub user's api key are applicable.\",\"api-rate-limit\":20}" - } - } - ] - }, - { - "name": "Sub Account", - "id": 348140, - "description": "", - "items": [ - { - "name": "Get SubAccount List - Summary Info", - "api": { - "id": "3470131", - "method": "get", - "path": "/api/v2/sub/user", - "parameters": { - "query": [ { - "id": "7kYgoQX9d6", + "id": "79t7ddnYAv", + "name": "bizType", + "required": false, + "description": "Type: DEPOSIT -deposit, WITHDRAW -withdraw, TRANSFER -transfer, SUB_TRANSFER -subaccount transfer,TRADE_EXCHANGE -trade, MARGIN_EXCHANGE -margin trade, KUCOIN_BONUS -bonus, BROKER_TRANSFER -Broker transfer record", + "example": "TRANSFER", + "type": "string", + "schema": { + "type": "string" + }, + "enable": true + }, + { + "id": "nRkUqJX2U6", + "name": "startAt", + "required": false, + "description": "Start time (milisecond)", + "example": "1728663338000", + "type": "integer", + "schema": { + "type": "integer", + "format": "int64" + }, + "enable": true + }, + { + "id": "rqSOV202LJ", + "name": "endAt", + "required": false, + "description": "End time (milisecond)", + "example": "1728692138000", + "type": "integer", + "schema": { + "type": "integer", + "format": "int64" + }, + "enable": true + }, + { + "id": "IcB8BHGcnb", "name": "currentPage", "required": false, - "description": "Current request page. Default is 1", + "description": "Current request page.", "example": "1", "type": "integer", + "schema": { + "type": "integer", + "default": 1 + }, "enable": true }, { - "id": "iIrspuNh6x", + "id": "7E4tpNduF3", "name": "pageSize", "required": false, - "description": "Number of results per request. Minimum is 1, maximum is 100, default is 10.", - "example": "10", + "description": "Number of results per request. Minimum is 10, maximum is 500.", + "example": "50", "type": "integer", - "fixedValue": false, "schema": { "type": "integer", - "default": 10, - "minimum": 1, - "maximum": 100 + "default": 50, + "minimum": 10, + "maximum": 500 }, "enable": true } @@ -2214,7 +1361,7 @@ }, "responses": [ { - "id": "10095", + "id": "10085", "code": 200, "name": "OK", "headers": [], @@ -2229,133 +1376,67 @@ "properties": { "currentPage": { "type": "integer", - "description": "Current request page" + "description": "current page" }, "pageSize": { "type": "integer", - "description": "Number of results per request. Minimum is 1, maximum is 100" + "description": "page size" }, "totalNum": { "type": "integer", - "description": "Total number of messages" + "description": "total number" }, "totalPage": { "type": "integer", - "description": "Total number of page" + "description": "total page" }, "items": { "type": "array", "items": { "type": "object", "properties": { - "userId": { + "id": { "type": "string", - "description": "Sub-account User Id" + "description": "unique id" }, - "uid": { - "type": "integer", - "description": "Sub-account UID" + "currency": { + "type": "string", + "description": "The currency of an account" }, - "subName": { + "amount": { "type": "string", - "description": "Sub-account name" + "description": "The total amount of assets (fees included) involved in assets changes such as transaction, withdrawal and bonus distribution." }, - "status": { - "type": "integer", - "description": "Sub-account; 2:Enable, 3:Frozen", - "enum": [ - 2, - 3 - ], - "x-api-enum": [ - { - "value": 2, - "name": "", - "description": "Enable" - }, - { - "value": 3, - "name": "", - "description": "Frozen" - } - ] + "fee": { + "type": "string", + "description": "Fees generated in transaction, withdrawal, etc." }, - "type": { - "type": "integer", - "description": "Sub-account type", - "enum": [ - 0, - 1, - 2, - 5 - ], - "x-api-enum": [ - { - "value": 0, - "name": "NORMAL", - "description": "Normal subaccount" - }, - { - "value": 1, - "name": "ROBOT", - "description": "Robot subaccount" - }, - { - "value": 2, - "name": "Novice", - "description": "New financial sub-account" - }, - { - "value": 5, - "name": "HOSTED", - "description": "Asset management subaccount" - } - ] + "balance": { + "type": "string", + "description": "Remaining funds after the transaction." }, - "access": { + "accountType": { "type": "string", - "description": "Sub-account Permission" + "description": "The account type of the master user: MAIN, TRADE, MARGIN or CONTRACT." + }, + "bizType": { + "type": "string", + "description": "Business type leading to the changes in funds, such as exchange, withdrawal, deposit, KUCOIN_BONUS, REFERRAL_BONUS, Lendings etc." + }, + "direction": { + "type": "string", + "description": "Side, out or in" }, "createdAt": { "type": "integer", "description": "Time of the event", "format": "int64" }, - "remarks": { + "context": { "type": "string", - "description": "Remarks" - }, - "tradeTypes": { - "type": "array", - "items": { - "type": "string" - }, - "description": "Subaccount Permissions" - }, - "openedTradeTypes": { - "type": "array", - "items": { - "type": "string" - }, - "description": "Subaccount active permissions,If do not have the corresponding permissions, need to log in to the sub-account and go to the corresponding web page to activate" - }, - "hostedStatus": { - "type": "string" + "description": "Business related information such as order ID, serial No., etc." } - }, - "required": [ - "userId", - "uid", - "subName", - "status", - "type", - "access", - "createdAt", - "remarks", - "tradeTypes", - "openedTradeTypes", - "hostedStatus" - ] + } } } }, @@ -2381,13 +1462,13 @@ "responseExamples": [ { "name": "Success", - "data": "{\n \"code\": \"200000\",\n \"data\": {\n \"currentPage\": 1,\n \"pageSize\": 10,\n \"totalNum\": 1,\n \"totalPage\": 1,\n \"items\": [\n {\n \"userId\": \"63743f07e0c5230001761d08\",\n \"uid\": 169579801,\n \"subName\": \"testapi6\",\n \"status\": 2,\n \"type\": 0,\n \"access\": \"All\",\n \"createdAt\": 1668562696000,\n \"remarks\": \"remarks\",\n \"tradeTypes\": [\n \"Spot\",\n \"Futures\",\n \"Margin\"\n ],\n \"openedTradeTypes\": [\n \"Spot\"\n ],\n \"hostedStatus\": null\n }\n ]\n }\n}", - "responseId": 10095, + "data": "{\n \"code\": \"200000\",\n \"data\": {\n \"currentPage\": 1,\n \"pageSize\": 50,\n \"totalNum\": 1,\n \"totalPage\": 1,\n \"items\": [\n {\n \"id\": \"265329987780896\",\n \"currency\": \"USDT\",\n \"amount\": \"0.01\",\n \"fee\": \"0\",\n \"balance\": \"0\",\n \"accountType\": \"TRADE\",\n \"bizType\": \"SUB_TRANSFER\",\n \"direction\": \"out\",\n \"createdAt\": 1728658481484,\n \"context\": \"\"\n }\n ]\n }\n}", + "responseId": 10085, "ordering": 1 } ], "requestBody": { - "type": "application/x-www-form-urlencoded", + "type": "none", "parameters": [], "jsonSchema": { "type": "object", @@ -2395,46 +1476,145 @@ }, "mediaType": "" }, - "description": ":::info[Description]\nThis endpoint can be used to get a paginated list of sub-accounts. Pagination is required.\n:::\n", - "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"General\",\"api-rate-limit-pool\":\"Management\",\"sdk-service\":\"Account\",\"sdk-sub-service\":\"SubAccount\",\"sdk-method-name\":\"getSpotSubAccountsSummaryV2\",\"sdk-method-description\":\"This endpoint can be used to get a paginated list of sub-accounts. Pagination is required.\",\"api-rate-limit\":20}" + "description": ":::info[Description]\nThis interface is for transaction records from all types of your accounts, supporting inquiry of various currencies. Items are paginated and sorted to show the latest first. See the Pagination section for retrieving additional entries after the first page.\n:::\n\n:::tip[Tips]\nthe start and end time range cannot exceed 24 hours. An error will occur if the specified time window exceeds the range. If you specify the end time only, the system will automatically calculate the start time as end time minus 24 hours, and vice versa.\n:::\n\n:::tip[Tips]\nSupport to obtain 1 year historical data, if need to obtain longer historical data, please submit a ticket: https://kucoin.zendesk.com/hc/en-us/requests/new\n:::\n\n**context**\n\nIf the returned value under bizType is “trade exchange”, the additional info. (such as order ID and trade ID, trading pair, etc.) of the trade will be returned in field context.\n\n**BizType Description**\n\n| Field | Description |\n| ------ | ---------- |\n| Assets Transferred in After Upgrading | Assets Transferred in After V1 to V2 Upgrading |\n| Deposit | Deposit |\n| Withdrawal | Withdrawal |\n| Transfer | Transfer |\n| Trade_Exchange | Trade |\n| Vote for Coin | Vote for Coin |\n| KuCoin Bonus | KuCoin Bonus |\n| Referral Bonus | Referral Bonus |\n| Rewards | Activities Rewards |\n| Distribution | Distribution, such as get GAS by holding NEO |\n| Airdrop/Fork | Airdrop/Fork |\n| Other rewards | Other rewards, except Vote, Airdrop, Fork |\n| Fee Rebate | Fee Rebate |\n| Buy Crypto | Use credit card to buy crypto |\n| Sell Crypto | Use credit card to sell crypto |\n| Public Offering Purchase | Public Offering Purchase for Spotlight |\n| Send red envelope | Send red envelope |\n| Open red envelope | Open red envelope |\n| Staking | Staking |\n| LockDrop Vesting | LockDrop Vesting |\n| Staking Profits | Staking Profits |\n| Redemption | Redemption |\n| Refunded Fees | Refunded Fees |\n| KCS Pay Fees | KCS Pay Fees |\n| Margin Trade | Margin Trade |\n| Loans | Loans |\n| Borrowings | Borrowings |\n| Debt Repayment | Debt Repayment |\n| Loans Repaid | Loans Repaid |\n| Lendings | Lendings |\n| Pool transactions | Pool-X transactions |\n| Instant Exchange | Instant Exchange |\n| Sub Account Transfer | Sub-account transfer |\n| Liquidation Fees | Liquidation Fees |\n| Soft Staking Profits | Soft Staking Profits |\n| Voting Earnings | Voting Earnings on Pool-X |\n| Redemption of Voting | Redemption of Voting on Pool-X |\n| Convert to KCS | Convert to KCS |\n| BROKER_TRANSFER | Broker transfer record |\n\n\n", + "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"General\",\"api-rate-limit-pool\":\"Management\",\"sdk-service\":\"Account\",\"sdk-sub-service\":\"Account\",\"sdk-method-name\":\"getSpotLedger\",\"sdk-method-description\":\"This interface is for transaction records from all types of your accounts, supporting inquiry of various currencies. Items are paginated and sorted to show the latest first. See the Pagination section for retrieving additional entries after the first page.\",\"api-rate-limit\":2}" } }, { - "name": "Get SubAccount Detail - Balance", + "name": "Get Account Ledgers - Trade_hf", "api": { - "id": "3470132", + "id": "3470122", "method": "get", - "path": "/api/v1/sub-accounts/{subUserId}", + "path": "/api/v1/hf/accounts/ledgers", "parameters": { - "path": [ - { - "id": "subUserId#0", - "name": "subUserId", - "required": true, - "description": "the userID of a sub-account.", - "example": "63743f07e0c5230001761d08", - "type": "string" - } - ], "query": [ { - "id": "iIrspuNh6x", - "name": "includeBaseAmount", - "required": true, - "description": "false: do not display the currency which asset is 0, true: display all currency", - "example": "false", - "type": "boolean", + "id": "8YpRjfgiQY", + "name": "currency", + "required": false, + "description": "Currency ( you can choose more than one currency). You can specify 10 currencies at most for one time. If not specified, all currencies will be inquired by default.", + "example": "BTC", + "type": "string", + "enable": true + }, + { + "id": "iwlQIVyBkb", + "name": "direction", + "required": false, + "description": "direction: in, out", + "example": "in", + "type": "string", "schema": { - "type": "boolean" - } + "type": "string", + "enum": [ + "in", + "out" + ], + "x-api-enum": [ + { + "value": "in", + "name": "", + "description": "" + }, + { + "value": "out", + "name": "", + "description": "" + } + ] + }, + "enable": true + }, + { + "id": "79t7ddnYAv", + "name": "bizType", + "required": false, + "description": "Transaction type: TRANSFER-transfer funds,TRADE_EXCHANGE-Trade", + "example": "TRANSFER", + "type": "string", + "schema": { + "type": "string", + "enum": [ + "TRADE_EXCHANGE", + "TRANSFER" + ], + "x-api-enum": [ + { + "value": "TRADE_EXCHANGE", + "name": "", + "description": "" + }, + { + "value": "TRANSFER", + "name": "", + "description": "" + } + ] + }, + "enable": true + }, + { + "id": "pPnKFH2DlI", + "name": "lastId", + "required": false, + "description": "The id of the last set of data from the previous batch of data. By default, the latest information is given.", + "example": "254062248624417", + "type": "integer", + "schema": { + "type": "integer", + "format": "int64" + }, + "enable": true + }, + { + "id": "TJwaZEZ59O", + "name": "limit", + "required": false, + "description": "Default100,Max200", + "example": "100", + "type": "integer", + "schema": { + "type": "integer", + "default": 100, + "maximum": 200, + "minimum": 1 + }, + "enable": true + }, + { + "id": "nRkUqJX2U6", + "name": "startAt", + "required": false, + "description": "Start time (milisecond)", + "example": "1728663338000", + "type": "integer", + "schema": { + "type": "integer", + "format": "int64" + }, + "enable": true + }, + { + "id": "rqSOV202LJ", + "name": "endAt", + "required": false, + "description": "End time (milisecond)", + "example": "1728692138000", + "type": "integer", + "schema": { + "type": "integer", + "format": "int64" + }, + "enable": true } ], + "path": [], "cookie": [], "header": [] }, "responses": [ { - "id": "10096", + "id": "10086", "code": 200, "name": "OK", "headers": [], @@ -2445,152 +1625,84 @@ "type": "string" }, "data": { - "type": "object", - "properties": { - "subUserId": { - "type": "string", - "description": "The user ID of a sub-user." - }, - "subName": { - "type": "string", - "description": "The username of a sub-user." - }, - "mainAccounts": { - "type": "array", - "items": { - "type": "object", - "properties": { - "currency": { - "type": "string", - "description": "Currency" - }, - "balance": { - "type": "string", - "description": "Total funds in an account." - }, - "available": { - "type": "string", - "description": "Funds available to withdraw or trade." - }, - "holds": { - "type": "string", - "description": "Funds on hold (not available for use)." - }, - "baseCurrency": { - "type": "string", - "description": "Calculated on this currency." - }, - "baseCurrencyPrice": { - "type": "string", - "description": "The base currency price." - }, - "baseAmount": { - "type": "string", - "description": "The base currency amount." - }, - "tag": { - "type": "string" - } - } + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Unique id" }, - "description": "Funding Account" - }, - "tradeAccounts": { - "type": "array", - "items": { - "type": "object", - "properties": { - "currency": { - "type": "string", - "description": "Currency" - }, - "balance": { - "type": "string", - "description": "Total funds in an account." - }, - "available": { - "type": "string", - "description": "Funds available to withdraw or trade." - }, - "holds": { - "type": "string", - "description": "Funds on hold (not available for use)." - }, - "baseCurrency": { - "type": "string", - "description": "Calculated on this currency." - }, - "baseCurrencyPrice": { - "type": "string", - "description": "The base currency price." - }, - "baseAmount": { - "type": "string", - "description": "The base currency amount." - }, - "tag": { - "type": "string" - } - } + "currency": { + "type": "string", + "description": "currency" }, - "description": "Spot Account" - }, - "marginAccounts": { - "type": "array", - "items": { - "type": "object", - "properties": { - "currency": { - "type": "string", - "description": "Currency" - }, - "balance": { - "type": "string", - "description": "Total funds in an account." - }, - "available": { - "type": "string", - "description": "Funds available to withdraw or trade." - }, - "holds": { - "type": "string", - "description": "Funds on hold (not available for use)." - }, - "baseCurrency": { - "type": "string", - "description": "Calculated on this currency." - }, - "baseCurrencyPrice": { - "type": "string", - "description": "The base currency price." - }, - "baseAmount": { - "type": "string", - "description": "The base currency amount." + "amount": { + "type": "string", + "description": "Change in funds balance" + }, + "fee": { + "type": "string", + "description": "Deposit or withdrawal fee" + }, + "tax": { + "type": "string" + }, + "balance": { + "type": "string", + "description": "Total balance of funds after change" + }, + "accountType": { + "type": "string", + "description": "Master account type TRADE_HF" + }, + "bizType": { + "type": "string", + "description": "Trnasaction type,such as TRANSFER, TRADE_EXCHANGE, etc." + }, + "direction": { + "type": "string", + "description": "Direction of transfer( out or in)", + "enum": [ + "in", + "out" + ], + "x-api-enum": [ + { + "value": "in", + "name": "", + "description": "" }, - "tag": { - "type": "string" + { + "value": "out", + "name": "", + "description": "" } - } + ] }, - "description": "Margin Account" - }, - "tradeHFAccounts": { - "type": "array", - "items": { - "type": "string" + "createdAt": { + "type": "string", + "description": "Created time" }, - "description": "This param is deprecated and only valid for some old users" - } - }, - "required": [ - "subUserId", - "subName", - "mainAccounts", - "tradeAccounts", - "marginAccounts", - "tradeHFAccounts" - ] + "context": { + "type": "string", + "description": "Core transaction parameter" + } + }, + "required": [ + "id", + "currency", + "amount", + "fee", + "tax", + "balance", + "accountType", + "bizType", + "direction", + "createdAt", + "context" + ] + } } }, "required": [ @@ -2606,9 +1718,15 @@ "responseExamples": [ { "name": "Success", - "data": "{\n \"code\": \"200000\",\n \"data\": {\n \"subUserId\": \"63743f07e0c5230001761d08\",\n \"subName\": \"testapi6\",\n \"mainAccounts\": [\n {\n \"currency\": \"USDT\",\n \"balance\": \"0.01\",\n \"available\": \"0.01\",\n \"holds\": \"0\",\n \"baseCurrency\": \"BTC\",\n \"baseCurrencyPrice\": \"62384.3\",\n \"baseAmount\": \"0.00000016\",\n \"tag\": \"DEFAULT\"\n }\n ],\n \"tradeAccounts\": [\n {\n \"currency\": \"USDT\",\n \"balance\": \"0.01\",\n \"available\": \"0.01\",\n \"holds\": \"0\",\n \"baseCurrency\": \"BTC\",\n \"baseCurrencyPrice\": \"62384.3\",\n \"baseAmount\": \"0.00000016\",\n \"tag\": \"DEFAULT\"\n }\n ],\n \"marginAccounts\": [\n {\n \"currency\": \"USDT\",\n \"balance\": \"0.01\",\n \"available\": \"0.01\",\n \"holds\": \"0\",\n \"baseCurrency\": \"BTC\",\n \"baseCurrencyPrice\": \"62384.3\",\n \"baseAmount\": \"0.00000016\",\n \"tag\": \"DEFAULT\"\n }\n ],\n \"tradeHFAccounts\": []\n }\n}", - "responseId": 10096, + "data": "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"id\": \"254062248624417\",\n \"currency\": \"USDT\",\n \"amount\": \"1.59760080\",\n \"fee\": \"0.00159920\",\n \"tax\": \"0\",\n \"balance\": \"26.73759503\",\n \"accountType\": \"TRADE_HF\",\n \"bizType\": \"TRADE_EXCHANGE\",\n \"direction\": \"in\",\n \"createdAt\": \"1728443957539\",\n \"context\": \"{\\\"symbol\\\":\\\"KCS-USDT\\\",\\\"orderId\\\":\\\"6705f6350dc7210007d6a36d\\\",\\\"tradeId\\\":\\\"10046097631627265\\\"}\"\n }\n ]\n}", + "responseId": 10086, "ordering": 1 + }, + { + "name": "KCS DEDUCTION FEES", + "data": "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"id\": \"284494946713889\",\n \"currency\": \"BTC\",\n \"amount\": \"0.00004585\",\n \"fee\": \"0.00000000\",\n \"tax\": \"0\",\n \"balance\": \"0.00092103\",\n \"accountType\": \"TRADE_HF\",\n \"bizType\": \"TRADE_EXCHANGE\",\n \"direction\": \"in\",\n \"createdAt\": \"1729004451665\",\n \"context\": \"{\\\"symbol\\\":\\\"BTC-USDT\\\",\\\"orderId\\\":\\\"670e83a3640ce3000736aace\\\",\\\"tradeId\\\":\\\"10946063166095361\\\"}\"\n },\n {\n \"id\": \"284494946713888\",\n \"currency\": \"USDT\",\n \"amount\": \"3.00023007\",\n \"fee\": \"0.00299723\",\n \"tax\": \"0\",\n \"balance\": \"31.40074009\",\n \"accountType\": \"TRADE_HF\",\n \"bizType\": \"TRADE_EXCHANGE\",\n \"direction\": \"out\",\n \"createdAt\": \"1729004451665\",\n \"context\": \"{\\\"symbol\\\":\\\"BTC-USDT\\\",\\\"orderId\\\":\\\"670e83a3640ce3000736aace\\\",\\\"tradeId\\\":\\\"10946063166095361\\\"}\"\n },\n {\n \"id\": \"284494428832032\",\n \"currency\": \"USDT\",\n \"amount\": \"0.00499782\",\n \"fee\": \"0.00000000\",\n \"tax\": \"0\",\n \"balance\": \"34.40097016\",\n \"accountType\": \"TRADE_HF\",\n \"bizType\": \"RETURNED_FEES\",\n \"direction\": \"in\",\n \"createdAt\": \"1729004444549\",\n \"context\": \"{}\"\n },\n {\n \"id\": \"284494423736608\",\n \"currency\": \"KCS\",\n \"amount\": \"0.00047428\",\n \"fee\": \"0.00000000\",\n \"tax\": \"0\",\n \"balance\": \"17.36207049\",\n \"accountType\": \"TRADE_HF\",\n \"bizType\": \"DEDUCTION_FEES\",\n \"direction\": \"out\",\n \"createdAt\": \"1729004444468\",\n \"context\": \"{}\"\n }\n ]\n}", + "responseId": 10086, + "ordering": 2 } ], "requestBody": { @@ -2620,58 +1738,129 @@ }, "mediaType": "" }, - "description": ":::info[Description]\nThis endpoint returns the account info of a sub-user specified by the subUserId.\n:::", - "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"General\",\"api-rate-limit-pool\":\"Management\",\"sdk-service\":\"Account\",\"sdk-sub-service\":\"SubAccount\",\"sdk-method-name\":\"getSpotSubAccountDetail\",\"sdk-method-description\":\"This endpoint returns the account info of a sub-user specified by the subUserId.\",\"api-rate-limit\":15}" + "description": ":::info[Description]\nThis API endpoint returns all transfer (in and out) records in high-frequency trading account and supports multi-coin queries. The query results are sorted in descending order by createdAt and id.\n:::\n\n\n\n:::tip[Tips]\nIf lastId is configured, the information obtained < lastId. Otherwise, it will go back to the latest information.\n\nYou can only obtain data from within a 3 _ 24 hour time range (i.e., from 3 _ 24 hours ago up to now) If you specify a time range that exceeds this limit, the system will default to data from within 3 * 24 hours.\n:::\n\n**context**\n\nIf the bizType is TRADE_EXCHANGE, the context field will include additional transaction information (order id, transaction id, and trading pair).\n", + "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"General\",\"api-rate-limit-pool\":\"Spot\",\"sdk-service\":\"Account\",\"sdk-sub-service\":\"Account\",\"sdk-method-name\":\"getSpotHFLedger\",\"sdk-method-description\":\"This API endpoint returns all transfer (in and out) records in high-frequency trading account and supports multi-coin queries. The query results are sorted in descending order by createdAt and id.\",\"api-rate-limit\":2}" } }, { - "name": "Get SubAccount List - Spot Balance(V2)", + "name": "Get Account Ledgers - Margin_hf", "api": { - "id": "3470133", + "id": "3470123", "method": "get", - "path": "/api/v2/sub-accounts", + "path": "/api/v3/hf/margin/account/ledgers", "parameters": { - "path": [], "query": [ { - "id": "iIrspuNh6x", - "name": "currentPage", + "id": "8YpRjfgiQY", + "name": "currency", "required": false, - "description": "Current request page. Default is 1", - "example": "1", + "description": "currency, optional,can select more than one,separate with commas,select no more than 10 currencys,the default will be to query for all currencys if left empty", + "example": "BTC", + "type": "string", + "enable": true + }, + { + "id": "iwlQIVyBkb", + "name": "direction", + "required": false, + "description": "direction: in, out", + "example": "in", + "type": "string", + "schema": { + "type": "string", + "enum": [ + "in", + "out" + ], + "x-api-enum": [ + { + "value": "in", + "name": "", + "description": "" + }, + { + "value": "out", + "name": "", + "description": "" + } + ] + }, + "enable": true + }, + { + "id": "79t7ddnYAv", + "name": "bizType", + "required": false, + "description": "Transaction type: TRANSFER- transfer funds, MARGIN_EXCHANGE - cross margin trade, ISOLATED_EXCHANGE - isolated margin trade, LIQUIDATION - liquidation, ASSERT_RETURN - forced liquidation asset return", + "example": "TRANSFER", + "type": "string", + "schema": { + "type": "string" + }, + "enable": true + }, + { + "id": "pPnKFH2DlI", + "name": "lastId", + "required": false, + "description": "The id of the last set of data from the previous batch of data. By default, the latest information is given.", + "example": "254062248624417", "type": "integer", "schema": { "type": "integer", - "default": 1, - "examples": [ - 1 - ] - } + "format": "int64" + }, + "enable": true }, { - "id": "hHqVIyqcpo", - "name": "pageSize", + "id": "TJwaZEZ59O", + "name": "limit", "required": false, - "description": "Number of results per request. Minimum is 10, maximum is 100, default is 10.\n", - "example": "10", + "description": "Default100,Max200", + "example": "100", "type": "integer", "schema": { "type": "integer", - "examples": [ - 10 - ], - "default": 10, - "minimum": 10, - "maximum": 100 - } + "default": 100, + "maximum": 200, + "minimum": 1 + }, + "enable": true + }, + { + "id": "nRkUqJX2U6", + "name": "startAt", + "required": false, + "description": "Start time (milisecond)", + "example": "1728663338000", + "type": "integer", + "schema": { + "type": "integer", + "format": "int64" + }, + "enable": true + }, + { + "id": "rqSOV202LJ", + "name": "endAt", + "required": false, + "description": "End time (milisecond)", + "example": "1728692138000", + "type": "integer", + "schema": { + "type": "integer", + "format": "int64" + }, + "enable": true } ], + "path": [], "cookie": [], "header": [] }, "responses": [ { - "id": "10097", + "id": "10087", "code": 200, "name": "OK", "headers": [], @@ -2682,179 +1871,56 @@ "type": "string" }, "data": { - "type": "object", - "properties": { - "currentPage": { - "type": "integer" - }, - "pageSize": { - "type": "integer" - }, - "totalNum": { - "type": "integer" - }, - "totalPage": { - "type": "integer" - }, - "items": { - "type": "array", - "items": { - "type": "object", - "properties": { - "subUserId": { - "type": "string", - "description": "The user ID of the sub-user." - }, - "subName": { - "type": "string", - "description": "The username of the sub-user." - }, - "mainAccounts": { - "type": "array", - "items": { - "type": "object", - "properties": { - "currency": { - "type": "string", - "description": "The currency of the account." - }, - "balance": { - "type": "string", - "description": "Total funds in the account." - }, - "available": { - "type": "string", - "description": "Funds available to withdraw or trade." - }, - "holds": { - "type": "string", - "description": "Funds on hold (not available for use)." - }, - "baseCurrency": { - "type": "string", - "description": "Calculated on this currency." - }, - "baseCurrencyPrice": { - "type": "string", - "description": "The base currency price." - }, - "baseAmount": { - "type": "string", - "description": "The base currency amount." - }, - "tag": { - "type": "string" - } - } - }, - "description": "Funding Account" - }, - "tradeAccounts": { - "type": "array", - "items": { - "type": "object", - "properties": { - "currency": { - "type": "string", - "description": "The currency of the account." - }, - "balance": { - "type": "string", - "description": "Total funds in the account." - }, - "available": { - "type": "string", - "description": "Funds available to withdraw or trade." - }, - "holds": { - "type": "string", - "description": "Funds on hold (not available for use)." - }, - "baseCurrency": { - "type": "string", - "description": "Calculated on this currency." - }, - "baseCurrencyPrice": { - "type": "string", - "description": "The base currency price." - }, - "baseAmount": { - "type": "string", - "description": "The base currency amount." - }, - "tag": { - "type": "string" - } - } - }, - "description": "Spot Account" - }, - "marginAccounts": { - "type": "array", - "items": { - "type": "object", - "properties": { - "currency": { - "type": "string", - "description": "The currency of the account." - }, - "balance": { - "type": "string", - "description": "Total funds in the account." - }, - "available": { - "type": "string", - "description": "Funds available to withdraw or trade." - }, - "holds": { - "type": "string", - "description": "Funds on hold (not available for use)." - }, - "baseCurrency": { - "type": "string", - "description": "Calculated on this currency." - }, - "baseCurrencyPrice": { - "type": "string", - "description": "The base currency price." - }, - "baseAmount": { - "type": "string", - "description": "The base currency amount." - }, - "tag": { - "type": "string" - } - } - }, - "description": "Margin Account" - }, - "tradeHFAccounts": { - "type": "array", - "items": { - "type": "string" - }, - "description": "This param is deprecated and only valid for some old users" - } - }, - "required": [ - "subUserId", - "subName", - "mainAccounts", - "tradeAccounts", - "marginAccounts", - "tradeHFAccounts" - ] + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "currency": { + "type": "string", + "description": "currency" + }, + "amount": { + "type": "string", + "description": "Change in funds balance" + }, + "fee": { + "type": "string", + "description": "Deposit or withdrawal fee" + }, + "balance": { + "type": "string", + "description": "Total balance of funds after change" + }, + "accountType": { + "type": "string", + "description": "Master account type TRADE_HF" + }, + "bizType": { + "type": "string", + "description": "Trnasaction type,such as TRANSFER, TRADE_EXCHANGE, etc." + }, + "direction": { + "type": "string", + "description": "Direction of transfer( out or in)" + }, + "createdAt": { + "type": "integer", + "description": "Ledger creation time", + "format": "int64" + }, + "context": { + "type": "string", + "description": "Core transaction parameter" + }, + "tax": { + "type": "string" } } - }, - "required": [ - "currentPage", - "pageSize", - "totalNum", - "totalPage", - "items" - ] + } } }, "required": [ @@ -2870,8 +1936,8 @@ "responseExamples": [ { "name": "Success", - "data": "{\n \"code\": \"200000\",\n \"data\": {\n \"currentPage\": 1,\n \"pageSize\": 10,\n \"totalNum\": 3,\n \"totalPage\": 1,\n \"items\": [\n {\n \"subUserId\": \"63743f07e0c5230001761d08\",\n \"subName\": \"testapi6\",\n \"mainAccounts\": [\n {\n \"currency\": \"USDT\",\n \"balance\": \"0.01\",\n \"available\": \"0.01\",\n \"holds\": \"0\",\n \"baseCurrency\": \"BTC\",\n \"baseCurrencyPrice\": \"62514.5\",\n \"baseAmount\": \"0.00000015\",\n \"tag\": \"DEFAULT\"\n }\n ],\n \"tradeAccounts\": [\n {\n \"currency\": \"USDT\",\n \"balance\": \"0.01\",\n \"available\": \"0.01\",\n \"holds\": \"0\",\n \"baseCurrency\": \"BTC\",\n \"baseCurrencyPrice\": \"62514.5\",\n \"baseAmount\": \"0.00000015\",\n \"tag\": \"DEFAULT\"\n }\n ],\n \"marginAccounts\": [\n {\n \"currency\": \"USDT\",\n \"balance\": \"0.01\",\n \"available\": \"0.01\",\n \"holds\": \"0\",\n \"baseCurrency\": \"BTC\",\n \"baseCurrencyPrice\": \"62514.5\",\n \"baseAmount\": \"0.00000015\",\n \"tag\": \"DEFAULT\"\n }\n ],\n \"tradeHFAccounts\": []\n },\n {\n \"subUserId\": \"670538a31037eb000115b076\",\n \"subName\": \"Name1234567\",\n \"mainAccounts\": [],\n \"tradeAccounts\": [],\n \"marginAccounts\": [],\n \"tradeHFAccounts\": []\n },\n {\n \"subUserId\": \"66b0c0905fc1480001c14c36\",\n \"subName\": \"LTkucoin1491\",\n \"mainAccounts\": [],\n \"tradeAccounts\": [],\n \"marginAccounts\": [],\n \"tradeHFAccounts\": []\n }\n ]\n }\n}", - "responseId": 10097, + "data": "{\"code\":\"200000\",\"data\":[{\"id\":1949641706720,\"currency\":\"USDT\",\"amount\":\"0.01000000\",\"fee\":\"0.00000000\",\"balance\":\"0.01000000\",\"accountType\":\"MARGIN_V2\",\"bizType\":\"TRANSFER\",\"direction\":\"in\",\"createdAt\":1728664091208,\"context\":\"{}\",\"tax\":\"0.00000000\"}]}", + "responseId": 10087, "ordering": 1 } ], @@ -2884,32 +1950,102 @@ }, "mediaType": "" }, - "description": ":::info[Description]\nThis endpoint can be used to get paginated Spot sub-account information. Pagination is required.\n:::", - "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"General\",\"api-rate-limit-pool\":\"Management\",\"sdk-service\":\"Account\",\"sdk-sub-service\":\"SubAccount\",\"sdk-method-name\":\"getSpotSubAccountListV2\",\"sdk-method-description\":\"This endpoint can be used to get paginated Spot sub-account information. Pagination is required.\",\"api-rate-limit\":20}" + "description": ":::info[Description]\nThis API endpoint returns all transfer (in and out) records in high-frequency margin trading account and supports multi-coin queries. The query results are sorted in descending order by createdAt and id.\n:::\n\n\n:::tip[Tips]\nIf lastId is configured, the information obtained < lastId. Otherwise, it will go back to the latest information.\n\nYou can only obtain data from within a 3 _ 24 hour time range (i.e., from 3 _ 24 hours ago up to now) If you specify a time range that exceeds this limit, the system will default to data from within 3 * 24 hours.\n\nIf bizType is MARGIN_EXCHANGE or ISOLATED_EXCHANGE, the context field will contain additional information about the transaction (order id, transaction id, transaction pair).\n:::\n\n", + "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"General\",\"api-rate-limit-pool\":\"Spot\",\"sdk-service\":\"Account\",\"sdk-sub-service\":\"Account\",\"sdk-method-name\":\"getMarginHFLedger\",\"sdk-method-description\":\"This API endpoint returns all transfer (in and out) records in high-frequency margin trading account and supports multi-coin queries. The query results are sorted in descending order by createdAt and id.\",\"api-rate-limit\":2}" } }, { - "name": "Get SubAccount List - Futures Balance(V2)", + "name": "Get Account Ledgers - Futures", "api": { - "id": "3470134", + "id": "3470124", "method": "get", - "path": "/api/v1/account-overview-all", + "path": "/api/v1/transaction-history", "parameters": { "query": [ { - "id": "iIrspuNh6x", + "id": "cYqa8zbNGo", "name": "currency", "required": false, - "description": "Currecny, Default XBT", - "example": "USDT", + "description": "Currency of transaction history, XBT or USDT", + "example": "XBT", + "type": "string", + "enable": true + }, + { + "id": "79t7ddnYAv", + "name": "type", + "required": false, + "description": "Type RealisedPNL-Realised profit and loss, Deposit-Deposit, Withdrawal-withdraw, Transferin-Transfer in, TransferOut-Transfer out", + "example": "Transferin", "type": "string", "schema": { - "type": "string", - "default": "XBT", - "examples": [ - "USDT", - "ETH" - ] + "type": "string" + }, + "enable": true + }, + { + "id": "pPnKFH2DlI", + "name": "offset", + "required": false, + "description": "Start offset. Generally, the only attribute of the last returned result of the previous request is used, and the first page is returned by default", + "example": "254062248624417", + "type": "integer", + "schema": { + "type": "integer", + "format": "int64" + }, + "enable": true + }, + { + "id": "Y9kMltt1Nl", + "name": "forward", + "required": false, + "description": "This parameter functions to judge whether the lookup is forward or not. True means “yes” and False means “no”. This parameter is set as true by default", + "example": "false", + "type": "boolean", + "schema": { + "type": "boolean", + "default": true + }, + "enable": true + }, + { + "id": "TJwaZEZ59O", + "name": "maxCount", + "required": false, + "description": "Displayed size per page. The default size is 50", + "example": "50", + "type": "integer", + "schema": { + "type": "integer", + "default": 50, + "format": "int64" + }, + "enable": true + }, + { + "id": "nRkUqJX2U6", + "name": "startAt", + "required": false, + "description": "Start time (milisecond)", + "example": "1728663338000", + "type": "integer", + "schema": { + "type": "integer", + "format": "int64" + }, + "enable": true + }, + { + "id": "rqSOV202LJ", + "name": "endAt", + "required": false, + "description": "End time (milisecond)", + "example": "1728692138000", + "type": "integer", + "schema": { + "type": "integer", + "format": "int64" }, "enable": true } @@ -2920,7 +2056,7 @@ }, "responses": [ { - "id": "10098", + "id": "10088", "code": 200, "name": "OK", "headers": [], @@ -2933,107 +2069,70 @@ "data": { "type": "object", "properties": { - "summary": { - "type": "object", - "properties": { - "accountEquityTotal": { - "type": "number", - "description": "Total Account Equity" - }, - "unrealisedPNLTotal": { - "type": "number", - "description": "Total unrealisedPNL" - }, - "marginBalanceTotal": { - "type": "number", - "description": "Total Margin Balance" - }, - "positionMarginTotal": { - "type": "number", - "description": "Total Position margin" - }, - "orderMarginTotal": { - "type": "number" - }, - "frozenFundsTotal": { - "type": "number", - "description": "Total frozen funds for withdrawal and out-transfer" - }, - "availableBalanceTotal": { - "type": "number", - "description": "total available balance" - }, - "currency": { - "type": "string" - } - }, - "required": [ - "accountEquityTotal", - "unrealisedPNLTotal", - "marginBalanceTotal", - "positionMarginTotal", - "orderMarginTotal", - "frozenFundsTotal", - "availableBalanceTotal", - "currency" - ] - }, - "accounts": { + "dataList": { "type": "array", "items": { "type": "object", "properties": { - "accountName": { - "type": "string", - "description": "Account name, main account is main", - "examples": [ - "main" - ] + "time": { + "type": "integer", + "description": "ledger time", + "format": "int64" }, - "accountEquity": { - "type": "number" + "type": { + "type": "string", + "description": "Type: RealisedPNL, Deposit, Withdrawal, TransferIn, TransferOut" }, - "unrealisedPNL": { - "type": "number" + "amount": { + "type": "number", + "description": "Transaction amount" }, - "marginBalance": { - "type": "number" + "fee": { + "type": "number", + "description": "Fee" }, - "positionMargin": { - "type": "number" + "accountEquity": { + "type": "number", + "description": "Account equity" }, - "orderMargin": { - "type": "number" + "status": { + "type": "string", + "description": "Status: Completed, Pending" }, - "frozenFunds": { - "type": "number" + "remark": { + "type": "string", + "description": "Ticker symbol of the contract" }, - "availableBalance": { - "type": "number" + "offset": { + "type": "integer", + "description": "Offset" }, "currency": { "type": "string", - "description": "currency" + "description": "Currency" } }, "required": [ - "accountName", + "time", + "type", + "amount", + "fee", "accountEquity", - "unrealisedPNL", - "marginBalance", - "positionMargin", - "orderMargin", - "frozenFunds", - "availableBalance", + "status", + "remark", + "offset", "currency" ] - }, - "description": "Account List" + } + }, + "hasMore": { + "type": "boolean", + "description": "Is it the last page. If it is false, it means it is the last page, and if it is true, it means need to turn the page." } }, "required": [ - "summary", - "accounts" + "dataList", + "hasMore" ] } }, @@ -3050,8 +2149,8 @@ "responseExamples": [ { "name": "Success", - "data": "{\n \"code\": \"200000\",\n \"data\": {\n \"summary\": {\n \"accountEquityTotal\": 103.899081508,\n \"unrealisedPNLTotal\": 38.81075,\n \"marginBalanceTotal\": 65.336985668,\n \"positionMarginTotal\": 68.9588320683,\n \"orderMarginTotal\": 0,\n \"frozenFundsTotal\": 0,\n \"availableBalanceTotal\": 67.2492494397,\n \"currency\": \"USDT\"\n },\n \"accounts\": [\n {\n \"accountName\": \"Name1234567\",\n \"accountEquity\": 0,\n \"unrealisedPNL\": 0,\n \"marginBalance\": 0,\n \"positionMargin\": 0,\n \"orderMargin\": 0,\n \"frozenFunds\": 0,\n \"availableBalance\": 0,\n \"currency\": \"USDT\"\n },\n {\n \"accountName\": \"LTkucoin1491\",\n \"accountEquity\": 0,\n \"unrealisedPNL\": 0,\n \"marginBalance\": 0,\n \"positionMargin\": 0,\n \"orderMargin\": 0,\n \"frozenFunds\": 0,\n \"availableBalance\": 0,\n \"currency\": \"USDT\"\n },\n {\n \"accountName\": \"manage112233\",\n \"accountEquity\": 0,\n \"unrealisedPNL\": 0,\n \"marginBalance\": 0,\n \"positionMargin\": 0,\n \"orderMargin\": 0,\n \"frozenFunds\": 0,\n \"availableBalance\": 0,\n \"currency\": \"USDT\"\n },\n {\n \"accountName\": \"testapi6\",\n \"accountEquity\": 27.30545128,\n \"unrealisedPNL\": 22.549,\n \"marginBalance\": 4.75645128,\n \"positionMargin\": 24.1223749975,\n \"orderMargin\": 0,\n \"frozenFunds\": 0,\n \"availableBalance\": 25.7320762825,\n \"currency\": \"USDT\"\n },\n {\n \"accountName\": \"main\",\n \"accountEquity\": 76.593630228,\n \"unrealisedPNL\": 16.26175,\n \"marginBalance\": 60.580534388,\n \"positionMargin\": 44.8364570708,\n \"orderMargin\": 0,\n \"frozenFunds\": 0,\n \"availableBalance\": 41.5171731572,\n \"currency\": \"USDT\"\n }\n ]\n }\n}", - "responseId": 10098, + "data": "{\n \"code\": \"200000\",\n \"data\": {\n \"dataList\": [\n {\n \"time\": 1728665747000,\n \"type\": \"TransferIn\",\n \"amount\": 0.01,\n \"fee\": 0.0,\n \"accountEquity\": 14.02924938,\n \"status\": \"Completed\",\n \"remark\": \"Transferred from High-Frequency Trading Account\",\n \"offset\": 51360793,\n \"currency\": \"USDT\"\n },\n {\n \"time\": 1728648000000,\n \"type\": \"RealisedPNL\",\n \"amount\": 0.00630042,\n \"fee\": 0.0,\n \"accountEquity\": 20.0,\n \"status\": \"Completed\",\n \"remark\": \"XBTUSDTM\",\n \"offset\": 51352430,\n \"currency\": \"USDT\"\n }\n ],\n \"hasMore\": false\n }\n}", + "responseId": 10088, "ordering": 1 } ], @@ -3064,10 +2163,17 @@ }, "mediaType": "" }, - "description": ":::info[Description]\nThis endpoint can be used to get Futures sub-account information. \n:::", - "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Futures\",\"api-channel\":\"Private\",\"api-permission\":\"General\",\"api-rate-limit-pool\":\"Futures\",\"sdk-service\":\"Account\",\"sdk-sub-service\":\"SubAccount\",\"sdk-method-name\":\"getFuturesSubAccountListV2\",\"sdk-method-description\":\"This endpoint can be used to get Futures sub-account information. \",\"api-rate-limit\":6}" + "description": ":::info[Description]\nThis interface can query the ledger records of the futures business line\n:::\n\n\n\n:::tip[Tips]\nIf there are open positions, the status of the first page returned will be Pending, indicating the realised profit and loss in the current 8-hour settlement period. Please specify the minimum offset number of the current page into the offset field to turn the page.\n:::\n\n:::tip[Tips]\nSupplementary instructions for startAt and endAt: startAt must be less than endAt; and the interval cannot exceed 1 day; only one field is allowed, and if only one field is passed, another field will be automatically added or subtracted by the system 1 day to complete\n:::\n", + "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Futures\",\"api-channel\":\"Private\",\"api-permission\":\"General\",\"api-rate-limit-pool\":\"Futures\",\"sdk-service\":\"Account\",\"sdk-sub-service\":\"Account\",\"sdk-method-name\":\"getFuturesLedger\",\"sdk-method-description\":\"This interface can query the ledger records of the futures business line\",\"api-rate-limit\":2}" } - }, + } + ] + }, + { + "name": "Sub Account", + "id": 348140, + "description": "", + "items": [ { "name": "Add SubAccount", "api": { @@ -3334,41 +2440,38 @@ "description": ":::info[Description]\nThis endpoint can be used to add sub-accounts Futures permission. Before using this endpoints, you need to ensure that the master account apikey has Futures permissions and the Futures function has been activated.\n:::\n", "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"Futures\",\"api-rate-limit-pool\":\"Management\",\"sdk-service\":\"Account\",\"sdk-sub-service\":\"SubAccount\",\"sdk-method-name\":\"addSubAccountFuturesPermission\",\"sdk-method-description\":\"This endpoint can be used to add sub-accounts Futures permission. Before using this endpoints, you need to ensure that the master account apikey has Futures permissions and the Futures function has been activated.\",\"api-rate-limit\":15}" } - } - ] - }, - { - "name": "Sub Account API", - "id": 348141, - "description": "", - "items": [ + }, { - "name": "Get SubAccount API List", + "name": "Get SubAccount List - Summary Info", "api": { - "id": "3470136", + "id": "3470131", "method": "get", - "path": "/api/v1/sub/api-key", + "path": "/api/v2/sub/user", "parameters": { "query": [ { - "id": "iIrspuNh6x", - "name": "apiKey", + "id": "7kYgoQX9d6", + "name": "currentPage", "required": false, - "description": "API-Key", - "example": "", - "type": "string", - "schema": { - "type": "string" - }, + "description": "Current request page. Default is 1", + "example": "1", + "type": "integer", "enable": true }, { - "id": "ZHD0fezlqh", - "name": "subName", - "required": true, - "description": "Sub-account name.", - "example": "testapi6", - "type": "string", + "id": "iIrspuNh6x", + "name": "pageSize", + "required": false, + "description": "Number of results per request. Minimum is 1, maximum is 100, default is 10.", + "example": "10", + "type": "integer", + "fixedValue": false, + "schema": { + "type": "integer", + "default": 10, + "minimum": 1, + "maximum": 100 + }, "enable": true } ], @@ -3378,7 +2481,7 @@ }, "responses": [ { - "id": "10100", + "id": "10095", "code": 200, "name": "OK", "headers": [], @@ -3389,49 +2492,147 @@ "type": "string" }, "data": { - "type": "array", - "items": { - "type": "object", - "properties": { - "subName": { - "type": "string", - "description": "Sub Name" - }, - "remark": { - "type": "string", - "description": "Remarks" - }, - "apiKey": { - "type": "string", - "description": "API Key" - }, - "apiVersion": { - "type": "integer", - "description": "API Version" - }, - "permission": { - "type": "string", - "description": "[Permissions](apidog://link/pages/338144)" - }, - "ipWhitelist": { - "type": "string", - "description": "IP whitelist" - }, - "createdAt": { - "type": "integer", - "format": "int64", - "description": "Apikey create time" - }, - "uid": { - "type": "integer", - "description": "Sub-account UID" - }, - "isMaster": { - "type": "boolean", - "description": "Whether it is the master account." + "type": "object", + "properties": { + "currentPage": { + "type": "integer", + "description": "Current request page" + }, + "pageSize": { + "type": "integer", + "description": "Number of results per request. Minimum is 1, maximum is 100" + }, + "totalNum": { + "type": "integer", + "description": "Total number of messages" + }, + "totalPage": { + "type": "integer", + "description": "Total number of page" + }, + "items": { + "type": "array", + "items": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "Sub-account User Id" + }, + "uid": { + "type": "integer", + "description": "Sub-account UID" + }, + "subName": { + "type": "string", + "description": "Sub-account name" + }, + "status": { + "type": "integer", + "description": "Sub-account; 2:Enable, 3:Frozen", + "enum": [ + 2, + 3 + ], + "x-api-enum": [ + { + "value": 2, + "name": "", + "description": "Enable" + }, + { + "value": 3, + "name": "", + "description": "Frozen" + } + ] + }, + "type": { + "type": "integer", + "description": "Sub-account type", + "enum": [ + 0, + 1, + 2, + 5 + ], + "x-api-enum": [ + { + "value": 0, + "name": "NORMAL", + "description": "Normal subaccount" + }, + { + "value": 1, + "name": "ROBOT", + "description": "Robot subaccount" + }, + { + "value": 2, + "name": "Novice", + "description": "New financial sub-account" + }, + { + "value": 5, + "name": "HOSTED", + "description": "Asset management subaccount" + } + ] + }, + "access": { + "type": "string", + "description": "Sub-account Permission" + }, + "createdAt": { + "type": "integer", + "description": "Time of the event", + "format": "int64" + }, + "remarks": { + "type": "string", + "description": "Remarks" + }, + "tradeTypes": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Subaccount Permissions" + }, + "openedTradeTypes": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Subaccount active permissions,If do not have the corresponding permissions, need to log in to the sub-account and go to the corresponding web page to activate" + }, + "hostedStatus": { + "type": "string" + } + }, + "required": [ + "userId", + "uid", + "subName", + "status", + "type", + "access", + "createdAt", + "remarks", + "tradeTypes", + "openedTradeTypes", + "hostedStatus" + ] } } - } + }, + "required": [ + "currentPage", + "pageSize", + "totalNum", + "totalPage", + "items" + ] } }, "required": [ @@ -3447,13 +2648,13 @@ "responseExamples": [ { "name": "Success", - "data": "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"subName\": \"apiSdkTest\",\n \"remark\": \"sdk_test_integration\",\n \"apiKey\": \"673eab2a955ebf000195d7e4\",\n \"apiVersion\": 3,\n \"permission\": \"General\",\n \"ipWhitelist\": \"10.**.1\",\n \"createdAt\": 1732160298000,\n \"uid\": 215112467,\n \"isMaster\": false\n }\n ]\n}", - "responseId": 10100, + "data": "{\n \"code\": \"200000\",\n \"data\": {\n \"currentPage\": 1,\n \"pageSize\": 10,\n \"totalNum\": 1,\n \"totalPage\": 1,\n \"items\": [\n {\n \"userId\": \"63743f07e0c5230001761d08\",\n \"uid\": 169579801,\n \"subName\": \"testapi6\",\n \"status\": 2,\n \"type\": 0,\n \"access\": \"All\",\n \"createdAt\": 1668562696000,\n \"remarks\": \"remarks\",\n \"tradeTypes\": [\n \"Spot\",\n \"Futures\",\n \"Margin\"\n ],\n \"openedTradeTypes\": [\n \"Spot\"\n ],\n \"hostedStatus\": null\n }\n ]\n }\n}", + "responseId": 10095, "ordering": 1 } ], "requestBody": { - "type": "none", + "type": "application/x-www-form-urlencoded", "parameters": [], "jsonSchema": { "type": "object", @@ -3461,45 +2662,38 @@ }, "mediaType": "" }, - "description": ":::info[Description]\nThis endpoint can be used to obtain a list of APIs pertaining to a sub-account.(Not contain ND Broker Sub Account)\n:::", - "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"General\",\"api-rate-limit-pool\":\"Management\",\"sdk-service\":\"Account\",\"sdk-sub-service\":\"SubAccount\",\"sdk-method-name\":\"getSubAccountApiList\",\"sdk-method-description\":\"This endpoint can be used to obtain a list of APIs pertaining to a sub-account.(Not contain ND Broker Sub Account)\",\"api-rate-limit\":20}" + "description": ":::info[Description]\nThis endpoint can be used to get a paginated list of sub-accounts. Pagination is required.\n:::\n", + "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"General\",\"api-rate-limit-pool\":\"Management\",\"sdk-service\":\"Account\",\"sdk-sub-service\":\"SubAccount\",\"sdk-method-name\":\"getSpotSubAccountsSummaryV2\",\"sdk-method-description\":\"This endpoint can be used to get a paginated list of sub-accounts. Pagination is required.\",\"api-rate-limit\":20}" } }, { - "name": "Delete SubAccount API", + "name": "Get SubAccount Detail - Balance", "api": { - "id": "3470137", - "method": "delete", - "path": "/api/v1/sub/api-key", + "id": "3470132", + "method": "get", + "path": "/api/v1/sub-accounts/{subUserId}", "parameters": { - "path": [], + "path": [ + { + "id": "subUserId#0", + "name": "subUserId", + "required": true, + "description": "the userID of a sub-account.", + "example": "63743f07e0c5230001761d08", + "type": "string" + } + ], "query": [ { "id": "iIrspuNh6x", - "name": "apiKey", + "name": "includeBaseAmount", "required": true, - "description": "API-Key", - "example": "670621e3a25958000159c82f", - "type": "string", + "description": "false: do not display the currency which asset is 0, true: display all currency", + "example": "false", + "type": "boolean", "schema": { - "type": "string" + "type": "boolean" } - }, - { - "id": "ZHD0fezlqh", - "name": "subName", - "required": true, - "description": "Sub-account name.", - "example": "testapi6", - "type": "string" - }, - { - "id": "BcPTs91zPK", - "name": "passphrase", - "required": true, - "description": "Password(Password of the API key)", - "example": "11223344", - "type": "string" } ], "cookie": [], @@ -3507,7 +2701,7 @@ }, "responses": [ { - "id": "10301", + "id": "10096", "code": 200, "name": "OK", "headers": [], @@ -3520,18 +2714,149 @@ "data": { "type": "object", "properties": { + "subUserId": { + "type": "string", + "description": "The user ID of a sub-user." + }, "subName": { "type": "string", "description": "The username of a sub-user." }, - "apiKey": { - "type": "string", - "description": "The APIKEY of a sub-user." + "mainAccounts": { + "type": "array", + "items": { + "type": "object", + "properties": { + "currency": { + "type": "string", + "description": "Currency" + }, + "balance": { + "type": "string", + "description": "Total funds in an account." + }, + "available": { + "type": "string", + "description": "Funds available to withdraw or trade." + }, + "holds": { + "type": "string", + "description": "Funds on hold (not available for use)." + }, + "baseCurrency": { + "type": "string", + "description": "Calculated on this currency." + }, + "baseCurrencyPrice": { + "type": "string", + "description": "The base currency price." + }, + "baseAmount": { + "type": "string", + "description": "The base currency amount." + }, + "tag": { + "type": "string" + } + } + }, + "description": "Funding Account" + }, + "tradeAccounts": { + "type": "array", + "items": { + "type": "object", + "properties": { + "currency": { + "type": "string", + "description": "Currency" + }, + "balance": { + "type": "string", + "description": "Total funds in an account." + }, + "available": { + "type": "string", + "description": "Funds available to withdraw or trade." + }, + "holds": { + "type": "string", + "description": "Funds on hold (not available for use)." + }, + "baseCurrency": { + "type": "string", + "description": "Calculated on this currency." + }, + "baseCurrencyPrice": { + "type": "string", + "description": "The base currency price." + }, + "baseAmount": { + "type": "string", + "description": "The base currency amount." + }, + "tag": { + "type": "string" + } + } + }, + "description": "Spot Account" + }, + "marginAccounts": { + "type": "array", + "items": { + "type": "object", + "properties": { + "currency": { + "type": "string", + "description": "Currency" + }, + "balance": { + "type": "string", + "description": "Total funds in an account." + }, + "available": { + "type": "string", + "description": "Funds available to withdraw or trade." + }, + "holds": { + "type": "string", + "description": "Funds on hold (not available for use)." + }, + "baseCurrency": { + "type": "string", + "description": "Calculated on this currency." + }, + "baseCurrencyPrice": { + "type": "string", + "description": "The base currency price." + }, + "baseAmount": { + "type": "string", + "description": "The base currency amount." + }, + "tag": { + "type": "string" + } + } + }, + "description": "Margin Account" + }, + "tradeHFAccounts": { + "type": "array", + "items": { + "type": "string" + }, + "description": "This param is deprecated and only valid for some old users" } }, "required": [ + "subUserId", "subName", - "apiKey" + "mainAccounts", + "tradeAccounts", + "marginAccounts", + "tradeHFAccounts" ] } }, @@ -3548,8 +2873,8 @@ "responseExamples": [ { "name": "Success", - "data": "{\"code\":\"200000\",\"data\":{\"subName\":\"testapi6\",\"apiKey\":\"670621e3a25958000159c82f\"}}", - "responseId": 10301, + "data": "{\n \"code\": \"200000\",\n \"data\": {\n \"subUserId\": \"63743f07e0c5230001761d08\",\n \"subName\": \"testapi6\",\n \"mainAccounts\": [\n {\n \"currency\": \"USDT\",\n \"balance\": \"0.01\",\n \"available\": \"0.01\",\n \"holds\": \"0\",\n \"baseCurrency\": \"BTC\",\n \"baseCurrencyPrice\": \"62384.3\",\n \"baseAmount\": \"0.00000016\",\n \"tag\": \"DEFAULT\"\n }\n ],\n \"tradeAccounts\": [\n {\n \"currency\": \"USDT\",\n \"balance\": \"0.01\",\n \"available\": \"0.01\",\n \"holds\": \"0\",\n \"baseCurrency\": \"BTC\",\n \"baseCurrencyPrice\": \"62384.3\",\n \"baseAmount\": \"0.00000016\",\n \"tag\": \"DEFAULT\"\n }\n ],\n \"marginAccounts\": [\n {\n \"currency\": \"USDT\",\n \"balance\": \"0.01\",\n \"available\": \"0.01\",\n \"holds\": \"0\",\n \"baseCurrency\": \"BTC\",\n \"baseCurrencyPrice\": \"62384.3\",\n \"baseAmount\": \"0.00000016\",\n \"tag\": \"DEFAULT\"\n }\n ],\n \"tradeHFAccounts\": []\n }\n}", + "responseId": 10096, "ordering": 1 } ], @@ -3562,25 +2887,58 @@ }, "mediaType": "" }, - "description": ":::info[Description]\nThis endpoint can be used to delete sub-account APIs.\n:::", - "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"General\",\"api-rate-limit-pool\":\"Management\",\"sdk-service\":\"Account\",\"sdk-sub-service\":\"SubAccount\",\"sdk-method-name\":\"deleteSubAccountApi\",\"sdk-method-description\":\"This endpoint can be used to delete sub-account APIs.\",\"api-rate-limit\":30}" + "description": ":::info[Description]\nThis endpoint returns the account info of a sub-user specified by the subUserId.\n:::", + "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"General\",\"api-rate-limit-pool\":\"Management\",\"sdk-service\":\"Account\",\"sdk-sub-service\":\"SubAccount\",\"sdk-method-name\":\"getSpotSubAccountDetail\",\"sdk-method-description\":\"This endpoint returns the account info of a sub-user specified by the subUserId.\",\"api-rate-limit\":15}" } }, { - "name": "Add SubAccount API", + "name": "Get SubAccount List - Spot Balance(V2)", "api": { - "id": "3470138", - "method": "post", - "path": "/api/v1/sub/api-key", + "id": "3470133", + "method": "get", + "path": "/api/v2/sub-accounts", "parameters": { - "query": [], "path": [], + "query": [ + { + "id": "iIrspuNh6x", + "name": "currentPage", + "required": false, + "description": "Current request page. Default is 1", + "example": "1", + "type": "integer", + "schema": { + "type": "integer", + "default": 1, + "examples": [ + 1 + ] + } + }, + { + "id": "hHqVIyqcpo", + "name": "pageSize", + "required": false, + "description": "Number of results per request. Minimum is 10, maximum is 100, default is 10.\n", + "example": "10", + "type": "integer", + "schema": { + "type": "integer", + "examples": [ + 10 + ], + "default": 10, + "minimum": 10, + "maximum": 100 + } + } + ], "cookie": [], "header": [] }, "responses": [ { - "id": "10302", + "id": "10097", "code": 200, "name": "OK", "headers": [], @@ -3593,53 +2951,176 @@ "data": { "type": "object", "properties": { - "subName": { - "type": "string", - "description": "Sub-account name" - }, - "remark": { - "type": "string", - "description": "Remarks" - }, - "apiKey": { - "type": "string", - "description": "API Key" - }, - "apiSecret": { - "type": "string", - "description": "API Secret Key\n" - }, - "apiVersion": { - "type": "integer", - "description": "API Version" + "currentPage": { + "type": "integer" }, - "passphrase": { - "type": "string", - "description": "Password" + "pageSize": { + "type": "integer" }, - "permission": { - "type": "string", - "description": "[Permissions](apidog://link/pages/338144)" + "totalNum": { + "type": "integer" }, - "ipWhitelist": { - "type": "string", - "description": "IP whitelist" + "totalPage": { + "type": "integer" }, - "createdAt": { - "type": "integer", - "description": "Time of the event", - "format": "int64" + "items": { + "type": "array", + "items": { + "type": "object", + "properties": { + "subUserId": { + "type": "string", + "description": "The user ID of the sub-user." + }, + "subName": { + "type": "string", + "description": "The username of the sub-user." + }, + "mainAccounts": { + "type": "array", + "items": { + "type": "object", + "properties": { + "currency": { + "type": "string", + "description": "The currency of the account." + }, + "balance": { + "type": "string", + "description": "Total funds in the account." + }, + "available": { + "type": "string", + "description": "Funds available to withdraw or trade." + }, + "holds": { + "type": "string", + "description": "Funds on hold (not available for use)." + }, + "baseCurrency": { + "type": "string", + "description": "Calculated on this currency." + }, + "baseCurrencyPrice": { + "type": "string", + "description": "The base currency price." + }, + "baseAmount": { + "type": "string", + "description": "The base currency amount." + }, + "tag": { + "type": "string" + } + } + }, + "description": "Funding Account" + }, + "tradeAccounts": { + "type": "array", + "items": { + "type": "object", + "properties": { + "currency": { + "type": "string", + "description": "The currency of the account." + }, + "balance": { + "type": "string", + "description": "Total funds in the account." + }, + "available": { + "type": "string", + "description": "Funds available to withdraw or trade." + }, + "holds": { + "type": "string", + "description": "Funds on hold (not available for use)." + }, + "baseCurrency": { + "type": "string", + "description": "Calculated on this currency." + }, + "baseCurrencyPrice": { + "type": "string", + "description": "The base currency price." + }, + "baseAmount": { + "type": "string", + "description": "The base currency amount." + }, + "tag": { + "type": "string" + } + } + }, + "description": "Spot Account" + }, + "marginAccounts": { + "type": "array", + "items": { + "type": "object", + "properties": { + "currency": { + "type": "string", + "description": "The currency of the account." + }, + "balance": { + "type": "string", + "description": "Total funds in the account." + }, + "available": { + "type": "string", + "description": "Funds available to withdraw or trade." + }, + "holds": { + "type": "string", + "description": "Funds on hold (not available for use)." + }, + "baseCurrency": { + "type": "string", + "description": "Calculated on this currency." + }, + "baseCurrencyPrice": { + "type": "string", + "description": "The base currency price." + }, + "baseAmount": { + "type": "string", + "description": "The base currency amount." + }, + "tag": { + "type": "string" + } + } + }, + "description": "Margin Account" + }, + "tradeHFAccounts": { + "type": "array", + "items": { + "type": "string" + }, + "description": "This param is deprecated and only valid for some old users" + } + }, + "required": [ + "subUserId", + "subName", + "mainAccounts", + "tradeAccounts", + "marginAccounts", + "tradeHFAccounts" + ] + } } }, "required": [ - "subName", - "remark", - "apiKey", - "apiSecret", - "apiVersion", - "passphrase", - "permission", - "createdAt" + "currentPage", + "pageSize", + "totalNum", + "totalPage", + "items" ] } }, @@ -3656,113 +3137,57 @@ "responseExamples": [ { "name": "Success", - "data": "{\n \"code\": \"200000\",\n \"data\": {\n \"subName\": \"testapi6\",\n \"remark\": \"TheRemark\",\n \"apiKey\": \"670621e3a25958000159c82f\",\n \"apiSecret\": \"46fd8974******896f005b2340\",\n \"apiVersion\": 3,\n \"passphrase\": \"11223344\",\n \"permission\": \"General,Futures\",\n \"createdAt\": 1728455139000\n }\n}", - "responseId": 10302, + "data": "{\n \"code\": \"200000\",\n \"data\": {\n \"currentPage\": 1,\n \"pageSize\": 10,\n \"totalNum\": 3,\n \"totalPage\": 1,\n \"items\": [\n {\n \"subUserId\": \"63743f07e0c5230001761d08\",\n \"subName\": \"testapi6\",\n \"mainAccounts\": [\n {\n \"currency\": \"USDT\",\n \"balance\": \"0.01\",\n \"available\": \"0.01\",\n \"holds\": \"0\",\n \"baseCurrency\": \"BTC\",\n \"baseCurrencyPrice\": \"62514.5\",\n \"baseAmount\": \"0.00000015\",\n \"tag\": \"DEFAULT\"\n }\n ],\n \"tradeAccounts\": [\n {\n \"currency\": \"USDT\",\n \"balance\": \"0.01\",\n \"available\": \"0.01\",\n \"holds\": \"0\",\n \"baseCurrency\": \"BTC\",\n \"baseCurrencyPrice\": \"62514.5\",\n \"baseAmount\": \"0.00000015\",\n \"tag\": \"DEFAULT\"\n }\n ],\n \"marginAccounts\": [\n {\n \"currency\": \"USDT\",\n \"balance\": \"0.01\",\n \"available\": \"0.01\",\n \"holds\": \"0\",\n \"baseCurrency\": \"BTC\",\n \"baseCurrencyPrice\": \"62514.5\",\n \"baseAmount\": \"0.00000015\",\n \"tag\": \"DEFAULT\"\n }\n ],\n \"tradeHFAccounts\": []\n },\n {\n \"subUserId\": \"670538a31037eb000115b076\",\n \"subName\": \"Name1234567\",\n \"mainAccounts\": [],\n \"tradeAccounts\": [],\n \"marginAccounts\": [],\n \"tradeHFAccounts\": []\n },\n {\n \"subUserId\": \"66b0c0905fc1480001c14c36\",\n \"subName\": \"LTkucoin1491\",\n \"mainAccounts\": [],\n \"tradeAccounts\": [],\n \"marginAccounts\": [],\n \"tradeHFAccounts\": []\n }\n ]\n }\n}", + "responseId": 10097, "ordering": 1 } ], "requestBody": { - "type": "application/json", + "type": "none", "parameters": [], "jsonSchema": { - "title": "", "type": "object", - "properties": { - "passphrase": { - "type": "string", - "description": "Password(Must contain 7-32 characters. Cannot contain any spaces.)" - }, - "remark": { - "type": "string", - "description": "Remarks(1~24 characters)" - }, - "permission": { - "type": "string", - "description": "[Permissions](apidog://link/pages/338144)(Only General、Spot、Futures、Margin、InnerTransfer(Flex Transfer) permissions can be set, such as \"General, Trade\". The default is \"General\")", - "default": "General", - "examples": [ - "General, Trade" - ] - }, - "ipWhitelist": { - "type": "string", - "description": "IP whitelist(You may add up to 20 IPs. Use a halfwidth comma to each IP)" - }, - "expire": { - "type": "string", - "description": "API expiration time; Never expire(default)-1,30Day30,90Day90,180Day180,360Day360", - "default": "-1", - "enum": [ - "-1", - "30", - "90", - "180", - "360" - ], - "examples": [ - "30" - ], - "x-api-enum": [ - { - "value": "-1", - "name": "", - "description": "" - }, - { - "value": "30", - "name": "", - "description": "" - }, - { - "value": "90", - "name": "", - "description": "" - }, - { - "value": "180", - "name": "", - "description": "" - }, - { - "value": "360", - "name": "", - "description": "" - } - ] - }, - "subName": { - "type": "string", - "description": "Sub-account name, create sub account name of API Key." - } - }, - "required": [ - "subName", - "remark", - "passphrase" - ] + "properties": {} }, - "example": "{\n \"subName\": \"testapi6\",\n \"passphrase\": \"11223344\",\n \"remark\": \"TheRemark\",\n \"permission\": \"General,Spot,Futures\"\n}", "mediaType": "" }, - "description": ":::info[Description]\nThis endpoint can be used to create APIs for sub-accounts.\n:::", - "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"General\",\"api-rate-limit-pool\":\"Management\",\"sdk-service\":\"Account\",\"sdk-sub-service\":\"SubAccount\",\"sdk-method-name\":\"addSubAccountApi\",\"sdk-method-description\":\"This endpoint can be used to create APIs for sub-accounts.\",\"api-rate-limit\":20}" + "description": ":::info[Description]\nThis endpoint can be used to get paginated Spot sub-account information. Pagination is required.\n:::", + "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"General\",\"api-rate-limit-pool\":\"Management\",\"sdk-service\":\"Account\",\"sdk-sub-service\":\"SubAccount\",\"sdk-method-name\":\"getSpotSubAccountListV2\",\"sdk-method-description\":\"This endpoint can be used to get paginated Spot sub-account information. Pagination is required.\",\"api-rate-limit\":20}" } }, { - "name": "Modify SubAccount API", + "name": "Get SubAccount List - Futures Balance(V2)", "api": { - "id": "3470139", - "method": "post", - "path": "/api/v1/sub/api-key/update", + "id": "3470134", + "method": "get", + "path": "/api/v1/account-overview-all", "parameters": { - "query": [], + "query": [ + { + "id": "iIrspuNh6x", + "name": "currency", + "required": false, + "description": "Currecny, Default XBT", + "example": "USDT", + "type": "string", + "schema": { + "type": "string", + "default": "XBT", + "examples": [ + "USDT", + "ETH" + ] + }, + "enable": true + } + ], "path": [], "cookie": [], "header": [] }, "responses": [ { - "id": "10303", + "id": "10098", "code": 200, "name": "OK", "headers": [], @@ -3775,7 +3200,358 @@ "data": { "type": "object", "properties": { - "subName": { + "summary": { + "type": "object", + "properties": { + "accountEquityTotal": { + "type": "number", + "description": "Total Account Equity" + }, + "unrealisedPNLTotal": { + "type": "number", + "description": "Total unrealisedPNL" + }, + "marginBalanceTotal": { + "type": "number", + "description": "Total Margin Balance" + }, + "positionMarginTotal": { + "type": "number", + "description": "Total Position margin" + }, + "orderMarginTotal": { + "type": "number" + }, + "frozenFundsTotal": { + "type": "number", + "description": "Total frozen funds for withdrawal and out-transfer" + }, + "availableBalanceTotal": { + "type": "number", + "description": "total available balance" + }, + "currency": { + "type": "string" + } + }, + "required": [ + "accountEquityTotal", + "unrealisedPNLTotal", + "marginBalanceTotal", + "positionMarginTotal", + "orderMarginTotal", + "frozenFundsTotal", + "availableBalanceTotal", + "currency" + ] + }, + "accounts": { + "type": "array", + "items": { + "type": "object", + "properties": { + "accountName": { + "type": "string", + "description": "Account name, main account is main", + "examples": [ + "main" + ] + }, + "accountEquity": { + "type": "number" + }, + "unrealisedPNL": { + "type": "number" + }, + "marginBalance": { + "type": "number" + }, + "positionMargin": { + "type": "number" + }, + "orderMargin": { + "type": "number" + }, + "frozenFunds": { + "type": "number" + }, + "availableBalance": { + "type": "number" + }, + "currency": { + "type": "string", + "description": "currency" + } + }, + "required": [ + "accountName", + "accountEquity", + "unrealisedPNL", + "marginBalance", + "positionMargin", + "orderMargin", + "frozenFunds", + "availableBalance", + "currency" + ] + }, + "description": "Account List" + } + }, + "required": [ + "summary", + "accounts" + ] + } + }, + "required": [ + "code", + "data" + ] + }, + "description": "", + "contentType": "json", + "mediaType": "" + } + ], + "responseExamples": [ + { + "name": "Success", + "data": "{\n \"code\": \"200000\",\n \"data\": {\n \"summary\": {\n \"accountEquityTotal\": 103.899081508,\n \"unrealisedPNLTotal\": 38.81075,\n \"marginBalanceTotal\": 65.336985668,\n \"positionMarginTotal\": 68.9588320683,\n \"orderMarginTotal\": 0,\n \"frozenFundsTotal\": 0,\n \"availableBalanceTotal\": 67.2492494397,\n \"currency\": \"USDT\"\n },\n \"accounts\": [\n {\n \"accountName\": \"Name1234567\",\n \"accountEquity\": 0,\n \"unrealisedPNL\": 0,\n \"marginBalance\": 0,\n \"positionMargin\": 0,\n \"orderMargin\": 0,\n \"frozenFunds\": 0,\n \"availableBalance\": 0,\n \"currency\": \"USDT\"\n },\n {\n \"accountName\": \"LTkucoin1491\",\n \"accountEquity\": 0,\n \"unrealisedPNL\": 0,\n \"marginBalance\": 0,\n \"positionMargin\": 0,\n \"orderMargin\": 0,\n \"frozenFunds\": 0,\n \"availableBalance\": 0,\n \"currency\": \"USDT\"\n },\n {\n \"accountName\": \"manage112233\",\n \"accountEquity\": 0,\n \"unrealisedPNL\": 0,\n \"marginBalance\": 0,\n \"positionMargin\": 0,\n \"orderMargin\": 0,\n \"frozenFunds\": 0,\n \"availableBalance\": 0,\n \"currency\": \"USDT\"\n },\n {\n \"accountName\": \"testapi6\",\n \"accountEquity\": 27.30545128,\n \"unrealisedPNL\": 22.549,\n \"marginBalance\": 4.75645128,\n \"positionMargin\": 24.1223749975,\n \"orderMargin\": 0,\n \"frozenFunds\": 0,\n \"availableBalance\": 25.7320762825,\n \"currency\": \"USDT\"\n },\n {\n \"accountName\": \"main\",\n \"accountEquity\": 76.593630228,\n \"unrealisedPNL\": 16.26175,\n \"marginBalance\": 60.580534388,\n \"positionMargin\": 44.8364570708,\n \"orderMargin\": 0,\n \"frozenFunds\": 0,\n \"availableBalance\": 41.5171731572,\n \"currency\": \"USDT\"\n }\n ]\n }\n}", + "responseId": 10098, + "ordering": 1 + } + ], + "requestBody": { + "type": "none", + "parameters": [], + "jsonSchema": { + "type": "object", + "properties": {} + }, + "mediaType": "" + }, + "description": ":::info[Description]\nThis endpoint can be used to get Futures sub-account information. \n:::", + "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Futures\",\"api-channel\":\"Private\",\"api-permission\":\"General\",\"api-rate-limit-pool\":\"Futures\",\"sdk-service\":\"Account\",\"sdk-sub-service\":\"SubAccount\",\"sdk-method-name\":\"getFuturesSubAccountListV2\",\"sdk-method-description\":\"This endpoint can be used to get Futures sub-account information. \",\"api-rate-limit\":6}" + } + } + ] + }, + { + "name": "Sub Account API", + "id": 348141, + "description": "", + "items": [ + { + "name": "Add SubAccount API", + "api": { + "id": "3470138", + "method": "post", + "path": "/api/v1/sub/api-key", + "parameters": { + "query": [], + "path": [], + "cookie": [], + "header": [] + }, + "responses": [ + { + "id": "10302", + "code": 200, + "name": "OK", + "headers": [], + "jsonSchema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "object", + "properties": { + "subName": { + "type": "string", + "description": "Sub-account name" + }, + "remark": { + "type": "string", + "description": "Remarks" + }, + "apiKey": { + "type": "string", + "description": "API Key" + }, + "apiSecret": { + "type": "string", + "description": "API Secret Key\n" + }, + "apiVersion": { + "type": "integer", + "description": "API Version" + }, + "passphrase": { + "type": "string", + "description": "Password" + }, + "permission": { + "type": "string", + "description": "[Permissions](apidog://link/pages/338144)" + }, + "ipWhitelist": { + "type": "string", + "description": "IP whitelist" + }, + "createdAt": { + "type": "integer", + "description": "Time of the event", + "format": "int64" + } + }, + "required": [ + "subName", + "remark", + "apiKey", + "apiSecret", + "apiVersion", + "passphrase", + "permission", + "createdAt" + ] + } + }, + "required": [ + "code", + "data" + ] + }, + "description": "", + "contentType": "json", + "mediaType": "" + } + ], + "responseExamples": [ + { + "name": "Success", + "data": "{\n \"code\": \"200000\",\n \"data\": {\n \"subName\": \"testapi6\",\n \"remark\": \"TheRemark\",\n \"apiKey\": \"670621e3a25958000159c82f\",\n \"apiSecret\": \"46fd8974******896f005b2340\",\n \"apiVersion\": 3,\n \"passphrase\": \"11223344\",\n \"permission\": \"General,Futures\",\n \"createdAt\": 1728455139000\n }\n}", + "responseId": 10302, + "ordering": 1 + } + ], + "requestBody": { + "type": "application/json", + "parameters": [], + "jsonSchema": { + "title": "", + "type": "object", + "properties": { + "passphrase": { + "type": "string", + "description": "Password(Must contain 7-32 characters. Cannot contain any spaces.)" + }, + "remark": { + "type": "string", + "description": "Remarks(1~24 characters)" + }, + "permission": { + "type": "string", + "description": "[Permissions](apidog://link/pages/338144)(Only General、Spot、Futures、Margin、InnerTransfer(Flex Transfer) permissions can be set, such as \"General, Trade\". The default is \"General\")", + "default": "General", + "examples": [ + "General, Trade" + ] + }, + "ipWhitelist": { + "type": "string", + "description": "IP whitelist(You may add up to 20 IPs. Use a halfwidth comma to each IP)" + }, + "expire": { + "type": "string", + "description": "API expiration time; Never expire(default)-1,30Day30,90Day90,180Day180,360Day360", + "default": "-1", + "enum": [ + "-1", + "30", + "90", + "180", + "360" + ], + "examples": [ + "30" + ], + "x-api-enum": [ + { + "value": "-1", + "name": "", + "description": "" + }, + { + "value": "30", + "name": "", + "description": "" + }, + { + "value": "90", + "name": "", + "description": "" + }, + { + "value": "180", + "name": "", + "description": "" + }, + { + "value": "360", + "name": "", + "description": "" + } + ] + }, + "subName": { + "type": "string", + "description": "Sub-account name, create sub account name of API Key." + } + }, + "required": [ + "subName", + "remark", + "passphrase" + ] + }, + "example": "{\n \"subName\": \"testapi6\",\n \"passphrase\": \"11223344\",\n \"remark\": \"TheRemark\",\n \"permission\": \"General,Spot,Futures\"\n}", + "mediaType": "" + }, + "description": ":::info[Description]\nThis endpoint can be used to create APIs for sub-accounts.\n:::", + "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"General\",\"api-rate-limit-pool\":\"Management\",\"sdk-service\":\"Account\",\"sdk-sub-service\":\"SubAccount\",\"sdk-method-name\":\"addSubAccountApi\",\"sdk-method-description\":\"This endpoint can be used to create APIs for sub-accounts.\",\"api-rate-limit\":20}" + } + }, + { + "name": "Modify SubAccount API", + "api": { + "id": "3470139", + "method": "post", + "path": "/api/v1/sub/api-key/update", + "parameters": { + "query": [], + "path": [], + "cookie": [], + "header": [] + }, + "responses": [ + { + "id": "10303", + "code": 200, + "name": "OK", + "headers": [], + "jsonSchema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "object", + "properties": { + "subName": { "type": "string", "description": "Sub-account name" }, @@ -3903,52 +3679,33 @@ "description": ":::info[Description]\nThis endpoint can be used to modify sub-account APIs.\n:::", "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"General\",\"api-rate-limit-pool\":\"Management\",\"sdk-service\":\"Account\",\"sdk-sub-service\":\"SubAccount\",\"sdk-method-name\":\"modifySubAccountApi\",\"sdk-method-description\":\"This endpoint can be used to modify sub-account APIs.\",\"api-rate-limit\":30}" } - } - ] - }, - { - "name": "Deposit", - "id": 348142, - "description": "", - "items": [ + }, { - "name": "Get Deposit Address(V3)", + "name": "Get SubAccount API List", "api": { - "id": "3470140", + "id": "3470136", "method": "get", - "path": "/api/v3/deposit-addresses", + "path": "/api/v1/sub/api-key", "parameters": { "query": [ { "id": "iIrspuNh6x", - "name": "currency", - "required": true, - "description": "currency", + "name": "apiKey", + "required": false, + "description": "API-Key", "example": "", "type": "string", "schema": { - "type": "string", - "examples": [ - "BTC", - "ETH", - "USDT" - ] + "type": "string" }, "enable": true }, { - "id": "xpmD1ldX5o", - "name": "amount", - "required": false, - "description": "Deposit amount. This parameter is only used when applying for invoices on the Lightning Network. This parameter is invalid if it is not passed through the Lightning Network.", - "type": "string", - "enable": true - }, - { - "id": "eO27DXUL3U", - "name": "chain", - "required": false, - "description": "The chain Id of currency.", + "id": "ZHD0fezlqh", + "name": "subName", + "required": true, + "description": "Sub-account name.", + "example": "testapi6", "type": "string", "enable": true } @@ -3959,7 +3716,7 @@ }, "responses": [ { - "id": "10304", + "id": "10100", "code": 200, "name": "OK", "headers": [], @@ -3974,65 +3731,44 @@ "items": { "type": "object", "properties": { - "address": { - "type": "string", - "description": "Deposit address" - }, - "memo": { + "subName": { "type": "string", - "description": "Address remark. If there’s no remark, it is empty. When you withdraw from other platforms to the KuCoin, you need to fill in memo(tag). If you do not fill memo (tag), your deposit may not be available, please be cautious." + "description": "Sub Name" }, - "chainId": { + "remark": { "type": "string", - "description": "The chainId of currency", - "examples": [ - "eth", - "bech32", - "btc", - "kcc", - "trx", - "bsc", - "arbitrum", - "ton", - "optimism" - ] + "description": "Remarks" }, - "to": { + "apiKey": { "type": "string", - "description": "Deposit account type: main (funding account), trade (spot trading account)" + "description": "API Key" }, - "expirationDate": { + "apiVersion": { "type": "integer", - "description": "Expiration time, Lightning network expiration time, non-Lightning network this field is invalid" + "description": "API Version" }, - "currency": { + "permission": { "type": "string", - "description": "currency", - "examples": [ - "BTC", - "ETH", - "USDT" - ] + "description": "[Permissions](apidog://link/pages/338144)" }, - "contractAddress": { + "ipWhitelist": { "type": "string", - "description": "The token contract address." + "description": "IP whitelist" }, - "chainName": { - "type": "string", - "description": "The chainName of currency" + "createdAt": { + "type": "integer", + "format": "int64", + "description": "Apikey create time" + }, + "uid": { + "type": "integer", + "description": "Sub-account UID" + }, + "isMaster": { + "type": "boolean", + "description": "Whether it is the master account." } - }, - "required": [ - "address", - "memo", - "chainId", - "to", - "expirationDate", - "currency", - "contractAddress", - "chainName" - ] + } } } }, @@ -4049,8 +3785,8 @@ "responseExamples": [ { "name": "Success", - "data": "{\"code\":\"200000\",\"data\":[{\"address\":\"TSv3L1fS7yA3SxzKD8c1qdX4nLP6rqNxYz\",\"memo\":\"\",\"chainId\":\"trx\",\"to\":\"TRADE\",\"expirationDate\":0,\"currency\":\"USDT\",\"contractAddress\":\"TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t\",\"chainName\":\"TRC20\"},{\"address\":\"0x551e823a3b36865e8c5dc6e6ac6cc0b00d98533e\",\"memo\":\"\",\"chainId\":\"kcc\",\"to\":\"TRADE\",\"expirationDate\":0,\"currency\":\"USDT\",\"contractAddress\":\"0x0039f574ee5cc39bdd162e9a88e3eb1f111baf48\",\"chainName\":\"KCC\"},{\"address\":\"EQCA1BI4QRZ8qYmskSRDzJmkucGodYRTZCf_b9hckjla6dZl\",\"memo\":\"2085202643\",\"chainId\":\"ton\",\"to\":\"TRADE\",\"expirationDate\":0,\"currency\":\"USDT\",\"contractAddress\":\"EQCxE6mUtQJKFnGfaROTKOt1lZbDiiX1kCixRv7Nw2Id_sDs\",\"chainName\":\"TON\"},{\"address\":\"0x0a2586d5a901c8e7e68f6b0dc83bfd8bd8600ff5\",\"memo\":\"\",\"chainId\":\"eth\",\"to\":\"MAIN\",\"expirationDate\":0,\"currency\":\"USDT\",\"contractAddress\":\"0xdac17f958d2ee523a2206206994597c13d831ec7\",\"chainName\":\"ERC20\"}]}", - "responseId": 10304, + "data": "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"subName\": \"apiSdkTest\",\n \"remark\": \"sdk_test_integration\",\n \"apiKey\": \"673eab2a955ebf000195d7e4\",\n \"apiVersion\": 3,\n \"permission\": \"General\",\n \"ipWhitelist\": \"10.**.1\",\n \"createdAt\": 1732160298000,\n \"uid\": 215112467,\n \"isMaster\": false\n }\n ]\n}", + "responseId": 10100, "ordering": 1 } ], @@ -4063,130 +3799,53 @@ }, "mediaType": "" }, - "description": ":::info[Description]\nGet all deposit addresses for the currency you intend to deposit. If the returned data is empty, you may need to Add Deposit Address first.\n:::", - "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"General\",\"api-rate-limit-pool\":\"Management\",\"sdk-service\":\"Account\",\"sdk-sub-service\":\"Deposit\",\"sdk-method-name\":\"getDepositAddressV3\",\"sdk-method-description\":\"Get all deposit addresses for the currency you intend to deposit. If the returned data is empty, you may need to Add Deposit Address first.\",\"api-rate-limit\":5}" + "description": ":::info[Description]\nThis endpoint can be used to obtain a list of APIs pertaining to a sub-account.(Not contain ND Broker Sub Account)\n:::", + "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"General\",\"api-rate-limit-pool\":\"Management\",\"sdk-service\":\"Account\",\"sdk-sub-service\":\"SubAccount\",\"sdk-method-name\":\"getSubAccountApiList\",\"sdk-method-description\":\"This endpoint can be used to obtain a list of APIs pertaining to a sub-account.(Not contain ND Broker Sub Account)\",\"api-rate-limit\":20}" } }, { - "name": "Get Deposit History", + "name": "Delete SubAccount API", "api": { - "id": "3470141", - "method": "get", - "path": "/api/v1/deposits", + "id": "3470137", + "method": "delete", + "path": "/api/v1/sub/api-key", "parameters": { + "path": [], "query": [ { "id": "iIrspuNh6x", - "name": "currency", + "name": "apiKey", "required": true, - "description": "currency", - "example": "", + "description": "API-Key", + "example": "670621e3a25958000159c82f", "type": "string", "schema": { - "type": "string", - "examples": [ - "BTC", - "ETH", - "USDT" - ] - }, - "enable": true + "type": "string" + } }, { - "id": "0cGmW3GSC0", - "name": "status", - "required": false, - "description": "Status. Available value: PROCESSING, SUCCESS, and FAILURE", - "example": "SUCCESS", - "type": "string", - "schema": { - "type": "string", - "enum": [ - "PROCESSING", - "SUCCESS", - "FAILURE" - ], - "x-api-enum": [ - { - "value": "PROCESSING", - "name": "", - "description": "" - }, - { - "value": "SUCCESS", - "name": "", - "description": "" - }, - { - "value": "FAILURE", - "name": "", - "description": "" - } - ] - }, - "enable": true - }, - { - "id": "5Lwpfvg7zz", - "name": "startAt", - "required": false, - "description": "Start time (milisecond)", - "example": "1728663338000", - "type": "integer", - "schema": { - "type": "integer", - "format": "int64" - }, - "enable": true - }, - { - "id": "WvwRPqp0J5", - "name": "endAt", - "required": false, - "description": "End time (milisecond)", - "example": "1728692138000", - "type": "integer", - "schema": { - "type": "integer", - "format": "int64" - }, - "enable": true - }, - { - "id": "veUIPKz0h5", - "name": "currentPage", - "required": false, - "description": "Current request page.", - "example": "1", - "type": "integer", - "schema": { - "type": "integer" - }, - "enable": true + "id": "ZHD0fezlqh", + "name": "subName", + "required": true, + "description": "Sub-account name.", + "example": "testapi6", + "type": "string" }, { - "id": "ghmIBiuNgn", - "name": "pageSize", - "required": false, - "description": "Number of results per request. Minimum is 10, maximum is 500.", - "example": "50", - "type": "integer", - "schema": { - "type": "integer", - "minimum": 10, - "maximum": 500, - "default": 50 - }, - "enable": true + "id": "BcPTs91zPK", + "name": "passphrase", + "required": true, + "description": "Password(Password of the API key)", + "example": "11223344", + "type": "string" } ], - "path": [], "cookie": [], "header": [] }, "responses": [ { - "id": "10305", + "id": "10301", "code": 200, "name": "OK", "headers": [], @@ -4199,124 +3858,18 @@ "data": { "type": "object", "properties": { - "currentPage": { - "type": "integer", - "description": "current page" - }, - "pageSize": { - "type": "integer", - "description": "page size" - }, - "totalNum": { - "type": "integer", - "description": "total number" - }, - "totalPage": { - "type": "integer", - "description": "total page" + "subName": { + "type": "string", + "description": "The username of a sub-user." }, - "items": { - "type": "array", - "items": { - "type": "object", - "properties": { - "currency": { - "type": "string", - "description": "Currency" - }, - "chain": { - "type": "string", - "description": "The chainName of currency", - "examples": [ - "ERC20", - "BTC-Segwit", - "BTC", - "KCC", - "TRC20", - "BEP20", - "ARBITRUM", - "TON", - "OPTIMISM" - ] - }, - "status": { - "type": "string", - "description": "Status", - "enum": [ - "PROCESSING", - "SUCCESS", - "FAILURE" - ], - "x-api-enum": [ - { - "value": "PROCESSING", - "name": "", - "description": "" - }, - { - "value": "SUCCESS", - "name": "", - "description": "" - }, - { - "value": "FAILURE", - "name": "", - "description": "" - } - ] - }, - "address": { - "type": "string", - "description": "Deposit address" - }, - "memo": { - "type": "string", - "description": "Address remark. If there’s no remark, it is empty. " - }, - "isInner": { - "type": "boolean", - "description": "Internal deposit or not" - }, - "amount": { - "type": "string", - "description": "Deposit amount" - }, - "fee": { - "type": "string", - "description": "Fees charged for deposit" - }, - "walletTxId": { - "type": "string", - "description": "Wallet Txid" - }, - "createdAt": { - "type": "integer", - "description": "Creation time of the database record", - "format": "int64" - }, - "updatedAt": { - "type": "integer", - "description": "Update time of the database record", - "format": "int64" - }, - "remark": { - "type": "string", - "description": "remark" - }, - "arrears": { - "type": "boolean", - "description": "Whether there is any debt.A quick rollback will cause the deposit to fail. If the deposit fails, you will need to repay the balance." - } - } - } + "apiKey": { + "type": "string", + "description": "The APIKEY of a sub-user." } }, "required": [ - "currentPage", - "pageSize", - "totalNum", - "totalPage", - "items" + "subName", + "apiKey" ] } }, @@ -4333,8 +3886,8 @@ "responseExamples": [ { "name": "Success", - "data": "{\n \"code\": \"200000\",\n \"data\": {\n \"currentPage\": 1,\n \"pageSize\": 50,\n \"totalNum\": 5,\n \"totalPage\": 1,\n \"items\": [\n {\n \"currency\": \"USDT\",\n \"chain\": \"\",\n \"status\": \"SUCCESS\",\n \"address\": \"a435*****@gmail.com\",\n \"memo\": \"\",\n \"isInner\": true,\n \"amount\": \"1.00000000\",\n \"fee\": \"0.00000000\",\n \"walletTxId\": null,\n \"createdAt\": 1728555875000,\n \"updatedAt\": 1728555875000,\n \"remark\": \"\",\n \"arrears\": false\n },\n {\n \"currency\": \"USDT\",\n \"chain\": \"trx\",\n \"status\": \"SUCCESS\",\n \"address\": \"TSv3L1fS7******X4nLP6rqNxYz\",\n \"memo\": \"\",\n \"isInner\": true,\n \"amount\": \"6.00000000\",\n \"fee\": \"0.00000000\",\n \"walletTxId\": null,\n \"createdAt\": 1721730920000,\n \"updatedAt\": 1721730920000,\n \"remark\": \"\",\n \"arrears\": false\n }\n ]\n }\n}", - "responseId": 10305, + "data": "{\"code\":\"200000\",\"data\":{\"subName\":\"testapi6\",\"apiKey\":\"670621e3a25958000159c82f\"}}", + "responseId": 10301, "ordering": 1 } ], @@ -4347,10 +3900,17 @@ }, "mediaType": "" }, - "description": ":::info[Description]\nRequest via this endpoint to get deposit list Items are paginated and sorted to show the latest first. See the Pagination section for retrieving additional entries after the first page.\n:::\n\n", - "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"General\",\"api-rate-limit-pool\":\"Management\",\"sdk-service\":\"Account\",\"sdk-sub-service\":\"Deposit\",\"sdk-method-name\":\"getDepositHistory\",\"sdk-method-description\":\"Request via this endpoint to get deposit list Items are paginated and sorted to show the latest first. See the Pagination section for retrieving additional entries after the first page.\",\"api-rate-limit\":5}" + "description": ":::info[Description]\nThis endpoint can be used to delete sub-account APIs.\n:::", + "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"General\",\"api-rate-limit-pool\":\"Management\",\"sdk-service\":\"Account\",\"sdk-sub-service\":\"SubAccount\",\"sdk-method-name\":\"deleteSubAccountApi\",\"sdk-method-description\":\"This endpoint can be used to delete sub-account APIs.\",\"api-rate-limit\":30}" } - }, + } + ] + }, + { + "name": "Deposit", + "id": 348142, + "description": "", + "items": [ { "name": "Add Deposit Address(V3)", "api": { @@ -4520,22 +4080,14 @@ "description": ":::info[Description]\nRequest via this endpoint to create a deposit address for a currency you intend to deposit.\n:::", "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"General\",\"api-rate-limit-pool\":\"Management\",\"sdk-service\":\"Account\",\"sdk-sub-service\":\"Deposit\",\"sdk-method-name\":\"addDepositAddressV3\",\"sdk-method-description\":\"Request via this endpoint to create a deposit address for a currency you intend to deposit.\",\"api-rate-limit\":20}" } - } - ] - }, - { - "name": "Withdrawals", - "id": 348143, - "description": "", - "items": [ + }, { - "name": "Get Withdrawal Quotas", + "name": "Get Deposit Address(V3)", "api": { - "id": "3470143", + "id": "3470140", "method": "get", - "path": "/api/v1/withdrawals/quotas", + "path": "/api/v3/deposit-addresses", "parameters": { - "path": [], "query": [ { "id": "iIrspuNh6x", @@ -4551,37 +4103,33 @@ "ETH", "USDT" ] - } + }, + "enable": true }, { - "id": "Dn0j2ITQMe", + "id": "xpmD1ldX5o", + "name": "amount", + "required": false, + "description": "Deposit amount. This parameter is only used when applying for invoices on the Lightning Network. This parameter is invalid if it is not passed through the Lightning Network.", + "type": "string", + "enable": true + }, + { + "id": "eO27DXUL3U", "name": "chain", "required": false, - "description": "The chainId of currency, e.g. The available value for USDT are OMNI, ERC20, TRC20, default is ERC20. The available value for BTC are Native, Segwit, TRC20, the parameters are bech32, btc, trx, default is Native. This only apply for multi-chain currency, and there is no need for single chain currency.", + "description": "The chain Id of currency.", "type": "string", - "schema": { - "type": "string", - "default": "eth", - "examples": [ - "eth", - "bech32", - "btc", - "kcc", - "trx", - "bsc", - "arbitrum", - "ton", - "optimism" - ] - } + "enable": true } ], + "path": [], "cookie": [], "header": [] }, "responses": [ { - "id": "10307", + "id": "10304", "code": 200, "name": "OK", "headers": [], @@ -4592,99 +4140,70 @@ "type": "string" }, "data": { - "type": "object", - "properties": { - "currency": { - "type": "string" - }, - "limitBTCAmount": { - "type": "string" - }, - "usedBTCAmount": { - "type": "string" - }, - "quotaCurrency": { - "type": "string", - "description": "withdrawal limit currency" - }, - "limitQuotaCurrencyAmount": { - "type": "string", - "description": "The intraday available withdrawal amount(withdrawal limit currency)" - }, - "usedQuotaCurrencyAmount": { - "type": "string", - "description": "The intraday cumulative withdrawal amount(withdrawal limit currency)" - }, - "remainAmount": { - "type": "string", - "description": "Remaining amount available to withdraw the current day\n" - }, - "availableAmount": { - "type": "string", - "description": "Current available withdrawal amount" - }, - "withdrawMinFee": { - "type": "string", - "description": "Minimum withdrawal fee" - }, - "innerWithdrawMinFee": { - "type": "string", - "description": "Fees for internal withdrawal" - }, - "withdrawMinSize": { - "type": "string", - "description": "Minimum withdrawal amount" - }, - "isWithdrawEnabled": { - "type": "boolean", - "description": "Is the withdraw function enabled or not" - }, - "precision": { - "type": "integer", - "description": "Floating point precision." - }, - "chain": { - "type": "string", - "description": "The chainName of currency", - "examples": [ - "ERC20", - "BTC-Segwit", - "BTC", - "KCC", - "TRC20", - "BEP20", - "ARBITRUM", - "TON", - "OPTIMISM" - ] - }, - "reason": { - "type": "string", - "description": "Reasons for restriction, Usually empty" + "type": "array", + "items": { + "type": "object", + "properties": { + "address": { + "type": "string", + "description": "Deposit address" + }, + "memo": { + "type": "string", + "description": "Address remark. If there’s no remark, it is empty. When you withdraw from other platforms to the KuCoin, you need to fill in memo(tag). If you do not fill memo (tag), your deposit may not be available, please be cautious." + }, + "chainId": { + "type": "string", + "description": "The chainId of currency", + "examples": [ + "eth", + "bech32", + "btc", + "kcc", + "trx", + "bsc", + "arbitrum", + "ton", + "optimism" + ] + }, + "to": { + "type": "string", + "description": "Deposit account type: main (funding account), trade (spot trading account)" + }, + "expirationDate": { + "type": "integer", + "description": "Expiration time, Lightning network expiration time, non-Lightning network this field is invalid" + }, + "currency": { + "type": "string", + "description": "currency", + "examples": [ + "BTC", + "ETH", + "USDT" + ] + }, + "contractAddress": { + "type": "string", + "description": "The token contract address." + }, + "chainName": { + "type": "string", + "description": "The chainName of currency" + } }, - "lockedAmount": { - "type": "string", - "description": "Total locked amount (including the amount locked into USDT for each currency)" - } - }, - "required": [ - "currency", - "limitBTCAmount", - "usedBTCAmount", - "quotaCurrency", - "limitQuotaCurrencyAmount", - "usedQuotaCurrencyAmount", - "remainAmount", - "availableAmount", - "withdrawMinFee", - "innerWithdrawMinFee", - "withdrawMinSize", - "isWithdrawEnabled", - "precision", - "chain", - "reason", - "lockedAmount" - ] + "required": [ + "address", + "memo", + "chainId", + "to", + "expirationDate", + "currency", + "contractAddress", + "chainName" + ] + } } }, "required": [ @@ -4700,8 +4219,8 @@ "responseExamples": [ { "name": "Success", - "data": "{\"code\":\"200000\",\"data\":{\"currency\":\"BTC\",\"limitBTCAmount\":\"15.79590095\",\"usedBTCAmount\":\"0.00000000\",\"quotaCurrency\":\"USDT\",\"limitQuotaCurrencyAmount\":\"999999.00000000\",\"usedQuotaCurrencyAmount\":\"0\",\"remainAmount\":\"15.79590095\",\"availableAmount\":\"0\",\"withdrawMinFee\":\"0.0005\",\"innerWithdrawMinFee\":\"0\",\"withdrawMinSize\":\"0.001\",\"isWithdrawEnabled\":true,\"precision\":8,\"chain\":\"BTC\",\"reason\":null,\"lockedAmount\":\"0\"}}", - "responseId": 10307, + "data": "{\"code\":\"200000\",\"data\":[{\"address\":\"TSv3L1fS7yA3SxzKD8c1qdX4nLP6rqNxYz\",\"memo\":\"\",\"chainId\":\"trx\",\"to\":\"TRADE\",\"expirationDate\":0,\"currency\":\"USDT\",\"contractAddress\":\"TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t\",\"chainName\":\"TRC20\"},{\"address\":\"0x551e823a3b36865e8c5dc6e6ac6cc0b00d98533e\",\"memo\":\"\",\"chainId\":\"kcc\",\"to\":\"TRADE\",\"expirationDate\":0,\"currency\":\"USDT\",\"contractAddress\":\"0x0039f574ee5cc39bdd162e9a88e3eb1f111baf48\",\"chainName\":\"KCC\"},{\"address\":\"EQCA1BI4QRZ8qYmskSRDzJmkucGodYRTZCf_b9hckjla6dZl\",\"memo\":\"2085202643\",\"chainId\":\"ton\",\"to\":\"TRADE\",\"expirationDate\":0,\"currency\":\"USDT\",\"contractAddress\":\"EQCxE6mUtQJKFnGfaROTKOt1lZbDiiX1kCixRv7Nw2Id_sDs\",\"chainName\":\"TON\"},{\"address\":\"0x0a2586d5a901c8e7e68f6b0dc83bfd8bd8600ff5\",\"memo\":\"\",\"chainId\":\"eth\",\"to\":\"MAIN\",\"expirationDate\":0,\"currency\":\"USDT\",\"contractAddress\":\"0xdac17f958d2ee523a2206206994597c13d831ec7\",\"chainName\":\"ERC20\"}]}", + "responseId": 10304, "ordering": 1 } ], @@ -4714,115 +4233,46 @@ }, "mediaType": "" }, - "description": ":::info[Description]\nThis interface can obtain the withdrawal quotas information of this currency.\n:::", - "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"General\",\"api-rate-limit-pool\":\"Management\",\"sdk-service\":\"Account\",\"sdk-sub-service\":\"Withdrawal\",\"sdk-method-name\":\"getWithdrawalQuotas\",\"sdk-method-description\":\"This interface can obtain the withdrawal quotas information of this currency.\",\"api-rate-limit\":20}" + "description": ":::info[Description]\nGet all deposit addresses for the currency you intend to deposit. If the returned data is empty, you may need to Add Deposit Address first.\n:::", + "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"General\",\"api-rate-limit-pool\":\"Management\",\"sdk-service\":\"Account\",\"sdk-sub-service\":\"Deposit\",\"sdk-method-name\":\"getDepositAddressV3\",\"sdk-method-description\":\"Get all deposit addresses for the currency you intend to deposit. If the returned data is empty, you may need to Add Deposit Address first.\",\"api-rate-limit\":5}" } }, { - "name": "Cancel Withdrawal", + "name": "Get Deposit History", "api": { - "id": "3470144", - "method": "delete", - "path": "/api/v1/withdrawals/{withdrawalId}", + "id": "3470141", + "method": "get", + "path": "/api/v1/deposits", "parameters": { - "path": [ + "query": [ { - "id": "withdrawalId#0", - "name": "withdrawalId", + "id": "iIrspuNh6x", + "name": "currency", "required": true, - "description": "Path parameter, a unique ID for a withdrawalId", - "example": "670b891f7e0f440007730692", - "type": "string" - } - ], - "query": [], - "cookie": [], - "header": [] - }, - "responses": [ - { - "id": "10308", - "code": 200, - "name": "OK", - "headers": [], - "jsonSchema": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "data": { - "type": "string" - } + "description": "currency", + "example": "", + "type": "string", + "schema": { + "type": "string", + "examples": [ + "BTC", + "ETH", + "USDT" + ] }, - "required": [ - "code", - "data" - ] - }, - "description": "", - "contentType": "json", - "mediaType": "" - } - ], - "responseExamples": [ - { - "name": "Success", - "data": "{\"code\":\"200000\",\"data\":null}", - "responseId": 10308, - "ordering": 1 - } - ], - "requestBody": { - "type": "none", - "parameters": [], - "jsonSchema": { - "type": "object", - "properties": {} - }, - "mediaType": "" - }, - "description": ":::info[Description]\nThis interface can cancel the withdrawal, Only withdrawals requests of PROCESSING status could be canceled.\n:::", - "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"Withdrawal\",\"api-rate-limit-pool\":\"Management\",\"sdk-service\":\"Account\",\"sdk-sub-service\":\"Withdrawal\",\"sdk-method-name\":\"cancelWithdrawal\",\"sdk-method-description\":\"This interface can cancel the withdrawal, Only withdrawals requests of PROCESSING status could be canceled.\",\"api-rate-limit\":20}" - } - }, - { - "name": "Get Withdrawal History", - "api": { - "id": "3470145", - "method": "get", - "path": "/api/v1/withdrawals", - "parameters": { - "query": [ - { - "id": "iIrspuNh6x", - "name": "currency", - "required": true, - "description": "currency", - "example": "", - "type": "string", - "schema": { - "type": "string", - "examples": [ - "BTC", - "ETH", - "USDT" - ] - }, - "enable": true + "enable": true }, { "id": "0cGmW3GSC0", "name": "status", "required": false, - "description": "Status. Available value: PROCESSING, WALLET_PROCESSING, SUCCESS, and FAILURE", + "description": "Status. Available value: PROCESSING, SUCCESS, and FAILURE", "example": "SUCCESS", "type": "string", "schema": { "type": "string", "enum": [ "PROCESSING", - "WALLET_PROCESSING", "SUCCESS", "FAILURE" ], @@ -4832,11 +4282,6 @@ "name": "", "description": "" }, - { - "value": "WALLET_PROCESSING", - "name": "", - "description": "" - }, { "value": "SUCCESS", "name": "", @@ -4878,20 +4323,19 @@ "enable": true }, { - "id": "tYmztUdnR2", + "id": "veUIPKz0h5", "name": "currentPage", "required": false, "description": "Current request page.", "example": "1", "type": "integer", "schema": { - "type": "integer", - "default": 1 + "type": "integer" }, "enable": true }, { - "id": "StNqU7nXlg", + "id": "ghmIBiuNgn", "name": "pageSize", "required": false, "description": "Number of results per request. Minimum is 10, maximum is 500.", @@ -4912,7 +4356,7 @@ }, "responses": [ { - "id": "10309", + "id": "10305", "code": 200, "name": "OK", "headers": [], @@ -4946,35 +4390,30 @@ "items": { "type": "object", "properties": { - "id": { - "type": "string", - "description": "Unique id" - }, "currency": { "type": "string", "description": "Currency" }, "chain": { "type": "string", + "description": "The chainName of currency", "examples": [ - "eth", - "bech32", - "btc", - "kcc", - "trx", - "bsc", - "arbitrum", - "ton", - "optimism" - ], - "description": "The id of currency" + "ERC20", + "BTC-Segwit", + "BTC", + "KCC", + "TRC20", + "BEP20", + "ARBITRUM", + "TON", + "OPTIMISM" + ] }, "status": { "type": "string", "description": "Status", "enum": [ "PROCESSING", - "WALLET_PROCESSING", "SUCCESS", "FAILURE" ], @@ -4984,11 +4423,6 @@ "name": "", "description": "" }, - { - "value": "WALLET_PROCESSING", - "name": "", - "description": "" - }, { "value": "SUCCESS", "name": "", @@ -5038,6 +4472,10 @@ "remark": { "type": "string", "description": "remark" + }, + "arrears": { + "type": "boolean", + "description": "Whether there is any debt.A quick rollback will cause the deposit to fail. If the deposit fails, you will need to repay the balance." } } } @@ -5066,7 +4504,7 @@ { "name": "Success", "data": "{\n \"code\": \"200000\",\n \"data\": {\n \"currentPage\": 1,\n \"pageSize\": 50,\n \"totalNum\": 5,\n \"totalPage\": 1,\n \"items\": [\n {\n \"currency\": \"USDT\",\n \"chain\": \"\",\n \"status\": \"SUCCESS\",\n \"address\": \"a435*****@gmail.com\",\n \"memo\": \"\",\n \"isInner\": true,\n \"amount\": \"1.00000000\",\n \"fee\": \"0.00000000\",\n \"walletTxId\": null,\n \"createdAt\": 1728555875000,\n \"updatedAt\": 1728555875000,\n \"remark\": \"\",\n \"arrears\": false\n },\n {\n \"currency\": \"USDT\",\n \"chain\": \"trx\",\n \"status\": \"SUCCESS\",\n \"address\": \"TSv3L1fS7******X4nLP6rqNxYz\",\n \"memo\": \"\",\n \"isInner\": true,\n \"amount\": \"6.00000000\",\n \"fee\": \"0.00000000\",\n \"walletTxId\": null,\n \"createdAt\": 1721730920000,\n \"updatedAt\": 1721730920000,\n \"remark\": \"\",\n \"arrears\": false\n }\n ]\n }\n}", - "responseId": 10309, + "responseId": 10305, "ordering": 1 } ], @@ -5079,8 +4517,205 @@ }, "mediaType": "" }, - "description": ":::info[Description]\nRequest via this endpoint to get withdrawal list Items are paginated and sorted to show the latest first. See the Pagination section for retrieving additional entries after the first page.\n:::", - "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"General\",\"api-rate-limit-pool\":\"Management\",\"sdk-service\":\"Account\",\"sdk-sub-service\":\"Withdrawal\",\"sdk-method-name\":\"getWithdrawalHistory\",\"sdk-method-description\":\"Request via this endpoint to get deposit list Items are paginated and sorted to show the latest first. See the Pagination section for retrieving additional entries after the first page.\",\"api-rate-limit\":20}" + "description": ":::info[Description]\nRequest via this endpoint to get deposit list Items are paginated and sorted to show the latest first. See the Pagination section for retrieving additional entries after the first page.\n:::\n\n", + "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"General\",\"api-rate-limit-pool\":\"Management\",\"sdk-service\":\"Account\",\"sdk-sub-service\":\"Deposit\",\"sdk-method-name\":\"getDepositHistory\",\"sdk-method-description\":\"Request via this endpoint to get deposit list Items are paginated and sorted to show the latest first. See the Pagination section for retrieving additional entries after the first page.\",\"api-rate-limit\":5}" + } + } + ] + }, + { + "name": "Withdrawals", + "id": 348143, + "description": "", + "items": [ + { + "name": "Get Withdrawal Quotas", + "api": { + "id": "3470143", + "method": "get", + "path": "/api/v1/withdrawals/quotas", + "parameters": { + "path": [], + "query": [ + { + "id": "iIrspuNh6x", + "name": "currency", + "required": true, + "description": "currency", + "example": "", + "type": "string", + "schema": { + "type": "string", + "examples": [ + "BTC", + "ETH", + "USDT" + ] + } + }, + { + "id": "Dn0j2ITQMe", + "name": "chain", + "required": false, + "description": "The chainId of currency, e.g. The available value for USDT are OMNI, ERC20, TRC20, default is ERC20. The available value for BTC are Native, Segwit, TRC20, the parameters are bech32, btc, trx, default is Native. This only apply for multi-chain currency, and there is no need for single chain currency.", + "type": "string", + "schema": { + "type": "string", + "default": "eth", + "examples": [ + "eth", + "bech32", + "btc", + "kcc", + "trx", + "bsc", + "arbitrum", + "ton", + "optimism" + ] + } + } + ], + "cookie": [], + "header": [] + }, + "responses": [ + { + "id": "10307", + "code": 200, + "name": "OK", + "headers": [], + "jsonSchema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "object", + "properties": { + "currency": { + "type": "string" + }, + "limitBTCAmount": { + "type": "string" + }, + "usedBTCAmount": { + "type": "string" + }, + "quotaCurrency": { + "type": "string", + "description": "withdrawal limit currency" + }, + "limitQuotaCurrencyAmount": { + "type": "string", + "description": "The intraday available withdrawal amount(withdrawal limit currency)" + }, + "usedQuotaCurrencyAmount": { + "type": "string", + "description": "The intraday cumulative withdrawal amount(withdrawal limit currency)" + }, + "remainAmount": { + "type": "string", + "description": "Remaining amount available to withdraw the current day\n" + }, + "availableAmount": { + "type": "string", + "description": "Current available withdrawal amount" + }, + "withdrawMinFee": { + "type": "string", + "description": "Minimum withdrawal fee" + }, + "innerWithdrawMinFee": { + "type": "string", + "description": "Fees for internal withdrawal" + }, + "withdrawMinSize": { + "type": "string", + "description": "Minimum withdrawal amount" + }, + "isWithdrawEnabled": { + "type": "boolean", + "description": "Is the withdraw function enabled or not" + }, + "precision": { + "type": "integer", + "description": "Floating point precision." + }, + "chain": { + "type": "string", + "description": "The chainName of currency", + "examples": [ + "ERC20", + "BTC-Segwit", + "BTC", + "KCC", + "TRC20", + "BEP20", + "ARBITRUM", + "TON", + "OPTIMISM" + ] + }, + "reason": { + "type": "string", + "description": "Reasons for restriction, Usually empty" + }, + "lockedAmount": { + "type": "string", + "description": "Total locked amount (including the amount locked into USDT for each currency)" + } + }, + "required": [ + "currency", + "limitBTCAmount", + "usedBTCAmount", + "quotaCurrency", + "limitQuotaCurrencyAmount", + "usedQuotaCurrencyAmount", + "remainAmount", + "availableAmount", + "withdrawMinFee", + "innerWithdrawMinFee", + "withdrawMinSize", + "isWithdrawEnabled", + "precision", + "chain", + "reason", + "lockedAmount" + ] + } + }, + "required": [ + "code", + "data" + ] + }, + "description": "", + "contentType": "json", + "mediaType": "" + } + ], + "responseExamples": [ + { + "name": "Success", + "data": "{\"code\":\"200000\",\"data\":{\"currency\":\"BTC\",\"limitBTCAmount\":\"15.79590095\",\"usedBTCAmount\":\"0.00000000\",\"quotaCurrency\":\"USDT\",\"limitQuotaCurrencyAmount\":\"999999.00000000\",\"usedQuotaCurrencyAmount\":\"0\",\"remainAmount\":\"15.79590095\",\"availableAmount\":\"0\",\"withdrawMinFee\":\"0.0005\",\"innerWithdrawMinFee\":\"0\",\"withdrawMinSize\":\"0.001\",\"isWithdrawEnabled\":true,\"precision\":8,\"chain\":\"BTC\",\"reason\":null,\"lockedAmount\":\"0\"}}", + "responseId": 10307, + "ordering": 1 + } + ], + "requestBody": { + "type": "none", + "parameters": [], + "jsonSchema": { + "type": "object", + "properties": {} + }, + "mediaType": "" + }, + "description": ":::info[Description]\nThis interface can obtain the withdrawal quotas information of this currency.\n:::", + "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"General\",\"api-rate-limit-pool\":\"Management\",\"sdk-service\":\"Account\",\"sdk-sub-service\":\"Withdrawal\",\"sdk-method-name\":\"getWithdrawalQuotas\",\"sdk-method-description\":\"This interface can obtain the withdrawal quotas information of this currency.\",\"api-rate-limit\":20}" } }, { @@ -5248,29 +4883,31 @@ "description": ":::info[Description]\nUse this interface to withdraw the specified currency\n:::\n\n:::tip[Tips]\nOn the WEB end, you can open the switch of specified favorite addresses for withdrawal, and when it is turned on, it will verify whether your withdrawal address(including chain) is a favorite address(it is case sensitive); if it fails validation, it will respond with the error message {\"msg\":\"Already set withdraw whitelist, this address is not favorite address\",\"code\":\"260325\"}.\n:::\n\n", "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"Withdrawal\",\"api-rate-limit-pool\":\"Management\",\"sdk-service\":\"Account\",\"sdk-sub-service\":\"Withdrawal\",\"sdk-method-name\":\"withdrawalV3\",\"sdk-method-description\":\"Use this interface to withdraw the specified currency\",\"api-rate-limit\":5}" } - } - ] - }, - { - "name": "Transfer", - "id": 348144, - "description": "", - "items": [ + }, { - "name": "Flex Transfer", + "name": "Cancel Withdrawal", "api": { - "id": "3470147", - "method": "post", - "path": "/api/v3/accounts/universal-transfer", + "id": "3470144", + "method": "delete", + "path": "/api/v1/withdrawals/{withdrawalId}", "parameters": { + "path": [ + { + "id": "withdrawalId#0", + "name": "withdrawalId", + "required": true, + "description": "Path parameter, a unique ID for a withdrawalId", + "example": "670b891f7e0f440007730692", + "type": "string" + } + ], "query": [], - "path": [], "cookie": [], "header": [] }, "responses": [ { - "id": "10311", + "id": "10308", "code": 200, "name": "OK", "headers": [], @@ -5281,16 +4918,7 @@ "type": "string" }, "data": { - "type": "object", - "properties": { - "orderId": { - "type": "string", - "description": "Transfer order ID" - } - }, - "required": [ - "orderId" - ] + "type": "string" } }, "required": [ @@ -5306,201 +4934,328 @@ "responseExamples": [ { "name": "Success", - "data": "{\n \"code\": \"200000\",\n \"data\": {\n \"orderId\": \"6705f7248c6954000733ecac\"\n }\n}", - "responseId": 10311, + "data": "{\"code\":\"200000\",\"data\":null}", + "responseId": 10308, "ordering": 1 } ], "requestBody": { - "type": "application/json", + "type": "none", "parameters": [], "jsonSchema": { - "title": "", "type": "object", - "properties": { - "clientOid": { - "type": "string", - "description": "Unique order id created by users to identify their orders, e.g. UUID, with a maximum length of 128 bits" - }, - "currency": { - "type": "string", - "description": "currency" - }, - "amount": { - "type": "string", - "description": "Transfer amount, the amount is a positive integer multiple of the currency precision." - }, - "fromUserId": { + "properties": {} + }, + "mediaType": "" + }, + "description": ":::info[Description]\nThis interface can cancel the withdrawal, Only withdrawals requests of PROCESSING status could be canceled.\n:::", + "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"Withdrawal\",\"api-rate-limit-pool\":\"Management\",\"sdk-service\":\"Account\",\"sdk-sub-service\":\"Withdrawal\",\"sdk-method-name\":\"cancelWithdrawal\",\"sdk-method-description\":\"This interface can cancel the withdrawal, Only withdrawals requests of PROCESSING status could be canceled.\",\"api-rate-limit\":20}" + } + }, + { + "name": "Get Withdrawal History", + "api": { + "id": "3470145", + "method": "get", + "path": "/api/v1/withdrawals", + "parameters": { + "query": [ + { + "id": "iIrspuNh6x", + "name": "currency", + "required": true, + "description": "currency", + "example": "", + "type": "string", + "schema": { "type": "string", - "description": "Transfer out UserId, This is required when transferring sub-account to master-account. It is optional for internal transfers." + "examples": [ + "BTC", + "ETH", + "USDT" + ] }, - "fromAccountType": { + "enable": true + }, + { + "id": "0cGmW3GSC0", + "name": "status", + "required": false, + "description": "Status. Available value: PROCESSING, WALLET_PROCESSING, SUCCESS, and FAILURE", + "example": "SUCCESS", + "type": "string", + "schema": { "type": "string", - "description": "Account type:MAIN、TRADE、CONTRACT、MARGIN、ISOLATED、MARGIN_V2、ISOLATED_V2", "enum": [ - "MAIN", - "TRADE", - "CONTRACT", - "MARGIN", - "ISOLATED", - "MARGIN_V2", - "ISOLATED_V2", - "OPTION" + "PROCESSING", + "WALLET_PROCESSING", + "SUCCESS", + "FAILURE" ], "x-api-enum": [ { - "value": "MAIN", - "name": "MAIN", - "description": "Funding account" - }, - { - "value": "TRADE", - "name": "TRADE", - "description": "Spot account" - }, - { - "value": "CONTRACT", - "name": "CONTRACT", - "description": "Futures account" - }, - { - "value": "MARGIN", - "name": "MARGIN", - "description": "Cross margin account" - }, - { - "value": "ISOLATED", - "name": "ISOLATED", - "description": "Isolated margin account" - }, - { - "value": "MARGIN_V2", - "name": "MARGIN_V2", - "description": "Cross margin account" - }, - { - "value": "ISOLATED_V2", - "name": "ISOLATED_V2", - "description": "Isolated margin account" + "value": "PROCESSING", + "name": "", + "description": "" }, { - "value": "OPTION", - "name": "OPTION", - "description": "Option account" - } - ] - }, - "fromAccountTag": { - "type": "string", - "description": "Symbol, required when the account type is ISOLATED or ISOLATED_V2, for example: BTC-USDT" - }, - "type": { - "type": "string", - "description": "Transfer type:INTERNAL(Transfer within account)、PARENT_TO_SUB(Transfer from master-account to sub-account),SUB_TO_PARENT(Transfer from sub-account to master-account)", - "enum": [ - "INTERNAL", - "PARENT_TO_SUB", - "SUB_TO_PARENT" - ], - "x-api-enum": [ - { - "value": "INTERNAL", + "value": "WALLET_PROCESSING", "name": "", "description": "" }, { - "value": "PARENT_TO_SUB", + "value": "SUCCESS", "name": "", "description": "" }, { - "value": "SUB_TO_PARENT", + "value": "FAILURE", "name": "", "description": "" } ] }, - "toUserId": { - "type": "string", - "description": "Transfer in UserId, This is required when transferring master-account to sub-account. It is optional for internal transfers." + "enable": true + }, + { + "id": "5Lwpfvg7zz", + "name": "startAt", + "required": false, + "description": "Start time (milisecond)", + "example": "1728663338000", + "type": "integer", + "schema": { + "type": "integer", + "format": "int64" }, - "toAccountType": { - "type": "string", - "description": "Account type:MAIN、TRADE、CONTRACT、MARGIN、ISOLATED、MARGIN_V2、ISOLATED_V2", - "enum": [ - "MAIN", - "TRADE", - "CONTRACT", - "MARGIN", - "ISOLATED", - "MARGIN_V2", - "ISOLATED_V2", - "OPTION" - ], - "x-api-enum": [ - { - "value": "MAIN", - "name": "MAIN", - "description": "Funding account" - }, - { - "value": "TRADE", - "name": "TRADE", - "description": "Spot account" - }, - { - "value": "CONTRACT", - "name": "CONTRACT", - "description": "Futures account" - }, - { - "value": "MARGIN", - "name": "MARGIN", - "description": "Cross margin account" - }, - { - "value": "ISOLATED", - "name": "ISOLATED", - "description": "Isolated margin account" - }, - { - "value": "MARGIN_V2", - "name": "MARGIN_V2", - "description": "Cross margin account" - }, - { - "value": "ISOLATED_V2", - "name": "ISOLATED_V2", - "description": "Isolated margin account" + "enable": true + }, + { + "id": "WvwRPqp0J5", + "name": "endAt", + "required": false, + "description": "End time (milisecond)", + "example": "1728692138000", + "type": "integer", + "schema": { + "type": "integer", + "format": "int64" + }, + "enable": true + }, + { + "id": "tYmztUdnR2", + "name": "currentPage", + "required": false, + "description": "Current request page.", + "example": "1", + "type": "integer", + "schema": { + "type": "integer", + "default": 1 + }, + "enable": true + }, + { + "id": "StNqU7nXlg", + "name": "pageSize", + "required": false, + "description": "Number of results per request. Minimum is 10, maximum is 500.", + "example": "50", + "type": "integer", + "schema": { + "type": "integer", + "minimum": 10, + "maximum": 500, + "default": 50 + }, + "enable": true + } + ], + "path": [], + "cookie": [], + "header": [] + }, + "responses": [ + { + "id": "10309", + "code": 200, + "name": "OK", + "headers": [], + "jsonSchema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "object", + "properties": { + "currentPage": { + "type": "integer", + "description": "current page" + }, + "pageSize": { + "type": "integer", + "description": "page size" + }, + "totalNum": { + "type": "integer", + "description": "total number" + }, + "totalPage": { + "type": "integer", + "description": "total page" + }, + "items": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Unique id" + }, + "currency": { + "type": "string", + "description": "Currency" + }, + "chain": { + "type": "string", + "examples": [ + "eth", + "bech32", + "btc", + "kcc", + "trx", + "bsc", + "arbitrum", + "ton", + "optimism" + ], + "description": "The id of currency" + }, + "status": { + "type": "string", + "description": "Status", + "enum": [ + "PROCESSING", + "WALLET_PROCESSING", + "SUCCESS", + "FAILURE" + ], + "x-api-enum": [ + { + "value": "PROCESSING", + "name": "", + "description": "" + }, + { + "value": "WALLET_PROCESSING", + "name": "", + "description": "" + }, + { + "value": "SUCCESS", + "name": "", + "description": "" + }, + { + "value": "FAILURE", + "name": "", + "description": "" + } + ] + }, + "address": { + "type": "string", + "description": "Deposit address" + }, + "memo": { + "type": "string", + "description": "Address remark. If there’s no remark, it is empty. " + }, + "isInner": { + "type": "boolean", + "description": "Internal deposit or not" + }, + "amount": { + "type": "string", + "description": "Deposit amount" + }, + "fee": { + "type": "string", + "description": "Fees charged for deposit" + }, + "walletTxId": { + "type": "string", + "description": "Wallet Txid" + }, + "createdAt": { + "type": "integer", + "description": "Creation time of the database record", + "format": "int64" + }, + "updatedAt": { + "type": "integer", + "description": "Update time of the database record", + "format": "int64" + }, + "remark": { + "type": "string", + "description": "remark" + } + } + } + } }, - { - "value": "OPTION", - "name": "OPTION", - "description": "Option account" - } - ] + "required": [ + "currentPage", + "pageSize", + "totalNum", + "totalPage", + "items" + ] + } }, - "toAccountTag": { - "type": "string", - "description": "Symbol, required when the account type is ISOLATED or ISOLATED_V2, for example: BTC-USDT" - } + "required": [ + "code", + "data" + ] }, - "required": [ - "clientOid", - "amount", - "fromAccountType", - "type", - "toAccountType", - "currency" - ] + "description": "", + "contentType": "json", + "mediaType": "" + } + ], + "responseExamples": [ + { + "name": "Success", + "data": "{\n \"code\": \"200000\",\n \"data\": {\n \"currentPage\": 1,\n \"pageSize\": 50,\n \"totalNum\": 5,\n \"totalPage\": 1,\n \"items\": [\n {\n \"currency\": \"USDT\",\n \"chain\": \"\",\n \"status\": \"SUCCESS\",\n \"address\": \"a435*****@gmail.com\",\n \"memo\": \"\",\n \"isInner\": true,\n \"amount\": \"1.00000000\",\n \"fee\": \"0.00000000\",\n \"walletTxId\": null,\n \"createdAt\": 1728555875000,\n \"updatedAt\": 1728555875000,\n \"remark\": \"\",\n \"arrears\": false\n },\n {\n \"currency\": \"USDT\",\n \"chain\": \"trx\",\n \"status\": \"SUCCESS\",\n \"address\": \"TSv3L1fS7******X4nLP6rqNxYz\",\n \"memo\": \"\",\n \"isInner\": true,\n \"amount\": \"6.00000000\",\n \"fee\": \"0.00000000\",\n \"walletTxId\": null,\n \"createdAt\": 1721730920000,\n \"updatedAt\": 1721730920000,\n \"remark\": \"\",\n \"arrears\": false\n }\n ]\n }\n}", + "responseId": 10309, + "ordering": 1 + } + ], + "requestBody": { + "type": "none", + "parameters": [], + "jsonSchema": { + "type": "object", + "properties": {} }, - "example": "//transfer from master-account to sub-account\n{\n \"clientOid\": \"64ccc0f164781800010d8c09\",\n \"type\": \"PARENT_TO_SUB\",\n \"currency\": \"USDT\",\n \"amount\": \"0.01\",\n \"fromAccountType\": \"TRADE\",\n \"toUserId\": \"63743f07e0c5230001761d08\",\n \"toAccountType\": \"TRADE\"\n}\n\n//transfer from sub-account to master-account\n// {\n// \"clientOid\": \"64ccc0f164781800010d8c09\",\n// \"type\": \"SUB_TO_PARENT\",\n// \"currency\": \"BTC\",\n// \"amount\": 1,\n// \"fromUserId\": \"62f5f5d4d72aaf000122707e\",\n// \"fromAccountType\": \"TRADE\",\n// \"toAccountType\": \"CONTRACT\"\n// }\n\n// internal transfer\n// {\n// \"clientOid\": \"53666633336123\",\n// \"type\": \"INTERNAL\",\n// \"currency\": \"BTC\",\n// \"amount\": 0.0003,\n// \"fromAccountType\": \"TRADE\",\n// \"toAccountType\": \"MAIN\"\n// }\n\n\n\n\n\n", "mediaType": "" }, - "description": ":::info[Description]\nThis interface can be used for transfers between master and sub accounts and inner transfers\n:::\n\n\n\nThe API Key needs to have universal transfer permission when calling.\n\nSupport internal transfer,do not support transfers between sub-accounts.\n\nSupport transfer between master and sub accounts (only applicable to master account APIKey).\n\nMARGIN_V2 only supports internal transfers between MARGIN and does not support transfers between master and sub accounts.\n\nISOLATED_V2 only supports internal transfers between ISOLATED and does not support transfers between master and sub accounts.", - "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"FlexTransfers\",\"api-rate-limit-pool\":\"Management\",\"sdk-service\":\"Account\",\"sdk-sub-service\":\"Transfer\",\"sdk-method-name\":\"flexTransfer\",\"sdk-method-description\":\"This interface can be used for transfers between master and sub accounts and inner transfers\",\"api-rate-limit\":4}" + "description": ":::info[Description]\nRequest via this endpoint to get withdrawal list Items are paginated and sorted to show the latest first. See the Pagination section for retrieving additional entries after the first page.\n:::", + "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"General\",\"api-rate-limit-pool\":\"Management\",\"sdk-service\":\"Account\",\"sdk-sub-service\":\"Withdrawal\",\"sdk-method-name\":\"getWithdrawalHistory\",\"sdk-method-description\":\"Request via this endpoint to get deposit list Items are paginated and sorted to show the latest first. See the Pagination section for retrieving additional entries after the first page.\",\"api-rate-limit\":20}" } - }, + } + ] + }, + { + "name": "Transfer", + "id": 348144, + "description": "", + "items": [ { "name": "Get Transfer Quotas", "api": { @@ -5668,6 +5423,251 @@ "description": ":::info[Description]\nThis endpoint returns the transferable balance of a specified account.\n:::", "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"General\",\"api-rate-limit-pool\":\"Management\",\"sdk-service\":\"Account\",\"sdk-sub-service\":\"Transfer\",\"sdk-method-name\":\"getTransferQuotas\",\"sdk-method-description\":\"This endpoint returns the transferable balance of a specified account.\",\"api-rate-limit\":20}" } + }, + { + "name": "Flex Transfer", + "api": { + "id": "3470147", + "method": "post", + "path": "/api/v3/accounts/universal-transfer", + "parameters": { + "query": [], + "path": [], + "cookie": [], + "header": [] + }, + "responses": [ + { + "id": "10311", + "code": 200, + "name": "OK", + "headers": [], + "jsonSchema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "object", + "properties": { + "orderId": { + "type": "string", + "description": "Transfer order ID" + } + }, + "required": [ + "orderId" + ] + } + }, + "required": [ + "code", + "data" + ] + }, + "description": "", + "contentType": "json", + "mediaType": "" + } + ], + "responseExamples": [ + { + "name": "Success", + "data": "{\n \"code\": \"200000\",\n \"data\": {\n \"orderId\": \"6705f7248c6954000733ecac\"\n }\n}", + "responseId": 10311, + "ordering": 1 + } + ], + "requestBody": { + "type": "application/json", + "parameters": [], + "jsonSchema": { + "title": "", + "type": "object", + "properties": { + "clientOid": { + "type": "string", + "description": "Unique order id created by users to identify their orders, e.g. UUID, with a maximum length of 128 bits" + }, + "currency": { + "type": "string", + "description": "currency" + }, + "amount": { + "type": "string", + "description": "Transfer amount, the amount is a positive integer multiple of the currency precision." + }, + "fromUserId": { + "type": "string", + "description": "Transfer out UserId, This is required when transferring sub-account to master-account. It is optional for internal transfers." + }, + "fromAccountType": { + "type": "string", + "description": "Account type:MAIN、TRADE、CONTRACT、MARGIN、ISOLATED、MARGIN_V2、ISOLATED_V2", + "enum": [ + "MAIN", + "TRADE", + "CONTRACT", + "MARGIN", + "ISOLATED", + "MARGIN_V2", + "ISOLATED_V2", + "OPTION" + ], + "x-api-enum": [ + { + "value": "MAIN", + "name": "MAIN", + "description": "Funding account" + }, + { + "value": "TRADE", + "name": "TRADE", + "description": "Spot account" + }, + { + "value": "CONTRACT", + "name": "CONTRACT", + "description": "Futures account" + }, + { + "value": "MARGIN", + "name": "MARGIN", + "description": "Cross margin account" + }, + { + "value": "ISOLATED", + "name": "ISOLATED", + "description": "Isolated margin account" + }, + { + "value": "MARGIN_V2", + "name": "MARGIN_V2", + "description": "Cross margin account" + }, + { + "value": "ISOLATED_V2", + "name": "ISOLATED_V2", + "description": "Isolated margin account" + }, + { + "value": "OPTION", + "name": "OPTION", + "description": "Option account" + } + ] + }, + "fromAccountTag": { + "type": "string", + "description": "Symbol, required when the account type is ISOLATED or ISOLATED_V2, for example: BTC-USDT" + }, + "type": { + "type": "string", + "description": "Transfer type:INTERNAL(Transfer within account)、PARENT_TO_SUB(Transfer from master-account to sub-account),SUB_TO_PARENT(Transfer from sub-account to master-account)", + "enum": [ + "INTERNAL", + "PARENT_TO_SUB", + "SUB_TO_PARENT" + ], + "x-api-enum": [ + { + "value": "INTERNAL", + "name": "", + "description": "" + }, + { + "value": "PARENT_TO_SUB", + "name": "", + "description": "" + }, + { + "value": "SUB_TO_PARENT", + "name": "", + "description": "" + } + ] + }, + "toUserId": { + "type": "string", + "description": "Transfer in UserId, This is required when transferring master-account to sub-account. It is optional for internal transfers." + }, + "toAccountType": { + "type": "string", + "description": "Account type:MAIN、TRADE、CONTRACT、MARGIN、ISOLATED、MARGIN_V2、ISOLATED_V2", + "enum": [ + "MAIN", + "TRADE", + "CONTRACT", + "MARGIN", + "ISOLATED", + "MARGIN_V2", + "ISOLATED_V2", + "OPTION" + ], + "x-api-enum": [ + { + "value": "MAIN", + "name": "MAIN", + "description": "Funding account" + }, + { + "value": "TRADE", + "name": "TRADE", + "description": "Spot account" + }, + { + "value": "CONTRACT", + "name": "CONTRACT", + "description": "Futures account" + }, + { + "value": "MARGIN", + "name": "MARGIN", + "description": "Cross margin account" + }, + { + "value": "ISOLATED", + "name": "ISOLATED", + "description": "Isolated margin account" + }, + { + "value": "MARGIN_V2", + "name": "MARGIN_V2", + "description": "Cross margin account" + }, + { + "value": "ISOLATED_V2", + "name": "ISOLATED_V2", + "description": "Isolated margin account" + }, + { + "value": "OPTION", + "name": "OPTION", + "description": "Option account" + } + ] + }, + "toAccountTag": { + "type": "string", + "description": "Symbol, required when the account type is ISOLATED or ISOLATED_V2, for example: BTC-USDT" + } + }, + "required": [ + "clientOid", + "amount", + "fromAccountType", + "type", + "toAccountType", + "currency" + ] + }, + "example": "//transfer from master-account to sub-account\n{\n \"clientOid\": \"64ccc0f164781800010d8c09\",\n \"type\": \"PARENT_TO_SUB\",\n \"currency\": \"USDT\",\n \"amount\": \"0.01\",\n \"fromAccountType\": \"TRADE\",\n \"toUserId\": \"63743f07e0c5230001761d08\",\n \"toAccountType\": \"TRADE\"\n}\n\n//transfer from sub-account to master-account\n// {\n// \"clientOid\": \"64ccc0f164781800010d8c09\",\n// \"type\": \"SUB_TO_PARENT\",\n// \"currency\": \"BTC\",\n// \"amount\": 1,\n// \"fromUserId\": \"62f5f5d4d72aaf000122707e\",\n// \"fromAccountType\": \"TRADE\",\n// \"toAccountType\": \"CONTRACT\"\n// }\n\n// internal transfer\n// {\n// \"clientOid\": \"53666633336123\",\n// \"type\": \"INTERNAL\",\n// \"currency\": \"BTC\",\n// \"amount\": 0.0003,\n// \"fromAccountType\": \"TRADE\",\n// \"toAccountType\": \"MAIN\"\n// }\n\n\n\n\n\n", + "mediaType": "" + }, + "description": ":::info[Description]\nThis interface can be used for transfers between master and sub accounts and inner transfers\n:::\n\n\n\nThe API Key needs to have universal transfer permission when calling.\n\nSupport internal transfer,do not support transfers between sub-accounts.\n\nSupport transfer between master and sub accounts (only applicable to master account APIKey).\n\nMARGIN_V2 only supports internal transfers between MARGIN and does not support transfers between master and sub accounts.\n\nISOLATED_V2 only supports internal transfers between ISOLATED and does not support transfers between master and sub accounts.", + "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"FlexTransfers\",\"api-rate-limit-pool\":\"Management\",\"sdk-service\":\"Account\",\"sdk-sub-service\":\"Transfer\",\"sdk-method-name\":\"flexTransfer\",\"sdk-method-description\":\"This interface can be used for transfers between master and sub accounts and inner transfers\",\"api-rate-limit\":4}" + } } ] }, @@ -5989,20 +5989,293 @@ "description": "", "items": [ { - "name": "Get All Currencies", + "name": "Get Announcements", "api": { - "id": "3470152", + "id": "3470157", "method": "get", - "path": "/api/v3/currencies", + "path": "/api/v3/announcements", "parameters": { + "query": [ + { + "id": "j3zlyFZAZT", + "name": "currentPage", + "required": false, + "description": "page number", + "type": "integer", + "schema": { + "type": "integer", + "format": "int64" + }, + "enable": true, + "example": "1" + }, + { + "id": "35MLManAOr", + "name": "pageSize", + "required": false, + "description": "page Size", + "type": "integer", + "schema": { + "type": "integer", + "format": "int64" + }, + "enable": true, + "example": "50" + }, + { + "id": "c9UEoOtAzp", + "name": "annType", + "required": false, + "description": "Announcement types: latest-announcements , activities (latest activities), new-listings (new currency online), product-updates (product updates), vip (institutions and VIPs), maintenance-updates (system maintenance), product -updates (product news), delistings (currency offline), others, api-campaigns (API user activities), default : latest-announcements", + "example": "latest-announcements", + "type": "string", + "schema": { + "type": "string", + "enum": [ + "latest-announcements ", + "activities ", + "product-updates ", + "vip ", + "maintenance-updates", + "delistings ", + "others", + "api-campaigns ", + "new-listings" + ], + "default": "latest-announcements", + "x-api-enum": [ + { + "value": "latest-announcements ", + "name": "LATEST-ANNOUNCEMENTS", + "description": "latest-announcements" + }, + { + "value": "activities ", + "name": "ACTIVITIES", + "description": "latest activities" + }, + { + "value": "product-updates ", + "name": "PRODUCT-UPDATES", + "description": "product updates" + }, + { + "value": "vip ", + "name": "VIPS", + "description": "institutions and VIPs" + }, + { + "value": "maintenance-updates", + "name": "MAINTENANCE-UPDATE", + "description": "system maintenance" + }, + { + "value": "delistings ", + "name": "DELISTINGS", + "description": "currency offline" + }, + { + "value": "others", + "name": "OTHERS", + "description": "others" + }, + { + "value": "api-campaigns ", + "name": "API-CAMPAIGNS", + "description": "API user activities" + }, + { + "value": "new-listings", + "name": "NEW-LISTINGS", + "description": "new currency online" + } + ] + }, + "enable": true + }, + { + "id": "ncGIEDsZtk", + "name": "lang", + "required": false, + "description": "Language type, the default is en_US, the specific value parameters are as follows", + "type": "string", + "schema": { + "type": "string", + "default": "en_US", + "enum": [ + "zh_HK", + "ja_JP", + "ko_KR", + "en_US", + "pl_PL", + "es_ES", + "fr_FR", + "ar_AE", + "it_IT", + "id_ID", + "nl_NL", + "pt_PT", + "vi_VN", + "de_DE", + "tr_TR", + "ms_MY", + "ru_RU", + "th_TH", + "hi_IN", + "bn_BD", + "fil_PH", + "ur_PK" + ], + "x-api-enum": [ + { + "value": "zh_HK", + "name": "ZH_HK", + "description": "Chinese (Hong Kong)" + }, + { + "value": "ja_JP", + "name": "JA_JP", + "description": "Japanese (Japan)" + }, + { + "value": "ko_KR", + "name": "KO_KR", + "description": "Korean (Korea)" + }, + { + "value": "en_US", + "name": "EN_US", + "description": "English" + }, + { + "value": "pl_PL", + "name": "PL_PL", + "description": "Polish (Poland)" + }, + { + "value": "es_ES", + "name": "ES_ES", + "description": "Spanish (Spain)" + }, + { + "value": "fr_FR", + "name": "FR_FR", + "description": "French (France)" + }, + { + "value": "ar_AE", + "name": "AR_AE", + "description": "Arabic (Egypt)" + }, + { + "value": "it_IT", + "name": "IT_IT", + "description": "Italian (Italy)" + }, + { + "value": "id_ID", + "name": "ID_ID", + "description": "Indonesian (Indonesia)" + }, + { + "value": "nl_NL", + "name": "NL_NL", + "description": "Dutch (Netherlands)" + }, + { + "value": "pt_PT", + "name": "PT_PT", + "description": "Portuguese (Brazil)" + }, + { + "value": "vi_VN", + "name": "VI_VN", + "description": "Vietnamese (Vietnam)" + }, + { + "value": "de_DE", + "name": "DE_DE", + "description": "German (Germany)" + }, + { + "value": "tr_TR", + "name": "TR_TR", + "description": "Turkish (Turkey)" + }, + { + "value": "ms_MY", + "name": "MS_MY", + "description": "Malay (Malaysia)" + }, + { + "value": "ru_RU", + "name": "RU_RU", + "description": "Russian (Russia)" + }, + { + "value": "th_TH", + "name": "TH_TH", + "description": "Thai (Thailand)" + }, + { + "value": "hi_IN", + "name": "HI_IN", + "description": "Hindi (India)" + }, + { + "value": "bn_BD", + "name": "BN_BD", + "description": "Bengali (Bangladesh)" + }, + { + "value": "fil_PH", + "name": "FIL_PH", + "description": "Filipino (Philippines)" + }, + { + "value": "ur_PK", + "name": "UR_PK", + "description": "Urdu (Pakistan)" + } + ] + }, + "enable": true, + "example": "en_US" + }, + { + "id": "7mBb3WnnJZ", + "name": "startTime", + "required": false, + "description": "Announcement online start time (milliseconds)", + "type": "integer", + "schema": { + "type": "integer", + "format": "int64" + }, + "enable": true, + "example": "1729594043000" + }, + { + "id": "r87zURGF3N", + "name": "endTime", + "required": false, + "description": "Announcement online end time (milliseconds)", + "type": "integer", + "schema": { + "type": "integer", + "format": "int64" + }, + "enable": true, + "example": "1729697729000" + } + ], "path": [], - "query": [], "cookie": [], "header": [] }, "responses": [ { - "id": "10316", + "id": "10321", "code": 200, "name": "OK", "headers": [], @@ -6013,152 +6286,81 @@ "type": "string" }, "data": { - "type": "array", - "items": { - "type": "object", - "properties": { - "currency": { - "type": "string", - "description": "A unique currency code that will never change" - }, - "name": { - "type": "string", - "description": "Currency name, will change after renaming" - }, - "fullName": { - "type": "string", - "description": "Full name of a currency, will change after renaming" - }, - "precision": { - "type": "integer", - "description": "Currency precision" - }, - "confirms": { - "type": "integer", - "description": "Number of block confirmations" - }, - "contractAddress": { - "type": "string", - "description": "Contract address" - }, - "isMarginEnabled": { - "type": "boolean", - "description": "Support margin or not" - }, - "isDebitEnabled": { - "type": "boolean", - "description": "Support debit or not" - }, - "chains": { - "type": "array", - "items": { - "type": "object", - "properties": { - "chainName": { - "type": "string", - "description": "chain name of currency" - }, - "withdrawalMinSize": { - "type": "string", - "description": "Minimum withdrawal amount" - }, - "depositMinSize": { - "type": "string", - "description": "Minimum deposit amount" - }, - "withdrawFeeRate": { - "type": "string", - "description": "withdraw fee rate" - }, - "withdrawalMinFee": { - "type": "string", - "description": "Minimum fees charged for withdrawal" - }, - "isWithdrawEnabled": { - "type": "boolean", - "description": "Support withdrawal or not" - }, - "isDepositEnabled": { - "type": "boolean", - "description": "Support deposit or not" - }, - "confirms": { - "type": "integer", - "description": "Number of block confirmations" - }, - "preConfirms": { - "type": "integer", - "description": "The number of blocks (confirmations) for advance on-chain verification" - }, - "contractAddress": { - "type": "string", - "description": "Contract address" - }, - "withdrawPrecision": { - "type": "integer", - "description": "Withdrawal precision bit, indicating the maximum supported length after the decimal point of the withdrawal amount" - }, - "maxWithdraw": { - "type": "string", - "description": "Maximum amount of single withdrawal" - }, - "maxDeposit": { - "type": "string", - "description": "Maximum amount of single deposit (only applicable to Lightning Network)" - }, - "needTag": { - "type": "boolean", - "description": "whether memo/tag is needed" - }, - "chainId": { - "type": "string", - "description": "chain id of currency" - }, - "depositFeeRate": { - "type": "string", - "description": "deposit fee rate (some currencies have this param, the default is empty)" - }, - "withdrawMaxFee": { - "type": "string", - "description": "withdraw max fee(some currencies have this param, the default is empty)" - }, - "depositTierFee": { + "type": "object", + "properties": { + "totalNum": { + "type": "integer", + "description": "Total Number" + }, + "items": { + "type": "array", + "items": { + "type": "object", + "properties": { + "annId": { + "type": "integer", + "description": "Announcement ID" + }, + "annTitle": { + "type": "string", + "description": "Announcement title" + }, + "annType": { + "type": "array", + "items": { "type": "string" - } + }, + "description": "Announcement type" }, - "required": [ - "chainName", - "withdrawalMinSize", - "depositMinSize", - "withdrawFeeRate", - "withdrawalMinFee", - "isWithdrawEnabled", - "isDepositEnabled", - "confirms", - "preConfirms", - "contractAddress", - "withdrawPrecision", - "maxWithdraw", - "maxDeposit", - "needTag", - "chainId" - ] + "annDesc": { + "type": "string", + "description": "Announcement description" + }, + "cTime": { + "type": "integer", + "description": "Announcement release time, Unix millisecond timestamp format", + "format": "int64" + }, + "language": { + "type": "string", + "description": "language type" + }, + "annUrl": { + "type": "string", + "description": "Announcement link" + } }, - "description": "chain list" + "required": [ + "annId", + "annTitle", + "annType", + "annDesc", + "cTime", + "language", + "annUrl" + ] } }, - "required": [ - "currency", - "name", - "fullName", - "precision", - "confirms", - "contractAddress", - "isMarginEnabled", - "isDebitEnabled", - "chains" - ] - } + "currentPage": { + "type": "integer", + "description": "Current page" + }, + "pageSize": { + "type": "integer", + "description": "Page size" + }, + "totalPage": { + "type": "integer", + "description": "Total Page" + } + }, + "required": [ + "totalNum", + "items", + "currentPage", + "pageSize", + "totalPage" + ] } }, "required": [ @@ -6174,8 +6376,8 @@ "responseExamples": [ { "name": "Success", - "data": "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"currency\": \"BTC\",\n \"name\": \"BTC\",\n \"fullName\": \"Bitcoin\",\n \"precision\": 8,\n \"confirms\": null,\n \"contractAddress\": null,\n \"isMarginEnabled\": true,\n \"isDebitEnabled\": true,\n \"chains\": [\n {\n \"chainName\": \"BTC\",\n \"withdrawalMinSize\": \"0.001\",\n \"depositMinSize\": \"0.0002\",\n \"withdrawFeeRate\": \"0\",\n \"withdrawalMinFee\": \"0.0005\",\n \"isWithdrawEnabled\": true,\n \"isDepositEnabled\": true,\n \"confirms\": 3,\n \"preConfirms\": 1,\n \"contractAddress\": \"\",\n \"withdrawPrecision\": 8,\n \"maxWithdraw\": null,\n \"maxDeposit\": null,\n \"needTag\": false,\n \"chainId\": \"btc\"\n },\n {\n \"chainName\": \"Lightning Network\",\n \"withdrawalMinSize\": \"0.00001\",\n \"depositMinSize\": \"0.00001\",\n \"withdrawFeeRate\": \"0\",\n \"withdrawalMinFee\": \"0.000015\",\n \"isWithdrawEnabled\": true,\n \"isDepositEnabled\": true,\n \"confirms\": 1,\n \"preConfirms\": 1,\n \"contractAddress\": \"\",\n \"withdrawPrecision\": 8,\n \"maxWithdraw\": null,\n \"maxDeposit\": \"0.03\",\n \"needTag\": false,\n \"chainId\": \"btcln\"\n },\n {\n \"chainName\": \"KCC\",\n \"withdrawalMinSize\": \"0.0008\",\n \"depositMinSize\": null,\n \"withdrawFeeRate\": \"0\",\n \"withdrawalMinFee\": \"0.00002\",\n \"isWithdrawEnabled\": true,\n \"isDepositEnabled\": true,\n \"confirms\": 20,\n \"preConfirms\": 20,\n \"contractAddress\": \"0xfa93c12cd345c658bc4644d1d4e1b9615952258c\",\n \"withdrawPrecision\": 8,\n \"maxWithdraw\": null,\n \"maxDeposit\": null,\n \"needTag\": false,\n \"chainId\": \"kcc\"\n },\n {\n \"chainName\": \"BTC-Segwit\",\n \"withdrawalMinSize\": \"0.0008\",\n \"depositMinSize\": \"0.0002\",\n \"withdrawFeeRate\": \"0\",\n \"withdrawalMinFee\": \"0.0005\",\n \"isWithdrawEnabled\": false,\n \"isDepositEnabled\": true,\n \"confirms\": 2,\n \"preConfirms\": 2,\n \"contractAddress\": \"\",\n \"withdrawPrecision\": 8,\n \"maxWithdraw\": null,\n \"maxDeposit\": null,\n \"needTag\": false,\n \"chainId\": \"bech32\"\n }\n ]\n },\n {\n \"currency\": \"BTCP\",\n \"name\": \"BTCP\",\n \"fullName\": \"Bitcoin Private\",\n \"precision\": 8,\n \"confirms\": null,\n \"contractAddress\": null,\n \"isMarginEnabled\": false,\n \"isDebitEnabled\": false,\n \"chains\": [\n {\n \"chainName\": \"BTCP\",\n \"withdrawalMinSize\": \"0.100000\",\n \"depositMinSize\": null,\n \"withdrawFeeRate\": \"0\",\n \"withdrawalMinFee\": \"0.010000\",\n \"isWithdrawEnabled\": false,\n \"isDepositEnabled\": false,\n \"confirms\": 6,\n \"preConfirms\": 6,\n \"contractAddress\": \"\",\n \"withdrawPrecision\": 8,\n \"maxWithdraw\": null,\n \"maxDeposit\": null,\n \"needTag\": false,\n \"chainId\": \"btcp\"\n }\n ]\n }\n ]\n}", - "responseId": 10316, + "data": "{\n \"code\": \"200000\",\n \"data\": {\n \"totalNum\": 195,\n \"totalPage\": 13,\n \"currentPage\": 1,\n \"pageSize\": 15,\n \"items\": [\n {\n \"annId\": 129045,\n \"annTitle\": \"KuCoin Isolated Margin Adds the Scroll (SCR) Trading Pair\",\n \"annType\": [\n \"latest-announcements\"\n ],\n \"annDesc\": \"To enrich the variety of assets available, KuCoin’s Isolated Margin Trading platform has added the Scroll (SCR) asset and trading pair.\",\n \"cTime\": 1729594043000,\n \"language\": \"en_US\",\n \"annUrl\": \"https://www.kucoin.com/announcement/kucoin-isolated-margin-adds-scr?lang=en_US\"\n },\n {\n \"annId\": 129001,\n \"annTitle\": \"DAPP-30D Fixed Promotion, Enjoy an APR of 200%!​\",\n \"annType\": [\n \"latest-announcements\",\n \"activities\"\n ],\n \"annDesc\": \"KuCoin Earn will be launching the DAPP Fixed Promotion at 10:00:00 on October 22, 2024 (UTC). The available product is “DAPP-30D'' with an APR of 200%.\",\n \"cTime\": 1729588460000,\n \"language\": \"en_US\",\n \"annUrl\": \"https://www.kucoin.com/announcement/dapp-30d-fixed-promotion-enjoy?lang=en_US\"\n },\n {\n \"annId\": 128581,\n \"annTitle\": \"NAYM (NAYM) Gets Listed on KuCoin! World Premiere!\",\n \"annType\": [\n \"latest-announcements\",\n \"new-listings\"\n ],\n \"annDesc\": \"Trading: 11:00 on October 22, 2024 (UTC)\",\n \"cTime\": 1729497729000,\n \"language\": \"en_US\",\n \"annUrl\": \"https://www.kucoin.com/announcement/en-naym-naym-gets-listed-on-kucoin-world-premiere?lang=en_US\"\n }\n ]\n }\n}", + "responseId": 10321, "ordering": 1 } ], @@ -6188,42 +6390,57 @@ }, "mediaType": "" }, - "description": ":::info[Description]\nRequest via this endpoint to get the currency list. Not all currencies currently can be used for trading.\n:::\n\n:::tip[Tips]\n**CURRENCY CODES**\n\nCurrency codes will conform to the ISO 4217 standard where possible. Currencies which have or had no representation in ISO 4217 may use a custom code.\n\n\n| Code | Description |\n| --- | --- |\n| BTC | Bitcoin |\n| ETH | Ethereum |\n| KCS | Kucoin Shares |\n\nFor a coin, the \"**currency**\" is a fixed value and works as the only recognized identity of the coin. As the \"**name**\", \"**fullnane**\" and \"**precision**\" of a coin are modifiable values, when the \"name\" of a coin is changed, you should use \"**currency**\" to get the coin.\n\nFor example: The \"**currency**\" of XRB is \"XRB\", if the \"**name**\" of XRB is changed into \"**Nano**\", you should use \"XRB\" (the currency of XRB) to search the coin.\n:::\n\n\n\n", - "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Spot\",\"api-channel\":\"Public\",\"api-permission\":\"NULL\",\"api-rate-limit-pool\":\"Public\",\"sdk-service\":\"Spot\",\"sdk-sub-service\":\"Market\",\"sdk-method-name\":\"getAllCurrencies\",\"sdk-method-description\":\"Request via this endpoint to get the currency list.Not all currencies currently can be used for trading.\",\"api-rate-limit\":3}" + "description": ":::info[Description]\nThis interface can obtain the latest news announcements, and the default page search is for announcements within a month.\n:::\n", + "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Spot\",\"api-channel\":\"Public\",\"api-permission\":\"NULL\",\"api-rate-limit-pool\":\"Public\",\"sdk-service\":\"Spot\",\"sdk-sub-service\":\"Market\",\"sdk-method-name\":\"getAnnouncements\",\"sdk-method-description\":\"This interface can obtain the latest news announcements, and the default page search is for announcements within a month.\",\"api-rate-limit\":20}" } }, { - "name": "Get Fiat Price", + "name": "Get Currency", "api": { - "id": "3470153", + "id": "3470155", "method": "get", - "path": "/api/v1/prices", + "path": "/api/v3/currencies/{currency}", "parameters": { - "path": [], - "query": [ + "path": [ { - "id": "awyky894vh", - "name": "base", - "required": false, - "description": "Ticker symbol of a base currency,eg.USD,EUR. Default is USD", - "example": "", - "type": "string", - "schema": { + "id": "currency#0", + "name": "currency", + "required": true, + "description": "Path parameter, Currency", + "example": "BTC", + "type": "string", + "schema": { "type": "string", - "default": "USD", "examples": [ - "USD", - "EUR" + "BTC", + "ETH", + "USDT" ] } - }, + } + ], + "query": [ { - "id": "Ak1pifFhEW", - "name": "currencies", + "id": "nSUWM8eRPB", + "name": "chain", "required": false, - "description": "Comma-separated cryptocurrencies to be converted into fiat, e.g.: BTC,ETH, etc. Default to return the fiat price of all currencies.", + "description": "Support for querying the chain of currency, e.g. The available value for USDT are OMNI, ERC20, TRC20. This only apply for multi-chain currency, and there is no need for single chain currency.", "example": "", - "type": "string" + "type": "string", + "schema": { + "type": "string", + "examples": [ + "eth", + "bech32", + "btc", + "kcc", + "trx", + "bsc", + "arbitrum", + "ton", + "optimism" + ] + } } ], "cookie": [], @@ -6231,7 +6448,7 @@ }, "responses": [ { - "id": "10317", + "id": "10319", "code": 200, "name": "OK", "headers": [], @@ -6244,1078 +6461,2817 @@ "data": { "type": "object", "properties": { - "AGLD": { - "type": "string" - }, - "DFI": { - "type": "string" + "currency": { + "type": "string", + "description": "A unique currency code that will never change" }, - "PYTHUP": { - "type": "string" + "name": { + "type": "string", + "description": "Currency name, will change after renaming" }, - "ISLM": { - "type": "string" + "fullName": { + "type": "string", + "description": "Full name of a currency, will change after renaming" }, - "NEAR": { - "type": "string" + "precision": { + "type": "integer", + "description": "Currency precision" }, - "AIOZ": { - "type": "string" + "confirms": { + "type": "integer", + "description": "Number of block confirmations" }, - "AUDIO": { - "type": "string" + "contractAddress": { + "type": "string", + "description": "Contract address" }, - "BBL": { - "type": "string" + "isMarginEnabled": { + "type": "boolean", + "description": "Support margin or not" }, - "WLD": { - "type": "string" + "isDebitEnabled": { + "type": "boolean", + "description": "Support debit or not" }, - "HNT": { - "type": "string" + "chains": { + "type": "array", + "items": { + "type": "object", + "properties": { + "chainName": { + "type": "string", + "description": "chain name of currency" + }, + "withdrawalMinSize": { + "type": "string", + "description": "Minimum withdrawal amount" + }, + "depositMinSize": { + "type": "string", + "description": "Minimum deposit amount" + }, + "withdrawFeeRate": { + "type": "string", + "description": "withdraw fee rate" + }, + "withdrawalMinFee": { + "type": "string", + "description": "Minimum fees charged for withdrawal" + }, + "isWithdrawEnabled": { + "type": "boolean", + "description": "Support withdrawal or not" + }, + "isDepositEnabled": { + "type": "boolean", + "description": "Support deposit or not" + }, + "confirms": { + "type": "integer", + "description": "Number of block confirmations" + }, + "preConfirms": { + "type": "integer", + "description": "The number of blocks (confirmations) for advance on-chain verification" + }, + "contractAddress": { + "type": "string", + "description": "Contract address" + }, + "withdrawPrecision": { + "type": "integer", + "description": "Withdrawal precision bit, indicating the maximum supported length after the decimal point of the withdrawal amount" + }, + "maxWithdraw": { + "type": "number", + "description": "Maximum amount of single withdrawal" + }, + "maxDeposit": { + "type": "string", + "description": "Maximum amount of single deposit (only applicable to Lightning Network)" + }, + "needTag": { + "type": "boolean", + "description": "whether memo/tag is needed" + }, + "chainId": { + "type": "string", + "description": "chain id of currency" + } + }, + "required": [ + "chainName", + "withdrawalMinSize", + "depositMinSize", + "withdrawFeeRate", + "withdrawalMinFee", + "isWithdrawEnabled", + "isDepositEnabled", + "confirms", + "preConfirms", + "contractAddress", + "withdrawPrecision", + "maxWithdraw", + "maxDeposit", + "needTag", + "chainId" + ] + }, + "description": "chain list" + } + }, + "required": [ + "currency", + "name", + "fullName", + "precision", + "confirms", + "contractAddress", + "isMarginEnabled", + "isDebitEnabled", + "chains" + ] + } + }, + "required": [ + "code", + "data" + ] + }, + "description": "", + "contentType": "json", + "mediaType": "" + } + ], + "responseExamples": [ + { + "name": "Success", + "data": "{\"code\":\"200000\",\"data\":{\"currency\":\"BTC\",\"name\":\"BTC\",\"fullName\":\"Bitcoin\",\"precision\":8,\"confirms\":null,\"contractAddress\":null,\"isMarginEnabled\":true,\"isDebitEnabled\":true,\"chains\":[{\"chainName\":\"BTC\",\"withdrawalMinSize\":\"0.001\",\"depositMinSize\":\"0.0002\",\"withdrawFeeRate\":\"0\",\"withdrawalMinFee\":\"0.0005\",\"isWithdrawEnabled\":true,\"isDepositEnabled\":true,\"confirms\":3,\"preConfirms\":1,\"contractAddress\":\"\",\"withdrawPrecision\":8,\"maxWithdraw\":null,\"maxDeposit\":null,\"needTag\":false,\"chainId\":\"btc\"},{\"chainName\":\"Lightning Network\",\"withdrawalMinSize\":\"0.00001\",\"depositMinSize\":\"0.00001\",\"withdrawFeeRate\":\"0\",\"withdrawalMinFee\":\"0.000015\",\"isWithdrawEnabled\":true,\"isDepositEnabled\":true,\"confirms\":1,\"preConfirms\":1,\"contractAddress\":\"\",\"withdrawPrecision\":8,\"maxWithdraw\":null,\"maxDeposit\":\"0.03\",\"needTag\":false,\"chainId\":\"btcln\"},{\"chainName\":\"KCC\",\"withdrawalMinSize\":\"0.0008\",\"depositMinSize\":null,\"withdrawFeeRate\":\"0\",\"withdrawalMinFee\":\"0.00002\",\"isWithdrawEnabled\":true,\"isDepositEnabled\":true,\"confirms\":20,\"preConfirms\":20,\"contractAddress\":\"0xfa93c12cd345c658bc4644d1d4e1b9615952258c\",\"withdrawPrecision\":8,\"maxWithdraw\":null,\"maxDeposit\":null,\"needTag\":false,\"chainId\":\"kcc\"},{\"chainName\":\"BTC-Segwit\",\"withdrawalMinSize\":\"0.0008\",\"depositMinSize\":\"0.0002\",\"withdrawFeeRate\":\"0\",\"withdrawalMinFee\":\"0.0005\",\"isWithdrawEnabled\":false,\"isDepositEnabled\":true,\"confirms\":2,\"preConfirms\":2,\"contractAddress\":\"\",\"withdrawPrecision\":8,\"maxWithdraw\":null,\"maxDeposit\":null,\"needTag\":false,\"chainId\":\"bech32\"}]}}", + "responseId": 10319, + "ordering": 1 + } + ], + "requestBody": { + "type": "none", + "parameters": [], + "jsonSchema": { + "type": "object", + "properties": {} + }, + "mediaType": "" + }, + "description": ":::info[Description]\nRequest via this endpoint to get the currency details of a specified currency\n:::", + "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Spot\",\"api-channel\":\"Public\",\"api-permission\":\"NULL\",\"api-rate-limit-pool\":\"Public\",\"sdk-service\":\"Spot\",\"sdk-sub-service\":\"Market\",\"sdk-method-name\":\"getCurrency\",\"sdk-method-description\":\"Request via this endpoint to get the currency details of a specified currency\",\"api-rate-limit\":3}" + } + }, + { + "name": "Get All Currencies", + "api": { + "id": "3470152", + "method": "get", + "path": "/api/v3/currencies", + "parameters": { + "path": [], + "query": [], + "cookie": [], + "header": [] + }, + "responses": [ + { + "id": "10316", + "code": 200, + "name": "OK", + "headers": [], + "jsonSchema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "array", + "items": { + "type": "object", + "properties": { + "currency": { + "type": "string", + "description": "A unique currency code that will never change" + }, + "name": { + "type": "string", + "description": "Currency name, will change after renaming" + }, + "fullName": { + "type": "string", + "description": "Full name of a currency, will change after renaming" + }, + "precision": { + "type": "integer", + "description": "Currency precision" + }, + "confirms": { + "type": "integer", + "description": "Number of block confirmations" + }, + "contractAddress": { + "type": "string", + "description": "Contract address" + }, + "isMarginEnabled": { + "type": "boolean", + "description": "Support margin or not" + }, + "isDebitEnabled": { + "type": "boolean", + "description": "Support debit or not" + }, + "chains": { + "type": "array", + "items": { + "type": "object", + "properties": { + "chainName": { + "type": "string", + "description": "chain name of currency" + }, + "withdrawalMinSize": { + "type": "string", + "description": "Minimum withdrawal amount" + }, + "depositMinSize": { + "type": "string", + "description": "Minimum deposit amount" + }, + "withdrawFeeRate": { + "type": "string", + "description": "withdraw fee rate" + }, + "withdrawalMinFee": { + "type": "string", + "description": "Minimum fees charged for withdrawal" + }, + "isWithdrawEnabled": { + "type": "boolean", + "description": "Support withdrawal or not" + }, + "isDepositEnabled": { + "type": "boolean", + "description": "Support deposit or not" + }, + "confirms": { + "type": "integer", + "description": "Number of block confirmations" + }, + "preConfirms": { + "type": "integer", + "description": "The number of blocks (confirmations) for advance on-chain verification" + }, + "contractAddress": { + "type": "string", + "description": "Contract address" + }, + "withdrawPrecision": { + "type": "integer", + "description": "Withdrawal precision bit, indicating the maximum supported length after the decimal point of the withdrawal amount" + }, + "maxWithdraw": { + "type": "string", + "description": "Maximum amount of single withdrawal" + }, + "maxDeposit": { + "type": "string", + "description": "Maximum amount of single deposit (only applicable to Lightning Network)" + }, + "needTag": { + "type": "boolean", + "description": "whether memo/tag is needed" + }, + "chainId": { + "type": "string", + "description": "chain id of currency" + }, + "depositFeeRate": { + "type": "string", + "description": "deposit fee rate (some currencies have this param, the default is empty)" + }, + "withdrawMaxFee": { + "type": "string", + "description": "withdraw max fee(some currencies have this param, the default is empty)" + }, + "depositTierFee": { + "type": "string" + } + }, + "required": [ + "chainName", + "withdrawalMinSize", + "depositMinSize", + "withdrawFeeRate", + "withdrawalMinFee", + "isWithdrawEnabled", + "isDepositEnabled", + "confirms", + "preConfirms", + "contractAddress", + "withdrawPrecision", + "maxWithdraw", + "maxDeposit", + "needTag", + "chainId" + ] + }, + "description": "chain list" + } }, - "ETHFI": { - "type": "string" + "required": [ + "currency", + "name", + "fullName", + "precision", + "confirms", + "contractAddress", + "isMarginEnabled", + "isDebitEnabled", + "chains" + ] + } + } + }, + "required": [ + "code", + "data" + ] + }, + "description": "", + "contentType": "json", + "mediaType": "" + } + ], + "responseExamples": [ + { + "name": "Success", + "data": "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"currency\": \"BTC\",\n \"name\": \"BTC\",\n \"fullName\": \"Bitcoin\",\n \"precision\": 8,\n \"confirms\": null,\n \"contractAddress\": null,\n \"isMarginEnabled\": true,\n \"isDebitEnabled\": true,\n \"chains\": [\n {\n \"chainName\": \"BTC\",\n \"withdrawalMinSize\": \"0.001\",\n \"depositMinSize\": \"0.0002\",\n \"withdrawFeeRate\": \"0\",\n \"withdrawalMinFee\": \"0.0005\",\n \"isWithdrawEnabled\": true,\n \"isDepositEnabled\": true,\n \"confirms\": 3,\n \"preConfirms\": 1,\n \"contractAddress\": \"\",\n \"withdrawPrecision\": 8,\n \"maxWithdraw\": null,\n \"maxDeposit\": null,\n \"needTag\": false,\n \"chainId\": \"btc\"\n },\n {\n \"chainName\": \"Lightning Network\",\n \"withdrawalMinSize\": \"0.00001\",\n \"depositMinSize\": \"0.00001\",\n \"withdrawFeeRate\": \"0\",\n \"withdrawalMinFee\": \"0.000015\",\n \"isWithdrawEnabled\": true,\n \"isDepositEnabled\": true,\n \"confirms\": 1,\n \"preConfirms\": 1,\n \"contractAddress\": \"\",\n \"withdrawPrecision\": 8,\n \"maxWithdraw\": null,\n \"maxDeposit\": \"0.03\",\n \"needTag\": false,\n \"chainId\": \"btcln\"\n },\n {\n \"chainName\": \"KCC\",\n \"withdrawalMinSize\": \"0.0008\",\n \"depositMinSize\": null,\n \"withdrawFeeRate\": \"0\",\n \"withdrawalMinFee\": \"0.00002\",\n \"isWithdrawEnabled\": true,\n \"isDepositEnabled\": true,\n \"confirms\": 20,\n \"preConfirms\": 20,\n \"contractAddress\": \"0xfa93c12cd345c658bc4644d1d4e1b9615952258c\",\n \"withdrawPrecision\": 8,\n \"maxWithdraw\": null,\n \"maxDeposit\": null,\n \"needTag\": false,\n \"chainId\": \"kcc\"\n },\n {\n \"chainName\": \"BTC-Segwit\",\n \"withdrawalMinSize\": \"0.0008\",\n \"depositMinSize\": \"0.0002\",\n \"withdrawFeeRate\": \"0\",\n \"withdrawalMinFee\": \"0.0005\",\n \"isWithdrawEnabled\": false,\n \"isDepositEnabled\": true,\n \"confirms\": 2,\n \"preConfirms\": 2,\n \"contractAddress\": \"\",\n \"withdrawPrecision\": 8,\n \"maxWithdraw\": null,\n \"maxDeposit\": null,\n \"needTag\": false,\n \"chainId\": \"bech32\"\n }\n ]\n },\n {\n \"currency\": \"BTCP\",\n \"name\": \"BTCP\",\n \"fullName\": \"Bitcoin Private\",\n \"precision\": 8,\n \"confirms\": null,\n \"contractAddress\": null,\n \"isMarginEnabled\": false,\n \"isDebitEnabled\": false,\n \"chains\": [\n {\n \"chainName\": \"BTCP\",\n \"withdrawalMinSize\": \"0.100000\",\n \"depositMinSize\": null,\n \"withdrawFeeRate\": \"0\",\n \"withdrawalMinFee\": \"0.010000\",\n \"isWithdrawEnabled\": false,\n \"isDepositEnabled\": false,\n \"confirms\": 6,\n \"preConfirms\": 6,\n \"contractAddress\": \"\",\n \"withdrawPrecision\": 8,\n \"maxWithdraw\": null,\n \"maxDeposit\": null,\n \"needTag\": false,\n \"chainId\": \"btcp\"\n }\n ]\n }\n ]\n}", + "responseId": 10316, + "ordering": 1 + } + ], + "requestBody": { + "type": "none", + "parameters": [], + "jsonSchema": { + "type": "object", + "properties": {} + }, + "mediaType": "" + }, + "description": ":::info[Description]\nRequest via this endpoint to get the currency list. Not all currencies currently can be used for trading.\n:::\n\n:::tip[Tips]\n**CURRENCY CODES**\n\nCurrency codes will conform to the ISO 4217 standard where possible. Currencies which have or had no representation in ISO 4217 may use a custom code.\n\n\n| Code | Description |\n| --- | --- |\n| BTC | Bitcoin |\n| ETH | Ethereum |\n| KCS | Kucoin Shares |\n\nFor a coin, the \"**currency**\" is a fixed value and works as the only recognized identity of the coin. As the \"**name**\", \"**fullnane**\" and \"**precision**\" of a coin are modifiable values, when the \"name\" of a coin is changed, you should use \"**currency**\" to get the coin.\n\nFor example: The \"**currency**\" of XRB is \"XRB\", if the \"**name**\" of XRB is changed into \"**Nano**\", you should use \"XRB\" (the currency of XRB) to search the coin.\n:::\n\n\n\n", + "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Spot\",\"api-channel\":\"Public\",\"api-permission\":\"NULL\",\"api-rate-limit-pool\":\"Public\",\"sdk-service\":\"Spot\",\"sdk-sub-service\":\"Market\",\"sdk-method-name\":\"getAllCurrencies\",\"sdk-method-description\":\"Request via this endpoint to get the currency list.Not all currencies currently can be used for trading.\",\"api-rate-limit\":3}" + } + }, + { + "name": "Get Symbol ", + "api": { + "id": "3470159", + "method": "get", + "path": "/api/v2/symbols/{symbol}", + "parameters": { + "path": [ + { + "id": "symbol#0", + "name": "symbol", + "required": true, + "description": "Path parameter, Symbol", + "example": "BTC-USDT", + "type": "string", + "schema": { + "type": "string" + } + } + ], + "query": [], + "cookie": [], + "header": [] + }, + "responses": [ + { + "id": "10323", + "code": 200, + "name": "OK", + "headers": [], + "jsonSchema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "object", + "properties": { + "symbol": { + "type": "string", + "description": "unique code of a symbol, it would not change after renaming", + "examples": [ + "BTC-USDT", + "BCHSV-USDT" + ] }, - "DMAIL": { - "type": "string" + "name": { + "type": "string", + "description": "Name of trading pairs, it would change after renaming", + "examples": [ + "BTC-USDT", + "BSV-USDT" + ] }, - "OPUP": { - "type": "string" + "baseCurrency": { + "type": "string", + "description": "Base currency,e.g. BTC." }, - "VET3S": { - "type": "string" + "quoteCurrency": { + "type": "string", + "description": "Quote currency,e.g. USDT." }, - "MANA3S": { - "type": "string" + "feeCurrency": { + "type": "string", + "description": "The currency of charged fees." }, - "TIDAL": { - "type": "string" + "market": { + "type": "string", + "description": "The trading market.", + "examples": [ + "USDS", + "BTC", + "ALTS" + ] }, - "HALO": { - "type": "string" + "baseMinSize": { + "type": "string", + "description": "The minimum order quantity requried to place an order." }, - "OPUL": { - "type": "string" + "quoteMinSize": { + "type": "string", + "description": "The minimum order funds required to place a market order." }, - "MANA3L": { - "type": "string" - }, - "DGB": { - "type": "string" - }, - "AA": { - "type": "string" - }, - "BCH": { - "type": "string" - }, - "GMEE": { - "type": "string" - }, - "JST": { - "type": "string" - }, - "PBUX": { - "type": "string" - }, - "AR": { - "type": "string" - }, - "SEI": { - "type": "string" - }, - "PSTAKE": { - "type": "string" - }, - "LMWR": { - "type": "string" - }, - "UNFIDOWN": { - "type": "string" - }, - "BB": { - "type": "string" - }, - "JTO": { - "type": "string" - }, - "WEMIX": { - "type": "string" - }, - "G": { - "type": "string" - }, - "MARSH": { - "type": "string" - }, - "BN": { - "type": "string" - }, - "FLIP": { - "type": "string" - }, - "FLR": { - "type": "string" - }, - "BIGTIME": { - "type": "string" - }, - "FLY": { - "type": "string" - }, - "T": { - "type": "string" - }, - "W": { - "type": "string" - }, - "BDX": { - "type": "string" + "baseMaxSize": { + "type": "string", + "description": "The maximum order size required to place an order." }, - "BABYDOGE": { - "type": "string" + "quoteMaxSize": { + "type": "string", + "description": "The maximum order funds required to place a market order." }, - "SFP": { - "type": "string" + "baseIncrement": { + "type": "string", + "description": "Quantity increment: The quantity for an order must be a positive integer multiple of this increment. Here, the size refers to the quantity of the base currency for the order. For example, for the ETH-USDT trading pair, if the baseIncrement is 0.0000001, the order quantity can be 1.0000001 but not 1.00000001." }, - "DIA": { - "type": "string" + "quoteIncrement": { + "type": "string", + "description": "Quote increment: The funds for a market order must be a positive integer multiple of this increment. The funds refer to the quote currency amount. For example, for the ETH-USDT trading pair, if the quoteIncrement is 0.000001, the amount of USDT for the order can be 3000.000001 but not 3000.0000001." }, - "ISME": { - "type": "string" + "priceIncrement": { + "type": "string", + "description": "Price increment: The price of an order must be a positive integer multiple of this increment. For example, for the ETH-USDT trading pair, if the priceIncrement is 0.01, the order price can be 3000.01 but not 3000.001." }, - "LYM": { - "type": "string" + "priceLimitRate": { + "type": "string", + "description": "Threshold for price portection" }, - "VET3L": { - "type": "string" + "minFunds": { + "type": "string", + "description": "the minimum trading amounts" }, - "JUP": { - "type": "string" + "isMarginEnabled": { + "type": "boolean", + "description": "Available for margin or not." }, - "LYX": { - "type": "string" + "enableTrading": { + "type": "boolean", + "description": "Available for transaction or not." }, - "AIEPK": { - "type": "string" + "feeCategory": { + "type": "integer", + "description": "[Fee Type](https://www.kucoin.com/vip/privilege)", + "enum": [ + 1, + 2, + 3 + ], + "x-api-enum": [ + { + "value": 1, + "name": "classA", + "description": "classA" + }, + { + "value": 2, + "name": "classB", + "description": "classB" + }, + { + "value": 3, + "name": "classC", + "description": "classC" + } + ] }, - "SILLY": { - "type": "string" + "makerFeeCoefficient": { + "type": "string", + "description": "The maker fee coefficient. The actual fee needs to be multiplied by this coefficient to get the final fee. Most currencies have a coefficient of 1. If set to 0, it means no fee" }, - "SCPT": { - "type": "string" + "takerFeeCoefficient": { + "type": "string", + "description": "The taker fee coefficient. The actual fee needs to be multiplied by this coefficient to get the final fee. Most currencies have a coefficient of 1. If set to 0, it means no fee" }, - "WOO": { - "type": "string" + "st": { + "type": "boolean" + } + }, + "required": [ + "symbol", + "name", + "baseCurrency", + "quoteCurrency", + "feeCurrency", + "market", + "baseMinSize", + "quoteMinSize", + "baseMaxSize", + "quoteMaxSize", + "baseIncrement", + "quoteIncrement", + "priceIncrement", + "priceLimitRate", + "minFunds", + "isMarginEnabled", + "enableTrading", + "feeCategory", + "makerFeeCoefficient", + "takerFeeCoefficient", + "st" + ] + } + }, + "required": [ + "code", + "data" + ] + }, + "description": "", + "contentType": "json", + "mediaType": "" + } + ], + "responseExamples": [ + { + "name": "Success", + "data": "{\"code\":\"200000\",\"data\":{\"symbol\":\"BTC-USDT\",\"name\":\"BTC-USDT\",\"baseCurrency\":\"BTC\",\"quoteCurrency\":\"USDT\",\"feeCurrency\":\"USDT\",\"market\":\"USDS\",\"baseMinSize\":\"0.00001\",\"quoteMinSize\":\"0.1\",\"baseMaxSize\":\"10000000000\",\"quoteMaxSize\":\"99999999\",\"baseIncrement\":\"0.00000001\",\"quoteIncrement\":\"0.000001\",\"priceIncrement\":\"0.1\",\"priceLimitRate\":\"0.1\",\"minFunds\":\"0.1\",\"isMarginEnabled\":true,\"enableTrading\":true,\"feeCategory\":1,\"makerFeeCoefficient\":\"1.00\",\"takerFeeCoefficient\":\"1.00\",\"st\":false}}", + "responseId": 10323, + "ordering": 1 + } + ], + "requestBody": { + "type": "none", + "parameters": [], + "jsonSchema": { + "type": "object", + "properties": {} + }, + "mediaType": "" + }, + "description": ":::info[Description]\nRequest via this endpoint to get detail currency pairs for trading. If you want to get the market information of the trading symbol, please use Get All Tickers.\n:::\n\n\n- The baseMinSize and baseMaxSize fields define the min and max order size.\n- The priceIncrement field specifies the min order price as well as the price increment.This also applies to quote currency.\n\nThe order price must be a positive integer multiple of this priceIncrement (i.e. if the increment is 0.01, the 0.001 and 0.021 order prices would be rejected).\n\npriceIncrement and quoteIncrement may be adjusted in the future. We will notify you by email and site notifications before adjustment.\n\n| Order Type | Follow the rules of minFunds |\n| ------ | ---------- |\n| Limit Buy\t | [Order Amount * Order Price] >= minFunds |\n| Limit Sell | [Order Amount * Order Price] >= minFunds |\n| Market Buy | Order Value >= minFunds |\n| Market Sell | [Order Amount * Last Price of Base Currency] >= minFunds |\n\nNote:\n- API market buy orders (by amount) valued at (Order Amount * Last Price of Base Currency) < minFunds will be rejected.\n- API market sell orders (by value) valued at < minFunds will be rejected.\n- Take profit and stop loss orders at market or limit prices will be rejected when triggered.", + "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Spot\",\"api-channel\":\"Public\",\"api-permission\":\"NULL\",\"api-rate-limit-pool\":\"Public\",\"sdk-service\":\"Spot\",\"sdk-sub-service\":\"Market\",\"sdk-method-name\":\"getSymbol\",\"sdk-method-description\":\"Request via this endpoint to get detail currency pairs for trading. If you want to get the market information of the trading symbol, please use Get All Tickers.\",\"api-rate-limit\":4}" + } + }, + { + "name": "Get All Symbols", + "api": { + "id": "3470154", + "method": "get", + "path": "/api/v2/symbols", + "parameters": { + "path": [], + "query": [ + { + "id": "4oM4tRz9wb", + "name": "market", + "required": false, + "description": "[The trading market](apidog://link/endpoint/222921786)", + "example": "", + "type": "string", + "schema": { + "type": "string", + "examples": [ + "ALTS", + "USDS", + "ETF" + ] + } + } + ], + "cookie": [], + "header": [] + }, + "responses": [ + { + "id": "10318", + "code": 200, + "name": "OK", + "headers": [], + "jsonSchema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "array", + "items": { + "type": "object", + "properties": { + "symbol": { + "type": "string", + "description": "unique code of a symbol, it would not change after renaming", + "examples": [ + "BTC-USDT", + "BCHSV-USDT" + ] + }, + "name": { + "type": "string", + "description": "Name of trading pairs, it would change after renaming", + "examples": [ + "BTC-USDT", + "BSV-USDT" + ] + }, + "baseCurrency": { + "type": "string", + "description": "Base currency,e.g. BTC." + }, + "quoteCurrency": { + "type": "string", + "description": "Quote currency,e.g. USDT." + }, + "feeCurrency": { + "type": "string", + "description": "The currency of charged fees." + }, + "market": { + "type": "string", + "description": "The trading market.", + "examples": [ + "USDS", + "BTC", + "ALTS" + ] + }, + "baseMinSize": { + "type": "string", + "description": "The minimum order quantity requried to place an order." + }, + "quoteMinSize": { + "type": "string", + "description": "The minimum order funds required to place a market order." + }, + "baseMaxSize": { + "type": "string", + "description": "The maximum order size required to place an order." + }, + "quoteMaxSize": { + "type": "string", + "description": "The maximum order funds required to place a market order." + }, + "baseIncrement": { + "type": "string", + "description": "Quantity increment: The quantity for an order must be a positive integer multiple of this increment. Here, the size refers to the quantity of the base currency for the order. For example, for the ETH-USDT trading pair, if the baseIncrement is 0.0000001, the order quantity can be 1.0000001 but not 1.00000001." + }, + "quoteIncrement": { + "type": "string", + "description": "Quote increment: The funds for a market order must be a positive integer multiple of this increment. The funds refer to the quote currency amount. For example, for the ETH-USDT trading pair, if the quoteIncrement is 0.000001, the amount of USDT for the order can be 3000.000001 but not 3000.0000001." + }, + "priceIncrement": { + "type": "string", + "description": "Price increment: The price of an order must be a positive integer multiple of this increment. For example, for the ETH-USDT trading pair, if the priceIncrement is 0.01, the order price can be 3000.01 but not 3000.001.\n\nspecifies the min order price as well as the price increment.This also applies to quote currency." + }, + "priceLimitRate": { + "type": "string", + "description": "Threshold for price portection" + }, + "minFunds": { + "type": "string", + "description": "the minimum trading amounts" + }, + "isMarginEnabled": { + "type": "boolean", + "description": "Available for margin or not." + }, + "enableTrading": { + "type": "boolean", + "description": "Available for transaction or not." + }, + "feeCategory": { + "type": "integer", + "description": "[Fee Type](https://www.kucoin.com/vip/privilege)", + "enum": [ + 1, + 2, + 3 + ], + "x-api-enum": [ + { + "value": 1, + "name": "classA", + "description": "classA" + }, + { + "value": 2, + "name": "classB", + "description": "classB" + }, + { + "value": 3, + "name": "classC", + "description": "classC" + } + ] + }, + "makerFeeCoefficient": { + "type": "string", + "description": "The maker fee coefficient. The actual fee needs to be multiplied by this coefficient to get the final fee. Most currencies have a coefficient of 1. If set to 0, it means no fee" + }, + "takerFeeCoefficient": { + "type": "string", + "description": "The taker fee coefficient. The actual fee needs to be multiplied by this coefficient to get the final fee. Most currencies have a coefficient of 1. If set to 0, it means no fee" + }, + "st": { + "type": "boolean", + "description": "Whether it is an [Special Treatment](https://www.kucoin.com/legal/special-treatment) symbol" + } }, - "BLUR": { - "type": "string" + "required": [ + "symbol", + "name", + "baseCurrency", + "quoteCurrency", + "feeCurrency", + "market", + "baseMinSize", + "quoteMinSize", + "baseMaxSize", + "quoteMaxSize", + "baseIncrement", + "quoteIncrement", + "priceIncrement", + "priceLimitRate", + "minFunds", + "isMarginEnabled", + "enableTrading", + "feeCategory", + "makerFeeCoefficient", + "takerFeeCoefficient", + "st" + ] + } + } + }, + "required": [ + "code", + "data" + ] + }, + "description": "", + "contentType": "json", + "mediaType": "" + } + ], + "responseExamples": [ + { + "name": "Success", + "data": "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"symbol\": \"BTC-USDT\",\n \"name\": \"BTC-USDT\",\n \"baseCurrency\": \"BTC\",\n \"quoteCurrency\": \"USDT\",\n \"feeCurrency\": \"USDT\",\n \"market\": \"USDS\",\n \"baseMinSize\": \"0.00001\",\n \"quoteMinSize\": \"0.1\",\n \"baseMaxSize\": \"10000000000\",\n \"quoteMaxSize\": \"99999999\",\n \"baseIncrement\": \"0.00000001\",\n \"quoteIncrement\": \"0.000001\",\n \"priceIncrement\": \"0.1\",\n \"priceLimitRate\": \"0.1\",\n \"minFunds\": \"0.1\",\n \"isMarginEnabled\": true,\n \"enableTrading\": true,\n \"feeCategory\": 1,\n \"makerFeeCoefficient\": \"1.00\",\n \"takerFeeCoefficient\": \"1.00\",\n \"st\": false\n }\n ]\n}", + "responseId": 10318, + "ordering": 1 + } + ], + "requestBody": { + "type": "none", + "parameters": [], + "jsonSchema": { + "type": "object", + "properties": {} + }, + "mediaType": "" + }, + "description": ":::info[Description]\nRequest via this endpoint to get a list of available currency pairs for trading. If you want to get the market information of the trading symbol, please use Get All Tickers.\n:::\n\n\n:::tip[Tips]\npriceIncrement and quoteIncrement may be adjusted in the future. We will notify you by email and site notifications before adjustment.\n:::\n\n| Order Type | Follow the rules of minFunds |\n| --- | --- |\n| Limit Buy | [Order Amount * Order Price] >= minFunds |\n| Limit Sell | [Order Amount * Order Price] >= minFunds |\n| Market Buy | Order Value >= minFunds |\n| Market Sell | [Order Amount * Last Price of Base Currency] >= minFunds |\n\nNote:\n\n- API market buy orders (by amount) valued at [Order Amount * Last Price of Base Currency] < minFunds will be rejected.\n- API market sell orders (by value) valued at < minFunds will be rejected.\n- Take profit and stop loss orders at market or limit prices will be rejected when triggered.\n\n\n", + "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Spot\",\"api-channel\":\"Public\",\"api-permission\":\"NULL\",\"api-rate-limit-pool\":\"Public\",\"sdk-service\":\"Spot\",\"sdk-sub-service\":\"Market\",\"sdk-method-name\":\"getAllSymbols\",\"sdk-method-description\":\"Request via this endpoint to get a list of available currency pairs for trading. If you want to get the market information of the trading symbol, please use Get All Tickers.\",\"api-rate-limit\":4}" + } + }, + { + "name": "Get Ticker", + "api": { + "id": "3470160", + "method": "get", + "path": "/api/v1/market/orderbook/level1", + "parameters": { + "path": [], + "query": [ + { + "id": "AwnkwQxRMq", + "name": "symbol", + "required": true, + "description": "symbol", + "example": "BTC-USDT", + "type": "string" + } + ], + "cookie": [], + "header": [] + }, + "responses": [ + { + "id": "10324", + "code": 200, + "name": "OK", + "headers": [], + "jsonSchema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "object", + "properties": { + "time": { + "type": "integer", + "description": "timestamp", + "format": "int64" }, - "STRK": { - "type": "string" + "sequence": { + "type": "string", + "description": "Sequence" }, - "BFC": { - "type": "string" + "price": { + "type": "string", + "description": "Last traded price" }, - "DC": { - "type": "string" + "size": { + "type": "string", + "description": "Last traded size" }, - "KARATE": { - "type": "string" + "bestBid": { + "type": "string", + "description": "Best bid price" }, - "SUSHI3L": { - "type": "string" + "bestBidSize": { + "type": "string", + "description": "Best bid size" }, - "NETVR": { - "type": "string" + "bestAsk": { + "type": "string", + "description": "Best ask price" }, - "WAVES": { - "type": "string" - }, - "LITH": { - "type": "string" - }, - "HAPI": { - "type": "string" - }, - "SUSHI3S": { - "type": "string" - }, - "CEEK": { - "type": "string" - }, - "FLOKI": { - "type": "string" - }, - "SHR": { - "type": "string" - }, - "SAND": { - "type": "string" - }, - "TURT": { - "type": "string" - }, - "UMA": { - "type": "string" - }, - "BEPRO": { - "type": "string" - }, - "SCRT": { - "type": "string" - }, - "TUSD": { - "type": "string" - }, - "COOKIE": { - "type": "string" - }, - "LRDS": { - "type": "string" - }, - "SIN": { - "type": "string" - }, - "OAS": { - "type": "string" - }, - "ROOT": { - "type": "string" - }, - "ADA3L": { - "type": "string" - }, - "TIAUP": { - "type": "string" - }, - "HTR": { - "type": "string" - }, - "UNB": { - "type": "string" - }, - "UNA": { - "type": "string" - }, - "HARD": { - "type": "string" - }, - "G3": { - "type": "string" - }, - "ADA3S": { - "type": "string" - }, - "MYRO": { - "type": "string" - }, - "HTX": { - "type": "string" - }, - "FT": { - "type": "string" - }, - "BTCDOWN": { - "type": "string" - }, - "UNI": { - "type": "string" - }, - "FX": { - "type": "string" - }, - "OBI": { - "type": "string" - }, - "UNO": { - "type": "string" - }, - "WRX": { - "type": "string" - }, - "TIADOWN": { - "type": "string" - }, - "ETHDOWN": { - "type": "string" - }, - "WELL": { - "type": "string" - }, - "SWFTC": { - "type": "string" - }, - "SKL": { - "type": "string" - }, - "UOS": { - "type": "string" - }, - "AIPAD": { - "type": "string" - }, - "BRETT": { - "type": "string" - }, - "SKY": { - "type": "string" - }, - "FRM": { - "type": "string" - }, - "VISION": { - "type": "string" - }, - "LENDS": { - "type": "string" - }, - "SLF": { - "type": "string" - }, - "BULL": { - "type": "string" - }, - "FLOW": { - "type": "string" - }, - "ODDZ": { - "type": "string" - }, - "SLN": { - "type": "string" - }, - "UPO": { - "type": "string" - }, - "SLP": { - "type": "string" - }, - "ID": { - "type": "string" - }, - "SLIM": { - "type": "string" - }, - "SPOT": { - "type": "string" - }, - "DOP": { - "type": "string" - }, - "ISSP": { - "type": "string" - }, - "UQC": { - "type": "string" - }, - "IO": { - "type": "string" - }, - "DOT": { - "type": "string" + "bestAskSize": { + "type": "string", + "description": "Best ask size" + } + }, + "required": [ + "sequence", + "price", + "size", + "bestBid", + "bestBidSize", + "bestAsk", + "bestAskSize", + "time" + ] + } + }, + "required": [ + "code", + "data" + ] + }, + "description": "", + "contentType": "json", + "mediaType": "" + } + ], + "responseExamples": [ + { + "name": "Success", + "data": "{\"code\":\"200000\",\"data\":{\"time\":1729172965609,\"sequence\":\"14609309753\",\"price\":\"67269\",\"size\":\"0.000025\",\"bestBid\":\"67267.5\",\"bestBidSize\":\"0.000025\",\"bestAsk\":\"67267.6\",\"bestAskSize\":\"1.24808993\"}}", + "responseId": 10324, + "ordering": 1 + } + ], + "requestBody": { + "type": "none", + "parameters": [], + "jsonSchema": { + "type": "object", + "properties": {} + }, + "mediaType": "" + }, + "description": ":::info[Description]\nRequest via this endpoint to get Level 1 Market Data. The returned value includes the best bid price and size, the best ask price and size as well as the last traded price and the last traded size.\n:::", + "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Spot\",\"api-channel\":\"Public\",\"api-permission\":\"NULL\",\"api-rate-limit-pool\":\"Public\",\"sdk-service\":\"Spot\",\"sdk-sub-service\":\"Market\",\"sdk-method-name\":\"getTicker\",\"sdk-method-description\":\"Request via this endpoint to get Level 1 Market Data. The returned value includes the best bid price and size, the best ask price and size as well as the last traded price and the last traded size.\",\"api-rate-limit\":2}" + } + }, + { + "name": "Get All Tickers", + "api": { + "id": "3470167", + "method": "get", + "path": "/api/v1/market/allTickers", + "parameters": { + "path": [], + "query": [], + "cookie": [], + "header": [] + }, + "responses": [ + { + "id": "10331", + "code": 200, + "name": "OK", + "headers": [], + "jsonSchema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "object", + "properties": { + "time": { + "type": "integer", + "description": "timestamp", + "format": "int64" }, - "1INCH": { - "type": "string" + "ticker": { + "type": "array", + "items": { + "type": "object", + "properties": { + "symbol": { + "type": "string", + "description": "Symbol" + }, + "symbolName": { + "type": "string", + "description": "Name of trading pairs, it would change after renaming" + }, + "buy": { + "type": "string", + "description": "Best bid price" + }, + "bestBidSize": { + "type": "string", + "description": "Best bid size" + }, + "sell": { + "type": "string", + "description": "Best ask price" + }, + "bestAskSize": { + "type": "string", + "description": "Best ask size" + }, + "changeRate": { + "type": "string", + "description": "24h change rate" + }, + "changePrice": { + "type": "string", + "description": "24h change price" + }, + "high": { + "type": "string", + "description": "Highest price in 24h" + }, + "low": { + "type": "string", + "description": "Lowest price in 24h" + }, + "vol": { + "type": "string", + "description": "24h volume, executed based on base currency" + }, + "volValue": { + "type": "string", + "description": "24h traded amount" + }, + "last": { + "type": "string", + "description": "Last traded price" + }, + "averagePrice": { + "type": "string", + "description": "Average trading price in the last 24 hours" + }, + "takerFeeRate": { + "type": "string", + "description": "Basic Taker Fee" + }, + "makerFeeRate": { + "type": "string", + "description": "Basic Maker Fee" + }, + "takerCoefficient": { + "type": "string", + "description": "The taker fee coefficient. The actual fee needs to be multiplied by this coefficient to get the final fee. Most currencies have a coefficient of 1. If set to 0, it means no fee", + "enum": [ + "1", + "0" + ], + "x-api-enum": [ + { + "value": "1", + "name": "1", + "description": "the taker fee coefficient is 1" + }, + { + "value": "0", + "name": "0", + "description": "no fee" + } + ] + }, + "makerCoefficient": { + "type": "string", + "description": "The maker fee coefficient. The actual fee needs to be multiplied by this coefficient to get the final fee. Most currencies have a coefficient of 1. If set to 0, it means no fee", + "enum": [ + "1", + "0" + ], + "x-api-enum": [ + { + "value": "1", + "name": "1", + "description": "the maker fee coefficient is 1" + }, + { + "value": "0", + "name": "0", + "description": "no fee" + } + ] + } + }, + "required": [ + "symbol", + "symbolName", + "buy", + "bestBidSize", + "sell", + "bestAskSize", + "changeRate", + "changePrice", + "high", + "low", + "vol", + "volValue", + "last", + "averagePrice", + "takerFeeRate", + "makerFeeRate", + "takerCoefficient", + "makerCoefficient" + ] + } + } + }, + "required": [ + "time", + "ticker" + ] + } + }, + "required": [ + "code", + "data" + ] + }, + "description": "", + "contentType": "json", + "mediaType": "" + } + ], + "responseExamples": [ + { + "name": "Success", + "data": "{\n \"code\": \"200000\",\n \"data\": {\n \"time\": 1729173207043,\n \"ticker\": [\n {\n \"symbol\": \"BTC-USDT\",\n \"symbolName\": \"BTC-USDT\",\n \"buy\": \"67192.5\",\n \"bestBidSize\": \"0.000025\",\n \"sell\": \"67192.6\",\n \"bestAskSize\": \"1.24949204\",\n \"changeRate\": \"-0.0014\",\n \"changePrice\": \"-98.5\",\n \"high\": \"68321.4\",\n \"low\": \"66683.3\",\n \"vol\": \"1836.03034612\",\n \"volValue\": \"124068431.06726933\",\n \"last\": \"67193\",\n \"averagePrice\": \"67281.21437289\",\n \"takerFeeRate\": \"0.001\",\n \"makerFeeRate\": \"0.001\",\n \"takerCoefficient\": \"1\",\n \"makerCoefficient\": \"1\"\n }\n ]\n }\n}", + "responseId": 10331, + "ordering": 1 + } + ], + "requestBody": { + "type": "none", + "parameters": [], + "jsonSchema": { + "type": "object", + "properties": {} + }, + "mediaType": "" + }, + "description": ":::info[Description]\nRequest market tickers for all the trading pairs in the market (including 24h volume), takes a snapshot every 2 seconds.\n\nOn the rare occasion that we will change the currency name, if you still want the changed symbol name, you can use the symbolName field instead of the symbol field via “Get Symbols List” endpoint.\n:::", + "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Spot\",\"api-channel\":\"Public\",\"api-permission\":\"NULL\",\"api-rate-limit-pool\":\"Public\",\"sdk-service\":\"Spot\",\"sdk-sub-service\":\"Market\",\"sdk-method-name\":\"getAllTickers\",\"sdk-method-description\":\"Request market tickers for all the trading pairs in the market (including 24h volume), takes a snapshot every 2 seconds. On the rare occasion that we will change the currency name, if you still want the changed symbol name, you can use the symbolName field instead of the symbol field via “Get all tickers” endpoint.\",\"api-rate-limit\":15}" + } + }, + { + "name": "Get Trade History", + "api": { + "id": "3470162", + "method": "get", + "path": "/api/v1/market/histories", + "parameters": { + "query": [ + { + "id": "AwnkwQxRMq", + "name": "symbol", + "required": true, + "description": "symbol", + "example": "BTC-USDT", + "type": "string", + "enable": true + } + ], + "path": [], + "cookie": [], + "header": [] + }, + "responses": [ + { + "id": "10326", + "code": 200, + "name": "OK", + "headers": [], + "jsonSchema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "array", + "items": { + "type": "object", + "properties": { + "sequence": { + "type": "string", + "description": "Sequence number" + }, + "price": { + "type": "string", + "description": "Filled price" + }, + "size": { + "type": "string", + "description": "Filled amount" + }, + "side": { + "type": "string", + "description": "Filled side, The trade side indicates the taker order side. A taker order is the order that was matched with orders opened on the order book.", + "enum": [ + "buy", + "sell" + ], + "x-api-enum": [ + { + "value": "buy", + "name": "buy", + "description": "buy" + }, + { + "value": "sell", + "name": "sell", + "description": "sell" + } + ] + }, + "time": { + "type": "integer", + "format": "int64", + "description": "Filled timestamp(nanosecond)" + } }, - "SMH": { - "type": "string" - }, - "MAK": { - "type": "string" - }, - "TOKO": { - "type": "string" - }, - "TURBO": { - "type": "string" - }, - "UNFI": { - "type": "string" - }, - "MAN": { - "type": "string" - }, - "EVER": { - "type": "string" - }, - "FTM": { - "type": "string" - }, - "SHRAP": { - "type": "string" - }, - "MAV": { - "type": "string" - }, - "MAX": { - "type": "string" - }, - "DPR": { - "type": "string" - }, - "FTT": { - "type": "string" - }, - "ARKM": { - "type": "string" - }, - "ATOM": { - "type": "string" - }, - "PENDLE": { - "type": "string" - }, - "QUICK": { - "type": "string" - }, - "BLZ": { - "type": "string" - }, - "BOBA": { - "type": "string" - }, - "MBL": { - "type": "string" - }, - "OFN": { - "type": "string" - }, - "UNIO": { - "type": "string" - }, - "SNS": { - "type": "string" + "required": [ + "sequence", + "price", + "size", + "side", + "time" + ] + } + } + }, + "required": [ + "code", + "data" + ] + }, + "description": "", + "contentType": "json", + "mediaType": "" + } + ], + "responseExamples": [ + { + "name": "Success", + "data": "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"sequence\": \"10976028003549185\",\n \"price\": \"67122\",\n \"size\": \"0.000025\",\n \"side\": \"buy\",\n \"time\": 1729177117877000000\n },\n {\n \"sequence\": \"10976028003549188\",\n \"price\": \"67122\",\n \"size\": \"0.01792257\",\n \"side\": \"buy\",\n \"time\": 1729177117877000000\n },\n {\n \"sequence\": \"10976028003549191\",\n \"price\": \"67122.9\",\n \"size\": \"0.05654289\",\n \"side\": \"buy\",\n \"time\": 1729177117877000000\n }\n ]\n}", + "responseId": 10326, + "ordering": 1 + } + ], + "requestBody": { + "type": "none", + "parameters": [], + "jsonSchema": { + "type": "object", + "properties": {} + }, + "mediaType": "" + }, + "description": ":::info[Description]\nRequest via this endpoint to get the trade history of the specified symbol, the returned quantity is the last 100 transaction records.\n:::", + "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Spot\",\"api-channel\":\"Public\",\"api-permission\":\"NULL\",\"api-rate-limit-pool\":\"Public\",\"sdk-service\":\"Spot\",\"sdk-sub-service\":\"Market\",\"sdk-method-name\":\"getTradeHistory\",\"sdk-method-description\":\"Request via this endpoint to get the trade history of the specified symbol, the returned quantity is the last 100 transaction records.\",\"api-rate-limit\":3}" + } + }, + { + "name": "Get Klines", + "api": { + "id": "3470163", + "method": "get", + "path": "/api/v1/market/candles", + "parameters": { + "query": [ + { + "id": "AwnkwQxRMq", + "name": "symbol", + "required": true, + "description": " symbol", + "example": "BTC-USDT", + "type": "string", + "enable": true + }, + { + "id": "FcaM2YvA6p", + "name": "type", + "required": true, + "description": "Type of candlestick patterns: 1min, 3min, 5min, 15min, 30min, 1hour, 2hour, 4hour, 6hour, 8hour, 12hour, 1day, 1week, 1month", + "example": "1min", + "type": "string", + "schema": { + "type": "string", + "enum": [ + "1min", + "3min", + "5min", + "15min", + "30min", + "1hour", + "2hour", + "4hour", + "6hour", + "8hour", + "12hour", + "1day", + "1week", + "1month" + ], + "x-api-enum": [ + { + "value": "1min", + "name": "1min", + "description": "1min" + }, + { + "value": "3min", + "name": "3min", + "description": "3min" + }, + { + "value": "5min", + "name": "5min", + "description": "5min" + }, + { + "value": "15min", + "name": "15min", + "description": "15min" + }, + { + "value": "30min", + "name": "30min", + "description": "30min" + }, + { + "value": "1hour", + "name": "1hour", + "description": "1hour" + }, + { + "value": "2hour", + "name": "2hour", + "description": "2hour" + }, + { + "value": "4hour", + "name": "4hour", + "description": "4hour" + }, + { + "value": "6hour", + "name": "6hour", + "description": "6hour" + }, + { + "value": "8hour", + "name": "8hour", + "description": "8hour" + }, + { + "value": "12hour", + "name": "12hour", + "description": "12hour" + }, + { + "value": "1day", + "name": "1day", + "description": "1day" + }, + { + "value": "1week", + "name": "1week", + "description": "1week" + }, + { + "value": "1month", + "name": "1month", + "description": "1month" + } + ] + }, + "enable": true + }, + { + "id": "LNMS5qTAS3", + "name": "startAt", + "required": false, + "description": "Start time (second), default is 0", + "example": "1566703297", + "type": "integer", + "schema": { + "type": "integer", + "format": "int64", + "default": 0 + }, + "enable": true + }, + { + "id": "gziaY6i2V1", + "name": "endAt", + "required": false, + "description": "End time (second), default is 0", + "example": "1566789757", + "type": "integer", + "schema": { + "type": "integer", + "format": "int64", + "default": 0 + }, + "enable": true + } + ], + "path": [], + "cookie": [], + "header": [] + }, + "responses": [ + { + "id": "10327", + "code": 200, + "name": "OK", + "headers": [], + "jsonSchema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "string", + "description": "Start time of the candle cycle, opening price, closing price, highest price, Lowest price, Transaction amount, Transaction volume" + } + } + } + }, + "required": [ + "code", + "data" + ] + }, + "description": "", + "contentType": "json", + "mediaType": "" + } + ], + "responseExamples": [ + { + "name": "Success", + "data": "{\n \"code\": \"200000\",\n \"data\": [\n [\n \"1566789720\",\n \"10411.5\",\n \"10401.9\",\n \"10411.5\",\n \"10396.3\",\n \"29.11357276\",\n \"302889.301529914\"\n ],\n [\n \"1566789660\",\n \"10416\",\n \"10411.5\",\n \"10422.3\",\n \"10411.5\",\n \"15.61781842\",\n \"162703.708997029\"\n ],\n [\n \"1566789600\",\n \"10408.6\",\n \"10416\",\n \"10416\",\n \"10405.4\",\n \"12.45584973\",\n \"129666.51508559\"\n ]\n ]\n}", + "responseId": 10327, + "ordering": 1 + } + ], + "requestBody": { + "type": "none", + "parameters": [], + "jsonSchema": { + "type": "object", + "properties": {} + }, + "mediaType": "" + }, + "description": ":::info[Description]\nGet the Kline of the symbol. Data are returned in grouped buckets based on requested type.\nFor each query, the system would return at most 1500 pieces of data. To obtain more data, please page the data by time.\n:::\n\n:::tip[Tips]\nKlines data may be incomplete. No data is published for intervals where there are no ticks.\n:::\n", + "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Spot\",\"api-channel\":\"Public\",\"api-permission\":\"NULL\",\"api-rate-limit-pool\":\"Public\",\"sdk-service\":\"Spot\",\"sdk-sub-service\":\"Market\",\"sdk-method-name\":\"getKlines\",\"sdk-method-description\":\"Get the Kline of the symbol. Data are returned in grouped buckets based on requested type. For each query, the system would return at most 1500 pieces of data. To obtain more data, please page the data by time.\",\"api-rate-limit\":3}" + } + }, + { + "name": "Get Part OrderBook", + "api": { + "id": "3470165", + "method": "get", + "path": "/api/v1/market/orderbook/level2_{size}", + "parameters": { + "query": [ + { + "id": "AwnkwQxRMq", + "name": "symbol", + "required": true, + "description": "symbol", + "example": "BTC-USDT", + "type": "string", + "enable": true + } + ], + "path": [ + { + "id": "size#0", + "name": "size", + "required": true, + "description": "Get the depth layer, optional value: 20, 100", + "example": "20", + "type": "integer", + "schema": { + "type": "integer", + "enum": [ + 20, + 100 + ], + "format": "int32", + "x-api-enum": [ + { + "value": 20, + "name": "size", + "description": "size" + }, + { + "value": 100, + "name": "size", + "description": "size" + } + ] + }, + "enable": true + } + ], + "cookie": [], + "header": [] + }, + "responses": [ + { + "id": "10329", + "code": 200, + "name": "OK", + "headers": [], + "jsonSchema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "object", + "properties": { + "time": { + "type": "integer", + "description": "Timestamp(millisecond)", + "format": "int64" }, - "SNX": { - "type": "string" + "sequence": { + "type": "string", + "description": "Sequence number" }, - "NXRA": { - "type": "string" + "bids": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "string", + "description": "Price, Size" + } + }, + "description": "bids, from high to low" }, - "TAIKO": { - "type": "string" + "asks": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "string", + "description": "Price, Size" + } + }, + "description": "asks, from low to high" + } + }, + "required": [ + "sequence", + "bids", + "asks", + "time" + ] + } + }, + "required": [ + "code", + "data" + ] + }, + "description": "", + "contentType": "json", + "mediaType": "" + } + ], + "responseExamples": [ + { + "name": "Success", + "data": "{\n \"code\": \"200000\",\n \"data\": {\n \"time\": 1729176273859,\n \"sequence\": \"14610502970\",\n \"bids\": [\n [\n \"66976.4\",\n \"0.69109872\"\n ],\n [\n \"66976.3\",\n \"0.14377\"\n ]\n ],\n \"asks\": [\n [\n \"66976.5\",\n \"0.05408199\"\n ],\n [\n \"66976.8\",\n \"0.0005\"\n ]\n ]\n }\n}", + "responseId": 10329, + "ordering": 1 + } + ], + "requestBody": { + "type": "none", + "parameters": [], + "jsonSchema": { + "type": "object", + "properties": {} + }, + "mediaType": "" + }, + "description": ":::info[Description]\nQuery for part orderbook depth data. (aggregated by price)\n\nYou are recommended to request via this endpoint as the system reponse would be faster and cosume less traffic.\n:::", + "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Spot\",\"api-channel\":\"Public\",\"api-permission\":\"NULL\",\"api-rate-limit-pool\":\"Public\",\"sdk-service\":\"Spot\",\"sdk-sub-service\":\"Market\",\"sdk-method-name\":\"getPartOrderBook\",\"sdk-method-description\":\"Query for part orderbook depth data. (aggregated by price) You are recommended to request via this endpoint as the system reponse would be faster and cosume less traffic.\",\"api-rate-limit\":2}" + } + }, + { + "name": "Get Full OrderBook", + "api": { + "id": "3470164", + "method": "get", + "path": "/api/v3/market/orderbook/level2", + "parameters": { + "query": [ + { + "id": "AwnkwQxRMq", + "name": "symbol", + "required": true, + "description": "symbol", + "example": "BTC-USDT", + "type": "string", + "enable": true + } + ], + "path": [], + "cookie": [], + "header": [] + }, + "responses": [ + { + "id": "10328", + "code": 200, + "name": "OK", + "headers": [], + "jsonSchema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "object", + "properties": { + "time": { + "type": "integer", + "description": "Timestamp(millisecond)", + "format": "int64" }, - "AVAX3L": { - "type": "string" + "sequence": { + "type": "string", + "description": "Sequence number" }, - "L3": { - "type": "string" + "bids": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "string", + "description": "Price, Size" + } + }, + "description": "bids, from high to low" }, - "API3": { - "type": "string" - }, - "XRP3S": { + "asks": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "string", + "description": "Price, Size" + } + }, + "description": "asks, from low to high" + } + }, + "required": [ + "time", + "sequence", + "bids", + "asks" + ] + } + }, + "required": [ + "code", + "data" + ] + }, + "description": "", + "contentType": "json", + "mediaType": "" + } + ], + "responseExamples": [ + { + "name": "Success", + "data": "{\n \"code\": \"200000\",\n \"data\": {\n \"time\": 1729176273859,\n \"sequence\": \"14610502970\",\n \"bids\": [\n [\n \"66976.4\",\n \"0.69109872\"\n ],\n [\n \"66976.3\",\n \"0.14377\"\n ]\n ],\n \"asks\": [\n [\n \"66976.5\",\n \"0.05408199\"\n ],\n [\n \"66976.8\",\n \"0.0005\"\n ]\n ]\n }\n}", + "responseId": 10328, + "ordering": 1 + } + ], + "requestBody": { + "type": "none", + "parameters": [], + "jsonSchema": { + "type": "object", + "properties": {} + }, + "mediaType": "" + }, + "description": ":::info[Description]\nQuery for Full orderbook depth data. (aggregated by price)\n\nIt is generally used by professional traders because it uses more server resources and traffic, and we have strict access rate limit control.\n\nTo maintain up-to-date Order Book, please use Websocket incremental feed after retrieving the OrderBook.\n:::", + "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"General\",\"api-rate-limit-pool\":\"Spot\",\"sdk-service\":\"Spot\",\"sdk-sub-service\":\"Market\",\"sdk-method-name\":\"getFullOrderBook\",\"sdk-method-description\":\"Query for Full orderbook depth data. (aggregated by price) It is generally used by professional traders because it uses more server resources and traffic, and we have strict access rate limit control. To maintain up-to-date Order Book, please use Websocket incremental feed after retrieving the OrderBook.\",\"api-rate-limit\":3}" + } + }, + { + "name": "Get Fiat Price", + "api": { + "id": "3470153", + "method": "get", + "path": "/api/v1/prices", + "parameters": { + "path": [], + "query": [ + { + "id": "awyky894vh", + "name": "base", + "required": false, + "description": "Ticker symbol of a base currency,eg.USD,EUR. Default is USD", + "example": "", + "type": "string", + "schema": { + "type": "string", + "default": "USD", + "examples": [ + "USD", + "EUR" + ] + } + }, + { + "id": "Ak1pifFhEW", + "name": "currencies", + "required": false, + "description": "Comma-separated cryptocurrencies to be converted into fiat, e.g.: BTC,ETH, etc. Default to return the fiat price of all currencies.", + "example": "", + "type": "string" + } + ], + "cookie": [], + "header": [] + }, + "responses": [ + { + "id": "10317", + "code": 200, + "name": "OK", + "headers": [], + "jsonSchema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "object", + "properties": { + "AGLD": { "type": "string" }, - "QKC": { + "DFI": { "type": "string" }, - "AVAX3S": { + "PYTHUP": { "type": "string" }, - "ROSE": { + "ISLM": { "type": "string" }, - "SATS": { + "NEAR": { "type": "string" }, - "BMX": { + "AIOZ": { "type": "string" }, - "PORTAL": { + "AUDIO": { "type": "string" }, - "TOMI": { + "BBL": { "type": "string" }, - "XRP3L": { + "WLD": { "type": "string" }, - "SOL": { + "HNT": { "type": "string" }, - "SON": { + "ETHFI": { "type": "string" }, - "BNC": { + "DMAIL": { "type": "string" }, - "SOCIAL": { + "OPUP": { "type": "string" }, - "CGPT": { + "VET3S": { "type": "string" }, - "CELR": { + "MANA3S": { "type": "string" }, - "BNB": { + "TIDAL": { "type": "string" }, - "OGN": { + "HALO": { "type": "string" }, - "CELO": { + "OPUL": { "type": "string" }, - "AUCTION": { + "MANA3L": { "type": "string" }, - "MANTA": { + "DGB": { "type": "string" }, - "LAYER": { + "AA": { "type": "string" }, - "AERO": { + "BCH": { "type": "string" }, - "CETUS": { + "GMEE": { "type": "string" }, - "LL": { + "JST": { "type": "string" }, - "SPA": { + "PBUX": { "type": "string" }, - "PYTHDOWN": { + "AR": { "type": "string" }, - "NEIROCTO": { + "SEI": { "type": "string" }, - "UTK": { + "PSTAKE": { "type": "string" }, - "GMRX": { + "LMWR": { "type": "string" }, - "BOB": { + "UNFIDOWN": { "type": "string" }, - "HOTCROSS": { + "BB": { "type": "string" }, - "AERGO": { + "JTO": { "type": "string" }, - "MOCA": { + "WEMIX": { "type": "string" }, - "SQD": { + "G": { "type": "string" }, - "MV": { + "MARSH": { "type": "string" }, - "BNB3L": { + "BN": { "type": "string" }, - "BNB3S": { + "FLIP": { "type": "string" }, - "GALAX3L": { + "FLR": { "type": "string" }, - "KAI": { + "BIGTIME": { "type": "string" }, - "SQR": { + "FLY": { "type": "string" }, - "GALAX3S": { + "T": { "type": "string" }, - "EGLD": { + "W": { "type": "string" }, - "ZBCN": { + "BDX": { "type": "string" }, - "KAS": { + "BABYDOGE": { "type": "string" }, - "MEW": { + "SFP": { "type": "string" }, - "PUNDIX": { + "DIA": { "type": "string" }, - "LOOKS": { + "ISME": { "type": "string" }, - "FXS": { + "LYM": { "type": "string" }, - "BOSON": { + "VET3L": { "type": "string" }, - "BRISE": { + "JUP": { "type": "string" }, - "AEVO": { + "LYX": { "type": "string" }, - "FLUX": { + "AIEPK": { "type": "string" }, - "PRCL": { + "SILLY": { "type": "string" }, - "UNFIUP": { + "SCPT": { "type": "string" }, - "SEIDOWN": { + "WOO": { "type": "string" }, - "DOAI": { + "BLUR": { "type": "string" }, - "QNT": { + "STRK": { "type": "string" }, - "REDO": { + "BFC": { "type": "string" }, - "STRIKE": { + "DC": { "type": "string" }, - "ETHW": { + "KARATE": { "type": "string" }, - "OM": { + "SUSHI3L": { "type": "string" }, - "OP": { + "NETVR": { "type": "string" }, - "WHALE": { + "WAVES": { "type": "string" }, - "1CAT": { + "LITH": { "type": "string" }, - "NEON": { + "HAPI": { "type": "string" }, - "GTAI": { + "SUSHI3S": { "type": "string" }, - "SSV": { + "CEEK": { "type": "string" }, - "ETH2": { + "FLOKI": { "type": "string" }, - "KCS": { + "SHR": { "type": "string" }, - "ARPA": { + "SAND": { "type": "string" }, - "ARTFI": { + "TURT": { "type": "string" }, - "BRL": { + "UMA": { "type": "string" }, - "ALEX": { + "BEPRO": { "type": "string" }, - "STG": { + "SCRT": { "type": "string" }, - "SHIB": { + "TUSD": { "type": "string" }, - "IOTX": { + "COOKIE": { "type": "string" }, - "OLE": { + "LRDS": { "type": "string" }, - "KDA": { + "SIN": { "type": "string" }, - "CERE": { + "OAS": { "type": "string" }, - "DOCK": { + "ROOT": { "type": "string" }, - "STX": { + "ADA3L": { "type": "string" }, - "OLT": { + "TIAUP": { "type": "string" }, - "QI": { + "HTR": { "type": "string" }, - "SDAO": { + "UNB": { "type": "string" }, - "BLAST": { + "UNA": { "type": "string" }, - "LINK3S": { + "HARD": { "type": "string" }, - "IOST": { + "G3": { "type": "string" }, - "SUI": { + "ADA3S": { "type": "string" }, - "CAKE": { + "MYRO": { "type": "string" }, - "BSW": { + "HTX": { "type": "string" }, - "OMG": { + "FT": { "type": "string" }, - "VOLT": { + "BTCDOWN": { "type": "string" }, - "LINK3L": { + "UNI": { "type": "string" }, - "GEEQ": { + "FX": { "type": "string" }, - "PYUSD": { + "OBI": { "type": "string" }, - "SUN": { + "UNO": { "type": "string" }, - "TOWER": { + "WRX": { "type": "string" }, - "BTC": { + "TIADOWN": { "type": "string" }, - "IOTA": { + "ETHDOWN": { "type": "string" }, - "REEF": { + "WELL": { "type": "string" }, - "TRIAS": { + "SWFTC": { "type": "string" }, - "KEY": { + "SKL": { "type": "string" }, - "ETH3L": { + "UOS": { "type": "string" }, - "BTT": { + "AIPAD": { "type": "string" }, - "ONE": { + "BRETT": { "type": "string" }, - "RENDER": { + "SKY": { "type": "string" }, - "ETH3S": { + "FRM": { "type": "string" }, - "ANKR": { + "VISION": { "type": "string" }, - "ALGO": { + "LENDS": { "type": "string" }, - "SYLO": { + "SLF": { "type": "string" }, - "ZCX": { + "BULL": { "type": "string" }, - "SD": { + "FLOW": { "type": "string" }, - "ONT": { + "ODDZ": { "type": "string" }, - "MJT": { + "SLN": { "type": "string" }, - "DYM": { + "UPO": { "type": "string" }, - "DYP": { + "SLP": { "type": "string" }, - "BAKEUP": { + "ID": { "type": "string" }, - "OOE": { + "SLIM": { "type": "string" }, - "ZELIX": { + "SPOT": { "type": "string" }, - "DOGE3L": { + "DOP": { "type": "string" }, - "ARTY": { + "ISSP": { "type": "string" }, - "QORPO": { + "UQC": { "type": "string" }, - "ICE": { + "IO": { "type": "string" }, - "NOTAI": { + "DOT": { "type": "string" }, - "DOGE3S": { + "1INCH": { "type": "string" }, - "NAKA": { + "SMH": { "type": "string" }, - "GALAX": { + "MAK": { "type": "string" }, - "MKR": { + "TOKO": { "type": "string" }, - "DODO": { + "TURBO": { "type": "string" }, - "ICP": { + "UNFI": { "type": "string" }, - "ZEC": { + "MAN": { "type": "string" }, - "ZEE": { + "EVER": { "type": "string" }, - "ICX": { + "FTM": { "type": "string" }, - "KMNO": { + "SHRAP": { "type": "string" }, - "TT": { + "MAV": { "type": "string" }, - "DOT3L": { + "MAX": { "type": "string" }, - "XAI": { + "DPR": { "type": "string" }, - "ZEN": { + "FTT": { "type": "string" }, - "DOGE": { + "ARKM": { "type": "string" }, - "ALPHA": { + "ATOM": { "type": "string" }, - "DUSK": { + "PENDLE": { "type": "string" }, - "DOT3S": { + "QUICK": { "type": "string" }, - "SXP": { + "BLZ": { "type": "string" }, - "HBAR": { + "BOBA": { "type": "string" }, - "SYNT": { + "MBL": { "type": "string" }, - "ZEX": { + "OFN": { "type": "string" }, - "BONDLY": { + "UNIO": { "type": "string" }, - "MLK": { + "SNS": { "type": "string" }, - "KICKS": { + "SNX": { "type": "string" }, - "PEPE": { + "NXRA": { "type": "string" }, - "OUSD": { + "TAIKO": { "type": "string" }, - "LUNCDOWN": { + "AVAX3L": { "type": "string" }, - "DOGS": { + "L3": { "type": "string" }, - "REV3L": { + "API3": { "type": "string" }, - "CTSI": { + "XRP3S": { "type": "string" }, - "C98": { + "QKC": { "type": "string" }, - "OSMO": { + "AVAX3S": { "type": "string" }, - "NTRN": { + "ROSE": { "type": "string" }, - "CFX2S": { + "SATS": { "type": "string" }, - "SYN": { + "BMX": { "type": "string" }, - "VIDT": { + "PORTAL": { "type": "string" }, - "SYS": { + "TOMI": { "type": "string" }, - "GAS": { + "XRP3L": { "type": "string" }, - "BOME": { + "SOL": { "type": "string" }, - "COMBO": { + "SON": { "type": "string" }, - "XCH": { + "BNC": { "type": "string" }, - "VR": { + "SOCIAL": { "type": "string" }, - "CFX2L": { + "CGPT": { "type": "string" }, - "VSYS": { + "CELR": { "type": "string" }, - "PANDORA": { + "BNB": { "type": "string" }, - "THETA": { + "OGN": { "type": "string" }, - "XCN": { + "CELO": { "type": "string" }, - "NEXG": { + "AUCTION": { "type": "string" }, - "MELOS": { + "MANTA": { "type": "string" }, - "XCV": { + "LAYER": { "type": "string" }, - "ORN": { + "AERO": { "type": "string" }, - "WLKN": { + "CETUS": { "type": "string" }, - "AAVE": { + "LL": { "type": "string" }, - "MNT": { + "SPA": { "type": "string" }, - "BONK": { + "PYTHDOWN": { "type": "string" }, - "PERP": { + "NEIROCTO": { "type": "string" }, - "XDC": { + "UTK": { "type": "string" }, - "MNW": { + "GMRX": { "type": "string" }, - "XDB": { + "BOB": { "type": "string" }, - "BOND": { + "HOTCROSS": { "type": "string" }, - "SUIA": { + "AERGO": { "type": "string" }, - "MOG": { + "MOCA": { "type": "string" }, - "SUTER": { + "SQD": { "type": "string" }, - "TIME": { + "MV": { "type": "string" }, - "RACA": { + "BNB3L": { "type": "string" }, - "BICO": { + "BNB3S": { "type": "string" }, - "MON": { + "GALAX3L": { "type": "string" }, - "SWEAT": { + "KAI": { "type": "string" }, - "MOXIE": { + "SQR": { "type": "string" }, - "BABYBNB": { + "GALAX3S": { "type": "string" }, - "IGU": { + "EGLD": { "type": "string" }, - "HMSTR": { + "ZBCN": { "type": "string" }, - "XEC": { + "KAS": { "type": "string" }, - "MONI": { + "MEW": { "type": "string" }, - "XR": { + "PUNDIX": { "type": "string" }, - "PEOPLE": { + "LOOKS": { "type": "string" }, - "PUMLX": { + "FXS": { "type": "string" }, - "ZIL": { + "BOSON": { "type": "string" }, - "WLDDOWN": { + "BRISE": { + "type": "string" + }, + "AEVO": { + "type": "string" + }, + "FLUX": { + "type": "string" + }, + "PRCL": { + "type": "string" + }, + "UNFIUP": { + "type": "string" + }, + "SEIDOWN": { + "type": "string" + }, + "DOAI": { + "type": "string" + }, + "QNT": { + "type": "string" + }, + "REDO": { + "type": "string" + }, + "STRIKE": { + "type": "string" + }, + "ETHW": { + "type": "string" + }, + "OM": { + "type": "string" + }, + "OP": { + "type": "string" + }, + "WHALE": { + "type": "string" + }, + "1CAT": { + "type": "string" + }, + "NEON": { + "type": "string" + }, + "GTAI": { + "type": "string" + }, + "SSV": { + "type": "string" + }, + "ETH2": { + "type": "string" + }, + "KCS": { + "type": "string" + }, + "ARPA": { + "type": "string" + }, + "ARTFI": { + "type": "string" + }, + "BRL": { + "type": "string" + }, + "ALEX": { + "type": "string" + }, + "STG": { + "type": "string" + }, + "SHIB": { + "type": "string" + }, + "IOTX": { + "type": "string" + }, + "OLE": { + "type": "string" + }, + "KDA": { + "type": "string" + }, + "CERE": { + "type": "string" + }, + "DOCK": { + "type": "string" + }, + "STX": { + "type": "string" + }, + "OLT": { + "type": "string" + }, + "QI": { + "type": "string" + }, + "SDAO": { + "type": "string" + }, + "BLAST": { + "type": "string" + }, + "LINK3S": { + "type": "string" + }, + "IOST": { + "type": "string" + }, + "SUI": { + "type": "string" + }, + "CAKE": { + "type": "string" + }, + "BSW": { + "type": "string" + }, + "OMG": { + "type": "string" + }, + "VOLT": { + "type": "string" + }, + "LINK3L": { + "type": "string" + }, + "GEEQ": { + "type": "string" + }, + "PYUSD": { + "type": "string" + }, + "SUN": { + "type": "string" + }, + "TOWER": { + "type": "string" + }, + "BTC": { + "type": "string" + }, + "IOTA": { + "type": "string" + }, + "REEF": { + "type": "string" + }, + "TRIAS": { + "type": "string" + }, + "KEY": { + "type": "string" + }, + "ETH3L": { + "type": "string" + }, + "BTT": { + "type": "string" + }, + "ONE": { + "type": "string" + }, + "RENDER": { + "type": "string" + }, + "ETH3S": { + "type": "string" + }, + "ANKR": { + "type": "string" + }, + "ALGO": { + "type": "string" + }, + "SYLO": { + "type": "string" + }, + "ZCX": { + "type": "string" + }, + "SD": { + "type": "string" + }, + "ONT": { + "type": "string" + }, + "MJT": { + "type": "string" + }, + "DYM": { + "type": "string" + }, + "DYP": { + "type": "string" + }, + "BAKEUP": { + "type": "string" + }, + "OOE": { + "type": "string" + }, + "ZELIX": { + "type": "string" + }, + "DOGE3L": { + "type": "string" + }, + "ARTY": { + "type": "string" + }, + "QORPO": { + "type": "string" + }, + "ICE": { + "type": "string" + }, + "NOTAI": { + "type": "string" + }, + "DOGE3S": { + "type": "string" + }, + "NAKA": { + "type": "string" + }, + "GALAX": { + "type": "string" + }, + "MKR": { + "type": "string" + }, + "DODO": { + "type": "string" + }, + "ICP": { + "type": "string" + }, + "ZEC": { + "type": "string" + }, + "ZEE": { + "type": "string" + }, + "ICX": { + "type": "string" + }, + "KMNO": { + "type": "string" + }, + "TT": { + "type": "string" + }, + "DOT3L": { + "type": "string" + }, + "XAI": { + "type": "string" + }, + "ZEN": { + "type": "string" + }, + "DOGE": { + "type": "string" + }, + "ALPHA": { + "type": "string" + }, + "DUSK": { + "type": "string" + }, + "DOT3S": { + "type": "string" + }, + "SXP": { + "type": "string" + }, + "HBAR": { + "type": "string" + }, + "SYNT": { + "type": "string" + }, + "ZEX": { + "type": "string" + }, + "BONDLY": { + "type": "string" + }, + "MLK": { + "type": "string" + }, + "KICKS": { + "type": "string" + }, + "PEPE": { + "type": "string" + }, + "OUSD": { + "type": "string" + }, + "LUNCDOWN": { + "type": "string" + }, + "DOGS": { + "type": "string" + }, + "REV3L": { + "type": "string" + }, + "CTSI": { + "type": "string" + }, + "C98": { + "type": "string" + }, + "OSMO": { + "type": "string" + }, + "NTRN": { + "type": "string" + }, + "CFX2S": { + "type": "string" + }, + "SYN": { + "type": "string" + }, + "VIDT": { + "type": "string" + }, + "SYS": { + "type": "string" + }, + "GAS": { + "type": "string" + }, + "BOME": { + "type": "string" + }, + "COMBO": { + "type": "string" + }, + "XCH": { + "type": "string" + }, + "VR": { + "type": "string" + }, + "CFX2L": { + "type": "string" + }, + "VSYS": { + "type": "string" + }, + "PANDORA": { + "type": "string" + }, + "THETA": { + "type": "string" + }, + "XCN": { + "type": "string" + }, + "NEXG": { + "type": "string" + }, + "MELOS": { + "type": "string" + }, + "XCV": { + "type": "string" + }, + "ORN": { + "type": "string" + }, + "WLKN": { + "type": "string" + }, + "AAVE": { + "type": "string" + }, + "MNT": { + "type": "string" + }, + "BONK": { + "type": "string" + }, + "PERP": { + "type": "string" + }, + "XDC": { + "type": "string" + }, + "MNW": { + "type": "string" + }, + "XDB": { + "type": "string" + }, + "BOND": { + "type": "string" + }, + "SUIA": { + "type": "string" + }, + "MOG": { + "type": "string" + }, + "SUTER": { + "type": "string" + }, + "TIME": { + "type": "string" + }, + "RACA": { + "type": "string" + }, + "BICO": { + "type": "string" + }, + "MON": { + "type": "string" + }, + "SWEAT": { + "type": "string" + }, + "MOXIE": { + "type": "string" + }, + "BABYBNB": { + "type": "string" + }, + "IGU": { + "type": "string" + }, + "HMSTR": { + "type": "string" + }, + "XEC": { + "type": "string" + }, + "MONI": { + "type": "string" + }, + "XR": { + "type": "string" + }, + "PEOPLE": { + "type": "string" + }, + "PUMLX": { + "type": "string" + }, + "ZIL": { + "type": "string" + }, + "WLDDOWN": { "type": "string" }, "VAI": { @@ -9700,3407 +11656,136 @@ "LKI", "AVA", "NOM", - "MAPO", - "PEPEUP", - "STRAX", - "NOT", - "ZERC", - "BCUT", - "MASA", - "WAN", - "WAT", - "WAX", - "MASK", - "EOS3L", - "IDEA", - "EOS3S", - "YFI", - "MOODENG", - "XCUR", - "HYDRA", - "POPCAT", - "LQTY", - "PIXEL", - "LMR", - "ZETA", - "YGG", - "AXS", - "BCHSV", - "NRN", - "FTON", - "COMP", - "XPRT", - "HFT", - "UXLINK", - "STAMP", - "RUNE", - "ZEUS", - "LTC3L", - "DAPP", - "FORTH", - "ALPINE", - "SENSO", - "LTC3S", - "DEXE", - "GOAL", - "AVAX", - "LISTA", - "AMPL", - "WORK", - "BRWL", - "BANANA", - "PUSH", - "WEN", - "NEIRO", - "BTCUP", - "SOL3S", - "BRAWL", - "LAY3R", - "LPT", - "GODS", - "SAND3S", - "RDNT", - "SOL3L", - "NIBI", - "NUM", - "PYR", - "DAG", - "DAI", - "HIP", - "DAO", - "AVAIL", - "DAR", - "FET", - "FCON", - "XAVA", - "LRC", - "UNI3S", - "POKT", - "DASH", - "BAKEDOWN", - "POLC", - "CIRUS", - "UNI3L", - "NWC", - "POLK", - "LSD", - "MARS4", - "LSK", - "BLOCK", - "ANALOS", - "SAFE", - "DCK", - "LSS", - "DCR", - "LIKE", - "DATA", - "WIF", - "BLOK", - "LTC", - "METIS", - "WIN", - "HLG", - "LTO", - "DYDX", - "ARB3S", - "MUBI", - "ARB3L", - "RBTC1", - "POND", - "LINA", - "MYRIA", - "LINK", - "QTUM", - "TUNE", - "UFO", - "CYBER", - "WILD", - "POLS", - "NYM", - "FIL", - "BAL", - "SCA", - "STND", - "WMTX", - "SCLP", - "MANEKI", - "BAT", - "AKRO", - "FTM3L", - "BAX", - "FTM3S", - "COTI" - ] - } - }, - "required": [ - "code", - "data" - ] - }, - "description": "", - "contentType": "json", - "mediaType": "" - } - ], - "responseExamples": [ - { - "name": "Success", - "data": "{\"code\":\"200000\",\"data\":{\"AGLD\":\"1.1174410000000001\",\"DFI\":\"0.0168915500000000\",\"PYTHUP\":\"0.0397880960000000\",\"ISLM\":\"0.0606196750000000\",\"NEAR\":\"4.7185395500000000\",\"AIOZ\":\"0.4862867350000000\",\"AUDIO\":\"0.1219390000000000\",\"BBL\":\"0.0067766100000000\",\"WLD\":\"2.2893547500000000\",\"HNT\":\"5.8990489999999984\",\"ETHFI\":\"1.5892050000000000\",\"DMAIL\":\"0.2726636000000000\",\"OPUP\":\"0.0986506500000000\",\"VET3S\":\"0.0003700448850000\",\"MANA3S\":\"0.0006056970000000\",\"TIDAL\":\"0.0001154422500000\",\"HALO\":\"0.0058270850000000\",\"OPUL\":\"0.0839480050000000\",\"MANA3L\":\"0.0029569407900000\",\"DGB\":\"0.0066556705000000\",\"AA\":\"0.2406796000000000\",\"BCH\":\"366.2167999999996484\",\"GMEE\":\"0.0113333305000000\",\"JST\":\"0.0302348750000000\",\"PBUX\":\"0.0208795550000000\",\"AR\":\"18.5457224999999909\",\"SEI\":\"0.4332832500000000\",\"PSTAKE\":\"0.0493153300000000\",\"LMWR\":\"0.1618190500000000\",\"UNFIDOWN\":\"0.0062058955000000\",\"BB\":\"0.3245376500000000\",\"JTO\":\"2.1239375000000002\",\"WEMIX\":\"0.7916040000000000\",\"G\":\"0.0324037900000000\",\"MARSH\":\"0.0617591050000000\",\"BN\":\"0.0036961510000000\",\"FLIP\":\"1.0976509000000000\",\"FLR\":\"0.0144827550000000\",\"BIGTIME\":\"0.1238780300000000\",\"FLY\":\"0.0005157420000000\",\"T\":\"0.0233483200000000\",\"W\":\"0.2865566500000000\",\"BDX\":\"0.0774012800000000\",\"BABYDOGE\":\"0.0000000029375305\",\"SFP\":\"0.7256370000000000\",\"DIA\":\"0.9179408000000000\",\"ISME\":\"0.0022388800000000\",\"LYM\":\"0.0010155919500000\",\"VET3L\":\"0.0000289755050000\",\"JUP\":\"0.8230882500000000\",\"LYX\":\"1.4501745500000001\",\"AIEPK\":\"0.0050094940000000\",\"SILLY\":\"0.0159420250000000\",\"SCPT\":\"0.0122038950000000\",\"WOO\":\"0.1796601250000000\",\"BLUR\":\"0.2462768000000000\",\"STRK\":\"0.3963117450000000\",\"BFC\":\"0.0383608100000000\",\"DC\":\"0.0003097450500000\",\"KARATE\":\"0.0007296350000000\",\"SUSHI3L\":\"0.5115441000000000\",\"NETVR\":\"0.0976111700000000\",\"WAVES\":\"1.0806594000000000\",\"LITH\":\"0.0001520239500000\",\"HAPI\":\"8.6533711499999987\",\"SUSHI3S\":\"1.2752620500000000\",\"CEEK\":\"0.0294852500000000\",\"FLOKI\":\"0.0001414292500000\",\"SHR\":\"0.0012463765000000\",\"SAND\":\"0.2566616050000000\",\"TURT\":\"0.0020889550000000\",\"UMA\":\"2.5207390000000000\",\"BEPRO\":\"0.0003955021500000\",\"SCRT\":\"0.1995002000000000\",\"TUSD\":\"0.9945025000000000\",\"COOKIE\":\"0.0220089900000000\",\"LRDS\":\"0.6218889000000000\",\"SIN\":\"0.0033633175000000\",\"OAS\":\"0.0331933950000000\",\"ROOT\":\"0.0183108400000000\",\"ADA3L\":\"0.0046396790000000\",\"TIAUP\":\"0.1228385500000000\",\"HTR\":\"0.0353023400000000\",\"UNB\":\"0.0003837080500000\",\"UNA\":\"0.0164917500000000\",\"HARD\":\"0.1087056200000000\",\"G3\":\"0.0502648550000000\",\"ADA3S\":\"0.0006191202850000\",\"MYRO\":\"0.1071863800000000\",\"HTX\":\"0.0000013693150000\",\"FT\":\"0.3585206500000000\",\"BTCDOWN\":\"0.1065467000000000\",\"UNI\":\"7.3571195999999993\",\"FX\":\"0.1379310000000000\",\"OBI\":\"0.0079030465000000\",\"UNO\":\"0.0137131400000000\",\"WRX\":\"0.1221389000000000\",\"TIADOWN\":\"0.0000914642450000\",\"ETHDOWN\":\"0.1306346500000000\",\"WELL\":\"0.0471244260000000\",\"SWFTC\":\"0.0028966509500000\",\"SKL\":\"0.0362418700000000\",\"UOS\":\"0.0867765900000000\",\"AIPAD\":\"0.0478660550000000\",\"BRETT\":\"0.1037481000000000\",\"SKY\":\"0.0520139800000000\",\"FRM\":\"0.0153123400000000\",\"VISION\":\"0.0014451770500000\",\"LENDS\":\"0.0047276350000000\",\"SLF\":\"0.3318340000000000\",\"BULL\":\"0.0023988000000000\",\"FLOW\":\"0.5372312500000000\",\"ODDZ\":\"0.0063368300000000\",\"SLN\":\"0.2804597000000000\",\"UPO\":\"0.0440779500000000\",\"SLP\":\"0.0023997995000000\",\"ID\":\"0.3718140000000000\",\"SLIM\":\"0.0906446550000000\",\"SPOT\":\"0.0021289350000000\",\"DOP\":\"0.0023028480000000\",\"ISSP\":\"0.0000874562500000\",\"UQC\":\"3.2339822000000003\",\"IO\":\"1.8185902499999999\",\"DOT\":\"4.2022978000000005\",\"1INCH\":\"0.2645676500000000\",\"SMH\":\"0.3448275000000000\",\"MAK\":\"0.0396701550000000\",\"TOKO\":\"0.0005923037000000\",\"TURBO\":\"0.0108085930000000\",\"UNFI\":\"2.8555714999999996\",\"MAN\":\"0.0210764565000000\",\"EVER\":\"0.0332733550000000\",\"FTM\":\"0.7259068650000000\",\"SHRAP\":\"0.0476361700000000\",\"MAV\":\"0.1738130500000000\",\"MAX\":\"0.2864966800000000\",\"DPR\":\"0.0018240875000000\",\"FTT\":\"2.0559715000000002\",\"ARKM\":\"1.7444273499999999\",\"ATOM\":\"4.2954512000000002\",\"PENDLE\":\"4.1554212500000007\",\"QUICK\":\"0.0365317250000000\",\"BLZ\":\"0.1217191100000000\",\"BOBA\":\"0.2014092450000000\",\"MBL\":\"0.0027856065000000\",\"OFN\":\"0.1252373500000000\",\"UNIO\":\"0.0025487250000000\",\"SNS\":\"0.0200899500000000\",\"SNX\":\"1.4282854999999999\",\"NXRA\":\"0.0272763550000000\",\"TAIKO\":\"1.4392800000000001\",\"AVAX3L\":\"0.1410875109550000\",\"L3\":\"0.0608395650000000\",\"API3\":\"1.3728132500000001\",\"XRP3S\":\"0.0028095945000000\",\"QKC\":\"0.0085157400000000\",\"AVAX3S\":\"0.5148424500000000\",\"ROSE\":\"0.0693453100000000\",\"SATS\":\"0.0000002701648500\",\"BMX\":\"0.3100449000000000\",\"PORTAL\":\"0.2811593500000000\",\"TOMI\":\"0.0309045400000000\",\"XRP3L\":\"2.1586201500000002\",\"SOL\":\"151.7250995000003583\",\"SON\":\"0.0002421788500000\",\"BNC\":\"0.1882058500000000\",\"SOCIAL\":\"0.0026486750000000\",\"CGPT\":\"0.1305147100000000\",\"CELR\":\"0.0127736100000000\",\"BNB\":\"591.0973035000118935\",\"OGN\":\"0.0852573500000000\",\"CELO\":\"0.7711142500000000\",\"AUCTION\":\"13.1634150000000014\",\"MANTA\":\"0.7564216000000000\",\"LAYER\":\"0.0372713550000000\",\"AERO\":\"1.3783104999999999\",\"CETUS\":\"0.1808295400000000\",\"LL\":\"0.0201199350000000\",\"SPA\":\"0.0067426270000000\",\"PYTHDOWN\":\"0.0011834080000000\",\"NEIROCTO\":\"0.0019964013000000\",\"UTK\":\"0.0365217300000000\",\"GMRX\":\"0.0007386305000000\",\"BOB\":\"0.0000380619595000\",\"HOTCROSS\":\"0.0056491740000000\",\"AERGO\":\"0.1007595950000000\",\"MOCA\":\"0.0783608000000000\",\"SQD\":\"0.0380809500000000\",\"MV\":\"0.0081359300000000\",\"BNB3L\":\"0.2761618500000000\",\"BNB3S\":\"0.0008545725000000\",\"GALAX3L\":\"0.0057571999600000\",\"KAI\":\"0.0020080954500000\",\"SQR\":\"0.0470764500000000\",\"GALAX3S\":\"0.1933033000000000\",\"EGLD\":\"25.5272299999999713\",\"ZBCN\":\"0.0010404795000000\",\"KAS\":\"0.1216691350000000\",\"MEW\":\"0.0086176890000000\",\"PUNDIX\":\"0.4130933500000000\",\"LOOKS\":\"0.0392803500000000\",\"FXS\":\"1.9060465000000000\",\"BOSON\":\"0.2732633000000000\",\"BRISE\":\"0.0000000860569500\",\"AEVO\":\"0.3388305000000000\",\"FLUX\":\"0.5276360500000000\",\"PRCL\":\"0.1969015000000000\",\"UNFIUP\":\"0.0011654170000000\",\"SEIDOWN\":\"0.0442778500000000\",\"DOAI\":\"0.0052363805000000\",\"QNT\":\"65.4312679999998206\",\"REDO\":\"0.2837580500000000\",\"STRIKE\":\"6.8225869999999997\",\"ETHW\":\"3.2418782499999998\",\"OM\":\"1.5396797750000000\",\"OP\":\"1.6911539999999999\",\"WHALE\":\"0.8134930500000000\",\"1CAT\":\"0.0018460765000000\",\"NEON\":\"0.4446775500000000\",\"GTAI\":\"0.7786105000000000\",\"SSV\":\"21.2393749999999841\",\"ETH2\":\"2601.6678843156403923\",\"KCS\":\"8.7646155000000020\",\"ARPA\":\"0.0393882960000000\",\"ARTFI\":\"0.0141029450000000\",\"BRL\":\"0.1742807323452485\",\"ALEX\":\"0.0924537500000000\",\"STG\":\"0.2943527500000000\",\"SHIB\":\"0.0000178060925000\",\"IOTX\":\"0.0394202800000000\",\"OLE\":\"0.0171414250000000\",\"KDA\":\"0.5653172000000000\",\"CERE\":\"0.0022548720000000\",\"DOCK\":\"0.0018990500000000\",\"STX\":\"1.8157916500000000\",\"OLT\":\"0.0007596200000000\",\"QI\":\"0.0131754090000000\",\"SDAO\":\"0.2748625000000000\",\"BLAST\":\"0.0087636160000000\",\"LINK3S\":\"0.0000702948350000\",\"IOST\":\"0.0049745115000000\",\"SUI\":\"2.0589700000000000\",\"CAKE\":\"1.7941024999999999\",\"BSW\":\"0.0586706500000000\",\"OMG\":\"0.2597700500000000\",\"VOLT\":\"0.0000002716641000\",\"LINK3L\":\"1.3408292499999999\",\"GEEQ\":\"0.0385607100000000\",\"PYUSD\":\"0.9988003500000000\",\"SUN\":\"0.0186106900000000\",\"TOWER\":\"0.0014812590000000\",\"BTC\":\"67133.4165000832051564\",\"IOTA\":\"0.1189405000000000\",\"REEF\":\"0.0019960015000000\",\"TRIAS\":\"3.3683149999999998\",\"KEY\":\"0.0037594713240047\",\"ETH3L\":\"0.0003305946200000\",\"BTT\":\"0.0000009117439000\",\"ONE\":\"0.0132003965000000\",\"RENDER\":\"5.2263854999999995\",\"ETH3S\":\"0.5517240000000000\",\"ANKR\":\"0.0264867500000000\",\"ALGO\":\"0.1188405500000000\",\"SYLO\":\"0.0007600198000000\",\"ZCX\":\"0.0784707450000000\",\"SD\":\"0.3851073500000000\",\"ONT\":\"0.1877960550000000\",\"MJT\":\"0.0132433750000000\",\"DYM\":\"1.6659666000000001\",\"DYP\":\"0.0205397250000000\",\"BAKEUP\":\"0.0389894955000000\",\"OOE\":\"0.0079360300000000\",\"ZELIX\":\"0.0000649675000000\",\"DOGE3L\":\"0.3837080500000000\",\"ARTY\":\"0.3980009000000000\",\"QORPO\":\"0.1204297550000000\",\"ICE\":\"0.0051504235000000\",\"NOTAI\":\"0.0000892753400000\",\"DOGE3S\":\"0.2291853500000000\",\"NAKA\":\"1.0695649500000000\",\"GALAX\":\"0.0212893500000000\",\"MKR\":\"1245.8767500000163833\",\"DODO\":\"0.1152423500000000\",\"ICP\":\"7.6731615000000027\",\"ZEC\":\"35.9400209999999543\",\"ZEE\":\"0.0065767100000000\",\"ICX\":\"0.1383308000000000\",\"KMNO\":\"0.0921499020000000\",\"TT\":\"0.0033883050000000\",\"DOT3L\":\"0.1454272500000000\",\"XAI\":\"0.2038980000000000\",\"ZEN\":\"8.0149905000000007\",\"DOGE\":\"0.1213093150000000\",\"ALPHA\":\"0.0567416150000000\",\"DUSK\":\"0.1964517250000000\",\"DOT3S\":\"0.0053613180000000\",\"SXP\":\"0.2538730000000000\",\"HBAR\":\"0.0510044850000000\",\"SYNT\":\"0.0467166300000000\",\"ZEX\":\"0.0571714000000000\",\"BONDLY\":\"0.0022208890000000\",\"MLK\":\"0.2080859050000000\",\"KICKS\":\"0.0001301249050000\",\"PEPE\":\"0.0000100249850000\",\"OUSD\":\"0.9982006500000000\",\"LUNCDOWN\":\"0.0000733333150000\",\"DOGS\":\"0.0007086455000000\",\"REV3L\":\"0.0094672640000000\",\"CTSI\":\"0.1257371000000000\",\"C98\":\"0.1219390000000000\",\"OSMO\":\"0.5370313500000000\",\"NTRN\":\"0.3869064500000000\",\"CFX2S\":\"0.0084757600000000\",\"SYN\":\"0.5636180500000000\",\"VIDT\":\"0.0308745550000000\",\"SYS\":\"0.0997501000000000\",\"GAS\":\"4.3029474500000008\",\"BOME\":\"0.0087336310000000\",\"COMBO\":\"0.4068964500000000\",\"XCH\":\"14.9825050000000010\",\"VR\":\"0.0063538215000000\",\"CFX2L\":\"0.0499660045000000\",\"VSYS\":\"0.0005201398000000\",\"PANDORA\":\"1629.2949450001102772\",\"THETA\":\"1.2461766000000000\",\"XCN\":\"0.0012699647000000\",\"NEXG\":\"0.0039180400000000\",\"MELOS\":\"0.0021244372500000\",\"XCV\":\"0.0013253370000000\",\"ORN\":\"0.8797599000000000\",\"WLKN\":\"0.0010624685000000\",\"AAVE\":\"154.2708259999996162\",\"MNT\":\"0.6168914000000000\",\"BONK\":\"0.0000227296295000\",\"PERP\":\"0.6037979500000000\",\"XDC\":\"0.0276361750000000\",\"MNW\":\"0.3681158500000000\",\"XDB\":\"0.0002578710000000\",\"BOND\":\"1.5662165000000000\",\"SUIA\":\"0.0809595000000000\",\"MOG\":\"0.0000019330330000\",\"SUTER\":\"0.0001840079500000\",\"TIME\":\"16.2648634999999969\",\"RACA\":\"0.0001949025000000\",\"BICO\":\"0.2021988500000000\",\"MON\":\"0.1066466500000000\",\"SWEAT\":\"0.0063718125000000\",\"MOXIE\":\"0.0022088950000000\",\"BABYBNB\":\"0.0289755050000000\",\"IGU\":\"0.0050674650000000\",\"HMSTR\":\"0.0037990995000000\",\"XEC\":\"0.0000354722550000\",\"MONI\":\"0.0058470750000000\",\"XR\":\"0.2374812000000000\",\"PEOPLE\":\"0.0796601500000000\",\"PUMLX\":\"0.0054572700000000\",\"ZIL\":\"0.0145927000000000\",\"WLDDOWN\":\"0.2089954500000000\",\"VAI\":\"0.0799999800000000\",\"XEN\":\"0.0000000839580000\",\"MPC\":\"0.1001499000000000\",\"XEM\":\"0.0176951480000000\",\"JASMY3S\":\"0.0019670160000000\",\"OTK\":\"0.0290464695000000\",\"TRAC\":\"0.4521738000000000\",\"DFYN\":\"0.0070664650000000\",\"BIDP\":\"0.0001939030000000\",\"JASMY3L\":\"0.0001653772700000\",\"INJDOWN\":\"0.0000194902500000\",\"KLV\":\"0.0019310340000000\",\"WAXL\":\"0.7858069000000000\",\"TRBDOWN\":\"0.0023138425000000\",\"BCH3L\":\"4.6390663064999996\",\"GMT3S\":\"0.0000457771000000\",\"KMD\":\"0.2493752500000000\",\"BCH3S\":\"0.9634180500000000\",\"ECOX\":\"0.0987506000000000\",\"AAVE3S\":\"0.0560719500000000\",\"GMT3L\":\"0.0053983694650000\",\"EPIK\":\"0.0045857060000000\",\"SUIP\":\"0.1067565950000000\",\"AAVE3L\":\"0.3638687346200000\",\"ZK\":\"0.1262368500000000\",\"ZKF\":\"0.0008595700000000\",\"OMNIA\":\"0.7624186000000000\",\"ZKJ\":\"1.1124435000000000\",\"ZKL\":\"0.1255372000000000\",\"GAFI\":\"3.0634675000000001\",\"CARV\":\"0.8703646000000000\",\"KNC\":\"0.4433782000000000\",\"CATS\":\"0.0000599700000000\",\"PROM\":\"5.2833570000000006\",\"ALEPH\":\"0.1756121500000000\",\"PONKE\":\"0.3958020000000000\",\"OVR\":\"0.1553223000000000\",\"CATI\":\"0.4105146400000000\",\"ORDER\":\"0.1183008200000000\",\"GFT\":\"0.0166616650000000\",\"BIFI\":\"0.0020489750000000\",\"GGC\":\"6.9965029985000000\",\"GGG\":\"0.0403798000000000\",\"DAPPX\":\"0.0043788095000000\",\"SUKU\":\"0.0618790450000000\",\"ULTI\":\"0.0168015950000000\",\"CREDI\":\"0.0192903500000000\",\"ERTHA\":\"0.0010014990000000\",\"FURY\":\"0.1405297000000000\",\"KARRAT\":\"0.5577210000000000\",\"MOBILE\":\"0.0009005495000000\",\"SIDUS\":\"0.0037671155000000\",\"NAVI\":\"0.1254672350000000\",\"TAO\":\"583.4081500000051807\",\"USDJ\":\"1.1386304000000001\",\"MTL\":\"0.9563216000000000\",\"VET\":\"0.0225387250000000\",\"FITFI\":\"0.0036421780000000\",\"USDT\":\"0.9995000000000000\",\"OXT\":\"0.0695652000000000\",\"CANDY\":\"0.0005597200000000\",\"USDP\":\"0.9932031500000000\",\"MTS\":\"0.0027516235000000\",\"TADA\":\"0.0283858000000000\",\"MTV\":\"0.0006559718500000\",\"NAVX\":\"0.1342228550000000\",\"ILV\":\"35.6771524999999671\",\"VINU\":\"0.0000000109045450\",\"GHX\":\"0.0903548000000000\",\"EDU\":\"0.5167415000000000\",\"HYVE\":\"0.0137331300000000\",\"BTC3L\":\"0.0058620675000000\",\"ANYONE\":\"0.9015490000000000\",\"BEAT\":\"0.0012593700000000\",\"KING\":\"0.0004821588000000\",\"CREAM\":\"15.6541689999999973\",\"CAS\":\"0.0038590695000000\",\"IMX\":\"1.4944524000000000\",\"CAT\":\"0.0000256981445000\",\"BTC3S\":\"0.0014142925000000\",\"USDE\":\"0.9985005000000000\",\"USDD\":\"1.0000997000000000\",\"CWAR\":\"0.0037981000000000\",\"USDC\":\"0.9997998500000000\",\"KRL\":\"0.3543127550000000\",\"INJ\":\"21.7691100000000194\",\"GAME\":\"0.0139630150000000\",\"TRIBL\":\"1.0994500000000000\",\"XLM\":\"0.0948525500000000\",\"TRBUP\":\"0.0012293850000000\",\"VRADOWN\":\"0.0013433280000000\",\"SUPER\":\"1.2853570000000000\",\"EIGEN\":\"3.1536223999999999\",\"IOI\":\"0.0146926500000000\",\"KSM\":\"17.5212350000000129\",\"CCD\":\"0.0034832575000000\",\"EGO\":\"0.0093553200000000\",\"EGP\":\"2.7946019999999998\",\"MXC\":\"0.0066866550000000\",\"TEL\":\"0.0014432780000000\",\"MOVR\":\"9.1340307000000027\",\"XMR\":\"155.5421899999990755\",\"MXM\":\"0.0092853550000000\",\"OORT\":\"0.1099949750000000\",\"GLM\":\"0.3231383500000000\",\"RAY\":\"2.0228880499999998\",\"XTAG\":\"0.0218190850000000\",\"GLQ\":\"0.0854572500000000\",\"CWEB\":\"0.0038480750000000\",\"REVU\":\"0.0105047450000000\",\"REVV\":\"0.0039760110000000\",\"ZRO\":\"3.7952014499999994\",\"XNL\":\"0.0093853050000000\",\"XNO\":\"0.8496749500000000\",\"SAROS\":\"0.0019290350000000\",\"KACE\":\"2.1165411999999998\",\"ZRX\":\"0.3186406000000000\",\"WLTH\":\"0.0374312750000000\",\"ATOM3L\":\"0.0321719060000000\",\"GMM\":\"0.0001497251000000\",\"BEER\":\"0.0000138670630000\",\"GMT\":\"0.1275362000000000\",\"HEART\":\"0.0159920000000000\",\"GMX\":\"22.7186349999999882\",\"ABBC\":\"0.0061769100000000\",\"OMNI\":\"8.9235359999999970\",\"ATOM3S\":\"0.0007945225400000\",\"IRL\":\"0.0099650150000000\",\"CFG\":\"0.3248375000000000\",\"WSDM\":\"0.0139830050000000\",\"GNS\":\"1.8390800000000001\",\"VANRY\":\"0.0809295150000000\",\"CFX\":\"0.1595202000000000\",\"GRAIL\":\"817.1212349999937891\",\"BEFI\":\"0.0175712100000000\",\"VELO\":\"0.0132043945000000\",\"XPR\":\"0.0008077959000000\",\"DOVI\":\"0.0584707500000000\",\"ACE\":\"0.0021349320000000\",\"ACH\":\"0.0190534685000000\",\"ISP\":\"0.0012161916000000\",\"XCAD\":\"0.2834582000000000\",\"MINA\":\"0.5630183500000000\",\"TIA\":\"5.9318325999999999\",\"DRIFT\":\"0.4350823500000000\",\"ACQ\":\"0.0056981495000000\",\"ACS\":\"0.0014917537500000\",\"MIND\":\"0.0018920535000000\",\"STORE\":\"0.0062358805000000\",\"REN\":\"0.0351224300000000\",\"ELA\":\"1.7282354500000000\",\"DREAMS\":\"0.0002498750000000\",\"ADA\":\"0.3463267500000000\",\"ELF\":\"0.3777110500000000\",\"REQ\":\"0.0959919800000000\",\"STORJ\":\"0.5662167500000000\",\"LADYS\":\"0.0000000837581000\",\"PAXG\":\"2697.9303600003123340\",\"REZ\":\"0.0409795000000000\",\"XRD\":\"0.0157821050000000\",\"CHO\":\"0.0205097400000000\",\"CHR\":\"0.1769115000000000\",\"ADS\":\"0.1889055000000000\",\"CHZ\":\"0.0738030800000000\",\"ADX\":\"0.1575212000000000\",\"XRP\":\"0.5525036100000000\",\"JASMY\":\"0.0188615645000000\",\"KAGI\":\"0.1834582250000000\",\"FIDA\":\"0.2282858000000000\",\"PBR\":\"0.0291953950000000\",\"AEG\":\"0.0093453250000000\",\"H2O\":\"0.1610194500000000\",\"CHMB\":\"0.0001715641750000\",\"SAND3L\":\"0.0015447972150000\",\"PBX\":\"0.0006879558500000\",\"SOLVE\":\"0.0084557700000000\",\"DECHAT\":\"0.1512243500000000\",\"GARI\":\"0.0076861550000000\",\"SHIB2L\":\"1.1996998499999999\",\"SHIB2S\":\"0.0240879500000000\",\"ENA\":\"0.3942028000000000\",\"VEMP\":\"0.0029335325000000\",\"ENJ\":\"0.1467266000000000\",\"AFG\":\"0.0072163900000000\",\"RATS\":\"0.0001211593900000\",\"GRT\":\"0.1646076550000000\",\"FORWARD\":\"0.0012873560000000\",\"TFUEL\":\"0.0598800450000000\",\"ENS\":\"17.0634640000000052\",\"KASDOWN\":\"0.0258770550000000\",\"XTM\":\"0.0251074400000000\",\"DEGEN\":\"0.0084857550000000\",\"TLM\":\"0.0100449750000000\",\"DYDXDOWN\":\"0.1042598440000000\",\"CKB\":\"0.0146026950000000\",\"LUNC\":\"0.0000889255150000\",\"AURORA\":\"0.1204397500000000\",\"LUNA\":\"0.3624187000000000\",\"XTZ\":\"0.6776610000000000\",\"ELON\":\"0.0000001410294500\",\"DMTR\":\"0.0891554000000000\",\"EOS\":\"0.4759619000000000\",\"GST\":\"0.0118940500000000\",\"FORT\":\"0.1155422000000000\",\"FLAME\":\"0.0247076400000000\",\"PATEX\":\"0.9605195000000000\",\"DEEP\":\"0.0328885475000000\",\"ID3L\":\"0.0016201895000000\",\"GTC\":\"0.6625685500000000\",\"ID3S\":\"0.0071674145000000\",\"RIO\":\"0.7616190000000000\",\"CLH\":\"0.0008555720000000\",\"BURGER\":\"0.4016990500000000\",\"VRA\":\"0.0029765110000000\",\"SUNDOG\":\"0.2173912500000000\",\"GTT\":\"0.0002038980000000\",\"INJUP\":\"0.2327835500000000\",\"CPOOL\":\"0.1557720750000000\",\"EPX\":\"0.0000740629500000\",\"CLV\":\"0.0329835000000000\",\"FEAR\":\"0.0560519600000000\",\"MEME\":\"0.0124847545000000\",\"ROOBEE\":\"0.0004520738500000\",\"DEFI\":\"0.0192903500000000\",\"TOKEN\":\"0.0477361200000000\",\"GRAPE\":\"0.0020599695000000\",\"KASUP\":\"0.3996001000000000\",\"XWG\":\"0.0003843077500000\",\"SKEY\":\"0.0621289200000000\",\"SFUND\":\"1.3243375000000000\",\"EQX\":\"0.0032823580000000\",\"ORDIUP\":\"0.0548315705000000\",\"TON\":\"5.1857058499999995\",\"DEGO\":\"2.2667660500000001\",\"IZI\":\"0.0088455750000000\",\"ERG\":\"0.6605695500000000\",\"ERN\":\"1.9255367500000001\",\"VENOM\":\"0.0817591000000000\",\"VOXEL\":\"0.1497251000000000\",\"RLC\":\"1.4649671500000000\",\"PHA\":\"0.1093453000000000\",\"DYDXUP\":\"0.0112573685000000\",\"APE3S\":\"0.0008475760000000\",\"ORBS\":\"0.0288955450000000\",\"OPDOWN\":\"0.6758619000000000\",\"ESE\":\"0.0139130400000000\",\"APE3L\":\"0.1339330000000000\",\"HMND\":\"0.0982208650000000\",\"COQ\":\"0.0000014432780000\",\"AURY\":\"0.3340329000000000\",\"CULT\":\"0.0000028025980000\",\"AKT\":\"2.4642672500000001\",\"GLMR\":\"0.1606196500000000\",\"XYM\":\"0.0142528700000000\",\"ORAI\":\"6.1769100000000012\",\"XYO\":\"0.0058680645000000\",\"ETC\":\"18.8458723500000169\",\"LAI\":\"0.0142828550000000\",\"PIP\":\"0.0178310800000000\",\"ETH\":\"2607.6655149998362673\",\"NEO\":\"10.3575186499999991\",\"RMV\":\"0.0081659150000000\",\"KLAY\":\"0.1251374000000000\",\"PIT\":\"0.0000000003268365\",\"TARA\":\"0.0043978000000000\",\"KALT\":\"0.1128735350000000\",\"PIX\":\"0.0001023687900000\",\"ETN\":\"0.0021579205000000\",\"CSIX\":\"0.0141729100000000\",\"TRADE\":\"0.4708644500000000\",\"MAVIA\":\"1.3592200500000001\",\"HIGH\":\"1.3043474999999999\",\"TRB\":\"62.5387150000000006\",\"ORDI\":\"35.7421200000000126\",\"TRVL\":\"0.0373643085000000\",\"AMB\":\"0.0059670150000000\",\"TRU\":\"0.0762018800000000\",\"LOGX\":\"0.0271963950000000\",\"FINC\":\"0.0362018900000000\",\"INFRA\":\"0.1978010500000000\",\"NATIX\":\"0.0008729633000000\",\"NFP\":\"0.2152923000000000\",\"TRY\":\"0.0292166033323590\",\"TRX\":\"0.1597201000000000\",\"LBP\":\"0.0001243378000000\",\"LBR\":\"0.0595702000000000\",\"EUL\":\"2.9735125000000000\",\"NFT\":\"0.0000004077960000\",\"SEIUP\":\"0.0478110825000000\",\"PUFFER\":\"0.3676161000000000\",\"EUR\":\"1.0811249323958897\",\"ORCA\":\"2.0664662499999999\",\"NEAR3L\":\"0.0117010765350000\",\"AMP\":\"0.0038330825000000\",\"XDEFI\":\"0.0472563600000000\",\"HIFI\":\"0.4947525000000000\",\"TRUF\":\"0.0459570100000000\",\"AITECH\":\"0.1045477000000000\",\"AMU\":\"0.0043978000000000\",\"USTC\":\"0.0214692600000000\",\"KNGL\":\"0.0499750000000000\",\"FOXY\":\"0.0102686631000000\",\"NGC\":\"0.0147935995000000\",\"TENET\":\"0.0043278350000000\",\"NEAR3S\":\"0.0072553705000000\",\"MAHA\":\"1.1904045000000000\",\"NGL\":\"0.0701748950000000\",\"TST\":\"0.0080359800000000\",\"HIPPO\":\"0.0104447750000000\",\"AXS3S\":\"0.0308705570000000\",\"CRO\":\"0.0781409100000000\",\"ZPAY\":\"0.0050574700000000\",\"MNDE\":\"0.1026786350000000\",\"CRV\":\"0.2534732000000000\",\"SWASH\":\"0.0056271850000000\",\"AXS3L\":\"0.0106388779000000\",\"VERSE\":\"0.0001803098000000\",\"RPK\":\"0.0049975000000000\",\"RPL\":\"10.9745099999999958\",\"AZERO\":\"0.3789104500000000\",\"SOUL\":\"0.0534332700000000\",\"VXV\":\"0.2619689500000000\",\"LDO\":\"1.0885554500000000\",\"MAGIC\":\"0.3390304000000000\",\"ALICE\":\"1.0324835000000000\",\"SEAM\":\"1.1933030499999999\",\"PLU\":\"1.9300345000000001\",\"AOG\":\"0.0031224380000000\",\"SMOLE\":\"0.0000387806000000\",\"EWT\":\"1.1094450000000000\",\"TSUGT\":\"0.0029185400000000\",\"PMG\":\"0.0800599500000000\",\"OPAI\":\"0.0006826585000000\",\"LOCUS\":\"0.0216591650000000\",\"CTA\":\"0.0825087250000000\",\"NIM\":\"0.0013673160000000\",\"CTC\":\"0.4033982000000000\",\"APE\":\"0.7035480500000000\",\"MERL\":\"0.2720639000000000\",\"JAM\":\"0.0004770613500000\",\"CTI\":\"0.0130314810000000\",\"APP\":\"0.0021989000000000\",\"APT\":\"9.9947001500000000\",\"WLDUP\":\"0.0093043455000000\",\"ZEND\":\"0.1280759300000000\",\"FIRE\":\"0.9113441000000000\",\"DENT\":\"0.0008630682500000\",\"PYTH\":\"0.3390603850000000\",\"LFT\":\"0.0155322300000000\",\"DPET\":\"0.0319040400000000\",\"ORDIDOWN\":\"0.3788105000000000\",\"KPOL\":\"0.0029175405000000\",\"ETHUP\":\"8.4971493000000032\",\"BAND\":\"1.0939527500000001\",\"POL\":\"0.3656171000000000\",\"ASTR\":\"0.0582608550000000\",\"NKN\":\"0.0691654000000000\",\"RSR\":\"0.0068055955000000\",\"DVPN\":\"0.0005979009000000\",\"TWT\":\"1.1119437500000000\",\"ARB\":\"0.5510243500000000\",\"CVC\":\"0.1409801746501747\",\"ARC\":\"0.0300849500000000\",\"XETA\":\"0.0022888550000000\",\"MTRG\":\"0.4007995000000000\",\"LOKA\":\"0.1867066000000000\",\"LPOOL\":\"0.0660069800000000\",\"TURBOS\":\"0.0034812585000000\",\"CVX\":\"1.7816087499999999\",\"ARX\":\"0.0007556220000000\",\"MPLX\":\"0.4355221300000000\",\"SUSHI\":\"0.7011492500000000\",\"NLK\":\"0.0114442750000000\",\"PEPE2\":\"0.0000000313843000\",\"WBTC\":\"66881.4425499645548419\",\"SUI3L\":\"0.0211204345000000\",\"CWS\":\"0.1927036000000000\",\"SUI3S\":\"0.0000579110300000\",\"INSP\":\"0.0264167850000000\",\"MANA\":\"0.2945026750000000\",\"VRTX\":\"0.0641679000000000\",\"CSPR\":\"0.0116441750000000\",\"ATA\":\"0.0785007300000000\",\"OPEN\":\"0.0080049955000000\",\"HAI\":\"0.0448275750000000\",\"NMR\":\"14.7436245000000072\",\"ATH\":\"0.0540929400000000\",\"LIT\":\"0.6282857000000000\",\"TLOS\":\"0.3263467450000000\",\"TNSR\":\"0.3662168000000000\",\"CXT\":\"0.0871364100000000\",\"POLYX\":\"0.2346826000000000\",\"ZERO\":\"0.0002507745500000\",\"ROUTE\":\"0.0610694500000000\",\"LOOM\":\"0.0580009850000000\",\"PRE\":\"0.0078680640000000\",\"VRAUP\":\"0.0134652640000000\",\"HBB\":\"0.0714742450000000\",\"RVN\":\"0.0165017450000000\",\"PRQ\":\"0.0715741950000000\",\"ONDO\":\"0.7134930750000000\",\"PEPEDOWN\":\"0.0000155022450000\",\"WOOP\":\"0.0020179905000000\",\"LUNCUP\":\"0.0168355780000000\",\"KAVA\":\"0.3522238000000000\",\"LKI\":\"0.0104187880000000\",\"AVA\":\"0.4857570000000000\",\"NOM\":\"0.0233883000000000\",\"MAPO\":\"0.0089015470000000\",\"PEPEUP\":\"0.0114252845000000\",\"STRAX\":\"0.0487156300000000\",\"NOT\":\"0.0078670645000000\",\"ZERC\":\"0.1108245600000000\",\"BCUT\":\"0.0255672100000000\",\"MASA\":\"0.0691354150000000\",\"WAN\":\"0.1785077544737212\",\"WAT\":\"0.0003273762300000\",\"WAX\":\"0.0327636100000000\",\"MASK\":\"2.2259864500000002\",\"EOS3L\":\"0.0002122138400000\",\"IDEA\":\"0.0005887055000000\",\"EOS3S\":\"0.0034472755000000\",\"YFI\":\"4919.4290549999908843\",\"MOODENG\":\"0.0774612500000000\",\"XCUR\":\"0.0048845565000000\",\"HYDRA\":\"0.2225886500000000\",\"POPCAT\":\"1.3382305500000000\",\"LQTY\":\"0.7848074000000000\",\"PIXEL\":\"0.1406596350000000\",\"LMR\":\"0.0145437245000000\",\"ZETA\":\"0.5997999500000000\",\"YGG\":\"0.4717640000000000\",\"AXS\":\"4.6006985000000006\",\"BCHSV\":\"49.8250749999999370\",\"NRN\":\"0.0395802000000000\",\"FTON\":\"0.0091954000000000\",\"COMP\":\"43.6581599999999881\",\"XPRT\":\"0.1819090000000000\",\"HFT\":\"0.1443278000000000\",\"UXLINK\":\"0.5085456000000000\",\"STAMP\":\"0.0335032400000000\",\"RUNE\":\"4.9233370999999996\",\"ZEUS\":\"0.2587705500000000\",\"LTC3L\":\"1.8294848000000001\",\"DAPP\":\"0.1763118000000000\",\"FORTH\":\"2.9508238500000004\",\"ALPINE\":\"1.5322335000000000\",\"SENSO\":\"0.0328835500000000\",\"LTC3S\":\"0.0006986505000000\",\"DEXE\":\"8.3795081500000028\",\"GOAL\":\"0.0175912000000000\",\"AVAX\":\"27.5602130000000058\",\"LISTA\":\"0.3782108000000000\",\"AMPL\":\"1.3743124999999999\",\"WORK\":\"0.1384307500000000\",\"BRWL\":\"0.0017391300000000\",\"BANANA\":\"57.1314200000001362\",\"PUSH\":\"0.0750624500000000\",\"WEN\":\"0.0001015492000000\",\"NEIRO\":\"0.0879560000000000\",\"BTCUP\":\"34.7711057499999789\",\"SOL3S\":\"0.0007816090000000\",\"BRAWL\":\"0.0004776610500000\",\"LAY3R\":\"0.2161918500000000\",\"LPT\":\"11.9304317999999945\",\"GODS\":\"0.1807096000000000\",\"SAND3S\":\"4.6152911999999992\",\"RDNT\":\"0.0640679500000000\",\"SOL3L\":\"1.8351913752850000\",\"NIBI\":\"0.0653772950000000\",\"NUM\":\"0.0436181800000000\",\"PYR\":\"2.5590198499999997\",\"DAG\":\"0.0226176855000000\",\"DAI\":\"0.9989006596042375\",\"HIP\":\"0.0034982500000000\",\"DAO\":\"0.2848575000000000\",\"AVAIL\":\"0.1300929210000000\",\"DAR\":\"0.1512243500000000\",\"FET\":\"1.3760116500000000\",\"FCON\":\"0.0001197600900000\",\"XAVA\":\"0.3789104500000000\",\"LRC\":\"0.1208395500000000\",\"UNI3S\":\"0.0000653573050000\",\"PZP\":\"0.0599600050000000\",\"POKT\":\"0.0424787500000000\",\"DASH\":\"23.6881500000000109\",\"BAKEDOWN\":\"0.0003324636850000\",\"POLC\":\"0.0061389290000000\",\"DBR\":\"0.0377671070000000\",\"CIRUS\":\"0.0055772100000000\",\"UNI3L\":\"0.0993921490650000\",\"NWC\":\"0.0681659000000000\",\"POLK\":\"0.0142628650000000\",\"LSD\":\"0.9420287500000000\",\"MARS4\":\"0.0005878059500000\",\"LSK\":\"0.8080957500000000\",\"BLOCK\":\"0.0261869000000000\",\"ANALOS\":\"0.0000446776500000\",\"SAFE\":\"0.8779608000000000\",\"DCK\":\"0.0234082900000000\",\"LSS\":\"0.0562718500000000\",\"DCR\":\"12.4337799999999929\",\"LIKE\":\"0.0559720000000000\",\"DATA\":\"0.0361819000000000\",\"WIF\":\"2.5696145499999999\",\"BLOK\":\"0.0006546725000000\",\"LTC\":\"71.6261690000000611\",\"METIS\":\"42.0289750000000612\",\"WIN\":\"0.0000868365600000\",\"HLG\":\"0.0018790600000000\",\"LTO\":\"0.1166116650000000\",\"DYDX\":\"0.9341327000000000\",\"ARB3S\":\"0.0509025360000000\",\"MUBI\":\"0.0303848000000000\",\"ARB3L\":\"0.0025917035000000\",\"RBTC1\":\"0.0000039480250000\",\"POND\":\"0.0118640650000000\",\"LINA\":\"0.0037771105000000\",\"MYRIA\":\"0.0025337325000000\",\"LINK\":\"11.0244849999999944\",\"QTUM\":\"2.4262016723130069\",\"TUNE\":\"0.0148025950000000\",\"UFO\":\"0.0000006479758500\",\"CYBER\":\"2.8755615000000001\",\"WILD\":\"0.2433782500000000\",\"POLS\":\"0.2809594500000000\",\"NYM\":\"0.0719640000000000\",\"FIL\":\"3.6786597500000005\",\"BAL\":\"2.0099945000000000\",\"SCA\":\"0.3999999000000000\",\"STND\":\"0.0133123405000000\",\"WMTX\":\"0.2138930000000000\",\"SCLP\":\"0.1545227000000000\",\"MANEKI\":\"0.0073963000000000\",\"BAT\":\"0.1721139000000000\",\"AKRO\":\"0.0042302838000000\",\"FTM3L\":\"8.2574692000000024\",\"BAX\":\"0.0000709645000000\",\"FTM3S\":\"0.0000255072400000\",\"COTI\":\"0.0951524000000000\"}}", - "responseId": 10317, - "ordering": 1 - } - ], - "requestBody": { - "type": "none", - "parameters": [], - "jsonSchema": { - "type": "object", - "properties": {} - }, - "mediaType": "" - }, - "description": ":::info[Description]\nRequest via this endpoint to get the fiat price of the currencies for the available trading pairs.\n:::\n", - "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Spot\",\"api-channel\":\"Public\",\"api-permission\":\"NULL\",\"api-rate-limit-pool\":\"Public\",\"sdk-service\":\"Spot\",\"sdk-sub-service\":\"Market\",\"sdk-method-name\":\"getFiatPrice\",\"sdk-method-description\":\"Request via this endpoint to get the fiat price of the currencies for the available trading pairs.\",\"api-rate-limit\":3}" - } - }, - { - "name": "Get All Symbols", - "api": { - "id": "3470154", - "method": "get", - "path": "/api/v2/symbols", - "parameters": { - "path": [], - "query": [ - { - "id": "4oM4tRz9wb", - "name": "market", - "required": false, - "description": "[The trading market](apidog://link/endpoint/222921786)", - "example": "", - "type": "string", - "schema": { - "type": "string", - "examples": [ - "ALTS", - "USDS", - "ETF" - ] - } - } - ], - "cookie": [], - "header": [] - }, - "responses": [ - { - "id": "10318", - "code": 200, - "name": "OK", - "headers": [], - "jsonSchema": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "data": { - "type": "array", - "items": { - "type": "object", - "properties": { - "symbol": { - "type": "string", - "description": "unique code of a symbol, it would not change after renaming", - "examples": [ - "BTC-USDT", - "BCHSV-USDT" - ] - }, - "name": { - "type": "string", - "description": "Name of trading pairs, it would change after renaming", - "examples": [ - "BTC-USDT", - "BSV-USDT" - ] - }, - "baseCurrency": { - "type": "string", - "description": "Base currency,e.g. BTC." - }, - "quoteCurrency": { - "type": "string", - "description": "Quote currency,e.g. USDT." - }, - "feeCurrency": { - "type": "string", - "description": "The currency of charged fees." - }, - "market": { - "type": "string", - "description": "The trading market.", - "examples": [ - "USDS", - "BTC", - "ALTS" - ] - }, - "baseMinSize": { - "type": "string", - "description": "The minimum order quantity requried to place an order." - }, - "quoteMinSize": { - "type": "string", - "description": "The minimum order funds required to place a market order." - }, - "baseMaxSize": { - "type": "string", - "description": "The maximum order size required to place an order." - }, - "quoteMaxSize": { - "type": "string", - "description": "The maximum order funds required to place a market order." - }, - "baseIncrement": { - "type": "string", - "description": "Quantity increment: The quantity for an order must be a positive integer multiple of this increment. Here, the size refers to the quantity of the base currency for the order. For example, for the ETH-USDT trading pair, if the baseIncrement is 0.0000001, the order quantity can be 1.0000001 but not 1.00000001." - }, - "quoteIncrement": { - "type": "string", - "description": "Quote increment: The funds for a market order must be a positive integer multiple of this increment. The funds refer to the quote currency amount. For example, for the ETH-USDT trading pair, if the quoteIncrement is 0.000001, the amount of USDT for the order can be 3000.000001 but not 3000.0000001." - }, - "priceIncrement": { - "type": "string", - "description": "Price increment: The price of an order must be a positive integer multiple of this increment. For example, for the ETH-USDT trading pair, if the priceIncrement is 0.01, the order price can be 3000.01 but not 3000.001.\n\nspecifies the min order price as well as the price increment.This also applies to quote currency." - }, - "priceLimitRate": { - "type": "string", - "description": "Threshold for price portection" - }, - "minFunds": { - "type": "string", - "description": "the minimum trading amounts" - }, - "isMarginEnabled": { - "type": "boolean", - "description": "Available for margin or not." - }, - "enableTrading": { - "type": "boolean", - "description": "Available for transaction or not." - }, - "feeCategory": { - "type": "integer", - "description": "[Fee Type](https://www.kucoin.com/vip/privilege)", - "enum": [ - 1, - 2, - 3 - ], - "x-api-enum": [ - { - "value": 1, - "name": "classA", - "description": "classA" - }, - { - "value": 2, - "name": "classB", - "description": "classB" - }, - { - "value": 3, - "name": "classC", - "description": "classC" - } - ] - }, - "makerFeeCoefficient": { - "type": "string", - "description": "The maker fee coefficient. The actual fee needs to be multiplied by this coefficient to get the final fee. Most currencies have a coefficient of 1. If set to 0, it means no fee" - }, - "takerFeeCoefficient": { - "type": "string", - "description": "The taker fee coefficient. The actual fee needs to be multiplied by this coefficient to get the final fee. Most currencies have a coefficient of 1. If set to 0, it means no fee" - }, - "st": { - "type": "boolean", - "description": "Whether it is an [Special Treatment](https://www.kucoin.com/legal/special-treatment) symbol" - } - }, - "required": [ - "symbol", - "name", - "baseCurrency", - "quoteCurrency", - "feeCurrency", - "market", - "baseMinSize", - "quoteMinSize", - "baseMaxSize", - "quoteMaxSize", - "baseIncrement", - "quoteIncrement", - "priceIncrement", - "priceLimitRate", - "minFunds", - "isMarginEnabled", - "enableTrading", - "feeCategory", - "makerFeeCoefficient", - "takerFeeCoefficient", - "st" - ] - } - } - }, - "required": [ - "code", - "data" - ] - }, - "description": "", - "contentType": "json", - "mediaType": "" - } - ], - "responseExamples": [ - { - "name": "Success", - "data": "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"symbol\": \"BTC-USDT\",\n \"name\": \"BTC-USDT\",\n \"baseCurrency\": \"BTC\",\n \"quoteCurrency\": \"USDT\",\n \"feeCurrency\": \"USDT\",\n \"market\": \"USDS\",\n \"baseMinSize\": \"0.00001\",\n \"quoteMinSize\": \"0.1\",\n \"baseMaxSize\": \"10000000000\",\n \"quoteMaxSize\": \"99999999\",\n \"baseIncrement\": \"0.00000001\",\n \"quoteIncrement\": \"0.000001\",\n \"priceIncrement\": \"0.1\",\n \"priceLimitRate\": \"0.1\",\n \"minFunds\": \"0.1\",\n \"isMarginEnabled\": true,\n \"enableTrading\": true,\n \"feeCategory\": 1,\n \"makerFeeCoefficient\": \"1.00\",\n \"takerFeeCoefficient\": \"1.00\",\n \"st\": false\n }\n ]\n}", - "responseId": 10318, - "ordering": 1 - } - ], - "requestBody": { - "type": "none", - "parameters": [], - "jsonSchema": { - "type": "object", - "properties": {} - }, - "mediaType": "" - }, - "description": ":::info[Description]\nRequest via this endpoint to get a list of available currency pairs for trading. If you want to get the market information of the trading symbol, please use Get All Tickers.\n:::\n\n\n:::tip[Tips]\npriceIncrement and quoteIncrement may be adjusted in the future. We will notify you by email and site notifications before adjustment.\n:::\n\n| Order Type | Follow the rules of minFunds |\n| --- | --- |\n| Limit Buy | [Order Amount * Order Price] >= minFunds |\n| Limit Sell | [Order Amount * Order Price] >= minFunds |\n| Market Buy | Order Value >= minFunds |\n| Market Sell | [Order Amount * Last Price of Base Currency] >= minFunds |\n\nNote:\n\n- API market buy orders (by amount) valued at [Order Amount * Last Price of Base Currency] < minFunds will be rejected.\n- API market sell orders (by value) valued at < minFunds will be rejected.\n- Take profit and stop loss orders at market or limit prices will be rejected when triggered.\n\n\n", - "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Spot\",\"api-channel\":\"Public\",\"api-permission\":\"NULL\",\"api-rate-limit-pool\":\"Public\",\"sdk-service\":\"Spot\",\"sdk-sub-service\":\"Market\",\"sdk-method-name\":\"getAllSymbols\",\"sdk-method-description\":\"Request via this endpoint to get a list of available currency pairs for trading. If you want to get the market information of the trading symbol, please use Get All Tickers.\",\"api-rate-limit\":4}" - } - }, - { - "name": "Get Currency", - "api": { - "id": "3470155", - "method": "get", - "path": "/api/v3/currencies/{currency}", - "parameters": { - "path": [ - { - "id": "currency#0", - "name": "currency", - "required": true, - "description": "Path parameter, Currency", - "example": "BTC", - "type": "string", - "schema": { - "type": "string", - "examples": [ - "BTC", - "ETH", - "USDT" - ] - } - } - ], - "query": [ - { - "id": "nSUWM8eRPB", - "name": "chain", - "required": false, - "description": "Support for querying the chain of currency, e.g. The available value for USDT are OMNI, ERC20, TRC20. This only apply for multi-chain currency, and there is no need for single chain currency.", - "example": "", - "type": "string", - "schema": { - "type": "string", - "examples": [ - "eth", - "bech32", - "btc", - "kcc", - "trx", - "bsc", - "arbitrum", - "ton", - "optimism" - ] - } - } - ], - "cookie": [], - "header": [] - }, - "responses": [ - { - "id": "10319", - "code": 200, - "name": "OK", - "headers": [], - "jsonSchema": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "data": { - "type": "object", - "properties": { - "currency": { - "type": "string", - "description": "A unique currency code that will never change" - }, - "name": { - "type": "string", - "description": "Currency name, will change after renaming" - }, - "fullName": { - "type": "string", - "description": "Full name of a currency, will change after renaming" - }, - "precision": { - "type": "integer", - "description": "Currency precision" - }, - "confirms": { - "type": "integer", - "description": "Number of block confirmations" - }, - "contractAddress": { - "type": "string", - "description": "Contract address" - }, - "isMarginEnabled": { - "type": "boolean", - "description": "Support margin or not" - }, - "isDebitEnabled": { - "type": "boolean", - "description": "Support debit or not" - }, - "chains": { - "type": "array", - "items": { - "type": "object", - "properties": { - "chainName": { - "type": "string", - "description": "chain name of currency" - }, - "withdrawalMinSize": { - "type": "string", - "description": "Minimum withdrawal amount" - }, - "depositMinSize": { - "type": "string", - "description": "Minimum deposit amount" - }, - "withdrawFeeRate": { - "type": "string", - "description": "withdraw fee rate" - }, - "withdrawalMinFee": { - "type": "string", - "description": "Minimum fees charged for withdrawal" - }, - "isWithdrawEnabled": { - "type": "boolean", - "description": "Support withdrawal or not" - }, - "isDepositEnabled": { - "type": "boolean", - "description": "Support deposit or not" - }, - "confirms": { - "type": "integer", - "description": "Number of block confirmations" - }, - "preConfirms": { - "type": "integer", - "description": "The number of blocks (confirmations) for advance on-chain verification" - }, - "contractAddress": { - "type": "string", - "description": "Contract address" - }, - "withdrawPrecision": { - "type": "integer", - "description": "Withdrawal precision bit, indicating the maximum supported length after the decimal point of the withdrawal amount" - }, - "maxWithdraw": { - "type": "number", - "description": "Maximum amount of single withdrawal" - }, - "maxDeposit": { - "type": "string", - "description": "Maximum amount of single deposit (only applicable to Lightning Network)" - }, - "needTag": { - "type": "boolean", - "description": "whether memo/tag is needed" - }, - "chainId": { - "type": "string", - "description": "chain id of currency" - } - }, - "required": [ - "chainName", - "withdrawalMinSize", - "depositMinSize", - "withdrawFeeRate", - "withdrawalMinFee", - "isWithdrawEnabled", - "isDepositEnabled", - "confirms", - "preConfirms", - "contractAddress", - "withdrawPrecision", - "maxWithdraw", - "maxDeposit", - "needTag", - "chainId" - ] - }, - "description": "chain list" - } - }, - "required": [ - "currency", - "name", - "fullName", - "precision", - "confirms", - "contractAddress", - "isMarginEnabled", - "isDebitEnabled", - "chains" - ] - } - }, - "required": [ - "code", - "data" - ] - }, - "description": "", - "contentType": "json", - "mediaType": "" - } - ], - "responseExamples": [ - { - "name": "Success", - "data": "{\"code\":\"200000\",\"data\":{\"currency\":\"BTC\",\"name\":\"BTC\",\"fullName\":\"Bitcoin\",\"precision\":8,\"confirms\":null,\"contractAddress\":null,\"isMarginEnabled\":true,\"isDebitEnabled\":true,\"chains\":[{\"chainName\":\"BTC\",\"withdrawalMinSize\":\"0.001\",\"depositMinSize\":\"0.0002\",\"withdrawFeeRate\":\"0\",\"withdrawalMinFee\":\"0.0005\",\"isWithdrawEnabled\":true,\"isDepositEnabled\":true,\"confirms\":3,\"preConfirms\":1,\"contractAddress\":\"\",\"withdrawPrecision\":8,\"maxWithdraw\":null,\"maxDeposit\":null,\"needTag\":false,\"chainId\":\"btc\"},{\"chainName\":\"Lightning Network\",\"withdrawalMinSize\":\"0.00001\",\"depositMinSize\":\"0.00001\",\"withdrawFeeRate\":\"0\",\"withdrawalMinFee\":\"0.000015\",\"isWithdrawEnabled\":true,\"isDepositEnabled\":true,\"confirms\":1,\"preConfirms\":1,\"contractAddress\":\"\",\"withdrawPrecision\":8,\"maxWithdraw\":null,\"maxDeposit\":\"0.03\",\"needTag\":false,\"chainId\":\"btcln\"},{\"chainName\":\"KCC\",\"withdrawalMinSize\":\"0.0008\",\"depositMinSize\":null,\"withdrawFeeRate\":\"0\",\"withdrawalMinFee\":\"0.00002\",\"isWithdrawEnabled\":true,\"isDepositEnabled\":true,\"confirms\":20,\"preConfirms\":20,\"contractAddress\":\"0xfa93c12cd345c658bc4644d1d4e1b9615952258c\",\"withdrawPrecision\":8,\"maxWithdraw\":null,\"maxDeposit\":null,\"needTag\":false,\"chainId\":\"kcc\"},{\"chainName\":\"BTC-Segwit\",\"withdrawalMinSize\":\"0.0008\",\"depositMinSize\":\"0.0002\",\"withdrawFeeRate\":\"0\",\"withdrawalMinFee\":\"0.0005\",\"isWithdrawEnabled\":false,\"isDepositEnabled\":true,\"confirms\":2,\"preConfirms\":2,\"contractAddress\":\"\",\"withdrawPrecision\":8,\"maxWithdraw\":null,\"maxDeposit\":null,\"needTag\":false,\"chainId\":\"bech32\"}]}}", - "responseId": 10319, - "ordering": 1 - } - ], - "requestBody": { - "type": "none", - "parameters": [], - "jsonSchema": { - "type": "object", - "properties": {} - }, - "mediaType": "" - }, - "description": ":::info[Description]\nRequest via this endpoint to get the currency details of a specified currency\n:::", - "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Spot\",\"api-channel\":\"Public\",\"api-permission\":\"NULL\",\"api-rate-limit-pool\":\"Public\",\"sdk-service\":\"Spot\",\"sdk-sub-service\":\"Market\",\"sdk-method-name\":\"getCurrency\",\"sdk-method-description\":\"Request via this endpoint to get the currency details of a specified currency\",\"api-rate-limit\":3}" - } - }, - { - "name": "Get Server Time", - "api": { - "id": "3470156", - "method": "get", - "path": "/api/v1/timestamp", - "parameters": { - "path": [], - "query": [], - "cookie": [], - "header": [] - }, - "responses": [ - { - "id": "10320", - "code": 200, - "name": "OK", - "headers": [], - "jsonSchema": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "data": { - "type": "integer", - "format": "int64", - "description": "ServerTime(millisecond)" - } - }, - "required": [ - "code", - "data" - ] - }, - "description": "", - "contentType": "json", - "mediaType": "" - } - ], - "responseExamples": [ - { - "name": "Success", - "data": "{\"code\":\"200000\",\"data\":1729100692873}", - "responseId": 10320, - "ordering": 1 - } - ], - "requestBody": { - "type": "none", - "parameters": [], - "jsonSchema": { - "type": "object", - "properties": {} - }, - "mediaType": "" - }, - "description": ":::info[Description]\nGet the server time.\n:::", - "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Spot\",\"api-channel\":\"Public\",\"api-permission\":\"NULL\",\"api-rate-limit-pool\":\"Public\",\"sdk-service\":\"Spot\",\"sdk-sub-service\":\"Market\",\"sdk-method-name\":\"getServerTime\",\"sdk-method-description\":\"Get the server time.\",\"api-rate-limit\":3}" - } - }, - { - "name": "Get Announcements", - "api": { - "id": "3470157", - "method": "get", - "path": "/api/v3/announcements", - "parameters": { - "query": [ - { - "id": "j3zlyFZAZT", - "name": "currentPage", - "required": false, - "description": "page number", - "type": "integer", - "schema": { - "type": "integer", - "format": "int64" - }, - "enable": true, - "example": "1" - }, - { - "id": "35MLManAOr", - "name": "pageSize", - "required": false, - "description": "page Size", - "type": "integer", - "schema": { - "type": "integer", - "format": "int64" - }, - "enable": true, - "example": "50" - }, - { - "id": "c9UEoOtAzp", - "name": "annType", - "required": false, - "description": "Announcement types: latest-announcements , activities (latest activities), new-listings (new currency online), product-updates (product updates), vip (institutions and VIPs), maintenance-updates (system maintenance), product -updates (product news), delistings (currency offline), others, api-campaigns (API user activities), default : latest-announcements", - "example": "latest-announcements", - "type": "string", - "schema": { - "type": "string", - "enum": [ - "latest-announcements ", - "activities ", - "product-updates ", - "vip ", - "maintenance-updates", - "delistings ", - "others", - "api-campaigns ", - "new-listings" - ], - "default": "latest-announcements", - "x-api-enum": [ - { - "value": "latest-announcements ", - "name": "LATEST-ANNOUNCEMENTS", - "description": "latest-announcements" - }, - { - "value": "activities ", - "name": "ACTIVITIES", - "description": "latest activities" - }, - { - "value": "product-updates ", - "name": "PRODUCT-UPDATES", - "description": "product updates" - }, - { - "value": "vip ", - "name": "VIPS", - "description": "institutions and VIPs" - }, - { - "value": "maintenance-updates", - "name": "MAINTENANCE-UPDATE", - "description": "system maintenance" - }, - { - "value": "delistings ", - "name": "DELISTINGS", - "description": "currency offline" - }, - { - "value": "others", - "name": "OTHERS", - "description": "others" - }, - { - "value": "api-campaigns ", - "name": "API-CAMPAIGNS", - "description": "API user activities" - }, - { - "value": "new-listings", - "name": "NEW-LISTINGS", - "description": "new currency online" - } - ] - }, - "enable": true - }, - { - "id": "ncGIEDsZtk", - "name": "lang", - "required": false, - "description": "Language type, the default is en_US, the specific value parameters are as follows", - "type": "string", - "schema": { - "type": "string", - "default": "en_US", - "enum": [ - "zh_HK", - "ja_JP", - "ko_KR", - "en_US", - "pl_PL", - "es_ES", - "fr_FR", - "ar_AE", - "it_IT", - "id_ID", - "nl_NL", - "pt_PT", - "vi_VN", - "de_DE", - "tr_TR", - "ms_MY", - "ru_RU", - "th_TH", - "hi_IN", - "bn_BD", - "fil_PH", - "ur_PK" - ], - "x-api-enum": [ - { - "value": "zh_HK", - "name": "ZH_HK", - "description": "Chinese (Hong Kong)" - }, - { - "value": "ja_JP", - "name": "JA_JP", - "description": "Japanese (Japan)" - }, - { - "value": "ko_KR", - "name": "KO_KR", - "description": "Korean (Korea)" - }, - { - "value": "en_US", - "name": "EN_US", - "description": "English" - }, - { - "value": "pl_PL", - "name": "PL_PL", - "description": "Polish (Poland)" - }, - { - "value": "es_ES", - "name": "ES_ES", - "description": "Spanish (Spain)" - }, - { - "value": "fr_FR", - "name": "FR_FR", - "description": "French (France)" - }, - { - "value": "ar_AE", - "name": "AR_AE", - "description": "Arabic (Egypt)" - }, - { - "value": "it_IT", - "name": "IT_IT", - "description": "Italian (Italy)" - }, - { - "value": "id_ID", - "name": "ID_ID", - "description": "Indonesian (Indonesia)" - }, - { - "value": "nl_NL", - "name": "NL_NL", - "description": "Dutch (Netherlands)" - }, - { - "value": "pt_PT", - "name": "PT_PT", - "description": "Portuguese (Brazil)" - }, - { - "value": "vi_VN", - "name": "VI_VN", - "description": "Vietnamese (Vietnam)" - }, - { - "value": "de_DE", - "name": "DE_DE", - "description": "German (Germany)" - }, - { - "value": "tr_TR", - "name": "TR_TR", - "description": "Turkish (Turkey)" - }, - { - "value": "ms_MY", - "name": "MS_MY", - "description": "Malay (Malaysia)" - }, - { - "value": "ru_RU", - "name": "RU_RU", - "description": "Russian (Russia)" - }, - { - "value": "th_TH", - "name": "TH_TH", - "description": "Thai (Thailand)" - }, - { - "value": "hi_IN", - "name": "HI_IN", - "description": "Hindi (India)" - }, - { - "value": "bn_BD", - "name": "BN_BD", - "description": "Bengali (Bangladesh)" - }, - { - "value": "fil_PH", - "name": "FIL_PH", - "description": "Filipino (Philippines)" - }, - { - "value": "ur_PK", - "name": "UR_PK", - "description": "Urdu (Pakistan)" - } - ] - }, - "enable": true, - "example": "en_US" - }, - { - "id": "7mBb3WnnJZ", - "name": "startTime", - "required": false, - "description": "Announcement online start time (milliseconds)", - "type": "integer", - "schema": { - "type": "integer", - "format": "int64" - }, - "enable": true, - "example": "1729594043000" - }, - { - "id": "r87zURGF3N", - "name": "endTime", - "required": false, - "description": "Announcement online end time (milliseconds)", - "type": "integer", - "schema": { - "type": "integer", - "format": "int64" - }, - "enable": true, - "example": "1729697729000" - } - ], - "path": [], - "cookie": [], - "header": [] - }, - "responses": [ - { - "id": "10321", - "code": 200, - "name": "OK", - "headers": [], - "jsonSchema": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "data": { - "type": "object", - "properties": { - "totalNum": { - "type": "integer", - "description": "Total Number" - }, - "items": { - "type": "array", - "items": { - "type": "object", - "properties": { - "annId": { - "type": "integer", - "description": "Announcement ID" - }, - "annTitle": { - "type": "string", - "description": "Announcement title" - }, - "annType": { - "type": "array", - "items": { - "type": "string" - }, - "description": "Announcement type" - }, - "annDesc": { - "type": "string", - "description": "Announcement description" - }, - "cTime": { - "type": "integer", - "description": "Announcement release time, Unix millisecond timestamp format", - "format": "int64" - }, - "language": { - "type": "string", - "description": "language type" - }, - "annUrl": { - "type": "string", - "description": "Announcement link" - } - }, - "required": [ - "annId", - "annTitle", - "annType", - "annDesc", - "cTime", - "language", - "annUrl" - ] - } - }, - "currentPage": { - "type": "integer", - "description": "Current page" - }, - "pageSize": { - "type": "integer", - "description": "Page size" - }, - "totalPage": { - "type": "integer", - "description": "Total Page" - } - }, - "required": [ - "totalNum", - "items", - "currentPage", - "pageSize", - "totalPage" - ] - } - }, - "required": [ - "code", - "data" - ] - }, - "description": "", - "contentType": "json", - "mediaType": "" - } - ], - "responseExamples": [ - { - "name": "Success", - "data": "{\n \"code\": \"200000\",\n \"data\": {\n \"totalNum\": 195,\n \"totalPage\": 13,\n \"currentPage\": 1,\n \"pageSize\": 15,\n \"items\": [\n {\n \"annId\": 129045,\n \"annTitle\": \"KuCoin Isolated Margin Adds the Scroll (SCR) Trading Pair\",\n \"annType\": [\n \"latest-announcements\"\n ],\n \"annDesc\": \"To enrich the variety of assets available, KuCoin’s Isolated Margin Trading platform has added the Scroll (SCR) asset and trading pair.\",\n \"cTime\": 1729594043000,\n \"language\": \"en_US\",\n \"annUrl\": \"https://www.kucoin.com/announcement/kucoin-isolated-margin-adds-scr?lang=en_US\"\n },\n {\n \"annId\": 129001,\n \"annTitle\": \"DAPP-30D Fixed Promotion, Enjoy an APR of 200%!​\",\n \"annType\": [\n \"latest-announcements\",\n \"activities\"\n ],\n \"annDesc\": \"KuCoin Earn will be launching the DAPP Fixed Promotion at 10:00:00 on October 22, 2024 (UTC). The available product is “DAPP-30D'' with an APR of 200%.\",\n \"cTime\": 1729588460000,\n \"language\": \"en_US\",\n \"annUrl\": \"https://www.kucoin.com/announcement/dapp-30d-fixed-promotion-enjoy?lang=en_US\"\n },\n {\n \"annId\": 128581,\n \"annTitle\": \"NAYM (NAYM) Gets Listed on KuCoin! World Premiere!\",\n \"annType\": [\n \"latest-announcements\",\n \"new-listings\"\n ],\n \"annDesc\": \"Trading: 11:00 on October 22, 2024 (UTC)\",\n \"cTime\": 1729497729000,\n \"language\": \"en_US\",\n \"annUrl\": \"https://www.kucoin.com/announcement/en-naym-naym-gets-listed-on-kucoin-world-premiere?lang=en_US\"\n }\n ]\n }\n}", - "responseId": 10321, - "ordering": 1 - } - ], - "requestBody": { - "type": "none", - "parameters": [], - "jsonSchema": { - "type": "object", - "properties": {} - }, - "mediaType": "" - }, - "description": ":::info[Description]\nThis interface can obtain the latest news announcements, and the default page search is for announcements within a month.\n:::\n", - "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Spot\",\"api-channel\":\"Public\",\"api-permission\":\"NULL\",\"api-rate-limit-pool\":\"Public\",\"sdk-service\":\"Spot\",\"sdk-sub-service\":\"Market\",\"sdk-method-name\":\"getAnnouncements\",\"sdk-method-description\":\"This interface can obtain the latest news announcements, and the default page search is for announcements within a month.\",\"api-rate-limit\":20}" - } - }, - { - "name": "Get Service Status", - "api": { - "id": "3470158", - "method": "get", - "path": "/api/v1/status", - "parameters": { - "path": [], - "query": [], - "cookie": [], - "header": [] - }, - "responses": [ - { - "id": "10322", - "code": 200, - "name": "OK", - "headers": [], - "jsonSchema": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "data": { - "type": "object", - "properties": { - "status": { - "type": "string", - "description": "Status of service: open:normal transaction, close:Stop Trading/Maintenance, cancelonly:can only cancel the order but not place order", - "enum": [ - "open", - "close", - "cancelonly" - ], - "x-api-enum": [ - { - "value": "open", - "name": "OPEN", - "description": "normal transaction" - }, - { - "value": "close", - "name": "CLOSE", - "description": "Stop Trading/Maintenance" - }, - { - "value": "cancelonly", - "name": "CANCELONLY", - "description": "can only cancel the order but not place order" - } - ] - }, - "msg": { - "type": "string", - "description": "Remark for operation" - } - }, - "required": [ - "status", - "msg" - ] - } - }, - "required": [ - "code", - "data" - ] - }, - "description": "", - "contentType": "json", - "mediaType": "" - } - ], - "responseExamples": [ - { - "name": "Success", - "data": "{\"code\":\"200000\",\"data\":{\"status\":\"open\",\"msg\":\"\"}}", - "responseId": 10322, - "ordering": 1 - } - ], - "requestBody": { - "type": "none", - "parameters": [], - "jsonSchema": { - "type": "object", - "properties": {} - }, - "mediaType": "" - }, - "description": ":::info[Description]\nGet the service status\n:::", - "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Spot\",\"api-channel\":\"Public\",\"api-permission\":\"NULL\",\"api-rate-limit-pool\":\"Public\",\"sdk-service\":\"Spot\",\"sdk-sub-service\":\"Market\",\"sdk-method-name\":\"getServiceStatus\",\"sdk-method-description\":\"Get the service status\",\"api-rate-limit\":3}" - } - }, - { - "name": "Get Symbol ", - "api": { - "id": "3470159", - "method": "get", - "path": "/api/v2/symbols/{symbol}", - "parameters": { - "path": [ - { - "id": "symbol#0", - "name": "symbol", - "required": true, - "description": "Path parameter, Symbol", - "example": "BTC-USDT", - "type": "string", - "schema": { - "type": "string" - } - } - ], - "query": [], - "cookie": [], - "header": [] - }, - "responses": [ - { - "id": "10323", - "code": 200, - "name": "OK", - "headers": [], - "jsonSchema": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "data": { - "type": "object", - "properties": { - "symbol": { - "type": "string", - "description": "unique code of a symbol, it would not change after renaming", - "examples": [ - "BTC-USDT", - "BCHSV-USDT" - ] - }, - "name": { - "type": "string", - "description": "Name of trading pairs, it would change after renaming", - "examples": [ - "BTC-USDT", - "BSV-USDT" - ] - }, - "baseCurrency": { - "type": "string", - "description": "Base currency,e.g. BTC." - }, - "quoteCurrency": { - "type": "string", - "description": "Quote currency,e.g. USDT." - }, - "feeCurrency": { - "type": "string", - "description": "The currency of charged fees." - }, - "market": { - "type": "string", - "description": "The trading market.", - "examples": [ - "USDS", - "BTC", - "ALTS" - ] - }, - "baseMinSize": { - "type": "string", - "description": "The minimum order quantity requried to place an order." - }, - "quoteMinSize": { - "type": "string", - "description": "The minimum order funds required to place a market order." - }, - "baseMaxSize": { - "type": "string", - "description": "The maximum order size required to place an order." - }, - "quoteMaxSize": { - "type": "string", - "description": "The maximum order funds required to place a market order." - }, - "baseIncrement": { - "type": "string", - "description": "Quantity increment: The quantity for an order must be a positive integer multiple of this increment. Here, the size refers to the quantity of the base currency for the order. For example, for the ETH-USDT trading pair, if the baseIncrement is 0.0000001, the order quantity can be 1.0000001 but not 1.00000001." - }, - "quoteIncrement": { - "type": "string", - "description": "Quote increment: The funds for a market order must be a positive integer multiple of this increment. The funds refer to the quote currency amount. For example, for the ETH-USDT trading pair, if the quoteIncrement is 0.000001, the amount of USDT for the order can be 3000.000001 but not 3000.0000001." - }, - "priceIncrement": { - "type": "string", - "description": "Price increment: The price of an order must be a positive integer multiple of this increment. For example, for the ETH-USDT trading pair, if the priceIncrement is 0.01, the order price can be 3000.01 but not 3000.001." - }, - "priceLimitRate": { - "type": "string", - "description": "Threshold for price portection" - }, - "minFunds": { - "type": "string", - "description": "the minimum trading amounts" - }, - "isMarginEnabled": { - "type": "boolean", - "description": "Available for margin or not." - }, - "enableTrading": { - "type": "boolean", - "description": "Available for transaction or not." - }, - "feeCategory": { - "type": "integer", - "description": "[Fee Type](https://www.kucoin.com/vip/privilege)", - "enum": [ - 1, - 2, - 3 - ], - "x-api-enum": [ - { - "value": 1, - "name": "classA", - "description": "classA" - }, - { - "value": 2, - "name": "classB", - "description": "classB" - }, - { - "value": 3, - "name": "classC", - "description": "classC" - } - ] - }, - "makerFeeCoefficient": { - "type": "string", - "description": "The maker fee coefficient. The actual fee needs to be multiplied by this coefficient to get the final fee. Most currencies have a coefficient of 1. If set to 0, it means no fee" - }, - "takerFeeCoefficient": { - "type": "string", - "description": "The taker fee coefficient. The actual fee needs to be multiplied by this coefficient to get the final fee. Most currencies have a coefficient of 1. If set to 0, it means no fee" - }, - "st": { - "type": "boolean" - } - }, - "required": [ - "symbol", - "name", - "baseCurrency", - "quoteCurrency", - "feeCurrency", - "market", - "baseMinSize", - "quoteMinSize", - "baseMaxSize", - "quoteMaxSize", - "baseIncrement", - "quoteIncrement", - "priceIncrement", - "priceLimitRate", - "minFunds", - "isMarginEnabled", - "enableTrading", - "feeCategory", - "makerFeeCoefficient", - "takerFeeCoefficient", - "st" - ] - } - }, - "required": [ - "code", - "data" - ] - }, - "description": "", - "contentType": "json", - "mediaType": "" - } - ], - "responseExamples": [ - { - "name": "Success", - "data": "{\"code\":\"200000\",\"data\":{\"symbol\":\"BTC-USDT\",\"name\":\"BTC-USDT\",\"baseCurrency\":\"BTC\",\"quoteCurrency\":\"USDT\",\"feeCurrency\":\"USDT\",\"market\":\"USDS\",\"baseMinSize\":\"0.00001\",\"quoteMinSize\":\"0.1\",\"baseMaxSize\":\"10000000000\",\"quoteMaxSize\":\"99999999\",\"baseIncrement\":\"0.00000001\",\"quoteIncrement\":\"0.000001\",\"priceIncrement\":\"0.1\",\"priceLimitRate\":\"0.1\",\"minFunds\":\"0.1\",\"isMarginEnabled\":true,\"enableTrading\":true,\"feeCategory\":1,\"makerFeeCoefficient\":\"1.00\",\"takerFeeCoefficient\":\"1.00\",\"st\":false}}", - "responseId": 10323, - "ordering": 1 - } - ], - "requestBody": { - "type": "none", - "parameters": [], - "jsonSchema": { - "type": "object", - "properties": {} - }, - "mediaType": "" - }, - "description": ":::info[Description]\nRequest via this endpoint to get detail currency pairs for trading. If you want to get the market information of the trading symbol, please use Get All Tickers.\n:::\n\n\n- The baseMinSize and baseMaxSize fields define the min and max order size.\n- The priceIncrement field specifies the min order price as well as the price increment.This also applies to quote currency.\n\nThe order price must be a positive integer multiple of this priceIncrement (i.e. if the increment is 0.01, the 0.001 and 0.021 order prices would be rejected).\n\npriceIncrement and quoteIncrement may be adjusted in the future. We will notify you by email and site notifications before adjustment.\n\n| Order Type | Follow the rules of minFunds |\n| ------ | ---------- |\n| Limit Buy\t | [Order Amount * Order Price] >= minFunds |\n| Limit Sell | [Order Amount * Order Price] >= minFunds |\n| Market Buy | Order Value >= minFunds |\n| Market Sell | [Order Amount * Last Price of Base Currency] >= minFunds |\n\nNote:\n- API market buy orders (by amount) valued at (Order Amount * Last Price of Base Currency) < minFunds will be rejected.\n- API market sell orders (by value) valued at < minFunds will be rejected.\n- Take profit and stop loss orders at market or limit prices will be rejected when triggered.", - "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Spot\",\"api-channel\":\"Public\",\"api-permission\":\"NULL\",\"api-rate-limit-pool\":\"Public\",\"sdk-service\":\"Spot\",\"sdk-sub-service\":\"Market\",\"sdk-method-name\":\"getSymbol\",\"sdk-method-description\":\"Request via this endpoint to get detail currency pairs for trading. If you want to get the market information of the trading symbol, please use Get All Tickers.\",\"api-rate-limit\":4}" - } - }, - { - "name": "Get Ticker", - "api": { - "id": "3470160", - "method": "get", - "path": "/api/v1/market/orderbook/level1", - "parameters": { - "path": [], - "query": [ - { - "id": "AwnkwQxRMq", - "name": "symbol", - "required": true, - "description": "symbol", - "example": "BTC-USDT", - "type": "string" - } - ], - "cookie": [], - "header": [] - }, - "responses": [ - { - "id": "10324", - "code": 200, - "name": "OK", - "headers": [], - "jsonSchema": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "data": { - "type": "object", - "properties": { - "time": { - "type": "integer", - "description": "timestamp", - "format": "int64" - }, - "sequence": { - "type": "string", - "description": "Sequence" - }, - "price": { - "type": "string", - "description": "Last traded price" - }, - "size": { - "type": "string", - "description": "Last traded size" - }, - "bestBid": { - "type": "string", - "description": "Best bid price" - }, - "bestBidSize": { - "type": "string", - "description": "Best bid size" - }, - "bestAsk": { - "type": "string", - "description": "Best ask price" - }, - "bestAskSize": { - "type": "string", - "description": "Best ask size" - } - }, - "required": [ - "sequence", - "price", - "size", - "bestBid", - "bestBidSize", - "bestAsk", - "bestAskSize", - "time" - ] - } - }, - "required": [ - "code", - "data" - ] - }, - "description": "", - "contentType": "json", - "mediaType": "" - } - ], - "responseExamples": [ - { - "name": "Success", - "data": "{\"code\":\"200000\",\"data\":{\"time\":1729172965609,\"sequence\":\"14609309753\",\"price\":\"67269\",\"size\":\"0.000025\",\"bestBid\":\"67267.5\",\"bestBidSize\":\"0.000025\",\"bestAsk\":\"67267.6\",\"bestAskSize\":\"1.24808993\"}}", - "responseId": 10324, - "ordering": 1 - } - ], - "requestBody": { - "type": "none", - "parameters": [], - "jsonSchema": { - "type": "object", - "properties": {} - }, - "mediaType": "" - }, - "description": ":::info[Description]\nRequest via this endpoint to get Level 1 Market Data. The returned value includes the best bid price and size, the best ask price and size as well as the last traded price and the last traded size.\n:::", - "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Spot\",\"api-channel\":\"Public\",\"api-permission\":\"NULL\",\"api-rate-limit-pool\":\"Public\",\"sdk-service\":\"Spot\",\"sdk-sub-service\":\"Market\",\"sdk-method-name\":\"getTicker\",\"sdk-method-description\":\"Request via this endpoint to get Level 1 Market Data. The returned value includes the best bid price and size, the best ask price and size as well as the last traded price and the last traded size.\",\"api-rate-limit\":2}" - } - }, - { - "name": "Get 24hr Stats", - "api": { - "id": "3470161", - "method": "get", - "path": "/api/v1/market/stats", - "parameters": { - "path": [], - "query": [ - { - "id": "AwnkwQxRMq", - "name": "symbol", - "required": true, - "description": "symbol", - "example": "BTC-USDT", - "type": "string" - } - ], - "cookie": [], - "header": [] - }, - "responses": [ - { - "id": "10325", - "code": 200, - "name": "OK", - "headers": [], - "jsonSchema": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "data": { - "type": "object", - "properties": { - "time": { - "type": "integer", - "description": "timestamp", - "format": "int64" - }, - "symbol": { - "type": "string", - "description": "Symbol" - }, - "buy": { - "type": "string", - "description": "Best bid price\n" - }, - "sell": { - "type": "string", - "description": "Best ask price" - }, - "changeRate": { - "type": "string", - "description": "24h change rate" - }, - "changePrice": { - "type": "string", - "description": "24h change price" - }, - "high": { - "type": "string", - "description": "Highest price in 24h" - }, - "low": { - "type": "string", - "description": "Lowest price in 24h" - }, - "vol": { - "type": "string", - "description": "24h volume, executed based on base currency" - }, - "volValue": { - "type": "string", - "description": "24h traded amount" - }, - "last": { - "type": "string", - "description": "Last traded price" - }, - "averagePrice": { - "type": "string", - "description": "Average trading price in the last 24 hours" - }, - "takerFeeRate": { - "type": "string", - "description": "Basic Taker Fee" - }, - "makerFeeRate": { - "type": "string", - "description": "Basic Maker Fee" - }, - "takerCoefficient": { - "type": "string", - "description": "The taker fee coefficient. The actual fee needs to be multiplied by this coefficient to get the final fee. Most currencies have a coefficient of 1. If set to 0, it means no fee" - }, - "makerCoefficient": { - "type": "string", - "description": "The maker fee coefficient. The actual fee needs to be multiplied by this coefficient to get the final fee. Most currencies have a coefficient of 1. If set to 0, it means no fee" - } - }, - "required": [ - "time", - "symbol", - "buy", - "sell", - "changeRate", - "changePrice", - "high", - "low", - "vol", - "volValue", - "last", - "averagePrice", - "takerFeeRate", - "makerFeeRate", - "takerCoefficient", - "makerCoefficient" - ] - } - }, - "required": [ - "code", - "data" - ] - }, - "description": "", - "contentType": "json", - "mediaType": "" - } - ], - "responseExamples": [ - { - "name": "Success", - "data": "{\"code\":\"200000\",\"data\":{\"time\":1729175612158,\"symbol\":\"BTC-USDT\",\"buy\":\"66982.4\",\"sell\":\"66982.5\",\"changeRate\":\"-0.0114\",\"changePrice\":\"-778.1\",\"high\":\"68107.7\",\"low\":\"66683.3\",\"vol\":\"1738.02898182\",\"volValue\":\"117321982.415978333\",\"last\":\"66981.5\",\"averagePrice\":\"67281.21437289\",\"takerFeeRate\":\"0.001\",\"makerFeeRate\":\"0.001\",\"takerCoefficient\":\"1\",\"makerCoefficient\":\"1\"}}", - "responseId": 10325, - "ordering": 1 - } - ], - "requestBody": { - "type": "none", - "parameters": [], - "jsonSchema": { - "type": "object", - "properties": {} - }, - "mediaType": "" - }, - "description": ":::info[Description]\nRequest via this endpoint to get the statistics of the specified ticker in the last 24 hours.\n:::", - "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Spot\",\"api-channel\":\"Public\",\"api-permission\":\"NULL\",\"api-rate-limit-pool\":\"Public\",\"sdk-service\":\"Spot\",\"sdk-sub-service\":\"Market\",\"sdk-method-name\":\"get24hrStats\",\"sdk-method-description\":\"Request via this endpoint to get the statistics of the specified ticker in the last 24 hours.\",\"api-rate-limit\":15}" - } - }, - { - "name": "Get Trade History", - "api": { - "id": "3470162", - "method": "get", - "path": "/api/v1/market/histories", - "parameters": { - "query": [ - { - "id": "AwnkwQxRMq", - "name": "symbol", - "required": true, - "description": "symbol", - "example": "BTC-USDT", - "type": "string", - "enable": true - } - ], - "path": [], - "cookie": [], - "header": [] - }, - "responses": [ - { - "id": "10326", - "code": 200, - "name": "OK", - "headers": [], - "jsonSchema": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "data": { - "type": "array", - "items": { - "type": "object", - "properties": { - "sequence": { - "type": "string", - "description": "Sequence number" - }, - "price": { - "type": "string", - "description": "Filled price" - }, - "size": { - "type": "string", - "description": "Filled amount" - }, - "side": { - "type": "string", - "description": "Filled side, The trade side indicates the taker order side. A taker order is the order that was matched with orders opened on the order book.", - "enum": [ - "buy", - "sell" - ], - "x-api-enum": [ - { - "value": "buy", - "name": "buy", - "description": "buy" - }, - { - "value": "sell", - "name": "sell", - "description": "sell" - } - ] - }, - "time": { - "type": "integer", - "format": "int64", - "description": "Filled timestamp(nanosecond)" - } - }, - "required": [ - "sequence", - "price", - "size", - "side", - "time" - ] - } - } - }, - "required": [ - "code", - "data" - ] - }, - "description": "", - "contentType": "json", - "mediaType": "" - } - ], - "responseExamples": [ - { - "name": "Success", - "data": "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"sequence\": \"10976028003549185\",\n \"price\": \"67122\",\n \"size\": \"0.000025\",\n \"side\": \"buy\",\n \"time\": 1729177117877000000\n },\n {\n \"sequence\": \"10976028003549188\",\n \"price\": \"67122\",\n \"size\": \"0.01792257\",\n \"side\": \"buy\",\n \"time\": 1729177117877000000\n },\n {\n \"sequence\": \"10976028003549191\",\n \"price\": \"67122.9\",\n \"size\": \"0.05654289\",\n \"side\": \"buy\",\n \"time\": 1729177117877000000\n }\n ]\n}", - "responseId": 10326, - "ordering": 1 - } - ], - "requestBody": { - "type": "none", - "parameters": [], - "jsonSchema": { - "type": "object", - "properties": {} - }, - "mediaType": "" - }, - "description": ":::info[Description]\nRequest via this endpoint to get the trade history of the specified symbol, the returned quantity is the last 100 transaction records.\n:::", - "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Spot\",\"api-channel\":\"Public\",\"api-permission\":\"NULL\",\"api-rate-limit-pool\":\"Public\",\"sdk-service\":\"Spot\",\"sdk-sub-service\":\"Market\",\"sdk-method-name\":\"getTradeHistory\",\"sdk-method-description\":\"Request via this endpoint to get the trade history of the specified symbol, the returned quantity is the last 100 transaction records.\",\"api-rate-limit\":3}" - } - }, - { - "name": "Get Klines", - "api": { - "id": "3470163", - "method": "get", - "path": "/api/v1/market/candles", - "parameters": { - "query": [ - { - "id": "AwnkwQxRMq", - "name": "symbol", - "required": true, - "description": " symbol", - "example": "BTC-USDT", - "type": "string", - "enable": true - }, - { - "id": "FcaM2YvA6p", - "name": "type", - "required": true, - "description": "Type of candlestick patterns: 1min, 3min, 5min, 15min, 30min, 1hour, 2hour, 4hour, 6hour, 8hour, 12hour, 1day, 1week, 1month", - "example": "1min", - "type": "string", - "schema": { - "type": "string", - "enum": [ - "1min", - "3min", - "5min", - "15min", - "30min", - "1hour", - "2hour", - "4hour", - "6hour", - "8hour", - "12hour", - "1day", - "1week", - "1month" - ], - "x-api-enum": [ - { - "value": "1min", - "name": "1min", - "description": "1min" - }, - { - "value": "3min", - "name": "3min", - "description": "3min" - }, - { - "value": "5min", - "name": "5min", - "description": "5min" - }, - { - "value": "15min", - "name": "15min", - "description": "15min" - }, - { - "value": "30min", - "name": "30min", - "description": "30min" - }, - { - "value": "1hour", - "name": "1hour", - "description": "1hour" - }, - { - "value": "2hour", - "name": "2hour", - "description": "2hour" - }, - { - "value": "4hour", - "name": "4hour", - "description": "4hour" - }, - { - "value": "6hour", - "name": "6hour", - "description": "6hour" - }, - { - "value": "8hour", - "name": "8hour", - "description": "8hour" - }, - { - "value": "12hour", - "name": "12hour", - "description": "12hour" - }, - { - "value": "1day", - "name": "1day", - "description": "1day" - }, - { - "value": "1week", - "name": "1week", - "description": "1week" - }, - { - "value": "1month", - "name": "1month", - "description": "1month" - } - ] - }, - "enable": true - }, - { - "id": "LNMS5qTAS3", - "name": "startAt", - "required": false, - "description": "Start time (second), default is 0", - "example": "1566703297", - "type": "integer", - "schema": { - "type": "integer", - "format": "int64", - "default": 0 - }, - "enable": true - }, - { - "id": "gziaY6i2V1", - "name": "endAt", - "required": false, - "description": "End time (second), default is 0", - "example": "1566789757", - "type": "integer", - "schema": { - "type": "integer", - "format": "int64", - "default": 0 - }, - "enable": true - } - ], - "path": [], - "cookie": [], - "header": [] - }, - "responses": [ - { - "id": "10327", - "code": 200, - "name": "OK", - "headers": [], - "jsonSchema": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "data": { - "type": "array", - "items": { - "type": "array", - "items": { - "type": "string", - "description": "Start time of the candle cycle, opening price, closing price, highest price, Lowest price, Transaction amount, Transaction volume" - } - } - } - }, - "required": [ - "code", - "data" - ] - }, - "description": "", - "contentType": "json", - "mediaType": "" - } - ], - "responseExamples": [ - { - "name": "Success", - "data": "{\n \"code\": \"200000\",\n \"data\": [\n [\n \"1566789720\",\n \"10411.5\",\n \"10401.9\",\n \"10411.5\",\n \"10396.3\",\n \"29.11357276\",\n \"302889.301529914\"\n ],\n [\n \"1566789660\",\n \"10416\",\n \"10411.5\",\n \"10422.3\",\n \"10411.5\",\n \"15.61781842\",\n \"162703.708997029\"\n ],\n [\n \"1566789600\",\n \"10408.6\",\n \"10416\",\n \"10416\",\n \"10405.4\",\n \"12.45584973\",\n \"129666.51508559\"\n ]\n ]\n}", - "responseId": 10327, - "ordering": 1 - } - ], - "requestBody": { - "type": "none", - "parameters": [], - "jsonSchema": { - "type": "object", - "properties": {} - }, - "mediaType": "" - }, - "description": ":::info[Description]\nGet the Kline of the symbol. Data are returned in grouped buckets based on requested type.\nFor each query, the system would return at most 1500 pieces of data. To obtain more data, please page the data by time.\n:::\n\n:::tip[Tips]\nKlines data may be incomplete. No data is published for intervals where there are no ticks.\n:::\n", - "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Spot\",\"api-channel\":\"Public\",\"api-permission\":\"NULL\",\"api-rate-limit-pool\":\"Public\",\"sdk-service\":\"Spot\",\"sdk-sub-service\":\"Market\",\"sdk-method-name\":\"getKlines\",\"sdk-method-description\":\"Get the Kline of the symbol. Data are returned in grouped buckets based on requested type. For each query, the system would return at most 1500 pieces of data. To obtain more data, please page the data by time.\",\"api-rate-limit\":3}" - } - }, - { - "name": "Get Full OrderBook", - "api": { - "id": "3470164", - "method": "get", - "path": "/api/v3/market/orderbook/level2", - "parameters": { - "query": [ - { - "id": "AwnkwQxRMq", - "name": "symbol", - "required": true, - "description": "symbol", - "example": "BTC-USDT", - "type": "string", - "enable": true - } - ], - "path": [], - "cookie": [], - "header": [] - }, - "responses": [ - { - "id": "10328", - "code": 200, - "name": "OK", - "headers": [], - "jsonSchema": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "data": { - "type": "object", - "properties": { - "time": { - "type": "integer", - "description": "Timestamp(millisecond)", - "format": "int64" - }, - "sequence": { - "type": "string", - "description": "Sequence number" - }, - "bids": { - "type": "array", - "items": { - "type": "array", - "items": { - "type": "string", - "description": "Price, Size" - } - }, - "description": "bids, from high to low" - }, - "asks": { - "type": "array", - "items": { - "type": "array", - "items": { - "type": "string", - "description": "Price, Size" - } - }, - "description": "asks, from low to high" - } - }, - "required": [ - "time", - "sequence", - "bids", - "asks" - ] - } - }, - "required": [ - "code", - "data" - ] - }, - "description": "", - "contentType": "json", - "mediaType": "" - } - ], - "responseExamples": [ - { - "name": "Success", - "data": "{\n \"code\": \"200000\",\n \"data\": {\n \"time\": 1729176273859,\n \"sequence\": \"14610502970\",\n \"bids\": [\n [\n \"66976.4\",\n \"0.69109872\"\n ],\n [\n \"66976.3\",\n \"0.14377\"\n ]\n ],\n \"asks\": [\n [\n \"66976.5\",\n \"0.05408199\"\n ],\n [\n \"66976.8\",\n \"0.0005\"\n ]\n ]\n }\n}", - "responseId": 10328, - "ordering": 1 - } - ], - "requestBody": { - "type": "none", - "parameters": [], - "jsonSchema": { - "type": "object", - "properties": {} - }, - "mediaType": "" - }, - "description": ":::info[Description]\nQuery for Full orderbook depth data. (aggregated by price)\n\nIt is generally used by professional traders because it uses more server resources and traffic, and we have strict access rate limit control.\n\nTo maintain up-to-date Order Book, please use Websocket incremental feed after retrieving the OrderBook.\n:::", - "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"General\",\"api-rate-limit-pool\":\"Spot\",\"sdk-service\":\"Spot\",\"sdk-sub-service\":\"Market\",\"sdk-method-name\":\"getFullOrderBook\",\"sdk-method-description\":\"Query for Full orderbook depth data. (aggregated by price) It is generally used by professional traders because it uses more server resources and traffic, and we have strict access rate limit control. To maintain up-to-date Order Book, please use Websocket incremental feed after retrieving the OrderBook.\",\"api-rate-limit\":3}" - } - }, - { - "name": "Get Part OrderBook", - "api": { - "id": "3470165", - "method": "get", - "path": "/api/v1/market/orderbook/level2_{size}", - "parameters": { - "query": [ - { - "id": "AwnkwQxRMq", - "name": "symbol", - "required": true, - "description": "symbol", - "example": "BTC-USDT", - "type": "string", - "enable": true - } - ], - "path": [ - { - "id": "size#0", - "name": "size", - "required": true, - "description": "Get the depth layer, optional value: 20, 100", - "example": "20", - "type": "integer", - "schema": { - "type": "integer", - "enum": [ - 20, - 100 - ], - "format": "int32", - "x-api-enum": [ - { - "value": 20, - "name": "size", - "description": "size" - }, - { - "value": 100, - "name": "size", - "description": "size" - } - ] - }, - "enable": true - } - ], - "cookie": [], - "header": [] - }, - "responses": [ - { - "id": "10329", - "code": 200, - "name": "OK", - "headers": [], - "jsonSchema": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "data": { - "type": "object", - "properties": { - "time": { - "type": "integer", - "description": "Timestamp(millisecond)", - "format": "int64" - }, - "sequence": { - "type": "string", - "description": "Sequence number" - }, - "bids": { - "type": "array", - "items": { - "type": "array", - "items": { - "type": "string", - "description": "Price, Size" - } - }, - "description": "bids, from high to low" - }, - "asks": { - "type": "array", - "items": { - "type": "array", - "items": { - "type": "string", - "description": "Price, Size" - } - }, - "description": "asks, from low to high" - } - }, - "required": [ - "sequence", - "bids", - "asks", - "time" - ] - } - }, - "required": [ - "code", - "data" - ] - }, - "description": "", - "contentType": "json", - "mediaType": "" - } - ], - "responseExamples": [ - { - "name": "Success", - "data": "{\n \"code\": \"200000\",\n \"data\": {\n \"time\": 1729176273859,\n \"sequence\": \"14610502970\",\n \"bids\": [\n [\n \"66976.4\",\n \"0.69109872\"\n ],\n [\n \"66976.3\",\n \"0.14377\"\n ]\n ],\n \"asks\": [\n [\n \"66976.5\",\n \"0.05408199\"\n ],\n [\n \"66976.8\",\n \"0.0005\"\n ]\n ]\n }\n}", - "responseId": 10329, - "ordering": 1 - } - ], - "requestBody": { - "type": "none", - "parameters": [], - "jsonSchema": { - "type": "object", - "properties": {} - }, - "mediaType": "" - }, - "description": ":::info[Description]\nQuery for part orderbook depth data. (aggregated by price)\n\nYou are recommended to request via this endpoint as the system reponse would be faster and cosume less traffic.\n:::", - "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Spot\",\"api-channel\":\"Public\",\"api-permission\":\"NULL\",\"api-rate-limit-pool\":\"Public\",\"sdk-service\":\"Spot\",\"sdk-sub-service\":\"Market\",\"sdk-method-name\":\"getPartOrderBook\",\"sdk-method-description\":\"Query for part orderbook depth data. (aggregated by price) You are recommended to request via this endpoint as the system reponse would be faster and cosume less traffic.\",\"api-rate-limit\":2}" - } - }, - { - "name": "Get Market List", - "api": { - "id": "3470166", - "method": "get", - "path": "/api/v1/markets", - "parameters": { - "path": [], - "query": [], - "cookie": [], - "header": [] - }, - "responses": [ - { - "id": "10330", - "code": 200, - "name": "OK", - "headers": [], - "jsonSchema": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "data": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": [ - "code", - "data" - ] - }, - "description": "", - "contentType": "json", - "mediaType": "" - } - ], - "responseExamples": [ - { - "name": "Success", - "data": "{\"code\":\"200000\",\"data\":[\"USDS\",\"TON\",\"AI\",\"DePIN\",\"PoW\",\"BRC-20\",\"ETF\",\"KCS\",\"Meme\",\"Solana\",\"FIAT\",\"VR&AR\",\"DeFi\",\"Polkadot\",\"BTC\",\"ALTS\",\"Layer 1\"]}", - "responseId": 10330, - "ordering": 1 - } - ], - "requestBody": { - "type": "none", - "parameters": [], - "jsonSchema": { - "type": "object", - "properties": {} - }, - "mediaType": "" - }, - "description": ":::info[Description]\nRequest via this endpoint to get the transaction currency for the entire trading market.\n:::\n\n:::tip[Tips]\nSC has been changed to USDS, but you can still use SC as a query parameter\n\nThe three markets of ETH, NEO and TRX are merged into the ALTS market. You can query the trading pairs of the ETH, NEO and TRX markets through the ALTS trading area.\n:::", - "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Spot\",\"api-channel\":\"Public\",\"api-permission\":\"NULL\",\"api-rate-limit-pool\":\"Public\",\"sdk-service\":\"Spot\",\"sdk-sub-service\":\"Market\",\"sdk-method-name\":\"getMarketList\",\"sdk-method-description\":\"Request via this endpoint to get the transaction currency for the entire trading market.\",\"api-rate-limit\":3}" - } - }, - { - "name": "Get All Tickers", - "api": { - "id": "3470167", - "method": "get", - "path": "/api/v1/market/allTickers", - "parameters": { - "path": [], - "query": [], - "cookie": [], - "header": [] - }, - "responses": [ - { - "id": "10331", - "code": 200, - "name": "OK", - "headers": [], - "jsonSchema": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "data": { - "type": "object", - "properties": { - "time": { - "type": "integer", - "description": "timestamp", - "format": "int64" - }, - "ticker": { - "type": "array", - "items": { - "type": "object", - "properties": { - "symbol": { - "type": "string", - "description": "Symbol" - }, - "symbolName": { - "type": "string", - "description": "Name of trading pairs, it would change after renaming" - }, - "buy": { - "type": "string", - "description": "Best bid price" - }, - "bestBidSize": { - "type": "string", - "description": "Best bid size" - }, - "sell": { - "type": "string", - "description": "Best ask price" - }, - "bestAskSize": { - "type": "string", - "description": "Best ask size" - }, - "changeRate": { - "type": "string", - "description": "24h change rate" - }, - "changePrice": { - "type": "string", - "description": "24h change price" - }, - "high": { - "type": "string", - "description": "Highest price in 24h" - }, - "low": { - "type": "string", - "description": "Lowest price in 24h" - }, - "vol": { - "type": "string", - "description": "24h volume, executed based on base currency" - }, - "volValue": { - "type": "string", - "description": "24h traded amount" - }, - "last": { - "type": "string", - "description": "Last traded price" - }, - "averagePrice": { - "type": "string", - "description": "Average trading price in the last 24 hours" - }, - "takerFeeRate": { - "type": "string", - "description": "Basic Taker Fee" - }, - "makerFeeRate": { - "type": "string", - "description": "Basic Maker Fee" - }, - "takerCoefficient": { - "type": "string", - "description": "The taker fee coefficient. The actual fee needs to be multiplied by this coefficient to get the final fee. Most currencies have a coefficient of 1. If set to 0, it means no fee", - "enum": [ - "1", - "0" - ], - "x-api-enum": [ - { - "value": "1", - "name": "1", - "description": "the taker fee coefficient is 1" - }, - { - "value": "0", - "name": "0", - "description": "no fee" - } - ] - }, - "makerCoefficient": { - "type": "string", - "description": "The maker fee coefficient. The actual fee needs to be multiplied by this coefficient to get the final fee. Most currencies have a coefficient of 1. If set to 0, it means no fee", - "enum": [ - "1", - "0" - ], - "x-api-enum": [ - { - "value": "1", - "name": "1", - "description": "the maker fee coefficient is 1" - }, - { - "value": "0", - "name": "0", - "description": "no fee" - } - ] - } - }, - "required": [ - "symbol", - "symbolName", - "buy", - "bestBidSize", - "sell", - "bestAskSize", - "changeRate", - "changePrice", - "high", - "low", - "vol", - "volValue", - "last", - "averagePrice", - "takerFeeRate", - "makerFeeRate", - "takerCoefficient", - "makerCoefficient" - ] - } - } - }, - "required": [ - "time", - "ticker" - ] - } - }, - "required": [ - "code", - "data" - ] - }, - "description": "", - "contentType": "json", - "mediaType": "" - } - ], - "responseExamples": [ - { - "name": "Success", - "data": "{\n \"code\": \"200000\",\n \"data\": {\n \"time\": 1729173207043,\n \"ticker\": [\n {\n \"symbol\": \"BTC-USDT\",\n \"symbolName\": \"BTC-USDT\",\n \"buy\": \"67192.5\",\n \"bestBidSize\": \"0.000025\",\n \"sell\": \"67192.6\",\n \"bestAskSize\": \"1.24949204\",\n \"changeRate\": \"-0.0014\",\n \"changePrice\": \"-98.5\",\n \"high\": \"68321.4\",\n \"low\": \"66683.3\",\n \"vol\": \"1836.03034612\",\n \"volValue\": \"124068431.06726933\",\n \"last\": \"67193\",\n \"averagePrice\": \"67281.21437289\",\n \"takerFeeRate\": \"0.001\",\n \"makerFeeRate\": \"0.001\",\n \"takerCoefficient\": \"1\",\n \"makerCoefficient\": \"1\"\n }\n ]\n }\n}", - "responseId": 10331, - "ordering": 1 - } - ], - "requestBody": { - "type": "none", - "parameters": [], - "jsonSchema": { - "type": "object", - "properties": {} - }, - "mediaType": "" - }, - "description": ":::info[Description]\nRequest market tickers for all the trading pairs in the market (including 24h volume), takes a snapshot every 2 seconds.\n\nOn the rare occasion that we will change the currency name, if you still want the changed symbol name, you can use the symbolName field instead of the symbol field via “Get Symbols List” endpoint.\n:::", - "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Spot\",\"api-channel\":\"Public\",\"api-permission\":\"NULL\",\"api-rate-limit-pool\":\"Public\",\"sdk-service\":\"Spot\",\"sdk-sub-service\":\"Market\",\"sdk-method-name\":\"getAllTickers\",\"sdk-method-description\":\"Request market tickers for all the trading pairs in the market (including 24h volume), takes a snapshot every 2 seconds. On the rare occasion that we will change the currency name, if you still want the changed symbol name, you can use the symbolName field instead of the symbol field via “Get all tickers” endpoint.\",\"api-rate-limit\":15}" - } - } - ] - }, - { - "name": "Orders", - "id": 348147, - "description": "", - "items": [ - { - "name": "Batch Add Orders", - "api": { - "id": "3470168", - "method": "post", - "path": "/api/v1/hf/orders/multi", - "parameters": { - "query": [], - "path": [], - "cookie": [], - "header": [] - }, - "responses": [ - { - "id": "10332", - "code": 200, - "name": "OK", - "headers": [], - "jsonSchema": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "data": { - "type": "array", - "items": { - "type": "object", - "properties": { - "orderId": { - "type": "string", - "description": "The unique order id generated by the trading system,which can be used later for further actions such as canceling the order." - }, - "clientOid": { - "type": "string", - "description": "The user self-defined order id." - }, - "success": { - "type": "boolean", - "description": "Add order success/failure" - }, - "failMsg": { - "type": "string", - "description": "error message" - } - }, - "required": [ - "success" - ] - } - } - }, - "required": [ - "code", - "data" - ] - }, - "description": "", - "contentType": "json", - "mediaType": "" - } - ], - "responseExamples": [ - { - "name": "Success", - "data": "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"orderId\": \"6710d8336afcdb0007319c27\",\n \"clientOid\": \"client order id 12\",\n \"success\": true\n },\n {\n \"success\": false,\n \"failMsg\": \"The order funds should more then 0.1 USDT.\"\n }\n ]\n}", - "responseId": 10332, - "ordering": 1 - } - ], - "requestBody": { - "type": "application/json", - "parameters": [], - "jsonSchema": { - "type": "object", - "properties": { - "orderList": { - "type": "array", - "items": { - "type": "object", - "properties": { - "clientOid": { - "type": "string", - "description": "Client Order Id,The ClientOid field is a unique ID created by the user(we recommend using a UUID), and can only contain numbers, letters, underscores (_), and hyphens (-). This field is returned when order information is obtained. You can use clientOid to tag your orders. ClientOid is different from the order ID created by the service provider. Please do not initiate requests using the same clientOid. The maximum length for the ClientOid is 40 characters.\n" - }, - "symbol": { - "type": "string", - "description": "symbol", - "examples": [ - "BTC-USDT", - "ETH-USDT", - "KCS-USDT" - ] - }, - "type": { - "type": "string", - "description": "Specify if the order is an 'limit' order or 'market' order. ", - "enum": [ - "limit" - ], - "x-api-enum": [ - { - "value": "limit", - "name": "", - "description": "" - } - ] - }, - "timeInForce": { - "type": "string", - "description": "[Time in force](apidog://link/pages/338146) is a special strategy used during trading", - "enum": [ - "GTC", - "GTT", - "IOC", - "FOK" - ], - "default": "GTC", - "x-api-enum": [ - { - "value": "GTC", - "name": "", - "description": "" - }, - { - "value": "GTT", - "name": "", - "description": "" - }, - { - "value": "IOC", - "name": "", - "description": "" - }, - { - "value": "FOK", - "name": "", - "description": "" - } - ] - }, - "side": { - "type": "string", - "description": "Specify if the order is to 'buy' or 'sell'", - "enum": [ - "buy", - "sell" - ], - "x-api-enum": [ - { - "value": "buy", - "name": "", - "description": "" - }, - { - "value": "sell", - "name": "", - "description": "" - } - ] - }, - "price": { - "type": "string", - "description": "Specify price for order" - }, - "size": { - "type": "string", - "description": "Specify quantity for order\n\nWhen **type** is limit, select one out of two: size or funds, size refers to the amount of trading targets (the asset name written in front) for the trading pair. Teh Size must be based on the baseIncrement of the trading pair. The baseIncrement represents the precision for the trading pair. The size of an order must be a positive-integer multiple of baseIncrement and must be between baseMinSize and baseMaxSize.\n\nWhen **type** is market, select one out of two: size or funds" - }, - "stp": { - "type": "string", - "description": "[Self Trade Prevention](apidog://link/pages/338146) is divided into four strategies: CN, CO, CB , and DC", - "enum": [ - "DC", - "CO", - "CN", - "CB" - ], - "x-api-enum": [ - { - "value": "DC", - "name": "", - "description": "" - }, - { - "value": "CO", - "name": "", - "description": "" - }, - { - "value": "CN", - "name": "", - "description": "" - }, - { - "value": "CB", - "name": "", - "description": "" - } - ] - }, - "cancelAfter": { - "type": "integer", - "description": "Cancel after n seconds,the order timing strategy is GTT", - "format": "int64" - }, - "postOnly": { - "type": "boolean", - "default": false, - "description": "passive order labels, this is disabled when the order timing strategy is IOC or FOK" - }, - "hidden": { - "type": "boolean", - "description": "[Hidden order](apidog://link/pages/338146) or not (not shown in order book)", - "default": false - }, - "iceberg": { - "type": "boolean", - "description": "Whether or not only visible portions of orders are shown in [Iceberg orders](apidog://link/pages/338146)", - "default": false - }, - "visibleSize": { - "type": "string", - "description": "Maximum visible quantity in iceberg orders" - }, - "tags": { - "type": "string", - "description": "Order tag, length cannot exceed 20 characters (ASCII)" - }, - "remark": { - "type": "string", - "description": "Order placement remarks, length cannot exceed 20 characters (ASCII)" - }, - "funds": { - "type": "string", - "description": "When **type** is market, select one out of two: size or funds" - } - }, - "required": [ - "type", - "symbol", - "side", - "price" - ] - }, - "description": "Order List" - } - }, - "required": [ - "orderList" - ] - }, - "example": "{\n \"orderList\": [\n {\n \"clientOid\": \"client order id 12\",\n \"symbol\": \"BTC-USDT\",\n \"type\": \"limit\",\n \"side\": \"buy\",\n \"price\": \"30000\",\n \"size\": \"0.00001\"\n },\n {\n \"clientOid\": \"client order id 13\",\n \"symbol\": \"ETH-USDT\",\n \"type\": \"limit\",\n \"side\": \"sell\",\n \"price\": \"2000\",\n \"size\": \"0.00001\"\n }\n ]\n}", - "mediaType": "" - }, - "description": ":::info[Description]\nThis endpoint supports sequential batch order placement from a single endpoint. A maximum of 20 orders can be placed simultaneously.\n:::\n\n\n\n:::tip[Tips]\nThis endpoint only supports order placement requests. To obtain the results of the order placement, you will need to check the order status or subscribe to websocket to obtain information about he order.\n:::\n\n:::tip[Tips]\nPlease note that once your order enters the order book, the system will freeze the handling fees for the order ahead of time.\n\nBefore placing orders, please be sure to fully understand the meaning of the parameters for each trading pair.\n:::\n\n:::tip[Tips]\nThe maximum number of active orders per account is 2000, with a maximum of 200 active orders per trading pair.\n:::\n\n**Public order placement request parameters**\n\n| Param | Type | Mandatory | Description |\n| --------- | ------ | --------- | ----------- |\n| clientOid | String | No | Client Order Id,unique identifier created by the user, the use of UUID is recommended |\n| symbol | String | Yes | symbol |\n| type | String | Yes | Order type `limit` and `market` |\n| side | String | Yes | `buy` or `sell` |\n| stp | String | No | self trade prevention is divided into four strategies: `CN`, `CO`, `CB` , and `DC` |\n| tags | String | No | Order tag, length cannot exceed `20` characters (ASCII) |\n| remark | String | No | Order placement remarks, length cannot exceed `20` characters (ASCII) |\n\n**Additional Request Parameters Required by `limit` Orders**\n\n| Param | Type | Mandatory | Description |\n| ----------- | ------- | --------- | ----------- |\n| price | String | Yes | Specify price for currency |\n| size | String | Yes | Specify quantity for currency |\n| timeInForce | String | No | Order timing strategy `GTC`, `GTT`, `IOC`, `FOK` (The default is `GTC`) |\n| cancelAfter | long | No | Cancel after `n` seconds,the order timing strategy is `GTT` |\n| postOnly | boolean | No | passive order labels, this is disabled when the order timing strategy is `IOC` or `FOK` |\n| hidden | boolean | No | Hidden or not (not shown in order book) |\n| iceberg | boolean | No | Whether or not only visible portions of orders are shown in iceberg orders |\n| visibleSize | String | No | Maximum visible quantity in iceberg orders |\n\n**Additional request parameters required by `market` orders**\n\n| Param | Type | Mandatory | Description |\n| ----- | ------ | --------- | ------------------------------------------ |\n| size | String | No | (Select one out of two: `size` or `funds`) |\n| funds | String | No | (Select one out of two: `size` or `funds`) |\n\n\n**Hold**\n\nFor limit price purchase orders, we will hold the amount of funds (price * size) required for your purchase order. Similarly, for limit price sell orders, we will also hold you sell order assets. When the transaction is executed, the service fees will be calculated. If you cancel a portion of a filled or unfilled order, then the remaining funds or amounts will be released and returned to your account. For market price buy/sell orders that require specific funds, we will hold the required funds in from your account. If only the size is specified, we may freeze (usually for a very short amount of time) all of the funds in your account prior to the order being filled or cancelled.\n\n\n**Order Lifecycle**\n\nWhen an order placement request is successful (the matching engine receives the order) or denied (due to there being insufficient funds or illegal parameter values, etc.), the system will respond to the HTTP request. When an order is successfully placed, the order ID is returned. The order will be matched, which could result in it being fully or partially filled. When an order is fully or partially filled, the remaining portions of the order will be in an active state awaiting to be matched (this does not include IOC orders). Orders that are fully or partially filled(already cancelled) will be put into the “done” state.\n\nUsers that have subscribed to the Market Data Channel can use the order ID (orderId) and client ID (clientOid) to identify messages.\n\n**Price Protection Mechanisms**\n\nPrice protection mechanisms ae enabled for order placements. Rules are detailed below:\n\n- If the spot trading market order/limit order placed by the user can be directly matched with an order in the current order book, the system will judge whether deviation between the price corresponding to the transaction depth and the spread exceeds the threshold value (the threshold value can be obtained using the symbol API endpoint);\n\n- If it is exceeded, for limit orders, the order will be directly cancelled;\n\n- If it is a market order, then the system will partially execute the order. The execution limit will be the order size within the price range corresponding to the threshold value. The remaining orders will not be filled.\n\nFor example: if the threshold value is 10%, when a user places a market price purchase order in the KCS/USDT trading market for 10,000 USDT (the selling price is currently 1.20000), the system will determine that after the order is completely filled, the final price will be 1.40000. (1.40000-1.20000)/1.20000=16.7%>10%. The threshold value is 1.32000. The user’s market price purchase order will be filled only to a maximum of 1.32000. The remaining order portions will not be matched with orders in the order book. Note: this feature may not be able to determine depth with complete accuracy. If your order is not completely filled, it may be because the portion exceeding the threshold value was not filled.\n", - "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"Spot\",\"api-rate-limit-pool\":\"Spot\",\"sdk-service\":\"Spot\",\"sdk-sub-service\":\"Order\",\"sdk-method-name\":\"batchAddOrders\",\"sdk-method-description\":\"This endpoint supports sequential batch order placement from a single endpoint. A maximum of 5orders can be placed simultaneously. The order types must be limit orders of the same trading pair\",\"api-rate-limit\":1}" - } - }, - { - "name": "Batch Add Orders Sync", - "api": { - "id": "3470169", - "method": "post", - "path": "/api/v1/hf/orders/multi/sync", - "parameters": { - "query": [], - "path": [], - "cookie": [], - "header": [] - }, - "responses": [ - { - "id": "10333", - "code": 200, - "name": "OK", - "headers": [], - "jsonSchema": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "data": { - "type": "array", - "items": { - "type": "object", - "properties": { - "orderId": { - "type": "string", - "description": "The unique order id generated by the trading system,which can be used later for further actions such as canceling the order." - }, - "clientOid": { - "type": "string", - "description": "The user self-defined order id." - }, - "orderTime": { - "type": "integer", - "format": "int64" - }, - "originSize": { - "type": "string", - "description": "original order size" - }, - "dealSize": { - "type": "string", - "description": "deal size" - }, - "remainSize": { - "type": "string", - "description": "remain size" - }, - "canceledSize": { - "type": "string", - "description": "Cumulative canceled size" - }, - "status": { - "type": "string", - "description": "Order Status. open:order is active; done:order has been completed", - "enum": [ - "open", - "done" - ], - "x-api-enum": [ - { - "value": "open", - "name": "", - "description": "" - }, - { - "value": "done", - "name": "", - "description": "" - } - ] - }, - "matchTime": { - "type": "integer", - "format": "int64" - }, - "success": { - "type": "boolean", - "description": "Add order success/failure" - }, - "failMsg": { - "type": "string", - "description": "error message" - } - }, - "required": [ - "success" - ] - } - } - }, - "required": [ - "code", - "data" - ] - }, - "description": "", - "contentType": "json", - "mediaType": "" - } - ], - "responseExamples": [ - { - "name": "Success", - "data": "{\"code\":\"200000\",\"data\":[{\"orderId\":\"6711195e5584bc0007bd5aef\",\"clientOid\":\"client order id 13\",\"orderTime\":1729173854299,\"originSize\":\"0.00001\",\"dealSize\":\"0\",\"remainSize\":\"0.00001\",\"canceledSize\":\"0\",\"status\":\"open\",\"matchTime\":1729173854326,\"success\":true},{\"success\":false,\"failMsg\":\"The order funds should more then 0.1 USDT.\"}]}", - "responseId": 10333, - "ordering": 1 - } - ], - "requestBody": { - "type": "application/json", - "parameters": [], - "jsonSchema": { - "type": "object", - "properties": { - "orderList": { - "type": "array", - "items": { - "type": "object", - "properties": { - "clientOid": { - "type": "string", - "description": "Client Order Id,The ClientOid field is a unique ID created by the user(we recommend using a UUID), and can only contain numbers, letters, underscores (_), and hyphens (-). This field is returned when order information is obtained. You can use clientOid to tag your orders. ClientOid is different from the order ID created by the service provider. Please do not initiate requests using the same clientOid. The maximum length for the ClientOid is 40 characters.\n" - }, - "symbol": { - "type": "string", - "description": "symbol", - "examples": [ - "BTC-USDT", - "ETH-USDT", - "KCS-USDT" - ] - }, - "type": { - "type": "string", - "description": "Specify if the order is an 'limit' order or 'market' order. ", - "enum": [ - "limit" - ], - "x-api-enum": [ - { - "value": "limit", - "name": "", - "description": "" - } - ] - }, - "timeInForce": { - "type": "string", - "description": "[Time in force](apidog://link/pages/338146) is a special strategy used during trading", - "enum": [ - "GTC", - "GTT", - "IOC", - "FOK" - ], - "default": "GTC", - "x-api-enum": [ - { - "value": "GTC", - "name": "", - "description": "" - }, - { - "value": "GTT", - "name": "", - "description": "" - }, - { - "value": "IOC", - "name": "", - "description": "" - }, - { - "value": "FOK", - "name": "", - "description": "" - } - ] - }, - "side": { - "type": "string", - "description": "Specify if the order is to 'buy' or 'sell'", - "enum": [ - "buy", - "sell" - ], - "x-api-enum": [ - { - "value": "buy", - "name": "", - "description": "" - }, - { - "value": "sell", - "name": "", - "description": "" - } - ] - }, - "price": { - "type": "string", - "description": "Specify price for order" - }, - "size": { - "type": "string", - "description": "Specify quantity for order\n\nWhen **type** is limit, select one out of two: size or funds, size refers to the amount of trading targets (the asset name written in front) for the trading pair. Teh Size must be based on the baseIncrement of the trading pair. The baseIncrement represents the precision for the trading pair. The size of an order must be a positive-integer multiple of baseIncrement and must be between baseMinSize and baseMaxSize.\n\nWhen **type** is market, select one out of two: size or funds" - }, - "stp": { - "type": "string", - "description": "[Self Trade Prevention](apidog://link/pages/338146) is divided into four strategies: CN, CO, CB , and DC", - "enum": [ - "DC", - "CO", - "CN", - "CB" - ], - "x-api-enum": [ - { - "value": "DC", - "name": "", - "description": "" - }, - { - "value": "CO", - "name": "", - "description": "" - }, - { - "value": "CN", - "name": "", - "description": "" - }, - { - "value": "CB", - "name": "", - "description": "" - } - ] - }, - "cancelAfter": { - "type": "integer", - "description": "Cancel after n seconds,the order timing strategy is GTT", - "format": "int64" - }, - "postOnly": { - "type": "boolean", - "default": false, - "description": "passive order labels, this is disabled when the order timing strategy is IOC or FOK" - }, - "hidden": { - "type": "boolean", - "description": "[Hidden order](apidog://link/pages/338146) or not (not shown in order book)", - "default": false - }, - "iceberg": { - "type": "boolean", - "description": "Whether or not only visible portions of orders are shown in [Iceberg orders](apidog://link/pages/338146)", - "default": false - }, - "visibleSize": { - "type": "string", - "description": "Maximum visible quantity in iceberg orders" - }, - "tags": { - "type": "string", - "description": "Order tag, length cannot exceed 20 characters (ASCII)" - }, - "remark": { - "type": "string", - "description": "Order placement remarks, length cannot exceed 20 characters (ASCII)" - }, - "funds": { - "type": "string", - "description": "When **type** is market, select one out of two: size or funds" - } - }, - "required": [ - "type", - "symbol", - "side", - "price" - ] - }, - "description": "Order List" - } - }, - "required": [ - "orderList" - ] - }, - "example": "{\n \"orderList\": [\n {\n \"clientOid\": \"client order id 13\",\n \"symbol\": \"BTC-USDT\",\n \"type\": \"limit\",\n \"side\": \"buy\",\n \"price\": \"30000\",\n \"size\": \"0.00001\"\n },\n {\n \"clientOid\": \"client order id 14\",\n \"symbol\": \"ETH-USDT\",\n \"type\": \"limit\",\n \"side\": \"sell\",\n \"price\": \"2000\",\n \"size\": \"0.00001\"\n }\n ]\n}", - "mediaType": "" - }, - "description": ":::info[Description]\nThis endpoint supports sequential batch order placement from a single endpoint. A maximum of 20 orders can be placed simultaneously.\n\nThe difference between this interface and \"Batch Add Orders\" is that this interface will synchronously return the order information after the order matching is completed.\n\nFor higher latency requirements, please select the \"Batch Add Orders\" interface. If there is a requirement for returning data integrity, please select this interface\n:::\n\n\n\n:::tip[Tips]\nThis endpoint only supports order placement requests. To obtain the results of the order placement, you will need to check the order status or subscribe to websocket to obtain information about he order.\n:::\n\n:::tip[Tips]\nPlease note that once your order enters the order book, the system will freeze the handling fees for the order ahead of time.\n\nBefore placing orders, please be sure to fully understand the meaning of the parameters for each trading pair.\n:::\n\n:::tip[Tips]\nThe maximum number of active orders per account is 2000, with a maximum of 200 active orders per trading pair.\n:::\n\n**Public order placement request parameters**\n\n| Param | Type | Mandatory | Description |\n| --------- | ------ | --------- | ----------- |\n| clientOid | String | No | Client Order Id,unique identifier created by the user, the use of UUID is recommended |\n| symbol | String | Yes | symbol |\n| type | String | Yes | Order type `limit` and `market` |\n| side | String | Yes | `buy` or `sell` |\n| stp | String | No | self trade prevention is divided into four strategies: `CN`, `CO`, `CB` , and `DC` |\n| tags | String | No | Order tag, length cannot exceed `20` characters (ASCII) |\n| remark | String | No | Order placement remarks, length cannot exceed `20` characters (ASCII) |\n\n**Additional Request Parameters Required by `limit` Orders**\n\n| Param | Type | Mandatory | Description |\n| ----------- | ------- | --------- | ----------- |\n| price | String | Yes | Specify price for currency |\n| size | String | Yes | Specify quantity for currency |\n| timeInForce | String | No | Order timing strategy `GTC`, `GTT`, `IOC`, `FOK` (The default is `GTC`) |\n| cancelAfter | long | No | Cancel after `n` seconds,the order timing strategy is `GTT` |\n| postOnly | boolean | No | passive order labels, this is disabled when the order timing strategy is `IOC` or `FOK` |\n| hidden | boolean | No | Hidden or not (not shown in order book) |\n| iceberg | boolean | No | Whether or not only visible portions of orders are shown in iceberg orders |\n| visibleSize | String | No | Maximum visible quantity in iceberg orders |\n\n**Additional request parameters required by `market` orders**\n\n| Param | Type | Mandatory | Description |\n| ----- | ------ | --------- | ------------------------------------------ |\n| size | String | No | (Select one out of two: `size` or `funds`) |\n| funds | String | No | (Select one out of two: `size` or `funds`) |\n\n\n**Hold**\n\nFor limit price purchase orders, we will hold the amount of funds (price * size) required for your purchase order. Similarly, for limit price sell orders, we will also hold you sell order assets. When the transaction is executed, the service fees will be calculated. If you cancel a portion of a filled or unfilled order, then the remaining funds or amounts will be released and returned to your account. For market price buy/sell orders that require specific funds, we will hold the required funds in from your account. If only the size is specified, we may freeze (usually for a very short amount of time) all of the funds in your account prior to the order being filled or cancelled.\n\n\n**Order Lifecycle**\n\nWhen an order placement request is successful (the matching engine receives the order) or denied (due to there being insufficient funds or illegal parameter values, etc.), the system will respond to the HTTP request. When an order is successfully placed, the order ID is returned. The order will be matched, which could result in it being fully or partially filled. When an order is fully or partially filled, the remaining portions of the order will be in an active state awaiting to be matched (this does not include IOC orders). Orders that are fully or partially filled(already cancelled) will be put into the “done” state.\n\nUsers that have subscribed to the Market Data Channel can use the order ID (orderId) and client ID (clientOid) to identify messages.\n\n**Price Protection Mechanisms**\n\nPrice protection mechanisms ae enabled for order placements. Rules are detailed below:\n\n- If the spot trading market order/limit order placed by the user can be directly matched with an order in the current order book, the system will judge whether deviation between the price corresponding to the transaction depth and the spread exceeds the threshold value (the threshold value can be obtained using the symbol API endpoint);\n\n- If it is exceeded, for limit orders, the order will be directly cancelled;\n\n- If it is a market order, then the system will partially execute the order. The execution limit will be the order size within the price range corresponding to the threshold value. The remaining orders will not be filled.\n\nFor example: if the threshold value is 10%, when a user places a market price purchase order in the KCS/USDT trading market for 10,000 USDT (the selling price is currently 1.20000), the system will determine that after the order is completely filled, the final price will be 1.40000. (1.40000-1.20000)/1.20000=16.7%>10%. The threshold value is 1.32000. The user’s market price purchase order will be filled only to a maximum of 1.32000. The remaining order portions will not be matched with orders in the order book. Note: this feature may not be able to determine depth with complete accuracy. If your order is not completely filled, it may be because the portion exceeding the threshold value was not filled.\n", - "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"Spot\",\"api-rate-limit-pool\":\"Spot\",\"sdk-service\":\"Spot\",\"sdk-sub-service\":\"Order\",\"sdk-method-name\":\"batchAddOrdersSync\",\"sdk-method-description\":\"This endpoint supports sequential batch order placement from a single endpoint. A maximum of 5orders can be placed simultaneously. The order types must be limit orders of the same trading pair\",\"api-rate-limit\":1}" - } - }, - { - "name": "Add Order Sync", - "api": { - "id": "3470170", - "method": "post", - "path": "/api/v1/hf/orders/sync", - "parameters": { - "query": [], - "path": [], - "cookie": [], - "header": [] - }, - "responses": [ - { - "id": "10334", - "code": 200, - "name": "OK", - "headers": [], - "jsonSchema": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "data": { - "type": "object", - "properties": { - "orderId": { - "type": "string", - "description": "The unique order id generated by the trading system,which can be used later for further actions such as canceling the order." - }, - "clientOid": { - "type": "string", - "description": "The user self-defined order id." - }, - "orderTime": { - "type": "integer", - "format": "int64" - }, - "originSize": { - "type": "string", - "description": "original order size" - }, - "dealSize": { - "type": "string", - "description": "deal size" - }, - "remainSize": { - "type": "string", - "description": "remain size" - }, - "canceledSize": { - "type": "string", - "description": "Cumulative canceled size" - }, - "status": { - "type": "string", - "description": "Order Status. open:order is active; done:order has been completed", - "enum": [ - "open", - "done" - ], - "x-api-enum": [ - { - "value": "open", - "name": "", - "description": "" - }, - { - "value": "done", - "name": "", - "description": "" - } - ] - }, - "matchTime": { - "type": "integer", - "format": "int64" - } - }, - "required": [ - "orderId", - "clientOid", - "orderTime", - "originSize", - "dealSize", - "remainSize", - "canceledSize", - "status", - "matchTime" - ] - } - }, - "required": [ - "code", - "data" - ] - }, - "description": "", - "contentType": "json", - "mediaType": "" - } - ], - "responseExamples": [ - { - "name": "Success", - "data": "{\"code\":\"200000\",\"data\":{\"orderId\":\"67111a7cb7cbdf000703e1f6\",\"clientOid\":\"5c52e11203aa677f33e493f\",\"orderTime\":1729174140586,\"originSize\":\"0.00001\",\"dealSize\":\"0\",\"remainSize\":\"0.00001\",\"canceledSize\":\"0\",\"status\":\"open\",\"matchTime\":1729174140588}}", - "responseId": 10334, - "ordering": 1 - } - ], - "requestBody": { - "type": "application/json", - "parameters": [], - "jsonSchema": { - "type": "object", - "properties": { - "clientOid": { - "type": "string", - "description": "Client Order Id,The ClientOid field is a unique ID created by the user(we recommend using a UUID), and can only contain numbers, letters, underscores (_), and hyphens (-). This field is returned when order information is obtained. You can use clientOid to tag your orders. ClientOid is different from the order ID created by the service provider. Please do not initiate requests using the same clientOid. The maximum length for the ClientOid is 40 characters.\n\nPlease remember the orderId created by the service provider, it used to check for updates in order status.", - "examples": [ - "5c52e11203aa677f33e493fb" - ] - }, - "side": { - "type": "string", - "description": "specify if the order is to 'buy' or 'sell'", - "enum": [ - "buy", - "sell" - ], - "examples": [ - "buy" - ], - "x-api-enum": [ - { - "value": "buy", - "name": "", - "description": "" - }, - { - "value": "sell", - "name": "", - "description": "" - } - ] - }, - "symbol": { - "type": "string", - "description": "symbol", - "examples": [ - "BTC-USDT", - "ETH-USDT", - "KCS-USDT" - ] - }, - "type": { - "type": "string", - "description": "specify if the order is an 'limit' order or 'market' order. \n\nThe type of order you specify when you place your order determines whether or not you need to request other parameters and also affects the execution of the matching engine.\n\nWhen placing a limit order, you must specify a price and size. The system will try to match the order according to market price or a price better than market price. If the order cannot be immediately matched, it will stay in the order book until it is matched or the user cancels.\n\nUnlike limit orders, the price for market orders fluctuates with market prices. When placing a market order, you do not need to specify a price, you only need to specify a quantity. Market orders are filled immediately and will not enter the order book. All market orders are takers and a taker fee will be charged.", - "enum": [ - "limit", - "market" - ], - "examples": [ - "limit" - ], - "x-api-enum": [ - { - "value": "limit", - "name": "", - "description": "" - }, - { - "value": "market", - "name": "", - "description": "" - } - ] - }, - "remark": { - "type": "string", - "description": "Order placement remarks, length cannot exceed 20 characters (ASCII)" - }, - "stp": { - "type": "string", - "description": "[Self Trade Prevention](apidog://link/pages/338146) is divided into four strategies: CN, CO, CB , and DC", - "enum": [ - "DC", - "CO", - "CN", - "CB" - ], - "x-api-enum": [ - { - "value": "DC", - "name": "", - "description": "" - }, - { - "value": "CO", - "name": "", - "description": "" - }, - { - "value": "CN", - "name": "", - "description": "" - }, - { - "value": "CB", - "name": "", - "description": "" - } - ] - }, - "price": { - "type": "string", - "description": "Specify price for order\n\nWhen placing a limit order, the price must be based on priceIncrement for the trading pair. The price increment (priceIncrement) is the price precision for the trading pair. For example, for the BTC-USDT trading pair, the priceIncrement is 0.00001000. So the price for your orders cannot be less than 0.00001000 and must be a multiple of priceIncrement. Otherwise, the order will return an invalid priceIncrement error." - }, - "size": { - "type": "string", - "description": "Specify quantity for order\n\nWhen **type** is limit, size refers to the amount of trading targets (the asset name written in front) for the trading pair. Teh Size must be based on the baseIncrement of the trading pair. The baseIncrement represents the precision for the trading pair. The size of an order must be a positive-integer multiple of baseIncrement and must be between baseMinSize and baseMaxSize.\n\nWhen **type** is market, select one out of two: size or funds" - }, - "timeInForce": { - "type": "string", - "description": "[Time in force](apidog://link/pages/338146) is a special strategy used during trading", - "enum": [ - "GTC", - "GTT", - "IOC", - "FOK" - ], - "default": "GTC", - "x-api-enum": [ - { - "value": "GTC", - "name": "", - "description": "" - }, - { - "value": "GTT", - "name": "", - "description": "" - }, - { - "value": "IOC", - "name": "", - "description": "" - }, - { - "value": "FOK", - "name": "", - "description": "" - } - ] - }, - "postOnly": { - "type": "boolean", - "default": false, - "description": "passive order labels, this is disabled when the order timing strategy is IOC or FOK" - }, - "hidden": { - "type": "boolean", - "description": "[Hidden order](apidog://link/pages/338146) or not (not shown in order book)", - "default": false - }, - "iceberg": { - "type": "boolean", - "description": "Whether or not only visible portions of orders are shown in [Iceberg orders](apidog://link/pages/338146)", - "default": false - }, - "visibleSize": { - "type": "string", - "description": "Maximum visible quantity in iceberg orders" - }, - "tags": { - "type": "string", - "description": "Order tag, length cannot exceed 20 characters (ASCII)" - }, - "cancelAfter": { - "type": "integer", - "format": "int64", - "description": "Cancel after n seconds,the order timing strategy is GTT" - }, - "funds": { - "type": "string", - "description": "When **type** is market, select one out of two: size or funds" - } - }, - "required": [ - "symbol", - "type", - "side" - ] - }, - "example": "//limit order\n{\n \"type\": \"limit\",\n \"symbol\": \"BTC-USDT\",\n \"side\": \"buy\",\n \"price\": \"50000\",\n \"size\": \"0.00001\",\n \"clientOid\": \"5c52e11203aa677f33e493f\",\n \"remark\": \"order remarks\"\n}\n\n//market order 1\n// {\n// \"type\": \"market\",\n// \"symbol\": \"BTC-USDT\",\n// \"side\": \"buy\",\n// \"size\": \"0.00001\",\n// \"clientOid\": \"5c52e11203aa677f33e493fc\",\n// \"remark\": \"order remarks\",\n// }\n\n//market order 2\n// {\n// \"type\": \"market\",\n// \"symbol\": \"BTC-USDT\",\n// \"side\": \"buy\",\n// \"funds\": \"1\",\n// \"clientOid\": \"5c52e11203aa677f33e493fc\",\n// \"remark\": \"order remarks\",\n// }\n", - "mediaType": "" - }, - "description": ":::info[Description]\nPlace order to the spot trading system\n\nThe difference between this interface and \"Add order\" is that this interface will synchronously return the order information after the order matching is completed.\n\nFor higher latency requirements, please select the \"Add order\" interface. If there is a requirement for returning data integrity, please select this interface\n:::\n\n:::tip[Tips]\nPlease note that once your order enters the order book, the system will freeze the handling fees for the order ahead of time.\n\nBefore placing orders, please be sure to fully understand the meaning of the parameters for each trading pair.\n:::\n\n:::tip[Tips]\nThe maximum number of active orders per account is 2000, with a maximum of 200 active orders per trading pair.\n:::\n\n\n**Public order placement request parameters**\n\n| Param | Type | Mandatory | Description |\n| --------- | ------ | --------- | ----------- |\n| clientOid | String | No | Client Order Id,unique identifier created by the user, the use of UUID is recommended |\n| symbol | String | Yes | symbol |\n| type | String | Yes | Order type `limit` and `market` |\n| side | String | Yes | `buy` or `sell` |\n| stp | String | No | self trade prevention is divided into four strategies: `CN`, `CO`, `CB` , and `DC` |\n| tags | String | No | Order tag, length cannot exceed `20` characters (ASCII) |\n| remark | String | No | Order placement remarks, length cannot exceed `20` characters (ASCII) |\n\n**Additional Request Parameters Required by `limit` Orders**\n\n| Param | Type | Mandatory | Description |\n| ----------- | ------- | --------- | ----------- |\n| price | String | Yes | Specify price for currency |\n| size | String | Yes | Specify quantity for currency |\n| timeInForce | String | No | Order timing strategy `GTC`, `GTT`, `IOC`, `FOK` (The default is `GTC`) |\n| cancelAfter | long | No | Cancel after `n` seconds,the order timing strategy is `GTT` |\n| postOnly | boolean | No | passive order labels, this is disabled when the order timing strategy is `IOC` or `FOK` |\n| hidden | boolean | No | Hidden or not (not shown in order book) |\n| iceberg | boolean | No | Whether or not only visible portions of orders are shown in iceberg orders |\n| visibleSize | String | No | Maximum visible quantity in iceberg orders |\n\n**Additional request parameters required by `market` orders**\n\n| Param | Type | Mandatory | Description |\n| ----- | ------ | --------- | ------------------------------------------ |\n| size | String | No | (Select one out of two: `size` or `funds`) |\n| funds | String | No | (Select one out of two: `size` or `funds`) |\n\n\n\n**Hold**\n\nFor limit price purchase orders, we will hold the amount of funds (price * size) required for your purchase order. Similarly, for limit price sell orders, we will also hold you sell order assets. When the transaction is executed, the service fees will be calculated. If you cancel a portion of a filled or unfilled order, then the remaining funds or amounts will be released and returned to your account. For market price buy/sell orders that require specific funds, we will hold the required funds in from your account. If only the size is specified, we may freeze (usually for a very short amount of time) all of the funds in your account prior to the order being filled or cancelled.\n\n\n**Order Lifecycle**\n\nWhen an order placement request is successful (the matching engine receives the order) or denied (due to there being insufficient funds or illegal parameter values, etc.), the system will respond to the HTTP request. When an order is successfully placed, the order ID is returned. The order will be matched, which could result in it being fully or partially filled. When an order is fully or partially filled, the remaining portions of the order will be in an active state awaiting to be matched (this does not include IOC orders). Orders that are fully or partially filled(already cancelled) will be put into the “done” state.\n\nUsers that have subscribed to the Market Data Channel can use the order ID (orderId) and client ID (clientOid) to identify messages.\n\n**Price Protection Mechanisms**\n\nPrice protection mechanisms ae enabled for order placements. Rules are detailed below:\n\n- If the spot trading market order/limit order placed by the user can be directly matched with an order in the current order book, the system will judge whether deviation between the price corresponding to the transaction depth and the spread exceeds the threshold value (the threshold value can be obtained using the symbol API endpoint);\n\n- If it is exceeded, for limit orders, the order will be directly cancelled;\n\n- If it is a market order, then the system will partially execute the order. The execution limit will be the order size within the price range corresponding to the threshold value. The remaining orders will not be filled.\n\nFor example: if the threshold value is 10%, when a user places a market price purchase order in the KCS/USDT trading market for 10,000 USDT (the selling price is currently 1.20000), the system will determine that after the order is completely filled, the final price will be 1.40000. (1.40000-1.20000)/1.20000=16.7%>10%. The threshold value is 1.32000. The user’s market price purchase order will be filled only to a maximum of 1.32000. The remaining order portions will not be matched with orders in the order book. Note: this feature may not be able to determine depth with complete accuracy. If your order is not completely filled, it may be because the portion exceeding the threshold value was not filled.\n", - "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"Spot\",\"api-rate-limit-pool\":\"Spot\",\"sdk-service\":\"Spot\",\"sdk-sub-service\":\"Order\",\"sdk-method-name\":\"addOrderSync\",\"sdk-method-description\":\"Place order to the spot trading system The difference between this interface and \\\"Add order\\\" is that this interface will synchronously return the order information after the order matching is completed. For higher latency requirements, please select the \\\"Add order\\\" interface. If there is a requirement for returning data integrity, please select this interface\",\"api-rate-limit\":1}" - } - }, - { - "name": "Modify Order", - "api": { - "id": "3470171", - "method": "post", - "path": "/api/v1/hf/orders/alter", - "parameters": { - "query": [], - "path": [], - "cookie": [], - "header": [] - }, - "responses": [ - { - "id": "10335", - "code": 200, - "name": "OK", - "headers": [], - "jsonSchema": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "data": { - "type": "object", - "properties": { - "newOrderId": { - "type": "string", - "description": "The new order id" - }, - "clientOid": { - "type": "string", - "description": "The original client order id" - } - }, - "required": [ - "newOrderId", - "clientOid" + "MAPO", + "PEPEUP", + "STRAX", + "NOT", + "ZERC", + "BCUT", + "MASA", + "WAN", + "WAT", + "WAX", + "MASK", + "EOS3L", + "IDEA", + "EOS3S", + "YFI", + "MOODENG", + "XCUR", + "HYDRA", + "POPCAT", + "LQTY", + "PIXEL", + "LMR", + "ZETA", + "YGG", + "AXS", + "BCHSV", + "NRN", + "FTON", + "COMP", + "XPRT", + "HFT", + "UXLINK", + "STAMP", + "RUNE", + "ZEUS", + "LTC3L", + "DAPP", + "FORTH", + "ALPINE", + "SENSO", + "LTC3S", + "DEXE", + "GOAL", + "AVAX", + "LISTA", + "AMPL", + "WORK", + "BRWL", + "BANANA", + "PUSH", + "WEN", + "NEIRO", + "BTCUP", + "SOL3S", + "BRAWL", + "LAY3R", + "LPT", + "GODS", + "SAND3S", + "RDNT", + "SOL3L", + "NIBI", + "NUM", + "PYR", + "DAG", + "DAI", + "HIP", + "DAO", + "AVAIL", + "DAR", + "FET", + "FCON", + "XAVA", + "LRC", + "UNI3S", + "POKT", + "DASH", + "BAKEDOWN", + "POLC", + "CIRUS", + "UNI3L", + "NWC", + "POLK", + "LSD", + "MARS4", + "LSK", + "BLOCK", + "ANALOS", + "SAFE", + "DCK", + "LSS", + "DCR", + "LIKE", + "DATA", + "WIF", + "BLOK", + "LTC", + "METIS", + "WIN", + "HLG", + "LTO", + "DYDX", + "ARB3S", + "MUBI", + "ARB3L", + "RBTC1", + "POND", + "LINA", + "MYRIA", + "LINK", + "QTUM", + "TUNE", + "UFO", + "CYBER", + "WILD", + "POLS", + "NYM", + "FIL", + "BAL", + "SCA", + "STND", + "WMTX", + "SCLP", + "MANEKI", + "BAT", + "AKRO", + "FTM3L", + "BAX", + "FTM3S", + "COTI" ] } }, @@ -13117,72 +11802,48 @@ "responseExamples": [ { "name": "Success", - "data": "{\"code\":\"200000\",\"data\":{\"newOrderId\":\"67112258f9406e0007408827\",\"clientOid\":\"client order id 12\"}}", - "responseId": 10335, + "data": "{\"code\":\"200000\",\"data\":{\"AGLD\":\"1.1174410000000001\",\"DFI\":\"0.0168915500000000\",\"PYTHUP\":\"0.0397880960000000\",\"ISLM\":\"0.0606196750000000\",\"NEAR\":\"4.7185395500000000\",\"AIOZ\":\"0.4862867350000000\",\"AUDIO\":\"0.1219390000000000\",\"BBL\":\"0.0067766100000000\",\"WLD\":\"2.2893547500000000\",\"HNT\":\"5.8990489999999984\",\"ETHFI\":\"1.5892050000000000\",\"DMAIL\":\"0.2726636000000000\",\"OPUP\":\"0.0986506500000000\",\"VET3S\":\"0.0003700448850000\",\"MANA3S\":\"0.0006056970000000\",\"TIDAL\":\"0.0001154422500000\",\"HALO\":\"0.0058270850000000\",\"OPUL\":\"0.0839480050000000\",\"MANA3L\":\"0.0029569407900000\",\"DGB\":\"0.0066556705000000\",\"AA\":\"0.2406796000000000\",\"BCH\":\"366.2167999999996484\",\"GMEE\":\"0.0113333305000000\",\"JST\":\"0.0302348750000000\",\"PBUX\":\"0.0208795550000000\",\"AR\":\"18.5457224999999909\",\"SEI\":\"0.4332832500000000\",\"PSTAKE\":\"0.0493153300000000\",\"LMWR\":\"0.1618190500000000\",\"UNFIDOWN\":\"0.0062058955000000\",\"BB\":\"0.3245376500000000\",\"JTO\":\"2.1239375000000002\",\"WEMIX\":\"0.7916040000000000\",\"G\":\"0.0324037900000000\",\"MARSH\":\"0.0617591050000000\",\"BN\":\"0.0036961510000000\",\"FLIP\":\"1.0976509000000000\",\"FLR\":\"0.0144827550000000\",\"BIGTIME\":\"0.1238780300000000\",\"FLY\":\"0.0005157420000000\",\"T\":\"0.0233483200000000\",\"W\":\"0.2865566500000000\",\"BDX\":\"0.0774012800000000\",\"BABYDOGE\":\"0.0000000029375305\",\"SFP\":\"0.7256370000000000\",\"DIA\":\"0.9179408000000000\",\"ISME\":\"0.0022388800000000\",\"LYM\":\"0.0010155919500000\",\"VET3L\":\"0.0000289755050000\",\"JUP\":\"0.8230882500000000\",\"LYX\":\"1.4501745500000001\",\"AIEPK\":\"0.0050094940000000\",\"SILLY\":\"0.0159420250000000\",\"SCPT\":\"0.0122038950000000\",\"WOO\":\"0.1796601250000000\",\"BLUR\":\"0.2462768000000000\",\"STRK\":\"0.3963117450000000\",\"BFC\":\"0.0383608100000000\",\"DC\":\"0.0003097450500000\",\"KARATE\":\"0.0007296350000000\",\"SUSHI3L\":\"0.5115441000000000\",\"NETVR\":\"0.0976111700000000\",\"WAVES\":\"1.0806594000000000\",\"LITH\":\"0.0001520239500000\",\"HAPI\":\"8.6533711499999987\",\"SUSHI3S\":\"1.2752620500000000\",\"CEEK\":\"0.0294852500000000\",\"FLOKI\":\"0.0001414292500000\",\"SHR\":\"0.0012463765000000\",\"SAND\":\"0.2566616050000000\",\"TURT\":\"0.0020889550000000\",\"UMA\":\"2.5207390000000000\",\"BEPRO\":\"0.0003955021500000\",\"SCRT\":\"0.1995002000000000\",\"TUSD\":\"0.9945025000000000\",\"COOKIE\":\"0.0220089900000000\",\"LRDS\":\"0.6218889000000000\",\"SIN\":\"0.0033633175000000\",\"OAS\":\"0.0331933950000000\",\"ROOT\":\"0.0183108400000000\",\"ADA3L\":\"0.0046396790000000\",\"TIAUP\":\"0.1228385500000000\",\"HTR\":\"0.0353023400000000\",\"UNB\":\"0.0003837080500000\",\"UNA\":\"0.0164917500000000\",\"HARD\":\"0.1087056200000000\",\"G3\":\"0.0502648550000000\",\"ADA3S\":\"0.0006191202850000\",\"MYRO\":\"0.1071863800000000\",\"HTX\":\"0.0000013693150000\",\"FT\":\"0.3585206500000000\",\"BTCDOWN\":\"0.1065467000000000\",\"UNI\":\"7.3571195999999993\",\"FX\":\"0.1379310000000000\",\"OBI\":\"0.0079030465000000\",\"UNO\":\"0.0137131400000000\",\"WRX\":\"0.1221389000000000\",\"TIADOWN\":\"0.0000914642450000\",\"ETHDOWN\":\"0.1306346500000000\",\"WELL\":\"0.0471244260000000\",\"SWFTC\":\"0.0028966509500000\",\"SKL\":\"0.0362418700000000\",\"UOS\":\"0.0867765900000000\",\"AIPAD\":\"0.0478660550000000\",\"BRETT\":\"0.1037481000000000\",\"SKY\":\"0.0520139800000000\",\"FRM\":\"0.0153123400000000\",\"VISION\":\"0.0014451770500000\",\"LENDS\":\"0.0047276350000000\",\"SLF\":\"0.3318340000000000\",\"BULL\":\"0.0023988000000000\",\"FLOW\":\"0.5372312500000000\",\"ODDZ\":\"0.0063368300000000\",\"SLN\":\"0.2804597000000000\",\"UPO\":\"0.0440779500000000\",\"SLP\":\"0.0023997995000000\",\"ID\":\"0.3718140000000000\",\"SLIM\":\"0.0906446550000000\",\"SPOT\":\"0.0021289350000000\",\"DOP\":\"0.0023028480000000\",\"ISSP\":\"0.0000874562500000\",\"UQC\":\"3.2339822000000003\",\"IO\":\"1.8185902499999999\",\"DOT\":\"4.2022978000000005\",\"1INCH\":\"0.2645676500000000\",\"SMH\":\"0.3448275000000000\",\"MAK\":\"0.0396701550000000\",\"TOKO\":\"0.0005923037000000\",\"TURBO\":\"0.0108085930000000\",\"UNFI\":\"2.8555714999999996\",\"MAN\":\"0.0210764565000000\",\"EVER\":\"0.0332733550000000\",\"FTM\":\"0.7259068650000000\",\"SHRAP\":\"0.0476361700000000\",\"MAV\":\"0.1738130500000000\",\"MAX\":\"0.2864966800000000\",\"DPR\":\"0.0018240875000000\",\"FTT\":\"2.0559715000000002\",\"ARKM\":\"1.7444273499999999\",\"ATOM\":\"4.2954512000000002\",\"PENDLE\":\"4.1554212500000007\",\"QUICK\":\"0.0365317250000000\",\"BLZ\":\"0.1217191100000000\",\"BOBA\":\"0.2014092450000000\",\"MBL\":\"0.0027856065000000\",\"OFN\":\"0.1252373500000000\",\"UNIO\":\"0.0025487250000000\",\"SNS\":\"0.0200899500000000\",\"SNX\":\"1.4282854999999999\",\"NXRA\":\"0.0272763550000000\",\"TAIKO\":\"1.4392800000000001\",\"AVAX3L\":\"0.1410875109550000\",\"L3\":\"0.0608395650000000\",\"API3\":\"1.3728132500000001\",\"XRP3S\":\"0.0028095945000000\",\"QKC\":\"0.0085157400000000\",\"AVAX3S\":\"0.5148424500000000\",\"ROSE\":\"0.0693453100000000\",\"SATS\":\"0.0000002701648500\",\"BMX\":\"0.3100449000000000\",\"PORTAL\":\"0.2811593500000000\",\"TOMI\":\"0.0309045400000000\",\"XRP3L\":\"2.1586201500000002\",\"SOL\":\"151.7250995000003583\",\"SON\":\"0.0002421788500000\",\"BNC\":\"0.1882058500000000\",\"SOCIAL\":\"0.0026486750000000\",\"CGPT\":\"0.1305147100000000\",\"CELR\":\"0.0127736100000000\",\"BNB\":\"591.0973035000118935\",\"OGN\":\"0.0852573500000000\",\"CELO\":\"0.7711142500000000\",\"AUCTION\":\"13.1634150000000014\",\"MANTA\":\"0.7564216000000000\",\"LAYER\":\"0.0372713550000000\",\"AERO\":\"1.3783104999999999\",\"CETUS\":\"0.1808295400000000\",\"LL\":\"0.0201199350000000\",\"SPA\":\"0.0067426270000000\",\"PYTHDOWN\":\"0.0011834080000000\",\"NEIROCTO\":\"0.0019964013000000\",\"UTK\":\"0.0365217300000000\",\"GMRX\":\"0.0007386305000000\",\"BOB\":\"0.0000380619595000\",\"HOTCROSS\":\"0.0056491740000000\",\"AERGO\":\"0.1007595950000000\",\"MOCA\":\"0.0783608000000000\",\"SQD\":\"0.0380809500000000\",\"MV\":\"0.0081359300000000\",\"BNB3L\":\"0.2761618500000000\",\"BNB3S\":\"0.0008545725000000\",\"GALAX3L\":\"0.0057571999600000\",\"KAI\":\"0.0020080954500000\",\"SQR\":\"0.0470764500000000\",\"GALAX3S\":\"0.1933033000000000\",\"EGLD\":\"25.5272299999999713\",\"ZBCN\":\"0.0010404795000000\",\"KAS\":\"0.1216691350000000\",\"MEW\":\"0.0086176890000000\",\"PUNDIX\":\"0.4130933500000000\",\"LOOKS\":\"0.0392803500000000\",\"FXS\":\"1.9060465000000000\",\"BOSON\":\"0.2732633000000000\",\"BRISE\":\"0.0000000860569500\",\"AEVO\":\"0.3388305000000000\",\"FLUX\":\"0.5276360500000000\",\"PRCL\":\"0.1969015000000000\",\"UNFIUP\":\"0.0011654170000000\",\"SEIDOWN\":\"0.0442778500000000\",\"DOAI\":\"0.0052363805000000\",\"QNT\":\"65.4312679999998206\",\"REDO\":\"0.2837580500000000\",\"STRIKE\":\"6.8225869999999997\",\"ETHW\":\"3.2418782499999998\",\"OM\":\"1.5396797750000000\",\"OP\":\"1.6911539999999999\",\"WHALE\":\"0.8134930500000000\",\"1CAT\":\"0.0018460765000000\",\"NEON\":\"0.4446775500000000\",\"GTAI\":\"0.7786105000000000\",\"SSV\":\"21.2393749999999841\",\"ETH2\":\"2601.6678843156403923\",\"KCS\":\"8.7646155000000020\",\"ARPA\":\"0.0393882960000000\",\"ARTFI\":\"0.0141029450000000\",\"BRL\":\"0.1742807323452485\",\"ALEX\":\"0.0924537500000000\",\"STG\":\"0.2943527500000000\",\"SHIB\":\"0.0000178060925000\",\"IOTX\":\"0.0394202800000000\",\"OLE\":\"0.0171414250000000\",\"KDA\":\"0.5653172000000000\",\"CERE\":\"0.0022548720000000\",\"DOCK\":\"0.0018990500000000\",\"STX\":\"1.8157916500000000\",\"OLT\":\"0.0007596200000000\",\"QI\":\"0.0131754090000000\",\"SDAO\":\"0.2748625000000000\",\"BLAST\":\"0.0087636160000000\",\"LINK3S\":\"0.0000702948350000\",\"IOST\":\"0.0049745115000000\",\"SUI\":\"2.0589700000000000\",\"CAKE\":\"1.7941024999999999\",\"BSW\":\"0.0586706500000000\",\"OMG\":\"0.2597700500000000\",\"VOLT\":\"0.0000002716641000\",\"LINK3L\":\"1.3408292499999999\",\"GEEQ\":\"0.0385607100000000\",\"PYUSD\":\"0.9988003500000000\",\"SUN\":\"0.0186106900000000\",\"TOWER\":\"0.0014812590000000\",\"BTC\":\"67133.4165000832051564\",\"IOTA\":\"0.1189405000000000\",\"REEF\":\"0.0019960015000000\",\"TRIAS\":\"3.3683149999999998\",\"KEY\":\"0.0037594713240047\",\"ETH3L\":\"0.0003305946200000\",\"BTT\":\"0.0000009117439000\",\"ONE\":\"0.0132003965000000\",\"RENDER\":\"5.2263854999999995\",\"ETH3S\":\"0.5517240000000000\",\"ANKR\":\"0.0264867500000000\",\"ALGO\":\"0.1188405500000000\",\"SYLO\":\"0.0007600198000000\",\"ZCX\":\"0.0784707450000000\",\"SD\":\"0.3851073500000000\",\"ONT\":\"0.1877960550000000\",\"MJT\":\"0.0132433750000000\",\"DYM\":\"1.6659666000000001\",\"DYP\":\"0.0205397250000000\",\"BAKEUP\":\"0.0389894955000000\",\"OOE\":\"0.0079360300000000\",\"ZELIX\":\"0.0000649675000000\",\"DOGE3L\":\"0.3837080500000000\",\"ARTY\":\"0.3980009000000000\",\"QORPO\":\"0.1204297550000000\",\"ICE\":\"0.0051504235000000\",\"NOTAI\":\"0.0000892753400000\",\"DOGE3S\":\"0.2291853500000000\",\"NAKA\":\"1.0695649500000000\",\"GALAX\":\"0.0212893500000000\",\"MKR\":\"1245.8767500000163833\",\"DODO\":\"0.1152423500000000\",\"ICP\":\"7.6731615000000027\",\"ZEC\":\"35.9400209999999543\",\"ZEE\":\"0.0065767100000000\",\"ICX\":\"0.1383308000000000\",\"KMNO\":\"0.0921499020000000\",\"TT\":\"0.0033883050000000\",\"DOT3L\":\"0.1454272500000000\",\"XAI\":\"0.2038980000000000\",\"ZEN\":\"8.0149905000000007\",\"DOGE\":\"0.1213093150000000\",\"ALPHA\":\"0.0567416150000000\",\"DUSK\":\"0.1964517250000000\",\"DOT3S\":\"0.0053613180000000\",\"SXP\":\"0.2538730000000000\",\"HBAR\":\"0.0510044850000000\",\"SYNT\":\"0.0467166300000000\",\"ZEX\":\"0.0571714000000000\",\"BONDLY\":\"0.0022208890000000\",\"MLK\":\"0.2080859050000000\",\"KICKS\":\"0.0001301249050000\",\"PEPE\":\"0.0000100249850000\",\"OUSD\":\"0.9982006500000000\",\"LUNCDOWN\":\"0.0000733333150000\",\"DOGS\":\"0.0007086455000000\",\"REV3L\":\"0.0094672640000000\",\"CTSI\":\"0.1257371000000000\",\"C98\":\"0.1219390000000000\",\"OSMO\":\"0.5370313500000000\",\"NTRN\":\"0.3869064500000000\",\"CFX2S\":\"0.0084757600000000\",\"SYN\":\"0.5636180500000000\",\"VIDT\":\"0.0308745550000000\",\"SYS\":\"0.0997501000000000\",\"GAS\":\"4.3029474500000008\",\"BOME\":\"0.0087336310000000\",\"COMBO\":\"0.4068964500000000\",\"XCH\":\"14.9825050000000010\",\"VR\":\"0.0063538215000000\",\"CFX2L\":\"0.0499660045000000\",\"VSYS\":\"0.0005201398000000\",\"PANDORA\":\"1629.2949450001102772\",\"THETA\":\"1.2461766000000000\",\"XCN\":\"0.0012699647000000\",\"NEXG\":\"0.0039180400000000\",\"MELOS\":\"0.0021244372500000\",\"XCV\":\"0.0013253370000000\",\"ORN\":\"0.8797599000000000\",\"WLKN\":\"0.0010624685000000\",\"AAVE\":\"154.2708259999996162\",\"MNT\":\"0.6168914000000000\",\"BONK\":\"0.0000227296295000\",\"PERP\":\"0.6037979500000000\",\"XDC\":\"0.0276361750000000\",\"MNW\":\"0.3681158500000000\",\"XDB\":\"0.0002578710000000\",\"BOND\":\"1.5662165000000000\",\"SUIA\":\"0.0809595000000000\",\"MOG\":\"0.0000019330330000\",\"SUTER\":\"0.0001840079500000\",\"TIME\":\"16.2648634999999969\",\"RACA\":\"0.0001949025000000\",\"BICO\":\"0.2021988500000000\",\"MON\":\"0.1066466500000000\",\"SWEAT\":\"0.0063718125000000\",\"MOXIE\":\"0.0022088950000000\",\"BABYBNB\":\"0.0289755050000000\",\"IGU\":\"0.0050674650000000\",\"HMSTR\":\"0.0037990995000000\",\"XEC\":\"0.0000354722550000\",\"MONI\":\"0.0058470750000000\",\"XR\":\"0.2374812000000000\",\"PEOPLE\":\"0.0796601500000000\",\"PUMLX\":\"0.0054572700000000\",\"ZIL\":\"0.0145927000000000\",\"WLDDOWN\":\"0.2089954500000000\",\"VAI\":\"0.0799999800000000\",\"XEN\":\"0.0000000839580000\",\"MPC\":\"0.1001499000000000\",\"XEM\":\"0.0176951480000000\",\"JASMY3S\":\"0.0019670160000000\",\"OTK\":\"0.0290464695000000\",\"TRAC\":\"0.4521738000000000\",\"DFYN\":\"0.0070664650000000\",\"BIDP\":\"0.0001939030000000\",\"JASMY3L\":\"0.0001653772700000\",\"INJDOWN\":\"0.0000194902500000\",\"KLV\":\"0.0019310340000000\",\"WAXL\":\"0.7858069000000000\",\"TRBDOWN\":\"0.0023138425000000\",\"BCH3L\":\"4.6390663064999996\",\"GMT3S\":\"0.0000457771000000\",\"KMD\":\"0.2493752500000000\",\"BCH3S\":\"0.9634180500000000\",\"ECOX\":\"0.0987506000000000\",\"AAVE3S\":\"0.0560719500000000\",\"GMT3L\":\"0.0053983694650000\",\"EPIK\":\"0.0045857060000000\",\"SUIP\":\"0.1067565950000000\",\"AAVE3L\":\"0.3638687346200000\",\"ZK\":\"0.1262368500000000\",\"ZKF\":\"0.0008595700000000\",\"OMNIA\":\"0.7624186000000000\",\"ZKJ\":\"1.1124435000000000\",\"ZKL\":\"0.1255372000000000\",\"GAFI\":\"3.0634675000000001\",\"CARV\":\"0.8703646000000000\",\"KNC\":\"0.4433782000000000\",\"CATS\":\"0.0000599700000000\",\"PROM\":\"5.2833570000000006\",\"ALEPH\":\"0.1756121500000000\",\"PONKE\":\"0.3958020000000000\",\"OVR\":\"0.1553223000000000\",\"CATI\":\"0.4105146400000000\",\"ORDER\":\"0.1183008200000000\",\"GFT\":\"0.0166616650000000\",\"BIFI\":\"0.0020489750000000\",\"GGC\":\"6.9965029985000000\",\"GGG\":\"0.0403798000000000\",\"DAPPX\":\"0.0043788095000000\",\"SUKU\":\"0.0618790450000000\",\"ULTI\":\"0.0168015950000000\",\"CREDI\":\"0.0192903500000000\",\"ERTHA\":\"0.0010014990000000\",\"FURY\":\"0.1405297000000000\",\"KARRAT\":\"0.5577210000000000\",\"MOBILE\":\"0.0009005495000000\",\"SIDUS\":\"0.0037671155000000\",\"NAVI\":\"0.1254672350000000\",\"TAO\":\"583.4081500000051807\",\"USDJ\":\"1.1386304000000001\",\"MTL\":\"0.9563216000000000\",\"VET\":\"0.0225387250000000\",\"FITFI\":\"0.0036421780000000\",\"USDT\":\"0.9995000000000000\",\"OXT\":\"0.0695652000000000\",\"CANDY\":\"0.0005597200000000\",\"USDP\":\"0.9932031500000000\",\"MTS\":\"0.0027516235000000\",\"TADA\":\"0.0283858000000000\",\"MTV\":\"0.0006559718500000\",\"NAVX\":\"0.1342228550000000\",\"ILV\":\"35.6771524999999671\",\"VINU\":\"0.0000000109045450\",\"GHX\":\"0.0903548000000000\",\"EDU\":\"0.5167415000000000\",\"HYVE\":\"0.0137331300000000\",\"BTC3L\":\"0.0058620675000000\",\"ANYONE\":\"0.9015490000000000\",\"BEAT\":\"0.0012593700000000\",\"KING\":\"0.0004821588000000\",\"CREAM\":\"15.6541689999999973\",\"CAS\":\"0.0038590695000000\",\"IMX\":\"1.4944524000000000\",\"CAT\":\"0.0000256981445000\",\"BTC3S\":\"0.0014142925000000\",\"USDE\":\"0.9985005000000000\",\"USDD\":\"1.0000997000000000\",\"CWAR\":\"0.0037981000000000\",\"USDC\":\"0.9997998500000000\",\"KRL\":\"0.3543127550000000\",\"INJ\":\"21.7691100000000194\",\"GAME\":\"0.0139630150000000\",\"TRIBL\":\"1.0994500000000000\",\"XLM\":\"0.0948525500000000\",\"TRBUP\":\"0.0012293850000000\",\"VRADOWN\":\"0.0013433280000000\",\"SUPER\":\"1.2853570000000000\",\"EIGEN\":\"3.1536223999999999\",\"IOI\":\"0.0146926500000000\",\"KSM\":\"17.5212350000000129\",\"CCD\":\"0.0034832575000000\",\"EGO\":\"0.0093553200000000\",\"EGP\":\"2.7946019999999998\",\"MXC\":\"0.0066866550000000\",\"TEL\":\"0.0014432780000000\",\"MOVR\":\"9.1340307000000027\",\"XMR\":\"155.5421899999990755\",\"MXM\":\"0.0092853550000000\",\"OORT\":\"0.1099949750000000\",\"GLM\":\"0.3231383500000000\",\"RAY\":\"2.0228880499999998\",\"XTAG\":\"0.0218190850000000\",\"GLQ\":\"0.0854572500000000\",\"CWEB\":\"0.0038480750000000\",\"REVU\":\"0.0105047450000000\",\"REVV\":\"0.0039760110000000\",\"ZRO\":\"3.7952014499999994\",\"XNL\":\"0.0093853050000000\",\"XNO\":\"0.8496749500000000\",\"SAROS\":\"0.0019290350000000\",\"KACE\":\"2.1165411999999998\",\"ZRX\":\"0.3186406000000000\",\"WLTH\":\"0.0374312750000000\",\"ATOM3L\":\"0.0321719060000000\",\"GMM\":\"0.0001497251000000\",\"BEER\":\"0.0000138670630000\",\"GMT\":\"0.1275362000000000\",\"HEART\":\"0.0159920000000000\",\"GMX\":\"22.7186349999999882\",\"ABBC\":\"0.0061769100000000\",\"OMNI\":\"8.9235359999999970\",\"ATOM3S\":\"0.0007945225400000\",\"IRL\":\"0.0099650150000000\",\"CFG\":\"0.3248375000000000\",\"WSDM\":\"0.0139830050000000\",\"GNS\":\"1.8390800000000001\",\"VANRY\":\"0.0809295150000000\",\"CFX\":\"0.1595202000000000\",\"GRAIL\":\"817.1212349999937891\",\"BEFI\":\"0.0175712100000000\",\"VELO\":\"0.0132043945000000\",\"XPR\":\"0.0008077959000000\",\"DOVI\":\"0.0584707500000000\",\"ACE\":\"0.0021349320000000\",\"ACH\":\"0.0190534685000000\",\"ISP\":\"0.0012161916000000\",\"XCAD\":\"0.2834582000000000\",\"MINA\":\"0.5630183500000000\",\"TIA\":\"5.9318325999999999\",\"DRIFT\":\"0.4350823500000000\",\"ACQ\":\"0.0056981495000000\",\"ACS\":\"0.0014917537500000\",\"MIND\":\"0.0018920535000000\",\"STORE\":\"0.0062358805000000\",\"REN\":\"0.0351224300000000\",\"ELA\":\"1.7282354500000000\",\"DREAMS\":\"0.0002498750000000\",\"ADA\":\"0.3463267500000000\",\"ELF\":\"0.3777110500000000\",\"REQ\":\"0.0959919800000000\",\"STORJ\":\"0.5662167500000000\",\"LADYS\":\"0.0000000837581000\",\"PAXG\":\"2697.9303600003123340\",\"REZ\":\"0.0409795000000000\",\"XRD\":\"0.0157821050000000\",\"CHO\":\"0.0205097400000000\",\"CHR\":\"0.1769115000000000\",\"ADS\":\"0.1889055000000000\",\"CHZ\":\"0.0738030800000000\",\"ADX\":\"0.1575212000000000\",\"XRP\":\"0.5525036100000000\",\"JASMY\":\"0.0188615645000000\",\"KAGI\":\"0.1834582250000000\",\"FIDA\":\"0.2282858000000000\",\"PBR\":\"0.0291953950000000\",\"AEG\":\"0.0093453250000000\",\"H2O\":\"0.1610194500000000\",\"CHMB\":\"0.0001715641750000\",\"SAND3L\":\"0.0015447972150000\",\"PBX\":\"0.0006879558500000\",\"SOLVE\":\"0.0084557700000000\",\"DECHAT\":\"0.1512243500000000\",\"GARI\":\"0.0076861550000000\",\"SHIB2L\":\"1.1996998499999999\",\"SHIB2S\":\"0.0240879500000000\",\"ENA\":\"0.3942028000000000\",\"VEMP\":\"0.0029335325000000\",\"ENJ\":\"0.1467266000000000\",\"AFG\":\"0.0072163900000000\",\"RATS\":\"0.0001211593900000\",\"GRT\":\"0.1646076550000000\",\"FORWARD\":\"0.0012873560000000\",\"TFUEL\":\"0.0598800450000000\",\"ENS\":\"17.0634640000000052\",\"KASDOWN\":\"0.0258770550000000\",\"XTM\":\"0.0251074400000000\",\"DEGEN\":\"0.0084857550000000\",\"TLM\":\"0.0100449750000000\",\"DYDXDOWN\":\"0.1042598440000000\",\"CKB\":\"0.0146026950000000\",\"LUNC\":\"0.0000889255150000\",\"AURORA\":\"0.1204397500000000\",\"LUNA\":\"0.3624187000000000\",\"XTZ\":\"0.6776610000000000\",\"ELON\":\"0.0000001410294500\",\"DMTR\":\"0.0891554000000000\",\"EOS\":\"0.4759619000000000\",\"GST\":\"0.0118940500000000\",\"FORT\":\"0.1155422000000000\",\"FLAME\":\"0.0247076400000000\",\"PATEX\":\"0.9605195000000000\",\"DEEP\":\"0.0328885475000000\",\"ID3L\":\"0.0016201895000000\",\"GTC\":\"0.6625685500000000\",\"ID3S\":\"0.0071674145000000\",\"RIO\":\"0.7616190000000000\",\"CLH\":\"0.0008555720000000\",\"BURGER\":\"0.4016990500000000\",\"VRA\":\"0.0029765110000000\",\"SUNDOG\":\"0.2173912500000000\",\"GTT\":\"0.0002038980000000\",\"INJUP\":\"0.2327835500000000\",\"CPOOL\":\"0.1557720750000000\",\"EPX\":\"0.0000740629500000\",\"CLV\":\"0.0329835000000000\",\"FEAR\":\"0.0560519600000000\",\"MEME\":\"0.0124847545000000\",\"ROOBEE\":\"0.0004520738500000\",\"DEFI\":\"0.0192903500000000\",\"TOKEN\":\"0.0477361200000000\",\"GRAPE\":\"0.0020599695000000\",\"KASUP\":\"0.3996001000000000\",\"XWG\":\"0.0003843077500000\",\"SKEY\":\"0.0621289200000000\",\"SFUND\":\"1.3243375000000000\",\"EQX\":\"0.0032823580000000\",\"ORDIUP\":\"0.0548315705000000\",\"TON\":\"5.1857058499999995\",\"DEGO\":\"2.2667660500000001\",\"IZI\":\"0.0088455750000000\",\"ERG\":\"0.6605695500000000\",\"ERN\":\"1.9255367500000001\",\"VENOM\":\"0.0817591000000000\",\"VOXEL\":\"0.1497251000000000\",\"RLC\":\"1.4649671500000000\",\"PHA\":\"0.1093453000000000\",\"DYDXUP\":\"0.0112573685000000\",\"APE3S\":\"0.0008475760000000\",\"ORBS\":\"0.0288955450000000\",\"OPDOWN\":\"0.6758619000000000\",\"ESE\":\"0.0139130400000000\",\"APE3L\":\"0.1339330000000000\",\"HMND\":\"0.0982208650000000\",\"COQ\":\"0.0000014432780000\",\"AURY\":\"0.3340329000000000\",\"CULT\":\"0.0000028025980000\",\"AKT\":\"2.4642672500000001\",\"GLMR\":\"0.1606196500000000\",\"XYM\":\"0.0142528700000000\",\"ORAI\":\"6.1769100000000012\",\"XYO\":\"0.0058680645000000\",\"ETC\":\"18.8458723500000169\",\"LAI\":\"0.0142828550000000\",\"PIP\":\"0.0178310800000000\",\"ETH\":\"2607.6655149998362673\",\"NEO\":\"10.3575186499999991\",\"RMV\":\"0.0081659150000000\",\"KLAY\":\"0.1251374000000000\",\"PIT\":\"0.0000000003268365\",\"TARA\":\"0.0043978000000000\",\"KALT\":\"0.1128735350000000\",\"PIX\":\"0.0001023687900000\",\"ETN\":\"0.0021579205000000\",\"CSIX\":\"0.0141729100000000\",\"TRADE\":\"0.4708644500000000\",\"MAVIA\":\"1.3592200500000001\",\"HIGH\":\"1.3043474999999999\",\"TRB\":\"62.5387150000000006\",\"ORDI\":\"35.7421200000000126\",\"TRVL\":\"0.0373643085000000\",\"AMB\":\"0.0059670150000000\",\"TRU\":\"0.0762018800000000\",\"LOGX\":\"0.0271963950000000\",\"FINC\":\"0.0362018900000000\",\"INFRA\":\"0.1978010500000000\",\"NATIX\":\"0.0008729633000000\",\"NFP\":\"0.2152923000000000\",\"TRY\":\"0.0292166033323590\",\"TRX\":\"0.1597201000000000\",\"LBP\":\"0.0001243378000000\",\"LBR\":\"0.0595702000000000\",\"EUL\":\"2.9735125000000000\",\"NFT\":\"0.0000004077960000\",\"SEIUP\":\"0.0478110825000000\",\"PUFFER\":\"0.3676161000000000\",\"EUR\":\"1.0811249323958897\",\"ORCA\":\"2.0664662499999999\",\"NEAR3L\":\"0.0117010765350000\",\"AMP\":\"0.0038330825000000\",\"XDEFI\":\"0.0472563600000000\",\"HIFI\":\"0.4947525000000000\",\"TRUF\":\"0.0459570100000000\",\"AITECH\":\"0.1045477000000000\",\"AMU\":\"0.0043978000000000\",\"USTC\":\"0.0214692600000000\",\"KNGL\":\"0.0499750000000000\",\"FOXY\":\"0.0102686631000000\",\"NGC\":\"0.0147935995000000\",\"TENET\":\"0.0043278350000000\",\"NEAR3S\":\"0.0072553705000000\",\"MAHA\":\"1.1904045000000000\",\"NGL\":\"0.0701748950000000\",\"TST\":\"0.0080359800000000\",\"HIPPO\":\"0.0104447750000000\",\"AXS3S\":\"0.0308705570000000\",\"CRO\":\"0.0781409100000000\",\"ZPAY\":\"0.0050574700000000\",\"MNDE\":\"0.1026786350000000\",\"CRV\":\"0.2534732000000000\",\"SWASH\":\"0.0056271850000000\",\"AXS3L\":\"0.0106388779000000\",\"VERSE\":\"0.0001803098000000\",\"RPK\":\"0.0049975000000000\",\"RPL\":\"10.9745099999999958\",\"AZERO\":\"0.3789104500000000\",\"SOUL\":\"0.0534332700000000\",\"VXV\":\"0.2619689500000000\",\"LDO\":\"1.0885554500000000\",\"MAGIC\":\"0.3390304000000000\",\"ALICE\":\"1.0324835000000000\",\"SEAM\":\"1.1933030499999999\",\"PLU\":\"1.9300345000000001\",\"AOG\":\"0.0031224380000000\",\"SMOLE\":\"0.0000387806000000\",\"EWT\":\"1.1094450000000000\",\"TSUGT\":\"0.0029185400000000\",\"PMG\":\"0.0800599500000000\",\"OPAI\":\"0.0006826585000000\",\"LOCUS\":\"0.0216591650000000\",\"CTA\":\"0.0825087250000000\",\"NIM\":\"0.0013673160000000\",\"CTC\":\"0.4033982000000000\",\"APE\":\"0.7035480500000000\",\"MERL\":\"0.2720639000000000\",\"JAM\":\"0.0004770613500000\",\"CTI\":\"0.0130314810000000\",\"APP\":\"0.0021989000000000\",\"APT\":\"9.9947001500000000\",\"WLDUP\":\"0.0093043455000000\",\"ZEND\":\"0.1280759300000000\",\"FIRE\":\"0.9113441000000000\",\"DENT\":\"0.0008630682500000\",\"PYTH\":\"0.3390603850000000\",\"LFT\":\"0.0155322300000000\",\"DPET\":\"0.0319040400000000\",\"ORDIDOWN\":\"0.3788105000000000\",\"KPOL\":\"0.0029175405000000\",\"ETHUP\":\"8.4971493000000032\",\"BAND\":\"1.0939527500000001\",\"POL\":\"0.3656171000000000\",\"ASTR\":\"0.0582608550000000\",\"NKN\":\"0.0691654000000000\",\"RSR\":\"0.0068055955000000\",\"DVPN\":\"0.0005979009000000\",\"TWT\":\"1.1119437500000000\",\"ARB\":\"0.5510243500000000\",\"CVC\":\"0.1409801746501747\",\"ARC\":\"0.0300849500000000\",\"XETA\":\"0.0022888550000000\",\"MTRG\":\"0.4007995000000000\",\"LOKA\":\"0.1867066000000000\",\"LPOOL\":\"0.0660069800000000\",\"TURBOS\":\"0.0034812585000000\",\"CVX\":\"1.7816087499999999\",\"ARX\":\"0.0007556220000000\",\"MPLX\":\"0.4355221300000000\",\"SUSHI\":\"0.7011492500000000\",\"NLK\":\"0.0114442750000000\",\"PEPE2\":\"0.0000000313843000\",\"WBTC\":\"66881.4425499645548419\",\"SUI3L\":\"0.0211204345000000\",\"CWS\":\"0.1927036000000000\",\"SUI3S\":\"0.0000579110300000\",\"INSP\":\"0.0264167850000000\",\"MANA\":\"0.2945026750000000\",\"VRTX\":\"0.0641679000000000\",\"CSPR\":\"0.0116441750000000\",\"ATA\":\"0.0785007300000000\",\"OPEN\":\"0.0080049955000000\",\"HAI\":\"0.0448275750000000\",\"NMR\":\"14.7436245000000072\",\"ATH\":\"0.0540929400000000\",\"LIT\":\"0.6282857000000000\",\"TLOS\":\"0.3263467450000000\",\"TNSR\":\"0.3662168000000000\",\"CXT\":\"0.0871364100000000\",\"POLYX\":\"0.2346826000000000\",\"ZERO\":\"0.0002507745500000\",\"ROUTE\":\"0.0610694500000000\",\"LOOM\":\"0.0580009850000000\",\"PRE\":\"0.0078680640000000\",\"VRAUP\":\"0.0134652640000000\",\"HBB\":\"0.0714742450000000\",\"RVN\":\"0.0165017450000000\",\"PRQ\":\"0.0715741950000000\",\"ONDO\":\"0.7134930750000000\",\"PEPEDOWN\":\"0.0000155022450000\",\"WOOP\":\"0.0020179905000000\",\"LUNCUP\":\"0.0168355780000000\",\"KAVA\":\"0.3522238000000000\",\"LKI\":\"0.0104187880000000\",\"AVA\":\"0.4857570000000000\",\"NOM\":\"0.0233883000000000\",\"MAPO\":\"0.0089015470000000\",\"PEPEUP\":\"0.0114252845000000\",\"STRAX\":\"0.0487156300000000\",\"NOT\":\"0.0078670645000000\",\"ZERC\":\"0.1108245600000000\",\"BCUT\":\"0.0255672100000000\",\"MASA\":\"0.0691354150000000\",\"WAN\":\"0.1785077544737212\",\"WAT\":\"0.0003273762300000\",\"WAX\":\"0.0327636100000000\",\"MASK\":\"2.2259864500000002\",\"EOS3L\":\"0.0002122138400000\",\"IDEA\":\"0.0005887055000000\",\"EOS3S\":\"0.0034472755000000\",\"YFI\":\"4919.4290549999908843\",\"MOODENG\":\"0.0774612500000000\",\"XCUR\":\"0.0048845565000000\",\"HYDRA\":\"0.2225886500000000\",\"POPCAT\":\"1.3382305500000000\",\"LQTY\":\"0.7848074000000000\",\"PIXEL\":\"0.1406596350000000\",\"LMR\":\"0.0145437245000000\",\"ZETA\":\"0.5997999500000000\",\"YGG\":\"0.4717640000000000\",\"AXS\":\"4.6006985000000006\",\"BCHSV\":\"49.8250749999999370\",\"NRN\":\"0.0395802000000000\",\"FTON\":\"0.0091954000000000\",\"COMP\":\"43.6581599999999881\",\"XPRT\":\"0.1819090000000000\",\"HFT\":\"0.1443278000000000\",\"UXLINK\":\"0.5085456000000000\",\"STAMP\":\"0.0335032400000000\",\"RUNE\":\"4.9233370999999996\",\"ZEUS\":\"0.2587705500000000\",\"LTC3L\":\"1.8294848000000001\",\"DAPP\":\"0.1763118000000000\",\"FORTH\":\"2.9508238500000004\",\"ALPINE\":\"1.5322335000000000\",\"SENSO\":\"0.0328835500000000\",\"LTC3S\":\"0.0006986505000000\",\"DEXE\":\"8.3795081500000028\",\"GOAL\":\"0.0175912000000000\",\"AVAX\":\"27.5602130000000058\",\"LISTA\":\"0.3782108000000000\",\"AMPL\":\"1.3743124999999999\",\"WORK\":\"0.1384307500000000\",\"BRWL\":\"0.0017391300000000\",\"BANANA\":\"57.1314200000001362\",\"PUSH\":\"0.0750624500000000\",\"WEN\":\"0.0001015492000000\",\"NEIRO\":\"0.0879560000000000\",\"BTCUP\":\"34.7711057499999789\",\"SOL3S\":\"0.0007816090000000\",\"BRAWL\":\"0.0004776610500000\",\"LAY3R\":\"0.2161918500000000\",\"LPT\":\"11.9304317999999945\",\"GODS\":\"0.1807096000000000\",\"SAND3S\":\"4.6152911999999992\",\"RDNT\":\"0.0640679500000000\",\"SOL3L\":\"1.8351913752850000\",\"NIBI\":\"0.0653772950000000\",\"NUM\":\"0.0436181800000000\",\"PYR\":\"2.5590198499999997\",\"DAG\":\"0.0226176855000000\",\"DAI\":\"0.9989006596042375\",\"HIP\":\"0.0034982500000000\",\"DAO\":\"0.2848575000000000\",\"AVAIL\":\"0.1300929210000000\",\"DAR\":\"0.1512243500000000\",\"FET\":\"1.3760116500000000\",\"FCON\":\"0.0001197600900000\",\"XAVA\":\"0.3789104500000000\",\"LRC\":\"0.1208395500000000\",\"UNI3S\":\"0.0000653573050000\",\"PZP\":\"0.0599600050000000\",\"POKT\":\"0.0424787500000000\",\"DASH\":\"23.6881500000000109\",\"BAKEDOWN\":\"0.0003324636850000\",\"POLC\":\"0.0061389290000000\",\"DBR\":\"0.0377671070000000\",\"CIRUS\":\"0.0055772100000000\",\"UNI3L\":\"0.0993921490650000\",\"NWC\":\"0.0681659000000000\",\"POLK\":\"0.0142628650000000\",\"LSD\":\"0.9420287500000000\",\"MARS4\":\"0.0005878059500000\",\"LSK\":\"0.8080957500000000\",\"BLOCK\":\"0.0261869000000000\",\"ANALOS\":\"0.0000446776500000\",\"SAFE\":\"0.8779608000000000\",\"DCK\":\"0.0234082900000000\",\"LSS\":\"0.0562718500000000\",\"DCR\":\"12.4337799999999929\",\"LIKE\":\"0.0559720000000000\",\"DATA\":\"0.0361819000000000\",\"WIF\":\"2.5696145499999999\",\"BLOK\":\"0.0006546725000000\",\"LTC\":\"71.6261690000000611\",\"METIS\":\"42.0289750000000612\",\"WIN\":\"0.0000868365600000\",\"HLG\":\"0.0018790600000000\",\"LTO\":\"0.1166116650000000\",\"DYDX\":\"0.9341327000000000\",\"ARB3S\":\"0.0509025360000000\",\"MUBI\":\"0.0303848000000000\",\"ARB3L\":\"0.0025917035000000\",\"RBTC1\":\"0.0000039480250000\",\"POND\":\"0.0118640650000000\",\"LINA\":\"0.0037771105000000\",\"MYRIA\":\"0.0025337325000000\",\"LINK\":\"11.0244849999999944\",\"QTUM\":\"2.4262016723130069\",\"TUNE\":\"0.0148025950000000\",\"UFO\":\"0.0000006479758500\",\"CYBER\":\"2.8755615000000001\",\"WILD\":\"0.2433782500000000\",\"POLS\":\"0.2809594500000000\",\"NYM\":\"0.0719640000000000\",\"FIL\":\"3.6786597500000005\",\"BAL\":\"2.0099945000000000\",\"SCA\":\"0.3999999000000000\",\"STND\":\"0.0133123405000000\",\"WMTX\":\"0.2138930000000000\",\"SCLP\":\"0.1545227000000000\",\"MANEKI\":\"0.0073963000000000\",\"BAT\":\"0.1721139000000000\",\"AKRO\":\"0.0042302838000000\",\"FTM3L\":\"8.2574692000000024\",\"BAX\":\"0.0000709645000000\",\"FTM3S\":\"0.0000255072400000\",\"COTI\":\"0.0951524000000000\"}}", + "responseId": 10317, "ordering": 1 } ], "requestBody": { - "type": "application/json", + "type": "none", "parameters": [], "jsonSchema": { "type": "object", - "properties": { - "clientOid": { - "type": "string", - "description": "The old client order id,orderId and clientOid must choose one", - "examples": [ - "5c52e11203aa677f33e493fb" - ] - }, - "symbol": { - "type": "string", - "description": "symbol", - "examples": [ - "BTC-USDT", - "ETH-USDT", - "KCS-USDT" - ] - }, - "orderId": { - "type": "string", - "description": "The old order id, orderId and clientOid must choose one" - }, - "newPrice": { - "type": "string", - "description": "The modified price of the new order, newPrice and newSize must choose one" - }, - "newSize": { - "type": "string", - "description": "The modified size of the new order, newPrice and newSize must choose one" - } - }, - "required": [ - "symbol" - ] + "properties": {} }, - "example": "{\n \"symbol\": \"BTC-USDT\",\n \"orderId\": \"670fd33bf9406e0007ab3945\",\n \"newPrice\": \"30000\",\n \"newSize\": \"0.0001\"\n}", "mediaType": "" }, - "description": ":::info[Description]\nThis interface can modify the price and quantity of the order according to orderId or clientOid.\n\nThe implementation of this interface is: cancel the order and place a new order on the same trading pair, and return the modification result to the client synchronously\n\nWhen the quantity of the new order updated by the user is less than the filled quantity of this order, the order will be considered as completed, and the order will be cancelled, and no new order will be placed\n:::\n", - "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"Spot\",\"api-rate-limit-pool\":\"Spot\",\"sdk-service\":\"Spot\",\"sdk-sub-service\":\"Order\",\"sdk-method-name\":\"modifyOrder\",\"sdk-method-description\":\"This interface can modify the price and quantity of the order according to orderId or clientOid. The implementation of this interface is: cancel the order and place a new order on the same trading pair, and return the modification result to the client synchronously When the quantity of the new order updated by the user is less than the filled quantity of this order, the order will be considered as completed, and the order will be cancelled, and no new order will be placed\",\"api-rate-limit\":3}" + "description": ":::info[Description]\nRequest via this endpoint to get the fiat price of the currencies for the available trading pairs.\n:::\n", + "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Spot\",\"api-channel\":\"Public\",\"api-permission\":\"NULL\",\"api-rate-limit-pool\":\"Public\",\"sdk-service\":\"Spot\",\"sdk-sub-service\":\"Market\",\"sdk-method-name\":\"getFiatPrice\",\"sdk-method-description\":\"Request via this endpoint to get the fiat price of the currencies for the available trading pairs.\",\"api-rate-limit\":3}" } }, { - "name": "Get DCP", + "name": "Get 24hr Stats", "api": { - "id": "3470172", + "id": "3470161", "method": "get", - "path": "/api/v1/hf/orders/dead-cancel-all/query", + "path": "/api/v1/market/stats", "parameters": { "path": [], - "query": [], + "query": [ + { + "id": "AwnkwQxRMq", + "name": "symbol", + "required": true, + "description": "symbol", + "example": "BTC-USDT", + "type": "string" + } + ], "cookie": [], "header": [] }, "responses": [ { - "id": "10336", + "id": "10325", "code": 200, "name": "OK", "headers": [], @@ -13195,25 +11856,90 @@ "data": { "type": "object", "properties": { - "timeout": { + "time": { "type": "integer", - "description": "Auto cancel order trigger setting time, the unit is second. range: timeout=-1 (meaning unset) or 5 <= timeout <= 86400" + "description": "timestamp", + "format": "int64" }, - "symbols": { + "symbol": { "type": "string", - "description": "List of trading pairs. Separated by commas, empty means all trading pairs" + "description": "Symbol" }, - "currentTime": { - "type": "integer", - "description": "System current time (in seconds)" + "buy": { + "type": "string", + "description": "Best bid price\n" }, - "triggerTime": { - "type": "integer", - "description": "Trigger cancellation time (in seconds)" + "sell": { + "type": "string", + "description": "Best ask price" + }, + "changeRate": { + "type": "string", + "description": "24h change rate" + }, + "changePrice": { + "type": "string", + "description": "24h change price" + }, + "high": { + "type": "string", + "description": "Highest price in 24h" + }, + "low": { + "type": "string", + "description": "Lowest price in 24h" + }, + "vol": { + "type": "string", + "description": "24h volume, executed based on base currency" + }, + "volValue": { + "type": "string", + "description": "24h traded amount" + }, + "last": { + "type": "string", + "description": "Last traded price" + }, + "averagePrice": { + "type": "string", + "description": "Average trading price in the last 24 hours" + }, + "takerFeeRate": { + "type": "string", + "description": "Basic Taker Fee" + }, + "makerFeeRate": { + "type": "string", + "description": "Basic Maker Fee" + }, + "takerCoefficient": { + "type": "string", + "description": "The taker fee coefficient. The actual fee needs to be multiplied by this coefficient to get the final fee. Most currencies have a coefficient of 1. If set to 0, it means no fee" + }, + "makerCoefficient": { + "type": "string", + "description": "The maker fee coefficient. The actual fee needs to be multiplied by this coefficient to get the final fee. Most currencies have a coefficient of 1. If set to 0, it means no fee" } }, - "description": "If the data is empty, it means that DCP is not set.", - "additionalProperties": false + "required": [ + "time", + "symbol", + "buy", + "sell", + "changeRate", + "changePrice", + "high", + "low", + "vol", + "volValue", + "last", + "averagePrice", + "takerFeeRate", + "makerFeeRate", + "takerCoefficient", + "makerCoefficient" + ] } }, "required": [ @@ -13229,8 +11955,8 @@ "responseExamples": [ { "name": "Success", - "data": "{\n \"code\": \"200000\",\n \"data\": {\n \"timeout\": 5,\n \"symbols\": \"BTC-USDT,ETH-USDT\",\n \"currentTime\": 1729241305,\n \"triggerTime\": 1729241308\n }\n}", - "responseId": 10336, + "data": "{\"code\":\"200000\",\"data\":{\"time\":1729175612158,\"symbol\":\"BTC-USDT\",\"buy\":\"66982.4\",\"sell\":\"66982.5\",\"changeRate\":\"-0.0114\",\"changePrice\":\"-778.1\",\"high\":\"68107.7\",\"low\":\"66683.3\",\"vol\":\"1738.02898182\",\"volValue\":\"117321982.415978333\",\"last\":\"66981.5\",\"averagePrice\":\"67281.21437289\",\"takerFeeRate\":\"0.001\",\"makerFeeRate\":\"0.001\",\"takerCoefficient\":\"1\",\"makerCoefficient\":\"1\"}}", + "responseId": 10325, "ordering": 1 } ], @@ -13241,28 +11967,27 @@ "type": "object", "properties": {} }, - "example": "{\n \"timeout\": 5,\n \"symbols\": \"BTC-USDT,ETH-USDT\"\n}", "mediaType": "" }, - "description": ":::info[Description]\nGet Disconnection Protect(Deadman Swich)Through this interface, you can query the settings of automatic order cancellation\n:::", - "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"Spot\",\"api-rate-limit-pool\":\"Spot\",\"sdk-service\":\"Spot\",\"sdk-sub-service\":\"Order\",\"sdk-method-name\":\"getDCP\",\"sdk-method-description\":\"Get Disconnection Protect(Deadman Swich)Through this interface, you can query the settings of automatic order cancellation\",\"api-rate-limit\":2}" + "description": ":::info[Description]\nRequest via this endpoint to get the statistics of the specified ticker in the last 24 hours.\n:::", + "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Spot\",\"api-channel\":\"Public\",\"api-permission\":\"NULL\",\"api-rate-limit-pool\":\"Public\",\"sdk-service\":\"Spot\",\"sdk-sub-service\":\"Market\",\"sdk-method-name\":\"get24hrStats\",\"sdk-method-description\":\"Request via this endpoint to get the statistics of the specified ticker in the last 24 hours.\",\"api-rate-limit\":15}" } }, { - "name": "Set DCP", + "name": "Get Market List", "api": { - "id": "3470173", - "method": "post", - "path": "/api/v1/hf/orders/dead-cancel-all", + "id": "3470166", + "method": "get", + "path": "/api/v1/markets", "parameters": { - "query": [], "path": [], + "query": [], "cookie": [], "header": [] }, "responses": [ { - "id": "10337", + "id": "10330", "code": 200, "name": "OK", "headers": [], @@ -13273,22 +11998,10 @@ "type": "string" }, "data": { - "type": "object", - "properties": { - "currentTime": { - "type": "integer", - "description": "System current time (in seconds)" - }, - "triggerTime": { - "type": "integer", - "description": "Trigger cancellation time (in seconds)" - } - }, - "required": [ - "currentTime", - "triggerTime" - ], - "description": "If the data is empty, it means that DCP is not set." + "type": "array", + "items": { + "type": "string" + } } }, "required": [ @@ -13304,81 +12017,39 @@ "responseExamples": [ { "name": "Success", - "data": "{\"code\":\"200000\",\"data\":{\"currentTime\":1729656588,\"triggerTime\":1729656593}}", - "responseId": 10337, + "data": "{\"code\":\"200000\",\"data\":[\"USDS\",\"TON\",\"AI\",\"DePIN\",\"PoW\",\"BRC-20\",\"ETF\",\"KCS\",\"Meme\",\"Solana\",\"FIAT\",\"VR&AR\",\"DeFi\",\"Polkadot\",\"BTC\",\"ALTS\",\"Layer 1\"]}", + "responseId": 10330, "ordering": 1 } ], "requestBody": { - "type": "application/json", + "type": "none", "parameters": [], "jsonSchema": { "type": "object", - "properties": { - "timeout": { - "type": "integer", - "description": "Auto cancel order trigger setting time, the unit is second. range: timeout=-1 (meaning unset) or 5 <= timeout <= 86400. For example, timeout=5 means that the order will be automatically canceled if no user request is received for more than 5 seconds. When this parameter is changed, the previous setting will be overwritten." - }, - "symbols": { - "type": "string", - "description": "List of trading pairs. When this parameter is not empty, separate it with commas and support up to 50 trading pairs. Empty means all trading pairs. When this parameter is changed, the previous setting will be overwritten.", - "examples": [ - "BTC-USDT,ETH-USDT" - ] - } - }, - "required": [ - "timeout" - ] + "properties": {} }, - "example": "{\n \"timeout\": 5,\n \"symbols\": \"BTC-USDT,ETH-USDT\"\n}", "mediaType": "" }, - "description": ":::info[Description]\nSet Disconnection Protect(Deadman Swich)Through this interface, Call this interface to automatically cancel all orders of the set trading pair after the specified time. If this interface is not called again for renewal or cancellation before the set time, the system will help the user to cancel the order of the corresponding trading pair. Otherwise it will not.\n:::\n\n:::tip[Tips]\nThe order cancellation delay is between 0 and 10 seconds, and the order will not be canceled in real time. When the system cancels the order, if the transaction pair status is no longer operable to cancel the order, it will not cancel the order\n:::", - "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"Spot\",\"api-rate-limit-pool\":\"Spot\",\"sdk-service\":\"Spot\",\"sdk-sub-service\":\"Order\",\"sdk-method-name\":\"setDCP\",\"sdk-method-description\":\"Set Disconnection Protect(Deadman Swich)Through this interface, Call this interface to automatically cancel all orders of the set trading pair after the specified time. If this interface is not called again for renewal or cancellation before the set time, the system will help the user to cancel the order of the corresponding trading pair. Otherwise it will not.\",\"api-rate-limit\":2}" + "description": ":::info[Description]\nRequest via this endpoint to get the transaction currency for the entire trading market.\n:::\n\n:::tip[Tips]\nSC has been changed to USDS, but you can still use SC as a query parameter\n\nThe three markets of ETH, NEO and TRX are merged into the ALTS market. You can query the trading pairs of the ETH, NEO and TRX markets through the ALTS trading area.\n:::", + "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Spot\",\"api-channel\":\"Public\",\"api-permission\":\"NULL\",\"api-rate-limit-pool\":\"Public\",\"sdk-service\":\"Spot\",\"sdk-sub-service\":\"Market\",\"sdk-method-name\":\"getMarketList\",\"sdk-method-description\":\"Request via this endpoint to get the transaction currency for the entire trading market.\",\"api-rate-limit\":3}" } }, { - "name": "Cancel Order By OrderId", + "name": "Get Server Time", "api": { - "id": "3470174", - "method": "delete", - "path": "/api/v1/hf/orders/{orderId}", + "id": "3470156", + "method": "get", + "path": "/api/v1/timestamp", "parameters": { - "path": [ - { - "id": "orderId#0", - "name": "orderId", - "required": true, - "description": "The unique order id generated by the trading system", - "example": "671124f9365ccb00073debd4", - "type": "string" - } - ], - "query": [ - { - "id": "KXIxHhD4qw", - "name": "symbol", - "required": true, - "description": "symbol", - "example": "BTC-USDT", - "type": "string", - "schema": { - "type": "string", - "examples": [ - "BTC-USDT", - "ETH-USDT", - "KCS-USDT" - ] - } - } - ], + "path": [], + "query": [], "cookie": [], "header": [] }, "responses": [ { - "id": "10338", + "id": "10320", "code": 200, "name": "OK", "headers": [], @@ -13389,16 +12060,9 @@ "type": "string" }, "data": { - "type": "object", - "properties": { - "orderId": { - "type": "string", - "description": "order id" - } - }, - "required": [ - "orderId" - ] + "type": "integer", + "format": "int64", + "description": "ServerTime(millisecond)" } }, "required": [ @@ -13414,8 +12078,8 @@ "responseExamples": [ { "name": "Success", - "data": "{\n \"code\": \"200000\",\n \"data\": {\n \"orderId\": \"671124f9365ccb00073debd4\"\n }\n}", - "responseId": 10338, + "data": "{\"code\":\"200000\",\"data\":1729100692873}", + "responseId": 10320, "ordering": 1 } ], @@ -13426,38 +12090,27 @@ "type": "object", "properties": {} }, - "example": "{\n \"symbol\": \"BTC-USDT\",\n \"orderId\": \"670fd33bf9406e0007ab3945\",\n \"newPrice\": \"30000\",\n \"newSize\": \"0.0001\"\n}", "mediaType": "" }, - "description": ":::info[Description]\nThis endpoint can be used to cancel a spot order by orderId.\nThis endpoint only sends cancellation requests. The results of the requests must be obtained by checking the order status or subscribing to websocket.\n:::", - "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"Spot\",\"api-rate-limit-pool\":\"Spot\",\"sdk-service\":\"Spot\",\"sdk-sub-service\":\"Order\",\"sdk-method-name\":\"cancelOrderByOrderId\",\"sdk-method-description\":\"This endpoint can be used to cancel a spot order by orderId. This endpoint only sends cancellation requests. The results of the requests must be obtained by checking the order status or subscribing to websocket.\",\"api-rate-limit\":1}" + "description": ":::info[Description]\nGet the server time.\n:::", + "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Spot\",\"api-channel\":\"Public\",\"api-permission\":\"NULL\",\"api-rate-limit-pool\":\"Public\",\"sdk-service\":\"Spot\",\"sdk-sub-service\":\"Market\",\"sdk-method-name\":\"getServerTime\",\"sdk-method-description\":\"Get the server time.\",\"api-rate-limit\":3}" } }, { - "name": "Cancel Stop Order By OrderId", + "name": "Get Service Status", "api": { - "id": "3470335", - "method": "delete", - "path": "/api/v1/stop-order/{orderId}", + "id": "3470158", + "method": "get", + "path": "/api/v1/status", "parameters": { + "path": [], "query": [], - "path": [ - { - "id": "orderId#0", - "name": "orderId", - "required": true, - "description": "The unique order id generated by the trading system", - "example": "671124f9365ccb00073debd4", - "type": "string", - "enable": true - } - ], "cookie": [], "header": [] }, "responses": [ { - "id": "10510", + "id": "10322", "code": 200, "name": "OK", "headers": [], @@ -13470,16 +12123,40 @@ "data": { "type": "object", "properties": { - "cancelledOrderIds": { - "type": "array", - "items": { - "type": "string" - }, - "description": "order id array" + "status": { + "type": "string", + "description": "Status of service: open:normal transaction, close:Stop Trading/Maintenance, cancelonly:can only cancel the order but not place order", + "enum": [ + "open", + "close", + "cancelonly" + ], + "x-api-enum": [ + { + "value": "open", + "name": "OPEN", + "description": "normal transaction" + }, + { + "value": "close", + "name": "CLOSE", + "description": "Stop Trading/Maintenance" + }, + { + "value": "cancelonly", + "name": "CANCELONLY", + "description": "can only cancel the order but not place order" + } + ] + }, + "msg": { + "type": "string", + "description": "Remark for operation" } }, "required": [ - "cancelledOrderIds" + "status", + "msg" ] } }, @@ -13496,8 +12173,8 @@ "responseExamples": [ { "name": "Success", - "data": "{\n \"code\": \"200000\",\n \"data\": {\n \"cancelledOrderIds\": [\n \"671124f9365ccb00073debd4\"\n ]\n }\n}", - "responseId": 10510, + "data": "{\"code\":\"200000\",\"data\":{\"status\":\"open\",\"msg\":\"\"}}", + "responseId": 10322, "ordering": 1 } ], @@ -13508,45 +12185,34 @@ "type": "object", "properties": {} }, - "example": "{\n \"symbol\": \"BTC-USDT\",\n \"orderId\": \"670fd33bf9406e0007ab3945\",\n \"newPrice\": \"30000\",\n \"newSize\": \"0.0001\"\n}", "mediaType": "" }, - "description": ":::info[Description]\nRequest via this endpoint to cancel a single stop order previously placed.\n\nYou will receive cancelledOrderIds field once the system has received the cancellation request. The cancellation request will be processed by the matching engine in sequence. To know if the request is processed (successfully or not), you may check the order status or the update message from the websocket pushes.\n:::", - "customApiFields": "{\"abandon\":\"abandon\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"Spot\",\"api-rate-limit-pool\":\"Spot\",\"sdk-service\":\"Spot\",\"sdk-sub-service\":\"Order\",\"sdk-method-name\":\"cancelStopOrderByOrderId\",\"sdk-method-description\":\"This endpoint can be used to cancel a spot stop order by orderId. \",\"api-rate-limit\":3}" + "description": ":::info[Description]\nGet the service status\n:::", + "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Spot\",\"api-channel\":\"Public\",\"api-permission\":\"NULL\",\"api-rate-limit-pool\":\"Public\",\"sdk-service\":\"Spot\",\"sdk-sub-service\":\"Market\",\"sdk-method-name\":\"getServiceStatus\",\"sdk-method-description\":\"Get the service status\",\"api-rate-limit\":3}" } - }, - { - "name": "Cancel All Orders By Symbol", - "api": { - "id": "3470175", - "method": "delete", - "path": "/api/v1/hf/orders", - "parameters": { - "path": [], - "query": [ - { - "id": "KXIxHhD4qw", - "name": "symbol", - "required": true, - "description": "symbol", - "example": "BTC-USDT", - "type": "string", - "schema": { - "type": "string", - "examples": [ - "BTC-USDT", - "ETH-USDT", - "KCS-USDT" - ] - } - } - ], + } + ] + }, + { + "name": "Orders", + "id": 348147, + "description": "", + "items": [ + { + "name": "Add Order", + "api": { + "id": "3470188", + "method": "post", + "path": "/api/v1/hf/orders", + "parameters": { + "query": [], + "path": [], "cookie": [], "header": [] }, "responses": [ { - "id": "10339", + "id": "10352", "code": 200, "name": "OK", "headers": [], @@ -13557,7 +12223,21 @@ "type": "string" }, "data": { - "type": "string" + "type": "object", + "properties": { + "orderId": { + "type": "string", + "description": "The unique order id generated by the trading system,which can be used later for further actions such as canceling the order." + }, + "clientOid": { + "type": "string", + "description": "The user self-defined order id." + } + }, + "required": [ + "orderId", + "clientOid" + ] } }, "required": [ @@ -13573,40 +12253,217 @@ "responseExamples": [ { "name": "Success", - "data": "{\"code\":\"200000\",\"data\":\"success\"}", - "responseId": 10339, + "data": "{\"code\":\"200000\",\"data\":{\"orderId\":\"670fd33bf9406e0007ab3945\",\"clientOid\":\"5c52e11203aa677f33e493fb\"}}", + "responseId": 10352, "ordering": 1 } ], "requestBody": { - "type": "none", + "type": "application/json", "parameters": [], "jsonSchema": { "type": "object", - "properties": {} + "properties": { + "clientOid": { + "type": "string", + "description": "Client Order Id,The ClientOid field is a unique ID created by the user(we recommend using a UUID), and can only contain numbers, letters, underscores (_), and hyphens (-). This field is returned when order information is obtained. You can use clientOid to tag your orders. ClientOid is different from the order ID created by the service provider. Please do not initiate requests using the same clientOid. The maximum length for the ClientOid is 40 characters.\n\nPlease remember the orderId created by the service provider, it used to check for updates in order status.", + "examples": [ + "5c52e11203aa677f33e493fb" + ] + }, + "side": { + "type": "string", + "description": "specify if the order is to 'buy' or 'sell'", + "enum": [ + "buy", + "sell" + ], + "examples": [ + "buy" + ], + "x-api-enum": [ + { + "value": "buy", + "name": "", + "description": "" + }, + { + "value": "sell", + "name": "", + "description": "" + } + ] + }, + "symbol": { + "type": "string", + "description": "symbol", + "examples": [ + "BTC-USDT", + "ETH-USDT", + "KCS-USDT" + ] + }, + "type": { + "type": "string", + "description": "specify if the order is an 'limit' order or 'market' order. \n\nThe type of order you specify when you place your order determines whether or not you need to request other parameters and also affects the execution of the matching engine.\n\nWhen placing a limit order, you must specify a price and size. The system will try to match the order according to market price or a price better than market price. If the order cannot be immediately matched, it will stay in the order book until it is matched or the user cancels.\n\nUnlike limit orders, the price for market orders fluctuates with market prices. When placing a market order, you do not need to specify a price, you only need to specify a quantity. Market orders are filled immediately and will not enter the order book. All market orders are takers and a taker fee will be charged.", + "enum": [ + "limit", + "market" + ], + "examples": [ + "limit" + ], + "x-api-enum": [ + { + "value": "limit", + "name": "", + "description": "" + }, + { + "value": "market", + "name": "", + "description": "" + } + ] + }, + "remark": { + "type": "string", + "description": "Order placement remarks, length cannot exceed 20 characters (ASCII)" + }, + "stp": { + "type": "string", + "description": "[Self Trade Prevention](apidog://link/pages/338146) is divided into four strategies: CN, CO, CB , and DC", + "enum": [ + "DC", + "CO", + "CN", + "CB" + ], + "x-api-enum": [ + { + "value": "DC", + "name": "", + "description": "" + }, + { + "value": "CO", + "name": "", + "description": "" + }, + { + "value": "CN", + "name": "", + "description": "" + }, + { + "value": "CB", + "name": "", + "description": "" + } + ] + }, + "price": { + "type": "string", + "description": "Specify price for order\n\nWhen placing a limit order, the price must be based on priceIncrement for the trading pair. The price increment (priceIncrement) is the price precision for the trading pair. For example, for the BTC-USDT trading pair, the priceIncrement is 0.00001000. So the price for your orders cannot be less than 0.00001000 and must be a multiple of priceIncrement. Otherwise, the order will return an invalid priceIncrement error." + }, + "size": { + "type": "string", + "description": "Specify quantity for order\n\nWhen **type** is limit, size refers to the amount of trading targets (the asset name written in front) for the trading pair. Teh Size must be based on the baseIncrement of the trading pair. The baseIncrement represents the precision for the trading pair. The size of an order must be a positive-integer multiple of baseIncrement and must be between baseMinSize and baseMaxSize.\n\nWhen **type** is market, select one out of two: size or funds" + }, + "timeInForce": { + "type": "string", + "description": "[Time in force](apidog://link/pages/338146) is a special strategy used during trading", + "enum": [ + "GTC", + "GTT", + "IOC", + "FOK" + ], + "default": "GTC", + "x-api-enum": [ + { + "value": "GTC", + "name": "", + "description": "" + }, + { + "value": "GTT", + "name": "", + "description": "" + }, + { + "value": "IOC", + "name": "", + "description": "" + }, + { + "value": "FOK", + "name": "", + "description": "" + } + ] + }, + "postOnly": { + "type": "boolean", + "default": false, + "description": "passive order labels, this is disabled when the order timing strategy is IOC or FOK" + }, + "hidden": { + "type": "boolean", + "description": "[Hidden order](apidog://link/pages/338146) or not (not shown in order book)", + "default": false + }, + "iceberg": { + "type": "boolean", + "description": "Whether or not only visible portions of orders are shown in [Iceberg orders](apidog://link/pages/338146)", + "default": false + }, + "visibleSize": { + "type": "string", + "description": "Maximum visible quantity in iceberg orders" + }, + "tags": { + "type": "string", + "description": "Order tag, length cannot exceed 20 characters (ASCII)" + }, + "cancelAfter": { + "type": "integer", + "format": "int64", + "description": "Cancel after n seconds,the order timing strategy is GTT" + }, + "funds": { + "type": "string", + "description": "When **type** is market, select one out of two: size or funds" + } + }, + "required": [ + "symbol", + "type", + "side" + ] }, - "example": "{\n \"symbol\": \"BTC-USDT\",\n \"orderId\": \"670fd33bf9406e0007ab3945\",\n \"newPrice\": \"30000\",\n \"newSize\": \"0.0001\"\n}", + "example": "//limit order\n{\n \"type\": \"limit\",\n \"symbol\": \"BTC-USDT\",\n \"side\": \"buy\",\n \"price\": \"50000\",\n \"size\": \"0.00001\",\n \"clientOid\": \"5c52e11203aa677f33e493fb\",\n \"remark\": \"order remarks\"\n}\n\n//market order 1\n// {\n// \"type\": \"market\",\n// \"symbol\": \"BTC-USDT\",\n// \"side\": \"buy\",\n// \"size\": \"0.00001\",\n// \"clientOid\": \"5c52e11203aa677f33e493fc\",\n// \"remark\": \"order remarks\"\n// }\n\n//market order 2\n// {\n// \"type\": \"market\",\n// \"symbol\": \"BTC-USDT\",\n// \"side\": \"buy\",\n// \"funds\": \"1\",\n// \"clientOid\": \"5c52e11203aa677f33e493fc\",\n// \"remark\": \"order remarks\"\n// }\n", "mediaType": "" }, - "description": ":::info[Description]\nThis endpoint can cancel all spot orders for specific symbol.\nThis endpoint only sends cancellation requests. The results of the requests must be obtained by checking the order status or subscribing to websocket.\n:::", - "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"Spot\",\"api-rate-limit-pool\":\"Spot\",\"sdk-service\":\"Spot\",\"sdk-sub-service\":\"Order\",\"sdk-method-name\":\"cancelAllOrdersBySymbol\",\"sdk-method-description\":\"This endpoint can cancel all spot orders for specific symbol. This endpoint only sends cancellation requests. The results of the requests must be obtained by checking the order status or subscribing to websocket.\",\"api-rate-limit\":2}" + "description": ":::info[Description]\nPlace order to the Spot trading system, you can place two major types of orders: limit and market. Orders can only be placed if your account has sufficient funds. Once an order is placed, your funds will be put on hold for the duration of the order. The amount of funds on hold depends on the order type and parameters specified.\n:::\n\n:::tip[Tips]\nPlease note that once your order enters the order book, the system will freeze the handling fees for the order ahead of time.\n\nBefore placing orders, please be sure to fully understand the meaning of the parameters for each trading pair.\n:::\n\n:::tip[Tips]\nThe maximum number of active orders per account is 2000, with a maximum of 200 active orders per trading pair.\n:::\n\n\n**Public order placement request parameters**\n\n| Param | Type | Mandatory | Description |\n| --------- | ------ | --------- | ----------- |\n| clientOid | String | No | Client Order Id,unique identifier created by the user, the use of UUID is recommended |\n| symbol | String | Yes | symbol |\n| type | String | Yes | Order type `limit` and `market` |\n| side | String | Yes | `buy` or `sell` |\n| stp | String | No | self trade prevention is divided into four strategies: `CN`, `CO`, `CB` , and `DC` |\n| tags | String | No | Order tag, length cannot exceed `20` characters (ASCII) |\n| remark | String | No | Order placement remarks, length cannot exceed `20` characters (ASCII) |\n\n**Additional Request Parameters Required by `limit` Orders**\n\n| Param | Type | Mandatory | Description |\n| ----------- | ------- | --------- | ----------- |\n| price | String | Yes | Specify price for currency |\n| size | String | Yes | Specify quantity for currency |\n| timeInForce | String | No | Order timing strategy `GTC`, `GTT`, `IOC`, `FOK` (The default is `GTC`) |\n| cancelAfter | long | No | Cancel after `n` seconds,the order timing strategy is `GTT` |\n| postOnly | boolean | No | passive order labels, this is disabled when the order timing strategy is `IOC` or `FOK` |\n| hidden | boolean | No | Hidden or not (not shown in order book) |\n| iceberg | boolean | No | Whether or not only visible portions of orders are shown in iceberg orders |\n| visibleSize | String | No | Maximum visible quantity in iceberg orders |\n\n**Additional request parameters required by `market` orders**\n\n| Param | Type | Mandatory | Description |\n| ----- | ------ | --------- | ------------------------------------------ |\n| size | String | No | (Select one out of two: `size` or `funds`) |\n| funds | String | No | (Select one out of two: `size` or `funds`) |\n\n\n\n**Hold**\n\nFor limit price purchase orders, we will hold the amount of funds (price * size) required for your purchase order. Similarly, for limit price sell orders, we will also hold you sell order assets. When the transaction is executed, the service fees will be calculated. If you cancel a portion of a filled or unfilled order, then the remaining funds or amounts will be released and returned to your account. For market price buy/sell orders that require specific funds, we will hold the required funds in from your account. If only the size is specified, we may freeze (usually for a very short amount of time) all of the funds in your account prior to the order being filled or cancelled.\n\n\n**Order Lifecycle**\n\nWhen an order placement request is successful (the matching engine receives the order) or denied (due to there being insufficient funds or illegal parameter values, etc.), the system will respond to the HTTP request. When an order is successfully placed, the order ID is returned. The order will be matched, which could result in it being fully or partially filled. When an order is fully or partially filled, the remaining portions of the order will be in an active state awaiting to be matched (this does not include IOC orders). Orders that are fully or partially filled(already cancelled) will be put into the “done” state.\n\nUsers that have subscribed to the Market Data Channel can use the order ID (orderId) and client ID (clientOid) to identify messages.\n\n**Price Protection Mechanisms**\n\nPrice protection mechanisms ae enabled for order placements. Rules are detailed below:\n\n- If the spot trading market order/limit order placed by the user can be directly matched with an order in the current order book, the system will judge whether deviation between the price corresponding to the transaction depth and the spread exceeds the threshold value (the threshold value can be obtained using the symbol API endpoint);\n\n- If it is exceeded, for limit orders, the order will be directly cancelled;\n\n- If it is a market order, then the system will partially execute the order. The execution limit will be the order size within the price range corresponding to the threshold value. The remaining orders will not be filled.\n\nFor example: if the threshold value is 10%, when a user places a market price purchase order in the KCS/USDT trading market for 10,000 USDT (the selling price is currently 1.20000), the system will determine that after the order is completely filled, the final price will be 1.40000. (1.40000-1.20000)/1.20000=16.7%>10%. The threshold value is 1.32000. The user’s market price purchase order will be filled only to a maximum of 1.32000. The remaining order portions will not be matched with orders in the order book. Note: this feature may not be able to determine depth with complete accuracy. If your order is not completely filled, it may be because the portion exceeding the threshold value was not filled.\n", + "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"Spot\",\"api-rate-limit-pool\":\"Spot\",\"sdk-service\":\"Spot\",\"sdk-sub-service\":\"Order\",\"sdk-method-name\":\"addOrder\",\"sdk-method-description\":\"Place order to the Spot trading system, you can place two major types of orders: limit and market. Orders can only be placed if your account has sufficient funds. Once an order is placed, your funds will be put on hold for the duration of the order. The amount of funds on hold depends on the order type and parameters specified.\",\"api-rate-limit\":1}" } }, { - "name": "Cancel All Orders", + "name": "Add Order Sync", "api": { - "id": "3470176", - "method": "delete", - "path": "/api/v1/hf/orders/cancelAll", + "id": "3470170", + "method": "post", + "path": "/api/v1/hf/orders/sync", "parameters": { - "path": [], "query": [], + "path": [], "cookie": [], "header": [] }, "responses": [ { - "id": "10340", + "id": "10334", "code": 200, "name": "OK", "headers": [], @@ -13619,99 +12476,296 @@ "data": { "type": "object", "properties": { - "succeedSymbols": { - "type": "array", - "items": { - "type": "string" - }, - "description": "The Symbols Successfully cancelled" + "orderId": { + "type": "string", + "description": "The unique order id generated by the trading system,which can be used later for further actions such as canceling the order." }, - "failedSymbols": { - "type": "array", - "items": { - "type": "object", - "properties": { - "symbol": { - "type": "string", - "description": "symbol", - "examples": [ - "BTC-USDT", - "ETH-USDT", - "KCS-USDT" - ] - }, - "error": { - "type": "string", - "description": "error message" - } + "clientOid": { + "type": "string", + "description": "The user self-defined order id." + }, + "orderTime": { + "type": "integer", + "format": "int64" + }, + "originSize": { + "type": "string", + "description": "original order size" + }, + "dealSize": { + "type": "string", + "description": "deal size" + }, + "remainSize": { + "type": "string", + "description": "remain size" + }, + "canceledSize": { + "type": "string", + "description": "Cumulative canceled size" + }, + "status": { + "type": "string", + "description": "Order Status. open:order is active; done:order has been completed", + "enum": [ + "open", + "done" + ], + "x-api-enum": [ + { + "value": "open", + "name": "", + "description": "" + }, + { + "value": "done", + "name": "", + "description": "" } - }, - "description": "The Symbols Failed to cancel" + ] + }, + "matchTime": { + "type": "integer", + "format": "int64" } }, "required": [ - "succeedSymbols", - "failedSymbols" + "orderId", + "clientOid", + "orderTime", + "originSize", + "dealSize", + "remainSize", + "canceledSize", + "status", + "matchTime" ] } }, - "required": [ - "code", - "data" - ] + "required": [ + "code", + "data" + ] + }, + "description": "", + "contentType": "json", + "mediaType": "" + } + ], + "responseExamples": [ + { + "name": "Success", + "data": "{\"code\":\"200000\",\"data\":{\"orderId\":\"67111a7cb7cbdf000703e1f6\",\"clientOid\":\"5c52e11203aa677f33e493f\",\"orderTime\":1729174140586,\"originSize\":\"0.00001\",\"dealSize\":\"0\",\"remainSize\":\"0.00001\",\"canceledSize\":\"0\",\"status\":\"open\",\"matchTime\":1729174140588}}", + "responseId": 10334, + "ordering": 1 + } + ], + "requestBody": { + "type": "application/json", + "parameters": [], + "jsonSchema": { + "type": "object", + "properties": { + "clientOid": { + "type": "string", + "description": "Client Order Id,The ClientOid field is a unique ID created by the user(we recommend using a UUID), and can only contain numbers, letters, underscores (_), and hyphens (-). This field is returned when order information is obtained. You can use clientOid to tag your orders. ClientOid is different from the order ID created by the service provider. Please do not initiate requests using the same clientOid. The maximum length for the ClientOid is 40 characters.\n\nPlease remember the orderId created by the service provider, it used to check for updates in order status.", + "examples": [ + "5c52e11203aa677f33e493fb" + ] + }, + "side": { + "type": "string", + "description": "specify if the order is to 'buy' or 'sell'", + "enum": [ + "buy", + "sell" + ], + "examples": [ + "buy" + ], + "x-api-enum": [ + { + "value": "buy", + "name": "", + "description": "" + }, + { + "value": "sell", + "name": "", + "description": "" + } + ] + }, + "symbol": { + "type": "string", + "description": "symbol", + "examples": [ + "BTC-USDT", + "ETH-USDT", + "KCS-USDT" + ] + }, + "type": { + "type": "string", + "description": "specify if the order is an 'limit' order or 'market' order. \n\nThe type of order you specify when you place your order determines whether or not you need to request other parameters and also affects the execution of the matching engine.\n\nWhen placing a limit order, you must specify a price and size. The system will try to match the order according to market price or a price better than market price. If the order cannot be immediately matched, it will stay in the order book until it is matched or the user cancels.\n\nUnlike limit orders, the price for market orders fluctuates with market prices. When placing a market order, you do not need to specify a price, you only need to specify a quantity. Market orders are filled immediately and will not enter the order book. All market orders are takers and a taker fee will be charged.", + "enum": [ + "limit", + "market" + ], + "examples": [ + "limit" + ], + "x-api-enum": [ + { + "value": "limit", + "name": "", + "description": "" + }, + { + "value": "market", + "name": "", + "description": "" + } + ] + }, + "remark": { + "type": "string", + "description": "Order placement remarks, length cannot exceed 20 characters (ASCII)" + }, + "stp": { + "type": "string", + "description": "[Self Trade Prevention](apidog://link/pages/338146) is divided into four strategies: CN, CO, CB , and DC", + "enum": [ + "DC", + "CO", + "CN", + "CB" + ], + "x-api-enum": [ + { + "value": "DC", + "name": "", + "description": "" + }, + { + "value": "CO", + "name": "", + "description": "" + }, + { + "value": "CN", + "name": "", + "description": "" + }, + { + "value": "CB", + "name": "", + "description": "" + } + ] + }, + "price": { + "type": "string", + "description": "Specify price for order\n\nWhen placing a limit order, the price must be based on priceIncrement for the trading pair. The price increment (priceIncrement) is the price precision for the trading pair. For example, for the BTC-USDT trading pair, the priceIncrement is 0.00001000. So the price for your orders cannot be less than 0.00001000 and must be a multiple of priceIncrement. Otherwise, the order will return an invalid priceIncrement error." + }, + "size": { + "type": "string", + "description": "Specify quantity for order\n\nWhen **type** is limit, size refers to the amount of trading targets (the asset name written in front) for the trading pair. Teh Size must be based on the baseIncrement of the trading pair. The baseIncrement represents the precision for the trading pair. The size of an order must be a positive-integer multiple of baseIncrement and must be between baseMinSize and baseMaxSize.\n\nWhen **type** is market, select one out of two: size or funds" + }, + "timeInForce": { + "type": "string", + "description": "[Time in force](apidog://link/pages/338146) is a special strategy used during trading", + "enum": [ + "GTC", + "GTT", + "IOC", + "FOK" + ], + "default": "GTC", + "x-api-enum": [ + { + "value": "GTC", + "name": "", + "description": "" + }, + { + "value": "GTT", + "name": "", + "description": "" + }, + { + "value": "IOC", + "name": "", + "description": "" + }, + { + "value": "FOK", + "name": "", + "description": "" + } + ] + }, + "postOnly": { + "type": "boolean", + "default": false, + "description": "passive order labels, this is disabled when the order timing strategy is IOC or FOK" + }, + "hidden": { + "type": "boolean", + "description": "[Hidden order](apidog://link/pages/338146) or not (not shown in order book)", + "default": false + }, + "iceberg": { + "type": "boolean", + "description": "Whether or not only visible portions of orders are shown in [Iceberg orders](apidog://link/pages/338146)", + "default": false + }, + "visibleSize": { + "type": "string", + "description": "Maximum visible quantity in iceberg orders" + }, + "tags": { + "type": "string", + "description": "Order tag, length cannot exceed 20 characters (ASCII)" + }, + "cancelAfter": { + "type": "integer", + "format": "int64", + "description": "Cancel after n seconds,the order timing strategy is GTT" + }, + "funds": { + "type": "string", + "description": "When **type** is market, select one out of two: size or funds" + } }, - "description": "", - "contentType": "json", - "mediaType": "" - } - ], - "responseExamples": [ - { - "name": "Success", - "data": "{\n \"code\": \"200000\",\n \"data\": {\n \"succeedSymbols\": [\n \"ETH-USDT\",\n \"BTC-USDT\"\n ],\n \"failedSymbols\": []\n }\n}", - "responseId": 10340, - "ordering": 1 - } - ], - "requestBody": { - "type": "none", - "parameters": [], - "jsonSchema": { - "type": "object", - "properties": {} + "required": [ + "symbol", + "type", + "side" + ] }, - "example": "{\n \"symbol\": \"BTC-USDT\",\n \"orderId\": \"670fd33bf9406e0007ab3945\",\n \"newPrice\": \"30000\",\n \"newSize\": \"0.0001\"\n}", + "example": "//limit order\n{\n \"type\": \"limit\",\n \"symbol\": \"BTC-USDT\",\n \"side\": \"buy\",\n \"price\": \"50000\",\n \"size\": \"0.00001\",\n \"clientOid\": \"5c52e11203aa677f33e493f\",\n \"remark\": \"order remarks\"\n}\n\n//market order 1\n// {\n// \"type\": \"market\",\n// \"symbol\": \"BTC-USDT\",\n// \"side\": \"buy\",\n// \"size\": \"0.00001\",\n// \"clientOid\": \"5c52e11203aa677f33e493fc\",\n// \"remark\": \"order remarks\",\n// }\n\n//market order 2\n// {\n// \"type\": \"market\",\n// \"symbol\": \"BTC-USDT\",\n// \"side\": \"buy\",\n// \"funds\": \"1\",\n// \"clientOid\": \"5c52e11203aa677f33e493fc\",\n// \"remark\": \"order remarks\",\n// }\n", "mediaType": "" }, - "description": ":::info[Description]\nThis endpoint can cancel all spot orders for all symbol.\nThis endpoint only sends cancellation requests. The results of the requests must be obtained by checking the order status or subscribing to websocket.\n:::", - "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"Spot\",\"api-rate-limit-pool\":\"Spot\",\"sdk-service\":\"Spot\",\"sdk-sub-service\":\"Order\",\"sdk-method-name\":\"cancelAllOrders\",\"sdk-method-description\":\"This endpoint can cancel all spot orders for all symbol. This endpoint only sends cancellation requests. The results of the requests must be obtained by checking the order status or subscribing to websocket.\",\"api-rate-limit\":30}" + "description": ":::info[Description]\nPlace order to the spot trading system\n\nThe difference between this interface and \"Add order\" is that this interface will synchronously return the order information after the order matching is completed.\n\nFor higher latency requirements, please select the \"Add order\" interface. If there is a requirement for returning data integrity, please select this interface\n:::\n\n:::tip[Tips]\nPlease note that once your order enters the order book, the system will freeze the handling fees for the order ahead of time.\n\nBefore placing orders, please be sure to fully understand the meaning of the parameters for each trading pair.\n:::\n\n:::tip[Tips]\nThe maximum number of active orders per account is 2000, with a maximum of 200 active orders per trading pair.\n:::\n\n\n**Public order placement request parameters**\n\n| Param | Type | Mandatory | Description |\n| --------- | ------ | --------- | ----------- |\n| clientOid | String | No | Client Order Id,unique identifier created by the user, the use of UUID is recommended |\n| symbol | String | Yes | symbol |\n| type | String | Yes | Order type `limit` and `market` |\n| side | String | Yes | `buy` or `sell` |\n| stp | String | No | self trade prevention is divided into four strategies: `CN`, `CO`, `CB` , and `DC` |\n| tags | String | No | Order tag, length cannot exceed `20` characters (ASCII) |\n| remark | String | No | Order placement remarks, length cannot exceed `20` characters (ASCII) |\n\n**Additional Request Parameters Required by `limit` Orders**\n\n| Param | Type | Mandatory | Description |\n| ----------- | ------- | --------- | ----------- |\n| price | String | Yes | Specify price for currency |\n| size | String | Yes | Specify quantity for currency |\n| timeInForce | String | No | Order timing strategy `GTC`, `GTT`, `IOC`, `FOK` (The default is `GTC`) |\n| cancelAfter | long | No | Cancel after `n` seconds,the order timing strategy is `GTT` |\n| postOnly | boolean | No | passive order labels, this is disabled when the order timing strategy is `IOC` or `FOK` |\n| hidden | boolean | No | Hidden or not (not shown in order book) |\n| iceberg | boolean | No | Whether or not only visible portions of orders are shown in iceberg orders |\n| visibleSize | String | No | Maximum visible quantity in iceberg orders |\n\n**Additional request parameters required by `market` orders**\n\n| Param | Type | Mandatory | Description |\n| ----- | ------ | --------- | ------------------------------------------ |\n| size | String | No | (Select one out of two: `size` or `funds`) |\n| funds | String | No | (Select one out of two: `size` or `funds`) |\n\n\n\n**Hold**\n\nFor limit price purchase orders, we will hold the amount of funds (price * size) required for your purchase order. Similarly, for limit price sell orders, we will also hold you sell order assets. When the transaction is executed, the service fees will be calculated. If you cancel a portion of a filled or unfilled order, then the remaining funds or amounts will be released and returned to your account. For market price buy/sell orders that require specific funds, we will hold the required funds in from your account. If only the size is specified, we may freeze (usually for a very short amount of time) all of the funds in your account prior to the order being filled or cancelled.\n\n\n**Order Lifecycle**\n\nWhen an order placement request is successful (the matching engine receives the order) or denied (due to there being insufficient funds or illegal parameter values, etc.), the system will respond to the HTTP request. When an order is successfully placed, the order ID is returned. The order will be matched, which could result in it being fully or partially filled. When an order is fully or partially filled, the remaining portions of the order will be in an active state awaiting to be matched (this does not include IOC orders). Orders that are fully or partially filled(already cancelled) will be put into the “done” state.\n\nUsers that have subscribed to the Market Data Channel can use the order ID (orderId) and client ID (clientOid) to identify messages.\n\n**Price Protection Mechanisms**\n\nPrice protection mechanisms ae enabled for order placements. Rules are detailed below:\n\n- If the spot trading market order/limit order placed by the user can be directly matched with an order in the current order book, the system will judge whether deviation between the price corresponding to the transaction depth and the spread exceeds the threshold value (the threshold value can be obtained using the symbol API endpoint);\n\n- If it is exceeded, for limit orders, the order will be directly cancelled;\n\n- If it is a market order, then the system will partially execute the order. The execution limit will be the order size within the price range corresponding to the threshold value. The remaining orders will not be filled.\n\nFor example: if the threshold value is 10%, when a user places a market price purchase order in the KCS/USDT trading market for 10,000 USDT (the selling price is currently 1.20000), the system will determine that after the order is completely filled, the final price will be 1.40000. (1.40000-1.20000)/1.20000=16.7%>10%. The threshold value is 1.32000. The user’s market price purchase order will be filled only to a maximum of 1.32000. The remaining order portions will not be matched with orders in the order book. Note: this feature may not be able to determine depth with complete accuracy. If your order is not completely filled, it may be because the portion exceeding the threshold value was not filled.\n", + "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"Spot\",\"api-rate-limit-pool\":\"Spot\",\"sdk-service\":\"Spot\",\"sdk-sub-service\":\"Order\",\"sdk-method-name\":\"addOrderSync\",\"sdk-method-description\":\"Place order to the spot trading system The difference between this interface and \\\"Add order\\\" is that this interface will synchronously return the order information after the order matching is completed. For higher latency requirements, please select the \\\"Add order\\\" interface. If there is a requirement for returning data integrity, please select this interface\",\"api-rate-limit\":1}" } }, { - "name": "Cancel OCO Order By OrderId", + "name": "Add Order Test", "api": { - "id": "3470354", - "method": "delete", - "path": "/api/v3/oco/order/{orderId}", + "id": "3470187", + "method": "post", + "path": "/api/v1/hf/orders/test", "parameters": { "query": [], - "path": [ - { - "id": "orderId#0", - "name": "orderId", - "required": true, - "description": "The unique order id generated by the trading system", - "example": "674c316e688dea0007c7b986", - "type": "string", - "enable": true - } - ], + "path": [], "cookie": [], "header": [] }, "responses": [ { - "id": "10608", + "id": "10351", "code": 200, "name": "OK", "headers": [], @@ -13724,16 +12778,18 @@ "data": { "type": "object", "properties": { - "cancelledOrderIds": { - "type": "array", - "items": { - "type": "string" - }, - "description": "List of two order IDs related to the canceled OCO order" + "orderId": { + "type": "string", + "description": "The unique order id generated by the trading system,which can be used later for further actions such as canceling the order." + }, + "clientOid": { + "type": "string", + "description": "The user self-defined order id." } }, "required": [ - "cancelledOrderIds" + "orderId", + "clientOid" ] } }, @@ -13750,40 +12806,217 @@ "responseExamples": [ { "name": "Success", - "data": "{\r\n \"code\": \"200000\",\r\n \"data\": {\r\n \"cancelledOrderIds\": [\r\n \"vs93gpqc6kkmkk57003gok16\",\r\n \"vs93gpqc6kkmkk57003gok17\"\r\n ]\r\n }\r\n}", - "responseId": 10608, + "data": "{\"code\":\"200000\",\"data\":{\"orderId\":\"670fd33bf9406e0007ab3945\",\"clientOid\":\"5c52e11203aa677f33e493fb\"}}", + "responseId": 10351, "ordering": 1 } ], "requestBody": { - "type": "none", + "type": "application/json", "parameters": [], "jsonSchema": { "type": "object", - "properties": {} + "properties": { + "clientOid": { + "type": "string", + "description": "Client Order Id,The ClientOid field is a unique ID created by the user(we recommend using a UUID), and can only contain numbers, letters, underscores (_), and hyphens (-). This field is returned when order information is obtained. You can use clientOid to tag your orders. ClientOid is different from the order ID created by the service provider. Please do not initiate requests using the same clientOid. The maximum length for the ClientOid is 40 characters.\n\nPlease remember the orderId created by the service provider, it used to check for updates in order status.", + "examples": [ + "5c52e11203aa677f33e493fb" + ] + }, + "side": { + "type": "string", + "description": "specify if the order is to 'buy' or 'sell'", + "enum": [ + "buy", + "sell" + ], + "examples": [ + "buy" + ], + "x-api-enum": [ + { + "value": "buy", + "name": "", + "description": "" + }, + { + "value": "sell", + "name": "", + "description": "" + } + ] + }, + "symbol": { + "type": "string", + "description": "symbol", + "examples": [ + "BTC-USDT", + "ETH-USDT", + "KCS-USDT" + ] + }, + "type": { + "type": "string", + "description": "specify if the order is an 'limit' order or 'market' order. \n\nThe type of order you specify when you place your order determines whether or not you need to request other parameters and also affects the execution of the matching engine.\n\nWhen placing a limit order, you must specify a price and size. The system will try to match the order according to market price or a price better than market price. If the order cannot be immediately matched, it will stay in the order book until it is matched or the user cancels.\n\nUnlike limit orders, the price for market orders fluctuates with market prices. When placing a market order, you do not need to specify a price, you only need to specify a quantity. Market orders are filled immediately and will not enter the order book. All market orders are takers and a taker fee will be charged.", + "enum": [ + "limit", + "market" + ], + "examples": [ + "limit" + ], + "x-api-enum": [ + { + "value": "limit", + "name": "", + "description": "" + }, + { + "value": "market", + "name": "", + "description": "" + } + ] + }, + "remark": { + "type": "string", + "description": "Order placement remarks, length cannot exceed 20 characters (ASCII)" + }, + "stp": { + "type": "string", + "description": "[Self Trade Prevention](apidog://link/pages/338146) is divided into four strategies: CN, CO, CB , and DC", + "enum": [ + "DC", + "CO", + "CN", + "CB" + ], + "x-api-enum": [ + { + "value": "DC", + "name": "", + "description": "" + }, + { + "value": "CO", + "name": "", + "description": "" + }, + { + "value": "CN", + "name": "", + "description": "" + }, + { + "value": "CB", + "name": "", + "description": "" + } + ] + }, + "price": { + "type": "string", + "description": "Specify price for order\n\nWhen placing a limit order, the price must be based on priceIncrement for the trading pair. The price increment (priceIncrement) is the price precision for the trading pair. For example, for the BTC-USDT trading pair, the priceIncrement is 0.00001000. So the price for your orders cannot be less than 0.00001000 and must be a multiple of priceIncrement. Otherwise, the order will return an invalid priceIncrement error." + }, + "size": { + "type": "string", + "description": "Specify quantity for order\n\nWhen **type** is limit, size refers to the amount of trading targets (the asset name written in front) for the trading pair. Teh Size must be based on the baseIncrement of the trading pair. The baseIncrement represents the precision for the trading pair. The size of an order must be a positive-integer multiple of baseIncrement and must be between baseMinSize and baseMaxSize.\n\nWhen **type** is market, select one out of two: size or funds" + }, + "timeInForce": { + "type": "string", + "description": "[Time in force](apidog://link/pages/338146) is a special strategy used during trading", + "enum": [ + "GTC", + "GTT", + "IOC", + "FOK" + ], + "default": "GTC", + "x-api-enum": [ + { + "value": "GTC", + "name": "", + "description": "" + }, + { + "value": "GTT", + "name": "", + "description": "" + }, + { + "value": "IOC", + "name": "", + "description": "" + }, + { + "value": "FOK", + "name": "", + "description": "" + } + ] + }, + "postOnly": { + "type": "boolean", + "default": false, + "description": "passive order labels, this is disabled when the order timing strategy is IOC or FOK" + }, + "hidden": { + "type": "boolean", + "description": "[Hidden order](apidog://link/pages/338146) or not (not shown in order book)", + "default": false + }, + "iceberg": { + "type": "boolean", + "description": "Whether or not only visible portions of orders are shown in [Iceberg orders](apidog://link/pages/338146)", + "default": false + }, + "visibleSize": { + "type": "string", + "description": "Maximum visible quantity in iceberg orders" + }, + "tags": { + "type": "string", + "description": "Order tag, length cannot exceed 20 characters (ASCII)" + }, + "cancelAfter": { + "type": "integer", + "format": "int64", + "description": "Cancel after n seconds,the order timing strategy is GTT" + }, + "funds": { + "type": "string", + "description": "When **type** is market, select one out of two: size or funds" + } + }, + "required": [ + "symbol", + "type", + "side" + ] }, - "example": "{\n \"symbol\": \"BTC-USDT\",\n \"orderId\": \"670fd33bf9406e0007ab3945\",\n \"newPrice\": \"30000\",\n \"newSize\": \"0.0001\"\n}", + "example": "//limit order\n{\n \"type\": \"limit\",\n \"symbol\": \"BTC-USDT\",\n \"side\": \"buy\",\n \"price\": \"50000\",\n \"size\": \"0.00001\",\n \"clientOid\": \"5c52e11203aa677f33e493f\",\n \"remark\": \"order remarks\"\n}\n\n//market order 1\n// {\n// \"type\": \"market\",\n// \"symbol\": \"BTC-USDT\",\n// \"side\": \"buy\",\n// \"size\": \"0.00001\",\n// \"clientOid\": \"5c52e11203aa677f33e493fc\",\n// \"remark\": \"order remarks\",\n// }\n\n//market order 2\n// {\n// \"type\": \"market\",\n// \"symbol\": \"BTC-USDT\",\n// \"side\": \"buy\",\n// \"funds\": \"1\",\n// \"clientOid\": \"5c52e11203aa677f33e493fc\",\n// \"remark\": \"order remarks\",\n// }\n", "mediaType": "" }, - "description": ":::info[Description]\nRequest via this endpoint to cancel a single oco order previously placed.\n\nYou will receive cancelledOrderIds field once the system has received the cancellation request. The cancellation request will be processed by the matching engine in sequence. To know if the request is processed (successfully or not), you may check the order status or the update message from the pushes.\n:::", - "customApiFields": "{\"abandon\":\"abandon\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"Spot\",\"api-rate-limit-pool\":\"Spot\",\"sdk-service\":\"Spot\",\"sdk-sub-service\":\"Order\",\"sdk-method-name\":\"cancelOcoOrderByOrderId\",\"sdk-method-description\":\"This endpoint can be used to cancel a spot order by orderId. This endpoint only sends cancellation requests. The results of the requests must be obtained by checking the order status or subscribing to websocket.\",\"api-rate-limit\":3}" + "description": ":::info[Description]\nOrder test endpoint, the request parameters and return parameters of this endpoint are exactly the same as the order endpoint, and can be used to verify whether the signature is correct and other operations. After placing an order, the order will not enter the matching system, and the order cannot be queried.\n:::\n\n:::tip[Tips]\nPlease note that once your order enters the order book, the system will freeze the handling fees for the order ahead of time.\n\nBefore placing orders, please be sure to fully understand the meaning of the parameters for each trading pair.\n:::\n\n:::tip[Tips]\nThe maximum number of active orders per account is 2000, with a maximum of 200 active orders per trading pair.\n:::\n\n\n**Public order placement request parameters**\n\n| Param | Type | Mandatory | Description |\n| --------- | ------ | --------- | ----------- |\n| clientOid | String | No | Client Order Id,unique identifier created by the user, the use of UUID is recommended |\n| symbol | String | Yes | symbol |\n| type | String | Yes | Order type `limit` and `market` |\n| side | String | Yes | `buy` or `sell` |\n| stp | String | No | self trade prevention is divided into four strategies: `CN`, `CO`, `CB` , and `DC` |\n| tags | String | No | Order tag, length cannot exceed `20` characters (ASCII) |\n| remark | String | No | Order placement remarks, length cannot exceed `20` characters (ASCII) |\n\n**Additional Request Parameters Required by `limit` Orders**\n\n| Param | Type | Mandatory | Description |\n| ----------- | ------- | --------- | ----------- |\n| price | String | Yes | Specify price for currency |\n| size | String | Yes | Specify quantity for currency |\n| timeInForce | String | No | Order timing strategy `GTC`, `GTT`, `IOC`, `FOK` (The default is `GTC`) |\n| cancelAfter | long | No | Cancel after `n` seconds,the order timing strategy is `GTT` |\n| postOnly | boolean | No | passive order labels, this is disabled when the order timing strategy is `IOC` or `FOK` |\n| hidden | boolean | No | Hidden or not (not shown in order book) |\n| iceberg | boolean | No | Whether or not only visible portions of orders are shown in iceberg orders |\n| visibleSize | String | No | Maximum visible quantity in iceberg orders |\n\n**Additional request parameters required by `market` orders**\n\n| Param | Type | Mandatory | Description |\n| ----- | ------ | --------- | ------------------------------------------ |\n| size | String | No | (Select one out of two: `size` or `funds`) |\n| funds | String | No | (Select one out of two: `size` or `funds`) |\n\n\n**Hold**\n\nFor limit price purchase orders, we will hold the amount of funds (price * size) required for your purchase order. Similarly, for limit price sell orders, we will also hold you sell order assets. When the transaction is executed, the service fees will be calculated. If you cancel a portion of a filled or unfilled order, then the remaining funds or amounts will be released and returned to your account. For market price buy/sell orders that require specific funds, we will hold the required funds in from your account. If only the size is specified, we may freeze (usually for a very short amount of time) all of the funds in your account prior to the order being filled or cancelled.\n\n\n**Order Lifecycle**\n\nWhen an order placement request is successful (the matching engine receives the order) or denied (due to there being insufficient funds or illegal parameter values, etc.), the system will respond to the HTTP request. When an order is successfully placed, the order ID is returned. The order will be matched, which could result in it being fully or partially filled. When an order is fully or partially filled, the remaining portions of the order will be in an active state awaiting to be matched (this does not include IOC orders). Orders that are fully or partially filled(already cancelled) will be put into the “done” state.\n\nUsers that have subscribed to the Market Data Channel can use the order ID (orderId) and client ID (clientOid) to identify messages.\n\n**Price Protection Mechanisms**\n\nPrice protection mechanisms ae enabled for order placements. Rules are detailed below:\n\n- If the spot trading market order/limit order placed by the user can be directly matched with an order in the current order book, the system will judge whether deviation between the price corresponding to the transaction depth and the spread exceeds the threshold value (the threshold value can be obtained using the symbol API endpoint);\n\n- If it is exceeded, for limit orders, the order will be directly cancelled;\n\n- If it is a market order, then the system will partially execute the order. The execution limit will be the order size within the price range corresponding to the threshold value. The remaining orders will not be filled.\n\nFor example: if the threshold value is 10%, when a user places a market price purchase order in the KCS/USDT trading market for 10,000 USDT (the selling price is currently 1.20000), the system will determine that after the order is completely filled, the final price will be 1.40000. (1.40000-1.20000)/1.20000=16.7%>10%. The threshold value is 1.32000. The user’s market price purchase order will be filled only to a maximum of 1.32000. The remaining order portions will not be matched with orders in the order book. Note: this feature may not be able to determine depth with complete accuracy. If your order is not completely filled, it may be because the portion exceeding the threshold value was not filled.\n", + "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"Spot\",\"api-rate-limit-pool\":\"Spot\",\"sdk-service\":\"Spot\",\"sdk-sub-service\":\"Order\",\"sdk-method-name\":\"addOrderTest\",\"sdk-method-description\":\"Order test endpoint, the request parameters and return parameters of this endpoint are exactly the same as the order endpoint, and can be used to verify whether the signature is correct and other operations. After placing an order, the order will not enter the matching system, and the order cannot be queried.\",\"api-rate-limit\":1}" } }, { - "name": "Get Symbols With Open Order", + "name": "Batch Add Orders", "api": { - "id": "3470177", - "method": "get", - "path": "/api/v1/hf/orders/active/symbols", + "id": "3470168", + "method": "post", + "path": "/api/v1/hf/orders/multi", "parameters": { - "path": [], "query": [], + "path": [], "cookie": [], "header": [] }, "responses": [ { - "id": "10341", + "id": "10332", "code": 200, "name": "OK", "headers": [], @@ -13794,19 +13027,31 @@ "type": "string" }, "data": { - "type": "object", - "properties": { - "symbols": { - "type": "array", - "items": { - "type": "string" + "type": "array", + "items": { + "type": "object", + "properties": { + "orderId": { + "type": "string", + "description": "The unique order id generated by the trading system,which can be used later for further actions such as canceling the order." }, - "description": "The symbol that has active orders" - } - }, - "required": [ - "symbols" - ] + "clientOid": { + "type": "string", + "description": "The user self-defined order id." + }, + "success": { + "type": "boolean", + "description": "Add order success/failure" + }, + "failMsg": { + "type": "string", + "description": "error message" + } + }, + "required": [ + "success" + ] + } } }, "required": [ @@ -13822,58 +13067,215 @@ "responseExamples": [ { "name": "Success", - "data": "{\n \"code\": \"200000\",\n \"data\": {\n \"symbols\": [\n \"ETH-USDT\",\n \"BTC-USDT\"\n ]\n }\n}", - "responseId": 10341, + "data": "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"orderId\": \"6710d8336afcdb0007319c27\",\n \"clientOid\": \"client order id 12\",\n \"success\": true\n },\n {\n \"success\": false,\n \"failMsg\": \"The order funds should more then 0.1 USDT.\"\n }\n ]\n}", + "responseId": 10332, "ordering": 1 } ], "requestBody": { - "type": "none", + "type": "application/json", "parameters": [], "jsonSchema": { "type": "object", - "properties": {} + "properties": { + "orderList": { + "type": "array", + "items": { + "type": "object", + "properties": { + "clientOid": { + "type": "string", + "description": "Client Order Id,The ClientOid field is a unique ID created by the user(we recommend using a UUID), and can only contain numbers, letters, underscores (_), and hyphens (-). This field is returned when order information is obtained. You can use clientOid to tag your orders. ClientOid is different from the order ID created by the service provider. Please do not initiate requests using the same clientOid. The maximum length for the ClientOid is 40 characters.\n" + }, + "symbol": { + "type": "string", + "description": "symbol", + "examples": [ + "BTC-USDT", + "ETH-USDT", + "KCS-USDT" + ] + }, + "type": { + "type": "string", + "description": "Specify if the order is an 'limit' order or 'market' order. ", + "enum": [ + "limit" + ], + "x-api-enum": [ + { + "value": "limit", + "name": "", + "description": "" + } + ] + }, + "timeInForce": { + "type": "string", + "description": "[Time in force](apidog://link/pages/338146) is a special strategy used during trading", + "enum": [ + "GTC", + "GTT", + "IOC", + "FOK" + ], + "default": "GTC", + "x-api-enum": [ + { + "value": "GTC", + "name": "", + "description": "" + }, + { + "value": "GTT", + "name": "", + "description": "" + }, + { + "value": "IOC", + "name": "", + "description": "" + }, + { + "value": "FOK", + "name": "", + "description": "" + } + ] + }, + "side": { + "type": "string", + "description": "Specify if the order is to 'buy' or 'sell'", + "enum": [ + "buy", + "sell" + ], + "x-api-enum": [ + { + "value": "buy", + "name": "", + "description": "" + }, + { + "value": "sell", + "name": "", + "description": "" + } + ] + }, + "price": { + "type": "string", + "description": "Specify price for order" + }, + "size": { + "type": "string", + "description": "Specify quantity for order\n\nWhen **type** is limit, select one out of two: size or funds, size refers to the amount of trading targets (the asset name written in front) for the trading pair. Teh Size must be based on the baseIncrement of the trading pair. The baseIncrement represents the precision for the trading pair. The size of an order must be a positive-integer multiple of baseIncrement and must be between baseMinSize and baseMaxSize.\n\nWhen **type** is market, select one out of two: size or funds" + }, + "stp": { + "type": "string", + "description": "[Self Trade Prevention](apidog://link/pages/338146) is divided into four strategies: CN, CO, CB , and DC", + "enum": [ + "DC", + "CO", + "CN", + "CB" + ], + "x-api-enum": [ + { + "value": "DC", + "name": "", + "description": "" + }, + { + "value": "CO", + "name": "", + "description": "" + }, + { + "value": "CN", + "name": "", + "description": "" + }, + { + "value": "CB", + "name": "", + "description": "" + } + ] + }, + "cancelAfter": { + "type": "integer", + "description": "Cancel after n seconds,the order timing strategy is GTT", + "format": "int64" + }, + "postOnly": { + "type": "boolean", + "default": false, + "description": "passive order labels, this is disabled when the order timing strategy is IOC or FOK" + }, + "hidden": { + "type": "boolean", + "description": "[Hidden order](apidog://link/pages/338146) or not (not shown in order book)", + "default": false + }, + "iceberg": { + "type": "boolean", + "description": "Whether or not only visible portions of orders are shown in [Iceberg orders](apidog://link/pages/338146)", + "default": false + }, + "visibleSize": { + "type": "string", + "description": "Maximum visible quantity in iceberg orders" + }, + "tags": { + "type": "string", + "description": "Order tag, length cannot exceed 20 characters (ASCII)" + }, + "remark": { + "type": "string", + "description": "Order placement remarks, length cannot exceed 20 characters (ASCII)" + }, + "funds": { + "type": "string", + "description": "When **type** is market, select one out of two: size or funds" + } + }, + "required": [ + "type", + "symbol", + "side", + "price" + ] + }, + "description": "Order List" + } + }, + "required": [ + "orderList" + ] }, - "example": "{\n \"symbol\": \"BTC-USDT\",\n \"orderId\": \"670fd33bf9406e0007ab3945\",\n \"newPrice\": \"30000\",\n \"newSize\": \"0.0001\"\n}", + "example": "{\n \"orderList\": [\n {\n \"clientOid\": \"client order id 12\",\n \"symbol\": \"BTC-USDT\",\n \"type\": \"limit\",\n \"side\": \"buy\",\n \"price\": \"30000\",\n \"size\": \"0.00001\"\n },\n {\n \"clientOid\": \"client order id 13\",\n \"symbol\": \"ETH-USDT\",\n \"type\": \"limit\",\n \"side\": \"sell\",\n \"price\": \"2000\",\n \"size\": \"0.00001\"\n }\n ]\n}", "mediaType": "" }, - "description": ":::info[Description]\nThis interface can query all spot symbol that has active orders\n:::", - "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"Spot\",\"api-rate-limit-pool\":\"Spot\",\"sdk-service\":\"Spot\",\"sdk-sub-service\":\"Order\",\"sdk-method-name\":\"getSymbolsWithOpenOrder\",\"sdk-method-description\":\"This interface can query all spot symbol that has active orders\",\"api-rate-limit\":2}" + "description": ":::info[Description]\nThis endpoint supports sequential batch order placement from a single endpoint. A maximum of 20 orders can be placed simultaneously.\n:::\n\n\n\n:::tip[Tips]\nThis endpoint only supports order placement requests. To obtain the results of the order placement, you will need to check the order status or subscribe to websocket to obtain information about he order.\n:::\n\n:::tip[Tips]\nPlease note that once your order enters the order book, the system will freeze the handling fees for the order ahead of time.\n\nBefore placing orders, please be sure to fully understand the meaning of the parameters for each trading pair.\n:::\n\n:::tip[Tips]\nThe maximum number of active orders per account is 2000, with a maximum of 200 active orders per trading pair.\n:::\n\n**Public order placement request parameters**\n\n| Param | Type | Mandatory | Description |\n| --------- | ------ | --------- | ----------- |\n| clientOid | String | No | Client Order Id,unique identifier created by the user, the use of UUID is recommended |\n| symbol | String | Yes | symbol |\n| type | String | Yes | Order type `limit` and `market` |\n| side | String | Yes | `buy` or `sell` |\n| stp | String | No | self trade prevention is divided into four strategies: `CN`, `CO`, `CB` , and `DC` |\n| tags | String | No | Order tag, length cannot exceed `20` characters (ASCII) |\n| remark | String | No | Order placement remarks, length cannot exceed `20` characters (ASCII) |\n\n**Additional Request Parameters Required by `limit` Orders**\n\n| Param | Type | Mandatory | Description |\n| ----------- | ------- | --------- | ----------- |\n| price | String | Yes | Specify price for currency |\n| size | String | Yes | Specify quantity for currency |\n| timeInForce | String | No | Order timing strategy `GTC`, `GTT`, `IOC`, `FOK` (The default is `GTC`) |\n| cancelAfter | long | No | Cancel after `n` seconds,the order timing strategy is `GTT` |\n| postOnly | boolean | No | passive order labels, this is disabled when the order timing strategy is `IOC` or `FOK` |\n| hidden | boolean | No | Hidden or not (not shown in order book) |\n| iceberg | boolean | No | Whether or not only visible portions of orders are shown in iceberg orders |\n| visibleSize | String | No | Maximum visible quantity in iceberg orders |\n\n**Additional request parameters required by `market` orders**\n\n| Param | Type | Mandatory | Description |\n| ----- | ------ | --------- | ------------------------------------------ |\n| size | String | No | (Select one out of two: `size` or `funds`) |\n| funds | String | No | (Select one out of two: `size` or `funds`) |\n\n\n**Hold**\n\nFor limit price purchase orders, we will hold the amount of funds (price * size) required for your purchase order. Similarly, for limit price sell orders, we will also hold you sell order assets. When the transaction is executed, the service fees will be calculated. If you cancel a portion of a filled or unfilled order, then the remaining funds or amounts will be released and returned to your account. For market price buy/sell orders that require specific funds, we will hold the required funds in from your account. If only the size is specified, we may freeze (usually for a very short amount of time) all of the funds in your account prior to the order being filled or cancelled.\n\n\n**Order Lifecycle**\n\nWhen an order placement request is successful (the matching engine receives the order) or denied (due to there being insufficient funds or illegal parameter values, etc.), the system will respond to the HTTP request. When an order is successfully placed, the order ID is returned. The order will be matched, which could result in it being fully or partially filled. When an order is fully or partially filled, the remaining portions of the order will be in an active state awaiting to be matched (this does not include IOC orders). Orders that are fully or partially filled(already cancelled) will be put into the “done” state.\n\nUsers that have subscribed to the Market Data Channel can use the order ID (orderId) and client ID (clientOid) to identify messages.\n\n**Price Protection Mechanisms**\n\nPrice protection mechanisms ae enabled for order placements. Rules are detailed below:\n\n- If the spot trading market order/limit order placed by the user can be directly matched with an order in the current order book, the system will judge whether deviation between the price corresponding to the transaction depth and the spread exceeds the threshold value (the threshold value can be obtained using the symbol API endpoint);\n\n- If it is exceeded, for limit orders, the order will be directly cancelled;\n\n- If it is a market order, then the system will partially execute the order. The execution limit will be the order size within the price range corresponding to the threshold value. The remaining orders will not be filled.\n\nFor example: if the threshold value is 10%, when a user places a market price purchase order in the KCS/USDT trading market for 10,000 USDT (the selling price is currently 1.20000), the system will determine that after the order is completely filled, the final price will be 1.40000. (1.40000-1.20000)/1.20000=16.7%>10%. The threshold value is 1.32000. The user’s market price purchase order will be filled only to a maximum of 1.32000. The remaining order portions will not be matched with orders in the order book. Note: this feature may not be able to determine depth with complete accuracy. If your order is not completely filled, it may be because the portion exceeding the threshold value was not filled.\n", + "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"Spot\",\"api-rate-limit-pool\":\"Spot\",\"sdk-service\":\"Spot\",\"sdk-sub-service\":\"Order\",\"sdk-method-name\":\"batchAddOrders\",\"sdk-method-description\":\"This endpoint supports sequential batch order placement from a single endpoint. A maximum of 5orders can be placed simultaneously. The order types must be limit orders of the same trading pair\",\"api-rate-limit\":1}" } }, { - "name": "Get Open Orders", + "name": "Batch Add Orders Sync", "api": { - "id": "3470178", - "method": "get", - "path": "/api/v1/hf/orders/active", + "id": "3470169", + "method": "post", + "path": "/api/v1/hf/orders/multi/sync", "parameters": { - "query": [ - { - "id": "M9bgPS6vOj", - "name": "symbol", - "required": true, - "description": "symbol", - "example": "BTC-USDT", - "type": "string", - "schema": { - "type": "string", - "examples": [ - "BTC-USDT", - "ETH-USDT", - "KCS-USDT" - ] - }, - "enable": true - } - ], + "query": [], "path": [], "cookie": [], "header": [] }, "responses": [ { - "id": "10342", + "id": "10333", "code": 200, "name": "OK", "headers": [], @@ -13888,266 +13290,69 @@ "items": { "type": "object", "properties": { - "id": { - "type": "string", - "description": "The unique order id generated by the trading system" - }, - "symbol": { - "type": "string", - "description": "symbol", - "examples": [ - "BTC-USDT", - "ETH-USDT", - "KCS-USDT" - ] - }, - "opType": { - "type": "string" - }, - "type": { - "type": "string", - "description": "Specify if the order is an 'limit' order or 'market' order. ", - "enum": [ - "limit", - "market" - ], - "x-api-enum": [ - { - "value": "limit", - "name": "", - "description": "" - }, - { - "value": "market", - "name": "", - "description": "" - } - ] - }, - "side": { + "orderId": { "type": "string", - "description": "Buy or sell", - "enum": [ - "buy", - "sell" - ], - "x-api-enum": [ - { - "value": "buy", - "name": "", - "description": "" - }, - { - "value": "sell", - "name": "", - "description": "" - } - ] + "description": "The unique order id generated by the trading system,which can be used later for further actions such as canceling the order." }, - "price": { + "clientOid": { "type": "string", - "description": "Order price" + "description": "The user self-defined order id." }, - "size": { - "type": "string", - "description": "Order size" + "orderTime": { + "type": "integer", + "format": "int64" }, - "funds": { + "originSize": { "type": "string", - "description": "Order Funds" + "description": "original order size" }, "dealSize": { "type": "string", - "description": "Number of filled transactions" - }, - "dealFunds": { - "type": "string", - "description": "Funds of filled transactions" - }, - "fee": { - "type": "string", - "description": "[Handling fees](apidog://link/pages/5327739)" + "description": "deal size" }, - "feeCurrency": { + "remainSize": { "type": "string", - "description": "currency used to calculate trading fee" + "description": "remain size" }, - "stp": { + "canceledSize": { "type": "string", - "description": "[Self Trade Prevention](apidog://link/pages/5176570)", - "enum": [ - "DC", - "CO", - "CN", - "CB" - ], - "x-api-enum": [ - { - "value": "DC", - "name": "", - "description": "" - }, - { - "value": "CO", - "name": "", - "description": "" - }, - { - "value": "CN", - "name": "", - "description": "" - }, - { - "value": "CB", - "name": "", - "description": "" - } - ] + "description": "Cumulative canceled size" }, - "timeInForce": { + "status": { "type": "string", - "description": "Time in force", + "description": "Order Status. open:order is active; done:order has been completed", "enum": [ - "GTC", - "GTT", - "IOC", - "FOK" + "open", + "done" ], "x-api-enum": [ { - "value": "GTC", - "name": "", - "description": "" - }, - { - "value": "GTT", - "name": "", - "description": "" - }, - { - "value": "IOC", + "value": "open", "name": "", "description": "" }, { - "value": "FOK", + "value": "done", "name": "", "description": "" } ] }, - "postOnly": { - "type": "boolean", - "description": "Whether its a postOnly order." - }, - "hidden": { - "type": "boolean", - "description": "Whether its a hidden order." - }, - "iceberg": { - "type": "boolean", - "description": "Whether its a iceberg order." - }, - "visibleSize": { - "type": "string", - "description": "Visible size of iceberg order in order book." - }, - "cancelAfter": { - "type": "integer", - "description": "A GTT timeInForce that expires in n seconds" - }, - "channel": { - "type": "string" - }, - "clientOid": { - "type": "string", - "description": "Client Order Id,unique identifier created by the user" - }, - "remark": { - "type": "string", - "description": "Order placement remarks" - }, - "tags": { - "type": "string", - "description": "Order tag" - }, - "cancelExist": { - "type": "boolean", - "description": "Whether there is a cancellation record for the order." - }, - "createdAt": { - "type": "integer", - "format": "int64" - }, - "lastUpdatedAt": { + "matchTime": { "type": "integer", "format": "int64" }, - "tradeType": { - "type": "string", - "description": "Trade type, redundancy param" - }, - "inOrderBook": { + "success": { "type": "boolean", - "description": "Whether to enter the orderbook: true: enter the orderbook; false: not enter the orderbook" - }, - "cancelledSize": { - "type": "string", - "description": "Number of canceled transactions" - }, - "cancelledFunds": { - "type": "string", - "description": "Funds of canceled transactions" - }, - "remainSize": { - "type": "string", - "description": "Number of remain transactions" - }, - "remainFunds": { - "type": "string", - "description": "Funds of remain transactions" + "description": "Add order success/failure" }, - "tax": { + "failMsg": { "type": "string", - "description": "Users in some regions need query this field" - }, - "active": { - "type": "boolean", - "description": "Order status: true-The status of the order isactive; false-The status of the order is done" + "description": "error message" } }, "required": [ - "id", - "symbol", - "opType", - "type", - "side", - "price", - "size", - "funds", - "dealSize", - "dealFunds", - "fee", - "feeCurrency", - "timeInForce", - "postOnly", - "hidden", - "iceberg", - "visibleSize", - "cancelAfter", - "channel", - "clientOid", - "cancelExist", - "tradeType", - "inOrderBook", - "cancelledSize", - "cancelledFunds", - "remainSize", - "remainFunds", - "active", - "createdAt", - "lastUpdatedAt", - "tax" + "success" ] } } @@ -14165,8 +13370,278 @@ "responseExamples": [ { "name": "Success", - "data": "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"id\": \"67120bbef094e200070976f6\",\n \"clientOid\": \"5c52e11203aa677f33e493fb\",\n \"symbol\": \"BTC-USDT\",\n \"opType\": \"DEAL\",\n \"type\": \"limit\",\n \"side\": \"buy\",\n \"price\": \"50000\",\n \"size\": \"0.00001\",\n \"funds\": \"0.5\",\n \"dealSize\": \"0\",\n \"dealFunds\": \"0\",\n \"fee\": \"0\",\n \"feeCurrency\": \"USDT\",\n \"stp\": null,\n \"timeInForce\": \"GTC\",\n \"postOnly\": false,\n \"hidden\": false,\n \"iceberg\": false,\n \"visibleSize\": \"0\",\n \"cancelAfter\": 0,\n \"channel\": \"API\",\n \"remark\": \"order remarks\",\n \"tags\": \"order tags\",\n \"cancelExist\": false,\n \"tradeType\": \"TRADE\",\n \"inOrderBook\": true,\n \"cancelledSize\": \"0\",\n \"cancelledFunds\": \"0\",\n \"remainSize\": \"0.00001\",\n \"remainFunds\": \"0.5\",\n \"tax\": \"0\",\n \"active\": true,\n \"createdAt\": 1729235902748,\n \"lastUpdatedAt\": 1729235909862\n }\n ]\n}", - "responseId": 10342, + "data": "{\"code\":\"200000\",\"data\":[{\"orderId\":\"6711195e5584bc0007bd5aef\",\"clientOid\":\"client order id 13\",\"orderTime\":1729173854299,\"originSize\":\"0.00001\",\"dealSize\":\"0\",\"remainSize\":\"0.00001\",\"canceledSize\":\"0\",\"status\":\"open\",\"matchTime\":1729173854326,\"success\":true},{\"success\":false,\"failMsg\":\"The order funds should more then 0.1 USDT.\"}]}", + "responseId": 10333, + "ordering": 1 + } + ], + "requestBody": { + "type": "application/json", + "parameters": [], + "jsonSchema": { + "type": "object", + "properties": { + "orderList": { + "type": "array", + "items": { + "type": "object", + "properties": { + "clientOid": { + "type": "string", + "description": "Client Order Id,The ClientOid field is a unique ID created by the user(we recommend using a UUID), and can only contain numbers, letters, underscores (_), and hyphens (-). This field is returned when order information is obtained. You can use clientOid to tag your orders. ClientOid is different from the order ID created by the service provider. Please do not initiate requests using the same clientOid. The maximum length for the ClientOid is 40 characters.\n" + }, + "symbol": { + "type": "string", + "description": "symbol", + "examples": [ + "BTC-USDT", + "ETH-USDT", + "KCS-USDT" + ] + }, + "type": { + "type": "string", + "description": "Specify if the order is an 'limit' order or 'market' order. ", + "enum": [ + "limit" + ], + "x-api-enum": [ + { + "value": "limit", + "name": "", + "description": "" + } + ] + }, + "timeInForce": { + "type": "string", + "description": "[Time in force](apidog://link/pages/338146) is a special strategy used during trading", + "enum": [ + "GTC", + "GTT", + "IOC", + "FOK" + ], + "default": "GTC", + "x-api-enum": [ + { + "value": "GTC", + "name": "", + "description": "" + }, + { + "value": "GTT", + "name": "", + "description": "" + }, + { + "value": "IOC", + "name": "", + "description": "" + }, + { + "value": "FOK", + "name": "", + "description": "" + } + ] + }, + "side": { + "type": "string", + "description": "Specify if the order is to 'buy' or 'sell'", + "enum": [ + "buy", + "sell" + ], + "x-api-enum": [ + { + "value": "buy", + "name": "", + "description": "" + }, + { + "value": "sell", + "name": "", + "description": "" + } + ] + }, + "price": { + "type": "string", + "description": "Specify price for order" + }, + "size": { + "type": "string", + "description": "Specify quantity for order\n\nWhen **type** is limit, select one out of two: size or funds, size refers to the amount of trading targets (the asset name written in front) for the trading pair. Teh Size must be based on the baseIncrement of the trading pair. The baseIncrement represents the precision for the trading pair. The size of an order must be a positive-integer multiple of baseIncrement and must be between baseMinSize and baseMaxSize.\n\nWhen **type** is market, select one out of two: size or funds" + }, + "stp": { + "type": "string", + "description": "[Self Trade Prevention](apidog://link/pages/338146) is divided into four strategies: CN, CO, CB , and DC", + "enum": [ + "DC", + "CO", + "CN", + "CB" + ], + "x-api-enum": [ + { + "value": "DC", + "name": "", + "description": "" + }, + { + "value": "CO", + "name": "", + "description": "" + }, + { + "value": "CN", + "name": "", + "description": "" + }, + { + "value": "CB", + "name": "", + "description": "" + } + ] + }, + "cancelAfter": { + "type": "integer", + "description": "Cancel after n seconds,the order timing strategy is GTT", + "format": "int64" + }, + "postOnly": { + "type": "boolean", + "default": false, + "description": "passive order labels, this is disabled when the order timing strategy is IOC or FOK" + }, + "hidden": { + "type": "boolean", + "description": "[Hidden order](apidog://link/pages/338146) or not (not shown in order book)", + "default": false + }, + "iceberg": { + "type": "boolean", + "description": "Whether or not only visible portions of orders are shown in [Iceberg orders](apidog://link/pages/338146)", + "default": false + }, + "visibleSize": { + "type": "string", + "description": "Maximum visible quantity in iceberg orders" + }, + "tags": { + "type": "string", + "description": "Order tag, length cannot exceed 20 characters (ASCII)" + }, + "remark": { + "type": "string", + "description": "Order placement remarks, length cannot exceed 20 characters (ASCII)" + }, + "funds": { + "type": "string", + "description": "When **type** is market, select one out of two: size or funds" + } + }, + "required": [ + "type", + "symbol", + "side", + "price" + ] + }, + "description": "Order List" + } + }, + "required": [ + "orderList" + ] + }, + "example": "{\n \"orderList\": [\n {\n \"clientOid\": \"client order id 13\",\n \"symbol\": \"BTC-USDT\",\n \"type\": \"limit\",\n \"side\": \"buy\",\n \"price\": \"30000\",\n \"size\": \"0.00001\"\n },\n {\n \"clientOid\": \"client order id 14\",\n \"symbol\": \"ETH-USDT\",\n \"type\": \"limit\",\n \"side\": \"sell\",\n \"price\": \"2000\",\n \"size\": \"0.00001\"\n }\n ]\n}", + "mediaType": "" + }, + "description": ":::info[Description]\nThis endpoint supports sequential batch order placement from a single endpoint. A maximum of 20 orders can be placed simultaneously.\n\nThe difference between this interface and \"Batch Add Orders\" is that this interface will synchronously return the order information after the order matching is completed.\n\nFor higher latency requirements, please select the \"Batch Add Orders\" interface. If there is a requirement for returning data integrity, please select this interface\n:::\n\n\n\n:::tip[Tips]\nThis endpoint only supports order placement requests. To obtain the results of the order placement, you will need to check the order status or subscribe to websocket to obtain information about he order.\n:::\n\n:::tip[Tips]\nPlease note that once your order enters the order book, the system will freeze the handling fees for the order ahead of time.\n\nBefore placing orders, please be sure to fully understand the meaning of the parameters for each trading pair.\n:::\n\n:::tip[Tips]\nThe maximum number of active orders per account is 2000, with a maximum of 200 active orders per trading pair.\n:::\n\n**Public order placement request parameters**\n\n| Param | Type | Mandatory | Description |\n| --------- | ------ | --------- | ----------- |\n| clientOid | String | No | Client Order Id,unique identifier created by the user, the use of UUID is recommended |\n| symbol | String | Yes | symbol |\n| type | String | Yes | Order type `limit` and `market` |\n| side | String | Yes | `buy` or `sell` |\n| stp | String | No | self trade prevention is divided into four strategies: `CN`, `CO`, `CB` , and `DC` |\n| tags | String | No | Order tag, length cannot exceed `20` characters (ASCII) |\n| remark | String | No | Order placement remarks, length cannot exceed `20` characters (ASCII) |\n\n**Additional Request Parameters Required by `limit` Orders**\n\n| Param | Type | Mandatory | Description |\n| ----------- | ------- | --------- | ----------- |\n| price | String | Yes | Specify price for currency |\n| size | String | Yes | Specify quantity for currency |\n| timeInForce | String | No | Order timing strategy `GTC`, `GTT`, `IOC`, `FOK` (The default is `GTC`) |\n| cancelAfter | long | No | Cancel after `n` seconds,the order timing strategy is `GTT` |\n| postOnly | boolean | No | passive order labels, this is disabled when the order timing strategy is `IOC` or `FOK` |\n| hidden | boolean | No | Hidden or not (not shown in order book) |\n| iceberg | boolean | No | Whether or not only visible portions of orders are shown in iceberg orders |\n| visibleSize | String | No | Maximum visible quantity in iceberg orders |\n\n**Additional request parameters required by `market` orders**\n\n| Param | Type | Mandatory | Description |\n| ----- | ------ | --------- | ------------------------------------------ |\n| size | String | No | (Select one out of two: `size` or `funds`) |\n| funds | String | No | (Select one out of two: `size` or `funds`) |\n\n\n**Hold**\n\nFor limit price purchase orders, we will hold the amount of funds (price * size) required for your purchase order. Similarly, for limit price sell orders, we will also hold you sell order assets. When the transaction is executed, the service fees will be calculated. If you cancel a portion of a filled or unfilled order, then the remaining funds or amounts will be released and returned to your account. For market price buy/sell orders that require specific funds, we will hold the required funds in from your account. If only the size is specified, we may freeze (usually for a very short amount of time) all of the funds in your account prior to the order being filled or cancelled.\n\n\n**Order Lifecycle**\n\nWhen an order placement request is successful (the matching engine receives the order) or denied (due to there being insufficient funds or illegal parameter values, etc.), the system will respond to the HTTP request. When an order is successfully placed, the order ID is returned. The order will be matched, which could result in it being fully or partially filled. When an order is fully or partially filled, the remaining portions of the order will be in an active state awaiting to be matched (this does not include IOC orders). Orders that are fully or partially filled(already cancelled) will be put into the “done” state.\n\nUsers that have subscribed to the Market Data Channel can use the order ID (orderId) and client ID (clientOid) to identify messages.\n\n**Price Protection Mechanisms**\n\nPrice protection mechanisms ae enabled for order placements. Rules are detailed below:\n\n- If the spot trading market order/limit order placed by the user can be directly matched with an order in the current order book, the system will judge whether deviation between the price corresponding to the transaction depth and the spread exceeds the threshold value (the threshold value can be obtained using the symbol API endpoint);\n\n- If it is exceeded, for limit orders, the order will be directly cancelled;\n\n- If it is a market order, then the system will partially execute the order. The execution limit will be the order size within the price range corresponding to the threshold value. The remaining orders will not be filled.\n\nFor example: if the threshold value is 10%, when a user places a market price purchase order in the KCS/USDT trading market for 10,000 USDT (the selling price is currently 1.20000), the system will determine that after the order is completely filled, the final price will be 1.40000. (1.40000-1.20000)/1.20000=16.7%>10%. The threshold value is 1.32000. The user’s market price purchase order will be filled only to a maximum of 1.32000. The remaining order portions will not be matched with orders in the order book. Note: this feature may not be able to determine depth with complete accuracy. If your order is not completely filled, it may be because the portion exceeding the threshold value was not filled.\n", + "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"Spot\",\"api-rate-limit-pool\":\"Spot\",\"sdk-service\":\"Spot\",\"sdk-sub-service\":\"Order\",\"sdk-method-name\":\"batchAddOrdersSync\",\"sdk-method-description\":\"This endpoint supports sequential batch order placement from a single endpoint. A maximum of 5orders can be placed simultaneously. The order types must be limit orders of the same trading pair\",\"api-rate-limit\":1}" + } + }, + { + "name": "Cancel Order By OrderId", + "api": { + "id": "3470174", + "method": "delete", + "path": "/api/v1/hf/orders/{orderId}", + "parameters": { + "path": [ + { + "id": "orderId#0", + "name": "orderId", + "required": true, + "description": "The unique order id generated by the trading system", + "example": "671124f9365ccb00073debd4", + "type": "string" + } + ], + "query": [ + { + "id": "KXIxHhD4qw", + "name": "symbol", + "required": true, + "description": "symbol", + "example": "BTC-USDT", + "type": "string", + "schema": { + "type": "string", + "examples": [ + "BTC-USDT", + "ETH-USDT", + "KCS-USDT" + ] + } + } + ], + "cookie": [], + "header": [] + }, + "responses": [ + { + "id": "10338", + "code": 200, + "name": "OK", + "headers": [], + "jsonSchema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "object", + "properties": { + "orderId": { + "type": "string", + "description": "order id" + } + }, + "required": [ + "orderId" + ] + } + }, + "required": [ + "code", + "data" + ] + }, + "description": "", + "contentType": "json", + "mediaType": "" + } + ], + "responseExamples": [ + { + "name": "Success", + "data": "{\n \"code\": \"200000\",\n \"data\": {\n \"orderId\": \"671124f9365ccb00073debd4\"\n }\n}", + "responseId": 10338, "ordering": 1 } ], @@ -14180,25 +13655,51 @@ "example": "{\n \"symbol\": \"BTC-USDT\",\n \"orderId\": \"670fd33bf9406e0007ab3945\",\n \"newPrice\": \"30000\",\n \"newSize\": \"0.0001\"\n}", "mediaType": "" }, - "description": ":::info[Description]\nThis interface is to obtain all Spot active order lists, and the return value of the active order interface is the paged data of all uncompleted order lists. The returned data is sorted in descending order according to the latest update time of the order.\n\nAfter the user successfully places an order, the order is in Active state, and the user can use inOrderBook to determine whether the order has entered the order. Canceled or fully filled orders are marked as completed Done status.\n:::\n\n:::tip[Tips]\nFor high-frequency trading users, we recommend locally caching, maintaining your own order records, and using market data streams to update your order information in real time.\n:::", - "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"General\",\"api-rate-limit-pool\":\"Spot\",\"sdk-service\":\"Spot\",\"sdk-sub-service\":\"Order\",\"sdk-method-name\":\"getOpenOrders\",\"sdk-method-description\":\"This interface is to obtain all Spot active order lists, and the return value of the active order interface is the paged data of all uncompleted order lists. The returned data is sorted in descending order according to the latest update time of the order. After the user successfully places an order, the order is in Active state, and the user can use inOrderBook to determine whether the order has entered the order. Canceled or fully filled orders are marked as completed Done status.\",\"api-rate-limit\":2}" + "description": ":::info[Description]\nThis endpoint can be used to cancel a spot order by orderId.\nThis endpoint only sends cancellation requests. The results of the requests must be obtained by checking the order status or subscribing to websocket.\n:::", + "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"Spot\",\"api-rate-limit-pool\":\"Spot\",\"sdk-service\":\"Spot\",\"sdk-sub-service\":\"Order\",\"sdk-method-name\":\"cancelOrderByOrderId\",\"sdk-method-description\":\"This endpoint can be used to cancel a spot order by orderId. This endpoint only sends cancellation requests. The results of the requests must be obtained by checking the order status or subscribing to websocket.\",\"api-rate-limit\":1}" } }, { - "name": "Get Stop Orders List", + "name": "Cancel Order By OrderId Sync", "api": { - "id": "3470338", - "method": "get", - "path": "/api/v1/stop-order", + "id": "3470185", + "method": "delete", + "path": "/api/v1/hf/orders/sync/{orderId}", "parameters": { - "query": [], - "path": [], + "path": [ + { + "id": "orderId#0", + "name": "orderId", + "required": true, + "description": "The unique order id generated by the trading system", + "example": "671128ee365ccb0007534d45", + "type": "string" + } + ], + "query": [ + { + "id": "KXIxHhD4qw", + "name": "symbol", + "required": true, + "description": "symbol", + "example": "BTC-USDT", + "type": "string", + "schema": { + "type": "string", + "examples": [ + "BTC-USDT", + "ETH-USDT", + "KCS-USDT" + ] + } + } + ], "cookie": [], "header": [] }, "responses": [ { - "id": "10568", + "id": "10349", "code": 200, "name": "OK", "headers": [], @@ -14211,160 +13712,59 @@ "data": { "type": "object", "properties": { - "currentPage": { - "type": "integer", - "description": "current page id" + "orderId": { + "type": "string", + "description": "order id" }, - "pageSize": { - "type": "integer" + "originSize": { + "type": "string", + "description": "original order size" }, - "totalNum": { - "type": "integer", - "description": "the stop order count" + "dealSize": { + "type": "string", + "description": "deal size" }, - "totalPage": { - "type": "integer", - "description": "total page count of the list" + "remainSize": { + "type": "string", + "description": "remain size" }, - "items": { - "type": "array", - "items": { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "Order ID, the ID of an order." - }, - "symbol": { - "type": "string", - "description": "Symbol name" - }, - "userId": { - "type": "string", - "description": "User ID" - }, - "status": { - "type": "string", - "description": "Order status, include NEW, TRIGGERED" - }, - "type": { - "type": "string", - "description": "Order type,limit, market, limit_stop or market_stop" - }, - "side": { - "type": "string", - "description": "transaction direction,include buy and sell" - }, - "price": { - "type": "string", - "description": "order price" - }, - "size": { - "type": "string", - "description": "order quantity" - }, - "funds": { - "type": "string", - "description": "order funds" - }, - "stp": { - "type": "string" - }, - "timeInForce": { - "type": "string", - "description": "time InForce,include GTC,GTT,IOC,FOK" - }, - "cancelAfter": { - "type": "integer", - "description": "cancel orders after n seconds,requires timeInForce to be GTT" - }, - "postOnly": { - "type": "boolean", - "description": "postOnly" - }, - "hidden": { - "type": "boolean", - "description": "hidden order" - }, - "iceberg": { - "type": "boolean", - "description": "Iceberg order" - }, - "visibleSize": { - "type": "string", - "description": "displayed quantity for iceberg order" - }, - "channel": { - "type": "string", - "description": "order source" - }, - "clientOid": { - "type": "string", - "description": "user-entered order unique mark" - }, - "remark": { - "type": "string", - "description": "Remarks at stop order creation" - }, - "tags": { - "type": "string", - "description": "tag order source" - }, - "orderTime": { - "type": "integer", - "description": "Time of place a stop order, accurate to nanoseconds", - "format": "int64" - }, - "domainId": { - "type": "string", - "description": "domainId, e.g: kucoin" - }, - "tradeSource": { - "type": "string", - "description": "trade source: USER(Order by user), MARGIN_SYSTEM(Order by margin system)" - }, - "tradeType": { - "type": "string", - "description": "The type of trading : TRADE(Spot), MARGIN_TRADE (Cross Margin), MARGIN_ISOLATED_TRADE (Isolated Margin)." - }, - "feeCurrency": { - "type": "string", - "description": "The currency of the fee" - }, - "takerFeeRate": { - "type": "string", - "description": "Fee Rate of taker" - }, - "makerFeeRate": { - "type": "string", - "description": "Fee Rate of maker" - }, - "createdAt": { - "type": "integer", - "description": "order creation time", - "format": "int64" - }, - "stop": { - "type": "string", - "description": "Stop order type, include loss and entry" - }, - "stopTriggerTime": { - "type": "integer", - "description": "The trigger time of the stop order", - "format": "int64" - }, - "stopPrice": { - "type": "string", - "description": "stop price" - } + "canceledSize": { + "type": "string", + "description": "Cumulative canceled size" + }, + "status": { + "type": "string", + "description": "Order Status. open:order is active; done:order has been completed", + "enum": [ + "open", + "done" + ], + "x-api-enum": [ + { + "value": "open", + "name": "", + "description": "" + }, + { + "value": "done", + "name": "", + "description": "" } - }, - "description": "the list of stop orders" + ] } - } + }, + "required": [ + "orderId", + "dealSize", + "remainSize", + "canceledSize", + "status", + "originSize" + ] } }, "required": [ + "code", "data" ] }, @@ -14376,142 +13776,276 @@ "responseExamples": [ { "name": "Success", - "data": "{\n \"code\": \"200000\",\n \"data\": {\n \"currentPage\": 1,\n \"pageSize\": 50,\n \"totalNum\": 1,\n \"totalPage\": 1,\n \"items\": [\n {\n \"id\": \"vs8hoo8kqjnklv4m0038lrfq\",\n \"symbol\": \"KCS-USDT\",\n \"userId\": \"60fe4956c43cbc0006562c2c\",\n \"status\": \"NEW\",\n \"type\": \"limit\",\n \"side\": \"buy\",\n \"price\": \"0.01000000000000000000\",\n \"size\": \"0.01000000000000000000\",\n \"funds\": null,\n \"stp\": null,\n \"timeInForce\": \"GTC\",\n \"cancelAfter\": -1,\n \"postOnly\": false,\n \"hidden\": false,\n \"iceberg\": false,\n \"visibleSize\": null,\n \"channel\": \"API\",\n \"clientOid\": \"404814a0fb4311eb9098acde48001122\",\n \"remark\": null,\n \"tags\": null,\n \"orderTime\": 1628755183702150100,\n \"domainId\": \"kucoin\",\n \"tradeSource\": \"USER\",\n \"tradeType\": \"TRADE\",\n \"feeCurrency\": \"USDT\",\n \"takerFeeRate\": \"0.00200000000000000000\",\n \"makerFeeRate\": \"0.00200000000000000000\",\n \"createdAt\": 1628755183704,\n \"stop\": \"loss\",\n \"stopTriggerTime\": null,\n \"stopPrice\": \"10.00000000000000000000\"\n }\n ]\n }\n}", - "responseId": 10568, + "data": "{\n \"code\": \"200000\",\n \"data\": {\n \"orderId\": \"671128ee365ccb0007534d45\",\n \"originSize\": \"0.00001\",\n \"dealSize\": \"0\",\n \"remainSize\": \"0\",\n \"canceledSize\": \"0.00001\",\n \"status\": \"done\"\n }\n}", + "responseId": 10349, "ordering": 1 } ], "requestBody": { - "type": "application/json", + "type": "none", "parameters": [], "jsonSchema": { "type": "object", - "properties": { - "symbol": { - "type": "string", - "description": "Only list orders for a specific symbol" - }, - "side": { + "properties": {} + }, + "example": "{\n \"symbol\": \"BTC-USDT\",\n \"orderId\": \"670fd33bf9406e0007ab3945\",\n \"newPrice\": \"30000\",\n \"newSize\": \"0.0001\"\n}", + "mediaType": "" + }, + "description": ":::info[Description]\nThis endpoint can be used to cancel a spot order by orderId.\n\nThe difference between this interface and \"Cancel Order By OrderId\" is that this interface will synchronously return the order information after the order canceling is completed.\n\nFor higher latency requirements, please select the \"Cancel Order By OrderId\" interface. If there is a requirement for returning data integrity, please select this interface\n:::", + "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"Spot\",\"api-rate-limit-pool\":\"Spot\",\"sdk-service\":\"Spot\",\"sdk-sub-service\":\"Order\",\"sdk-method-name\":\"cancelOrderByOrderIdSync\",\"sdk-method-description\":\"This endpoint can be used to cancel a spot order by orderId.\",\"api-rate-limit\":1}" + } + }, + { + "name": "Cancel Order By ClientOid", + "api": { + "id": "3470184", + "method": "delete", + "path": "/api/v1/hf/orders/client-order/{clientOid}", + "parameters": { + "path": [ + { + "id": "clientOid#0", + "name": "clientOid", + "required": true, + "description": "Client Order Id,unique identifier created by the user", + "example": "5c52e11203aa677f33e493fb", + "type": "string" + } + ], + "query": [ + { + "id": "KXIxHhD4qw", + "name": "symbol", + "required": true, + "description": "symbol", + "example": "BTC-USDT", + "type": "string", + "schema": { "type": "string", - "enum": [ - "buy", - "sell" - ], - "description": "buy or sell", - "x-api-enum": [ - { - "value": "buy", - "name": "buy", - "description": "" - }, - { - "value": "sell", - "name": "sell", - "description": "" - } + "examples": [ + "BTC-USDT", + "ETH-USDT", + "KCS-USDT" ] - }, - "type": { - "type": "string", - "description": "limit, market, limit_stop or market_stop", - "enum": [ - "limit", - "market", - "limit_stop", - "market_stop" - ], - "x-api-enum": [ - { - "value": "limit", - "name": "limit", - "description": "" - }, - { - "value": "market", - "name": "market", - "description": "" - }, - { - "value": "limit_stop", - "name": "limit_stop", - "description": "" + } + } + ], + "cookie": [], + "header": [] + }, + "responses": [ + { + "id": "10348", + "code": 200, + "name": "OK", + "headers": [], + "jsonSchema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "object", + "properties": { + "clientOid": { + "type": "string", + "description": "Client Order Id,unique identifier created by the user" + } }, - { - "value": "market_stop", - "name": "market_stop", - "description": "" - } - ] + "required": [ + "clientOid" + ] + } }, - "tradeType": { + "required": [ + "code", + "data" + ] + }, + "description": "", + "contentType": "json", + "mediaType": "" + } + ], + "responseExamples": [ + { + "name": "Success", + "data": "{\"code\":\"200000\",\"data\":{\"clientOid\":\"5c52e11203aa677f33e493fb\"}}", + "responseId": 10348, + "ordering": 1 + } + ], + "requestBody": { + "type": "none", + "parameters": [], + "jsonSchema": { + "type": "object", + "properties": {} + }, + "example": "{\n \"symbol\": \"BTC-USDT\",\n \"orderId\": \"670fd33bf9406e0007ab3945\",\n \"newPrice\": \"30000\",\n \"newSize\": \"0.0001\"\n}", + "mediaType": "" + }, + "description": ":::info[Description]\nThis endpoint can be used to cancel a spot order by clientOid.\nThis endpoint only sends cancellation requests. The results of the requests must be obtained by checking the order status or subscribing to websocket.\n:::", + "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"Spot\",\"api-rate-limit-pool\":\"Spot\",\"sdk-service\":\"Spot\",\"sdk-sub-service\":\"Order\",\"sdk-method-name\":\"cancelOrderByClientOid\",\"sdk-method-description\":\"This endpoint can be used to cancel a spot order by clientOid. This endpoint only sends cancellation requests. The results of the requests must be obtained by checking the order status or subscribing to websocket.\",\"api-rate-limit\":1}" + } + }, + { + "name": "Cancel Order By ClientOid Sync", + "api": { + "id": "3470186", + "method": "delete", + "path": "/api/v1/hf/orders/sync/client-order/{clientOid}", + "parameters": { + "path": [ + { + "id": "clientOid#0", + "name": "clientOid", + "required": true, + "description": "Client Order Id,unique identifier created by the user", + "example": "5c52e11203aa677f33e493fb", + "type": "string" + } + ], + "query": [ + { + "id": "KXIxHhD4qw", + "name": "symbol", + "required": true, + "description": "symbol", + "example": "BTC-USDT", + "type": "string", + "schema": { "type": "string", - "description": "The type of trading : TRADE(Spot), MARGIN_TRADE (Cross Margin), MARGIN_ISOLATED_TRADE (Isolated Margin). Default is TRADE", - "enum": [ - "TRADE", - "MARGIN_TRADE", - "MARGIN_ISOLATED_TRADE" - ], - "x-api-enum": [ - { - "value": "TRADE", - "name": "TRADE", - "description": "" - }, - { - "value": "MARGIN_TRADE", - "name": "MARGIN_TRADE", - "description": "" + "examples": [ + "BTC-USDT", + "ETH-USDT", + "KCS-USDT" + ] + } + } + ], + "cookie": [], + "header": [] + }, + "responses": [ + { + "id": "10350", + "code": 200, + "name": "OK", + "headers": [], + "jsonSchema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "object", + "properties": { + "clientOid": { + "type": "string", + "description": "Client Order Id,unique identifier created by the user" + }, + "originSize": { + "type": "string", + "description": "original order size" + }, + "dealSize": { + "type": "string", + "description": "deal size" + }, + "remainSize": { + "type": "string", + "description": "remain size" + }, + "canceledSize": { + "type": "string", + "description": "Cumulative canceled size" + }, + "status": { + "type": "string", + "description": "Order Status. open:order is active; done:order has been completed", + "enum": [ + "open", + "done" + ], + "x-api-enum": [ + { + "value": "open", + "name": "", + "description": "" + }, + { + "value": "done", + "name": "", + "description": "" + } + ] + } }, - { - "value": "MARGIN_ISOLATED_TRADE", - "name": "MARGIN_ISOLATED_TRADE", - "description": "" - } - ] - }, - "startAt": { - "type": "number", - "description": "Start time (milisecond)" - }, - "endAt": { - "type": "number", - "description": "End time (milisecond)" - }, - "currentPage": { - "type": "integer", - "description": "current page" - }, - "orderIds": { - "type": "string", - "description": "comma seperated order ID list" - }, - "pageSize": { - "type": "integer", - "description": "page size" + "required": [ + "clientOid", + "originSize", + "dealSize", + "remainSize", + "canceledSize", + "status" + ] + } }, - "stop": { - "type": "string", - "description": "Order type: stop: stop loss order, oco: oco order" - } - } + "required": [ + "code", + "data" + ] + }, + "description": "", + "contentType": "json", + "mediaType": "" + } + ], + "responseExamples": [ + { + "name": "Success", + "data": "{\n \"code\": \"200000\",\n \"data\": {\n \"clientOid\": \"5c52e11203aa677f33e493fb\",\n \"originSize\": \"0.00001\",\n \"dealSize\": \"0\",\n \"remainSize\": \"0\",\n \"canceledSize\": \"0.00001\",\n \"status\": \"done\"\n }\n}", + "responseId": 10350, + "ordering": 1 + } + ], + "requestBody": { + "type": "none", + "parameters": [], + "jsonSchema": { + "type": "object", + "properties": {} }, "example": "{\n \"symbol\": \"BTC-USDT\",\n \"orderId\": \"670fd33bf9406e0007ab3945\",\n \"newPrice\": \"30000\",\n \"newSize\": \"0.0001\"\n}", "mediaType": "" }, - "description": ":::info[Description]\nRequest via this endpoint to get your current untriggered stop order list. Items are paginated and sorted to show the latest first. See the Pagination section for retrieving additional entries after the first page.\n\n:::\n\n\n:::tip[Example]\n```json\n{\n \"currentPage\": 1,\n \"pageSize\": 50,\n \"totalNum\": 1,\n \"totalPage\": 1,\n \"items\": [\n {\n \"id\": \"vs8hoo8kqjnklv4m0038lrfq\",\n \"symbol\": \"KCS-USDT\",\n \"userId\": \"60fe4956c43cbc0006562c2c\",\n \"status\": \"NEW\",\n \"type\": \"limit\",\n \"side\": \"buy\",\n \"price\": \"0.01000000000000000000\",\n \"size\": \"0.01000000000000000000\",\n \"funds\": null,\n \"stp\": null,\n \"timeInForce\": \"GTC\",\n \"cancelAfter\": -1,\n \"postOnly\": false,\n \"hidden\": false,\n \"iceberg\": false,\n \"visibleSize\": null,\n \"channel\": \"API\",\n \"clientOid\": \"404814a0fb4311eb9098acde48001122\",\n \"remark\": null,\n \"tags\": null,\n \"orderTime\": 1628755183702150167,\n \"domainId\": \"kucoin\",\n \"tradeSource\": \"USER\",\n \"tradeType\": \"TRADE\",\n \"feeCurrency\": \"USDT\",\n \"takerFeeRate\": \"0.00200000000000000000\",\n \"makerFeeRate\": \"0.00200000000000000000\",\n \"createdAt\": 1628755183704,\n \"stop\": \"loss\",\n \"stopTriggerTime\": null,\n \"stopPrice\": \"10.00000000000000000000\"\n }\n ]\n}\n```\n:::", - "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"General\",\"api-rate-limit-pool\":\"Spot\",\"sdk-service\":\"Spot\",\"sdk-sub-service\":\"Order\",\"sdk-method-name\":\"getStopOrdersList\",\"sdk-method-description\":\"This interface is to obtain all Spot active stop order lists\",\"api-rate-limit\":8}" + "description": ":::info[Description]\nThis endpoint can be used to cancel a spot order by clientOid.\n\nThe difference between this interface and \"Cancel Order By ClientOid\" is that this interface will synchronously return the order information after the order canceling is completed.\n\nFor higher latency requirements, please select the \"Cancel Order By ClientOid\" interface. If there is a requirement for returning data integrity, please select this interface\n:::", + "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"Spot\",\"api-rate-limit-pool\":\"Spot\",\"sdk-service\":\"Spot\",\"sdk-sub-service\":\"Order\",\"sdk-method-name\":\"cancelOrderByClientOidSync\",\"sdk-method-description\":\"This endpoint can be used to cancel a spot order by orderId.\",\"api-rate-limit\":1}" } }, { - "name": "Get Closed Orders", + "name": "Cancel Partial Order", "api": { - "id": "3470179", - "method": "get", - "path": "/api/v1/hf/orders/done", + "id": "3470183", + "method": "delete", + "path": "/api/v1/hf/orders/cancel/{orderId}", "parameters": { + "path": [ + { + "id": "orderId#0", + "name": "orderId", + "required": true, + "description": "The unique order id generated by the trading system", + "example": "6711f73c1ef16c000717bb31", + "type": "string" + } + ], "query": [ { - "id": "M9bgPS6vOj", + "id": "KXIxHhD4qw", "name": "symbol", "required": true, "description": "symbol", @@ -14524,414 +14058,47 @@ "ETH-USDT", "KCS-USDT" ] - }, - "enable": true - }, - { - "id": "sTtMCE9Jhf", - "name": "side", - "required": false, - "description": "specify if the order is to 'buy' or 'sell'", - "type": "string", - "schema": { - "type": "string", - "enum": [ - "buy", - "sell" - ], - "x-api-enum": [ - { - "value": "buy", - "name": "", - "description": "" - }, - { - "value": "sell", - "name": "", - "description": "" - } - ] - }, - "enable": true - }, - { - "id": "QaBSxyasEm", - "name": "type", - "required": false, - "description": "specify if the order is an 'limit' order or 'market' order. ", - "type": "string", - "schema": { - "type": "string", - "enum": [ - "limit", - "market" - ], - "x-api-enum": [ - { - "value": "limit", - "name": "", - "description": "" - }, - { - "value": "market", - "name": "", - "description": "" - } - ] - }, - "enable": true - }, - { - "id": "kkvuIGVxs6", - "name": "lastId", - "required": false, - "description": "The id of the last set of data from the previous batch of data. By default, the latest information is given.\nlastId is used to filter data and paginate. If lastId is not entered, the default is a maximum of 100 returned data items. The return results include lastId,which can be used as a query parameter to look up new data from the next page.", - "example": "254062248624417", - "type": "integer", - "schema": { - "type": "integer", - "format": "int64" - }, - "enable": true - }, - { - "id": "heQ8W6yKwm", - "name": "limit", - "required": false, - "description": "Default20,Max100", - "example": "20", - "type": "integer", - "schema": { - "type": "integer", - "default": 20, - "minimum": 1, - "maximum": 100 - }, - "enable": true - }, - { - "id": "Djtx6oC9gm", - "name": "startAt", - "required": false, - "description": "Start time (milisecond)", - "example": "1728663338000", - "type": "integer", - "schema": { - "type": "integer", - "format": "int64" - }, - "enable": true + } }, { - "id": "K9IMpKw8u2", - "name": "endAt", - "required": false, - "description": "End time (milisecond)", - "example": "1728692138000", - "type": "integer", - "schema": { - "type": "integer", - "format": "int64" - }, - "enable": true + "id": "QDkiklGpjc", + "name": "cancelSize", + "required": true, + "description": "The size you want cancel", + "example": "0.00001", + "type": "string" } ], - "path": [], "cookie": [], "header": [] }, "responses": [ { - "id": "10343", - "code": 200, - "name": "OK", - "headers": [], - "jsonSchema": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "data": { - "type": "object", - "properties": { - "lastId": { - "type": "integer", - "description": "The id of the last set of data from the previous batch of data. By default, the latest information is given.\nlastId is used to filter data and paginate. If lastId is not entered, the default is a maximum of 100 returned data items. The return results include lastId,which can be used as a query parameter to look up new data from the next page.", - "format": "int64" - }, - "items": { - "type": "array", - "items": { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "The unique order id generated by the trading system" - }, - "symbol": { - "type": "string", - "description": "symbol", - "examples": [ - "BTC-USDT", - "ETH-USDT", - "KCS-USDT" - ] - }, - "opType": { - "type": "string" - }, - "type": { - "type": "string", - "description": "Specify if the order is an 'limit' order or 'market' order. ", - "enum": [ - "limit", - "market" - ], - "x-api-enum": [ - { - "value": "limit", - "name": "", - "description": "" - }, - { - "value": "market", - "name": "", - "description": "" - } - ] - }, - "side": { - "type": "string", - "description": "Buy or sell", - "enum": [ - "buy", - "sell" - ], - "x-api-enum": [ - { - "value": "buy", - "name": "", - "description": "" - }, - { - "value": "sell", - "name": "", - "description": "" - } - ] - }, - "price": { - "type": "string", - "description": "Order price" - }, - "size": { - "type": "string", - "description": "Order size" - }, - "funds": { - "type": "string", - "description": "Order Funds" - }, - "dealSize": { - "type": "string", - "description": "Number of filled transactions" - }, - "dealFunds": { - "type": "string", - "description": "Funds of filled transactions" - }, - "fee": { - "type": "string", - "description": "[Handling fees](apidog://link/pages/5327739)" - }, - "feeCurrency": { - "type": "string", - "description": "currency used to calculate trading fee" - }, - "stp": { - "type": "string", - "description": "[Self Trade Prevention](apidog://link/pages/5176570)", - "enum": [ - "DC", - "CO", - "CN", - "CB" - ], - "x-api-enum": [ - { - "value": "DC", - "name": "", - "description": "" - }, - { - "value": "CO", - "name": "", - "description": "" - }, - { - "value": "CN", - "name": "", - "description": "" - }, - { - "value": "CB", - "name": "", - "description": "" - } - ] - }, - "timeInForce": { - "type": "string", - "description": "Time in force", - "enum": [ - "GTC", - "GTT", - "IOC", - "FOK" - ], - "x-api-enum": [ - { - "value": "GTC", - "name": "", - "description": "" - }, - { - "value": "GTT", - "name": "", - "description": "" - }, - { - "value": "IOC", - "name": "", - "description": "" - }, - { - "value": "FOK", - "name": "", - "description": "" - } - ] - }, - "postOnly": { - "type": "boolean", - "description": "Whether its a postOnly order." - }, - "hidden": { - "type": "boolean", - "description": "Whether its a hidden order." - }, - "iceberg": { - "type": "boolean", - "description": "Whether its a iceberg order." - }, - "visibleSize": { - "type": "string", - "description": "Visible size of iceberg order in order book." - }, - "cancelAfter": { - "type": "integer", - "description": "A GTT timeInForce that expires in n seconds" - }, - "channel": { - "type": "string" - }, - "clientOid": { - "type": "string", - "description": "Client Order Id,unique identifier created by the user" - }, - "remark": { - "type": "string", - "description": "Order placement remarks" - }, - "tags": { - "type": "string", - "description": "Order tag" - }, - "cancelExist": { - "type": "boolean", - "description": "Whether there is a cancellation record for the order." - }, - "createdAt": { - "type": "integer", - "format": "int64" - }, - "lastUpdatedAt": { - "type": "integer", - "format": "int64" - }, - "tradeType": { - "type": "string", - "description": "Trade type, redundancy param" - }, - "inOrderBook": { - "type": "boolean", - "description": "Whether to enter the orderbook: true: enter the orderbook; false: not enter the orderbook" - }, - "cancelledSize": { - "type": "string", - "description": "Number of canceled transactions" - }, - "cancelledFunds": { - "type": "string", - "description": "Funds of canceled transactions" - }, - "remainSize": { - "type": "string", - "description": "Number of remain transactions" - }, - "remainFunds": { - "type": "string", - "description": "Funds of remain transactions" - }, - "tax": { - "type": "string", - "description": "Users in some regions need query this field" - }, - "active": { - "type": "boolean", - "description": "Order status: true-The status of the order isactive; false-The status of the order is done" - } - }, - "required": [ - "feeCurrency", - "id", - "symbol", - "opType", - "type", - "side", - "price", - "size", - "funds", - "dealSize", - "fee", - "timeInForce", - "dealFunds", - "clientOid", - "remainSize", - "remainFunds", - "cancelledSize", - "cancelledFunds", - "lastUpdatedAt", - "createdAt", - "tax", - "active", - "cancelExist", - "tradeType", - "inOrderBook", - "postOnly", - "hidden", - "iceberg", - "visibleSize", - "cancelAfter", - "channel" - ] - } + "id": "10347", + "code": 200, + "name": "OK", + "headers": [], + "jsonSchema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "object", + "properties": { + "orderId": { + "type": "string", + "description": "order id" + }, + "cancelSize": { + "type": "string", + "description": "The size you canceled" } }, "required": [ - "lastId", - "items" + "orderId", + "cancelSize" ] } }, @@ -14948,8 +14115,8 @@ "responseExamples": [ { "name": "Success", - "data": "{\n \"code\": \"200000\",\n \"data\": {\n \"lastId\": 19814995255305,\n \"items\": [\n {\n \"id\": \"6717422bd51c29000775ea03\",\n \"clientOid\": \"5c52e11203aa677f33e493fb\",\n \"symbol\": \"BTC-USDT\",\n \"opType\": \"DEAL\",\n \"type\": \"limit\",\n \"side\": \"buy\",\n \"price\": \"70000\",\n \"size\": \"0.00001\",\n \"funds\": \"0.7\",\n \"dealSize\": \"0.00001\",\n \"dealFunds\": \"0.677176\",\n \"remainSize\": \"0\",\n \"remainFunds\": \"0.022824\",\n \"cancelledSize\": \"0\",\n \"cancelledFunds\": \"0\",\n \"fee\": \"0.000677176\",\n \"feeCurrency\": \"USDT\",\n \"stp\": null,\n \"timeInForce\": \"GTC\",\n \"postOnly\": false,\n \"hidden\": false,\n \"iceberg\": false,\n \"visibleSize\": \"0\",\n \"cancelAfter\": 0,\n \"channel\": \"API\",\n \"remark\": \"order remarks\",\n \"tags\": null,\n \"cancelExist\": false,\n \"tradeType\": \"TRADE\",\n \"inOrderBook\": false,\n \"active\": false,\n \"tax\": \"0\",\n \"createdAt\": 1729577515444,\n \"lastUpdatedAt\": 1729577515481\n }\n ]\n }\n}", - "responseId": 10343, + "data": "{\n \"code\": \"200000\",\n \"data\": {\n \"orderId\": \"6711f73c1ef16c000717bb31\",\n \"cancelSize\": \"0.00001\"\n }\n}", + "responseId": 10347, "ordering": 1 } ], @@ -14963,26 +14130,34 @@ "example": "{\n \"symbol\": \"BTC-USDT\",\n \"orderId\": \"670fd33bf9406e0007ab3945\",\n \"newPrice\": \"30000\",\n \"newSize\": \"0.0001\"\n}", "mediaType": "" }, - "description": ":::info[Description]\nThis interface is to obtain all Spot Closed order lists, and the return value of the active order interface is the paged data of all uncompleted order lists. The returned data is sorted in descending order according to the latest update time of the order.\n\nAfter the user successfully places an order, the order is in Active state, and the user can use inOrderBook to determine whether the order has entered the order. Canceled or fully filled orders are marked as completed Done status.\n:::\n\n:::tip[Tips]\nIf the order is not an active order, you can only get data within the time range of 3 _ 24 hours (ie: from the current time to 3 _ 24 hours ago). If the time range is exceeded, the system will query the data within the time range of 3 * 24 hours by default.\n:::", - "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"General\",\"api-rate-limit-pool\":\"Spot\",\"sdk-service\":\"Spot\",\"sdk-sub-service\":\"Order\",\"sdk-method-name\":\"getClosedOrders\",\"sdk-method-description\":\"This interface is to obtain all Spot closed order lists, and the return value of the active order interface is the paged data of all uncompleted order lists. The returned data is sorted in descending order according to the latest update time of the order. After the user successfully places an order, the order is in Active state, and the user can use inOrderBook to determine whether the order has entered the order. Canceled or fully filled orders are marked as completed Done status.\",\"api-rate-limit\":2}" + "description": ":::info[Description]\nThis interface can cancel the specified quantity of the order according to the orderId.\nThe order execution order is: price first, time first, this interface will not change the queue order\n:::", + "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"Spot\",\"api-rate-limit-pool\":\"Spot\",\"sdk-service\":\"Spot\",\"sdk-sub-service\":\"Order\",\"sdk-method-name\":\"cancelPartialOrder\",\"sdk-method-description\":\"This interface can cancel the specified quantity of the order according to the orderId. The order execution order is: price first, time first, this interface will not change the queue order\",\"api-rate-limit\":2}" } }, { - "name": "Get Stop Order By OrderId", + "name": "Cancel All Orders By Symbol", "api": { - "id": "3470339", - "method": "get", - "path": "/api/v1/stop-order/{orderId}", + "id": "3470175", + "method": "delete", + "path": "/api/v1/hf/orders", "parameters": { - "query": [], - "path": [ + "path": [], + "query": [ { - "id": "orderId#0", - "name": "orderId", + "id": "KXIxHhD4qw", + "name": "symbol", "required": true, - "description": "The order id", + "description": "symbol", + "example": "BTC-USDT", "type": "string", - "enable": true + "schema": { + "type": "string", + "examples": [ + "BTC-USDT", + "ETH-USDT", + "KCS-USDT" + ] + } } ], "cookie": [], @@ -14990,154 +14165,23 @@ }, "responses": [ { - "id": "10569", + "id": "10339", "code": 200, "name": "OK", "headers": [], "jsonSchema": { "type": "object", "properties": { - "data": { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "Order ID, the ID of an order." - }, - "symbol": { - "type": "string", - "description": "Symbol name" - }, - "userId": { - "type": "string", - "description": "User ID" - }, - "status": { - "type": "string", - "description": "Order status, include NEW, TRIGGERED" - }, - "type": { - "type": "string", - "description": "Order type,limit, market, limit_stop or market_stop" - }, - "side": { - "type": "string", - "description": "transaction direction,include buy and sell" - }, - "price": { - "type": "string", - "description": "order price" - }, - "size": { - "type": "string", - "description": "order quantity" - }, - "funds": { - "type": "string", - "description": "order funds" - }, - "stp": { - "type": "string" - }, - "timeInForce": { - "type": "string", - "description": "time InForce,include GTC,GTT,IOC,FOK" - }, - "cancelAfter": { - "type": "integer", - "description": "cancel orders after n seconds,requires timeInForce to be GTT", - "format": "int64" - }, - "postOnly": { - "type": "boolean", - "description": "postOnly" - }, - "hidden": { - "type": "boolean", - "description": "hidden order" - }, - "iceberg": { - "type": "boolean", - "description": "Iceberg order" - }, - "visibleSize": { - "type": "string", - "description": "displayed quantity for iceberg order" - }, - "channel": { - "type": "string", - "description": "order source" - }, - "clientOid": { - "type": "string", - "description": "user-entered order unique mark" - }, - "remark": { - "type": "string", - "description": "Remarks at stop order creation" - }, - "tags": { - "type": "string", - "description": "tag order source" - }, - "domainId": { - "type": "string", - "description": "domainId, e.g: kucoin" - }, - "tradeSource": { - "type": "string", - "description": "trade source: USER(Order by user), MARGIN_SYSTEM(Order by margin system)" - }, - "tradeType": { - "type": "string", - "description": "The type of trading : TRADE(Spot), MARGIN_TRADE (Cross Margin), MARGIN_ISOLATED_TRADE (Isolated Margin)." - }, - "feeCurrency": { - "type": "string", - "description": "The currency of the fee" - }, - "takerFeeRate": { - "type": "string", - "description": "Fee Rate of taker" - }, - "makerFeeRate": { - "type": "string", - "description": "Fee Rate of maker" - }, - "createdAt": { - "type": "integer", - "description": "order creation time", - "format": "int64" - }, - "stop": { - "type": "string", - "description": "Stop order type, include loss and entry" - }, - "stopTriggerTime": { - "type": "integer", - "description": "The trigger time of the stop order", - "format": "int64" - }, - "stopPrice": { - "type": "string", - "description": "stop price" - }, - "orderTime": { - "type": "integer", - "description": "Time of place a stop order, accurate to nanoseconds", - "format": "int64" - } - }, - "description": "the details" - }, "code": { - "type": "string", - "description": "return status code" + "type": "string" + }, + "data": { + "type": "string" } }, "required": [ - "data", - "code" + "code", + "data" ] }, "description": "", @@ -15148,8 +14192,8 @@ "responseExamples": [ { "name": "Success", - "data": "{\n \"code\": \"200000\",\n \"data\": {\n \"id\": \"vs8hoo8q2ceshiue003b67c0\",\n \"symbol\": \"KCS-USDT\",\n \"userId\": \"60fe4956c43cbc0006562c2c\",\n \"status\": \"NEW\",\n \"type\": \"limit\",\n \"side\": \"buy\",\n \"price\": \"0.01000000000000000000\",\n \"size\": \"0.01000000000000000000\",\n \"funds\": null,\n \"stp\": null,\n \"timeInForce\": \"GTC\",\n \"cancelAfter\": -1,\n \"postOnly\": false,\n \"hidden\": false,\n \"iceberg\": false,\n \"visibleSize\": null,\n \"channel\": \"API\",\n \"clientOid\": \"40e0eb9efe6311eb8e58acde48001122\",\n \"remark\": null,\n \"tags\": null,\n \"orderTime\": 1629098781127530200,\n \"domainId\": \"kucoin\",\n \"tradeSource\": \"USER\",\n \"tradeType\": \"TRADE\",\n \"feeCurrency\": \"USDT\",\n \"takerFeeRate\": \"0.00200000000000000000\",\n \"makerFeeRate\": \"0.00200000000000000000\",\n \"createdAt\": 1629098781128,\n \"stop\": \"loss\",\n \"stopTriggerTime\": null,\n \"stopPrice\": \"10.00000000000000000000\"\n }\n}", - "responseId": 10569, + "data": "{\"code\":\"200000\",\"data\":\"success\"}", + "responseId": 10339, "ordering": 1 } ], @@ -15158,154 +14202,30 @@ "parameters": [], "jsonSchema": { "type": "object", - "properties": { - "symbol": { - "type": "string", - "description": "Only list orders for a specific symbol" - }, - "side": { - "type": "string", - "enum": [ - "buy", - "sell" - ], - "description": "buy or sell", - "x-api-enum": [ - { - "value": "buy", - "name": "buy", - "description": "" - }, - { - "value": "sell", - "name": "sell", - "description": "" - } - ] - }, - "type": { - "type": "string", - "description": "limit, market, limit_stop or market_stop", - "enum": [ - "limit", - "market", - "limit_stop", - "market_stop" - ], - "x-api-enum": [ - { - "value": "limit", - "name": "limit", - "description": "" - }, - { - "value": "market", - "name": "market", - "description": "" - }, - { - "value": "limit_stop", - "name": "limit_stop", - "description": "" - }, - { - "value": "market_stop", - "name": "market_stop", - "description": "" - } - ] - }, - "tradeType": { - "type": "string", - "description": "The type of trading : TRADE(Spot), MARGIN_TRADE (Cross Margin), MARGIN_ISOLATED_TRADE (Isolated Margin). Default is TRADE", - "enum": [ - "TRADE", - "MARGIN_TRADE", - "MARGIN_ISOLATED_TRADE" - ], - "x-api-enum": [ - { - "value": "TRADE", - "name": "TRADE", - "description": "" - }, - { - "value": "MARGIN_TRADE", - "name": "MARGIN_TRADE", - "description": "" - }, - { - "value": "MARGIN_ISOLATED_TRADE", - "name": "MARGIN_ISOLATED_TRADE", - "description": "" - } - ] - }, - "startAt": { - "type": "number", - "description": "Start time (milisecond)" - }, - "endAt": { - "type": "number", - "description": "End time (milisecond)" - }, - "currentPage": { - "type": "integer", - "description": "current page" - }, - "orderIds": { - "type": "string", - "description": "comma seperated order ID list" - }, - "pageSize": { - "type": "integer", - "description": "page size" - }, - "stop": { - "type": "string", - "description": "Order type: stop: stop loss order, oco: oco order" - } - } + "properties": {} }, "example": "{\n \"symbol\": \"BTC-USDT\",\n \"orderId\": \"670fd33bf9406e0007ab3945\",\n \"newPrice\": \"30000\",\n \"newSize\": \"0.0001\"\n}", "mediaType": "" }, - "description": ":::info[Description]\nRequest via this interface to get a stop order information via the order ID.\n\n:::\n\n\n:::tip[Example]\n```json\n{\n \"id\": \"vs8hoo8q2ceshiue003b67c0\",\n \"symbol\": \"KCS-USDT\",\n \"userId\": \"60fe4956c43cbc0006562c2c\",\n \"status\": \"NEW\",\n \"type\": \"limit\",\n \"side\": \"buy\",\n \"price\": \"0.01000000000000000000\",\n \"size\": \"0.01000000000000000000\",\n \"funds\": null,\n \"stp\": null,\n \"timeInForce\": \"GTC\",\n \"cancelAfter\": -1,\n \"postOnly\": false,\n \"hidden\": false,\n \"iceberg\": false,\n \"visibleSize\": null,\n \"channel\": \"API\",\n \"clientOid\": \"40e0eb9efe6311eb8e58acde48001122\",\n \"remark\": null,\n \"tags\": null,\n \"orderTime\": 1629098781127530345,\n \"domainId\": \"kucoin\",\n \"tradeSource\": \"USER\",\n \"tradeType\": \"TRADE\",\n \"feeCurrency\": \"USDT\",\n \"takerFeeRate\": \"0.00200000000000000000\",\n \"makerFeeRate\": \"0.00200000000000000000\",\n \"createdAt\": 1629098781128,\n \"stop\": \"loss\",\n \"stopTriggerTime\": null,\n \"stopPrice\": \"10.00000000000000000000\"\n}\n```\n:::", - "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"General\",\"api-rate-limit-pool\":\"Spot\",\"sdk-service\":\"Spot\",\"sdk-sub-service\":\"Order\",\"sdk-method-name\":\"getStopOrderByOrderId\",\"sdk-method-description\":\"This interface is to obtain Spot stop order details by orderId\",\"api-rate-limit\":3}" + "description": ":::info[Description]\nThis endpoint can cancel all spot orders for specific symbol.\nThis endpoint only sends cancellation requests. The results of the requests must be obtained by checking the order status or subscribing to websocket.\n:::", + "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"Spot\",\"api-rate-limit-pool\":\"Spot\",\"sdk-service\":\"Spot\",\"sdk-sub-service\":\"Order\",\"sdk-method-name\":\"cancelAllOrdersBySymbol\",\"sdk-method-description\":\"This endpoint can cancel all spot orders for specific symbol. This endpoint only sends cancellation requests. The results of the requests must be obtained by checking the order status or subscribing to websocket.\",\"api-rate-limit\":2}" } }, { - "name": "Get Stop Order By ClientOid", + "name": "Cancel All Orders", "api": { - "id": "3470340", - "method": "get", - "path": "/api/v1/stop-order/queryOrderByClientOid", + "id": "3470176", + "method": "delete", + "path": "/api/v1/hf/orders/cancelAll", "parameters": { - "query": [ - { - "required": true, - "description": "The client order id", - "type": "string", - "id": "hV69UNFPAV", - "enable": true, - "name": "clientOid" - }, - { - "required": false, - "description": "symbol name", - "type": "string", - "id": "gbNm67rykJ", - "enable": true, - "name": "symbol" - } - ], "path": [], + "query": [], "cookie": [], "header": [] }, "responses": [ { - "id": "10570", + "id": "10340", "code": 200, "name": "OK", "headers": [], @@ -15313,144 +14233,45 @@ "type": "object", "properties": { "code": { - "type": "string", - "description": "the return code" + "type": "string" }, "data": { - "type": "array", - "items": { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "Order ID, the ID of an order." - }, - "symbol": { - "type": "string", - "description": "Symbol name" - }, - "userId": { - "type": "string", - "description": "User ID" - }, - "status": { - "type": "string", - "description": "Order status, include NEW, TRIGGERED" - }, - "type": { - "type": "string", - "description": "Order type,limit, market, limit_stop or market_stop" - }, - "side": { - "type": "string", - "description": "transaction direction,include buy and sell" - }, - "price": { - "type": "string", - "description": "order price" - }, - "size": { - "type": "string", - "description": "order quantity" - }, - "funds": { - "type": "string", - "description": "order funds" - }, - "stp": { + "type": "object", + "properties": { + "succeedSymbols": { + "type": "array", + "items": { "type": "string" }, - "timeInForce": { - "type": "string", - "description": "time InForce,include GTC,GTT,IOC,FOK" - }, - "cancelAfter": { - "type": "integer", - "description": "cancel orders after n seconds,requires timeInForce to be GTT", - "format": "int64" - }, - "postOnly": { - "type": "boolean", - "description": "postOnly" - }, - "hidden": { - "type": "boolean", - "description": "hidden order" - }, - "iceberg": { - "type": "boolean", - "description": "Iceberg order" - }, - "visibleSize": { - "type": "string", - "description": "displayed quantity for iceberg order" - }, - "channel": { - "type": "string", - "description": "order source" - }, - "clientOid": { - "type": "string", - "description": "user-entered order unique mark" - }, - "remark": { - "type": "string", - "description": "Remarks at stop order creation" - }, - "tags": { - "type": "string", - "description": "tag order source" - }, - "domainId": { - "type": "string", - "description": "domainId, e.g: kucoin" - }, - "tradeSource": { - "type": "string", - "description": "trade source: USER(Order by user), MARGIN_SYSTEM(Order by margin system)" - }, - "tradeType": { - "type": "string", - "description": "The type of trading : TRADE(Spot), MARGIN_TRADE (Cross Margin), MARGIN_ISOLATED_TRADE (Isolated Margin)." - }, - "feeCurrency": { - "type": "string", - "description": "The currency of the fee" - }, - "takerFeeRate": { - "type": "string", - "description": "Fee Rate of taker" - }, - "makerFeeRate": { - "type": "string", - "description": "Fee Rate of maker" - }, - "createdAt": { - "type": "integer", - "description": "order creation time", - "format": "int64" - }, - "stop": { - "type": "string", - "description": "Stop order type, include loss and entry" - }, - "stopTriggerTime": { - "type": "integer", - "description": "The trigger time of the stop order", - "format": "int64" - }, - "stopPrice": { - "type": "string", - "description": "stop price" + "description": "The Symbols Successfully cancelled" + }, + "failedSymbols": { + "type": "array", + "items": { + "type": "object", + "properties": { + "symbol": { + "type": "string", + "description": "symbol", + "examples": [ + "BTC-USDT", + "ETH-USDT", + "KCS-USDT" + ] + }, + "error": { + "type": "string", + "description": "error message" + } + } }, - "orderTime": { - "type": "integer", - "description": "Time of place a stop order, accurate to nanoseconds", - "format": "int64" - } + "description": "The Symbols Failed to cancel" } }, - "description": "the return code" + "required": [ + "succeedSymbols", + "failedSymbols" + ] } }, "required": [ @@ -15466,8 +14287,8 @@ "responseExamples": [ { "name": "Success", - "data": "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"id\": \"vs8hoo8os561f5np0032vngj\",\n \"symbol\": \"KCS-USDT\",\n \"userId\": \"60fe4956c43cbc0006562c2c\",\n \"status\": \"NEW\",\n \"type\": \"limit\",\n \"side\": \"buy\",\n \"price\": \"0.01000000000000000000\",\n \"size\": \"0.01000000000000000000\",\n \"funds\": null,\n \"stp\": null,\n \"timeInForce\": \"GTC\",\n \"cancelAfter\": -1,\n \"postOnly\": false,\n \"hidden\": false,\n \"iceberg\": false,\n \"visibleSize\": null,\n \"channel\": \"API\",\n \"clientOid\": \"2b700942b5db41cebe578cff48960e09\",\n \"remark\": null,\n \"tags\": null,\n \"orderTime\": 1629020492834532600,\n \"domainId\": \"kucoin\",\n \"tradeSource\": \"USER\",\n \"tradeType\": \"TRADE\",\n \"feeCurrency\": \"USDT\",\n \"takerFeeRate\": \"0.00200000000000000000\",\n \"makerFeeRate\": \"0.00200000000000000000\",\n \"createdAt\": 1629020492837,\n \"stop\": \"loss\",\n \"stopTriggerTime\": null,\n \"stopPrice\": \"1.00000000000000000000\"\n }\n ]\n}", - "responseId": 10570, + "data": "{\n \"code\": \"200000\",\n \"data\": {\n \"succeedSymbols\": [\n \"ETH-USDT\",\n \"BTC-USDT\"\n ],\n \"failedSymbols\": []\n }\n}", + "responseId": 10340, "ordering": 1 } ], @@ -15476,164 +14297,30 @@ "parameters": [], "jsonSchema": { "type": "object", - "properties": { - "symbol": { - "type": "string", - "description": "Only list orders for a specific symbol" - }, - "side": { - "type": "string", - "enum": [ - "buy", - "sell" - ], - "description": "buy or sell", - "x-api-enum": [ - { - "value": "buy", - "name": "buy", - "description": "" - }, - { - "value": "sell", - "name": "sell", - "description": "" - } - ] - }, - "type": { - "type": "string", - "description": "limit, market, limit_stop or market_stop", - "enum": [ - "limit", - "market", - "limit_stop", - "market_stop" - ], - "x-api-enum": [ - { - "value": "limit", - "name": "limit", - "description": "" - }, - { - "value": "market", - "name": "market", - "description": "" - }, - { - "value": "limit_stop", - "name": "limit_stop", - "description": "" - }, - { - "value": "market_stop", - "name": "market_stop", - "description": "" - } - ] - }, - "tradeType": { - "type": "string", - "description": "The type of trading : TRADE(Spot), MARGIN_TRADE (Cross Margin), MARGIN_ISOLATED_TRADE (Isolated Margin). Default is TRADE", - "enum": [ - "TRADE", - "MARGIN_TRADE", - "MARGIN_ISOLATED_TRADE" - ], - "x-api-enum": [ - { - "value": "TRADE", - "name": "TRADE", - "description": "" - }, - { - "value": "MARGIN_TRADE", - "name": "MARGIN_TRADE", - "description": "" - }, - { - "value": "MARGIN_ISOLATED_TRADE", - "name": "MARGIN_ISOLATED_TRADE", - "description": "" - } - ] - }, - "startAt": { - "type": "integer", - "description": "Start time (milisecond)", - "format": "int64" - }, - "endAt": { - "type": "integer", - "description": "End time (milisecond)", - "format": "int64" - }, - "currentPage": { - "type": "integer", - "description": "current page" - }, - "orderIds": { - "type": "string", - "description": "comma seperated order ID list" - }, - "pageSize": { - "type": "integer", - "description": "page size" - }, - "stop": { - "type": "string", - "description": "Order type: stop: stop loss order, oco: oco order" - } - } + "properties": {} }, "example": "{\n \"symbol\": \"BTC-USDT\",\n \"orderId\": \"670fd33bf9406e0007ab3945\",\n \"newPrice\": \"30000\",\n \"newSize\": \"0.0001\"\n}", "mediaType": "" }, - "description": ":::info[Description]\nRequest via this interface to get a stop order information via the clientOid.\n\n:::\n\n\n:::tip[Example]\n```json\n{\n \"id\": \"vs8hoo8q2ceshiue003b67c0\",\n \"symbol\": \"KCS-USDT\",\n \"userId\": \"60fe4956c43cbc0006562c2c\",\n \"status\": \"NEW\",\n \"type\": \"limit\",\n \"side\": \"buy\",\n \"price\": \"0.01000000000000000000\",\n \"size\": \"0.01000000000000000000\",\n \"funds\": null,\n \"stp\": null,\n \"timeInForce\": \"GTC\",\n \"cancelAfter\": -1,\n \"postOnly\": false,\n \"hidden\": false,\n \"iceberg\": false,\n \"visibleSize\": null,\n \"channel\": \"API\",\n \"clientOid\": \"40e0eb9efe6311eb8e58acde48001122\",\n \"remark\": null,\n \"tags\": null,\n \"orderTime\": 1629098781127530345,\n \"domainId\": \"kucoin\",\n \"tradeSource\": \"USER\",\n \"tradeType\": \"TRADE\",\n \"feeCurrency\": \"USDT\",\n \"takerFeeRate\": \"0.00200000000000000000\",\n \"makerFeeRate\": \"0.00200000000000000000\",\n \"createdAt\": 1629098781128,\n \"stop\": \"loss\",\n \"stopTriggerTime\": null,\n \"stopPrice\": \"10.00000000000000000000\"\n}\n```\n:::", - "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"General\",\"api-rate-limit-pool\":\"Spot\",\"sdk-service\":\"Spot\",\"sdk-sub-service\":\"Order\",\"sdk-method-name\":\"getStopOrderByClientOid\",\"sdk-method-description\":\"This interface is to obtain Spot stop order details by orderId\",\"api-rate-limit\":3}" + "description": ":::info[Description]\nThis endpoint can cancel all spot orders for all symbol.\nThis endpoint only sends cancellation requests. The results of the requests must be obtained by checking the order status or subscribing to websocket.\n:::", + "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"Spot\",\"api-rate-limit-pool\":\"Spot\",\"sdk-service\":\"Spot\",\"sdk-sub-service\":\"Order\",\"sdk-method-name\":\"cancelAllOrders\",\"sdk-method-description\":\"This endpoint can cancel all spot orders for all symbol. This endpoint only sends cancellation requests. The results of the requests must be obtained by checking the order status or subscribing to websocket.\",\"api-rate-limit\":30}" } }, { - "name": "Batch Cancel Stop Orders", + "name": "Modify Order", "api": { - "id": "3470337", - "method": "delete", - "path": "/api/v1/stop-order/cancel", + "id": "3470171", + "method": "post", + "path": "/api/v1/hf/orders/alter", "parameters": { - "query": [ - { - "required": false, - "description": "Cancel the open order for the specified symbol", - "type": "string", - "id": "3XtxdL10NG", - "enable": true, - "name": "symbol" - }, - { - "required": false, - "description": "The type of trading : TRADE(Spot), MARGIN_TRADE (Cross Margin), MARGIN_ISOLATED_TRADE (Isolated Margin). Default is TRADE", - "type": "string", - "id": "WL2a8vOzaG", - "enable": true, - "name": "tradeType" - }, - { - "required": false, - "description": "Comma seperated order IDs.", - "type": "string", - "id": "jVrbtXmTbt", - "enable": true, - "name": "orderIds" - } - ], + "query": [], "path": [], "cookie": [], "header": [] }, "responses": [ { - "id": "10652", + "id": "10335", "code": 200, "name": "OK", "headers": [], @@ -15646,16 +14333,18 @@ "data": { "type": "object", "properties": { - "cancelledOrderIds": { - "type": "array", - "items": { - "type": "string" - }, - "description": "order id array" + "newOrderId": { + "type": "string", + "description": "The new order id" + }, + "clientOid": { + "type": "string", + "description": "The original client order id" } }, "required": [ - "cancelledOrderIds" + "newOrderId", + "clientOid" ] } }, @@ -15672,59 +14361,100 @@ "responseExamples": [ { "name": "Success", - "data": "{\n \"code\": \"200000\",\n \"data\": {\n \"cancelledOrderIds\": [\n \"671124f9365ccb00073debd4\"\n ]\n }\n}", - "responseId": 10652, + "data": "{\"code\":\"200000\",\"data\":{\"newOrderId\":\"67112258f9406e0007408827\",\"clientOid\":\"client order id 12\"}}", + "responseId": 10335, "ordering": 1 } ], "requestBody": { - "type": "none", + "type": "application/json", "parameters": [], "jsonSchema": { "type": "object", - "properties": {} + "properties": { + "clientOid": { + "type": "string", + "description": "The old client order id,orderId and clientOid must choose one", + "examples": [ + "5c52e11203aa677f33e493fb" + ] + }, + "symbol": { + "type": "string", + "description": "symbol", + "examples": [ + "BTC-USDT", + "ETH-USDT", + "KCS-USDT" + ] + }, + "orderId": { + "type": "string", + "description": "The old order id, orderId and clientOid must choose one" + }, + "newPrice": { + "type": "string", + "description": "The modified price of the new order, newPrice and newSize must choose one" + }, + "newSize": { + "type": "string", + "description": "The modified size of the new order, newPrice and newSize must choose one" + } + }, + "required": [ + "symbol" + ] }, "example": "{\n \"symbol\": \"BTC-USDT\",\n \"orderId\": \"670fd33bf9406e0007ab3945\",\n \"newPrice\": \"30000\",\n \"newSize\": \"0.0001\"\n}", "mediaType": "" }, - "description": ":::info[Description]\nRequest via this interface to cancel a batch of stop orders.\n\nThe count of orderId in the parameter now is not limited.\n\nAn example is:\n ```/api/v1/stop-order/cancel?symbol=ETH-BTC&tradeType=TRADE&orderIds=5bd6e9286d99522a52e458de,5bd6e9286d99522a52e458df```\n:::", - "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"Spot\",\"api-rate-limit-pool\":\"Spot\",\"sdk-service\":\"Spot\",\"sdk-sub-service\":\"Order\",\"sdk-method-name\":\"batchCancelStopOrder\",\"sdk-method-description\":\"This endpoint can be used to cancel a spot stop orders by batch.\",\"api-rate-limit\":3}" + "description": ":::info[Description]\nThis interface can modify the price and quantity of the order according to orderId or clientOid.\n\nThe implementation of this interface is: cancel the order and place a new order on the same trading pair, and return the modification result to the client synchronously\n\nWhen the quantity of the new order updated by the user is less than the filled quantity of this order, the order will be considered as completed, and the order will be cancelled, and no new order will be placed\n:::\n", + "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"Spot\",\"api-rate-limit-pool\":\"Spot\",\"sdk-service\":\"Spot\",\"sdk-sub-service\":\"Order\",\"sdk-method-name\":\"modifyOrder\",\"sdk-method-description\":\"This interface can modify the price and quantity of the order according to orderId or clientOid. The implementation of this interface is: cancel the order and place a new order on the same trading pair, and return the modification result to the client synchronously When the quantity of the new order updated by the user is less than the filled quantity of this order, the order will be considered as completed, and the order will be cancelled, and no new order will be placed\",\"api-rate-limit\":3}" } }, { - "name": "Batch Cancel OCO Order", + "name": "Get Order By OrderId", "api": { - "id": "3470356", - "method": "delete", - "path": "/api/v3/oco/orders", + "id": "3470181", + "method": "get", + "path": "/api/v1/hf/orders/{orderId}", "parameters": { "query": [ { - "required": false, - "description": "Specify the order id, there can be multiple orders, separated by commas. If not passed, all oco orders will be canceled by default.", + "id": "M9bgPS6vOj", + "name": "symbol", + "required": true, + "description": "symbol", + "example": "BTC-USDT", "type": "string", - "id": "k4wDZR9oG9", - "enable": true, - "name": "orderIds", - "example": "674c388172cf2800072ee746,674c38bdfd8300000795167e" - }, + "schema": { + "type": "string", + "examples": [ + "BTC-USDT", + "ETH-USDT", + "KCS-USDT" + ] + }, + "enable": true + } + ], + "path": [ { - "required": false, - "description": "trading pair. If not passed, the oco orders of all symbols will be canceled by default.", + "id": "orderId#0", + "name": "orderId", + "required": true, + "description": "The unique order id generated by the trading system", + "example": "6717422bd51c29000775ea03", "type": "string", - "id": "VGVVOaGkpz", - "enable": true, - "name": "symbol", - "example": "BTC-USDT" + "enable": true } ], - "path": [], "cookie": [], "header": [] }, "responses": [ { - "id": "10609", + "id": "10345", "code": 200, "name": "OK", "headers": [], @@ -15737,16 +14467,266 @@ "data": { "type": "object", "properties": { - "cancelledOrderIds": { - "type": "array", - "items": { - "type": "string" - }, - "description": "List of two order IDs related to the canceled OCO order" + "id": { + "type": "string", + "description": "The unique order id generated by the trading system" + }, + "symbol": { + "type": "string", + "description": "symbol", + "examples": [ + "BTC-USDT", + "ETH-USDT", + "KCS-USDT" + ] + }, + "opType": { + "type": "string" + }, + "type": { + "type": "string", + "description": "Specify if the order is an 'limit' order or 'market' order. ", + "enum": [ + "limit", + "market" + ], + "x-api-enum": [ + { + "value": "limit", + "name": "", + "description": "" + }, + { + "value": "market", + "name": "", + "description": "" + } + ] + }, + "side": { + "type": "string", + "description": "Buy or sell", + "enum": [ + "buy", + "sell" + ], + "x-api-enum": [ + { + "value": "buy", + "name": "", + "description": "" + }, + { + "value": "sell", + "name": "", + "description": "" + } + ] + }, + "price": { + "type": "string", + "description": "Order price" + }, + "size": { + "type": "string", + "description": "Order size" + }, + "funds": { + "type": "string", + "description": "Order Funds" + }, + "dealSize": { + "type": "string", + "description": "Number of filled transactions" + }, + "dealFunds": { + "type": "string", + "description": "Funds of filled transactions" + }, + "fee": { + "type": "string", + "description": "[Handling fees](apidog://link/pages/5327739)" + }, + "feeCurrency": { + "type": "string", + "description": "currency used to calculate trading fee" + }, + "stp": { + "type": "string", + "description": "[Self Trade Prevention](apidog://link/pages/5176570)", + "enum": [ + "DC", + "CO", + "CN", + "CB" + ], + "x-api-enum": [ + { + "value": "DC", + "name": "", + "description": "" + }, + { + "value": "CO", + "name": "", + "description": "" + }, + { + "value": "CN", + "name": "", + "description": "" + }, + { + "value": "CB", + "name": "", + "description": "" + } + ] + }, + "timeInForce": { + "type": "string", + "description": "Time in force", + "enum": [ + "GTC", + "GTT", + "IOC", + "FOK" + ], + "x-api-enum": [ + { + "value": "GTC", + "name": "", + "description": "" + }, + { + "value": "GTT", + "name": "", + "description": "" + }, + { + "value": "IOC", + "name": "", + "description": "" + }, + { + "value": "FOK", + "name": "", + "description": "" + } + ] + }, + "postOnly": { + "type": "boolean", + "description": "Whether its a postOnly order." + }, + "hidden": { + "type": "boolean", + "description": "Whether its a hidden order." + }, + "iceberg": { + "type": "boolean", + "description": "Whether its a iceberg order." + }, + "visibleSize": { + "type": "string", + "description": "Visible size of iceberg order in order book." + }, + "cancelAfter": { + "type": "integer", + "description": "A GTT timeInForce that expires in n seconds" + }, + "channel": { + "type": "string" + }, + "clientOid": { + "type": "string", + "description": "Client Order Id,unique identifier created by the user" + }, + "remark": { + "type": "string", + "description": "Order placement remarks" + }, + "tags": { + "type": "string", + "description": "Order tag" + }, + "cancelExist": { + "type": "boolean", + "description": "Whether there is a cancellation record for the order." + }, + "createdAt": { + "type": "integer", + "format": "int64" + }, + "lastUpdatedAt": { + "type": "integer", + "format": "int64" + }, + "tradeType": { + "type": "string", + "description": "Trade type, redundancy param" + }, + "inOrderBook": { + "type": "boolean", + "description": "Whether to enter the orderbook: true: enter the orderbook; false: not enter the orderbook" + }, + "cancelledSize": { + "type": "string", + "description": "Number of canceled transactions" + }, + "cancelledFunds": { + "type": "string", + "description": "Funds of canceled transactions" + }, + "remainSize": { + "type": "string", + "description": "Number of remain transactions" + }, + "remainFunds": { + "type": "string", + "description": "Funds of remain transactions" + }, + "tax": { + "type": "string", + "description": "Users in some regions need query this field" + }, + "active": { + "type": "boolean", + "description": "Order status: true-The status of the order isactive; false-The status of the order is done" } }, "required": [ - "cancelledOrderIds" + "id", + "symbol", + "opType", + "type", + "side", + "price", + "size", + "funds", + "dealSize", + "dealFunds", + "fee", + "feeCurrency", + "timeInForce", + "postOnly", + "hidden", + "iceberg", + "visibleSize", + "cancelAfter", + "channel", + "clientOid", + "cancelExist", + "tradeType", + "inOrderBook", + "cancelledSize", + "cancelledFunds", + "remainSize", + "remainFunds", + "active", + "createdAt", + "lastUpdatedAt", + "tax" ] } }, @@ -15763,8 +14743,8 @@ "responseExamples": [ { "name": "Success", - "data": "{\r\n \"code\": \"200000\",\r\n \"data\": {\r\n \"cancelledOrderIds\": [\r\n \"vs93gpqc750mkk57003gok6i\",\r\n \"vs93gpqc750mkk57003gok6j\",\r\n \"vs93gpqc75c39p83003tnriu\",\r\n \"vs93gpqc75c39p83003tnriv\"\r\n ]\r\n }\r\n}", - "responseId": 10609, + "data": "{\n \"code\": \"200000\",\n \"data\": {\n \"id\": \"6717422bd51c29000775ea03\",\n \"clientOid\": \"5c52e11203aa677f33e493fb\",\n \"symbol\": \"BTC-USDT\",\n \"opType\": \"DEAL\",\n \"type\": \"limit\",\n \"side\": \"buy\",\n \"price\": \"70000\",\n \"size\": \"0.00001\",\n \"funds\": \"0.7\",\n \"dealSize\": \"0.00001\",\n \"dealFunds\": \"0.677176\",\n \"remainSize\": \"0\",\n \"remainFunds\": \"0.022824\",\n \"cancelledSize\": \"0\",\n \"cancelledFunds\": \"0\",\n \"fee\": \"0.000677176\",\n \"feeCurrency\": \"USDT\",\n \"stp\": null,\n \"timeInForce\": \"GTC\",\n \"postOnly\": false,\n \"hidden\": false,\n \"iceberg\": false,\n \"visibleSize\": \"0\",\n \"cancelAfter\": 0,\n \"channel\": \"API\",\n \"remark\": \"order remarks\",\n \"tags\": null,\n \"cancelExist\": false,\n \"tradeType\": \"TRADE\",\n \"inOrderBook\": false,\n \"active\": false,\n \"tax\": \"0\",\n \"createdAt\": 1729577515444,\n \"lastUpdatedAt\": 1729577515481\n }\n}", + "responseId": 10345, "ordering": 1 } ], @@ -15778,16 +14758,16 @@ "example": "{\n \"symbol\": \"BTC-USDT\",\n \"orderId\": \"670fd33bf9406e0007ab3945\",\n \"newPrice\": \"30000\",\n \"newSize\": \"0.0001\"\n}", "mediaType": "" }, - "description": ":::info[Description]\nThis interface can batch cancel OCO orders through orderIds.\n\nYou will receive cancelledOrderIds field once the system has received the cancellation request. The cancellation request will be processed by the matching engine in sequence. To know if the request is processed (successfully or not), you may check the order status or the update message from the pushes.\n:::", - "customApiFields": "{\"abandon\":\"abandon\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"Spot\",\"api-rate-limit-pool\":\"Spot\",\"sdk-service\":\"Spot\",\"sdk-sub-service\":\"Order\",\"sdk-method-name\":\"batchCancelOcoOrders\",\"sdk-method-description\":\"This interface can batch cancel OCO orders through orderIds. You will receive cancelledOrderIds field once the system has received the cancellation request. The cancellation request will be processed by the matching engine in sequence. To know if the request is processed (successfully or not), you may check the order status or the update message from the pushes.\",\"api-rate-limit\":3}" + "description": ":::info[Description]\nThis endpoint can be used to obtain information for a single Spot order using the order id.\n\nAfter the user successfully places an order, the order is in Active state, and the user can use inOrderBook to determine whether the order has entered the order. Canceled or fully filled orders are marked as completed Done status.\n:::\n\n:::tip[Tips]\nIf the order is not an active order, you can only get data within the time range of 3 _ 24 hours (ie: from the current time to 3 _ 24 hours ago). If the time range is exceeded, the system will query the data within the time range of 3 * 24 hours by default.\n:::", + "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"General\",\"api-rate-limit-pool\":\"Spot\",\"sdk-service\":\"Spot\",\"sdk-sub-service\":\"Order\",\"sdk-method-name\":\"getOrderByOrderId\",\"sdk-method-description\":\"This endpoint can be used to obtain information for a single Spot order using the order id. After the user successfully places an order, the order is in Active state, and the user can use inOrderBook to determine whether the order has entered the order. Canceled or fully filled orders are marked as completed Done status.\",\"api-rate-limit\":2}" } }, { - "name": "Get Trade History", + "name": "Get Order By ClientOid", "api": { - "id": "3470180", + "id": "3470182", "method": "get", - "path": "/api/v1/hf/fills", + "path": "/api/v1/hf/orders/client-order/{clientOid}", "parameters": { "query": [ { @@ -15806,368 +14786,17 @@ ] }, "enable": true - }, - { - "id": "Bc6ZDrZFdp", - "name": "orderId", - "required": false, - "description": "The unique order id generated by the trading system\n(If orderId is specified,please ignore the other query parameters)", - "type": "string", - "enable": true - }, - { - "id": "sTtMCE9Jhf", - "name": "side", - "required": false, - "description": "specify if the order is to 'buy' or 'sell'", - "type": "string", - "schema": { - "type": "string", - "enum": [ - "buy", - "sell" - ], - "x-api-enum": [ - { - "value": "buy", - "name": "", - "description": "" - }, - { - "value": "sell", - "name": "", - "description": "" - } - ] - }, - "enable": true - }, - { - "id": "QaBSxyasEm", - "name": "type", - "required": false, - "description": "specify if the order is an 'limit' order or 'market' order. ", - "type": "string", - "schema": { - "type": "string", - "enum": [ - "limit", - "market" - ], - "x-api-enum": [ - { - "value": "limit", - "name": "", - "description": "" - }, - { - "value": "market", - "name": "", - "description": "" - } - ] - }, - "enable": true - }, - { - "id": "kkvuIGVxs6", - "name": "lastId", - "required": false, - "description": "The id of the last set of data from the previous batch of data. By default, the latest information is given.\nlastId is used to filter data and paginate. If lastId is not entered, the default is a maximum of 100 returned data items. The return results include lastId,which can be used as a query parameter to look up new data from the next page.", - "example": "254062248624417", - "type": "integer", - "schema": { - "type": "integer", - "format": "int64" - }, - "enable": true - }, - { - "id": "heQ8W6yKwm", - "name": "limit", - "required": false, - "description": "Default20,Max100", - "example": "100", - "type": "integer", - "schema": { - "type": "integer", - "default": 20, - "minimum": 1, - "maximum": 100 - }, - "enable": true - }, - { - "id": "Djtx6oC9gm", - "name": "startAt", - "required": false, - "description": "Start time (milisecond)", - "example": "1728663338000", - "type": "integer", - "schema": { - "type": "integer", - "format": "int64" - }, - "enable": true - }, - { - "id": "K9IMpKw8u2", - "name": "endAt", - "required": false, - "description": "End time (milisecond)", - "example": "1728692138000", - "type": "integer", - "schema": { - "type": "integer", - "format": "int64" - }, - "enable": true } ], - "path": [], - "cookie": [], - "header": [] - }, - "responses": [ - { - "id": "10344", - "code": 200, - "name": "OK", - "headers": [], - "jsonSchema": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "data": { - "type": "object", - "properties": { - "items": { - "type": "array", - "items": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "description": "Id of transaction detail", - "format": "int64" - }, - "symbol": { - "type": "string", - "description": "symbol", - "examples": [ - "BTC-USDT", - "ETH-USDT", - "KCS-USDT" - ] - }, - "tradeId": { - "type": "integer", - "description": "Trade Id, symbol latitude increment", - "format": "int64" - }, - "orderId": { - "type": "string", - "description": "The unique order id generated by the trading system" - }, - "counterOrderId": { - "type": "string", - "description": "Counterparty order Id" - }, - "side": { - "type": "string", - "description": "Buy or sell", - "enum": [ - "buy", - "sell" - ], - "x-api-enum": [ - { - "value": "buy", - "name": "", - "description": "" - }, - { - "value": "sell", - "name": "", - "description": "" - } - ] - }, - "liquidity": { - "type": "string", - "description": "Liquidity type: taker or maker", - "enum": [ - "taker", - "maker" - ], - "x-api-enum": [ - { - "value": "taker", - "name": "", - "description": "" - }, - { - "value": "maker", - "name": "", - "description": "" - } - ] - }, - "forceTaker": { - "type": "boolean" - }, - "price": { - "type": "string", - "description": "Order price" - }, - "size": { - "type": "string", - "description": "Order size" - }, - "funds": { - "type": "string", - "description": "Order Funds" - }, - "fee": { - "type": "string", - "description": "[Handling fees](apidog://link/pages/5327739)" - }, - "feeRate": { - "type": "string", - "description": "Fee rate\n" - }, - "feeCurrency": { - "type": "string", - "description": "currency used to calculate trading fee" - }, - "stop": { - "type": "string", - "description": "Take Profit and Stop Loss type, currently HFT does not support the Take Profit and Stop Loss type, so it is empty" - }, - "tradeType": { - "type": "string", - "description": "Trade type, redundancy param" - }, - "taxRate": { - "type": "string", - "description": "Tax Rate, Users in some regions need query this field" - }, - "tax": { - "type": "string", - "description": "Users in some regions need query this field" - }, - "type": { - "type": "string", - "description": "Specify if the order is an 'limit' order or 'market' order. ", - "enum": [ - "limit", - "market" - ], - "x-api-enum": [ - { - "value": "limit", - "name": "", - "description": "" - }, - { - "value": "market", - "name": "", - "description": "" - } - ] - }, - "createdAt": { - "type": "integer", - "format": "int64" - } - }, - "required": [ - "id", - "symbol", - "tradeId", - "orderId", - "counterOrderId", - "side", - "liquidity", - "forceTaker", - "price", - "size", - "funds", - "fee", - "feeRate", - "feeCurrency", - "stop", - "tradeType", - "taxRate", - "tax", - "type", - "createdAt" - ] - } - }, - "lastId": { - "type": "integer", - "description": "The id of the last set of data from the previous batch of data. By default, the latest information is given.\nlastId is used to filter data and paginate. If lastId is not entered, the default is a maximum of 100 returned data items. The return results include lastId,which can be used as a query parameter to look up new data from the next page.", - "format": "int64" - } - }, - "required": [ - "items", - "lastId" - ] - } - }, - "required": [ - "code", - "data" - ] - }, - "description": "", - "contentType": "json", - "mediaType": "" - } - ], - "responseExamples": [ - { - "name": "Success", - "data": "{\n \"code\": \"200000\",\n \"data\": {\n \"items\": [\n {\n \"id\": 19814995255305,\n \"orderId\": \"6717422bd51c29000775ea03\",\n \"counterOrderId\": \"67174228135f9e000709da8c\",\n \"tradeId\": 11029373945659392,\n \"symbol\": \"BTC-USDT\",\n \"side\": \"buy\",\n \"liquidity\": \"taker\",\n \"type\": \"limit\",\n \"forceTaker\": false,\n \"price\": \"67717.6\",\n \"size\": \"0.00001\",\n \"funds\": \"0.677176\",\n \"fee\": \"0.000677176\",\n \"feeRate\": \"0.001\",\n \"feeCurrency\": \"USDT\",\n \"stop\": \"\",\n \"tradeType\": \"TRADE\",\n \"taxRate\": \"0\",\n \"tax\": \"0\",\n \"createdAt\": 1729577515473\n }\n ],\n \"lastId\": 19814995255305\n }\n}", - "responseId": 10344, - "ordering": 1 - } - ], - "requestBody": { - "type": "none", - "parameters": [], - "jsonSchema": { - "type": "object", - "properties": {} - }, - "example": "{\n \"symbol\": \"BTC-USDT\",\n \"orderId\": \"670fd33bf9406e0007ab3945\",\n \"newPrice\": \"30000\",\n \"newSize\": \"0.0001\"\n}", - "mediaType": "" - }, - "description": ":::info[Description]\nThis endpoint can be used to obtain a list of the latest Spot transaction details. \nThe returned data is sorted in descending order according to the latest update time of the order.\n:::\n\n:::tip[Tips]\nIf the order is not an active order, you can only get data within the time range of 3 _ 24 hours (ie: from the current time to 3 _ 24 hours ago). If the time range is exceeded, the system will query the data within the time range of 3 * 24 hours by default.\n:::", - "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"General\",\"api-rate-limit-pool\":\"Spot\",\"sdk-service\":\"Spot\",\"sdk-sub-service\":\"Order\",\"sdk-method-name\":\"getTradeHistory\",\"sdk-method-description\":\"This endpoint can be used to obtain a list of the latest Spot transaction details. The returned data is sorted in descending order according to the latest update time of the order.\",\"api-rate-limit\":2}" - } - }, - { - "name": "Get OCO Order By OrderId", - "api": { - "id": "3470357", - "method": "get", - "path": "/api/v3/oco/order/{orderId}", - "parameters": { - "query": [], "path": [ { - "id": "orderId#0", - "name": "orderId", + "id": "clientOid#0", + "name": "clientOid", "required": true, - "description": "The unique order id generated by the trading system", + "description": "Client Order Id,unique identifier created by the user", + "example": "5c52e11203aa677f33e493fb", "type": "string", - "enable": true, - "example": "674c3b6e688dea0007c7bab2" + "enable": true } ], "cookie": [], @@ -16175,7 +14804,7 @@ }, "responses": [ { - "id": "10579", + "id": "10346", "code": 200, "name": "OK", "headers": [], @@ -16188,62 +14817,266 @@ "data": { "type": "object", "properties": { + "id": { + "type": "string", + "description": "The unique order id generated by the trading system" + }, "symbol": { "type": "string", - "description": "symbol" + "description": "symbol", + "examples": [ + "BTC-USDT", + "ETH-USDT", + "KCS-USDT" + ] }, - "clientOid": { + "opType": { + "type": "string" + }, + "type": { "type": "string", - "description": "Client Order Id" + "description": "Specify if the order is an 'limit' order or 'market' order. ", + "enum": [ + "limit", + "market" + ], + "x-api-enum": [ + { + "value": "limit", + "name": "", + "description": "" + }, + { + "value": "market", + "name": "", + "description": "" + } + ] }, - "orderId": { + "side": { "type": "string", - "description": "The unique order id generated by the trading system,which can be used later for further actions such as canceling the order." + "description": "Buy or sell", + "enum": [ + "buy", + "sell" + ], + "x-api-enum": [ + { + "value": "buy", + "name": "", + "description": "" + }, + { + "value": "sell", + "name": "", + "description": "" + } + ] }, - "orderTime": { - "type": "integer", - "description": "Order placement time, milliseconds", - "format": "int64" + "price": { + "type": "string", + "description": "Order price" }, - "status": { + "size": { + "type": "string", + "description": "Order size" + }, + "funds": { + "type": "string", + "description": "Order Funds" + }, + "dealSize": { + "type": "string", + "description": "Number of filled transactions" + }, + "dealFunds": { + "type": "string", + "description": "Funds of filled transactions" + }, + "fee": { + "type": "string", + "description": "[Handling fees](apidog://link/pages/5327739)" + }, + "feeCurrency": { + "type": "string", + "description": "currency used to calculate trading fee" + }, + "stp": { + "type": "string", + "description": "[Self Trade Prevention](apidog://link/pages/5176570)", + "enum": [ + "DC", + "CO", + "CN", + "CB" + ], + "x-api-enum": [ + { + "value": "DC", + "name": "", + "description": "" + }, + { + "value": "CO", + "name": "", + "description": "" + }, + { + "value": "CN", + "name": "", + "description": "" + }, + { + "value": "CB", + "name": "", + "description": "" + } + ] + }, + "timeInForce": { "type": "string", - "description": "Order status: NEW: New, DONE: Completed, TRIGGERED: Triggered, CANCELLED: Cancelled", + "description": "Time in force", "enum": [ - "NEW", - "DONE", - "TRIGGERED", - "CANCELLED" + "GTC", + "GTT", + "IOC", + "FOK" ], "x-api-enum": [ { - "value": "NEW", - "name": "NEW", - "description": "New" + "value": "GTC", + "name": "", + "description": "" }, { - "value": "DONE", - "name": "DONE", - "description": "Completed" + "value": "GTT", + "name": "", + "description": "" }, { - "value": "TRIGGERED", - "name": "TRIGGERED", - "description": "Triggered" + "value": "IOC", + "name": "", + "description": "" }, { - "value": "CANCELLED", - "name": "CANCELLED", - "description": "Cancelled" + "value": "FOK", + "name": "", + "description": "" } ] + }, + "postOnly": { + "type": "boolean", + "description": "Whether its a postOnly order." + }, + "hidden": { + "type": "boolean", + "description": "Whether its a hidden order." + }, + "iceberg": { + "type": "boolean", + "description": "Whether its a iceberg order." + }, + "visibleSize": { + "type": "string", + "description": "Visible size of iceberg order in order book." + }, + "cancelAfter": { + "type": "integer", + "description": "A GTT timeInForce that expires in n seconds" + }, + "channel": { + "type": "string" + }, + "clientOid": { + "type": "string", + "description": "Client Order Id,unique identifier created by the user" + }, + "remark": { + "type": "string", + "description": "Order placement remarks" + }, + "tags": { + "type": "string", + "description": "Order tag" + }, + "cancelExist": { + "type": "boolean", + "description": "Whether there is a cancellation record for the order." + }, + "createdAt": { + "type": "integer", + "format": "int64" + }, + "lastUpdatedAt": { + "type": "integer", + "format": "int64" + }, + "tradeType": { + "type": "string", + "description": "Trade type, redundancy param" + }, + "inOrderBook": { + "type": "boolean", + "description": "Whether to enter the orderbook: true: enter the orderbook; false: not enter the orderbook" + }, + "cancelledSize": { + "type": "string", + "description": "Number of canceled transactions" + }, + "cancelledFunds": { + "type": "string", + "description": "Funds of canceled transactions" + }, + "remainSize": { + "type": "string", + "description": "Number of remain transactions" + }, + "remainFunds": { + "type": "string", + "description": "Funds of remain transactions" + }, + "tax": { + "type": "string", + "description": "Users in some regions need query this field" + }, + "active": { + "type": "boolean", + "description": "Order status: true-The status of the order isactive; false-The status of the order is done" } }, "required": [ - "orderId", + "id", "symbol", + "opType", + "type", + "side", + "price", + "size", + "funds", + "dealSize", + "dealFunds", + "fee", + "feeCurrency", + "timeInForce", + "postOnly", + "hidden", + "iceberg", + "visibleSize", + "cancelAfter", + "channel", "clientOid", - "orderTime", - "status" + "cancelExist", + "tradeType", + "inOrderBook", + "cancelledSize", + "cancelledFunds", + "remainSize", + "remainFunds", + "active", + "createdAt", + "lastUpdatedAt", + "tax" ] } }, @@ -16260,8 +15093,8 @@ "responseExamples": [ { "name": "Success", - "data": "{\r\n \"code\": \"200000\",\r\n \"data\": {\r\n \"orderId\": \"674c3b6e688dea0007c7bab2\",\r\n \"symbol\": \"BTC-USDT\",\r\n \"clientOid\": \"5c52e1203aa6f37f1e493fb\",\r\n \"orderTime\": 1733049198863,\r\n \"status\": \"NEW\"\r\n }\r\n}", - "responseId": 10579, + "data": "{\n \"code\": \"200000\",\n \"data\": {\n \"id\": \"6717422bd51c29000775ea03\",\n \"clientOid\": \"5c52e11203aa677f33e493fb\",\n \"symbol\": \"BTC-USDT\",\n \"opType\": \"DEAL\",\n \"type\": \"limit\",\n \"side\": \"buy\",\n \"price\": \"70000\",\n \"size\": \"0.00001\",\n \"funds\": \"0.7\",\n \"dealSize\": \"0.00001\",\n \"dealFunds\": \"0.677176\",\n \"remainSize\": \"0\",\n \"remainFunds\": \"0.022824\",\n \"cancelledSize\": \"0\",\n \"cancelledFunds\": \"0\",\n \"fee\": \"0.000677176\",\n \"feeCurrency\": \"USDT\",\n \"stp\": null,\n \"timeInForce\": \"GTC\",\n \"postOnly\": false,\n \"hidden\": false,\n \"iceberg\": false,\n \"visibleSize\": \"0\",\n \"cancelAfter\": 0,\n \"channel\": \"API\",\n \"remark\": \"order remarks\",\n \"tags\": null,\n \"cancelExist\": false,\n \"tradeType\": \"TRADE\",\n \"inOrderBook\": false,\n \"active\": false,\n \"tax\": \"0\",\n \"createdAt\": 1729577515444,\n \"lastUpdatedAt\": 1729577515481\n }\n}", + "responseId": 10346, "ordering": 1 } ], @@ -16275,100 +15108,25 @@ "example": "{\n \"symbol\": \"BTC-USDT\",\n \"orderId\": \"670fd33bf9406e0007ab3945\",\n \"newPrice\": \"30000\",\n \"newSize\": \"0.0001\"\n}", "mediaType": "" }, - "description": ":::info[Description]\nRequest via this interface to get a oco order information via the order ID.\n:::", - "customApiFields": "{\"abandon\":\"abandon\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"General\",\"api-rate-limit-pool\":\"Spot\",\"sdk-service\":\"Spot\",\"sdk-sub-service\":\"Order\",\"sdk-method-name\":\"getOcoOrderByOrderId\",\"sdk-method-description\":\"Request via this interface to get a oco order information via the order ID.\",\"api-rate-limit\":2}" + "description": ":::info[Description]\nThis endpoint can be used to obtain information for a single Spot order using the client order id.\n\nAfter the user successfully places an order, the order is in Active state, and the user can use inOrderBook to determine whether the order has entered the order. Canceled or fully filled orders are marked as completed Done status.\n:::\n\n:::tip[Tips]\nIf the order is not an active order, you can only get data within the time range of 3 _ 24 hours (ie: from the current time to 3 _ 24 hours ago). If the time range is exceeded, the system will query the data within the time range of 3 * 24 hours by default.\n:::", + "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"General\",\"api-rate-limit-pool\":\"Spot\",\"sdk-service\":\"Spot\",\"sdk-sub-service\":\"Order\",\"sdk-method-name\":\"getOrderByClientOid\",\"sdk-method-description\":\"This endpoint can be used to obtain information for a single Spot order using the client order id. After the user successfully places an order, the order is in Active state, and the user can use inOrderBook to determine whether the order has entered the order. Canceled or fully filled orders are marked as completed Done status.\",\"api-rate-limit\":2}" } }, { - "name": "Get OCO Order List", + "name": "Get Symbols With Open Order", "api": { - "id": "3470360", + "id": "3470177", "method": "get", - "path": "/api/v3/oco/orders", + "path": "/api/v1/hf/orders/active/symbols", "parameters": { - "query": [ - { - "required": false, - "description": "symbol", - "type": "string", - "id": "k5kTqKOh1U", - "enable": true, - "name": "symbol", - "schema": { - "type": "string", - "examples": [ - "BTC-USDT", - "ETH-USDT", - "KCS-USDT" - ] - } - }, - { - "required": false, - "description": "Start time (milliseconds)", - "type": "integer", - "id": "3gEHqfvq1R", - "enable": true, - "name": "startAt", - "schema": { - "type": "integer", - "format": "int64" - } - }, - { - "required": false, - "description": "End time (milliseconds)", - "type": "integer", - "id": "qfsVt7qQe8", - "enable": true, - "name": "endAt", - "schema": { - "type": "integer", - "format": "int64" - } - }, - { - "required": false, - "description": "Specify orderId collection, up to 500 orders\n", - "type": "string", - "id": "ZFIKYx3RJH", - "enable": true, - "name": "orderIds" - }, - { - "required": false, - "description": "Size per page, minimum value 10, maximum value 500", - "type": "integer", - "id": "FJH8SIb2XY", - "enable": true, - "name": "pageSize", - "schema": { - "type": "integer", - "minimum": 10, - "maximum": 500, - "default": 50 - } - }, - { - "required": false, - "description": "Page number, minimum value 1\n", - "type": "integer", - "id": "sSsAg6Hbjc", - "enable": true, - "name": "currentPage", - "schema": { - "type": "integer", - "default": 1 - } - } - ], "path": [], + "query": [], "cookie": [], "header": [] }, "responses": [ { - "id": "10581", + "id": "10341", "code": 200, "name": "OK", "headers": [], @@ -16381,89 +15139,16 @@ "data": { "type": "object", "properties": { - "currentPage": { - "type": "integer" - }, - "pageSize": { - "type": "integer" - }, - "totalNum": { - "type": "integer" - }, - "totalPage": { - "type": "integer" - }, - "items": { + "symbols": { "type": "array", "items": { - "type": "object", - "properties": { - "orderId": { - "type": "string", - "description": "The unique order id generated by the trading system,which can be used later for further actions such as canceling the order." - }, - "symbol": { - "type": "string", - "description": "symbol" - }, - "clientOid": { - "type": "string", - "description": "Client Order Id" - }, - "orderTime": { - "type": "integer", - "description": "Order placement time, milliseconds", - "format": "int64" - }, - "status": { - "type": "string", - "description": "Order status: NEW: New, DONE: Completed, TRIGGERED: Triggered, CANCELLED: Cancelled", - "enum": [ - "NEW", - "DONE", - "TRIGGERED", - "CANCELLED" - ], - "x-api-enum": [ - { - "value": "NEW", - "name": "NEW", - "description": "New" - }, - { - "value": "DONE", - "name": "DONE", - "description": "Completed" - }, - { - "value": "TRIGGERED", - "name": "TRIGGERED", - "description": "Triggered" - }, - { - "value": "CANCELLED", - "name": "CANCELLED", - "description": "Cancelled" - } - ] - } - }, - "required": [ - "orderId", - "symbol", - "clientOid", - "orderTime", - "status" - ] - } + "type": "string" + }, + "description": "The symbol that has active orders" } }, "required": [ - "currentPage", - "pageSize", - "totalNum", - "totalPage", - "items" + "symbols" ] } }, @@ -16480,8 +15165,8 @@ "responseExamples": [ { "name": "Success", - "data": "{\r\n \"code\": \"200000\",\r\n \"data\": {\r\n \"currentPage\": 1,\r\n \"pageSize\": 50,\r\n \"totalNum\": 1,\r\n \"totalPage\": 1,\r\n \"items\": [\r\n {\r\n \"orderId\": \"674c3cfa72cf2800072ee7ce\",\r\n \"symbol\": \"BTC-USDT\",\r\n \"clientOid\": \"5c52e1203aa6f3g7f1e493fb\",\r\n \"orderTime\": 1733049594803,\r\n \"status\": \"NEW\"\r\n }\r\n ]\r\n }\r\n}", - "responseId": 10581, + "data": "{\n \"code\": \"200000\",\n \"data\": {\n \"symbols\": [\n \"ETH-USDT\",\n \"BTC-USDT\"\n ]\n }\n}", + "responseId": 10341, "ordering": 1 } ], @@ -16495,35 +15180,43 @@ "example": "{\n \"symbol\": \"BTC-USDT\",\n \"orderId\": \"670fd33bf9406e0007ab3945\",\n \"newPrice\": \"30000\",\n \"newSize\": \"0.0001\"\n}", "mediaType": "" }, - "description": ":::info[Description]\nRequest via this endpoint to get your current OCO order list. Items are paginated and sorted to show the latest first. See the Pagination section for retrieving additional entries after the first page.\n:::", - "customApiFields": "{\"abandon\":\"abandon\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"General\",\"api-rate-limit-pool\":\"Spot\",\"sdk-service\":\"Spot\",\"sdk-sub-service\":\"Order\",\"sdk-method-name\":\"getOcoOrderList\",\"sdk-method-description\":\"Request via this endpoint to get your current OCO order list. Items are paginated and sorted to show the latest first. See the Pagination section for retrieving additional entries after the first page.\",\"api-rate-limit\":2}" + "description": ":::info[Description]\nThis interface can query all spot symbol that has active orders\n:::", + "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"Spot\",\"api-rate-limit-pool\":\"Spot\",\"sdk-service\":\"Spot\",\"sdk-sub-service\":\"Order\",\"sdk-method-name\":\"getSymbolsWithOpenOrder\",\"sdk-method-description\":\"This interface can query all spot symbol that has active orders\",\"api-rate-limit\":2}" } }, { - "name": "Get OCO Order Detail By OrderId", + "name": "Get Open Orders", "api": { - "id": "3470359", + "id": "3470178", "method": "get", - "path": "/api/v3/oco/order/details/{orderId}", + "path": "/api/v1/hf/orders/active", "parameters": { - "query": [], - "path": [ + "query": [ { - "id": "orderId#0", - "name": "orderId", + "id": "M9bgPS6vOj", + "name": "symbol", "required": true, - "description": "The unique order id generated by the trading system", + "description": "symbol", + "example": "BTC-USDT", "type": "string", - "enable": true, - "example": "674c3b6e688dea0007c7bab2" + "schema": { + "type": "string", + "examples": [ + "BTC-USDT", + "ETH-USDT", + "KCS-USDT" + ] + }, + "enable": true } ], + "path": [], "cookie": [], "header": [] }, "responses": [ { - "id": "10610", + "id": "10342", "code": 200, "name": "OK", "headers": [], @@ -16534,76 +15227,272 @@ "type": "string" }, "data": { - "type": "object", - "properties": { - "orderId": { - "type": "string", - "description": "The unique order id generated by the trading system,which can be used later for further actions such as canceling the order." - }, - "symbol": { - "type": "string", - "description": "symbol" - }, - "clientOid": { - "type": "string", - "description": "Client Order Id" - }, - "orderTime": { - "type": "integer", - "description": "Order placement time, milliseconds", - "format": "int64" - }, - "status": { - "type": "string", - "description": "Order status: NEW: New, DONE: Completed, TRIGGERED: Triggered, CANCELLED: Cancelled" - }, - "orders": { - "type": "array", - "items": { - "type": "object", - "properties": { - "id": { - "type": "string" + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The unique order id generated by the trading system" + }, + "symbol": { + "type": "string", + "description": "symbol", + "examples": [ + "BTC-USDT", + "ETH-USDT", + "KCS-USDT" + ] + }, + "opType": { + "type": "string" + }, + "type": { + "type": "string", + "description": "Specify if the order is an 'limit' order or 'market' order. ", + "enum": [ + "limit", + "market" + ], + "x-api-enum": [ + { + "value": "limit", + "name": "", + "description": "" }, - "symbol": { - "type": "string" + { + "value": "market", + "name": "", + "description": "" + } + ] + }, + "side": { + "type": "string", + "description": "Buy or sell", + "enum": [ + "buy", + "sell" + ], + "x-api-enum": [ + { + "value": "buy", + "name": "", + "description": "" }, - "side": { - "type": "string" + { + "value": "sell", + "name": "", + "description": "" + } + ] + }, + "price": { + "type": "string", + "description": "Order price" + }, + "size": { + "type": "string", + "description": "Order size" + }, + "funds": { + "type": "string", + "description": "Order Funds" + }, + "dealSize": { + "type": "string", + "description": "Number of filled transactions" + }, + "dealFunds": { + "type": "string", + "description": "Funds of filled transactions" + }, + "fee": { + "type": "string", + "description": "[Handling fees](apidog://link/pages/5327739)" + }, + "feeCurrency": { + "type": "string", + "description": "currency used to calculate trading fee" + }, + "stp": { + "type": "string", + "description": "[Self Trade Prevention](apidog://link/pages/5176570)", + "enum": [ + "DC", + "CO", + "CN", + "CB" + ], + "x-api-enum": [ + { + "value": "DC", + "name": "", + "description": "" }, - "price": { - "type": "string" + { + "value": "CO", + "name": "", + "description": "" + }, + { + "value": "CN", + "name": "", + "description": "" + }, + { + "value": "CB", + "name": "", + "description": "" + } + ] + }, + "timeInForce": { + "type": "string", + "description": "Time in force", + "enum": [ + "GTC", + "GTT", + "IOC", + "FOK" + ], + "x-api-enum": [ + { + "value": "GTC", + "name": "", + "description": "" }, - "stopPrice": { - "type": "string" + { + "value": "GTT", + "name": "", + "description": "" }, - "size": { - "type": "string" + { + "value": "IOC", + "name": "", + "description": "" }, - "status": { - "type": "string" + { + "value": "FOK", + "name": "", + "description": "" } - }, - "required": [ - "id", - "symbol", - "side", - "price", - "stopPrice", - "size", - "status" ] + }, + "postOnly": { + "type": "boolean", + "description": "Whether its a postOnly order." + }, + "hidden": { + "type": "boolean", + "description": "Whether its a hidden order." + }, + "iceberg": { + "type": "boolean", + "description": "Whether its a iceberg order." + }, + "visibleSize": { + "type": "string", + "description": "Visible size of iceberg order in order book." + }, + "cancelAfter": { + "type": "integer", + "description": "A GTT timeInForce that expires in n seconds" + }, + "channel": { + "type": "string" + }, + "clientOid": { + "type": "string", + "description": "Client Order Id,unique identifier created by the user" + }, + "remark": { + "type": "string", + "description": "Order placement remarks" + }, + "tags": { + "type": "string", + "description": "Order tag" + }, + "cancelExist": { + "type": "boolean", + "description": "Whether there is a cancellation record for the order." + }, + "createdAt": { + "type": "integer", + "format": "int64" + }, + "lastUpdatedAt": { + "type": "integer", + "format": "int64" + }, + "tradeType": { + "type": "string", + "description": "Trade type, redundancy param" + }, + "inOrderBook": { + "type": "boolean", + "description": "Whether to enter the orderbook: true: enter the orderbook; false: not enter the orderbook" + }, + "cancelledSize": { + "type": "string", + "description": "Number of canceled transactions" + }, + "cancelledFunds": { + "type": "string", + "description": "Funds of canceled transactions" + }, + "remainSize": { + "type": "string", + "description": "Number of remain transactions" + }, + "remainFunds": { + "type": "string", + "description": "Funds of remain transactions" + }, + "tax": { + "type": "string", + "description": "Users in some regions need query this field" + }, + "active": { + "type": "boolean", + "description": "Order status: true-The status of the order isactive; false-The status of the order is done" } - } - }, - "required": [ - "orderId", - "symbol", - "clientOid", - "orderTime", - "status", - "orders" - ] + }, + "required": [ + "id", + "symbol", + "opType", + "type", + "side", + "price", + "size", + "funds", + "dealSize", + "dealFunds", + "fee", + "feeCurrency", + "timeInForce", + "postOnly", + "hidden", + "iceberg", + "visibleSize", + "cancelAfter", + "channel", + "clientOid", + "cancelExist", + "tradeType", + "inOrderBook", + "cancelledSize", + "cancelledFunds", + "remainSize", + "remainFunds", + "active", + "createdAt", + "lastUpdatedAt", + "tax" + ] + } } }, "required": [ @@ -16619,8 +15508,8 @@ "responseExamples": [ { "name": "Success", - "data": "{\r\n \"code\": \"200000\",\r\n \"data\": {\r\n \"orderId\": \"674c3b6e688dea0007c7bab2\",\r\n \"symbol\": \"BTC-USDT\",\r\n \"clientOid\": \"5c52e1203aa6f37f1e493fb\",\r\n \"orderTime\": 1733049198863,\r\n \"status\": \"NEW\",\r\n \"orders\": [\r\n {\r\n \"id\": \"vs93gpqc7dn6h3fa003sfelj\",\r\n \"symbol\": \"BTC-USDT\",\r\n \"side\": \"buy\",\r\n \"price\": \"94000.00000000000000000000\",\r\n \"stopPrice\": \"94000.00000000000000000000\",\r\n \"size\": \"0.10000000000000000000\",\r\n \"status\": \"NEW\"\r\n },\r\n {\r\n \"id\": \"vs93gpqc7dn6h3fa003sfelk\",\r\n \"symbol\": \"BTC-USDT\",\r\n \"side\": \"buy\",\r\n \"price\": \"96000.00000000000000000000\",\r\n \"stopPrice\": \"98000.00000000000000000000\",\r\n \"size\": \"0.10000000000000000000\",\r\n \"status\": \"NEW\"\r\n }\r\n ]\r\n }\r\n}", - "responseId": 10610, + "data": "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"id\": \"67120bbef094e200070976f6\",\n \"clientOid\": \"5c52e11203aa677f33e493fb\",\n \"symbol\": \"BTC-USDT\",\n \"opType\": \"DEAL\",\n \"type\": \"limit\",\n \"side\": \"buy\",\n \"price\": \"50000\",\n \"size\": \"0.00001\",\n \"funds\": \"0.5\",\n \"dealSize\": \"0\",\n \"dealFunds\": \"0\",\n \"fee\": \"0\",\n \"feeCurrency\": \"USDT\",\n \"stp\": null,\n \"timeInForce\": \"GTC\",\n \"postOnly\": false,\n \"hidden\": false,\n \"iceberg\": false,\n \"visibleSize\": \"0\",\n \"cancelAfter\": 0,\n \"channel\": \"API\",\n \"remark\": \"order remarks\",\n \"tags\": \"order tags\",\n \"cancelExist\": false,\n \"tradeType\": \"TRADE\",\n \"inOrderBook\": true,\n \"cancelledSize\": \"0\",\n \"cancelledFunds\": \"0\",\n \"remainSize\": \"0.00001\",\n \"remainFunds\": \"0.5\",\n \"tax\": \"0\",\n \"active\": true,\n \"createdAt\": 1729235902748,\n \"lastUpdatedAt\": 1729235909862\n }\n ]\n}", + "responseId": 10342, "ordering": 1 } ], @@ -16634,16 +15523,16 @@ "example": "{\n \"symbol\": \"BTC-USDT\",\n \"orderId\": \"670fd33bf9406e0007ab3945\",\n \"newPrice\": \"30000\",\n \"newSize\": \"0.0001\"\n}", "mediaType": "" }, - "description": ":::info[Description]\nRequest via this interface to get a oco order detail via the order ID.\n:::", - "customApiFields": "{\"abandon\":\"abandon\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"General\",\"api-rate-limit-pool\":\"Spot\",\"sdk-service\":\"Spot\",\"sdk-sub-service\":\"Order\",\"sdk-method-name\":\"getOcoOrderDetailByOrderId\",\"sdk-method-description\":\"Request via this interface to get a oco order detail via the order ID.\",\"api-rate-limit\":2}" + "description": ":::info[Description]\nThis interface is to obtain all Spot active order lists, and the return value of the active order interface is the paged data of all uncompleted order lists. The returned data is sorted in descending order according to the latest update time of the order.\n\nAfter the user successfully places an order, the order is in Active state, and the user can use inOrderBook to determine whether the order has entered the order. Canceled or fully filled orders are marked as completed Done status.\n:::\n\n:::tip[Tips]\nFor high-frequency trading users, we recommend locally caching, maintaining your own order records, and using market data streams to update your order information in real time.\n:::", + "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"General\",\"api-rate-limit-pool\":\"Spot\",\"sdk-service\":\"Spot\",\"sdk-sub-service\":\"Order\",\"sdk-method-name\":\"getOpenOrders\",\"sdk-method-description\":\"This interface is to obtain all Spot active order lists, and the return value of the active order interface is the paged data of all uncompleted order lists. The returned data is sorted in descending order according to the latest update time of the order. After the user successfully places an order, the order is in Active state, and the user can use inOrderBook to determine whether the order has entered the order. Canceled or fully filled orders are marked as completed Done status.\",\"api-rate-limit\":2}" } }, { - "name": "Get Order By OrderId", + "name": "Get Closed Orders", "api": { - "id": "3470181", + "id": "3470179", "method": "get", - "path": "/api/v1/hf/orders/{orderId}", + "path": "/api/v1/hf/orders/done", "parameters": { "query": [ { @@ -16662,357 +15551,123 @@ ] }, "enable": true - } - ], - "path": [ + }, { - "id": "orderId#0", - "name": "orderId", - "required": true, - "description": "The unique order id generated by the trading system", - "example": "6717422bd51c29000775ea03", + "id": "sTtMCE9Jhf", + "name": "side", + "required": false, + "description": "specify if the order is to 'buy' or 'sell'", "type": "string", + "schema": { + "type": "string", + "enum": [ + "buy", + "sell" + ], + "x-api-enum": [ + { + "value": "buy", + "name": "", + "description": "" + }, + { + "value": "sell", + "name": "", + "description": "" + } + ] + }, "enable": true - } - ], - "cookie": [], - "header": [] - }, - "responses": [ - { - "id": "10345", - "code": 200, - "name": "OK", - "headers": [], - "jsonSchema": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "data": { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "The unique order id generated by the trading system" - }, - "symbol": { - "type": "string", - "description": "symbol", - "examples": [ - "BTC-USDT", - "ETH-USDT", - "KCS-USDT" - ] - }, - "opType": { - "type": "string" - }, - "type": { - "type": "string", - "description": "Specify if the order is an 'limit' order or 'market' order. ", - "enum": [ - "limit", - "market" - ], - "x-api-enum": [ - { - "value": "limit", - "name": "", - "description": "" - }, - { - "value": "market", - "name": "", - "description": "" - } - ] - }, - "side": { - "type": "string", - "description": "Buy or sell", - "enum": [ - "buy", - "sell" - ], - "x-api-enum": [ - { - "value": "buy", - "name": "", - "description": "" - }, - { - "value": "sell", - "name": "", - "description": "" - } - ] - }, - "price": { - "type": "string", - "description": "Order price" - }, - "size": { - "type": "string", - "description": "Order size" - }, - "funds": { - "type": "string", - "description": "Order Funds" - }, - "dealSize": { - "type": "string", - "description": "Number of filled transactions" - }, - "dealFunds": { - "type": "string", - "description": "Funds of filled transactions" - }, - "fee": { - "type": "string", - "description": "[Handling fees](apidog://link/pages/5327739)" - }, - "feeCurrency": { - "type": "string", - "description": "currency used to calculate trading fee" - }, - "stp": { - "type": "string", - "description": "[Self Trade Prevention](apidog://link/pages/5176570)", - "enum": [ - "DC", - "CO", - "CN", - "CB" - ], - "x-api-enum": [ - { - "value": "DC", - "name": "", - "description": "" - }, - { - "value": "CO", - "name": "", - "description": "" - }, - { - "value": "CN", - "name": "", - "description": "" - }, - { - "value": "CB", - "name": "", - "description": "" - } - ] - }, - "timeInForce": { - "type": "string", - "description": "Time in force", - "enum": [ - "GTC", - "GTT", - "IOC", - "FOK" - ], - "x-api-enum": [ - { - "value": "GTC", - "name": "", - "description": "" - }, - { - "value": "GTT", - "name": "", - "description": "" - }, - { - "value": "IOC", - "name": "", - "description": "" - }, - { - "value": "FOK", - "name": "", - "description": "" - } - ] - }, - "postOnly": { - "type": "boolean", - "description": "Whether its a postOnly order." - }, - "hidden": { - "type": "boolean", - "description": "Whether its a hidden order." - }, - "iceberg": { - "type": "boolean", - "description": "Whether its a iceberg order." - }, - "visibleSize": { - "type": "string", - "description": "Visible size of iceberg order in order book." - }, - "cancelAfter": { - "type": "integer", - "description": "A GTT timeInForce that expires in n seconds" - }, - "channel": { - "type": "string" - }, - "clientOid": { - "type": "string", - "description": "Client Order Id,unique identifier created by the user" - }, - "remark": { - "type": "string", - "description": "Order placement remarks" - }, - "tags": { - "type": "string", - "description": "Order tag" - }, - "cancelExist": { - "type": "boolean", - "description": "Whether there is a cancellation record for the order." - }, - "createdAt": { - "type": "integer", - "format": "int64" - }, - "lastUpdatedAt": { - "type": "integer", - "format": "int64" - }, - "tradeType": { - "type": "string", - "description": "Trade type, redundancy param" - }, - "inOrderBook": { - "type": "boolean", - "description": "Whether to enter the orderbook: true: enter the orderbook; false: not enter the orderbook" - }, - "cancelledSize": { - "type": "string", - "description": "Number of canceled transactions" - }, - "cancelledFunds": { - "type": "string", - "description": "Funds of canceled transactions" - }, - "remainSize": { - "type": "string", - "description": "Number of remain transactions" - }, - "remainFunds": { - "type": "string", - "description": "Funds of remain transactions" - }, - "tax": { - "type": "string", - "description": "Users in some regions need query this field" - }, - "active": { - "type": "boolean", - "description": "Order status: true-The status of the order isactive; false-The status of the order is done" - } + }, + { + "id": "QaBSxyasEm", + "name": "type", + "required": false, + "description": "specify if the order is an 'limit' order or 'market' order. ", + "type": "string", + "schema": { + "type": "string", + "enum": [ + "limit", + "market" + ], + "x-api-enum": [ + { + "value": "limit", + "name": "", + "description": "" }, - "required": [ - "id", - "symbol", - "opType", - "type", - "side", - "price", - "size", - "funds", - "dealSize", - "dealFunds", - "fee", - "feeCurrency", - "timeInForce", - "postOnly", - "hidden", - "iceberg", - "visibleSize", - "cancelAfter", - "channel", - "clientOid", - "cancelExist", - "tradeType", - "inOrderBook", - "cancelledSize", - "cancelledFunds", - "remainSize", - "remainFunds", - "active", - "createdAt", - "lastUpdatedAt", - "tax" - ] - } + { + "value": "market", + "name": "", + "description": "" + } + ] }, - "required": [ - "code", - "data" - ] + "enable": true }, - "description": "", - "contentType": "json", - "mediaType": "" - } - ], - "responseExamples": [ - { - "name": "Success", - "data": "{\n \"code\": \"200000\",\n \"data\": {\n \"id\": \"6717422bd51c29000775ea03\",\n \"clientOid\": \"5c52e11203aa677f33e493fb\",\n \"symbol\": \"BTC-USDT\",\n \"opType\": \"DEAL\",\n \"type\": \"limit\",\n \"side\": \"buy\",\n \"price\": \"70000\",\n \"size\": \"0.00001\",\n \"funds\": \"0.7\",\n \"dealSize\": \"0.00001\",\n \"dealFunds\": \"0.677176\",\n \"remainSize\": \"0\",\n \"remainFunds\": \"0.022824\",\n \"cancelledSize\": \"0\",\n \"cancelledFunds\": \"0\",\n \"fee\": \"0.000677176\",\n \"feeCurrency\": \"USDT\",\n \"stp\": null,\n \"timeInForce\": \"GTC\",\n \"postOnly\": false,\n \"hidden\": false,\n \"iceberg\": false,\n \"visibleSize\": \"0\",\n \"cancelAfter\": 0,\n \"channel\": \"API\",\n \"remark\": \"order remarks\",\n \"tags\": null,\n \"cancelExist\": false,\n \"tradeType\": \"TRADE\",\n \"inOrderBook\": false,\n \"active\": false,\n \"tax\": \"0\",\n \"createdAt\": 1729577515444,\n \"lastUpdatedAt\": 1729577515481\n }\n}", - "responseId": 10345, - "ordering": 1 - } - ], - "requestBody": { - "type": "none", - "parameters": [], - "jsonSchema": { - "type": "object", - "properties": {} - }, - "example": "{\n \"symbol\": \"BTC-USDT\",\n \"orderId\": \"670fd33bf9406e0007ab3945\",\n \"newPrice\": \"30000\",\n \"newSize\": \"0.0001\"\n}", - "mediaType": "" - }, - "description": ":::info[Description]\nThis endpoint can be used to obtain information for a single Spot order using the order id.\n\nAfter the user successfully places an order, the order is in Active state, and the user can use inOrderBook to determine whether the order has entered the order. Canceled or fully filled orders are marked as completed Done status.\n:::\n\n:::tip[Tips]\nIf the order is not an active order, you can only get data within the time range of 3 _ 24 hours (ie: from the current time to 3 _ 24 hours ago). If the time range is exceeded, the system will query the data within the time range of 3 * 24 hours by default.\n:::", - "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"General\",\"api-rate-limit-pool\":\"Spot\",\"sdk-service\":\"Spot\",\"sdk-sub-service\":\"Order\",\"sdk-method-name\":\"getOrderByOrderId\",\"sdk-method-description\":\"This endpoint can be used to obtain information for a single Spot order using the order id. After the user successfully places an order, the order is in Active state, and the user can use inOrderBook to determine whether the order has entered the order. Canceled or fully filled orders are marked as completed Done status.\",\"api-rate-limit\":2}" - } - }, - { - "name": "Get OCO Order By ClientOid", - "api": { - "id": "3470358", - "method": "get", - "path": "/api/v3/oco/client-order/{clientOid}", - "parameters": { - "query": [], - "path": [ { - "id": "clientOid#0", - "name": "clientOid", - "required": true, - "description": "Client Order Id,unique identifier created by the user", - "type": "string", - "enable": true, - "example": "5c52e1203aa6f3g7f1e493fb" + "id": "kkvuIGVxs6", + "name": "lastId", + "required": false, + "description": "The id of the last set of data from the previous batch of data. By default, the latest information is given.\nlastId is used to filter data and paginate. If lastId is not entered, the default is a maximum of 100 returned data items. The return results include lastId,which can be used as a query parameter to look up new data from the next page.", + "example": "254062248624417", + "type": "integer", + "schema": { + "type": "integer", + "format": "int64" + }, + "enable": true + }, + { + "id": "heQ8W6yKwm", + "name": "limit", + "required": false, + "description": "Default20,Max100", + "example": "20", + "type": "integer", + "schema": { + "type": "integer", + "default": 20, + "minimum": 1, + "maximum": 100 + }, + "enable": true + }, + { + "id": "Djtx6oC9gm", + "name": "startAt", + "required": false, + "description": "Start time (milisecond)", + "example": "1728663338000", + "type": "integer", + "schema": { + "type": "integer", + "format": "int64" + }, + "enable": true + }, + { + "id": "K9IMpKw8u2", + "name": "endAt", + "required": false, + "description": "End time (milisecond)", + "example": "1728692138000", + "type": "integer", + "schema": { + "type": "integer", + "format": "int64" + }, + "enable": true } ], + "path": [], "cookie": [], "header": [] }, "responses": [ { - "id": "10580", + "id": "10343", "code": 200, "name": "OK", "headers": [], @@ -17025,34 +15680,283 @@ "data": { "type": "object", "properties": { - "symbol": { - "type": "string", - "description": "symbol" - }, - "clientOid": { - "type": "string", - "description": "Client Order Id" - }, - "orderId": { - "type": "string", - "description": "The unique order id generated by the trading system,which can be used later for further actions such as canceling the order." - }, - "orderTime": { + "lastId": { "type": "integer", - "description": "Order placement time, milliseconds", + "description": "The id of the last set of data from the previous batch of data. By default, the latest information is given.\nlastId is used to filter data and paginate. If lastId is not entered, the default is a maximum of 100 returned data items. The return results include lastId,which can be used as a query parameter to look up new data from the next page.", "format": "int64" }, - "status": { - "type": "string", - "description": "Order status: NEW: New, DONE: Completed, TRIGGERED: Triggered, CANCELLED: Cancelled" + "items": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The unique order id generated by the trading system" + }, + "symbol": { + "type": "string", + "description": "symbol", + "examples": [ + "BTC-USDT", + "ETH-USDT", + "KCS-USDT" + ] + }, + "opType": { + "type": "string" + }, + "type": { + "type": "string", + "description": "Specify if the order is an 'limit' order or 'market' order. ", + "enum": [ + "limit", + "market" + ], + "x-api-enum": [ + { + "value": "limit", + "name": "", + "description": "" + }, + { + "value": "market", + "name": "", + "description": "" + } + ] + }, + "side": { + "type": "string", + "description": "Buy or sell", + "enum": [ + "buy", + "sell" + ], + "x-api-enum": [ + { + "value": "buy", + "name": "", + "description": "" + }, + { + "value": "sell", + "name": "", + "description": "" + } + ] + }, + "price": { + "type": "string", + "description": "Order price" + }, + "size": { + "type": "string", + "description": "Order size" + }, + "funds": { + "type": "string", + "description": "Order Funds" + }, + "dealSize": { + "type": "string", + "description": "Number of filled transactions" + }, + "dealFunds": { + "type": "string", + "description": "Funds of filled transactions" + }, + "fee": { + "type": "string", + "description": "[Handling fees](apidog://link/pages/5327739)" + }, + "feeCurrency": { + "type": "string", + "description": "currency used to calculate trading fee" + }, + "stp": { + "type": "string", + "description": "[Self Trade Prevention](apidog://link/pages/5176570)", + "enum": [ + "DC", + "CO", + "CN", + "CB" + ], + "x-api-enum": [ + { + "value": "DC", + "name": "", + "description": "" + }, + { + "value": "CO", + "name": "", + "description": "" + }, + { + "value": "CN", + "name": "", + "description": "" + }, + { + "value": "CB", + "name": "", + "description": "" + } + ] + }, + "timeInForce": { + "type": "string", + "description": "Time in force", + "enum": [ + "GTC", + "GTT", + "IOC", + "FOK" + ], + "x-api-enum": [ + { + "value": "GTC", + "name": "", + "description": "" + }, + { + "value": "GTT", + "name": "", + "description": "" + }, + { + "value": "IOC", + "name": "", + "description": "" + }, + { + "value": "FOK", + "name": "", + "description": "" + } + ] + }, + "postOnly": { + "type": "boolean", + "description": "Whether its a postOnly order." + }, + "hidden": { + "type": "boolean", + "description": "Whether its a hidden order." + }, + "iceberg": { + "type": "boolean", + "description": "Whether its a iceberg order." + }, + "visibleSize": { + "type": "string", + "description": "Visible size of iceberg order in order book." + }, + "cancelAfter": { + "type": "integer", + "description": "A GTT timeInForce that expires in n seconds" + }, + "channel": { + "type": "string" + }, + "clientOid": { + "type": "string", + "description": "Client Order Id,unique identifier created by the user" + }, + "remark": { + "type": "string", + "description": "Order placement remarks" + }, + "tags": { + "type": "string", + "description": "Order tag" + }, + "cancelExist": { + "type": "boolean", + "description": "Whether there is a cancellation record for the order." + }, + "createdAt": { + "type": "integer", + "format": "int64" + }, + "lastUpdatedAt": { + "type": "integer", + "format": "int64" + }, + "tradeType": { + "type": "string", + "description": "Trade type, redundancy param" + }, + "inOrderBook": { + "type": "boolean", + "description": "Whether to enter the orderbook: true: enter the orderbook; false: not enter the orderbook" + }, + "cancelledSize": { + "type": "string", + "description": "Number of canceled transactions" + }, + "cancelledFunds": { + "type": "string", + "description": "Funds of canceled transactions" + }, + "remainSize": { + "type": "string", + "description": "Number of remain transactions" + }, + "remainFunds": { + "type": "string", + "description": "Funds of remain transactions" + }, + "tax": { + "type": "string", + "description": "Users in some regions need query this field" + }, + "active": { + "type": "boolean", + "description": "Order status: true-The status of the order isactive; false-The status of the order is done" + } + }, + "required": [ + "feeCurrency", + "id", + "symbol", + "opType", + "type", + "side", + "price", + "size", + "funds", + "dealSize", + "fee", + "timeInForce", + "dealFunds", + "clientOid", + "remainSize", + "remainFunds", + "cancelledSize", + "cancelledFunds", + "lastUpdatedAt", + "createdAt", + "tax", + "active", + "cancelExist", + "tradeType", + "inOrderBook", + "postOnly", + "hidden", + "iceberg", + "visibleSize", + "cancelAfter", + "channel" + ] + } } }, "required": [ - "orderId", - "symbol", - "clientOid", - "orderTime", - "status" + "lastId", + "items" ] } }, @@ -17069,8 +15973,8 @@ "responseExamples": [ { "name": "Success", - "data": "{\r\n \"code\": \"200000\",\r\n \"data\": {\r\n \"orderId\": \"674c3cfa72cf2800072ee7ce\",\r\n \"symbol\": \"BTC-USDT\",\r\n \"clientOid\": \"5c52e1203aa6f3g7f1e493fb\",\r\n \"orderTime\": 1733049594803,\r\n \"status\": \"NEW\"\r\n }\r\n}", - "responseId": 10580, + "data": "{\n \"code\": \"200000\",\n \"data\": {\n \"lastId\": 19814995255305,\n \"items\": [\n {\n \"id\": \"6717422bd51c29000775ea03\",\n \"clientOid\": \"5c52e11203aa677f33e493fb\",\n \"symbol\": \"BTC-USDT\",\n \"opType\": \"DEAL\",\n \"type\": \"limit\",\n \"side\": \"buy\",\n \"price\": \"70000\",\n \"size\": \"0.00001\",\n \"funds\": \"0.7\",\n \"dealSize\": \"0.00001\",\n \"dealFunds\": \"0.677176\",\n \"remainSize\": \"0\",\n \"remainFunds\": \"0.022824\",\n \"cancelledSize\": \"0\",\n \"cancelledFunds\": \"0\",\n \"fee\": \"0.000677176\",\n \"feeCurrency\": \"USDT\",\n \"stp\": null,\n \"timeInForce\": \"GTC\",\n \"postOnly\": false,\n \"hidden\": false,\n \"iceberg\": false,\n \"visibleSize\": \"0\",\n \"cancelAfter\": 0,\n \"channel\": \"API\",\n \"remark\": \"order remarks\",\n \"tags\": null,\n \"cancelExist\": false,\n \"tradeType\": \"TRADE\",\n \"inOrderBook\": false,\n \"active\": false,\n \"tax\": \"0\",\n \"createdAt\": 1729577515444,\n \"lastUpdatedAt\": 1729577515481\n }\n ]\n }\n}", + "responseId": 10343, "ordering": 1 } ], @@ -17084,53 +15988,159 @@ "example": "{\n \"symbol\": \"BTC-USDT\",\n \"orderId\": \"670fd33bf9406e0007ab3945\",\n \"newPrice\": \"30000\",\n \"newSize\": \"0.0001\"\n}", "mediaType": "" }, - "description": ":::info[Description]\nRequest via this interface to get a oco order information via the client order ID.\n:::", - "customApiFields": "{\"abandon\":\"abandon\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"General\",\"api-rate-limit-pool\":\"Spot\",\"sdk-service\":\"Spot\",\"sdk-sub-service\":\"Order\",\"sdk-method-name\":\"getOcoOrderByClientOid\",\"sdk-method-description\":\"Request via this interface to get a oco order information via the client order ID.\",\"api-rate-limit\":2}" + "description": ":::info[Description]\nThis interface is to obtain all Spot Closed order lists, and the return value of the active order interface is the paged data of all uncompleted order lists. The returned data is sorted in descending order according to the latest update time of the order.\n\nAfter the user successfully places an order, the order is in Active state, and the user can use inOrderBook to determine whether the order has entered the order. Canceled or fully filled orders are marked as completed Done status.\n:::\n\n:::tip[Tips]\nIf the order is not an active order, you can only get data within the time range of 3 _ 24 hours (ie: from the current time to 3 _ 24 hours ago). If the time range is exceeded, the system will query the data within the time range of 3 * 24 hours by default.\n:::", + "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"General\",\"api-rate-limit-pool\":\"Spot\",\"sdk-service\":\"Spot\",\"sdk-sub-service\":\"Order\",\"sdk-method-name\":\"getClosedOrders\",\"sdk-method-description\":\"This interface is to obtain all Spot closed order lists, and the return value of the active order interface is the paged data of all uncompleted order lists. The returned data is sorted in descending order according to the latest update time of the order. After the user successfully places an order, the order is in Active state, and the user can use inOrderBook to determine whether the order has entered the order. Canceled or fully filled orders are marked as completed Done status.\",\"api-rate-limit\":2}" } }, { - "name": "Get Order By ClientOid", + "name": "Get Trade History", "api": { - "id": "3470182", + "id": "3470180", "method": "get", - "path": "/api/v1/hf/orders/client-order/{clientOid}", + "path": "/api/v1/hf/fills", "parameters": { "query": [ { - "id": "M9bgPS6vOj", - "name": "symbol", - "required": true, - "description": "symbol", - "example": "BTC-USDT", - "type": "string", + "id": "M9bgPS6vOj", + "name": "symbol", + "required": true, + "description": "symbol", + "example": "BTC-USDT", + "type": "string", + "schema": { + "type": "string", + "examples": [ + "BTC-USDT", + "ETH-USDT", + "KCS-USDT" + ] + }, + "enable": true + }, + { + "id": "Bc6ZDrZFdp", + "name": "orderId", + "required": false, + "description": "The unique order id generated by the trading system\n(If orderId is specified,please ignore the other query parameters)", + "type": "string", + "enable": true + }, + { + "id": "sTtMCE9Jhf", + "name": "side", + "required": false, + "description": "specify if the order is to 'buy' or 'sell'", + "type": "string", + "schema": { + "type": "string", + "enum": [ + "buy", + "sell" + ], + "x-api-enum": [ + { + "value": "buy", + "name": "", + "description": "" + }, + { + "value": "sell", + "name": "", + "description": "" + } + ] + }, + "enable": true + }, + { + "id": "QaBSxyasEm", + "name": "type", + "required": false, + "description": "specify if the order is an 'limit' order or 'market' order. ", + "type": "string", + "schema": { + "type": "string", + "enum": [ + "limit", + "market" + ], + "x-api-enum": [ + { + "value": "limit", + "name": "", + "description": "" + }, + { + "value": "market", + "name": "", + "description": "" + } + ] + }, + "enable": true + }, + { + "id": "kkvuIGVxs6", + "name": "lastId", + "required": false, + "description": "The id of the last set of data from the previous batch of data. By default, the latest information is given.\nlastId is used to filter data and paginate. If lastId is not entered, the default is a maximum of 100 returned data items. The return results include lastId,which can be used as a query parameter to look up new data from the next page.", + "example": "254062248624417", + "type": "integer", + "schema": { + "type": "integer", + "format": "int64" + }, + "enable": true + }, + { + "id": "heQ8W6yKwm", + "name": "limit", + "required": false, + "description": "Default20,Max100", + "example": "100", + "type": "integer", + "schema": { + "type": "integer", + "default": 20, + "minimum": 1, + "maximum": 100 + }, + "enable": true + }, + { + "id": "Djtx6oC9gm", + "name": "startAt", + "required": false, + "description": "Start time (milisecond)", + "example": "1728663338000", + "type": "integer", "schema": { - "type": "string", - "examples": [ - "BTC-USDT", - "ETH-USDT", - "KCS-USDT" - ] + "type": "integer", + "format": "int64" }, "enable": true - } - ], - "path": [ + }, { - "id": "clientOid#0", - "name": "clientOid", - "required": true, - "description": "Client Order Id,unique identifier created by the user", - "example": "5c52e11203aa677f33e493fb", - "type": "string", + "id": "K9IMpKw8u2", + "name": "endAt", + "required": false, + "description": "End time (milisecond)", + "example": "1728692138000", + "type": "integer", + "schema": { + "type": "integer", + "format": "int64" + }, "enable": true } ], + "path": [], "cookie": [], "header": [] }, "responses": [ { - "id": "10346", + "id": "10344", "code": 200, "name": "OK", "headers": [], @@ -17143,266 +16153,179 @@ "data": { "type": "object", "properties": { - "id": { - "type": "string", - "description": "The unique order id generated by the trading system" - }, - "symbol": { - "type": "string", - "description": "symbol", - "examples": [ - "BTC-USDT", - "ETH-USDT", - "KCS-USDT" - ] - }, - "opType": { - "type": "string" - }, - "type": { - "type": "string", - "description": "Specify if the order is an 'limit' order or 'market' order. ", - "enum": [ - "limit", - "market" - ], - "x-api-enum": [ - { - "value": "limit", - "name": "", - "description": "" - }, - { - "value": "market", - "name": "", - "description": "" - } - ] - }, - "side": { - "type": "string", - "description": "Buy or sell", - "enum": [ - "buy", - "sell" - ], - "x-api-enum": [ - { - "value": "buy", - "name": "", - "description": "" - }, - { - "value": "sell", - "name": "", - "description": "" - } - ] - }, - "price": { - "type": "string", - "description": "Order price" - }, - "size": { - "type": "string", - "description": "Order size" - }, - "funds": { - "type": "string", - "description": "Order Funds" - }, - "dealSize": { - "type": "string", - "description": "Number of filled transactions" - }, - "dealFunds": { - "type": "string", - "description": "Funds of filled transactions" - }, - "fee": { - "type": "string", - "description": "[Handling fees](apidog://link/pages/5327739)" - }, - "feeCurrency": { - "type": "string", - "description": "currency used to calculate trading fee" - }, - "stp": { - "type": "string", - "description": "[Self Trade Prevention](apidog://link/pages/5176570)", - "enum": [ - "DC", - "CO", - "CN", - "CB" - ], - "x-api-enum": [ - { - "value": "DC", - "name": "", - "description": "" - }, - { - "value": "CO", - "name": "", - "description": "" - }, - { - "value": "CN", - "name": "", - "description": "" - }, - { - "value": "CB", - "name": "", - "description": "" - } - ] - }, - "timeInForce": { - "type": "string", - "description": "Time in force", - "enum": [ - "GTC", - "GTT", - "IOC", - "FOK" - ], - "x-api-enum": [ - { - "value": "GTC", - "name": "", - "description": "" - }, - { - "value": "GTT", - "name": "", - "description": "" - }, - { - "value": "IOC", - "name": "", - "description": "" + "items": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "description": "Id of transaction detail", + "format": "int64" + }, + "symbol": { + "type": "string", + "description": "symbol", + "examples": [ + "BTC-USDT", + "ETH-USDT", + "KCS-USDT" + ] + }, + "tradeId": { + "type": "integer", + "description": "Trade Id, symbol latitude increment", + "format": "int64" + }, + "orderId": { + "type": "string", + "description": "The unique order id generated by the trading system" + }, + "counterOrderId": { + "type": "string", + "description": "Counterparty order Id" + }, + "side": { + "type": "string", + "description": "Buy or sell", + "enum": [ + "buy", + "sell" + ], + "x-api-enum": [ + { + "value": "buy", + "name": "", + "description": "" + }, + { + "value": "sell", + "name": "", + "description": "" + } + ] + }, + "liquidity": { + "type": "string", + "description": "Liquidity type: taker or maker", + "enum": [ + "taker", + "maker" + ], + "x-api-enum": [ + { + "value": "taker", + "name": "", + "description": "" + }, + { + "value": "maker", + "name": "", + "description": "" + } + ] + }, + "forceTaker": { + "type": "boolean" + }, + "price": { + "type": "string", + "description": "Order price" + }, + "size": { + "type": "string", + "description": "Order size" + }, + "funds": { + "type": "string", + "description": "Order Funds" + }, + "fee": { + "type": "string", + "description": "[Handling fees](apidog://link/pages/5327739)" + }, + "feeRate": { + "type": "string", + "description": "Fee rate\n" + }, + "feeCurrency": { + "type": "string", + "description": "currency used to calculate trading fee" + }, + "stop": { + "type": "string", + "description": "Take Profit and Stop Loss type, currently HFT does not support the Take Profit and Stop Loss type, so it is empty" + }, + "tradeType": { + "type": "string", + "description": "Trade type, redundancy param" + }, + "taxRate": { + "type": "string", + "description": "Tax Rate, Users in some regions need query this field" + }, + "tax": { + "type": "string", + "description": "Users in some regions need query this field" + }, + "type": { + "type": "string", + "description": "Specify if the order is an 'limit' order or 'market' order. ", + "enum": [ + "limit", + "market" + ], + "x-api-enum": [ + { + "value": "limit", + "name": "", + "description": "" + }, + { + "value": "market", + "name": "", + "description": "" + } + ] + }, + "createdAt": { + "type": "integer", + "format": "int64" + } }, - { - "value": "FOK", - "name": "", - "description": "" - } - ] - }, - "postOnly": { - "type": "boolean", - "description": "Whether its a postOnly order." - }, - "hidden": { - "type": "boolean", - "description": "Whether its a hidden order." - }, - "iceberg": { - "type": "boolean", - "description": "Whether its a iceberg order." - }, - "visibleSize": { - "type": "string", - "description": "Visible size of iceberg order in order book." - }, - "cancelAfter": { - "type": "integer", - "description": "A GTT timeInForce that expires in n seconds" - }, - "channel": { - "type": "string" - }, - "clientOid": { - "type": "string", - "description": "Client Order Id,unique identifier created by the user" - }, - "remark": { - "type": "string", - "description": "Order placement remarks" - }, - "tags": { - "type": "string", - "description": "Order tag" - }, - "cancelExist": { - "type": "boolean", - "description": "Whether there is a cancellation record for the order." - }, - "createdAt": { - "type": "integer", - "format": "int64" + "required": [ + "id", + "symbol", + "tradeId", + "orderId", + "counterOrderId", + "side", + "liquidity", + "forceTaker", + "price", + "size", + "funds", + "fee", + "feeRate", + "feeCurrency", + "stop", + "tradeType", + "taxRate", + "tax", + "type", + "createdAt" + ] + } }, - "lastUpdatedAt": { + "lastId": { "type": "integer", + "description": "The id of the last set of data from the previous batch of data. By default, the latest information is given.\nlastId is used to filter data and paginate. If lastId is not entered, the default is a maximum of 100 returned data items. The return results include lastId,which can be used as a query parameter to look up new data from the next page.", "format": "int64" - }, - "tradeType": { - "type": "string", - "description": "Trade type, redundancy param" - }, - "inOrderBook": { - "type": "boolean", - "description": "Whether to enter the orderbook: true: enter the orderbook; false: not enter the orderbook" - }, - "cancelledSize": { - "type": "string", - "description": "Number of canceled transactions" - }, - "cancelledFunds": { - "type": "string", - "description": "Funds of canceled transactions" - }, - "remainSize": { - "type": "string", - "description": "Number of remain transactions" - }, - "remainFunds": { - "type": "string", - "description": "Funds of remain transactions" - }, - "tax": { - "type": "string", - "description": "Users in some regions need query this field" - }, - "active": { - "type": "boolean", - "description": "Order status: true-The status of the order isactive; false-The status of the order is done" } }, "required": [ - "id", - "symbol", - "opType", - "type", - "side", - "price", - "size", - "funds", - "dealSize", - "dealFunds", - "fee", - "feeCurrency", - "timeInForce", - "postOnly", - "hidden", - "iceberg", - "visibleSize", - "cancelAfter", - "channel", - "clientOid", - "cancelExist", - "tradeType", - "inOrderBook", - "cancelledSize", - "cancelledFunds", - "remainSize", - "remainFunds", - "active", - "createdAt", - "lastUpdatedAt", - "tax" + "items", + "lastId" ] } }, @@ -17419,8 +16342,8 @@ "responseExamples": [ { "name": "Success", - "data": "{\n \"code\": \"200000\",\n \"data\": {\n \"id\": \"6717422bd51c29000775ea03\",\n \"clientOid\": \"5c52e11203aa677f33e493fb\",\n \"symbol\": \"BTC-USDT\",\n \"opType\": \"DEAL\",\n \"type\": \"limit\",\n \"side\": \"buy\",\n \"price\": \"70000\",\n \"size\": \"0.00001\",\n \"funds\": \"0.7\",\n \"dealSize\": \"0.00001\",\n \"dealFunds\": \"0.677176\",\n \"remainSize\": \"0\",\n \"remainFunds\": \"0.022824\",\n \"cancelledSize\": \"0\",\n \"cancelledFunds\": \"0\",\n \"fee\": \"0.000677176\",\n \"feeCurrency\": \"USDT\",\n \"stp\": null,\n \"timeInForce\": \"GTC\",\n \"postOnly\": false,\n \"hidden\": false,\n \"iceberg\": false,\n \"visibleSize\": \"0\",\n \"cancelAfter\": 0,\n \"channel\": \"API\",\n \"remark\": \"order remarks\",\n \"tags\": null,\n \"cancelExist\": false,\n \"tradeType\": \"TRADE\",\n \"inOrderBook\": false,\n \"active\": false,\n \"tax\": \"0\",\n \"createdAt\": 1729577515444,\n \"lastUpdatedAt\": 1729577515481\n }\n}", - "responseId": 10346, + "data": "{\n \"code\": \"200000\",\n \"data\": {\n \"items\": [\n {\n \"id\": 19814995255305,\n \"orderId\": \"6717422bd51c29000775ea03\",\n \"counterOrderId\": \"67174228135f9e000709da8c\",\n \"tradeId\": 11029373945659392,\n \"symbol\": \"BTC-USDT\",\n \"side\": \"buy\",\n \"liquidity\": \"taker\",\n \"type\": \"limit\",\n \"forceTaker\": false,\n \"price\": \"67717.6\",\n \"size\": \"0.00001\",\n \"funds\": \"0.677176\",\n \"fee\": \"0.000677176\",\n \"feeRate\": \"0.001\",\n \"feeCurrency\": \"USDT\",\n \"stop\": \"\",\n \"tradeType\": \"TRADE\",\n \"taxRate\": \"0\",\n \"tax\": \"0\",\n \"createdAt\": 1729577515473\n }\n ],\n \"lastId\": 19814995255305\n }\n}", + "responseId": 10344, "ordering": 1 } ], @@ -17434,35 +16357,25 @@ "example": "{\n \"symbol\": \"BTC-USDT\",\n \"orderId\": \"670fd33bf9406e0007ab3945\",\n \"newPrice\": \"30000\",\n \"newSize\": \"0.0001\"\n}", "mediaType": "" }, - "description": ":::info[Description]\nThis endpoint can be used to obtain information for a single Spot order using the client order id.\n\nAfter the user successfully places an order, the order is in Active state, and the user can use inOrderBook to determine whether the order has entered the order. Canceled or fully filled orders are marked as completed Done status.\n:::\n\n:::tip[Tips]\nIf the order is not an active order, you can only get data within the time range of 3 _ 24 hours (ie: from the current time to 3 _ 24 hours ago). If the time range is exceeded, the system will query the data within the time range of 3 * 24 hours by default.\n:::", - "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"General\",\"api-rate-limit-pool\":\"Spot\",\"sdk-service\":\"Spot\",\"sdk-sub-service\":\"Order\",\"sdk-method-name\":\"getOrderByClientOid\",\"sdk-method-description\":\"This endpoint can be used to obtain information for a single Spot order using the client order id. After the user successfully places an order, the order is in Active state, and the user can use inOrderBook to determine whether the order has entered the order. Canceled or fully filled orders are marked as completed Done status.\",\"api-rate-limit\":2}" + "description": ":::info[Description]\nThis endpoint can be used to obtain a list of the latest Spot transaction details. \nThe returned data is sorted in descending order according to the latest update time of the order.\n:::\n\n:::tip[Tips]\nIf the order is not an active order, you can only get data within the time range of 3 _ 24 hours (ie: from the current time to 3 _ 24 hours ago). If the time range is exceeded, the system will query the data within the time range of 3 * 24 hours by default.\n:::", + "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"General\",\"api-rate-limit-pool\":\"Spot\",\"sdk-service\":\"Spot\",\"sdk-sub-service\":\"Order\",\"sdk-method-name\":\"getTradeHistory\",\"sdk-method-description\":\"This endpoint can be used to obtain a list of the latest Spot transaction details. The returned data is sorted in descending order according to the latest update time of the order.\",\"api-rate-limit\":2}" } }, { - "name": "Cancel OCO Order By ClientOid", + "name": "Get DCP", "api": { - "id": "3470355", - "method": "delete", - "path": "/api/v3/oco/client-order/{clientOid}", + "id": "3470172", + "method": "get", + "path": "/api/v1/hf/orders/dead-cancel-all/query", "parameters": { + "path": [], "query": [], - "path": [ - { - "id": "clientOid#0", - "name": "clientOid", - "required": true, - "description": "Client Order Id,unique identifier created by the user", - "type": "string", - "enable": true, - "example": "5c52e11203aa67f1e493fb" - } - ], "cookie": [], "header": [] }, "responses": [ { - "id": "10578", + "id": "10336", "code": 200, "name": "OK", "headers": [], @@ -17471,21 +16384,29 @@ "properties": { "code": { "type": "string" - }, - "data": { - "type": "object", - "properties": { - "cancelledOrderIds": { - "type": "array", - "items": { - "type": "string" - }, - "description": "List of two order IDs related to the canceled OCO order" + }, + "data": { + "type": "object", + "properties": { + "timeout": { + "type": "integer", + "description": "Auto cancel order trigger setting time, the unit is second. range: timeout=-1 (meaning unset) or 5 <= timeout <= 86400" + }, + "symbols": { + "type": "string", + "description": "List of trading pairs. Separated by commas, empty means all trading pairs" + }, + "currentTime": { + "type": "integer", + "description": "System current time (in seconds)" + }, + "triggerTime": { + "type": "integer", + "description": "Trigger cancellation time (in seconds)" } }, - "required": [ - "cancelledOrderIds" - ] + "description": "If the data is empty, it means that DCP is not set.", + "additionalProperties": false } }, "required": [ @@ -17501,8 +16422,8 @@ "responseExamples": [ { "name": "Success", - "data": "{\r\n \"code\": \"200000\",\r\n \"data\": {\r\n \"cancelledOrderIds\": [\r\n \"vs93gpqc6r0mkk57003gok3h\",\r\n \"vs93gpqc6r0mkk57003gok3i\"\r\n ]\r\n }\r\n}", - "responseId": 10578, + "data": "{\n \"code\": \"200000\",\n \"data\": {\n \"timeout\": 5,\n \"symbols\": \"BTC-USDT,ETH-USDT\",\n \"currentTime\": 1729241305,\n \"triggerTime\": 1729241308\n }\n}", + "responseId": 10336, "ordering": 1 } ], @@ -17513,62 +16434,28 @@ "type": "object", "properties": {} }, - "example": "{\n \"symbol\": \"BTC-USDT\",\n \"orderId\": \"670fd33bf9406e0007ab3945\",\n \"newPrice\": \"30000\",\n \"newSize\": \"0.0001\"\n}", + "example": "{\n \"timeout\": 5,\n \"symbols\": \"BTC-USDT,ETH-USDT\"\n}", "mediaType": "" }, - "description": ":::info[Description]\nRequest via this interface to cancel a stop order via the clientOid.\n\nYou will receive cancelledOrderIds field once the system has received the cancellation request. The cancellation request will be processed by the matching engine in sequence. To know if the request is processed (successfully or not), you may check the order status or the update message from the pushes.\n:::", - "customApiFields": "{\"abandon\":\"abandon\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"Spot\",\"api-rate-limit-pool\":\"Spot\",\"sdk-service\":\"Spot\",\"sdk-sub-service\":\"Order\",\"sdk-method-name\":\"cancelOcoOrderByClientOid\",\"sdk-method-description\":\"Request via this interface to cancel a stop order via the clientOid. You will receive cancelledOrderIds field once the system has received the cancellation request. The cancellation request will be processed by the matching engine in sequence. To know if the request is processed (successfully or not), you may check the order status or the update message from the pushes.\",\"api-rate-limit\":3}" + "description": ":::info[Description]\nGet Disconnection Protect(Deadman Swich)Through this interface, you can query the settings of automatic order cancellation\n:::", + "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"Spot\",\"api-rate-limit-pool\":\"Spot\",\"sdk-service\":\"Spot\",\"sdk-sub-service\":\"Order\",\"sdk-method-name\":\"getDCP\",\"sdk-method-description\":\"Get Disconnection Protect(Deadman Swich)Through this interface, you can query the settings of automatic order cancellation\",\"api-rate-limit\":2}" } }, { - "name": "Cancel Partial Order", + "name": "Set DCP", "api": { - "id": "3470183", - "method": "delete", - "path": "/api/v1/hf/orders/cancel/{orderId}", + "id": "3470173", + "method": "post", + "path": "/api/v1/hf/orders/dead-cancel-all", "parameters": { - "path": [ - { - "id": "orderId#0", - "name": "orderId", - "required": true, - "description": "The unique order id generated by the trading system", - "example": "6711f73c1ef16c000717bb31", - "type": "string" - } - ], - "query": [ - { - "id": "KXIxHhD4qw", - "name": "symbol", - "required": true, - "description": "symbol", - "example": "BTC-USDT", - "type": "string", - "schema": { - "type": "string", - "examples": [ - "BTC-USDT", - "ETH-USDT", - "KCS-USDT" - ] - } - }, - { - "id": "QDkiklGpjc", - "name": "cancelSize", - "required": true, - "description": "The size you want cancel", - "example": "0.00001", - "type": "string" - } - ], + "query": [], + "path": [], "cookie": [], "header": [] }, "responses": [ { - "id": "10347", + "id": "10337", "code": 200, "name": "OK", "headers": [], @@ -17581,19 +16468,20 @@ "data": { "type": "object", "properties": { - "orderId": { - "type": "string", - "description": "order id" + "currentTime": { + "type": "integer", + "description": "System current time (in seconds)" }, - "cancelSize": { - "type": "string", - "description": "The size you canceled" + "triggerTime": { + "type": "integer", + "description": "Trigger cancellation time (in seconds)" } }, "required": [ - "orderId", - "cancelSize" - ] + "currentTime", + "triggerTime" + ], + "description": "If the data is empty, it means that DCP is not set." } }, "required": [ @@ -17609,66 +16497,55 @@ "responseExamples": [ { "name": "Success", - "data": "{\n \"code\": \"200000\",\n \"data\": {\n \"orderId\": \"6711f73c1ef16c000717bb31\",\n \"cancelSize\": \"0.00001\"\n }\n}", - "responseId": 10347, + "data": "{\"code\":\"200000\",\"data\":{\"currentTime\":1729656588,\"triggerTime\":1729656593}}", + "responseId": 10337, "ordering": 1 } ], "requestBody": { - "type": "none", + "type": "application/json", "parameters": [], "jsonSchema": { "type": "object", - "properties": {} + "properties": { + "timeout": { + "type": "integer", + "description": "Auto cancel order trigger setting time, the unit is second. range: timeout=-1 (meaning unset) or 5 <= timeout <= 86400. For example, timeout=5 means that the order will be automatically canceled if no user request is received for more than 5 seconds. When this parameter is changed, the previous setting will be overwritten." + }, + "symbols": { + "type": "string", + "description": "List of trading pairs. When this parameter is not empty, separate it with commas and support up to 50 trading pairs. Empty means all trading pairs. When this parameter is changed, the previous setting will be overwritten.", + "examples": [ + "BTC-USDT,ETH-USDT" + ] + } + }, + "required": [ + "timeout" + ] }, - "example": "{\n \"symbol\": \"BTC-USDT\",\n \"orderId\": \"670fd33bf9406e0007ab3945\",\n \"newPrice\": \"30000\",\n \"newSize\": \"0.0001\"\n}", + "example": "{\n \"timeout\": 5,\n \"symbols\": \"BTC-USDT,ETH-USDT\"\n}", "mediaType": "" }, - "description": ":::info[Description]\nThis interface can cancel the specified quantity of the order according to the orderId.\nThe order execution order is: price first, time first, this interface will not change the queue order\n:::", - "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"Spot\",\"api-rate-limit-pool\":\"Spot\",\"sdk-service\":\"Spot\",\"sdk-sub-service\":\"Order\",\"sdk-method-name\":\"cancelPartialOrder\",\"sdk-method-description\":\"This interface can cancel the specified quantity of the order according to the orderId. The order execution order is: price first, time first, this interface will not change the queue order\",\"api-rate-limit\":2}" + "description": ":::info[Description]\nSet Disconnection Protect(Deadman Swich)Through this interface, Call this interface to automatically cancel all orders of the set trading pair after the specified time. If this interface is not called again for renewal or cancellation before the set time, the system will help the user to cancel the order of the corresponding trading pair. Otherwise it will not.\n:::\n\n:::tip[Tips]\nThe order cancellation delay is between 0 and 10 seconds, and the order will not be canceled in real time. When the system cancels the order, if the transaction pair status is no longer operable to cancel the order, it will not cancel the order\n:::", + "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"Spot\",\"api-rate-limit-pool\":\"Spot\",\"sdk-service\":\"Spot\",\"sdk-sub-service\":\"Order\",\"sdk-method-name\":\"setDCP\",\"sdk-method-description\":\"Set Disconnection Protect(Deadman Swich)Through this interface, Call this interface to automatically cancel all orders of the set trading pair after the specified time. If this interface is not called again for renewal or cancellation before the set time, the system will help the user to cancel the order of the corresponding trading pair. Otherwise it will not.\",\"api-rate-limit\":2}" } }, { - "name": "Cancel Order By ClientOid", + "name": "Add Stop Order", "api": { - "id": "3470184", - "method": "delete", - "path": "/api/v1/hf/orders/client-order/{clientOid}", + "id": "3470334", + "method": "post", + "path": "/api/v1/stop-order", "parameters": { - "path": [ - { - "id": "clientOid#0", - "name": "clientOid", - "required": true, - "description": "Client Order Id,unique identifier created by the user", - "example": "5c52e11203aa677f33e493fb", - "type": "string" - } - ], - "query": [ - { - "id": "KXIxHhD4qw", - "name": "symbol", - "required": true, - "description": "symbol", - "example": "BTC-USDT", - "type": "string", - "schema": { - "type": "string", - "examples": [ - "BTC-USDT", - "ETH-USDT", - "KCS-USDT" - ] - } - } - ], + "query": [], + "path": [], "cookie": [], "header": [] }, "responses": [ { - "id": "10348", + "id": "10651", "code": 200, "name": "OK", "headers": [], @@ -17681,12 +16558,17 @@ "data": { "type": "object", "properties": { + "orderId": { + "type": "string", + "description": "The unique order id generated by the trading system,which can be used later for further actions such as canceling the order." + }, "clientOid": { "type": "string", - "description": "Client Order Id,unique identifier created by the user" + "description": "The user self-defined order id." } }, "required": [ + "orderId", "clientOid" ] } @@ -17704,23 +16586,205 @@ "responseExamples": [ { "name": "Success", - "data": "{\"code\":\"200000\",\"data\":{\"clientOid\":\"5c52e11203aa677f33e493fb\"}}", - "responseId": 10348, + "data": "{\"code\":\"200000\",\"data\":{\"orderId\":\"670fd33bf9406e0007ab3945\",\"clientOid\":\"5c52e11203aa677f33e493fb\"}}", + "responseId": 10651, "ordering": 1 } ], "requestBody": { - "type": "none", + "type": "application/json", "parameters": [], "jsonSchema": { "type": "object", - "properties": {} + "properties": { + "clientOid": { + "type": "string", + "description": "Client Order Id,The ClientOid field is a unique ID created by the user(we recommend using a UUID), and can only contain numbers, letters, underscores (_), and hyphens (-). This field is returned when order information is obtained. You can use clientOid to tag your orders. ClientOid is different from the order ID created by the service provider. Please do not initiate requests using the same clientOid. The maximum length for the ClientOid is 40 characters.\n\nPlease remember the orderId created by the service provider, it used to check for updates in order status.", + "examples": [ + "5c52e11203aa677f33e493fb" + ] + }, + "side": { + "type": "string", + "description": "specify if the order is to 'buy' or 'sell'", + "enum": [ + "buy", + "sell" + ], + "examples": [ + "buy" + ], + "x-api-enum": [ + { + "value": "buy", + "name": "", + "description": "" + }, + { + "value": "sell", + "name": "", + "description": "" + } + ] + }, + "symbol": { + "type": "string", + "description": "symbol", + "examples": [ + "BTC-USDT", + "ETH-USDT", + "KCS-USDT" + ] + }, + "type": { + "type": "string", + "description": "specify if the order is an 'limit' order or 'market' order. \n\nThe type of order you specify when you place your order determines whether or not you need to request other parameters and also affects the execution of the matching engine.\n\nWhen placing a limit order, you must specify a price and size. The system will try to match the order according to market price or a price better than market price. If the order cannot be immediately matched, it will stay in the order book until it is matched or the user cancels.\n\nUnlike limit orders, the price for market orders fluctuates with market prices. When placing a market order, you do not need to specify a price, you only need to specify a quantity. Market orders are filled immediately and will not enter the order book. All market orders are takers and a taker fee will be charged.", + "enum": [ + "limit", + "market" + ], + "examples": [ + "limit" + ], + "x-api-enum": [ + { + "value": "limit", + "name": "", + "description": "" + }, + { + "value": "market", + "name": "", + "description": "" + } + ] + }, + "remark": { + "type": "string", + "description": "Order placement remarks, length cannot exceed 20 characters (ASCII)" + }, + "stp": { + "type": "string", + "description": "[Self Trade Prevention](apidog://link/pages/338146) is divided into four strategies: CN, CO, CB , and DC", + "enum": [ + "DC", + "CO", + "CN", + "CB" + ], + "x-api-enum": [ + { + "value": "DC", + "name": "", + "description": "" + }, + { + "value": "CO", + "name": "", + "description": "" + }, + { + "value": "CN", + "name": "", + "description": "" + }, + { + "value": "CB", + "name": "", + "description": "" + } + ] + }, + "price": { + "type": "string", + "description": "Specify price for order, not need for market order.\n\nWhen placing a limit order, the price must be based on priceIncrement for the trading pair. The price increment (priceIncrement) is the price precision for the trading pair. For example, for the BTC-USDT trading pair, the priceIncrement is 0.00001000. So the price for your orders cannot be less than 0.00001000 and must be a multiple of priceIncrement. Otherwise, the order will return an invalid priceIncrement error." + }, + "size": { + "type": "string", + "description": "Specify quantity for order\n\nWhen **type** is limit, size refers to the amount of trading targets (the asset name written in front) for the trading pair. Teh Size must be based on the baseIncrement of the trading pair. The baseIncrement represents the precision for the trading pair. The size of an order must be a positive-integer multiple of baseIncrement and must be between baseMinSize and baseMaxSize.\n\nWhen **type** is market, select one out of two: size or funds" + }, + "timeInForce": { + "type": "string", + "description": "[Time in force](apidog://link/pages/338146) is a special strategy used during trading. Required for limit orders.", + "enum": [ + "GTC", + "GTT", + "IOC", + "FOK" + ], + "default": "GTC", + "x-api-enum": [ + { + "value": "GTC", + "name": "", + "description": "" + }, + { + "value": "GTT", + "name": "", + "description": "" + }, + { + "value": "IOC", + "name": "", + "description": "" + }, + { + "value": "FOK", + "name": "", + "description": "" + } + ] + }, + "postOnly": { + "type": "boolean", + "description": "passive order labels, this is disabled when the order timing strategy is IOC or FOK if **type** is limit.", + "default": false + }, + "hidden": { + "type": "boolean", + "description": "[Hidden order](apidog://link/pages/338146) or not (not shown in order book)", + "default": false + }, + "iceberg": { + "type": "boolean", + "description": "Whether or not only visible portions of orders are shown in [Iceberg orders](apidog://link/pages/338146)", + "default": false + }, + "visibleSize": { + "type": "string", + "description": "When **type** is limit, this is Maximum visible quantity in iceberg orders." + }, + "cancelAfter": { + "type": "integer", + "description": "Cancel after n seconds,the order timing strategy is GTT when **type** is limit.", + "format": "int64" + }, + "funds": { + "type": "string", + "description": "When **type** is market, select one out of two: size or funds" + }, + "stopPrice": { + "type": "string", + "description": "The trigger price." + }, + "tradeType": { + "type": "string", + "description": "The type of trading : TRADE(Spot), MARGIN_TRADE (Cross Margin), MARGIN_ISOLATED_TRADE (Isolated Margin). Default is TRADE" + } + }, + "required": [ + "symbol", + "type", + "side", + "stopPrice" + ] }, - "example": "{\n \"symbol\": \"BTC-USDT\",\n \"orderId\": \"670fd33bf9406e0007ab3945\",\n \"newPrice\": \"30000\",\n \"newSize\": \"0.0001\"\n}", + "example": "//limit order\n{\n \"type\": \"limit\",\n \"symbol\": \"BTC-USDT\",\n \"side\": \"buy\",\n \"price\": \"50000\",\n \"size\": \"0.00001\",\n \"clientOid\": \"5c52e11203aa677f33e493fb\",\n \"remark\": \"order remarks\"\n}\n\n//market order 1\n// {\n// \"type\": \"market\",\n// \"symbol\": \"BTC-USDT\",\n// \"side\": \"buy\",\n// \"size\": \"0.00001\",\n// \"clientOid\": \"5c52e11203aa677f33e493fc\",\n// \"remark\": \"order remarks\"\n// }\n\n//market order 2\n// {\n// \"type\": \"market\",\n// \"symbol\": \"BTC-USDT\",\n// \"side\": \"buy\",\n// \"funds\": \"1\",\n// \"clientOid\": \"5c52e11203aa677f33e493fc\",\n// \"remark\": \"order remarks\"\n// }\n", "mediaType": "" }, - "description": ":::info[Description]\nThis endpoint can be used to cancel a spot order by clientOid.\nThis endpoint only sends cancellation requests. The results of the requests must be obtained by checking the order status or subscribing to websocket.\n:::", - "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"Spot\",\"api-rate-limit-pool\":\"Spot\",\"sdk-service\":\"Spot\",\"sdk-sub-service\":\"Order\",\"sdk-method-name\":\"cancelOrderByClientOid\",\"sdk-method-description\":\"This endpoint can be used to cancel a spot order by clientOid. This endpoint only sends cancellation requests. The results of the requests must be obtained by checking the order status or subscribing to websocket.\",\"api-rate-limit\":1}" + "description": ":::info[Description]\nPlace stop order to the Spot trading system. The maximum untriggered stop orders for a single trading pair in one account is 20.\n:::\n\n", + "customApiFields": "{\"abandon\":\"abandon\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"Spot\",\"api-rate-limit-pool\":\"Spot\",\"sdk-service\":\"Spot\",\"sdk-sub-service\":\"Order\",\"sdk-method-name\":\"addStopOrder\",\"sdk-method-description\":\"Place stop order to the Spot trading system, you can place two major types of orders: limit and market. Orders can only be placed if your account has sufficient funds. Once an order is placed, your funds will be put on hold for the duration of the order. The amount of funds on hold depends on the order type and parameters specified.\",\"api-rate-limit\":1}" } }, { @@ -17825,38 +16889,22 @@ } }, { - "name": "Cancel Order By OrderId Sync", + "name": "Cancel Stop Order By OrderId", "api": { - "id": "3470185", + "id": "3470335", "method": "delete", - "path": "/api/v1/hf/orders/sync/{orderId}", + "path": "/api/v1/stop-order/{orderId}", "parameters": { + "query": [], "path": [ { "id": "orderId#0", "name": "orderId", "required": true, "description": "The unique order id generated by the trading system", - "example": "671128ee365ccb0007534d45", - "type": "string" - } - ], - "query": [ - { - "id": "KXIxHhD4qw", - "name": "symbol", - "required": true, - "description": "symbol", - "example": "BTC-USDT", + "example": "671124f9365ccb00073debd4", "type": "string", - "schema": { - "type": "string", - "examples": [ - "BTC-USDT", - "ETH-USDT", - "KCS-USDT" - ] - } + "enable": true } ], "cookie": [], @@ -17864,7 +16912,7 @@ }, "responses": [ { - "id": "10349", + "id": "10510", "code": 200, "name": "OK", "headers": [], @@ -17877,54 +16925,113 @@ "data": { "type": "object", "properties": { - "orderId": { - "type": "string", - "description": "order id" - }, - "originSize": { - "type": "string", - "description": "original order size" - }, - "dealSize": { - "type": "string", - "description": "deal size" - }, - "remainSize": { - "type": "string", - "description": "remain size" - }, - "canceledSize": { - "type": "string", - "description": "Cumulative canceled size" - }, - "status": { - "type": "string", - "description": "Order Status. open:order is active; done:order has been completed", - "enum": [ - "open", - "done" - ], - "x-api-enum": [ - { - "value": "open", - "name": "", - "description": "" - }, - { - "value": "done", - "name": "", - "description": "" - } - ] + "cancelledOrderIds": { + "type": "array", + "items": { + "type": "string" + }, + "description": "order id array" + } + }, + "required": [ + "cancelledOrderIds" + ] + } + }, + "required": [ + "code", + "data" + ] + }, + "description": "", + "contentType": "json", + "mediaType": "" + } + ], + "responseExamples": [ + { + "name": "Success", + "data": "{\n \"code\": \"200000\",\n \"data\": {\n \"cancelledOrderIds\": [\n \"671124f9365ccb00073debd4\"\n ]\n }\n}", + "responseId": 10510, + "ordering": 1 + } + ], + "requestBody": { + "type": "none", + "parameters": [], + "jsonSchema": { + "type": "object", + "properties": {} + }, + "example": "{\n \"symbol\": \"BTC-USDT\",\n \"orderId\": \"670fd33bf9406e0007ab3945\",\n \"newPrice\": \"30000\",\n \"newSize\": \"0.0001\"\n}", + "mediaType": "" + }, + "description": ":::info[Description]\nRequest via this endpoint to cancel a single stop order previously placed.\n\nYou will receive cancelledOrderIds field once the system has received the cancellation request. The cancellation request will be processed by the matching engine in sequence. To know if the request is processed (successfully or not), you may check the order status or the update message from the websocket pushes.\n:::", + "customApiFields": "{\"abandon\":\"abandon\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"Spot\",\"api-rate-limit-pool\":\"Spot\",\"sdk-service\":\"Spot\",\"sdk-sub-service\":\"Order\",\"sdk-method-name\":\"cancelStopOrderByOrderId\",\"sdk-method-description\":\"This endpoint can be used to cancel a spot stop order by orderId. \",\"api-rate-limit\":3}" + } + }, + { + "name": "Batch Cancel Stop Orders", + "api": { + "id": "3470337", + "method": "delete", + "path": "/api/v1/stop-order/cancel", + "parameters": { + "query": [ + { + "required": false, + "description": "Cancel the open order for the specified symbol", + "type": "string", + "id": "3XtxdL10NG", + "enable": true, + "name": "symbol" + }, + { + "required": false, + "description": "The type of trading : TRADE(Spot), MARGIN_TRADE (Cross Margin), MARGIN_ISOLATED_TRADE (Isolated Margin). Default is TRADE", + "type": "string", + "id": "WL2a8vOzaG", + "enable": true, + "name": "tradeType" + }, + { + "required": false, + "description": "Comma seperated order IDs.", + "type": "string", + "id": "jVrbtXmTbt", + "enable": true, + "name": "orderIds" + } + ], + "path": [], + "cookie": [], + "header": [] + }, + "responses": [ + { + "id": "10652", + "code": 200, + "name": "OK", + "headers": [], + "jsonSchema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "object", + "properties": { + "cancelledOrderIds": { + "type": "array", + "items": { + "type": "string" + }, + "description": "order id array" } }, "required": [ - "orderId", - "dealSize", - "remainSize", - "canceledSize", - "status", - "originSize" + "cancelledOrderIds" ] } }, @@ -17941,8 +17048,8 @@ "responseExamples": [ { "name": "Success", - "data": "{\n \"code\": \"200000\",\n \"data\": {\n \"orderId\": \"671128ee365ccb0007534d45\",\n \"originSize\": \"0.00001\",\n \"dealSize\": \"0\",\n \"remainSize\": \"0\",\n \"canceledSize\": \"0.00001\",\n \"status\": \"done\"\n }\n}", - "responseId": 10349, + "data": "{\n \"code\": \"200000\",\n \"data\": {\n \"cancelledOrderIds\": [\n \"671124f9365ccb00073debd4\"\n ]\n }\n}", + "responseId": 10652, "ordering": 1 } ], @@ -17956,51 +17063,25 @@ "example": "{\n \"symbol\": \"BTC-USDT\",\n \"orderId\": \"670fd33bf9406e0007ab3945\",\n \"newPrice\": \"30000\",\n \"newSize\": \"0.0001\"\n}", "mediaType": "" }, - "description": ":::info[Description]\nThis endpoint can be used to cancel a spot order by orderId.\n\nThe difference between this interface and \"Cancel Order By OrderId\" is that this interface will synchronously return the order information after the order canceling is completed.\n\nFor higher latency requirements, please select the \"Cancel Order By OrderId\" interface. If there is a requirement for returning data integrity, please select this interface\n:::", - "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"Spot\",\"api-rate-limit-pool\":\"Spot\",\"sdk-service\":\"Spot\",\"sdk-sub-service\":\"Order\",\"sdk-method-name\":\"cancelOrderByOrderIdSync\",\"sdk-method-description\":\"This endpoint can be used to cancel a spot order by orderId.\",\"api-rate-limit\":1}" + "description": ":::info[Description]\nRequest via this interface to cancel a batch of stop orders.\n\nThe count of orderId in the parameter now is not limited.\n\nAn example is:\n ```/api/v1/stop-order/cancel?symbol=ETH-BTC&tradeType=TRADE&orderIds=5bd6e9286d99522a52e458de,5bd6e9286d99522a52e458df```\n:::", + "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"Spot\",\"api-rate-limit-pool\":\"Spot\",\"sdk-service\":\"Spot\",\"sdk-sub-service\":\"Order\",\"sdk-method-name\":\"batchCancelStopOrder\",\"sdk-method-description\":\"This endpoint can be used to cancel a spot stop orders by batch.\",\"api-rate-limit\":3}" } }, { - "name": "Cancel Order By ClientOid Sync", + "name": "Get Stop Orders List", "api": { - "id": "3470186", - "method": "delete", - "path": "/api/v1/hf/orders/sync/client-order/{clientOid}", + "id": "3470338", + "method": "get", + "path": "/api/v1/stop-order", "parameters": { - "path": [ - { - "id": "clientOid#0", - "name": "clientOid", - "required": true, - "description": "Client Order Id,unique identifier created by the user", - "example": "5c52e11203aa677f33e493fb", - "type": "string" - } - ], - "query": [ - { - "id": "KXIxHhD4qw", - "name": "symbol", - "required": true, - "description": "symbol", - "example": "BTC-USDT", - "type": "string", - "schema": { - "type": "string", - "examples": [ - "BTC-USDT", - "ETH-USDT", - "KCS-USDT" - ] - } - } - ], + "query": [], + "path": [], "cookie": [], "header": [] }, "responses": [ { - "id": "10350", + "id": "10568", "code": 200, "name": "OK", "headers": [], @@ -18013,59 +17094,160 @@ "data": { "type": "object", "properties": { - "clientOid": { - "type": "string", - "description": "Client Order Id,unique identifier created by the user" - }, - "originSize": { - "type": "string", - "description": "original order size" + "currentPage": { + "type": "integer", + "description": "current page id" }, - "dealSize": { - "type": "string", - "description": "deal size" + "pageSize": { + "type": "integer" }, - "remainSize": { - "type": "string", - "description": "remain size" + "totalNum": { + "type": "integer", + "description": "the stop order count" }, - "canceledSize": { - "type": "string", - "description": "Cumulative canceled size" + "totalPage": { + "type": "integer", + "description": "total page count of the list" }, - "status": { - "type": "string", - "description": "Order Status. open:order is active; done:order has been completed", - "enum": [ - "open", - "done" - ], - "x-api-enum": [ - { - "value": "open", - "name": "", - "description": "" - }, - { - "value": "done", - "name": "", - "description": "" + "items": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Order ID, the ID of an order." + }, + "symbol": { + "type": "string", + "description": "Symbol name" + }, + "userId": { + "type": "string", + "description": "User ID" + }, + "status": { + "type": "string", + "description": "Order status, include NEW, TRIGGERED" + }, + "type": { + "type": "string", + "description": "Order type,limit, market, limit_stop or market_stop" + }, + "side": { + "type": "string", + "description": "transaction direction,include buy and sell" + }, + "price": { + "type": "string", + "description": "order price" + }, + "size": { + "type": "string", + "description": "order quantity" + }, + "funds": { + "type": "string", + "description": "order funds" + }, + "stp": { + "type": "string" + }, + "timeInForce": { + "type": "string", + "description": "time InForce,include GTC,GTT,IOC,FOK" + }, + "cancelAfter": { + "type": "integer", + "description": "cancel orders after n seconds,requires timeInForce to be GTT" + }, + "postOnly": { + "type": "boolean", + "description": "postOnly" + }, + "hidden": { + "type": "boolean", + "description": "hidden order" + }, + "iceberg": { + "type": "boolean", + "description": "Iceberg order" + }, + "visibleSize": { + "type": "string", + "description": "displayed quantity for iceberg order" + }, + "channel": { + "type": "string", + "description": "order source" + }, + "clientOid": { + "type": "string", + "description": "user-entered order unique mark" + }, + "remark": { + "type": "string", + "description": "Remarks at stop order creation" + }, + "tags": { + "type": "string", + "description": "tag order source" + }, + "orderTime": { + "type": "integer", + "description": "Time of place a stop order, accurate to nanoseconds", + "format": "int64" + }, + "domainId": { + "type": "string", + "description": "domainId, e.g: kucoin" + }, + "tradeSource": { + "type": "string", + "description": "trade source: USER(Order by user), MARGIN_SYSTEM(Order by margin system)" + }, + "tradeType": { + "type": "string", + "description": "The type of trading : TRADE(Spot), MARGIN_TRADE (Cross Margin), MARGIN_ISOLATED_TRADE (Isolated Margin)." + }, + "feeCurrency": { + "type": "string", + "description": "The currency of the fee" + }, + "takerFeeRate": { + "type": "string", + "description": "Fee Rate of taker" + }, + "makerFeeRate": { + "type": "string", + "description": "Fee Rate of maker" + }, + "createdAt": { + "type": "integer", + "description": "order creation time", + "format": "int64" + }, + "stop": { + "type": "string", + "description": "Stop order type, include loss and entry" + }, + "stopTriggerTime": { + "type": "integer", + "description": "The trigger time of the stop order", + "format": "int64" + }, + "stopPrice": { + "type": "string", + "description": "stop price" + } } - ] + }, + "description": "the list of stop orders" } - }, - "required": [ - "clientOid", - "originSize", - "dealSize", - "remainSize", - "canceledSize", - "status" - ] + } } }, "required": [ - "code", "data" ] }, @@ -18077,70 +17259,303 @@ "responseExamples": [ { "name": "Success", - "data": "{\n \"code\": \"200000\",\n \"data\": {\n \"clientOid\": \"5c52e11203aa677f33e493fb\",\n \"originSize\": \"0.00001\",\n \"dealSize\": \"0\",\n \"remainSize\": \"0\",\n \"canceledSize\": \"0.00001\",\n \"status\": \"done\"\n }\n}", - "responseId": 10350, + "data": "{\n \"code\": \"200000\",\n \"data\": {\n \"currentPage\": 1,\n \"pageSize\": 50,\n \"totalNum\": 1,\n \"totalPage\": 1,\n \"items\": [\n {\n \"id\": \"vs8hoo8kqjnklv4m0038lrfq\",\n \"symbol\": \"KCS-USDT\",\n \"userId\": \"60fe4956c43cbc0006562c2c\",\n \"status\": \"NEW\",\n \"type\": \"limit\",\n \"side\": \"buy\",\n \"price\": \"0.01000000000000000000\",\n \"size\": \"0.01000000000000000000\",\n \"funds\": null,\n \"stp\": null,\n \"timeInForce\": \"GTC\",\n \"cancelAfter\": -1,\n \"postOnly\": false,\n \"hidden\": false,\n \"iceberg\": false,\n \"visibleSize\": null,\n \"channel\": \"API\",\n \"clientOid\": \"404814a0fb4311eb9098acde48001122\",\n \"remark\": null,\n \"tags\": null,\n \"orderTime\": 1628755183702150100,\n \"domainId\": \"kucoin\",\n \"tradeSource\": \"USER\",\n \"tradeType\": \"TRADE\",\n \"feeCurrency\": \"USDT\",\n \"takerFeeRate\": \"0.00200000000000000000\",\n \"makerFeeRate\": \"0.00200000000000000000\",\n \"createdAt\": 1628755183704,\n \"stop\": \"loss\",\n \"stopTriggerTime\": null,\n \"stopPrice\": \"10.00000000000000000000\"\n }\n ]\n }\n}", + "responseId": 10568, "ordering": 1 } ], "requestBody": { - "type": "none", + "type": "application/json", "parameters": [], "jsonSchema": { "type": "object", - "properties": {} + "properties": { + "symbol": { + "type": "string", + "description": "Only list orders for a specific symbol" + }, + "side": { + "type": "string", + "enum": [ + "buy", + "sell" + ], + "description": "buy or sell", + "x-api-enum": [ + { + "value": "buy", + "name": "buy", + "description": "" + }, + { + "value": "sell", + "name": "sell", + "description": "" + } + ] + }, + "type": { + "type": "string", + "description": "limit, market, limit_stop or market_stop", + "enum": [ + "limit", + "market", + "limit_stop", + "market_stop" + ], + "x-api-enum": [ + { + "value": "limit", + "name": "limit", + "description": "" + }, + { + "value": "market", + "name": "market", + "description": "" + }, + { + "value": "limit_stop", + "name": "limit_stop", + "description": "" + }, + { + "value": "market_stop", + "name": "market_stop", + "description": "" + } + ] + }, + "tradeType": { + "type": "string", + "description": "The type of trading : TRADE(Spot), MARGIN_TRADE (Cross Margin), MARGIN_ISOLATED_TRADE (Isolated Margin). Default is TRADE", + "enum": [ + "TRADE", + "MARGIN_TRADE", + "MARGIN_ISOLATED_TRADE" + ], + "x-api-enum": [ + { + "value": "TRADE", + "name": "TRADE", + "description": "" + }, + { + "value": "MARGIN_TRADE", + "name": "MARGIN_TRADE", + "description": "" + }, + { + "value": "MARGIN_ISOLATED_TRADE", + "name": "MARGIN_ISOLATED_TRADE", + "description": "" + } + ] + }, + "startAt": { + "type": "number", + "description": "Start time (milisecond)" + }, + "endAt": { + "type": "number", + "description": "End time (milisecond)" + }, + "currentPage": { + "type": "integer", + "description": "current page" + }, + "orderIds": { + "type": "string", + "description": "comma seperated order ID list" + }, + "pageSize": { + "type": "integer", + "description": "page size" + }, + "stop": { + "type": "string", + "description": "Order type: stop: stop loss order, oco: oco order" + } + } }, "example": "{\n \"symbol\": \"BTC-USDT\",\n \"orderId\": \"670fd33bf9406e0007ab3945\",\n \"newPrice\": \"30000\",\n \"newSize\": \"0.0001\"\n}", "mediaType": "" }, - "description": ":::info[Description]\nThis endpoint can be used to cancel a spot order by clientOid.\n\nThe difference between this interface and \"Cancel Order By ClientOid\" is that this interface will synchronously return the order information after the order canceling is completed.\n\nFor higher latency requirements, please select the \"Cancel Order By ClientOid\" interface. If there is a requirement for returning data integrity, please select this interface\n:::", - "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"Spot\",\"api-rate-limit-pool\":\"Spot\",\"sdk-service\":\"Spot\",\"sdk-sub-service\":\"Order\",\"sdk-method-name\":\"cancelOrderByClientOidSync\",\"sdk-method-description\":\"This endpoint can be used to cancel a spot order by orderId.\",\"api-rate-limit\":1}" + "description": ":::info[Description]\nRequest via this endpoint to get your current untriggered stop order list. Items are paginated and sorted to show the latest first. See the Pagination section for retrieving additional entries after the first page.\n\n:::\n\n\n:::tip[Example]\n```json\n{\n \"currentPage\": 1,\n \"pageSize\": 50,\n \"totalNum\": 1,\n \"totalPage\": 1,\n \"items\": [\n {\n \"id\": \"vs8hoo8kqjnklv4m0038lrfq\",\n \"symbol\": \"KCS-USDT\",\n \"userId\": \"60fe4956c43cbc0006562c2c\",\n \"status\": \"NEW\",\n \"type\": \"limit\",\n \"side\": \"buy\",\n \"price\": \"0.01000000000000000000\",\n \"size\": \"0.01000000000000000000\",\n \"funds\": null,\n \"stp\": null,\n \"timeInForce\": \"GTC\",\n \"cancelAfter\": -1,\n \"postOnly\": false,\n \"hidden\": false,\n \"iceberg\": false,\n \"visibleSize\": null,\n \"channel\": \"API\",\n \"clientOid\": \"404814a0fb4311eb9098acde48001122\",\n \"remark\": null,\n \"tags\": null,\n \"orderTime\": 1628755183702150167,\n \"domainId\": \"kucoin\",\n \"tradeSource\": \"USER\",\n \"tradeType\": \"TRADE\",\n \"feeCurrency\": \"USDT\",\n \"takerFeeRate\": \"0.00200000000000000000\",\n \"makerFeeRate\": \"0.00200000000000000000\",\n \"createdAt\": 1628755183704,\n \"stop\": \"loss\",\n \"stopTriggerTime\": null,\n \"stopPrice\": \"10.00000000000000000000\"\n }\n ]\n}\n```\n:::", + "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"General\",\"api-rate-limit-pool\":\"Spot\",\"sdk-service\":\"Spot\",\"sdk-sub-service\":\"Order\",\"sdk-method-name\":\"getStopOrdersList\",\"sdk-method-description\":\"This interface is to obtain all Spot active stop order lists\",\"api-rate-limit\":8}" } }, { - "name": "Add Order Test", + "name": "Get Stop Order By OrderId", "api": { - "id": "3470187", - "method": "post", - "path": "/api/v1/hf/orders/test", + "id": "3470339", + "method": "get", + "path": "/api/v1/stop-order/{orderId}", "parameters": { "query": [], - "path": [], + "path": [ + { + "id": "orderId#0", + "name": "orderId", + "required": true, + "description": "The order id", + "type": "string", + "enable": true + } + ], "cookie": [], "header": [] }, "responses": [ { - "id": "10351", + "id": "10569", "code": 200, "name": "OK", "headers": [], "jsonSchema": { "type": "object", "properties": { - "code": { - "type": "string" - }, "data": { "type": "object", "properties": { - "orderId": { + "id": { + "type": "string", + "description": "Order ID, the ID of an order." + }, + "symbol": { + "type": "string", + "description": "Symbol name" + }, + "userId": { + "type": "string", + "description": "User ID" + }, + "status": { + "type": "string", + "description": "Order status, include NEW, TRIGGERED" + }, + "type": { + "type": "string", + "description": "Order type,limit, market, limit_stop or market_stop" + }, + "side": { + "type": "string", + "description": "transaction direction,include buy and sell" + }, + "price": { + "type": "string", + "description": "order price" + }, + "size": { + "type": "string", + "description": "order quantity" + }, + "funds": { + "type": "string", + "description": "order funds" + }, + "stp": { + "type": "string" + }, + "timeInForce": { + "type": "string", + "description": "time InForce,include GTC,GTT,IOC,FOK" + }, + "cancelAfter": { + "type": "integer", + "description": "cancel orders after n seconds,requires timeInForce to be GTT", + "format": "int64" + }, + "postOnly": { + "type": "boolean", + "description": "postOnly" + }, + "hidden": { + "type": "boolean", + "description": "hidden order" + }, + "iceberg": { + "type": "boolean", + "description": "Iceberg order" + }, + "visibleSize": { + "type": "string", + "description": "displayed quantity for iceberg order" + }, + "channel": { + "type": "string", + "description": "order source" + }, + "clientOid": { + "type": "string", + "description": "user-entered order unique mark" + }, + "remark": { + "type": "string", + "description": "Remarks at stop order creation" + }, + "tags": { + "type": "string", + "description": "tag order source" + }, + "domainId": { + "type": "string", + "description": "domainId, e.g: kucoin" + }, + "tradeSource": { + "type": "string", + "description": "trade source: USER(Order by user), MARGIN_SYSTEM(Order by margin system)" + }, + "tradeType": { + "type": "string", + "description": "The type of trading : TRADE(Spot), MARGIN_TRADE (Cross Margin), MARGIN_ISOLATED_TRADE (Isolated Margin)." + }, + "feeCurrency": { "type": "string", - "description": "The unique order id generated by the trading system,which can be used later for further actions such as canceling the order." + "description": "The currency of the fee" }, - "clientOid": { + "takerFeeRate": { "type": "string", - "description": "The user self-defined order id." + "description": "Fee Rate of taker" + }, + "makerFeeRate": { + "type": "string", + "description": "Fee Rate of maker" + }, + "createdAt": { + "type": "integer", + "description": "order creation time", + "format": "int64" + }, + "stop": { + "type": "string", + "description": "Stop order type, include loss and entry" + }, + "stopTriggerTime": { + "type": "integer", + "description": "The trigger time of the stop order", + "format": "int64" + }, + "stopPrice": { + "type": "string", + "description": "stop price" + }, + "orderTime": { + "type": "integer", + "description": "Time of place a stop order, accurate to nanoseconds", + "format": "int64" } }, - "required": [ - "orderId", - "clientOid" - ] + "description": "the details" + }, + "code": { + "type": "string", + "description": "return status code" } }, "required": [ - "code", - "data" + "data", + "code" ] }, "description": "", @@ -18151,217 +17566,164 @@ "responseExamples": [ { "name": "Success", - "data": "{\"code\":\"200000\",\"data\":{\"orderId\":\"670fd33bf9406e0007ab3945\",\"clientOid\":\"5c52e11203aa677f33e493fb\"}}", - "responseId": 10351, + "data": "{\n \"code\": \"200000\",\n \"data\": {\n \"id\": \"vs8hoo8q2ceshiue003b67c0\",\n \"symbol\": \"KCS-USDT\",\n \"userId\": \"60fe4956c43cbc0006562c2c\",\n \"status\": \"NEW\",\n \"type\": \"limit\",\n \"side\": \"buy\",\n \"price\": \"0.01000000000000000000\",\n \"size\": \"0.01000000000000000000\",\n \"funds\": null,\n \"stp\": null,\n \"timeInForce\": \"GTC\",\n \"cancelAfter\": -1,\n \"postOnly\": false,\n \"hidden\": false,\n \"iceberg\": false,\n \"visibleSize\": null,\n \"channel\": \"API\",\n \"clientOid\": \"40e0eb9efe6311eb8e58acde48001122\",\n \"remark\": null,\n \"tags\": null,\n \"orderTime\": 1629098781127530200,\n \"domainId\": \"kucoin\",\n \"tradeSource\": \"USER\",\n \"tradeType\": \"TRADE\",\n \"feeCurrency\": \"USDT\",\n \"takerFeeRate\": \"0.00200000000000000000\",\n \"makerFeeRate\": \"0.00200000000000000000\",\n \"createdAt\": 1629098781128,\n \"stop\": \"loss\",\n \"stopTriggerTime\": null,\n \"stopPrice\": \"10.00000000000000000000\"\n }\n}", + "responseId": 10569, "ordering": 1 } ], "requestBody": { - "type": "application/json", + "type": "none", "parameters": [], "jsonSchema": { "type": "object", "properties": { - "clientOid": { + "symbol": { "type": "string", - "description": "Client Order Id,The ClientOid field is a unique ID created by the user(we recommend using a UUID), and can only contain numbers, letters, underscores (_), and hyphens (-). This field is returned when order information is obtained. You can use clientOid to tag your orders. ClientOid is different from the order ID created by the service provider. Please do not initiate requests using the same clientOid. The maximum length for the ClientOid is 40 characters.\n\nPlease remember the orderId created by the service provider, it used to check for updates in order status.", - "examples": [ - "5c52e11203aa677f33e493fb" - ] + "description": "Only list orders for a specific symbol" }, "side": { "type": "string", - "description": "specify if the order is to 'buy' or 'sell'", "enum": [ "buy", "sell" ], - "examples": [ - "buy" - ], + "description": "buy or sell", "x-api-enum": [ { "value": "buy", - "name": "", + "name": "buy", "description": "" }, { "value": "sell", - "name": "", + "name": "sell", "description": "" } ] }, - "symbol": { - "type": "string", - "description": "symbol", - "examples": [ - "BTC-USDT", - "ETH-USDT", - "KCS-USDT" - ] - }, "type": { "type": "string", - "description": "specify if the order is an 'limit' order or 'market' order. \n\nThe type of order you specify when you place your order determines whether or not you need to request other parameters and also affects the execution of the matching engine.\n\nWhen placing a limit order, you must specify a price and size. The system will try to match the order according to market price or a price better than market price. If the order cannot be immediately matched, it will stay in the order book until it is matched or the user cancels.\n\nUnlike limit orders, the price for market orders fluctuates with market prices. When placing a market order, you do not need to specify a price, you only need to specify a quantity. Market orders are filled immediately and will not enter the order book. All market orders are takers and a taker fee will be charged.", + "description": "limit, market, limit_stop or market_stop", "enum": [ "limit", - "market" - ], - "examples": [ - "limit" + "market", + "limit_stop", + "market_stop" ], "x-api-enum": [ { "value": "limit", - "name": "", + "name": "limit", "description": "" }, { "value": "market", - "name": "", - "description": "" - } - ] - }, - "remark": { - "type": "string", - "description": "Order placement remarks, length cannot exceed 20 characters (ASCII)" - }, - "stp": { - "type": "string", - "description": "[Self Trade Prevention](apidog://link/pages/338146) is divided into four strategies: CN, CO, CB , and DC", - "enum": [ - "DC", - "CO", - "CN", - "CB" - ], - "x-api-enum": [ - { - "value": "DC", - "name": "", - "description": "" - }, - { - "value": "CO", - "name": "", + "name": "market", "description": "" }, { - "value": "CN", - "name": "", + "value": "limit_stop", + "name": "limit_stop", "description": "" }, { - "value": "CB", - "name": "", + "value": "market_stop", + "name": "market_stop", "description": "" } ] }, - "price": { - "type": "string", - "description": "Specify price for order\n\nWhen placing a limit order, the price must be based on priceIncrement for the trading pair. The price increment (priceIncrement) is the price precision for the trading pair. For example, for the BTC-USDT trading pair, the priceIncrement is 0.00001000. So the price for your orders cannot be less than 0.00001000 and must be a multiple of priceIncrement. Otherwise, the order will return an invalid priceIncrement error." - }, - "size": { - "type": "string", - "description": "Specify quantity for order\n\nWhen **type** is limit, size refers to the amount of trading targets (the asset name written in front) for the trading pair. Teh Size must be based on the baseIncrement of the trading pair. The baseIncrement represents the precision for the trading pair. The size of an order must be a positive-integer multiple of baseIncrement and must be between baseMinSize and baseMaxSize.\n\nWhen **type** is market, select one out of two: size or funds" - }, - "timeInForce": { + "tradeType": { "type": "string", - "description": "[Time in force](apidog://link/pages/338146) is a special strategy used during trading", + "description": "The type of trading : TRADE(Spot), MARGIN_TRADE (Cross Margin), MARGIN_ISOLATED_TRADE (Isolated Margin). Default is TRADE", "enum": [ - "GTC", - "GTT", - "IOC", - "FOK" + "TRADE", + "MARGIN_TRADE", + "MARGIN_ISOLATED_TRADE" ], - "default": "GTC", "x-api-enum": [ { - "value": "GTC", - "name": "", - "description": "" - }, - { - "value": "GTT", - "name": "", + "value": "TRADE", + "name": "TRADE", "description": "" }, { - "value": "IOC", - "name": "", + "value": "MARGIN_TRADE", + "name": "MARGIN_TRADE", "description": "" }, { - "value": "FOK", - "name": "", + "value": "MARGIN_ISOLATED_TRADE", + "name": "MARGIN_ISOLATED_TRADE", "description": "" } ] }, - "postOnly": { - "type": "boolean", - "default": false, - "description": "passive order labels, this is disabled when the order timing strategy is IOC or FOK" - }, - "hidden": { - "type": "boolean", - "description": "[Hidden order](apidog://link/pages/338146) or not (not shown in order book)", - "default": false + "startAt": { + "type": "number", + "description": "Start time (milisecond)" }, - "iceberg": { - "type": "boolean", - "description": "Whether or not only visible portions of orders are shown in [Iceberg orders](apidog://link/pages/338146)", - "default": false + "endAt": { + "type": "number", + "description": "End time (milisecond)" }, - "visibleSize": { - "type": "string", - "description": "Maximum visible quantity in iceberg orders" + "currentPage": { + "type": "integer", + "description": "current page" }, - "tags": { + "orderIds": { "type": "string", - "description": "Order tag, length cannot exceed 20 characters (ASCII)" + "description": "comma seperated order ID list" }, - "cancelAfter": { + "pageSize": { "type": "integer", - "format": "int64", - "description": "Cancel after n seconds,the order timing strategy is GTT" + "description": "page size" }, - "funds": { + "stop": { "type": "string", - "description": "When **type** is market, select one out of two: size or funds" + "description": "Order type: stop: stop loss order, oco: oco order" } - }, - "required": [ - "symbol", - "type", - "side" - ] + } }, - "example": "//limit order\n{\n \"type\": \"limit\",\n \"symbol\": \"BTC-USDT\",\n \"side\": \"buy\",\n \"price\": \"50000\",\n \"size\": \"0.00001\",\n \"clientOid\": \"5c52e11203aa677f33e493f\",\n \"remark\": \"order remarks\"\n}\n\n//market order 1\n// {\n// \"type\": \"market\",\n// \"symbol\": \"BTC-USDT\",\n// \"side\": \"buy\",\n// \"size\": \"0.00001\",\n// \"clientOid\": \"5c52e11203aa677f33e493fc\",\n// \"remark\": \"order remarks\",\n// }\n\n//market order 2\n// {\n// \"type\": \"market\",\n// \"symbol\": \"BTC-USDT\",\n// \"side\": \"buy\",\n// \"funds\": \"1\",\n// \"clientOid\": \"5c52e11203aa677f33e493fc\",\n// \"remark\": \"order remarks\",\n// }\n", + "example": "{\n \"symbol\": \"BTC-USDT\",\n \"orderId\": \"670fd33bf9406e0007ab3945\",\n \"newPrice\": \"30000\",\n \"newSize\": \"0.0001\"\n}", "mediaType": "" }, - "description": ":::info[Description]\nOrder test endpoint, the request parameters and return parameters of this endpoint are exactly the same as the order endpoint, and can be used to verify whether the signature is correct and other operations. After placing an order, the order will not enter the matching system, and the order cannot be queried.\n:::\n\n:::tip[Tips]\nPlease note that once your order enters the order book, the system will freeze the handling fees for the order ahead of time.\n\nBefore placing orders, please be sure to fully understand the meaning of the parameters for each trading pair.\n:::\n\n:::tip[Tips]\nThe maximum number of active orders per account is 2000, with a maximum of 200 active orders per trading pair.\n:::\n\n\n**Public order placement request parameters**\n\n| Param | Type | Mandatory | Description |\n| --------- | ------ | --------- | ----------- |\n| clientOid | String | No | Client Order Id,unique identifier created by the user, the use of UUID is recommended |\n| symbol | String | Yes | symbol |\n| type | String | Yes | Order type `limit` and `market` |\n| side | String | Yes | `buy` or `sell` |\n| stp | String | No | self trade prevention is divided into four strategies: `CN`, `CO`, `CB` , and `DC` |\n| tags | String | No | Order tag, length cannot exceed `20` characters (ASCII) |\n| remark | String | No | Order placement remarks, length cannot exceed `20` characters (ASCII) |\n\n**Additional Request Parameters Required by `limit` Orders**\n\n| Param | Type | Mandatory | Description |\n| ----------- | ------- | --------- | ----------- |\n| price | String | Yes | Specify price for currency |\n| size | String | Yes | Specify quantity for currency |\n| timeInForce | String | No | Order timing strategy `GTC`, `GTT`, `IOC`, `FOK` (The default is `GTC`) |\n| cancelAfter | long | No | Cancel after `n` seconds,the order timing strategy is `GTT` |\n| postOnly | boolean | No | passive order labels, this is disabled when the order timing strategy is `IOC` or `FOK` |\n| hidden | boolean | No | Hidden or not (not shown in order book) |\n| iceberg | boolean | No | Whether or not only visible portions of orders are shown in iceberg orders |\n| visibleSize | String | No | Maximum visible quantity in iceberg orders |\n\n**Additional request parameters required by `market` orders**\n\n| Param | Type | Mandatory | Description |\n| ----- | ------ | --------- | ------------------------------------------ |\n| size | String | No | (Select one out of two: `size` or `funds`) |\n| funds | String | No | (Select one out of two: `size` or `funds`) |\n\n\n**Hold**\n\nFor limit price purchase orders, we will hold the amount of funds (price * size) required for your purchase order. Similarly, for limit price sell orders, we will also hold you sell order assets. When the transaction is executed, the service fees will be calculated. If you cancel a portion of a filled or unfilled order, then the remaining funds or amounts will be released and returned to your account. For market price buy/sell orders that require specific funds, we will hold the required funds in from your account. If only the size is specified, we may freeze (usually for a very short amount of time) all of the funds in your account prior to the order being filled or cancelled.\n\n\n**Order Lifecycle**\n\nWhen an order placement request is successful (the matching engine receives the order) or denied (due to there being insufficient funds or illegal parameter values, etc.), the system will respond to the HTTP request. When an order is successfully placed, the order ID is returned. The order will be matched, which could result in it being fully or partially filled. When an order is fully or partially filled, the remaining portions of the order will be in an active state awaiting to be matched (this does not include IOC orders). Orders that are fully or partially filled(already cancelled) will be put into the “done” state.\n\nUsers that have subscribed to the Market Data Channel can use the order ID (orderId) and client ID (clientOid) to identify messages.\n\n**Price Protection Mechanisms**\n\nPrice protection mechanisms ae enabled for order placements. Rules are detailed below:\n\n- If the spot trading market order/limit order placed by the user can be directly matched with an order in the current order book, the system will judge whether deviation between the price corresponding to the transaction depth and the spread exceeds the threshold value (the threshold value can be obtained using the symbol API endpoint);\n\n- If it is exceeded, for limit orders, the order will be directly cancelled;\n\n- If it is a market order, then the system will partially execute the order. The execution limit will be the order size within the price range corresponding to the threshold value. The remaining orders will not be filled.\n\nFor example: if the threshold value is 10%, when a user places a market price purchase order in the KCS/USDT trading market for 10,000 USDT (the selling price is currently 1.20000), the system will determine that after the order is completely filled, the final price will be 1.40000. (1.40000-1.20000)/1.20000=16.7%>10%. The threshold value is 1.32000. The user’s market price purchase order will be filled only to a maximum of 1.32000. The remaining order portions will not be matched with orders in the order book. Note: this feature may not be able to determine depth with complete accuracy. If your order is not completely filled, it may be because the portion exceeding the threshold value was not filled.\n", - "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"Spot\",\"api-rate-limit-pool\":\"Spot\",\"sdk-service\":\"Spot\",\"sdk-sub-service\":\"Order\",\"sdk-method-name\":\"addOrderTest\",\"sdk-method-description\":\"Order test endpoint, the request parameters and return parameters of this endpoint are exactly the same as the order endpoint, and can be used to verify whether the signature is correct and other operations. After placing an order, the order will not enter the matching system, and the order cannot be queried.\",\"api-rate-limit\":1}" + "description": ":::info[Description]\nRequest via this interface to get a stop order information via the order ID.\n\n:::\n\n\n:::tip[Example]\n```json\n{\n \"id\": \"vs8hoo8q2ceshiue003b67c0\",\n \"symbol\": \"KCS-USDT\",\n \"userId\": \"60fe4956c43cbc0006562c2c\",\n \"status\": \"NEW\",\n \"type\": \"limit\",\n \"side\": \"buy\",\n \"price\": \"0.01000000000000000000\",\n \"size\": \"0.01000000000000000000\",\n \"funds\": null,\n \"stp\": null,\n \"timeInForce\": \"GTC\",\n \"cancelAfter\": -1,\n \"postOnly\": false,\n \"hidden\": false,\n \"iceberg\": false,\n \"visibleSize\": null,\n \"channel\": \"API\",\n \"clientOid\": \"40e0eb9efe6311eb8e58acde48001122\",\n \"remark\": null,\n \"tags\": null,\n \"orderTime\": 1629098781127530345,\n \"domainId\": \"kucoin\",\n \"tradeSource\": \"USER\",\n \"tradeType\": \"TRADE\",\n \"feeCurrency\": \"USDT\",\n \"takerFeeRate\": \"0.00200000000000000000\",\n \"makerFeeRate\": \"0.00200000000000000000\",\n \"createdAt\": 1629098781128,\n \"stop\": \"loss\",\n \"stopTriggerTime\": null,\n \"stopPrice\": \"10.00000000000000000000\"\n}\n```\n:::", + "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"General\",\"api-rate-limit-pool\":\"Spot\",\"sdk-service\":\"Spot\",\"sdk-sub-service\":\"Order\",\"sdk-method-name\":\"getStopOrderByOrderId\",\"sdk-method-description\":\"This interface is to obtain Spot stop order details by orderId\",\"api-rate-limit\":3}" } }, { - "name": "Add Order", + "name": "Get Stop Order By ClientOid", "api": { - "id": "3470188", - "method": "post", - "path": "/api/v1/hf/orders", + "id": "3470340", + "method": "get", + "path": "/api/v1/stop-order/queryOrderByClientOid", "parameters": { - "query": [], + "query": [ + { + "required": true, + "description": "The client order id", + "type": "string", + "id": "hV69UNFPAV", + "enable": true, + "name": "clientOid" + }, + { + "required": false, + "description": "symbol name", + "type": "string", + "id": "gbNm67rykJ", + "enable": true, + "name": "symbol" + } + ], "path": [], "cookie": [], "header": [] }, "responses": [ { - "id": "10352", + "id": "10570", "code": 200, "name": "OK", "headers": [], @@ -18369,24 +17731,144 @@ "type": "object", "properties": { "code": { - "type": "string" + "type": "string", + "description": "the return code" }, "data": { - "type": "object", - "properties": { - "orderId": { - "type": "string", - "description": "The unique order id generated by the trading system,which can be used later for further actions such as canceling the order." - }, - "clientOid": { - "type": "string", - "description": "The user self-defined order id." + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Order ID, the ID of an order." + }, + "symbol": { + "type": "string", + "description": "Symbol name" + }, + "userId": { + "type": "string", + "description": "User ID" + }, + "status": { + "type": "string", + "description": "Order status, include NEW, TRIGGERED" + }, + "type": { + "type": "string", + "description": "Order type,limit, market, limit_stop or market_stop" + }, + "side": { + "type": "string", + "description": "transaction direction,include buy and sell" + }, + "price": { + "type": "string", + "description": "order price" + }, + "size": { + "type": "string", + "description": "order quantity" + }, + "funds": { + "type": "string", + "description": "order funds" + }, + "stp": { + "type": "string" + }, + "timeInForce": { + "type": "string", + "description": "time InForce,include GTC,GTT,IOC,FOK" + }, + "cancelAfter": { + "type": "integer", + "description": "cancel orders after n seconds,requires timeInForce to be GTT", + "format": "int64" + }, + "postOnly": { + "type": "boolean", + "description": "postOnly" + }, + "hidden": { + "type": "boolean", + "description": "hidden order" + }, + "iceberg": { + "type": "boolean", + "description": "Iceberg order" + }, + "visibleSize": { + "type": "string", + "description": "displayed quantity for iceberg order" + }, + "channel": { + "type": "string", + "description": "order source" + }, + "clientOid": { + "type": "string", + "description": "user-entered order unique mark" + }, + "remark": { + "type": "string", + "description": "Remarks at stop order creation" + }, + "tags": { + "type": "string", + "description": "tag order source" + }, + "domainId": { + "type": "string", + "description": "domainId, e.g: kucoin" + }, + "tradeSource": { + "type": "string", + "description": "trade source: USER(Order by user), MARGIN_SYSTEM(Order by margin system)" + }, + "tradeType": { + "type": "string", + "description": "The type of trading : TRADE(Spot), MARGIN_TRADE (Cross Margin), MARGIN_ISOLATED_TRADE (Isolated Margin)." + }, + "feeCurrency": { + "type": "string", + "description": "The currency of the fee" + }, + "takerFeeRate": { + "type": "string", + "description": "Fee Rate of taker" + }, + "makerFeeRate": { + "type": "string", + "description": "Fee Rate of maker" + }, + "createdAt": { + "type": "integer", + "description": "order creation time", + "format": "int64" + }, + "stop": { + "type": "string", + "description": "Stop order type, include loss and entry" + }, + "stopTriggerTime": { + "type": "integer", + "description": "The trigger time of the stop order", + "format": "int64" + }, + "stopPrice": { + "type": "string", + "description": "stop price" + }, + "orderTime": { + "type": "integer", + "description": "Time of place a stop order, accurate to nanoseconds", + "format": "int64" + } } }, - "required": [ - "orderId", - "clientOid" - ] + "description": "the return code" } }, "required": [ @@ -18402,200 +17884,132 @@ "responseExamples": [ { "name": "Success", - "data": "{\"code\":\"200000\",\"data\":{\"orderId\":\"670fd33bf9406e0007ab3945\",\"clientOid\":\"5c52e11203aa677f33e493fb\"}}", - "responseId": 10352, + "data": "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"id\": \"vs8hoo8os561f5np0032vngj\",\n \"symbol\": \"KCS-USDT\",\n \"userId\": \"60fe4956c43cbc0006562c2c\",\n \"status\": \"NEW\",\n \"type\": \"limit\",\n \"side\": \"buy\",\n \"price\": \"0.01000000000000000000\",\n \"size\": \"0.01000000000000000000\",\n \"funds\": null,\n \"stp\": null,\n \"timeInForce\": \"GTC\",\n \"cancelAfter\": -1,\n \"postOnly\": false,\n \"hidden\": false,\n \"iceberg\": false,\n \"visibleSize\": null,\n \"channel\": \"API\",\n \"clientOid\": \"2b700942b5db41cebe578cff48960e09\",\n \"remark\": null,\n \"tags\": null,\n \"orderTime\": 1629020492834532600,\n \"domainId\": \"kucoin\",\n \"tradeSource\": \"USER\",\n \"tradeType\": \"TRADE\",\n \"feeCurrency\": \"USDT\",\n \"takerFeeRate\": \"0.00200000000000000000\",\n \"makerFeeRate\": \"0.00200000000000000000\",\n \"createdAt\": 1629020492837,\n \"stop\": \"loss\",\n \"stopTriggerTime\": null,\n \"stopPrice\": \"1.00000000000000000000\"\n }\n ]\n}", + "responseId": 10570, "ordering": 1 } ], "requestBody": { - "type": "application/json", + "type": "none", "parameters": [], "jsonSchema": { "type": "object", "properties": { - "clientOid": { + "symbol": { "type": "string", - "description": "Client Order Id,The ClientOid field is a unique ID created by the user(we recommend using a UUID), and can only contain numbers, letters, underscores (_), and hyphens (-). This field is returned when order information is obtained. You can use clientOid to tag your orders. ClientOid is different from the order ID created by the service provider. Please do not initiate requests using the same clientOid. The maximum length for the ClientOid is 40 characters.\n\nPlease remember the orderId created by the service provider, it used to check for updates in order status.", - "examples": [ - "5c52e11203aa677f33e493fb" - ] + "description": "Only list orders for a specific symbol" }, "side": { "type": "string", - "description": "specify if the order is to 'buy' or 'sell'", "enum": [ "buy", "sell" ], - "examples": [ - "buy" - ], + "description": "buy or sell", "x-api-enum": [ { "value": "buy", - "name": "", + "name": "buy", "description": "" }, { "value": "sell", - "name": "", + "name": "sell", "description": "" } ] }, - "symbol": { - "type": "string", - "description": "symbol", - "examples": [ - "BTC-USDT", - "ETH-USDT", - "KCS-USDT" - ] - }, "type": { "type": "string", - "description": "specify if the order is an 'limit' order or 'market' order. \n\nThe type of order you specify when you place your order determines whether or not you need to request other parameters and also affects the execution of the matching engine.\n\nWhen placing a limit order, you must specify a price and size. The system will try to match the order according to market price or a price better than market price. If the order cannot be immediately matched, it will stay in the order book until it is matched or the user cancels.\n\nUnlike limit orders, the price for market orders fluctuates with market prices. When placing a market order, you do not need to specify a price, you only need to specify a quantity. Market orders are filled immediately and will not enter the order book. All market orders are takers and a taker fee will be charged.", + "description": "limit, market, limit_stop or market_stop", "enum": [ "limit", - "market" - ], - "examples": [ - "limit" + "market", + "limit_stop", + "market_stop" ], "x-api-enum": [ { "value": "limit", - "name": "", + "name": "limit", "description": "" }, { "value": "market", - "name": "", - "description": "" - } - ] - }, - "remark": { - "type": "string", - "description": "Order placement remarks, length cannot exceed 20 characters (ASCII)" - }, - "stp": { - "type": "string", - "description": "[Self Trade Prevention](apidog://link/pages/338146) is divided into four strategies: CN, CO, CB , and DC", - "enum": [ - "DC", - "CO", - "CN", - "CB" - ], - "x-api-enum": [ - { - "value": "DC", - "name": "", - "description": "" - }, - { - "value": "CO", - "name": "", + "name": "market", "description": "" }, { - "value": "CN", - "name": "", + "value": "limit_stop", + "name": "limit_stop", "description": "" }, { - "value": "CB", - "name": "", + "value": "market_stop", + "name": "market_stop", "description": "" } ] }, - "price": { - "type": "string", - "description": "Specify price for order\n\nWhen placing a limit order, the price must be based on priceIncrement for the trading pair. The price increment (priceIncrement) is the price precision for the trading pair. For example, for the BTC-USDT trading pair, the priceIncrement is 0.00001000. So the price for your orders cannot be less than 0.00001000 and must be a multiple of priceIncrement. Otherwise, the order will return an invalid priceIncrement error." - }, - "size": { - "type": "string", - "description": "Specify quantity for order\n\nWhen **type** is limit, size refers to the amount of trading targets (the asset name written in front) for the trading pair. Teh Size must be based on the baseIncrement of the trading pair. The baseIncrement represents the precision for the trading pair. The size of an order must be a positive-integer multiple of baseIncrement and must be between baseMinSize and baseMaxSize.\n\nWhen **type** is market, select one out of two: size or funds" - }, - "timeInForce": { + "tradeType": { "type": "string", - "description": "[Time in force](apidog://link/pages/338146) is a special strategy used during trading", + "description": "The type of trading : TRADE(Spot), MARGIN_TRADE (Cross Margin), MARGIN_ISOLATED_TRADE (Isolated Margin). Default is TRADE", "enum": [ - "GTC", - "GTT", - "IOC", - "FOK" + "TRADE", + "MARGIN_TRADE", + "MARGIN_ISOLATED_TRADE" ], - "default": "GTC", "x-api-enum": [ { - "value": "GTC", - "name": "", - "description": "" - }, - { - "value": "GTT", - "name": "", + "value": "TRADE", + "name": "TRADE", "description": "" }, { - "value": "IOC", - "name": "", + "value": "MARGIN_TRADE", + "name": "MARGIN_TRADE", "description": "" }, { - "value": "FOK", - "name": "", + "value": "MARGIN_ISOLATED_TRADE", + "name": "MARGIN_ISOLATED_TRADE", "description": "" } - ] - }, - "postOnly": { - "type": "boolean", - "default": false, - "description": "passive order labels, this is disabled when the order timing strategy is IOC or FOK" + ] }, - "hidden": { - "type": "boolean", - "description": "[Hidden order](apidog://link/pages/338146) or not (not shown in order book)", - "default": false + "startAt": { + "type": "integer", + "description": "Start time (milisecond)", + "format": "int64" }, - "iceberg": { - "type": "boolean", - "description": "Whether or not only visible portions of orders are shown in [Iceberg orders](apidog://link/pages/338146)", - "default": false + "endAt": { + "type": "integer", + "description": "End time (milisecond)", + "format": "int64" }, - "visibleSize": { - "type": "string", - "description": "Maximum visible quantity in iceberg orders" + "currentPage": { + "type": "integer", + "description": "current page" }, - "tags": { + "orderIds": { "type": "string", - "description": "Order tag, length cannot exceed 20 characters (ASCII)" + "description": "comma seperated order ID list" }, - "cancelAfter": { + "pageSize": { "type": "integer", - "format": "int64", - "description": "Cancel after n seconds,the order timing strategy is GTT" + "description": "page size" }, - "funds": { + "stop": { "type": "string", - "description": "When **type** is market, select one out of two: size or funds" + "description": "Order type: stop: stop loss order, oco: oco order" } - }, - "required": [ - "symbol", - "type", - "side" - ] + } }, - "example": "//limit order\n{\n \"type\": \"limit\",\n \"symbol\": \"BTC-USDT\",\n \"side\": \"buy\",\n \"price\": \"50000\",\n \"size\": \"0.00001\",\n \"clientOid\": \"5c52e11203aa677f33e493fb\",\n \"remark\": \"order remarks\"\n}\n\n//market order 1\n// {\n// \"type\": \"market\",\n// \"symbol\": \"BTC-USDT\",\n// \"side\": \"buy\",\n// \"size\": \"0.00001\",\n// \"clientOid\": \"5c52e11203aa677f33e493fc\",\n// \"remark\": \"order remarks\"\n// }\n\n//market order 2\n// {\n// \"type\": \"market\",\n// \"symbol\": \"BTC-USDT\",\n// \"side\": \"buy\",\n// \"funds\": \"1\",\n// \"clientOid\": \"5c52e11203aa677f33e493fc\",\n// \"remark\": \"order remarks\"\n// }\n", + "example": "{\n \"symbol\": \"BTC-USDT\",\n \"orderId\": \"670fd33bf9406e0007ab3945\",\n \"newPrice\": \"30000\",\n \"newSize\": \"0.0001\"\n}", "mediaType": "" }, - "description": ":::info[Description]\nPlace order to the Spot trading system, you can place two major types of orders: limit and market. Orders can only be placed if your account has sufficient funds. Once an order is placed, your funds will be put on hold for the duration of the order. The amount of funds on hold depends on the order type and parameters specified.\n:::\n\n:::tip[Tips]\nPlease note that once your order enters the order book, the system will freeze the handling fees for the order ahead of time.\n\nBefore placing orders, please be sure to fully understand the meaning of the parameters for each trading pair.\n:::\n\n:::tip[Tips]\nThe maximum number of active orders per account is 2000, with a maximum of 200 active orders per trading pair.\n:::\n\n\n**Public order placement request parameters**\n\n| Param | Type | Mandatory | Description |\n| --------- | ------ | --------- | ----------- |\n| clientOid | String | No | Client Order Id,unique identifier created by the user, the use of UUID is recommended |\n| symbol | String | Yes | symbol |\n| type | String | Yes | Order type `limit` and `market` |\n| side | String | Yes | `buy` or `sell` |\n| stp | String | No | self trade prevention is divided into four strategies: `CN`, `CO`, `CB` , and `DC` |\n| tags | String | No | Order tag, length cannot exceed `20` characters (ASCII) |\n| remark | String | No | Order placement remarks, length cannot exceed `20` characters (ASCII) |\n\n**Additional Request Parameters Required by `limit` Orders**\n\n| Param | Type | Mandatory | Description |\n| ----------- | ------- | --------- | ----------- |\n| price | String | Yes | Specify price for currency |\n| size | String | Yes | Specify quantity for currency |\n| timeInForce | String | No | Order timing strategy `GTC`, `GTT`, `IOC`, `FOK` (The default is `GTC`) |\n| cancelAfter | long | No | Cancel after `n` seconds,the order timing strategy is `GTT` |\n| postOnly | boolean | No | passive order labels, this is disabled when the order timing strategy is `IOC` or `FOK` |\n| hidden | boolean | No | Hidden or not (not shown in order book) |\n| iceberg | boolean | No | Whether or not only visible portions of orders are shown in iceberg orders |\n| visibleSize | String | No | Maximum visible quantity in iceberg orders |\n\n**Additional request parameters required by `market` orders**\n\n| Param | Type | Mandatory | Description |\n| ----- | ------ | --------- | ------------------------------------------ |\n| size | String | No | (Select one out of two: `size` or `funds`) |\n| funds | String | No | (Select one out of two: `size` or `funds`) |\n\n\n\n**Hold**\n\nFor limit price purchase orders, we will hold the amount of funds (price * size) required for your purchase order. Similarly, for limit price sell orders, we will also hold you sell order assets. When the transaction is executed, the service fees will be calculated. If you cancel a portion of a filled or unfilled order, then the remaining funds or amounts will be released and returned to your account. For market price buy/sell orders that require specific funds, we will hold the required funds in from your account. If only the size is specified, we may freeze (usually for a very short amount of time) all of the funds in your account prior to the order being filled or cancelled.\n\n\n**Order Lifecycle**\n\nWhen an order placement request is successful (the matching engine receives the order) or denied (due to there being insufficient funds or illegal parameter values, etc.), the system will respond to the HTTP request. When an order is successfully placed, the order ID is returned. The order will be matched, which could result in it being fully or partially filled. When an order is fully or partially filled, the remaining portions of the order will be in an active state awaiting to be matched (this does not include IOC orders). Orders that are fully or partially filled(already cancelled) will be put into the “done” state.\n\nUsers that have subscribed to the Market Data Channel can use the order ID (orderId) and client ID (clientOid) to identify messages.\n\n**Price Protection Mechanisms**\n\nPrice protection mechanisms ae enabled for order placements. Rules are detailed below:\n\n- If the spot trading market order/limit order placed by the user can be directly matched with an order in the current order book, the system will judge whether deviation between the price corresponding to the transaction depth and the spread exceeds the threshold value (the threshold value can be obtained using the symbol API endpoint);\n\n- If it is exceeded, for limit orders, the order will be directly cancelled;\n\n- If it is a market order, then the system will partially execute the order. The execution limit will be the order size within the price range corresponding to the threshold value. The remaining orders will not be filled.\n\nFor example: if the threshold value is 10%, when a user places a market price purchase order in the KCS/USDT trading market for 10,000 USDT (the selling price is currently 1.20000), the system will determine that after the order is completely filled, the final price will be 1.40000. (1.40000-1.20000)/1.20000=16.7%>10%. The threshold value is 1.32000. The user’s market price purchase order will be filled only to a maximum of 1.32000. The remaining order portions will not be matched with orders in the order book. Note: this feature may not be able to determine depth with complete accuracy. If your order is not completely filled, it may be because the portion exceeding the threshold value was not filled.\n", - "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"Spot\",\"api-rate-limit-pool\":\"Spot\",\"sdk-service\":\"Spot\",\"sdk-sub-service\":\"Order\",\"sdk-method-name\":\"addOrder\",\"sdk-method-description\":\"Place order to the Spot trading system, you can place two major types of orders: limit and market. Orders can only be placed if your account has sufficient funds. Once an order is placed, your funds will be put on hold for the duration of the order. The amount of funds on hold depends on the order type and parameters specified.\",\"api-rate-limit\":1}" + "description": ":::info[Description]\nRequest via this interface to get a stop order information via the clientOid.\n\n:::\n\n\n:::tip[Example]\n```json\n{\n \"id\": \"vs8hoo8q2ceshiue003b67c0\",\n \"symbol\": \"KCS-USDT\",\n \"userId\": \"60fe4956c43cbc0006562c2c\",\n \"status\": \"NEW\",\n \"type\": \"limit\",\n \"side\": \"buy\",\n \"price\": \"0.01000000000000000000\",\n \"size\": \"0.01000000000000000000\",\n \"funds\": null,\n \"stp\": null,\n \"timeInForce\": \"GTC\",\n \"cancelAfter\": -1,\n \"postOnly\": false,\n \"hidden\": false,\n \"iceberg\": false,\n \"visibleSize\": null,\n \"channel\": \"API\",\n \"clientOid\": \"40e0eb9efe6311eb8e58acde48001122\",\n \"remark\": null,\n \"tags\": null,\n \"orderTime\": 1629098781127530345,\n \"domainId\": \"kucoin\",\n \"tradeSource\": \"USER\",\n \"tradeType\": \"TRADE\",\n \"feeCurrency\": \"USDT\",\n \"takerFeeRate\": \"0.00200000000000000000\",\n \"makerFeeRate\": \"0.00200000000000000000\",\n \"createdAt\": 1629098781128,\n \"stop\": \"loss\",\n \"stopTriggerTime\": null,\n \"stopPrice\": \"10.00000000000000000000\"\n}\n```\n:::", + "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"General\",\"api-rate-limit-pool\":\"Spot\",\"sdk-service\":\"Spot\",\"sdk-sub-service\":\"Order\",\"sdk-method-name\":\"getStopOrderByClientOid\",\"sdk-method-description\":\"This interface is to obtain Spot stop order details by orderId\",\"api-rate-limit\":3}" } }, { @@ -18718,53 +18132,546 @@ "type": "string", "description": "The limit order price after take-profit and stop-loss are triggered." }, - "tradeType": { - "type": "string", - "description": "Transaction Type, currently only supports TRADE (spot transactions), the default is TRADE", - "enum": [ - "TRADE" - ], - "x-api-enum": [ - { - "value": "TRADE", - "name": "TRADE", - "description": "Spot Trading" - } - ] - } + "tradeType": { + "type": "string", + "description": "Transaction Type, currently only supports TRADE (spot transactions), the default is TRADE", + "enum": [ + "TRADE" + ], + "x-api-enum": [ + { + "value": "TRADE", + "name": "TRADE", + "description": "Spot Trading" + } + ] + } + }, + "required": [ + "symbol", + "side", + "clientOid", + "price", + "size", + "stopPrice", + "limitPrice" + ] + }, + "example": "{\n \"symbol\": \"BTC-USDT\",\n \"side\": \"buy\",\n \"price\": \"94000\",\n \"size\": \"0.1\",\n \"clientOid\": \"5c52e11203aa67f1e493fb\",\n \"stopPrice\": \"98000\",\n \"limitPrice\": \"96000\",\n \"remark\": \"this is remark\",\n \"tradeType\": \"TRADE\"\n}", + "mediaType": "" + }, + "description": ":::info[Description]\nPlace OCO order to the Spot trading system\n:::\n\n:::tip[Tips]\nThe maximum untriggered stop orders for a single trading pair in one account is 20.\n:::\n", + "customApiFields": "{\"abandon\":\"abandon\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"Spot\",\"api-rate-limit-pool\":\"Spot\",\"sdk-service\":\"Spot\",\"sdk-sub-service\":\"Order\",\"sdk-method-name\":\"addOcoOrder\",\"sdk-method-description\":\"Place OCO order to the Spot trading system\",\"api-rate-limit\":2}" + } + }, + { + "name": "Cancel OCO Order By OrderId", + "api": { + "id": "3470354", + "method": "delete", + "path": "/api/v3/oco/order/{orderId}", + "parameters": { + "query": [], + "path": [ + { + "id": "orderId#0", + "name": "orderId", + "required": true, + "description": "The unique order id generated by the trading system", + "example": "674c316e688dea0007c7b986", + "type": "string", + "enable": true + } + ], + "cookie": [], + "header": [] + }, + "responses": [ + { + "id": "10608", + "code": 200, + "name": "OK", + "headers": [], + "jsonSchema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "object", + "properties": { + "cancelledOrderIds": { + "type": "array", + "items": { + "type": "string" + }, + "description": "List of two order IDs related to the canceled OCO order" + } + }, + "required": [ + "cancelledOrderIds" + ] + } + }, + "required": [ + "code", + "data" + ] + }, + "description": "", + "contentType": "json", + "mediaType": "" + } + ], + "responseExamples": [ + { + "name": "Success", + "data": "{\r\n \"code\": \"200000\",\r\n \"data\": {\r\n \"cancelledOrderIds\": [\r\n \"vs93gpqc6kkmkk57003gok16\",\r\n \"vs93gpqc6kkmkk57003gok17\"\r\n ]\r\n }\r\n}", + "responseId": 10608, + "ordering": 1 + } + ], + "requestBody": { + "type": "none", + "parameters": [], + "jsonSchema": { + "type": "object", + "properties": {} + }, + "example": "{\n \"symbol\": \"BTC-USDT\",\n \"orderId\": \"670fd33bf9406e0007ab3945\",\n \"newPrice\": \"30000\",\n \"newSize\": \"0.0001\"\n}", + "mediaType": "" + }, + "description": ":::info[Description]\nRequest via this endpoint to cancel a single oco order previously placed.\n\nYou will receive cancelledOrderIds field once the system has received the cancellation request. The cancellation request will be processed by the matching engine in sequence. To know if the request is processed (successfully or not), you may check the order status or the update message from the pushes.\n:::", + "customApiFields": "{\"abandon\":\"abandon\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"Spot\",\"api-rate-limit-pool\":\"Spot\",\"sdk-service\":\"Spot\",\"sdk-sub-service\":\"Order\",\"sdk-method-name\":\"cancelOcoOrderByOrderId\",\"sdk-method-description\":\"This endpoint can be used to cancel a spot order by orderId. This endpoint only sends cancellation requests. The results of the requests must be obtained by checking the order status or subscribing to websocket.\",\"api-rate-limit\":3}" + } + }, + { + "name": "Cancel OCO Order By ClientOid", + "api": { + "id": "3470355", + "method": "delete", + "path": "/api/v3/oco/client-order/{clientOid}", + "parameters": { + "query": [], + "path": [ + { + "id": "clientOid#0", + "name": "clientOid", + "required": true, + "description": "Client Order Id,unique identifier created by the user", + "type": "string", + "enable": true, + "example": "5c52e11203aa67f1e493fb" + } + ], + "cookie": [], + "header": [] + }, + "responses": [ + { + "id": "10578", + "code": 200, + "name": "OK", + "headers": [], + "jsonSchema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "object", + "properties": { + "cancelledOrderIds": { + "type": "array", + "items": { + "type": "string" + }, + "description": "List of two order IDs related to the canceled OCO order" + } + }, + "required": [ + "cancelledOrderIds" + ] + } + }, + "required": [ + "code", + "data" + ] + }, + "description": "", + "contentType": "json", + "mediaType": "" + } + ], + "responseExamples": [ + { + "name": "Success", + "data": "{\r\n \"code\": \"200000\",\r\n \"data\": {\r\n \"cancelledOrderIds\": [\r\n \"vs93gpqc6r0mkk57003gok3h\",\r\n \"vs93gpqc6r0mkk57003gok3i\"\r\n ]\r\n }\r\n}", + "responseId": 10578, + "ordering": 1 + } + ], + "requestBody": { + "type": "none", + "parameters": [], + "jsonSchema": { + "type": "object", + "properties": {} + }, + "example": "{\n \"symbol\": \"BTC-USDT\",\n \"orderId\": \"670fd33bf9406e0007ab3945\",\n \"newPrice\": \"30000\",\n \"newSize\": \"0.0001\"\n}", + "mediaType": "" + }, + "description": ":::info[Description]\nRequest via this interface to cancel a stop order via the clientOid.\n\nYou will receive cancelledOrderIds field once the system has received the cancellation request. The cancellation request will be processed by the matching engine in sequence. To know if the request is processed (successfully or not), you may check the order status or the update message from the pushes.\n:::", + "customApiFields": "{\"abandon\":\"abandon\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"Spot\",\"api-rate-limit-pool\":\"Spot\",\"sdk-service\":\"Spot\",\"sdk-sub-service\":\"Order\",\"sdk-method-name\":\"cancelOcoOrderByClientOid\",\"sdk-method-description\":\"Request via this interface to cancel a stop order via the clientOid. You will receive cancelledOrderIds field once the system has received the cancellation request. The cancellation request will be processed by the matching engine in sequence. To know if the request is processed (successfully or not), you may check the order status or the update message from the pushes.\",\"api-rate-limit\":3}" + } + }, + { + "name": "Batch Cancel OCO Order", + "api": { + "id": "3470356", + "method": "delete", + "path": "/api/v3/oco/orders", + "parameters": { + "query": [ + { + "required": false, + "description": "Specify the order id, there can be multiple orders, separated by commas. If not passed, all oco orders will be canceled by default.", + "type": "string", + "id": "k4wDZR9oG9", + "enable": true, + "name": "orderIds", + "example": "674c388172cf2800072ee746,674c38bdfd8300000795167e" + }, + { + "required": false, + "description": "trading pair. If not passed, the oco orders of all symbols will be canceled by default.", + "type": "string", + "id": "VGVVOaGkpz", + "enable": true, + "name": "symbol", + "example": "BTC-USDT" + } + ], + "path": [], + "cookie": [], + "header": [] + }, + "responses": [ + { + "id": "10609", + "code": 200, + "name": "OK", + "headers": [], + "jsonSchema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "object", + "properties": { + "cancelledOrderIds": { + "type": "array", + "items": { + "type": "string" + }, + "description": "List of two order IDs related to the canceled OCO order" + } + }, + "required": [ + "cancelledOrderIds" + ] + } + }, + "required": [ + "code", + "data" + ] + }, + "description": "", + "contentType": "json", + "mediaType": "" + } + ], + "responseExamples": [ + { + "name": "Success", + "data": "{\r\n \"code\": \"200000\",\r\n \"data\": {\r\n \"cancelledOrderIds\": [\r\n \"vs93gpqc750mkk57003gok6i\",\r\n \"vs93gpqc750mkk57003gok6j\",\r\n \"vs93gpqc75c39p83003tnriu\",\r\n \"vs93gpqc75c39p83003tnriv\"\r\n ]\r\n }\r\n}", + "responseId": 10609, + "ordering": 1 + } + ], + "requestBody": { + "type": "none", + "parameters": [], + "jsonSchema": { + "type": "object", + "properties": {} + }, + "example": "{\n \"symbol\": \"BTC-USDT\",\n \"orderId\": \"670fd33bf9406e0007ab3945\",\n \"newPrice\": \"30000\",\n \"newSize\": \"0.0001\"\n}", + "mediaType": "" + }, + "description": ":::info[Description]\nThis interface can batch cancel OCO orders through orderIds.\n\nYou will receive cancelledOrderIds field once the system has received the cancellation request. The cancellation request will be processed by the matching engine in sequence. To know if the request is processed (successfully or not), you may check the order status or the update message from the pushes.\n:::", + "customApiFields": "{\"abandon\":\"abandon\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"Spot\",\"api-rate-limit-pool\":\"Spot\",\"sdk-service\":\"Spot\",\"sdk-sub-service\":\"Order\",\"sdk-method-name\":\"batchCancelOcoOrders\",\"sdk-method-description\":\"This interface can batch cancel OCO orders through orderIds. You will receive cancelledOrderIds field once the system has received the cancellation request. The cancellation request will be processed by the matching engine in sequence. To know if the request is processed (successfully or not), you may check the order status or the update message from the pushes.\",\"api-rate-limit\":3}" + } + }, + { + "name": "Get OCO Order By OrderId", + "api": { + "id": "3470357", + "method": "get", + "path": "/api/v3/oco/order/{orderId}", + "parameters": { + "query": [], + "path": [ + { + "id": "orderId#0", + "name": "orderId", + "required": true, + "description": "The unique order id generated by the trading system", + "type": "string", + "enable": true, + "example": "674c3b6e688dea0007c7bab2" + } + ], + "cookie": [], + "header": [] + }, + "responses": [ + { + "id": "10579", + "code": 200, + "name": "OK", + "headers": [], + "jsonSchema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "object", + "properties": { + "symbol": { + "type": "string", + "description": "symbol" + }, + "clientOid": { + "type": "string", + "description": "Client Order Id" + }, + "orderId": { + "type": "string", + "description": "The unique order id generated by the trading system,which can be used later for further actions such as canceling the order." + }, + "orderTime": { + "type": "integer", + "description": "Order placement time, milliseconds", + "format": "int64" + }, + "status": { + "type": "string", + "description": "Order status: NEW: New, DONE: Completed, TRIGGERED: Triggered, CANCELLED: Cancelled", + "enum": [ + "NEW", + "DONE", + "TRIGGERED", + "CANCELLED" + ], + "x-api-enum": [ + { + "value": "NEW", + "name": "NEW", + "description": "New" + }, + { + "value": "DONE", + "name": "DONE", + "description": "Completed" + }, + { + "value": "TRIGGERED", + "name": "TRIGGERED", + "description": "Triggered" + }, + { + "value": "CANCELLED", + "name": "CANCELLED", + "description": "Cancelled" + } + ] + } + }, + "required": [ + "orderId", + "symbol", + "clientOid", + "orderTime", + "status" + ] + } + }, + "required": [ + "code", + "data" + ] + }, + "description": "", + "contentType": "json", + "mediaType": "" + } + ], + "responseExamples": [ + { + "name": "Success", + "data": "{\r\n \"code\": \"200000\",\r\n \"data\": {\r\n \"orderId\": \"674c3b6e688dea0007c7bab2\",\r\n \"symbol\": \"BTC-USDT\",\r\n \"clientOid\": \"5c52e1203aa6f37f1e493fb\",\r\n \"orderTime\": 1733049198863,\r\n \"status\": \"NEW\"\r\n }\r\n}", + "responseId": 10579, + "ordering": 1 + } + ], + "requestBody": { + "type": "none", + "parameters": [], + "jsonSchema": { + "type": "object", + "properties": {} + }, + "example": "{\n \"symbol\": \"BTC-USDT\",\n \"orderId\": \"670fd33bf9406e0007ab3945\",\n \"newPrice\": \"30000\",\n \"newSize\": \"0.0001\"\n}", + "mediaType": "" + }, + "description": ":::info[Description]\nRequest via this interface to get a oco order information via the order ID.\n:::", + "customApiFields": "{\"abandon\":\"abandon\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"General\",\"api-rate-limit-pool\":\"Spot\",\"sdk-service\":\"Spot\",\"sdk-sub-service\":\"Order\",\"sdk-method-name\":\"getOcoOrderByOrderId\",\"sdk-method-description\":\"Request via this interface to get a oco order information via the order ID.\",\"api-rate-limit\":2}" + } + }, + { + "name": "Get OCO Order By ClientOid", + "api": { + "id": "3470358", + "method": "get", + "path": "/api/v3/oco/client-order/{clientOid}", + "parameters": { + "query": [], + "path": [ + { + "id": "clientOid#0", + "name": "clientOid", + "required": true, + "description": "Client Order Id,unique identifier created by the user", + "type": "string", + "enable": true, + "example": "5c52e1203aa6f3g7f1e493fb" + } + ], + "cookie": [], + "header": [] + }, + "responses": [ + { + "id": "10580", + "code": 200, + "name": "OK", + "headers": [], + "jsonSchema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "object", + "properties": { + "symbol": { + "type": "string", + "description": "symbol" + }, + "clientOid": { + "type": "string", + "description": "Client Order Id" + }, + "orderId": { + "type": "string", + "description": "The unique order id generated by the trading system,which can be used later for further actions such as canceling the order." + }, + "orderTime": { + "type": "integer", + "description": "Order placement time, milliseconds", + "format": "int64" + }, + "status": { + "type": "string", + "description": "Order status: NEW: New, DONE: Completed, TRIGGERED: Triggered, CANCELLED: Cancelled" + } + }, + "required": [ + "orderId", + "symbol", + "clientOid", + "orderTime", + "status" + ] + } + }, + "required": [ + "code", + "data" + ] }, - "required": [ - "symbol", - "side", - "clientOid", - "price", - "size", - "stopPrice", - "limitPrice" - ] + "description": "", + "contentType": "json", + "mediaType": "" + } + ], + "responseExamples": [ + { + "name": "Success", + "data": "{\r\n \"code\": \"200000\",\r\n \"data\": {\r\n \"orderId\": \"674c3cfa72cf2800072ee7ce\",\r\n \"symbol\": \"BTC-USDT\",\r\n \"clientOid\": \"5c52e1203aa6f3g7f1e493fb\",\r\n \"orderTime\": 1733049594803,\r\n \"status\": \"NEW\"\r\n }\r\n}", + "responseId": 10580, + "ordering": 1 + } + ], + "requestBody": { + "type": "none", + "parameters": [], + "jsonSchema": { + "type": "object", + "properties": {} }, - "example": "{\n \"symbol\": \"BTC-USDT\",\n \"side\": \"buy\",\n \"price\": \"94000\",\n \"size\": \"0.1\",\n \"clientOid\": \"5c52e11203aa67f1e493fb\",\n \"stopPrice\": \"98000\",\n \"limitPrice\": \"96000\",\n \"remark\": \"this is remark\",\n \"tradeType\": \"TRADE\"\n}", + "example": "{\n \"symbol\": \"BTC-USDT\",\n \"orderId\": \"670fd33bf9406e0007ab3945\",\n \"newPrice\": \"30000\",\n \"newSize\": \"0.0001\"\n}", "mediaType": "" }, - "description": ":::info[Description]\nPlace OCO order to the Spot trading system\n:::\n\n:::tip[Tips]\nThe maximum untriggered stop orders for a single trading pair in one account is 20.\n:::\n", - "customApiFields": "{\"abandon\":\"abandon\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"Spot\",\"api-rate-limit-pool\":\"Spot\",\"sdk-service\":\"Spot\",\"sdk-sub-service\":\"Order\",\"sdk-method-name\":\"addOcoOrder\",\"sdk-method-description\":\"Place OCO order to the Spot trading system\",\"api-rate-limit\":2}" + "description": ":::info[Description]\nRequest via this interface to get a oco order information via the client order ID.\n:::", + "customApiFields": "{\"abandon\":\"abandon\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"General\",\"api-rate-limit-pool\":\"Spot\",\"sdk-service\":\"Spot\",\"sdk-sub-service\":\"Order\",\"sdk-method-name\":\"getOcoOrderByClientOid\",\"sdk-method-description\":\"Request via this interface to get a oco order information via the client order ID.\",\"api-rate-limit\":2}" } }, { - "name": "Add Stop Order", + "name": "Get OCO Order Detail By OrderId", "api": { - "id": "3470334", - "method": "post", - "path": "/api/v1/stop-order", + "id": "3470359", + "method": "get", + "path": "/api/v3/oco/order/details/{orderId}", "parameters": { "query": [], - "path": [], + "path": [ + { + "id": "orderId#0", + "name": "orderId", + "required": true, + "description": "The unique order id generated by the trading system", + "type": "string", + "enable": true, + "example": "674c3b6e688dea0007c7bab2" + } + ], "cookie": [], "header": [] }, "responses": [ { - "id": "10651", + "id": "10610", "code": 200, "name": "OK", "headers": [], @@ -18781,14 +18688,69 @@ "type": "string", "description": "The unique order id generated by the trading system,which can be used later for further actions such as canceling the order." }, + "symbol": { + "type": "string", + "description": "symbol" + }, "clientOid": { "type": "string", - "description": "The user self-defined order id." + "description": "Client Order Id" + }, + "orderTime": { + "type": "integer", + "description": "Order placement time, milliseconds", + "format": "int64" + }, + "status": { + "type": "string", + "description": "Order status: NEW: New, DONE: Completed, TRIGGERED: Triggered, CANCELLED: Cancelled" + }, + "orders": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "symbol": { + "type": "string" + }, + "side": { + "type": "string" + }, + "price": { + "type": "string" + }, + "stopPrice": { + "type": "string" + }, + "size": { + "type": "string" + }, + "status": { + "type": "string" + } + }, + "required": [ + "id", + "symbol", + "side", + "price", + "stopPrice", + "size", + "status" + ] + } } }, "required": [ "orderId", - "clientOid" + "symbol", + "clientOid", + "orderTime", + "status", + "orders" ] } }, @@ -18805,205 +18767,243 @@ "responseExamples": [ { "name": "Success", - "data": "{\"code\":\"200000\",\"data\":{\"orderId\":\"670fd33bf9406e0007ab3945\",\"clientOid\":\"5c52e11203aa677f33e493fb\"}}", - "responseId": 10651, + "data": "{\r\n \"code\": \"200000\",\r\n \"data\": {\r\n \"orderId\": \"674c3b6e688dea0007c7bab2\",\r\n \"symbol\": \"BTC-USDT\",\r\n \"clientOid\": \"5c52e1203aa6f37f1e493fb\",\r\n \"orderTime\": 1733049198863,\r\n \"status\": \"NEW\",\r\n \"orders\": [\r\n {\r\n \"id\": \"vs93gpqc7dn6h3fa003sfelj\",\r\n \"symbol\": \"BTC-USDT\",\r\n \"side\": \"buy\",\r\n \"price\": \"94000.00000000000000000000\",\r\n \"stopPrice\": \"94000.00000000000000000000\",\r\n \"size\": \"0.10000000000000000000\",\r\n \"status\": \"NEW\"\r\n },\r\n {\r\n \"id\": \"vs93gpqc7dn6h3fa003sfelk\",\r\n \"symbol\": \"BTC-USDT\",\r\n \"side\": \"buy\",\r\n \"price\": \"96000.00000000000000000000\",\r\n \"stopPrice\": \"98000.00000000000000000000\",\r\n \"size\": \"0.10000000000000000000\",\r\n \"status\": \"NEW\"\r\n }\r\n ]\r\n }\r\n}", + "responseId": 10610, "ordering": 1 } ], "requestBody": { - "type": "application/json", + "type": "none", "parameters": [], "jsonSchema": { "type": "object", - "properties": { - "clientOid": { - "type": "string", - "description": "Client Order Id,The ClientOid field is a unique ID created by the user(we recommend using a UUID), and can only contain numbers, letters, underscores (_), and hyphens (-). This field is returned when order information is obtained. You can use clientOid to tag your orders. ClientOid is different from the order ID created by the service provider. Please do not initiate requests using the same clientOid. The maximum length for the ClientOid is 40 characters.\n\nPlease remember the orderId created by the service provider, it used to check for updates in order status.", - "examples": [ - "5c52e11203aa677f33e493fb" - ] - }, - "side": { - "type": "string", - "description": "specify if the order is to 'buy' or 'sell'", - "enum": [ - "buy", - "sell" - ], - "examples": [ - "buy" - ], - "x-api-enum": [ - { - "value": "buy", - "name": "", - "description": "" - }, - { - "value": "sell", - "name": "", - "description": "" - } - ] - }, - "symbol": { + "properties": {} + }, + "example": "{\n \"symbol\": \"BTC-USDT\",\n \"orderId\": \"670fd33bf9406e0007ab3945\",\n \"newPrice\": \"30000\",\n \"newSize\": \"0.0001\"\n}", + "mediaType": "" + }, + "description": ":::info[Description]\nRequest via this interface to get a oco order detail via the order ID.\n:::", + "customApiFields": "{\"abandon\":\"abandon\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"General\",\"api-rate-limit-pool\":\"Spot\",\"sdk-service\":\"Spot\",\"sdk-sub-service\":\"Order\",\"sdk-method-name\":\"getOcoOrderDetailByOrderId\",\"sdk-method-description\":\"Request via this interface to get a oco order detail via the order ID.\",\"api-rate-limit\":2}" + } + }, + { + "name": "Get OCO Order List", + "api": { + "id": "3470360", + "method": "get", + "path": "/api/v3/oco/orders", + "parameters": { + "query": [ + { + "required": false, + "description": "symbol", + "type": "string", + "id": "k5kTqKOh1U", + "enable": true, + "name": "symbol", + "schema": { "type": "string", - "description": "symbol", "examples": [ "BTC-USDT", "ETH-USDT", "KCS-USDT" ] - }, - "type": { - "type": "string", - "description": "specify if the order is an 'limit' order or 'market' order. \n\nThe type of order you specify when you place your order determines whether or not you need to request other parameters and also affects the execution of the matching engine.\n\nWhen placing a limit order, you must specify a price and size. The system will try to match the order according to market price or a price better than market price. If the order cannot be immediately matched, it will stay in the order book until it is matched or the user cancels.\n\nUnlike limit orders, the price for market orders fluctuates with market prices. When placing a market order, you do not need to specify a price, you only need to specify a quantity. Market orders are filled immediately and will not enter the order book. All market orders are takers and a taker fee will be charged.", - "enum": [ - "limit", - "market" - ], - "examples": [ - "limit" - ], - "x-api-enum": [ - { - "value": "limit", - "name": "", - "description": "" - }, - { - "value": "market", - "name": "", - "description": "" - } - ] - }, - "remark": { - "type": "string", - "description": "Order placement remarks, length cannot exceed 20 characters (ASCII)" - }, - "stp": { - "type": "string", - "description": "[Self Trade Prevention](apidog://link/pages/338146) is divided into four strategies: CN, CO, CB , and DC", - "enum": [ - "DC", - "CO", - "CN", - "CB" - ], - "x-api-enum": [ - { - "value": "DC", - "name": "", - "description": "" - }, - { - "value": "CO", - "name": "", - "description": "" - }, - { - "value": "CN", - "name": "", - "description": "" - }, - { - "value": "CB", - "name": "", - "description": "" - } - ] - }, - "price": { - "type": "string", - "description": "Specify price for order, not need for market order.\n\nWhen placing a limit order, the price must be based on priceIncrement for the trading pair. The price increment (priceIncrement) is the price precision for the trading pair. For example, for the BTC-USDT trading pair, the priceIncrement is 0.00001000. So the price for your orders cannot be less than 0.00001000 and must be a multiple of priceIncrement. Otherwise, the order will return an invalid priceIncrement error." - }, - "size": { - "type": "string", - "description": "Specify quantity for order\n\nWhen **type** is limit, size refers to the amount of trading targets (the asset name written in front) for the trading pair. Teh Size must be based on the baseIncrement of the trading pair. The baseIncrement represents the precision for the trading pair. The size of an order must be a positive-integer multiple of baseIncrement and must be between baseMinSize and baseMaxSize.\n\nWhen **type** is market, select one out of two: size or funds" - }, - "timeInForce": { - "type": "string", - "description": "[Time in force](apidog://link/pages/338146) is a special strategy used during trading. Required for limit orders.", - "enum": [ - "GTC", - "GTT", - "IOC", - "FOK" - ], - "default": "GTC", - "x-api-enum": [ - { - "value": "GTC", - "name": "", - "description": "" - }, - { - "value": "GTT", - "name": "", - "description": "" - }, - { - "value": "IOC", - "name": "", - "description": "" - }, - { - "value": "FOK", - "name": "", - "description": "" - } - ] - }, - "postOnly": { - "type": "boolean", - "description": "passive order labels, this is disabled when the order timing strategy is IOC or FOK if **type** is limit.", - "default": false - }, - "hidden": { - "type": "boolean", - "description": "[Hidden order](apidog://link/pages/338146) or not (not shown in order book)", - "default": false - }, - "iceberg": { - "type": "boolean", - "description": "Whether or not only visible portions of orders are shown in [Iceberg orders](apidog://link/pages/338146)", - "default": false - }, - "visibleSize": { - "type": "string", - "description": "When **type** is limit, this is Maximum visible quantity in iceberg orders." - }, - "cancelAfter": { + } + }, + { + "required": false, + "description": "Start time (milliseconds)", + "type": "integer", + "id": "3gEHqfvq1R", + "enable": true, + "name": "startAt", + "schema": { "type": "integer", - "description": "Cancel after n seconds,the order timing strategy is GTT when **type** is limit.", "format": "int64" - }, - "funds": { - "type": "string", - "description": "When **type** is market, select one out of two: size or funds" - }, - "stopPrice": { - "type": "string", - "description": "The trigger price." - }, - "tradeType": { - "type": "string", - "description": "The type of trading : TRADE(Spot), MARGIN_TRADE (Cross Margin), MARGIN_ISOLATED_TRADE (Isolated Margin). Default is TRADE" } }, - "required": [ - "symbol", - "type", - "side", - "stopPrice" - ] + { + "required": false, + "description": "End time (milliseconds)", + "type": "integer", + "id": "qfsVt7qQe8", + "enable": true, + "name": "endAt", + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "required": false, + "description": "Specify orderId collection, up to 500 orders\n", + "type": "string", + "id": "ZFIKYx3RJH", + "enable": true, + "name": "orderIds" + }, + { + "required": false, + "description": "Size per page, minimum value 10, maximum value 500", + "type": "integer", + "id": "FJH8SIb2XY", + "enable": true, + "name": "pageSize", + "schema": { + "type": "integer", + "minimum": 10, + "maximum": 500, + "default": 50 + } + }, + { + "required": false, + "description": "Page number, minimum value 1\n", + "type": "integer", + "id": "sSsAg6Hbjc", + "enable": true, + "name": "currentPage", + "schema": { + "type": "integer", + "default": 1 + } + } + ], + "path": [], + "cookie": [], + "header": [] + }, + "responses": [ + { + "id": "10581", + "code": 200, + "name": "OK", + "headers": [], + "jsonSchema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "object", + "properties": { + "currentPage": { + "type": "integer" + }, + "pageSize": { + "type": "integer" + }, + "totalNum": { + "type": "integer" + }, + "totalPage": { + "type": "integer" + }, + "items": { + "type": "array", + "items": { + "type": "object", + "properties": { + "orderId": { + "type": "string", + "description": "The unique order id generated by the trading system,which can be used later for further actions such as canceling the order." + }, + "symbol": { + "type": "string", + "description": "symbol" + }, + "clientOid": { + "type": "string", + "description": "Client Order Id" + }, + "orderTime": { + "type": "integer", + "description": "Order placement time, milliseconds", + "format": "int64" + }, + "status": { + "type": "string", + "description": "Order status: NEW: New, DONE: Completed, TRIGGERED: Triggered, CANCELLED: Cancelled", + "enum": [ + "NEW", + "DONE", + "TRIGGERED", + "CANCELLED" + ], + "x-api-enum": [ + { + "value": "NEW", + "name": "NEW", + "description": "New" + }, + { + "value": "DONE", + "name": "DONE", + "description": "Completed" + }, + { + "value": "TRIGGERED", + "name": "TRIGGERED", + "description": "Triggered" + }, + { + "value": "CANCELLED", + "name": "CANCELLED", + "description": "Cancelled" + } + ] + } + }, + "required": [ + "orderId", + "symbol", + "clientOid", + "orderTime", + "status" + ] + } + } + }, + "required": [ + "currentPage", + "pageSize", + "totalNum", + "totalPage", + "items" + ] + } + }, + "required": [ + "code", + "data" + ] + }, + "description": "", + "contentType": "json", + "mediaType": "" + } + ], + "responseExamples": [ + { + "name": "Success", + "data": "{\r\n \"code\": \"200000\",\r\n \"data\": {\r\n \"currentPage\": 1,\r\n \"pageSize\": 50,\r\n \"totalNum\": 1,\r\n \"totalPage\": 1,\r\n \"items\": [\r\n {\r\n \"orderId\": \"674c3cfa72cf2800072ee7ce\",\r\n \"symbol\": \"BTC-USDT\",\r\n \"clientOid\": \"5c52e1203aa6f3g7f1e493fb\",\r\n \"orderTime\": 1733049594803,\r\n \"status\": \"NEW\"\r\n }\r\n ]\r\n }\r\n}", + "responseId": 10581, + "ordering": 1 + } + ], + "requestBody": { + "type": "none", + "parameters": [], + "jsonSchema": { + "type": "object", + "properties": {} }, - "example": "//limit order\n{\n \"type\": \"limit\",\n \"symbol\": \"BTC-USDT\",\n \"side\": \"buy\",\n \"price\": \"50000\",\n \"size\": \"0.00001\",\n \"clientOid\": \"5c52e11203aa677f33e493fb\",\n \"remark\": \"order remarks\"\n}\n\n//market order 1\n// {\n// \"type\": \"market\",\n// \"symbol\": \"BTC-USDT\",\n// \"side\": \"buy\",\n// \"size\": \"0.00001\",\n// \"clientOid\": \"5c52e11203aa677f33e493fc\",\n// \"remark\": \"order remarks\"\n// }\n\n//market order 2\n// {\n// \"type\": \"market\",\n// \"symbol\": \"BTC-USDT\",\n// \"side\": \"buy\",\n// \"funds\": \"1\",\n// \"clientOid\": \"5c52e11203aa677f33e493fc\",\n// \"remark\": \"order remarks\"\n// }\n", + "example": "{\n \"symbol\": \"BTC-USDT\",\n \"orderId\": \"670fd33bf9406e0007ab3945\",\n \"newPrice\": \"30000\",\n \"newSize\": \"0.0001\"\n}", "mediaType": "" }, - "description": ":::info[Description]\nPlace stop order to the Spot trading system. The maximum untriggered stop orders for a single trading pair in one account is 20.\n:::\n\n", - "customApiFields": "{\"abandon\":\"abandon\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"Spot\",\"api-rate-limit-pool\":\"Spot\",\"sdk-service\":\"Spot\",\"sdk-sub-service\":\"Order\",\"sdk-method-name\":\"addStopOrder\",\"sdk-method-description\":\"Place stop order to the Spot trading system, you can place two major types of orders: limit and market. Orders can only be placed if your account has sufficient funds. Once an order is placed, your funds will be put on hold for the duration of the order. The amount of funds on hold depends on the order type and parameters specified.\",\"api-rate-limit\":1}" + "description": ":::info[Description]\nRequest via this endpoint to get your current OCO order list. Items are paginated and sorted to show the latest first. See the Pagination section for retrieving additional entries after the first page.\n:::", + "customApiFields": "{\"abandon\":\"abandon\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"General\",\"api-rate-limit-pool\":\"Spot\",\"sdk-service\":\"Spot\",\"sdk-sub-service\":\"Order\",\"sdk-method-name\":\"getOcoOrderList\",\"sdk-method-description\":\"Request via this endpoint to get your current OCO order list. Items are paginated and sorted to show the latest first. See the Pagination section for retrieving additional entries after the first page.\",\"api-rate-limit\":2}" } } ] @@ -19501,7 +19501,488 @@ }, "responses": [ { - "id": "10357", + "id": "10357", + "code": 200, + "name": "OK", + "headers": [], + "jsonSchema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "object", + "properties": { + "symbol": { + "type": "string", + "description": "symbol" + }, + "timePoint": { + "type": "integer", + "description": "Timestamp (milliseconds)", + "format": "int64" + }, + "value": { + "type": "number", + "description": "Mark price" + } + }, + "required": [ + "symbol", + "timePoint", + "value" + ] + } + }, + "required": [ + "code", + "data" + ] + }, + "description": "", + "contentType": "json", + "mediaType": "" + } + ], + "responseExamples": [ + { + "name": "Success", + "data": "{\n \"code\": \"200000\",\n \"data\": {\n \"symbol\": \"USDT-BTC\",\n \"timePoint\": 1729676888000,\n \"value\": 1.5045E-5\n }\n}", + "responseId": 10357, + "ordering": 1 + } + ], + "requestBody": { + "type": "none", + "parameters": [], + "jsonSchema": { + "type": "object", + "properties": {} + }, + "example": "{\n \"currency\": \"USDT\",\n \"size\": 10,\n \"timeInForce\": \"FOK\",\n \"isIsolated\": false,\n \"isHf\": false\n}", + "mediaType": "" + }, + "description": ":::info[Description]\nThis endpoint returns the current Mark price for specified margin trading pairs.\n:::", + "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Spot\",\"api-channel\":\"Public\",\"api-permission\":\"NULL\",\"api-rate-limit-pool\":\"Public\",\"sdk-service\":\"Margin\",\"sdk-sub-service\":\"Market\",\"sdk-method-name\":\"getMarkPriceDetail\",\"sdk-method-description\":\"This endpoint returns the current Mark price for specified margin trading pairs.\",\"api-rate-limit\":2}" + } + }, + { + "name": "Get Symbols - Isolated Margin", + "api": { + "id": "3470194", + "method": "get", + "path": "/api/v1/isolated/symbols", + "parameters": { + "query": [], + "path": [], + "cookie": [], + "header": [] + }, + "responses": [ + { + "id": "10358", + "code": 200, + "name": "OK", + "headers": [], + "jsonSchema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "array", + "items": { + "type": "object", + "properties": { + "symbol": { + "type": "string", + "description": "symbol" + }, + "symbolName": { + "type": "string", + "description": "symbol name" + }, + "baseCurrency": { + "type": "string", + "description": "Base currency,e.g. BTC." + }, + "quoteCurrency": { + "type": "string", + "description": "Quote currency,e.g. USDT." + }, + "maxLeverage": { + "type": "integer", + "description": "Max leverage of this symbol" + }, + "flDebtRatio": { + "type": "string" + }, + "tradeEnable": { + "type": "boolean" + }, + "autoRenewMaxDebtRatio": { + "type": "string" + }, + "baseBorrowEnable": { + "type": "boolean" + }, + "quoteBorrowEnable": { + "type": "boolean" + }, + "baseTransferInEnable": { + "type": "boolean" + }, + "quoteTransferInEnable": { + "type": "boolean" + }, + "baseBorrowCoefficient": { + "type": "string" + }, + "quoteBorrowCoefficient": { + "type": "string" + } + }, + "required": [ + "symbol", + "symbolName", + "baseCurrency", + "quoteCurrency", + "maxLeverage", + "flDebtRatio", + "tradeEnable", + "autoRenewMaxDebtRatio", + "baseBorrowEnable", + "quoteBorrowEnable", + "baseTransferInEnable", + "quoteTransferInEnable", + "baseBorrowCoefficient", + "quoteBorrowCoefficient" + ] + } + } + }, + "required": [ + "code", + "data" + ] + }, + "description": "", + "contentType": "json", + "mediaType": "" + } + ], + "responseExamples": [ + { + "name": "Success", + "data": "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"symbol\": \"BTC-USDT\",\n \"symbolName\": \"BTC-USDT\",\n \"baseCurrency\": \"BTC\",\n \"quoteCurrency\": \"USDT\",\n \"maxLeverage\": 10,\n \"flDebtRatio\": \"0.97\",\n \"tradeEnable\": true,\n \"autoRenewMaxDebtRatio\": \"0.96\",\n \"baseBorrowEnable\": true,\n \"quoteBorrowEnable\": true,\n \"baseTransferInEnable\": true,\n \"quoteTransferInEnable\": true,\n \"baseBorrowCoefficient\": \"1\",\n \"quoteBorrowCoefficient\": \"1\"\n }\n ]\n}", + "responseId": 10358, + "ordering": 1 + } + ], + "requestBody": { + "type": "none", + "parameters": [], + "jsonSchema": { + "type": "object", + "properties": {} + }, + "example": "{\n \"currency\": \"USDT\",\n \"size\": 10,\n \"timeInForce\": \"FOK\",\n \"isIsolated\": false,\n \"isHf\": false\n}", + "mediaType": "" + }, + "description": ":::info[Description]\nThis endpoint allows querying the configuration of isolated margin symbol.\n:::", + "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Spot\",\"api-channel\":\"Public\",\"api-permission\":\"NULL\",\"api-rate-limit-pool\":\"Public\",\"sdk-service\":\"Margin\",\"sdk-sub-service\":\"Market\",\"sdk-method-name\":\"getIsolatedMarginSymbols\",\"sdk-method-description\":\"This endpoint allows querying the configuration of isolated margin symbol.\",\"api-rate-limit\":3}" + } + } + ] + }, + { + "name": "Orders", + "id": 348149, + "description": "", + "items": [ + { + "name": "Add Order", + "api": { + "id": "3470204", + "method": "post", + "path": "/api/v3/hf/margin/order", + "parameters": { + "query": [], + "path": [], + "cookie": [], + "header": [] + }, + "responses": [ + { + "id": "10368", + "code": 200, + "name": "OK", + "headers": [], + "jsonSchema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "object", + "properties": { + "orderId": { + "type": "string", + "description": "The unique order id generated by the trading system,which can be used later for further actions such as canceling the order." + }, + "loanApplyId": { + "type": "string", + "description": "Borrow order id. The field is returned only after placing the order under the mode of Auto-Borrow." + }, + "borrowSize": { + "type": "string", + "description": "Borrowed amount. The field is returned only after placing the order under the mode of Auto-Borrow." + }, + "clientOid": { + "type": "string", + "description": "The user self-defined order id." + } + }, + "required": [ + "orderId", + "borrowSize", + "clientOid", + "loanApplyId" + ] + } + }, + "required": [ + "code", + "data" + ] + }, + "description": "", + "contentType": "json", + "mediaType": "" + } + ], + "responseExamples": [ + { + "name": "Success", + "data": "{\n \"success\": true,\n \"code\": \"200000\",\n \"data\": {\n \"orderId\": \"671663e02188630007e21c9c\",\n \"clientOid\": \"5c52e11203aa677f33e1493fb\",\n \"borrowSize\": \"10.2\",\n \"loanApplyId\": \"600656d9a33ac90009de4f6f\"\n }\n}", + "responseId": 10368, + "ordering": 1 + } + ], + "requestBody": { + "type": "application/json", + "parameters": [], + "jsonSchema": { + "type": "object", + "properties": { + "clientOid": { + "type": "string", + "description": "Client Order Id,The ClientOid field is a unique ID created by the user(we recommend using a UUID), and can only contain numbers, letters, underscores (_), and hyphens (-). This field is returned when order information is obtained. You can use clientOid to tag your orders. ClientOid is different from the order ID created by the service provider. Please do not initiate requests using the same clientOid. The maximum length for the ClientOid is 40 characters.\n\nPlease remember the orderId created by the service provider, it used to check for updates in order status.", + "examples": [ + "5c52e11203aa677f33e493fb" + ] + }, + "side": { + "type": "string", + "description": "specify if the order is to 'buy' or 'sell'", + "enum": [ + "buy", + "sell" + ], + "examples": [ + "buy" + ], + "x-api-enum": [ + { + "value": "buy", + "name": "", + "description": "" + }, + { + "value": "sell", + "name": "", + "description": "" + } + ] + }, + "symbol": { + "type": "string", + "description": "symbol", + "examples": [ + "BTC-USDT", + "ETH-USDT", + "KCS-USDT" + ] + }, + "type": { + "type": "string", + "description": "specify if the order is an 'limit' order or 'market' order. \n\nThe type of order you specify when you place your order determines whether or not you need to request other parameters and also affects the execution of the matching engine.\n\nWhen placing a limit order, you must specify a price and size. The system will try to match the order according to market price or a price better than market price. If the order cannot be immediately matched, it will stay in the order book until it is matched or the user cancels.\n\nUnlike limit orders, the price for market orders fluctuates with market prices. When placing a market order, you do not need to specify a price, you only need to specify a quantity. Market orders are filled immediately and will not enter the order book. All market orders are takers and a taker fee will be charged.", + "enum": [ + "limit", + "market" + ], + "default": "limit", + "x-api-enum": [ + { + "value": "limit", + "name": "", + "description": "" + }, + { + "value": "market", + "name": "", + "description": "" + } + ] + }, + "stp": { + "type": "string", + "description": "[Self Trade Prevention](apidog://link/pages/338146) is divided into these strategies: CN, CO, CB , and DC", + "enum": [ + "DC", + "CO", + "CN", + "CB" + ], + "x-api-enum": [ + { + "value": "DC", + "name": "", + "description": "" + }, + { + "value": "CO", + "name": "", + "description": "" + }, + { + "value": "CN", + "name": "", + "description": "" + }, + { + "value": "CB", + "name": "", + "description": "" + } + ] + }, + "price": { + "type": "string", + "description": "Specify price for order\n\nWhen placing a limit order, the price must be based on priceIncrement for the trading pair. The price increment (priceIncrement) is the price precision for the trading pair. For example, for the BTC-USDT trading pair, the priceIncrement is 0.00001000. So the price for your orders cannot be less than 0.00001000 and must be a multiple of priceIncrement. Otherwise, the order will return an invalid priceIncrement error." + }, + "size": { + "type": "string", + "description": "Specify quantity for order\n\nWhen **type** is limit, size refers to the amount of trading targets (the asset name written in front) for the trading pair. Teh Size must be based on the baseIncrement of the trading pair. The baseIncrement represents the precision for the trading pair. The size of an order must be a positive-integer multiple of baseIncrement and must be between baseMinSize and baseMaxSize.\n\nWhen **type** is market, select one out of two: size or funds" + }, + "timeInForce": { + "type": "string", + "description": "[Time in force](apidog://link/pages/5176570) is a special strategy used during trading", + "enum": [ + "GTC", + "GTT", + "IOC", + "FOK" + ], + "default": "GTC", + "x-api-enum": [ + { + "value": "GTC", + "name": "", + "description": "" + }, + { + "value": "GTT", + "name": "", + "description": "" + }, + { + "value": "IOC", + "name": "", + "description": "" + }, + { + "value": "FOK", + "name": "", + "description": "" + } + ] + }, + "postOnly": { + "type": "boolean", + "default": false, + "description": "passive order labels, this is disabled when the order timing strategy is IOC or FOK" + }, + "hidden": { + "type": "boolean", + "description": "[Hidden order](apidog://link/pages/338146) or not (not shown in order book)", + "default": false + }, + "iceberg": { + "type": "boolean", + "description": "Whether or not only visible portions of orders are shown in [Iceberg orders](apidog://link/pages/338146)", + "default": false + }, + "visibleSize": { + "type": "string", + "description": "Maximum visible quantity in iceberg orders" + }, + "cancelAfter": { + "type": "integer", + "format": "int64", + "description": "Cancel after n seconds,the order timing strategy is GTT" + }, + "funds": { + "type": "string", + "description": "When **type** is market, select one out of two: size or funds" + }, + "isIsolated": { + "type": "boolean", + "description": "true - isolated margin ,false - cross margin. defult as false", + "default": false + }, + "autoBorrow": { + "type": "boolean", + "description": "When Margin Account has inefficient balance, our system autoborrows inefficient assets and opens positions according to the lowest market interest rate.", + "default": false + }, + "autoRepay": { + "type": "boolean", + "description": "AutoPay allows returning borrowed assets when you close a position. Our system automatically triggers the repayment and the maximum repayment amount equals to the filled-order amount.", + "default": false + } + }, + "required": [ + "symbol", + "side", + "clientOid" + ] + }, + "example": "//limit order\n{\n \"type\": \"limit\",\n \"symbol\": \"BTC-USDT\",\n \"side\": \"buy\",\n \"price\": \"50000\",\n \"size\": \"0.00001\",\n \"clientOid\": \"5c52e11203aa677f33e493fb\",\n \"remark\": \"order remarks\"\n}\n\n//market order 1\n// {\n// \"type\": \"market\",\n// \"symbol\": \"BTC-USDT\",\n// \"side\": \"buy\",\n// \"size\": \"0.00001\",\n// \"clientOid\": \"5c52e11203aa677f33e493fc\",\n// \"remark\": \"order remarks\"\n// }\n\n//market order 2\n// {\n// \"type\": \"market\",\n// \"symbol\": \"BTC-USDT\",\n// \"side\": \"buy\",\n// \"funds\": \"1\",\n// \"clientOid\": \"5c52e11203aa677f33e493fc\",\n// \"remark\": \"order remarks\"\n// }\n", + "mediaType": "" + }, + "description": ":::info[Description]\nPlace order to the Cross-margin or Isolated-margin trading system, you can place two major types of orders: limit and market. Orders can only be placed if your account has sufficient funds. Once an order is placed, your funds will be put on hold for the duration of the order. The amount of funds on hold depends on the order type and parameters specified.\n:::\n\n:::tip[Tips]\nPlease note that once your order enters the order book, the system will freeze the handling fees for the order ahead of time.\n\nBefore placing orders, please be sure to fully understand the meaning of the parameters for each trading pair.\n:::\n\n:::tip[Tips]\nThe maximum number of active orders per account is 2000, with a maximum of 200 active orders per trading pair.\n:::\n\n\n**Public order placement request parameters**\n\n| Param | Type | Mandatory | Description |\n| --------- | ------ | --------- | ----------- |\n| clientOid | String | Yes | Client Order Id,unique identifier created by the user, the use of UUID is recommended |\n| symbol | String | Yes | symbol |\n| side | String | Yes | `buy` or `sell` |\n| type | String | No | Order type `limit` and `market`, defult is limit |\n| stp | String | No | self trade prevention is divided into four strategies: `CN`, `CO`, `CB` , and `DC` |\n| isIsolated | boolean | No | true - isolated margin ,false - cross margin. defult as false |\n| autoBorrow | boolean | No | When Margin Account has inefficient balance, our system autoborrows inefficient assets and opens positions according to the lowest market interest rate. |\n| autoRepay | boolean | No | AutoPay allows returning borrowed assets when you close a position. Our system automatically triggers the repayment and the maximum repayment amount equals to the filled-order amount. |\n\n**Additional Request Parameters Required by `limit` Orders**\n\n| Param | Type | Mandatory | Description |\n| ----------- | ------- | --------- | ----------- |\n| price | String | Yes | Specify price for currency |\n| size | String | Yes | Specify quantity for currency |\n| timeInForce | String | No | Order timing strategy `GTC`, `GTT`, `IOC`, `FOK` (The default is `GTC`) |\n| cancelAfter | long | No | Cancel after `n` seconds,the order timing strategy is `GTT` |\n| postOnly | boolean | No | passive order labels, this is disabled when the order timing strategy is `IOC` or `FOK` |\n| hidden | boolean | No | Hidden or not (not shown in order book) |\n| iceberg | boolean | No | Whether or not only visible portions of orders are shown in iceberg orders |\n| visibleSize | String | No | Maximum visible quantity in iceberg orders |\n\n**Additional request parameters required by `market` orders**\n\n| Param | Type | Mandatory | Description |\n| ----- | ------ | --------- | ------------------------------------------ |\n| size | String | No | (Select one out of two: `size` or `funds`) |\n| funds | String | No | (Select one out of two: `size` or `funds`) |\n\n\n**Hold**\n\nFor limit price purchase orders, we will hold the amount of funds (price * size) required for your purchase order. Similarly, for limit price sell orders, we will also hold you sell order assets. When the transaction is executed, the service fees will be calculated. If you cancel a portion of a filled or unfilled order, then the remaining funds or amounts will be released and returned to your account. For market price buy/sell orders that require specific funds, we will hold the required funds in from your account. If only the size is specified, we may freeze (usually for a very short amount of time) all of the funds in your account prior to the order being filled or cancelled.\n\n\n**Order Lifecycle**\n\nWhen an order placement request is successful (the matching engine receives the order) or denied (due to there being insufficient funds or illegal parameter values, etc.), the system will respond to the HTTP request. When an order is successfully placed, the order ID is returned. The order will be matched, which could result in it being fully or partially filled. When an order is fully or partially filled, the remaining portions of the order will be in an active state awaiting to be matched (this does not include IOC orders). Orders that are fully or partially filled(already cancelled) will be put into the “done” state.\n\nUsers that have subscribed to the Market Data Channel can use the order ID (orderId) and client ID (clientOid) to identify messages.\n\n**Price Protection Mechanisms**\n\nPrice protection mechanisms ae enabled for order placements. Rules are detailed below:\n\n- If the spot trading market order/limit order placed by the user can be directly matched with an order in the current order book, the system will judge whether deviation between the price corresponding to the transaction depth and the spread exceeds the threshold value (the threshold value can be obtained using the symbol API endpoint);\n\n- If it is exceeded, for limit orders, the order will be directly cancelled;\n\n- If it is a market order, then the system will partially execute the order. The execution limit will be the order size within the price range corresponding to the threshold value. The remaining orders will not be filled.\n\nFor example: if the threshold value is 10%, when a user places a market price purchase order in the KCS/USDT trading market for 10,000 USDT (the selling price is currently 1.20000), the system will determine that after the order is completely filled, the final price will be 1.40000. (1.40000-1.20000)/1.20000=16.7%>10%. The threshold value is 1.32000. The user’s market price purchase order will be filled only to a maximum of 1.32000. The remaining order portions will not be matched with orders in the order book. Note: this feature may not be able to determine depth with complete accuracy. If your order is not completely filled, it may be because the portion exceeding the threshold value was not filled.\n", + "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"Margin\",\"api-rate-limit-pool\":\"Spot\",\"sdk-service\":\"Margin\",\"sdk-sub-service\":\"Order\",\"sdk-method-name\":\"addOrder\",\"sdk-method-description\":\"Place order to the Cross-margin or Isolated-margin trading system, you can place two major types of orders: limit and market. Orders can only be placed if your account has sufficient funds. Once an order is placed, your funds will be put on hold for the duration of the order. The amount of funds on hold depends on the order type and parameters specified.\",\"api-rate-limit\":5}" + } + }, + { + "name": "Add Order Test", + "api": { + "id": "3470205", + "method": "post", + "path": "/api/v3/hf/margin/order/test", + "parameters": { + "query": [], + "path": [], + "cookie": [], + "header": [] + }, + "responses": [ + { + "id": "10369", "code": 200, "name": "OK", "headers": [], @@ -19514,24 +19995,28 @@ "data": { "type": "object", "properties": { - "symbol": { + "orderId": { "type": "string", - "description": "symbol" + "description": "The unique order id generated by the trading system,which can be used later for further actions such as canceling the order." }, - "timePoint": { - "type": "integer", - "description": "Timestamp (milliseconds)", - "format": "int64" + "loanApplyId": { + "type": "string", + "description": "Borrowed amount. The field is returned only after placing the order under the mode of Auto-Borrow." }, - "value": { + "borrowSize": { "type": "number", - "description": "Mark price" + "description": "ID of the borrowing response. The field is returned only after placing the order under the mode of Auto-Borrow." + }, + "clientOid": { + "type": "string", + "description": "The user self-defined order id." } }, "required": [ - "symbol", - "timePoint", - "value" + "orderId", + "borrowSize", + "clientOid", + "loanApplyId" ] } }, @@ -19548,40 +20033,248 @@ "responseExamples": [ { "name": "Success", - "data": "{\n \"code\": \"200000\",\n \"data\": {\n \"symbol\": \"USDT-BTC\",\n \"timePoint\": 1729676888000,\n \"value\": 1.5045E-5\n }\n}", - "responseId": 10357, + "data": "{\n \"success\": true,\n \"code\": \"200000\",\n \"data\": {\n \"orderId\": \"5bd6e9286d99522a52e458de\",\n \"clientOid\": \"5c52e11203aa677f33e493fb\",\n \"borrowSize\": 10.2,\n \"loanApplyId\": \"600656d9a33ac90009de4f6f\"\n }\n}", + "responseId": 10369, "ordering": 1 } ], "requestBody": { - "type": "none", + "type": "application/json", "parameters": [], "jsonSchema": { "type": "object", - "properties": {} + "properties": { + "clientOid": { + "type": "string", + "description": "Client Order Id,The ClientOid field is a unique ID created by the user(we recommend using a UUID), and can only contain numbers, letters, underscores (_), and hyphens (-). This field is returned when order information is obtained. You can use clientOid to tag your orders. ClientOid is different from the order ID created by the service provider. Please do not initiate requests using the same clientOid. The maximum length for the ClientOid is 40 characters.\n\nPlease remember the orderId created by the service provider, it used to check for updates in order status.", + "examples": [ + "5c52e11203aa677f33e493fb" + ] + }, + "side": { + "type": "string", + "description": "specify if the order is to 'buy' or 'sell'", + "enum": [ + "buy", + "sell" + ], + "examples": [ + "buy" + ], + "x-api-enum": [ + { + "value": "buy", + "name": "", + "description": "" + }, + { + "value": "sell", + "name": "", + "description": "" + } + ] + }, + "symbol": { + "type": "string", + "description": "symbol", + "examples": [ + "BTC-USDT", + "ETH-USDT", + "KCS-USDT" + ] + }, + "type": { + "type": "string", + "description": "specify if the order is an 'limit' order or 'market' order. \n\nThe type of order you specify when you place your order determines whether or not you need to request other parameters and also affects the execution of the matching engine.\n\nWhen placing a limit order, you must specify a price and size. The system will try to match the order according to market price or a price better than market price. If the order cannot be immediately matched, it will stay in the order book until it is matched or the user cancels.\n\nUnlike limit orders, the price for market orders fluctuates with market prices. When placing a market order, you do not need to specify a price, you only need to specify a quantity. Market orders are filled immediately and will not enter the order book. All market orders are takers and a taker fee will be charged.", + "enum": [ + "limit", + "market" + ], + "default": "limit", + "x-api-enum": [ + { + "value": "limit", + "name": "", + "description": "" + }, + { + "value": "market", + "name": "", + "description": "" + } + ] + }, + "stp": { + "type": "string", + "description": "[Self Trade Prevention](apidog://link/pages/338146) is divided into these strategies: CN, CO, CB , and DC", + "enum": [ + "DC", + "CO", + "CN", + "CB" + ], + "x-api-enum": [ + { + "value": "DC", + "name": "", + "description": "" + }, + { + "value": "CO", + "name": "", + "description": "" + }, + { + "value": "CN", + "name": "", + "description": "" + }, + { + "value": "CB", + "name": "", + "description": "" + } + ] + }, + "price": { + "type": "string", + "description": "Specify price for order\n\nWhen placing a limit order, the price must be based on priceIncrement for the trading pair. The price increment (priceIncrement) is the price precision for the trading pair. For example, for the BTC-USDT trading pair, the priceIncrement is 0.00001000. So the price for your orders cannot be less than 0.00001000 and must be a multiple of priceIncrement. Otherwise, the order will return an invalid priceIncrement error." + }, + "size": { + "type": "string", + "description": "Specify quantity for order\n\nWhen **type** is limit, size refers to the amount of trading targets (the asset name written in front) for the trading pair. Teh Size must be based on the baseIncrement of the trading pair. The baseIncrement represents the precision for the trading pair. The size of an order must be a positive-integer multiple of baseIncrement and must be between baseMinSize and baseMaxSize.\n\nWhen **type** is market, select one out of two: size or funds" + }, + "timeInForce": { + "type": "string", + "description": "[Time in force](apidog://link/pages/5176570) is a special strategy used during trading", + "enum": [ + "GTC", + "GTT", + "IOC", + "FOK" + ], + "default": "GTC", + "x-api-enum": [ + { + "value": "GTC", + "name": "", + "description": "" + }, + { + "value": "GTT", + "name": "", + "description": "" + }, + { + "value": "IOC", + "name": "", + "description": "" + }, + { + "value": "FOK", + "name": "", + "description": "" + } + ] + }, + "postOnly": { + "type": "boolean", + "default": false, + "description": "passive order labels, this is disabled when the order timing strategy is IOC or FOK" + }, + "hidden": { + "type": "boolean", + "description": "[Hidden order](apidog://link/pages/338146) or not (not shown in order book)", + "default": false + }, + "iceberg": { + "type": "boolean", + "description": "Whether or not only visible portions of orders are shown in [Iceberg orders](apidog://link/pages/338146)", + "default": false + }, + "visibleSize": { + "type": "string", + "description": "Maximum visible quantity in iceberg orders" + }, + "cancelAfter": { + "type": "integer", + "format": "int64", + "description": "Cancel after n seconds,the order timing strategy is GTT" + }, + "funds": { + "type": "string", + "description": "When **type** is market, select one out of two: size or funds" + }, + "isIsolated": { + "type": "boolean", + "description": "true - isolated margin ,false - cross margin. defult as false", + "default": false + }, + "autoBorrow": { + "type": "boolean", + "description": "When Margin Account has inefficient balance, our system autoborrows inefficient assets and opens positions according to the lowest market interest rate.", + "default": false + }, + "autoRepay": { + "type": "boolean", + "description": "AutoPay allows returning borrowed assets when you close a position. Our system automatically triggers the repayment and the maximum repayment amount equals to the filled-order amount.", + "default": false + } + }, + "required": [ + "symbol", + "side", + "clientOid" + ] }, - "example": "{\n \"currency\": \"USDT\",\n \"size\": 10,\n \"timeInForce\": \"FOK\",\n \"isIsolated\": false,\n \"isHf\": false\n}", + "example": "//limit order\n{\n \"type\": \"limit\",\n \"symbol\": \"BTC-USDT\",\n \"side\": \"buy\",\n \"price\": \"50000\",\n \"size\": \"0.00001\",\n \"clientOid\": \"5c52e11203aa677f33e493fb\",\n \"remark\": \"order remarks\"\n}\n\n//market order 1\n// {\n// \"type\": \"market\",\n// \"symbol\": \"BTC-USDT\",\n// \"side\": \"buy\",\n// \"size\": \"0.00001\",\n// \"clientOid\": \"5c52e11203aa677f33e493fc\",\n// \"remark\": \"order remarks\"\n// }\n\n//market order 2\n// {\n// \"type\": \"market\",\n// \"symbol\": \"BTC-USDT\",\n// \"side\": \"buy\",\n// \"funds\": \"1\",\n// \"clientOid\": \"5c52e11203aa677f33e493fc\",\n// \"remark\": \"order remarks\"\n// }\n", "mediaType": "" }, - "description": ":::info[Description]\nThis endpoint returns the current Mark price for specified margin trading pairs.\n:::", - "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Spot\",\"api-channel\":\"Public\",\"api-permission\":\"NULL\",\"api-rate-limit-pool\":\"Public\",\"sdk-service\":\"Margin\",\"sdk-sub-service\":\"Market\",\"sdk-method-name\":\"getMarkPriceDetail\",\"sdk-method-description\":\"This endpoint returns the current Mark price for specified margin trading pairs.\",\"api-rate-limit\":2}" + "description": ":::info[Description]\nOrder test endpoint, the request parameters and return parameters of this endpoint are exactly the same as the order endpoint, and can be used to verify whether the signature is correct and other operations. After placing an order, the order will not enter the matching system, and the order cannot be queried.\n:::\n\n:::tip[Tips]\nPlease note that once your order enters the order book, the system will freeze the handling fees for the order ahead of time.\n\nBefore placing orders, please be sure to fully understand the meaning of the parameters for each trading pair.\n:::\n\n:::tip[Tips]\nThe maximum number of active orders per account is 2000, with a maximum of 200 active orders per trading pair.\n:::\n\n\n**Public order placement request parameters**\n\n| Param | Type | Mandatory | Description |\n| --------- | ------ | --------- | ----------- |\n| clientOid | String | Yes | Client Order Id,unique identifier created by the user, the use of UUID is recommended |\n| symbol | String | Yes | symbol |\n| side | String | Yes | `buy` or `sell` |\n| type | String | No | Order type `limit` and `market`, defult is limit |\n| stp | String | No | self trade prevention is divided into four strategies: `CN`, `CO`, `CB` , and `DC` |\n| isIsolated | boolean | No | true - isolated margin ,false - cross margin. defult as false |\n| autoBorrow | boolean | No | When Margin Account has inefficient balance, our system autoborrows inefficient assets and opens positions according to the lowest market interest rate. |\n| autoRepay | boolean | No | AutoPay allows returning borrowed assets when you close a position. Our system automatically triggers the repayment and the maximum repayment amount equals to the filled-order amount. |\n\n**Additional Request Parameters Required by `limit` Orders**\n\n| Param | Type | Mandatory | Description |\n| ----------- | ------- | --------- | ----------- |\n| price | String | Yes | Specify price for currency |\n| size | String | Yes | Specify quantity for currency |\n| timeInForce | String | No | Order timing strategy `GTC`, `GTT`, `IOC`, `FOK` (The default is `GTC`) |\n| cancelAfter | long | No | Cancel after `n` seconds,the order timing strategy is `GTT` |\n| postOnly | boolean | No | passive order labels, this is disabled when the order timing strategy is `IOC` or `FOK` |\n| hidden | boolean | No | Hidden or not (not shown in order book) |\n| iceberg | boolean | No | Whether or not only visible portions of orders are shown in iceberg orders |\n| visibleSize | String | No | Maximum visible quantity in iceberg orders |\n\n**Additional request parameters required by `market` orders**\n\n| Param | Type | Mandatory | Description |\n| ----- | ------ | --------- | ------------------------------------------ |\n| size | String | No | (Select one out of two: `size` or `funds`) |\n| funds | String | No | (Select one out of two: `size` or `funds`) |\n\n\n**Hold**\n\nFor limit price purchase orders, we will hold the amount of funds (price * size) required for your purchase order. Similarly, for limit price sell orders, we will also hold you sell order assets. When the transaction is executed, the service fees will be calculated. If you cancel a portion of a filled or unfilled order, then the remaining funds or amounts will be released and returned to your account. For market price buy/sell orders that require specific funds, we will hold the required funds in from your account. If only the size is specified, we may freeze (usually for a very short amount of time) all of the funds in your account prior to the order being filled or cancelled.\n\n\n**Order Lifecycle**\n\nWhen an order placement request is successful (the matching engine receives the order) or denied (due to there being insufficient funds or illegal parameter values, etc.), the system will respond to the HTTP request. When an order is successfully placed, the order ID is returned. The order will be matched, which could result in it being fully or partially filled. When an order is fully or partially filled, the remaining portions of the order will be in an active state awaiting to be matched (this does not include IOC orders). Orders that are fully or partially filled(already cancelled) will be put into the “done” state.\n\nUsers that have subscribed to the Market Data Channel can use the order ID (orderId) and client ID (clientOid) to identify messages.\n\n**Price Protection Mechanisms**\n\nPrice protection mechanisms ae enabled for order placements. Rules are detailed below:\n\n- If the spot trading market order/limit order placed by the user can be directly matched with an order in the current order book, the system will judge whether deviation between the price corresponding to the transaction depth and the spread exceeds the threshold value (the threshold value can be obtained using the symbol API endpoint);\n\n- If it is exceeded, for limit orders, the order will be directly cancelled;\n\n- If it is a market order, then the system will partially execute the order. The execution limit will be the order size within the price range corresponding to the threshold value. The remaining orders will not be filled.\n\nFor example: if the threshold value is 10%, when a user places a market price purchase order in the KCS/USDT trading market for 10,000 USDT (the selling price is currently 1.20000), the system will determine that after the order is completely filled, the final price will be 1.40000. (1.40000-1.20000)/1.20000=16.7%>10%. The threshold value is 1.32000. The user’s market price purchase order will be filled only to a maximum of 1.32000. The remaining order portions will not be matched with orders in the order book. Note: this feature may not be able to determine depth with complete accuracy. If your order is not completely filled, it may be because the portion exceeding the threshold value was not filled.\n", + "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"Margin\",\"api-rate-limit-pool\":\"Spot\",\"sdk-service\":\"Margin\",\"sdk-sub-service\":\"Order\",\"sdk-method-name\":\"addOrderTest\",\"sdk-method-description\":\" Order test endpoint, the request parameters and return parameters of this endpoint are exactly the same as the order endpoint, and can be used to verify whether the signature is correct and other operations. After placing an order, the order will not enter the matching system, and the order cannot be queried.\",\"api-rate-limit\":5}" } }, { - "name": "Get Symbols - Isolated Margin", + "name": "Cancel Order By OrderId", "api": { - "id": "3470194", - "method": "get", - "path": "/api/v1/isolated/symbols", + "id": "3470195", + "method": "delete", + "path": "/api/v3/hf/margin/orders/{orderId}", "parameters": { - "query": [], - "path": [], + "path": [ + { + "id": "orderId#0", + "name": "orderId", + "required": true, + "description": "The unique order id generated by the trading system", + "example": "671663e02188630007e21c9c", + "type": "string" + } + ], + "query": [ + { + "id": "KXIxHhD4qw", + "name": "symbol", + "required": true, + "description": "symbol", + "example": "BTC-USDT", + "type": "string", + "schema": { + "type": "string", + "examples": [ + "BTC-USDT", + "ETH-USDT", + "KCS-USDT" + ] + } + } + ], "cookie": [], "header": [] }, "responses": [ { - "id": "10358", + "id": "10359", "code": 200, "name": "OK", "headers": [], @@ -19592,75 +20285,16 @@ "type": "string" }, "data": { - "type": "array", - "items": { - "type": "object", - "properties": { - "symbol": { - "type": "string", - "description": "symbol" - }, - "symbolName": { - "type": "string", - "description": "symbol name" - }, - "baseCurrency": { - "type": "string", - "description": "Base currency,e.g. BTC." - }, - "quoteCurrency": { - "type": "string", - "description": "Quote currency,e.g. USDT." - }, - "maxLeverage": { - "type": "integer", - "description": "Max leverage of this symbol" - }, - "flDebtRatio": { - "type": "string" - }, - "tradeEnable": { - "type": "boolean" - }, - "autoRenewMaxDebtRatio": { - "type": "string" - }, - "baseBorrowEnable": { - "type": "boolean" - }, - "quoteBorrowEnable": { - "type": "boolean" - }, - "baseTransferInEnable": { - "type": "boolean" - }, - "quoteTransferInEnable": { - "type": "boolean" - }, - "baseBorrowCoefficient": { - "type": "string" - }, - "quoteBorrowCoefficient": { - "type": "string" - } - }, - "required": [ - "symbol", - "symbolName", - "baseCurrency", - "quoteCurrency", - "maxLeverage", - "flDebtRatio", - "tradeEnable", - "autoRenewMaxDebtRatio", - "baseBorrowEnable", - "quoteBorrowEnable", - "baseTransferInEnable", - "quoteTransferInEnable", - "baseBorrowCoefficient", - "quoteBorrowCoefficient" - ] - } + "type": "object", + "properties": { + "orderId": { + "type": "string", + "description": "order id" + } + }, + "required": [ + "orderId" + ] } }, "required": [ @@ -19676,8 +20310,8 @@ "responseExamples": [ { "name": "Success", - "data": "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"symbol\": \"BTC-USDT\",\n \"symbolName\": \"BTC-USDT\",\n \"baseCurrency\": \"BTC\",\n \"quoteCurrency\": \"USDT\",\n \"maxLeverage\": 10,\n \"flDebtRatio\": \"0.97\",\n \"tradeEnable\": true,\n \"autoRenewMaxDebtRatio\": \"0.96\",\n \"baseBorrowEnable\": true,\n \"quoteBorrowEnable\": true,\n \"baseTransferInEnable\": true,\n \"quoteTransferInEnable\": true,\n \"baseBorrowCoefficient\": \"1\",\n \"quoteBorrowCoefficient\": \"1\"\n }\n ]\n}", - "responseId": 10358, + "data": "{\"code\":\"200000\",\"data\":{\"orderId\":\"671663e02188630007e21c9c\"}}", + "responseId": 10359, "ordering": 1 } ], @@ -19688,34 +20322,27 @@ "type": "object", "properties": {} }, - "example": "{\n \"currency\": \"USDT\",\n \"size\": 10,\n \"timeInForce\": \"FOK\",\n \"isIsolated\": false,\n \"isHf\": false\n}", + "example": "{\n \"symbol\": \"BTC-USDT\",\n \"orderId\": \"670fd33bf9406e0007ab3945\",\n \"newPrice\": \"30000\",\n \"newSize\": \"0.0001\"\n}", "mediaType": "" }, - "description": ":::info[Description]\nThis endpoint allows querying the configuration of isolated margin symbol.\n:::", - "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Spot\",\"api-channel\":\"Public\",\"api-permission\":\"NULL\",\"api-rate-limit-pool\":\"Public\",\"sdk-service\":\"Margin\",\"sdk-sub-service\":\"Market\",\"sdk-method-name\":\"getIsolatedMarginSymbols\",\"sdk-method-description\":\"This endpoint allows querying the configuration of isolated margin symbol.\",\"api-rate-limit\":3}" + "description": ":::info[Description]\nThis endpoint can be used to cancel a margin order by orderId.\nThis endpoint only sends cancellation requests. The results of the requests must be obtained by checking the order status or subscribing to websocket.\n:::", + "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"Margin\",\"api-rate-limit-pool\":\"Spot\",\"sdk-service\":\"Margin\",\"sdk-sub-service\":\"Order\",\"sdk-method-name\":\"cancelOrderByOrderId\",\"sdk-method-description\":\"This endpoint can be used to cancel a margin order by orderId. This endpoint only sends cancellation requests. The results of the requests must be obtained by checking the order status or subscribing to websocket.\",\"api-rate-limit\":5}" } - } - ] - }, - { - "name": "Orders", - "id": 348149, - "description": "", - "items": [ + }, { - "name": "Cancel Order By OrderId", + "name": "Cancel Order By ClientOid", "api": { - "id": "3470195", + "id": "3470201", "method": "delete", - "path": "/api/v3/hf/margin/orders/{orderId}", + "path": "/api/v3/hf/margin/orders/client-order/{clientOid}", "parameters": { "path": [ { - "id": "orderId#0", - "name": "orderId", + "id": "clientOid#0", + "name": "clientOid", "required": true, - "description": "The unique order id generated by the trading system", - "example": "671663e02188630007e21c9c", + "description": "Client Order Id,unique identifier created by the user", + "example": "5c52e11203aa677f33e1493fb", "type": "string" } ], @@ -19742,7 +20369,7 @@ }, "responses": [ { - "id": "10359", + "id": "10365", "code": 200, "name": "OK", "headers": [], @@ -19755,13 +20382,13 @@ "data": { "type": "object", "properties": { - "orderId": { + "clientOid": { "type": "string", - "description": "order id" + "description": "Client Order Id,unique identifier created by the user" } }, "required": [ - "orderId" + "clientOid" ] } }, @@ -19778,8 +20405,8 @@ "responseExamples": [ { "name": "Success", - "data": "{\"code\":\"200000\",\"data\":{\"orderId\":\"671663e02188630007e21c9c\"}}", - "responseId": 10359, + "data": "{\"code\":\"200000\",\"data\":{\"clientOid\":\"5c52e11203aa677f33e1493fb\"}}", + "responseId": 10365, "ordering": 1 } ], @@ -19793,24 +20420,40 @@ "example": "{\n \"symbol\": \"BTC-USDT\",\n \"orderId\": \"670fd33bf9406e0007ab3945\",\n \"newPrice\": \"30000\",\n \"newSize\": \"0.0001\"\n}", "mediaType": "" }, - "description": ":::info[Description]\nThis endpoint can be used to cancel a margin order by orderId.\nThis endpoint only sends cancellation requests. The results of the requests must be obtained by checking the order status or subscribing to websocket.\n:::", - "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"Margin\",\"api-rate-limit-pool\":\"Spot\",\"sdk-service\":\"Margin\",\"sdk-sub-service\":\"Order\",\"sdk-method-name\":\"cancelOrderByOrderId\",\"sdk-method-description\":\"This endpoint can be used to cancel a margin order by orderId. This endpoint only sends cancellation requests. The results of the requests must be obtained by checking the order status or subscribing to websocket.\",\"api-rate-limit\":5}" + "description": ":::info[Description]\nThis endpoint can be used to cancel a margin order by clientOid.\nThis endpoint only sends cancellation requests. The results of the requests must be obtained by checking the order status or subscribing to websocket.\n:::", + "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"Margin\",\"api-rate-limit-pool\":\"Spot\",\"sdk-service\":\"Margin\",\"sdk-sub-service\":\"Order\",\"sdk-method-name\":\"cancelOrderByClientOid\",\"sdk-method-description\":\"This endpoint can be used to cancel a margin order by clientOid. This endpoint only sends cancellation requests. The results of the requests must be obtained by checking the order status or subscribing to websocket.\",\"api-rate-limit\":5}" } }, { - "name": "Get Symbols With Open Order", + "name": "Cancel All Orders By Symbol", "api": { - "id": "3470196", - "method": "get", - "path": "/api/v3/hf/margin/order/active/symbols", + "id": "3470197", + "method": "delete", + "path": "/api/v3/hf/margin/orders", "parameters": { "path": [], "query": [ { - "id": "D8DOjyDYcq", + "id": "KXIxHhD4qw", + "name": "symbol", + "required": true, + "description": "symbol", + "example": "BTC-USDT", + "type": "string", + "schema": { + "type": "string", + "examples": [ + "BTC-USDT", + "ETH-USDT", + "KCS-USDT" + ] + } + }, + { + "id": "diFMZqfTZb", "name": "tradeType", "required": true, - "description": "Cross Margin: MARGIN_TRADE, Isolated Margin: MARGIN_ISOLATED_TRADE\n", + "description": "Transaction type: MARGIN_TRADE - cross margin trade, MARGIN_ISOLATED_TRADE - isolated margin trade", "example": "MARGIN_TRADE", "type": "string", "schema": { @@ -19839,7 +20482,7 @@ }, "responses": [ { - "id": "10360", + "id": "10361", "code": 200, "name": "OK", "headers": [], @@ -19850,24 +20493,7 @@ "type": "string" }, "data": { - "type": "object", - "properties": { - "symbolSize": { - "type": "integer", - "description": "Symbol Size" - }, - "symbols": { - "type": "array", - "items": { - "type": "string" - }, - "description": "The symbol that has active orders" - } - }, - "required": [ - "symbolSize", - "symbols" - ] + "type": "string" } }, "required": [ @@ -19883,8 +20509,8 @@ "responseExamples": [ { "name": "Success", - "data": "{\n \"code\": \"200000\",\n \"data\": {\n \"symbolSize\": 1,\n \"symbols\": [\n \"BTC-USDT\"\n ]\n }\n}", - "responseId": 10360, + "data": "{\"code\":\"200000\",\"data\":\"success\"}", + "responseId": 10361, "ordering": 1 } ], @@ -19898,40 +20524,24 @@ "example": "{\n \"symbol\": \"BTC-USDT\",\n \"orderId\": \"670fd33bf9406e0007ab3945\",\n \"newPrice\": \"30000\",\n \"newSize\": \"0.0001\"\n}", "mediaType": "" }, - "description": ":::info[Description]\nThis interface can query all Margin symbol that has active orders\n:::", - "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"Margin\",\"api-rate-limit-pool\":\"Spot\",\"sdk-service\":\"Margin\",\"sdk-sub-service\":\"Order\",\"sdk-method-name\":\"getSymbolsWithOpenOrder\",\"sdk-method-description\":\"This interface can query all Margin symbol that has active orders\",\"api-rate-limit\":2}" + "description": ":::info[Description]\nThis interface can cancel all open Margin orders by symbol\nThis endpoint only sends cancellation requests. The results of the requests must be obtained by checking the order status or subscribing to websocket.\n:::", + "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"Margin\",\"api-rate-limit-pool\":\"Spot\",\"sdk-service\":\"Margin\",\"sdk-sub-service\":\"Order\",\"sdk-method-name\":\"cancelAllOrdersBySymbol\",\"sdk-method-description\":\"This interface can cancel all open Margin orders by symbol This endpoint only sends cancellation requests. The results of the requests must be obtained by checking the order status or subscribing to websocket.\",\"api-rate-limit\":10}" } }, { - "name": "Cancel All Orders By Symbol", + "name": "Get Symbols With Open Order", "api": { - "id": "3470197", - "method": "delete", - "path": "/api/v3/hf/margin/orders", + "id": "3470196", + "method": "get", + "path": "/api/v3/hf/margin/order/active/symbols", "parameters": { "path": [], "query": [ { - "id": "KXIxHhD4qw", - "name": "symbol", - "required": true, - "description": "symbol", - "example": "BTC-USDT", - "type": "string", - "schema": { - "type": "string", - "examples": [ - "BTC-USDT", - "ETH-USDT", - "KCS-USDT" - ] - } - }, - { - "id": "diFMZqfTZb", + "id": "D8DOjyDYcq", "name": "tradeType", "required": true, - "description": "Transaction type: MARGIN_TRADE - cross margin trade, MARGIN_ISOLATED_TRADE - isolated margin trade", + "description": "Cross Margin: MARGIN_TRADE, Isolated Margin: MARGIN_ISOLATED_TRADE\n", "example": "MARGIN_TRADE", "type": "string", "schema": { @@ -19960,7 +20570,7 @@ }, "responses": [ { - "id": "10361", + "id": "10360", "code": 200, "name": "OK", "headers": [], @@ -19971,7 +20581,24 @@ "type": "string" }, "data": { - "type": "string" + "type": "object", + "properties": { + "symbolSize": { + "type": "integer", + "description": "Symbol Size" + }, + "symbols": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The symbol that has active orders" + } + }, + "required": [ + "symbolSize", + "symbols" + ] } }, "required": [ @@ -19987,8 +20614,8 @@ "responseExamples": [ { "name": "Success", - "data": "{\"code\":\"200000\",\"data\":\"success\"}", - "responseId": 10361, + "data": "{\n \"code\": \"200000\",\n \"data\": {\n \"symbolSize\": 1,\n \"symbols\": [\n \"BTC-USDT\"\n ]\n }\n}", + "responseId": 10360, "ordering": 1 } ], @@ -20002,8 +20629,8 @@ "example": "{\n \"symbol\": \"BTC-USDT\",\n \"orderId\": \"670fd33bf9406e0007ab3945\",\n \"newPrice\": \"30000\",\n \"newSize\": \"0.0001\"\n}", "mediaType": "" }, - "description": ":::info[Description]\nThis interface can cancel all open Margin orders by symbol\nThis endpoint only sends cancellation requests. The results of the requests must be obtained by checking the order status or subscribing to websocket.\n:::", - "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"Margin\",\"api-rate-limit-pool\":\"Spot\",\"sdk-service\":\"Margin\",\"sdk-sub-service\":\"Order\",\"sdk-method-name\":\"cancelAllOrdersBySymbol\",\"sdk-method-description\":\"This interface can cancel all open Margin orders by symbol This endpoint only sends cancellation requests. The results of the requests must be obtained by checking the order status or subscribing to websocket.\",\"api-rate-limit\":10}" + "description": ":::info[Description]\nThis interface can query all Margin symbol that has active orders\n:::", + "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"Margin\",\"api-rate-limit-pool\":\"Spot\",\"sdk-service\":\"Margin\",\"sdk-sub-service\":\"Order\",\"sdk-method-name\":\"getSymbolsWithOpenOrder\",\"sdk-method-description\":\"This interface can query all Margin symbol that has active orders\",\"api-rate-limit\":2}" } }, { @@ -21183,518 +21810,61 @@ "type": { "type": "string", "description": "Specify if the order is an 'limit' order or 'market' order. ", - "enum": [ - "limit", - "market" - ], - "x-api-enum": [ - { - "value": "limit", - "name": "", - "description": "" - }, - { - "value": "market", - "name": "", - "description": "" - } - ] - }, - "createdAt": { - "type": "integer", - "format": "int64" - } - }, - "required": [ - "id", - "symbol", - "tradeId", - "orderId", - "counterOrderId", - "side", - "liquidity", - "forceTaker", - "price", - "size", - "funds", - "fee", - "feeRate", - "feeCurrency", - "stop", - "tradeType", - "tax", - "taxRate", - "type", - "createdAt" - ] - } - }, - "lastId": { - "type": "integer", - "description": "The id of the last set of data from the previous batch of data. By default, the latest information is given.\nlastId is used to filter data and paginate. If lastId is not entered, the default is a maximum of 100 returned data items. The return results include lastId,which can be used as a query parameter to look up new data from the next page.", - "format": "int64" - } - }, - "required": [ - "items", - "lastId" - ] - } - }, - "required": [ - "code", - "data" - ] - }, - "description": "", - "contentType": "json", - "mediaType": "" - } - ], - "responseExamples": [ - { - "name": "Success", - "data": "{\n \"code\": \"200000\",\n \"data\": {\n \"items\": [\n {\n \"id\": 137891621991,\n \"symbol\": \"BTC-USDT\",\n \"tradeId\": 11040911994273793,\n \"orderId\": \"671868085584bc0007d85f46\",\n \"counterOrderId\": \"67186805b7cbdf00071621f9\",\n \"side\": \"buy\",\n \"liquidity\": \"taker\",\n \"forceTaker\": false,\n \"price\": \"67141.6\",\n \"size\": \"0.00001\",\n \"funds\": \"0.671416\",\n \"fee\": \"0.000671416\",\n \"feeRate\": \"0.001\",\n \"feeCurrency\": \"USDT\",\n \"stop\": \"\",\n \"tradeType\": \"MARGIN_TRADE\",\n \"tax\": \"0\",\n \"taxRate\": \"0\",\n \"type\": \"limit\",\n \"createdAt\": 1729652744998\n }\n ],\n \"lastId\": 137891621991\n }\n}", - "responseId": 10364, - "ordering": 1 - } - ], - "requestBody": { - "type": "none", - "parameters": [], - "jsonSchema": { - "type": "object", - "properties": {} - }, - "example": "{\n \"symbol\": \"BTC-USDT\",\n \"orderId\": \"670fd33bf9406e0007ab3945\",\n \"newPrice\": \"30000\",\n \"newSize\": \"0.0001\"\n}", - "mediaType": "" - }, - "description": ":::info[Description]\nThis endpoint can be used to obtain a list of the latest Margin transaction details. \nThe returned data is sorted in descending order according to the latest update time of the order.\n:::\n\n:::tip[Tips]\nIf the order is not an active order, you can only get data within the time range of 3 _ 24 hours (ie: from the current time to 3 _ 24 hours ago). If the time range is exceeded, the system will query the data within the time range of 3 * 24 hours by default.\n:::", - "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"General\",\"api-rate-limit-pool\":\"Spot\",\"sdk-service\":\"Margin\",\"sdk-sub-service\":\"Order\",\"sdk-method-name\":\"getTradeHistory\",\"sdk-method-description\":\"This endpoint can be used to obtain a list of the latest Margin transaction details. The returned data is sorted in descending order according to the latest update time of the order.\",\"api-rate-limit\":5}" - } - }, - { - "name": "Cancel Order By ClientOid", - "api": { - "id": "3470201", - "method": "delete", - "path": "/api/v3/hf/margin/orders/client-order/{clientOid}", - "parameters": { - "path": [ - { - "id": "clientOid#0", - "name": "clientOid", - "required": true, - "description": "Client Order Id,unique identifier created by the user", - "example": "5c52e11203aa677f33e1493fb", - "type": "string" - } - ], - "query": [ - { - "id": "KXIxHhD4qw", - "name": "symbol", - "required": true, - "description": "symbol", - "example": "BTC-USDT", - "type": "string", - "schema": { - "type": "string", - "examples": [ - "BTC-USDT", - "ETH-USDT", - "KCS-USDT" - ] - } - } - ], - "cookie": [], - "header": [] - }, - "responses": [ - { - "id": "10365", - "code": 200, - "name": "OK", - "headers": [], - "jsonSchema": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "data": { - "type": "object", - "properties": { - "clientOid": { - "type": "string", - "description": "Client Order Id,unique identifier created by the user" - } - }, - "required": [ - "clientOid" - ] - } - }, - "required": [ - "code", - "data" - ] - }, - "description": "", - "contentType": "json", - "mediaType": "" - } - ], - "responseExamples": [ - { - "name": "Success", - "data": "{\"code\":\"200000\",\"data\":{\"clientOid\":\"5c52e11203aa677f33e1493fb\"}}", - "responseId": 10365, - "ordering": 1 - } - ], - "requestBody": { - "type": "none", - "parameters": [], - "jsonSchema": { - "type": "object", - "properties": {} - }, - "example": "{\n \"symbol\": \"BTC-USDT\",\n \"orderId\": \"670fd33bf9406e0007ab3945\",\n \"newPrice\": \"30000\",\n \"newSize\": \"0.0001\"\n}", - "mediaType": "" - }, - "description": ":::info[Description]\nThis endpoint can be used to cancel a margin order by clientOid.\nThis endpoint only sends cancellation requests. The results of the requests must be obtained by checking the order status or subscribing to websocket.\n:::", - "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"Margin\",\"api-rate-limit-pool\":\"Spot\",\"sdk-service\":\"Margin\",\"sdk-sub-service\":\"Order\",\"sdk-method-name\":\"cancelOrderByClientOid\",\"sdk-method-description\":\"This endpoint can be used to cancel a margin order by clientOid. This endpoint only sends cancellation requests. The results of the requests must be obtained by checking the order status or subscribing to websocket.\",\"api-rate-limit\":5}" - } - }, - { - "name": "Get Order By OrderId", - "api": { - "id": "3470202", - "method": "get", - "path": "/api/v3/hf/margin/orders/{orderId}", - "parameters": { - "query": [ - { - "id": "M9bgPS6vOj", - "name": "symbol", - "required": true, - "description": "symbol", - "example": "BTC-USDT", - "type": "string", - "schema": { - "type": "string", - "examples": [ - "BTC-USDT", - "ETH-USDT", - "KCS-USDT" - ] - }, - "enable": true - } - ], - "path": [ - { - "id": "orderId#0", - "name": "orderId", - "required": true, - "description": "The unique order id generated by the trading system", - "example": "671667306afcdb000723107f", - "type": "string", - "enable": true - } - ], - "cookie": [], - "header": [] - }, - "responses": [ - { - "id": "10366", - "code": 200, - "name": "OK", - "headers": [], - "jsonSchema": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "data": { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "The unique order id generated by the trading system" - }, - "symbol": { - "type": "string", - "description": "symbol", - "examples": [ - "BTC-USDT", - "ETH-USDT", - "KCS-USDT" - ] - }, - "opType": { - "type": "string" - }, - "type": { - "type": "string", - "description": "Specify if the order is an 'limit' order or 'market' order. ", - "enum": [ - "limit", - "market" - ], - "x-api-enum": [ - { - "value": "limit", - "name": "", - "description": "" - }, - { - "value": "market", - "name": "", - "description": "" - } - ] - }, - "side": { - "type": "string", - "description": "Buy or sell", - "enum": [ - "buy", - "sell" - ], - "x-api-enum": [ - { - "value": "buy", - "name": "", - "description": "" - }, - { - "value": "sell", - "name": "", - "description": "" - } - ] - }, - "price": { - "type": "string", - "description": "Order price" - }, - "size": { - "type": "string", - "description": "Order size" - }, - "funds": { - "type": "string", - "description": "Order Funds" - }, - "dealSize": { - "type": "string", - "description": "Number of filled transactions" - }, - "dealFunds": { - "type": "string", - "description": "Funds of filled transactions" - }, - "fee": { - "type": "string", - "description": "[Handling fees](apidog://link/pages/5327739)" - }, - "feeCurrency": { - "type": "string", - "description": "currency used to calculate trading fee" - }, - "stp": { - "type": "string", - "description": "[Self Trade Prevention](apidog://link/pages/338146) is divided into these strategies: CN, CO, CB , and DC", - "enum": [ - "DC", - "CO", - "CN", - "CB" - ], - "x-api-enum": [ - { - "value": "DC", - "name": "", - "description": "" - }, - { - "value": "CO", - "name": "", - "description": "" - }, - { - "value": "CN", - "name": "", - "description": "" - }, - { - "value": "CB", - "name": "", - "description": "" - } - ] - }, - "stop": { - "type": "string" - }, - "stopTriggered": { - "type": "boolean" - }, - "stopPrice": { - "type": "string" - }, - "timeInForce": { - "type": "string", - "description": "Time in force", - "enum": [ - "GTC", - "GTT", - "IOC", - "FOK" - ], - "x-api-enum": [ - { - "value": "GTC", - "name": "", - "description": "" - }, - { - "value": "GTT", - "name": "", - "description": "" - }, - { - "value": "IOC", - "name": "", - "description": "" - }, - { - "value": "FOK", - "name": "", - "description": "" - } - ] - }, - "postOnly": { - "type": "boolean", - "description": "Whether its a postOnly order." - }, - "hidden": { - "type": "boolean", - "description": "Whether its a hidden order." - }, - "iceberg": { - "type": "boolean", - "description": "Whether its a iceberg order." - }, - "visibleSize": { - "type": "string", - "description": "Visible size of iceberg order in order book." - }, - "cancelAfter": { - "type": "integer", - "description": "A GTT timeInForce that expires in n seconds" - }, - "channel": { - "type": "string" - }, - "clientOid": { - "type": "string", - "description": "Client Order Id,unique identifier created by the user" - }, - "remark": { - "type": "string", - "description": "Order placement remarks" - }, - "tags": { - "type": "string", - "description": "Order tag" - }, - "cancelExist": { - "type": "boolean", - "description": "Whether there is a cancellation record for the order." - }, - "createdAt": { - "type": "integer", - "format": "int64" + "enum": [ + "limit", + "market" + ], + "x-api-enum": [ + { + "value": "limit", + "name": "", + "description": "" + }, + { + "value": "market", + "name": "", + "description": "" + } + ] + }, + "createdAt": { + "type": "integer", + "format": "int64" + } + }, + "required": [ + "id", + "symbol", + "tradeId", + "orderId", + "counterOrderId", + "side", + "liquidity", + "forceTaker", + "price", + "size", + "funds", + "fee", + "feeRate", + "feeCurrency", + "stop", + "tradeType", + "tax", + "taxRate", + "type", + "createdAt" + ] + } }, - "lastUpdatedAt": { + "lastId": { "type": "integer", + "description": "The id of the last set of data from the previous batch of data. By default, the latest information is given.\nlastId is used to filter data and paginate. If lastId is not entered, the default is a maximum of 100 returned data items. The return results include lastId,which can be used as a query parameter to look up new data from the next page.", "format": "int64" - }, - "tradeType": { - "type": "string", - "description": "Trade type, redundancy param" - }, - "inOrderBook": { - "type": "boolean", - "description": "Whether to enter the orderbook: true: enter the orderbook; false: not enter the orderbook" - }, - "cancelledSize": { - "type": "string", - "description": "Number of canceled transactions" - }, - "cancelledFunds": { - "type": "string", - "description": "Funds of canceled transactions" - }, - "remainSize": { - "type": "string", - "description": "Number of remain transactions" - }, - "remainFunds": { - "type": "string", - "description": "Funds of remain transactions" - }, - "tax": { - "type": "string", - "description": "Users in some regions need query this field" - }, - "active": { - "type": "boolean", - "description": "Order status: true-The status of the order isactive; false-The status of the order is done" } }, "required": [ - "id", - "symbol", - "opType", - "type", - "side", - "price", - "size", - "funds", - "dealSize", - "dealFunds", - "fee", - "feeCurrency", - "stopTriggered", - "stopPrice", - "timeInForce", - "postOnly", - "hidden", - "iceberg", - "visibleSize", - "cancelAfter", - "channel", - "clientOid", - "remark", - "cancelExist", - "createdAt", - "lastUpdatedAt", - "tradeType", - "inOrderBook", - "cancelledSize", - "cancelledFunds", - "remainSize", - "remainFunds", - "tax", - "active" + "items", + "lastId" ] } }, @@ -21711,8 +21881,8 @@ "responseExamples": [ { "name": "Success", - "data": "{\n \"code\": \"200000\",\n \"data\": {\n \"id\": \"671667306afcdb000723107f\",\n \"symbol\": \"BTC-USDT\",\n \"opType\": \"DEAL\",\n \"type\": \"limit\",\n \"side\": \"buy\",\n \"price\": \"50000\",\n \"size\": \"0.00001\",\n \"funds\": \"0.5\",\n \"dealSize\": \"0\",\n \"dealFunds\": \"0\",\n \"fee\": \"0\",\n \"feeCurrency\": \"USDT\",\n \"stp\": null,\n \"stop\": null,\n \"stopTriggered\": false,\n \"stopPrice\": \"0\",\n \"timeInForce\": \"GTC\",\n \"postOnly\": false,\n \"hidden\": false,\n \"iceberg\": false,\n \"visibleSize\": \"0\",\n \"cancelAfter\": 0,\n \"channel\": \"API\",\n \"clientOid\": \"5c52e11203aa677f33e493fb\",\n \"remark\": null,\n \"tags\": null,\n \"cancelExist\": false,\n \"createdAt\": 1729521456248,\n \"lastUpdatedAt\": 1729651011877,\n \"tradeType\": \"MARGIN_TRADE\",\n \"inOrderBook\": true,\n \"cancelledSize\": \"0\",\n \"cancelledFunds\": \"0\",\n \"remainSize\": \"0.00001\",\n \"remainFunds\": \"0.5\",\n \"tax\": \"0\",\n \"active\": true\n }\n}", - "responseId": 10366, + "data": "{\n \"code\": \"200000\",\n \"data\": {\n \"items\": [\n {\n \"id\": 137891621991,\n \"symbol\": \"BTC-USDT\",\n \"tradeId\": 11040911994273793,\n \"orderId\": \"671868085584bc0007d85f46\",\n \"counterOrderId\": \"67186805b7cbdf00071621f9\",\n \"side\": \"buy\",\n \"liquidity\": \"taker\",\n \"forceTaker\": false,\n \"price\": \"67141.6\",\n \"size\": \"0.00001\",\n \"funds\": \"0.671416\",\n \"fee\": \"0.000671416\",\n \"feeRate\": \"0.001\",\n \"feeCurrency\": \"USDT\",\n \"stop\": \"\",\n \"tradeType\": \"MARGIN_TRADE\",\n \"tax\": \"0\",\n \"taxRate\": \"0\",\n \"type\": \"limit\",\n \"createdAt\": 1729652744998\n }\n ],\n \"lastId\": 137891621991\n }\n}", + "responseId": 10364, "ordering": 1 } ], @@ -21726,16 +21896,16 @@ "example": "{\n \"symbol\": \"BTC-USDT\",\n \"orderId\": \"670fd33bf9406e0007ab3945\",\n \"newPrice\": \"30000\",\n \"newSize\": \"0.0001\"\n}", "mediaType": "" }, - "description": ":::info[Description]\nThis endpoint can be used to obtain information for a single Margin order using the order id.\n\nAfter the user successfully places an order, the order is in Active state, and the user can use inOrderBook to determine whether the order has entered the order. Canceled or fully filled orders are marked as completed Done status.\n:::\n\n:::tip[Tips]\nIf the order is not an active order, you can only get data within the time range of 3 _ 24 hours (ie: from the current time to 3 _ 24 hours ago). If the time range is exceeded, the system will query the data within the time range of 3 * 24 hours by default.\n:::", - "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"General\",\"api-rate-limit-pool\":\"Spot\",\"sdk-service\":\"Margin\",\"sdk-sub-service\":\"Order\",\"sdk-method-name\":\"getOrderByOrderId\",\"sdk-method-description\":\"This endpoint can be used to obtain information for a single Margin order using the order id. After the user successfully places an order, the order is in Active state, and the user can use inOrderBook to determine whether the order has entered the order. Canceled or fully filled orders are marked as completed Done status.\",\"api-rate-limit\":5}" + "description": ":::info[Description]\nThis endpoint can be used to obtain a list of the latest Margin transaction details. \nThe returned data is sorted in descending order according to the latest update time of the order.\n:::\n\n:::tip[Tips]\nIf the order is not an active order, you can only get data within the time range of 3 _ 24 hours (ie: from the current time to 3 _ 24 hours ago). If the time range is exceeded, the system will query the data within the time range of 3 * 24 hours by default.\n:::", + "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"General\",\"api-rate-limit-pool\":\"Spot\",\"sdk-service\":\"Margin\",\"sdk-sub-service\":\"Order\",\"sdk-method-name\":\"getTradeHistory\",\"sdk-method-description\":\"This endpoint can be used to obtain a list of the latest Margin transaction details. The returned data is sorted in descending order according to the latest update time of the order.\",\"api-rate-limit\":5}" } }, { - "name": "Get Order By ClientOid", + "name": "Get Order By OrderId", "api": { - "id": "3470203", + "id": "3470202", "method": "get", - "path": "/api/v3/hf/margin/orders/client-order/{clientOid}", + "path": "/api/v3/hf/margin/orders/{orderId}", "parameters": { "query": [ { @@ -21758,11 +21928,11 @@ ], "path": [ { - "id": "clientOid#0", - "name": "clientOid", + "id": "orderId#0", + "name": "orderId", "required": true, - "description": "Client Order Id,unique identifier created by the user", - "example": "5c52e11203aa677f33e493fb", + "description": "The unique order id generated by the trading system", + "example": "671667306afcdb000723107f", "type": "string", "enable": true } @@ -21772,7 +21942,7 @@ }, "responses": [ { - "id": "10367", + "id": "10366", "code": 200, "name": "OK", "headers": [], @@ -22045,6 +22215,7 @@ "cancelAfter", "channel", "clientOid", + "remark", "cancelExist", "createdAt", "lastUpdatedAt", @@ -22073,7 +22244,7 @@ { "name": "Success", "data": "{\n \"code\": \"200000\",\n \"data\": {\n \"id\": \"671667306afcdb000723107f\",\n \"symbol\": \"BTC-USDT\",\n \"opType\": \"DEAL\",\n \"type\": \"limit\",\n \"side\": \"buy\",\n \"price\": \"50000\",\n \"size\": \"0.00001\",\n \"funds\": \"0.5\",\n \"dealSize\": \"0\",\n \"dealFunds\": \"0\",\n \"fee\": \"0\",\n \"feeCurrency\": \"USDT\",\n \"stp\": null,\n \"stop\": null,\n \"stopTriggered\": false,\n \"stopPrice\": \"0\",\n \"timeInForce\": \"GTC\",\n \"postOnly\": false,\n \"hidden\": false,\n \"iceberg\": false,\n \"visibleSize\": \"0\",\n \"cancelAfter\": 0,\n \"channel\": \"API\",\n \"clientOid\": \"5c52e11203aa677f33e493fb\",\n \"remark\": null,\n \"tags\": null,\n \"cancelExist\": false,\n \"createdAt\": 1729521456248,\n \"lastUpdatedAt\": 1729651011877,\n \"tradeType\": \"MARGIN_TRADE\",\n \"inOrderBook\": true,\n \"cancelledSize\": \"0\",\n \"cancelledFunds\": \"0\",\n \"remainSize\": \"0.00001\",\n \"remainFunds\": \"0.5\",\n \"tax\": \"0\",\n \"active\": true\n }\n}", - "responseId": 10367, + "responseId": 10366, "ordering": 1 } ], @@ -22087,291 +22258,53 @@ "example": "{\n \"symbol\": \"BTC-USDT\",\n \"orderId\": \"670fd33bf9406e0007ab3945\",\n \"newPrice\": \"30000\",\n \"newSize\": \"0.0001\"\n}", "mediaType": "" }, - "description": ":::info[Description]\nThis endpoint can be used to obtain information for a single Margin order using the client order id.\n\nAfter the user successfully places an order, the order is in Active state, and the user can use inOrderBook to determine whether the order has entered the order. Canceled or fully filled orders are marked as completed Done status.\n:::\n\n:::tip[Tips]\nIf the order is not an active order, you can only get data within the time range of 3 _ 24 hours (ie: from the current time to 3 _ 24 hours ago). If the time range is exceeded, the system will query the data within the time range of 3 * 24 hours by default.\n:::", - "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"General\",\"api-rate-limit-pool\":\"Spot\",\"sdk-service\":\"Margin\",\"sdk-sub-service\":\"Order\",\"sdk-method-name\":\"getOrderByClientOid\",\"sdk-method-description\":\"This endpoint can be used to obtain information for a single Margin order using the client order id. After the user successfully places an order, the order is in Active state, and the user can use inOrderBook to determine whether the order has entered the order. Canceled or fully filled orders are marked as completed Done status.\",\"api-rate-limit\":5}" + "description": ":::info[Description]\nThis endpoint can be used to obtain information for a single Margin order using the order id.\n\nAfter the user successfully places an order, the order is in Active state, and the user can use inOrderBook to determine whether the order has entered the order. Canceled or fully filled orders are marked as completed Done status.\n:::\n\n:::tip[Tips]\nIf the order is not an active order, you can only get data within the time range of 3 _ 24 hours (ie: from the current time to 3 _ 24 hours ago). If the time range is exceeded, the system will query the data within the time range of 3 * 24 hours by default.\n:::", + "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"General\",\"api-rate-limit-pool\":\"Spot\",\"sdk-service\":\"Margin\",\"sdk-sub-service\":\"Order\",\"sdk-method-name\":\"getOrderByOrderId\",\"sdk-method-description\":\"This endpoint can be used to obtain information for a single Margin order using the order id. After the user successfully places an order, the order is in Active state, and the user can use inOrderBook to determine whether the order has entered the order. Canceled or fully filled orders are marked as completed Done status.\",\"api-rate-limit\":5}" } }, { - "name": "Add Order", + "name": "Get Order By ClientOid", "api": { - "id": "3470204", - "method": "post", - "path": "/api/v3/hf/margin/order", + "id": "3470203", + "method": "get", + "path": "/api/v3/hf/margin/orders/client-order/{clientOid}", "parameters": { - "query": [], - "path": [], - "cookie": [], - "header": [] - }, - "responses": [ - { - "id": "10368", - "code": 200, - "name": "OK", - "headers": [], - "jsonSchema": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "data": { - "type": "object", - "properties": { - "orderId": { - "type": "string", - "description": "The unique order id generated by the trading system,which can be used later for further actions such as canceling the order." - }, - "loanApplyId": { - "type": "string", - "description": "Borrow order id. The field is returned only after placing the order under the mode of Auto-Borrow." - }, - "borrowSize": { - "type": "string", - "description": "Borrowed amount. The field is returned only after placing the order under the mode of Auto-Borrow." - }, - "clientOid": { - "type": "string", - "description": "The user self-defined order id." - } - }, - "required": [ - "orderId", - "borrowSize", - "clientOid", - "loanApplyId" - ] - } - }, - "required": [ - "code", - "data" - ] - }, - "description": "", - "contentType": "json", - "mediaType": "" - } - ], - "responseExamples": [ - { - "name": "Success", - "data": "{\n \"success\": true,\n \"code\": \"200000\",\n \"data\": {\n \"orderId\": \"671663e02188630007e21c9c\",\n \"clientOid\": \"5c52e11203aa677f33e1493fb\",\n \"borrowSize\": \"10.2\",\n \"loanApplyId\": \"600656d9a33ac90009de4f6f\"\n }\n}", - "responseId": 10368, - "ordering": 1 - } - ], - "requestBody": { - "type": "application/json", - "parameters": [], - "jsonSchema": { - "type": "object", - "properties": { - "clientOid": { - "type": "string", - "description": "Client Order Id,The ClientOid field is a unique ID created by the user(we recommend using a UUID), and can only contain numbers, letters, underscores (_), and hyphens (-). This field is returned when order information is obtained. You can use clientOid to tag your orders. ClientOid is different from the order ID created by the service provider. Please do not initiate requests using the same clientOid. The maximum length for the ClientOid is 40 characters.\n\nPlease remember the orderId created by the service provider, it used to check for updates in order status.", - "examples": [ - "5c52e11203aa677f33e493fb" - ] - }, - "side": { - "type": "string", - "description": "specify if the order is to 'buy' or 'sell'", - "enum": [ - "buy", - "sell" - ], - "examples": [ - "buy" - ], - "x-api-enum": [ - { - "value": "buy", - "name": "", - "description": "" - }, - { - "value": "sell", - "name": "", - "description": "" - } - ] - }, - "symbol": { + "query": [ + { + "id": "M9bgPS6vOj", + "name": "symbol", + "required": true, + "description": "symbol", + "example": "BTC-USDT", + "type": "string", + "schema": { "type": "string", - "description": "symbol", "examples": [ "BTC-USDT", "ETH-USDT", "KCS-USDT" ] }, - "type": { - "type": "string", - "description": "specify if the order is an 'limit' order or 'market' order. \n\nThe type of order you specify when you place your order determines whether or not you need to request other parameters and also affects the execution of the matching engine.\n\nWhen placing a limit order, you must specify a price and size. The system will try to match the order according to market price or a price better than market price. If the order cannot be immediately matched, it will stay in the order book until it is matched or the user cancels.\n\nUnlike limit orders, the price for market orders fluctuates with market prices. When placing a market order, you do not need to specify a price, you only need to specify a quantity. Market orders are filled immediately and will not enter the order book. All market orders are takers and a taker fee will be charged.", - "enum": [ - "limit", - "market" - ], - "default": "limit", - "x-api-enum": [ - { - "value": "limit", - "name": "", - "description": "" - }, - { - "value": "market", - "name": "", - "description": "" - } - ] - }, - "stp": { - "type": "string", - "description": "[Self Trade Prevention](apidog://link/pages/338146) is divided into these strategies: CN, CO, CB , and DC", - "enum": [ - "DC", - "CO", - "CN", - "CB" - ], - "x-api-enum": [ - { - "value": "DC", - "name": "", - "description": "" - }, - { - "value": "CO", - "name": "", - "description": "" - }, - { - "value": "CN", - "name": "", - "description": "" - }, - { - "value": "CB", - "name": "", - "description": "" - } - ] - }, - "price": { - "type": "string", - "description": "Specify price for order\n\nWhen placing a limit order, the price must be based on priceIncrement for the trading pair. The price increment (priceIncrement) is the price precision for the trading pair. For example, for the BTC-USDT trading pair, the priceIncrement is 0.00001000. So the price for your orders cannot be less than 0.00001000 and must be a multiple of priceIncrement. Otherwise, the order will return an invalid priceIncrement error." - }, - "size": { - "type": "string", - "description": "Specify quantity for order\n\nWhen **type** is limit, size refers to the amount of trading targets (the asset name written in front) for the trading pair. Teh Size must be based on the baseIncrement of the trading pair. The baseIncrement represents the precision for the trading pair. The size of an order must be a positive-integer multiple of baseIncrement and must be between baseMinSize and baseMaxSize.\n\nWhen **type** is market, select one out of two: size or funds" - }, - "timeInForce": { - "type": "string", - "description": "[Time in force](apidog://link/pages/5176570) is a special strategy used during trading", - "enum": [ - "GTC", - "GTT", - "IOC", - "FOK" - ], - "default": "GTC", - "x-api-enum": [ - { - "value": "GTC", - "name": "", - "description": "" - }, - { - "value": "GTT", - "name": "", - "description": "" - }, - { - "value": "IOC", - "name": "", - "description": "" - }, - { - "value": "FOK", - "name": "", - "description": "" - } - ] - }, - "postOnly": { - "type": "boolean", - "default": false, - "description": "passive order labels, this is disabled when the order timing strategy is IOC or FOK" - }, - "hidden": { - "type": "boolean", - "description": "[Hidden order](apidog://link/pages/338146) or not (not shown in order book)", - "default": false - }, - "iceberg": { - "type": "boolean", - "description": "Whether or not only visible portions of orders are shown in [Iceberg orders](apidog://link/pages/338146)", - "default": false - }, - "visibleSize": { - "type": "string", - "description": "Maximum visible quantity in iceberg orders" - }, - "cancelAfter": { - "type": "integer", - "format": "int64", - "description": "Cancel after n seconds,the order timing strategy is GTT" - }, - "funds": { - "type": "string", - "description": "When **type** is market, select one out of two: size or funds" - }, - "isIsolated": { - "type": "boolean", - "description": "true - isolated margin ,false - cross margin. defult as false", - "default": false - }, - "autoBorrow": { - "type": "boolean", - "description": "When Margin Account has inefficient balance, our system autoborrows inefficient assets and opens positions according to the lowest market interest rate.", - "default": false - }, - "autoRepay": { - "type": "boolean", - "description": "AutoPay allows returning borrowed assets when you close a position. Our system automatically triggers the repayment and the maximum repayment amount equals to the filled-order amount.", - "default": false - } - }, - "required": [ - "symbol", - "side", - "clientOid" - ] - }, - "example": "//limit order\n{\n \"type\": \"limit\",\n \"symbol\": \"BTC-USDT\",\n \"side\": \"buy\",\n \"price\": \"50000\",\n \"size\": \"0.00001\",\n \"clientOid\": \"5c52e11203aa677f33e493fb\",\n \"remark\": \"order remarks\"\n}\n\n//market order 1\n// {\n// \"type\": \"market\",\n// \"symbol\": \"BTC-USDT\",\n// \"side\": \"buy\",\n// \"size\": \"0.00001\",\n// \"clientOid\": \"5c52e11203aa677f33e493fc\",\n// \"remark\": \"order remarks\"\n// }\n\n//market order 2\n// {\n// \"type\": \"market\",\n// \"symbol\": \"BTC-USDT\",\n// \"side\": \"buy\",\n// \"funds\": \"1\",\n// \"clientOid\": \"5c52e11203aa677f33e493fc\",\n// \"remark\": \"order remarks\"\n// }\n", - "mediaType": "" - }, - "description": ":::info[Description]\nPlace order to the Cross-margin or Isolated-margin trading system, you can place two major types of orders: limit and market. Orders can only be placed if your account has sufficient funds. Once an order is placed, your funds will be put on hold for the duration of the order. The amount of funds on hold depends on the order type and parameters specified.\n:::\n\n:::tip[Tips]\nPlease note that once your order enters the order book, the system will freeze the handling fees for the order ahead of time.\n\nBefore placing orders, please be sure to fully understand the meaning of the parameters for each trading pair.\n:::\n\n:::tip[Tips]\nThe maximum number of active orders per account is 2000, with a maximum of 200 active orders per trading pair.\n:::\n\n\n**Public order placement request parameters**\n\n| Param | Type | Mandatory | Description |\n| --------- | ------ | --------- | ----------- |\n| clientOid | String | Yes | Client Order Id,unique identifier created by the user, the use of UUID is recommended |\n| symbol | String | Yes | symbol |\n| side | String | Yes | `buy` or `sell` |\n| type | String | No | Order type `limit` and `market`, defult is limit |\n| stp | String | No | self trade prevention is divided into four strategies: `CN`, `CO`, `CB` , and `DC` |\n| isIsolated | boolean | No | true - isolated margin ,false - cross margin. defult as false |\n| autoBorrow | boolean | No | When Margin Account has inefficient balance, our system autoborrows inefficient assets and opens positions according to the lowest market interest rate. |\n| autoRepay | boolean | No | AutoPay allows returning borrowed assets when you close a position. Our system automatically triggers the repayment and the maximum repayment amount equals to the filled-order amount. |\n\n**Additional Request Parameters Required by `limit` Orders**\n\n| Param | Type | Mandatory | Description |\n| ----------- | ------- | --------- | ----------- |\n| price | String | Yes | Specify price for currency |\n| size | String | Yes | Specify quantity for currency |\n| timeInForce | String | No | Order timing strategy `GTC`, `GTT`, `IOC`, `FOK` (The default is `GTC`) |\n| cancelAfter | long | No | Cancel after `n` seconds,the order timing strategy is `GTT` |\n| postOnly | boolean | No | passive order labels, this is disabled when the order timing strategy is `IOC` or `FOK` |\n| hidden | boolean | No | Hidden or not (not shown in order book) |\n| iceberg | boolean | No | Whether or not only visible portions of orders are shown in iceberg orders |\n| visibleSize | String | No | Maximum visible quantity in iceberg orders |\n\n**Additional request parameters required by `market` orders**\n\n| Param | Type | Mandatory | Description |\n| ----- | ------ | --------- | ------------------------------------------ |\n| size | String | No | (Select one out of two: `size` or `funds`) |\n| funds | String | No | (Select one out of two: `size` or `funds`) |\n\n\n**Hold**\n\nFor limit price purchase orders, we will hold the amount of funds (price * size) required for your purchase order. Similarly, for limit price sell orders, we will also hold you sell order assets. When the transaction is executed, the service fees will be calculated. If you cancel a portion of a filled or unfilled order, then the remaining funds or amounts will be released and returned to your account. For market price buy/sell orders that require specific funds, we will hold the required funds in from your account. If only the size is specified, we may freeze (usually for a very short amount of time) all of the funds in your account prior to the order being filled or cancelled.\n\n\n**Order Lifecycle**\n\nWhen an order placement request is successful (the matching engine receives the order) or denied (due to there being insufficient funds or illegal parameter values, etc.), the system will respond to the HTTP request. When an order is successfully placed, the order ID is returned. The order will be matched, which could result in it being fully or partially filled. When an order is fully or partially filled, the remaining portions of the order will be in an active state awaiting to be matched (this does not include IOC orders). Orders that are fully or partially filled(already cancelled) will be put into the “done” state.\n\nUsers that have subscribed to the Market Data Channel can use the order ID (orderId) and client ID (clientOid) to identify messages.\n\n**Price Protection Mechanisms**\n\nPrice protection mechanisms ae enabled for order placements. Rules are detailed below:\n\n- If the spot trading market order/limit order placed by the user can be directly matched with an order in the current order book, the system will judge whether deviation between the price corresponding to the transaction depth and the spread exceeds the threshold value (the threshold value can be obtained using the symbol API endpoint);\n\n- If it is exceeded, for limit orders, the order will be directly cancelled;\n\n- If it is a market order, then the system will partially execute the order. The execution limit will be the order size within the price range corresponding to the threshold value. The remaining orders will not be filled.\n\nFor example: if the threshold value is 10%, when a user places a market price purchase order in the KCS/USDT trading market for 10,000 USDT (the selling price is currently 1.20000), the system will determine that after the order is completely filled, the final price will be 1.40000. (1.40000-1.20000)/1.20000=16.7%>10%. The threshold value is 1.32000. The user’s market price purchase order will be filled only to a maximum of 1.32000. The remaining order portions will not be matched with orders in the order book. Note: this feature may not be able to determine depth with complete accuracy. If your order is not completely filled, it may be because the portion exceeding the threshold value was not filled.\n", - "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"Margin\",\"api-rate-limit-pool\":\"Spot\",\"sdk-service\":\"Margin\",\"sdk-sub-service\":\"Order\",\"sdk-method-name\":\"addOrder\",\"sdk-method-description\":\"Place order to the Cross-margin or Isolated-margin trading system, you can place two major types of orders: limit and market. Orders can only be placed if your account has sufficient funds. Once an order is placed, your funds will be put on hold for the duration of the order. The amount of funds on hold depends on the order type and parameters specified.\",\"api-rate-limit\":5}" - } - }, - { - "name": "Add Order Test", - "api": { - "id": "3470205", - "method": "post", - "path": "/api/v3/hf/margin/order/test", - "parameters": { - "query": [], - "path": [], + "enable": true + } + ], + "path": [ + { + "id": "clientOid#0", + "name": "clientOid", + "required": true, + "description": "Client Order Id,unique identifier created by the user", + "example": "5c52e11203aa677f33e493fb", + "type": "string", + "enable": true + } + ], "cookie": [], "header": [] }, "responses": [ { - "id": "10369", + "id": "10367", "code": 200, "name": "OK", "headers": [], @@ -22384,28 +22317,277 @@ "data": { "type": "object", "properties": { - "orderId": { + "id": { + "type": "string", + "description": "The unique order id generated by the trading system" + }, + "symbol": { + "type": "string", + "description": "symbol", + "examples": [ + "BTC-USDT", + "ETH-USDT", + "KCS-USDT" + ] + }, + "opType": { + "type": "string" + }, + "type": { + "type": "string", + "description": "Specify if the order is an 'limit' order or 'market' order. ", + "enum": [ + "limit", + "market" + ], + "x-api-enum": [ + { + "value": "limit", + "name": "", + "description": "" + }, + { + "value": "market", + "name": "", + "description": "" + } + ] + }, + "side": { + "type": "string", + "description": "Buy or sell", + "enum": [ + "buy", + "sell" + ], + "x-api-enum": [ + { + "value": "buy", + "name": "", + "description": "" + }, + { + "value": "sell", + "name": "", + "description": "" + } + ] + }, + "price": { + "type": "string", + "description": "Order price" + }, + "size": { + "type": "string", + "description": "Order size" + }, + "funds": { + "type": "string", + "description": "Order Funds" + }, + "dealSize": { + "type": "string", + "description": "Number of filled transactions" + }, + "dealFunds": { "type": "string", - "description": "The unique order id generated by the trading system,which can be used later for further actions such as canceling the order." + "description": "Funds of filled transactions" }, - "loanApplyId": { + "fee": { "type": "string", - "description": "Borrowed amount. The field is returned only after placing the order under the mode of Auto-Borrow." + "description": "[Handling fees](apidog://link/pages/5327739)" }, - "borrowSize": { - "type": "number", - "description": "ID of the borrowing response. The field is returned only after placing the order under the mode of Auto-Borrow." + "feeCurrency": { + "type": "string", + "description": "currency used to calculate trading fee" + }, + "stp": { + "type": "string", + "description": "[Self Trade Prevention](apidog://link/pages/338146) is divided into these strategies: CN, CO, CB , and DC", + "enum": [ + "DC", + "CO", + "CN", + "CB" + ], + "x-api-enum": [ + { + "value": "DC", + "name": "", + "description": "" + }, + { + "value": "CO", + "name": "", + "description": "" + }, + { + "value": "CN", + "name": "", + "description": "" + }, + { + "value": "CB", + "name": "", + "description": "" + } + ] + }, + "stop": { + "type": "string" + }, + "stopTriggered": { + "type": "boolean" + }, + "stopPrice": { + "type": "string" + }, + "timeInForce": { + "type": "string", + "description": "Time in force", + "enum": [ + "GTC", + "GTT", + "IOC", + "FOK" + ], + "x-api-enum": [ + { + "value": "GTC", + "name": "", + "description": "" + }, + { + "value": "GTT", + "name": "", + "description": "" + }, + { + "value": "IOC", + "name": "", + "description": "" + }, + { + "value": "FOK", + "name": "", + "description": "" + } + ] + }, + "postOnly": { + "type": "boolean", + "description": "Whether its a postOnly order." + }, + "hidden": { + "type": "boolean", + "description": "Whether its a hidden order." + }, + "iceberg": { + "type": "boolean", + "description": "Whether its a iceberg order." + }, + "visibleSize": { + "type": "string", + "description": "Visible size of iceberg order in order book." + }, + "cancelAfter": { + "type": "integer", + "description": "A GTT timeInForce that expires in n seconds" + }, + "channel": { + "type": "string" }, "clientOid": { "type": "string", - "description": "The user self-defined order id." + "description": "Client Order Id,unique identifier created by the user" + }, + "remark": { + "type": "string", + "description": "Order placement remarks" + }, + "tags": { + "type": "string", + "description": "Order tag" + }, + "cancelExist": { + "type": "boolean", + "description": "Whether there is a cancellation record for the order." + }, + "createdAt": { + "type": "integer", + "format": "int64" + }, + "lastUpdatedAt": { + "type": "integer", + "format": "int64" + }, + "tradeType": { + "type": "string", + "description": "Trade type, redundancy param" + }, + "inOrderBook": { + "type": "boolean", + "description": "Whether to enter the orderbook: true: enter the orderbook; false: not enter the orderbook" + }, + "cancelledSize": { + "type": "string", + "description": "Number of canceled transactions" + }, + "cancelledFunds": { + "type": "string", + "description": "Funds of canceled transactions" + }, + "remainSize": { + "type": "string", + "description": "Number of remain transactions" + }, + "remainFunds": { + "type": "string", + "description": "Funds of remain transactions" + }, + "tax": { + "type": "string", + "description": "Users in some regions need query this field" + }, + "active": { + "type": "boolean", + "description": "Order status: true-The status of the order isactive; false-The status of the order is done" } }, "required": [ - "orderId", - "borrowSize", + "id", + "symbol", + "opType", + "type", + "side", + "price", + "size", + "funds", + "dealSize", + "dealFunds", + "fee", + "feeCurrency", + "stopTriggered", + "stopPrice", + "timeInForce", + "postOnly", + "hidden", + "iceberg", + "visibleSize", + "cancelAfter", + "channel", "clientOid", - "loanApplyId" + "cancelExist", + "createdAt", + "lastUpdatedAt", + "tradeType", + "inOrderBook", + "cancelledSize", + "cancelledFunds", + "remainSize", + "remainFunds", + "tax", + "active" ] } }, @@ -22422,205 +22604,23 @@ "responseExamples": [ { "name": "Success", - "data": "{\n \"success\": true,\n \"code\": \"200000\",\n \"data\": {\n \"orderId\": \"5bd6e9286d99522a52e458de\",\n \"clientOid\": \"5c52e11203aa677f33e493fb\",\n \"borrowSize\": 10.2,\n \"loanApplyId\": \"600656d9a33ac90009de4f6f\"\n }\n}", - "responseId": 10369, + "data": "{\n \"code\": \"200000\",\n \"data\": {\n \"id\": \"671667306afcdb000723107f\",\n \"symbol\": \"BTC-USDT\",\n \"opType\": \"DEAL\",\n \"type\": \"limit\",\n \"side\": \"buy\",\n \"price\": \"50000\",\n \"size\": \"0.00001\",\n \"funds\": \"0.5\",\n \"dealSize\": \"0\",\n \"dealFunds\": \"0\",\n \"fee\": \"0\",\n \"feeCurrency\": \"USDT\",\n \"stp\": null,\n \"stop\": null,\n \"stopTriggered\": false,\n \"stopPrice\": \"0\",\n \"timeInForce\": \"GTC\",\n \"postOnly\": false,\n \"hidden\": false,\n \"iceberg\": false,\n \"visibleSize\": \"0\",\n \"cancelAfter\": 0,\n \"channel\": \"API\",\n \"clientOid\": \"5c52e11203aa677f33e493fb\",\n \"remark\": null,\n \"tags\": null,\n \"cancelExist\": false,\n \"createdAt\": 1729521456248,\n \"lastUpdatedAt\": 1729651011877,\n \"tradeType\": \"MARGIN_TRADE\",\n \"inOrderBook\": true,\n \"cancelledSize\": \"0\",\n \"cancelledFunds\": \"0\",\n \"remainSize\": \"0.00001\",\n \"remainFunds\": \"0.5\",\n \"tax\": \"0\",\n \"active\": true\n }\n}", + "responseId": 10367, "ordering": 1 } ], "requestBody": { - "type": "application/json", + "type": "none", "parameters": [], "jsonSchema": { "type": "object", - "properties": { - "clientOid": { - "type": "string", - "description": "Client Order Id,The ClientOid field is a unique ID created by the user(we recommend using a UUID), and can only contain numbers, letters, underscores (_), and hyphens (-). This field is returned when order information is obtained. You can use clientOid to tag your orders. ClientOid is different from the order ID created by the service provider. Please do not initiate requests using the same clientOid. The maximum length for the ClientOid is 40 characters.\n\nPlease remember the orderId created by the service provider, it used to check for updates in order status.", - "examples": [ - "5c52e11203aa677f33e493fb" - ] - }, - "side": { - "type": "string", - "description": "specify if the order is to 'buy' or 'sell'", - "enum": [ - "buy", - "sell" - ], - "examples": [ - "buy" - ], - "x-api-enum": [ - { - "value": "buy", - "name": "", - "description": "" - }, - { - "value": "sell", - "name": "", - "description": "" - } - ] - }, - "symbol": { - "type": "string", - "description": "symbol", - "examples": [ - "BTC-USDT", - "ETH-USDT", - "KCS-USDT" - ] - }, - "type": { - "type": "string", - "description": "specify if the order is an 'limit' order or 'market' order. \n\nThe type of order you specify when you place your order determines whether or not you need to request other parameters and also affects the execution of the matching engine.\n\nWhen placing a limit order, you must specify a price and size. The system will try to match the order according to market price or a price better than market price. If the order cannot be immediately matched, it will stay in the order book until it is matched or the user cancels.\n\nUnlike limit orders, the price for market orders fluctuates with market prices. When placing a market order, you do not need to specify a price, you only need to specify a quantity. Market orders are filled immediately and will not enter the order book. All market orders are takers and a taker fee will be charged.", - "enum": [ - "limit", - "market" - ], - "default": "limit", - "x-api-enum": [ - { - "value": "limit", - "name": "", - "description": "" - }, - { - "value": "market", - "name": "", - "description": "" - } - ] - }, - "stp": { - "type": "string", - "description": "[Self Trade Prevention](apidog://link/pages/338146) is divided into these strategies: CN, CO, CB , and DC", - "enum": [ - "DC", - "CO", - "CN", - "CB" - ], - "x-api-enum": [ - { - "value": "DC", - "name": "", - "description": "" - }, - { - "value": "CO", - "name": "", - "description": "" - }, - { - "value": "CN", - "name": "", - "description": "" - }, - { - "value": "CB", - "name": "", - "description": "" - } - ] - }, - "price": { - "type": "string", - "description": "Specify price for order\n\nWhen placing a limit order, the price must be based on priceIncrement for the trading pair. The price increment (priceIncrement) is the price precision for the trading pair. For example, for the BTC-USDT trading pair, the priceIncrement is 0.00001000. So the price for your orders cannot be less than 0.00001000 and must be a multiple of priceIncrement. Otherwise, the order will return an invalid priceIncrement error." - }, - "size": { - "type": "string", - "description": "Specify quantity for order\n\nWhen **type** is limit, size refers to the amount of trading targets (the asset name written in front) for the trading pair. Teh Size must be based on the baseIncrement of the trading pair. The baseIncrement represents the precision for the trading pair. The size of an order must be a positive-integer multiple of baseIncrement and must be between baseMinSize and baseMaxSize.\n\nWhen **type** is market, select one out of two: size or funds" - }, - "timeInForce": { - "type": "string", - "description": "[Time in force](apidog://link/pages/5176570) is a special strategy used during trading", - "enum": [ - "GTC", - "GTT", - "IOC", - "FOK" - ], - "default": "GTC", - "x-api-enum": [ - { - "value": "GTC", - "name": "", - "description": "" - }, - { - "value": "GTT", - "name": "", - "description": "" - }, - { - "value": "IOC", - "name": "", - "description": "" - }, - { - "value": "FOK", - "name": "", - "description": "" - } - ] - }, - "postOnly": { - "type": "boolean", - "default": false, - "description": "passive order labels, this is disabled when the order timing strategy is IOC or FOK" - }, - "hidden": { - "type": "boolean", - "description": "[Hidden order](apidog://link/pages/338146) or not (not shown in order book)", - "default": false - }, - "iceberg": { - "type": "boolean", - "description": "Whether or not only visible portions of orders are shown in [Iceberg orders](apidog://link/pages/338146)", - "default": false - }, - "visibleSize": { - "type": "string", - "description": "Maximum visible quantity in iceberg orders" - }, - "cancelAfter": { - "type": "integer", - "format": "int64", - "description": "Cancel after n seconds,the order timing strategy is GTT" - }, - "funds": { - "type": "string", - "description": "When **type** is market, select one out of two: size or funds" - }, - "isIsolated": { - "type": "boolean", - "description": "true - isolated margin ,false - cross margin. defult as false", - "default": false - }, - "autoBorrow": { - "type": "boolean", - "description": "When Margin Account has inefficient balance, our system autoborrows inefficient assets and opens positions according to the lowest market interest rate.", - "default": false - }, - "autoRepay": { - "type": "boolean", - "description": "AutoPay allows returning borrowed assets when you close a position. Our system automatically triggers the repayment and the maximum repayment amount equals to the filled-order amount.", - "default": false - } - }, - "required": [ - "symbol", - "side", - "clientOid" - ] + "properties": {} }, - "example": "//limit order\n{\n \"type\": \"limit\",\n \"symbol\": \"BTC-USDT\",\n \"side\": \"buy\",\n \"price\": \"50000\",\n \"size\": \"0.00001\",\n \"clientOid\": \"5c52e11203aa677f33e493fb\",\n \"remark\": \"order remarks\"\n}\n\n//market order 1\n// {\n// \"type\": \"market\",\n// \"symbol\": \"BTC-USDT\",\n// \"side\": \"buy\",\n// \"size\": \"0.00001\",\n// \"clientOid\": \"5c52e11203aa677f33e493fc\",\n// \"remark\": \"order remarks\"\n// }\n\n//market order 2\n// {\n// \"type\": \"market\",\n// \"symbol\": \"BTC-USDT\",\n// \"side\": \"buy\",\n// \"funds\": \"1\",\n// \"clientOid\": \"5c52e11203aa677f33e493fc\",\n// \"remark\": \"order remarks\"\n// }\n", + "example": "{\n \"symbol\": \"BTC-USDT\",\n \"orderId\": \"670fd33bf9406e0007ab3945\",\n \"newPrice\": \"30000\",\n \"newSize\": \"0.0001\"\n}", "mediaType": "" }, - "description": ":::info[Description]\nOrder test endpoint, the request parameters and return parameters of this endpoint are exactly the same as the order endpoint, and can be used to verify whether the signature is correct and other operations. After placing an order, the order will not enter the matching system, and the order cannot be queried.\n:::\n\n:::tip[Tips]\nPlease note that once your order enters the order book, the system will freeze the handling fees for the order ahead of time.\n\nBefore placing orders, please be sure to fully understand the meaning of the parameters for each trading pair.\n:::\n\n:::tip[Tips]\nThe maximum number of active orders per account is 2000, with a maximum of 200 active orders per trading pair.\n:::\n\n\n**Public order placement request parameters**\n\n| Param | Type | Mandatory | Description |\n| --------- | ------ | --------- | ----------- |\n| clientOid | String | Yes | Client Order Id,unique identifier created by the user, the use of UUID is recommended |\n| symbol | String | Yes | symbol |\n| side | String | Yes | `buy` or `sell` |\n| type | String | No | Order type `limit` and `market`, defult is limit |\n| stp | String | No | self trade prevention is divided into four strategies: `CN`, `CO`, `CB` , and `DC` |\n| isIsolated | boolean | No | true - isolated margin ,false - cross margin. defult as false |\n| autoBorrow | boolean | No | When Margin Account has inefficient balance, our system autoborrows inefficient assets and opens positions according to the lowest market interest rate. |\n| autoRepay | boolean | No | AutoPay allows returning borrowed assets when you close a position. Our system automatically triggers the repayment and the maximum repayment amount equals to the filled-order amount. |\n\n**Additional Request Parameters Required by `limit` Orders**\n\n| Param | Type | Mandatory | Description |\n| ----------- | ------- | --------- | ----------- |\n| price | String | Yes | Specify price for currency |\n| size | String | Yes | Specify quantity for currency |\n| timeInForce | String | No | Order timing strategy `GTC`, `GTT`, `IOC`, `FOK` (The default is `GTC`) |\n| cancelAfter | long | No | Cancel after `n` seconds,the order timing strategy is `GTT` |\n| postOnly | boolean | No | passive order labels, this is disabled when the order timing strategy is `IOC` or `FOK` |\n| hidden | boolean | No | Hidden or not (not shown in order book) |\n| iceberg | boolean | No | Whether or not only visible portions of orders are shown in iceberg orders |\n| visibleSize | String | No | Maximum visible quantity in iceberg orders |\n\n**Additional request parameters required by `market` orders**\n\n| Param | Type | Mandatory | Description |\n| ----- | ------ | --------- | ------------------------------------------ |\n| size | String | No | (Select one out of two: `size` or `funds`) |\n| funds | String | No | (Select one out of two: `size` or `funds`) |\n\n\n**Hold**\n\nFor limit price purchase orders, we will hold the amount of funds (price * size) required for your purchase order. Similarly, for limit price sell orders, we will also hold you sell order assets. When the transaction is executed, the service fees will be calculated. If you cancel a portion of a filled or unfilled order, then the remaining funds or amounts will be released and returned to your account. For market price buy/sell orders that require specific funds, we will hold the required funds in from your account. If only the size is specified, we may freeze (usually for a very short amount of time) all of the funds in your account prior to the order being filled or cancelled.\n\n\n**Order Lifecycle**\n\nWhen an order placement request is successful (the matching engine receives the order) or denied (due to there being insufficient funds or illegal parameter values, etc.), the system will respond to the HTTP request. When an order is successfully placed, the order ID is returned. The order will be matched, which could result in it being fully or partially filled. When an order is fully or partially filled, the remaining portions of the order will be in an active state awaiting to be matched (this does not include IOC orders). Orders that are fully or partially filled(already cancelled) will be put into the “done” state.\n\nUsers that have subscribed to the Market Data Channel can use the order ID (orderId) and client ID (clientOid) to identify messages.\n\n**Price Protection Mechanisms**\n\nPrice protection mechanisms ae enabled for order placements. Rules are detailed below:\n\n- If the spot trading market order/limit order placed by the user can be directly matched with an order in the current order book, the system will judge whether deviation between the price corresponding to the transaction depth and the spread exceeds the threshold value (the threshold value can be obtained using the symbol API endpoint);\n\n- If it is exceeded, for limit orders, the order will be directly cancelled;\n\n- If it is a market order, then the system will partially execute the order. The execution limit will be the order size within the price range corresponding to the threshold value. The remaining orders will not be filled.\n\nFor example: if the threshold value is 10%, when a user places a market price purchase order in the KCS/USDT trading market for 10,000 USDT (the selling price is currently 1.20000), the system will determine that after the order is completely filled, the final price will be 1.40000. (1.40000-1.20000)/1.20000=16.7%>10%. The threshold value is 1.32000. The user’s market price purchase order will be filled only to a maximum of 1.32000. The remaining order portions will not be matched with orders in the order book. Note: this feature may not be able to determine depth with complete accuracy. If your order is not completely filled, it may be because the portion exceeding the threshold value was not filled.\n", - "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"Margin\",\"api-rate-limit-pool\":\"Spot\",\"sdk-service\":\"Margin\",\"sdk-sub-service\":\"Order\",\"sdk-method-name\":\"addOrderTest\",\"sdk-method-description\":\" Order test endpoint, the request parameters and return parameters of this endpoint are exactly the same as the order endpoint, and can be used to verify whether the signature is correct and other operations. After placing an order, the order will not enter the matching system, and the order cannot be queried.\",\"api-rate-limit\":5}" + "description": ":::info[Description]\nThis endpoint can be used to obtain information for a single Margin order using the client order id.\n\nAfter the user successfully places an order, the order is in Active state, and the user can use inOrderBook to determine whether the order has entered the order. Canceled or fully filled orders are marked as completed Done status.\n:::\n\n:::tip[Tips]\nIf the order is not an active order, you can only get data within the time range of 3 _ 24 hours (ie: from the current time to 3 _ 24 hours ago). If the time range is exceeded, the system will query the data within the time range of 3 * 24 hours by default.\n:::", + "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"General\",\"api-rate-limit-pool\":\"Spot\",\"sdk-service\":\"Margin\",\"sdk-sub-service\":\"Order\",\"sdk-method-name\":\"getOrderByClientOid\",\"sdk-method-description\":\"This endpoint can be used to obtain information for a single Margin order using the client order id. After the user successfully places an order, the order is in Active state, and the user can use inOrderBook to determine whether the order has entered the order. Canceled or fully filled orders are marked as completed Done status.\",\"api-rate-limit\":5}" } } ] @@ -23028,6 +23028,122 @@ "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"Margin\",\"api-rate-limit-pool\":\"Spot\",\"sdk-service\":\"Margin\",\"sdk-sub-service\":\"Debit\",\"sdk-method-name\":\"getBorrowHistory\",\"sdk-method-description\":\"This API endpoint is used to get the borrowing orders for cross and isolated margin accounts\",\"api-rate-limit\":15}" } }, + { + "name": "Repay", + "api": { + "id": "3470210", + "method": "post", + "path": "/api/v3/margin/repay", + "parameters": { + "query": [], + "path": [], + "cookie": [], + "header": [] + }, + "responses": [ + { + "id": "10374", + "code": 200, + "name": "OK", + "headers": [], + "jsonSchema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "object", + "properties": { + "timestamp": { + "type": "integer", + "format": "int64" + }, + "orderNo": { + "type": "string", + "description": "Repay Order Id" + }, + "actualSize": { + "type": "string", + "description": "Actual repay amount" + } + }, + "required": [ + "timestamp", + "orderNo", + "actualSize" + ] + } + }, + "required": [ + "code", + "data" + ] + }, + "description": "", + "contentType": "json", + "mediaType": "" + } + ], + "responseExamples": [ + { + "name": "Success", + "data": "{\"code\":\"200000\",\"data\":{\"timestamp\":1729655606816,\"orderNo\":\"671873361d5bd400075096ad\",\"actualSize\":\"10\"}}", + "responseId": 10374, + "ordering": 1 + } + ], + "requestBody": { + "type": "application/json", + "parameters": [], + "jsonSchema": { + "type": "object", + "properties": { + "currency": { + "type": "string", + "description": "currency", + "examples": [ + "BTC", + "ETH", + "USDT" + ] + }, + "size": { + "type": "number", + "description": "Borrow amount" + }, + "symbol": { + "type": "string", + "description": "symbol, mandatory for isolated margin account", + "examples": [ + "BTC-USDT", + "ETH-USDT", + "KCS-USDT" + ] + }, + "isIsolated": { + "type": "boolean", + "description": "true-isolated, false-cross; default is false", + "default": false + }, + "isHf": { + "type": "boolean", + "description": "true: high frequency borrowing, false: low frequency borrowing; default false", + "default": false + } + }, + "required": [ + "currency", + "size" + ] + }, + "example": "{\n \"currency\": \"USDT\",\n \"size\": 10\n}", + "mediaType": "" + }, + "description": ":::info[Description]\nThis API endpoint is used to initiate an application for cross or isolated margin repayment.\n:::", + "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"Margin\",\"api-rate-limit-pool\":\"Spot\",\"sdk-service\":\"Margin\",\"sdk-sub-service\":\"Debit\",\"sdk-method-name\":\"repay\",\"sdk-method-description\":\"This API endpoint is used to initiate an application for cross or isolated margin repayment.\",\"api-rate-limit\":10}" + } + }, { "name": "Get Repay History", "api": { @@ -23510,122 +23626,6 @@ "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"Margin\",\"api-rate-limit-pool\":\"Spot\",\"sdk-service\":\"Margin\",\"sdk-sub-service\":\"Debit\",\"sdk-method-name\":\"getInterestHistory\",\"sdk-method-description\":\"Request via this endpoint to get the interest records of the cross/isolated margin lending.\",\"api-rate-limit\":20}" } }, - { - "name": "Repay", - "api": { - "id": "3470210", - "method": "post", - "path": "/api/v3/margin/repay", - "parameters": { - "query": [], - "path": [], - "cookie": [], - "header": [] - }, - "responses": [ - { - "id": "10374", - "code": 200, - "name": "OK", - "headers": [], - "jsonSchema": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "data": { - "type": "object", - "properties": { - "timestamp": { - "type": "integer", - "format": "int64" - }, - "orderNo": { - "type": "string", - "description": "Repay Order Id" - }, - "actualSize": { - "type": "string", - "description": "Actual repay amount" - } - }, - "required": [ - "timestamp", - "orderNo", - "actualSize" - ] - } - }, - "required": [ - "code", - "data" - ] - }, - "description": "", - "contentType": "json", - "mediaType": "" - } - ], - "responseExamples": [ - { - "name": "Success", - "data": "{\"code\":\"200000\",\"data\":{\"timestamp\":1729655606816,\"orderNo\":\"671873361d5bd400075096ad\",\"actualSize\":\"10\"}}", - "responseId": 10374, - "ordering": 1 - } - ], - "requestBody": { - "type": "application/json", - "parameters": [], - "jsonSchema": { - "type": "object", - "properties": { - "currency": { - "type": "string", - "description": "currency", - "examples": [ - "BTC", - "ETH", - "USDT" - ] - }, - "size": { - "type": "number", - "description": "Borrow amount" - }, - "symbol": { - "type": "string", - "description": "symbol, mandatory for isolated margin account", - "examples": [ - "BTC-USDT", - "ETH-USDT", - "KCS-USDT" - ] - }, - "isIsolated": { - "type": "boolean", - "description": "true-isolated, false-cross; default is false", - "default": false - }, - "isHf": { - "type": "boolean", - "description": "true: high frequency borrowing, false: low frequency borrowing; default false", - "default": false - } - }, - "required": [ - "currency", - "size" - ] - }, - "example": "{\n \"currency\": \"USDT\",\n \"size\": 10\n}", - "mediaType": "" - }, - "description": ":::info[Description]\nThis API endpoint is used to initiate an application for cross or isolated margin repayment.\n:::", - "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"Margin\",\"api-rate-limit-pool\":\"Spot\",\"sdk-service\":\"Margin\",\"sdk-sub-service\":\"Debit\",\"sdk-method-name\":\"repay\",\"sdk-method-description\":\"This API endpoint is used to initiate an application for cross or isolated margin repayment.\",\"api-rate-limit\":10}" - } - }, { "name": "Modify Leverage", "api": { @@ -23822,23 +23822,293 @@ "responseExamples": [ { "name": "Success", - "data": "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"currency\": \"BTC\",\n \"purchaseEnable\": true,\n \"redeemEnable\": true,\n \"increment\": \"0.00000001\",\n \"minPurchaseSize\": \"0.001\",\n \"maxPurchaseSize\": \"40\",\n \"interestIncrement\": \"0.0001\",\n \"minInterestRate\": \"0.005\",\n \"marketInterestRate\": \"0.005\",\n \"maxInterestRate\": \"0.32\",\n \"autoPurchaseEnable\": false\n }\n ]\n}", - "responseId": 10376, + "data": "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"currency\": \"BTC\",\n \"purchaseEnable\": true,\n \"redeemEnable\": true,\n \"increment\": \"0.00000001\",\n \"minPurchaseSize\": \"0.001\",\n \"maxPurchaseSize\": \"40\",\n \"interestIncrement\": \"0.0001\",\n \"minInterestRate\": \"0.005\",\n \"marketInterestRate\": \"0.005\",\n \"maxInterestRate\": \"0.32\",\n \"autoPurchaseEnable\": false\n }\n ]\n}", + "responseId": 10376, + "ordering": 1 + } + ], + "requestBody": { + "type": "none", + "parameters": [], + "jsonSchema": { + "type": "object", + "properties": {} + }, + "example": "{\n \"currency\": \"USDT\",\n \"size\": 10,\n \"timeInForce\": \"FOK\",\n \"isIsolated\": false,\n \"isHf\": false\n}", + "mediaType": "" + }, + "description": ":::info[Description]\nThis API endpoint is used to get the information about the currencies available for lending.\n:::", + "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"General\",\"api-rate-limit-pool\":\"Spot\",\"sdk-service\":\"Margin\",\"sdk-sub-service\":\"Credit\",\"sdk-method-name\":\"getLoanMarket\",\"sdk-method-description\":\"This API endpoint is used to get the information about the currencies available for lending.\",\"api-rate-limit\":10}" + } + }, + { + "name": "Get Loan Market Interest Rate", + "api": { + "id": "3470215", + "method": "get", + "path": "/api/v3/project/marketInterestRate", + "parameters": { + "query": [ + { + "id": "l1uItcOfv7", + "name": "currency", + "required": true, + "description": "currency", + "example": "USDT", + "type": "string", + "schema": { + "type": "string", + "examples": [ + "BTC", + "ETH", + "KCS" + ] + }, + "enable": true + } + ], + "path": [], + "cookie": [], + "header": [] + }, + "responses": [ + { + "id": "10379", + "code": 200, + "name": "OK", + "headers": [], + "jsonSchema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "array", + "items": { + "type": "object", + "properties": { + "time": { + "type": "string", + "description": "Time: YYYYMMDDHH00" + }, + "marketInterestRate": { + "type": "string", + "description": "Market lending rate" + } + }, + "required": [ + "time", + "marketInterestRate" + ] + } + } + }, + "required": [ + "code", + "data" + ] + }, + "description": "", + "contentType": "json", + "mediaType": "" + } + ], + "responseExamples": [ + { + "name": "Success", + "data": "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"time\": \"202410170000\",\n \"marketInterestRate\": \"0.005\"\n },\n {\n \"time\": \"202410170100\",\n \"marketInterestRate\": \"0.005\"\n }\n ]\n}", + "responseId": 10379, + "ordering": 1 + } + ], + "requestBody": { + "type": "none", + "parameters": [], + "jsonSchema": { + "type": "object", + "properties": {} + }, + "example": "{\n \"currency\": \"USDT\",\n \"size\": 10,\n \"timeInForce\": \"FOK\",\n \"isIsolated\": false,\n \"isHf\": false\n}", + "mediaType": "" + }, + "description": ":::info[Description]\nThis API endpoint is used to get the interest rates of the margin lending market over the past 7 days.\n:::", + "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Spot\",\"api-channel\":\"Public\",\"api-permission\":\"NULL\",\"api-rate-limit-pool\":\"Public\",\"sdk-service\":\"Margin\",\"sdk-sub-service\":\"Credit\",\"sdk-method-name\":\"getLoanMarketInterestRate\",\"sdk-method-description\":\"This API endpoint is used to get the interest rates of the margin lending market over the past 7 days.\",\"api-rate-limit\":5}" + } + }, + { + "name": "Purchase", + "api": { + "id": "3470216", + "method": "post", + "path": "/api/v3/purchase", + "parameters": { + "path": [], + "query": [], + "cookie": [], + "header": [] + }, + "responses": [ + { + "id": "10380", + "code": 200, + "name": "OK", + "headers": [], + "jsonSchema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "object", + "properties": { + "orderNo": { + "type": "string", + "description": "Purchase order id" + } + }, + "required": [ + "orderNo" + ] + } + }, + "required": [ + "code", + "data" + ] + }, + "description": "", + "contentType": "json", + "mediaType": "" + } + ], + "responseExamples": [ + { + "name": "Success", + "data": "{\n \"code\": \"200000\",\n \"data\": {\n \"orderNo\": \"671bafa804c26d000773c533\"\n }\n}", + "responseId": 10380, + "ordering": 1 + } + ], + "requestBody": { + "type": "application/json", + "parameters": [], + "jsonSchema": { + "type": "object", + "properties": { + "currency": { + "type": "string", + "description": "Currency", + "examples": [ + "BTC", + "ETH", + "USDT" + ] + }, + "size": { + "type": "string", + "description": "purchase amount" + }, + "interestRate": { + "type": "string", + "description": "purchase interest rate" + } + }, + "required": [ + "currency", + "size", + "interestRate" + ] + }, + "example": "{\n \"currency\": \"BTC\",\n \"size\": \"0.001\",\n \"interestRate\": \"0.1\"\n}", + "mediaType": "" + }, + "description": ":::info[Description]\nInvest credit in the market and earn interest,Please ensure that the funds are in the main(funding) account\n:::", + "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"Margin\",\"api-rate-limit-pool\":\"Spot\",\"sdk-service\":\"Margin\",\"sdk-sub-service\":\"Credit\",\"sdk-method-name\":\"purchase\",\"sdk-method-description\":\"Invest credit in the market and earn interest\",\"api-rate-limit\":15}" + } + }, + { + "name": "Modify Purchase", + "api": { + "id": "3470217", + "method": "post", + "path": "/api/v3/lend/purchase/update", + "parameters": { + "query": [], + "path": [], + "cookie": [], + "header": [] + }, + "responses": [ + { + "id": "10381", + "code": 200, + "name": "OK", + "headers": [], + "jsonSchema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "string" + } + }, + "required": [ + "code", + "data" + ] + }, + "description": "", + "contentType": "json", + "mediaType": "" + } + ], + "responseExamples": [ + { + "name": "Success", + "data": "{\n \"code\": \"200000\",\n \"data\": null\n}", + "responseId": 10381, "ordering": 1 } ], "requestBody": { - "type": "none", + "type": "application/json", "parameters": [], "jsonSchema": { "type": "object", - "properties": {} + "properties": { + "currency": { + "type": "string", + "description": "Currency", + "examples": [ + "BTC", + "ETH", + "USDT" + ] + }, + "interestRate": { + "type": "string", + "description": "Modified purchase interest rate" + }, + "purchaseOrderNo": { + "type": "string", + "description": "Purchase order id" + } + }, + "required": [ + "currency", + "purchaseOrderNo", + "interestRate" + ] }, - "example": "{\n \"currency\": \"USDT\",\n \"size\": 10,\n \"timeInForce\": \"FOK\",\n \"isIsolated\": false,\n \"isHf\": false\n}", + "example": "{\n \"currency\": \"BTC\",\n \"purchaseOrderNo\": \"671bafa804c26d000773c533\",\n \"interestRate\": \"0.09\"\n}", "mediaType": "" }, - "description": ":::info[Description]\nThis API endpoint is used to get the information about the currencies available for lending.\n:::", - "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"General\",\"api-rate-limit-pool\":\"Spot\",\"sdk-service\":\"Margin\",\"sdk-sub-service\":\"Credit\",\"sdk-method-name\":\"getLoanMarket\",\"sdk-method-description\":\"This API endpoint is used to get the information about the currencies available for lending.\",\"api-rate-limit\":10}" + "description": ":::info[Description]\nThis API endpoint is used to update the interest rates of subscription orders, which will take effect at the beginning of the next hour.,Please ensure that the funds are in the main(funding) account\n:::", + "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"Margin\",\"api-rate-limit-pool\":\"Spot\",\"sdk-service\":\"Margin\",\"sdk-sub-service\":\"Credit\",\"sdk-method-name\":\"modifyPurchase\",\"sdk-method-description\":\"This API endpoint is used to update the interest rates of subscription orders, which will take effect at the beginning of the next hour.,Please ensure that the funds are in the main(funding) account\",\"api-rate-limit\":10}" } }, { @@ -24076,6 +24346,98 @@ "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"General\",\"api-rate-limit-pool\":\"Spot\",\"sdk-service\":\"Margin\",\"sdk-sub-service\":\"Credit\",\"sdk-method-name\":\"getPurchaseOrders\",\"sdk-method-description\":\"This API endpoint provides pagination query for the purchase orders.\",\"api-rate-limit\":10}" } }, + { + "name": "Redeem", + "api": { + "id": "3470218", + "method": "post", + "path": "/api/v3/redeem", + "parameters": { + "path": [], + "query": [], + "cookie": [], + "header": [] + }, + "responses": [ + { + "id": "10382", + "code": 200, + "name": "OK", + "headers": [], + "jsonSchema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "object", + "properties": { + "orderNo": { + "type": "string", + "description": "Redeem order id" + } + }, + "required": [ + "orderNo" + ] + } + }, + "required": [ + "code", + "data" + ] + }, + "description": "", + "contentType": "json", + "mediaType": "" + } + ], + "responseExamples": [ + { + "name": "Success", + "data": "{\n \"code\": \"200000\",\n \"data\": {\n \"orderNo\": \"671bafa804c26d000773c533\"\n }\n}", + "responseId": 10382, + "ordering": 1 + } + ], + "requestBody": { + "type": "application/json", + "parameters": [], + "jsonSchema": { + "type": "object", + "properties": { + "currency": { + "type": "string", + "description": "Currency", + "examples": [ + "BTC", + "ETH", + "USDT" + ] + }, + "size": { + "type": "string", + "description": "Redemption amount" + }, + "purchaseOrderNo": { + "type": "string", + "description": "Purchase order id" + } + }, + "required": [ + "currency", + "size", + "purchaseOrderNo" + ] + }, + "example": "{\n \"currency\": \"BTC\",\n \"size\": \"0.001\",\n \"purchaseOrderNo\": \"671bafa804c26d000773c533\"\n}", + "mediaType": "" + }, + "description": ":::info[Description]\nRedeem your loan order\n:::", + "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"Margin\",\"api-rate-limit-pool\":\"Spot\",\"sdk-service\":\"Margin\",\"sdk-sub-service\":\"Credit\",\"sdk-method-name\":\"redeem\",\"sdk-method-description\":\"Redeem your loan order\",\"api-rate-limit\":15}" + } + }, { "name": "Get Redeem Orders", "api": { @@ -24211,383 +24573,44 @@ "description": "Purchase order id" }, "redeemOrderNo": { - "type": "string", - "description": "Redeem order id" - }, - "redeemSize": { - "type": "string", - "description": "Redemption size" - }, - "receiptSize": { - "type": "string", - "description": "Redeemed size" - }, - "applyTime": { - "type": "string", - "description": "Time of redeem" - }, - "status": { - "type": "string", - "description": "Status: DONE-completed; PENDING-settling" - } - }, - "required": [ - "currency", - "purchaseOrderNo", - "redeemOrderNo", - "redeemSize", - "receiptSize", - "applyTime", - "status" - ] - } - } - }, - "required": [ - "currentPage", - "pageSize", - "totalNum", - "totalPage", - "items" - ] - } - }, - "required": [ - "code", - "data" - ] - }, - "description": "", - "contentType": "json", - "mediaType": "" - } - ], - "responseExamples": [ - { - "name": "Success", - "data": "{\n \"code\": \"200000\",\n \"data\": {\n \"currentPage\": 1,\n \"pageSize\": 10,\n \"totalNum\": 1,\n \"totalPage\": 1,\n \"items\": [\n {\n \"currency\": \"BTC\",\n \"purchaseOrderNo\": \"671bafa804c26d000773c533\",\n \"redeemOrderNo\": \"671bb01004c26d000773c55c\",\n \"redeemSize\": \"0.001\",\n \"receiptSize\": \"0.001\",\n \"applyTime\": null,\n \"status\": \"DONE\"\n }\n ]\n }\n}", - "responseId": 10378, - "ordering": 1 - } - ], - "requestBody": { - "type": "none", - "parameters": [], - "jsonSchema": { - "type": "object", - "properties": {} - }, - "example": "{\n \"currency\": \"USDT\",\n \"size\": 10,\n \"timeInForce\": \"FOK\",\n \"isIsolated\": false,\n \"isHf\": false\n}", - "mediaType": "" - }, - "description": ":::info[Description]\nThis API endpoint provides pagination query for the redeem orders.\n:::", - "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"General\",\"api-rate-limit-pool\":\"Spot\",\"sdk-service\":\"Margin\",\"sdk-sub-service\":\"Credit\",\"sdk-method-name\":\"getRedeemOrders\",\"sdk-method-description\":\"This API endpoint provides pagination query for the redeem orders.\",\"api-rate-limit\":10}" - } - }, - { - "name": "Get Loan Market Interest Rate", - "api": { - "id": "3470215", - "method": "get", - "path": "/api/v3/project/marketInterestRate", - "parameters": { - "query": [ - { - "id": "l1uItcOfv7", - "name": "currency", - "required": true, - "description": "currency", - "example": "USDT", - "type": "string", - "schema": { - "type": "string", - "examples": [ - "BTC", - "ETH", - "KCS" - ] - }, - "enable": true - } - ], - "path": [], - "cookie": [], - "header": [] - }, - "responses": [ - { - "id": "10379", - "code": 200, - "name": "OK", - "headers": [], - "jsonSchema": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "data": { - "type": "array", - "items": { - "type": "object", - "properties": { - "time": { - "type": "string", - "description": "Time: YYYYMMDDHH00" - }, - "marketInterestRate": { - "type": "string", - "description": "Market lending rate" - } - }, - "required": [ - "time", - "marketInterestRate" - ] - } - } - }, - "required": [ - "code", - "data" - ] - }, - "description": "", - "contentType": "json", - "mediaType": "" - } - ], - "responseExamples": [ - { - "name": "Success", - "data": "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"time\": \"202410170000\",\n \"marketInterestRate\": \"0.005\"\n },\n {\n \"time\": \"202410170100\",\n \"marketInterestRate\": \"0.005\"\n }\n ]\n}", - "responseId": 10379, - "ordering": 1 - } - ], - "requestBody": { - "type": "none", - "parameters": [], - "jsonSchema": { - "type": "object", - "properties": {} - }, - "example": "{\n \"currency\": \"USDT\",\n \"size\": 10,\n \"timeInForce\": \"FOK\",\n \"isIsolated\": false,\n \"isHf\": false\n}", - "mediaType": "" - }, - "description": ":::info[Description]\nThis API endpoint is used to get the interest rates of the margin lending market over the past 7 days.\n:::", - "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Spot\",\"api-channel\":\"Public\",\"api-permission\":\"NULL\",\"api-rate-limit-pool\":\"Public\",\"sdk-service\":\"Margin\",\"sdk-sub-service\":\"Credit\",\"sdk-method-name\":\"getLoanMarketInterestRate\",\"sdk-method-description\":\"This API endpoint is used to get the interest rates of the margin lending market over the past 7 days.\",\"api-rate-limit\":5}" - } - }, - { - "name": "Purchase", - "api": { - "id": "3470216", - "method": "post", - "path": "/api/v3/purchase", - "parameters": { - "path": [], - "query": [], - "cookie": [], - "header": [] - }, - "responses": [ - { - "id": "10380", - "code": 200, - "name": "OK", - "headers": [], - "jsonSchema": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "data": { - "type": "object", - "properties": { - "orderNo": { - "type": "string", - "description": "Purchase order id" - } - }, - "required": [ - "orderNo" - ] - } - }, - "required": [ - "code", - "data" - ] - }, - "description": "", - "contentType": "json", - "mediaType": "" - } - ], - "responseExamples": [ - { - "name": "Success", - "data": "{\n \"code\": \"200000\",\n \"data\": {\n \"orderNo\": \"671bafa804c26d000773c533\"\n }\n}", - "responseId": 10380, - "ordering": 1 - } - ], - "requestBody": { - "type": "application/json", - "parameters": [], - "jsonSchema": { - "type": "object", - "properties": { - "currency": { - "type": "string", - "description": "Currency", - "examples": [ - "BTC", - "ETH", - "USDT" - ] - }, - "size": { - "type": "string", - "description": "purchase amount" - }, - "interestRate": { - "type": "string", - "description": "purchase interest rate" - } - }, - "required": [ - "currency", - "size", - "interestRate" - ] - }, - "example": "{\n \"currency\": \"BTC\",\n \"size\": \"0.001\",\n \"interestRate\": \"0.1\"\n}", - "mediaType": "" - }, - "description": ":::info[Description]\nInvest credit in the market and earn interest,Please ensure that the funds are in the main(funding) account\n:::", - "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"Margin\",\"api-rate-limit-pool\":\"Spot\",\"sdk-service\":\"Margin\",\"sdk-sub-service\":\"Credit\",\"sdk-method-name\":\"purchase\",\"sdk-method-description\":\"Invest credit in the market and earn interest\",\"api-rate-limit\":15}" - } - }, - { - "name": "Modify Purchase", - "api": { - "id": "3470217", - "method": "post", - "path": "/api/v3/lend/purchase/update", - "parameters": { - "query": [], - "path": [], - "cookie": [], - "header": [] - }, - "responses": [ - { - "id": "10381", - "code": 200, - "name": "OK", - "headers": [], - "jsonSchema": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "data": { - "type": "string" - } - }, - "required": [ - "code", - "data" - ] - }, - "description": "", - "contentType": "json", - "mediaType": "" - } - ], - "responseExamples": [ - { - "name": "Success", - "data": "{\n \"code\": \"200000\",\n \"data\": null\n}", - "responseId": 10381, - "ordering": 1 - } - ], - "requestBody": { - "type": "application/json", - "parameters": [], - "jsonSchema": { - "type": "object", - "properties": { - "currency": { - "type": "string", - "description": "Currency", - "examples": [ - "BTC", - "ETH", - "USDT" - ] - }, - "interestRate": { - "type": "string", - "description": "Modified purchase interest rate" - }, - "purchaseOrderNo": { - "type": "string", - "description": "Purchase order id" - } - }, - "required": [ - "currency", - "purchaseOrderNo", - "interestRate" - ] - }, - "example": "{\n \"currency\": \"BTC\",\n \"purchaseOrderNo\": \"671bafa804c26d000773c533\",\n \"interestRate\": \"0.09\"\n}", - "mediaType": "" - }, - "description": ":::info[Description]\nThis API endpoint is used to update the interest rates of subscription orders, which will take effect at the beginning of the next hour.,Please ensure that the funds are in the main(funding) account\n:::", - "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"Margin\",\"api-rate-limit-pool\":\"Spot\",\"sdk-service\":\"Margin\",\"sdk-sub-service\":\"Credit\",\"sdk-method-name\":\"modifyPurchase\",\"sdk-method-description\":\"This API endpoint is used to update the interest rates of subscription orders, which will take effect at the beginning of the next hour.,Please ensure that the funds are in the main(funding) account\",\"api-rate-limit\":10}" - } - }, - { - "name": "Redeem", - "api": { - "id": "3470218", - "method": "post", - "path": "/api/v3/redeem", - "parameters": { - "path": [], - "query": [], - "cookie": [], - "header": [] - }, - "responses": [ - { - "id": "10382", - "code": 200, - "name": "OK", - "headers": [], - "jsonSchema": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "data": { - "type": "object", - "properties": { - "orderNo": { - "type": "string", - "description": "Redeem order id" + "type": "string", + "description": "Redeem order id" + }, + "redeemSize": { + "type": "string", + "description": "Redemption size" + }, + "receiptSize": { + "type": "string", + "description": "Redeemed size" + }, + "applyTime": { + "type": "string", + "description": "Time of redeem" + }, + "status": { + "type": "string", + "description": "Status: DONE-completed; PENDING-settling" + } + }, + "required": [ + "currency", + "purchaseOrderNo", + "redeemOrderNo", + "redeemSize", + "receiptSize", + "applyTime", + "status" + ] + } } }, "required": [ - "orderNo" + "currentPage", + "pageSize", + "totalNum", + "totalPage", + "items" ] } }, @@ -24604,46 +24627,23 @@ "responseExamples": [ { "name": "Success", - "data": "{\n \"code\": \"200000\",\n \"data\": {\n \"orderNo\": \"671bafa804c26d000773c533\"\n }\n}", - "responseId": 10382, + "data": "{\n \"code\": \"200000\",\n \"data\": {\n \"currentPage\": 1,\n \"pageSize\": 10,\n \"totalNum\": 1,\n \"totalPage\": 1,\n \"items\": [\n {\n \"currency\": \"BTC\",\n \"purchaseOrderNo\": \"671bafa804c26d000773c533\",\n \"redeemOrderNo\": \"671bb01004c26d000773c55c\",\n \"redeemSize\": \"0.001\",\n \"receiptSize\": \"0.001\",\n \"applyTime\": null,\n \"status\": \"DONE\"\n }\n ]\n }\n}", + "responseId": 10378, "ordering": 1 } ], "requestBody": { - "type": "application/json", + "type": "none", "parameters": [], "jsonSchema": { "type": "object", - "properties": { - "currency": { - "type": "string", - "description": "Currency", - "examples": [ - "BTC", - "ETH", - "USDT" - ] - }, - "size": { - "type": "string", - "description": "Redemption amount" - }, - "purchaseOrderNo": { - "type": "string", - "description": "Purchase order id" - } - }, - "required": [ - "currency", - "size", - "purchaseOrderNo" - ] + "properties": {} }, - "example": "{\n \"currency\": \"BTC\",\n \"size\": \"0.001\",\n \"purchaseOrderNo\": \"671bafa804c26d000773c533\"\n}", + "example": "{\n \"currency\": \"USDT\",\n \"size\": 10,\n \"timeInForce\": \"FOK\",\n \"isIsolated\": false,\n \"isHf\": false\n}", "mediaType": "" }, - "description": ":::info[Description]\nRedeem your loan order\n:::", - "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"Margin\",\"api-rate-limit-pool\":\"Spot\",\"sdk-service\":\"Margin\",\"sdk-sub-service\":\"Credit\",\"sdk-method-name\":\"redeem\",\"sdk-method-description\":\"Redeem your loan order\",\"api-rate-limit\":15}" + "description": ":::info[Description]\nThis API endpoint provides pagination query for the redeem orders.\n:::", + "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"General\",\"api-rate-limit-pool\":\"Spot\",\"sdk-service\":\"Margin\",\"sdk-sub-service\":\"Credit\",\"sdk-method-name\":\"getRedeemOrders\",\"sdk-method-description\":\"This API endpoint provides pagination query for the redeem orders.\",\"api-rate-limit\":10}" } } ] @@ -24858,39 +24858,512 @@ "responseExamples": [ { "name": "Success", - "data": "//Cross Margin\n{\n \"code\": \"200000\",\n \"data\": [\n {\n \"timestamp\": 1729678659275,\n \"currency\": \"BTC\",\n \"borrowMaxAmount\": \"75.15\",\n \"buyMaxAmount\": \"217.12\",\n \"holdMaxAmount\": \"217.12\",\n \"borrowCoefficient\": \"1\",\n \"marginCoefficient\": \"1\",\n \"precision\": 8,\n \"borrowMinAmount\": \"0.001\",\n \"borrowMinUnit\": \"0.0001\",\n \"borrowEnabled\": true\n }\n ]\n}\n\n//Isolated Margin\n//{\n// \"code\": \"200000\",\n// \"data\": [\n// {\n// \"timestamp\": 1729685173576,\n// \"symbol\": \"BTC-USDT\",\n// \"baseMaxBorrowAmount\": \"75.4\",\n// \"quoteMaxBorrowAmount\": \"6000000\",\n// \"baseMaxBuyAmount\": \"217.84\",\n// \"quoteMaxBuyAmount\": \"8000000\",\n// \"baseMaxHoldAmount\": \"217.84\",\n// \"quoteMaxHoldAmount\": \"8000000\",\n// \"basePrecision\": 8,\n// \"quotePrecision\": 8,\n// \"baseBorrowCoefficient\": \"1\",\n// \"quoteBorrowCoefficient\": \"1\",\n// \"baseMarginCoefficient\": \"1\",\n// \"quoteMarginCoefficient\": \"1\",\n// \"baseBorrowMinAmount\": \"0.001\",\n// \"baseBorrowMinUnit\": \"0.0001\",\n// \"quoteBorrowMinAmount\": \"10\",\n// \"quoteBorrowMinUnit\": \"1\",\n// \"baseBorrowEnabled\": true,\n// \"quoteBorrowEnabled\": true\n// }\n// ]\n//}", - "responseId": 10383, + "data": "//Cross Margin\n{\n \"code\": \"200000\",\n \"data\": [\n {\n \"timestamp\": 1729678659275,\n \"currency\": \"BTC\",\n \"borrowMaxAmount\": \"75.15\",\n \"buyMaxAmount\": \"217.12\",\n \"holdMaxAmount\": \"217.12\",\n \"borrowCoefficient\": \"1\",\n \"marginCoefficient\": \"1\",\n \"precision\": 8,\n \"borrowMinAmount\": \"0.001\",\n \"borrowMinUnit\": \"0.0001\",\n \"borrowEnabled\": true\n }\n ]\n}\n\n//Isolated Margin\n//{\n// \"code\": \"200000\",\n// \"data\": [\n// {\n// \"timestamp\": 1729685173576,\n// \"symbol\": \"BTC-USDT\",\n// \"baseMaxBorrowAmount\": \"75.4\",\n// \"quoteMaxBorrowAmount\": \"6000000\",\n// \"baseMaxBuyAmount\": \"217.84\",\n// \"quoteMaxBuyAmount\": \"8000000\",\n// \"baseMaxHoldAmount\": \"217.84\",\n// \"quoteMaxHoldAmount\": \"8000000\",\n// \"basePrecision\": 8,\n// \"quotePrecision\": 8,\n// \"baseBorrowCoefficient\": \"1\",\n// \"quoteBorrowCoefficient\": \"1\",\n// \"baseMarginCoefficient\": \"1\",\n// \"quoteMarginCoefficient\": \"1\",\n// \"baseBorrowMinAmount\": \"0.001\",\n// \"baseBorrowMinUnit\": \"0.0001\",\n// \"quoteBorrowMinAmount\": \"10\",\n// \"quoteBorrowMinUnit\": \"1\",\n// \"baseBorrowEnabled\": true,\n// \"quoteBorrowEnabled\": true\n// }\n// ]\n//}", + "responseId": 10383, + "ordering": 1 + } + ], + "requestBody": { + "type": "none", + "parameters": [], + "jsonSchema": { + "type": "object", + "properties": {} + }, + "example": "{\n \"currency\": \"USDT\",\n \"size\": 10,\n \"timeInForce\": \"FOK\",\n \"isIsolated\": false,\n \"isHf\": false\n}", + "mediaType": "" + }, + "description": ":::info[Description]\nRequest via this endpoint to get the Configure and Risk limit info of the margin.\n:::", + "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"General\",\"api-rate-limit-pool\":\"Spot\",\"sdk-service\":\"Margin\",\"sdk-sub-service\":\"RiskLimit\",\"sdk-method-name\":\"getMarginRiskLimit\",\"sdk-method-description\":\"Request via this endpoint to get the Configure and Risk limit info of the margin.\",\"api-rate-limit\":20}" + } + } + ] + } + ] + }, + { + "name": "Futures Trading", + "id": 348134, + "description": "", + "items": [ + { + "name": "Market Data", + "id": 348153, + "description": "", + "items": [ + { + "name": "Get Symbol", + "api": { + "id": "3470221", + "method": "get", + "path": "/api/v1/contracts/{symbol}", + "parameters": { + "query": [], + "path": [ + { + "id": "symbol#0", + "name": "symbol", + "required": true, + "description": "Path Parameter. Symbol of the contract", + "example": "XBTUSDTM", + "type": "string", + "enable": true + } + ], + "cookie": [], + "header": [] + }, + "responses": [ + { + "id": "10385", + "code": 200, + "name": "OK", + "headers": [], + "jsonSchema": { + "type": "object", + "properties": { + "code": { + "type": "string", + "description": "200000 is for success, other is error" + }, + "data": { + "type": "object", + "properties": { + "symbol": { + "type": "string", + "description": "Symbol", + "examples": [ + "XBTUSDTM", + "XBTUSDCM", + "XBTUSDM" + ] + }, + "rootSymbol": { + "type": "string", + "description": "Contract group", + "examples": [ + "USDT", + "USDC", + "XBT" + ] + }, + "type": { + "type": "string", + "description": "Type of the contract", + "enum": [ + "FFWCSX", + "FFICSX" + ], + "x-api-enum": [ + { + "value": "FFWCSX", + "name": "FFWCSX", + "description": "Standardized swap contracts standard financial futures on swap, expiration swap funding rate" + }, + { + "value": "FFICSX", + "name": "FFICSX", + "description": "Futures Contract" + } + ] + }, + "firstOpenDate": { + "type": "integer", + "description": "First Open Date(millisecond)", + "format": "int64" + }, + "expireDate": { + "type": "integer", + "description": "Expiration date(millisecond). Null means it will never expire", + "format": "int64" + }, + "settleDate": { + "type": "integer", + "description": "Settlement date(millisecond). Null indicates that automatic settlement is not supported", + "format": "int64" + }, + "baseCurrency": { + "type": "string", + "description": "Base currency" + }, + "quoteCurrency": { + "type": "string", + "description": "Quote currency" + }, + "settleCurrency": { + "type": "string", + "description": "Currency used to clear and settle the trades" + }, + "maxOrderQty": { + "type": "integer", + "description": "Maximum order quantity" + }, + "maxPrice": { + "type": "number", + "description": "Maximum order price" + }, + "lotSize": { + "type": "integer", + "description": "Minimum lot size" + }, + "tickSize": { + "type": "number", + "description": "Minimum price changes" + }, + "indexPriceTickSize": { + "type": "number", + "description": "Index price of tick size" + }, + "multiplier": { + "type": "number", + "description": "The basic unit of the contract API is lots. For the number of coins in each lot, please refer to the param multiplier. For example, for XBTUSDTM, multiplier=0.001, which corresponds to the value of each XBTUSDTM contract being 0.001 BTC. There is also a special case. All coin-swap contracts, such as each XBTUSDM contract, correspond to 1 USD." + }, + "initialMargin": { + "type": "number", + "description": "Initial margin requirement" + }, + "maintainMargin": { + "type": "number", + "description": "Maintenance margin requirement" + }, + "maxRiskLimit": { + "type": "integer", + "description": "Maximum risk limit (unit: XBT)" + }, + "minRiskLimit": { + "type": "integer", + "description": "Minimum risk limit (unit: XBT)" + }, + "riskStep": { + "type": "integer", + "description": "Risk limit increment value (unit: XBT)" + }, + "makerFeeRate": { + "type": "number", + "description": "Maker fee rate" + }, + "takerFeeRate": { + "type": "number", + "description": "Taker fee rate" + }, + "takerFixFee": { + "type": "number", + "description": "Deprecated param" + }, + "makerFixFee": { + "type": "number", + "description": "Deprecated param" + }, + "settlementFee": { + "type": "number", + "description": "Settlement fee" + }, + "isDeleverage": { + "type": "boolean", + "description": "Enabled ADL or not" + }, + "isQuanto": { + "type": "boolean", + "description": "Deprecated param" + }, + "isInverse": { + "type": "boolean", + "description": "Whether it is a reverse contract" + }, + "markMethod": { + "type": "string", + "description": "Marking method", + "enum": [ + "FairPrice" + ], + "x-api-enum": [ + { + "value": "FairPrice", + "name": "FairPrice", + "description": "Fair Price" + } + ] + }, + "fairMethod": { + "type": "string", + "description": "Fair price marking method, The Futures contract is null", + "enum": [ + "FundingRate" + ], + "x-api-enum": [ + { + "value": "FundingRate", + "name": "FundingRate", + "description": "FundingRate" + } + ] + }, + "fundingBaseSymbol": { + "type": "string", + "description": "Ticker symbol of the based currency" + }, + "fundingQuoteSymbol": { + "type": "string", + "description": "Ticker symbol of the quote currency" + }, + "fundingRateSymbol": { + "type": "string", + "description": "Funding rate symbol" + }, + "indexSymbol": { + "type": "string", + "description": "Index symbol" + }, + "settlementSymbol": { + "type": "string", + "description": "Settlement Symbol" + }, + "status": { + "type": "string", + "description": "Contract status", + "enum": [ + "Init", + "Open", + "BeingSettled", + "Settled", + "Paused", + "Closed", + "CancelOnly" + ], + "x-api-enum": [ + { + "value": "Init", + "name": "Init", + "description": "Initial" + }, + { + "value": "Open", + "name": "Open", + "description": "Online" + }, + { + "value": "BeingSettled", + "name": "BeingSettled", + "description": "Setting" + }, + { + "value": "Settled", + "name": "Settled", + "description": "Settled" + }, + { + "value": "Paused", + "name": "Paused", + "description": "Suspended" + }, + { + "value": "Closed", + "name": "Closed", + "description": "Offline" + }, + { + "value": "CancelOnly", + "name": "CancelOnly", + "description": "Orders can only be canceled" + } + ] + }, + "fundingFeeRate": { + "type": "number", + "description": "Funding fee rate" + }, + "predictedFundingFeeRate": { + "type": "number", + "description": "Predicted funding fee rate" + }, + "fundingRateGranularity": { + "type": "integer", + "description": "Funding interval(millisecond)" + }, + "openInterest": { + "type": "string", + "description": "Open interest" + }, + "turnoverOf24h": { + "type": "number", + "description": "24-hour turnover" + }, + "volumeOf24h": { + "type": "number", + "description": "24-hour volume" + }, + "markPrice": { + "type": "number", + "description": "Mark price" + }, + "indexPrice": { + "type": "number", + "description": "Index price" + }, + "lastTradePrice": { + "type": "number", + "description": "Last trade price" + }, + "nextFundingRateTime": { + "type": "integer", + "description": "Next funding rate time(millisecond)" + }, + "maxLeverage": { + "type": "integer", + "description": "Maximum leverage" + }, + "sourceExchanges": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The contract index price source exchange" + }, + "premiumsSymbol1M": { + "type": "string", + "description": "Premium index symbol(1 minute)" + }, + "premiumsSymbol8H": { + "type": "string", + "description": "Premium index symbol(8 hours)" + }, + "fundingBaseSymbol1M": { + "type": "string", + "description": "Base currency interest rate symbol(1 minute)" + }, + "fundingQuoteSymbol1M": { + "type": "string", + "description": "Quote currency interest rate symbol(1 minute)" + }, + "lowPrice": { + "type": "number", + "description": "24-hour lowest price" + }, + "highPrice": { + "type": "number", + "description": "24-hour highest price" + }, + "priceChgPct": { + "type": "number", + "description": "24-hour price change% " + }, + "priceChg": { + "type": "number", + "description": "24-hour price change" + }, + "k": { + "type": "number" + }, + "m": { + "type": "number" + }, + "f": { + "type": "number" + }, + "mmrLimit": { + "type": "number" + }, + "mmrLevConstant": { + "type": "number" + }, + "supportCross": { + "type": "boolean", + "description": "Whether support Cross Margin" + } + }, + "required": [ + "symbol", + "rootSymbol", + "type", + "firstOpenDate", + "expireDate", + "settleDate", + "baseCurrency", + "quoteCurrency", + "settleCurrency", + "maxOrderQty", + "maxPrice", + "lotSize", + "tickSize", + "indexPriceTickSize", + "multiplier", + "initialMargin", + "maintainMargin", + "maxRiskLimit", + "minRiskLimit", + "riskStep", + "makerFeeRate", + "takerFeeRate", + "takerFixFee", + "makerFixFee", + "settlementFee", + "isDeleverage", + "isQuanto", + "isInverse", + "markMethod", + "fairMethod", + "fundingBaseSymbol", + "fundingQuoteSymbol", + "fundingRateSymbol", + "indexSymbol", + "settlementSymbol", + "status", + "fundingFeeRate", + "predictedFundingFeeRate", + "fundingRateGranularity", + "openInterest", + "turnoverOf24h", + "volumeOf24h", + "markPrice", + "indexPrice", + "lastTradePrice", + "nextFundingRateTime", + "maxLeverage", + "sourceExchanges", + "premiumsSymbol1M", + "premiumsSymbol8H", + "fundingBaseSymbol1M", + "fundingQuoteSymbol1M", + "lowPrice", + "highPrice", + "priceChgPct", + "priceChg", + "k", + "m", + "f", + "mmrLimit", + "mmrLevConstant", + "supportCross" + ] + } + }, + "required": [ + "code", + "data" + ] + }, + "description": "", + "contentType": "json", + "mediaType": "" + } + ], + "responseExamples": [ + { + "name": "Success", + "data": "{\n \"code\": \"200000\",\n \"data\": {\n \"symbol\": \"XBTUSDM\",\n \"rootSymbol\": \"XBT\",\n \"type\": \"FFWCSX\",\n \"firstOpenDate\": 1552638575000,\n \"expireDate\": null,\n \"settleDate\": null,\n \"baseCurrency\": \"XBT\",\n \"quoteCurrency\": \"USD\",\n \"settleCurrency\": \"XBT\",\n \"maxOrderQty\": 10000000,\n \"maxPrice\": 1000000.0,\n \"lotSize\": 1,\n \"tickSize\": 0.1,\n \"indexPriceTickSize\": 0.1,\n \"multiplier\": -1.0,\n \"initialMargin\": 0.014,\n \"maintainMargin\": 0.007,\n \"maxRiskLimit\": 1,\n \"minRiskLimit\": 1,\n \"riskStep\": 0,\n \"makerFeeRate\": 2.0E-4,\n \"takerFeeRate\": 6.0E-4,\n \"takerFixFee\": 0.0,\n \"makerFixFee\": 0.0,\n \"settlementFee\": null,\n \"isDeleverage\": true,\n \"isQuanto\": false,\n \"isInverse\": true,\n \"markMethod\": \"FairPrice\",\n \"fairMethod\": \"FundingRate\",\n \"fundingBaseSymbol\": \".XBTINT8H\",\n \"fundingQuoteSymbol\": \".USDINT8H\",\n \"fundingRateSymbol\": \".XBTUSDMFPI8H\",\n \"indexSymbol\": \".BXBT\",\n \"settlementSymbol\": null,\n \"status\": \"Open\",\n \"fundingFeeRate\": 1.75E-4,\n \"predictedFundingFeeRate\": 1.76E-4,\n \"fundingRateGranularity\": 28800000,\n \"openInterest\": \"61725904\",\n \"turnoverOf24h\": 209.56303473,\n \"volumeOf24h\": 1.4354731E7,\n \"markPrice\": 68336.7,\n \"indexPrice\": 68335.29,\n \"lastTradePrice\": 68349.3,\n \"nextFundingRateTime\": 17402942,\n \"maxLeverage\": 75,\n \"sourceExchanges\": [\n \"kraken\",\n \"bitstamp\",\n \"crypto\"\n ],\n \"premiumsSymbol1M\": \".XBTUSDMPI\",\n \"premiumsSymbol8H\": \".XBTUSDMPI8H\",\n \"fundingBaseSymbol1M\": \".XBTINT\",\n \"fundingQuoteSymbol1M\": \".USDINT\",\n \"lowPrice\": 67436.7,\n \"highPrice\": 69471.8,\n \"priceChgPct\": 0.0097,\n \"priceChg\": 658.7,\n \"k\": 2645000.0,\n \"m\": 1640000.0,\n \"f\": 1.3,\n \"mmrLimit\": 0.3,\n \"mmrLevConstant\": 75.0,\n \"supportCross\": true\n }\n}", + "responseId": 10385, "ordering": 1 } ], "requestBody": { "type": "none", "parameters": [], - "jsonSchema": { - "type": "object", - "properties": {} - }, - "example": "{\n \"currency\": \"USDT\",\n \"size\": 10,\n \"timeInForce\": \"FOK\",\n \"isIsolated\": false,\n \"isHf\": false\n}", "mediaType": "" }, - "description": ":::info[Description]\nRequest via this endpoint to get the Configure and Risk limit info of the margin.\n:::", - "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"General\",\"api-rate-limit-pool\":\"Spot\",\"sdk-service\":\"Margin\",\"sdk-sub-service\":\"RiskLimit\",\"sdk-method-name\":\"getMarginRiskLimit\",\"sdk-method-description\":\"Request via this endpoint to get the Configure and Risk limit info of the margin.\",\"api-rate-limit\":20}" + "description": ":::info[Description]\nGet information of specified contracts that can be traded. This API will return a list of tradable contracts, including some key parameters of the contract such as the symbol name, tick size, mark price,etc.\n:::", + "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Futures\",\"api-channel\":\"Public\",\"api-permission\":\"NULL\",\"api-rate-limit-pool\":\"Public\",\"sdk-service\":\"Futures\",\"sdk-sub-service\":\"Market\",\"sdk-method-name\":\"getSymbol\",\"sdk-method-description\":\"Get information of specified contracts that can be traded. This API will return a list of tradable contracts, including some key parameters of the contract such as the symbol name, tick size, mark price,etc.\",\"api-rate-limit\":3}" } - } - ] - } - ] - }, - { - "name": "Futures Trading", - "id": 348134, - "description": "", - "items": [ - { - "name": "Market Data", - "id": 348153, - "description": "", - "items": [ + }, { "name": "Get All Symbols", "api": { @@ -25305,501 +25778,28 @@ "turnoverOf24h", "volumeOf24h", "markPrice", - "indexPrice", - "lastTradePrice", - "nextFundingRateTime", - "maxLeverage", - "sourceExchanges", - "premiumsSymbol1M", - "premiumsSymbol8H", - "fundingBaseSymbol1M", - "fundingQuoteSymbol1M", - "lowPrice", - "highPrice", - "priceChgPct", - "priceChg", - "k", - "m", - "f", - "mmrLimit", - "mmrLevConstant", - "supportCross" - ] - }, - "description": "the list of all contracts" - } - }, - "required": [ - "code", - "data" - ] - }, - "description": "", - "contentType": "json", - "mediaType": "" - } - ], - "responseExamples": [ - { - "name": "Success", - "data": "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"symbol\": \"XBTUSDTM\",\n \"rootSymbol\": \"USDT\",\n \"type\": \"FFWCSX\",\n \"firstOpenDate\": 1585555200000,\n \"expireDate\": null,\n \"settleDate\": null,\n \"baseCurrency\": \"XBT\",\n \"quoteCurrency\": \"USDT\",\n \"settleCurrency\": \"USDT\",\n \"maxOrderQty\": 1000000,\n \"maxPrice\": 1000000.0,\n \"lotSize\": 1,\n \"tickSize\": 0.1,\n \"indexPriceTickSize\": 0.01,\n \"multiplier\": 0.001,\n \"initialMargin\": 0.008,\n \"maintainMargin\": 0.004,\n \"maxRiskLimit\": 100000,\n \"minRiskLimit\": 100000,\n \"riskStep\": 50000,\n \"makerFeeRate\": 2.0E-4,\n \"takerFeeRate\": 6.0E-4,\n \"takerFixFee\": 0.0,\n \"makerFixFee\": 0.0,\n \"settlementFee\": null,\n \"isDeleverage\": true,\n \"isQuanto\": true,\n \"isInverse\": false,\n \"markMethod\": \"FairPrice\",\n \"fairMethod\": \"FundingRate\",\n \"fundingBaseSymbol\": \".XBTINT8H\",\n \"fundingQuoteSymbol\": \".USDTINT8H\",\n \"fundingRateSymbol\": \".XBTUSDTMFPI8H\",\n \"indexSymbol\": \".KXBTUSDT\",\n \"settlementSymbol\": \"\",\n \"status\": \"Open\",\n \"fundingFeeRate\": 1.53E-4,\n \"predictedFundingFeeRate\": 8.0E-5,\n \"fundingRateGranularity\": 28800000,\n \"openInterest\": \"6384957\",\n \"turnoverOf24h\": 5.788402220999069E8,\n \"volumeOf24h\": 8274.432,\n \"markPrice\": 69732.33,\n \"indexPrice\": 69732.32,\n \"lastTradePrice\": 69732,\n \"nextFundingRateTime\": 21265941,\n \"maxLeverage\": 125,\n \"sourceExchanges\": [\n \"okex\",\n \"binance\",\n \"kucoin\",\n \"bybit\",\n \"bitmart\",\n \"gateio\"\n ],\n \"premiumsSymbol1M\": \".XBTUSDTMPI\",\n \"premiumsSymbol8H\": \".XBTUSDTMPI8H\",\n \"fundingBaseSymbol1M\": \".XBTINT\",\n \"fundingQuoteSymbol1M\": \".USDTINT\",\n \"lowPrice\": 68817.5,\n \"highPrice\": 71615.8,\n \"priceChgPct\": 6.0E-4,\n \"priceChg\": 48.0,\n \"k\": 490.0,\n \"m\": 300.0,\n \"f\": 1.3,\n \"mmrLimit\": 0.3,\n \"mmrLevConstant\": 125.0,\n \"supportCross\": true\n }\n ]\n}", - "responseId": 10384, - "ordering": 1 - } - ], - "requestBody": { - "type": "none", - "parameters": [], - "mediaType": "" - }, - "description": ":::info[Description]\nGet detailed information of all contracts that can be traded. This API will return a list of tradable contracts, including some key parameters of the contract such as the symbol name, tick size, mark price,etc.\n:::", - "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Futures\",\"api-channel\":\"Public\",\"api-permission\":\"NULL\",\"api-rate-limit-pool\":\"Public\",\"sdk-service\":\"Futures\",\"sdk-sub-service\":\"Market\",\"sdk-method-name\":\"GetAllSymbols\",\"sdk-method-description\":\"Get detailed information of all contracts that can be traded. This API will return a list of tradable contracts, including some key parameters of the contract such as the symbol name, tick size, mark price,etc.\",\"api-rate-limit\":3}" - } - }, - { - "name": "Get Symbol", - "api": { - "id": "3470221", - "method": "get", - "path": "/api/v1/contracts/{symbol}", - "parameters": { - "query": [], - "path": [ - { - "id": "symbol#0", - "name": "symbol", - "required": true, - "description": "Path Parameter. Symbol of the contract", - "example": "XBTUSDTM", - "type": "string", - "enable": true - } - ], - "cookie": [], - "header": [] - }, - "responses": [ - { - "id": "10385", - "code": 200, - "name": "OK", - "headers": [], - "jsonSchema": { - "type": "object", - "properties": { - "code": { - "type": "string", - "description": "200000 is for success, other is error" - }, - "data": { - "type": "object", - "properties": { - "symbol": { - "type": "string", - "description": "Symbol", - "examples": [ - "XBTUSDTM", - "XBTUSDCM", - "XBTUSDM" - ] - }, - "rootSymbol": { - "type": "string", - "description": "Contract group", - "examples": [ - "USDT", - "USDC", - "XBT" - ] - }, - "type": { - "type": "string", - "description": "Type of the contract", - "enum": [ - "FFWCSX", - "FFICSX" - ], - "x-api-enum": [ - { - "value": "FFWCSX", - "name": "FFWCSX", - "description": "Standardized swap contracts standard financial futures on swap, expiration swap funding rate" - }, - { - "value": "FFICSX", - "name": "FFICSX", - "description": "Futures Contract" - } - ] - }, - "firstOpenDate": { - "type": "integer", - "description": "First Open Date(millisecond)", - "format": "int64" - }, - "expireDate": { - "type": "integer", - "description": "Expiration date(millisecond). Null means it will never expire", - "format": "int64" - }, - "settleDate": { - "type": "integer", - "description": "Settlement date(millisecond). Null indicates that automatic settlement is not supported", - "format": "int64" - }, - "baseCurrency": { - "type": "string", - "description": "Base currency" - }, - "quoteCurrency": { - "type": "string", - "description": "Quote currency" - }, - "settleCurrency": { - "type": "string", - "description": "Currency used to clear and settle the trades" - }, - "maxOrderQty": { - "type": "integer", - "description": "Maximum order quantity" - }, - "maxPrice": { - "type": "number", - "description": "Maximum order price" - }, - "lotSize": { - "type": "integer", - "description": "Minimum lot size" - }, - "tickSize": { - "type": "number", - "description": "Minimum price changes" - }, - "indexPriceTickSize": { - "type": "number", - "description": "Index price of tick size" - }, - "multiplier": { - "type": "number", - "description": "The basic unit of the contract API is lots. For the number of coins in each lot, please refer to the param multiplier. For example, for XBTUSDTM, multiplier=0.001, which corresponds to the value of each XBTUSDTM contract being 0.001 BTC. There is also a special case. All coin-swap contracts, such as each XBTUSDM contract, correspond to 1 USD." - }, - "initialMargin": { - "type": "number", - "description": "Initial margin requirement" - }, - "maintainMargin": { - "type": "number", - "description": "Maintenance margin requirement" - }, - "maxRiskLimit": { - "type": "integer", - "description": "Maximum risk limit (unit: XBT)" - }, - "minRiskLimit": { - "type": "integer", - "description": "Minimum risk limit (unit: XBT)" - }, - "riskStep": { - "type": "integer", - "description": "Risk limit increment value (unit: XBT)" - }, - "makerFeeRate": { - "type": "number", - "description": "Maker fee rate" - }, - "takerFeeRate": { - "type": "number", - "description": "Taker fee rate" - }, - "takerFixFee": { - "type": "number", - "description": "Deprecated param" - }, - "makerFixFee": { - "type": "number", - "description": "Deprecated param" - }, - "settlementFee": { - "type": "number", - "description": "Settlement fee" - }, - "isDeleverage": { - "type": "boolean", - "description": "Enabled ADL or not" - }, - "isQuanto": { - "type": "boolean", - "description": "Deprecated param" - }, - "isInverse": { - "type": "boolean", - "description": "Whether it is a reverse contract" - }, - "markMethod": { - "type": "string", - "description": "Marking method", - "enum": [ - "FairPrice" - ], - "x-api-enum": [ - { - "value": "FairPrice", - "name": "FairPrice", - "description": "Fair Price" - } - ] - }, - "fairMethod": { - "type": "string", - "description": "Fair price marking method, The Futures contract is null", - "enum": [ - "FundingRate" - ], - "x-api-enum": [ - { - "value": "FundingRate", - "name": "FundingRate", - "description": "FundingRate" - } - ] - }, - "fundingBaseSymbol": { - "type": "string", - "description": "Ticker symbol of the based currency" - }, - "fundingQuoteSymbol": { - "type": "string", - "description": "Ticker symbol of the quote currency" - }, - "fundingRateSymbol": { - "type": "string", - "description": "Funding rate symbol" - }, - "indexSymbol": { - "type": "string", - "description": "Index symbol" - }, - "settlementSymbol": { - "type": "string", - "description": "Settlement Symbol" - }, - "status": { - "type": "string", - "description": "Contract status", - "enum": [ - "Init", - "Open", - "BeingSettled", - "Settled", - "Paused", - "Closed", - "CancelOnly" - ], - "x-api-enum": [ - { - "value": "Init", - "name": "Init", - "description": "Initial" - }, - { - "value": "Open", - "name": "Open", - "description": "Online" - }, - { - "value": "BeingSettled", - "name": "BeingSettled", - "description": "Setting" - }, - { - "value": "Settled", - "name": "Settled", - "description": "Settled" - }, - { - "value": "Paused", - "name": "Paused", - "description": "Suspended" - }, - { - "value": "Closed", - "name": "Closed", - "description": "Offline" - }, - { - "value": "CancelOnly", - "name": "CancelOnly", - "description": "Orders can only be canceled" - } - ] - }, - "fundingFeeRate": { - "type": "number", - "description": "Funding fee rate" - }, - "predictedFundingFeeRate": { - "type": "number", - "description": "Predicted funding fee rate" - }, - "fundingRateGranularity": { - "type": "integer", - "description": "Funding interval(millisecond)" - }, - "openInterest": { - "type": "string", - "description": "Open interest" - }, - "turnoverOf24h": { - "type": "number", - "description": "24-hour turnover" - }, - "volumeOf24h": { - "type": "number", - "description": "24-hour volume" - }, - "markPrice": { - "type": "number", - "description": "Mark price" - }, - "indexPrice": { - "type": "number", - "description": "Index price" - }, - "lastTradePrice": { - "type": "number", - "description": "Last trade price" - }, - "nextFundingRateTime": { - "type": "integer", - "description": "Next funding rate time(millisecond)" - }, - "maxLeverage": { - "type": "integer", - "description": "Maximum leverage" - }, - "sourceExchanges": { - "type": "array", - "items": { - "type": "string" - }, - "description": "The contract index price source exchange" - }, - "premiumsSymbol1M": { - "type": "string", - "description": "Premium index symbol(1 minute)" - }, - "premiumsSymbol8H": { - "type": "string", - "description": "Premium index symbol(8 hours)" - }, - "fundingBaseSymbol1M": { - "type": "string", - "description": "Base currency interest rate symbol(1 minute)" - }, - "fundingQuoteSymbol1M": { - "type": "string", - "description": "Quote currency interest rate symbol(1 minute)" - }, - "lowPrice": { - "type": "number", - "description": "24-hour lowest price" - }, - "highPrice": { - "type": "number", - "description": "24-hour highest price" - }, - "priceChgPct": { - "type": "number", - "description": "24-hour price change% " - }, - "priceChg": { - "type": "number", - "description": "24-hour price change" - }, - "k": { - "type": "number" - }, - "m": { - "type": "number" - }, - "f": { - "type": "number" - }, - "mmrLimit": { - "type": "number" - }, - "mmrLevConstant": { - "type": "number" - }, - "supportCross": { - "type": "boolean", - "description": "Whether support Cross Margin" - } + "indexPrice", + "lastTradePrice", + "nextFundingRateTime", + "maxLeverage", + "sourceExchanges", + "premiumsSymbol1M", + "premiumsSymbol8H", + "fundingBaseSymbol1M", + "fundingQuoteSymbol1M", + "lowPrice", + "highPrice", + "priceChgPct", + "priceChg", + "k", + "m", + "f", + "mmrLimit", + "mmrLevConstant", + "supportCross" + ] }, - "required": [ - "symbol", - "rootSymbol", - "type", - "firstOpenDate", - "expireDate", - "settleDate", - "baseCurrency", - "quoteCurrency", - "settleCurrency", - "maxOrderQty", - "maxPrice", - "lotSize", - "tickSize", - "indexPriceTickSize", - "multiplier", - "initialMargin", - "maintainMargin", - "maxRiskLimit", - "minRiskLimit", - "riskStep", - "makerFeeRate", - "takerFeeRate", - "takerFixFee", - "makerFixFee", - "settlementFee", - "isDeleverage", - "isQuanto", - "isInverse", - "markMethod", - "fairMethod", - "fundingBaseSymbol", - "fundingQuoteSymbol", - "fundingRateSymbol", - "indexSymbol", - "settlementSymbol", - "status", - "fundingFeeRate", - "predictedFundingFeeRate", - "fundingRateGranularity", - "openInterest", - "turnoverOf24h", - "volumeOf24h", - "markPrice", - "indexPrice", - "lastTradePrice", - "nextFundingRateTime", - "maxLeverage", - "sourceExchanges", - "premiumsSymbol1M", - "premiumsSymbol8H", - "fundingBaseSymbol1M", - "fundingQuoteSymbol1M", - "lowPrice", - "highPrice", - "priceChgPct", - "priceChg", - "k", - "m", - "f", - "mmrLimit", - "mmrLevConstant", - "supportCross" - ] + "description": "the list of all contracts" } }, "required": [ @@ -25815,8 +25815,8 @@ "responseExamples": [ { "name": "Success", - "data": "{\n \"code\": \"200000\",\n \"data\": {\n \"symbol\": \"XBTUSDM\",\n \"rootSymbol\": \"XBT\",\n \"type\": \"FFWCSX\",\n \"firstOpenDate\": 1552638575000,\n \"expireDate\": null,\n \"settleDate\": null,\n \"baseCurrency\": \"XBT\",\n \"quoteCurrency\": \"USD\",\n \"settleCurrency\": \"XBT\",\n \"maxOrderQty\": 10000000,\n \"maxPrice\": 1000000.0,\n \"lotSize\": 1,\n \"tickSize\": 0.1,\n \"indexPriceTickSize\": 0.1,\n \"multiplier\": -1.0,\n \"initialMargin\": 0.014,\n \"maintainMargin\": 0.007,\n \"maxRiskLimit\": 1,\n \"minRiskLimit\": 1,\n \"riskStep\": 0,\n \"makerFeeRate\": 2.0E-4,\n \"takerFeeRate\": 6.0E-4,\n \"takerFixFee\": 0.0,\n \"makerFixFee\": 0.0,\n \"settlementFee\": null,\n \"isDeleverage\": true,\n \"isQuanto\": false,\n \"isInverse\": true,\n \"markMethod\": \"FairPrice\",\n \"fairMethod\": \"FundingRate\",\n \"fundingBaseSymbol\": \".XBTINT8H\",\n \"fundingQuoteSymbol\": \".USDINT8H\",\n \"fundingRateSymbol\": \".XBTUSDMFPI8H\",\n \"indexSymbol\": \".BXBT\",\n \"settlementSymbol\": null,\n \"status\": \"Open\",\n \"fundingFeeRate\": 1.75E-4,\n \"predictedFundingFeeRate\": 1.76E-4,\n \"fundingRateGranularity\": 28800000,\n \"openInterest\": \"61725904\",\n \"turnoverOf24h\": 209.56303473,\n \"volumeOf24h\": 1.4354731E7,\n \"markPrice\": 68336.7,\n \"indexPrice\": 68335.29,\n \"lastTradePrice\": 68349.3,\n \"nextFundingRateTime\": 17402942,\n \"maxLeverage\": 75,\n \"sourceExchanges\": [\n \"kraken\",\n \"bitstamp\",\n \"crypto\"\n ],\n \"premiumsSymbol1M\": \".XBTUSDMPI\",\n \"premiumsSymbol8H\": \".XBTUSDMPI8H\",\n \"fundingBaseSymbol1M\": \".XBTINT\",\n \"fundingQuoteSymbol1M\": \".USDINT\",\n \"lowPrice\": 67436.7,\n \"highPrice\": 69471.8,\n \"priceChgPct\": 0.0097,\n \"priceChg\": 658.7,\n \"k\": 2645000.0,\n \"m\": 1640000.0,\n \"f\": 1.3,\n \"mmrLimit\": 0.3,\n \"mmrLevConstant\": 75.0,\n \"supportCross\": true\n }\n}", - "responseId": 10385, + "data": "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"symbol\": \"XBTUSDTM\",\n \"rootSymbol\": \"USDT\",\n \"type\": \"FFWCSX\",\n \"firstOpenDate\": 1585555200000,\n \"expireDate\": null,\n \"settleDate\": null,\n \"baseCurrency\": \"XBT\",\n \"quoteCurrency\": \"USDT\",\n \"settleCurrency\": \"USDT\",\n \"maxOrderQty\": 1000000,\n \"maxPrice\": 1000000.0,\n \"lotSize\": 1,\n \"tickSize\": 0.1,\n \"indexPriceTickSize\": 0.01,\n \"multiplier\": 0.001,\n \"initialMargin\": 0.008,\n \"maintainMargin\": 0.004,\n \"maxRiskLimit\": 100000,\n \"minRiskLimit\": 100000,\n \"riskStep\": 50000,\n \"makerFeeRate\": 2.0E-4,\n \"takerFeeRate\": 6.0E-4,\n \"takerFixFee\": 0.0,\n \"makerFixFee\": 0.0,\n \"settlementFee\": null,\n \"isDeleverage\": true,\n \"isQuanto\": true,\n \"isInverse\": false,\n \"markMethod\": \"FairPrice\",\n \"fairMethod\": \"FundingRate\",\n \"fundingBaseSymbol\": \".XBTINT8H\",\n \"fundingQuoteSymbol\": \".USDTINT8H\",\n \"fundingRateSymbol\": \".XBTUSDTMFPI8H\",\n \"indexSymbol\": \".KXBTUSDT\",\n \"settlementSymbol\": \"\",\n \"status\": \"Open\",\n \"fundingFeeRate\": 1.53E-4,\n \"predictedFundingFeeRate\": 8.0E-5,\n \"fundingRateGranularity\": 28800000,\n \"openInterest\": \"6384957\",\n \"turnoverOf24h\": 5.788402220999069E8,\n \"volumeOf24h\": 8274.432,\n \"markPrice\": 69732.33,\n \"indexPrice\": 69732.32,\n \"lastTradePrice\": 69732,\n \"nextFundingRateTime\": 21265941,\n \"maxLeverage\": 125,\n \"sourceExchanges\": [\n \"okex\",\n \"binance\",\n \"kucoin\",\n \"bybit\",\n \"bitmart\",\n \"gateio\"\n ],\n \"premiumsSymbol1M\": \".XBTUSDTMPI\",\n \"premiumsSymbol8H\": \".XBTUSDTMPI8H\",\n \"fundingBaseSymbol1M\": \".XBTINT\",\n \"fundingQuoteSymbol1M\": \".USDTINT\",\n \"lowPrice\": 68817.5,\n \"highPrice\": 71615.8,\n \"priceChgPct\": 6.0E-4,\n \"priceChg\": 48.0,\n \"k\": 490.0,\n \"m\": 300.0,\n \"f\": 1.3,\n \"mmrLimit\": 0.3,\n \"mmrLevConstant\": 125.0,\n \"supportCross\": true\n }\n ]\n}", + "responseId": 10384, "ordering": 1 } ], @@ -25825,8 +25825,8 @@ "parameters": [], "mediaType": "" }, - "description": ":::info[Description]\nGet information of specified contracts that can be traded. This API will return a list of tradable contracts, including some key parameters of the contract such as the symbol name, tick size, mark price,etc.\n:::", - "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Futures\",\"api-channel\":\"Public\",\"api-permission\":\"NULL\",\"api-rate-limit-pool\":\"Public\",\"sdk-service\":\"Futures\",\"sdk-sub-service\":\"Market\",\"sdk-method-name\":\"getSymbol\",\"sdk-method-description\":\"Get information of specified contracts that can be traded. This API will return a list of tradable contracts, including some key parameters of the contract such as the symbol name, tick size, mark price,etc.\",\"api-rate-limit\":3}" + "description": ":::info[Description]\nGet detailed information of all contracts that can be traded. This API will return a list of tradable contracts, including some key parameters of the contract such as the symbol name, tick size, mark price,etc.\n:::", + "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Futures\",\"api-channel\":\"Public\",\"api-permission\":\"NULL\",\"api-rate-limit-pool\":\"Public\",\"sdk-service\":\"Futures\",\"sdk-sub-service\":\"Market\",\"sdk-method-name\":\"GetAllSymbols\",\"sdk-method-description\":\"Get detailed information of all contracts that can be traded. This API will return a list of tradable contracts, including some key parameters of the contract such as the symbol name, tick size, mark price,etc.\",\"api-rate-limit\":3}" } }, { @@ -26333,9 +26333,429 @@ "required": [ "sequence", "symbol", - "bids", - "asks", - "ts" + "bids", + "asks", + "ts" + ] + } + }, + "required": [ + "code", + "data" + ] + }, + "description": "", + "contentType": "json", + "mediaType": "" + } + ], + "responseExamples": [ + { + "name": "Success", + "data": "{\n \"code\": \"200000\",\n \"data\": {\n \"sequence\": 1697895963339,\n \"symbol\": \"XBTUSDM\",\n \"bids\": [\n [\n 66968,\n 2\n ],\n [\n 66964.8,\n 25596\n ]\n ],\n \"asks\": [\n [\n 66968.1,\n 13501\n ],\n [\n 66968.7,\n 2032\n ]\n ],\n \"ts\": 1729168101216000000\n }\n}", + "responseId": 10389, + "ordering": 1 + } + ], + "requestBody": { + "type": "none", + "parameters": [], + "mediaType": "" + }, + "description": ":::info[Discription]\nQuery for part orderbook depth data. (aggregated by price)\n\nYou are recommended to request via this endpoint as the system reponse would be faster and cosume less traffic.\n:::", + "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Futures\",\"api-channel\":\"Public\",\"api-permission\":\"NULL\",\"api-rate-limit-pool\":\"Public\",\"sdk-service\":\"Futures\",\"sdk-sub-service\":\"Market\",\"sdk-method-name\":\"getPartOrderBook\",\"sdk-method-description\":\"Query for part orderbook depth data. (aggregated by price) You are recommended to request via this endpoint as the system reponse would be faster and cosume less traffic.\",\"api-rate-limit\":5}" + } + }, + { + "name": "Get Trade History", + "api": { + "id": "3470232", + "method": "get", + "path": "/api/v1/trade/history", + "parameters": { + "query": [ + { + "id": "jVYCLbgfDY", + "name": "symbol", + "required": true, + "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](apidog://link/endpoint/3470220) ", + "example": "XBTUSDM", + "type": "string", + "enable": true + } + ], + "path": [], + "cookie": [], + "header": [] + }, + "responses": [ + { + "id": "10396", + "code": 200, + "name": "OK", + "headers": [], + "jsonSchema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "array", + "items": { + "type": "object", + "properties": { + "sequence": { + "type": "integer", + "description": "Sequence number", + "format": "int64" + }, + "contractId": { + "type": "integer", + "description": "Deprecated param" + }, + "tradeId": { + "type": "string", + "description": "Transaction ID" + }, + "makerOrderId": { + "type": "string", + "description": "Maker order ID" + }, + "takerOrderId": { + "type": "string", + "description": "Taker order ID" + }, + "ts": { + "type": "integer", + "description": "Filled timestamp(nanosecond)", + "format": "int64" + }, + "size": { + "type": "integer", + "description": "Filled amount" + }, + "price": { + "type": "string", + "description": "Filled price" + }, + "side": { + "type": "string", + "description": "Filled side, The trade side indicates the taker order side. A taker order is the order that was matched with orders opened on the order book.", + "enum": [ + "buy", + "sell" + ], + "x-api-enum": [ + { + "value": "buy", + "name": "buy", + "description": "buy" + }, + { + "value": "sell", + "name": "sell", + "description": "sell" + } + ] + } + }, + "required": [ + "sequence", + "contractId", + "tradeId", + "makerOrderId", + "takerOrderId", + "ts", + "size", + "price", + "side" + ] + } + } + }, + "required": [ + "code", + "data" + ] + }, + "description": "", + "contentType": "json", + "mediaType": "" + } + ], + "responseExamples": [ + { + "name": "Success", + "data": "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"sequence\": 1697915257909,\n \"contractId\": 1,\n \"tradeId\": \"1697915257909\",\n \"makerOrderId\": \"236679665752801280\",\n \"takerOrderId\": \"236679667975745536\",\n \"ts\": 1729242032152000000,\n \"size\": 1,\n \"price\": \"67878\",\n \"side\": \"sell\"\n },\n {\n \"sequence\": 1697915257749,\n \"contractId\": 1,\n \"tradeId\": \"1697915257749\",\n \"makerOrderId\": \"236679660971245570\",\n \"takerOrderId\": \"236679665400492032\",\n \"ts\": 1729242031535000000,\n \"size\": 1,\n \"price\": \"67867.8\",\n \"side\": \"sell\"\n },\n {\n \"sequence\": 1697915257701,\n \"contractId\": 1,\n \"tradeId\": \"1697915257701\",\n \"makerOrderId\": \"236679660971245570\",\n \"takerOrderId\": \"236679661919211521\",\n \"ts\": 1729242030932000000,\n \"size\": 1,\n \"price\": \"67867.8\",\n \"side\": \"sell\"\n }\n ]\n}", + "responseId": 10396, + "ordering": 1 + } + ], + "requestBody": { + "type": "none", + "parameters": [], + "mediaType": "" + }, + "description": ":::info[Discription]\nRequest via this endpoint to get the trade history of the specified symbol, the returned quantity is the last 100 transaction records.\n:::", + "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Futures\",\"api-channel\":\"Public\",\"api-permission\":\"NULL\",\"api-rate-limit-pool\":\"Public\",\"sdk-service\":\"Futures\",\"sdk-sub-service\":\"Market\",\"sdk-method-name\":\"getTradeHistory\",\"sdk-method-description\":\"Request via this endpoint to get the trade history of the specified symbol, the returned quantity is the last 100 transaction records.\",\"api-rate-limit\":5}" + } + }, + { + "name": "Get Klines", + "api": { + "id": "3470234", + "method": "get", + "path": "/api/v1/kline/query", + "parameters": { + "query": [ + { + "id": "jVYCLbgfDY", + "name": "symbol", + "required": true, + "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol, indexSymbol, premiumsSymbol1M, premiumsSymbol8H](apidog://link/endpoint/3470220) ", + "example": "", + "type": "string", + "schema": { + "type": "string", + "examples": [ + "XBTUSDTM", + ".KXBTUSDT", + ".XBTUSDTMPI", + ".XBTUSDTMPI8H" + ] + }, + "enable": true + }, + { + "id": "jgqzFrzKqc", + "name": "granularity", + "required": true, + "description": "Type of candlestick patterns(minute)", + "example": "", + "type": "integer", + "schema": { + "type": "integer", + "enum": [ + 1, + 5, + 15, + 30, + 60, + 120, + 240, + 480, + 720, + 1440, + 10080 + ], + "format": "int64", + "x-api-enum": [ + { + "value": 1, + "name": "1", + "description": "1min" + }, + { + "value": 5, + "name": "5", + "description": "5min" + }, + { + "value": 15, + "name": "15", + "description": "15min" + }, + { + "value": 30, + "name": "30", + "description": "30min" + }, + { + "value": 60, + "name": "60", + "description": "1hour" + }, + { + "value": 120, + "name": "120", + "description": "2hour" + }, + { + "value": 240, + "name": "240", + "description": "4hour" + }, + { + "value": 480, + "name": "480", + "description": "8hour" + }, + { + "value": 720, + "name": "720", + "description": "12hour" + }, + { + "value": 1440, + "name": "1440", + "description": "1day" + }, + { + "value": 10080, + "name": "10080", + "description": "1week" + } + ] + }, + "enable": true + }, + { + "id": "DyCMyfR0e9", + "name": "from", + "required": false, + "description": "Start time (milisecond)", + "example": "1728552342000", + "type": "integer", + "schema": { + "type": "integer", + "format": "int64" + }, + "enable": true + }, + { + "id": "Z1XMrUW1vQ", + "name": "to", + "required": false, + "description": "End time (milisecond)", + "example": "1729243542000", + "type": "integer", + "schema": { + "type": "integer", + "format": "int64" + }, + "enable": true + } + ], + "path": [], + "cookie": [], + "header": [] + }, + "responses": [ + { + "id": "10398", + "code": 200, + "name": "OK", + "headers": [], + "jsonSchema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "number", + "description": "Start time of the candle cycle, opening price, highest price, Lowest price, closing price, Transaction volume" + } + } + } + }, + "required": [ + "code", + "data" + ] + }, + "description": "", + "contentType": "json", + "mediaType": "" + } + ], + "responseExamples": [ + { + "name": "Success", + "data": "{\n \"code\": \"200000\",\n \"data\": [\n [\n 1728576000000,\n 60791.1,\n 61035,\n 58940,\n 60300,\n 5501167\n ],\n [\n 1728604800000,\n 60299.9,\n 60924.1,\n 60077.4,\n 60666.1,\n 1220980\n ],\n [\n 1728633600000,\n 60665.7,\n 62436.8,\n 60650.1,\n 62255.1,\n 3386359\n ]\n ]\n}", + "responseId": 10398, + "ordering": 1 + } + ], + "requestBody": { + "type": "none", + "parameters": [], + "mediaType": "" + }, + "description": ":::info[Description]\nGet the Kline of the symbol. Data are returned in grouped buckets based on requested type.\nFor each query, the system would return at most 500 pieces of data. To obtain more data, please page the data by time.\n:::\n\n:::tip[Tips]\nKlines data may be incomplete. No data is published for intervals where there are no ticks.\n\nIf the specified start/end time and the time granularity exceeds the maximum size allowed for a single request, the system will only return 500 pieces of data for your request. If you want to get fine-grained data in a larger time range, you will need to specify the time ranges and make multiple requests for multiple times.\n\nIf you’ve specified only the start time in your request, the system will return 500 pieces of data from the specified start time to the current time of the system; If only the end time is specified, the system will return 500 pieces of data closest to the end time; If neither the start time nor the end time is specified, the system will return the 500 pieces of data closest to the current time of the system.\n:::", + "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Futures\",\"api-channel\":\"Public\",\"api-permission\":\"NULL\",\"api-rate-limit-pool\":\"Public\",\"sdk-service\":\"Futures\",\"sdk-sub-service\":\"Market\",\"sdk-method-name\":\"getKlines\",\"sdk-method-description\":\"Get the Kline of the symbol. Data are returned in grouped buckets based on requested type. For each query, the system would return at most 500 pieces of data. To obtain more data, please page the data by time.\",\"api-rate-limit\":3}" + } + }, + { + "name": "Get Mark Price", + "api": { + "id": "3470233", + "method": "get", + "path": "/api/v1/mark-price/{symbol}/current", + "parameters": { + "query": [], + "path": [ + { + "id": "symbol#0", + "name": "symbol", + "required": true, + "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](apidog://link/endpoint/3470220) ", + "example": "XBTUSDTM", + "type": "string", + "enable": true + } + ], + "cookie": [], + "header": [] + }, + "responses": [ + { + "id": "10397", + "code": 200, + "name": "OK", + "headers": [], + "jsonSchema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "object", + "properties": { + "symbol": { + "type": "string", + "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](apidog://link/endpoint/3470220) " + }, + "granularity": { + "type": "integer", + "description": "Granularity (milisecond)" + }, + "timePoint": { + "type": "integer", + "description": "Time point (milisecond)", + "format": "int64" + }, + "value": { + "type": "number", + "description": "Mark price" + }, + "indexPrice": { + "type": "number", + "description": "Index price" + } + }, + "required": [ + "symbol", + "granularity", + "timePoint", + "value", + "indexPrice" ] } }, @@ -26352,8 +26772,8 @@ "responseExamples": [ { "name": "Success", - "data": "{\n \"code\": \"200000\",\n \"data\": {\n \"sequence\": 1697895963339,\n \"symbol\": \"XBTUSDM\",\n \"bids\": [\n [\n 66968,\n 2\n ],\n [\n 66964.8,\n 25596\n ]\n ],\n \"asks\": [\n [\n 66968.1,\n 13501\n ],\n [\n 66968.7,\n 2032\n ]\n ],\n \"ts\": 1729168101216000000\n }\n}", - "responseId": 10389, + "data": "{\"code\":\"200000\",\"data\":{\"symbol\":\"XBTUSDTM\",\"granularity\":1000,\"timePoint\":1729254307000,\"value\":67687.08,\"indexPrice\":67683.58}}", + "responseId": 10397, "ordering": 1 } ], @@ -26362,32 +26782,30 @@ "parameters": [], "mediaType": "" }, - "description": ":::info[Discription]\nQuery for part orderbook depth data. (aggregated by price)\n\nYou are recommended to request via this endpoint as the system reponse would be faster and cosume less traffic.\n:::", - "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Futures\",\"api-channel\":\"Public\",\"api-permission\":\"NULL\",\"api-rate-limit-pool\":\"Public\",\"sdk-service\":\"Futures\",\"sdk-sub-service\":\"Market\",\"sdk-method-name\":\"getPartOrderBook\",\"sdk-method-description\":\"Query for part orderbook depth data. (aggregated by price) You are recommended to request via this endpoint as the system reponse would be faster and cosume less traffic.\",\"api-rate-limit\":5}" + "description": ":::info[Discription]\nGet current mark price\n:::", + "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Futures\",\"api-channel\":\"Public\",\"api-permission\":\"NULL\",\"api-rate-limit-pool\":\"Public\",\"sdk-service\":\"Futures\",\"sdk-sub-service\":\"Market\",\"sdk-method-name\":\"getMarkPrice\",\"sdk-method-description\":\"Get current mark price\",\"api-rate-limit\":3}" } }, { - "name": "Get Interest Rate Index", + "name": "Get Spot Index Price", "api": { - "id": "3470226", + "id": "3470231", "method": "get", - "path": "/api/v1/interest/query", + "path": "/api/v1/index/query", "parameters": { "query": [ { "id": "jVYCLbgfDY", "name": "symbol", "required": true, - "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: fundingBaseSymbol, fundingQuoteSymbol, fundingBaseSymbol1M, fundingQuoteSymbol1M](apidog://link/endpoint/3470220) ", + "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: indexSymbol](apidog://link/endpoint/3470220) ", "example": "", "type": "string", "schema": { "type": "string", "examples": [ - ".XBTINT8H", - ".USDTINT8H", - ".XBTINT", - ".USDTINT" + ".KXBTUSDT", + ".BXBT" ] }, "enable": true @@ -26397,7 +26815,6 @@ "name": "startAt", "required": false, "description": "Start time (milisecond)", - "example": "1728663338000", "type": "integer", "schema": { "type": "integer", @@ -26410,7 +26827,6 @@ "name": "endAt", "required": false, "description": "End time (milisecond)", - "example": "1728692138000", "type": "integer", "schema": { "type": "integer", @@ -26423,7 +26839,6 @@ "name": "reverse", "required": false, "description": "This parameter functions to judge whether the lookup is reverse. True means “yes”. False means no. This parameter is set as True by default.", - "example": "true", "type": "boolean", "schema": { "type": "boolean", @@ -26436,7 +26851,6 @@ "name": "offset", "required": false, "description": "Start offset. The unique attribute of the last returned result of the last request. The data of the first page will be returned by default.", - "example": "254062248624417", "type": "integer", "schema": { "type": "integer", @@ -26449,7 +26863,6 @@ "name": "forward", "required": false, "description": "This parameter functions to judge whether the lookup is forward or not. True means “yes” and False means “no”. This parameter is set as true by default", - "example": "true", "type": "boolean", "schema": { "type": "boolean", @@ -26462,7 +26875,6 @@ "name": "maxCount", "required": false, "description": "Max record count. The default record count is 10, The maximum length cannot exceed 100", - "example": "10", "type": "integer", "schema": { "type": "integer", @@ -26479,7 +26891,7 @@ }, "responses": [ { - "id": "10390", + "id": "10395", "code": 200, "name": "OK", "headers": [], @@ -26499,7 +26911,7 @@ "properties": { "symbol": { "type": "string", - "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: fundingBaseSymbol, fundingQuoteSymbol, fundingBaseSymbol1M, fundingQuoteSymbol1M](apidog://link/endpoint/3470220) " + "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: indexSymbol](apidog://link/endpoint/3470220) " }, "granularity": { "type": "integer", @@ -26507,19 +26919,46 @@ }, "timePoint": { "type": "integer", - "description": "Timestamp(milisecond)", + "description": "Timestamp (milisecond)", "format": "int64" }, "value": { "type": "number", - "description": "Interest rate value" + "description": "Index Value" + }, + "decomposionList": { + "type": "array", + "items": { + "type": "object", + "properties": { + "exchange": { + "type": "string", + "description": "Exchange" + }, + "price": { + "type": "number", + "description": "Price" + }, + "weight": { + "type": "number", + "description": "Weight" + } + }, + "required": [ + "exchange", + "price", + "weight" + ] + }, + "description": "Component List" } }, "required": [ "symbol", "granularity", "timePoint", - "value" + "value", + "decomposionList" ] } }, @@ -26547,8 +26986,8 @@ "responseExamples": [ { "name": "Success", - "data": "{\n \"code\": \"200000\",\n \"data\": {\n \"dataList\": [\n {\n \"symbol\": \".XBTINT\",\n \"granularity\": 60000,\n \"timePoint\": 1728692100000,\n \"value\": 3.0E-4\n },\n {\n \"symbol\": \".XBTINT\",\n \"granularity\": 60000,\n \"timePoint\": 1728692040000,\n \"value\": 3.0E-4\n }\n ],\n \"hasMore\": true\n }\n}", - "responseId": 10390, + "data": "{\n \"code\": \"200000\",\n \"data\": {\n \"hasMore\": true,\n \"dataList\": [\n {\n \"symbol\": \".KXBTUSDT\",\n \"granularity\": 1000,\n \"timePoint\": 1730557515000,\n \"value\": 69202.94,\n \"decomposionList\": [\n {\n \"exchange\": \"gateio\",\n \"price\": 69209.27,\n \"weight\": 0.0533\n },\n {\n \"exchange\": \"bitmart\",\n \"price\": 69230.77,\n \"weight\": 0.0128\n },\n {\n \"exchange\": \"okex\",\n \"price\": 69195.34,\n \"weight\": 0.11\n },\n {\n \"exchange\": \"bybit\",\n \"price\": 69190.33,\n \"weight\": 0.0676\n },\n {\n \"exchange\": \"binance\",\n \"price\": 69204.55,\n \"weight\": 0.6195\n },\n {\n \"exchange\": \"kucoin\",\n \"price\": 69202.91,\n \"weight\": 0.1368\n }\n ]\n },\n {\n \"symbol\": \".KXBTUSDT\",\n \"granularity\": 1000,\n \"timePoint\": 1730557514000,\n \"value\": 69204.98,\n \"decomposionList\": [\n {\n \"exchange\": \"gateio\",\n \"price\": 69212.71,\n \"weight\": 0.0808\n },\n {\n \"exchange\": \"bitmart\",\n \"price\": 69230.77,\n \"weight\": 0.0134\n },\n {\n \"exchange\": \"okex\",\n \"price\": 69195.49,\n \"weight\": 0.0536\n },\n {\n \"exchange\": \"bybit\",\n \"price\": 69195.97,\n \"weight\": 0.0921\n },\n {\n \"exchange\": \"binance\",\n \"price\": 69204.56,\n \"weight\": 0.5476\n },\n {\n \"exchange\": \"kucoin\",\n \"price\": 69207.8,\n \"weight\": 0.2125\n }\n ]\n }\n ]\n }\n}", + "responseId": 10395, "ordering": 1 } ], @@ -26557,30 +26996,32 @@ "parameters": [], "mediaType": "" }, - "description": ":::info[Discription]\nGet interest rate Index.\n:::", - "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Futures\",\"api-channel\":\"Public\",\"api-permission\":\"NULL\",\"api-rate-limit-pool\":\"Public\",\"sdk-service\":\"Futures\",\"sdk-sub-service\":\"Market\",\"sdk-method-name\":\"getInterestRateIndex\",\"sdk-method-description\":\"Get interest rate Index.\",\"api-rate-limit\":5}" + "description": ":::info[Discription]\nGet Spot Index price\n:::", + "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Futures\",\"api-channel\":\"Public\",\"api-permission\":\"NULL\",\"api-rate-limit-pool\":\"Public\",\"sdk-service\":\"Futures\",\"sdk-sub-service\":\"Market\",\"sdk-method-name\":\"getSpotIndexPrice\",\"sdk-method-description\":\"Get Spot Index Price\",\"api-rate-limit\":2}" } }, { - "name": "Get Premium Index", + "name": "Get Interest Rate Index", "api": { - "id": "3470227", + "id": "3470226", "method": "get", - "path": "/api/v1/premium/query", + "path": "/api/v1/interest/query", "parameters": { "query": [ { "id": "jVYCLbgfDY", "name": "symbol", "required": true, - "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: premiumsSymbol1M, premiumsSymbol8H](apidog://link/endpoint/3470220) ", + "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: fundingBaseSymbol, fundingQuoteSymbol, fundingBaseSymbol1M, fundingQuoteSymbol1M](apidog://link/endpoint/3470220) ", "example": "", "type": "string", "schema": { "type": "string", "examples": [ - ".XBTUSDTMPI", - ".XBTUSDTMPI8H" + ".XBTINT8H", + ".USDTINT8H", + ".XBTINT", + ".USDTINT" ] }, "enable": true @@ -26672,7 +27113,7 @@ }, "responses": [ { - "id": "10391", + "id": "10390", "code": 200, "name": "OK", "headers": [], @@ -26692,11 +27133,11 @@ "properties": { "symbol": { "type": "string", - "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: premiumsSymbol1M, premiumsSymbol8H](apidog://link/endpoint/3470220) " + "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: fundingBaseSymbol, fundingQuoteSymbol, fundingBaseSymbol1M, fundingQuoteSymbol1M](apidog://link/endpoint/3470220) " }, "granularity": { "type": "integer", - "description": "Granularity(milisecond)" + "description": "Granularity (milisecond)" }, "timePoint": { "type": "integer", @@ -26705,7 +27146,7 @@ }, "value": { "type": "number", - "description": "Premium index" + "description": "Interest rate value" } }, "required": [ @@ -26740,219 +27181,8 @@ "responseExamples": [ { "name": "Success", - "data": "{\n \"code\": \"200000\",\n \"data\": {\n \"hasMore\": true,\n \"dataList\": [\n {\n \"symbol\": \".XBTUSDTMPI\",\n \"granularity\": 60000,\n \"timePoint\": 1730558040000,\n \"value\": 0.00006\n },\n {\n \"symbol\": \".XBTUSDTMPI\",\n \"granularity\": 60000,\n \"timePoint\": 1730557980000,\n \"value\": -0.000025\n }\n ]\n }\n}", - "responseId": 10391, - "ordering": 1 - } - ], - "requestBody": { - "type": "none", - "parameters": [], - "mediaType": "" - }, - "description": ":::info[Discription]\nSubmit request to get premium index.\n:::", - "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Futures\",\"api-channel\":\"Public\",\"api-permission\":\"NULL\",\"api-rate-limit-pool\":\"Public\",\"sdk-service\":\"Futures\",\"sdk-sub-service\":\"Market\",\"sdk-method-name\":\"getPremiumIndex\",\"sdk-method-description\":\"Submit request to get premium index.\",\"api-rate-limit\":3}" - } - }, - { - "name": "Get 24hr Stats", - "api": { - "id": "3470228", - "method": "get", - "path": "/api/v1/trade-statistics", - "parameters": { - "path": [], - "query": [], - "cookie": [], - "header": [] - }, - "responses": [ - { - "id": "10392", - "code": 200, - "name": "OK", - "headers": [], - "jsonSchema": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "data": { - "type": "object", - "properties": { - "turnoverOf24h": { - "type": "number", - "description": "24-hour platform Futures trading volume. Unit is USD" - } - }, - "required": [ - "turnoverOf24h" - ] - } - }, - "required": [ - "code", - "data" - ] - }, - "description": "", - "contentType": "json", - "mediaType": "" - } - ], - "responseExamples": [ - { - "name": "Success", - "data": "{\"code\":\"200000\",\"data\":{\"turnoverOf24h\":1.1155733413273683E9}}", - "responseId": 10392, - "ordering": 1 - } - ], - "requestBody": { - "type": "none", - "parameters": [], - "mediaType": "" - }, - "description": ":::info[Discription]\nGet the statistics of the platform futures trading volume in the last 24 hours.\n:::", - "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Futures\",\"api-channel\":\"Public\",\"api-permission\":\"NULL\",\"api-rate-limit-pool\":\"Futures\",\"sdk-service\":\"Futures\",\"sdk-sub-service\":\"Market\",\"sdk-method-name\":\"get24hrStats\",\"sdk-method-description\":\"Get the statistics of the platform futures trading volume in the last 24 hours.\",\"api-rate-limit\":3}" - } - }, - { - "name": "Get Server Time", - "api": { - "id": "3470229", - "method": "get", - "path": "/api/v1/timestamp", - "parameters": { - "path": [], - "query": [], - "cookie": [], - "header": [] - }, - "responses": [ - { - "id": "10393", - "code": 200, - "name": "OK", - "headers": [], - "jsonSchema": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "data": { - "type": "integer", - "format": "int64", - "description": "ServerTime(millisecond)" - } - }, - "required": [ - "code", - "data" - ] - }, - "description": "", - "contentType": "json", - "mediaType": "" - } - ], - "responseExamples": [ - { - "name": "Success", - "data": "{\"code\":\"200000\",\"data\":1729260030774}", - "responseId": 10393, - "ordering": 1 - } - ], - "requestBody": { - "type": "none", - "parameters": [], - "mediaType": "" - }, - "description": ":::info[Discription]\nGet the API server time. This is the Unix timestamp.\n:::", - "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Futures\",\"api-channel\":\"Public\",\"api-permission\":\"NULL\",\"api-rate-limit-pool\":\"Public\",\"sdk-service\":\"Futures\",\"sdk-sub-service\":\"Market\",\"sdk-method-name\":\"getServerTime\",\"sdk-method-description\":\"Get the API server time. This is the Unix timestamp.\",\"api-rate-limit\":2}" - } - }, - { - "name": "Get Service Status", - "api": { - "id": "3470230", - "method": "get", - "path": "/api/v1/status", - "parameters": { - "query": [], - "path": [], - "cookie": [], - "header": [] - }, - "responses": [ - { - "id": "10394", - "code": 200, - "name": "OK", - "headers": [], - "jsonSchema": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "data": { - "type": "object", - "properties": { - "msg": { - "type": "string" - }, - "status": { - "type": "string", - "description": "Status of service: open:normal transaction, close:Stop Trading/Maintenance, cancelonly:can only cancel the order but not place order", - "enum": [ - "open", - "close", - "cancelonly" - ], - "x-api-enum": [ - { - "value": "open", - "name": "OPEN", - "description": "normal transaction" - }, - { - "value": "close", - "name": "CLOSE", - "description": "Stop Trading/Maintenance" - }, - { - "value": "cancelonly", - "name": "CANCELONLY", - "description": "can only cancel the order but not place order" - } - ] - } - }, - "required": [ - "msg", - "status" - ] - } - }, - "required": [ - "code", - "data" - ] - }, - "description": "", - "contentType": "json", - "mediaType": "" - } - ], - "responseExamples": [ - { - "name": "Success", - "data": "{\"code\":\"200000\",\"data\":{\"msg\":\"\",\"status\":\"open\"}}", - "responseId": 10394, + "data": "{\n \"code\": \"200000\",\n \"data\": {\n \"dataList\": [\n {\n \"symbol\": \".XBTINT\",\n \"granularity\": 60000,\n \"timePoint\": 1728692100000,\n \"value\": 3.0E-4\n },\n {\n \"symbol\": \".XBTINT\",\n \"granularity\": 60000,\n \"timePoint\": 1728692040000,\n \"value\": 3.0E-4\n }\n ],\n \"hasMore\": true\n }\n}", + "responseId": 10390, "ordering": 1 } ], @@ -26961,30 +27191,30 @@ "parameters": [], "mediaType": "" }, - "description": ":::info[Discription]\nGet the service status.\n:::", - "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Futures\",\"api-channel\":\"Public\",\"api-permission\":\"NULL\",\"api-rate-limit-pool\":\"Public\",\"sdk-service\":\"Futures\",\"sdk-sub-service\":\"Market\",\"sdk-method-name\":\"getServiceStatus\",\"sdk-method-description\":\"Get the service status.\",\"api-rate-limit\":4}" + "description": ":::info[Discription]\nGet interest rate Index.\n:::", + "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Futures\",\"api-channel\":\"Public\",\"api-permission\":\"NULL\",\"api-rate-limit-pool\":\"Public\",\"sdk-service\":\"Futures\",\"sdk-sub-service\":\"Market\",\"sdk-method-name\":\"getInterestRateIndex\",\"sdk-method-description\":\"Get interest rate Index.\",\"api-rate-limit\":5}" } }, { - "name": "Get Spot Index Price", + "name": "Get Premium Index", "api": { - "id": "3470231", + "id": "3470227", "method": "get", - "path": "/api/v1/index/query", + "path": "/api/v1/premium/query", "parameters": { "query": [ { "id": "jVYCLbgfDY", "name": "symbol", "required": true, - "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: indexSymbol](apidog://link/endpoint/3470220) ", + "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: premiumsSymbol1M, premiumsSymbol8H](apidog://link/endpoint/3470220) ", "example": "", "type": "string", "schema": { "type": "string", "examples": [ - ".KXBTUSDT", - ".BXBT" + ".XBTUSDTMPI", + ".XBTUSDTMPI8H" ] }, "enable": true @@ -26994,6 +27224,7 @@ "name": "startAt", "required": false, "description": "Start time (milisecond)", + "example": "1728663338000", "type": "integer", "schema": { "type": "integer", @@ -27006,6 +27237,7 @@ "name": "endAt", "required": false, "description": "End time (milisecond)", + "example": "1728692138000", "type": "integer", "schema": { "type": "integer", @@ -27018,6 +27250,7 @@ "name": "reverse", "required": false, "description": "This parameter functions to judge whether the lookup is reverse. True means “yes”. False means no. This parameter is set as True by default.", + "example": "true", "type": "boolean", "schema": { "type": "boolean", @@ -27030,6 +27263,7 @@ "name": "offset", "required": false, "description": "Start offset. The unique attribute of the last returned result of the last request. The data of the first page will be returned by default.", + "example": "254062248624417", "type": "integer", "schema": { "type": "integer", @@ -27042,6 +27276,7 @@ "name": "forward", "required": false, "description": "This parameter functions to judge whether the lookup is forward or not. True means “yes” and False means “no”. This parameter is set as true by default", + "example": "true", "type": "boolean", "schema": { "type": "boolean", @@ -27054,6 +27289,7 @@ "name": "maxCount", "required": false, "description": "Max record count. The default record count is 10, The maximum length cannot exceed 100", + "example": "10", "type": "integer", "schema": { "type": "integer", @@ -27070,7 +27306,7 @@ }, "responses": [ { - "id": "10395", + "id": "10391", "code": 200, "name": "OK", "headers": [], @@ -27090,201 +27326,39 @@ "properties": { "symbol": { "type": "string", - "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: indexSymbol](apidog://link/endpoint/3470220) " + "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: premiumsSymbol1M, premiumsSymbol8H](apidog://link/endpoint/3470220) " }, "granularity": { "type": "integer", - "description": "Granularity (milisecond)" + "description": "Granularity(milisecond)" }, "timePoint": { "type": "integer", - "description": "Timestamp (milisecond)", - "format": "int64" - }, - "value": { - "type": "number", - "description": "Index Value" - }, - "decomposionList": { - "type": "array", - "items": { - "type": "object", - "properties": { - "exchange": { - "type": "string", - "description": "Exchange" - }, - "price": { - "type": "number", - "description": "Price" - }, - "weight": { - "type": "number", - "description": "Weight" - } - }, - "required": [ - "exchange", - "price", - "weight" - ] - }, - "description": "Component List" - } - }, - "required": [ - "symbol", - "granularity", - "timePoint", - "value", - "decomposionList" - ] - } - }, - "hasMore": { - "type": "boolean", - "description": "Whether there are more pages" - } - }, - "required": [ - "dataList", - "hasMore" - ] - } - }, - "required": [ - "code", - "data" - ] - }, - "description": "", - "contentType": "json", - "mediaType": "" - } - ], - "responseExamples": [ - { - "name": "Success", - "data": "{\n \"code\": \"200000\",\n \"data\": {\n \"hasMore\": true,\n \"dataList\": [\n {\n \"symbol\": \".KXBTUSDT\",\n \"granularity\": 1000,\n \"timePoint\": 1730557515000,\n \"value\": 69202.94,\n \"decomposionList\": [\n {\n \"exchange\": \"gateio\",\n \"price\": 69209.27,\n \"weight\": 0.0533\n },\n {\n \"exchange\": \"bitmart\",\n \"price\": 69230.77,\n \"weight\": 0.0128\n },\n {\n \"exchange\": \"okex\",\n \"price\": 69195.34,\n \"weight\": 0.11\n },\n {\n \"exchange\": \"bybit\",\n \"price\": 69190.33,\n \"weight\": 0.0676\n },\n {\n \"exchange\": \"binance\",\n \"price\": 69204.55,\n \"weight\": 0.6195\n },\n {\n \"exchange\": \"kucoin\",\n \"price\": 69202.91,\n \"weight\": 0.1368\n }\n ]\n },\n {\n \"symbol\": \".KXBTUSDT\",\n \"granularity\": 1000,\n \"timePoint\": 1730557514000,\n \"value\": 69204.98,\n \"decomposionList\": [\n {\n \"exchange\": \"gateio\",\n \"price\": 69212.71,\n \"weight\": 0.0808\n },\n {\n \"exchange\": \"bitmart\",\n \"price\": 69230.77,\n \"weight\": 0.0134\n },\n {\n \"exchange\": \"okex\",\n \"price\": 69195.49,\n \"weight\": 0.0536\n },\n {\n \"exchange\": \"bybit\",\n \"price\": 69195.97,\n \"weight\": 0.0921\n },\n {\n \"exchange\": \"binance\",\n \"price\": 69204.56,\n \"weight\": 0.5476\n },\n {\n \"exchange\": \"kucoin\",\n \"price\": 69207.8,\n \"weight\": 0.2125\n }\n ]\n }\n ]\n }\n}", - "responseId": 10395, - "ordering": 1 - } - ], - "requestBody": { - "type": "none", - "parameters": [], - "mediaType": "" - }, - "description": ":::info[Discription]\nGet Spot Index price\n:::", - "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Futures\",\"api-channel\":\"Public\",\"api-permission\":\"NULL\",\"api-rate-limit-pool\":\"Public\",\"sdk-service\":\"Futures\",\"sdk-sub-service\":\"Market\",\"sdk-method-name\":\"getSpotIndexPrice\",\"sdk-method-description\":\"Get Spot Index Price\",\"api-rate-limit\":2}" - } - }, - { - "name": "Get Trade History", - "api": { - "id": "3470232", - "method": "get", - "path": "/api/v1/trade/history", - "parameters": { - "query": [ - { - "id": "jVYCLbgfDY", - "name": "symbol", - "required": true, - "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](apidog://link/endpoint/3470220) ", - "example": "XBTUSDM", - "type": "string", - "enable": true - } - ], - "path": [], - "cookie": [], - "header": [] - }, - "responses": [ - { - "id": "10396", - "code": 200, - "name": "OK", - "headers": [], - "jsonSchema": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "data": { - "type": "array", - "items": { - "type": "object", - "properties": { - "sequence": { - "type": "integer", - "description": "Sequence number", - "format": "int64" - }, - "contractId": { - "type": "integer", - "description": "Deprecated param" - }, - "tradeId": { - "type": "string", - "description": "Transaction ID" - }, - "makerOrderId": { - "type": "string", - "description": "Maker order ID" - }, - "takerOrderId": { - "type": "string", - "description": "Taker order ID" - }, - "ts": { - "type": "integer", - "description": "Filled timestamp(nanosecond)", - "format": "int64" - }, - "size": { - "type": "integer", - "description": "Filled amount" - }, - "price": { - "type": "string", - "description": "Filled price" - }, - "side": { - "type": "string", - "description": "Filled side, The trade side indicates the taker order side. A taker order is the order that was matched with orders opened on the order book.", - "enum": [ - "buy", - "sell" - ], - "x-api-enum": [ - { - "value": "buy", - "name": "buy", - "description": "buy" + "description": "Timestamp(milisecond)", + "format": "int64" }, - { - "value": "sell", - "name": "sell", - "description": "sell" + "value": { + "type": "number", + "description": "Premium index" } + }, + "required": [ + "symbol", + "granularity", + "timePoint", + "value" ] } }, - "required": [ - "sequence", - "contractId", - "tradeId", - "makerOrderId", - "takerOrderId", - "ts", - "size", - "price", - "side" - ] - } + "hasMore": { + "type": "boolean", + "description": "Whether there are more pages" + } + }, + "required": [ + "dataList", + "hasMore" + ] } }, "required": [ @@ -27300,8 +27374,8 @@ "responseExamples": [ { "name": "Success", - "data": "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"sequence\": 1697915257909,\n \"contractId\": 1,\n \"tradeId\": \"1697915257909\",\n \"makerOrderId\": \"236679665752801280\",\n \"takerOrderId\": \"236679667975745536\",\n \"ts\": 1729242032152000000,\n \"size\": 1,\n \"price\": \"67878\",\n \"side\": \"sell\"\n },\n {\n \"sequence\": 1697915257749,\n \"contractId\": 1,\n \"tradeId\": \"1697915257749\",\n \"makerOrderId\": \"236679660971245570\",\n \"takerOrderId\": \"236679665400492032\",\n \"ts\": 1729242031535000000,\n \"size\": 1,\n \"price\": \"67867.8\",\n \"side\": \"sell\"\n },\n {\n \"sequence\": 1697915257701,\n \"contractId\": 1,\n \"tradeId\": \"1697915257701\",\n \"makerOrderId\": \"236679660971245570\",\n \"takerOrderId\": \"236679661919211521\",\n \"ts\": 1729242030932000000,\n \"size\": 1,\n \"price\": \"67867.8\",\n \"side\": \"sell\"\n }\n ]\n}", - "responseId": 10396, + "data": "{\n \"code\": \"200000\",\n \"data\": {\n \"hasMore\": true,\n \"dataList\": [\n {\n \"symbol\": \".XBTUSDTMPI\",\n \"granularity\": 60000,\n \"timePoint\": 1730558040000,\n \"value\": 0.00006\n },\n {\n \"symbol\": \".XBTUSDTMPI\",\n \"granularity\": 60000,\n \"timePoint\": 1730557980000,\n \"value\": -0.000025\n }\n ]\n }\n}", + "responseId": 10391, "ordering": 1 } ], @@ -27310,35 +27384,25 @@ "parameters": [], "mediaType": "" }, - "description": ":::info[Discription]\nRequest via this endpoint to get the trade history of the specified symbol, the returned quantity is the last 100 transaction records.\n:::", - "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Futures\",\"api-channel\":\"Public\",\"api-permission\":\"NULL\",\"api-rate-limit-pool\":\"Public\",\"sdk-service\":\"Futures\",\"sdk-sub-service\":\"Market\",\"sdk-method-name\":\"getTradeHistory\",\"sdk-method-description\":\"Request via this endpoint to get the trade history of the specified symbol, the returned quantity is the last 100 transaction records.\",\"api-rate-limit\":5}" + "description": ":::info[Discription]\nSubmit request to get premium index.\n:::", + "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Futures\",\"api-channel\":\"Public\",\"api-permission\":\"NULL\",\"api-rate-limit-pool\":\"Public\",\"sdk-service\":\"Futures\",\"sdk-sub-service\":\"Market\",\"sdk-method-name\":\"getPremiumIndex\",\"sdk-method-description\":\"Submit request to get premium index.\",\"api-rate-limit\":3}" } }, { - "name": "Get Mark Price", + "name": "Get 24hr Stats", "api": { - "id": "3470233", + "id": "3470228", "method": "get", - "path": "/api/v1/mark-price/{symbol}/current", + "path": "/api/v1/trade-statistics", "parameters": { + "path": [], "query": [], - "path": [ - { - "id": "symbol#0", - "name": "symbol", - "required": true, - "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](apidog://link/endpoint/3470220) ", - "example": "XBTUSDTM", - "type": "string", - "enable": true - } - ], "cookie": [], "header": [] }, "responses": [ { - "id": "10397", + "id": "10392", "code": 200, "name": "OK", "headers": [], @@ -27351,34 +27415,13 @@ "data": { "type": "object", "properties": { - "symbol": { - "type": "string", - "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](apidog://link/endpoint/3470220) " - }, - "granularity": { - "type": "integer", - "description": "Granularity (milisecond)" - }, - "timePoint": { - "type": "integer", - "description": "Time point (milisecond)", - "format": "int64" - }, - "value": { - "type": "number", - "description": "Mark price" - }, - "indexPrice": { + "turnoverOf24h": { "type": "number", - "description": "Index price" + "description": "24-hour platform Futures trading volume. Unit is USD" } }, "required": [ - "symbol", - "granularity", - "timePoint", - "value", - "indexPrice" + "turnoverOf24h" ] } }, @@ -27395,8 +27438,8 @@ "responseExamples": [ { "name": "Success", - "data": "{\"code\":\"200000\",\"data\":{\"symbol\":\"XBTUSDTM\",\"granularity\":1000,\"timePoint\":1729254307000,\"value\":67687.08,\"indexPrice\":67683.58}}", - "responseId": 10397, + "data": "{\"code\":\"200000\",\"data\":{\"turnoverOf24h\":1.1155733413273683E9}}", + "responseId": 10392, "ordering": 1 } ], @@ -27405,153 +27448,82 @@ "parameters": [], "mediaType": "" }, - "description": ":::info[Discription]\nGet current mark price\n:::", - "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Futures\",\"api-channel\":\"Public\",\"api-permission\":\"NULL\",\"api-rate-limit-pool\":\"Public\",\"sdk-service\":\"Futures\",\"sdk-sub-service\":\"Market\",\"sdk-method-name\":\"getMarkPrice\",\"sdk-method-description\":\"Get current mark price\",\"api-rate-limit\":3}" + "description": ":::info[Discription]\nGet the statistics of the platform futures trading volume in the last 24 hours.\n:::", + "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Futures\",\"api-channel\":\"Public\",\"api-permission\":\"NULL\",\"api-rate-limit-pool\":\"Futures\",\"sdk-service\":\"Futures\",\"sdk-sub-service\":\"Market\",\"sdk-method-name\":\"get24hrStats\",\"sdk-method-description\":\"Get the statistics of the platform futures trading volume in the last 24 hours.\",\"api-rate-limit\":3}" } }, { - "name": "Get Klines", + "name": "Get Server Time", "api": { - "id": "3470234", + "id": "3470229", "method": "get", - "path": "/api/v1/kline/query", + "path": "/api/v1/timestamp", "parameters": { - "query": [ - { - "id": "jVYCLbgfDY", - "name": "symbol", - "required": true, - "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol, indexSymbol, premiumsSymbol1M, premiumsSymbol8H](apidog://link/endpoint/3470220) ", - "example": "", - "type": "string", - "schema": { - "type": "string", - "examples": [ - "XBTUSDTM", - ".KXBTUSDT", - ".XBTUSDTMPI", - ".XBTUSDTMPI8H" - ] - }, - "enable": true - }, - { - "id": "jgqzFrzKqc", - "name": "granularity", - "required": true, - "description": "Type of candlestick patterns(minute)", - "example": "", - "type": "integer", - "schema": { - "type": "integer", - "enum": [ - 1, - 5, - 15, - 30, - 60, - 120, - 240, - 480, - 720, - 1440, - 10080 - ], - "format": "int64", - "x-api-enum": [ - { - "value": 1, - "name": "1", - "description": "1min" - }, - { - "value": 5, - "name": "5", - "description": "5min" - }, - { - "value": 15, - "name": "15", - "description": "15min" - }, - { - "value": 30, - "name": "30", - "description": "30min" - }, - { - "value": 60, - "name": "60", - "description": "1hour" - }, - { - "value": 120, - "name": "120", - "description": "2hour" - }, - { - "value": 240, - "name": "240", - "description": "4hour" - }, - { - "value": 480, - "name": "480", - "description": "8hour" - }, - { - "value": 720, - "name": "720", - "description": "12hour" - }, - { - "value": 1440, - "name": "1440", - "description": "1day" - }, - { - "value": 10080, - "name": "10080", - "description": "1week" - } - ] - }, - "enable": true - }, - { - "id": "DyCMyfR0e9", - "name": "from", - "required": false, - "description": "Start time (milisecond)", - "example": "1728552342000", - "type": "integer", - "schema": { - "type": "integer", - "format": "int64" + "path": [], + "query": [], + "cookie": [], + "header": [] + }, + "responses": [ + { + "id": "10393", + "code": 200, + "name": "OK", + "headers": [], + "jsonSchema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "integer", + "format": "int64", + "description": "ServerTime(millisecond)" + } }, - "enable": true + "required": [ + "code", + "data" + ] }, - { - "id": "Z1XMrUW1vQ", - "name": "to", - "required": false, - "description": "End time (milisecond)", - "example": "1729243542000", - "type": "integer", - "schema": { - "type": "integer", - "format": "int64" - }, - "enable": true - } - ], + "description": "", + "contentType": "json", + "mediaType": "" + } + ], + "responseExamples": [ + { + "name": "Success", + "data": "{\"code\":\"200000\",\"data\":1729260030774}", + "responseId": 10393, + "ordering": 1 + } + ], + "requestBody": { + "type": "none", + "parameters": [], + "mediaType": "" + }, + "description": ":::info[Discription]\nGet the API server time. This is the Unix timestamp.\n:::", + "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Futures\",\"api-channel\":\"Public\",\"api-permission\":\"NULL\",\"api-rate-limit-pool\":\"Public\",\"sdk-service\":\"Futures\",\"sdk-sub-service\":\"Market\",\"sdk-method-name\":\"getServerTime\",\"sdk-method-description\":\"Get the API server time. This is the Unix timestamp.\",\"api-rate-limit\":2}" + } + }, + { + "name": "Get Service Status", + "api": { + "id": "3470230", + "method": "get", + "path": "/api/v1/status", + "parameters": { + "query": [], "path": [], "cookie": [], "header": [] }, "responses": [ { - "id": "10398", + "id": "10394", "code": 200, "name": "OK", "headers": [], @@ -27562,14 +27534,42 @@ "type": "string" }, "data": { - "type": "array", - "items": { - "type": "array", - "items": { - "type": "number", - "description": "Start time of the candle cycle, opening price, highest price, Lowest price, closing price, Transaction volume" + "type": "object", + "properties": { + "msg": { + "type": "string" + }, + "status": { + "type": "string", + "description": "Status of service: open:normal transaction, close:Stop Trading/Maintenance, cancelonly:can only cancel the order but not place order", + "enum": [ + "open", + "close", + "cancelonly" + ], + "x-api-enum": [ + { + "value": "open", + "name": "OPEN", + "description": "normal transaction" + }, + { + "value": "close", + "name": "CLOSE", + "description": "Stop Trading/Maintenance" + }, + { + "value": "cancelonly", + "name": "CANCELONLY", + "description": "can only cancel the order but not place order" + } + ] } - } + }, + "required": [ + "msg", + "status" + ] } }, "required": [ @@ -27585,8 +27585,8 @@ "responseExamples": [ { "name": "Success", - "data": "{\n \"code\": \"200000\",\n \"data\": [\n [\n 1728576000000,\n 60791.1,\n 61035,\n 58940,\n 60300,\n 5501167\n ],\n [\n 1728604800000,\n 60299.9,\n 60924.1,\n 60077.4,\n 60666.1,\n 1220980\n ],\n [\n 1728633600000,\n 60665.7,\n 62436.8,\n 60650.1,\n 62255.1,\n 3386359\n ]\n ]\n}", - "responseId": 10398, + "data": "{\"code\":\"200000\",\"data\":{\"msg\":\"\",\"status\":\"open\"}}", + "responseId": 10394, "ordering": 1 } ], @@ -27595,8 +27595,8 @@ "parameters": [], "mediaType": "" }, - "description": ":::info[Description]\nGet the Kline of the symbol. Data are returned in grouped buckets based on requested type.\nFor each query, the system would return at most 500 pieces of data. To obtain more data, please page the data by time.\n:::\n\n:::tip[Tips]\nKlines data may be incomplete. No data is published for intervals where there are no ticks.\n\nIf the specified start/end time and the time granularity exceeds the maximum size allowed for a single request, the system will only return 500 pieces of data for your request. If you want to get fine-grained data in a larger time range, you will need to specify the time ranges and make multiple requests for multiple times.\n\nIf you’ve specified only the start time in your request, the system will return 500 pieces of data from the specified start time to the current time of the system; If only the end time is specified, the system will return 500 pieces of data closest to the end time; If neither the start time nor the end time is specified, the system will return the 500 pieces of data closest to the current time of the system.\n:::", - "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Futures\",\"api-channel\":\"Public\",\"api-permission\":\"NULL\",\"api-rate-limit-pool\":\"Public\",\"sdk-service\":\"Futures\",\"sdk-sub-service\":\"Market\",\"sdk-method-name\":\"getKlines\",\"sdk-method-description\":\"Get the Kline of the symbol. Data are returned in grouped buckets based on requested type. For each query, the system would return at most 500 pieces of data. To obtain more data, please page the data by time.\",\"api-rate-limit\":3}" + "description": ":::info[Discription]\nGet the service status.\n:::", + "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Futures\",\"api-channel\":\"Public\",\"api-permission\":\"NULL\",\"api-rate-limit-pool\":\"Public\",\"sdk-service\":\"Futures\",\"sdk-sub-service\":\"Market\",\"sdk-method-name\":\"getServiceStatus\",\"sdk-method-description\":\"Get the service status.\",\"api-rate-limit\":4}" } } ] @@ -27869,548 +27869,390 @@ }, "timeInForce": { "type": "string", - "description": "Optional for type is 'limit' order, [Time in force](apidog://link/pages/338146) is a special strategy used during trading, default is GTC", + "description": "Optional for type is 'limit' order, [Time in force](apidog://link/pages/338146) is a special strategy used during trading, default is GTC", + "enum": [ + "GTC", + "IOC" + ], + "default": "GTC", + "x-api-enum": [ + { + "value": "GTC", + "name": "Good Till Canceled", + "description": "order remains open on the order book until canceled. This is the default type if the field is left empty." + }, + { + "value": "IOC", + "name": "Immediate Or Cancel", + "description": "being matched or not, the remaining size of the order will be instantly canceled instead of entering the order book." + } + ] + }, + "postOnly": { + "type": "boolean", + "description": "Optional for type is 'limit' order, post only flag, invalid when timeInForce is IOC. When postOnly is true, not allowed choose hidden or iceberg. The post-only flag ensures that the trader always pays the maker fee and provides liquidity to the order book. If any part of the order is going to pay taker fee, the order will be fully rejected.", + "default": false + }, + "hidden": { + "type": "boolean", + "description": "Optional for type is 'limit' order, orders not displaying in order book. When hidden chose, not allowed choose postOnly.", + "default": false + }, + "iceberg": { + "type": "boolean", + "description": "Optional for type is 'limit' order, Only visible portion of the order is displayed in the order book. When iceberg chose, not allowed choose postOnly.", + "default": false + }, + "visibleSize": { + "type": "string", + "description": "Optional for type is 'limit' order, The maximum visible size of an iceberg order. please place order in size (lots), The units of qty (base currency) and valueQty (value) are not supported." + }, + "qty": { + "type": "string", + "description": "**Choose one of size, qty, valueQty**, Order size (Base currency) must be an integer multiple of the multiplier. The unit of the quantity of coin-swap is size(lot), which is not supported" + }, + "valueQty": { + "type": "string", + "description": "**Choose one of size, qty, valueQty**, Order size (Value), USDS-Swap correspond to USDT or USDC. The unit of the quantity of coin-swap is size(lot), which is not supported" + } + }, + "required": [ + "clientOid", + "symbol", + "side", + "leverage" + ] + }, + "example": "{\n \"clientOid\": \"5c52e11203aa677f33e493fb\",\n \"side\": \"buy\",\n \"symbol\": \"XBTUSDTM\",\n \"leverage\": 3,\n \"type\": \"limit\",\n \"remark\": \"order remarks\",\n \"reduceOnly\": false,\n \"marginMode\": \"ISOLATED\",\n \"price\": \"0.1\",\n \"size\": 1,\n \"timeInForce\": \"GTC\"\n}", + "mediaType": "" + }, + "description": ":::info[Description]\nPlace order to the futures trading system, you can place two major types of orders: limit and market. Orders can only be placed if your account has sufficient funds. Once an order is placed, your funds will be put on hold for the duration of the order. The amount of funds on hold depends on the order type and parameters specified.\n:::\n\n:::tip[Tips]\nThe maximum limit orders for a single contract is 100 per account, and the maximum stop orders for a single contract is 200 per account.\n:::", + "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Futures\",\"api-channel\":\"Private\",\"api-permission\":\"Futures\",\"api-rate-limit-pool\":\"Futures\",\"sdk-service\":\"Futures\",\"sdk-sub-service\":\"Order\",\"sdk-method-name\":\"addOrder\",\"sdk-method-description\":\"Place order to the futures trading system, you can place two major types of orders: limit and market. Orders can only be placed if your account has sufficient funds. Once an order is placed, your funds will be put on hold for the duration of the order. The amount of funds on hold depends on the order type and parameters specified.\",\"api-rate-limit\":2}" + } + }, + { + "name": "Add Order Test", + "api": { + "id": "3470238", + "method": "post", + "path": "/api/v1/orders/test", + "parameters": { + "query": [], + "path": [], + "cookie": [], + "header": [] + }, + "responses": [ + { + "id": "10402", + "code": 200, + "name": "成功", + "headers": [], + "jsonSchema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "object", + "properties": { + "orderId": { + "type": "string", + "description": "The unique order id generated by the trading system,which can be used later for further actions such as canceling the order." + }, + "clientOid": { + "type": "string", + "description": "The user self-defined order id." + } + }, + "required": [ + "orderId", + "clientOid" + ] + } + }, + "required": [ + "code", + "data" + ] + }, + "description": "", + "contentType": "json", + "mediaType": "" + } + ], + "responseExamples": [ + { + "name": "Success", + "data": "{\n \"code\": \"200000\",\n \"data\": {\n \"orderId\": \"234125150956625920\",\n \"clientOid\": \"5c52e11203aa677f33e493fb\"\n }\n}", + "responseId": 10402, + "ordering": 1 + } + ], + "requestBody": { + "type": "application/json", + "parameters": [], + "jsonSchema": { + "type": "object", + "properties": { + "clientOid": { + "type": "string", + "description": "Unique order id created by users to identify their orders, the maximum length cannot exceed 40, e.g. UUID, Only allows numbers, characters, underline(_), and separator(-)", + "examples": [ + "5c52e11203aa677f33e493fb" + ] + }, + "side": { + "type": "string", + "description": "specify if the order is to 'buy' or 'sell'", + "enum": [ + "buy", + "sell" + ], + "examples": [ + "buy" + ], + "x-api-enum": [ + { + "value": "buy", + "name": "", + "description": "" + }, + { + "value": "sell", + "name": "", + "description": "" + } + ] + }, + "symbol": { + "type": "string", + "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](apidog://link/endpoint/3470220) ", + "examples": [ + "XBTUSDTM" + ] + }, + "leverage": { + "type": "integer", + "description": "Used to calculate the margin to be frozen for the order. If you are to close the position, this parameter is not required.", + "examples": [ + 3 + ] + }, + "type": { + "type": "string", + "description": "specify if the order is an 'limit' order or 'market' order", "enum": [ - "GTC", - "IOC" + "limit", + "market" ], - "default": "GTC", + "examples": [ + "limit" + ], + "default": "limit", "x-api-enum": [ { - "value": "GTC", - "name": "Good Till Canceled", - "description": "order remains open on the order book until canceled. This is the default type if the field is left empty." + "value": "limit", + "name": "", + "description": "" }, { - "value": "IOC", - "name": "Immediate Or Cancel", - "description": "being matched or not, the remaining size of the order will be instantly canceled instead of entering the order book." + "value": "market", + "name": "", + "description": "" } ] }, - "postOnly": { - "type": "boolean", - "description": "Optional for type is 'limit' order, post only flag, invalid when timeInForce is IOC. When postOnly is true, not allowed choose hidden or iceberg. The post-only flag ensures that the trader always pays the maker fee and provides liquidity to the order book. If any part of the order is going to pay taker fee, the order will be fully rejected.", - "default": false - }, - "hidden": { - "type": "boolean", - "description": "Optional for type is 'limit' order, orders not displaying in order book. When hidden chose, not allowed choose postOnly.", - "default": false - }, - "iceberg": { - "type": "boolean", - "description": "Optional for type is 'limit' order, Only visible portion of the order is displayed in the order book. When iceberg chose, not allowed choose postOnly.", - "default": false - }, - "visibleSize": { - "type": "string", - "description": "Optional for type is 'limit' order, The maximum visible size of an iceberg order. please place order in size (lots), The units of qty (base currency) and valueQty (value) are not supported." - }, - "qty": { + "remark": { "type": "string", - "description": "**Choose one of size, qty, valueQty**, Order size (Base currency) must be an integer multiple of the multiplier. The unit of the quantity of coin-swap is size(lot), which is not supported" + "description": "remark for the order, length cannot exceed 100 utf8 characters" }, - "valueQty": { - "type": "string", - "description": "**Choose one of size, qty, valueQty**, Order size (Value), USDS-Swap correspond to USDT or USDC. The unit of the quantity of coin-swap is size(lot), which is not supported" - } - }, - "required": [ - "clientOid", - "symbol", - "side", - "leverage" - ] - }, - "example": "{\n \"clientOid\": \"5c52e11203aa677f33e493fb\",\n \"side\": \"buy\",\n \"symbol\": \"XBTUSDTM\",\n \"leverage\": 3,\n \"type\": \"limit\",\n \"remark\": \"order remarks\",\n \"reduceOnly\": false,\n \"marginMode\": \"ISOLATED\",\n \"price\": \"0.1\",\n \"size\": 1,\n \"timeInForce\": \"GTC\"\n}", - "mediaType": "" - }, - "description": ":::info[Description]\nPlace order to the futures trading system, you can place two major types of orders: limit and market. Orders can only be placed if your account has sufficient funds. Once an order is placed, your funds will be put on hold for the duration of the order. The amount of funds on hold depends on the order type and parameters specified.\n:::\n\n:::tip[Tips]\nThe maximum limit orders for a single contract is 100 per account, and the maximum stop orders for a single contract is 200 per account.\n:::", - "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Futures\",\"api-channel\":\"Private\",\"api-permission\":\"Futures\",\"api-rate-limit-pool\":\"Futures\",\"sdk-service\":\"Futures\",\"sdk-sub-service\":\"Order\",\"sdk-method-name\":\"addOrder\",\"sdk-method-description\":\"Place order to the futures trading system, you can place two major types of orders: limit and market. Orders can only be placed if your account has sufficient funds. Once an order is placed, your funds will be put on hold for the duration of the order. The amount of funds on hold depends on the order type and parameters specified.\",\"api-rate-limit\":2}" - } - }, - { - "name": "Get Trade History", - "api": { - "id": "3470248", - "method": "get", - "path": "/api/v1/fills", - "parameters": { - "query": [ - { - "id": "2KbksGFfyd", - "name": "orderId", - "required": false, - "description": "List fills for a specific order only (If you specify orderId, other parameters can be ignored)", - "example": "236655147005071361", - "type": "string", - "enable": true - }, - { - "id": "4wXlXiQszi", - "name": "symbol", - "required": false, - "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](apidog://link/endpoint/3470220) ", - "type": "string", - "enable": true - }, - { - "id": "uaSHeFQTjq", - "name": "side", - "required": false, - "description": "Order side", - "type": "string", - "enable": true, - "schema": { + "stop": { "type": "string", + "description": "Either 'down' or 'up'. If stop is used,parameter stopPrice and stopPriceType also need to be provieded.", "enum": [ - "buy", - "sell" + "down", + "up" ], "x-api-enum": [ { - "value": "buy", - "name": "buy", - "description": "buy" + "value": "down", + "name": "down", + "description": "Triggers when the price reaches or goes below the stopPrice." }, { - "value": "sell", - "name": "sell", - "description": "sell" + "value": "up", + "name": "up", + "description": "Triggers when the price reaches or goes above the stopPrice" } ] - } - }, - { - "id": "WUcubn1a2F", - "name": "type", - "required": false, - "description": "Order Type", - "type": "string", - "enable": true, - "schema": { + }, + "stopPriceType": { "type": "string", + "description": "Either 'TP', 'IP' or 'MP', Need to be defined if stop is specified.", "enum": [ - "limit", - "market", - "limit_stop", - "market_stop" + "TP", + "MP", + "IP" ], "x-api-enum": [ { - "value": "limit", - "name": "limit", - "description": "Limit order" - }, - { - "value": "market", - "name": "market", - "description": "Market order" + "value": "TP", + "name": "trade price", + "description": "TP for trade price, The last trade price is the last price at which an order was filled. This price can be found in the latest match message." }, { - "value": "limit_stop", - "name": "limit_stop", - "description": "Stop limit order" + "value": "MP", + "name": "mark price", + "description": "MP for mark price, The mark price can be obtained through relevant OPEN API for index services" }, { - "value": "market_stop", - "name": "market_stop", - "description": "Stop Market order" + "value": "IP", + "name": "index price", + "description": "IP for index price, The index price can be obtained through relevant OPEN API for index services" } - ] - } - }, - { - "required": false, - "description": "Transaction type: trade, adl, liquid, settlement. Supports querying multiple types at the same time, separated by commas. Query all type when empty", - "type": "string", - "id": "n3uTl3OSFi", - "enable": true, - "name": "tradeTypes", - "schema": { - "type": "string", - "examples": [ - "trade", - "adl", - "liquid", - "settlement", - "adl,liquid" - ] - } - }, - { - "id": "92p8ibIf57", - "name": "startAt", - "required": false, - "description": "Start time (milisecond)", - "type": "integer", - "schema": { - "type": "integer", - "format": "int64" - }, - "enable": true - }, - { - "id": "xa3hJqPSIi", - "name": "endAt", - "required": false, - "description": "End time (milisecond)", - "type": "integer", - "schema": { - "type": "integer", - "format": "int64" - }, - "enable": true - }, - { - "id": "1CHlZrEtu0", - "name": "currentPage", - "required": false, - "description": "Current request page, The default currentPage is 1", - "type": "integer", - "schema": { - "type": "integer", - "default": 1 - }, - "enable": true - }, - { - "id": "nlqXQHDnh5", - "name": "pageSize", - "required": false, - "description": "pageSize, The default pageSize is 50, The maximum cannot exceed 1000", - "type": "integer", - "schema": { - "type": "integer", - "default": 50, - "maximum": 1000 - }, - "enable": true - } - ], - "path": [], - "cookie": [], - "header": [] - }, - "responses": [ - { - "id": "10412", - "code": 200, - "name": "成功", - "headers": [], - "jsonSchema": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "data": { - "type": "object", - "properties": { - "currentPage": { - "type": "integer" - }, - "pageSize": { - "type": "integer" - }, - "totalNum": { - "type": "integer" - }, - "totalPage": { - "type": "integer" - }, - "items": { - "type": "array", - "items": { - "type": "object", - "properties": { - "symbol": { - "type": "string", - "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](apidog://link/endpoint/3470220) " - }, - "tradeId": { - "type": "string", - "description": "Trade ID\n" - }, - "orderId": { - "type": "string", - "description": "Order ID\n" - }, - "side": { - "type": "string", - "description": "Transaction side", - "enum": [ - "buy", - "sell" - ], - "x-api-enum": [ - { - "value": "buy", - "name": "buy", - "description": "buy" - }, - { - "value": "sell", - "name": "sell", - "description": "sell" - } - ] - }, - "liquidity": { - "type": "string", - "description": "Liquidity- taker or maker", - "enum": [ - "taker", - "maker" - ], - "x-api-enum": [ - { - "value": "taker", - "name": "taker", - "description": "taker" - }, - { - "value": "maker", - "name": "maker", - "description": "maker" - } - ] - }, - "forceTaker": { - "type": "boolean", - "description": "Whether to force processing as a taker\n" - }, - "price": { - "type": "string", - "description": "Filled price" - }, - "size": { - "type": "integer", - "description": "Filled amount" - }, - "value": { - "type": "string", - "description": "Order value" - }, - "openFeePay": { - "type": "string", - "description": "Opening transaction fee" - }, - "closeFeePay": { - "type": "string", - "description": "Closing transaction fee" - }, - "stop": { - "type": "string", - "description": "A mark to the stop order type" - }, - "feeRate": { - "type": "string", - "description": "Fee Rate" - }, - "fixFee": { - "type": "string", - "description": "Fixed fees(Deprecated field, no actual use of the value field)" - }, - "feeCurrency": { - "type": "string", - "description": "Charging currency" - }, - "tradeTime": { - "type": "integer", - "description": "trade time in nanosecond", - "format": "int64" - }, - "subTradeType": { - "type": "string", - "description": "Deprecated field, no actual use of the value field" - }, - "marginMode": { - "type": "string", - "description": "Margin mode: ISOLATED (isolated), CROSS (cross margin).", - "enum": [ - "ISOLATED", - "CROSS" - ], - "x-api-enum": [ - { - "value": "ISOLATED", - "name": "ISOLATED", - "description": "Isolated Margin" - }, - { - "value": "CROSS", - "name": "CROSS", - "description": "Cross Margin" - } - ] - }, - "settleCurrency": { - "type": "string", - "description": "Settle Currency" - }, - "displayType": { - "type": "string", - "enum": [ - "limit", - "market", - "limit_stop", - "market_stop" - ], - "description": "Order Type", - "x-api-enum": [ - { - "value": "limit", - "name": "limit", - "description": "Limit order" - }, - { - "value": "market", - "name": "market", - "description": "Market order" - }, - { - "value": "limit_stop", - "name": "limit_stop", - "description": "Stop limit order" - }, - { - "value": "market_stop", - "name": "market_stop", - "description": "Stop Market order" - } - ] - }, - "fee": { - "type": "string" - }, - "orderType": { - "type": "string", - "description": "Order type", - "enum": [ - "market", - "limit" - ], - "x-api-enum": [ - { - "value": "market", - "name": "market", - "description": "market" - }, - { - "value": "limit", - "name": "limit", - "description": "limit" - } - ] - }, - "tradeType": { - "type": "string", - "description": "Trade type (trade, liquid, adl or settlement)\n", - "enum": [ - "trade", - "liquid", - "adl", - "settlement" - ], - "x-api-enum": [ - { - "value": "trade", - "name": "trade", - "description": "trade" - }, - { - "value": "liquid", - "name": "liquid", - "description": "liquid" - }, - { - "value": "adl", - "name": "adl", - "description": "adl" - }, - { - "value": "settlement", - "name": "settlement", - "description": "settlement" - } - ] - }, - "createdAt": { - "type": "integer", - "description": "Time the order created\n", - "format": "int64" - } - }, - "required": [ - "symbol", - "tradeId", - "orderId", - "side", - "liquidity", - "forceTaker", - "price", - "size", - "value", - "openFeePay", - "closeFeePay", - "stop", - "feeRate", - "fixFee", - "feeCurrency", - "tradeTime", - "subTradeType", - "marginMode", - "settleCurrency", - "displayType", - "fee", - "orderType", - "tradeType", - "createdAt" - ] - } - } + ] + }, + "stopPrice": { + "type": "string", + "description": "Need to be defined if stop is specified. " + }, + "reduceOnly": { + "type": "boolean", + "description": "A mark to reduce the position size only. Set to false by default. Need to set the position size when reduceOnly is true. If set to true, only the orders reducing the position size will be executed. If the reduce-only order size exceeds the position size, the extra size will be canceled.", + "default": false + }, + "closeOrder": { + "type": "boolean", + "description": "A mark to close the position. Set to false by default. If closeOrder is set to true, the system will close the position and the position size will become 0. Side, Size and Leverage fields can be left empty and the system will determine the side and size automatically.", + "default": false + }, + "forceHold": { + "type": "boolean", + "description": "A mark to forcely hold the funds for an order, even though it's an order to reduce the position size. This helps the order stay on the order book and not get canceled when the position size changes. Set to false by default. The system will forcely freeze certain amount of funds for this order, including orders whose direction is opposite to the current positions. This feature is to ensure that the order won’t be canceled by the matching engine in such a circumstance that not enough funds are frozen for the order.", + "default": false + }, + "stp": { + "type": "string", + "description": "[Self Trade Prevention](apidog://link/pages/338146) is divided into these strategies: CN, CO, CB. Not supported DC at the moment.", + "enum": [ + "CN", + "CO", + "CB" + ], + "x-api-enum": [ + { + "value": "CN", + "name": "CN", + "description": "Cancel new, Cancel the new order" }, - "required": [ - "currentPage", - "pageSize", - "totalNum", - "totalPage", - "items" - ] - } + { + "value": "CO", + "name": "CO", + "description": "Cancel old, Cancel the old order" + }, + { + "value": "CB", + "name": "CB", + "description": "Cancel both, Cancel both sides" + } + ] }, - "required": [ - "code", - "data" - ] + "marginMode": { + "type": "string", + "description": "Margin mode: ISOLATED, CROSS, default: ISOLATED", + "enum": [ + "ISOLATED", + "CROSS" + ], + "default": "ISOLATED", + "x-api-enum": [ + { + "value": "ISOLATED", + "name": "", + "description": "" + }, + { + "value": "CROSS", + "name": "", + "description": "" + } + ] + }, + "price": { + "type": "string", + "description": "Required for type is 'limit' order, indicating the operating price", + "examples": [ + "0.1" + ] + }, + "size": { + "type": "integer", + "description": "**Choose one of size, qty, valueQty**, Order size (Lot), must be a positive integer. The quantity unit of coin-swap contracts is size(lot), and other units are not supported." + }, + "timeInForce": { + "type": "string", + "description": "Optional for type is 'limit' order, [Time in force](apidog://link/pages/338146) is a special strategy used during trading, default is GTC", + "enum": [ + "GTC", + "IOC" + ], + "default": "GTC", + "x-api-enum": [ + { + "value": "GTC", + "name": "Good Till Canceled", + "description": "order remains open on the order book until canceled. This is the default type if the field is left empty." + }, + { + "value": "IOC", + "name": "Immediate Or Cancel", + "description": "being matched or not, the remaining size of the order will be instantly canceled instead of entering the order book." + } + ] + }, + "postOnly": { + "type": "boolean", + "description": "Optional for type is 'limit' order, post only flag, invalid when timeInForce is IOC. When postOnly is true, not allowed choose hidden or iceberg. The post-only flag ensures that the trader always pays the maker fee and provides liquidity to the order book. If any part of the order is going to pay taker fee, the order will be fully rejected.", + "default": false + }, + "hidden": { + "type": "boolean", + "description": "Optional for type is 'limit' order, orders not displaying in order book. When hidden chose, not allowed choose postOnly.", + "default": false + }, + "iceberg": { + "type": "boolean", + "description": "Optional for type is 'limit' order, Only visible portion of the order is displayed in the order book. When iceberg chose, not allowed choose postOnly.", + "default": false + }, + "visibleSize": { + "type": "string", + "description": "Optional for type is 'limit' order, The maximum visible size of an iceberg order. please place order in size (lots), The units of qty (base currency) and valueQty (value) are not supported." + }, + "qty": { + "type": "string", + "description": "**Choose one of size, qty, valueQty**, Order size (Base currency) must be an integer multiple of the multiplier. The unit of the quantity of coin-swap is size(lot), which is not supported" + }, + "valueQty": { + "type": "string", + "description": "**Choose one of size, qty, valueQty**, Order size (Value), USDS-Swap correspond to USDT or USDC. The unit of the quantity of coin-swap is size(lot), which is not supported" + } }, - "description": "", - "contentType": "json", - "mediaType": "" - } - ], - "responseExamples": [ - { - "name": "Success", - "data": "{\n \"code\": \"200000\",\n \"data\": {\n \"currentPage\": 1,\n \"pageSize\": 50,\n \"totalNum\": 2,\n \"totalPage\": 1,\n \"items\": [\n {\n \"symbol\": \"XBTUSDTM\",\n \"tradeId\": \"1784277229880\",\n \"orderId\": \"236317213710184449\",\n \"side\": \"buy\",\n \"liquidity\": \"taker\",\n \"forceTaker\": false,\n \"price\": \"67430.9\",\n \"size\": 1,\n \"value\": \"67.4309\",\n \"openFeePay\": \"0.04045854\",\n \"closeFeePay\": \"0\",\n \"stop\": \"\",\n \"feeRate\": \"0.00060\",\n \"fixFee\": \"0\",\n \"feeCurrency\": \"USDT\",\n \"marginMode\": \"ISOLATED\",\n \"settleCurrency\": \"USDT\",\n \"fee\": \"0.04045854\",\n \"orderType\": \"market\",\n \"displayType\": \"market\",\n \"tradeType\": \"trade\",\n \"subTradeType\": null,\n \"tradeTime\": 1729155616320000000,\n \"createdAt\": 1729155616493\n },\n {\n \"symbol\": \"XBTUSDTM\",\n \"tradeId\": \"1784277132002\",\n \"orderId\": \"236317094436728832\",\n \"side\": \"buy\",\n \"liquidity\": \"taker\",\n \"forceTaker\": false,\n \"price\": \"67445\",\n \"size\": 1,\n \"value\": \"67.445\",\n \"openFeePay\": \"0\",\n \"closeFeePay\": \"0.040467\",\n \"stop\": \"\",\n \"feeRate\": \"0.00060\",\n \"fixFee\": \"0\",\n \"feeCurrency\": \"USDT\",\n \"marginMode\": \"ISOLATED\",\n \"settleCurrency\": \"USDT\",\n \"fee\": \"0.040467\",\n \"orderType\": \"market\",\n \"displayType\": \"market\",\n \"tradeType\": \"trade\",\n \"subTradeType\": null,\n \"tradeTime\": 1729155587944000000,\n \"createdAt\": 1729155588104\n }\n ]\n }\n}", - "responseId": 10412, - "ordering": 1 - } - ], - "requestBody": { - "type": "none", - "parameters": [], - "jsonSchema": { - "type": "object", - "properties": {} + "required": [ + "clientOid", + "symbol", + "type", + "side", + "leverage" + ] }, - "example": "", + "example": "{\n \"clientOid\": \"5c52e11203aa677f33e493fb\",\n \"side\": \"buy\",\n \"symbol\": \"XBTUSDTM\",\n \"leverage\": 3,\n \"type\": \"limit\",\n \"remark\": \"order remarks\",\n \"reduceOnly\": false,\n \"marginMode\": \"ISOLATED\",\n \"price\": \"0.1\",\n \"size\": 1,\n \"timeInForce\": \"GTC\"\n}", "mediaType": "" }, - "description": ":::info[Description]\nGet a list of recent fills. If you need to get your recent trade history with low latency, please query endpoint Get List of Orders Completed in 24h. The requested data is not real-time.\n:::\n\n**Data Time Range**\n\nThe system allows you to retrieve data up to one week (start from the last day by default). If the time period of the queried data exceeds one week (time range from the start time to end time exceeded 24*7 hours), the system will prompt to remind you that you have exceeded the time limit. If you only specified the start time, the system will automatically calculate the end time (end time = start time + 24 hours). On the contrary, if you only specified the end time, the system will calculate the start time (start time= end time - 24 hours) the same way.\n\n**Fee**\n\nOrders on KuCoin Futures platform are classified into two types, taker and maker. A taker order matches other resting orders on the exchange order book, and gets executed immediately after order entry. A maker order, on the contrary, stays on the exchange order book and awaits to be matched. Taker orders will be charged taker fees, while maker orders will receive maker rebates. Please note that market orders, iceberg orders and hidden orders are always charged taker fees.\n\nThe system will pre-freeze a predicted taker fee when you place an order.The liquidity field indicates if the fill was charged taker or maker fees.\n\nThe system will pre-freeze the predicted fees (including the maintenance margin needed for the position, entry fees and fees to close positions) if you added the position, and will not pre-freeze fees if you reduced the position. After the order is executed, if you added positions, the system will deduct entry fees from your balance, if you closed positions, the system will deduct the close fees.", - "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Futures\",\"api-channel\":\"Private\",\"api-permission\":\"Futures\",\"api-rate-limit-pool\":\"Futures\",\"sdk-service\":\"Futures\",\"sdk-sub-service\":\"Order\",\"sdk-method-name\":\"getTradeHistory\",\"sdk-method-description\":\"Get a list of recent fills. If you need to get your recent trade history with low latency, please query endpoint Get List of Orders Completed in 24h. The requested data is not real-time.\",\"api-rate-limit\":5}" + "description": ":::info[Description]\nOrder test endpoint, the request parameters and return parameters of this endpoint are exactly the same as the order endpoint, and can be used to verify whether the signature is correct and other operations. After placing an order, the order will not enter the matching system, and the order cannot be queried.\n:::\n", + "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Futures\",\"api-channel\":\"Private\",\"api-permission\":\"Futures\",\"api-rate-limit-pool\":\"Futures\",\"sdk-service\":\"Futures\",\"sdk-sub-service\":\"Order\",\"sdk-method-name\":\"addOrderTest\",\"sdk-method-description\":\"Place order to the futures trading system just for validation\",\"api-rate-limit\":2}" } }, { @@ -28705,381 +28547,56 @@ "value": "GTC", "name": "Good Till Canceled", "description": "order remains open on the order book until canceled. This is the default type if the field is left empty." - }, - { - "value": "IOC", - "name": "Immediate Or Cancel", - "description": "being matched or not, the remaining size of the order will be instantly canceled instead of entering the order book." - } - ] - }, - "postOnly": { - "type": "boolean", - "description": "Optional for type is 'limit' order, post only flag, invalid when timeInForce is IOC. When postOnly is true, not allowed choose hidden or iceberg. The post-only flag ensures that the trader always pays the maker fee and provides liquidity to the order book. If any part of the order is going to pay taker fee, the order will be fully rejected.", - "default": false - }, - "hidden": { - "type": "boolean", - "description": "Optional for type is 'limit' order, orders not displaying in order book. When hidden chose, not allowed choose postOnly.", - "default": false - }, - "iceberg": { - "type": "boolean", - "description": "Optional for type is 'limit' order, Only visible portion of the order is displayed in the order book. When iceberg chose, not allowed choose postOnly.", - "default": false - }, - "visibleSize": { - "type": "string", - "description": "Optional for type is 'limit' order, The maximum visible size of an iceberg order. please place order in size (lots), The units of qty (base currency) and valueQty (value) are not supported." - }, - "qty": { - "type": "string", - "description": "**Choose one of size, qty, valueQty**, Order size (Base currency) must be an integer multiple of the multiplier. The unit of the quantity of coin-swap is size(lot), which is not supported" - }, - "valueQty": { - "type": "string", - "description": "**Choose one of size, qty, valueQty**, Order size (Value), USDS-Swap correspond to USDT or USDC. The unit of the quantity of coin-swap is size(lot), which is not supported" - } - }, - "required": [ - "clientOid", - "symbol", - "type", - "side", - "leverage" - ] - } - }, - "example": "[\n {\n \"clientOid\": \"5c52e11203aa677f33e493fb\",\n \"side\": \"buy\",\n \"symbol\": \"XBTUSDTM\",\n \"leverage\": 3,\n \"type\": \"limit\",\n \"remark\": \"order remarks\",\n \"reduceOnly\": false,\n \"marginMode\": \"ISOLATED\",\n \"price\": \"0.1\",\n \"size\": 1,\n \"timeInForce\": \"GTC\"\n },\n {\n \"clientOid\": \"5c52e11203aa677f33e493fc\",\n \"side\": \"buy\",\n \"symbol\": \"XBTUSDTM\",\n \"leverage\": 3,\n \"type\": \"limit\",\n \"remark\": \"order remarks\",\n \"reduceOnly\": false,\n \"marginMode\": \"ISOLATED\",\n \"price\": \"0.1\",\n \"size\": 1,\n \"timeInForce\": \"GTC\"\n }\n]", - "mediaType": "" - }, - "description": ":::info[Description]\nPlace multiple order to the futures trading system, you can place two major types of orders: limit and market. Orders can only be placed if your account has sufficient funds. Once an order is placed, your funds will be put on hold for the duration of the order. The amount of funds on hold depends on the order type and parameters specified.\nYou can place up to 20 orders at one time, including limit orders, market orders, and stop orders\n\nPlease be noted that the system would hold the fees from the orders entered the orderbook in advance.\n\nDo NOT include extra spaces in JSON strings.\n\nPlace Order Limit\nThe maximum limit orders for a single contract is 100 per account, and the maximum stop orders for a single contract is 50 per account.\n:::\n\n:::tip[Tips]\n- The maximum limit orders for a single contract is 100 per account, and the maximum stop orders for a single contract is 50 per account.\n:::", - "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Futures\",\"api-channel\":\"Private\",\"api-permission\":\"Futures\",\"api-rate-limit-pool\":\"Futures\",\"sdk-service\":\"Futures\",\"sdk-sub-service\":\"Order\",\"sdk-method-name\":\"batchAddOrders\",\"sdk-method-description\":\"Place multiple order to the futures trading system, you can place two major types of orders: limit and market. Orders can only be placed if your account has sufficient funds. Once an order is placed, your funds will be put on hold for the duration of the order. The amount of funds on hold depends on the order type and parameters specified. You can place up to 20 orders at one time, including limit orders, market orders, and stop orders Please be noted that the system would hold the fees from the orders entered the orderbook in advance.\",\"api-rate-limit\":20}" - } - }, - { - "name": "Get Recent Trade History", - "api": { - "id": "3470249", - "method": "get", - "path": "/api/v1/recentFills", - "parameters": { - "query": [ - { - "id": "4wXlXiQszi", - "name": "symbol", - "required": false, - "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](apidog://link/endpoint/3470220) ", - "example": "XBTUSDTM", - "type": "string", - "enable": true - } - ], - "path": [], - "cookie": [], - "header": [] - }, - "responses": [ - { - "id": "10413", - "code": 200, - "name": "成功", - "headers": [], - "jsonSchema": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "data": { - "type": "array", - "items": { - "type": "object", - "properties": { - "symbol": { - "type": "string", - "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](apidog://link/endpoint/3470220) " - }, - "tradeId": { - "type": "string", - "description": "Trade ID\n" - }, - "orderId": { - "type": "string", - "description": "Order ID\n" - }, - "side": { - "type": "string", - "description": "Transaction side\n", - "enum": [ - "buy", - "sell" - ], - "x-api-enum": [ - { - "value": "buy", - "name": "buy", - "description": "buy" - }, - { - "value": "sell", - "name": "sell", - "description": "sell" - } - ] - }, - "liquidity": { - "type": "string", - "description": "Liquidity- taker or maker\n", - "enum": [ - "taker", - "maker" - ], - "x-api-enum": [ - { - "value": "taker", - "name": "taker", - "description": "taker" - }, - { - "value": "maker", - "name": "maker", - "description": "maker" - } - ] - }, - "forceTaker": { - "type": "boolean", - "description": "Whether to force processing as a taker\n" - }, - "price": { - "type": "string", - "description": "Filled price\n" - }, - "size": { - "type": "integer", - "description": "Filled amount\n" - }, - "value": { - "type": "string", - "description": "Order value\n" - }, - "openFeePay": { - "type": "string", - "description": "Opening transaction fee\n" - }, - "closeFeePay": { - "type": "string", - "description": "Closing transaction fee\n" - }, - "stop": { - "type": "string", - "description": "A mark to the stop order type\n" - }, - "feeRate": { - "type": "string", - "description": "Fee Rate" - }, - "fixFee": { - "type": "string", - "description": "Fixed fees(Deprecated field, no actual use of the value field)\n" - }, - "feeCurrency": { - "type": "string", - "description": "Charging currency\n" - }, - "tradeTime": { - "type": "integer", - "description": "trade time in nanosecond\n", - "format": "int64" - }, - "subTradeType": { - "type": "string", - "description": "Deprecated field, no actual use of the value field" - }, - "marginMode": { - "type": "string", - "description": "Margin mode: ISOLATED (isolated), CROSS (cross margin).\n", - "enum": [ - "ISOLATED", - "CROSS" - ], - "x-api-enum": [ - { - "value": "ISOLATED", - "name": "ISOLATED", - "description": "Isolated Margin" - }, - { - "value": "CROSS", - "name": "CROSS", - "description": "Cross Margin" - } - ] - }, - "displayType": { - "type": "string", - "enum": [ - "limit", - "market", - "limit_stop", - "market_stop" - ], - "description": "Order Type", - "x-api-enum": [ - { - "value": "limit", - "name": "limit", - "description": "Limit order" - }, - { - "value": "market", - "name": "market", - "description": "Market order" - }, - { - "value": "limit_stop", - "name": "limit_stop", - "description": "Stop limit order" - }, - { - "value": "market_stop", - "name": "market_stop", - "description": "Stop Market order" - } - ] - }, - "fee": { - "type": "string", - "description": "Transaction fee\n" - }, - "settleCurrency": { - "type": "string", - "description": "Settle Currency" - }, - "orderType": { - "type": "string", - "description": "Order type\n", - "enum": [ - "market", - "limit" - ], - "x-api-enum": [ - { - "value": "market", - "name": "market", - "description": "market" - }, - { - "value": "limit", - "name": "limit", - "description": "limit" - } - ] - }, - "tradeType": { - "type": "string", - "description": "Trade type (trade, liquid, cancel, adl or settlement)\n", - "enum": [ - "trade", - "cancel", - "liquid", - "adl", - "settlement" - ], - "x-api-enum": [ - { - "value": "trade", - "name": "trade", - "description": "trade" - }, - { - "value": "cancel", - "name": "cancel", - "description": "Partially filled and cancelled orders" - }, - { - "value": "liquid", - "name": "liquid", - "description": "liquid" - }, - { - "value": "adl", - "name": "adl", - "description": "adl" - }, - { - "value": "settlement", - "name": "settlement", - "description": "settlement" - } - ] - }, - "createdAt": { - "type": "integer", - "description": "Time the order created\n", - "format": "int64" - } - }, - "required": [ - "symbol", - "tradeId", - "orderId", - "side", - "liquidity", - "forceTaker", - "price", - "size", - "value", - "openFeePay", - "closeFeePay", - "stop", - "feeRate", - "fixFee", - "feeCurrency", - "tradeTime", - "subTradeType", - "marginMode", - "displayType", - "fee", - "settleCurrency", - "orderType", - "tradeType", - "createdAt" - ] - } + }, + { + "value": "IOC", + "name": "Immediate Or Cancel", + "description": "being matched or not, the remaining size of the order will be instantly canceled instead of entering the order book." + } + ] + }, + "postOnly": { + "type": "boolean", + "description": "Optional for type is 'limit' order, post only flag, invalid when timeInForce is IOC. When postOnly is true, not allowed choose hidden or iceberg. The post-only flag ensures that the trader always pays the maker fee and provides liquidity to the order book. If any part of the order is going to pay taker fee, the order will be fully rejected.", + "default": false + }, + "hidden": { + "type": "boolean", + "description": "Optional for type is 'limit' order, orders not displaying in order book. When hidden chose, not allowed choose postOnly.", + "default": false + }, + "iceberg": { + "type": "boolean", + "description": "Optional for type is 'limit' order, Only visible portion of the order is displayed in the order book. When iceberg chose, not allowed choose postOnly.", + "default": false + }, + "visibleSize": { + "type": "string", + "description": "Optional for type is 'limit' order, The maximum visible size of an iceberg order. please place order in size (lots), The units of qty (base currency) and valueQty (value) are not supported." + }, + "qty": { + "type": "string", + "description": "**Choose one of size, qty, valueQty**, Order size (Base currency) must be an integer multiple of the multiplier. The unit of the quantity of coin-swap is size(lot), which is not supported" + }, + "valueQty": { + "type": "string", + "description": "**Choose one of size, qty, valueQty**, Order size (Value), USDS-Swap correspond to USDT or USDC. The unit of the quantity of coin-swap is size(lot), which is not supported" } }, "required": [ - "code", - "data" + "clientOid", + "symbol", + "type", + "side", + "leverage" ] - }, - "description": "", - "contentType": "json", - "mediaType": "" - } - ], - "responseExamples": [ - { - "name": "Success", - "data": "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"symbol\": \"XBTUSDTM\",\n \"tradeId\": \"1784277229880\",\n \"orderId\": \"236317213710184449\",\n \"side\": \"buy\",\n \"liquidity\": \"taker\",\n \"forceTaker\": false,\n \"price\": \"67430.9\",\n \"size\": 1,\n \"value\": \"67.4309\",\n \"openFeePay\": \"0.04045854\",\n \"closeFeePay\": \"0\",\n \"stop\": \"\",\n \"feeRate\": \"0.00060\",\n \"fixFee\": \"0\",\n \"feeCurrency\": \"USDT\",\n \"marginMode\": \"ISOLATED\",\n \"fee\": \"0.04045854\",\n \"settleCurrency\": \"USDT\",\n \"orderType\": \"market\",\n \"displayType\": \"market\",\n \"tradeType\": \"trade\",\n \"subTradeType\": null,\n \"tradeTime\": 1729155616320000000,\n \"createdAt\": 1729155616493\n },\n {\n \"symbol\": \"XBTUSDTM\",\n \"tradeId\": \"1784277132002\",\n \"orderId\": \"236317094436728832\",\n \"side\": \"buy\",\n \"liquidity\": \"taker\",\n \"forceTaker\": false,\n \"price\": \"67445\",\n \"size\": 1,\n \"value\": \"67.445\",\n \"openFeePay\": \"0\",\n \"closeFeePay\": \"0.040467\",\n \"stop\": \"\",\n \"feeRate\": \"0.00060\",\n \"fixFee\": \"0\",\n \"feeCurrency\": \"USDT\",\n \"marginMode\": \"ISOLATED\",\n \"fee\": \"0.040467\",\n \"settleCurrency\": \"USDT\",\n \"orderType\": \"market\",\n \"displayType\": \"market\",\n \"tradeType\": \"trade\",\n \"subTradeType\": null,\n \"tradeTime\": 1729155587944000000,\n \"createdAt\": 1729155588104\n }\n ]\n}", - "responseId": 10413, - "ordering": 1 - } - ], - "requestBody": { - "type": "none", - "parameters": [], - "jsonSchema": { - "type": "object", - "properties": {} + } }, - "example": "", + "example": "[\n {\n \"clientOid\": \"5c52e11203aa677f33e493fb\",\n \"side\": \"buy\",\n \"symbol\": \"XBTUSDTM\",\n \"leverage\": 3,\n \"type\": \"limit\",\n \"remark\": \"order remarks\",\n \"reduceOnly\": false,\n \"marginMode\": \"ISOLATED\",\n \"price\": \"0.1\",\n \"size\": 1,\n \"timeInForce\": \"GTC\"\n },\n {\n \"clientOid\": \"5c52e11203aa677f33e493fc\",\n \"side\": \"buy\",\n \"symbol\": \"XBTUSDTM\",\n \"leverage\": 3,\n \"type\": \"limit\",\n \"remark\": \"order remarks\",\n \"reduceOnly\": false,\n \"marginMode\": \"ISOLATED\",\n \"price\": \"0.1\",\n \"size\": 1,\n \"timeInForce\": \"GTC\"\n }\n]", "mediaType": "" }, - "description": ":::info[Description]\nGet a list of recent 1000 fills in the last 24 hours. If you need to get your recent traded order history with low latency, you may query this endpoint.\n\nIf you need to get your recent traded order history with low latency, you may query this endpoint.\n:::", - "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Futures\",\"api-channel\":\"Private\",\"api-permission\":\"Futures\",\"api-rate-limit-pool\":\"Futures\",\"sdk-service\":\"Futures\",\"sdk-sub-service\":\"Order\",\"sdk-method-name\":\"getRecentTradeHistory\",\"sdk-method-description\":\"Get a list of recent 1000 fills in the last 24 hours. If you need to get your recent traded order history with low latency, you may query this endpoint.\",\"api-rate-limit\":3}" + "description": ":::info[Description]\nPlace multiple order to the futures trading system, you can place two major types of orders: limit and market. Orders can only be placed if your account has sufficient funds. Once an order is placed, your funds will be put on hold for the duration of the order. The amount of funds on hold depends on the order type and parameters specified.\nYou can place up to 20 orders at one time, including limit orders, market orders, and stop orders\n\nPlease be noted that the system would hold the fees from the orders entered the orderbook in advance.\n\nDo NOT include extra spaces in JSON strings.\n\nPlace Order Limit\nThe maximum limit orders for a single contract is 100 per account, and the maximum stop orders for a single contract is 50 per account.\n:::\n\n:::tip[Tips]\n- The maximum limit orders for a single contract is 100 per account, and the maximum stop orders for a single contract is 50 per account.\n:::", + "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Futures\",\"api-channel\":\"Private\",\"api-permission\":\"Futures\",\"api-rate-limit-pool\":\"Futures\",\"sdk-service\":\"Futures\",\"sdk-sub-service\":\"Order\",\"sdk-method-name\":\"batchAddOrders\",\"sdk-method-description\":\"Place multiple order to the futures trading system, you can place two major types of orders: limit and market. Orders can only be placed if your account has sufficient funds. Once an order is placed, your funds will be put on hold for the duration of the order. The amount of funds on hold depends on the order type and parameters specified. You can place up to 20 orders at one time, including limit orders, market orders, and stop orders Please be noted that the system would hold the fees from the orders entered the orderbook in advance.\",\"api-rate-limit\":20}" } }, { @@ -29392,30 +28909,29 @@ } }, { - "name": "Get Open Order Value", + "name": "Cancel Order By OrderId", "api": { - "id": "3470250", - "method": "get", - "path": "/api/v1/openOrderStatistics", + "id": "3470239", + "method": "delete", + "path": "/api/v1/orders/{orderId}", "parameters": { - "query": [ + "query": [], + "path": [ { - "id": "4wXlXiQszi", - "name": "symbol", + "id": "orderId#0", + "name": "orderId", "required": true, - "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](apidog://link/endpoint/3470220) ", - "example": "XBTUSDTM", + "description": "", "type": "string", "enable": true } ], - "path": [], "cookie": [], "header": [] }, "responses": [ { - "id": "10414", + "id": "10403", "code": 200, "name": "成功", "headers": [], @@ -29428,33 +28944,16 @@ "data": { "type": "object", "properties": { - "openOrderBuySize": { - "type": "integer", - "description": "Total number of the unexecuted buy orders\n" - }, - "openOrderSellSize": { - "type": "integer", - "description": "Total number of the unexecuted sell orders\n" - }, - "openOrderBuyCost": { - "type": "string", - "description": "Value of all the unexecuted buy orders\n" - }, - "openOrderSellCost": { - "type": "string", - "description": "Value of all the unexecuted sell orders\n" - }, - "settleCurrency": { - "type": "string", - "description": "settlement currency\n" + "cancelledOrderIds": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The orderId that is to be canceled" } }, "required": [ - "openOrderBuySize", - "openOrderSellSize", - "openOrderBuyCost", - "openOrderSellCost", - "settleCurrency" + "cancelledOrderIds" ] } }, @@ -29471,8 +28970,8 @@ "responseExamples": [ { "name": "Success", - "data": "{\n \"code\": \"200000\",\n \"data\": {\n \"openOrderBuySize\": 1,\n \"openOrderSellSize\": 0,\n \"openOrderBuyCost\": \"0.0001\",\n \"openOrderSellCost\": \"0\",\n \"settleCurrency\": \"USDT\"\n }\n}", - "responseId": 10414, + "data": "{\n \"code\": \"200000\",\n \"data\": {\n \"cancelledOrderIds\": [\n \"235303670076489728\"\n ]\n }\n}", + "responseId": 10403, "ordering": 1 } ], @@ -29486,25 +28985,44 @@ "example": "", "mediaType": "" }, - "description": ":::info[Description]\nYou can query this endpoint to get the the total number and value of the all your active orders.\n:::", - "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Futures\",\"api-channel\":\"Private\",\"api-permission\":\"Futures\",\"api-rate-limit-pool\":\"Futures\",\"sdk-service\":\"Futures\",\"sdk-sub-service\":\"Order\",\"sdk-method-name\":\"GetOpenOrderValue\",\"sdk-method-description\":\"You can query this endpoint to get the the total number and value of the all your active orders.\",\"api-rate-limit\":10}" + "description": ":::info[Description]\nCancel an order (including a stop order).\n\nYou will receive success message once the system has received the cancellation request. The cancellation request will be processed by matching engine in sequence. To know if the request has been processed, you may check the order status or update message from the websocket pushes.\n\nThe `orderId` is the server-assigned order id, not the specified clientOid.\n\nIf the order can not be canceled (already filled or previously canceled, etc), then an error response will indicate the reason in the message field.\n:::\n\n**API KEY PERMISSIONS**\nThis endpoint requires the Futures Trading permission.\n\n**REQUEST URL**\nThis endpoint support Futures URL\n\n**REQUEST RATE LIMIT**\nFutures weight:1\n", + "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Futures\",\"api-channel\":\"Private\",\"api-permission\":\"Futures\",\"api-rate-limit-pool\":\"Futures\",\"sdk-service\":\"Futures\",\"sdk-sub-service\":\"Order\",\"sdk-method-name\":\"cancelOrderById\",\"sdk-method-description\":\"Cancel order by system generated orderId.\",\"api-rate-limit\":1}" } }, { - "name": "Add Order Test", + "name": "Cancel Order By ClientOid", "api": { - "id": "3470238", - "method": "post", - "path": "/api/v1/orders/test", + "id": "3470240", + "method": "delete", + "path": "/api/v1/orders/client-order/{clientOid}", "parameters": { - "query": [], - "path": [], + "query": [ + { + "id": "3ERfnDiWhq", + "name": "symbol", + "required": true, + "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](apidog://link/endpoint/3470220) ", + "example": "XBTUSDTM", + "type": "string", + "enable": true + } + ], + "path": [ + { + "id": "clientOid#0", + "name": "clientOid", + "required": true, + "description": "client order id", + "type": "string", + "enable": true + } + ], "cookie": [], "header": [] }, "responses": [ { - "id": "10402", + "id": "10404", "code": 200, "name": "成功", "headers": [], @@ -29517,17 +29035,11 @@ "data": { "type": "object", "properties": { - "orderId": { - "type": "string", - "description": "The unique order id generated by the trading system,which can be used later for further actions such as canceling the order." - }, "clientOid": { - "type": "string", - "description": "The user self-defined order id." + "type": "string" } }, "required": [ - "orderId", "clientOid" ] } @@ -29545,300 +29057,165 @@ "responseExamples": [ { "name": "Success", - "data": "{\n \"code\": \"200000\",\n \"data\": {\n \"orderId\": \"234125150956625920\",\n \"clientOid\": \"5c52e11203aa677f33e493fb\"\n }\n}", - "responseId": 10402, + "data": "{\n \"code\": \"200000\",\n \"data\": {\n \"clientOid\": \"017485b0-2957-4681-8a14-5d46b35aee0d\"\n }\n}", + "responseId": 10404, "ordering": 1 } ], "requestBody": { - "type": "application/json", + "type": "none", "parameters": [], "jsonSchema": { "type": "object", - "properties": { - "clientOid": { - "type": "string", - "description": "Unique order id created by users to identify their orders, the maximum length cannot exceed 40, e.g. UUID, Only allows numbers, characters, underline(_), and separator(-)", - "examples": [ - "5c52e11203aa677f33e493fb" - ] - }, - "side": { - "type": "string", - "description": "specify if the order is to 'buy' or 'sell'", - "enum": [ - "buy", - "sell" - ], - "examples": [ - "buy" - ], - "x-api-enum": [ - { - "value": "buy", - "name": "", - "description": "" - }, - { - "value": "sell", - "name": "", - "description": "" - } - ] - }, - "symbol": { - "type": "string", - "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](apidog://link/endpoint/3470220) ", - "examples": [ - "XBTUSDTM" - ] - }, - "leverage": { - "type": "integer", - "description": "Used to calculate the margin to be frozen for the order. If you are to close the position, this parameter is not required.", - "examples": [ - 3 - ] - }, - "type": { - "type": "string", - "description": "specify if the order is an 'limit' order or 'market' order", - "enum": [ - "limit", - "market" - ], - "examples": [ - "limit" - ], - "default": "limit", - "x-api-enum": [ - { - "value": "limit", - "name": "", - "description": "" - }, - { - "value": "market", - "name": "", - "description": "" - } - ] - }, - "remark": { - "type": "string", - "description": "remark for the order, length cannot exceed 100 utf8 characters" - }, - "stop": { - "type": "string", - "description": "Either 'down' or 'up'. If stop is used,parameter stopPrice and stopPriceType also need to be provieded.", - "enum": [ - "down", - "up" - ], - "x-api-enum": [ - { - "value": "down", - "name": "down", - "description": "Triggers when the price reaches or goes below the stopPrice." - }, - { - "value": "up", - "name": "up", - "description": "Triggers when the price reaches or goes above the stopPrice" - } - ] - }, - "stopPriceType": { - "type": "string", - "description": "Either 'TP', 'IP' or 'MP', Need to be defined if stop is specified.", - "enum": [ - "TP", - "MP", - "IP" - ], - "x-api-enum": [ - { - "value": "TP", - "name": "trade price", - "description": "TP for trade price, The last trade price is the last price at which an order was filled. This price can be found in the latest match message." - }, - { - "value": "MP", - "name": "mark price", - "description": "MP for mark price, The mark price can be obtained through relevant OPEN API for index services" - }, - { - "value": "IP", - "name": "index price", - "description": "IP for index price, The index price can be obtained through relevant OPEN API for index services" - } - ] - }, - "stopPrice": { - "type": "string", - "description": "Need to be defined if stop is specified. " - }, - "reduceOnly": { - "type": "boolean", - "description": "A mark to reduce the position size only. Set to false by default. Need to set the position size when reduceOnly is true. If set to true, only the orders reducing the position size will be executed. If the reduce-only order size exceeds the position size, the extra size will be canceled.", - "default": false - }, - "closeOrder": { - "type": "boolean", - "description": "A mark to close the position. Set to false by default. If closeOrder is set to true, the system will close the position and the position size will become 0. Side, Size and Leverage fields can be left empty and the system will determine the side and size automatically.", - "default": false - }, - "forceHold": { - "type": "boolean", - "description": "A mark to forcely hold the funds for an order, even though it's an order to reduce the position size. This helps the order stay on the order book and not get canceled when the position size changes. Set to false by default. The system will forcely freeze certain amount of funds for this order, including orders whose direction is opposite to the current positions. This feature is to ensure that the order won’t be canceled by the matching engine in such a circumstance that not enough funds are frozen for the order.", - "default": false - }, - "stp": { - "type": "string", - "description": "[Self Trade Prevention](apidog://link/pages/338146) is divided into these strategies: CN, CO, CB. Not supported DC at the moment.", - "enum": [ - "CN", - "CO", - "CB" - ], - "x-api-enum": [ - { - "value": "CN", - "name": "CN", - "description": "Cancel new, Cancel the new order" - }, - { - "value": "CO", - "name": "CO", - "description": "Cancel old, Cancel the old order" - }, - { - "value": "CB", - "name": "CB", - "description": "Cancel both, Cancel both sides" - } - ] - }, - "marginMode": { - "type": "string", - "description": "Margin mode: ISOLATED, CROSS, default: ISOLATED", - "enum": [ - "ISOLATED", - "CROSS" - ], - "default": "ISOLATED", - "x-api-enum": [ - { - "value": "ISOLATED", - "name": "", - "description": "" - }, - { - "value": "CROSS", - "name": "", - "description": "" - } - ] - }, - "price": { - "type": "string", - "description": "Required for type is 'limit' order, indicating the operating price", - "examples": [ - "0.1" - ] - }, - "size": { - "type": "integer", - "description": "**Choose one of size, qty, valueQty**, Order size (Lot), must be a positive integer. The quantity unit of coin-swap contracts is size(lot), and other units are not supported." - }, - "timeInForce": { - "type": "string", - "description": "Optional for type is 'limit' order, [Time in force](apidog://link/pages/338146) is a special strategy used during trading, default is GTC", - "enum": [ - "GTC", - "IOC" - ], - "default": "GTC", - "x-api-enum": [ - { - "value": "GTC", - "name": "Good Till Canceled", - "description": "order remains open on the order book until canceled. This is the default type if the field is left empty." - }, - { - "value": "IOC", - "name": "Immediate Or Cancel", - "description": "being matched or not, the remaining size of the order will be instantly canceled instead of entering the order book." + "properties": {} + }, + "example": "", + "mediaType": "" + }, + "description": ":::info[Description]\nCancel an order (including a stop order).\n\nYou will receive success message once the system has received the cancellation request. The cancellation request will be processed by matching engine in sequence. To know if the request has been processed, you may check the order status or update message from the pushes.\n\nResponse the ID created by the client (clientOid).\n\nIf the order can not be canceled (already filled or previously canceled, etc), then an error response will indicate the reason in the message field.\n:::\n\n**API KEY PERMISSIONS**\nThis endpoint requires the Futures Trading permission.\n\n**REQUEST URL**\nThis endpoint support Futures URL", + "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Futures\",\"api-channel\":\"Private\",\"api-permission\":\"Futures\",\"api-rate-limit-pool\":\"Futures\",\"sdk-service\":\"Futures\",\"sdk-sub-service\":\"Order\",\"sdk-method-name\":\"cancelOrderByClientOid\",\"sdk-method-description\":\"Cancel order by client defined orderId.\",\"api-rate-limit\":1}" + } + }, + { + "name": "Batch Cancel Orders", + "api": { + "id": "3470241", + "method": "delete", + "path": "/api/v1/orders/multi-cancel", + "parameters": { + "query": [], + "path": [], + "cookie": [], + "header": [] + }, + "responses": [ + { + "id": "10405", + "code": 200, + "name": "成功", + "headers": [], + "jsonSchema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "array", + "items": { + "type": "object", + "properties": { + "orderId": { + "type": "string" + }, + "clientOid": { + "type": "string" + }, + "code": { + "type": "string" + }, + "msg": { + "type": "string" + } + }, + "required": [ + "orderId", + "clientOid", + "code", + "msg" + ] } - ] - }, - "postOnly": { - "type": "boolean", - "description": "Optional for type is 'limit' order, post only flag, invalid when timeInForce is IOC. When postOnly is true, not allowed choose hidden or iceberg. The post-only flag ensures that the trader always pays the maker fee and provides liquidity to the order book. If any part of the order is going to pay taker fee, the order will be fully rejected.", - "default": false - }, - "hidden": { - "type": "boolean", - "description": "Optional for type is 'limit' order, orders not displaying in order book. When hidden chose, not allowed choose postOnly.", - "default": false - }, - "iceberg": { - "type": "boolean", - "description": "Optional for type is 'limit' order, Only visible portion of the order is displayed in the order book. When iceberg chose, not allowed choose postOnly.", - "default": false - }, - "visibleSize": { - "type": "string", - "description": "Optional for type is 'limit' order, The maximum visible size of an iceberg order. please place order in size (lots), The units of qty (base currency) and valueQty (value) are not supported." + } }, - "qty": { - "type": "string", - "description": "**Choose one of size, qty, valueQty**, Order size (Base currency) must be an integer multiple of the multiplier. The unit of the quantity of coin-swap is size(lot), which is not supported" + "required": [ + "code", + "data" + ] + }, + "description": "", + "contentType": "json", + "mediaType": "" + } + ], + "responseExamples": [ + { + "name": "Success", + "data": "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"orderId\": \"250445104152670209\",\n \"clientOid\": null,\n \"code\": \"200\",\n \"msg\": \"success\"\n },\n {\n \"orderId\": \"250445181751463936\",\n \"clientOid\": null,\n \"code\": \"200\",\n \"msg\": \"success\"\n }\n ]\n}\n\n//{\n// \"code\": \"200000\",\n// \"data\": [\n// {\n// \"orderId\": null,\n// \"clientOid\": \"5c52e11203aa1677f133e493fb\",\n// \"code\": \"200\",\n// \"msg\": \"success\"\n// },\n// {\n// \"orderId\": null,\n// \"clientOid\": \"5c52214e112\",\n// \"code\": \"200\",\n// \"msg\": \"success\"\n// }\n// ]\n//}", + "responseId": 10405, + "ordering": 1 + } + ], + "requestBody": { + "type": "application/json", + "parameters": [], + "jsonSchema": { + "type": "object", + "properties": { + "orderIdsList": { + "type": "array", + "items": { + "type": "string" + }, + "description": "the list of orderId" }, - "valueQty": { - "type": "string", - "description": "**Choose one of size, qty, valueQty**, Order size (Value), USDS-Swap correspond to USDT or USDC. The unit of the quantity of coin-swap is size(lot), which is not supported" + "clientOidsList": { + "type": "array", + "items": { + "type": "object", + "properties": { + "symbol": { + "type": "string", + "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](apidog://link/endpoint/3470220) " + }, + "clientOid": { + "type": "string" + } + }, + "required": [ + "symbol", + "clientOid" + ] + }, + "description": "the list of client orderId" } }, "required": [ - "clientOid", - "symbol", - "type", - "side", - "leverage" + "orderIdsList", + "clientOidsList" ] }, - "example": "{\n \"clientOid\": \"5c52e11203aa677f33e493fb\",\n \"side\": \"buy\",\n \"symbol\": \"XBTUSDTM\",\n \"leverage\": 3,\n \"type\": \"limit\",\n \"remark\": \"order remarks\",\n \"reduceOnly\": false,\n \"marginMode\": \"ISOLATED\",\n \"price\": \"0.1\",\n \"size\": 1,\n \"timeInForce\": \"GTC\"\n}", + "example": "{\n \"orderIdsList\":\n [\n \"250445104152670209\",\n \"250445181751463936\"\n ]\n}\n\n\n//{\n// \"clientOidsList\":\n// [\n// {\n// \"symbol\": \"XRPUSDTM\",\n// \"clientOid\": \"5c52e11203aa1677f133e493fb\"\n// },\n// {\n// \"symbol\": \"ETHUSDTM\",\n// \"clientOid\": \"5c52214e112\"\n// }\n// ]\n//}\n", "mediaType": "" }, - "description": ":::info[Description]\nOrder test endpoint, the request parameters and return parameters of this endpoint are exactly the same as the order endpoint, and can be used to verify whether the signature is correct and other operations. After placing an order, the order will not enter the matching system, and the order cannot be queried.\n:::\n", - "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Futures\",\"api-channel\":\"Private\",\"api-permission\":\"Futures\",\"api-rate-limit-pool\":\"Futures\",\"sdk-service\":\"Futures\",\"sdk-sub-service\":\"Order\",\"sdk-method-name\":\"addOrderTest\",\"sdk-method-description\":\"Place order to the futures trading system just for validation\",\"api-rate-limit\":2}" + "description": ":::info[Description]\nUsing this endpoint, orders can be canceled in batches, If there are both normal orders and conditional orders with the same clientOid (it is not recommended to use the same clientOrderId), when cancelling orders in batches by clientOid, normal orders will be canceled and conditional orders will be retained.\n\nSupports batch cancellation of orders by orderId or clientOid. When orderIdsList and clientOidsList are used at the same time, orderIdsList shall prevail. A maximum of 10 orders can be canceled at a time.\n\nWhen using orderId to cancel order, the response will return the orderId.\nWhen using clientOid to cancel order, the response will return the clientOid.\n:::", + "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Futures\",\"api-channel\":\"Private\",\"api-permission\":\"Futures\",\"api-rate-limit-pool\":\"Futures\",\"sdk-service\":\"Futures\",\"sdk-sub-service\":\"Order\",\"sdk-method-name\":\"batchCancelOrders\",\"sdk-method-description\":\"Cancel a bach of orders by client defined orderId or system generated orderId\",\"api-rate-limit\":20}" } }, { - "name": "Cancel Order By OrderId", + "name": "Cancel All Orders", "api": { - "id": "3470239", + "id": "3470242", "method": "delete", - "path": "/api/v1/orders/{orderId}", + "path": "/api/v3/orders", "parameters": { - "query": [], - "path": [ + "query": [ { - "id": "orderId#0", - "name": "orderId", + "id": "2KbksGFfyd", + "name": "symbol", "required": true, - "description": "", + "description": "Cancel all limit orders for a specific symbol only, Please refer to [Get Symbol endpoint: symbol](apidog://link/endpoint/3470220) ", + "example": "XBTUSDTM", "type": "string", "enable": true } ], + "path": [], "cookie": [], "header": [] }, "responses": [ { - "id": "10403", + "id": "10406", "code": 200, "name": "成功", "headers": [], @@ -29856,7 +29233,7 @@ "items": { "type": "string" }, - "description": "The orderId that is to be canceled" + "description": "Unique ID of the cancelled order" } }, "required": [ @@ -29877,8 +29254,8 @@ "responseExamples": [ { "name": "Success", - "data": "{\n \"code\": \"200000\",\n \"data\": {\n \"cancelledOrderIds\": [\n \"235303670076489728\"\n ]\n }\n}", - "responseId": 10403, + "data": "{\n \"code\": \"200000\",\n \"data\": {\n \"cancelledOrderIds\": [\n \"235919172150824960\",\n \"235919172150824961\"\n ]\n }\n}", + "responseId": 10406, "ordering": 1 } ], @@ -29892,46 +29269,506 @@ "example": "", "mediaType": "" }, - "description": ":::info[Description]\nCancel an order (including a stop order).\n\nYou will receive success message once the system has received the cancellation request. The cancellation request will be processed by matching engine in sequence. To know if the request has been processed, you may check the order status or update message from the websocket pushes.\n\nThe `orderId` is the server-assigned order id, not the specified clientOid.\n\nIf the order can not be canceled (already filled or previously canceled, etc), then an error response will indicate the reason in the message field.\n:::\n\n**API KEY PERMISSIONS**\nThis endpoint requires the Futures Trading permission.\n\n**REQUEST URL**\nThis endpoint support Futures URL\n\n**REQUEST RATE LIMIT**\nFutures weight:1\n", - "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Futures\",\"api-channel\":\"Private\",\"api-permission\":\"Futures\",\"api-rate-limit-pool\":\"Futures\",\"sdk-service\":\"Futures\",\"sdk-sub-service\":\"Order\",\"sdk-method-name\":\"cancelOrderById\",\"sdk-method-description\":\"Cancel order by system generated orderId.\",\"api-rate-limit\":1}" + "description": ":::info[Description]\nUsing this endpoint, all open orders (excluding stop orders) can be canceled in batches.\n\nThe response is a list of orderIDs of the canceled orders.\n:::\n", + "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Futures\",\"api-channel\":\"Private\",\"api-permission\":\"Futures\",\"api-rate-limit-pool\":\"Futures\",\"sdk-service\":\"Futures\",\"sdk-sub-service\":\"Order\",\"sdk-method-name\":\"cancelAllOrdersV3\",\"sdk-method-description\":\"Cancel all open orders (excluding stop orders). The response is a list of orderIDs of the canceled orders.\",\"api-rate-limit\":10}" } }, { - "name": "Cancel Order By ClientOid", + "name": "Cancel All Stop orders", "api": { - "id": "3470240", + "id": "3470243", "method": "delete", - "path": "/api/v1/orders/client-order/{clientOid}", + "path": "/api/v1/stopOrders", "parameters": { "query": [ { - "id": "3ERfnDiWhq", + "id": "2KbksGFfyd", "name": "symbol", - "required": true, - "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](apidog://link/endpoint/3470220) ", + "required": false, + "description": "Cancel all limit orders for a specific contract only, If not specified, all the limit orders will be deleted, Please refer to [Get Symbol endpoint: symbol](apidog://link/endpoint/3470220) ", "example": "XBTUSDTM", "type": "string", "enable": true } ], + "path": [], + "cookie": [], + "header": [] + }, + "responses": [ + { + "id": "10407", + "code": 200, + "name": "成功", + "headers": [], + "jsonSchema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "object", + "properties": { + "cancelledOrderIds": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Unique ID of the cancelled order" + } + }, + "required": [ + "cancelledOrderIds" + ] + } + }, + "required": [ + "code", + "data" + ] + }, + "description": "", + "contentType": "json", + "mediaType": "" + } + ], + "responseExamples": [ + { + "name": "Success", + "data": "{\n \"code\": \"200000\",\n \"data\": {\n \"cancelledOrderIds\": [\n \"235919172150824960\",\n \"235919172150824961\"\n ]\n }\n}", + "responseId": 10407, + "ordering": 1 + } + ], + "requestBody": { + "type": "none", + "parameters": [], + "jsonSchema": { + "type": "object", + "properties": {} + }, + "example": "{\n \"orderIdsList\":\n [\n \"80465574458560512\",\n \"80465575289094144\"\n ],\n \"clientOidsList\":\n [\n {\n \"symbol\": \"XBTUSDTM\",\n \"clientOid\": \"clientOid123\"\n },\n {\n \"symbol\": \"ETHUSDTM\",\n \"clientOid\": \"clientOid321\"\n }\n ]\n}", + "mediaType": "" + }, + "description": ":::info[Description]\nUsing this endpoint, all untriggered stop orders can be canceled in batches.\n\nSupports batch cancellation of untriggered stop orders by symbol. Cancel all all untriggered stop orders for a specific contract symbol only , If not specified, all the all untriggered stop orders will be canceled.\n:::", + "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Futures\",\"api-channel\":\"Private\",\"api-permission\":\"Futures\",\"api-rate-limit-pool\":\"Futures\",\"sdk-service\":\"Futures\",\"sdk-sub-service\":\"Order\",\"sdk-method-name\":\"cancelAllStopOrders\",\"sdk-method-description\":\"Cancel all untriggered stop orders. The response is a list of orderIDs of the canceled stop orders. To cancel triggered stop orders, please use 'Cancel Multiple Futures Limit orders'.\",\"api-rate-limit\":15}" + } + }, + { + "name": "Get Order By OrderId", + "api": { + "id": "3470245", + "method": "get", + "path": "/api/v1/orders/{order-id}", + "parameters": { + "query": [], "path": [ { - "id": "clientOid#0", - "name": "clientOid", - "required": true, - "description": "client order id", + "id": "order-id#0", + "name": "order-id", + "required": true, + "description": "", + "example": "236655147005071361", + "type": "string", + "enable": true + } + ], + "cookie": [], + "header": [] + }, + "responses": [ + { + "id": "10409", + "code": 200, + "name": "成功", + "headers": [], + "jsonSchema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Order ID" + }, + "symbol": { + "type": "string", + "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](apidog://link/endpoint/3470220) " + }, + "type": { + "type": "string", + "description": "Order type, market order or limit order", + "enum": [ + "market", + "limit" + ], + "x-api-enum": [ + { + "value": "market", + "name": "market", + "description": "Market Order" + }, + { + "value": "limit", + "name": "limit", + "description": "Limit Order" + } + ] + }, + "side": { + "type": "string", + "description": "Transaction side", + "enum": [ + "buy", + "sell" + ], + "x-api-enum": [ + { + "value": "buy", + "name": "buy", + "description": "buy" + }, + { + "value": "sell", + "name": "sell", + "description": "sell" + } + ] + }, + "price": { + "type": "string", + "description": "Order price" + }, + "size": { + "type": "integer", + "description": "Order quantity" + }, + "value": { + "type": "string", + "description": "Order value\n" + }, + "dealValue": { + "type": "string", + "description": "Executed size of funds\n" + }, + "dealSize": { + "type": "integer", + "description": "Executed quantity\n" + }, + "stp": { + "type": "string", + "description": "[Self Trade Prevention](apidog://link/pages/338146) is divided into these strategies: CN, CO, CB. Not supported DC at the moment.", + "enum": [ + "", + "CN", + "CO", + "CB" + ], + "x-api-enum": [ + { + "value": "", + "name": "NULL", + "description": "Null means not stp order" + }, + { + "value": "CN", + "name": "CN", + "description": "Cancel new, Cancel the new order" + }, + { + "value": "CO", + "name": "CO", + "description": "Cancel old, Cancel the old order" + }, + { + "value": "CB", + "name": "CB", + "description": "Cancel both, Cancel both sides" + } + ] + }, + "stop": { + "type": "string", + "description": "Stop order type (stop limit or stop market)\n" + }, + "stopPriceType": { + "type": "string", + "description": "Trigger price type of stop orders", + "enum": [ + "", + "TP", + "MP", + "IP" + ], + "x-api-enum": [ + { + "value": "", + "name": "NULL", + "description": "" + }, + { + "value": "TP", + "name": "trade price", + "description": "TP for trade price, The last trade price is the last price at which an order was filled. This price can be found in the latest match message." + }, + { + "value": "MP", + "name": "mark price", + "description": "MP for mark price, The mark price can be obtained through relevant OPEN API for index services" + }, + { + "value": "IP", + "name": "index price", + "description": "IP for index price, The index price can be obtained through relevant OPEN API for index services" + } + ] + }, + "stopTriggered": { + "type": "boolean", + "description": "Mark to show whether the stop order is triggered" + }, + "stopPrice": { + "type": "number", + "description": "Trigger price of stop orders" + }, + "timeInForce": { + "type": "string", + "description": "Time in force policy type\n" + }, + "postOnly": { + "type": "boolean", + "description": "Mark of post only\n" + }, + "hidden": { + "type": "boolean", + "description": "Mark of the hidden order\n" + }, + "iceberg": { + "type": "boolean", + "description": "Mark of the iceberg order\n" + }, + "leverage": { + "type": "string", + "description": "Leverage of the order\n" + }, + "forceHold": { + "type": "boolean", + "description": "A mark to forcely hold the funds for an order\n" + }, + "closeOrder": { + "type": "boolean", + "description": "A mark to close the position\n" + }, + "visibleSize": { + "type": "integer", + "description": "Visible size of the iceberg order\n" + }, + "clientOid": { + "type": "string", + "description": "Unique order id created by users to identify their orders\n" + }, + "remark": { + "type": "string", + "description": "Remark" + }, + "tags": { + "type": "string", + "description": "tag order source\n" + }, + "isActive": { + "type": "boolean", + "description": "Mark of the active orders\n" + }, + "cancelExist": { + "type": "boolean", + "description": "Mark of the canceled orders\n" + }, + "createdAt": { + "type": "integer", + "description": "Time the order created\n", + "format": "int64" + }, + "updatedAt": { + "type": "integer", + "description": "last update time\n", + "format": "int64" + }, + "endAt": { + "type": "integer", + "description": "Order Endtime", + "format": "int64" + }, + "orderTime": { + "type": "integer", + "description": "Order create time in nanosecond\n", + "format": "int64" + }, + "settleCurrency": { + "type": "string", + "description": "settlement currency\n" + }, + "marginMode": { + "type": "string", + "description": "Margin mode: ISOLATED (isolated), CROSS (cross margin).\n", + "enum": [ + "CROSS", + "ISOLATED" + ], + "x-api-enum": [ + { + "value": "CROSS", + "name": "CROSS", + "description": "Cross margin" + }, + { + "value": "ISOLATED", + "name": "ISOLATED", + "description": "Isolated margin" + } + ] + }, + "avgDealPrice": { + "type": "string", + "description": "Average transaction price, forward contract average transaction price = sum (transaction value) / sum (transaction quantity), reverse contract average transaction price = sum (transaction quantity) / sum (transaction value). Transaction quantity = lots * multiplier\n" + }, + "filledSize": { + "type": "integer", + "description": "Value of the executed orders\n" + }, + "filledValue": { + "type": "string", + "description": "Executed order quantity\n" + }, + "status": { + "type": "string", + "description": "order status: “open” or “done”\n", + "enum": [ + "open", + "done" + ], + "x-api-enum": [ + { + "value": "open", + "name": "open", + "description": "open order" + }, + { + "value": "done", + "name": "done", + "description": "done order" + } + ] + }, + "reduceOnly": { + "type": "boolean", + "description": "A mark to reduce the position size only\n" + } + }, + "required": [ + "id", + "symbol", + "type", + "side", + "price", + "size", + "value", + "dealValue", + "dealSize", + "stp", + "stop", + "stopPriceType", + "stopTriggered", + "stopPrice", + "timeInForce", + "postOnly", + "hidden", + "iceberg", + "leverage", + "forceHold", + "closeOrder", + "visibleSize", + "clientOid", + "remark", + "tags", + "isActive", + "cancelExist", + "createdAt", + "updatedAt", + "orderTime", + "settleCurrency", + "marginMode", + "avgDealPrice", + "filledSize", + "filledValue", + "status", + "reduceOnly" + ] + } + }, + "required": [ + "code", + "data" + ] + }, + "description": "", + "contentType": "json", + "mediaType": "" + } + ], + "responseExamples": [ + { + "name": "Success", + "data": "{\n \"code\": \"200000\",\n \"data\": {\n \"id\": \"236655147005071361\",\n \"symbol\": \"XBTUSDTM\",\n \"type\": \"limit\",\n \"side\": \"buy\",\n \"price\": \"0.1\",\n \"size\": 1,\n \"value\": \"0.0001\",\n \"dealValue\": \"0\",\n \"dealSize\": 0,\n \"stp\": \"\",\n \"stop\": \"\",\n \"stopPriceType\": \"\",\n \"stopTriggered\": false,\n \"stopPrice\": null,\n \"timeInForce\": \"GTC\",\n \"postOnly\": false,\n \"hidden\": false,\n \"iceberg\": false,\n \"leverage\": \"3\",\n \"forceHold\": false,\n \"closeOrder\": false,\n \"visibleSize\": 0,\n \"clientOid\": \"5c52e11203aa677f33e493fb\",\n \"remark\": null,\n \"tags\": \"\",\n \"isActive\": true,\n \"cancelExist\": false,\n \"createdAt\": 1729236185949,\n \"updatedAt\": 1729236185949,\n \"endAt\": null,\n \"orderTime\": 1729236185885647952,\n \"settleCurrency\": \"USDT\",\n \"marginMode\": \"ISOLATED\",\n \"avgDealPrice\": \"0\",\n \"filledSize\": 0,\n \"filledValue\": \"0\",\n \"status\": \"open\",\n \"reduceOnly\": false\n }\n}", + "responseId": 10409, + "ordering": 1 + } + ], + "requestBody": { + "type": "none", + "parameters": [], + "jsonSchema": { + "type": "object", + "properties": {} + }, + "example": "", + "mediaType": "" + }, + "description": ":::info[Description]\nGet a single order by order id (including a stop order).\n:::", + "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Futures\",\"api-channel\":\"Private\",\"api-permission\":\"General\",\"api-rate-limit-pool\":\"Futures\",\"sdk-service\":\"Futures\",\"sdk-sub-service\":\"Order\",\"sdk-method-name\":\"getOrderByOrderId\",\"sdk-method-description\":\"Get a single order by order id (including a stop order).\",\"api-rate-limit\":5}" + } + }, + { + "name": "Get Order By ClientOid", + "api": { + "id": "3470352", + "method": "get", + "path": "/api/v1/orders/byClientOid", + "parameters": { + "query": [ + { + "required": false, + "description": "The user self-defined order id.", "type": "string", - "enable": true + "id": "hieQtTqErS", + "enable": true, + "name": "clientOid", + "example": "5c52e11203aa677f33e493fb" } ], + "path": [], "cookie": [], "header": [] }, "responses": [ { - "id": "10404", + "id": "10576", "code": 200, - "name": "成功", + "name": "OK", "headers": [], "jsonSchema": { "type": "object", @@ -29942,12 +29779,322 @@ "data": { "type": "object", "properties": { + "id": { + "type": "string", + "description": "Order ID" + }, + "symbol": { + "type": "string", + "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](apidog://link/endpoint/3470220) " + }, + "type": { + "type": "string", + "description": "Order type, market order or limit order", + "enum": [ + "market", + "limit" + ], + "x-api-enum": [ + { + "value": "market", + "name": "market", + "description": "Market Order" + }, + { + "value": "limit", + "name": "limit", + "description": "Limit Order" + } + ] + }, + "side": { + "type": "string", + "description": "Transaction side", + "enum": [ + "buy", + "sell" + ], + "x-api-enum": [ + { + "value": "buy", + "name": "buy", + "description": "buy" + }, + { + "value": "sell", + "name": "sell", + "description": "sell" + } + ] + }, + "price": { + "type": "string", + "description": "Order price" + }, + "size": { + "type": "integer", + "description": "Order quantity" + }, + "value": { + "type": "string", + "description": "Order value\n" + }, + "dealValue": { + "type": "string", + "description": "Executed size of funds\n" + }, + "dealSize": { + "type": "integer", + "description": "Executed quantity\n" + }, + "stp": { + "type": "string", + "description": "[Self Trade Prevention](apidog://link/pages/338146) is divided into these strategies: CN, CO, CB. Not supported DC at the moment.", + "enum": [ + "", + "CN", + "CO", + "CB" + ], + "x-api-enum": [ + { + "value": "", + "name": "NULL", + "description": "None" + }, + { + "value": "CN", + "name": "CN", + "description": "Cancel new, Cancel the new order" + }, + { + "value": "CO", + "name": "CO", + "description": "Cancel old, Cancel the old order" + }, + { + "value": "CB", + "name": "CB", + "description": "Cancel both, Cancel both sides" + } + ] + }, + "stop": { + "type": "string", + "description": "Stop order type (stop limit or stop market)\n" + }, + "stopPriceType": { + "type": "string", + "description": "Trigger price type of stop orders", + "enum": [ + "", + "TP", + "MP", + "IP" + ], + "x-api-enum": [ + { + "value": "", + "name": "NULL", + "description": "None" + }, + { + "value": "TP", + "name": "trade price", + "description": "TP for trade price, The last trade price is the last price at which an order was filled. This price can be found in the latest match message." + }, + { + "value": "MP", + "name": "mark price", + "description": "MP for mark price, The mark price can be obtained through relevant OPEN API for index services" + }, + { + "value": "IP", + "name": "index price", + "description": "IP for index price, The index price can be obtained through relevant OPEN API for index services" + } + ] + }, + "stopTriggered": { + "type": "boolean", + "description": "Mark to show whether the stop order is triggered" + }, + "stopPrice": { + "type": "number", + "description": "Trigger price of stop orders" + }, + "timeInForce": { + "type": "string", + "description": "Time in force policy type\n" + }, + "postOnly": { + "type": "boolean", + "description": "Mark of post only\n" + }, + "hidden": { + "type": "boolean", + "description": "Mark of the hidden order\n" + }, + "iceberg": { + "type": "boolean", + "description": "Mark of the iceberg order\n" + }, + "leverage": { + "type": "string", + "description": "Leverage of the order\n" + }, + "forceHold": { + "type": "boolean", + "description": "A mark to forcely hold the funds for an order\n" + }, + "closeOrder": { + "type": "boolean", + "description": "A mark to close the position\n" + }, + "visibleSize": { + "type": "integer", + "description": "Visible size of the iceberg order\n" + }, "clientOid": { - "type": "string" + "type": "string", + "description": "Unique order id created by users to identify their orders\n" + }, + "remark": { + "type": "string", + "description": "Remark" + }, + "tags": { + "type": "string", + "description": "tag order source\n" + }, + "isActive": { + "type": "boolean", + "description": "Mark of the active orders\n" + }, + "cancelExist": { + "type": "boolean", + "description": "Mark of the canceled orders\n" + }, + "createdAt": { + "type": "integer", + "description": "Time the order created\n", + "format": "int64" + }, + "updatedAt": { + "type": "integer", + "description": "last update time\n", + "format": "int64" + }, + "endAt": { + "type": "integer", + "description": "Order Endtime", + "format": "int64" + }, + "orderTime": { + "type": "integer", + "description": "Order create time in nanosecond\n", + "format": "int64" + }, + "settleCurrency": { + "type": "string", + "description": "settlement currency\n" + }, + "marginMode": { + "type": "string", + "description": "Margin mode: ISOLATED (isolated), CROSS (cross margin).\n", + "enum": [ + "CROSS", + "ISOLATED" + ], + "x-api-enum": [ + { + "value": "CROSS", + "name": "CROSS", + "description": "Cross margin" + }, + { + "value": "ISOLATED", + "name": "ISOLATED", + "description": "Isolated margin" + } + ] + }, + "avgDealPrice": { + "type": "string", + "description": "Average transaction price, forward contract average transaction price = sum (transaction value) / sum (transaction quantity), reverse contract average transaction price = sum (transaction quantity) / sum (transaction value). Transaction quantity = lots * multiplier\n" + }, + "filledSize": { + "type": "integer", + "description": "Value of the executed orders\n" + }, + "filledValue": { + "type": "string", + "description": "Executed order quantity\n" + }, + "status": { + "type": "string", + "description": "order status: “open” or “done”\n", + "enum": [ + "open", + "done" + ], + "x-api-enum": [ + { + "value": "open", + "name": "open", + "description": "open order" + }, + { + "value": "done", + "name": "done", + "description": "done order" + } + ] + }, + "reduceOnly": { + "type": "boolean", + "description": "A mark to reduce the position size only\n" } }, "required": [ - "clientOid" + "id", + "symbol", + "type", + "side", + "price", + "size", + "value", + "dealValue", + "dealSize", + "stp", + "stop", + "stopPriceType", + "stopTriggered", + "stopPrice", + "timeInForce", + "postOnly", + "hidden", + "iceberg", + "leverage", + "forceHold", + "closeOrder", + "visibleSize", + "clientOid", + "remark", + "tags", + "isActive", + "cancelExist", + "createdAt", + "updatedAt", + "endAt", + "orderTime", + "settleCurrency", + "marginMode", + "avgDealPrice", + "filledSize", + "filledValue", + "status", + "reduceOnly" ] } }, @@ -29964,8 +30111,8 @@ "responseExamples": [ { "name": "Success", - "data": "{\n \"code\": \"200000\",\n \"data\": {\n \"clientOid\": \"017485b0-2957-4681-8a14-5d46b35aee0d\"\n }\n}", - "responseId": 10404, + "data": "{\r\n \"code\": \"200000\",\r\n \"data\": {\r\n \"id\": \"250444645610336256\",\r\n \"symbol\": \"XRPUSDTM\",\r\n \"type\": \"limit\",\r\n \"side\": \"buy\",\r\n \"price\": \"0.1\",\r\n \"size\": 1,\r\n \"value\": \"1\",\r\n \"dealValue\": \"0\",\r\n \"dealSize\": 0,\r\n \"stp\": \"\",\r\n \"stop\": \"\",\r\n \"stopPriceType\": \"\",\r\n \"stopTriggered\": false,\r\n \"stopPrice\": null,\r\n \"timeInForce\": \"GTC\",\r\n \"postOnly\": false,\r\n \"hidden\": false,\r\n \"iceberg\": false,\r\n \"leverage\": \"3\",\r\n \"forceHold\": false,\r\n \"closeOrder\": false,\r\n \"visibleSize\": 0,\r\n \"clientOid\": \"5c52e11203aa677f33e493fb\",\r\n \"remark\": null,\r\n \"tags\": \"\",\r\n \"isActive\": true,\r\n \"cancelExist\": false,\r\n \"createdAt\": 1732523858568,\r\n \"updatedAt\": 1732523858568,\r\n \"endAt\": null,\r\n \"orderTime\": 1732523858550892322,\r\n \"settleCurrency\": \"USDT\",\r\n \"marginMode\": \"ISOLATED\",\r\n \"avgDealPrice\": \"0\",\r\n \"filledSize\": 0,\r\n \"filledValue\": \"0\",\r\n \"status\": \"open\",\r\n \"reduceOnly\": false\r\n }\r\n}", + "responseId": 10576, "ordering": 1 } ], @@ -29979,140 +30126,152 @@ "example": "", "mediaType": "" }, - "description": ":::info[Description]\nCancel an order (including a stop order).\n\nYou will receive success message once the system has received the cancellation request. The cancellation request will be processed by matching engine in sequence. To know if the request has been processed, you may check the order status or update message from the pushes.\n\nResponse the ID created by the client (clientOid).\n\nIf the order can not be canceled (already filled or previously canceled, etc), then an error response will indicate the reason in the message field.\n:::\n\n**API KEY PERMISSIONS**\nThis endpoint requires the Futures Trading permission.\n\n**REQUEST URL**\nThis endpoint support Futures URL", - "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Futures\",\"api-channel\":\"Private\",\"api-permission\":\"Futures\",\"api-rate-limit-pool\":\"Futures\",\"sdk-service\":\"Futures\",\"sdk-sub-service\":\"Order\",\"sdk-method-name\":\"cancelOrderByClientOid\",\"sdk-method-description\":\"Cancel order by client defined orderId.\",\"api-rate-limit\":1}" + "description": ":::info[Description]\nGet a single order by client order id (including a stop order).\n:::", + "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Futures\",\"api-channel\":\"Private\",\"api-permission\":\"General\",\"api-rate-limit-pool\":\"Futures\",\"sdk-service\":\"Futures\",\"sdk-sub-service\":\"Order\",\"sdk-method-name\":\"getOrderByClientOid\",\"sdk-method-description\":\"Get a single order by client order id (including a stop order).\",\"api-rate-limit\":5}" } }, { - "name": "Batch Cancel Orders", + "name": "Get Order List", "api": { - "id": "3470241", - "method": "delete", - "path": "/api/v1/orders/multi-cancel", + "id": "3470244", + "method": "get", + "path": "/api/v1/orders", "parameters": { - "query": [], - "path": [], - "cookie": [], - "header": [] - }, - "responses": [ - { - "id": "10405", - "code": 200, - "name": "成功", - "headers": [], - "jsonSchema": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "data": { - "type": "array", - "items": { - "type": "object", - "properties": { - "orderId": { - "type": "string" - }, - "clientOid": { - "type": "string" - }, - "code": { - "type": "string" - }, - "msg": { - "type": "string" - } - }, - "required": [ - "orderId", - "clientOid", - "code", - "msg" - ] + "query": [ + { + "id": "2KbksGFfyd", + "name": "status", + "required": true, + "description": "active or done, done as default. Only list orders for a specific status", + "example": "done", + "type": "string", + "schema": { + "type": "string", + "enum": [ + "active", + "done" + ], + "x-api-enum": [ + { + "value": "active", + "name": "", + "description": "" + }, + { + "value": "done", + "name": "", + "description": "" } - } + ] }, - "required": [ - "code", - "data" - ] + "enable": true + }, + { + "id": "4wXlXiQszi", + "name": "symbol", + "required": false, + "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](apidog://link/endpoint/3470220) ", + "type": "string", + "enable": true + }, + { + "id": "uaSHeFQTjq", + "name": "side", + "required": true, + "description": "buy or sell", + "type": "string", + "schema": { + "type": "string", + "enum": [ + "buy", + "sell" + ], + "x-api-enum": [ + { + "value": "buy", + "name": "", + "description": "" + }, + { + "value": "sell", + "name": "", + "description": "" + } + ] + }, + "enable": true + }, + { + "id": "WUcubn1a2F", + "name": "type", + "required": true, + "description": "limit, market, limit_stop or market_stop", + "type": "string", + "schema": { + "type": "string", + "enum": [ + "limit", + "market" + ], + "x-api-enum": [ + { + "value": "limit", + "name": "", + "description": "" + }, + { + "value": "market", + "name": "", + "description": "" + } + ] + }, + "enable": true + }, + { + "id": "92p8ibIf57", + "name": "startAt", + "required": false, + "description": "Start time (milisecond)", + "type": "integer", + "schema": { + "type": "integer", + "format": "int64" + }, + "enable": true + }, + { + "id": "xa3hJqPSIi", + "name": "endAt", + "required": false, + "description": "End time (milisecond)", + "type": "integer", + "schema": { + "type": "integer", + "format": "int64" + }, + "enable": true }, - "description": "", - "contentType": "json", - "mediaType": "" - } - ], - "responseExamples": [ - { - "name": "Success", - "data": "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"orderId\": \"250445104152670209\",\n \"clientOid\": null,\n \"code\": \"200\",\n \"msg\": \"success\"\n },\n {\n \"orderId\": \"250445181751463936\",\n \"clientOid\": null,\n \"code\": \"200\",\n \"msg\": \"success\"\n }\n ]\n}\n\n//{\n// \"code\": \"200000\",\n// \"data\": [\n// {\n// \"orderId\": null,\n// \"clientOid\": \"5c52e11203aa1677f133e493fb\",\n// \"code\": \"200\",\n// \"msg\": \"success\"\n// },\n// {\n// \"orderId\": null,\n// \"clientOid\": \"5c52214e112\",\n// \"code\": \"200\",\n// \"msg\": \"success\"\n// }\n// ]\n//}", - "responseId": 10405, - "ordering": 1 - } - ], - "requestBody": { - "type": "application/json", - "parameters": [], - "jsonSchema": { - "type": "object", - "properties": { - "orderIdsList": { - "type": "array", - "items": { - "type": "string" - }, - "description": "the list of orderId" + { + "id": "1CHlZrEtu0", + "name": "currentPage", + "required": true, + "description": "Current request page, The default currentPage is 1", + "type": "integer", + "schema": { + "type": "integer" }, - "clientOidsList": { - "type": "array", - "items": { - "type": "object", - "properties": { - "symbol": { - "type": "string", - "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](apidog://link/endpoint/3470220) " - }, - "clientOid": { - "type": "string" - } - }, - "required": [ - "symbol", - "clientOid" - ] - }, - "description": "the list of client orderId" - } + "enable": true }, - "required": [ - "orderIdsList", - "clientOidsList" - ] - }, - "example": "{\n \"orderIdsList\":\n [\n \"250445104152670209\",\n \"250445181751463936\"\n ]\n}\n\n\n//{\n// \"clientOidsList\":\n// [\n// {\n// \"symbol\": \"XRPUSDTM\",\n// \"clientOid\": \"5c52e11203aa1677f133e493fb\"\n// },\n// {\n// \"symbol\": \"ETHUSDTM\",\n// \"clientOid\": \"5c52214e112\"\n// }\n// ]\n//}\n", - "mediaType": "" - }, - "description": ":::info[Description]\nUsing this endpoint, orders can be canceled in batches, If there are both normal orders and conditional orders with the same clientOid (it is not recommended to use the same clientOrderId), when cancelling orders in batches by clientOid, normal orders will be canceled and conditional orders will be retained.\n\nSupports batch cancellation of orders by orderId or clientOid. When orderIdsList and clientOidsList are used at the same time, orderIdsList shall prevail. A maximum of 10 orders can be canceled at a time.\n\nWhen using orderId to cancel order, the response will return the orderId.\nWhen using clientOid to cancel order, the response will return the clientOid.\n:::", - "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Futures\",\"api-channel\":\"Private\",\"api-permission\":\"Futures\",\"api-rate-limit-pool\":\"Futures\",\"sdk-service\":\"Futures\",\"sdk-sub-service\":\"Order\",\"sdk-method-name\":\"batchCancelOrders\",\"sdk-method-description\":\"Cancel a bach of orders by client defined orderId or system generated orderId\",\"api-rate-limit\":20}" - } - }, - { - "name": "Cancel All Orders", - "api": { - "id": "3470242", - "method": "delete", - "path": "/api/v3/orders", - "parameters": { - "query": [ { - "id": "2KbksGFfyd", - "name": "symbol", + "id": "nlqXQHDnh5", + "name": "pageSize", "required": true, - "description": "Cancel all limit orders for a specific contract only, If not specified, all the limit orders will be deleted, Please refer to [Get Symbol endpoint: symbol](apidog://link/endpoint/3470220) ", - "example": "XBTUSDTM", - "type": "string", + "description": "pageSize, The default pageSize is 50, The maximum cannot exceed 1000", + "type": "integer", + "schema": { + "type": "integer" + }, "enable": true } ], @@ -30122,7 +30281,7 @@ }, "responses": [ { - "id": "10406", + "id": "10408", "code": 200, "name": "成功", "headers": [], @@ -30135,16 +30294,231 @@ "data": { "type": "object", "properties": { - "cancelledOrderIds": { + "currentPage": { + "type": "integer", + "description": "Current request page, The default currentPage is 1" + }, + "pageSize": { + "type": "integer", + "description": "pageSize, The default pageSize is 50, The maximum cannot exceed 1000" + }, + "totalNum": { + "type": "integer" + }, + "totalPage": { + "type": "integer" + }, + "items": { "type": "array", "items": { - "type": "string" - }, - "description": "Unique ID of the cancelled order" + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Order ID" + }, + "symbol": { + "type": "string", + "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](apidog://link/endpoint/3470220) " + }, + "type": { + "type": "string", + "description": "Order type, market order or limit order\n" + }, + "side": { + "type": "string", + "description": "Transaction side" + }, + "price": { + "type": "string", + "description": "Order price" + }, + "size": { + "type": "integer", + "description": "Order quantity" + }, + "value": { + "type": "string", + "description": "Order value" + }, + "dealValue": { + "type": "string", + "description": "Executed size of funds\n" + }, + "dealSize": { + "type": "integer", + "description": "Executed quantity" + }, + "stp": { + "type": "string", + "description": "self trade prevention" + }, + "stop": { + "type": "string", + "description": "Stop order type (stop limit or stop market)" + }, + "stopPriceType": { + "type": "string", + "description": "Trigger price type of stop orders" + }, + "stopTriggered": { + "type": "boolean", + "description": "Mark to show whether the stop order is triggered" + }, + "stopPrice": { + "type": "integer", + "description": "Trigger price of stop orders" + }, + "timeInForce": { + "type": "string", + "description": "Time in force policy type" + }, + "postOnly": { + "type": "boolean", + "description": "Mark of post only" + }, + "hidden": { + "type": "boolean", + "description": "Mark of the hidden order" + }, + "iceberg": { + "type": "boolean", + "description": "Mark of the iceberg order" + }, + "leverage": { + "type": "string", + "description": "Leverage of the order" + }, + "forceHold": { + "type": "boolean", + "description": "A mark to forcely hold the funds for an order" + }, + "closeOrder": { + "type": "boolean", + "description": "A mark to close the position" + }, + "visibleSize": { + "type": "integer", + "description": "Visible size of the iceberg order" + }, + "clientOid": { + "type": "string", + "description": "Unique order id created by users to identify their orders" + }, + "remark": { + "type": "string", + "description": "Remark of the order" + }, + "tags": { + "type": "string", + "description": "tag order source" + }, + "isActive": { + "type": "boolean", + "description": "Mark of the active orders" + }, + "cancelExist": { + "type": "boolean", + "description": "Mark of the canceled orders" + }, + "createdAt": { + "type": "integer", + "description": "Time the order created", + "format": "int64" + }, + "updatedAt": { + "type": "integer", + "description": "last update time", + "format": "int64" + }, + "endAt": { + "type": "integer", + "description": "End time", + "format": "int64" + }, + "orderTime": { + "type": "integer", + "description": "Order create time in nanosecond", + "format": "int64" + }, + "settleCurrency": { + "type": "string", + "description": "settlement currency" + }, + "marginMode": { + "type": "string", + "description": "Margin mode: ISOLATED (isolated), CROSS (cross margin)." + }, + "avgDealPrice": { + "type": "string", + "description": "Average transaction price, forward contract average transaction price = sum (transaction value) / sum (transaction quantity), reverse contract average transaction price = sum (transaction quantity) / sum (transaction value). Transaction quantity = lots * multiplier" + }, + "status": { + "type": "string", + "description": "order status: “open” or “done”" + }, + "filledSize": { + "type": "integer", + "description": "Value of the executed orders" + }, + "filledValue": { + "type": "string", + "description": "Executed order quantity" + }, + "reduceOnly": { + "type": "boolean", + "description": "A mark to reduce the position size only" + } + }, + "required": [ + "id", + "symbol", + "type", + "side", + "price", + "size", + "value", + "dealValue", + "dealSize", + "stp", + "stop", + "stopPriceType", + "stopTriggered", + "stopPrice", + "timeInForce", + "postOnly", + "hidden", + "iceberg", + "leverage", + "forceHold", + "closeOrder", + "visibleSize", + "clientOid", + "remark", + "tags", + "isActive", + "cancelExist", + "createdAt", + "updatedAt", + "endAt", + "orderTime", + "settleCurrency", + "marginMode", + "avgDealPrice", + "status", + "filledSize", + "filledValue", + "reduceOnly" + ] + } } }, "required": [ - "cancelledOrderIds" + "currentPage", + "pageSize", + "totalNum", + "totalPage", + "items" ] } }, @@ -30161,8 +30535,8 @@ "responseExamples": [ { "name": "Success", - "data": "{\n \"code\": \"200000\",\n \"data\": {\n \"cancelledOrderIds\": [\n \"235919172150824960\",\n \"235919172150824961\"\n ]\n }\n}", - "responseId": 10406, + "data": "{\n \"code\": \"200000\",\n \"data\": {\n \"currentPage\": 1,\n \"pageSize\": 50,\n \"totalNum\": 1,\n \"totalPage\": 1,\n \"items\": [\n {\n \"id\": \"230181737576050688\",\n \"symbol\": \"PEOPLEUSDTM\",\n \"type\": \"limit\",\n \"side\": \"buy\",\n \"price\": \"0.05\",\n \"size\": 10,\n \"value\": \"5\",\n \"dealValue\": \"0\",\n \"dealSize\": 0,\n \"stp\": \"\",\n \"stop\": \"\",\n \"stopPriceType\": \"\",\n \"stopTriggered\": false,\n \"stopPrice\": null,\n \"timeInForce\": \"GTC\",\n \"postOnly\": false,\n \"hidden\": false,\n \"iceberg\": false,\n \"leverage\": \"1\",\n \"forceHold\": false,\n \"closeOrder\": false,\n \"visibleSize\": 0,\n \"clientOid\": \"5a80bd847f1811ef8a7faa665a37b3d7\",\n \"remark\": null,\n \"tags\": \"\",\n \"isActive\": true,\n \"cancelExist\": false,\n \"createdAt\": 1727692804813,\n \"updatedAt\": 1727692804813,\n \"endAt\": null,\n \"orderTime\": 1727692804808418000,\n \"settleCurrency\": \"USDT\",\n \"marginMode\": \"ISOLATED\",\n \"avgDealPrice\": \"0\",\n \"filledSize\": 0,\n \"filledValue\": \"0\",\n \"status\": \"open\",\n \"reduceOnly\": false\n }\n ]\n }\n}", + "responseId": 10408, "ordering": 1 } ], @@ -30176,23 +30550,23 @@ "example": "", "mediaType": "" }, - "description": ":::info[Description]\nUsing this endpoint, all open orders (excluding stop orders) can be canceled in batches.\n\nThe response is a list of orderIDs of the canceled orders.\n:::\n", - "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Futures\",\"api-channel\":\"Private\",\"api-permission\":\"Futures\",\"api-rate-limit-pool\":\"Futures\",\"sdk-service\":\"Futures\",\"sdk-sub-service\":\"Order\",\"sdk-method-name\":\"cancelAllOrdersV3\",\"sdk-method-description\":\"Cancel all open orders (excluding stop orders). The response is a list of orderIDs of the canceled orders.\",\"api-rate-limit\":30}" + "description": ":::info[Description]\nList your current orders.\n\nAny limit order on the exchange order book is in active status. Orders removed from the order book will be marked with done status. After an order becomes done, there may be a few milliseconds latency before it’s fully settled.\n\nYou can check the orders in any status. If the status parameter is not specified, orders of done status will be returned by default.\n\nWhen you query orders in active status, there is no time limit. However, when you query orders in done status, the start and end time range cannot exceed 24 * 7 hours. An error will occur if the specified time window exceeds the range. If you specify the end time only, the system will automatically calculate the start time as end time minus 24 hours, and vice versa.\n\n**POLLING**\nFor high-volume trading, it is highly recommended that you maintain your own list of open orders and use one of the streaming market data feeds to keep it updated. You should poll the open orders endpoint to obtain the current state of any open order.\n\nIf you need to get your recent trade history with low latency, you may query the endpoint Get List of Orders Completed in 24h.\n:::\n\n**API KEY PERMISSIONS**\nThis endpoint requires the General permission.\n\n**REQUEST URL**\nThis endpoint support Futures URL\n\n**REQUEST RATE LIMIT**\nFutures weight:2", + "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Futures\",\"api-channel\":\"Private\",\"api-permission\":\"Futures\",\"api-rate-limit-pool\":\"Futures\",\"sdk-service\":\"Futures\",\"sdk-sub-service\":\"Order\",\"sdk-method-name\":\"GetOrderList\",\"sdk-method-description\":\"List your current orders.\",\"api-rate-limit\":2}" } }, { - "name": "Cancel All Stop orders", + "name": "Get Recent Closed Orders", "api": { - "id": "3470243", - "method": "delete", - "path": "/api/v1/stopOrders", + "id": "3470246", + "method": "get", + "path": "/api/v1/recentDoneOrders", "parameters": { "query": [ { - "id": "2KbksGFfyd", + "id": "4wXlXiQszi", "name": "symbol", "required": false, - "description": "Cancel all limit orders for a specific contract only, If not specified, all the limit orders will be deleted, Please refer to [Get Symbol endpoint: symbol](apidog://link/endpoint/3470220) ", + "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](apidog://link/endpoint/3470220) ", "example": "XBTUSDTM", "type": "string", "enable": true @@ -30204,7 +30578,7 @@ }, "responses": [ { - "id": "10407", + "id": "10410", "code": 200, "name": "成功", "headers": [], @@ -30215,19 +30589,208 @@ "type": "string" }, "data": { - "type": "object", - "properties": { - "cancelledOrderIds": { - "type": "array", - "items": { - "type": "string" + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Order ID" }, - "description": "Unique ID of the cancelled order" - } - }, - "required": [ - "cancelledOrderIds" - ] + "symbol": { + "type": "string", + "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](apidog://link/endpoint/3470220) " + }, + "type": { + "type": "string", + "description": "Order type, market order or limit order" + }, + "side": { + "type": "string", + "description": "Transaction side" + }, + "price": { + "type": "string", + "description": "Order price" + }, + "size": { + "type": "integer", + "description": "Order quantity" + }, + "value": { + "type": "string", + "description": "Order value\n" + }, + "dealValue": { + "type": "string", + "description": "Executed size of funds\n" + }, + "dealSize": { + "type": "integer", + "description": "Executed quantity\n" + }, + "stp": { + "type": "string", + "description": "self trade prevention" + }, + "stop": { + "type": "string", + "description": "Stop order type (stop limit or stop market)\n" + }, + "stopPriceType": { + "type": "string", + "description": "Trigger price type of stop orders\n" + }, + "stopTriggered": { + "type": "boolean", + "description": "Mark to show whether the stop order is triggered" + }, + "stopPrice": { + "type": "integer", + "description": "Trigger price of stop orders\n" + }, + "timeInForce": { + "type": "string", + "description": "Time in force policy type\n" + }, + "postOnly": { + "type": "boolean", + "description": "Mark of post only\n" + }, + "hidden": { + "type": "boolean", + "description": "Mark of the hidden order\n" + }, + "iceberg": { + "type": "boolean", + "description": "Mark of the iceberg order\n" + }, + "leverage": { + "type": "string", + "description": "Leverage of the order\n" + }, + "forceHold": { + "type": "boolean", + "description": "A mark to forcely hold the funds for an order\n" + }, + "closeOrder": { + "type": "boolean", + "description": "A mark to close the position\n" + }, + "visibleSize": { + "type": "integer", + "description": "Visible size of the iceberg order\n" + }, + "clientOid": { + "type": "string", + "description": "Unique order id created by users to identify their orders\n" + }, + "remark": { + "type": "string", + "description": "Remark of the order\n" + }, + "tags": { + "type": "string", + "description": "tag order source\n" + }, + "isActive": { + "type": "boolean", + "description": "Mark of the active orders\n" + }, + "cancelExist": { + "type": "boolean", + "description": "Mark of the canceled orders\n" + }, + "createdAt": { + "type": "integer", + "description": "Time the order created\n", + "format": "int64" + }, + "updatedAt": { + "type": "integer", + "description": "last update time\n", + "format": "int64" + }, + "endAt": { + "type": "integer", + "description": "End time\n", + "format": "int64" + }, + "orderTime": { + "type": "integer", + "description": "Order create time in nanosecond\n", + "format": "int64" + }, + "settleCurrency": { + "type": "string", + "description": "settlement currency\n" + }, + "marginMode": { + "type": "string", + "description": "Margin mode: ISOLATED (isolated), CROSS (cross margin).\n" + }, + "avgDealPrice": { + "type": "string", + "description": "Average transaction price, forward contract average transaction price = sum (transaction value) / sum (transaction quantity), reverse contract average transaction price = sum (transaction quantity) / sum (transaction value). Transaction quantity = lots * multiplier\n" + }, + "filledSize": { + "type": "integer", + "description": "Value of the executed orders\n" + }, + "filledValue": { + "type": "string", + "description": "Executed order quantity\n" + }, + "status": { + "type": "string", + "description": "order status: “open” or “done”\n" + }, + "reduceOnly": { + "type": "boolean", + "description": "A mark to reduce the position size only\n" + } + }, + "required": [ + "id", + "symbol", + "type", + "side", + "price", + "size", + "value", + "dealValue", + "dealSize", + "stp", + "stop", + "stopPriceType", + "stopTriggered", + "stopPrice", + "timeInForce", + "postOnly", + "hidden", + "iceberg", + "leverage", + "forceHold", + "closeOrder", + "visibleSize", + "clientOid", + "remark", + "tags", + "isActive", + "cancelExist", + "createdAt", + "updatedAt", + "endAt", + "orderTime", + "settleCurrency", + "marginMode", + "avgDealPrice", + "filledSize", + "filledValue", + "status", + "reduceOnly" + ] + } } }, "required": [ @@ -30243,8 +30806,8 @@ "responseExamples": [ { "name": "Success", - "data": "{\n \"code\": \"200000\",\n \"data\": {\n \"cancelledOrderIds\": [\n \"235919172150824960\",\n \"235919172150824961\"\n ]\n }\n}", - "responseId": 10407, + "data": "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"id\": \"236387137732231168\",\n \"symbol\": \"XRPUSDTM\",\n \"type\": \"market\",\n \"side\": \"buy\",\n \"price\": \"0\",\n \"size\": 1,\n \"value\": \"5.51\",\n \"dealValue\": \"5.511\",\n \"dealSize\": 1,\n \"stp\": \"\",\n \"stop\": \"\",\n \"stopPriceType\": \"\",\n \"stopTriggered\": false,\n \"stopPrice\": null,\n \"timeInForce\": \"GTC\",\n \"postOnly\": false,\n \"hidden\": false,\n \"iceberg\": false,\n \"leverage\": \"10.0\",\n \"forceHold\": false,\n \"closeOrder\": false,\n \"visibleSize\": 0,\n \"clientOid\": \"16698fe6-2746-4aeb-a7fa-61f633ab6090\",\n \"remark\": null,\n \"tags\": \"\",\n \"isActive\": false,\n \"cancelExist\": false,\n \"createdAt\": 1729172287496,\n \"updatedAt\": 1729172287568,\n \"endAt\": 1729172287568,\n \"orderTime\": 1729172287496950800,\n \"settleCurrency\": \"USDT\",\n \"marginMode\": \"ISOLATED\",\n \"avgDealPrice\": \"0.5511\",\n \"filledSize\": 1,\n \"filledValue\": \"5.511\",\n \"status\": \"done\",\n \"reduceOnly\": false\n },\n {\n \"id\": \"236317213710184449\",\n \"symbol\": \"XBTUSDTM\",\n \"type\": \"market\",\n \"side\": \"buy\",\n \"price\": \"0\",\n \"size\": 1,\n \"value\": \"67.4309\",\n \"dealValue\": \"67.4309\",\n \"dealSize\": 1,\n \"stp\": \"\",\n \"stop\": \"\",\n \"stopPriceType\": \"\",\n \"stopTriggered\": false,\n \"stopPrice\": null,\n \"timeInForce\": \"GTC\",\n \"postOnly\": false,\n \"hidden\": false,\n \"iceberg\": false,\n \"leverage\": \"3\",\n \"forceHold\": false,\n \"closeOrder\": false,\n \"visibleSize\": 0,\n \"clientOid\": \"5c52e11203aa677f33e493fb\",\n \"remark\": null,\n \"tags\": \"\",\n \"isActive\": false,\n \"cancelExist\": false,\n \"createdAt\": 1729155616310,\n \"updatedAt\": 1729155616324,\n \"endAt\": 1729155616324,\n \"orderTime\": 1729155616310180400,\n \"settleCurrency\": \"USDT\",\n \"marginMode\": \"ISOLATED\",\n \"avgDealPrice\": \"67430.9\",\n \"filledSize\": 1,\n \"filledValue\": \"67.4309\",\n \"status\": \"done\",\n \"reduceOnly\": false\n },\n {\n \"id\": \"236317094436728832\",\n \"symbol\": \"XBTUSDTM\",\n \"type\": \"market\",\n \"side\": \"buy\",\n \"price\": \"0\",\n \"size\": 1,\n \"value\": \"67.445\",\n \"dealValue\": \"67.445\",\n \"dealSize\": 1,\n \"stp\": \"\",\n \"stop\": \"\",\n \"stopPriceType\": \"\",\n \"stopTriggered\": false,\n \"stopPrice\": null,\n \"timeInForce\": \"GTC\",\n \"postOnly\": false,\n \"hidden\": false,\n \"iceberg\": false,\n \"leverage\": \"3\",\n \"forceHold\": false,\n \"closeOrder\": false,\n \"visibleSize\": 0,\n \"clientOid\": \"5c52e11203aa677f33e493fb\",\n \"remark\": null,\n \"tags\": \"\",\n \"isActive\": false,\n \"cancelExist\": false,\n \"createdAt\": 1729155587873,\n \"updatedAt\": 1729155587946,\n \"endAt\": 1729155587946,\n \"orderTime\": 1729155587873332000,\n \"settleCurrency\": \"USDT\",\n \"marginMode\": \"ISOLATED\",\n \"avgDealPrice\": \"67445.0\",\n \"filledSize\": 1,\n \"filledValue\": \"67.445\",\n \"status\": \"done\",\n \"reduceOnly\": false\n }\n ]\n}", + "responseId": 10410, "ordering": 1 } ], @@ -30255,61 +30818,34 @@ "type": "object", "properties": {} }, - "example": "{\n \"orderIdsList\":\n [\n \"80465574458560512\",\n \"80465575289094144\"\n ],\n \"clientOidsList\":\n [\n {\n \"symbol\": \"XBTUSDTM\",\n \"clientOid\": \"clientOid123\"\n },\n {\n \"symbol\": \"ETHUSDTM\",\n \"clientOid\": \"clientOid321\"\n }\n ]\n}", + "example": "", "mediaType": "" }, - "description": ":::info[Description]\nUsing this endpoint, all untriggered stop orders can be canceled in batches.\n\nSupports batch cancellation of untriggered stop orders by symbol. Cancel all all untriggered stop orders for a specific contract symbol only , If not specified, all the all untriggered stop orders will be canceled.\n:::", - "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Futures\",\"api-channel\":\"Private\",\"api-permission\":\"Futures\",\"api-rate-limit-pool\":\"Futures\",\"sdk-service\":\"Futures\",\"sdk-sub-service\":\"Order\",\"sdk-method-name\":\"cancelAllStopOrders\",\"sdk-method-description\":\"Cancel all untriggered stop orders. The response is a list of orderIDs of the canceled stop orders. To cancel triggered stop orders, please use 'Cancel Multiple Futures Limit orders'.\",\"api-rate-limit\":15}" + "description": ":::info[Description]\nGet a list of recent 1000 closed orders in the last 24 hours.\n\nIf you need to get your recent traded order history with low latency, you may query this endpoint.\n\n\nAny limit order on the exchange order book is in active status. Orders removed from the order book will be marked with done status. After an order becomes done, there may be a few milliseconds latency before it’s fully settled.\n\nYou can check the orders in any status. If the status parameter is not specified, orders of done status will be returned by default.\n\nWhen you query orders in active status, there is no time limit. However, when you query orders in done status, the start and end time range cannot exceed 24*7 hours. An error will occur if the specified time window exceeds the range. If you specify the end time only, the system will automatically calculate the start time as end time minus 24 hours, and vice versa.\n\n**POLLING**\nFor high-volume trading, it is highly recommended that you maintain your own list of open orders and use one of the streaming market data feeds to keep it updated. You should poll the open orders endpoint to obtain the current state of any open order.\n\nIf you need to get your recent trade history with low latency, you may query the endpoint Get List of Orders Completed in 24h.\n:::\n\n**API KEY PERMISSIONS**\nThis endpoint requires the General permission.\n\n**REQUEST URL**\nThis endpoint support Futures URL\n\n**REQUEST RATE LIMIT**\nFutures weight:2\n", + "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Futures\",\"api-channel\":\"Private\",\"api-permission\":\"Futures\",\"api-rate-limit-pool\":\"Futures\",\"sdk-service\":\"Futures\",\"sdk-sub-service\":\"Order\",\"sdk-method-name\":\"GetRecentClosedOrders\",\"sdk-method-description\":\"Get a list of recent 1000 closed orders in the last 24 hours. If you need to get your recent traded order history with low latency, you may query this endpoint.\",\"api-rate-limit\":5}" } }, { - "name": "Get Order List", + "name": "Get Stop Order List", "api": { - "id": "3470244", + "id": "3470247", "method": "get", - "path": "/api/v1/orders", + "path": "/api/v1/stopOrders", "parameters": { "query": [ - { - "id": "2KbksGFfyd", - "name": "status", - "required": true, - "description": "active or done, done as default. Only list orders for a specific status", - "example": "done", - "type": "string", - "schema": { - "type": "string", - "enum": [ - "active", - "done" - ], - "x-api-enum": [ - { - "value": "active", - "name": "", - "description": "" - }, - { - "value": "done", - "name": "", - "description": "" - } - ] - }, - "enable": true - }, { "id": "4wXlXiQszi", "name": "symbol", "required": false, "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](apidog://link/endpoint/3470220) ", + "example": "XBTUSDTM", "type": "string", "enable": true }, { "id": "uaSHeFQTjq", "name": "side", - "required": true, + "required": false, "description": "buy or sell", "type": "string", "schema": { @@ -30336,8 +30872,8 @@ { "id": "WUcubn1a2F", "name": "type", - "required": true, - "description": "limit, market, limit_stop or market_stop", + "required": false, + "description": "limit, market", "type": "string", "schema": { "type": "string", @@ -30387,7 +30923,7 @@ { "id": "1CHlZrEtu0", "name": "currentPage", - "required": true, + "required": false, "description": "Current request page, The default currentPage is 1", "type": "integer", "schema": { @@ -30398,11 +30934,13 @@ { "id": "nlqXQHDnh5", "name": "pageSize", - "required": true, + "required": false, "description": "pageSize, The default pageSize is 50, The maximum cannot exceed 1000", "type": "integer", "schema": { - "type": "integer" + "type": "integer", + "maximum": 1000, + "default": 50 }, "enable": true } @@ -30413,7 +30951,7 @@ }, "responses": [ { - "id": "10408", + "id": "10411", "code": 200, "name": "成功", "headers": [], @@ -30498,7 +31036,7 @@ "description": "Mark to show whether the stop order is triggered" }, "stopPrice": { - "type": "integer", + "type": "string", "description": "Trigger price of stop orders" }, "timeInForce": { @@ -30585,10 +31123,6 @@ "type": "string", "description": "Average transaction price, forward contract average transaction price = sum (transaction value) / sum (transaction quantity), reverse contract average transaction price = sum (transaction quantity) / sum (transaction value). Transaction quantity = lots * multiplier" }, - "status": { - "type": "string", - "description": "order status: “open” or “done”" - }, "filledSize": { "type": "integer", "description": "Value of the executed orders" @@ -30597,6 +31131,10 @@ "type": "string", "description": "Executed order quantity" }, + "status": { + "type": "string", + "description": "order status: “open” or “done”" + }, "reduceOnly": { "type": "boolean", "description": "A mark to reduce the position size only" @@ -30632,412 +31170,25 @@ "cancelExist", "createdAt", "updatedAt", - "endAt", - "orderTime", - "settleCurrency", - "marginMode", - "avgDealPrice", - "status", - "filledSize", - "filledValue", - "reduceOnly" - ] - } - } - }, - "required": [ - "currentPage", - "pageSize", - "totalNum", - "totalPage", - "items" - ] - } - }, - "required": [ - "code", - "data" - ] - }, - "description": "", - "contentType": "json", - "mediaType": "" - } - ], - "responseExamples": [ - { - "name": "Success", - "data": "{\n \"code\": \"200000\",\n \"data\": {\n \"currentPage\": 1,\n \"pageSize\": 50,\n \"totalNum\": 1,\n \"totalPage\": 1,\n \"items\": [\n {\n \"id\": \"230181737576050688\",\n \"symbol\": \"PEOPLEUSDTM\",\n \"type\": \"limit\",\n \"side\": \"buy\",\n \"price\": \"0.05\",\n \"size\": 10,\n \"value\": \"5\",\n \"dealValue\": \"0\",\n \"dealSize\": 0,\n \"stp\": \"\",\n \"stop\": \"\",\n \"stopPriceType\": \"\",\n \"stopTriggered\": false,\n \"stopPrice\": null,\n \"timeInForce\": \"GTC\",\n \"postOnly\": false,\n \"hidden\": false,\n \"iceberg\": false,\n \"leverage\": \"1\",\n \"forceHold\": false,\n \"closeOrder\": false,\n \"visibleSize\": 0,\n \"clientOid\": \"5a80bd847f1811ef8a7faa665a37b3d7\",\n \"remark\": null,\n \"tags\": \"\",\n \"isActive\": true,\n \"cancelExist\": false,\n \"createdAt\": 1727692804813,\n \"updatedAt\": 1727692804813,\n \"endAt\": null,\n \"orderTime\": 1727692804808418000,\n \"settleCurrency\": \"USDT\",\n \"marginMode\": \"ISOLATED\",\n \"avgDealPrice\": \"0\",\n \"filledSize\": 0,\n \"filledValue\": \"0\",\n \"status\": \"open\",\n \"reduceOnly\": false\n }\n ]\n }\n}", - "responseId": 10408, - "ordering": 1 - } - ], - "requestBody": { - "type": "none", - "parameters": [], - "jsonSchema": { - "type": "object", - "properties": {} - }, - "example": "", - "mediaType": "" - }, - "description": ":::info[Description]\nList your current orders.\n\nAny limit order on the exchange order book is in active status. Orders removed from the order book will be marked with done status. After an order becomes done, there may be a few milliseconds latency before it’s fully settled.\n\nYou can check the orders in any status. If the status parameter is not specified, orders of done status will be returned by default.\n\nWhen you query orders in active status, there is no time limit. However, when you query orders in done status, the start and end time range cannot exceed 24 * 7 hours. An error will occur if the specified time window exceeds the range. If you specify the end time only, the system will automatically calculate the start time as end time minus 24 hours, and vice versa.\n\n**POLLING**\nFor high-volume trading, it is highly recommended that you maintain your own list of open orders and use one of the streaming market data feeds to keep it updated. You should poll the open orders endpoint to obtain the current state of any open order.\n\nIf you need to get your recent trade history with low latency, you may query the endpoint Get List of Orders Completed in 24h.\n:::\n\n**API KEY PERMISSIONS**\nThis endpoint requires the General permission.\n\n**REQUEST URL**\nThis endpoint support Futures URL\n\n**REQUEST RATE LIMIT**\nFutures weight:2", - "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Futures\",\"api-channel\":\"Private\",\"api-permission\":\"Futures\",\"api-rate-limit-pool\":\"Futures\",\"sdk-service\":\"Futures\",\"sdk-sub-service\":\"Order\",\"sdk-method-name\":\"GetOrderList\",\"sdk-method-description\":\"List your current orders.\",\"api-rate-limit\":2}" - } - }, - { - "name": "Get Order By OrderId", - "api": { - "id": "3470245", - "method": "get", - "path": "/api/v1/orders/{order-id}", - "parameters": { - "query": [], - "path": [ - { - "id": "order-id#0", - "name": "order-id", - "required": true, - "description": "", - "example": "236655147005071361", - "type": "string", - "enable": true - } - ], - "cookie": [], - "header": [] - }, - "responses": [ - { - "id": "10409", - "code": 200, - "name": "成功", - "headers": [], - "jsonSchema": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "data": { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "Order ID" - }, - "symbol": { - "type": "string", - "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](apidog://link/endpoint/3470220) " - }, - "type": { - "type": "string", - "description": "Order type, market order or limit order", - "enum": [ - "market", - "limit" - ], - "x-api-enum": [ - { - "value": "market", - "name": "market", - "description": "Market Order" - }, - { - "value": "limit", - "name": "limit", - "description": "Limit Order" - } - ] - }, - "side": { - "type": "string", - "description": "Transaction side", - "enum": [ - "buy", - "sell" - ], - "x-api-enum": [ - { - "value": "buy", - "name": "buy", - "description": "buy" - }, - { - "value": "sell", - "name": "sell", - "description": "sell" - } - ] - }, - "price": { - "type": "string", - "description": "Order price" - }, - "size": { - "type": "integer", - "description": "Order quantity" - }, - "value": { - "type": "string", - "description": "Order value\n" - }, - "dealValue": { - "type": "string", - "description": "Executed size of funds\n" - }, - "dealSize": { - "type": "integer", - "description": "Executed quantity\n" - }, - "stp": { - "type": "string", - "description": "[Self Trade Prevention](apidog://link/pages/338146) is divided into these strategies: CN, CO, CB. Not supported DC at the moment.", - "enum": [ - "", - "CN", - "CO", - "CB" - ], - "x-api-enum": [ - { - "value": "", - "name": "NULL", - "description": "Null means not stp order" - }, - { - "value": "CN", - "name": "CN", - "description": "Cancel new, Cancel the new order" - }, - { - "value": "CO", - "name": "CO", - "description": "Cancel old, Cancel the old order" - }, - { - "value": "CB", - "name": "CB", - "description": "Cancel both, Cancel both sides" - } - ] - }, - "stop": { - "type": "string", - "description": "Stop order type (stop limit or stop market)\n" - }, - "stopPriceType": { - "type": "string", - "description": "Trigger price type of stop orders", - "enum": [ - "", - "TP", - "MP", - "IP" - ], - "x-api-enum": [ - { - "value": "", - "name": "NULL", - "description": "" - }, - { - "value": "TP", - "name": "trade price", - "description": "TP for trade price, The last trade price is the last price at which an order was filled. This price can be found in the latest match message." - }, - { - "value": "MP", - "name": "mark price", - "description": "MP for mark price, The mark price can be obtained through relevant OPEN API for index services" - }, - { - "value": "IP", - "name": "index price", - "description": "IP for index price, The index price can be obtained through relevant OPEN API for index services" - } - ] - }, - "stopTriggered": { - "type": "boolean", - "description": "Mark to show whether the stop order is triggered" - }, - "stopPrice": { - "type": "number", - "description": "Trigger price of stop orders" - }, - "timeInForce": { - "type": "string", - "description": "Time in force policy type\n" - }, - "postOnly": { - "type": "boolean", - "description": "Mark of post only\n" - }, - "hidden": { - "type": "boolean", - "description": "Mark of the hidden order\n" - }, - "iceberg": { - "type": "boolean", - "description": "Mark of the iceberg order\n" - }, - "leverage": { - "type": "string", - "description": "Leverage of the order\n" - }, - "forceHold": { - "type": "boolean", - "description": "A mark to forcely hold the funds for an order\n" - }, - "closeOrder": { - "type": "boolean", - "description": "A mark to close the position\n" - }, - "visibleSize": { - "type": "integer", - "description": "Visible size of the iceberg order\n" - }, - "clientOid": { - "type": "string", - "description": "Unique order id created by users to identify their orders\n" - }, - "remark": { - "type": "string", - "description": "Remark" - }, - "tags": { - "type": "string", - "description": "tag order source\n" - }, - "isActive": { - "type": "boolean", - "description": "Mark of the active orders\n" - }, - "cancelExist": { - "type": "boolean", - "description": "Mark of the canceled orders\n" - }, - "createdAt": { - "type": "integer", - "description": "Time the order created\n", - "format": "int64" - }, - "updatedAt": { - "type": "integer", - "description": "last update time\n", - "format": "int64" - }, - "endAt": { - "type": "integer", - "description": "Order Endtime", - "format": "int64" - }, - "orderTime": { - "type": "integer", - "description": "Order create time in nanosecond\n", - "format": "int64" - }, - "settleCurrency": { - "type": "string", - "description": "settlement currency\n" - }, - "marginMode": { - "type": "string", - "description": "Margin mode: ISOLATED (isolated), CROSS (cross margin).\n", - "enum": [ - "CROSS", - "ISOLATED" - ], - "x-api-enum": [ - { - "value": "CROSS", - "name": "CROSS", - "description": "Cross margin" - }, - { - "value": "ISOLATED", - "name": "ISOLATED", - "description": "Isolated margin" - } - ] - }, - "avgDealPrice": { - "type": "string", - "description": "Average transaction price, forward contract average transaction price = sum (transaction value) / sum (transaction quantity), reverse contract average transaction price = sum (transaction quantity) / sum (transaction value). Transaction quantity = lots * multiplier\n" - }, - "filledSize": { - "type": "integer", - "description": "Value of the executed orders\n" - }, - "filledValue": { - "type": "string", - "description": "Executed order quantity\n" - }, - "status": { - "type": "string", - "description": "order status: “open” or “done”\n", - "enum": [ - "open", - "done" - ], - "x-api-enum": [ - { - "value": "open", - "name": "open", - "description": "open order" - }, - { - "value": "done", - "name": "done", - "description": "done order" - } - ] - }, - "reduceOnly": { - "type": "boolean", - "description": "A mark to reduce the position size only\n" - } - }, - "required": [ - "id", - "symbol", - "type", - "side", - "price", - "size", - "value", - "dealValue", - "dealSize", - "stp", - "stop", - "stopPriceType", - "stopTriggered", - "stopPrice", - "timeInForce", - "postOnly", - "hidden", - "iceberg", - "leverage", - "forceHold", - "closeOrder", - "visibleSize", - "clientOid", - "remark", - "tags", - "isActive", - "cancelExist", - "createdAt", - "updatedAt", - "orderTime", - "settleCurrency", - "marginMode", - "avgDealPrice", - "filledSize", - "filledValue", - "status", - "reduceOnly" + "endAt", + "orderTime", + "settleCurrency", + "marginMode", + "avgDealPrice", + "filledSize", + "filledValue", + "status", + "reduceOnly" + ] + } + } + }, + "required": [ + "currentPage", + "pageSize", + "totalNum", + "totalPage", + "items" ] } }, @@ -31054,8 +31205,8 @@ "responseExamples": [ { "name": "Success", - "data": "{\n \"code\": \"200000\",\n \"data\": {\n \"id\": \"236655147005071361\",\n \"symbol\": \"XBTUSDTM\",\n \"type\": \"limit\",\n \"side\": \"buy\",\n \"price\": \"0.1\",\n \"size\": 1,\n \"value\": \"0.0001\",\n \"dealValue\": \"0\",\n \"dealSize\": 0,\n \"stp\": \"\",\n \"stop\": \"\",\n \"stopPriceType\": \"\",\n \"stopTriggered\": false,\n \"stopPrice\": null,\n \"timeInForce\": \"GTC\",\n \"postOnly\": false,\n \"hidden\": false,\n \"iceberg\": false,\n \"leverage\": \"3\",\n \"forceHold\": false,\n \"closeOrder\": false,\n \"visibleSize\": 0,\n \"clientOid\": \"5c52e11203aa677f33e493fb\",\n \"remark\": null,\n \"tags\": \"\",\n \"isActive\": true,\n \"cancelExist\": false,\n \"createdAt\": 1729236185949,\n \"updatedAt\": 1729236185949,\n \"endAt\": null,\n \"orderTime\": 1729236185885647952,\n \"settleCurrency\": \"USDT\",\n \"marginMode\": \"ISOLATED\",\n \"avgDealPrice\": \"0\",\n \"filledSize\": 0,\n \"filledValue\": \"0\",\n \"status\": \"open\",\n \"reduceOnly\": false\n }\n}", - "responseId": 10409, + "data": "{\n \"code\": \"200000\",\n \"data\": {\n \"currentPage\": 1,\n \"pageSize\": 50,\n \"totalNum\": 1,\n \"totalPage\": 1,\n \"items\": [\n {\n \"id\": \"230181737576050688\",\n \"symbol\": \"PEOPLEUSDTM\",\n \"type\": \"limit\",\n \"side\": \"buy\",\n \"price\": \"0.05\",\n \"size\": 10,\n \"value\": \"5\",\n \"dealValue\": \"0\",\n \"dealSize\": 0,\n \"stp\": \"\",\n \"stop\": \"\",\n \"stopPriceType\": \"\",\n \"stopTriggered\": false,\n \"stopPrice\": null,\n \"timeInForce\": \"GTC\",\n \"postOnly\": false,\n \"hidden\": false,\n \"iceberg\": false,\n \"leverage\": \"1\",\n \"forceHold\": false,\n \"closeOrder\": false,\n \"visibleSize\": 0,\n \"clientOid\": \"5a80bd847f1811ef8a7faa665a37b3d7\",\n \"remark\": null,\n \"tags\": \"\",\n \"isActive\": true,\n \"cancelExist\": false,\n \"createdAt\": 1727692804813,\n \"updatedAt\": 1727692804813,\n \"endAt\": null,\n \"orderTime\": 1727692804808418000,\n \"settleCurrency\": \"USDT\",\n \"marginMode\": \"ISOLATED\",\n \"avgDealPrice\": \"0\",\n \"filledSize\": 0,\n \"filledValue\": \"0\",\n \"status\": \"open\",\n \"reduceOnly\": false\n }\n ]\n }\n}", + "responseId": 10411, "ordering": 1 } ], @@ -31069,26 +31220,26 @@ "example": "", "mediaType": "" }, - "description": ":::info[Description]\nGet a single order by order id (including a stop order).\n:::", - "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Futures\",\"api-channel\":\"Private\",\"api-permission\":\"General\",\"api-rate-limit-pool\":\"Futures\",\"sdk-service\":\"Futures\",\"sdk-sub-service\":\"Order\",\"sdk-method-name\":\"getOrderByOrderId\",\"sdk-method-description\":\"Get a single order by order id (including a stop order).\",\"api-rate-limit\":5}" + "description": ":::info[Description]\nGet the un-triggered stop orders list. Stop orders that have been triggered can be queried through the general order interface\n:::\n\nAny limit order on the exchange order book is in active status. Orders removed from the order book will be marked with done status. After an order becomes done, there may be a few milliseconds latency before it’s fully settled.\n\nYou can check the orders in any status. If the status parameter is not specified, orders of done status will be returned by default.\n\nWhen you query orders in active status, there is no time limit. However, when you query orders in done status, the start and end time range cannot exceed 24*7 hours. An error will occur if the specified time window exceeds the range. If you specify the end time only, the system will automatically calculate the start time as end time minus 24 hours, and vice versa.\n\nPOLLING\nFor high-volume trading, it is highly recommended that you maintain your own list of open orders and use one of the streaming market data feeds to keep it updated. You should poll the open orders endpoint to obtain the current state of any open order.\n\nIf you need to get your recent trade history with low latency, you may query the endpoint Get List of Orders Completed in 24h.", + "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Futures\",\"api-channel\":\"Private\",\"api-permission\":\"Futures\",\"api-rate-limit-pool\":\"Futures\",\"sdk-service\":\"Futures\",\"sdk-sub-service\":\"Order\",\"sdk-method-name\":\"GetStopOrderList\",\"sdk-method-description\":\"Get the un-triggered stop orders list. Stop orders that have been triggered can be queried through the general order interface\",\"api-rate-limit\":6}" } }, { - "name": "Get Order By ClientOid", + "name": "Get Open Order Value", "api": { - "id": "3470352", + "id": "3470250", "method": "get", - "path": "/api/v1/orders/byClientOid", + "path": "/api/v1/openOrderStatistics", "parameters": { "query": [ { - "required": false, - "description": "The user self-defined order id.", + "id": "4wXlXiQszi", + "name": "symbol", + "required": true, + "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](apidog://link/endpoint/3470220) ", + "example": "XBTUSDTM", "type": "string", - "id": "hieQtTqErS", - "enable": true, - "name": "clientOid", - "example": "5c52e11203aa677f33e493fb" + "enable": true } ], "path": [], @@ -31097,9 +31248,9 @@ }, "responses": [ { - "id": "10576", + "id": "10414", "code": 200, - "name": "OK", + "name": "成功", "headers": [], "jsonSchema": { "type": "object", @@ -31110,322 +31261,33 @@ "data": { "type": "object", "properties": { - "id": { - "type": "string", - "description": "Order ID" - }, - "symbol": { - "type": "string", - "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](apidog://link/endpoint/3470220) " - }, - "type": { - "type": "string", - "description": "Order type, market order or limit order", - "enum": [ - "market", - "limit" - ], - "x-api-enum": [ - { - "value": "market", - "name": "market", - "description": "Market Order" - }, - { - "value": "limit", - "name": "limit", - "description": "Limit Order" - } - ] - }, - "side": { - "type": "string", - "description": "Transaction side", - "enum": [ - "buy", - "sell" - ], - "x-api-enum": [ - { - "value": "buy", - "name": "buy", - "description": "buy" - }, - { - "value": "sell", - "name": "sell", - "description": "sell" - } - ] - }, - "price": { - "type": "string", - "description": "Order price" - }, - "size": { - "type": "integer", - "description": "Order quantity" - }, - "value": { - "type": "string", - "description": "Order value\n" - }, - "dealValue": { - "type": "string", - "description": "Executed size of funds\n" - }, - "dealSize": { + "openOrderBuySize": { "type": "integer", - "description": "Executed quantity\n" - }, - "stp": { - "type": "string", - "description": "[Self Trade Prevention](apidog://link/pages/338146) is divided into these strategies: CN, CO, CB. Not supported DC at the moment.", - "enum": [ - "", - "CN", - "CO", - "CB" - ], - "x-api-enum": [ - { - "value": "", - "name": "NULL", - "description": "None" - }, - { - "value": "CN", - "name": "CN", - "description": "Cancel new, Cancel the new order" - }, - { - "value": "CO", - "name": "CO", - "description": "Cancel old, Cancel the old order" - }, - { - "value": "CB", - "name": "CB", - "description": "Cancel both, Cancel both sides" - } - ] - }, - "stop": { - "type": "string", - "description": "Stop order type (stop limit or stop market)\n" - }, - "stopPriceType": { - "type": "string", - "description": "Trigger price type of stop orders", - "enum": [ - "", - "TP", - "MP", - "IP" - ], - "x-api-enum": [ - { - "value": "", - "name": "NULL", - "description": "None" - }, - { - "value": "TP", - "name": "trade price", - "description": "TP for trade price, The last trade price is the last price at which an order was filled. This price can be found in the latest match message." - }, - { - "value": "MP", - "name": "mark price", - "description": "MP for mark price, The mark price can be obtained through relevant OPEN API for index services" - }, - { - "value": "IP", - "name": "index price", - "description": "IP for index price, The index price can be obtained through relevant OPEN API for index services" - } - ] - }, - "stopTriggered": { - "type": "boolean", - "description": "Mark to show whether the stop order is triggered" - }, - "stopPrice": { - "type": "number", - "description": "Trigger price of stop orders" - }, - "timeInForce": { - "type": "string", - "description": "Time in force policy type\n" - }, - "postOnly": { - "type": "boolean", - "description": "Mark of post only\n" - }, - "hidden": { - "type": "boolean", - "description": "Mark of the hidden order\n" - }, - "iceberg": { - "type": "boolean", - "description": "Mark of the iceberg order\n" - }, - "leverage": { - "type": "string", - "description": "Leverage of the order\n" - }, - "forceHold": { - "type": "boolean", - "description": "A mark to forcely hold the funds for an order\n" - }, - "closeOrder": { - "type": "boolean", - "description": "A mark to close the position\n" + "description": "Total number of the unexecuted buy orders\n" }, - "visibleSize": { + "openOrderSellSize": { "type": "integer", - "description": "Visible size of the iceberg order\n" - }, - "clientOid": { - "type": "string", - "description": "Unique order id created by users to identify their orders\n" + "description": "Total number of the unexecuted sell orders\n" }, - "remark": { + "openOrderBuyCost": { "type": "string", - "description": "Remark" + "description": "Value of all the unexecuted buy orders\n" }, - "tags": { + "openOrderSellCost": { "type": "string", - "description": "tag order source\n" - }, - "isActive": { - "type": "boolean", - "description": "Mark of the active orders\n" - }, - "cancelExist": { - "type": "boolean", - "description": "Mark of the canceled orders\n" - }, - "createdAt": { - "type": "integer", - "description": "Time the order created\n", - "format": "int64" - }, - "updatedAt": { - "type": "integer", - "description": "last update time\n", - "format": "int64" - }, - "endAt": { - "type": "integer", - "description": "Order Endtime", - "format": "int64" - }, - "orderTime": { - "type": "integer", - "description": "Order create time in nanosecond\n", - "format": "int64" + "description": "Value of all the unexecuted sell orders\n" }, "settleCurrency": { "type": "string", "description": "settlement currency\n" - }, - "marginMode": { - "type": "string", - "description": "Margin mode: ISOLATED (isolated), CROSS (cross margin).\n", - "enum": [ - "CROSS", - "ISOLATED" - ], - "x-api-enum": [ - { - "value": "CROSS", - "name": "CROSS", - "description": "Cross margin" - }, - { - "value": "ISOLATED", - "name": "ISOLATED", - "description": "Isolated margin" - } - ] - }, - "avgDealPrice": { - "type": "string", - "description": "Average transaction price, forward contract average transaction price = sum (transaction value) / sum (transaction quantity), reverse contract average transaction price = sum (transaction quantity) / sum (transaction value). Transaction quantity = lots * multiplier\n" - }, - "filledSize": { - "type": "integer", - "description": "Value of the executed orders\n" - }, - "filledValue": { - "type": "string", - "description": "Executed order quantity\n" - }, - "status": { - "type": "string", - "description": "order status: “open” or “done”\n", - "enum": [ - "open", - "done" - ], - "x-api-enum": [ - { - "value": "open", - "name": "open", - "description": "open order" - }, - { - "value": "done", - "name": "done", - "description": "done order" - } - ] - }, - "reduceOnly": { - "type": "boolean", - "description": "A mark to reduce the position size only\n" } }, "required": [ - "id", - "symbol", - "type", - "side", - "price", - "size", - "value", - "dealValue", - "dealSize", - "stp", - "stop", - "stopPriceType", - "stopTriggered", - "stopPrice", - "timeInForce", - "postOnly", - "hidden", - "iceberg", - "leverage", - "forceHold", - "closeOrder", - "visibleSize", - "clientOid", - "remark", - "tags", - "isActive", - "cancelExist", - "createdAt", - "updatedAt", - "endAt", - "orderTime", - "settleCurrency", - "marginMode", - "avgDealPrice", - "filledSize", - "filledValue", - "status", - "reduceOnly" + "openOrderBuySize", + "openOrderSellSize", + "openOrderBuyCost", + "openOrderSellCost", + "settleCurrency" ] } }, @@ -31442,8 +31304,8 @@ "responseExamples": [ { "name": "Success", - "data": "{\r\n \"code\": \"200000\",\r\n \"data\": {\r\n \"id\": \"250444645610336256\",\r\n \"symbol\": \"XRPUSDTM\",\r\n \"type\": \"limit\",\r\n \"side\": \"buy\",\r\n \"price\": \"0.1\",\r\n \"size\": 1,\r\n \"value\": \"1\",\r\n \"dealValue\": \"0\",\r\n \"dealSize\": 0,\r\n \"stp\": \"\",\r\n \"stop\": \"\",\r\n \"stopPriceType\": \"\",\r\n \"stopTriggered\": false,\r\n \"stopPrice\": null,\r\n \"timeInForce\": \"GTC\",\r\n \"postOnly\": false,\r\n \"hidden\": false,\r\n \"iceberg\": false,\r\n \"leverage\": \"3\",\r\n \"forceHold\": false,\r\n \"closeOrder\": false,\r\n \"visibleSize\": 0,\r\n \"clientOid\": \"5c52e11203aa677f33e493fb\",\r\n \"remark\": null,\r\n \"tags\": \"\",\r\n \"isActive\": true,\r\n \"cancelExist\": false,\r\n \"createdAt\": 1732523858568,\r\n \"updatedAt\": 1732523858568,\r\n \"endAt\": null,\r\n \"orderTime\": 1732523858550892322,\r\n \"settleCurrency\": \"USDT\",\r\n \"marginMode\": \"ISOLATED\",\r\n \"avgDealPrice\": \"0\",\r\n \"filledSize\": 0,\r\n \"filledValue\": \"0\",\r\n \"status\": \"open\",\r\n \"reduceOnly\": false\r\n }\r\n}", - "responseId": 10576, + "data": "{\n \"code\": \"200000\",\n \"data\": {\n \"openOrderBuySize\": 1,\n \"openOrderSellSize\": 0,\n \"openOrderBuyCost\": \"0.0001\",\n \"openOrderSellCost\": \"0\",\n \"settleCurrency\": \"USDT\"\n }\n}", + "responseId": 10414, "ordering": 1 } ], @@ -31457,16 +31319,16 @@ "example": "", "mediaType": "" }, - "description": ":::info[Description]\nGet a single order by client order id (including a stop order).\n:::", - "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Futures\",\"api-channel\":\"Private\",\"api-permission\":\"General\",\"api-rate-limit-pool\":\"Futures\",\"sdk-service\":\"Futures\",\"sdk-sub-service\":\"Order\",\"sdk-method-name\":\"getOrderByClientOid\",\"sdk-method-description\":\"Get a single order by client order id (including a stop order).\",\"api-rate-limit\":5}" + "description": ":::info[Description]\nYou can query this endpoint to get the the total number and value of the all your active orders.\n:::", + "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Futures\",\"api-channel\":\"Private\",\"api-permission\":\"Futures\",\"api-rate-limit-pool\":\"Futures\",\"sdk-service\":\"Futures\",\"sdk-sub-service\":\"Order\",\"sdk-method-name\":\"GetOpenOrderValue\",\"sdk-method-description\":\"You can query this endpoint to get the the total number and value of the all your active orders.\",\"api-rate-limit\":10}" } }, { - "name": "Get Recent Closed Orders", + "name": "Get Recent Trade History", "api": { - "id": "3470246", + "id": "3470249", "method": "get", - "path": "/api/v1/recentDoneOrders", + "path": "/api/v1/recentFills", "parameters": { "query": [ { @@ -31485,7 +31347,7 @@ }, "responses": [ { - "id": "10410", + "id": "10413", "code": 200, "name": "成功", "headers": [], @@ -31500,202 +31362,256 @@ "items": { "type": "object", "properties": { - "id": { - "type": "string", - "description": "Order ID" - }, "symbol": { "type": "string", "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](apidog://link/endpoint/3470220) " }, - "type": { - "type": "string", - "description": "Order type, market order or limit order" - }, - "side": { - "type": "string", - "description": "Transaction side" - }, - "price": { - "type": "string", - "description": "Order price" - }, - "size": { - "type": "integer", - "description": "Order quantity" - }, - "value": { - "type": "string", - "description": "Order value\n" - }, - "dealValue": { - "type": "string", - "description": "Executed size of funds\n" - }, - "dealSize": { - "type": "integer", - "description": "Executed quantity\n" - }, - "stp": { + "tradeId": { "type": "string", - "description": "self trade prevention" + "description": "Trade ID\n" }, - "stop": { + "orderId": { "type": "string", - "description": "Stop order type (stop limit or stop market)\n" + "description": "Order ID\n" }, - "stopPriceType": { + "side": { "type": "string", - "description": "Trigger price type of stop orders\n" - }, - "stopTriggered": { - "type": "boolean", - "description": "Mark to show whether the stop order is triggered" - }, - "stopPrice": { - "type": "integer", - "description": "Trigger price of stop orders\n" + "description": "Transaction side\n", + "enum": [ + "buy", + "sell" + ], + "x-api-enum": [ + { + "value": "buy", + "name": "buy", + "description": "buy" + }, + { + "value": "sell", + "name": "sell", + "description": "sell" + } + ] }, - "timeInForce": { + "liquidity": { "type": "string", - "description": "Time in force policy type\n" - }, - "postOnly": { - "type": "boolean", - "description": "Mark of post only\n" - }, - "hidden": { - "type": "boolean", - "description": "Mark of the hidden order\n" + "description": "Liquidity- taker or maker\n", + "enum": [ + "taker", + "maker" + ], + "x-api-enum": [ + { + "value": "taker", + "name": "taker", + "description": "taker" + }, + { + "value": "maker", + "name": "maker", + "description": "maker" + } + ] }, - "iceberg": { + "forceTaker": { "type": "boolean", - "description": "Mark of the iceberg order\n" + "description": "Whether to force processing as a taker\n" }, - "leverage": { + "price": { "type": "string", - "description": "Leverage of the order\n" - }, - "forceHold": { - "type": "boolean", - "description": "A mark to forcely hold the funds for an order\n" - }, - "closeOrder": { - "type": "boolean", - "description": "A mark to close the position\n" + "description": "Filled price\n" }, - "visibleSize": { + "size": { "type": "integer", - "description": "Visible size of the iceberg order\n" - }, - "clientOid": { - "type": "string", - "description": "Unique order id created by users to identify their orders\n" + "description": "Filled amount\n" }, - "remark": { + "value": { "type": "string", - "description": "Remark of the order\n" + "description": "Order value\n" }, - "tags": { + "openFeePay": { "type": "string", - "description": "tag order source\n" + "description": "Opening transaction fee\n" }, - "isActive": { - "type": "boolean", - "description": "Mark of the active orders\n" + "closeFeePay": { + "type": "string", + "description": "Closing transaction fee\n" }, - "cancelExist": { - "type": "boolean", - "description": "Mark of the canceled orders\n" + "stop": { + "type": "string", + "description": "A mark to the stop order type\n" }, - "createdAt": { - "type": "integer", - "description": "Time the order created\n", - "format": "int64" + "feeRate": { + "type": "string", + "description": "Fee Rate" }, - "updatedAt": { - "type": "integer", - "description": "last update time\n", - "format": "int64" + "fixFee": { + "type": "string", + "description": "Fixed fees(Deprecated field, no actual use of the value field)\n" }, - "endAt": { - "type": "integer", - "description": "End time\n", - "format": "int64" + "feeCurrency": { + "type": "string", + "description": "Charging currency\n" }, - "orderTime": { + "tradeTime": { "type": "integer", - "description": "Order create time in nanosecond\n", + "description": "trade time in nanosecond\n", "format": "int64" }, - "settleCurrency": { + "subTradeType": { "type": "string", - "description": "settlement currency\n" + "description": "Deprecated field, no actual use of the value field" }, "marginMode": { "type": "string", - "description": "Margin mode: ISOLATED (isolated), CROSS (cross margin).\n" + "description": "Margin mode: ISOLATED (isolated), CROSS (cross margin).\n", + "enum": [ + "ISOLATED", + "CROSS" + ], + "x-api-enum": [ + { + "value": "ISOLATED", + "name": "ISOLATED", + "description": "Isolated Margin" + }, + { + "value": "CROSS", + "name": "CROSS", + "description": "Cross Margin" + } + ] }, - "avgDealPrice": { + "displayType": { "type": "string", - "description": "Average transaction price, forward contract average transaction price = sum (transaction value) / sum (transaction quantity), reverse contract average transaction price = sum (transaction quantity) / sum (transaction value). Transaction quantity = lots * multiplier\n" + "enum": [ + "limit", + "market", + "limit_stop", + "market_stop" + ], + "description": "Order Type", + "x-api-enum": [ + { + "value": "limit", + "name": "limit", + "description": "Limit order" + }, + { + "value": "market", + "name": "market", + "description": "Market order" + }, + { + "value": "limit_stop", + "name": "limit_stop", + "description": "Stop limit order" + }, + { + "value": "market_stop", + "name": "market_stop", + "description": "Stop Market order" + } + ] }, - "filledSize": { - "type": "integer", - "description": "Value of the executed orders\n" + "fee": { + "type": "string", + "description": "Transaction fee\n" }, - "filledValue": { + "settleCurrency": { "type": "string", - "description": "Executed order quantity\n" + "description": "Settle Currency" }, - "status": { + "orderType": { "type": "string", - "description": "order status: “open” or “done”\n" + "description": "Order type\n", + "enum": [ + "market", + "limit" + ], + "x-api-enum": [ + { + "value": "market", + "name": "market", + "description": "market" + }, + { + "value": "limit", + "name": "limit", + "description": "limit" + } + ] }, - "reduceOnly": { - "type": "boolean", - "description": "A mark to reduce the position size only\n" + "tradeType": { + "type": "string", + "description": "Trade type (trade, liquid, cancel, adl or settlement)\n", + "enum": [ + "trade", + "cancel", + "liquid", + "adl", + "settlement" + ], + "x-api-enum": [ + { + "value": "trade", + "name": "trade", + "description": "trade" + }, + { + "value": "cancel", + "name": "cancel", + "description": "Partially filled and cancelled orders" + }, + { + "value": "liquid", + "name": "liquid", + "description": "liquid" + }, + { + "value": "adl", + "name": "adl", + "description": "adl" + }, + { + "value": "settlement", + "name": "settlement", + "description": "settlement" + } + ] + }, + "createdAt": { + "type": "integer", + "description": "Time the order created\n", + "format": "int64" } }, "required": [ - "id", "symbol", - "type", + "tradeId", + "orderId", "side", + "liquidity", + "forceTaker", "price", "size", "value", - "dealValue", - "dealSize", - "stp", + "openFeePay", + "closeFeePay", "stop", - "stopPriceType", - "stopTriggered", - "stopPrice", - "timeInForce", - "postOnly", - "hidden", - "iceberg", - "leverage", - "forceHold", - "closeOrder", - "visibleSize", - "clientOid", - "remark", - "tags", - "isActive", - "cancelExist", - "createdAt", - "updatedAt", - "endAt", - "orderTime", - "settleCurrency", + "feeRate", + "fixFee", + "feeCurrency", + "tradeTime", + "subTradeType", "marginMode", - "avgDealPrice", - "filledSize", - "filledValue", - "status", - "reduceOnly" + "displayType", + "fee", + "settleCurrency", + "orderType", + "tradeType", + "createdAt" ] } } @@ -31713,8 +31629,8 @@ "responseExamples": [ { "name": "Success", - "data": "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"id\": \"236387137732231168\",\n \"symbol\": \"XRPUSDTM\",\n \"type\": \"market\",\n \"side\": \"buy\",\n \"price\": \"0\",\n \"size\": 1,\n \"value\": \"5.51\",\n \"dealValue\": \"5.511\",\n \"dealSize\": 1,\n \"stp\": \"\",\n \"stop\": \"\",\n \"stopPriceType\": \"\",\n \"stopTriggered\": false,\n \"stopPrice\": null,\n \"timeInForce\": \"GTC\",\n \"postOnly\": false,\n \"hidden\": false,\n \"iceberg\": false,\n \"leverage\": \"10.0\",\n \"forceHold\": false,\n \"closeOrder\": false,\n \"visibleSize\": 0,\n \"clientOid\": \"16698fe6-2746-4aeb-a7fa-61f633ab6090\",\n \"remark\": null,\n \"tags\": \"\",\n \"isActive\": false,\n \"cancelExist\": false,\n \"createdAt\": 1729172287496,\n \"updatedAt\": 1729172287568,\n \"endAt\": 1729172287568,\n \"orderTime\": 1729172287496950800,\n \"settleCurrency\": \"USDT\",\n \"marginMode\": \"ISOLATED\",\n \"avgDealPrice\": \"0.5511\",\n \"filledSize\": 1,\n \"filledValue\": \"5.511\",\n \"status\": \"done\",\n \"reduceOnly\": false\n },\n {\n \"id\": \"236317213710184449\",\n \"symbol\": \"XBTUSDTM\",\n \"type\": \"market\",\n \"side\": \"buy\",\n \"price\": \"0\",\n \"size\": 1,\n \"value\": \"67.4309\",\n \"dealValue\": \"67.4309\",\n \"dealSize\": 1,\n \"stp\": \"\",\n \"stop\": \"\",\n \"stopPriceType\": \"\",\n \"stopTriggered\": false,\n \"stopPrice\": null,\n \"timeInForce\": \"GTC\",\n \"postOnly\": false,\n \"hidden\": false,\n \"iceberg\": false,\n \"leverage\": \"3\",\n \"forceHold\": false,\n \"closeOrder\": false,\n \"visibleSize\": 0,\n \"clientOid\": \"5c52e11203aa677f33e493fb\",\n \"remark\": null,\n \"tags\": \"\",\n \"isActive\": false,\n \"cancelExist\": false,\n \"createdAt\": 1729155616310,\n \"updatedAt\": 1729155616324,\n \"endAt\": 1729155616324,\n \"orderTime\": 1729155616310180400,\n \"settleCurrency\": \"USDT\",\n \"marginMode\": \"ISOLATED\",\n \"avgDealPrice\": \"67430.9\",\n \"filledSize\": 1,\n \"filledValue\": \"67.4309\",\n \"status\": \"done\",\n \"reduceOnly\": false\n },\n {\n \"id\": \"236317094436728832\",\n \"symbol\": \"XBTUSDTM\",\n \"type\": \"market\",\n \"side\": \"buy\",\n \"price\": \"0\",\n \"size\": 1,\n \"value\": \"67.445\",\n \"dealValue\": \"67.445\",\n \"dealSize\": 1,\n \"stp\": \"\",\n \"stop\": \"\",\n \"stopPriceType\": \"\",\n \"stopTriggered\": false,\n \"stopPrice\": null,\n \"timeInForce\": \"GTC\",\n \"postOnly\": false,\n \"hidden\": false,\n \"iceberg\": false,\n \"leverage\": \"3\",\n \"forceHold\": false,\n \"closeOrder\": false,\n \"visibleSize\": 0,\n \"clientOid\": \"5c52e11203aa677f33e493fb\",\n \"remark\": null,\n \"tags\": \"\",\n \"isActive\": false,\n \"cancelExist\": false,\n \"createdAt\": 1729155587873,\n \"updatedAt\": 1729155587946,\n \"endAt\": 1729155587946,\n \"orderTime\": 1729155587873332000,\n \"settleCurrency\": \"USDT\",\n \"marginMode\": \"ISOLATED\",\n \"avgDealPrice\": \"67445.0\",\n \"filledSize\": 1,\n \"filledValue\": \"67.445\",\n \"status\": \"done\",\n \"reduceOnly\": false\n }\n ]\n}", - "responseId": 10410, + "data": "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"symbol\": \"XBTUSDTM\",\n \"tradeId\": \"1784277229880\",\n \"orderId\": \"236317213710184449\",\n \"side\": \"buy\",\n \"liquidity\": \"taker\",\n \"forceTaker\": false,\n \"price\": \"67430.9\",\n \"size\": 1,\n \"value\": \"67.4309\",\n \"openFeePay\": \"0.04045854\",\n \"closeFeePay\": \"0\",\n \"stop\": \"\",\n \"feeRate\": \"0.00060\",\n \"fixFee\": \"0\",\n \"feeCurrency\": \"USDT\",\n \"marginMode\": \"ISOLATED\",\n \"fee\": \"0.04045854\",\n \"settleCurrency\": \"USDT\",\n \"orderType\": \"market\",\n \"displayType\": \"market\",\n \"tradeType\": \"trade\",\n \"subTradeType\": null,\n \"tradeTime\": 1729155616320000000,\n \"createdAt\": 1729155616493\n },\n {\n \"symbol\": \"XBTUSDTM\",\n \"tradeId\": \"1784277132002\",\n \"orderId\": \"236317094436728832\",\n \"side\": \"buy\",\n \"liquidity\": \"taker\",\n \"forceTaker\": false,\n \"price\": \"67445\",\n \"size\": 1,\n \"value\": \"67.445\",\n \"openFeePay\": \"0\",\n \"closeFeePay\": \"0.040467\",\n \"stop\": \"\",\n \"feeRate\": \"0.00060\",\n \"fixFee\": \"0\",\n \"feeCurrency\": \"USDT\",\n \"marginMode\": \"ISOLATED\",\n \"fee\": \"0.040467\",\n \"settleCurrency\": \"USDT\",\n \"orderType\": \"market\",\n \"displayType\": \"market\",\n \"tradeType\": \"trade\",\n \"subTradeType\": null,\n \"tradeTime\": 1729155587944000000,\n \"createdAt\": 1729155588104\n }\n ]\n}", + "responseId": 10413, "ordering": 1 } ], @@ -31728,24 +31644,32 @@ "example": "", "mediaType": "" }, - "description": ":::info[Description]\nGet a list of recent 1000 closed orders in the last 24 hours.\n\nIf you need to get your recent traded order history with low latency, you may query this endpoint.\n\n\nAny limit order on the exchange order book is in active status. Orders removed from the order book will be marked with done status. After an order becomes done, there may be a few milliseconds latency before it’s fully settled.\n\nYou can check the orders in any status. If the status parameter is not specified, orders of done status will be returned by default.\n\nWhen you query orders in active status, there is no time limit. However, when you query orders in done status, the start and end time range cannot exceed 24*7 hours. An error will occur if the specified time window exceeds the range. If you specify the end time only, the system will automatically calculate the start time as end time minus 24 hours, and vice versa.\n\n**POLLING**\nFor high-volume trading, it is highly recommended that you maintain your own list of open orders and use one of the streaming market data feeds to keep it updated. You should poll the open orders endpoint to obtain the current state of any open order.\n\nIf you need to get your recent trade history with low latency, you may query the endpoint Get List of Orders Completed in 24h.\n:::\n\n**API KEY PERMISSIONS**\nThis endpoint requires the General permission.\n\n**REQUEST URL**\nThis endpoint support Futures URL\n\n**REQUEST RATE LIMIT**\nFutures weight:2\n", - "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Futures\",\"api-channel\":\"Private\",\"api-permission\":\"Futures\",\"api-rate-limit-pool\":\"Futures\",\"sdk-service\":\"Futures\",\"sdk-sub-service\":\"Order\",\"sdk-method-name\":\"GetRecentClosedOrders\",\"sdk-method-description\":\"Get a list of recent 1000 closed orders in the last 24 hours. If you need to get your recent traded order history with low latency, you may query this endpoint.\",\"api-rate-limit\":5}" + "description": ":::info[Description]\nGet a list of recent 1000 fills in the last 24 hours. If you need to get your recent traded order history with low latency, you may query this endpoint.\n\nIf you need to get your recent traded order history with low latency, you may query this endpoint.\n:::", + "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Futures\",\"api-channel\":\"Private\",\"api-permission\":\"Futures\",\"api-rate-limit-pool\":\"Futures\",\"sdk-service\":\"Futures\",\"sdk-sub-service\":\"Order\",\"sdk-method-name\":\"getRecentTradeHistory\",\"sdk-method-description\":\"Get a list of recent 1000 fills in the last 24 hours. If you need to get your recent traded order history with low latency, you may query this endpoint.\",\"api-rate-limit\":3}" } }, { - "name": "Get Stop Order List", + "name": "Get Trade History", "api": { - "id": "3470247", + "id": "3470248", "method": "get", - "path": "/api/v1/stopOrders", + "path": "/api/v1/fills", "parameters": { "query": [ + { + "id": "2KbksGFfyd", + "name": "orderId", + "required": false, + "description": "List fills for a specific order only (If you specify orderId, other parameters can be ignored)", + "example": "236655147005071361", + "type": "string", + "enable": true + }, { "id": "4wXlXiQszi", "name": "symbol", "required": false, "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](apidog://link/endpoint/3470220) ", - "example": "XBTUSDTM", "type": "string", "enable": true }, @@ -31753,8 +31677,9 @@ "id": "uaSHeFQTjq", "name": "side", "required": false, - "description": "buy or sell", + "description": "Order side", "type": "string", + "enable": true, "schema": { "type": "string", "enum": [ @@ -31764,44 +31689,73 @@ "x-api-enum": [ { "value": "buy", - "name": "", - "description": "" + "name": "buy", + "description": "buy" }, { "value": "sell", - "name": "", - "description": "" + "name": "sell", + "description": "sell" } ] - }, - "enable": true + } }, { "id": "WUcubn1a2F", "name": "type", "required": false, - "description": "limit, market", + "description": "Order Type", "type": "string", + "enable": true, "schema": { "type": "string", "enum": [ "limit", - "market" + "market", + "limit_stop", + "market_stop" ], "x-api-enum": [ { "value": "limit", - "name": "", - "description": "" + "name": "limit", + "description": "Limit order" }, { "value": "market", - "name": "", - "description": "" + "name": "market", + "description": "Market order" + }, + { + "value": "limit_stop", + "name": "limit_stop", + "description": "Stop limit order" + }, + { + "value": "market_stop", + "name": "market_stop", + "description": "Stop Market order" } ] - }, - "enable": true + } + }, + { + "required": false, + "description": "Transaction type: trade, adl, liquid, settlement. Supports querying multiple types at the same time, separated by commas. Query all type when empty", + "type": "string", + "id": "n3uTl3OSFi", + "enable": true, + "name": "tradeTypes", + "schema": { + "type": "string", + "examples": [ + "trade", + "adl", + "liquid", + "settlement", + "adl,liquid" + ] + } }, { "id": "92p8ibIf57", @@ -31834,7 +31788,8 @@ "description": "Current request page, The default currentPage is 1", "type": "integer", "schema": { - "type": "integer" + "type": "integer", + "default": 1 }, "enable": true }, @@ -31846,8 +31801,8 @@ "type": "integer", "schema": { "type": "integer", - "maximum": 1000, - "default": 50 + "default": 50, + "maximum": 1000 }, "enable": true } @@ -31858,7 +31813,7 @@ }, "responses": [ { - "id": "10411", + "id": "10412", "code": 200, "name": "成功", "headers": [], @@ -31872,12 +31827,10 @@ "type": "object", "properties": { "currentPage": { - "type": "integer", - "description": "Current request page, The default currentPage is 1" + "type": "integer" }, "pageSize": { - "type": "integer", - "description": "pageSize, The default pageSize is 50, The maximum cannot exceed 1000" + "type": "integer" }, "totalNum": { "type": "integer" @@ -31890,202 +31843,249 @@ "items": { "type": "object", "properties": { - "id": { - "type": "string", - "description": "Order ID" - }, "symbol": { "type": "string", "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](apidog://link/endpoint/3470220) " }, - "type": { + "tradeId": { "type": "string", - "description": "Order type, market order or limit order\n" + "description": "Trade ID\n" + }, + "orderId": { + "type": "string", + "description": "Order ID\n" }, "side": { "type": "string", - "description": "Transaction side" + "description": "Transaction side", + "enum": [ + "buy", + "sell" + ], + "x-api-enum": [ + { + "value": "buy", + "name": "buy", + "description": "buy" + }, + { + "value": "sell", + "name": "sell", + "description": "sell" + } + ] + }, + "liquidity": { + "type": "string", + "description": "Liquidity- taker or maker", + "enum": [ + "taker", + "maker" + ], + "x-api-enum": [ + { + "value": "taker", + "name": "taker", + "description": "taker" + }, + { + "value": "maker", + "name": "maker", + "description": "maker" + } + ] + }, + "forceTaker": { + "type": "boolean", + "description": "Whether to force processing as a taker\n" }, "price": { "type": "string", - "description": "Order price" + "description": "Filled price" }, "size": { "type": "integer", - "description": "Order quantity" + "description": "Filled amount" }, "value": { "type": "string", "description": "Order value" }, - "dealValue": { + "openFeePay": { "type": "string", - "description": "Executed size of funds\n" - }, - "dealSize": { - "type": "integer", - "description": "Executed quantity" + "description": "Opening transaction fee" }, - "stp": { + "closeFeePay": { "type": "string", - "description": "self trade prevention" + "description": "Closing transaction fee" }, "stop": { "type": "string", - "description": "Stop order type (stop limit or stop market)" - }, - "stopPriceType": { - "type": "string", - "description": "Trigger price type of stop orders" - }, - "stopTriggered": { - "type": "boolean", - "description": "Mark to show whether the stop order is triggered" + "description": "A mark to the stop order type" }, - "stopPrice": { + "feeRate": { "type": "string", - "description": "Trigger price of stop orders" + "description": "Fee Rate" }, - "timeInForce": { + "fixFee": { "type": "string", - "description": "Time in force policy type" - }, - "postOnly": { - "type": "boolean", - "description": "Mark of post only" - }, - "hidden": { - "type": "boolean", - "description": "Mark of the hidden order" - }, - "iceberg": { - "type": "boolean", - "description": "Mark of the iceberg order" + "description": "Fixed fees(Deprecated field, no actual use of the value field)" }, - "leverage": { + "feeCurrency": { "type": "string", - "description": "Leverage of the order" - }, - "forceHold": { - "type": "boolean", - "description": "A mark to forcely hold the funds for an order" - }, - "closeOrder": { - "type": "boolean", - "description": "A mark to close the position" + "description": "Charging currency" }, - "visibleSize": { + "tradeTime": { "type": "integer", - "description": "Visible size of the iceberg order" - }, - "clientOid": { - "type": "string", - "description": "Unique order id created by users to identify their orders" + "description": "trade time in nanosecond", + "format": "int64" }, - "remark": { + "subTradeType": { "type": "string", - "description": "Remark of the order" + "description": "Deprecated field, no actual use of the value field" }, - "tags": { + "marginMode": { "type": "string", - "description": "tag order source" - }, - "isActive": { - "type": "boolean", - "description": "Mark of the active orders" - }, - "cancelExist": { - "type": "boolean", - "description": "Mark of the canceled orders" - }, - "createdAt": { - "type": "integer", - "description": "Time the order created", - "format": "int64" - }, - "updatedAt": { - "type": "integer", - "description": "last update time", - "format": "int64" - }, - "endAt": { - "type": "integer", - "description": "End time", - "format": "int64" - }, - "orderTime": { - "type": "integer", - "description": "Order create time in nanosecond", - "format": "int64" + "description": "Margin mode: ISOLATED (isolated), CROSS (cross margin).", + "enum": [ + "ISOLATED", + "CROSS" + ], + "x-api-enum": [ + { + "value": "ISOLATED", + "name": "ISOLATED", + "description": "Isolated Margin" + }, + { + "value": "CROSS", + "name": "CROSS", + "description": "Cross Margin" + } + ] }, "settleCurrency": { "type": "string", - "description": "settlement currency" - }, - "marginMode": { - "type": "string", - "description": "Margin mode: ISOLATED (isolated), CROSS (cross margin)." + "description": "Settle Currency" }, - "avgDealPrice": { + "displayType": { "type": "string", - "description": "Average transaction price, forward contract average transaction price = sum (transaction value) / sum (transaction quantity), reverse contract average transaction price = sum (transaction quantity) / sum (transaction value). Transaction quantity = lots * multiplier" + "enum": [ + "limit", + "market", + "limit_stop", + "market_stop" + ], + "description": "Order Type", + "x-api-enum": [ + { + "value": "limit", + "name": "limit", + "description": "Limit order" + }, + { + "value": "market", + "name": "market", + "description": "Market order" + }, + { + "value": "limit_stop", + "name": "limit_stop", + "description": "Stop limit order" + }, + { + "value": "market_stop", + "name": "market_stop", + "description": "Stop Market order" + } + ] }, - "filledSize": { - "type": "integer", - "description": "Value of the executed orders" + "fee": { + "type": "string" }, - "filledValue": { + "orderType": { "type": "string", - "description": "Executed order quantity" + "description": "Order type", + "enum": [ + "market", + "limit" + ], + "x-api-enum": [ + { + "value": "market", + "name": "market", + "description": "market" + }, + { + "value": "limit", + "name": "limit", + "description": "limit" + } + ] }, - "status": { + "tradeType": { "type": "string", - "description": "order status: “open” or “done”" + "description": "Trade type (trade, liquid, adl or settlement)\n", + "enum": [ + "trade", + "liquid", + "adl", + "settlement" + ], + "x-api-enum": [ + { + "value": "trade", + "name": "trade", + "description": "trade" + }, + { + "value": "liquid", + "name": "liquid", + "description": "liquid" + }, + { + "value": "adl", + "name": "adl", + "description": "adl" + }, + { + "value": "settlement", + "name": "settlement", + "description": "settlement" + } + ] }, - "reduceOnly": { - "type": "boolean", - "description": "A mark to reduce the position size only" + "createdAt": { + "type": "integer", + "description": "Time the order created\n", + "format": "int64" } }, "required": [ - "id", "symbol", - "type", + "tradeId", + "orderId", "side", + "liquidity", + "forceTaker", "price", "size", "value", - "dealValue", - "dealSize", - "stp", + "openFeePay", + "closeFeePay", "stop", - "stopPriceType", - "stopTriggered", - "stopPrice", - "timeInForce", - "postOnly", - "hidden", - "iceberg", - "leverage", - "forceHold", - "closeOrder", - "visibleSize", - "clientOid", - "remark", - "tags", - "isActive", - "cancelExist", - "createdAt", - "updatedAt", - "endAt", - "orderTime", - "settleCurrency", + "feeRate", + "fixFee", + "feeCurrency", + "tradeTime", + "subTradeType", "marginMode", - "avgDealPrice", - "filledSize", - "filledValue", - "status", - "reduceOnly" + "settleCurrency", + "displayType", + "fee", + "orderType", + "tradeType", + "createdAt" ] } } @@ -32112,8 +32112,8 @@ "responseExamples": [ { "name": "Success", - "data": "{\n \"code\": \"200000\",\n \"data\": {\n \"currentPage\": 1,\n \"pageSize\": 50,\n \"totalNum\": 1,\n \"totalPage\": 1,\n \"items\": [\n {\n \"id\": \"230181737576050688\",\n \"symbol\": \"PEOPLEUSDTM\",\n \"type\": \"limit\",\n \"side\": \"buy\",\n \"price\": \"0.05\",\n \"size\": 10,\n \"value\": \"5\",\n \"dealValue\": \"0\",\n \"dealSize\": 0,\n \"stp\": \"\",\n \"stop\": \"\",\n \"stopPriceType\": \"\",\n \"stopTriggered\": false,\n \"stopPrice\": null,\n \"timeInForce\": \"GTC\",\n \"postOnly\": false,\n \"hidden\": false,\n \"iceberg\": false,\n \"leverage\": \"1\",\n \"forceHold\": false,\n \"closeOrder\": false,\n \"visibleSize\": 0,\n \"clientOid\": \"5a80bd847f1811ef8a7faa665a37b3d7\",\n \"remark\": null,\n \"tags\": \"\",\n \"isActive\": true,\n \"cancelExist\": false,\n \"createdAt\": 1727692804813,\n \"updatedAt\": 1727692804813,\n \"endAt\": null,\n \"orderTime\": 1727692804808418000,\n \"settleCurrency\": \"USDT\",\n \"marginMode\": \"ISOLATED\",\n \"avgDealPrice\": \"0\",\n \"filledSize\": 0,\n \"filledValue\": \"0\",\n \"status\": \"open\",\n \"reduceOnly\": false\n }\n ]\n }\n}", - "responseId": 10411, + "data": "{\n \"code\": \"200000\",\n \"data\": {\n \"currentPage\": 1,\n \"pageSize\": 50,\n \"totalNum\": 2,\n \"totalPage\": 1,\n \"items\": [\n {\n \"symbol\": \"XBTUSDTM\",\n \"tradeId\": \"1784277229880\",\n \"orderId\": \"236317213710184449\",\n \"side\": \"buy\",\n \"liquidity\": \"taker\",\n \"forceTaker\": false,\n \"price\": \"67430.9\",\n \"size\": 1,\n \"value\": \"67.4309\",\n \"openFeePay\": \"0.04045854\",\n \"closeFeePay\": \"0\",\n \"stop\": \"\",\n \"feeRate\": \"0.00060\",\n \"fixFee\": \"0\",\n \"feeCurrency\": \"USDT\",\n \"marginMode\": \"ISOLATED\",\n \"settleCurrency\": \"USDT\",\n \"fee\": \"0.04045854\",\n \"orderType\": \"market\",\n \"displayType\": \"market\",\n \"tradeType\": \"trade\",\n \"subTradeType\": null,\n \"tradeTime\": 1729155616320000000,\n \"createdAt\": 1729155616493\n },\n {\n \"symbol\": \"XBTUSDTM\",\n \"tradeId\": \"1784277132002\",\n \"orderId\": \"236317094436728832\",\n \"side\": \"buy\",\n \"liquidity\": \"taker\",\n \"forceTaker\": false,\n \"price\": \"67445\",\n \"size\": 1,\n \"value\": \"67.445\",\n \"openFeePay\": \"0\",\n \"closeFeePay\": \"0.040467\",\n \"stop\": \"\",\n \"feeRate\": \"0.00060\",\n \"fixFee\": \"0\",\n \"feeCurrency\": \"USDT\",\n \"marginMode\": \"ISOLATED\",\n \"settleCurrency\": \"USDT\",\n \"fee\": \"0.040467\",\n \"orderType\": \"market\",\n \"displayType\": \"market\",\n \"tradeType\": \"trade\",\n \"subTradeType\": null,\n \"tradeTime\": 1729155587944000000,\n \"createdAt\": 1729155588104\n }\n ]\n }\n}", + "responseId": 10412, "ordering": 1 } ], @@ -32127,8 +32127,8 @@ "example": "", "mediaType": "" }, - "description": ":::info[Description]\nGet the un-triggered stop orders list. Stop orders that have been triggered can be queried through the general order interface\n:::\n\nAny limit order on the exchange order book is in active status. Orders removed from the order book will be marked with done status. After an order becomes done, there may be a few milliseconds latency before it’s fully settled.\n\nYou can check the orders in any status. If the status parameter is not specified, orders of done status will be returned by default.\n\nWhen you query orders in active status, there is no time limit. However, when you query orders in done status, the start and end time range cannot exceed 24*7 hours. An error will occur if the specified time window exceeds the range. If you specify the end time only, the system will automatically calculate the start time as end time minus 24 hours, and vice versa.\n\nPOLLING\nFor high-volume trading, it is highly recommended that you maintain your own list of open orders and use one of the streaming market data feeds to keep it updated. You should poll the open orders endpoint to obtain the current state of any open order.\n\nIf you need to get your recent trade history with low latency, you may query the endpoint Get List of Orders Completed in 24h.", - "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Futures\",\"api-channel\":\"Private\",\"api-permission\":\"Futures\",\"api-rate-limit-pool\":\"Futures\",\"sdk-service\":\"Futures\",\"sdk-sub-service\":\"Order\",\"sdk-method-name\":\"GetStopOrderList\",\"sdk-method-description\":\"Get the un-triggered stop orders list. Stop orders that have been triggered can be queried through the general order interface\",\"api-rate-limit\":6}" + "description": ":::info[Description]\nGet a list of recent fills. If you need to get your recent trade history with low latency, please query endpoint Get List of Orders Completed in 24h. The requested data is not real-time.\n:::\n\n**Data Time Range**\n\nThe system allows you to retrieve data up to one week (start from the last day by default). If the time period of the queried data exceeds one week (time range from the start time to end time exceeded 24*7 hours), the system will prompt to remind you that you have exceeded the time limit. If you only specified the start time, the system will automatically calculate the end time (end time = start time + 24 hours). On the contrary, if you only specified the end time, the system will calculate the start time (start time= end time - 24 hours) the same way.\n\n**Fee**\n\nOrders on KuCoin Futures platform are classified into two types, taker and maker. A taker order matches other resting orders on the exchange order book, and gets executed immediately after order entry. A maker order, on the contrary, stays on the exchange order book and awaits to be matched. Taker orders will be charged taker fees, while maker orders will receive maker rebates. Please note that market orders, iceberg orders and hidden orders are always charged taker fees.\n\nThe system will pre-freeze a predicted taker fee when you place an order.The liquidity field indicates if the fill was charged taker or maker fees.\n\nThe system will pre-freeze the predicted fees (including the maintenance margin needed for the position, entry fees and fees to close positions) if you added the position, and will not pre-freeze fees if you reduced the position. After the order is executed, if you added positions, the system will deduct entry fees from your balance, if you closed positions, the system will deduct the close fees.", + "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Futures\",\"api-channel\":\"Private\",\"api-permission\":\"Futures\",\"api-rate-limit-pool\":\"Futures\",\"sdk-service\":\"Futures\",\"sdk-sub-service\":\"Order\",\"sdk-method-name\":\"getTradeHistory\",\"sdk-method-description\":\"Get a list of recent fills. If you need to get your recent trade history with low latency, please query endpoint Get List of Orders Completed in 24h. The requested data is not real-time.\",\"api-rate-limit\":5}" } } ] @@ -32139,46 +32139,20 @@ "description": "", "items": [ { - "name": "Get Max Open Size", + "name": "Get Margin Mode", "api": { - "id": "3470251", + "id": "3470259", "method": "get", - "path": "/api/v2/getMaxOpenSize", + "path": "/api/v2/position/getMarginMode", "parameters": { "query": [ { - "id": "4wXlXiQszi", + "id": "1BH2JPcdrO", "name": "symbol", "required": true, "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](apidog://link/endpoint/3470220) ", + "example": "XBTUSDTM", "type": "string", - "schema": { - "type": "string", - "examples": [ - "XBTUSDTM", - "XBTUSDM", - "ETHUSDTM" - ] - }, - "enable": true - }, - { - "id": "uaSHeFQTjq", - "name": "price", - "required": true, - "description": "Order price\n", - "type": "string", - "enable": true - }, - { - "id": "WUcubn1a2F", - "name": "leverage", - "required": true, - "description": "Leverage\n", - "type": "integer", - "schema": { - "type": "integer" - }, "enable": true } ], @@ -32188,7 +32162,7 @@ }, "responses": [ { - "id": "10415", + "id": "10423", "code": 200, "name": "成功", "headers": [], @@ -32205,19 +32179,30 @@ "type": "string", "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](apidog://link/endpoint/3470220) " }, - "maxBuyOpenSize": { - "type": "integer", - "description": "Maximum buy size\n" - }, - "maxSellOpenSize": { - "type": "integer", - "description": "Maximum buy size\n" + "marginMode": { + "type": "string", + "description": "Margin mode: ISOLATED (isolated), CROSS (cross margin).", + "enum": [ + "ISOLATED", + "CROSS" + ], + "x-api-enum": [ + { + "value": "ISOLATED", + "name": "ISOLATED", + "description": "isolated margin" + }, + { + "value": "CROSS", + "name": "CROSS", + "description": "cross margin" + } + ] } }, "required": [ "symbol", - "maxBuyOpenSize", - "maxSellOpenSize" + "marginMode" ] } }, @@ -32234,8 +32219,8 @@ "responseExamples": [ { "name": "Success", - "data": "{\n \"code\": \"200000\",\n \"data\": {\n \"symbol\": \"XBTUSDTM\",\n \"maxBuyOpenSize\": 0,\n \"maxSellOpenSize\": 0\n }\n}", - "responseId": 10415, + "data": "{\n \"code\": \"200000\",\n \"data\": {\n \"symbol\": \"XBTUSDTM\",\n \"marginMode\": \"ISOLATED\"\n }\n}", + "responseId": 10423, "ordering": 1 } ], @@ -32249,35 +32234,185 @@ "example": "", "mediaType": "" }, - "description": ":::info[Description]\nGet Maximum Open Position Size.\n:::", - "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Futures\",\"api-channel\":\"Private\",\"api-permission\":\"Futures\",\"api-rate-limit-pool\":\"Futures\",\"sdk-service\":\"Futures\",\"sdk-sub-service\":\"Positions\",\"sdk-method-name\":\"GetMaxOpenSize\",\"sdk-method-description\":\"Get Maximum Open Position Size.\",\"api-rate-limit\":2}" + "description": ":::info[Description]\nThis interface can query the margin mode of the current symbol.\n:::", + "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Futures\",\"api-channel\":\"Private\",\"api-permission\":\"Futures\",\"api-rate-limit-pool\":\"Futures\",\"sdk-service\":\"Futures\",\"sdk-sub-service\":\"Positions\",\"sdk-method-name\":\"getMarginMode\",\"sdk-method-description\":\"This interface can query the margin mode of the current symbol.\",\"api-rate-limit\":2}" } }, { - "name": "Get Isolated Margin Risk Limit", + "name": "Switch Margin Mode", "api": { - "id": "3470263", - "method": "get", - "path": "/api/v1/contracts/risk-limit/{symbol}", + "id": "3470262", + "method": "post", + "path": "/api/v2/position/changeMarginMode", "parameters": { "query": [], - "path": [ + "path": [], + "cookie": [], + "header": [] + }, + "responses": [ + { + "id": "10426", + "code": 200, + "name": "成功", + "headers": [], + "jsonSchema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "object", + "properties": { + "symbol": { + "type": "string", + "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](apidog://link/endpoint/3470220) " + }, + "marginMode": { + "type": "string", + "description": "Margin mode: ISOLATED (isolated), CROSS (cross margin).", + "enum": [ + "ISOLATED", + "CROSS" + ], + "x-api-enum": [ + { + "value": "ISOLATED", + "name": "ISOLATED", + "description": "isolated margin" + }, + { + "value": "CROSS", + "name": "CROSS", + "description": "cross margin" + } + ] + } + }, + "required": [ + "symbol", + "marginMode" + ] + } + }, + "required": [ + "code", + "data" + ] + }, + "description": "", + "contentType": "json", + "mediaType": "" + } + ], + "responseExamples": [ + { + "name": "Success", + "data": "{\n \"code\": \"200000\",\n \"data\": {\n \"symbol\": \"XBTUSDTM\",\n \"marginMode\": \"ISOLATED\"\n }\n}", + "responseId": 10426, + "ordering": 1 + } + ], + "requestBody": { + "type": "application/json", + "parameters": [], + "jsonSchema": { + "type": "object", + "properties": { + "symbol": { + "type": "string", + "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](apidog://link/endpoint/3470220) ", + "examples": [ + "XBTUSDTM", + "XBTUSDCM", + "ETHUSDTM" + ] + }, + "marginMode": { + "type": "string", + "description": "Modified margin model: ISOLATED (isolated), CROSS (cross margin).", + "enum": [ + "ISOLATED", + "CROSS" + ], + "x-api-enum": [ + { + "value": "ISOLATED", + "name": "ISOLATED", + "description": "Isolated Margin Mode" + }, + { + "value": "CROSS", + "name": "CROSS", + "description": "Cross Margin MOde" + } + ] + } + }, + "required": [ + "symbol", + "marginMode" + ] + }, + "example": "{\n \"symbol\": \"XBTUSDTM\",\n \"marginMode\": \"ISOLATED\"\n}", + "mediaType": "" + }, + "description": ":::info[Description]\nModify the margin mode of the current symbol.\n:::", + "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Futures\",\"api-channel\":\"Private\",\"api-permission\":\"Futures\",\"api-rate-limit-pool\":\"Futures\",\"sdk-service\":\"Futures\",\"sdk-sub-service\":\"Positions\",\"sdk-method-name\":\"switchMarginMode\",\"sdk-method-description\":\"This interface can modify the margin mode of the current symbol.\",\"api-rate-limit\":2}" + } + }, + { + "name": "Get Max Open Size", + "api": { + "id": "3470251", + "method": "get", + "path": "/api/v2/getMaxOpenSize", + "parameters": { + "query": [ { - "id": "symbol#0", + "id": "4wXlXiQszi", "name": "symbol", "required": true, "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](apidog://link/endpoint/3470220) ", - "example": "XBTUSDTM", "type": "string", + "schema": { + "type": "string", + "examples": [ + "XBTUSDTM", + "XBTUSDM", + "ETHUSDTM" + ] + }, + "enable": true + }, + { + "id": "uaSHeFQTjq", + "name": "price", + "required": true, + "description": "Order price\n", + "type": "string", + "enable": true + }, + { + "id": "WUcubn1a2F", + "name": "leverage", + "required": true, + "description": "Leverage\n", + "type": "integer", + "schema": { + "type": "integer" + }, "enable": true } ], + "path": [], "cookie": [], "header": [] }, "responses": [ { - "id": "10427", + "id": "10415", "code": 200, "name": "成功", "headers": [], @@ -32288,49 +32423,26 @@ "type": "string" }, "data": { - "type": "array", - "items": { - "type": "object", - "properties": { - "symbol": { - "type": "string", - "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](apidog://link/endpoint/3470220) " - }, - "level": { - "type": "integer", - "description": "level\n" - }, - "maxRiskLimit": { - "type": "integer", - "description": "Upper limit USDT(includes)\n" - }, - "minRiskLimit": { - "type": "integer", - "description": "Lower limit USDT\n" - }, - "maxLeverage": { - "type": "integer", - "description": "Max leverage\n" - }, - "initialMargin": { - "type": "number", - "description": "Initial margin rate\n" - }, - "maintainMargin": { - "type": "number", - "description": "Maintenance margin rate\n" - } + "type": "object", + "properties": { + "symbol": { + "type": "string", + "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](apidog://link/endpoint/3470220) " }, - "required": [ - "symbol", - "level", - "maxRiskLimit", - "minRiskLimit", - "maxLeverage", - "initialMargin", - "maintainMargin" - ] - } + "maxBuyOpenSize": { + "type": "integer", + "description": "Maximum buy size\n" + }, + "maxSellOpenSize": { + "type": "integer", + "description": "Maximum buy size\n" + } + }, + "required": [ + "symbol", + "maxBuyOpenSize", + "maxSellOpenSize" + ] } }, "required": [ @@ -32346,8 +32458,8 @@ "responseExamples": [ { "name": "Success", - "data": "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"symbol\": \"XBTUSDTM\",\n \"level\": 1,\n \"maxRiskLimit\": 100000,\n \"minRiskLimit\": 0,\n \"maxLeverage\": 125,\n \"initialMargin\": 0.008,\n \"maintainMargin\": 0.004\n },\n {\n \"symbol\": \"XBTUSDTM\",\n \"level\": 2,\n \"maxRiskLimit\": 500000,\n \"minRiskLimit\": 100000,\n \"maxLeverage\": 100,\n \"initialMargin\": 0.01,\n \"maintainMargin\": 0.005\n },\n {\n \"symbol\": \"XBTUSDTM\",\n \"level\": 3,\n \"maxRiskLimit\": 1000000,\n \"minRiskLimit\": 500000,\n \"maxLeverage\": 75,\n \"initialMargin\": 0.014,\n \"maintainMargin\": 0.007\n },\n {\n \"symbol\": \"XBTUSDTM\",\n \"level\": 4,\n \"maxRiskLimit\": 2000000,\n \"minRiskLimit\": 1000000,\n \"maxLeverage\": 50,\n \"initialMargin\": 0.02,\n \"maintainMargin\": 0.01\n },\n {\n \"symbol\": \"XBTUSDTM\",\n \"level\": 5,\n \"maxRiskLimit\": 3000000,\n \"minRiskLimit\": 2000000,\n \"maxLeverage\": 30,\n \"initialMargin\": 0.034,\n \"maintainMargin\": 0.017\n },\n {\n \"symbol\": \"XBTUSDTM\",\n \"level\": 6,\n \"maxRiskLimit\": 5000000,\n \"minRiskLimit\": 3000000,\n \"maxLeverage\": 20,\n \"initialMargin\": 0.05,\n \"maintainMargin\": 0.025\n },\n {\n \"symbol\": \"XBTUSDTM\",\n \"level\": 7,\n \"maxRiskLimit\": 8000000,\n \"minRiskLimit\": 5000000,\n \"maxLeverage\": 10,\n \"initialMargin\": 0.1,\n \"maintainMargin\": 0.05\n },\n {\n \"symbol\": \"XBTUSDTM\",\n \"level\": 8,\n \"maxRiskLimit\": 12000000,\n \"minRiskLimit\": 8000000,\n \"maxLeverage\": 5,\n \"initialMargin\": 0.2,\n \"maintainMargin\": 0.1\n },\n {\n \"symbol\": \"XBTUSDTM\",\n \"level\": 9,\n \"maxRiskLimit\": 20000000,\n \"minRiskLimit\": 12000000,\n \"maxLeverage\": 4,\n \"initialMargin\": 0.25,\n \"maintainMargin\": 0.125\n },\n {\n \"symbol\": \"XBTUSDTM\",\n \"level\": 10,\n \"maxRiskLimit\": 30000000,\n \"minRiskLimit\": 20000000,\n \"maxLeverage\": 3,\n \"initialMargin\": 0.334,\n \"maintainMargin\": 0.167\n },\n {\n \"symbol\": \"XBTUSDTM\",\n \"level\": 11,\n \"maxRiskLimit\": 40000000,\n \"minRiskLimit\": 30000000,\n \"maxLeverage\": 2,\n \"initialMargin\": 0.5,\n \"maintainMargin\": 0.25\n },\n {\n \"symbol\": \"XBTUSDTM\",\n \"level\": 12,\n \"maxRiskLimit\": 50000000,\n \"minRiskLimit\": 40000000,\n \"maxLeverage\": 1,\n \"initialMargin\": 1.0,\n \"maintainMargin\": 0.5\n }\n ]\n}", - "responseId": 10427, + "data": "{\n \"code\": \"200000\",\n \"data\": {\n \"symbol\": \"XBTUSDTM\",\n \"maxBuyOpenSize\": 0,\n \"maxSellOpenSize\": 0\n }\n}", + "responseId": 10415, "ordering": 1 } ], @@ -32361,8 +32473,8 @@ "example": "", "mediaType": "" }, - "description": ":::info[Description]\nThis interface can be used to obtain information about risk limit level of a specific contract(Only valid for isolated Margin).\n:::\n", - "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Futures\",\"api-channel\":\"Private\",\"api-permission\":\"Futures\",\"api-rate-limit-pool\":\"Public\",\"sdk-service\":\"Futures\",\"sdk-sub-service\":\"Positions\",\"sdk-method-name\":\"getIsolatedMarginRiskLimit\",\"sdk-method-description\":\"This interface can be used to obtain information about risk limit level of a specific contract(Only valid for isolated Margin).\",\"api-rate-limit\":5}" + "description": ":::info[Description]\nGet Maximum Open Position Size.\n:::", + "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Futures\",\"api-channel\":\"Private\",\"api-permission\":\"Futures\",\"api-rate-limit-pool\":\"Futures\",\"sdk-service\":\"Futures\",\"sdk-sub-service\":\"Positions\",\"sdk-method-name\":\"GetMaxOpenSize\",\"sdk-method-description\":\"Get Maximum Open Position Size.\",\"api-rate-limit\":2}" } }, { @@ -32678,80 +32790,6 @@ "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Futures\",\"api-channel\":\"Private\",\"api-permission\":\"Futures\",\"api-rate-limit-pool\":\"Futures\",\"sdk-service\":\"Futures\",\"sdk-sub-service\":\"Positions\",\"sdk-method-name\":\"GetPositionDetails\",\"sdk-method-description\":\"Get the position details of a specified position.\",\"api-rate-limit\":2}" } }, - { - "name": "Modify Isolated Margin Risk Limit", - "api": { - "id": "3470264", - "method": "post", - "path": "/api/v1/position/risk-limit-level/change", - "parameters": { - "query": [], - "path": [], - "cookie": [], - "header": [] - }, - "responses": [ - { - "id": "10428", - "code": 200, - "name": "成功", - "headers": [], - "jsonSchema": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "data": { - "type": "boolean", - "description": "To adjust the level will cancel the open order, the response can only indicate whether the submit of the adjustment request is successful or not.\n" - } - }, - "required": [ - "code", - "data" - ] - }, - "description": "", - "contentType": "json", - "mediaType": "" - } - ], - "responseExamples": [ - { - "name": "Success", - "data": "{\n \"code\": \"200000\",\n \"data\": true\n}", - "responseId": 10428, - "ordering": 1 - } - ], - "requestBody": { - "type": "application/json", - "parameters": [], - "jsonSchema": { - "type": "object", - "properties": { - "symbol": { - "type": "string", - "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](apidog://link/endpoint/3470220) " - }, - "level": { - "type": "integer", - "description": "level" - } - }, - "required": [ - "symbol", - "level" - ] - }, - "example": "{\n \"symbol\" : \"XBTUSDTM\",\n \"level\" : 2\n}", - "mediaType": "" - }, - "description": ":::info[Description]\nThis interface is for the adjustment of the risk limit level(Only valid for isolated Margin). To adjust the level will cancel the open order, the response can only indicate whether the submit of the adjustment request is successful or not. The result of the adjustment can be achieved by WebSocket information: Position Change Events\n\n:::\n\n", - "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Futures\",\"api-channel\":\"Private\",\"api-permission\":\"Futures\",\"api-rate-limit-pool\":\"Futures\",\"sdk-service\":\"Futures\",\"sdk-sub-service\":\"Positions\",\"sdk-method-name\":\"modifyIsolatedMarginRiskLimt\",\"sdk-method-description\":\"This interface can be used to obtain information about risk limit level of a specific contract(Only valid for isolated Margin).\",\"api-rate-limit\":5}" - } - }, { "name": "Get Position List", "api": { @@ -33329,11 +33367,165 @@ } }, { - "name": "Remove Isolated Margin", + "name": "Get Max Withdraw Margin", "api": { - "id": "3470256", + "id": "3470258", + "method": "get", + "path": "/api/v1/margin/maxWithdrawMargin", + "parameters": { + "query": [ + { + "id": "1BH2JPcdrO", + "name": "symbol", + "required": true, + "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](apidog://link/endpoint/3470220) ", + "type": "string", + "enable": true + } + ], + "path": [], + "cookie": [], + "header": [] + }, + "responses": [ + { + "id": "10422", + "code": 200, + "name": "成功", + "headers": [], + "jsonSchema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "string", + "description": "The size of the position that can be deposited. If it is USDT-margin, it represents the amount of USDT. If it is coin-margin, this value represents the number of coins\n" + } + }, + "required": [ + "code", + "data" + ] + }, + "description": "", + "contentType": "json", + "mediaType": "" + } + ], + "responseExamples": [ + { + "name": "Success", + "data": "{\n \"code\": \"200000\",\n \"data\": \"21.1135719252\"\n}", + "responseId": 10422, + "ordering": 1 + } + ], + "requestBody": { + "type": "none", + "parameters": [], + "jsonSchema": { + "type": "object", + "properties": {} + }, + "example": "", + "mediaType": "" + }, + "description": ":::info[Description]\nThis interface can query the maximum amount of margin that the current position supports withdrawal.\n:::\n", + "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Futures\",\"api-channel\":\"Private\",\"api-permission\":\"Futures\",\"api-rate-limit-pool\":\"Futures\",\"sdk-service\":\"Futures\",\"sdk-sub-service\":\"Positions\",\"sdk-method-name\":\"GetMaxWithdrawMargin\",\"sdk-method-description\":\"This interface can query the maximum amount of margin that the current position supports withdrawal.\",\"api-rate-limit\":10}" + } + }, + { + "name": "Get Cross Margin Leverage", + "api": { + "id": "3470260", + "method": "get", + "path": "/api/v2/getCrossUserLeverage", + "parameters": { + "query": [ + { + "id": "1BH2JPcdrO", + "name": "symbol", + "required": true, + "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](apidog://link/endpoint/3470220) ", + "example": "XBTUSDTM", + "type": "string", + "enable": true + } + ], + "path": [], + "cookie": [], + "header": [] + }, + "responses": [ + { + "id": "10424", + "code": 200, + "name": "成功", + "headers": [], + "jsonSchema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "object", + "properties": { + "symbol": { + "type": "string", + "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](apidog://link/endpoint/3470220) " + }, + "leverage": { + "type": "string", + "description": "Leverage multiple" + } + }, + "required": [ + "symbol", + "leverage" + ] + } + }, + "required": [ + "code", + "data" + ] + }, + "description": "", + "contentType": "json", + "mediaType": "" + } + ], + "responseExamples": [ + { + "name": "Success", + "data": "{\n \"code\": \"200000\",\n \"data\": {\n \"symbol\": \"XBTUSDTM\",\n \"leverage\": \"3\"\n }\n}", + "responseId": 10424, + "ordering": 1 + } + ], + "requestBody": { + "type": "none", + "parameters": [], + "jsonSchema": { + "type": "object", + "properties": {} + }, + "example": "", + "mediaType": "" + }, + "description": ":::info[Description]\nThis interface can query the current symbol’s cross-margin leverage multiple.\n:::\n", + "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Futures\",\"api-channel\":\"Private\",\"api-permission\":\"Futures\",\"api-rate-limit-pool\":\"Futures\",\"sdk-service\":\"Futures\",\"sdk-sub-service\":\"Positions\",\"sdk-method-name\":\"getCrossMarginLeverage\",\"sdk-method-description\":\"This interface can query the current symbol’s cross-margin leverage multiple.\",\"api-rate-limit\":2}" + } + }, + { + "name": "Modify Cross Margin Leverage", + "api": { + "id": "3470261", "method": "post", - "path": "/api/v1/margin/withdrawMargin", + "path": "/api/v2/changeCrossUserLeverage", "parameters": { "query": [], "path": [], @@ -33342,7 +33534,7 @@ }, "responses": [ { - "id": "10420", + "id": "10425", "code": 200, "name": "成功", "headers": [], @@ -33353,8 +33545,19 @@ "type": "string" }, "data": { - "type": "string", - "description": "The size of the position deposited. If it is USDT-margin, it represents the amount of USDT. If it is coin-margin, this value represents the number of coins\n" + "type": "object", + "properties": { + "symbol": { + "type": "string" + }, + "leverage": { + "type": "string" + } + }, + "required": [ + "symbol", + "leverage" + ] } }, "required": [ @@ -33370,8 +33573,8 @@ "responseExamples": [ { "name": "Success", - "data": "{\n \"code\": \"200000\",\n \"data\": \"0.1\"\n}", - "responseId": 10420, + "data": "{\n \"code\": \"200000\",\n \"data\": {\n \"symbol\": \"XBTUSDTM\",\n \"leverage\": \"3\"\n }\n}", + "responseId": 10425, "ordering": 1 } ], @@ -33385,21 +33588,21 @@ "type": "string", "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](apidog://link/endpoint/3470220) " }, - "withdrawAmount": { + "leverage": { "type": "string", - "description": "The size of the position that can be deposited. If it is USDT-margin, it represents the amount of USDT. If it is coin-margin, this value represents the number of coins\n" + "description": "Leverage multiple" } }, "required": [ "symbol", - "withdrawAmount" + "leverage" ] }, - "example": "{\n \"symbol\": \"XBTUSDTM\",\n \"withdrawAmount\": \"0.0000001\"\n}", + "example": "{\n \"symbol\": \"XBTUSDTM\",\n \"leverage\" : \"10\"\n}", "mediaType": "" }, - "description": ":::info[Description]\nRemove Isolated Margin Manually.\n:::", - "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Futures\",\"api-channel\":\"Private\",\"api-permission\":\"Futures\",\"api-rate-limit-pool\":\"Futures\",\"sdk-service\":\"Futures\",\"sdk-sub-service\":\"Positions\",\"sdk-method-name\":\"RemoveIsolatedMargin\",\"sdk-method-description\":\"Remove Isolated Margin Manually.\",\"api-rate-limit\":10}" + "description": ":::info[Description]\nThis interface can modify the current symbol’s cross-margin leverage multiple.\n:::\n", + "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Futures\",\"api-channel\":\"Private\",\"api-permission\":\"Futures\",\"api-rate-limit-pool\":\"Futures\",\"sdk-service\":\"Futures\",\"sdk-sub-service\":\"Positions\",\"sdk-method-name\":\"ModifyMarginLeverage\",\"sdk-method-description\":\"This interface can modify the current symbol’s cross-margin leverage multiple.\",\"api-rate-limit\":2}" } }, { @@ -33611,102 +33814,14 @@ "realisedGrossPnl", "realisedPnl", "unrealisedPnl", - "unrealisedPnlPcnt", - "unrealisedRoePcnt", - "avgEntryPrice", - "liquidationPrice", - "bankruptPrice", - "userId", - "settleCurrency" - ] - } - }, - "required": [ - "code", - "data" - ] - }, - "description": "", - "contentType": "json", - "mediaType": "" - } - ], - "responseExamples": [ - { - "name": "Success", - "data": "{\n \"code\": \"200000\",\n \"data\": {\n \"id\": \"6200c9b83aecfb000152ddcd\",\n \"symbol\": \"XBTUSDTM\",\n \"autoDeposit\": false,\n \"maintMarginReq\": 0.005,\n \"riskLimit\": 500000,\n \"realLeverage\": 18.72,\n \"crossMode\": false,\n \"delevPercentage\": 0.66,\n \"openingTimestamp\": 1646287090131,\n \"currentTimestamp\": 1646295055021,\n \"currentQty\": 1,\n \"currentCost\": 43.388,\n \"currentComm\": 0.0260328,\n \"unrealisedCost\": 43.388,\n \"realisedGrossCost\": 0,\n \"realisedCost\": 0.0260328,\n \"isOpen\": true,\n \"markPrice\": 43536.65,\n \"markValue\": 43.53665,\n \"posCost\": 43.388,\n \"posCross\": 0.000024985,\n \"posInit\": 2.1694,\n \"posComm\": 0.02733446,\n \"posLoss\": 0,\n \"posMargin\": 2.19675944,\n \"posMaint\": 0.24861326,\n \"maintMargin\": 2.34540944,\n \"realisedGrossPnl\": 0,\n \"realisedPnl\": -0.0260328,\n \"unrealisedPnl\": 0.14865,\n \"unrealisedPnlPcnt\": 0.0034,\n \"unrealisedRoePcnt\": 0.0685,\n \"avgEntryPrice\": 43388,\n \"liquidationPrice\": 41440,\n \"bankruptPrice\": 41218,\n \"userId\": 1234321123,\n \"settleCurrency\": \"USDT\"\n }\n}", - "responseId": 10421, - "ordering": 1 - } - ], - "requestBody": { - "type": "application/json", - "parameters": [], - "jsonSchema": { - "type": "object", - "properties": { - "symbol": { - "type": "string", - "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](apidog://link/endpoint/3470220) " - }, - "margin": { - "type": "number", - "description": "Margin amount (min. margin amount≥0.00001667XBT)" - }, - "bizNo": { - "type": "string", - "description": "A unique ID generated by the user, to ensure the operation is processed by the system only once, The maximum length cannot exceed 36" - } - }, - "required": [ - "symbol", - "margin", - "bizNo" - ] - }, - "example": "{\n \"symbol\": \"string\",\n \"margin\": 0,\n \"bizNo\": \"string\"\n}", - "mediaType": "" - }, - "description": ":::info[Description]\nAdd Isolated Margin Manually.\n:::", - "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Futures\",\"api-channel\":\"Private\",\"api-permission\":\"Futures\",\"api-rate-limit-pool\":\"Futures\",\"sdk-service\":\"Futures\",\"sdk-sub-service\":\"Positions\",\"sdk-method-name\":\"AddIsolatedMargin\",\"sdk-method-description\":\"Add Isolated Margin Manually.\",\"api-rate-limit\":4}" - } - }, - { - "name": "Get Max Withdraw Margin", - "api": { - "id": "3470258", - "method": "get", - "path": "/api/v1/margin/maxWithdrawMargin", - "parameters": { - "query": [ - { - "id": "1BH2JPcdrO", - "name": "symbol", - "required": true, - "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](apidog://link/endpoint/3470220) ", - "type": "string", - "enable": true - } - ], - "path": [], - "cookie": [], - "header": [] - }, - "responses": [ - { - "id": "10422", - "code": 200, - "name": "成功", - "headers": [], - "jsonSchema": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "data": { - "type": "string", - "description": "The size of the position that can be deposited. If it is USDT-margin, it represents the amount of USDT. If it is coin-margin, this value represents the number of coins\n" + "unrealisedPnlPcnt", + "unrealisedRoePcnt", + "avgEntryPrice", + "liquidationPrice", + "bankruptPrice", + "userId", + "settleCurrency" + ] } }, "required": [ @@ -33722,50 +33837,58 @@ "responseExamples": [ { "name": "Success", - "data": "{\n \"code\": \"200000\",\n \"data\": \"21.1135719252\"\n}", - "responseId": 10422, + "data": "{\n \"code\": \"200000\",\n \"data\": {\n \"id\": \"6200c9b83aecfb000152ddcd\",\n \"symbol\": \"XBTUSDTM\",\n \"autoDeposit\": false,\n \"maintMarginReq\": 0.005,\n \"riskLimit\": 500000,\n \"realLeverage\": 18.72,\n \"crossMode\": false,\n \"delevPercentage\": 0.66,\n \"openingTimestamp\": 1646287090131,\n \"currentTimestamp\": 1646295055021,\n \"currentQty\": 1,\n \"currentCost\": 43.388,\n \"currentComm\": 0.0260328,\n \"unrealisedCost\": 43.388,\n \"realisedGrossCost\": 0,\n \"realisedCost\": 0.0260328,\n \"isOpen\": true,\n \"markPrice\": 43536.65,\n \"markValue\": 43.53665,\n \"posCost\": 43.388,\n \"posCross\": 0.000024985,\n \"posInit\": 2.1694,\n \"posComm\": 0.02733446,\n \"posLoss\": 0,\n \"posMargin\": 2.19675944,\n \"posMaint\": 0.24861326,\n \"maintMargin\": 2.34540944,\n \"realisedGrossPnl\": 0,\n \"realisedPnl\": -0.0260328,\n \"unrealisedPnl\": 0.14865,\n \"unrealisedPnlPcnt\": 0.0034,\n \"unrealisedRoePcnt\": 0.0685,\n \"avgEntryPrice\": 43388,\n \"liquidationPrice\": 41440,\n \"bankruptPrice\": 41218,\n \"userId\": 1234321123,\n \"settleCurrency\": \"USDT\"\n }\n}", + "responseId": 10421, "ordering": 1 } ], "requestBody": { - "type": "none", + "type": "application/json", "parameters": [], "jsonSchema": { "type": "object", - "properties": {} + "properties": { + "symbol": { + "type": "string", + "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](apidog://link/endpoint/3470220) " + }, + "margin": { + "type": "number", + "description": "Margin amount (min. margin amount≥0.00001667XBT)" + }, + "bizNo": { + "type": "string", + "description": "A unique ID generated by the user, to ensure the operation is processed by the system only once, The maximum length cannot exceed 36" + } + }, + "required": [ + "symbol", + "margin", + "bizNo" + ] }, - "example": "", + "example": "{\n \"symbol\": \"string\",\n \"margin\": 0,\n \"bizNo\": \"string\"\n}", "mediaType": "" }, - "description": ":::info[Description]\nThis interface can query the maximum amount of margin that the current position supports withdrawal.\n:::\n", - "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Futures\",\"api-channel\":\"Private\",\"api-permission\":\"Futures\",\"api-rate-limit-pool\":\"Futures\",\"sdk-service\":\"Futures\",\"sdk-sub-service\":\"Positions\",\"sdk-method-name\":\"GetMaxWithdrawMargin\",\"sdk-method-description\":\"This interface can query the maximum amount of margin that the current position supports withdrawal.\",\"api-rate-limit\":10}" + "description": ":::info[Description]\nAdd Isolated Margin Manually.\n:::", + "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Futures\",\"api-channel\":\"Private\",\"api-permission\":\"Futures\",\"api-rate-limit-pool\":\"Futures\",\"sdk-service\":\"Futures\",\"sdk-sub-service\":\"Positions\",\"sdk-method-name\":\"AddIsolatedMargin\",\"sdk-method-description\":\"Add Isolated Margin Manually.\",\"api-rate-limit\":4}" } }, { - "name": "Get Margin Mode", + "name": "Remove Isolated Margin", "api": { - "id": "3470259", - "method": "get", - "path": "/api/v2/position/getMarginMode", + "id": "3470256", + "method": "post", + "path": "/api/v1/margin/withdrawMargin", "parameters": { - "query": [ - { - "id": "1BH2JPcdrO", - "name": "symbol", - "required": true, - "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](apidog://link/endpoint/3470220) ", - "example": "XBTUSDTM", - "type": "string", - "enable": true - } - ], + "query": [], "path": [], "cookie": [], "header": [] }, "responses": [ { - "id": "10423", + "id": "10420", "code": 200, "name": "成功", "headers": [], @@ -33776,37 +33899,8 @@ "type": "string" }, "data": { - "type": "object", - "properties": { - "symbol": { - "type": "string", - "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](apidog://link/endpoint/3470220) " - }, - "marginMode": { - "type": "string", - "description": "Margin mode: ISOLATED (isolated), CROSS (cross margin).", - "enum": [ - "ISOLATED", - "CROSS" - ], - "x-api-enum": [ - { - "value": "ISOLATED", - "name": "ISOLATED", - "description": "isolated margin" - }, - { - "value": "CROSS", - "name": "CROSS", - "description": "cross margin" - } - ] - } - }, - "required": [ - "symbol", - "marginMode" - ] + "type": "string", + "description": "The size of the position deposited. If it is USDT-margin, it represents the amount of USDT. If it is coin-margin, this value represents the number of coins\n" } }, "required": [ @@ -33822,35 +33916,49 @@ "responseExamples": [ { "name": "Success", - "data": "{\n \"code\": \"200000\",\n \"data\": {\n \"symbol\": \"XBTUSDTM\",\n \"marginMode\": \"ISOLATED\"\n }\n}", - "responseId": 10423, + "data": "{\n \"code\": \"200000\",\n \"data\": \"0.1\"\n}", + "responseId": 10420, "ordering": 1 } ], "requestBody": { - "type": "none", + "type": "application/json", "parameters": [], "jsonSchema": { "type": "object", - "properties": {} + "properties": { + "symbol": { + "type": "string", + "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](apidog://link/endpoint/3470220) " + }, + "withdrawAmount": { + "type": "string", + "description": "The size of the position that can be deposited. If it is USDT-margin, it represents the amount of USDT. If it is coin-margin, this value represents the number of coins\n" + } + }, + "required": [ + "symbol", + "withdrawAmount" + ] }, - "example": "", + "example": "{\n \"symbol\": \"XBTUSDTM\",\n \"withdrawAmount\": \"0.0000001\"\n}", "mediaType": "" }, - "description": ":::info[Description]\nThis interface can query the margin mode of the current symbol.\n:::", - "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Futures\",\"api-channel\":\"Private\",\"api-permission\":\"Futures\",\"api-rate-limit-pool\":\"Futures\",\"sdk-service\":\"Futures\",\"sdk-sub-service\":\"Positions\",\"sdk-method-name\":\"getMarginMode\",\"sdk-method-description\":\"This interface can query the margin mode of the current symbol.\",\"api-rate-limit\":2}" + "description": ":::info[Description]\nRemove Isolated Margin Manually.\n:::", + "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Futures\",\"api-channel\":\"Private\",\"api-permission\":\"Futures\",\"api-rate-limit-pool\":\"Futures\",\"sdk-service\":\"Futures\",\"sdk-sub-service\":\"Positions\",\"sdk-method-name\":\"RemoveIsolatedMargin\",\"sdk-method-description\":\"Remove Isolated Margin Manually.\",\"api-rate-limit\":10}" } }, { - "name": "Get Cross Margin Leverage", + "name": "Get Isolated Margin Risk Limit", "api": { - "id": "3470260", + "id": "3470263", "method": "get", - "path": "/api/v2/getCrossUserLeverage", + "path": "/api/v1/contracts/risk-limit/{symbol}", "parameters": { - "query": [ + "query": [], + "path": [ { - "id": "1BH2JPcdrO", + "id": "symbol#0", "name": "symbol", "required": true, "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](apidog://link/endpoint/3470220) ", @@ -33859,13 +33967,12 @@ "enable": true } ], - "path": [], "cookie": [], "header": [] }, "responses": [ { - "id": "10424", + "id": "10427", "code": 200, "name": "成功", "headers": [], @@ -33876,21 +33983,49 @@ "type": "string" }, "data": { - "type": "object", - "properties": { - "symbol": { - "type": "string", - "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](apidog://link/endpoint/3470220) " + "type": "array", + "items": { + "type": "object", + "properties": { + "symbol": { + "type": "string", + "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](apidog://link/endpoint/3470220) " + }, + "level": { + "type": "integer", + "description": "level\n" + }, + "maxRiskLimit": { + "type": "integer", + "description": "Upper limit USDT(includes)\n" + }, + "minRiskLimit": { + "type": "integer", + "description": "Lower limit USDT\n" + }, + "maxLeverage": { + "type": "integer", + "description": "Max leverage\n" + }, + "initialMargin": { + "type": "number", + "description": "Initial margin rate\n" + }, + "maintainMargin": { + "type": "number", + "description": "Maintenance margin rate\n" + } }, - "leverage": { - "type": "string", - "description": "Leverage multiple" - } - }, - "required": [ - "symbol", - "leverage" - ] + "required": [ + "symbol", + "level", + "maxRiskLimit", + "minRiskLimit", + "maxLeverage", + "initialMargin", + "maintainMargin" + ] + } } }, "required": [ @@ -33906,8 +34041,8 @@ "responseExamples": [ { "name": "Success", - "data": "{\n \"code\": \"200000\",\n \"data\": {\n \"symbol\": \"XBTUSDTM\",\n \"leverage\": \"3\"\n }\n}", - "responseId": 10424, + "data": "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"symbol\": \"XBTUSDTM\",\n \"level\": 1,\n \"maxRiskLimit\": 100000,\n \"minRiskLimit\": 0,\n \"maxLeverage\": 125,\n \"initialMargin\": 0.008,\n \"maintainMargin\": 0.004\n },\n {\n \"symbol\": \"XBTUSDTM\",\n \"level\": 2,\n \"maxRiskLimit\": 500000,\n \"minRiskLimit\": 100000,\n \"maxLeverage\": 100,\n \"initialMargin\": 0.01,\n \"maintainMargin\": 0.005\n },\n {\n \"symbol\": \"XBTUSDTM\",\n \"level\": 3,\n \"maxRiskLimit\": 1000000,\n \"minRiskLimit\": 500000,\n \"maxLeverage\": 75,\n \"initialMargin\": 0.014,\n \"maintainMargin\": 0.007\n },\n {\n \"symbol\": \"XBTUSDTM\",\n \"level\": 4,\n \"maxRiskLimit\": 2000000,\n \"minRiskLimit\": 1000000,\n \"maxLeverage\": 50,\n \"initialMargin\": 0.02,\n \"maintainMargin\": 0.01\n },\n {\n \"symbol\": \"XBTUSDTM\",\n \"level\": 5,\n \"maxRiskLimit\": 3000000,\n \"minRiskLimit\": 2000000,\n \"maxLeverage\": 30,\n \"initialMargin\": 0.034,\n \"maintainMargin\": 0.017\n },\n {\n \"symbol\": \"XBTUSDTM\",\n \"level\": 6,\n \"maxRiskLimit\": 5000000,\n \"minRiskLimit\": 3000000,\n \"maxLeverage\": 20,\n \"initialMargin\": 0.05,\n \"maintainMargin\": 0.025\n },\n {\n \"symbol\": \"XBTUSDTM\",\n \"level\": 7,\n \"maxRiskLimit\": 8000000,\n \"minRiskLimit\": 5000000,\n \"maxLeverage\": 10,\n \"initialMargin\": 0.1,\n \"maintainMargin\": 0.05\n },\n {\n \"symbol\": \"XBTUSDTM\",\n \"level\": 8,\n \"maxRiskLimit\": 12000000,\n \"minRiskLimit\": 8000000,\n \"maxLeverage\": 5,\n \"initialMargin\": 0.2,\n \"maintainMargin\": 0.1\n },\n {\n \"symbol\": \"XBTUSDTM\",\n \"level\": 9,\n \"maxRiskLimit\": 20000000,\n \"minRiskLimit\": 12000000,\n \"maxLeverage\": 4,\n \"initialMargin\": 0.25,\n \"maintainMargin\": 0.125\n },\n {\n \"symbol\": \"XBTUSDTM\",\n \"level\": 10,\n \"maxRiskLimit\": 30000000,\n \"minRiskLimit\": 20000000,\n \"maxLeverage\": 3,\n \"initialMargin\": 0.334,\n \"maintainMargin\": 0.167\n },\n {\n \"symbol\": \"XBTUSDTM\",\n \"level\": 11,\n \"maxRiskLimit\": 40000000,\n \"minRiskLimit\": 30000000,\n \"maxLeverage\": 2,\n \"initialMargin\": 0.5,\n \"maintainMargin\": 0.25\n },\n {\n \"symbol\": \"XBTUSDTM\",\n \"level\": 12,\n \"maxRiskLimit\": 50000000,\n \"minRiskLimit\": 40000000,\n \"maxLeverage\": 1,\n \"initialMargin\": 1.0,\n \"maintainMargin\": 0.5\n }\n ]\n}", + "responseId": 10427, "ordering": 1 } ], @@ -33921,16 +34056,16 @@ "example": "", "mediaType": "" }, - "description": ":::info[Description]\nThis interface can query the current symbol’s cross-margin leverage multiple.\n:::\n", - "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Futures\",\"api-channel\":\"Private\",\"api-permission\":\"Futures\",\"api-rate-limit-pool\":\"Futures\",\"sdk-service\":\"Futures\",\"sdk-sub-service\":\"Positions\",\"sdk-method-name\":\"getCrossMarginLeverage\",\"sdk-method-description\":\"This interface can query the current symbol’s cross-margin leverage multiple.\",\"api-rate-limit\":2}" + "description": ":::info[Description]\nThis interface can be used to obtain information about risk limit level of a specific contract(Only valid for isolated Margin).\n:::\n", + "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Futures\",\"api-channel\":\"Private\",\"api-permission\":\"Futures\",\"api-rate-limit-pool\":\"Public\",\"sdk-service\":\"Futures\",\"sdk-sub-service\":\"Positions\",\"sdk-method-name\":\"getIsolatedMarginRiskLimit\",\"sdk-method-description\":\"This interface can be used to obtain information about risk limit level of a specific contract(Only valid for isolated Margin).\",\"api-rate-limit\":5}" } }, { - "name": "Modify Cross Margin Leverage", + "name": "Modify Isolated Margin Risk Limit", "api": { - "id": "3470261", + "id": "3470264", "method": "post", - "path": "/api/v2/changeCrossUserLeverage", + "path": "/api/v1/position/risk-limit-level/change", "parameters": { "query": [], "path": [], @@ -33939,7 +34074,7 @@ }, "responses": [ { - "id": "10425", + "id": "10428", "code": 200, "name": "成功", "headers": [], @@ -33950,19 +34085,8 @@ "type": "string" }, "data": { - "type": "object", - "properties": { - "symbol": { - "type": "string" - }, - "leverage": { - "type": "string" - } - }, - "required": [ - "symbol", - "leverage" - ] + "type": "boolean", + "description": "To adjust the level will cancel the open order, the response can only indicate whether the submit of the adjustment request is successful or not.\n" } }, "required": [ @@ -33978,8 +34102,8 @@ "responseExamples": [ { "name": "Success", - "data": "{\n \"code\": \"200000\",\n \"data\": {\n \"symbol\": \"XBTUSDTM\",\n \"leverage\": \"3\"\n }\n}", - "responseId": 10425, + "data": "{\n \"code\": \"200000\",\n \"data\": true\n}", + "responseId": 10428, "ordering": 1 } ], @@ -33993,145 +34117,21 @@ "type": "string", "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](apidog://link/endpoint/3470220) " }, - "leverage": { - "type": "string", - "description": "Leverage multiple" - } - }, - "required": [ - "symbol", - "leverage" - ] - }, - "example": "{\n \"symbol\": \"XBTUSDTM\",\n \"leverage\" : \"10\"\n}", - "mediaType": "" - }, - "description": ":::info[Description]\nThis interface can modify the current symbol’s cross-margin leverage multiple.\n:::\n", - "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Futures\",\"api-channel\":\"Private\",\"api-permission\":\"Futures\",\"api-rate-limit-pool\":\"Futures\",\"sdk-service\":\"Futures\",\"sdk-sub-service\":\"Positions\",\"sdk-method-name\":\"ModifyMarginLeverage\",\"sdk-method-description\":\"This interface can modify the current symbol’s cross-margin leverage multiple.\",\"api-rate-limit\":2}" - } - }, - { - "name": "Switch Margin Mode", - "api": { - "id": "3470262", - "method": "post", - "path": "/api/v2/position/changeMarginMode", - "parameters": { - "query": [], - "path": [], - "cookie": [], - "header": [] - }, - "responses": [ - { - "id": "10426", - "code": 200, - "name": "成功", - "headers": [], - "jsonSchema": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "data": { - "type": "object", - "properties": { - "symbol": { - "type": "string", - "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](apidog://link/endpoint/3470220) " - }, - "marginMode": { - "type": "string", - "description": "Margin mode: ISOLATED (isolated), CROSS (cross margin).", - "enum": [ - "ISOLATED", - "CROSS" - ], - "x-api-enum": [ - { - "value": "ISOLATED", - "name": "ISOLATED", - "description": "isolated margin" - }, - { - "value": "CROSS", - "name": "CROSS", - "description": "cross margin" - } - ] - } - }, - "required": [ - "symbol", - "marginMode" - ] - } - }, - "required": [ - "code", - "data" - ] - }, - "description": "", - "contentType": "json", - "mediaType": "" - } - ], - "responseExamples": [ - { - "name": "Success", - "data": "{\n \"code\": \"200000\",\n \"data\": {\n \"symbol\": \"XBTUSDTM\",\n \"marginMode\": \"ISOLATED\"\n }\n}", - "responseId": 10426, - "ordering": 1 - } - ], - "requestBody": { - "type": "application/json", - "parameters": [], - "jsonSchema": { - "type": "object", - "properties": { - "symbol": { - "type": "string", - "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](apidog://link/endpoint/3470220) ", - "examples": [ - "XBTUSDTM", - "XBTUSDCM", - "ETHUSDTM" - ] - }, - "marginMode": { - "type": "string", - "description": "Modified margin model: ISOLATED (isolated), CROSS (cross margin).", - "enum": [ - "ISOLATED", - "CROSS" - ], - "x-api-enum": [ - { - "value": "ISOLATED", - "name": "ISOLATED", - "description": "Isolated Margin Mode" - }, - { - "value": "CROSS", - "name": "CROSS", - "description": "Cross Margin MOde" - } - ] + "level": { + "type": "integer", + "description": "level" } }, "required": [ "symbol", - "marginMode" + "level" ] }, - "example": "{\n \"symbol\": \"XBTUSDTM\",\n \"marginMode\": \"ISOLATED\"\n}", + "example": "{\n \"symbol\" : \"XBTUSDTM\",\n \"level\" : 2\n}", "mediaType": "" }, - "description": ":::info[Description]\nModify the margin mode of the current symbol.\n:::", - "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Futures\",\"api-channel\":\"Private\",\"api-permission\":\"Futures\",\"api-rate-limit-pool\":\"Futures\",\"sdk-service\":\"Futures\",\"sdk-sub-service\":\"Positions\",\"sdk-method-name\":\"switchMarginMode\",\"sdk-method-description\":\"This interface can modify the margin mode of the current symbol.\",\"api-rate-limit\":2}" + "description": ":::info[Description]\nThis interface is for the adjustment of the risk limit level(Only valid for isolated Margin). To adjust the level will cancel the open order, the response can only indicate whether the submit of the adjustment request is successful or not. The result of the adjustment can be achieved by WebSocket information: Position Change Events\n\n:::\n\n", + "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Futures\",\"api-channel\":\"Private\",\"api-permission\":\"Futures\",\"api-rate-limit-pool\":\"Futures\",\"sdk-service\":\"Futures\",\"sdk-sub-service\":\"Positions\",\"sdk-method-name\":\"modifyIsolatedMarginRiskLimt\",\"sdk-method-description\":\"This interface can be used to obtain information about risk limit level of a specific contract(Only valid for isolated Margin).\",\"api-rate-limit\":5}" } } ] @@ -34599,7 +34599,7 @@ "example": "", "mediaType": "" }, - "description": ":::info[Description]\nSubmit request to get the funding history.\n:::\n", + "description": ":::info[Description]\nSubmit request to get the funding history.\n:::\n\n:::tip[Tips]\nThe **from time** and **to time** range cannot exceed 3 month. An error will occur if the specified time window exceeds the range. \n\nIf only **from time** is entered, the default **to time** is the current time. If it exceeds 3 months, an error will be reported.\n\nIf only **to time** is entered, the system will automatically calculate the start time as end time minus 3month.\n:::\n", "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Futures\",\"api-channel\":\"Private\",\"api-permission\":\"Futures\",\"api-rate-limit-pool\":\"Futures\",\"sdk-service\":\"Futures\",\"sdk-sub-service\":\"FundingFees\",\"sdk-method-name\":\"getPrivateFundingHistory\",\"sdk-method-description\":\"Submit request to get the funding history.\",\"api-rate-limit\":5}" } } @@ -37454,170 +37454,41 @@ "name": "Success", "data": "{\n \"code\": \"200000\",\n \"data\": {\n \"parentUid\": \"1000000\",\n \"orders\": [\n {\n \"orderId\": \"1668458892612980737\",\n \"currency\": \"USDT\",\n \"principal\": \"100\",\n \"interest\": \"0\"\n }\n ],\n \"ltv\": {\n \"transferLtv\": \"0.6000\",\n \"onlyClosePosLtv\": \"0.7500\",\n \"delayedLiquidationLtv\": \"0.9000\",\n \"instantLiquidationLtv\": \"0.9500\",\n \"currentLtv\": \"0.0854\"\n },\n \"totalMarginAmount\": \"1170.36181573\",\n \"transferMarginAmount\": \"166.66666666\",\n \"margins\": [\n {\n \"marginCcy\": \"USDT\",\n \"marginQty\": \"1170.36181573\",\n \"marginFactor\": \"1.000000000000000000\"\n }\n ]\n }\n}", "responseId": 10443, - "ordering": 1 - } - ], - "requestBody": { - "type": "none", - "parameters": [], - "jsonSchema": { - "type": "object", - "properties": {} - }, - "example": "{\n \"currency\": \"USDT\",\n \"size\": 10,\n \"timeInForce\": \"FOK\",\n \"isIsolated\": false,\n \"isHf\": false\n}", - "mediaType": "" - }, - "description": ":::info[Description]\nThis endpoint allows getting affiliate user rebate information.\n:::", - "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"General\",\"api-rate-limit-pool\":\"Management\",\"sdk-service\":\"Affiliate\",\"sdk-sub-service\":\"Affiliate\",\"sdk-method-name\":\"getAccount\",\"sdk-method-description\":\"This endpoint allows getting affiliate user rebate information.\",\"api-rate-limit\":30}" - } - } - ] - }, - { - "name": "Broker", - "id": 348138, - "description": "", - "items": [ - { - "name": "Beginners", - "id": 348159, - "description": "", - "items": [] - }, - { - "name": "API Broker", - "id": 348160, - "description": "", - "items": [ - { - "name": "Get Broker Rebate", - "api": { - "id": "3470280", - "method": "get", - "path": "/api/v1/broker/api/rebase/download", - "parameters": { - "query": [ - { - "id": "6iUCMmMHEI", - "name": "begin", - "required": true, - "description": "Start time, for example: 20240610", - "example": "20240610", - "type": "string", - "enable": true - }, - { - "id": "5uqjEGNGxr", - "name": "end", - "required": true, - "description": "End time, for example: 20241010 (query data with a maximum interval of 6 months)\n", - "example": "20241010", - "type": "string", - "enable": true - }, - { - "id": "LzvLfsT2yl", - "name": "tradeType", - "required": true, - "description": "Transaction type, 1: spot 2: futures", - "example": "1", - "type": "string", - "schema": { - "type": "string", - "enum": [ - "1", - "2" - ], - "x-api-enum": [ - { - "value": "1", - "name": "", - "description": "spot" - }, - { - "value": "2", - "name": "", - "description": "futures" - } - ] - }, - "enable": true - } - ], - "path": [], - "cookie": [], - "header": [] - }, - "responses": [ - { - "id": "10444", - "code": 200, - "name": "OK", - "headers": [], - "jsonSchema": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "data": { - "type": "object", - "properties": { - "url": { - "type": "string", - "description": "Rebate order file (link is valid for 1 day)" - } - }, - "required": [ - "url" - ] - } - }, - "required": [ - "code", - "data" - ] - }, - "description": "", - "contentType": "json", - "mediaType": "" - } - ], - "responseExamples": [ - { - "name": "Success", - "data": "{\n \"code\": \"200000\",\n \"data\": {\n \"url\": \"https://kc-v2-promotion.s3.ap-northeast-1.amazonaws.com/broker/671aec522593f600019766d0_file.csv?X-Amz-Security-Token=IQo*********2cd90f14efb\"\n }\n}", - "responseId": 10444, - "ordering": 1 - } - ], - "requestBody": { - "type": "none", - "parameters": [], - "jsonSchema": { - "type": "object", - "properties": {} - }, - "example": "", - "mediaType": "" - }, - "description": ":::info[Description]\nThis interface supports downloading Broker rebate orders\n:::\n\n### Excel Response\n\n| Param | Description | Example |\n| ------------------- | ----------------- |--------- |\n| Date | Date | 2024/9/1 |\n| BrokerUID | Broker's UID | 3243241 |\n| AffiliateUID | Affiliate's UID | 2354546 |\n| UID | User's UID | 6345466 |\n| BizLine | Business Line(Spot、Futures) | Spot |\n| Volume | Volume | 0 |\n| TotalCommission | Total Commission = BrokerCommission + UserCommission + AffiliateCommission | 0 |\n| BrokerCommission | Broker Commission | 0 |\n| UserCommission | User Commission | 0 |\n| AffiliateCommission | Affiliate Commission | 0 |\n", - "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"General\",\"api-rate-limit-pool\":\"Management\",\"sdk-service\":\"Broker\",\"sdk-sub-service\":\"APIBroker\",\"sdk-method-name\":\"getRebase\",\"sdk-method-description\":\"This interface supports downloading Broker rebate orders\",\"api-rate-limit\":3}" + "ordering": 1 } - } - ] - }, + ], + "requestBody": { + "type": "none", + "parameters": [], + "jsonSchema": { + "type": "object", + "properties": {} + }, + "example": "{\n \"currency\": \"USDT\",\n \"size\": 10,\n \"timeInForce\": \"FOK\",\n \"isIsolated\": false,\n \"isHf\": false\n}", + "mediaType": "" + }, + "description": ":::info[Description]\nThis endpoint allows getting affiliate user rebate information.\n:::", + "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"General\",\"api-rate-limit-pool\":\"Management\",\"sdk-service\":\"Affiliate\",\"sdk-sub-service\":\"Affiliate\",\"sdk-method-name\":\"getAccount\",\"sdk-method-description\":\"This endpoint allows getting affiliate user rebate information.\",\"api-rate-limit\":30}" + } + } + ] + }, + { + "name": "Broker", + "id": 348138, + "description": "", + "items": [ { - "name": "Exchange Broker", - "id": 348161, + "name": "API Broker", + "id": 348160, "description": "", "items": [ { "name": "Get Broker Rebate", "api": { - "id": "3470281", + "id": "3470280", "method": "get", - "path": "/api/v1/broker/nd/rebase/download", + "path": "/api/v1/broker/api/rebase/download", "parameters": { "query": [ { @@ -37673,7 +37544,7 @@ }, "responses": [ { - "id": "10445", + "id": "10444", "code": 200, "name": "OK", "headers": [], @@ -37710,7 +37581,7 @@ { "name": "Success", "data": "{\n \"code\": \"200000\",\n \"data\": {\n \"url\": \"https://kc-v2-promotion.s3.ap-northeast-1.amazonaws.com/broker/671aec522593f600019766d0_file.csv?X-Amz-Security-Token=IQo*********2cd90f14efb\"\n }\n}", - "responseId": 10445, + "responseId": 10444, "ordering": 1 } ], @@ -37724,10 +37595,17 @@ "example": "", "mediaType": "" }, - "description": ":::info[Description]\nThis interface supports downloading Broker rebate orders\n:::\n\n### Excel Response\n\n| Param | Description | Example |\n| ------------------- | ----------------- |--------- |\n| Date | Date | 2024/9/1 |\n| BrokerUID | Broker's UID | 3243241 |\n| AffiliateUID | Affiliate's UID | 2354546 |\n| UID | User's UID | 6345466 |\n| BizLine | Business Line(Spot、Futures) | Spot |\n| Volume | Volume | 0 |\n| TotalCommission | Total Commission = BrokerCommission + UserCommission + AffiliateCommission | 0 |\n| BrokerCommission | Broker Commission | 0 |\n| UserCommission | User Commission | 0 |\n| AffiliateCommission | Affiliate Commission | 0 |\n\n\n\n\n", - "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Broker\",\"api-channel\":\"Private\",\"api-permission\":\"General\",\"api-rate-limit-pool\":\"Broker\",\"sdk-service\":\"Broker\",\"sdk-sub-service\":\"NDBroker\",\"sdk-method-name\":\"getRebase\",\"sdk-method-description\":\"This interface supports downloading Broker rebate orders\",\"api-rate-limit\":3}" + "description": ":::info[Description]\nThis interface supports downloading Broker rebate orders\n:::\n\n### Excel Response\n\n| Param | Description | Example |\n| ------------------- | ----------------- |--------- |\n| Date | Date | 2024/9/1 |\n| BrokerUID | Broker's UID | 3243241 |\n| AffiliateUID | Affiliate's UID | 2354546 |\n| UID | User's UID | 6345466 |\n| BizLine | Business Line(Spot、Futures) | Spot |\n| Volume | Volume | 0 |\n| TotalCommission | Total Commission = BrokerCommission + UserCommission + AffiliateCommission | 0 |\n| BrokerCommission | Broker Commission | 0 |\n| UserCommission | User Commission | 0 |\n| AffiliateCommission | Affiliate Commission | 0 |\n", + "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"General\",\"api-rate-limit-pool\":\"Management\",\"sdk-service\":\"Broker\",\"sdk-sub-service\":\"APIBroker\",\"sdk-method-name\":\"getRebase\",\"sdk-method-description\":\"This interface supports downloading Broker rebate orders\",\"api-rate-limit\":3}" } - }, + } + ] + }, + { + "name": "Exchange Broker", + "id": 348161, + "description": "", + "items": [ { "name": "Get Broker Info", "api": { @@ -37851,6 +37729,99 @@ "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Broker\",\"api-channel\":\"Private\",\"api-permission\":\"General\",\"api-rate-limit-pool\":\"Broker\",\"sdk-service\":\"Broker\",\"sdk-sub-service\":\"NDBroker\",\"sdk-method-name\":\"getBrokerInfo\",\"sdk-method-description\":\"This endpoint supports querying the basic information of the current Broker\",\"api-rate-limit\":2}" } }, + { + "name": "Add SubAccount", + "api": { + "id": "3470290", + "method": "post", + "path": "/api/v1/broker/nd/account", + "parameters": { + "query": [], + "path": [], + "cookie": [], + "header": [] + }, + "responses": [ + { + "id": "10454", + "code": 200, + "name": "OK", + "headers": [], + "jsonSchema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "object", + "properties": { + "accountName": { + "type": "string", + "description": "Sub-Account name\n" + }, + "uid": { + "type": "string", + "description": "Sub-Account UID" + }, + "createdAt": { + "type": "integer", + "description": "Creation time, unix timestamp (milliseconds)", + "format": "int64" + }, + "level": { + "type": "integer", + "description": "Subaccount VIP level" + } + }, + "required": [ + "accountName", + "uid", + "createdAt", + "level" + ] + } + }, + "required": [ + "code", + "data" + ] + }, + "description": "", + "contentType": "json", + "mediaType": "" + } + ], + "responseExamples": [ + { + "name": "Success", + "data": "{\n \"code\": \"200000\",\n \"data\": {\n \"accountName\": \"Account15\",\n \"uid\": \"226383154\",\n \"createdAt\": 1729819381908,\n \"level\": 0\n }\n}", + "responseId": 10454, + "ordering": 1 + } + ], + "requestBody": { + "type": "application/json", + "parameters": [], + "jsonSchema": { + "type": "object", + "properties": { + "accountName": { + "type": "string", + "description": "Sub Account Name, Note that this name is unique across the exchange. It is recommended to add a special identifier to prevent name duplication." + } + }, + "required": [ + "accountName" + ] + }, + "example": "{\n \"accountName\": \"Account1\"\n}", + "mediaType": "" + }, + "description": ":::info[Description]\nThis endpoint supports Broker users to create sub-accounts\n:::", + "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Broker\",\"api-channel\":\"Private\",\"api-permission\":\"General\",\"api-rate-limit-pool\":\"Broker\",\"sdk-service\":\"Broker\",\"sdk-sub-service\":\"NDBroker\",\"sdk-method-name\":\"addSubAccount\",\"sdk-method-description\":\"This endpoint supports Broker users to create sub-accounts\",\"api-rate-limit\":3}" + } + }, { "name": "Get SubAccount", "api": { @@ -38005,6 +37976,175 @@ "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Broker\",\"api-channel\":\"Private\",\"api-permission\":\"General\",\"api-rate-limit-pool\":\"Broker\",\"sdk-service\":\"Broker\",\"sdk-sub-service\":\"NDBroker\",\"sdk-method-name\":\"getSubAccount\",\"sdk-method-description\":\"This interface supports querying sub-accounts created by Broker\",\"api-rate-limit\":2}" } }, + { + "name": "Add SubAccount API", + "api": { + "id": "3470291", + "method": "post", + "path": "/api/v1/broker/nd/account/apikey", + "parameters": { + "query": [], + "path": [], + "cookie": [], + "header": [] + }, + "responses": [ + { + "id": "10455", + "code": 200, + "name": "OK", + "headers": [], + "jsonSchema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "object", + "properties": { + "uid": { + "type": "string", + "description": "Sub-Account UID" + }, + "label": { + "type": "string", + "description": "apikey remarks" + }, + "apiKey": { + "type": "string", + "description": "apiKey" + }, + "secretKey": { + "type": "string", + "description": "secretKey" + }, + "apiVersion": { + "type": "integer", + "description": "apiVersion" + }, + "permissions": { + "type": "array", + "items": { + "type": "string" + }, + "description": "[Permissions](apidog://link/pages/338144) group list" + }, + "ipWhitelist": { + "type": "array", + "items": { + "type": "string" + }, + "description": "IP whitelist list" + }, + "createdAt": { + "type": "integer", + "description": "Creation time, unix timestamp (milliseconds)", + "format": "int64" + } + }, + "required": [ + "uid", + "label", + "apiKey", + "secretKey", + "apiVersion", + "permissions", + "ipWhitelist", + "createdAt" + ] + } + }, + "required": [ + "code", + "data" + ] + }, + "description": "", + "contentType": "json", + "mediaType": "" + } + ], + "responseExamples": [ + { + "name": "Success", + "data": "{\n \"code\": \"200000\",\n \"data\": {\n \"uid\": \"226383154\",\n \"label\": \"This is remarks\",\n \"apiKey\": \"671afb36cee20f00015cfaf1\",\n \"secretKey\": \"d694df2******5bae05b96\",\n \"apiVersion\": 3,\n \"permissions\": [\n \"General\",\n \"Spot\"\n ],\n \"ipWhitelist\": [\n \"127.0.0.1\",\n \"123.123.123.123\"\n ],\n \"createdAt\": 1729821494000\n }\n}", + "responseId": 10455, + "ordering": 1 + } + ], + "requestBody": { + "type": "application/json", + "parameters": [], + "jsonSchema": { + "type": "object", + "properties": { + "uid": { + "type": "string", + "description": "Subaccount UID" + }, + "passphrase": { + "type": "string", + "description": "API passphrase" + }, + "ipWhitelist": { + "type": "array", + "items": { + "type": "string" + }, + "description": "IP whitelist list, supports up to 20 IPs" + }, + "permissions": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "general", + "spot", + "futures" + ], + "x-api-enum": [ + { + "value": "general", + "name": "General", + "description": "" + }, + { + "value": "spot", + "name": "Spot", + "description": "" + }, + { + "value": "futures", + "name": "Futures", + "description": "" + } + ] + }, + "description": "Permission group list(Only General、Spot、Futures permissions can be set, such as \"General, Trade\". )\n" + }, + "label": { + "type": "string", + "description": "apikey remarks (length 4~32)\n", + "minLength": 4, + "maxLength": 32 + } + }, + "required": [ + "uid", + "passphrase", + "ipWhitelist", + "permissions", + "label" + ] + }, + "example": "{\n \"uid\": \"226383154\",\n \"passphrase\": \"11223344\",\n \"ipWhitelist\": [\n \"127.0.0.1\",\"123.123.123.123\"\n ],\n \"permissions\": [\n \"general\",\"spot\"\n ],\n \"label\": \"This is remarks\"\n}", + "mediaType": "" + }, + "description": ":::info[Description]\nThis interface supports the creation of Broker sub-account APIKEY\n:::", + "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Broker\",\"api-channel\":\"Private\",\"api-permission\":\"General\",\"api-rate-limit-pool\":\"Broker\",\"sdk-service\":\"Broker\",\"sdk-sub-service\":\"NDBroker\",\"sdk-method-name\":\"addSubAccountApi\",\"sdk-method-description\":\"This interface supports the creation of Broker sub-account APIKEY\",\"api-rate-limit\":3}" + } + }, { "name": "Get SubAccount API", "api": { @@ -38159,216 +38299,81 @@ } }, { - "name": "Get Deposit List", + "name": "Modify SubAccount API", "api": { - "id": "3470285", - "method": "get", - "path": "/api/v1/asset/ndbroker/deposit/list", + "id": "3470292", + "method": "post", + "path": "/api/v1/broker/nd/account/update-apikey", "parameters": { - "query": [ - { - "id": "6iUCMmMHEI", - "name": "currency", - "required": false, - "description": "currency", - "example": "USDT", - "type": "string", - "enable": true - }, - { - "id": "rhz4T0YToL", - "name": "status", - "required": false, - "description": "Status. Available value: PROCESSING, SUCCESS, FAILURE", - "example": "SUCCESS", - "type": "string", - "schema": { - "type": "string" - }, - "enable": true - }, - { - "id": "sLCkhRlAza", - "name": "hash", - "required": false, - "description": "hash", - "type": "string", - "enable": true - }, - { - "id": "OdP8NCGePT", - "name": "startTimestamp", - "required": false, - "description": "Start time (milisecond)", - "type": "integer", - "schema": { - "type": "integer", - "format": "int64" - }, - "enable": true - }, - { - "id": "6LhDAZ17S7", - "name": "endTimestamp", - "required": false, - "description": "End time (milisecond),Default sorting in descending order", - "type": "integer", - "schema": { - "type": "integer", - "format": "int64" - }, - "enable": true - }, - { - "id": "ihMNgcLm7f", - "name": "limit", - "required": false, - "description": "Maximum number of returned items, maximum 1000, default 1000", - "type": "integer", - "schema": { - "type": "integer", - "default": 1000, - "maximum": 1000 - }, - "enable": true, - "example": "100" - } - ], + "query": [], "path": [], "cookie": [], "header": [] }, "responses": [ { - "id": "10449", + "id": "10456", "code": 200, "name": "OK", "headers": [], "jsonSchema": { "type": "object", "properties": { - "success": { - "type": "boolean" - }, "code": { "type": "string" }, - "msg": { - "type": "string" - }, - "retry": { - "type": "boolean" - }, "data": { - "type": "array", - "items": { - "type": "object", - "properties": { - "uid": { - "type": "number", - "description": "deposit uid" - }, - "hash": { - "type": "string", - "description": "hash" - }, - "address": { - "type": "string", - "description": "Deposit address" - }, - "memo": { - "type": "string", - "description": "Address remark. If there’s no remark, it is empty. When you withdraw from other platforms to the KuCoin, you need to fill in memo(tag). If you do not fill memo (tag), your deposit may not be available, please be cautious." - }, - "amount": { - "type": "string", - "description": "Deposit amount" - }, - "fee": { - "type": "string", - "description": "Fees charged for deposit" - }, - "currency": { - "type": "string", - "description": "currency" - }, - "isInner": { - "type": "boolean", - "description": "Internal deposit or not" - }, - "walletTxId": { - "type": "string", - "description": "Wallet Txid" - }, - "status": { - "type": "string", - "enum": [ - "PROCESSING", - "SUCCESS", - "FAILURE" - ], - "description": "Status. Available value: PROCESSING, SUCCESS, FAILURE", - "x-api-enum": [ - { - "value": "PROCESSING", - "name": "", - "description": "" - }, - { - "value": "SUCCESS", - "name": "", - "description": "" - }, - { - "value": "FAILURE", - "name": "", - "description": "" - } - ] - }, - "remark": { - "type": "string", - "description": "remark" - }, - "chain": { - "type": "string", - "description": "chain name of currency" - }, - "createdAt": { - "type": "integer", - "format": "int64", - "description": "Creation time of the database record" + "type": "object", + "properties": { + "uid": { + "type": "string", + "description": "Sub-Account UID" + }, + "label": { + "type": "string", + "description": "apikey remarks" + }, + "apiKey": { + "type": "string", + "description": "apiKey" + }, + "apiVersion": { + "type": "integer", + "description": "apiVersion" + }, + "permissions": { + "type": "array", + "items": { + "type": "string" }, - "updatedAt": { - "type": "integer", - "format": "int64", - "description": "Update time of the database record" - } + "description": "[Permissions](apidog://link/pages/338144) group list" + }, + "ipWhitelist": { + "type": "array", + "items": { + "type": "string" + }, + "description": "IP whitelist list" }, - "required": [ - "uid", - "hash", - "address", - "memo", - "amount", - "fee", - "currency", - "isInner", - "walletTxId", - "status", - "remark", - "chain", - "createdAt", - "updatedAt" - ] - } + "createdAt": { + "type": "integer", + "description": "Creation time, unix timestamp (milliseconds)", + "format": "int64" + } + }, + "required": [ + "uid", + "label", + "apiKey", + "apiVersion", + "permissions", + "ipWhitelist", + "createdAt" + ] } }, "required": [ - "success", "code", - "msg", - "retry", "data" ] }, @@ -38380,50 +38385,118 @@ "responseExamples": [ { "name": "Success", - "data": "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"uid\": 165111215,\n \"hash\": \"6724e363a492800007ec602b\",\n \"address\": \"xxxxxxx@gmail.com\",\n \"memo\": \"\",\n \"amount\": \"3.0\",\n \"fee\": \"0.0\",\n \"currency\": \"USDT\",\n \"isInner\": true,\n \"walletTxId\": \"bbbbbbbbb\",\n \"status\": \"SUCCESS\",\n \"chain\": \"\",\n \"remark\": \"\",\n \"createdAt\": 1730470760000,\n \"updatedAt\": 1730470760000\n }\n ]\n}", - "responseId": 10449, + "data": "{\n \"code\": \"200000\",\n \"data\": {\n \"uid\": \"226383154\",\n \"label\": \"This is remarks\",\n \"apiKey\": \"671afb36cee20f00015cfaf1\",\n \"apiVersion\": 3,\n \"permissions\": [\n \"General\",\n \"Spot\"\n ],\n \"ipWhitelist\": [\n \"127.**.1\",\n \"123.**.123\"\n ],\n \"createdAt\": 1729821494000\n }\n}", + "responseId": 10456, "ordering": 1 } ], "requestBody": { - "type": "none", + "type": "application/json", "parameters": [], "jsonSchema": { "type": "object", - "properties": {} + "properties": { + "uid": { + "type": "string", + "description": "Subaccount UID" + }, + "ipWhitelist": { + "type": "array", + "items": { + "type": "string" + }, + "description": "IP whitelist list, supports up to 20 IPs" + }, + "permissions": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "general", + "spot", + "futures" + ], + "x-api-enum": [ + { + "value": "general", + "name": "General", + "description": "" + }, + { + "value": "spot", + "name": "Spot", + "description": "" + }, + { + "value": "futures", + "name": "Futures", + "description": "" + } + ] + }, + "description": "[Permissions](apidog://link/pages/338144) group list(Only General、Spot、Futures permissions can be set, such as \"General, Trade\". )\n" + }, + "label": { + "type": "string", + "description": "apikey remarks (length 4~32)\n", + "minLength": 4, + "maxLength": 32 + }, + "apiKey": { + "type": "string", + "description": "Subaccount apiKey" + } + }, + "required": [ + "uid", + "apiKey", + "ipWhitelist", + "permissions", + "label" + ] }, - "example": "", + "example": "{\n \"uid\": \"226383154\",\n \"apiKey\": \"671afb36cee20f00015cfaf1\",\n \"ipWhitelist\": [\n \"127.0.0.1\",\n \"123.123.123.123\"\n ],\n \"permissions\": [\n \"general\",\n \"spot\"\n ],\n \"label\": \"This is remarks\"\n}", "mediaType": "" }, - "description": ":::info[Description]\nThis endpoint can obtain the deposit records of each sub-account under the ND Broker.\n:::", - "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Broker\",\"api-channel\":\"Private\",\"api-permission\":\"General\",\"api-rate-limit-pool\":\"Broker\",\"sdk-service\":\"Broker\",\"sdk-sub-service\":\"NDBroker\",\"sdk-method-name\":\"getDepositList\",\"sdk-method-description\":\"This endpoint can obtain the deposit records of each sub-account under the ND Broker.\",\"api-rate-limit\":10}" + "description": ":::info[Description]\nThis interface supports modify the Broker’s sub-account APIKEY\n:::", + "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Broker\",\"api-channel\":\"Private\",\"api-permission\":\"General\",\"api-rate-limit-pool\":\"Broker\",\"sdk-service\":\"Broker\",\"sdk-sub-service\":\"NDBroker\",\"sdk-method-name\":\"modifySubAccountApi\",\"sdk-method-description\":\"This interface supports modify the Broker’s sub-account APIKEY\",\"api-rate-limit\":3}" } }, { - "name": "Get Transfer History", + "name": "Delete SubAccount API", "api": { - "id": "3470286", - "method": "get", - "path": "/api/v3/broker/nd/transfer/detail", + "id": "3470289", + "method": "delete", + "path": "/api/v1/broker/nd/account/apikey", "parameters": { + "path": [], "query": [ { - "id": "frg7Fxp2Xk", - "name": "orderId", + "id": "6iUCMmMHEI", + "name": "uid", "required": true, - "description": "Transfer Order ID", - "example": "671b4600c1e3dd000726866d", + "description": "Sub-account UID", + "example": "226383154", + "type": "string" + }, + { + "id": "rhz4T0YToL", + "name": "apiKey", + "required": true, + "description": "Sub-account apiKey\n", + "example": "671afb36cee20f00015cfaf1", "type": "string", - "enable": true + "schema": { + "type": "string" + } } ], - "path": [], "cookie": [], "header": [] }, "responses": [ { - "id": "10450", + "id": "10453", "code": 200, "name": "OK", "headers": [], @@ -38434,172 +38507,7 @@ "type": "string" }, "data": { - "type": "object", - "properties": { - "orderId": { - "type": "string", - "description": "Transfer Order ID" - }, - "currency": { - "type": "string", - "description": "Currency" - }, - "amount": { - "type": "string", - "description": "Transfer Amount" - }, - "fromUid": { - "type": "integer", - "description": "UID of the user transferring out" - }, - "fromAccountType": { - "type": "string", - "description": "From Account Type:Account Type: MAIN, TRADE, CONTRACT, MARGIN, ISOLATED", - "enum": [ - "MAIN", - "TRADE", - "CONTRACT", - "MARGIN", - "ISOLATED" - ], - "x-api-enum": [ - { - "value": "MAIN", - "name": "", - "description": "" - }, - { - "value": "TRADE", - "name": "", - "description": "" - }, - { - "value": "CONTRACT", - "name": "", - "description": "" - }, - { - "value": "MARGIN", - "name": "", - "description": "" - }, - { - "value": "ISOLATED", - "name": "", - "description": "" - } - ] - }, - "fromAccountTag": { - "type": "string", - "description": "Trading pair, required if the account type is ISOLATED, e.g., BTC-USDT", - "examples": [ - "BTC-USDT", - "ETH-USDT", - "KCS-USDT" - ] - }, - "toUid": { - "type": "integer", - "description": "UID of the user transferring in" - }, - "toAccountType": { - "type": "string", - "description": "Account Type:Account Type: MAIN, TRADE, CONTRACT, MARGIN, ISOLATED", - "enum": [ - "MAIN", - "TRADE", - "CONTRACT", - "MARGIN", - "ISOLATED" - ], - "x-api-enum": [ - { - "value": "MAIN", - "name": "", - "description": "" - }, - { - "value": "TRADE", - "name": "", - "description": "" - }, - { - "value": "CONTRACT", - "name": "", - "description": "" - }, - { - "value": "MARGIN", - "name": "", - "description": "" - }, - { - "value": "ISOLATED", - "name": "", - "description": "" - } - ] - }, - "toAccountTag": { - "type": "string", - "description": "To Trading pair, required if the account type is ISOLATED, e.g., BTC-USDT", - "examples": [ - "BTC-USDT", - "ETH-USDT", - "KCS-USDT" - ] - }, - "status": { - "type": "string", - "description": "Status: PROCESSING (processing), SUCCESS (successful), FAILURE (failed)", - "enum": [ - "PROCESSING", - "SUCCESS", - "FAILURE" - ], - "x-api-enum": [ - { - "value": "PROCESSING", - "name": "", - "description": "" - }, - { - "value": "SUCCESS", - "name": "", - "description": "" - }, - { - "value": "FAILURE", - "name": "", - "description": "" - } - ] - }, - "reason": { - "type": "string", - "description": "Failure Reason" - }, - "createdAt": { - "type": "integer", - "description": "Creation Time (Unix timestamp in milliseconds)", - "format": "int64" - } - }, - "required": [ - "orderId", - "currency", - "amount", - "fromUid", - "fromAccountType", - "fromAccountTag", - "toUid", - "toAccountType", - "toAccountTag", - "status", - "reason", - "createdAt" - ] + "type": "boolean" } }, "required": [ @@ -38615,8 +38523,8 @@ "responseExamples": [ { "name": "Success", - "data": "{\n \"code\": \"200000\",\n \"data\": {\n \"orderId\": \"671b4600c1e3dd000726866d\",\n \"currency\": \"USDT\",\n \"amount\": \"1\",\n \"fromUid\": 165111215,\n \"fromAccountType\": \"MAIN\",\n \"fromAccountTag\": \"DEFAULT\",\n \"toUid\": 226383154,\n \"toAccountType\": \"MAIN\",\n \"toAccountTag\": \"DEFAULT\",\n \"status\": \"SUCCESS\",\n \"reason\": null,\n \"createdAt\": 1729840640000\n }\n}", - "responseId": 10450, + "data": "{\n \"code\": \"200000\",\n \"data\": true\n}", + "responseId": 10453, "ordering": 1 } ], @@ -38630,213 +38538,179 @@ "example": "", "mediaType": "" }, - "description": ":::info[Description]\nThis endpoint supports querying transfer records of the broker itself and its created sub-accounts.\n:::", - "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Broker\",\"api-channel\":\"Private\",\"api-permission\":\"General\",\"api-rate-limit-pool\":\"Broker\",\"sdk-service\":\"Broker\",\"sdk-sub-service\":\"NDBroker\",\"sdk-method-name\":\"getTransferHistory\",\"sdk-method-description\":\"This endpoint supports querying transfer records of the broker itself and its created sub-accounts.\",\"api-rate-limit\":1}" + "description": ":::info[Description]\nThis interface supports deleting Broker’s sub-account APIKEY\n:::", + "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Broker\",\"api-channel\":\"Private\",\"api-permission\":\"General\",\"api-rate-limit-pool\":\"Broker\",\"sdk-service\":\"Broker\",\"sdk-sub-service\":\"NDBroker\",\"sdk-method-name\":\"deleteSubAccountAPI\",\"sdk-method-description\":\"This interface supports deleting Broker’s sub-account APIKEY\",\"api-rate-limit\":3}" } }, { - "name": "Get Withdraw Detail", + "name": "Transfer", "api": { - "id": "3470287", - "method": "get", - "path": "/api/v3/broker/nd/withdraw/detail", + "id": "3470293", + "method": "post", + "path": "/api/v1/broker/nd/transfer", "parameters": { - "query": [ - { - "id": "frg7Fxp2Xk", - "name": "withdrawalId", - "required": true, - "description": "Withdrawal ID", - "example": "66617a2***3c9a", - "type": "string", - "enable": true - } - ], "path": [], + "query": [], "cookie": [], "header": [] }, "responses": [ { - "id": "10451", + "id": "10457", "code": 200, "name": "OK", "headers": [], "jsonSchema": { "type": "object", "properties": { + "code": { + "type": "string" + }, "data": { "type": "object", "properties": { - "id": { - "type": "string", - "description": "Withdrawal ID" - }, - "chain": { - "type": "string", - "description": "chain id of currency" - }, - "walletTxId": { - "type": "string", - "description": "Wallet Transaction ID" - }, - "uid": { - "type": "integer", - "description": "UID" - }, - "updatedAt": { - "type": "integer", - "description": "Update Time (milliseconds)", - "format": "int64" - }, - "amount": { - "type": "string", - "description": "Amount" - }, - "memo": { - "type": "string", - "description": "Memo" - }, - "fee": { - "type": "string", - "description": "Fee" - }, - "address": { - "type": "string", - "description": "Address" - }, - "remark": { - "type": "string", - "description": "Remark" - }, - "isInner": { - "type": "boolean", - "description": "Is Internal (true or false)" - }, - "currency": { - "type": "string", - "description": "Currency" - }, - "status": { - "type": "string", - "description": "Status (PROCESSING, WALLET_PROCESSING, REVIEW, SUCCESS, FAILURE)", - "enum": [ - "PROCESSING", - "WALLET_PROCESSING", - "REVIEW", - "SUCCESS", - "FAILURE" - ], - "x-api-enum": [ - { - "value": "PROCESSING", - "name": "", - "description": "" - }, - { - "value": "WALLET_PROCESSING", - "name": "", - "description": "" - }, - { - "value": "REVIEW", - "name": "", - "description": "" - }, - { - "value": "SUCCESS", - "name": "", - "description": "" - }, - { - "value": "FAILURE", - "name": "", - "description": "" - } - ] - }, - "createdAt": { - "type": "integer", - "description": "Creation Time (milliseconds)", - "format": "int64" + "orderId": { + "type": "string" } }, - "required": [ - "id", - "chain", - "walletTxId", - "uid", - "updatedAt", - "amount", - "memo", - "fee", - "address", - "remark", - "isInner", - "currency", - "status", - "createdAt" - ] - }, - "code": { - "type": "string" - } + "required": [ + "orderId" + ] + } + }, + "required": [ + "code", + "data" + ] + }, + "description": "", + "contentType": "json", + "mediaType": "" + } + ], + "responseExamples": [ + { + "name": "Success", + "data": "{\n \"code\": \"200000\",\n \"data\": {\n \"orderId\": \"671b4600c1e3dd000726866d\"\n }\n}", + "responseId": 10457, + "ordering": 1 + } + ], + "requestBody": { + "type": "application/json", + "parameters": [], + "jsonSchema": { + "type": "object", + "properties": { + "currency": { + "type": "string", + "description": "Currency" + }, + "amount": { + "type": "string", + "description": "Transfer Amount (must be a positive integer in the currency's precision)" + }, + "direction": { + "type": "string", + "description": "Fund transfer direction: OUT (Broker account is transferred to Broker sub-account), IN (Broker sub-account is transferred to Broker account)", + "enum": [ + "OUT", + "IN" + ], + "x-api-enum": [ + { + "value": "OUT", + "name": "", + "description": "" + }, + { + "value": "IN", + "name": "", + "description": "" + } + ] + }, + "accountType": { + "type": "string", + "description": "Broker account types: MAIN (Funding account), TRADE (Spot trading account)", + "enum": [ + "MAIN", + "TRADE" + ], + "x-api-enum": [ + { + "value": "MAIN", + "name": "", + "description": "" + }, + { + "value": "TRADE", + "name": "", + "description": "" + } + ] + }, + "specialUid": { + "type": "string", + "description": "Broker subaccount uid, must be the Broker subaccount created by the current Broker user." + }, + "specialAccountType": { + "type": "string", + "description": "Broker sub-account types: MAIN (Funding account), TRADE (Spot trading account)", + "enum": [ + "MAIN", + "TRADE" + ], + "x-api-enum": [ + { + "value": "MAIN", + "name": "", + "description": "" + }, + { + "value": "TRADE", + "name": "", + "description": "" + } + ] }, - "required": [ - "data", - "code" - ] + "clientOid": { + "type": "string", + "description": "Client Order Id, The unique identifier created by the client. It is recommended to use UUID. The maximum length is 128 bits.", + "maxLength": 128 + } }, - "description": "", - "contentType": "json", - "mediaType": "" - } - ], - "responseExamples": [ - { - "name": "Success", - "data": "{\n \"data\": {\n \"id\": \"66617a2***3c9a\",\n \"chain\": \"ton\",\n \"walletTxId\": \"AJ***eRI=\",\n \"uid\": 157267400,\n \"amount\": \"1.00000000\",\n \"memo\": \"7025734\",\n \"fee\": \"0.00000000\",\n \"address\": \"EQDn***dKbGzr\",\n \"remark\": \"\",\n \"isInner\": false,\n \"currency\": \"USDT\",\n \"status\": \"SUCCESS\",\n \"createdAt\": 1717664288000,\n \"updatedAt\": 1717664375000\n },\n \"code\": \"200000\"\n}", - "responseId": 10451, - "ordering": 1 - } - ], - "requestBody": { - "type": "none", - "parameters": [], - "jsonSchema": { - "type": "object", - "properties": {} + "required": [ + "currency", + "amount", + "direction", + "accountType", + "specialUid", + "specialAccountType", + "clientOid" + ] }, - "example": "", + "example": "{\n \"currency\": \"USDT\",\n \"amount\": \"1\",\n \"clientOid\": \"e6c24d23-6bc2-401b-bf9e-55e2daddfbc1\",\n \"direction\": \"OUT\",\n \"accountType\": \"MAIN\",\n \"specialUid\": \"226383154\",\n \"specialAccountType\": \"MAIN\"\n}", "mediaType": "" }, - "description": ":::info[Description]\nThis endpoint supports querying the withdrawal records of sub-accounts created by a Broker (excluding main account of nd broker).\n:::", - "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Broker\",\"api-channel\":\"Private\",\"api-permission\":\"General\",\"api-rate-limit-pool\":\"Broker\",\"sdk-service\":\"Broker\",\"sdk-sub-service\":\"NDBroker\",\"sdk-method-name\":\"getWithdrawDetail\",\"sdk-method-description\":\"This endpoint supports querying the withdrawal records of sub-accounts created by a Broker (excluding main account of nd broker).\",\"api-rate-limit\":1}" + "description": ":::info[Description]\nThis endpoint supports fund transfer between Broker account and Broker sub-accounts.\n\nPlease be aware that withdrawal from sub-account is not directly supported. Broker has to transfer funds from broker sub-account to broker account to initiate the withdrawals.\n:::", + "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Broker\",\"api-channel\":\"Private\",\"api-permission\":\"General\",\"api-rate-limit-pool\":\"Broker\",\"sdk-service\":\"Broker\",\"sdk-sub-service\":\"NDBroker\",\"sdk-method-name\":\"transfer\",\"sdk-method-description\":\"This endpoint supports fund transfer between Broker account and Broker sub-accounts. Please be aware that withdrawal from sub-account is not directly supported. Broker has to transfer funds from broker sub-account to broker account to initiate the withdrawals.\",\"api-rate-limit\":1}" } }, { - "name": "Get Deposit Detail", + "name": "Get Transfer History", "api": { - "id": "3470288", + "id": "3470286", "method": "get", - "path": "/api/v3/broker/nd/deposit/detail", + "path": "/api/v3/broker/nd/transfer/detail", "parameters": { "query": [ { "id": "frg7Fxp2Xk", - "name": "currency", - "required": true, - "description": "Currency", - "example": "USDT", - "type": "string", - "enable": true - }, - { - "id": "QASXsRQu7k", - "name": "hash", + "name": "orderId", "required": true, - "description": "Hash Value", - "example": "30bb0e0b***4156c5188", + "description": "Transfer Order ID", + "example": "671b4600c1e3dd000726866d", "type": "string", "enable": true } @@ -38847,121 +38721,188 @@ }, "responses": [ { - "id": "10452", + "id": "10450", "code": 200, "name": "OK", "headers": [], "jsonSchema": { "type": "object", "properties": { + "code": { + "type": "string" + }, "data": { "type": "object", "properties": { - "chain": { + "orderId": { "type": "string", - "description": "chain id of currency" + "description": "Transfer Order ID" }, - "hash": { + "currency": { "type": "string", - "description": "Hash" + "description": "Currency" }, - "walletTxId": { + "amount": { "type": "string", - "description": "Wallet Transaction ID" - }, - "uid": { - "type": "integer", - "description": "UID" + "description": "Transfer Amount" }, - "updatedAt": { + "fromUid": { "type": "integer", - "description": "Update Time (milliseconds)", - "format": "int64" - }, - "amount": { - "type": "string", - "description": "Amount" + "description": "UID of the user transferring out" }, - "memo": { + "fromAccountType": { "type": "string", - "description": "Memo" + "description": "From Account Type:Account Type: MAIN, TRADE, CONTRACT, MARGIN, ISOLATED", + "enum": [ + "MAIN", + "TRADE", + "CONTRACT", + "MARGIN", + "ISOLATED" + ], + "x-api-enum": [ + { + "value": "MAIN", + "name": "", + "description": "" + }, + { + "value": "TRADE", + "name": "", + "description": "" + }, + { + "value": "CONTRACT", + "name": "", + "description": "" + }, + { + "value": "MARGIN", + "name": "", + "description": "" + }, + { + "value": "ISOLATED", + "name": "", + "description": "" + } + ] }, - "fee": { + "fromAccountTag": { "type": "string", - "description": "Fee" + "description": "Trading pair, required if the account type is ISOLATED, e.g., BTC-USDT", + "examples": [ + "BTC-USDT", + "ETH-USDT", + "KCS-USDT" + ] }, - "address": { - "type": "string", - "description": "Address" + "toUid": { + "type": "integer", + "description": "UID of the user transferring in" }, - "remark": { + "toAccountType": { "type": "string", - "description": "Remark" - }, - "isInner": { - "type": "boolean", - "description": "Is Internal (true or false)" + "description": "Account Type:Account Type: MAIN, TRADE, CONTRACT, MARGIN, ISOLATED", + "enum": [ + "MAIN", + "TRADE", + "CONTRACT", + "MARGIN", + "ISOLATED" + ], + "x-api-enum": [ + { + "value": "MAIN", + "name": "", + "description": "" + }, + { + "value": "TRADE", + "name": "", + "description": "" + }, + { + "value": "CONTRACT", + "name": "", + "description": "" + }, + { + "value": "MARGIN", + "name": "", + "description": "" + }, + { + "value": "ISOLATED", + "name": "", + "description": "" + } + ] }, - "currency": { + "toAccountTag": { "type": "string", - "description": "Currency" + "description": "To Trading pair, required if the account type is ISOLATED, e.g., BTC-USDT", + "examples": [ + "BTC-USDT", + "ETH-USDT", + "KCS-USDT" + ] }, "status": { "type": "string", - "description": "Status (PROCESSING, SUCCESS, FAILURE)", + "description": "Status: PROCESSING (processing), SUCCESS (successful), FAILURE (failed)", "enum": [ + "PROCESSING", "SUCCESS", - "FAILURE", - "PROCESSING" + "FAILURE" ], "x-api-enum": [ { - "value": "SUCCESS", + "value": "PROCESSING", "name": "", "description": "" }, { - "value": "FAILURE", + "value": "SUCCESS", "name": "", "description": "" }, { - "value": "PROCESSING", + "value": "FAILURE", "name": "", "description": "" } ] }, + "reason": { + "type": "string", + "description": "Failure Reason" + }, "createdAt": { "type": "integer", - "description": "Creation Time (milliseconds)", + "description": "Creation Time (Unix timestamp in milliseconds)", "format": "int64" } }, "required": [ - "chain", - "hash", - "walletTxId", - "uid", - "updatedAt", - "amount", - "memo", - "fee", - "address", - "remark", - "isInner", + "orderId", "currency", + "amount", + "fromUid", + "fromAccountType", + "fromAccountTag", + "toUid", + "toAccountType", + "toAccountTag", "status", + "reason", "createdAt" ] - }, - "code": { - "type": "string" } }, "required": [ - "data", - "code" + "code", + "data" ] }, "description": "", @@ -38972,8 +38913,8 @@ "responseExamples": [ { "name": "Success", - "data": "{\n \"data\" : {\n \"chain\" : \"trx\",\n \"hash\" : \"30bb0e0b***4156c5188\",\n \"walletTxId\" : \"30bb0***610d1030f\",\n \"uid\" : 201496341,\n \"updatedAt\" : 1713429174000,\n \"amount\" : \"8.5\",\n \"memo\" : \"\",\n \"fee\" : \"0.0\",\n \"address\" : \"THLPzUrbd1o***vP7d\",\n \"remark\" : \"Deposit\",\n \"isInner\" : false,\n \"currency\" : \"USDT\",\n \"status\" : \"SUCCESS\",\n \"createdAt\" : 1713429173000\n },\n \"code\" : \"200000\"\n}", - "responseId": 10452, + "data": "{\n \"code\": \"200000\",\n \"data\": {\n \"orderId\": \"671b4600c1e3dd000726866d\",\n \"currency\": \"USDT\",\n \"amount\": \"1\",\n \"fromUid\": 165111215,\n \"fromAccountType\": \"MAIN\",\n \"fromAccountTag\": \"DEFAULT\",\n \"toUid\": 226383154,\n \"toAccountType\": \"MAIN\",\n \"toAccountTag\": \"DEFAULT\",\n \"status\": \"SUCCESS\",\n \"reason\": null,\n \"createdAt\": 1729840640000\n }\n}", + "responseId": 10450, "ordering": 1 } ], @@ -38987,145 +38928,221 @@ "example": "", "mediaType": "" }, - "description": ":::info[Description]\nThis endpoint supports querying the deposit record of sub-accounts created by a Broker (excluding main account of nd broker)\n:::", - "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Broker\",\"api-channel\":\"Private\",\"api-permission\":\"General\",\"api-rate-limit-pool\":\"Broker\",\"sdk-service\":\"Broker\",\"sdk-sub-service\":\"NDBroker\",\"sdk-method-name\":\"getDepositDetail\",\"sdk-method-description\":\"This endpoint supports querying the deposit record of sub-accounts created by a Broker (excluding main account of nd broker)\",\"api-rate-limit\":1}" + "description": ":::info[Description]\nThis endpoint supports querying transfer records of the broker itself and its created sub-accounts.\n:::", + "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Broker\",\"api-channel\":\"Private\",\"api-permission\":\"General\",\"api-rate-limit-pool\":\"Broker\",\"sdk-service\":\"Broker\",\"sdk-sub-service\":\"NDBroker\",\"sdk-method-name\":\"getTransferHistory\",\"sdk-method-description\":\"This endpoint supports querying transfer records of the broker itself and its created sub-accounts.\",\"api-rate-limit\":1}" } }, { - "name": "Delete SubAccount API", + "name": "Get Deposit List", "api": { - "id": "3470289", - "method": "delete", - "path": "/api/v1/broker/nd/account/apikey", + "id": "3470285", + "method": "get", + "path": "/api/v1/asset/ndbroker/deposit/list", "parameters": { - "path": [], "query": [ { "id": "6iUCMmMHEI", - "name": "uid", - "required": true, - "description": "Sub-account UID", - "example": "226383154", - "type": "string" + "name": "currency", + "required": false, + "description": "currency", + "example": "USDT", + "type": "string", + "enable": true }, { "id": "rhz4T0YToL", - "name": "apiKey", - "required": true, - "description": "Sub-account apiKey\n", - "example": "671afb36cee20f00015cfaf1", + "name": "status", + "required": false, + "description": "Status. Available value: PROCESSING, SUCCESS, FAILURE", + "example": "SUCCESS", "type": "string", "schema": { "type": "string" - } + }, + "enable": true + }, + { + "id": "sLCkhRlAza", + "name": "hash", + "required": false, + "description": "hash", + "type": "string", + "enable": true + }, + { + "id": "OdP8NCGePT", + "name": "startTimestamp", + "required": false, + "description": "Start time (milisecond)", + "type": "integer", + "schema": { + "type": "integer", + "format": "int64" + }, + "enable": true + }, + { + "id": "6LhDAZ17S7", + "name": "endTimestamp", + "required": false, + "description": "End time (milisecond),Default sorting in descending order", + "type": "integer", + "schema": { + "type": "integer", + "format": "int64" + }, + "enable": true + }, + { + "id": "ihMNgcLm7f", + "name": "limit", + "required": false, + "description": "Maximum number of returned items, maximum 1000, default 1000", + "type": "integer", + "schema": { + "type": "integer", + "default": 1000, + "maximum": 1000 + }, + "enable": true, + "example": "100" } ], + "path": [], "cookie": [], "header": [] }, "responses": [ { - "id": "10453", + "id": "10449", "code": 200, "name": "OK", "headers": [], "jsonSchema": { "type": "object", "properties": { + "success": { + "type": "boolean" + }, "code": { "type": "string" }, - "data": { - "type": "boolean" - } - }, - "required": [ - "code", - "data" - ] - }, - "description": "", - "contentType": "json", - "mediaType": "" - } - ], - "responseExamples": [ - { - "name": "Success", - "data": "{\n \"code\": \"200000\",\n \"data\": true\n}", - "responseId": 10453, - "ordering": 1 - } - ], - "requestBody": { - "type": "none", - "parameters": [], - "jsonSchema": { - "type": "object", - "properties": {} - }, - "example": "", - "mediaType": "" - }, - "description": ":::info[Description]\nThis interface supports deleting Broker’s sub-account APIKEY\n:::", - "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Broker\",\"api-channel\":\"Private\",\"api-permission\":\"General\",\"api-rate-limit-pool\":\"Broker\",\"sdk-service\":\"Broker\",\"sdk-sub-service\":\"NDBroker\",\"sdk-method-name\":\"deleteSubAccountAPI\",\"sdk-method-description\":\"This interface supports deleting Broker’s sub-account APIKEY\",\"api-rate-limit\":3}" - } - }, - { - "name": "Add SubAccount", - "api": { - "id": "3470290", - "method": "post", - "path": "/api/v1/broker/nd/account", - "parameters": { - "query": [], - "path": [], - "cookie": [], - "header": [] - }, - "responses": [ - { - "id": "10454", - "code": 200, - "name": "OK", - "headers": [], - "jsonSchema": { - "type": "object", - "properties": { - "code": { + "msg": { "type": "string" }, + "retry": { + "type": "boolean" + }, "data": { - "type": "object", - "properties": { - "accountName": { - "type": "string", - "description": "Sub-Account name\n" - }, - "uid": { - "type": "string", - "description": "Sub-Account UID" - }, - "createdAt": { - "type": "integer", - "description": "Creation time, unix timestamp (milliseconds)", - "format": "int64" + "type": "array", + "items": { + "type": "object", + "properties": { + "uid": { + "type": "number", + "description": "deposit uid" + }, + "hash": { + "type": "string", + "description": "hash" + }, + "address": { + "type": "string", + "description": "Deposit address" + }, + "memo": { + "type": "string", + "description": "Address remark. If there’s no remark, it is empty. When you withdraw from other platforms to the KuCoin, you need to fill in memo(tag). If you do not fill memo (tag), your deposit may not be available, please be cautious." + }, + "amount": { + "type": "string", + "description": "Deposit amount" + }, + "fee": { + "type": "string", + "description": "Fees charged for deposit" + }, + "currency": { + "type": "string", + "description": "currency" + }, + "isInner": { + "type": "boolean", + "description": "Internal deposit or not" + }, + "walletTxId": { + "type": "string", + "description": "Wallet Txid" + }, + "status": { + "type": "string", + "enum": [ + "PROCESSING", + "SUCCESS", + "FAILURE" + ], + "description": "Status. Available value: PROCESSING, SUCCESS, FAILURE", + "x-api-enum": [ + { + "value": "PROCESSING", + "name": "", + "description": "" + }, + { + "value": "SUCCESS", + "name": "", + "description": "" + }, + { + "value": "FAILURE", + "name": "", + "description": "" + } + ] + }, + "remark": { + "type": "string", + "description": "remark" + }, + "chain": { + "type": "string", + "description": "chain name of currency" + }, + "createdAt": { + "type": "integer", + "format": "int64", + "description": "Creation time of the database record" + }, + "updatedAt": { + "type": "integer", + "format": "int64", + "description": "Update time of the database record" + } }, - "level": { - "type": "integer", - "description": "Subaccount VIP level" - } - }, - "required": [ - "accountName", - "uid", - "createdAt", - "level" - ] + "required": [ + "uid", + "hash", + "address", + "memo", + "amount", + "fee", + "currency", + "isInner", + "walletTxId", + "status", + "remark", + "chain", + "createdAt", + "updatedAt" + ] + } } }, "required": [ + "success", "code", + "msg", + "retry", "data" ] }, @@ -39137,115 +39154,173 @@ "responseExamples": [ { "name": "Success", - "data": "{\n \"code\": \"200000\",\n \"data\": {\n \"accountName\": \"Account15\",\n \"uid\": \"226383154\",\n \"createdAt\": 1729819381908,\n \"level\": 0\n }\n}", - "responseId": 10454, + "data": "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"uid\": 165111215,\n \"hash\": \"6724e363a492800007ec602b\",\n \"address\": \"xxxxxxx@gmail.com\",\n \"memo\": \"\",\n \"amount\": \"3.0\",\n \"fee\": \"0.0\",\n \"currency\": \"USDT\",\n \"isInner\": true,\n \"walletTxId\": \"bbbbbbbbb\",\n \"status\": \"SUCCESS\",\n \"chain\": \"\",\n \"remark\": \"\",\n \"createdAt\": 1730470760000,\n \"updatedAt\": 1730470760000\n }\n ]\n}", + "responseId": 10449, "ordering": 1 } ], "requestBody": { - "type": "application/json", + "type": "none", "parameters": [], "jsonSchema": { "type": "object", - "properties": { - "accountName": { - "type": "string", - "description": "Sub Account Name, Note that this name is unique across the exchange. It is recommended to add a special identifier to prevent name duplication." - } - }, - "required": [ - "accountName" - ] + "properties": {} }, - "example": "{\n \"accountName\": \"Account1\"\n}", + "example": "", "mediaType": "" }, - "description": ":::info[Description]\nThis endpoint supports Broker users to create sub-accounts\n:::", - "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Broker\",\"api-channel\":\"Private\",\"api-permission\":\"General\",\"api-rate-limit-pool\":\"Broker\",\"sdk-service\":\"Broker\",\"sdk-sub-service\":\"NDBroker\",\"sdk-method-name\":\"addSubAccount\",\"sdk-method-description\":\"This endpoint supports Broker users to create sub-accounts\",\"api-rate-limit\":3}" + "description": ":::info[Description]\nThis endpoint can obtain the deposit records of each sub-account under the ND Broker.\n:::", + "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Broker\",\"api-channel\":\"Private\",\"api-permission\":\"General\",\"api-rate-limit-pool\":\"Broker\",\"sdk-service\":\"Broker\",\"sdk-sub-service\":\"NDBroker\",\"sdk-method-name\":\"getDepositList\",\"sdk-method-description\":\"This endpoint can obtain the deposit records of each sub-account under the ND Broker.\",\"api-rate-limit\":10}" } }, { - "name": "Add SubAccount API", + "name": "Get Deposit Detail", "api": { - "id": "3470291", - "method": "post", - "path": "/api/v1/broker/nd/account/apikey", + "id": "3470288", + "method": "get", + "path": "/api/v3/broker/nd/deposit/detail", "parameters": { - "query": [], + "query": [ + { + "id": "frg7Fxp2Xk", + "name": "currency", + "required": true, + "description": "Currency", + "example": "USDT", + "type": "string", + "enable": true + }, + { + "id": "QASXsRQu7k", + "name": "hash", + "required": true, + "description": "Hash Value", + "example": "30bb0e0b***4156c5188", + "type": "string", + "enable": true + } + ], "path": [], "cookie": [], "header": [] }, "responses": [ { - "id": "10455", + "id": "10452", "code": 200, "name": "OK", "headers": [], "jsonSchema": { "type": "object", "properties": { - "code": { - "type": "string" - }, "data": { "type": "object", "properties": { + "chain": { + "type": "string", + "description": "chain id of currency" + }, + "hash": { + "type": "string", + "description": "Hash" + }, + "walletTxId": { + "type": "string", + "description": "Wallet Transaction ID" + }, "uid": { + "type": "integer", + "description": "UID" + }, + "updatedAt": { + "type": "integer", + "description": "Update Time (milliseconds)", + "format": "int64" + }, + "amount": { "type": "string", - "description": "Sub-Account UID" + "description": "Amount" }, - "label": { + "memo": { "type": "string", - "description": "apikey remarks" + "description": "Memo" }, - "apiKey": { + "fee": { "type": "string", - "description": "apiKey" + "description": "Fee" }, - "secretKey": { + "address": { "type": "string", - "description": "secretKey" + "description": "Address" }, - "apiVersion": { - "type": "integer", - "description": "apiVersion" + "remark": { + "type": "string", + "description": "Remark" }, - "permissions": { - "type": "array", - "items": { - "type": "string" - }, - "description": "[Permissions](apidog://link/pages/338144) group list" + "isInner": { + "type": "boolean", + "description": "Is Internal (true or false)" }, - "ipWhitelist": { - "type": "array", - "items": { - "type": "string" - }, - "description": "IP whitelist list" + "currency": { + "type": "string", + "description": "Currency" + }, + "status": { + "type": "string", + "description": "Status (PROCESSING, SUCCESS, FAILURE)", + "enum": [ + "SUCCESS", + "FAILURE", + "PROCESSING" + ], + "x-api-enum": [ + { + "value": "SUCCESS", + "name": "", + "description": "" + }, + { + "value": "FAILURE", + "name": "", + "description": "" + }, + { + "value": "PROCESSING", + "name": "", + "description": "" + } + ] }, "createdAt": { "type": "integer", - "description": "Creation time, unix timestamp (milliseconds)", + "description": "Creation Time (milliseconds)", "format": "int64" } }, "required": [ + "chain", + "hash", + "walletTxId", "uid", - "label", - "apiKey", - "secretKey", - "apiVersion", - "permissions", - "ipWhitelist", + "updatedAt", + "amount", + "memo", + "fee", + "address", + "remark", + "isInner", + "currency", + "status", "createdAt" ] + }, + "code": { + "type": "string" } }, "required": [ - "code", - "data" + "data", + "code" ] }, "description": "", @@ -39256,286 +39331,176 @@ "responseExamples": [ { "name": "Success", - "data": "{\n \"code\": \"200000\",\n \"data\": {\n \"uid\": \"226383154\",\n \"label\": \"This is remarks\",\n \"apiKey\": \"671afb36cee20f00015cfaf1\",\n \"secretKey\": \"d694df2******5bae05b96\",\n \"apiVersion\": 3,\n \"permissions\": [\n \"General\",\n \"Spot\"\n ],\n \"ipWhitelist\": [\n \"127.0.0.1\",\n \"123.123.123.123\"\n ],\n \"createdAt\": 1729821494000\n }\n}", - "responseId": 10455, + "data": "{\n \"data\" : {\n \"chain\" : \"trx\",\n \"hash\" : \"30bb0e0b***4156c5188\",\n \"walletTxId\" : \"30bb0***610d1030f\",\n \"uid\" : 201496341,\n \"updatedAt\" : 1713429174000,\n \"amount\" : \"8.5\",\n \"memo\" : \"\",\n \"fee\" : \"0.0\",\n \"address\" : \"THLPzUrbd1o***vP7d\",\n \"remark\" : \"Deposit\",\n \"isInner\" : false,\n \"currency\" : \"USDT\",\n \"status\" : \"SUCCESS\",\n \"createdAt\" : 1713429173000\n },\n \"code\" : \"200000\"\n}", + "responseId": 10452, "ordering": 1 } ], "requestBody": { - "type": "application/json", + "type": "none", "parameters": [], "jsonSchema": { "type": "object", - "properties": { - "uid": { - "type": "string", - "description": "Subaccount UID" - }, - "passphrase": { - "type": "string", - "description": "API passphrase" - }, - "ipWhitelist": { - "type": "array", - "items": { - "type": "string" - }, - "description": "IP whitelist list, supports up to 20 IPs" - }, - "permissions": { - "type": "array", - "items": { - "type": "string", - "enum": [ - "general", - "spot", - "futures" - ], - "x-api-enum": [ - { - "value": "general", - "name": "General", - "description": "" - }, - { - "value": "spot", - "name": "Spot", - "description": "" - }, - { - "value": "futures", - "name": "Futures", - "description": "" - } - ] - }, - "description": "Permission group list(Only General、Spot、Futures permissions can be set, such as \"General, Trade\". )\n" - }, - "label": { - "type": "string", - "description": "apikey remarks (length 4~32)\n", - "minLength": 4, - "maxLength": 32 - } - }, - "required": [ - "uid", - "passphrase", - "ipWhitelist", - "permissions", - "label" - ] + "properties": {} }, - "example": "{\n \"uid\": \"226383154\",\n \"passphrase\": \"11223344\",\n \"ipWhitelist\": [\n \"127.0.0.1\",\"123.123.123.123\"\n ],\n \"permissions\": [\n \"general\",\"spot\"\n ],\n \"label\": \"This is remarks\"\n}", + "example": "", "mediaType": "" }, - "description": ":::info[Description]\nThis interface supports the creation of Broker sub-account APIKEY\n:::", - "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Broker\",\"api-channel\":\"Private\",\"api-permission\":\"General\",\"api-rate-limit-pool\":\"Broker\",\"sdk-service\":\"Broker\",\"sdk-sub-service\":\"NDBroker\",\"sdk-method-name\":\"addSubAccountApi\",\"sdk-method-description\":\"This interface supports the creation of Broker sub-account APIKEY\",\"api-rate-limit\":3}" + "description": ":::info[Description]\nThis endpoint supports querying the deposit record of sub-accounts created by a Broker (excluding main account of nd broker)\n:::", + "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Broker\",\"api-channel\":\"Private\",\"api-permission\":\"General\",\"api-rate-limit-pool\":\"Broker\",\"sdk-service\":\"Broker\",\"sdk-sub-service\":\"NDBroker\",\"sdk-method-name\":\"getDepositDetail\",\"sdk-method-description\":\"This endpoint supports querying the deposit record of sub-accounts created by a Broker (excluding main account of nd broker)\",\"api-rate-limit\":1}" } }, { - "name": "Modify SubAccount API", + "name": "Get Withdraw Detail", "api": { - "id": "3470292", - "method": "post", - "path": "/api/v1/broker/nd/account/update-apikey", + "id": "3470287", + "method": "get", + "path": "/api/v3/broker/nd/withdraw/detail", "parameters": { - "query": [], + "query": [ + { + "id": "frg7Fxp2Xk", + "name": "withdrawalId", + "required": true, + "description": "Withdrawal ID", + "example": "66617a2***3c9a", + "type": "string", + "enable": true + } + ], "path": [], "cookie": [], "header": [] }, "responses": [ { - "id": "10456", + "id": "10451", "code": 200, "name": "OK", "headers": [], "jsonSchema": { "type": "object", "properties": { - "code": { - "type": "string" - }, "data": { "type": "object", "properties": { - "uid": { + "id": { "type": "string", - "description": "Sub-Account UID" + "description": "Withdrawal ID" }, - "label": { + "chain": { "type": "string", - "description": "apikey remarks" + "description": "chain id of currency" }, - "apiKey": { + "walletTxId": { "type": "string", - "description": "apiKey" + "description": "Wallet Transaction ID" }, - "apiVersion": { + "uid": { "type": "integer", - "description": "apiVersion" - }, - "permissions": { - "type": "array", - "items": { - "type": "string" - }, - "description": "[Permissions](apidog://link/pages/338144) group list" - }, - "ipWhitelist": { - "type": "array", - "items": { - "type": "string" - }, - "description": "IP whitelist list" + "description": "UID" }, - "createdAt": { + "updatedAt": { "type": "integer", - "description": "Creation time, unix timestamp (milliseconds)", + "description": "Update Time (milliseconds)", "format": "int64" - } - }, - "required": [ - "uid", - "label", - "apiKey", - "apiVersion", - "permissions", - "ipWhitelist", - "createdAt" - ] - } - }, - "required": [ - "code", - "data" - ] - }, - "description": "", - "contentType": "json", - "mediaType": "" - } - ], - "responseExamples": [ - { - "name": "Success", - "data": "{\n \"code\": \"200000\",\n \"data\": {\n \"uid\": \"226383154\",\n \"label\": \"This is remarks\",\n \"apiKey\": \"671afb36cee20f00015cfaf1\",\n \"apiVersion\": 3,\n \"permissions\": [\n \"General\",\n \"Spot\"\n ],\n \"ipWhitelist\": [\n \"127.**.1\",\n \"123.**.123\"\n ],\n \"createdAt\": 1729821494000\n }\n}", - "responseId": 10456, - "ordering": 1 - } - ], - "requestBody": { - "type": "application/json", - "parameters": [], - "jsonSchema": { - "type": "object", - "properties": { - "uid": { - "type": "string", - "description": "Subaccount UID" - }, - "ipWhitelist": { - "type": "array", - "items": { - "type": "string" - }, - "description": "IP whitelist list, supports up to 20 IPs" - }, - "permissions": { - "type": "array", - "items": { - "type": "string", - "enum": [ - "general", - "spot", - "futures" - ], - "x-api-enum": [ - { - "value": "general", - "name": "General", - "description": "" }, - { - "value": "spot", - "name": "Spot", - "description": "" + "amount": { + "type": "string", + "description": "Amount" }, - { - "value": "futures", - "name": "Futures", - "description": "" - } - ] - }, - "description": "[Permissions](apidog://link/pages/338144) group list(Only General、Spot、Futures permissions can be set, such as \"General, Trade\". )\n" - }, - "label": { - "type": "string", - "description": "apikey remarks (length 4~32)\n", - "minLength": 4, - "maxLength": 32 - }, - "apiKey": { - "type": "string", - "description": "Subaccount apiKey" - } - }, - "required": [ - "uid", - "apiKey", - "ipWhitelist", - "permissions", - "label" - ] - }, - "example": "{\n \"uid\": \"226383154\",\n \"apiKey\": \"671afb36cee20f00015cfaf1\",\n \"ipWhitelist\": [\n \"127.0.0.1\",\n \"123.123.123.123\"\n ],\n \"permissions\": [\n \"general\",\n \"spot\"\n ],\n \"label\": \"This is remarks\"\n}", - "mediaType": "" - }, - "description": ":::info[Description]\nThis interface supports modify the Broker’s sub-account APIKEY\n:::", - "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Broker\",\"api-channel\":\"Private\",\"api-permission\":\"General\",\"api-rate-limit-pool\":\"Broker\",\"sdk-service\":\"Broker\",\"sdk-sub-service\":\"NDBroker\",\"sdk-method-name\":\"modifySubAccountApi\",\"sdk-method-description\":\"This interface supports modify the Broker’s sub-account APIKEY\",\"api-rate-limit\":3}" - } - }, - { - "name": "Transfer", - "api": { - "id": "3470293", - "method": "post", - "path": "/api/v1/broker/nd/transfer", - "parameters": { - "path": [], - "query": [], - "cookie": [], - "header": [] - }, - "responses": [ - { - "id": "10457", - "code": 200, - "name": "OK", - "headers": [], - "jsonSchema": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "data": { - "type": "object", - "properties": { - "orderId": { - "type": "string" + "memo": { + "type": "string", + "description": "Memo" + }, + "fee": { + "type": "string", + "description": "Fee" + }, + "address": { + "type": "string", + "description": "Address" + }, + "remark": { + "type": "string", + "description": "Remark" + }, + "isInner": { + "type": "boolean", + "description": "Is Internal (true or false)" + }, + "currency": { + "type": "string", + "description": "Currency" + }, + "status": { + "type": "string", + "description": "Status (PROCESSING, WALLET_PROCESSING, REVIEW, SUCCESS, FAILURE)", + "enum": [ + "PROCESSING", + "WALLET_PROCESSING", + "REVIEW", + "SUCCESS", + "FAILURE" + ], + "x-api-enum": [ + { + "value": "PROCESSING", + "name": "", + "description": "" + }, + { + "value": "WALLET_PROCESSING", + "name": "", + "description": "" + }, + { + "value": "REVIEW", + "name": "", + "description": "" + }, + { + "value": "SUCCESS", + "name": "", + "description": "" + }, + { + "value": "FAILURE", + "name": "", + "description": "" + } + ] + }, + "createdAt": { + "type": "integer", + "description": "Creation Time (milliseconds)", + "format": "int64" } }, "required": [ - "orderId" + "id", + "chain", + "walletTxId", + "uid", + "updatedAt", + "amount", + "memo", + "fee", + "address", + "remark", + "isInner", + "currency", + "status", + "createdAt" ] + }, + "code": { + "type": "string" } }, "required": [ - "code", - "data" + "data", + "code" ] }, "description": "", @@ -39546,474 +39511,161 @@ "responseExamples": [ { "name": "Success", - "data": "{\n \"code\": \"200000\",\n \"data\": {\n \"orderId\": \"671b4600c1e3dd000726866d\"\n }\n}", - "responseId": 10457, + "data": "{\n \"data\": {\n \"id\": \"66617a2***3c9a\",\n \"chain\": \"ton\",\n \"walletTxId\": \"AJ***eRI=\",\n \"uid\": 157267400,\n \"amount\": \"1.00000000\",\n \"memo\": \"7025734\",\n \"fee\": \"0.00000000\",\n \"address\": \"EQDn***dKbGzr\",\n \"remark\": \"\",\n \"isInner\": false,\n \"currency\": \"USDT\",\n \"status\": \"SUCCESS\",\n \"createdAt\": 1717664288000,\n \"updatedAt\": 1717664375000\n },\n \"code\": \"200000\"\n}", + "responseId": 10451, "ordering": 1 } ], "requestBody": { - "type": "application/json", + "type": "none", "parameters": [], "jsonSchema": { "type": "object", - "properties": { - "currency": { - "type": "string", - "description": "Currency" - }, - "amount": { - "type": "string", - "description": "Transfer Amount (must be a positive integer in the currency's precision)" - }, - "direction": { - "type": "string", - "description": "Fund transfer direction: OUT (Broker account is transferred to Broker sub-account), IN (Broker sub-account is transferred to Broker account)", - "enum": [ - "OUT", - "IN" - ], - "x-api-enum": [ - { - "value": "OUT", - "name": "", - "description": "" - }, - { - "value": "IN", - "name": "", - "description": "" - } - ] - }, - "accountType": { - "type": "string", - "description": "Broker account types: MAIN (Funding account), TRADE (Spot trading account)", - "enum": [ - "MAIN", - "TRADE" - ], - "x-api-enum": [ - { - "value": "MAIN", - "name": "", - "description": "" - }, - { - "value": "TRADE", - "name": "", - "description": "" - } - ] - }, - "specialUid": { - "type": "string", - "description": "Broker subaccount uid, must be the Broker subaccount created by the current Broker user." - }, - "specialAccountType": { - "type": "string", - "description": "Broker sub-account types: MAIN (Funding account), TRADE (Spot trading account)", - "enum": [ - "MAIN", - "TRADE" - ], - "x-api-enum": [ - { - "value": "MAIN", - "name": "", - "description": "" - }, - { - "value": "TRADE", - "name": "", - "description": "" - } - ] - }, - "clientOid": { - "type": "string", - "description": "Client Order Id, The unique identifier created by the client. It is recommended to use UUID. The maximum length is 128 bits.", - "maxLength": 128 - } - }, - "required": [ - "currency", - "amount", - "direction", - "accountType", - "specialUid", - "specialAccountType", - "clientOid" - ] + "properties": {} }, - "example": "{\n \"currency\": \"USDT\",\n \"amount\": \"1\",\n \"clientOid\": \"e6c24d23-6bc2-401b-bf9e-55e2daddfbc1\",\n \"direction\": \"OUT\",\n \"accountType\": \"MAIN\",\n \"specialUid\": \"226383154\",\n \"specialAccountType\": \"MAIN\"\n}", + "example": "", "mediaType": "" }, - "description": ":::info[Description]\nThis endpoint supports fund transfer between Broker account and Broker sub-accounts.\n\nPlease be aware that withdrawal from sub-account is not directly supported. Broker has to transfer funds from broker sub-account to broker account to initiate the withdrawals.\n:::", - "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Broker\",\"api-channel\":\"Private\",\"api-permission\":\"General\",\"api-rate-limit-pool\":\"Broker\",\"sdk-service\":\"Broker\",\"sdk-sub-service\":\"NDBroker\",\"sdk-method-name\":\"transfer\",\"sdk-method-description\":\"This endpoint supports fund transfer between Broker account and Broker sub-accounts. Please be aware that withdrawal from sub-account is not directly supported. Broker has to transfer funds from broker sub-account to broker account to initiate the withdrawals.\",\"api-rate-limit\":1}" - } - } - ] - } - ] - } - ] - }, - { - "name": "Websocket API", - "id": 348128, - "description": "", - "items": [ - { - "name": "Base Info", - "id": 348162, - "description": "", - "items": [ - { - "name": "Get Public Token - Spot/Margin", - "api": { - "id": "3470294", - "method": "post", - "path": "/api/v1/bullet-public", - "parameters": { - "query": [], - "path": [], - "cookie": [], - "header": [] - }, - "responses": [ - { - "id": "10458", - "code": 200, - "name": "OK", - "headers": [], - "jsonSchema": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "data": { - "type": "object", - "properties": { - "token": { - "type": "string", - "description": "The token required to establish a websocket connection" - }, - "instanceServers": { - "type": "array", - "items": { - "type": "object", - "properties": { - "endpoint": { - "type": "string", - "description": "Websocket domain URL, It is recommended to use a dynamic URL as the URL may change" - }, - "encrypt": { - "type": "boolean", - "description": "Whether to encrypt. Currently only supports wss, not ws" - }, - "protocol": { - "type": "string", - "description": "Network Protocol", - "enum": [ - "websocket" - ], - "x-api-enum": [ - { - "value": "websocket", - "name": "websocket", - "description": "websocket" - } - ] - }, - "pingInterval": { - "type": "integer", - "description": "Recommended ping interval(millisecond)" - }, - "pingTimeout": { - "type": "integer", - "description": "Heartbeat timeout(millisecond)" - } - }, - "required": [ - "endpoint", - "encrypt", - "protocol", - "pingInterval", - "pingTimeout" - ] - } - } - }, - "required": [ - "token", - "instanceServers" - ] - } - }, - "required": [ - "code", - "data" - ] - }, - "description": "", - "contentType": "json", - "mediaType": "" - } - ], - "responseExamples": [ - { - "name": "Success", - "data": "{\n \"code\": \"200000\",\n \"data\": {\n \"token\": \"2neAiuYvAU61ZDXANAGAsiL4-iAExhsBXZxftpOeh_55i3Ysy2q2LEsEWU64mdzUOPusi34M_wGoSf7iNyEWJ93g2WHl-j4M7tCZ_S21PuIByWXUJFDywtiYB9J6i9GjsxUuhPw3Blq6rhZlGykT3Vp1phUafnulOOpts-MEmEF-3bpfetLOAq79RbGaLlE4JBvJHl5Vs9Y=.ymP9jIr6v-vucrZr8761yA==\",\n \"instanceServers\": [\n {\n \"endpoint\": \"wss://ws-api-spot.kucoin.com/\",\n \"encrypt\": true,\n \"protocol\": \"websocket\",\n \"pingInterval\": 18000,\n \"pingTimeout\": 10000\n }\n ]\n }\n}", - "responseId": 10458, - "ordering": 1 + "description": ":::info[Description]\nThis endpoint supports querying the withdrawal records of sub-accounts created by a Broker (excluding main account of nd broker).\n:::", + "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Broker\",\"api-channel\":\"Private\",\"api-permission\":\"General\",\"api-rate-limit-pool\":\"Broker\",\"sdk-service\":\"Broker\",\"sdk-sub-service\":\"NDBroker\",\"sdk-method-name\":\"getWithdrawDetail\",\"sdk-method-description\":\"This endpoint supports querying the withdrawal records of sub-accounts created by a Broker (excluding main account of nd broker).\",\"api-rate-limit\":1}" } - ], - "requestBody": { - "type": "none", - "parameters": [], - "jsonSchema": { - "type": "object", - "properties": {} - }, - "mediaType": "" - }, - "description": ":::info[Description]\nThis interface can obtain the token required for websocket to establish a Spot/Margin connection.\nIf you need use public channels (e.g. all public market data), please make request as follows to obtain the server list and public token \n:::\n\n", - "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Spot\",\"api-channel\":\"Public\",\"api-permission\":\"NULL\",\"api-rate-limit-pool\":\"Public\",\"sdk-service\":\"Spot\",\"sdk-sub-service\":\"Market\",\"sdk-method-name\":\"getPublicToken\",\"sdk-method-description\":\"This interface can obtain the token required for websocket to establish a Spot/Margin connection. If you need use public channels (e.g. all public market data), please make request as follows to obtain the server list and public token\",\"api-rate-limit\":10}" - } - }, - { - "name": "Get Private Token - Spot/Margin", - "api": { - "id": "3470295", - "method": "post", - "path": "/api/v1/bullet-private", - "parameters": { - "query": [], - "path": [], - "cookie": [], - "header": [] }, - "responses": [ - { - "id": "10459", - "code": 200, - "name": "OK", - "headers": [], - "jsonSchema": { - "type": "object", - "properties": { - "code": { - "type": "string" + { + "name": "Get Broker Rebate", + "api": { + "id": "3470281", + "method": "get", + "path": "/api/v1/broker/nd/rebase/download", + "parameters": { + "query": [ + { + "id": "6iUCMmMHEI", + "name": "begin", + "required": true, + "description": "Start time, for example: 20240610", + "example": "20240610", + "type": "string", + "enable": true }, - "data": { - "type": "object", - "properties": { - "token": { - "type": "string", - "description": "The token required to establish a websocket connection" - }, - "instanceServers": { - "type": "array", - "items": { - "type": "object", - "properties": { - "endpoint": { - "type": "string", - "description": "Websocket domain URL, It is recommended to use a dynamic URL as the URL may change" - }, - "encrypt": { - "type": "boolean", - "description": "Whether to encrypt. Currently only supports wss, not ws" - }, - "protocol": { - "type": "string", - "description": "Network Protocol", - "enum": [ - "websocket" - ], - "x-api-enum": [ - { - "value": "websocket", - "name": "websocket", - "description": "websocket" - } - ] - }, - "pingInterval": { - "type": "integer", - "description": "Recommended ping interval(millisecond)" - }, - "pingTimeout": { - "type": "integer", - "description": "Heartbeat timeout(millisecond)" - } - }, - "required": [ - "endpoint", - "encrypt", - "protocol", - "pingInterval", - "pingTimeout" - ] - } - } - }, - "required": [ - "token", - "instanceServers" - ] - } - }, - "required": [ - "code", - "data" - ] - }, - "description": "", - "contentType": "json", - "mediaType": "" - } - ], - "responseExamples": [ - { - "name": "Success", - "data": "{\n \"code\": \"200000\",\n \"data\": {\n \"token\": \"2neAiuYvAU737TOajb2U3uT8AEZqSWYe0fBD4LoHuXJDSC7gIzJiH4kNTWhCPISWo6nDpAe7aUaaHJ4fG8oRjFgMfUI2sM4IySWHrBceFocY8pKy2REU1HwZIngtMdMrjqPnP-biofFWbNaP1cl0X1pZc2SQ-33hDH1LgNP-yg80ZJv_Ctaj8sAFhTOZ8m1L.jut4vBQxXAseWKxODdGVGg==\",\n \"instanceServers\": [\n {\n \"endpoint\": \"wss://ws-api-spot.kucoin.com/\",\n \"encrypt\": true,\n \"protocol\": \"websocket\",\n \"pingInterval\": 18000,\n \"pingTimeout\": 10000\n }\n ]\n }\n}", - "responseId": 10459, - "ordering": 1 - } - ], - "requestBody": { - "type": "none", - "parameters": [], - "jsonSchema": { - "type": "object", - "properties": {} - }, - "mediaType": "" - }, - "description": ":::info[Description]\nThis interface can obtain the token required for websocket to establish a Spot/Margin private connection.\nIf you need use private channels(e.g. account balance notice), please make request as follows to obtain the server list and private token\n:::\n\n", - "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"General\",\"api-rate-limit-pool\":\"Spot\",\"sdk-service\":\"Spot\",\"sdk-sub-service\":\"Market\",\"sdk-method-name\":\"getPrivateToken\",\"sdk-method-description\":\"This interface can obtain the token required for websocket to establish a Spot/Margin private connection. If you need use private channels(e.g. account balance notice), please make request as follows to obtain the server list and private token\",\"api-rate-limit\":10}" - } - }, - { - "name": "Get Private Token - Futures", - "api": { - "id": "3470296", - "method": "post", - "path": "/api/v1/bullet-private", - "parameters": { - "query": [], - "path": [], - "cookie": [], - "header": [] - }, - "responses": [ - { - "id": "10460", - "code": 200, - "name": "OK", - "headers": [], - "jsonSchema": { - "type": "object", - "properties": { - "code": { - "type": "string" + { + "id": "5uqjEGNGxr", + "name": "end", + "required": true, + "description": "End time, for example: 20241010 (query data with a maximum interval of 6 months)\n", + "example": "20241010", + "type": "string", + "enable": true }, - "data": { - "type": "object", - "properties": { - "token": { - "type": "string", - "description": "The token required to establish a websocket connection" - }, - "instanceServers": { - "type": "array", - "items": { - "type": "object", - "properties": { - "endpoint": { - "type": "string", - "description": "Websocket domain URL, It is recommended to use a dynamic URL as the URL may change" - }, - "encrypt": { - "type": "boolean", - "description": "Whether to encrypt. Currently only supports wss, not ws" - }, - "protocol": { - "type": "string", - "description": "Network Protocol", - "enum": [ - "websocket" - ], - "x-api-enum": [ - { - "value": "websocket", - "name": "websocket", - "description": "websocket" - } - ] - }, - "pingInterval": { - "type": "integer", - "description": "Recommended ping interval(millisecond)" - }, - "pingTimeout": { - "type": "integer", - "description": "Heartbeat timeout(millisecond)" - } - }, - "required": [ - "protocol", - "pingInterval", - "pingTimeout", - "encrypt", - "endpoint" - ] + { + "id": "LzvLfsT2yl", + "name": "tradeType", + "required": true, + "description": "Transaction type, 1: spot 2: futures", + "example": "1", + "type": "string", + "schema": { + "type": "string", + "enum": [ + "1", + "2" + ], + "x-api-enum": [ + { + "value": "1", + "name": "", + "description": "spot" + }, + { + "value": "2", + "name": "", + "description": "futures" } + ] + }, + "enable": true + } + ], + "path": [], + "cookie": [], + "header": [] + }, + "responses": [ + { + "id": "10445", + "code": 200, + "name": "OK", + "headers": [], + "jsonSchema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "object", + "properties": { + "url": { + "type": "string", + "description": "Rebate order file (link is valid for 1 day)" + } + }, + "required": [ + "url" + ] } }, "required": [ - "token", - "instanceServers" + "code", + "data" ] - } + }, + "description": "", + "contentType": "json", + "mediaType": "" + } + ], + "responseExamples": [ + { + "name": "Success", + "data": "{\n \"code\": \"200000\",\n \"data\": {\n \"url\": \"https://kc-v2-promotion.s3.ap-northeast-1.amazonaws.com/broker/671aec522593f600019766d0_file.csv?X-Amz-Security-Token=IQo*********2cd90f14efb\"\n }\n}", + "responseId": 10445, + "ordering": 1 + } + ], + "requestBody": { + "type": "none", + "parameters": [], + "jsonSchema": { + "type": "object", + "properties": {} }, - "required": [ - "code", - "data" - ] + "example": "", + "mediaType": "" }, - "description": "", - "contentType": "json", - "mediaType": "" - } - ], - "responseExamples": [ - { - "name": "Success", - "data": "{\n \"code\": \"200000\",\n \"data\": {\n \"token\": \"2neAiuYvAU737TOajb2U3uT8AEZqSWYe0fBD4LoHuXJDSC7gIzJiH4kNTWhCPISWo6nDpAe7aUaaHJ4fG8oRjFgMfUI2sM4IySWHrBceFocY8pKy2REU1HwZIngtMdMrjqPnP-biofFWbNaP1cl0X1pZc2SQ-33hDH1LgNP-yg8bktVoIG0dIxSN4m3uzO8u.ueCCihQ5_4GPpXKxWTDiFQ==\",\n \"instanceServers\": [\n {\n \"endpoint\": \"wss://ws-api-futures.kucoin.com/\",\n \"encrypt\": true,\n \"protocol\": \"websocket\",\n \"pingInterval\": 18000,\n \"pingTimeout\": 10000\n }\n ]\n }\n}", - "responseId": 10460, - "ordering": 1 + "description": ":::info[Description]\nThis interface supports downloading Broker rebate orders\n:::\n\n### Excel Response\n\n| Param | Description | Example |\n| ------------------- | ----------------- |--------- |\n| Date | Date | 2024/9/1 |\n| BrokerUID | Broker's UID | 3243241 |\n| AffiliateUID | Affiliate's UID | 2354546 |\n| UID | User's UID | 6345466 |\n| BizLine | Business Line(Spot、Futures) | Spot |\n| Volume | Volume | 0 |\n| TotalCommission | Total Commission = BrokerCommission + UserCommission + AffiliateCommission | 0 |\n| BrokerCommission | Broker Commission | 0 |\n| UserCommission | User Commission | 0 |\n| AffiliateCommission | Affiliate Commission | 0 |\n\n\n\n\n", + "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Broker\",\"api-channel\":\"Private\",\"api-permission\":\"General\",\"api-rate-limit-pool\":\"Broker\",\"sdk-service\":\"Broker\",\"sdk-sub-service\":\"NDBroker\",\"sdk-method-name\":\"getRebase\",\"sdk-method-description\":\"This interface supports downloading Broker rebate orders\",\"api-rate-limit\":3}" } - ], - "requestBody": { - "type": "none", - "parameters": [], - "jsonSchema": { - "type": "object", - "properties": {} - }, - "mediaType": "" - }, - "description": ":::info[Description]\nThis interface can obtain the token required for websocket to establish a Futures private connection.\nIf you need use private channels(e.g. account balance notice), please make request as follows to obtain the server list and private token\n:::", - "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Futures\",\"api-channel\":\"Private\",\"api-permission\":\"General\",\"api-rate-limit-pool\":\"Futures\",\"sdk-service\":\"Futures\",\"sdk-sub-service\":\"Market\",\"sdk-method-name\":\"getPrivateToken\",\"sdk-method-description\":\"This interface can obtain the token required for websocket to establish a Futures private connection. If you need use private channels(e.g. account balance notice), please make request as follows to obtain the server list and private token\",\"api-rate-limit\":10}" - } - }, + } + ] + } + ] + } + ] + }, + { + "name": "Websocket API", + "id": 348128, + "description": "", + "items": [ + { + "name": "Base Info", + "id": 348162, + "description": "", + "items": [ { - "name": "Get Public Token - Futures", + "name": "Get Public Token - Spot/Margin", "api": { - "id": "3470297", + "id": "3470294", "method": "post", "path": "/api/v1/bullet-public", "parameters": { @@ -40024,7 +39676,7 @@ }, "responses": [ { - "id": "10461", + "id": "10458", "code": 200, "name": "OK", "headers": [], @@ -40058,410 +39710,39 @@ "type": "string", "description": "Network Protocol", "enum": [ - "websocket" - ], - "x-api-enum": [ - { - "value": "websocket", - "name": "websocket", - "description": "websocket" - } - ] - }, - "pingInterval": { - "type": "integer", - "description": "Recommended ping interval(millisecond)" - }, - "pingTimeout": { - "type": "integer", - "description": "Heartbeat timeout(millisecond)" - } - }, - "required": [ - "endpoint", - "encrypt", - "protocol", - "pingInterval", - "pingTimeout" - ] - } - } - }, - "required": [ - "token", - "instanceServers" - ] - } - }, - "required": [ - "code", - "data" - ] - }, - "description": "", - "contentType": "json", - "mediaType": "" - } - ], - "responseExamples": [ - { - "name": "Success", - "data": "{\"code\":\"200000\",\"data\":{\"token\":\"2neAiuYvAU61ZDXANAGAsiL4-iAExhsBXZxftpOeh_55i3Ysy2q2LEsEWU64mdzUOPusi34M_wGoSf7iNyEWJ6dACm4ny9vJtLTRq_YsRUlG5ADnAawegdiYB9J6i9GjsxUuhPw3Blq6rhZlGykT3Vp1phUafnulOOpts-MEmEF-3bpfetLOAjsMMBS5qwTWJBvJHl5Vs9Y=.gJEIAywPXFr_4L-WG10eug==\",\"instanceServers\":[{\"endpoint\":\"wss://ws-api-futures.kucoin.com/\",\"encrypt\":true,\"protocol\":\"websocket\",\"pingInterval\":18000,\"pingTimeout\":10000}]}}", - "responseId": 10461, - "ordering": 1 - } - ], - "requestBody": { - "type": "none", - "parameters": [], - "jsonSchema": { - "type": "object", - "properties": {} - }, - "mediaType": "" - }, - "description": ":::info[Description]\nThis interface can obtain the token required for websocket to establish a Futures connection.\nIf you need use public channels (e.g. all public market data), please make request as follows to obtain the server list and public token\n:::\n\n", - "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Futures\",\"api-channel\":\"Public\",\"api-permission\":\"NULL\",\"api-rate-limit-pool\":\"Public\",\"sdk-service\":\"Futures\",\"sdk-sub-service\":\"Market\",\"sdk-method-name\":\"getPublicToken\",\"sdk-method-description\":\"This interface can obtain the token required for websocket to establish a Futures connection. If you need use public channels (e.g. all public market data), please make request as follows to obtain the server list and public token\",\"api-rate-limit\":10}" - } - } - ] - }, - { - "name": "Spot Trading", - "id": 348163, - "description": "", - "items": [ - { - "name": "Public Channels", - "id": 348166, - "description": "", - "items": [] - }, - { - "name": "Private Channels", - "id": 348167, - "description": "", - "items": [] - } - ] - }, - { - "name": "Margin Trading", - "id": 348164, - "description": "", - "items": [ - { - "name": "Public Channels", - "id": 348168, - "description": "", - "items": [] - }, - { - "name": "Private Channels", - "id": 348169, - "description": "", - "items": [] - } - ] - }, - { - "name": "Futures Trading", - "id": 348165, - "description": "", - "items": [ - { - "name": "Public Channels", - "id": 348170, - "description": "", - "items": [] - }, - { - "name": "Private Channels", - "id": 348171, - "description": "", - "items": [] - } - ] - } - ] - }, - { - "name": "Error Code", - "id": 348129, - "description": "", - "items": [] - }, - { - "name": "Abandoned Endpoints", - "id": 348130, - "description": "", - "items": [ - { - "name": "Account & Funding", - "id": 348172, - "description": "", - "items": [ - { - "name": "Get SubAccount List - Summary Info(V1)", - "api": { - "id": "3470298", - "method": "get", - "path": "/api/v1/sub/user", - "parameters": { - "path": [], - "query": [], - "cookie": [], - "header": [] - }, - "responses": [ - { - "id": "10462", - "code": 200, - "name": "OK", - "headers": [], - "jsonSchema": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "data": { - "type": "array", - "items": { - "type": "object", - "properties": { - "userId": { - "type": "string" - }, - "uid": { - "type": "integer" - }, - "subName": { - "type": "string" - }, - "type": { - "type": "integer" - }, - "remarks": { - "type": "string" - }, - "access": { - "type": "string", - "description": "Sub-account Permission" - } - }, - "required": [ - "userId", - "uid", - "subName", - "type", - "remarks", - "access" - ] - } - } - }, - "required": [ - "code", - "data" - ] - }, - "description": "", - "contentType": "json", - "mediaType": "" - } - ], - "responseExamples": [ - { - "name": "Success", - "data": "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"userId\": \"63743f07e0c5230001761d08\",\n \"uid\": 169579801,\n \"subName\": \"testapi6\",\n \"type\": 0,\n \"remarks\": \"remarks\",\n \"access\": \"All\"\n },\n {\n \"userId\": \"670538a31037eb000115b076\",\n \"uid\": 225139445,\n \"subName\": \"Name1234567\",\n \"type\": 0,\n \"remarks\": \"TheRemark\",\n \"access\": \"All\"\n }\n ]\n}", - "responseId": 10462, - "ordering": 1 - } - ], - "requestBody": { - "type": "none", - "parameters": [], - "mediaType": "" - }, - "description": ":::tip[]\nIt is recommended to use the **GET /api/v2/sub/user** endpoint instead of this endpoint\n:::\n\n:::info[Description]\nYou can get the user info of all sub-account via this interface.\n:::\n\n", - "customApiFields": "{\"abandon\":\"abandon\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"General\",\"api-rate-limit-pool\":\"Management\",\"sdk-service\":\"Account\",\"sdk-sub-service\":\"SubAccount\",\"sdk-method-name\":\"getSpotSubAccountsSummaryV1\",\"sdk-method-description\":\"You can get the user info of all sub-account via this interface It is recommended to use the GET /api/v2/sub/user interface for paging query\",\"api-rate-limit\":20}" - } - }, - { - "name": "Get SubAccount List - Spot Balance(V1)", - "api": { - "id": "3470299", - "method": "get", - "path": "/api/v1/sub-accounts", - "parameters": { - "path": [], - "query": [], - "cookie": [], - "header": [] - }, - "responses": [ - { - "id": "10463", - "code": 200, - "name": "OK", - "headers": [], - "jsonSchema": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "data": { - "type": "array", - "items": { - "type": "object", - "properties": { - "subUserId": { - "type": "string", - "description": "The user ID of the sub-user." - }, - "subName": { - "type": "string", - "description": "The username of the sub-user." - }, - "mainAccounts": { - "type": "array", - "items": { - "type": "object", - "properties": { - "currency": { - "type": "string", - "description": "The currency of the account." - }, - "balance": { - "type": "string", - "description": "Total funds in the account." - }, - "available": { - "type": "string", - "description": "Funds available to withdraw or trade." - }, - "holds": { - "type": "string", - "description": "Funds on hold (not available for use)." - }, - "baseCurrency": { - "type": "string", - "description": "Calculated on this currency." - }, - "baseCurrencyPrice": { - "type": "string", - "description": "The base currency price." - }, - "baseAmount": { - "type": "string", - "description": "The base currency amount." - }, - "tag": { - "type": "string" - } - } - }, - "description": "Funding Account" - }, - "tradeAccounts": { - "type": "array", - "items": { - "type": "object", - "properties": { - "currency": { - "type": "string", - "description": "The currency of the account." - }, - "balance": { - "type": "string", - "description": "Total funds in the account." - }, - "available": { - "type": "string", - "description": "Funds available to withdraw or trade." - }, - "holds": { - "type": "string", - "description": "Funds on hold (not available for use)." - }, - "baseCurrency": { - "type": "string", - "description": "Calculated on this currency." - }, - "baseCurrencyPrice": { - "type": "string", - "description": "The base currency price." - }, - "baseAmount": { - "type": "string", - "description": "The base currency amount." - }, - "tag": { - "type": "string" - } - } - }, - "description": "Spot Account" - }, - "marginAccounts": { - "type": "array", - "items": { - "type": "object", - "properties": { - "currency": { - "type": "string", - "description": "The currency of the account." - }, - "balance": { - "type": "string", - "description": "Total funds in the account." - }, - "available": { - "type": "string", - "description": "Funds available to withdraw or trade." - }, - "holds": { - "type": "string", - "description": "Funds on hold (not available for use)." - }, - "baseCurrency": { - "type": "string", - "description": "Calculated on this currency." - }, - "baseCurrencyPrice": { - "type": "string", - "description": "The base currency price." - }, - "baseAmount": { - "type": "string", - "description": "The base currency amount." - }, - "tag": { - "type": "string" - } + "websocket" + ], + "x-api-enum": [ + { + "value": "websocket", + "name": "websocket", + "description": "websocket" + } + ] + }, + "pingInterval": { + "type": "integer", + "description": "Recommended ping interval(millisecond)" + }, + "pingTimeout": { + "type": "integer", + "description": "Heartbeat timeout(millisecond)" } }, - "description": "Margin Account" - }, - "tradeHFAccounts": { - "type": "array", - "items": { - "type": "string" - }, - "description": "This param is deprecated and only valid for some old users" + "required": [ + "endpoint", + "encrypt", + "protocol", + "pingInterval", + "pingTimeout" + ] } - }, - "required": [ - "subUserId", - "subName", - "mainAccounts", - "tradeAccounts", - "marginAccounts", - "tradeHFAccounts" - ] - } + } + }, + "required": [ + "token", + "instanceServers" + ] } }, "required": [ @@ -40477,8 +39758,8 @@ "responseExamples": [ { "name": "Success", - "data": "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"subUserId\": \"63743f07e0c5230001761d08\",\n \"subName\": \"testapi6\",\n \"mainAccounts\": [\n {\n \"currency\": \"USDT\",\n \"balance\": \"0.01\",\n \"available\": \"0.01\",\n \"holds\": \"0\",\n \"baseCurrency\": \"BTC\",\n \"baseCurrencyPrice\": \"62489.8\",\n \"baseAmount\": \"0.00000016\",\n \"tag\": \"DEFAULT\"\n }\n ],\n \"tradeAccounts\": [\n {\n \"currency\": \"USDT\",\n \"balance\": \"0.01\",\n \"available\": \"0.01\",\n \"holds\": \"0\",\n \"baseCurrency\": \"BTC\",\n \"baseCurrencyPrice\": \"62489.8\",\n \"baseAmount\": \"0.00000016\",\n \"tag\": \"DEFAULT\"\n }\n ],\n \"marginAccounts\": [\n {\n \"currency\": \"USDT\",\n \"balance\": \"0.01\",\n \"available\": \"0.01\",\n \"holds\": \"0\",\n \"baseCurrency\": \"BTC\",\n \"baseCurrencyPrice\": \"62489.8\",\n \"baseAmount\": \"0.00000016\",\n \"tag\": \"DEFAULT\"\n }\n ],\n \"tradeHFAccounts\": []\n },\n {\n \"subUserId\": \"670538a31037eb000115b076\",\n \"subName\": \"Name1234567\",\n \"mainAccounts\": [],\n \"tradeAccounts\": [],\n \"marginAccounts\": [],\n \"tradeHFAccounts\": []\n },\n {\n \"subUserId\": \"66b0c0905fc1480001c14c36\",\n \"subName\": \"LTkucoin1491\",\n \"mainAccounts\": [],\n \"tradeAccounts\": [],\n \"marginAccounts\": [],\n \"tradeHFAccounts\": []\n }\n ]\n}", - "responseId": 10463, + "data": "{\n \"code\": \"200000\",\n \"data\": {\n \"token\": \"2neAiuYvAU61ZDXANAGAsiL4-iAExhsBXZxftpOeh_55i3Ysy2q2LEsEWU64mdzUOPusi34M_wGoSf7iNyEWJ93g2WHl-j4M7tCZ_S21PuIByWXUJFDywtiYB9J6i9GjsxUuhPw3Blq6rhZlGykT3Vp1phUafnulOOpts-MEmEF-3bpfetLOAq79RbGaLlE4JBvJHl5Vs9Y=.ymP9jIr6v-vucrZr8761yA==\",\n \"instanceServers\": [\n {\n \"endpoint\": \"wss://ws-api-spot.kucoin.com/\",\n \"encrypt\": true,\n \"protocol\": \"websocket\",\n \"pingInterval\": 18000,\n \"pingTimeout\": 10000\n }\n ]\n }\n}", + "responseId": 10458, "ordering": 1 } ], @@ -40491,43 +39772,25 @@ }, "mediaType": "" }, - "description": ":::tip[TIPS]\nIt is recommended to use the **GET /api/v2/sub-accounts** endpoint instead of this endpoint\n:::\n\n:::info[Description]\nThis endpoint returns the account info of all sub-users.\n:::\n", - "customApiFields": "{\"abandon\":\"abandon\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"General\",\"api-rate-limit-pool\":\"Management\",\"sdk-service\":\"Account\",\"sdk-sub-service\":\"SubAccount\",\"sdk-method-name\":\"getSpotSubAccountListV1\",\"sdk-method-description\":\"This endpoint returns the account info of all sub-users.\",\"api-rate-limit\":20}" + "description": ":::info[Description]\nThis interface can obtain the token required for websocket to establish a Spot/Margin connection.\nIf you need use public channels (e.g. all public market data), please make request as follows to obtain the server list and public token \n:::\n\n", + "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Spot\",\"api-channel\":\"Public\",\"api-permission\":\"NULL\",\"api-rate-limit-pool\":\"Public\",\"sdk-service\":\"Spot\",\"sdk-sub-service\":\"Market\",\"sdk-method-name\":\"getPublicToken\",\"sdk-method-description\":\"This interface can obtain the token required for websocket to establish a Spot/Margin connection. If you need use public channels (e.g. all public market data), please make request as follows to obtain the server list and public token\",\"api-rate-limit\":10}" } }, { - "name": "Get Deposit Addresses(V2)", + "name": "Get Private Token - Spot/Margin", "api": { - "id": "3470300", - "method": "get", - "path": "/api/v2/deposit-addresses", + "id": "3470295", + "method": "post", + "path": "/api/v1/bullet-private", "parameters": { - "query": [ - { - "id": "iIrspuNh6x", - "name": "currency", - "required": true, - "description": "currency", - "example": "", - "type": "string", - "schema": { - "type": "string", - "examples": [ - "BTC", - "ETH", - "USDT" - ] - }, - "enable": true - } - ], + "query": [], "path": [], "cookie": [], "header": [] }, "responses": [ { - "id": "10464", + "id": "10459", "code": 200, "name": "OK", "headers": [], @@ -40538,83 +39801,62 @@ "type": "string" }, "data": { - "type": "array", - "items": { - "type": "object", - "properties": { - "address": { - "type": "string", - "description": "Deposit address" - }, - "memo": { - "type": "string", - "description": "Address remark. If there’s no remark, it is empty. When you withdraw from other platforms to the KuCoin, you need to fill in memo(tag). If you do not fill memo (tag), your deposit may not be available, please be cautious." - }, - "chain": { - "type": "string", - "description": "The chainName of currency", - "examples": [ - "ERC20", - "BTC-Segwit", - "BTC", - "KCC", - "TRC20", - "BEP20", - "ARBITRUM", - "TON", - "OPTIMISM" - ] - }, - "chainId": { - "type": "string", - "examples": [ - "eth", - "bech32", - "btc", - "kcc", - "trx", - "bsc", - "arbitrum", - "ton", - "optimism" - ], - "description": "The chainId of currency" - }, - "to": { - "type": "string", - "description": "Deposit account type: main (funding account), trade (spot trading account)", - "enum": [ - "MAIN", - "TRADE" - ], - "x-api-enum": [ - { - "value": "MAIN", - "name": "", - "description": "" + "type": "object", + "properties": { + "token": { + "type": "string", + "description": "The token required to establish a websocket connection" + }, + "instanceServers": { + "type": "array", + "items": { + "type": "object", + "properties": { + "endpoint": { + "type": "string", + "description": "Websocket domain URL, It is recommended to use a dynamic URL as the URL may change" }, - { - "value": "TRADE", - "name": "", - "description": "" + "encrypt": { + "type": "boolean", + "description": "Whether to encrypt. Currently only supports wss, not ws" + }, + "protocol": { + "type": "string", + "description": "Network Protocol", + "enum": [ + "websocket" + ], + "x-api-enum": [ + { + "value": "websocket", + "name": "websocket", + "description": "websocket" + } + ] + }, + "pingInterval": { + "type": "integer", + "description": "Recommended ping interval(millisecond)" + }, + "pingTimeout": { + "type": "integer", + "description": "Heartbeat timeout(millisecond)" } + }, + "required": [ + "endpoint", + "encrypt", + "protocol", + "pingInterval", + "pingTimeout" ] - }, - "currency": { - "type": "string", - "description": "currency", - "examples": [ - "BTC", - "ETH", - "USDT" - ] - }, - "contractAddress": { - "type": "string", - "description": "The token contract address." } } - } + }, + "required": [ + "token", + "instanceServers" + ] } }, "required": [ @@ -40630,8 +39872,8 @@ "responseExamples": [ { "name": "Success", - "data": "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"address\": \"0x02028456*****87ede7a73d7c\",\n \"memo\": \"\",\n \"chain\": \"ERC20\",\n \"chainId\": \"eth\",\n \"to\": \"MAIN\",\n \"currency\": \"ETH\",\n \"contractAddress\": \"\"\n }\n ]\n}", - "responseId": 10464, + "data": "{\n \"code\": \"200000\",\n \"data\": {\n \"token\": \"2neAiuYvAU737TOajb2U3uT8AEZqSWYe0fBD4LoHuXJDSC7gIzJiH4kNTWhCPISWo6nDpAe7aUaaHJ4fG8oRjFgMfUI2sM4IySWHrBceFocY8pKy2REU1HwZIngtMdMrjqPnP-biofFWbNaP1cl0X1pZc2SQ-33hDH1LgNP-yg80ZJv_Ctaj8sAFhTOZ8m1L.jut4vBQxXAseWKxODdGVGg==\",\n \"instanceServers\": [\n {\n \"endpoint\": \"wss://ws-api-spot.kucoin.com/\",\n \"encrypt\": true,\n \"protocol\": \"websocket\",\n \"pingInterval\": 18000,\n \"pingTimeout\": 10000\n }\n ]\n }\n}", + "responseId": 10459, "ordering": 1 } ], @@ -40644,16 +39886,16 @@ }, "mediaType": "" }, - "description": ":::tip[TIPS]\nIt is recommended to use the **GET /api/v3/deposit-addresses** endpoint instead of this endpoint\n:::\n\n:::info[Description]\nGet all deposit addresses for the currency you intend to deposit. If the returned data is empty, you may need to Add Deposit Address first.\n:::", - "customApiFields": "{\"abandon\":\"abandon\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"General\",\"api-rate-limit-pool\":\"Management\",\"sdk-service\":\"Account\",\"sdk-sub-service\":\"Deposit\",\"sdk-method-name\":\"getDepositAddressV2\",\"sdk-method-description\":\"Get all deposit addresses for the currency you intend to deposit. If the returned data is empty, you may need to Add Deposit Address first.\",\"api-rate-limit\":5}" + "description": ":::info[Description]\nThis interface can obtain the token required for websocket to establish a Spot/Margin private connection.\nIf you need use private channels(e.g. account balance notice), please make request as follows to obtain the server list and private token\n:::\n\n", + "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"General\",\"api-rate-limit-pool\":\"Spot\",\"sdk-service\":\"Spot\",\"sdk-sub-service\":\"Market\",\"sdk-method-name\":\"getPrivateToken\",\"sdk-method-description\":\"This interface can obtain the token required for websocket to establish a Spot/Margin private connection. If you need use private channels(e.g. account balance notice), please make request as follows to obtain the server list and private token\",\"api-rate-limit\":10}" } }, { - "name": "SubAccount Transfer", + "name": "Get Public Token - Futures", "api": { - "id": "3470301", + "id": "3470297", "method": "post", - "path": "/api/v2/accounts/sub-transfer", + "path": "/api/v1/bullet-public", "parameters": { "query": [], "path": [], @@ -40662,7 +39904,7 @@ }, "responses": [ { - "id": "10465", + "id": "10461", "code": 200, "name": "OK", "headers": [], @@ -40675,13 +39917,59 @@ "data": { "type": "object", "properties": { - "orderId": { + "token": { "type": "string", - "description": "Transfer order ID" + "description": "The token required to establish a websocket connection" + }, + "instanceServers": { + "type": "array", + "items": { + "type": "object", + "properties": { + "endpoint": { + "type": "string", + "description": "Websocket domain URL, It is recommended to use a dynamic URL as the URL may change" + }, + "encrypt": { + "type": "boolean", + "description": "Whether to encrypt. Currently only supports wss, not ws" + }, + "protocol": { + "type": "string", + "description": "Network Protocol", + "enum": [ + "websocket" + ], + "x-api-enum": [ + { + "value": "websocket", + "name": "websocket", + "description": "websocket" + } + ] + }, + "pingInterval": { + "type": "integer", + "description": "Recommended ping interval(millisecond)" + }, + "pingTimeout": { + "type": "integer", + "description": "Heartbeat timeout(millisecond)" + } + }, + "required": [ + "endpoint", + "encrypt", + "protocol", + "pingInterval", + "pingTimeout" + ] + } } }, "required": [ - "orderId" + "token", + "instanceServers" ] } }, @@ -40698,156 +39986,230 @@ "responseExamples": [ { "name": "Success", - "data": "{\"code\":\"200000\",\"data\":{\"orderId\":\"670be6b0b1b9080007040a9b\"}}", - "responseId": 10465, + "data": "{\"code\":\"200000\",\"data\":{\"token\":\"2neAiuYvAU61ZDXANAGAsiL4-iAExhsBXZxftpOeh_55i3Ysy2q2LEsEWU64mdzUOPusi34M_wGoSf7iNyEWJ6dACm4ny9vJtLTRq_YsRUlG5ADnAawegdiYB9J6i9GjsxUuhPw3Blq6rhZlGykT3Vp1phUafnulOOpts-MEmEF-3bpfetLOAjsMMBS5qwTWJBvJHl5Vs9Y=.gJEIAywPXFr_4L-WG10eug==\",\"instanceServers\":[{\"endpoint\":\"wss://ws-api-futures.kucoin.com/\",\"encrypt\":true,\"protocol\":\"websocket\",\"pingInterval\":18000,\"pingTimeout\":10000}]}}", + "responseId": 10461, "ordering": 1 } ], "requestBody": { - "type": "application/json", + "type": "none", "parameters": [], "jsonSchema": { - "title": "", "type": "object", - "properties": { - "clientOid": { - "type": "string", - "description": "Unique order id created by users to identify their orders, e.g. UUID, with a maximum length of 128 bits" - }, - "currency": { - "type": "string", - "description": "currency" - }, - "amount": { - "type": "string", - "description": "Transfer amount, the amount is a positive integer multiple of the currency precision." - }, - "direction": { - "type": "string", - "description": "OUT — the master user to sub user\nIN — the sub user to the master user.", - "enum": [ - "IN", - "OUT" - ], - "x-api-enum": [ - { - "value": "IN", - "name": "", - "description": "" - }, - { - "value": "OUT", - "name": "", - "description": "" - } - ] - }, - "accountType": { - "type": "string", - "description": "Account type:MAIN、TRADE、CONTRACT、MARGIN", - "enum": [ - "MAIN", - "TRADE", - "MARGIN", - "CONTRACT", - "OPTION" - ], - "default": "MAIN", - "x-api-enum": [ - { - "value": "MAIN", - "name": "MAIN", - "description": "Funding account" - }, - { - "value": "TRADE", - "name": "TRADE", - "description": "Spot account" - }, - { - "value": "MARGIN", - "name": "MARGIN", - "description": "Margin account" - }, - { - "value": "CONTRACT", - "name": "CONTRACT", - "description": "Futures account" - }, - { - "value": "OPTION", - "name": "OPTION", - "description": "Option account" - } - ] - }, - "subAccountType": { - "type": "string", - "description": "Sub Account type:MAIN、TRADE、CONTRACT、MARGIN", - "enum": [ - "MAIN", - "TRADE", - "MARGIN", - "CONTRACT" - ], - "default": "MAIN", - "x-api-enum": [ - { - "value": "MAIN", - "name": "", - "description": "" - }, - { - "value": "TRADE", - "name": "", - "description": "" - }, - { - "value": "MARGIN", - "name": "", - "description": "" + "properties": {} + }, + "mediaType": "" + }, + "description": ":::info[Description]\nThis interface can obtain the token required for websocket to establish a Futures connection.\nIf you need use public channels (e.g. all public market data), please make request as follows to obtain the server list and public token\n:::\n\n", + "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Futures\",\"api-channel\":\"Public\",\"api-permission\":\"NULL\",\"api-rate-limit-pool\":\"Public\",\"sdk-service\":\"Futures\",\"sdk-sub-service\":\"Market\",\"sdk-method-name\":\"getPublicToken\",\"sdk-method-description\":\"This interface can obtain the token required for websocket to establish a Futures connection. If you need use public channels (e.g. all public market data), please make request as follows to obtain the server list and public token\",\"api-rate-limit\":10}" + } + }, + { + "name": "Get Private Token - Futures", + "api": { + "id": "3470296", + "method": "post", + "path": "/api/v1/bullet-private", + "parameters": { + "query": [], + "path": [], + "cookie": [], + "header": [] + }, + "responses": [ + { + "id": "10460", + "code": 200, + "name": "OK", + "headers": [], + "jsonSchema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "object", + "properties": { + "token": { + "type": "string", + "description": "The token required to establish a websocket connection" + }, + "instanceServers": { + "type": "array", + "items": { + "type": "object", + "properties": { + "endpoint": { + "type": "string", + "description": "Websocket domain URL, It is recommended to use a dynamic URL as the URL may change" + }, + "encrypt": { + "type": "boolean", + "description": "Whether to encrypt. Currently only supports wss, not ws" + }, + "protocol": { + "type": "string", + "description": "Network Protocol", + "enum": [ + "websocket" + ], + "x-api-enum": [ + { + "value": "websocket", + "name": "websocket", + "description": "websocket" + } + ] + }, + "pingInterval": { + "type": "integer", + "description": "Recommended ping interval(millisecond)" + }, + "pingTimeout": { + "type": "integer", + "description": "Heartbeat timeout(millisecond)" + } + }, + "required": [ + "protocol", + "pingInterval", + "pingTimeout", + "encrypt", + "endpoint" + ] + } + } }, - { - "value": "CONTRACT", - "name": "", - "description": "" - } - ] + "required": [ + "token", + "instanceServers" + ] + } }, - "subUserId": { - "type": "string", - "description": "the user ID of a sub-account." - } + "required": [ + "code", + "data" + ] }, - "required": [ - "clientOid", - "amount", - "currency", - "direction" - ] + "description": "", + "contentType": "json", + "mediaType": "" + } + ], + "responseExamples": [ + { + "name": "Success", + "data": "{\n \"code\": \"200000\",\n \"data\": {\n \"token\": \"2neAiuYvAU737TOajb2U3uT8AEZqSWYe0fBD4LoHuXJDSC7gIzJiH4kNTWhCPISWo6nDpAe7aUaaHJ4fG8oRjFgMfUI2sM4IySWHrBceFocY8pKy2REU1HwZIngtMdMrjqPnP-biofFWbNaP1cl0X1pZc2SQ-33hDH1LgNP-yg8bktVoIG0dIxSN4m3uzO8u.ueCCihQ5_4GPpXKxWTDiFQ==\",\n \"instanceServers\": [\n {\n \"endpoint\": \"wss://ws-api-futures.kucoin.com/\",\n \"encrypt\": true,\n \"protocol\": \"websocket\",\n \"pingInterval\": 18000,\n \"pingTimeout\": 10000\n }\n ]\n }\n}", + "responseId": 10460, + "ordering": 1 + } + ], + "requestBody": { + "type": "none", + "parameters": [], + "jsonSchema": { + "type": "object", + "properties": {} }, - "example": "{\n \"clientOid\": \"64ccc0f164781800010d8c09\",\n \"currency\": \"USDT\",\n \"amount\": \"0.01\",\n \"direction\": \"OUT\",\n \"accountType\": \"MAIN\",\n \"subAccountType\": \"MAIN\",\n \"subUserId\": \"63743f07e0c5230001761d08\"\n}", "mediaType": "" }, - "description": ":::tip[TIPS]\nIt is recommended to use the **GET /api/v3/accounts/universal-transfer** endpoint instead of this endpoint\n:::\n\n:::info[Description]\nFunds in the main account, trading account and margin account of a Master Account can be transferred to the main account, trading account, futures account and margin account of its Sub-Account. The futures account of both the Master Account and Sub-Account can only accept funds transferred in from the main account, trading account and margin account and cannot transfer out to these accounts.\n:::\n", - "customApiFields": "{\"abandon\":\"abandon\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"Spot\",\"api-rate-limit-pool\":\"Management\",\"sdk-service\":\"Account\",\"sdk-sub-service\":\"Transfer\",\"sdk-method-name\":\"subAccountTransfer\",\"sdk-method-description\":\"Funds in the main account, trading account and margin account of a Master Account can be transferred to the main account, trading account, futures account and margin account of its Sub-Account. The futures account of both the Master Account and Sub-Account can only accept funds transferred in from the main account, trading account and margin account and cannot transfer out to these accounts.\",\"api-rate-limit\":30}" + "description": ":::info[Description]\nThis interface can obtain the token required for websocket to establish a Futures private connection.\nIf you need use private channels(e.g. account balance notice), please make request as follows to obtain the server list and private token\n:::", + "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Futures\",\"api-channel\":\"Private\",\"api-permission\":\"General\",\"api-rate-limit-pool\":\"Futures\",\"sdk-service\":\"Futures\",\"sdk-sub-service\":\"Market\",\"sdk-method-name\":\"getPrivateToken\",\"sdk-method-description\":\"This interface can obtain the token required for websocket to establish a Futures private connection. If you need use private channels(e.g. account balance notice), please make request as follows to obtain the server list and private token\",\"api-rate-limit\":10}" } + } + ] + }, + { + "name": "Spot Trading", + "id": 348163, + "description": "", + "items": [ + { + "name": "Public Channels", + "id": 348166, + "description": "", + "items": [] }, { - "name": "Inner Transfer", + "name": "Private Channels", + "id": 348167, + "description": "", + "items": [] + } + ] + }, + { + "name": "Margin Trading", + "id": 348164, + "description": "", + "items": [ + { + "name": "Public Channels", + "id": 348168, + "description": "", + "items": [] + }, + { + "name": "Private Channels", + "id": 348169, + "description": "", + "items": [] + } + ] + }, + { + "name": "Futures Trading", + "id": 348165, + "description": "", + "items": [ + { + "name": "Public Channels", + "id": 348170, + "description": "", + "items": [] + }, + { + "name": "Private Channels", + "id": 348171, + "description": "", + "items": [] + } + ] + } + ] + }, + { + "name": "Error Code", + "id": 348129, + "description": "", + "items": [] + }, + { + "name": "Abandoned Endpoints", + "id": 348130, + "description": "", + "items": [ + { + "name": "Account & Funding", + "id": 348172, + "description": "", + "items": [ + { + "name": "Get SubAccount List - Summary Info(V1)", "api": { - "id": "3470302", - "method": "post", - "path": "/api/v2/accounts/inner-transfer", + "id": "3470298", + "method": "get", + "path": "/api/v1/sub/user", "parameters": { - "query": [], "path": [], + "query": [], "cookie": [], "header": [] }, "responses": [ { - "id": "10466", + "id": "10462", "code": 200, "name": "OK", "headers": [], @@ -40858,16 +40220,39 @@ "type": "string" }, "data": { - "type": "object", - "properties": { - "orderId": { - "type": "string", - "description": "Transfer order ID" - } - }, - "required": [ - "orderId" - ] + "type": "array", + "items": { + "type": "object", + "properties": { + "userId": { + "type": "string" + }, + "uid": { + "type": "integer" + }, + "subName": { + "type": "string" + }, + "type": { + "type": "integer" + }, + "remarks": { + "type": "string" + }, + "access": { + "type": "string", + "description": "Sub-account Permission" + } + }, + "required": [ + "userId", + "uid", + "subName", + "type", + "remarks", + "access" + ] + } } }, "required": [ @@ -40883,169 +40268,35 @@ "responseExamples": [ { "name": "Success", - "data": "{\"code\":\"200000\",\"data\":{\"orderId\":\"670beb3482a1bb0007dec644\"}}", - "responseId": 10466, + "data": "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"userId\": \"63743f07e0c5230001761d08\",\n \"uid\": 169579801,\n \"subName\": \"testapi6\",\n \"type\": 0,\n \"remarks\": \"remarks\",\n \"access\": \"All\"\n },\n {\n \"userId\": \"670538a31037eb000115b076\",\n \"uid\": 225139445,\n \"subName\": \"Name1234567\",\n \"type\": 0,\n \"remarks\": \"TheRemark\",\n \"access\": \"All\"\n }\n ]\n}", + "responseId": 10462, "ordering": 1 } ], "requestBody": { - "type": "application/json", + "type": "none", "parameters": [], - "jsonSchema": { - "title": "", - "type": "object", - "properties": { - "clientOid": { - "type": "string", - "description": "Unique order id created by users to identify their orders, e.g. UUID, with a maximum length of 128 bits" - }, - "currency": { - "type": "string", - "description": "currency" - }, - "amount": { - "type": "string", - "description": "Transfer amount, the amount is a positive integer multiple of the currency precision." - }, - "to": { - "type": "string", - "description": "Receiving Account Type: main, trade, margin, isolated, margin_v2, isolated_v2, contract", - "enum": [ - "main", - "trade", - "margin", - "isolated", - "margin_v2", - "isolated_v2", - "option" - ], - "x-api-enum": [ - { - "value": "main", - "name": "main", - "description": "Funding account" - }, - { - "value": "trade", - "name": "trade", - "description": "Spot account" - }, - { - "value": "margin", - "name": "margin", - "description": "Cross margin account" - }, - { - "value": "isolated", - "name": "isolated", - "description": "Isolated margin account" - }, - { - "value": "margin_v2", - "name": "margin_v2", - "description": "Cross margin account" - }, - { - "value": "isolated_v2", - "name": "isolated_v2", - "description": "Isolated margin account" - }, - { - "value": "option", - "name": "option", - "description": "Option account" - } - ] - }, - "fromTag": { - "type": "string", - "description": "Trading pair, required when the payment account type is isolated, e.g.: BTC-USDT" - }, - "toTag": { - "type": "string", - "description": "Trading pair, required when the payment account type is isolated, e.g.: BTC-USDT" - }, - "from": { - "type": "string", - "description": "Payment Account Type: main, trade, margin, isolated, margin_v2, isolated_v2", - "enum": [ - "main", - "trade", - "margin", - "isolated", - "margin_v2", - "isolated_v2", - "option" - ], - "x-api-enum": [ - { - "value": "main", - "name": "main", - "description": "Funding account" - }, - { - "value": "trade", - "name": "trade", - "description": "Spot account" - }, - { - "value": "margin", - "name": "margin", - "description": "Cross margin account" - }, - { - "value": "isolated", - "name": "isolated", - "description": "Isolated margin account" - }, - { - "value": "margin_v2", - "name": "margin_v2", - "description": "Cross margin account" - }, - { - "value": "isolated_v2", - "name": "isolated_v2", - "description": "Isolated margin account" - }, - { - "value": "option", - "name": "option", - "description": "Option account" - } - ] - } - }, - "required": [ - "clientOid", - "amount", - "currency", - "from", - "to" - ] - }, - "example": "{\n \"clientOid\": \"64ccc0f164781800010d8c09\",\n \"currency\": \"USDT\",\n \"amount\": \"0.01\",\n \"from\": \"main\",\n \"to\": \"trade\"\n}", "mediaType": "" }, - "description": ":::tip[TIPS]\nIt is recommended to use the **GET /api/v3/accounts/universal-transfer** endpoint instead of this endpoint\n:::\n\n:::info[Description]\nThis API endpoint can be used to transfer funds between accounts internally. Users can transfer funds between their account free of charge. \n:::\n\nnotice:\nIt is not supported to transfer funds from contract account to other accounts.\nThe margin_v2 account currently only supports mutual transfers with margin accounts, and cannot be directly transferred from other accounts to margin_v2\nThe isolated_v2 account currently only supports mutual transfer with the margin account, and cannot be directly transferred from other accounts to isolated_v2", - "customApiFields": "{\"abandon\":\"abandon\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"Spot\",\"api-rate-limit-pool\":\"Management\",\"sdk-service\":\"Account\",\"sdk-sub-service\":\"Transfer\",\"sdk-method-name\":\"innerTransfer\",\"sdk-method-description\":\"This API endpoint can be used to transfer funds between accounts internally. Users can transfer funds between their account free of charge. \",\"api-rate-limit\":10}" + "description": ":::tip[]\nIt is recommended to use the **GET /api/v2/sub/user** endpoint instead of this endpoint\n:::\n\n:::info[Description]\nYou can get the user info of all sub-account via this interface.\n:::\n\n", + "customApiFields": "{\"abandon\":\"abandon\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"General\",\"api-rate-limit-pool\":\"Management\",\"sdk-service\":\"Account\",\"sdk-sub-service\":\"SubAccount\",\"sdk-method-name\":\"getSpotSubAccountsSummaryV1\",\"sdk-method-description\":\"You can get the user info of all sub-account via this interface It is recommended to use the GET /api/v2/sub/user interface for paging query\",\"api-rate-limit\":20}" } }, { - "name": "Futures Account Transfer Out", + "name": "Get SubAccount List - Spot Balance(V1)", "api": { - "id": "3470303", - "method": "post", - "path": "/api/v3/transfer-out", + "id": "3470299", + "method": "get", + "path": "/api/v1/sub-accounts", "parameters": { - "query": [], "path": [], + "query": [], "cookie": [], "header": [] }, "responses": [ { - "id": "10467", + "id": "10463", "code": 200, "name": "OK", "headers": [], @@ -41056,99 +40307,155 @@ "type": "string" }, "data": { - "type": "object", - "properties": { - "applyId": { - "type": "string", - "description": "Transfer order ID" - }, - "bizNo": { - "type": "string", - "description": "Business number" - }, - "payAccountType": { - "type": "string", - "description": "Pay account type" - }, - "payTag": { - "type": "string", - "description": "Pay account sub type" - }, - "remark": { - "type": "string", - "description": "User remark" - }, - "recAccountType": { - "type": "string", - "description": "Receive account type" - }, - "recTag": { - "type": "string", - "description": "Receive account sub type" - }, - "recRemark": { - "type": "string", - "description": "Receive account tx remark" - }, - "recSystem": { - "type": "string", - "description": "Receive system" - }, - "status": { - "type": "string", - "description": "Status:APPLY, PROCESSING, PENDING_APPROVAL, APPROVED, REJECTED, PENDING_CANCEL, CANCEL, SUCCESS" - }, - "currency": { - "type": "string", - "description": "Currency" - }, - "amount": { - "type": "string", - "description": "Transfer amout" - }, - "fee": { - "type": "string", - "description": "Transfer fee" - }, - "sn": { - "type": "integer", - "description": "Serial number", - "format": "int64" - }, - "reason": { - "type": "string", - "description": "Fail Reason" - }, - "createdAt": { - "type": "integer", - "description": "Create time", - "format": "int64" - }, - "updatedAt": { - "type": "integer", - "description": "Update time", - "format": "int64" - } - }, - "required": [ - "applyId", - "bizNo", - "payAccountType", - "payTag", - "remark", - "recAccountType", - "recTag", - "recRemark", - "recSystem", - "status", - "currency", - "amount", - "fee", - "sn", - "reason", - "createdAt", - "updatedAt" - ] + "type": "array", + "items": { + "type": "object", + "properties": { + "subUserId": { + "type": "string", + "description": "The user ID of the sub-user." + }, + "subName": { + "type": "string", + "description": "The username of the sub-user." + }, + "mainAccounts": { + "type": "array", + "items": { + "type": "object", + "properties": { + "currency": { + "type": "string", + "description": "The currency of the account." + }, + "balance": { + "type": "string", + "description": "Total funds in the account." + }, + "available": { + "type": "string", + "description": "Funds available to withdraw or trade." + }, + "holds": { + "type": "string", + "description": "Funds on hold (not available for use)." + }, + "baseCurrency": { + "type": "string", + "description": "Calculated on this currency." + }, + "baseCurrencyPrice": { + "type": "string", + "description": "The base currency price." + }, + "baseAmount": { + "type": "string", + "description": "The base currency amount." + }, + "tag": { + "type": "string" + } + } + }, + "description": "Funding Account" + }, + "tradeAccounts": { + "type": "array", + "items": { + "type": "object", + "properties": { + "currency": { + "type": "string", + "description": "The currency of the account." + }, + "balance": { + "type": "string", + "description": "Total funds in the account." + }, + "available": { + "type": "string", + "description": "Funds available to withdraw or trade." + }, + "holds": { + "type": "string", + "description": "Funds on hold (not available for use)." + }, + "baseCurrency": { + "type": "string", + "description": "Calculated on this currency." + }, + "baseCurrencyPrice": { + "type": "string", + "description": "The base currency price." + }, + "baseAmount": { + "type": "string", + "description": "The base currency amount." + }, + "tag": { + "type": "string" + } + } + }, + "description": "Spot Account" + }, + "marginAccounts": { + "type": "array", + "items": { + "type": "object", + "properties": { + "currency": { + "type": "string", + "description": "The currency of the account." + }, + "balance": { + "type": "string", + "description": "Total funds in the account." + }, + "available": { + "type": "string", + "description": "Funds available to withdraw or trade." + }, + "holds": { + "type": "string", + "description": "Funds on hold (not available for use)." + }, + "baseCurrency": { + "type": "string", + "description": "Calculated on this currency." + }, + "baseCurrencyPrice": { + "type": "string", + "description": "The base currency price." + }, + "baseAmount": { + "type": "string", + "description": "The base currency amount." + }, + "tag": { + "type": "string" + } + } + }, + "description": "Margin Account" + }, + "tradeHFAccounts": { + "type": "array", + "items": { + "type": "string" + }, + "description": "This param is deprecated and only valid for some old users" + } + }, + "required": [ + "subUserId", + "subName", + "mainAccounts", + "tradeAccounts", + "marginAccounts", + "tradeHFAccounts" + ] + } } }, "required": [ @@ -41164,81 +40471,57 @@ "responseExamples": [ { "name": "Success", - "data": "{\n \"code\": \"200000\",\n \"data\": {\n \"applyId\": \"670bf84c577f6c00017a1c48\",\n \"bizNo\": \"670bf84c577f6c00017a1c47\",\n \"payAccountType\": \"CONTRACT\",\n \"payTag\": \"DEFAULT\",\n \"remark\": \"\",\n \"recAccountType\": \"MAIN\",\n \"recTag\": \"DEFAULT\",\n \"recRemark\": \"\",\n \"recSystem\": \"KUCOIN\",\n \"status\": \"PROCESSING\",\n \"currency\": \"USDT\",\n \"amount\": \"0.01\",\n \"fee\": \"0\",\n \"sn\": 1519769124134806,\n \"reason\": \"\",\n \"createdAt\": 1728837708000,\n \"updatedAt\": 1728837708000\n }\n}", - "responseId": 10467, + "data": "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"subUserId\": \"63743f07e0c5230001761d08\",\n \"subName\": \"testapi6\",\n \"mainAccounts\": [\n {\n \"currency\": \"USDT\",\n \"balance\": \"0.01\",\n \"available\": \"0.01\",\n \"holds\": \"0\",\n \"baseCurrency\": \"BTC\",\n \"baseCurrencyPrice\": \"62489.8\",\n \"baseAmount\": \"0.00000016\",\n \"tag\": \"DEFAULT\"\n }\n ],\n \"tradeAccounts\": [\n {\n \"currency\": \"USDT\",\n \"balance\": \"0.01\",\n \"available\": \"0.01\",\n \"holds\": \"0\",\n \"baseCurrency\": \"BTC\",\n \"baseCurrencyPrice\": \"62489.8\",\n \"baseAmount\": \"0.00000016\",\n \"tag\": \"DEFAULT\"\n }\n ],\n \"marginAccounts\": [\n {\n \"currency\": \"USDT\",\n \"balance\": \"0.01\",\n \"available\": \"0.01\",\n \"holds\": \"0\",\n \"baseCurrency\": \"BTC\",\n \"baseCurrencyPrice\": \"62489.8\",\n \"baseAmount\": \"0.00000016\",\n \"tag\": \"DEFAULT\"\n }\n ],\n \"tradeHFAccounts\": []\n },\n {\n \"subUserId\": \"670538a31037eb000115b076\",\n \"subName\": \"Name1234567\",\n \"mainAccounts\": [],\n \"tradeAccounts\": [],\n \"marginAccounts\": [],\n \"tradeHFAccounts\": []\n },\n {\n \"subUserId\": \"66b0c0905fc1480001c14c36\",\n \"subName\": \"LTkucoin1491\",\n \"mainAccounts\": [],\n \"tradeAccounts\": [],\n \"marginAccounts\": [],\n \"tradeHFAccounts\": []\n }\n ]\n}", + "responseId": 10463, "ordering": 1 } ], "requestBody": { - "type": "application/json", + "type": "none", "parameters": [], "jsonSchema": { - "title": "", "type": "object", - "properties": { - "currency": { - "type": "string", - "description": "Currency, including XBT,USDT...", - "examples": [ - "XBT", - "USDT", - "ETH" - ] - }, - "amount": { - "type": "number", - "description": "Amount to be transfered out, the maximum cannot exceed 1000000000", - "maximum": 1000000000 - }, - "recAccountType": { - "type": "string", - "description": "Receive account type, including MAIN,TRADE", - "enum": [ - "MAIN", - "TRADE" - ], - "x-api-enum": [ - { - "value": "MAIN", - "name": "", - "description": "" - }, - { - "value": "TRADE", - "name": "", - "description": "" - } - ] - } - }, - "required": [ - "amount", - "currency", - "recAccountType" - ] + "properties": {} }, - "example": "{\n \"currency\": \"USDT\",\n \"amount\": 0.01,\n \"recAccountType\": \"MAIN\"\n}", "mediaType": "" }, - "description": ":::tip[TIPS]\nIt is recommended to use the **GET /api/v3/accounts/universal-transfer** endpoint instead of this endpoint\n:::\n\n:::info[Description]\nThe amount to be transferred will be deducted from the KuCoin Futures Account. Please ensure that you have sufficient funds in your KuCoin Futures Account, or the transfer will fail.\n:::", - "customApiFields": "{\"abandon\":\"abandon\",\"domain\":\"Futures\",\"api-channel\":\"Private\",\"api-permission\":\"Futures\",\"api-rate-limit-pool\":\"Management\",\"sdk-service\":\"Account\",\"sdk-sub-service\":\"Transfer\",\"sdk-method-name\":\"futuresAccountTransferOut\",\"sdk-method-description\":\"The amount to be transferred will be deducted from the KuCoin Futures Account. Please ensure that you have sufficient funds in your KuCoin Futures Account, or the transfer will fail.\",\"api-rate-limit\":20}" + "description": ":::tip[TIPS]\nIt is recommended to use the **GET /api/v2/sub-accounts** endpoint instead of this endpoint\n:::\n\n:::info[Description]\nThis endpoint returns the account info of all sub-users.\n:::\n", + "customApiFields": "{\"abandon\":\"abandon\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"General\",\"api-rate-limit-pool\":\"Management\",\"sdk-service\":\"Account\",\"sdk-sub-service\":\"SubAccount\",\"sdk-method-name\":\"getSpotSubAccountListV1\",\"sdk-method-description\":\"This endpoint returns the account info of all sub-users.\",\"api-rate-limit\":20}" } }, { - "name": "Futures Account Transfer In", + "name": "Get Deposit Addresses(V2)", "api": { - "id": "3470304", - "method": "post", - "path": "/api/v1/transfer-in", + "id": "3470300", + "method": "get", + "path": "/api/v2/deposit-addresses", "parameters": { - "query": [], + "query": [ + { + "id": "iIrspuNh6x", + "name": "currency", + "required": true, + "description": "currency", + "example": "", + "type": "string", + "schema": { + "type": "string", + "examples": [ + "BTC", + "ETH", + "USDT" + ] + }, + "enable": true + } + ], "path": [], "cookie": [], "header": [] }, "responses": [ { - "id": "10468", + "id": "10464", "code": 200, "name": "OK", "headers": [], @@ -41249,7 +40532,83 @@ "type": "string" }, "data": { - "type": "string" + "type": "array", + "items": { + "type": "object", + "properties": { + "address": { + "type": "string", + "description": "Deposit address" + }, + "memo": { + "type": "string", + "description": "Address remark. If there’s no remark, it is empty. When you withdraw from other platforms to the KuCoin, you need to fill in memo(tag). If you do not fill memo (tag), your deposit may not be available, please be cautious." + }, + "chain": { + "type": "string", + "description": "The chainName of currency", + "examples": [ + "ERC20", + "BTC-Segwit", + "BTC", + "KCC", + "TRC20", + "BEP20", + "ARBITRUM", + "TON", + "OPTIMISM" + ] + }, + "chainId": { + "type": "string", + "examples": [ + "eth", + "bech32", + "btc", + "kcc", + "trx", + "bsc", + "arbitrum", + "ton", + "optimism" + ], + "description": "The chainId of currency" + }, + "to": { + "type": "string", + "description": "Deposit account type: main (funding account), trade (spot trading account)", + "enum": [ + "MAIN", + "TRADE" + ], + "x-api-enum": [ + { + "value": "MAIN", + "name": "", + "description": "" + }, + { + "value": "TRADE", + "name": "", + "description": "" + } + ] + }, + "currency": { + "type": "string", + "description": "currency", + "examples": [ + "BTC", + "ETH", + "USDT" + ] + }, + "contractAddress": { + "type": "string", + "description": "The token contract address." + } + } + } } }, "required": [ @@ -41265,121 +40624,39 @@ "responseExamples": [ { "name": "Success", - "data": "{\"code\":\"200000\",\"data\":null}", - "responseId": 10468, + "data": "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"address\": \"0x02028456*****87ede7a73d7c\",\n \"memo\": \"\",\n \"chain\": \"ERC20\",\n \"chainId\": \"eth\",\n \"to\": \"MAIN\",\n \"currency\": \"ETH\",\n \"contractAddress\": \"\"\n }\n ]\n}", + "responseId": 10464, "ordering": 1 } ], "requestBody": { - "type": "application/json", + "type": "none", "parameters": [], "jsonSchema": { - "title": "", "type": "object", - "properties": { - "currency": { - "type": "string", - "description": "Currency, including XBT,USDT...", - "examples": [ - "XBT", - "USDT", - "ETH" - ] - }, - "amount": { - "type": "number", - "description": "Amount to be transfered in" - }, - "payAccountType": { - "type": "string", - "description": "Payment account type, including MAIN,TRADE", - "enum": [ - "MAIN", - "TRADE" - ], - "x-api-enum": [ - { - "value": "MAIN", - "name": "", - "description": "" - }, - { - "value": "TRADE", - "name": "", - "description": "" - } - ] - } - }, - "required": [ - "amount", - "currency", - "payAccountType" - ] + "properties": {} }, - "example": "{\n \"currency\": \"USDT\",\n \"amount\": 0.01,\n \"payAccountType\": \"MAIN\"\n}", "mediaType": "" }, - "description": ":::tip[TIPS]\nIt is recommended to use the **GET /api/v3/accounts/universal-transfer** endpoint instead of this endpoint\n:::\n\n:::info[Description]\nThe amount to be transferred will be deducted from the payAccount. Please ensure that you have sufficient funds in your payAccount Account, or the transfer will fail.\n:::", - "customApiFields": "{\"abandon\":\"abandon\",\"domain\":\"Futures\",\"api-channel\":\"Private\",\"api-permission\":\"Futures\",\"api-rate-limit-pool\":\"Management\",\"sdk-service\":\"Account\",\"sdk-sub-service\":\"Transfer\",\"sdk-method-name\":\"futuresAccountTransferIn\",\"sdk-method-description\":\"The amount to be transferred will be deducted from the payAccount. Please ensure that you have sufficient funds in your payAccount Account, or the transfer will fail.\",\"api-rate-limit\":20}" + "description": ":::tip[TIPS]\nIt is recommended to use the **GET /api/v3/deposit-addresses** endpoint instead of this endpoint\n:::\n\n:::info[Description]\nGet all deposit addresses for the currency you intend to deposit. If the returned data is empty, you may need to Add Deposit Address first.\n:::", + "customApiFields": "{\"abandon\":\"abandon\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"General\",\"api-rate-limit-pool\":\"Management\",\"sdk-service\":\"Account\",\"sdk-sub-service\":\"Deposit\",\"sdk-method-name\":\"getDepositAddressV2\",\"sdk-method-description\":\"Get all deposit addresses for the currency you intend to deposit. If the returned data is empty, you may need to Add Deposit Address first.\",\"api-rate-limit\":5}" } }, { - "name": "Get Deposit Addresses - V1", + "name": "SubAccount Transfer", "api": { - "id": "3470305", - "method": "get", - "path": "/api/v1/deposit-addresses", + "id": "3470301", + "method": "post", + "path": "/api/v2/accounts/sub-transfer", "parameters": { - "query": [ - { - "id": "iIrspuNh6x", - "name": "currency", - "required": true, - "description": "currency", - "example": "", - "type": "string", - "schema": { - "type": "string", - "examples": [ - "BTC", - "ETH", - "USDT" - ] - }, - "enable": true - }, - { - "id": "Z4ZrGIhlK3", - "name": "chain", - "required": false, - "description": "The chainId of currency, e.g. The available value for USDT are OMNI, ERC20, TRC20, default is ERC20. The available value for BTC are Native, Segwit, TRC20, the parameters are bech32, btc, trx, default is Native. This only apply for multi-chain currency, and there is no need for single chain currency.", - "type": "string", - "schema": { - "type": "string", - "default": "eth", - "examples": [ - "eth", - "bech32", - "btc", - "kcc", - "trx", - "bsc", - "arbitrum", - "ton", - "optimism" - ] - }, - "enable": true - } - ], + "query": [], "path": [], "cookie": [], "header": [] }, "responses": [ { - "id": "10469", + "id": "10465", "code": 200, "name": "OK", "headers": [], @@ -41392,78 +40669,14 @@ "data": { "type": "object", "properties": { - "address": { - "type": "string", - "description": "Deposit address" - }, - "memo": { - "type": "string", - "description": "Address remark. If there’s no remark, it is empty. When you withdraw from other platforms to the KuCoin, you need to fill in memo(tag). If you do not fill memo (tag), your deposit may not be available, please be cautious." - }, - "chain": { - "type": "string", - "description": "The chainName of currency", - "examples": [ - "ERC20", - "BTC-Segwit", - "BTC", - "KCC", - "TRC20", - "BEP20", - "ARBITRUM", - "TON", - "OPTIMISM" - ] - }, - "chainId": { - "type": "string", - "description": "The chainId of currency", - "examples": [ - "eth", - "bech32", - "btc", - "kcc", - "trx", - "bsc", - "arbitrum", - "ton", - "optimism" - ] - }, - "to": { - "type": "string", - "description": "Deposit account type: main (funding account), trade (spot trading account)", - "enum": [ - "MAIN", - "TRADE" - ], - "x-api-enum": [ - { - "value": "MAIN", - "name": "", - "description": "" - }, - { - "value": "TRADE", - "name": "", - "description": "" - } - ] - }, - "currency": { - "type": "string", - "description": "currency", - "examples": [ - "BTC", - "ETH", - "USDT" - ] - }, - "contractAddress": { + "orderId": { "type": "string", - "description": "The token contract address." + "description": "Transfer order ID" } - } + }, + "required": [ + "orderId" + ] } }, "required": [ @@ -41479,117 +40692,156 @@ "responseExamples": [ { "name": "Success", - "data": "{\n \"code\": \"200000\",\n \"data\": {\n \"address\": \"0xea220bf61c3c2b0adc2cfa29fec3d2677745a379\",\n \"memo\": \"\",\n \"chain\": \"ERC20\",\n \"chainId\": \"eth\",\n \"to\": \"MAIN\",\n \"currency\": \"USDT\"\n }\n}", - "responseId": 10469, + "data": "{\"code\":\"200000\",\"data\":{\"orderId\":\"670be6b0b1b9080007040a9b\"}}", + "responseId": 10465, "ordering": 1 } ], "requestBody": { - "type": "none", + "type": "application/json", "parameters": [], "jsonSchema": { + "title": "", "type": "object", - "properties": {} - }, - "mediaType": "" - }, - "description": ":::tip[TIPS]\nIt is recommended to use the **GET /api/v3/deposit-addresses** endpoint instead of this endpoint\n:::\n\n:::info[Description]\nGet all deposit addresses for the currency you intend to deposit. If the returned data is empty, you may need to Add Deposit Address first.\n:::\n", - "customApiFields": "{\"abandon\":\"abandon\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"General\",\"api-rate-limit-pool\":\"Management\",\"sdk-service\":\"Account\",\"sdk-sub-service\":\"Deposit\",\"sdk-method-name\":\"getDepositAddressV1\",\"sdk-method-description\":\"Get all deposit addresses for the currency you intend to deposit. If the returned data is empty, you may need to Add Deposit Address first.\",\"api-rate-limit\":5}" - } - }, - { - "name": "Get Deposit History - Old", - "api": { - "id": "3470306", - "method": "get", - "path": "/api/v1/hist-deposits", - "parameters": { - "query": [ - { - "id": "iIrspuNh6x", - "name": "currency", - "required": true, - "description": "currency", - "example": "", - "type": "string", - "schema": { + "properties": { + "clientOid": { "type": "string", - "examples": [ - "BTC", - "ETH", - "USDT" - ] + "description": "Unique order id created by users to identify their orders, e.g. UUID, with a maximum length of 128 bits" }, - "enable": true - }, - { - "id": "0cGmW3GSC0", - "name": "status", - "required": false, - "description": "Status. Available value: PROCESSING, SUCCESS, and FAILURE", - "example": "SUCCESS", - "type": "string", - "schema": { + "currency": { + "type": "string", + "description": "currency" + }, + "amount": { + "type": "string", + "description": "Transfer amount, the amount is a positive integer multiple of the currency precision." + }, + "direction": { "type": "string", + "description": "OUT — the master user to sub user\nIN — the sub user to the master user.", "enum": [ - "PROCESSING", - "SUCCESS", - "FAILURE" + "IN", + "OUT" ], "x-api-enum": [ { - "value": "PROCESSING", + "value": "IN", "name": "", "description": "" }, { - "value": "SUCCESS", + "value": "OUT", "name": "", "description": "" + } + ] + }, + "accountType": { + "type": "string", + "description": "Account type:MAIN、TRADE、CONTRACT、MARGIN", + "enum": [ + "MAIN", + "TRADE", + "MARGIN", + "CONTRACT", + "OPTION" + ], + "default": "MAIN", + "x-api-enum": [ + { + "value": "MAIN", + "name": "MAIN", + "description": "Funding account" }, { - "value": "FAILURE", - "name": "", - "description": "" + "value": "TRADE", + "name": "TRADE", + "description": "Spot account" + }, + { + "value": "MARGIN", + "name": "MARGIN", + "description": "Margin account" + }, + { + "value": "CONTRACT", + "name": "CONTRACT", + "description": "Futures account" + }, + { + "value": "OPTION", + "name": "OPTION", + "description": "Option account" } ] }, - "enable": true - }, - { - "id": "5Lwpfvg7zz", - "name": "startAt", - "required": false, - "description": "Start time (milisecond)", - "example": "1728663338000", - "type": "integer", - "schema": { - "type": "integer", - "format": "int64" + "subAccountType": { + "type": "string", + "description": "Sub Account type:MAIN、TRADE、CONTRACT、MARGIN", + "enum": [ + "MAIN", + "TRADE", + "MARGIN", + "CONTRACT" + ], + "default": "MAIN", + "x-api-enum": [ + { + "value": "MAIN", + "name": "", + "description": "" + }, + { + "value": "TRADE", + "name": "", + "description": "" + }, + { + "value": "MARGIN", + "name": "", + "description": "" + }, + { + "value": "CONTRACT", + "name": "", + "description": "" + } + ] }, - "enable": true + "subUserId": { + "type": "string", + "description": "the user ID of a sub-account." + } }, - { - "id": "WvwRPqp0J5", - "name": "endAt", - "required": false, - "description": "End time (milisecond)", - "example": "1728692138000", - "type": "integer", - "schema": { - "type": "integer", - "format": "int64" - }, - "enable": true - } - ], + "required": [ + "clientOid", + "amount", + "currency", + "direction" + ] + }, + "example": "{\n \"clientOid\": \"64ccc0f164781800010d8c09\",\n \"currency\": \"USDT\",\n \"amount\": \"0.01\",\n \"direction\": \"OUT\",\n \"accountType\": \"MAIN\",\n \"subAccountType\": \"MAIN\",\n \"subUserId\": \"63743f07e0c5230001761d08\"\n}", + "mediaType": "" + }, + "description": ":::tip[TIPS]\nIt is recommended to use the **GET /api/v3/accounts/universal-transfer** endpoint instead of this endpoint\n:::\n\n:::info[Description]\nFunds in the main account, trading account and margin account of a Master Account can be transferred to the main account, trading account, futures account and margin account of its Sub-Account. The futures account of both the Master Account and Sub-Account can only accept funds transferred in from the main account, trading account and margin account and cannot transfer out to these accounts.\n:::\n", + "customApiFields": "{\"abandon\":\"abandon\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"Spot\",\"api-rate-limit-pool\":\"Management\",\"sdk-service\":\"Account\",\"sdk-sub-service\":\"Transfer\",\"sdk-method-name\":\"subAccountTransfer\",\"sdk-method-description\":\"Funds in the main account, trading account and margin account of a Master Account can be transferred to the main account, trading account, futures account and margin account of its Sub-Account. The futures account of both the Master Account and Sub-Account can only accept funds transferred in from the main account, trading account and margin account and cannot transfer out to these accounts.\",\"api-rate-limit\":30}" + } + }, + { + "name": "Inner Transfer", + "api": { + "id": "3470302", + "method": "post", + "path": "/api/v2/accounts/inner-transfer", + "parameters": { + "query": [], "path": [], "cookie": [], "header": [] }, "responses": [ { - "id": "10470", + "id": "10466", "code": 200, "name": "OK", "headers": [], @@ -41602,82 +40854,13 @@ "data": { "type": "object", "properties": { - "currentPage": { - "type": "integer", - "description": "current page" - }, - "pageSize": { - "type": "integer", - "description": "page size" - }, - "totalNum": { - "type": "integer", - "description": "total number" - }, - "totalPage": { - "type": "integer", - "description": "total page" - }, - "items": { - "type": "array", - "items": { - "type": "object", - "properties": { - "currency": { - "type": "string", - "description": "Currency" - }, - "createAt": { - "type": "integer", - "description": "Creation time of the database record" - }, - "amount": { - "type": "string", - "description": "Deposit amount" - }, - "walletTxId": { - "type": "string", - "description": "Wallet Txid" - }, - "isInner": { - "type": "boolean", - "description": "Internal deposit or not" - }, - "status": { - "type": "string", - "enum": [ - "PROCESSING", - "SUCCESS", - "FAILURE" - ], - "x-api-enum": [ - { - "value": "PROCESSING", - "name": "", - "description": "" - }, - { - "value": "SUCCESS", - "name": "", - "description": "" - }, - { - "value": "FAILURE", - "name": "", - "description": "" - } - ] - } - } - } + "orderId": { + "type": "string", + "description": "Transfer order ID" } }, "required": [ - "currentPage", - "pageSize", - "totalNum", - "totalPage", - "items" + "orderId" ] } }, @@ -41694,163 +40877,169 @@ "responseExamples": [ { "name": "Success", - "data": "{\n \"code\": \"200000\",\n \"data\": {\n \"currentPage\": 1,\n \"pageSize\": 50,\n \"totalNum\": 0,\n \"totalPage\": 0,\n \"items\": [\n {\n \"currency\": \"BTC\",\n \"createAt\": 1528536998,\n \"amount\": \"0.03266638\",\n \"walletTxId\": \"55c643bc2c68d6f17266383ac1be9e454038864b929ae7cee0bc408cc5c869e8@12ffGWmMMD1zA1WbFm7Ho3JZ1w6NYXjpFk@234\",\n \"isInner\": false,\n \"status\": \"SUCCESS\"\n }\n ]\n }\n}", - "responseId": 10470, + "data": "{\"code\":\"200000\",\"data\":{\"orderId\":\"670beb3482a1bb0007dec644\"}}", + "responseId": 10466, "ordering": 1 } ], "requestBody": { - "type": "none", + "type": "application/json", "parameters": [], "jsonSchema": { + "title": "", "type": "object", - "properties": {} - }, - "mediaType": "" - }, - "description": ":::tip[TIPS]\nIt is recommended to use the **GET /api/v1/deposits** endpoint instead of this endpoint\n:::\n\n:::info[Description]\nRequest via this endpoint to get the V1 historical deposits list on KuCoin. The return value is the data after Pagination, sorted in descending order according to time.\n:::\n\n:::tip[TIPS]\nDefault query for one month of data.\nThis request is paginated\n:::", - "customApiFields": "{\"abandon\":\"abandon\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"General\",\"api-rate-limit-pool\":\"Management\",\"sdk-service\":\"Account\",\"sdk-sub-service\":\"Deposit\",\"sdk-method-name\":\"getDepositHistoryOld\",\"sdk-method-description\":\"Request via this endpoint to get the V1 historical deposits list on KuCoin. The return value is the data after Pagination, sorted in descending order according to time.\",\"api-rate-limit\":5}" - } - }, - { - "name": "Get Futures Account Transfer Out Ledger", - "api": { - "id": "3470307", - "method": "get", - "path": "/api/v1/transfer-list", - "parameters": { - "query": [ - { - "id": "iIrspuNh6x", - "name": "currency", - "required": false, - "description": "currency", - "example": "", - "type": "string", - "schema": { + "properties": { + "clientOid": { "type": "string", - "examples": [ - "XBT", - "USDT", - "ETH" - ] + "description": "Unique order id created by users to identify their orders, e.g. UUID, with a maximum length of 128 bits" }, - "enable": true - }, - { - "id": "Dn0j2ITQMe", - "name": "type", - "required": false, - "description": "Status PROCESSING, SUCCESS, FAILURE", - "type": "string", - "schema": { + "currency": { + "type": "string", + "description": "currency" + }, + "amount": { + "type": "string", + "description": "Transfer amount, the amount is a positive integer multiple of the currency precision." + }, + "to": { "type": "string", + "description": "Receiving Account Type: main, trade, margin, isolated, margin_v2, isolated_v2, contract", "enum": [ - "MAIN", - "TRADE", - "MARGIN", - "ISOLATED" + "main", + "trade", + "margin", + "isolated", + "margin_v2", + "isolated_v2", + "option" ], "x-api-enum": [ { - "value": "MAIN", - "name": "", - "description": "" + "value": "main", + "name": "main", + "description": "Funding account" }, { - "value": "TRADE", - "name": "", - "description": "" + "value": "trade", + "name": "trade", + "description": "Spot account" }, { - "value": "MARGIN", - "name": "", - "description": "" + "value": "margin", + "name": "margin", + "description": "Cross margin account" }, { - "value": "ISOLATED", - "name": "", - "description": "" + "value": "isolated", + "name": "isolated", + "description": "Isolated margin account" + }, + { + "value": "margin_v2", + "name": "margin_v2", + "description": "Cross margin account" + }, + { + "value": "isolated_v2", + "name": "isolated_v2", + "description": "Isolated margin account" + }, + { + "value": "option", + "name": "option", + "description": "Option account" } ] }, - "enable": true, - "example": "MAIN" - }, - { - "id": "pU2UVFoaY6", - "name": "tag", - "required": false, - "description": "Status List PROCESSING, SUCCESS, FAILURE", - "type": "array", - "schema": { - "type": "array", - "items": { - "type": "string" - } - }, - "enable": true - }, - { - "id": "JXDXFL0pit", - "name": "startAt", - "required": false, - "description": "Start time (milisecond)", - "example": "1728663338000", - "type": "integer", - "schema": { - "type": "integer", - "format": "int64" - }, - "enable": true - }, - { - "id": "h4o3HcI26F", - "name": "endAt", - "required": false, - "description": "End time (milisecond)", - "example": "1728692138000", - "type": "integer", - "schema": { - "type": "integer", - "format": "int64" + "fromTag": { + "type": "string", + "description": "Trading pair, required when the payment account type is isolated, e.g.: BTC-USDT" }, - "enable": true - }, - { - "id": "GXsjHTtpda", - "name": "currentPage", - "required": false, - "description": "Current request page, The default currentPage is 1", - "type": "integer", - "schema": { - "type": "integer", - "format": "int64", - "default": 1 + "toTag": { + "type": "string", + "description": "Trading pair, required when the payment account type is isolated, e.g.: BTC-USDT" }, - "enable": true + "from": { + "type": "string", + "description": "Payment Account Type: main, trade, margin, isolated, margin_v2, isolated_v2", + "enum": [ + "main", + "trade", + "margin", + "isolated", + "margin_v2", + "isolated_v2", + "option" + ], + "x-api-enum": [ + { + "value": "main", + "name": "main", + "description": "Funding account" + }, + { + "value": "trade", + "name": "trade", + "description": "Spot account" + }, + { + "value": "margin", + "name": "margin", + "description": "Cross margin account" + }, + { + "value": "isolated", + "name": "isolated", + "description": "Isolated margin account" + }, + { + "value": "margin_v2", + "name": "margin_v2", + "description": "Cross margin account" + }, + { + "value": "isolated_v2", + "name": "isolated_v2", + "description": "Isolated margin account" + }, + { + "value": "option", + "name": "option", + "description": "Option account" + } + ] + } }, - { - "id": "8oTh0NFp8G", - "name": "pageSize", - "required": false, - "description": "pageSize, The default pageSize is 50", - "type": "integer", - "schema": { - "type": "integer", - "format": "int64", - "default": 50 - }, - "enable": true - } - ], + "required": [ + "clientOid", + "amount", + "currency", + "from", + "to" + ] + }, + "example": "{\n \"clientOid\": \"64ccc0f164781800010d8c09\",\n \"currency\": \"USDT\",\n \"amount\": \"0.01\",\n \"from\": \"main\",\n \"to\": \"trade\"\n}", + "mediaType": "" + }, + "description": ":::tip[TIPS]\nIt is recommended to use the **GET /api/v3/accounts/universal-transfer** endpoint instead of this endpoint\n:::\n\n:::info[Description]\nThis API endpoint can be used to transfer funds between accounts internally. Users can transfer funds between their account free of charge. \n:::\n\nnotice:\nIt is not supported to transfer funds from contract account to other accounts.\nThe margin_v2 account currently only supports mutual transfers with margin accounts, and cannot be directly transferred from other accounts to margin_v2\nThe isolated_v2 account currently only supports mutual transfer with the margin account, and cannot be directly transferred from other accounts to isolated_v2", + "customApiFields": "{\"abandon\":\"abandon\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"Spot\",\"api-rate-limit-pool\":\"Management\",\"sdk-service\":\"Account\",\"sdk-sub-service\":\"Transfer\",\"sdk-method-name\":\"innerTransfer\",\"sdk-method-description\":\"This API endpoint can be used to transfer funds between accounts internally. Users can transfer funds between their account free of charge. \",\"api-rate-limit\":10}" + } + }, + { + "name": "Futures Account Transfer Out", + "api": { + "id": "3470303", + "method": "post", + "path": "/api/v3/transfer-out", + "parameters": { + "query": [], "path": [], "cookie": [], "header": [] }, "responses": [ { - "id": "10471", + "id": "10467", "code": 200, "name": "OK", "headers": [], @@ -41863,101 +41052,96 @@ "data": { "type": "object", "properties": { - "currentPage": { - "type": "integer", - "description": "current page" + "applyId": { + "type": "string", + "description": "Transfer order ID" }, - "pageSize": { - "type": "integer", - "description": "page size" + "bizNo": { + "type": "string", + "description": "Business number" }, - "totalNum": { - "type": "integer", - "description": "total number" + "payAccountType": { + "type": "string", + "description": "Pay account type" }, - "totalPage": { - "type": "integer", - "description": "total page" + "payTag": { + "type": "string", + "description": "Pay account sub type" }, - "items": { - "type": "array", - "items": { - "type": "object", - "properties": { - "applyId": { - "type": "string", - "description": "Transfer order ID" - }, - "currency": { - "type": "string", - "description": "Currency" - }, - "recRemark": { - "type": "string", - "description": "Receive account tx remark" - }, - "recSystem": { - "type": "string", - "description": "Receive system" - }, - "status": { - "type": "string", - "description": "Status PROCESSING, SUCCESS, FAILURE", - "enum": [ - "PROCESSING", - "SUCCESS", - "FAILURE" - ], - "x-api-enum": [ - { - "value": "PROCESSING", - "name": "", - "description": "" - }, - { - "value": "SUCCESS", - "name": "", - "description": "" - }, - { - "value": "FAILURE", - "name": "", - "description": "" - } - ] - }, - "amount": { - "type": "string", - "description": "Transaction amount" - }, - "reason": { - "type": "string", - "description": "Reason caused the failure" - }, - "offset": { - "type": "integer", - "description": "Offset", - "format": "int64" - }, - "createdAt": { - "type": "integer", - "description": "Request application time", - "format": "int64" - }, - "remark": { - "type": "string", - "description": "User remark" - } - } - } + "remark": { + "type": "string", + "description": "User remark" + }, + "recAccountType": { + "type": "string", + "description": "Receive account type" + }, + "recTag": { + "type": "string", + "description": "Receive account sub type" + }, + "recRemark": { + "type": "string", + "description": "Receive account tx remark" + }, + "recSystem": { + "type": "string", + "description": "Receive system" + }, + "status": { + "type": "string", + "description": "Status:APPLY, PROCESSING, PENDING_APPROVAL, APPROVED, REJECTED, PENDING_CANCEL, CANCEL, SUCCESS" + }, + "currency": { + "type": "string", + "description": "Currency" + }, + "amount": { + "type": "string", + "description": "Transfer amout" + }, + "fee": { + "type": "string", + "description": "Transfer fee" + }, + "sn": { + "type": "integer", + "description": "Serial number", + "format": "int64" + }, + "reason": { + "type": "string", + "description": "Fail Reason" + }, + "createdAt": { + "type": "integer", + "description": "Create time", + "format": "int64" + }, + "updatedAt": { + "type": "integer", + "description": "Update time", + "format": "int64" } }, "required": [ - "currentPage", - "pageSize", - "totalNum", - "totalPage", - "items" + "applyId", + "bizNo", + "payAccountType", + "payTag", + "remark", + "recAccountType", + "recTag", + "recRemark", + "recSystem", + "status", + "currency", + "amount", + "fee", + "sn", + "reason", + "createdAt", + "updatedAt" ] } }, @@ -41974,145 +41158,81 @@ "responseExamples": [ { "name": "Success", - "data": "{\"code\":\"200000\",\"data\":{\"currentPage\":1,\"pageSize\":50,\"totalNum\":1,\"totalPage\":1,\"items\":[{\"applyId\":\"670bf84c577f6c00017a1c48\",\"currency\":\"USDT\",\"recRemark\":\"\",\"recSystem\":\"KUCOIN\",\"status\":\"SUCCESS\",\"amount\":\"0.01\",\"reason\":\"\",\"offset\":1519769124134806,\"createdAt\":1728837708000,\"remark\":\"\"}]}}", - "responseId": 10471, + "data": "{\n \"code\": \"200000\",\n \"data\": {\n \"applyId\": \"670bf84c577f6c00017a1c48\",\n \"bizNo\": \"670bf84c577f6c00017a1c47\",\n \"payAccountType\": \"CONTRACT\",\n \"payTag\": \"DEFAULT\",\n \"remark\": \"\",\n \"recAccountType\": \"MAIN\",\n \"recTag\": \"DEFAULT\",\n \"recRemark\": \"\",\n \"recSystem\": \"KUCOIN\",\n \"status\": \"PROCESSING\",\n \"currency\": \"USDT\",\n \"amount\": \"0.01\",\n \"fee\": \"0\",\n \"sn\": 1519769124134806,\n \"reason\": \"\",\n \"createdAt\": 1728837708000,\n \"updatedAt\": 1728837708000\n }\n}", + "responseId": 10467, "ordering": 1 } ], "requestBody": { - "type": "none", + "type": "application/json", "parameters": [], "jsonSchema": { + "title": "", "type": "object", - "properties": {} - }, - "mediaType": "" - }, - "description": ":::info[Description]\nThis endpoint can get futures account transfer out ledger\n:::", - "customApiFields": "{\"abandon\":\"abandon\",\"domain\":\"Futures\",\"api-channel\":\"Private\",\"api-permission\":\"General\",\"api-rate-limit-pool\":\"Management\",\"sdk-service\":\"Account\",\"sdk-sub-service\":\"Transfer\",\"sdk-method-name\":\"getFuturesAccountTransferOutLedger\",\"sdk-method-description\":\"This endpoint can get futures account transfer out ledger\",\"api-rate-limit\":20}" - } - }, - { - "name": "Get Withdrawal History - Old", - "api": { - "id": "3470308", - "method": "get", - "path": "/api/v1/hist-withdrawals", - "parameters": { - "query": [ - { - "id": "iIrspuNh6x", - "name": "currency", - "required": true, - "description": "currency", - "example": "", - "type": "string", - "schema": { + "properties": { + "currency": { "type": "string", + "description": "Currency, including XBT,USDT...", "examples": [ - "BTC", - "ETH", - "USDT" + "XBT", + "USDT", + "ETH" ] }, - "enable": true - }, - { - "id": "0cGmW3GSC0", - "name": "status", - "required": false, - "description": "Status. Available value: PROCESSING, SUCCESS, and FAILURE", - "example": "SUCCESS", - "type": "string", - "schema": { + "amount": { + "type": "number", + "description": "Amount to be transfered out, the maximum cannot exceed 1000000000", + "maximum": 1000000000 + }, + "recAccountType": { "type": "string", + "description": "Receive account type, including MAIN,TRADE", "enum": [ - "PROCESSING", - "SUCCESS", - "FAILURE" + "MAIN", + "TRADE" ], "x-api-enum": [ { - "value": "PROCESSING", - "name": "", - "description": "" - }, - { - "value": "SUCCESS", + "value": "MAIN", "name": "", "description": "" }, { - "value": "FAILURE", + "value": "TRADE", "name": "", "description": "" } ] - }, - "enable": true - }, - { - "id": "5Lwpfvg7zz", - "name": "startAt", - "required": false, - "description": "Start time (milisecond)", - "example": "1728663338000", - "type": "integer", - "schema": { - "type": "integer", - "format": "int64" - }, - "enable": true - }, - { - "id": "WvwRPqp0J5", - "name": "endAt", - "required": false, - "description": "End time (milisecond)", - "example": "1728692138000", - "type": "integer", - "schema": { - "type": "integer", - "format": "int64" - }, - "enable": true - }, - { - "id": "tYmztUdnR2", - "name": "currentPage", - "required": false, - "description": "Current request page.", - "example": "1", - "type": "integer", - "schema": { - "type": "integer", - "default": 1 - }, - "enable": true + } }, - { - "id": "StNqU7nXlg", - "name": "pageSize", - "required": false, - "description": "Number of results per request. Minimum is 10, maximum is 500.", - "example": "50", - "type": "integer", - "schema": { - "type": "integer", - "minimum": 10, - "maximum": 500, - "default": 50 - }, - "enable": true - } - ], + "required": [ + "amount", + "currency", + "recAccountType" + ] + }, + "example": "{\n \"currency\": \"USDT\",\n \"amount\": 0.01,\n \"recAccountType\": \"MAIN\"\n}", + "mediaType": "" + }, + "description": ":::tip[TIPS]\nIt is recommended to use the **GET /api/v3/accounts/universal-transfer** endpoint instead of this endpoint\n:::\n\n:::info[Description]\nThe amount to be transferred will be deducted from the KuCoin Futures Account. Please ensure that you have sufficient funds in your KuCoin Futures Account, or the transfer will fail.\n:::", + "customApiFields": "{\"abandon\":\"abandon\",\"domain\":\"Futures\",\"api-channel\":\"Private\",\"api-permission\":\"Futures\",\"api-rate-limit-pool\":\"Management\",\"sdk-service\":\"Account\",\"sdk-sub-service\":\"Transfer\",\"sdk-method-name\":\"futuresAccountTransferOut\",\"sdk-method-description\":\"The amount to be transferred will be deducted from the KuCoin Futures Account. Please ensure that you have sufficient funds in your KuCoin Futures Account, or the transfer will fail.\",\"api-rate-limit\":20}" + } + }, + { + "name": "Futures Account Transfer In", + "api": { + "id": "3470304", + "method": "post", + "path": "/api/v1/transfer-in", + "parameters": { + "query": [], "path": [], "cookie": [], "header": [] }, "responses": [ { - "id": "10472", + "id": "10468", "code": 200, "name": "OK", "headers": [], @@ -42123,90 +41243,7 @@ "type": "string" }, "data": { - "type": "object", - "properties": { - "currentPage": { - "type": "integer", - "description": "current page" - }, - "pageSize": { - "type": "integer", - "description": "page size" - }, - "totalNum": { - "type": "integer", - "description": "total number" - }, - "totalPage": { - "type": "integer", - "description": "total page" - }, - "items": { - "type": "array", - "items": { - "type": "object", - "properties": { - "currency": { - "type": "string", - "description": "Currency" - }, - "createAt": { - "type": "integer", - "description": "Creation time of the database record" - }, - "amount": { - "type": "string", - "description": "Withdrawal amount" - }, - "address": { - "type": "string", - "description": "Withdrawal address" - }, - "walletTxId": { - "type": "string", - "description": "Wallet Txid" - }, - "isInner": { - "type": "boolean", - "description": "Internal deposit or not" - }, - "status": { - "type": "string", - "description": "Status", - "enum": [ - "PROCESSING", - "SUCCESS", - "FAILURE" - ], - "x-api-enum": [ - { - "value": "PROCESSING", - "name": "", - "description": "" - }, - { - "value": "SUCCESS", - "name": "", - "description": "" - }, - { - "value": "FAILURE", - "name": "", - "description": "" - } - ] - } - } - } - } - }, - "required": [ - "currentPage", - "pageSize", - "totalNum", - "totalPage", - "items" - ] + "type": "string" } }, "required": [ @@ -42222,39 +41259,121 @@ "responseExamples": [ { "name": "Success", - "data": "{\n \"code\": \"200000\",\n \"data\": {\n \"currentPage\": 1,\n \"pageSize\": 50,\n \"totalNum\": 1,\n \"totalPage\": 1,\n \"items\": [\n {\n \"currency\": \"BTC\",\n \"createAt\": 1526723468,\n \"amount\": \"0.534\",\n \"address\": \"33xW37ZSW4tQvg443Pc7NLCAs167Yc2XUV\",\n \"walletTxId\": \"aeacea864c020acf58e51606169240e96774838dcd4f7ce48acf38e3651323f4\",\n \"isInner\": false,\n \"status\": \"SUCCESS\"\n }\n ]\n }\n}", - "responseId": 10472, + "data": "{\"code\":\"200000\",\"data\":null}", + "responseId": 10468, "ordering": 1 } ], "requestBody": { - "type": "none", + "type": "application/json", "parameters": [], "jsonSchema": { + "title": "", "type": "object", - "properties": {} + "properties": { + "currency": { + "type": "string", + "description": "Currency, including XBT,USDT...", + "examples": [ + "XBT", + "USDT", + "ETH" + ] + }, + "amount": { + "type": "number", + "description": "Amount to be transfered in" + }, + "payAccountType": { + "type": "string", + "description": "Payment account type, including MAIN,TRADE", + "enum": [ + "MAIN", + "TRADE" + ], + "x-api-enum": [ + { + "value": "MAIN", + "name": "", + "description": "" + }, + { + "value": "TRADE", + "name": "", + "description": "" + } + ] + } + }, + "required": [ + "amount", + "currency", + "payAccountType" + ] }, + "example": "{\n \"currency\": \"USDT\",\n \"amount\": 0.01,\n \"payAccountType\": \"MAIN\"\n}", "mediaType": "" }, - "description": ":::tip[TIPS]\nIt is recommended to use the **GET /api/v1/withdrawals** endpoint instead of this endpoint\n:::\n\n:::info[Description]\nRequest via this endpoint to get withdrawal list Items are paginated and sorted to show the latest first. See the Pagination section for retrieving additional entries after the first page.\n:::\n\n:::tip[TIPS]\nDefault query for one month of data.\n:::\n", - "customApiFields": "{\"abandon\":\"abandon\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"General\",\"api-rate-limit-pool\":\"Management\",\"sdk-service\":\"Account\",\"sdk-sub-service\":\"Withdrawal\",\"sdk-method-name\":\"getWithdrawalHistoryOld\",\"sdk-method-description\":\"Request via this endpoint to get deposit list Items are paginated and sorted to show the latest first. See the Pagination section for retrieving additional entries after the first page.\",\"api-rate-limit\":20}" + "description": ":::tip[TIPS]\nIt is recommended to use the **GET /api/v3/accounts/universal-transfer** endpoint instead of this endpoint\n:::\n\n:::info[Description]\nThe amount to be transferred will be deducted from the payAccount. Please ensure that you have sufficient funds in your payAccount Account, or the transfer will fail.\n:::", + "customApiFields": "{\"abandon\":\"abandon\",\"domain\":\"Futures\",\"api-channel\":\"Private\",\"api-permission\":\"Futures\",\"api-rate-limit-pool\":\"Management\",\"sdk-service\":\"Account\",\"sdk-sub-service\":\"Transfer\",\"sdk-method-name\":\"futuresAccountTransferIn\",\"sdk-method-description\":\"The amount to be transferred will be deducted from the payAccount. Please ensure that you have sufficient funds in your payAccount Account, or the transfer will fail.\",\"api-rate-limit\":20}" } }, { - "name": "Add Deposit Address - V1", + "name": "Get Deposit Addresses - V1", "api": { - "id": "3470309", - "method": "post", + "id": "3470305", + "method": "get", "path": "/api/v1/deposit-addresses", "parameters": { - "query": [], + "query": [ + { + "id": "iIrspuNh6x", + "name": "currency", + "required": true, + "description": "currency", + "example": "", + "type": "string", + "schema": { + "type": "string", + "examples": [ + "BTC", + "ETH", + "USDT" + ] + }, + "enable": true + }, + { + "id": "Z4ZrGIhlK3", + "name": "chain", + "required": false, + "description": "The chainId of currency, e.g. The available value for USDT are OMNI, ERC20, TRC20, default is ERC20. The available value for BTC are Native, Segwit, TRC20, the parameters are bech32, btc, trx, default is Native. This only apply for multi-chain currency, and there is no need for single chain currency.", + "type": "string", + "schema": { + "type": "string", + "default": "eth", + "examples": [ + "eth", + "bech32", + "btc", + "kcc", + "trx", + "bsc", + "arbitrum", + "ton", + "optimism" + ] + }, + "enable": true + } + ], "path": [], "cookie": [], "header": [] }, "responses": [ { - "id": "10473", + "id": "10469", "code": 200, "name": "OK", "headers": [], @@ -42292,6 +41411,7 @@ }, "chainId": { "type": "string", + "description": "The chainId of currency", "examples": [ "eth", "bech32", @@ -42302,146 +41422,42 @@ "arbitrum", "ton", "optimism" - ], - "description": "The chainId of currency" - }, - "to": { - "type": "string", - "description": "Deposit account type: main (funding account), trade (spot trading account)", - "enum": [ - "MAIN", - "TRADE" - ], - "x-api-enum": [ - { - "value": "MAIN", - "name": "", - "description": "" - }, - { - "value": "TRADE", - "name": "", - "description": "" - } ] }, - "currency": { - "type": "string", - "description": "currency", - "examples": [ - "BTC", - "ETH", - "USDT" - ] - } - }, - "required": [ - "address", - "memo", - "chain", - "to", - "currency", - "chainId" - ] - } - }, - "required": [ - "code", - "data" - ] - }, - "description": "", - "contentType": "json", - "mediaType": "" - } - ], - "responseExamples": [ - { - "name": "Success", - "data": "{\"code\":\"200000\",\"data\":{\"address\":\"0x02028456f38e78609904e8a002c787ede7a73d7c\",\"memo\":null,\"chain\":\"ERC20\",\"chainId\":\"eth\",\"to\":\"MAIN\",\"currency\":\"ETH\"}}", - "responseId": 10473, - "ordering": 1 - } - ], - "requestBody": { - "type": "application/json", - "parameters": [], - "jsonSchema": { - "title": "", - "type": "object", - "properties": { - "currency": { - "type": "string", - "description": "currency", - "examples": [ - "BTC", - "ETH", - "USDT" - ] - }, - "chain": { - "type": "string", - "description": "The chainId of currency, e.g. The available value for USDT are OMNI, ERC20, TRC20, default is ERC20. The available value for BTC are Native, Segwit, TRC20, the parameters are bech32, btc, trx, default is Native. This only apply for multi-chain currency, and there is no need for single chain currency.", - "default": "eth", - "examples": [ - "eth", - "bech32", - "btc", - "kcc", - "trx", - "bsc", - "arbitrum", - "ton", - "optimism" - ] - } - }, - "required": [ - "currency" - ] - }, - "example": "{\n \"currency\": \"ETH\",\n \"chain\": \"eth\"\n}", - "mediaType": "" - }, - "description": ":::tip[TIPS]\nIt is recommended to use the **POST /v3/deposit-address/create** endpoint instead of this endpoint\n:::\n\n:::info[Description]\nRequest via this endpoint to create a deposit address for a currency you intend to deposit.\n:::", - "customApiFields": "{\"abandon\":\"abandon\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"General\",\"api-rate-limit-pool\":\"Management\",\"sdk-service\":\"Account\",\"sdk-sub-service\":\"Deposit\",\"sdk-method-name\":\"addDepositAddressV1\",\"sdk-method-description\":\"Request via this endpoint to create a deposit address for a currency you intend to deposit.\",\"api-rate-limit\":20}" - } - }, - { - "name": "Withdraw - V1", - "api": { - "id": "3470310", - "method": "post", - "path": "/api/v1/withdrawals", - "parameters": { - "query": [], - "path": [], - "cookie": [], - "header": [] - }, - "responses": [ - { - "id": "10474", - "code": 200, - "name": "OK", - "headers": [], - "jsonSchema": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "data": { - "type": "object", - "properties": { - "withdrawalId": { + "to": { "type": "string", - "description": "Withdrawal id, a unique ID for a withdrawal" + "description": "Deposit account type: main (funding account), trade (spot trading account)", + "enum": [ + "MAIN", + "TRADE" + ], + "x-api-enum": [ + { + "value": "MAIN", + "name": "", + "description": "" + }, + { + "value": "TRADE", + "name": "", + "description": "" + } + ] + }, + "currency": { + "type": "string", + "description": "currency", + "examples": [ + "BTC", + "ETH", + "USDT" + ] + }, + "contractAddress": { + "type": "string", + "description": "The token contract address." } - }, - "required": [ - "withdrawalId" - ] + } } }, "required": [ @@ -42457,1172 +41473,1107 @@ "responseExamples": [ { "name": "Success", - "data": "{\"code\":\"200000\",\"data\":{\"withdrawalId\":\"670a973cf07b3800070e216c\"}}", - "responseId": 10474, + "data": "{\n \"code\": \"200000\",\n \"data\": {\n \"address\": \"0xea220bf61c3c2b0adc2cfa29fec3d2677745a379\",\n \"memo\": \"\",\n \"chain\": \"ERC20\",\n \"chainId\": \"eth\",\n \"to\": \"MAIN\",\n \"currency\": \"USDT\"\n }\n}", + "responseId": 10469, "ordering": 1 } ], "requestBody": { - "type": "application/json", + "type": "none", "parameters": [], "jsonSchema": { - "title": "", "type": "object", - "properties": { - "currency": { + "properties": {} + }, + "mediaType": "" + }, + "description": ":::tip[TIPS]\nIt is recommended to use the **GET /api/v3/deposit-addresses** endpoint instead of this endpoint\n:::\n\n:::info[Description]\nGet all deposit addresses for the currency you intend to deposit. If the returned data is empty, you may need to Add Deposit Address first.\n:::\n", + "customApiFields": "{\"abandon\":\"abandon\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"General\",\"api-rate-limit-pool\":\"Management\",\"sdk-service\":\"Account\",\"sdk-sub-service\":\"Deposit\",\"sdk-method-name\":\"getDepositAddressV1\",\"sdk-method-description\":\"Get all deposit addresses for the currency you intend to deposit. If the returned data is empty, you may need to Add Deposit Address first.\",\"api-rate-limit\":5}" + } + }, + { + "name": "Get Deposit History - Old", + "api": { + "id": "3470306", + "method": "get", + "path": "/api/v1/hist-deposits", + "parameters": { + "query": [ + { + "id": "iIrspuNh6x", + "name": "currency", + "required": true, + "description": "currency", + "example": "", + "type": "string", + "schema": { "type": "string", - "description": "currency", "examples": [ "BTC", "ETH", "USDT" ] }, - "chain": { + "enable": true + }, + { + "id": "0cGmW3GSC0", + "name": "status", + "required": false, + "description": "Status. Available value: PROCESSING, SUCCESS, and FAILURE", + "example": "SUCCESS", + "type": "string", + "schema": { "type": "string", - "description": "The chainId of currency, For a currency with multiple chains, it is recommended to specify chain parameter instead of using the default chain; you can query the chainId through the response of the GET /api/v3/currencies/{currency} interface.", - "default": "eth", - "examples": [ - "eth", - "bech32", - "btc", - "kcc", - "trx", - "bsc", - "arbitrum", - "ton", - "optimism" + "enum": [ + "PROCESSING", + "SUCCESS", + "FAILURE" + ], + "x-api-enum": [ + { + "value": "PROCESSING", + "name": "", + "description": "" + }, + { + "value": "SUCCESS", + "name": "", + "description": "" + }, + { + "value": "FAILURE", + "name": "", + "description": "" + } ] }, - "address": { - "type": "string", - "description": "Withdrawal address" - }, - "amount": { + "enable": true + }, + { + "id": "5Lwpfvg7zz", + "name": "startAt", + "required": false, + "description": "Start time (milisecond)", + "example": "1728663338000", + "type": "integer", + "schema": { "type": "integer", - "format": "int64", - "description": "Withdrawal amount, a positive number which is a multiple of the amount precision" - }, - "memo": { - "type": "string", - "description": "Address remark. If there’s no remark, it is empty. When you withdraw from other platforms to the KuCoin, you need to fill in memo(tag). If you do not fill memo (tag), your deposit may not be available, please be cautious." - }, - "isInner": { - "type": "boolean", - "description": "Internal withdrawal or not. Default : false", - "default": false - }, - "remark": { - "type": "string", - "description": "remark" + "format": "int64" }, - "feeDeductType": { - "type": "string", - "description": "Withdrawal fee deduction type: INTERNAL or EXTERNAL or not specified\n\n1. INTERNAL- deduct the transaction fees from your withdrawal amount\n2. EXTERNAL- deduct the transaction fees from your main account\n3. If you don't specify the feeDeductType parameter, when the balance in your main account is sufficient to support the withdrawal, the system will initially deduct the transaction fees from your main account. But if the balance in your main account is not sufficient to support the withdrawal, the system will deduct the fees from your withdrawal amount. For example: Suppose you are going to withdraw 1 BTC from the KuCoin platform (transaction fee: 0.0001BTC), if the balance in your main account is insufficient, the system will deduct the transaction fees from your withdrawal amount. In this case, you will be receiving 0.9999BTC." - } + "enable": true }, - "required": [ - "currency", - "address", - "amount" - ] - }, - "example": "{\n \"currency\": \"USDT\",\n \"address\": \"TKFRQXSDc****16GmLrjJggwX8\",\n \"amount\": 3,\n \"chain\": \"trx\",\n \"isInner\": true\n}", - "mediaType": "" + { + "id": "WvwRPqp0J5", + "name": "endAt", + "required": false, + "description": "End time (milisecond)", + "example": "1728692138000", + "type": "integer", + "schema": { + "type": "integer", + "format": "int64" + }, + "enable": true + } + ], + "path": [], + "cookie": [], + "header": [] }, - "description": ":::tip[TIPS]\nIt is recommended to use the **POST /api/v3/withdrawals** endpoint instead of this endpoint\n:::\n\n:::info[Description]\nUse this interface to withdraw the specified currency\n:::\n", - "customApiFields": "{\"abandon\":\"abandon\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"Withdrawal\",\"api-rate-limit-pool\":\"Management\",\"sdk-service\":\"Account\",\"sdk-sub-service\":\"Withdrawal\",\"sdk-method-name\":\"withdrawalV1\",\"sdk-method-description\":\"Use this interface to withdraw the specified currency\",\"api-rate-limit\":5}" - } - } - ] - }, - { - "name": "Spot Trading", - "id": 348173, - "description": "", - "items": [ - { - "name": "Orders", - "id": 348185, - "description": "", - "items": [ - { - "name": "Cancel Order By OrderId - Old", - "api": { - "id": "3470343", - "method": "delete", - "path": "/api/v1/orders/{orderId}", - "parameters": { - "query": [ - { - "id": "KXIxHhD4qw", - "name": "symbol", - "required": true, - "description": "symbol", - "example": "BTC-USDT", - "type": "string", - "schema": { - "type": "string", - "examples": [ - "BTC-USDT", - "ETH-USDT", - "KCS-USDT" - ] - }, - "enable": true - } - ], - "path": [ - { - "id": "orderId#0", - "name": "orderId", - "required": true, - "description": "The unique order id generated by the trading system", - "example": "674a97dfef434f0007efc431", - "type": "string", - "enable": true - } - ], - "cookie": [], - "header": [] - }, - "responses": [ - { - "id": "10604", - "code": 200, - "name": "OK", - "headers": [], - "jsonSchema": { + "responses": [ + { + "id": "10470", + "code": 200, + "name": "OK", + "headers": [], + "jsonSchema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { "type": "object", "properties": { - "code": { - "type": "string" + "currentPage": { + "type": "integer", + "description": "current page" }, - "data": { - "type": "object", - "properties": { - "cancelledOrderIds": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": [ - "cancelledOrderIds" - ] - } - }, - "required": [ - "code", - "data" - ] - }, - "description": "", - "contentType": "json", - "mediaType": "" - } - ], - "responseExamples": [ - { - "name": "Success", - "data": "{\r\n \"code\": \"200000\",\r\n \"data\": {\r\n \"cancelledOrderIds\": [\r\n \"674a97dfef434f0007efc431\"\r\n ]\r\n }\r\n}", - "responseId": 10604, - "ordering": 1 - } - ], - "requestBody": { - "type": "none", - "parameters": [], - "jsonSchema": { - "type": "object", - "properties": {} - }, - "example": "{\n \"symbol\": \"BTC-USDT\",\n \"orderId\": \"670fd33bf9406e0007ab3945\",\n \"newPrice\": \"30000\",\n \"newSize\": \"0.0001\"\n}", - "mediaType": "" - }, - "description": ":::tip[]\nIt is recommended to use the **DELETE /api/v1/hf/orders/{orderId}** endpoint instead of this endpoint\n:::\n\n:::info[Description]\nThis endpoint can be used to cancel a spot order by orderId.\nThis endpoint only sends cancellation requests. The results of the requests must be obtained by checking the order status or subscribing to websocket.\n:::", - "customApiFields": "{\"abandon\":\"abandon\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"Spot\",\"api-rate-limit-pool\":\"Spot\",\"sdk-service\":\"Spot\",\"sdk-sub-service\":\"Order\",\"sdk-method-name\":\"cancelOrderByOrderIdOld\",\"sdk-method-description\":\"This endpoint can be used to cancel a spot order by orderId. This endpoint only sends cancellation requests. The results of the requests must be obtained by checking the order status or subscribing to websocket.\",\"api-rate-limit\":3}" - } - }, - { - "name": "Get Orders List - Old", - "api": { - "id": "3470346", - "method": "get", - "path": "/api/v1/orders", - "parameters": { - "query": [ - { - "id": "M9bgPS6vOj", - "name": "symbol", - "required": false, - "description": "symbol", - "example": "BTC-USDT", - "type": "string", - "schema": { - "type": "string", - "examples": [ - "BTC-USDT", - "ETH-USDT", - "KCS-USDT" - ] - }, - "enable": true - }, - { - "required": false, - "description": "active or done(done as default), Only list orders with a specific status .", - "type": "string", - "id": "zsUnKYu93V", - "enable": true, - "name": "status", - "schema": { - "type": "string", - "enum": [ - "active", - "done" - ], - "default": "done", - "x-api-enum": [ - { - "value": "active", - "name": "active", - "description": "Active order" - }, - { - "value": "done", - "name": "done", - "description": "Done orders" - } - ] - } - }, - { - "required": false, - "description": "buy or sell", - "type": "string", - "id": "dZ29pTedUy", - "enable": true, - "name": "side", - "schema": { - "type": "string", - "enum": [ - "buy", - "sell" - ], - "x-api-enum": [ - { - "value": "buy", - "name": "buy", - "description": "buy" - }, - { - "value": "sell", - "name": "sell", - "description": "sell" - } - ] - } - }, - { - "required": false, - "description": "limit, market, limit_stop or market_stop", - "type": "string", - "id": "YtmMAG6Hsr", - "enable": true, - "name": "type", - "schema": { - "type": "string", - "enum": [ - "limit", - "market", - "limit_stop", - "market_stop" - ], - "x-api-enum": [ - { - "value": "limit", - "name": "limit", - "description": "limit" - }, - { - "value": "market", - "name": "market", - "description": "market" - }, - { - "value": "limit_stop", - "name": "limit_stop", - "description": "limit_stop" - }, - { - "value": "market_stop", - "name": "market_stop", - "description": "market_stop" - } - ] - } - }, - { - "required": false, - "description": "The type of trading:TRADE - Spot Trading(TRADE as default), MARGIN_TRADE - Cross Margin Trading, MARGIN_ISOLATED_TRADE - Isolated Margin Trading.", - "type": "string", - "id": "e2bW58TtXo", - "enable": true, - "name": "tradeType", - "schema": { - "type": "string", - "enum": [ - "TRADE", - "MARGIN_TRADE", - "MARGIN_ISOLATED_TRADE" - ], - "default": "TRADE", - "x-api-enum": [ - { - "value": "TRADE", - "name": "TRADE", - "description": "Spot Trading" - }, - { - "value": "MARGIN_TRADE", - "name": "MARGIN_TRADE", - "description": "Cross Margin Trading" - }, - { - "value": "MARGIN_ISOLATED_TRADE", - "name": "MARGIN_ISOLATED_TRADE", - "description": "Isolated Margin Trading" + "pageSize": { + "type": "integer", + "description": "page size" + }, + "totalNum": { + "type": "integer", + "description": "total number" + }, + "totalPage": { + "type": "integer", + "description": "total page" + }, + "items": { + "type": "array", + "items": { + "type": "object", + "properties": { + "currency": { + "type": "string", + "description": "Currency" + }, + "createAt": { + "type": "integer", + "description": "Creation time of the database record" + }, + "amount": { + "type": "string", + "description": "Deposit amount" + }, + "walletTxId": { + "type": "string", + "description": "Wallet Txid" + }, + "isInner": { + "type": "boolean", + "description": "Internal deposit or not" + }, + "status": { + "type": "string", + "enum": [ + "PROCESSING", + "SUCCESS", + "FAILURE" + ], + "x-api-enum": [ + { + "value": "PROCESSING", + "name": "", + "description": "" + }, + { + "value": "SUCCESS", + "name": "", + "description": "" + }, + { + "value": "FAILURE", + "name": "", + "description": "" + } + ] + } + } } - ] - } - }, - { - "required": false, - "description": "Start time (milisecond)", - "type": "integer", - "id": "85VEoHpEav", - "enable": true, - "name": "startAt", - "schema": { - "type": "integer", - "format": "int64" - } - }, - { - "required": false, - "description": "End time (milisecond)", - "type": "integer", - "id": "KCSk3kvfhI", - "enable": true, - "name": "endAt", - "schema": { - "type": "integer", - "format": "int64" - } - }, - { - "required": false, - "description": "Current request page.", - "type": "integer", - "id": "2mkDeImcUS", - "enable": true, - "name": "currentPage", - "schema": { - "type": "integer", - "default": 1 - } - }, - { - "required": false, - "description": "Number of results per request. Minimum is 10, maximum is 500.", - "type": "integer", - "id": "Ihi3ZFwAv0", - "enable": true, - "name": "pageSize", - "schema": { - "type": "integer", - "default": 50, - "minimum": 10, - "maximum": 500 + } + }, + "required": [ + "currentPage", + "pageSize", + "totalNum", + "totalPage", + "items" + ] + } + }, + "required": [ + "code", + "data" + ] + }, + "description": "", + "contentType": "json", + "mediaType": "" + } + ], + "responseExamples": [ + { + "name": "Success", + "data": "{\n \"code\": \"200000\",\n \"data\": {\n \"currentPage\": 1,\n \"pageSize\": 50,\n \"totalNum\": 0,\n \"totalPage\": 0,\n \"items\": [\n {\n \"currency\": \"BTC\",\n \"createAt\": 1528536998,\n \"amount\": \"0.03266638\",\n \"walletTxId\": \"55c643bc2c68d6f17266383ac1be9e454038864b929ae7cee0bc408cc5c869e8@12ffGWmMMD1zA1WbFm7Ho3JZ1w6NYXjpFk@234\",\n \"isInner\": false,\n \"status\": \"SUCCESS\"\n }\n ]\n }\n}", + "responseId": 10470, + "ordering": 1 + } + ], + "requestBody": { + "type": "none", + "parameters": [], + "jsonSchema": { + "type": "object", + "properties": {} + }, + "mediaType": "" + }, + "description": ":::tip[TIPS]\nIt is recommended to use the **GET /api/v1/deposits** endpoint instead of this endpoint\n:::\n\n:::info[Description]\nRequest via this endpoint to get the V1 historical deposits list on KuCoin. The return value is the data after Pagination, sorted in descending order according to time.\n:::\n\n:::tip[TIPS]\nDefault query for one month of data.\nThis request is paginated\n:::", + "customApiFields": "{\"abandon\":\"abandon\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"General\",\"api-rate-limit-pool\":\"Management\",\"sdk-service\":\"Account\",\"sdk-sub-service\":\"Deposit\",\"sdk-method-name\":\"getDepositHistoryOld\",\"sdk-method-description\":\"Request via this endpoint to get the V1 historical deposits list on KuCoin. The return value is the data after Pagination, sorted in descending order according to time.\",\"api-rate-limit\":5}" + } + }, + { + "name": "Get Futures Account Transfer Out Ledger", + "api": { + "id": "3470307", + "method": "get", + "path": "/api/v1/transfer-list", + "parameters": { + "query": [ + { + "id": "iIrspuNh6x", + "name": "currency", + "required": false, + "description": "currency", + "example": "", + "type": "string", + "schema": { + "type": "string", + "examples": [ + "XBT", + "USDT", + "ETH" + ] + }, + "enable": true + }, + { + "id": "Dn0j2ITQMe", + "name": "type", + "required": false, + "description": "Status PROCESSING, SUCCESS, FAILURE", + "type": "string", + "schema": { + "type": "string", + "enum": [ + "MAIN", + "TRADE", + "MARGIN", + "ISOLATED" + ], + "x-api-enum": [ + { + "value": "MAIN", + "name": "", + "description": "" + }, + { + "value": "TRADE", + "name": "", + "description": "" + }, + { + "value": "MARGIN", + "name": "", + "description": "" + }, + { + "value": "ISOLATED", + "name": "", + "description": "" } + ] + }, + "enable": true, + "example": "MAIN" + }, + { + "id": "pU2UVFoaY6", + "name": "tag", + "required": false, + "description": "Status List PROCESSING, SUCCESS, FAILURE", + "type": "array", + "schema": { + "type": "array", + "items": { + "type": "string" } - ], - "path": [], - "cookie": [], - "header": [] + }, + "enable": true }, - "responses": [ - { - "id": "10573", - "code": 200, - "name": "OK", - "headers": [], - "jsonSchema": { + { + "id": "JXDXFL0pit", + "name": "startAt", + "required": false, + "description": "Start time (milisecond)", + "example": "1728663338000", + "type": "integer", + "schema": { + "type": "integer", + "format": "int64" + }, + "enable": true + }, + { + "id": "h4o3HcI26F", + "name": "endAt", + "required": false, + "description": "End time (milisecond)", + "example": "1728692138000", + "type": "integer", + "schema": { + "type": "integer", + "format": "int64" + }, + "enable": true + }, + { + "id": "GXsjHTtpda", + "name": "currentPage", + "required": false, + "description": "Current request page, The default currentPage is 1", + "type": "integer", + "schema": { + "type": "integer", + "format": "int64", + "default": 1 + }, + "enable": true + }, + { + "id": "8oTh0NFp8G", + "name": "pageSize", + "required": false, + "description": "pageSize, The default pageSize is 50", + "type": "integer", + "schema": { + "type": "integer", + "format": "int64", + "default": 50 + }, + "enable": true + } + ], + "path": [], + "cookie": [], + "header": [] + }, + "responses": [ + { + "id": "10471", + "code": 200, + "name": "OK", + "headers": [], + "jsonSchema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { "type": "object", "properties": { - "code": { - "type": "string" + "currentPage": { + "type": "integer", + "description": "current page" }, - "data": { - "type": "object", - "properties": { - "currentPage": { - "type": "integer" - }, - "pageSize": { - "type": "integer" - }, - "totalNum": { - "type": "integer" - }, - "totalPage": { - "type": "integer" - }, - "items": { - "type": "array", - "items": { - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "symbol": { - "type": "string" - }, - "opType": { - "type": "string" - }, - "type": { - "type": "string" - }, - "side": { - "type": "string" - }, - "price": { - "type": "string" - }, - "size": { - "type": "string" - }, - "funds": { - "type": "string" - }, - "dealFunds": { - "type": "string" - }, - "dealSize": { - "type": "string" - }, - "fee": { - "type": "string" - }, - "feeCurrency": { - "type": "string" - }, - "stp": { - "type": "string" - }, - "stop": { - "type": "string" - }, - "stopTriggered": { - "type": "boolean" - }, - "stopPrice": { - "type": "string" - }, - "timeInForce": { - "type": "string" - }, - "postOnly": { - "type": "boolean" - }, - "hidden": { - "type": "boolean" - }, - "iceberg": { - "type": "boolean" - }, - "visibleSize": { - "type": "string" - }, - "cancelAfter": { - "type": "integer" - }, - "channel": { - "type": "string" - }, - "clientOid": { - "type": "string" - }, - "remark": { - "type": "string" - }, - "tags": { - "type": "string" - }, - "isActive": { - "type": "boolean" - }, - "cancelExist": { - "type": "boolean" + "pageSize": { + "type": "integer", + "description": "page size" + }, + "totalNum": { + "type": "integer", + "description": "total number" + }, + "totalPage": { + "type": "integer", + "description": "total page" + }, + "items": { + "type": "array", + "items": { + "type": "object", + "properties": { + "applyId": { + "type": "string", + "description": "Transfer order ID" + }, + "currency": { + "type": "string", + "description": "Currency" + }, + "recRemark": { + "type": "string", + "description": "Receive account tx remark" + }, + "recSystem": { + "type": "string", + "description": "Receive system" + }, + "status": { + "type": "string", + "description": "Status PROCESSING, SUCCESS, FAILURE", + "enum": [ + "PROCESSING", + "SUCCESS", + "FAILURE" + ], + "x-api-enum": [ + { + "value": "PROCESSING", + "name": "", + "description": "" }, - "createdAt": { - "type": "integer", - "format": "int64" + { + "value": "SUCCESS", + "name": "", + "description": "" }, - "tradeType": { - "type": "string" + { + "value": "FAILURE", + "name": "", + "description": "" } - }, - "required": [ - "id", - "symbol", - "opType", - "type", - "side", - "price", - "size", - "funds", - "dealFunds", - "dealSize", - "fee", - "feeCurrency", - "stp", - "stop", - "stopTriggered", - "stopPrice", - "timeInForce", - "postOnly", - "hidden", - "iceberg", - "visibleSize", - "cancelAfter", - "channel", - "clientOid", - "remark", - "tags", - "isActive", - "cancelExist", - "createdAt", - "tradeType" ] + }, + "amount": { + "type": "string", + "description": "Transaction amount" + }, + "reason": { + "type": "string", + "description": "Reason caused the failure" + }, + "offset": { + "type": "integer", + "description": "Offset", + "format": "int64" + }, + "createdAt": { + "type": "integer", + "description": "Request application time", + "format": "int64" + }, + "remark": { + "type": "string", + "description": "User remark" } } - }, - "required": [ - "currentPage", - "pageSize", - "totalNum", - "totalPage", - "items" - ] + } } }, "required": [ - "code", - "data" - ] - }, - "description": "", - "contentType": "json", - "mediaType": "" - } - ], - "responseExamples": [ - { - "name": "Success", - "data": "{\r\n \"code\": \"200000\",\r\n \"data\": {\r\n \"currentPage\": 1,\r\n \"pageSize\": 50,\r\n \"totalNum\": 1,\r\n \"totalPage\": 1,\r\n \"items\": [\r\n {\r\n \"id\": \"674a9a872033a50007e2790d\",\r\n \"symbol\": \"BTC-USDT\",\r\n \"opType\": \"DEAL\",\r\n \"type\": \"limit\",\r\n \"side\": \"buy\",\r\n \"price\": \"50000\",\r\n \"size\": \"0.00001\",\r\n \"funds\": \"0\",\r\n \"dealFunds\": \"0\",\r\n \"dealSize\": \"0\",\r\n \"fee\": \"0\",\r\n \"feeCurrency\": \"USDT\",\r\n \"stp\": \"\",\r\n \"stop\": \"\",\r\n \"stopTriggered\": false,\r\n \"stopPrice\": \"0\",\r\n \"timeInForce\": \"GTC\",\r\n \"postOnly\": false,\r\n \"hidden\": false,\r\n \"iceberg\": false,\r\n \"visibleSize\": \"0\",\r\n \"cancelAfter\": 0,\r\n \"channel\": \"API\",\r\n \"clientOid\": \"5c52e11203aa677f33e4923fb\",\r\n \"remark\": \"order remarks\",\r\n \"tags\": null,\r\n \"isActive\": false,\r\n \"cancelExist\": true,\r\n \"createdAt\": 1732942471752,\r\n \"tradeType\": \"TRADE\"\r\n }\r\n ]\r\n }\r\n}", - "responseId": 10573, - "ordering": 1 - } - ], - "requestBody": { - "type": "none", - "parameters": [], - "jsonSchema": { - "type": "object", - "properties": {} + "currentPage", + "pageSize", + "totalNum", + "totalPage", + "items" + ] + } }, - "example": "{\n \"symbol\": \"BTC-USDT\",\n \"orderId\": \"670fd33bf9406e0007ab3945\",\n \"newPrice\": \"30000\",\n \"newSize\": \"0.0001\"\n}", - "mediaType": "" + "required": [ + "code", + "data" + ] }, - "description": ":::tip[]\nIt is recommended to use the **GET /api/v1/hf/orders/active** endpoint instead of this endpoint\n:::\n\n:::info[Description]\nRequest via this endpoint to get your current order list. The return value is the data after Pagination, sorted in descending order according to time.\n:::\n\n:::tip[Tips]\nWhen you query orders in active status, there is no time limit. However, when you query orders in done status, the start and end time range cannot exceed 7* 24 hours. An error will occur if the specified time window exceeds the range. If you specify the end time only, the system will automatically calculate the start time as end time minus 7*24 hours, and vice versa.\n\nThe history for cancelled orders is only kept for one month. The history for Filled orders is only kept for six month.\n:::", - "customApiFields": "{\"abandon\":\"abandon\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"General\",\"api-rate-limit-pool\":\"Spot\",\"sdk-service\":\"Spot\",\"sdk-sub-service\":\"Order\",\"sdk-method-name\":\"getOrdersListOld\",\"sdk-method-description\":\"Request via this endpoint to get your current order list. The return value is the data after Pagination, sorted in descending order according to time.\",\"api-rate-limit\":2}" + "description": "", + "contentType": "json", + "mediaType": "" + } + ], + "responseExamples": [ + { + "name": "Success", + "data": "{\"code\":\"200000\",\"data\":{\"currentPage\":1,\"pageSize\":50,\"totalNum\":1,\"totalPage\":1,\"items\":[{\"applyId\":\"670bf84c577f6c00017a1c48\",\"currency\":\"USDT\",\"recRemark\":\"\",\"recSystem\":\"KUCOIN\",\"status\":\"SUCCESS\",\"amount\":\"0.01\",\"reason\":\"\",\"offset\":1519769124134806,\"createdAt\":1728837708000,\"remark\":\"\"}]}}", + "responseId": 10471, + "ordering": 1 } + ], + "requestBody": { + "type": "none", + "parameters": [], + "jsonSchema": { + "type": "object", + "properties": {} + }, + "mediaType": "" }, - { - "name": "Get Recent Orders List - Old", - "api": { - "id": "3470347", - "method": "get", - "path": "/api/v1/limit/orders", - "parameters": { - "query": [ - { - "required": false, - "description": "Current request page.", - "type": "integer", - "id": "2mkDeImcUS", - "enable": true, - "name": "currentPage", - "schema": { - "type": "integer", - "default": 1 - } - }, - { - "required": false, - "description": "Number of results per request. Minimum is 10, maximum is 500.", - "type": "integer", - "id": "Ihi3ZFwAv0", - "enable": true, - "name": "pageSize", - "schema": { - "type": "integer", - "default": 50, - "minimum": 10, - "maximum": 500 + "description": ":::info[Description]\nThis endpoint can get futures account transfer out ledger\n:::", + "customApiFields": "{\"abandon\":\"abandon\",\"domain\":\"Futures\",\"api-channel\":\"Private\",\"api-permission\":\"General\",\"api-rate-limit-pool\":\"Management\",\"sdk-service\":\"Account\",\"sdk-sub-service\":\"Transfer\",\"sdk-method-name\":\"getFuturesAccountTransferOutLedger\",\"sdk-method-description\":\"This endpoint can get futures account transfer out ledger\",\"api-rate-limit\":20}" + } + }, + { + "name": "Get Withdrawal History - Old", + "api": { + "id": "3470308", + "method": "get", + "path": "/api/v1/hist-withdrawals", + "parameters": { + "query": [ + { + "id": "iIrspuNh6x", + "name": "currency", + "required": true, + "description": "currency", + "example": "", + "type": "string", + "schema": { + "type": "string", + "examples": [ + "BTC", + "ETH", + "USDT" + ] + }, + "enable": true + }, + { + "id": "0cGmW3GSC0", + "name": "status", + "required": false, + "description": "Status. Available value: PROCESSING, SUCCESS, and FAILURE", + "example": "SUCCESS", + "type": "string", + "schema": { + "type": "string", + "enum": [ + "PROCESSING", + "SUCCESS", + "FAILURE" + ], + "x-api-enum": [ + { + "value": "PROCESSING", + "name": "", + "description": "" + }, + { + "value": "SUCCESS", + "name": "", + "description": "" + }, + { + "value": "FAILURE", + "name": "", + "description": "" } - } - ], - "path": [], - "cookie": [], - "header": [] + ] + }, + "enable": true }, - "responses": [ - { - "id": "10574", - "code": 200, - "name": "OK", - "headers": [], - "jsonSchema": { + { + "id": "5Lwpfvg7zz", + "name": "startAt", + "required": false, + "description": "Start time (milisecond)", + "example": "1728663338000", + "type": "integer", + "schema": { + "type": "integer", + "format": "int64" + }, + "enable": true + }, + { + "id": "WvwRPqp0J5", + "name": "endAt", + "required": false, + "description": "End time (milisecond)", + "example": "1728692138000", + "type": "integer", + "schema": { + "type": "integer", + "format": "int64" + }, + "enable": true + }, + { + "id": "tYmztUdnR2", + "name": "currentPage", + "required": false, + "description": "Current request page.", + "example": "1", + "type": "integer", + "schema": { + "type": "integer", + "default": 1 + }, + "enable": true + }, + { + "id": "StNqU7nXlg", + "name": "pageSize", + "required": false, + "description": "Number of results per request. Minimum is 10, maximum is 500.", + "example": "50", + "type": "integer", + "schema": { + "type": "integer", + "minimum": 10, + "maximum": 500, + "default": 50 + }, + "enable": true + } + ], + "path": [], + "cookie": [], + "header": [] + }, + "responses": [ + { + "id": "10472", + "code": 200, + "name": "OK", + "headers": [], + "jsonSchema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { "type": "object", "properties": { - "code": { - "type": "string" + "currentPage": { + "type": "integer", + "description": "current page" }, - "data": { + "pageSize": { + "type": "integer", + "description": "page size" + }, + "totalNum": { + "type": "integer", + "description": "total number" + }, + "totalPage": { + "type": "integer", + "description": "total page" + }, + "items": { "type": "array", "items": { "type": "object", "properties": { - "id": { - "type": "string" - }, - "symbol": { - "type": "string" - }, - "opType": { - "type": "string" - }, - "type": { - "type": "string" - }, - "side": { - "type": "string" - }, - "price": { - "type": "string" - }, - "size": { - "type": "string" - }, - "funds": { - "type": "string" - }, - "dealFunds": { - "type": "string" - }, - "dealSize": { - "type": "string" - }, - "fee": { - "type": "string" - }, - "feeCurrency": { - "type": "string" - }, - "stp": { - "type": "string" - }, - "stop": { - "type": "string" - }, - "stopTriggered": { - "type": "boolean" - }, - "stopPrice": { - "type": "string" - }, - "timeInForce": { - "type": "string" - }, - "postOnly": { - "type": "boolean" - }, - "hidden": { - "type": "boolean" - }, - "iceberg": { - "type": "boolean" - }, - "visibleSize": { - "type": "string" - }, - "cancelAfter": { - "type": "integer" - }, - "channel": { - "type": "string" - }, - "clientOid": { - "type": "string" + "currency": { + "type": "string", + "description": "Currency" }, - "remark": { - "type": "string" + "createAt": { + "type": "integer", + "description": "Creation time of the database record" }, - "tags": { - "type": "string" + "amount": { + "type": "string", + "description": "Withdrawal amount" }, - "isActive": { - "type": "boolean" + "address": { + "type": "string", + "description": "Withdrawal address" }, - "cancelExist": { - "type": "boolean" + "walletTxId": { + "type": "string", + "description": "Wallet Txid" }, - "createdAt": { - "type": "integer", - "format": "int64" + "isInner": { + "type": "boolean", + "description": "Internal deposit or not" }, - "tradeType": { - "type": "string" + "status": { + "type": "string", + "description": "Status", + "enum": [ + "PROCESSING", + "SUCCESS", + "FAILURE" + ], + "x-api-enum": [ + { + "value": "PROCESSING", + "name": "", + "description": "" + }, + { + "value": "SUCCESS", + "name": "", + "description": "" + }, + { + "value": "FAILURE", + "name": "", + "description": "" + } + ] } - }, - "required": [ - "id", - "symbol", - "opType", - "type", - "side", - "price", - "size", - "funds", - "dealFunds", - "dealSize", - "fee", - "feeCurrency", - "stp", - "stop", - "stopTriggered", - "stopPrice", - "timeInForce", - "postOnly", - "hidden", - "iceberg", - "visibleSize", - "cancelAfter", - "channel", - "clientOid", - "remark", - "tags", - "isActive", - "cancelExist", - "createdAt", - "tradeType" - ] + } } } }, "required": [ - "code", - "data" + "currentPage", + "pageSize", + "totalNum", + "totalPage", + "items" + ] + } + }, + "required": [ + "code", + "data" + ] + }, + "description": "", + "contentType": "json", + "mediaType": "" + } + ], + "responseExamples": [ + { + "name": "Success", + "data": "{\n \"code\": \"200000\",\n \"data\": {\n \"currentPage\": 1,\n \"pageSize\": 50,\n \"totalNum\": 1,\n \"totalPage\": 1,\n \"items\": [\n {\n \"currency\": \"BTC\",\n \"createAt\": 1526723468,\n \"amount\": \"0.534\",\n \"address\": \"33xW37ZSW4tQvg443Pc7NLCAs167Yc2XUV\",\n \"walletTxId\": \"aeacea864c020acf58e51606169240e96774838dcd4f7ce48acf38e3651323f4\",\n \"isInner\": false,\n \"status\": \"SUCCESS\"\n }\n ]\n }\n}", + "responseId": 10472, + "ordering": 1 + } + ], + "requestBody": { + "type": "none", + "parameters": [], + "jsonSchema": { + "type": "object", + "properties": {} + }, + "mediaType": "" + }, + "description": ":::tip[TIPS]\nIt is recommended to use the **GET /api/v1/withdrawals** endpoint instead of this endpoint\n:::\n\n:::info[Description]\nRequest via this endpoint to get withdrawal list Items are paginated and sorted to show the latest first. See the Pagination section for retrieving additional entries after the first page.\n:::\n\n:::tip[TIPS]\nDefault query for one month of data.\n:::\n", + "customApiFields": "{\"abandon\":\"abandon\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"General\",\"api-rate-limit-pool\":\"Management\",\"sdk-service\":\"Account\",\"sdk-sub-service\":\"Withdrawal\",\"sdk-method-name\":\"getWithdrawalHistoryOld\",\"sdk-method-description\":\"Request via this endpoint to get deposit list Items are paginated and sorted to show the latest first. See the Pagination section for retrieving additional entries after the first page.\",\"api-rate-limit\":20}" + } + }, + { + "name": "Add Deposit Address - V1", + "api": { + "id": "3470309", + "method": "post", + "path": "/api/v1/deposit-addresses", + "parameters": { + "query": [], + "path": [], + "cookie": [], + "header": [] + }, + "responses": [ + { + "id": "10473", + "code": 200, + "name": "OK", + "headers": [], + "jsonSchema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "object", + "properties": { + "address": { + "type": "string", + "description": "Deposit address" + }, + "memo": { + "type": "string", + "description": "Address remark. If there’s no remark, it is empty. When you withdraw from other platforms to the KuCoin, you need to fill in memo(tag). If you do not fill memo (tag), your deposit may not be available, please be cautious." + }, + "chain": { + "type": "string", + "description": "The chainName of currency", + "examples": [ + "ERC20", + "BTC-Segwit", + "BTC", + "KCC", + "TRC20", + "BEP20", + "ARBITRUM", + "TON", + "OPTIMISM" + ] + }, + "chainId": { + "type": "string", + "examples": [ + "eth", + "bech32", + "btc", + "kcc", + "trx", + "bsc", + "arbitrum", + "ton", + "optimism" + ], + "description": "The chainId of currency" + }, + "to": { + "type": "string", + "description": "Deposit account type: main (funding account), trade (spot trading account)", + "enum": [ + "MAIN", + "TRADE" + ], + "x-api-enum": [ + { + "value": "MAIN", + "name": "", + "description": "" + }, + { + "value": "TRADE", + "name": "", + "description": "" + } + ] + }, + "currency": { + "type": "string", + "description": "currency", + "examples": [ + "BTC", + "ETH", + "USDT" + ] + } + }, + "required": [ + "address", + "memo", + "chain", + "to", + "currency", + "chainId" ] - }, - "description": "", - "contentType": "json", - "mediaType": "" - } - ], - "responseExamples": [ - { - "name": "Success", - "data": "{\r\n \"code\": \"200000\",\r\n \"data\": [\r\n {\r\n \"id\": \"674a9a872033a50007e2790d\",\r\n \"symbol\": \"BTC-USDT\",\r\n \"opType\": \"DEAL\",\r\n \"type\": \"limit\",\r\n \"side\": \"buy\",\r\n \"price\": \"50000\",\r\n \"size\": \"0.00001\",\r\n \"funds\": \"0\",\r\n \"dealFunds\": \"0\",\r\n \"dealSize\": \"0\",\r\n \"fee\": \"0\",\r\n \"feeCurrency\": \"USDT\",\r\n \"stp\": \"\",\r\n \"stop\": \"\",\r\n \"stopTriggered\": false,\r\n \"stopPrice\": \"0\",\r\n \"timeInForce\": \"GTC\",\r\n \"postOnly\": false,\r\n \"hidden\": false,\r\n \"iceberg\": false,\r\n \"visibleSize\": \"0\",\r\n \"cancelAfter\": 0,\r\n \"channel\": \"API\",\r\n \"clientOid\": \"5c52e11203aa677f33e4923fb\",\r\n \"remark\": \"order remarks\",\r\n \"tags\": null,\r\n \"isActive\": false,\r\n \"cancelExist\": true,\r\n \"createdAt\": 1732942471752,\r\n \"tradeType\": \"TRADE\"\r\n }\r\n ]\r\n}", - "responseId": 10574, - "ordering": 1 - } - ], - "requestBody": { - "type": "none", - "parameters": [], - "jsonSchema": { - "type": "object", - "properties": {} + } }, - "example": "{\n \"symbol\": \"BTC-USDT\",\n \"orderId\": \"670fd33bf9406e0007ab3945\",\n \"newPrice\": \"30000\",\n \"newSize\": \"0.0001\"\n}", - "mediaType": "" + "required": [ + "code", + "data" + ] }, - "description": ":::tip[]\nIt is recommended to use the **GET /api/v1/hf/orders/active** endpoint instead of this endpoint\n:::\n\n:::info[Description]\nRequest via this endpoint to get 1000 orders in the last 24 hours. The return value is the data after Pagination, sorted in descending order according to time.\n:::", - "customApiFields": "{\"abandon\":\"abandon\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"General\",\"api-rate-limit-pool\":\"Spot\",\"sdk-service\":\"Spot\",\"sdk-sub-service\":\"Order\",\"sdk-method-name\":\"getRecentOrdersListOld\",\"sdk-method-description\":\"Request via this endpoint to get your current order list. The return value is the data after Pagination, sorted in descending order according to time.\",\"api-rate-limit\":3}" + "description": "", + "contentType": "json", + "mediaType": "" } - }, - { - "name": "Get Order By OrderId - Old", - "api": { - "id": "3470348", - "method": "get", - "path": "/api/v1/orders/{orderId}", - "parameters": { - "query": [], - "path": [ - { - "id": "orderId#0", - "name": "orderId", - "required": true, - "description": "The unique order id generated by the trading system", - "type": "string", - "enable": true, - "example": "674a97dfef434f0007efc431" - } - ], - "cookie": [], - "header": [] + ], + "responseExamples": [ + { + "name": "Success", + "data": "{\"code\":\"200000\",\"data\":{\"address\":\"0x02028456f38e78609904e8a002c787ede7a73d7c\",\"memo\":null,\"chain\":\"ERC20\",\"chainId\":\"eth\",\"to\":\"MAIN\",\"currency\":\"ETH\"}}", + "responseId": 10473, + "ordering": 1 + } + ], + "requestBody": { + "type": "application/json", + "parameters": [], + "jsonSchema": { + "title": "", + "type": "object", + "properties": { + "currency": { + "type": "string", + "description": "currency", + "examples": [ + "BTC", + "ETH", + "USDT" + ] + }, + "chain": { + "type": "string", + "description": "The chainId of currency, e.g. The available value for USDT are OMNI, ERC20, TRC20, default is ERC20. The available value for BTC are Native, Segwit, TRC20, the parameters are bech32, btc, trx, default is Native. This only apply for multi-chain currency, and there is no need for single chain currency.", + "default": "eth", + "examples": [ + "eth", + "bech32", + "btc", + "kcc", + "trx", + "bsc", + "arbitrum", + "ton", + "optimism" + ] + } }, - "responses": [ - { - "id": "10605", - "code": 200, - "name": "OK", - "headers": [], - "jsonSchema": { + "required": [ + "currency" + ] + }, + "example": "{\n \"currency\": \"ETH\",\n \"chain\": \"eth\"\n}", + "mediaType": "" + }, + "description": ":::tip[TIPS]\nIt is recommended to use the **POST /v3/deposit-address/create** endpoint instead of this endpoint\n:::\n\n:::info[Description]\nRequest via this endpoint to create a deposit address for a currency you intend to deposit.\n:::", + "customApiFields": "{\"abandon\":\"abandon\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"General\",\"api-rate-limit-pool\":\"Management\",\"sdk-service\":\"Account\",\"sdk-sub-service\":\"Deposit\",\"sdk-method-name\":\"addDepositAddressV1\",\"sdk-method-description\":\"Request via this endpoint to create a deposit address for a currency you intend to deposit.\",\"api-rate-limit\":20}" + } + }, + { + "name": "Withdraw - V1", + "api": { + "id": "3470310", + "method": "post", + "path": "/api/v1/withdrawals", + "parameters": { + "query": [], + "path": [], + "cookie": [], + "header": [] + }, + "responses": [ + { + "id": "10474", + "code": 200, + "name": "OK", + "headers": [], + "jsonSchema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { "type": "object", "properties": { - "code": { - "type": "string" - }, - "data": { - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "symbol": { - "type": "string" - }, - "opType": { - "type": "string" - }, - "type": { - "type": "string" - }, - "side": { - "type": "string" - }, - "price": { - "type": "string" - }, - "size": { - "type": "string" - }, - "funds": { - "type": "string" - }, - "dealFunds": { - "type": "string" - }, - "dealSize": { - "type": "string" - }, - "fee": { - "type": "string" - }, - "feeCurrency": { - "type": "string" - }, - "stp": { - "type": "string" - }, - "stop": { - "type": "string" - }, - "stopTriggered": { - "type": "boolean" - }, - "stopPrice": { - "type": "string" - }, - "timeInForce": { - "type": "string" - }, - "postOnly": { - "type": "boolean" - }, - "hidden": { - "type": "boolean" - }, - "iceberg": { - "type": "boolean" - }, - "visibleSize": { - "type": "string" - }, - "cancelAfter": { - "type": "integer" - }, - "channel": { - "type": "string" - }, - "clientOid": { - "type": "string" - }, - "remark": { - "type": "string" - }, - "tags": { - "type": "string" - }, - "isActive": { - "type": "boolean" - }, - "cancelExist": { - "type": "boolean" - }, - "createdAt": { - "type": "integer", - "format": "int64" - }, - "tradeType": { - "type": "string" - } - }, - "required": [ - "id", - "symbol", - "opType", - "type", - "side", - "price", - "size", - "funds", - "dealFunds", - "dealSize", - "fee", - "feeCurrency", - "stp", - "stop", - "stopTriggered", - "stopPrice", - "timeInForce", - "postOnly", - "hidden", - "iceberg", - "visibleSize", - "cancelAfter", - "channel", - "clientOid", - "remark", - "tags", - "isActive", - "cancelExist", - "createdAt", - "tradeType" - ] + "withdrawalId": { + "type": "string", + "description": "Withdrawal id, a unique ID for a withdrawal" } }, "required": [ - "code", - "data" + "withdrawalId" ] - }, - "description": "", - "contentType": "json", - "mediaType": "" - } - ], - "responseExamples": [ - { - "name": "Success", - "data": "{\r\n \"code\": \"200000\",\r\n \"data\": {\r\n \"id\": \"674a97dfef434f0007efc431\",\r\n \"symbol\": \"BTC-USDT\",\r\n \"opType\": \"DEAL\",\r\n \"type\": \"limit\",\r\n \"side\": \"buy\",\r\n \"price\": \"50000\",\r\n \"size\": \"0.0001\",\r\n \"funds\": \"0\",\r\n \"dealFunds\": \"0\",\r\n \"dealSize\": \"0\",\r\n \"fee\": \"0\",\r\n \"feeCurrency\": \"USDT\",\r\n \"stp\": \"\",\r\n \"stop\": \"\",\r\n \"stopTriggered\": false,\r\n \"stopPrice\": \"0\",\r\n \"timeInForce\": \"GTC\",\r\n \"postOnly\": false,\r\n \"hidden\": false,\r\n \"iceberg\": false,\r\n \"visibleSize\": \"0\",\r\n \"cancelAfter\": 0,\r\n \"channel\": \"API\",\r\n \"clientOid\": \"3d07008668054da6b3cb12e432c2b13a\",\r\n \"remark\": null,\r\n \"tags\": null,\r\n \"isActive\": false,\r\n \"cancelExist\": true,\r\n \"createdAt\": 1732941791518,\r\n \"tradeType\": \"TRADE\"\r\n }\r\n}", - "responseId": 10605, - "ordering": 1 - } - ], - "requestBody": { - "type": "none", - "parameters": [], - "jsonSchema": { - "type": "object", - "properties": {} + } }, - "example": "{\n \"symbol\": \"BTC-USDT\",\n \"orderId\": \"670fd33bf9406e0007ab3945\",\n \"newPrice\": \"30000\",\n \"newSize\": \"0.0001\"\n}", - "mediaType": "" + "required": [ + "code", + "data" + ] }, - "description": ":::tip[]\nIt is recommended to use the **GET /api/v1/hf/orders/{orderId}** endpoint instead of this endpoint\n:::\n\n:::info[Description]\nRequest via this endpoint to get a single order info by order ID.\n:::", - "customApiFields": "{\"abandon\":\"abandon\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"General\",\"api-rate-limit-pool\":\"Spot\",\"sdk-service\":\"Spot\",\"sdk-sub-service\":\"Order\",\"sdk-method-name\":\"getOrderByOrderIdOld\",\"sdk-method-description\":\"Request via this endpoint to get a single order info by order ID.\",\"api-rate-limit\":2}" + "description": "", + "contentType": "json", + "mediaType": "" } - }, - { - "name": "Get Order By ClientOid - Old", - "api": { - "id": "3470349", - "method": "get", - "path": "/api/v1/order/client-order/{clientOid}", - "parameters": { - "query": [], - "path": [ - { - "id": "clientOid#0", - "name": "clientOid", - "required": true, - "description": "Unique order id created by users to identify their orders", - "type": "string", - "enable": true, - "example": "3d07008668054da6b3cb12e432c2b13a" - } - ], - "cookie": [], - "header": [] - }, - "responses": [ - { - "id": "10575", - "code": 200, - "name": "OK", - "headers": [], - "jsonSchema": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "data": { - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "symbol": { - "type": "string" - }, - "opType": { - "type": "string" - }, - "type": { - "type": "string" - }, - "side": { - "type": "string" - }, - "price": { - "type": "string" - }, - "size": { - "type": "string" - }, - "funds": { - "type": "string" - }, - "dealFunds": { - "type": "string" - }, - "dealSize": { - "type": "string" - }, - "fee": { - "type": "string" - }, - "feeCurrency": { - "type": "string" - }, - "stp": { - "type": "string" - }, - "stop": { - "type": "string" - }, - "stopTriggered": { - "type": "boolean" - }, - "stopPrice": { - "type": "string" - }, - "timeInForce": { - "type": "string" - }, - "postOnly": { - "type": "boolean" - }, - "hidden": { - "type": "boolean" - }, - "iceberg": { - "type": "boolean" - }, - "visibleSize": { - "type": "string" - }, - "cancelAfter": { - "type": "integer" - }, - "channel": { - "type": "string" - }, - "clientOid": { - "type": "string" - }, - "remark": { - "type": "string" - }, - "tags": { - "type": "string" - }, - "isActive": { - "type": "boolean" - }, - "cancelExist": { - "type": "boolean" - }, - "createdAt": { - "type": "integer", - "format": "int64" - }, - "tradeType": { - "type": "string" + ], + "responseExamples": [ + { + "name": "Success", + "data": "{\"code\":\"200000\",\"data\":{\"withdrawalId\":\"670a973cf07b3800070e216c\"}}", + "responseId": 10474, + "ordering": 1 + } + ], + "requestBody": { + "type": "application/json", + "parameters": [], + "jsonSchema": { + "title": "", + "type": "object", + "properties": { + "currency": { + "type": "string", + "description": "currency", + "examples": [ + "BTC", + "ETH", + "USDT" + ] + }, + "chain": { + "type": "string", + "description": "The chainId of currency, For a currency with multiple chains, it is recommended to specify chain parameter instead of using the default chain; you can query the chainId through the response of the GET /api/v3/currencies/{currency} interface.", + "default": "eth", + "examples": [ + "eth", + "bech32", + "btc", + "kcc", + "trx", + "bsc", + "arbitrum", + "ton", + "optimism" + ] + }, + "address": { + "type": "string", + "description": "Withdrawal address" + }, + "amount": { + "type": "integer", + "format": "int64", + "description": "Withdrawal amount, a positive number which is a multiple of the amount precision" + }, + "memo": { + "type": "string", + "description": "Address remark. If there’s no remark, it is empty. When you withdraw from other platforms to the KuCoin, you need to fill in memo(tag). If you do not fill memo (tag), your deposit may not be available, please be cautious." + }, + "isInner": { + "type": "boolean", + "description": "Internal withdrawal or not. Default : false", + "default": false + }, + "remark": { + "type": "string", + "description": "remark" + }, + "feeDeductType": { + "type": "string", + "description": "Withdrawal fee deduction type: INTERNAL or EXTERNAL or not specified\n\n1. INTERNAL- deduct the transaction fees from your withdrawal amount\n2. EXTERNAL- deduct the transaction fees from your main account\n3. If you don't specify the feeDeductType parameter, when the balance in your main account is sufficient to support the withdrawal, the system will initially deduct the transaction fees from your main account. But if the balance in your main account is not sufficient to support the withdrawal, the system will deduct the fees from your withdrawal amount. For example: Suppose you are going to withdraw 1 BTC from the KuCoin platform (transaction fee: 0.0001BTC), if the balance in your main account is insufficient, the system will deduct the transaction fees from your withdrawal amount. In this case, you will be receiving 0.9999BTC." + } + }, + "required": [ + "currency", + "address", + "amount" + ] + }, + "example": "{\n \"currency\": \"USDT\",\n \"address\": \"TKFRQXSDc****16GmLrjJggwX8\",\n \"amount\": 3,\n \"chain\": \"trx\",\n \"isInner\": true\n}", + "mediaType": "" + }, + "description": ":::tip[TIPS]\nIt is recommended to use the **POST /api/v3/withdrawals** endpoint instead of this endpoint\n:::\n\n:::info[Description]\nUse this interface to withdraw the specified currency\n:::\n", + "customApiFields": "{\"abandon\":\"abandon\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"Withdrawal\",\"api-rate-limit-pool\":\"Management\",\"sdk-service\":\"Account\",\"sdk-sub-service\":\"Withdrawal\",\"sdk-method-name\":\"withdrawalV1\",\"sdk-method-description\":\"Use this interface to withdraw the specified currency\",\"api-rate-limit\":5}" + } + } + ] + }, + { + "name": "Spot Trading", + "id": 348173, + "description": "", + "items": [ + { + "name": "Orders", + "id": 348185, + "description": "", + "items": [ + { + "name": "Add Order - Old", + "api": { + "id": "3470333", + "method": "post", + "path": "/api/v1/orders", + "parameters": { + "query": [], + "path": [], + "cookie": [], + "header": [] + }, + "responses": [ + { + "id": "10509", + "code": 200, + "name": "OK", + "headers": [], + "jsonSchema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "object", + "properties": { + "orderId": { + "type": "string", + "description": "The unique order id generated by the trading system,which can be used later for further actions such as canceling the order." } }, "required": [ - "id", - "symbol", - "opType", - "type", - "side", - "price", - "size", - "funds", - "dealFunds", - "dealSize", - "fee", - "feeCurrency", - "stp", - "stop", - "stopTriggered", - "stopPrice", - "timeInForce", - "postOnly", - "hidden", - "iceberg", - "visibleSize", - "cancelAfter", - "channel", - "clientOid", - "remark", - "tags", - "isActive", - "cancelExist", - "createdAt", - "tradeType" + "orderId" ] } }, @@ -43639,93 +42590,232 @@ "responseExamples": [ { "name": "Success", - "data": "{\r\n \"code\": \"200000\",\r\n \"data\": {\r\n \"id\": \"674a97dfef434f0007efc431\",\r\n \"symbol\": \"BTC-USDT\",\r\n \"opType\": \"DEAL\",\r\n \"type\": \"limit\",\r\n \"side\": \"buy\",\r\n \"price\": \"50000\",\r\n \"size\": \"0.0001\",\r\n \"funds\": \"0\",\r\n \"dealFunds\": \"0\",\r\n \"dealSize\": \"0\",\r\n \"fee\": \"0\",\r\n \"feeCurrency\": \"USDT\",\r\n \"stp\": \"\",\r\n \"stop\": \"\",\r\n \"stopTriggered\": false,\r\n \"stopPrice\": \"0\",\r\n \"timeInForce\": \"GTC\",\r\n \"postOnly\": false,\r\n \"hidden\": false,\r\n \"iceberg\": false,\r\n \"visibleSize\": \"0\",\r\n \"cancelAfter\": 0,\r\n \"channel\": \"API\",\r\n \"clientOid\": \"3d07008668054da6b3cb12e432c2b13a\",\r\n \"remark\": null,\r\n \"tags\": null,\r\n \"isActive\": false,\r\n \"cancelExist\": true,\r\n \"createdAt\": 1732941791518,\r\n \"tradeType\": \"TRADE\"\r\n }\r\n}", - "responseId": 10575, + "data": "{\r\n \"code\": \"200000\",\r\n \"data\": {\r\n \"orderId\": \"674a8635b38d120007709c0f\"\r\n }\r\n}", + "responseId": 10509, "ordering": 1 } ], "requestBody": { - "type": "none", + "type": "application/json", "parameters": [], "jsonSchema": { "type": "object", - "properties": {} - }, - "example": "{\n \"symbol\": \"BTC-USDT\",\n \"orderId\": \"670fd33bf9406e0007ab3945\",\n \"newPrice\": \"30000\",\n \"newSize\": \"0.0001\"\n}", - "mediaType": "" - }, - "description": ":::tip[]\nIt is recommended to use the **GET /api/v1/hf/orders/client-order/{clientOid}** endpoint instead of this endpoint\n:::\n\n:::info[Description]\nRequest via this interface to check the information of a single active order via clientOid. The system will prompt that the order does not exists if the order does not exist or has been settled.\n:::", - "customApiFields": "{\"abandon\":\"abandon\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"General\",\"api-rate-limit-pool\":\"Spot\",\"sdk-service\":\"Spot\",\"sdk-sub-service\":\"Order\",\"sdk-method-name\":\"getOrderByClientOidOld\",\"sdk-method-description\":\"Request via this interface to check the information of a single active order via clientOid. The system will prompt that the order does not exists if the order does not exist or has been settled.\",\"api-rate-limit\":3}" - } - }, - { - "name": "Batch Cancel Order - Old", - "api": { - "id": "3470345", - "method": "delete", - "path": "/api/v1/orders", - "parameters": { - "query": [ - { - "id": "KXIxHhD4qw", - "name": "symbol", - "required": false, - "description": "symbol", - "example": "BTC-USDT", - "type": "string", - "schema": { + "properties": { + "clientOid": { + "type": "string", + "description": "Client Order Id,The ClientOid field is a unique ID created by the user(we recommend using a UUID), and can only contain numbers, letters, underscores (_), and hyphens (-). This field is returned when order information is obtained. You can use clientOid to tag your orders. ClientOid is different from the order ID created by the service provider. Please do not initiate requests using the same clientOid. The maximum length for the ClientOid is 40 characters.\n\nPlease remember the orderId created by the service provider, it used to check for updates in order status.", + "examples": [ + "5c52e11203aa677f33e493fb" + ] + }, + "side": { + "type": "string", + "description": "specify if the order is to 'buy' or 'sell'", + "enum": [ + "buy", + "sell" + ], + "examples": [ + "buy" + ], + "x-api-enum": [ + { + "value": "buy", + "name": "", + "description": "" + }, + { + "value": "sell", + "name": "", + "description": "" + } + ] + }, + "symbol": { "type": "string", + "description": "symbol", "examples": [ "BTC-USDT", "ETH-USDT", "KCS-USDT" ] }, - "enable": true - }, - { - "required": false, - "description": "The type of trading :TRADE(Spot Trading), MARGIN_TRADE(Cross Margin Trading), MARGIN_ISOLATED_TRADE(Isolated Margin Trading), and the default is TRADE to cancel the spot trading orders.", - "type": "string", - "id": "Pt2HaiQzCP", - "enable": true, - "name": "tradeType", - "schema": { + "type": { + "type": "string", + "description": "specify if the order is an 'limit' order or 'market' order. \n\nThe type of order you specify when you place your order determines whether or not you need to request other parameters and also affects the execution of the matching engine.\n\nWhen placing a limit order, you must specify a price and size. The system will try to match the order according to market price or a price better than market price. If the order cannot be immediately matched, it will stay in the order book until it is matched or the user cancels.\n\nUnlike limit orders, the price for market orders fluctuates with market prices. When placing a market order, you do not need to specify a price, you only need to specify a quantity. Market orders are filled immediately and will not enter the order book. All market orders are takers and a taker fee will be charged.", + "enum": [ + "limit", + "market" + ], + "default": "limit", + "x-api-enum": [ + { + "value": "limit", + "name": "limit", + "description": "limit order" + }, + { + "value": "market", + "name": "market", + "description": "market order" + } + ] + }, + "remark": { + "type": "string", + "description": "Order placement remarks, length cannot exceed 20 characters (ASCII)" + }, + "stp": { + "type": "string", + "description": "[Self Trade Prevention](apidog://link/pages/338146) is divided into four strategies: CN, CO, CB , and DC", + "enum": [ + "DC", + "CO", + "CN", + "CB" + ], + "x-api-enum": [ + { + "value": "DC", + "name": "", + "description": "" + }, + { + "value": "CO", + "name": "", + "description": "" + }, + { + "value": "CN", + "name": "", + "description": "" + }, + { + "value": "CB", + "name": "", + "description": "" + } + ] + }, + "price": { + "type": "string", + "description": "Specify price for order\n\nWhen placing a limit order, the price must be based on priceIncrement for the trading pair. The price increment (priceIncrement) is the price precision for the trading pair. For example, for the BTC-USDT trading pair, the priceIncrement is 0.00001000. So the price for your orders cannot be less than 0.00001000 and must be a multiple of priceIncrement. Otherwise, the order will return an invalid priceIncrement error." + }, + "size": { + "type": "string", + "description": "Specify quantity for order\n\nWhen **type** is limit, size refers to the amount of trading targets (the asset name written in front) for the trading pair. Teh Size must be based on the baseIncrement of the trading pair. The baseIncrement represents the precision for the trading pair. The size of an order must be a positive-integer multiple of baseIncrement and must be between baseMinSize and baseMaxSize.\n\nWhen **type** is market, select one out of two: size or funds" + }, + "timeInForce": { + "type": "string", + "description": "[Time in force](apidog://link/pages/338146) is a special strategy used during trading", + "enum": [ + "GTC", + "GTT", + "IOC", + "FOK" + ], + "default": "GTC", + "x-api-enum": [ + { + "value": "GTC", + "name": "", + "description": "" + }, + { + "value": "GTT", + "name": "", + "description": "" + }, + { + "value": "IOC", + "name": "", + "description": "" + }, + { + "value": "FOK", + "name": "", + "description": "" + } + ] + }, + "postOnly": { + "type": "boolean", + "default": false, + "description": "passive order labels, this is disabled when the order timing strategy is IOC or FOK" + }, + "hidden": { + "type": "boolean", + "description": "Hidden or not (not shown in order book)", + "default": false + }, + "iceberg": { + "type": "boolean", + "description": "Whether or not only visible portions of orders are shown in iceberg orders", + "default": false + }, + "visibleSize": { + "type": "string", + "description": "Maximum visible quantity in iceberg orders" + }, + "cancelAfter": { + "type": "integer", + "format": "int64", + "description": "Cancel after n seconds,the order timing strategy is GTT" + }, + "funds": { + "type": "string", + "description": "When **type** is market, select one out of two: size or funds" + }, + "tradeType": { "type": "string", + "description": "The type of trading : **TRADE**(Spot Trade), **MARGIN_TRADE** (Margin Trade). Default is **TRADE**. **Note: To improve the system performance and to accelerate order placing and processing, KuCoin has added a new interface for order placing of margin. For traders still using the current interface, please move to the new one as soon as possible. The current one will no longer accept margin orders by May 1st, 2021 (UTC). At the time, KuCoin will notify users via the announcement, please pay attention to it.**", "enum": [ "TRADE", - "MARGIN_TRADE", - "MARGIN_ISOLATED_TRADE" + "MARGIN_TRADE" ], "default": "TRADE", "x-api-enum": [ { "value": "TRADE", "name": "TRADE", - "description": "Spot Trading" + "description": "Spot" }, { "value": "MARGIN_TRADE", "name": "MARGIN_TRADE", - "description": "Cross Margin Trading" - }, - { - "value": "MARGIN_ISOLATED_TRADE", - "name": "MARGIN_ISOLATED_TRADE", - "description": "Isolated Margin Trading" + "description": "Margin" } ] - }, - "example": "TRADE" - } - ], + } + }, + "required": [ + "symbol", + "side", + "clientOid" + ] + }, + "example": "//limit order\n{\n \"type\": \"limit\",\n \"symbol\": \"BTC-USDT\",\n \"side\": \"buy\",\n \"price\": \"50000\",\n \"size\": \"0.00001\",\n \"clientOid\": \"5c52e11203aa677f33e493fb\",\n \"remark\": \"order remarks\"\n}\n\n//market order 1\n// {\n// \"type\": \"market\",\n// \"symbol\": \"BTC-USDT\",\n// \"side\": \"buy\",\n// \"size\": \"0.00001\",\n// \"clientOid\": \"5c52e11203aa677f33e493fc\",\n// \"remark\": \"order remarks\"\n// }\n\n//market order 2\n// {\n// \"type\": \"market\",\n// \"symbol\": \"BTC-USDT\",\n// \"side\": \"buy\",\n// \"funds\": \"1\",\n// \"clientOid\": \"5c52e11203aa677f33e493fc\",\n// \"remark\": \"order remarks\"\n// }\n", + "mediaType": "" + }, + "description": ":::tip[]\nIt is recommended to use the **POST /api/v1/hf/orders** endpoint instead of this endpoint\n:::\n\n:::info[Description]\nPlace order to the Spot trading system, you can place two major types of orders: limit and market. Orders can only be placed if your account has sufficient funds. Once an order is placed, your funds will be put on hold for the duration of the order. The amount of funds on hold depends on the order type and parameters specified.\n:::\n\n:::tip[Tips]\nPlease note that once your order enters the order book, the system will freeze the handling fees for the order ahead of time.\n\nBefore placing orders, please be sure to fully understand the meaning of the parameters for each trading pair.\n:::\n\n:::tip[Tips]\nThe maximum number of active orders per account is 2000, with a maximum of 200 active orders per trading pair.(including stop orders).\n:::\n\n**Public order placement request parameters**\n\n| Param | Type | Mandatory | Description |\n| --------- | ------ | --------- | ----------- |\n| clientOid | String | Yes | clientOid, the unique identifier created by the client, use of UUID, with a maximum length of 128 bits. |\n| side | String | Yes | **buy** or **sell** |\n| symbol | String | Yes | symbol, e.g. ETH-BTC |\n| type | String | No | **limit** or **market** (default is **limit**) |\n| remark | String | No | remark, length cannot exceed 50 characters (ASCII) |\n| stp | String | No | self trade prevention, **CN**, **CO**, **CB** or **DC** |\n| tradeType | String | No | The type of trading : **TRADE**(Spot Trade), **MARGIN_TRADE** (Margin Trade). Default is **TRADE**. **Note: To improve the system performance and to accelerate order placing and processing, KuCoin has added a new interface for order placing of margin. For traders still using the current interface, please move to the new one as soon as possible. The current one will no longer accept margin orders by May 1st, 2021 (UTC). At the time, KuCoin will notify users via the announcement, please pay attention to it.** |\n\n##### Additional Request Parameters Required by `limit` Orders\n\n| Param | Type | Mandatory | Description |\n| ----------- | ------- | --------- | ------------ |\n| price | String | Yes | Specify price for currency |\n| size | String | Yes | Specify quantity for currency |\n| timeInForce | String | No | Order timing strategy `GTC`, `GTT`, `IOC`, `FOK` (The default is `GTC`) |\n| cancelAfter | long | No | Cancel after `n` seconds,the order timing strategy is `GTT` |\n| postOnly | boolean | No | passive order labels, this is disabled when the order timing strategy is `IOC` or `FOK` |\n| hidden | boolean | No | Hidden or not (not shown in order book) |\n| iceberg | boolean | No | Whether or not only visible portions of orders are shown in iceberg orders |\n| visibleSize | String | No | Maximum visible quantity in iceberg orders |\n\n##### Additional request parameters required by `market` orders\n\n| Param | Type | Mandatory | Description |\n| ----- | ------ | --------- | ------------------------------------------ |\n| size | String | No | (Select one out of two: `size` or `funds`) |\n| funds | String | No | (Select one out of two: `size` or `funds`) |", + "customApiFields": "{\"abandon\":\"abandon\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"Spot\",\"api-rate-limit-pool\":\"Spot\",\"sdk-service\":\"Spot\",\"sdk-sub-service\":\"Order\",\"sdk-method-name\":\"addOrderOld\",\"sdk-method-description\":\"Place order to the Spot trading system, you can place two major types of orders: limit and market. Orders can only be placed if your account has sufficient funds. Once an order is placed, your funds will be put on hold for the duration of the order. The amount of funds on hold depends on the order type and parameters specified.\",\"api-rate-limit\":2}" + } + }, + { + "name": "Add Order Test - Old", + "api": { + "id": "3470341", + "method": "post", + "path": "/api/v1/orders/test", + "parameters": { + "query": [], "path": [], "cookie": [], "header": [] }, "responses": [ { - "id": "10572", + "id": "10602", "code": 200, "name": "OK", "headers": [], @@ -43738,15 +42828,13 @@ "data": { "type": "object", "properties": { - "cancelledOrderIds": { - "type": "array", - "items": { - "type": "string" - } + "orderId": { + "type": "string", + "description": "The unique order id generated by the trading system,which can be used later for further actions such as canceling the order." } }, "required": [ - "cancelledOrderIds" + "orderId" ] } }, @@ -43763,220 +42851,232 @@ "responseExamples": [ { "name": "Success", - "data": "{\r\n \"code\": \"200000\",\r\n \"data\": {\r\n \"cancelledOrderIds\": [\r\n \"674a8635b38d120007709c0f\",\r\n \"674a8630439c100007d3bce1\"\r\n ]\r\n }\r\n}", - "responseId": 10572, + "data": "{\r\n \"code\": \"200000\",\r\n \"data\": {\r\n \"orderId\": \"674a8776291d9e00074f1edf\"\r\n }\r\n}", + "responseId": 10602, "ordering": 1 } ], "requestBody": { - "type": "none", + "type": "application/json", "parameters": [], "jsonSchema": { "type": "object", - "properties": {} - }, - "example": "{\n \"symbol\": \"BTC-USDT\",\n \"orderId\": \"670fd33bf9406e0007ab3945\",\n \"newPrice\": \"30000\",\n \"newSize\": \"0.0001\"\n}", - "mediaType": "" - }, - "description": ":::tip[]\nIt is recommended to use the **DELETE /api/v1/hf/orders/cancelAll** endpoint instead of this endpoint\n:::\n\n:::info[Description]\nRequest via this endpoint to cancel all open orders. The response is a list of ids of the canceled orders.\n:::", - "customApiFields": "{\"abandon\":\"abandon\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"Spot\",\"api-rate-limit-pool\":\"Spot\",\"sdk-service\":\"Spot\",\"sdk-sub-service\":\"Order\",\"sdk-method-name\":\"batchCancelOrderOld\",\"sdk-method-description\":\"Request via this endpoint to cancel all open orders. The response is a list of ids of the canceled orders.\",\"api-rate-limit\":20}" - } - }, - { - "name": "Get Trade History - Old", - "api": { - "id": "3470350", - "method": "get", - "path": "/api/v1/fills", - "parameters": { - "query": [ - { - "id": "M9bgPS6vOj", - "name": "symbol", - "required": true, - "description": "symbol", - "example": "BTC-USDT", - "type": "string", - "schema": { + "properties": { + "clientOid": { "type": "string", + "description": "Client Order Id,The ClientOid field is a unique ID created by the user(we recommend using a UUID), and can only contain numbers, letters, underscores (_), and hyphens (-). This field is returned when order information is obtained. You can use clientOid to tag your orders. ClientOid is different from the order ID created by the service provider. Please do not initiate requests using the same clientOid. The maximum length for the ClientOid is 40 characters.\n\nPlease remember the orderId created by the service provider, it used to check for updates in order status.", "examples": [ - "BTC-USDT", - "ETH-USDT", - "KCS-USDT" + "5c52e11203aa677f33e493fb" ] }, - "enable": true - }, - { - "id": "Bc6ZDrZFdp", - "name": "orderId", - "required": false, - "description": "The unique order id generated by the trading system (If orderId is specified,please ignore the other query parameters)", - "type": "string", - "enable": true - }, - { - "id": "sTtMCE9Jhf", - "name": "side", - "required": false, - "description": "specify if the order is to 'buy' or 'sell'", - "type": "string", - "schema": { + "side": { "type": "string", + "description": "specify if the order is to 'buy' or 'sell'", "enum": [ "buy", "sell" ], + "examples": [ + "buy" + ], "x-api-enum": [ { "value": "buy", - "name": "buy", - "description": "buy" + "name": "", + "description": "" }, { "value": "sell", - "name": "sell", - "description": "sell" + "name": "", + "description": "" } ] }, - "enable": true - }, - { - "id": "QaBSxyasEm", - "name": "type", - "required": false, - "description": "limit, market, limit_stop or market_stop\n", - "type": "string", - "schema": { + "symbol": { + "type": "string", + "description": "symbol", + "examples": [ + "BTC-USDT", + "ETH-USDT", + "KCS-USDT" + ] + }, + "type": { "type": "string", + "description": "specify if the order is an 'limit' order or 'market' order. \n\nThe type of order you specify when you place your order determines whether or not you need to request other parameters and also affects the execution of the matching engine.\n\nWhen placing a limit order, you must specify a price and size. The system will try to match the order according to market price or a price better than market price. If the order cannot be immediately matched, it will stay in the order book until it is matched or the user cancels.\n\nUnlike limit orders, the price for market orders fluctuates with market prices. When placing a market order, you do not need to specify a price, you only need to specify a quantity. Market orders are filled immediately and will not enter the order book. All market orders are takers and a taker fee will be charged.", "enum": [ "limit", - "market", - "limit_stop", - "market_stop" + "market" ], + "default": "limit", "x-api-enum": [ { "value": "limit", "name": "limit", - "description": "limit" + "description": "limit order" }, { "value": "market", "name": "market", - "description": "market" + "description": "market order" + } + ] + }, + "remark": { + "type": "string", + "description": "Order placement remarks, length cannot exceed 20 characters (ASCII)" + }, + "stp": { + "type": "string", + "description": "[Self Trade Prevention](apidog://link/pages/338146) is divided into four strategies: CN, CO, CB , and DC", + "enum": [ + "DC", + "CO", + "CN", + "CB" + ], + "x-api-enum": [ + { + "value": "DC", + "name": "", + "description": "" }, { - "value": "limit_stop", - "name": "limit_stop", - "description": "limit_stop" + "value": "CO", + "name": "", + "description": "" + }, + { + "value": "CN", + "name": "", + "description": "" + }, + { + "value": "CB", + "name": "", + "description": "" + } + ] + }, + "price": { + "type": "string", + "description": "Specify price for order\n\nWhen placing a limit order, the price must be based on priceIncrement for the trading pair. The price increment (priceIncrement) is the price precision for the trading pair. For example, for the BTC-USDT trading pair, the priceIncrement is 0.00001000. So the price for your orders cannot be less than 0.00001000 and must be a multiple of priceIncrement. Otherwise, the order will return an invalid priceIncrement error." + }, + "size": { + "type": "string", + "description": "Specify quantity for order\n\nWhen **type** is limit, size refers to the amount of trading targets (the asset name written in front) for the trading pair. Teh Size must be based on the baseIncrement of the trading pair. The baseIncrement represents the precision for the trading pair. The size of an order must be a positive-integer multiple of baseIncrement and must be between baseMinSize and baseMaxSize.\n\nWhen **type** is market, select one out of two: size or funds" + }, + "timeInForce": { + "type": "string", + "description": "[Time in force](apidog://link/pages/338146) is a special strategy used during trading", + "enum": [ + "GTC", + "GTT", + "IOC", + "FOK" + ], + "default": "GTC", + "x-api-enum": [ + { + "value": "GTC", + "name": "", + "description": "" + }, + { + "value": "GTT", + "name": "", + "description": "" }, { - "value": "market_stop", - "name": "market_stop", - "description": "market_stop" + "value": "IOC", + "name": "", + "description": "" + }, + { + "value": "FOK", + "name": "", + "description": "" } ] }, - "enable": true - }, - { - "required": false, - "description": "The type of trading:TRADE - Spot Trading(TRADE as default), MARGIN_TRADE - Cross Margin Trading, MARGIN_ISOLATED_TRADE - Isolated Margin Trading.", - "type": "string", - "id": "mgaSumd8UP", - "enable": true, - "name": "tradeType", - "schema": { + "postOnly": { + "type": "boolean", + "default": false, + "description": "passive order labels, this is disabled when the order timing strategy is IOC or FOK" + }, + "hidden": { + "type": "boolean", + "description": "Hidden or not (not shown in order book)", + "default": false + }, + "iceberg": { + "type": "boolean", + "description": "Whether or not only visible portions of orders are shown in iceberg orders", + "default": false + }, + "visibleSize": { + "type": "string", + "description": "Maximum visible quantity in iceberg orders" + }, + "cancelAfter": { + "type": "integer", + "format": "int64", + "description": "Cancel after n seconds,the order timing strategy is GTT" + }, + "funds": { + "type": "string", + "description": "When **type** is market, select one out of two: size or funds" + }, + "tradeType": { "type": "string", + "description": "The type of trading : **TRADE**(Spot Trade), **MARGIN_TRADE** (Margin Trade). Default is **TRADE**. **Note: To improve the system performance and to accelerate order placing and processing, KuCoin has added a new interface for order placing of margin. For traders still using the current interface, please move to the new one as soon as possible. The current one will no longer accept margin orders by May 1st, 2021 (UTC). At the time, KuCoin will notify users via the announcement, please pay attention to it.**", "enum": [ "TRADE", - "MARGIN_TRADE", - "MARGIN_ISOLATED_TRADE" + "MARGIN_TRADE" ], "default": "TRADE", "x-api-enum": [ { "value": "TRADE", "name": "TRADE", - "description": "Spot Trading" + "description": "Spot" }, { "value": "MARGIN_TRADE", "name": "MARGIN_TRADE", - "description": "Cross Margin Trading" - }, - { - "value": "MARGIN_ISOLATED_TRADE", - "name": "MARGIN_ISOLATED_TRADE", - "description": "Isolated Margin Trading" + "description": "Margin" } ] } }, - { - "id": "Djtx6oC9gm", - "name": "startAt", - "required": false, - "description": "Start time (milisecond)", - "example": "1728663338000", - "type": "integer", - "schema": { - "type": "integer", - "format": "int64" - }, - "enable": true - }, - { - "id": "K9IMpKw8u2", - "name": "endAt", - "required": false, - "description": "End time (milisecond)", - "example": "1728692138000", - "type": "integer", - "schema": { - "type": "integer", - "format": "int64" - }, - "enable": true - }, - { - "required": false, - "description": "Current request page.", - "type": "integer", - "id": "EBVkCJ9t08", - "enable": true, - "name": "currentPage", - "schema": { - "type": "integer", - "default": 1 - } - }, - { - "required": false, - "description": "Number of results per request. Minimum is 10, maximum is 500.", - "type": "integer", - "id": "0RU5JfoTZO", - "enable": true, - "name": "pageSize", - "schema": { - "type": "integer", - "minimum": 10, - "maximum": 500, - "examples": [ - 50 - ] - } - } - ], + "required": [ + "symbol", + "side", + "clientOid" + ] + }, + "example": "//limit order\n{\n \"type\": \"limit\",\n \"symbol\": \"BTC-USDT\",\n \"side\": \"buy\",\n \"price\": \"50000\",\n \"size\": \"0.00001\",\n \"clientOid\": \"5c52e11203aa677f33e493fb\",\n \"remark\": \"order remarks\"\n}\n\n//market order 1\n// {\n// \"type\": \"market\",\n// \"symbol\": \"BTC-USDT\",\n// \"side\": \"buy\",\n// \"size\": \"0.00001\",\n// \"clientOid\": \"5c52e11203aa677f33e493fc\",\n// \"remark\": \"order remarks\"\n// }\n\n//market order 2\n// {\n// \"type\": \"market\",\n// \"symbol\": \"BTC-USDT\",\n// \"side\": \"buy\",\n// \"funds\": \"1\",\n// \"clientOid\": \"5c52e11203aa677f33e493fc\",\n// \"remark\": \"order remarks\"\n// }\n", + "mediaType": "" + }, + "description": ":::tip[]\nIt is recommended to use the **POST /api/v1/hf/orders/test** endpoint instead of this endpoint\n:::\n\n:::info[Description]\nOrder test endpoint, the request parameters and return parameters of this endpoint are exactly the same as the order endpoint, and can be used to verify whether the signature is correct and other operations. After placing an order, the order will not enter the matching system, and the order cannot be queried.\n:::\n\n:::tip[Tips]\nPlease note that once your order enters the order book, the system will freeze the handling fees for the order ahead of time.\n\nBefore placing orders, please be sure to fully understand the meaning of the parameters for each trading pair.\n:::\n\n:::tip[Tips]\nThe maximum number of active orders per account is 2000, with a maximum of 200 active orders per trading pair.(including stop orders).\n:::\n\n**Public order placement request parameters**\n\n| Param | Type | Mandatory | Description |\n| --------- | ------ | --------- | ----------- |\n| clientOid | String | Yes | clientOid, the unique identifier created by the client, use of UUID, with a maximum length of 128 bits. |\n| side | String | Yes | **buy** or **sell** |\n| symbol | String | Yes | symbol, e.g. ETH-BTC |\n| type | String | No | **limit** or **market** (default is **limit**) |\n| remark | String | No | remark, length cannot exceed 50 characters (ASCII) |\n| stp | String | No | self trade prevention, **CN**, **CO**, **CB** or **DC** |\n| tradeType | String | No | The type of trading : **TRADE**(Spot Trade), **MARGIN_TRADE** (Margin Trade). Default is **TRADE**. **Note: To improve the system performance and to accelerate order placing and processing, KuCoin has added a new interface for order placing of margin. For traders still using the current interface, please move to the new one as soon as possible. The current one will no longer accept margin orders by May 1st, 2021 (UTC). At the time, KuCoin will notify users via the announcement, please pay attention to it.** |\n\n##### Additional Request Parameters Required by `limit` Orders\n\n| Param | Type | Mandatory | Description |\n| ----------- | ------- | --------- | ------------ |\n| price | String | Yes | Specify price for currency |\n| size | String | Yes | Specify quantity for currency |\n| timeInForce | String | No | Order timing strategy `GTC`, `GTT`, `IOC`, `FOK` (The default is `GTC`) |\n| cancelAfter | long | No | Cancel after `n` seconds,the order timing strategy is `GTT` |\n| postOnly | boolean | No | passive order labels, this is disabled when the order timing strategy is `IOC` or `FOK` |\n| hidden | boolean | No | Hidden or not (not shown in order book) |\n| iceberg | boolean | No | Whether or not only visible portions of orders are shown in iceberg orders |\n| visibleSize | String | No | Maximum visible quantity in iceberg orders |\n\n##### Additional request parameters required by `market` orders\n\n| Param | Type | Mandatory | Description |\n| ----- | ------ | --------- | ------------------------------------------ |\n| size | String | No | (Select one out of two: `size` or `funds`) |\n| funds | String | No | (Select one out of two: `size` or `funds`) |", + "customApiFields": "{\"abandon\":\"abandon\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"Spot\",\"api-rate-limit-pool\":\"Spot\",\"sdk-service\":\"Spot\",\"sdk-sub-service\":\"Order\",\"sdk-method-name\":\"addOrderTestOld\",\"sdk-method-description\":\"Order test endpoint, the request parameters and return parameters of this endpoint are exactly the same as the order endpoint, and can be used to verify whether the signature is correct and other operations. After placing an order, the order will not enter the matching system, and the order cannot be queried.\",\"api-rate-limit\":2}" + } + }, + { + "name": "Batch Add Orders - Old", + "api": { + "id": "3470342", + "method": "post", + "path": "/api/v1/orders/multi", + "parameters": { + "query": [], "path": [], "cookie": [], "header": [] }, "responses": [ { - "id": "10606", + "id": "10603", "code": 200, "name": "OK", "headers": [], @@ -43989,104 +43089,103 @@ "data": { "type": "object", "properties": { - "currentPage": { - "type": "integer" - }, - "pageSize": { - "type": "integer" - }, - "totalNum": { - "type": "integer" - }, - "totalPage": { - "type": "integer" - }, - "items": { + "data": { "type": "array", "items": { "type": "object", "properties": { "symbol": { - "type": "string", - "description": "symbol", - "examples": [ - "BTC-USDT", - "ETH-USDT", - "KCS-USDT" - ] - }, - "tradeId": { "type": "string" }, - "orderId": { - "type": "string", - "description": "The unique order id generated by the trading system" - }, - "counterOrderId": { - "type": "string", - "description": "Counterparty order Id" + "type": { + "type": "string" }, "side": { - "type": "string", - "description": "Buy or sell" - }, - "liquidity": { - "type": "string", - "description": "Liquidity type: taker or maker" - }, - "forceTaker": { - "type": "boolean" + "type": "string" }, "price": { - "type": "string", - "description": "Order price" + "type": "string" }, "size": { - "type": "string", - "description": "Order size" + "type": "string" }, "funds": { - "type": "string", - "description": "Order Funds" + "type": "string" }, - "fee": { - "type": "string", - "description": "[Handling fees](apidog://link/pages/5327739)" + "stp": { + "type": "string" }, - "feeRate": { - "type": "string", - "description": "Fee rate\n" + "stop": { + "type": "string" }, - "feeCurrency": { - "type": "string", - "description": "currency used to calculate trading fee" + "stopPrice": { + "type": "string" }, - "stop": { - "type": "string", - "description": "Take Profit and Stop Loss type, currently HFT does not support the Take Profit and Stop Loss type, so it is empty" + "timeInForce": { + "type": "string" }, - "tradeType": { - "type": "string", - "description": "Trade type, redundancy param" + "cancelAfter": { + "type": "integer" }, - "type": { - "type": "string", - "description": "Specify if the order is an 'limit' order or 'market' order. " + "postOnly": { + "type": "boolean" }, - "createdAt": { - "type": "integer", - "format": "int64" + "hidden": { + "type": "boolean" + }, + "iceberge": { + "type": "boolean" + }, + "iceberg": { + "type": "boolean" + }, + "visibleSize": { + "type": "string" + }, + "channel": { + "type": "string" + }, + "id": { + "type": "string" + }, + "status": { + "type": "string" + }, + "failMsg": { + "type": "string" + }, + "clientOid": { + "type": "string" } - } + }, + "required": [ + "symbol", + "type", + "side", + "price", + "size", + "funds", + "stp", + "stop", + "stopPrice", + "timeInForce", + "cancelAfter", + "postOnly", + "hidden", + "iceberge", + "iceberg", + "visibleSize", + "channel", + "id", + "status", + "failMsg", + "clientOid" + ] } } }, "required": [ - "currentPage", - "pageSize", - "totalNum", - "totalPage", - "items" + "data" ] } }, @@ -44103,69 +43202,284 @@ "responseExamples": [ { "name": "Success", - "data": "{\r\n \"code\": \"200000\",\r\n \"data\": {\r\n \"currentPage\": 1,\r\n \"pageSize\": 50,\r\n \"totalNum\": 1,\r\n \"totalPage\": 1,\r\n \"items\": [\r\n {\r\n \"symbol\": \"DOGE-USDT\",\r\n \"tradeId\": \"10862827223795713\",\r\n \"orderId\": \"6745698ef4f1200007c561a8\",\r\n \"counterOrderId\": \"6745695ef15b270007ac5076\",\r\n \"side\": \"buy\",\r\n \"liquidity\": \"taker\",\r\n \"forceTaker\": false,\r\n \"price\": \"0.40739\",\r\n \"size\": \"10\",\r\n \"funds\": \"4.0739\",\r\n \"fee\": \"0.0040739\",\r\n \"feeRate\": \"0.001\",\r\n \"feeCurrency\": \"USDT\",\r\n \"stop\": \"\",\r\n \"tradeType\": \"TRADE\",\r\n \"type\": \"market\",\r\n \"createdAt\": 1732602254928\r\n }\r\n ]\r\n }\r\n}", - "responseId": 10606, + "data": "{\r\n \"code\": \"200000\",\r\n \"data\": {\r\n \"data\": [\r\n {\r\n \"symbol\": \"BTC-USDT\",\r\n \"type\": \"limit\",\r\n \"side\": \"buy\",\r\n \"price\": \"50000\",\r\n \"size\": \"0.0001\",\r\n \"funds\": null,\r\n \"stp\": \"\",\r\n \"stop\": \"\",\r\n \"stopPrice\": null,\r\n \"timeInForce\": \"GTC\",\r\n \"cancelAfter\": 0,\r\n \"postOnly\": false,\r\n \"hidden\": false,\r\n \"iceberge\": false,\r\n \"iceberg\": false,\r\n \"visibleSize\": null,\r\n \"channel\": \"API\",\r\n \"id\": \"674a97dfef434f0007efc431\",\r\n \"status\": \"success\",\r\n \"failMsg\": null,\r\n \"clientOid\": \"3d07008668054da6b3cb12e432c2b13a\"\r\n },\r\n {\r\n \"symbol\": \"BTC-USDT\",\r\n \"type\": \"limit\",\r\n \"side\": \"buy\",\r\n \"price\": \"49999\",\r\n \"size\": \"0.0001\",\r\n \"funds\": null,\r\n \"stp\": \"\",\r\n \"stop\": \"\",\r\n \"stopPrice\": null,\r\n \"timeInForce\": \"GTC\",\r\n \"cancelAfter\": 0,\r\n \"postOnly\": false,\r\n \"hidden\": false,\r\n \"iceberge\": false,\r\n \"iceberg\": false,\r\n \"visibleSize\": null,\r\n \"channel\": \"API\",\r\n \"id\": \"674a97dffb378b00077b9c20\",\r\n \"status\": \"fail\",\r\n \"failMsg\": \"Balance insufficient!\",\r\n \"clientOid\": \"37245dbe6e134b5c97732bfb36cd4a9d\"\r\n }\r\n ]\r\n }\r\n}", + "responseId": 10603, "ordering": 1 } ], "requestBody": { - "type": "none", + "type": "application/json", "parameters": [], "jsonSchema": { "type": "object", - "properties": {} + "properties": { + "orderList": { + "type": "array", + "items": { + "type": "object", + "properties": { + "clientOid": { + "type": "string", + "description": "Client Order Id,The ClientOid field is a unique ID created by the user(we recommend using a UUID), and can only contain numbers, letters, underscores (_), and hyphens (-). This field is returned when order information is obtained. You can use clientOid to tag your orders. ClientOid is different from the order ID created by the service provider. Please do not initiate requests using the same clientOid. The maximum length for the ClientOid is 40 characters.\n\nPlease remember the orderId created by the service provider, it used to check for updates in order status.", + "examples": [ + "5c52e11203aa677f33e493fb" + ] + }, + "side": { + "type": "string", + "description": "specify if the order is to 'buy' or 'sell'", + "enum": [ + "buy", + "sell" + ], + "examples": [ + "buy" + ], + "x-api-enum": [ + { + "value": "buy", + "name": "", + "description": "" + }, + { + "value": "sell", + "name": "", + "description": "" + } + ] + }, + "symbol": { + "type": "string", + "description": "symbol", + "examples": [ + "BTC-USDT", + "ETH-USDT", + "KCS-USDT" + ] + }, + "type": { + "type": "string", + "description": "only limit (default is limit)", + "enum": [ + "limit" + ], + "default": "limit", + "x-api-enum": [ + { + "value": "limit", + "name": "limit", + "description": "limit order" + } + ] + }, + "remark": { + "type": "string", + "description": "Order placement remarks, length cannot exceed 20 characters (ASCII)" + }, + "stp": { + "type": "string", + "description": "[Self Trade Prevention](apidog://link/pages/338146) is divided into four strategies: CN, CO, CB , and DC", + "enum": [ + "DC", + "CO", + "CN", + "CB" + ], + "x-api-enum": [ + { + "value": "DC", + "name": "", + "description": "" + }, + { + "value": "CO", + "name": "", + "description": "" + }, + { + "value": "CN", + "name": "", + "description": "" + }, + { + "value": "CB", + "name": "", + "description": "" + } + ] + }, + "price": { + "type": "string", + "description": "Specify price for order\n\nWhen placing a limit order, the price must be based on priceIncrement for the trading pair. The price increment (priceIncrement) is the price precision for the trading pair. For example, for the BTC-USDT trading pair, the priceIncrement is 0.00001000. So the price for your orders cannot be less than 0.00001000 and must be a multiple of priceIncrement. Otherwise, the order will return an invalid priceIncrement error." + }, + "size": { + "type": "string", + "description": "Specify quantity for order\n\nWhen **type** is limit, size refers to the amount of trading targets (the asset name written in front) for the trading pair. Teh Size must be based on the baseIncrement of the trading pair. The baseIncrement represents the precision for the trading pair. The size of an order must be a positive-integer multiple of baseIncrement and must be between baseMinSize and baseMaxSize.\n\nWhen **type** is market, select one out of two: size or funds" + }, + "timeInForce": { + "type": "string", + "description": "[Time in force](apidog://link/pages/338146) is a special strategy used during trading", + "enum": [ + "GTC", + "GTT", + "IOC", + "FOK" + ], + "default": "GTC", + "x-api-enum": [ + { + "value": "GTC", + "name": "", + "description": "" + }, + { + "value": "GTT", + "name": "", + "description": "" + }, + { + "value": "IOC", + "name": "", + "description": "" + }, + { + "value": "FOK", + "name": "", + "description": "" + } + ] + }, + "postOnly": { + "type": "boolean", + "default": false, + "description": "passive order labels, this is disabled when the order timing strategy is IOC or FOK" + }, + "hidden": { + "type": "boolean", + "description": "Hidden or not (not shown in order book)", + "default": false + }, + "iceberg": { + "type": "boolean", + "description": "Whether or not only visible portions of orders are shown in iceberg orders", + "default": false + }, + "visibleSize": { + "type": "string", + "description": "Maximum visible quantity in iceberg orders" + }, + "cancelAfter": { + "type": "integer", + "format": "int64", + "description": "Cancel after n seconds,the order timing strategy is GTT" + }, + "tradeType": { + "type": "string", + "description": "The type of trading : **TRADE**(Spot Trade)", + "enum": [ + "TRADE" + ], + "default": "TRADE", + "x-api-enum": [ + { + "value": "TRADE", + "name": "TRADE", + "description": "Spot" + } + ] + }, + "stop": { + "type": "string", + "description": "Either loss or entry. Requires stopPrice to be defined", + "enum": [ + "loss", + "entry" + ], + "x-api-enum": [ + { + "value": "loss", + "name": "loss", + "description": "<=" + }, + { + "value": "entry", + "name": "entry", + "description": ">=" + } + ] + }, + "stopPrice": { + "type": "string", + "description": "Stop price, Need to be defined if stop is specified." + } + }, + "required": [ + "symbol", + "side", + "clientOid", + "price", + "size" + ] + } + }, + "symbol": { + "type": "string" + } + }, + "required": [ + "symbol" + ] }, - "example": "{\n \"symbol\": \"BTC-USDT\",\n \"orderId\": \"670fd33bf9406e0007ab3945\",\n \"newPrice\": \"30000\",\n \"newSize\": \"0.0001\"\n}", + "example": "{\n \"symbol\": \"BTC-USDT\",\n \"orderList\": [\n {\n \"clientOid\": \"3d07008668054da6b3cb12e432c2b13a\",\n \"side\": \"buy\",\n \"type\": \"limit\",\n \"price\": \"50000\",\n \"size\": \"0.0001\"\n },\n {\n \"clientOid\": \"37245dbe6e134b5c97732bfb36cd4a9d\",\n \"side\": \"buy\",\n \"type\": \"limit\",\n \"price\": \"49999\",\n \"size\": \"0.0001\"\n }\n ]\n}", "mediaType": "" }, - "description": ":::tip[]\nIt is recommended to use the **GET /api/v1/hf/fills** endpoint instead of this endpoint\n:::\n\n:::info[Description]\nRequest via this endpoint to get the recent fills.\nThe return value is the data after Pagination, sorted in descending order according to time.\n:::\n\n:::tip[Tips]\nThe system allows you to retrieve data up to one week (start from the last day by default). If the time period of the queried data exceeds one week (time range from the start time to end time exceeded 7*24 hours), the system will prompt to remind you that you have exceeded the time limit. If you only specified the start time, the system will automatically calculate the end time (end time = start time + 7 * 24 hours). On the contrary, if you only specified the end time, the system will calculate the start time (start time= end time - 7 * 24 hours) the same way.\n\nThe total number of items retrieved cannot exceed 50,000. If it is exceeded, please shorten the query time range.\n:::", - "customApiFields": "{\"abandon\":\"abandon\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"General\",\"api-rate-limit-pool\":\"Spot\",\"sdk-service\":\"Spot\",\"sdk-sub-service\":\"Order\",\"sdk-method-name\":\"getTradeHistoryOld\",\"sdk-method-description\":\"Request via this endpoint to get the recent fills. The return value is the data after Pagination, sorted in descending order according to time.\",\"api-rate-limit\":10}" + "description": ":::tip[]\nIt is recommended to use the **POST /api/v1/hf/orders/multi** endpoint instead of this endpoint\n:::\n\n:::info[Description]\nRequest via this endpoint to place 5 orders at the same time. The order type must be a limit order of the same symbol.\n:::", + "customApiFields": "{\"abandon\":\"abandon\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"Spot\",\"api-rate-limit-pool\":\"Spot\",\"sdk-service\":\"Spot\",\"sdk-sub-service\":\"Order\",\"sdk-method-name\":\"batchAddOrdersOld\",\"sdk-method-description\":\"Request via this endpoint to place 5 orders at the same time. The order type must be a limit order of the same symbol.\",\"api-rate-limit\":3}" } }, { - "name": "Get Recent Trade History - Old", + "name": "Cancel Order By OrderId - Old", "api": { - "id": "3470351", - "method": "get", - "path": "/api/v1/limit/fills", + "id": "3470343", + "method": "delete", + "path": "/api/v1/orders/{orderId}", "parameters": { "query": [ { - "required": false, - "description": "Current request page.", - "type": "integer", - "id": "EBVkCJ9t08", - "enable": true, - "name": "currentPage", - "schema": { - "type": "integer", - "default": 1 - } - }, - { - "required": false, - "description": "Number of results per request. Minimum is 10, maximum is 500.", - "type": "integer", - "id": "0RU5JfoTZO", - "enable": true, - "name": "pageSize", + "id": "KXIxHhD4qw", + "name": "symbol", + "required": true, + "description": "symbol", + "example": "BTC-USDT", + "type": "string", "schema": { - "type": "integer", - "minimum": 10, - "maximum": 500, + "type": "string", "examples": [ - 50 + "BTC-USDT", + "ETH-USDT", + "KCS-USDT" ] - } + }, + "enable": true + } + ], + "path": [ + { + "id": "orderId#0", + "name": "orderId", + "required": true, + "description": "The unique order id generated by the trading system", + "example": "674a97dfef434f0007efc431", + "type": "string", + "enable": true } ], - "path": [], "cookie": [], "header": [] }, "responses": [ { - "id": "10607", + "id": "10604", "code": 200, "name": "OK", "headers": [], @@ -44176,64 +43490,18 @@ "type": "string" }, "data": { - "type": "array", - "items": { - "type": "object", - "properties": { - "symbol": { - "type": "string" - }, - "tradeId": { - "type": "string" - }, - "orderId": { - "type": "string" - }, - "counterOrderId": { - "type": "string" - }, - "side": { - "type": "string" - }, - "liquidity": { - "type": "string" - }, - "forceTaker": { - "type": "boolean" - }, - "price": { - "type": "string" - }, - "size": { - "type": "string" - }, - "funds": { - "type": "string" - }, - "fee": { - "type": "string" - }, - "feeRate": { - "type": "string" - }, - "feeCurrency": { - "type": "string" - }, - "stop": { - "type": "string" - }, - "tradeType": { - "type": "string" - }, - "type": { + "type": "object", + "properties": { + "cancelledOrderIds": { + "type": "array", + "items": { "type": "string" - }, - "createdAt": { - "type": "integer", - "format": "int64" } } - } + }, + "required": [ + "cancelledOrderIds" + ] } }, "required": [ @@ -44249,8 +43517,8 @@ "responseExamples": [ { "name": "Success", - "data": "{\r\n \"code\": \"200000\",\r\n \"data\": [\r\n {\r\n \"symbol\": \"BTC-USDT\",\r\n \"tradeId\": \"11732720444522497\",\r\n \"orderId\": \"674aab24754b1e00077dbc69\",\r\n \"counterOrderId\": \"674aab1fb26bfb0007a18b67\",\r\n \"side\": \"buy\",\r\n \"liquidity\": \"taker\",\r\n \"forceTaker\": false,\r\n \"price\": \"96999.6\",\r\n \"size\": \"0.00001\",\r\n \"funds\": \"0.969996\",\r\n \"fee\": \"0.000969996\",\r\n \"feeRate\": \"0.001\",\r\n \"feeCurrency\": \"USDT\",\r\n \"stop\": \"\",\r\n \"tradeType\": \"TRADE\",\r\n \"type\": \"limit\",\r\n \"createdAt\": 1732946724082\r\n }\r\n ]\r\n}", - "responseId": 10607, + "data": "{\r\n \"code\": \"200000\",\r\n \"data\": {\r\n \"cancelledOrderIds\": [\r\n \"674a97dfef434f0007efc431\"\r\n ]\r\n }\r\n}", + "responseId": 10604, "ordering": 1 } ], @@ -44264,8 +43532,8 @@ "example": "{\n \"symbol\": \"BTC-USDT\",\n \"orderId\": \"670fd33bf9406e0007ab3945\",\n \"newPrice\": \"30000\",\n \"newSize\": \"0.0001\"\n}", "mediaType": "" }, - "description": ":::tip[]\nIt is recommended to use the **GET /api/v1/hf/fills** endpoint instead of this endpoint\n:::\n\n:::info[Description]\nRequest via this endpoint to get a list of 1000 fills in the last 24 hours. The return value is the data after Pagination, sorted in descending order according to time.\n:::", - "customApiFields": "{\"abandon\":\"abandon\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"General\",\"api-rate-limit-pool\":\"Spot\",\"sdk-service\":\"Spot\",\"sdk-sub-service\":\"Order\",\"sdk-method-name\":\"getRecentTradeHistoryOld\",\"sdk-method-description\":\"Request via this endpoint to get a list of 1000 fills in the last 24 hours. The return value is the data after Pagination, sorted in descending order according to time.\",\"api-rate-limit\":20}" + "description": ":::tip[]\nIt is recommended to use the **DELETE /api/v1/hf/orders/{orderId}** endpoint instead of this endpoint\n:::\n\n:::info[Description]\nThis endpoint can be used to cancel a spot order by orderId.\nThis endpoint only sends cancellation requests. The results of the requests must be obtained by checking the order status or subscribing to websocket.\n:::", + "customApiFields": "{\"abandon\":\"abandon\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"Spot\",\"api-rate-limit-pool\":\"Spot\",\"sdk-service\":\"Spot\",\"sdk-sub-service\":\"Order\",\"sdk-method-name\":\"cancelOrderByOrderIdOld\",\"sdk-method-description\":\"This endpoint can be used to cancel a spot order by orderId. This endpoint only sends cancellation requests. The results of the requests must be obtained by checking the order status or subscribing to websocket.\",\"api-rate-limit\":3}" } }, { @@ -44374,20 +43642,73 @@ } }, { - "name": "Add Order - Old", + "name": "Batch Cancel Order - Old", "api": { - "id": "3470333", - "method": "post", + "id": "3470345", + "method": "delete", "path": "/api/v1/orders", "parameters": { - "query": [], + "query": [ + { + "id": "KXIxHhD4qw", + "name": "symbol", + "required": false, + "description": "symbol", + "example": "BTC-USDT", + "type": "string", + "schema": { + "type": "string", + "examples": [ + "BTC-USDT", + "ETH-USDT", + "KCS-USDT" + ] + }, + "enable": true + }, + { + "required": false, + "description": "The type of trading :TRADE(Spot Trading), MARGIN_TRADE(Cross Margin Trading), MARGIN_ISOLATED_TRADE(Isolated Margin Trading), and the default is TRADE to cancel the spot trading orders.", + "type": "string", + "id": "Pt2HaiQzCP", + "enable": true, + "name": "tradeType", + "schema": { + "type": "string", + "enum": [ + "TRADE", + "MARGIN_TRADE", + "MARGIN_ISOLATED_TRADE" + ], + "default": "TRADE", + "x-api-enum": [ + { + "value": "TRADE", + "name": "TRADE", + "description": "Spot Trading" + }, + { + "value": "MARGIN_TRADE", + "name": "MARGIN_TRADE", + "description": "Cross Margin Trading" + }, + { + "value": "MARGIN_ISOLATED_TRADE", + "name": "MARGIN_ISOLATED_TRADE", + "description": "Isolated Margin Trading" + } + ] + }, + "example": "TRADE" + } + ], "path": [], "cookie": [], "header": [] }, "responses": [ { - "id": "10509", + "id": "10572", "code": 200, "name": "OK", "headers": [], @@ -44400,13 +43721,15 @@ "data": { "type": "object", "properties": { - "orderId": { - "type": "string", - "description": "The unique order id generated by the trading system,which can be used later for further actions such as canceling the order." + "cancelledOrderIds": { + "type": "array", + "items": { + "type": "string" + } } }, "required": [ - "orderId" + "cancelledOrderIds" ] } }, @@ -44423,232 +43746,236 @@ "responseExamples": [ { "name": "Success", - "data": "{\r\n \"code\": \"200000\",\r\n \"data\": {\r\n \"orderId\": \"674a8635b38d120007709c0f\"\r\n }\r\n}", - "responseId": 10509, + "data": "{\r\n \"code\": \"200000\",\r\n \"data\": {\r\n \"cancelledOrderIds\": [\r\n \"674a8635b38d120007709c0f\",\r\n \"674a8630439c100007d3bce1\"\r\n ]\r\n }\r\n}", + "responseId": 10572, "ordering": 1 } ], "requestBody": { - "type": "application/json", + "type": "none", "parameters": [], "jsonSchema": { "type": "object", - "properties": { - "clientOid": { - "type": "string", - "description": "Client Order Id,The ClientOid field is a unique ID created by the user(we recommend using a UUID), and can only contain numbers, letters, underscores (_), and hyphens (-). This field is returned when order information is obtained. You can use clientOid to tag your orders. ClientOid is different from the order ID created by the service provider. Please do not initiate requests using the same clientOid. The maximum length for the ClientOid is 40 characters.\n\nPlease remember the orderId created by the service provider, it used to check for updates in order status.", - "examples": [ - "5c52e11203aa677f33e493fb" - ] - }, - "side": { - "type": "string", - "description": "specify if the order is to 'buy' or 'sell'", - "enum": [ - "buy", - "sell" - ], - "examples": [ - "buy" - ], - "x-api-enum": [ - { - "value": "buy", - "name": "", - "description": "" - }, - { - "value": "sell", - "name": "", - "description": "" - } - ] - }, - "symbol": { + "properties": {} + }, + "example": "{\n \"symbol\": \"BTC-USDT\",\n \"orderId\": \"670fd33bf9406e0007ab3945\",\n \"newPrice\": \"30000\",\n \"newSize\": \"0.0001\"\n}", + "mediaType": "" + }, + "description": ":::tip[]\nIt is recommended to use the **DELETE /api/v1/hf/orders/cancelAll** endpoint instead of this endpoint\n:::\n\n:::info[Description]\nRequest via this endpoint to cancel all open orders. The response is a list of ids of the canceled orders.\n:::", + "customApiFields": "{\"abandon\":\"abandon\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"Spot\",\"api-rate-limit-pool\":\"Spot\",\"sdk-service\":\"Spot\",\"sdk-sub-service\":\"Order\",\"sdk-method-name\":\"batchCancelOrderOld\",\"sdk-method-description\":\"Request via this endpoint to cancel all open orders. The response is a list of ids of the canceled orders.\",\"api-rate-limit\":20}" + } + }, + { + "name": "Get Orders List - Old", + "api": { + "id": "3470346", + "method": "get", + "path": "/api/v1/orders", + "parameters": { + "query": [ + { + "id": "M9bgPS6vOj", + "name": "symbol", + "required": false, + "description": "symbol", + "example": "BTC-USDT", + "type": "string", + "schema": { "type": "string", - "description": "symbol", "examples": [ "BTC-USDT", "ETH-USDT", "KCS-USDT" ] }, - "type": { + "enable": true + }, + { + "required": false, + "description": "active or done(done as default), Only list orders with a specific status .", + "type": "string", + "id": "zsUnKYu93V", + "enable": true, + "name": "status", + "schema": { "type": "string", - "description": "specify if the order is an 'limit' order or 'market' order. \n\nThe type of order you specify when you place your order determines whether or not you need to request other parameters and also affects the execution of the matching engine.\n\nWhen placing a limit order, you must specify a price and size. The system will try to match the order according to market price or a price better than market price. If the order cannot be immediately matched, it will stay in the order book until it is matched or the user cancels.\n\nUnlike limit orders, the price for market orders fluctuates with market prices. When placing a market order, you do not need to specify a price, you only need to specify a quantity. Market orders are filled immediately and will not enter the order book. All market orders are takers and a taker fee will be charged.", "enum": [ - "limit", - "market" + "active", + "done" ], - "default": "limit", + "default": "done", "x-api-enum": [ { - "value": "limit", - "name": "limit", - "description": "limit order" + "value": "active", + "name": "active", + "description": "Active order" }, { - "value": "market", - "name": "market", - "description": "market order" + "value": "done", + "name": "done", + "description": "Done orders" } ] - }, - "remark": { - "type": "string", - "description": "Order placement remarks, length cannot exceed 20 characters (ASCII)" - }, - "stp": { + } + }, + { + "required": false, + "description": "buy or sell", + "type": "string", + "id": "dZ29pTedUy", + "enable": true, + "name": "side", + "schema": { "type": "string", - "description": "[Self Trade Prevention](apidog://link/pages/338146) is divided into four strategies: CN, CO, CB , and DC", "enum": [ - "DC", - "CO", - "CN", - "CB" + "buy", + "sell" ], "x-api-enum": [ { - "value": "DC", - "name": "", - "description": "" - }, - { - "value": "CO", - "name": "", - "description": "" - }, - { - "value": "CN", - "name": "", - "description": "" + "value": "buy", + "name": "buy", + "description": "buy" }, { - "value": "CB", - "name": "", - "description": "" + "value": "sell", + "name": "sell", + "description": "sell" } ] - }, - "price": { - "type": "string", - "description": "Specify price for order\n\nWhen placing a limit order, the price must be based on priceIncrement for the trading pair. The price increment (priceIncrement) is the price precision for the trading pair. For example, for the BTC-USDT trading pair, the priceIncrement is 0.00001000. So the price for your orders cannot be less than 0.00001000 and must be a multiple of priceIncrement. Otherwise, the order will return an invalid priceIncrement error." - }, - "size": { - "type": "string", - "description": "Specify quantity for order\n\nWhen **type** is limit, size refers to the amount of trading targets (the asset name written in front) for the trading pair. Teh Size must be based on the baseIncrement of the trading pair. The baseIncrement represents the precision for the trading pair. The size of an order must be a positive-integer multiple of baseIncrement and must be between baseMinSize and baseMaxSize.\n\nWhen **type** is market, select one out of two: size or funds" - }, - "timeInForce": { + } + }, + { + "required": false, + "description": "limit, market, limit_stop or market_stop", + "type": "string", + "id": "YtmMAG6Hsr", + "enable": true, + "name": "type", + "schema": { "type": "string", - "description": "[Time in force](apidog://link/pages/338146) is a special strategy used during trading", "enum": [ - "GTC", - "GTT", - "IOC", - "FOK" + "limit", + "market", + "limit_stop", + "market_stop" ], - "default": "GTC", "x-api-enum": [ { - "value": "GTC", - "name": "", - "description": "" + "value": "limit", + "name": "limit", + "description": "limit" }, { - "value": "GTT", - "name": "", - "description": "" + "value": "market", + "name": "market", + "description": "market" }, { - "value": "IOC", - "name": "", - "description": "" + "value": "limit_stop", + "name": "limit_stop", + "description": "limit_stop" }, { - "value": "FOK", - "name": "", - "description": "" + "value": "market_stop", + "name": "market_stop", + "description": "market_stop" } ] - }, - "postOnly": { - "type": "boolean", - "default": false, - "description": "passive order labels, this is disabled when the order timing strategy is IOC or FOK" - }, - "hidden": { - "type": "boolean", - "description": "Hidden or not (not shown in order book)", - "default": false - }, - "iceberg": { - "type": "boolean", - "description": "Whether or not only visible portions of orders are shown in iceberg orders", - "default": false - }, - "visibleSize": { - "type": "string", - "description": "Maximum visible quantity in iceberg orders" - }, - "cancelAfter": { - "type": "integer", - "format": "int64", - "description": "Cancel after n seconds,the order timing strategy is GTT" - }, - "funds": { - "type": "string", - "description": "When **type** is market, select one out of two: size or funds" - }, - "tradeType": { + } + }, + { + "required": false, + "description": "The type of trading:TRADE - Spot Trading(TRADE as default), MARGIN_TRADE - Cross Margin Trading, MARGIN_ISOLATED_TRADE - Isolated Margin Trading.", + "type": "string", + "id": "e2bW58TtXo", + "enable": true, + "name": "tradeType", + "schema": { "type": "string", - "description": "The type of trading : **TRADE**(Spot Trade), **MARGIN_TRADE** (Margin Trade). Default is **TRADE**. **Note: To improve the system performance and to accelerate order placing and processing, KuCoin has added a new interface for order placing of margin. For traders still using the current interface, please move to the new one as soon as possible. The current one will no longer accept margin orders by May 1st, 2021 (UTC). At the time, KuCoin will notify users via the announcement, please pay attention to it.**", "enum": [ "TRADE", - "MARGIN_TRADE" + "MARGIN_TRADE", + "MARGIN_ISOLATED_TRADE" ], "default": "TRADE", "x-api-enum": [ { "value": "TRADE", "name": "TRADE", - "description": "Spot" + "description": "Spot Trading" }, { "value": "MARGIN_TRADE", "name": "MARGIN_TRADE", - "description": "Margin" + "description": "Cross Margin Trading" + }, + { + "value": "MARGIN_ISOLATED_TRADE", + "name": "MARGIN_ISOLATED_TRADE", + "description": "Isolated Margin Trading" } ] } }, - "required": [ - "symbol", - "side", - "clientOid" - ] - }, - "example": "//limit order\n{\n \"type\": \"limit\",\n \"symbol\": \"BTC-USDT\",\n \"side\": \"buy\",\n \"price\": \"50000\",\n \"size\": \"0.00001\",\n \"clientOid\": \"5c52e11203aa677f33e493fb\",\n \"remark\": \"order remarks\"\n}\n\n//market order 1\n// {\n// \"type\": \"market\",\n// \"symbol\": \"BTC-USDT\",\n// \"side\": \"buy\",\n// \"size\": \"0.00001\",\n// \"clientOid\": \"5c52e11203aa677f33e493fc\",\n// \"remark\": \"order remarks\"\n// }\n\n//market order 2\n// {\n// \"type\": \"market\",\n// \"symbol\": \"BTC-USDT\",\n// \"side\": \"buy\",\n// \"funds\": \"1\",\n// \"clientOid\": \"5c52e11203aa677f33e493fc\",\n// \"remark\": \"order remarks\"\n// }\n", - "mediaType": "" - }, - "description": ":::tip[]\nIt is recommended to use the **POST /api/v1/hf/orders** endpoint instead of this endpoint\n:::\n\n:::info[Description]\nPlace order to the Spot trading system, you can place two major types of orders: limit and market. Orders can only be placed if your account has sufficient funds. Once an order is placed, your funds will be put on hold for the duration of the order. The amount of funds on hold depends on the order type and parameters specified.\n:::\n\n:::tip[Tips]\nPlease note that once your order enters the order book, the system will freeze the handling fees for the order ahead of time.\n\nBefore placing orders, please be sure to fully understand the meaning of the parameters for each trading pair.\n:::\n\n:::tip[Tips]\nThe maximum number of active orders per account is 2000, with a maximum of 200 active orders per trading pair.(including stop orders).\n:::\n\n**Public order placement request parameters**\n\n| Param | Type | Mandatory | Description |\n| --------- | ------ | --------- | ----------- |\n| clientOid | String | Yes | clientOid, the unique identifier created by the client, use of UUID, with a maximum length of 128 bits. |\n| side | String | Yes | **buy** or **sell** |\n| symbol | String | Yes | symbol, e.g. ETH-BTC |\n| type | String | No | **limit** or **market** (default is **limit**) |\n| remark | String | No | remark, length cannot exceed 50 characters (ASCII) |\n| stp | String | No | self trade prevention, **CN**, **CO**, **CB** or **DC** |\n| tradeType | String | No | The type of trading : **TRADE**(Spot Trade), **MARGIN_TRADE** (Margin Trade). Default is **TRADE**. **Note: To improve the system performance and to accelerate order placing and processing, KuCoin has added a new interface for order placing of margin. For traders still using the current interface, please move to the new one as soon as possible. The current one will no longer accept margin orders by May 1st, 2021 (UTC). At the time, KuCoin will notify users via the announcement, please pay attention to it.** |\n\n##### Additional Request Parameters Required by `limit` Orders\n\n| Param | Type | Mandatory | Description |\n| ----------- | ------- | --------- | ------------ |\n| price | String | Yes | Specify price for currency |\n| size | String | Yes | Specify quantity for currency |\n| timeInForce | String | No | Order timing strategy `GTC`, `GTT`, `IOC`, `FOK` (The default is `GTC`) |\n| cancelAfter | long | No | Cancel after `n` seconds,the order timing strategy is `GTT` |\n| postOnly | boolean | No | passive order labels, this is disabled when the order timing strategy is `IOC` or `FOK` |\n| hidden | boolean | No | Hidden or not (not shown in order book) |\n| iceberg | boolean | No | Whether or not only visible portions of orders are shown in iceberg orders |\n| visibleSize | String | No | Maximum visible quantity in iceberg orders |\n\n##### Additional request parameters required by `market` orders\n\n| Param | Type | Mandatory | Description |\n| ----- | ------ | --------- | ------------------------------------------ |\n| size | String | No | (Select one out of two: `size` or `funds`) |\n| funds | String | No | (Select one out of two: `size` or `funds`) |", - "customApiFields": "{\"abandon\":\"abandon\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"Spot\",\"api-rate-limit-pool\":\"Spot\",\"sdk-service\":\"Spot\",\"sdk-sub-service\":\"Order\",\"sdk-method-name\":\"addOrderOld\",\"sdk-method-description\":\"Place order to the Spot trading system, you can place two major types of orders: limit and market. Orders can only be placed if your account has sufficient funds. Once an order is placed, your funds will be put on hold for the duration of the order. The amount of funds on hold depends on the order type and parameters specified.\",\"api-rate-limit\":2}" - } - }, - { - "name": "Batch Add Orders - Old", - "api": { - "id": "3470342", - "method": "post", - "path": "/api/v1/orders/multi", - "parameters": { - "query": [], + { + "required": false, + "description": "Start time (milisecond)", + "type": "integer", + "id": "85VEoHpEav", + "enable": true, + "name": "startAt", + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "required": false, + "description": "End time (milisecond)", + "type": "integer", + "id": "KCSk3kvfhI", + "enable": true, + "name": "endAt", + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "required": false, + "description": "Current request page.", + "type": "integer", + "id": "2mkDeImcUS", + "enable": true, + "name": "currentPage", + "schema": { + "type": "integer", + "default": 1 + } + }, + { + "required": false, + "description": "Number of results per request. Minimum is 10, maximum is 500.", + "type": "integer", + "id": "Ihi3ZFwAv0", + "enable": true, + "name": "pageSize", + "schema": { + "type": "integer", + "default": 50, + "minimum": 10, + "maximum": 500 + } + } + ], "path": [], "cookie": [], "header": [] }, "responses": [ { - "id": "10603", + "id": "10573", "code": 200, "name": "OK", "headers": [], @@ -44661,14 +43988,32 @@ "data": { "type": "object", "properties": { - "data": { + "currentPage": { + "type": "integer" + }, + "pageSize": { + "type": "integer" + }, + "totalNum": { + "type": "integer" + }, + "totalPage": { + "type": "integer" + }, + "items": { "type": "array", "items": { "type": "object", "properties": { + "id": { + "type": "string" + }, "symbol": { "type": "string" }, + "opType": { + "type": "string" + }, "type": { "type": "string" }, @@ -44684,80 +44029,115 @@ "funds": { "type": "string" }, + "dealFunds": { + "type": "string" + }, + "dealSize": { + "type": "string" + }, + "fee": { + "type": "string" + }, + "feeCurrency": { + "type": "string" + }, "stp": { "type": "string" }, "stop": { "type": "string" }, + "stopTriggered": { + "type": "boolean" + }, "stopPrice": { "type": "string" }, "timeInForce": { "type": "string" }, - "cancelAfter": { - "type": "integer" - }, "postOnly": { "type": "boolean" }, "hidden": { "type": "boolean" }, - "iceberge": { - "type": "boolean" - }, "iceberg": { "type": "boolean" }, "visibleSize": { "type": "string" }, + "cancelAfter": { + "type": "integer" + }, "channel": { "type": "string" }, - "id": { + "clientOid": { "type": "string" }, - "status": { + "remark": { "type": "string" }, - "failMsg": { + "tags": { "type": "string" }, - "clientOid": { + "isActive": { + "type": "boolean" + }, + "cancelExist": { + "type": "boolean" + }, + "createdAt": { + "type": "integer", + "format": "int64" + }, + "tradeType": { "type": "string" } }, "required": [ + "id", "symbol", + "opType", "type", "side", "price", "size", "funds", + "dealFunds", + "dealSize", + "fee", + "feeCurrency", "stp", "stop", + "stopTriggered", "stopPrice", "timeInForce", - "cancelAfter", "postOnly", "hidden", - "iceberge", "iceberg", "visibleSize", + "cancelAfter", "channel", - "id", - "status", - "failMsg", - "clientOid" + "clientOid", + "remark", + "tags", + "isActive", + "cancelExist", + "createdAt", + "tradeType" ] } } }, "required": [ - "data" + "currentPage", + "pageSize", + "totalNum", + "totalPage", + "items" ] } }, @@ -44774,256 +44154,460 @@ "responseExamples": [ { "name": "Success", - "data": "{\r\n \"code\": \"200000\",\r\n \"data\": {\r\n \"data\": [\r\n {\r\n \"symbol\": \"BTC-USDT\",\r\n \"type\": \"limit\",\r\n \"side\": \"buy\",\r\n \"price\": \"50000\",\r\n \"size\": \"0.0001\",\r\n \"funds\": null,\r\n \"stp\": \"\",\r\n \"stop\": \"\",\r\n \"stopPrice\": null,\r\n \"timeInForce\": \"GTC\",\r\n \"cancelAfter\": 0,\r\n \"postOnly\": false,\r\n \"hidden\": false,\r\n \"iceberge\": false,\r\n \"iceberg\": false,\r\n \"visibleSize\": null,\r\n \"channel\": \"API\",\r\n \"id\": \"674a97dfef434f0007efc431\",\r\n \"status\": \"success\",\r\n \"failMsg\": null,\r\n \"clientOid\": \"3d07008668054da6b3cb12e432c2b13a\"\r\n },\r\n {\r\n \"symbol\": \"BTC-USDT\",\r\n \"type\": \"limit\",\r\n \"side\": \"buy\",\r\n \"price\": \"49999\",\r\n \"size\": \"0.0001\",\r\n \"funds\": null,\r\n \"stp\": \"\",\r\n \"stop\": \"\",\r\n \"stopPrice\": null,\r\n \"timeInForce\": \"GTC\",\r\n \"cancelAfter\": 0,\r\n \"postOnly\": false,\r\n \"hidden\": false,\r\n \"iceberge\": false,\r\n \"iceberg\": false,\r\n \"visibleSize\": null,\r\n \"channel\": \"API\",\r\n \"id\": \"674a97dffb378b00077b9c20\",\r\n \"status\": \"fail\",\r\n \"failMsg\": \"Balance insufficient!\",\r\n \"clientOid\": \"37245dbe6e134b5c97732bfb36cd4a9d\"\r\n }\r\n ]\r\n }\r\n}", - "responseId": 10603, + "data": "{\r\n \"code\": \"200000\",\r\n \"data\": {\r\n \"currentPage\": 1,\r\n \"pageSize\": 50,\r\n \"totalNum\": 1,\r\n \"totalPage\": 1,\r\n \"items\": [\r\n {\r\n \"id\": \"674a9a872033a50007e2790d\",\r\n \"symbol\": \"BTC-USDT\",\r\n \"opType\": \"DEAL\",\r\n \"type\": \"limit\",\r\n \"side\": \"buy\",\r\n \"price\": \"50000\",\r\n \"size\": \"0.00001\",\r\n \"funds\": \"0\",\r\n \"dealFunds\": \"0\",\r\n \"dealSize\": \"0\",\r\n \"fee\": \"0\",\r\n \"feeCurrency\": \"USDT\",\r\n \"stp\": \"\",\r\n \"stop\": \"\",\r\n \"stopTriggered\": false,\r\n \"stopPrice\": \"0\",\r\n \"timeInForce\": \"GTC\",\r\n \"postOnly\": false,\r\n \"hidden\": false,\r\n \"iceberg\": false,\r\n \"visibleSize\": \"0\",\r\n \"cancelAfter\": 0,\r\n \"channel\": \"API\",\r\n \"clientOid\": \"5c52e11203aa677f33e4923fb\",\r\n \"remark\": \"order remarks\",\r\n \"tags\": null,\r\n \"isActive\": false,\r\n \"cancelExist\": true,\r\n \"createdAt\": 1732942471752,\r\n \"tradeType\": \"TRADE\"\r\n }\r\n ]\r\n }\r\n}", + "responseId": 10573, "ordering": 1 } ], "requestBody": { - "type": "application/json", + "type": "none", "parameters": [], "jsonSchema": { "type": "object", - "properties": { - "orderList": { - "type": "array", - "items": { + "properties": {} + }, + "example": "{\n \"symbol\": \"BTC-USDT\",\n \"orderId\": \"670fd33bf9406e0007ab3945\",\n \"newPrice\": \"30000\",\n \"newSize\": \"0.0001\"\n}", + "mediaType": "" + }, + "description": ":::tip[]\nIt is recommended to use the **GET /api/v1/hf/orders/active** endpoint instead of this endpoint\n:::\n\n:::info[Description]\nRequest via this endpoint to get your current order list. The return value is the data after Pagination, sorted in descending order according to time.\n:::\n\n:::tip[Tips]\nWhen you query orders in active status, there is no time limit. However, when you query orders in done status, the start and end time range cannot exceed 7* 24 hours. An error will occur if the specified time window exceeds the range. If you specify the end time only, the system will automatically calculate the start time as end time minus 7*24 hours, and vice versa.\n\nThe history for cancelled orders is only kept for one month. The history for Filled orders is only kept for six month.\n:::", + "customApiFields": "{\"abandon\":\"abandon\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"General\",\"api-rate-limit-pool\":\"Spot\",\"sdk-service\":\"Spot\",\"sdk-sub-service\":\"Order\",\"sdk-method-name\":\"getOrdersListOld\",\"sdk-method-description\":\"Request via this endpoint to get your current order list. The return value is the data after Pagination, sorted in descending order according to time.\",\"api-rate-limit\":2}" + } + }, + { + "name": "Get Recent Orders List - Old", + "api": { + "id": "3470347", + "method": "get", + "path": "/api/v1/limit/orders", + "parameters": { + "query": [ + { + "required": false, + "description": "Current request page.", + "type": "integer", + "id": "2mkDeImcUS", + "enable": true, + "name": "currentPage", + "schema": { + "type": "integer", + "default": 1 + } + }, + { + "required": false, + "description": "Number of results per request. Minimum is 10, maximum is 500.", + "type": "integer", + "id": "Ihi3ZFwAv0", + "enable": true, + "name": "pageSize", + "schema": { + "type": "integer", + "default": 50, + "minimum": 10, + "maximum": 500 + } + } + ], + "path": [], + "cookie": [], + "header": [] + }, + "responses": [ + { + "id": "10574", + "code": 200, + "name": "OK", + "headers": [], + "jsonSchema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "symbol": { + "type": "string" + }, + "opType": { + "type": "string" + }, + "type": { + "type": "string" + }, + "side": { + "type": "string" + }, + "price": { + "type": "string" + }, + "size": { + "type": "string" + }, + "funds": { + "type": "string" + }, + "dealFunds": { + "type": "string" + }, + "dealSize": { + "type": "string" + }, + "fee": { + "type": "string" + }, + "feeCurrency": { + "type": "string" + }, + "stp": { + "type": "string" + }, + "stop": { + "type": "string" + }, + "stopTriggered": { + "type": "boolean" + }, + "stopPrice": { + "type": "string" + }, + "timeInForce": { + "type": "string" + }, + "postOnly": { + "type": "boolean" + }, + "hidden": { + "type": "boolean" + }, + "iceberg": { + "type": "boolean" + }, + "visibleSize": { + "type": "string" + }, + "cancelAfter": { + "type": "integer" + }, + "channel": { + "type": "string" + }, + "clientOid": { + "type": "string" + }, + "remark": { + "type": "string" + }, + "tags": { + "type": "string" + }, + "isActive": { + "type": "boolean" + }, + "cancelExist": { + "type": "boolean" + }, + "createdAt": { + "type": "integer", + "format": "int64" + }, + "tradeType": { + "type": "string" + } + }, + "required": [ + "id", + "symbol", + "opType", + "type", + "side", + "price", + "size", + "funds", + "dealFunds", + "dealSize", + "fee", + "feeCurrency", + "stp", + "stop", + "stopTriggered", + "stopPrice", + "timeInForce", + "postOnly", + "hidden", + "iceberg", + "visibleSize", + "cancelAfter", + "channel", + "clientOid", + "remark", + "tags", + "isActive", + "cancelExist", + "createdAt", + "tradeType" + ] + } + } + }, + "required": [ + "code", + "data" + ] + }, + "description": "", + "contentType": "json", + "mediaType": "" + } + ], + "responseExamples": [ + { + "name": "Success", + "data": "{\r\n \"code\": \"200000\",\r\n \"data\": [\r\n {\r\n \"id\": \"674a9a872033a50007e2790d\",\r\n \"symbol\": \"BTC-USDT\",\r\n \"opType\": \"DEAL\",\r\n \"type\": \"limit\",\r\n \"side\": \"buy\",\r\n \"price\": \"50000\",\r\n \"size\": \"0.00001\",\r\n \"funds\": \"0\",\r\n \"dealFunds\": \"0\",\r\n \"dealSize\": \"0\",\r\n \"fee\": \"0\",\r\n \"feeCurrency\": \"USDT\",\r\n \"stp\": \"\",\r\n \"stop\": \"\",\r\n \"stopTriggered\": false,\r\n \"stopPrice\": \"0\",\r\n \"timeInForce\": \"GTC\",\r\n \"postOnly\": false,\r\n \"hidden\": false,\r\n \"iceberg\": false,\r\n \"visibleSize\": \"0\",\r\n \"cancelAfter\": 0,\r\n \"channel\": \"API\",\r\n \"clientOid\": \"5c52e11203aa677f33e4923fb\",\r\n \"remark\": \"order remarks\",\r\n \"tags\": null,\r\n \"isActive\": false,\r\n \"cancelExist\": true,\r\n \"createdAt\": 1732942471752,\r\n \"tradeType\": \"TRADE\"\r\n }\r\n ]\r\n}", + "responseId": 10574, + "ordering": 1 + } + ], + "requestBody": { + "type": "none", + "parameters": [], + "jsonSchema": { + "type": "object", + "properties": {} + }, + "example": "{\n \"symbol\": \"BTC-USDT\",\n \"orderId\": \"670fd33bf9406e0007ab3945\",\n \"newPrice\": \"30000\",\n \"newSize\": \"0.0001\"\n}", + "mediaType": "" + }, + "description": ":::tip[]\nIt is recommended to use the **GET /api/v1/hf/orders/active** endpoint instead of this endpoint\n:::\n\n:::info[Description]\nRequest via this endpoint to get 1000 orders in the last 24 hours. The return value is the data after Pagination, sorted in descending order according to time.\n:::", + "customApiFields": "{\"abandon\":\"abandon\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"General\",\"api-rate-limit-pool\":\"Spot\",\"sdk-service\":\"Spot\",\"sdk-sub-service\":\"Order\",\"sdk-method-name\":\"getRecentOrdersListOld\",\"sdk-method-description\":\"Request via this endpoint to get your current order list. The return value is the data after Pagination, sorted in descending order according to time.\",\"api-rate-limit\":3}" + } + }, + { + "name": "Get Order By OrderId - Old", + "api": { + "id": "3470348", + "method": "get", + "path": "/api/v1/orders/{orderId}", + "parameters": { + "query": [], + "path": [ + { + "id": "orderId#0", + "name": "orderId", + "required": true, + "description": "The unique order id generated by the trading system", + "type": "string", + "enable": true, + "example": "674a97dfef434f0007efc431" + } + ], + "cookie": [], + "header": [] + }, + "responses": [ + { + "id": "10605", + "code": 200, + "name": "OK", + "headers": [], + "jsonSchema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { "type": "object", "properties": { - "clientOid": { - "type": "string", - "description": "Client Order Id,The ClientOid field is a unique ID created by the user(we recommend using a UUID), and can only contain numbers, letters, underscores (_), and hyphens (-). This field is returned when order information is obtained. You can use clientOid to tag your orders. ClientOid is different from the order ID created by the service provider. Please do not initiate requests using the same clientOid. The maximum length for the ClientOid is 40 characters.\n\nPlease remember the orderId created by the service provider, it used to check for updates in order status.", - "examples": [ - "5c52e11203aa677f33e493fb" - ] - }, - "side": { - "type": "string", - "description": "specify if the order is to 'buy' or 'sell'", - "enum": [ - "buy", - "sell" - ], - "examples": [ - "buy" - ], - "x-api-enum": [ - { - "value": "buy", - "name": "", - "description": "" - }, - { - "value": "sell", - "name": "", - "description": "" - } - ] + "id": { + "type": "string" }, "symbol": { - "type": "string", - "description": "symbol", - "examples": [ - "BTC-USDT", - "ETH-USDT", - "KCS-USDT" - ] + "type": "string" }, - "type": { - "type": "string", - "description": "only limit (default is limit)", - "enum": [ - "limit" - ], - "default": "limit", - "x-api-enum": [ - { - "value": "limit", - "name": "limit", - "description": "limit order" - } - ] + "opType": { + "type": "string" }, - "remark": { - "type": "string", - "description": "Order placement remarks, length cannot exceed 20 characters (ASCII)" + "type": { + "type": "string" }, - "stp": { - "type": "string", - "description": "[Self Trade Prevention](apidog://link/pages/338146) is divided into four strategies: CN, CO, CB , and DC", - "enum": [ - "DC", - "CO", - "CN", - "CB" - ], - "x-api-enum": [ - { - "value": "DC", - "name": "", - "description": "" - }, - { - "value": "CO", - "name": "", - "description": "" - }, - { - "value": "CN", - "name": "", - "description": "" - }, - { - "value": "CB", - "name": "", - "description": "" - } - ] + "side": { + "type": "string" }, "price": { - "type": "string", - "description": "Specify price for order\n\nWhen placing a limit order, the price must be based on priceIncrement for the trading pair. The price increment (priceIncrement) is the price precision for the trading pair. For example, for the BTC-USDT trading pair, the priceIncrement is 0.00001000. So the price for your orders cannot be less than 0.00001000 and must be a multiple of priceIncrement. Otherwise, the order will return an invalid priceIncrement error." + "type": "string" }, "size": { - "type": "string", - "description": "Specify quantity for order\n\nWhen **type** is limit, size refers to the amount of trading targets (the asset name written in front) for the trading pair. Teh Size must be based on the baseIncrement of the trading pair. The baseIncrement represents the precision for the trading pair. The size of an order must be a positive-integer multiple of baseIncrement and must be between baseMinSize and baseMaxSize.\n\nWhen **type** is market, select one out of two: size or funds" + "type": "string" }, - "timeInForce": { - "type": "string", - "description": "[Time in force](apidog://link/pages/338146) is a special strategy used during trading", - "enum": [ - "GTC", - "GTT", - "IOC", - "FOK" - ], - "default": "GTC", - "x-api-enum": [ - { - "value": "GTC", - "name": "", - "description": "" - }, - { - "value": "GTT", - "name": "", - "description": "" - }, - { - "value": "IOC", - "name": "", - "description": "" - }, - { - "value": "FOK", - "name": "", - "description": "" - } - ] + "funds": { + "type": "string" + }, + "dealFunds": { + "type": "string" + }, + "dealSize": { + "type": "string" + }, + "fee": { + "type": "string" + }, + "feeCurrency": { + "type": "string" + }, + "stp": { + "type": "string" + }, + "stop": { + "type": "string" + }, + "stopTriggered": { + "type": "boolean" + }, + "stopPrice": { + "type": "string" + }, + "timeInForce": { + "type": "string" }, "postOnly": { - "type": "boolean", - "default": false, - "description": "passive order labels, this is disabled when the order timing strategy is IOC or FOK" + "type": "boolean" }, "hidden": { - "type": "boolean", - "description": "Hidden or not (not shown in order book)", - "default": false + "type": "boolean" }, "iceberg": { - "type": "boolean", - "description": "Whether or not only visible portions of orders are shown in iceberg orders", - "default": false + "type": "boolean" }, "visibleSize": { - "type": "string", - "description": "Maximum visible quantity in iceberg orders" + "type": "string" }, "cancelAfter": { - "type": "integer", - "format": "int64", - "description": "Cancel after n seconds,the order timing strategy is GTT" + "type": "integer" }, - "tradeType": { - "type": "string", - "description": "The type of trading : **TRADE**(Spot Trade)", - "enum": [ - "TRADE" - ], - "default": "TRADE", - "x-api-enum": [ - { - "value": "TRADE", - "name": "TRADE", - "description": "Spot" - } - ] + "channel": { + "type": "string" }, - "stop": { - "type": "string", - "description": "Either loss or entry. Requires stopPrice to be defined", - "enum": [ - "loss", - "entry" - ], - "x-api-enum": [ - { - "value": "loss", - "name": "loss", - "description": "<=" - }, - { - "value": "entry", - "name": "entry", - "description": ">=" - } - ] + "clientOid": { + "type": "string" }, - "stopPrice": { - "type": "string", - "description": "Stop price, Need to be defined if stop is specified." + "remark": { + "type": "string" + }, + "tags": { + "type": "string" + }, + "isActive": { + "type": "boolean" + }, + "cancelExist": { + "type": "boolean" + }, + "createdAt": { + "type": "integer", + "format": "int64" + }, + "tradeType": { + "type": "string" } }, "required": [ + "id", "symbol", + "opType", + "type", "side", - "clientOid", "price", - "size" + "size", + "funds", + "dealFunds", + "dealSize", + "fee", + "feeCurrency", + "stp", + "stop", + "stopTriggered", + "stopPrice", + "timeInForce", + "postOnly", + "hidden", + "iceberg", + "visibleSize", + "cancelAfter", + "channel", + "clientOid", + "remark", + "tags", + "isActive", + "cancelExist", + "createdAt", + "tradeType" ] } }, - "symbol": { - "type": "string" - } + "required": [ + "code", + "data" + ] }, - "required": [ - "symbol" - ] + "description": "", + "contentType": "json", + "mediaType": "" + } + ], + "responseExamples": [ + { + "name": "Success", + "data": "{\r\n \"code\": \"200000\",\r\n \"data\": {\r\n \"id\": \"674a97dfef434f0007efc431\",\r\n \"symbol\": \"BTC-USDT\",\r\n \"opType\": \"DEAL\",\r\n \"type\": \"limit\",\r\n \"side\": \"buy\",\r\n \"price\": \"50000\",\r\n \"size\": \"0.0001\",\r\n \"funds\": \"0\",\r\n \"dealFunds\": \"0\",\r\n \"dealSize\": \"0\",\r\n \"fee\": \"0\",\r\n \"feeCurrency\": \"USDT\",\r\n \"stp\": \"\",\r\n \"stop\": \"\",\r\n \"stopTriggered\": false,\r\n \"stopPrice\": \"0\",\r\n \"timeInForce\": \"GTC\",\r\n \"postOnly\": false,\r\n \"hidden\": false,\r\n \"iceberg\": false,\r\n \"visibleSize\": \"0\",\r\n \"cancelAfter\": 0,\r\n \"channel\": \"API\",\r\n \"clientOid\": \"3d07008668054da6b3cb12e432c2b13a\",\r\n \"remark\": null,\r\n \"tags\": null,\r\n \"isActive\": false,\r\n \"cancelExist\": true,\r\n \"createdAt\": 1732941791518,\r\n \"tradeType\": \"TRADE\"\r\n }\r\n}", + "responseId": 10605, + "ordering": 1 + } + ], + "requestBody": { + "type": "none", + "parameters": [], + "jsonSchema": { + "type": "object", + "properties": {} }, - "example": "{\n \"symbol\": \"BTC-USDT\",\n \"orderList\": [\n {\n \"clientOid\": \"3d07008668054da6b3cb12e432c2b13a\",\n \"side\": \"buy\",\n \"type\": \"limit\",\n \"price\": \"50000\",\n \"size\": \"0.0001\"\n },\n {\n \"clientOid\": \"37245dbe6e134b5c97732bfb36cd4a9d\",\n \"side\": \"buy\",\n \"type\": \"limit\",\n \"price\": \"49999\",\n \"size\": \"0.0001\"\n }\n ]\n}", + "example": "{\n \"symbol\": \"BTC-USDT\",\n \"orderId\": \"670fd33bf9406e0007ab3945\",\n \"newPrice\": \"30000\",\n \"newSize\": \"0.0001\"\n}", "mediaType": "" }, - "description": ":::tip[]\nIt is recommended to use the **POST /api/v1/hf/orders/multi** endpoint instead of this endpoint\n:::\n\n:::info[Description]\nRequest via this endpoint to place 5 orders at the same time. The order type must be a limit order of the same symbol.\n:::", - "customApiFields": "{\"abandon\":\"abandon\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"Spot\",\"api-rate-limit-pool\":\"Spot\",\"sdk-service\":\"Spot\",\"sdk-sub-service\":\"Order\",\"sdk-method-name\":\"batchAddOrdersOld\",\"sdk-method-description\":\"Request via this endpoint to place 5 orders at the same time. The order type must be a limit order of the same symbol.\",\"api-rate-limit\":3}" + "description": ":::tip[]\nIt is recommended to use the **GET /api/v1/hf/orders/{orderId}** endpoint instead of this endpoint\n:::\n\n:::info[Description]\nRequest via this endpoint to get a single order info by order ID.\n:::", + "customApiFields": "{\"abandon\":\"abandon\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"General\",\"api-rate-limit-pool\":\"Spot\",\"sdk-service\":\"Spot\",\"sdk-sub-service\":\"Order\",\"sdk-method-name\":\"getOrderByOrderIdOld\",\"sdk-method-description\":\"Request via this endpoint to get a single order info by order ID.\",\"api-rate-limit\":2}" } }, { - "name": "Add Order Test - Old", + "name": "Get Order By ClientOid - Old", "api": { - "id": "3470341", - "method": "post", - "path": "/api/v1/orders/test", + "id": "3470349", + "method": "get", + "path": "/api/v1/order/client-order/{clientOid}", "parameters": { "query": [], - "path": [], + "path": [ + { + "id": "clientOid#0", + "name": "clientOid", + "required": true, + "description": "Unique order id created by users to identify their orders", + "type": "string", + "enable": true, + "example": "3d07008668054da6b3cb12e432c2b13a" + } + ], "cookie": [], "header": [] }, "responses": [ { - "id": "10602", + "id": "10575", "code": 200, "name": "OK", "headers": [], @@ -45036,13 +44620,129 @@ "data": { "type": "object", "properties": { - "orderId": { - "type": "string", - "description": "The unique order id generated by the trading system,which can be used later for further actions such as canceling the order." + "id": { + "type": "string" + }, + "symbol": { + "type": "string" + }, + "opType": { + "type": "string" + }, + "type": { + "type": "string" + }, + "side": { + "type": "string" + }, + "price": { + "type": "string" + }, + "size": { + "type": "string" + }, + "funds": { + "type": "string" + }, + "dealFunds": { + "type": "string" + }, + "dealSize": { + "type": "string" + }, + "fee": { + "type": "string" + }, + "feeCurrency": { + "type": "string" + }, + "stp": { + "type": "string" + }, + "stop": { + "type": "string" + }, + "stopTriggered": { + "type": "boolean" + }, + "stopPrice": { + "type": "string" + }, + "timeInForce": { + "type": "string" + }, + "postOnly": { + "type": "boolean" + }, + "hidden": { + "type": "boolean" + }, + "iceberg": { + "type": "boolean" + }, + "visibleSize": { + "type": "string" + }, + "cancelAfter": { + "type": "integer" + }, + "channel": { + "type": "string" + }, + "clientOid": { + "type": "string" + }, + "remark": { + "type": "string" + }, + "tags": { + "type": "string" + }, + "isActive": { + "type": "boolean" + }, + "cancelExist": { + "type": "boolean" + }, + "createdAt": { + "type": "integer", + "format": "int64" + }, + "tradeType": { + "type": "string" } }, "required": [ - "orderId" + "id", + "symbol", + "opType", + "type", + "side", + "price", + "size", + "funds", + "dealFunds", + "dealSize", + "fee", + "feeCurrency", + "stp", + "stop", + "stopTriggered", + "stopPrice", + "timeInForce", + "postOnly", + "hidden", + "iceberg", + "visibleSize", + "cancelAfter", + "channel", + "clientOid", + "remark", + "tags", + "isActive", + "cancelExist", + "createdAt", + "tradeType" ] } }, @@ -45059,951 +44759,535 @@ "responseExamples": [ { "name": "Success", - "data": "{\r\n \"code\": \"200000\",\r\n \"data\": {\r\n \"orderId\": \"674a8776291d9e00074f1edf\"\r\n }\r\n}", - "responseId": 10602, + "data": "{\r\n \"code\": \"200000\",\r\n \"data\": {\r\n \"id\": \"674a97dfef434f0007efc431\",\r\n \"symbol\": \"BTC-USDT\",\r\n \"opType\": \"DEAL\",\r\n \"type\": \"limit\",\r\n \"side\": \"buy\",\r\n \"price\": \"50000\",\r\n \"size\": \"0.0001\",\r\n \"funds\": \"0\",\r\n \"dealFunds\": \"0\",\r\n \"dealSize\": \"0\",\r\n \"fee\": \"0\",\r\n \"feeCurrency\": \"USDT\",\r\n \"stp\": \"\",\r\n \"stop\": \"\",\r\n \"stopTriggered\": false,\r\n \"stopPrice\": \"0\",\r\n \"timeInForce\": \"GTC\",\r\n \"postOnly\": false,\r\n \"hidden\": false,\r\n \"iceberg\": false,\r\n \"visibleSize\": \"0\",\r\n \"cancelAfter\": 0,\r\n \"channel\": \"API\",\r\n \"clientOid\": \"3d07008668054da6b3cb12e432c2b13a\",\r\n \"remark\": null,\r\n \"tags\": null,\r\n \"isActive\": false,\r\n \"cancelExist\": true,\r\n \"createdAt\": 1732941791518,\r\n \"tradeType\": \"TRADE\"\r\n }\r\n}", + "responseId": 10575, "ordering": 1 } ], "requestBody": { - "type": "application/json", + "type": "none", "parameters": [], "jsonSchema": { "type": "object", - "properties": { - "clientOid": { + "properties": {} + }, + "example": "{\n \"symbol\": \"BTC-USDT\",\n \"orderId\": \"670fd33bf9406e0007ab3945\",\n \"newPrice\": \"30000\",\n \"newSize\": \"0.0001\"\n}", + "mediaType": "" + }, + "description": ":::tip[]\nIt is recommended to use the **GET /api/v1/hf/orders/client-order/{clientOid}** endpoint instead of this endpoint\n:::\n\n:::info[Description]\nRequest via this interface to check the information of a single active order via clientOid. The system will prompt that the order does not exists if the order does not exist or has been settled.\n:::", + "customApiFields": "{\"abandon\":\"abandon\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"General\",\"api-rate-limit-pool\":\"Spot\",\"sdk-service\":\"Spot\",\"sdk-sub-service\":\"Order\",\"sdk-method-name\":\"getOrderByClientOidOld\",\"sdk-method-description\":\"Request via this interface to check the information of a single active order via clientOid. The system will prompt that the order does not exists if the order does not exist or has been settled.\",\"api-rate-limit\":3}" + } + }, + { + "name": "Get Trade History - Old", + "api": { + "id": "3470350", + "method": "get", + "path": "/api/v1/fills", + "parameters": { + "query": [ + { + "id": "M9bgPS6vOj", + "name": "symbol", + "required": true, + "description": "symbol", + "example": "BTC-USDT", + "type": "string", + "schema": { "type": "string", - "description": "Client Order Id,The ClientOid field is a unique ID created by the user(we recommend using a UUID), and can only contain numbers, letters, underscores (_), and hyphens (-). This field is returned when order information is obtained. You can use clientOid to tag your orders. ClientOid is different from the order ID created by the service provider. Please do not initiate requests using the same clientOid. The maximum length for the ClientOid is 40 characters.\n\nPlease remember the orderId created by the service provider, it used to check for updates in order status.", "examples": [ - "5c52e11203aa677f33e493fb" + "BTC-USDT", + "ETH-USDT", + "KCS-USDT" ] }, - "side": { + "enable": true + }, + { + "id": "Bc6ZDrZFdp", + "name": "orderId", + "required": false, + "description": "The unique order id generated by the trading system (If orderId is specified,please ignore the other query parameters)", + "type": "string", + "enable": true + }, + { + "id": "sTtMCE9Jhf", + "name": "side", + "required": false, + "description": "specify if the order is to 'buy' or 'sell'", + "type": "string", + "schema": { "type": "string", - "description": "specify if the order is to 'buy' or 'sell'", "enum": [ "buy", "sell" ], - "examples": [ - "buy" - ], "x-api-enum": [ { "value": "buy", - "name": "", - "description": "" + "name": "buy", + "description": "buy" }, { "value": "sell", - "name": "", - "description": "" + "name": "sell", + "description": "sell" } ] }, - "symbol": { - "type": "string", - "description": "symbol", - "examples": [ - "BTC-USDT", - "ETH-USDT", - "KCS-USDT" - ] - }, - "type": { + "enable": true + }, + { + "id": "QaBSxyasEm", + "name": "type", + "required": false, + "description": "limit, market, limit_stop or market_stop\n", + "type": "string", + "schema": { "type": "string", - "description": "specify if the order is an 'limit' order or 'market' order. \n\nThe type of order you specify when you place your order determines whether or not you need to request other parameters and also affects the execution of the matching engine.\n\nWhen placing a limit order, you must specify a price and size. The system will try to match the order according to market price or a price better than market price. If the order cannot be immediately matched, it will stay in the order book until it is matched or the user cancels.\n\nUnlike limit orders, the price for market orders fluctuates with market prices. When placing a market order, you do not need to specify a price, you only need to specify a quantity. Market orders are filled immediately and will not enter the order book. All market orders are takers and a taker fee will be charged.", "enum": [ "limit", - "market" - ], - "default": "limit", - "x-api-enum": [ - { - "value": "limit", - "name": "limit", - "description": "limit order" - }, - { - "value": "market", - "name": "market", - "description": "market order" - } - ] - }, - "remark": { - "type": "string", - "description": "Order placement remarks, length cannot exceed 20 characters (ASCII)" - }, - "stp": { - "type": "string", - "description": "[Self Trade Prevention](apidog://link/pages/338146) is divided into four strategies: CN, CO, CB , and DC", - "enum": [ - "DC", - "CO", - "CN", - "CB" - ], - "x-api-enum": [ - { - "value": "DC", - "name": "", - "description": "" - }, - { - "value": "CO", - "name": "", - "description": "" - }, - { - "value": "CN", - "name": "", - "description": "" - }, - { - "value": "CB", - "name": "", - "description": "" - } - ] - }, - "price": { - "type": "string", - "description": "Specify price for order\n\nWhen placing a limit order, the price must be based on priceIncrement for the trading pair. The price increment (priceIncrement) is the price precision for the trading pair. For example, for the BTC-USDT trading pair, the priceIncrement is 0.00001000. So the price for your orders cannot be less than 0.00001000 and must be a multiple of priceIncrement. Otherwise, the order will return an invalid priceIncrement error." - }, - "size": { - "type": "string", - "description": "Specify quantity for order\n\nWhen **type** is limit, size refers to the amount of trading targets (the asset name written in front) for the trading pair. Teh Size must be based on the baseIncrement of the trading pair. The baseIncrement represents the precision for the trading pair. The size of an order must be a positive-integer multiple of baseIncrement and must be between baseMinSize and baseMaxSize.\n\nWhen **type** is market, select one out of two: size or funds" - }, - "timeInForce": { - "type": "string", - "description": "[Time in force](apidog://link/pages/338146) is a special strategy used during trading", - "enum": [ - "GTC", - "GTT", - "IOC", - "FOK" - ], - "default": "GTC", - "x-api-enum": [ - { - "value": "GTC", - "name": "", - "description": "" - }, - { - "value": "GTT", - "name": "", - "description": "" - }, - { - "value": "IOC", - "name": "", - "description": "" - }, - { - "value": "FOK", - "name": "", - "description": "" - } - ] - }, - "postOnly": { - "type": "boolean", - "default": false, - "description": "passive order labels, this is disabled when the order timing strategy is IOC or FOK" - }, - "hidden": { - "type": "boolean", - "description": "Hidden or not (not shown in order book)", - "default": false - }, - "iceberg": { - "type": "boolean", - "description": "Whether or not only visible portions of orders are shown in iceberg orders", - "default": false - }, - "visibleSize": { - "type": "string", - "description": "Maximum visible quantity in iceberg orders" - }, - "cancelAfter": { - "type": "integer", - "format": "int64", - "description": "Cancel after n seconds,the order timing strategy is GTT" - }, - "funds": { - "type": "string", - "description": "When **type** is market, select one out of two: size or funds" + "market", + "limit_stop", + "market_stop" + ], + "x-api-enum": [ + { + "value": "limit", + "name": "limit", + "description": "limit" + }, + { + "value": "market", + "name": "market", + "description": "market" + }, + { + "value": "limit_stop", + "name": "limit_stop", + "description": "limit_stop" + }, + { + "value": "market_stop", + "name": "market_stop", + "description": "market_stop" + } + ] }, - "tradeType": { + "enable": true + }, + { + "required": false, + "description": "The type of trading:TRADE - Spot Trading(TRADE as default), MARGIN_TRADE - Cross Margin Trading, MARGIN_ISOLATED_TRADE - Isolated Margin Trading.", + "type": "string", + "id": "mgaSumd8UP", + "enable": true, + "name": "tradeType", + "schema": { "type": "string", - "description": "The type of trading : **TRADE**(Spot Trade), **MARGIN_TRADE** (Margin Trade). Default is **TRADE**. **Note: To improve the system performance and to accelerate order placing and processing, KuCoin has added a new interface for order placing of margin. For traders still using the current interface, please move to the new one as soon as possible. The current one will no longer accept margin orders by May 1st, 2021 (UTC). At the time, KuCoin will notify users via the announcement, please pay attention to it.**", "enum": [ "TRADE", - "MARGIN_TRADE" + "MARGIN_TRADE", + "MARGIN_ISOLATED_TRADE" ], "default": "TRADE", "x-api-enum": [ { "value": "TRADE", "name": "TRADE", - "description": "Spot" + "description": "Spot Trading" }, { "value": "MARGIN_TRADE", "name": "MARGIN_TRADE", - "description": "Margin" + "description": "Cross Margin Trading" + }, + { + "value": "MARGIN_ISOLATED_TRADE", + "name": "MARGIN_ISOLATED_TRADE", + "description": "Isolated Margin Trading" } ] } }, - "required": [ - "symbol", - "side", - "clientOid" - ] - }, - "example": "//limit order\n{\n \"type\": \"limit\",\n \"symbol\": \"BTC-USDT\",\n \"side\": \"buy\",\n \"price\": \"50000\",\n \"size\": \"0.00001\",\n \"clientOid\": \"5c52e11203aa677f33e493fb\",\n \"remark\": \"order remarks\"\n}\n\n//market order 1\n// {\n// \"type\": \"market\",\n// \"symbol\": \"BTC-USDT\",\n// \"side\": \"buy\",\n// \"size\": \"0.00001\",\n// \"clientOid\": \"5c52e11203aa677f33e493fc\",\n// \"remark\": \"order remarks\"\n// }\n\n//market order 2\n// {\n// \"type\": \"market\",\n// \"symbol\": \"BTC-USDT\",\n// \"side\": \"buy\",\n// \"funds\": \"1\",\n// \"clientOid\": \"5c52e11203aa677f33e493fc\",\n// \"remark\": \"order remarks\"\n// }\n", - "mediaType": "" - }, - "description": ":::tip[]\nIt is recommended to use the **POST /api/v1/hf/orders/test** endpoint instead of this endpoint\n:::\n\n:::info[Description]\nOrder test endpoint, the request parameters and return parameters of this endpoint are exactly the same as the order endpoint, and can be used to verify whether the signature is correct and other operations. After placing an order, the order will not enter the matching system, and the order cannot be queried.\n:::\n\n:::tip[Tips]\nPlease note that once your order enters the order book, the system will freeze the handling fees for the order ahead of time.\n\nBefore placing orders, please be sure to fully understand the meaning of the parameters for each trading pair.\n:::\n\n:::tip[Tips]\nThe maximum number of active orders per account is 2000, with a maximum of 200 active orders per trading pair.(including stop orders).\n:::\n\n**Public order placement request parameters**\n\n| Param | Type | Mandatory | Description |\n| --------- | ------ | --------- | ----------- |\n| clientOid | String | Yes | clientOid, the unique identifier created by the client, use of UUID, with a maximum length of 128 bits. |\n| side | String | Yes | **buy** or **sell** |\n| symbol | String | Yes | symbol, e.g. ETH-BTC |\n| type | String | No | **limit** or **market** (default is **limit**) |\n| remark | String | No | remark, length cannot exceed 50 characters (ASCII) |\n| stp | String | No | self trade prevention, **CN**, **CO**, **CB** or **DC** |\n| tradeType | String | No | The type of trading : **TRADE**(Spot Trade), **MARGIN_TRADE** (Margin Trade). Default is **TRADE**. **Note: To improve the system performance and to accelerate order placing and processing, KuCoin has added a new interface for order placing of margin. For traders still using the current interface, please move to the new one as soon as possible. The current one will no longer accept margin orders by May 1st, 2021 (UTC). At the time, KuCoin will notify users via the announcement, please pay attention to it.** |\n\n##### Additional Request Parameters Required by `limit` Orders\n\n| Param | Type | Mandatory | Description |\n| ----------- | ------- | --------- | ------------ |\n| price | String | Yes | Specify price for currency |\n| size | String | Yes | Specify quantity for currency |\n| timeInForce | String | No | Order timing strategy `GTC`, `GTT`, `IOC`, `FOK` (The default is `GTC`) |\n| cancelAfter | long | No | Cancel after `n` seconds,the order timing strategy is `GTT` |\n| postOnly | boolean | No | passive order labels, this is disabled when the order timing strategy is `IOC` or `FOK` |\n| hidden | boolean | No | Hidden or not (not shown in order book) |\n| iceberg | boolean | No | Whether or not only visible portions of orders are shown in iceberg orders |\n| visibleSize | String | No | Maximum visible quantity in iceberg orders |\n\n##### Additional request parameters required by `market` orders\n\n| Param | Type | Mandatory | Description |\n| ----- | ------ | --------- | ------------------------------------------ |\n| size | String | No | (Select one out of two: `size` or `funds`) |\n| funds | String | No | (Select one out of two: `size` or `funds`) |", - "customApiFields": "{\"abandon\":\"abandon\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"Spot\",\"api-rate-limit-pool\":\"Spot\",\"sdk-service\":\"Spot\",\"sdk-sub-service\":\"Order\",\"sdk-method-name\":\"addOrderTestOld\",\"sdk-method-description\":\"Order test endpoint, the request parameters and return parameters of this endpoint are exactly the same as the order endpoint, and can be used to verify whether the signature is correct and other operations. After placing an order, the order will not enter the matching system, and the order cannot be queried.\",\"api-rate-limit\":2}" - } - } - ] - } - ] - }, - { - "name": "Margin Trading", - "id": 348174, - "description": "", - "items": [ - { - "name": "Get Account Detail - Margin", - "api": { - "id": "3470311", - "method": "get", - "path": "/api/v1/margin/account", - "parameters": { - "path": [], - "query": [], - "cookie": [], - "header": [] - }, - "responses": [ - { - "id": "10475", - "code": 200, - "name": "OK", - "headers": [], - "jsonSchema": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "data": { - "type": "object", - "properties": { - "debtRatio": { - "type": "string", - "description": "Debt ratio" - }, - "accounts": { - "type": "array", - "items": { - "type": "object", - "properties": { - "currency": { - "type": "string", - "description": "Currency" - }, - "totalBalance": { - "type": "string", - "description": "Total funds in the account" - }, - "availableBalance": { - "type": "string", - "description": "Available funds in the account" - }, - "holdBalance": { - "type": "string", - "description": "Funds on hold in the account" - }, - "liability": { - "type": "string", - "description": "Total liabilities" - }, - "maxBorrowSize": { - "type": "string", - "description": "Available size to borrow" - } - }, - "required": [ - "currency", - "totalBalance", - "availableBalance", - "holdBalance", - "liability", - "maxBorrowSize" - ] - }, - "description": "Margin account list" - } + { + "id": "Djtx6oC9gm", + "name": "startAt", + "required": false, + "description": "Start time (milisecond)", + "example": "1728663338000", + "type": "integer", + "schema": { + "type": "integer", + "format": "int64" }, - "required": [ - "debtRatio", - "accounts" - ] - } - }, - "required": [ - "code", - "data" - ] - }, - "description": "", - "contentType": "json", - "mediaType": "" - } - ], - "responseExamples": [ - { - "name": "Success", - "data": "{\n \"code\": \"200000\",\n \"data\": {\n \"debtRatio\": \"0\",\n \"accounts\": [\n {\n \"currency\": \"USDT\",\n \"totalBalance\": \"0.03\",\n \"availableBalance\": \"0.02\",\n \"holdBalance\": \"0.01\",\n \"liability\": \"0\",\n \"maxBorrowSize\": \"0\"\n }\n ]\n }\n}", - "responseId": 10475, - "ordering": 1 - } - ], - "requestBody": { - "type": "none", - "parameters": [], - "jsonSchema": { - "type": "object", - "properties": {} - }, - "mediaType": "" - }, - "description": ":::tip[TIPS]\nIt is recommended to use the **GET /api/v3/margin/accounts** endpoint instead of this endpoint\n:::\n\n:::info[Description]\nRequest via this endpoint to get the info of the margin account.\n:::", - "customApiFields": "{\"abandon\":\"abandon\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"General\",\"api-rate-limit-pool\":\"Spot\",\"sdk-service\":\"Account\",\"sdk-sub-service\":\"Account\",\"sdk-method-name\":\"getMarginAccountDetail\",\"sdk-method-description\":\"Request via this endpoint to get the info of the margin account.\",\"api-rate-limit\":40}" - } - }, - { - "name": "Add Order - V1", - "api": { - "id": "3470312", - "method": "post", - "path": "/api/v1/margin/order", - "parameters": { - "query": [], - "path": [], - "cookie": [], - "header": [] - }, - "responses": [ - { - "id": "10476", - "code": 200, - "name": "OK", - "headers": [], - "jsonSchema": { - "type": "object", - "properties": { - "code": { - "type": "string" + "enable": true }, - "data": { - "type": "object", - "properties": { - "orderId": { - "type": "string", - "description": "The unique order id generated by the trading system,which can be used later for further actions such as canceling the order." - }, - "loanApplyId": { - "type": "string", - "description": "Borrow order id. The field is returned only after placing the order under the mode of Auto-Borrow." - }, - "borrowSize": { - "type": "string", - "description": "Borrowed amount. The field is returned only after placing the order under the mode of Auto-Borrow." - }, - "clientOid": { - "type": "string", - "description": "This return value is invalid" - } - }, - "required": [ - "orderId", - "loanApplyId", - "borrowSize", - "clientOid" - ] - } - }, - "required": [ - "code", - "data" - ] - }, - "description": "", - "contentType": "json", - "mediaType": "" - } - ], - "responseExamples": [ - { - "name": "Success", - "data": "{\n \"code\": \"200000\",\n \"data\": {\n \"orderId\": \"671bb90194422f00073ff4f0\",\n \"loanApplyId\": null,\n \"borrowSize\": null,\n \"clientOid\": null\n }\n}", - "responseId": 10476, - "ordering": 1 - } - ], - "requestBody": { - "type": "application/json", - "parameters": [], - "jsonSchema": { - "type": "object", - "properties": { - "clientOid": { - "type": "string", - "description": "Client Order Id,The ClientOid field is a unique ID created by the user(we recommend using a UUID), and can only contain numbers, letters, underscores (_), and hyphens (-). This field is returned when order information is obtained. You can use clientOid to tag your orders. ClientOid is different from the order ID created by the service provider. Please do not initiate requests using the same clientOid. The maximum length for the ClientOid is 40 characters.\n\nPlease remember the orderId created by the service provider, it used to check for updates in order status.", - "examples": [ - "5c52e11203aa677f33e493fb" - ] - }, - "side": { - "type": "string", - "description": "specify if the order is to 'buy' or 'sell'", - "enum": [ - "buy", - "sell" - ], - "examples": [ - "buy" - ], - "x-api-enum": [ - { - "value": "buy", - "name": "", - "description": "" - }, - { - "value": "sell", - "name": "", - "description": "" - } - ] - }, - "symbol": { - "type": "string", - "description": "symbol", - "examples": [ - "BTC-USDT", - "ETH-USDT", - "KCS-USDT" - ] - }, - "type": { - "type": "string", - "description": "specify if the order is an 'limit' order or 'market' order. \n\nThe type of order you specify when you place your order determines whether or not you need to request other parameters and also affects the execution of the matching engine.\n\nWhen placing a limit order, you must specify a price and size. The system will try to match the order according to market price or a price better than market price. If the order cannot be immediately matched, it will stay in the order book until it is matched or the user cancels.\n\nUnlike limit orders, the price for market orders fluctuates with market prices. When placing a market order, you do not need to specify a price, you only need to specify a quantity. Market orders are filled immediately and will not enter the order book. All market orders are takers and a taker fee will be charged.", - "enum": [ - "limit", - "market" - ], - "default": "limit", - "x-api-enum": [ - { - "value": "limit", - "name": "", - "description": "" - }, - { - "value": "market", - "name": "", - "description": "" - } - ] - }, - "stp": { - "type": "string", - "description": "[Self Trade Prevention](apidog://link/pages/338146) is divided into four strategies: CN, CO, CB , and DC", - "enum": [ - "DC", - "CO", - "CN", - "CB" - ], - "x-api-enum": [ - { - "value": "DC", - "name": "", - "description": "" - }, - { - "value": "CO", - "name": "", - "description": "" - }, - { - "value": "CN", - "name": "", - "description": "" - }, - { - "value": "CB", - "name": "", - "description": "" - } - ] - }, - "price": { - "type": "string", - "description": "Specify price for order\n\nWhen placing a limit order, the price must be based on priceIncrement for the trading pair. The price increment (priceIncrement) is the price precision for the trading pair. For example, for the BTC-USDT trading pair, the priceIncrement is 0.00001000. So the price for your orders cannot be less than 0.00001000 and must be a multiple of priceIncrement. Otherwise, the order will return an invalid priceIncrement error." - }, - "size": { - "type": "string", - "description": "Specify quantity for order\n\nWhen **type** is limit, size refers to the amount of trading targets (the asset name written in front) for the trading pair. Teh Size must be based on the baseIncrement of the trading pair. The baseIncrement represents the precision for the trading pair. The size of an order must be a positive-integer multiple of baseIncrement and must be between baseMinSize and baseMaxSize.\n\nWhen **type** is market, select one out of two: size or funds" - }, - "timeInForce": { - "type": "string", - "description": "[Time in force](apidog://link/pages/338146) is a special strategy used during trading", - "enum": [ - "GTC", - "GTT", - "IOC", - "FOK" - ], - "default": "GTC", - "x-api-enum": [ - { - "value": "GTC", - "name": "", - "description": "" - }, - { - "value": "GTT", - "name": "", - "description": "" - }, - { - "value": "IOC", - "name": "", - "description": "" - }, - { - "value": "FOK", - "name": "", - "description": "" - } - ] - }, - "postOnly": { - "type": "boolean", - "default": false, - "description": "passive order labels, this is disabled when the order timing strategy is IOC or FOK" - }, - "hidden": { - "type": "boolean", - "description": "Hidden or not (not shown in order book)", - "default": false - }, - "iceberg": { - "type": "boolean", - "description": "Whether or not only visible portions of orders are shown in iceberg orders", - "default": false - }, - "visibleSize": { - "type": "string", - "description": "Maximum visible quantity in iceberg orders" - }, - "cancelAfter": { - "type": "integer", - "format": "int64", - "description": "Cancel after n seconds,the order timing strategy is GTT" - }, - "funds": { - "type": "string", - "description": "When **type** is market, select one out of two: size or funds" - }, - "autoBorrow": { - "type": "boolean", - "description": "When Margin Account has inefficient balance, our system autoborrows inefficient assets and opens positions according to the lowest market interest rate.", - "default": false - }, - "autoRepay": { - "type": "boolean", - "description": "AutoPay allows returning borrowed assets when you close a position. Our system automatically triggers the repayment and the maximum repayment amount equals to the filled-order amount.", - "default": false - }, - "marginModel": { - "type": "string", - "description": "The type of trading, including cross (cross mode) and isolated (isolated mode). It is set at cross by default.", - "enum": [ - "cross", - "isolated" - ], - "default": "cross", - "x-api-enum": [ - { - "value": "cross", - "name": "", - "description": "" + { + "id": "K9IMpKw8u2", + "name": "endAt", + "required": false, + "description": "End time (milisecond)", + "example": "1728692138000", + "type": "integer", + "schema": { + "type": "integer", + "format": "int64" }, - { - "value": "isolated", - "name": "", - "description": "" - } - ] - } - }, - "required": [ - "symbol", - "side", - "clientOid" - ] - }, - "example": "//limit order\n{\n \"type\": \"limit\",\n \"symbol\": \"BTC-USDT\",\n \"side\": \"buy\",\n \"price\": \"50000\",\n \"size\": \"0.00001\",\n \"clientOid\": \"5c52e11203aa677f33e4193fb\",\n \"remark\": \"order remarks\"\n}\n\n//market order 1\n// {\n// \"type\": \"market\",\n// \"symbol\": \"BTC-USDT\",\n// \"side\": \"buy\",\n// \"size\": \"0.00001\",\n// \"clientOid\": \"5c52e11203aa677f33e493fc\",\n// \"remark\": \"order remarks\"\n// }\n\n//market order 2\n// {\n// \"type\": \"market\",\n// \"symbol\": \"BTC-USDT\",\n// \"side\": \"buy\",\n// \"funds\": \"1\",\n// \"clientOid\": \"5c52e11203aa677f33e493fc\",\n// \"remark\": \"order remarks\"\n// }\n", - "mediaType": "" - }, - "description": ":::tip[TIPS]\nIt is recommended to use the **POST /api/v3/hf/margin/order** endpoint instead of this endpoint\n:::\n\n:::info[Description]\nPlace order to the Cross-margin or Isolated-margin trading system, you can place two major types of orders: limit and market. Orders can only be placed if your account has sufficient funds. Once an order is placed, your funds will be put on hold for the duration of the order. The amount of funds on hold depends on the order type and parameters specified.\n:::\n\n:::tip[Tips]\nPlease note that once your order enters the order book, the system will freeze the handling fees for the order ahead of time.\n\nBefore placing orders, please be sure to fully understand the meaning of the parameters for each trading pair.\n:::\n\n:::tip[Tips]\nThe maximum number of active orders per account is 2000, with a maximum of 200 active orders per trading pair.\n:::\n\n\n**Public order placement request parameters**\n\n| Param | Type | Mandatory | Description |\n| --------- | ------ | --------- | ----------- |\n| clientOid | String | Yes | Client Order Id,unique identifier created by the user, the use of UUID is recommended |\n| symbol | String | Yes | symbol |\n| side | String | Yes | `buy` or `sell` |\n| type | String | No | Order type `limit` and `market`, defult is limit |\n| stp | String | No | self trade prevention is divided into four strategies: `CN`, `CO`, `CB` , and `DC` |\n| marginModel | String | No | The type of trading, including cross (cross mode) and isolated (isolated mode). It is set at cross by default. |\n| autoBorrow | boolean | No | When Margin Account has inefficient balance, our system autoborrows inefficient assets and opens positions according to the lowest market interest rate. |\n| autoRepay | boolean | No | AutoPay allows returning borrowed assets when you close a position. Our system automatically triggers the repayment and the maximum repayment amount equals to the filled-order amount. |\n\n**Additional Request Parameters Required by `limit` Orders**\n\n| Param | Type | Mandatory | Description |\n| ----------- | ------- | --------- | ----------- |\n| price | String | Yes | Specify price for currency |\n| size | String | Yes | Specify quantity for currency |\n| timeInForce | String | No | Order timing strategy `GTC`, `GTT`, `IOC`, `FOK` (The default is `GTC`) |\n| cancelAfter | long | No | Cancel after `n` seconds,the order timing strategy is `GTT` |\n| postOnly | boolean | No | passive order labels, this is disabled when the order timing strategy is `IOC` or `FOK` |\n| hidden | boolean | No | Hidden or not (not shown in order book) |\n| iceberg | boolean | No | Whether or not only visible portions of orders are shown in iceberg orders |\n| visibleSize | String | No | Maximum visible quantity in iceberg orders |\n\n**Additional request parameters required by `market` orders**\n\n| Param | Type | Mandatory | Description |\n| ----- | ------ | --------- | ------------------------------------------ |\n| size | String | No | (Select one out of two: `size` or `funds`) |\n| funds | String | No | (Select one out of two: `size` or `funds`) |\n\n\n\n**Hidden Orders and Iceberg Orders (Hidden & Iceberg)**\n\nHidden orders and iceberg orders can be set in advanced settings (iceberg orders are a special type of hidden orders). When placing limit orders or stop limit orders, you can choose to execute according to hidden orders or iceberg orders.\n\nHidden orders are not shown in order books.\n\nUnlike hidden orders, iceberg orders are divided into visible and hidden portions. When engaging in iceberg orders, visible order sizes must be set. The minimum visible size for an iceberg order is 1/20 of the total order size.\n\nWhen matching, the visible portions of iceberg orders are matched first. Once the visible portions are fully matched, hidden portions will emerge. This will continue until the order is fully filled.\n\nNote:\n\n- The system will charge taker fees for hidden orders and iceberg orders.\n- If you simultaneously set iceberg orders and hidden orders, your order will default to an iceberg order for execution.\n\n**Hold**\n\nFor limit price purchase orders, we will hold the amount of funds (price * size) required for your purchase order. Similarly, for limit price sell orders, we will also hold you sell order assets. When the transaction is executed, the service fees will be calculated. If you cancel a portion of a filled or unfilled order, then the remaining funds or amounts will be released and returned to your account. For market price buy/sell orders that require specific funds, we will hold the required funds in from your account. If only the size is specified, we may freeze (usually for a very short amount of time) all of the funds in your account prior to the order being filled or cancelled.\n\n\n**Order Lifecycle**\n\nWhen an order placement request is successful (the matching engine receives the order) or denied (due to there being insufficient funds or illegal parameter values, etc.), the system will respond to the HTTP request. When an order is successfully placed, the order ID is returned. The order will be matched, which could result in it being fully or partially filled. When an order is fully or partially filled, the remaining portions of the order will be in an active state awaiting to be matched (this does not include IOC orders). Orders that are fully or partially filled(already cancelled) will be put into the “done” state.\n\nUsers that have subscribed to the Market Data Channel can use the order ID (orderId) and client ID (clientOid) to identify messages.\n\n**Price Protection Mechanisms**\n\nPrice protection mechanisms ae enabled for order placements. Rules are detailed below:\n\n- If the spot trading market order/limit order placed by the user can be directly matched with an order in the current order book, the system will judge whether deviation between the price corresponding to the transaction depth and the spread exceeds the threshold value (the threshold value can be obtained using the symbol API endpoint);\n\n- If it is exceeded, for limit orders, the order will be directly cancelled;\n\n- If it is a market order, then the system will partially execute the order. The execution limit will be the order size within the price range corresponding to the threshold value. The remaining orders will not be filled.\n\nFor example: if the threshold value is 10%, when a user places a market price purchase order in the KCS/USDT trading market for 10,000 USDT (the selling price is currently 1.20000), the system will determine that after the order is completely filled, the final price will be 1.40000. (1.40000-1.20000)/1.20000=16.7%>10%. The threshold value is 1.32000. The user’s market price purchase order will be filled only to a maximum of 1.32000. The remaining order portions will not be matched with orders in the order book. Note: this feature may not be able to determine depth with complete accuracy. If your order is not completely filled, it may be because the portion exceeding the threshold value was not filled.\n", - "customApiFields": "{\"abandon\":\"abandon\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"Margin\",\"api-rate-limit-pool\":\"Spot\",\"sdk-service\":\"Margin\",\"sdk-sub-service\":\"Order\",\"sdk-method-name\":\"addOrderV1\",\"sdk-method-description\":\"Place order to the Cross-margin or Isolated-margin trading system, you can place two major types of orders: limit and market. Orders can only be placed if your account has sufficient funds. Once an order is placed, your funds will be put on hold for the duration of the order. The amount of funds on hold depends on the order type and parameters specified.\",\"api-rate-limit\":5}" - } - }, - { - "name": "Add Order Test - V1", - "api": { - "id": "3470313", - "method": "post", - "path": "/api/v1/margin/order/test", - "parameters": { - "query": [], - "path": [], - "cookie": [], - "header": [] - }, - "responses": [ - { - "id": "10477", - "code": 200, - "name": "OK", - "headers": [], - "jsonSchema": { - "type": "object", - "properties": { - "code": { - "type": "string" + "enable": true + }, + { + "required": false, + "description": "Current request page.", + "type": "integer", + "id": "EBVkCJ9t08", + "enable": true, + "name": "currentPage", + "schema": { + "type": "integer", + "default": 1 + } }, - "data": { + { + "required": false, + "description": "Number of results per request. Minimum is 10, maximum is 500.", + "type": "integer", + "id": "0RU5JfoTZO", + "enable": true, + "name": "pageSize", + "schema": { + "type": "integer", + "minimum": 10, + "maximum": 500, + "examples": [ + 50 + ] + } + } + ], + "path": [], + "cookie": [], + "header": [] + }, + "responses": [ + { + "id": "10606", + "code": 200, + "name": "OK", + "headers": [], + "jsonSchema": { "type": "object", "properties": { - "orderId": { - "type": "string", - "description": "The unique order id generated by the trading system,which can be used later for further actions such as canceling the order." - }, - "loanApplyId": { - "type": "string", - "description": "Borrow order id. The field is returned only after placing the order under the mode of Auto-Borrow." - }, - "borrowSize": { - "type": "string", - "description": "Borrowed amount. The field is returned only after placing the order under the mode of Auto-Borrow." + "code": { + "type": "string" }, - "clientOid": { - "type": "string", - "description": "This return value is invalid" + "data": { + "type": "object", + "properties": { + "currentPage": { + "type": "integer" + }, + "pageSize": { + "type": "integer" + }, + "totalNum": { + "type": "integer" + }, + "totalPage": { + "type": "integer" + }, + "items": { + "type": "array", + "items": { + "type": "object", + "properties": { + "symbol": { + "type": "string", + "description": "symbol", + "examples": [ + "BTC-USDT", + "ETH-USDT", + "KCS-USDT" + ] + }, + "tradeId": { + "type": "string" + }, + "orderId": { + "type": "string", + "description": "The unique order id generated by the trading system" + }, + "counterOrderId": { + "type": "string", + "description": "Counterparty order Id" + }, + "side": { + "type": "string", + "description": "Buy or sell" + }, + "liquidity": { + "type": "string", + "description": "Liquidity type: taker or maker" + }, + "forceTaker": { + "type": "boolean" + }, + "price": { + "type": "string", + "description": "Order price" + }, + "size": { + "type": "string", + "description": "Order size" + }, + "funds": { + "type": "string", + "description": "Order Funds" + }, + "fee": { + "type": "string", + "description": "[Handling fees](apidog://link/pages/5327739)" + }, + "feeRate": { + "type": "string", + "description": "Fee rate\n" + }, + "feeCurrency": { + "type": "string", + "description": "currency used to calculate trading fee" + }, + "stop": { + "type": "string", + "description": "Take Profit and Stop Loss type, currently HFT does not support the Take Profit and Stop Loss type, so it is empty" + }, + "tradeType": { + "type": "string", + "description": "Trade type, redundancy param" + }, + "type": { + "type": "string", + "description": "Specify if the order is an 'limit' order or 'market' order. " + }, + "createdAt": { + "type": "integer", + "format": "int64" + } + } + } + } + }, + "required": [ + "currentPage", + "pageSize", + "totalNum", + "totalPage", + "items" + ] } }, "required": [ - "orderId", - "loanApplyId", - "borrowSize", - "clientOid" + "code", + "data" ] - } + }, + "description": "", + "contentType": "json", + "mediaType": "" + } + ], + "responseExamples": [ + { + "name": "Success", + "data": "{\r\n \"code\": \"200000\",\r\n \"data\": {\r\n \"currentPage\": 1,\r\n \"pageSize\": 50,\r\n \"totalNum\": 1,\r\n \"totalPage\": 1,\r\n \"items\": [\r\n {\r\n \"symbol\": \"DOGE-USDT\",\r\n \"tradeId\": \"10862827223795713\",\r\n \"orderId\": \"6745698ef4f1200007c561a8\",\r\n \"counterOrderId\": \"6745695ef15b270007ac5076\",\r\n \"side\": \"buy\",\r\n \"liquidity\": \"taker\",\r\n \"forceTaker\": false,\r\n \"price\": \"0.40739\",\r\n \"size\": \"10\",\r\n \"funds\": \"4.0739\",\r\n \"fee\": \"0.0040739\",\r\n \"feeRate\": \"0.001\",\r\n \"feeCurrency\": \"USDT\",\r\n \"stop\": \"\",\r\n \"tradeType\": \"TRADE\",\r\n \"type\": \"market\",\r\n \"createdAt\": 1732602254928\r\n }\r\n ]\r\n }\r\n}", + "responseId": 10606, + "ordering": 1 + } + ], + "requestBody": { + "type": "none", + "parameters": [], + "jsonSchema": { + "type": "object", + "properties": {} }, - "required": [ - "code", - "data" - ] + "example": "{\n \"symbol\": \"BTC-USDT\",\n \"orderId\": \"670fd33bf9406e0007ab3945\",\n \"newPrice\": \"30000\",\n \"newSize\": \"0.0001\"\n}", + "mediaType": "" }, - "description": "", - "contentType": "json", - "mediaType": "" - } - ], - "responseExamples": [ - { - "name": "Success", - "data": "{\n \"code\": \"200000\",\n \"data\": {\n \"orderId\": \"671bb90194422f00073ff4f0\",\n \"loanApplyId\": null,\n \"borrowSize\": null,\n \"clientOid\": null\n }\n}", - "responseId": 10477, - "ordering": 1 + "description": ":::tip[]\nIt is recommended to use the **GET /api/v1/hf/fills** endpoint instead of this endpoint\n:::\n\n:::info[Description]\nRequest via this endpoint to get the recent fills.\nThe return value is the data after Pagination, sorted in descending order according to time.\n:::\n\n:::tip[Tips]\nThe system allows you to retrieve data up to one week (start from the last day by default). If the time period of the queried data exceeds one week (time range from the start time to end time exceeded 7*24 hours), the system will prompt to remind you that you have exceeded the time limit. If you only specified the start time, the system will automatically calculate the end time (end time = start time + 7 * 24 hours). On the contrary, if you only specified the end time, the system will calculate the start time (start time= end time - 7 * 24 hours) the same way.\n\nThe total number of items retrieved cannot exceed 50,000. If it is exceeded, please shorten the query time range.\n:::", + "customApiFields": "{\"abandon\":\"abandon\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"General\",\"api-rate-limit-pool\":\"Spot\",\"sdk-service\":\"Spot\",\"sdk-sub-service\":\"Order\",\"sdk-method-name\":\"getTradeHistoryOld\",\"sdk-method-description\":\"Request via this endpoint to get the recent fills. The return value is the data after Pagination, sorted in descending order according to time.\",\"api-rate-limit\":10}" } - ], - "requestBody": { - "type": "application/json", - "parameters": [], - "jsonSchema": { - "type": "object", - "properties": { - "clientOid": { - "type": "string", - "description": "Client Order Id,The ClientOid field is a unique ID created by the user(we recommend using a UUID), and can only contain numbers, letters, underscores (_), and hyphens (-). This field is returned when order information is obtained. You can use clientOid to tag your orders. ClientOid is different from the order ID created by the service provider. Please do not initiate requests using the same clientOid. The maximum length for the ClientOid is 40 characters.\n\nPlease remember the orderId created by the service provider, it used to check for updates in order status.", - "examples": [ - "5c52e11203aa677f33e493fb" - ] - }, - "side": { - "type": "string", - "description": "specify if the order is to 'buy' or 'sell'", - "enum": [ - "buy", - "sell" - ], - "examples": [ - "buy" - ], - "x-api-enum": [ - { - "value": "buy", - "name": "", - "description": "" - }, - { - "value": "sell", - "name": "", - "description": "" - } - ] - }, - "symbol": { - "type": "string", - "description": "symbol", - "examples": [ - "BTC-USDT", - "ETH-USDT", - "KCS-USDT" - ] - }, - "type": { - "type": "string", - "description": "specify if the order is an 'limit' order or 'market' order. \n\nThe type of order you specify when you place your order determines whether or not you need to request other parameters and also affects the execution of the matching engine.\n\nWhen placing a limit order, you must specify a price and size. The system will try to match the order according to market price or a price better than market price. If the order cannot be immediately matched, it will stay in the order book until it is matched or the user cancels.\n\nUnlike limit orders, the price for market orders fluctuates with market prices. When placing a market order, you do not need to specify a price, you only need to specify a quantity. Market orders are filled immediately and will not enter the order book. All market orders are takers and a taker fee will be charged.", - "enum": [ - "limit", - "market" - ], - "default": "limit", - "x-api-enum": [ - { - "value": "limit", - "name": "", - "description": "" - }, - { - "value": "market", - "name": "", - "description": "" - } - ] - }, - "stp": { - "type": "string", - "description": "[Self Trade Prevention](apidog://link/pages/5176570) is divided into four strategies: CN, CO, CB , and DC", - "enum": [ - "DC", - "CO", - "CN", - "CB" - ], - "x-api-enum": [ - { - "value": "DC", - "name": "", - "description": "" - }, - { - "value": "CO", - "name": "", - "description": "" - }, - { - "value": "CN", - "name": "", - "description": "" - }, - { - "value": "CB", - "name": "", - "description": "" + }, + { + "name": "Get Recent Trade History - Old", + "api": { + "id": "3470351", + "method": "get", + "path": "/api/v1/limit/fills", + "parameters": { + "query": [ + { + "required": false, + "description": "Current request page.", + "type": "integer", + "id": "EBVkCJ9t08", + "enable": true, + "name": "currentPage", + "schema": { + "type": "integer", + "default": 1 } - ] - }, - "price": { - "type": "string", - "description": "Specify price for order\n\nWhen placing a limit order, the price must be based on priceIncrement for the trading pair. The price increment (priceIncrement) is the price precision for the trading pair. For example, for the BTC-USDT trading pair, the priceIncrement is 0.00001000. So the price for your orders cannot be less than 0.00001000 and must be a multiple of priceIncrement. Otherwise, the order will return an invalid priceIncrement error." - }, - "size": { - "type": "string", - "description": "Specify quantity for order\n\nWhen **type** is limit, size refers to the amount of trading targets (the asset name written in front) for the trading pair. Teh Size must be based on the baseIncrement of the trading pair. The baseIncrement represents the precision for the trading pair. The size of an order must be a positive-integer multiple of baseIncrement and must be between baseMinSize and baseMaxSize.\n\nWhen **type** is market, select one out of two: size or funds" - }, - "timeInForce": { - "type": "string", - "description": "[Time in force](apidog://link/pages/5176570) is a special strategy used during trading", - "enum": [ - "GTC", - "GTT", - "IOC", - "FOK" - ], - "default": "GTC", - "x-api-enum": [ - { - "value": "GTC", - "name": "", - "description": "" - }, - { - "value": "GTT", - "name": "", - "description": "" - }, - { - "value": "IOC", - "name": "", - "description": "" - }, - { - "value": "FOK", - "name": "", - "description": "" + }, + { + "required": false, + "description": "Number of results per request. Minimum is 10, maximum is 500.", + "type": "integer", + "id": "0RU5JfoTZO", + "enable": true, + "name": "pageSize", + "schema": { + "type": "integer", + "minimum": 10, + "maximum": 500, + "examples": [ + 50 + ] } - ] - }, - "postOnly": { - "type": "boolean", - "default": false, - "description": "passive order labels, this is disabled when the order timing strategy is IOC or FOK" - }, - "hidden": { - "type": "boolean", - "description": "Hidden or not (not shown in order book)", - "default": false - }, - "iceberg": { - "type": "boolean", - "description": "Whether or not only visible portions of orders are shown in iceberg orders", - "default": false - }, - "visibleSize": { - "type": "string", - "description": "Maximum visible quantity in iceberg orders" - }, - "cancelAfter": { - "type": "integer", - "format": "int64", - "description": "Cancel after n seconds,the order timing strategy is GTT" - }, - "funds": { - "type": "string", - "description": "When **type** is market, select one out of two: size or funds" - }, - "autoBorrow": { - "type": "boolean", - "description": "When Margin Account has inefficient balance, our system autoborrows inefficient assets and opens positions according to the lowest market interest rate.", - "default": false - }, - "autoRepay": { - "type": "boolean", - "description": "AutoPay allows returning borrowed assets when you close a position. Our system automatically triggers the repayment and the maximum repayment amount equals to the filled-order amount.", - "default": false - }, - "marginModel": { - "type": "string", - "description": "The type of trading, including cross (cross mode) and isolated (isolated mode). It is set at cross by default.", - "enum": [ - "cross", - "isolated" - ], - "default": "cross", - "x-api-enum": [ - { - "value": "cross", - "name": "", - "description": "" + } + ], + "path": [], + "cookie": [], + "header": [] + }, + "responses": [ + { + "id": "10607", + "code": 200, + "name": "OK", + "headers": [], + "jsonSchema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "array", + "items": { + "type": "object", + "properties": { + "symbol": { + "type": "string" + }, + "tradeId": { + "type": "string" + }, + "orderId": { + "type": "string" + }, + "counterOrderId": { + "type": "string" + }, + "side": { + "type": "string" + }, + "liquidity": { + "type": "string" + }, + "forceTaker": { + "type": "boolean" + }, + "price": { + "type": "string" + }, + "size": { + "type": "string" + }, + "funds": { + "type": "string" + }, + "fee": { + "type": "string" + }, + "feeRate": { + "type": "string" + }, + "feeCurrency": { + "type": "string" + }, + "stop": { + "type": "string" + }, + "tradeType": { + "type": "string" + }, + "type": { + "type": "string" + }, + "createdAt": { + "type": "integer", + "format": "int64" + } + } + } + } }, - { - "value": "isolated", - "name": "", - "description": "" - } - ] + "required": [ + "code", + "data" + ] + }, + "description": "", + "contentType": "json", + "mediaType": "" + } + ], + "responseExamples": [ + { + "name": "Success", + "data": "{\r\n \"code\": \"200000\",\r\n \"data\": [\r\n {\r\n \"symbol\": \"BTC-USDT\",\r\n \"tradeId\": \"11732720444522497\",\r\n \"orderId\": \"674aab24754b1e00077dbc69\",\r\n \"counterOrderId\": \"674aab1fb26bfb0007a18b67\",\r\n \"side\": \"buy\",\r\n \"liquidity\": \"taker\",\r\n \"forceTaker\": false,\r\n \"price\": \"96999.6\",\r\n \"size\": \"0.00001\",\r\n \"funds\": \"0.969996\",\r\n \"fee\": \"0.000969996\",\r\n \"feeRate\": \"0.001\",\r\n \"feeCurrency\": \"USDT\",\r\n \"stop\": \"\",\r\n \"tradeType\": \"TRADE\",\r\n \"type\": \"limit\",\r\n \"createdAt\": 1732946724082\r\n }\r\n ]\r\n}", + "responseId": 10607, + "ordering": 1 } + ], + "requestBody": { + "type": "none", + "parameters": [], + "jsonSchema": { + "type": "object", + "properties": {} + }, + "example": "{\n \"symbol\": \"BTC-USDT\",\n \"orderId\": \"670fd33bf9406e0007ab3945\",\n \"newPrice\": \"30000\",\n \"newSize\": \"0.0001\"\n}", + "mediaType": "" }, - "required": [ - "symbol", - "side", - "clientOid" - ] - }, - "example": "//limit order\n{\n \"type\": \"limit\",\n \"symbol\": \"BTC-USDT\",\n \"side\": \"buy\",\n \"price\": \"50000\",\n \"size\": \"0.00001\",\n \"clientOid\": \"5c52e11203aa677f33e4193fb\",\n \"remark\": \"order remarks\"\n}\n\n//market order 1\n// {\n// \"type\": \"market\",\n// \"symbol\": \"BTC-USDT\",\n// \"side\": \"buy\",\n// \"size\": \"0.00001\",\n// \"clientOid\": \"5c52e11203aa677f33e493fc\",\n// \"remark\": \"order remarks\"\n// }\n\n//market order 2\n// {\n// \"type\": \"market\",\n// \"symbol\": \"BTC-USDT\",\n// \"side\": \"buy\",\n// \"funds\": \"1\",\n// \"clientOid\": \"5c52e11203aa677f33e493fc\",\n// \"remark\": \"order remarks\"\n// }\n", - "mediaType": "" - }, - "description": ":::tip[TIPS]\nIt is recommended to use the **POST /api/v3/hf/margin/order/test** endpoint instead of this endpoint\n:::\n\n:::info[Description]\nOrder test endpoint, the request parameters and return parameters of this endpoint are exactly the same as the order endpoint, and can be used to verify whether the signature is correct and other operations. After placing an order, the order will not enter the matching system, and the order cannot be queried.\n:::\n\n:::tip[Tips]\nPlease note that once your order enters the order book, the system will freeze the handling fees for the order ahead of time.\n\nBefore placing orders, please be sure to fully understand the meaning of the parameters for each trading pair.\n:::\n\n:::tip[Tips]\nThe maximum number of active orders per account is 2000, with a maximum of 200 active orders per trading pair.\n:::\n\n\n**Public order placement request parameters**\n\n| Param | Type | Mandatory | Description |\n| --------- | ------ | --------- | ----------- |\n| clientOid | String | Yes | Client Order Id,unique identifier created by the user, the use of UUID is recommended |\n| symbol | String | Yes | symbol |\n| side | String | Yes | `buy` or `sell` |\n| type | String | No | Order type `limit` and `market`, defult is limit |\n| stp | String | No | self trade prevention is divided into four strategies: `CN`, `CO`, `CB` , and `DC` |\n| marginModel | String | No | The type of trading, including cross (cross mode) and isolated (isolated mode). It is set at cross by default. |\n| autoBorrow | boolean | No | When Margin Account has inefficient balance, our system autoborrows inefficient assets and opens positions according to the lowest market interest rate. |\n| autoRepay | boolean | No | AutoPay allows returning borrowed assets when you close a position. Our system automatically triggers the repayment and the maximum repayment amount equals to the filled-order amount. |\n\n**Additional Request Parameters Required by `limit` Orders**\n\n| Param | Type | Mandatory | Description |\n| ----------- | ------- | --------- | ----------- |\n| price | String | Yes | Specify price for currency |\n| size | String | Yes | Specify quantity for currency |\n| timeInForce | String | No | Order timing strategy `GTC`, `GTT`, `IOC`, `FOK` (The default is `GTC`) |\n| cancelAfter | long | No | Cancel after `n` seconds,the order timing strategy is `GTT` |\n| postOnly | boolean | No | passive order labels, this is disabled when the order timing strategy is `IOC` or `FOK` |\n| hidden | boolean | No | Hidden or not (not shown in order book) |\n| iceberg | boolean | No | Whether or not only visible portions of orders are shown in iceberg orders |\n| visibleSize | String | No | Maximum visible quantity in iceberg orders |\n\n**Additional request parameters required by `market` orders**\n\n| Param | Type | Mandatory | Description |\n| ----- | ------ | --------- | ------------------------------------------ |\n| size | String | No | (Select one out of two: `size` or `funds`) |\n| funds | String | No | (Select one out of two: `size` or `funds`) |\n\n\n\n**Hidden Orders and Iceberg Orders (Hidden & Iceberg)**\n\nHidden orders and iceberg orders can be set in advanced settings (iceberg orders are a special type of hidden orders). When placing limit orders or stop limit orders, you can choose to execute according to hidden orders or iceberg orders.\n\nHidden orders are not shown in order books.\n\nUnlike hidden orders, iceberg orders are divided into visible and hidden portions. When engaging in iceberg orders, visible order sizes must be set. The minimum visible size for an iceberg order is 1/20 of the total order size.\n\nWhen matching, the visible portions of iceberg orders are matched first. Once the visible portions are fully matched, hidden portions will emerge. This will continue until the order is fully filled.\n\nNote:\n\n- The system will charge taker fees for hidden orders and iceberg orders.\n- If you simultaneously set iceberg orders and hidden orders, your order will default to an iceberg order for execution.\n\n**Hold**\n\nFor limit price purchase orders, we will hold the amount of funds (price * size) required for your purchase order. Similarly, for limit price sell orders, we will also hold you sell order assets. When the transaction is executed, the service fees will be calculated. If you cancel a portion of a filled or unfilled order, then the remaining funds or amounts will be released and returned to your account. For market price buy/sell orders that require specific funds, we will hold the required funds in from your account. If only the size is specified, we may freeze (usually for a very short amount of time) all of the funds in your account prior to the order being filled or cancelled.\n\n\n**Order Lifecycle**\n\nWhen an order placement request is successful (the matching engine receives the order) or denied (due to there being insufficient funds or illegal parameter values, etc.), the system will respond to the HTTP request. When an order is successfully placed, the order ID is returned. The order will be matched, which could result in it being fully or partially filled. When an order is fully or partially filled, the remaining portions of the order will be in an active state awaiting to be matched (this does not include IOC orders). Orders that are fully or partially filled(already cancelled) will be put into the “done” state.\n\nUsers that have subscribed to the Market Data Channel can use the order ID (orderId) and client ID (clientOid) to identify messages.\n\n**Price Protection Mechanisms**\n\nPrice protection mechanisms ae enabled for order placements. Rules are detailed below:\n\n- If the spot trading market order/limit order placed by the user can be directly matched with an order in the current order book, the system will judge whether deviation between the price corresponding to the transaction depth and the spread exceeds the threshold value (the threshold value can be obtained using the symbol API endpoint);\n\n- If it is exceeded, for limit orders, the order will be directly cancelled;\n\n- If it is a market order, then the system will partially execute the order. The execution limit will be the order size within the price range corresponding to the threshold value. The remaining orders will not be filled.\n\nFor example: if the threshold value is 10%, when a user places a market price purchase order in the KCS/USDT trading market for 10,000 USDT (the selling price is currently 1.20000), the system will determine that after the order is completely filled, the final price will be 1.40000. (1.40000-1.20000)/1.20000=16.7%>10%. The threshold value is 1.32000. The user’s market price purchase order will be filled only to a maximum of 1.32000. The remaining order portions will not be matched with orders in the order book. Note: this feature may not be able to determine depth with complete accuracy. If your order is not completely filled, it may be because the portion exceeding the threshold value was not filled.\n", - "customApiFields": "{\"abandon\":\"abandon\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"Margin\",\"api-rate-limit-pool\":\"Spot\",\"sdk-service\":\"Margin\",\"sdk-sub-service\":\"Order\",\"sdk-method-name\":\"addOrderTestV1\",\"sdk-method-description\":\"Order test endpoint, the request parameters and return parameters of this endpoint are exactly the same as the order endpoint, and can be used to verify whether the signature is correct and other operations. After placing an order, the order will not enter the matching system, and the order cannot be queried.\",\"api-rate-limit\":5}" - } - }, + "description": ":::tip[]\nIt is recommended to use the **GET /api/v1/hf/fills** endpoint instead of this endpoint\n:::\n\n:::info[Description]\nRequest via this endpoint to get a list of 1000 fills in the last 24 hours. The return value is the data after Pagination, sorted in descending order according to time.\n:::", + "customApiFields": "{\"abandon\":\"abandon\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"General\",\"api-rate-limit-pool\":\"Spot\",\"sdk-service\":\"Spot\",\"sdk-sub-service\":\"Order\",\"sdk-method-name\":\"getRecentTradeHistoryOld\",\"sdk-method-description\":\"Request via this endpoint to get a list of 1000 fills in the last 24 hours. The return value is the data after Pagination, sorted in descending order according to time.\",\"api-rate-limit\":20}" + } + } + ] + } + ] + }, + { + "name": "Margin Trading", + "id": 348174, + "description": "", + "items": [ { - "name": "Get Account List - Isolated Margin - V1", + "name": "Get Account Detail - Margin", "api": { - "id": "3470314", + "id": "3470311", "method": "get", - "path": "/api/v1/isolated/accounts", + "path": "/api/v1/margin/account", "parameters": { - "query": [ - { - "id": "PjWvwo4LmP", - "name": "balanceCurrency", - "required": false, - "description": "quote currency, currently only supports USDT, KCS, BTC, USDT as default", - "example": "USDT", - "type": "string", - "schema": { - "type": "string", - "default": "BTC", - "enum": [ - "USDT", - "KCS", - "BTC" - ], - "x-api-enum": [ - { - "value": "USDT", - "name": "", - "description": "" - }, - { - "value": "KCS", - "name": "", - "description": "" - }, - { - "value": "BTC", - "name": "", - "description": "" - } - ] - }, - "enable": true - } - ], "path": [], + "query": [], "cookie": [], "header": [] }, "responses": [ { - "id": "10478", + "id": "10475", "code": 200, "name": "OK", "headers": [], @@ -46016,175 +45300,55 @@ "data": { "type": "object", "properties": { - "totalConversionBalance": { - "type": "string", - "description": "The total balance of the isolated margin account(in the request coin)" - }, - "liabilityConversionBalance": { + "debtRatio": { "type": "string", - "description": "Total liabilities of the isolated margin account(in the request coin)" + "description": "Debt ratio" }, - "assets": { + "accounts": { "type": "array", "items": { "type": "object", "properties": { - "symbol": { + "currency": { "type": "string", - "description": "Symbol" + "description": "Currency" }, - "status": { + "totalBalance": { "type": "string", - "description": "The position status: Existing liabilities-DEBT, No liabilities-CLEAR, Bankrupcy (after position enters a negative balance)-BANKRUPTCY, Existing borrowings-IN_BORROW, Existing repayments-IN_REPAY, Under liquidation-IN_LIQUIDATION, Under auto-renewal assets-IN_AUTO_RENEW .", - "enum": [ - "DEBT", - "CLEAR", - "BANKRUPTCY", - "IN_BORROW", - "IN_REPAY", - "IN_LIQUIDATION", - "IN_AUTO_RENEW" - ], - "x-api-enum": [ - { - "value": "DEBT", - "name": "", - "description": "" - }, - { - "value": "CLEAR", - "name": "", - "description": "" - }, - { - "value": "BANKRUPTCY", - "name": "", - "description": "" - }, - { - "value": "IN_BORROW", - "name": "", - "description": "" - }, - { - "value": "IN_REPAY", - "name": "", - "description": "" - }, - { - "value": "IN_LIQUIDATION", - "name": "", - "description": "" - }, - { - "value": "IN_AUTO_RENEW", - "name": "", - "description": "" - } - ] + "description": "Total funds in the account" }, - "debtRatio": { + "availableBalance": { "type": "string", - "description": "debt ratio" + "description": "Available funds in the account" }, - "baseAsset": { - "type": "object", - "properties": { - "currency": { - "type": "string", - "description": "currency" - }, - "totalBalance": { - "type": "string", - "description": "Current currency total asset amount" - }, - "holdBalance": { - "type": "string", - "description": "Current currency holding asset amount" - }, - "availableBalance": { - "type": "string", - "description": "Current available asset amount" - }, - "liability": { - "type": "string", - "description": "Liabilities" - }, - "interest": { - "type": "string" - }, - "borrowableAmount": { - "type": "string" - } - }, - "required": [ - "currency", - "totalBalance", - "holdBalance", - "availableBalance", - "liability", - "interest", - "borrowableAmount" - ], - "description": "base asset" + "holdBalance": { + "type": "string", + "description": "Funds on hold in the account" }, - "quoteAsset": { - "type": "object", - "properties": { - "currency": { - "type": "string", - "description": "currency" - }, - "totalBalance": { - "type": "string", - "description": "Current currency total asset amount" - }, - "holdBalance": { - "type": "string", - "description": "Current currency holding asset amount" - }, - "availableBalance": { - "type": "string", - "description": "Current available asset amount" - }, - "liability": { - "type": "string", - "description": "Liabilities" - }, - "interest": { - "type": "string" - }, - "borrowableAmount": { - "type": "string" - } - }, - "required": [ - "currency", - "totalBalance", - "holdBalance", - "availableBalance", - "liability", - "interest", - "borrowableAmount" - ], - "description": "quote asset" + "liability": { + "type": "string", + "description": "Total liabilities" + }, + "maxBorrowSize": { + "type": "string", + "description": "Available size to borrow" } }, "required": [ - "symbol", - "status", - "debtRatio", - "baseAsset", - "quoteAsset" + "currency", + "totalBalance", + "availableBalance", + "holdBalance", + "liability", + "maxBorrowSize" ] }, - "description": "Account list" + "description": "Margin account list" } }, "required": [ - "totalConversionBalance", - "liabilityConversionBalance", - "assets" + "debtRatio", + "accounts" ] } }, @@ -46201,8 +45365,8 @@ "responseExamples": [ { "name": "Success", - "data": "{\n \"code\": \"200000\",\n \"data\": {\n \"totalConversionBalance\": \"0.01\",\n \"liabilityConversionBalance\": \"0\",\n \"assets\": [\n {\n \"symbol\": \"BTC-USDT\",\n \"status\": \"CLEAR\",\n \"debtRatio\": \"0\",\n \"baseAsset\": {\n \"currency\": \"BTC\",\n \"totalBalance\": \"0\",\n \"holdBalance\": \"0\",\n \"availableBalance\": \"0\",\n \"liability\": \"0\",\n \"interest\": \"0\",\n \"borrowableAmount\": \"0\"\n },\n \"quoteAsset\": {\n \"currency\": \"USDT\",\n \"totalBalance\": \"0.01\",\n \"holdBalance\": \"0\",\n \"availableBalance\": \"0.01\",\n \"liability\": \"0\",\n \"interest\": \"0\",\n \"borrowableAmount\": \"0\"\n }\n }\n ]\n }\n}", - "responseId": 10478, + "data": "{\n \"code\": \"200000\",\n \"data\": {\n \"debtRatio\": \"0\",\n \"accounts\": [\n {\n \"currency\": \"USDT\",\n \"totalBalance\": \"0.03\",\n \"availableBalance\": \"0.02\",\n \"holdBalance\": \"0.01\",\n \"liability\": \"0\",\n \"maxBorrowSize\": \"0\"\n }\n ]\n }\n}", + "responseId": 10475, "ordering": 1 } ], @@ -46215,34 +45379,25 @@ }, "mediaType": "" }, - "description": ":::tip[TIPS]\nIt is recommended to use the **GET /api/v3/isolated/accounts** endpoint instead of this endpoint\n:::\n\n:::info[Description]\nRequest via this endpoint to get the info list of the isolated margin account.\n:::", - "customApiFields": "{\"abandon\":\"abandon\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"General\",\"api-rate-limit-pool\":\"Spot\",\"sdk-service\":\"Account\",\"sdk-sub-service\":\"Account\",\"sdk-method-name\":\"getIsolatedMarginAccountListV1\",\"sdk-method-description\":\"Request via this endpoint to get the info list of the isolated margin account.\",\"api-rate-limit\":50}" + "description": ":::tip[TIPS]\nIt is recommended to use the **GET /api/v3/margin/accounts** endpoint instead of this endpoint\n:::\n\n:::info[Description]\nRequest via this endpoint to get the info of the margin account.\n:::", + "customApiFields": "{\"abandon\":\"abandon\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"General\",\"api-rate-limit-pool\":\"Spot\",\"sdk-service\":\"Account\",\"sdk-sub-service\":\"Account\",\"sdk-method-name\":\"getMarginAccountDetail\",\"sdk-method-description\":\"Request via this endpoint to get the info of the margin account.\",\"api-rate-limit\":40}" } }, { - "name": "Get Account Detail - Isolated Margin - V1", + "name": "Add Order - V1", "api": { - "id": "3470315", - "method": "get", - "path": "/api/v1/isolated/account/{symbol}", + "id": "3470312", + "method": "post", + "path": "/api/v1/margin/order", "parameters": { "query": [], - "path": [ - { - "id": "symbol#0", - "name": "symbol", - "required": true, - "description": "", - "type": "string", - "enable": true - } - ], + "path": [], "cookie": [], "header": [] }, "responses": [ { - "id": "10479", + "id": "10476", "code": 200, "name": "OK", "headers": [], @@ -46255,220 +45410,29 @@ "data": { "type": "object", "properties": { - "symbol": { + "orderId": { "type": "string", - "description": "Symbol" + "description": "The unique order id generated by the trading system,which can be used later for further actions such as canceling the order." }, - "status": { + "loanApplyId": { "type": "string", - "description": "The position status: Existing liabilities-DEBT, No liabilities-CLEAR, Bankrupcy (after position enters a negative balance)-BANKRUPTCY, Existing borrowings-IN_BORROW, Existing repayments-IN_REPAY, Under liquidation-IN_LIQUIDATION, Under auto-renewal assets-IN_AUTO_RENEW .", - "enum": [ - "DEBT", - "CLEAR", - "BANKRUPTCY", - "IN_BORROW", - "IN_REPAY", - "IN_LIQUIDATION", - "IN_AUTO_RENEW" - ], - "x-api-enum": [ - { - "value": "DEBT", - "name": "", - "description": "" - }, - { - "value": "CLEAR", - "name": "", - "description": "" - }, - { - "value": "BANKRUPTCY", - "name": "", - "description": "" - }, - { - "value": "IN_BORROW", - "name": "", - "description": "" - }, - { - "value": "IN_REPAY", - "name": "", - "description": "" - }, - { - "value": "IN_LIQUIDATION", - "name": "", - "description": "" - }, - { - "value": "IN_AUTO_RENEW", - "name": "", - "description": "" - } - ] + "description": "Borrow order id. The field is returned only after placing the order under the mode of Auto-Borrow." }, - "debtRatio": { + "borrowSize": { "type": "string", - "description": "debt ratio" - }, - "baseAsset": { - "type": "object", - "properties": { - "currency": { - "type": "string", - "description": "currency" - }, - "totalBalance": { - "type": "string", - "description": "Current currency total asset amount" - }, - "holdBalance": { - "type": "string", - "description": "Current currency holding asset amount" - }, - "availableBalance": { - "type": "string", - "description": "Current available asset amount" - }, - "liability": { - "type": "string", - "description": "Liabilities" - }, - "interest": { - "type": "string" - }, - "borrowableAmount": { - "type": "string" - } - }, - "required": [ - "currency", - "totalBalance", - "holdBalance", - "availableBalance", - "liability", - "interest", - "borrowableAmount" - ], - "description": "base asset" + "description": "Borrowed amount. The field is returned only after placing the order under the mode of Auto-Borrow." }, - "quoteAsset": { - "type": "object", - "properties": { - "currency": { - "type": "string", - "description": "currency" - }, - "totalBalance": { - "type": "string", - "description": "Current currency total asset amount" - }, - "holdBalance": { - "type": "string", - "description": "Current currency holding asset amount" - }, - "availableBalance": { - "type": "string", - "description": "Current available asset amount" - }, - "liability": { - "type": "string", - "description": "Liabilities" - }, - "interest": { - "type": "string" - }, - "borrowableAmount": { - "type": "string" - } - }, - "required": [ - "currency", - "totalBalance", - "holdBalance", - "availableBalance", - "liability", - "interest", - "borrowableAmount" - ], - "description": "quote asset" + "clientOid": { + "type": "string", + "description": "This return value is invalid" } }, "required": [ - "symbol", - "status", - "debtRatio", - "baseAsset", - "quoteAsset" - ] - } - }, - "required": [ - "code", - "data" - ] - }, - "description": "", - "contentType": "json", - "mediaType": "" - } - ], - "responseExamples": [ - { - "name": "Success", - "data": "{\n \"code\": \"200000\",\n \"data\": {\n \"symbol\": \"BTC-USDT\",\n \"status\": \"CLEAR\",\n \"debtRatio\": \"0\",\n \"baseAsset\": {\n \"currency\": \"BTC\",\n \"totalBalance\": \"0\",\n \"holdBalance\": \"0\",\n \"availableBalance\": \"0\",\n \"liability\": \"0\",\n \"interest\": \"0\",\n \"borrowableAmount\": \"0\"\n },\n \"quoteAsset\": {\n \"currency\": \"USDT\",\n \"totalBalance\": \"0.01\",\n \"holdBalance\": \"0\",\n \"availableBalance\": \"0.01\",\n \"liability\": \"0\",\n \"interest\": \"0\",\n \"borrowableAmount\": \"0\"\n }\n }\n}", - "responseId": 10479, - "ordering": 1 - } - ], - "requestBody": { - "type": "none", - "parameters": [], - "jsonSchema": { - "type": "object", - "properties": {} - }, - "mediaType": "" - }, - "description": ":::tip[TIPS]\nIt is recommended to use the **GET /api/v3/isolated/accounts** endpoint instead of this endpoint\n:::\n\n:::info[Description]\nRequest via this endpoint to get the info of the isolated margin account.\n:::", - "customApiFields": "{\"abandon\":\"abandon\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"General\",\"api-rate-limit-pool\":\"Spot\",\"sdk-service\":\"Account\",\"sdk-sub-service\":\"Account\",\"sdk-method-name\":\"getIsolatedMarginAccountDetailV1\",\"sdk-method-description\":\"Request via this endpoint to get the info of the isolated margin account.\",\"api-rate-limit\":50}" - } - } - ] - }, - { - "name": "Futures Trading", - "id": 348177, - "description": "", - "items": [ - { - "name": "Modify Isolated Margin Auto-Deposit Status", - "api": { - "id": "3470255", - "method": "post", - "path": "/api/v1/position/margin/auto-deposit-status", - "parameters": { - "query": [], - "path": [], - "cookie": [], - "header": [] - }, - "responses": [ - { - "id": "10419", - "code": 200, - "name": "成功", - "headers": [], - "jsonSchema": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "data": { - "type": "boolean" + "orderId", + "loanApplyId", + "borrowSize", + "clientOid" + ] } }, "required": [ @@ -46484,8 +45448,8 @@ "responseExamples": [ { "name": "Success", - "data": "{\n \"code\": \"200000\",\n \"data\": true\n}", - "responseId": 10419, + "data": "{\n \"code\": \"200000\",\n \"data\": {\n \"orderId\": \"671bb90194422f00073ff4f0\",\n \"loanApplyId\": null,\n \"borrowSize\": null,\n \"clientOid\": null\n }\n}", + "responseId": 10476, "ordering": 1 } ], @@ -46495,58 +45459,229 @@ "jsonSchema": { "type": "object", "properties": { + "clientOid": { + "type": "string", + "description": "Client Order Id,The ClientOid field is a unique ID created by the user(we recommend using a UUID), and can only contain numbers, letters, underscores (_), and hyphens (-). This field is returned when order information is obtained. You can use clientOid to tag your orders. ClientOid is different from the order ID created by the service provider. Please do not initiate requests using the same clientOid. The maximum length for the ClientOid is 40 characters.\n\nPlease remember the orderId created by the service provider, it used to check for updates in order status.", + "examples": [ + "5c52e11203aa677f33e493fb" + ] + }, + "side": { + "type": "string", + "description": "specify if the order is to 'buy' or 'sell'", + "enum": [ + "buy", + "sell" + ], + "examples": [ + "buy" + ], + "x-api-enum": [ + { + "value": "buy", + "name": "", + "description": "" + }, + { + "value": "sell", + "name": "", + "description": "" + } + ] + }, "symbol": { "type": "string", - "description": "Symbol of the contract\n", + "description": "symbol", "examples": [ - "XBTUSDTM", - "ETHUSDTM" + "BTC-USDT", + "ETH-USDT", + "KCS-USDT" ] }, - "status": { + "type": { + "type": "string", + "description": "specify if the order is an 'limit' order or 'market' order. \n\nThe type of order you specify when you place your order determines whether or not you need to request other parameters and also affects the execution of the matching engine.\n\nWhen placing a limit order, you must specify a price and size. The system will try to match the order according to market price or a price better than market price. If the order cannot be immediately matched, it will stay in the order book until it is matched or the user cancels.\n\nUnlike limit orders, the price for market orders fluctuates with market prices. When placing a market order, you do not need to specify a price, you only need to specify a quantity. Market orders are filled immediately and will not enter the order book. All market orders are takers and a taker fee will be charged.", + "enum": [ + "limit", + "market" + ], + "default": "limit", + "x-api-enum": [ + { + "value": "limit", + "name": "", + "description": "" + }, + { + "value": "market", + "name": "", + "description": "" + } + ] + }, + "stp": { + "type": "string", + "description": "[Self Trade Prevention](apidog://link/pages/338146) is divided into four strategies: CN, CO, CB , and DC", + "enum": [ + "DC", + "CO", + "CN", + "CB" + ], + "x-api-enum": [ + { + "value": "DC", + "name": "", + "description": "" + }, + { + "value": "CO", + "name": "", + "description": "" + }, + { + "value": "CN", + "name": "", + "description": "" + }, + { + "value": "CB", + "name": "", + "description": "" + } + ] + }, + "price": { + "type": "string", + "description": "Specify price for order\n\nWhen placing a limit order, the price must be based on priceIncrement for the trading pair. The price increment (priceIncrement) is the price precision for the trading pair. For example, for the BTC-USDT trading pair, the priceIncrement is 0.00001000. So the price for your orders cannot be less than 0.00001000 and must be a multiple of priceIncrement. Otherwise, the order will return an invalid priceIncrement error." + }, + "size": { + "type": "string", + "description": "Specify quantity for order\n\nWhen **type** is limit, size refers to the amount of trading targets (the asset name written in front) for the trading pair. Teh Size must be based on the baseIncrement of the trading pair. The baseIncrement represents the precision for the trading pair. The size of an order must be a positive-integer multiple of baseIncrement and must be between baseMinSize and baseMaxSize.\n\nWhen **type** is market, select one out of two: size or funds" + }, + "timeInForce": { + "type": "string", + "description": "[Time in force](apidog://link/pages/338146) is a special strategy used during trading", + "enum": [ + "GTC", + "GTT", + "IOC", + "FOK" + ], + "default": "GTC", + "x-api-enum": [ + { + "value": "GTC", + "name": "", + "description": "" + }, + { + "value": "GTT", + "name": "", + "description": "" + }, + { + "value": "IOC", + "name": "", + "description": "" + }, + { + "value": "FOK", + "name": "", + "description": "" + } + ] + }, + "postOnly": { "type": "boolean", - "description": "Status" + "default": false, + "description": "passive order labels, this is disabled when the order timing strategy is IOC or FOK" + }, + "hidden": { + "type": "boolean", + "description": "Hidden or not (not shown in order book)", + "default": false + }, + "iceberg": { + "type": "boolean", + "description": "Whether or not only visible portions of orders are shown in iceberg orders", + "default": false + }, + "visibleSize": { + "type": "string", + "description": "Maximum visible quantity in iceberg orders" + }, + "cancelAfter": { + "type": "integer", + "format": "int64", + "description": "Cancel after n seconds,the order timing strategy is GTT" + }, + "funds": { + "type": "string", + "description": "When **type** is market, select one out of two: size or funds" + }, + "autoBorrow": { + "type": "boolean", + "description": "When Margin Account has inefficient balance, our system autoborrows inefficient assets and opens positions according to the lowest market interest rate.", + "default": false + }, + "autoRepay": { + "type": "boolean", + "description": "AutoPay allows returning borrowed assets when you close a position. Our system automatically triggers the repayment and the maximum repayment amount equals to the filled-order amount.", + "default": false + }, + "marginModel": { + "type": "string", + "description": "The type of trading, including cross (cross mode) and isolated (isolated mode). It is set at cross by default.", + "enum": [ + "cross", + "isolated" + ], + "default": "cross", + "x-api-enum": [ + { + "value": "cross", + "name": "", + "description": "" + }, + { + "value": "isolated", + "name": "", + "description": "" + } + ] } }, "required": [ "symbol", - "status" + "side", + "clientOid" ] }, - "example": "{\n \"symbol\": \"XBTUSDTM\",\n \"status\": true\n}", + "example": "//limit order\n{\n \"type\": \"limit\",\n \"symbol\": \"BTC-USDT\",\n \"side\": \"buy\",\n \"price\": \"50000\",\n \"size\": \"0.00001\",\n \"clientOid\": \"5c52e11203aa677f33e4193fb\",\n \"remark\": \"order remarks\"\n}\n\n//market order 1\n// {\n// \"type\": \"market\",\n// \"symbol\": \"BTC-USDT\",\n// \"side\": \"buy\",\n// \"size\": \"0.00001\",\n// \"clientOid\": \"5c52e11203aa677f33e493fc\",\n// \"remark\": \"order remarks\"\n// }\n\n//market order 2\n// {\n// \"type\": \"market\",\n// \"symbol\": \"BTC-USDT\",\n// \"side\": \"buy\",\n// \"funds\": \"1\",\n// \"clientOid\": \"5c52e11203aa677f33e493fc\",\n// \"remark\": \"order remarks\"\n// }\n", "mediaType": "" }, - "description": ":::tip[TIPS]\nCurrently, it is not recommended to use the Isolated margin + auto deposit margin . It is recommended to switch to the cross margin mode.\nPlease refer to **POST /api/v2/position/changeMarginMode** endpoint\n:::\n\n:::info[Description]\nThis endpoint is only applicable to isolated margin and is no longer recommended. It is recommended to use cross margin instead.\n:::\n", - "customApiFields": "{\"abandon\":\"abandon\",\"domain\":\"Futures\",\"api-channel\":\"Private\",\"api-permission\":\"Futures\",\"api-rate-limit-pool\":\"Futures\",\"sdk-service\":\"Futures\",\"sdk-sub-service\":\"Positions\",\"sdk-method-name\":\"modifyAutoDepositStatus\",\"sdk-method-description\":\"This endpoint is only applicable to isolated margin and is no longer recommended. It is recommended to use cross margin instead.\",\"api-rate-limit\":4}" + "description": ":::tip[TIPS]\nIt is recommended to use the **POST /api/v3/hf/margin/order** endpoint instead of this endpoint\n:::\n\n:::info[Description]\nPlace order to the Cross-margin or Isolated-margin trading system, you can place two major types of orders: limit and market. Orders can only be placed if your account has sufficient funds. Once an order is placed, your funds will be put on hold for the duration of the order. The amount of funds on hold depends on the order type and parameters specified.\n:::\n\n:::tip[Tips]\nPlease note that once your order enters the order book, the system will freeze the handling fees for the order ahead of time.\n\nBefore placing orders, please be sure to fully understand the meaning of the parameters for each trading pair.\n:::\n\n:::tip[Tips]\nThe maximum number of active orders per account is 2000, with a maximum of 200 active orders per trading pair.\n:::\n\n\n**Public order placement request parameters**\n\n| Param | Type | Mandatory | Description |\n| --------- | ------ | --------- | ----------- |\n| clientOid | String | Yes | Client Order Id,unique identifier created by the user, the use of UUID is recommended |\n| symbol | String | Yes | symbol |\n| side | String | Yes | `buy` or `sell` |\n| type | String | No | Order type `limit` and `market`, defult is limit |\n| stp | String | No | self trade prevention is divided into four strategies: `CN`, `CO`, `CB` , and `DC` |\n| marginModel | String | No | The type of trading, including cross (cross mode) and isolated (isolated mode). It is set at cross by default. |\n| autoBorrow | boolean | No | When Margin Account has inefficient balance, our system autoborrows inefficient assets and opens positions according to the lowest market interest rate. |\n| autoRepay | boolean | No | AutoPay allows returning borrowed assets when you close a position. Our system automatically triggers the repayment and the maximum repayment amount equals to the filled-order amount. |\n\n**Additional Request Parameters Required by `limit` Orders**\n\n| Param | Type | Mandatory | Description |\n| ----------- | ------- | --------- | ----------- |\n| price | String | Yes | Specify price for currency |\n| size | String | Yes | Specify quantity for currency |\n| timeInForce | String | No | Order timing strategy `GTC`, `GTT`, `IOC`, `FOK` (The default is `GTC`) |\n| cancelAfter | long | No | Cancel after `n` seconds,the order timing strategy is `GTT` |\n| postOnly | boolean | No | passive order labels, this is disabled when the order timing strategy is `IOC` or `FOK` |\n| hidden | boolean | No | Hidden or not (not shown in order book) |\n| iceberg | boolean | No | Whether or not only visible portions of orders are shown in iceberg orders |\n| visibleSize | String | No | Maximum visible quantity in iceberg orders |\n\n**Additional request parameters required by `market` orders**\n\n| Param | Type | Mandatory | Description |\n| ----- | ------ | --------- | ------------------------------------------ |\n| size | String | No | (Select one out of two: `size` or `funds`) |\n| funds | String | No | (Select one out of two: `size` or `funds`) |\n\n\n\n**Hidden Orders and Iceberg Orders (Hidden & Iceberg)**\n\nHidden orders and iceberg orders can be set in advanced settings (iceberg orders are a special type of hidden orders). When placing limit orders or stop limit orders, you can choose to execute according to hidden orders or iceberg orders.\n\nHidden orders are not shown in order books.\n\nUnlike hidden orders, iceberg orders are divided into visible and hidden portions. When engaging in iceberg orders, visible order sizes must be set. The minimum visible size for an iceberg order is 1/20 of the total order size.\n\nWhen matching, the visible portions of iceberg orders are matched first. Once the visible portions are fully matched, hidden portions will emerge. This will continue until the order is fully filled.\n\nNote:\n\n- The system will charge taker fees for hidden orders and iceberg orders.\n- If you simultaneously set iceberg orders and hidden orders, your order will default to an iceberg order for execution.\n\n**Hold**\n\nFor limit price purchase orders, we will hold the amount of funds (price * size) required for your purchase order. Similarly, for limit price sell orders, we will also hold you sell order assets. When the transaction is executed, the service fees will be calculated. If you cancel a portion of a filled or unfilled order, then the remaining funds or amounts will be released and returned to your account. For market price buy/sell orders that require specific funds, we will hold the required funds in from your account. If only the size is specified, we may freeze (usually for a very short amount of time) all of the funds in your account prior to the order being filled or cancelled.\n\n\n**Order Lifecycle**\n\nWhen an order placement request is successful (the matching engine receives the order) or denied (due to there being insufficient funds or illegal parameter values, etc.), the system will respond to the HTTP request. When an order is successfully placed, the order ID is returned. The order will be matched, which could result in it being fully or partially filled. When an order is fully or partially filled, the remaining portions of the order will be in an active state awaiting to be matched (this does not include IOC orders). Orders that are fully or partially filled(already cancelled) will be put into the “done” state.\n\nUsers that have subscribed to the Market Data Channel can use the order ID (orderId) and client ID (clientOid) to identify messages.\n\n**Price Protection Mechanisms**\n\nPrice protection mechanisms ae enabled for order placements. Rules are detailed below:\n\n- If the spot trading market order/limit order placed by the user can be directly matched with an order in the current order book, the system will judge whether deviation between the price corresponding to the transaction depth and the spread exceeds the threshold value (the threshold value can be obtained using the symbol API endpoint);\n\n- If it is exceeded, for limit orders, the order will be directly cancelled;\n\n- If it is a market order, then the system will partially execute the order. The execution limit will be the order size within the price range corresponding to the threshold value. The remaining orders will not be filled.\n\nFor example: if the threshold value is 10%, when a user places a market price purchase order in the KCS/USDT trading market for 10,000 USDT (the selling price is currently 1.20000), the system will determine that after the order is completely filled, the final price will be 1.40000. (1.40000-1.20000)/1.20000=16.7%>10%. The threshold value is 1.32000. The user’s market price purchase order will be filled only to a maximum of 1.32000. The remaining order portions will not be matched with orders in the order book. Note: this feature may not be able to determine depth with complete accuracy. If your order is not completely filled, it may be because the portion exceeding the threshold value was not filled.\n", + "customApiFields": "{\"abandon\":\"abandon\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"Margin\",\"api-rate-limit-pool\":\"Spot\",\"sdk-service\":\"Margin\",\"sdk-sub-service\":\"Order\",\"sdk-method-name\":\"addOrderV1\",\"sdk-method-description\":\"Place order to the Cross-margin or Isolated-margin trading system, you can place two major types of orders: limit and market. Orders can only be placed if your account has sufficient funds. Once an order is placed, your funds will be put on hold for the duration of the order. The amount of funds on hold depends on the order type and parameters specified.\",\"api-rate-limit\":5}" } }, { - "name": "Cancel All Orders - V1", + "name": "Add Order Test - V1", "api": { - "id": "3470362", - "method": "delete", - "path": "/api/v1/orders", + "id": "3470313", + "method": "post", + "path": "/api/v1/margin/order/test", "parameters": { - "query": [ - { - "id": "2KbksGFfyd", - "name": "symbol", - "required": false, - "description": "Cancel all limit orders for a specific contract only, If not specified, all the limit orders will be deleted, Please refer to [Get Symbol endpoint: symbol](apidog://link/endpoint/3470220) ", - "example": "XBTUSDTM", - "type": "string", - "enable": true - } - ], + "query": [], "path": [], "cookie": [], "header": [] }, "responses": [ { - "id": "10701", + "id": "10477", "code": 200, - "name": "成功", + "name": "OK", "headers": [], "jsonSchema": { "type": "object", @@ -46557,16 +45692,28 @@ "data": { "type": "object", "properties": { - "cancelledOrderIds": { - "type": "array", - "items": { - "type": "string" - }, - "description": "Unique ID of the cancelled order" + "orderId": { + "type": "string", + "description": "The unique order id generated by the trading system,which can be used later for further actions such as canceling the order." + }, + "loanApplyId": { + "type": "string", + "description": "Borrow order id. The field is returned only after placing the order under the mode of Auto-Borrow." + }, + "borrowSize": { + "type": "string", + "description": "Borrowed amount. The field is returned only after placing the order under the mode of Auto-Borrow." + }, + "clientOid": { + "type": "string", + "description": "This return value is invalid" } }, "required": [ - "cancelledOrderIds" + "orderId", + "loanApplyId", + "borrowSize", + "clientOid" ] } }, @@ -46583,741 +45730,926 @@ "responseExamples": [ { "name": "Success", - "data": "{\n \"code\": \"200000\",\n \"data\": {\n \"cancelledOrderIds\": [\n \"235919172150824960\",\n \"235919172150824961\"\n ]\n }\n}", - "responseId": 10701, + "data": "{\n \"code\": \"200000\",\n \"data\": {\n \"orderId\": \"671bb90194422f00073ff4f0\",\n \"loanApplyId\": null,\n \"borrowSize\": null,\n \"clientOid\": null\n }\n}", + "responseId": 10477, "ordering": 1 } ], "requestBody": { - "type": "none", + "type": "application/json", "parameters": [], "jsonSchema": { "type": "object", - "properties": {} - }, - "example": "", - "mediaType": "" - }, - "description": ":::tip[TIPS]\nIt is recommended to use the **DELETE /api/v3/orders** endpoint instead of this endpoint\n:::\n\n:::info[Description]\nUsing this endpoint, all open orders (excluding stop orders) can be canceled in batches.\n\nThe response is a list of orderIDs of the canceled orders.\n:::\n", - "customApiFields": "{\"abandon\":\"abandon\",\"domain\":\"Futures\",\"api-channel\":\"Private\",\"api-permission\":\"Futures\",\"api-rate-limit-pool\":\"Futures\",\"sdk-service\":\"Futures\",\"sdk-sub-service\":\"Order\",\"sdk-method-name\":\"cancelAllOrdersV1\",\"sdk-method-description\":\"Cancel all open orders (excluding stop orders). The response is a list of orderIDs of the canceled orders.\",\"api-rate-limit\":200}" - } - } - ] - } - ] - }, - { - "name": "Developing", - "id": 348188, - "description": "", - "items": [] - } - ] - } - ], - "schemaCollection": [ - { - "id": 33, - "name": "Root", - "visibility": "SHARED", - "items": [ - { - "id": 35, - "name": "ws", - "visibility": "INHERITED", - "items": [ - { - "id": 36, - "name": "Spot", - "visibility": "INHERITED", - "items": [ - { - "id": 39, - "name": "Public", - "visibility": "INHERITED", - "items": [ - { - "name": "ticker", - "displayName": "", - "id": "#/definitions/56", - "description": "method: ticker\ntopic:/market/ticker:{symbol},{symbol}\nsummary:Get Ticker\ndescription:Subscribe to this topic to get the specified symbol push of BBO changes.\npush_frequency:once every 100ms", - "schema": { - "jsonSchema": { - "type": "object", - "properties": { - "type": { - "type": "string" - }, - "topic": { - "type": "string" - }, - "subject": { - "type": "string" - }, - "data": { - "type": "object", - "properties": { - "sequence": { - "description": "Sequence number", - "type": "string" - }, - "price": { - "description": "Last traded price", - "type": "string" - }, - "size": { - "description": "Last traded amount", - "type": "string" - }, - "bestAsk": { - "description": "Best ask price", - "type": "string" - }, - "bestAskSize": { - "description": "Best ask size", - "type": "string" - }, - "bestBid": { - "description": "Best bid price", - "type": "string" - }, - "bestBidSize": { - "description": "Best bid size", - "type": "string" - }, - "Time": { - "type": "integer", - "description": "The matching time of the latest transaction", - "format": "int64" - } + "properties": { + "clientOid": { + "type": "string", + "description": "Client Order Id,The ClientOid field is a unique ID created by the user(we recommend using a UUID), and can only contain numbers, letters, underscores (_), and hyphens (-). This field is returned when order information is obtained. You can use clientOid to tag your orders. ClientOid is different from the order ID created by the service provider. Please do not initiate requests using the same clientOid. The maximum length for the ClientOid is 40 characters.\n\nPlease remember the orderId created by the service provider, it used to check for updates in order status.", + "examples": [ + "5c52e11203aa677f33e493fb" + ] + }, + "side": { + "type": "string", + "description": "specify if the order is to 'buy' or 'sell'", + "enum": [ + "buy", + "sell" + ], + "examples": [ + "buy" + ], + "x-api-enum": [ + { + "value": "buy", + "name": "", + "description": "" + }, + { + "value": "sell", + "name": "", + "description": "" + } + ] + }, + "symbol": { + "type": "string", + "description": "symbol", + "examples": [ + "BTC-USDT", + "ETH-USDT", + "KCS-USDT" + ] + }, + "type": { + "type": "string", + "description": "specify if the order is an 'limit' order or 'market' order. \n\nThe type of order you specify when you place your order determines whether or not you need to request other parameters and also affects the execution of the matching engine.\n\nWhen placing a limit order, you must specify a price and size. The system will try to match the order according to market price or a price better than market price. If the order cannot be immediately matched, it will stay in the order book until it is matched or the user cancels.\n\nUnlike limit orders, the price for market orders fluctuates with market prices. When placing a market order, you do not need to specify a price, you only need to specify a quantity. Market orders are filled immediately and will not enter the order book. All market orders are takers and a taker fee will be charged.", + "enum": [ + "limit", + "market" + ], + "default": "limit", + "x-api-enum": [ + { + "value": "limit", + "name": "", + "description": "" + }, + { + "value": "market", + "name": "", + "description": "" + } + ] + }, + "stp": { + "type": "string", + "description": "[Self Trade Prevention](apidog://link/pages/5176570) is divided into four strategies: CN, CO, CB , and DC", + "enum": [ + "DC", + "CO", + "CN", + "CB" + ], + "x-api-enum": [ + { + "value": "DC", + "name": "", + "description": "" + }, + { + "value": "CO", + "name": "", + "description": "" + }, + { + "value": "CN", + "name": "", + "description": "" + }, + { + "value": "CB", + "name": "", + "description": "" + } + ] + }, + "price": { + "type": "string", + "description": "Specify price for order\n\nWhen placing a limit order, the price must be based on priceIncrement for the trading pair. The price increment (priceIncrement) is the price precision for the trading pair. For example, for the BTC-USDT trading pair, the priceIncrement is 0.00001000. So the price for your orders cannot be less than 0.00001000 and must be a multiple of priceIncrement. Otherwise, the order will return an invalid priceIncrement error." + }, + "size": { + "type": "string", + "description": "Specify quantity for order\n\nWhen **type** is limit, size refers to the amount of trading targets (the asset name written in front) for the trading pair. Teh Size must be based on the baseIncrement of the trading pair. The baseIncrement represents the precision for the trading pair. The size of an order must be a positive-integer multiple of baseIncrement and must be between baseMinSize and baseMaxSize.\n\nWhen **type** is market, select one out of two: size or funds" + }, + "timeInForce": { + "type": "string", + "description": "[Time in force](apidog://link/pages/5176570) is a special strategy used during trading", + "enum": [ + "GTC", + "GTT", + "IOC", + "FOK" + ], + "default": "GTC", + "x-api-enum": [ + { + "value": "GTC", + "name": "", + "description": "" + }, + { + "value": "GTT", + "name": "", + "description": "" + }, + { + "value": "IOC", + "name": "", + "description": "" + }, + { + "value": "FOK", + "name": "", + "description": "" + } + ] + }, + "postOnly": { + "type": "boolean", + "default": false, + "description": "passive order labels, this is disabled when the order timing strategy is IOC or FOK" + }, + "hidden": { + "type": "boolean", + "description": "Hidden or not (not shown in order book)", + "default": false + }, + "iceberg": { + "type": "boolean", + "description": "Whether or not only visible portions of orders are shown in iceberg orders", + "default": false + }, + "visibleSize": { + "type": "string", + "description": "Maximum visible quantity in iceberg orders" + }, + "cancelAfter": { + "type": "integer", + "format": "int64", + "description": "Cancel after n seconds,the order timing strategy is GTT" + }, + "funds": { + "type": "string", + "description": "When **type** is market, select one out of two: size or funds" + }, + "autoBorrow": { + "type": "boolean", + "description": "When Margin Account has inefficient balance, our system autoborrows inefficient assets and opens positions according to the lowest market interest rate.", + "default": false + }, + "autoRepay": { + "type": "boolean", + "description": "AutoPay allows returning borrowed assets when you close a position. Our system automatically triggers the repayment and the maximum repayment amount equals to the filled-order amount.", + "default": false + }, + "marginModel": { + "type": "string", + "description": "The type of trading, including cross (cross mode) and isolated (isolated mode). It is set at cross by default.", + "enum": [ + "cross", + "isolated" + ], + "default": "cross", + "x-api-enum": [ + { + "value": "cross", + "name": "", + "description": "" }, - "required": [ - "sequence", - "price", - "size", - "bestAsk", - "bestAskSize", - "bestBid", - "bestBidSize", - "Time" - ] - } + { + "value": "isolated", + "name": "", + "description": "" + } + ] + } + }, + "required": [ + "symbol", + "side", + "clientOid" + ] + }, + "example": "//limit order\n{\n \"type\": \"limit\",\n \"symbol\": \"BTC-USDT\",\n \"side\": \"buy\",\n \"price\": \"50000\",\n \"size\": \"0.00001\",\n \"clientOid\": \"5c52e11203aa677f33e4193fb\",\n \"remark\": \"order remarks\"\n}\n\n//market order 1\n// {\n// \"type\": \"market\",\n// \"symbol\": \"BTC-USDT\",\n// \"side\": \"buy\",\n// \"size\": \"0.00001\",\n// \"clientOid\": \"5c52e11203aa677f33e493fc\",\n// \"remark\": \"order remarks\"\n// }\n\n//market order 2\n// {\n// \"type\": \"market\",\n// \"symbol\": \"BTC-USDT\",\n// \"side\": \"buy\",\n// \"funds\": \"1\",\n// \"clientOid\": \"5c52e11203aa677f33e493fc\",\n// \"remark\": \"order remarks\"\n// }\n", + "mediaType": "" + }, + "description": ":::tip[TIPS]\nIt is recommended to use the **POST /api/v3/hf/margin/order/test** endpoint instead of this endpoint\n:::\n\n:::info[Description]\nOrder test endpoint, the request parameters and return parameters of this endpoint are exactly the same as the order endpoint, and can be used to verify whether the signature is correct and other operations. After placing an order, the order will not enter the matching system, and the order cannot be queried.\n:::\n\n:::tip[Tips]\nPlease note that once your order enters the order book, the system will freeze the handling fees for the order ahead of time.\n\nBefore placing orders, please be sure to fully understand the meaning of the parameters for each trading pair.\n:::\n\n:::tip[Tips]\nThe maximum number of active orders per account is 2000, with a maximum of 200 active orders per trading pair.\n:::\n\n\n**Public order placement request parameters**\n\n| Param | Type | Mandatory | Description |\n| --------- | ------ | --------- | ----------- |\n| clientOid | String | Yes | Client Order Id,unique identifier created by the user, the use of UUID is recommended |\n| symbol | String | Yes | symbol |\n| side | String | Yes | `buy` or `sell` |\n| type | String | No | Order type `limit` and `market`, defult is limit |\n| stp | String | No | self trade prevention is divided into four strategies: `CN`, `CO`, `CB` , and `DC` |\n| marginModel | String | No | The type of trading, including cross (cross mode) and isolated (isolated mode). It is set at cross by default. |\n| autoBorrow | boolean | No | When Margin Account has inefficient balance, our system autoborrows inefficient assets and opens positions according to the lowest market interest rate. |\n| autoRepay | boolean | No | AutoPay allows returning borrowed assets when you close a position. Our system automatically triggers the repayment and the maximum repayment amount equals to the filled-order amount. |\n\n**Additional Request Parameters Required by `limit` Orders**\n\n| Param | Type | Mandatory | Description |\n| ----------- | ------- | --------- | ----------- |\n| price | String | Yes | Specify price for currency |\n| size | String | Yes | Specify quantity for currency |\n| timeInForce | String | No | Order timing strategy `GTC`, `GTT`, `IOC`, `FOK` (The default is `GTC`) |\n| cancelAfter | long | No | Cancel after `n` seconds,the order timing strategy is `GTT` |\n| postOnly | boolean | No | passive order labels, this is disabled when the order timing strategy is `IOC` or `FOK` |\n| hidden | boolean | No | Hidden or not (not shown in order book) |\n| iceberg | boolean | No | Whether or not only visible portions of orders are shown in iceberg orders |\n| visibleSize | String | No | Maximum visible quantity in iceberg orders |\n\n**Additional request parameters required by `market` orders**\n\n| Param | Type | Mandatory | Description |\n| ----- | ------ | --------- | ------------------------------------------ |\n| size | String | No | (Select one out of two: `size` or `funds`) |\n| funds | String | No | (Select one out of two: `size` or `funds`) |\n\n\n\n**Hidden Orders and Iceberg Orders (Hidden & Iceberg)**\n\nHidden orders and iceberg orders can be set in advanced settings (iceberg orders are a special type of hidden orders). When placing limit orders or stop limit orders, you can choose to execute according to hidden orders or iceberg orders.\n\nHidden orders are not shown in order books.\n\nUnlike hidden orders, iceberg orders are divided into visible and hidden portions. When engaging in iceberg orders, visible order sizes must be set. The minimum visible size for an iceberg order is 1/20 of the total order size.\n\nWhen matching, the visible portions of iceberg orders are matched first. Once the visible portions are fully matched, hidden portions will emerge. This will continue until the order is fully filled.\n\nNote:\n\n- The system will charge taker fees for hidden orders and iceberg orders.\n- If you simultaneously set iceberg orders and hidden orders, your order will default to an iceberg order for execution.\n\n**Hold**\n\nFor limit price purchase orders, we will hold the amount of funds (price * size) required for your purchase order. Similarly, for limit price sell orders, we will also hold you sell order assets. When the transaction is executed, the service fees will be calculated. If you cancel a portion of a filled or unfilled order, then the remaining funds or amounts will be released and returned to your account. For market price buy/sell orders that require specific funds, we will hold the required funds in from your account. If only the size is specified, we may freeze (usually for a very short amount of time) all of the funds in your account prior to the order being filled or cancelled.\n\n\n**Order Lifecycle**\n\nWhen an order placement request is successful (the matching engine receives the order) or denied (due to there being insufficient funds or illegal parameter values, etc.), the system will respond to the HTTP request. When an order is successfully placed, the order ID is returned. The order will be matched, which could result in it being fully or partially filled. When an order is fully or partially filled, the remaining portions of the order will be in an active state awaiting to be matched (this does not include IOC orders). Orders that are fully or partially filled(already cancelled) will be put into the “done” state.\n\nUsers that have subscribed to the Market Data Channel can use the order ID (orderId) and client ID (clientOid) to identify messages.\n\n**Price Protection Mechanisms**\n\nPrice protection mechanisms ae enabled for order placements. Rules are detailed below:\n\n- If the spot trading market order/limit order placed by the user can be directly matched with an order in the current order book, the system will judge whether deviation between the price corresponding to the transaction depth and the spread exceeds the threshold value (the threshold value can be obtained using the symbol API endpoint);\n\n- If it is exceeded, for limit orders, the order will be directly cancelled;\n\n- If it is a market order, then the system will partially execute the order. The execution limit will be the order size within the price range corresponding to the threshold value. The remaining orders will not be filled.\n\nFor example: if the threshold value is 10%, when a user places a market price purchase order in the KCS/USDT trading market for 10,000 USDT (the selling price is currently 1.20000), the system will determine that after the order is completely filled, the final price will be 1.40000. (1.40000-1.20000)/1.20000=16.7%>10%. The threshold value is 1.32000. The user’s market price purchase order will be filled only to a maximum of 1.32000. The remaining order portions will not be matched with orders in the order book. Note: this feature may not be able to determine depth with complete accuracy. If your order is not completely filled, it may be because the portion exceeding the threshold value was not filled.\n", + "customApiFields": "{\"abandon\":\"abandon\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"Margin\",\"api-rate-limit-pool\":\"Spot\",\"sdk-service\":\"Margin\",\"sdk-sub-service\":\"Order\",\"sdk-method-name\":\"addOrderTestV1\",\"sdk-method-description\":\"Order test endpoint, the request parameters and return parameters of this endpoint are exactly the same as the order endpoint, and can be used to verify whether the signature is correct and other operations. After placing an order, the order will not enter the matching system, and the order cannot be queried.\",\"api-rate-limit\":5}" + } + }, + { + "name": "Get Account List - Isolated Margin - V1", + "api": { + "id": "3470314", + "method": "get", + "path": "/api/v1/isolated/accounts", + "parameters": { + "query": [ + { + "id": "PjWvwo4LmP", + "name": "balanceCurrency", + "required": false, + "description": "quote currency, currently only supports USDT, KCS, BTC, USDT as default", + "example": "USDT", + "type": "string", + "schema": { + "type": "string", + "default": "BTC", + "enum": [ + "USDT", + "KCS", + "BTC" + ], + "x-api-enum": [ + { + "value": "USDT", + "name": "", + "description": "" + }, + { + "value": "KCS", + "name": "", + "description": "" + }, + { + "value": "BTC", + "name": "", + "description": "" + } + ] }, - "required": [ - "type", - "topic", - "subject", - "data" - ], - "x-apidog-refs": {}, - "x-example": "{\"type\":\"message\",\"topic\":\"/market/ticker:BTC-USDT\",\"subject\":\"trade.ticker\",\"data\":{\"sequence\":\"1545896668986\",\"price\":\"0.08\",\"size\":\"0.011\",\"bestAsk\":\"0.08\",\"bestAskSize\":\"0.18\",\"bestBid\":\"0.049\",\"bestBidSize\":\"0.036\",\"Time\":1704873323416}}" + "enable": true } - }, - "visibility": "INHERITED" + ], + "path": [], + "cookie": [], + "header": [] }, - { - "name": "symbolSnapshot", - "displayName": "", - "id": "#/definitions/58", - "description": "method:symbolSnapshot\ntopic:/market/snapshot:{symbol}\nsummary:Symbol Snapshot\ndescription:Subscribe to get snapshot data for a single symbol.\npush_frequency:once every 2s", - "schema": { + "responses": [ + { + "id": "10478", + "code": 200, + "name": "OK", + "headers": [], "jsonSchema": { "type": "object", "properties": { - "topic": { - "type": "string" - }, - "type": { - "type": "string" - }, - "subject": { + "code": { "type": "string" }, "data": { "type": "object", "properties": { - "sequence": { - "type": "string" + "totalConversionBalance": { + "type": "string", + "description": "The total balance of the isolated margin account(in the request coin)" }, - "data": { - "type": "object", - "properties": { - "askSize": { - "type": "number" - }, - "averagePrice": { - "type": "number" - }, - "baseCurrency": { - "type": "string" - }, - "bidSize": { - "type": "number" - }, - "board": { - "type": "integer", - "description": "Trading pair partition: 0.primary partition 1.KuCoin Plus\", example = \"1\"", - "enum": [ - 0, - 1 - ], - "x-api-enum": [ - { - "value": 0, - "name": "", - "description": "primary partition" - }, - { - "value": 1, - "name": "", - "description": "KuCoin Plus" - } - ] - }, - "buy": { - "type": "number" - }, - "changePrice": { - "type": "number" - }, - "changeRate": { - "type": "number" - }, - "close": { - "type": "number" - }, - "datetime": { - "type": "integer", - "format": "int64" - }, - "high": { - "type": "number" - }, - "lastTradedPrice": { - "type": "number" - }, - "low": { - "type": "number" - }, - "makerCoefficient": { - "type": "number" - }, - "makerFeeRate": { - "type": "number" - }, - "marginTrade": { - "type": "boolean" - }, - "mark": { - "type": "integer", - "description": "Trading Pair Mark: 0.default 1.ST. 2.NEW\", example = \"1\"", - "enum": [ - 0, - 1, - 2 - ], - "x-api-enum": [ - { - "value": 0, - "name": "", - "description": "default" - }, - { - "value": 1, - "name": "", - "description": "ST" - }, - { - "value": 2, - "name": "", - "description": "NEW" - } - ] - }, - "market": { - "type": "string" - }, - "marketChange1h": { - "type": "object", - "properties": { - "changePrice": { - "type": "number" - }, - "changeRate": { - "type": "number" - }, - "high": { - "type": "number" - }, - "low": { - "type": "number" - }, - "open": { - "type": "number" - }, - "vol": { - "type": "number" - }, - "volValue": { - "type": "number" - } + "liabilityConversionBalance": { + "type": "string", + "description": "Total liabilities of the isolated margin account(in the request coin)" + }, + "assets": { + "type": "array", + "items": { + "type": "object", + "properties": { + "symbol": { + "type": "string", + "description": "Symbol" }, - "required": [ - "changePrice", - "changeRate", - "high", - "low", - "open", - "vol", - "volValue" - ] - }, - "marketChange24h": { - "type": "object", - "properties": { - "changePrice": { - "type": "number" - }, - "changeRate": { - "type": "number" - }, - "high": { - "type": "number" - }, - "low": { - "type": "number" - }, - "open": { - "type": "number" - }, - "vol": { - "type": "number" - }, - "volValue": { - "type": "number" - } + "status": { + "type": "string", + "description": "The position status: Existing liabilities-DEBT, No liabilities-CLEAR, Bankrupcy (after position enters a negative balance)-BANKRUPTCY, Existing borrowings-IN_BORROW, Existing repayments-IN_REPAY, Under liquidation-IN_LIQUIDATION, Under auto-renewal assets-IN_AUTO_RENEW .", + "enum": [ + "DEBT", + "CLEAR", + "BANKRUPTCY", + "IN_BORROW", + "IN_REPAY", + "IN_LIQUIDATION", + "IN_AUTO_RENEW" + ], + "x-api-enum": [ + { + "value": "DEBT", + "name": "", + "description": "" + }, + { + "value": "CLEAR", + "name": "", + "description": "" + }, + { + "value": "BANKRUPTCY", + "name": "", + "description": "" + }, + { + "value": "IN_BORROW", + "name": "", + "description": "" + }, + { + "value": "IN_REPAY", + "name": "", + "description": "" + }, + { + "value": "IN_LIQUIDATION", + "name": "", + "description": "" + }, + { + "value": "IN_AUTO_RENEW", + "name": "", + "description": "" + } + ] }, - "required": [ - "changePrice", - "changeRate", - "high", - "low", - "open", - "vol", - "volValue" - ] - }, - "marketChange4h": { - "type": "object", - "properties": { - "changePrice": { - "type": "number" - }, - "changeRate": { - "type": "number" - }, - "high": { - "type": "number" - }, - "low": { - "type": "number" - }, - "open": { - "type": "number" - }, - "vol": { - "type": "number" + "debtRatio": { + "type": "string", + "description": "debt ratio" + }, + "baseAsset": { + "type": "object", + "properties": { + "currency": { + "type": "string", + "description": "currency" + }, + "totalBalance": { + "type": "string", + "description": "Current currency total asset amount" + }, + "holdBalance": { + "type": "string", + "description": "Current currency holding asset amount" + }, + "availableBalance": { + "type": "string", + "description": "Current available asset amount" + }, + "liability": { + "type": "string", + "description": "Liabilities" + }, + "interest": { + "type": "string" + }, + "borrowableAmount": { + "type": "string" + } }, - "volValue": { - "type": "number" - } + "required": [ + "currency", + "totalBalance", + "holdBalance", + "availableBalance", + "liability", + "interest", + "borrowableAmount" + ], + "description": "base asset" }, - "required": [ - "changePrice", - "changeRate", - "high", - "low", - "open", - "vol", - "volValue" - ] - }, - "markets": { - "type": "array", - "items": { - "type": "string" - } - }, - "open": { - "type": "number" - }, - "quoteCurrency": { - "type": "string" - }, - "sell": { - "type": "number" - }, - "siteTypes": { - "type": "array", - "items": { - "type": "string" - } - }, - "sort": { - "type": "integer", - "description": "sorting number(Pointless)" - }, - "symbol": { - "type": "string" - }, - "symbolCode": { - "type": "string" - }, - "takerCoefficient": { - "type": "number" - }, - "takerFeeRate": { - "type": "number" - }, - "trading": { - "type": "boolean" - }, - "vol": { - "type": "number" + "quoteAsset": { + "type": "object", + "properties": { + "currency": { + "type": "string", + "description": "currency" + }, + "totalBalance": { + "type": "string", + "description": "Current currency total asset amount" + }, + "holdBalance": { + "type": "string", + "description": "Current currency holding asset amount" + }, + "availableBalance": { + "type": "string", + "description": "Current available asset amount" + }, + "liability": { + "type": "string", + "description": "Liabilities" + }, + "interest": { + "type": "string" + }, + "borrowableAmount": { + "type": "string" + } + }, + "required": [ + "currency", + "totalBalance", + "holdBalance", + "availableBalance", + "liability", + "interest", + "borrowableAmount" + ], + "description": "quote asset" + } }, - "volValue": { - "type": "number", - "description": "24-hour rolling transaction volume, refreshed every 2s" - } + "required": [ + "symbol", + "status", + "debtRatio", + "baseAsset", + "quoteAsset" + ] }, - "required": [ - "askSize", - "averagePrice", - "baseCurrency", - "bidSize", - "board", - "buy", - "changePrice", - "changeRate", - "close", - "datetime", - "high", - "lastTradedPrice", - "low", - "makerCoefficient", - "makerFeeRate", - "marginTrade", - "mark", - "market", - "marketChange1h", - "marketChange24h", - "marketChange4h", - "markets", - "open", - "quoteCurrency", - "sell", - "siteTypes", - "sort", - "symbol", - "symbolCode", - "takerCoefficient", - "takerFeeRate", - "trading", - "vol", - "volValue" - ] + "description": "Account list" } }, "required": [ - "sequence", - "data" + "totalConversionBalance", + "liabilityConversionBalance", + "assets" ] } }, "required": [ - "topic", - "type", - "subject", + "code", "data" - ], - "x-example": "{\"topic\":\"/market/snapshot:BTC-USDT\",\"type\":\"message\",\"subject\":\"trade.snapshot\",\"data\":{\"sequence\":\"14691517895\",\"data\":{\"askSize\":1.15955795,\"averagePrice\":66867.89967612,\"baseCurrency\":\"BTC\",\"bidSize\":0.81772627,\"board\":1,\"buy\":67158.1,\"changePrice\":315.20000000000000000000,\"changeRate\":0.0047,\"close\":67158.1,\"datetime\":1729758286011,\"high\":67611.80000000000000000000,\"lastTradedPrice\":67158.1,\"low\":65257.10000000000000000000,\"makerCoefficient\":1.000000,\"makerFeeRate\":0.001,\"marginTrade\":true,\"mark\":0,\"market\":\"USDS\",\"marketChange1h\":{\"changePrice\":-102.10000000000000000000,\"changeRate\":-0.0015,\"high\":67310.60000000000000000000,\"low\":67051.80000000000000000000,\"open\":67260.20000000000000000000,\"vol\":53.73698081000000000000,\"volValue\":3609965.13819127700000000000},\"marketChange24h\":{\"changePrice\":315.20000000000000000000,\"changeRate\":0.0047,\"high\":67611.80000000000000000000,\"low\":65257.10000000000000000000,\"open\":66842.90000000000000000000,\"vol\":2227.69895852000000000000,\"volValue\":147972941.07857507300000000000},\"marketChange4h\":{\"changePrice\":-166.30000000000000000000,\"changeRate\":-0.0024,\"high\":67476.60000000000000000000,\"low\":67051.80000000000000000000,\"open\":67324.40000000000000000000,\"vol\":173.76971188000000000000,\"volValue\":11695949.43841656500000000000},\"markets\":[\"USDS\",\"PoW\"],\"open\":66842.90000000000000000000,\"quoteCurrency\":\"USDT\",\"sell\":67158.2,\"siteTypes\":[\"turkey\",\"thailand\",\"global\"],\"sort\":100,\"symbol\":\"BTC-USDT\",\"symbolCode\":\"BTC-USDT\",\"takerCoefficient\":1.000000,\"takerFeeRate\":0.001,\"trading\":true,\"vol\":2227.69895852000000000000,\"volValue\":147972941.07857507300000000000}}}" - } + ] + }, + "description": "", + "contentType": "json", + "mediaType": "" + } + ], + "responseExamples": [ + { + "name": "Success", + "data": "{\n \"code\": \"200000\",\n \"data\": {\n \"totalConversionBalance\": \"0.01\",\n \"liabilityConversionBalance\": \"0\",\n \"assets\": [\n {\n \"symbol\": \"BTC-USDT\",\n \"status\": \"CLEAR\",\n \"debtRatio\": \"0\",\n \"baseAsset\": {\n \"currency\": \"BTC\",\n \"totalBalance\": \"0\",\n \"holdBalance\": \"0\",\n \"availableBalance\": \"0\",\n \"liability\": \"0\",\n \"interest\": \"0\",\n \"borrowableAmount\": \"0\"\n },\n \"quoteAsset\": {\n \"currency\": \"USDT\",\n \"totalBalance\": \"0.01\",\n \"holdBalance\": \"0\",\n \"availableBalance\": \"0.01\",\n \"liability\": \"0\",\n \"interest\": \"0\",\n \"borrowableAmount\": \"0\"\n }\n }\n ]\n }\n}", + "responseId": 10478, + "ordering": 1 + } + ], + "requestBody": { + "type": "none", + "parameters": [], + "jsonSchema": { + "type": "object", + "properties": {} }, - "visibility": "INHERITED" + "mediaType": "" }, - { - "name": "orderbookLevel1", - "displayName": "", - "id": "#/definitions/60", - "description": "method:orderbookLevel1\ntopic:/spotMarket/level1:{symbol},{symbol}\nsummary:Orderbook - Level1\ndescription:The system will return the 1 best ask/bid orders data, A topic supports up to 100 symbols. If there is no change in the market, data will not be pushed\npush_frequency:once every 10ms", - "schema": { - "jsonSchema": { - "type": "object", - "properties": { - "topic": { - "type": "string" - }, - "type": { - "type": "string" - }, - "subject": { - "type": "string" - }, - "data": { - "type": "object", - "properties": { - "asks": { - "type": "array", - "items": { - "type": "string" - }, - "description": "price, size" - }, - "bids": { - "type": "array", - "items": { - "type": "string" - } - }, - "timestamp": { - "type": "integer", - "format": "int64" - } - }, - "required": [ - "asks", - "bids", - "timestamp" - ] - } - }, - "required": [ - "topic", - "type", - "subject", - "data" - ], - "x-example": "{\"topic\":\"/spotMarket/level1:BTC-USDT\",\"type\":\"message\",\"subject\":\"level1\",\"data\":{\"asks\":[\"68145.8\",\"0.51987471\"],\"bids\":[\"68145.7\",\"1.29267802\"],\"timestamp\":1729816058766}}" + "description": ":::tip[TIPS]\nIt is recommended to use the **GET /api/v3/isolated/accounts** endpoint instead of this endpoint\n:::\n\n:::info[Description]\nRequest via this endpoint to get the info list of the isolated margin account.\n:::", + "customApiFields": "{\"abandon\":\"abandon\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"General\",\"api-rate-limit-pool\":\"Spot\",\"sdk-service\":\"Account\",\"sdk-sub-service\":\"Account\",\"sdk-method-name\":\"getIsolatedMarginAccountListV1\",\"sdk-method-description\":\"Request via this endpoint to get the info list of the isolated margin account.\",\"api-rate-limit\":50}" + } + }, + { + "name": "Get Account Detail - Isolated Margin - V1", + "api": { + "id": "3470315", + "method": "get", + "path": "/api/v1/isolated/account/{symbol}", + "parameters": { + "query": [], + "path": [ + { + "id": "symbol#0", + "name": "symbol", + "required": true, + "description": "", + "type": "string", + "enable": true } - }, - "visibility": "INHERITED" + ], + "cookie": [], + "header": [] }, - { - "name": "orderbookLevel5", - "displayName": "", - "id": "#/definitions/61", - "description": "method:orderbookLevel5\ntopic:/spotMarket/level2Depth5:{symbol},{symbol}\nsummary:Orderbook - Level5\ndescription:The system will return the 5 best ask/bid orders data,A topic supports up to 100 symbols. If there is no change in the market, data will not be pushed\npush_frequency:once every 100ms", - "schema": { + "responses": [ + { + "id": "10479", + "code": 200, + "name": "OK", + "headers": [], "jsonSchema": { "type": "object", "properties": { - "topic": { - "type": "string" - }, - "type": { - "type": "string" - }, - "subject": { + "code": { "type": "string" }, "data": { "type": "object", "properties": { - "asks": { - "type": "array", - "items": { - "type": "array", - "items": { + "symbol": { + "type": "string", + "description": "Symbol" + }, + "status": { + "type": "string", + "description": "The position status: Existing liabilities-DEBT, No liabilities-CLEAR, Bankrupcy (after position enters a negative balance)-BANKRUPTCY, Existing borrowings-IN_BORROW, Existing repayments-IN_REPAY, Under liquidation-IN_LIQUIDATION, Under auto-renewal assets-IN_AUTO_RENEW .", + "enum": [ + "DEBT", + "CLEAR", + "BANKRUPTCY", + "IN_BORROW", + "IN_REPAY", + "IN_LIQUIDATION", + "IN_AUTO_RENEW" + ], + "x-api-enum": [ + { + "value": "DEBT", + "name": "", + "description": "" + }, + { + "value": "CLEAR", + "name": "", + "description": "" + }, + { + "value": "BANKRUPTCY", + "name": "", + "description": "" + }, + { + "value": "IN_BORROW", + "name": "", + "description": "" + }, + { + "value": "IN_REPAY", + "name": "", + "description": "" + }, + { + "value": "IN_LIQUIDATION", + "name": "", + "description": "" + }, + { + "value": "IN_AUTO_RENEW", + "name": "", + "description": "" + } + ] + }, + "debtRatio": { + "type": "string", + "description": "debt ratio" + }, + "baseAsset": { + "type": "object", + "properties": { + "currency": { + "type": "string", + "description": "currency" + }, + "totalBalance": { + "type": "string", + "description": "Current currency total asset amount" + }, + "holdBalance": { + "type": "string", + "description": "Current currency holding asset amount" + }, + "availableBalance": { + "type": "string", + "description": "Current available asset amount" + }, + "liability": { + "type": "string", + "description": "Liabilities" + }, + "interest": { + "type": "string" + }, + "borrowableAmount": { "type": "string" } }, - "description": "price, size" + "required": [ + "currency", + "totalBalance", + "holdBalance", + "availableBalance", + "liability", + "interest", + "borrowableAmount" + ], + "description": "base asset" }, - "bids": { - "type": "array", - "items": { - "type": "array", - "items": { + "quoteAsset": { + "type": "object", + "properties": { + "currency": { + "type": "string", + "description": "currency" + }, + "totalBalance": { + "type": "string", + "description": "Current currency total asset amount" + }, + "holdBalance": { + "type": "string", + "description": "Current currency holding asset amount" + }, + "availableBalance": { + "type": "string", + "description": "Current available asset amount" + }, + "liability": { + "type": "string", + "description": "Liabilities" + }, + "interest": { + "type": "string" + }, + "borrowableAmount": { "type": "string" } - } - }, - "timestamp": { - "type": "integer", - "format": "int64" + }, + "required": [ + "currency", + "totalBalance", + "holdBalance", + "availableBalance", + "liability", + "interest", + "borrowableAmount" + ], + "description": "quote asset" } }, "required": [ - "asks", - "bids", - "timestamp" + "symbol", + "status", + "debtRatio", + "baseAsset", + "quoteAsset" ] } }, "required": [ - "topic", - "type", - "subject", + "code", "data" - ], - "x-example": "{\"topic\":\"/spotMarket/level2Depth5:BTC-USDT\",\"type\":\"message\",\"subject\":\"level2\",\"data\":{\"asks\":[[\"67996.7\",\"1.14213262\"],[\"67996.8\",\"0.21748212\"],[\"67996.9\",\"0.1503747\"],[\"67997\",\"0.11446863\"],[\"67997.1\",\"0.14842782\"]],\"bids\":[[\"67996.6\",\"0.37969491\"],[\"67995.3\",\"0.20779746\"],[\"67994.5\",\"0.00047785\"],[\"67993.4\",\"0.405\"],[\"67993.3\",\"0.13528566\"]],\"timestamp\":1729822226746}}" - } + ] + }, + "description": "", + "contentType": "json", + "mediaType": "" + } + ], + "responseExamples": [ + { + "name": "Success", + "data": "{\n \"code\": \"200000\",\n \"data\": {\n \"symbol\": \"BTC-USDT\",\n \"status\": \"CLEAR\",\n \"debtRatio\": \"0\",\n \"baseAsset\": {\n \"currency\": \"BTC\",\n \"totalBalance\": \"0\",\n \"holdBalance\": \"0\",\n \"availableBalance\": \"0\",\n \"liability\": \"0\",\n \"interest\": \"0\",\n \"borrowableAmount\": \"0\"\n },\n \"quoteAsset\": {\n \"currency\": \"USDT\",\n \"totalBalance\": \"0.01\",\n \"holdBalance\": \"0\",\n \"availableBalance\": \"0.01\",\n \"liability\": \"0\",\n \"interest\": \"0\",\n \"borrowableAmount\": \"0\"\n }\n }\n}", + "responseId": 10479, + "ordering": 1 + } + ], + "requestBody": { + "type": "none", + "parameters": [], + "jsonSchema": { + "type": "object", + "properties": {} }, - "visibility": "INHERITED" + "mediaType": "" }, - { - "name": "orderbookLevel50", - "displayName": "", - "id": "#/definitions/63", - "description": "method:orderbookLevel50\ntopic:/market/level2:{symbol},{symbol}\nsummary:Orderbook - Level50\ndescription:The system will return the 50 best ask/bid orders data, A topic supports up to 100 symbols. If there is no change in the market, data will not be pushed\npush_frequency:once every 100ms", - "schema": { + "description": ":::tip[TIPS]\nIt is recommended to use the **GET /api/v3/isolated/accounts** endpoint instead of this endpoint\n:::\n\n:::info[Description]\nRequest via this endpoint to get the info of the isolated margin account.\n:::", + "customApiFields": "{\"abandon\":\"abandon\",\"domain\":\"Spot\",\"api-channel\":\"Private\",\"api-permission\":\"General\",\"api-rate-limit-pool\":\"Spot\",\"sdk-service\":\"Account\",\"sdk-sub-service\":\"Account\",\"sdk-method-name\":\"getIsolatedMarginAccountDetailV1\",\"sdk-method-description\":\"Request via this endpoint to get the info of the isolated margin account.\",\"api-rate-limit\":50}" + } + } + ] + }, + { + "name": "Futures Trading", + "id": 348177, + "description": "", + "items": [ + { + "name": "Modify Isolated Margin Auto-Deposit Status", + "api": { + "id": "3470255", + "method": "post", + "path": "/api/v1/position/margin/auto-deposit-status", + "parameters": { + "query": [], + "path": [], + "cookie": [], + "header": [] + }, + "responses": [ + { + "id": "10419", + "code": 200, + "name": "成功", + "headers": [], "jsonSchema": { "type": "object", "properties": { - "type": { - "type": "string" - }, - "topic": { - "type": "string" - }, - "subject": { + "code": { "type": "string" }, "data": { - "type": "object", - "properties": { - "changes": { - "type": "object", - "properties": { - "asks": { - "type": "array", - "items": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "bids": { - "type": "array", - "items": { - "type": "array", - "items": { - "type": "string" - } - } - } - }, - "required": [ - "asks", - "bids" - ] - }, - "sequenceEnd": { - "type": "integer", - "format": "int64" - }, - "sequenceStart": { - "type": "integer", - "format": "int64" - }, - "symbol": { - "type": "string" - }, - "time": { - "type": "integer", - "format": "int64" - } - }, - "required": [ - "changes", - "sequenceEnd", - "sequenceStart", - "symbol", - "time" - ] + "type": "boolean" } }, - "required": [ - "type", - "topic", - "subject", - "data" - ], - "x-example": "{\"topic\":\"/spotMarket/level2Depth50:BTC-USDT\",\"type\":\"message\",\"subject\":\"level2\",\"data\":{\"asks\":[[\"95964.3\",\"0.08168874\"],[\"95967.9\",\"0.00985094\"],[\"95969.9\",\"0.00078081\"],[\"95971.2\",\"0.10016039\"],[\"95971.3\",\"0.12531139\"],[\"95971.7\",\"0.00291\"],[\"95971.9\",\"0.10271829\"],[\"95973.3\",\"0.00021\"],[\"95974.7\",\"0.10271829\"],[\"95976.9\",\"0.03095177\"],[\"95977\",\"0.10271829\"],[\"95978.7\",\"0.00022411\"],[\"95979.1\",\"0.00023017\"],[\"95981\",\"0.00022008\"],[\"95981.2\",\"0.14330324\"],[\"95982.3\",\"0.27922082\"],[\"95982.5\",\"0.02302674\"],[\"95983.8\",\"0.00011035\"],[\"95985\",\"0.00104222\"],[\"95985.1\",\"0.00021808\"],[\"95985.5\",\"0.211127\"],[\"95986.2\",\"0.09690904\"],[\"95986.3\",\"0.31261\"],[\"95986.9\",\"0.09225037\"],[\"95987\",\"0.01042013\"],[\"95990.5\",\"0.12712438\"],[\"95990.6\",\"0.0916115\"],[\"95992.2\",\"0.279\"],[\"95992.7\",\"0.00521084\"],[\"95995.2\",\"0.00033\"],[\"95999.1\",\"0.02973561\"],[\"96001.1\",\"0.083825\"],[\"96002.6\",\"0.01900906\"],[\"96002.7\",\"0.00041665\"],[\"96002.8\",\"0.12531139\"],[\"96002.9\",\"0.279\"],[\"96004.8\",\"0.02081884\"],[\"96006.3\",\"0.00065542\"],[\"96008.5\",\"0.00033166\"],[\"96011\",\"0.08776246\"],[\"96012.5\",\"0.279\"],[\"96013.3\",\"0.00066666\"],[\"96013.9\",\"0.26097183\"],[\"96014\",\"0.01087009\"],[\"96017\",\"0.06248892\"],[\"96017.1\",\"0.20829641\"],[\"96022\",\"0.00107066\"],[\"96022.1\",\"0.279\"],[\"96022.9\",\"0.0006499\"],[\"96024.6\",\"0.00104131\"]],\"bids\":[[\"95964.2\",\"1.35483359\"],[\"95964.1\",\"0.01117492\"],[\"95962.1\",\"0.0062\"],[\"95961.8\",\"0.03081549\"],[\"95961.7\",\"0.10271829\"],[\"95958.5\",\"0.04681571\"],[\"95958.4\",\"0.05177498\"],[\"95958.2\",\"0.00155911\"],[\"95957.8\",\"0.10271829\"],[\"95954.7\",\"0.16312181\"],[\"95954.6\",\"0.44102109\"],[\"95952.6\",\"0.10271829\"],[\"95951.3\",\"0.0062\"],[\"95951\",\"0.17075141\"],[\"95950.9\",\"0.279\"],[\"95949.5\",\"0.13567811\"],[\"95949.2\",\"0.05177498\"],[\"95948.3\",\"0.10271829\"],[\"95947.2\",\"0.04634798\"],[\"95944.7\",\"0.10271829\"],[\"95944.2\",\"0.05177498\"],[\"95942.3\",\"0.26028569\"],[\"95942.2\",\"0.10271829\"],[\"95940.6\",\"0.12531139\"],[\"95940.2\",\"0.43349327\"],[\"95938.3\",\"0.01041604\"],[\"95937.4\",\"0.04957577\"],[\"95937.2\",\"0.00305\"],[\"95936.3\",\"0.10271829\"],[\"95934\",\"0.05177498\"],[\"95931.9\",\"0.03394093\"],[\"95931.8\",\"0.10271829\"],[\"95930\",\"0.01041814\"],[\"95927.9\",\"0.10271829\"],[\"95927\",\"0.13312774\"],[\"95926.9\",\"0.33077498\"],[\"95924.9\",\"0.10271829\"],[\"95924\",\"0.00180915\"],[\"95923.8\",\"0.00022434\"],[\"95919.6\",\"0.00021854\"],[\"95919.1\",\"0.01471872\"],[\"95919\",\"0.05177498\"],[\"95918.1\",\"0.00001889\"],[\"95917.8\",\"0.1521089\"],[\"95917.5\",\"0.00010962\"],[\"95916.2\",\"0.00021958\"],[\"95915.5\",\"0.12531139\"],[\"95915.3\",\"0.279\"],[\"95913.6\",\"0.01739249\"],[\"95913.5\",\"0.05177498\"]],\"timestamp\":1733124805073}}" - } + "required": [ + "code", + "data" + ] + }, + "description": "", + "contentType": "json", + "mediaType": "" + } + ], + "responseExamples": [ + { + "name": "Success", + "data": "{\n \"code\": \"200000\",\n \"data\": true\n}", + "responseId": 10419, + "ordering": 1 + } + ], + "requestBody": { + "type": "application/json", + "parameters": [], + "jsonSchema": { + "type": "object", + "properties": { + "symbol": { + "type": "string", + "description": "Symbol of the contract\n", + "examples": [ + "XBTUSDTM", + "ETHUSDTM" + ] + }, + "status": { + "type": "boolean", + "description": "Status" + } + }, + "required": [ + "symbol", + "status" + ] }, - "visibility": "INHERITED" + "example": "{\n \"symbol\": \"XBTUSDTM\",\n \"status\": true\n}", + "mediaType": "" }, - { - "name": "klines", - "displayName": "", - "id": "#/definitions/64", - "description": "method:klines\ntopic:/market/candles:{symbol}_{type}\nsummary:Klines\ndescription:Subscribe to this topic to get K-Line data.\npush_frequency:real-time", - "schema": { + "description": ":::tip[TIPS]\nCurrently, it is not recommended to use the Isolated margin + auto deposit margin . It is recommended to switch to the cross margin mode.\nPlease refer to **POST /api/v2/position/changeMarginMode** endpoint\n:::\n\n:::info[Description]\nThis endpoint is only applicable to isolated margin and is no longer recommended. It is recommended to use cross margin instead.\n:::\n", + "customApiFields": "{\"abandon\":\"abandon\",\"domain\":\"Futures\",\"api-channel\":\"Private\",\"api-permission\":\"Futures\",\"api-rate-limit-pool\":\"Futures\",\"sdk-service\":\"Futures\",\"sdk-sub-service\":\"Positions\",\"sdk-method-name\":\"modifyAutoDepositStatus\",\"sdk-method-description\":\"This endpoint is only applicable to isolated margin and is no longer recommended. It is recommended to use cross margin instead.\",\"api-rate-limit\":4}" + } + }, + { + "name": "Cancel All Orders - V1", + "api": { + "id": "3470362", + "method": "delete", + "path": "/api/v1/orders", + "parameters": { + "query": [ + { + "id": "2KbksGFfyd", + "name": "symbol", + "required": false, + "description": "Cancel all limit orders for a specific contract only, If not specified, all the limit orders will be deleted, Please refer to [Get Symbol endpoint: symbol](apidog://link/endpoint/3470220) ", + "example": "XBTUSDTM", + "type": "string", + "enable": true + } + ], + "path": [], + "cookie": [], + "header": [] + }, + "responses": [ + { + "id": "10701", + "code": 200, + "name": "成功", + "headers": [], "jsonSchema": { "type": "object", "properties": { - "topic": { - "type": "string" - }, - "type": { - "type": "string" - }, - "subject": { + "code": { "type": "string" }, "data": { "type": "object", "properties": { - "symbol": { - "type": "string", - "description": "symbol" - }, - "candles": { + "cancelledOrderIds": { "type": "array", "items": { "type": "string" }, - "description": "Start time of the candle cycle,open price,close price, high price,low price,Transaction volume,Transaction amount" - }, - "time": { - "type": "integer", - "description": "now(us)", - "format": "int64" + "description": "Unique ID of the cancelled order" } }, "required": [ - "symbol", - "candles", - "time" + "cancelledOrderIds" ] } }, "required": [ - "topic", - "type", - "subject", + "code", "data" - ], - "x-example": "{\"topic\":\"/market/candles:BTC-USDT_1hour\",\"type\":\"message\",\"subject\":\"trade.candles.update\",\"data\":{\"symbol\":\"BTC-USDT\",\"candles\":[\"1729839600\",\"67644.9\",\"67437.6\",\"67724.8\",\"67243.8\",\"44.88321441\",\"3027558.991928447\"],\"time\":1729842192785164840}}" - } + ] + }, + "description": "", + "contentType": "json", + "mediaType": "" + } + ], + "responseExamples": [ + { + "name": "Success", + "data": "{\n \"code\": \"200000\",\n \"data\": {\n \"cancelledOrderIds\": [\n \"235919172150824960\",\n \"235919172150824961\"\n ]\n }\n}", + "responseId": 10701, + "ordering": 1 + } + ], + "requestBody": { + "type": "none", + "parameters": [], + "jsonSchema": { + "type": "object", + "properties": {} }, - "visibility": "INHERITED" + "example": "", + "mediaType": "" }, + "description": ":::tip[TIPS]\nIt is recommended to use the **DELETE /api/v3/orders** endpoint instead of this endpoint\n:::\n\n:::info[Description]\nUsing this endpoint, all open orders (excluding stop orders) can be canceled in batches.\n\nThe response is a list of orderIDs of the canceled orders.\n:::\n", + "customApiFields": "{\"abandon\":\"abandon\",\"domain\":\"Futures\",\"api-channel\":\"Private\",\"api-permission\":\"Futures\",\"api-rate-limit-pool\":\"Futures\",\"sdk-service\":\"Futures\",\"sdk-sub-service\":\"Order\",\"sdk-method-name\":\"cancelAllOrdersV1\",\"sdk-method-description\":\"Cancel all open orders (excluding stop orders). The response is a list of orderIDs of the canceled orders.\",\"api-rate-limit\":200}" + } + } + ] + } + ] + }, + { + "name": "Developing", + "id": 348188, + "description": "", + "items": [ + { + "name": "Wbesocket API", + "id": 348262, + "description": "", + "items": [] + } + ] + } + ] + } + ], + "schemaCollection": [ + { + "id": 33, + "name": "Root", + "visibility": "SHARED", + "items": [ + { + "id": 35, + "name": "ws", + "visibility": "INHERITED", + "items": [ + { + "id": 36, + "name": "Spot", + "visibility": "INHERITED", + "items": [ + { + "id": 39, + "name": "Public", + "visibility": "INHERITED", + "items": [ { - "name": "allTickers", + "name": "ticker", "displayName": "", - "id": "#/definitions/57", - "description": "method:allTickers\ntopic:/market/ticker:all\nsummary:Get All Tickers\ndescription:Subscribe to this topic to get the push of all market symbols BBO change.\npush_frequency:once every 100ms", + "id": "#/definitions/56", + "description": "method: ticker\ntopic:/market/ticker:{symbol},{symbol}\nsummary:Get Ticker\ndescription:Subscribe to this topic to get the specified symbol push of BBO changes.\npush_frequency:once every 100ms", "schema": { "jsonSchema": { "type": "object", "properties": { - "topic": { + "type": { "type": "string" }, - "type": { + "topic": { "type": "string" }, "subject": { @@ -47326,61 +46658,69 @@ "data": { "type": "object", "properties": { - "bestAsk": { + "sequence": { + "description": "Sequence number", "type": "string" }, - "bestAskSize": { + "price": { + "description": "Last traded price", "type": "string" }, - "bestBid": { + "size": { + "description": "Last traded amount", "type": "string" }, - "bestBidSize": { + "bestAsk": { + "description": "Best ask price", "type": "string" }, - "price": { + "bestAskSize": { + "description": "Best ask size", "type": "string" }, - "sequence": { + "bestBid": { + "description": "Best bid price", "type": "string" }, - "size": { + "bestBidSize": { + "description": "Best bid size", "type": "string" }, - "time": { + "Time": { "type": "integer", "description": "The matching time of the latest transaction", "format": "int64" } }, "required": [ + "sequence", + "price", + "size", "bestAsk", "bestAskSize", "bestBid", "bestBidSize", - "price", - "sequence", - "size", - "time" + "Time" ] } }, "required": [ - "topic", "type", + "topic", "subject", "data" ], - "x-example": "{\"topic\":\"/market/ticker:all\",\"type\":\"message\",\"subject\":\"BTC-USDT\",\"data\":{\"bestAsk\":\"67218.7\",\"bestAskSize\":\"1.92318539\",\"bestBid\":\"67218.6\",\"bestBidSize\":\"0.01045638\",\"price\":\"67220\",\"sequence\":\"14691455768\",\"size\":\"0.00004316\",\"time\":1729757723612}}" + "x-apidog-refs": {}, + "x-example": "{\"type\":\"message\",\"topic\":\"/market/ticker:BTC-USDT\",\"subject\":\"trade.ticker\",\"data\":{\"sequence\":\"1545896668986\",\"price\":\"0.08\",\"size\":\"0.011\",\"bestAsk\":\"0.08\",\"bestAskSize\":\"0.18\",\"bestBid\":\"0.049\",\"bestBidSize\":\"0.036\",\"Time\":1704873323416}}" } }, "visibility": "INHERITED" }, { - "name": "marketSnapshot", + "name": "allTickers", "displayName": "", - "id": "#/definitions/59", - "description": "method:marketSnapshot\ntopic:/market/snapshot:{market}\nsummary:Market Snapshot\ndescription:Subscribe this topic to get the snapshot data of for the entire market.\npush_frequency:once every 2s", + "id": "#/definitions/57", + "description": "method:allTickers\ntopic:/market/ticker:all\nsummary:Get All Tickers\ndescription:Subscribe to this topic to get the push of all market symbols BBO change.\npush_frequency:once every 100ms", "schema": { "jsonSchema": { "type": "object", @@ -47397,306 +46737,42 @@ "data": { "type": "object", "properties": { - "sequence": { + "bestAsk": { "type": "string" }, - "data": { - "type": "object", - "properties": { - "askSize": { - "type": "number" - }, - "averagePrice": { - "type": "number" - }, - "baseCurrency": { - "type": "string" - }, - "bidSize": { - "type": "number" - }, - "board": { - "type": "integer", - "description": "Trading pair partition: 0.primary partition 1.KuCoin Plus\", example = \"1\"", - "enum": [ - 0, - 1 - ], - "examples": [ - 1 - ], - "x-api-enum": [ - { - "value": 0, - "name": "", - "description": "primary partition" - }, - { - "value": 1, - "name": "", - "description": "KuCoin Plus" - } - ] - }, - "buy": { - "type": "number" - }, - "changePrice": { - "type": "number" - }, - "changeRate": { - "type": "number" - }, - "close": { - "type": "number" - }, - "datetime": { - "type": "integer", - "format": "int64" - }, - "high": { - "type": "number" - }, - "lastTradedPrice": { - "type": "number" - }, - "low": { - "type": "number" - }, - "makerCoefficient": { - "type": "number" - }, - "makerFeeRate": { - "type": "number" - }, - "marginTrade": { - "type": "boolean" - }, - "mark": { - "type": "integer", - "description": "Trading Pair Mark: 0.default 1.ST. 2.NEW\", example = \"1\"", - "enum": [ - 0, - 1, - 2 - ], - "examples": [ - 1 - ], - "x-api-enum": [ - { - "value": 0, - "name": "", - "description": "default " - }, - { - "value": 1, - "name": "", - "description": "ST" - }, - { - "value": 2, - "name": "", - "description": "NEW" - } - ] - }, - "market": { - "type": "string" - }, - "marketChange1h": { - "type": "object", - "properties": { - "changePrice": { - "type": "number" - }, - "changeRate": { - "type": "number" - }, - "high": { - "type": "number" - }, - "low": { - "type": "number" - }, - "open": { - "type": "number" - }, - "vol": { - "type": "number" - }, - "volValue": { - "type": "number" - } - }, - "required": [ - "changePrice", - "changeRate", - "high", - "low", - "open", - "vol", - "volValue" - ] - }, - "marketChange24h": { - "type": "object", - "properties": { - "changePrice": { - "type": "number" - }, - "changeRate": { - "type": "number" - }, - "high": { - "type": "number" - }, - "low": { - "type": "number" - }, - "open": { - "type": "number" - }, - "vol": { - "type": "number" - }, - "volValue": { - "type": "number" - } - }, - "required": [ - "changePrice", - "changeRate", - "high", - "low", - "open", - "vol", - "volValue" - ] - }, - "marketChange4h": { - "type": "object", - "properties": { - "changePrice": { - "type": "number" - }, - "changeRate": { - "type": "number" - }, - "high": { - "type": "number" - }, - "low": { - "type": "number" - }, - "open": { - "type": "number" - }, - "vol": { - "type": "number" - }, - "volValue": { - "type": "number" - } - }, - "required": [ - "changePrice", - "changeRate", - "high", - "low", - "open", - "vol", - "volValue" - ] - }, - "markets": { - "type": "array", - "items": { - "type": "string" - } - }, - "open": { - "type": "number" - }, - "quoteCurrency": { - "type": "string" - }, - "sell": { - "type": "number" - }, - "siteTypes": { - "type": "array", - "items": { - "type": "string" - } - }, - "sort": { - "type": "integer", - "description": "sorting number" - }, - "symbol": { - "type": "string" - }, - "symbolCode": { - "type": "string" - }, - "takerCoefficient": { - "type": "number" - }, - "takerFeeRate": { - "type": "number" - }, - "trading": { - "type": "boolean" - }, - "vol": { - "type": "number" - }, - "volValue": { - "type": "number" - } - }, - "required": [ - "askSize", - "averagePrice", - "baseCurrency", - "bidSize", - "board", - "buy", - "changePrice", - "changeRate", - "close", - "datetime", - "high", - "lastTradedPrice", - "low", - "makerCoefficient", - "makerFeeRate", - "marginTrade", - "mark", - "market", - "marketChange1h", - "marketChange24h", - "marketChange4h", - "markets", - "open", - "quoteCurrency", - "sell", - "siteTypes", - "sort", - "symbol", - "symbolCode", - "takerCoefficient", - "takerFeeRate", - "trading", - "vol", - "volValue" - ] + "bestAskSize": { + "type": "string" + }, + "bestBid": { + "type": "string" + }, + "bestBidSize": { + "type": "string" + }, + "price": { + "type": "string" + }, + "sequence": { + "type": "string" + }, + "size": { + "type": "string" + }, + "time": { + "type": "integer", + "description": "The matching time of the latest transaction", + "format": "int64" } }, "required": [ + "bestAsk", + "bestAskSize", + "bestBid", + "bestBidSize", + "price", "sequence", - "data" + "size", + "time" ] } }, @@ -47706,16 +46782,16 @@ "subject", "data" ], - "x-example": "{\"topic\":\"/market/snapshot:BTC\",\"type\":\"message\",\"subject\":\"trade.snapshot\",\"data\":{\"sequence\":\"1729785948015\",\"data\":{\"askSize\":1375.1096,\"averagePrice\":0.00000262,\"baseCurrency\":\"CHR\",\"bidSize\":152.0912,\"board\":0,\"buy\":0.00000263,\"changePrice\":0.00000005300000000000,\"changeRate\":0.0200,\"close\":0.000002698,\"datetime\":1729785948008,\"high\":0.00000274600000000000,\"lastTradedPrice\":0.000002698,\"low\":0.00000255800000000000,\"makerCoefficient\":1.000000,\"makerFeeRate\":0.001,\"marginTrade\":false,\"mark\":0,\"market\":\"BTC\",\"marketChange1h\":{\"changePrice\":-0.00000000900000000000,\"changeRate\":-0.0033,\"high\":0.00000270700000000000,\"low\":0.00000264200000000000,\"open\":0.00000270700000000000,\"vol\":27.10350000000000000000,\"volValue\":0.00007185015660000000},\"marketChange24h\":{\"changePrice\":0.00000005300000000000,\"changeRate\":0.0200,\"high\":0.00000274600000000000,\"low\":0.00000255800000000000,\"open\":0.00000264500000000000,\"vol\":6824.94800000000000000000,\"volValue\":0.01789509649520000000},\"marketChange4h\":{\"changePrice\":0.00000000600000000000,\"changeRate\":0.0022,\"high\":0.00000270700000000000,\"low\":0.00000264200000000000,\"open\":0.00000269200000000000,\"vol\":92.69020000000000000000,\"volValue\":0.00024903875740000000},\"markets\":[\"BTC\",\"DePIN\",\"Layer 1\"],\"open\":0.00000264500000000000,\"quoteCurrency\":\"BTC\",\"sell\":0.000002695,\"siteTypes\":[\"global\"],\"sort\":100,\"symbol\":\"CHR-BTC\",\"symbolCode\":\"CHR-BTC\",\"takerCoefficient\":1.000000,\"takerFeeRate\":0.001,\"trading\":true,\"vol\":6824.94800000000000000000,\"volValue\":0.01789509649520000000}}}" + "x-example": "{\"topic\":\"/market/ticker:all\",\"type\":\"message\",\"subject\":\"BTC-USDT\",\"data\":{\"bestAsk\":\"67218.7\",\"bestAskSize\":\"1.92318539\",\"bestBid\":\"67218.6\",\"bestBidSize\":\"0.01045638\",\"price\":\"67220\",\"sequence\":\"14691455768\",\"size\":\"0.00004316\",\"time\":1729757723612}}" } }, "visibility": "INHERITED" }, { - "name": "trade", + "name": "orderbookLevel1", "displayName": "", - "id": "#/definitions/65", - "description": "method:trade\ntopic:/market/match:{symbol},{symbol}\nsummary:Trade\ndescription:Subscribe to this topic to get the matching event data flow of Level 3. A topic supports up to 100 symbols.\npush_frequency:real-time", + "id": "#/definitions/60", + "description": "method:orderbookLevel1\ntopic:/spotMarket/level1:{symbol},{symbol}\nsummary:Orderbook - Level1\ndescription:The system will return the 1 best ask/bid orders data, A topic supports up to 100 symbols. If there is no change in the market, data will not be pushed\npush_frequency:once every 10ms", "schema": { "jsonSchema": { "type": "object", @@ -47732,58 +46808,185 @@ "data": { "type": "object", "properties": { - "makerOrderId": { - "type": "string" - }, - "price": { - "type": "string" + "asks": { + "type": "array", + "items": { + "type": "string" + }, + "description": "price, size" }, - "sequence": { - "type": "string" + "bids": { + "type": "array", + "items": { + "type": "string" + } }, - "side": { - "type": "string" + "timestamp": { + "type": "integer", + "format": "int64" + } + }, + "required": [ + "asks", + "bids", + "timestamp" + ] + } + }, + "required": [ + "topic", + "type", + "subject", + "data" + ], + "x-example": "{\"topic\":\"/spotMarket/level1:BTC-USDT\",\"type\":\"message\",\"subject\":\"level1\",\"data\":{\"asks\":[\"68145.8\",\"0.51987471\"],\"bids\":[\"68145.7\",\"1.29267802\"],\"timestamp\":1729816058766}}" + } + }, + "visibility": "INHERITED" + }, + { + "name": "orderbookLevel5", + "displayName": "", + "id": "#/definitions/61", + "description": "method:orderbookLevel5\ntopic:/spotMarket/level2Depth5:{symbol},{symbol}\nsummary:Orderbook - Level5\ndescription:The system will return the 5 best ask/bid orders data,A topic supports up to 100 symbols. If there is no change in the market, data will not be pushed\npush_frequency:once every 100ms", + "schema": { + "jsonSchema": { + "type": "object", + "properties": { + "topic": { + "type": "string" + }, + "type": { + "type": "string" + }, + "subject": { + "type": "string" + }, + "data": { + "type": "object", + "properties": { + "asks": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "string" + } + }, + "description": "price, size" }, - "size": { - "type": "string" + "bids": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "string" + } + } }, - "symbol": { - "type": "string" + "timestamp": { + "type": "integer", + "format": "int64" + } + }, + "required": [ + "asks", + "bids", + "timestamp" + ] + } + }, + "required": [ + "topic", + "type", + "subject", + "data" + ], + "x-example": "{\"topic\":\"/spotMarket/level2Depth5:BTC-USDT\",\"type\":\"message\",\"subject\":\"level2\",\"data\":{\"asks\":[[\"67996.7\",\"1.14213262\"],[\"67996.8\",\"0.21748212\"],[\"67996.9\",\"0.1503747\"],[\"67997\",\"0.11446863\"],[\"67997.1\",\"0.14842782\"]],\"bids\":[[\"67996.6\",\"0.37969491\"],[\"67995.3\",\"0.20779746\"],[\"67994.5\",\"0.00047785\"],[\"67993.4\",\"0.405\"],[\"67993.3\",\"0.13528566\"]],\"timestamp\":1729822226746}}" + } + }, + "visibility": "INHERITED" + }, + { + "name": "orderbookLevel50", + "displayName": "", + "id": "#/definitions/63", + "description": "method:orderbookLevel50\ntopic:/market/level2:{symbol},{symbol}\nsummary:Orderbook - Level50\ndescription:The system will return the 50 best ask/bid orders data, A topic supports up to 100 symbols. If there is no change in the market, data will not be pushed\npush_frequency:once every 100ms", + "schema": { + "jsonSchema": { + "type": "object", + "properties": { + "type": { + "type": "string" + }, + "topic": { + "type": "string" + }, + "subject": { + "type": "string" + }, + "data": { + "type": "object", + "properties": { + "changes": { + "type": "object", + "properties": { + "asks": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "bids": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "required": [ + "asks", + "bids" + ] }, - "takerOrderId": { - "type": "string" + "sequenceEnd": { + "type": "integer", + "format": "int64" }, - "time": { - "type": "string" + "sequenceStart": { + "type": "integer", + "format": "int64" }, - "tradeId": { + "symbol": { "type": "string" }, - "type": { - "type": "string" + "time": { + "type": "integer", + "format": "int64" } }, "required": [ - "makerOrderId", - "price", - "sequence", - "side", - "size", + "changes", + "sequenceEnd", + "sequenceStart", "symbol", - "takerOrderId", - "time", - "tradeId", - "type" + "time" ] } }, "required": [ - "topic", "type", + "topic", "subject", "data" ], - "x-example": "{\"topic\":\"/market/match:BTC-USDT\",\"type\":\"message\",\"subject\":\"trade.l3match\",\"data\":{\"makerOrderId\":\"671b5007389355000701b1d3\",\"price\":\"67523\",\"sequence\":\"11067996711960577\",\"side\":\"buy\",\"size\":\"0.003\",\"symbol\":\"BTC-USDT\",\"takerOrderId\":\"671b50161777ff00074c168d\",\"time\":\"1729843222921000000\",\"tradeId\":\"11067996711960577\",\"type\":\"match\"}}" + "x-example": "{\"topic\":\"/spotMarket/level2Depth50:BTC-USDT\",\"type\":\"message\",\"subject\":\"level2\",\"data\":{\"asks\":[[\"95964.3\",\"0.08168874\"],[\"95967.9\",\"0.00985094\"],[\"95969.9\",\"0.00078081\"],[\"95971.2\",\"0.10016039\"],[\"95971.3\",\"0.12531139\"],[\"95971.7\",\"0.00291\"],[\"95971.9\",\"0.10271829\"],[\"95973.3\",\"0.00021\"],[\"95974.7\",\"0.10271829\"],[\"95976.9\",\"0.03095177\"],[\"95977\",\"0.10271829\"],[\"95978.7\",\"0.00022411\"],[\"95979.1\",\"0.00023017\"],[\"95981\",\"0.00022008\"],[\"95981.2\",\"0.14330324\"],[\"95982.3\",\"0.27922082\"],[\"95982.5\",\"0.02302674\"],[\"95983.8\",\"0.00011035\"],[\"95985\",\"0.00104222\"],[\"95985.1\",\"0.00021808\"],[\"95985.5\",\"0.211127\"],[\"95986.2\",\"0.09690904\"],[\"95986.3\",\"0.31261\"],[\"95986.9\",\"0.09225037\"],[\"95987\",\"0.01042013\"],[\"95990.5\",\"0.12712438\"],[\"95990.6\",\"0.0916115\"],[\"95992.2\",\"0.279\"],[\"95992.7\",\"0.00521084\"],[\"95995.2\",\"0.00033\"],[\"95999.1\",\"0.02973561\"],[\"96001.1\",\"0.083825\"],[\"96002.6\",\"0.01900906\"],[\"96002.7\",\"0.00041665\"],[\"96002.8\",\"0.12531139\"],[\"96002.9\",\"0.279\"],[\"96004.8\",\"0.02081884\"],[\"96006.3\",\"0.00065542\"],[\"96008.5\",\"0.00033166\"],[\"96011\",\"0.08776246\"],[\"96012.5\",\"0.279\"],[\"96013.3\",\"0.00066666\"],[\"96013.9\",\"0.26097183\"],[\"96014\",\"0.01087009\"],[\"96017\",\"0.06248892\"],[\"96017.1\",\"0.20829641\"],[\"96022\",\"0.00107066\"],[\"96022.1\",\"0.279\"],[\"96022.9\",\"0.0006499\"],[\"96024.6\",\"0.00104131\"]],\"bids\":[[\"95964.2\",\"1.35483359\"],[\"95964.1\",\"0.01117492\"],[\"95962.1\",\"0.0062\"],[\"95961.8\",\"0.03081549\"],[\"95961.7\",\"0.10271829\"],[\"95958.5\",\"0.04681571\"],[\"95958.4\",\"0.05177498\"],[\"95958.2\",\"0.00155911\"],[\"95957.8\",\"0.10271829\"],[\"95954.7\",\"0.16312181\"],[\"95954.6\",\"0.44102109\"],[\"95952.6\",\"0.10271829\"],[\"95951.3\",\"0.0062\"],[\"95951\",\"0.17075141\"],[\"95950.9\",\"0.279\"],[\"95949.5\",\"0.13567811\"],[\"95949.2\",\"0.05177498\"],[\"95948.3\",\"0.10271829\"],[\"95947.2\",\"0.04634798\"],[\"95944.7\",\"0.10271829\"],[\"95944.2\",\"0.05177498\"],[\"95942.3\",\"0.26028569\"],[\"95942.2\",\"0.10271829\"],[\"95940.6\",\"0.12531139\"],[\"95940.2\",\"0.43349327\"],[\"95938.3\",\"0.01041604\"],[\"95937.4\",\"0.04957577\"],[\"95937.2\",\"0.00305\"],[\"95936.3\",\"0.10271829\"],[\"95934\",\"0.05177498\"],[\"95931.9\",\"0.03394093\"],[\"95931.8\",\"0.10271829\"],[\"95930\",\"0.01041814\"],[\"95927.9\",\"0.10271829\"],[\"95927\",\"0.13312774\"],[\"95926.9\",\"0.33077498\"],[\"95924.9\",\"0.10271829\"],[\"95924\",\"0.00180915\"],[\"95923.8\",\"0.00022434\"],[\"95919.6\",\"0.00021854\"],[\"95919.1\",\"0.01471872\"],[\"95919\",\"0.05177498\"],[\"95918.1\",\"0.00001889\"],[\"95917.8\",\"0.1521089\"],[\"95917.5\",\"0.00010962\"],[\"95916.2\",\"0.00021958\"],[\"95915.5\",\"0.12531139\"],[\"95915.3\",\"0.279\"],[\"95913.6\",\"0.01739249\"],[\"95913.5\",\"0.05177498\"]],\"timestamp\":1733124805073}}" } }, "visibility": "INHERITED" @@ -47873,19 +47076,12 @@ } }, "visibility": "INHERITED" - } - ] - }, - { - "id": 40, - "name": "Private", - "visibility": "INHERITED", - "items": [ + }, { - "name": "orderV2", + "name": "klines", "displayName": "", - "id": "#/definitions/66", - "description": "method: orderV2\ntopic:/spotMarket/tradeOrdersV2\nsummary:Get Order(V2)\ndescription:This topic will push all change events of your orders. Compared with v1, v2 adds an Order Status: \"new\", there is no difference in push speed\npush_frequency:real-time", + "id": "#/definitions/64", + "description": "method:klines\ntopic:/market/candles:{symbol}_{type}\nsummary:Klines\ndescription:Subscribe to this topic to get K-Line data.\npush_frequency:real-time", "schema": { "jsonSchema": { "type": "object", @@ -47899,271 +47095,30 @@ "subject": { "type": "string" }, - "userId": { - "type": "string" - }, - "channelType": { - "type": "string", - "enum": [ - "private", - "public" - ], - "description": "Channel type", - "x-api-enum": [ - { - "value": "private", - "name": "private", - "description": "private channel" - }, - { - "value": "public", - "name": "public", - "description": "public channel" - } - ] - }, "data": { "type": "object", "properties": { - "canceledSize": { - "type": "string", - "description": "Cumulative number of cancellations" - }, - "clientOid": { - "type": "string", - "description": "Client Order Id,The ClientOid field is a unique ID created by the user" - }, - "filledSize": { - "type": "string", - "description": "Cumulative number of filled" - }, - "orderId": { - "type": "string", - "description": "The unique order id generated by the trading system" - }, - "orderTime": { - "type": "integer", - "description": "Order time(millisecond)", - "format": "int64" - }, - "orderType": { - "type": "string", - "enum": [ - "limit", - "market" - ], - "description": "User-specified order type", - "x-api-enum": [ - { - "value": "limit", - "name": "limit", - "description": "limit" - }, - { - "value": "market", - "name": "market", - "description": "market" - } - ] - }, - "originSize": { - "type": "string", - "description": "User-specified order size" - }, - "price": { - "type": "string", - "description": "Price" - }, - "remainFunds": { - "type": "string", - "description": "Remain funds" - }, - "remainSize": { - "type": "string", - "description": "Remain size" - }, - "side": { - "type": "string", - "enum": [ - "buy", - "sell" - ], - "description": "buy or sell", - "x-api-enum": [ - { - "value": "buy", - "name": "buy", - "description": "buy" - }, - { - "value": "sell", - "name": "sell", - "description": "sell" - } - ] - }, - "size": { - "type": "string", - "description": "User-specified order size" - }, - "status": { - "type": "string", - "enum": [ - "new", - "open", - "match", - "done" - ], - "description": "Order Status", - "x-api-enum": [ - { - "value": "new", - "name": "new", - "description": "the order enters the matching system" - }, - { - "value": "open", - "name": "open", - "description": "the order is in the order book(maker order)" - }, - { - "value": "match", - "name": "match", - "description": "when taker order executes with orders in the order book, the taker order status is “match”" - }, - { - "value": "done", - "name": "done", - "description": "the order is fully executed successfully" - } - ] - }, "symbol": { "type": "string", - "examples": [ - "BTC-USDT", - "ETH-USDT", - "KCS-USDT" - ], - "description": "Symbol" + "description": "symbol" }, - "ts": { + "candles": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Start time of the candle cycle,open price,close price, high price,low price,Transaction volume,Transaction amount" + }, + "time": { "type": "integer", - "description": "Push time(Nanosecond)", + "description": "now(us)", "format": "int64" - }, - "type": { - "type": "string", - "enum": [ - "open", - "match", - "update", - "filled", - "canceled", - "received" - ], - "description": "Order Type", - "x-api-enum": [ - { - "value": "open", - "name": "open", - "description": "the order is in the order book(maker order)" - }, - { - "value": "match", - "name": "match", - "description": "the message sent when the order is match, 1. When the status is open and the type is match, it is a maker match. 2. When the status is match and the type is match, it is a taker match." - }, - { - "value": "update", - "name": "update", - "description": "The message sent due to the order being modified: STP triggering, partial cancellation of the order. Includes these three situations: 1. When the status is open and the type is update: partial amounts of the order have been canceled, or STP triggers 2. When the status is match and the type is update: STP triggers 3. When the status is done and the type is update: partial amounts of the order have been filled and the unfilled part got canceled, or STP is triggered." - }, - { - "value": "filled", - "name": "filled", - "description": "The message sent when the status of the order changes to DONE after the transaction" - }, - { - "value": "canceled", - "name": "canceled", - "description": "The message sent when the status of the order changes to DONE due to being canceled" - }, - { - "value": "received", - "name": "received", - "description": "The message sent when the order enters the matching system. When the order has just entered the matching system and has not yet done matching logic with the counterparty, a private message with the message type \"received\" and the order status \"new\" will be pushed." - } - ] - }, - "oldSize": { - "type": "string", - "description": "The size before order update" - }, - "feeType": { - "type": "string", - "enum": [ - "takerFee", - "makerFee" - ], - "description": "Actual Fee Type", - "x-api-enum": [ - { - "value": "takerFee", - "name": "takerFee", - "description": "takerFee" - }, - { - "value": "makerFee", - "name": "makerFee", - "description": "makerFee" - } - ] - }, - "liquidity": { - "type": "string", - "enum": [ - "taker", - "maker" - ], - "description": "Actual transaction order type, If the counterparty order is an [Hidden/Iceberg Order](apidog://link/pages/338146), even if it is a maker order, this param will be displayed as taker. For actual trading fee, please refer to the **feeType** ", - "x-api-enum": [ - { - "value": "taker", - "name": "taker", - "description": "taker" - }, - { - "value": "maker", - "name": "maker", - "description": "maker" - } - ] - }, - "matchPrice": { - "type": "string", - "description": "Match Price (when the type is \"match\")" - }, - "matchSize": { - "type": "string", - "description": "Match Size (when the type is \"match\")" - }, - "tradeId": { - "type": "string", - "description": "Trade id, it is generated by Matching engine." } }, "required": [ - "clientOid", - "orderId", - "orderTime", - "orderType", - "originSize", - "side", - "status", "symbol", - "ts", - "type" + "candles", + "time" ] } }, @@ -48171,20 +47126,18 @@ "topic", "type", "subject", - "userId", - "channelType", "data" ], - "x-example": "{\"topic\":\"/spotMarket/tradeOrdersV2\",\"type\":\"message\",\"subject\":\"orderChange\",\"userId\":\"633559791e1cbc0001f319bc\",\"channelType\":\"private\",\"data\":{\"clientOid\":\"5c52e11203aa677f33e493fc\",\"orderId\":\"6720da3fa30a360007f5f832\",\"orderTime\":1730206271588,\"orderType\":\"market\",\"originSize\":\"0.00001\",\"side\":\"buy\",\"status\":\"new\",\"symbol\":\"BTC-USDT\",\"ts\":1730206271616000000,\"type\":\"received\"}}" + "x-example": "{\"topic\":\"/market/candles:BTC-USDT_1hour\",\"type\":\"message\",\"subject\":\"trade.candles.update\",\"data\":{\"symbol\":\"BTC-USDT\",\"candles\":[\"1729839600\",\"67644.9\",\"67437.6\",\"67724.8\",\"67243.8\",\"44.88321441\",\"3027558.991928447\"],\"time\":1729842192785164840}}" } }, "visibility": "INHERITED" }, { - "name": "orderV1", + "name": "trade", "displayName": "", - "id": "#/definitions/67", - "description": "method: orderV1\ntopic:/spotMarket/tradeOrders\nsummary:Get Order(V1)\ndescription:This topic will push all change events of your orders. \npush_frequency:real-time", + "id": "#/definitions/65", + "description": "method:trade\ntopic:/market/match:{symbol},{symbol}\nsummary:Trade\ndescription:Subscribe to this topic to get the matching event data flow of Level 3. A topic supports up to 100 symbols.\npush_frequency:real-time", "schema": { "jsonSchema": { "type": "object", @@ -48195,267 +47148,53 @@ "type": { "type": "string" }, - "subject": { - "type": "string" - }, - "userId": { + "subject": { "type": "string" }, - "channelType": { - "type": "string", - "enum": [ - "private", - "public" - ], - "description": "Channel type", - "x-api-enum": [ - { - "value": "private", - "name": "private", - "description": "private channel" - }, - { - "value": "public", - "name": "public", - "description": "public channel" - } - ] - }, "data": { "type": "object", "properties": { - "canceledSize": { - "type": "string", - "description": "Cumulative number of cancellations" - }, - "clientOid": { - "type": "string", - "description": "Client Order Id,The ClientOid field is a unique ID created by the user" - }, - "filledSize": { - "type": "string", - "description": "Cumulative number of filled" - }, - "orderId": { - "type": "string", - "description": "The unique order id generated by the trading system" - }, - "orderTime": { - "type": "integer", - "description": "Order time(millisecond)", - "format": "int64" - }, - "orderType": { - "type": "string", - "enum": [ - "limit", - "market" - ], - "description": "User-specified order type", - "x-api-enum": [ - { - "value": "limit", - "name": "limit", - "description": "limit" - }, - { - "value": "market", - "name": "market", - "description": "market" - } - ] - }, - "originSize": { - "type": "string", - "description": "User-specified order size" + "makerOrderId": { + "type": "string" }, "price": { - "type": "string", - "description": "Specify price for currency" - }, - "remainFunds": { - "type": "string", - "description": "Remain funds" + "type": "string" }, - "remainSize": { - "type": "string", - "description": "Remain size" + "sequence": { + "type": "string" }, "side": { - "type": "string", - "enum": [ - "buy", - "sell" - ], - "description": "buy or sell", - "x-api-enum": [ - { - "value": "buy", - "name": "buy", - "description": "buy" - }, - { - "value": "sell", - "name": "sell", - "description": "sell" - } - ] + "type": "string" }, "size": { - "type": "string", - "description": "User-specified order size" - }, - "status": { - "type": "string", - "enum": [ - "new", - "open", - "match", - "done" - ], - "description": "Order Status", - "x-api-enum": [ - { - "value": "new", - "name": "new", - "description": "the order enters the matching system" - }, - { - "value": "open", - "name": "open", - "description": "the order is in the order book(maker order)" - }, - { - "value": "match", - "name": "match", - "description": "when taker order executes with orders in the order book, the taker order status is “match”" - }, - { - "value": "done", - "name": "done", - "description": "the order is fully executed successfully" - } - ] + "type": "string" }, "symbol": { - "type": "string", - "examples": [ - "BTC-USDT", - "ETH-USDT", - "KCS-USDT" - ], - "description": "Symbol" - }, - "ts": { - "type": "integer", - "description": "Push time(Nanosecond)", - "format": "int64" - }, - "type": { - "type": "string", - "enum": [ - "open", - "match", - "update", - "filled", - "canceled" - ], - "description": "Order Type", - "x-api-enum": [ - { - "value": "open", - "name": "open", - "description": "the order is in the order book(maker order)" - }, - { - "value": "match", - "name": "match", - "description": "the message sent when the order is match, 1. When the status is open and the type is match, it is a maker match. 2. When the status is match and the type is match, it is a taker match." - }, - { - "value": "update", - "name": "update", - "description": "The message sent due to the order being modified: STP triggering, partial cancellation of the order. Includes these three situations: 1. When the status is open and the type is update: partial amounts of the order have been canceled, or STP triggers 2. When the status is match and the type is update: STP triggers 3. When the status is done and the type is update: partial amounts of the order have been filled and the unfilled part got canceled, or STP is triggered." - }, - { - "value": "filled", - "name": "filled", - "description": "The message sent when the status of the order changes to DONE after the transaction" - }, - { - "value": "canceled", - "name": "canceled", - "description": "The message sent when the status of the order changes to DONE due to being canceled" - } - ] - }, - "oldSize": { - "type": "string", - "description": "The size before order update" - }, - "feeType": { - "type": "string", - "enum": [ - "takerFee", - "makerFee" - ], - "description": "Actual Fee Type", - "x-api-enum": [ - { - "value": "takerFee", - "name": "takerFee", - "description": "takerFee" - }, - { - "value": "makerFee", - "name": "makerFee", - "description": "makerFee" - } - ] - }, - "liquidity": { - "type": "string", - "enum": [ - "taker", - "maker" - ], - "description": "Actual transaction order type, If the counterparty order is an [Hidden/Iceberg Order](apidog://link/pages/338146), even if it is a maker order, this param will be displayed as taker. For actual trading fee, please refer to the **feeType** ", - "x-api-enum": [ - { - "value": "taker", - "name": "taker", - "description": "taker" - }, - { - "value": "maker", - "name": "maker", - "description": "maker" - } - ] + "type": "string" }, - "matchPrice": { - "type": "string", - "description": "Match Price (when the type is \"match\")" + "takerOrderId": { + "type": "string" }, - "matchSize": { - "type": "string", - "description": "Match Size (when the type is \"match\")" + "time": { + "type": "string" }, "tradeId": { - "type": "string", - "description": "Trade id, it is generated by Matching engine." + "type": "string" + }, + "type": { + "type": "string" } }, "required": [ - "clientOid", - "orderId", - "orderTime", - "orderType", - "originSize", + "makerOrderId", + "price", + "sequence", "side", - "status", + "size", "symbol", - "ts", + "takerOrderId", + "time", + "tradeId", "type" ] } @@ -48464,20 +47203,18 @@ "topic", "type", "subject", - "userId", - "channelType", "data" ], - "x-example": "{\"topic\":\"/spotMarket/tradeOrdersV2\",\"type\":\"message\",\"subject\":\"orderChange\",\"userId\":\"633559791e1cbc0001f319bc\",\"channelType\":\"private\",\"data\":{\"canceledSize\":\"0\",\"clientOid\":\"5c52e11203aa677f33e493fb\",\"filledSize\":\"0\",\"orderId\":\"6720ecd9ec71f4000747731a\",\"orderTime\":1730211033305,\"orderType\":\"limit\",\"originSize\":\"0.00001\",\"price\":\"50000\",\"remainSize\":\"0.00001\",\"side\":\"buy\",\"size\":\"0.00001\",\"status\":\"open\",\"symbol\":\"BTC-USDT\",\"ts\":1730211033335000000,\"type\":\"open\"}}" + "x-example": "{\"topic\":\"/market/match:BTC-USDT\",\"type\":\"message\",\"subject\":\"trade.l3match\",\"data\":{\"makerOrderId\":\"671b5007389355000701b1d3\",\"price\":\"67523\",\"sequence\":\"11067996711960577\",\"side\":\"buy\",\"size\":\"0.003\",\"symbol\":\"BTC-USDT\",\"takerOrderId\":\"671b50161777ff00074c168d\",\"time\":\"1729843222921000000\",\"tradeId\":\"11067996711960577\",\"type\":\"match\"}}" } }, "visibility": "INHERITED" }, { - "name": "account", + "name": "symbolSnapshot", "displayName": "", - "id": "#/definitions/68", - "description": "method: account\ntopic:/account/balance\nsummary:Get Account Balance\ndescription:You will receive this message when an account balance changes. The message contains the details of the change.\npush_frequency:real-time", + "id": "#/definitions/58", + "description": "method:symbolSnapshot\ntopic:/market/snapshot:{symbol}\nsummary:Symbol Snapshot\ndescription:Subscribe to get snapshot data for a single symbol.\npush_frequency:once every 2s", "schema": { "jsonSchema": { "type": "object", @@ -48491,108 +47228,304 @@ "subject": { "type": "string" }, - "id": { - "type": "string" - }, - "userId": { - "type": "string" - }, - "channelType": { - "type": "string", - "description": "Channel type", - "enum": [ - "private", - "public" - ], - "x-api-enum": [ - { - "value": "private", - "name": "private", - "description": "private channel" - }, - { - "value": "public", - "name": "public", - "description": "public channel" - } - ] - }, "data": { "type": "object", "properties": { - "accountId": { - "type": "string", - "description": "Account ID" - }, - "available": { - "type": "string", - "description": "Funds available to withdraw or trade" - }, - "availableChange": { - "type": "string", - "description": "The change of available Funds" - }, - "currency": { - "type": "string", - "description": "currency", - "examples": [ - "BTC", - "ETH", - "KCS" - ] - }, - "hold": { - "type": "string", - "description": "Funds on hold (not available for use)" - }, - "holdChange": { - "type": "string", - "description": "The change of hold funds" + "sequence": { + "type": "string" }, - "relationContext": { + "data": { "type": "object", "properties": { + "askSize": { + "type": "number" + }, + "averagePrice": { + "type": "number" + }, + "baseCurrency": { + "type": "string" + }, + "bidSize": { + "type": "number" + }, + "board": { + "type": "integer", + "description": "Trading pair partition: 0.primary partition 1.KuCoin Plus\", example = \"1\"", + "enum": [ + 0, + 1 + ], + "x-api-enum": [ + { + "value": 0, + "name": "", + "description": "primary partition" + }, + { + "value": 1, + "name": "", + "description": "KuCoin Plus" + } + ] + }, + "buy": { + "type": "number" + }, + "changePrice": { + "type": "number" + }, + "changeRate": { + "type": "number" + }, + "close": { + "type": "number" + }, + "datetime": { + "type": "integer", + "format": "int64" + }, + "high": { + "type": "number" + }, + "lastTradedPrice": { + "type": "number" + }, + "low": { + "type": "number" + }, + "makerCoefficient": { + "type": "number" + }, + "makerFeeRate": { + "type": "number" + }, + "marginTrade": { + "type": "boolean" + }, + "mark": { + "type": "integer", + "description": "Trading Pair Mark: 0.default 1.ST. 2.NEW\", example = \"1\"", + "enum": [ + 0, + 1, + 2 + ], + "x-api-enum": [ + { + "value": 0, + "name": "", + "description": "default" + }, + { + "value": 1, + "name": "", + "description": "ST" + }, + { + "value": 2, + "name": "", + "description": "NEW" + } + ] + }, + "market": { + "type": "string" + }, + "marketChange1h": { + "type": "object", + "properties": { + "changePrice": { + "type": "number" + }, + "changeRate": { + "type": "number" + }, + "high": { + "type": "number" + }, + "low": { + "type": "number" + }, + "open": { + "type": "number" + }, + "vol": { + "type": "number" + }, + "volValue": { + "type": "number" + } + }, + "required": [ + "changePrice", + "changeRate", + "high", + "low", + "open", + "vol", + "volValue" + ] + }, + "marketChange24h": { + "type": "object", + "properties": { + "changePrice": { + "type": "number" + }, + "changeRate": { + "type": "number" + }, + "high": { + "type": "number" + }, + "low": { + "type": "number" + }, + "open": { + "type": "number" + }, + "vol": { + "type": "number" + }, + "volValue": { + "type": "number" + } + }, + "required": [ + "changePrice", + "changeRate", + "high", + "low", + "open", + "vol", + "volValue" + ] + }, + "marketChange4h": { + "type": "object", + "properties": { + "changePrice": { + "type": "number" + }, + "changeRate": { + "type": "number" + }, + "high": { + "type": "number" + }, + "low": { + "type": "number" + }, + "open": { + "type": "number" + }, + "vol": { + "type": "number" + }, + "volValue": { + "type": "number" + } + }, + "required": [ + "changePrice", + "changeRate", + "high", + "low", + "open", + "vol", + "volValue" + ] + }, + "markets": { + "type": "array", + "items": { + "type": "string" + } + }, + "open": { + "type": "number" + }, + "quoteCurrency": { + "type": "string" + }, + "sell": { + "type": "number" + }, + "siteTypes": { + "type": "array", + "items": { + "type": "string" + } + }, + "sort": { + "type": "integer", + "description": "sorting number(Pointless)" + }, "symbol": { "type": "string" }, - "orderId": { + "symbolCode": { "type": "string" + }, + "takerCoefficient": { + "type": "number" + }, + "takerFeeRate": { + "type": "number" + }, + "trading": { + "type": "boolean" + }, + "vol": { + "type": "number" + }, + "volValue": { + "type": "number", + "description": "24-hour rolling transaction volume, refreshed every 2s" } }, "required": [ + "askSize", + "averagePrice", + "baseCurrency", + "bidSize", + "board", + "buy", + "changePrice", + "changeRate", + "close", + "datetime", + "high", + "lastTradedPrice", + "low", + "makerCoefficient", + "makerFeeRate", + "marginTrade", + "mark", + "market", + "marketChange1h", + "marketChange24h", + "marketChange4h", + "markets", + "open", + "quoteCurrency", + "sell", + "siteTypes", + "sort", "symbol", - "orderId" - ], - "description": "Relation context" - }, - "relationEvent": { - "type": "string", - "description": "Relation event" - }, - "relationEventId": { - "type": "string", - "description": "Relation event Id" - }, - "time": { - "type": "string" - }, - "total": { - "type": "string", - "description": "Total balance = available + hold" + "symbolCode", + "takerCoefficient", + "takerFeeRate", + "trading", + "vol", + "volValue" + ] } }, "required": [ - "accountId", - "available", - "availableChange", - "currency", - "hold", - "holdChange", - "relationContext", - "relationEvent", - "relationEventId", - "time", - "total" + "sequence", + "data" ] } }, @@ -48600,142 +47533,344 @@ "topic", "type", "subject", - "id", - "userId", - "channelType", - "data" - ], - "x-example": "{\"topic\":\"/account/balance\",\"type\":\"message\",\"subject\":\"account.balance\",\"id\":\"354689988084000\",\"userId\":\"633559791e1cbc0001f319bc\",\"channelType\":\"private\",\"data\":{\"accountId\":\"548674591753\",\"currency\":\"USDT\",\"total\":\"21.133773386762\",\"available\":\"20.132773386762\",\"hold\":\"1.001\",\"availableChange\":\"-0.5005\",\"holdChange\":\"0.5005\",\"relationContext\":{\"symbol\":\"BTC-USDT\",\"orderId\":\"6721d0632db25b0007071fdc\"},\"relationEvent\":\"trade.hold\",\"relationEventId\":\"354689988084000\",\"time\":\"1730269283892\"}}" - } - }, - "visibility": "INHERITED" - } - ] - } - ] - }, - { - "id": 37, - "name": "Margin", - "visibility": "INHERITED", - "items": [ - { - "id": 41, - "name": "Public", - "visibility": "INHERITED", - "items": [ - { - "name": "indexPrice", - "displayName": "", - "id": "#/definitions/69", - "description": "method:indexPrice\ntopic:/indicator/index:{symbol},{symbol}\nsummary:Index Price\ndescription:Subscribe to this topic to get the index price for the margin trading. The following ticker symbols are supported: List of currently supported symbol.\npush_frequency:once every 1s", - "schema": { - "jsonSchema": { - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "type": { - "type": "string" - }, - "topic": { - "type": "string" - }, - "subject": { - "type": "string" - }, - "data": { - "type": "object", - "properties": { - "symbol": { - "type": "string" - }, - "granularity": { - "type": "integer" - }, - "timestamp": { - "type": "integer", - "format": "int64" - }, - "value": { - "type": "number" - } - }, - "required": [ - "symbol", - "granularity", - "timestamp", - "value" - ] - } - }, - "required": [ - "id", - "type", - "topic", - "subject", "data" ], - "x-example": "{\"id\":\"5c24c5da03aa673885cd67a0\",\"type\":\"message\",\"topic\":\"/indicator/index:USDT-BTC\",\"subject\":\"tick\",\"data\":{\"symbol\":\"USDT-BTC\",\"granularity\":5000,\"timestamp\":1551770400000,\"value\":0.0001092}}" + "x-example": "{\"topic\":\"/market/snapshot:BTC-USDT\",\"type\":\"message\",\"subject\":\"trade.snapshot\",\"data\":{\"sequence\":\"14691517895\",\"data\":{\"askSize\":1.15955795,\"averagePrice\":66867.89967612,\"baseCurrency\":\"BTC\",\"bidSize\":0.81772627,\"board\":1,\"buy\":67158.1,\"changePrice\":315.20000000000000000000,\"changeRate\":0.0047,\"close\":67158.1,\"datetime\":1729758286011,\"high\":67611.80000000000000000000,\"lastTradedPrice\":67158.1,\"low\":65257.10000000000000000000,\"makerCoefficient\":1.000000,\"makerFeeRate\":0.001,\"marginTrade\":true,\"mark\":0,\"market\":\"USDS\",\"marketChange1h\":{\"changePrice\":-102.10000000000000000000,\"changeRate\":-0.0015,\"high\":67310.60000000000000000000,\"low\":67051.80000000000000000000,\"open\":67260.20000000000000000000,\"vol\":53.73698081000000000000,\"volValue\":3609965.13819127700000000000},\"marketChange24h\":{\"changePrice\":315.20000000000000000000,\"changeRate\":0.0047,\"high\":67611.80000000000000000000,\"low\":65257.10000000000000000000,\"open\":66842.90000000000000000000,\"vol\":2227.69895852000000000000,\"volValue\":147972941.07857507300000000000},\"marketChange4h\":{\"changePrice\":-166.30000000000000000000,\"changeRate\":-0.0024,\"high\":67476.60000000000000000000,\"low\":67051.80000000000000000000,\"open\":67324.40000000000000000000,\"vol\":173.76971188000000000000,\"volValue\":11695949.43841656500000000000},\"markets\":[\"USDS\",\"PoW\"],\"open\":66842.90000000000000000000,\"quoteCurrency\":\"USDT\",\"sell\":67158.2,\"siteTypes\":[\"turkey\",\"thailand\",\"global\"],\"sort\":100,\"symbol\":\"BTC-USDT\",\"symbolCode\":\"BTC-USDT\",\"takerCoefficient\":1.000000,\"takerFeeRate\":0.001,\"trading\":true,\"vol\":2227.69895852000000000000,\"volValue\":147972941.07857507300000000000}}}" } }, "visibility": "INHERITED" }, { - "name": "markPrice", + "name": "marketSnapshot", "displayName": "", - "id": "#/definitions/70", - "description": "method:markPrice\ntopic:/indicator/markPrice:{symbol},{symbol}\nsummary:Mark Price\ndescription:Subscribe to this topic to get the mark price for margin trading.The following ticker symbols are supported: List of currently supported symbol\npush_frequency:once every 1s", + "id": "#/definitions/59", + "description": "method:marketSnapshot\ntopic:/market/snapshot:{market}\nsummary:Market Snapshot\ndescription:Subscribe this topic to get the snapshot data of for the entire market.\npush_frequency:once every 2s", "schema": { "jsonSchema": { "type": "object", "properties": { - "id": { + "topic": { "type": "string" }, "type": { "type": "string" }, - "topic": { - "type": "string" - }, "subject": { "type": "string" }, "data": { "type": "object", "properties": { - "symbol": { + "sequence": { "type": "string" }, - "granularity": { - "type": "integer" - }, - "timestamp": { - "type": "integer", - "format": "int64" - }, - "value": { - "type": "number" + "data": { + "type": "object", + "properties": { + "askSize": { + "type": "number" + }, + "averagePrice": { + "type": "number" + }, + "baseCurrency": { + "type": "string" + }, + "bidSize": { + "type": "number" + }, + "board": { + "type": "integer", + "description": "Trading pair partition: 0.primary partition 1.KuCoin Plus\", example = \"1\"", + "enum": [ + 0, + 1 + ], + "examples": [ + 1 + ], + "x-api-enum": [ + { + "value": 0, + "name": "", + "description": "primary partition" + }, + { + "value": 1, + "name": "", + "description": "KuCoin Plus" + } + ] + }, + "buy": { + "type": "number" + }, + "changePrice": { + "type": "number" + }, + "changeRate": { + "type": "number" + }, + "close": { + "type": "number" + }, + "datetime": { + "type": "integer", + "format": "int64" + }, + "high": { + "type": "number" + }, + "lastTradedPrice": { + "type": "number" + }, + "low": { + "type": "number" + }, + "makerCoefficient": { + "type": "number" + }, + "makerFeeRate": { + "type": "number" + }, + "marginTrade": { + "type": "boolean" + }, + "mark": { + "type": "integer", + "description": "Trading Pair Mark: 0.default 1.ST. 2.NEW\", example = \"1\"", + "enum": [ + 0, + 1, + 2 + ], + "examples": [ + 1 + ], + "x-api-enum": [ + { + "value": 0, + "name": "", + "description": "default " + }, + { + "value": 1, + "name": "", + "description": "ST" + }, + { + "value": 2, + "name": "", + "description": "NEW" + } + ] + }, + "market": { + "type": "string" + }, + "marketChange1h": { + "type": "object", + "properties": { + "changePrice": { + "type": "number" + }, + "changeRate": { + "type": "number" + }, + "high": { + "type": "number" + }, + "low": { + "type": "number" + }, + "open": { + "type": "number" + }, + "vol": { + "type": "number" + }, + "volValue": { + "type": "number" + } + }, + "required": [ + "changePrice", + "changeRate", + "high", + "low", + "open", + "vol", + "volValue" + ] + }, + "marketChange24h": { + "type": "object", + "properties": { + "changePrice": { + "type": "number" + }, + "changeRate": { + "type": "number" + }, + "high": { + "type": "number" + }, + "low": { + "type": "number" + }, + "open": { + "type": "number" + }, + "vol": { + "type": "number" + }, + "volValue": { + "type": "number" + } + }, + "required": [ + "changePrice", + "changeRate", + "high", + "low", + "open", + "vol", + "volValue" + ] + }, + "marketChange4h": { + "type": "object", + "properties": { + "changePrice": { + "type": "number" + }, + "changeRate": { + "type": "number" + }, + "high": { + "type": "number" + }, + "low": { + "type": "number" + }, + "open": { + "type": "number" + }, + "vol": { + "type": "number" + }, + "volValue": { + "type": "number" + } + }, + "required": [ + "changePrice", + "changeRate", + "high", + "low", + "open", + "vol", + "volValue" + ] + }, + "markets": { + "type": "array", + "items": { + "type": "string" + } + }, + "open": { + "type": "number" + }, + "quoteCurrency": { + "type": "string" + }, + "sell": { + "type": "number" + }, + "siteTypes": { + "type": "array", + "items": { + "type": "string" + } + }, + "sort": { + "type": "integer", + "description": "sorting number" + }, + "symbol": { + "type": "string" + }, + "symbolCode": { + "type": "string" + }, + "takerCoefficient": { + "type": "number" + }, + "takerFeeRate": { + "type": "number" + }, + "trading": { + "type": "boolean" + }, + "vol": { + "type": "number" + }, + "volValue": { + "type": "number" + } + }, + "required": [ + "askSize", + "averagePrice", + "baseCurrency", + "bidSize", + "board", + "buy", + "changePrice", + "changeRate", + "close", + "datetime", + "high", + "lastTradedPrice", + "low", + "makerCoefficient", + "makerFeeRate", + "marginTrade", + "mark", + "market", + "marketChange1h", + "marketChange24h", + "marketChange4h", + "markets", + "open", + "quoteCurrency", + "sell", + "siteTypes", + "sort", + "symbol", + "symbolCode", + "takerCoefficient", + "takerFeeRate", + "trading", + "vol", + "volValue" + ] } }, "required": [ - "symbol", - "granularity", - "timestamp", - "value" + "sequence", + "data" ] } }, "required": [ - "id", - "type", "topic", + "type", "subject", "data" ], - "x-example": "{\"id\":\"5c24c5da03aa673885cd67aa\",\"type\":\"message\",\"topic\":\"/indicator/markPrice:USDT-BTC\",\"subject\":\"tick\",\"data\":{\"symbol\":\"USDT-BTC\",\"granularity\":5000,\"timestamp\":1551770400000,\"value\":0.0001093}}" + "x-example": "{\"topic\":\"/market/snapshot:BTC\",\"type\":\"message\",\"subject\":\"trade.snapshot\",\"data\":{\"sequence\":\"1729785948015\",\"data\":{\"askSize\":1375.1096,\"averagePrice\":0.00000262,\"baseCurrency\":\"CHR\",\"bidSize\":152.0912,\"board\":0,\"buy\":0.00000263,\"changePrice\":0.00000005300000000000,\"changeRate\":0.0200,\"close\":0.000002698,\"datetime\":1729785948008,\"high\":0.00000274600000000000,\"lastTradedPrice\":0.000002698,\"low\":0.00000255800000000000,\"makerCoefficient\":1.000000,\"makerFeeRate\":0.001,\"marginTrade\":false,\"mark\":0,\"market\":\"BTC\",\"marketChange1h\":{\"changePrice\":-0.00000000900000000000,\"changeRate\":-0.0033,\"high\":0.00000270700000000000,\"low\":0.00000264200000000000,\"open\":0.00000270700000000000,\"vol\":27.10350000000000000000,\"volValue\":0.00007185015660000000},\"marketChange24h\":{\"changePrice\":0.00000005300000000000,\"changeRate\":0.0200,\"high\":0.00000274600000000000,\"low\":0.00000255800000000000,\"open\":0.00000264500000000000,\"vol\":6824.94800000000000000000,\"volValue\":0.01789509649520000000},\"marketChange4h\":{\"changePrice\":0.00000000600000000000,\"changeRate\":0.0022,\"high\":0.00000270700000000000,\"low\":0.00000264200000000000,\"open\":0.00000269200000000000,\"vol\":92.69020000000000000000,\"volValue\":0.00024903875740000000},\"markets\":[\"BTC\",\"DePIN\",\"Layer 1\"],\"open\":0.00000264500000000000,\"quoteCurrency\":\"BTC\",\"sell\":0.000002695,\"siteTypes\":[\"global\"],\"sort\":100,\"symbol\":\"CHR-BTC\",\"symbolCode\":\"CHR-BTC\",\"takerCoefficient\":1.000000,\"takerFeeRate\":0.001,\"trading\":true,\"vol\":6824.94800000000000000000,\"volValue\":0.01789509649520000000}}}" } }, "visibility": "INHERITED" @@ -48743,15 +47878,15 @@ ] }, { - "id": 42, + "id": 40, "name": "Private", "visibility": "INHERITED", "items": [ { - "name": "crossMarginPosition", + "name": "orderV2", "displayName": "", - "id": "#/definitions/71", - "description": "method:crossMarginPosition\ntopic:/margin/position\nsummary:Get Cross Margin Position change\ndescription:The system will push the change event when the position status changes, Or push the current debt message periodically when there is a liability.\npush_frequency: once every 4s", + "id": "#/definitions/66", + "description": "method: orderV2\ntopic:/spotMarket/tradeOrdersV2\nsummary:Get Order(V2)\ndescription:This topic will push all change events of your orders. Compared with v1, v2 adds an Order Status: \"new\", there is no difference in push speed\npush_frequency:real-time", "schema": { "jsonSchema": { "type": "object", @@ -48762,181 +47897,6 @@ "type": { "type": "string" }, - "data": { - "type": "object", - "properties": { - "debtRatio": { - "type": "number", - "description": "Debt ratio" - }, - "totalAsset": { - "type": "number", - "description": "Total asset in BTC (interest included)" - }, - "marginCoefficientTotalAsset": { - "type": "string" - }, - "totalDebt": { - "type": "string", - "description": "Total debt in BTC (interest included)" - }, - "assetList": { - "type": "object", - "properties": {}, - "description": "Asset list (interest included)", - "additionalProperties": { - "type": "object", - "properties": { - "total": { - "type": "string" - }, - "available": { - "type": "string" - }, - "hold": { - "type": "string" - } - }, - "required": [ - "total", - "available", - "hold" - ] - } - }, - "debtList": { - "type": "object", - "properties": {}, - "description": "Debt list (interest included)", - "additionalProperties": { - "type": "string" - } - }, - "timestamp": { - "type": "integer", - "format": "int64" - }, - "type": { - "type": "string", - "enum": [ - "FROZEN_FL", - "UNFROZEN_FL", - "FROZEN_RENEW", - "UNFROZEN_RENEW", - "LIABILITY", - "UNLIABILITY" - ], - "description": "Event type, **Only applicable to \"debt.ratio\" subject**", - "x-api-enum": [ - { - "value": "FROZEN_FL", - "name": "FROZEN_FL", - "description": "When the debt ratio exceeds the liquidation threshold and the position is frozen, the system will push this event." - }, - { - "value": "UNFROZEN_FL", - "name": "UNFROZEN_FL", - "description": "When the liquidation is finished and the position returns to “EFFECTIVE” status, the system will push this event." - }, - { - "value": "FROZEN_RENEW", - "name": "FROZEN_RENEW", - "description": "When the auto-borrow renewing is complete and the position returns to “EFFECTIVE” status, the system will push this event." - }, - { - "value": "UNFROZEN_RENEW", - "name": "UNFROZEN_RENEW", - "description": "When the account reaches a negative balance, the system will push this event." - }, - { - "value": "LIABILITY", - "name": "LIABILITY", - "description": "When the account reaches a negative balance, the system will push this event." - }, - { - "value": "UNLIABILITY", - "name": "UNLIABILITY", - "description": "When all the liabilities is repaid and the position returns to “EFFECTIVE” status, the system will push this event." - } - ] - } - }, - "required": [ - "debtRatio", - "totalAsset", - "marginCoefficientTotalAsset", - "totalDebt", - "assetList", - "debtList", - "timestamp", - "type" - ] - }, - "subject": { - "type": "string", - "enum": [ - "debt.ratio", - "position.status" - ], - "x-api-enum": [ - { - "value": "debt.ratio", - "name": "", - "description": "" - }, - { - "value": "position.status", - "name": "", - "description": "" - } - ] - }, - "userId": { - "type": "string" - }, - "channelType": { - "type": "string", - "enum": [ - "private", - "public" - ], - "description": "Channel type", - "x-api-enum": [ - { - "value": "private", - "name": "private", - "description": "private channel" - }, - { - "value": "public", - "name": "public", - "description": "public channel" - } - ] - } - }, - "required": [ - "topic", - "type", - "data", - "subject", - "userId", - "channelType" - ], - "x-example": "{\"topic\":\"/margin/position\",\"subject\":\"debt.ratio\",\"type\":\"message\",\"userId\":\"633559791e1cbc0001f319bc\",\"channelType\":\"private\",\"data\":{\"debtRatio\":0,\"totalAsset\":0.00052431772284080000000,\"marginCoefficientTotalAsset\":\"0.0005243177228408\",\"totalDebt\":\"0\",\"assetList\":{\"BTC\":{\"total\":\"0.00002\",\"available\":\"0\",\"hold\":\"0.00002\"},\"USDT\":{\"total\":\"33.68855864\",\"available\":\"15.01916691\",\"hold\":\"18.66939173\"}},\"debtList\":{\"BTC\":\"0\",\"USDT\":\"0\"},\"timestamp\":1729912435657}}" - } - }, - "visibility": "INHERITED" - }, - { - "name": "isolatedMarginPosition", - "displayName": "", - "id": "#/definitions/72", - "description": "method:isolatedMarginPosition\ntopic:/margin/isolatedPosition:{symbol}\nsummary:Get Isolated Margin Position change\ndescription:The system will push the change event when the position status changes, Or push the current debt message periodically when there is a liability.\npush_frequency: real time", - "schema": { - "jsonSchema": { - "type": "object", - "properties": { "subject": { "type": "string" }, @@ -48963,264 +47923,248 @@ } ] }, - "topic": { - "type": "string" - }, - "type": { - "type": "string" - }, "data": { "type": "object", "properties": { - "tag": { + "canceledSize": { "type": "string", - "description": "Isolated margin symbol", - "examples": [ - "BTC-USDT", - "ETH-USDT" - ] + "description": "Cumulative number of cancellations" }, - "status": { + "clientOid": { + "type": "string", + "description": "Client Order Id,The ClientOid field is a unique ID created by the user" + }, + "filledSize": { + "type": "string", + "description": "Cumulative number of filled" + }, + "orderId": { + "type": "string", + "description": "The unique order id generated by the trading system" + }, + "orderTime": { + "type": "integer", + "description": "Order time(millisecond)", + "format": "int64" + }, + "orderType": { "type": "string", - "description": "Position status", "enum": [ - "DEBT", - "CLEAR", - "IN_BORROW", - "IN_REPAY", - "IN_LIQUIDATION", - "IN_AUTO_RENEW" + "limit", + "market" ], + "description": "User-specified order type", "x-api-enum": [ { - "value": "DEBT", - "name": "DEBT", - "description": "Debt" - }, - { - "value": "CLEAR", - "name": "CLEAR", - "description": "debt-free" - }, - { - "value": "IN_BORROW", - "name": "IN_BORROW", - "description": "Borrowing" - }, - { - "value": "IN_REPAY", - "name": "IN_REPAY", - "description": "Repayment in progress" - }, - { - "value": "IN_LIQUIDATION", - "name": "IN_LIQUIDATION", - "description": "Position closing" + "value": "limit", + "name": "limit", + "description": "limit" }, { - "value": "IN_AUTO_RENEW", - "name": "IN_AUTO_RENEW", - "description": "Automatically renewing" + "value": "market", + "name": "market", + "description": "market" } ] }, - "statusBizType": { + "originSize": { + "type": "string", + "description": "User-specified order size" + }, + "price": { + "type": "string", + "description": "Price" + }, + "remainFunds": { + "type": "string", + "description": "Remain funds" + }, + "remainSize": { + "type": "string", + "description": "Remain size" + }, + "side": { "type": "string", "enum": [ - "FORCE_LIQUIDATION", - "USER_BORROW", - "TRADE_AUTO_BORROW", - "USER_REPAY", - "AUTO_REPAY", - "DEFAULT_DEBT", - "DEFAULT_CLEAR", - "ONE_CLICK_LIQUIDATION", - "B2C_INTEREST_SETTLE_LIQUIDATION", - "AIR_DROP_LIQUIDATION" + "buy", + "sell" ], - "description": "Status type", + "description": "buy or sell", "x-api-enum": [ { - "value": "FORCE_LIQUIDATION", - "name": "FORCE_LIQUIDATION", - "description": "Liquidation" - }, - { - "value": "USER_BORROW", - "name": "USER_BORROW", - "description": "User borrow" - }, - { - "value": "TRADE_AUTO_BORROW", - "name": "TRADE_AUTO_BORROW", - "description": "Trade auto borrow" - }, - { - "value": "USER_REPAY", - "name": "USER_REPAY", - "description": "User reply" - }, - { - "value": "AUTO_REPAY", - "name": "AUTO_REPAY", - "description": "Auto reply" + "value": "buy", + "name": "buy", + "description": "buy" }, { - "value": "DEFAULT_DEBT", - "name": "DEFAULT_DEBT", - "description": "In debt" - }, + "value": "sell", + "name": "sell", + "description": "sell" + } + ] + }, + "size": { + "type": "string", + "description": "User-specified order size" + }, + "status": { + "type": "string", + "enum": [ + "new", + "open", + "match", + "done" + ], + "description": "Order Status", + "x-api-enum": [ { - "value": "DEFAULT_CLEAR", - "name": "DEFAULT_CLEAR", - "description": "No debt" + "value": "new", + "name": "new", + "description": "the order enters the matching system" }, { - "value": "ONE_CLICK_LIQUIDATION", - "name": "ONE_CLICK_LIQUIDATION", - "description": "One click liquidation" + "value": "open", + "name": "open", + "description": "the order is in the order book(maker order)" }, { - "value": "B2C_INTEREST_SETTLE_LIQUIDATION", - "name": "B2C_INTEREST_SETTLE_LIQUIDATION", - "description": "B2C interest settle liquidation" + "value": "match", + "name": "match", + "description": "when taker order executes with orders in the order book, the taker order status is “match”" }, { - "value": "AIR_DROP_LIQUIDATION", - "name": "AIR_DROP_LIQUIDATION", - "description": "Air drop liquidation" + "value": "done", + "name": "done", + "description": "the order is fully executed successfully" } ] }, - "accumulatedPrincipal": { + "symbol": { "type": "string", - "description": "Accumulated principal" - }, - "changeAssets": { - "type": "object", - "properties": {}, - "additionalProperties": { - "type": "object", - "properties": { - "total": { - "type": "string" - }, - "hold": { - "type": "string" - }, - "liabilityPrincipal": { - "type": "string" - }, - "liabilityInterest": { - "type": "string" - } - }, - "required": [ - "total", - "hold", - "liabilityPrincipal", - "liabilityInterest" - ] - } + "examples": [ + "BTC-USDT", + "ETH-USDT", + "KCS-USDT" + ], + "description": "Symbol" }, - "timestamp": { + "ts": { "type": "integer", + "description": "Push time(Nanosecond)", "format": "int64" - } - }, - "required": [ - "tag", - "status", - "statusBizType", - "accumulatedPrincipal", - "changeAssets", - "timestamp" - ] - } - }, - "required": [ - "subject", - "userId", - "channelType", - "topic", - "type", - "data" - ], - "x-example": "{\"topic\":\"/margin/isolatedPosition:BTC-USDT\",\"subject\":\"positionChange\",\"type\":\"message\",\"userId\":\"633559791e1cbc0001f319bc\",\"channelType\":\"private\",\"data\":{\"tag\":\"BTC-USDT\",\"status\":\"DEBT\",\"statusBizType\":\"DEFAULT_DEBT\",\"accumulatedPrincipal\":\"5.01\",\"changeAssets\":{\"BTC\":{\"total\":\"0.00043478\",\"hold\":\"0\",\"liabilityPrincipal\":\"0\",\"liabilityInterest\":\"0\"},\"USDT\":{\"total\":\"0.98092004\",\"hold\":\"0\",\"liabilityPrincipal\":\"26\",\"liabilityInterest\":\"0.00025644\"}},\"timestamp\":1730121097742}}" - } - }, - "visibility": "INHERITED" - } - ] - } - ] - }, - { - "id": 38, - "name": "Futures", - "visibility": "INHERITED", - "items": [ - { - "id": 43, - "name": "Public", - "visibility": "INHERITED", - "items": [ - { - "name": "tickerv2", - "displayName": "", - "id": "#/definitions/73", - "description": "method: tickerV2\ntopic:/contractMarket/tickerV2:{symbol}\nsummary:Get Ticker V2\ndescription:Subscribe this topic to get the realtime push of BBO changes. After subscription, when there are changes in the order book(Not necessarily ask1/bid1 changes), the system will push the real-time ticker symbol information to you.\npush_frequency: realtime", - "schema": { - "jsonSchema": { - "type": "object", - "properties": { - "topic": { - "type": "string" - }, - "type": { - "type": "string" - }, - "subject": { - "type": "string" - }, - "sn": { - "type": "integer" - }, - "data": { - "type": "object", - "properties": { - "symbol": { - "type": "string" }, - "sequence": { - "type": "integer", - "format": "int64" + "type": { + "type": "string", + "enum": [ + "open", + "match", + "update", + "filled", + "canceled", + "received" + ], + "description": "Order Type", + "x-api-enum": [ + { + "value": "open", + "name": "open", + "description": "the order is in the order book(maker order)" + }, + { + "value": "match", + "name": "match", + "description": "the message sent when the order is match, 1. When the status is open and the type is match, it is a maker match. 2. When the status is match and the type is match, it is a taker match." + }, + { + "value": "update", + "name": "update", + "description": "The message sent due to the order being modified: STP triggering, partial cancellation of the order. Includes these three situations: 1. When the status is open and the type is update: partial amounts of the order have been canceled, or STP triggers 2. When the status is match and the type is update: STP triggers 3. When the status is done and the type is update: partial amounts of the order have been filled and the unfilled part got canceled, or STP is triggered." + }, + { + "value": "filled", + "name": "filled", + "description": "The message sent when the status of the order changes to DONE after the transaction" + }, + { + "value": "canceled", + "name": "canceled", + "description": "The message sent when the status of the order changes to DONE due to being canceled" + }, + { + "value": "received", + "name": "received", + "description": "The message sent when the order enters the matching system. When the order has just entered the matching system and has not yet done matching logic with the counterparty, a private message with the message type \"received\" and the order status \"new\" will be pushed." + } + ] + }, + "oldSize": { + "type": "string", + "description": "The size before order update" }, - "bestBidSize": { - "type": "integer" + "feeType": { + "type": "string", + "enum": [ + "takerFee", + "makerFee" + ], + "description": "Actual Fee Type", + "x-api-enum": [ + { + "value": "takerFee", + "name": "takerFee", + "description": "takerFee" + }, + { + "value": "makerFee", + "name": "makerFee", + "description": "makerFee" + } + ] }, - "bestBidPrice": { - "type": "string" + "liquidity": { + "type": "string", + "enum": [ + "taker", + "maker" + ], + "description": "Actual transaction order type, If the counterparty order is an [Hidden/Iceberg Order](apidog://link/pages/338146), even if it is a maker order, this param will be displayed as taker. For actual trading fee, please refer to the **feeType** ", + "x-api-enum": [ + { + "value": "taker", + "name": "taker", + "description": "taker" + }, + { + "value": "maker", + "name": "maker", + "description": "maker" + } + ] }, - "bestAskPrice": { - "type": "string" + "matchPrice": { + "type": "string", + "description": "Match Price (when the type is \"match\")" }, - "bestAskSize": { - "type": "integer" + "matchSize": { + "type": "string", + "description": "Match Size (when the type is \"match\")" }, - "ts": { - "type": "integer", - "format": "int64" + "tradeId": { + "type": "string", + "description": "Trade id, it is generated by Matching engine." } }, "required": [ + "clientOid", + "orderId", + "orderTime", + "orderType", + "originSize", + "side", + "status", "symbol", - "sequence", - "bestBidSize", - "bestBidPrice", - "bestAskPrice", - "bestAskSize", - "ts" + "ts", + "type" ] } }, @@ -49228,19 +48172,20 @@ "topic", "type", "subject", - "sn", + "userId", + "channelType", "data" ], - "x-example": "{\"topic\":\"/contractMarket/tickerV2:XBTUSDTM\",\"type\":\"message\",\"subject\":\"tickerV2\",\"sn\":1709284589209,\"data\":{\"symbol\":\"XBTUSDTM\",\"sequence\":1709284589209,\"bestBidSize\":713,\"bestBidPrice\":\"88987.4\",\"bestAskPrice\":\"88987.5\",\"bestAskSize\":1037,\"ts\":1731665526461000000}}" + "x-example": "{\"topic\":\"/spotMarket/tradeOrdersV2\",\"type\":\"message\",\"subject\":\"orderChange\",\"userId\":\"633559791e1cbc0001f319bc\",\"channelType\":\"private\",\"data\":{\"clientOid\":\"5c52e11203aa677f33e493fc\",\"orderId\":\"6720da3fa30a360007f5f832\",\"orderTime\":1730206271588,\"orderType\":\"market\",\"originSize\":\"0.00001\",\"side\":\"buy\",\"status\":\"new\",\"symbol\":\"BTC-USDT\",\"ts\":1730206271616000000,\"type\":\"received\"}}" } }, "visibility": "INHERITED" }, { - "name": "tickerV1", + "name": "orderV1", "displayName": "", - "id": "#/definitions/74", - "description": "method: tickerV1\ntopic:/contractMarket/ticker:{symbol}\nsummary:Get Ticker(not recommended)\ndescription:Subscribe this topic to get the realtime push of BBO changes.It is not recommended to use this topic any more. For real-time ticker information, please subscribe /contractMarket/tickerV2:{symbol}.\npush_frequency: realtime", + "id": "#/definitions/67", + "description": "method: orderV1\ntopic:/spotMarket/tradeOrders\nsummary:Get Order(V1)\ndescription:This topic will push all change events of your orders. \npush_frequency:real-time", "schema": { "jsonSchema": { "type": "object", @@ -49254,60 +48199,265 @@ "subject": { "type": "string" }, - "sn": { - "type": "integer" + "userId": { + "type": "string" + }, + "channelType": { + "type": "string", + "enum": [ + "private", + "public" + ], + "description": "Channel type", + "x-api-enum": [ + { + "value": "private", + "name": "private", + "description": "private channel" + }, + { + "value": "public", + "name": "public", + "description": "public channel" + } + ] }, "data": { "type": "object", "properties": { - "symbol": { - "type": "string" + "canceledSize": { + "type": "string", + "description": "Cumulative number of cancellations" }, - "sequence": { + "clientOid": { + "type": "string", + "description": "Client Order Id,The ClientOid field is a unique ID created by the user" + }, + "filledSize": { + "type": "string", + "description": "Cumulative number of filled" + }, + "orderId": { + "type": "string", + "description": "The unique order id generated by the trading system" + }, + "orderTime": { "type": "integer", + "description": "Order time(millisecond)", "format": "int64" }, - "side": { - "type": "string" + "orderType": { + "type": "string", + "enum": [ + "limit", + "market" + ], + "description": "User-specified order type", + "x-api-enum": [ + { + "value": "limit", + "name": "limit", + "description": "limit" + }, + { + "value": "market", + "name": "market", + "description": "market" + } + ] }, - "size": { - "type": "integer" + "originSize": { + "type": "string", + "description": "User-specified order size" }, "price": { - "type": "string" + "type": "string", + "description": "Specify price for currency" }, - "bestBidSize": { - "type": "integer" + "remainFunds": { + "type": "string", + "description": "Remain funds" }, - "bestBidPrice": { - "type": "string" + "remainSize": { + "type": "string", + "description": "Remain size" }, - "bestAskPrice": { - "type": "string" + "side": { + "type": "string", + "enum": [ + "buy", + "sell" + ], + "description": "buy or sell", + "x-api-enum": [ + { + "value": "buy", + "name": "buy", + "description": "buy" + }, + { + "value": "sell", + "name": "sell", + "description": "sell" + } + ] }, - "tradeId": { - "type": "string" + "size": { + "type": "string", + "description": "User-specified order size" }, - "bestAskSize": { - "type": "integer" + "status": { + "type": "string", + "enum": [ + "new", + "open", + "match", + "done" + ], + "description": "Order Status", + "x-api-enum": [ + { + "value": "new", + "name": "new", + "description": "the order enters the matching system" + }, + { + "value": "open", + "name": "open", + "description": "the order is in the order book(maker order)" + }, + { + "value": "match", + "name": "match", + "description": "when taker order executes with orders in the order book, the taker order status is “match”" + }, + { + "value": "done", + "name": "done", + "description": "the order is fully executed successfully" + } + ] + }, + "symbol": { + "type": "string", + "examples": [ + "BTC-USDT", + "ETH-USDT", + "KCS-USDT" + ], + "description": "Symbol" }, "ts": { "type": "integer", + "description": "Push time(Nanosecond)", "format": "int64" + }, + "type": { + "type": "string", + "enum": [ + "open", + "match", + "update", + "filled", + "canceled" + ], + "description": "Order Type", + "x-api-enum": [ + { + "value": "open", + "name": "open", + "description": "the order is in the order book(maker order)" + }, + { + "value": "match", + "name": "match", + "description": "the message sent when the order is match, 1. When the status is open and the type is match, it is a maker match. 2. When the status is match and the type is match, it is a taker match." + }, + { + "value": "update", + "name": "update", + "description": "The message sent due to the order being modified: STP triggering, partial cancellation of the order. Includes these three situations: 1. When the status is open and the type is update: partial amounts of the order have been canceled, or STP triggers 2. When the status is match and the type is update: STP triggers 3. When the status is done and the type is update: partial amounts of the order have been filled and the unfilled part got canceled, or STP is triggered." + }, + { + "value": "filled", + "name": "filled", + "description": "The message sent when the status of the order changes to DONE after the transaction" + }, + { + "value": "canceled", + "name": "canceled", + "description": "The message sent when the status of the order changes to DONE due to being canceled" + } + ] + }, + "oldSize": { + "type": "string", + "description": "The size before order update" + }, + "feeType": { + "type": "string", + "enum": [ + "takerFee", + "makerFee" + ], + "description": "Actual Fee Type", + "x-api-enum": [ + { + "value": "takerFee", + "name": "takerFee", + "description": "takerFee" + }, + { + "value": "makerFee", + "name": "makerFee", + "description": "makerFee" + } + ] + }, + "liquidity": { + "type": "string", + "enum": [ + "taker", + "maker" + ], + "description": "Actual transaction order type, If the counterparty order is an [Hidden/Iceberg Order](apidog://link/pages/338146), even if it is a maker order, this param will be displayed as taker. For actual trading fee, please refer to the **feeType** ", + "x-api-enum": [ + { + "value": "taker", + "name": "taker", + "description": "taker" + }, + { + "value": "maker", + "name": "maker", + "description": "maker" + } + ] + }, + "matchPrice": { + "type": "string", + "description": "Match Price (when the type is \"match\")" + }, + "matchSize": { + "type": "string", + "description": "Match Size (when the type is \"match\")" + }, + "tradeId": { + "type": "string", + "description": "Trade id, it is generated by Matching engine." } }, "required": [ - "symbol", - "sequence", + "clientOid", + "orderId", + "orderTime", + "orderType", + "originSize", "side", - "size", - "price", - "bestBidSize", - "bestBidPrice", - "bestAskPrice", - "tradeId", - "bestAskSize", - "ts" + "status", + "symbol", + "ts", + "type" ] } }, @@ -49315,19 +48465,20 @@ "topic", "type", "subject", - "sn", + "userId", + "channelType", "data" ], - "x-example": "{\"topic\":\"/contractMarket/ticker:XBTUSDTM\",\"type\":\"message\",\"subject\":\"ticker\",\"sn\":1793133570931,\"data\":{\"symbol\":\"XBTUSDTM\",\"sequence\":1793133570931,\"side\":\"sell\",\"size\":1,\"price\":\"90147.7\",\"bestBidSize\":2186,\"bestBidPrice\":\"90147.7\",\"bestAskPrice\":\"90147.8\",\"tradeId\":\"1793133570931\",\"bestAskSize\":275,\"ts\":1731679215637000000}}" + "x-example": "{\"topic\":\"/spotMarket/tradeOrdersV2\",\"type\":\"message\",\"subject\":\"orderChange\",\"userId\":\"633559791e1cbc0001f319bc\",\"channelType\":\"private\",\"data\":{\"canceledSize\":\"0\",\"clientOid\":\"5c52e11203aa677f33e493fb\",\"filledSize\":\"0\",\"orderId\":\"6720ecd9ec71f4000747731a\",\"orderTime\":1730211033305,\"orderType\":\"limit\",\"originSize\":\"0.00001\",\"price\":\"50000\",\"remainSize\":\"0.00001\",\"side\":\"buy\",\"size\":\"0.00001\",\"status\":\"open\",\"symbol\":\"BTC-USDT\",\"ts\":1730211033335000000,\"type\":\"open\"}}" } }, "visibility": "INHERITED" }, { - "name": "orderbookLevel5", + "name": "account", "displayName": "", - "id": "#/definitions/77", - "description": "method: orderbookLevel5\ntopic:/contractMarket/level2Depth5:{symbol}\nsummary: Orderbook - Level5\ndescription: The system will return the 5 best ask/bid orders data, If there is no change in the market, data will not be pushed\npush_frequency: 100ms", + "id": "#/definitions/68", + "description": "method: account\ntopic:/account/balance\nsummary:Get Account Balance\ndescription:You will receive this message when an account balance changes. The message contains the details of the change.\npush_frequency:real-time", "schema": { "jsonSchema": { "type": "object", @@ -49341,67 +48492,108 @@ "subject": { "type": "string" }, - "sn": { - "type": "integer" + "id": { + "type": "string" + }, + "userId": { + "type": "string" + }, + "channelType": { + "type": "string", + "description": "Channel type", + "enum": [ + "private", + "public" + ], + "x-api-enum": [ + { + "value": "private", + "name": "private", + "description": "private channel" + }, + { + "value": "public", + "name": "public", + "description": "public channel" + } + ] }, "data": { "type": "object", "properties": { - "bids": { - "type": "array", - "items": { - "type": "array", - "items": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "integer" - } - ] - }, - "minItems": 2, - "maxItems": 2 - } + "accountId": { + "type": "string", + "description": "Account ID" }, - "sequence": { - "type": "integer", - "format": "int64" + "available": { + "type": "string", + "description": "Funds available to withdraw or trade" }, - "timestamp": { - "type": "integer", - "format": "int64" + "availableChange": { + "type": "string", + "description": "The change of available Funds" }, - "ts": { - "type": "integer", - "format": "int64" + "currency": { + "type": "string", + "description": "currency", + "examples": [ + "BTC", + "ETH", + "KCS" + ] }, - "asks": { - "type": "array", - "items": { - "type": "array", - "items": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "integer" - } - ] + "hold": { + "type": "string", + "description": "Funds on hold (not available for use)" + }, + "holdChange": { + "type": "string", + "description": "The change of hold funds" + }, + "relationContext": { + "type": "object", + "properties": { + "symbol": { + "type": "string" }, - "minItems": 2, - "maxItems": 2 - } + "orderId": { + "type": "string" + } + }, + "required": [ + "symbol", + "orderId" + ], + "description": "Relation context" + }, + "relationEvent": { + "type": "string", + "description": "Relation event" + }, + "relationEventId": { + "type": "string", + "description": "Relation event Id" + }, + "time": { + "type": "string" + }, + "total": { + "type": "string", + "description": "Total balance = available + hold" } }, "required": [ - "bids", - "sequence", - "timestamp", - "ts", - "asks" + "accountId", + "available", + "availableChange", + "currency", + "hold", + "holdChange", + "relationContext", + "relationEvent", + "relationEventId", + "time", + "total" ] } }, @@ -49409,34 +48601,50 @@ "topic", "type", "subject", - "sn", + "id", + "userId", + "channelType", "data" ], - "x-example": "{\"topic\":\"/contractMarket/level2Depth5:XBTUSDTM\",\"type\":\"message\",\"subject\":\"level2\",\"sn\":1731680019100,\"data\":{\"bids\":[[\"89720.9\",513],[\"89720.8\",12],[\"89718.6\",113],[\"89718.4\",19],[\"89718.3\",7]],\"sequence\":1709294294670,\"timestamp\":1731680019100,\"ts\":1731680019100,\"asks\":[[\"89721\",906],[\"89721.1\",203],[\"89721.4\",113],[\"89723.2\",113],[\"89725.4\",113]]}}" + "x-example": "{\"topic\":\"/account/balance\",\"type\":\"message\",\"subject\":\"account.balance\",\"id\":\"354689988084000\",\"userId\":\"633559791e1cbc0001f319bc\",\"channelType\":\"private\",\"data\":{\"accountId\":\"548674591753\",\"currency\":\"USDT\",\"total\":\"21.133773386762\",\"available\":\"20.132773386762\",\"hold\":\"1.001\",\"availableChange\":\"-0.5005\",\"holdChange\":\"0.5005\",\"relationContext\":{\"symbol\":\"BTC-USDT\",\"orderId\":\"6721d0632db25b0007071fdc\"},\"relationEvent\":\"trade.hold\",\"relationEventId\":\"354689988084000\",\"time\":\"1730269283892\"}}" } }, "visibility": "INHERITED" - }, + } + ] + } + ] + }, + { + "id": 37, + "name": "Margin", + "visibility": "INHERITED", + "items": [ + { + "id": 41, + "name": "Public", + "visibility": "INHERITED", + "items": [ { - "name": "matchExecution", + "name": "indexPrice", "displayName": "", - "id": "#/definitions/76", - "description": "method: execution\ntopic:/contractMarket/execution:{symbol}\nsummary: Match execution data.\ndescription:For each order executed, the system will send you the match messages in the format as following.\npush_frequency: realtime", + "id": "#/definitions/69", + "description": "method:indexPrice\ntopic:/indicator/index:{symbol},{symbol}\nsummary:Index Price\ndescription:Subscribe to this topic to get the index price for the margin trading. The following ticker symbols are supported: List of currently supported symbol.\npush_frequency:once every 1s", "schema": { "jsonSchema": { "type": "object", "properties": { - "topic": { + "id": { "type": "string" }, "type": { "type": "string" }, - "subject": { + "topic": { "type": "string" }, - "sn": { - "type": "integer" + "subject": { + "type": "string" }, "data": { "type": "object", @@ -49444,119 +48652,107 @@ "symbol": { "type": "string" }, - "sequence": { - "type": "integer", - "format": "int64" - }, - "side": { - "type": "string" - }, - "size": { + "granularity": { "type": "integer" }, - "price": { - "type": "string" - }, - "takerOrderId": { - "type": "string" - }, - "makerOrderId": { - "type": "string" - }, - "tradeId": { - "type": "string" - }, - "ts": { + "timestamp": { "type": "integer", "format": "int64" + }, + "value": { + "type": "number" } }, "required": [ "symbol", - "sequence", - "side", - "size", - "price", - "takerOrderId", - "makerOrderId", - "tradeId", - "ts" + "granularity", + "timestamp", + "value" ] } }, "required": [ - "topic", + "id", "type", + "topic", "subject", - "sn", "data" ], - "x-example": "{\"topic\":\"/contractMarket/execution:XBTUSDTM\",\"type\":\"message\",\"subject\":\"match\",\"sn\":1794100537695,\"data\":{\"symbol\":\"XBTUSDTM\",\"sequence\":1794100537695,\"side\":\"buy\",\"size\":2,\"price\":\"90503.9\",\"takerOrderId\":\"247822202957807616\",\"makerOrderId\":\"247822167163555840\",\"tradeId\":\"1794100537695\",\"ts\":1731898619520000000}}" + "x-example": "{\"id\":\"5c24c5da03aa673885cd67a0\",\"type\":\"message\",\"topic\":\"/indicator/index:USDT-BTC\",\"subject\":\"tick\",\"data\":{\"symbol\":\"USDT-BTC\",\"granularity\":5000,\"timestamp\":1551770400000,\"value\":0.0001092}}" } }, "visibility": "INHERITED" }, { - "name": "orderbookIncrement", + "name": "markPrice", "displayName": "", - "id": "#/definitions/75", - "description": "method: orderbookIncrement\ntopic:/contractMarket/level2:{symbol}\nsummary: Orderbook - Increment\ndescription:The system will return the increment change orderbook data(All depth), If there is no change in the market, data will not be pushed\npush_frequency: realtime", + "id": "#/definitions/70", + "description": "method:markPrice\ntopic:/indicator/markPrice:{symbol},{symbol}\nsummary:Mark Price\ndescription:Subscribe to this topic to get the mark price for margin trading.The following ticker symbols are supported: List of currently supported symbol\npush_frequency:once every 1s", "schema": { "jsonSchema": { "type": "object", "properties": { - "topic": { + "id": { "type": "string" }, "type": { "type": "string" }, - "subject": { + "topic": { "type": "string" }, - "sn": { - "type": "integer", - "format": "int64" + "subject": { + "type": "string" }, "data": { "type": "object", "properties": { - "sequence": { - "type": "integer", - "format": "int64" - }, - "change": { + "symbol": { "type": "string" }, + "granularity": { + "type": "integer" + }, "timestamp": { "type": "integer", "format": "int64" + }, + "value": { + "type": "number" } }, "required": [ - "sequence", - "change", - "timestamp" + "symbol", + "granularity", + "timestamp", + "value" ] } }, "required": [ - "topic", + "id", "type", + "topic", "subject", - "sn", "data" ], - "x-example": "{\"topic\":\"/contractMarket/level2:XBTUSDTM\",\"type\":\"message\",\"subject\":\"level2\",\"sn\":1709400450243,\"data\":{\"sequence\":1709400450243,\"change\":\"90631.2,sell,2\",\"timestamp\":1731897467182}}" + "x-example": "{\"id\":\"5c24c5da03aa673885cd67aa\",\"type\":\"message\",\"topic\":\"/indicator/markPrice:USDT-BTC\",\"subject\":\"tick\",\"data\":{\"symbol\":\"USDT-BTC\",\"granularity\":5000,\"timestamp\":1551770400000,\"value\":0.0001093}}" } }, "visibility": "INHERITED" - }, + } + ] + }, + { + "id": 42, + "name": "Private", + "visibility": "INHERITED", + "items": [ { - "name": "orderbookLevel50", + "name": "crossMarginPosition", "displayName": "", - "id": "#/definitions/78", - "description": "method: orderbookLevel50\ntopic:/contractMarket/level2Depth50:{symbol}\nsummary: Orderbook - Level50\ndescription: The depth50 market data.\npush_frequency: 100ms", + "id": "#/definitions/71", + "description": "method:crossMarginPosition\ntopic:/margin/position\nsummary:Get Cross Margin Position change\ndescription:The system will push the change event when the position status changes, Or push the current debt message periodically when there is a liability.\npush_frequency: once every 4s", "schema": { "jsonSchema": { "type": "object", @@ -49567,94 +48763,207 @@ "type": { "type": "string" }, - "subject": { - "type": "string" - }, - "sn": { - "type": "integer" - }, "data": { "type": "object", "properties": { - "bids": { - "type": "array", - "items": { - "type": "array", - "items": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "integer" - } - ] + "debtRatio": { + "type": "number", + "description": "Debt ratio" + }, + "totalAsset": { + "type": "number", + "description": "Total asset in BTC (interest included)" + }, + "marginCoefficientTotalAsset": { + "type": "string" + }, + "totalDebt": { + "type": "string", + "description": "Total debt in BTC (interest included)" + }, + "assetList": { + "type": "object", + "properties": {}, + "description": "Asset list (interest included)", + "additionalProperties": { + "type": "object", + "properties": { + "total": { + "type": "string" + }, + "available": { + "type": "string" + }, + "hold": { + "type": "string" + } }, - "minItems": 2, - "maxItems": 2 + "required": [ + "total", + "available", + "hold" + ] } }, - "sequence": { - "type": "integer", - "format": "int64" + "debtList": { + "type": "object", + "properties": {}, + "description": "Debt list (interest included)", + "additionalProperties": { + "type": "string" + } }, "timestamp": { "type": "integer", "format": "int64" }, - "ts": { - "type": "integer", - "format": "int64" - }, - "asks": { - "type": "array", - "items": { - "type": "array", - "items": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "integer" - } - ] + "type": { + "type": "string", + "enum": [ + "FROZEN_FL", + "UNFROZEN_FL", + "FROZEN_RENEW", + "UNFROZEN_RENEW", + "LIABILITY", + "UNLIABILITY" + ], + "description": "Event type, **Only applicable to \"debt.ratio\" subject**", + "x-api-enum": [ + { + "value": "FROZEN_FL", + "name": "FROZEN_FL", + "description": "When the debt ratio exceeds the liquidation threshold and the position is frozen, the system will push this event." }, - "minItems": 2, - "maxItems": 2 - } + { + "value": "UNFROZEN_FL", + "name": "UNFROZEN_FL", + "description": "When the liquidation is finished and the position returns to “EFFECTIVE” status, the system will push this event." + }, + { + "value": "FROZEN_RENEW", + "name": "FROZEN_RENEW", + "description": "When the auto-borrow renewing is complete and the position returns to “EFFECTIVE” status, the system will push this event." + }, + { + "value": "UNFROZEN_RENEW", + "name": "UNFROZEN_RENEW", + "description": "When the account reaches a negative balance, the system will push this event." + }, + { + "value": "LIABILITY", + "name": "LIABILITY", + "description": "When the account reaches a negative balance, the system will push this event." + }, + { + "value": "UNLIABILITY", + "name": "UNLIABILITY", + "description": "When all the liabilities is repaid and the position returns to “EFFECTIVE” status, the system will push this event." + } + ] } }, "required": [ - "bids", - "sequence", + "debtRatio", + "totalAsset", + "marginCoefficientTotalAsset", + "totalDebt", + "assetList", + "debtList", "timestamp", - "ts", - "asks" + "type" + ] + }, + "subject": { + "type": "string", + "enum": [ + "debt.ratio", + "position.status" + ], + "x-api-enum": [ + { + "value": "debt.ratio", + "name": "", + "description": "" + }, + { + "value": "position.status", + "name": "", + "description": "" + } + ] + }, + "userId": { + "type": "string" + }, + "channelType": { + "type": "string", + "enum": [ + "private", + "public" + ], + "description": "Channel type", + "x-api-enum": [ + { + "value": "private", + "name": "private", + "description": "private channel" + }, + { + "value": "public", + "name": "public", + "description": "public channel" + } ] } }, "required": [ "topic", "type", + "data", "subject", - "sn", - "data" + "userId", + "channelType" ], - "x-example": "{\"topic\":\"/contractMarket/level2Depth50:XBTUSDTM\",\"type\":\"message\",\"subject\":\"level2\",\"sn\":1731680249700,\"data\":{\"bids\":[[\"89778.6\",1534],[\"89778.2\",54]],\"sequence\":1709294490099,\"timestamp\":1731680249700,\"ts\":1731680249700,\"asks\":[[\"89778.7\",854],[\"89779.2\",4]]}}" + "x-example": "{\"topic\":\"/margin/position\",\"subject\":\"debt.ratio\",\"type\":\"message\",\"userId\":\"633559791e1cbc0001f319bc\",\"channelType\":\"private\",\"data\":{\"debtRatio\":0,\"totalAsset\":0.00052431772284080000000,\"marginCoefficientTotalAsset\":\"0.0005243177228408\",\"totalDebt\":\"0\",\"assetList\":{\"BTC\":{\"total\":\"0.00002\",\"available\":\"0\",\"hold\":\"0.00002\"},\"USDT\":{\"total\":\"33.68855864\",\"available\":\"15.01916691\",\"hold\":\"18.66939173\"}},\"debtList\":{\"BTC\":\"0\",\"USDT\":\"0\"},\"timestamp\":1729912435657}}" } }, "visibility": "INHERITED" }, { - "name": "klines", + "name": "isolatedMarginPosition", "displayName": "", - "id": "#/definitions/79", - "description": "method: klines\ntopic:/contractMarket/limitCandle:{symbol}_{type}\nsummary: Klines\ndescription: Subscribe to this topic to get K-Line data.\npush_frequency: 1s", + "id": "#/definitions/72", + "description": "method:isolatedMarginPosition\ntopic:/margin/isolatedPosition:{symbol}\nsummary:Get Isolated Margin Position change\ndescription:The system will push the change event when the position status changes, Or push the current debt message periodically when there is a liability.\npush_frequency: real time", "schema": { "jsonSchema": { "type": "object", "properties": { + "subject": { + "type": "string" + }, + "userId": { + "type": "string" + }, + "channelType": { + "type": "string", + "enum": [ + "private", + "public" + ], + "description": "Channel type", + "x-api-enum": [ + { + "value": "private", + "name": "private", + "description": "private channel" + }, + { + "value": "public", + "name": "public", + "description": "public channel" + } + ] + }, "topic": { "type": "string" }, @@ -49664,49 +48973,204 @@ "data": { "type": "object", "properties": { - "symbol": { + "tag": { "type": "string", - "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](apidog://link/endpoint/3470220) " + "description": "Isolated margin symbol", + "examples": [ + "BTC-USDT", + "ETH-USDT" + ] }, - "candles": { - "type": "array", - "items": { - "type": "string" - }, - "description": "Start time, open price, close price, high price, low price, Transaction volume(This value is incorrect, please do not use it, we will fix it in subsequent versions), Transaction amount" + "status": { + "type": "string", + "description": "Position status", + "enum": [ + "DEBT", + "CLEAR", + "IN_BORROW", + "IN_REPAY", + "IN_LIQUIDATION", + "IN_AUTO_RENEW" + ], + "x-api-enum": [ + { + "value": "DEBT", + "name": "DEBT", + "description": "Debt" + }, + { + "value": "CLEAR", + "name": "CLEAR", + "description": "debt-free" + }, + { + "value": "IN_BORROW", + "name": "IN_BORROW", + "description": "Borrowing" + }, + { + "value": "IN_REPAY", + "name": "IN_REPAY", + "description": "Repayment in progress" + }, + { + "value": "IN_LIQUIDATION", + "name": "IN_LIQUIDATION", + "description": "Position closing" + }, + { + "value": "IN_AUTO_RENEW", + "name": "IN_AUTO_RENEW", + "description": "Automatically renewing" + } + ] + }, + "statusBizType": { + "type": "string", + "enum": [ + "FORCE_LIQUIDATION", + "USER_BORROW", + "TRADE_AUTO_BORROW", + "USER_REPAY", + "AUTO_REPAY", + "DEFAULT_DEBT", + "DEFAULT_CLEAR", + "ONE_CLICK_LIQUIDATION", + "B2C_INTEREST_SETTLE_LIQUIDATION", + "AIR_DROP_LIQUIDATION" + ], + "description": "Status type", + "x-api-enum": [ + { + "value": "FORCE_LIQUIDATION", + "name": "FORCE_LIQUIDATION", + "description": "Liquidation" + }, + { + "value": "USER_BORROW", + "name": "USER_BORROW", + "description": "User borrow" + }, + { + "value": "TRADE_AUTO_BORROW", + "name": "TRADE_AUTO_BORROW", + "description": "Trade auto borrow" + }, + { + "value": "USER_REPAY", + "name": "USER_REPAY", + "description": "User reply" + }, + { + "value": "AUTO_REPAY", + "name": "AUTO_REPAY", + "description": "Auto reply" + }, + { + "value": "DEFAULT_DEBT", + "name": "DEFAULT_DEBT", + "description": "In debt" + }, + { + "value": "DEFAULT_CLEAR", + "name": "DEFAULT_CLEAR", + "description": "No debt" + }, + { + "value": "ONE_CLICK_LIQUIDATION", + "name": "ONE_CLICK_LIQUIDATION", + "description": "One click liquidation" + }, + { + "value": "B2C_INTEREST_SETTLE_LIQUIDATION", + "name": "B2C_INTEREST_SETTLE_LIQUIDATION", + "description": "B2C interest settle liquidation" + }, + { + "value": "AIR_DROP_LIQUIDATION", + "name": "AIR_DROP_LIQUIDATION", + "description": "Air drop liquidation" + } + ] + }, + "accumulatedPrincipal": { + "type": "string", + "description": "Accumulated principal" + }, + "changeAssets": { + "type": "object", + "properties": {}, + "additionalProperties": { + "type": "object", + "properties": { + "total": { + "type": "string" + }, + "hold": { + "type": "string" + }, + "liabilityPrincipal": { + "type": "string" + }, + "liabilityInterest": { + "type": "string" + } + }, + "required": [ + "total", + "hold", + "liabilityPrincipal", + "liabilityInterest" + ] + } }, - "time": { + "timestamp": { "type": "integer", - "description": "timestamp(ms)", "format": "int64" } }, "required": [ - "symbol", - "candles", - "time" + "tag", + "status", + "statusBizType", + "accumulatedPrincipal", + "changeAssets", + "timestamp" ] - }, - "subject": { - "type": "string" } }, "required": [ + "subject", + "userId", + "channelType", "topic", "type", - "data", - "subject" + "data" ], - "x-example": "{\"topic\":\"/contractMarket/limitCandle:XBTUSDTM_1min\",\"type\":\"message\",\"data\":{\"symbol\":\"XBTUSDTM\",\"candles\":[\"1731898200\",\"90638.6\",\"90638.6\",\"90638.6\",\"90638.6\",\"21.0\",\"21\"],\"time\":1731898208357},\"subject\":\"candle.stick\"}" + "x-example": "{\"topic\":\"/margin/isolatedPosition:BTC-USDT\",\"subject\":\"positionChange\",\"type\":\"message\",\"userId\":\"633559791e1cbc0001f319bc\",\"channelType\":\"private\",\"data\":{\"tag\":\"BTC-USDT\",\"status\":\"DEBT\",\"statusBizType\":\"DEFAULT_DEBT\",\"accumulatedPrincipal\":\"5.01\",\"changeAssets\":{\"BTC\":{\"total\":\"0.00043478\",\"hold\":\"0\",\"liabilityPrincipal\":\"0\",\"liabilityInterest\":\"0\"},\"USDT\":{\"total\":\"0.98092004\",\"hold\":\"0\",\"liabilityPrincipal\":\"26\",\"liabilityInterest\":\"0.00025644\"}},\"timestamp\":1730121097742}}" } }, "visibility": "INHERITED" - }, + } + ] + } + ] + }, + { + "id": 38, + "name": "Futures", + "visibility": "INHERITED", + "items": [ + { + "id": 43, + "name": "Public", + "visibility": "INHERITED", + "items": [ { - "name": "instrument", + "name": "tickerv2", "displayName": "", - "id": "#/definitions/80", - "description": "method: instrument\ntopic:/contract/instrument:{symbol}\nsummary: instrument\ndescription: Subscribe this topic to get the mark Price, index Price or funding fee Rate\npush_frequency: mark.index.price 1s, funding.rate 1min\n", + "id": "#/definitions/73", + "description": "method: tickerV2\ntopic:/contractMarket/tickerV2:{symbol}\nsummary:Get Ticker V2\ndescription:Subscribe this topic to get the realtime push of BBO changes. After subscription, when there are changes in the order book(Not necessarily ask1/bid1 changes), the system will push the real-time ticker symbol information to you.\npush_frequency: realtime", "schema": { "jsonSchema": { "type": "object", @@ -49714,129 +49178,157 @@ "topic": { "type": "string" }, + "type": { + "type": "string" + }, "subject": { - "type": "string", - "enum": [ - "mark.index.price", - "funding.rate" - ], - "x-api-enum": [ - { - "value": "mark.index.price", - "name": "", - "description": "" - }, - { - "value": "funding.rate", - "name": "", - "description": "" - } - ] + "type": "string" + }, + "sn": { + "type": "integer" }, "data": { "type": "object", "properties": { - "granularity": { - "type": "integer", - "description": "Granularity (predicted funding rate: 1-min granularity: 60000; Funding rate: 8-hours granularity: 28800000. )" - }, - "fundingRate": { - "type": "number" + "symbol": { + "type": "string" }, - "timestamp": { + "sequence": { "type": "integer", "format": "int64" }, - "markPrice": { - "type": "number" + "bestBidSize": { + "type": "integer" }, - "indexPrice": { - "type": "number" + "bestBidPrice": { + "type": "string" + }, + "bestAskPrice": { + "type": "string" + }, + "bestAskSize": { + "type": "integer" + }, + "ts": { + "type": "integer", + "format": "int64" } }, "required": [ - "granularity", - "timestamp" + "symbol", + "sequence", + "bestBidSize", + "bestBidPrice", + "bestAskPrice", + "bestAskSize", + "ts" ] - }, - "type": { - "type": "string" } }, "required": [ "topic", + "type", "subject", - "data", - "type" + "sn", + "data" ], - "x-example": "{\"topic\":\"/contract/instrument:XBTUSDTM\",\"type\":\"message\",\"subject\":\"mark.index.price\",\"data\":{\"markPrice\":90445.02,\"indexPrice\":90445.02,\"granularity\":1000,\"timestamp\":1731899129000}}" + "x-example": "{\"topic\":\"/contractMarket/tickerV2:XBTUSDTM\",\"type\":\"message\",\"subject\":\"tickerV2\",\"sn\":1709284589209,\"data\":{\"symbol\":\"XBTUSDTM\",\"sequence\":1709284589209,\"bestBidSize\":713,\"bestBidPrice\":\"88987.4\",\"bestAskPrice\":\"88987.5\",\"bestAskSize\":1037,\"ts\":1731665526461000000}}" } }, "visibility": "INHERITED" }, { - "name": "fundingFeeSettlement", + "name": "tickerV1", "displayName": "", - "id": "#/definitions/81", - "description": "method: announcement\ntopic:/contract/announcement:{symbol}\nsummary: announcement\ndescription: Subscribe this topic to get Funding Fee Settlement.\npush_frequency: Settlement is made every 8 hours, real-time push", + "id": "#/definitions/74", + "description": "method: tickerV1\ntopic:/contractMarket/ticker:{symbol}\nsummary:Get Ticker(not recommended)\ndescription:Subscribe this topic to get the realtime push of BBO changes.It is not recommended to use this topic any more. For real-time ticker information, please subscribe /contractMarket/tickerV2:{symbol}.\npush_frequency: realtime", "schema": { "jsonSchema": { "type": "object", "properties": { - "type": { + "topic": { "type": "string" }, - "topic": { + "type": { "type": "string" }, "subject": { "type": "string" }, + "sn": { + "type": "integer" + }, "data": { "type": "object", "properties": { "symbol": { - "description": "Symbol", "type": "string" }, - "fundingTime": { + "sequence": { "type": "integer", - "description": "Funding time", "format": "int64" }, - "fundingRate": { - "description": "Funding rate", - "type": "number" + "side": { + "type": "string" }, - "timestamp": { + "size": { + "type": "integer" + }, + "price": { + "type": "string" + }, + "bestBidSize": { + "type": "integer" + }, + "bestBidPrice": { + "type": "string" + }, + "bestAskPrice": { + "type": "string" + }, + "tradeId": { + "type": "string" + }, + "bestAskSize": { + "type": "integer" + }, + "ts": { "type": "integer", "format": "int64" } }, "required": [ "symbol", - "fundingTime", - "fundingRate", - "timestamp" + "sequence", + "side", + "size", + "price", + "bestBidSize", + "bestBidPrice", + "bestAskPrice", + "tradeId", + "bestAskSize", + "ts" ] } }, "required": [ - "type", "topic", + "type", "subject", + "sn", "data" ], - "x-example": "{\"topic\":\"/contract/announcement\",\"subject\":\"funding.begin\",\"data\":{\"symbol\":\"XBTUSDTM\",\"fundingTime\":1551770400000,\"fundingRate\":-0.002966,\"timestamp\":1551770400000}}" + "x-example": "{\"topic\":\"/contractMarket/ticker:XBTUSDTM\",\"type\":\"message\",\"subject\":\"ticker\",\"sn\":1793133570931,\"data\":{\"symbol\":\"XBTUSDTM\",\"sequence\":1793133570931,\"side\":\"sell\",\"size\":1,\"price\":\"90147.7\",\"bestBidSize\":2186,\"bestBidPrice\":\"90147.7\",\"bestAskPrice\":\"90147.8\",\"tradeId\":\"1793133570931\",\"bestAskSize\":275,\"ts\":1731679215637000000}}" } }, "visibility": "INHERITED" }, { - "name": "symbolSnapshot", + "name": "orderbookLevel5", "displayName": "", - "id": "#/definitions/82", - "description": "method: symbolSnapshot\ntopic:/contractMarket/snapshot:{symbol}\nsummary: Symbol Snapshot\ndescription: Get symbol's snapshot.\npush_frequency:5000ms", + "id": "#/definitions/77", + "description": "method: orderbookLevel5\ntopic:/contractMarket/level2Depth5:{symbol}\nsummary: Orderbook - Level5\ndescription: The system will return the 5 best ask/bid orders data, If there is no change in the market, data will not be pushed\npush_frequency: 100ms", "schema": { "jsonSchema": { "type": "object", @@ -49850,55 +49342,67 @@ "subject": { "type": "string" }, - "id": { - "type": "string" + "sn": { + "type": "integer" }, "data": { "type": "object", "properties": { - "highPrice": { - "type": "number" - }, - "lastPrice": { - "type": "number" - }, - "lowPrice": { - "type": "number" - }, - "price24HoursBefore": { - "type": "number" - }, - "priceChg": { - "type": "number" + "bids": { + "type": "array", + "items": { + "type": "array", + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "integer" + } + ] + }, + "minItems": 2, + "maxItems": 2 + } }, - "priceChgPct": { - "type": "number" + "sequence": { + "type": "integer", + "format": "int64" }, - "symbol": { - "type": "string" + "timestamp": { + "type": "integer", + "format": "int64" }, "ts": { "type": "integer", "format": "int64" }, - "turnover": { - "type": "number" - }, - "volume": { - "type": "number" + "asks": { + "type": "array", + "items": { + "type": "array", + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "integer" + } + ] + }, + "minItems": 2, + "maxItems": 2 + } } }, "required": [ - "highPrice", - "lastPrice", - "lowPrice", - "price24HoursBefore", - "priceChg", - "priceChgPct", - "symbol", + "bids", + "sequence", + "timestamp", "ts", - "turnover", - "volume" + "asks" ] } }, @@ -49906,26 +49410,19 @@ "topic", "type", "subject", - "id", + "sn", "data" ], - "x-example": "{\"topic\":\"/contractMarket/snapshot:XBTUSDTM\",\"type\":\"message\",\"subject\":\"snapshot.24h\",\"id\":\"673ab3fff4088b0001664f41\",\"data\":{\"highPrice\":91512.8,\"lastPrice\":90326.7,\"lowPrice\":88747.8,\"price24HoursBefore\":89880.4,\"priceChg\":446.3,\"priceChgPct\":0.0049,\"symbol\":\"XBTUSDTM\",\"ts\":1731900415023929239,\"turnover\":526928331.0482177734,\"volume\":5834.46}}" + "x-example": "{\"topic\":\"/contractMarket/level2Depth5:XBTUSDTM\",\"type\":\"message\",\"subject\":\"level2\",\"sn\":1731680019100,\"data\":{\"bids\":[[\"89720.9\",513],[\"89720.8\",12],[\"89718.6\",113],[\"89718.4\",19],[\"89718.3\",7]],\"sequence\":1709294294670,\"timestamp\":1731680019100,\"ts\":1731680019100,\"asks\":[[\"89721\",906],[\"89721.1\",203],[\"89721.4\",113],[\"89723.2\",113],[\"89725.4\",113]]}}" } }, "visibility": "INHERITED" - } - ] - }, - { - "id": 44, - "name": "Private", - "visibility": "INHERITED", - "items": [ + }, { - "name": "orders", + "name": "orderbookLevel50", "displayName": "", - "id": "#/definitions/83", - "description": "method: order\ntopic:/contractMarket/tradeOrders:{symbol}\nsummary: Order change pushes.\ndescription:Push order changes for the specified symbol\npush_frequency: realtime", + "id": "#/definitions/78", + "description": "method: orderbookLevel50\ntopic:/contractMarket/level2Depth50:{symbol}\nsummary: Orderbook - Level50\ndescription: The depth50 market data.\npush_frequency: 100ms", "schema": { "jsonSchema": { "type": "object", @@ -49937,291 +49434,69 @@ "type": "string" }, "subject": { - "type": "string", - "enum": [ - "orderChange", - "symbolOrderChange" - ], - "x-api-enum": [ - { - "value": "orderChange", - "name": "orderChange", - "description": "orderChange" - }, - { - "value": "symbolOrderChange", - "name": "symbolOrderChange", - "description": "symbolOrderChange" - } - ] - }, - "userId": { "type": "string" }, - "channelType": { - "type": "string" + "sn": { + "type": "integer" }, "data": { "type": "object", "properties": { - "symbol": { - "type": "string", - "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](apidog://link/endpoint/221752070) " - }, - "orderType": { - "type": "string", - "enum": [ - "limit", - "market" - ], - "description": "User-specified order type", - "x-api-enum": [ - { - "value": "limit", - "name": "limit", - "description": "limit" - }, - { - "value": "market", - "name": "market", - "description": "market" - } - ] - }, - "side": { - "type": "string", - "enum": [ - "buy", - "sell" - ], - "description": "buy or sell", - "x-api-enum": [ - { - "value": "buy", - "name": "buy", - "description": "buy" - }, - { - "value": "sell", - "name": "sell", - "description": "sell" - } - ] - }, - "canceledSize": { - "type": "string", - "description": "Cumulative number of cancellations" - }, - "orderId": { - "type": "string", - "description": "The unique order id generated by the trading system" - }, - "marginMode": { - "type": "string", - "enum": [ - "ISOLATED", - "CROSS" - ], - "description": "Margin Mode", - "x-api-enum": [ - { - "value": "ISOLATED", - "name": "ISOLATED", - "description": "Isolated Margin" - }, - { - "value": "CROSS", - "name": "CROSS", - "description": "Cross Margin" - } - ] - }, - "type": { - "type": "string", - "description": "Order Type", - "enum": [ - "open", - "match", - "update", - "filled", - "canceled" - ], - "x-api-enum": [ - { - "value": "open", - "name": "open", - "description": "the order is in the order book(maker order)" - }, - { - "value": "match", - "name": "match", - "description": "the message sent when the order is match, 1. When the status is open and the type is match, it is a maker match. 2. When the status is match and the type is match, it is a taker match." - }, - { - "value": "update", - "name": "update", - "description": "The message sent due to the order being modified: STP triggering, partial cancellation of the order. Includes these three situations: 1. When the status is open and the type is update: partial amounts of the order have been canceled, or STP triggers 2. When the status is match and the type is update: STP triggers 3. When the status is done and the type is update: partial amounts of the order have been filled and the unfilled part got canceled, or STP is triggered." - }, - { - "value": "filled", - "name": "filled", - "description": "The message sent when the status of the order changes to DONE after the transaction" - }, - { - "value": "canceled", - "name": "canceled", - "description": "The message sent when the status of the order changes to DONE due to being canceled" - } - ] - }, - "orderTime": { - "type": "integer", - "format": "int64", - "description": "Order time(Nanosecond)" - }, - "size": { - "type": "string", - "description": "User-specified order size" - }, - "filledSize": { - "type": "string", - "description": "Cumulative number of filled" - }, - "price": { - "type": "string", - "description": "Price" - }, - "remainSize": { - "type": "string", - "description": "Remain size" - }, - "status": { - "type": "string", - "description": "Order Status", - "enum": [ - "open", - "match", - "done" - ], - "x-api-enum": [ - { - "value": "open", - "name": "open", - "description": "the order is in the order book(maker order)" - }, - { - "value": "match", - "name": "match", - "description": "when taker order executes with orders in the order book, the taker order status is “match”" - }, - { - "value": "done", - "name": "done", - "description": "the order is fully executed successfully" - } - ] - }, - "ts": { - "type": "integer", - "format": "int64", - "description": "Push time(Nanosecond)" - }, - "liquidity": { - "type": "string", - "enum": [ - "taker", - "maker" - ], - "description": "Actual transaction order type, If the counterparty order is an [Hidden/Iceberg Order](apidog://link/pages/338146), even if it is a maker order, this param will be displayed as taker. For actual trading fee, please refer to the **feeType** ", - "x-api-enum": [ - { - "value": "taker", - "name": "taker", - "description": "taker" - }, - { - "value": "maker", - "name": "maker", - "description": "maker" - } - ] - }, - "feeType": { - "type": "string", - "enum": [ - "takerFee", - "makerFee" - ], - "description": "Actual Fee Type", - "x-api-enum": [ - { - "value": "takerFee", - "name": "takerFee", - "description": "takerFee" + "bids": { + "type": "array", + "items": { + "type": "array", + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "integer" + } + ] }, - { - "value": "makerFee", - "name": "makerFee", - "description": "makerFee" - } - ] - }, - "matchPrice": { - "type": "string", - "description": "Match Price(when the type is \"match\")" - }, - "matchSize": { - "type": "string", - "description": "Match Size (when the type is \"match\")" + "minItems": 2, + "maxItems": 2 + } }, - "tradeId": { - "type": "string", - "description": "Trade id, it is generated by Matching engine." + "sequence": { + "type": "integer", + "format": "int64" }, - "oldSize": { - "type": "string", - "description": "The size before order update" + "timestamp": { + "type": "integer", + "format": "int64" }, - "clientOid": { - "type": "string", - "description": "Client Order Id,The ClientOid field is a unique ID created by the user" + "ts": { + "type": "integer", + "format": "int64" }, - "tradeType": { - "type": "string", - "description": "normal order or liquid order", - "enum": [ - "trade", - "liquid" - ], - "x-api-enum": [ - { - "value": "trade", - "name": "trade", - "description": "Normal trade order" + "asks": { + "type": "array", + "items": { + "type": "array", + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "integer" + } + ] }, - { - "value": "liquid", - "name": "liquid", - "description": "Liquid order, except type=update, all other types will be pushed" - } - ] + "minItems": 2, + "maxItems": 2 + } } }, "required": [ - "symbol", - "side", - "canceledSize", - "orderId", - "marginMode", - "type", - "orderTime", - "size", - "filledSize", - "price", - "remainSize", - "status", + "bids", + "sequence", + "timestamp", "ts", - "tradeType" + "asks" ] } }, @@ -50229,20 +49504,19 @@ "topic", "type", "subject", - "userId", - "channelType", + "sn", "data" ], - "x-example": "{\"topic\":\"/contractMarket/tradeOrders:XBTUSDTM\",\"type\":\"message\",\"subject\":\"symbolOrderChange\",\"userId\":\"633559791e1cbc0001f319bc\",\"channelType\":\"private\",\"data\":{\"symbol\":\"XBTUSDTM\",\"side\":\"buy\",\"canceledSize\":\"0\",\"orderId\":\"247899236673269761\",\"liquidity\":\"maker\",\"marginMode\":\"ISOLATED\",\"type\":\"open\",\"orderTime\":1731916985768138917,\"size\":\"1\",\"filledSize\":\"0\",\"price\":\"91670\",\"remainSize\":\"1\",\"status\":\"open\",\"ts\":1731916985789000000}}" + "x-example": "{\"topic\":\"/contractMarket/level2Depth50:XBTUSDTM\",\"type\":\"message\",\"subject\":\"level2\",\"sn\":1731680249700,\"data\":{\"bids\":[[\"89778.6\",1534],[\"89778.2\",54]],\"sequence\":1709294490099,\"timestamp\":1731680249700,\"ts\":1731680249700,\"asks\":[[\"89778.7\",854],[\"89779.2\",4]]}}" } }, "visibility": "INHERITED" }, { - "name": "balance", + "name": "orderbookIncrement", "displayName": "", - "id": "#/definitions/85", - "description": "method: balance\ntopic:/contractAccount/wallet\nsummary: the balance change push\ndescription:Subscribe this topic to get the realtime push of balance change\npush_frequency: realtime", + "id": "#/definitions/75", + "description": "method: orderbookIncrement\ntopic:/contractMarket/level2:{symbol}\nsummary: Orderbook - Increment\ndescription:The system will return the increment change orderbook data(All depth), If there is no change in the market, data will not be pushed\npush_frequency: realtime", "schema": { "jsonSchema": { "type": "object", @@ -50256,94 +49530,28 @@ "subject": { "type": "string" }, - "id": { - "type": "string" - }, - "userId": { - "type": "string" - }, - "channelType": { - "type": "string" + "sn": { + "type": "integer", + "format": "int64" }, "data": { "type": "object", "properties": { - "crossPosMargin": { - "type": "string", - "description": "Margin of the cross margin position" - }, - "isolatedOrderMargin": { - "type": "string", - "description": "Margin of the isolated margin order" - }, - "holdBalance": { - "type": "string", - "description": "Frozen Balance" - }, - "equity": { - "type": "string", - "description": "Equity" - }, - "version": { - "type": "string", - "description": "Version. When holding a cross margin position, the available balance may change with fluctuations in the mark price, leading to discrepancies in the available balance for the same version number." - }, - "availableBalance": { - "type": "string", - "description": "Available Balance" - }, - "isolatedPosMargin": { - "type": "string", - "description": "Margin of the isolated margin position, including isolated margin funding fees" - }, - "walletBalance": { - "type": "string", - "description": "Wallet Balance" - }, - "isolatedFundingFeeMargin": { - "type": "string", - "description": "Isolated margin funding fee" - }, - "crossUnPnl": { - "type": "string", - "description": "Unrealized PNL in cross margin mode" - }, - "totalCrossMargin": { - "type": "string", - "description": "Total margin under cross margin mode" - }, - "currency": { - "type": "string", - "description": "Currency Symbol" - }, - "isolatedUnPnl": { - "type": "string", - "description": " Unrealized PNL in isolated margin mode" + "sequence": { + "type": "integer", + "format": "int64" }, - "crossOrderMargin": { - "type": "string", - "description": "Margin of the cross margin order" + "change": { + "type": "string" }, "timestamp": { - "type": "string", - "description": "Last modified time" + "type": "integer", + "format": "int64" } }, "required": [ - "crossPosMargin", - "isolatedOrderMargin", - "holdBalance", - "equity", - "version", - "availableBalance", - "isolatedPosMargin", - "walletBalance", - "isolatedFundingFeeMargin", - "crossUnPnl", - "totalCrossMargin", - "currency", - "isolatedUnPnl", - "crossOrderMargin", + "sequence", + "change", "timestamp" ] } @@ -50352,33 +49560,27 @@ "topic", "type", "subject", - "id", - "userId", - "channelType", + "sn", "data" ], - "x-example": "{\"topic\":\"/contractAccount/wallet\",\"type\":\"message\",\"subject\":\"walletBalance.change\",\"id\":\"673b0bb925b4bc0001fadfef\",\"userId\":\"633559791e1cbc0001f319bc\",\"channelType\":\"private\",\"data\":{\"crossPosMargin\":\"0\",\"isolatedOrderMargin\":\"18.1188\",\"holdBalance\":\"0\",\"equity\":\"81.273621258\",\"version\":\"1337\",\"availableBalance\":\"26.144281178\",\"isolatedPosMargin\":\"36.80984008\",\"walletBalance\":\"81.072921258\",\"isolatedFundingFeeMargin\":\"0\",\"crossUnPnl\":\"0\",\"totalCrossMargin\":\"26.144281178\",\"currency\":\"USDT\",\"isolatedUnPnl\":\"0.2007\",\"crossOrderMargin\":\"0\",\"timestamp\":\"1731916996764\"}}" + "x-example": "{\"topic\":\"/contractMarket/level2:XBTUSDTM\",\"type\":\"message\",\"subject\":\"level2\",\"sn\":1709400450243,\"data\":{\"sequence\":1709400450243,\"change\":\"90631.2,sell,2\",\"timestamp\":1731897467182}}" } }, "visibility": "INHERITED" }, { - "name": "position", + "name": "klines", "displayName": "", - "id": "#/definitions/86", - "description": "method: position\ntopic:/contract/position:{symbol}\nsummary: the position change events push\ndescription:Subscribe this topic to get the realtime push of position change event of a symbol\npush_frequency: realtime", + "id": "#/definitions/79", + "description": "method: klines\ntopic:/contractMarket/limitCandle:{symbol}_{type}\nsummary: Klines\ndescription: Subscribe to this topic to get K-Line data.\npush_frequency: 1s", "schema": { "jsonSchema": { "type": "object", "properties": { - "userId": { - "type": "string", - "description": "Deprecated, will detele later" - }, "topic": { "type": "string" }, - "subject": { + "type": { "type": "string" }, "data": { @@ -50386,281 +49588,256 @@ "properties": { "symbol": { "type": "string", - "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](apidog://link/endpoint/221752070) ", - "examples": [ - "XBTUSDTM", - "XBTUSDM", - "ETHUSDTM" - ] - }, - "crossMode": { - "type": "boolean", - "description": "Whether it is cross margin." + "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](apidog://link/endpoint/3470220) " }, - "delevPercentage": { - "type": "number", - "description": "ADL ranking percentile\n" + "candles": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Start time, open price, close price, high price, low price, Transaction volume(This value is incorrect, please do not use it, we will fix it in subsequent versions), Transaction amount" }, - "openingTimestamp": { + "time": { "type": "integer", - "description": "Open time\n", + "description": "timestamp(ms)", "format": "int64" + } + }, + "required": [ + "symbol", + "candles", + "time" + ] + }, + "subject": { + "type": "string" + } + }, + "required": [ + "topic", + "type", + "data", + "subject" + ], + "x-example": "{\"topic\":\"/contractMarket/limitCandle:XBTUSDTM_1min\",\"type\":\"message\",\"data\":{\"symbol\":\"XBTUSDTM\",\"candles\":[\"1731898200\",\"90638.6\",\"90638.6\",\"90638.6\",\"90638.6\",\"21.0\",\"21\"],\"time\":1731898208357},\"subject\":\"candle.stick\"}" + } + }, + "visibility": "INHERITED" + }, + { + "name": "matchExecution", + "displayName": "", + "id": "#/definitions/76", + "description": "method: execution\ntopic:/contractMarket/execution:{symbol}\nsummary: Match execution data.\ndescription:For each order executed, the system will send you the match messages in the format as following.\npush_frequency: realtime", + "schema": { + "jsonSchema": { + "type": "object", + "properties": { + "topic": { + "type": "string" + }, + "type": { + "type": "string" + }, + "subject": { + "type": "string" + }, + "sn": { + "type": "integer" + }, + "data": { + "type": "object", + "properties": { + "symbol": { + "type": "string" }, - "currentTimestamp": { + "sequence": { "type": "integer", - "description": "Current timestamp\n", "format": "int64" }, - "currentQty": { - "type": "integer", - "description": "Current postion quantity\n" - }, - "currentCost": { - "type": "number", - "description": "Current postion value\n" - }, - "currentComm": { - "type": "number", - "description": "Current commission\n" - }, - "unrealisedCost": { - "type": "number", - "description": "Unrealised value\n" - }, - "realisedGrossCost": { - "type": "number", - "description": "Accumulated realised gross profit value\n" - }, - "realisedCost": { - "type": "number", - "description": "Current realised position value\n" - }, - "isOpen": { - "type": "boolean", - "description": "Opened position or not\n" - }, - "markPrice": { - "type": "number", - "description": "Mark price\n" - }, - "markValue": { - "type": "number", - "description": "Mark Value\n" - }, - "posCost": { - "type": "number", - "description": "Position value\n" - }, - "posInit": { - "type": "number", - "description": "Inital margin Cross = opening value/cross leverage; isolated = accumulation of initial margin for each transaction\n" - }, - "posMargin": { - "type": "number", - "description": "Bankruptcy cost Cross = mark value * imr; Isolated = position margin (accumulation of initial margin, additional margin, generated funding fees, etc.)\n" - }, - "realisedGrossPnl": { - "type": "number", - "description": "Accumulated realised gross profit value\n" - }, - "realisedPnl": { - "type": "number", - "description": "Realised profit and loss\n" - }, - "unrealisedPnl": { - "type": "number", - "description": "Unrealised profit and loss\n" - }, - "unrealisedPnlPcnt": { - "type": "number", - "description": "Profit-loss ratio of the position\n" - }, - "unrealisedRoePcnt": { - "type": "number", - "description": "Rate of return on investment\n" - }, - "avgEntryPrice": { - "type": "number", - "description": "Average entry price\n" - }, - "liquidationPrice": { - "type": "number", - "description": "Liquidation price For Cross Margin, you can refer to the liquidationPrice, and the liquidation is based on the risk rate.\n" - }, - "bankruptPrice": { - "type": "number", - "description": "Bankruptcy price For Cross Margin, you can refer to the bankruptPrice, and the liquidation is based on the risk rate.\n" - }, - "settleCurrency": { - "type": "string", - "description": "Currency used to clear and settle the trades\n" - }, - "marginMode": { - "type": "string", - "description": "Margin Mode: CROSS,ISOLATED\n", - "enum": [ - "CROSS", - "ISOLATED" - ], - "x-api-enum": [ - { - "value": "CROSS", - "name": "CROSS", - "description": "cross margin" - }, - { - "value": "ISOLATED", - "name": "ISOLATED", - "description": "isolated margin" - } - ] - }, - "positionSide": { - "type": "string", - "description": "Position Side\n", - "enum": [ - "BOTH" - ], - "x-api-enum": [ - { - "value": "BOTH", - "name": "BOTH", - "description": "One-way position" - } - ] - }, - "leverage": { - "type": "number", - "description": "Leverage" - }, - "autoDeposit": { - "type": "boolean", - "description": "Auto deposit margin or not **Only applicable to Isolated Margin**\n" - }, - "maintMarginReq": { - "type": "number", - "description": "Maintenance margin requirement **Only applicable to Isolated Margin**\n" - }, - "riskLimit": { - "type": "integer", - "description": "Risk limit **Only applicable to Isolated Margin**\n" - }, - "realLeverage": { - "type": "number", - "description": "Leverage of the order **Only applicable to Isolated Margin**\n" - }, - "posCross": { - "type": "number", - "description": "added margin **Only applicable to Isolated Margin**\n" + "side": { + "type": "string" }, - "posComm": { - "type": "number", - "description": "Bankruptcy cost **Only applicable to Isolated Margin**\n" + "size": { + "type": "integer" }, - "posLoss": { - "type": "number", - "description": "Funding fees paid out **Only applicable to Isolated Margin**\n" + "price": { + "type": "string" }, - "posFunding": { - "type": "number", - "description": "The current remaining unsettled funding fee for the position **Only applicable to Isolated Margin**\n" + "takerOrderId": { + "type": "string" }, - "posMaint": { - "type": "number", - "description": "Maintenance margin **Only applicable to Isolated Margin**\n" + "makerOrderId": { + "type": "string" }, - "maintMargin": { - "type": "number", - "description": "Position margin **Only applicable to Isolated Margin**\n" + "tradeId": { + "type": "string" }, - "fundingTime": { + "ts": { "type": "integer", - "format": "int64", - "description": "Funding time" + "format": "int64" + } + }, + "required": [ + "symbol", + "sequence", + "side", + "size", + "price", + "takerOrderId", + "makerOrderId", + "tradeId", + "ts" + ] + } + }, + "required": [ + "topic", + "type", + "subject", + "sn", + "data" + ], + "x-example": "{\"topic\":\"/contractMarket/execution:XBTUSDTM\",\"type\":\"message\",\"subject\":\"match\",\"sn\":1794100537695,\"data\":{\"symbol\":\"XBTUSDTM\",\"sequence\":1794100537695,\"side\":\"buy\",\"size\":2,\"price\":\"90503.9\",\"takerOrderId\":\"247822202957807616\",\"makerOrderId\":\"247822167163555840\",\"tradeId\":\"1794100537695\",\"ts\":1731898619520000000}}" + } + }, + "visibility": "INHERITED" + }, + { + "name": "instrument", + "displayName": "", + "id": "#/definitions/80", + "description": "method: instrument\ntopic:/contract/instrument:{symbol}\nsummary: instrument\ndescription: Subscribe this topic to get the mark Price, index Price or funding fee Rate\npush_frequency: mark.index.price 1s, funding.rate 1min\n", + "schema": { + "jsonSchema": { + "type": "object", + "properties": { + "topic": { + "type": "string" + }, + "subject": { + "type": "string", + "enum": [ + "mark.index.price", + "funding.rate" + ], + "x-api-enum": [ + { + "value": "mark.index.price", + "name": "", + "description": "" }, - "qty": { + { + "value": "funding.rate", + "name": "", + "description": "" + } + ] + }, + "data": { + "type": "object", + "properties": { + "granularity": { "type": "integer", - "description": "Position size" + "description": "Granularity (predicted funding rate: 1-min granularity: 60000; Funding rate: 8-hours granularity: 28800000. )" }, "fundingRate": { - "type": "number", - "description": "Funding rate" - }, - "fundingFee": { - "type": "number", - "description": "Funding fees" + "type": "number" }, - "ts": { + "timestamp": { "type": "integer", - "format": "int64", - "description": "Funding Fee Settlement Time (nanosecond)" + "format": "int64" }, - "success": { - "type": "boolean", - "description": "Adjustment isolated margin risk limit level successful or not" + "markPrice": { + "type": "number" }, - "msg": { - "type": "string", - "description": "Adjustment isolated margin risk limit level failure reason" + "indexPrice": { + "type": "number" } }, "required": [ - "symbol", - "crossMode", - "delevPercentage", - "openingTimestamp", - "currentTimestamp", - "currentQty", - "currentCost", - "currentComm", - "unrealisedCost", - "realisedGrossCost", - "realisedCost", - "isOpen", - "markPrice", - "markValue", - "posCost", - "posInit", - "posMargin", - "realisedGrossPnl", - "realisedPnl", - "unrealisedPnl", - "unrealisedPnlPcnt", - "unrealisedRoePcnt", - "avgEntryPrice", - "liquidationPrice", - "bankruptPrice", - "settleCurrency", - "marginMode", - "positionSide", - "leverage" + "granularity", + "timestamp" ] }, "type": { "type": "string" - }, - "channelType": { - "type": "string" } }, "required": [ - "userId", "topic", "subject", "data", + "type" + ], + "x-example": "{\"topic\":\"/contract/instrument:XBTUSDTM\",\"type\":\"message\",\"subject\":\"mark.index.price\",\"data\":{\"markPrice\":90445.02,\"indexPrice\":90445.02,\"granularity\":1000,\"timestamp\":1731899129000}}" + } + }, + "visibility": "INHERITED" + }, + { + "name": "fundingFeeSettlement", + "displayName": "", + "id": "#/definitions/81", + "description": "method: announcement\ntopic:/contract/announcement:{symbol}\nsummary: announcement\ndescription: Subscribe this topic to get Funding Fee Settlement.\npush_frequency: Settlement is made every 8 hours, real-time push", + "schema": { + "jsonSchema": { + "type": "object", + "properties": { + "type": { + "type": "string" + }, + "topic": { + "type": "string" + }, + "subject": { + "type": "string" + }, + "data": { + "type": "object", + "properties": { + "symbol": { + "description": "Symbol", + "type": "string" + }, + "fundingTime": { + "type": "integer", + "description": "Funding time", + "format": "int64" + }, + "fundingRate": { + "description": "Funding rate", + "type": "number" + }, + "timestamp": { + "type": "integer", + "format": "int64" + } + }, + "required": [ + "symbol", + "fundingTime", + "fundingRate", + "timestamp" + ] + } + }, + "required": [ "type", - "channelType" + "topic", + "subject", + "data" ], - "x-example": "{\"topic\":\"/contract/position:XBTUSDTM\",\"type\":\"message\",\"data\":{\"symbol\":\"XBTUSDTM\",\"maintMarginReq\":0.005,\"riskLimit\":500000,\"realLeverage\":4.9685590767,\"crossMode\":false,\"delevPercentage\":0.10,\"openingTimestamp\":1731916913097,\"autoDeposit\":true,\"currentTimestamp\":1731924561514,\"currentQty\":1,\"currentCost\":91.5306,\"currentComm\":0.09179284,\"unrealisedCost\":91.6945,\"realisedCost\":-0.07210716,\"isOpen\":true,\"markPrice\":91839.79,\"markValue\":91.83979,\"posCost\":91.6945,\"posCross\":0,\"posInit\":18.3389,\"posComm\":0.06602004,\"posLoss\":0,\"posMargin\":18.40492004,\"posFunding\":0,\"posMaint\":0.5634627025,\"maintMargin\":18.55021004,\"avgEntryPrice\":91694.5,\"liquidationPrice\":73853.0426625,\"bankruptPrice\":73355.6,\"settleCurrency\":\"USDT\",\"changeReason\":\"positionChange\",\"riskLimitLevel\":2,\"realisedGrossCost\":-0.1639,\"realisedGrossPnl\":0.1639,\"realisedPnl\":0.07210716,\"unrealisedPnl\":0.14529,\"unrealisedPnlPcnt\":0.0016,\"unrealisedRoePcnt\":0.0079,\"leverage\":4.9685590767,\"marginMode\":\"ISOLATED\",\"positionSide\":\"BOTH\"},\"subject\":\"position.change\",\"userId\":\"633559791e1cbc0001f319bc\",\"channelType\":\"private\"}" + "x-example": "{\"topic\":\"/contract/announcement\",\"subject\":\"funding.begin\",\"data\":{\"symbol\":\"XBTUSDTM\",\"fundingTime\":1551770400000,\"fundingRate\":-0.002966,\"timestamp\":1551770400000}}" } }, "visibility": "INHERITED" }, { - "name": "stopOrders", + "name": "symbolSnapshot", "displayName": "", - "id": "#/definitions/84", - "description": "method: stopOrders\ntopic:/contractMarket/advancedOrders\nsummary: stop order change pushes.\ndescription:Subscribe this topic to get the realtime push of stop order changes.\npush_frequency: realtime", + "id": "#/definitions/82", + "description": "method: symbolSnapshot\ntopic:/contractMarket/snapshot:{symbol}\nsummary: Symbol Snapshot\ndescription: Get symbol's snapshot.\npush_frequency:5000ms", "schema": { "jsonSchema": { "type": "object", @@ -50671,52 +49848,144 @@ "type": { "type": "string" }, + "subject": { + "type": "string" + }, + "id": { + "type": "string" + }, "data": { "type": "object", "properties": { - "createdAt": { + "highPrice": { + "type": "number" + }, + "lastPrice": { + "type": "number" + }, + "lowPrice": { + "type": "number" + }, + "price24HoursBefore": { + "type": "number" + }, + "priceChg": { + "type": "number" + }, + "priceChgPct": { + "type": "number" + }, + "symbol": { + "type": "string" + }, + "ts": { "type": "integer", "format": "int64" }, - "marginMode": { - "type": "string", - "enum": [ - "ISOLATED", - "CROSS" - ], - "description": "Margin Mode", - "x-api-enum": [ - { - "value": "ISOLATED", - "name": "ISOLATED", - "description": "Isolated Margin" - }, - { - "value": "CROSS", - "name": "CROSS", - "description": "Cross Margin" - } - ] + "turnover": { + "type": "number" }, - "orderId": { - "type": "string", - "description": "The unique order id generated by the trading system" + "volume": { + "type": "number" + } + }, + "required": [ + "highPrice", + "lastPrice", + "lowPrice", + "price24HoursBefore", + "priceChg", + "priceChgPct", + "symbol", + "ts", + "turnover", + "volume" + ] + } + }, + "required": [ + "topic", + "type", + "subject", + "id", + "data" + ], + "x-example": "{\"topic\":\"/contractMarket/snapshot:XBTUSDTM\",\"type\":\"message\",\"subject\":\"snapshot.24h\",\"id\":\"673ab3fff4088b0001664f41\",\"data\":{\"highPrice\":91512.8,\"lastPrice\":90326.7,\"lowPrice\":88747.8,\"price24HoursBefore\":89880.4,\"priceChg\":446.3,\"priceChgPct\":0.0049,\"symbol\":\"XBTUSDTM\",\"ts\":1731900415023929239,\"turnover\":526928331.0482177734,\"volume\":5834.46}}" + } + }, + "visibility": "INHERITED" + } + ] + }, + { + "id": 44, + "name": "Private", + "visibility": "INHERITED", + "items": [ + { + "name": "orders", + "displayName": "", + "id": "#/definitions/83", + "description": "method: order\ntopic:/contractMarket/tradeOrders:{symbol}\nsummary: Order change pushes.\ndescription:Push order changes for the specified symbol\npush_frequency: realtime", + "schema": { + "jsonSchema": { + "type": "object", + "properties": { + "topic": { + "type": "string" + }, + "type": { + "type": "string" + }, + "subject": { + "type": "string", + "enum": [ + "orderChange", + "symbolOrderChange" + ], + "x-api-enum": [ + { + "value": "orderChange", + "name": "orderChange", + "description": "orderChange" }, - "orderPrice": { + { + "value": "symbolOrderChange", + "name": "symbolOrderChange", + "description": "symbolOrderChange" + } + ] + }, + "userId": { + "type": "string" + }, + "channelType": { + "type": "string" + }, + "data": { + "type": "object", + "properties": { + "symbol": { "type": "string", - "description": "Order price" + "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](apidog://link/endpoint/221752070) " }, "orderType": { "type": "string", - "description": "User-specified order type", "enum": [ - "stop" + "limit", + "market" ], + "description": "User-specified order type", "x-api-enum": [ { - "value": "stop", - "name": "stop", - "description": "Stop order" + "value": "limit", + "name": "limit", + "description": "limit" + }, + { + "value": "market", + "name": "market", + "description": "market" } ] }, @@ -50740,52 +50009,100 @@ } ] }, - "size": { - "type": "integer", - "description": "User-specified order size" + "canceledSize": { + "type": "string", + "description": "Cumulative number of cancellations" }, - "stop": { + "orderId": { + "type": "string", + "description": "The unique order id generated by the trading system" + }, + "marginMode": { "type": "string", - "description": "Either 'down' or 'up'", "enum": [ - "down", - "up" + "ISOLATED", + "CROSS" ], + "description": "Margin Mode", "x-api-enum": [ { - "value": "down", - "name": "down", - "description": "Triggers when the price reaches or goes below the stopPrice" + "value": "ISOLATED", + "name": "ISOLATED", + "description": "Isolated Margin" }, { - "value": "up", - "name": "up", - "description": "Triggers when the price reaches or goes above the stopPrice" + "value": "CROSS", + "name": "CROSS", + "description": "Cross Margin" } ] }, - "stopPrice": { + "type": { "type": "string", - "description": "Stop Price" + "description": "Order Type", + "enum": [ + "open", + "match", + "update", + "filled", + "canceled" + ], + "x-api-enum": [ + { + "value": "open", + "name": "open", + "description": "the order is in the order book(maker order)" + }, + { + "value": "match", + "name": "match", + "description": "the message sent when the order is match, 1. When the status is open and the type is match, it is a maker match. 2. When the status is match and the type is match, it is a taker match." + }, + { + "value": "update", + "name": "update", + "description": "The message sent due to the order being modified: STP triggering, partial cancellation of the order. Includes these three situations: 1. When the status is open and the type is update: partial amounts of the order have been canceled, or STP triggers 2. When the status is match and the type is update: STP triggers 3. When the status is done and the type is update: partial amounts of the order have been filled and the unfilled part got canceled, or STP is triggered." + }, + { + "value": "filled", + "name": "filled", + "description": "The message sent when the status of the order changes to DONE after the transaction" + }, + { + "value": "canceled", + "name": "canceled", + "description": "The message sent when the status of the order changes to DONE due to being canceled" + } + ] }, - "stopPriceType": { - "type": "string" + "orderTime": { + "type": "integer", + "format": "int64", + "description": "Order time(Nanosecond)" }, - "symbol": { + "size": { "type": "string", - "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](apidog://link/endpoint/221752070) " + "description": "User-specified order size" }, - "ts": { - "type": "integer", - "format": "int64" + "filledSize": { + "type": "string", + "description": "Cumulative number of filled" }, - "type": { + "price": { "type": "string", - "description": "Order Type", + "description": "Price" + }, + "remainSize": { + "type": "string", + "description": "Remain size" + }, + "status": { + "type": "string", + "description": "Order Status", "enum": [ "open", - "triggered", - "cancel" + "match", + "done" ], "x-api-enum": [ { @@ -50794,149 +50111,119 @@ "description": "the order is in the order book(maker order)" }, { - "value": "triggered", - "name": "triggered", - "description": "when the stop order has been triggered" + "value": "match", + "name": "match", + "description": "when taker order executes with orders in the order book, the taker order status is “match”" }, { - "value": "cancel", - "name": "cancel", - "description": "when the order has been canceled" + "value": "done", + "name": "done", + "description": "the order is fully executed successfully" } ] - } - }, - "required": [ - "createdAt", - "marginMode", - "orderId", - "orderPrice", - "orderType", - "side", - "size", - "stop", - "stopPrice", - "stopPriceType", - "symbol", - "ts", - "type" - ] - }, - "subject": { - "type": "string" - }, - "id": { - "type": "string" - }, - "userId": { - "type": "string" - }, - "channelType": { - "type": "string" - } - }, - "required": [ - "topic", - "type", - "data", - "subject", - "id", - "userId", - "channelType" - ], - "x-example": "{\"topic\":\"/contractMarket/advancedOrders\",\"type\":\"message\",\"data\":{\"createdAt\":1730194206837,\"marginMode\":\"ISOLATED\",\"orderId\":\"240673378116083712\",\"orderPrice\":\"0.1\",\"orderType\":\"stop\",\"side\":\"buy\",\"size\":1,\"stop\":\"down\",\"stopPrice\":\"1000\",\"stopPriceType\":\"TP\",\"symbol\":\"XBTUSDTM\",\"ts\":1730194206843133000,\"type\":\"open\"},\"subject\":\"stopOrder\",\"id\":\"6720ab1ea52a9b0001734392\",\"userId\":\"66f12e8befb04d0001882b49\",\"channelType\":\"private\"}" - } - }, - "visibility": "INHERITED" - }, - { - "name": "marginMode", - "displayName": "", - "id": "#/definitions/87", - "description": "method: marginMode\ntopic:/contract/marginMode\nsummary: the margin mode change\ndescription:Subscribe this topic to get the realtime push of margin mode change event of a symbol\npush_frequency: realtime", - "schema": { - "jsonSchema": { - "type": "object", - "properties": { - "topic": { - "type": "string" - }, - "type": { - "type": "string" - }, - "data": { - "type": "object", - "properties": { - "SYMBOL": { + }, + "ts": { + "type": "integer", + "format": "int64", + "description": "Push time(Nanosecond)" + }, + "liquidity": { + "type": "string", + "enum": [ + "taker", + "maker" + ], + "description": "Actual transaction order type, If the counterparty order is an [Hidden/Iceberg Order](apidog://link/pages/338146), even if it is a maker order, this param will be displayed as taker. For actual trading fee, please refer to the **feeType** ", + "x-api-enum": [ + { + "value": "taker", + "name": "taker", + "description": "taker" + }, + { + "value": "maker", + "name": "maker", + "description": "maker" + } + ] + }, + "feeType": { + "type": "string", + "enum": [ + "takerFee", + "makerFee" + ], + "description": "Actual Fee Type", + "x-api-enum": [ + { + "value": "takerFee", + "name": "takerFee", + "description": "takerFee" + }, + { + "value": "makerFee", + "name": "makerFee", + "description": "makerFee" + } + ] + }, + "matchPrice": { "type": "string", - "description": "The SYMBOL is the key with value \n\"CROSS\" or \"ISOLATED\"" + "description": "Match Price(when the type is \"match\")" + }, + "matchSize": { + "type": "string", + "description": "Match Size (when the type is \"match\")" + }, + "tradeId": { + "type": "string", + "description": "Trade id, it is generated by Matching engine." + }, + "oldSize": { + "type": "string", + "description": "The size before order update" + }, + "clientOid": { + "type": "string", + "description": "Client Order Id,The ClientOid field is a unique ID created by the user" + }, + "tradeType": { + "type": "string", + "description": "normal order or liquid order", + "enum": [ + "trade", + "liquid" + ], + "x-api-enum": [ + { + "value": "trade", + "name": "trade", + "description": "Normal trade order" + }, + { + "value": "liquid", + "name": "liquid", + "description": "Liquid order, except type=update, all other types will be pushed" + } + ] } }, "required": [ - "SYMBOL" + "symbol", + "side", + "canceledSize", + "orderId", + "marginMode", + "type", + "orderTime", + "size", + "filledSize", + "price", + "remainSize", + "status", + "ts", + "tradeType" ] - }, - "subject": { - "type": "string" - }, - "userId": { - "type": "string" - }, - "channelType": { - "type": "string" - } - }, - "required": [ - "topic", - "type", - "data", - "subject", - "userId", - "channelType" - ], - "x-example": "{\"topic\":\"/contract/marginMode\",\"type\":\"message\",\"data\":{\"ETHUSDTM\":\"ISOLATED\"},\"subject\":\"user.config\",\"userId\":\"66f12e8befb04d0001882b49\",\"channelType\":\"private\"}" - } - }, - "visibility": "INHERITED" - }, - { - "name": "crossLeverage", - "displayName": "", - "id": "#/definitions/88", - "description": "method: crossLeverage\ntopic:/contract/crossLeverage\nsummary: the leverage change push\ndescription:Subscribe this topic to get the realtime push of leverage change of contracts that are in cross margin mode\npush_frequency: realtime", - "schema": { - "jsonSchema": { - "type": "object", - "properties": { - "topic": { - "type": "string" - }, - "type": { - "type": "string" - }, - "subject": { - "type": "string" - }, - "userId": { - "type": "string" - }, - "channelType": { - "type": "string" - }, - "data": { - "type": "object", - "properties": {}, - "additionalProperties": { - "type": "object", - "properties": { - "leverage": { - "type": "string" - } - }, - "required": [ - "leverage" - ] - } } }, "required": [ @@ -50947,7 +50234,7 @@ "channelType", "data" ], - "x-example": "{\"topic\":\"/contract/crossLeverage\",\"type\":\"message\",\"data\":{\"ETHUSDTM\":{\"leverage\":\"8\"}},\"subject\":\"user.config\",\"userId\":\"66f12e8befb04d0001882b49\",\"channelType\":\"private\"}" + "x-example": "{\"topic\":\"/contractMarket/tradeOrders:XBTUSDTM\",\"type\":\"message\",\"subject\":\"symbolOrderChange\",\"userId\":\"633559791e1cbc0001f319bc\",\"channelType\":\"private\",\"data\":{\"symbol\":\"XBTUSDTM\",\"side\":\"buy\",\"canceledSize\":\"0\",\"orderId\":\"247899236673269761\",\"liquidity\":\"maker\",\"marginMode\":\"ISOLATED\",\"type\":\"open\",\"orderTime\":1731916985768138917,\"size\":\"1\",\"filledSize\":\"0\",\"price\":\"91670\",\"remainSize\":\"1\",\"status\":\"open\",\"ts\":1731916985789000000}}" } }, "visibility": "INHERITED" @@ -51197,74 +50484,492 @@ } ] }, - "matchPrice": { - "type": "string", - "description": "Match Price(when the type is \"match\")" + "matchPrice": { + "type": "string", + "description": "Match Price(when the type is \"match\")" + }, + "matchSize": { + "type": "string", + "description": "Match Size (when the type is \"match\")" + }, + "tradeId": { + "type": "string", + "description": "Trade id, it is generated by Matching engine." + }, + "oldSize": { + "type": "string", + "description": "The size before order update" + }, + "clientOid": { + "type": "string", + "description": "Client Order Id,The ClientOid field is a unique ID created by the user" + }, + "tradeType": { + "type": "string", + "description": "normal order or liquid order", + "enum": [ + "trade", + "liquid" + ], + "x-api-enum": [ + { + "value": "trade", + "name": "trade", + "description": "Normal trade order" + }, + { + "value": "liquid", + "name": "liquid", + "description": "Liquid order, except type=update, all other types will be pushed" + } + ] + } + }, + "required": [ + "symbol", + "side", + "canceledSize", + "orderId", + "marginMode", + "type", + "orderTime", + "size", + "filledSize", + "price", + "remainSize", + "status", + "ts", + "tradeType" + ] + } + }, + "required": [ + "topic", + "type", + "subject", + "userId", + "channelType", + "data" + ], + "x-example": "{\"topic\":\"/contractMarket/tradeOrders:XBTUSDTM\",\"type\":\"message\",\"subject\":\"symbolOrderChange\",\"userId\":\"633559791e1cbc0001f319bc\",\"channelType\":\"private\",\"data\":{\"symbol\":\"XBTUSDTM\",\"side\":\"buy\",\"canceledSize\":\"0\",\"orderId\":\"247899236673269761\",\"liquidity\":\"maker\",\"marginMode\":\"ISOLATED\",\"type\":\"open\",\"orderTime\":1731916985768138917,\"size\":\"1\",\"filledSize\":\"0\",\"price\":\"91670\",\"remainSize\":\"1\",\"status\":\"open\",\"ts\":1731916985789000000}}" + } + }, + "visibility": "INHERITED" + }, + { + "name": "balance", + "displayName": "", + "id": "#/definitions/85", + "description": "method: balance\ntopic:/contractAccount/wallet\nsummary: the balance change push\ndescription:Subscribe this topic to get the realtime push of balance change\npush_frequency: realtime", + "schema": { + "jsonSchema": { + "type": "object", + "properties": { + "topic": { + "type": "string" + }, + "type": { + "type": "string" + }, + "subject": { + "type": "string" + }, + "id": { + "type": "string" + }, + "userId": { + "type": "string" + }, + "channelType": { + "type": "string" + }, + "data": { + "type": "object", + "properties": { + "crossPosMargin": { + "type": "string", + "description": "Margin of the cross margin position" + }, + "isolatedOrderMargin": { + "type": "string", + "description": "Margin of the isolated margin order" + }, + "holdBalance": { + "type": "string", + "description": "Frozen Balance" + }, + "equity": { + "type": "string", + "description": "Equity" + }, + "version": { + "type": "string", + "description": "Version. When holding a cross margin position, the available balance may change with fluctuations in the mark price, leading to discrepancies in the available balance for the same version number." + }, + "availableBalance": { + "type": "string", + "description": "Available Balance" + }, + "isolatedPosMargin": { + "type": "string", + "description": "Margin of the isolated margin position, including isolated margin funding fees" + }, + "walletBalance": { + "type": "string", + "description": "Wallet Balance" + }, + "isolatedFundingFeeMargin": { + "type": "string", + "description": "Isolated margin funding fee" + }, + "crossUnPnl": { + "type": "string", + "description": "Unrealized PNL in cross margin mode" + }, + "totalCrossMargin": { + "type": "string", + "description": "Total margin under cross margin mode" + }, + "currency": { + "type": "string", + "description": "Currency Symbol" + }, + "isolatedUnPnl": { + "type": "string", + "description": " Unrealized PNL in isolated margin mode" + }, + "crossOrderMargin": { + "type": "string", + "description": "Margin of the cross margin order" + }, + "timestamp": { + "type": "string", + "description": "Last modified time" + } + }, + "required": [ + "crossPosMargin", + "isolatedOrderMargin", + "holdBalance", + "equity", + "version", + "availableBalance", + "isolatedPosMargin", + "walletBalance", + "isolatedFundingFeeMargin", + "crossUnPnl", + "totalCrossMargin", + "currency", + "isolatedUnPnl", + "crossOrderMargin", + "timestamp" + ] + } + }, + "required": [ + "topic", + "type", + "subject", + "id", + "userId", + "channelType", + "data" + ], + "x-example": "{\"topic\":\"/contractAccount/wallet\",\"type\":\"message\",\"subject\":\"walletBalance.change\",\"id\":\"673b0bb925b4bc0001fadfef\",\"userId\":\"633559791e1cbc0001f319bc\",\"channelType\":\"private\",\"data\":{\"crossPosMargin\":\"0\",\"isolatedOrderMargin\":\"18.1188\",\"holdBalance\":\"0\",\"equity\":\"81.273621258\",\"version\":\"1337\",\"availableBalance\":\"26.144281178\",\"isolatedPosMargin\":\"36.80984008\",\"walletBalance\":\"81.072921258\",\"isolatedFundingFeeMargin\":\"0\",\"crossUnPnl\":\"0\",\"totalCrossMargin\":\"26.144281178\",\"currency\":\"USDT\",\"isolatedUnPnl\":\"0.2007\",\"crossOrderMargin\":\"0\",\"timestamp\":\"1731916996764\"}}" + } + }, + "visibility": "INHERITED" + }, + { + "name": "position", + "displayName": "", + "id": "#/definitions/86", + "description": "method: position\ntopic:/contract/position:{symbol}\nsummary: the position change events push\ndescription:Subscribe this topic to get the realtime push of position change event of a symbol\npush_frequency: realtime", + "schema": { + "jsonSchema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "Deprecated, will detele later" + }, + "topic": { + "type": "string" + }, + "subject": { + "type": "string" + }, + "data": { + "type": "object", + "properties": { + "symbol": { + "type": "string", + "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](apidog://link/endpoint/221752070) ", + "examples": [ + "XBTUSDTM", + "XBTUSDM", + "ETHUSDTM" + ] + }, + "crossMode": { + "type": "boolean", + "description": "Whether it is cross margin." + }, + "delevPercentage": { + "type": "number", + "description": "ADL ranking percentile\n" + }, + "openingTimestamp": { + "type": "integer", + "description": "Open time\n", + "format": "int64" + }, + "currentTimestamp": { + "type": "integer", + "description": "Current timestamp\n", + "format": "int64" + }, + "currentQty": { + "type": "integer", + "description": "Current postion quantity\n" + }, + "currentCost": { + "type": "number", + "description": "Current postion value\n" + }, + "currentComm": { + "type": "number", + "description": "Current commission\n" + }, + "unrealisedCost": { + "type": "number", + "description": "Unrealised value\n" + }, + "realisedGrossCost": { + "type": "number", + "description": "Accumulated realised gross profit value\n" + }, + "realisedCost": { + "type": "number", + "description": "Current realised position value\n" + }, + "isOpen": { + "type": "boolean", + "description": "Opened position or not\n" + }, + "markPrice": { + "type": "number", + "description": "Mark price\n" + }, + "markValue": { + "type": "number", + "description": "Mark Value\n" + }, + "posCost": { + "type": "number", + "description": "Position value\n" + }, + "posInit": { + "type": "number", + "description": "Inital margin Cross = opening value/cross leverage; isolated = accumulation of initial margin for each transaction\n" + }, + "posMargin": { + "type": "number", + "description": "Bankruptcy cost Cross = mark value * imr; Isolated = position margin (accumulation of initial margin, additional margin, generated funding fees, etc.)\n" + }, + "realisedGrossPnl": { + "type": "number", + "description": "Accumulated realised gross profit value\n" + }, + "realisedPnl": { + "type": "number", + "description": "Realised profit and loss\n" + }, + "unrealisedPnl": { + "type": "number", + "description": "Unrealised profit and loss\n" + }, + "unrealisedPnlPcnt": { + "type": "number", + "description": "Profit-loss ratio of the position\n" + }, + "unrealisedRoePcnt": { + "type": "number", + "description": "Rate of return on investment\n" + }, + "avgEntryPrice": { + "type": "number", + "description": "Average entry price\n" + }, + "liquidationPrice": { + "type": "number", + "description": "Liquidation price For Cross Margin, you can refer to the liquidationPrice, and the liquidation is based on the risk rate.\n" + }, + "bankruptPrice": { + "type": "number", + "description": "Bankruptcy price For Cross Margin, you can refer to the bankruptPrice, and the liquidation is based on the risk rate.\n" + }, + "settleCurrency": { + "type": "string", + "description": "Currency used to clear and settle the trades\n" + }, + "marginMode": { + "type": "string", + "description": "Margin Mode: CROSS,ISOLATED\n", + "enum": [ + "CROSS", + "ISOLATED" + ], + "x-api-enum": [ + { + "value": "CROSS", + "name": "CROSS", + "description": "cross margin" + }, + { + "value": "ISOLATED", + "name": "ISOLATED", + "description": "isolated margin" + } + ] + }, + "positionSide": { + "type": "string", + "description": "Position Side\n", + "enum": [ + "BOTH" + ], + "x-api-enum": [ + { + "value": "BOTH", + "name": "BOTH", + "description": "One-way position" + } + ] + }, + "leverage": { + "type": "number", + "description": "Leverage" + }, + "autoDeposit": { + "type": "boolean", + "description": "Auto deposit margin or not **Only applicable to Isolated Margin**\n" + }, + "maintMarginReq": { + "type": "number", + "description": "Maintenance margin requirement **Only applicable to Isolated Margin**\n" + }, + "riskLimit": { + "type": "integer", + "description": "Risk limit **Only applicable to Isolated Margin**\n" + }, + "realLeverage": { + "type": "number", + "description": "Leverage of the order **Only applicable to Isolated Margin**\n" + }, + "posCross": { + "type": "number", + "description": "added margin **Only applicable to Isolated Margin**\n" + }, + "posComm": { + "type": "number", + "description": "Bankruptcy cost **Only applicable to Isolated Margin**\n" + }, + "posLoss": { + "type": "number", + "description": "Funding fees paid out **Only applicable to Isolated Margin**\n" + }, + "posFunding": { + "type": "number", + "description": "The current remaining unsettled funding fee for the position **Only applicable to Isolated Margin**\n" }, - "matchSize": { - "type": "string", - "description": "Match Size (when the type is \"match\")" + "posMaint": { + "type": "number", + "description": "Maintenance margin **Only applicable to Isolated Margin**\n" }, - "tradeId": { - "type": "string", - "description": "Trade id, it is generated by Matching engine." + "maintMargin": { + "type": "number", + "description": "Position margin **Only applicable to Isolated Margin**\n" }, - "oldSize": { - "type": "string", - "description": "The size before order update" + "fundingTime": { + "type": "integer", + "format": "int64", + "description": "Funding time" }, - "clientOid": { - "type": "string", - "description": "Client Order Id,The ClientOid field is a unique ID created by the user" + "qty": { + "type": "integer", + "description": "Position size" }, - "tradeType": { + "fundingRate": { + "type": "number", + "description": "Funding rate" + }, + "fundingFee": { + "type": "number", + "description": "Funding fees" + }, + "ts": { + "type": "integer", + "format": "int64", + "description": "Funding Fee Settlement Time (nanosecond)" + }, + "success": { + "type": "boolean", + "description": "Adjustment isolated margin risk limit level successful or not" + }, + "msg": { "type": "string", - "description": "normal order or liquid order", - "enum": [ - "trade", - "liquid" - ], - "x-api-enum": [ - { - "value": "trade", - "name": "trade", - "description": "Normal trade order" - }, - { - "value": "liquid", - "name": "liquid", - "description": "Liquid order, except type=update, all other types will be pushed" - } - ] + "description": "Adjustment isolated margin risk limit level failure reason" } }, "required": [ "symbol", - "side", - "canceledSize", - "orderId", + "crossMode", + "delevPercentage", + "openingTimestamp", + "currentTimestamp", + "currentQty", + "currentCost", + "currentComm", + "unrealisedCost", + "realisedGrossCost", + "realisedCost", + "isOpen", + "markPrice", + "markValue", + "posCost", + "posInit", + "posMargin", + "realisedGrossPnl", + "realisedPnl", + "unrealisedPnl", + "unrealisedPnlPcnt", + "unrealisedRoePcnt", + "avgEntryPrice", + "liquidationPrice", + "bankruptPrice", + "settleCurrency", "marginMode", - "type", - "orderTime", - "size", - "filledSize", - "price", - "remainSize", - "status", - "ts", - "tradeType" + "positionSide", + "leverage" ] + }, + "type": { + "type": "string" + }, + "channelType": { + "type": "string" } }, "required": [ + "userId", "topic", - "type", "subject", - "userId", - "channelType", - "data" + "data", + "type", + "channelType" ], - "x-example": "{\"topic\":\"/contractMarket/tradeOrders:XBTUSDTM\",\"type\":\"message\",\"subject\":\"symbolOrderChange\",\"userId\":\"633559791e1cbc0001f319bc\",\"channelType\":\"private\",\"data\":{\"symbol\":\"XBTUSDTM\",\"side\":\"buy\",\"canceledSize\":\"0\",\"orderId\":\"247899236673269761\",\"liquidity\":\"maker\",\"marginMode\":\"ISOLATED\",\"type\":\"open\",\"orderTime\":1731916985768138917,\"size\":\"1\",\"filledSize\":\"0\",\"price\":\"91670\",\"remainSize\":\"1\",\"status\":\"open\",\"ts\":1731916985789000000}}" + "x-example": "{\"topic\":\"/contract/position:XBTUSDTM\",\"type\":\"message\",\"data\":{\"symbol\":\"XBTUSDTM\",\"maintMarginReq\":0.005,\"riskLimit\":500000,\"realLeverage\":4.9685590767,\"crossMode\":false,\"delevPercentage\":0.10,\"openingTimestamp\":1731916913097,\"autoDeposit\":true,\"currentTimestamp\":1731924561514,\"currentQty\":1,\"currentCost\":91.5306,\"currentComm\":0.09179284,\"unrealisedCost\":91.6945,\"realisedCost\":-0.07210716,\"isOpen\":true,\"markPrice\":91839.79,\"markValue\":91.83979,\"posCost\":91.6945,\"posCross\":0,\"posInit\":18.3389,\"posComm\":0.06602004,\"posLoss\":0,\"posMargin\":18.40492004,\"posFunding\":0,\"posMaint\":0.5634627025,\"maintMargin\":18.55021004,\"avgEntryPrice\":91694.5,\"liquidationPrice\":73853.0426625,\"bankruptPrice\":73355.6,\"settleCurrency\":\"USDT\",\"changeReason\":\"positionChange\",\"riskLimitLevel\":2,\"realisedGrossCost\":-0.1639,\"realisedGrossPnl\":0.1639,\"realisedPnl\":0.07210716,\"unrealisedPnl\":0.14529,\"unrealisedPnlPcnt\":0.0016,\"unrealisedRoePcnt\":0.0079,\"leverage\":4.9685590767,\"marginMode\":\"ISOLATED\",\"positionSide\":\"BOTH\"},\"subject\":\"position.change\",\"userId\":\"633559791e1cbc0001f319bc\",\"channelType\":\"private\"}" } }, "visibility": "INHERITED" @@ -51562,17 +51267,621 @@ } }, "visibility": "INHERITED" + }, + { + "name": "marginMode", + "displayName": "", + "id": "#/definitions/87", + "description": "method: marginMode\ntopic:/contract/marginMode\nsummary: the margin mode change\ndescription:Subscribe this topic to get the realtime push of margin mode change event of a symbol\npush_frequency: realtime", + "schema": { + "jsonSchema": { + "type": "object", + "properties": { + "topic": { + "type": "string" + }, + "type": { + "type": "string" + }, + "data": { + "type": "object", + "properties": { + "SYMBOL": { + "type": "string", + "description": "The SYMBOL is the key with value \n\"CROSS\" or \"ISOLATED\"" + } + }, + "required": [ + "SYMBOL" + ] + }, + "subject": { + "type": "string" + }, + "userId": { + "type": "string" + }, + "channelType": { + "type": "string" + } + }, + "required": [ + "topic", + "type", + "data", + "subject", + "userId", + "channelType" + ], + "x-example": "{\"topic\":\"/contract/marginMode\",\"type\":\"message\",\"data\":{\"ETHUSDTM\":\"ISOLATED\"},\"subject\":\"user.config\",\"userId\":\"66f12e8befb04d0001882b49\",\"channelType\":\"private\"}" + } + }, + "visibility": "INHERITED" + }, + { + "name": "crossLeverage", + "displayName": "", + "id": "#/definitions/88", + "description": "method: crossLeverage\ntopic:/contract/crossLeverage\nsummary: the leverage change push\ndescription:Subscribe this topic to get the realtime push of leverage change of contracts that are in cross margin mode\npush_frequency: realtime", + "schema": { + "jsonSchema": { + "type": "object", + "properties": { + "topic": { + "type": "string" + }, + "type": { + "type": "string" + }, + "subject": { + "type": "string" + }, + "userId": { + "type": "string" + }, + "channelType": { + "type": "string" + }, + "data": { + "type": "object", + "properties": {}, + "additionalProperties": { + "type": "object", + "properties": { + "leverage": { + "type": "string" + } + }, + "required": [ + "leverage" + ] + } + } + }, + "required": [ + "topic", + "type", + "subject", + "userId", + "channelType", + "data" + ], + "x-example": "{\"topic\":\"/contract/crossLeverage\",\"type\":\"message\",\"data\":{\"ETHUSDTM\":{\"leverage\":\"8\"}},\"subject\":\"user.config\",\"userId\":\"66f12e8befb04d0001882b49\",\"channelType\":\"private\"}" + } + }, + "visibility": "INHERITED" + }, + { + "name": "stopOrders", + "displayName": "", + "id": "#/definitions/84", + "description": "method: stopOrders\ntopic:/contractMarket/advancedOrders\nsummary: stop order change pushes.\ndescription:Subscribe this topic to get the realtime push of stop order changes.\npush_frequency: realtime", + "schema": { + "jsonSchema": { + "type": "object", + "properties": { + "topic": { + "type": "string" + }, + "type": { + "type": "string" + }, + "data": { + "type": "object", + "properties": { + "createdAt": { + "type": "integer", + "format": "int64" + }, + "marginMode": { + "type": "string", + "enum": [ + "ISOLATED", + "CROSS" + ], + "description": "Margin Mode", + "x-api-enum": [ + { + "value": "ISOLATED", + "name": "ISOLATED", + "description": "Isolated Margin" + }, + { + "value": "CROSS", + "name": "CROSS", + "description": "Cross Margin" + } + ] + }, + "orderId": { + "type": "string", + "description": "The unique order id generated by the trading system" + }, + "orderPrice": { + "type": "string", + "description": "Order price" + }, + "orderType": { + "type": "string", + "description": "User-specified order type", + "enum": [ + "stop" + ], + "x-api-enum": [ + { + "value": "stop", + "name": "stop", + "description": "Stop order" + } + ] + }, + "side": { + "type": "string", + "enum": [ + "buy", + "sell" + ], + "description": "buy or sell", + "x-api-enum": [ + { + "value": "buy", + "name": "buy", + "description": "buy" + }, + { + "value": "sell", + "name": "sell", + "description": "sell" + } + ] + }, + "size": { + "type": "integer", + "description": "User-specified order size" + }, + "stop": { + "type": "string", + "description": "Either 'down' or 'up'", + "enum": [ + "down", + "up" + ], + "x-api-enum": [ + { + "value": "down", + "name": "down", + "description": "Triggers when the price reaches or goes below the stopPrice" + }, + { + "value": "up", + "name": "up", + "description": "Triggers when the price reaches or goes above the stopPrice" + } + ] + }, + "stopPrice": { + "type": "string", + "description": "Stop Price" + }, + "stopPriceType": { + "type": "string" + }, + "symbol": { + "type": "string", + "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](apidog://link/endpoint/221752070) " + }, + "ts": { + "type": "integer", + "format": "int64" + }, + "type": { + "type": "string", + "description": "Order Type", + "enum": [ + "open", + "triggered", + "cancel" + ], + "x-api-enum": [ + { + "value": "open", + "name": "open", + "description": "the order is in the order book(maker order)" + }, + { + "value": "triggered", + "name": "triggered", + "description": "when the stop order has been triggered" + }, + { + "value": "cancel", + "name": "cancel", + "description": "when the order has been canceled" + } + ] + } + }, + "required": [ + "createdAt", + "marginMode", + "orderId", + "orderPrice", + "orderType", + "side", + "size", + "stop", + "stopPrice", + "stopPriceType", + "symbol", + "ts", + "type" + ] + }, + "subject": { + "type": "string" + }, + "id": { + "type": "string" + }, + "userId": { + "type": "string" + }, + "channelType": { + "type": "string" + } + }, + "required": [ + "topic", + "type", + "data", + "subject", + "id", + "userId", + "channelType" + ], + "x-example": "{\"topic\":\"/contractMarket/advancedOrders\",\"type\":\"message\",\"data\":{\"createdAt\":1730194206837,\"marginMode\":\"ISOLATED\",\"orderId\":\"240673378116083712\",\"orderPrice\":\"0.1\",\"orderType\":\"stop\",\"side\":\"buy\",\"size\":1,\"stop\":\"down\",\"stopPrice\":\"1000\",\"stopPriceType\":\"TP\",\"symbol\":\"XBTUSDTM\",\"ts\":1730194206843133000,\"type\":\"open\"},\"subject\":\"stopOrder\",\"id\":\"6720ab1ea52a9b0001734392\",\"userId\":\"66f12e8befb04d0001882b49\",\"channelType\":\"private\"}" + } + }, + "visibility": "INHERITED" } ] } ] } ] + }, + { + "id": 78, + "name": "wsv2", + "visibility": "INHERITED", + "items": [ + { + "name": "addOrderRequest", + "displayName": "", + "id": "#/definitions/349260", + "description": "method: addOrder\ntopic:NULL\nsummary:Add Order\ndescription: This endpoint allow users to add order through Websocket", + "schema": { + "jsonSchema": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "User-defined generation, used to uniquely represent a request, the server will also return this id when returning" + }, + "op": { + "type": "string", + "description": "Operation type", + "enum": [ + "spot.order", + "futures.order", + "margin.order" + ], + "x-api-enum": [ + { + "value": "spot.order", + "name": "spot.order", + "description": "Add Spot order" + }, + { + "value": "futures.order", + "name": "futures.order", + "description": "Add Futures order" + }, + { + "value": "margin.order", + "name": "margin.order", + "description": "Add Margin order" + } + ] + }, + "args": { + "type": "object", + "properties": { + "price": { + "type": "string" + }, + "quantity": { + "type": "number" + }, + "side": { + "type": "string" + }, + "symbol": { + "type": "string" + }, + "timeInForce": { + "type": "string" + }, + "timestamp": { + "type": "integer" + }, + "type": { + "type": "string" + } + }, + "required": [ + "price", + "quantity", + "side", + "symbol", + "timeInForce", + "timestamp", + "type" + ], + "description": "Business parameters, same as RestAPI" + } + }, + "required": [ + "id", + "op", + "args" + ] + } + }, + "visibility": "INHERITED" + }, + { + "name": "addOrderResponse", + "displayName": "", + "id": "#/definitions/349261", + "description": "method: addOrder\ntopic:NULL\nsummary:Add Order\ndescription: This endpoint allow users to add order through Websocket", + "schema": { + "jsonSchema": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "op": { + "type": "string", + "description": "Operation type", + "enum": [ + "spot.order", + "futures.order", + "margin.order" + ], + "x-api-enum": [ + { + "value": "spot.order", + "name": "spot.order", + "description": "Add Spot order" + }, + { + "value": "futures.order", + "name": "futures.order", + "description": "Add Futures order" + }, + { + "value": "margin.order", + "name": "margin.order", + "description": "Add Margin order" + } + ] + }, + "data": { + "type": "array", + "items": { + "type": "object", + "properties": { + "orderId": { + "type": "string", + "description": "Order id" + } + }, + "required": [ + "orderId" + ] + } + }, + "inTime": { + "description": "In time by the websocket gateway (ms)", + "type": "string" + }, + "outTime": { + "description": "Out time by the websocket gateway (ms)", + "type": "string" + } + }, + "required": [ + "id", + "op", + "data", + "inTime", + "outTime" + ] + } + }, + "visibility": "INHERITED" + }, + { + "name": "cancelOrderRequest", + "displayName": "", + "id": "#/definitions/349262", + "description": "method: cancelOrder\ntopic:NULL\nsummary:Cancel Order\ndescription: This endpoint allow users to cancelorder through Websocket", + "schema": { + "jsonSchema": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "User-defined generation, used to uniquely represent a request, the server will also return this id when returning" + }, + "op": { + "type": "string", + "description": "Operation type", + "enum": [ + "spot.cancel", + "futures.cancel", + "margin.cancel" + ], + "x-api-enum": [ + { + "value": "spot.cancel", + "name": "spot.cancel", + "description": "Cancel Spot order" + }, + { + "value": "futures.cancel", + "name": "futures.cancel", + "description": "Cancel Futures order" + }, + { + "value": "margin.cancel", + "name": "margin.cancel", + "description": "Cancel Margin order" + } + ] + }, + "args": { + "type": "object", + "properties": { + "symbol": { + "type": "string" + }, + "orderId": { + "type": "string", + "description": "**Choose one of orderId, clientOid. If orderid and clientoid exist at the same time, only clientoid will take effect** The unique order id generated by the trading system,which can be used later for further actions such as canceling the order." + }, + "clientOid": { + "type": "string", + "description": "**Choose one of orderId, clientOid. If orderid and clientoid exist at the same time, only clientoid will take effect** The user self-defined order id." + } + }, + "required": [ + "symbol" + ], + "description": "Business parameters, same as RestAPI" + } + }, + "required": [ + "id", + "op", + "args" + ] + } + }, + "visibility": "INHERITED" + }, + { + "name": "cancelOrderResponse", + "displayName": "", + "id": "#/definitions/349263", + "description": "method: cancelOrder\ntopic:NULL\nsummary:Cancel Order\ndescription: This endpoint allow users to cancelorder through Websocket", + "schema": { + "jsonSchema": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "op": { + "type": "string", + "description": "Operation type", + "enum": [ + "spot.cancel", + "futures.cancel", + "margin.cancel" + ], + "x-api-enum": [ + { + "value": "spot.cancel", + "name": "spot.cancel", + "description": "Cancel Spot order" + }, + { + "value": "futures.cancel", + "name": "futures.cancel", + "description": "Cancel Futures order" + }, + { + "value": "margin.cancel", + "name": "margin.cancel", + "description": "Cancel Margin order" + } + ] + }, + "data": { + "type": "array", + "items": { + "type": "object", + "properties": { + "canceledOrderId": { + "type": "string", + "description": "Order id" + } + }, + "required": [ + "canceledOrderId" + ] + } + }, + "inTime": { + "description": "In time by the websocket gateway (ms)", + "type": "string" + }, + "outTime": { + "description": "Out time by the websocket gateway (ms)", + "type": "string" + } + }, + "required": [ + "id", + "op", + "data", + "inTime", + "outTime" + ] + } + }, + "visibility": "INHERITED" + } + ] } ] } ], "doc_id": [ + 338207, 338144, 338145, 338146, @@ -51597,6 +51906,8 @@ 338165, 338166, 338167, - 338168 + 338168, + 338211, + 338210 ] } \ No newline at end of file diff --git a/spec/rest/api/openapi-account-account.json b/spec/rest/api/openapi-account-account.json index 7f5ab322..3f31680c 100644 --- a/spec/rest/api/openapi-account-account.json +++ b/spec/rest/api/openapi-account-account.json @@ -116,6 +116,99 @@ "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"level\\\": 0,\\n \\\"subQuantity\\\": 3,\\n \\\"spotSubQuantity\\\": 3,\\n \\\"marginSubQuantity\\\": 2,\\n \\\"futuresSubQuantity\\\": 2,\\n \\\"optionSubQuantity\\\": 0,\\n \\\"maxSubQuantity\\\": 5,\\n \\\"maxDefaultSubQuantity\\\": 5,\\n \\\"maxSpotSubQuantity\\\": 0,\\n \\\"maxMarginSubQuantity\\\": 0,\\n \\\"maxFuturesSubQuantity\\\": 0,\\n \\\"maxOptionSubQuantity\\\": 0\\n }\\n}" } }, + "/api/v1/user/api-key": { + "get": { + "summary": "Get Apikey Info", + "deprecated": false, + "description": "Get the information of the api key. Use the api key pending to be checked to call the endpoint. Both master and sub user's api key are applicable.", + "tags": [], + "parameters": [], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "object", + "properties": { + "remark": { + "type": "string", + "description": "Remarks" + }, + "apiKey": { + "type": "string", + "description": "Apikey" + }, + "apiVersion": { + "type": "integer", + "description": "API Version" + }, + "permission": { + "type": "string", + "description": "[Permissions](https://www.kucoin.com/docs-new/doc-338144), possible values: General, Spot, Margin, Futures, InnerTransfer, Transfer, Earn" + }, + "ipWhitelist": { + "type": "string", + "description": "IP whitelist\n\n" + }, + "createdAt": { + "type": "integer", + "description": "Apikey create time", + "format": "int64" + }, + "uid": { + "type": "integer", + "description": "Account UID" + }, + "isMaster": { + "type": "boolean", + "description": "Whether it is the master account." + }, + "subName": { + "type": "string", + "description": "Sub Name, There is no such param for the master account" + } + }, + "required": [ + "remark", + "apiKey", + "apiVersion", + "permission", + "createdAt", + "uid", + "isMaster" + ] + } + }, + "required": [ + "code", + "data" + ] + } + } + } + } + }, + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470130", + "x-abandon": "normal", + "x-domain": "Spot", + "x-api-channel": "Private", + "x-api-permission": "General", + "x-api-rate-limit-pool": "Management", + "x-sdk-service": "Account", + "x-sdk-sub-service": "Account", + "x-sdk-method-name": "getApikeyInfo", + "x-sdk-method-description": "Get the information of the api key. Use the api key pending to be checked to call the endpoint. Both master and sub user's api key are applicable.", + "x-api-rate-limit": 20, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"remark\\\": \\\"account1\\\",\\n \\\"apiKey\\\": \\\"6705f5c311545b000157d3eb\\\",\\n \\\"apiVersion\\\": 3,\\n \\\"permission\\\": \\\"General,Futures,Spot,Earn,InnerTransfer,Transfer,Margin\\\",\\n \\\"ipWhitelist\\\": \\\"203.**.154,103.**.34\\\",\\n \\\"createdAt\\\": 1728443843000,\\n \\\"uid\\\": 165111215,\\n \\\"isMaster\\\": true\\n }\\n}" + } + }, "/api/v1/hf/accounts/opened": { "get": { "summary": "Get Account Type - Spot ", @@ -162,97 +255,46 @@ "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":false}" } }, - "/api/v1/accounts/ledgers": { + "/api/v1/accounts": { "get": { - "summary": "Get Account Ledgers - Spot/Margin", + "summary": "Get Account List - Spot", "deprecated": false, - "description": "This interface is for transaction records from all types of your accounts, supporting inquiry of various currencies. Items are paginated and sorted to show the latest first. See the Pagination section for retrieving additional entries after the first page.", + "description": "Get a list of accounts. Please Deposit to the main account firstly, then transfer the funds to the trade account via Inner Transfer before transaction.", "tags": [], "parameters": [ { "name": "currency", "in": "query", - "description": "Currency ( you can choose more than one currency). You can specify 10 currencies at most for one time. If not specified, all currencies will be inquired by default.", + "description": "currency", "required": false, "schema": { "type": "string" } }, { - "name": "direction", + "name": "type", "in": "query", - "description": "direction: in, out", + "description": "Account type main、trade", "required": false, "schema": { "type": "string", "enum": [ - "in", - "out" + "main", + "trade" ], "x-api-enum": [ { - "value": "in", - "name": "", - "description": "" + "value": "main", + "name": "main", + "description": "Funding account" }, { - "value": "out", - "name": "", - "description": "" + "value": "trade", + "name": "trade", + "description": "Spot account" } ] } - }, - { - "name": "bizType", - "in": "query", - "description": "Type: DEPOSIT -deposit, WITHDRAW -withdraw, TRANSFER -transfer, SUB_TRANSFER -subaccount transfer,TRADE_EXCHANGE -trade, MARGIN_EXCHANGE -margin trade, KUCOIN_BONUS -bonus, BROKER_TRANSFER -Broker transfer record", - "required": false, - "schema": { - "type": "string" - } - }, - { - "name": "startAt", - "in": "query", - "description": "Start time (milisecond)", - "required": false, - "schema": { - "type": "integer", - "format": "int64" - } - }, - { - "name": "endAt", - "in": "query", - "description": "End time (milisecond)", - "required": false, - "schema": { - "type": "integer", - "format": "int64" - } - }, - { - "name": "currentPage", - "in": "query", - "description": "Current request page.", - "required": false, - "schema": { - "type": "integer", - "default": 1 - } - }, - { - "name": "pageSize", - "in": "query", - "description": "Number of results per request. Minimum is 10, maximum is 500.", - "required": false, - "schema": { - "type": "integer", - "default": 50, - "minimum": 10, - "maximum": 500 - } } ], "responses": { @@ -267,81 +309,60 @@ "type": "string" }, "data": { - "type": "object", - "properties": { - "currentPage": { - "type": "integer", - "description": "current page" - }, - "pageSize": { - "type": "integer", - "description": "page size" - }, - "totalNum": { - "type": "integer", - "description": "total number" - }, - "totalPage": { - "type": "integer", - "description": "total page" - }, - "items": { - "type": "array", - "items": { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "unique id" - }, - "currency": { - "type": "string", - "description": "The currency of an account" - }, - "amount": { - "type": "string", - "description": "The total amount of assets (fees included) involved in assets changes such as transaction, withdrawal and bonus distribution." - }, - "fee": { - "type": "string", - "description": "Fees generated in transaction, withdrawal, etc." - }, - "balance": { - "type": "string", - "description": "Remaining funds after the transaction." - }, - "accountType": { - "type": "string", - "description": "The account type of the master user: MAIN, TRADE, MARGIN or CONTRACT." - }, - "bizType": { - "type": "string", - "description": "Business type leading to the changes in funds, such as exchange, withdrawal, deposit, KUCOIN_BONUS, REFERRAL_BONUS, Lendings etc." - }, - "direction": { - "type": "string", - "description": "Side, out or in" - }, - "createdAt": { - "type": "integer", - "description": "Time of the event", - "format": "int64" + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Account ID" + }, + "currency": { + "type": "string", + "description": "Currency" + }, + "type": { + "type": "string", + "description": "Account type:,main、trade、isolated(abandon)、margin(abandon)\n", + "enum": [ + "main", + "trade" + ], + "x-api-enum": [ + { + "value": "main", + "name": "main", + "description": "Funding account" }, - "context": { - "type": "string", - "description": "Business related information such as order ID, serial No., etc." + { + "value": "trade", + "name": "trade", + "description": "Spot account" } - } + ] + }, + "balance": { + "type": "string", + "description": "Total funds in the account" + }, + "available": { + "type": "string", + "description": "Funds available to withdraw or trade" + }, + "holds": { + "type": "string", + "description": "Funds on hold (not available for use)" } - } - }, - "required": [ - "currentPage", - "pageSize", - "totalNum", - "totalPage", - "items" - ] + }, + "required": [ + "id", + "currency", + "type", + "balance", + "available", + "holds" + ] + } } }, "required": [ @@ -353,7 +374,7 @@ } } }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470121", + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470125", "x-abandon": "normal", "x-domain": "Spot", "x-api-channel": "Private", @@ -361,48 +382,126 @@ "x-api-rate-limit-pool": "Management", "x-sdk-service": "Account", "x-sdk-sub-service": "Account", - "x-sdk-method-name": "getSpotLedger", - "x-sdk-method-description": "This interface is for transaction records from all types of your accounts, supporting inquiry of various currencies. Items are paginated and sorted to show the latest first. See the Pagination section for retrieving additional entries after the first page.", - "x-api-rate-limit": 2, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"currentPage\\\": 1,\\n \\\"pageSize\\\": 50,\\n \\\"totalNum\\\": 1,\\n \\\"totalPage\\\": 1,\\n \\\"items\\\": [\\n {\\n \\\"id\\\": \\\"265329987780896\\\",\\n \\\"currency\\\": \\\"USDT\\\",\\n \\\"amount\\\": \\\"0.01\\\",\\n \\\"fee\\\": \\\"0\\\",\\n \\\"balance\\\": \\\"0\\\",\\n \\\"accountType\\\": \\\"TRADE\\\",\\n \\\"bizType\\\": \\\"SUB_TRANSFER\\\",\\n \\\"direction\\\": \\\"out\\\",\\n \\\"createdAt\\\": 1728658481484,\\n \\\"context\\\": \\\"\\\"\\n }\\n ]\\n }\\n}", - "x-request-example": "{\\\"currency\\\": \\\"BTC\\\", \\\"direction\\\": \\\"in\\\", \\\"bizType\\\": \\\"TRANSFER\\\", \\\"startAt\\\": 1728663338000, \\\"endAt\\\": 1728692138000, \\\"currentPage\\\": 1, \\\"pageSize\\\": 50}" + "x-sdk-method-name": "getSpotAccountList", + "x-sdk-method-description": "Get a list of accounts. Please Deposit to the main account firstly, then transfer the funds to the trade account via Inner Transfer before transaction.", + "x-api-rate-limit": 5, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": [\\n {\\n \\\"id\\\": \\\"548674591753\\\",\\n \\\"currency\\\": \\\"USDT\\\",\\n \\\"type\\\": \\\"trade\\\",\\n \\\"balance\\\": \\\"26.66759503\\\",\\n \\\"available\\\": \\\"26.66759503\\\",\\n \\\"holds\\\": \\\"0\\\"\\n },\\n {\\n \\\"id\\\": \\\"63355cd156298d0001b66e61\\\",\\n \\\"currency\\\": \\\"USDT\\\",\\n \\\"type\\\": \\\"main\\\",\\n \\\"balance\\\": \\\"0.01\\\",\\n \\\"available\\\": \\\"0.01\\\",\\n \\\"holds\\\": \\\"0\\\"\\n }\\n ]\\n}", + "x-request-example": "{\\\"currency\\\": \\\"USDT\\\", \\\"type\\\": \\\"main\\\"}" } }, - "/api/v1/hf/accounts/ledgers": { + "/api/v1/accounts/{accountId}": { "get": { - "summary": "Get Account Ledgers - Trade_hf", + "summary": "Get Account Detail - Spot", "deprecated": false, - "description": "This API endpoint returns all transfer (in and out) records in high-frequency trading account and supports multi-coin queries. The query results are sorted in descending order by createdAt and id.", + "description": "get Information for a single spot account. Use this endpoint when you know the accountId.", "tags": [], "parameters": [ { - "name": "currency", - "in": "query", - "description": "Currency ( you can choose more than one currency). You can specify 10 currencies at most for one time. If not specified, all currencies will be inquired by default.", - "required": false, + "name": "accountId", + "in": "path", + "description": "Path parameter. Account ID", + "required": true, "schema": { "type": "string" } - }, + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "object", + "properties": { + "currency": { + "type": "string", + "description": "The currency of the account" + }, + "balance": { + "type": "string", + "description": "Total funds in the account" + }, + "available": { + "type": "string", + "description": "Funds available to withdraw or trade" + }, + "holds": { + "type": "string", + "description": "Funds on hold (not available for use)" + } + }, + "required": [ + "currency", + "balance", + "available", + "holds" + ] + } + }, + "required": [ + "code", + "data" + ] + } + } + } + } + }, + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470126", + "x-abandon": "normal", + "x-domain": "Spot", + "x-api-channel": "Private", + "x-api-permission": "General", + "x-api-rate-limit-pool": "Management", + "x-sdk-service": "Account", + "x-sdk-sub-service": "Account", + "x-sdk-method-name": "getSpotAccountDetail", + "x-sdk-method-description": "get Information for a single spot account. Use this endpoint when you know the accountId.", + "x-api-rate-limit": 5, + "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"currency\\\":\\\"USDT\\\",\\\"balance\\\":\\\"26.66759503\\\",\\\"available\\\":\\\"26.66759503\\\",\\\"holds\\\":\\\"0\\\"}}", + "x-request-example": "{\\\"accountId\\\": \\\"548674591753\\\"}" + } + }, + "/api/v3/margin/accounts": { + "get": { + "summary": "Get Account - Cross Margin", + "deprecated": false, + "description": "Request via this endpoint to get the info of the cross margin account.", + "tags": [], + "parameters": [ { - "name": "direction", + "name": "quoteCurrency", "in": "query", - "description": "direction: in, out", + "description": "quote currency, currently only supports USDT, KCS, BTC, USDT as default", "required": false, "schema": { "type": "string", + "default": "USDT", "enum": [ - "in", - "out" + "USDT", + "KCS", + "BTC" ], "x-api-enum": [ { - "value": "in", + "value": "USDT", "name": "", "description": "" }, { - "value": "out", + "value": "KCS", + "name": "", + "description": "" + }, + { + "value": "BTC", "name": "", "description": "" } @@ -410,71 +509,36 @@ } }, { - "name": "bizType", + "name": "queryType", "in": "query", - "description": "Transaction type: TRANSFER-transfer funds,TRADE_EXCHANGE-Trade", + "description": "Query account type (default MARGIN), MARGIN - only query low frequency cross margin account, MARGIN_V2-only query high frequency cross margin account, ALL - consistent aggregate query with the web side", "required": false, "schema": { "type": "string", + "default": "MARGIN", "enum": [ - "TRADE_EXCHANGE", - "TRANSFER" + "MARGIN", + "MARGIN_V2", + "ALL" ], "x-api-enum": [ { - "value": "TRADE_EXCHANGE", + "value": "MARGIN", "name": "", "description": "" }, { - "value": "TRANSFER", + "value": "MARGIN_V2", + "name": "", + "description": "" + }, + { + "value": "ALL", "name": "", "description": "" } ] } - }, - { - "name": "lastId", - "in": "query", - "description": "The id of the last set of data from the previous batch of data. By default, the latest information is given.", - "required": false, - "schema": { - "type": "integer", - "format": "int64" - } - }, - { - "name": "limit", - "in": "query", - "description": "Default100,Max200", - "required": false, - "schema": { - "type": "integer", - "default": 100, - "maximum": 200, - "minimum": 1 - } - }, - { - "name": "startAt", - "in": "query", - "description": "Start time (milisecond)", - "required": false, - "schema": { - "type": "integer", - "format": "int64" - } - }, - { - "name": "endAt", - "in": "query", - "description": "End time (milisecond)", - "required": false, - "schema": { - "type": "integer", - "format": "int64" - } } ], "responses": { @@ -489,84 +553,117 @@ "type": "string" }, "data": { - "type": "array", - "items": { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "Unique id" - }, - "currency": { - "type": "string", - "description": "currency" - }, - "amount": { - "type": "string", - "description": "Change in funds balance" - }, - "fee": { - "type": "string", - "description": "Deposit or withdrawal fee" - }, - "tax": { - "type": "string" - }, - "balance": { - "type": "string", - "description": "Total balance of funds after change" - }, - "accountType": { - "type": "string", - "description": "Master account type TRADE_HF" - }, - "bizType": { - "type": "string", - "description": "Trnasaction type,such as TRANSFER, TRADE_EXCHANGE, etc." - }, - "direction": { - "type": "string", - "description": "Direction of transfer( out or in)", - "enum": [ - "in", - "out" - ], - "x-api-enum": [ - { - "value": "in", - "name": "", - "description": "" + "type": "object", + "properties": { + "totalAssetOfQuoteCurrency": { + "type": "string", + "description": "Total Assets in Quote Currency" + }, + "totalLiabilityOfQuoteCurrency": { + "type": "string", + "description": "Total Liability in Quote Currency" + }, + "debtRatio": { + "type": "string", + "description": "debt ratio" + }, + "status": { + "type": "string", + "description": "Position status; EFFECTIVE-effective, BANKRUPTCY-bankruptcy liquidation, LIQUIDATION-closing, REPAY-repayment, BORROW borrowing", + "enum": [ + "EFFECTIVE", + "BANKRUPTCY", + "LIQUIDATION", + "REPAY", + "BORROW" + ], + "x-api-enum": [ + { + "value": "EFFECTIVE", + "name": "EFFECTIVE", + "description": "Effective" + }, + { + "value": "BANKRUPTCY", + "name": "BANKRUPTCY", + "description": "Bankruptcy liquidation" + }, + { + "value": "LIQUIDATION", + "name": "LIQUIDATION", + "description": "Closing" + }, + { + "value": "REPAY", + "name": "REPAY", + "description": "Repayment" + }, + { + "value": "BORROW", + "name": "BORROW", + "description": "Borrowing" + } + ] + }, + "accounts": { + "type": "array", + "items": { + "type": "object", + "properties": { + "currency": { + "type": "string", + "description": "currency" }, - { - "value": "out", - "name": "", - "description": "" + "total": { + "type": "string", + "description": "Total Assets" + }, + "available": { + "type": "string", + "description": "Account available assets (total assets - frozen)" + }, + "hold": { + "type": "string", + "description": "Account frozen assets" + }, + "liability": { + "type": "string", + "description": "Liabilities" + }, + "maxBorrowSize": { + "type": "string", + "description": "The user's remaining maximum loan amount" + }, + "borrowEnabled": { + "type": "boolean", + "description": "Support borrow or not" + }, + "transferInEnabled": { + "type": "boolean", + "description": "Support transfer or not" } + }, + "required": [ + "currency", + "total", + "available", + "hold", + "liability", + "maxBorrowSize", + "borrowEnabled", + "transferInEnabled" ] }, - "createdAt": { - "type": "string", - "description": "Created time" - }, - "context": { - "type": "string", - "description": "Core transaction parameter" - } - }, - "required": [ - "id", - "currency", - "amount", - "fee", - "tax", - "balance", - "accountType", - "bizType", - "direction", - "createdAt", - "context" - ] - } + "description": "Margin account list" + } + }, + "required": [ + "totalAssetOfQuoteCurrency", + "totalLiabilityOfQuoteCurrency", + "debtRatio", + "status", + "accounts" + ] } }, "required": [ @@ -578,7 +675,7 @@ } } }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470122", + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470127", "x-abandon": "normal", "x-domain": "Spot", "x-api-channel": "Private", @@ -586,48 +683,55 @@ "x-api-rate-limit-pool": "Spot", "x-sdk-service": "Account", "x-sdk-sub-service": "Account", - "x-sdk-method-name": "getSpotHFLedger", - "x-sdk-method-description": "This API endpoint returns all transfer (in and out) records in high-frequency trading account and supports multi-coin queries. The query results are sorted in descending order by createdAt and id.", - "x-api-rate-limit": 2, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": [\\n {\\n \\\"id\\\": \\\"254062248624417\\\",\\n \\\"currency\\\": \\\"USDT\\\",\\n \\\"amount\\\": \\\"1.59760080\\\",\\n \\\"fee\\\": \\\"0.00159920\\\",\\n \\\"tax\\\": \\\"0\\\",\\n \\\"balance\\\": \\\"26.73759503\\\",\\n \\\"accountType\\\": \\\"TRADE_HF\\\",\\n \\\"bizType\\\": \\\"TRADE_EXCHANGE\\\",\\n \\\"direction\\\": \\\"in\\\",\\n \\\"createdAt\\\": \\\"1728443957539\\\",\\n \\\"context\\\": \\\"{\\\\\\\"symbol\\\\\\\":\\\\\\\"KCS-USDT\\\\\\\",\\\\\\\"orderId\\\\\\\":\\\\\\\"6705f6350dc7210007d6a36d\\\\\\\",\\\\\\\"tradeId\\\\\\\":\\\\\\\"10046097631627265\\\\\\\"}\\\"\\n }\\n ]\\n}", - "x-request-example": "{\\\"currency\\\": \\\"BTC\\\", \\\"direction\\\": \\\"in\\\", \\\"bizType\\\": \\\"TRANSFER\\\", \\\"lastId\\\": 254062248624417, \\\"limit\\\": 100, \\\"startAt\\\": 1728663338000, \\\"endAt\\\": 1728692138000}" + "x-sdk-method-name": "getCrossMarginAccount", + "x-sdk-method-description": "Request via this endpoint to get the info of the cross margin account.", + "x-api-rate-limit": 15, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"totalAssetOfQuoteCurrency\\\": \\\"0.02\\\",\\n \\\"totalLiabilityOfQuoteCurrency\\\": \\\"0\\\",\\n \\\"debtRatio\\\": \\\"0\\\",\\n \\\"status\\\": \\\"EFFECTIVE\\\",\\n \\\"accounts\\\": [\\n {\\n \\\"currency\\\": \\\"USDT\\\",\\n \\\"total\\\": \\\"0.02\\\",\\n \\\"available\\\": \\\"0.02\\\",\\n \\\"hold\\\": \\\"0\\\",\\n \\\"liability\\\": \\\"0\\\",\\n \\\"maxBorrowSize\\\": \\\"0\\\",\\n \\\"borrowEnabled\\\": true,\\n \\\"transferInEnabled\\\": true\\n }\\n ]\\n }\\n}", + "x-request-example": "{\\\"quoteCurrency\\\": \\\"USDT\\\", \\\"queryType\\\": \\\"MARGIN\\\"}" } }, - "/api/v3/hf/margin/account/ledgers": { + "/api/v3/isolated/accounts": { "get": { - "summary": "Get Account Ledgers - Margin_hf", + "summary": "Get Account - Isolated Margin", "deprecated": false, - "description": "This API endpoint returns all transfer (in and out) records in high-frequency margin trading account and supports multi-coin queries. The query results are sorted in descending order by createdAt and id.", + "description": "Request via this endpoint to get the info of the isolated margin account.", "tags": [], "parameters": [ { - "name": "currency", + "name": "symbol", "in": "query", - "description": "currency, optional,can select more than one,separate with commas,select no more than 10 currencys,the default will be to query for all currencys if left empty", + "description": "For isolated trading pairs, query all without passing", "required": false, "schema": { "type": "string" } }, { - "name": "direction", + "name": "quoteCurrency", "in": "query", - "description": "direction: in, out", + "description": "quote currency, currently only supports USDT, KCS, BTC, USDT as default", "required": false, "schema": { "type": "string", + "default": "USDT", "enum": [ - "in", - "out" + "USDT", + "KCS", + "BTC" ], "x-api-enum": [ { - "value": "in", + "value": "USDT", "name": "", "description": "" }, { - "value": "out", + "value": "KCS", + "name": "", + "description": "" + }, + { + "value": "BTC", "name": "", "description": "" } @@ -635,219 +739,35 @@ } }, { - "name": "bizType", - "in": "query", - "description": "Transaction type: TRANSFER- transfer funds, MARGIN_EXCHANGE - cross margin trade, ISOLATED_EXCHANGE - isolated margin trade, LIQUIDATION - liquidation, ASSERT_RETURN - forced liquidation asset return", - "required": false, - "schema": { - "type": "string" - } - }, - { - "name": "lastId", - "in": "query", - "description": "The id of the last set of data from the previous batch of data. By default, the latest information is given.", - "required": false, - "schema": { - "type": "integer", - "format": "int64" - } - }, - { - "name": "limit", - "in": "query", - "description": "Default100,Max200", - "required": false, - "schema": { - "type": "integer", - "default": 100, - "maximum": 200, - "minimum": 1 - } - }, - { - "name": "startAt", - "in": "query", - "description": "Start time (milisecond)", - "required": false, - "schema": { - "type": "integer", - "format": "int64" - } - }, - { - "name": "endAt", + "name": "queryType", "in": "query", - "description": "End time (milisecond)", + "description": "Query account type (default ISOLATED), ISOLATED- - only query low frequency isolated margin account, ISOLATED_V2-only query high frequency isolated margin account, ALL - consistent aggregate query with the web side", "required": false, "schema": { - "type": "integer", - "format": "int64" - } - } - ], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "data": { - "type": "array", - "items": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int64" - }, - "currency": { - "type": "string", - "description": "currency" - }, - "amount": { - "type": "string", - "description": "Change in funds balance" - }, - "fee": { - "type": "string", - "description": "Deposit or withdrawal fee" - }, - "balance": { - "type": "string", - "description": "Total balance of funds after change" - }, - "accountType": { - "type": "string", - "description": "Master account type TRADE_HF" - }, - "bizType": { - "type": "string", - "description": "Trnasaction type,such as TRANSFER, TRADE_EXCHANGE, etc." - }, - "direction": { - "type": "string", - "description": "Direction of transfer( out or in)" - }, - "createdAt": { - "type": "integer", - "description": "Ledger creation time", - "format": "int64" - }, - "context": { - "type": "string", - "description": "Core transaction parameter" - }, - "tax": { - "type": "string" - } - } - } - } - }, - "required": [ - "code", - "data" - ] - } - } - } - } - }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470123", - "x-abandon": "normal", - "x-domain": "Spot", - "x-api-channel": "Private", - "x-api-permission": "General", - "x-api-rate-limit-pool": "Spot", - "x-sdk-service": "Account", - "x-sdk-sub-service": "Account", - "x-sdk-method-name": "getMarginHFLedger", - "x-sdk-method-description": "This API endpoint returns all transfer (in and out) records in high-frequency margin trading account and supports multi-coin queries. The query results are sorted in descending order by createdAt and id.", - "x-api-rate-limit": 2, - "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":[{\\\"id\\\":1949641706720,\\\"currency\\\":\\\"USDT\\\",\\\"amount\\\":\\\"0.01000000\\\",\\\"fee\\\":\\\"0.00000000\\\",\\\"balance\\\":\\\"0.01000000\\\",\\\"accountType\\\":\\\"MARGIN_V2\\\",\\\"bizType\\\":\\\"TRANSFER\\\",\\\"direction\\\":\\\"in\\\",\\\"createdAt\\\":1728664091208,\\\"context\\\":\\\"{}\\\",\\\"tax\\\":\\\"0.00000000\\\"}]}", - "x-request-example": "{\\\"currency\\\": \\\"BTC\\\", \\\"direction\\\": \\\"in\\\", \\\"bizType\\\": \\\"TRANSFER\\\", \\\"lastId\\\": 254062248624417, \\\"limit\\\": 100, \\\"startAt\\\": 1728663338000, \\\"endAt\\\": 1728692138000}" - } - }, - "/api/v1/transaction-history": { - "get": { - "summary": "Get Account Ledgers - Futures", - "deprecated": false, - "description": "This interface can query the ledger records of the futures business line", - "tags": [], - "parameters": [ - { - "name": "currency", - "in": "query", - "description": "Currency of transaction history, XBT or USDT", - "required": false, - "schema": { - "type": "string" - } - }, - { - "name": "type", - "in": "query", - "description": "Type RealisedPNL-Realised profit and loss, Deposit-Deposit, Withdrawal-withdraw, Transferin-Transfer in, TransferOut-Transfer out", - "required": false, - "schema": { - "type": "string" - } - }, - { - "name": "offset", - "in": "query", - "description": "Start offset. Generally, the only attribute of the last returned result of the previous request is used, and the first page is returned by default", - "required": false, - "schema": { - "type": "integer", - "format": "int64" - } - }, - { - "name": "forward", - "in": "query", - "description": "This parameter functions to judge whether the lookup is forward or not. True means “yes” and False means “no”. This parameter is set as true by default", - "required": false, - "schema": { - "type": "boolean", - "default": true - } - }, - { - "name": "maxCount", - "in": "query", - "description": "Displayed size per page. The default size is 50", - "required": false, - "schema": { - "type": "integer", - "default": 50, - "format": "int64" - } - }, - { - "name": "startAt", - "in": "query", - "description": "Start time (milisecond)", - "required": false, - "schema": { - "type": "integer", - "format": "int64" - } - }, - { - "name": "endAt", - "in": "query", - "description": "End time (milisecond)", - "required": false, - "schema": { - "type": "integer", - "format": "int64" + "type": "string", + "default": "ISOLATED", + "enum": [ + "ISOLATED", + "ISOLATED_V2", + "ALL" + ], + "x-api-enum": [ + { + "value": "ISOLATED", + "name": "", + "description": "" + }, + { + "value": "ISOLATED_V2", + "name": "", + "description": "" + }, + { + "value": "ALL", + "name": "", + "description": "" + } + ] } } ], @@ -865,70 +785,182 @@ "data": { "type": "object", "properties": { - "dataList": { + "totalAssetOfQuoteCurrency": { + "type": "string", + "description": "Total Assets in Quote Currency" + }, + "totalLiabilityOfQuoteCurrency": { + "type": "string", + "description": "Total Liability in Quote Currency" + }, + "timestamp": { + "type": "integer", + "description": "timestamp", + "format": "int64" + }, + "assets": { "type": "array", "items": { "type": "object", "properties": { - "time": { - "type": "integer", - "description": "ledger time", - "format": "int64" - }, - "type": { + "symbol": { "type": "string", - "description": "Type: RealisedPNL, Deposit, Withdrawal, TransferIn, TransferOut" - }, - "amount": { - "type": "number", - "description": "Transaction amount" - }, - "fee": { - "type": "number", - "description": "Fee" - }, - "accountEquity": { - "type": "number", - "description": "Account equity" + "description": "Symbol" }, "status": { "type": "string", - "description": "Status: Completed, Pending" + "description": "Position status; EFFECTIVE-effective, BANKRUPTCY-bankruptcy liquidation, LIQUIDATION-closing, REPAY-repayment, BORROW borrowing", + "enum": [ + "EFFECTIVE", + "BANKRUPTCY", + "LIQUIDATION", + "REPAY", + "BORROW" + ], + "x-api-enum": [ + { + "value": "EFFECTIVE", + "name": "EFFECTIVE", + "description": "Effective" + }, + { + "value": "BANKRUPTCY", + "name": "BANKRUPTCY", + "description": "Bankruptcy liquidation" + }, + { + "value": "LIQUIDATION", + "name": "LIQUIDATION", + "description": "Closing" + }, + { + "value": "REPAY", + "name": "REPAY", + "description": "Repayment" + }, + { + "value": "BORROW", + "name": "BORROW", + "description": "Borrowing" + } + ] }, - "remark": { + "debtRatio": { "type": "string", - "description": "Ticker symbol of the contract" + "description": "debt ratio" }, - "offset": { - "type": "integer", - "description": "Offset" + "baseAsset": { + "type": "object", + "properties": { + "currency": { + "type": "string", + "description": "currency" + }, + "borrowEnabled": { + "type": "boolean", + "description": "Support borrow or not" + }, + "transferInEnabled": { + "type": "boolean", + "description": "Support transfer or not" + }, + "liability": { + "type": "string", + "description": "Liabilities" + }, + "total": { + "type": "string", + "description": "Total Assets" + }, + "available": { + "type": "string", + "description": "Account available assets (total assets - frozen)" + }, + "hold": { + "type": "string", + "description": "Account frozen assets" + }, + "maxBorrowSize": { + "type": "string", + "description": "The user's remaining maximum loan amount" + } + }, + "required": [ + "currency", + "borrowEnabled", + "transferInEnabled", + "liability", + "total", + "available", + "hold", + "maxBorrowSize" + ], + "description": "base asset" }, - "currency": { - "type": "string", - "description": "Currency" + "quoteAsset": { + "type": "object", + "properties": { + "currency": { + "type": "string", + "description": "currency" + }, + "borrowEnabled": { + "type": "boolean", + "description": "Support borrow or not" + }, + "transferInEnabled": { + "type": "boolean", + "description": "Support transfer or not" + }, + "liability": { + "type": "string", + "description": "Liabilities" + }, + "total": { + "type": "string", + "description": "Total Assets" + }, + "available": { + "type": "string", + "description": "Account available assets (total assets - frozen)" + }, + "hold": { + "type": "string", + "description": "Account frozen assets" + }, + "maxBorrowSize": { + "type": "string", + "description": "The user's remaining maximum loan amount" + } + }, + "required": [ + "currency", + "borrowEnabled", + "transferInEnabled", + "liability", + "total", + "available", + "hold", + "maxBorrowSize" + ], + "description": "quote asset" } }, "required": [ - "time", - "type", - "amount", - "fee", - "accountEquity", + "symbol", "status", - "remark", - "offset", - "currency" + "debtRatio", + "baseAsset", + "quoteAsset" ] } - }, - "hasMore": { - "type": "boolean", - "description": "Is it the last page. If it is false, it means it is the last page, and if it is true, it means need to turn the page." } }, "required": [ - "dataList", - "hasMore" + "totalAssetOfQuoteCurrency", + "totalLiabilityOfQuoteCurrency", + "timestamp", + "assets" ] } }, @@ -941,172 +973,43 @@ } } }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470124", + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470128", "x-abandon": "normal", - "x-domain": "Futures", + "x-domain": "Spot", "x-api-channel": "Private", "x-api-permission": "General", - "x-api-rate-limit-pool": "Futures", + "x-api-rate-limit-pool": "Spot", "x-sdk-service": "Account", "x-sdk-sub-service": "Account", - "x-sdk-method-name": "getFuturesLedger", - "x-sdk-method-description": "This interface can query the ledger records of the futures business line", - "x-api-rate-limit": 2, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"dataList\\\": [\\n {\\n \\\"time\\\": 1728665747000,\\n \\\"type\\\": \\\"TransferIn\\\",\\n \\\"amount\\\": 0.01,\\n \\\"fee\\\": 0.0,\\n \\\"accountEquity\\\": 14.02924938,\\n \\\"status\\\": \\\"Completed\\\",\\n \\\"remark\\\": \\\"Transferred from High-Frequency Trading Account\\\",\\n \\\"offset\\\": 51360793,\\n \\\"currency\\\": \\\"USDT\\\"\\n },\\n {\\n \\\"time\\\": 1728648000000,\\n \\\"type\\\": \\\"RealisedPNL\\\",\\n \\\"amount\\\": 0.00630042,\\n \\\"fee\\\": 0.0,\\n \\\"accountEquity\\\": 20.0,\\n \\\"status\\\": \\\"Completed\\\",\\n \\\"remark\\\": \\\"XBTUSDTM\\\",\\n \\\"offset\\\": 51352430,\\n \\\"currency\\\": \\\"USDT\\\"\\n }\\n ],\\n \\\"hasMore\\\": false\\n }\\n}", - "x-request-example": "{\\\"currency\\\": \\\"XBT\\\", \\\"type\\\": \\\"Transferin\\\", \\\"offset\\\": 254062248624417, \\\"forward\\\": true, \\\"maxCount\\\": 50, \\\"startAt\\\": 1728663338000, \\\"endAt\\\": 1728692138000}" + "x-sdk-method-name": "getIsolatedMarginAccount", + "x-sdk-method-description": "Request via this endpoint to get the info of the isolated margin account.", + "x-api-rate-limit": 15, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"totalAssetOfQuoteCurrency\\\": \\\"0.01\\\",\\n \\\"totalLiabilityOfQuoteCurrency\\\": \\\"0\\\",\\n \\\"timestamp\\\": 1728725465994,\\n \\\"assets\\\": [\\n {\\n \\\"symbol\\\": \\\"BTC-USDT\\\",\\n \\\"status\\\": \\\"EFFECTIVE\\\",\\n \\\"debtRatio\\\": \\\"0\\\",\\n \\\"baseAsset\\\": {\\n \\\"currency\\\": \\\"BTC\\\",\\n \\\"borrowEnabled\\\": true,\\n \\\"transferInEnabled\\\": true,\\n \\\"liability\\\": \\\"0\\\",\\n \\\"total\\\": \\\"0\\\",\\n \\\"available\\\": \\\"0\\\",\\n \\\"hold\\\": \\\"0\\\",\\n \\\"maxBorrowSize\\\": \\\"0\\\"\\n },\\n \\\"quoteAsset\\\": {\\n \\\"currency\\\": \\\"USDT\\\",\\n \\\"borrowEnabled\\\": true,\\n \\\"transferInEnabled\\\": true,\\n \\\"liability\\\": \\\"0\\\",\\n \\\"total\\\": \\\"0.01\\\",\\n \\\"available\\\": \\\"0.01\\\",\\n \\\"hold\\\": \\\"0\\\",\\n \\\"maxBorrowSize\\\": \\\"0\\\"\\n }\\n }\\n ]\\n }\\n}", + "x-request-example": "{\\\"symbol\\\": \\\"example_string_default_value\\\", \\\"quoteCurrency\\\": \\\"USDT\\\", \\\"queryType\\\": \\\"ISOLATED\\\"}" } }, - "/api/v1/accounts": { + "/api/v1/account-overview": { "get": { - "summary": "Get Account List - Spot", + "summary": "Get Account - Futures", "deprecated": false, - "description": "Get a list of accounts. Please Deposit to the main account firstly, then transfer the funds to the trade account via Inner Transfer before transaction.", + "description": "Request via this endpoint to get the info of the futures account.", "tags": [], "parameters": [ { "name": "currency", "in": "query", - "description": "currency", - "required": false, - "schema": { - "type": "string" - } - }, - { - "name": "type", - "in": "query", - "description": "Account type main、trade", + "description": "Currecny, Default XBT", "required": false, "schema": { "type": "string", - "enum": [ - "main", - "trade" - ], - "x-api-enum": [ - { - "value": "main", - "name": "main", - "description": "Funding account" - }, - { - "value": "trade", - "name": "trade", - "description": "Spot account" - } + "default": "XBT", + "example": [ + "USDT", + "ETH" ] } } ], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "data": { - "type": "array", - "items": { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "Account ID" - }, - "currency": { - "type": "string", - "description": "Currency" - }, - "type": { - "type": "string", - "description": "Account type:,main、trade、isolated(abandon)、margin(abandon)\n", - "enum": [ - "main", - "trade" - ], - "x-api-enum": [ - { - "value": "main", - "name": "main", - "description": "Funding account" - }, - { - "value": "trade", - "name": "trade", - "description": "Spot account" - } - ] - }, - "balance": { - "type": "string", - "description": "Total funds in the account" - }, - "available": { - "type": "string", - "description": "Funds available to withdraw or trade" - }, - "holds": { - "type": "string", - "description": "Funds on hold (not available for use)" - } - }, - "required": [ - "id", - "currency", - "type", - "balance", - "available", - "holds" - ] - } - } - }, - "required": [ - "code", - "data" - ] - } - } - } - } - }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470125", - "x-abandon": "normal", - "x-domain": "Spot", - "x-api-channel": "Private", - "x-api-permission": "General", - "x-api-rate-limit-pool": "Management", - "x-sdk-service": "Account", - "x-sdk-sub-service": "Account", - "x-sdk-method-name": "getSpotAccountList", - "x-sdk-method-description": "Get a list of accounts. Please Deposit to the main account firstly, then transfer the funds to the trade account via Inner Transfer before transaction.", - "x-api-rate-limit": 5, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": [\\n {\\n \\\"id\\\": \\\"548674591753\\\",\\n \\\"currency\\\": \\\"USDT\\\",\\n \\\"type\\\": \\\"trade\\\",\\n \\\"balance\\\": \\\"26.66759503\\\",\\n \\\"available\\\": \\\"26.66759503\\\",\\n \\\"holds\\\": \\\"0\\\"\\n },\\n {\\n \\\"id\\\": \\\"63355cd156298d0001b66e61\\\",\\n \\\"currency\\\": \\\"USDT\\\",\\n \\\"type\\\": \\\"main\\\",\\n \\\"balance\\\": \\\"0.01\\\",\\n \\\"available\\\": \\\"0.01\\\",\\n \\\"holds\\\": \\\"0\\\"\\n }\\n ]\\n}", - "x-request-example": "{\\\"currency\\\": \\\"USDT\\\", \\\"type\\\": \\\"main\\\"}" - } - }, - "/api/v1/accounts/{accountId}": { - "get": { - "summary": "Get Account Detail - Spot", - "deprecated": false, - "description": "get Information for a single spot account. Use this endpoint when you know the accountId.", - "tags": [], - "parameters": [ - { - "name": "accountId", - "in": "path", - "description": "Path parameter. Account ID", - "required": true, - "schema": { - "type": "string" - } - } - ], "responses": { "200": { "description": "", @@ -1121,28 +1024,58 @@ "data": { "type": "object", "properties": { - "currency": { - "type": "string", - "description": "The currency of the account" + "accountEquity": { + "type": "number", + "description": "Account equity = marginBalance + Unrealised PNL" }, - "balance": { - "type": "string", - "description": "Total funds in the account" + "unrealisedPNL": { + "type": "number", + "description": "Unrealised profit and loss" }, - "available": { - "type": "string", - "description": "Funds available to withdraw or trade" + "marginBalance": { + "type": "number", + "description": "Margin balance = positionMargin + orderMargin + frozenFunds + availableBalance - unrealisedPNL" }, - "holds": { + "positionMargin": { + "type": "number", + "description": "Position margin" + }, + "orderMargin": { + "type": "number", + "description": "Order margin" + }, + "frozenFunds": { + "type": "number", + "description": "Frozen funds for out-transfer" + }, + "availableBalance": { + "type": "number", + "description": "Available balance" + }, + "currency": { "type": "string", - "description": "Funds on hold (not available for use)" + "description": "Currency", + "example": [ + "XBT", + "USDT", + "ETH" + ] + }, + "riskRatio": { + "type": "number", + "description": "Cross margin risk rate" } }, "required": [ + "accountEquity", + "unrealisedPNL", + "marginBalance", + "positionMargin", + "orderMargin", + "frozenFunds", + "availableBalance", "currency", - "balance", - "available", - "holds" + "riskRatio" ] } }, @@ -1155,91 +1088,112 @@ } } }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470126", + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470129", "x-abandon": "normal", - "x-domain": "Spot", + "x-domain": "Futures", "x-api-channel": "Private", - "x-api-permission": "General", - "x-api-rate-limit-pool": "Management", + "x-api-permission": "Futures", + "x-api-rate-limit-pool": "Futures", "x-sdk-service": "Account", "x-sdk-sub-service": "Account", - "x-sdk-method-name": "getSpotAccountDetail", - "x-sdk-method-description": "get Information for a single spot account. Use this endpoint when you know the accountId.", + "x-sdk-method-name": "getFuturesAccount", + "x-sdk-method-description": "Request via this endpoint to get the info of the futures account.", "x-api-rate-limit": 5, - "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"currency\\\":\\\"USDT\\\",\\\"balance\\\":\\\"26.66759503\\\",\\\"available\\\":\\\"26.66759503\\\",\\\"holds\\\":\\\"0\\\"}}", - "x-request-example": "{\\\"accountId\\\": \\\"548674591753\\\"}" + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"currency\\\": \\\"USDT\\\",\\n \\\"accountEquity\\\": 48.921913718,\\n \\\"unrealisedPNL\\\": 1.59475,\\n \\\"marginBalance\\\": 47.548728628,\\n \\\"positionMargin\\\": 34.1577964733,\\n \\\"orderMargin\\\": 0,\\n \\\"frozenFunds\\\": 0,\\n \\\"availableBalance\\\": 14.7876172447,\\n \\\"riskRatio\\\": 0.0090285199\\n }\\n}", + "x-request-example": "{\\\"currency\\\": \\\"USDT\\\"}" } }, - "/api/v3/margin/accounts": { + "/api/v1/accounts/ledgers": { "get": { - "summary": "Get Account - Cross Margin", + "summary": "Get Account Ledgers - Spot/Margin", "deprecated": false, - "description": "Request via this endpoint to get the info of the cross margin account.", + "description": "This interface is for transaction records from all types of your accounts, supporting inquiry of various currencies. Items are paginated and sorted to show the latest first. See the Pagination section for retrieving additional entries after the first page.", "tags": [], "parameters": [ { - "name": "quoteCurrency", + "name": "currency", "in": "query", - "description": "quote currency, currently only supports USDT, KCS, BTC, USDT as default", + "description": "Currency ( you can choose more than one currency). You can specify 10 currencies at most for one time. If not specified, all currencies will be inquired by default.", "required": false, "schema": { - "type": "string", - "default": "USDT", - "enum": [ - "USDT", - "KCS", - "BTC" - ], - "x-api-enum": [ - { - "value": "USDT", - "name": "", - "description": "" - }, - { - "value": "KCS", - "name": "", - "description": "" - }, - { - "value": "BTC", - "name": "", - "description": "" - } - ] + "type": "string" } }, { - "name": "queryType", + "name": "direction", "in": "query", - "description": "Query account type (default MARGIN), MARGIN - only query low frequency cross margin account, MARGIN_V2-only query high frequency cross margin account, ALL - consistent aggregate query with the web side", + "description": "direction: in, out", "required": false, "schema": { "type": "string", - "default": "MARGIN", "enum": [ - "MARGIN", - "MARGIN_V2", - "ALL" + "in", + "out" ], "x-api-enum": [ { - "value": "MARGIN", - "name": "", - "description": "" - }, - { - "value": "MARGIN_V2", + "value": "in", "name": "", "description": "" }, { - "value": "ALL", + "value": "out", "name": "", "description": "" } ] } + }, + { + "name": "bizType", + "in": "query", + "description": "Type: DEPOSIT -deposit, WITHDRAW -withdraw, TRANSFER -transfer, SUB_TRANSFER -subaccount transfer,TRADE_EXCHANGE -trade, MARGIN_EXCHANGE -margin trade, KUCOIN_BONUS -bonus, BROKER_TRANSFER -Broker transfer record", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "startAt", + "in": "query", + "description": "Start time (milisecond)", + "required": false, + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "endAt", + "in": "query", + "description": "End time (milisecond)", + "required": false, + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "currentPage", + "in": "query", + "description": "Current request page.", + "required": false, + "schema": { + "type": "integer", + "default": 1 + } + }, + { + "name": "pageSize", + "in": "query", + "description": "Number of results per request. Minimum is 10, maximum is 500.", + "required": false, + "schema": { + "type": "integer", + "default": 50, + "minimum": 10, + "maximum": 500 + } } ], "responses": { @@ -1256,114 +1210,78 @@ "data": { "type": "object", "properties": { - "totalAssetOfQuoteCurrency": { - "type": "string", - "description": "Total Assets in Quote Currency" + "currentPage": { + "type": "integer", + "description": "current page" }, - "totalLiabilityOfQuoteCurrency": { - "type": "string", - "description": "Total Liability in Quote Currency" + "pageSize": { + "type": "integer", + "description": "page size" }, - "debtRatio": { - "type": "string", - "description": "debt ratio" + "totalNum": { + "type": "integer", + "description": "total number" }, - "status": { - "type": "string", - "description": "Position status; EFFECTIVE-effective, BANKRUPTCY-bankruptcy liquidation, LIQUIDATION-closing, REPAY-repayment, BORROW borrowing", - "enum": [ - "EFFECTIVE", - "BANKRUPTCY", - "LIQUIDATION", - "REPAY", - "BORROW" - ], - "x-api-enum": [ - { - "value": "EFFECTIVE", - "name": "EFFECTIVE", - "description": "Effective" - }, - { - "value": "BANKRUPTCY", - "name": "BANKRUPTCY", - "description": "Bankruptcy liquidation" - }, - { - "value": "LIQUIDATION", - "name": "LIQUIDATION", - "description": "Closing" - }, - { - "value": "REPAY", - "name": "REPAY", - "description": "Repayment" - }, - { - "value": "BORROW", - "name": "BORROW", - "description": "Borrowing" - } - ] + "totalPage": { + "type": "integer", + "description": "total page" }, - "accounts": { + "items": { "type": "array", "items": { "type": "object", "properties": { + "id": { + "type": "string", + "description": "unique id" + }, "currency": { "type": "string", - "description": "currency" + "description": "The currency of an account" }, - "total": { + "amount": { "type": "string", - "description": "Total Assets" + "description": "The total amount of assets (fees included) involved in assets changes such as transaction, withdrawal and bonus distribution." }, - "available": { + "fee": { "type": "string", - "description": "Account available assets (total assets - frozen)" + "description": "Fees generated in transaction, withdrawal, etc." }, - "hold": { + "balance": { "type": "string", - "description": "Account frozen assets" + "description": "Remaining funds after the transaction." }, - "liability": { + "accountType": { "type": "string", - "description": "Liabilities" + "description": "The account type of the master user: MAIN, TRADE, MARGIN or CONTRACT." }, - "maxBorrowSize": { + "bizType": { "type": "string", - "description": "The user's remaining maximum loan amount" + "description": "Business type leading to the changes in funds, such as exchange, withdrawal, deposit, KUCOIN_BONUS, REFERRAL_BONUS, Lendings etc." }, - "borrowEnabled": { - "type": "boolean", - "description": "Support borrow or not" + "direction": { + "type": "string", + "description": "Side, out or in" }, - "transferInEnabled": { - "type": "boolean", - "description": "Support transfer or not" + "createdAt": { + "type": "integer", + "description": "Time of the event", + "format": "int64" + }, + "context": { + "type": "string", + "description": "Business related information such as order ID, serial No., etc." } - }, - "required": [ - "currency", - "total", - "available", - "hold", - "liability", - "maxBorrowSize", - "borrowEnabled", - "transferInEnabled" - ] - }, - "description": "Margin account list" + } + } } }, "required": [ - "totalAssetOfQuoteCurrency", - "totalLiabilityOfQuoteCurrency", - "debtRatio", - "status", - "accounts" + "currentPage", + "pageSize", + "totalNum", + "totalPage", + "items" ] } }, @@ -1376,63 +1294,56 @@ } } }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470127", + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470121", "x-abandon": "normal", "x-domain": "Spot", "x-api-channel": "Private", "x-api-permission": "General", - "x-api-rate-limit-pool": "Spot", + "x-api-rate-limit-pool": "Management", "x-sdk-service": "Account", "x-sdk-sub-service": "Account", - "x-sdk-method-name": "getCrossMarginAccount", - "x-sdk-method-description": "Request via this endpoint to get the info of the cross margin account.", - "x-api-rate-limit": 15, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"totalAssetOfQuoteCurrency\\\": \\\"0.02\\\",\\n \\\"totalLiabilityOfQuoteCurrency\\\": \\\"0\\\",\\n \\\"debtRatio\\\": \\\"0\\\",\\n \\\"status\\\": \\\"EFFECTIVE\\\",\\n \\\"accounts\\\": [\\n {\\n \\\"currency\\\": \\\"USDT\\\",\\n \\\"total\\\": \\\"0.02\\\",\\n \\\"available\\\": \\\"0.02\\\",\\n \\\"hold\\\": \\\"0\\\",\\n \\\"liability\\\": \\\"0\\\",\\n \\\"maxBorrowSize\\\": \\\"0\\\",\\n \\\"borrowEnabled\\\": true,\\n \\\"transferInEnabled\\\": true\\n }\\n ]\\n }\\n}", - "x-request-example": "{\\\"quoteCurrency\\\": \\\"USDT\\\", \\\"queryType\\\": \\\"MARGIN\\\"}" + "x-sdk-method-name": "getSpotLedger", + "x-sdk-method-description": "This interface is for transaction records from all types of your accounts, supporting inquiry of various currencies. Items are paginated and sorted to show the latest first. See the Pagination section for retrieving additional entries after the first page.", + "x-api-rate-limit": 2, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"currentPage\\\": 1,\\n \\\"pageSize\\\": 50,\\n \\\"totalNum\\\": 1,\\n \\\"totalPage\\\": 1,\\n \\\"items\\\": [\\n {\\n \\\"id\\\": \\\"265329987780896\\\",\\n \\\"currency\\\": \\\"USDT\\\",\\n \\\"amount\\\": \\\"0.01\\\",\\n \\\"fee\\\": \\\"0\\\",\\n \\\"balance\\\": \\\"0\\\",\\n \\\"accountType\\\": \\\"TRADE\\\",\\n \\\"bizType\\\": \\\"SUB_TRANSFER\\\",\\n \\\"direction\\\": \\\"out\\\",\\n \\\"createdAt\\\": 1728658481484,\\n \\\"context\\\": \\\"\\\"\\n }\\n ]\\n }\\n}", + "x-request-example": "{\\\"currency\\\": \\\"BTC\\\", \\\"direction\\\": \\\"in\\\", \\\"bizType\\\": \\\"TRANSFER\\\", \\\"startAt\\\": 1728663338000, \\\"endAt\\\": 1728692138000, \\\"currentPage\\\": 1, \\\"pageSize\\\": 50}" } }, - "/api/v3/isolated/accounts": { + "/api/v1/hf/accounts/ledgers": { "get": { - "summary": "Get Account - Isolated Margin", + "summary": "Get Account Ledgers - Trade_hf", "deprecated": false, - "description": "Request via this endpoint to get the info of the isolated margin account.", + "description": "This API endpoint returns all transfer (in and out) records in high-frequency trading account and supports multi-coin queries. The query results are sorted in descending order by createdAt and id.", "tags": [], "parameters": [ { - "name": "symbol", + "name": "currency", "in": "query", - "description": "For isolated trading pairs, query all without passing", + "description": "Currency ( you can choose more than one currency). You can specify 10 currencies at most for one time. If not specified, all currencies will be inquired by default.", "required": false, "schema": { "type": "string" } }, { - "name": "quoteCurrency", + "name": "direction", "in": "query", - "description": "quote currency, currently only supports USDT, KCS, BTC, USDT as default", + "description": "direction: in, out", "required": false, "schema": { "type": "string", - "default": "USDT", "enum": [ - "USDT", - "KCS", - "BTC" + "in", + "out" ], "x-api-enum": [ { - "value": "USDT", - "name": "", - "description": "" - }, - { - "value": "KCS", + "value": "in", "name": "", "description": "" }, { - "value": "BTC", + "value": "out", "name": "", "description": "" } @@ -1440,36 +1351,71 @@ } }, { - "name": "queryType", + "name": "bizType", "in": "query", - "description": "Query account type (default ISOLATED), ISOLATED- - only query low frequency isolated margin account, ISOLATED_V2-only query high frequency isolated margin account, ALL - consistent aggregate query with the web side", + "description": "Transaction type: TRANSFER-transfer funds,TRADE_EXCHANGE-Trade", "required": false, "schema": { "type": "string", - "default": "ISOLATED", "enum": [ - "ISOLATED", - "ISOLATED_V2", - "ALL" + "TRADE_EXCHANGE", + "TRANSFER" ], "x-api-enum": [ { - "value": "ISOLATED", - "name": "", - "description": "" - }, - { - "value": "ISOLATED_V2", + "value": "TRADE_EXCHANGE", "name": "", "description": "" }, { - "value": "ALL", + "value": "TRANSFER", "name": "", "description": "" } ] } + }, + { + "name": "lastId", + "in": "query", + "description": "The id of the last set of data from the previous batch of data. By default, the latest information is given.", + "required": false, + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "limit", + "in": "query", + "description": "Default100,Max200", + "required": false, + "schema": { + "type": "integer", + "default": 100, + "maximum": 200, + "minimum": 1 + } + }, + { + "name": "startAt", + "in": "query", + "description": "Start time (milisecond)", + "required": false, + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "endAt", + "in": "query", + "description": "End time (milisecond)", + "required": false, + "schema": { + "type": "integer", + "format": "int64" + } } ], "responses": { @@ -1484,185 +1430,84 @@ "type": "string" }, "data": { - "type": "object", - "properties": { - "totalAssetOfQuoteCurrency": { - "type": "string", - "description": "Total Assets in Quote Currency" - }, - "totalLiabilityOfQuoteCurrency": { - "type": "string", - "description": "Total Liability in Quote Currency" - }, - "timestamp": { - "type": "integer", - "description": "timestamp", - "format": "int64" - }, - "assets": { - "type": "array", - "items": { - "type": "object", - "properties": { - "symbol": { - "type": "string", - "description": "Symbol" - }, - "status": { - "type": "string", - "description": "Position status; EFFECTIVE-effective, BANKRUPTCY-bankruptcy liquidation, LIQUIDATION-closing, REPAY-repayment, BORROW borrowing", - "enum": [ - "EFFECTIVE", - "BANKRUPTCY", - "LIQUIDATION", - "REPAY", - "BORROW" - ], - "x-api-enum": [ - { - "value": "EFFECTIVE", - "name": "EFFECTIVE", - "description": "Effective" - }, - { - "value": "BANKRUPTCY", - "name": "BANKRUPTCY", - "description": "Bankruptcy liquidation" - }, - { - "value": "LIQUIDATION", - "name": "LIQUIDATION", - "description": "Closing" - }, - { - "value": "REPAY", - "name": "REPAY", - "description": "Repayment" - }, - { - "value": "BORROW", - "name": "BORROW", - "description": "Borrowing" - } - ] - }, - "debtRatio": { - "type": "string", - "description": "debt ratio" - }, - "baseAsset": { - "type": "object", - "properties": { - "currency": { - "type": "string", - "description": "currency" - }, - "borrowEnabled": { - "type": "boolean", - "description": "Support borrow or not" - }, - "transferInEnabled": { - "type": "boolean", - "description": "Support transfer or not" - }, - "liability": { - "type": "string", - "description": "Liabilities" - }, - "total": { - "type": "string", - "description": "Total Assets" - }, - "available": { - "type": "string", - "description": "Account available assets (total assets - frozen)" - }, - "hold": { - "type": "string", - "description": "Account frozen assets" - }, - "maxBorrowSize": { - "type": "string", - "description": "The user's remaining maximum loan amount" - } - }, - "required": [ - "currency", - "borrowEnabled", - "transferInEnabled", - "liability", - "total", - "available", - "hold", - "maxBorrowSize" - ], - "description": "base asset" + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Unique id" + }, + "currency": { + "type": "string", + "description": "currency" + }, + "amount": { + "type": "string", + "description": "Change in funds balance" + }, + "fee": { + "type": "string", + "description": "Deposit or withdrawal fee" + }, + "tax": { + "type": "string" + }, + "balance": { + "type": "string", + "description": "Total balance of funds after change" + }, + "accountType": { + "type": "string", + "description": "Master account type TRADE_HF" + }, + "bizType": { + "type": "string", + "description": "Trnasaction type,such as TRANSFER, TRADE_EXCHANGE, etc." + }, + "direction": { + "type": "string", + "description": "Direction of transfer( out or in)", + "enum": [ + "in", + "out" + ], + "x-api-enum": [ + { + "value": "in", + "name": "", + "description": "" }, - "quoteAsset": { - "type": "object", - "properties": { - "currency": { - "type": "string", - "description": "currency" - }, - "borrowEnabled": { - "type": "boolean", - "description": "Support borrow or not" - }, - "transferInEnabled": { - "type": "boolean", - "description": "Support transfer or not" - }, - "liability": { - "type": "string", - "description": "Liabilities" - }, - "total": { - "type": "string", - "description": "Total Assets" - }, - "available": { - "type": "string", - "description": "Account available assets (total assets - frozen)" - }, - "hold": { - "type": "string", - "description": "Account frozen assets" - }, - "maxBorrowSize": { - "type": "string", - "description": "The user's remaining maximum loan amount" - } - }, - "required": [ - "currency", - "borrowEnabled", - "transferInEnabled", - "liability", - "total", - "available", - "hold", - "maxBorrowSize" - ], - "description": "quote asset" + { + "value": "out", + "name": "", + "description": "" } - }, - "required": [ - "symbol", - "status", - "debtRatio", - "baseAsset", - "quoteAsset" ] + }, + "createdAt": { + "type": "string", + "description": "Created time" + }, + "context": { + "type": "string", + "description": "Core transaction parameter" } - } - }, - "required": [ - "totalAssetOfQuoteCurrency", - "totalLiabilityOfQuoteCurrency", - "timestamp", - "assets" - ] + }, + "required": [ + "id", + "currency", + "amount", + "fee", + "tax", + "balance", + "accountType", + "bizType", + "direction", + "createdAt", + "context" + ] + } } }, "required": [ @@ -1674,7 +1519,7 @@ } } }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470128", + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470122", "x-abandon": "normal", "x-domain": "Spot", "x-api-channel": "Private", @@ -1682,33 +1527,104 @@ "x-api-rate-limit-pool": "Spot", "x-sdk-service": "Account", "x-sdk-sub-service": "Account", - "x-sdk-method-name": "getIsolatedMarginAccount", - "x-sdk-method-description": "Request via this endpoint to get the info of the isolated margin account.", - "x-api-rate-limit": 15, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"totalAssetOfQuoteCurrency\\\": \\\"0.01\\\",\\n \\\"totalLiabilityOfQuoteCurrency\\\": \\\"0\\\",\\n \\\"timestamp\\\": 1728725465994,\\n \\\"assets\\\": [\\n {\\n \\\"symbol\\\": \\\"BTC-USDT\\\",\\n \\\"status\\\": \\\"EFFECTIVE\\\",\\n \\\"debtRatio\\\": \\\"0\\\",\\n \\\"baseAsset\\\": {\\n \\\"currency\\\": \\\"BTC\\\",\\n \\\"borrowEnabled\\\": true,\\n \\\"transferInEnabled\\\": true,\\n \\\"liability\\\": \\\"0\\\",\\n \\\"total\\\": \\\"0\\\",\\n \\\"available\\\": \\\"0\\\",\\n \\\"hold\\\": \\\"0\\\",\\n \\\"maxBorrowSize\\\": \\\"0\\\"\\n },\\n \\\"quoteAsset\\\": {\\n \\\"currency\\\": \\\"USDT\\\",\\n \\\"borrowEnabled\\\": true,\\n \\\"transferInEnabled\\\": true,\\n \\\"liability\\\": \\\"0\\\",\\n \\\"total\\\": \\\"0.01\\\",\\n \\\"available\\\": \\\"0.01\\\",\\n \\\"hold\\\": \\\"0\\\",\\n \\\"maxBorrowSize\\\": \\\"0\\\"\\n }\\n }\\n ]\\n }\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"example_string_default_value\\\", \\\"quoteCurrency\\\": \\\"USDT\\\", \\\"queryType\\\": \\\"ISOLATED\\\"}" + "x-sdk-method-name": "getSpotHFLedger", + "x-sdk-method-description": "This API endpoint returns all transfer (in and out) records in high-frequency trading account and supports multi-coin queries. The query results are sorted in descending order by createdAt and id.", + "x-api-rate-limit": 2, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": [\\n {\\n \\\"id\\\": \\\"254062248624417\\\",\\n \\\"currency\\\": \\\"USDT\\\",\\n \\\"amount\\\": \\\"1.59760080\\\",\\n \\\"fee\\\": \\\"0.00159920\\\",\\n \\\"tax\\\": \\\"0\\\",\\n \\\"balance\\\": \\\"26.73759503\\\",\\n \\\"accountType\\\": \\\"TRADE_HF\\\",\\n \\\"bizType\\\": \\\"TRADE_EXCHANGE\\\",\\n \\\"direction\\\": \\\"in\\\",\\n \\\"createdAt\\\": \\\"1728443957539\\\",\\n \\\"context\\\": \\\"{\\\\\\\"symbol\\\\\\\":\\\\\\\"KCS-USDT\\\\\\\",\\\\\\\"orderId\\\\\\\":\\\\\\\"6705f6350dc7210007d6a36d\\\\\\\",\\\\\\\"tradeId\\\\\\\":\\\\\\\"10046097631627265\\\\\\\"}\\\"\\n }\\n ]\\n}", + "x-request-example": "{\\\"currency\\\": \\\"BTC\\\", \\\"direction\\\": \\\"in\\\", \\\"bizType\\\": \\\"TRANSFER\\\", \\\"lastId\\\": 254062248624417, \\\"limit\\\": 100, \\\"startAt\\\": 1728663338000, \\\"endAt\\\": 1728692138000}" } }, - "/api/v1/account-overview": { + "/api/v3/hf/margin/account/ledgers": { "get": { - "summary": "Get Account - Futures", + "summary": "Get Account Ledgers - Margin_hf", "deprecated": false, - "description": "Request via this endpoint to get the info of the futures account.", + "description": "This API endpoint returns all transfer (in and out) records in high-frequency margin trading account and supports multi-coin queries. The query results are sorted in descending order by createdAt and id.", "tags": [], "parameters": [ { "name": "currency", "in": "query", - "description": "Currecny, Default XBT", + "description": "currency, optional,can select more than one,separate with commas,select no more than 10 currencys,the default will be to query for all currencys if left empty", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "direction", + "in": "query", + "description": "direction: in, out", "required": false, "schema": { "type": "string", - "default": "XBT", - "example": [ - "USDT", - "ETH" + "enum": [ + "in", + "out" + ], + "x-api-enum": [ + { + "value": "in", + "name": "", + "description": "" + }, + { + "value": "out", + "name": "", + "description": "" + } ] } + }, + { + "name": "bizType", + "in": "query", + "description": "Transaction type: TRANSFER- transfer funds, MARGIN_EXCHANGE - cross margin trade, ISOLATED_EXCHANGE - isolated margin trade, LIQUIDATION - liquidation, ASSERT_RETURN - forced liquidation asset return", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "lastId", + "in": "query", + "description": "The id of the last set of data from the previous batch of data. By default, the latest information is given.", + "required": false, + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "limit", + "in": "query", + "description": "Default100,Max200", + "required": false, + "schema": { + "type": "integer", + "default": 100, + "maximum": 200, + "minimum": 1 + } + }, + { + "name": "startAt", + "in": "query", + "description": "Start time (milisecond)", + "required": false, + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "endAt", + "in": "query", + "description": "End time (milisecond)", + "required": false, + "schema": { + "type": "integer", + "format": "int64" + } } ], "responses": { @@ -1723,61 +1639,56 @@ "type": "string" }, "data": { - "type": "object", - "properties": { - "accountEquity": { - "type": "number", - "description": "Account equity = marginBalance + Unrealised PNL" - }, - "unrealisedPNL": { - "type": "number", - "description": "Unrealised profit and loss" - }, - "marginBalance": { - "type": "number", - "description": "Margin balance = positionMargin + orderMargin + frozenFunds + availableBalance - unrealisedPNL" - }, - "positionMargin": { - "type": "number", - "description": "Position margin" - }, - "orderMargin": { - "type": "number", - "description": "Order margin" - }, - "frozenFunds": { - "type": "number", - "description": "Frozen funds for out-transfer" - }, - "availableBalance": { - "type": "number", - "description": "Available balance" - }, - "currency": { - "type": "string", - "description": "Currency", - "example": [ - "XBT", - "USDT", - "ETH" - ] - }, - "riskRatio": { - "type": "number", - "description": "Cross margin risk rate" + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "currency": { + "type": "string", + "description": "currency" + }, + "amount": { + "type": "string", + "description": "Change in funds balance" + }, + "fee": { + "type": "string", + "description": "Deposit or withdrawal fee" + }, + "balance": { + "type": "string", + "description": "Total balance of funds after change" + }, + "accountType": { + "type": "string", + "description": "Master account type TRADE_HF" + }, + "bizType": { + "type": "string", + "description": "Trnasaction type,such as TRANSFER, TRADE_EXCHANGE, etc." + }, + "direction": { + "type": "string", + "description": "Direction of transfer( out or in)" + }, + "createdAt": { + "type": "integer", + "description": "Ledger creation time", + "format": "int64" + }, + "context": { + "type": "string", + "description": "Core transaction parameter" + }, + "tax": { + "type": "string" + } } - }, - "required": [ - "accountEquity", - "unrealisedPNL", - "marginBalance", - "positionMargin", - "orderMargin", - "frozenFunds", - "availableBalance", - "currency", - "riskRatio" - ] + } } }, "required": [ @@ -1789,28 +1700,98 @@ } } }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470129", + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470123", "x-abandon": "normal", - "x-domain": "Futures", + "x-domain": "Spot", "x-api-channel": "Private", - "x-api-permission": "Futures", - "x-api-rate-limit-pool": "Futures", + "x-api-permission": "General", + "x-api-rate-limit-pool": "Spot", "x-sdk-service": "Account", "x-sdk-sub-service": "Account", - "x-sdk-method-name": "getFuturesAccount", - "x-sdk-method-description": "Request via this endpoint to get the info of the futures account.", - "x-api-rate-limit": 5, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"currency\\\": \\\"USDT\\\",\\n \\\"accountEquity\\\": 48.921913718,\\n \\\"unrealisedPNL\\\": 1.59475,\\n \\\"marginBalance\\\": 47.548728628,\\n \\\"positionMargin\\\": 34.1577964733,\\n \\\"orderMargin\\\": 0,\\n \\\"frozenFunds\\\": 0,\\n \\\"availableBalance\\\": 14.7876172447,\\n \\\"riskRatio\\\": 0.0090285199\\n }\\n}", - "x-request-example": "{\\\"currency\\\": \\\"USDT\\\"}" + "x-sdk-method-name": "getMarginHFLedger", + "x-sdk-method-description": "This API endpoint returns all transfer (in and out) records in high-frequency margin trading account and supports multi-coin queries. The query results are sorted in descending order by createdAt and id.", + "x-api-rate-limit": 2, + "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":[{\\\"id\\\":1949641706720,\\\"currency\\\":\\\"USDT\\\",\\\"amount\\\":\\\"0.01000000\\\",\\\"fee\\\":\\\"0.00000000\\\",\\\"balance\\\":\\\"0.01000000\\\",\\\"accountType\\\":\\\"MARGIN_V2\\\",\\\"bizType\\\":\\\"TRANSFER\\\",\\\"direction\\\":\\\"in\\\",\\\"createdAt\\\":1728664091208,\\\"context\\\":\\\"{}\\\",\\\"tax\\\":\\\"0.00000000\\\"}]}", + "x-request-example": "{\\\"currency\\\": \\\"BTC\\\", \\\"direction\\\": \\\"in\\\", \\\"bizType\\\": \\\"TRANSFER\\\", \\\"lastId\\\": 254062248624417, \\\"limit\\\": 100, \\\"startAt\\\": 1728663338000, \\\"endAt\\\": 1728692138000}" } }, - "/api/v1/user/api-key": { + "/api/v1/transaction-history": { "get": { - "summary": "Get Apikey Info", + "summary": "Get Account Ledgers - Futures", "deprecated": false, - "description": "Get the information of the api key. Use the api key pending to be checked to call the endpoint. Both master and sub user's api key are applicable.", + "description": "This interface can query the ledger records of the futures business line", "tags": [], - "parameters": [], + "parameters": [ + { + "name": "currency", + "in": "query", + "description": "Currency of transaction history, XBT or USDT", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "type", + "in": "query", + "description": "Type RealisedPNL-Realised profit and loss, Deposit-Deposit, Withdrawal-withdraw, Transferin-Transfer in, TransferOut-Transfer out", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "offset", + "in": "query", + "description": "Start offset. Generally, the only attribute of the last returned result of the previous request is used, and the first page is returned by default", + "required": false, + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "forward", + "in": "query", + "description": "This parameter functions to judge whether the lookup is forward or not. True means “yes” and False means “no”. This parameter is set as true by default", + "required": false, + "schema": { + "type": "boolean", + "default": true + } + }, + { + "name": "maxCount", + "in": "query", + "description": "Displayed size per page. The default size is 50", + "required": false, + "schema": { + "type": "integer", + "default": 50, + "format": "int64" + } + }, + { + "name": "startAt", + "in": "query", + "description": "Start time (milisecond)", + "required": false, + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "endAt", + "in": "query", + "description": "End time (milisecond)", + "required": false, + "schema": { + "type": "integer", + "format": "int64" + } + } + ], "responses": { "200": { "description": "", @@ -1825,52 +1806,70 @@ "data": { "type": "object", "properties": { - "remark": { - "type": "string", - "description": "Remarks" - }, - "apiKey": { - "type": "string", - "description": "Apikey" - }, - "apiVersion": { - "type": "integer", - "description": "API Version" - }, - "permission": { - "type": "string", - "description": "[Permissions](https://www.kucoin.com/docs-new/doc-338144), possible values: General, Spot, Margin, Futures, InnerTransfer, Transfer, Earn" - }, - "ipWhitelist": { - "type": "string", - "description": "IP whitelist\n\n" - }, - "createdAt": { - "type": "integer", - "description": "Apikey create time", - "format": "int64" - }, - "uid": { - "type": "integer", - "description": "Account UID" + "dataList": { + "type": "array", + "items": { + "type": "object", + "properties": { + "time": { + "type": "integer", + "description": "ledger time", + "format": "int64" + }, + "type": { + "type": "string", + "description": "Type: RealisedPNL, Deposit, Withdrawal, TransferIn, TransferOut" + }, + "amount": { + "type": "number", + "description": "Transaction amount" + }, + "fee": { + "type": "number", + "description": "Fee" + }, + "accountEquity": { + "type": "number", + "description": "Account equity" + }, + "status": { + "type": "string", + "description": "Status: Completed, Pending" + }, + "remark": { + "type": "string", + "description": "Ticker symbol of the contract" + }, + "offset": { + "type": "integer", + "description": "Offset" + }, + "currency": { + "type": "string", + "description": "Currency" + } + }, + "required": [ + "time", + "type", + "amount", + "fee", + "accountEquity", + "status", + "remark", + "offset", + "currency" + ] + } }, - "isMaster": { + "hasMore": { "type": "boolean", - "description": "Whether it is the master account." - }, - "subName": { - "type": "string", - "description": "Sub Name, There is no such param for the master account" + "description": "Is it the last page. If it is false, it means it is the last page, and if it is true, it means need to turn the page." } }, "required": [ - "remark", - "apiKey", - "apiVersion", - "permission", - "createdAt", - "uid", - "isMaster" + "dataList", + "hasMore" ] } }, @@ -1883,18 +1882,19 @@ } } }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470130", + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470124", "x-abandon": "normal", - "x-domain": "Spot", + "x-domain": "Futures", "x-api-channel": "Private", "x-api-permission": "General", - "x-api-rate-limit-pool": "Management", + "x-api-rate-limit-pool": "Futures", "x-sdk-service": "Account", "x-sdk-sub-service": "Account", - "x-sdk-method-name": "getApikeyInfo", - "x-sdk-method-description": "Get the information of the api key. Use the api key pending to be checked to call the endpoint. Both master and sub user's api key are applicable.", - "x-api-rate-limit": 20, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"remark\\\": \\\"account1\\\",\\n \\\"apiKey\\\": \\\"6705f5c311545b000157d3eb\\\",\\n \\\"apiVersion\\\": 3,\\n \\\"permission\\\": \\\"General,Futures,Spot,Earn,InnerTransfer,Transfer,Margin\\\",\\n \\\"ipWhitelist\\\": \\\"203.**.154,103.**.34\\\",\\n \\\"createdAt\\\": 1728443843000,\\n \\\"uid\\\": 165111215,\\n \\\"isMaster\\\": true\\n }\\n}" + "x-sdk-method-name": "getFuturesLedger", + "x-sdk-method-description": "This interface can query the ledger records of the futures business line", + "x-api-rate-limit": 2, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"dataList\\\": [\\n {\\n \\\"time\\\": 1728665747000,\\n \\\"type\\\": \\\"TransferIn\\\",\\n \\\"amount\\\": 0.01,\\n \\\"fee\\\": 0.0,\\n \\\"accountEquity\\\": 14.02924938,\\n \\\"status\\\": \\\"Completed\\\",\\n \\\"remark\\\": \\\"Transferred from High-Frequency Trading Account\\\",\\n \\\"offset\\\": 51360793,\\n \\\"currency\\\": \\\"USDT\\\"\\n },\\n {\\n \\\"time\\\": 1728648000000,\\n \\\"type\\\": \\\"RealisedPNL\\\",\\n \\\"amount\\\": 0.00630042,\\n \\\"fee\\\": 0.0,\\n \\\"accountEquity\\\": 20.0,\\n \\\"status\\\": \\\"Completed\\\",\\n \\\"remark\\\": \\\"XBTUSDTM\\\",\\n \\\"offset\\\": 51352430,\\n \\\"currency\\\": \\\"USDT\\\"\\n }\\n ],\\n \\\"hasMore\\\": false\\n }\\n}", + "x-request-example": "{\\\"currency\\\": \\\"XBT\\\", \\\"type\\\": \\\"Transferin\\\", \\\"offset\\\": 254062248624417, \\\"forward\\\": true, \\\"maxCount\\\": 50, \\\"startAt\\\": 1728663338000, \\\"endAt\\\": 1728692138000}" } }, "/api/v1/margin/account": { diff --git a/spec/rest/api/openapi-account-deposit.json b/spec/rest/api/openapi-account-deposit.json index 8e6c3e6e..2a4c582f 100644 --- a/spec/rest/api/openapi-account-deposit.json +++ b/spec/rest/api/openapi-account-deposit.json @@ -7,6 +7,173 @@ }, "tags": [], "paths": { + "/api/v3/deposit-address/create": { + "post": { + "summary": "Add Deposit Address(V3)", + "deprecated": false, + "description": "Request via this endpoint to create a deposit address for a currency you intend to deposit.", + "tags": [], + "parameters": [], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "object", + "properties": { + "address": { + "type": "string", + "description": "Deposit address" + }, + "memo": { + "type": "string", + "description": "Address remark. If there’s no remark, it is empty. When you withdraw from other platforms to the KuCoin, you need to fill in memo(tag). If you do not fill memo (tag), your deposit may not be available, please be cautious." + }, + "chainId": { + "type": "string", + "description": "The chainId of currency", + "example": [ + "eth", + "bech32", + "btc", + "kcc", + "trx", + "bsc", + "arbitrum", + "ton", + "optimism" + ] + }, + "to": { + "type": "string", + "description": "Deposit account type: main (funding account), trade (spot trading account)" + }, + "expirationDate": { + "type": "integer", + "description": "Expiration time, Lightning network expiration time, non-Lightning network this field is invalid" + }, + "currency": { + "type": "string", + "description": "currency", + "example": [ + "BTC", + "ETH", + "USDT" + ] + }, + "chainName": { + "type": "string", + "description": "The chainName of currency" + } + }, + "required": [ + "address", + "memo", + "chainId", + "to", + "expirationDate", + "currency", + "chainName" + ] + } + }, + "required": [ + "code", + "data" + ] + } + } + } + } + }, + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470142", + "x-abandon": "normal", + "x-domain": "Spot", + "x-api-channel": "Private", + "x-api-permission": "General", + "x-api-rate-limit-pool": "Management", + "x-sdk-service": "Account", + "x-sdk-sub-service": "Deposit", + "x-sdk-method-name": "addDepositAddressV3", + "x-sdk-method-description": "Request via this endpoint to create a deposit address for a currency you intend to deposit.", + "x-api-rate-limit": 20, + "requestBody": { + "content": { + "application/json": { + "schema": { + "title": "", + "type": "object", + "properties": { + "currency": { + "type": "string", + "description": "currency", + "example": [ + "BTC", + "ETH", + "USDT" + ] + }, + "chain": { + "type": "string", + "description": "The chainId of currency, e.g. The available value for USDT are OMNI, ERC20, TRC20, default is ERC20. The available value for BTC are Native, Segwit, TRC20, the parameters are bech32, btc, trx, default is Native. This only apply for multi-chain currency, and there is no need for single chain currency.", + "default": "eth", + "example": [ + "eth", + "bech32", + "btc", + "kcc", + "trx", + "bsc", + "arbitrum", + "ton", + "optimism" + ] + }, + "to": { + "type": "string", + "description": "Deposit account type: main (funding account), trade (spot trading account), the default is main", + "enum": [ + "main", + "trade" + ], + "default": "main", + "x-api-enum": [ + { + "value": "main", + "name": "", + "description": "" + }, + { + "value": "trade", + "name": "", + "description": "" + } + ] + }, + "amount": { + "type": "string", + "description": "Deposit amount. This parameter is only used when applying for invoices on the Lightning Network. This parameter is invalid if it is not passed through the Lightning Network." + } + }, + "required": [ + "currency" + ] + }, + "example": "{\n \"currency\": \"TON\",\n \"chain\": \"ton\",\n \"to\": \"trade\"\n}" + } + } + }, + "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"address\\\":\\\"EQCA1BI4QRZ8qYmskSRDzJmkucGodYRTZCf_b9hckjla6dZl\\\",\\\"memo\\\":\\\"2090821203\\\",\\\"chainId\\\":\\\"ton\\\",\\\"to\\\":\\\"TRADE\\\",\\\"expirationDate\\\":0,\\\"currency\\\":\\\"TON\\\",\\\"chainName\\\":\\\"TON\\\"}}", + "x-request-example": "{\\\"currency\\\": \\\"TON\\\", \\\"chain\\\": \\\"ton\\\", \\\"to\\\": \\\"trade\\\"}" + } + }, "/api/v3/deposit-addresses": { "get": { "summary": "Get Deposit Address(V3)", @@ -402,173 +569,6 @@ "x-request-example": "{\\\"currency\\\": \\\"BTC\\\", \\\"status\\\": \\\"SUCCESS\\\", \\\"startAt\\\": 1728663338000, \\\"endAt\\\": 1728692138000, \\\"currentPage\\\": 1, \\\"pageSize\\\": 50}" } }, - "/api/v3/deposit-address/create": { - "post": { - "summary": "Add Deposit Address(V3)", - "deprecated": false, - "description": "Request via this endpoint to create a deposit address for a currency you intend to deposit.", - "tags": [], - "parameters": [], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "data": { - "type": "object", - "properties": { - "address": { - "type": "string", - "description": "Deposit address" - }, - "memo": { - "type": "string", - "description": "Address remark. If there’s no remark, it is empty. When you withdraw from other platforms to the KuCoin, you need to fill in memo(tag). If you do not fill memo (tag), your deposit may not be available, please be cautious." - }, - "chainId": { - "type": "string", - "description": "The chainId of currency", - "example": [ - "eth", - "bech32", - "btc", - "kcc", - "trx", - "bsc", - "arbitrum", - "ton", - "optimism" - ] - }, - "to": { - "type": "string", - "description": "Deposit account type: main (funding account), trade (spot trading account)" - }, - "expirationDate": { - "type": "integer", - "description": "Expiration time, Lightning network expiration time, non-Lightning network this field is invalid" - }, - "currency": { - "type": "string", - "description": "currency", - "example": [ - "BTC", - "ETH", - "USDT" - ] - }, - "chainName": { - "type": "string", - "description": "The chainName of currency" - } - }, - "required": [ - "address", - "memo", - "chainId", - "to", - "expirationDate", - "currency", - "chainName" - ] - } - }, - "required": [ - "code", - "data" - ] - } - } - } - } - }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470142", - "x-abandon": "normal", - "x-domain": "Spot", - "x-api-channel": "Private", - "x-api-permission": "General", - "x-api-rate-limit-pool": "Management", - "x-sdk-service": "Account", - "x-sdk-sub-service": "Deposit", - "x-sdk-method-name": "addDepositAddressV3", - "x-sdk-method-description": "Request via this endpoint to create a deposit address for a currency you intend to deposit.", - "x-api-rate-limit": 20, - "requestBody": { - "content": { - "application/json": { - "schema": { - "title": "", - "type": "object", - "properties": { - "currency": { - "type": "string", - "description": "currency", - "example": [ - "BTC", - "ETH", - "USDT" - ] - }, - "chain": { - "type": "string", - "description": "The chainId of currency, e.g. The available value for USDT are OMNI, ERC20, TRC20, default is ERC20. The available value for BTC are Native, Segwit, TRC20, the parameters are bech32, btc, trx, default is Native. This only apply for multi-chain currency, and there is no need for single chain currency.", - "default": "eth", - "example": [ - "eth", - "bech32", - "btc", - "kcc", - "trx", - "bsc", - "arbitrum", - "ton", - "optimism" - ] - }, - "to": { - "type": "string", - "description": "Deposit account type: main (funding account), trade (spot trading account), the default is main", - "enum": [ - "main", - "trade" - ], - "default": "main", - "x-api-enum": [ - { - "value": "main", - "name": "", - "description": "" - }, - { - "value": "trade", - "name": "", - "description": "" - } - ] - }, - "amount": { - "type": "string", - "description": "Deposit amount. This parameter is only used when applying for invoices on the Lightning Network. This parameter is invalid if it is not passed through the Lightning Network." - } - }, - "required": [ - "currency" - ] - }, - "example": "{\n \"currency\": \"TON\",\n \"chain\": \"ton\",\n \"to\": \"trade\"\n}" - } - } - }, - "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"address\\\":\\\"EQCA1BI4QRZ8qYmskSRDzJmkucGodYRTZCf_b9hckjla6dZl\\\",\\\"memo\\\":\\\"2090821203\\\",\\\"chainId\\\":\\\"ton\\\",\\\"to\\\":\\\"TRADE\\\",\\\"expirationDate\\\":0,\\\"currency\\\":\\\"TON\\\",\\\"chainName\\\":\\\"TON\\\"}}", - "x-request-example": "{\\\"currency\\\": \\\"TON\\\", \\\"chain\\\": \\\"ton\\\", \\\"to\\\": \\\"trade\\\"}" - } - }, "/api/v2/deposit-addresses": { "get": { "summary": "Get Deposit Addresses(V2)", diff --git a/spec/rest/api/openapi-account-subaccount.json b/spec/rest/api/openapi-account-subaccount.json index e6aa903a..a0de5700 100644 --- a/spec/rest/api/openapi-account-subaccount.json +++ b/spec/rest/api/openapi-account-subaccount.json @@ -7,6 +7,264 @@ }, "tags": [], "paths": { + "/api/v2/sub/user/created": { + "post": { + "summary": "Add SubAccount", + "deprecated": false, + "description": "This endpoint can be used to create sub-accounts.", + "tags": [], + "parameters": [], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "object", + "properties": { + "uid": { + "type": "integer", + "description": "Sub-account UID" + }, + "subName": { + "type": "string", + "description": "Sub-account name" + }, + "remarks": { + "type": "string", + "description": "Remarks" + }, + "access": { + "type": "string", + "description": "Permission" + } + }, + "required": [ + "uid", + "subName", + "remarks", + "access" + ] + } + }, + "required": [ + "code", + "data" + ] + } + } + } + } + }, + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470135", + "x-abandon": "normal", + "x-domain": "Spot", + "x-api-channel": "Private", + "x-api-permission": "General", + "x-api-rate-limit-pool": "Management", + "x-sdk-service": "Account", + "x-sdk-sub-service": "SubAccount", + "x-sdk-method-name": "addSubAccount", + "x-sdk-method-description": "This endpoint can be used to create sub-accounts.", + "x-api-rate-limit": 15, + "requestBody": { + "content": { + "application/json": { + "schema": { + "title": "", + "type": "object", + "properties": { + "password": { + "type": "string", + "description": "Password(7-24 characters, must contain letters and numbers, cannot only contain numbers or include special characters)" + }, + "remarks": { + "type": "string", + "description": "Remarks(1~24 characters)" + }, + "subName": { + "type": "string", + "description": "Sub-account name(must contain 7-32 characters, at least one number and one letter. Cannot contain any spaces.)" + }, + "access": { + "type": "string", + "description": "Permission (types include Spot, Futures, Margin permissions, which can be used alone or in combination).", + "enum": [ + "Spot", + "Futures", + "Margin" + ], + "x-api-enum": [ + { + "value": "Spot", + "name": "", + "description": "Spot Account" + }, + { + "value": "Futures", + "name": "", + "description": "Futures Account" + }, + { + "value": "Margin", + "name": "", + "description": "Margin Account" + } + ] + } + }, + "required": [ + "password", + "subName", + "access" + ] + }, + "example": "{\n \"password\": \"1234567\",\n \"remarks\": \"TheRemark\",\n \"subName\": \"Name1234567\",\n \"access\": \"Spot\"\n}" + } + } + }, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"currentPage\\\": 1,\\n \\\"pageSize\\\": 10,\\n \\\"totalNum\\\": 1,\\n \\\"totalPage\\\": 1,\\n \\\"items\\\": [\\n {\\n \\\"userId\\\": \\\"63743f07e0c5230001761d08\\\",\\n \\\"uid\\\": 169579801,\\n \\\"subName\\\": \\\"testapi6\\\",\\n \\\"status\\\": 2,\\n \\\"type\\\": 0,\\n \\\"access\\\": \\\"All\\\",\\n \\\"createdAt\\\": 1668562696000,\\n \\\"remarks\\\": \\\"remarks\\\",\\n \\\"tradeTypes\\\": [\\n \\\"Spot\\\",\\n \\\"Futures\\\",\\n \\\"Margin\\\"\\n ],\\n \\\"openedTradeTypes\\\": [\\n \\\"Spot\\\"\\n ],\\n \\\"hostedStatus\\\": null\\n }\\n ]\\n }\\n}", + "x-request-example": "{\\\"password\\\": \\\"1234567\\\", \\\"remarks\\\": \\\"TheRemark\\\", \\\"subName\\\": \\\"Name1234567\\\", \\\"access\\\": \\\"Spot\\\"}" + } + }, + "/api/v3/sub/user/margin/enable": { + "post": { + "summary": "Add SubAccount Margin Permission", + "deprecated": false, + "description": "This endpoint can be used to add sub-accounts Margin permission. Before using this endpoints, you need to ensure that the master account apikey has Margin permissions and the Margin function has been activated.", + "tags": [], + "parameters": [], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "string" + } + }, + "required": [ + "code", + "data" + ] + } + } + } + } + }, + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470331", + "x-abandon": "normal", + "x-domain": "Spot", + "x-api-channel": "Private", + "x-api-permission": "Margin", + "x-api-rate-limit-pool": "Management", + "x-sdk-service": "Account", + "x-sdk-sub-service": "SubAccount", + "x-sdk-method-name": "addSubAccountMarginPermission", + "x-sdk-method-description": "This endpoint can be used to add sub-accounts Margin permission. Before using this endpoints, you need to ensure that the master account apikey has Margin permissions and the Margin function has been activated.", + "x-api-rate-limit": 15, + "requestBody": { + "content": { + "application/json": { + "schema": { + "title": "", + "type": "object", + "properties": { + "uid": { + "type": "string", + "description": "Sub account UID" + } + }, + "required": [ + "uid" + ] + }, + "example": "{\n \"uid\": \"169579801\"\n}" + } + } + }, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": null\\n}", + "x-request-example": "{\\\"uid\\\": \\\"169579801\\\"}" + } + }, + "/api/v3/sub/user/futures/enable": { + "post": { + "summary": "Add SubAccount Futures Permission", + "deprecated": false, + "description": "This endpoint can be used to add sub-accounts Futures permission. Before using this endpoints, you need to ensure that the master account apikey has Futures permissions and the Futures function has been activated.", + "tags": [], + "parameters": [], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "boolean" + } + }, + "required": [ + "code", + "data" + ] + } + } + } + } + }, + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470332", + "x-abandon": "normal", + "x-domain": "Spot", + "x-api-channel": "Private", + "x-api-permission": "Futures", + "x-api-rate-limit-pool": "Management", + "x-sdk-service": "Account", + "x-sdk-sub-service": "SubAccount", + "x-sdk-method-name": "addSubAccountFuturesPermission", + "x-sdk-method-description": "This endpoint can be used to add sub-accounts Futures permission. Before using this endpoints, you need to ensure that the master account apikey has Futures permissions and the Futures function has been activated.", + "x-api-rate-limit": 15, + "requestBody": { + "content": { + "application/json": { + "schema": { + "title": "", + "type": "object", + "properties": { + "uid": { + "type": "string", + "description": "Sub account UID" + } + }, + "required": [ + "uid" + ] + }, + "example": "{\n \"uid\": \"169579801\"\n}" + } + } + }, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": null\\n}", + "x-request-example": "{\\\"uid\\\": \\\"169579801\\\"}" + } + }, "/api/v2/sub/user": { "get": { "summary": "Get SubAccount List - Summary Info", @@ -836,11 +1094,11 @@ "x-request-example": "{\\\"currency\\\": \\\"USDT\\\"}" } }, - "/api/v2/sub/user/created": { + "/api/v1/sub/api-key": { "post": { - "summary": "Add SubAccount", + "summary": "Add SubAccount API", "deprecated": false, - "description": "This endpoint can be used to create sub-accounts.", + "description": "This endpoint can be used to create APIs for sub-accounts.", "tags": [], "parameters": [], "responses": { @@ -857,28 +1115,53 @@ "data": { "type": "object", "properties": { - "uid": { - "type": "integer", - "description": "Sub-account UID" - }, "subName": { "type": "string", "description": "Sub-account name" }, - "remarks": { + "remark": { "type": "string", "description": "Remarks" }, - "access": { + "apiKey": { "type": "string", - "description": "Permission" + "description": "API Key" + }, + "apiSecret": { + "type": "string", + "description": "API Secret Key\n" + }, + "apiVersion": { + "type": "integer", + "description": "API Version" + }, + "passphrase": { + "type": "string", + "description": "Password" + }, + "permission": { + "type": "string", + "description": "[Permissions](https://www.kucoin.com/docs-new/doc-338144)" + }, + "ipWhitelist": { + "type": "string", + "description": "IP whitelist" + }, + "createdAt": { + "type": "integer", + "description": "Time of the event", + "format": "int64" } }, "required": [ - "uid", "subName", - "remarks", - "access" + "remark", + "apiKey", + "apiSecret", + "apiVersion", + "passphrase", + "permission", + "createdAt" ] } }, @@ -891,7 +1174,7 @@ } } }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470135", + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470138", "x-abandon": "normal", "x-domain": "Spot", "x-api-channel": "Private", @@ -899,9 +1182,9 @@ "x-api-rate-limit-pool": "Management", "x-sdk-service": "Account", "x-sdk-sub-service": "SubAccount", - "x-sdk-method-name": "addSubAccount", - "x-sdk-method-description": "This endpoint can be used to create sub-accounts.", - "x-api-rate-limit": 15, + "x-sdk-method-name": "addSubAccountApi", + "x-sdk-method-description": "This endpoint can be used to create APIs for sub-accounts.", + "x-api-rate-limit": 20, "requestBody": { "content": { "application/json": { @@ -909,192 +1192,86 @@ "title": "", "type": "object", "properties": { - "password": { + "passphrase": { "type": "string", - "description": "Password(7-24 characters, must contain letters and numbers, cannot only contain numbers or include special characters)" + "description": "Password(Must contain 7-32 characters. Cannot contain any spaces.)" }, - "remarks": { + "remark": { "type": "string", "description": "Remarks(1~24 characters)" }, - "subName": { + "permission": { "type": "string", - "description": "Sub-account name(must contain 7-32 characters, at least one number and one letter. Cannot contain any spaces.)" + "description": "[Permissions](https://www.kucoin.com/docs-new/doc-338144)(Only General、Spot、Futures、Margin、InnerTransfer(Flex Transfer) permissions can be set, such as \"General, Trade\". The default is \"General\")", + "default": "General", + "example": [ + "General, Trade" + ] }, - "access": { + "ipWhitelist": { "type": "string", - "description": "Permission (types include Spot, Futures, Margin permissions, which can be used alone or in combination).", - "enum": [ - "Spot", - "Futures", - "Margin" - ], - "x-api-enum": [ - { - "value": "Spot", - "name": "", - "description": "Spot Account" - }, - { - "value": "Futures", - "name": "", - "description": "Futures Account" - }, - { - "value": "Margin", - "name": "", - "description": "Margin Account" - } - ] - } - }, - "required": [ - "password", - "subName", - "access" - ] - }, - "example": "{\n \"password\": \"1234567\",\n \"remarks\": \"TheRemark\",\n \"subName\": \"Name1234567\",\n \"access\": \"Spot\"\n}" - } - } - }, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"currentPage\\\": 1,\\n \\\"pageSize\\\": 10,\\n \\\"totalNum\\\": 1,\\n \\\"totalPage\\\": 1,\\n \\\"items\\\": [\\n {\\n \\\"userId\\\": \\\"63743f07e0c5230001761d08\\\",\\n \\\"uid\\\": 169579801,\\n \\\"subName\\\": \\\"testapi6\\\",\\n \\\"status\\\": 2,\\n \\\"type\\\": 0,\\n \\\"access\\\": \\\"All\\\",\\n \\\"createdAt\\\": 1668562696000,\\n \\\"remarks\\\": \\\"remarks\\\",\\n \\\"tradeTypes\\\": [\\n \\\"Spot\\\",\\n \\\"Futures\\\",\\n \\\"Margin\\\"\\n ],\\n \\\"openedTradeTypes\\\": [\\n \\\"Spot\\\"\\n ],\\n \\\"hostedStatus\\\": null\\n }\\n ]\\n }\\n}", - "x-request-example": "{\\\"password\\\": \\\"1234567\\\", \\\"remarks\\\": \\\"TheRemark\\\", \\\"subName\\\": \\\"Name1234567\\\", \\\"access\\\": \\\"Spot\\\"}" - } - }, - "/api/v3/sub/user/margin/enable": { - "post": { - "summary": "Add SubAccount Margin Permission", - "deprecated": false, - "description": "This endpoint can be used to add sub-accounts Margin permission. Before using this endpoints, you need to ensure that the master account apikey has Margin permissions and the Margin function has been activated.", - "tags": [], - "parameters": [], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "data": { - "type": "string" - } + "description": "IP whitelist(You may add up to 20 IPs. Use a halfwidth comma to each IP)" }, - "required": [ - "code", - "data" - ] - } - } - } - } - }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470331", - "x-abandon": "normal", - "x-domain": "Spot", - "x-api-channel": "Private", - "x-api-permission": "Margin", - "x-api-rate-limit-pool": "Management", - "x-sdk-service": "Account", - "x-sdk-sub-service": "SubAccount", - "x-sdk-method-name": "addSubAccountMarginPermission", - "x-sdk-method-description": "This endpoint can be used to add sub-accounts Margin permission. Before using this endpoints, you need to ensure that the master account apikey has Margin permissions and the Margin function has been activated.", - "x-api-rate-limit": 15, - "requestBody": { - "content": { - "application/json": { - "schema": { - "title": "", - "type": "object", - "properties": { - "uid": { + "expire": { "type": "string", - "description": "Sub account UID" - } - }, - "required": [ - "uid" - ] - }, - "example": "{\n \"uid\": \"169579801\"\n}" - } - } - }, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": null\\n}", - "x-request-example": "{\\\"uid\\\": \\\"169579801\\\"}" - } - }, - "/api/v3/sub/user/futures/enable": { - "post": { - "summary": "Add SubAccount Futures Permission", - "deprecated": false, - "description": "This endpoint can be used to add sub-accounts Futures permission. Before using this endpoints, you need to ensure that the master account apikey has Futures permissions and the Futures function has been activated.", - "tags": [], - "parameters": [], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "data": { - "type": "boolean" - } + "description": "API expiration time; Never expire(default)-1,30Day30,90Day90,180Day180,360Day360", + "default": "-1", + "enum": [ + "-1", + "30", + "90", + "180", + "360" + ], + "x-api-enum": [ + { + "value": "-1", + "name": "", + "description": "" + }, + { + "value": "30", + "name": "", + "description": "" + }, + { + "value": "90", + "name": "", + "description": "" + }, + { + "value": "180", + "name": "", + "description": "" + }, + { + "value": "360", + "name": "", + "description": "" + } + ], + "example": [ + "30" + ] }, - "required": [ - "code", - "data" - ] - } - } - } - } - }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470332", - "x-abandon": "normal", - "x-domain": "Spot", - "x-api-channel": "Private", - "x-api-permission": "Futures", - "x-api-rate-limit-pool": "Management", - "x-sdk-service": "Account", - "x-sdk-sub-service": "SubAccount", - "x-sdk-method-name": "addSubAccountFuturesPermission", - "x-sdk-method-description": "This endpoint can be used to add sub-accounts Futures permission. Before using this endpoints, you need to ensure that the master account apikey has Futures permissions and the Futures function has been activated.", - "x-api-rate-limit": 15, - "requestBody": { - "content": { - "application/json": { - "schema": { - "title": "", - "type": "object", - "properties": { - "uid": { + "subName": { "type": "string", - "description": "Sub account UID" + "description": "Sub-account name, create sub account name of API Key." } }, "required": [ - "uid" + "subName", + "remark", + "passphrase" ] }, - "example": "{\n \"uid\": \"169579801\"\n}" + "example": "{\n \"subName\": \"testapi6\",\n \"passphrase\": \"11223344\",\n \"remark\": \"TheRemark\",\n \"permission\": \"General,Spot,Futures\"\n}" } } }, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": null\\n}", - "x-request-example": "{\\\"uid\\\": \\\"169579801\\\"}" - } - }, - "/api/v1/sub/api-key": { + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"subName\\\": \\\"testapi6\\\",\\n \\\"remark\\\": \\\"TheRemark\\\",\\n \\\"apiKey\\\": \\\"670621e3a25958000159c82f\\\",\\n \\\"apiSecret\\\": \\\"46fd8974******896f005b2340\\\",\\n \\\"apiVersion\\\": 3,\\n \\\"passphrase\\\": \\\"11223344\\\",\\n \\\"permission\\\": \\\"General,Futures\\\",\\n \\\"createdAt\\\": 1728455139000\\n }\\n}", + "x-request-example": "{\\\"subName\\\": \\\"testapi6\\\", \\\"passphrase\\\": \\\"11223344\\\", \\\"remark\\\": \\\"TheRemark\\\", \\\"permission\\\": \\\"General,Spot,Futures\\\"}" + }, "get": { "summary": "Get SubAccount API List", "deprecated": false, @@ -1285,183 +1462,6 @@ "x-api-rate-limit": 30, "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"subName\\\":\\\"testapi6\\\",\\\"apiKey\\\":\\\"670621e3a25958000159c82f\\\"}}", "x-request-example": "{\\\"apiKey\\\": \\\"670621e3a25958000159c82f\\\", \\\"subName\\\": \\\"testapi6\\\", \\\"passphrase\\\": \\\"11223344\\\"}" - }, - "post": { - "summary": "Add SubAccount API", - "deprecated": false, - "description": "This endpoint can be used to create APIs for sub-accounts.", - "tags": [], - "parameters": [], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "data": { - "type": "object", - "properties": { - "subName": { - "type": "string", - "description": "Sub-account name" - }, - "remark": { - "type": "string", - "description": "Remarks" - }, - "apiKey": { - "type": "string", - "description": "API Key" - }, - "apiSecret": { - "type": "string", - "description": "API Secret Key\n" - }, - "apiVersion": { - "type": "integer", - "description": "API Version" - }, - "passphrase": { - "type": "string", - "description": "Password" - }, - "permission": { - "type": "string", - "description": "[Permissions](https://www.kucoin.com/docs-new/doc-338144)" - }, - "ipWhitelist": { - "type": "string", - "description": "IP whitelist" - }, - "createdAt": { - "type": "integer", - "description": "Time of the event", - "format": "int64" - } - }, - "required": [ - "subName", - "remark", - "apiKey", - "apiSecret", - "apiVersion", - "passphrase", - "permission", - "createdAt" - ] - } - }, - "required": [ - "code", - "data" - ] - } - } - } - } - }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470138", - "x-abandon": "normal", - "x-domain": "Spot", - "x-api-channel": "Private", - "x-api-permission": "General", - "x-api-rate-limit-pool": "Management", - "x-sdk-service": "Account", - "x-sdk-sub-service": "SubAccount", - "x-sdk-method-name": "addSubAccountApi", - "x-sdk-method-description": "This endpoint can be used to create APIs for sub-accounts.", - "x-api-rate-limit": 20, - "requestBody": { - "content": { - "application/json": { - "schema": { - "title": "", - "type": "object", - "properties": { - "passphrase": { - "type": "string", - "description": "Password(Must contain 7-32 characters. Cannot contain any spaces.)" - }, - "remark": { - "type": "string", - "description": "Remarks(1~24 characters)" - }, - "permission": { - "type": "string", - "description": "[Permissions](https://www.kucoin.com/docs-new/doc-338144)(Only General、Spot、Futures、Margin、InnerTransfer(Flex Transfer) permissions can be set, such as \"General, Trade\". The default is \"General\")", - "default": "General", - "example": [ - "General, Trade" - ] - }, - "ipWhitelist": { - "type": "string", - "description": "IP whitelist(You may add up to 20 IPs. Use a halfwidth comma to each IP)" - }, - "expire": { - "type": "string", - "description": "API expiration time; Never expire(default)-1,30Day30,90Day90,180Day180,360Day360", - "default": "-1", - "enum": [ - "-1", - "30", - "90", - "180", - "360" - ], - "x-api-enum": [ - { - "value": "-1", - "name": "", - "description": "" - }, - { - "value": "30", - "name": "", - "description": "" - }, - { - "value": "90", - "name": "", - "description": "" - }, - { - "value": "180", - "name": "", - "description": "" - }, - { - "value": "360", - "name": "", - "description": "" - } - ], - "example": [ - "30" - ] - }, - "subName": { - "type": "string", - "description": "Sub-account name, create sub account name of API Key." - } - }, - "required": [ - "subName", - "remark", - "passphrase" - ] - }, - "example": "{\n \"subName\": \"testapi6\",\n \"passphrase\": \"11223344\",\n \"remark\": \"TheRemark\",\n \"permission\": \"General,Spot,Futures\"\n}" - } - } - }, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"subName\\\": \\\"testapi6\\\",\\n \\\"remark\\\": \\\"TheRemark\\\",\\n \\\"apiKey\\\": \\\"670621e3a25958000159c82f\\\",\\n \\\"apiSecret\\\": \\\"46fd8974******896f005b2340\\\",\\n \\\"apiVersion\\\": 3,\\n \\\"passphrase\\\": \\\"11223344\\\",\\n \\\"permission\\\": \\\"General,Futures\\\",\\n \\\"createdAt\\\": 1728455139000\\n }\\n}", - "x-request-example": "{\\\"subName\\\": \\\"testapi6\\\", \\\"passphrase\\\": \\\"11223344\\\", \\\"remark\\\": \\\"TheRemark\\\", \\\"permission\\\": \\\"General,Spot,Futures\\\"}" } }, "/api/v1/sub/api-key/update": { diff --git a/spec/rest/api/openapi-account-transfer.json b/spec/rest/api/openapi-account-transfer.json index 954df246..75a39cfe 100644 --- a/spec/rest/api/openapi-account-transfer.json +++ b/spec/rest/api/openapi-account-transfer.json @@ -7,6 +7,153 @@ }, "tags": [], "paths": { + "/api/v1/accounts/transferable": { + "get": { + "summary": "Get Transfer Quotas", + "deprecated": false, + "description": "This endpoint returns the transferable balance of a specified account.", + "tags": [], + "parameters": [ + { + "name": "currency", + "in": "query", + "description": "currency", + "required": true, + "schema": { + "type": "string", + "example": [ + "BTC", + "ETH", + "USDT" + ] + } + }, + { + "name": "type", + "in": "query", + "description": "The account type:MAIN、TRADE、MARGIN、ISOLATED", + "required": true, + "schema": { + "type": "string", + "enum": [ + "MAIN", + "TRADE", + "MARGIN", + "ISOLATED", + "OPTION" + ], + "x-api-enum": [ + { + "value": "MAIN", + "name": "MAIN", + "description": "Funding account" + }, + { + "value": "TRADE", + "name": "TRADE", + "description": "Spot account" + }, + { + "value": "MARGIN", + "name": "MARGIN", + "description": "Cross margin account" + }, + { + "value": "ISOLATED", + "name": "ISOLATED", + "description": "Isolated margin account" + }, + { + "value": "OPTION", + "name": "OPTION", + "description": "Option account" + } + ] + } + }, + { + "name": "tag", + "in": "query", + "description": "Trading pair, required when the account type is ISOLATED; other types are not passed, e.g.: BTC-USDT", + "required": false, + "schema": { + "type": "string", + "default": "BTC-USDT", + "example": [ + "ETH-USDT", + "KCS-USDT" + ] + } + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "object", + "properties": { + "currency": { + "type": "string", + "description": "Currency" + }, + "balance": { + "type": "string", + "description": "Total funds in an account." + }, + "available": { + "type": "string", + "description": "Funds available to withdraw or trade." + }, + "holds": { + "type": "string", + "description": "Funds on hold (not available for use)." + }, + "transferable": { + "type": "string", + "description": "Funds available to transfer." + } + }, + "required": [ + "currency", + "balance", + "available", + "holds", + "transferable" + ] + } + }, + "required": [ + "code", + "data" + ] + } + } + } + } + }, + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470148", + "x-abandon": "normal", + "x-domain": "Spot", + "x-api-channel": "Private", + "x-api-permission": "General", + "x-api-rate-limit-pool": "Management", + "x-sdk-service": "Account", + "x-sdk-sub-service": "Transfer", + "x-sdk-method-name": "getTransferQuotas", + "x-sdk-method-description": "This endpoint returns the transferable balance of a specified account.", + "x-api-rate-limit": 20, + "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"currency\\\":\\\"USDT\\\",\\\"balance\\\":\\\"10.5\\\",\\\"available\\\":\\\"10.5\\\",\\\"holds\\\":\\\"0\\\",\\\"transferable\\\":\\\"10.5\\\"}}", + "x-request-example": "{\\\"currency\\\": \\\"BTC\\\", \\\"type\\\": \\\"MAIN\\\", \\\"tag\\\": \\\"ETH-USDT\\\"}" + } + }, "/api/v3/accounts/universal-transfer": { "post": { "summary": "Flex Transfer", @@ -249,153 +396,6 @@ "x-request-example": "{\\\"clientOid\\\": \\\"64ccc0f164781800010d8c09\\\", \\\"type\\\": \\\"PARENT_TO_SUB\\\", \\\"currency\\\": \\\"USDT\\\", \\\"amount\\\": \\\"0.01\\\", \\\"fromAccountType\\\": \\\"TRADE\\\", \\\"toUserId\\\": \\\"63743f07e0c5230001761d08\\\", \\\"toAccountType\\\": \\\"TRADE\\\"}" } }, - "/api/v1/accounts/transferable": { - "get": { - "summary": "Get Transfer Quotas", - "deprecated": false, - "description": "This endpoint returns the transferable balance of a specified account.", - "tags": [], - "parameters": [ - { - "name": "currency", - "in": "query", - "description": "currency", - "required": true, - "schema": { - "type": "string", - "example": [ - "BTC", - "ETH", - "USDT" - ] - } - }, - { - "name": "type", - "in": "query", - "description": "The account type:MAIN、TRADE、MARGIN、ISOLATED", - "required": true, - "schema": { - "type": "string", - "enum": [ - "MAIN", - "TRADE", - "MARGIN", - "ISOLATED", - "OPTION" - ], - "x-api-enum": [ - { - "value": "MAIN", - "name": "MAIN", - "description": "Funding account" - }, - { - "value": "TRADE", - "name": "TRADE", - "description": "Spot account" - }, - { - "value": "MARGIN", - "name": "MARGIN", - "description": "Cross margin account" - }, - { - "value": "ISOLATED", - "name": "ISOLATED", - "description": "Isolated margin account" - }, - { - "value": "OPTION", - "name": "OPTION", - "description": "Option account" - } - ] - } - }, - { - "name": "tag", - "in": "query", - "description": "Trading pair, required when the account type is ISOLATED; other types are not passed, e.g.: BTC-USDT", - "required": false, - "schema": { - "type": "string", - "default": "BTC-USDT", - "example": [ - "ETH-USDT", - "KCS-USDT" - ] - } - } - ], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "data": { - "type": "object", - "properties": { - "currency": { - "type": "string", - "description": "Currency" - }, - "balance": { - "type": "string", - "description": "Total funds in an account." - }, - "available": { - "type": "string", - "description": "Funds available to withdraw or trade." - }, - "holds": { - "type": "string", - "description": "Funds on hold (not available for use)." - }, - "transferable": { - "type": "string", - "description": "Funds available to transfer." - } - }, - "required": [ - "currency", - "balance", - "available", - "holds", - "transferable" - ] - } - }, - "required": [ - "code", - "data" - ] - } - } - } - } - }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470148", - "x-abandon": "normal", - "x-domain": "Spot", - "x-api-channel": "Private", - "x-api-permission": "General", - "x-api-rate-limit-pool": "Management", - "x-sdk-service": "Account", - "x-sdk-sub-service": "Transfer", - "x-sdk-method-name": "getTransferQuotas", - "x-sdk-method-description": "This endpoint returns the transferable balance of a specified account.", - "x-api-rate-limit": 20, - "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"currency\\\":\\\"USDT\\\",\\\"balance\\\":\\\"10.5\\\",\\\"available\\\":\\\"10.5\\\",\\\"holds\\\":\\\"0\\\",\\\"transferable\\\":\\\"10.5\\\"}}", - "x-request-example": "{\\\"currency\\\": \\\"BTC\\\", \\\"type\\\": \\\"MAIN\\\", \\\"tag\\\": \\\"ETH-USDT\\\"}" - } - }, "/api/v2/accounts/sub-transfer": { "post": { "summary": "SubAccount Transfer", diff --git a/spec/rest/api/openapi-account-withdrawal.json b/spec/rest/api/openapi-account-withdrawal.json index 59dfd01c..b1b88a10 100644 --- a/spec/rest/api/openapi-account-withdrawal.json +++ b/spec/rest/api/openapi-account-withdrawal.json @@ -181,6 +181,169 @@ "x-request-example": "{\\\"currency\\\": \\\"BTC\\\", \\\"chain\\\": \\\"eth\\\"}" } }, + "/api/v3/withdrawals": { + "post": { + "summary": "Withdraw(V3)", + "deprecated": false, + "description": "Use this interface to withdraw the specified currency", + "tags": [], + "parameters": [], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "object", + "properties": { + "withdrawalId": { + "type": "string", + "description": "Withdrawal id, a unique ID for a withdrawal" + } + }, + "required": [ + "withdrawalId" + ] + } + }, + "required": [ + "code", + "data" + ] + } + } + } + } + }, + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470146", + "x-abandon": "normal", + "x-domain": "Spot", + "x-api-channel": "Private", + "x-api-permission": "Withdrawal", + "x-api-rate-limit-pool": "Management", + "x-sdk-service": "Account", + "x-sdk-sub-service": "Withdrawal", + "x-sdk-method-name": "withdrawalV3", + "x-sdk-method-description": "Use this interface to withdraw the specified currency", + "x-api-rate-limit": 5, + "requestBody": { + "content": { + "application/json": { + "schema": { + "title": "", + "type": "object", + "properties": { + "currency": { + "type": "string", + "description": "currency", + "example": [ + "BTC", + "ETH", + "USDT" + ] + }, + "chain": { + "type": "string", + "description": "The chainId of currency, For a currency with multiple chains, it is recommended to specify chain parameter instead of using the default chain; you can query the chainId through the response of the GET /api/v3/currencies/{currency} interface.", + "default": "eth", + "example": [ + "eth", + "bech32", + "btc", + "kcc", + "trx", + "bsc", + "arbitrum", + "ton", + "optimism" + ] + }, + "amount": { + "type": "integer", + "format": "int64", + "description": "Withdrawal amount, a positive number which is a multiple of the amount precision" + }, + "memo": { + "type": "string", + "description": "Address remark. If there’s no remark, it is empty. When you withdraw from other platforms to the KuCoin, you need to fill in memo(tag). If you do not fill memo (tag), your deposit may not be available, please be cautious." + }, + "isInner": { + "type": "boolean", + "description": "Internal withdrawal or not. Default : false", + "default": false + }, + "remark": { + "type": "string", + "description": "remark" + }, + "feeDeductType": { + "type": "string", + "description": "Withdrawal fee deduction type: INTERNAL or EXTERNAL or not specified\n\n1. INTERNAL- deduct the transaction fees from your withdrawal amount\n2. EXTERNAL- deduct the transaction fees from your main account\n3. If you don't specify the feeDeductType parameter, when the balance in your main account is sufficient to support the withdrawal, the system will initially deduct the transaction fees from your main account. But if the balance in your main account is not sufficient to support the withdrawal, the system will deduct the fees from your withdrawal amount. For example: Suppose you are going to withdraw 1 BTC from the KuCoin platform (transaction fee: 0.0001BTC), if the balance in your main account is insufficient, the system will deduct the transaction fees from your withdrawal amount. In this case, you will be receiving 0.9999BTC." + }, + "toAddress": { + "type": "string", + "description": "Withdrawal address", + "example": [ + "0x023****2355", + "1572**401", + "a431***1e@gmail.com", + "55-12341234" + ] + }, + "withdrawType": { + "type": "string", + "description": "Withdrawal type, ADDRESS (withdrawal address), UID, MAIL (email), PHONE (mobile phone number). Note: If you withdraw by uid/mail/phone, there will have rate limited: 3 times/10 seconds, 50 times/24 hours (calculated on a rolling basis based on the first request time)", + "enum": [ + "ADDRESS", + "UID", + "MAIL", + "PHONE" + ], + "x-api-enum": [ + { + "value": "ADDRESS", + "name": "", + "description": "" + }, + { + "value": "UID", + "name": "", + "description": "" + }, + { + "value": "MAIL", + "name": "", + "description": "" + }, + { + "value": "PHONE", + "name": "", + "description": "" + } + ] + } + }, + "required": [ + "currency", + "toAddress", + "amount", + "withdrawType" + ] + }, + "example": "{\n \"currency\": \"USDT\",\n \"toAddress\": \"TKFRQXSDcY****GmLrjJggwX8\",\n \"amount\": 3,\n \"withdrawType\": \"ADDRESS\",\n \"chain\": \"trx\",\n \"isInner\": true,\n \"remark\": \"this is Remark\"\n}" + } + } + }, + "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"withdrawalId\\\":\\\"670deec84d64da0007d7c946\\\"}}", + "x-request-example": "{\\\"currency\\\": \\\"USDT\\\", \\\"toAddress\\\": \\\"TKFRQXSDcY****GmLrjJggwX8\\\", \\\"amount\\\": 3, \\\"withdrawType\\\": \\\"ADDRESS\\\", \\\"chain\\\": \\\"trx\\\", \\\"isInner\\\": true, \\\"remark\\\": \\\"this is Remark\\\"}" + } + }, "/api/v1/withdrawals/{withdrawalId}": { "delete": { "summary": "Cancel Withdrawal", @@ -625,169 +788,6 @@ "x-request-example": "{\\\"currency\\\": \\\"USDT\\\", \\\"address\\\": \\\"TKFRQXSDc****16GmLrjJggwX8\\\", \\\"amount\\\": 3, \\\"chain\\\": \\\"trx\\\", \\\"isInner\\\": true}" } }, - "/api/v3/withdrawals": { - "post": { - "summary": "Withdraw(V3)", - "deprecated": false, - "description": "Use this interface to withdraw the specified currency", - "tags": [], - "parameters": [], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "data": { - "type": "object", - "properties": { - "withdrawalId": { - "type": "string", - "description": "Withdrawal id, a unique ID for a withdrawal" - } - }, - "required": [ - "withdrawalId" - ] - } - }, - "required": [ - "code", - "data" - ] - } - } - } - } - }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470146", - "x-abandon": "normal", - "x-domain": "Spot", - "x-api-channel": "Private", - "x-api-permission": "Withdrawal", - "x-api-rate-limit-pool": "Management", - "x-sdk-service": "Account", - "x-sdk-sub-service": "Withdrawal", - "x-sdk-method-name": "withdrawalV3", - "x-sdk-method-description": "Use this interface to withdraw the specified currency", - "x-api-rate-limit": 5, - "requestBody": { - "content": { - "application/json": { - "schema": { - "title": "", - "type": "object", - "properties": { - "currency": { - "type": "string", - "description": "currency", - "example": [ - "BTC", - "ETH", - "USDT" - ] - }, - "chain": { - "type": "string", - "description": "The chainId of currency, For a currency with multiple chains, it is recommended to specify chain parameter instead of using the default chain; you can query the chainId through the response of the GET /api/v3/currencies/{currency} interface.", - "default": "eth", - "example": [ - "eth", - "bech32", - "btc", - "kcc", - "trx", - "bsc", - "arbitrum", - "ton", - "optimism" - ] - }, - "amount": { - "type": "integer", - "format": "int64", - "description": "Withdrawal amount, a positive number which is a multiple of the amount precision" - }, - "memo": { - "type": "string", - "description": "Address remark. If there’s no remark, it is empty. When you withdraw from other platforms to the KuCoin, you need to fill in memo(tag). If you do not fill memo (tag), your deposit may not be available, please be cautious." - }, - "isInner": { - "type": "boolean", - "description": "Internal withdrawal or not. Default : false", - "default": false - }, - "remark": { - "type": "string", - "description": "remark" - }, - "feeDeductType": { - "type": "string", - "description": "Withdrawal fee deduction type: INTERNAL or EXTERNAL or not specified\n\n1. INTERNAL- deduct the transaction fees from your withdrawal amount\n2. EXTERNAL- deduct the transaction fees from your main account\n3. If you don't specify the feeDeductType parameter, when the balance in your main account is sufficient to support the withdrawal, the system will initially deduct the transaction fees from your main account. But if the balance in your main account is not sufficient to support the withdrawal, the system will deduct the fees from your withdrawal amount. For example: Suppose you are going to withdraw 1 BTC from the KuCoin platform (transaction fee: 0.0001BTC), if the balance in your main account is insufficient, the system will deduct the transaction fees from your withdrawal amount. In this case, you will be receiving 0.9999BTC." - }, - "toAddress": { - "type": "string", - "description": "Withdrawal address", - "example": [ - "0x023****2355", - "1572**401", - "a431***1e@gmail.com", - "55-12341234" - ] - }, - "withdrawType": { - "type": "string", - "description": "Withdrawal type, ADDRESS (withdrawal address), UID, MAIL (email), PHONE (mobile phone number). Note: If you withdraw by uid/mail/phone, there will have rate limited: 3 times/10 seconds, 50 times/24 hours (calculated on a rolling basis based on the first request time)", - "enum": [ - "ADDRESS", - "UID", - "MAIL", - "PHONE" - ], - "x-api-enum": [ - { - "value": "ADDRESS", - "name": "", - "description": "" - }, - { - "value": "UID", - "name": "", - "description": "" - }, - { - "value": "MAIL", - "name": "", - "description": "" - }, - { - "value": "PHONE", - "name": "", - "description": "" - } - ] - } - }, - "required": [ - "currency", - "toAddress", - "amount", - "withdrawType" - ] - }, - "example": "{\n \"currency\": \"USDT\",\n \"toAddress\": \"TKFRQXSDcY****GmLrjJggwX8\",\n \"amount\": 3,\n \"withdrawType\": \"ADDRESS\",\n \"chain\": \"trx\",\n \"isInner\": true,\n \"remark\": \"this is Remark\"\n}" - } - } - }, - "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"withdrawalId\\\":\\\"670deec84d64da0007d7c946\\\"}}", - "x-request-example": "{\\\"currency\\\": \\\"USDT\\\", \\\"toAddress\\\": \\\"TKFRQXSDcY****GmLrjJggwX8\\\", \\\"amount\\\": 3, \\\"withdrawType\\\": \\\"ADDRESS\\\", \\\"chain\\\": \\\"trx\\\", \\\"isInner\\\": true, \\\"remark\\\": \\\"this is Remark\\\"}" - } - }, "/api/v1/hist-withdrawals": { "get": { "summary": "Get Withdrawal History - Old", diff --git a/spec/rest/api/openapi-broker-ndbroker.json b/spec/rest/api/openapi-broker-ndbroker.json index 78e25f34..f5276f48 100644 --- a/spec/rest/api/openapi-broker-ndbroker.json +++ b/spec/rest/api/openapi-broker-ndbroker.json @@ -7,17 +7,17 @@ }, "tags": [], "paths": { - "/api/v1/broker/nd/rebase/download": { + "/api/v1/broker/nd/info": { "get": { - "summary": "Get Broker Rebate", + "summary": "Get Broker Info", "deprecated": false, - "description": "This interface supports downloading Broker rebate orders", + "description": "This endpoint supports querying the basic information of the current Broker", "tags": [], "parameters": [ { "name": "begin", "in": "query", - "description": "Start time, for example: 20240610", + "description": "Start time, for example: 20230110", "required": true, "schema": { "type": "string" @@ -26,7 +26,7 @@ { "name": "end", "in": "query", - "description": "End time, for example: 20241010 (query data with a maximum interval of 6 months)\n", + "description": "End time, for example: 20230210 (query data with a maximum interval of 6 months)\n", "required": true, "schema": { "type": "string" @@ -72,13 +72,23 @@ "data": { "type": "object", "properties": { - "url": { - "type": "string", - "description": "Rebate order file (link is valid for 1 day)" + "accountSize": { + "type": "integer", + "description": "Number of sub-accounts created" + }, + "maxAccountSize": { + "type": "integer", + "description": "The maximum number of sub-accounts allowed to be created, null means no limit" + }, + "level": { + "type": "integer", + "description": "Broker level" } }, "required": [ - "url" + "accountSize", + "maxAccountSize", + "level" ] } }, @@ -91,7 +101,7 @@ } } }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470281", + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470282", "x-abandon": "normal", "x-domain": "Broker", "x-api-channel": "Private", @@ -99,64 +109,20 @@ "x-api-rate-limit-pool": "Broker", "x-sdk-service": "Broker", "x-sdk-sub-service": "NDBroker", - "x-sdk-method-name": "getRebase", - "x-sdk-method-description": "This interface supports downloading Broker rebate orders", - "x-api-rate-limit": 3, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"url\\\": \\\"https://kc-v2-promotion.s3.ap-northeast-1.amazonaws.com/broker/671aec522593f600019766d0_file.csv?X-Amz-Security-Token=IQo*********2cd90f14efb\\\"\\n }\\n}", - "x-request-example": "{\\\"begin\\\": \\\"20240610\\\", \\\"end\\\": \\\"20241010\\\", \\\"tradeType\\\": \\\"1\\\"}" + "x-sdk-method-name": "getBrokerInfo", + "x-sdk-method-description": "This endpoint supports querying the basic information of the current Broker", + "x-api-rate-limit": 2, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"accountSize\\\": 0,\\n \\\"maxAccountSize\\\": null,\\n \\\"level\\\": 0\\n }\\n}", + "x-request-example": "{\\\"begin\\\": \\\"20240510\\\", \\\"end\\\": \\\"20241010\\\", \\\"tradeType\\\": \\\"1\\\"}" } }, - "/api/v1/broker/nd/info": { - "get": { - "summary": "Get Broker Info", + "/api/v1/broker/nd/account": { + "post": { + "summary": "Add SubAccount", "deprecated": false, - "description": "This endpoint supports querying the basic information of the current Broker", + "description": "This endpoint supports Broker users to create sub-accounts", "tags": [], - "parameters": [ - { - "name": "begin", - "in": "query", - "description": "Start time, for example: 20230110", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "end", - "in": "query", - "description": "End time, for example: 20230210 (query data with a maximum interval of 6 months)\n", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "tradeType", - "in": "query", - "description": "Transaction type, 1: spot 2: futures", - "required": true, - "schema": { - "type": "string", - "enum": [ - "1", - "2" - ], - "x-api-enum": [ - { - "value": "1", - "name": "", - "description": "spot" - }, - { - "value": "2", - "name": "", - "description": "futures" - } - ] - } - } - ], + "parameters": [], "responses": { "200": { "description": "", @@ -171,22 +137,28 @@ "data": { "type": "object", "properties": { - "accountSize": { - "type": "integer", - "description": "Number of sub-accounts created" + "accountName": { + "type": "string", + "description": "Sub-Account name\n" }, - "maxAccountSize": { + "uid": { + "type": "string", + "description": "Sub-Account UID" + }, + "createdAt": { "type": "integer", - "description": "The maximum number of sub-accounts allowed to be created, null means no limit" + "description": "Creation time, unix timestamp (milliseconds)", + "format": "int64" }, "level": { "type": "integer", - "description": "Broker level" + "description": "Subaccount VIP level" } }, "required": [ - "accountSize", - "maxAccountSize", + "accountName", + "uid", + "createdAt", "level" ] } @@ -200,7 +172,7 @@ } } }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470282", + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470290", "x-abandon": "normal", "x-domain": "Broker", "x-api-channel": "Private", @@ -208,14 +180,31 @@ "x-api-rate-limit-pool": "Broker", "x-sdk-service": "Broker", "x-sdk-sub-service": "NDBroker", - "x-sdk-method-name": "getBrokerInfo", - "x-sdk-method-description": "This endpoint supports querying the basic information of the current Broker", - "x-api-rate-limit": 2, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"accountSize\\\": 0,\\n \\\"maxAccountSize\\\": null,\\n \\\"level\\\": 0\\n }\\n}", - "x-request-example": "{\\\"begin\\\": \\\"20240510\\\", \\\"end\\\": \\\"20241010\\\", \\\"tradeType\\\": \\\"1\\\"}" - } - }, - "/api/v1/broker/nd/account": { + "x-sdk-method-name": "addSubAccount", + "x-sdk-method-description": "This endpoint supports Broker users to create sub-accounts", + "x-api-rate-limit": 3, + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "accountName": { + "type": "string", + "description": "Sub Account Name, Note that this name is unique across the exchange. It is recommended to add a special identifier to prevent name duplication." + } + }, + "required": [ + "accountName" + ] + }, + "example": "{\n \"accountName\": \"Account1\"\n}" + } + } + }, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"accountName\\\": \\\"Account15\\\",\\n \\\"uid\\\": \\\"226383154\\\",\\n \\\"createdAt\\\": 1729819381908,\\n \\\"level\\\": 0\\n }\\n}", + "x-request-example": "{\\\"accountName\\\": \\\"Account1\\\"}" + }, "get": { "summary": "Get SubAccount", "deprecated": false, @@ -347,11 +336,13 @@ "x-api-rate-limit": 2, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"currentPage\\\": 1,\\n \\\"pageSize\\\": 20,\\n \\\"totalNum\\\": 1,\\n \\\"totalPage\\\": 1,\\n \\\"items\\\": [\\n {\\n \\\"accountName\\\": \\\"Account15\\\",\\n \\\"uid\\\": \\\"226383154\\\",\\n \\\"createdAt\\\": 1729819382000,\\n \\\"level\\\": 0\\n }\\n ]\\n }\\n}", "x-request-example": "{\\\"uid\\\": \\\"226383154\\\", \\\"currentPage\\\": 1, \\\"pageSize\\\": 20}" - }, + } + }, + "/api/v1/broker/nd/account/apikey": { "post": { - "summary": "Add SubAccount", + "summary": "Add SubAccount API", "deprecated": false, - "description": "This endpoint supports Broker users to create sub-accounts", + "description": "This interface supports the creation of Broker sub-account APIKEY", "tags": [], "parameters": [], "responses": { @@ -368,29 +359,55 @@ "data": { "type": "object", "properties": { - "accountName": { - "type": "string", - "description": "Sub-Account name\n" - }, "uid": { "type": "string", "description": "Sub-Account UID" }, + "label": { + "type": "string", + "description": "apikey remarks" + }, + "apiKey": { + "type": "string", + "description": "apiKey" + }, + "secretKey": { + "type": "string", + "description": "secretKey" + }, + "apiVersion": { + "type": "integer", + "description": "apiVersion" + }, + "permissions": { + "type": "array", + "items": { + "type": "string" + }, + "description": "[Permissions](https://www.kucoin.com/docs-new/doc-338144) group list" + }, + "ipWhitelist": { + "type": "array", + "items": { + "type": "string" + }, + "description": "IP whitelist list" + }, "createdAt": { "type": "integer", "description": "Creation time, unix timestamp (milliseconds)", "format": "int64" - }, - "level": { - "type": "integer", - "description": "Subaccount VIP level" } }, "required": [ - "accountName", "uid", - "createdAt", - "level" + "label", + "apiKey", + "secretKey", + "apiVersion", + "permissions", + "ipWhitelist", + "createdAt" ] } }, @@ -403,7 +420,7 @@ } } }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470290", + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470291", "x-abandon": "normal", "x-domain": "Broker", "x-api-channel": "Private", @@ -411,8 +428,8 @@ "x-api-rate-limit-pool": "Broker", "x-sdk-service": "Broker", "x-sdk-sub-service": "NDBroker", - "x-sdk-method-name": "addSubAccount", - "x-sdk-method-description": "This endpoint supports Broker users to create sub-accounts", + "x-sdk-method-name": "addSubAccountApi", + "x-sdk-method-description": "This interface supports the creation of Broker sub-account APIKEY", "x-api-rate-limit": 3, "requestBody": { "content": { @@ -420,49 +437,97 @@ "schema": { "type": "object", "properties": { - "accountName": { + "uid": { "type": "string", - "description": "Sub Account Name, Note that this name is unique across the exchange. It is recommended to add a special identifier to prevent name duplication." - } - }, - "required": [ - "accountName" - ] - }, - "example": "{\n \"accountName\": \"Account1\"\n}" - } - } - }, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"accountName\\\": \\\"Account15\\\",\\n \\\"uid\\\": \\\"226383154\\\",\\n \\\"createdAt\\\": 1729819381908,\\n \\\"level\\\": 0\\n }\\n}", - "x-request-example": "{\\\"accountName\\\": \\\"Account1\\\"}" - } - }, - "/api/v1/broker/nd/account/apikey": { - "get": { - "summary": "Get SubAccount API", - "deprecated": false, - "description": "This interface supports querying the Broker’s sub-account APIKEY", - "tags": [], - "parameters": [ - { - "name": "uid", - "in": "query", - "description": "Sub-account UID", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "apiKey", - "in": "query", - "description": "Sub-account apiKey\n", - "required": false, - "schema": { - "type": "string" - } - } - ], + "description": "Subaccount UID" + }, + "passphrase": { + "type": "string", + "description": "API passphrase" + }, + "ipWhitelist": { + "type": "array", + "items": { + "type": "string" + }, + "description": "IP whitelist list, supports up to 20 IPs" + }, + "permissions": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "general", + "spot", + "futures" + ], + "x-api-enum": [ + { + "value": "general", + "name": "General", + "description": "" + }, + { + "value": "spot", + "name": "Spot", + "description": "" + }, + { + "value": "futures", + "name": "Futures", + "description": "" + } + ] + }, + "description": "Permission group list(Only General、Spot、Futures permissions can be set, such as \"General, Trade\". )\n" + }, + "label": { + "type": "string", + "description": "apikey remarks (length 4~32)\n", + "minLength": 4, + "maxLength": 32 + } + }, + "required": [ + "uid", + "passphrase", + "ipWhitelist", + "permissions", + "label" + ] + }, + "example": "{\n \"uid\": \"226383154\",\n \"passphrase\": \"11223344\",\n \"ipWhitelist\": [\n \"127.0.0.1\",\"123.123.123.123\"\n ],\n \"permissions\": [\n \"general\",\"spot\"\n ],\n \"label\": \"This is remarks\"\n}" + } + } + }, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"uid\\\": \\\"226383154\\\",\\n \\\"label\\\": \\\"This is remarks\\\",\\n \\\"apiKey\\\": \\\"671afb36cee20f00015cfaf1\\\",\\n \\\"secretKey\\\": \\\"d694df2******5bae05b96\\\",\\n \\\"apiVersion\\\": 3,\\n \\\"permissions\\\": [\\n \\\"General\\\",\\n \\\"Spot\\\"\\n ],\\n \\\"ipWhitelist\\\": [\\n \\\"127.0.0.1\\\",\\n \\\"123.123.123.123\\\"\\n ],\\n \\\"createdAt\\\": 1729821494000\\n }\\n}", + "x-request-example": "{\\\"uid\\\": \\\"226383154\\\", \\\"passphrase\\\": \\\"11223344\\\", \\\"ipWhitelist\\\": [\\\"127.0.0.1\\\", \\\"123.123.123.123\\\"], \\\"permissions\\\": [\\\"general\\\", \\\"spot\\\"], \\\"label\\\": \\\"This is remarks\\\"}" + }, + "get": { + "summary": "Get SubAccount API", + "deprecated": false, + "description": "This interface supports querying the Broker’s sub-account APIKEY", + "tags": [], + "parameters": [ + { + "name": "uid", + "in": "query", + "description": "Sub-account UID", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "apiKey", + "in": "query", + "description": "Sub-account apiKey\n", + "required": false, + "schema": { + "type": "string" + } + } + ], "responses": { "200": { "description": "", @@ -634,11 +699,13 @@ "x-api-rate-limit": 3, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": true\\n}", "x-request-example": "{\\\"uid\\\": \\\"226383154\\\", \\\"apiKey\\\": \\\"671afb36cee20f00015cfaf1\\\"}" - }, + } + }, + "/api/v1/broker/nd/account/update-apikey": { "post": { - "summary": "Add SubAccount API", + "summary": "Modify SubAccount API", "deprecated": false, - "description": "This interface supports the creation of Broker sub-account APIKEY", + "description": "This interface supports modify the Broker’s sub-account APIKEY", "tags": [], "parameters": [], "responses": { @@ -667,10 +734,6 @@ "type": "string", "description": "apiKey" }, - "secretKey": { - "type": "string", - "description": "secretKey" - }, "apiVersion": { "type": "integer", "description": "apiVersion" @@ -699,7 +762,6 @@ "uid", "label", "apiKey", - "secretKey", "apiVersion", "permissions", "ipWhitelist", @@ -716,7 +778,7 @@ } } }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470291", + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470292", "x-abandon": "normal", "x-domain": "Broker", "x-api-channel": "Private", @@ -724,8 +786,8 @@ "x-api-rate-limit-pool": "Broker", "x-sdk-service": "Broker", "x-sdk-sub-service": "NDBroker", - "x-sdk-method-name": "addSubAccountApi", - "x-sdk-method-description": "This interface supports the creation of Broker sub-account APIKEY", + "x-sdk-method-name": "modifySubAccountApi", + "x-sdk-method-description": "This interface supports modify the Broker’s sub-account APIKEY", "x-api-rate-limit": 3, "requestBody": { "content": { @@ -737,10 +799,6 @@ "type": "string", "description": "Subaccount UID" }, - "passphrase": { - "type": "string", - "description": "API passphrase" - }, "ipWhitelist": { "type": "array", "items": { @@ -775,97 +833,42 @@ } ] }, - "description": "Permission group list(Only General、Spot、Futures permissions can be set, such as \"General, Trade\". )\n" + "description": "[Permissions](https://www.kucoin.com/docs-new/doc-338144) group list(Only General、Spot、Futures permissions can be set, such as \"General, Trade\". )\n" }, "label": { "type": "string", "description": "apikey remarks (length 4~32)\n", "minLength": 4, "maxLength": 32 + }, + "apiKey": { + "type": "string", + "description": "Subaccount apiKey" } }, "required": [ "uid", - "passphrase", + "apiKey", "ipWhitelist", "permissions", "label" ] }, - "example": "{\n \"uid\": \"226383154\",\n \"passphrase\": \"11223344\",\n \"ipWhitelist\": [\n \"127.0.0.1\",\"123.123.123.123\"\n ],\n \"permissions\": [\n \"general\",\"spot\"\n ],\n \"label\": \"This is remarks\"\n}" + "example": "{\n \"uid\": \"226383154\",\n \"apiKey\": \"671afb36cee20f00015cfaf1\",\n \"ipWhitelist\": [\n \"127.0.0.1\",\n \"123.123.123.123\"\n ],\n \"permissions\": [\n \"general\",\n \"spot\"\n ],\n \"label\": \"This is remarks\"\n}" } } }, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"uid\\\": \\\"226383154\\\",\\n \\\"label\\\": \\\"This is remarks\\\",\\n \\\"apiKey\\\": \\\"671afb36cee20f00015cfaf1\\\",\\n \\\"secretKey\\\": \\\"d694df2******5bae05b96\\\",\\n \\\"apiVersion\\\": 3,\\n \\\"permissions\\\": [\\n \\\"General\\\",\\n \\\"Spot\\\"\\n ],\\n \\\"ipWhitelist\\\": [\\n \\\"127.0.0.1\\\",\\n \\\"123.123.123.123\\\"\\n ],\\n \\\"createdAt\\\": 1729821494000\\n }\\n}", - "x-request-example": "{\\\"uid\\\": \\\"226383154\\\", \\\"passphrase\\\": \\\"11223344\\\", \\\"ipWhitelist\\\": [\\\"127.0.0.1\\\", \\\"123.123.123.123\\\"], \\\"permissions\\\": [\\\"general\\\", \\\"spot\\\"], \\\"label\\\": \\\"This is remarks\\\"}" + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"uid\\\": \\\"226383154\\\",\\n \\\"label\\\": \\\"This is remarks\\\",\\n \\\"apiKey\\\": \\\"671afb36cee20f00015cfaf1\\\",\\n \\\"apiVersion\\\": 3,\\n \\\"permissions\\\": [\\n \\\"General\\\",\\n \\\"Spot\\\"\\n ],\\n \\\"ipWhitelist\\\": [\\n \\\"127.**.1\\\",\\n \\\"123.**.123\\\"\\n ],\\n \\\"createdAt\\\": 1729821494000\\n }\\n}", + "x-request-example": "{\\\"uid\\\": \\\"226383154\\\", \\\"apiKey\\\": \\\"671afb36cee20f00015cfaf1\\\", \\\"ipWhitelist\\\": [\\\"127.0.0.1\\\", \\\"123.123.123.123\\\"], \\\"permissions\\\": [\\\"general\\\", \\\"spot\\\"], \\\"label\\\": \\\"This is remarks\\\"}" } }, - "/api/v1/asset/ndbroker/deposit/list": { - "get": { - "summary": "Get Deposit List", + "/api/v1/broker/nd/transfer": { + "post": { + "summary": "Transfer", "deprecated": false, - "description": "This endpoint can obtain the deposit records of each sub-account under the ND Broker.", + "description": "This endpoint supports fund transfer between Broker account and Broker sub-accounts. Please be aware that withdrawal from sub-account is not directly supported. Broker has to transfer funds from broker sub-account to broker account to initiate the withdrawals.", "tags": [], - "parameters": [ - { - "name": "currency", - "in": "query", - "description": "currency", - "required": false, - "schema": { - "type": "string" - } - }, - { - "name": "status", - "in": "query", - "description": "Status. Available value: PROCESSING, SUCCESS, FAILURE", - "required": false, - "schema": { - "type": "string" - } - }, - { - "name": "hash", - "in": "query", - "description": "hash", - "required": false, - "schema": { - "type": "string" - } - }, - { - "name": "startTimestamp", - "in": "query", - "description": "Start time (milisecond)", - "required": false, - "schema": { - "type": "integer", - "format": "int64" - } - }, - { - "name": "endTimestamp", - "in": "query", - "description": "End time (milisecond),Default sorting in descending order", - "required": false, - "schema": { - "type": "integer", - "format": "int64" - } - }, - { - "name": "limit", - "in": "query", - "description": "Maximum number of returned items, maximum 1000, default 1000", - "required": false, - "schema": { - "type": "integer", - "default": 1000, - "maximum": 1000 - } - } - ], + "parameters": [], "responses": { "200": { "description": "", @@ -874,128 +877,23 @@ "schema": { "type": "object", "properties": { - "success": { - "type": "boolean" - }, "code": { "type": "string" }, - "msg": { - "type": "string" - }, - "retry": { - "type": "boolean" - }, "data": { - "type": "array", - "items": { - "type": "object", - "properties": { - "uid": { - "type": "number", - "description": "deposit uid" - }, - "hash": { - "type": "string", - "description": "hash" - }, - "address": { - "type": "string", - "description": "Deposit address" - }, - "memo": { - "type": "string", - "description": "Address remark. If there’s no remark, it is empty. When you withdraw from other platforms to the KuCoin, you need to fill in memo(tag). If you do not fill memo (tag), your deposit may not be available, please be cautious." - }, - "amount": { - "type": "string", - "description": "Deposit amount" - }, - "fee": { - "type": "string", - "description": "Fees charged for deposit" - }, - "currency": { - "type": "string", - "description": "currency" - }, - "isInner": { - "type": "boolean", - "description": "Internal deposit or not" - }, - "walletTxId": { - "type": "string", - "description": "Wallet Txid" - }, - "status": { - "type": "string", - "enum": [ - "PROCESSING", - "SUCCESS", - "FAILURE" - ], - "description": "Status. Available value: PROCESSING, SUCCESS, FAILURE", - "x-api-enum": [ - { - "value": "PROCESSING", - "name": "", - "description": "" - }, - { - "value": "SUCCESS", - "name": "", - "description": "" - }, - { - "value": "FAILURE", - "name": "", - "description": "" - } - ] - }, - "remark": { - "type": "string", - "description": "remark" - }, - "chain": { - "type": "string", - "description": "chain name of currency" - }, - "createdAt": { - "type": "integer", - "format": "int64", - "description": "Creation time of the database record" - }, - "updatedAt": { - "type": "integer", - "format": "int64", - "description": "Update time of the database record" - } - }, - "required": [ - "uid", - "hash", - "address", - "memo", - "amount", - "fee", - "currency", - "isInner", - "walletTxId", - "status", - "remark", - "chain", - "createdAt", - "updatedAt" - ] - } + "type": "object", + "properties": { + "orderId": { + "type": "string" + } + }, + "required": [ + "orderId" + ] } }, "required": [ - "success", "code", - "msg", - "retry", "data" ] } @@ -1003,7 +901,7 @@ } } }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470285", + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470293", "x-abandon": "normal", "x-domain": "Broker", "x-api-channel": "Private", @@ -1011,11 +909,109 @@ "x-api-rate-limit-pool": "Broker", "x-sdk-service": "Broker", "x-sdk-sub-service": "NDBroker", - "x-sdk-method-name": "getDepositList", - "x-sdk-method-description": "This endpoint can obtain the deposit records of each sub-account under the ND Broker.", - "x-api-rate-limit": 10, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": [\\n {\\n \\\"uid\\\": 165111215,\\n \\\"hash\\\": \\\"6724e363a492800007ec602b\\\",\\n \\\"address\\\": \\\"xxxxxxx@gmail.com\\\",\\n \\\"memo\\\": \\\"\\\",\\n \\\"amount\\\": \\\"3.0\\\",\\n \\\"fee\\\": \\\"0.0\\\",\\n \\\"currency\\\": \\\"USDT\\\",\\n \\\"isInner\\\": true,\\n \\\"walletTxId\\\": \\\"bbbbbbbbb\\\",\\n \\\"status\\\": \\\"SUCCESS\\\",\\n \\\"chain\\\": \\\"\\\",\\n \\\"remark\\\": \\\"\\\",\\n \\\"createdAt\\\": 1730470760000,\\n \\\"updatedAt\\\": 1730470760000\\n }\\n ]\\n}", - "x-request-example": "{\\\"currency\\\": \\\"USDT\\\", \\\"status\\\": \\\"SUCCESS\\\", \\\"hash\\\": \\\"example_string_default_value\\\", \\\"startTimestamp\\\": 123456, \\\"endTimestamp\\\": 123456, \\\"limit\\\": 100}" + "x-sdk-method-name": "transfer", + "x-sdk-method-description": "This endpoint supports fund transfer between Broker account and Broker sub-accounts. Please be aware that withdrawal from sub-account is not directly supported. Broker has to transfer funds from broker sub-account to broker account to initiate the withdrawals.", + "x-api-rate-limit": 1, + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "currency": { + "type": "string", + "description": "Currency" + }, + "amount": { + "type": "string", + "description": "Transfer Amount (must be a positive integer in the currency's precision)" + }, + "direction": { + "type": "string", + "description": "Fund transfer direction: OUT (Broker account is transferred to Broker sub-account), IN (Broker sub-account is transferred to Broker account)", + "enum": [ + "OUT", + "IN" + ], + "x-api-enum": [ + { + "value": "OUT", + "name": "", + "description": "" + }, + { + "value": "IN", + "name": "", + "description": "" + } + ] + }, + "accountType": { + "type": "string", + "description": "Broker account types: MAIN (Funding account), TRADE (Spot trading account)", + "enum": [ + "MAIN", + "TRADE" + ], + "x-api-enum": [ + { + "value": "MAIN", + "name": "", + "description": "" + }, + { + "value": "TRADE", + "name": "", + "description": "" + } + ] + }, + "specialUid": { + "type": "string", + "description": "Broker subaccount uid, must be the Broker subaccount created by the current Broker user." + }, + "specialAccountType": { + "type": "string", + "description": "Broker sub-account types: MAIN (Funding account), TRADE (Spot trading account)", + "enum": [ + "MAIN", + "TRADE" + ], + "x-api-enum": [ + { + "value": "MAIN", + "name": "", + "description": "" + }, + { + "value": "TRADE", + "name": "", + "description": "" + } + ] + }, + "clientOid": { + "type": "string", + "description": "Client Order Id, The unique identifier created by the client. It is recommended to use UUID. The maximum length is 128 bits.", + "maxLength": 128 + } + }, + "required": [ + "currency", + "amount", + "direction", + "accountType", + "specialUid", + "specialAccountType", + "clientOid" + ] + }, + "example": "{\n \"currency\": \"USDT\",\n \"amount\": \"1\",\n \"clientOid\": \"e6c24d23-6bc2-401b-bf9e-55e2daddfbc1\",\n \"direction\": \"OUT\",\n \"accountType\": \"MAIN\",\n \"specialUid\": \"226383154\",\n \"specialAccountType\": \"MAIN\"\n}" + } + } + }, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"orderId\\\": \\\"671b4600c1e3dd000726866d\\\"\\n }\\n}", + "x-request-example": "{\\\"currency\\\": \\\"USDT\\\", \\\"amount\\\": \\\"1\\\", \\\"clientOid\\\": \\\"e6c24d23-6bc2-401b-bf9e-55e2daddfbc1\\\", \\\"direction\\\": \\\"OUT\\\", \\\"accountType\\\": \\\"MAIN\\\", \\\"specialUid\\\": \\\"226383154\\\", \\\"specialAccountType\\\": \\\"MAIN\\\"}" } }, "/api/v3/broker/nd/transfer/detail": { @@ -1239,21 +1235,70 @@ "x-request-example": "{\\\"orderId\\\": \\\"671b4600c1e3dd000726866d\\\"}" } }, - "/api/v3/broker/nd/withdraw/detail": { + "/api/v1/asset/ndbroker/deposit/list": { "get": { - "summary": "Get Withdraw Detail", + "summary": "Get Deposit List", "deprecated": false, - "description": "This endpoint supports querying the withdrawal records of sub-accounts created by a Broker (excluding main account of nd broker).", + "description": "This endpoint can obtain the deposit records of each sub-account under the ND Broker.", "tags": [], "parameters": [ { - "name": "withdrawalId", + "name": "currency", "in": "query", - "description": "Withdrawal ID", - "required": true, + "description": "currency", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "status", + "in": "query", + "description": "Status. Available value: PROCESSING, SUCCESS, FAILURE", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "hash", + "in": "query", + "description": "hash", + "required": false, "schema": { "type": "string" } + }, + { + "name": "startTimestamp", + "in": "query", + "description": "Start time (milisecond)", + "required": false, + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "endTimestamp", + "in": "query", + "description": "End time (milisecond),Default sorting in descending order", + "required": false, + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "limit", + "in": "query", + "description": "Maximum number of returned items, maximum 1000, default 1000", + "required": false, + "schema": { + "type": "integer", + "default": 1000, + "maximum": 1000 + } } ], "responses": { @@ -1264,133 +1309,136 @@ "schema": { "type": "object", "properties": { + "success": { + "type": "boolean" + }, + "code": { + "type": "string" + }, + "msg": { + "type": "string" + }, + "retry": { + "type": "boolean" + }, "data": { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "Withdrawal ID" - }, - "chain": { - "type": "string", - "description": "chain id of currency" - }, - "walletTxId": { - "type": "string", - "description": "Wallet Transaction ID" - }, - "uid": { - "type": "integer", - "description": "UID" - }, - "updatedAt": { - "type": "integer", - "description": "Update Time (milliseconds)", - "format": "int64" - }, - "amount": { - "type": "string", - "description": "Amount" - }, - "memo": { - "type": "string", - "description": "Memo" - }, - "fee": { - "type": "string", - "description": "Fee" - }, - "address": { - "type": "string", - "description": "Address" - }, - "remark": { - "type": "string", - "description": "Remark" - }, - "isInner": { - "type": "boolean", - "description": "Is Internal (true or false)" - }, - "currency": { - "type": "string", - "description": "Currency" - }, - "status": { - "type": "string", - "description": "Status (PROCESSING, WALLET_PROCESSING, REVIEW, SUCCESS, FAILURE)", - "enum": [ - "PROCESSING", - "WALLET_PROCESSING", - "REVIEW", - "SUCCESS", - "FAILURE" - ], - "x-api-enum": [ - { - "value": "PROCESSING", - "name": "", - "description": "" - }, - { - "value": "WALLET_PROCESSING", - "name": "", - "description": "" - }, - { - "value": "REVIEW", - "name": "", - "description": "" - }, - { - "value": "SUCCESS", - "name": "", - "description": "" - }, - { - "value": "FAILURE", - "name": "", - "description": "" - } - ] + "type": "array", + "items": { + "type": "object", + "properties": { + "uid": { + "type": "number", + "description": "deposit uid" + }, + "hash": { + "type": "string", + "description": "hash" + }, + "address": { + "type": "string", + "description": "Deposit address" + }, + "memo": { + "type": "string", + "description": "Address remark. If there’s no remark, it is empty. When you withdraw from other platforms to the KuCoin, you need to fill in memo(tag). If you do not fill memo (tag), your deposit may not be available, please be cautious." + }, + "amount": { + "type": "string", + "description": "Deposit amount" + }, + "fee": { + "type": "string", + "description": "Fees charged for deposit" + }, + "currency": { + "type": "string", + "description": "currency" + }, + "isInner": { + "type": "boolean", + "description": "Internal deposit or not" + }, + "walletTxId": { + "type": "string", + "description": "Wallet Txid" + }, + "status": { + "type": "string", + "enum": [ + "PROCESSING", + "SUCCESS", + "FAILURE" + ], + "description": "Status. Available value: PROCESSING, SUCCESS, FAILURE", + "x-api-enum": [ + { + "value": "PROCESSING", + "name": "", + "description": "" + }, + { + "value": "SUCCESS", + "name": "", + "description": "" + }, + { + "value": "FAILURE", + "name": "", + "description": "" + } + ] + }, + "remark": { + "type": "string", + "description": "remark" + }, + "chain": { + "type": "string", + "description": "chain name of currency" + }, + "createdAt": { + "type": "integer", + "format": "int64", + "description": "Creation time of the database record" + }, + "updatedAt": { + "type": "integer", + "format": "int64", + "description": "Update time of the database record" + } }, - "createdAt": { - "type": "integer", - "description": "Creation Time (milliseconds)", - "format": "int64" - } - }, - "required": [ - "id", - "chain", - "walletTxId", - "uid", - "updatedAt", - "amount", - "memo", - "fee", - "address", - "remark", - "isInner", - "currency", - "status", - "createdAt" - ] - }, - "code": { - "type": "string" + "required": [ + "uid", + "hash", + "address", + "memo", + "amount", + "fee", + "currency", + "isInner", + "walletTxId", + "status", + "remark", + "chain", + "createdAt", + "updatedAt" + ] + } } }, "required": [ - "data", - "code" + "success", + "code", + "msg", + "retry", + "data" ] } } } } }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470287", + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470285", "x-abandon": "normal", "x-domain": "Broker", "x-api-channel": "Private", @@ -1398,11 +1446,11 @@ "x-api-rate-limit-pool": "Broker", "x-sdk-service": "Broker", "x-sdk-sub-service": "NDBroker", - "x-sdk-method-name": "getWithdrawDetail", - "x-sdk-method-description": "This endpoint supports querying the withdrawal records of sub-accounts created by a Broker (excluding main account of nd broker).", - "x-api-rate-limit": 1, - "x-response-example": "{\\n \\\"data\\\": {\\n \\\"id\\\": \\\"66617a2***3c9a\\\",\\n \\\"chain\\\": \\\"ton\\\",\\n \\\"walletTxId\\\": \\\"AJ***eRI=\\\",\\n \\\"uid\\\": 157267400,\\n \\\"amount\\\": \\\"1.00000000\\\",\\n \\\"memo\\\": \\\"7025734\\\",\\n \\\"fee\\\": \\\"0.00000000\\\",\\n \\\"address\\\": \\\"EQDn***dKbGzr\\\",\\n \\\"remark\\\": \\\"\\\",\\n \\\"isInner\\\": false,\\n \\\"currency\\\": \\\"USDT\\\",\\n \\\"status\\\": \\\"SUCCESS\\\",\\n \\\"createdAt\\\": 1717664288000,\\n \\\"updatedAt\\\": 1717664375000\\n },\\n \\\"code\\\": \\\"200000\\\"\\n}", - "x-request-example": "{\\\"withdrawalId\\\": \\\"66617a2***3c9a\\\"}" + "x-sdk-method-name": "getDepositList", + "x-sdk-method-description": "This endpoint can obtain the deposit records of each sub-account under the ND Broker.", + "x-api-rate-limit": 10, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": [\\n {\\n \\\"uid\\\": 165111215,\\n \\\"hash\\\": \\\"6724e363a492800007ec602b\\\",\\n \\\"address\\\": \\\"xxxxxxx@gmail.com\\\",\\n \\\"memo\\\": \\\"\\\",\\n \\\"amount\\\": \\\"3.0\\\",\\n \\\"fee\\\": \\\"0.0\\\",\\n \\\"currency\\\": \\\"USDT\\\",\\n \\\"isInner\\\": true,\\n \\\"walletTxId\\\": \\\"bbbbbbbbb\\\",\\n \\\"status\\\": \\\"SUCCESS\\\",\\n \\\"chain\\\": \\\"\\\",\\n \\\"remark\\\": \\\"\\\",\\n \\\"createdAt\\\": 1730470760000,\\n \\\"updatedAt\\\": 1730470760000\\n }\\n ]\\n}", + "x-request-example": "{\\\"currency\\\": \\\"USDT\\\", \\\"status\\\": \\\"SUCCESS\\\", \\\"hash\\\": \\\"example_string_default_value\\\", \\\"startTimestamp\\\": 123456, \\\"endTimestamp\\\": 123456, \\\"limit\\\": 100}" } }, "/api/v3/broker/nd/deposit/detail": { @@ -1568,13 +1616,23 @@ "x-request-example": "{\\\"currency\\\": \\\"USDT\\\", \\\"hash\\\": \\\"30bb0e0b***4156c5188\\\"}" } }, - "/api/v1/broker/nd/account/update-apikey": { - "post": { - "summary": "Modify SubAccount API", + "/api/v3/broker/nd/withdraw/detail": { + "get": { + "summary": "Get Withdraw Detail", "deprecated": false, - "description": "This interface supports modify the Broker’s sub-account APIKEY", + "description": "This endpoint supports querying the withdrawal records of sub-accounts created by a Broker (excluding main account of nd broker).", "tags": [], - "parameters": [], + "parameters": [ + { + "name": "withdrawalId", + "in": "query", + "description": "Withdrawal ID", + "required": true, + "schema": { + "type": "string" + } + } + ], "responses": { "200": { "description": "", @@ -1583,69 +1641,133 @@ "schema": { "type": "object", "properties": { - "code": { - "type": "string" - }, "data": { "type": "object", "properties": { - "uid": { + "id": { "type": "string", - "description": "Sub-Account UID" + "description": "Withdrawal ID" }, - "label": { + "chain": { "type": "string", - "description": "apikey remarks" + "description": "chain id of currency" }, - "apiKey": { + "walletTxId": { "type": "string", - "description": "apiKey" + "description": "Wallet Transaction ID" }, - "apiVersion": { + "uid": { "type": "integer", - "description": "apiVersion" + "description": "UID" }, - "permissions": { - "type": "array", - "items": { - "type": "string" - }, - "description": "[Permissions](https://www.kucoin.com/docs-new/doc-338144) group list" + "updatedAt": { + "type": "integer", + "description": "Update Time (milliseconds)", + "format": "int64" }, - "ipWhitelist": { - "type": "array", - "items": { - "type": "string" - }, - "description": "IP whitelist list" + "amount": { + "type": "string", + "description": "Amount" + }, + "memo": { + "type": "string", + "description": "Memo" + }, + "fee": { + "type": "string", + "description": "Fee" + }, + "address": { + "type": "string", + "description": "Address" + }, + "remark": { + "type": "string", + "description": "Remark" + }, + "isInner": { + "type": "boolean", + "description": "Is Internal (true or false)" + }, + "currency": { + "type": "string", + "description": "Currency" + }, + "status": { + "type": "string", + "description": "Status (PROCESSING, WALLET_PROCESSING, REVIEW, SUCCESS, FAILURE)", + "enum": [ + "PROCESSING", + "WALLET_PROCESSING", + "REVIEW", + "SUCCESS", + "FAILURE" + ], + "x-api-enum": [ + { + "value": "PROCESSING", + "name": "", + "description": "" + }, + { + "value": "WALLET_PROCESSING", + "name": "", + "description": "" + }, + { + "value": "REVIEW", + "name": "", + "description": "" + }, + { + "value": "SUCCESS", + "name": "", + "description": "" + }, + { + "value": "FAILURE", + "name": "", + "description": "" + } + ] }, "createdAt": { "type": "integer", - "description": "Creation time, unix timestamp (milliseconds)", + "description": "Creation Time (milliseconds)", "format": "int64" } }, "required": [ + "id", + "chain", + "walletTxId", "uid", - "label", - "apiKey", - "apiVersion", - "permissions", - "ipWhitelist", + "updatedAt", + "amount", + "memo", + "fee", + "address", + "remark", + "isInner", + "currency", + "status", "createdAt" ] + }, + "code": { + "type": "string" } }, "required": [ - "code", - "data" + "data", + "code" ] } } } } }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470292", + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470287", "x-abandon": "normal", "x-domain": "Broker", "x-api-channel": "Private", @@ -1653,89 +1775,64 @@ "x-api-rate-limit-pool": "Broker", "x-sdk-service": "Broker", "x-sdk-sub-service": "NDBroker", - "x-sdk-method-name": "modifySubAccountApi", - "x-sdk-method-description": "This interface supports modify the Broker’s sub-account APIKEY", - "x-api-rate-limit": 3, - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "uid": { - "type": "string", - "description": "Subaccount UID" - }, - "ipWhitelist": { - "type": "array", - "items": { - "type": "string" - }, - "description": "IP whitelist list, supports up to 20 IPs" - }, - "permissions": { - "type": "array", - "items": { - "type": "string", - "enum": [ - "general", - "spot", - "futures" - ], - "x-api-enum": [ - { - "value": "general", - "name": "General", - "description": "" - }, - { - "value": "spot", - "name": "Spot", - "description": "" - }, - { - "value": "futures", - "name": "Futures", - "description": "" - } - ] - }, - "description": "[Permissions](https://www.kucoin.com/docs-new/doc-338144) group list(Only General、Spot、Futures permissions can be set, such as \"General, Trade\". )\n" - }, - "label": { - "type": "string", - "description": "apikey remarks (length 4~32)\n", - "minLength": 4, - "maxLength": 32 - }, - "apiKey": { - "type": "string", - "description": "Subaccount apiKey" - } - }, - "required": [ - "uid", - "apiKey", - "ipWhitelist", - "permissions", - "label" - ] - }, - "example": "{\n \"uid\": \"226383154\",\n \"apiKey\": \"671afb36cee20f00015cfaf1\",\n \"ipWhitelist\": [\n \"127.0.0.1\",\n \"123.123.123.123\"\n ],\n \"permissions\": [\n \"general\",\n \"spot\"\n ],\n \"label\": \"This is remarks\"\n}" - } - } - }, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"uid\\\": \\\"226383154\\\",\\n \\\"label\\\": \\\"This is remarks\\\",\\n \\\"apiKey\\\": \\\"671afb36cee20f00015cfaf1\\\",\\n \\\"apiVersion\\\": 3,\\n \\\"permissions\\\": [\\n \\\"General\\\",\\n \\\"Spot\\\"\\n ],\\n \\\"ipWhitelist\\\": [\\n \\\"127.**.1\\\",\\n \\\"123.**.123\\\"\\n ],\\n \\\"createdAt\\\": 1729821494000\\n }\\n}", - "x-request-example": "{\\\"uid\\\": \\\"226383154\\\", \\\"apiKey\\\": \\\"671afb36cee20f00015cfaf1\\\", \\\"ipWhitelist\\\": [\\\"127.0.0.1\\\", \\\"123.123.123.123\\\"], \\\"permissions\\\": [\\\"general\\\", \\\"spot\\\"], \\\"label\\\": \\\"This is remarks\\\"}" + "x-sdk-method-name": "getWithdrawDetail", + "x-sdk-method-description": "This endpoint supports querying the withdrawal records of sub-accounts created by a Broker (excluding main account of nd broker).", + "x-api-rate-limit": 1, + "x-response-example": "{\\n \\\"data\\\": {\\n \\\"id\\\": \\\"66617a2***3c9a\\\",\\n \\\"chain\\\": \\\"ton\\\",\\n \\\"walletTxId\\\": \\\"AJ***eRI=\\\",\\n \\\"uid\\\": 157267400,\\n \\\"amount\\\": \\\"1.00000000\\\",\\n \\\"memo\\\": \\\"7025734\\\",\\n \\\"fee\\\": \\\"0.00000000\\\",\\n \\\"address\\\": \\\"EQDn***dKbGzr\\\",\\n \\\"remark\\\": \\\"\\\",\\n \\\"isInner\\\": false,\\n \\\"currency\\\": \\\"USDT\\\",\\n \\\"status\\\": \\\"SUCCESS\\\",\\n \\\"createdAt\\\": 1717664288000,\\n \\\"updatedAt\\\": 1717664375000\\n },\\n \\\"code\\\": \\\"200000\\\"\\n}", + "x-request-example": "{\\\"withdrawalId\\\": \\\"66617a2***3c9a\\\"}" } }, - "/api/v1/broker/nd/transfer": { - "post": { - "summary": "Transfer", + "/api/v1/broker/nd/rebase/download": { + "get": { + "summary": "Get Broker Rebate", "deprecated": false, - "description": "This endpoint supports fund transfer between Broker account and Broker sub-accounts. Please be aware that withdrawal from sub-account is not directly supported. Broker has to transfer funds from broker sub-account to broker account to initiate the withdrawals.", + "description": "This interface supports downloading Broker rebate orders", "tags": [], - "parameters": [], + "parameters": [ + { + "name": "begin", + "in": "query", + "description": "Start time, for example: 20240610", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "end", + "in": "query", + "description": "End time, for example: 20241010 (query data with a maximum interval of 6 months)\n", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "tradeType", + "in": "query", + "description": "Transaction type, 1: spot 2: futures", + "required": true, + "schema": { + "type": "string", + "enum": [ + "1", + "2" + ], + "x-api-enum": [ + { + "value": "1", + "name": "", + "description": "spot" + }, + { + "value": "2", + "name": "", + "description": "futures" + } + ] + } + } + ], "responses": { "200": { "description": "", @@ -1750,12 +1847,13 @@ "data": { "type": "object", "properties": { - "orderId": { - "type": "string" + "url": { + "type": "string", + "description": "Rebate order file (link is valid for 1 day)" } }, "required": [ - "orderId" + "url" ] } }, @@ -1768,7 +1866,7 @@ } } }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470293", + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470281", "x-abandon": "normal", "x-domain": "Broker", "x-api-channel": "Private", @@ -1776,109 +1874,11 @@ "x-api-rate-limit-pool": "Broker", "x-sdk-service": "Broker", "x-sdk-sub-service": "NDBroker", - "x-sdk-method-name": "transfer", - "x-sdk-method-description": "This endpoint supports fund transfer between Broker account and Broker sub-accounts. Please be aware that withdrawal from sub-account is not directly supported. Broker has to transfer funds from broker sub-account to broker account to initiate the withdrawals.", - "x-api-rate-limit": 1, - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "currency": { - "type": "string", - "description": "Currency" - }, - "amount": { - "type": "string", - "description": "Transfer Amount (must be a positive integer in the currency's precision)" - }, - "direction": { - "type": "string", - "description": "Fund transfer direction: OUT (Broker account is transferred to Broker sub-account), IN (Broker sub-account is transferred to Broker account)", - "enum": [ - "OUT", - "IN" - ], - "x-api-enum": [ - { - "value": "OUT", - "name": "", - "description": "" - }, - { - "value": "IN", - "name": "", - "description": "" - } - ] - }, - "accountType": { - "type": "string", - "description": "Broker account types: MAIN (Funding account), TRADE (Spot trading account)", - "enum": [ - "MAIN", - "TRADE" - ], - "x-api-enum": [ - { - "value": "MAIN", - "name": "", - "description": "" - }, - { - "value": "TRADE", - "name": "", - "description": "" - } - ] - }, - "specialUid": { - "type": "string", - "description": "Broker subaccount uid, must be the Broker subaccount created by the current Broker user." - }, - "specialAccountType": { - "type": "string", - "description": "Broker sub-account types: MAIN (Funding account), TRADE (Spot trading account)", - "enum": [ - "MAIN", - "TRADE" - ], - "x-api-enum": [ - { - "value": "MAIN", - "name": "", - "description": "" - }, - { - "value": "TRADE", - "name": "", - "description": "" - } - ] - }, - "clientOid": { - "type": "string", - "description": "Client Order Id, The unique identifier created by the client. It is recommended to use UUID. The maximum length is 128 bits.", - "maxLength": 128 - } - }, - "required": [ - "currency", - "amount", - "direction", - "accountType", - "specialUid", - "specialAccountType", - "clientOid" - ] - }, - "example": "{\n \"currency\": \"USDT\",\n \"amount\": \"1\",\n \"clientOid\": \"e6c24d23-6bc2-401b-bf9e-55e2daddfbc1\",\n \"direction\": \"OUT\",\n \"accountType\": \"MAIN\",\n \"specialUid\": \"226383154\",\n \"specialAccountType\": \"MAIN\"\n}" - } - } - }, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"orderId\\\": \\\"671b4600c1e3dd000726866d\\\"\\n }\\n}", - "x-request-example": "{\\\"currency\\\": \\\"USDT\\\", \\\"amount\\\": \\\"1\\\", \\\"clientOid\\\": \\\"e6c24d23-6bc2-401b-bf9e-55e2daddfbc1\\\", \\\"direction\\\": \\\"OUT\\\", \\\"accountType\\\": \\\"MAIN\\\", \\\"specialUid\\\": \\\"226383154\\\", \\\"specialAccountType\\\": \\\"MAIN\\\"}" + "x-sdk-method-name": "getRebase", + "x-sdk-method-description": "This interface supports downloading Broker rebate orders", + "x-api-rate-limit": 3, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"url\\\": \\\"https://kc-v2-promotion.s3.ap-northeast-1.amazonaws.com/broker/671aec522593f600019766d0_file.csv?X-Amz-Security-Token=IQo*********2cd90f14efb\\\"\\n }\\n}", + "x-request-example": "{\\\"begin\\\": \\\"20240610\\\", \\\"end\\\": \\\"20241010\\\", \\\"tradeType\\\": \\\"1\\\"}" } } }, diff --git a/spec/rest/api/openapi-futures-market.json b/spec/rest/api/openapi-futures-market.json index b0438028..77533044 100644 --- a/spec/rest/api/openapi-futures-market.json +++ b/spec/rest/api/openapi-futures-market.json @@ -7,6 +7,470 @@ }, "tags": [], "paths": { + "/api/v1/contracts/{symbol}": { + "get": { + "summary": "Get Symbol", + "deprecated": false, + "description": "Get information of specified contracts that can be traded. This API will return a list of tradable contracts, including some key parameters of the contract such as the symbol name, tick size, mark price,etc.", + "tags": [], + "parameters": [ + { + "name": "symbol", + "in": "path", + "description": "Path Parameter. Symbol of the contract", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "string", + "description": "200000 is for success, other is error" + }, + "data": { + "type": "object", + "properties": { + "symbol": { + "type": "string", + "description": "Symbol", + "example": [ + "XBTUSDTM", + "XBTUSDCM", + "XBTUSDM" + ] + }, + "rootSymbol": { + "type": "string", + "description": "Contract group", + "example": [ + "USDT", + "USDC", + "XBT" + ] + }, + "type": { + "type": "string", + "description": "Type of the contract", + "enum": [ + "FFWCSX", + "FFICSX" + ], + "x-api-enum": [ + { + "value": "FFWCSX", + "name": "FFWCSX", + "description": "Standardized swap contracts standard financial futures on swap, expiration swap funding rate" + }, + { + "value": "FFICSX", + "name": "FFICSX", + "description": "Futures Contract" + } + ] + }, + "firstOpenDate": { + "type": "integer", + "description": "First Open Date(millisecond)", + "format": "int64" + }, + "expireDate": { + "type": "integer", + "description": "Expiration date(millisecond). Null means it will never expire", + "format": "int64" + }, + "settleDate": { + "type": "integer", + "description": "Settlement date(millisecond). Null indicates that automatic settlement is not supported", + "format": "int64" + }, + "baseCurrency": { + "type": "string", + "description": "Base currency" + }, + "quoteCurrency": { + "type": "string", + "description": "Quote currency" + }, + "settleCurrency": { + "type": "string", + "description": "Currency used to clear and settle the trades" + }, + "maxOrderQty": { + "type": "integer", + "description": "Maximum order quantity" + }, + "maxPrice": { + "type": "number", + "description": "Maximum order price" + }, + "lotSize": { + "type": "integer", + "description": "Minimum lot size" + }, + "tickSize": { + "type": "number", + "description": "Minimum price changes" + }, + "indexPriceTickSize": { + "type": "number", + "description": "Index price of tick size" + }, + "multiplier": { + "type": "number", + "description": "The basic unit of the contract API is lots. For the number of coins in each lot, please refer to the param multiplier. For example, for XBTUSDTM, multiplier=0.001, which corresponds to the value of each XBTUSDTM contract being 0.001 BTC. There is also a special case. All coin-swap contracts, such as each XBTUSDM contract, correspond to 1 USD." + }, + "initialMargin": { + "type": "number", + "description": "Initial margin requirement" + }, + "maintainMargin": { + "type": "number", + "description": "Maintenance margin requirement" + }, + "maxRiskLimit": { + "type": "integer", + "description": "Maximum risk limit (unit: XBT)" + }, + "minRiskLimit": { + "type": "integer", + "description": "Minimum risk limit (unit: XBT)" + }, + "riskStep": { + "type": "integer", + "description": "Risk limit increment value (unit: XBT)" + }, + "makerFeeRate": { + "type": "number", + "description": "Maker fee rate" + }, + "takerFeeRate": { + "type": "number", + "description": "Taker fee rate" + }, + "takerFixFee": { + "type": "number", + "description": "Deprecated param" + }, + "makerFixFee": { + "type": "number", + "description": "Deprecated param" + }, + "settlementFee": { + "type": "number", + "description": "Settlement fee" + }, + "isDeleverage": { + "type": "boolean", + "description": "Enabled ADL or not" + }, + "isQuanto": { + "type": "boolean", + "description": "Deprecated param" + }, + "isInverse": { + "type": "boolean", + "description": "Whether it is a reverse contract" + }, + "markMethod": { + "type": "string", + "description": "Marking method", + "enum": [ + "FairPrice" + ], + "x-api-enum": [ + { + "value": "FairPrice", + "name": "FairPrice", + "description": "Fair Price" + } + ] + }, + "fairMethod": { + "type": "string", + "description": "Fair price marking method, The Futures contract is null", + "enum": [ + "FundingRate" + ], + "x-api-enum": [ + { + "value": "FundingRate", + "name": "FundingRate", + "description": "FundingRate" + } + ] + }, + "fundingBaseSymbol": { + "type": "string", + "description": "Ticker symbol of the based currency" + }, + "fundingQuoteSymbol": { + "type": "string", + "description": "Ticker symbol of the quote currency" + }, + "fundingRateSymbol": { + "type": "string", + "description": "Funding rate symbol" + }, + "indexSymbol": { + "type": "string", + "description": "Index symbol" + }, + "settlementSymbol": { + "type": "string", + "description": "Settlement Symbol" + }, + "status": { + "type": "string", + "description": "Contract status", + "enum": [ + "Init", + "Open", + "BeingSettled", + "Settled", + "Paused", + "Closed", + "CancelOnly" + ], + "x-api-enum": [ + { + "value": "Init", + "name": "Init", + "description": "Initial" + }, + { + "value": "Open", + "name": "Open", + "description": "Online" + }, + { + "value": "BeingSettled", + "name": "BeingSettled", + "description": "Setting" + }, + { + "value": "Settled", + "name": "Settled", + "description": "Settled" + }, + { + "value": "Paused", + "name": "Paused", + "description": "Suspended" + }, + { + "value": "Closed", + "name": "Closed", + "description": "Offline" + }, + { + "value": "CancelOnly", + "name": "CancelOnly", + "description": "Orders can only be canceled" + } + ] + }, + "fundingFeeRate": { + "type": "number", + "description": "Funding fee rate" + }, + "predictedFundingFeeRate": { + "type": "number", + "description": "Predicted funding fee rate" + }, + "fundingRateGranularity": { + "type": "integer", + "description": "Funding interval(millisecond)" + }, + "openInterest": { + "type": "string", + "description": "Open interest" + }, + "turnoverOf24h": { + "type": "number", + "description": "24-hour turnover" + }, + "volumeOf24h": { + "type": "number", + "description": "24-hour volume" + }, + "markPrice": { + "type": "number", + "description": "Mark price" + }, + "indexPrice": { + "type": "number", + "description": "Index price" + }, + "lastTradePrice": { + "type": "number", + "description": "Last trade price" + }, + "nextFundingRateTime": { + "type": "integer", + "description": "Next funding rate time(millisecond)" + }, + "maxLeverage": { + "type": "integer", + "description": "Maximum leverage" + }, + "sourceExchanges": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The contract index price source exchange" + }, + "premiumsSymbol1M": { + "type": "string", + "description": "Premium index symbol(1 minute)" + }, + "premiumsSymbol8H": { + "type": "string", + "description": "Premium index symbol(8 hours)" + }, + "fundingBaseSymbol1M": { + "type": "string", + "description": "Base currency interest rate symbol(1 minute)" + }, + "fundingQuoteSymbol1M": { + "type": "string", + "description": "Quote currency interest rate symbol(1 minute)" + }, + "lowPrice": { + "type": "number", + "description": "24-hour lowest price" + }, + "highPrice": { + "type": "number", + "description": "24-hour highest price" + }, + "priceChgPct": { + "type": "number", + "description": "24-hour price change% " + }, + "priceChg": { + "type": "number", + "description": "24-hour price change" + }, + "k": { + "type": "number" + }, + "m": { + "type": "number" + }, + "f": { + "type": "number" + }, + "mmrLimit": { + "type": "number" + }, + "mmrLevConstant": { + "type": "number" + }, + "supportCross": { + "type": "boolean", + "description": "Whether support Cross Margin" + } + }, + "required": [ + "symbol", + "rootSymbol", + "type", + "firstOpenDate", + "expireDate", + "settleDate", + "baseCurrency", + "quoteCurrency", + "settleCurrency", + "maxOrderQty", + "maxPrice", + "lotSize", + "tickSize", + "indexPriceTickSize", + "multiplier", + "initialMargin", + "maintainMargin", + "maxRiskLimit", + "minRiskLimit", + "riskStep", + "makerFeeRate", + "takerFeeRate", + "takerFixFee", + "makerFixFee", + "settlementFee", + "isDeleverage", + "isQuanto", + "isInverse", + "markMethod", + "fairMethod", + "fundingBaseSymbol", + "fundingQuoteSymbol", + "fundingRateSymbol", + "indexSymbol", + "settlementSymbol", + "status", + "fundingFeeRate", + "predictedFundingFeeRate", + "fundingRateGranularity", + "openInterest", + "turnoverOf24h", + "volumeOf24h", + "markPrice", + "indexPrice", + "lastTradePrice", + "nextFundingRateTime", + "maxLeverage", + "sourceExchanges", + "premiumsSymbol1M", + "premiumsSymbol8H", + "fundingBaseSymbol1M", + "fundingQuoteSymbol1M", + "lowPrice", + "highPrice", + "priceChgPct", + "priceChg", + "k", + "m", + "f", + "mmrLimit", + "mmrLevConstant", + "supportCross" + ] + } + }, + "required": [ + "code", + "data" + ] + } + } + } + } + }, + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470221", + "x-abandon": "normal", + "x-domain": "Futures", + "x-api-channel": "Public", + "x-api-permission": "NULL", + "x-api-rate-limit-pool": "Public", + "x-sdk-service": "Futures", + "x-sdk-sub-service": "Market", + "x-sdk-method-name": "getSymbol", + "x-sdk-method-description": "Get information of specified contracts that can be traded. This API will return a list of tradable contracts, including some key parameters of the contract such as the symbol name, tick size, mark price,etc.", + "x-api-rate-limit": 3, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"symbol\\\": \\\"XBTUSDM\\\",\\n \\\"rootSymbol\\\": \\\"XBT\\\",\\n \\\"type\\\": \\\"FFWCSX\\\",\\n \\\"firstOpenDate\\\": 1552638575000,\\n \\\"expireDate\\\": null,\\n \\\"settleDate\\\": null,\\n \\\"baseCurrency\\\": \\\"XBT\\\",\\n \\\"quoteCurrency\\\": \\\"USD\\\",\\n \\\"settleCurrency\\\": \\\"XBT\\\",\\n \\\"maxOrderQty\\\": 10000000,\\n \\\"maxPrice\\\": 1000000.0,\\n \\\"lotSize\\\": 1,\\n \\\"tickSize\\\": 0.1,\\n \\\"indexPriceTickSize\\\": 0.1,\\n \\\"multiplier\\\": -1.0,\\n \\\"initialMargin\\\": 0.014,\\n \\\"maintainMargin\\\": 0.007,\\n \\\"maxRiskLimit\\\": 1,\\n \\\"minRiskLimit\\\": 1,\\n \\\"riskStep\\\": 0,\\n \\\"makerFeeRate\\\": 2.0E-4,\\n \\\"takerFeeRate\\\": 6.0E-4,\\n \\\"takerFixFee\\\": 0.0,\\n \\\"makerFixFee\\\": 0.0,\\n \\\"settlementFee\\\": null,\\n \\\"isDeleverage\\\": true,\\n \\\"isQuanto\\\": false,\\n \\\"isInverse\\\": true,\\n \\\"markMethod\\\": \\\"FairPrice\\\",\\n \\\"fairMethod\\\": \\\"FundingRate\\\",\\n \\\"fundingBaseSymbol\\\": \\\".XBTINT8H\\\",\\n \\\"fundingQuoteSymbol\\\": \\\".USDINT8H\\\",\\n \\\"fundingRateSymbol\\\": \\\".XBTUSDMFPI8H\\\",\\n \\\"indexSymbol\\\": \\\".BXBT\\\",\\n \\\"settlementSymbol\\\": null,\\n \\\"status\\\": \\\"Open\\\",\\n \\\"fundingFeeRate\\\": 1.75E-4,\\n \\\"predictedFundingFeeRate\\\": 1.76E-4,\\n \\\"fundingRateGranularity\\\": 28800000,\\n \\\"openInterest\\\": \\\"61725904\\\",\\n \\\"turnoverOf24h\\\": 209.56303473,\\n \\\"volumeOf24h\\\": 1.4354731E7,\\n \\\"markPrice\\\": 68336.7,\\n \\\"indexPrice\\\": 68335.29,\\n \\\"lastTradePrice\\\": 68349.3,\\n \\\"nextFundingRateTime\\\": 17402942,\\n \\\"maxLeverage\\\": 75,\\n \\\"sourceExchanges\\\": [\\n \\\"kraken\\\",\\n \\\"bitstamp\\\",\\n \\\"crypto\\\"\\n ],\\n \\\"premiumsSymbol1M\\\": \\\".XBTUSDMPI\\\",\\n \\\"premiumsSymbol8H\\\": \\\".XBTUSDMPI8H\\\",\\n \\\"fundingBaseSymbol1M\\\": \\\".XBTINT\\\",\\n \\\"fundingQuoteSymbol1M\\\": \\\".USDINT\\\",\\n \\\"lowPrice\\\": 67436.7,\\n \\\"highPrice\\\": 69471.8,\\n \\\"priceChgPct\\\": 0.0097,\\n \\\"priceChg\\\": 658.7,\\n \\\"k\\\": 2645000.0,\\n \\\"m\\\": 1640000.0,\\n \\\"f\\\": 1.3,\\n \\\"mmrLimit\\\": 0.3,\\n \\\"mmrLevConstant\\\": 75.0,\\n \\\"supportCross\\\": true\\n }\\n}", + "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDTM\\\"}" + } + }, "/api/v1/contracts/active": { "get": { "summary": "Get All Symbols", @@ -462,20 +926,25 @@ "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": [\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"rootSymbol\\\": \\\"USDT\\\",\\n \\\"type\\\": \\\"FFWCSX\\\",\\n \\\"firstOpenDate\\\": 1585555200000,\\n \\\"expireDate\\\": null,\\n \\\"settleDate\\\": null,\\n \\\"baseCurrency\\\": \\\"XBT\\\",\\n \\\"quoteCurrency\\\": \\\"USDT\\\",\\n \\\"settleCurrency\\\": \\\"USDT\\\",\\n \\\"maxOrderQty\\\": 1000000,\\n \\\"maxPrice\\\": 1000000.0,\\n \\\"lotSize\\\": 1,\\n \\\"tickSize\\\": 0.1,\\n \\\"indexPriceTickSize\\\": 0.01,\\n \\\"multiplier\\\": 0.001,\\n \\\"initialMargin\\\": 0.008,\\n \\\"maintainMargin\\\": 0.004,\\n \\\"maxRiskLimit\\\": 100000,\\n \\\"minRiskLimit\\\": 100000,\\n \\\"riskStep\\\": 50000,\\n \\\"makerFeeRate\\\": 2.0E-4,\\n \\\"takerFeeRate\\\": 6.0E-4,\\n \\\"takerFixFee\\\": 0.0,\\n \\\"makerFixFee\\\": 0.0,\\n \\\"settlementFee\\\": null,\\n \\\"isDeleverage\\\": true,\\n \\\"isQuanto\\\": true,\\n \\\"isInverse\\\": false,\\n \\\"markMethod\\\": \\\"FairPrice\\\",\\n \\\"fairMethod\\\": \\\"FundingRate\\\",\\n \\\"fundingBaseSymbol\\\": \\\".XBTINT8H\\\",\\n \\\"fundingQuoteSymbol\\\": \\\".USDTINT8H\\\",\\n \\\"fundingRateSymbol\\\": \\\".XBTUSDTMFPI8H\\\",\\n \\\"indexSymbol\\\": \\\".KXBTUSDT\\\",\\n \\\"settlementSymbol\\\": \\\"\\\",\\n \\\"status\\\": \\\"Open\\\",\\n \\\"fundingFeeRate\\\": 1.53E-4,\\n \\\"predictedFundingFeeRate\\\": 8.0E-5,\\n \\\"fundingRateGranularity\\\": 28800000,\\n \\\"openInterest\\\": \\\"6384957\\\",\\n \\\"turnoverOf24h\\\": 5.788402220999069E8,\\n \\\"volumeOf24h\\\": 8274.432,\\n \\\"markPrice\\\": 69732.33,\\n \\\"indexPrice\\\": 69732.32,\\n \\\"lastTradePrice\\\": 69732,\\n \\\"nextFundingRateTime\\\": 21265941,\\n \\\"maxLeverage\\\": 125,\\n \\\"sourceExchanges\\\": [\\n \\\"okex\\\",\\n \\\"binance\\\",\\n \\\"kucoin\\\",\\n \\\"bybit\\\",\\n \\\"bitmart\\\",\\n \\\"gateio\\\"\\n ],\\n \\\"premiumsSymbol1M\\\": \\\".XBTUSDTMPI\\\",\\n \\\"premiumsSymbol8H\\\": \\\".XBTUSDTMPI8H\\\",\\n \\\"fundingBaseSymbol1M\\\": \\\".XBTINT\\\",\\n \\\"fundingQuoteSymbol1M\\\": \\\".USDTINT\\\",\\n \\\"lowPrice\\\": 68817.5,\\n \\\"highPrice\\\": 71615.8,\\n \\\"priceChgPct\\\": 6.0E-4,\\n \\\"priceChg\\\": 48.0,\\n \\\"k\\\": 490.0,\\n \\\"m\\\": 300.0,\\n \\\"f\\\": 1.3,\\n \\\"mmrLimit\\\": 0.3,\\n \\\"mmrLevConstant\\\": 125.0,\\n \\\"supportCross\\\": true\\n }\\n ]\\n}" } }, - "/api/v1/contracts/{symbol}": { + "/api/v1/ticker": { "get": { - "summary": "Get Symbol", + "summary": "Get Ticker", "deprecated": false, - "description": "Get information of specified contracts that can be traded. This API will return a list of tradable contracts, including some key parameters of the contract such as the symbol name, tick size, mark price,etc.", + "description": "This endpoint returns \"last traded price/size\"、\"best bid/ask price/size\" etc. of a single symbol. These messages can also be obtained through Websocket.", "tags": [], "parameters": [ { "name": "symbol", - "in": "path", - "description": "Path Parameter. Symbol of the contract", + "in": "query", + "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) \n\n", "required": true, "schema": { - "type": "string" + "type": "string", + "example": [ + "XBTUSDTM", + "XBTUSDM", + "ETHUSDTM" + ] } } ], @@ -489,417 +958,214 @@ "properties": { "code": { "type": "string", - "description": "200000 is for success, other is error" - }, - "data": { - "type": "object", - "properties": { - "symbol": { - "type": "string", - "description": "Symbol", - "example": [ - "XBTUSDTM", - "XBTUSDCM", - "XBTUSDM" - ] - }, - "rootSymbol": { - "type": "string", - "description": "Contract group", - "example": [ - "USDT", - "USDC", - "XBT" - ] - }, - "type": { - "type": "string", - "description": "Type of the contract", - "enum": [ - "FFWCSX", - "FFICSX" - ], - "x-api-enum": [ - { - "value": "FFWCSX", - "name": "FFWCSX", - "description": "Standardized swap contracts standard financial futures on swap, expiration swap funding rate" - }, - { - "value": "FFICSX", - "name": "FFICSX", - "description": "Futures Contract" - } - ] - }, - "firstOpenDate": { - "type": "integer", - "description": "First Open Date(millisecond)", - "format": "int64" - }, - "expireDate": { - "type": "integer", - "description": "Expiration date(millisecond). Null means it will never expire", - "format": "int64" - }, - "settleDate": { - "type": "integer", - "description": "Settlement date(millisecond). Null indicates that automatic settlement is not supported", - "format": "int64" - }, - "baseCurrency": { - "type": "string", - "description": "Base currency" - }, - "quoteCurrency": { - "type": "string", - "description": "Quote currency" - }, - "settleCurrency": { - "type": "string", - "description": "Currency used to clear and settle the trades" - }, - "maxOrderQty": { - "type": "integer", - "description": "Maximum order quantity" - }, - "maxPrice": { - "type": "number", - "description": "Maximum order price" - }, - "lotSize": { - "type": "integer", - "description": "Minimum lot size" - }, - "tickSize": { - "type": "number", - "description": "Minimum price changes" - }, - "indexPriceTickSize": { - "type": "number", - "description": "Index price of tick size" - }, - "multiplier": { - "type": "number", - "description": "The basic unit of the contract API is lots. For the number of coins in each lot, please refer to the param multiplier. For example, for XBTUSDTM, multiplier=0.001, which corresponds to the value of each XBTUSDTM contract being 0.001 BTC. There is also a special case. All coin-swap contracts, such as each XBTUSDM contract, correspond to 1 USD." - }, - "initialMargin": { - "type": "number", - "description": "Initial margin requirement" - }, - "maintainMargin": { - "type": "number", - "description": "Maintenance margin requirement" - }, - "maxRiskLimit": { - "type": "integer", - "description": "Maximum risk limit (unit: XBT)" - }, - "minRiskLimit": { - "type": "integer", - "description": "Minimum risk limit (unit: XBT)" - }, - "riskStep": { - "type": "integer", - "description": "Risk limit increment value (unit: XBT)" - }, - "makerFeeRate": { - "type": "number", - "description": "Maker fee rate" - }, - "takerFeeRate": { - "type": "number", - "description": "Taker fee rate" - }, - "takerFixFee": { - "type": "number", - "description": "Deprecated param" - }, - "makerFixFee": { - "type": "number", - "description": "Deprecated param" - }, - "settlementFee": { - "type": "number", - "description": "Settlement fee" - }, - "isDeleverage": { - "type": "boolean", - "description": "Enabled ADL or not" - }, - "isQuanto": { - "type": "boolean", - "description": "Deprecated param" - }, - "isInverse": { - "type": "boolean", - "description": "Whether it is a reverse contract" - }, - "markMethod": { - "type": "string", - "description": "Marking method", - "enum": [ - "FairPrice" - ], - "x-api-enum": [ - { - "value": "FairPrice", - "name": "FairPrice", - "description": "Fair Price" - } - ] - }, - "fairMethod": { - "type": "string", - "description": "Fair price marking method, The Futures contract is null", - "enum": [ - "FundingRate" - ], - "x-api-enum": [ - { - "value": "FundingRate", - "name": "FundingRate", - "description": "FundingRate" - } - ] - }, - "fundingBaseSymbol": { - "type": "string", - "description": "Ticker symbol of the based currency" - }, - "fundingQuoteSymbol": { - "type": "string", - "description": "Ticker symbol of the quote currency" - }, - "fundingRateSymbol": { - "type": "string", - "description": "Funding rate symbol" - }, - "indexSymbol": { - "type": "string", - "description": "Index symbol" + "description": "200000 is for success, other is error" + }, + "data": { + "type": "object", + "properties": { + "sequence": { + "type": "integer", + "description": "Sequence number, used to judge whether the messages pushed by Websocket is continuous.", + "format": "int64" }, - "settlementSymbol": { + "symbol": { "type": "string", - "description": "Settlement Symbol" + "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) " }, - "status": { + "side": { "type": "string", - "description": "Contract status", + "description": "Filled side, The trade side indicates the taker order side. A taker order is the order that was matched with orders opened on the order book.", "enum": [ - "Init", - "Open", - "BeingSettled", - "Settled", - "Paused", - "Closed", - "CancelOnly" + "buy", + "sell" ], "x-api-enum": [ { - "value": "Init", - "name": "Init", - "description": "Initial" - }, - { - "value": "Open", - "name": "Open", - "description": "Online" - }, - { - "value": "BeingSettled", - "name": "BeingSettled", - "description": "Setting" - }, - { - "value": "Settled", - "name": "Settled", - "description": "Settled" - }, - { - "value": "Paused", - "name": "Paused", - "description": "Suspended" - }, - { - "value": "Closed", - "name": "Closed", - "description": "Offline" + "value": "buy", + "name": "buy", + "description": "buy" }, { - "value": "CancelOnly", - "name": "CancelOnly", - "description": "Orders can only be canceled" + "value": "sell", + "name": "sell", + "description": "sell" } ] }, - "fundingFeeRate": { - "type": "number", - "description": "Funding fee rate" - }, - "predictedFundingFeeRate": { - "type": "number", - "description": "Predicted funding fee rate" - }, - "fundingRateGranularity": { + "size": { "type": "integer", - "description": "Funding interval(millisecond)" + "description": "Filled quantity" }, - "openInterest": { + "tradeId": { "type": "string", - "description": "Open interest" - }, - "turnoverOf24h": { - "type": "number", - "description": "24-hour turnover" - }, - "volumeOf24h": { - "type": "number", - "description": "24-hour volume" - }, - "markPrice": { - "type": "number", - "description": "Mark price" - }, - "indexPrice": { - "type": "number", - "description": "Index price" - }, - "lastTradePrice": { - "type": "number", - "description": "Last trade price" - }, - "nextFundingRateTime": { - "type": "integer", - "description": "Next funding rate time(millisecond)" - }, - "maxLeverage": { - "type": "integer", - "description": "Maximum leverage" - }, - "sourceExchanges": { - "type": "array", - "items": { - "type": "string" - }, - "description": "The contract index price source exchange" + "description": "Transaction ID" }, - "premiumsSymbol1M": { + "price": { "type": "string", - "description": "Premium index symbol(1 minute)" + "description": "Filled price" }, - "premiumsSymbol8H": { + "bestBidPrice": { "type": "string", - "description": "Premium index symbol(8 hours)" + "description": "Best bid price" }, - "fundingBaseSymbol1M": { - "type": "string", - "description": "Base currency interest rate symbol(1 minute)" + "bestBidSize": { + "type": "integer", + "description": "Best bid size" }, - "fundingQuoteSymbol1M": { + "bestAskPrice": { "type": "string", - "description": "Quote currency interest rate symbol(1 minute)" - }, - "lowPrice": { - "type": "number", - "description": "24-hour lowest price" - }, - "highPrice": { - "type": "number", - "description": "24-hour highest price" - }, - "priceChgPct": { - "type": "number", - "description": "24-hour price change% " - }, - "priceChg": { - "type": "number", - "description": "24-hour price change" - }, - "k": { - "type": "number" - }, - "m": { - "type": "number" - }, - "f": { - "type": "number" + "description": "Best ask price" }, - "mmrLimit": { - "type": "number" + "bestAskSize": { + "type": "integer", + "description": "Best ask size" }, - "mmrLevConstant": { - "type": "number" + "ts": { + "type": "integer", + "description": "Filled time(nanosecond)", + "format": "int64" + } + }, + "required": [ + "sequence", + "symbol", + "side", + "size", + "tradeId", + "price", + "bestBidPrice", + "bestBidSize", + "bestAskPrice", + "bestAskSize", + "ts" + ] + } + }, + "required": [ + "code", + "data" + ] + } + } + } + } + }, + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470222", + "x-abandon": "normal", + "x-domain": "Futures", + "x-api-channel": "Public", + "x-api-permission": "NULL", + "x-api-rate-limit-pool": "Public", + "x-sdk-service": "Futures", + "x-sdk-sub-service": "Market", + "x-sdk-method-name": "getTicker", + "x-sdk-method-description": "This endpoint returns \"last traded price/size\"、\"best bid/ask price/size\" etc. of a single symbol. These messages can also be obtained through Websocket.", + "x-api-rate-limit": 2, + "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"sequence\\\":1697895100310,\\\"symbol\\\":\\\"XBTUSDM\\\",\\\"side\\\":\\\"sell\\\",\\\"size\\\":2936,\\\"tradeId\\\":\\\"1697901180000\\\",\\\"price\\\":\\\"67158.4\\\",\\\"bestBidPrice\\\":\\\"67169.6\\\",\\\"bestBidSize\\\":32345,\\\"bestAskPrice\\\":\\\"67169.7\\\",\\\"bestAskSize\\\":7251,\\\"ts\\\":1729163001780000000}}", + "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDTM\\\"}" + } + }, + "/api/v1/allTickers": { + "get": { + "summary": "Get All Tickers", + "deprecated": false, + "description": "This endpoint returns \"last traded price/size\"、\"best bid/ask price/size\" etc. of a single symbol. These messages can also be obtained through Websocket.", + "tags": [], + "parameters": [], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "string", + "description": "200000 is for success, other is error" + }, + "data": { + "type": "array", + "items": { + "type": "object", + "properties": { + "sequence": { + "type": "integer", + "description": "Sequence number, used to judge whether the messages pushed by Websocket is continuous.", + "format": "int64" + }, + "symbol": { + "type": "string", + "description": "Symbol" + }, + "side": { + "type": "string", + "description": "Trade direction", + "enum": [ + "buy", + "sell" + ], + "x-api-enum": [ + { + "value": "buy", + "name": "BUY", + "description": "" + }, + { + "value": "sell", + "name": "SELL", + "description": "" + } + ] + }, + "size": { + "type": "integer", + "description": "Filled side, The trade side indicates the taker order side. A taker order is the order that was matched with orders opened on the order book." + }, + "tradeId": { + "type": "string", + "description": "Transaction ID" + }, + "price": { + "type": "string", + "description": "Filled price" + }, + "bestBidPrice": { + "type": "string", + "description": "Best bid price" + }, + "bestBidSize": { + "type": "integer", + "description": "Best bid size" + }, + "bestAskPrice": { + "type": "string", + "description": "Best ask price" + }, + "bestAskSize": { + "type": "integer", + "description": "Best ask size" + }, + "ts": { + "type": "integer", + "description": "Filled time(nanosecond)", + "format": "int64" + } }, - "supportCross": { - "type": "boolean", - "description": "Whether support Cross Margin" - } - }, - "required": [ - "symbol", - "rootSymbol", - "type", - "firstOpenDate", - "expireDate", - "settleDate", - "baseCurrency", - "quoteCurrency", - "settleCurrency", - "maxOrderQty", - "maxPrice", - "lotSize", - "tickSize", - "indexPriceTickSize", - "multiplier", - "initialMargin", - "maintainMargin", - "maxRiskLimit", - "minRiskLimit", - "riskStep", - "makerFeeRate", - "takerFeeRate", - "takerFixFee", - "makerFixFee", - "settlementFee", - "isDeleverage", - "isQuanto", - "isInverse", - "markMethod", - "fairMethod", - "fundingBaseSymbol", - "fundingQuoteSymbol", - "fundingRateSymbol", - "indexSymbol", - "settlementSymbol", - "status", - "fundingFeeRate", - "predictedFundingFeeRate", - "fundingRateGranularity", - "openInterest", - "turnoverOf24h", - "volumeOf24h", - "markPrice", - "indexPrice", - "lastTradePrice", - "nextFundingRateTime", - "maxLeverage", - "sourceExchanges", - "premiumsSymbol1M", - "premiumsSymbol8H", - "fundingBaseSymbol1M", - "fundingQuoteSymbol1M", - "lowPrice", - "highPrice", - "priceChgPct", - "priceChg", - "k", - "m", - "f", - "mmrLimit", - "mmrLevConstant", - "supportCross" - ] + "required": [ + "sequence", + "symbol", + "side", + "tradeId", + "price", + "bestBidPrice", + "bestBidSize", + "bestAskPrice", + "bestAskSize", + "ts", + "size" + ] + } } }, "required": [ @@ -911,7 +1177,7 @@ } } }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470221", + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470223", "x-abandon": "normal", "x-domain": "Futures", "x-api-channel": "Public", @@ -919,32 +1185,26 @@ "x-api-rate-limit-pool": "Public", "x-sdk-service": "Futures", "x-sdk-sub-service": "Market", - "x-sdk-method-name": "getSymbol", - "x-sdk-method-description": "Get information of specified contracts that can be traded. This API will return a list of tradable contracts, including some key parameters of the contract such as the symbol name, tick size, mark price,etc.", - "x-api-rate-limit": 3, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"symbol\\\": \\\"XBTUSDM\\\",\\n \\\"rootSymbol\\\": \\\"XBT\\\",\\n \\\"type\\\": \\\"FFWCSX\\\",\\n \\\"firstOpenDate\\\": 1552638575000,\\n \\\"expireDate\\\": null,\\n \\\"settleDate\\\": null,\\n \\\"baseCurrency\\\": \\\"XBT\\\",\\n \\\"quoteCurrency\\\": \\\"USD\\\",\\n \\\"settleCurrency\\\": \\\"XBT\\\",\\n \\\"maxOrderQty\\\": 10000000,\\n \\\"maxPrice\\\": 1000000.0,\\n \\\"lotSize\\\": 1,\\n \\\"tickSize\\\": 0.1,\\n \\\"indexPriceTickSize\\\": 0.1,\\n \\\"multiplier\\\": -1.0,\\n \\\"initialMargin\\\": 0.014,\\n \\\"maintainMargin\\\": 0.007,\\n \\\"maxRiskLimit\\\": 1,\\n \\\"minRiskLimit\\\": 1,\\n \\\"riskStep\\\": 0,\\n \\\"makerFeeRate\\\": 2.0E-4,\\n \\\"takerFeeRate\\\": 6.0E-4,\\n \\\"takerFixFee\\\": 0.0,\\n \\\"makerFixFee\\\": 0.0,\\n \\\"settlementFee\\\": null,\\n \\\"isDeleverage\\\": true,\\n \\\"isQuanto\\\": false,\\n \\\"isInverse\\\": true,\\n \\\"markMethod\\\": \\\"FairPrice\\\",\\n \\\"fairMethod\\\": \\\"FundingRate\\\",\\n \\\"fundingBaseSymbol\\\": \\\".XBTINT8H\\\",\\n \\\"fundingQuoteSymbol\\\": \\\".USDINT8H\\\",\\n \\\"fundingRateSymbol\\\": \\\".XBTUSDMFPI8H\\\",\\n \\\"indexSymbol\\\": \\\".BXBT\\\",\\n \\\"settlementSymbol\\\": null,\\n \\\"status\\\": \\\"Open\\\",\\n \\\"fundingFeeRate\\\": 1.75E-4,\\n \\\"predictedFundingFeeRate\\\": 1.76E-4,\\n \\\"fundingRateGranularity\\\": 28800000,\\n \\\"openInterest\\\": \\\"61725904\\\",\\n \\\"turnoverOf24h\\\": 209.56303473,\\n \\\"volumeOf24h\\\": 1.4354731E7,\\n \\\"markPrice\\\": 68336.7,\\n \\\"indexPrice\\\": 68335.29,\\n \\\"lastTradePrice\\\": 68349.3,\\n \\\"nextFundingRateTime\\\": 17402942,\\n \\\"maxLeverage\\\": 75,\\n \\\"sourceExchanges\\\": [\\n \\\"kraken\\\",\\n \\\"bitstamp\\\",\\n \\\"crypto\\\"\\n ],\\n \\\"premiumsSymbol1M\\\": \\\".XBTUSDMPI\\\",\\n \\\"premiumsSymbol8H\\\": \\\".XBTUSDMPI8H\\\",\\n \\\"fundingBaseSymbol1M\\\": \\\".XBTINT\\\",\\n \\\"fundingQuoteSymbol1M\\\": \\\".USDINT\\\",\\n \\\"lowPrice\\\": 67436.7,\\n \\\"highPrice\\\": 69471.8,\\n \\\"priceChgPct\\\": 0.0097,\\n \\\"priceChg\\\": 658.7,\\n \\\"k\\\": 2645000.0,\\n \\\"m\\\": 1640000.0,\\n \\\"f\\\": 1.3,\\n \\\"mmrLimit\\\": 0.3,\\n \\\"mmrLevConstant\\\": 75.0,\\n \\\"supportCross\\\": true\\n }\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDTM\\\"}" + "x-sdk-method-name": "getAllTickers", + "x-sdk-method-description": "This endpoint returns \"last traded price/size\"、\"best bid/ask price/size\" etc. of a single symbol. These messages can also be obtained through Websocket.", + "x-api-rate-limit": 5, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": [\\n {\\n \\\"sequence\\\": 1707992727046,\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"side\\\": \\\"sell\\\",\\n \\\"size\\\": 21,\\n \\\"tradeId\\\": \\\"1784299761369\\\",\\n \\\"price\\\": \\\"67153\\\",\\n \\\"bestBidPrice\\\": \\\"67153\\\",\\n \\\"bestBidSize\\\": 2767,\\n \\\"bestAskPrice\\\": \\\"67153.1\\\",\\n \\\"bestAskSize\\\": 5368,\\n \\\"ts\\\": 1729163466659000000\\n },\\n {\\n \\\"sequence\\\": 1697895166299,\\n \\\"symbol\\\": \\\"XBTUSDM\\\",\\n \\\"side\\\": \\\"sell\\\",\\n \\\"size\\\": 1956,\\n \\\"tradeId\\\": \\\"1697901245065\\\",\\n \\\"price\\\": \\\"67145.2\\\",\\n \\\"bestBidPrice\\\": \\\"67135.3\\\",\\n \\\"bestBidSize\\\": 1,\\n \\\"bestAskPrice\\\": \\\"67135.8\\\",\\n \\\"bestAskSize\\\": 3,\\n \\\"ts\\\": 1729163445340000000\\n }\\n ]\\n}" } }, - "/api/v1/ticker": { + "/api/v1/level2/snapshot": { "get": { - "summary": "Get Ticker", + "summary": "Get Full OrderBook", "deprecated": false, - "description": "This endpoint returns \"last traded price/size\"、\"best bid/ask price/size\" etc. of a single symbol. These messages can also be obtained through Websocket.", + "description": "Query for Full orderbook depth data. (aggregated by price) It is generally used by professional traders because it uses more server resources and traffic, and we have strict access rate limit control. To maintain up-to-date Order Book, please use Websocket incremental feed after retrieving the OrderBook.", "tags": [], "parameters": [ { "name": "symbol", "in": "query", - "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) \n\n", - "required": true, + "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) \n", + "required": false, "schema": { - "type": "string", - "example": [ - "XBTUSDTM", - "XBTUSDM", - "ETHUSDTM" - ] + "type": "string" } } ], @@ -965,78 +1225,156 @@ "properties": { "sequence": { "type": "integer", - "description": "Sequence number, used to judge whether the messages pushed by Websocket is continuous.", + "description": "Sequence number", "format": "int64" }, "symbol": { "type": "string", "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) " }, - "side": { - "type": "string", - "description": "Filled side, The trade side indicates the taker order side. A taker order is the order that was matched with orders opened on the order book.", - "enum": [ - "buy", - "sell" - ], - "x-api-enum": [ - { - "value": "buy", - "name": "buy", - "description": "buy" - }, - { - "value": "sell", - "name": "sell", - "description": "sell" + "bids": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "number", + "description": "Price, Size" } - ] + }, + "description": "bids, from high to low" }, - "size": { + "asks": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "number", + "description": "Price, Size" + } + }, + "description": "asks, from low to high" + }, + "ts": { + "type": "integer", + "format": "int64", + "description": "Timestamp(nanosecond)" + } + }, + "required": [ + "sequence", + "symbol", + "bids", + "asks", + "ts" + ] + } + }, + "required": [ + "code", + "data" + ] + } + } + } + } + }, + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470224", + "x-abandon": "normal", + "x-domain": "Futures", + "x-api-channel": "Public", + "x-api-permission": "NULL", + "x-api-rate-limit-pool": "Public", + "x-sdk-service": "Futures", + "x-sdk-sub-service": "Market", + "x-sdk-method-name": "getFullOrderBook", + "x-sdk-method-description": "Query for Full orderbook depth data. (aggregated by price) It is generally used by professional traders because it uses more server resources and traffic, and we have strict access rate limit control. To maintain up-to-date Order Book, please use Websocket incremental feed after retrieving the OrderBook.", + "x-api-rate-limit": 3, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"sequence\\\": 1697895963339,\\n \\\"symbol\\\": \\\"XBTUSDM\\\",\\n \\\"bids\\\": [\\n [\\n 66968,\\n 2\\n ],\\n [\\n 66964.8,\\n 25596\\n ]\\n ],\\n \\\"asks\\\": [\\n [\\n 66968.1,\\n 13501\\n ],\\n [\\n 66968.7,\\n 2032\\n ]\\n ],\\n \\\"ts\\\": 1729168101216000000\\n }\\n}", + "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDM\\\"}" + } + }, + "/api/v1/level2/depth{size}": { + "get": { + "summary": "Get Part OrderBook", + "deprecated": false, + "description": "Query for part orderbook depth data. (aggregated by price) You are recommended to request via this endpoint as the system reponse would be faster and cosume less traffic.", + "tags": [], + "parameters": [ + { + "name": "symbol", + "in": "query", + "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) ", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "size", + "in": "path", + "description": "Get the depth layer, optional value: 20, 100", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "object", + "properties": { + "sequence": { "type": "integer", - "description": "Filled quantity" - }, - "tradeId": { - "type": "string", - "description": "Transaction ID" - }, - "price": { - "type": "string", - "description": "Filled price" + "description": "Sequence number", + "format": "int64" }, - "bestBidPrice": { + "symbol": { "type": "string", - "description": "Best bid price" - }, - "bestBidSize": { - "type": "integer", - "description": "Best bid size" + "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) " }, - "bestAskPrice": { - "type": "string", - "description": "Best ask price" + "bids": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "number", + "description": "Price, Size" + } + }, + "description": "bids, from high to low" }, - "bestAskSize": { - "type": "integer", - "description": "Best ask size" + "asks": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "number", + "description": "Price, Size" + } + }, + "description": "asks, from low to high" }, "ts": { "type": "integer", - "description": "Filled time(nanosecond)", + "description": "Timestamp(nanosecond)", "format": "int64" } }, "required": [ "sequence", "symbol", - "side", - "size", - "tradeId", - "price", - "bestBidPrice", - "bestBidSize", - "bestAskPrice", - "bestAskSize", + "bids", + "asks", "ts" ] } @@ -1050,7 +1388,7 @@ } } }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470222", + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470225", "x-abandon": "normal", "x-domain": "Futures", "x-api-channel": "Public", @@ -1058,20 +1396,30 @@ "x-api-rate-limit-pool": "Public", "x-sdk-service": "Futures", "x-sdk-sub-service": "Market", - "x-sdk-method-name": "getTicker", - "x-sdk-method-description": "This endpoint returns \"last traded price/size\"、\"best bid/ask price/size\" etc. of a single symbol. These messages can also be obtained through Websocket.", - "x-api-rate-limit": 2, - "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"sequence\\\":1697895100310,\\\"symbol\\\":\\\"XBTUSDM\\\",\\\"side\\\":\\\"sell\\\",\\\"size\\\":2936,\\\"tradeId\\\":\\\"1697901180000\\\",\\\"price\\\":\\\"67158.4\\\",\\\"bestBidPrice\\\":\\\"67169.6\\\",\\\"bestBidSize\\\":32345,\\\"bestAskPrice\\\":\\\"67169.7\\\",\\\"bestAskSize\\\":7251,\\\"ts\\\":1729163001780000000}}", - "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDTM\\\"}" + "x-sdk-method-name": "getPartOrderBook", + "x-sdk-method-description": "Query for part orderbook depth data. (aggregated by price) You are recommended to request via this endpoint as the system reponse would be faster and cosume less traffic.", + "x-api-rate-limit": 5, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"sequence\\\": 1697895963339,\\n \\\"symbol\\\": \\\"XBTUSDM\\\",\\n \\\"bids\\\": [\\n [\\n 66968,\\n 2\\n ],\\n [\\n 66964.8,\\n 25596\\n ]\\n ],\\n \\\"asks\\\": [\\n [\\n 66968.1,\\n 13501\\n ],\\n [\\n 66968.7,\\n 2032\\n ]\\n ],\\n \\\"ts\\\": 1729168101216000000\\n }\\n}", + "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDM\\\", \\\"size\\\": \\\"20\\\"}" } }, - "/api/v1/allTickers": { + "/api/v1/trade/history": { "get": { - "summary": "Get All Tickers", + "summary": "Get Trade History", "deprecated": false, - "description": "This endpoint returns \"last traded price/size\"、\"best bid/ask price/size\" etc. of a single symbol. These messages can also be obtained through Websocket.", + "description": "Request via this endpoint to get the trade history of the specified symbol, the returned quantity is the last 100 transaction records.", "tags": [], - "parameters": [], + "parameters": [ + { + "name": "symbol", + "in": "query", + "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) ", + "required": true, + "schema": { + "type": "string" + } + } + ], "responses": { "200": { "description": "", @@ -1081,8 +1429,7 @@ "type": "object", "properties": { "code": { - "type": "string", - "description": "200000 is for success, other is error" + "type": "string" }, "data": { "type": "array", @@ -1091,16 +1438,41 @@ "properties": { "sequence": { "type": "integer", - "description": "Sequence number, used to judge whether the messages pushed by Websocket is continuous.", + "description": "Sequence number", "format": "int64" }, - "symbol": { + "contractId": { + "type": "integer", + "description": "Deprecated param" + }, + "tradeId": { "type": "string", - "description": "Symbol" + "description": "Transaction ID" + }, + "makerOrderId": { + "type": "string", + "description": "Maker order ID" + }, + "takerOrderId": { + "type": "string", + "description": "Taker order ID" + }, + "ts": { + "type": "integer", + "description": "Filled timestamp(nanosecond)", + "format": "int64" + }, + "size": { + "type": "integer", + "description": "Filled amount" + }, + "price": { + "type": "string", + "description": "Filled price" }, "side": { "type": "string", - "description": "Trade direction", + "description": "Filled side, The trade side indicates the taker order side. A taker order is the order that was matched with orders opened on the order book.", "enum": [ "buy", "sell" @@ -1108,62 +1480,27 @@ "x-api-enum": [ { "value": "buy", - "name": "BUY", - "description": "" + "name": "buy", + "description": "buy" }, { "value": "sell", - "name": "SELL", - "description": "" + "name": "sell", + "description": "sell" } ] - }, - "size": { - "type": "integer", - "description": "Filled side, The trade side indicates the taker order side. A taker order is the order that was matched with orders opened on the order book." - }, - "tradeId": { - "type": "string", - "description": "Transaction ID" - }, - "price": { - "type": "string", - "description": "Filled price" - }, - "bestBidPrice": { - "type": "string", - "description": "Best bid price" - }, - "bestBidSize": { - "type": "integer", - "description": "Best bid size" - }, - "bestAskPrice": { - "type": "string", - "description": "Best ask price" - }, - "bestAskSize": { - "type": "integer", - "description": "Best ask size" - }, - "ts": { - "type": "integer", - "description": "Filled time(nanosecond)", - "format": "int64" } }, "required": [ "sequence", - "symbol", - "side", + "contractId", "tradeId", - "price", - "bestBidPrice", - "bestBidSize", - "bestAskPrice", - "bestAskSize", + "makerOrderId", + "takerOrderId", "ts", - "size" + "size", + "price", + "side" ] } } @@ -1173,38 +1510,145 @@ "data" ] } - } + } + } + } + }, + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470232", + "x-abandon": "normal", + "x-domain": "Futures", + "x-api-channel": "Public", + "x-api-permission": "NULL", + "x-api-rate-limit-pool": "Public", + "x-sdk-service": "Futures", + "x-sdk-sub-service": "Market", + "x-sdk-method-name": "getTradeHistory", + "x-sdk-method-description": "Request via this endpoint to get the trade history of the specified symbol, the returned quantity is the last 100 transaction records.", + "x-api-rate-limit": 5, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": [\\n {\\n \\\"sequence\\\": 1697915257909,\\n \\\"contractId\\\": 1,\\n \\\"tradeId\\\": \\\"1697915257909\\\",\\n \\\"makerOrderId\\\": \\\"236679665752801280\\\",\\n \\\"takerOrderId\\\": \\\"236679667975745536\\\",\\n \\\"ts\\\": 1729242032152000000,\\n \\\"size\\\": 1,\\n \\\"price\\\": \\\"67878\\\",\\n \\\"side\\\": \\\"sell\\\"\\n },\\n {\\n \\\"sequence\\\": 1697915257749,\\n \\\"contractId\\\": 1,\\n \\\"tradeId\\\": \\\"1697915257749\\\",\\n \\\"makerOrderId\\\": \\\"236679660971245570\\\",\\n \\\"takerOrderId\\\": \\\"236679665400492032\\\",\\n \\\"ts\\\": 1729242031535000000,\\n \\\"size\\\": 1,\\n \\\"price\\\": \\\"67867.8\\\",\\n \\\"side\\\": \\\"sell\\\"\\n },\\n {\\n \\\"sequence\\\": 1697915257701,\\n \\\"contractId\\\": 1,\\n \\\"tradeId\\\": \\\"1697915257701\\\",\\n \\\"makerOrderId\\\": \\\"236679660971245570\\\",\\n \\\"takerOrderId\\\": \\\"236679661919211521\\\",\\n \\\"ts\\\": 1729242030932000000,\\n \\\"size\\\": 1,\\n \\\"price\\\": \\\"67867.8\\\",\\n \\\"side\\\": \\\"sell\\\"\\n }\\n ]\\n}", + "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDM\\\"}" + } + }, + "/api/v1/kline/query": { + "get": { + "summary": "Get Klines", + "deprecated": false, + "description": "Get the Kline of the symbol. Data are returned in grouped buckets based on requested type. For each query, the system would return at most 500 pieces of data. To obtain more data, please page the data by time.", + "tags": [], + "parameters": [ + { + "name": "symbol", + "in": "query", + "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol, indexSymbol, premiumsSymbol1M, premiumsSymbol8H](https://www.kucoin.com/docs-new/api-3470220) ", + "required": true, + "schema": { + "type": "string", + "example": [ + "XBTUSDTM", + ".KXBTUSDT", + ".XBTUSDTMPI", + ".XBTUSDTMPI8H" + ] + } + }, + { + "name": "granularity", + "in": "query", + "description": "Type of candlestick patterns(minute)", + "required": true, + "schema": { + "type": "integer", + "enum": [ + 1, + 5, + 15, + 30, + 60, + 120, + 240, + 480, + 720, + 1440, + 10080 + ], + "format": "int64", + "x-api-enum": [ + { + "value": 1, + "name": "1", + "description": "1min" + }, + { + "value": 5, + "name": "5", + "description": "5min" + }, + { + "value": 15, + "name": "15", + "description": "15min" + }, + { + "value": 30, + "name": "30", + "description": "30min" + }, + { + "value": 60, + "name": "60", + "description": "1hour" + }, + { + "value": 120, + "name": "120", + "description": "2hour" + }, + { + "value": 240, + "name": "240", + "description": "4hour" + }, + { + "value": 480, + "name": "480", + "description": "8hour" + }, + { + "value": 720, + "name": "720", + "description": "12hour" + }, + { + "value": 1440, + "name": "1440", + "description": "1day" + }, + { + "value": 10080, + "name": "10080", + "description": "1week" + } + ] } - } - }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470223", - "x-abandon": "normal", - "x-domain": "Futures", - "x-api-channel": "Public", - "x-api-permission": "NULL", - "x-api-rate-limit-pool": "Public", - "x-sdk-service": "Futures", - "x-sdk-sub-service": "Market", - "x-sdk-method-name": "getAllTickers", - "x-sdk-method-description": "This endpoint returns \"last traded price/size\"、\"best bid/ask price/size\" etc. of a single symbol. These messages can also be obtained through Websocket.", - "x-api-rate-limit": 5, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": [\\n {\\n \\\"sequence\\\": 1707992727046,\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"side\\\": \\\"sell\\\",\\n \\\"size\\\": 21,\\n \\\"tradeId\\\": \\\"1784299761369\\\",\\n \\\"price\\\": \\\"67153\\\",\\n \\\"bestBidPrice\\\": \\\"67153\\\",\\n \\\"bestBidSize\\\": 2767,\\n \\\"bestAskPrice\\\": \\\"67153.1\\\",\\n \\\"bestAskSize\\\": 5368,\\n \\\"ts\\\": 1729163466659000000\\n },\\n {\\n \\\"sequence\\\": 1697895166299,\\n \\\"symbol\\\": \\\"XBTUSDM\\\",\\n \\\"side\\\": \\\"sell\\\",\\n \\\"size\\\": 1956,\\n \\\"tradeId\\\": \\\"1697901245065\\\",\\n \\\"price\\\": \\\"67145.2\\\",\\n \\\"bestBidPrice\\\": \\\"67135.3\\\",\\n \\\"bestBidSize\\\": 1,\\n \\\"bestAskPrice\\\": \\\"67135.8\\\",\\n \\\"bestAskSize\\\": 3,\\n \\\"ts\\\": 1729163445340000000\\n }\\n ]\\n}" - } - }, - "/api/v1/level2/snapshot": { - "get": { - "summary": "Get Full OrderBook", - "deprecated": false, - "description": "Query for Full orderbook depth data. (aggregated by price) It is generally used by professional traders because it uses more server resources and traffic, and we have strict access rate limit control. To maintain up-to-date Order Book, please use Websocket incremental feed after retrieving the OrderBook.", - "tags": [], - "parameters": [ + }, { - "name": "symbol", + "name": "from", "in": "query", - "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) \n", + "description": "Start time (milisecond)", "required": false, "schema": { - "type": "string" + "type": "integer", + "format": "int64" + } + }, + { + "name": "to", + "in": "query", + "description": "End time (milisecond)", + "required": false, + "schema": { + "type": "integer", + "format": "int64" } } ], @@ -1217,56 +1661,17 @@ "type": "object", "properties": { "code": { - "type": "string", - "description": "200000 is for success, other is error" + "type": "string" }, "data": { - "type": "object", - "properties": { - "sequence": { - "type": "integer", - "description": "Sequence number", - "format": "int64" - }, - "symbol": { - "type": "string", - "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) " - }, - "bids": { - "type": "array", - "items": { - "type": "array", - "items": { - "type": "number", - "description": "Price, Size" - } - }, - "description": "bids, from high to low" - }, - "asks": { - "type": "array", - "items": { - "type": "array", - "items": { - "type": "number", - "description": "Price, Size" - } - }, - "description": "asks, from low to high" - }, - "ts": { - "type": "integer", - "format": "int64", - "description": "Timestamp(nanosecond)" + "type": "array", + "items": { + "type": "array", + "items": { + "type": "number", + "description": "Start time of the candle cycle, opening price, highest price, Lowest price, closing price, Transaction volume" } - }, - "required": [ - "sequence", - "symbol", - "bids", - "asks", - "ts" - ] + } } }, "required": [ @@ -1278,7 +1683,7 @@ } } }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470224", + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470234", "x-abandon": "normal", "x-domain": "Futures", "x-api-channel": "Public", @@ -1286,33 +1691,24 @@ "x-api-rate-limit-pool": "Public", "x-sdk-service": "Futures", "x-sdk-sub-service": "Market", - "x-sdk-method-name": "getFullOrderBook", - "x-sdk-method-description": "Query for Full orderbook depth data. (aggregated by price) It is generally used by professional traders because it uses more server resources and traffic, and we have strict access rate limit control. To maintain up-to-date Order Book, please use Websocket incremental feed after retrieving the OrderBook.", + "x-sdk-method-name": "getKlines", + "x-sdk-method-description": "Get the Kline of the symbol. Data are returned in grouped buckets based on requested type. For each query, the system would return at most 500 pieces of data. To obtain more data, please page the data by time.", "x-api-rate-limit": 3, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"sequence\\\": 1697895963339,\\n \\\"symbol\\\": \\\"XBTUSDM\\\",\\n \\\"bids\\\": [\\n [\\n 66968,\\n 2\\n ],\\n [\\n 66964.8,\\n 25596\\n ]\\n ],\\n \\\"asks\\\": [\\n [\\n 66968.1,\\n 13501\\n ],\\n [\\n 66968.7,\\n 2032\\n ]\\n ],\\n \\\"ts\\\": 1729168101216000000\\n }\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDM\\\"}" + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": [\\n [\\n 1728576000000,\\n 60791.1,\\n 61035,\\n 58940,\\n 60300,\\n 5501167\\n ],\\n [\\n 1728604800000,\\n 60299.9,\\n 60924.1,\\n 60077.4,\\n 60666.1,\\n 1220980\\n ],\\n [\\n 1728633600000,\\n 60665.7,\\n 62436.8,\\n 60650.1,\\n 62255.1,\\n 3386359\\n ]\\n ]\\n}", + "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDTM\\\", \\\"granularity\\\": 1, \\\"from\\\": 1728552342000, \\\"to\\\": 1729243542000}" } }, - "/api/v1/level2/depth{size}": { + "/api/v1/mark-price/{symbol}/current": { "get": { - "summary": "Get Part OrderBook", + "summary": "Get Mark Price", "deprecated": false, - "description": "Query for part orderbook depth data. (aggregated by price) You are recommended to request via this endpoint as the system reponse would be faster and cosume less traffic.", + "description": "Get current mark price", "tags": [], "parameters": [ { "name": "symbol", - "in": "query", - "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) ", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "size", "in": "path", - "description": "Get the depth layer, optional value: 20, 100", + "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) ", "required": true, "schema": { "type": "string" @@ -1333,49 +1729,34 @@ "data": { "type": "object", "properties": { - "sequence": { - "type": "integer", - "description": "Sequence number", - "format": "int64" - }, "symbol": { "type": "string", "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) " }, - "bids": { - "type": "array", - "items": { - "type": "array", - "items": { - "type": "number", - "description": "Price, Size" - } - }, - "description": "bids, from high to low" - }, - "asks": { - "type": "array", - "items": { - "type": "array", - "items": { - "type": "number", - "description": "Price, Size" - } - }, - "description": "asks, from low to high" + "granularity": { + "type": "integer", + "description": "Granularity (milisecond)" }, - "ts": { + "timePoint": { "type": "integer", - "description": "Timestamp(nanosecond)", + "description": "Time point (milisecond)", "format": "int64" + }, + "value": { + "type": "number", + "description": "Mark price" + }, + "indexPrice": { + "type": "number", + "description": "Index price" } }, "required": [ - "sequence", "symbol", - "bids", - "asks", - "ts" + "granularity", + "timePoint", + "value", + "indexPrice" ] } }, @@ -1388,7 +1769,7 @@ } } }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470225", + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470233", "x-abandon": "normal", "x-domain": "Futures", "x-api-channel": "Public", @@ -1396,32 +1777,30 @@ "x-api-rate-limit-pool": "Public", "x-sdk-service": "Futures", "x-sdk-sub-service": "Market", - "x-sdk-method-name": "getPartOrderBook", - "x-sdk-method-description": "Query for part orderbook depth data. (aggregated by price) You are recommended to request via this endpoint as the system reponse would be faster and cosume less traffic.", - "x-api-rate-limit": 5, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"sequence\\\": 1697895963339,\\n \\\"symbol\\\": \\\"XBTUSDM\\\",\\n \\\"bids\\\": [\\n [\\n 66968,\\n 2\\n ],\\n [\\n 66964.8,\\n 25596\\n ]\\n ],\\n \\\"asks\\\": [\\n [\\n 66968.1,\\n 13501\\n ],\\n [\\n 66968.7,\\n 2032\\n ]\\n ],\\n \\\"ts\\\": 1729168101216000000\\n }\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDM\\\", \\\"size\\\": \\\"20\\\"}" + "x-sdk-method-name": "getMarkPrice", + "x-sdk-method-description": "Get current mark price", + "x-api-rate-limit": 3, + "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"symbol\\\":\\\"XBTUSDTM\\\",\\\"granularity\\\":1000,\\\"timePoint\\\":1729254307000,\\\"value\\\":67687.08,\\\"indexPrice\\\":67683.58}}", + "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDTM\\\"}" } }, - "/api/v1/interest/query": { + "/api/v1/index/query": { "get": { - "summary": "Get Interest Rate Index", + "summary": "Get Spot Index Price", "deprecated": false, - "description": "Get interest rate Index.", + "description": "Get Spot Index Price", "tags": [], "parameters": [ { "name": "symbol", "in": "query", - "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: fundingBaseSymbol, fundingQuoteSymbol, fundingBaseSymbol1M, fundingQuoteSymbol1M](https://www.kucoin.com/docs-new/api-3470220) ", + "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: indexSymbol](https://www.kucoin.com/docs-new/api-3470220) ", "required": true, "schema": { "type": "string", "example": [ - ".XBTINT8H", - ".USDTINT8H", - ".XBTINT", - ".USDTINT" + ".KXBTUSDT", + ".BXBT" ] } }, @@ -1509,7 +1888,7 @@ "properties": { "symbol": { "type": "string", - "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: fundingBaseSymbol, fundingQuoteSymbol, fundingBaseSymbol1M, fundingQuoteSymbol1M](https://www.kucoin.com/docs-new/api-3470220) " + "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: indexSymbol](https://www.kucoin.com/docs-new/api-3470220) " }, "granularity": { "type": "integer", @@ -1517,19 +1896,46 @@ }, "timePoint": { "type": "integer", - "description": "Timestamp(milisecond)", + "description": "Timestamp (milisecond)", "format": "int64" }, "value": { "type": "number", - "description": "Interest rate value" + "description": "Index Value" + }, + "decomposionList": { + "type": "array", + "items": { + "type": "object", + "properties": { + "exchange": { + "type": "string", + "description": "Exchange" + }, + "price": { + "type": "number", + "description": "Price" + }, + "weight": { + "type": "number", + "description": "Weight" + } + }, + "required": [ + "exchange", + "price", + "weight" + ] + }, + "description": "Component List" } }, "required": [ "symbol", "granularity", "timePoint", - "value" + "value", + "decomposionList" ] } }, @@ -1553,7 +1959,7 @@ } } }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470226", + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470231", "x-abandon": "normal", "x-domain": "Futures", "x-api-channel": "Public", @@ -1561,30 +1967,32 @@ "x-api-rate-limit-pool": "Public", "x-sdk-service": "Futures", "x-sdk-sub-service": "Market", - "x-sdk-method-name": "getInterestRateIndex", - "x-sdk-method-description": "Get interest rate Index.", - "x-api-rate-limit": 5, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"dataList\\\": [\\n {\\n \\\"symbol\\\": \\\".XBTINT\\\",\\n \\\"granularity\\\": 60000,\\n \\\"timePoint\\\": 1728692100000,\\n \\\"value\\\": 3.0E-4\\n },\\n {\\n \\\"symbol\\\": \\\".XBTINT\\\",\\n \\\"granularity\\\": 60000,\\n \\\"timePoint\\\": 1728692040000,\\n \\\"value\\\": 3.0E-4\\n }\\n ],\\n \\\"hasMore\\\": true\\n }\\n}", - "x-request-example": "{\\\"symbol\\\": \\\".XBTINT8H\\\", \\\"startAt\\\": 1728663338000, \\\"endAt\\\": 1728692138000, \\\"reverse\\\": true, \\\"offset\\\": 254062248624417, \\\"forward\\\": true, \\\"maxCount\\\": 10}" + "x-sdk-method-name": "getSpotIndexPrice", + "x-sdk-method-description": "Get Spot Index Price", + "x-api-rate-limit": 2, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"hasMore\\\": true,\\n \\\"dataList\\\": [\\n {\\n \\\"symbol\\\": \\\".KXBTUSDT\\\",\\n \\\"granularity\\\": 1000,\\n \\\"timePoint\\\": 1730557515000,\\n \\\"value\\\": 69202.94,\\n \\\"decomposionList\\\": [\\n {\\n \\\"exchange\\\": \\\"gateio\\\",\\n \\\"price\\\": 69209.27,\\n \\\"weight\\\": 0.0533\\n },\\n {\\n \\\"exchange\\\": \\\"bitmart\\\",\\n \\\"price\\\": 69230.77,\\n \\\"weight\\\": 0.0128\\n },\\n {\\n \\\"exchange\\\": \\\"okex\\\",\\n \\\"price\\\": 69195.34,\\n \\\"weight\\\": 0.11\\n },\\n {\\n \\\"exchange\\\": \\\"bybit\\\",\\n \\\"price\\\": 69190.33,\\n \\\"weight\\\": 0.0676\\n },\\n {\\n \\\"exchange\\\": \\\"binance\\\",\\n \\\"price\\\": 69204.55,\\n \\\"weight\\\": 0.6195\\n },\\n {\\n \\\"exchange\\\": \\\"kucoin\\\",\\n \\\"price\\\": 69202.91,\\n \\\"weight\\\": 0.1368\\n }\\n ]\\n },\\n {\\n \\\"symbol\\\": \\\".KXBTUSDT\\\",\\n \\\"granularity\\\": 1000,\\n \\\"timePoint\\\": 1730557514000,\\n \\\"value\\\": 69204.98,\\n \\\"decomposionList\\\": [\\n {\\n \\\"exchange\\\": \\\"gateio\\\",\\n \\\"price\\\": 69212.71,\\n \\\"weight\\\": 0.0808\\n },\\n {\\n \\\"exchange\\\": \\\"bitmart\\\",\\n \\\"price\\\": 69230.77,\\n \\\"weight\\\": 0.0134\\n },\\n {\\n \\\"exchange\\\": \\\"okex\\\",\\n \\\"price\\\": 69195.49,\\n \\\"weight\\\": 0.0536\\n },\\n {\\n \\\"exchange\\\": \\\"bybit\\\",\\n \\\"price\\\": 69195.97,\\n \\\"weight\\\": 0.0921\\n },\\n {\\n \\\"exchange\\\": \\\"binance\\\",\\n \\\"price\\\": 69204.56,\\n \\\"weight\\\": 0.5476\\n },\\n {\\n \\\"exchange\\\": \\\"kucoin\\\",\\n \\\"price\\\": 69207.8,\\n \\\"weight\\\": 0.2125\\n }\\n ]\\n }\\n ]\\n }\\n}", + "x-request-example": "{\\\"symbol\\\": \\\".KXBTUSDT\\\", \\\"startAt\\\": 123456, \\\"endAt\\\": 123456, \\\"reverse\\\": true, \\\"offset\\\": 123456, \\\"forward\\\": true, \\\"maxCount\\\": 10}" } }, - "/api/v1/premium/query": { + "/api/v1/interest/query": { "get": { - "summary": "Get Premium Index", + "summary": "Get Interest Rate Index", "deprecated": false, - "description": "Submit request to get premium index.", + "description": "Get interest rate Index.", "tags": [], "parameters": [ { "name": "symbol", "in": "query", - "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: premiumsSymbol1M, premiumsSymbol8H](https://www.kucoin.com/docs-new/api-3470220) ", + "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: fundingBaseSymbol, fundingQuoteSymbol, fundingBaseSymbol1M, fundingQuoteSymbol1M](https://www.kucoin.com/docs-new/api-3470220) ", "required": true, "schema": { "type": "string", "example": [ - ".XBTUSDTMPI", - ".XBTUSDTMPI8H" + ".XBTINT8H", + ".USDTINT8H", + ".XBTINT", + ".USDTINT" ] } }, @@ -1672,11 +2080,11 @@ "properties": { "symbol": { "type": "string", - "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: premiumsSymbol1M, premiumsSymbol8H](https://www.kucoin.com/docs-new/api-3470220) " + "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: fundingBaseSymbol, fundingQuoteSymbol, fundingBaseSymbol1M, fundingQuoteSymbol1M](https://www.kucoin.com/docs-new/api-3470220) " }, "granularity": { "type": "integer", - "description": "Granularity(milisecond)" + "description": "Granularity (milisecond)" }, "timePoint": { "type": "integer", @@ -1685,207 +2093,25 @@ }, "value": { "type": "number", - "description": "Premium index" + "description": "Interest rate value" } }, "required": [ "symbol", "granularity", - "timePoint", - "value" - ] - } - }, - "hasMore": { - "type": "boolean", - "description": "Whether there are more pages" - } - }, - "required": [ - "dataList", - "hasMore" - ] - } - }, - "required": [ - "code", - "data" - ] - } - } - } - } - }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470227", - "x-abandon": "normal", - "x-domain": "Futures", - "x-api-channel": "Public", - "x-api-permission": "NULL", - "x-api-rate-limit-pool": "Public", - "x-sdk-service": "Futures", - "x-sdk-sub-service": "Market", - "x-sdk-method-name": "getPremiumIndex", - "x-sdk-method-description": "Submit request to get premium index.", - "x-api-rate-limit": 3, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"hasMore\\\": true,\\n \\\"dataList\\\": [\\n {\\n \\\"symbol\\\": \\\".XBTUSDTMPI\\\",\\n \\\"granularity\\\": 60000,\\n \\\"timePoint\\\": 1730558040000,\\n \\\"value\\\": 0.00006\\n },\\n {\\n \\\"symbol\\\": \\\".XBTUSDTMPI\\\",\\n \\\"granularity\\\": 60000,\\n \\\"timePoint\\\": 1730557980000,\\n \\\"value\\\": -0.000025\\n }\\n ]\\n }\\n}", - "x-request-example": "{\\\"symbol\\\": \\\".XBTUSDTMPI\\\", \\\"startAt\\\": 1728663338000, \\\"endAt\\\": 1728692138000, \\\"reverse\\\": true, \\\"offset\\\": 254062248624417, \\\"forward\\\": true, \\\"maxCount\\\": 10}" - } - }, - "/api/v1/trade-statistics": { - "get": { - "summary": "Get 24hr Stats", - "deprecated": false, - "description": "Get the statistics of the platform futures trading volume in the last 24 hours.", - "tags": [], - "parameters": [], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "data": { - "type": "object", - "properties": { - "turnoverOf24h": { - "type": "number", - "description": "24-hour platform Futures trading volume. Unit is USD" - } - }, - "required": [ - "turnoverOf24h" - ] - } - }, - "required": [ - "code", - "data" - ] - } - } - } - } - }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470228", - "x-abandon": "normal", - "x-domain": "Futures", - "x-api-channel": "Public", - "x-api-permission": "NULL", - "x-api-rate-limit-pool": "Futures", - "x-sdk-service": "Futures", - "x-sdk-sub-service": "Market", - "x-sdk-method-name": "get24hrStats", - "x-sdk-method-description": "Get the statistics of the platform futures trading volume in the last 24 hours.", - "x-api-rate-limit": 3, - "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"turnoverOf24h\\\":1.1155733413273683E9}}" - } - }, - "/api/v1/timestamp": { - "get": { - "summary": "Get Server Time", - "deprecated": false, - "description": "Get the API server time. This is the Unix timestamp.", - "tags": [], - "parameters": [], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "data": { - "type": "integer", - "format": "int64", - "description": "ServerTime(millisecond)" - } - }, - "required": [ - "code", - "data" - ] - } - } - } - } - }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470229", - "x-abandon": "normal", - "x-domain": "Futures", - "x-api-channel": "Public", - "x-api-permission": "NULL", - "x-api-rate-limit-pool": "Public", - "x-sdk-service": "Futures", - "x-sdk-sub-service": "Market", - "x-sdk-method-name": "getServerTime", - "x-sdk-method-description": "Get the API server time. This is the Unix timestamp.", - "x-api-rate-limit": 2, - "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":1729260030774}" - } - }, - "/api/v1/status": { - "get": { - "summary": "Get Service Status", - "deprecated": false, - "description": "Get the service status.", - "tags": [], - "parameters": [], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "data": { - "type": "object", - "properties": { - "msg": { - "type": "string" - }, - "status": { - "type": "string", - "description": "Status of service: open:normal transaction, close:Stop Trading/Maintenance, cancelonly:can only cancel the order but not place order", - "enum": [ - "open", - "close", - "cancelonly" - ], - "x-api-enum": [ - { - "value": "open", - "name": "OPEN", - "description": "normal transaction" - }, - { - "value": "close", - "name": "CLOSE", - "description": "Stop Trading/Maintenance" - }, - { - "value": "cancelonly", - "name": "CANCELONLY", - "description": "can only cancel the order but not place order" - } - ] + "timePoint", + "value" + ] + } + }, + "hasMore": { + "type": "boolean", + "description": "Whether there are more pages" } }, "required": [ - "msg", - "status" + "dataList", + "hasMore" ] } }, @@ -1898,7 +2124,7 @@ } } }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470230", + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470226", "x-abandon": "normal", "x-domain": "Futures", "x-api-channel": "Public", @@ -1906,29 +2132,30 @@ "x-api-rate-limit-pool": "Public", "x-sdk-service": "Futures", "x-sdk-sub-service": "Market", - "x-sdk-method-name": "getServiceStatus", - "x-sdk-method-description": "Get the service status.", - "x-api-rate-limit": 4, - "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"msg\\\":\\\"\\\",\\\"status\\\":\\\"open\\\"}}" + "x-sdk-method-name": "getInterestRateIndex", + "x-sdk-method-description": "Get interest rate Index.", + "x-api-rate-limit": 5, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"dataList\\\": [\\n {\\n \\\"symbol\\\": \\\".XBTINT\\\",\\n \\\"granularity\\\": 60000,\\n \\\"timePoint\\\": 1728692100000,\\n \\\"value\\\": 3.0E-4\\n },\\n {\\n \\\"symbol\\\": \\\".XBTINT\\\",\\n \\\"granularity\\\": 60000,\\n \\\"timePoint\\\": 1728692040000,\\n \\\"value\\\": 3.0E-4\\n }\\n ],\\n \\\"hasMore\\\": true\\n }\\n}", + "x-request-example": "{\\\"symbol\\\": \\\".XBTINT8H\\\", \\\"startAt\\\": 1728663338000, \\\"endAt\\\": 1728692138000, \\\"reverse\\\": true, \\\"offset\\\": 254062248624417, \\\"forward\\\": true, \\\"maxCount\\\": 10}" } }, - "/api/v1/index/query": { + "/api/v1/premium/query": { "get": { - "summary": "Get Spot Index Price", + "summary": "Get Premium Index", "deprecated": false, - "description": "Get Spot Index Price", + "description": "Submit request to get premium index.", "tags": [], "parameters": [ { "name": "symbol", "in": "query", - "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: indexSymbol](https://www.kucoin.com/docs-new/api-3470220) ", + "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: premiumsSymbol1M, premiumsSymbol8H](https://www.kucoin.com/docs-new/api-3470220) ", "required": true, "schema": { "type": "string", "example": [ - ".KXBTUSDT", - ".BXBT" + ".XBTUSDTMPI", + ".XBTUSDTMPI8H" ] } }, @@ -2016,54 +2243,27 @@ "properties": { "symbol": { "type": "string", - "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: indexSymbol](https://www.kucoin.com/docs-new/api-3470220) " + "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: premiumsSymbol1M, premiumsSymbol8H](https://www.kucoin.com/docs-new/api-3470220) " }, "granularity": { "type": "integer", - "description": "Granularity (milisecond)" + "description": "Granularity(milisecond)" }, "timePoint": { "type": "integer", - "description": "Timestamp (milisecond)", + "description": "Timestamp(milisecond)", "format": "int64" }, "value": { "type": "number", - "description": "Index Value" - }, - "decomposionList": { - "type": "array", - "items": { - "type": "object", - "properties": { - "exchange": { - "type": "string", - "description": "Exchange" - }, - "price": { - "type": "number", - "description": "Price" - }, - "weight": { - "type": "number", - "description": "Weight" - } - }, - "required": [ - "exchange", - "price", - "weight" - ] - }, - "description": "Component List" + "description": "Premium index" } }, "required": [ "symbol", "granularity", "timePoint", - "value", - "decomposionList" + "value" ] } }, @@ -2087,7 +2287,7 @@ } } }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470231", + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470227", "x-abandon": "normal", "x-domain": "Futures", "x-api-channel": "Public", @@ -2095,30 +2295,20 @@ "x-api-rate-limit-pool": "Public", "x-sdk-service": "Futures", "x-sdk-sub-service": "Market", - "x-sdk-method-name": "getSpotIndexPrice", - "x-sdk-method-description": "Get Spot Index Price", - "x-api-rate-limit": 2, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"hasMore\\\": true,\\n \\\"dataList\\\": [\\n {\\n \\\"symbol\\\": \\\".KXBTUSDT\\\",\\n \\\"granularity\\\": 1000,\\n \\\"timePoint\\\": 1730557515000,\\n \\\"value\\\": 69202.94,\\n \\\"decomposionList\\\": [\\n {\\n \\\"exchange\\\": \\\"gateio\\\",\\n \\\"price\\\": 69209.27,\\n \\\"weight\\\": 0.0533\\n },\\n {\\n \\\"exchange\\\": \\\"bitmart\\\",\\n \\\"price\\\": 69230.77,\\n \\\"weight\\\": 0.0128\\n },\\n {\\n \\\"exchange\\\": \\\"okex\\\",\\n \\\"price\\\": 69195.34,\\n \\\"weight\\\": 0.11\\n },\\n {\\n \\\"exchange\\\": \\\"bybit\\\",\\n \\\"price\\\": 69190.33,\\n \\\"weight\\\": 0.0676\\n },\\n {\\n \\\"exchange\\\": \\\"binance\\\",\\n \\\"price\\\": 69204.55,\\n \\\"weight\\\": 0.6195\\n },\\n {\\n \\\"exchange\\\": \\\"kucoin\\\",\\n \\\"price\\\": 69202.91,\\n \\\"weight\\\": 0.1368\\n }\\n ]\\n },\\n {\\n \\\"symbol\\\": \\\".KXBTUSDT\\\",\\n \\\"granularity\\\": 1000,\\n \\\"timePoint\\\": 1730557514000,\\n \\\"value\\\": 69204.98,\\n \\\"decomposionList\\\": [\\n {\\n \\\"exchange\\\": \\\"gateio\\\",\\n \\\"price\\\": 69212.71,\\n \\\"weight\\\": 0.0808\\n },\\n {\\n \\\"exchange\\\": \\\"bitmart\\\",\\n \\\"price\\\": 69230.77,\\n \\\"weight\\\": 0.0134\\n },\\n {\\n \\\"exchange\\\": \\\"okex\\\",\\n \\\"price\\\": 69195.49,\\n \\\"weight\\\": 0.0536\\n },\\n {\\n \\\"exchange\\\": \\\"bybit\\\",\\n \\\"price\\\": 69195.97,\\n \\\"weight\\\": 0.0921\\n },\\n {\\n \\\"exchange\\\": \\\"binance\\\",\\n \\\"price\\\": 69204.56,\\n \\\"weight\\\": 0.5476\\n },\\n {\\n \\\"exchange\\\": \\\"kucoin\\\",\\n \\\"price\\\": 69207.8,\\n \\\"weight\\\": 0.2125\\n }\\n ]\\n }\\n ]\\n }\\n}", - "x-request-example": "{\\\"symbol\\\": \\\".KXBTUSDT\\\", \\\"startAt\\\": 123456, \\\"endAt\\\": 123456, \\\"reverse\\\": true, \\\"offset\\\": 123456, \\\"forward\\\": true, \\\"maxCount\\\": 10}" + "x-sdk-method-name": "getPremiumIndex", + "x-sdk-method-description": "Submit request to get premium index.", + "x-api-rate-limit": 3, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"hasMore\\\": true,\\n \\\"dataList\\\": [\\n {\\n \\\"symbol\\\": \\\".XBTUSDTMPI\\\",\\n \\\"granularity\\\": 60000,\\n \\\"timePoint\\\": 1730558040000,\\n \\\"value\\\": 0.00006\\n },\\n {\\n \\\"symbol\\\": \\\".XBTUSDTMPI\\\",\\n \\\"granularity\\\": 60000,\\n \\\"timePoint\\\": 1730557980000,\\n \\\"value\\\": -0.000025\\n }\\n ]\\n }\\n}", + "x-request-example": "{\\\"symbol\\\": \\\".XBTUSDTMPI\\\", \\\"startAt\\\": 1728663338000, \\\"endAt\\\": 1728692138000, \\\"reverse\\\": true, \\\"offset\\\": 254062248624417, \\\"forward\\\": true, \\\"maxCount\\\": 10}" } }, - "/api/v1/trade/history": { + "/api/v1/trade-statistics": { "get": { - "summary": "Get Trade History", + "summary": "Get 24hr Stats", "deprecated": false, - "description": "Request via this endpoint to get the trade history of the specified symbol, the returned quantity is the last 100 transaction records.", + "description": "Get the statistics of the platform futures trading volume in the last 24 hours.", "tags": [], - "parameters": [ - { - "name": "symbol", - "in": "query", - "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) ", - "required": true, - "schema": { - "type": "string" - } - } - ], + "parameters": [], "responses": { "200": { "description": "", @@ -2131,77 +2321,16 @@ "type": "string" }, "data": { - "type": "array", - "items": { - "type": "object", - "properties": { - "sequence": { - "type": "integer", - "description": "Sequence number", - "format": "int64" - }, - "contractId": { - "type": "integer", - "description": "Deprecated param" - }, - "tradeId": { - "type": "string", - "description": "Transaction ID" - }, - "makerOrderId": { - "type": "string", - "description": "Maker order ID" - }, - "takerOrderId": { - "type": "string", - "description": "Taker order ID" - }, - "ts": { - "type": "integer", - "description": "Filled timestamp(nanosecond)", - "format": "int64" - }, - "size": { - "type": "integer", - "description": "Filled amount" - }, - "price": { - "type": "string", - "description": "Filled price" - }, - "side": { - "type": "string", - "description": "Filled side, The trade side indicates the taker order side. A taker order is the order that was matched with orders opened on the order book.", - "enum": [ - "buy", - "sell" - ], - "x-api-enum": [ - { - "value": "buy", - "name": "buy", - "description": "buy" - }, - { - "value": "sell", - "name": "sell", - "description": "sell" - } - ] - } - }, - "required": [ - "sequence", - "contractId", - "tradeId", - "makerOrderId", - "takerOrderId", - "ts", - "size", - "price", - "side" - ] - } + "type": "object", + "properties": { + "turnoverOf24h": { + "type": "number", + "description": "24-hour platform Futures trading volume. Unit is USD" + } + }, + "required": [ + "turnoverOf24h" + ] } }, "required": [ @@ -2213,81 +2342,42 @@ } } }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470232", + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470228", "x-abandon": "normal", "x-domain": "Futures", "x-api-channel": "Public", "x-api-permission": "NULL", - "x-api-rate-limit-pool": "Public", + "x-api-rate-limit-pool": "Futures", "x-sdk-service": "Futures", "x-sdk-sub-service": "Market", - "x-sdk-method-name": "getTradeHistory", - "x-sdk-method-description": "Request via this endpoint to get the trade history of the specified symbol, the returned quantity is the last 100 transaction records.", - "x-api-rate-limit": 5, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": [\\n {\\n \\\"sequence\\\": 1697915257909,\\n \\\"contractId\\\": 1,\\n \\\"tradeId\\\": \\\"1697915257909\\\",\\n \\\"makerOrderId\\\": \\\"236679665752801280\\\",\\n \\\"takerOrderId\\\": \\\"236679667975745536\\\",\\n \\\"ts\\\": 1729242032152000000,\\n \\\"size\\\": 1,\\n \\\"price\\\": \\\"67878\\\",\\n \\\"side\\\": \\\"sell\\\"\\n },\\n {\\n \\\"sequence\\\": 1697915257749,\\n \\\"contractId\\\": 1,\\n \\\"tradeId\\\": \\\"1697915257749\\\",\\n \\\"makerOrderId\\\": \\\"236679660971245570\\\",\\n \\\"takerOrderId\\\": \\\"236679665400492032\\\",\\n \\\"ts\\\": 1729242031535000000,\\n \\\"size\\\": 1,\\n \\\"price\\\": \\\"67867.8\\\",\\n \\\"side\\\": \\\"sell\\\"\\n },\\n {\\n \\\"sequence\\\": 1697915257701,\\n \\\"contractId\\\": 1,\\n \\\"tradeId\\\": \\\"1697915257701\\\",\\n \\\"makerOrderId\\\": \\\"236679660971245570\\\",\\n \\\"takerOrderId\\\": \\\"236679661919211521\\\",\\n \\\"ts\\\": 1729242030932000000,\\n \\\"size\\\": 1,\\n \\\"price\\\": \\\"67867.8\\\",\\n \\\"side\\\": \\\"sell\\\"\\n }\\n ]\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDM\\\"}" + "x-sdk-method-name": "get24hrStats", + "x-sdk-method-description": "Get the statistics of the platform futures trading volume in the last 24 hours.", + "x-api-rate-limit": 3, + "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"turnoverOf24h\\\":1.1155733413273683E9}}" } }, - "/api/v1/mark-price/{symbol}/current": { + "/api/v1/timestamp": { "get": { - "summary": "Get Mark Price", + "summary": "Get Server Time", "deprecated": false, - "description": "Get current mark price", + "description": "Get the API server time. This is the Unix timestamp.", "tags": [], - "parameters": [ - { - "name": "symbol", - "in": "path", - "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) ", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "data": { - "type": "object", - "properties": { - "symbol": { - "type": "string", - "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) " - }, - "granularity": { - "type": "integer", - "description": "Granularity (milisecond)" - }, - "timePoint": { - "type": "integer", - "description": "Time point (milisecond)", - "format": "int64" - }, - "value": { - "type": "number", - "description": "Mark price" - }, - "indexPrice": { - "type": "number", - "description": "Index price" - } - }, - "required": [ - "symbol", - "granularity", - "timePoint", - "value", - "indexPrice" - ] + "parameters": [], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "integer", + "format": "int64", + "description": "ServerTime(millisecond)" } }, "required": [ @@ -2299,7 +2389,7 @@ } } }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470233", + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470229", "x-abandon": "normal", "x-domain": "Futures", "x-api-channel": "Public", @@ -2307,136 +2397,19 @@ "x-api-rate-limit-pool": "Public", "x-sdk-service": "Futures", "x-sdk-sub-service": "Market", - "x-sdk-method-name": "getMarkPrice", - "x-sdk-method-description": "Get current mark price", - "x-api-rate-limit": 3, - "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"symbol\\\":\\\"XBTUSDTM\\\",\\\"granularity\\\":1000,\\\"timePoint\\\":1729254307000,\\\"value\\\":67687.08,\\\"indexPrice\\\":67683.58}}", - "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDTM\\\"}" + "x-sdk-method-name": "getServerTime", + "x-sdk-method-description": "Get the API server time. This is the Unix timestamp.", + "x-api-rate-limit": 2, + "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":1729260030774}" } }, - "/api/v1/kline/query": { + "/api/v1/status": { "get": { - "summary": "Get Klines", + "summary": "Get Service Status", "deprecated": false, - "description": "Get the Kline of the symbol. Data are returned in grouped buckets based on requested type. For each query, the system would return at most 500 pieces of data. To obtain more data, please page the data by time.", + "description": "Get the service status.", "tags": [], - "parameters": [ - { - "name": "symbol", - "in": "query", - "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol, indexSymbol, premiumsSymbol1M, premiumsSymbol8H](https://www.kucoin.com/docs-new/api-3470220) ", - "required": true, - "schema": { - "type": "string", - "example": [ - "XBTUSDTM", - ".KXBTUSDT", - ".XBTUSDTMPI", - ".XBTUSDTMPI8H" - ] - } - }, - { - "name": "granularity", - "in": "query", - "description": "Type of candlestick patterns(minute)", - "required": true, - "schema": { - "type": "integer", - "enum": [ - 1, - 5, - 15, - 30, - 60, - 120, - 240, - 480, - 720, - 1440, - 10080 - ], - "format": "int64", - "x-api-enum": [ - { - "value": 1, - "name": "1", - "description": "1min" - }, - { - "value": 5, - "name": "5", - "description": "5min" - }, - { - "value": 15, - "name": "15", - "description": "15min" - }, - { - "value": 30, - "name": "30", - "description": "30min" - }, - { - "value": 60, - "name": "60", - "description": "1hour" - }, - { - "value": 120, - "name": "120", - "description": "2hour" - }, - { - "value": 240, - "name": "240", - "description": "4hour" - }, - { - "value": 480, - "name": "480", - "description": "8hour" - }, - { - "value": 720, - "name": "720", - "description": "12hour" - }, - { - "value": 1440, - "name": "1440", - "description": "1day" - }, - { - "value": 10080, - "name": "10080", - "description": "1week" - } - ] - } - }, - { - "name": "from", - "in": "query", - "description": "Start time (milisecond)", - "required": false, - "schema": { - "type": "integer", - "format": "int64" - } - }, - { - "name": "to", - "in": "query", - "description": "End time (milisecond)", - "required": false, - "schema": { - "type": "integer", - "format": "int64" - } - } - ], + "parameters": [], "responses": { "200": { "description": "", @@ -2449,14 +2422,42 @@ "type": "string" }, "data": { - "type": "array", - "items": { - "type": "array", - "items": { - "type": "number", - "description": "Start time of the candle cycle, opening price, highest price, Lowest price, closing price, Transaction volume" + "type": "object", + "properties": { + "msg": { + "type": "string" + }, + "status": { + "type": "string", + "description": "Status of service: open:normal transaction, close:Stop Trading/Maintenance, cancelonly:can only cancel the order but not place order", + "enum": [ + "open", + "close", + "cancelonly" + ], + "x-api-enum": [ + { + "value": "open", + "name": "OPEN", + "description": "normal transaction" + }, + { + "value": "close", + "name": "CLOSE", + "description": "Stop Trading/Maintenance" + }, + { + "value": "cancelonly", + "name": "CANCELONLY", + "description": "can only cancel the order but not place order" + } + ] } - } + }, + "required": [ + "msg", + "status" + ] } }, "required": [ @@ -2468,7 +2469,7 @@ } } }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470234", + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470230", "x-abandon": "normal", "x-domain": "Futures", "x-api-channel": "Public", @@ -2476,18 +2477,17 @@ "x-api-rate-limit-pool": "Public", "x-sdk-service": "Futures", "x-sdk-sub-service": "Market", - "x-sdk-method-name": "getKlines", - "x-sdk-method-description": "Get the Kline of the symbol. Data are returned in grouped buckets based on requested type. For each query, the system would return at most 500 pieces of data. To obtain more data, please page the data by time.", - "x-api-rate-limit": 3, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": [\\n [\\n 1728576000000,\\n 60791.1,\\n 61035,\\n 58940,\\n 60300,\\n 5501167\\n ],\\n [\\n 1728604800000,\\n 60299.9,\\n 60924.1,\\n 60077.4,\\n 60666.1,\\n 1220980\\n ],\\n [\\n 1728633600000,\\n 60665.7,\\n 62436.8,\\n 60650.1,\\n 62255.1,\\n 3386359\\n ]\\n ]\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDTM\\\", \\\"granularity\\\": 1, \\\"from\\\": 1728552342000, \\\"to\\\": 1729243542000}" + "x-sdk-method-name": "getServiceStatus", + "x-sdk-method-description": "Get the service status.", + "x-api-rate-limit": 4, + "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"msg\\\":\\\"\\\",\\\"status\\\":\\\"open\\\"}}" } }, - "/api/v1/bullet-private": { + "/api/v1/bullet-public": { "post": { - "summary": "Get Private Token - Futures", + "summary": "Get Public Token - Futures", "deprecated": false, - "description": "This interface can obtain the token required for websocket to establish a Futures private connection. If you need use private channels(e.g. account balance notice), please make request as follows to obtain the server list and private token", + "description": "This interface can obtain the token required for websocket to establish a Futures connection. If you need use public channels (e.g. all public market data), please make request as follows to obtain the server list and public token", "tags": [], "parameters": [], "responses": { @@ -2545,11 +2545,11 @@ } }, "required": [ + "endpoint", + "encrypt", "protocol", "pingInterval", - "pingTimeout", - "encrypt", - "endpoint" + "pingTimeout" ] } } @@ -2569,25 +2569,25 @@ } } }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470296", + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470297", "x-abandon": "normal", "x-domain": "Futures", - "x-api-channel": "Private", - "x-api-permission": "General", - "x-api-rate-limit-pool": "Futures", + "x-api-channel": "Public", + "x-api-permission": "NULL", + "x-api-rate-limit-pool": "Public", "x-sdk-service": "Futures", "x-sdk-sub-service": "Market", - "x-sdk-method-name": "getPrivateToken", - "x-sdk-method-description": "This interface can obtain the token required for websocket to establish a Futures private connection. If you need use private channels(e.g. account balance notice), please make request as follows to obtain the server list and private token", + "x-sdk-method-name": "getPublicToken", + "x-sdk-method-description": "This interface can obtain the token required for websocket to establish a Futures connection. If you need use public channels (e.g. all public market data), please make request as follows to obtain the server list and public token", "x-api-rate-limit": 10, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"token\\\": \\\"2neAiuYvAU737TOajb2U3uT8AEZqSWYe0fBD4LoHuXJDSC7gIzJiH4kNTWhCPISWo6nDpAe7aUaaHJ4fG8oRjFgMfUI2sM4IySWHrBceFocY8pKy2REU1HwZIngtMdMrjqPnP-biofFWbNaP1cl0X1pZc2SQ-33hDH1LgNP-yg8bktVoIG0dIxSN4m3uzO8u.ueCCihQ5_4GPpXKxWTDiFQ==\\\",\\n \\\"instanceServers\\\": [\\n {\\n \\\"endpoint\\\": \\\"wss://ws-api-futures.kucoin.com/\\\",\\n \\\"encrypt\\\": true,\\n \\\"protocol\\\": \\\"websocket\\\",\\n \\\"pingInterval\\\": 18000,\\n \\\"pingTimeout\\\": 10000\\n }\\n ]\\n }\\n}" + "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"token\\\":\\\"2neAiuYvAU61ZDXANAGAsiL4-iAExhsBXZxftpOeh_55i3Ysy2q2LEsEWU64mdzUOPusi34M_wGoSf7iNyEWJ6dACm4ny9vJtLTRq_YsRUlG5ADnAawegdiYB9J6i9GjsxUuhPw3Blq6rhZlGykT3Vp1phUafnulOOpts-MEmEF-3bpfetLOAjsMMBS5qwTWJBvJHl5Vs9Y=.gJEIAywPXFr_4L-WG10eug==\\\",\\\"instanceServers\\\":[{\\\"endpoint\\\":\\\"wss://ws-api-futures.kucoin.com/\\\",\\\"encrypt\\\":true,\\\"protocol\\\":\\\"websocket\\\",\\\"pingInterval\\\":18000,\\\"pingTimeout\\\":10000}]}}" } }, - "/api/v1/bullet-public": { + "/api/v1/bullet-private": { "post": { - "summary": "Get Public Token - Futures", + "summary": "Get Private Token - Futures", "deprecated": false, - "description": "This interface can obtain the token required for websocket to establish a Futures connection. If you need use public channels (e.g. all public market data), please make request as follows to obtain the server list and public token", + "description": "This interface can obtain the token required for websocket to establish a Futures private connection. If you need use private channels(e.g. account balance notice), please make request as follows to obtain the server list and private token", "tags": [], "parameters": [], "responses": { @@ -2645,11 +2645,11 @@ } }, "required": [ - "endpoint", - "encrypt", "protocol", "pingInterval", - "pingTimeout" + "pingTimeout", + "encrypt", + "endpoint" ] } } @@ -2669,18 +2669,18 @@ } } }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470297", + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470296", "x-abandon": "normal", "x-domain": "Futures", - "x-api-channel": "Public", - "x-api-permission": "NULL", - "x-api-rate-limit-pool": "Public", + "x-api-channel": "Private", + "x-api-permission": "General", + "x-api-rate-limit-pool": "Futures", "x-sdk-service": "Futures", "x-sdk-sub-service": "Market", - "x-sdk-method-name": "getPublicToken", - "x-sdk-method-description": "This interface can obtain the token required for websocket to establish a Futures connection. If you need use public channels (e.g. all public market data), please make request as follows to obtain the server list and public token", + "x-sdk-method-name": "getPrivateToken", + "x-sdk-method-description": "This interface can obtain the token required for websocket to establish a Futures private connection. If you need use private channels(e.g. account balance notice), please make request as follows to obtain the server list and private token", "x-api-rate-limit": 10, - "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"token\\\":\\\"2neAiuYvAU61ZDXANAGAsiL4-iAExhsBXZxftpOeh_55i3Ysy2q2LEsEWU64mdzUOPusi34M_wGoSf7iNyEWJ6dACm4ny9vJtLTRq_YsRUlG5ADnAawegdiYB9J6i9GjsxUuhPw3Blq6rhZlGykT3Vp1phUafnulOOpts-MEmEF-3bpfetLOAjsMMBS5qwTWJBvJHl5Vs9Y=.gJEIAywPXFr_4L-WG10eug==\\\",\\\"instanceServers\\\":[{\\\"endpoint\\\":\\\"wss://ws-api-futures.kucoin.com/\\\",\\\"encrypt\\\":true,\\\"protocol\\\":\\\"websocket\\\",\\\"pingInterval\\\":18000,\\\"pingTimeout\\\":10000}]}}" + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"token\\\": \\\"2neAiuYvAU737TOajb2U3uT8AEZqSWYe0fBD4LoHuXJDSC7gIzJiH4kNTWhCPISWo6nDpAe7aUaaHJ4fG8oRjFgMfUI2sM4IySWHrBceFocY8pKy2REU1HwZIngtMdMrjqPnP-biofFWbNaP1cl0X1pZc2SQ-33hDH1LgNP-yg8bktVoIG0dIxSN4m3uzO8u.ueCCihQ5_4GPpXKxWTDiFQ==\\\",\\n \\\"instanceServers\\\": [\\n {\\n \\\"endpoint\\\": \\\"wss://ws-api-futures.kucoin.com/\\\",\\n \\\"encrypt\\\": true,\\n \\\"protocol\\\": \\\"websocket\\\",\\n \\\"pingInterval\\\": 18000,\\n \\\"pingTimeout\\\": 10000\\n }\\n ]\\n }\\n}" } } }, diff --git a/spec/rest/api/openapi-futures-order.json b/spec/rest/api/openapi-futures-order.json index 091b3ecf..3afe0cb9 100644 --- a/spec/rest/api/openapi-futures-order.json +++ b/spec/rest/api/openapi-futures-order.json @@ -788,151 +788,13 @@ "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDTM\\\"}" } }, - "/api/v1/fills": { - "get": { - "summary": "Get Trade History", + "/api/v1/orders/test": { + "post": { + "summary": "Add Order Test", "deprecated": false, - "description": "Get a list of recent fills. If you need to get your recent trade history with low latency, please query endpoint Get List of Orders Completed in 24h. The requested data is not real-time.", + "description": "Place order to the futures trading system just for validation", "tags": [], - "parameters": [ - { - "name": "orderId", - "in": "query", - "description": "List fills for a specific order only (If you specify orderId, other parameters can be ignored)", - "required": false, - "schema": { - "type": "string" - } - }, - { - "name": "symbol", - "in": "query", - "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) ", - "required": false, - "schema": { - "type": "string" - } - }, - { - "name": "side", - "in": "query", - "description": "Order side", - "required": false, - "schema": { - "type": "string", - "enum": [ - "buy", - "sell" - ], - "x-api-enum": [ - { - "value": "buy", - "name": "buy", - "description": "buy" - }, - { - "value": "sell", - "name": "sell", - "description": "sell" - } - ] - } - }, - { - "name": "type", - "in": "query", - "description": "Order Type", - "required": false, - "schema": { - "type": "string", - "enum": [ - "limit", - "market", - "limit_stop", - "market_stop" - ], - "x-api-enum": [ - { - "value": "limit", - "name": "limit", - "description": "Limit order" - }, - { - "value": "market", - "name": "market", - "description": "Market order" - }, - { - "value": "limit_stop", - "name": "limit_stop", - "description": "Stop limit order" - }, - { - "value": "market_stop", - "name": "market_stop", - "description": "Stop Market order" - } - ] - } - }, - { - "name": "tradeTypes", - "in": "query", - "description": "Transaction type: trade, adl, liquid, settlement. Supports querying multiple types at the same time, separated by commas. Query all type when empty", - "required": false, - "schema": { - "type": "string", - "example": [ - "trade", - "adl", - "liquid", - "settlement", - "adl,liquid" - ] - } - }, - { - "name": "startAt", - "in": "query", - "description": "Start time (milisecond)", - "required": false, - "schema": { - "type": "integer", - "format": "int64" - } - }, - { - "name": "endAt", - "in": "query", - "description": "End time (milisecond)", - "required": false, - "schema": { - "type": "integer", - "format": "int64" - } - }, - { - "name": "currentPage", - "in": "query", - "description": "Current request page, The default currentPage is 1", - "required": false, - "schema": { - "type": "integer", - "default": 1 - } - }, - { - "name": "pageSize", - "in": "query", - "description": "pageSize, The default pageSize is 50, The maximum cannot exceed 1000", - "required": false, - "schema": { - "type": "integer", - "default": 50, - "maximum": 1000 - } - } - ], + "parameters": [], "responses": { "200": { "description": "", @@ -947,276 +809,18 @@ "data": { "type": "object", "properties": { - "currentPage": { - "type": "integer" - }, - "pageSize": { - "type": "integer" - }, - "totalNum": { - "type": "integer" - }, - "totalPage": { - "type": "integer" + "orderId": { + "type": "string", + "description": "The unique order id generated by the trading system,which can be used later for further actions such as canceling the order." }, - "items": { - "type": "array", - "items": { - "type": "object", - "properties": { - "symbol": { - "type": "string", - "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) " - }, - "tradeId": { - "type": "string", - "description": "Trade ID\n" - }, - "orderId": { - "type": "string", - "description": "Order ID\n" - }, - "side": { - "type": "string", - "description": "Transaction side", - "enum": [ - "buy", - "sell" - ], - "x-api-enum": [ - { - "value": "buy", - "name": "buy", - "description": "buy" - }, - { - "value": "sell", - "name": "sell", - "description": "sell" - } - ] - }, - "liquidity": { - "type": "string", - "description": "Liquidity- taker or maker", - "enum": [ - "taker", - "maker" - ], - "x-api-enum": [ - { - "value": "taker", - "name": "taker", - "description": "taker" - }, - { - "value": "maker", - "name": "maker", - "description": "maker" - } - ] - }, - "forceTaker": { - "type": "boolean", - "description": "Whether to force processing as a taker\n" - }, - "price": { - "type": "string", - "description": "Filled price" - }, - "size": { - "type": "integer", - "description": "Filled amount" - }, - "value": { - "type": "string", - "description": "Order value" - }, - "openFeePay": { - "type": "string", - "description": "Opening transaction fee" - }, - "closeFeePay": { - "type": "string", - "description": "Closing transaction fee" - }, - "stop": { - "type": "string", - "description": "A mark to the stop order type" - }, - "feeRate": { - "type": "string", - "description": "Fee Rate" - }, - "fixFee": { - "type": "string", - "description": "Fixed fees(Deprecated field, no actual use of the value field)" - }, - "feeCurrency": { - "type": "string", - "description": "Charging currency" - }, - "tradeTime": { - "type": "integer", - "description": "trade time in nanosecond", - "format": "int64" - }, - "subTradeType": { - "type": "string", - "description": "Deprecated field, no actual use of the value field" - }, - "marginMode": { - "type": "string", - "description": "Margin mode: ISOLATED (isolated), CROSS (cross margin).", - "enum": [ - "ISOLATED", - "CROSS" - ], - "x-api-enum": [ - { - "value": "ISOLATED", - "name": "ISOLATED", - "description": "Isolated Margin" - }, - { - "value": "CROSS", - "name": "CROSS", - "description": "Cross Margin" - } - ] - }, - "settleCurrency": { - "type": "string", - "description": "Settle Currency" - }, - "displayType": { - "type": "string", - "enum": [ - "limit", - "market", - "limit_stop", - "market_stop" - ], - "description": "Order Type", - "x-api-enum": [ - { - "value": "limit", - "name": "limit", - "description": "Limit order" - }, - { - "value": "market", - "name": "market", - "description": "Market order" - }, - { - "value": "limit_stop", - "name": "limit_stop", - "description": "Stop limit order" - }, - { - "value": "market_stop", - "name": "market_stop", - "description": "Stop Market order" - } - ] - }, - "fee": { - "type": "string" - }, - "orderType": { - "type": "string", - "description": "Order type", - "enum": [ - "market", - "limit" - ], - "x-api-enum": [ - { - "value": "market", - "name": "market", - "description": "market" - }, - { - "value": "limit", - "name": "limit", - "description": "limit" - } - ] - }, - "tradeType": { - "type": "string", - "description": "Trade type (trade, liquid, adl or settlement)\n", - "enum": [ - "trade", - "liquid", - "adl", - "settlement" - ], - "x-api-enum": [ - { - "value": "trade", - "name": "trade", - "description": "trade" - }, - { - "value": "liquid", - "name": "liquid", - "description": "liquid" - }, - { - "value": "adl", - "name": "adl", - "description": "adl" - }, - { - "value": "settlement", - "name": "settlement", - "description": "settlement" - } - ] - }, - "createdAt": { - "type": "integer", - "description": "Time the order created\n", - "format": "int64" - } - }, - "required": [ - "symbol", - "tradeId", - "orderId", - "side", - "liquidity", - "forceTaker", - "price", - "size", - "value", - "openFeePay", - "closeFeePay", - "stop", - "feeRate", - "fixFee", - "feeCurrency", - "tradeTime", - "subTradeType", - "marginMode", - "settleCurrency", - "displayType", - "fee", - "orderType", - "tradeType", - "createdAt" - ] - } + "clientOid": { + "type": "string", + "description": "The user self-defined order id." } }, "required": [ - "currentPage", - "pageSize", - "totalNum", - "totalPage", - "items" + "orderId", + "clientOid" ] } }, @@ -1229,83 +833,7 @@ } } }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470248", - "x-abandon": "normal", - "x-domain": "Futures", - "x-api-channel": "Private", - "x-api-permission": "Futures", - "x-api-rate-limit-pool": "Futures", - "x-sdk-service": "Futures", - "x-sdk-sub-service": "Order", - "x-sdk-method-name": "getTradeHistory", - "x-sdk-method-description": "Get a list of recent fills. If you need to get your recent trade history with low latency, please query endpoint Get List of Orders Completed in 24h. The requested data is not real-time.", - "x-api-rate-limit": 5, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"currentPage\\\": 1,\\n \\\"pageSize\\\": 50,\\n \\\"totalNum\\\": 2,\\n \\\"totalPage\\\": 1,\\n \\\"items\\\": [\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"tradeId\\\": \\\"1784277229880\\\",\\n \\\"orderId\\\": \\\"236317213710184449\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"liquidity\\\": \\\"taker\\\",\\n \\\"forceTaker\\\": false,\\n \\\"price\\\": \\\"67430.9\\\",\\n \\\"size\\\": 1,\\n \\\"value\\\": \\\"67.4309\\\",\\n \\\"openFeePay\\\": \\\"0.04045854\\\",\\n \\\"closeFeePay\\\": \\\"0\\\",\\n \\\"stop\\\": \\\"\\\",\\n \\\"feeRate\\\": \\\"0.00060\\\",\\n \\\"fixFee\\\": \\\"0\\\",\\n \\\"feeCurrency\\\": \\\"USDT\\\",\\n \\\"marginMode\\\": \\\"ISOLATED\\\",\\n \\\"settleCurrency\\\": \\\"USDT\\\",\\n \\\"fee\\\": \\\"0.04045854\\\",\\n \\\"orderType\\\": \\\"market\\\",\\n \\\"displayType\\\": \\\"market\\\",\\n \\\"tradeType\\\": \\\"trade\\\",\\n \\\"subTradeType\\\": null,\\n \\\"tradeTime\\\": 1729155616320000000,\\n \\\"createdAt\\\": 1729155616493\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"tradeId\\\": \\\"1784277132002\\\",\\n \\\"orderId\\\": \\\"236317094436728832\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"liquidity\\\": \\\"taker\\\",\\n \\\"forceTaker\\\": false,\\n \\\"price\\\": \\\"67445\\\",\\n \\\"size\\\": 1,\\n \\\"value\\\": \\\"67.445\\\",\\n \\\"openFeePay\\\": \\\"0\\\",\\n \\\"closeFeePay\\\": \\\"0.040467\\\",\\n \\\"stop\\\": \\\"\\\",\\n \\\"feeRate\\\": \\\"0.00060\\\",\\n \\\"fixFee\\\": \\\"0\\\",\\n \\\"feeCurrency\\\": \\\"USDT\\\",\\n \\\"marginMode\\\": \\\"ISOLATED\\\",\\n \\\"settleCurrency\\\": \\\"USDT\\\",\\n \\\"fee\\\": \\\"0.040467\\\",\\n \\\"orderType\\\": \\\"market\\\",\\n \\\"displayType\\\": \\\"market\\\",\\n \\\"tradeType\\\": \\\"trade\\\",\\n \\\"subTradeType\\\": null,\\n \\\"tradeTime\\\": 1729155587944000000,\\n \\\"createdAt\\\": 1729155588104\\n }\\n ]\\n }\\n}", - "x-request-example": "{\\\"orderId\\\": \\\"236655147005071361\\\", \\\"symbol\\\": \\\"example_string_default_value\\\", \\\"side\\\": \\\"buy\\\", \\\"type\\\": \\\"limit\\\", \\\"tradeTypes\\\": \\\"trade\\\", \\\"startAt\\\": 123456, \\\"endAt\\\": 123456, \\\"currentPage\\\": 1, \\\"pageSize\\\": 50}" - } - }, - "/api/v1/orders/multi": { - "post": { - "summary": "Batch Add Orders", - "deprecated": false, - "description": "Place multiple order to the futures trading system, you can place two major types of orders: limit and market. Orders can only be placed if your account has sufficient funds. Once an order is placed, your funds will be put on hold for the duration of the order. The amount of funds on hold depends on the order type and parameters specified. You can place up to 20 orders at one time, including limit orders, market orders, and stop orders Please be noted that the system would hold the fees from the orders entered the orderbook in advance.", - "tags": [], - "parameters": [], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "data": { - "type": "array", - "items": { - "type": "object", - "properties": { - "orderId": { - "type": "string", - "description": "The unique order id generated by the trading system,which can be used later for further actions such as canceling the order." - }, - "clientOid": { - "type": "string", - "description": "Unique order id created by users to identify their orders, the maximum length cannot exceed 40, e.g. UUID, Only allows numbers, characters, underline(_), and separator(-)" - }, - "symbol": { - "type": "string", - "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) " - }, - "code": { - "type": "string" - }, - "msg": { - "type": "string" - } - }, - "required": [ - "orderId", - "clientOid", - "symbol", - "code", - "msg" - ] - } - } - }, - "required": [ - "code", - "data" - ] - } - } - } - } - }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470236", + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470238", "x-abandon": "normal", "x-domain": "Futures", "x-api-channel": "Private", @@ -1313,645 +841,9 @@ "x-api-rate-limit-pool": "Futures", "x-sdk-service": "Futures", "x-sdk-sub-service": "Order", - "x-sdk-method-name": "batchAddOrders", - "x-sdk-method-description": "Place multiple order to the futures trading system, you can place two major types of orders: limit and market. Orders can only be placed if your account has sufficient funds. Once an order is placed, your funds will be put on hold for the duration of the order. The amount of funds on hold depends on the order type and parameters specified. You can place up to 20 orders at one time, including limit orders, market orders, and stop orders Please be noted that the system would hold the fees from the orders entered the orderbook in advance.", - "x-api-rate-limit": 20, - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "type": "object", - "properties": { - "clientOid": { - "type": "string", - "description": "Unique order id created by users to identify their orders, the maximum length cannot exceed 40, e.g. UUID, Only allows numbers, characters, underline(_), and separator(-)", - "example": [ - "5c52e11203aa677f33e493fb" - ] - }, - "side": { - "type": "string", - "description": "specify if the order is to 'buy' or 'sell'", - "enum": [ - "buy", - "sell" - ], - "x-api-enum": [ - { - "value": "buy", - "name": "", - "description": "" - }, - { - "value": "sell", - "name": "", - "description": "" - } - ], - "example": [ - "buy" - ] - }, - "symbol": { - "type": "string", - "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-221752070) ", - "example": [ - "XBTUSDTM" - ] - }, - "leverage": { - "type": "integer", - "description": "Used to calculate the margin to be frozen for the order. If you are to close the position, this parameter is not required.", - "example": [ - 3 - ] - }, - "type": { - "type": "string", - "description": "specify if the order is an 'limit' order or 'market' order", - "enum": [ - "limit", - "market" - ], - "default": "limit", - "x-api-enum": [ - { - "value": "limit", - "name": "", - "description": "" - }, - { - "value": "market", - "name": "", - "description": "" - } - ], - "example": [ - "limit" - ] - }, - "remark": { - "type": "string", - "description": "remark for the order, length cannot exceed 100 utf8 characters" - }, - "stop": { - "type": "string", - "description": "Either 'down' or 'up'. If stop is used,parameter stopPrice and stopPriceType also need to be provieded.", - "enum": [ - "down", - "up" - ], - "x-api-enum": [ - { - "value": "down", - "name": "down", - "description": "Triggers when the price reaches or goes below the stopPrice." - }, - { - "value": "up", - "name": "up", - "description": "Triggers when the price reaches or goes above the stopPrice" - } - ] - }, - "stopPriceType": { - "type": "string", - "description": "Either 'TP', 'IP' or 'MP', Need to be defined if stop is specified.", - "enum": [ - "TP", - "MP", - "IP" - ], - "x-api-enum": [ - { - "value": "TP", - "name": "trade price", - "description": "TP for trade price, The last trade price is the last price at which an order was filled. This price can be found in the latest match message." - }, - { - "value": "MP", - "name": "mark price", - "description": "MP for mark price, The mark price can be obtained through relevant OPEN API for index services" - }, - { - "value": "IP", - "name": "index price", - "description": "IP for index price, The index price can be obtained through relevant OPEN API for index services" - } - ] - }, - "stopPrice": { - "type": "string", - "description": "Need to be defined if stop is specified. " - }, - "reduceOnly": { - "type": "boolean", - "description": "A mark to reduce the position size only. Set to false by default. Need to set the position size when reduceOnly is true. If set to true, only the orders reducing the position size will be executed. If the reduce-only order size exceeds the position size, the extra size will be canceled.", - "default": false - }, - "closeOrder": { - "type": "boolean", - "description": "A mark to close the position. Set to false by default. If closeOrder is set to true, the system will close the position and the position size will become 0. Side, Size and Leverage fields can be left empty and the system will determine the side and size automatically.", - "default": false - }, - "forceHold": { - "type": "boolean", - "description": "A mark to forcely hold the funds for an order, even though it's an order to reduce the position size. This helps the order stay on the order book and not get canceled when the position size changes. Set to false by default. The system will forcely freeze certain amount of funds for this order, including orders whose direction is opposite to the current positions. This feature is to ensure that the order won’t be canceled by the matching engine in such a circumstance that not enough funds are frozen for the order.", - "default": false - }, - "stp": { - "type": "string", - "description": "[Self Trade Prevention](https://www.kucoin.com/docs-new/doc-338146) is divided into these strategies: CN, CO, CB. Not supported DC at the moment.", - "enum": [ - "CN", - "CO", - "CB" - ], - "x-api-enum": [ - { - "value": "CN", - "name": "CN", - "description": "Cancel new, Cancel the new order" - }, - { - "value": "CO", - "name": "CO", - "description": "Cancel old, Cancel the old order" - }, - { - "value": "CB", - "name": "CB", - "description": "Cancel both, Cancel both sides" - } - ] - }, - "marginMode": { - "type": "string", - "description": "Margin mode: ISOLATED, CROSS, default: ISOLATED", - "enum": [ - "ISOLATED", - "CROSS" - ], - "default": "ISOLATED", - "x-api-enum": [ - { - "value": "ISOLATED", - "name": "", - "description": "" - }, - { - "value": "CROSS", - "name": "", - "description": "" - } - ] - }, - "price": { - "type": "string", - "description": "Required for type is 'limit' order, indicating the operating price", - "example": [ - "0.1" - ] - }, - "size": { - "type": "integer", - "description": "**Choose one of size, qty, valueQty**, Order size (Lot), must be a positive integer. The quantity unit of coin-swap contracts is size(lot), and other units are not supported." - }, - "timeInForce": { - "type": "string", - "description": "Optional for type is 'limit' order, [Time in force](https://www.kucoin.com/docs-new/doc-338146) is a special strategy used during trading, default is GTC", - "enum": [ - "GTC", - "IOC" - ], - "default": "GTC", - "x-api-enum": [ - { - "value": "GTC", - "name": "Good Till Canceled", - "description": "order remains open on the order book until canceled. This is the default type if the field is left empty." - }, - { - "value": "IOC", - "name": "Immediate Or Cancel", - "description": "being matched or not, the remaining size of the order will be instantly canceled instead of entering the order book." - } - ] - }, - "postOnly": { - "type": "boolean", - "description": "Optional for type is 'limit' order, post only flag, invalid when timeInForce is IOC. When postOnly is true, not allowed choose hidden or iceberg. The post-only flag ensures that the trader always pays the maker fee and provides liquidity to the order book. If any part of the order is going to pay taker fee, the order will be fully rejected.", - "default": false - }, - "hidden": { - "type": "boolean", - "description": "Optional for type is 'limit' order, orders not displaying in order book. When hidden chose, not allowed choose postOnly.", - "default": false - }, - "iceberg": { - "type": "boolean", - "description": "Optional for type is 'limit' order, Only visible portion of the order is displayed in the order book. When iceberg chose, not allowed choose postOnly.", - "default": false - }, - "visibleSize": { - "type": "string", - "description": "Optional for type is 'limit' order, The maximum visible size of an iceberg order. please place order in size (lots), The units of qty (base currency) and valueQty (value) are not supported." - }, - "qty": { - "type": "string", - "description": "**Choose one of size, qty, valueQty**, Order size (Base currency) must be an integer multiple of the multiplier. The unit of the quantity of coin-swap is size(lot), which is not supported" - }, - "valueQty": { - "type": "string", - "description": "**Choose one of size, qty, valueQty**, Order size (Value), USDS-Swap correspond to USDT or USDC. The unit of the quantity of coin-swap is size(lot), which is not supported" - } - }, - "required": [ - "clientOid", - "symbol", - "type", - "side", - "leverage" - ] - } - }, - "example": "[\n {\n \"clientOid\": \"5c52e11203aa677f33e493fb\",\n \"side\": \"buy\",\n \"symbol\": \"XBTUSDTM\",\n \"leverage\": 3,\n \"type\": \"limit\",\n \"remark\": \"order remarks\",\n \"reduceOnly\": false,\n \"marginMode\": \"ISOLATED\",\n \"price\": \"0.1\",\n \"size\": 1,\n \"timeInForce\": \"GTC\"\n },\n {\n \"clientOid\": \"5c52e11203aa677f33e493fc\",\n \"side\": \"buy\",\n \"symbol\": \"XBTUSDTM\",\n \"leverage\": 3,\n \"type\": \"limit\",\n \"remark\": \"order remarks\",\n \"reduceOnly\": false,\n \"marginMode\": \"ISOLATED\",\n \"price\": \"0.1\",\n \"size\": 1,\n \"timeInForce\": \"GTC\"\n }\n]" - } - } - }, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": [\\n {\\n \\\"orderId\\\": \\\"235919387779985408\\\",\\n \\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\",\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"code\\\": \\\"200000\\\",\\n \\\"msg\\\": \\\"success\\\"\\n },\\n {\\n \\\"orderId\\\": \\\"235919387855482880\\\",\\n \\\"clientOid\\\": \\\"5c52e11203aa677f33e493fc\\\",\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"code\\\": \\\"200000\\\",\\n \\\"msg\\\": \\\"success\\\"\\n }\\n ]\\n}", - "x-request-example": "[{\\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\", \\\"side\\\": \\\"buy\\\", \\\"symbol\\\": \\\"XBTUSDTM\\\", \\\"leverage\\\": 3, \\\"type\\\": \\\"limit\\\", \\\"remark\\\": \\\"order remarks\\\", \\\"reduceOnly\\\": false, \\\"marginMode\\\": \\\"ISOLATED\\\", \\\"price\\\": \\\"0.1\\\", \\\"size\\\": 1, \\\"timeInForce\\\": \\\"GTC\\\"}, {\\\"clientOid\\\": \\\"5c52e11203aa677f33e493fc\\\", \\\"side\\\": \\\"buy\\\", \\\"symbol\\\": \\\"XBTUSDTM\\\", \\\"leverage\\\": 3, \\\"type\\\": \\\"limit\\\", \\\"remark\\\": \\\"order remarks\\\", \\\"reduceOnly\\\": false, \\\"marginMode\\\": \\\"ISOLATED\\\", \\\"price\\\": \\\"0.1\\\", \\\"size\\\": 1, \\\"timeInForce\\\": \\\"GTC\\\"}]" - } - }, - "/api/v1/recentFills": { - "get": { - "summary": "Get Recent Trade History", - "deprecated": false, - "description": "Get a list of recent 1000 fills in the last 24 hours. If you need to get your recent traded order history with low latency, you may query this endpoint.", - "tags": [], - "parameters": [ - { - "name": "symbol", - "in": "query", - "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) ", - "required": false, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "data": { - "type": "array", - "items": { - "type": "object", - "properties": { - "symbol": { - "type": "string", - "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) " - }, - "tradeId": { - "type": "string", - "description": "Trade ID\n" - }, - "orderId": { - "type": "string", - "description": "Order ID\n" - }, - "side": { - "type": "string", - "description": "Transaction side\n", - "enum": [ - "buy", - "sell" - ], - "x-api-enum": [ - { - "value": "buy", - "name": "buy", - "description": "buy" - }, - { - "value": "sell", - "name": "sell", - "description": "sell" - } - ] - }, - "liquidity": { - "type": "string", - "description": "Liquidity- taker or maker\n", - "enum": [ - "taker", - "maker" - ], - "x-api-enum": [ - { - "value": "taker", - "name": "taker", - "description": "taker" - }, - { - "value": "maker", - "name": "maker", - "description": "maker" - } - ] - }, - "forceTaker": { - "type": "boolean", - "description": "Whether to force processing as a taker\n" - }, - "price": { - "type": "string", - "description": "Filled price\n" - }, - "size": { - "type": "integer", - "description": "Filled amount\n" - }, - "value": { - "type": "string", - "description": "Order value\n" - }, - "openFeePay": { - "type": "string", - "description": "Opening transaction fee\n" - }, - "closeFeePay": { - "type": "string", - "description": "Closing transaction fee\n" - }, - "stop": { - "type": "string", - "description": "A mark to the stop order type\n" - }, - "feeRate": { - "type": "string", - "description": "Fee Rate" - }, - "fixFee": { - "type": "string", - "description": "Fixed fees(Deprecated field, no actual use of the value field)\n" - }, - "feeCurrency": { - "type": "string", - "description": "Charging currency\n" - }, - "tradeTime": { - "type": "integer", - "description": "trade time in nanosecond\n", - "format": "int64" - }, - "subTradeType": { - "type": "string", - "description": "Deprecated field, no actual use of the value field" - }, - "marginMode": { - "type": "string", - "description": "Margin mode: ISOLATED (isolated), CROSS (cross margin).\n", - "enum": [ - "ISOLATED", - "CROSS" - ], - "x-api-enum": [ - { - "value": "ISOLATED", - "name": "ISOLATED", - "description": "Isolated Margin" - }, - { - "value": "CROSS", - "name": "CROSS", - "description": "Cross Margin" - } - ] - }, - "displayType": { - "type": "string", - "enum": [ - "limit", - "market", - "limit_stop", - "market_stop" - ], - "description": "Order Type", - "x-api-enum": [ - { - "value": "limit", - "name": "limit", - "description": "Limit order" - }, - { - "value": "market", - "name": "market", - "description": "Market order" - }, - { - "value": "limit_stop", - "name": "limit_stop", - "description": "Stop limit order" - }, - { - "value": "market_stop", - "name": "market_stop", - "description": "Stop Market order" - } - ] - }, - "fee": { - "type": "string", - "description": "Transaction fee\n" - }, - "settleCurrency": { - "type": "string", - "description": "Settle Currency" - }, - "orderType": { - "type": "string", - "description": "Order type\n", - "enum": [ - "market", - "limit" - ], - "x-api-enum": [ - { - "value": "market", - "name": "market", - "description": "market" - }, - { - "value": "limit", - "name": "limit", - "description": "limit" - } - ] - }, - "tradeType": { - "type": "string", - "description": "Trade type (trade, liquid, cancel, adl or settlement)\n", - "enum": [ - "trade", - "cancel", - "liquid", - "adl", - "settlement" - ], - "x-api-enum": [ - { - "value": "trade", - "name": "trade", - "description": "trade" - }, - { - "value": "cancel", - "name": "cancel", - "description": "Partially filled and cancelled orders" - }, - { - "value": "liquid", - "name": "liquid", - "description": "liquid" - }, - { - "value": "adl", - "name": "adl", - "description": "adl" - }, - { - "value": "settlement", - "name": "settlement", - "description": "settlement" - } - ] - }, - "createdAt": { - "type": "integer", - "description": "Time the order created\n", - "format": "int64" - } - }, - "required": [ - "symbol", - "tradeId", - "orderId", - "side", - "liquidity", - "forceTaker", - "price", - "size", - "value", - "openFeePay", - "closeFeePay", - "stop", - "feeRate", - "fixFee", - "feeCurrency", - "tradeTime", - "subTradeType", - "marginMode", - "displayType", - "fee", - "settleCurrency", - "orderType", - "tradeType", - "createdAt" - ] - } - } - }, - "required": [ - "code", - "data" - ] - } - } - } - } - }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470249", - "x-abandon": "normal", - "x-domain": "Futures", - "x-api-channel": "Private", - "x-api-permission": "Futures", - "x-api-rate-limit-pool": "Futures", - "x-sdk-service": "Futures", - "x-sdk-sub-service": "Order", - "x-sdk-method-name": "getRecentTradeHistory", - "x-sdk-method-description": "Get a list of recent 1000 fills in the last 24 hours. If you need to get your recent traded order history with low latency, you may query this endpoint.", - "x-api-rate-limit": 3, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": [\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"tradeId\\\": \\\"1784277229880\\\",\\n \\\"orderId\\\": \\\"236317213710184449\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"liquidity\\\": \\\"taker\\\",\\n \\\"forceTaker\\\": false,\\n \\\"price\\\": \\\"67430.9\\\",\\n \\\"size\\\": 1,\\n \\\"value\\\": \\\"67.4309\\\",\\n \\\"openFeePay\\\": \\\"0.04045854\\\",\\n \\\"closeFeePay\\\": \\\"0\\\",\\n \\\"stop\\\": \\\"\\\",\\n \\\"feeRate\\\": \\\"0.00060\\\",\\n \\\"fixFee\\\": \\\"0\\\",\\n \\\"feeCurrency\\\": \\\"USDT\\\",\\n \\\"marginMode\\\": \\\"ISOLATED\\\",\\n \\\"fee\\\": \\\"0.04045854\\\",\\n \\\"settleCurrency\\\": \\\"USDT\\\",\\n \\\"orderType\\\": \\\"market\\\",\\n \\\"displayType\\\": \\\"market\\\",\\n \\\"tradeType\\\": \\\"trade\\\",\\n \\\"subTradeType\\\": null,\\n \\\"tradeTime\\\": 1729155616320000000,\\n \\\"createdAt\\\": 1729155616493\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"tradeId\\\": \\\"1784277132002\\\",\\n \\\"orderId\\\": \\\"236317094436728832\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"liquidity\\\": \\\"taker\\\",\\n \\\"forceTaker\\\": false,\\n \\\"price\\\": \\\"67445\\\",\\n \\\"size\\\": 1,\\n \\\"value\\\": \\\"67.445\\\",\\n \\\"openFeePay\\\": \\\"0\\\",\\n \\\"closeFeePay\\\": \\\"0.040467\\\",\\n \\\"stop\\\": \\\"\\\",\\n \\\"feeRate\\\": \\\"0.00060\\\",\\n \\\"fixFee\\\": \\\"0\\\",\\n \\\"feeCurrency\\\": \\\"USDT\\\",\\n \\\"marginMode\\\": \\\"ISOLATED\\\",\\n \\\"fee\\\": \\\"0.040467\\\",\\n \\\"settleCurrency\\\": \\\"USDT\\\",\\n \\\"orderType\\\": \\\"market\\\",\\n \\\"displayType\\\": \\\"market\\\",\\n \\\"tradeType\\\": \\\"trade\\\",\\n \\\"subTradeType\\\": null,\\n \\\"tradeTime\\\": 1729155587944000000,\\n \\\"createdAt\\\": 1729155588104\\n }\\n ]\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDTM\\\"}" - } - }, - "/api/v1/st-orders": { - "post": { - "summary": "Add Take Profit And Stop Loss Order", - "deprecated": false, - "description": "Place take profit and stop loss order supports both take-profit and stop-loss functions, and other functions are exactly the same as the place order interface.", - "tags": [], - "parameters": [], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "data": { - "type": "object", - "properties": { - "orderId": { - "type": "string", - "description": "The unique order id generated by the trading system,which can be used later for further actions such as canceling the order." - }, - "clientOid": { - "type": "string", - "description": "The user self-defined order id." - } - }, - "required": [ - "orderId", - "clientOid" - ] - } - }, - "required": [ - "code", - "data" - ] - } - } - } - } - }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470237", - "x-abandon": "normal", - "x-domain": "Futures", - "x-api-channel": "Private", - "x-api-permission": "Futures", - "x-api-rate-limit-pool": "Futures", - "x-sdk-service": "Futures", - "x-sdk-sub-service": "Order", - "x-sdk-method-name": "addTPSLOrder", - "x-sdk-method-description": "Place take profit and stop loss order supports both take-profit and stop-loss functions, and other functions are exactly the same as the place order interface.", - "x-api-rate-limit": 2, + "x-sdk-method-name": "addOrderTest", + "x-sdk-method-description": "Place order to the futures trading system just for validation", + "x-api-rate-limit": 2, "requestBody": { "content": { "application/json": { @@ -2013,13 +905,13 @@ "x-api-enum": [ { "value": "limit", - "name": "limit", - "description": "limit order" + "name": "", + "description": "" }, { "value": "market", - "name": "market", - "description": "market order" + "name": "", + "description": "" } ], "example": [ @@ -2030,9 +922,29 @@ "type": "string", "description": "remark for the order, length cannot exceed 100 utf8 characters" }, + "stop": { + "type": "string", + "description": "Either 'down' or 'up'. If stop is used,parameter stopPrice and stopPriceType also need to be provieded.", + "enum": [ + "down", + "up" + ], + "x-api-enum": [ + { + "value": "down", + "name": "down", + "description": "Triggers when the price reaches or goes below the stopPrice." + }, + { + "value": "up", + "name": "up", + "description": "Triggers when the price reaches or goes above the stopPrice" + } + ] + }, "stopPriceType": { "type": "string", - "description": "Either 'TP', 'IP' or 'MP'", + "description": "Either 'TP', 'IP' or 'MP', Need to be defined if stop is specified.", "enum": [ "TP", "MP", @@ -2056,6 +968,10 @@ } ] }, + "stopPrice": { + "type": "string", + "description": "Need to be defined if stop is specified. " + }, "reduceOnly": { "type": "boolean", "description": "A mark to reduce the position size only. Set to false by default. Need to set the position size when reduceOnly is true. If set to true, only the orders reducing the position size will be executed. If the reduce-only order size exceeds the position size, the extra size will be canceled.", @@ -2169,14 +1085,6 @@ "type": "string", "description": "Optional for type is 'limit' order, The maximum visible size of an iceberg order. please place order in size (lots), The units of qty (base currency) and valueQty (value) are not supported." }, - "triggerStopUpPrice": { - "type": "string", - "description": "Take profit price" - }, - "triggerStopDownPrice": { - "type": "string", - "description": "Stop loss price" - }, "qty": { "type": "string", "description": "**Choose one of size, qty, valueQty**, Order size (Base currency) must be an integer multiple of the multiplier. The unit of the quantity of coin-swap is size(lot), which is not supported" @@ -2194,104 +1102,360 @@ "leverage" ] }, - "example": "{\n \"clientOid\": \"5c52e11203aa677f33e493fb\",\n \"side\": \"buy\",\n \"symbol\": \"XBTUSDTM\",\n \"leverage\": 3,\n \"type\": \"limit\",\n \"remark\": \"order remarks\",\n \"reduceOnly\": false,\n \"marginMode\": \"ISOLATED\",\n \"price\": \"0.2\",\n \"size\": 1,\n \"timeInForce\": \"GTC\",\n \"triggerStopUpPrice\": \"0.3\",\n \"triggerStopDownPrice\": \"0.1\",\n \"stopPriceType\": \"TP\"\n}" + "example": "{\n \"clientOid\": \"5c52e11203aa677f33e493fb\",\n \"side\": \"buy\",\n \"symbol\": \"XBTUSDTM\",\n \"leverage\": 3,\n \"type\": \"limit\",\n \"remark\": \"order remarks\",\n \"reduceOnly\": false,\n \"marginMode\": \"ISOLATED\",\n \"price\": \"0.1\",\n \"size\": 1,\n \"timeInForce\": \"GTC\"\n}" } } }, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"orderId\\\": \\\"234125150956625920\\\",\\n \\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\"\\n }\\n}", - "x-request-example": "{\\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\", \\\"side\\\": \\\"buy\\\", \\\"symbol\\\": \\\"XBTUSDTM\\\", \\\"leverage\\\": 3, \\\"type\\\": \\\"limit\\\", \\\"remark\\\": \\\"order remarks\\\", \\\"reduceOnly\\\": false, \\\"marginMode\\\": \\\"ISOLATED\\\", \\\"price\\\": \\\"0.2\\\", \\\"size\\\": 1, \\\"timeInForce\\\": \\\"GTC\\\", \\\"triggerStopUpPrice\\\": \\\"0.3\\\", \\\"triggerStopDownPrice\\\": \\\"0.1\\\", \\\"stopPriceType\\\": \\\"TP\\\"}" + "x-request-example": "{\\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\", \\\"side\\\": \\\"buy\\\", \\\"symbol\\\": \\\"XBTUSDTM\\\", \\\"leverage\\\": 3, \\\"type\\\": \\\"limit\\\", \\\"remark\\\": \\\"order remarks\\\", \\\"reduceOnly\\\": false, \\\"marginMode\\\": \\\"ISOLATED\\\", \\\"price\\\": \\\"0.1\\\", \\\"size\\\": 1, \\\"timeInForce\\\": \\\"GTC\\\"}" } }, - "/api/v1/openOrderStatistics": { - "get": { - "summary": "Get Open Order Value", + "/api/v1/orders/multi": { + "post": { + "summary": "Batch Add Orders", "deprecated": false, - "description": "You can query this endpoint to get the the total number and value of the all your active orders.", + "description": "Place multiple order to the futures trading system, you can place two major types of orders: limit and market. Orders can only be placed if your account has sufficient funds. Once an order is placed, your funds will be put on hold for the duration of the order. The amount of funds on hold depends on the order type and parameters specified. You can place up to 20 orders at one time, including limit orders, market orders, and stop orders Please be noted that the system would hold the fees from the orders entered the orderbook in advance.", "tags": [], - "parameters": [ - { - "name": "symbol", - "in": "query", - "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) ", - "required": true, - "schema": { - "type": "string" + "parameters": [], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "array", + "items": { + "type": "object", + "properties": { + "orderId": { + "type": "string", + "description": "The unique order id generated by the trading system,which can be used later for further actions such as canceling the order." + }, + "clientOid": { + "type": "string", + "description": "Unique order id created by users to identify their orders, the maximum length cannot exceed 40, e.g. UUID, Only allows numbers, characters, underline(_), and separator(-)" + }, + "symbol": { + "type": "string", + "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) " + }, + "code": { + "type": "string" + }, + "msg": { + "type": "string" + } + }, + "required": [ + "orderId", + "clientOid", + "symbol", + "code", + "msg" + ] + } + } + }, + "required": [ + "code", + "data" + ] + } + } } } - ], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { + }, + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470236", + "x-abandon": "normal", + "x-domain": "Futures", + "x-api-channel": "Private", + "x-api-permission": "Futures", + "x-api-rate-limit-pool": "Futures", + "x-sdk-service": "Futures", + "x-sdk-sub-service": "Order", + "x-sdk-method-name": "batchAddOrders", + "x-sdk-method-description": "Place multiple order to the futures trading system, you can place two major types of orders: limit and market. Orders can only be placed if your account has sufficient funds. Once an order is placed, your funds will be put on hold for the duration of the order. The amount of funds on hold depends on the order type and parameters specified. You can place up to 20 orders at one time, including limit orders, market orders, and stop orders Please be noted that the system would hold the fees from the orders entered the orderbook in advance.", + "x-api-rate-limit": 20, + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { "type": "object", "properties": { - "code": { - "type": "string" + "clientOid": { + "type": "string", + "description": "Unique order id created by users to identify their orders, the maximum length cannot exceed 40, e.g. UUID, Only allows numbers, characters, underline(_), and separator(-)", + "example": [ + "5c52e11203aa677f33e493fb" + ] }, - "data": { - "type": "object", - "properties": { - "openOrderBuySize": { - "type": "integer", - "description": "Total number of the unexecuted buy orders\n" + "side": { + "type": "string", + "description": "specify if the order is to 'buy' or 'sell'", + "enum": [ + "buy", + "sell" + ], + "x-api-enum": [ + { + "value": "buy", + "name": "", + "description": "" }, - "openOrderSellSize": { - "type": "integer", - "description": "Total number of the unexecuted sell orders\n" + { + "value": "sell", + "name": "", + "description": "" + } + ], + "example": [ + "buy" + ] + }, + "symbol": { + "type": "string", + "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-221752070) ", + "example": [ + "XBTUSDTM" + ] + }, + "leverage": { + "type": "integer", + "description": "Used to calculate the margin to be frozen for the order. If you are to close the position, this parameter is not required.", + "example": [ + 3 + ] + }, + "type": { + "type": "string", + "description": "specify if the order is an 'limit' order or 'market' order", + "enum": [ + "limit", + "market" + ], + "default": "limit", + "x-api-enum": [ + { + "value": "limit", + "name": "", + "description": "" }, - "openOrderBuyCost": { - "type": "string", - "description": "Value of all the unexecuted buy orders\n" + { + "value": "market", + "name": "", + "description": "" + } + ], + "example": [ + "limit" + ] + }, + "remark": { + "type": "string", + "description": "remark for the order, length cannot exceed 100 utf8 characters" + }, + "stop": { + "type": "string", + "description": "Either 'down' or 'up'. If stop is used,parameter stopPrice and stopPriceType also need to be provieded.", + "enum": [ + "down", + "up" + ], + "x-api-enum": [ + { + "value": "down", + "name": "down", + "description": "Triggers when the price reaches or goes below the stopPrice." }, - "openOrderSellCost": { - "type": "string", - "description": "Value of all the unexecuted sell orders\n" + { + "value": "up", + "name": "up", + "description": "Triggers when the price reaches or goes above the stopPrice" + } + ] + }, + "stopPriceType": { + "type": "string", + "description": "Either 'TP', 'IP' or 'MP', Need to be defined if stop is specified.", + "enum": [ + "TP", + "MP", + "IP" + ], + "x-api-enum": [ + { + "value": "TP", + "name": "trade price", + "description": "TP for trade price, The last trade price is the last price at which an order was filled. This price can be found in the latest match message." }, - "settleCurrency": { - "type": "string", - "description": "settlement currency\n" + { + "value": "MP", + "name": "mark price", + "description": "MP for mark price, The mark price can be obtained through relevant OPEN API for index services" + }, + { + "value": "IP", + "name": "index price", + "description": "IP for index price, The index price can be obtained through relevant OPEN API for index services" + } + ] + }, + "stopPrice": { + "type": "string", + "description": "Need to be defined if stop is specified. " + }, + "reduceOnly": { + "type": "boolean", + "description": "A mark to reduce the position size only. Set to false by default. Need to set the position size when reduceOnly is true. If set to true, only the orders reducing the position size will be executed. If the reduce-only order size exceeds the position size, the extra size will be canceled.", + "default": false + }, + "closeOrder": { + "type": "boolean", + "description": "A mark to close the position. Set to false by default. If closeOrder is set to true, the system will close the position and the position size will become 0. Side, Size and Leverage fields can be left empty and the system will determine the side and size automatically.", + "default": false + }, + "forceHold": { + "type": "boolean", + "description": "A mark to forcely hold the funds for an order, even though it's an order to reduce the position size. This helps the order stay on the order book and not get canceled when the position size changes. Set to false by default. The system will forcely freeze certain amount of funds for this order, including orders whose direction is opposite to the current positions. This feature is to ensure that the order won’t be canceled by the matching engine in such a circumstance that not enough funds are frozen for the order.", + "default": false + }, + "stp": { + "type": "string", + "description": "[Self Trade Prevention](https://www.kucoin.com/docs-new/doc-338146) is divided into these strategies: CN, CO, CB. Not supported DC at the moment.", + "enum": [ + "CN", + "CO", + "CB" + ], + "x-api-enum": [ + { + "value": "CN", + "name": "CN", + "description": "Cancel new, Cancel the new order" + }, + { + "value": "CO", + "name": "CO", + "description": "Cancel old, Cancel the old order" + }, + { + "value": "CB", + "name": "CB", + "description": "Cancel both, Cancel both sides" + } + ] + }, + "marginMode": { + "type": "string", + "description": "Margin mode: ISOLATED, CROSS, default: ISOLATED", + "enum": [ + "ISOLATED", + "CROSS" + ], + "default": "ISOLATED", + "x-api-enum": [ + { + "value": "ISOLATED", + "name": "", + "description": "" + }, + { + "value": "CROSS", + "name": "", + "description": "" + } + ] + }, + "price": { + "type": "string", + "description": "Required for type is 'limit' order, indicating the operating price", + "example": [ + "0.1" + ] + }, + "size": { + "type": "integer", + "description": "**Choose one of size, qty, valueQty**, Order size (Lot), must be a positive integer. The quantity unit of coin-swap contracts is size(lot), and other units are not supported." + }, + "timeInForce": { + "type": "string", + "description": "Optional for type is 'limit' order, [Time in force](https://www.kucoin.com/docs-new/doc-338146) is a special strategy used during trading, default is GTC", + "enum": [ + "GTC", + "IOC" + ], + "default": "GTC", + "x-api-enum": [ + { + "value": "GTC", + "name": "Good Till Canceled", + "description": "order remains open on the order book until canceled. This is the default type if the field is left empty." + }, + { + "value": "IOC", + "name": "Immediate Or Cancel", + "description": "being matched or not, the remaining size of the order will be instantly canceled instead of entering the order book." } - }, - "required": [ - "openOrderBuySize", - "openOrderSellSize", - "openOrderBuyCost", - "openOrderSellCost", - "settleCurrency" ] + }, + "postOnly": { + "type": "boolean", + "description": "Optional for type is 'limit' order, post only flag, invalid when timeInForce is IOC. When postOnly is true, not allowed choose hidden or iceberg. The post-only flag ensures that the trader always pays the maker fee and provides liquidity to the order book. If any part of the order is going to pay taker fee, the order will be fully rejected.", + "default": false + }, + "hidden": { + "type": "boolean", + "description": "Optional for type is 'limit' order, orders not displaying in order book. When hidden chose, not allowed choose postOnly.", + "default": false + }, + "iceberg": { + "type": "boolean", + "description": "Optional for type is 'limit' order, Only visible portion of the order is displayed in the order book. When iceberg chose, not allowed choose postOnly.", + "default": false + }, + "visibleSize": { + "type": "string", + "description": "Optional for type is 'limit' order, The maximum visible size of an iceberg order. please place order in size (lots), The units of qty (base currency) and valueQty (value) are not supported." + }, + "qty": { + "type": "string", + "description": "**Choose one of size, qty, valueQty**, Order size (Base currency) must be an integer multiple of the multiplier. The unit of the quantity of coin-swap is size(lot), which is not supported" + }, + "valueQty": { + "type": "string", + "description": "**Choose one of size, qty, valueQty**, Order size (Value), USDS-Swap correspond to USDT or USDC. The unit of the quantity of coin-swap is size(lot), which is not supported" } }, "required": [ - "code", - "data" + "clientOid", + "symbol", + "type", + "side", + "leverage" ] } - } + }, + "example": "[\n {\n \"clientOid\": \"5c52e11203aa677f33e493fb\",\n \"side\": \"buy\",\n \"symbol\": \"XBTUSDTM\",\n \"leverage\": 3,\n \"type\": \"limit\",\n \"remark\": \"order remarks\",\n \"reduceOnly\": false,\n \"marginMode\": \"ISOLATED\",\n \"price\": \"0.1\",\n \"size\": 1,\n \"timeInForce\": \"GTC\"\n },\n {\n \"clientOid\": \"5c52e11203aa677f33e493fc\",\n \"side\": \"buy\",\n \"symbol\": \"XBTUSDTM\",\n \"leverage\": 3,\n \"type\": \"limit\",\n \"remark\": \"order remarks\",\n \"reduceOnly\": false,\n \"marginMode\": \"ISOLATED\",\n \"price\": \"0.1\",\n \"size\": 1,\n \"timeInForce\": \"GTC\"\n }\n]" } } }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470250", - "x-abandon": "normal", - "x-domain": "Futures", - "x-api-channel": "Private", - "x-api-permission": "Futures", - "x-api-rate-limit-pool": "Futures", - "x-sdk-service": "Futures", - "x-sdk-sub-service": "Order", - "x-sdk-method-name": "GetOpenOrderValue", - "x-sdk-method-description": "You can query this endpoint to get the the total number and value of the all your active orders.", - "x-api-rate-limit": 10, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"openOrderBuySize\\\": 1,\\n \\\"openOrderSellSize\\\": 0,\\n \\\"openOrderBuyCost\\\": \\\"0.0001\\\",\\n \\\"openOrderSellCost\\\": \\\"0\\\",\\n \\\"settleCurrency\\\": \\\"USDT\\\"\\n }\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDTM\\\"}" + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": [\\n {\\n \\\"orderId\\\": \\\"235919387779985408\\\",\\n \\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\",\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"code\\\": \\\"200000\\\",\\n \\\"msg\\\": \\\"success\\\"\\n },\\n {\\n \\\"orderId\\\": \\\"235919387855482880\\\",\\n \\\"clientOid\\\": \\\"5c52e11203aa677f33e493fc\\\",\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"code\\\": \\\"200000\\\",\\n \\\"msg\\\": \\\"success\\\"\\n }\\n ]\\n}", + "x-request-example": "[{\\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\", \\\"side\\\": \\\"buy\\\", \\\"symbol\\\": \\\"XBTUSDTM\\\", \\\"leverage\\\": 3, \\\"type\\\": \\\"limit\\\", \\\"remark\\\": \\\"order remarks\\\", \\\"reduceOnly\\\": false, \\\"marginMode\\\": \\\"ISOLATED\\\", \\\"price\\\": \\\"0.1\\\", \\\"size\\\": 1, \\\"timeInForce\\\": \\\"GTC\\\"}, {\\\"clientOid\\\": \\\"5c52e11203aa677f33e493fc\\\", \\\"side\\\": \\\"buy\\\", \\\"symbol\\\": \\\"XBTUSDTM\\\", \\\"leverage\\\": 3, \\\"type\\\": \\\"limit\\\", \\\"remark\\\": \\\"order remarks\\\", \\\"reduceOnly\\\": false, \\\"marginMode\\\": \\\"ISOLATED\\\", \\\"price\\\": \\\"0.1\\\", \\\"size\\\": 1, \\\"timeInForce\\\": \\\"GTC\\\"}]" } }, - "/api/v1/orders/test": { + "/api/v1/st-orders": { "post": { - "summary": "Add Order Test", + "summary": "Add Take Profit And Stop Loss Order", "deprecated": false, - "description": "Place order to the futures trading system just for validation", + "description": "Place take profit and stop loss order supports both take-profit and stop-loss functions, and other functions are exactly the same as the place order interface.", "tags": [], "parameters": [], "responses": { @@ -2332,7 +1496,7 @@ } } }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470238", + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470237", "x-abandon": "normal", "x-domain": "Futures", "x-api-channel": "Private", @@ -2340,8 +1504,8 @@ "x-api-rate-limit-pool": "Futures", "x-sdk-service": "Futures", "x-sdk-sub-service": "Order", - "x-sdk-method-name": "addOrderTest", - "x-sdk-method-description": "Place order to the futures trading system just for validation", + "x-sdk-method-name": "addTPSLOrder", + "x-sdk-method-description": "Place take profit and stop loss order supports both take-profit and stop-loss functions, and other functions are exactly the same as the place order interface.", "x-api-rate-limit": 2, "requestBody": { "content": { @@ -2404,13 +1568,13 @@ "x-api-enum": [ { "value": "limit", - "name": "", - "description": "" + "name": "limit", + "description": "limit order" }, { "value": "market", - "name": "", - "description": "" + "name": "market", + "description": "market order" } ], "example": [ @@ -2421,29 +1585,9 @@ "type": "string", "description": "remark for the order, length cannot exceed 100 utf8 characters" }, - "stop": { - "type": "string", - "description": "Either 'down' or 'up'. If stop is used,parameter stopPrice and stopPriceType also need to be provieded.", - "enum": [ - "down", - "up" - ], - "x-api-enum": [ - { - "value": "down", - "name": "down", - "description": "Triggers when the price reaches or goes below the stopPrice." - }, - { - "value": "up", - "name": "up", - "description": "Triggers when the price reaches or goes above the stopPrice" - } - ] - }, "stopPriceType": { "type": "string", - "description": "Either 'TP', 'IP' or 'MP', Need to be defined if stop is specified.", + "description": "Either 'TP', 'IP' or 'MP'", "enum": [ "TP", "MP", @@ -2467,10 +1611,6 @@ } ] }, - "stopPrice": { - "type": "string", - "description": "Need to be defined if stop is specified. " - }, "reduceOnly": { "type": "boolean", "description": "A mark to reduce the position size only. Set to false by default. Need to set the position size when reduceOnly is true. If set to true, only the orders reducing the position size will be executed. If the reduce-only order size exceeds the position size, the extra size will be canceled.", @@ -2584,6 +1724,14 @@ "type": "string", "description": "Optional for type is 'limit' order, The maximum visible size of an iceberg order. please place order in size (lots), The units of qty (base currency) and valueQty (value) are not supported." }, + "triggerStopUpPrice": { + "type": "string", + "description": "Take profit price" + }, + "triggerStopDownPrice": { + "type": "string", + "description": "Stop loss price" + }, "qty": { "type": "string", "description": "**Choose one of size, qty, valueQty**, Order size (Base currency) must be an integer multiple of the multiplier. The unit of the quantity of coin-swap is size(lot), which is not supported" @@ -2601,12 +1749,12 @@ "leverage" ] }, - "example": "{\n \"clientOid\": \"5c52e11203aa677f33e493fb\",\n \"side\": \"buy\",\n \"symbol\": \"XBTUSDTM\",\n \"leverage\": 3,\n \"type\": \"limit\",\n \"remark\": \"order remarks\",\n \"reduceOnly\": false,\n \"marginMode\": \"ISOLATED\",\n \"price\": \"0.1\",\n \"size\": 1,\n \"timeInForce\": \"GTC\"\n}" + "example": "{\n \"clientOid\": \"5c52e11203aa677f33e493fb\",\n \"side\": \"buy\",\n \"symbol\": \"XBTUSDTM\",\n \"leverage\": 3,\n \"type\": \"limit\",\n \"remark\": \"order remarks\",\n \"reduceOnly\": false,\n \"marginMode\": \"ISOLATED\",\n \"price\": \"0.2\",\n \"size\": 1,\n \"timeInForce\": \"GTC\",\n \"triggerStopUpPrice\": \"0.3\",\n \"triggerStopDownPrice\": \"0.1\",\n \"stopPriceType\": \"TP\"\n}" } } }, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"orderId\\\": \\\"234125150956625920\\\",\\n \\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\"\\n }\\n}", - "x-request-example": "{\\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\", \\\"side\\\": \\\"buy\\\", \\\"symbol\\\": \\\"XBTUSDTM\\\", \\\"leverage\\\": 3, \\\"type\\\": \\\"limit\\\", \\\"remark\\\": \\\"order remarks\\\", \\\"reduceOnly\\\": false, \\\"marginMode\\\": \\\"ISOLATED\\\", \\\"price\\\": \\\"0.1\\\", \\\"size\\\": 1, \\\"timeInForce\\\": \\\"GTC\\\"}" + "x-request-example": "{\\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\", \\\"side\\\": \\\"buy\\\", \\\"symbol\\\": \\\"XBTUSDTM\\\", \\\"leverage\\\": 3, \\\"type\\\": \\\"limit\\\", \\\"remark\\\": \\\"order remarks\\\", \\\"reduceOnly\\\": false, \\\"marginMode\\\": \\\"ISOLATED\\\", \\\"price\\\": \\\"0.2\\\", \\\"size\\\": 1, \\\"timeInForce\\\": \\\"GTC\\\", \\\"triggerStopUpPrice\\\": \\\"0.3\\\", \\\"triggerStopDownPrice\\\": \\\"0.1\\\", \\\"stopPriceType\\\": \\\"TP\\\"}" } }, "/api/v1/orders/{orderId}": { @@ -2873,7 +2021,7 @@ { "name": "symbol", "in": "query", - "description": "Cancel all limit orders for a specific contract only, If not specified, all the limit orders will be deleted, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) ", + "description": "Cancel all limit orders for a specific symbol only, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) ", "required": true, "schema": { "type": "string" @@ -2926,7 +2074,7 @@ "x-sdk-sub-service": "Order", "x-sdk-method-name": "cancelAllOrdersV3", "x-sdk-method-description": "Cancel all open orders (excluding stop orders). The response is a list of orderIDs of the canceled orders.", - "x-api-rate-limit": 30, + "x-api-rate-limit": 10, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"cancelledOrderIds\\\": [\\n \\\"235919172150824960\\\",\\n \\\"235919172150824961\\\"\\n ]\\n }\\n}", "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDTM\\\"}" } @@ -2939,12 +2087,168 @@ "tags": [], "parameters": [ { - "name": "symbol", + "name": "symbol", + "in": "query", + "description": "Cancel all limit orders for a specific contract only, If not specified, all the limit orders will be deleted, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) ", + "required": false, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "object", + "properties": { + "cancelledOrderIds": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Unique ID of the cancelled order" + } + }, + "required": [ + "cancelledOrderIds" + ] + } + }, + "required": [ + "code", + "data" + ] + } + } + } + } + }, + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470243", + "x-abandon": "normal", + "x-domain": "Futures", + "x-api-channel": "Private", + "x-api-permission": "Futures", + "x-api-rate-limit-pool": "Futures", + "x-sdk-service": "Futures", + "x-sdk-sub-service": "Order", + "x-sdk-method-name": "cancelAllStopOrders", + "x-sdk-method-description": "Cancel all untriggered stop orders. The response is a list of orderIDs of the canceled stop orders. To cancel triggered stop orders, please use 'Cancel Multiple Futures Limit orders'.", + "x-api-rate-limit": 15, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"cancelledOrderIds\\\": [\\n \\\"235919172150824960\\\",\\n \\\"235919172150824961\\\"\\n ]\\n }\\n}", + "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDTM\\\"}" + }, + "get": { + "summary": "Get Stop Order List", + "deprecated": false, + "description": "Get the un-triggered stop orders list. Stop orders that have been triggered can be queried through the general order interface", + "tags": [], + "parameters": [ + { + "name": "symbol", + "in": "query", + "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) ", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "side", + "in": "query", + "description": "buy or sell", + "required": false, + "schema": { + "type": "string", + "enum": [ + "buy", + "sell" + ], + "x-api-enum": [ + { + "value": "buy", + "name": "", + "description": "" + }, + { + "value": "sell", + "name": "", + "description": "" + } + ] + } + }, + { + "name": "type", + "in": "query", + "description": "limit, market", + "required": false, + "schema": { + "type": "string", + "enum": [ + "limit", + "market" + ], + "x-api-enum": [ + { + "value": "limit", + "name": "", + "description": "" + }, + { + "value": "market", + "name": "", + "description": "" + } + ] + } + }, + { + "name": "startAt", + "in": "query", + "description": "Start time (milisecond)", + "required": false, + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "endAt", + "in": "query", + "description": "End time (milisecond)", + "required": false, + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "currentPage", "in": "query", - "description": "Cancel all limit orders for a specific contract only, If not specified, all the limit orders will be deleted, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) ", + "description": "Current request page, The default currentPage is 1", "required": false, "schema": { - "type": "string" + "type": "integer" + } + }, + { + "name": "pageSize", + "in": "query", + "description": "pageSize, The default pageSize is 50, The maximum cannot exceed 1000", + "required": false, + "schema": { + "type": "integer", + "maximum": 1000, + "default": 50 } } ], @@ -2962,16 +2266,231 @@ "data": { "type": "object", "properties": { - "cancelledOrderIds": { + "currentPage": { + "type": "integer", + "description": "Current request page, The default currentPage is 1" + }, + "pageSize": { + "type": "integer", + "description": "pageSize, The default pageSize is 50, The maximum cannot exceed 1000" + }, + "totalNum": { + "type": "integer" + }, + "totalPage": { + "type": "integer" + }, + "items": { "type": "array", "items": { - "type": "string" - }, - "description": "Unique ID of the cancelled order" + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Order ID" + }, + "symbol": { + "type": "string", + "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) " + }, + "type": { + "type": "string", + "description": "Order type, market order or limit order\n" + }, + "side": { + "type": "string", + "description": "Transaction side" + }, + "price": { + "type": "string", + "description": "Order price" + }, + "size": { + "type": "integer", + "description": "Order quantity" + }, + "value": { + "type": "string", + "description": "Order value" + }, + "dealValue": { + "type": "string", + "description": "Executed size of funds\n" + }, + "dealSize": { + "type": "integer", + "description": "Executed quantity" + }, + "stp": { + "type": "string", + "description": "self trade prevention" + }, + "stop": { + "type": "string", + "description": "Stop order type (stop limit or stop market)" + }, + "stopPriceType": { + "type": "string", + "description": "Trigger price type of stop orders" + }, + "stopTriggered": { + "type": "boolean", + "description": "Mark to show whether the stop order is triggered" + }, + "stopPrice": { + "type": "string", + "description": "Trigger price of stop orders" + }, + "timeInForce": { + "type": "string", + "description": "Time in force policy type" + }, + "postOnly": { + "type": "boolean", + "description": "Mark of post only" + }, + "hidden": { + "type": "boolean", + "description": "Mark of the hidden order" + }, + "iceberg": { + "type": "boolean", + "description": "Mark of the iceberg order" + }, + "leverage": { + "type": "string", + "description": "Leverage of the order" + }, + "forceHold": { + "type": "boolean", + "description": "A mark to forcely hold the funds for an order" + }, + "closeOrder": { + "type": "boolean", + "description": "A mark to close the position" + }, + "visibleSize": { + "type": "integer", + "description": "Visible size of the iceberg order" + }, + "clientOid": { + "type": "string", + "description": "Unique order id created by users to identify their orders" + }, + "remark": { + "type": "string", + "description": "Remark of the order" + }, + "tags": { + "type": "string", + "description": "tag order source" + }, + "isActive": { + "type": "boolean", + "description": "Mark of the active orders" + }, + "cancelExist": { + "type": "boolean", + "description": "Mark of the canceled orders" + }, + "createdAt": { + "type": "integer", + "description": "Time the order created", + "format": "int64" + }, + "updatedAt": { + "type": "integer", + "description": "last update time", + "format": "int64" + }, + "endAt": { + "type": "integer", + "description": "End time", + "format": "int64" + }, + "orderTime": { + "type": "integer", + "description": "Order create time in nanosecond", + "format": "int64" + }, + "settleCurrency": { + "type": "string", + "description": "settlement currency" + }, + "marginMode": { + "type": "string", + "description": "Margin mode: ISOLATED (isolated), CROSS (cross margin)." + }, + "avgDealPrice": { + "type": "string", + "description": "Average transaction price, forward contract average transaction price = sum (transaction value) / sum (transaction quantity), reverse contract average transaction price = sum (transaction quantity) / sum (transaction value). Transaction quantity = lots * multiplier" + }, + "filledSize": { + "type": "integer", + "description": "Value of the executed orders" + }, + "filledValue": { + "type": "string", + "description": "Executed order quantity" + }, + "status": { + "type": "string", + "description": "order status: “open” or “done”" + }, + "reduceOnly": { + "type": "boolean", + "description": "A mark to reduce the position size only" + } + }, + "required": [ + "id", + "symbol", + "type", + "side", + "price", + "size", + "value", + "dealValue", + "dealSize", + "stp", + "stop", + "stopPriceType", + "stopTriggered", + "stopPrice", + "timeInForce", + "postOnly", + "hidden", + "iceberg", + "leverage", + "forceHold", + "closeOrder", + "visibleSize", + "clientOid", + "remark", + "tags", + "isActive", + "cancelExist", + "createdAt", + "updatedAt", + "endAt", + "orderTime", + "settleCurrency", + "marginMode", + "avgDealPrice", + "filledSize", + "filledValue", + "status", + "reduceOnly" + ] + } } }, "required": [ - "cancelledOrderIds" + "currentPage", + "pageSize", + "totalNum", + "totalPage", + "items" ] } }, @@ -2984,7 +2503,7 @@ } } }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470243", + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470247", "x-abandon": "normal", "x-domain": "Futures", "x-api-channel": "Private", @@ -2992,116 +2511,28 @@ "x-api-rate-limit-pool": "Futures", "x-sdk-service": "Futures", "x-sdk-sub-service": "Order", - "x-sdk-method-name": "cancelAllStopOrders", - "x-sdk-method-description": "Cancel all untriggered stop orders. The response is a list of orderIDs of the canceled stop orders. To cancel triggered stop orders, please use 'Cancel Multiple Futures Limit orders'.", - "x-api-rate-limit": 15, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"cancelledOrderIds\\\": [\\n \\\"235919172150824960\\\",\\n \\\"235919172150824961\\\"\\n ]\\n }\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDTM\\\"}" - }, + "x-sdk-method-name": "GetStopOrderList", + "x-sdk-method-description": "Get the un-triggered stop orders list. Stop orders that have been triggered can be queried through the general order interface", + "x-api-rate-limit": 6, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"currentPage\\\": 1,\\n \\\"pageSize\\\": 50,\\n \\\"totalNum\\\": 1,\\n \\\"totalPage\\\": 1,\\n \\\"items\\\": [\\n {\\n \\\"id\\\": \\\"230181737576050688\\\",\\n \\\"symbol\\\": \\\"PEOPLEUSDTM\\\",\\n \\\"type\\\": \\\"limit\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"price\\\": \\\"0.05\\\",\\n \\\"size\\\": 10,\\n \\\"value\\\": \\\"5\\\",\\n \\\"dealValue\\\": \\\"0\\\",\\n \\\"dealSize\\\": 0,\\n \\\"stp\\\": \\\"\\\",\\n \\\"stop\\\": \\\"\\\",\\n \\\"stopPriceType\\\": \\\"\\\",\\n \\\"stopTriggered\\\": false,\\n \\\"stopPrice\\\": null,\\n \\\"timeInForce\\\": \\\"GTC\\\",\\n \\\"postOnly\\\": false,\\n \\\"hidden\\\": false,\\n \\\"iceberg\\\": false,\\n \\\"leverage\\\": \\\"1\\\",\\n \\\"forceHold\\\": false,\\n \\\"closeOrder\\\": false,\\n \\\"visibleSize\\\": 0,\\n \\\"clientOid\\\": \\\"5a80bd847f1811ef8a7faa665a37b3d7\\\",\\n \\\"remark\\\": null,\\n \\\"tags\\\": \\\"\\\",\\n \\\"isActive\\\": true,\\n \\\"cancelExist\\\": false,\\n \\\"createdAt\\\": 1727692804813,\\n \\\"updatedAt\\\": 1727692804813,\\n \\\"endAt\\\": null,\\n \\\"orderTime\\\": 1727692804808418000,\\n \\\"settleCurrency\\\": \\\"USDT\\\",\\n \\\"marginMode\\\": \\\"ISOLATED\\\",\\n \\\"avgDealPrice\\\": \\\"0\\\",\\n \\\"filledSize\\\": 0,\\n \\\"filledValue\\\": \\\"0\\\",\\n \\\"status\\\": \\\"open\\\",\\n \\\"reduceOnly\\\": false\\n }\\n ]\\n }\\n}", + "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDTM\\\", \\\"side\\\": \\\"buy\\\", \\\"type\\\": \\\"limit\\\", \\\"startAt\\\": 123456, \\\"endAt\\\": 123456, \\\"currentPage\\\": 123456, \\\"pageSize\\\": 50}" + } + }, + "/api/v1/orders/{order-id}": { "get": { - "summary": "Get Stop Order List", + "summary": "Get Order By OrderId", "deprecated": false, - "description": "Get the un-triggered stop orders list. Stop orders that have been triggered can be queried through the general order interface", + "description": "Get a single order by order id (including a stop order).", "tags": [], "parameters": [ { - "name": "symbol", - "in": "query", - "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) ", - "required": false, + "name": "order-id", + "in": "path", + "description": "", + "required": true, "schema": { "type": "string" } - }, - { - "name": "side", - "in": "query", - "description": "buy or sell", - "required": false, - "schema": { - "type": "string", - "enum": [ - "buy", - "sell" - ], - "x-api-enum": [ - { - "value": "buy", - "name": "", - "description": "" - }, - { - "value": "sell", - "name": "", - "description": "" - } - ] - } - }, - { - "name": "type", - "in": "query", - "description": "limit, market", - "required": false, - "schema": { - "type": "string", - "enum": [ - "limit", - "market" - ], - "x-api-enum": [ - { - "value": "limit", - "name": "", - "description": "" - }, - { - "value": "market", - "name": "", - "description": "" - } - ] - } - }, - { - "name": "startAt", - "in": "query", - "description": "Start time (milisecond)", - "required": false, - "schema": { - "type": "integer", - "format": "int64" - } - }, - { - "name": "endAt", - "in": "query", - "description": "End time (milisecond)", - "required": false, - "schema": { - "type": "integer", - "format": "int64" - } - }, - { - "name": "currentPage", - "in": "query", - "description": "Current request page, The default currentPage is 1", - "required": false, - "schema": { - "type": "integer" - } - }, - { - "name": "pageSize", - "in": "query", - "description": "pageSize, The default pageSize is 50, The maximum cannot exceed 1000", - "required": false, - "schema": { - "type": "integer", - "maximum": 1000, - "default": 50 - } } ], "responses": { @@ -3118,231 +2549,321 @@ "data": { "type": "object", "properties": { - "currentPage": { + "id": { + "type": "string", + "description": "Order ID" + }, + "symbol": { + "type": "string", + "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) " + }, + "type": { + "type": "string", + "description": "Order type, market order or limit order", + "enum": [ + "market", + "limit" + ], + "x-api-enum": [ + { + "value": "market", + "name": "market", + "description": "Market Order" + }, + { + "value": "limit", + "name": "limit", + "description": "Limit Order" + } + ] + }, + "side": { + "type": "string", + "description": "Transaction side", + "enum": [ + "buy", + "sell" + ], + "x-api-enum": [ + { + "value": "buy", + "name": "buy", + "description": "buy" + }, + { + "value": "sell", + "name": "sell", + "description": "sell" + } + ] + }, + "price": { + "type": "string", + "description": "Order price" + }, + "size": { + "type": "integer", + "description": "Order quantity" + }, + "value": { + "type": "string", + "description": "Order value\n" + }, + "dealValue": { + "type": "string", + "description": "Executed size of funds\n" + }, + "dealSize": { + "type": "integer", + "description": "Executed quantity\n" + }, + "stp": { + "type": "string", + "description": "[Self Trade Prevention](https://www.kucoin.com/docs-new/doc-338146) is divided into these strategies: CN, CO, CB. Not supported DC at the moment.", + "enum": [ + "", + "CN", + "CO", + "CB" + ], + "x-api-enum": [ + { + "value": "", + "name": "NULL", + "description": "Null means not stp order" + }, + { + "value": "CN", + "name": "CN", + "description": "Cancel new, Cancel the new order" + }, + { + "value": "CO", + "name": "CO", + "description": "Cancel old, Cancel the old order" + }, + { + "value": "CB", + "name": "CB", + "description": "Cancel both, Cancel both sides" + } + ] + }, + "stop": { + "type": "string", + "description": "Stop order type (stop limit or stop market)\n" + }, + "stopPriceType": { + "type": "string", + "description": "Trigger price type of stop orders", + "enum": [ + "", + "TP", + "MP", + "IP" + ], + "x-api-enum": [ + { + "value": "", + "name": "NULL", + "description": "" + }, + { + "value": "TP", + "name": "trade price", + "description": "TP for trade price, The last trade price is the last price at which an order was filled. This price can be found in the latest match message." + }, + { + "value": "MP", + "name": "mark price", + "description": "MP for mark price, The mark price can be obtained through relevant OPEN API for index services" + }, + { + "value": "IP", + "name": "index price", + "description": "IP for index price, The index price can be obtained through relevant OPEN API for index services" + } + ] + }, + "stopTriggered": { + "type": "boolean", + "description": "Mark to show whether the stop order is triggered" + }, + "stopPrice": { + "type": "number", + "description": "Trigger price of stop orders" + }, + "timeInForce": { + "type": "string", + "description": "Time in force policy type\n" + }, + "postOnly": { + "type": "boolean", + "description": "Mark of post only\n" + }, + "hidden": { + "type": "boolean", + "description": "Mark of the hidden order\n" + }, + "iceberg": { + "type": "boolean", + "description": "Mark of the iceberg order\n" + }, + "leverage": { + "type": "string", + "description": "Leverage of the order\n" + }, + "forceHold": { + "type": "boolean", + "description": "A mark to forcely hold the funds for an order\n" + }, + "closeOrder": { + "type": "boolean", + "description": "A mark to close the position\n" + }, + "visibleSize": { "type": "integer", - "description": "Current request page, The default currentPage is 1" + "description": "Visible size of the iceberg order\n" }, - "pageSize": { + "clientOid": { + "type": "string", + "description": "Unique order id created by users to identify their orders\n" + }, + "remark": { + "type": "string", + "description": "Remark" + }, + "tags": { + "type": "string", + "description": "tag order source\n" + }, + "isActive": { + "type": "boolean", + "description": "Mark of the active orders\n" + }, + "cancelExist": { + "type": "boolean", + "description": "Mark of the canceled orders\n" + }, + "createdAt": { "type": "integer", - "description": "pageSize, The default pageSize is 50, The maximum cannot exceed 1000" + "description": "Time the order created\n", + "format": "int64" }, - "totalNum": { - "type": "integer" + "updatedAt": { + "type": "integer", + "description": "last update time\n", + "format": "int64" }, - "totalPage": { - "type": "integer" + "endAt": { + "type": "integer", + "description": "Order Endtime", + "format": "int64" }, - "items": { - "type": "array", - "items": { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "Order ID" - }, - "symbol": { - "type": "string", - "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) " - }, - "type": { - "type": "string", - "description": "Order type, market order or limit order\n" - }, - "side": { - "type": "string", - "description": "Transaction side" - }, - "price": { - "type": "string", - "description": "Order price" - }, - "size": { - "type": "integer", - "description": "Order quantity" - }, - "value": { - "type": "string", - "description": "Order value" - }, - "dealValue": { - "type": "string", - "description": "Executed size of funds\n" - }, - "dealSize": { - "type": "integer", - "description": "Executed quantity" - }, - "stp": { - "type": "string", - "description": "self trade prevention" - }, - "stop": { - "type": "string", - "description": "Stop order type (stop limit or stop market)" - }, - "stopPriceType": { - "type": "string", - "description": "Trigger price type of stop orders" - }, - "stopTriggered": { - "type": "boolean", - "description": "Mark to show whether the stop order is triggered" - }, - "stopPrice": { - "type": "string", - "description": "Trigger price of stop orders" - }, - "timeInForce": { - "type": "string", - "description": "Time in force policy type" - }, - "postOnly": { - "type": "boolean", - "description": "Mark of post only" - }, - "hidden": { - "type": "boolean", - "description": "Mark of the hidden order" - }, - "iceberg": { - "type": "boolean", - "description": "Mark of the iceberg order" - }, - "leverage": { - "type": "string", - "description": "Leverage of the order" - }, - "forceHold": { - "type": "boolean", - "description": "A mark to forcely hold the funds for an order" - }, - "closeOrder": { - "type": "boolean", - "description": "A mark to close the position" - }, - "visibleSize": { - "type": "integer", - "description": "Visible size of the iceberg order" - }, - "clientOid": { - "type": "string", - "description": "Unique order id created by users to identify their orders" - }, - "remark": { - "type": "string", - "description": "Remark of the order" - }, - "tags": { - "type": "string", - "description": "tag order source" - }, - "isActive": { - "type": "boolean", - "description": "Mark of the active orders" - }, - "cancelExist": { - "type": "boolean", - "description": "Mark of the canceled orders" - }, - "createdAt": { - "type": "integer", - "description": "Time the order created", - "format": "int64" - }, - "updatedAt": { - "type": "integer", - "description": "last update time", - "format": "int64" - }, - "endAt": { - "type": "integer", - "description": "End time", - "format": "int64" - }, - "orderTime": { - "type": "integer", - "description": "Order create time in nanosecond", - "format": "int64" - }, - "settleCurrency": { - "type": "string", - "description": "settlement currency" - }, - "marginMode": { - "type": "string", - "description": "Margin mode: ISOLATED (isolated), CROSS (cross margin)." - }, - "avgDealPrice": { - "type": "string", - "description": "Average transaction price, forward contract average transaction price = sum (transaction value) / sum (transaction quantity), reverse contract average transaction price = sum (transaction quantity) / sum (transaction value). Transaction quantity = lots * multiplier" - }, - "filledSize": { - "type": "integer", - "description": "Value of the executed orders" - }, - "filledValue": { - "type": "string", - "description": "Executed order quantity" - }, - "status": { - "type": "string", - "description": "order status: “open” or “done”" - }, - "reduceOnly": { - "type": "boolean", - "description": "A mark to reduce the position size only" - } + "orderTime": { + "type": "integer", + "description": "Order create time in nanosecond\n", + "format": "int64" + }, + "settleCurrency": { + "type": "string", + "description": "settlement currency\n" + }, + "marginMode": { + "type": "string", + "description": "Margin mode: ISOLATED (isolated), CROSS (cross margin).\n", + "enum": [ + "CROSS", + "ISOLATED" + ], + "x-api-enum": [ + { + "value": "CROSS", + "name": "CROSS", + "description": "Cross margin" + }, + { + "value": "ISOLATED", + "name": "ISOLATED", + "description": "Isolated margin" + } + ] + }, + "avgDealPrice": { + "type": "string", + "description": "Average transaction price, forward contract average transaction price = sum (transaction value) / sum (transaction quantity), reverse contract average transaction price = sum (transaction quantity) / sum (transaction value). Transaction quantity = lots * multiplier\n" + }, + "filledSize": { + "type": "integer", + "description": "Value of the executed orders\n" + }, + "filledValue": { + "type": "string", + "description": "Executed order quantity\n" + }, + "status": { + "type": "string", + "description": "order status: “open” or “done”\n", + "enum": [ + "open", + "done" + ], + "x-api-enum": [ + { + "value": "open", + "name": "open", + "description": "open order" }, - "required": [ - "id", - "symbol", - "type", - "side", - "price", - "size", - "value", - "dealValue", - "dealSize", - "stp", - "stop", - "stopPriceType", - "stopTriggered", - "stopPrice", - "timeInForce", - "postOnly", - "hidden", - "iceberg", - "leverage", - "forceHold", - "closeOrder", - "visibleSize", - "clientOid", - "remark", - "tags", - "isActive", - "cancelExist", - "createdAt", - "updatedAt", - "endAt", - "orderTime", - "settleCurrency", - "marginMode", - "avgDealPrice", - "filledSize", - "filledValue", - "status", - "reduceOnly" - ] - } + { + "value": "done", + "name": "done", + "description": "done order" + } + ] + }, + "reduceOnly": { + "type": "boolean", + "description": "A mark to reduce the position size only\n" } }, "required": [ - "currentPage", - "pageSize", - "totalNum", - "totalPage", - "items" + "id", + "symbol", + "type", + "side", + "price", + "size", + "value", + "dealValue", + "dealSize", + "stp", + "stop", + "stopPriceType", + "stopTriggered", + "stopPrice", + "timeInForce", + "postOnly", + "hidden", + "iceberg", + "leverage", + "forceHold", + "closeOrder", + "visibleSize", + "clientOid", + "remark", + "tags", + "isActive", + "cancelExist", + "createdAt", + "updatedAt", + "orderTime", + "settleCurrency", + "marginMode", + "avgDealPrice", + "filledSize", + "filledValue", + "status", + "reduceOnly" ] } }, @@ -3355,33 +2876,33 @@ } } }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470247", + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470245", "x-abandon": "normal", "x-domain": "Futures", "x-api-channel": "Private", - "x-api-permission": "Futures", + "x-api-permission": "General", "x-api-rate-limit-pool": "Futures", "x-sdk-service": "Futures", "x-sdk-sub-service": "Order", - "x-sdk-method-name": "GetStopOrderList", - "x-sdk-method-description": "Get the un-triggered stop orders list. Stop orders that have been triggered can be queried through the general order interface", - "x-api-rate-limit": 6, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"currentPage\\\": 1,\\n \\\"pageSize\\\": 50,\\n \\\"totalNum\\\": 1,\\n \\\"totalPage\\\": 1,\\n \\\"items\\\": [\\n {\\n \\\"id\\\": \\\"230181737576050688\\\",\\n \\\"symbol\\\": \\\"PEOPLEUSDTM\\\",\\n \\\"type\\\": \\\"limit\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"price\\\": \\\"0.05\\\",\\n \\\"size\\\": 10,\\n \\\"value\\\": \\\"5\\\",\\n \\\"dealValue\\\": \\\"0\\\",\\n \\\"dealSize\\\": 0,\\n \\\"stp\\\": \\\"\\\",\\n \\\"stop\\\": \\\"\\\",\\n \\\"stopPriceType\\\": \\\"\\\",\\n \\\"stopTriggered\\\": false,\\n \\\"stopPrice\\\": null,\\n \\\"timeInForce\\\": \\\"GTC\\\",\\n \\\"postOnly\\\": false,\\n \\\"hidden\\\": false,\\n \\\"iceberg\\\": false,\\n \\\"leverage\\\": \\\"1\\\",\\n \\\"forceHold\\\": false,\\n \\\"closeOrder\\\": false,\\n \\\"visibleSize\\\": 0,\\n \\\"clientOid\\\": \\\"5a80bd847f1811ef8a7faa665a37b3d7\\\",\\n \\\"remark\\\": null,\\n \\\"tags\\\": \\\"\\\",\\n \\\"isActive\\\": true,\\n \\\"cancelExist\\\": false,\\n \\\"createdAt\\\": 1727692804813,\\n \\\"updatedAt\\\": 1727692804813,\\n \\\"endAt\\\": null,\\n \\\"orderTime\\\": 1727692804808418000,\\n \\\"settleCurrency\\\": \\\"USDT\\\",\\n \\\"marginMode\\\": \\\"ISOLATED\\\",\\n \\\"avgDealPrice\\\": \\\"0\\\",\\n \\\"filledSize\\\": 0,\\n \\\"filledValue\\\": \\\"0\\\",\\n \\\"status\\\": \\\"open\\\",\\n \\\"reduceOnly\\\": false\\n }\\n ]\\n }\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDTM\\\", \\\"side\\\": \\\"buy\\\", \\\"type\\\": \\\"limit\\\", \\\"startAt\\\": 123456, \\\"endAt\\\": 123456, \\\"currentPage\\\": 123456, \\\"pageSize\\\": 50}" + "x-sdk-method-name": "getOrderByOrderId", + "x-sdk-method-description": "Get a single order by order id (including a stop order).", + "x-api-rate-limit": 5, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"id\\\": \\\"236655147005071361\\\",\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"type\\\": \\\"limit\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"price\\\": \\\"0.1\\\",\\n \\\"size\\\": 1,\\n \\\"value\\\": \\\"0.0001\\\",\\n \\\"dealValue\\\": \\\"0\\\",\\n \\\"dealSize\\\": 0,\\n \\\"stp\\\": \\\"\\\",\\n \\\"stop\\\": \\\"\\\",\\n \\\"stopPriceType\\\": \\\"\\\",\\n \\\"stopTriggered\\\": false,\\n \\\"stopPrice\\\": null,\\n \\\"timeInForce\\\": \\\"GTC\\\",\\n \\\"postOnly\\\": false,\\n \\\"hidden\\\": false,\\n \\\"iceberg\\\": false,\\n \\\"leverage\\\": \\\"3\\\",\\n \\\"forceHold\\\": false,\\n \\\"closeOrder\\\": false,\\n \\\"visibleSize\\\": 0,\\n \\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\",\\n \\\"remark\\\": null,\\n \\\"tags\\\": \\\"\\\",\\n \\\"isActive\\\": true,\\n \\\"cancelExist\\\": false,\\n \\\"createdAt\\\": 1729236185949,\\n \\\"updatedAt\\\": 1729236185949,\\n \\\"endAt\\\": null,\\n \\\"orderTime\\\": 1729236185885647952,\\n \\\"settleCurrency\\\": \\\"USDT\\\",\\n \\\"marginMode\\\": \\\"ISOLATED\\\",\\n \\\"avgDealPrice\\\": \\\"0\\\",\\n \\\"filledSize\\\": 0,\\n \\\"filledValue\\\": \\\"0\\\",\\n \\\"status\\\": \\\"open\\\",\\n \\\"reduceOnly\\\": false\\n }\\n}", + "x-request-example": "{\\\"order-id\\\": \\\"236655147005071361\\\"}" } }, - "/api/v1/orders/{order-id}": { + "/api/v1/orders/byClientOid": { "get": { - "summary": "Get Order By OrderId", + "summary": "Get Order By ClientOid", "deprecated": false, - "description": "Get a single order by order id (including a stop order).", + "description": "Get a single order by client order id (including a stop order).", "tags": [], "parameters": [ { - "name": "order-id", - "in": "path", - "description": "", - "required": true, + "name": "clientOid", + "in": "query", + "description": "The user self-defined order id.", + "required": false, "schema": { "type": "string" } @@ -3482,7 +3003,7 @@ { "value": "", "name": "NULL", - "description": "Null means not stp order" + "description": "None" }, { "value": "CN", @@ -3518,7 +3039,7 @@ { "value": "", "name": "NULL", - "description": "" + "description": "None" }, { "value": "TP", @@ -3673,50 +3194,308 @@ } ] }, - "reduceOnly": { - "type": "boolean", - "description": "A mark to reduce the position size only\n" - } - }, - "required": [ - "id", - "symbol", - "type", - "side", - "price", - "size", - "value", - "dealValue", - "dealSize", - "stp", - "stop", - "stopPriceType", - "stopTriggered", - "stopPrice", - "timeInForce", - "postOnly", - "hidden", - "iceberg", - "leverage", - "forceHold", - "closeOrder", - "visibleSize", - "clientOid", - "remark", - "tags", - "isActive", - "cancelExist", - "createdAt", - "updatedAt", - "orderTime", - "settleCurrency", - "marginMode", - "avgDealPrice", - "filledSize", - "filledValue", - "status", - "reduceOnly" - ] + "reduceOnly": { + "type": "boolean", + "description": "A mark to reduce the position size only\n" + } + }, + "required": [ + "id", + "symbol", + "type", + "side", + "price", + "size", + "value", + "dealValue", + "dealSize", + "stp", + "stop", + "stopPriceType", + "stopTriggered", + "stopPrice", + "timeInForce", + "postOnly", + "hidden", + "iceberg", + "leverage", + "forceHold", + "closeOrder", + "visibleSize", + "clientOid", + "remark", + "tags", + "isActive", + "cancelExist", + "createdAt", + "updatedAt", + "endAt", + "orderTime", + "settleCurrency", + "marginMode", + "avgDealPrice", + "filledSize", + "filledValue", + "status", + "reduceOnly" + ] + } + }, + "required": [ + "code", + "data" + ] + } + } + } + } + }, + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470352", + "x-abandon": "normal", + "x-domain": "Futures", + "x-api-channel": "Private", + "x-api-permission": "General", + "x-api-rate-limit-pool": "Futures", + "x-sdk-service": "Futures", + "x-sdk-sub-service": "Order", + "x-sdk-method-name": "getOrderByClientOid", + "x-sdk-method-description": "Get a single order by client order id (including a stop order).", + "x-api-rate-limit": 5, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"id\\\": \\\"250444645610336256\\\",\\n \\\"symbol\\\": \\\"XRPUSDTM\\\",\\n \\\"type\\\": \\\"limit\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"price\\\": \\\"0.1\\\",\\n \\\"size\\\": 1,\\n \\\"value\\\": \\\"1\\\",\\n \\\"dealValue\\\": \\\"0\\\",\\n \\\"dealSize\\\": 0,\\n \\\"stp\\\": \\\"\\\",\\n \\\"stop\\\": \\\"\\\",\\n \\\"stopPriceType\\\": \\\"\\\",\\n \\\"stopTriggered\\\": false,\\n \\\"stopPrice\\\": null,\\n \\\"timeInForce\\\": \\\"GTC\\\",\\n \\\"postOnly\\\": false,\\n \\\"hidden\\\": false,\\n \\\"iceberg\\\": false,\\n \\\"leverage\\\": \\\"3\\\",\\n \\\"forceHold\\\": false,\\n \\\"closeOrder\\\": false,\\n \\\"visibleSize\\\": 0,\\n \\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\",\\n \\\"remark\\\": null,\\n \\\"tags\\\": \\\"\\\",\\n \\\"isActive\\\": true,\\n \\\"cancelExist\\\": false,\\n \\\"createdAt\\\": 1732523858568,\\n \\\"updatedAt\\\": 1732523858568,\\n \\\"endAt\\\": null,\\n \\\"orderTime\\\": 1732523858550892322,\\n \\\"settleCurrency\\\": \\\"USDT\\\",\\n \\\"marginMode\\\": \\\"ISOLATED\\\",\\n \\\"avgDealPrice\\\": \\\"0\\\",\\n \\\"filledSize\\\": 0,\\n \\\"filledValue\\\": \\\"0\\\",\\n \\\"status\\\": \\\"open\\\",\\n \\\"reduceOnly\\\": false\\n }\\n}", + "x-request-example": "{\\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\"}" + } + }, + "/api/v1/recentDoneOrders": { + "get": { + "summary": "Get Recent Closed Orders", + "deprecated": false, + "description": "Get a list of recent 1000 closed orders in the last 24 hours. If you need to get your recent traded order history with low latency, you may query this endpoint.", + "tags": [], + "parameters": [ + { + "name": "symbol", + "in": "query", + "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) ", + "required": false, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Order ID" + }, + "symbol": { + "type": "string", + "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) " + }, + "type": { + "type": "string", + "description": "Order type, market order or limit order" + }, + "side": { + "type": "string", + "description": "Transaction side" + }, + "price": { + "type": "string", + "description": "Order price" + }, + "size": { + "type": "integer", + "description": "Order quantity" + }, + "value": { + "type": "string", + "description": "Order value\n" + }, + "dealValue": { + "type": "string", + "description": "Executed size of funds\n" + }, + "dealSize": { + "type": "integer", + "description": "Executed quantity\n" + }, + "stp": { + "type": "string", + "description": "self trade prevention" + }, + "stop": { + "type": "string", + "description": "Stop order type (stop limit or stop market)\n" + }, + "stopPriceType": { + "type": "string", + "description": "Trigger price type of stop orders\n" + }, + "stopTriggered": { + "type": "boolean", + "description": "Mark to show whether the stop order is triggered" + }, + "stopPrice": { + "type": "integer", + "description": "Trigger price of stop orders\n" + }, + "timeInForce": { + "type": "string", + "description": "Time in force policy type\n" + }, + "postOnly": { + "type": "boolean", + "description": "Mark of post only\n" + }, + "hidden": { + "type": "boolean", + "description": "Mark of the hidden order\n" + }, + "iceberg": { + "type": "boolean", + "description": "Mark of the iceberg order\n" + }, + "leverage": { + "type": "string", + "description": "Leverage of the order\n" + }, + "forceHold": { + "type": "boolean", + "description": "A mark to forcely hold the funds for an order\n" + }, + "closeOrder": { + "type": "boolean", + "description": "A mark to close the position\n" + }, + "visibleSize": { + "type": "integer", + "description": "Visible size of the iceberg order\n" + }, + "clientOid": { + "type": "string", + "description": "Unique order id created by users to identify their orders\n" + }, + "remark": { + "type": "string", + "description": "Remark of the order\n" + }, + "tags": { + "type": "string", + "description": "tag order source\n" + }, + "isActive": { + "type": "boolean", + "description": "Mark of the active orders\n" + }, + "cancelExist": { + "type": "boolean", + "description": "Mark of the canceled orders\n" + }, + "createdAt": { + "type": "integer", + "description": "Time the order created\n", + "format": "int64" + }, + "updatedAt": { + "type": "integer", + "description": "last update time\n", + "format": "int64" + }, + "endAt": { + "type": "integer", + "description": "End time\n", + "format": "int64" + }, + "orderTime": { + "type": "integer", + "description": "Order create time in nanosecond\n", + "format": "int64" + }, + "settleCurrency": { + "type": "string", + "description": "settlement currency\n" + }, + "marginMode": { + "type": "string", + "description": "Margin mode: ISOLATED (isolated), CROSS (cross margin).\n" + }, + "avgDealPrice": { + "type": "string", + "description": "Average transaction price, forward contract average transaction price = sum (transaction value) / sum (transaction quantity), reverse contract average transaction price = sum (transaction quantity) / sum (transaction value). Transaction quantity = lots * multiplier\n" + }, + "filledSize": { + "type": "integer", + "description": "Value of the executed orders\n" + }, + "filledValue": { + "type": "string", + "description": "Executed order quantity\n" + }, + "status": { + "type": "string", + "description": "order status: “open” or “done”\n" + }, + "reduceOnly": { + "type": "boolean", + "description": "A mark to reduce the position size only\n" + } + }, + "required": [ + "id", + "symbol", + "type", + "side", + "price", + "size", + "value", + "dealValue", + "dealSize", + "stp", + "stop", + "stopPriceType", + "stopTriggered", + "stopPrice", + "timeInForce", + "postOnly", + "hidden", + "iceberg", + "leverage", + "forceHold", + "closeOrder", + "visibleSize", + "clientOid", + "remark", + "tags", + "isActive", + "cancelExist", + "createdAt", + "updatedAt", + "endAt", + "orderTime", + "settleCurrency", + "marginMode", + "avgDealPrice", + "filledSize", + "filledValue", + "status", + "reduceOnly" + ] + } } }, "required": [ @@ -3728,33 +3507,33 @@ } } }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470245", + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470246", "x-abandon": "normal", "x-domain": "Futures", "x-api-channel": "Private", - "x-api-permission": "General", + "x-api-permission": "Futures", "x-api-rate-limit-pool": "Futures", "x-sdk-service": "Futures", "x-sdk-sub-service": "Order", - "x-sdk-method-name": "getOrderByOrderId", - "x-sdk-method-description": "Get a single order by order id (including a stop order).", + "x-sdk-method-name": "GetRecentClosedOrders", + "x-sdk-method-description": "Get a list of recent 1000 closed orders in the last 24 hours. If you need to get your recent traded order history with low latency, you may query this endpoint.", "x-api-rate-limit": 5, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"id\\\": \\\"236655147005071361\\\",\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"type\\\": \\\"limit\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"price\\\": \\\"0.1\\\",\\n \\\"size\\\": 1,\\n \\\"value\\\": \\\"0.0001\\\",\\n \\\"dealValue\\\": \\\"0\\\",\\n \\\"dealSize\\\": 0,\\n \\\"stp\\\": \\\"\\\",\\n \\\"stop\\\": \\\"\\\",\\n \\\"stopPriceType\\\": \\\"\\\",\\n \\\"stopTriggered\\\": false,\\n \\\"stopPrice\\\": null,\\n \\\"timeInForce\\\": \\\"GTC\\\",\\n \\\"postOnly\\\": false,\\n \\\"hidden\\\": false,\\n \\\"iceberg\\\": false,\\n \\\"leverage\\\": \\\"3\\\",\\n \\\"forceHold\\\": false,\\n \\\"closeOrder\\\": false,\\n \\\"visibleSize\\\": 0,\\n \\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\",\\n \\\"remark\\\": null,\\n \\\"tags\\\": \\\"\\\",\\n \\\"isActive\\\": true,\\n \\\"cancelExist\\\": false,\\n \\\"createdAt\\\": 1729236185949,\\n \\\"updatedAt\\\": 1729236185949,\\n \\\"endAt\\\": null,\\n \\\"orderTime\\\": 1729236185885647952,\\n \\\"settleCurrency\\\": \\\"USDT\\\",\\n \\\"marginMode\\\": \\\"ISOLATED\\\",\\n \\\"avgDealPrice\\\": \\\"0\\\",\\n \\\"filledSize\\\": 0,\\n \\\"filledValue\\\": \\\"0\\\",\\n \\\"status\\\": \\\"open\\\",\\n \\\"reduceOnly\\\": false\\n }\\n}", - "x-request-example": "{\\\"order-id\\\": \\\"236655147005071361\\\"}" + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": [\\n {\\n \\\"id\\\": \\\"236387137732231168\\\",\\n \\\"symbol\\\": \\\"XRPUSDTM\\\",\\n \\\"type\\\": \\\"market\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"price\\\": \\\"0\\\",\\n \\\"size\\\": 1,\\n \\\"value\\\": \\\"5.51\\\",\\n \\\"dealValue\\\": \\\"5.511\\\",\\n \\\"dealSize\\\": 1,\\n \\\"stp\\\": \\\"\\\",\\n \\\"stop\\\": \\\"\\\",\\n \\\"stopPriceType\\\": \\\"\\\",\\n \\\"stopTriggered\\\": false,\\n \\\"stopPrice\\\": null,\\n \\\"timeInForce\\\": \\\"GTC\\\",\\n \\\"postOnly\\\": false,\\n \\\"hidden\\\": false,\\n \\\"iceberg\\\": false,\\n \\\"leverage\\\": \\\"10.0\\\",\\n \\\"forceHold\\\": false,\\n \\\"closeOrder\\\": false,\\n \\\"visibleSize\\\": 0,\\n \\\"clientOid\\\": \\\"16698fe6-2746-4aeb-a7fa-61f633ab6090\\\",\\n \\\"remark\\\": null,\\n \\\"tags\\\": \\\"\\\",\\n \\\"isActive\\\": false,\\n \\\"cancelExist\\\": false,\\n \\\"createdAt\\\": 1729172287496,\\n \\\"updatedAt\\\": 1729172287568,\\n \\\"endAt\\\": 1729172287568,\\n \\\"orderTime\\\": 1729172287496950800,\\n \\\"settleCurrency\\\": \\\"USDT\\\",\\n \\\"marginMode\\\": \\\"ISOLATED\\\",\\n \\\"avgDealPrice\\\": \\\"0.5511\\\",\\n \\\"filledSize\\\": 1,\\n \\\"filledValue\\\": \\\"5.511\\\",\\n \\\"status\\\": \\\"done\\\",\\n \\\"reduceOnly\\\": false\\n },\\n {\\n \\\"id\\\": \\\"236317213710184449\\\",\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"type\\\": \\\"market\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"price\\\": \\\"0\\\",\\n \\\"size\\\": 1,\\n \\\"value\\\": \\\"67.4309\\\",\\n \\\"dealValue\\\": \\\"67.4309\\\",\\n \\\"dealSize\\\": 1,\\n \\\"stp\\\": \\\"\\\",\\n \\\"stop\\\": \\\"\\\",\\n \\\"stopPriceType\\\": \\\"\\\",\\n \\\"stopTriggered\\\": false,\\n \\\"stopPrice\\\": null,\\n \\\"timeInForce\\\": \\\"GTC\\\",\\n \\\"postOnly\\\": false,\\n \\\"hidden\\\": false,\\n \\\"iceberg\\\": false,\\n \\\"leverage\\\": \\\"3\\\",\\n \\\"forceHold\\\": false,\\n \\\"closeOrder\\\": false,\\n \\\"visibleSize\\\": 0,\\n \\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\",\\n \\\"remark\\\": null,\\n \\\"tags\\\": \\\"\\\",\\n \\\"isActive\\\": false,\\n \\\"cancelExist\\\": false,\\n \\\"createdAt\\\": 1729155616310,\\n \\\"updatedAt\\\": 1729155616324,\\n \\\"endAt\\\": 1729155616324,\\n \\\"orderTime\\\": 1729155616310180400,\\n \\\"settleCurrency\\\": \\\"USDT\\\",\\n \\\"marginMode\\\": \\\"ISOLATED\\\",\\n \\\"avgDealPrice\\\": \\\"67430.9\\\",\\n \\\"filledSize\\\": 1,\\n \\\"filledValue\\\": \\\"67.4309\\\",\\n \\\"status\\\": \\\"done\\\",\\n \\\"reduceOnly\\\": false\\n },\\n {\\n \\\"id\\\": \\\"236317094436728832\\\",\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"type\\\": \\\"market\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"price\\\": \\\"0\\\",\\n \\\"size\\\": 1,\\n \\\"value\\\": \\\"67.445\\\",\\n \\\"dealValue\\\": \\\"67.445\\\",\\n \\\"dealSize\\\": 1,\\n \\\"stp\\\": \\\"\\\",\\n \\\"stop\\\": \\\"\\\",\\n \\\"stopPriceType\\\": \\\"\\\",\\n \\\"stopTriggered\\\": false,\\n \\\"stopPrice\\\": null,\\n \\\"timeInForce\\\": \\\"GTC\\\",\\n \\\"postOnly\\\": false,\\n \\\"hidden\\\": false,\\n \\\"iceberg\\\": false,\\n \\\"leverage\\\": \\\"3\\\",\\n \\\"forceHold\\\": false,\\n \\\"closeOrder\\\": false,\\n \\\"visibleSize\\\": 0,\\n \\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\",\\n \\\"remark\\\": null,\\n \\\"tags\\\": \\\"\\\",\\n \\\"isActive\\\": false,\\n \\\"cancelExist\\\": false,\\n \\\"createdAt\\\": 1729155587873,\\n \\\"updatedAt\\\": 1729155587946,\\n \\\"endAt\\\": 1729155587946,\\n \\\"orderTime\\\": 1729155587873332000,\\n \\\"settleCurrency\\\": \\\"USDT\\\",\\n \\\"marginMode\\\": \\\"ISOLATED\\\",\\n \\\"avgDealPrice\\\": \\\"67445.0\\\",\\n \\\"filledSize\\\": 1,\\n \\\"filledValue\\\": \\\"67.445\\\",\\n \\\"status\\\": \\\"done\\\",\\n \\\"reduceOnly\\\": false\\n }\\n ]\\n}", + "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDTM\\\"}" } }, - "/api/v1/orders/byClientOid": { + "/api/v1/openOrderStatistics": { "get": { - "summary": "Get Order By ClientOid", + "summary": "Get Open Order Value", "deprecated": false, - "description": "Get a single order by client order id (including a stop order).", + "description": "You can query this endpoint to get the the total number and value of the all your active orders.", "tags": [], "parameters": [ { - "name": "clientOid", + "name": "symbol", "in": "query", - "description": "The user self-defined order id.", - "required": false, + "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) ", + "required": true, "schema": { "type": "string" } @@ -3774,323 +3553,345 @@ "data": { "type": "object", "properties": { - "id": { - "type": "string", - "description": "Order ID" - }, - "symbol": { - "type": "string", - "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) " - }, - "type": { - "type": "string", - "description": "Order type, market order or limit order", - "enum": [ - "market", - "limit" - ], - "x-api-enum": [ - { - "value": "market", - "name": "market", - "description": "Market Order" - }, - { - "value": "limit", - "name": "limit", - "description": "Limit Order" - } - ] - }, - "side": { - "type": "string", - "description": "Transaction side", - "enum": [ - "buy", - "sell" - ], - "x-api-enum": [ - { - "value": "buy", - "name": "buy", - "description": "buy" - }, - { - "value": "sell", - "name": "sell", - "description": "sell" - } - ] - }, - "price": { - "type": "string", - "description": "Order price" - }, - "size": { - "type": "integer", - "description": "Order quantity" - }, - "value": { - "type": "string", - "description": "Order value\n" - }, - "dealValue": { - "type": "string", - "description": "Executed size of funds\n" - }, - "dealSize": { - "type": "integer", - "description": "Executed quantity\n" - }, - "stp": { - "type": "string", - "description": "[Self Trade Prevention](https://www.kucoin.com/docs-new/doc-338146) is divided into these strategies: CN, CO, CB. Not supported DC at the moment.", - "enum": [ - "", - "CN", - "CO", - "CB" - ], - "x-api-enum": [ - { - "value": "", - "name": "NULL", - "description": "None" - }, - { - "value": "CN", - "name": "CN", - "description": "Cancel new, Cancel the new order" - }, - { - "value": "CO", - "name": "CO", - "description": "Cancel old, Cancel the old order" - }, - { - "value": "CB", - "name": "CB", - "description": "Cancel both, Cancel both sides" - } - ] - }, - "stop": { - "type": "string", - "description": "Stop order type (stop limit or stop market)\n" - }, - "stopPriceType": { - "type": "string", - "description": "Trigger price type of stop orders", - "enum": [ - "", - "TP", - "MP", - "IP" - ], - "x-api-enum": [ - { - "value": "", - "name": "NULL", - "description": "None" - }, - { - "value": "TP", - "name": "trade price", - "description": "TP for trade price, The last trade price is the last price at which an order was filled. This price can be found in the latest match message." - }, - { - "value": "MP", - "name": "mark price", - "description": "MP for mark price, The mark price can be obtained through relevant OPEN API for index services" - }, - { - "value": "IP", - "name": "index price", - "description": "IP for index price, The index price can be obtained through relevant OPEN API for index services" - } - ] - }, - "stopTriggered": { - "type": "boolean", - "description": "Mark to show whether the stop order is triggered" - }, - "stopPrice": { - "type": "number", - "description": "Trigger price of stop orders" - }, - "timeInForce": { - "type": "string", - "description": "Time in force policy type\n" - }, - "postOnly": { - "type": "boolean", - "description": "Mark of post only\n" - }, - "hidden": { - "type": "boolean", - "description": "Mark of the hidden order\n" - }, - "iceberg": { - "type": "boolean", - "description": "Mark of the iceberg order\n" - }, - "leverage": { - "type": "string", - "description": "Leverage of the order\n" - }, - "forceHold": { - "type": "boolean", - "description": "A mark to forcely hold the funds for an order\n" - }, - "closeOrder": { - "type": "boolean", - "description": "A mark to close the position\n" - }, - "visibleSize": { - "type": "integer", - "description": "Visible size of the iceberg order\n" - }, - "clientOid": { - "type": "string", - "description": "Unique order id created by users to identify their orders\n" - }, - "remark": { - "type": "string", - "description": "Remark" - }, - "tags": { - "type": "string", - "description": "tag order source\n" - }, - "isActive": { - "type": "boolean", - "description": "Mark of the active orders\n" - }, - "cancelExist": { - "type": "boolean", - "description": "Mark of the canceled orders\n" - }, - "createdAt": { - "type": "integer", - "description": "Time the order created\n", - "format": "int64" - }, - "updatedAt": { - "type": "integer", - "description": "last update time\n", - "format": "int64" - }, - "endAt": { + "openOrderBuySize": { "type": "integer", - "description": "Order Endtime", - "format": "int64" + "description": "Total number of the unexecuted buy orders\n" }, - "orderTime": { + "openOrderSellSize": { "type": "integer", - "description": "Order create time in nanosecond\n", - "format": "int64" - }, - "settleCurrency": { - "type": "string", - "description": "settlement currency\n" - }, - "marginMode": { - "type": "string", - "description": "Margin mode: ISOLATED (isolated), CROSS (cross margin).\n", - "enum": [ - "CROSS", - "ISOLATED" - ], - "x-api-enum": [ - { - "value": "CROSS", - "name": "CROSS", - "description": "Cross margin" - }, - { - "value": "ISOLATED", - "name": "ISOLATED", - "description": "Isolated margin" - } - ] + "description": "Total number of the unexecuted sell orders\n" }, - "avgDealPrice": { + "openOrderBuyCost": { "type": "string", - "description": "Average transaction price, forward contract average transaction price = sum (transaction value) / sum (transaction quantity), reverse contract average transaction price = sum (transaction quantity) / sum (transaction value). Transaction quantity = lots * multiplier\n" - }, - "filledSize": { - "type": "integer", - "description": "Value of the executed orders\n" + "description": "Value of all the unexecuted buy orders\n" }, - "filledValue": { + "openOrderSellCost": { "type": "string", - "description": "Executed order quantity\n" + "description": "Value of all the unexecuted sell orders\n" }, - "status": { + "settleCurrency": { "type": "string", - "description": "order status: “open” or “done”\n", - "enum": [ - "open", - "done" - ], - "x-api-enum": [ - { - "value": "open", - "name": "open", - "description": "open order" - }, - { - "value": "done", - "name": "done", - "description": "done order" - } - ] + "description": "settlement currency\n" + } + }, + "required": [ + "openOrderBuySize", + "openOrderSellSize", + "openOrderBuyCost", + "openOrderSellCost", + "settleCurrency" + ] + } + }, + "required": [ + "code", + "data" + ] + } + } + } + } + }, + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470250", + "x-abandon": "normal", + "x-domain": "Futures", + "x-api-channel": "Private", + "x-api-permission": "Futures", + "x-api-rate-limit-pool": "Futures", + "x-sdk-service": "Futures", + "x-sdk-sub-service": "Order", + "x-sdk-method-name": "GetOpenOrderValue", + "x-sdk-method-description": "You can query this endpoint to get the the total number and value of the all your active orders.", + "x-api-rate-limit": 10, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"openOrderBuySize\\\": 1,\\n \\\"openOrderSellSize\\\": 0,\\n \\\"openOrderBuyCost\\\": \\\"0.0001\\\",\\n \\\"openOrderSellCost\\\": \\\"0\\\",\\n \\\"settleCurrency\\\": \\\"USDT\\\"\\n }\\n}", + "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDTM\\\"}" + } + }, + "/api/v1/recentFills": { + "get": { + "summary": "Get Recent Trade History", + "deprecated": false, + "description": "Get a list of recent 1000 fills in the last 24 hours. If you need to get your recent traded order history with low latency, you may query this endpoint.", + "tags": [], + "parameters": [ + { + "name": "symbol", + "in": "query", + "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) ", + "required": false, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "array", + "items": { + "type": "object", + "properties": { + "symbol": { + "type": "string", + "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) " + }, + "tradeId": { + "type": "string", + "description": "Trade ID\n" + }, + "orderId": { + "type": "string", + "description": "Order ID\n" + }, + "side": { + "type": "string", + "description": "Transaction side\n", + "enum": [ + "buy", + "sell" + ], + "x-api-enum": [ + { + "value": "buy", + "name": "buy", + "description": "buy" + }, + { + "value": "sell", + "name": "sell", + "description": "sell" + } + ] + }, + "liquidity": { + "type": "string", + "description": "Liquidity- taker or maker\n", + "enum": [ + "taker", + "maker" + ], + "x-api-enum": [ + { + "value": "taker", + "name": "taker", + "description": "taker" + }, + { + "value": "maker", + "name": "maker", + "description": "maker" + } + ] + }, + "forceTaker": { + "type": "boolean", + "description": "Whether to force processing as a taker\n" + }, + "price": { + "type": "string", + "description": "Filled price\n" + }, + "size": { + "type": "integer", + "description": "Filled amount\n" + }, + "value": { + "type": "string", + "description": "Order value\n" + }, + "openFeePay": { + "type": "string", + "description": "Opening transaction fee\n" + }, + "closeFeePay": { + "type": "string", + "description": "Closing transaction fee\n" + }, + "stop": { + "type": "string", + "description": "A mark to the stop order type\n" + }, + "feeRate": { + "type": "string", + "description": "Fee Rate" + }, + "fixFee": { + "type": "string", + "description": "Fixed fees(Deprecated field, no actual use of the value field)\n" + }, + "feeCurrency": { + "type": "string", + "description": "Charging currency\n" + }, + "tradeTime": { + "type": "integer", + "description": "trade time in nanosecond\n", + "format": "int64" + }, + "subTradeType": { + "type": "string", + "description": "Deprecated field, no actual use of the value field" + }, + "marginMode": { + "type": "string", + "description": "Margin mode: ISOLATED (isolated), CROSS (cross margin).\n", + "enum": [ + "ISOLATED", + "CROSS" + ], + "x-api-enum": [ + { + "value": "ISOLATED", + "name": "ISOLATED", + "description": "Isolated Margin" + }, + { + "value": "CROSS", + "name": "CROSS", + "description": "Cross Margin" + } + ] + }, + "displayType": { + "type": "string", + "enum": [ + "limit", + "market", + "limit_stop", + "market_stop" + ], + "description": "Order Type", + "x-api-enum": [ + { + "value": "limit", + "name": "limit", + "description": "Limit order" + }, + { + "value": "market", + "name": "market", + "description": "Market order" + }, + { + "value": "limit_stop", + "name": "limit_stop", + "description": "Stop limit order" + }, + { + "value": "market_stop", + "name": "market_stop", + "description": "Stop Market order" + } + ] + }, + "fee": { + "type": "string", + "description": "Transaction fee\n" + }, + "settleCurrency": { + "type": "string", + "description": "Settle Currency" + }, + "orderType": { + "type": "string", + "description": "Order type\n", + "enum": [ + "market", + "limit" + ], + "x-api-enum": [ + { + "value": "market", + "name": "market", + "description": "market" + }, + { + "value": "limit", + "name": "limit", + "description": "limit" + } + ] + }, + "tradeType": { + "type": "string", + "description": "Trade type (trade, liquid, cancel, adl or settlement)\n", + "enum": [ + "trade", + "cancel", + "liquid", + "adl", + "settlement" + ], + "x-api-enum": [ + { + "value": "trade", + "name": "trade", + "description": "trade" + }, + { + "value": "cancel", + "name": "cancel", + "description": "Partially filled and cancelled orders" + }, + { + "value": "liquid", + "name": "liquid", + "description": "liquid" + }, + { + "value": "adl", + "name": "adl", + "description": "adl" + }, + { + "value": "settlement", + "name": "settlement", + "description": "settlement" + } + ] + }, + "createdAt": { + "type": "integer", + "description": "Time the order created\n", + "format": "int64" + } }, - "reduceOnly": { - "type": "boolean", - "description": "A mark to reduce the position size only\n" - } - }, - "required": [ - "id", - "symbol", - "type", - "side", - "price", - "size", - "value", - "dealValue", - "dealSize", - "stp", - "stop", - "stopPriceType", - "stopTriggered", - "stopPrice", - "timeInForce", - "postOnly", - "hidden", - "iceberg", - "leverage", - "forceHold", - "closeOrder", - "visibleSize", - "clientOid", - "remark", - "tags", - "isActive", - "cancelExist", - "createdAt", - "updatedAt", - "endAt", - "orderTime", - "settleCurrency", - "marginMode", - "avgDealPrice", - "filledSize", - "filledValue", - "status", - "reduceOnly" - ] + "required": [ + "symbol", + "tradeId", + "orderId", + "side", + "liquidity", + "forceTaker", + "price", + "size", + "value", + "openFeePay", + "closeFeePay", + "stop", + "feeRate", + "fixFee", + "feeCurrency", + "tradeTime", + "subTradeType", + "marginMode", + "displayType", + "fee", + "settleCurrency", + "orderType", + "tradeType", + "createdAt" + ] + } } }, "required": [ @@ -4102,35 +3903,163 @@ } } }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470352", + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470249", "x-abandon": "normal", "x-domain": "Futures", "x-api-channel": "Private", - "x-api-permission": "General", + "x-api-permission": "Futures", "x-api-rate-limit-pool": "Futures", "x-sdk-service": "Futures", "x-sdk-sub-service": "Order", - "x-sdk-method-name": "getOrderByClientOid", - "x-sdk-method-description": "Get a single order by client order id (including a stop order).", - "x-api-rate-limit": 5, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"id\\\": \\\"250444645610336256\\\",\\n \\\"symbol\\\": \\\"XRPUSDTM\\\",\\n \\\"type\\\": \\\"limit\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"price\\\": \\\"0.1\\\",\\n \\\"size\\\": 1,\\n \\\"value\\\": \\\"1\\\",\\n \\\"dealValue\\\": \\\"0\\\",\\n \\\"dealSize\\\": 0,\\n \\\"stp\\\": \\\"\\\",\\n \\\"stop\\\": \\\"\\\",\\n \\\"stopPriceType\\\": \\\"\\\",\\n \\\"stopTriggered\\\": false,\\n \\\"stopPrice\\\": null,\\n \\\"timeInForce\\\": \\\"GTC\\\",\\n \\\"postOnly\\\": false,\\n \\\"hidden\\\": false,\\n \\\"iceberg\\\": false,\\n \\\"leverage\\\": \\\"3\\\",\\n \\\"forceHold\\\": false,\\n \\\"closeOrder\\\": false,\\n \\\"visibleSize\\\": 0,\\n \\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\",\\n \\\"remark\\\": null,\\n \\\"tags\\\": \\\"\\\",\\n \\\"isActive\\\": true,\\n \\\"cancelExist\\\": false,\\n \\\"createdAt\\\": 1732523858568,\\n \\\"updatedAt\\\": 1732523858568,\\n \\\"endAt\\\": null,\\n \\\"orderTime\\\": 1732523858550892322,\\n \\\"settleCurrency\\\": \\\"USDT\\\",\\n \\\"marginMode\\\": \\\"ISOLATED\\\",\\n \\\"avgDealPrice\\\": \\\"0\\\",\\n \\\"filledSize\\\": 0,\\n \\\"filledValue\\\": \\\"0\\\",\\n \\\"status\\\": \\\"open\\\",\\n \\\"reduceOnly\\\": false\\n }\\n}", - "x-request-example": "{\\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\"}" + "x-sdk-method-name": "getRecentTradeHistory", + "x-sdk-method-description": "Get a list of recent 1000 fills in the last 24 hours. If you need to get your recent traded order history with low latency, you may query this endpoint.", + "x-api-rate-limit": 3, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": [\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"tradeId\\\": \\\"1784277229880\\\",\\n \\\"orderId\\\": \\\"236317213710184449\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"liquidity\\\": \\\"taker\\\",\\n \\\"forceTaker\\\": false,\\n \\\"price\\\": \\\"67430.9\\\",\\n \\\"size\\\": 1,\\n \\\"value\\\": \\\"67.4309\\\",\\n \\\"openFeePay\\\": \\\"0.04045854\\\",\\n \\\"closeFeePay\\\": \\\"0\\\",\\n \\\"stop\\\": \\\"\\\",\\n \\\"feeRate\\\": \\\"0.00060\\\",\\n \\\"fixFee\\\": \\\"0\\\",\\n \\\"feeCurrency\\\": \\\"USDT\\\",\\n \\\"marginMode\\\": \\\"ISOLATED\\\",\\n \\\"fee\\\": \\\"0.04045854\\\",\\n \\\"settleCurrency\\\": \\\"USDT\\\",\\n \\\"orderType\\\": \\\"market\\\",\\n \\\"displayType\\\": \\\"market\\\",\\n \\\"tradeType\\\": \\\"trade\\\",\\n \\\"subTradeType\\\": null,\\n \\\"tradeTime\\\": 1729155616320000000,\\n \\\"createdAt\\\": 1729155616493\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"tradeId\\\": \\\"1784277132002\\\",\\n \\\"orderId\\\": \\\"236317094436728832\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"liquidity\\\": \\\"taker\\\",\\n \\\"forceTaker\\\": false,\\n \\\"price\\\": \\\"67445\\\",\\n \\\"size\\\": 1,\\n \\\"value\\\": \\\"67.445\\\",\\n \\\"openFeePay\\\": \\\"0\\\",\\n \\\"closeFeePay\\\": \\\"0.040467\\\",\\n \\\"stop\\\": \\\"\\\",\\n \\\"feeRate\\\": \\\"0.00060\\\",\\n \\\"fixFee\\\": \\\"0\\\",\\n \\\"feeCurrency\\\": \\\"USDT\\\",\\n \\\"marginMode\\\": \\\"ISOLATED\\\",\\n \\\"fee\\\": \\\"0.040467\\\",\\n \\\"settleCurrency\\\": \\\"USDT\\\",\\n \\\"orderType\\\": \\\"market\\\",\\n \\\"displayType\\\": \\\"market\\\",\\n \\\"tradeType\\\": \\\"trade\\\",\\n \\\"subTradeType\\\": null,\\n \\\"tradeTime\\\": 1729155587944000000,\\n \\\"createdAt\\\": 1729155588104\\n }\\n ]\\n}", + "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDTM\\\"}" } }, - "/api/v1/recentDoneOrders": { + "/api/v1/fills": { "get": { - "summary": "Get Recent Closed Orders", + "summary": "Get Trade History", "deprecated": false, - "description": "Get a list of recent 1000 closed orders in the last 24 hours. If you need to get your recent traded order history with low latency, you may query this endpoint.", + "description": "Get a list of recent fills. If you need to get your recent trade history with low latency, please query endpoint Get List of Orders Completed in 24h. The requested data is not real-time.", "tags": [], "parameters": [ { - "name": "symbol", + "name": "orderId", + "in": "query", + "description": "List fills for a specific order only (If you specify orderId, other parameters can be ignored)", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "symbol", + "in": "query", + "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) ", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "side", + "in": "query", + "description": "Order side", + "required": false, + "schema": { + "type": "string", + "enum": [ + "buy", + "sell" + ], + "x-api-enum": [ + { + "value": "buy", + "name": "buy", + "description": "buy" + }, + { + "value": "sell", + "name": "sell", + "description": "sell" + } + ] + } + }, + { + "name": "type", + "in": "query", + "description": "Order Type", + "required": false, + "schema": { + "type": "string", + "enum": [ + "limit", + "market", + "limit_stop", + "market_stop" + ], + "x-api-enum": [ + { + "value": "limit", + "name": "limit", + "description": "Limit order" + }, + { + "value": "market", + "name": "market", + "description": "Market order" + }, + { + "value": "limit_stop", + "name": "limit_stop", + "description": "Stop limit order" + }, + { + "value": "market_stop", + "name": "market_stop", + "description": "Stop Market order" + } + ] + } + }, + { + "name": "tradeTypes", + "in": "query", + "description": "Transaction type: trade, adl, liquid, settlement. Supports querying multiple types at the same time, separated by commas. Query all type when empty", + "required": false, + "schema": { + "type": "string", + "example": [ + "trade", + "adl", + "liquid", + "settlement", + "adl,liquid" + ] + } + }, + { + "name": "startAt", + "in": "query", + "description": "Start time (milisecond)", + "required": false, + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "endAt", "in": "query", - "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) ", + "description": "End time (milisecond)", "required": false, "schema": { - "type": "string" + "type": "integer", + "format": "int64" + } + }, + { + "name": "currentPage", + "in": "query", + "description": "Current request page, The default currentPage is 1", + "required": false, + "schema": { + "type": "integer", + "default": 1 + } + }, + { + "name": "pageSize", + "in": "query", + "description": "pageSize, The default pageSize is 50, The maximum cannot exceed 1000", + "required": false, + "schema": { + "type": "integer", + "default": 50, + "maximum": 1000 } } ], @@ -4146,208 +4075,279 @@ "type": "string" }, "data": { - "type": "array", - "items": { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "Order ID" - }, - "symbol": { - "type": "string", - "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) " - }, - "type": { - "type": "string", - "description": "Order type, market order or limit order" - }, - "side": { - "type": "string", - "description": "Transaction side" - }, - "price": { - "type": "string", - "description": "Order price" - }, - "size": { - "type": "integer", - "description": "Order quantity" - }, - "value": { - "type": "string", - "description": "Order value\n" - }, - "dealValue": { - "type": "string", - "description": "Executed size of funds\n" - }, - "dealSize": { - "type": "integer", - "description": "Executed quantity\n" - }, - "stp": { - "type": "string", - "description": "self trade prevention" - }, - "stop": { - "type": "string", - "description": "Stop order type (stop limit or stop market)\n" - }, - "stopPriceType": { - "type": "string", - "description": "Trigger price type of stop orders\n" - }, - "stopTriggered": { - "type": "boolean", - "description": "Mark to show whether the stop order is triggered" - }, - "stopPrice": { - "type": "integer", - "description": "Trigger price of stop orders\n" - }, - "timeInForce": { - "type": "string", - "description": "Time in force policy type\n" - }, - "postOnly": { - "type": "boolean", - "description": "Mark of post only\n" - }, - "hidden": { - "type": "boolean", - "description": "Mark of the hidden order\n" - }, - "iceberg": { - "type": "boolean", - "description": "Mark of the iceberg order\n" - }, - "leverage": { - "type": "string", - "description": "Leverage of the order\n" - }, - "forceHold": { - "type": "boolean", - "description": "A mark to forcely hold the funds for an order\n" - }, - "closeOrder": { - "type": "boolean", - "description": "A mark to close the position\n" - }, - "visibleSize": { - "type": "integer", - "description": "Visible size of the iceberg order\n" - }, - "clientOid": { - "type": "string", - "description": "Unique order id created by users to identify their orders\n" - }, - "remark": { - "type": "string", - "description": "Remark of the order\n" - }, - "tags": { - "type": "string", - "description": "tag order source\n" - }, - "isActive": { - "type": "boolean", - "description": "Mark of the active orders\n" - }, - "cancelExist": { - "type": "boolean", - "description": "Mark of the canceled orders\n" - }, - "createdAt": { - "type": "integer", - "description": "Time the order created\n", - "format": "int64" - }, - "updatedAt": { - "type": "integer", - "description": "last update time\n", - "format": "int64" - }, - "endAt": { - "type": "integer", - "description": "End time\n", - "format": "int64" - }, - "orderTime": { - "type": "integer", - "description": "Order create time in nanosecond\n", - "format": "int64" - }, - "settleCurrency": { - "type": "string", - "description": "settlement currency\n" - }, - "marginMode": { - "type": "string", - "description": "Margin mode: ISOLATED (isolated), CROSS (cross margin).\n" - }, - "avgDealPrice": { - "type": "string", - "description": "Average transaction price, forward contract average transaction price = sum (transaction value) / sum (transaction quantity), reverse contract average transaction price = sum (transaction quantity) / sum (transaction value). Transaction quantity = lots * multiplier\n" - }, - "filledSize": { - "type": "integer", - "description": "Value of the executed orders\n" - }, - "filledValue": { - "type": "string", - "description": "Executed order quantity\n" - }, - "status": { - "type": "string", - "description": "order status: “open” or “done”\n" - }, - "reduceOnly": { - "type": "boolean", - "description": "A mark to reduce the position size only\n" + "type": "object", + "properties": { + "currentPage": { + "type": "integer" + }, + "pageSize": { + "type": "integer" + }, + "totalNum": { + "type": "integer" + }, + "totalPage": { + "type": "integer" + }, + "items": { + "type": "array", + "items": { + "type": "object", + "properties": { + "symbol": { + "type": "string", + "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) " + }, + "tradeId": { + "type": "string", + "description": "Trade ID\n" + }, + "orderId": { + "type": "string", + "description": "Order ID\n" + }, + "side": { + "type": "string", + "description": "Transaction side", + "enum": [ + "buy", + "sell" + ], + "x-api-enum": [ + { + "value": "buy", + "name": "buy", + "description": "buy" + }, + { + "value": "sell", + "name": "sell", + "description": "sell" + } + ] + }, + "liquidity": { + "type": "string", + "description": "Liquidity- taker or maker", + "enum": [ + "taker", + "maker" + ], + "x-api-enum": [ + { + "value": "taker", + "name": "taker", + "description": "taker" + }, + { + "value": "maker", + "name": "maker", + "description": "maker" + } + ] + }, + "forceTaker": { + "type": "boolean", + "description": "Whether to force processing as a taker\n" + }, + "price": { + "type": "string", + "description": "Filled price" + }, + "size": { + "type": "integer", + "description": "Filled amount" + }, + "value": { + "type": "string", + "description": "Order value" + }, + "openFeePay": { + "type": "string", + "description": "Opening transaction fee" + }, + "closeFeePay": { + "type": "string", + "description": "Closing transaction fee" + }, + "stop": { + "type": "string", + "description": "A mark to the stop order type" + }, + "feeRate": { + "type": "string", + "description": "Fee Rate" + }, + "fixFee": { + "type": "string", + "description": "Fixed fees(Deprecated field, no actual use of the value field)" + }, + "feeCurrency": { + "type": "string", + "description": "Charging currency" + }, + "tradeTime": { + "type": "integer", + "description": "trade time in nanosecond", + "format": "int64" + }, + "subTradeType": { + "type": "string", + "description": "Deprecated field, no actual use of the value field" + }, + "marginMode": { + "type": "string", + "description": "Margin mode: ISOLATED (isolated), CROSS (cross margin).", + "enum": [ + "ISOLATED", + "CROSS" + ], + "x-api-enum": [ + { + "value": "ISOLATED", + "name": "ISOLATED", + "description": "Isolated Margin" + }, + { + "value": "CROSS", + "name": "CROSS", + "description": "Cross Margin" + } + ] + }, + "settleCurrency": { + "type": "string", + "description": "Settle Currency" + }, + "displayType": { + "type": "string", + "enum": [ + "limit", + "market", + "limit_stop", + "market_stop" + ], + "description": "Order Type", + "x-api-enum": [ + { + "value": "limit", + "name": "limit", + "description": "Limit order" + }, + { + "value": "market", + "name": "market", + "description": "Market order" + }, + { + "value": "limit_stop", + "name": "limit_stop", + "description": "Stop limit order" + }, + { + "value": "market_stop", + "name": "market_stop", + "description": "Stop Market order" + } + ] + }, + "fee": { + "type": "string" + }, + "orderType": { + "type": "string", + "description": "Order type", + "enum": [ + "market", + "limit" + ], + "x-api-enum": [ + { + "value": "market", + "name": "market", + "description": "market" + }, + { + "value": "limit", + "name": "limit", + "description": "limit" + } + ] + }, + "tradeType": { + "type": "string", + "description": "Trade type (trade, liquid, adl or settlement)\n", + "enum": [ + "trade", + "liquid", + "adl", + "settlement" + ], + "x-api-enum": [ + { + "value": "trade", + "name": "trade", + "description": "trade" + }, + { + "value": "liquid", + "name": "liquid", + "description": "liquid" + }, + { + "value": "adl", + "name": "adl", + "description": "adl" + }, + { + "value": "settlement", + "name": "settlement", + "description": "settlement" + } + ] + }, + "createdAt": { + "type": "integer", + "description": "Time the order created\n", + "format": "int64" + } + }, + "required": [ + "symbol", + "tradeId", + "orderId", + "side", + "liquidity", + "forceTaker", + "price", + "size", + "value", + "openFeePay", + "closeFeePay", + "stop", + "feeRate", + "fixFee", + "feeCurrency", + "tradeTime", + "subTradeType", + "marginMode", + "settleCurrency", + "displayType", + "fee", + "orderType", + "tradeType", + "createdAt" + ] } - }, - "required": [ - "id", - "symbol", - "type", - "side", - "price", - "size", - "value", - "dealValue", - "dealSize", - "stp", - "stop", - "stopPriceType", - "stopTriggered", - "stopPrice", - "timeInForce", - "postOnly", - "hidden", - "iceberg", - "leverage", - "forceHold", - "closeOrder", - "visibleSize", - "clientOid", - "remark", - "tags", - "isActive", - "cancelExist", - "createdAt", - "updatedAt", - "endAt", - "orderTime", - "settleCurrency", - "marginMode", - "avgDealPrice", - "filledSize", - "filledValue", - "status", - "reduceOnly" - ] - } + } + }, + "required": [ + "currentPage", + "pageSize", + "totalNum", + "totalPage", + "items" + ] } }, "required": [ @@ -4359,7 +4359,7 @@ } } }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470246", + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470248", "x-abandon": "normal", "x-domain": "Futures", "x-api-channel": "Private", @@ -4367,11 +4367,11 @@ "x-api-rate-limit-pool": "Futures", "x-sdk-service": "Futures", "x-sdk-sub-service": "Order", - "x-sdk-method-name": "GetRecentClosedOrders", - "x-sdk-method-description": "Get a list of recent 1000 closed orders in the last 24 hours. If you need to get your recent traded order history with low latency, you may query this endpoint.", + "x-sdk-method-name": "getTradeHistory", + "x-sdk-method-description": "Get a list of recent fills. If you need to get your recent trade history with low latency, please query endpoint Get List of Orders Completed in 24h. The requested data is not real-time.", "x-api-rate-limit": 5, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": [\\n {\\n \\\"id\\\": \\\"236387137732231168\\\",\\n \\\"symbol\\\": \\\"XRPUSDTM\\\",\\n \\\"type\\\": \\\"market\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"price\\\": \\\"0\\\",\\n \\\"size\\\": 1,\\n \\\"value\\\": \\\"5.51\\\",\\n \\\"dealValue\\\": \\\"5.511\\\",\\n \\\"dealSize\\\": 1,\\n \\\"stp\\\": \\\"\\\",\\n \\\"stop\\\": \\\"\\\",\\n \\\"stopPriceType\\\": \\\"\\\",\\n \\\"stopTriggered\\\": false,\\n \\\"stopPrice\\\": null,\\n \\\"timeInForce\\\": \\\"GTC\\\",\\n \\\"postOnly\\\": false,\\n \\\"hidden\\\": false,\\n \\\"iceberg\\\": false,\\n \\\"leverage\\\": \\\"10.0\\\",\\n \\\"forceHold\\\": false,\\n \\\"closeOrder\\\": false,\\n \\\"visibleSize\\\": 0,\\n \\\"clientOid\\\": \\\"16698fe6-2746-4aeb-a7fa-61f633ab6090\\\",\\n \\\"remark\\\": null,\\n \\\"tags\\\": \\\"\\\",\\n \\\"isActive\\\": false,\\n \\\"cancelExist\\\": false,\\n \\\"createdAt\\\": 1729172287496,\\n \\\"updatedAt\\\": 1729172287568,\\n \\\"endAt\\\": 1729172287568,\\n \\\"orderTime\\\": 1729172287496950800,\\n \\\"settleCurrency\\\": \\\"USDT\\\",\\n \\\"marginMode\\\": \\\"ISOLATED\\\",\\n \\\"avgDealPrice\\\": \\\"0.5511\\\",\\n \\\"filledSize\\\": 1,\\n \\\"filledValue\\\": \\\"5.511\\\",\\n \\\"status\\\": \\\"done\\\",\\n \\\"reduceOnly\\\": false\\n },\\n {\\n \\\"id\\\": \\\"236317213710184449\\\",\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"type\\\": \\\"market\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"price\\\": \\\"0\\\",\\n \\\"size\\\": 1,\\n \\\"value\\\": \\\"67.4309\\\",\\n \\\"dealValue\\\": \\\"67.4309\\\",\\n \\\"dealSize\\\": 1,\\n \\\"stp\\\": \\\"\\\",\\n \\\"stop\\\": \\\"\\\",\\n \\\"stopPriceType\\\": \\\"\\\",\\n \\\"stopTriggered\\\": false,\\n \\\"stopPrice\\\": null,\\n \\\"timeInForce\\\": \\\"GTC\\\",\\n \\\"postOnly\\\": false,\\n \\\"hidden\\\": false,\\n \\\"iceberg\\\": false,\\n \\\"leverage\\\": \\\"3\\\",\\n \\\"forceHold\\\": false,\\n \\\"closeOrder\\\": false,\\n \\\"visibleSize\\\": 0,\\n \\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\",\\n \\\"remark\\\": null,\\n \\\"tags\\\": \\\"\\\",\\n \\\"isActive\\\": false,\\n \\\"cancelExist\\\": false,\\n \\\"createdAt\\\": 1729155616310,\\n \\\"updatedAt\\\": 1729155616324,\\n \\\"endAt\\\": 1729155616324,\\n \\\"orderTime\\\": 1729155616310180400,\\n \\\"settleCurrency\\\": \\\"USDT\\\",\\n \\\"marginMode\\\": \\\"ISOLATED\\\",\\n \\\"avgDealPrice\\\": \\\"67430.9\\\",\\n \\\"filledSize\\\": 1,\\n \\\"filledValue\\\": \\\"67.4309\\\",\\n \\\"status\\\": \\\"done\\\",\\n \\\"reduceOnly\\\": false\\n },\\n {\\n \\\"id\\\": \\\"236317094436728832\\\",\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"type\\\": \\\"market\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"price\\\": \\\"0\\\",\\n \\\"size\\\": 1,\\n \\\"value\\\": \\\"67.445\\\",\\n \\\"dealValue\\\": \\\"67.445\\\",\\n \\\"dealSize\\\": 1,\\n \\\"stp\\\": \\\"\\\",\\n \\\"stop\\\": \\\"\\\",\\n \\\"stopPriceType\\\": \\\"\\\",\\n \\\"stopTriggered\\\": false,\\n \\\"stopPrice\\\": null,\\n \\\"timeInForce\\\": \\\"GTC\\\",\\n \\\"postOnly\\\": false,\\n \\\"hidden\\\": false,\\n \\\"iceberg\\\": false,\\n \\\"leverage\\\": \\\"3\\\",\\n \\\"forceHold\\\": false,\\n \\\"closeOrder\\\": false,\\n \\\"visibleSize\\\": 0,\\n \\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\",\\n \\\"remark\\\": null,\\n \\\"tags\\\": \\\"\\\",\\n \\\"isActive\\\": false,\\n \\\"cancelExist\\\": false,\\n \\\"createdAt\\\": 1729155587873,\\n \\\"updatedAt\\\": 1729155587946,\\n \\\"endAt\\\": 1729155587946,\\n \\\"orderTime\\\": 1729155587873332000,\\n \\\"settleCurrency\\\": \\\"USDT\\\",\\n \\\"marginMode\\\": \\\"ISOLATED\\\",\\n \\\"avgDealPrice\\\": \\\"67445.0\\\",\\n \\\"filledSize\\\": 1,\\n \\\"filledValue\\\": \\\"67.445\\\",\\n \\\"status\\\": \\\"done\\\",\\n \\\"reduceOnly\\\": false\\n }\\n ]\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDTM\\\"}" + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"currentPage\\\": 1,\\n \\\"pageSize\\\": 50,\\n \\\"totalNum\\\": 2,\\n \\\"totalPage\\\": 1,\\n \\\"items\\\": [\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"tradeId\\\": \\\"1784277229880\\\",\\n \\\"orderId\\\": \\\"236317213710184449\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"liquidity\\\": \\\"taker\\\",\\n \\\"forceTaker\\\": false,\\n \\\"price\\\": \\\"67430.9\\\",\\n \\\"size\\\": 1,\\n \\\"value\\\": \\\"67.4309\\\",\\n \\\"openFeePay\\\": \\\"0.04045854\\\",\\n \\\"closeFeePay\\\": \\\"0\\\",\\n \\\"stop\\\": \\\"\\\",\\n \\\"feeRate\\\": \\\"0.00060\\\",\\n \\\"fixFee\\\": \\\"0\\\",\\n \\\"feeCurrency\\\": \\\"USDT\\\",\\n \\\"marginMode\\\": \\\"ISOLATED\\\",\\n \\\"settleCurrency\\\": \\\"USDT\\\",\\n \\\"fee\\\": \\\"0.04045854\\\",\\n \\\"orderType\\\": \\\"market\\\",\\n \\\"displayType\\\": \\\"market\\\",\\n \\\"tradeType\\\": \\\"trade\\\",\\n \\\"subTradeType\\\": null,\\n \\\"tradeTime\\\": 1729155616320000000,\\n \\\"createdAt\\\": 1729155616493\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"tradeId\\\": \\\"1784277132002\\\",\\n \\\"orderId\\\": \\\"236317094436728832\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"liquidity\\\": \\\"taker\\\",\\n \\\"forceTaker\\\": false,\\n \\\"price\\\": \\\"67445\\\",\\n \\\"size\\\": 1,\\n \\\"value\\\": \\\"67.445\\\",\\n \\\"openFeePay\\\": \\\"0\\\",\\n \\\"closeFeePay\\\": \\\"0.040467\\\",\\n \\\"stop\\\": \\\"\\\",\\n \\\"feeRate\\\": \\\"0.00060\\\",\\n \\\"fixFee\\\": \\\"0\\\",\\n \\\"feeCurrency\\\": \\\"USDT\\\",\\n \\\"marginMode\\\": \\\"ISOLATED\\\",\\n \\\"settleCurrency\\\": \\\"USDT\\\",\\n \\\"fee\\\": \\\"0.040467\\\",\\n \\\"orderType\\\": \\\"market\\\",\\n \\\"displayType\\\": \\\"market\\\",\\n \\\"tradeType\\\": \\\"trade\\\",\\n \\\"subTradeType\\\": null,\\n \\\"tradeTime\\\": 1729155587944000000,\\n \\\"createdAt\\\": 1729155588104\\n }\\n ]\\n }\\n}", + "x-request-example": "{\\\"orderId\\\": \\\"236655147005071361\\\", \\\"symbol\\\": \\\"example_string_default_value\\\", \\\"side\\\": \\\"buy\\\", \\\"type\\\": \\\"limit\\\", \\\"tradeTypes\\\": \\\"trade\\\", \\\"startAt\\\": 123456, \\\"endAt\\\": 123456, \\\"currentPage\\\": 1, \\\"pageSize\\\": 50}" } } }, diff --git a/spec/rest/api/openapi-futures-positions.json b/spec/rest/api/openapi-futures-positions.json index c76a190e..10c76653 100644 --- a/spec/rest/api/openapi-futures-positions.json +++ b/spec/rest/api/openapi-futures-positions.json @@ -7,6 +7,213 @@ }, "tags": [], "paths": { + "/api/v2/position/getMarginMode": { + "get": { + "summary": "Get Margin Mode", + "deprecated": false, + "description": "This interface can query the margin mode of the current symbol.", + "tags": [], + "parameters": [ + { + "name": "symbol", + "in": "query", + "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) ", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "object", + "properties": { + "symbol": { + "type": "string", + "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) " + }, + "marginMode": { + "type": "string", + "description": "Margin mode: ISOLATED (isolated), CROSS (cross margin).", + "enum": [ + "ISOLATED", + "CROSS" + ], + "x-api-enum": [ + { + "value": "ISOLATED", + "name": "ISOLATED", + "description": "isolated margin" + }, + { + "value": "CROSS", + "name": "CROSS", + "description": "cross margin" + } + ] + } + }, + "required": [ + "symbol", + "marginMode" + ] + } + }, + "required": [ + "code", + "data" + ] + } + } + } + } + }, + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470259", + "x-abandon": "normal", + "x-domain": "Futures", + "x-api-channel": "Private", + "x-api-permission": "Futures", + "x-api-rate-limit-pool": "Futures", + "x-sdk-service": "Futures", + "x-sdk-sub-service": "Positions", + "x-sdk-method-name": "getMarginMode", + "x-sdk-method-description": "This interface can query the margin mode of the current symbol.", + "x-api-rate-limit": 2, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"marginMode\\\": \\\"ISOLATED\\\"\\n }\\n}", + "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDTM\\\"}" + } + }, + "/api/v2/position/changeMarginMode": { + "post": { + "summary": "Switch Margin Mode", + "deprecated": false, + "description": "This interface can modify the margin mode of the current symbol.", + "tags": [], + "parameters": [], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "object", + "properties": { + "symbol": { + "type": "string", + "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) " + }, + "marginMode": { + "type": "string", + "description": "Margin mode: ISOLATED (isolated), CROSS (cross margin).", + "enum": [ + "ISOLATED", + "CROSS" + ], + "x-api-enum": [ + { + "value": "ISOLATED", + "name": "ISOLATED", + "description": "isolated margin" + }, + { + "value": "CROSS", + "name": "CROSS", + "description": "cross margin" + } + ] + } + }, + "required": [ + "symbol", + "marginMode" + ] + } + }, + "required": [ + "code", + "data" + ] + } + } + } + } + }, + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470262", + "x-abandon": "normal", + "x-domain": "Futures", + "x-api-channel": "Private", + "x-api-permission": "Futures", + "x-api-rate-limit-pool": "Futures", + "x-sdk-service": "Futures", + "x-sdk-sub-service": "Positions", + "x-sdk-method-name": "switchMarginMode", + "x-sdk-method-description": "This interface can modify the margin mode of the current symbol.", + "x-api-rate-limit": 2, + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "symbol": { + "type": "string", + "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) ", + "example": [ + "XBTUSDTM", + "XBTUSDCM", + "ETHUSDTM" + ] + }, + "marginMode": { + "type": "string", + "description": "Modified margin model: ISOLATED (isolated), CROSS (cross margin).", + "enum": [ + "ISOLATED", + "CROSS" + ], + "x-api-enum": [ + { + "value": "ISOLATED", + "name": "ISOLATED", + "description": "Isolated Margin Mode" + }, + { + "value": "CROSS", + "name": "CROSS", + "description": "Cross Margin MOde" + } + ] + } + }, + "required": [ + "symbol", + "marginMode" + ] + }, + "example": "{\n \"symbol\": \"XBTUSDTM\",\n \"marginMode\": \"ISOLATED\"\n}" + } + } + }, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"marginMode\\\": \\\"ISOLATED\\\"\\n }\\n}", + "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDTM\\\", \\\"marginMode\\\": \\\"ISOLATED\\\"}" + } + }, "/api/v2/getMaxOpenSize": { "get": { "summary": "Get Max Open Size", @@ -105,16 +312,16 @@ "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDTM\\\", \\\"price\\\": \\\"example_string_default_value\\\", \\\"leverage\\\": 123456}" } }, - "/api/v1/contracts/risk-limit/{symbol}": { + "/api/v1/position": { "get": { - "summary": "Get Isolated Margin Risk Limit", + "summary": "Get Position Details", "deprecated": false, - "description": "This interface can be used to obtain information about risk limit level of a specific contract(Only valid for isolated Margin).", + "description": "Get the position details of a specified position.", "tags": [], "parameters": [ { "name": "symbol", - "in": "path", + "in": "query", "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) ", "required": true, "schema": { @@ -134,109 +341,11 @@ "type": "string" }, "data": { - "type": "array", - "items": { - "type": "object", - "properties": { - "symbol": { - "type": "string", - "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) " - }, - "level": { - "type": "integer", - "description": "level\n" - }, - "maxRiskLimit": { - "type": "integer", - "description": "Upper limit USDT(includes)\n" - }, - "minRiskLimit": { - "type": "integer", - "description": "Lower limit USDT\n" - }, - "maxLeverage": { - "type": "integer", - "description": "Max leverage\n" - }, - "initialMargin": { - "type": "number", - "description": "Initial margin rate\n" - }, - "maintainMargin": { - "type": "number", - "description": "Maintenance margin rate\n" - } - }, - "required": [ - "symbol", - "level", - "maxRiskLimit", - "minRiskLimit", - "maxLeverage", - "initialMargin", - "maintainMargin" - ] - } - } - }, - "required": [ - "code", - "data" - ] - } - } - } - } - }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470263", - "x-abandon": "normal", - "x-domain": "Futures", - "x-api-channel": "Private", - "x-api-permission": "Futures", - "x-api-rate-limit-pool": "Public", - "x-sdk-service": "Futures", - "x-sdk-sub-service": "Positions", - "x-sdk-method-name": "getIsolatedMarginRiskLimit", - "x-sdk-method-description": "This interface can be used to obtain information about risk limit level of a specific contract(Only valid for isolated Margin).", - "x-api-rate-limit": 5, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": [\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"level\\\": 1,\\n \\\"maxRiskLimit\\\": 100000,\\n \\\"minRiskLimit\\\": 0,\\n \\\"maxLeverage\\\": 125,\\n \\\"initialMargin\\\": 0.008,\\n \\\"maintainMargin\\\": 0.004\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"level\\\": 2,\\n \\\"maxRiskLimit\\\": 500000,\\n \\\"minRiskLimit\\\": 100000,\\n \\\"maxLeverage\\\": 100,\\n \\\"initialMargin\\\": 0.01,\\n \\\"maintainMargin\\\": 0.005\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"level\\\": 3,\\n \\\"maxRiskLimit\\\": 1000000,\\n \\\"minRiskLimit\\\": 500000,\\n \\\"maxLeverage\\\": 75,\\n \\\"initialMargin\\\": 0.014,\\n \\\"maintainMargin\\\": 0.007\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"level\\\": 4,\\n \\\"maxRiskLimit\\\": 2000000,\\n \\\"minRiskLimit\\\": 1000000,\\n \\\"maxLeverage\\\": 50,\\n \\\"initialMargin\\\": 0.02,\\n \\\"maintainMargin\\\": 0.01\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"level\\\": 5,\\n \\\"maxRiskLimit\\\": 3000000,\\n \\\"minRiskLimit\\\": 2000000,\\n \\\"maxLeverage\\\": 30,\\n \\\"initialMargin\\\": 0.034,\\n \\\"maintainMargin\\\": 0.017\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"level\\\": 6,\\n \\\"maxRiskLimit\\\": 5000000,\\n \\\"minRiskLimit\\\": 3000000,\\n \\\"maxLeverage\\\": 20,\\n \\\"initialMargin\\\": 0.05,\\n \\\"maintainMargin\\\": 0.025\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"level\\\": 7,\\n \\\"maxRiskLimit\\\": 8000000,\\n \\\"minRiskLimit\\\": 5000000,\\n \\\"maxLeverage\\\": 10,\\n \\\"initialMargin\\\": 0.1,\\n \\\"maintainMargin\\\": 0.05\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"level\\\": 8,\\n \\\"maxRiskLimit\\\": 12000000,\\n \\\"minRiskLimit\\\": 8000000,\\n \\\"maxLeverage\\\": 5,\\n \\\"initialMargin\\\": 0.2,\\n \\\"maintainMargin\\\": 0.1\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"level\\\": 9,\\n \\\"maxRiskLimit\\\": 20000000,\\n \\\"minRiskLimit\\\": 12000000,\\n \\\"maxLeverage\\\": 4,\\n \\\"initialMargin\\\": 0.25,\\n \\\"maintainMargin\\\": 0.125\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"level\\\": 10,\\n \\\"maxRiskLimit\\\": 30000000,\\n \\\"minRiskLimit\\\": 20000000,\\n \\\"maxLeverage\\\": 3,\\n \\\"initialMargin\\\": 0.334,\\n \\\"maintainMargin\\\": 0.167\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"level\\\": 11,\\n \\\"maxRiskLimit\\\": 40000000,\\n \\\"minRiskLimit\\\": 30000000,\\n \\\"maxLeverage\\\": 2,\\n \\\"initialMargin\\\": 0.5,\\n \\\"maintainMargin\\\": 0.25\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"level\\\": 12,\\n \\\"maxRiskLimit\\\": 50000000,\\n \\\"minRiskLimit\\\": 40000000,\\n \\\"maxLeverage\\\": 1,\\n \\\"initialMargin\\\": 1.0,\\n \\\"maintainMargin\\\": 0.5\\n }\\n ]\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDTM\\\"}" - } - }, - "/api/v1/position": { - "get": { - "summary": "Get Position Details", - "deprecated": false, - "description": "Get the position details of a specified position.", - "tags": [], - "parameters": [ - { - "name": "symbol", - "in": "query", - "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) ", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "data": { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "Position ID\n" + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Position ID\n" }, "symbol": { "type": "string", @@ -503,77 +612,6 @@ "x-request-example": "{\\\"symbol\\\": \\\"example_string_default_value\\\"}" } }, - "/api/v1/position/risk-limit-level/change": { - "post": { - "summary": "Modify Isolated Margin Risk Limit", - "deprecated": false, - "description": "This interface can be used to obtain information about risk limit level of a specific contract(Only valid for isolated Margin).", - "tags": [], - "parameters": [], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "data": { - "type": "boolean", - "description": "To adjust the level will cancel the open order, the response can only indicate whether the submit of the adjustment request is successful or not.\n" - } - }, - "required": [ - "code", - "data" - ] - } - } - } - } - }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470264", - "x-abandon": "normal", - "x-domain": "Futures", - "x-api-channel": "Private", - "x-api-permission": "Futures", - "x-api-rate-limit-pool": "Futures", - "x-sdk-service": "Futures", - "x-sdk-sub-service": "Positions", - "x-sdk-method-name": "modifyIsolatedMarginRiskLimt", - "x-sdk-method-description": "This interface can be used to obtain information about risk limit level of a specific contract(Only valid for isolated Margin).", - "x-api-rate-limit": 5, - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "symbol": { - "type": "string", - "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) " - }, - "level": { - "type": "integer", - "description": "level" - } - }, - "required": [ - "symbol", - "level" - ] - }, - "example": "{\n \"symbol\" : \"XBTUSDTM\",\n \"level\" : 2\n}" - } - } - }, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": true\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDTM\\\", \\\"level\\\": 2}" - } - }, "/api/v1/positions": { "get": { "summary": "Get Position List", @@ -1112,13 +1150,23 @@ "x-request-example": "{\\\"symbol\\\": \\\"example_string_default_value\\\", \\\"from\\\": 123456, \\\"to\\\": 123456, \\\"limit\\\": 10, \\\"pageId\\\": 1}" } }, - "/api/v1/margin/withdrawMargin": { - "post": { - "summary": "Remove Isolated Margin", + "/api/v1/margin/maxWithdrawMargin": { + "get": { + "summary": "Get Max Withdraw Margin", "deprecated": false, - "description": "Remove Isolated Margin Manually.", + "description": "This interface can query the maximum amount of margin that the current position supports withdrawal.", "tags": [], - "parameters": [], + "parameters": [ + { + "name": "symbol", + "in": "query", + "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) ", + "required": true, + "schema": { + "type": "string" + } + } + ], "responses": { "200": { "description": "", @@ -1132,7 +1180,7 @@ }, "data": { "type": "string", - "description": "The size of the position deposited. If it is USDT-margin, it represents the amount of USDT. If it is coin-margin, this value represents the number of coins\n" + "description": "The size of the position that can be deposited. If it is USDT-margin, it represents the amount of USDT. If it is coin-margin, this value represents the number of coins\n" } }, "required": [ @@ -1144,7 +1192,7 @@ } } }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470256", + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470258", "x-abandon": "normal", "x-domain": "Futures", "x-api-channel": "Private", @@ -1152,44 +1200,30 @@ "x-api-rate-limit-pool": "Futures", "x-sdk-service": "Futures", "x-sdk-sub-service": "Positions", - "x-sdk-method-name": "RemoveIsolatedMargin", - "x-sdk-method-description": "Remove Isolated Margin Manually.", + "x-sdk-method-name": "GetMaxWithdrawMargin", + "x-sdk-method-description": "This interface can query the maximum amount of margin that the current position supports withdrawal.", "x-api-rate-limit": 10, - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "symbol": { - "type": "string", - "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) " - }, - "withdrawAmount": { - "type": "string", - "description": "The size of the position that can be deposited. If it is USDT-margin, it represents the amount of USDT. If it is coin-margin, this value represents the number of coins\n" - } - }, - "required": [ - "symbol", - "withdrawAmount" - ] - }, - "example": "{\n \"symbol\": \"XBTUSDTM\",\n \"withdrawAmount\": \"0.0000001\"\n}" - } - } - }, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": \\\"0.1\\\"\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDTM\\\", \\\"withdrawAmount\\\": \\\"0.0000001\\\"}" + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": \\\"21.1135719252\\\"\\n}", + "x-request-example": "{\\\"symbol\\\": \\\"example_string_default_value\\\"}" } }, - "/api/v1/position/margin/deposit-margin": { - "post": { - "summary": "Add Isolated Margin", + "/api/v2/getCrossUserLeverage": { + "get": { + "summary": "Get Cross Margin Leverage", "deprecated": false, - "description": "Add Isolated Margin Manually.", + "description": "This interface can query the current symbol’s cross-margin leverage multiple.", "tags": [], - "parameters": [], + "parameters": [ + { + "name": "symbol", + "in": "query", + "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) ", + "required": true, + "schema": { + "type": "string" + } + } + ], "responses": { "200": { "description": "", @@ -1204,52 +1238,194 @@ "data": { "type": "object", "properties": { - "id": { - "type": "string", - "description": "Position ID" - }, "symbol": { "type": "string", "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) " }, - "autoDeposit": { - "type": "boolean", - "description": "Auto deposit margin or not" - }, - "maintMarginReq": { - "type": "number", - "description": "Maintenance margin requirement\n\n" - }, - "riskLimit": { - "type": "integer", - "description": "Risk limit\n" - }, - "realLeverage": { - "type": "number", - "description": "Leverage o the order" - }, - "crossMode": { - "type": "boolean", - "description": "Cross mode or not" - }, - "delevPercentage": { - "type": "number", - "description": "ADL ranking percentile" - }, - "openingTimestamp": { - "type": "integer", - "description": "Open time", - "format": "int64" - }, - "currentTimestamp": { - "type": "integer", - "format": "int64", - "description": "Current timestamp\n" - }, - "currentQty": { - "type": "integer", - "description": "Current postion quantity" - }, + "leverage": { + "type": "string", + "description": "Leverage multiple" + } + }, + "required": [ + "symbol", + "leverage" + ] + } + }, + "required": [ + "code", + "data" + ] + } + } + } + } + }, + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470260", + "x-abandon": "normal", + "x-domain": "Futures", + "x-api-channel": "Private", + "x-api-permission": "Futures", + "x-api-rate-limit-pool": "Futures", + "x-sdk-service": "Futures", + "x-sdk-sub-service": "Positions", + "x-sdk-method-name": "getCrossMarginLeverage", + "x-sdk-method-description": "This interface can query the current symbol’s cross-margin leverage multiple.", + "x-api-rate-limit": 2, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"leverage\\\": \\\"3\\\"\\n }\\n}", + "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDTM\\\"}" + } + }, + "/api/v2/changeCrossUserLeverage": { + "post": { + "summary": "Modify Cross Margin Leverage", + "deprecated": false, + "description": "This interface can modify the current symbol’s cross-margin leverage multiple.", + "tags": [], + "parameters": [], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "object", + "properties": { + "symbol": { + "type": "string" + }, + "leverage": { + "type": "string" + } + }, + "required": [ + "symbol", + "leverage" + ] + } + }, + "required": [ + "code", + "data" + ] + } + } + } + } + }, + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470261", + "x-abandon": "normal", + "x-domain": "Futures", + "x-api-channel": "Private", + "x-api-permission": "Futures", + "x-api-rate-limit-pool": "Futures", + "x-sdk-service": "Futures", + "x-sdk-sub-service": "Positions", + "x-sdk-method-name": "ModifyMarginLeverage", + "x-sdk-method-description": "This interface can modify the current symbol’s cross-margin leverage multiple.", + "x-api-rate-limit": 2, + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "symbol": { + "type": "string", + "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) " + }, + "leverage": { + "type": "string", + "description": "Leverage multiple" + } + }, + "required": [ + "symbol", + "leverage" + ] + }, + "example": "{\n \"symbol\": \"XBTUSDTM\",\n \"leverage\" : \"10\"\n}" + } + } + }, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"leverage\\\": \\\"3\\\"\\n }\\n}", + "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDTM\\\", \\\"leverage\\\": \\\"10\\\"}" + } + }, + "/api/v1/position/margin/deposit-margin": { + "post": { + "summary": "Add Isolated Margin", + "deprecated": false, + "description": "Add Isolated Margin Manually.", + "tags": [], + "parameters": [], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Position ID" + }, + "symbol": { + "type": "string", + "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) " + }, + "autoDeposit": { + "type": "boolean", + "description": "Auto deposit margin or not" + }, + "maintMarginReq": { + "type": "number", + "description": "Maintenance margin requirement\n\n" + }, + "riskLimit": { + "type": "integer", + "description": "Risk limit\n" + }, + "realLeverage": { + "type": "number", + "description": "Leverage o the order" + }, + "crossMode": { + "type": "boolean", + "description": "Cross mode or not" + }, + "delevPercentage": { + "type": "number", + "description": "ADL ranking percentile" + }, + "openingTimestamp": { + "type": "integer", + "description": "Open time", + "format": "int64" + }, + "currentTimestamp": { + "type": "integer", + "format": "int64", + "description": "Current timestamp\n" + }, + "currentQty": { + "type": "integer", + "description": "Current postion quantity" + }, "currentCost": { "type": "number", "description": "Current postion value" @@ -1449,23 +1625,13 @@ "x-request-example": "{\\\"symbol\\\": \\\"string\\\", \\\"margin\\\": 0, \\\"bizNo\\\": \\\"string\\\"}" } }, - "/api/v1/margin/maxWithdrawMargin": { - "get": { - "summary": "Get Max Withdraw Margin", + "/api/v1/margin/withdrawMargin": { + "post": { + "summary": "Remove Isolated Margin", "deprecated": false, - "description": "This interface can query the maximum amount of margin that the current position supports withdrawal.", + "description": "Remove Isolated Margin Manually.", "tags": [], - "parameters": [ - { - "name": "symbol", - "in": "query", - "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) ", - "required": true, - "schema": { - "type": "string" - } - } - ], + "parameters": [], "responses": { "200": { "description": "", @@ -1479,7 +1645,7 @@ }, "data": { "type": "string", - "description": "The size of the position that can be deposited. If it is USDT-margin, it represents the amount of USDT. If it is coin-margin, this value represents the number of coins\n" + "description": "The size of the position deposited. If it is USDT-margin, it represents the amount of USDT. If it is coin-margin, this value represents the number of coins\n" } }, "required": [ @@ -1491,7 +1657,7 @@ } } }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470258", + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470256", "x-abandon": "normal", "x-domain": "Futures", "x-api-channel": "Private", @@ -1499,23 +1665,47 @@ "x-api-rate-limit-pool": "Futures", "x-sdk-service": "Futures", "x-sdk-sub-service": "Positions", - "x-sdk-method-name": "GetMaxWithdrawMargin", - "x-sdk-method-description": "This interface can query the maximum amount of margin that the current position supports withdrawal.", + "x-sdk-method-name": "RemoveIsolatedMargin", + "x-sdk-method-description": "Remove Isolated Margin Manually.", "x-api-rate-limit": 10, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": \\\"21.1135719252\\\"\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"example_string_default_value\\\"}" + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "symbol": { + "type": "string", + "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) " + }, + "withdrawAmount": { + "type": "string", + "description": "The size of the position that can be deposited. If it is USDT-margin, it represents the amount of USDT. If it is coin-margin, this value represents the number of coins\n" + } + }, + "required": [ + "symbol", + "withdrawAmount" + ] + }, + "example": "{\n \"symbol\": \"XBTUSDTM\",\n \"withdrawAmount\": \"0.0000001\"\n}" + } + } + }, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": \\\"0.1\\\"\\n}", + "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDTM\\\", \\\"withdrawAmount\\\": \\\"0.0000001\\\"}" } }, - "/api/v2/position/getMarginMode": { + "/api/v1/contracts/risk-limit/{symbol}": { "get": { - "summary": "Get Margin Mode", + "summary": "Get Isolated Margin Risk Limit", "deprecated": false, - "description": "This interface can query the margin mode of the current symbol.", + "description": "This interface can be used to obtain information about risk limit level of a specific contract(Only valid for isolated Margin).", "tags": [], "parameters": [ { "name": "symbol", - "in": "query", + "in": "path", "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) ", "required": true, "schema": { @@ -1535,107 +1725,49 @@ "type": "string" }, "data": { - "type": "object", - "properties": { - "symbol": { - "type": "string", - "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) " - }, - "marginMode": { - "type": "string", - "description": "Margin mode: ISOLATED (isolated), CROSS (cross margin).", - "enum": [ - "ISOLATED", - "CROSS" - ], - "x-api-enum": [ - { - "value": "ISOLATED", - "name": "ISOLATED", - "description": "isolated margin" - }, - { - "value": "CROSS", - "name": "CROSS", - "description": "cross margin" - } - ] - } - }, - "required": [ - "symbol", - "marginMode" - ] - } - }, - "required": [ - "code", - "data" - ] - } - } - } - } - }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470259", - "x-abandon": "normal", - "x-domain": "Futures", - "x-api-channel": "Private", - "x-api-permission": "Futures", - "x-api-rate-limit-pool": "Futures", - "x-sdk-service": "Futures", - "x-sdk-sub-service": "Positions", - "x-sdk-method-name": "getMarginMode", - "x-sdk-method-description": "This interface can query the margin mode of the current symbol.", - "x-api-rate-limit": 2, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"marginMode\\\": \\\"ISOLATED\\\"\\n }\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDTM\\\"}" - } - }, - "/api/v2/getCrossUserLeverage": { - "get": { - "summary": "Get Cross Margin Leverage", - "deprecated": false, - "description": "This interface can query the current symbol’s cross-margin leverage multiple.", - "tags": [], - "parameters": [ - { - "name": "symbol", - "in": "query", - "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) ", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "data": { - "type": "object", - "properties": { - "symbol": { - "type": "string", - "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) " + "type": "array", + "items": { + "type": "object", + "properties": { + "symbol": { + "type": "string", + "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) " + }, + "level": { + "type": "integer", + "description": "level\n" + }, + "maxRiskLimit": { + "type": "integer", + "description": "Upper limit USDT(includes)\n" + }, + "minRiskLimit": { + "type": "integer", + "description": "Lower limit USDT\n" + }, + "maxLeverage": { + "type": "integer", + "description": "Max leverage\n" + }, + "initialMargin": { + "type": "number", + "description": "Initial margin rate\n" + }, + "maintainMargin": { + "type": "number", + "description": "Maintenance margin rate\n" + } }, - "leverage": { - "type": "string", - "description": "Leverage multiple" - } - }, - "required": [ - "symbol", - "leverage" - ] + "required": [ + "symbol", + "level", + "maxRiskLimit", + "minRiskLimit", + "maxLeverage", + "initialMargin", + "maintainMargin" + ] + } } }, "required": [ @@ -1647,26 +1779,26 @@ } } }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470260", + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470263", "x-abandon": "normal", "x-domain": "Futures", "x-api-channel": "Private", "x-api-permission": "Futures", - "x-api-rate-limit-pool": "Futures", + "x-api-rate-limit-pool": "Public", "x-sdk-service": "Futures", "x-sdk-sub-service": "Positions", - "x-sdk-method-name": "getCrossMarginLeverage", - "x-sdk-method-description": "This interface can query the current symbol’s cross-margin leverage multiple.", - "x-api-rate-limit": 2, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"leverage\\\": \\\"3\\\"\\n }\\n}", + "x-sdk-method-name": "getIsolatedMarginRiskLimit", + "x-sdk-method-description": "This interface can be used to obtain information about risk limit level of a specific contract(Only valid for isolated Margin).", + "x-api-rate-limit": 5, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": [\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"level\\\": 1,\\n \\\"maxRiskLimit\\\": 100000,\\n \\\"minRiskLimit\\\": 0,\\n \\\"maxLeverage\\\": 125,\\n \\\"initialMargin\\\": 0.008,\\n \\\"maintainMargin\\\": 0.004\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"level\\\": 2,\\n \\\"maxRiskLimit\\\": 500000,\\n \\\"minRiskLimit\\\": 100000,\\n \\\"maxLeverage\\\": 100,\\n \\\"initialMargin\\\": 0.01,\\n \\\"maintainMargin\\\": 0.005\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"level\\\": 3,\\n \\\"maxRiskLimit\\\": 1000000,\\n \\\"minRiskLimit\\\": 500000,\\n \\\"maxLeverage\\\": 75,\\n \\\"initialMargin\\\": 0.014,\\n \\\"maintainMargin\\\": 0.007\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"level\\\": 4,\\n \\\"maxRiskLimit\\\": 2000000,\\n \\\"minRiskLimit\\\": 1000000,\\n \\\"maxLeverage\\\": 50,\\n \\\"initialMargin\\\": 0.02,\\n \\\"maintainMargin\\\": 0.01\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"level\\\": 5,\\n \\\"maxRiskLimit\\\": 3000000,\\n \\\"minRiskLimit\\\": 2000000,\\n \\\"maxLeverage\\\": 30,\\n \\\"initialMargin\\\": 0.034,\\n \\\"maintainMargin\\\": 0.017\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"level\\\": 6,\\n \\\"maxRiskLimit\\\": 5000000,\\n \\\"minRiskLimit\\\": 3000000,\\n \\\"maxLeverage\\\": 20,\\n \\\"initialMargin\\\": 0.05,\\n \\\"maintainMargin\\\": 0.025\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"level\\\": 7,\\n \\\"maxRiskLimit\\\": 8000000,\\n \\\"minRiskLimit\\\": 5000000,\\n \\\"maxLeverage\\\": 10,\\n \\\"initialMargin\\\": 0.1,\\n \\\"maintainMargin\\\": 0.05\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"level\\\": 8,\\n \\\"maxRiskLimit\\\": 12000000,\\n \\\"minRiskLimit\\\": 8000000,\\n \\\"maxLeverage\\\": 5,\\n \\\"initialMargin\\\": 0.2,\\n \\\"maintainMargin\\\": 0.1\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"level\\\": 9,\\n \\\"maxRiskLimit\\\": 20000000,\\n \\\"minRiskLimit\\\": 12000000,\\n \\\"maxLeverage\\\": 4,\\n \\\"initialMargin\\\": 0.25,\\n \\\"maintainMargin\\\": 0.125\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"level\\\": 10,\\n \\\"maxRiskLimit\\\": 30000000,\\n \\\"minRiskLimit\\\": 20000000,\\n \\\"maxLeverage\\\": 3,\\n \\\"initialMargin\\\": 0.334,\\n \\\"maintainMargin\\\": 0.167\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"level\\\": 11,\\n \\\"maxRiskLimit\\\": 40000000,\\n \\\"minRiskLimit\\\": 30000000,\\n \\\"maxLeverage\\\": 2,\\n \\\"initialMargin\\\": 0.5,\\n \\\"maintainMargin\\\": 0.25\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"level\\\": 12,\\n \\\"maxRiskLimit\\\": 50000000,\\n \\\"minRiskLimit\\\": 40000000,\\n \\\"maxLeverage\\\": 1,\\n \\\"initialMargin\\\": 1.0,\\n \\\"maintainMargin\\\": 0.5\\n }\\n ]\\n}", "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDTM\\\"}" } }, - "/api/v2/changeCrossUserLeverage": { + "/api/v1/position/risk-limit-level/change": { "post": { - "summary": "Modify Cross Margin Leverage", + "summary": "Modify Isolated Margin Risk Limit", "deprecated": false, - "description": "This interface can modify the current symbol’s cross-margin leverage multiple.", + "description": "This interface can be used to obtain information about risk limit level of a specific contract(Only valid for isolated Margin).", "tags": [], "parameters": [], "responses": { @@ -1681,19 +1813,8 @@ "type": "string" }, "data": { - "type": "object", - "properties": { - "symbol": { - "type": "string" - }, - "leverage": { - "type": "string" - } - }, - "required": [ - "symbol", - "leverage" - ] + "type": "boolean", + "description": "To adjust the level will cancel the open order, the response can only indicate whether the submit of the adjustment request is successful or not.\n" } }, "required": [ @@ -1705,7 +1826,7 @@ } } }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470261", + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470264", "x-abandon": "normal", "x-domain": "Futures", "x-api-channel": "Private", @@ -1713,9 +1834,9 @@ "x-api-rate-limit-pool": "Futures", "x-sdk-service": "Futures", "x-sdk-sub-service": "Positions", - "x-sdk-method-name": "ModifyMarginLeverage", - "x-sdk-method-description": "This interface can modify the current symbol’s cross-margin leverage multiple.", - "x-api-rate-limit": 2, + "x-sdk-method-name": "modifyIsolatedMarginRiskLimt", + "x-sdk-method-description": "This interface can be used to obtain information about risk limit level of a specific contract(Only valid for isolated Margin).", + "x-api-rate-limit": 5, "requestBody": { "content": { "application/json": { @@ -1726,143 +1847,22 @@ "type": "string", "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) " }, - "leverage": { - "type": "string", - "description": "Leverage multiple" - } - }, - "required": [ - "symbol", - "leverage" - ] - }, - "example": "{\n \"symbol\": \"XBTUSDTM\",\n \"leverage\" : \"10\"\n}" - } - } - }, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"leverage\\\": \\\"3\\\"\\n }\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDTM\\\", \\\"leverage\\\": \\\"10\\\"}" - } - }, - "/api/v2/position/changeMarginMode": { - "post": { - "summary": "Switch Margin Mode", - "deprecated": false, - "description": "This interface can modify the margin mode of the current symbol.", - "tags": [], - "parameters": [], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "data": { - "type": "object", - "properties": { - "symbol": { - "type": "string", - "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) " - }, - "marginMode": { - "type": "string", - "description": "Margin mode: ISOLATED (isolated), CROSS (cross margin).", - "enum": [ - "ISOLATED", - "CROSS" - ], - "x-api-enum": [ - { - "value": "ISOLATED", - "name": "ISOLATED", - "description": "isolated margin" - }, - { - "value": "CROSS", - "name": "CROSS", - "description": "cross margin" - } - ] - } - }, - "required": [ - "symbol", - "marginMode" - ] - } - }, - "required": [ - "code", - "data" - ] - } - } - } - } - }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470262", - "x-abandon": "normal", - "x-domain": "Futures", - "x-api-channel": "Private", - "x-api-permission": "Futures", - "x-api-rate-limit-pool": "Futures", - "x-sdk-service": "Futures", - "x-sdk-sub-service": "Positions", - "x-sdk-method-name": "switchMarginMode", - "x-sdk-method-description": "This interface can modify the margin mode of the current symbol.", - "x-api-rate-limit": 2, - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "symbol": { - "type": "string", - "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) ", - "example": [ - "XBTUSDTM", - "XBTUSDCM", - "ETHUSDTM" - ] - }, - "marginMode": { - "type": "string", - "description": "Modified margin model: ISOLATED (isolated), CROSS (cross margin).", - "enum": [ - "ISOLATED", - "CROSS" - ], - "x-api-enum": [ - { - "value": "ISOLATED", - "name": "ISOLATED", - "description": "Isolated Margin Mode" - }, - { - "value": "CROSS", - "name": "CROSS", - "description": "Cross Margin MOde" - } - ] + "level": { + "type": "integer", + "description": "level" } }, "required": [ "symbol", - "marginMode" + "level" ] }, - "example": "{\n \"symbol\": \"XBTUSDTM\",\n \"marginMode\": \"ISOLATED\"\n}" + "example": "{\n \"symbol\" : \"XBTUSDTM\",\n \"level\" : 2\n}" } } }, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"marginMode\\\": \\\"ISOLATED\\\"\\n }\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDTM\\\", \\\"marginMode\\\": \\\"ISOLATED\\\"}" + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": true\\n}", + "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDTM\\\", \\\"level\\\": 2}" } }, "/api/v1/position/margin/auto-deposit-status": { diff --git a/spec/rest/api/openapi-margin-credit.json b/spec/rest/api/openapi-margin-credit.json index 53b51a44..7693db37 100644 --- a/spec/rest/api/openapi-margin-credit.json +++ b/spec/rest/api/openapi-margin-credit.json @@ -118,6 +118,253 @@ "x-request-example": "{\\\"currency\\\": \\\"BTC\\\"}" } }, + "/api/v3/project/marketInterestRate": { + "get": { + "summary": "Get Loan Market Interest Rate", + "deprecated": false, + "description": "This API endpoint is used to get the interest rates of the margin lending market over the past 7 days.", + "tags": [], + "parameters": [ + { + "name": "currency", + "in": "query", + "description": "currency", + "required": true, + "schema": { + "type": "string", + "example": [ + "BTC", + "ETH", + "KCS" + ] + } + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "array", + "items": { + "type": "object", + "properties": { + "time": { + "type": "string", + "description": "Time: YYYYMMDDHH00" + }, + "marketInterestRate": { + "type": "string", + "description": "Market lending rate" + } + }, + "required": [ + "time", + "marketInterestRate" + ] + } + } + }, + "required": [ + "code", + "data" + ] + } + } + } + } + }, + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470215", + "x-abandon": "normal", + "x-domain": "Spot", + "x-api-channel": "Public", + "x-api-permission": "NULL", + "x-api-rate-limit-pool": "Public", + "x-sdk-service": "Margin", + "x-sdk-sub-service": "Credit", + "x-sdk-method-name": "getLoanMarketInterestRate", + "x-sdk-method-description": "This API endpoint is used to get the interest rates of the margin lending market over the past 7 days.", + "x-api-rate-limit": 5, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": [\\n {\\n \\\"time\\\": \\\"202410170000\\\",\\n \\\"marketInterestRate\\\": \\\"0.005\\\"\\n },\\n {\\n \\\"time\\\": \\\"202410170100\\\",\\n \\\"marketInterestRate\\\": \\\"0.005\\\"\\n }\\n ]\\n}", + "x-request-example": "{\\\"currency\\\": \\\"BTC\\\"}" + } + }, + "/api/v3/purchase": { + "post": { + "summary": "Purchase", + "deprecated": false, + "description": "Invest credit in the market and earn interest", + "tags": [], + "parameters": [], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "object", + "properties": { + "orderNo": { + "type": "string", + "description": "Purchase order id" + } + }, + "required": [ + "orderNo" + ] + } + }, + "required": [ + "code", + "data" + ] + } + } + } + } + }, + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470216", + "x-abandon": "normal", + "x-domain": "Spot", + "x-api-channel": "Private", + "x-api-permission": "Margin", + "x-api-rate-limit-pool": "Spot", + "x-sdk-service": "Margin", + "x-sdk-sub-service": "Credit", + "x-sdk-method-name": "purchase", + "x-sdk-method-description": "Invest credit in the market and earn interest", + "x-api-rate-limit": 15, + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "currency": { + "type": "string", + "description": "Currency", + "example": [ + "BTC", + "ETH", + "USDT" + ] + }, + "size": { + "type": "string", + "description": "purchase amount" + }, + "interestRate": { + "type": "string", + "description": "purchase interest rate" + } + }, + "required": [ + "currency", + "size", + "interestRate" + ] + }, + "example": "{\n \"currency\": \"BTC\",\n \"size\": \"0.001\",\n \"interestRate\": \"0.1\"\n}" + } + } + }, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"orderNo\\\": \\\"671bafa804c26d000773c533\\\"\\n }\\n}", + "x-request-example": "{\\\"currency\\\": \\\"BTC\\\", \\\"size\\\": \\\"0.001\\\", \\\"interestRate\\\": \\\"0.1\\\"}" + } + }, + "/api/v3/lend/purchase/update": { + "post": { + "summary": "Modify Purchase", + "deprecated": false, + "description": "This API endpoint is used to update the interest rates of subscription orders, which will take effect at the beginning of the next hour.,Please ensure that the funds are in the main(funding) account", + "tags": [], + "parameters": [], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "string" + } + }, + "required": [ + "code", + "data" + ] + } + } + } + } + }, + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470217", + "x-abandon": "normal", + "x-domain": "Spot", + "x-api-channel": "Private", + "x-api-permission": "Margin", + "x-api-rate-limit-pool": "Spot", + "x-sdk-service": "Margin", + "x-sdk-sub-service": "Credit", + "x-sdk-method-name": "modifyPurchase", + "x-sdk-method-description": "This API endpoint is used to update the interest rates of subscription orders, which will take effect at the beginning of the next hour.,Please ensure that the funds are in the main(funding) account", + "x-api-rate-limit": 10, + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "currency": { + "type": "string", + "description": "Currency", + "example": [ + "BTC", + "ETH", + "USDT" + ] + }, + "interestRate": { + "type": "string", + "description": "Modified purchase interest rate" + }, + "purchaseOrderNo": { + "type": "string", + "description": "Purchase order id" + } + }, + "required": [ + "currency", + "purchaseOrderNo", + "interestRate" + ] + }, + "example": "{\n \"currency\": \"BTC\",\n \"purchaseOrderNo\": \"671bafa804c26d000773c533\",\n \"interestRate\": \"0.09\"\n}" + } + } + }, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": null\\n}", + "x-request-example": "{\\\"currency\\\": \\\"BTC\\\", \\\"purchaseOrderNo\\\": \\\"671bafa804c26d000773c533\\\", \\\"interestRate\\\": \\\"0.09\\\"}" + } + }, "/api/v3/purchase/orders": { "get": { "summary": "Get Purchase Orders", @@ -332,13 +579,102 @@ "x-request-example": "{\\\"currency\\\": \\\"BTC\\\", \\\"status\\\": \\\"DONE\\\", \\\"purchaseOrderNo\\\": \\\"example_string_default_value\\\", \\\"currentPage\\\": 1, \\\"pageSize\\\": 50}" } }, - "/api/v3/redeem/orders": { - "get": { - "summary": "Get Redeem Orders", + "/api/v3/redeem": { + "post": { + "summary": "Redeem", "deprecated": false, - "description": "This API endpoint provides pagination query for the redeem orders.", + "description": "Redeem your loan order", "tags": [], - "parameters": [ + "parameters": [], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "object", + "properties": { + "orderNo": { + "type": "string", + "description": "Redeem order id" + } + }, + "required": [ + "orderNo" + ] + } + }, + "required": [ + "code", + "data" + ] + } + } + } + } + }, + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470218", + "x-abandon": "normal", + "x-domain": "Spot", + "x-api-channel": "Private", + "x-api-permission": "Margin", + "x-api-rate-limit-pool": "Spot", + "x-sdk-service": "Margin", + "x-sdk-sub-service": "Credit", + "x-sdk-method-name": "redeem", + "x-sdk-method-description": "Redeem your loan order", + "x-api-rate-limit": 15, + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "currency": { + "type": "string", + "description": "Currency", + "example": [ + "BTC", + "ETH", + "USDT" + ] + }, + "size": { + "type": "string", + "description": "Redemption amount" + }, + "purchaseOrderNo": { + "type": "string", + "description": "Purchase order id" + } + }, + "required": [ + "currency", + "size", + "purchaseOrderNo" + ] + }, + "example": "{\n \"currency\": \"BTC\",\n \"size\": \"0.001\",\n \"purchaseOrderNo\": \"671bafa804c26d000773c533\"\n}" + } + } + }, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"orderNo\\\": \\\"671bafa804c26d000773c533\\\"\\n }\\n}", + "x-request-example": "{\\\"currency\\\": \\\"BTC\\\", \\\"size\\\": \\\"0.001\\\", \\\"purchaseOrderNo\\\": \\\"671bafa804c26d000773c533\\\"}" + } + }, + "/api/v3/redeem/orders": { + "get": { + "summary": "Get Redeem Orders", + "deprecated": false, + "description": "This API endpoint provides pagination query for the redeem orders.", + "tags": [], + "parameters": [ { "name": "currency", "in": "query", @@ -523,342 +859,6 @@ "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"currentPage\\\": 1,\\n \\\"pageSize\\\": 10,\\n \\\"totalNum\\\": 1,\\n \\\"totalPage\\\": 1,\\n \\\"items\\\": [\\n {\\n \\\"currency\\\": \\\"BTC\\\",\\n \\\"purchaseOrderNo\\\": \\\"671bafa804c26d000773c533\\\",\\n \\\"redeemOrderNo\\\": \\\"671bb01004c26d000773c55c\\\",\\n \\\"redeemSize\\\": \\\"0.001\\\",\\n \\\"receiptSize\\\": \\\"0.001\\\",\\n \\\"applyTime\\\": null,\\n \\\"status\\\": \\\"DONE\\\"\\n }\\n ]\\n }\\n}", "x-request-example": "{\\\"currency\\\": \\\"BTC\\\", \\\"status\\\": \\\"DONE\\\", \\\"redeemOrderNo\\\": \\\"example_string_default_value\\\", \\\"currentPage\\\": 1, \\\"pageSize\\\": 50}" } - }, - "/api/v3/project/marketInterestRate": { - "get": { - "summary": "Get Loan Market Interest Rate", - "deprecated": false, - "description": "This API endpoint is used to get the interest rates of the margin lending market over the past 7 days.", - "tags": [], - "parameters": [ - { - "name": "currency", - "in": "query", - "description": "currency", - "required": true, - "schema": { - "type": "string", - "example": [ - "BTC", - "ETH", - "KCS" - ] - } - } - ], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "data": { - "type": "array", - "items": { - "type": "object", - "properties": { - "time": { - "type": "string", - "description": "Time: YYYYMMDDHH00" - }, - "marketInterestRate": { - "type": "string", - "description": "Market lending rate" - } - }, - "required": [ - "time", - "marketInterestRate" - ] - } - } - }, - "required": [ - "code", - "data" - ] - } - } - } - } - }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470215", - "x-abandon": "normal", - "x-domain": "Spot", - "x-api-channel": "Public", - "x-api-permission": "NULL", - "x-api-rate-limit-pool": "Public", - "x-sdk-service": "Margin", - "x-sdk-sub-service": "Credit", - "x-sdk-method-name": "getLoanMarketInterestRate", - "x-sdk-method-description": "This API endpoint is used to get the interest rates of the margin lending market over the past 7 days.", - "x-api-rate-limit": 5, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": [\\n {\\n \\\"time\\\": \\\"202410170000\\\",\\n \\\"marketInterestRate\\\": \\\"0.005\\\"\\n },\\n {\\n \\\"time\\\": \\\"202410170100\\\",\\n \\\"marketInterestRate\\\": \\\"0.005\\\"\\n }\\n ]\\n}", - "x-request-example": "{\\\"currency\\\": \\\"BTC\\\"}" - } - }, - "/api/v3/purchase": { - "post": { - "summary": "Purchase", - "deprecated": false, - "description": "Invest credit in the market and earn interest", - "tags": [], - "parameters": [], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "data": { - "type": "object", - "properties": { - "orderNo": { - "type": "string", - "description": "Purchase order id" - } - }, - "required": [ - "orderNo" - ] - } - }, - "required": [ - "code", - "data" - ] - } - } - } - } - }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470216", - "x-abandon": "normal", - "x-domain": "Spot", - "x-api-channel": "Private", - "x-api-permission": "Margin", - "x-api-rate-limit-pool": "Spot", - "x-sdk-service": "Margin", - "x-sdk-sub-service": "Credit", - "x-sdk-method-name": "purchase", - "x-sdk-method-description": "Invest credit in the market and earn interest", - "x-api-rate-limit": 15, - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "currency": { - "type": "string", - "description": "Currency", - "example": [ - "BTC", - "ETH", - "USDT" - ] - }, - "size": { - "type": "string", - "description": "purchase amount" - }, - "interestRate": { - "type": "string", - "description": "purchase interest rate" - } - }, - "required": [ - "currency", - "size", - "interestRate" - ] - }, - "example": "{\n \"currency\": \"BTC\",\n \"size\": \"0.001\",\n \"interestRate\": \"0.1\"\n}" - } - } - }, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"orderNo\\\": \\\"671bafa804c26d000773c533\\\"\\n }\\n}", - "x-request-example": "{\\\"currency\\\": \\\"BTC\\\", \\\"size\\\": \\\"0.001\\\", \\\"interestRate\\\": \\\"0.1\\\"}" - } - }, - "/api/v3/lend/purchase/update": { - "post": { - "summary": "Modify Purchase", - "deprecated": false, - "description": "This API endpoint is used to update the interest rates of subscription orders, which will take effect at the beginning of the next hour.,Please ensure that the funds are in the main(funding) account", - "tags": [], - "parameters": [], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "data": { - "type": "string" - } - }, - "required": [ - "code", - "data" - ] - } - } - } - } - }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470217", - "x-abandon": "normal", - "x-domain": "Spot", - "x-api-channel": "Private", - "x-api-permission": "Margin", - "x-api-rate-limit-pool": "Spot", - "x-sdk-service": "Margin", - "x-sdk-sub-service": "Credit", - "x-sdk-method-name": "modifyPurchase", - "x-sdk-method-description": "This API endpoint is used to update the interest rates of subscription orders, which will take effect at the beginning of the next hour.,Please ensure that the funds are in the main(funding) account", - "x-api-rate-limit": 10, - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "currency": { - "type": "string", - "description": "Currency", - "example": [ - "BTC", - "ETH", - "USDT" - ] - }, - "interestRate": { - "type": "string", - "description": "Modified purchase interest rate" - }, - "purchaseOrderNo": { - "type": "string", - "description": "Purchase order id" - } - }, - "required": [ - "currency", - "purchaseOrderNo", - "interestRate" - ] - }, - "example": "{\n \"currency\": \"BTC\",\n \"purchaseOrderNo\": \"671bafa804c26d000773c533\",\n \"interestRate\": \"0.09\"\n}" - } - } - }, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": null\\n}", - "x-request-example": "{\\\"currency\\\": \\\"BTC\\\", \\\"purchaseOrderNo\\\": \\\"671bafa804c26d000773c533\\\", \\\"interestRate\\\": \\\"0.09\\\"}" - } - }, - "/api/v3/redeem": { - "post": { - "summary": "Redeem", - "deprecated": false, - "description": "Redeem your loan order", - "tags": [], - "parameters": [], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "data": { - "type": "object", - "properties": { - "orderNo": { - "type": "string", - "description": "Redeem order id" - } - }, - "required": [ - "orderNo" - ] - } - }, - "required": [ - "code", - "data" - ] - } - } - } - } - }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470218", - "x-abandon": "normal", - "x-domain": "Spot", - "x-api-channel": "Private", - "x-api-permission": "Margin", - "x-api-rate-limit-pool": "Spot", - "x-sdk-service": "Margin", - "x-sdk-sub-service": "Credit", - "x-sdk-method-name": "redeem", - "x-sdk-method-description": "Redeem your loan order", - "x-api-rate-limit": 15, - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "currency": { - "type": "string", - "description": "Currency", - "example": [ - "BTC", - "ETH", - "USDT" - ] - }, - "size": { - "type": "string", - "description": "Redemption amount" - }, - "purchaseOrderNo": { - "type": "string", - "description": "Purchase order id" - } - }, - "required": [ - "currency", - "size", - "purchaseOrderNo" - ] - }, - "example": "{\n \"currency\": \"BTC\",\n \"size\": \"0.001\",\n \"purchaseOrderNo\": \"671bafa804c26d000773c533\"\n}" - } - } - }, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"orderNo\\\": \\\"671bafa804c26d000773c533\\\"\\n }\\n}", - "x-request-example": "{\\\"currency\\\": \\\"BTC\\\", \\\"size\\\": \\\"0.001\\\", \\\"purchaseOrderNo\\\": \\\"671bafa804c26d000773c533\\\"}" - } } }, "components": { diff --git a/spec/rest/api/openapi-margin-debit.json b/spec/rest/api/openapi-margin-debit.json index 20ebe1f3..e190d2bc 100644 --- a/spec/rest/api/openapi-margin-debit.json +++ b/spec/rest/api/openapi-margin-debit.json @@ -374,6 +374,117 @@ } }, "/api/v3/margin/repay": { + "post": { + "summary": "Repay", + "deprecated": false, + "description": "This API endpoint is used to initiate an application for cross or isolated margin repayment.", + "tags": [], + "parameters": [], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "object", + "properties": { + "timestamp": { + "type": "integer", + "format": "int64" + }, + "orderNo": { + "type": "string", + "description": "Repay Order Id" + }, + "actualSize": { + "type": "string", + "description": "Actual repay amount" + } + }, + "required": [ + "timestamp", + "orderNo", + "actualSize" + ] + } + }, + "required": [ + "code", + "data" + ] + } + } + } + } + }, + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470210", + "x-abandon": "normal", + "x-domain": "Spot", + "x-api-channel": "Private", + "x-api-permission": "Margin", + "x-api-rate-limit-pool": "Spot", + "x-sdk-service": "Margin", + "x-sdk-sub-service": "Debit", + "x-sdk-method-name": "repay", + "x-sdk-method-description": "This API endpoint is used to initiate an application for cross or isolated margin repayment.", + "x-api-rate-limit": 10, + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "currency": { + "type": "string", + "description": "currency", + "example": [ + "BTC", + "ETH", + "USDT" + ] + }, + "size": { + "type": "number", + "description": "Borrow amount" + }, + "symbol": { + "type": "string", + "description": "symbol, mandatory for isolated margin account", + "example": [ + "BTC-USDT", + "ETH-USDT", + "KCS-USDT" + ] + }, + "isIsolated": { + "type": "boolean", + "description": "true-isolated, false-cross; default is false", + "default": false + }, + "isHf": { + "type": "boolean", + "description": "true: high frequency borrowing, false: low frequency borrowing; default false", + "default": false + } + }, + "required": [ + "currency", + "size" + ] + }, + "example": "{\n \"currency\": \"USDT\",\n \"size\": 10\n}" + } + } + }, + "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"timestamp\\\":1729655606816,\\\"orderNo\\\":\\\"671873361d5bd400075096ad\\\",\\\"actualSize\\\":\\\"10\\\"}}", + "x-request-example": "{\\\"currency\\\": \\\"USDT\\\", \\\"size\\\": 10}" + }, "get": { "summary": "Get Repay History", "deprecated": false, @@ -610,117 +721,6 @@ "x-api-rate-limit": 15, "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"timestamp\\\":1729663471891,\\\"currentPage\\\":1,\\\"pageSize\\\":50,\\\"totalNum\\\":1,\\\"totalPage\\\":1,\\\"items\\\":[{\\\"orderNo\\\":\\\"671873361d5bd400075096ad\\\",\\\"symbol\\\":null,\\\"currency\\\":\\\"USDT\\\",\\\"size\\\":\\\"10\\\",\\\"principal\\\":\\\"9.99986518\\\",\\\"interest\\\":\\\"0.00013482\\\",\\\"status\\\":\\\"SUCCESS\\\",\\\"createdTime\\\":1729655606000}]}}", "x-request-example": "{\\\"currency\\\": \\\"BTC\\\", \\\"isIsolated\\\": true, \\\"symbol\\\": \\\"BTC-USDT\\\", \\\"orderNo\\\": \\\"example_string_default_value\\\", \\\"startTime\\\": 123456, \\\"endTime\\\": 123456, \\\"currentPage\\\": 1, \\\"pageSize\\\": 50}" - }, - "post": { - "summary": "Repay", - "deprecated": false, - "description": "This API endpoint is used to initiate an application for cross or isolated margin repayment.", - "tags": [], - "parameters": [], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "data": { - "type": "object", - "properties": { - "timestamp": { - "type": "integer", - "format": "int64" - }, - "orderNo": { - "type": "string", - "description": "Repay Order Id" - }, - "actualSize": { - "type": "string", - "description": "Actual repay amount" - } - }, - "required": [ - "timestamp", - "orderNo", - "actualSize" - ] - } - }, - "required": [ - "code", - "data" - ] - } - } - } - } - }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470210", - "x-abandon": "normal", - "x-domain": "Spot", - "x-api-channel": "Private", - "x-api-permission": "Margin", - "x-api-rate-limit-pool": "Spot", - "x-sdk-service": "Margin", - "x-sdk-sub-service": "Debit", - "x-sdk-method-name": "repay", - "x-sdk-method-description": "This API endpoint is used to initiate an application for cross or isolated margin repayment.", - "x-api-rate-limit": 10, - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "currency": { - "type": "string", - "description": "currency", - "example": [ - "BTC", - "ETH", - "USDT" - ] - }, - "size": { - "type": "number", - "description": "Borrow amount" - }, - "symbol": { - "type": "string", - "description": "symbol, mandatory for isolated margin account", - "example": [ - "BTC-USDT", - "ETH-USDT", - "KCS-USDT" - ] - }, - "isIsolated": { - "type": "boolean", - "description": "true-isolated, false-cross; default is false", - "default": false - }, - "isHf": { - "type": "boolean", - "description": "true: high frequency borrowing, false: low frequency borrowing; default false", - "default": false - } - }, - "required": [ - "currency", - "size" - ] - }, - "example": "{\n \"currency\": \"USDT\",\n \"size\": 10\n}" - } - } - }, - "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"timestamp\\\":1729655606816,\\\"orderNo\\\":\\\"671873361d5bd400075096ad\\\",\\\"actualSize\\\":\\\"10\\\"}}", - "x-request-example": "{\\\"currency\\\": \\\"USDT\\\", \\\"size\\\": 10}" } }, "/api/v3/margin/interest": { diff --git a/spec/rest/api/openapi-margin-order.json b/spec/rest/api/openapi-margin-order.json index 23e5ad69..03d6d122 100644 --- a/spec/rest/api/openapi-margin-order.json +++ b/spec/rest/api/openapi-margin-order.json @@ -7,37 +7,13 @@ }, "tags": [], "paths": { - "/api/v3/hf/margin/orders/{orderId}": { - "delete": { - "summary": "Cancel Order By OrderId", + "/api/v3/hf/margin/order": { + "post": { + "summary": "Add Order", "deprecated": false, - "description": "This endpoint can be used to cancel a margin order by orderId. This endpoint only sends cancellation requests. The results of the requests must be obtained by checking the order status or subscribing to websocket.", + "description": "Place order to the Cross-margin or Isolated-margin trading system, you can place two major types of orders: limit and market. Orders can only be placed if your account has sufficient funds. Once an order is placed, your funds will be put on hold for the duration of the order. The amount of funds on hold depends on the order type and parameters specified.", "tags": [], - "parameters": [ - { - "name": "orderId", - "in": "path", - "description": "The unique order id generated by the trading system", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "symbol", - "in": "query", - "description": "symbol", - "required": true, - "schema": { - "type": "string", - "example": [ - "BTC-USDT", - "ETH-USDT", - "KCS-USDT" - ] - } - } - ], + "parameters": [], "responses": { "200": { "description": "", @@ -54,11 +30,26 @@ "properties": { "orderId": { "type": "string", - "description": "order id" + "description": "The unique order id generated by the trading system,which can be used later for further actions such as canceling the order." + }, + "loanApplyId": { + "type": "string", + "description": "Borrow order id. The field is returned only after placing the order under the mode of Auto-Borrow." + }, + "borrowSize": { + "type": "string", + "description": "Borrowed amount. The field is returned only after placing the order under the mode of Auto-Borrow." + }, + "clientOid": { + "type": "string", + "description": "The user self-defined order id." } }, "required": [ - "orderId" + "orderId", + "borrowSize", + "clientOid", + "loanApplyId" ] } }, @@ -71,7 +62,7 @@ } } }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470195", + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470204", "x-abandon": "normal", "x-domain": "Spot", "x-api-channel": "Private", @@ -79,328 +70,249 @@ "x-api-rate-limit-pool": "Spot", "x-sdk-service": "Margin", "x-sdk-sub-service": "Order", - "x-sdk-method-name": "cancelOrderByOrderId", - "x-sdk-method-description": "This endpoint can be used to cancel a margin order by orderId. This endpoint only sends cancellation requests. The results of the requests must be obtained by checking the order status or subscribing to websocket.", + "x-sdk-method-name": "addOrder", + "x-sdk-method-description": "Place order to the Cross-margin or Isolated-margin trading system, you can place two major types of orders: limit and market. Orders can only be placed if your account has sufficient funds. Once an order is placed, your funds will be put on hold for the duration of the order. The amount of funds on hold depends on the order type and parameters specified.", "x-api-rate-limit": 5, - "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"orderId\\\":\\\"671663e02188630007e21c9c\\\"}}", - "x-request-example": "{\\\"orderId\\\": \\\"671663e02188630007e21c9c\\\", \\\"symbol\\\": \\\"BTC-USDT\\\"}" - }, - "get": { - "summary": "Get Order By OrderId", - "deprecated": false, - "description": "This endpoint can be used to obtain information for a single Margin order using the order id. After the user successfully places an order, the order is in Active state, and the user can use inOrderBook to determine whether the order has entered the order. Canceled or fully filled orders are marked as completed Done status.", - "tags": [], - "parameters": [ - { - "name": "symbol", - "in": "query", - "description": "symbol", - "required": true, - "schema": { - "type": "string", - "example": [ - "BTC-USDT", - "ETH-USDT", - "KCS-USDT" - ] - } - }, - { - "name": "orderId", - "in": "path", - "description": "The unique order id generated by the trading system", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "data": { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "The unique order id generated by the trading system" - }, - "symbol": { - "type": "string", - "description": "symbol", - "example": [ - "BTC-USDT", - "ETH-USDT", - "KCS-USDT" - ] - }, - "opType": { - "type": "string" - }, - "type": { - "type": "string", - "description": "Specify if the order is an 'limit' order or 'market' order. ", - "enum": [ - "limit", - "market" - ], - "x-api-enum": [ - { - "value": "limit", - "name": "", - "description": "" - }, - { - "value": "market", - "name": "", - "description": "" - } - ] - }, - "side": { - "type": "string", - "description": "Buy or sell", - "enum": [ - "buy", - "sell" - ], - "x-api-enum": [ - { - "value": "buy", - "name": "", - "description": "" - }, - { - "value": "sell", - "name": "", - "description": "" - } - ] - }, - "price": { - "type": "string", - "description": "Order price" - }, - "size": { - "type": "string", - "description": "Order size" - }, - "funds": { - "type": "string", - "description": "Order Funds" - }, - "dealSize": { - "type": "string", - "description": "Number of filled transactions" - }, - "dealFunds": { - "type": "string", - "description": "Funds of filled transactions" - }, - "fee": { - "type": "string", - "description": "[Handling fees](https://www.kucoin.com/docs-new/api-5327739)" - }, - "feeCurrency": { - "type": "string", - "description": "currency used to calculate trading fee" - }, - "stp": { - "type": "string", - "description": "[Self Trade Prevention](https://www.kucoin.com/docs-new/doc-338146) is divided into these strategies: CN, CO, CB , and DC", - "enum": [ - "DC", - "CO", - "CN", - "CB" - ], - "x-api-enum": [ - { - "value": "DC", - "name": "", - "description": "" - }, - { - "value": "CO", - "name": "", - "description": "" - }, - { - "value": "CN", - "name": "", - "description": "" - }, - { - "value": "CB", - "name": "", - "description": "" - } - ] - }, - "stop": { - "type": "string" - }, - "stopTriggered": { - "type": "boolean" - }, - "stopPrice": { - "type": "string" - }, - "timeInForce": { - "type": "string", - "description": "Time in force", - "enum": [ - "GTC", - "GTT", - "IOC", - "FOK" - ], - "x-api-enum": [ - { - "value": "GTC", - "name": "", - "description": "" - }, - { - "value": "GTT", - "name": "", - "description": "" - }, - { - "value": "IOC", - "name": "", - "description": "" - }, - { - "value": "FOK", - "name": "", - "description": "" - } - ] - }, - "postOnly": { - "type": "boolean", - "description": "Whether its a postOnly order." - }, - "hidden": { - "type": "boolean", - "description": "Whether its a hidden order." - }, - "iceberg": { - "type": "boolean", - "description": "Whether its a iceberg order." - }, - "visibleSize": { + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "clientOid": { + "type": "string", + "description": "Client Order Id,The ClientOid field is a unique ID created by the user(we recommend using a UUID), and can only contain numbers, letters, underscores (_), and hyphens (-). This field is returned when order information is obtained. You can use clientOid to tag your orders. ClientOid is different from the order ID created by the service provider. Please do not initiate requests using the same clientOid. The maximum length for the ClientOid is 40 characters.\n\nPlease remember the orderId created by the service provider, it used to check for updates in order status.", + "example": [ + "5c52e11203aa677f33e493fb" + ] + }, + "side": { + "type": "string", + "description": "specify if the order is to 'buy' or 'sell'", + "enum": [ + "buy", + "sell" + ], + "x-api-enum": [ + { + "value": "buy", + "name": "", + "description": "" + }, + { + "value": "sell", + "name": "", + "description": "" + } + ], + "example": [ + "buy" + ] + }, + "symbol": { + "type": "string", + "description": "symbol", + "example": [ + "BTC-USDT", + "ETH-USDT", + "KCS-USDT" + ] + }, + "type": { + "type": "string", + "description": "specify if the order is an 'limit' order or 'market' order. \n\nThe type of order you specify when you place your order determines whether or not you need to request other parameters and also affects the execution of the matching engine.\n\nWhen placing a limit order, you must specify a price and size. The system will try to match the order according to market price or a price better than market price. If the order cannot be immediately matched, it will stay in the order book until it is matched or the user cancels.\n\nUnlike limit orders, the price for market orders fluctuates with market prices. When placing a market order, you do not need to specify a price, you only need to specify a quantity. Market orders are filled immediately and will not enter the order book. All market orders are takers and a taker fee will be charged.", + "enum": [ + "limit", + "market" + ], + "default": "limit", + "x-api-enum": [ + { + "value": "limit", + "name": "", + "description": "" + }, + { + "value": "market", + "name": "", + "description": "" + } + ] + }, + "stp": { + "type": "string", + "description": "[Self Trade Prevention](https://www.kucoin.com/docs-new/doc-338146) is divided into these strategies: CN, CO, CB , and DC", + "enum": [ + "DC", + "CO", + "CN", + "CB" + ], + "x-api-enum": [ + { + "value": "DC", + "name": "", + "description": "" + }, + { + "value": "CO", + "name": "", + "description": "" + }, + { + "value": "CN", + "name": "", + "description": "" + }, + { + "value": "CB", + "name": "", + "description": "" + } + ] + }, + "price": { + "type": "string", + "description": "Specify price for order\n\nWhen placing a limit order, the price must be based on priceIncrement for the trading pair. The price increment (priceIncrement) is the price precision for the trading pair. For example, for the BTC-USDT trading pair, the priceIncrement is 0.00001000. So the price for your orders cannot be less than 0.00001000 and must be a multiple of priceIncrement. Otherwise, the order will return an invalid priceIncrement error." + }, + "size": { + "type": "string", + "description": "Specify quantity for order\n\nWhen **type** is limit, size refers to the amount of trading targets (the asset name written in front) for the trading pair. Teh Size must be based on the baseIncrement of the trading pair. The baseIncrement represents the precision for the trading pair. The size of an order must be a positive-integer multiple of baseIncrement and must be between baseMinSize and baseMaxSize.\n\nWhen **type** is market, select one out of two: size or funds" + }, + "timeInForce": { + "type": "string", + "description": "[Time in force](https://www.kucoin.com/docs-new/api-5176570) is a special strategy used during trading", + "enum": [ + "GTC", + "GTT", + "IOC", + "FOK" + ], + "default": "GTC", + "x-api-enum": [ + { + "value": "GTC", + "name": "", + "description": "" + }, + { + "value": "GTT", + "name": "", + "description": "" + }, + { + "value": "IOC", + "name": "", + "description": "" + }, + { + "value": "FOK", + "name": "", + "description": "" + } + ] + }, + "postOnly": { + "type": "boolean", + "default": false, + "description": "passive order labels, this is disabled when the order timing strategy is IOC or FOK" + }, + "hidden": { + "type": "boolean", + "description": "[Hidden order](https://www.kucoin.com/docs-new/doc-338146) or not (not shown in order book)", + "default": false + }, + "iceberg": { + "type": "boolean", + "description": "Whether or not only visible portions of orders are shown in [Iceberg orders](https://www.kucoin.com/docs-new/doc-338146)", + "default": false + }, + "visibleSize": { + "type": "string", + "description": "Maximum visible quantity in iceberg orders" + }, + "cancelAfter": { + "type": "integer", + "format": "int64", + "description": "Cancel after n seconds,the order timing strategy is GTT" + }, + "funds": { + "type": "string", + "description": "When **type** is market, select one out of two: size or funds" + }, + "isIsolated": { + "type": "boolean", + "description": "true - isolated margin ,false - cross margin. defult as false", + "default": false + }, + "autoBorrow": { + "type": "boolean", + "description": "When Margin Account has inefficient balance, our system autoborrows inefficient assets and opens positions according to the lowest market interest rate.", + "default": false + }, + "autoRepay": { + "type": "boolean", + "description": "AutoPay allows returning borrowed assets when you close a position. Our system automatically triggers the repayment and the maximum repayment amount equals to the filled-order amount.", + "default": false + } + }, + "required": [ + "symbol", + "side", + "clientOid" + ] + }, + "example": "//limit order\n{\n \"type\": \"limit\",\n \"symbol\": \"BTC-USDT\",\n \"side\": \"buy\",\n \"price\": \"50000\",\n \"size\": \"0.00001\",\n \"clientOid\": \"5c52e11203aa677f33e493fb\",\n \"remark\": \"order remarks\"\n}\n\n//market order 1\n// {\n// \"type\": \"market\",\n// \"symbol\": \"BTC-USDT\",\n// \"side\": \"buy\",\n// \"size\": \"0.00001\",\n// \"clientOid\": \"5c52e11203aa677f33e493fc\",\n// \"remark\": \"order remarks\"\n// }\n\n//market order 2\n// {\n// \"type\": \"market\",\n// \"symbol\": \"BTC-USDT\",\n// \"side\": \"buy\",\n// \"funds\": \"1\",\n// \"clientOid\": \"5c52e11203aa677f33e493fc\",\n// \"remark\": \"order remarks\"\n// }\n" + } + } + }, + "x-response-example": "{\\n \\\"success\\\": true,\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"orderId\\\": \\\"671663e02188630007e21c9c\\\",\\n \\\"clientOid\\\": \\\"5c52e11203aa677f33e1493fb\\\",\\n \\\"borrowSize\\\": \\\"10.2\\\",\\n \\\"loanApplyId\\\": \\\"600656d9a33ac90009de4f6f\\\"\\n }\\n}", + "x-request-example": "{\\\"type\\\": \\\"limit\\\", \\\"symbol\\\": \\\"BTC-USDT\\\", \\\"side\\\": \\\"buy\\\", \\\"price\\\": \\\"50000\\\", \\\"size\\\": \\\"0.00001\\\", \\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\", \\\"remark\\\": \\\"order remarks\\\"}" + } + }, + "/api/v3/hf/margin/order/test": { + "post": { + "summary": "Add Order Test", + "deprecated": false, + "description": " Order test endpoint, the request parameters and return parameters of this endpoint are exactly the same as the order endpoint, and can be used to verify whether the signature is correct and other operations. After placing an order, the order will not enter the matching system, and the order cannot be queried.", + "tags": [], + "parameters": [], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "object", + "properties": { + "orderId": { "type": "string", - "description": "Visible size of iceberg order in order book." + "description": "The unique order id generated by the trading system,which can be used later for further actions such as canceling the order." }, - "cancelAfter": { - "type": "integer", - "description": "A GTT timeInForce that expires in n seconds" + "loanApplyId": { + "type": "string", + "description": "Borrowed amount. The field is returned only after placing the order under the mode of Auto-Borrow." }, - "channel": { - "type": "string" + "borrowSize": { + "type": "number", + "description": "ID of the borrowing response. The field is returned only after placing the order under the mode of Auto-Borrow." }, "clientOid": { "type": "string", - "description": "Client Order Id,unique identifier created by the user" - }, - "remark": { - "type": "string", - "description": "Order placement remarks" - }, - "tags": { - "type": "string", - "description": "Order tag" - }, - "cancelExist": { - "type": "boolean", - "description": "Whether there is a cancellation record for the order." - }, - "createdAt": { - "type": "integer", - "format": "int64" - }, - "lastUpdatedAt": { - "type": "integer", - "format": "int64" - }, - "tradeType": { - "type": "string", - "description": "Trade type, redundancy param" - }, - "inOrderBook": { - "type": "boolean", - "description": "Whether to enter the orderbook: true: enter the orderbook; false: not enter the orderbook" - }, - "cancelledSize": { - "type": "string", - "description": "Number of canceled transactions" - }, - "cancelledFunds": { - "type": "string", - "description": "Funds of canceled transactions" - }, - "remainSize": { - "type": "string", - "description": "Number of remain transactions" - }, - "remainFunds": { - "type": "string", - "description": "Funds of remain transactions" - }, - "tax": { - "type": "string", - "description": "Users in some regions need query this field" - }, - "active": { - "type": "boolean", - "description": "Order status: true-The status of the order isactive; false-The status of the order is done" + "description": "The user self-defined order id." } }, "required": [ - "id", - "symbol", - "opType", - "type", - "side", - "price", - "size", - "funds", - "dealSize", - "dealFunds", - "fee", - "feeCurrency", - "stopTriggered", - "stopPrice", - "timeInForce", - "postOnly", - "hidden", - "iceberg", - "visibleSize", - "cancelAfter", - "channel", + "orderId", + "borrowSize", "clientOid", - "remark", - "cancelExist", - "createdAt", - "lastUpdatedAt", - "tradeType", - "inOrderBook", - "cancelledSize", - "cancelledFunds", - "remainSize", - "remainFunds", - "tax", - "active" + "loanApplyId" ] } }, @@ -413,153 +325,241 @@ } } }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470202", + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470205", "x-abandon": "normal", "x-domain": "Spot", "x-api-channel": "Private", - "x-api-permission": "General", + "x-api-permission": "Margin", "x-api-rate-limit-pool": "Spot", "x-sdk-service": "Margin", "x-sdk-sub-service": "Order", - "x-sdk-method-name": "getOrderByOrderId", - "x-sdk-method-description": "This endpoint can be used to obtain information for a single Margin order using the order id. After the user successfully places an order, the order is in Active state, and the user can use inOrderBook to determine whether the order has entered the order. Canceled or fully filled orders are marked as completed Done status.", + "x-sdk-method-name": "addOrderTest", + "x-sdk-method-description": " Order test endpoint, the request parameters and return parameters of this endpoint are exactly the same as the order endpoint, and can be used to verify whether the signature is correct and other operations. After placing an order, the order will not enter the matching system, and the order cannot be queried.", "x-api-rate-limit": 5, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"id\\\": \\\"671667306afcdb000723107f\\\",\\n \\\"symbol\\\": \\\"BTC-USDT\\\",\\n \\\"opType\\\": \\\"DEAL\\\",\\n \\\"type\\\": \\\"limit\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"price\\\": \\\"50000\\\",\\n \\\"size\\\": \\\"0.00001\\\",\\n \\\"funds\\\": \\\"0.5\\\",\\n \\\"dealSize\\\": \\\"0\\\",\\n \\\"dealFunds\\\": \\\"0\\\",\\n \\\"fee\\\": \\\"0\\\",\\n \\\"feeCurrency\\\": \\\"USDT\\\",\\n \\\"stp\\\": null,\\n \\\"stop\\\": null,\\n \\\"stopTriggered\\\": false,\\n \\\"stopPrice\\\": \\\"0\\\",\\n \\\"timeInForce\\\": \\\"GTC\\\",\\n \\\"postOnly\\\": false,\\n \\\"hidden\\\": false,\\n \\\"iceberg\\\": false,\\n \\\"visibleSize\\\": \\\"0\\\",\\n \\\"cancelAfter\\\": 0,\\n \\\"channel\\\": \\\"API\\\",\\n \\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\",\\n \\\"remark\\\": null,\\n \\\"tags\\\": null,\\n \\\"cancelExist\\\": false,\\n \\\"createdAt\\\": 1729521456248,\\n \\\"lastUpdatedAt\\\": 1729651011877,\\n \\\"tradeType\\\": \\\"MARGIN_TRADE\\\",\\n \\\"inOrderBook\\\": true,\\n \\\"cancelledSize\\\": \\\"0\\\",\\n \\\"cancelledFunds\\\": \\\"0\\\",\\n \\\"remainSize\\\": \\\"0.00001\\\",\\n \\\"remainFunds\\\": \\\"0.5\\\",\\n \\\"tax\\\": \\\"0\\\",\\n \\\"active\\\": true\\n }\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"orderId\\\": \\\"671667306afcdb000723107f\\\"}" - } - }, - "/api/v3/hf/margin/order/active/symbols": { - "get": { - "summary": "Get Symbols With Open Order", - "deprecated": false, - "description": "This interface can query all Margin symbol that has active orders", - "tags": [], - "parameters": [ - { - "name": "tradeType", - "in": "query", - "description": "Cross Margin: MARGIN_TRADE, Isolated Margin: MARGIN_ISOLATED_TRADE\n", - "required": true, - "schema": { - "type": "string", - "enum": [ - "MARGIN_TRADE", - "MARGIN_ISOLATED_TRADE" - ], - "x-api-enum": [ - { - "value": "MARGIN_TRADE", - "name": "", - "description": "" - }, - { - "value": "MARGIN_ISOLATED_TRADE", - "name": "", - "description": "" - } - ] - } - } - ], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "data": { - "type": "object", - "properties": { - "symbolSize": { - "type": "integer", - "description": "Symbol Size" - }, - "symbols": { - "type": "array", - "items": { - "type": "string" - }, - "description": "The symbol that has active orders" - } + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "clientOid": { + "type": "string", + "description": "Client Order Id,The ClientOid field is a unique ID created by the user(we recommend using a UUID), and can only contain numbers, letters, underscores (_), and hyphens (-). This field is returned when order information is obtained. You can use clientOid to tag your orders. ClientOid is different from the order ID created by the service provider. Please do not initiate requests using the same clientOid. The maximum length for the ClientOid is 40 characters.\n\nPlease remember the orderId created by the service provider, it used to check for updates in order status.", + "example": [ + "5c52e11203aa677f33e493fb" + ] + }, + "side": { + "type": "string", + "description": "specify if the order is to 'buy' or 'sell'", + "enum": [ + "buy", + "sell" + ], + "x-api-enum": [ + { + "value": "buy", + "name": "", + "description": "" }, - "required": [ - "symbolSize", - "symbols" - ] - } + { + "value": "sell", + "name": "", + "description": "" + } + ], + "example": [ + "buy" + ] }, - "required": [ - "code", - "data" - ] - } - } - } - } - }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470196", - "x-abandon": "normal", - "x-domain": "Spot", - "x-api-channel": "Private", - "x-api-permission": "Margin", - "x-api-rate-limit-pool": "Spot", - "x-sdk-service": "Margin", - "x-sdk-sub-service": "Order", - "x-sdk-method-name": "getSymbolsWithOpenOrder", - "x-sdk-method-description": "This interface can query all Margin symbol that has active orders", - "x-api-rate-limit": 2, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"symbolSize\\\": 1,\\n \\\"symbols\\\": [\\n \\\"BTC-USDT\\\"\\n ]\\n }\\n}", - "x-request-example": "{\\\"tradeType\\\": \\\"MARGIN_TRADE\\\"}" - } - }, - "/api/v3/hf/margin/orders": { - "delete": { - "summary": "Cancel All Orders By Symbol", - "deprecated": false, - "description": "This interface can cancel all open Margin orders by symbol This endpoint only sends cancellation requests. The results of the requests must be obtained by checking the order status or subscribing to websocket.", - "tags": [], - "parameters": [ - { - "name": "symbol", - "in": "query", - "description": "symbol", - "required": true, - "schema": { - "type": "string", - "example": [ - "BTC-USDT", - "ETH-USDT", - "KCS-USDT" - ] - } - }, - { - "name": "tradeType", - "in": "query", - "description": "Transaction type: MARGIN_TRADE - cross margin trade, MARGIN_ISOLATED_TRADE - isolated margin trade", - "required": true, - "schema": { - "type": "string", - "enum": [ - "MARGIN_TRADE", - "MARGIN_ISOLATED_TRADE" - ], - "x-api-enum": [ - { - "value": "MARGIN_TRADE", - "name": "", - "description": "" + "symbol": { + "type": "string", + "description": "symbol", + "example": [ + "BTC-USDT", + "ETH-USDT", + "KCS-USDT" + ] + }, + "type": { + "type": "string", + "description": "specify if the order is an 'limit' order or 'market' order. \n\nThe type of order you specify when you place your order determines whether or not you need to request other parameters and also affects the execution of the matching engine.\n\nWhen placing a limit order, you must specify a price and size. The system will try to match the order according to market price or a price better than market price. If the order cannot be immediately matched, it will stay in the order book until it is matched or the user cancels.\n\nUnlike limit orders, the price for market orders fluctuates with market prices. When placing a market order, you do not need to specify a price, you only need to specify a quantity. Market orders are filled immediately and will not enter the order book. All market orders are takers and a taker fee will be charged.", + "enum": [ + "limit", + "market" + ], + "default": "limit", + "x-api-enum": [ + { + "value": "limit", + "name": "", + "description": "" + }, + { + "value": "market", + "name": "", + "description": "" + } + ] + }, + "stp": { + "type": "string", + "description": "[Self Trade Prevention](https://www.kucoin.com/docs-new/doc-338146) is divided into these strategies: CN, CO, CB , and DC", + "enum": [ + "DC", + "CO", + "CN", + "CB" + ], + "x-api-enum": [ + { + "value": "DC", + "name": "", + "description": "" + }, + { + "value": "CO", + "name": "", + "description": "" + }, + { + "value": "CN", + "name": "", + "description": "" + }, + { + "value": "CB", + "name": "", + "description": "" + } + ] + }, + "price": { + "type": "string", + "description": "Specify price for order\n\nWhen placing a limit order, the price must be based on priceIncrement for the trading pair. The price increment (priceIncrement) is the price precision for the trading pair. For example, for the BTC-USDT trading pair, the priceIncrement is 0.00001000. So the price for your orders cannot be less than 0.00001000 and must be a multiple of priceIncrement. Otherwise, the order will return an invalid priceIncrement error." + }, + "size": { + "type": "string", + "description": "Specify quantity for order\n\nWhen **type** is limit, size refers to the amount of trading targets (the asset name written in front) for the trading pair. Teh Size must be based on the baseIncrement of the trading pair. The baseIncrement represents the precision for the trading pair. The size of an order must be a positive-integer multiple of baseIncrement and must be between baseMinSize and baseMaxSize.\n\nWhen **type** is market, select one out of two: size or funds" + }, + "timeInForce": { + "type": "string", + "description": "[Time in force](https://www.kucoin.com/docs-new/api-5176570) is a special strategy used during trading", + "enum": [ + "GTC", + "GTT", + "IOC", + "FOK" + ], + "default": "GTC", + "x-api-enum": [ + { + "value": "GTC", + "name": "", + "description": "" + }, + { + "value": "GTT", + "name": "", + "description": "" + }, + { + "value": "IOC", + "name": "", + "description": "" + }, + { + "value": "FOK", + "name": "", + "description": "" + } + ] + }, + "postOnly": { + "type": "boolean", + "default": false, + "description": "passive order labels, this is disabled when the order timing strategy is IOC or FOK" + }, + "hidden": { + "type": "boolean", + "description": "[Hidden order](https://www.kucoin.com/docs-new/doc-338146) or not (not shown in order book)", + "default": false + }, + "iceberg": { + "type": "boolean", + "description": "Whether or not only visible portions of orders are shown in [Iceberg orders](https://www.kucoin.com/docs-new/doc-338146)", + "default": false + }, + "visibleSize": { + "type": "string", + "description": "Maximum visible quantity in iceberg orders" + }, + "cancelAfter": { + "type": "integer", + "format": "int64", + "description": "Cancel after n seconds,the order timing strategy is GTT" + }, + "funds": { + "type": "string", + "description": "When **type** is market, select one out of two: size or funds" + }, + "isIsolated": { + "type": "boolean", + "description": "true - isolated margin ,false - cross margin. defult as false", + "default": false + }, + "autoBorrow": { + "type": "boolean", + "description": "When Margin Account has inefficient balance, our system autoborrows inefficient assets and opens positions according to the lowest market interest rate.", + "default": false + }, + "autoRepay": { + "type": "boolean", + "description": "AutoPay allows returning borrowed assets when you close a position. Our system automatically triggers the repayment and the maximum repayment amount equals to the filled-order amount.", + "default": false + } }, - { - "value": "MARGIN_ISOLATED_TRADE", - "name": "", - "description": "" - } + "required": [ + "symbol", + "side", + "clientOid" + ] + }, + "example": "//limit order\n{\n \"type\": \"limit\",\n \"symbol\": \"BTC-USDT\",\n \"side\": \"buy\",\n \"price\": \"50000\",\n \"size\": \"0.00001\",\n \"clientOid\": \"5c52e11203aa677f33e493fb\",\n \"remark\": \"order remarks\"\n}\n\n//market order 1\n// {\n// \"type\": \"market\",\n// \"symbol\": \"BTC-USDT\",\n// \"side\": \"buy\",\n// \"size\": \"0.00001\",\n// \"clientOid\": \"5c52e11203aa677f33e493fc\",\n// \"remark\": \"order remarks\"\n// }\n\n//market order 2\n// {\n// \"type\": \"market\",\n// \"symbol\": \"BTC-USDT\",\n// \"side\": \"buy\",\n// \"funds\": \"1\",\n// \"clientOid\": \"5c52e11203aa677f33e493fc\",\n// \"remark\": \"order remarks\"\n// }\n" + } + } + }, + "x-response-example": "{\\n \\\"success\\\": true,\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"orderId\\\": \\\"5bd6e9286d99522a52e458de\\\",\\n \\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\",\\n \\\"borrowSize\\\": 10.2,\\n \\\"loanApplyId\\\": \\\"600656d9a33ac90009de4f6f\\\"\\n }\\n}", + "x-request-example": "{\\\"type\\\": \\\"limit\\\", \\\"symbol\\\": \\\"BTC-USDT\\\", \\\"side\\\": \\\"buy\\\", \\\"price\\\": \\\"50000\\\", \\\"size\\\": \\\"0.00001\\\", \\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\", \\\"remark\\\": \\\"order remarks\\\"}" + } + }, + "/api/v3/hf/margin/orders/{orderId}": { + "delete": { + "summary": "Cancel Order By OrderId", + "deprecated": false, + "description": "This endpoint can be used to cancel a margin order by orderId. This endpoint only sends cancellation requests. The results of the requests must be obtained by checking the order status or subscribing to websocket.", + "tags": [], + "parameters": [ + { + "name": "orderId", + "in": "path", + "description": "The unique order id generated by the trading system", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "symbol", + "in": "query", + "description": "symbol", + "required": true, + "schema": { + "type": "string", + "example": [ + "BTC-USDT", + "ETH-USDT", + "KCS-USDT" ] } } @@ -576,7 +576,16 @@ "type": "string" }, "data": { - "type": "string" + "type": "object", + "properties": { + "orderId": { + "type": "string", + "description": "order id" + } + }, + "required": [ + "orderId" + ] } }, "required": [ @@ -588,7 +597,7 @@ } } }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470197", + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470195", "x-abandon": "normal", "x-domain": "Spot", "x-api-channel": "Private", @@ -596,18 +605,16 @@ "x-api-rate-limit-pool": "Spot", "x-sdk-service": "Margin", "x-sdk-sub-service": "Order", - "x-sdk-method-name": "cancelAllOrdersBySymbol", - "x-sdk-method-description": "This interface can cancel all open Margin orders by symbol This endpoint only sends cancellation requests. The results of the requests must be obtained by checking the order status or subscribing to websocket.", - "x-api-rate-limit": 10, - "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":\\\"success\\\"}", - "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"tradeType\\\": \\\"MARGIN_TRADE\\\"}" - } - }, - "/api/v3/hf/margin/orders/active": { + "x-sdk-method-name": "cancelOrderByOrderId", + "x-sdk-method-description": "This endpoint can be used to cancel a margin order by orderId. This endpoint only sends cancellation requests. The results of the requests must be obtained by checking the order status or subscribing to websocket.", + "x-api-rate-limit": 5, + "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"orderId\\\":\\\"671663e02188630007e21c9c\\\"}}", + "x-request-example": "{\\\"orderId\\\": \\\"671663e02188630007e21c9c\\\", \\\"symbol\\\": \\\"BTC-USDT\\\"}" + }, "get": { - "summary": "Get Open Orders", + "summary": "Get Order By OrderId", "deprecated": false, - "description": "This interface is to obtain all Margin active order lists, and the return value of the active order interface is the paged data of all uncompleted order lists. The returned data is sorted in descending order according to the latest update time of the order. After the user successfully places an order, the order is in Active state, and the user can use inOrderBook to determine whether the order has entered the order. Canceled or fully filled orders are marked as completed Done status.", + "description": "This endpoint can be used to obtain information for a single Margin order using the order id. After the user successfully places an order, the order is in Active state, and the user can use inOrderBook to determine whether the order has entered the order. Canceled or fully filled orders are marked as completed Done status.", "tags": [], "parameters": [ { @@ -625,28 +632,12 @@ } }, { - "name": "tradeType", - "in": "query", - "description": "Order type: MARGIN_TRADE - cross margin trading order, MARGIN_ISOLATED_TRADE - isolated margin trading order", + "name": "orderId", + "in": "path", + "description": "The unique order id generated by the trading system", "required": true, "schema": { - "type": "string", - "enum": [ - "MARGIN_TRADE", - "MARGIN_ISOLATED_TRADE" - ], - "x-api-enum": [ - { - "value": "MARGIN_TRADE", - "name": "", - "description": "" - }, - { - "value": "MARGIN_ISOLATED_TRADE", - "name": "", - "description": "" - } - ] + "type": "string" } } ], @@ -662,1096 +653,280 @@ "type": "string" }, "data": { - "type": "array", - "items": { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "The unique order id generated by the trading system" - }, - "symbol": { - "type": "string", - "description": "symbol", - "example": [ - "BTC-USDT", - "ETH-USDT", - "KCS-USDT" - ] - }, - "opType": { - "type": "string" - }, - "type": { - "type": "string", - "description": "Specify if the order is an 'limit' order or 'market' order. ", - "enum": [ - "limit", - "market" - ], - "x-api-enum": [ - { - "value": "limit", - "name": "", - "description": "" - }, - { - "value": "market", - "name": "", - "description": "" - } - ] - }, - "side": { - "type": "string", - "description": "Buy or sell", - "enum": [ - "buy", - "sell" - ], - "x-api-enum": [ - { - "value": "buy", - "name": "", - "description": "" - }, - { - "value": "sell", - "name": "", - "description": "" - } - ] - }, - "price": { - "type": "string", - "description": "Order price" - }, - "size": { - "type": "string", - "description": "Order size" - }, - "funds": { - "type": "string", - "description": "Order Funds" - }, - "dealSize": { - "type": "string", - "description": "Number of filled transactions" - }, - "dealFunds": { - "type": "string", - "description": "Funds of filled transactions" - }, - "fee": { - "type": "string", - "description": "trading fee" - }, - "feeCurrency": { - "type": "string", - "description": "currency used to calculate trading fee" - }, - "stp": { - "type": "string", - "description": "[Self Trade Prevention](https://www.kucoin.com/docs-new/doc-338146) is divided into these strategies: CN, CO, CB , and DC", - "enum": [ - "DC", - "CO", - "CN", - "CB" - ], - "x-api-enum": [ - { - "value": "DC", - "name": "", - "description": "" - }, - { - "value": "CO", - "name": "", - "description": "" - }, - { - "value": "CN", - "name": "", - "description": "" - }, - { - "value": "CB", - "name": "", - "description": "" - } - ] - }, - "stop": { - "type": "string" - }, - "stopTriggered": { - "type": "boolean" - }, - "stopPrice": { - "type": "string" - }, - "timeInForce": { - "type": "string", - "description": "Time in force", - "enum": [ - "GTC", - "GTT", - "IOC", - "FOK" - ], - "x-api-enum": [ - { - "value": "GTC", - "name": "", - "description": "" - }, - { - "value": "GTT", - "name": "", - "description": "" - }, - { - "value": "IOC", - "name": "", - "description": "" - }, - { - "value": "FOK", - "name": "", - "description": "" - } - ] - }, - "postOnly": { - "type": "boolean", - "description": "Whether its a postOnly order." - }, - "hidden": { - "type": "boolean", - "description": "Whether its a hidden order." - }, - "iceberg": { - "type": "boolean", - "description": "Whether its a iceberg order." - }, - "visibleSize": { - "type": "string", - "description": "Visible size of iceberg order in order book." - }, - "cancelAfter": { - "type": "integer", - "description": "A GTT timeInForce that expires in n seconds" - }, - "channel": { - "type": "string" - }, - "clientOid": { - "type": "string", - "description": "Client Order Id,unique identifier created by the user" - }, - "remark": { - "type": "string", - "description": "Order placement remarks" - }, - "tags": { - "type": "string", - "description": "Order tag" - }, - "cancelExist": { - "type": "boolean", - "description": "Whether there is a cancellation record for the order." - }, - "createdAt": { - "type": "integer", - "format": "int64" - }, - "lastUpdatedAt": { - "type": "integer", - "format": "int64" - }, - "tradeType": { - "type": "string", - "description": "Trade type, redundancy param" - }, - "inOrderBook": { - "type": "boolean", - "description": "Whether to enter the orderbook: true: enter the orderbook; false: not enter the orderbook" - }, - "cancelledSize": { - "type": "string", - "description": "Number of canceled transactions" - }, - "cancelledFunds": { - "type": "string", - "description": "Funds of canceled transactions" - }, - "remainSize": { - "type": "string", - "description": "Number of remain transactions" - }, - "remainFunds": { - "type": "string", - "description": "Funds of remain transactions" - }, - "tax": { - "type": "string", - "description": "Users in some regions need query this field" - }, - "active": { - "type": "boolean", - "description": "Order status: true-The status of the order isactive; false-The status of the order is done" - } + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The unique order id generated by the trading system" }, - "required": [ - "stopPrice", - "id", - "symbol", - "opType", - "type", - "side", - "price", - "size", - "funds", - "dealSize", - "dealFunds", - "fee", - "feeCurrency", - "stopTriggered", - "timeInForce", - "postOnly", - "hidden", - "iceberg", - "visibleSize", - "cancelAfter", - "channel", - "clientOid", - "cancelExist", - "tradeType", - "inOrderBook", - "cancelledSize", - "cancelledFunds", - "remainSize", - "remainFunds", - "tax", - "active", - "createdAt", - "lastUpdatedAt" - ] - } - } - }, - "required": [ - "code", - "data" - ] - } - } - } - } - }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470198", - "x-abandon": "normal", - "x-domain": "Spot", - "x-api-channel": "Private", - "x-api-permission": "General", - "x-api-rate-limit-pool": "Spot", - "x-sdk-service": "Margin", - "x-sdk-sub-service": "Order", - "x-sdk-method-name": "getOpenOrders", - "x-sdk-method-description": "This interface is to obtain all Margin active order lists, and the return value of the active order interface is the paged data of all uncompleted order lists. The returned data is sorted in descending order according to the latest update time of the order. After the user successfully places an order, the order is in Active state, and the user can use inOrderBook to determine whether the order has entered the order. Canceled or fully filled orders are marked as completed Done status.", - "x-api-rate-limit": 4, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": [\\n {\\n \\\"id\\\": \\\"671667306afcdb000723107f\\\",\\n \\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\",\\n \\\"symbol\\\": \\\"BTC-USDT\\\",\\n \\\"opType\\\": \\\"DEAL\\\",\\n \\\"type\\\": \\\"limit\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"price\\\": \\\"50000\\\",\\n \\\"size\\\": \\\"0.00001\\\",\\n \\\"funds\\\": \\\"0.5\\\",\\n \\\"dealSize\\\": \\\"0\\\",\\n \\\"dealFunds\\\": \\\"0\\\",\\n \\\"remainSize\\\": \\\"0.00001\\\",\\n \\\"remainFunds\\\": \\\"0.5\\\",\\n \\\"cancelledSize\\\": \\\"0\\\",\\n \\\"cancelledFunds\\\": \\\"0\\\",\\n \\\"fee\\\": \\\"0\\\",\\n \\\"feeCurrency\\\": \\\"USDT\\\",\\n \\\"stp\\\": null,\\n \\\"stop\\\": null,\\n \\\"stopTriggered\\\": false,\\n \\\"stopPrice\\\": \\\"0\\\",\\n \\\"timeInForce\\\": \\\"GTC\\\",\\n \\\"postOnly\\\": false,\\n \\\"hidden\\\": false,\\n \\\"iceberg\\\": false,\\n \\\"visibleSize\\\": \\\"0\\\",\\n \\\"cancelAfter\\\": 0,\\n \\\"channel\\\": \\\"API\\\",\\n \\\"remark\\\": null,\\n \\\"tags\\\": null,\\n \\\"cancelExist\\\": false,\\n \\\"tradeType\\\": \\\"MARGIN_TRADE\\\",\\n \\\"inOrderBook\\\": true,\\n \\\"active\\\": true,\\n \\\"tax\\\": \\\"0\\\",\\n \\\"createdAt\\\": 1729521456248,\\n \\\"lastUpdatedAt\\\": 1729521460940\\n }\\n ]\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"tradeType\\\": \\\"MARGIN_TRADE\\\"}" - } - }, - "/api/v3/hf/margin/orders/done": { - "get": { - "summary": "Get Closed Orders", - "deprecated": false, - "description": "This interface is to obtain all Margin closed order lists, and the return value of the active order interface is the paged data of all uncompleted order lists. The returned data is sorted in descending order according to the latest update time of the order. After the user successfully places an order, the order is in Active state, and the user can use inOrderBook to determine whether the order has entered the order. Canceled or fully filled orders are marked as completed Done status.", - "tags": [], - "parameters": [ - { - "name": "symbol", - "in": "query", - "description": "symbol", - "required": true, - "schema": { - "type": "string", - "example": [ - "BTC-USDT", - "ETH-USDT", - "KCS-USDT" - ] - } - }, - { - "name": "tradeType", - "in": "query", - "description": "Transaction type: MARGIN_TRADE - cross margin trade, MARGIN_ISOLATED_TRADE - isolated margin trade", - "required": true, - "schema": { - "type": "string", - "enum": [ - "MARGIN_TRADE", - "MARGIN_ISOLATED_TRADE" - ], - "x-api-enum": [ - { - "value": "MARGIN_TRADE", - "name": "", - "description": "" - }, - { - "value": "MARGIN_ISOLATED_TRADE", - "name": "", - "description": "" - } - ] - } - }, - { - "name": "side", - "in": "query", - "description": "specify if the order is to 'buy' or 'sell'", - "required": false, - "schema": { - "type": "string", - "enum": [ - "buy", - "sell" - ], - "x-api-enum": [ - { - "value": "buy", - "name": "", - "description": "" - }, - { - "value": "sell", - "name": "", - "description": "" - } - ] - } - }, - { - "name": "type", - "in": "query", - "description": "specify if the order is an 'limit' order or 'market' order. ", - "required": false, - "schema": { - "type": "string", - "enum": [ - "limit", - "market" - ], - "x-api-enum": [ - { - "value": "limit", - "name": "", - "description": "" - }, - { - "value": "market", - "name": "", - "description": "" - } - ] - } - }, - { - "name": "lastId", - "in": "query", - "description": "The id of the last set of data from the previous batch of data. By default, the latest information is given.\nlastId is used to filter data and paginate. If lastId is not entered, the default is a maximum of 100 returned data items. The return results include lastId,which can be used as a query parameter to look up new data from the next page.", - "required": false, - "schema": { - "type": "integer", - "format": "int64" - } - }, - { - "name": "limit", - "in": "query", - "description": "Default20,Max100", - "required": false, - "schema": { - "type": "integer", - "default": 20, - "minimum": 1, - "maximum": 100 - } - }, - { - "name": "startAt", - "in": "query", - "description": "Start time (milisecond)", - "required": false, - "schema": { - "type": "integer", - "format": "int64" - } - }, - { - "name": "endAt", - "in": "query", - "description": "End time (milisecond)", - "required": false, - "schema": { - "type": "integer", - "format": "int64" - } - } - ], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "data": { - "type": "object", - "properties": { - "lastId": { - "type": "integer", - "description": "The id of the last set of data from the previous batch of data. By default, the latest information is given.\nlastId is used to filter data and paginate. If lastId is not entered, the default is a maximum of 100 returned data items. The return results include lastId,which can be used as a query parameter to look up new data from the next page.", - "format": "int64" + "symbol": { + "type": "string", + "description": "symbol", + "example": [ + "BTC-USDT", + "ETH-USDT", + "KCS-USDT" + ] }, - "items": { - "type": "array", - "items": { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "The unique order id generated by the trading system" - }, - "symbol": { - "type": "string", - "description": "symbol", - "example": [ - "BTC-USDT", - "ETH-USDT", - "KCS-USDT" - ] - }, - "opType": { - "type": "string" - }, - "type": { - "type": "string", - "description": "Specify if the order is an 'limit' order or 'market' order. ", - "enum": [ - "limit", - "market" - ], - "x-api-enum": [ - { - "value": "limit", - "name": "", - "description": "" - }, - { - "value": "market", - "name": "", - "description": "" - } - ] - }, - "side": { - "type": "string", - "description": "Buy or sell" - }, - "price": { - "type": "string", - "description": "Order price" - }, - "size": { - "type": "string", - "description": "Order size" - }, - "funds": { - "type": "string", - "description": "Order Funds" - }, - "dealSize": { - "type": "string", - "description": "Number of filled transactions" - }, - "dealFunds": { - "type": "string", - "description": "Funds of filled transactions" - }, - "fee": { - "type": "string", - "description": "[Handling fees](https://www.kucoin.com/docs-new/api-5327739)" - }, - "feeCurrency": { - "type": "string", - "description": "currency used to calculate trading fee" - }, - "stp": { - "type": "string", - "description": "[Self Trade Prevention](https://www.kucoin.com/docs-new/doc-338146) is divided into these strategies: CN, CO, CB , and DC", - "enum": [ - "DC", - "CO", - "CN", - "CB" - ], - "x-api-enum": [ - { - "value": "DC", - "name": "", - "description": "" - }, - { - "value": "CO", - "name": "", - "description": "" - }, - { - "value": "CN", - "name": "", - "description": "" - }, - { - "value": "CB", - "name": "", - "description": "" - } - ] - }, - "stop": { - "type": "string" - }, - "stopTriggered": { - "type": "boolean" - }, - "stopPrice": { - "type": "string" - }, - "timeInForce": { - "type": "string", - "description": "Time in force", - "enum": [ - "GTC", - "GTT", - "IOC", - "FOK" - ], - "x-api-enum": [ - { - "value": "GTC", - "name": "", - "description": "" - }, - { - "value": "GTT", - "name": "", - "description": "" - }, - { - "value": "IOC", - "name": "", - "description": "" - }, - { - "value": "FOK", - "name": "", - "description": "" - } - ] - }, - "postOnly": { - "type": "boolean", - "description": "Whether its a postOnly order." - }, - "hidden": { - "type": "boolean", - "description": "Whether its a hidden order." - }, - "iceberg": { - "type": "boolean", - "description": "Whether its a iceberg order." - }, - "visibleSize": { - "type": "string", - "description": "Visible size of iceberg order in order book." - }, - "cancelAfter": { - "type": "integer", - "description": "A GTT timeInForce that expires in n seconds" - }, - "channel": { - "type": "string" - }, - "clientOid": { - "type": "string", - "description": "Client Order Id,unique identifier created by the user" - }, - "remark": { - "type": "string", - "description": "Order placement remarks" - }, - "tags": { - "type": "string", - "description": "Order tag" - }, - "cancelExist": { - "type": "boolean", - "description": "Whether there is a cancellation record for the order." - }, - "createdAt": { - "type": "integer", - "format": "int64" - }, - "lastUpdatedAt": { - "type": "integer", - "format": "int64" - }, - "tradeType": { - "type": "string", - "description": "Trade type, redundancy param" - }, - "inOrderBook": { - "type": "boolean", - "description": "Whether to enter the orderbook: true: enter the orderbook; false: not enter the orderbook" - }, - "cancelledSize": { - "type": "string", - "description": "Number of canceled transactions" - }, - "cancelledFunds": { - "type": "string", - "description": "Funds of canceled transactions" - }, - "remainSize": { - "type": "string", - "description": "Number of remain transactions" - }, - "remainFunds": { - "type": "string", - "description": "Funds of remain transactions" - }, - "tax": { - "type": "string", - "description": "Users in some regions need query this field" - }, - "active": { - "type": "boolean", - "description": "Order status: true-The status of the order isactive; false-The status of the order is done" - } + "opType": { + "type": "string" + }, + "type": { + "type": "string", + "description": "Specify if the order is an 'limit' order or 'market' order. ", + "enum": [ + "limit", + "market" + ], + "x-api-enum": [ + { + "value": "limit", + "name": "", + "description": "" }, - "required": [ - "id", - "symbol", - "opType", - "type", - "side", - "price", - "size", - "funds", - "dealSize", - "dealFunds", - "fee", - "feeCurrency", - "stopTriggered", - "stopPrice", - "timeInForce", - "postOnly", - "hidden", - "iceberg", - "visibleSize", - "cancelAfter", - "channel", - "clientOid", - "cancelExist", - "createdAt", - "lastUpdatedAt", - "tradeType", - "inOrderBook", - "cancelledSize", - "cancelledFunds", - "remainSize", - "remainFunds", - "tax", - "active" - ] - } - } - }, - "required": [ - "lastId", - "items" - ] - } - }, - "required": [ - "code", - "data" - ] - } - } - } - } - }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470199", - "x-abandon": "normal", - "x-domain": "Spot", - "x-api-channel": "Private", - "x-api-permission": "General", - "x-api-rate-limit-pool": "Spot", - "x-sdk-service": "Margin", - "x-sdk-sub-service": "Order", - "x-sdk-method-name": "getClosedOrders", - "x-sdk-method-description": "This interface is to obtain all Margin closed order lists, and the return value of the active order interface is the paged data of all uncompleted order lists. The returned data is sorted in descending order according to the latest update time of the order. After the user successfully places an order, the order is in Active state, and the user can use inOrderBook to determine whether the order has entered the order. Canceled or fully filled orders are marked as completed Done status.", - "x-api-rate-limit": 10, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"lastId\\\": 136112949351,\\n \\\"items\\\": [\\n {\\n \\\"id\\\": \\\"6716491f6afcdb00078365c8\\\",\\n \\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\",\\n \\\"symbol\\\": \\\"BTC-USDT\\\",\\n \\\"opType\\\": \\\"DEAL\\\",\\n \\\"type\\\": \\\"limit\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"price\\\": \\\"50000\\\",\\n \\\"size\\\": \\\"0.00001\\\",\\n \\\"funds\\\": \\\"0.5\\\",\\n \\\"dealSize\\\": \\\"0\\\",\\n \\\"dealFunds\\\": \\\"0\\\",\\n \\\"remainSize\\\": \\\"0\\\",\\n \\\"remainFunds\\\": \\\"0\\\",\\n \\\"cancelledSize\\\": \\\"0.00001\\\",\\n \\\"cancelledFunds\\\": \\\"0.5\\\",\\n \\\"fee\\\": \\\"0\\\",\\n \\\"feeCurrency\\\": \\\"USDT\\\",\\n \\\"stp\\\": null,\\n \\\"stop\\\": null,\\n \\\"stopTriggered\\\": false,\\n \\\"stopPrice\\\": \\\"0\\\",\\n \\\"timeInForce\\\": \\\"GTC\\\",\\n \\\"postOnly\\\": false,\\n \\\"hidden\\\": false,\\n \\\"iceberg\\\": false,\\n \\\"visibleSize\\\": \\\"0\\\",\\n \\\"cancelAfter\\\": 0,\\n \\\"channel\\\": \\\"API\\\",\\n \\\"remark\\\": null,\\n \\\"tags\\\": null,\\n \\\"cancelExist\\\": true,\\n \\\"tradeType\\\": \\\"MARGIN_TRADE\\\",\\n \\\"inOrderBook\\\": false,\\n \\\"active\\\": false,\\n \\\"tax\\\": \\\"0\\\",\\n \\\"createdAt\\\": 1729513759162,\\n \\\"lastUpdatedAt\\\": 1729521126597\\n }\\n ]\\n }\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"tradeType\\\": \\\"MARGIN_TRADE\\\", \\\"side\\\": \\\"buy\\\", \\\"type\\\": \\\"limit\\\", \\\"lastId\\\": 254062248624417, \\\"limit\\\": 20, \\\"startAt\\\": 1728663338000, \\\"endAt\\\": 1728692138000}" - } - }, - "/api/v3/hf/margin/fills": { - "get": { - "summary": "Get Trade History", - "deprecated": false, - "description": "This endpoint can be used to obtain a list of the latest Margin transaction details. The returned data is sorted in descending order according to the latest update time of the order.", - "tags": [], - "parameters": [ - { - "name": "symbol", - "in": "query", - "description": "symbol", - "required": true, - "schema": { - "type": "string", - "example": [ - "BTC-USDT", - "ETH-USDT", - "KCS-USDT" - ] - } - }, - { - "name": "tradeType", - "in": "query", - "description": "Trade type: MARGIN_TRADE - cross margin trade, MARGIN_ISOLATED_TRADE - isolated margin trade", - "required": true, - "schema": { - "type": "string", - "enum": [ - "MARGIN_TRADE", - "MARGIN_ISOLATED_TRADE" - ], - "x-api-enum": [ - { - "value": "MARGIN_TRADE", - "name": "", - "description": "" - }, - { - "value": "MARGIN_ISOLATED_TRADE", - "name": "", - "description": "" - } - ] - } - }, - { - "name": "orderId", - "in": "query", - "description": "The unique order id generated by the trading system\n(If orderId is specified,please ignore the other query parameters)", - "required": false, - "schema": { - "type": "string" - } - }, - { - "name": "side", - "in": "query", - "description": "specify if the order is to 'buy' or 'sell'", - "required": false, - "schema": { - "type": "string", - "enum": [ - "buy", - "sell" - ], - "x-api-enum": [ - { - "value": "buy", - "name": "", - "description": "" - }, - { - "value": "sell", - "name": "", - "description": "" - } - ] - } - }, - { - "name": "type", - "in": "query", - "description": "specify if the order is an 'limit' order or 'market' order. ", - "required": false, - "schema": { - "type": "string", - "enum": [ - "limit", - "market" - ], - "x-api-enum": [ - { - "value": "limit", - "name": "", - "description": "" - }, - { - "value": "market", - "name": "", - "description": "" - } - ] - } - }, - { - "name": "lastId", - "in": "query", - "description": "The id of the last set of data from the previous batch of data. By default, the latest information is given.\nlastId is used to filter data and paginate. If lastId is not entered, the default is a maximum of 100 returned data items. The return results include lastId,which can be used as a query parameter to look up new data from the next page.", - "required": false, - "schema": { - "type": "integer", - "format": "int64" - } - }, - { - "name": "limit", - "in": "query", - "description": "Default100,Max200", - "required": false, - "schema": { - "type": "integer", - "default": 20, - "minimum": 1, - "maximum": 200 - } - }, - { - "name": "startAt", - "in": "query", - "description": "Start time (milisecond)", - "required": false, - "schema": { - "type": "integer", - "format": "int64" - } - }, - { - "name": "endAt", - "in": "query", - "description": "End time (milisecond)", - "required": false, - "schema": { - "type": "integer", - "format": "int64" - } - } - ], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "data": { - "type": "object", - "properties": { - "items": { - "type": "array", - "items": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "description": "Id of transaction detail", - "format": "int64" - }, - "symbol": { - "type": "string", - "description": "symbol", - "example": [ - "BTC-USDT", - "ETH-USDT", - "KCS-USDT" - ] - }, - "tradeId": { - "type": "integer", - "description": "Trade Id, symbol latitude increment", - "format": "int64" - }, - "orderId": { - "type": "string", - "description": "The unique order id generated by the trading system" - }, - "counterOrderId": { - "type": "string", - "description": "Counterparty order Id" - }, - "side": { - "type": "string", - "description": "Buy or sell", - "enum": [ - "buy", - "sell" - ], - "x-api-enum": [ - { - "value": "buy", - "name": "", - "description": "" - }, - { - "value": "sell", - "name": "", - "description": "" - } - ] - }, - "liquidity": { - "type": "string", - "description": "Liquidity type: taker or maker", - "enum": [ - "taker", - "maker" - ], - "x-api-enum": [ - { - "value": "taker", - "name": "", - "description": "" - }, - { - "value": "maker", - "name": "", - "description": "" - } - ] - }, - "forceTaker": { - "type": "boolean" - }, - "price": { - "type": "string", - "description": "Order price" - }, - "size": { - "type": "string", - "description": "Order size" - }, - "funds": { - "type": "string", - "description": "Order Funds" - }, - "fee": { - "type": "string", - "description": "[Handling fees](https://www.kucoin.com/docs-new/api-5327739)" - }, - "feeRate": { - "type": "string", - "description": "Fee rate\n" - }, - "feeCurrency": { - "type": "string", - "description": "currency used to calculate trading fee" - }, - "stop": { - "type": "string", - "description": "Take Profit and Stop Loss type, currently HFT does not support the Take Profit and Stop Loss type, so it is empty" - }, - "tradeType": { - "type": "string", - "description": "Trade type, redundancy param" - }, - "tax": { - "type": "string", - "description": "Users in some regions need query this field" - }, - "taxRate": { - "type": "string", - "description": "Tax Rate, Users in some regions need query this field" - }, - "type": { - "type": "string", - "description": "Specify if the order is an 'limit' order or 'market' order. ", - "enum": [ - "limit", - "market" - ], - "x-api-enum": [ - { - "value": "limit", - "name": "", - "description": "" - }, - { - "value": "market", - "name": "", - "description": "" - } - ] - }, - "createdAt": { - "type": "integer", - "format": "int64" - } + { + "value": "market", + "name": "", + "description": "" + } + ] + }, + "side": { + "type": "string", + "description": "Buy or sell", + "enum": [ + "buy", + "sell" + ], + "x-api-enum": [ + { + "value": "buy", + "name": "", + "description": "" + }, + { + "value": "sell", + "name": "", + "description": "" + } + ] + }, + "price": { + "type": "string", + "description": "Order price" + }, + "size": { + "type": "string", + "description": "Order size" + }, + "funds": { + "type": "string", + "description": "Order Funds" + }, + "dealSize": { + "type": "string", + "description": "Number of filled transactions" + }, + "dealFunds": { + "type": "string", + "description": "Funds of filled transactions" + }, + "fee": { + "type": "string", + "description": "[Handling fees](https://www.kucoin.com/docs-new/api-5327739)" + }, + "feeCurrency": { + "type": "string", + "description": "currency used to calculate trading fee" + }, + "stp": { + "type": "string", + "description": "[Self Trade Prevention](https://www.kucoin.com/docs-new/doc-338146) is divided into these strategies: CN, CO, CB , and DC", + "enum": [ + "DC", + "CO", + "CN", + "CB" + ], + "x-api-enum": [ + { + "value": "DC", + "name": "", + "description": "" + }, + { + "value": "CO", + "name": "", + "description": "" + }, + { + "value": "CN", + "name": "", + "description": "" + }, + { + "value": "CB", + "name": "", + "description": "" + } + ] + }, + "stop": { + "type": "string" + }, + "stopTriggered": { + "type": "boolean" + }, + "stopPrice": { + "type": "string" + }, + "timeInForce": { + "type": "string", + "description": "Time in force", + "enum": [ + "GTC", + "GTT", + "IOC", + "FOK" + ], + "x-api-enum": [ + { + "value": "GTC", + "name": "", + "description": "" }, - "required": [ - "id", - "symbol", - "tradeId", - "orderId", - "counterOrderId", - "side", - "liquidity", - "forceTaker", - "price", - "size", - "funds", - "fee", - "feeRate", - "feeCurrency", - "stop", - "tradeType", - "tax", - "taxRate", - "type", - "createdAt" - ] - } + { + "value": "GTT", + "name": "", + "description": "" + }, + { + "value": "IOC", + "name": "", + "description": "" + }, + { + "value": "FOK", + "name": "", + "description": "" + } + ] }, - "lastId": { + "postOnly": { + "type": "boolean", + "description": "Whether its a postOnly order." + }, + "hidden": { + "type": "boolean", + "description": "Whether its a hidden order." + }, + "iceberg": { + "type": "boolean", + "description": "Whether its a iceberg order." + }, + "visibleSize": { + "type": "string", + "description": "Visible size of iceberg order in order book." + }, + "cancelAfter": { + "type": "integer", + "description": "A GTT timeInForce that expires in n seconds" + }, + "channel": { + "type": "string" + }, + "clientOid": { + "type": "string", + "description": "Client Order Id,unique identifier created by the user" + }, + "remark": { + "type": "string", + "description": "Order placement remarks" + }, + "tags": { + "type": "string", + "description": "Order tag" + }, + "cancelExist": { + "type": "boolean", + "description": "Whether there is a cancellation record for the order." + }, + "createdAt": { + "type": "integer", + "format": "int64" + }, + "lastUpdatedAt": { "type": "integer", - "description": "The id of the last set of data from the previous batch of data. By default, the latest information is given.\nlastId is used to filter data and paginate. If lastId is not entered, the default is a maximum of 100 returned data items. The return results include lastId,which can be used as a query parameter to look up new data from the next page.", "format": "int64" + }, + "tradeType": { + "type": "string", + "description": "Trade type, redundancy param" + }, + "inOrderBook": { + "type": "boolean", + "description": "Whether to enter the orderbook: true: enter the orderbook; false: not enter the orderbook" + }, + "cancelledSize": { + "type": "string", + "description": "Number of canceled transactions" + }, + "cancelledFunds": { + "type": "string", + "description": "Funds of canceled transactions" + }, + "remainSize": { + "type": "string", + "description": "Number of remain transactions" + }, + "remainFunds": { + "type": "string", + "description": "Funds of remain transactions" + }, + "tax": { + "type": "string", + "description": "Users in some regions need query this field" + }, + "active": { + "type": "boolean", + "description": "Order status: true-The status of the order isactive; false-The status of the order is done" } }, "required": [ - "items", - "lastId" + "id", + "symbol", + "opType", + "type", + "side", + "price", + "size", + "funds", + "dealSize", + "dealFunds", + "fee", + "feeCurrency", + "stopTriggered", + "stopPrice", + "timeInForce", + "postOnly", + "hidden", + "iceberg", + "visibleSize", + "cancelAfter", + "channel", + "clientOid", + "remark", + "cancelExist", + "createdAt", + "lastUpdatedAt", + "tradeType", + "inOrderBook", + "cancelledSize", + "cancelledFunds", + "remainSize", + "remainFunds", + "tax", + "active" ] } }, @@ -1764,7 +939,7 @@ } } }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470200", + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470202", "x-abandon": "normal", "x-domain": "Spot", "x-api-channel": "Private", @@ -1772,11 +947,11 @@ "x-api-rate-limit-pool": "Spot", "x-sdk-service": "Margin", "x-sdk-sub-service": "Order", - "x-sdk-method-name": "getTradeHistory", - "x-sdk-method-description": "This endpoint can be used to obtain a list of the latest Margin transaction details. The returned data is sorted in descending order according to the latest update time of the order.", + "x-sdk-method-name": "getOrderByOrderId", + "x-sdk-method-description": "This endpoint can be used to obtain information for a single Margin order using the order id. After the user successfully places an order, the order is in Active state, and the user can use inOrderBook to determine whether the order has entered the order. Canceled or fully filled orders are marked as completed Done status.", "x-api-rate-limit": 5, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"items\\\": [\\n {\\n \\\"id\\\": 137891621991,\\n \\\"symbol\\\": \\\"BTC-USDT\\\",\\n \\\"tradeId\\\": 11040911994273793,\\n \\\"orderId\\\": \\\"671868085584bc0007d85f46\\\",\\n \\\"counterOrderId\\\": \\\"67186805b7cbdf00071621f9\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"liquidity\\\": \\\"taker\\\",\\n \\\"forceTaker\\\": false,\\n \\\"price\\\": \\\"67141.6\\\",\\n \\\"size\\\": \\\"0.00001\\\",\\n \\\"funds\\\": \\\"0.671416\\\",\\n \\\"fee\\\": \\\"0.000671416\\\",\\n \\\"feeRate\\\": \\\"0.001\\\",\\n \\\"feeCurrency\\\": \\\"USDT\\\",\\n \\\"stop\\\": \\\"\\\",\\n \\\"tradeType\\\": \\\"MARGIN_TRADE\\\",\\n \\\"tax\\\": \\\"0\\\",\\n \\\"taxRate\\\": \\\"0\\\",\\n \\\"type\\\": \\\"limit\\\",\\n \\\"createdAt\\\": 1729652744998\\n }\\n ],\\n \\\"lastId\\\": 137891621991\\n }\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"tradeType\\\": \\\"MARGIN_TRADE\\\", \\\"orderId\\\": \\\"example_string_default_value\\\", \\\"side\\\": \\\"buy\\\", \\\"type\\\": \\\"limit\\\", \\\"lastId\\\": 254062248624417, \\\"limit\\\": 100, \\\"startAt\\\": 1728663338000, \\\"endAt\\\": 1728692138000}" + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"id\\\": \\\"671667306afcdb000723107f\\\",\\n \\\"symbol\\\": \\\"BTC-USDT\\\",\\n \\\"opType\\\": \\\"DEAL\\\",\\n \\\"type\\\": \\\"limit\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"price\\\": \\\"50000\\\",\\n \\\"size\\\": \\\"0.00001\\\",\\n \\\"funds\\\": \\\"0.5\\\",\\n \\\"dealSize\\\": \\\"0\\\",\\n \\\"dealFunds\\\": \\\"0\\\",\\n \\\"fee\\\": \\\"0\\\",\\n \\\"feeCurrency\\\": \\\"USDT\\\",\\n \\\"stp\\\": null,\\n \\\"stop\\\": null,\\n \\\"stopTriggered\\\": false,\\n \\\"stopPrice\\\": \\\"0\\\",\\n \\\"timeInForce\\\": \\\"GTC\\\",\\n \\\"postOnly\\\": false,\\n \\\"hidden\\\": false,\\n \\\"iceberg\\\": false,\\n \\\"visibleSize\\\": \\\"0\\\",\\n \\\"cancelAfter\\\": 0,\\n \\\"channel\\\": \\\"API\\\",\\n \\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\",\\n \\\"remark\\\": null,\\n \\\"tags\\\": null,\\n \\\"cancelExist\\\": false,\\n \\\"createdAt\\\": 1729521456248,\\n \\\"lastUpdatedAt\\\": 1729651011877,\\n \\\"tradeType\\\": \\\"MARGIN_TRADE\\\",\\n \\\"inOrderBook\\\": true,\\n \\\"cancelledSize\\\": \\\"0\\\",\\n \\\"cancelledFunds\\\": \\\"0\\\",\\n \\\"remainSize\\\": \\\"0.00001\\\",\\n \\\"remainFunds\\\": \\\"0.5\\\",\\n \\\"tax\\\": \\\"0\\\",\\n \\\"active\\\": true\\n }\\n}", + "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"orderId\\\": \\\"671667306afcdb000723107f\\\"}" } }, "/api/v3/hf/margin/orders/client-order/{clientOid}": { @@ -2103,76 +1278,613 @@ }, "lastUpdatedAt": { "type": "integer", - "format": "int64" - }, - "tradeType": { - "type": "string", - "description": "Trade type, redundancy param" - }, - "inOrderBook": { - "type": "boolean", - "description": "Whether to enter the orderbook: true: enter the orderbook; false: not enter the orderbook" - }, - "cancelledSize": { - "type": "string", - "description": "Number of canceled transactions" - }, - "cancelledFunds": { - "type": "string", - "description": "Funds of canceled transactions" - }, - "remainSize": { - "type": "string", - "description": "Number of remain transactions" - }, - "remainFunds": { - "type": "string", - "description": "Funds of remain transactions" + "format": "int64" + }, + "tradeType": { + "type": "string", + "description": "Trade type, redundancy param" + }, + "inOrderBook": { + "type": "boolean", + "description": "Whether to enter the orderbook: true: enter the orderbook; false: not enter the orderbook" + }, + "cancelledSize": { + "type": "string", + "description": "Number of canceled transactions" + }, + "cancelledFunds": { + "type": "string", + "description": "Funds of canceled transactions" + }, + "remainSize": { + "type": "string", + "description": "Number of remain transactions" + }, + "remainFunds": { + "type": "string", + "description": "Funds of remain transactions" + }, + "tax": { + "type": "string", + "description": "Users in some regions need query this field" + }, + "active": { + "type": "boolean", + "description": "Order status: true-The status of the order isactive; false-The status of the order is done" + } + }, + "required": [ + "id", + "symbol", + "opType", + "type", + "side", + "price", + "size", + "funds", + "dealSize", + "dealFunds", + "fee", + "feeCurrency", + "stopTriggered", + "stopPrice", + "timeInForce", + "postOnly", + "hidden", + "iceberg", + "visibleSize", + "cancelAfter", + "channel", + "clientOid", + "cancelExist", + "createdAt", + "lastUpdatedAt", + "tradeType", + "inOrderBook", + "cancelledSize", + "cancelledFunds", + "remainSize", + "remainFunds", + "tax", + "active" + ] + } + }, + "required": [ + "code", + "data" + ] + } + } + } + } + }, + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470203", + "x-abandon": "normal", + "x-domain": "Spot", + "x-api-channel": "Private", + "x-api-permission": "General", + "x-api-rate-limit-pool": "Spot", + "x-sdk-service": "Margin", + "x-sdk-sub-service": "Order", + "x-sdk-method-name": "getOrderByClientOid", + "x-sdk-method-description": "This endpoint can be used to obtain information for a single Margin order using the client order id. After the user successfully places an order, the order is in Active state, and the user can use inOrderBook to determine whether the order has entered the order. Canceled or fully filled orders are marked as completed Done status.", + "x-api-rate-limit": 5, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"id\\\": \\\"671667306afcdb000723107f\\\",\\n \\\"symbol\\\": \\\"BTC-USDT\\\",\\n \\\"opType\\\": \\\"DEAL\\\",\\n \\\"type\\\": \\\"limit\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"price\\\": \\\"50000\\\",\\n \\\"size\\\": \\\"0.00001\\\",\\n \\\"funds\\\": \\\"0.5\\\",\\n \\\"dealSize\\\": \\\"0\\\",\\n \\\"dealFunds\\\": \\\"0\\\",\\n \\\"fee\\\": \\\"0\\\",\\n \\\"feeCurrency\\\": \\\"USDT\\\",\\n \\\"stp\\\": null,\\n \\\"stop\\\": null,\\n \\\"stopTriggered\\\": false,\\n \\\"stopPrice\\\": \\\"0\\\",\\n \\\"timeInForce\\\": \\\"GTC\\\",\\n \\\"postOnly\\\": false,\\n \\\"hidden\\\": false,\\n \\\"iceberg\\\": false,\\n \\\"visibleSize\\\": \\\"0\\\",\\n \\\"cancelAfter\\\": 0,\\n \\\"channel\\\": \\\"API\\\",\\n \\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\",\\n \\\"remark\\\": null,\\n \\\"tags\\\": null,\\n \\\"cancelExist\\\": false,\\n \\\"createdAt\\\": 1729521456248,\\n \\\"lastUpdatedAt\\\": 1729651011877,\\n \\\"tradeType\\\": \\\"MARGIN_TRADE\\\",\\n \\\"inOrderBook\\\": true,\\n \\\"cancelledSize\\\": \\\"0\\\",\\n \\\"cancelledFunds\\\": \\\"0\\\",\\n \\\"remainSize\\\": \\\"0.00001\\\",\\n \\\"remainFunds\\\": \\\"0.5\\\",\\n \\\"tax\\\": \\\"0\\\",\\n \\\"active\\\": true\\n }\\n}", + "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\"}" + } + }, + "/api/v3/hf/margin/orders": { + "delete": { + "summary": "Cancel All Orders By Symbol", + "deprecated": false, + "description": "This interface can cancel all open Margin orders by symbol This endpoint only sends cancellation requests. The results of the requests must be obtained by checking the order status or subscribing to websocket.", + "tags": [], + "parameters": [ + { + "name": "symbol", + "in": "query", + "description": "symbol", + "required": true, + "schema": { + "type": "string", + "example": [ + "BTC-USDT", + "ETH-USDT", + "KCS-USDT" + ] + } + }, + { + "name": "tradeType", + "in": "query", + "description": "Transaction type: MARGIN_TRADE - cross margin trade, MARGIN_ISOLATED_TRADE - isolated margin trade", + "required": true, + "schema": { + "type": "string", + "enum": [ + "MARGIN_TRADE", + "MARGIN_ISOLATED_TRADE" + ], + "x-api-enum": [ + { + "value": "MARGIN_TRADE", + "name": "", + "description": "" + }, + { + "value": "MARGIN_ISOLATED_TRADE", + "name": "", + "description": "" + } + ] + } + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "string" + } + }, + "required": [ + "code", + "data" + ] + } + } + } + } + }, + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470197", + "x-abandon": "normal", + "x-domain": "Spot", + "x-api-channel": "Private", + "x-api-permission": "Margin", + "x-api-rate-limit-pool": "Spot", + "x-sdk-service": "Margin", + "x-sdk-sub-service": "Order", + "x-sdk-method-name": "cancelAllOrdersBySymbol", + "x-sdk-method-description": "This interface can cancel all open Margin orders by symbol This endpoint only sends cancellation requests. The results of the requests must be obtained by checking the order status or subscribing to websocket.", + "x-api-rate-limit": 10, + "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":\\\"success\\\"}", + "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"tradeType\\\": \\\"MARGIN_TRADE\\\"}" + } + }, + "/api/v3/hf/margin/order/active/symbols": { + "get": { + "summary": "Get Symbols With Open Order", + "deprecated": false, + "description": "This interface can query all Margin symbol that has active orders", + "tags": [], + "parameters": [ + { + "name": "tradeType", + "in": "query", + "description": "Cross Margin: MARGIN_TRADE, Isolated Margin: MARGIN_ISOLATED_TRADE\n", + "required": true, + "schema": { + "type": "string", + "enum": [ + "MARGIN_TRADE", + "MARGIN_ISOLATED_TRADE" + ], + "x-api-enum": [ + { + "value": "MARGIN_TRADE", + "name": "", + "description": "" + }, + { + "value": "MARGIN_ISOLATED_TRADE", + "name": "", + "description": "" + } + ] + } + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "object", + "properties": { + "symbolSize": { + "type": "integer", + "description": "Symbol Size" }, - "tax": { - "type": "string", - "description": "Users in some regions need query this field" + "symbols": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The symbol that has active orders" + } + }, + "required": [ + "symbolSize", + "symbols" + ] + } + }, + "required": [ + "code", + "data" + ] + } + } + } + } + }, + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470196", + "x-abandon": "normal", + "x-domain": "Spot", + "x-api-channel": "Private", + "x-api-permission": "Margin", + "x-api-rate-limit-pool": "Spot", + "x-sdk-service": "Margin", + "x-sdk-sub-service": "Order", + "x-sdk-method-name": "getSymbolsWithOpenOrder", + "x-sdk-method-description": "This interface can query all Margin symbol that has active orders", + "x-api-rate-limit": 2, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"symbolSize\\\": 1,\\n \\\"symbols\\\": [\\n \\\"BTC-USDT\\\"\\n ]\\n }\\n}", + "x-request-example": "{\\\"tradeType\\\": \\\"MARGIN_TRADE\\\"}" + } + }, + "/api/v3/hf/margin/orders/active": { + "get": { + "summary": "Get Open Orders", + "deprecated": false, + "description": "This interface is to obtain all Margin active order lists, and the return value of the active order interface is the paged data of all uncompleted order lists. The returned data is sorted in descending order according to the latest update time of the order. After the user successfully places an order, the order is in Active state, and the user can use inOrderBook to determine whether the order has entered the order. Canceled or fully filled orders are marked as completed Done status.", + "tags": [], + "parameters": [ + { + "name": "symbol", + "in": "query", + "description": "symbol", + "required": true, + "schema": { + "type": "string", + "example": [ + "BTC-USDT", + "ETH-USDT", + "KCS-USDT" + ] + } + }, + { + "name": "tradeType", + "in": "query", + "description": "Order type: MARGIN_TRADE - cross margin trading order, MARGIN_ISOLATED_TRADE - isolated margin trading order", + "required": true, + "schema": { + "type": "string", + "enum": [ + "MARGIN_TRADE", + "MARGIN_ISOLATED_TRADE" + ], + "x-api-enum": [ + { + "value": "MARGIN_TRADE", + "name": "", + "description": "" + }, + { + "value": "MARGIN_ISOLATED_TRADE", + "name": "", + "description": "" + } + ] + } + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The unique order id generated by the trading system" + }, + "symbol": { + "type": "string", + "description": "symbol", + "example": [ + "BTC-USDT", + "ETH-USDT", + "KCS-USDT" + ] + }, + "opType": { + "type": "string" + }, + "type": { + "type": "string", + "description": "Specify if the order is an 'limit' order or 'market' order. ", + "enum": [ + "limit", + "market" + ], + "x-api-enum": [ + { + "value": "limit", + "name": "", + "description": "" + }, + { + "value": "market", + "name": "", + "description": "" + } + ] + }, + "side": { + "type": "string", + "description": "Buy or sell", + "enum": [ + "buy", + "sell" + ], + "x-api-enum": [ + { + "value": "buy", + "name": "", + "description": "" + }, + { + "value": "sell", + "name": "", + "description": "" + } + ] + }, + "price": { + "type": "string", + "description": "Order price" + }, + "size": { + "type": "string", + "description": "Order size" + }, + "funds": { + "type": "string", + "description": "Order Funds" + }, + "dealSize": { + "type": "string", + "description": "Number of filled transactions" + }, + "dealFunds": { + "type": "string", + "description": "Funds of filled transactions" + }, + "fee": { + "type": "string", + "description": "trading fee" + }, + "feeCurrency": { + "type": "string", + "description": "currency used to calculate trading fee" + }, + "stp": { + "type": "string", + "description": "[Self Trade Prevention](https://www.kucoin.com/docs-new/doc-338146) is divided into these strategies: CN, CO, CB , and DC", + "enum": [ + "DC", + "CO", + "CN", + "CB" + ], + "x-api-enum": [ + { + "value": "DC", + "name": "", + "description": "" + }, + { + "value": "CO", + "name": "", + "description": "" + }, + { + "value": "CN", + "name": "", + "description": "" + }, + { + "value": "CB", + "name": "", + "description": "" + } + ] + }, + "stop": { + "type": "string" + }, + "stopTriggered": { + "type": "boolean" + }, + "stopPrice": { + "type": "string" + }, + "timeInForce": { + "type": "string", + "description": "Time in force", + "enum": [ + "GTC", + "GTT", + "IOC", + "FOK" + ], + "x-api-enum": [ + { + "value": "GTC", + "name": "", + "description": "" + }, + { + "value": "GTT", + "name": "", + "description": "" + }, + { + "value": "IOC", + "name": "", + "description": "" + }, + { + "value": "FOK", + "name": "", + "description": "" + } + ] + }, + "postOnly": { + "type": "boolean", + "description": "Whether its a postOnly order." + }, + "hidden": { + "type": "boolean", + "description": "Whether its a hidden order." + }, + "iceberg": { + "type": "boolean", + "description": "Whether its a iceberg order." + }, + "visibleSize": { + "type": "string", + "description": "Visible size of iceberg order in order book." + }, + "cancelAfter": { + "type": "integer", + "description": "A GTT timeInForce that expires in n seconds" + }, + "channel": { + "type": "string" + }, + "clientOid": { + "type": "string", + "description": "Client Order Id,unique identifier created by the user" + }, + "remark": { + "type": "string", + "description": "Order placement remarks" + }, + "tags": { + "type": "string", + "description": "Order tag" + }, + "cancelExist": { + "type": "boolean", + "description": "Whether there is a cancellation record for the order." + }, + "createdAt": { + "type": "integer", + "format": "int64" + }, + "lastUpdatedAt": { + "type": "integer", + "format": "int64" + }, + "tradeType": { + "type": "string", + "description": "Trade type, redundancy param" + }, + "inOrderBook": { + "type": "boolean", + "description": "Whether to enter the orderbook: true: enter the orderbook; false: not enter the orderbook" + }, + "cancelledSize": { + "type": "string", + "description": "Number of canceled transactions" + }, + "cancelledFunds": { + "type": "string", + "description": "Funds of canceled transactions" + }, + "remainSize": { + "type": "string", + "description": "Number of remain transactions" + }, + "remainFunds": { + "type": "string", + "description": "Funds of remain transactions" + }, + "tax": { + "type": "string", + "description": "Users in some regions need query this field" + }, + "active": { + "type": "boolean", + "description": "Order status: true-The status of the order isactive; false-The status of the order is done" + } }, - "active": { - "type": "boolean", - "description": "Order status: true-The status of the order isactive; false-The status of the order is done" - } - }, - "required": [ - "id", - "symbol", - "opType", - "type", - "side", - "price", - "size", - "funds", - "dealSize", - "dealFunds", - "fee", - "feeCurrency", - "stopTriggered", - "stopPrice", - "timeInForce", - "postOnly", - "hidden", - "iceberg", - "visibleSize", - "cancelAfter", - "channel", - "clientOid", - "cancelExist", - "createdAt", - "lastUpdatedAt", - "tradeType", - "inOrderBook", - "cancelledSize", - "cancelledFunds", - "remainSize", - "remainFunds", - "tax", - "active" - ] + "required": [ + "stopPrice", + "id", + "symbol", + "opType", + "type", + "side", + "price", + "size", + "funds", + "dealSize", + "dealFunds", + "fee", + "feeCurrency", + "stopTriggered", + "timeInForce", + "postOnly", + "hidden", + "iceberg", + "visibleSize", + "cancelAfter", + "channel", + "clientOid", + "cancelExist", + "tradeType", + "inOrderBook", + "cancelledSize", + "cancelledFunds", + "remainSize", + "remainFunds", + "tax", + "active", + "createdAt", + "lastUpdatedAt" + ] + } } }, "required": [ @@ -2184,7 +1896,7 @@ } } }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470203", + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470198", "x-abandon": "normal", "x-domain": "Spot", "x-api-channel": "Private", @@ -2192,20 +1904,152 @@ "x-api-rate-limit-pool": "Spot", "x-sdk-service": "Margin", "x-sdk-sub-service": "Order", - "x-sdk-method-name": "getOrderByClientOid", - "x-sdk-method-description": "This endpoint can be used to obtain information for a single Margin order using the client order id. After the user successfully places an order, the order is in Active state, and the user can use inOrderBook to determine whether the order has entered the order. Canceled or fully filled orders are marked as completed Done status.", - "x-api-rate-limit": 5, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"id\\\": \\\"671667306afcdb000723107f\\\",\\n \\\"symbol\\\": \\\"BTC-USDT\\\",\\n \\\"opType\\\": \\\"DEAL\\\",\\n \\\"type\\\": \\\"limit\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"price\\\": \\\"50000\\\",\\n \\\"size\\\": \\\"0.00001\\\",\\n \\\"funds\\\": \\\"0.5\\\",\\n \\\"dealSize\\\": \\\"0\\\",\\n \\\"dealFunds\\\": \\\"0\\\",\\n \\\"fee\\\": \\\"0\\\",\\n \\\"feeCurrency\\\": \\\"USDT\\\",\\n \\\"stp\\\": null,\\n \\\"stop\\\": null,\\n \\\"stopTriggered\\\": false,\\n \\\"stopPrice\\\": \\\"0\\\",\\n \\\"timeInForce\\\": \\\"GTC\\\",\\n \\\"postOnly\\\": false,\\n \\\"hidden\\\": false,\\n \\\"iceberg\\\": false,\\n \\\"visibleSize\\\": \\\"0\\\",\\n \\\"cancelAfter\\\": 0,\\n \\\"channel\\\": \\\"API\\\",\\n \\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\",\\n \\\"remark\\\": null,\\n \\\"tags\\\": null,\\n \\\"cancelExist\\\": false,\\n \\\"createdAt\\\": 1729521456248,\\n \\\"lastUpdatedAt\\\": 1729651011877,\\n \\\"tradeType\\\": \\\"MARGIN_TRADE\\\",\\n \\\"inOrderBook\\\": true,\\n \\\"cancelledSize\\\": \\\"0\\\",\\n \\\"cancelledFunds\\\": \\\"0\\\",\\n \\\"remainSize\\\": \\\"0.00001\\\",\\n \\\"remainFunds\\\": \\\"0.5\\\",\\n \\\"tax\\\": \\\"0\\\",\\n \\\"active\\\": true\\n }\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\"}" + "x-sdk-method-name": "getOpenOrders", + "x-sdk-method-description": "This interface is to obtain all Margin active order lists, and the return value of the active order interface is the paged data of all uncompleted order lists. The returned data is sorted in descending order according to the latest update time of the order. After the user successfully places an order, the order is in Active state, and the user can use inOrderBook to determine whether the order has entered the order. Canceled or fully filled orders are marked as completed Done status.", + "x-api-rate-limit": 4, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": [\\n {\\n \\\"id\\\": \\\"671667306afcdb000723107f\\\",\\n \\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\",\\n \\\"symbol\\\": \\\"BTC-USDT\\\",\\n \\\"opType\\\": \\\"DEAL\\\",\\n \\\"type\\\": \\\"limit\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"price\\\": \\\"50000\\\",\\n \\\"size\\\": \\\"0.00001\\\",\\n \\\"funds\\\": \\\"0.5\\\",\\n \\\"dealSize\\\": \\\"0\\\",\\n \\\"dealFunds\\\": \\\"0\\\",\\n \\\"remainSize\\\": \\\"0.00001\\\",\\n \\\"remainFunds\\\": \\\"0.5\\\",\\n \\\"cancelledSize\\\": \\\"0\\\",\\n \\\"cancelledFunds\\\": \\\"0\\\",\\n \\\"fee\\\": \\\"0\\\",\\n \\\"feeCurrency\\\": \\\"USDT\\\",\\n \\\"stp\\\": null,\\n \\\"stop\\\": null,\\n \\\"stopTriggered\\\": false,\\n \\\"stopPrice\\\": \\\"0\\\",\\n \\\"timeInForce\\\": \\\"GTC\\\",\\n \\\"postOnly\\\": false,\\n \\\"hidden\\\": false,\\n \\\"iceberg\\\": false,\\n \\\"visibleSize\\\": \\\"0\\\",\\n \\\"cancelAfter\\\": 0,\\n \\\"channel\\\": \\\"API\\\",\\n \\\"remark\\\": null,\\n \\\"tags\\\": null,\\n \\\"cancelExist\\\": false,\\n \\\"tradeType\\\": \\\"MARGIN_TRADE\\\",\\n \\\"inOrderBook\\\": true,\\n \\\"active\\\": true,\\n \\\"tax\\\": \\\"0\\\",\\n \\\"createdAt\\\": 1729521456248,\\n \\\"lastUpdatedAt\\\": 1729521460940\\n }\\n ]\\n}", + "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"tradeType\\\": \\\"MARGIN_TRADE\\\"}" } }, - "/api/v3/hf/margin/order": { - "post": { - "summary": "Add Order", + "/api/v3/hf/margin/orders/done": { + "get": { + "summary": "Get Closed Orders", "deprecated": false, - "description": "Place order to the Cross-margin or Isolated-margin trading system, you can place two major types of orders: limit and market. Orders can only be placed if your account has sufficient funds. Once an order is placed, your funds will be put on hold for the duration of the order. The amount of funds on hold depends on the order type and parameters specified.", + "description": "This interface is to obtain all Margin closed order lists, and the return value of the active order interface is the paged data of all uncompleted order lists. The returned data is sorted in descending order according to the latest update time of the order. After the user successfully places an order, the order is in Active state, and the user can use inOrderBook to determine whether the order has entered the order. Canceled or fully filled orders are marked as completed Done status.", "tags": [], - "parameters": [], + "parameters": [ + { + "name": "symbol", + "in": "query", + "description": "symbol", + "required": true, + "schema": { + "type": "string", + "example": [ + "BTC-USDT", + "ETH-USDT", + "KCS-USDT" + ] + } + }, + { + "name": "tradeType", + "in": "query", + "description": "Transaction type: MARGIN_TRADE - cross margin trade, MARGIN_ISOLATED_TRADE - isolated margin trade", + "required": true, + "schema": { + "type": "string", + "enum": [ + "MARGIN_TRADE", + "MARGIN_ISOLATED_TRADE" + ], + "x-api-enum": [ + { + "value": "MARGIN_TRADE", + "name": "", + "description": "" + }, + { + "value": "MARGIN_ISOLATED_TRADE", + "name": "", + "description": "" + } + ] + } + }, + { + "name": "side", + "in": "query", + "description": "specify if the order is to 'buy' or 'sell'", + "required": false, + "schema": { + "type": "string", + "enum": [ + "buy", + "sell" + ], + "x-api-enum": [ + { + "value": "buy", + "name": "", + "description": "" + }, + { + "value": "sell", + "name": "", + "description": "" + } + ] + } + }, + { + "name": "type", + "in": "query", + "description": "specify if the order is an 'limit' order or 'market' order. ", + "required": false, + "schema": { + "type": "string", + "enum": [ + "limit", + "market" + ], + "x-api-enum": [ + { + "value": "limit", + "name": "", + "description": "" + }, + { + "value": "market", + "name": "", + "description": "" + } + ] + } + }, + { + "name": "lastId", + "in": "query", + "description": "The id of the last set of data from the previous batch of data. By default, the latest information is given.\nlastId is used to filter data and paginate. If lastId is not entered, the default is a maximum of 100 returned data items. The return results include lastId,which can be used as a query parameter to look up new data from the next page.", + "required": false, + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "limit", + "in": "query", + "description": "Default20,Max100", + "required": false, + "schema": { + "type": "integer", + "default": 20, + "minimum": 1, + "maximum": 100 + } + }, + { + "name": "startAt", + "in": "query", + "description": "Start time (milisecond)", + "required": false, + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "endAt", + "in": "query", + "description": "End time (milisecond)", + "required": false, + "schema": { + "type": "integer", + "format": "int64" + } + } + ], "responses": { "200": { "description": "", @@ -2220,28 +2064,278 @@ "data": { "type": "object", "properties": { - "orderId": { - "type": "string", - "description": "The unique order id generated by the trading system,which can be used later for further actions such as canceling the order." - }, - "loanApplyId": { - "type": "string", - "description": "Borrow order id. The field is returned only after placing the order under the mode of Auto-Borrow." - }, - "borrowSize": { - "type": "string", - "description": "Borrowed amount. The field is returned only after placing the order under the mode of Auto-Borrow." + "lastId": { + "type": "integer", + "description": "The id of the last set of data from the previous batch of data. By default, the latest information is given.\nlastId is used to filter data and paginate. If lastId is not entered, the default is a maximum of 100 returned data items. The return results include lastId,which can be used as a query parameter to look up new data from the next page.", + "format": "int64" }, - "clientOid": { - "type": "string", - "description": "The user self-defined order id." + "items": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The unique order id generated by the trading system" + }, + "symbol": { + "type": "string", + "description": "symbol", + "example": [ + "BTC-USDT", + "ETH-USDT", + "KCS-USDT" + ] + }, + "opType": { + "type": "string" + }, + "type": { + "type": "string", + "description": "Specify if the order is an 'limit' order or 'market' order. ", + "enum": [ + "limit", + "market" + ], + "x-api-enum": [ + { + "value": "limit", + "name": "", + "description": "" + }, + { + "value": "market", + "name": "", + "description": "" + } + ] + }, + "side": { + "type": "string", + "description": "Buy or sell" + }, + "price": { + "type": "string", + "description": "Order price" + }, + "size": { + "type": "string", + "description": "Order size" + }, + "funds": { + "type": "string", + "description": "Order Funds" + }, + "dealSize": { + "type": "string", + "description": "Number of filled transactions" + }, + "dealFunds": { + "type": "string", + "description": "Funds of filled transactions" + }, + "fee": { + "type": "string", + "description": "[Handling fees](https://www.kucoin.com/docs-new/api-5327739)" + }, + "feeCurrency": { + "type": "string", + "description": "currency used to calculate trading fee" + }, + "stp": { + "type": "string", + "description": "[Self Trade Prevention](https://www.kucoin.com/docs-new/doc-338146) is divided into these strategies: CN, CO, CB , and DC", + "enum": [ + "DC", + "CO", + "CN", + "CB" + ], + "x-api-enum": [ + { + "value": "DC", + "name": "", + "description": "" + }, + { + "value": "CO", + "name": "", + "description": "" + }, + { + "value": "CN", + "name": "", + "description": "" + }, + { + "value": "CB", + "name": "", + "description": "" + } + ] + }, + "stop": { + "type": "string" + }, + "stopTriggered": { + "type": "boolean" + }, + "stopPrice": { + "type": "string" + }, + "timeInForce": { + "type": "string", + "description": "Time in force", + "enum": [ + "GTC", + "GTT", + "IOC", + "FOK" + ], + "x-api-enum": [ + { + "value": "GTC", + "name": "", + "description": "" + }, + { + "value": "GTT", + "name": "", + "description": "" + }, + { + "value": "IOC", + "name": "", + "description": "" + }, + { + "value": "FOK", + "name": "", + "description": "" + } + ] + }, + "postOnly": { + "type": "boolean", + "description": "Whether its a postOnly order." + }, + "hidden": { + "type": "boolean", + "description": "Whether its a hidden order." + }, + "iceberg": { + "type": "boolean", + "description": "Whether its a iceberg order." + }, + "visibleSize": { + "type": "string", + "description": "Visible size of iceberg order in order book." + }, + "cancelAfter": { + "type": "integer", + "description": "A GTT timeInForce that expires in n seconds" + }, + "channel": { + "type": "string" + }, + "clientOid": { + "type": "string", + "description": "Client Order Id,unique identifier created by the user" + }, + "remark": { + "type": "string", + "description": "Order placement remarks" + }, + "tags": { + "type": "string", + "description": "Order tag" + }, + "cancelExist": { + "type": "boolean", + "description": "Whether there is a cancellation record for the order." + }, + "createdAt": { + "type": "integer", + "format": "int64" + }, + "lastUpdatedAt": { + "type": "integer", + "format": "int64" + }, + "tradeType": { + "type": "string", + "description": "Trade type, redundancy param" + }, + "inOrderBook": { + "type": "boolean", + "description": "Whether to enter the orderbook: true: enter the orderbook; false: not enter the orderbook" + }, + "cancelledSize": { + "type": "string", + "description": "Number of canceled transactions" + }, + "cancelledFunds": { + "type": "string", + "description": "Funds of canceled transactions" + }, + "remainSize": { + "type": "string", + "description": "Number of remain transactions" + }, + "remainFunds": { + "type": "string", + "description": "Funds of remain transactions" + }, + "tax": { + "type": "string", + "description": "Users in some regions need query this field" + }, + "active": { + "type": "boolean", + "description": "Order status: true-The status of the order isactive; false-The status of the order is done" + } + }, + "required": [ + "id", + "symbol", + "opType", + "type", + "side", + "price", + "size", + "funds", + "dealSize", + "dealFunds", + "fee", + "feeCurrency", + "stopTriggered", + "stopPrice", + "timeInForce", + "postOnly", + "hidden", + "iceberg", + "visibleSize", + "cancelAfter", + "channel", + "clientOid", + "cancelExist", + "createdAt", + "lastUpdatedAt", + "tradeType", + "inOrderBook", + "cancelledSize", + "cancelledFunds", + "remainSize", + "remainFunds", + "tax", + "active" + ] + } } }, "required": [ - "orderId", - "borrowSize", - "clientOid", - "loanApplyId" + "lastId", + "items" ] } }, @@ -2254,221 +2348,169 @@ } } }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470204", + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470199", "x-abandon": "normal", "x-domain": "Spot", "x-api-channel": "Private", - "x-api-permission": "Margin", + "x-api-permission": "General", "x-api-rate-limit-pool": "Spot", "x-sdk-service": "Margin", "x-sdk-sub-service": "Order", - "x-sdk-method-name": "addOrder", - "x-sdk-method-description": "Place order to the Cross-margin or Isolated-margin trading system, you can place two major types of orders: limit and market. Orders can only be placed if your account has sufficient funds. Once an order is placed, your funds will be put on hold for the duration of the order. The amount of funds on hold depends on the order type and parameters specified.", - "x-api-rate-limit": 5, - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "clientOid": { - "type": "string", - "description": "Client Order Id,The ClientOid field is a unique ID created by the user(we recommend using a UUID), and can only contain numbers, letters, underscores (_), and hyphens (-). This field is returned when order information is obtained. You can use clientOid to tag your orders. ClientOid is different from the order ID created by the service provider. Please do not initiate requests using the same clientOid. The maximum length for the ClientOid is 40 characters.\n\nPlease remember the orderId created by the service provider, it used to check for updates in order status.", - "example": [ - "5c52e11203aa677f33e493fb" - ] - }, - "side": { - "type": "string", - "description": "specify if the order is to 'buy' or 'sell'", - "enum": [ - "buy", - "sell" - ], - "x-api-enum": [ - { - "value": "buy", - "name": "", - "description": "" - }, - { - "value": "sell", - "name": "", - "description": "" - } - ], - "example": [ - "buy" - ] - }, - "symbol": { - "type": "string", - "description": "symbol", - "example": [ - "BTC-USDT", - "ETH-USDT", - "KCS-USDT" - ] - }, - "type": { - "type": "string", - "description": "specify if the order is an 'limit' order or 'market' order. \n\nThe type of order you specify when you place your order determines whether or not you need to request other parameters and also affects the execution of the matching engine.\n\nWhen placing a limit order, you must specify a price and size. The system will try to match the order according to market price or a price better than market price. If the order cannot be immediately matched, it will stay in the order book until it is matched or the user cancels.\n\nUnlike limit orders, the price for market orders fluctuates with market prices. When placing a market order, you do not need to specify a price, you only need to specify a quantity. Market orders are filled immediately and will not enter the order book. All market orders are takers and a taker fee will be charged.", - "enum": [ - "limit", - "market" - ], - "default": "limit", - "x-api-enum": [ - { - "value": "limit", - "name": "", - "description": "" - }, - { - "value": "market", - "name": "", - "description": "" - } - ] - }, - "stp": { - "type": "string", - "description": "[Self Trade Prevention](https://www.kucoin.com/docs-new/doc-338146) is divided into these strategies: CN, CO, CB , and DC", - "enum": [ - "DC", - "CO", - "CN", - "CB" - ], - "x-api-enum": [ - { - "value": "DC", - "name": "", - "description": "" - }, - { - "value": "CO", - "name": "", - "description": "" - }, - { - "value": "CN", - "name": "", - "description": "" - }, - { - "value": "CB", - "name": "", - "description": "" - } - ] - }, - "price": { - "type": "string", - "description": "Specify price for order\n\nWhen placing a limit order, the price must be based on priceIncrement for the trading pair. The price increment (priceIncrement) is the price precision for the trading pair. For example, for the BTC-USDT trading pair, the priceIncrement is 0.00001000. So the price for your orders cannot be less than 0.00001000 and must be a multiple of priceIncrement. Otherwise, the order will return an invalid priceIncrement error." - }, - "size": { - "type": "string", - "description": "Specify quantity for order\n\nWhen **type** is limit, size refers to the amount of trading targets (the asset name written in front) for the trading pair. Teh Size must be based on the baseIncrement of the trading pair. The baseIncrement represents the precision for the trading pair. The size of an order must be a positive-integer multiple of baseIncrement and must be between baseMinSize and baseMaxSize.\n\nWhen **type** is market, select one out of two: size or funds" - }, - "timeInForce": { - "type": "string", - "description": "[Time in force](https://www.kucoin.com/docs-new/api-5176570) is a special strategy used during trading", - "enum": [ - "GTC", - "GTT", - "IOC", - "FOK" - ], - "default": "GTC", - "x-api-enum": [ - { - "value": "GTC", - "name": "", - "description": "" - }, - { - "value": "GTT", - "name": "", - "description": "" - }, - { - "value": "IOC", - "name": "", - "description": "" - }, - { - "value": "FOK", - "name": "", - "description": "" - } - ] - }, - "postOnly": { - "type": "boolean", - "default": false, - "description": "passive order labels, this is disabled when the order timing strategy is IOC or FOK" - }, - "hidden": { - "type": "boolean", - "description": "[Hidden order](https://www.kucoin.com/docs-new/doc-338146) or not (not shown in order book)", - "default": false - }, - "iceberg": { - "type": "boolean", - "description": "Whether or not only visible portions of orders are shown in [Iceberg orders](https://www.kucoin.com/docs-new/doc-338146)", - "default": false - }, - "visibleSize": { - "type": "string", - "description": "Maximum visible quantity in iceberg orders" - }, - "cancelAfter": { - "type": "integer", - "format": "int64", - "description": "Cancel after n seconds,the order timing strategy is GTT" - }, - "funds": { - "type": "string", - "description": "When **type** is market, select one out of two: size or funds" - }, - "isIsolated": { - "type": "boolean", - "description": "true - isolated margin ,false - cross margin. defult as false", - "default": false - }, - "autoBorrow": { - "type": "boolean", - "description": "When Margin Account has inefficient balance, our system autoborrows inefficient assets and opens positions according to the lowest market interest rate.", - "default": false - }, - "autoRepay": { - "type": "boolean", - "description": "AutoPay allows returning borrowed assets when you close a position. Our system automatically triggers the repayment and the maximum repayment amount equals to the filled-order amount.", - "default": false - } + "x-sdk-method-name": "getClosedOrders", + "x-sdk-method-description": "This interface is to obtain all Margin closed order lists, and the return value of the active order interface is the paged data of all uncompleted order lists. The returned data is sorted in descending order according to the latest update time of the order. After the user successfully places an order, the order is in Active state, and the user can use inOrderBook to determine whether the order has entered the order. Canceled or fully filled orders are marked as completed Done status.", + "x-api-rate-limit": 10, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"lastId\\\": 136112949351,\\n \\\"items\\\": [\\n {\\n \\\"id\\\": \\\"6716491f6afcdb00078365c8\\\",\\n \\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\",\\n \\\"symbol\\\": \\\"BTC-USDT\\\",\\n \\\"opType\\\": \\\"DEAL\\\",\\n \\\"type\\\": \\\"limit\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"price\\\": \\\"50000\\\",\\n \\\"size\\\": \\\"0.00001\\\",\\n \\\"funds\\\": \\\"0.5\\\",\\n \\\"dealSize\\\": \\\"0\\\",\\n \\\"dealFunds\\\": \\\"0\\\",\\n \\\"remainSize\\\": \\\"0\\\",\\n \\\"remainFunds\\\": \\\"0\\\",\\n \\\"cancelledSize\\\": \\\"0.00001\\\",\\n \\\"cancelledFunds\\\": \\\"0.5\\\",\\n \\\"fee\\\": \\\"0\\\",\\n \\\"feeCurrency\\\": \\\"USDT\\\",\\n \\\"stp\\\": null,\\n \\\"stop\\\": null,\\n \\\"stopTriggered\\\": false,\\n \\\"stopPrice\\\": \\\"0\\\",\\n \\\"timeInForce\\\": \\\"GTC\\\",\\n \\\"postOnly\\\": false,\\n \\\"hidden\\\": false,\\n \\\"iceberg\\\": false,\\n \\\"visibleSize\\\": \\\"0\\\",\\n \\\"cancelAfter\\\": 0,\\n \\\"channel\\\": \\\"API\\\",\\n \\\"remark\\\": null,\\n \\\"tags\\\": null,\\n \\\"cancelExist\\\": true,\\n \\\"tradeType\\\": \\\"MARGIN_TRADE\\\",\\n \\\"inOrderBook\\\": false,\\n \\\"active\\\": false,\\n \\\"tax\\\": \\\"0\\\",\\n \\\"createdAt\\\": 1729513759162,\\n \\\"lastUpdatedAt\\\": 1729521126597\\n }\\n ]\\n }\\n}", + "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"tradeType\\\": \\\"MARGIN_TRADE\\\", \\\"side\\\": \\\"buy\\\", \\\"type\\\": \\\"limit\\\", \\\"lastId\\\": 254062248624417, \\\"limit\\\": 20, \\\"startAt\\\": 1728663338000, \\\"endAt\\\": 1728692138000}" + } + }, + "/api/v3/hf/margin/fills": { + "get": { + "summary": "Get Trade History", + "deprecated": false, + "description": "This endpoint can be used to obtain a list of the latest Margin transaction details. The returned data is sorted in descending order according to the latest update time of the order.", + "tags": [], + "parameters": [ + { + "name": "symbol", + "in": "query", + "description": "symbol", + "required": true, + "schema": { + "type": "string", + "example": [ + "BTC-USDT", + "ETH-USDT", + "KCS-USDT" + ] + } + }, + { + "name": "tradeType", + "in": "query", + "description": "Trade type: MARGIN_TRADE - cross margin trade, MARGIN_ISOLATED_TRADE - isolated margin trade", + "required": true, + "schema": { + "type": "string", + "enum": [ + "MARGIN_TRADE", + "MARGIN_ISOLATED_TRADE" + ], + "x-api-enum": [ + { + "value": "MARGIN_TRADE", + "name": "", + "description": "" + }, + { + "value": "MARGIN_ISOLATED_TRADE", + "name": "", + "description": "" + } + ] + } + }, + { + "name": "orderId", + "in": "query", + "description": "The unique order id generated by the trading system\n(If orderId is specified,please ignore the other query parameters)", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "side", + "in": "query", + "description": "specify if the order is to 'buy' or 'sell'", + "required": false, + "schema": { + "type": "string", + "enum": [ + "buy", + "sell" + ], + "x-api-enum": [ + { + "value": "buy", + "name": "", + "description": "" }, - "required": [ - "symbol", - "side", - "clientOid" - ] - }, - "example": "//limit order\n{\n \"type\": \"limit\",\n \"symbol\": \"BTC-USDT\",\n \"side\": \"buy\",\n \"price\": \"50000\",\n \"size\": \"0.00001\",\n \"clientOid\": \"5c52e11203aa677f33e493fb\",\n \"remark\": \"order remarks\"\n}\n\n//market order 1\n// {\n// \"type\": \"market\",\n// \"symbol\": \"BTC-USDT\",\n// \"side\": \"buy\",\n// \"size\": \"0.00001\",\n// \"clientOid\": \"5c52e11203aa677f33e493fc\",\n// \"remark\": \"order remarks\"\n// }\n\n//market order 2\n// {\n// \"type\": \"market\",\n// \"symbol\": \"BTC-USDT\",\n// \"side\": \"buy\",\n// \"funds\": \"1\",\n// \"clientOid\": \"5c52e11203aa677f33e493fc\",\n// \"remark\": \"order remarks\"\n// }\n" + { + "value": "sell", + "name": "", + "description": "" + } + ] + } + }, + { + "name": "type", + "in": "query", + "description": "specify if the order is an 'limit' order or 'market' order. ", + "required": false, + "schema": { + "type": "string", + "enum": [ + "limit", + "market" + ], + "x-api-enum": [ + { + "value": "limit", + "name": "", + "description": "" + }, + { + "value": "market", + "name": "", + "description": "" + } + ] + } + }, + { + "name": "lastId", + "in": "query", + "description": "The id of the last set of data from the previous batch of data. By default, the latest information is given.\nlastId is used to filter data and paginate. If lastId is not entered, the default is a maximum of 100 returned data items. The return results include lastId,which can be used as a query parameter to look up new data from the next page.", + "required": false, + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "limit", + "in": "query", + "description": "Default100,Max200", + "required": false, + "schema": { + "type": "integer", + "default": 20, + "minimum": 1, + "maximum": 200 + } + }, + { + "name": "startAt", + "in": "query", + "description": "Start time (milisecond)", + "required": false, + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "endAt", + "in": "query", + "description": "End time (milisecond)", + "required": false, + "schema": { + "type": "integer", + "format": "int64" } } - }, - "x-response-example": "{\\n \\\"success\\\": true,\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"orderId\\\": \\\"671663e02188630007e21c9c\\\",\\n \\\"clientOid\\\": \\\"5c52e11203aa677f33e1493fb\\\",\\n \\\"borrowSize\\\": \\\"10.2\\\",\\n \\\"loanApplyId\\\": \\\"600656d9a33ac90009de4f6f\\\"\\n }\\n}", - "x-request-example": "{\\\"type\\\": \\\"limit\\\", \\\"symbol\\\": \\\"BTC-USDT\\\", \\\"side\\\": \\\"buy\\\", \\\"price\\\": \\\"50000\\\", \\\"size\\\": \\\"0.00001\\\", \\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\", \\\"remark\\\": \\\"order remarks\\\"}" - } - }, - "/api/v3/hf/margin/order/test": { - "post": { - "summary": "Add Order Test", - "deprecated": false, - "description": " Order test endpoint, the request parameters and return parameters of this endpoint are exactly the same as the order endpoint, and can be used to verify whether the signature is correct and other operations. After placing an order, the order will not enter the matching system, and the order cannot be queried.", - "tags": [], - "parameters": [], + ], "responses": { "200": { "description": "", @@ -2483,28 +2525,179 @@ "data": { "type": "object", "properties": { - "orderId": { - "type": "string", - "description": "The unique order id generated by the trading system,which can be used later for further actions such as canceling the order." - }, - "loanApplyId": { - "type": "string", - "description": "Borrowed amount. The field is returned only after placing the order under the mode of Auto-Borrow." - }, - "borrowSize": { - "type": "number", - "description": "ID of the borrowing response. The field is returned only after placing the order under the mode of Auto-Borrow." + "items": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "description": "Id of transaction detail", + "format": "int64" + }, + "symbol": { + "type": "string", + "description": "symbol", + "example": [ + "BTC-USDT", + "ETH-USDT", + "KCS-USDT" + ] + }, + "tradeId": { + "type": "integer", + "description": "Trade Id, symbol latitude increment", + "format": "int64" + }, + "orderId": { + "type": "string", + "description": "The unique order id generated by the trading system" + }, + "counterOrderId": { + "type": "string", + "description": "Counterparty order Id" + }, + "side": { + "type": "string", + "description": "Buy or sell", + "enum": [ + "buy", + "sell" + ], + "x-api-enum": [ + { + "value": "buy", + "name": "", + "description": "" + }, + { + "value": "sell", + "name": "", + "description": "" + } + ] + }, + "liquidity": { + "type": "string", + "description": "Liquidity type: taker or maker", + "enum": [ + "taker", + "maker" + ], + "x-api-enum": [ + { + "value": "taker", + "name": "", + "description": "" + }, + { + "value": "maker", + "name": "", + "description": "" + } + ] + }, + "forceTaker": { + "type": "boolean" + }, + "price": { + "type": "string", + "description": "Order price" + }, + "size": { + "type": "string", + "description": "Order size" + }, + "funds": { + "type": "string", + "description": "Order Funds" + }, + "fee": { + "type": "string", + "description": "[Handling fees](https://www.kucoin.com/docs-new/api-5327739)" + }, + "feeRate": { + "type": "string", + "description": "Fee rate\n" + }, + "feeCurrency": { + "type": "string", + "description": "currency used to calculate trading fee" + }, + "stop": { + "type": "string", + "description": "Take Profit and Stop Loss type, currently HFT does not support the Take Profit and Stop Loss type, so it is empty" + }, + "tradeType": { + "type": "string", + "description": "Trade type, redundancy param" + }, + "tax": { + "type": "string", + "description": "Users in some regions need query this field" + }, + "taxRate": { + "type": "string", + "description": "Tax Rate, Users in some regions need query this field" + }, + "type": { + "type": "string", + "description": "Specify if the order is an 'limit' order or 'market' order. ", + "enum": [ + "limit", + "market" + ], + "x-api-enum": [ + { + "value": "limit", + "name": "", + "description": "" + }, + { + "value": "market", + "name": "", + "description": "" + } + ] + }, + "createdAt": { + "type": "integer", + "format": "int64" + } + }, + "required": [ + "id", + "symbol", + "tradeId", + "orderId", + "counterOrderId", + "side", + "liquidity", + "forceTaker", + "price", + "size", + "funds", + "fee", + "feeRate", + "feeCurrency", + "stop", + "tradeType", + "tax", + "taxRate", + "type", + "createdAt" + ] + } }, - "clientOid": { - "type": "string", - "description": "The user self-defined order id." + "lastId": { + "type": "integer", + "description": "The id of the last set of data from the previous batch of data. By default, the latest information is given.\nlastId is used to filter data and paginate. If lastId is not entered, the default is a maximum of 100 returned data items. The return results include lastId,which can be used as a query parameter to look up new data from the next page.", + "format": "int64" } }, "required": [ - "orderId", - "borrowSize", - "clientOid", - "loanApplyId" + "items", + "lastId" ] } }, @@ -2517,212 +2710,19 @@ } } }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470205", + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470200", "x-abandon": "normal", "x-domain": "Spot", "x-api-channel": "Private", - "x-api-permission": "Margin", + "x-api-permission": "General", "x-api-rate-limit-pool": "Spot", "x-sdk-service": "Margin", "x-sdk-sub-service": "Order", - "x-sdk-method-name": "addOrderTest", - "x-sdk-method-description": " Order test endpoint, the request parameters and return parameters of this endpoint are exactly the same as the order endpoint, and can be used to verify whether the signature is correct and other operations. After placing an order, the order will not enter the matching system, and the order cannot be queried.", + "x-sdk-method-name": "getTradeHistory", + "x-sdk-method-description": "This endpoint can be used to obtain a list of the latest Margin transaction details. The returned data is sorted in descending order according to the latest update time of the order.", "x-api-rate-limit": 5, - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "clientOid": { - "type": "string", - "description": "Client Order Id,The ClientOid field is a unique ID created by the user(we recommend using a UUID), and can only contain numbers, letters, underscores (_), and hyphens (-). This field is returned when order information is obtained. You can use clientOid to tag your orders. ClientOid is different from the order ID created by the service provider. Please do not initiate requests using the same clientOid. The maximum length for the ClientOid is 40 characters.\n\nPlease remember the orderId created by the service provider, it used to check for updates in order status.", - "example": [ - "5c52e11203aa677f33e493fb" - ] - }, - "side": { - "type": "string", - "description": "specify if the order is to 'buy' or 'sell'", - "enum": [ - "buy", - "sell" - ], - "x-api-enum": [ - { - "value": "buy", - "name": "", - "description": "" - }, - { - "value": "sell", - "name": "", - "description": "" - } - ], - "example": [ - "buy" - ] - }, - "symbol": { - "type": "string", - "description": "symbol", - "example": [ - "BTC-USDT", - "ETH-USDT", - "KCS-USDT" - ] - }, - "type": { - "type": "string", - "description": "specify if the order is an 'limit' order or 'market' order. \n\nThe type of order you specify when you place your order determines whether or not you need to request other parameters and also affects the execution of the matching engine.\n\nWhen placing a limit order, you must specify a price and size. The system will try to match the order according to market price or a price better than market price. If the order cannot be immediately matched, it will stay in the order book until it is matched or the user cancels.\n\nUnlike limit orders, the price for market orders fluctuates with market prices. When placing a market order, you do not need to specify a price, you only need to specify a quantity. Market orders are filled immediately and will not enter the order book. All market orders are takers and a taker fee will be charged.", - "enum": [ - "limit", - "market" - ], - "default": "limit", - "x-api-enum": [ - { - "value": "limit", - "name": "", - "description": "" - }, - { - "value": "market", - "name": "", - "description": "" - } - ] - }, - "stp": { - "type": "string", - "description": "[Self Trade Prevention](https://www.kucoin.com/docs-new/doc-338146) is divided into these strategies: CN, CO, CB , and DC", - "enum": [ - "DC", - "CO", - "CN", - "CB" - ], - "x-api-enum": [ - { - "value": "DC", - "name": "", - "description": "" - }, - { - "value": "CO", - "name": "", - "description": "" - }, - { - "value": "CN", - "name": "", - "description": "" - }, - { - "value": "CB", - "name": "", - "description": "" - } - ] - }, - "price": { - "type": "string", - "description": "Specify price for order\n\nWhen placing a limit order, the price must be based on priceIncrement for the trading pair. The price increment (priceIncrement) is the price precision for the trading pair. For example, for the BTC-USDT trading pair, the priceIncrement is 0.00001000. So the price for your orders cannot be less than 0.00001000 and must be a multiple of priceIncrement. Otherwise, the order will return an invalid priceIncrement error." - }, - "size": { - "type": "string", - "description": "Specify quantity for order\n\nWhen **type** is limit, size refers to the amount of trading targets (the asset name written in front) for the trading pair. Teh Size must be based on the baseIncrement of the trading pair. The baseIncrement represents the precision for the trading pair. The size of an order must be a positive-integer multiple of baseIncrement and must be between baseMinSize and baseMaxSize.\n\nWhen **type** is market, select one out of two: size or funds" - }, - "timeInForce": { - "type": "string", - "description": "[Time in force](https://www.kucoin.com/docs-new/api-5176570) is a special strategy used during trading", - "enum": [ - "GTC", - "GTT", - "IOC", - "FOK" - ], - "default": "GTC", - "x-api-enum": [ - { - "value": "GTC", - "name": "", - "description": "" - }, - { - "value": "GTT", - "name": "", - "description": "" - }, - { - "value": "IOC", - "name": "", - "description": "" - }, - { - "value": "FOK", - "name": "", - "description": "" - } - ] - }, - "postOnly": { - "type": "boolean", - "default": false, - "description": "passive order labels, this is disabled when the order timing strategy is IOC or FOK" - }, - "hidden": { - "type": "boolean", - "description": "[Hidden order](https://www.kucoin.com/docs-new/doc-338146) or not (not shown in order book)", - "default": false - }, - "iceberg": { - "type": "boolean", - "description": "Whether or not only visible portions of orders are shown in [Iceberg orders](https://www.kucoin.com/docs-new/doc-338146)", - "default": false - }, - "visibleSize": { - "type": "string", - "description": "Maximum visible quantity in iceberg orders" - }, - "cancelAfter": { - "type": "integer", - "format": "int64", - "description": "Cancel after n seconds,the order timing strategy is GTT" - }, - "funds": { - "type": "string", - "description": "When **type** is market, select one out of two: size or funds" - }, - "isIsolated": { - "type": "boolean", - "description": "true - isolated margin ,false - cross margin. defult as false", - "default": false - }, - "autoBorrow": { - "type": "boolean", - "description": "When Margin Account has inefficient balance, our system autoborrows inefficient assets and opens positions according to the lowest market interest rate.", - "default": false - }, - "autoRepay": { - "type": "boolean", - "description": "AutoPay allows returning borrowed assets when you close a position. Our system automatically triggers the repayment and the maximum repayment amount equals to the filled-order amount.", - "default": false - } - }, - "required": [ - "symbol", - "side", - "clientOid" - ] - }, - "example": "//limit order\n{\n \"type\": \"limit\",\n \"symbol\": \"BTC-USDT\",\n \"side\": \"buy\",\n \"price\": \"50000\",\n \"size\": \"0.00001\",\n \"clientOid\": \"5c52e11203aa677f33e493fb\",\n \"remark\": \"order remarks\"\n}\n\n//market order 1\n// {\n// \"type\": \"market\",\n// \"symbol\": \"BTC-USDT\",\n// \"side\": \"buy\",\n// \"size\": \"0.00001\",\n// \"clientOid\": \"5c52e11203aa677f33e493fc\",\n// \"remark\": \"order remarks\"\n// }\n\n//market order 2\n// {\n// \"type\": \"market\",\n// \"symbol\": \"BTC-USDT\",\n// \"side\": \"buy\",\n// \"funds\": \"1\",\n// \"clientOid\": \"5c52e11203aa677f33e493fc\",\n// \"remark\": \"order remarks\"\n// }\n" - } - } - }, - "x-response-example": "{\\n \\\"success\\\": true,\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"orderId\\\": \\\"5bd6e9286d99522a52e458de\\\",\\n \\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\",\\n \\\"borrowSize\\\": 10.2,\\n \\\"loanApplyId\\\": \\\"600656d9a33ac90009de4f6f\\\"\\n }\\n}", - "x-request-example": "{\\\"type\\\": \\\"limit\\\", \\\"symbol\\\": \\\"BTC-USDT\\\", \\\"side\\\": \\\"buy\\\", \\\"price\\\": \\\"50000\\\", \\\"size\\\": \\\"0.00001\\\", \\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\", \\\"remark\\\": \\\"order remarks\\\"}" + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"items\\\": [\\n {\\n \\\"id\\\": 137891621991,\\n \\\"symbol\\\": \\\"BTC-USDT\\\",\\n \\\"tradeId\\\": 11040911994273793,\\n \\\"orderId\\\": \\\"671868085584bc0007d85f46\\\",\\n \\\"counterOrderId\\\": \\\"67186805b7cbdf00071621f9\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"liquidity\\\": \\\"taker\\\",\\n \\\"forceTaker\\\": false,\\n \\\"price\\\": \\\"67141.6\\\",\\n \\\"size\\\": \\\"0.00001\\\",\\n \\\"funds\\\": \\\"0.671416\\\",\\n \\\"fee\\\": \\\"0.000671416\\\",\\n \\\"feeRate\\\": \\\"0.001\\\",\\n \\\"feeCurrency\\\": \\\"USDT\\\",\\n \\\"stop\\\": \\\"\\\",\\n \\\"tradeType\\\": \\\"MARGIN_TRADE\\\",\\n \\\"tax\\\": \\\"0\\\",\\n \\\"taxRate\\\": \\\"0\\\",\\n \\\"type\\\": \\\"limit\\\",\\n \\\"createdAt\\\": 1729652744998\\n }\\n ],\\n \\\"lastId\\\": 137891621991\\n }\\n}", + "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"tradeType\\\": \\\"MARGIN_TRADE\\\", \\\"orderId\\\": \\\"example_string_default_value\\\", \\\"side\\\": \\\"buy\\\", \\\"type\\\": \\\"limit\\\", \\\"lastId\\\": 254062248624417, \\\"limit\\\": 100, \\\"startAt\\\": 1728663338000, \\\"endAt\\\": 1728692138000}" } }, "/api/v1/margin/order": { diff --git a/spec/rest/api/openapi-spot-market.json b/spec/rest/api/openapi-spot-market.json index 45c0d626..6f4692a2 100644 --- a/spec/rest/api/openapi-spot-market.json +++ b/spec/rest/api/openapi-spot-market.json @@ -7,3827 +7,1448 @@ }, "tags": [], "paths": { - "/api/v3/currencies": { - "get": { - "summary": "Get All Currencies", - "deprecated": false, - "description": "Request via this endpoint to get the currency list.Not all currencies currently can be used for trading.", - "tags": [], - "parameters": [], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "data": { - "type": "array", - "items": { - "type": "object", - "properties": { - "currency": { - "type": "string", - "description": "A unique currency code that will never change" - }, - "name": { - "type": "string", - "description": "Currency name, will change after renaming" - }, - "fullName": { - "type": "string", - "description": "Full name of a currency, will change after renaming" - }, - "precision": { - "type": "integer", - "description": "Currency precision" - }, - "confirms": { - "type": "integer", - "description": "Number of block confirmations" - }, - "contractAddress": { - "type": "string", - "description": "Contract address" - }, - "isMarginEnabled": { - "type": "boolean", - "description": "Support margin or not" - }, - "isDebitEnabled": { - "type": "boolean", - "description": "Support debit or not" - }, - "chains": { - "type": "array", - "items": { - "type": "object", - "properties": { - "chainName": { - "type": "string", - "description": "chain name of currency" - }, - "withdrawalMinSize": { - "type": "string", - "description": "Minimum withdrawal amount" - }, - "depositMinSize": { - "type": "string", - "description": "Minimum deposit amount" - }, - "withdrawFeeRate": { - "type": "string", - "description": "withdraw fee rate" - }, - "withdrawalMinFee": { - "type": "string", - "description": "Minimum fees charged for withdrawal" - }, - "isWithdrawEnabled": { - "type": "boolean", - "description": "Support withdrawal or not" - }, - "isDepositEnabled": { - "type": "boolean", - "description": "Support deposit or not" - }, - "confirms": { - "type": "integer", - "description": "Number of block confirmations" - }, - "preConfirms": { - "type": "integer", - "description": "The number of blocks (confirmations) for advance on-chain verification" - }, - "contractAddress": { - "type": "string", - "description": "Contract address" - }, - "withdrawPrecision": { - "type": "integer", - "description": "Withdrawal precision bit, indicating the maximum supported length after the decimal point of the withdrawal amount" - }, - "maxWithdraw": { - "type": "string", - "description": "Maximum amount of single withdrawal" - }, - "maxDeposit": { - "type": "string", - "description": "Maximum amount of single deposit (only applicable to Lightning Network)" - }, - "needTag": { - "type": "boolean", - "description": "whether memo/tag is needed" - }, - "chainId": { - "type": "string", - "description": "chain id of currency" - }, - "depositFeeRate": { - "type": "string", - "description": "deposit fee rate (some currencies have this param, the default is empty)" - }, - "withdrawMaxFee": { - "type": "string", - "description": "withdraw max fee(some currencies have this param, the default is empty)" - }, - "depositTierFee": { - "type": "string" - } - }, - "required": [ - "chainName", - "withdrawalMinSize", - "depositMinSize", - "withdrawFeeRate", - "withdrawalMinFee", - "isWithdrawEnabled", - "isDepositEnabled", - "confirms", - "preConfirms", - "contractAddress", - "withdrawPrecision", - "maxWithdraw", - "maxDeposit", - "needTag", - "chainId" - ] - }, - "description": "chain list" - } - }, - "required": [ - "currency", - "name", - "fullName", - "precision", - "confirms", - "contractAddress", - "isMarginEnabled", - "isDebitEnabled", - "chains" - ] - } - } - }, - "required": [ - "code", - "data" - ] - } - } - } - } - }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470152", - "x-abandon": "normal", - "x-domain": "Spot", - "x-api-channel": "Public", - "x-api-permission": "NULL", - "x-api-rate-limit-pool": "Public", - "x-sdk-service": "Spot", - "x-sdk-sub-service": "Market", - "x-sdk-method-name": "getAllCurrencies", - "x-sdk-method-description": "Request via this endpoint to get the currency list.Not all currencies currently can be used for trading.", - "x-api-rate-limit": 3, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": [\\n {\\n \\\"currency\\\": \\\"BTC\\\",\\n \\\"name\\\": \\\"BTC\\\",\\n \\\"fullName\\\": \\\"Bitcoin\\\",\\n \\\"precision\\\": 8,\\n \\\"confirms\\\": null,\\n \\\"contractAddress\\\": null,\\n \\\"isMarginEnabled\\\": true,\\n \\\"isDebitEnabled\\\": true,\\n \\\"chains\\\": [\\n {\\n \\\"chainName\\\": \\\"BTC\\\",\\n \\\"withdrawalMinSize\\\": \\\"0.001\\\",\\n \\\"depositMinSize\\\": \\\"0.0002\\\",\\n \\\"withdrawFeeRate\\\": \\\"0\\\",\\n \\\"withdrawalMinFee\\\": \\\"0.0005\\\",\\n \\\"isWithdrawEnabled\\\": true,\\n \\\"isDepositEnabled\\\": true,\\n \\\"confirms\\\": 3,\\n \\\"preConfirms\\\": 1,\\n \\\"contractAddress\\\": \\\"\\\",\\n \\\"withdrawPrecision\\\": 8,\\n \\\"maxWithdraw\\\": null,\\n \\\"maxDeposit\\\": null,\\n \\\"needTag\\\": false,\\n \\\"chainId\\\": \\\"btc\\\"\\n },\\n {\\n \\\"chainName\\\": \\\"Lightning Network\\\",\\n \\\"withdrawalMinSize\\\": \\\"0.00001\\\",\\n \\\"depositMinSize\\\": \\\"0.00001\\\",\\n \\\"withdrawFeeRate\\\": \\\"0\\\",\\n \\\"withdrawalMinFee\\\": \\\"0.000015\\\",\\n \\\"isWithdrawEnabled\\\": true,\\n \\\"isDepositEnabled\\\": true,\\n \\\"confirms\\\": 1,\\n \\\"preConfirms\\\": 1,\\n \\\"contractAddress\\\": \\\"\\\",\\n \\\"withdrawPrecision\\\": 8,\\n \\\"maxWithdraw\\\": null,\\n \\\"maxDeposit\\\": \\\"0.03\\\",\\n \\\"needTag\\\": false,\\n \\\"chainId\\\": \\\"btcln\\\"\\n },\\n {\\n \\\"chainName\\\": \\\"KCC\\\",\\n \\\"withdrawalMinSize\\\": \\\"0.0008\\\",\\n \\\"depositMinSize\\\": null,\\n \\\"withdrawFeeRate\\\": \\\"0\\\",\\n \\\"withdrawalMinFee\\\": \\\"0.00002\\\",\\n \\\"isWithdrawEnabled\\\": true,\\n \\\"isDepositEnabled\\\": true,\\n \\\"confirms\\\": 20,\\n \\\"preConfirms\\\": 20,\\n \\\"contractAddress\\\": \\\"0xfa93c12cd345c658bc4644d1d4e1b9615952258c\\\",\\n \\\"withdrawPrecision\\\": 8,\\n \\\"maxWithdraw\\\": null,\\n \\\"maxDeposit\\\": null,\\n \\\"needTag\\\": false,\\n \\\"chainId\\\": \\\"kcc\\\"\\n },\\n {\\n \\\"chainName\\\": \\\"BTC-Segwit\\\",\\n \\\"withdrawalMinSize\\\": \\\"0.0008\\\",\\n \\\"depositMinSize\\\": \\\"0.0002\\\",\\n \\\"withdrawFeeRate\\\": \\\"0\\\",\\n \\\"withdrawalMinFee\\\": \\\"0.0005\\\",\\n \\\"isWithdrawEnabled\\\": false,\\n \\\"isDepositEnabled\\\": true,\\n \\\"confirms\\\": 2,\\n \\\"preConfirms\\\": 2,\\n \\\"contractAddress\\\": \\\"\\\",\\n \\\"withdrawPrecision\\\": 8,\\n \\\"maxWithdraw\\\": null,\\n \\\"maxDeposit\\\": null,\\n \\\"needTag\\\": false,\\n \\\"chainId\\\": \\\"bech32\\\"\\n }\\n ]\\n },\\n {\\n \\\"currency\\\": \\\"BTCP\\\",\\n \\\"name\\\": \\\"BTCP\\\",\\n \\\"fullName\\\": \\\"Bitcoin Private\\\",\\n \\\"precision\\\": 8,\\n \\\"confirms\\\": null,\\n \\\"contractAddress\\\": null,\\n \\\"isMarginEnabled\\\": false,\\n \\\"isDebitEnabled\\\": false,\\n \\\"chains\\\": [\\n {\\n \\\"chainName\\\": \\\"BTCP\\\",\\n \\\"withdrawalMinSize\\\": \\\"0.100000\\\",\\n \\\"depositMinSize\\\": null,\\n \\\"withdrawFeeRate\\\": \\\"0\\\",\\n \\\"withdrawalMinFee\\\": \\\"0.010000\\\",\\n \\\"isWithdrawEnabled\\\": false,\\n \\\"isDepositEnabled\\\": false,\\n \\\"confirms\\\": 6,\\n \\\"preConfirms\\\": 6,\\n \\\"contractAddress\\\": \\\"\\\",\\n \\\"withdrawPrecision\\\": 8,\\n \\\"maxWithdraw\\\": null,\\n \\\"maxDeposit\\\": null,\\n \\\"needTag\\\": false,\\n \\\"chainId\\\": \\\"btcp\\\"\\n }\\n ]\\n }\\n ]\\n}" - } - }, - "/api/v1/prices": { + "/api/v3/announcements": { "get": { - "summary": "Get Fiat Price", + "summary": "Get Announcements", "deprecated": false, - "description": "Request via this endpoint to get the fiat price of the currencies for the available trading pairs.", + "description": "This interface can obtain the latest news announcements, and the default page search is for announcements within a month.", "tags": [], "parameters": [ { - "name": "base", + "name": "currentPage", "in": "query", - "description": "Ticker symbol of a base currency,eg.USD,EUR. Default is USD", + "description": "page number", "required": false, "schema": { - "type": "string", - "default": "USD", - "example": [ - "USD", - "EUR" - ] + "type": "integer", + "format": "int64" } }, { - "name": "currencies", + "name": "pageSize", "in": "query", - "description": "Comma-separated cryptocurrencies to be converted into fiat, e.g.: BTC,ETH, etc. Default to return the fiat price of all currencies.", + "description": "page Size", "required": false, "schema": { - "type": "string" + "type": "integer", + "format": "int64" } - } - ], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "data": { - "type": "object", - "properties": { - "AGLD": { - "type": "string" - }, - "DFI": { - "type": "string" - }, - "PYTHUP": { - "type": "string" - }, - "ISLM": { - "type": "string" - }, - "NEAR": { - "type": "string" - }, - "AIOZ": { - "type": "string" - }, - "AUDIO": { - "type": "string" - }, - "BBL": { - "type": "string" - }, - "WLD": { - "type": "string" + }, + { + "name": "annType", + "in": "query", + "description": "Announcement types: latest-announcements , activities (latest activities), new-listings (new currency online), product-updates (product updates), vip (institutions and VIPs), maintenance-updates (system maintenance), product -updates (product news), delistings (currency offline), others, api-campaigns (API user activities), default : latest-announcements", + "required": false, + "schema": { + "type": "string", + "enum": [ + "latest-announcements ", + "activities ", + "product-updates ", + "vip ", + "maintenance-updates", + "delistings ", + "others", + "api-campaigns ", + "new-listings" + ], + "default": "latest-announcements", + "x-api-enum": [ + { + "value": "latest-announcements ", + "name": "LATEST-ANNOUNCEMENTS", + "description": "latest-announcements" + }, + { + "value": "activities ", + "name": "ACTIVITIES", + "description": "latest activities" + }, + { + "value": "product-updates ", + "name": "PRODUCT-UPDATES", + "description": "product updates" + }, + { + "value": "vip ", + "name": "VIPS", + "description": "institutions and VIPs" + }, + { + "value": "maintenance-updates", + "name": "MAINTENANCE-UPDATE", + "description": "system maintenance" + }, + { + "value": "delistings ", + "name": "DELISTINGS", + "description": "currency offline" + }, + { + "value": "others", + "name": "OTHERS", + "description": "others" + }, + { + "value": "api-campaigns ", + "name": "API-CAMPAIGNS", + "description": "API user activities" + }, + { + "value": "new-listings", + "name": "NEW-LISTINGS", + "description": "new currency online" + } + ] + } + }, + { + "name": "lang", + "in": "query", + "description": "Language type, the default is en_US, the specific value parameters are as follows", + "required": false, + "schema": { + "type": "string", + "default": "en_US", + "enum": [ + "zh_HK", + "ja_JP", + "ko_KR", + "en_US", + "pl_PL", + "es_ES", + "fr_FR", + "ar_AE", + "it_IT", + "id_ID", + "nl_NL", + "pt_PT", + "vi_VN", + "de_DE", + "tr_TR", + "ms_MY", + "ru_RU", + "th_TH", + "hi_IN", + "bn_BD", + "fil_PH", + "ur_PK" + ], + "x-api-enum": [ + { + "value": "zh_HK", + "name": "ZH_HK", + "description": "Chinese (Hong Kong)" + }, + { + "value": "ja_JP", + "name": "JA_JP", + "description": "Japanese (Japan)" + }, + { + "value": "ko_KR", + "name": "KO_KR", + "description": "Korean (Korea)" + }, + { + "value": "en_US", + "name": "EN_US", + "description": "English" + }, + { + "value": "pl_PL", + "name": "PL_PL", + "description": "Polish (Poland)" + }, + { + "value": "es_ES", + "name": "ES_ES", + "description": "Spanish (Spain)" + }, + { + "value": "fr_FR", + "name": "FR_FR", + "description": "French (France)" + }, + { + "value": "ar_AE", + "name": "AR_AE", + "description": "Arabic (Egypt)" + }, + { + "value": "it_IT", + "name": "IT_IT", + "description": "Italian (Italy)" + }, + { + "value": "id_ID", + "name": "ID_ID", + "description": "Indonesian (Indonesia)" + }, + { + "value": "nl_NL", + "name": "NL_NL", + "description": "Dutch (Netherlands)" + }, + { + "value": "pt_PT", + "name": "PT_PT", + "description": "Portuguese (Brazil)" + }, + { + "value": "vi_VN", + "name": "VI_VN", + "description": "Vietnamese (Vietnam)" + }, + { + "value": "de_DE", + "name": "DE_DE", + "description": "German (Germany)" + }, + { + "value": "tr_TR", + "name": "TR_TR", + "description": "Turkish (Turkey)" + }, + { + "value": "ms_MY", + "name": "MS_MY", + "description": "Malay (Malaysia)" + }, + { + "value": "ru_RU", + "name": "RU_RU", + "description": "Russian (Russia)" + }, + { + "value": "th_TH", + "name": "TH_TH", + "description": "Thai (Thailand)" + }, + { + "value": "hi_IN", + "name": "HI_IN", + "description": "Hindi (India)" + }, + { + "value": "bn_BD", + "name": "BN_BD", + "description": "Bengali (Bangladesh)" + }, + { + "value": "fil_PH", + "name": "FIL_PH", + "description": "Filipino (Philippines)" + }, + { + "value": "ur_PK", + "name": "UR_PK", + "description": "Urdu (Pakistan)" + } + ] + } + }, + { + "name": "startTime", + "in": "query", + "description": "Announcement online start time (milliseconds)", + "required": false, + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "endTime", + "in": "query", + "description": "Announcement online end time (milliseconds)", + "required": false, + "schema": { + "type": "integer", + "format": "int64" + } + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "object", + "properties": { + "totalNum": { + "type": "integer", + "description": "Total Number" }, - "HNT": { - "type": "string" - }, - "ETHFI": { - "type": "string" - }, - "DMAIL": { - "type": "string" - }, - "OPUP": { - "type": "string" - }, - "VET3S": { - "type": "string" - }, - "MANA3S": { - "type": "string" - }, - "TIDAL": { - "type": "string" - }, - "HALO": { - "type": "string" - }, - "OPUL": { - "type": "string" - }, - "MANA3L": { - "type": "string" - }, - "DGB": { - "type": "string" - }, - "AA": { - "type": "string" - }, - "BCH": { - "type": "string" - }, - "GMEE": { - "type": "string" - }, - "JST": { - "type": "string" - }, - "PBUX": { - "type": "string" - }, - "AR": { - "type": "string" - }, - "SEI": { - "type": "string" - }, - "PSTAKE": { - "type": "string" - }, - "LMWR": { - "type": "string" - }, - "UNFIDOWN": { - "type": "string" - }, - "BB": { - "type": "string" - }, - "JTO": { - "type": "string" - }, - "WEMIX": { - "type": "string" + "items": { + "type": "array", + "items": { + "type": "object", + "properties": { + "annId": { + "type": "integer", + "description": "Announcement ID" + }, + "annTitle": { + "type": "string", + "description": "Announcement title" + }, + "annType": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Announcement type" + }, + "annDesc": { + "type": "string", + "description": "Announcement description" + }, + "cTime": { + "type": "integer", + "description": "Announcement release time, Unix millisecond timestamp format", + "format": "int64" + }, + "language": { + "type": "string", + "description": "language type" + }, + "annUrl": { + "type": "string", + "description": "Announcement link" + } + }, + "required": [ + "annId", + "annTitle", + "annType", + "annDesc", + "cTime", + "language", + "annUrl" + ] + } }, - "G": { - "type": "string" + "currentPage": { + "type": "integer", + "description": "Current page" }, - "MARSH": { - "type": "string" + "pageSize": { + "type": "integer", + "description": "Page size" }, - "BN": { - "type": "string" + "totalPage": { + "type": "integer", + "description": "Total Page" + } + }, + "required": [ + "totalNum", + "items", + "currentPage", + "pageSize", + "totalPage" + ] + } + }, + "required": [ + "code", + "data" + ] + } + } + } + } + }, + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470157", + "x-abandon": "normal", + "x-domain": "Spot", + "x-api-channel": "Public", + "x-api-permission": "NULL", + "x-api-rate-limit-pool": "Public", + "x-sdk-service": "Spot", + "x-sdk-sub-service": "Market", + "x-sdk-method-name": "getAnnouncements", + "x-sdk-method-description": "This interface can obtain the latest news announcements, and the default page search is for announcements within a month.", + "x-api-rate-limit": 20, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"totalNum\\\": 195,\\n \\\"totalPage\\\": 13,\\n \\\"currentPage\\\": 1,\\n \\\"pageSize\\\": 15,\\n \\\"items\\\": [\\n {\\n \\\"annId\\\": 129045,\\n \\\"annTitle\\\": \\\"KuCoin Isolated Margin Adds the Scroll (SCR) Trading Pair\\\",\\n \\\"annType\\\": [\\n \\\"latest-announcements\\\"\\n ],\\n \\\"annDesc\\\": \\\"To enrich the variety of assets available,\\xa0KuCoin\\u2019s Isolated Margin Trading platform has added the Scroll (SCR)\\xa0asset and trading pair.\\\",\\n \\\"cTime\\\": 1729594043000,\\n \\\"language\\\": \\\"en_US\\\",\\n \\\"annUrl\\\": \\\"https://www.kucoin.com/announcement/kucoin-isolated-margin-adds-scr?lang=en_US\\\"\\n },\\n {\\n \\\"annId\\\": 129001,\\n \\\"annTitle\\\": \\\"DAPP-30D Fixed Promotion, Enjoy an APR of 200%!\\u200b\\\",\\n \\\"annType\\\": [\\n \\\"latest-announcements\\\",\\n \\\"activities\\\"\\n ],\\n \\\"annDesc\\\": \\\"KuCoin Earn will be launching the DAPP Fixed Promotion at 10:00:00 on October 22, 2024 (UTC). The available product is \\u201cDAPP-30D'' with an APR of 200%.\\\",\\n \\\"cTime\\\": 1729588460000,\\n \\\"language\\\": \\\"en_US\\\",\\n \\\"annUrl\\\": \\\"https://www.kucoin.com/announcement/dapp-30d-fixed-promotion-enjoy?lang=en_US\\\"\\n },\\n {\\n \\\"annId\\\": 128581,\\n \\\"annTitle\\\": \\\"NAYM (NAYM) Gets Listed on KuCoin! World Premiere!\\\",\\n \\\"annType\\\": [\\n \\\"latest-announcements\\\",\\n \\\"new-listings\\\"\\n ],\\n \\\"annDesc\\\": \\\"Trading:\\xa011:00 on October 22, 2024 (UTC)\\\",\\n \\\"cTime\\\": 1729497729000,\\n \\\"language\\\": \\\"en_US\\\",\\n \\\"annUrl\\\": \\\"https://www.kucoin.com/announcement/en-naym-naym-gets-listed-on-kucoin-world-premiere?lang=en_US\\\"\\n }\\n ]\\n }\\n}", + "x-request-example": "{\\\"currentPage\\\": 1, \\\"pageSize\\\": 50, \\\"annType\\\": \\\"latest-announcements\\\", \\\"lang\\\": \\\"en_US\\\", \\\"startTime\\\": 1729594043000, \\\"endTime\\\": 1729697729000}" + } + }, + "/api/v3/currencies/{currency}": { + "get": { + "summary": "Get Currency", + "deprecated": false, + "description": "Request via this endpoint to get the currency details of a specified currency", + "tags": [], + "parameters": [ + { + "name": "currency", + "in": "path", + "description": "Path parameter, Currency", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "chain", + "in": "query", + "description": "Support for querying the chain of currency, e.g. The available value for USDT are OMNI, ERC20, TRC20. This only apply for multi-chain currency, and there is no need for single chain currency.", + "required": false, + "schema": { + "type": "string", + "example": [ + "eth", + "bech32", + "btc", + "kcc", + "trx", + "bsc", + "arbitrum", + "ton", + "optimism" + ] + } + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "object", + "properties": { + "currency": { + "type": "string", + "description": "A unique currency code that will never change" }, - "FLIP": { - "type": "string" + "name": { + "type": "string", + "description": "Currency name, will change after renaming" }, - "FLR": { - "type": "string" + "fullName": { + "type": "string", + "description": "Full name of a currency, will change after renaming" }, - "BIGTIME": { - "type": "string" + "precision": { + "type": "integer", + "description": "Currency precision" }, - "FLY": { - "type": "string" + "confirms": { + "type": "integer", + "description": "Number of block confirmations" }, - "T": { - "type": "string" + "contractAddress": { + "type": "string", + "description": "Contract address" }, - "W": { - "type": "string" + "isMarginEnabled": { + "type": "boolean", + "description": "Support margin or not" }, - "BDX": { - "type": "string" + "isDebitEnabled": { + "type": "boolean", + "description": "Support debit or not" }, - "BABYDOGE": { - "type": "string" - }, - "SFP": { - "type": "string" - }, - "DIA": { - "type": "string" - }, - "ISME": { - "type": "string" - }, - "LYM": { - "type": "string" - }, - "VET3L": { - "type": "string" - }, - "JUP": { - "type": "string" - }, - "LYX": { - "type": "string" - }, - "AIEPK": { - "type": "string" - }, - "SILLY": { - "type": "string" - }, - "SCPT": { - "type": "string" - }, - "WOO": { - "type": "string" - }, - "BLUR": { - "type": "string" - }, - "STRK": { - "type": "string" - }, - "BFC": { - "type": "string" - }, - "DC": { - "type": "string" - }, - "KARATE": { - "type": "string" - }, - "SUSHI3L": { - "type": "string" - }, - "NETVR": { - "type": "string" - }, - "WAVES": { - "type": "string" - }, - "LITH": { - "type": "string" - }, - "HAPI": { - "type": "string" - }, - "SUSHI3S": { - "type": "string" - }, - "CEEK": { - "type": "string" - }, - "FLOKI": { - "type": "string" - }, - "SHR": { - "type": "string" - }, - "SAND": { - "type": "string" - }, - "TURT": { - "type": "string" - }, - "UMA": { - "type": "string" - }, - "BEPRO": { - "type": "string" - }, - "SCRT": { - "type": "string" - }, - "TUSD": { - "type": "string" - }, - "COOKIE": { - "type": "string" - }, - "LRDS": { - "type": "string" - }, - "SIN": { - "type": "string" - }, - "OAS": { - "type": "string" - }, - "ROOT": { - "type": "string" - }, - "ADA3L": { - "type": "string" - }, - "TIAUP": { - "type": "string" - }, - "HTR": { - "type": "string" - }, - "UNB": { - "type": "string" - }, - "UNA": { - "type": "string" - }, - "HARD": { - "type": "string" - }, - "G3": { - "type": "string" - }, - "ADA3S": { - "type": "string" - }, - "MYRO": { - "type": "string" - }, - "HTX": { - "type": "string" - }, - "FT": { - "type": "string" - }, - "BTCDOWN": { - "type": "string" - }, - "UNI": { - "type": "string" - }, - "FX": { - "type": "string" - }, - "OBI": { - "type": "string" - }, - "UNO": { - "type": "string" - }, - "WRX": { - "type": "string" - }, - "TIADOWN": { - "type": "string" - }, - "ETHDOWN": { - "type": "string" - }, - "WELL": { - "type": "string" - }, - "SWFTC": { - "type": "string" - }, - "SKL": { - "type": "string" - }, - "UOS": { - "type": "string" - }, - "AIPAD": { - "type": "string" - }, - "BRETT": { - "type": "string" - }, - "SKY": { - "type": "string" - }, - "FRM": { - "type": "string" - }, - "VISION": { - "type": "string" - }, - "LENDS": { - "type": "string" - }, - "SLF": { - "type": "string" - }, - "BULL": { - "type": "string" - }, - "FLOW": { - "type": "string" - }, - "ODDZ": { - "type": "string" - }, - "SLN": { - "type": "string" - }, - "UPO": { - "type": "string" - }, - "SLP": { - "type": "string" - }, - "ID": { - "type": "string" - }, - "SLIM": { - "type": "string" - }, - "SPOT": { - "type": "string" - }, - "DOP": { - "type": "string" - }, - "ISSP": { - "type": "string" - }, - "UQC": { - "type": "string" - }, - "IO": { - "type": "string" - }, - "DOT": { - "type": "string" - }, - "1INCH": { - "type": "string" - }, - "SMH": { - "type": "string" - }, - "MAK": { - "type": "string" - }, - "TOKO": { - "type": "string" - }, - "TURBO": { - "type": "string" - }, - "UNFI": { - "type": "string" - }, - "MAN": { - "type": "string" - }, - "EVER": { - "type": "string" - }, - "FTM": { - "type": "string" - }, - "SHRAP": { - "type": "string" - }, - "MAV": { - "type": "string" - }, - "MAX": { - "type": "string" - }, - "DPR": { - "type": "string" - }, - "FTT": { - "type": "string" - }, - "ARKM": { - "type": "string" - }, - "ATOM": { - "type": "string" - }, - "PENDLE": { - "type": "string" - }, - "QUICK": { - "type": "string" - }, - "BLZ": { - "type": "string" - }, - "BOBA": { - "type": "string" - }, - "MBL": { - "type": "string" - }, - "OFN": { - "type": "string" - }, - "UNIO": { - "type": "string" - }, - "SNS": { - "type": "string" - }, - "SNX": { - "type": "string" - }, - "NXRA": { - "type": "string" - }, - "TAIKO": { - "type": "string" - }, - "AVAX3L": { - "type": "string" - }, - "L3": { - "type": "string" - }, - "API3": { - "type": "string" - }, - "XRP3S": { - "type": "string" - }, - "QKC": { - "type": "string" - }, - "AVAX3S": { - "type": "string" - }, - "ROSE": { - "type": "string" - }, - "SATS": { - "type": "string" - }, - "BMX": { - "type": "string" - }, - "PORTAL": { - "type": "string" - }, - "TOMI": { - "type": "string" - }, - "XRP3L": { - "type": "string" - }, - "SOL": { - "type": "string" - }, - "SON": { - "type": "string" - }, - "BNC": { - "type": "string" - }, - "SOCIAL": { - "type": "string" - }, - "CGPT": { - "type": "string" - }, - "CELR": { - "type": "string" - }, - "BNB": { - "type": "string" - }, - "OGN": { - "type": "string" - }, - "CELO": { - "type": "string" - }, - "AUCTION": { - "type": "string" - }, - "MANTA": { - "type": "string" - }, - "LAYER": { - "type": "string" - }, - "AERO": { - "type": "string" - }, - "CETUS": { - "type": "string" - }, - "LL": { - "type": "string" - }, - "SPA": { - "type": "string" - }, - "PYTHDOWN": { - "type": "string" - }, - "NEIROCTO": { - "type": "string" - }, - "UTK": { - "type": "string" - }, - "GMRX": { - "type": "string" - }, - "BOB": { - "type": "string" - }, - "HOTCROSS": { - "type": "string" - }, - "AERGO": { - "type": "string" - }, - "MOCA": { - "type": "string" - }, - "SQD": { - "type": "string" - }, - "MV": { - "type": "string" - }, - "BNB3L": { - "type": "string" - }, - "BNB3S": { - "type": "string" - }, - "GALAX3L": { - "type": "string" - }, - "KAI": { - "type": "string" - }, - "SQR": { - "type": "string" - }, - "GALAX3S": { - "type": "string" - }, - "EGLD": { - "type": "string" - }, - "ZBCN": { - "type": "string" - }, - "KAS": { - "type": "string" - }, - "MEW": { - "type": "string" - }, - "PUNDIX": { - "type": "string" - }, - "LOOKS": { - "type": "string" - }, - "FXS": { - "type": "string" - }, - "BOSON": { - "type": "string" - }, - "BRISE": { - "type": "string" - }, - "AEVO": { - "type": "string" - }, - "FLUX": { - "type": "string" - }, - "PRCL": { - "type": "string" - }, - "UNFIUP": { - "type": "string" - }, - "SEIDOWN": { - "type": "string" - }, - "DOAI": { - "type": "string" - }, - "QNT": { - "type": "string" - }, - "REDO": { - "type": "string" - }, - "STRIKE": { - "type": "string" - }, - "ETHW": { - "type": "string" - }, - "OM": { - "type": "string" - }, - "OP": { - "type": "string" - }, - "WHALE": { - "type": "string" - }, - "1CAT": { - "type": "string" - }, - "NEON": { - "type": "string" - }, - "GTAI": { - "type": "string" - }, - "SSV": { - "type": "string" - }, - "ETH2": { - "type": "string" - }, - "KCS": { - "type": "string" - }, - "ARPA": { - "type": "string" - }, - "ARTFI": { - "type": "string" - }, - "BRL": { - "type": "string" - }, - "ALEX": { - "type": "string" - }, - "STG": { - "type": "string" - }, - "SHIB": { - "type": "string" - }, - "IOTX": { - "type": "string" - }, - "OLE": { - "type": "string" - }, - "KDA": { - "type": "string" - }, - "CERE": { - "type": "string" - }, - "DOCK": { - "type": "string" - }, - "STX": { - "type": "string" - }, - "OLT": { - "type": "string" - }, - "QI": { - "type": "string" - }, - "SDAO": { - "type": "string" - }, - "BLAST": { - "type": "string" - }, - "LINK3S": { - "type": "string" - }, - "IOST": { - "type": "string" - }, - "SUI": { - "type": "string" - }, - "CAKE": { - "type": "string" - }, - "BSW": { - "type": "string" - }, - "OMG": { - "type": "string" - }, - "VOLT": { - "type": "string" - }, - "LINK3L": { - "type": "string" - }, - "GEEQ": { - "type": "string" - }, - "PYUSD": { - "type": "string" - }, - "SUN": { - "type": "string" - }, - "TOWER": { - "type": "string" - }, - "BTC": { - "type": "string" - }, - "IOTA": { - "type": "string" - }, - "REEF": { - "type": "string" - }, - "TRIAS": { - "type": "string" - }, - "KEY": { - "type": "string" - }, - "ETH3L": { - "type": "string" - }, - "BTT": { - "type": "string" - }, - "ONE": { - "type": "string" - }, - "RENDER": { - "type": "string" - }, - "ETH3S": { - "type": "string" - }, - "ANKR": { - "type": "string" - }, - "ALGO": { - "type": "string" - }, - "SYLO": { - "type": "string" - }, - "ZCX": { - "type": "string" - }, - "SD": { - "type": "string" - }, - "ONT": { - "type": "string" - }, - "MJT": { - "type": "string" - }, - "DYM": { - "type": "string" - }, - "DYP": { - "type": "string" - }, - "BAKEUP": { - "type": "string" - }, - "OOE": { - "type": "string" - }, - "ZELIX": { - "type": "string" - }, - "DOGE3L": { - "type": "string" - }, - "ARTY": { - "type": "string" - }, - "QORPO": { - "type": "string" - }, - "ICE": { - "type": "string" - }, - "NOTAI": { - "type": "string" - }, - "DOGE3S": { - "type": "string" - }, - "NAKA": { - "type": "string" - }, - "GALAX": { - "type": "string" - }, - "MKR": { - "type": "string" - }, - "DODO": { - "type": "string" - }, - "ICP": { - "type": "string" - }, - "ZEC": { - "type": "string" - }, - "ZEE": { - "type": "string" - }, - "ICX": { - "type": "string" - }, - "KMNO": { - "type": "string" - }, - "TT": { - "type": "string" - }, - "DOT3L": { - "type": "string" - }, - "XAI": { - "type": "string" - }, - "ZEN": { - "type": "string" - }, - "DOGE": { - "type": "string" - }, - "ALPHA": { - "type": "string" - }, - "DUSK": { - "type": "string" - }, - "DOT3S": { - "type": "string" - }, - "SXP": { - "type": "string" - }, - "HBAR": { - "type": "string" - }, - "SYNT": { - "type": "string" - }, - "ZEX": { - "type": "string" - }, - "BONDLY": { - "type": "string" - }, - "MLK": { - "type": "string" - }, - "KICKS": { - "type": "string" - }, - "PEPE": { - "type": "string" - }, - "OUSD": { - "type": "string" - }, - "LUNCDOWN": { - "type": "string" - }, - "DOGS": { - "type": "string" - }, - "REV3L": { - "type": "string" - }, - "CTSI": { - "type": "string" - }, - "C98": { - "type": "string" - }, - "OSMO": { - "type": "string" - }, - "NTRN": { - "type": "string" - }, - "CFX2S": { - "type": "string" - }, - "SYN": { - "type": "string" - }, - "VIDT": { - "type": "string" - }, - "SYS": { - "type": "string" - }, - "GAS": { - "type": "string" - }, - "BOME": { - "type": "string" - }, - "COMBO": { - "type": "string" - }, - "XCH": { - "type": "string" - }, - "VR": { - "type": "string" - }, - "CFX2L": { - "type": "string" - }, - "VSYS": { - "type": "string" - }, - "PANDORA": { - "type": "string" - }, - "THETA": { - "type": "string" - }, - "XCN": { - "type": "string" - }, - "NEXG": { - "type": "string" - }, - "MELOS": { - "type": "string" - }, - "XCV": { - "type": "string" - }, - "ORN": { - "type": "string" - }, - "WLKN": { - "type": "string" - }, - "AAVE": { - "type": "string" - }, - "MNT": { - "type": "string" - }, - "BONK": { - "type": "string" - }, - "PERP": { - "type": "string" - }, - "XDC": { - "type": "string" - }, - "MNW": { - "type": "string" - }, - "XDB": { - "type": "string" - }, - "BOND": { - "type": "string" - }, - "SUIA": { - "type": "string" - }, - "MOG": { - "type": "string" - }, - "SUTER": { - "type": "string" - }, - "TIME": { - "type": "string" - }, - "RACA": { - "type": "string" - }, - "BICO": { - "type": "string" - }, - "MON": { - "type": "string" - }, - "SWEAT": { - "type": "string" - }, - "MOXIE": { - "type": "string" - }, - "BABYBNB": { - "type": "string" - }, - "IGU": { - "type": "string" - }, - "HMSTR": { - "type": "string" - }, - "XEC": { - "type": "string" - }, - "MONI": { - "type": "string" - }, - "XR": { - "type": "string" - }, - "PEOPLE": { - "type": "string" - }, - "PUMLX": { - "type": "string" - }, - "ZIL": { - "type": "string" - }, - "WLDDOWN": { - "type": "string" - }, - "VAI": { - "type": "string" - }, - "XEN": { - "type": "string" - }, - "MPC": { - "type": "string" - }, - "XEM": { - "type": "string" - }, - "JASMY3S": { - "type": "string" - }, - "OTK": { - "type": "string" - }, - "TRAC": { - "type": "string" - }, - "DFYN": { - "type": "string" - }, - "BIDP": { - "type": "string" - }, - "JASMY3L": { - "type": "string" - }, - "INJDOWN": { - "type": "string" - }, - "KLV": { - "type": "string" - }, - "WAXL": { - "type": "string" - }, - "TRBDOWN": { - "type": "string" - }, - "BCH3L": { - "type": "string" - }, - "GMT3S": { - "type": "string" - }, - "KMD": { - "type": "string" - }, - "BCH3S": { - "type": "string" - }, - "ECOX": { - "type": "string" - }, - "AAVE3S": { - "type": "string" - }, - "GMT3L": { - "type": "string" - }, - "EPIK": { - "type": "string" - }, - "SUIP": { - "type": "string" - }, - "AAVE3L": { - "type": "string" - }, - "ZK": { - "type": "string" - }, - "ZKF": { - "type": "string" - }, - "OMNIA": { - "type": "string" - }, - "ZKJ": { - "type": "string" - }, - "ZKL": { - "type": "string" - }, - "GAFI": { - "type": "string" - }, - "CARV": { - "type": "string" - }, - "KNC": { - "type": "string" - }, - "CATS": { - "type": "string" - }, - "PROM": { - "type": "string" - }, - "ALEPH": { - "type": "string" - }, - "PONKE": { - "type": "string" - }, - "OVR": { - "type": "string" - }, - "CATI": { - "type": "string" - }, - "ORDER": { - "type": "string" - }, - "GFT": { - "type": "string" - }, - "BIFI": { - "type": "string" - }, - "GGC": { - "type": "string" - }, - "GGG": { - "type": "string" - }, - "DAPPX": { - "type": "string" - }, - "SUKU": { - "type": "string" - }, - "ULTI": { - "type": "string" - }, - "CREDI": { - "type": "string" - }, - "ERTHA": { - "type": "string" - }, - "FURY": { - "type": "string" - }, - "KARRAT": { - "type": "string" - }, - "MOBILE": { - "type": "string" - }, - "SIDUS": { - "type": "string" - }, - "NAVI": { - "type": "string" - }, - "TAO": { - "type": "string" - }, - "USDJ": { - "type": "string" - }, - "MTL": { - "type": "string" - }, - "VET": { - "type": "string" - }, - "FITFI": { - "type": "string" - }, - "USDT": { - "type": "string" - }, - "OXT": { - "type": "string" - }, - "CANDY": { - "type": "string" - }, - "USDP": { - "type": "string" - }, - "MTS": { - "type": "string" - }, - "TADA": { - "type": "string" - }, - "MTV": { - "type": "string" - }, - "NAVX": { - "type": "string" - }, - "ILV": { - "type": "string" - }, - "VINU": { - "type": "string" - }, - "GHX": { - "type": "string" - }, - "EDU": { - "type": "string" - }, - "HYVE": { - "type": "string" - }, - "BTC3L": { - "type": "string" - }, - "ANYONE": { - "type": "string" - }, - "BEAT": { - "type": "string" - }, - "KING": { - "type": "string" - }, - "CREAM": { - "type": "string" - }, - "CAS": { - "type": "string" - }, - "IMX": { - "type": "string" - }, - "CAT": { - "type": "string" - }, - "BTC3S": { - "type": "string" - }, - "USDE": { - "type": "string" - }, - "USDD": { - "type": "string" - }, - "CWAR": { - "type": "string" - }, - "USDC": { - "type": "string" - }, - "KRL": { - "type": "string" - }, - "INJ": { - "type": "string" - }, - "GAME": { - "type": "string" - }, - "TRIBL": { - "type": "string" - }, - "XLM": { - "type": "string" - }, - "TRBUP": { - "type": "string" - }, - "VRADOWN": { - "type": "string" - }, - "SUPER": { - "type": "string" - }, - "EIGEN": { - "type": "string" - }, - "IOI": { - "type": "string" - }, - "KSM": { - "type": "string" - }, - "CCD": { - "type": "string" - }, - "EGO": { - "type": "string" - }, - "EGP": { - "type": "string" - }, - "MXC": { - "type": "string" - }, - "TEL": { - "type": "string" - }, - "MOVR": { - "type": "string" - }, - "XMR": { - "type": "string" - }, - "MXM": { - "type": "string" - }, - "OORT": { - "type": "string" - }, - "GLM": { - "type": "string" - }, - "RAY": { - "type": "string" - }, - "XTAG": { - "type": "string" - }, - "GLQ": { - "type": "string" - }, - "CWEB": { - "type": "string" - }, - "REVU": { - "type": "string" - }, - "REVV": { - "type": "string" - }, - "ZRO": { - "type": "string" - }, - "XNL": { - "type": "string" - }, - "XNO": { - "type": "string" - }, - "SAROS": { - "type": "string" - }, - "KACE": { - "type": "string" - }, - "ZRX": { - "type": "string" - }, - "WLTH": { - "type": "string" - }, - "ATOM3L": { - "type": "string" - }, - "GMM": { - "type": "string" - }, - "BEER": { - "type": "string" - }, - "GMT": { - "type": "string" - }, - "HEART": { - "type": "string" - }, - "GMX": { - "type": "string" - }, - "ABBC": { - "type": "string" - }, - "OMNI": { - "type": "string" - }, - "ATOM3S": { - "type": "string" - }, - "IRL": { - "type": "string" - }, - "CFG": { - "type": "string" - }, - "WSDM": { - "type": "string" - }, - "GNS": { - "type": "string" - }, - "VANRY": { - "type": "string" - }, - "CFX": { - "type": "string" - }, - "GRAIL": { - "type": "string" - }, - "BEFI": { - "type": "string" - }, - "VELO": { - "type": "string" - }, - "XPR": { - "type": "string" - }, - "DOVI": { - "type": "string" - }, - "ACE": { - "type": "string" - }, - "ACH": { - "type": "string" - }, - "ISP": { - "type": "string" - }, - "XCAD": { - "type": "string" - }, - "MINA": { - "type": "string" - }, - "TIA": { - "type": "string" - }, - "DRIFT": { - "type": "string" - }, - "ACQ": { - "type": "string" - }, - "ACS": { - "type": "string" - }, - "MIND": { - "type": "string" - }, - "STORE": { - "type": "string" - }, - "REN": { - "type": "string" - }, - "ELA": { - "type": "string" - }, - "DREAMS": { - "type": "string" - }, - "ADA": { - "type": "string" - }, - "ELF": { - "type": "string" - }, - "REQ": { - "type": "string" - }, - "STORJ": { - "type": "string" - }, - "LADYS": { - "type": "string" - }, - "PAXG": { - "type": "string" - }, - "REZ": { - "type": "string" - }, - "XRD": { - "type": "string" - }, - "CHO": { - "type": "string" - }, - "CHR": { - "type": "string" - }, - "ADS": { - "type": "string" - }, - "CHZ": { - "type": "string" - }, - "ADX": { - "type": "string" - }, - "XRP": { - "type": "string" - }, - "JASMY": { - "type": "string" - }, - "KAGI": { - "type": "string" - }, - "FIDA": { - "type": "string" - }, - "PBR": { - "type": "string" - }, - "AEG": { - "type": "string" - }, - "H2O": { - "type": "string" - }, - "CHMB": { - "type": "string" - }, - "SAND3L": { - "type": "string" - }, - "PBX": { - "type": "string" - }, - "SOLVE": { - "type": "string" - }, - "DECHAT": { - "type": "string" - }, - "GARI": { - "type": "string" - }, - "SHIB2L": { - "type": "string" - }, - "SHIB2S": { - "type": "string" - }, - "ENA": { - "type": "string" - }, - "VEMP": { - "type": "string" - }, - "ENJ": { - "type": "string" - }, - "AFG": { - "type": "string" - }, - "RATS": { - "type": "string" - }, - "GRT": { - "type": "string" - }, - "FORWARD": { - "type": "string" - }, - "TFUEL": { - "type": "string" - }, - "ENS": { - "type": "string" - }, - "KASDOWN": { - "type": "string" - }, - "XTM": { - "type": "string" - }, - "DEGEN": { - "type": "string" - }, - "TLM": { - "type": "string" - }, - "DYDXDOWN": { - "type": "string" - }, - "CKB": { - "type": "string" - }, - "LUNC": { - "type": "string" - }, - "AURORA": { - "type": "string" - }, - "LUNA": { - "type": "string" - }, - "XTZ": { - "type": "string" - }, - "ELON": { - "type": "string" - }, - "DMTR": { - "type": "string" - }, - "EOS": { - "type": "string" - }, - "GST": { - "type": "string" - }, - "FORT": { - "type": "string" - }, - "FLAME": { - "type": "string" - }, - "PATEX": { - "type": "string" - }, - "DEEP": { - "type": "string" - }, - "ID3L": { - "type": "string" - }, - "GTC": { - "type": "string" - }, - "ID3S": { - "type": "string" - }, - "RIO": { - "type": "string" - }, - "CLH": { - "type": "string" - }, - "BURGER": { - "type": "string" - }, - "VRA": { - "type": "string" - }, - "SUNDOG": { - "type": "string" - }, - "GTT": { - "type": "string" - }, - "INJUP": { - "type": "string" - }, - "CPOOL": { - "type": "string" - }, - "EPX": { - "type": "string" - }, - "CLV": { - "type": "string" - }, - "FEAR": { - "type": "string" - }, - "MEME": { - "type": "string" - }, - "ROOBEE": { - "type": "string" - }, - "DEFI": { - "type": "string" - }, - "TOKEN": { - "type": "string" - }, - "GRAPE": { - "type": "string" - }, - "KASUP": { - "type": "string" - }, - "XWG": { - "type": "string" - }, - "SKEY": { - "type": "string" - }, - "SFUND": { - "type": "string" - }, - "EQX": { - "type": "string" - }, - "ORDIUP": { - "type": "string" - }, - "TON": { - "type": "string" - }, - "DEGO": { - "type": "string" - }, - "IZI": { - "type": "string" - }, - "ERG": { - "type": "string" - }, - "ERN": { - "type": "string" - }, - "VENOM": { - "type": "string" - }, - "VOXEL": { - "type": "string" - }, - "RLC": { - "type": "string" - }, - "PHA": { - "type": "string" - }, - "DYDXUP": { - "type": "string" - }, - "APE3S": { - "type": "string" - }, - "ORBS": { - "type": "string" - }, - "OPDOWN": { - "type": "string" - }, - "ESE": { - "type": "string" - }, - "APE3L": { - "type": "string" - }, - "HMND": { - "type": "string" - }, - "COQ": { - "type": "string" - }, - "AURY": { - "type": "string" - }, - "CULT": { - "type": "string" - }, - "AKT": { - "type": "string" - }, - "GLMR": { - "type": "string" - }, - "XYM": { - "type": "string" - }, - "ORAI": { - "type": "string" - }, - "XYO": { - "type": "string" - }, - "ETC": { - "type": "string" - }, - "LAI": { - "type": "string" - }, - "PIP": { - "type": "string" - }, - "ETH": { - "type": "string" - }, - "NEO": { - "type": "string" - }, - "RMV": { - "type": "string" - }, - "KLAY": { - "type": "string" - }, - "PIT": { - "type": "string" - }, - "TARA": { - "type": "string" - }, - "KALT": { - "type": "string" - }, - "PIX": { - "type": "string" - }, - "ETN": { - "type": "string" - }, - "CSIX": { - "type": "string" - }, - "TRADE": { - "type": "string" - }, - "MAVIA": { - "type": "string" - }, - "HIGH": { - "type": "string" - }, - "TRB": { - "type": "string" - }, - "ORDI": { - "type": "string" - }, - "TRVL": { - "type": "string" - }, - "AMB": { - "type": "string" - }, - "TRU": { - "type": "string" - }, - "LOGX": { - "type": "string" - }, - "FINC": { - "type": "string" - }, - "INFRA": { - "type": "string" - }, - "NATIX": { - "type": "string" - }, - "NFP": { - "type": "string" - }, - "TRY": { - "type": "string" - }, - "TRX": { - "type": "string" - }, - "LBP": { - "type": "string" - }, - "LBR": { - "type": "string" - }, - "EUL": { - "type": "string" - }, - "NFT": { - "type": "string" - }, - "SEIUP": { - "type": "string" - }, - "PUFFER": { - "type": "string" - }, - "EUR": { - "type": "string" - }, - "ORCA": { - "type": "string" - }, - "NEAR3L": { - "type": "string" - }, - "AMP": { - "type": "string" - }, - "XDEFI": { - "type": "string" - }, - "HIFI": { - "type": "string" - }, - "TRUF": { - "type": "string" - }, - "AITECH": { - "type": "string" - }, - "AMU": { - "type": "string" - }, - "USTC": { - "type": "string" - }, - "KNGL": { - "type": "string" - }, - "FOXY": { - "type": "string" - }, - "NGC": { - "type": "string" - }, - "TENET": { - "type": "string" - }, - "NEAR3S": { - "type": "string" - }, - "MAHA": { - "type": "string" - }, - "NGL": { - "type": "string" - }, - "TST": { - "type": "string" - }, - "HIPPO": { - "type": "string" - }, - "AXS3S": { - "type": "string" - }, - "CRO": { - "type": "string" - }, - "ZPAY": { - "type": "string" - }, - "MNDE": { - "type": "string" - }, - "CRV": { - "type": "string" - }, - "SWASH": { - "type": "string" - }, - "AXS3L": { - "type": "string" - }, - "VERSE": { - "type": "string" - }, - "RPK": { - "type": "string" - }, - "RPL": { - "type": "string" - }, - "AZERO": { - "type": "string" - }, - "SOUL": { - "type": "string" - }, - "VXV": { - "type": "string" - }, - "LDO": { - "type": "string" - }, - "MAGIC": { - "type": "string" - }, - "ALICE": { - "type": "string" - }, - "SEAM": { - "type": "string" - }, - "PLU": { - "type": "string" - }, - "AOG": { - "type": "string" - }, - "SMOLE": { - "type": "string" - }, - "EWT": { - "type": "string" - }, - "TSUGT": { - "type": "string" - }, - "PMG": { - "type": "string" - }, - "OPAI": { - "type": "string" - }, - "LOCUS": { - "type": "string" - }, - "CTA": { - "type": "string" - }, - "NIM": { - "type": "string" - }, - "CTC": { - "type": "string" - }, - "APE": { - "type": "string" - }, - "MERL": { - "type": "string" - }, - "JAM": { - "type": "string" - }, - "CTI": { - "type": "string" - }, - "APP": { - "type": "string" - }, - "APT": { - "type": "string" - }, - "WLDUP": { - "type": "string" - }, - "ZEND": { - "type": "string" - }, - "FIRE": { - "type": "string" - }, - "DENT": { - "type": "string" - }, - "PYTH": { - "type": "string" - }, - "LFT": { - "type": "string" - }, - "DPET": { - "type": "string" - }, - "ORDIDOWN": { - "type": "string" - }, - "KPOL": { - "type": "string" - }, - "ETHUP": { - "type": "string" - }, - "BAND": { - "type": "string" - }, - "POL": { - "type": "string" - }, - "ASTR": { - "type": "string" - }, - "NKN": { - "type": "string" - }, - "RSR": { - "type": "string" - }, - "DVPN": { - "type": "string" - }, - "TWT": { - "type": "string" - }, - "ARB": { - "type": "string" - }, - "CVC": { - "type": "string" - }, - "ARC": { - "type": "string" - }, - "XETA": { - "type": "string" - }, - "MTRG": { - "type": "string" - }, - "LOKA": { - "type": "string" - }, - "LPOOL": { - "type": "string" - }, - "TURBOS": { - "type": "string" - }, - "CVX": { - "type": "string" - }, - "ARX": { - "type": "string" - }, - "MPLX": { - "type": "string" - }, - "SUSHI": { - "type": "string" - }, - "NLK": { - "type": "string" - }, - "PEPE2": { - "type": "string" - }, - "WBTC": { - "type": "string" - }, - "SUI3L": { - "type": "string" - }, - "CWS": { - "type": "string" - }, - "SUI3S": { - "type": "string" - }, - "INSP": { - "type": "string" - }, - "MANA": { - "type": "string" - }, - "VRTX": { - "type": "string" - }, - "CSPR": { - "type": "string" - }, - "ATA": { - "type": "string" - }, - "OPEN": { - "type": "string" - }, - "HAI": { - "type": "string" - }, - "NMR": { - "type": "string" - }, - "ATH": { - "type": "string" - }, - "LIT": { - "type": "string" - }, - "TLOS": { - "type": "string" - }, - "TNSR": { - "type": "string" - }, - "CXT": { - "type": "string" - }, - "POLYX": { - "type": "string" - }, - "ZERO": { - "type": "string" - }, - "ROUTE": { - "type": "string" - }, - "LOOM": { - "type": "string" - }, - "PRE": { - "type": "string" - }, - "VRAUP": { - "type": "string" - }, - "HBB": { - "type": "string" - }, - "RVN": { - "type": "string" - }, - "PRQ": { - "type": "string" - }, - "ONDO": { - "type": "string" - }, - "PEPEDOWN": { - "type": "string" - }, - "WOOP": { - "type": "string" - }, - "LUNCUP": { - "type": "string" - }, - "KAVA": { - "type": "string" - }, - "LKI": { - "type": "string" - }, - "AVA": { - "type": "string" - }, - "NOM": { - "type": "string" - }, - "MAPO": { - "type": "string" - }, - "PEPEUP": { - "type": "string" - }, - "STRAX": { - "type": "string" - }, - "NOT": { - "type": "string" - }, - "ZERC": { - "type": "string" - }, - "BCUT": { - "type": "string" - }, - "MASA": { - "type": "string" - }, - "WAN": { - "type": "string" - }, - "WAT": { - "type": "string" - }, - "WAX": { - "type": "string" - }, - "MASK": { - "type": "string" - }, - "EOS3L": { - "type": "string" - }, - "IDEA": { - "type": "string" - }, - "EOS3S": { - "type": "string" - }, - "YFI": { - "type": "string" - }, - "MOODENG": { - "type": "string" - }, - "XCUR": { - "type": "string" - }, - "HYDRA": { - "type": "string" - }, - "POPCAT": { - "type": "string" - }, - "LQTY": { - "type": "string" - }, - "PIXEL": { - "type": "string" - }, - "LMR": { - "type": "string" - }, - "ZETA": { - "type": "string" - }, - "YGG": { - "type": "string" - }, - "AXS": { - "type": "string" - }, - "BCHSV": { - "type": "string" - }, - "NRN": { - "type": "string" - }, - "FTON": { - "type": "string" - }, - "COMP": { - "type": "string" - }, - "XPRT": { - "type": "string" - }, - "HFT": { - "type": "string" - }, - "UXLINK": { - "type": "string" - }, - "STAMP": { - "type": "string" - }, - "RUNE": { - "type": "string" - }, - "ZEUS": { - "type": "string" - }, - "LTC3L": { - "type": "string" - }, - "DAPP": { - "type": "string" - }, - "FORTH": { - "type": "string" - }, - "ALPINE": { - "type": "string" - }, - "SENSO": { - "type": "string" - }, - "LTC3S": { - "type": "string" - }, - "DEXE": { - "type": "string" - }, - "GOAL": { - "type": "string" - }, - "AVAX": { - "type": "string" - }, - "LISTA": { - "type": "string" - }, - "AMPL": { - "type": "string" - }, - "WORK": { - "type": "string" - }, - "BRWL": { - "type": "string" - }, - "BANANA": { - "type": "string" - }, - "PUSH": { - "type": "string" - }, - "WEN": { - "type": "string" - }, - "NEIRO": { - "type": "string" - }, - "BTCUP": { - "type": "string" - }, - "SOL3S": { - "type": "string" - }, - "BRAWL": { - "type": "string" - }, - "LAY3R": { - "type": "string" - }, - "LPT": { - "type": "string" - }, - "GODS": { - "type": "string" - }, - "SAND3S": { - "type": "string" - }, - "RDNT": { - "type": "string" - }, - "SOL3L": { - "type": "string" - }, - "NIBI": { - "type": "string" - }, - "NUM": { - "type": "string" - }, - "PYR": { - "type": "string" - }, - "DAG": { - "type": "string" - }, - "DAI": { - "type": "string" - }, - "HIP": { - "type": "string" - }, - "DAO": { - "type": "string" - }, - "AVAIL": { - "type": "string" - }, - "DAR": { - "type": "string" - }, - "FET": { - "type": "string" - }, - "FCON": { - "type": "string" - }, - "XAVA": { - "type": "string" - }, - "LRC": { - "type": "string" - }, - "UNI3S": { - "type": "string" - }, - "POKT": { - "type": "string" - }, - "DASH": { - "type": "string" - }, - "BAKEDOWN": { - "type": "string" - }, - "POLC": { - "type": "string" - }, - "CIRUS": { - "type": "string" - }, - "UNI3L": { - "type": "string" - }, - "NWC": { - "type": "string" - }, - "POLK": { - "type": "string" - }, - "LSD": { - "type": "string" - }, - "MARS4": { - "type": "string" - }, - "LSK": { - "type": "string" - }, - "BLOCK": { - "type": "string" - }, - "ANALOS": { - "type": "string" - }, - "SAFE": { - "type": "string" - }, - "DCK": { - "type": "string" - }, - "LSS": { - "type": "string" - }, - "DCR": { - "type": "string" - }, - "LIKE": { - "type": "string" - }, - "DATA": { - "type": "string" - }, - "WIF": { - "type": "string" - }, - "BLOK": { - "type": "string" - }, - "LTC": { - "type": "string" - }, - "METIS": { - "type": "string" - }, - "WIN": { - "type": "string" - }, - "HLG": { - "type": "string" - }, - "LTO": { - "type": "string" - }, - "DYDX": { - "type": "string" - }, - "ARB3S": { - "type": "string" - }, - "MUBI": { - "type": "string" - }, - "ARB3L": { - "type": "string" - }, - "RBTC1": { - "type": "string" - }, - "POND": { - "type": "string" - }, - "LINA": { - "type": "string" - }, - "MYRIA": { - "type": "string" - }, - "LINK": { - "type": "string" - }, - "QTUM": { - "type": "string" - }, - "TUNE": { - "type": "string" - }, - "UFO": { - "type": "string" - }, - "CYBER": { - "type": "string" - }, - "WILD": { - "type": "string" - }, - "POLS": { - "type": "string" - }, - "NYM": { - "type": "string" - }, - "FIL": { - "type": "string" - }, - "BAL": { - "type": "string" - }, - "SCA": { - "type": "string" - }, - "STND": { - "type": "string" - }, - "WMTX": { - "type": "string" - }, - "SCLP": { - "type": "string" - }, - "MANEKI": { - "type": "string" - }, - "BAT": { - "type": "string" - }, - "AKRO": { - "type": "string" - }, - "FTM3L": { - "type": "string" - }, - "BAX": { - "type": "string" - }, - "FTM3S": { - "type": "string" - }, - "COTI": { - "type": "string" - } - }, - "required": [ - "AGLD", - "DFI", - "PYTHUP", - "ISLM", - "NEAR", - "AIOZ", - "AUDIO", - "BBL", - "WLD", - "HNT", - "ETHFI", - "DMAIL", - "OPUP", - "VET3S", - "MANA3S", - "TIDAL", - "HALO", - "OPUL", - "MANA3L", - "DGB", - "AA", - "BCH", - "GMEE", - "JST", - "PBUX", - "AR", - "SEI", - "PSTAKE", - "LMWR", - "UNFIDOWN", - "BB", - "JTO", - "WEMIX", - "G", - "MARSH", - "BN", - "FLIP", - "FLR", - "BIGTIME", - "FLY", - "T", - "W", - "BDX", - "BABYDOGE", - "SFP", - "DIA", - "ISME", - "LYM", - "VET3L", - "JUP", - "LYX", - "AIEPK", - "SILLY", - "SCPT", - "WOO", - "BLUR", - "STRK", - "BFC", - "DC", - "KARATE", - "SUSHI3L", - "NETVR", - "WAVES", - "LITH", - "HAPI", - "SUSHI3S", - "CEEK", - "FLOKI", - "SHR", - "SAND", - "TURT", - "UMA", - "BEPRO", - "SCRT", - "TUSD", - "COOKIE", - "LRDS", - "SIN", - "OAS", - "ROOT", - "ADA3L", - "TIAUP", - "HTR", - "UNB", - "UNA", - "HARD", - "G3", - "ADA3S", - "MYRO", - "HTX", - "FT", - "BTCDOWN", - "UNI", - "FX", - "OBI", - "UNO", - "WRX", - "TIADOWN", - "ETHDOWN", - "WELL", - "SWFTC", - "SKL", - "UOS", - "AIPAD", - "BRETT", - "SKY", - "FRM", - "VISION", - "LENDS", - "SLF", - "BULL", - "FLOW", - "ODDZ", - "SLN", - "UPO", - "SLP", - "ID", - "SLIM", - "SPOT", - "DOP", - "ISSP", - "UQC", - "IO", - "DOT", - "1INCH", - "SMH", - "MAK", - "TOKO", - "TURBO", - "UNFI", - "MAN", - "EVER", - "FTM", - "SHRAP", - "MAV", - "MAX", - "DPR", - "FTT", - "ARKM", - "ATOM", - "PENDLE", - "QUICK", - "BLZ", - "BOBA", - "MBL", - "OFN", - "UNIO", - "SNS", - "SNX", - "NXRA", - "TAIKO", - "AVAX3L", - "L3", - "API3", - "XRP3S", - "QKC", - "AVAX3S", - "ROSE", - "SATS", - "BMX", - "PORTAL", - "TOMI", - "XRP3L", - "SOL", - "SON", - "BNC", - "SOCIAL", - "CGPT", - "CELR", - "BNB", - "OGN", - "CELO", - "AUCTION", - "MANTA", - "LAYER", - "AERO", - "CETUS", - "LL", - "SPA", - "PYTHDOWN", - "NEIROCTO", - "UTK", - "GMRX", - "BOB", - "HOTCROSS", - "AERGO", - "MOCA", - "SQD", - "MV", - "BNB3L", - "BNB3S", - "GALAX3L", - "KAI", - "SQR", - "GALAX3S", - "EGLD", - "ZBCN", - "KAS", - "MEW", - "PUNDIX", - "LOOKS", - "FXS", - "BOSON", - "BRISE", - "AEVO", - "FLUX", - "PRCL", - "UNFIUP", - "SEIDOWN", - "DOAI", - "QNT", - "REDO", - "STRIKE", - "ETHW", - "OM", - "OP", - "WHALE", - "1CAT", - "NEON", - "GTAI", - "SSV", - "ETH2", - "KCS", - "ARPA", - "ARTFI", - "BRL", - "ALEX", - "STG", - "SHIB", - "IOTX", - "OLE", - "KDA", - "CERE", - "DOCK", - "STX", - "OLT", - "QI", - "SDAO", - "BLAST", - "LINK3S", - "IOST", - "SUI", - "CAKE", - "BSW", - "OMG", - "VOLT", - "LINK3L", - "GEEQ", - "PYUSD", - "SUN", - "TOWER", - "BTC", - "IOTA", - "REEF", - "TRIAS", - "KEY", - "ETH3L", - "BTT", - "ONE", - "RENDER", - "ETH3S", - "ANKR", - "ALGO", - "SYLO", - "ZCX", - "SD", - "ONT", - "MJT", - "DYM", - "DYP", - "BAKEUP", - "OOE", - "ZELIX", - "DOGE3L", - "ARTY", - "QORPO", - "ICE", - "NOTAI", - "DOGE3S", - "NAKA", - "GALAX", - "MKR", - "DODO", - "ICP", - "ZEC", - "ZEE", - "ICX", - "KMNO", - "TT", - "DOT3L", - "XAI", - "ZEN", - "DOGE", - "ALPHA", - "DUSK", - "DOT3S", - "SXP", - "HBAR", - "SYNT", - "ZEX", - "BONDLY", - "MLK", - "KICKS", - "PEPE", - "OUSD", - "LUNCDOWN", - "DOGS", - "REV3L", - "CTSI", - "C98", - "OSMO", - "NTRN", - "CFX2S", - "SYN", - "VIDT", - "SYS", - "GAS", - "BOME", - "COMBO", - "XCH", - "VR", - "CFX2L", - "VSYS", - "PANDORA", - "THETA", - "XCN", - "NEXG", - "MELOS", - "XCV", - "ORN", - "WLKN", - "AAVE", - "MNT", - "BONK", - "PERP", - "XDC", - "MNW", - "XDB", - "BOND", - "SUIA", - "MOG", - "SUTER", - "TIME", - "RACA", - "BICO", - "MON", - "SWEAT", - "MOXIE", - "BABYBNB", - "IGU", - "HMSTR", - "XEC", - "MONI", - "XR", - "PEOPLE", - "PUMLX", - "ZIL", - "WLDDOWN", - "VAI", - "XEN", - "MPC", - "XEM", - "JASMY3S", - "OTK", - "TRAC", - "DFYN", - "BIDP", - "JASMY3L", - "INJDOWN", - "KLV", - "WAXL", - "TRBDOWN", - "BCH3L", - "GMT3S", - "KMD", - "BCH3S", - "ECOX", - "AAVE3S", - "GMT3L", - "EPIK", - "SUIP", - "AAVE3L", - "ZK", - "ZKF", - "OMNIA", - "ZKJ", - "ZKL", - "GAFI", - "CARV", - "KNC", - "CATS", - "PROM", - "ALEPH", - "PONKE", - "OVR", - "CATI", - "ORDER", - "GFT", - "BIFI", - "GGC", - "GGG", - "DAPPX", - "SUKU", - "ULTI", - "CREDI", - "ERTHA", - "FURY", - "KARRAT", - "MOBILE", - "SIDUS", - "NAVI", - "TAO", - "USDJ", - "MTL", - "VET", - "FITFI", - "USDT", - "OXT", - "CANDY", - "USDP", - "MTS", - "TADA", - "MTV", - "NAVX", - "ILV", - "VINU", - "GHX", - "EDU", - "HYVE", - "BTC3L", - "ANYONE", - "BEAT", - "KING", - "CREAM", - "CAS", - "IMX", - "CAT", - "BTC3S", - "USDE", - "USDD", - "CWAR", - "USDC", - "KRL", - "INJ", - "GAME", - "TRIBL", - "XLM", - "TRBUP", - "VRADOWN", - "SUPER", - "EIGEN", - "IOI", - "KSM", - "CCD", - "EGO", - "EGP", - "MXC", - "TEL", - "MOVR", - "XMR", - "MXM", - "OORT", - "GLM", - "RAY", - "XTAG", - "GLQ", - "CWEB", - "REVU", - "REVV", - "ZRO", - "XNL", - "XNO", - "SAROS", - "KACE", - "ZRX", - "WLTH", - "ATOM3L", - "GMM", - "BEER", - "GMT", - "HEART", - "GMX", - "ABBC", - "OMNI", - "ATOM3S", - "IRL", - "CFG", - "WSDM", - "GNS", - "VANRY", - "CFX", - "GRAIL", - "BEFI", - "VELO", - "XPR", - "DOVI", - "ACE", - "ACH", - "ISP", - "XCAD", - "MINA", - "TIA", - "DRIFT", - "ACQ", - "ACS", - "MIND", - "STORE", - "REN", - "ELA", - "DREAMS", - "ADA", - "ELF", - "REQ", - "STORJ", - "LADYS", - "PAXG", - "REZ", - "XRD", - "CHO", - "CHR", - "ADS", - "CHZ", - "ADX", - "XRP", - "JASMY", - "KAGI", - "FIDA", - "PBR", - "AEG", - "H2O", - "CHMB", - "SAND3L", - "PBX", - "SOLVE", - "DECHAT", - "GARI", - "SHIB2L", - "SHIB2S", - "ENA", - "VEMP", - "ENJ", - "AFG", - "RATS", - "GRT", - "FORWARD", - "TFUEL", - "ENS", - "KASDOWN", - "XTM", - "DEGEN", - "TLM", - "DYDXDOWN", - "CKB", - "LUNC", - "AURORA", - "LUNA", - "XTZ", - "ELON", - "DMTR", - "EOS", - "GST", - "FORT", - "FLAME", - "PATEX", - "DEEP", - "ID3L", - "GTC", - "ID3S", - "RIO", - "CLH", - "BURGER", - "VRA", - "SUNDOG", - "GTT", - "INJUP", - "CPOOL", - "EPX", - "CLV", - "FEAR", - "MEME", - "ROOBEE", - "DEFI", - "TOKEN", - "GRAPE", - "KASUP", - "XWG", - "SKEY", - "SFUND", - "EQX", - "ORDIUP", - "TON", - "DEGO", - "IZI", - "ERG", - "ERN", - "VENOM", - "VOXEL", - "RLC", - "PHA", - "DYDXUP", - "APE3S", - "ORBS", - "OPDOWN", - "ESE", - "APE3L", - "HMND", - "COQ", - "AURY", - "CULT", - "AKT", - "GLMR", - "XYM", - "ORAI", - "XYO", - "ETC", - "LAI", - "PIP", - "ETH", - "NEO", - "RMV", - "KLAY", - "PIT", - "TARA", - "KALT", - "PIX", - "ETN", - "CSIX", - "TRADE", - "MAVIA", - "HIGH", - "TRB", - "ORDI", - "TRVL", - "AMB", - "TRU", - "LOGX", - "FINC", - "INFRA", - "NATIX", - "NFP", - "TRY", - "TRX", - "LBP", - "LBR", - "EUL", - "NFT", - "SEIUP", - "PUFFER", - "EUR", - "ORCA", - "NEAR3L", - "AMP", - "XDEFI", - "HIFI", - "TRUF", - "AITECH", - "AMU", - "USTC", - "KNGL", - "FOXY", - "NGC", - "TENET", - "NEAR3S", - "MAHA", - "NGL", - "TST", - "HIPPO", - "AXS3S", - "CRO", - "ZPAY", - "MNDE", - "CRV", - "SWASH", - "AXS3L", - "VERSE", - "RPK", - "RPL", - "AZERO", - "SOUL", - "VXV", - "LDO", - "MAGIC", - "ALICE", - "SEAM", - "PLU", - "AOG", - "SMOLE", - "EWT", - "TSUGT", - "PMG", - "OPAI", - "LOCUS", - "CTA", - "NIM", - "CTC", - "APE", - "MERL", - "JAM", - "CTI", - "APP", - "APT", - "WLDUP", - "ZEND", - "FIRE", - "DENT", - "PYTH", - "LFT", - "DPET", - "ORDIDOWN", - "KPOL", - "ETHUP", - "BAND", - "POL", - "ASTR", - "NKN", - "RSR", - "DVPN", - "TWT", - "ARB", - "CVC", - "ARC", - "XETA", - "MTRG", - "LOKA", - "LPOOL", - "TURBOS", - "CVX", - "ARX", - "MPLX", - "SUSHI", - "NLK", - "PEPE2", - "WBTC", - "SUI3L", - "CWS", - "SUI3S", - "INSP", - "MANA", - "VRTX", - "CSPR", - "ATA", - "OPEN", - "HAI", - "NMR", - "ATH", - "LIT", - "TLOS", - "TNSR", - "CXT", - "POLYX", - "ZERO", - "ROUTE", - "LOOM", - "PRE", - "VRAUP", - "HBB", - "RVN", - "PRQ", - "ONDO", - "PEPEDOWN", - "WOOP", - "LUNCUP", - "KAVA", - "LKI", - "AVA", - "NOM", - "MAPO", - "PEPEUP", - "STRAX", - "NOT", - "ZERC", - "BCUT", - "MASA", - "WAN", - "WAT", - "WAX", - "MASK", - "EOS3L", - "IDEA", - "EOS3S", - "YFI", - "MOODENG", - "XCUR", - "HYDRA", - "POPCAT", - "LQTY", - "PIXEL", - "LMR", - "ZETA", - "YGG", - "AXS", - "BCHSV", - "NRN", - "FTON", - "COMP", - "XPRT", - "HFT", - "UXLINK", - "STAMP", - "RUNE", - "ZEUS", - "LTC3L", - "DAPP", - "FORTH", - "ALPINE", - "SENSO", - "LTC3S", - "DEXE", - "GOAL", - "AVAX", - "LISTA", - "AMPL", - "WORK", - "BRWL", - "BANANA", - "PUSH", - "WEN", - "NEIRO", - "BTCUP", - "SOL3S", - "BRAWL", - "LAY3R", - "LPT", - "GODS", - "SAND3S", - "RDNT", - "SOL3L", - "NIBI", - "NUM", - "PYR", - "DAG", - "DAI", - "HIP", - "DAO", - "AVAIL", - "DAR", - "FET", - "FCON", - "XAVA", - "LRC", - "UNI3S", - "POKT", - "DASH", - "BAKEDOWN", - "POLC", - "CIRUS", - "UNI3L", - "NWC", - "POLK", - "LSD", - "MARS4", - "LSK", - "BLOCK", - "ANALOS", - "SAFE", - "DCK", - "LSS", - "DCR", - "LIKE", - "DATA", - "WIF", - "BLOK", - "LTC", - "METIS", - "WIN", - "HLG", - "LTO", - "DYDX", - "ARB3S", - "MUBI", - "ARB3L", - "RBTC1", - "POND", - "LINA", - "MYRIA", - "LINK", - "QTUM", - "TUNE", - "UFO", - "CYBER", - "WILD", - "POLS", - "NYM", - "FIL", - "BAL", - "SCA", - "STND", - "WMTX", - "SCLP", - "MANEKI", - "BAT", - "AKRO", - "FTM3L", - "BAX", - "FTM3S", - "COTI" + "chains": { + "type": "array", + "items": { + "type": "object", + "properties": { + "chainName": { + "type": "string", + "description": "chain name of currency" + }, + "withdrawalMinSize": { + "type": "string", + "description": "Minimum withdrawal amount" + }, + "depositMinSize": { + "type": "string", + "description": "Minimum deposit amount" + }, + "withdrawFeeRate": { + "type": "string", + "description": "withdraw fee rate" + }, + "withdrawalMinFee": { + "type": "string", + "description": "Minimum fees charged for withdrawal" + }, + "isWithdrawEnabled": { + "type": "boolean", + "description": "Support withdrawal or not" + }, + "isDepositEnabled": { + "type": "boolean", + "description": "Support deposit or not" + }, + "confirms": { + "type": "integer", + "description": "Number of block confirmations" + }, + "preConfirms": { + "type": "integer", + "description": "The number of blocks (confirmations) for advance on-chain verification" + }, + "contractAddress": { + "type": "string", + "description": "Contract address" + }, + "withdrawPrecision": { + "type": "integer", + "description": "Withdrawal precision bit, indicating the maximum supported length after the decimal point of the withdrawal amount" + }, + "maxWithdraw": { + "type": "number", + "description": "Maximum amount of single withdrawal" + }, + "maxDeposit": { + "type": "string", + "description": "Maximum amount of single deposit (only applicable to Lightning Network)" + }, + "needTag": { + "type": "boolean", + "description": "whether memo/tag is needed" + }, + "chainId": { + "type": "string", + "description": "chain id of currency" + } + }, + "required": [ + "chainName", + "withdrawalMinSize", + "depositMinSize", + "withdrawFeeRate", + "withdrawalMinFee", + "isWithdrawEnabled", + "isDepositEnabled", + "confirms", + "preConfirms", + "contractAddress", + "withdrawPrecision", + "maxWithdraw", + "maxDeposit", + "needTag", + "chainId" + ] + }, + "description": "chain list" + } + }, + "required": [ + "currency", + "name", + "fullName", + "precision", + "confirms", + "contractAddress", + "isMarginEnabled", + "isDebitEnabled", + "chains" + ] + } + }, + "required": [ + "code", + "data" + ] + } + } + } + } + }, + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470155", + "x-abandon": "normal", + "x-domain": "Spot", + "x-api-channel": "Public", + "x-api-permission": "NULL", + "x-api-rate-limit-pool": "Public", + "x-sdk-service": "Spot", + "x-sdk-sub-service": "Market", + "x-sdk-method-name": "getCurrency", + "x-sdk-method-description": "Request via this endpoint to get the currency details of a specified currency", + "x-api-rate-limit": 3, + "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"currency\\\":\\\"BTC\\\",\\\"name\\\":\\\"BTC\\\",\\\"fullName\\\":\\\"Bitcoin\\\",\\\"precision\\\":8,\\\"confirms\\\":null,\\\"contractAddress\\\":null,\\\"isMarginEnabled\\\":true,\\\"isDebitEnabled\\\":true,\\\"chains\\\":[{\\\"chainName\\\":\\\"BTC\\\",\\\"withdrawalMinSize\\\":\\\"0.001\\\",\\\"depositMinSize\\\":\\\"0.0002\\\",\\\"withdrawFeeRate\\\":\\\"0\\\",\\\"withdrawalMinFee\\\":\\\"0.0005\\\",\\\"isWithdrawEnabled\\\":true,\\\"isDepositEnabled\\\":true,\\\"confirms\\\":3,\\\"preConfirms\\\":1,\\\"contractAddress\\\":\\\"\\\",\\\"withdrawPrecision\\\":8,\\\"maxWithdraw\\\":null,\\\"maxDeposit\\\":null,\\\"needTag\\\":false,\\\"chainId\\\":\\\"btc\\\"},{\\\"chainName\\\":\\\"Lightning Network\\\",\\\"withdrawalMinSize\\\":\\\"0.00001\\\",\\\"depositMinSize\\\":\\\"0.00001\\\",\\\"withdrawFeeRate\\\":\\\"0\\\",\\\"withdrawalMinFee\\\":\\\"0.000015\\\",\\\"isWithdrawEnabled\\\":true,\\\"isDepositEnabled\\\":true,\\\"confirms\\\":1,\\\"preConfirms\\\":1,\\\"contractAddress\\\":\\\"\\\",\\\"withdrawPrecision\\\":8,\\\"maxWithdraw\\\":null,\\\"maxDeposit\\\":\\\"0.03\\\",\\\"needTag\\\":false,\\\"chainId\\\":\\\"btcln\\\"},{\\\"chainName\\\":\\\"KCC\\\",\\\"withdrawalMinSize\\\":\\\"0.0008\\\",\\\"depositMinSize\\\":null,\\\"withdrawFeeRate\\\":\\\"0\\\",\\\"withdrawalMinFee\\\":\\\"0.00002\\\",\\\"isWithdrawEnabled\\\":true,\\\"isDepositEnabled\\\":true,\\\"confirms\\\":20,\\\"preConfirms\\\":20,\\\"contractAddress\\\":\\\"0xfa93c12cd345c658bc4644d1d4e1b9615952258c\\\",\\\"withdrawPrecision\\\":8,\\\"maxWithdraw\\\":null,\\\"maxDeposit\\\":null,\\\"needTag\\\":false,\\\"chainId\\\":\\\"kcc\\\"},{\\\"chainName\\\":\\\"BTC-Segwit\\\",\\\"withdrawalMinSize\\\":\\\"0.0008\\\",\\\"depositMinSize\\\":\\\"0.0002\\\",\\\"withdrawFeeRate\\\":\\\"0\\\",\\\"withdrawalMinFee\\\":\\\"0.0005\\\",\\\"isWithdrawEnabled\\\":false,\\\"isDepositEnabled\\\":true,\\\"confirms\\\":2,\\\"preConfirms\\\":2,\\\"contractAddress\\\":\\\"\\\",\\\"withdrawPrecision\\\":8,\\\"maxWithdraw\\\":null,\\\"maxDeposit\\\":null,\\\"needTag\\\":false,\\\"chainId\\\":\\\"bech32\\\"}]}}", + "x-request-example": "{\\\"currency\\\": \\\"BTC\\\", \\\"chain\\\": \\\"eth\\\"}" + } + }, + "/api/v3/currencies": { + "get": { + "summary": "Get All Currencies", + "deprecated": false, + "description": "Request via this endpoint to get the currency list.Not all currencies currently can be used for trading.", + "tags": [], + "parameters": [], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "array", + "items": { + "type": "object", + "properties": { + "currency": { + "type": "string", + "description": "A unique currency code that will never change" + }, + "name": { + "type": "string", + "description": "Currency name, will change after renaming" + }, + "fullName": { + "type": "string", + "description": "Full name of a currency, will change after renaming" + }, + "precision": { + "type": "integer", + "description": "Currency precision" + }, + "confirms": { + "type": "integer", + "description": "Number of block confirmations" + }, + "contractAddress": { + "type": "string", + "description": "Contract address" + }, + "isMarginEnabled": { + "type": "boolean", + "description": "Support margin or not" + }, + "isDebitEnabled": { + "type": "boolean", + "description": "Support debit or not" + }, + "chains": { + "type": "array", + "items": { + "type": "object", + "properties": { + "chainName": { + "type": "string", + "description": "chain name of currency" + }, + "withdrawalMinSize": { + "type": "string", + "description": "Minimum withdrawal amount" + }, + "depositMinSize": { + "type": "string", + "description": "Minimum deposit amount" + }, + "withdrawFeeRate": { + "type": "string", + "description": "withdraw fee rate" + }, + "withdrawalMinFee": { + "type": "string", + "description": "Minimum fees charged for withdrawal" + }, + "isWithdrawEnabled": { + "type": "boolean", + "description": "Support withdrawal or not" + }, + "isDepositEnabled": { + "type": "boolean", + "description": "Support deposit or not" + }, + "confirms": { + "type": "integer", + "description": "Number of block confirmations" + }, + "preConfirms": { + "type": "integer", + "description": "The number of blocks (confirmations) for advance on-chain verification" + }, + "contractAddress": { + "type": "string", + "description": "Contract address" + }, + "withdrawPrecision": { + "type": "integer", + "description": "Withdrawal precision bit, indicating the maximum supported length after the decimal point of the withdrawal amount" + }, + "maxWithdraw": { + "type": "string", + "description": "Maximum amount of single withdrawal" + }, + "maxDeposit": { + "type": "string", + "description": "Maximum amount of single deposit (only applicable to Lightning Network)" + }, + "needTag": { + "type": "boolean", + "description": "whether memo/tag is needed" + }, + "chainId": { + "type": "string", + "description": "chain id of currency" + }, + "depositFeeRate": { + "type": "string", + "description": "deposit fee rate (some currencies have this param, the default is empty)" + }, + "withdrawMaxFee": { + "type": "string", + "description": "withdraw max fee(some currencies have this param, the default is empty)" + }, + "depositTierFee": { + "type": "string" + } + }, + "required": [ + "chainName", + "withdrawalMinSize", + "depositMinSize", + "withdrawFeeRate", + "withdrawalMinFee", + "isWithdrawEnabled", + "isDepositEnabled", + "confirms", + "preConfirms", + "contractAddress", + "withdrawPrecision", + "maxWithdraw", + "maxDeposit", + "needTag", + "chainId" + ] + }, + "description": "chain list" + } + }, + "required": [ + "currency", + "name", + "fullName", + "precision", + "confirms", + "contractAddress", + "isMarginEnabled", + "isDebitEnabled", + "chains" + ] + } + } + }, + "required": [ + "code", + "data" + ] + } + } + } + } + }, + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470152", + "x-abandon": "normal", + "x-domain": "Spot", + "x-api-channel": "Public", + "x-api-permission": "NULL", + "x-api-rate-limit-pool": "Public", + "x-sdk-service": "Spot", + "x-sdk-sub-service": "Market", + "x-sdk-method-name": "getAllCurrencies", + "x-sdk-method-description": "Request via this endpoint to get the currency list.Not all currencies currently can be used for trading.", + "x-api-rate-limit": 3, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": [\\n {\\n \\\"currency\\\": \\\"BTC\\\",\\n \\\"name\\\": \\\"BTC\\\",\\n \\\"fullName\\\": \\\"Bitcoin\\\",\\n \\\"precision\\\": 8,\\n \\\"confirms\\\": null,\\n \\\"contractAddress\\\": null,\\n \\\"isMarginEnabled\\\": true,\\n \\\"isDebitEnabled\\\": true,\\n \\\"chains\\\": [\\n {\\n \\\"chainName\\\": \\\"BTC\\\",\\n \\\"withdrawalMinSize\\\": \\\"0.001\\\",\\n \\\"depositMinSize\\\": \\\"0.0002\\\",\\n \\\"withdrawFeeRate\\\": \\\"0\\\",\\n \\\"withdrawalMinFee\\\": \\\"0.0005\\\",\\n \\\"isWithdrawEnabled\\\": true,\\n \\\"isDepositEnabled\\\": true,\\n \\\"confirms\\\": 3,\\n \\\"preConfirms\\\": 1,\\n \\\"contractAddress\\\": \\\"\\\",\\n \\\"withdrawPrecision\\\": 8,\\n \\\"maxWithdraw\\\": null,\\n \\\"maxDeposit\\\": null,\\n \\\"needTag\\\": false,\\n \\\"chainId\\\": \\\"btc\\\"\\n },\\n {\\n \\\"chainName\\\": \\\"Lightning Network\\\",\\n \\\"withdrawalMinSize\\\": \\\"0.00001\\\",\\n \\\"depositMinSize\\\": \\\"0.00001\\\",\\n \\\"withdrawFeeRate\\\": \\\"0\\\",\\n \\\"withdrawalMinFee\\\": \\\"0.000015\\\",\\n \\\"isWithdrawEnabled\\\": true,\\n \\\"isDepositEnabled\\\": true,\\n \\\"confirms\\\": 1,\\n \\\"preConfirms\\\": 1,\\n \\\"contractAddress\\\": \\\"\\\",\\n \\\"withdrawPrecision\\\": 8,\\n \\\"maxWithdraw\\\": null,\\n \\\"maxDeposit\\\": \\\"0.03\\\",\\n \\\"needTag\\\": false,\\n \\\"chainId\\\": \\\"btcln\\\"\\n },\\n {\\n \\\"chainName\\\": \\\"KCC\\\",\\n \\\"withdrawalMinSize\\\": \\\"0.0008\\\",\\n \\\"depositMinSize\\\": null,\\n \\\"withdrawFeeRate\\\": \\\"0\\\",\\n \\\"withdrawalMinFee\\\": \\\"0.00002\\\",\\n \\\"isWithdrawEnabled\\\": true,\\n \\\"isDepositEnabled\\\": true,\\n \\\"confirms\\\": 20,\\n \\\"preConfirms\\\": 20,\\n \\\"contractAddress\\\": \\\"0xfa93c12cd345c658bc4644d1d4e1b9615952258c\\\",\\n \\\"withdrawPrecision\\\": 8,\\n \\\"maxWithdraw\\\": null,\\n \\\"maxDeposit\\\": null,\\n \\\"needTag\\\": false,\\n \\\"chainId\\\": \\\"kcc\\\"\\n },\\n {\\n \\\"chainName\\\": \\\"BTC-Segwit\\\",\\n \\\"withdrawalMinSize\\\": \\\"0.0008\\\",\\n \\\"depositMinSize\\\": \\\"0.0002\\\",\\n \\\"withdrawFeeRate\\\": \\\"0\\\",\\n \\\"withdrawalMinFee\\\": \\\"0.0005\\\",\\n \\\"isWithdrawEnabled\\\": false,\\n \\\"isDepositEnabled\\\": true,\\n \\\"confirms\\\": 2,\\n \\\"preConfirms\\\": 2,\\n \\\"contractAddress\\\": \\\"\\\",\\n \\\"withdrawPrecision\\\": 8,\\n \\\"maxWithdraw\\\": null,\\n \\\"maxDeposit\\\": null,\\n \\\"needTag\\\": false,\\n \\\"chainId\\\": \\\"bech32\\\"\\n }\\n ]\\n },\\n {\\n \\\"currency\\\": \\\"BTCP\\\",\\n \\\"name\\\": \\\"BTCP\\\",\\n \\\"fullName\\\": \\\"Bitcoin Private\\\",\\n \\\"precision\\\": 8,\\n \\\"confirms\\\": null,\\n \\\"contractAddress\\\": null,\\n \\\"isMarginEnabled\\\": false,\\n \\\"isDebitEnabled\\\": false,\\n \\\"chains\\\": [\\n {\\n \\\"chainName\\\": \\\"BTCP\\\",\\n \\\"withdrawalMinSize\\\": \\\"0.100000\\\",\\n \\\"depositMinSize\\\": null,\\n \\\"withdrawFeeRate\\\": \\\"0\\\",\\n \\\"withdrawalMinFee\\\": \\\"0.010000\\\",\\n \\\"isWithdrawEnabled\\\": false,\\n \\\"isDepositEnabled\\\": false,\\n \\\"confirms\\\": 6,\\n \\\"preConfirms\\\": 6,\\n \\\"contractAddress\\\": \\\"\\\",\\n \\\"withdrawPrecision\\\": 8,\\n \\\"maxWithdraw\\\": null,\\n \\\"maxDeposit\\\": null,\\n \\\"needTag\\\": false,\\n \\\"chainId\\\": \\\"btcp\\\"\\n }\\n ]\\n }\\n ]\\n}" + } + }, + "/api/v2/symbols/{symbol}": { + "get": { + "summary": "Get Symbol ", + "deprecated": false, + "description": "Request via this endpoint to get detail currency pairs for trading. If you want to get the market information of the trading symbol, please use Get All Tickers.", + "tags": [], + "parameters": [ + { + "name": "symbol", + "in": "path", + "description": "Path parameter, Symbol", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "object", + "properties": { + "symbol": { + "type": "string", + "description": "unique code of a symbol, it would not change after renaming", + "example": [ + "BTC-USDT", + "BCHSV-USDT" + ] + }, + "name": { + "type": "string", + "description": "Name of trading pairs, it would change after renaming", + "example": [ + "BTC-USDT", + "BSV-USDT" + ] + }, + "baseCurrency": { + "type": "string", + "description": "Base currency,e.g. BTC." + }, + "quoteCurrency": { + "type": "string", + "description": "Quote currency,e.g. USDT." + }, + "feeCurrency": { + "type": "string", + "description": "The currency of charged fees." + }, + "market": { + "type": "string", + "description": "The trading market.", + "example": [ + "USDS", + "BTC", + "ALTS" + ] + }, + "baseMinSize": { + "type": "string", + "description": "The minimum order quantity requried to place an order." + }, + "quoteMinSize": { + "type": "string", + "description": "The minimum order funds required to place a market order." + }, + "baseMaxSize": { + "type": "string", + "description": "The maximum order size required to place an order." + }, + "quoteMaxSize": { + "type": "string", + "description": "The maximum order funds required to place a market order." + }, + "baseIncrement": { + "type": "string", + "description": "Quantity increment: The quantity for an order must be a positive integer multiple of this increment. Here, the size refers to the quantity of the base currency for the order. For example, for the ETH-USDT trading pair, if the baseIncrement is 0.0000001, the order quantity can be 1.0000001 but not 1.00000001." + }, + "quoteIncrement": { + "type": "string", + "description": "Quote increment: The funds for a market order must be a positive integer multiple of this increment. The funds refer to the quote currency amount. For example, for the ETH-USDT trading pair, if the quoteIncrement is 0.000001, the amount of USDT for the order can be 3000.000001 but not 3000.0000001." + }, + "priceIncrement": { + "type": "string", + "description": "Price increment: The price of an order must be a positive integer multiple of this increment. For example, for the ETH-USDT trading pair, if the priceIncrement is 0.01, the order price can be 3000.01 but not 3000.001." + }, + "priceLimitRate": { + "type": "string", + "description": "Threshold for price portection" + }, + "minFunds": { + "type": "string", + "description": "the minimum trading amounts" + }, + "isMarginEnabled": { + "type": "boolean", + "description": "Available for margin or not." + }, + "enableTrading": { + "type": "boolean", + "description": "Available for transaction or not." + }, + "feeCategory": { + "type": "integer", + "description": "[Fee Type](https://www.kucoin.com/vip/privilege)", + "enum": [ + 1, + 2, + 3 + ], + "x-api-enum": [ + { + "value": 1, + "name": "classA", + "description": "classA" + }, + { + "value": 2, + "name": "classB", + "description": "classB" + }, + { + "value": 3, + "name": "classC", + "description": "classC" + } + ] + }, + "makerFeeCoefficient": { + "type": "string", + "description": "The maker fee coefficient. The actual fee needs to be multiplied by this coefficient to get the final fee. Most currencies have a coefficient of 1. If set to 0, it means no fee" + }, + "takerFeeCoefficient": { + "type": "string", + "description": "The taker fee coefficient. The actual fee needs to be multiplied by this coefficient to get the final fee. Most currencies have a coefficient of 1. If set to 0, it means no fee" + }, + "st": { + "type": "boolean" + } + }, + "required": [ + "symbol", + "name", + "baseCurrency", + "quoteCurrency", + "feeCurrency", + "market", + "baseMinSize", + "quoteMinSize", + "baseMaxSize", + "quoteMaxSize", + "baseIncrement", + "quoteIncrement", + "priceIncrement", + "priceLimitRate", + "minFunds", + "isMarginEnabled", + "enableTrading", + "feeCategory", + "makerFeeCoefficient", + "takerFeeCoefficient", + "st" + ] + } + }, + "required": [ + "code", + "data" + ] + } + } + } + } + }, + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470159", + "x-abandon": "normal", + "x-domain": "Spot", + "x-api-channel": "Public", + "x-api-permission": "NULL", + "x-api-rate-limit-pool": "Public", + "x-sdk-service": "Spot", + "x-sdk-sub-service": "Market", + "x-sdk-method-name": "getSymbol", + "x-sdk-method-description": "Request via this endpoint to get detail currency pairs for trading. If you want to get the market information of the trading symbol, please use Get All Tickers.", + "x-api-rate-limit": 4, + "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"symbol\\\":\\\"BTC-USDT\\\",\\\"name\\\":\\\"BTC-USDT\\\",\\\"baseCurrency\\\":\\\"BTC\\\",\\\"quoteCurrency\\\":\\\"USDT\\\",\\\"feeCurrency\\\":\\\"USDT\\\",\\\"market\\\":\\\"USDS\\\",\\\"baseMinSize\\\":\\\"0.00001\\\",\\\"quoteMinSize\\\":\\\"0.1\\\",\\\"baseMaxSize\\\":\\\"10000000000\\\",\\\"quoteMaxSize\\\":\\\"99999999\\\",\\\"baseIncrement\\\":\\\"0.00000001\\\",\\\"quoteIncrement\\\":\\\"0.000001\\\",\\\"priceIncrement\\\":\\\"0.1\\\",\\\"priceLimitRate\\\":\\\"0.1\\\",\\\"minFunds\\\":\\\"0.1\\\",\\\"isMarginEnabled\\\":true,\\\"enableTrading\\\":true,\\\"feeCategory\\\":1,\\\"makerFeeCoefficient\\\":\\\"1.00\\\",\\\"takerFeeCoefficient\\\":\\\"1.00\\\",\\\"st\\\":false}}", + "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\"}" + } + }, + "/api/v2/symbols": { + "get": { + "summary": "Get All Symbols", + "deprecated": false, + "description": "Request via this endpoint to get a list of available currency pairs for trading. If you want to get the market information of the trading symbol, please use Get All Tickers.", + "tags": [], + "parameters": [ + { + "name": "market", + "in": "query", + "description": "[The trading market](https://www.kucoin.com/docs-new/api-222921786)", + "required": false, + "schema": { + "type": "string", + "example": [ + "ALTS", + "USDS", + "ETF" + ] + } + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "array", + "items": { + "type": "object", + "properties": { + "symbol": { + "type": "string", + "description": "unique code of a symbol, it would not change after renaming", + "example": [ + "BTC-USDT", + "BCHSV-USDT" + ] + }, + "name": { + "type": "string", + "description": "Name of trading pairs, it would change after renaming", + "example": [ + "BTC-USDT", + "BSV-USDT" + ] + }, + "baseCurrency": { + "type": "string", + "description": "Base currency,e.g. BTC." + }, + "quoteCurrency": { + "type": "string", + "description": "Quote currency,e.g. USDT." + }, + "feeCurrency": { + "type": "string", + "description": "The currency of charged fees." + }, + "market": { + "type": "string", + "description": "The trading market.", + "example": [ + "USDS", + "BTC", + "ALTS" + ] + }, + "baseMinSize": { + "type": "string", + "description": "The minimum order quantity requried to place an order." + }, + "quoteMinSize": { + "type": "string", + "description": "The minimum order funds required to place a market order." + }, + "baseMaxSize": { + "type": "string", + "description": "The maximum order size required to place an order." + }, + "quoteMaxSize": { + "type": "string", + "description": "The maximum order funds required to place a market order." + }, + "baseIncrement": { + "type": "string", + "description": "Quantity increment: The quantity for an order must be a positive integer multiple of this increment. Here, the size refers to the quantity of the base currency for the order. For example, for the ETH-USDT trading pair, if the baseIncrement is 0.0000001, the order quantity can be 1.0000001 but not 1.00000001." + }, + "quoteIncrement": { + "type": "string", + "description": "Quote increment: The funds for a market order must be a positive integer multiple of this increment. The funds refer to the quote currency amount. For example, for the ETH-USDT trading pair, if the quoteIncrement is 0.000001, the amount of USDT for the order can be 3000.000001 but not 3000.0000001." + }, + "priceIncrement": { + "type": "string", + "description": "Price increment: The price of an order must be a positive integer multiple of this increment. For example, for the ETH-USDT trading pair, if the priceIncrement is 0.01, the order price can be 3000.01 but not 3000.001.\n\nspecifies the min order price as well as the price increment.This also applies to quote currency." + }, + "priceLimitRate": { + "type": "string", + "description": "Threshold for price portection" + }, + "minFunds": { + "type": "string", + "description": "the minimum trading amounts" + }, + "isMarginEnabled": { + "type": "boolean", + "description": "Available for margin or not." + }, + "enableTrading": { + "type": "boolean", + "description": "Available for transaction or not." + }, + "feeCategory": { + "type": "integer", + "description": "[Fee Type](https://www.kucoin.com/vip/privilege)", + "enum": [ + 1, + 2, + 3 + ], + "x-api-enum": [ + { + "value": 1, + "name": "classA", + "description": "classA" + }, + { + "value": 2, + "name": "classB", + "description": "classB" + }, + { + "value": 3, + "name": "classC", + "description": "classC" + } + ] + }, + "makerFeeCoefficient": { + "type": "string", + "description": "The maker fee coefficient. The actual fee needs to be multiplied by this coefficient to get the final fee. Most currencies have a coefficient of 1. If set to 0, it means no fee" + }, + "takerFeeCoefficient": { + "type": "string", + "description": "The taker fee coefficient. The actual fee needs to be multiplied by this coefficient to get the final fee. Most currencies have a coefficient of 1. If set to 0, it means no fee" + }, + "st": { + "type": "boolean", + "description": "Whether it is an [Special Treatment](https://www.kucoin.com/legal/special-treatment) symbol" + } + }, + "required": [ + "symbol", + "name", + "baseCurrency", + "quoteCurrency", + "feeCurrency", + "market", + "baseMinSize", + "quoteMinSize", + "baseMaxSize", + "quoteMaxSize", + "baseIncrement", + "quoteIncrement", + "priceIncrement", + "priceLimitRate", + "minFunds", + "isMarginEnabled", + "enableTrading", + "feeCategory", + "makerFeeCoefficient", + "takerFeeCoefficient", + "st" + ] + } + } + }, + "required": [ + "code", + "data" + ] + } + } + } + } + }, + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470154", + "x-abandon": "normal", + "x-domain": "Spot", + "x-api-channel": "Public", + "x-api-permission": "NULL", + "x-api-rate-limit-pool": "Public", + "x-sdk-service": "Spot", + "x-sdk-sub-service": "Market", + "x-sdk-method-name": "getAllSymbols", + "x-sdk-method-description": "Request via this endpoint to get a list of available currency pairs for trading. If you want to get the market information of the trading symbol, please use Get All Tickers.", + "x-api-rate-limit": 4, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": [\\n {\\n \\\"symbol\\\": \\\"BTC-USDT\\\",\\n \\\"name\\\": \\\"BTC-USDT\\\",\\n \\\"baseCurrency\\\": \\\"BTC\\\",\\n \\\"quoteCurrency\\\": \\\"USDT\\\",\\n \\\"feeCurrency\\\": \\\"USDT\\\",\\n \\\"market\\\": \\\"USDS\\\",\\n \\\"baseMinSize\\\": \\\"0.00001\\\",\\n \\\"quoteMinSize\\\": \\\"0.1\\\",\\n \\\"baseMaxSize\\\": \\\"10000000000\\\",\\n \\\"quoteMaxSize\\\": \\\"99999999\\\",\\n \\\"baseIncrement\\\": \\\"0.00000001\\\",\\n \\\"quoteIncrement\\\": \\\"0.000001\\\",\\n \\\"priceIncrement\\\": \\\"0.1\\\",\\n \\\"priceLimitRate\\\": \\\"0.1\\\",\\n \\\"minFunds\\\": \\\"0.1\\\",\\n \\\"isMarginEnabled\\\": true,\\n \\\"enableTrading\\\": true,\\n \\\"feeCategory\\\": 1,\\n \\\"makerFeeCoefficient\\\": \\\"1.00\\\",\\n \\\"takerFeeCoefficient\\\": \\\"1.00\\\",\\n \\\"st\\\": false\\n }\\n ]\\n}", + "x-request-example": "{\\\"market\\\": \\\"ALTS\\\"}" + } + }, + "/api/v1/market/orderbook/level1": { + "get": { + "summary": "Get Ticker", + "deprecated": false, + "description": "Request via this endpoint to get Level 1 Market Data. The returned value includes the best bid price and size, the best ask price and size as well as the last traded price and the last traded size.", + "tags": [], + "parameters": [ + { + "name": "symbol", + "in": "query", + "description": "symbol", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "object", + "properties": { + "time": { + "type": "integer", + "description": "timestamp", + "format": "int64" + }, + "sequence": { + "type": "string", + "description": "Sequence" + }, + "price": { + "type": "string", + "description": "Last traded price" + }, + "size": { + "type": "string", + "description": "Last traded size" + }, + "bestBid": { + "type": "string", + "description": "Best bid price" + }, + "bestBidSize": { + "type": "string", + "description": "Best bid size" + }, + "bestAsk": { + "type": "string", + "description": "Best ask price" + }, + "bestAskSize": { + "type": "string", + "description": "Best ask size" + } + }, + "required": [ + "sequence", + "price", + "size", + "bestBid", + "bestBidSize", + "bestAsk", + "bestAskSize", + "time" + ] + } + }, + "required": [ + "code", + "data" + ] + } + } + } + } + }, + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470160", + "x-abandon": "normal", + "x-domain": "Spot", + "x-api-channel": "Public", + "x-api-permission": "NULL", + "x-api-rate-limit-pool": "Public", + "x-sdk-service": "Spot", + "x-sdk-sub-service": "Market", + "x-sdk-method-name": "getTicker", + "x-sdk-method-description": "Request via this endpoint to get Level 1 Market Data. The returned value includes the best bid price and size, the best ask price and size as well as the last traded price and the last traded size.", + "x-api-rate-limit": 2, + "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"time\\\":1729172965609,\\\"sequence\\\":\\\"14609309753\\\",\\\"price\\\":\\\"67269\\\",\\\"size\\\":\\\"0.000025\\\",\\\"bestBid\\\":\\\"67267.5\\\",\\\"bestBidSize\\\":\\\"0.000025\\\",\\\"bestAsk\\\":\\\"67267.6\\\",\\\"bestAskSize\\\":\\\"1.24808993\\\"}}", + "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\"}" + } + }, + "/api/v1/market/allTickers": { + "get": { + "summary": "Get All Tickers", + "deprecated": false, + "description": "Request market tickers for all the trading pairs in the market (including 24h volume), takes a snapshot every 2 seconds. On the rare occasion that we will change the currency name, if you still want the changed symbol name, you can use the symbolName field instead of the symbol field via “Get all tickers” endpoint.", + "tags": [], + "parameters": [], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "object", + "properties": { + "time": { + "type": "integer", + "description": "timestamp", + "format": "int64" + }, + "ticker": { + "type": "array", + "items": { + "type": "object", + "properties": { + "symbol": { + "type": "string", + "description": "Symbol" + }, + "symbolName": { + "type": "string", + "description": "Name of trading pairs, it would change after renaming" + }, + "buy": { + "type": "string", + "description": "Best bid price" + }, + "bestBidSize": { + "type": "string", + "description": "Best bid size" + }, + "sell": { + "type": "string", + "description": "Best ask price" + }, + "bestAskSize": { + "type": "string", + "description": "Best ask size" + }, + "changeRate": { + "type": "string", + "description": "24h change rate" + }, + "changePrice": { + "type": "string", + "description": "24h change price" + }, + "high": { + "type": "string", + "description": "Highest price in 24h" + }, + "low": { + "type": "string", + "description": "Lowest price in 24h" + }, + "vol": { + "type": "string", + "description": "24h volume, executed based on base currency" + }, + "volValue": { + "type": "string", + "description": "24h traded amount" + }, + "last": { + "type": "string", + "description": "Last traded price" + }, + "averagePrice": { + "type": "string", + "description": "Average trading price in the last 24 hours" + }, + "takerFeeRate": { + "type": "string", + "description": "Basic Taker Fee" + }, + "makerFeeRate": { + "type": "string", + "description": "Basic Maker Fee" + }, + "takerCoefficient": { + "type": "string", + "description": "The taker fee coefficient. The actual fee needs to be multiplied by this coefficient to get the final fee. Most currencies have a coefficient of 1. If set to 0, it means no fee", + "enum": [ + "1", + "0" + ], + "x-api-enum": [ + { + "value": "1", + "name": "1", + "description": "the taker fee coefficient is 1" + }, + { + "value": "0", + "name": "0", + "description": "no fee" + } + ] + }, + "makerCoefficient": { + "type": "string", + "description": "The maker fee coefficient. The actual fee needs to be multiplied by this coefficient to get the final fee. Most currencies have a coefficient of 1. If set to 0, it means no fee", + "enum": [ + "1", + "0" + ], + "x-api-enum": [ + { + "value": "1", + "name": "1", + "description": "the maker fee coefficient is 1" + }, + { + "value": "0", + "name": "0", + "description": "no fee" + } + ] + } + }, + "required": [ + "symbol", + "symbolName", + "buy", + "bestBidSize", + "sell", + "bestAskSize", + "changeRate", + "changePrice", + "high", + "low", + "vol", + "volValue", + "last", + "averagePrice", + "takerFeeRate", + "makerFeeRate", + "takerCoefficient", + "makerCoefficient" + ] + } + } + }, + "required": [ + "time", + "ticker" ] } }, @@ -3836,44 +1457,262 @@ "data" ] } - } + } + } + } + }, + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470167", + "x-abandon": "normal", + "x-domain": "Spot", + "x-api-channel": "Public", + "x-api-permission": "NULL", + "x-api-rate-limit-pool": "Public", + "x-sdk-service": "Spot", + "x-sdk-sub-service": "Market", + "x-sdk-method-name": "getAllTickers", + "x-sdk-method-description": "Request market tickers for all the trading pairs in the market (including 24h volume), takes a snapshot every 2 seconds. On the rare occasion that we will change the currency name, if you still want the changed symbol name, you can use the symbolName field instead of the symbol field via “Get all tickers” endpoint.", + "x-api-rate-limit": 15, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"time\\\": 1729173207043,\\n \\\"ticker\\\": [\\n {\\n \\\"symbol\\\": \\\"BTC-USDT\\\",\\n \\\"symbolName\\\": \\\"BTC-USDT\\\",\\n \\\"buy\\\": \\\"67192.5\\\",\\n \\\"bestBidSize\\\": \\\"0.000025\\\",\\n \\\"sell\\\": \\\"67192.6\\\",\\n \\\"bestAskSize\\\": \\\"1.24949204\\\",\\n \\\"changeRate\\\": \\\"-0.0014\\\",\\n \\\"changePrice\\\": \\\"-98.5\\\",\\n \\\"high\\\": \\\"68321.4\\\",\\n \\\"low\\\": \\\"66683.3\\\",\\n \\\"vol\\\": \\\"1836.03034612\\\",\\n \\\"volValue\\\": \\\"124068431.06726933\\\",\\n \\\"last\\\": \\\"67193\\\",\\n \\\"averagePrice\\\": \\\"67281.21437289\\\",\\n \\\"takerFeeRate\\\": \\\"0.001\\\",\\n \\\"makerFeeRate\\\": \\\"0.001\\\",\\n \\\"takerCoefficient\\\": \\\"1\\\",\\n \\\"makerCoefficient\\\": \\\"1\\\"\\n }\\n ]\\n }\\n}" + } + }, + "/api/v1/market/histories": { + "get": { + "summary": "Get Trade History", + "deprecated": false, + "description": "Request via this endpoint to get the trade history of the specified symbol, the returned quantity is the last 100 transaction records.", + "tags": [], + "parameters": [ + { + "name": "symbol", + "in": "query", + "description": "symbol", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "array", + "items": { + "type": "object", + "properties": { + "sequence": { + "type": "string", + "description": "Sequence number" + }, + "price": { + "type": "string", + "description": "Filled price" + }, + "size": { + "type": "string", + "description": "Filled amount" + }, + "side": { + "type": "string", + "description": "Filled side, The trade side indicates the taker order side. A taker order is the order that was matched with orders opened on the order book.", + "enum": [ + "buy", + "sell" + ], + "x-api-enum": [ + { + "value": "buy", + "name": "buy", + "description": "buy" + }, + { + "value": "sell", + "name": "sell", + "description": "sell" + } + ] + }, + "time": { + "type": "integer", + "format": "int64", + "description": "Filled timestamp(nanosecond)" + } + }, + "required": [ + "sequence", + "price", + "size", + "side", + "time" + ] + } + } + }, + "required": [ + "code", + "data" + ] + } + } + } + } + }, + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470162", + "x-abandon": "normal", + "x-domain": "Spot", + "x-api-channel": "Public", + "x-api-permission": "NULL", + "x-api-rate-limit-pool": "Public", + "x-sdk-service": "Spot", + "x-sdk-sub-service": "Market", + "x-sdk-method-name": "getTradeHistory", + "x-sdk-method-description": "Request via this endpoint to get the trade history of the specified symbol, the returned quantity is the last 100 transaction records.", + "x-api-rate-limit": 3, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": [\\n {\\n \\\"sequence\\\": \\\"10976028003549185\\\",\\n \\\"price\\\": \\\"67122\\\",\\n \\\"size\\\": \\\"0.000025\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"time\\\": 1729177117877000000\\n },\\n {\\n \\\"sequence\\\": \\\"10976028003549188\\\",\\n \\\"price\\\": \\\"67122\\\",\\n \\\"size\\\": \\\"0.01792257\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"time\\\": 1729177117877000000\\n },\\n {\\n \\\"sequence\\\": \\\"10976028003549191\\\",\\n \\\"price\\\": \\\"67122.9\\\",\\n \\\"size\\\": \\\"0.05654289\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"time\\\": 1729177117877000000\\n }\\n ]\\n}", + "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\"}" + } + }, + "/api/v1/market/candles": { + "get": { + "summary": "Get Klines", + "deprecated": false, + "description": "Get the Kline of the symbol. Data are returned in grouped buckets based on requested type. For each query, the system would return at most 1500 pieces of data. To obtain more data, please page the data by time.", + "tags": [], + "parameters": [ + { + "name": "symbol", + "in": "query", + "description": " symbol", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "type", + "in": "query", + "description": "Type of candlestick patterns: 1min, 3min, 5min, 15min, 30min, 1hour, 2hour, 4hour, 6hour, 8hour, 12hour, 1day, 1week, 1month", + "required": true, + "schema": { + "type": "string", + "enum": [ + "1min", + "3min", + "5min", + "15min", + "30min", + "1hour", + "2hour", + "4hour", + "6hour", + "8hour", + "12hour", + "1day", + "1week", + "1month" + ], + "x-api-enum": [ + { + "value": "1min", + "name": "1min", + "description": "1min" + }, + { + "value": "3min", + "name": "3min", + "description": "3min" + }, + { + "value": "5min", + "name": "5min", + "description": "5min" + }, + { + "value": "15min", + "name": "15min", + "description": "15min" + }, + { + "value": "30min", + "name": "30min", + "description": "30min" + }, + { + "value": "1hour", + "name": "1hour", + "description": "1hour" + }, + { + "value": "2hour", + "name": "2hour", + "description": "2hour" + }, + { + "value": "4hour", + "name": "4hour", + "description": "4hour" + }, + { + "value": "6hour", + "name": "6hour", + "description": "6hour" + }, + { + "value": "8hour", + "name": "8hour", + "description": "8hour" + }, + { + "value": "12hour", + "name": "12hour", + "description": "12hour" + }, + { + "value": "1day", + "name": "1day", + "description": "1day" + }, + { + "value": "1week", + "name": "1week", + "description": "1week" + }, + { + "value": "1month", + "name": "1month", + "description": "1month" + } + ] } - } - }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470153", - "x-abandon": "normal", - "x-domain": "Spot", - "x-api-channel": "Public", - "x-api-permission": "NULL", - "x-api-rate-limit-pool": "Public", - "x-sdk-service": "Spot", - "x-sdk-sub-service": "Market", - "x-sdk-method-name": "getFiatPrice", - "x-sdk-method-description": "Request via this endpoint to get the fiat price of the currencies for the available trading pairs.", - "x-api-rate-limit": 3, - "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"AGLD\\\":\\\"1.1174410000000001\\\",\\\"DFI\\\":\\\"0.0168915500000000\\\",\\\"PYTHUP\\\":\\\"0.0397880960000000\\\",\\\"ISLM\\\":\\\"0.0606196750000000\\\",\\\"NEAR\\\":\\\"4.7185395500000000\\\",\\\"AIOZ\\\":\\\"0.4862867350000000\\\",\\\"AUDIO\\\":\\\"0.1219390000000000\\\",\\\"BBL\\\":\\\"0.0067766100000000\\\",\\\"WLD\\\":\\\"2.2893547500000000\\\",\\\"HNT\\\":\\\"5.8990489999999984\\\",\\\"ETHFI\\\":\\\"1.5892050000000000\\\",\\\"DMAIL\\\":\\\"0.2726636000000000\\\",\\\"OPUP\\\":\\\"0.0986506500000000\\\",\\\"VET3S\\\":\\\"0.0003700448850000\\\",\\\"MANA3S\\\":\\\"0.0006056970000000\\\",\\\"TIDAL\\\":\\\"0.0001154422500000\\\",\\\"HALO\\\":\\\"0.0058270850000000\\\",\\\"OPUL\\\":\\\"0.0839480050000000\\\",\\\"MANA3L\\\":\\\"0.0029569407900000\\\",\\\"DGB\\\":\\\"0.0066556705000000\\\",\\\"AA\\\":\\\"0.2406796000000000\\\",\\\"BCH\\\":\\\"366.2167999999996484\\\",\\\"GMEE\\\":\\\"0.0113333305000000\\\",\\\"JST\\\":\\\"0.0302348750000000\\\",\\\"PBUX\\\":\\\"0.0208795550000000\\\",\\\"AR\\\":\\\"18.5457224999999909\\\",\\\"SEI\\\":\\\"0.4332832500000000\\\",\\\"PSTAKE\\\":\\\"0.0493153300000000\\\",\\\"LMWR\\\":\\\"0.1618190500000000\\\",\\\"UNFIDOWN\\\":\\\"0.0062058955000000\\\",\\\"BB\\\":\\\"0.3245376500000000\\\",\\\"JTO\\\":\\\"2.1239375000000002\\\",\\\"WEMIX\\\":\\\"0.7916040000000000\\\",\\\"G\\\":\\\"0.0324037900000000\\\",\\\"MARSH\\\":\\\"0.0617591050000000\\\",\\\"BN\\\":\\\"0.0036961510000000\\\",\\\"FLIP\\\":\\\"1.0976509000000000\\\",\\\"FLR\\\":\\\"0.0144827550000000\\\",\\\"BIGTIME\\\":\\\"0.1238780300000000\\\",\\\"FLY\\\":\\\"0.0005157420000000\\\",\\\"T\\\":\\\"0.0233483200000000\\\",\\\"W\\\":\\\"0.2865566500000000\\\",\\\"BDX\\\":\\\"0.0774012800000000\\\",\\\"BABYDOGE\\\":\\\"0.0000000029375305\\\",\\\"SFP\\\":\\\"0.7256370000000000\\\",\\\"DIA\\\":\\\"0.9179408000000000\\\",\\\"ISME\\\":\\\"0.0022388800000000\\\",\\\"LYM\\\":\\\"0.0010155919500000\\\",\\\"VET3L\\\":\\\"0.0000289755050000\\\",\\\"JUP\\\":\\\"0.8230882500000000\\\",\\\"LYX\\\":\\\"1.4501745500000001\\\",\\\"AIEPK\\\":\\\"0.0050094940000000\\\",\\\"SILLY\\\":\\\"0.0159420250000000\\\",\\\"SCPT\\\":\\\"0.0122038950000000\\\",\\\"WOO\\\":\\\"0.1796601250000000\\\",\\\"BLUR\\\":\\\"0.2462768000000000\\\",\\\"STRK\\\":\\\"0.3963117450000000\\\",\\\"BFC\\\":\\\"0.0383608100000000\\\",\\\"DC\\\":\\\"0.0003097450500000\\\",\\\"KARATE\\\":\\\"0.0007296350000000\\\",\\\"SUSHI3L\\\":\\\"0.5115441000000000\\\",\\\"NETVR\\\":\\\"0.0976111700000000\\\",\\\"WAVES\\\":\\\"1.0806594000000000\\\",\\\"LITH\\\":\\\"0.0001520239500000\\\",\\\"HAPI\\\":\\\"8.6533711499999987\\\",\\\"SUSHI3S\\\":\\\"1.2752620500000000\\\",\\\"CEEK\\\":\\\"0.0294852500000000\\\",\\\"FLOKI\\\":\\\"0.0001414292500000\\\",\\\"SHR\\\":\\\"0.0012463765000000\\\",\\\"SAND\\\":\\\"0.2566616050000000\\\",\\\"TURT\\\":\\\"0.0020889550000000\\\",\\\"UMA\\\":\\\"2.5207390000000000\\\",\\\"BEPRO\\\":\\\"0.0003955021500000\\\",\\\"SCRT\\\":\\\"0.1995002000000000\\\",\\\"TUSD\\\":\\\"0.9945025000000000\\\",\\\"COOKIE\\\":\\\"0.0220089900000000\\\",\\\"LRDS\\\":\\\"0.6218889000000000\\\",\\\"SIN\\\":\\\"0.0033633175000000\\\",\\\"OAS\\\":\\\"0.0331933950000000\\\",\\\"ROOT\\\":\\\"0.0183108400000000\\\",\\\"ADA3L\\\":\\\"0.0046396790000000\\\",\\\"TIAUP\\\":\\\"0.1228385500000000\\\",\\\"HTR\\\":\\\"0.0353023400000000\\\",\\\"UNB\\\":\\\"0.0003837080500000\\\",\\\"UNA\\\":\\\"0.0164917500000000\\\",\\\"HARD\\\":\\\"0.1087056200000000\\\",\\\"G3\\\":\\\"0.0502648550000000\\\",\\\"ADA3S\\\":\\\"0.0006191202850000\\\",\\\"MYRO\\\":\\\"0.1071863800000000\\\",\\\"HTX\\\":\\\"0.0000013693150000\\\",\\\"FT\\\":\\\"0.3585206500000000\\\",\\\"BTCDOWN\\\":\\\"0.1065467000000000\\\",\\\"UNI\\\":\\\"7.3571195999999993\\\",\\\"FX\\\":\\\"0.1379310000000000\\\",\\\"OBI\\\":\\\"0.0079030465000000\\\",\\\"UNO\\\":\\\"0.0137131400000000\\\",\\\"WRX\\\":\\\"0.1221389000000000\\\",\\\"TIADOWN\\\":\\\"0.0000914642450000\\\",\\\"ETHDOWN\\\":\\\"0.1306346500000000\\\",\\\"WELL\\\":\\\"0.0471244260000000\\\",\\\"SWFTC\\\":\\\"0.0028966509500000\\\",\\\"SKL\\\":\\\"0.0362418700000000\\\",\\\"UOS\\\":\\\"0.0867765900000000\\\",\\\"AIPAD\\\":\\\"0.0478660550000000\\\",\\\"BRETT\\\":\\\"0.1037481000000000\\\",\\\"SKY\\\":\\\"0.0520139800000000\\\",\\\"FRM\\\":\\\"0.0153123400000000\\\",\\\"VISION\\\":\\\"0.0014451770500000\\\",\\\"LENDS\\\":\\\"0.0047276350000000\\\",\\\"SLF\\\":\\\"0.3318340000000000\\\",\\\"BULL\\\":\\\"0.0023988000000000\\\",\\\"FLOW\\\":\\\"0.5372312500000000\\\",\\\"ODDZ\\\":\\\"0.0063368300000000\\\",\\\"SLN\\\":\\\"0.2804597000000000\\\",\\\"UPO\\\":\\\"0.0440779500000000\\\",\\\"SLP\\\":\\\"0.0023997995000000\\\",\\\"ID\\\":\\\"0.3718140000000000\\\",\\\"SLIM\\\":\\\"0.0906446550000000\\\",\\\"SPOT\\\":\\\"0.0021289350000000\\\",\\\"DOP\\\":\\\"0.0023028480000000\\\",\\\"ISSP\\\":\\\"0.0000874562500000\\\",\\\"UQC\\\":\\\"3.2339822000000003\\\",\\\"IO\\\":\\\"1.8185902499999999\\\",\\\"DOT\\\":\\\"4.2022978000000005\\\",\\\"1INCH\\\":\\\"0.2645676500000000\\\",\\\"SMH\\\":\\\"0.3448275000000000\\\",\\\"MAK\\\":\\\"0.0396701550000000\\\",\\\"TOKO\\\":\\\"0.0005923037000000\\\",\\\"TURBO\\\":\\\"0.0108085930000000\\\",\\\"UNFI\\\":\\\"2.8555714999999996\\\",\\\"MAN\\\":\\\"0.0210764565000000\\\",\\\"EVER\\\":\\\"0.0332733550000000\\\",\\\"FTM\\\":\\\"0.7259068650000000\\\",\\\"SHRAP\\\":\\\"0.0476361700000000\\\",\\\"MAV\\\":\\\"0.1738130500000000\\\",\\\"MAX\\\":\\\"0.2864966800000000\\\",\\\"DPR\\\":\\\"0.0018240875000000\\\",\\\"FTT\\\":\\\"2.0559715000000002\\\",\\\"ARKM\\\":\\\"1.7444273499999999\\\",\\\"ATOM\\\":\\\"4.2954512000000002\\\",\\\"PENDLE\\\":\\\"4.1554212500000007\\\",\\\"QUICK\\\":\\\"0.0365317250000000\\\",\\\"BLZ\\\":\\\"0.1217191100000000\\\",\\\"BOBA\\\":\\\"0.2014092450000000\\\",\\\"MBL\\\":\\\"0.0027856065000000\\\",\\\"OFN\\\":\\\"0.1252373500000000\\\",\\\"UNIO\\\":\\\"0.0025487250000000\\\",\\\"SNS\\\":\\\"0.0200899500000000\\\",\\\"SNX\\\":\\\"1.4282854999999999\\\",\\\"NXRA\\\":\\\"0.0272763550000000\\\",\\\"TAIKO\\\":\\\"1.4392800000000001\\\",\\\"AVAX3L\\\":\\\"0.1410875109550000\\\",\\\"L3\\\":\\\"0.0608395650000000\\\",\\\"API3\\\":\\\"1.3728132500000001\\\",\\\"XRP3S\\\":\\\"0.0028095945000000\\\",\\\"QKC\\\":\\\"0.0085157400000000\\\",\\\"AVAX3S\\\":\\\"0.5148424500000000\\\",\\\"ROSE\\\":\\\"0.0693453100000000\\\",\\\"SATS\\\":\\\"0.0000002701648500\\\",\\\"BMX\\\":\\\"0.3100449000000000\\\",\\\"PORTAL\\\":\\\"0.2811593500000000\\\",\\\"TOMI\\\":\\\"0.0309045400000000\\\",\\\"XRP3L\\\":\\\"2.1586201500000002\\\",\\\"SOL\\\":\\\"151.7250995000003583\\\",\\\"SON\\\":\\\"0.0002421788500000\\\",\\\"BNC\\\":\\\"0.1882058500000000\\\",\\\"SOCIAL\\\":\\\"0.0026486750000000\\\",\\\"CGPT\\\":\\\"0.1305147100000000\\\",\\\"CELR\\\":\\\"0.0127736100000000\\\",\\\"BNB\\\":\\\"591.0973035000118935\\\",\\\"OGN\\\":\\\"0.0852573500000000\\\",\\\"CELO\\\":\\\"0.7711142500000000\\\",\\\"AUCTION\\\":\\\"13.1634150000000014\\\",\\\"MANTA\\\":\\\"0.7564216000000000\\\",\\\"LAYER\\\":\\\"0.0372713550000000\\\",\\\"AERO\\\":\\\"1.3783104999999999\\\",\\\"CETUS\\\":\\\"0.1808295400000000\\\",\\\"LL\\\":\\\"0.0201199350000000\\\",\\\"SPA\\\":\\\"0.0067426270000000\\\",\\\"PYTHDOWN\\\":\\\"0.0011834080000000\\\",\\\"NEIROCTO\\\":\\\"0.0019964013000000\\\",\\\"UTK\\\":\\\"0.0365217300000000\\\",\\\"GMRX\\\":\\\"0.0007386305000000\\\",\\\"BOB\\\":\\\"0.0000380619595000\\\",\\\"HOTCROSS\\\":\\\"0.0056491740000000\\\",\\\"AERGO\\\":\\\"0.1007595950000000\\\",\\\"MOCA\\\":\\\"0.0783608000000000\\\",\\\"SQD\\\":\\\"0.0380809500000000\\\",\\\"MV\\\":\\\"0.0081359300000000\\\",\\\"BNB3L\\\":\\\"0.2761618500000000\\\",\\\"BNB3S\\\":\\\"0.0008545725000000\\\",\\\"GALAX3L\\\":\\\"0.0057571999600000\\\",\\\"KAI\\\":\\\"0.0020080954500000\\\",\\\"SQR\\\":\\\"0.0470764500000000\\\",\\\"GALAX3S\\\":\\\"0.1933033000000000\\\",\\\"EGLD\\\":\\\"25.5272299999999713\\\",\\\"ZBCN\\\":\\\"0.0010404795000000\\\",\\\"KAS\\\":\\\"0.1216691350000000\\\",\\\"MEW\\\":\\\"0.0086176890000000\\\",\\\"PUNDIX\\\":\\\"0.4130933500000000\\\",\\\"LOOKS\\\":\\\"0.0392803500000000\\\",\\\"FXS\\\":\\\"1.9060465000000000\\\",\\\"BOSON\\\":\\\"0.2732633000000000\\\",\\\"BRISE\\\":\\\"0.0000000860569500\\\",\\\"AEVO\\\":\\\"0.3388305000000000\\\",\\\"FLUX\\\":\\\"0.5276360500000000\\\",\\\"PRCL\\\":\\\"0.1969015000000000\\\",\\\"UNFIUP\\\":\\\"0.0011654170000000\\\",\\\"SEIDOWN\\\":\\\"0.0442778500000000\\\",\\\"DOAI\\\":\\\"0.0052363805000000\\\",\\\"QNT\\\":\\\"65.4312679999998206\\\",\\\"REDO\\\":\\\"0.2837580500000000\\\",\\\"STRIKE\\\":\\\"6.8225869999999997\\\",\\\"ETHW\\\":\\\"3.2418782499999998\\\",\\\"OM\\\":\\\"1.5396797750000000\\\",\\\"OP\\\":\\\"1.6911539999999999\\\",\\\"WHALE\\\":\\\"0.8134930500000000\\\",\\\"1CAT\\\":\\\"0.0018460765000000\\\",\\\"NEON\\\":\\\"0.4446775500000000\\\",\\\"GTAI\\\":\\\"0.7786105000000000\\\",\\\"SSV\\\":\\\"21.2393749999999841\\\",\\\"ETH2\\\":\\\"2601.6678843156403923\\\",\\\"KCS\\\":\\\"8.7646155000000020\\\",\\\"ARPA\\\":\\\"0.0393882960000000\\\",\\\"ARTFI\\\":\\\"0.0141029450000000\\\",\\\"BRL\\\":\\\"0.1742807323452485\\\",\\\"ALEX\\\":\\\"0.0924537500000000\\\",\\\"STG\\\":\\\"0.2943527500000000\\\",\\\"SHIB\\\":\\\"0.0000178060925000\\\",\\\"IOTX\\\":\\\"0.0394202800000000\\\",\\\"OLE\\\":\\\"0.0171414250000000\\\",\\\"KDA\\\":\\\"0.5653172000000000\\\",\\\"CERE\\\":\\\"0.0022548720000000\\\",\\\"DOCK\\\":\\\"0.0018990500000000\\\",\\\"STX\\\":\\\"1.8157916500000000\\\",\\\"OLT\\\":\\\"0.0007596200000000\\\",\\\"QI\\\":\\\"0.0131754090000000\\\",\\\"SDAO\\\":\\\"0.2748625000000000\\\",\\\"BLAST\\\":\\\"0.0087636160000000\\\",\\\"LINK3S\\\":\\\"0.0000702948350000\\\",\\\"IOST\\\":\\\"0.0049745115000000\\\",\\\"SUI\\\":\\\"2.0589700000000000\\\",\\\"CAKE\\\":\\\"1.7941024999999999\\\",\\\"BSW\\\":\\\"0.0586706500000000\\\",\\\"OMG\\\":\\\"0.2597700500000000\\\",\\\"VOLT\\\":\\\"0.0000002716641000\\\",\\\"LINK3L\\\":\\\"1.3408292499999999\\\",\\\"GEEQ\\\":\\\"0.0385607100000000\\\",\\\"PYUSD\\\":\\\"0.9988003500000000\\\",\\\"SUN\\\":\\\"0.0186106900000000\\\",\\\"TOWER\\\":\\\"0.0014812590000000\\\",\\\"BTC\\\":\\\"67133.4165000832051564\\\",\\\"IOTA\\\":\\\"0.1189405000000000\\\",\\\"REEF\\\":\\\"0.0019960015000000\\\",\\\"TRIAS\\\":\\\"3.3683149999999998\\\",\\\"KEY\\\":\\\"0.0037594713240047\\\",\\\"ETH3L\\\":\\\"0.0003305946200000\\\",\\\"BTT\\\":\\\"0.0000009117439000\\\",\\\"ONE\\\":\\\"0.0132003965000000\\\",\\\"RENDER\\\":\\\"5.2263854999999995\\\",\\\"ETH3S\\\":\\\"0.5517240000000000\\\",\\\"ANKR\\\":\\\"0.0264867500000000\\\",\\\"ALGO\\\":\\\"0.1188405500000000\\\",\\\"SYLO\\\":\\\"0.0007600198000000\\\",\\\"ZCX\\\":\\\"0.0784707450000000\\\",\\\"SD\\\":\\\"0.3851073500000000\\\",\\\"ONT\\\":\\\"0.1877960550000000\\\",\\\"MJT\\\":\\\"0.0132433750000000\\\",\\\"DYM\\\":\\\"1.6659666000000001\\\",\\\"DYP\\\":\\\"0.0205397250000000\\\",\\\"BAKEUP\\\":\\\"0.0389894955000000\\\",\\\"OOE\\\":\\\"0.0079360300000000\\\",\\\"ZELIX\\\":\\\"0.0000649675000000\\\",\\\"DOGE3L\\\":\\\"0.3837080500000000\\\",\\\"ARTY\\\":\\\"0.3980009000000000\\\",\\\"QORPO\\\":\\\"0.1204297550000000\\\",\\\"ICE\\\":\\\"0.0051504235000000\\\",\\\"NOTAI\\\":\\\"0.0000892753400000\\\",\\\"DOGE3S\\\":\\\"0.2291853500000000\\\",\\\"NAKA\\\":\\\"1.0695649500000000\\\",\\\"GALAX\\\":\\\"0.0212893500000000\\\",\\\"MKR\\\":\\\"1245.8767500000163833\\\",\\\"DODO\\\":\\\"0.1152423500000000\\\",\\\"ICP\\\":\\\"7.6731615000000027\\\",\\\"ZEC\\\":\\\"35.9400209999999543\\\",\\\"ZEE\\\":\\\"0.0065767100000000\\\",\\\"ICX\\\":\\\"0.1383308000000000\\\",\\\"KMNO\\\":\\\"0.0921499020000000\\\",\\\"TT\\\":\\\"0.0033883050000000\\\",\\\"DOT3L\\\":\\\"0.1454272500000000\\\",\\\"XAI\\\":\\\"0.2038980000000000\\\",\\\"ZEN\\\":\\\"8.0149905000000007\\\",\\\"DOGE\\\":\\\"0.1213093150000000\\\",\\\"ALPHA\\\":\\\"0.0567416150000000\\\",\\\"DUSK\\\":\\\"0.1964517250000000\\\",\\\"DOT3S\\\":\\\"0.0053613180000000\\\",\\\"SXP\\\":\\\"0.2538730000000000\\\",\\\"HBAR\\\":\\\"0.0510044850000000\\\",\\\"SYNT\\\":\\\"0.0467166300000000\\\",\\\"ZEX\\\":\\\"0.0571714000000000\\\",\\\"BONDLY\\\":\\\"0.0022208890000000\\\",\\\"MLK\\\":\\\"0.2080859050000000\\\",\\\"KICKS\\\":\\\"0.0001301249050000\\\",\\\"PEPE\\\":\\\"0.0000100249850000\\\",\\\"OUSD\\\":\\\"0.9982006500000000\\\",\\\"LUNCDOWN\\\":\\\"0.0000733333150000\\\",\\\"DOGS\\\":\\\"0.0007086455000000\\\",\\\"REV3L\\\":\\\"0.0094672640000000\\\",\\\"CTSI\\\":\\\"0.1257371000000000\\\",\\\"C98\\\":\\\"0.1219390000000000\\\",\\\"OSMO\\\":\\\"0.5370313500000000\\\",\\\"NTRN\\\":\\\"0.3869064500000000\\\",\\\"CFX2S\\\":\\\"0.0084757600000000\\\",\\\"SYN\\\":\\\"0.5636180500000000\\\",\\\"VIDT\\\":\\\"0.0308745550000000\\\",\\\"SYS\\\":\\\"0.0997501000000000\\\",\\\"GAS\\\":\\\"4.3029474500000008\\\",\\\"BOME\\\":\\\"0.0087336310000000\\\",\\\"COMBO\\\":\\\"0.4068964500000000\\\",\\\"XCH\\\":\\\"14.9825050000000010\\\",\\\"VR\\\":\\\"0.0063538215000000\\\",\\\"CFX2L\\\":\\\"0.0499660045000000\\\",\\\"VSYS\\\":\\\"0.0005201398000000\\\",\\\"PANDORA\\\":\\\"1629.2949450001102772\\\",\\\"THETA\\\":\\\"1.2461766000000000\\\",\\\"XCN\\\":\\\"0.0012699647000000\\\",\\\"NEXG\\\":\\\"0.0039180400000000\\\",\\\"MELOS\\\":\\\"0.0021244372500000\\\",\\\"XCV\\\":\\\"0.0013253370000000\\\",\\\"ORN\\\":\\\"0.8797599000000000\\\",\\\"WLKN\\\":\\\"0.0010624685000000\\\",\\\"AAVE\\\":\\\"154.2708259999996162\\\",\\\"MNT\\\":\\\"0.6168914000000000\\\",\\\"BONK\\\":\\\"0.0000227296295000\\\",\\\"PERP\\\":\\\"0.6037979500000000\\\",\\\"XDC\\\":\\\"0.0276361750000000\\\",\\\"MNW\\\":\\\"0.3681158500000000\\\",\\\"XDB\\\":\\\"0.0002578710000000\\\",\\\"BOND\\\":\\\"1.5662165000000000\\\",\\\"SUIA\\\":\\\"0.0809595000000000\\\",\\\"MOG\\\":\\\"0.0000019330330000\\\",\\\"SUTER\\\":\\\"0.0001840079500000\\\",\\\"TIME\\\":\\\"16.2648634999999969\\\",\\\"RACA\\\":\\\"0.0001949025000000\\\",\\\"BICO\\\":\\\"0.2021988500000000\\\",\\\"MON\\\":\\\"0.1066466500000000\\\",\\\"SWEAT\\\":\\\"0.0063718125000000\\\",\\\"MOXIE\\\":\\\"0.0022088950000000\\\",\\\"BABYBNB\\\":\\\"0.0289755050000000\\\",\\\"IGU\\\":\\\"0.0050674650000000\\\",\\\"HMSTR\\\":\\\"0.0037990995000000\\\",\\\"XEC\\\":\\\"0.0000354722550000\\\",\\\"MONI\\\":\\\"0.0058470750000000\\\",\\\"XR\\\":\\\"0.2374812000000000\\\",\\\"PEOPLE\\\":\\\"0.0796601500000000\\\",\\\"PUMLX\\\":\\\"0.0054572700000000\\\",\\\"ZIL\\\":\\\"0.0145927000000000\\\",\\\"WLDDOWN\\\":\\\"0.2089954500000000\\\",\\\"VAI\\\":\\\"0.0799999800000000\\\",\\\"XEN\\\":\\\"0.0000000839580000\\\",\\\"MPC\\\":\\\"0.1001499000000000\\\",\\\"XEM\\\":\\\"0.0176951480000000\\\",\\\"JASMY3S\\\":\\\"0.0019670160000000\\\",\\\"OTK\\\":\\\"0.0290464695000000\\\",\\\"TRAC\\\":\\\"0.4521738000000000\\\",\\\"DFYN\\\":\\\"0.0070664650000000\\\",\\\"BIDP\\\":\\\"0.0001939030000000\\\",\\\"JASMY3L\\\":\\\"0.0001653772700000\\\",\\\"INJDOWN\\\":\\\"0.0000194902500000\\\",\\\"KLV\\\":\\\"0.0019310340000000\\\",\\\"WAXL\\\":\\\"0.7858069000000000\\\",\\\"TRBDOWN\\\":\\\"0.0023138425000000\\\",\\\"BCH3L\\\":\\\"4.6390663064999996\\\",\\\"GMT3S\\\":\\\"0.0000457771000000\\\",\\\"KMD\\\":\\\"0.2493752500000000\\\",\\\"BCH3S\\\":\\\"0.9634180500000000\\\",\\\"ECOX\\\":\\\"0.0987506000000000\\\",\\\"AAVE3S\\\":\\\"0.0560719500000000\\\",\\\"GMT3L\\\":\\\"0.0053983694650000\\\",\\\"EPIK\\\":\\\"0.0045857060000000\\\",\\\"SUIP\\\":\\\"0.1067565950000000\\\",\\\"AAVE3L\\\":\\\"0.3638687346200000\\\",\\\"ZK\\\":\\\"0.1262368500000000\\\",\\\"ZKF\\\":\\\"0.0008595700000000\\\",\\\"OMNIA\\\":\\\"0.7624186000000000\\\",\\\"ZKJ\\\":\\\"1.1124435000000000\\\",\\\"ZKL\\\":\\\"0.1255372000000000\\\",\\\"GAFI\\\":\\\"3.0634675000000001\\\",\\\"CARV\\\":\\\"0.8703646000000000\\\",\\\"KNC\\\":\\\"0.4433782000000000\\\",\\\"CATS\\\":\\\"0.0000599700000000\\\",\\\"PROM\\\":\\\"5.2833570000000006\\\",\\\"ALEPH\\\":\\\"0.1756121500000000\\\",\\\"PONKE\\\":\\\"0.3958020000000000\\\",\\\"OVR\\\":\\\"0.1553223000000000\\\",\\\"CATI\\\":\\\"0.4105146400000000\\\",\\\"ORDER\\\":\\\"0.1183008200000000\\\",\\\"GFT\\\":\\\"0.0166616650000000\\\",\\\"BIFI\\\":\\\"0.0020489750000000\\\",\\\"GGC\\\":\\\"6.9965029985000000\\\",\\\"GGG\\\":\\\"0.0403798000000000\\\",\\\"DAPPX\\\":\\\"0.0043788095000000\\\",\\\"SUKU\\\":\\\"0.0618790450000000\\\",\\\"ULTI\\\":\\\"0.0168015950000000\\\",\\\"CREDI\\\":\\\"0.0192903500000000\\\",\\\"ERTHA\\\":\\\"0.0010014990000000\\\",\\\"FURY\\\":\\\"0.1405297000000000\\\",\\\"KARRAT\\\":\\\"0.5577210000000000\\\",\\\"MOBILE\\\":\\\"0.0009005495000000\\\",\\\"SIDUS\\\":\\\"0.0037671155000000\\\",\\\"NAVI\\\":\\\"0.1254672350000000\\\",\\\"TAO\\\":\\\"583.4081500000051807\\\",\\\"USDJ\\\":\\\"1.1386304000000001\\\",\\\"MTL\\\":\\\"0.9563216000000000\\\",\\\"VET\\\":\\\"0.0225387250000000\\\",\\\"FITFI\\\":\\\"0.0036421780000000\\\",\\\"USDT\\\":\\\"0.9995000000000000\\\",\\\"OXT\\\":\\\"0.0695652000000000\\\",\\\"CANDY\\\":\\\"0.0005597200000000\\\",\\\"USDP\\\":\\\"0.9932031500000000\\\",\\\"MTS\\\":\\\"0.0027516235000000\\\",\\\"TADA\\\":\\\"0.0283858000000000\\\",\\\"MTV\\\":\\\"0.0006559718500000\\\",\\\"NAVX\\\":\\\"0.1342228550000000\\\",\\\"ILV\\\":\\\"35.6771524999999671\\\",\\\"VINU\\\":\\\"0.0000000109045450\\\",\\\"GHX\\\":\\\"0.0903548000000000\\\",\\\"EDU\\\":\\\"0.5167415000000000\\\",\\\"HYVE\\\":\\\"0.0137331300000000\\\",\\\"BTC3L\\\":\\\"0.0058620675000000\\\",\\\"ANYONE\\\":\\\"0.9015490000000000\\\",\\\"BEAT\\\":\\\"0.0012593700000000\\\",\\\"KING\\\":\\\"0.0004821588000000\\\",\\\"CREAM\\\":\\\"15.6541689999999973\\\",\\\"CAS\\\":\\\"0.0038590695000000\\\",\\\"IMX\\\":\\\"1.4944524000000000\\\",\\\"CAT\\\":\\\"0.0000256981445000\\\",\\\"BTC3S\\\":\\\"0.0014142925000000\\\",\\\"USDE\\\":\\\"0.9985005000000000\\\",\\\"USDD\\\":\\\"1.0000997000000000\\\",\\\"CWAR\\\":\\\"0.0037981000000000\\\",\\\"USDC\\\":\\\"0.9997998500000000\\\",\\\"KRL\\\":\\\"0.3543127550000000\\\",\\\"INJ\\\":\\\"21.7691100000000194\\\",\\\"GAME\\\":\\\"0.0139630150000000\\\",\\\"TRIBL\\\":\\\"1.0994500000000000\\\",\\\"XLM\\\":\\\"0.0948525500000000\\\",\\\"TRBUP\\\":\\\"0.0012293850000000\\\",\\\"VRADOWN\\\":\\\"0.0013433280000000\\\",\\\"SUPER\\\":\\\"1.2853570000000000\\\",\\\"EIGEN\\\":\\\"3.1536223999999999\\\",\\\"IOI\\\":\\\"0.0146926500000000\\\",\\\"KSM\\\":\\\"17.5212350000000129\\\",\\\"CCD\\\":\\\"0.0034832575000000\\\",\\\"EGO\\\":\\\"0.0093553200000000\\\",\\\"EGP\\\":\\\"2.7946019999999998\\\",\\\"MXC\\\":\\\"0.0066866550000000\\\",\\\"TEL\\\":\\\"0.0014432780000000\\\",\\\"MOVR\\\":\\\"9.1340307000000027\\\",\\\"XMR\\\":\\\"155.5421899999990755\\\",\\\"MXM\\\":\\\"0.0092853550000000\\\",\\\"OORT\\\":\\\"0.1099949750000000\\\",\\\"GLM\\\":\\\"0.3231383500000000\\\",\\\"RAY\\\":\\\"2.0228880499999998\\\",\\\"XTAG\\\":\\\"0.0218190850000000\\\",\\\"GLQ\\\":\\\"0.0854572500000000\\\",\\\"CWEB\\\":\\\"0.0038480750000000\\\",\\\"REVU\\\":\\\"0.0105047450000000\\\",\\\"REVV\\\":\\\"0.0039760110000000\\\",\\\"ZRO\\\":\\\"3.7952014499999994\\\",\\\"XNL\\\":\\\"0.0093853050000000\\\",\\\"XNO\\\":\\\"0.8496749500000000\\\",\\\"SAROS\\\":\\\"0.0019290350000000\\\",\\\"KACE\\\":\\\"2.1165411999999998\\\",\\\"ZRX\\\":\\\"0.3186406000000000\\\",\\\"WLTH\\\":\\\"0.0374312750000000\\\",\\\"ATOM3L\\\":\\\"0.0321719060000000\\\",\\\"GMM\\\":\\\"0.0001497251000000\\\",\\\"BEER\\\":\\\"0.0000138670630000\\\",\\\"GMT\\\":\\\"0.1275362000000000\\\",\\\"HEART\\\":\\\"0.0159920000000000\\\",\\\"GMX\\\":\\\"22.7186349999999882\\\",\\\"ABBC\\\":\\\"0.0061769100000000\\\",\\\"OMNI\\\":\\\"8.9235359999999970\\\",\\\"ATOM3S\\\":\\\"0.0007945225400000\\\",\\\"IRL\\\":\\\"0.0099650150000000\\\",\\\"CFG\\\":\\\"0.3248375000000000\\\",\\\"WSDM\\\":\\\"0.0139830050000000\\\",\\\"GNS\\\":\\\"1.8390800000000001\\\",\\\"VANRY\\\":\\\"0.0809295150000000\\\",\\\"CFX\\\":\\\"0.1595202000000000\\\",\\\"GRAIL\\\":\\\"817.1212349999937891\\\",\\\"BEFI\\\":\\\"0.0175712100000000\\\",\\\"VELO\\\":\\\"0.0132043945000000\\\",\\\"XPR\\\":\\\"0.0008077959000000\\\",\\\"DOVI\\\":\\\"0.0584707500000000\\\",\\\"ACE\\\":\\\"0.0021349320000000\\\",\\\"ACH\\\":\\\"0.0190534685000000\\\",\\\"ISP\\\":\\\"0.0012161916000000\\\",\\\"XCAD\\\":\\\"0.2834582000000000\\\",\\\"MINA\\\":\\\"0.5630183500000000\\\",\\\"TIA\\\":\\\"5.9318325999999999\\\",\\\"DRIFT\\\":\\\"0.4350823500000000\\\",\\\"ACQ\\\":\\\"0.0056981495000000\\\",\\\"ACS\\\":\\\"0.0014917537500000\\\",\\\"MIND\\\":\\\"0.0018920535000000\\\",\\\"STORE\\\":\\\"0.0062358805000000\\\",\\\"REN\\\":\\\"0.0351224300000000\\\",\\\"ELA\\\":\\\"1.7282354500000000\\\",\\\"DREAMS\\\":\\\"0.0002498750000000\\\",\\\"ADA\\\":\\\"0.3463267500000000\\\",\\\"ELF\\\":\\\"0.3777110500000000\\\",\\\"REQ\\\":\\\"0.0959919800000000\\\",\\\"STORJ\\\":\\\"0.5662167500000000\\\",\\\"LADYS\\\":\\\"0.0000000837581000\\\",\\\"PAXG\\\":\\\"2697.9303600003123340\\\",\\\"REZ\\\":\\\"0.0409795000000000\\\",\\\"XRD\\\":\\\"0.0157821050000000\\\",\\\"CHO\\\":\\\"0.0205097400000000\\\",\\\"CHR\\\":\\\"0.1769115000000000\\\",\\\"ADS\\\":\\\"0.1889055000000000\\\",\\\"CHZ\\\":\\\"0.0738030800000000\\\",\\\"ADX\\\":\\\"0.1575212000000000\\\",\\\"XRP\\\":\\\"0.5525036100000000\\\",\\\"JASMY\\\":\\\"0.0188615645000000\\\",\\\"KAGI\\\":\\\"0.1834582250000000\\\",\\\"FIDA\\\":\\\"0.2282858000000000\\\",\\\"PBR\\\":\\\"0.0291953950000000\\\",\\\"AEG\\\":\\\"0.0093453250000000\\\",\\\"H2O\\\":\\\"0.1610194500000000\\\",\\\"CHMB\\\":\\\"0.0001715641750000\\\",\\\"SAND3L\\\":\\\"0.0015447972150000\\\",\\\"PBX\\\":\\\"0.0006879558500000\\\",\\\"SOLVE\\\":\\\"0.0084557700000000\\\",\\\"DECHAT\\\":\\\"0.1512243500000000\\\",\\\"GARI\\\":\\\"0.0076861550000000\\\",\\\"SHIB2L\\\":\\\"1.1996998499999999\\\",\\\"SHIB2S\\\":\\\"0.0240879500000000\\\",\\\"ENA\\\":\\\"0.3942028000000000\\\",\\\"VEMP\\\":\\\"0.0029335325000000\\\",\\\"ENJ\\\":\\\"0.1467266000000000\\\",\\\"AFG\\\":\\\"0.0072163900000000\\\",\\\"RATS\\\":\\\"0.0001211593900000\\\",\\\"GRT\\\":\\\"0.1646076550000000\\\",\\\"FORWARD\\\":\\\"0.0012873560000000\\\",\\\"TFUEL\\\":\\\"0.0598800450000000\\\",\\\"ENS\\\":\\\"17.0634640000000052\\\",\\\"KASDOWN\\\":\\\"0.0258770550000000\\\",\\\"XTM\\\":\\\"0.0251074400000000\\\",\\\"DEGEN\\\":\\\"0.0084857550000000\\\",\\\"TLM\\\":\\\"0.0100449750000000\\\",\\\"DYDXDOWN\\\":\\\"0.1042598440000000\\\",\\\"CKB\\\":\\\"0.0146026950000000\\\",\\\"LUNC\\\":\\\"0.0000889255150000\\\",\\\"AURORA\\\":\\\"0.1204397500000000\\\",\\\"LUNA\\\":\\\"0.3624187000000000\\\",\\\"XTZ\\\":\\\"0.6776610000000000\\\",\\\"ELON\\\":\\\"0.0000001410294500\\\",\\\"DMTR\\\":\\\"0.0891554000000000\\\",\\\"EOS\\\":\\\"0.4759619000000000\\\",\\\"GST\\\":\\\"0.0118940500000000\\\",\\\"FORT\\\":\\\"0.1155422000000000\\\",\\\"FLAME\\\":\\\"0.0247076400000000\\\",\\\"PATEX\\\":\\\"0.9605195000000000\\\",\\\"DEEP\\\":\\\"0.0328885475000000\\\",\\\"ID3L\\\":\\\"0.0016201895000000\\\",\\\"GTC\\\":\\\"0.6625685500000000\\\",\\\"ID3S\\\":\\\"0.0071674145000000\\\",\\\"RIO\\\":\\\"0.7616190000000000\\\",\\\"CLH\\\":\\\"0.0008555720000000\\\",\\\"BURGER\\\":\\\"0.4016990500000000\\\",\\\"VRA\\\":\\\"0.0029765110000000\\\",\\\"SUNDOG\\\":\\\"0.2173912500000000\\\",\\\"GTT\\\":\\\"0.0002038980000000\\\",\\\"INJUP\\\":\\\"0.2327835500000000\\\",\\\"CPOOL\\\":\\\"0.1557720750000000\\\",\\\"EPX\\\":\\\"0.0000740629500000\\\",\\\"CLV\\\":\\\"0.0329835000000000\\\",\\\"FEAR\\\":\\\"0.0560519600000000\\\",\\\"MEME\\\":\\\"0.0124847545000000\\\",\\\"ROOBEE\\\":\\\"0.0004520738500000\\\",\\\"DEFI\\\":\\\"0.0192903500000000\\\",\\\"TOKEN\\\":\\\"0.0477361200000000\\\",\\\"GRAPE\\\":\\\"0.0020599695000000\\\",\\\"KASUP\\\":\\\"0.3996001000000000\\\",\\\"XWG\\\":\\\"0.0003843077500000\\\",\\\"SKEY\\\":\\\"0.0621289200000000\\\",\\\"SFUND\\\":\\\"1.3243375000000000\\\",\\\"EQX\\\":\\\"0.0032823580000000\\\",\\\"ORDIUP\\\":\\\"0.0548315705000000\\\",\\\"TON\\\":\\\"5.1857058499999995\\\",\\\"DEGO\\\":\\\"2.2667660500000001\\\",\\\"IZI\\\":\\\"0.0088455750000000\\\",\\\"ERG\\\":\\\"0.6605695500000000\\\",\\\"ERN\\\":\\\"1.9255367500000001\\\",\\\"VENOM\\\":\\\"0.0817591000000000\\\",\\\"VOXEL\\\":\\\"0.1497251000000000\\\",\\\"RLC\\\":\\\"1.4649671500000000\\\",\\\"PHA\\\":\\\"0.1093453000000000\\\",\\\"DYDXUP\\\":\\\"0.0112573685000000\\\",\\\"APE3S\\\":\\\"0.0008475760000000\\\",\\\"ORBS\\\":\\\"0.0288955450000000\\\",\\\"OPDOWN\\\":\\\"0.6758619000000000\\\",\\\"ESE\\\":\\\"0.0139130400000000\\\",\\\"APE3L\\\":\\\"0.1339330000000000\\\",\\\"HMND\\\":\\\"0.0982208650000000\\\",\\\"COQ\\\":\\\"0.0000014432780000\\\",\\\"AURY\\\":\\\"0.3340329000000000\\\",\\\"CULT\\\":\\\"0.0000028025980000\\\",\\\"AKT\\\":\\\"2.4642672500000001\\\",\\\"GLMR\\\":\\\"0.1606196500000000\\\",\\\"XYM\\\":\\\"0.0142528700000000\\\",\\\"ORAI\\\":\\\"6.1769100000000012\\\",\\\"XYO\\\":\\\"0.0058680645000000\\\",\\\"ETC\\\":\\\"18.8458723500000169\\\",\\\"LAI\\\":\\\"0.0142828550000000\\\",\\\"PIP\\\":\\\"0.0178310800000000\\\",\\\"ETH\\\":\\\"2607.6655149998362673\\\",\\\"NEO\\\":\\\"10.3575186499999991\\\",\\\"RMV\\\":\\\"0.0081659150000000\\\",\\\"KLAY\\\":\\\"0.1251374000000000\\\",\\\"PIT\\\":\\\"0.0000000003268365\\\",\\\"TARA\\\":\\\"0.0043978000000000\\\",\\\"KALT\\\":\\\"0.1128735350000000\\\",\\\"PIX\\\":\\\"0.0001023687900000\\\",\\\"ETN\\\":\\\"0.0021579205000000\\\",\\\"CSIX\\\":\\\"0.0141729100000000\\\",\\\"TRADE\\\":\\\"0.4708644500000000\\\",\\\"MAVIA\\\":\\\"1.3592200500000001\\\",\\\"HIGH\\\":\\\"1.3043474999999999\\\",\\\"TRB\\\":\\\"62.5387150000000006\\\",\\\"ORDI\\\":\\\"35.7421200000000126\\\",\\\"TRVL\\\":\\\"0.0373643085000000\\\",\\\"AMB\\\":\\\"0.0059670150000000\\\",\\\"TRU\\\":\\\"0.0762018800000000\\\",\\\"LOGX\\\":\\\"0.0271963950000000\\\",\\\"FINC\\\":\\\"0.0362018900000000\\\",\\\"INFRA\\\":\\\"0.1978010500000000\\\",\\\"NATIX\\\":\\\"0.0008729633000000\\\",\\\"NFP\\\":\\\"0.2152923000000000\\\",\\\"TRY\\\":\\\"0.0292166033323590\\\",\\\"TRX\\\":\\\"0.1597201000000000\\\",\\\"LBP\\\":\\\"0.0001243378000000\\\",\\\"LBR\\\":\\\"0.0595702000000000\\\",\\\"EUL\\\":\\\"2.9735125000000000\\\",\\\"NFT\\\":\\\"0.0000004077960000\\\",\\\"SEIUP\\\":\\\"0.0478110825000000\\\",\\\"PUFFER\\\":\\\"0.3676161000000000\\\",\\\"EUR\\\":\\\"1.0811249323958897\\\",\\\"ORCA\\\":\\\"2.0664662499999999\\\",\\\"NEAR3L\\\":\\\"0.0117010765350000\\\",\\\"AMP\\\":\\\"0.0038330825000000\\\",\\\"XDEFI\\\":\\\"0.0472563600000000\\\",\\\"HIFI\\\":\\\"0.4947525000000000\\\",\\\"TRUF\\\":\\\"0.0459570100000000\\\",\\\"AITECH\\\":\\\"0.1045477000000000\\\",\\\"AMU\\\":\\\"0.0043978000000000\\\",\\\"USTC\\\":\\\"0.0214692600000000\\\",\\\"KNGL\\\":\\\"0.0499750000000000\\\",\\\"FOXY\\\":\\\"0.0102686631000000\\\",\\\"NGC\\\":\\\"0.0147935995000000\\\",\\\"TENET\\\":\\\"0.0043278350000000\\\",\\\"NEAR3S\\\":\\\"0.0072553705000000\\\",\\\"MAHA\\\":\\\"1.1904045000000000\\\",\\\"NGL\\\":\\\"0.0701748950000000\\\",\\\"TST\\\":\\\"0.0080359800000000\\\",\\\"HIPPO\\\":\\\"0.0104447750000000\\\",\\\"AXS3S\\\":\\\"0.0308705570000000\\\",\\\"CRO\\\":\\\"0.0781409100000000\\\",\\\"ZPAY\\\":\\\"0.0050574700000000\\\",\\\"MNDE\\\":\\\"0.1026786350000000\\\",\\\"CRV\\\":\\\"0.2534732000000000\\\",\\\"SWASH\\\":\\\"0.0056271850000000\\\",\\\"AXS3L\\\":\\\"0.0106388779000000\\\",\\\"VERSE\\\":\\\"0.0001803098000000\\\",\\\"RPK\\\":\\\"0.0049975000000000\\\",\\\"RPL\\\":\\\"10.9745099999999958\\\",\\\"AZERO\\\":\\\"0.3789104500000000\\\",\\\"SOUL\\\":\\\"0.0534332700000000\\\",\\\"VXV\\\":\\\"0.2619689500000000\\\",\\\"LDO\\\":\\\"1.0885554500000000\\\",\\\"MAGIC\\\":\\\"0.3390304000000000\\\",\\\"ALICE\\\":\\\"1.0324835000000000\\\",\\\"SEAM\\\":\\\"1.1933030499999999\\\",\\\"PLU\\\":\\\"1.9300345000000001\\\",\\\"AOG\\\":\\\"0.0031224380000000\\\",\\\"SMOLE\\\":\\\"0.0000387806000000\\\",\\\"EWT\\\":\\\"1.1094450000000000\\\",\\\"TSUGT\\\":\\\"0.0029185400000000\\\",\\\"PMG\\\":\\\"0.0800599500000000\\\",\\\"OPAI\\\":\\\"0.0006826585000000\\\",\\\"LOCUS\\\":\\\"0.0216591650000000\\\",\\\"CTA\\\":\\\"0.0825087250000000\\\",\\\"NIM\\\":\\\"0.0013673160000000\\\",\\\"CTC\\\":\\\"0.4033982000000000\\\",\\\"APE\\\":\\\"0.7035480500000000\\\",\\\"MERL\\\":\\\"0.2720639000000000\\\",\\\"JAM\\\":\\\"0.0004770613500000\\\",\\\"CTI\\\":\\\"0.0130314810000000\\\",\\\"APP\\\":\\\"0.0021989000000000\\\",\\\"APT\\\":\\\"9.9947001500000000\\\",\\\"WLDUP\\\":\\\"0.0093043455000000\\\",\\\"ZEND\\\":\\\"0.1280759300000000\\\",\\\"FIRE\\\":\\\"0.9113441000000000\\\",\\\"DENT\\\":\\\"0.0008630682500000\\\",\\\"PYTH\\\":\\\"0.3390603850000000\\\",\\\"LFT\\\":\\\"0.0155322300000000\\\",\\\"DPET\\\":\\\"0.0319040400000000\\\",\\\"ORDIDOWN\\\":\\\"0.3788105000000000\\\",\\\"KPOL\\\":\\\"0.0029175405000000\\\",\\\"ETHUP\\\":\\\"8.4971493000000032\\\",\\\"BAND\\\":\\\"1.0939527500000001\\\",\\\"POL\\\":\\\"0.3656171000000000\\\",\\\"ASTR\\\":\\\"0.0582608550000000\\\",\\\"NKN\\\":\\\"0.0691654000000000\\\",\\\"RSR\\\":\\\"0.0068055955000000\\\",\\\"DVPN\\\":\\\"0.0005979009000000\\\",\\\"TWT\\\":\\\"1.1119437500000000\\\",\\\"ARB\\\":\\\"0.5510243500000000\\\",\\\"CVC\\\":\\\"0.1409801746501747\\\",\\\"ARC\\\":\\\"0.0300849500000000\\\",\\\"XETA\\\":\\\"0.0022888550000000\\\",\\\"MTRG\\\":\\\"0.4007995000000000\\\",\\\"LOKA\\\":\\\"0.1867066000000000\\\",\\\"LPOOL\\\":\\\"0.0660069800000000\\\",\\\"TURBOS\\\":\\\"0.0034812585000000\\\",\\\"CVX\\\":\\\"1.7816087499999999\\\",\\\"ARX\\\":\\\"0.0007556220000000\\\",\\\"MPLX\\\":\\\"0.4355221300000000\\\",\\\"SUSHI\\\":\\\"0.7011492500000000\\\",\\\"NLK\\\":\\\"0.0114442750000000\\\",\\\"PEPE2\\\":\\\"0.0000000313843000\\\",\\\"WBTC\\\":\\\"66881.4425499645548419\\\",\\\"SUI3L\\\":\\\"0.0211204345000000\\\",\\\"CWS\\\":\\\"0.1927036000000000\\\",\\\"SUI3S\\\":\\\"0.0000579110300000\\\",\\\"INSP\\\":\\\"0.0264167850000000\\\",\\\"MANA\\\":\\\"0.2945026750000000\\\",\\\"VRTX\\\":\\\"0.0641679000000000\\\",\\\"CSPR\\\":\\\"0.0116441750000000\\\",\\\"ATA\\\":\\\"0.0785007300000000\\\",\\\"OPEN\\\":\\\"0.0080049955000000\\\",\\\"HAI\\\":\\\"0.0448275750000000\\\",\\\"NMR\\\":\\\"14.7436245000000072\\\",\\\"ATH\\\":\\\"0.0540929400000000\\\",\\\"LIT\\\":\\\"0.6282857000000000\\\",\\\"TLOS\\\":\\\"0.3263467450000000\\\",\\\"TNSR\\\":\\\"0.3662168000000000\\\",\\\"CXT\\\":\\\"0.0871364100000000\\\",\\\"POLYX\\\":\\\"0.2346826000000000\\\",\\\"ZERO\\\":\\\"0.0002507745500000\\\",\\\"ROUTE\\\":\\\"0.0610694500000000\\\",\\\"LOOM\\\":\\\"0.0580009850000000\\\",\\\"PRE\\\":\\\"0.0078680640000000\\\",\\\"VRAUP\\\":\\\"0.0134652640000000\\\",\\\"HBB\\\":\\\"0.0714742450000000\\\",\\\"RVN\\\":\\\"0.0165017450000000\\\",\\\"PRQ\\\":\\\"0.0715741950000000\\\",\\\"ONDO\\\":\\\"0.7134930750000000\\\",\\\"PEPEDOWN\\\":\\\"0.0000155022450000\\\",\\\"WOOP\\\":\\\"0.0020179905000000\\\",\\\"LUNCUP\\\":\\\"0.0168355780000000\\\",\\\"KAVA\\\":\\\"0.3522238000000000\\\",\\\"LKI\\\":\\\"0.0104187880000000\\\",\\\"AVA\\\":\\\"0.4857570000000000\\\",\\\"NOM\\\":\\\"0.0233883000000000\\\",\\\"MAPO\\\":\\\"0.0089015470000000\\\",\\\"PEPEUP\\\":\\\"0.0114252845000000\\\",\\\"STRAX\\\":\\\"0.0487156300000000\\\",\\\"NOT\\\":\\\"0.0078670645000000\\\",\\\"ZERC\\\":\\\"0.1108245600000000\\\",\\\"BCUT\\\":\\\"0.0255672100000000\\\",\\\"MASA\\\":\\\"0.0691354150000000\\\",\\\"WAN\\\":\\\"0.1785077544737212\\\",\\\"WAT\\\":\\\"0.0003273762300000\\\",\\\"WAX\\\":\\\"0.0327636100000000\\\",\\\"MASK\\\":\\\"2.2259864500000002\\\",\\\"EOS3L\\\":\\\"0.0002122138400000\\\",\\\"IDEA\\\":\\\"0.0005887055000000\\\",\\\"EOS3S\\\":\\\"0.0034472755000000\\\",\\\"YFI\\\":\\\"4919.4290549999908843\\\",\\\"MOODENG\\\":\\\"0.0774612500000000\\\",\\\"XCUR\\\":\\\"0.0048845565000000\\\",\\\"HYDRA\\\":\\\"0.2225886500000000\\\",\\\"POPCAT\\\":\\\"1.3382305500000000\\\",\\\"LQTY\\\":\\\"0.7848074000000000\\\",\\\"PIXEL\\\":\\\"0.1406596350000000\\\",\\\"LMR\\\":\\\"0.0145437245000000\\\",\\\"ZETA\\\":\\\"0.5997999500000000\\\",\\\"YGG\\\":\\\"0.4717640000000000\\\",\\\"AXS\\\":\\\"4.6006985000000006\\\",\\\"BCHSV\\\":\\\"49.8250749999999370\\\",\\\"NRN\\\":\\\"0.0395802000000000\\\",\\\"FTON\\\":\\\"0.0091954000000000\\\",\\\"COMP\\\":\\\"43.6581599999999881\\\",\\\"XPRT\\\":\\\"0.1819090000000000\\\",\\\"HFT\\\":\\\"0.1443278000000000\\\",\\\"UXLINK\\\":\\\"0.5085456000000000\\\",\\\"STAMP\\\":\\\"0.0335032400000000\\\",\\\"RUNE\\\":\\\"4.9233370999999996\\\",\\\"ZEUS\\\":\\\"0.2587705500000000\\\",\\\"LTC3L\\\":\\\"1.8294848000000001\\\",\\\"DAPP\\\":\\\"0.1763118000000000\\\",\\\"FORTH\\\":\\\"2.9508238500000004\\\",\\\"ALPINE\\\":\\\"1.5322335000000000\\\",\\\"SENSO\\\":\\\"0.0328835500000000\\\",\\\"LTC3S\\\":\\\"0.0006986505000000\\\",\\\"DEXE\\\":\\\"8.3795081500000028\\\",\\\"GOAL\\\":\\\"0.0175912000000000\\\",\\\"AVAX\\\":\\\"27.5602130000000058\\\",\\\"LISTA\\\":\\\"0.3782108000000000\\\",\\\"AMPL\\\":\\\"1.3743124999999999\\\",\\\"WORK\\\":\\\"0.1384307500000000\\\",\\\"BRWL\\\":\\\"0.0017391300000000\\\",\\\"BANANA\\\":\\\"57.1314200000001362\\\",\\\"PUSH\\\":\\\"0.0750624500000000\\\",\\\"WEN\\\":\\\"0.0001015492000000\\\",\\\"NEIRO\\\":\\\"0.0879560000000000\\\",\\\"BTCUP\\\":\\\"34.7711057499999789\\\",\\\"SOL3S\\\":\\\"0.0007816090000000\\\",\\\"BRAWL\\\":\\\"0.0004776610500000\\\",\\\"LAY3R\\\":\\\"0.2161918500000000\\\",\\\"LPT\\\":\\\"11.9304317999999945\\\",\\\"GODS\\\":\\\"0.1807096000000000\\\",\\\"SAND3S\\\":\\\"4.6152911999999992\\\",\\\"RDNT\\\":\\\"0.0640679500000000\\\",\\\"SOL3L\\\":\\\"1.8351913752850000\\\",\\\"NIBI\\\":\\\"0.0653772950000000\\\",\\\"NUM\\\":\\\"0.0436181800000000\\\",\\\"PYR\\\":\\\"2.5590198499999997\\\",\\\"DAG\\\":\\\"0.0226176855000000\\\",\\\"DAI\\\":\\\"0.9989006596042375\\\",\\\"HIP\\\":\\\"0.0034982500000000\\\",\\\"DAO\\\":\\\"0.2848575000000000\\\",\\\"AVAIL\\\":\\\"0.1300929210000000\\\",\\\"DAR\\\":\\\"0.1512243500000000\\\",\\\"FET\\\":\\\"1.3760116500000000\\\",\\\"FCON\\\":\\\"0.0001197600900000\\\",\\\"XAVA\\\":\\\"0.3789104500000000\\\",\\\"LRC\\\":\\\"0.1208395500000000\\\",\\\"UNI3S\\\":\\\"0.0000653573050000\\\",\\\"PZP\\\":\\\"0.0599600050000000\\\",\\\"POKT\\\":\\\"0.0424787500000000\\\",\\\"DASH\\\":\\\"23.6881500000000109\\\",\\\"BAKEDOWN\\\":\\\"0.0003324636850000\\\",\\\"POLC\\\":\\\"0.0061389290000000\\\",\\\"DBR\\\":\\\"0.0377671070000000\\\",\\\"CIRUS\\\":\\\"0.0055772100000000\\\",\\\"UNI3L\\\":\\\"0.0993921490650000\\\",\\\"NWC\\\":\\\"0.0681659000000000\\\",\\\"POLK\\\":\\\"0.0142628650000000\\\",\\\"LSD\\\":\\\"0.9420287500000000\\\",\\\"MARS4\\\":\\\"0.0005878059500000\\\",\\\"LSK\\\":\\\"0.8080957500000000\\\",\\\"BLOCK\\\":\\\"0.0261869000000000\\\",\\\"ANALOS\\\":\\\"0.0000446776500000\\\",\\\"SAFE\\\":\\\"0.8779608000000000\\\",\\\"DCK\\\":\\\"0.0234082900000000\\\",\\\"LSS\\\":\\\"0.0562718500000000\\\",\\\"DCR\\\":\\\"12.4337799999999929\\\",\\\"LIKE\\\":\\\"0.0559720000000000\\\",\\\"DATA\\\":\\\"0.0361819000000000\\\",\\\"WIF\\\":\\\"2.5696145499999999\\\",\\\"BLOK\\\":\\\"0.0006546725000000\\\",\\\"LTC\\\":\\\"71.6261690000000611\\\",\\\"METIS\\\":\\\"42.0289750000000612\\\",\\\"WIN\\\":\\\"0.0000868365600000\\\",\\\"HLG\\\":\\\"0.0018790600000000\\\",\\\"LTO\\\":\\\"0.1166116650000000\\\",\\\"DYDX\\\":\\\"0.9341327000000000\\\",\\\"ARB3S\\\":\\\"0.0509025360000000\\\",\\\"MUBI\\\":\\\"0.0303848000000000\\\",\\\"ARB3L\\\":\\\"0.0025917035000000\\\",\\\"RBTC1\\\":\\\"0.0000039480250000\\\",\\\"POND\\\":\\\"0.0118640650000000\\\",\\\"LINA\\\":\\\"0.0037771105000000\\\",\\\"MYRIA\\\":\\\"0.0025337325000000\\\",\\\"LINK\\\":\\\"11.0244849999999944\\\",\\\"QTUM\\\":\\\"2.4262016723130069\\\",\\\"TUNE\\\":\\\"0.0148025950000000\\\",\\\"UFO\\\":\\\"0.0000006479758500\\\",\\\"CYBER\\\":\\\"2.8755615000000001\\\",\\\"WILD\\\":\\\"0.2433782500000000\\\",\\\"POLS\\\":\\\"0.2809594500000000\\\",\\\"NYM\\\":\\\"0.0719640000000000\\\",\\\"FIL\\\":\\\"3.6786597500000005\\\",\\\"BAL\\\":\\\"2.0099945000000000\\\",\\\"SCA\\\":\\\"0.3999999000000000\\\",\\\"STND\\\":\\\"0.0133123405000000\\\",\\\"WMTX\\\":\\\"0.2138930000000000\\\",\\\"SCLP\\\":\\\"0.1545227000000000\\\",\\\"MANEKI\\\":\\\"0.0073963000000000\\\",\\\"BAT\\\":\\\"0.1721139000000000\\\",\\\"AKRO\\\":\\\"0.0042302838000000\\\",\\\"FTM3L\\\":\\\"8.2574692000000024\\\",\\\"BAX\\\":\\\"0.0000709645000000\\\",\\\"FTM3S\\\":\\\"0.0000255072400000\\\",\\\"COTI\\\":\\\"0.0951524000000000\\\"}}", - "x-request-example": "{\\\"base\\\": \\\"USD\\\", \\\"currencies\\\": \\\"example_string_default_value\\\"}" - } - }, - "/api/v2/symbols": { - "get": { - "summary": "Get All Symbols", - "deprecated": false, - "description": "Request via this endpoint to get a list of available currency pairs for trading. If you want to get the market information of the trading symbol, please use Get All Tickers.", - "tags": [], - "parameters": [ + }, { - "name": "market", + "name": "startAt", "in": "query", - "description": "[The trading market](https://www.kucoin.com/docs-new/api-222921786)", + "description": "Start time (second), default is 0", "required": false, "schema": { - "type": "string", - "example": [ - "ALTS", - "USDS", - "ETF" - ] + "type": "integer", + "format": "int64", + "default": 0 + } + }, + { + "name": "endAt", + "in": "query", + "description": "End time (second), default is 0", + "required": false, + "schema": { + "type": "integer", + "format": "int64", + "default": 0 } } ], @@ -3891,151 +1730,11 @@ "data": { "type": "array", "items": { - "type": "object", - "properties": { - "symbol": { - "type": "string", - "description": "unique code of a symbol, it would not change after renaming", - "example": [ - "BTC-USDT", - "BCHSV-USDT" - ] - }, - "name": { - "type": "string", - "description": "Name of trading pairs, it would change after renaming", - "example": [ - "BTC-USDT", - "BSV-USDT" - ] - }, - "baseCurrency": { - "type": "string", - "description": "Base currency,e.g. BTC." - }, - "quoteCurrency": { - "type": "string", - "description": "Quote currency,e.g. USDT." - }, - "feeCurrency": { - "type": "string", - "description": "The currency of charged fees." - }, - "market": { - "type": "string", - "description": "The trading market.", - "example": [ - "USDS", - "BTC", - "ALTS" - ] - }, - "baseMinSize": { - "type": "string", - "description": "The minimum order quantity requried to place an order." - }, - "quoteMinSize": { - "type": "string", - "description": "The minimum order funds required to place a market order." - }, - "baseMaxSize": { - "type": "string", - "description": "The maximum order size required to place an order." - }, - "quoteMaxSize": { - "type": "string", - "description": "The maximum order funds required to place a market order." - }, - "baseIncrement": { - "type": "string", - "description": "Quantity increment: The quantity for an order must be a positive integer multiple of this increment. Here, the size refers to the quantity of the base currency for the order. For example, for the ETH-USDT trading pair, if the baseIncrement is 0.0000001, the order quantity can be 1.0000001 but not 1.00000001." - }, - "quoteIncrement": { - "type": "string", - "description": "Quote increment: The funds for a market order must be a positive integer multiple of this increment. The funds refer to the quote currency amount. For example, for the ETH-USDT trading pair, if the quoteIncrement is 0.000001, the amount of USDT for the order can be 3000.000001 but not 3000.0000001." - }, - "priceIncrement": { - "type": "string", - "description": "Price increment: The price of an order must be a positive integer multiple of this increment. For example, for the ETH-USDT trading pair, if the priceIncrement is 0.01, the order price can be 3000.01 but not 3000.001.\n\nspecifies the min order price as well as the price increment.This also applies to quote currency." - }, - "priceLimitRate": { - "type": "string", - "description": "Threshold for price portection" - }, - "minFunds": { - "type": "string", - "description": "the minimum trading amounts" - }, - "isMarginEnabled": { - "type": "boolean", - "description": "Available for margin or not." - }, - "enableTrading": { - "type": "boolean", - "description": "Available for transaction or not." - }, - "feeCategory": { - "type": "integer", - "description": "[Fee Type](https://www.kucoin.com/vip/privilege)", - "enum": [ - 1, - 2, - 3 - ], - "x-api-enum": [ - { - "value": 1, - "name": "classA", - "description": "classA" - }, - { - "value": 2, - "name": "classB", - "description": "classB" - }, - { - "value": 3, - "name": "classC", - "description": "classC" - } - ] - }, - "makerFeeCoefficient": { - "type": "string", - "description": "The maker fee coefficient. The actual fee needs to be multiplied by this coefficient to get the final fee. Most currencies have a coefficient of 1. If set to 0, it means no fee" - }, - "takerFeeCoefficient": { - "type": "string", - "description": "The taker fee coefficient. The actual fee needs to be multiplied by this coefficient to get the final fee. Most currencies have a coefficient of 1. If set to 0, it means no fee" - }, - "st": { - "type": "boolean", - "description": "Whether it is an [Special Treatment](https://www.kucoin.com/legal/special-treatment) symbol" - } - }, - "required": [ - "symbol", - "name", - "baseCurrency", - "quoteCurrency", - "feeCurrency", - "market", - "baseMinSize", - "quoteMinSize", - "baseMaxSize", - "quoteMaxSize", - "baseIncrement", - "quoteIncrement", - "priceIncrement", - "priceLimitRate", - "minFunds", - "isMarginEnabled", - "enableTrading", - "feeCategory", - "makerFeeCoefficient", - "takerFeeCoefficient", - "st" - ] + "type": "array", + "items": { + "type": "string", + "description": "Start time of the candle cycle, opening price, closing price, highest price, Lowest price, Transaction amount, Transaction volume" + } } } }, @@ -4048,55 +1747,44 @@ } } }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470154", + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470163", "x-abandon": "normal", "x-domain": "Spot", "x-api-channel": "Public", "x-api-permission": "NULL", "x-api-rate-limit-pool": "Public", - "x-sdk-service": "Spot", - "x-sdk-sub-service": "Market", - "x-sdk-method-name": "getAllSymbols", - "x-sdk-method-description": "Request via this endpoint to get a list of available currency pairs for trading. If you want to get the market information of the trading symbol, please use Get All Tickers.", - "x-api-rate-limit": 4, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": [\\n {\\n \\\"symbol\\\": \\\"BTC-USDT\\\",\\n \\\"name\\\": \\\"BTC-USDT\\\",\\n \\\"baseCurrency\\\": \\\"BTC\\\",\\n \\\"quoteCurrency\\\": \\\"USDT\\\",\\n \\\"feeCurrency\\\": \\\"USDT\\\",\\n \\\"market\\\": \\\"USDS\\\",\\n \\\"baseMinSize\\\": \\\"0.00001\\\",\\n \\\"quoteMinSize\\\": \\\"0.1\\\",\\n \\\"baseMaxSize\\\": \\\"10000000000\\\",\\n \\\"quoteMaxSize\\\": \\\"99999999\\\",\\n \\\"baseIncrement\\\": \\\"0.00000001\\\",\\n \\\"quoteIncrement\\\": \\\"0.000001\\\",\\n \\\"priceIncrement\\\": \\\"0.1\\\",\\n \\\"priceLimitRate\\\": \\\"0.1\\\",\\n \\\"minFunds\\\": \\\"0.1\\\",\\n \\\"isMarginEnabled\\\": true,\\n \\\"enableTrading\\\": true,\\n \\\"feeCategory\\\": 1,\\n \\\"makerFeeCoefficient\\\": \\\"1.00\\\",\\n \\\"takerFeeCoefficient\\\": \\\"1.00\\\",\\n \\\"st\\\": false\\n }\\n ]\\n}", - "x-request-example": "{\\\"market\\\": \\\"ALTS\\\"}" + "x-sdk-service": "Spot", + "x-sdk-sub-service": "Market", + "x-sdk-method-name": "getKlines", + "x-sdk-method-description": "Get the Kline of the symbol. Data are returned in grouped buckets based on requested type. For each query, the system would return at most 1500 pieces of data. To obtain more data, please page the data by time.", + "x-api-rate-limit": 3, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": [\\n [\\n \\\"1566789720\\\",\\n \\\"10411.5\\\",\\n \\\"10401.9\\\",\\n \\\"10411.5\\\",\\n \\\"10396.3\\\",\\n \\\"29.11357276\\\",\\n \\\"302889.301529914\\\"\\n ],\\n [\\n \\\"1566789660\\\",\\n \\\"10416\\\",\\n \\\"10411.5\\\",\\n \\\"10422.3\\\",\\n \\\"10411.5\\\",\\n \\\"15.61781842\\\",\\n \\\"162703.708997029\\\"\\n ],\\n [\\n \\\"1566789600\\\",\\n \\\"10408.6\\\",\\n \\\"10416\\\",\\n \\\"10416\\\",\\n \\\"10405.4\\\",\\n \\\"12.45584973\\\",\\n \\\"129666.51508559\\\"\\n ]\\n ]\\n}", + "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"type\\\": \\\"1min\\\", \\\"startAt\\\": 1566703297, \\\"endAt\\\": 1566789757}" } }, - "/api/v3/currencies/{currency}": { + "/api/v1/market/orderbook/level2_{size}": { "get": { - "summary": "Get Currency", + "summary": "Get Part OrderBook", "deprecated": false, - "description": "Request via this endpoint to get the currency details of a specified currency", + "description": "Query for part orderbook depth data. (aggregated by price) You are recommended to request via this endpoint as the system reponse would be faster and cosume less traffic.", "tags": [], "parameters": [ { - "name": "currency", - "in": "path", - "description": "Path parameter, Currency", + "name": "symbol", + "in": "query", + "description": "symbol", "required": true, "schema": { "type": "string" } }, { - "name": "chain", - "in": "query", - "description": "Support for querying the chain of currency, e.g. The available value for USDT are OMNI, ERC20, TRC20. This only apply for multi-chain currency, and there is no need for single chain currency.", - "required": false, + "name": "size", + "in": "path", + "description": "Get the depth layer, optional value: 20, 100", + "required": true, "schema": { - "type": "string", - "example": [ - "eth", - "bech32", - "btc", - "kcc", - "trx", - "bsc", - "arbitrum", - "ton", - "optimism" - ] + "type": "integer" } } ], @@ -4114,135 +1802,43 @@ "data": { "type": "object", "properties": { - "currency": { - "type": "string", - "description": "A unique currency code that will never change" - }, - "name": { - "type": "string", - "description": "Currency name, will change after renaming" - }, - "fullName": { - "type": "string", - "description": "Full name of a currency, will change after renaming" - }, - "precision": { - "type": "integer", - "description": "Currency precision" - }, - "confirms": { + "time": { "type": "integer", - "description": "Number of block confirmations" + "description": "Timestamp(millisecond)", + "format": "int64" }, - "contractAddress": { + "sequence": { "type": "string", - "description": "Contract address" - }, - "isMarginEnabled": { - "type": "boolean", - "description": "Support margin or not" + "description": "Sequence number" }, - "isDebitEnabled": { - "type": "boolean", - "description": "Support debit or not" + "bids": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "string", + "description": "Price, Size" + } + }, + "description": "bids, from high to low" }, - "chains": { + "asks": { "type": "array", "items": { - "type": "object", - "properties": { - "chainName": { - "type": "string", - "description": "chain name of currency" - }, - "withdrawalMinSize": { - "type": "string", - "description": "Minimum withdrawal amount" - }, - "depositMinSize": { - "type": "string", - "description": "Minimum deposit amount" - }, - "withdrawFeeRate": { - "type": "string", - "description": "withdraw fee rate" - }, - "withdrawalMinFee": { - "type": "string", - "description": "Minimum fees charged for withdrawal" - }, - "isWithdrawEnabled": { - "type": "boolean", - "description": "Support withdrawal or not" - }, - "isDepositEnabled": { - "type": "boolean", - "description": "Support deposit or not" - }, - "confirms": { - "type": "integer", - "description": "Number of block confirmations" - }, - "preConfirms": { - "type": "integer", - "description": "The number of blocks (confirmations) for advance on-chain verification" - }, - "contractAddress": { - "type": "string", - "description": "Contract address" - }, - "withdrawPrecision": { - "type": "integer", - "description": "Withdrawal precision bit, indicating the maximum supported length after the decimal point of the withdrawal amount" - }, - "maxWithdraw": { - "type": "number", - "description": "Maximum amount of single withdrawal" - }, - "maxDeposit": { - "type": "string", - "description": "Maximum amount of single deposit (only applicable to Lightning Network)" - }, - "needTag": { - "type": "boolean", - "description": "whether memo/tag is needed" - }, - "chainId": { - "type": "string", - "description": "chain id of currency" - } - }, - "required": [ - "chainName", - "withdrawalMinSize", - "depositMinSize", - "withdrawFeeRate", - "withdrawalMinFee", - "isWithdrawEnabled", - "isDepositEnabled", - "confirms", - "preConfirms", - "contractAddress", - "withdrawPrecision", - "maxWithdraw", - "maxDeposit", - "needTag", - "chainId" - ] + "type": "array", + "items": { + "type": "string", + "description": "Price, Size" + } }, - "description": "chain list" + "description": "asks, from low to high" } }, "required": [ - "currency", - "name", - "fullName", - "precision", - "confirms", - "contractAddress", - "isMarginEnabled", - "isDebitEnabled", - "chains" + "sequence", + "bids", + "asks", + "time" ] } }, @@ -4255,7 +1851,7 @@ } } }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470155", + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470165", "x-abandon": "normal", "x-domain": "Spot", "x-api-channel": "Public", @@ -4263,20 +1859,30 @@ "x-api-rate-limit-pool": "Public", "x-sdk-service": "Spot", "x-sdk-sub-service": "Market", - "x-sdk-method-name": "getCurrency", - "x-sdk-method-description": "Request via this endpoint to get the currency details of a specified currency", - "x-api-rate-limit": 3, - "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"currency\\\":\\\"BTC\\\",\\\"name\\\":\\\"BTC\\\",\\\"fullName\\\":\\\"Bitcoin\\\",\\\"precision\\\":8,\\\"confirms\\\":null,\\\"contractAddress\\\":null,\\\"isMarginEnabled\\\":true,\\\"isDebitEnabled\\\":true,\\\"chains\\\":[{\\\"chainName\\\":\\\"BTC\\\",\\\"withdrawalMinSize\\\":\\\"0.001\\\",\\\"depositMinSize\\\":\\\"0.0002\\\",\\\"withdrawFeeRate\\\":\\\"0\\\",\\\"withdrawalMinFee\\\":\\\"0.0005\\\",\\\"isWithdrawEnabled\\\":true,\\\"isDepositEnabled\\\":true,\\\"confirms\\\":3,\\\"preConfirms\\\":1,\\\"contractAddress\\\":\\\"\\\",\\\"withdrawPrecision\\\":8,\\\"maxWithdraw\\\":null,\\\"maxDeposit\\\":null,\\\"needTag\\\":false,\\\"chainId\\\":\\\"btc\\\"},{\\\"chainName\\\":\\\"Lightning Network\\\",\\\"withdrawalMinSize\\\":\\\"0.00001\\\",\\\"depositMinSize\\\":\\\"0.00001\\\",\\\"withdrawFeeRate\\\":\\\"0\\\",\\\"withdrawalMinFee\\\":\\\"0.000015\\\",\\\"isWithdrawEnabled\\\":true,\\\"isDepositEnabled\\\":true,\\\"confirms\\\":1,\\\"preConfirms\\\":1,\\\"contractAddress\\\":\\\"\\\",\\\"withdrawPrecision\\\":8,\\\"maxWithdraw\\\":null,\\\"maxDeposit\\\":\\\"0.03\\\",\\\"needTag\\\":false,\\\"chainId\\\":\\\"btcln\\\"},{\\\"chainName\\\":\\\"KCC\\\",\\\"withdrawalMinSize\\\":\\\"0.0008\\\",\\\"depositMinSize\\\":null,\\\"withdrawFeeRate\\\":\\\"0\\\",\\\"withdrawalMinFee\\\":\\\"0.00002\\\",\\\"isWithdrawEnabled\\\":true,\\\"isDepositEnabled\\\":true,\\\"confirms\\\":20,\\\"preConfirms\\\":20,\\\"contractAddress\\\":\\\"0xfa93c12cd345c658bc4644d1d4e1b9615952258c\\\",\\\"withdrawPrecision\\\":8,\\\"maxWithdraw\\\":null,\\\"maxDeposit\\\":null,\\\"needTag\\\":false,\\\"chainId\\\":\\\"kcc\\\"},{\\\"chainName\\\":\\\"BTC-Segwit\\\",\\\"withdrawalMinSize\\\":\\\"0.0008\\\",\\\"depositMinSize\\\":\\\"0.0002\\\",\\\"withdrawFeeRate\\\":\\\"0\\\",\\\"withdrawalMinFee\\\":\\\"0.0005\\\",\\\"isWithdrawEnabled\\\":false,\\\"isDepositEnabled\\\":true,\\\"confirms\\\":2,\\\"preConfirms\\\":2,\\\"contractAddress\\\":\\\"\\\",\\\"withdrawPrecision\\\":8,\\\"maxWithdraw\\\":null,\\\"maxDeposit\\\":null,\\\"needTag\\\":false,\\\"chainId\\\":\\\"bech32\\\"}]}}", - "x-request-example": "{\\\"currency\\\": \\\"BTC\\\", \\\"chain\\\": \\\"eth\\\"}" + "x-sdk-method-name": "getPartOrderBook", + "x-sdk-method-description": "Query for part orderbook depth data. (aggregated by price) You are recommended to request via this endpoint as the system reponse would be faster and cosume less traffic.", + "x-api-rate-limit": 2, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"time\\\": 1729176273859,\\n \\\"sequence\\\": \\\"14610502970\\\",\\n \\\"bids\\\": [\\n [\\n \\\"66976.4\\\",\\n \\\"0.69109872\\\"\\n ],\\n [\\n \\\"66976.3\\\",\\n \\\"0.14377\\\"\\n ]\\n ],\\n \\\"asks\\\": [\\n [\\n \\\"66976.5\\\",\\n \\\"0.05408199\\\"\\n ],\\n [\\n \\\"66976.8\\\",\\n \\\"0.0005\\\"\\n ]\\n ]\\n }\\n}", + "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"size\\\": \\\"20\\\"}" } }, - "/api/v1/timestamp": { + "/api/v3/market/orderbook/level2": { "get": { - "summary": "Get Server Time", + "summary": "Get Full OrderBook", "deprecated": false, - "description": "Get the server time.", + "description": "Query for Full orderbook depth data. (aggregated by price) It is generally used by professional traders because it uses more server resources and traffic, and we have strict access rate limit control. To maintain up-to-date Order Book, please use Websocket incremental feed after retrieving the OrderBook.", "tags": [], - "parameters": [], + "parameters": [ + { + "name": "symbol", + "in": "query", + "description": "symbol", + "required": true, + "schema": { + "type": "string" + } + } + ], "responses": { "200": { "description": "", @@ -4289,9 +1895,46 @@ "type": "string" }, "data": { - "type": "integer", - "format": "int64", - "description": "ServerTime(millisecond)" + "type": "object", + "properties": { + "time": { + "type": "integer", + "description": "Timestamp(millisecond)", + "format": "int64" + }, + "sequence": { + "type": "string", + "description": "Sequence number" + }, + "bids": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "string", + "description": "Price, Size" + } + }, + "description": "bids, from high to low" + }, + "asks": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "string", + "description": "Price, Size" + } + }, + "description": "asks, from low to high" + } + }, + "required": [ + "time", + "sequence", + "bids", + "asks" + ] } }, "required": [ @@ -4303,279 +1946,49 @@ } } }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470156", + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470164", "x-abandon": "normal", - "x-domain": "Spot", - "x-api-channel": "Public", - "x-api-permission": "NULL", - "x-api-rate-limit-pool": "Public", - "x-sdk-service": "Spot", - "x-sdk-sub-service": "Market", - "x-sdk-method-name": "getServerTime", - "x-sdk-method-description": "Get the server time.", - "x-api-rate-limit": 3, - "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":1729100692873}" - } - }, - "/api/v3/announcements": { - "get": { - "summary": "Get Announcements", - "deprecated": false, - "description": "This interface can obtain the latest news announcements, and the default page search is for announcements within a month.", - "tags": [], - "parameters": [ - { - "name": "currentPage", - "in": "query", - "description": "page number", - "required": false, - "schema": { - "type": "integer", - "format": "int64" - } - }, - { - "name": "pageSize", - "in": "query", - "description": "page Size", - "required": false, - "schema": { - "type": "integer", - "format": "int64" - } - }, - { - "name": "annType", - "in": "query", - "description": "Announcement types: latest-announcements , activities (latest activities), new-listings (new currency online), product-updates (product updates), vip (institutions and VIPs), maintenance-updates (system maintenance), product -updates (product news), delistings (currency offline), others, api-campaigns (API user activities), default : latest-announcements", - "required": false, - "schema": { - "type": "string", - "enum": [ - "latest-announcements ", - "activities ", - "product-updates ", - "vip ", - "maintenance-updates", - "delistings ", - "others", - "api-campaigns ", - "new-listings" - ], - "default": "latest-announcements", - "x-api-enum": [ - { - "value": "latest-announcements ", - "name": "LATEST-ANNOUNCEMENTS", - "description": "latest-announcements" - }, - { - "value": "activities ", - "name": "ACTIVITIES", - "description": "latest activities" - }, - { - "value": "product-updates ", - "name": "PRODUCT-UPDATES", - "description": "product updates" - }, - { - "value": "vip ", - "name": "VIPS", - "description": "institutions and VIPs" - }, - { - "value": "maintenance-updates", - "name": "MAINTENANCE-UPDATE", - "description": "system maintenance" - }, - { - "value": "delistings ", - "name": "DELISTINGS", - "description": "currency offline" - }, - { - "value": "others", - "name": "OTHERS", - "description": "others" - }, - { - "value": "api-campaigns ", - "name": "API-CAMPAIGNS", - "description": "API user activities" - }, - { - "value": "new-listings", - "name": "NEW-LISTINGS", - "description": "new currency online" - } - ] - } - }, - { - "name": "lang", - "in": "query", - "description": "Language type, the default is en_US, the specific value parameters are as follows", - "required": false, - "schema": { - "type": "string", - "default": "en_US", - "enum": [ - "zh_HK", - "ja_JP", - "ko_KR", - "en_US", - "pl_PL", - "es_ES", - "fr_FR", - "ar_AE", - "it_IT", - "id_ID", - "nl_NL", - "pt_PT", - "vi_VN", - "de_DE", - "tr_TR", - "ms_MY", - "ru_RU", - "th_TH", - "hi_IN", - "bn_BD", - "fil_PH", - "ur_PK" - ], - "x-api-enum": [ - { - "value": "zh_HK", - "name": "ZH_HK", - "description": "Chinese (Hong Kong)" - }, - { - "value": "ja_JP", - "name": "JA_JP", - "description": "Japanese (Japan)" - }, - { - "value": "ko_KR", - "name": "KO_KR", - "description": "Korean (Korea)" - }, - { - "value": "en_US", - "name": "EN_US", - "description": "English" - }, - { - "value": "pl_PL", - "name": "PL_PL", - "description": "Polish (Poland)" - }, - { - "value": "es_ES", - "name": "ES_ES", - "description": "Spanish (Spain)" - }, - { - "value": "fr_FR", - "name": "FR_FR", - "description": "French (France)" - }, - { - "value": "ar_AE", - "name": "AR_AE", - "description": "Arabic (Egypt)" - }, - { - "value": "it_IT", - "name": "IT_IT", - "description": "Italian (Italy)" - }, - { - "value": "id_ID", - "name": "ID_ID", - "description": "Indonesian (Indonesia)" - }, - { - "value": "nl_NL", - "name": "NL_NL", - "description": "Dutch (Netherlands)" - }, - { - "value": "pt_PT", - "name": "PT_PT", - "description": "Portuguese (Brazil)" - }, - { - "value": "vi_VN", - "name": "VI_VN", - "description": "Vietnamese (Vietnam)" - }, - { - "value": "de_DE", - "name": "DE_DE", - "description": "German (Germany)" - }, - { - "value": "tr_TR", - "name": "TR_TR", - "description": "Turkish (Turkey)" - }, - { - "value": "ms_MY", - "name": "MS_MY", - "description": "Malay (Malaysia)" - }, - { - "value": "ru_RU", - "name": "RU_RU", - "description": "Russian (Russia)" - }, - { - "value": "th_TH", - "name": "TH_TH", - "description": "Thai (Thailand)" - }, - { - "value": "hi_IN", - "name": "HI_IN", - "description": "Hindi (India)" - }, - { - "value": "bn_BD", - "name": "BN_BD", - "description": "Bengali (Bangladesh)" - }, - { - "value": "fil_PH", - "name": "FIL_PH", - "description": "Filipino (Philippines)" - }, - { - "value": "ur_PK", - "name": "UR_PK", - "description": "Urdu (Pakistan)" - } - ] - } - }, + "x-domain": "Spot", + "x-api-channel": "Private", + "x-api-permission": "General", + "x-api-rate-limit-pool": "Spot", + "x-sdk-service": "Spot", + "x-sdk-sub-service": "Market", + "x-sdk-method-name": "getFullOrderBook", + "x-sdk-method-description": "Query for Full orderbook depth data. (aggregated by price) It is generally used by professional traders because it uses more server resources and traffic, and we have strict access rate limit control. To maintain up-to-date Order Book, please use Websocket incremental feed after retrieving the OrderBook.", + "x-api-rate-limit": 3, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"time\\\": 1729176273859,\\n \\\"sequence\\\": \\\"14610502970\\\",\\n \\\"bids\\\": [\\n [\\n \\\"66976.4\\\",\\n \\\"0.69109872\\\"\\n ],\\n [\\n \\\"66976.3\\\",\\n \\\"0.14377\\\"\\n ]\\n ],\\n \\\"asks\\\": [\\n [\\n \\\"66976.5\\\",\\n \\\"0.05408199\\\"\\n ],\\n [\\n \\\"66976.8\\\",\\n \\\"0.0005\\\"\\n ]\\n ]\\n }\\n}", + "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\"}" + } + }, + "/api/v1/prices": { + "get": { + "summary": "Get Fiat Price", + "deprecated": false, + "description": "Request via this endpoint to get the fiat price of the currencies for the available trading pairs.", + "tags": [], + "parameters": [ { - "name": "startTime", + "name": "base", "in": "query", - "description": "Announcement online start time (milliseconds)", + "description": "Ticker symbol of a base currency,eg.USD,EUR. Default is USD", "required": false, "schema": { - "type": "integer", - "format": "int64" + "type": "string", + "default": "USD", + "example": [ + "USD", + "EUR" + ] } }, { - "name": "endTime", + "name": "currencies", "in": "query", - "description": "Announcement online end time (milliseconds)", + "description": "Comma-separated cryptocurrencies to be converted into fiat, e.g.: BTC,ETH, etc. Default to return the fiat price of all currencies.", "required": false, "schema": { - "type": "integer", - "format": "int64" + "type": "string" } } ], @@ -4593,888 +2006,3593 @@ "data": { "type": "object", "properties": { - "totalNum": { - "type": "integer", - "description": "Total Number" + "AGLD": { + "type": "string" + }, + "DFI": { + "type": "string" + }, + "PYTHUP": { + "type": "string" + }, + "ISLM": { + "type": "string" + }, + "NEAR": { + "type": "string" + }, + "AIOZ": { + "type": "string" + }, + "AUDIO": { + "type": "string" + }, + "BBL": { + "type": "string" + }, + "WLD": { + "type": "string" + }, + "HNT": { + "type": "string" + }, + "ETHFI": { + "type": "string" + }, + "DMAIL": { + "type": "string" + }, + "OPUP": { + "type": "string" + }, + "VET3S": { + "type": "string" + }, + "MANA3S": { + "type": "string" + }, + "TIDAL": { + "type": "string" + }, + "HALO": { + "type": "string" + }, + "OPUL": { + "type": "string" + }, + "MANA3L": { + "type": "string" + }, + "DGB": { + "type": "string" + }, + "AA": { + "type": "string" + }, + "BCH": { + "type": "string" + }, + "GMEE": { + "type": "string" + }, + "JST": { + "type": "string" + }, + "PBUX": { + "type": "string" + }, + "AR": { + "type": "string" + }, + "SEI": { + "type": "string" + }, + "PSTAKE": { + "type": "string" + }, + "LMWR": { + "type": "string" + }, + "UNFIDOWN": { + "type": "string" + }, + "BB": { + "type": "string" + }, + "JTO": { + "type": "string" + }, + "WEMIX": { + "type": "string" + }, + "G": { + "type": "string" + }, + "MARSH": { + "type": "string" + }, + "BN": { + "type": "string" + }, + "FLIP": { + "type": "string" + }, + "FLR": { + "type": "string" + }, + "BIGTIME": { + "type": "string" + }, + "FLY": { + "type": "string" + }, + "T": { + "type": "string" + }, + "W": { + "type": "string" + }, + "BDX": { + "type": "string" + }, + "BABYDOGE": { + "type": "string" + }, + "SFP": { + "type": "string" + }, + "DIA": { + "type": "string" + }, + "ISME": { + "type": "string" + }, + "LYM": { + "type": "string" + }, + "VET3L": { + "type": "string" + }, + "JUP": { + "type": "string" + }, + "LYX": { + "type": "string" + }, + "AIEPK": { + "type": "string" + }, + "SILLY": { + "type": "string" + }, + "SCPT": { + "type": "string" + }, + "WOO": { + "type": "string" + }, + "BLUR": { + "type": "string" + }, + "STRK": { + "type": "string" + }, + "BFC": { + "type": "string" + }, + "DC": { + "type": "string" + }, + "KARATE": { + "type": "string" + }, + "SUSHI3L": { + "type": "string" + }, + "NETVR": { + "type": "string" + }, + "WAVES": { + "type": "string" + }, + "LITH": { + "type": "string" + }, + "HAPI": { + "type": "string" + }, + "SUSHI3S": { + "type": "string" + }, + "CEEK": { + "type": "string" + }, + "FLOKI": { + "type": "string" + }, + "SHR": { + "type": "string" + }, + "SAND": { + "type": "string" + }, + "TURT": { + "type": "string" + }, + "UMA": { + "type": "string" + }, + "BEPRO": { + "type": "string" + }, + "SCRT": { + "type": "string" + }, + "TUSD": { + "type": "string" + }, + "COOKIE": { + "type": "string" + }, + "LRDS": { + "type": "string" + }, + "SIN": { + "type": "string" + }, + "OAS": { + "type": "string" + }, + "ROOT": { + "type": "string" + }, + "ADA3L": { + "type": "string" + }, + "TIAUP": { + "type": "string" + }, + "HTR": { + "type": "string" + }, + "UNB": { + "type": "string" + }, + "UNA": { + "type": "string" + }, + "HARD": { + "type": "string" + }, + "G3": { + "type": "string" + }, + "ADA3S": { + "type": "string" + }, + "MYRO": { + "type": "string" + }, + "HTX": { + "type": "string" + }, + "FT": { + "type": "string" + }, + "BTCDOWN": { + "type": "string" + }, + "UNI": { + "type": "string" + }, + "FX": { + "type": "string" + }, + "OBI": { + "type": "string" + }, + "UNO": { + "type": "string" + }, + "WRX": { + "type": "string" + }, + "TIADOWN": { + "type": "string" + }, + "ETHDOWN": { + "type": "string" + }, + "WELL": { + "type": "string" + }, + "SWFTC": { + "type": "string" + }, + "SKL": { + "type": "string" + }, + "UOS": { + "type": "string" + }, + "AIPAD": { + "type": "string" + }, + "BRETT": { + "type": "string" + }, + "SKY": { + "type": "string" + }, + "FRM": { + "type": "string" + }, + "VISION": { + "type": "string" + }, + "LENDS": { + "type": "string" + }, + "SLF": { + "type": "string" + }, + "BULL": { + "type": "string" + }, + "FLOW": { + "type": "string" + }, + "ODDZ": { + "type": "string" + }, + "SLN": { + "type": "string" + }, + "UPO": { + "type": "string" + }, + "SLP": { + "type": "string" + }, + "ID": { + "type": "string" + }, + "SLIM": { + "type": "string" + }, + "SPOT": { + "type": "string" + }, + "DOP": { + "type": "string" + }, + "ISSP": { + "type": "string" + }, + "UQC": { + "type": "string" + }, + "IO": { + "type": "string" + }, + "DOT": { + "type": "string" + }, + "1INCH": { + "type": "string" + }, + "SMH": { + "type": "string" + }, + "MAK": { + "type": "string" + }, + "TOKO": { + "type": "string" + }, + "TURBO": { + "type": "string" + }, + "UNFI": { + "type": "string" + }, + "MAN": { + "type": "string" + }, + "EVER": { + "type": "string" + }, + "FTM": { + "type": "string" + }, + "SHRAP": { + "type": "string" + }, + "MAV": { + "type": "string" + }, + "MAX": { + "type": "string" + }, + "DPR": { + "type": "string" + }, + "FTT": { + "type": "string" + }, + "ARKM": { + "type": "string" + }, + "ATOM": { + "type": "string" + }, + "PENDLE": { + "type": "string" + }, + "QUICK": { + "type": "string" + }, + "BLZ": { + "type": "string" + }, + "BOBA": { + "type": "string" + }, + "MBL": { + "type": "string" + }, + "OFN": { + "type": "string" + }, + "UNIO": { + "type": "string" + }, + "SNS": { + "type": "string" + }, + "SNX": { + "type": "string" + }, + "NXRA": { + "type": "string" + }, + "TAIKO": { + "type": "string" + }, + "AVAX3L": { + "type": "string" + }, + "L3": { + "type": "string" + }, + "API3": { + "type": "string" + }, + "XRP3S": { + "type": "string" + }, + "QKC": { + "type": "string" + }, + "AVAX3S": { + "type": "string" + }, + "ROSE": { + "type": "string" + }, + "SATS": { + "type": "string" + }, + "BMX": { + "type": "string" + }, + "PORTAL": { + "type": "string" + }, + "TOMI": { + "type": "string" + }, + "XRP3L": { + "type": "string" + }, + "SOL": { + "type": "string" + }, + "SON": { + "type": "string" + }, + "BNC": { + "type": "string" + }, + "SOCIAL": { + "type": "string" + }, + "CGPT": { + "type": "string" + }, + "CELR": { + "type": "string" + }, + "BNB": { + "type": "string" + }, + "OGN": { + "type": "string" + }, + "CELO": { + "type": "string" + }, + "AUCTION": { + "type": "string" + }, + "MANTA": { + "type": "string" + }, + "LAYER": { + "type": "string" + }, + "AERO": { + "type": "string" + }, + "CETUS": { + "type": "string" + }, + "LL": { + "type": "string" + }, + "SPA": { + "type": "string" + }, + "PYTHDOWN": { + "type": "string" + }, + "NEIROCTO": { + "type": "string" + }, + "UTK": { + "type": "string" + }, + "GMRX": { + "type": "string" + }, + "BOB": { + "type": "string" + }, + "HOTCROSS": { + "type": "string" + }, + "AERGO": { + "type": "string" + }, + "MOCA": { + "type": "string" + }, + "SQD": { + "type": "string" + }, + "MV": { + "type": "string" + }, + "BNB3L": { + "type": "string" + }, + "BNB3S": { + "type": "string" + }, + "GALAX3L": { + "type": "string" + }, + "KAI": { + "type": "string" + }, + "SQR": { + "type": "string" + }, + "GALAX3S": { + "type": "string" + }, + "EGLD": { + "type": "string" + }, + "ZBCN": { + "type": "string" + }, + "KAS": { + "type": "string" + }, + "MEW": { + "type": "string" + }, + "PUNDIX": { + "type": "string" + }, + "LOOKS": { + "type": "string" + }, + "FXS": { + "type": "string" + }, + "BOSON": { + "type": "string" + }, + "BRISE": { + "type": "string" + }, + "AEVO": { + "type": "string" + }, + "FLUX": { + "type": "string" + }, + "PRCL": { + "type": "string" + }, + "UNFIUP": { + "type": "string" + }, + "SEIDOWN": { + "type": "string" + }, + "DOAI": { + "type": "string" + }, + "QNT": { + "type": "string" + }, + "REDO": { + "type": "string" + }, + "STRIKE": { + "type": "string" + }, + "ETHW": { + "type": "string" + }, + "OM": { + "type": "string" + }, + "OP": { + "type": "string" + }, + "WHALE": { + "type": "string" + }, + "1CAT": { + "type": "string" + }, + "NEON": { + "type": "string" + }, + "GTAI": { + "type": "string" + }, + "SSV": { + "type": "string" + }, + "ETH2": { + "type": "string" + }, + "KCS": { + "type": "string" + }, + "ARPA": { + "type": "string" + }, + "ARTFI": { + "type": "string" + }, + "BRL": { + "type": "string" + }, + "ALEX": { + "type": "string" + }, + "STG": { + "type": "string" + }, + "SHIB": { + "type": "string" + }, + "IOTX": { + "type": "string" + }, + "OLE": { + "type": "string" + }, + "KDA": { + "type": "string" + }, + "CERE": { + "type": "string" + }, + "DOCK": { + "type": "string" + }, + "STX": { + "type": "string" + }, + "OLT": { + "type": "string" + }, + "QI": { + "type": "string" + }, + "SDAO": { + "type": "string" + }, + "BLAST": { + "type": "string" + }, + "LINK3S": { + "type": "string" + }, + "IOST": { + "type": "string" + }, + "SUI": { + "type": "string" + }, + "CAKE": { + "type": "string" + }, + "BSW": { + "type": "string" + }, + "OMG": { + "type": "string" + }, + "VOLT": { + "type": "string" + }, + "LINK3L": { + "type": "string" + }, + "GEEQ": { + "type": "string" + }, + "PYUSD": { + "type": "string" + }, + "SUN": { + "type": "string" + }, + "TOWER": { + "type": "string" + }, + "BTC": { + "type": "string" + }, + "IOTA": { + "type": "string" + }, + "REEF": { + "type": "string" + }, + "TRIAS": { + "type": "string" + }, + "KEY": { + "type": "string" + }, + "ETH3L": { + "type": "string" + }, + "BTT": { + "type": "string" + }, + "ONE": { + "type": "string" + }, + "RENDER": { + "type": "string" + }, + "ETH3S": { + "type": "string" + }, + "ANKR": { + "type": "string" + }, + "ALGO": { + "type": "string" + }, + "SYLO": { + "type": "string" + }, + "ZCX": { + "type": "string" + }, + "SD": { + "type": "string" + }, + "ONT": { + "type": "string" + }, + "MJT": { + "type": "string" + }, + "DYM": { + "type": "string" + }, + "DYP": { + "type": "string" + }, + "BAKEUP": { + "type": "string" + }, + "OOE": { + "type": "string" + }, + "ZELIX": { + "type": "string" + }, + "DOGE3L": { + "type": "string" + }, + "ARTY": { + "type": "string" + }, + "QORPO": { + "type": "string" + }, + "ICE": { + "type": "string" + }, + "NOTAI": { + "type": "string" + }, + "DOGE3S": { + "type": "string" + }, + "NAKA": { + "type": "string" + }, + "GALAX": { + "type": "string" + }, + "MKR": { + "type": "string" + }, + "DODO": { + "type": "string" + }, + "ICP": { + "type": "string" + }, + "ZEC": { + "type": "string" + }, + "ZEE": { + "type": "string" + }, + "ICX": { + "type": "string" + }, + "KMNO": { + "type": "string" + }, + "TT": { + "type": "string" + }, + "DOT3L": { + "type": "string" + }, + "XAI": { + "type": "string" + }, + "ZEN": { + "type": "string" + }, + "DOGE": { + "type": "string" + }, + "ALPHA": { + "type": "string" + }, + "DUSK": { + "type": "string" + }, + "DOT3S": { + "type": "string" + }, + "SXP": { + "type": "string" + }, + "HBAR": { + "type": "string" + }, + "SYNT": { + "type": "string" + }, + "ZEX": { + "type": "string" + }, + "BONDLY": { + "type": "string" + }, + "MLK": { + "type": "string" + }, + "KICKS": { + "type": "string" + }, + "PEPE": { + "type": "string" + }, + "OUSD": { + "type": "string" + }, + "LUNCDOWN": { + "type": "string" + }, + "DOGS": { + "type": "string" + }, + "REV3L": { + "type": "string" + }, + "CTSI": { + "type": "string" + }, + "C98": { + "type": "string" + }, + "OSMO": { + "type": "string" + }, + "NTRN": { + "type": "string" + }, + "CFX2S": { + "type": "string" + }, + "SYN": { + "type": "string" + }, + "VIDT": { + "type": "string" + }, + "SYS": { + "type": "string" + }, + "GAS": { + "type": "string" + }, + "BOME": { + "type": "string" + }, + "COMBO": { + "type": "string" + }, + "XCH": { + "type": "string" + }, + "VR": { + "type": "string" + }, + "CFX2L": { + "type": "string" + }, + "VSYS": { + "type": "string" + }, + "PANDORA": { + "type": "string" + }, + "THETA": { + "type": "string" + }, + "XCN": { + "type": "string" + }, + "NEXG": { + "type": "string" + }, + "MELOS": { + "type": "string" + }, + "XCV": { + "type": "string" + }, + "ORN": { + "type": "string" + }, + "WLKN": { + "type": "string" + }, + "AAVE": { + "type": "string" + }, + "MNT": { + "type": "string" + }, + "BONK": { + "type": "string" + }, + "PERP": { + "type": "string" + }, + "XDC": { + "type": "string" + }, + "MNW": { + "type": "string" + }, + "XDB": { + "type": "string" + }, + "BOND": { + "type": "string" + }, + "SUIA": { + "type": "string" + }, + "MOG": { + "type": "string" + }, + "SUTER": { + "type": "string" + }, + "TIME": { + "type": "string" + }, + "RACA": { + "type": "string" + }, + "BICO": { + "type": "string" + }, + "MON": { + "type": "string" + }, + "SWEAT": { + "type": "string" + }, + "MOXIE": { + "type": "string" + }, + "BABYBNB": { + "type": "string" + }, + "IGU": { + "type": "string" + }, + "HMSTR": { + "type": "string" + }, + "XEC": { + "type": "string" + }, + "MONI": { + "type": "string" + }, + "XR": { + "type": "string" + }, + "PEOPLE": { + "type": "string" + }, + "PUMLX": { + "type": "string" + }, + "ZIL": { + "type": "string" + }, + "WLDDOWN": { + "type": "string" + }, + "VAI": { + "type": "string" + }, + "XEN": { + "type": "string" + }, + "MPC": { + "type": "string" + }, + "XEM": { + "type": "string" + }, + "JASMY3S": { + "type": "string" + }, + "OTK": { + "type": "string" + }, + "TRAC": { + "type": "string" + }, + "DFYN": { + "type": "string" + }, + "BIDP": { + "type": "string" + }, + "JASMY3L": { + "type": "string" + }, + "INJDOWN": { + "type": "string" + }, + "KLV": { + "type": "string" + }, + "WAXL": { + "type": "string" + }, + "TRBDOWN": { + "type": "string" + }, + "BCH3L": { + "type": "string" + }, + "GMT3S": { + "type": "string" + }, + "KMD": { + "type": "string" + }, + "BCH3S": { + "type": "string" + }, + "ECOX": { + "type": "string" + }, + "AAVE3S": { + "type": "string" + }, + "GMT3L": { + "type": "string" + }, + "EPIK": { + "type": "string" + }, + "SUIP": { + "type": "string" + }, + "AAVE3L": { + "type": "string" + }, + "ZK": { + "type": "string" + }, + "ZKF": { + "type": "string" + }, + "OMNIA": { + "type": "string" + }, + "ZKJ": { + "type": "string" + }, + "ZKL": { + "type": "string" + }, + "GAFI": { + "type": "string" + }, + "CARV": { + "type": "string" + }, + "KNC": { + "type": "string" + }, + "CATS": { + "type": "string" + }, + "PROM": { + "type": "string" + }, + "ALEPH": { + "type": "string" + }, + "PONKE": { + "type": "string" + }, + "OVR": { + "type": "string" + }, + "CATI": { + "type": "string" + }, + "ORDER": { + "type": "string" + }, + "GFT": { + "type": "string" + }, + "BIFI": { + "type": "string" + }, + "GGC": { + "type": "string" + }, + "GGG": { + "type": "string" + }, + "DAPPX": { + "type": "string" + }, + "SUKU": { + "type": "string" + }, + "ULTI": { + "type": "string" + }, + "CREDI": { + "type": "string" + }, + "ERTHA": { + "type": "string" + }, + "FURY": { + "type": "string" + }, + "KARRAT": { + "type": "string" + }, + "MOBILE": { + "type": "string" + }, + "SIDUS": { + "type": "string" + }, + "NAVI": { + "type": "string" + }, + "TAO": { + "type": "string" + }, + "USDJ": { + "type": "string" + }, + "MTL": { + "type": "string" + }, + "VET": { + "type": "string" + }, + "FITFI": { + "type": "string" + }, + "USDT": { + "type": "string" + }, + "OXT": { + "type": "string" + }, + "CANDY": { + "type": "string" + }, + "USDP": { + "type": "string" + }, + "MTS": { + "type": "string" + }, + "TADA": { + "type": "string" + }, + "MTV": { + "type": "string" + }, + "NAVX": { + "type": "string" + }, + "ILV": { + "type": "string" + }, + "VINU": { + "type": "string" + }, + "GHX": { + "type": "string" + }, + "EDU": { + "type": "string" + }, + "HYVE": { + "type": "string" + }, + "BTC3L": { + "type": "string" + }, + "ANYONE": { + "type": "string" + }, + "BEAT": { + "type": "string" + }, + "KING": { + "type": "string" + }, + "CREAM": { + "type": "string" + }, + "CAS": { + "type": "string" + }, + "IMX": { + "type": "string" + }, + "CAT": { + "type": "string" + }, + "BTC3S": { + "type": "string" + }, + "USDE": { + "type": "string" + }, + "USDD": { + "type": "string" + }, + "CWAR": { + "type": "string" + }, + "USDC": { + "type": "string" + }, + "KRL": { + "type": "string" + }, + "INJ": { + "type": "string" + }, + "GAME": { + "type": "string" + }, + "TRIBL": { + "type": "string" + }, + "XLM": { + "type": "string" + }, + "TRBUP": { + "type": "string" + }, + "VRADOWN": { + "type": "string" + }, + "SUPER": { + "type": "string" + }, + "EIGEN": { + "type": "string" + }, + "IOI": { + "type": "string" + }, + "KSM": { + "type": "string" + }, + "CCD": { + "type": "string" + }, + "EGO": { + "type": "string" + }, + "EGP": { + "type": "string" + }, + "MXC": { + "type": "string" + }, + "TEL": { + "type": "string" + }, + "MOVR": { + "type": "string" + }, + "XMR": { + "type": "string" + }, + "MXM": { + "type": "string" + }, + "OORT": { + "type": "string" + }, + "GLM": { + "type": "string" + }, + "RAY": { + "type": "string" + }, + "XTAG": { + "type": "string" + }, + "GLQ": { + "type": "string" + }, + "CWEB": { + "type": "string" + }, + "REVU": { + "type": "string" + }, + "REVV": { + "type": "string" + }, + "ZRO": { + "type": "string" + }, + "XNL": { + "type": "string" + }, + "XNO": { + "type": "string" + }, + "SAROS": { + "type": "string" + }, + "KACE": { + "type": "string" + }, + "ZRX": { + "type": "string" + }, + "WLTH": { + "type": "string" + }, + "ATOM3L": { + "type": "string" + }, + "GMM": { + "type": "string" + }, + "BEER": { + "type": "string" + }, + "GMT": { + "type": "string" + }, + "HEART": { + "type": "string" + }, + "GMX": { + "type": "string" + }, + "ABBC": { + "type": "string" + }, + "OMNI": { + "type": "string" + }, + "ATOM3S": { + "type": "string" + }, + "IRL": { + "type": "string" + }, + "CFG": { + "type": "string" + }, + "WSDM": { + "type": "string" + }, + "GNS": { + "type": "string" + }, + "VANRY": { + "type": "string" + }, + "CFX": { + "type": "string" + }, + "GRAIL": { + "type": "string" + }, + "BEFI": { + "type": "string" + }, + "VELO": { + "type": "string" + }, + "XPR": { + "type": "string" + }, + "DOVI": { + "type": "string" + }, + "ACE": { + "type": "string" + }, + "ACH": { + "type": "string" + }, + "ISP": { + "type": "string" + }, + "XCAD": { + "type": "string" + }, + "MINA": { + "type": "string" + }, + "TIA": { + "type": "string" + }, + "DRIFT": { + "type": "string" + }, + "ACQ": { + "type": "string" + }, + "ACS": { + "type": "string" + }, + "MIND": { + "type": "string" + }, + "STORE": { + "type": "string" + }, + "REN": { + "type": "string" + }, + "ELA": { + "type": "string" + }, + "DREAMS": { + "type": "string" + }, + "ADA": { + "type": "string" + }, + "ELF": { + "type": "string" + }, + "REQ": { + "type": "string" + }, + "STORJ": { + "type": "string" + }, + "LADYS": { + "type": "string" + }, + "PAXG": { + "type": "string" + }, + "REZ": { + "type": "string" + }, + "XRD": { + "type": "string" + }, + "CHO": { + "type": "string" + }, + "CHR": { + "type": "string" + }, + "ADS": { + "type": "string" + }, + "CHZ": { + "type": "string" + }, + "ADX": { + "type": "string" + }, + "XRP": { + "type": "string" + }, + "JASMY": { + "type": "string" + }, + "KAGI": { + "type": "string" + }, + "FIDA": { + "type": "string" + }, + "PBR": { + "type": "string" + }, + "AEG": { + "type": "string" + }, + "H2O": { + "type": "string" + }, + "CHMB": { + "type": "string" + }, + "SAND3L": { + "type": "string" + }, + "PBX": { + "type": "string" + }, + "SOLVE": { + "type": "string" + }, + "DECHAT": { + "type": "string" + }, + "GARI": { + "type": "string" + }, + "SHIB2L": { + "type": "string" + }, + "SHIB2S": { + "type": "string" + }, + "ENA": { + "type": "string" + }, + "VEMP": { + "type": "string" + }, + "ENJ": { + "type": "string" + }, + "AFG": { + "type": "string" + }, + "RATS": { + "type": "string" + }, + "GRT": { + "type": "string" + }, + "FORWARD": { + "type": "string" + }, + "TFUEL": { + "type": "string" + }, + "ENS": { + "type": "string" + }, + "KASDOWN": { + "type": "string" + }, + "XTM": { + "type": "string" + }, + "DEGEN": { + "type": "string" + }, + "TLM": { + "type": "string" + }, + "DYDXDOWN": { + "type": "string" + }, + "CKB": { + "type": "string" + }, + "LUNC": { + "type": "string" + }, + "AURORA": { + "type": "string" + }, + "LUNA": { + "type": "string" + }, + "XTZ": { + "type": "string" + }, + "ELON": { + "type": "string" + }, + "DMTR": { + "type": "string" + }, + "EOS": { + "type": "string" + }, + "GST": { + "type": "string" + }, + "FORT": { + "type": "string" + }, + "FLAME": { + "type": "string" + }, + "PATEX": { + "type": "string" + }, + "DEEP": { + "type": "string" + }, + "ID3L": { + "type": "string" + }, + "GTC": { + "type": "string" + }, + "ID3S": { + "type": "string" + }, + "RIO": { + "type": "string" + }, + "CLH": { + "type": "string" + }, + "BURGER": { + "type": "string" + }, + "VRA": { + "type": "string" + }, + "SUNDOG": { + "type": "string" + }, + "GTT": { + "type": "string" + }, + "INJUP": { + "type": "string" + }, + "CPOOL": { + "type": "string" + }, + "EPX": { + "type": "string" + }, + "CLV": { + "type": "string" + }, + "FEAR": { + "type": "string" + }, + "MEME": { + "type": "string" + }, + "ROOBEE": { + "type": "string" + }, + "DEFI": { + "type": "string" + }, + "TOKEN": { + "type": "string" + }, + "GRAPE": { + "type": "string" + }, + "KASUP": { + "type": "string" + }, + "XWG": { + "type": "string" + }, + "SKEY": { + "type": "string" + }, + "SFUND": { + "type": "string" + }, + "EQX": { + "type": "string" + }, + "ORDIUP": { + "type": "string" + }, + "TON": { + "type": "string" + }, + "DEGO": { + "type": "string" + }, + "IZI": { + "type": "string" + }, + "ERG": { + "type": "string" + }, + "ERN": { + "type": "string" + }, + "VENOM": { + "type": "string" + }, + "VOXEL": { + "type": "string" + }, + "RLC": { + "type": "string" + }, + "PHA": { + "type": "string" + }, + "DYDXUP": { + "type": "string" + }, + "APE3S": { + "type": "string" + }, + "ORBS": { + "type": "string" + }, + "OPDOWN": { + "type": "string" + }, + "ESE": { + "type": "string" + }, + "APE3L": { + "type": "string" + }, + "HMND": { + "type": "string" + }, + "COQ": { + "type": "string" + }, + "AURY": { + "type": "string" + }, + "CULT": { + "type": "string" + }, + "AKT": { + "type": "string" + }, + "GLMR": { + "type": "string" + }, + "XYM": { + "type": "string" + }, + "ORAI": { + "type": "string" + }, + "XYO": { + "type": "string" + }, + "ETC": { + "type": "string" + }, + "LAI": { + "type": "string" + }, + "PIP": { + "type": "string" + }, + "ETH": { + "type": "string" + }, + "NEO": { + "type": "string" + }, + "RMV": { + "type": "string" + }, + "KLAY": { + "type": "string" + }, + "PIT": { + "type": "string" + }, + "TARA": { + "type": "string" + }, + "KALT": { + "type": "string" + }, + "PIX": { + "type": "string" + }, + "ETN": { + "type": "string" + }, + "CSIX": { + "type": "string" + }, + "TRADE": { + "type": "string" + }, + "MAVIA": { + "type": "string" + }, + "HIGH": { + "type": "string" + }, + "TRB": { + "type": "string" + }, + "ORDI": { + "type": "string" + }, + "TRVL": { + "type": "string" + }, + "AMB": { + "type": "string" + }, + "TRU": { + "type": "string" + }, + "LOGX": { + "type": "string" + }, + "FINC": { + "type": "string" + }, + "INFRA": { + "type": "string" + }, + "NATIX": { + "type": "string" + }, + "NFP": { + "type": "string" + }, + "TRY": { + "type": "string" + }, + "TRX": { + "type": "string" + }, + "LBP": { + "type": "string" + }, + "LBR": { + "type": "string" + }, + "EUL": { + "type": "string" + }, + "NFT": { + "type": "string" + }, + "SEIUP": { + "type": "string" + }, + "PUFFER": { + "type": "string" + }, + "EUR": { + "type": "string" + }, + "ORCA": { + "type": "string" + }, + "NEAR3L": { + "type": "string" + }, + "AMP": { + "type": "string" + }, + "XDEFI": { + "type": "string" + }, + "HIFI": { + "type": "string" + }, + "TRUF": { + "type": "string" + }, + "AITECH": { + "type": "string" + }, + "AMU": { + "type": "string" + }, + "USTC": { + "type": "string" + }, + "KNGL": { + "type": "string" + }, + "FOXY": { + "type": "string" + }, + "NGC": { + "type": "string" + }, + "TENET": { + "type": "string" + }, + "NEAR3S": { + "type": "string" + }, + "MAHA": { + "type": "string" + }, + "NGL": { + "type": "string" + }, + "TST": { + "type": "string" + }, + "HIPPO": { + "type": "string" + }, + "AXS3S": { + "type": "string" + }, + "CRO": { + "type": "string" }, - "items": { - "type": "array", - "items": { - "type": "object", - "properties": { - "annId": { - "type": "integer", - "description": "Announcement ID" - }, - "annTitle": { - "type": "string", - "description": "Announcement title" - }, - "annType": { - "type": "array", - "items": { - "type": "string" - }, - "description": "Announcement type" - }, - "annDesc": { - "type": "string", - "description": "Announcement description" - }, - "cTime": { - "type": "integer", - "description": "Announcement release time, Unix millisecond timestamp format", - "format": "int64" - }, - "language": { - "type": "string", - "description": "language type" - }, - "annUrl": { - "type": "string", - "description": "Announcement link" - } - }, - "required": [ - "annId", - "annTitle", - "annType", - "annDesc", - "cTime", - "language", - "annUrl" - ] - } + "ZPAY": { + "type": "string" + }, + "MNDE": { + "type": "string" + }, + "CRV": { + "type": "string" + }, + "SWASH": { + "type": "string" + }, + "AXS3L": { + "type": "string" + }, + "VERSE": { + "type": "string" + }, + "RPK": { + "type": "string" + }, + "RPL": { + "type": "string" + }, + "AZERO": { + "type": "string" + }, + "SOUL": { + "type": "string" + }, + "VXV": { + "type": "string" + }, + "LDO": { + "type": "string" + }, + "MAGIC": { + "type": "string" + }, + "ALICE": { + "type": "string" + }, + "SEAM": { + "type": "string" + }, + "PLU": { + "type": "string" + }, + "AOG": { + "type": "string" + }, + "SMOLE": { + "type": "string" + }, + "EWT": { + "type": "string" + }, + "TSUGT": { + "type": "string" + }, + "PMG": { + "type": "string" + }, + "OPAI": { + "type": "string" + }, + "LOCUS": { + "type": "string" + }, + "CTA": { + "type": "string" + }, + "NIM": { + "type": "string" + }, + "CTC": { + "type": "string" + }, + "APE": { + "type": "string" + }, + "MERL": { + "type": "string" + }, + "JAM": { + "type": "string" + }, + "CTI": { + "type": "string" + }, + "APP": { + "type": "string" + }, + "APT": { + "type": "string" + }, + "WLDUP": { + "type": "string" + }, + "ZEND": { + "type": "string" + }, + "FIRE": { + "type": "string" + }, + "DENT": { + "type": "string" + }, + "PYTH": { + "type": "string" + }, + "LFT": { + "type": "string" + }, + "DPET": { + "type": "string" + }, + "ORDIDOWN": { + "type": "string" + }, + "KPOL": { + "type": "string" + }, + "ETHUP": { + "type": "string" + }, + "BAND": { + "type": "string" + }, + "POL": { + "type": "string" + }, + "ASTR": { + "type": "string" + }, + "NKN": { + "type": "string" + }, + "RSR": { + "type": "string" + }, + "DVPN": { + "type": "string" + }, + "TWT": { + "type": "string" + }, + "ARB": { + "type": "string" + }, + "CVC": { + "type": "string" + }, + "ARC": { + "type": "string" + }, + "XETA": { + "type": "string" + }, + "MTRG": { + "type": "string" + }, + "LOKA": { + "type": "string" + }, + "LPOOL": { + "type": "string" + }, + "TURBOS": { + "type": "string" + }, + "CVX": { + "type": "string" + }, + "ARX": { + "type": "string" + }, + "MPLX": { + "type": "string" + }, + "SUSHI": { + "type": "string" + }, + "NLK": { + "type": "string" + }, + "PEPE2": { + "type": "string" + }, + "WBTC": { + "type": "string" + }, + "SUI3L": { + "type": "string" + }, + "CWS": { + "type": "string" + }, + "SUI3S": { + "type": "string" + }, + "INSP": { + "type": "string" + }, + "MANA": { + "type": "string" + }, + "VRTX": { + "type": "string" }, - "currentPage": { - "type": "integer", - "description": "Current page" + "CSPR": { + "type": "string" }, - "pageSize": { - "type": "integer", - "description": "Page size" + "ATA": { + "type": "string" }, - "totalPage": { - "type": "integer", - "description": "Total Page" - } - }, - "required": [ - "totalNum", - "items", - "currentPage", - "pageSize", - "totalPage" - ] - } - }, - "required": [ - "code", - "data" - ] - } - } - } - } - }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470157", - "x-abandon": "normal", - "x-domain": "Spot", - "x-api-channel": "Public", - "x-api-permission": "NULL", - "x-api-rate-limit-pool": "Public", - "x-sdk-service": "Spot", - "x-sdk-sub-service": "Market", - "x-sdk-method-name": "getAnnouncements", - "x-sdk-method-description": "This interface can obtain the latest news announcements, and the default page search is for announcements within a month.", - "x-api-rate-limit": 20, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"totalNum\\\": 195,\\n \\\"totalPage\\\": 13,\\n \\\"currentPage\\\": 1,\\n \\\"pageSize\\\": 15,\\n \\\"items\\\": [\\n {\\n \\\"annId\\\": 129045,\\n \\\"annTitle\\\": \\\"KuCoin Isolated Margin Adds the Scroll (SCR) Trading Pair\\\",\\n \\\"annType\\\": [\\n \\\"latest-announcements\\\"\\n ],\\n \\\"annDesc\\\": \\\"To enrich the variety of assets available,\\xa0KuCoin\\u2019s Isolated Margin Trading platform has added the Scroll (SCR)\\xa0asset and trading pair.\\\",\\n \\\"cTime\\\": 1729594043000,\\n \\\"language\\\": \\\"en_US\\\",\\n \\\"annUrl\\\": \\\"https://www.kucoin.com/announcement/kucoin-isolated-margin-adds-scr?lang=en_US\\\"\\n },\\n {\\n \\\"annId\\\": 129001,\\n \\\"annTitle\\\": \\\"DAPP-30D Fixed Promotion, Enjoy an APR of 200%!\\u200b\\\",\\n \\\"annType\\\": [\\n \\\"latest-announcements\\\",\\n \\\"activities\\\"\\n ],\\n \\\"annDesc\\\": \\\"KuCoin Earn will be launching the DAPP Fixed Promotion at 10:00:00 on October 22, 2024 (UTC). The available product is \\u201cDAPP-30D'' with an APR of 200%.\\\",\\n \\\"cTime\\\": 1729588460000,\\n \\\"language\\\": \\\"en_US\\\",\\n \\\"annUrl\\\": \\\"https://www.kucoin.com/announcement/dapp-30d-fixed-promotion-enjoy?lang=en_US\\\"\\n },\\n {\\n \\\"annId\\\": 128581,\\n \\\"annTitle\\\": \\\"NAYM (NAYM) Gets Listed on KuCoin! World Premiere!\\\",\\n \\\"annType\\\": [\\n \\\"latest-announcements\\\",\\n \\\"new-listings\\\"\\n ],\\n \\\"annDesc\\\": \\\"Trading:\\xa011:00 on October 22, 2024 (UTC)\\\",\\n \\\"cTime\\\": 1729497729000,\\n \\\"language\\\": \\\"en_US\\\",\\n \\\"annUrl\\\": \\\"https://www.kucoin.com/announcement/en-naym-naym-gets-listed-on-kucoin-world-premiere?lang=en_US\\\"\\n }\\n ]\\n }\\n}", - "x-request-example": "{\\\"currentPage\\\": 1, \\\"pageSize\\\": 50, \\\"annType\\\": \\\"latest-announcements\\\", \\\"lang\\\": \\\"en_US\\\", \\\"startTime\\\": 1729594043000, \\\"endTime\\\": 1729697729000}" - } - }, - "/api/v1/status": { - "get": { - "summary": "Get Service Status", - "deprecated": false, - "description": "Get the service status", - "tags": [], - "parameters": [], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "data": { - "type": "object", - "properties": { - "status": { - "type": "string", - "description": "Status of service: open:normal transaction, close:Stop Trading/Maintenance, cancelonly:can only cancel the order but not place order", - "enum": [ - "open", - "close", - "cancelonly" - ], - "x-api-enum": [ - { - "value": "open", - "name": "OPEN", - "description": "normal transaction" - }, - { - "value": "close", - "name": "CLOSE", - "description": "Stop Trading/Maintenance" - }, - { - "value": "cancelonly", - "name": "CANCELONLY", - "description": "can only cancel the order but not place order" - } - ] + "OPEN": { + "type": "string" }, - "msg": { - "type": "string", - "description": "Remark for operation" - } - }, - "required": [ - "status", - "msg" - ] - } - }, - "required": [ - "code", - "data" - ] - } - } - } - } - }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470158", - "x-abandon": "normal", - "x-domain": "Spot", - "x-api-channel": "Public", - "x-api-permission": "NULL", - "x-api-rate-limit-pool": "Public", - "x-sdk-service": "Spot", - "x-sdk-sub-service": "Market", - "x-sdk-method-name": "getServiceStatus", - "x-sdk-method-description": "Get the service status", - "x-api-rate-limit": 3, - "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"status\\\":\\\"open\\\",\\\"msg\\\":\\\"\\\"}}" - } - }, - "/api/v2/symbols/{symbol}": { - "get": { - "summary": "Get Symbol ", - "deprecated": false, - "description": "Request via this endpoint to get detail currency pairs for trading. If you want to get the market information of the trading symbol, please use Get All Tickers.", - "tags": [], - "parameters": [ - { - "name": "symbol", - "in": "path", - "description": "Path parameter, Symbol", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "data": { - "type": "object", - "properties": { - "symbol": { - "type": "string", - "description": "unique code of a symbol, it would not change after renaming", - "example": [ - "BTC-USDT", - "BCHSV-USDT" - ] + "HAI": { + "type": "string" }, - "name": { - "type": "string", - "description": "Name of trading pairs, it would change after renaming", - "example": [ - "BTC-USDT", - "BSV-USDT" - ] + "NMR": { + "type": "string" }, - "baseCurrency": { - "type": "string", - "description": "Base currency,e.g. BTC." + "ATH": { + "type": "string" }, - "quoteCurrency": { - "type": "string", - "description": "Quote currency,e.g. USDT." + "LIT": { + "type": "string" }, - "feeCurrency": { - "type": "string", - "description": "The currency of charged fees." + "TLOS": { + "type": "string" }, - "market": { - "type": "string", - "description": "The trading market.", - "example": [ - "USDS", - "BTC", - "ALTS" - ] + "TNSR": { + "type": "string" }, - "baseMinSize": { - "type": "string", - "description": "The minimum order quantity requried to place an order." + "CXT": { + "type": "string" }, - "quoteMinSize": { - "type": "string", - "description": "The minimum order funds required to place a market order." + "POLYX": { + "type": "string" }, - "baseMaxSize": { - "type": "string", - "description": "The maximum order size required to place an order." + "ZERO": { + "type": "string" }, - "quoteMaxSize": { - "type": "string", - "description": "The maximum order funds required to place a market order." + "ROUTE": { + "type": "string" }, - "baseIncrement": { - "type": "string", - "description": "Quantity increment: The quantity for an order must be a positive integer multiple of this increment. Here, the size refers to the quantity of the base currency for the order. For example, for the ETH-USDT trading pair, if the baseIncrement is 0.0000001, the order quantity can be 1.0000001 but not 1.00000001." + "LOOM": { + "type": "string" }, - "quoteIncrement": { - "type": "string", - "description": "Quote increment: The funds for a market order must be a positive integer multiple of this increment. The funds refer to the quote currency amount. For example, for the ETH-USDT trading pair, if the quoteIncrement is 0.000001, the amount of USDT for the order can be 3000.000001 but not 3000.0000001." + "PRE": { + "type": "string" }, - "priceIncrement": { - "type": "string", - "description": "Price increment: The price of an order must be a positive integer multiple of this increment. For example, for the ETH-USDT trading pair, if the priceIncrement is 0.01, the order price can be 3000.01 but not 3000.001." + "VRAUP": { + "type": "string" + }, + "HBB": { + "type": "string" + }, + "RVN": { + "type": "string" + }, + "PRQ": { + "type": "string" + }, + "ONDO": { + "type": "string" + }, + "PEPEDOWN": { + "type": "string" + }, + "WOOP": { + "type": "string" }, - "priceLimitRate": { - "type": "string", - "description": "Threshold for price portection" + "LUNCUP": { + "type": "string" }, - "minFunds": { - "type": "string", - "description": "the minimum trading amounts" + "KAVA": { + "type": "string" }, - "isMarginEnabled": { - "type": "boolean", - "description": "Available for margin or not." + "LKI": { + "type": "string" }, - "enableTrading": { - "type": "boolean", - "description": "Available for transaction or not." + "AVA": { + "type": "string" }, - "feeCategory": { - "type": "integer", - "description": "[Fee Type](https://www.kucoin.com/vip/privilege)", - "enum": [ - 1, - 2, - 3 - ], - "x-api-enum": [ - { - "value": 1, - "name": "classA", - "description": "classA" - }, - { - "value": 2, - "name": "classB", - "description": "classB" - }, - { - "value": 3, - "name": "classC", - "description": "classC" - } - ] + "NOM": { + "type": "string" }, - "makerFeeCoefficient": { - "type": "string", - "description": "The maker fee coefficient. The actual fee needs to be multiplied by this coefficient to get the final fee. Most currencies have a coefficient of 1. If set to 0, it means no fee" + "MAPO": { + "type": "string" }, - "takerFeeCoefficient": { - "type": "string", - "description": "The taker fee coefficient. The actual fee needs to be multiplied by this coefficient to get the final fee. Most currencies have a coefficient of 1. If set to 0, it means no fee" + "PEPEUP": { + "type": "string" }, - "st": { - "type": "boolean" - } - }, - "required": [ - "symbol", - "name", - "baseCurrency", - "quoteCurrency", - "feeCurrency", - "market", - "baseMinSize", - "quoteMinSize", - "baseMaxSize", - "quoteMaxSize", - "baseIncrement", - "quoteIncrement", - "priceIncrement", - "priceLimitRate", - "minFunds", - "isMarginEnabled", - "enableTrading", - "feeCategory", - "makerFeeCoefficient", - "takerFeeCoefficient", - "st" - ] - } - }, - "required": [ - "code", - "data" - ] - } - } - } - } - }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470159", - "x-abandon": "normal", - "x-domain": "Spot", - "x-api-channel": "Public", - "x-api-permission": "NULL", - "x-api-rate-limit-pool": "Public", - "x-sdk-service": "Spot", - "x-sdk-sub-service": "Market", - "x-sdk-method-name": "getSymbol", - "x-sdk-method-description": "Request via this endpoint to get detail currency pairs for trading. If you want to get the market information of the trading symbol, please use Get All Tickers.", - "x-api-rate-limit": 4, - "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"symbol\\\":\\\"BTC-USDT\\\",\\\"name\\\":\\\"BTC-USDT\\\",\\\"baseCurrency\\\":\\\"BTC\\\",\\\"quoteCurrency\\\":\\\"USDT\\\",\\\"feeCurrency\\\":\\\"USDT\\\",\\\"market\\\":\\\"USDS\\\",\\\"baseMinSize\\\":\\\"0.00001\\\",\\\"quoteMinSize\\\":\\\"0.1\\\",\\\"baseMaxSize\\\":\\\"10000000000\\\",\\\"quoteMaxSize\\\":\\\"99999999\\\",\\\"baseIncrement\\\":\\\"0.00000001\\\",\\\"quoteIncrement\\\":\\\"0.000001\\\",\\\"priceIncrement\\\":\\\"0.1\\\",\\\"priceLimitRate\\\":\\\"0.1\\\",\\\"minFunds\\\":\\\"0.1\\\",\\\"isMarginEnabled\\\":true,\\\"enableTrading\\\":true,\\\"feeCategory\\\":1,\\\"makerFeeCoefficient\\\":\\\"1.00\\\",\\\"takerFeeCoefficient\\\":\\\"1.00\\\",\\\"st\\\":false}}", - "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\"}" - } - }, - "/api/v1/market/orderbook/level1": { - "get": { - "summary": "Get Ticker", - "deprecated": false, - "description": "Request via this endpoint to get Level 1 Market Data. The returned value includes the best bid price and size, the best ask price and size as well as the last traded price and the last traded size.", - "tags": [], - "parameters": [ - { - "name": "symbol", - "in": "query", - "description": "symbol", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "data": { - "type": "object", - "properties": { - "time": { - "type": "integer", - "description": "timestamp", - "format": "int64" + "STRAX": { + "type": "string" }, - "sequence": { - "type": "string", - "description": "Sequence" + "NOT": { + "type": "string" }, - "price": { - "type": "string", - "description": "Last traded price" + "ZERC": { + "type": "string" }, - "size": { - "type": "string", - "description": "Last traded size" + "BCUT": { + "type": "string" }, - "bestBid": { - "type": "string", - "description": "Best bid price" + "MASA": { + "type": "string" }, - "bestBidSize": { - "type": "string", - "description": "Best bid size" + "WAN": { + "type": "string" }, - "bestAsk": { - "type": "string", - "description": "Best ask price" + "WAT": { + "type": "string" }, - "bestAskSize": { - "type": "string", - "description": "Best ask size" - } - }, - "required": [ - "sequence", - "price", - "size", - "bestBid", - "bestBidSize", - "bestAsk", - "bestAskSize", - "time" - ] - } - }, - "required": [ - "code", - "data" - ] - } - } - } - } - }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470160", - "x-abandon": "normal", - "x-domain": "Spot", - "x-api-channel": "Public", - "x-api-permission": "NULL", - "x-api-rate-limit-pool": "Public", - "x-sdk-service": "Spot", - "x-sdk-sub-service": "Market", - "x-sdk-method-name": "getTicker", - "x-sdk-method-description": "Request via this endpoint to get Level 1 Market Data. The returned value includes the best bid price and size, the best ask price and size as well as the last traded price and the last traded size.", - "x-api-rate-limit": 2, - "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"time\\\":1729172965609,\\\"sequence\\\":\\\"14609309753\\\",\\\"price\\\":\\\"67269\\\",\\\"size\\\":\\\"0.000025\\\",\\\"bestBid\\\":\\\"67267.5\\\",\\\"bestBidSize\\\":\\\"0.000025\\\",\\\"bestAsk\\\":\\\"67267.6\\\",\\\"bestAskSize\\\":\\\"1.24808993\\\"}}", - "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\"}" - } - }, - "/api/v1/market/stats": { - "get": { - "summary": "Get 24hr Stats", - "deprecated": false, - "description": "Request via this endpoint to get the statistics of the specified ticker in the last 24 hours.", - "tags": [], - "parameters": [ - { - "name": "symbol", - "in": "query", - "description": "symbol", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "data": { - "type": "object", - "properties": { - "time": { - "type": "integer", - "description": "timestamp", - "format": "int64" + "WAX": { + "type": "string" }, - "symbol": { - "type": "string", - "description": "Symbol" + "MASK": { + "type": "string" }, - "buy": { - "type": "string", - "description": "Best bid price\n" + "EOS3L": { + "type": "string" }, - "sell": { - "type": "string", - "description": "Best ask price" + "IDEA": { + "type": "string" }, - "changeRate": { - "type": "string", - "description": "24h change rate" + "EOS3S": { + "type": "string" }, - "changePrice": { - "type": "string", - "description": "24h change price" + "YFI": { + "type": "string" }, - "high": { - "type": "string", - "description": "Highest price in 24h" + "MOODENG": { + "type": "string" }, - "low": { - "type": "string", - "description": "Lowest price in 24h" + "XCUR": { + "type": "string" }, - "vol": { - "type": "string", - "description": "24h volume, executed based on base currency" + "HYDRA": { + "type": "string" }, - "volValue": { - "type": "string", - "description": "24h traded amount" + "POPCAT": { + "type": "string" }, - "last": { - "type": "string", - "description": "Last traded price" + "LQTY": { + "type": "string" }, - "averagePrice": { - "type": "string", - "description": "Average trading price in the last 24 hours" + "PIXEL": { + "type": "string" }, - "takerFeeRate": { - "type": "string", - "description": "Basic Taker Fee" + "LMR": { + "type": "string" }, - "makerFeeRate": { - "type": "string", - "description": "Basic Maker Fee" + "ZETA": { + "type": "string" }, - "takerCoefficient": { - "type": "string", - "description": "The taker fee coefficient. The actual fee needs to be multiplied by this coefficient to get the final fee. Most currencies have a coefficient of 1. If set to 0, it means no fee" + "YGG": { + "type": "string" }, - "makerCoefficient": { - "type": "string", - "description": "The maker fee coefficient. The actual fee needs to be multiplied by this coefficient to get the final fee. Most currencies have a coefficient of 1. If set to 0, it means no fee" - } - }, - "required": [ - "time", - "symbol", - "buy", - "sell", - "changeRate", - "changePrice", - "high", - "low", - "vol", - "volValue", - "last", - "averagePrice", - "takerFeeRate", - "makerFeeRate", - "takerCoefficient", - "makerCoefficient" - ] - } - }, - "required": [ - "code", - "data" - ] - } - } - } - } - }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470161", - "x-abandon": "normal", - "x-domain": "Spot", - "x-api-channel": "Public", - "x-api-permission": "NULL", - "x-api-rate-limit-pool": "Public", - "x-sdk-service": "Spot", - "x-sdk-sub-service": "Market", - "x-sdk-method-name": "get24hrStats", - "x-sdk-method-description": "Request via this endpoint to get the statistics of the specified ticker in the last 24 hours.", - "x-api-rate-limit": 15, - "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"time\\\":1729175612158,\\\"symbol\\\":\\\"BTC-USDT\\\",\\\"buy\\\":\\\"66982.4\\\",\\\"sell\\\":\\\"66982.5\\\",\\\"changeRate\\\":\\\"-0.0114\\\",\\\"changePrice\\\":\\\"-778.1\\\",\\\"high\\\":\\\"68107.7\\\",\\\"low\\\":\\\"66683.3\\\",\\\"vol\\\":\\\"1738.02898182\\\",\\\"volValue\\\":\\\"117321982.415978333\\\",\\\"last\\\":\\\"66981.5\\\",\\\"averagePrice\\\":\\\"67281.21437289\\\",\\\"takerFeeRate\\\":\\\"0.001\\\",\\\"makerFeeRate\\\":\\\"0.001\\\",\\\"takerCoefficient\\\":\\\"1\\\",\\\"makerCoefficient\\\":\\\"1\\\"}}", - "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\"}" - } - }, - "/api/v1/market/histories": { - "get": { - "summary": "Get Trade History", - "deprecated": false, - "description": "Request via this endpoint to get the trade history of the specified symbol, the returned quantity is the last 100 transaction records.", - "tags": [], - "parameters": [ - { - "name": "symbol", - "in": "query", - "description": "symbol", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "data": { - "type": "array", - "items": { - "type": "object", - "properties": { - "sequence": { - "type": "string", - "description": "Sequence number" - }, - "price": { - "type": "string", - "description": "Filled price" - }, - "size": { - "type": "string", - "description": "Filled amount" - }, - "side": { - "type": "string", - "description": "Filled side, The trade side indicates the taker order side. A taker order is the order that was matched with orders opened on the order book.", - "enum": [ - "buy", - "sell" - ], - "x-api-enum": [ - { - "value": "buy", - "name": "buy", - "description": "buy" - }, - { - "value": "sell", - "name": "sell", - "description": "sell" - } - ] - }, - "time": { - "type": "integer", - "format": "int64", - "description": "Filled timestamp(nanosecond)" - } + "AXS": { + "type": "string" + }, + "BCHSV": { + "type": "string" + }, + "NRN": { + "type": "string" + }, + "FTON": { + "type": "string" + }, + "COMP": { + "type": "string" + }, + "XPRT": { + "type": "string" + }, + "HFT": { + "type": "string" + }, + "UXLINK": { + "type": "string" + }, + "STAMP": { + "type": "string" + }, + "RUNE": { + "type": "string" + }, + "ZEUS": { + "type": "string" + }, + "LTC3L": { + "type": "string" + }, + "DAPP": { + "type": "string" + }, + "FORTH": { + "type": "string" + }, + "ALPINE": { + "type": "string" + }, + "SENSO": { + "type": "string" + }, + "LTC3S": { + "type": "string" + }, + "DEXE": { + "type": "string" + }, + "GOAL": { + "type": "string" + }, + "AVAX": { + "type": "string" + }, + "LISTA": { + "type": "string" + }, + "AMPL": { + "type": "string" + }, + "WORK": { + "type": "string" }, - "required": [ - "sequence", - "price", - "size", - "side", - "time" - ] - } - } - }, - "required": [ - "code", - "data" - ] - } - } - } - } - }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470162", - "x-abandon": "normal", - "x-domain": "Spot", - "x-api-channel": "Public", - "x-api-permission": "NULL", - "x-api-rate-limit-pool": "Public", - "x-sdk-service": "Spot", - "x-sdk-sub-service": "Market", - "x-sdk-method-name": "getTradeHistory", - "x-sdk-method-description": "Request via this endpoint to get the trade history of the specified symbol, the returned quantity is the last 100 transaction records.", - "x-api-rate-limit": 3, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": [\\n {\\n \\\"sequence\\\": \\\"10976028003549185\\\",\\n \\\"price\\\": \\\"67122\\\",\\n \\\"size\\\": \\\"0.000025\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"time\\\": 1729177117877000000\\n },\\n {\\n \\\"sequence\\\": \\\"10976028003549188\\\",\\n \\\"price\\\": \\\"67122\\\",\\n \\\"size\\\": \\\"0.01792257\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"time\\\": 1729177117877000000\\n },\\n {\\n \\\"sequence\\\": \\\"10976028003549191\\\",\\n \\\"price\\\": \\\"67122.9\\\",\\n \\\"size\\\": \\\"0.05654289\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"time\\\": 1729177117877000000\\n }\\n ]\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\"}" - } - }, - "/api/v1/market/candles": { - "get": { - "summary": "Get Klines", - "deprecated": false, - "description": "Get the Kline of the symbol. Data are returned in grouped buckets based on requested type. For each query, the system would return at most 1500 pieces of data. To obtain more data, please page the data by time.", - "tags": [], - "parameters": [ - { - "name": "symbol", - "in": "query", - "description": " symbol", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "type", - "in": "query", - "description": "Type of candlestick patterns: 1min, 3min, 5min, 15min, 30min, 1hour, 2hour, 4hour, 6hour, 8hour, 12hour, 1day, 1week, 1month", - "required": true, - "schema": { - "type": "string", - "enum": [ - "1min", - "3min", - "5min", - "15min", - "30min", - "1hour", - "2hour", - "4hour", - "6hour", - "8hour", - "12hour", - "1day", - "1week", - "1month" - ], - "x-api-enum": [ - { - "value": "1min", - "name": "1min", - "description": "1min" - }, - { - "value": "3min", - "name": "3min", - "description": "3min" - }, - { - "value": "5min", - "name": "5min", - "description": "5min" - }, - { - "value": "15min", - "name": "15min", - "description": "15min" - }, - { - "value": "30min", - "name": "30min", - "description": "30min" - }, - { - "value": "1hour", - "name": "1hour", - "description": "1hour" - }, - { - "value": "2hour", - "name": "2hour", - "description": "2hour" - }, - { - "value": "4hour", - "name": "4hour", - "description": "4hour" - }, - { - "value": "6hour", - "name": "6hour", - "description": "6hour" - }, - { - "value": "8hour", - "name": "8hour", - "description": "8hour" - }, - { - "value": "12hour", - "name": "12hour", - "description": "12hour" - }, - { - "value": "1day", - "name": "1day", - "description": "1day" - }, - { - "value": "1week", - "name": "1week", - "description": "1week" - }, - { - "value": "1month", - "name": "1month", - "description": "1month" - } - ] - } - }, - { - "name": "startAt", - "in": "query", - "description": "Start time (second), default is 0", - "required": false, - "schema": { - "type": "integer", - "format": "int64", - "default": 0 - } - }, - { - "name": "endAt", - "in": "query", - "description": "End time (second), default is 0", - "required": false, - "schema": { - "type": "integer", - "format": "int64", - "default": 0 - } - } - ], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "data": { - "type": "array", - "items": { - "type": "array", - "items": { - "type": "string", - "description": "Start time of the candle cycle, opening price, closing price, highest price, Lowest price, Transaction amount, Transaction volume" + "BRWL": { + "type": "string" + }, + "BANANA": { + "type": "string" + }, + "PUSH": { + "type": "string" + }, + "WEN": { + "type": "string" + }, + "NEIRO": { + "type": "string" + }, + "BTCUP": { + "type": "string" + }, + "SOL3S": { + "type": "string" + }, + "BRAWL": { + "type": "string" + }, + "LAY3R": { + "type": "string" + }, + "LPT": { + "type": "string" + }, + "GODS": { + "type": "string" + }, + "SAND3S": { + "type": "string" + }, + "RDNT": { + "type": "string" + }, + "SOL3L": { + "type": "string" + }, + "NIBI": { + "type": "string" + }, + "NUM": { + "type": "string" + }, + "PYR": { + "type": "string" + }, + "DAG": { + "type": "string" + }, + "DAI": { + "type": "string" + }, + "HIP": { + "type": "string" + }, + "DAO": { + "type": "string" + }, + "AVAIL": { + "type": "string" + }, + "DAR": { + "type": "string" + }, + "FET": { + "type": "string" + }, + "FCON": { + "type": "string" + }, + "XAVA": { + "type": "string" + }, + "LRC": { + "type": "string" + }, + "UNI3S": { + "type": "string" + }, + "POKT": { + "type": "string" + }, + "DASH": { + "type": "string" + }, + "BAKEDOWN": { + "type": "string" + }, + "POLC": { + "type": "string" + }, + "CIRUS": { + "type": "string" + }, + "UNI3L": { + "type": "string" + }, + "NWC": { + "type": "string" + }, + "POLK": { + "type": "string" + }, + "LSD": { + "type": "string" + }, + "MARS4": { + "type": "string" + }, + "LSK": { + "type": "string" + }, + "BLOCK": { + "type": "string" + }, + "ANALOS": { + "type": "string" + }, + "SAFE": { + "type": "string" + }, + "DCK": { + "type": "string" + }, + "LSS": { + "type": "string" + }, + "DCR": { + "type": "string" + }, + "LIKE": { + "type": "string" + }, + "DATA": { + "type": "string" + }, + "WIF": { + "type": "string" + }, + "BLOK": { + "type": "string" + }, + "LTC": { + "type": "string" + }, + "METIS": { + "type": "string" + }, + "WIN": { + "type": "string" + }, + "HLG": { + "type": "string" + }, + "LTO": { + "type": "string" + }, + "DYDX": { + "type": "string" + }, + "ARB3S": { + "type": "string" + }, + "MUBI": { + "type": "string" + }, + "ARB3L": { + "type": "string" + }, + "RBTC1": { + "type": "string" + }, + "POND": { + "type": "string" + }, + "LINA": { + "type": "string" + }, + "MYRIA": { + "type": "string" + }, + "LINK": { + "type": "string" + }, + "QTUM": { + "type": "string" + }, + "TUNE": { + "type": "string" + }, + "UFO": { + "type": "string" + }, + "CYBER": { + "type": "string" + }, + "WILD": { + "type": "string" + }, + "POLS": { + "type": "string" + }, + "NYM": { + "type": "string" + }, + "FIL": { + "type": "string" + }, + "BAL": { + "type": "string" + }, + "SCA": { + "type": "string" + }, + "STND": { + "type": "string" + }, + "WMTX": { + "type": "string" + }, + "SCLP": { + "type": "string" + }, + "MANEKI": { + "type": "string" + }, + "BAT": { + "type": "string" + }, + "AKRO": { + "type": "string" + }, + "FTM3L": { + "type": "string" + }, + "BAX": { + "type": "string" + }, + "FTM3S": { + "type": "string" + }, + "COTI": { + "type": "string" } - } + }, + "required": [ + "AGLD", + "DFI", + "PYTHUP", + "ISLM", + "NEAR", + "AIOZ", + "AUDIO", + "BBL", + "WLD", + "HNT", + "ETHFI", + "DMAIL", + "OPUP", + "VET3S", + "MANA3S", + "TIDAL", + "HALO", + "OPUL", + "MANA3L", + "DGB", + "AA", + "BCH", + "GMEE", + "JST", + "PBUX", + "AR", + "SEI", + "PSTAKE", + "LMWR", + "UNFIDOWN", + "BB", + "JTO", + "WEMIX", + "G", + "MARSH", + "BN", + "FLIP", + "FLR", + "BIGTIME", + "FLY", + "T", + "W", + "BDX", + "BABYDOGE", + "SFP", + "DIA", + "ISME", + "LYM", + "VET3L", + "JUP", + "LYX", + "AIEPK", + "SILLY", + "SCPT", + "WOO", + "BLUR", + "STRK", + "BFC", + "DC", + "KARATE", + "SUSHI3L", + "NETVR", + "WAVES", + "LITH", + "HAPI", + "SUSHI3S", + "CEEK", + "FLOKI", + "SHR", + "SAND", + "TURT", + "UMA", + "BEPRO", + "SCRT", + "TUSD", + "COOKIE", + "LRDS", + "SIN", + "OAS", + "ROOT", + "ADA3L", + "TIAUP", + "HTR", + "UNB", + "UNA", + "HARD", + "G3", + "ADA3S", + "MYRO", + "HTX", + "FT", + "BTCDOWN", + "UNI", + "FX", + "OBI", + "UNO", + "WRX", + "TIADOWN", + "ETHDOWN", + "WELL", + "SWFTC", + "SKL", + "UOS", + "AIPAD", + "BRETT", + "SKY", + "FRM", + "VISION", + "LENDS", + "SLF", + "BULL", + "FLOW", + "ODDZ", + "SLN", + "UPO", + "SLP", + "ID", + "SLIM", + "SPOT", + "DOP", + "ISSP", + "UQC", + "IO", + "DOT", + "1INCH", + "SMH", + "MAK", + "TOKO", + "TURBO", + "UNFI", + "MAN", + "EVER", + "FTM", + "SHRAP", + "MAV", + "MAX", + "DPR", + "FTT", + "ARKM", + "ATOM", + "PENDLE", + "QUICK", + "BLZ", + "BOBA", + "MBL", + "OFN", + "UNIO", + "SNS", + "SNX", + "NXRA", + "TAIKO", + "AVAX3L", + "L3", + "API3", + "XRP3S", + "QKC", + "AVAX3S", + "ROSE", + "SATS", + "BMX", + "PORTAL", + "TOMI", + "XRP3L", + "SOL", + "SON", + "BNC", + "SOCIAL", + "CGPT", + "CELR", + "BNB", + "OGN", + "CELO", + "AUCTION", + "MANTA", + "LAYER", + "AERO", + "CETUS", + "LL", + "SPA", + "PYTHDOWN", + "NEIROCTO", + "UTK", + "GMRX", + "BOB", + "HOTCROSS", + "AERGO", + "MOCA", + "SQD", + "MV", + "BNB3L", + "BNB3S", + "GALAX3L", + "KAI", + "SQR", + "GALAX3S", + "EGLD", + "ZBCN", + "KAS", + "MEW", + "PUNDIX", + "LOOKS", + "FXS", + "BOSON", + "BRISE", + "AEVO", + "FLUX", + "PRCL", + "UNFIUP", + "SEIDOWN", + "DOAI", + "QNT", + "REDO", + "STRIKE", + "ETHW", + "OM", + "OP", + "WHALE", + "1CAT", + "NEON", + "GTAI", + "SSV", + "ETH2", + "KCS", + "ARPA", + "ARTFI", + "BRL", + "ALEX", + "STG", + "SHIB", + "IOTX", + "OLE", + "KDA", + "CERE", + "DOCK", + "STX", + "OLT", + "QI", + "SDAO", + "BLAST", + "LINK3S", + "IOST", + "SUI", + "CAKE", + "BSW", + "OMG", + "VOLT", + "LINK3L", + "GEEQ", + "PYUSD", + "SUN", + "TOWER", + "BTC", + "IOTA", + "REEF", + "TRIAS", + "KEY", + "ETH3L", + "BTT", + "ONE", + "RENDER", + "ETH3S", + "ANKR", + "ALGO", + "SYLO", + "ZCX", + "SD", + "ONT", + "MJT", + "DYM", + "DYP", + "BAKEUP", + "OOE", + "ZELIX", + "DOGE3L", + "ARTY", + "QORPO", + "ICE", + "NOTAI", + "DOGE3S", + "NAKA", + "GALAX", + "MKR", + "DODO", + "ICP", + "ZEC", + "ZEE", + "ICX", + "KMNO", + "TT", + "DOT3L", + "XAI", + "ZEN", + "DOGE", + "ALPHA", + "DUSK", + "DOT3S", + "SXP", + "HBAR", + "SYNT", + "ZEX", + "BONDLY", + "MLK", + "KICKS", + "PEPE", + "OUSD", + "LUNCDOWN", + "DOGS", + "REV3L", + "CTSI", + "C98", + "OSMO", + "NTRN", + "CFX2S", + "SYN", + "VIDT", + "SYS", + "GAS", + "BOME", + "COMBO", + "XCH", + "VR", + "CFX2L", + "VSYS", + "PANDORA", + "THETA", + "XCN", + "NEXG", + "MELOS", + "XCV", + "ORN", + "WLKN", + "AAVE", + "MNT", + "BONK", + "PERP", + "XDC", + "MNW", + "XDB", + "BOND", + "SUIA", + "MOG", + "SUTER", + "TIME", + "RACA", + "BICO", + "MON", + "SWEAT", + "MOXIE", + "BABYBNB", + "IGU", + "HMSTR", + "XEC", + "MONI", + "XR", + "PEOPLE", + "PUMLX", + "ZIL", + "WLDDOWN", + "VAI", + "XEN", + "MPC", + "XEM", + "JASMY3S", + "OTK", + "TRAC", + "DFYN", + "BIDP", + "JASMY3L", + "INJDOWN", + "KLV", + "WAXL", + "TRBDOWN", + "BCH3L", + "GMT3S", + "KMD", + "BCH3S", + "ECOX", + "AAVE3S", + "GMT3L", + "EPIK", + "SUIP", + "AAVE3L", + "ZK", + "ZKF", + "OMNIA", + "ZKJ", + "ZKL", + "GAFI", + "CARV", + "KNC", + "CATS", + "PROM", + "ALEPH", + "PONKE", + "OVR", + "CATI", + "ORDER", + "GFT", + "BIFI", + "GGC", + "GGG", + "DAPPX", + "SUKU", + "ULTI", + "CREDI", + "ERTHA", + "FURY", + "KARRAT", + "MOBILE", + "SIDUS", + "NAVI", + "TAO", + "USDJ", + "MTL", + "VET", + "FITFI", + "USDT", + "OXT", + "CANDY", + "USDP", + "MTS", + "TADA", + "MTV", + "NAVX", + "ILV", + "VINU", + "GHX", + "EDU", + "HYVE", + "BTC3L", + "ANYONE", + "BEAT", + "KING", + "CREAM", + "CAS", + "IMX", + "CAT", + "BTC3S", + "USDE", + "USDD", + "CWAR", + "USDC", + "KRL", + "INJ", + "GAME", + "TRIBL", + "XLM", + "TRBUP", + "VRADOWN", + "SUPER", + "EIGEN", + "IOI", + "KSM", + "CCD", + "EGO", + "EGP", + "MXC", + "TEL", + "MOVR", + "XMR", + "MXM", + "OORT", + "GLM", + "RAY", + "XTAG", + "GLQ", + "CWEB", + "REVU", + "REVV", + "ZRO", + "XNL", + "XNO", + "SAROS", + "KACE", + "ZRX", + "WLTH", + "ATOM3L", + "GMM", + "BEER", + "GMT", + "HEART", + "GMX", + "ABBC", + "OMNI", + "ATOM3S", + "IRL", + "CFG", + "WSDM", + "GNS", + "VANRY", + "CFX", + "GRAIL", + "BEFI", + "VELO", + "XPR", + "DOVI", + "ACE", + "ACH", + "ISP", + "XCAD", + "MINA", + "TIA", + "DRIFT", + "ACQ", + "ACS", + "MIND", + "STORE", + "REN", + "ELA", + "DREAMS", + "ADA", + "ELF", + "REQ", + "STORJ", + "LADYS", + "PAXG", + "REZ", + "XRD", + "CHO", + "CHR", + "ADS", + "CHZ", + "ADX", + "XRP", + "JASMY", + "KAGI", + "FIDA", + "PBR", + "AEG", + "H2O", + "CHMB", + "SAND3L", + "PBX", + "SOLVE", + "DECHAT", + "GARI", + "SHIB2L", + "SHIB2S", + "ENA", + "VEMP", + "ENJ", + "AFG", + "RATS", + "GRT", + "FORWARD", + "TFUEL", + "ENS", + "KASDOWN", + "XTM", + "DEGEN", + "TLM", + "DYDXDOWN", + "CKB", + "LUNC", + "AURORA", + "LUNA", + "XTZ", + "ELON", + "DMTR", + "EOS", + "GST", + "FORT", + "FLAME", + "PATEX", + "DEEP", + "ID3L", + "GTC", + "ID3S", + "RIO", + "CLH", + "BURGER", + "VRA", + "SUNDOG", + "GTT", + "INJUP", + "CPOOL", + "EPX", + "CLV", + "FEAR", + "MEME", + "ROOBEE", + "DEFI", + "TOKEN", + "GRAPE", + "KASUP", + "XWG", + "SKEY", + "SFUND", + "EQX", + "ORDIUP", + "TON", + "DEGO", + "IZI", + "ERG", + "ERN", + "VENOM", + "VOXEL", + "RLC", + "PHA", + "DYDXUP", + "APE3S", + "ORBS", + "OPDOWN", + "ESE", + "APE3L", + "HMND", + "COQ", + "AURY", + "CULT", + "AKT", + "GLMR", + "XYM", + "ORAI", + "XYO", + "ETC", + "LAI", + "PIP", + "ETH", + "NEO", + "RMV", + "KLAY", + "PIT", + "TARA", + "KALT", + "PIX", + "ETN", + "CSIX", + "TRADE", + "MAVIA", + "HIGH", + "TRB", + "ORDI", + "TRVL", + "AMB", + "TRU", + "LOGX", + "FINC", + "INFRA", + "NATIX", + "NFP", + "TRY", + "TRX", + "LBP", + "LBR", + "EUL", + "NFT", + "SEIUP", + "PUFFER", + "EUR", + "ORCA", + "NEAR3L", + "AMP", + "XDEFI", + "HIFI", + "TRUF", + "AITECH", + "AMU", + "USTC", + "KNGL", + "FOXY", + "NGC", + "TENET", + "NEAR3S", + "MAHA", + "NGL", + "TST", + "HIPPO", + "AXS3S", + "CRO", + "ZPAY", + "MNDE", + "CRV", + "SWASH", + "AXS3L", + "VERSE", + "RPK", + "RPL", + "AZERO", + "SOUL", + "VXV", + "LDO", + "MAGIC", + "ALICE", + "SEAM", + "PLU", + "AOG", + "SMOLE", + "EWT", + "TSUGT", + "PMG", + "OPAI", + "LOCUS", + "CTA", + "NIM", + "CTC", + "APE", + "MERL", + "JAM", + "CTI", + "APP", + "APT", + "WLDUP", + "ZEND", + "FIRE", + "DENT", + "PYTH", + "LFT", + "DPET", + "ORDIDOWN", + "KPOL", + "ETHUP", + "BAND", + "POL", + "ASTR", + "NKN", + "RSR", + "DVPN", + "TWT", + "ARB", + "CVC", + "ARC", + "XETA", + "MTRG", + "LOKA", + "LPOOL", + "TURBOS", + "CVX", + "ARX", + "MPLX", + "SUSHI", + "NLK", + "PEPE2", + "WBTC", + "SUI3L", + "CWS", + "SUI3S", + "INSP", + "MANA", + "VRTX", + "CSPR", + "ATA", + "OPEN", + "HAI", + "NMR", + "ATH", + "LIT", + "TLOS", + "TNSR", + "CXT", + "POLYX", + "ZERO", + "ROUTE", + "LOOM", + "PRE", + "VRAUP", + "HBB", + "RVN", + "PRQ", + "ONDO", + "PEPEDOWN", + "WOOP", + "LUNCUP", + "KAVA", + "LKI", + "AVA", + "NOM", + "MAPO", + "PEPEUP", + "STRAX", + "NOT", + "ZERC", + "BCUT", + "MASA", + "WAN", + "WAT", + "WAX", + "MASK", + "EOS3L", + "IDEA", + "EOS3S", + "YFI", + "MOODENG", + "XCUR", + "HYDRA", + "POPCAT", + "LQTY", + "PIXEL", + "LMR", + "ZETA", + "YGG", + "AXS", + "BCHSV", + "NRN", + "FTON", + "COMP", + "XPRT", + "HFT", + "UXLINK", + "STAMP", + "RUNE", + "ZEUS", + "LTC3L", + "DAPP", + "FORTH", + "ALPINE", + "SENSO", + "LTC3S", + "DEXE", + "GOAL", + "AVAX", + "LISTA", + "AMPL", + "WORK", + "BRWL", + "BANANA", + "PUSH", + "WEN", + "NEIRO", + "BTCUP", + "SOL3S", + "BRAWL", + "LAY3R", + "LPT", + "GODS", + "SAND3S", + "RDNT", + "SOL3L", + "NIBI", + "NUM", + "PYR", + "DAG", + "DAI", + "HIP", + "DAO", + "AVAIL", + "DAR", + "FET", + "FCON", + "XAVA", + "LRC", + "UNI3S", + "POKT", + "DASH", + "BAKEDOWN", + "POLC", + "CIRUS", + "UNI3L", + "NWC", + "POLK", + "LSD", + "MARS4", + "LSK", + "BLOCK", + "ANALOS", + "SAFE", + "DCK", + "LSS", + "DCR", + "LIKE", + "DATA", + "WIF", + "BLOK", + "LTC", + "METIS", + "WIN", + "HLG", + "LTO", + "DYDX", + "ARB3S", + "MUBI", + "ARB3L", + "RBTC1", + "POND", + "LINA", + "MYRIA", + "LINK", + "QTUM", + "TUNE", + "UFO", + "CYBER", + "WILD", + "POLS", + "NYM", + "FIL", + "BAL", + "SCA", + "STND", + "WMTX", + "SCLP", + "MANEKI", + "BAT", + "AKRO", + "FTM3L", + "BAX", + "FTM3S", + "COTI" + ] } }, "required": [ @@ -5486,7 +5604,7 @@ } } }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470163", + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470153", "x-abandon": "normal", "x-domain": "Spot", "x-api-channel": "Public", @@ -5494,18 +5612,18 @@ "x-api-rate-limit-pool": "Public", "x-sdk-service": "Spot", "x-sdk-sub-service": "Market", - "x-sdk-method-name": "getKlines", - "x-sdk-method-description": "Get the Kline of the symbol. Data are returned in grouped buckets based on requested type. For each query, the system would return at most 1500 pieces of data. To obtain more data, please page the data by time.", + "x-sdk-method-name": "getFiatPrice", + "x-sdk-method-description": "Request via this endpoint to get the fiat price of the currencies for the available trading pairs.", "x-api-rate-limit": 3, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": [\\n [\\n \\\"1566789720\\\",\\n \\\"10411.5\\\",\\n \\\"10401.9\\\",\\n \\\"10411.5\\\",\\n \\\"10396.3\\\",\\n \\\"29.11357276\\\",\\n \\\"302889.301529914\\\"\\n ],\\n [\\n \\\"1566789660\\\",\\n \\\"10416\\\",\\n \\\"10411.5\\\",\\n \\\"10422.3\\\",\\n \\\"10411.5\\\",\\n \\\"15.61781842\\\",\\n \\\"162703.708997029\\\"\\n ],\\n [\\n \\\"1566789600\\\",\\n \\\"10408.6\\\",\\n \\\"10416\\\",\\n \\\"10416\\\",\\n \\\"10405.4\\\",\\n \\\"12.45584973\\\",\\n \\\"129666.51508559\\\"\\n ]\\n ]\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"type\\\": \\\"1min\\\", \\\"startAt\\\": 1566703297, \\\"endAt\\\": 1566789757}" + "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"AGLD\\\":\\\"1.1174410000000001\\\",\\\"DFI\\\":\\\"0.0168915500000000\\\",\\\"PYTHUP\\\":\\\"0.0397880960000000\\\",\\\"ISLM\\\":\\\"0.0606196750000000\\\",\\\"NEAR\\\":\\\"4.7185395500000000\\\",\\\"AIOZ\\\":\\\"0.4862867350000000\\\",\\\"AUDIO\\\":\\\"0.1219390000000000\\\",\\\"BBL\\\":\\\"0.0067766100000000\\\",\\\"WLD\\\":\\\"2.2893547500000000\\\",\\\"HNT\\\":\\\"5.8990489999999984\\\",\\\"ETHFI\\\":\\\"1.5892050000000000\\\",\\\"DMAIL\\\":\\\"0.2726636000000000\\\",\\\"OPUP\\\":\\\"0.0986506500000000\\\",\\\"VET3S\\\":\\\"0.0003700448850000\\\",\\\"MANA3S\\\":\\\"0.0006056970000000\\\",\\\"TIDAL\\\":\\\"0.0001154422500000\\\",\\\"HALO\\\":\\\"0.0058270850000000\\\",\\\"OPUL\\\":\\\"0.0839480050000000\\\",\\\"MANA3L\\\":\\\"0.0029569407900000\\\",\\\"DGB\\\":\\\"0.0066556705000000\\\",\\\"AA\\\":\\\"0.2406796000000000\\\",\\\"BCH\\\":\\\"366.2167999999996484\\\",\\\"GMEE\\\":\\\"0.0113333305000000\\\",\\\"JST\\\":\\\"0.0302348750000000\\\",\\\"PBUX\\\":\\\"0.0208795550000000\\\",\\\"AR\\\":\\\"18.5457224999999909\\\",\\\"SEI\\\":\\\"0.4332832500000000\\\",\\\"PSTAKE\\\":\\\"0.0493153300000000\\\",\\\"LMWR\\\":\\\"0.1618190500000000\\\",\\\"UNFIDOWN\\\":\\\"0.0062058955000000\\\",\\\"BB\\\":\\\"0.3245376500000000\\\",\\\"JTO\\\":\\\"2.1239375000000002\\\",\\\"WEMIX\\\":\\\"0.7916040000000000\\\",\\\"G\\\":\\\"0.0324037900000000\\\",\\\"MARSH\\\":\\\"0.0617591050000000\\\",\\\"BN\\\":\\\"0.0036961510000000\\\",\\\"FLIP\\\":\\\"1.0976509000000000\\\",\\\"FLR\\\":\\\"0.0144827550000000\\\",\\\"BIGTIME\\\":\\\"0.1238780300000000\\\",\\\"FLY\\\":\\\"0.0005157420000000\\\",\\\"T\\\":\\\"0.0233483200000000\\\",\\\"W\\\":\\\"0.2865566500000000\\\",\\\"BDX\\\":\\\"0.0774012800000000\\\",\\\"BABYDOGE\\\":\\\"0.0000000029375305\\\",\\\"SFP\\\":\\\"0.7256370000000000\\\",\\\"DIA\\\":\\\"0.9179408000000000\\\",\\\"ISME\\\":\\\"0.0022388800000000\\\",\\\"LYM\\\":\\\"0.0010155919500000\\\",\\\"VET3L\\\":\\\"0.0000289755050000\\\",\\\"JUP\\\":\\\"0.8230882500000000\\\",\\\"LYX\\\":\\\"1.4501745500000001\\\",\\\"AIEPK\\\":\\\"0.0050094940000000\\\",\\\"SILLY\\\":\\\"0.0159420250000000\\\",\\\"SCPT\\\":\\\"0.0122038950000000\\\",\\\"WOO\\\":\\\"0.1796601250000000\\\",\\\"BLUR\\\":\\\"0.2462768000000000\\\",\\\"STRK\\\":\\\"0.3963117450000000\\\",\\\"BFC\\\":\\\"0.0383608100000000\\\",\\\"DC\\\":\\\"0.0003097450500000\\\",\\\"KARATE\\\":\\\"0.0007296350000000\\\",\\\"SUSHI3L\\\":\\\"0.5115441000000000\\\",\\\"NETVR\\\":\\\"0.0976111700000000\\\",\\\"WAVES\\\":\\\"1.0806594000000000\\\",\\\"LITH\\\":\\\"0.0001520239500000\\\",\\\"HAPI\\\":\\\"8.6533711499999987\\\",\\\"SUSHI3S\\\":\\\"1.2752620500000000\\\",\\\"CEEK\\\":\\\"0.0294852500000000\\\",\\\"FLOKI\\\":\\\"0.0001414292500000\\\",\\\"SHR\\\":\\\"0.0012463765000000\\\",\\\"SAND\\\":\\\"0.2566616050000000\\\",\\\"TURT\\\":\\\"0.0020889550000000\\\",\\\"UMA\\\":\\\"2.5207390000000000\\\",\\\"BEPRO\\\":\\\"0.0003955021500000\\\",\\\"SCRT\\\":\\\"0.1995002000000000\\\",\\\"TUSD\\\":\\\"0.9945025000000000\\\",\\\"COOKIE\\\":\\\"0.0220089900000000\\\",\\\"LRDS\\\":\\\"0.6218889000000000\\\",\\\"SIN\\\":\\\"0.0033633175000000\\\",\\\"OAS\\\":\\\"0.0331933950000000\\\",\\\"ROOT\\\":\\\"0.0183108400000000\\\",\\\"ADA3L\\\":\\\"0.0046396790000000\\\",\\\"TIAUP\\\":\\\"0.1228385500000000\\\",\\\"HTR\\\":\\\"0.0353023400000000\\\",\\\"UNB\\\":\\\"0.0003837080500000\\\",\\\"UNA\\\":\\\"0.0164917500000000\\\",\\\"HARD\\\":\\\"0.1087056200000000\\\",\\\"G3\\\":\\\"0.0502648550000000\\\",\\\"ADA3S\\\":\\\"0.0006191202850000\\\",\\\"MYRO\\\":\\\"0.1071863800000000\\\",\\\"HTX\\\":\\\"0.0000013693150000\\\",\\\"FT\\\":\\\"0.3585206500000000\\\",\\\"BTCDOWN\\\":\\\"0.1065467000000000\\\",\\\"UNI\\\":\\\"7.3571195999999993\\\",\\\"FX\\\":\\\"0.1379310000000000\\\",\\\"OBI\\\":\\\"0.0079030465000000\\\",\\\"UNO\\\":\\\"0.0137131400000000\\\",\\\"WRX\\\":\\\"0.1221389000000000\\\",\\\"TIADOWN\\\":\\\"0.0000914642450000\\\",\\\"ETHDOWN\\\":\\\"0.1306346500000000\\\",\\\"WELL\\\":\\\"0.0471244260000000\\\",\\\"SWFTC\\\":\\\"0.0028966509500000\\\",\\\"SKL\\\":\\\"0.0362418700000000\\\",\\\"UOS\\\":\\\"0.0867765900000000\\\",\\\"AIPAD\\\":\\\"0.0478660550000000\\\",\\\"BRETT\\\":\\\"0.1037481000000000\\\",\\\"SKY\\\":\\\"0.0520139800000000\\\",\\\"FRM\\\":\\\"0.0153123400000000\\\",\\\"VISION\\\":\\\"0.0014451770500000\\\",\\\"LENDS\\\":\\\"0.0047276350000000\\\",\\\"SLF\\\":\\\"0.3318340000000000\\\",\\\"BULL\\\":\\\"0.0023988000000000\\\",\\\"FLOW\\\":\\\"0.5372312500000000\\\",\\\"ODDZ\\\":\\\"0.0063368300000000\\\",\\\"SLN\\\":\\\"0.2804597000000000\\\",\\\"UPO\\\":\\\"0.0440779500000000\\\",\\\"SLP\\\":\\\"0.0023997995000000\\\",\\\"ID\\\":\\\"0.3718140000000000\\\",\\\"SLIM\\\":\\\"0.0906446550000000\\\",\\\"SPOT\\\":\\\"0.0021289350000000\\\",\\\"DOP\\\":\\\"0.0023028480000000\\\",\\\"ISSP\\\":\\\"0.0000874562500000\\\",\\\"UQC\\\":\\\"3.2339822000000003\\\",\\\"IO\\\":\\\"1.8185902499999999\\\",\\\"DOT\\\":\\\"4.2022978000000005\\\",\\\"1INCH\\\":\\\"0.2645676500000000\\\",\\\"SMH\\\":\\\"0.3448275000000000\\\",\\\"MAK\\\":\\\"0.0396701550000000\\\",\\\"TOKO\\\":\\\"0.0005923037000000\\\",\\\"TURBO\\\":\\\"0.0108085930000000\\\",\\\"UNFI\\\":\\\"2.8555714999999996\\\",\\\"MAN\\\":\\\"0.0210764565000000\\\",\\\"EVER\\\":\\\"0.0332733550000000\\\",\\\"FTM\\\":\\\"0.7259068650000000\\\",\\\"SHRAP\\\":\\\"0.0476361700000000\\\",\\\"MAV\\\":\\\"0.1738130500000000\\\",\\\"MAX\\\":\\\"0.2864966800000000\\\",\\\"DPR\\\":\\\"0.0018240875000000\\\",\\\"FTT\\\":\\\"2.0559715000000002\\\",\\\"ARKM\\\":\\\"1.7444273499999999\\\",\\\"ATOM\\\":\\\"4.2954512000000002\\\",\\\"PENDLE\\\":\\\"4.1554212500000007\\\",\\\"QUICK\\\":\\\"0.0365317250000000\\\",\\\"BLZ\\\":\\\"0.1217191100000000\\\",\\\"BOBA\\\":\\\"0.2014092450000000\\\",\\\"MBL\\\":\\\"0.0027856065000000\\\",\\\"OFN\\\":\\\"0.1252373500000000\\\",\\\"UNIO\\\":\\\"0.0025487250000000\\\",\\\"SNS\\\":\\\"0.0200899500000000\\\",\\\"SNX\\\":\\\"1.4282854999999999\\\",\\\"NXRA\\\":\\\"0.0272763550000000\\\",\\\"TAIKO\\\":\\\"1.4392800000000001\\\",\\\"AVAX3L\\\":\\\"0.1410875109550000\\\",\\\"L3\\\":\\\"0.0608395650000000\\\",\\\"API3\\\":\\\"1.3728132500000001\\\",\\\"XRP3S\\\":\\\"0.0028095945000000\\\",\\\"QKC\\\":\\\"0.0085157400000000\\\",\\\"AVAX3S\\\":\\\"0.5148424500000000\\\",\\\"ROSE\\\":\\\"0.0693453100000000\\\",\\\"SATS\\\":\\\"0.0000002701648500\\\",\\\"BMX\\\":\\\"0.3100449000000000\\\",\\\"PORTAL\\\":\\\"0.2811593500000000\\\",\\\"TOMI\\\":\\\"0.0309045400000000\\\",\\\"XRP3L\\\":\\\"2.1586201500000002\\\",\\\"SOL\\\":\\\"151.7250995000003583\\\",\\\"SON\\\":\\\"0.0002421788500000\\\",\\\"BNC\\\":\\\"0.1882058500000000\\\",\\\"SOCIAL\\\":\\\"0.0026486750000000\\\",\\\"CGPT\\\":\\\"0.1305147100000000\\\",\\\"CELR\\\":\\\"0.0127736100000000\\\",\\\"BNB\\\":\\\"591.0973035000118935\\\",\\\"OGN\\\":\\\"0.0852573500000000\\\",\\\"CELO\\\":\\\"0.7711142500000000\\\",\\\"AUCTION\\\":\\\"13.1634150000000014\\\",\\\"MANTA\\\":\\\"0.7564216000000000\\\",\\\"LAYER\\\":\\\"0.0372713550000000\\\",\\\"AERO\\\":\\\"1.3783104999999999\\\",\\\"CETUS\\\":\\\"0.1808295400000000\\\",\\\"LL\\\":\\\"0.0201199350000000\\\",\\\"SPA\\\":\\\"0.0067426270000000\\\",\\\"PYTHDOWN\\\":\\\"0.0011834080000000\\\",\\\"NEIROCTO\\\":\\\"0.0019964013000000\\\",\\\"UTK\\\":\\\"0.0365217300000000\\\",\\\"GMRX\\\":\\\"0.0007386305000000\\\",\\\"BOB\\\":\\\"0.0000380619595000\\\",\\\"HOTCROSS\\\":\\\"0.0056491740000000\\\",\\\"AERGO\\\":\\\"0.1007595950000000\\\",\\\"MOCA\\\":\\\"0.0783608000000000\\\",\\\"SQD\\\":\\\"0.0380809500000000\\\",\\\"MV\\\":\\\"0.0081359300000000\\\",\\\"BNB3L\\\":\\\"0.2761618500000000\\\",\\\"BNB3S\\\":\\\"0.0008545725000000\\\",\\\"GALAX3L\\\":\\\"0.0057571999600000\\\",\\\"KAI\\\":\\\"0.0020080954500000\\\",\\\"SQR\\\":\\\"0.0470764500000000\\\",\\\"GALAX3S\\\":\\\"0.1933033000000000\\\",\\\"EGLD\\\":\\\"25.5272299999999713\\\",\\\"ZBCN\\\":\\\"0.0010404795000000\\\",\\\"KAS\\\":\\\"0.1216691350000000\\\",\\\"MEW\\\":\\\"0.0086176890000000\\\",\\\"PUNDIX\\\":\\\"0.4130933500000000\\\",\\\"LOOKS\\\":\\\"0.0392803500000000\\\",\\\"FXS\\\":\\\"1.9060465000000000\\\",\\\"BOSON\\\":\\\"0.2732633000000000\\\",\\\"BRISE\\\":\\\"0.0000000860569500\\\",\\\"AEVO\\\":\\\"0.3388305000000000\\\",\\\"FLUX\\\":\\\"0.5276360500000000\\\",\\\"PRCL\\\":\\\"0.1969015000000000\\\",\\\"UNFIUP\\\":\\\"0.0011654170000000\\\",\\\"SEIDOWN\\\":\\\"0.0442778500000000\\\",\\\"DOAI\\\":\\\"0.0052363805000000\\\",\\\"QNT\\\":\\\"65.4312679999998206\\\",\\\"REDO\\\":\\\"0.2837580500000000\\\",\\\"STRIKE\\\":\\\"6.8225869999999997\\\",\\\"ETHW\\\":\\\"3.2418782499999998\\\",\\\"OM\\\":\\\"1.5396797750000000\\\",\\\"OP\\\":\\\"1.6911539999999999\\\",\\\"WHALE\\\":\\\"0.8134930500000000\\\",\\\"1CAT\\\":\\\"0.0018460765000000\\\",\\\"NEON\\\":\\\"0.4446775500000000\\\",\\\"GTAI\\\":\\\"0.7786105000000000\\\",\\\"SSV\\\":\\\"21.2393749999999841\\\",\\\"ETH2\\\":\\\"2601.6678843156403923\\\",\\\"KCS\\\":\\\"8.7646155000000020\\\",\\\"ARPA\\\":\\\"0.0393882960000000\\\",\\\"ARTFI\\\":\\\"0.0141029450000000\\\",\\\"BRL\\\":\\\"0.1742807323452485\\\",\\\"ALEX\\\":\\\"0.0924537500000000\\\",\\\"STG\\\":\\\"0.2943527500000000\\\",\\\"SHIB\\\":\\\"0.0000178060925000\\\",\\\"IOTX\\\":\\\"0.0394202800000000\\\",\\\"OLE\\\":\\\"0.0171414250000000\\\",\\\"KDA\\\":\\\"0.5653172000000000\\\",\\\"CERE\\\":\\\"0.0022548720000000\\\",\\\"DOCK\\\":\\\"0.0018990500000000\\\",\\\"STX\\\":\\\"1.8157916500000000\\\",\\\"OLT\\\":\\\"0.0007596200000000\\\",\\\"QI\\\":\\\"0.0131754090000000\\\",\\\"SDAO\\\":\\\"0.2748625000000000\\\",\\\"BLAST\\\":\\\"0.0087636160000000\\\",\\\"LINK3S\\\":\\\"0.0000702948350000\\\",\\\"IOST\\\":\\\"0.0049745115000000\\\",\\\"SUI\\\":\\\"2.0589700000000000\\\",\\\"CAKE\\\":\\\"1.7941024999999999\\\",\\\"BSW\\\":\\\"0.0586706500000000\\\",\\\"OMG\\\":\\\"0.2597700500000000\\\",\\\"VOLT\\\":\\\"0.0000002716641000\\\",\\\"LINK3L\\\":\\\"1.3408292499999999\\\",\\\"GEEQ\\\":\\\"0.0385607100000000\\\",\\\"PYUSD\\\":\\\"0.9988003500000000\\\",\\\"SUN\\\":\\\"0.0186106900000000\\\",\\\"TOWER\\\":\\\"0.0014812590000000\\\",\\\"BTC\\\":\\\"67133.4165000832051564\\\",\\\"IOTA\\\":\\\"0.1189405000000000\\\",\\\"REEF\\\":\\\"0.0019960015000000\\\",\\\"TRIAS\\\":\\\"3.3683149999999998\\\",\\\"KEY\\\":\\\"0.0037594713240047\\\",\\\"ETH3L\\\":\\\"0.0003305946200000\\\",\\\"BTT\\\":\\\"0.0000009117439000\\\",\\\"ONE\\\":\\\"0.0132003965000000\\\",\\\"RENDER\\\":\\\"5.2263854999999995\\\",\\\"ETH3S\\\":\\\"0.5517240000000000\\\",\\\"ANKR\\\":\\\"0.0264867500000000\\\",\\\"ALGO\\\":\\\"0.1188405500000000\\\",\\\"SYLO\\\":\\\"0.0007600198000000\\\",\\\"ZCX\\\":\\\"0.0784707450000000\\\",\\\"SD\\\":\\\"0.3851073500000000\\\",\\\"ONT\\\":\\\"0.1877960550000000\\\",\\\"MJT\\\":\\\"0.0132433750000000\\\",\\\"DYM\\\":\\\"1.6659666000000001\\\",\\\"DYP\\\":\\\"0.0205397250000000\\\",\\\"BAKEUP\\\":\\\"0.0389894955000000\\\",\\\"OOE\\\":\\\"0.0079360300000000\\\",\\\"ZELIX\\\":\\\"0.0000649675000000\\\",\\\"DOGE3L\\\":\\\"0.3837080500000000\\\",\\\"ARTY\\\":\\\"0.3980009000000000\\\",\\\"QORPO\\\":\\\"0.1204297550000000\\\",\\\"ICE\\\":\\\"0.0051504235000000\\\",\\\"NOTAI\\\":\\\"0.0000892753400000\\\",\\\"DOGE3S\\\":\\\"0.2291853500000000\\\",\\\"NAKA\\\":\\\"1.0695649500000000\\\",\\\"GALAX\\\":\\\"0.0212893500000000\\\",\\\"MKR\\\":\\\"1245.8767500000163833\\\",\\\"DODO\\\":\\\"0.1152423500000000\\\",\\\"ICP\\\":\\\"7.6731615000000027\\\",\\\"ZEC\\\":\\\"35.9400209999999543\\\",\\\"ZEE\\\":\\\"0.0065767100000000\\\",\\\"ICX\\\":\\\"0.1383308000000000\\\",\\\"KMNO\\\":\\\"0.0921499020000000\\\",\\\"TT\\\":\\\"0.0033883050000000\\\",\\\"DOT3L\\\":\\\"0.1454272500000000\\\",\\\"XAI\\\":\\\"0.2038980000000000\\\",\\\"ZEN\\\":\\\"8.0149905000000007\\\",\\\"DOGE\\\":\\\"0.1213093150000000\\\",\\\"ALPHA\\\":\\\"0.0567416150000000\\\",\\\"DUSK\\\":\\\"0.1964517250000000\\\",\\\"DOT3S\\\":\\\"0.0053613180000000\\\",\\\"SXP\\\":\\\"0.2538730000000000\\\",\\\"HBAR\\\":\\\"0.0510044850000000\\\",\\\"SYNT\\\":\\\"0.0467166300000000\\\",\\\"ZEX\\\":\\\"0.0571714000000000\\\",\\\"BONDLY\\\":\\\"0.0022208890000000\\\",\\\"MLK\\\":\\\"0.2080859050000000\\\",\\\"KICKS\\\":\\\"0.0001301249050000\\\",\\\"PEPE\\\":\\\"0.0000100249850000\\\",\\\"OUSD\\\":\\\"0.9982006500000000\\\",\\\"LUNCDOWN\\\":\\\"0.0000733333150000\\\",\\\"DOGS\\\":\\\"0.0007086455000000\\\",\\\"REV3L\\\":\\\"0.0094672640000000\\\",\\\"CTSI\\\":\\\"0.1257371000000000\\\",\\\"C98\\\":\\\"0.1219390000000000\\\",\\\"OSMO\\\":\\\"0.5370313500000000\\\",\\\"NTRN\\\":\\\"0.3869064500000000\\\",\\\"CFX2S\\\":\\\"0.0084757600000000\\\",\\\"SYN\\\":\\\"0.5636180500000000\\\",\\\"VIDT\\\":\\\"0.0308745550000000\\\",\\\"SYS\\\":\\\"0.0997501000000000\\\",\\\"GAS\\\":\\\"4.3029474500000008\\\",\\\"BOME\\\":\\\"0.0087336310000000\\\",\\\"COMBO\\\":\\\"0.4068964500000000\\\",\\\"XCH\\\":\\\"14.9825050000000010\\\",\\\"VR\\\":\\\"0.0063538215000000\\\",\\\"CFX2L\\\":\\\"0.0499660045000000\\\",\\\"VSYS\\\":\\\"0.0005201398000000\\\",\\\"PANDORA\\\":\\\"1629.2949450001102772\\\",\\\"THETA\\\":\\\"1.2461766000000000\\\",\\\"XCN\\\":\\\"0.0012699647000000\\\",\\\"NEXG\\\":\\\"0.0039180400000000\\\",\\\"MELOS\\\":\\\"0.0021244372500000\\\",\\\"XCV\\\":\\\"0.0013253370000000\\\",\\\"ORN\\\":\\\"0.8797599000000000\\\",\\\"WLKN\\\":\\\"0.0010624685000000\\\",\\\"AAVE\\\":\\\"154.2708259999996162\\\",\\\"MNT\\\":\\\"0.6168914000000000\\\",\\\"BONK\\\":\\\"0.0000227296295000\\\",\\\"PERP\\\":\\\"0.6037979500000000\\\",\\\"XDC\\\":\\\"0.0276361750000000\\\",\\\"MNW\\\":\\\"0.3681158500000000\\\",\\\"XDB\\\":\\\"0.0002578710000000\\\",\\\"BOND\\\":\\\"1.5662165000000000\\\",\\\"SUIA\\\":\\\"0.0809595000000000\\\",\\\"MOG\\\":\\\"0.0000019330330000\\\",\\\"SUTER\\\":\\\"0.0001840079500000\\\",\\\"TIME\\\":\\\"16.2648634999999969\\\",\\\"RACA\\\":\\\"0.0001949025000000\\\",\\\"BICO\\\":\\\"0.2021988500000000\\\",\\\"MON\\\":\\\"0.1066466500000000\\\",\\\"SWEAT\\\":\\\"0.0063718125000000\\\",\\\"MOXIE\\\":\\\"0.0022088950000000\\\",\\\"BABYBNB\\\":\\\"0.0289755050000000\\\",\\\"IGU\\\":\\\"0.0050674650000000\\\",\\\"HMSTR\\\":\\\"0.0037990995000000\\\",\\\"XEC\\\":\\\"0.0000354722550000\\\",\\\"MONI\\\":\\\"0.0058470750000000\\\",\\\"XR\\\":\\\"0.2374812000000000\\\",\\\"PEOPLE\\\":\\\"0.0796601500000000\\\",\\\"PUMLX\\\":\\\"0.0054572700000000\\\",\\\"ZIL\\\":\\\"0.0145927000000000\\\",\\\"WLDDOWN\\\":\\\"0.2089954500000000\\\",\\\"VAI\\\":\\\"0.0799999800000000\\\",\\\"XEN\\\":\\\"0.0000000839580000\\\",\\\"MPC\\\":\\\"0.1001499000000000\\\",\\\"XEM\\\":\\\"0.0176951480000000\\\",\\\"JASMY3S\\\":\\\"0.0019670160000000\\\",\\\"OTK\\\":\\\"0.0290464695000000\\\",\\\"TRAC\\\":\\\"0.4521738000000000\\\",\\\"DFYN\\\":\\\"0.0070664650000000\\\",\\\"BIDP\\\":\\\"0.0001939030000000\\\",\\\"JASMY3L\\\":\\\"0.0001653772700000\\\",\\\"INJDOWN\\\":\\\"0.0000194902500000\\\",\\\"KLV\\\":\\\"0.0019310340000000\\\",\\\"WAXL\\\":\\\"0.7858069000000000\\\",\\\"TRBDOWN\\\":\\\"0.0023138425000000\\\",\\\"BCH3L\\\":\\\"4.6390663064999996\\\",\\\"GMT3S\\\":\\\"0.0000457771000000\\\",\\\"KMD\\\":\\\"0.2493752500000000\\\",\\\"BCH3S\\\":\\\"0.9634180500000000\\\",\\\"ECOX\\\":\\\"0.0987506000000000\\\",\\\"AAVE3S\\\":\\\"0.0560719500000000\\\",\\\"GMT3L\\\":\\\"0.0053983694650000\\\",\\\"EPIK\\\":\\\"0.0045857060000000\\\",\\\"SUIP\\\":\\\"0.1067565950000000\\\",\\\"AAVE3L\\\":\\\"0.3638687346200000\\\",\\\"ZK\\\":\\\"0.1262368500000000\\\",\\\"ZKF\\\":\\\"0.0008595700000000\\\",\\\"OMNIA\\\":\\\"0.7624186000000000\\\",\\\"ZKJ\\\":\\\"1.1124435000000000\\\",\\\"ZKL\\\":\\\"0.1255372000000000\\\",\\\"GAFI\\\":\\\"3.0634675000000001\\\",\\\"CARV\\\":\\\"0.8703646000000000\\\",\\\"KNC\\\":\\\"0.4433782000000000\\\",\\\"CATS\\\":\\\"0.0000599700000000\\\",\\\"PROM\\\":\\\"5.2833570000000006\\\",\\\"ALEPH\\\":\\\"0.1756121500000000\\\",\\\"PONKE\\\":\\\"0.3958020000000000\\\",\\\"OVR\\\":\\\"0.1553223000000000\\\",\\\"CATI\\\":\\\"0.4105146400000000\\\",\\\"ORDER\\\":\\\"0.1183008200000000\\\",\\\"GFT\\\":\\\"0.0166616650000000\\\",\\\"BIFI\\\":\\\"0.0020489750000000\\\",\\\"GGC\\\":\\\"6.9965029985000000\\\",\\\"GGG\\\":\\\"0.0403798000000000\\\",\\\"DAPPX\\\":\\\"0.0043788095000000\\\",\\\"SUKU\\\":\\\"0.0618790450000000\\\",\\\"ULTI\\\":\\\"0.0168015950000000\\\",\\\"CREDI\\\":\\\"0.0192903500000000\\\",\\\"ERTHA\\\":\\\"0.0010014990000000\\\",\\\"FURY\\\":\\\"0.1405297000000000\\\",\\\"KARRAT\\\":\\\"0.5577210000000000\\\",\\\"MOBILE\\\":\\\"0.0009005495000000\\\",\\\"SIDUS\\\":\\\"0.0037671155000000\\\",\\\"NAVI\\\":\\\"0.1254672350000000\\\",\\\"TAO\\\":\\\"583.4081500000051807\\\",\\\"USDJ\\\":\\\"1.1386304000000001\\\",\\\"MTL\\\":\\\"0.9563216000000000\\\",\\\"VET\\\":\\\"0.0225387250000000\\\",\\\"FITFI\\\":\\\"0.0036421780000000\\\",\\\"USDT\\\":\\\"0.9995000000000000\\\",\\\"OXT\\\":\\\"0.0695652000000000\\\",\\\"CANDY\\\":\\\"0.0005597200000000\\\",\\\"USDP\\\":\\\"0.9932031500000000\\\",\\\"MTS\\\":\\\"0.0027516235000000\\\",\\\"TADA\\\":\\\"0.0283858000000000\\\",\\\"MTV\\\":\\\"0.0006559718500000\\\",\\\"NAVX\\\":\\\"0.1342228550000000\\\",\\\"ILV\\\":\\\"35.6771524999999671\\\",\\\"VINU\\\":\\\"0.0000000109045450\\\",\\\"GHX\\\":\\\"0.0903548000000000\\\",\\\"EDU\\\":\\\"0.5167415000000000\\\",\\\"HYVE\\\":\\\"0.0137331300000000\\\",\\\"BTC3L\\\":\\\"0.0058620675000000\\\",\\\"ANYONE\\\":\\\"0.9015490000000000\\\",\\\"BEAT\\\":\\\"0.0012593700000000\\\",\\\"KING\\\":\\\"0.0004821588000000\\\",\\\"CREAM\\\":\\\"15.6541689999999973\\\",\\\"CAS\\\":\\\"0.0038590695000000\\\",\\\"IMX\\\":\\\"1.4944524000000000\\\",\\\"CAT\\\":\\\"0.0000256981445000\\\",\\\"BTC3S\\\":\\\"0.0014142925000000\\\",\\\"USDE\\\":\\\"0.9985005000000000\\\",\\\"USDD\\\":\\\"1.0000997000000000\\\",\\\"CWAR\\\":\\\"0.0037981000000000\\\",\\\"USDC\\\":\\\"0.9997998500000000\\\",\\\"KRL\\\":\\\"0.3543127550000000\\\",\\\"INJ\\\":\\\"21.7691100000000194\\\",\\\"GAME\\\":\\\"0.0139630150000000\\\",\\\"TRIBL\\\":\\\"1.0994500000000000\\\",\\\"XLM\\\":\\\"0.0948525500000000\\\",\\\"TRBUP\\\":\\\"0.0012293850000000\\\",\\\"VRADOWN\\\":\\\"0.0013433280000000\\\",\\\"SUPER\\\":\\\"1.2853570000000000\\\",\\\"EIGEN\\\":\\\"3.1536223999999999\\\",\\\"IOI\\\":\\\"0.0146926500000000\\\",\\\"KSM\\\":\\\"17.5212350000000129\\\",\\\"CCD\\\":\\\"0.0034832575000000\\\",\\\"EGO\\\":\\\"0.0093553200000000\\\",\\\"EGP\\\":\\\"2.7946019999999998\\\",\\\"MXC\\\":\\\"0.0066866550000000\\\",\\\"TEL\\\":\\\"0.0014432780000000\\\",\\\"MOVR\\\":\\\"9.1340307000000027\\\",\\\"XMR\\\":\\\"155.5421899999990755\\\",\\\"MXM\\\":\\\"0.0092853550000000\\\",\\\"OORT\\\":\\\"0.1099949750000000\\\",\\\"GLM\\\":\\\"0.3231383500000000\\\",\\\"RAY\\\":\\\"2.0228880499999998\\\",\\\"XTAG\\\":\\\"0.0218190850000000\\\",\\\"GLQ\\\":\\\"0.0854572500000000\\\",\\\"CWEB\\\":\\\"0.0038480750000000\\\",\\\"REVU\\\":\\\"0.0105047450000000\\\",\\\"REVV\\\":\\\"0.0039760110000000\\\",\\\"ZRO\\\":\\\"3.7952014499999994\\\",\\\"XNL\\\":\\\"0.0093853050000000\\\",\\\"XNO\\\":\\\"0.8496749500000000\\\",\\\"SAROS\\\":\\\"0.0019290350000000\\\",\\\"KACE\\\":\\\"2.1165411999999998\\\",\\\"ZRX\\\":\\\"0.3186406000000000\\\",\\\"WLTH\\\":\\\"0.0374312750000000\\\",\\\"ATOM3L\\\":\\\"0.0321719060000000\\\",\\\"GMM\\\":\\\"0.0001497251000000\\\",\\\"BEER\\\":\\\"0.0000138670630000\\\",\\\"GMT\\\":\\\"0.1275362000000000\\\",\\\"HEART\\\":\\\"0.0159920000000000\\\",\\\"GMX\\\":\\\"22.7186349999999882\\\",\\\"ABBC\\\":\\\"0.0061769100000000\\\",\\\"OMNI\\\":\\\"8.9235359999999970\\\",\\\"ATOM3S\\\":\\\"0.0007945225400000\\\",\\\"IRL\\\":\\\"0.0099650150000000\\\",\\\"CFG\\\":\\\"0.3248375000000000\\\",\\\"WSDM\\\":\\\"0.0139830050000000\\\",\\\"GNS\\\":\\\"1.8390800000000001\\\",\\\"VANRY\\\":\\\"0.0809295150000000\\\",\\\"CFX\\\":\\\"0.1595202000000000\\\",\\\"GRAIL\\\":\\\"817.1212349999937891\\\",\\\"BEFI\\\":\\\"0.0175712100000000\\\",\\\"VELO\\\":\\\"0.0132043945000000\\\",\\\"XPR\\\":\\\"0.0008077959000000\\\",\\\"DOVI\\\":\\\"0.0584707500000000\\\",\\\"ACE\\\":\\\"0.0021349320000000\\\",\\\"ACH\\\":\\\"0.0190534685000000\\\",\\\"ISP\\\":\\\"0.0012161916000000\\\",\\\"XCAD\\\":\\\"0.2834582000000000\\\",\\\"MINA\\\":\\\"0.5630183500000000\\\",\\\"TIA\\\":\\\"5.9318325999999999\\\",\\\"DRIFT\\\":\\\"0.4350823500000000\\\",\\\"ACQ\\\":\\\"0.0056981495000000\\\",\\\"ACS\\\":\\\"0.0014917537500000\\\",\\\"MIND\\\":\\\"0.0018920535000000\\\",\\\"STORE\\\":\\\"0.0062358805000000\\\",\\\"REN\\\":\\\"0.0351224300000000\\\",\\\"ELA\\\":\\\"1.7282354500000000\\\",\\\"DREAMS\\\":\\\"0.0002498750000000\\\",\\\"ADA\\\":\\\"0.3463267500000000\\\",\\\"ELF\\\":\\\"0.3777110500000000\\\",\\\"REQ\\\":\\\"0.0959919800000000\\\",\\\"STORJ\\\":\\\"0.5662167500000000\\\",\\\"LADYS\\\":\\\"0.0000000837581000\\\",\\\"PAXG\\\":\\\"2697.9303600003123340\\\",\\\"REZ\\\":\\\"0.0409795000000000\\\",\\\"XRD\\\":\\\"0.0157821050000000\\\",\\\"CHO\\\":\\\"0.0205097400000000\\\",\\\"CHR\\\":\\\"0.1769115000000000\\\",\\\"ADS\\\":\\\"0.1889055000000000\\\",\\\"CHZ\\\":\\\"0.0738030800000000\\\",\\\"ADX\\\":\\\"0.1575212000000000\\\",\\\"XRP\\\":\\\"0.5525036100000000\\\",\\\"JASMY\\\":\\\"0.0188615645000000\\\",\\\"KAGI\\\":\\\"0.1834582250000000\\\",\\\"FIDA\\\":\\\"0.2282858000000000\\\",\\\"PBR\\\":\\\"0.0291953950000000\\\",\\\"AEG\\\":\\\"0.0093453250000000\\\",\\\"H2O\\\":\\\"0.1610194500000000\\\",\\\"CHMB\\\":\\\"0.0001715641750000\\\",\\\"SAND3L\\\":\\\"0.0015447972150000\\\",\\\"PBX\\\":\\\"0.0006879558500000\\\",\\\"SOLVE\\\":\\\"0.0084557700000000\\\",\\\"DECHAT\\\":\\\"0.1512243500000000\\\",\\\"GARI\\\":\\\"0.0076861550000000\\\",\\\"SHIB2L\\\":\\\"1.1996998499999999\\\",\\\"SHIB2S\\\":\\\"0.0240879500000000\\\",\\\"ENA\\\":\\\"0.3942028000000000\\\",\\\"VEMP\\\":\\\"0.0029335325000000\\\",\\\"ENJ\\\":\\\"0.1467266000000000\\\",\\\"AFG\\\":\\\"0.0072163900000000\\\",\\\"RATS\\\":\\\"0.0001211593900000\\\",\\\"GRT\\\":\\\"0.1646076550000000\\\",\\\"FORWARD\\\":\\\"0.0012873560000000\\\",\\\"TFUEL\\\":\\\"0.0598800450000000\\\",\\\"ENS\\\":\\\"17.0634640000000052\\\",\\\"KASDOWN\\\":\\\"0.0258770550000000\\\",\\\"XTM\\\":\\\"0.0251074400000000\\\",\\\"DEGEN\\\":\\\"0.0084857550000000\\\",\\\"TLM\\\":\\\"0.0100449750000000\\\",\\\"DYDXDOWN\\\":\\\"0.1042598440000000\\\",\\\"CKB\\\":\\\"0.0146026950000000\\\",\\\"LUNC\\\":\\\"0.0000889255150000\\\",\\\"AURORA\\\":\\\"0.1204397500000000\\\",\\\"LUNA\\\":\\\"0.3624187000000000\\\",\\\"XTZ\\\":\\\"0.6776610000000000\\\",\\\"ELON\\\":\\\"0.0000001410294500\\\",\\\"DMTR\\\":\\\"0.0891554000000000\\\",\\\"EOS\\\":\\\"0.4759619000000000\\\",\\\"GST\\\":\\\"0.0118940500000000\\\",\\\"FORT\\\":\\\"0.1155422000000000\\\",\\\"FLAME\\\":\\\"0.0247076400000000\\\",\\\"PATEX\\\":\\\"0.9605195000000000\\\",\\\"DEEP\\\":\\\"0.0328885475000000\\\",\\\"ID3L\\\":\\\"0.0016201895000000\\\",\\\"GTC\\\":\\\"0.6625685500000000\\\",\\\"ID3S\\\":\\\"0.0071674145000000\\\",\\\"RIO\\\":\\\"0.7616190000000000\\\",\\\"CLH\\\":\\\"0.0008555720000000\\\",\\\"BURGER\\\":\\\"0.4016990500000000\\\",\\\"VRA\\\":\\\"0.0029765110000000\\\",\\\"SUNDOG\\\":\\\"0.2173912500000000\\\",\\\"GTT\\\":\\\"0.0002038980000000\\\",\\\"INJUP\\\":\\\"0.2327835500000000\\\",\\\"CPOOL\\\":\\\"0.1557720750000000\\\",\\\"EPX\\\":\\\"0.0000740629500000\\\",\\\"CLV\\\":\\\"0.0329835000000000\\\",\\\"FEAR\\\":\\\"0.0560519600000000\\\",\\\"MEME\\\":\\\"0.0124847545000000\\\",\\\"ROOBEE\\\":\\\"0.0004520738500000\\\",\\\"DEFI\\\":\\\"0.0192903500000000\\\",\\\"TOKEN\\\":\\\"0.0477361200000000\\\",\\\"GRAPE\\\":\\\"0.0020599695000000\\\",\\\"KASUP\\\":\\\"0.3996001000000000\\\",\\\"XWG\\\":\\\"0.0003843077500000\\\",\\\"SKEY\\\":\\\"0.0621289200000000\\\",\\\"SFUND\\\":\\\"1.3243375000000000\\\",\\\"EQX\\\":\\\"0.0032823580000000\\\",\\\"ORDIUP\\\":\\\"0.0548315705000000\\\",\\\"TON\\\":\\\"5.1857058499999995\\\",\\\"DEGO\\\":\\\"2.2667660500000001\\\",\\\"IZI\\\":\\\"0.0088455750000000\\\",\\\"ERG\\\":\\\"0.6605695500000000\\\",\\\"ERN\\\":\\\"1.9255367500000001\\\",\\\"VENOM\\\":\\\"0.0817591000000000\\\",\\\"VOXEL\\\":\\\"0.1497251000000000\\\",\\\"RLC\\\":\\\"1.4649671500000000\\\",\\\"PHA\\\":\\\"0.1093453000000000\\\",\\\"DYDXUP\\\":\\\"0.0112573685000000\\\",\\\"APE3S\\\":\\\"0.0008475760000000\\\",\\\"ORBS\\\":\\\"0.0288955450000000\\\",\\\"OPDOWN\\\":\\\"0.6758619000000000\\\",\\\"ESE\\\":\\\"0.0139130400000000\\\",\\\"APE3L\\\":\\\"0.1339330000000000\\\",\\\"HMND\\\":\\\"0.0982208650000000\\\",\\\"COQ\\\":\\\"0.0000014432780000\\\",\\\"AURY\\\":\\\"0.3340329000000000\\\",\\\"CULT\\\":\\\"0.0000028025980000\\\",\\\"AKT\\\":\\\"2.4642672500000001\\\",\\\"GLMR\\\":\\\"0.1606196500000000\\\",\\\"XYM\\\":\\\"0.0142528700000000\\\",\\\"ORAI\\\":\\\"6.1769100000000012\\\",\\\"XYO\\\":\\\"0.0058680645000000\\\",\\\"ETC\\\":\\\"18.8458723500000169\\\",\\\"LAI\\\":\\\"0.0142828550000000\\\",\\\"PIP\\\":\\\"0.0178310800000000\\\",\\\"ETH\\\":\\\"2607.6655149998362673\\\",\\\"NEO\\\":\\\"10.3575186499999991\\\",\\\"RMV\\\":\\\"0.0081659150000000\\\",\\\"KLAY\\\":\\\"0.1251374000000000\\\",\\\"PIT\\\":\\\"0.0000000003268365\\\",\\\"TARA\\\":\\\"0.0043978000000000\\\",\\\"KALT\\\":\\\"0.1128735350000000\\\",\\\"PIX\\\":\\\"0.0001023687900000\\\",\\\"ETN\\\":\\\"0.0021579205000000\\\",\\\"CSIX\\\":\\\"0.0141729100000000\\\",\\\"TRADE\\\":\\\"0.4708644500000000\\\",\\\"MAVIA\\\":\\\"1.3592200500000001\\\",\\\"HIGH\\\":\\\"1.3043474999999999\\\",\\\"TRB\\\":\\\"62.5387150000000006\\\",\\\"ORDI\\\":\\\"35.7421200000000126\\\",\\\"TRVL\\\":\\\"0.0373643085000000\\\",\\\"AMB\\\":\\\"0.0059670150000000\\\",\\\"TRU\\\":\\\"0.0762018800000000\\\",\\\"LOGX\\\":\\\"0.0271963950000000\\\",\\\"FINC\\\":\\\"0.0362018900000000\\\",\\\"INFRA\\\":\\\"0.1978010500000000\\\",\\\"NATIX\\\":\\\"0.0008729633000000\\\",\\\"NFP\\\":\\\"0.2152923000000000\\\",\\\"TRY\\\":\\\"0.0292166033323590\\\",\\\"TRX\\\":\\\"0.1597201000000000\\\",\\\"LBP\\\":\\\"0.0001243378000000\\\",\\\"LBR\\\":\\\"0.0595702000000000\\\",\\\"EUL\\\":\\\"2.9735125000000000\\\",\\\"NFT\\\":\\\"0.0000004077960000\\\",\\\"SEIUP\\\":\\\"0.0478110825000000\\\",\\\"PUFFER\\\":\\\"0.3676161000000000\\\",\\\"EUR\\\":\\\"1.0811249323958897\\\",\\\"ORCA\\\":\\\"2.0664662499999999\\\",\\\"NEAR3L\\\":\\\"0.0117010765350000\\\",\\\"AMP\\\":\\\"0.0038330825000000\\\",\\\"XDEFI\\\":\\\"0.0472563600000000\\\",\\\"HIFI\\\":\\\"0.4947525000000000\\\",\\\"TRUF\\\":\\\"0.0459570100000000\\\",\\\"AITECH\\\":\\\"0.1045477000000000\\\",\\\"AMU\\\":\\\"0.0043978000000000\\\",\\\"USTC\\\":\\\"0.0214692600000000\\\",\\\"KNGL\\\":\\\"0.0499750000000000\\\",\\\"FOXY\\\":\\\"0.0102686631000000\\\",\\\"NGC\\\":\\\"0.0147935995000000\\\",\\\"TENET\\\":\\\"0.0043278350000000\\\",\\\"NEAR3S\\\":\\\"0.0072553705000000\\\",\\\"MAHA\\\":\\\"1.1904045000000000\\\",\\\"NGL\\\":\\\"0.0701748950000000\\\",\\\"TST\\\":\\\"0.0080359800000000\\\",\\\"HIPPO\\\":\\\"0.0104447750000000\\\",\\\"AXS3S\\\":\\\"0.0308705570000000\\\",\\\"CRO\\\":\\\"0.0781409100000000\\\",\\\"ZPAY\\\":\\\"0.0050574700000000\\\",\\\"MNDE\\\":\\\"0.1026786350000000\\\",\\\"CRV\\\":\\\"0.2534732000000000\\\",\\\"SWASH\\\":\\\"0.0056271850000000\\\",\\\"AXS3L\\\":\\\"0.0106388779000000\\\",\\\"VERSE\\\":\\\"0.0001803098000000\\\",\\\"RPK\\\":\\\"0.0049975000000000\\\",\\\"RPL\\\":\\\"10.9745099999999958\\\",\\\"AZERO\\\":\\\"0.3789104500000000\\\",\\\"SOUL\\\":\\\"0.0534332700000000\\\",\\\"VXV\\\":\\\"0.2619689500000000\\\",\\\"LDO\\\":\\\"1.0885554500000000\\\",\\\"MAGIC\\\":\\\"0.3390304000000000\\\",\\\"ALICE\\\":\\\"1.0324835000000000\\\",\\\"SEAM\\\":\\\"1.1933030499999999\\\",\\\"PLU\\\":\\\"1.9300345000000001\\\",\\\"AOG\\\":\\\"0.0031224380000000\\\",\\\"SMOLE\\\":\\\"0.0000387806000000\\\",\\\"EWT\\\":\\\"1.1094450000000000\\\",\\\"TSUGT\\\":\\\"0.0029185400000000\\\",\\\"PMG\\\":\\\"0.0800599500000000\\\",\\\"OPAI\\\":\\\"0.0006826585000000\\\",\\\"LOCUS\\\":\\\"0.0216591650000000\\\",\\\"CTA\\\":\\\"0.0825087250000000\\\",\\\"NIM\\\":\\\"0.0013673160000000\\\",\\\"CTC\\\":\\\"0.4033982000000000\\\",\\\"APE\\\":\\\"0.7035480500000000\\\",\\\"MERL\\\":\\\"0.2720639000000000\\\",\\\"JAM\\\":\\\"0.0004770613500000\\\",\\\"CTI\\\":\\\"0.0130314810000000\\\",\\\"APP\\\":\\\"0.0021989000000000\\\",\\\"APT\\\":\\\"9.9947001500000000\\\",\\\"WLDUP\\\":\\\"0.0093043455000000\\\",\\\"ZEND\\\":\\\"0.1280759300000000\\\",\\\"FIRE\\\":\\\"0.9113441000000000\\\",\\\"DENT\\\":\\\"0.0008630682500000\\\",\\\"PYTH\\\":\\\"0.3390603850000000\\\",\\\"LFT\\\":\\\"0.0155322300000000\\\",\\\"DPET\\\":\\\"0.0319040400000000\\\",\\\"ORDIDOWN\\\":\\\"0.3788105000000000\\\",\\\"KPOL\\\":\\\"0.0029175405000000\\\",\\\"ETHUP\\\":\\\"8.4971493000000032\\\",\\\"BAND\\\":\\\"1.0939527500000001\\\",\\\"POL\\\":\\\"0.3656171000000000\\\",\\\"ASTR\\\":\\\"0.0582608550000000\\\",\\\"NKN\\\":\\\"0.0691654000000000\\\",\\\"RSR\\\":\\\"0.0068055955000000\\\",\\\"DVPN\\\":\\\"0.0005979009000000\\\",\\\"TWT\\\":\\\"1.1119437500000000\\\",\\\"ARB\\\":\\\"0.5510243500000000\\\",\\\"CVC\\\":\\\"0.1409801746501747\\\",\\\"ARC\\\":\\\"0.0300849500000000\\\",\\\"XETA\\\":\\\"0.0022888550000000\\\",\\\"MTRG\\\":\\\"0.4007995000000000\\\",\\\"LOKA\\\":\\\"0.1867066000000000\\\",\\\"LPOOL\\\":\\\"0.0660069800000000\\\",\\\"TURBOS\\\":\\\"0.0034812585000000\\\",\\\"CVX\\\":\\\"1.7816087499999999\\\",\\\"ARX\\\":\\\"0.0007556220000000\\\",\\\"MPLX\\\":\\\"0.4355221300000000\\\",\\\"SUSHI\\\":\\\"0.7011492500000000\\\",\\\"NLK\\\":\\\"0.0114442750000000\\\",\\\"PEPE2\\\":\\\"0.0000000313843000\\\",\\\"WBTC\\\":\\\"66881.4425499645548419\\\",\\\"SUI3L\\\":\\\"0.0211204345000000\\\",\\\"CWS\\\":\\\"0.1927036000000000\\\",\\\"SUI3S\\\":\\\"0.0000579110300000\\\",\\\"INSP\\\":\\\"0.0264167850000000\\\",\\\"MANA\\\":\\\"0.2945026750000000\\\",\\\"VRTX\\\":\\\"0.0641679000000000\\\",\\\"CSPR\\\":\\\"0.0116441750000000\\\",\\\"ATA\\\":\\\"0.0785007300000000\\\",\\\"OPEN\\\":\\\"0.0080049955000000\\\",\\\"HAI\\\":\\\"0.0448275750000000\\\",\\\"NMR\\\":\\\"14.7436245000000072\\\",\\\"ATH\\\":\\\"0.0540929400000000\\\",\\\"LIT\\\":\\\"0.6282857000000000\\\",\\\"TLOS\\\":\\\"0.3263467450000000\\\",\\\"TNSR\\\":\\\"0.3662168000000000\\\",\\\"CXT\\\":\\\"0.0871364100000000\\\",\\\"POLYX\\\":\\\"0.2346826000000000\\\",\\\"ZERO\\\":\\\"0.0002507745500000\\\",\\\"ROUTE\\\":\\\"0.0610694500000000\\\",\\\"LOOM\\\":\\\"0.0580009850000000\\\",\\\"PRE\\\":\\\"0.0078680640000000\\\",\\\"VRAUP\\\":\\\"0.0134652640000000\\\",\\\"HBB\\\":\\\"0.0714742450000000\\\",\\\"RVN\\\":\\\"0.0165017450000000\\\",\\\"PRQ\\\":\\\"0.0715741950000000\\\",\\\"ONDO\\\":\\\"0.7134930750000000\\\",\\\"PEPEDOWN\\\":\\\"0.0000155022450000\\\",\\\"WOOP\\\":\\\"0.0020179905000000\\\",\\\"LUNCUP\\\":\\\"0.0168355780000000\\\",\\\"KAVA\\\":\\\"0.3522238000000000\\\",\\\"LKI\\\":\\\"0.0104187880000000\\\",\\\"AVA\\\":\\\"0.4857570000000000\\\",\\\"NOM\\\":\\\"0.0233883000000000\\\",\\\"MAPO\\\":\\\"0.0089015470000000\\\",\\\"PEPEUP\\\":\\\"0.0114252845000000\\\",\\\"STRAX\\\":\\\"0.0487156300000000\\\",\\\"NOT\\\":\\\"0.0078670645000000\\\",\\\"ZERC\\\":\\\"0.1108245600000000\\\",\\\"BCUT\\\":\\\"0.0255672100000000\\\",\\\"MASA\\\":\\\"0.0691354150000000\\\",\\\"WAN\\\":\\\"0.1785077544737212\\\",\\\"WAT\\\":\\\"0.0003273762300000\\\",\\\"WAX\\\":\\\"0.0327636100000000\\\",\\\"MASK\\\":\\\"2.2259864500000002\\\",\\\"EOS3L\\\":\\\"0.0002122138400000\\\",\\\"IDEA\\\":\\\"0.0005887055000000\\\",\\\"EOS3S\\\":\\\"0.0034472755000000\\\",\\\"YFI\\\":\\\"4919.4290549999908843\\\",\\\"MOODENG\\\":\\\"0.0774612500000000\\\",\\\"XCUR\\\":\\\"0.0048845565000000\\\",\\\"HYDRA\\\":\\\"0.2225886500000000\\\",\\\"POPCAT\\\":\\\"1.3382305500000000\\\",\\\"LQTY\\\":\\\"0.7848074000000000\\\",\\\"PIXEL\\\":\\\"0.1406596350000000\\\",\\\"LMR\\\":\\\"0.0145437245000000\\\",\\\"ZETA\\\":\\\"0.5997999500000000\\\",\\\"YGG\\\":\\\"0.4717640000000000\\\",\\\"AXS\\\":\\\"4.6006985000000006\\\",\\\"BCHSV\\\":\\\"49.8250749999999370\\\",\\\"NRN\\\":\\\"0.0395802000000000\\\",\\\"FTON\\\":\\\"0.0091954000000000\\\",\\\"COMP\\\":\\\"43.6581599999999881\\\",\\\"XPRT\\\":\\\"0.1819090000000000\\\",\\\"HFT\\\":\\\"0.1443278000000000\\\",\\\"UXLINK\\\":\\\"0.5085456000000000\\\",\\\"STAMP\\\":\\\"0.0335032400000000\\\",\\\"RUNE\\\":\\\"4.9233370999999996\\\",\\\"ZEUS\\\":\\\"0.2587705500000000\\\",\\\"LTC3L\\\":\\\"1.8294848000000001\\\",\\\"DAPP\\\":\\\"0.1763118000000000\\\",\\\"FORTH\\\":\\\"2.9508238500000004\\\",\\\"ALPINE\\\":\\\"1.5322335000000000\\\",\\\"SENSO\\\":\\\"0.0328835500000000\\\",\\\"LTC3S\\\":\\\"0.0006986505000000\\\",\\\"DEXE\\\":\\\"8.3795081500000028\\\",\\\"GOAL\\\":\\\"0.0175912000000000\\\",\\\"AVAX\\\":\\\"27.5602130000000058\\\",\\\"LISTA\\\":\\\"0.3782108000000000\\\",\\\"AMPL\\\":\\\"1.3743124999999999\\\",\\\"WORK\\\":\\\"0.1384307500000000\\\",\\\"BRWL\\\":\\\"0.0017391300000000\\\",\\\"BANANA\\\":\\\"57.1314200000001362\\\",\\\"PUSH\\\":\\\"0.0750624500000000\\\",\\\"WEN\\\":\\\"0.0001015492000000\\\",\\\"NEIRO\\\":\\\"0.0879560000000000\\\",\\\"BTCUP\\\":\\\"34.7711057499999789\\\",\\\"SOL3S\\\":\\\"0.0007816090000000\\\",\\\"BRAWL\\\":\\\"0.0004776610500000\\\",\\\"LAY3R\\\":\\\"0.2161918500000000\\\",\\\"LPT\\\":\\\"11.9304317999999945\\\",\\\"GODS\\\":\\\"0.1807096000000000\\\",\\\"SAND3S\\\":\\\"4.6152911999999992\\\",\\\"RDNT\\\":\\\"0.0640679500000000\\\",\\\"SOL3L\\\":\\\"1.8351913752850000\\\",\\\"NIBI\\\":\\\"0.0653772950000000\\\",\\\"NUM\\\":\\\"0.0436181800000000\\\",\\\"PYR\\\":\\\"2.5590198499999997\\\",\\\"DAG\\\":\\\"0.0226176855000000\\\",\\\"DAI\\\":\\\"0.9989006596042375\\\",\\\"HIP\\\":\\\"0.0034982500000000\\\",\\\"DAO\\\":\\\"0.2848575000000000\\\",\\\"AVAIL\\\":\\\"0.1300929210000000\\\",\\\"DAR\\\":\\\"0.1512243500000000\\\",\\\"FET\\\":\\\"1.3760116500000000\\\",\\\"FCON\\\":\\\"0.0001197600900000\\\",\\\"XAVA\\\":\\\"0.3789104500000000\\\",\\\"LRC\\\":\\\"0.1208395500000000\\\",\\\"UNI3S\\\":\\\"0.0000653573050000\\\",\\\"PZP\\\":\\\"0.0599600050000000\\\",\\\"POKT\\\":\\\"0.0424787500000000\\\",\\\"DASH\\\":\\\"23.6881500000000109\\\",\\\"BAKEDOWN\\\":\\\"0.0003324636850000\\\",\\\"POLC\\\":\\\"0.0061389290000000\\\",\\\"DBR\\\":\\\"0.0377671070000000\\\",\\\"CIRUS\\\":\\\"0.0055772100000000\\\",\\\"UNI3L\\\":\\\"0.0993921490650000\\\",\\\"NWC\\\":\\\"0.0681659000000000\\\",\\\"POLK\\\":\\\"0.0142628650000000\\\",\\\"LSD\\\":\\\"0.9420287500000000\\\",\\\"MARS4\\\":\\\"0.0005878059500000\\\",\\\"LSK\\\":\\\"0.8080957500000000\\\",\\\"BLOCK\\\":\\\"0.0261869000000000\\\",\\\"ANALOS\\\":\\\"0.0000446776500000\\\",\\\"SAFE\\\":\\\"0.8779608000000000\\\",\\\"DCK\\\":\\\"0.0234082900000000\\\",\\\"LSS\\\":\\\"0.0562718500000000\\\",\\\"DCR\\\":\\\"12.4337799999999929\\\",\\\"LIKE\\\":\\\"0.0559720000000000\\\",\\\"DATA\\\":\\\"0.0361819000000000\\\",\\\"WIF\\\":\\\"2.5696145499999999\\\",\\\"BLOK\\\":\\\"0.0006546725000000\\\",\\\"LTC\\\":\\\"71.6261690000000611\\\",\\\"METIS\\\":\\\"42.0289750000000612\\\",\\\"WIN\\\":\\\"0.0000868365600000\\\",\\\"HLG\\\":\\\"0.0018790600000000\\\",\\\"LTO\\\":\\\"0.1166116650000000\\\",\\\"DYDX\\\":\\\"0.9341327000000000\\\",\\\"ARB3S\\\":\\\"0.0509025360000000\\\",\\\"MUBI\\\":\\\"0.0303848000000000\\\",\\\"ARB3L\\\":\\\"0.0025917035000000\\\",\\\"RBTC1\\\":\\\"0.0000039480250000\\\",\\\"POND\\\":\\\"0.0118640650000000\\\",\\\"LINA\\\":\\\"0.0037771105000000\\\",\\\"MYRIA\\\":\\\"0.0025337325000000\\\",\\\"LINK\\\":\\\"11.0244849999999944\\\",\\\"QTUM\\\":\\\"2.4262016723130069\\\",\\\"TUNE\\\":\\\"0.0148025950000000\\\",\\\"UFO\\\":\\\"0.0000006479758500\\\",\\\"CYBER\\\":\\\"2.8755615000000001\\\",\\\"WILD\\\":\\\"0.2433782500000000\\\",\\\"POLS\\\":\\\"0.2809594500000000\\\",\\\"NYM\\\":\\\"0.0719640000000000\\\",\\\"FIL\\\":\\\"3.6786597500000005\\\",\\\"BAL\\\":\\\"2.0099945000000000\\\",\\\"SCA\\\":\\\"0.3999999000000000\\\",\\\"STND\\\":\\\"0.0133123405000000\\\",\\\"WMTX\\\":\\\"0.2138930000000000\\\",\\\"SCLP\\\":\\\"0.1545227000000000\\\",\\\"MANEKI\\\":\\\"0.0073963000000000\\\",\\\"BAT\\\":\\\"0.1721139000000000\\\",\\\"AKRO\\\":\\\"0.0042302838000000\\\",\\\"FTM3L\\\":\\\"8.2574692000000024\\\",\\\"BAX\\\":\\\"0.0000709645000000\\\",\\\"FTM3S\\\":\\\"0.0000255072400000\\\",\\\"COTI\\\":\\\"0.0951524000000000\\\"}}", + "x-request-example": "{\\\"base\\\": \\\"USD\\\", \\\"currencies\\\": \\\"example_string_default_value\\\"}" } }, - "/api/v3/market/orderbook/level2": { + "/api/v1/market/stats": { "get": { - "summary": "Get Full OrderBook", + "summary": "Get 24hr Stats", "deprecated": false, - "description": "Query for Full orderbook depth data. (aggregated by price) It is generally used by professional traders because it uses more server resources and traffic, and we have strict access rate limit control. To maintain up-to-date Order Book, please use Websocket incremental feed after retrieving the OrderBook.", + "description": "Request via this endpoint to get the statistics of the specified ticker in the last 24 hours.", "tags": [], "parameters": [ { @@ -5534,145 +5652,87 @@ "properties": { "time": { "type": "integer", - "description": "Timestamp(millisecond)", + "description": "timestamp", "format": "int64" }, - "sequence": { + "symbol": { "type": "string", - "description": "Sequence number" + "description": "Symbol" }, - "bids": { - "type": "array", - "items": { - "type": "array", - "items": { - "type": "string", - "description": "Price, Size" - } - }, - "description": "bids, from high to low" + "buy": { + "type": "string", + "description": "Best bid price\n" }, - "asks": { - "type": "array", - "items": { - "type": "array", - "items": { - "type": "string", - "description": "Price, Size" - } - }, - "description": "asks, from low to high" - } - }, - "required": [ - "time", - "sequence", - "bids", - "asks" - ] - } - }, - "required": [ - "code", - "data" - ] - } - } - } - } - }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470164", - "x-abandon": "normal", - "x-domain": "Spot", - "x-api-channel": "Private", - "x-api-permission": "General", - "x-api-rate-limit-pool": "Spot", - "x-sdk-service": "Spot", - "x-sdk-sub-service": "Market", - "x-sdk-method-name": "getFullOrderBook", - "x-sdk-method-description": "Query for Full orderbook depth data. (aggregated by price) It is generally used by professional traders because it uses more server resources and traffic, and we have strict access rate limit control. To maintain up-to-date Order Book, please use Websocket incremental feed after retrieving the OrderBook.", - "x-api-rate-limit": 3, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"time\\\": 1729176273859,\\n \\\"sequence\\\": \\\"14610502970\\\",\\n \\\"bids\\\": [\\n [\\n \\\"66976.4\\\",\\n \\\"0.69109872\\\"\\n ],\\n [\\n \\\"66976.3\\\",\\n \\\"0.14377\\\"\\n ]\\n ],\\n \\\"asks\\\": [\\n [\\n \\\"66976.5\\\",\\n \\\"0.05408199\\\"\\n ],\\n [\\n \\\"66976.8\\\",\\n \\\"0.0005\\\"\\n ]\\n ]\\n }\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\"}" - } - }, - "/api/v1/market/orderbook/level2_{size}": { - "get": { - "summary": "Get Part OrderBook", - "deprecated": false, - "description": "Query for part orderbook depth data. (aggregated by price) You are recommended to request via this endpoint as the system reponse would be faster and cosume less traffic.", - "tags": [], - "parameters": [ - { - "name": "symbol", - "in": "query", - "description": "symbol", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "size", - "in": "path", - "description": "Get the depth layer, optional value: 20, 100", - "required": true, - "schema": { - "type": "integer" - } - } - ], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "data": { - "type": "object", - "properties": { - "time": { - "type": "integer", - "description": "Timestamp(millisecond)", - "format": "int64" + "sell": { + "type": "string", + "description": "Best ask price" }, - "sequence": { + "changeRate": { "type": "string", - "description": "Sequence number" + "description": "24h change rate" }, - "bids": { - "type": "array", - "items": { - "type": "array", - "items": { - "type": "string", - "description": "Price, Size" - } - }, - "description": "bids, from high to low" + "changePrice": { + "type": "string", + "description": "24h change price" }, - "asks": { - "type": "array", - "items": { - "type": "array", - "items": { - "type": "string", - "description": "Price, Size" - } - }, - "description": "asks, from low to high" + "high": { + "type": "string", + "description": "Highest price in 24h" + }, + "low": { + "type": "string", + "description": "Lowest price in 24h" + }, + "vol": { + "type": "string", + "description": "24h volume, executed based on base currency" + }, + "volValue": { + "type": "string", + "description": "24h traded amount" + }, + "last": { + "type": "string", + "description": "Last traded price" + }, + "averagePrice": { + "type": "string", + "description": "Average trading price in the last 24 hours" + }, + "takerFeeRate": { + "type": "string", + "description": "Basic Taker Fee" + }, + "makerFeeRate": { + "type": "string", + "description": "Basic Maker Fee" + }, + "takerCoefficient": { + "type": "string", + "description": "The taker fee coefficient. The actual fee needs to be multiplied by this coefficient to get the final fee. Most currencies have a coefficient of 1. If set to 0, it means no fee" + }, + "makerCoefficient": { + "type": "string", + "description": "The maker fee coefficient. The actual fee needs to be multiplied by this coefficient to get the final fee. Most currencies have a coefficient of 1. If set to 0, it means no fee" } }, "required": [ - "sequence", - "bids", - "asks", - "time" + "time", + "symbol", + "buy", + "sell", + "changeRate", + "changePrice", + "high", + "low", + "vol", + "volValue", + "last", + "averagePrice", + "takerFeeRate", + "makerFeeRate", + "takerCoefficient", + "makerCoefficient" ] } }, @@ -5685,7 +5745,7 @@ } } }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470165", + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470161", "x-abandon": "normal", "x-domain": "Spot", "x-api-channel": "Public", @@ -5693,11 +5753,11 @@ "x-api-rate-limit-pool": "Public", "x-sdk-service": "Spot", "x-sdk-sub-service": "Market", - "x-sdk-method-name": "getPartOrderBook", - "x-sdk-method-description": "Query for part orderbook depth data. (aggregated by price) You are recommended to request via this endpoint as the system reponse would be faster and cosume less traffic.", - "x-api-rate-limit": 2, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"time\\\": 1729176273859,\\n \\\"sequence\\\": \\\"14610502970\\\",\\n \\\"bids\\\": [\\n [\\n \\\"66976.4\\\",\\n \\\"0.69109872\\\"\\n ],\\n [\\n \\\"66976.3\\\",\\n \\\"0.14377\\\"\\n ]\\n ],\\n \\\"asks\\\": [\\n [\\n \\\"66976.5\\\",\\n \\\"0.05408199\\\"\\n ],\\n [\\n \\\"66976.8\\\",\\n \\\"0.0005\\\"\\n ]\\n ]\\n }\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"size\\\": \\\"20\\\"}" + "x-sdk-method-name": "get24hrStats", + "x-sdk-method-description": "Request via this endpoint to get the statistics of the specified ticker in the last 24 hours.", + "x-api-rate-limit": 15, + "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"time\\\":1729175612158,\\\"symbol\\\":\\\"BTC-USDT\\\",\\\"buy\\\":\\\"66982.4\\\",\\\"sell\\\":\\\"66982.5\\\",\\\"changeRate\\\":\\\"-0.0114\\\",\\\"changePrice\\\":\\\"-778.1\\\",\\\"high\\\":\\\"68107.7\\\",\\\"low\\\":\\\"66683.3\\\",\\\"vol\\\":\\\"1738.02898182\\\",\\\"volValue\\\":\\\"117321982.415978333\\\",\\\"last\\\":\\\"66981.5\\\",\\\"averagePrice\\\":\\\"67281.21437289\\\",\\\"takerFeeRate\\\":\\\"0.001\\\",\\\"makerFeeRate\\\":\\\"0.001\\\",\\\"takerCoefficient\\\":\\\"1\\\",\\\"makerCoefficient\\\":\\\"1\\\"}}", + "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\"}" } }, "/api/v1/markets": { @@ -5748,11 +5808,58 @@ "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":[\\\"USDS\\\",\\\"TON\\\",\\\"AI\\\",\\\"DePIN\\\",\\\"PoW\\\",\\\"BRC-20\\\",\\\"ETF\\\",\\\"KCS\\\",\\\"Meme\\\",\\\"Solana\\\",\\\"FIAT\\\",\\\"VR&AR\\\",\\\"DeFi\\\",\\\"Polkadot\\\",\\\"BTC\\\",\\\"ALTS\\\",\\\"Layer 1\\\"]}" } }, - "/api/v1/market/allTickers": { + "/api/v1/timestamp": { "get": { - "summary": "Get All Tickers", + "summary": "Get Server Time", "deprecated": false, - "description": "Request market tickers for all the trading pairs in the market (including 24h volume), takes a snapshot every 2 seconds. On the rare occasion that we will change the currency name, if you still want the changed symbol name, you can use the symbolName field instead of the symbol field via “Get all tickers” endpoint.", + "description": "Get the server time.", + "tags": [], + "parameters": [], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "integer", + "format": "int64", + "description": "ServerTime(millisecond)" + } + }, + "required": [ + "code", + "data" + ] + } + } + } + } + }, + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470156", + "x-abandon": "normal", + "x-domain": "Spot", + "x-api-channel": "Public", + "x-api-permission": "NULL", + "x-api-rate-limit-pool": "Public", + "x-sdk-service": "Spot", + "x-sdk-sub-service": "Market", + "x-sdk-method-name": "getServerTime", + "x-sdk-method-description": "Get the server time.", + "x-api-rate-limit": 3, + "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":1729100692873}" + } + }, + "/api/v1/status": { + "get": { + "summary": "Get Service Status", + "deprecated": false, + "description": "Get the service status", "tags": [], "parameters": [], "responses": { @@ -5769,147 +5876,40 @@ "data": { "type": "object", "properties": { - "time": { - "type": "integer", - "description": "timestamp", - "format": "int64" - }, - "ticker": { - "type": "array", - "items": { - "type": "object", - "properties": { - "symbol": { - "type": "string", - "description": "Symbol" - }, - "symbolName": { - "type": "string", - "description": "Name of trading pairs, it would change after renaming" - }, - "buy": { - "type": "string", - "description": "Best bid price" - }, - "bestBidSize": { - "type": "string", - "description": "Best bid size" - }, - "sell": { - "type": "string", - "description": "Best ask price" - }, - "bestAskSize": { - "type": "string", - "description": "Best ask size" - }, - "changeRate": { - "type": "string", - "description": "24h change rate" - }, - "changePrice": { - "type": "string", - "description": "24h change price" - }, - "high": { - "type": "string", - "description": "Highest price in 24h" - }, - "low": { - "type": "string", - "description": "Lowest price in 24h" - }, - "vol": { - "type": "string", - "description": "24h volume, executed based on base currency" - }, - "volValue": { - "type": "string", - "description": "24h traded amount" - }, - "last": { - "type": "string", - "description": "Last traded price" - }, - "averagePrice": { - "type": "string", - "description": "Average trading price in the last 24 hours" - }, - "takerFeeRate": { - "type": "string", - "description": "Basic Taker Fee" - }, - "makerFeeRate": { - "type": "string", - "description": "Basic Maker Fee" - }, - "takerCoefficient": { - "type": "string", - "description": "The taker fee coefficient. The actual fee needs to be multiplied by this coefficient to get the final fee. Most currencies have a coefficient of 1. If set to 0, it means no fee", - "enum": [ - "1", - "0" - ], - "x-api-enum": [ - { - "value": "1", - "name": "1", - "description": "the taker fee coefficient is 1" - }, - { - "value": "0", - "name": "0", - "description": "no fee" - } - ] - }, - "makerCoefficient": { - "type": "string", - "description": "The maker fee coefficient. The actual fee needs to be multiplied by this coefficient to get the final fee. Most currencies have a coefficient of 1. If set to 0, it means no fee", - "enum": [ - "1", - "0" - ], - "x-api-enum": [ - { - "value": "1", - "name": "1", - "description": "the maker fee coefficient is 1" - }, - { - "value": "0", - "name": "0", - "description": "no fee" - } - ] - } + "status": { + "type": "string", + "description": "Status of service: open:normal transaction, close:Stop Trading/Maintenance, cancelonly:can only cancel the order but not place order", + "enum": [ + "open", + "close", + "cancelonly" + ], + "x-api-enum": [ + { + "value": "open", + "name": "OPEN", + "description": "normal transaction" }, - "required": [ - "symbol", - "symbolName", - "buy", - "bestBidSize", - "sell", - "bestAskSize", - "changeRate", - "changePrice", - "high", - "low", - "vol", - "volValue", - "last", - "averagePrice", - "takerFeeRate", - "makerFeeRate", - "takerCoefficient", - "makerCoefficient" - ] - } + { + "value": "close", + "name": "CLOSE", + "description": "Stop Trading/Maintenance" + }, + { + "value": "cancelonly", + "name": "CANCELONLY", + "description": "can only cancel the order but not place order" + } + ] + }, + "msg": { + "type": "string", + "description": "Remark for operation" } }, "required": [ - "time", - "ticker" + "status", + "msg" ] } }, @@ -5922,7 +5922,7 @@ } } }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470167", + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470158", "x-abandon": "normal", "x-domain": "Spot", "x-api-channel": "Public", @@ -5930,10 +5930,10 @@ "x-api-rate-limit-pool": "Public", "x-sdk-service": "Spot", "x-sdk-sub-service": "Market", - "x-sdk-method-name": "getAllTickers", - "x-sdk-method-description": "Request market tickers for all the trading pairs in the market (including 24h volume), takes a snapshot every 2 seconds. On the rare occasion that we will change the currency name, if you still want the changed symbol name, you can use the symbolName field instead of the symbol field via “Get all tickers” endpoint.", - "x-api-rate-limit": 15, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"time\\\": 1729173207043,\\n \\\"ticker\\\": [\\n {\\n \\\"symbol\\\": \\\"BTC-USDT\\\",\\n \\\"symbolName\\\": \\\"BTC-USDT\\\",\\n \\\"buy\\\": \\\"67192.5\\\",\\n \\\"bestBidSize\\\": \\\"0.000025\\\",\\n \\\"sell\\\": \\\"67192.6\\\",\\n \\\"bestAskSize\\\": \\\"1.24949204\\\",\\n \\\"changeRate\\\": \\\"-0.0014\\\",\\n \\\"changePrice\\\": \\\"-98.5\\\",\\n \\\"high\\\": \\\"68321.4\\\",\\n \\\"low\\\": \\\"66683.3\\\",\\n \\\"vol\\\": \\\"1836.03034612\\\",\\n \\\"volValue\\\": \\\"124068431.06726933\\\",\\n \\\"last\\\": \\\"67193\\\",\\n \\\"averagePrice\\\": \\\"67281.21437289\\\",\\n \\\"takerFeeRate\\\": \\\"0.001\\\",\\n \\\"makerFeeRate\\\": \\\"0.001\\\",\\n \\\"takerCoefficient\\\": \\\"1\\\",\\n \\\"makerCoefficient\\\": \\\"1\\\"\\n }\\n ]\\n }\\n}" + "x-sdk-method-name": "getServiceStatus", + "x-sdk-method-description": "Get the service status", + "x-api-rate-limit": 3, + "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"status\\\":\\\"open\\\",\\\"msg\\\":\\\"\\\"}}" } }, "/api/v1/bullet-public": { diff --git a/spec/rest/api/openapi-spot-order.json b/spec/rest/api/openapi-spot-order.json index e7019568..688a3d33 100644 --- a/spec/rest/api/openapi-spot-order.json +++ b/spec/rest/api/openapi-spot-order.json @@ -7,11 +7,11 @@ }, "tags": [], "paths": { - "/api/v1/hf/orders/multi": { + "/api/v1/hf/orders": { "post": { - "summary": "Batch Add Orders", + "summary": "Add Order", "deprecated": false, - "description": "This endpoint supports sequential batch order placement from a single endpoint. A maximum of 5orders can be placed simultaneously. The order types must be limit orders of the same trading pair", + "description": "Place order to the Spot trading system, you can place two major types of orders: limit and market. Orders can only be placed if your account has sufficient funds. Once an order is placed, your funds will be put on hold for the duration of the order. The amount of funds on hold depends on the order type and parameters specified.", "tags": [], "parameters": [], "responses": { @@ -26,31 +26,21 @@ "type": "string" }, "data": { - "type": "array", - "items": { - "type": "object", - "properties": { - "orderId": { - "type": "string", - "description": "The unique order id generated by the trading system,which can be used later for further actions such as canceling the order." - }, - "clientOid": { - "type": "string", - "description": "The user self-defined order id." - }, - "success": { - "type": "boolean", - "description": "Add order success/failure" - }, - "failMsg": { - "type": "string", - "description": "error message" - } + "type": "object", + "properties": { + "orderId": { + "type": "string", + "description": "The unique order id generated by the trading system,which can be used later for further actions such as canceling the order." }, - "required": [ - "success" - ] - } + "clientOid": { + "type": "string", + "description": "The user self-defined order id." + } + }, + "required": [ + "orderId", + "clientOid" + ] } }, "required": [ @@ -62,7 +52,7 @@ } } }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470168", + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470188", "x-abandon": "normal", "x-domain": "Spot", "x-api-channel": "Private", @@ -70,8 +60,8 @@ "x-api-rate-limit-pool": "Spot", "x-sdk-service": "Spot", "x-sdk-sub-service": "Order", - "x-sdk-method-name": "batchAddOrders", - "x-sdk-method-description": "This endpoint supports sequential batch order placement from a single endpoint. A maximum of 5orders can be placed simultaneously. The order types must be limit orders of the same trading pair", + "x-sdk-method-name": "addOrder", + "x-sdk-method-description": "Place order to the Spot trading system, you can place two major types of orders: limit and market. Orders can only be placed if your account has sufficient funds. Once an order is placed, your funds will be put on hold for the duration of the order. The amount of funds on hold depends on the order type and parameters specified.", "x-api-rate-limit": 1, "requestBody": { "content": { @@ -79,195 +69,256 @@ "schema": { "type": "object", "properties": { - "orderList": { - "type": "array", - "items": { - "type": "object", - "properties": { - "clientOid": { - "type": "string", - "description": "Client Order Id,The ClientOid field is a unique ID created by the user(we recommend using a UUID), and can only contain numbers, letters, underscores (_), and hyphens (-). This field is returned when order information is obtained. You can use clientOid to tag your orders. ClientOid is different from the order ID created by the service provider. Please do not initiate requests using the same clientOid. The maximum length for the ClientOid is 40 characters.\n" - }, - "symbol": { - "type": "string", - "description": "symbol", - "example": [ - "BTC-USDT", - "ETH-USDT", - "KCS-USDT" - ] - }, - "type": { - "type": "string", - "description": "Specify if the order is an 'limit' order or 'market' order. ", - "enum": [ - "limit" - ], - "x-api-enum": [ - { - "value": "limit", - "name": "", - "description": "" - } - ] - }, - "timeInForce": { - "type": "string", - "description": "[Time in force](https://www.kucoin.com/docs-new/doc-338146) is a special strategy used during trading", - "enum": [ - "GTC", - "GTT", - "IOC", - "FOK" - ], - "default": "GTC", - "x-api-enum": [ - { - "value": "GTC", - "name": "", - "description": "" - }, - { - "value": "GTT", - "name": "", - "description": "" - }, - { - "value": "IOC", - "name": "", - "description": "" - }, - { - "value": "FOK", - "name": "", - "description": "" - } - ] - }, - "side": { - "type": "string", - "description": "Specify if the order is to 'buy' or 'sell'", - "enum": [ - "buy", - "sell" - ], - "x-api-enum": [ - { - "value": "buy", - "name": "", - "description": "" - }, - { - "value": "sell", - "name": "", - "description": "" - } - ] - }, - "price": { - "type": "string", - "description": "Specify price for order" - }, - "size": { - "type": "string", - "description": "Specify quantity for order\n\nWhen **type** is limit, select one out of two: size or funds, size refers to the amount of trading targets (the asset name written in front) for the trading pair. Teh Size must be based on the baseIncrement of the trading pair. The baseIncrement represents the precision for the trading pair. The size of an order must be a positive-integer multiple of baseIncrement and must be between baseMinSize and baseMaxSize.\n\nWhen **type** is market, select one out of two: size or funds" - }, - "stp": { - "type": "string", - "description": "[Self Trade Prevention](https://www.kucoin.com/docs-new/doc-338146) is divided into four strategies: CN, CO, CB , and DC", - "enum": [ - "DC", - "CO", - "CN", - "CB" - ], - "x-api-enum": [ - { - "value": "DC", - "name": "", - "description": "" - }, - { - "value": "CO", - "name": "", - "description": "" - }, - { - "value": "CN", - "name": "", - "description": "" - }, - { - "value": "CB", - "name": "", - "description": "" - } - ] - }, - "cancelAfter": { - "type": "integer", - "description": "Cancel after n seconds,the order timing strategy is GTT", - "format": "int64" - }, - "postOnly": { - "type": "boolean", - "default": false, - "description": "passive order labels, this is disabled when the order timing strategy is IOC or FOK" - }, - "hidden": { - "type": "boolean", - "description": "[Hidden order](https://www.kucoin.com/docs-new/doc-338146) or not (not shown in order book)", - "default": false - }, - "iceberg": { - "type": "boolean", - "description": "Whether or not only visible portions of orders are shown in [Iceberg orders](https://www.kucoin.com/docs-new/doc-338146)", - "default": false - }, - "visibleSize": { - "type": "string", - "description": "Maximum visible quantity in iceberg orders" - }, - "tags": { - "type": "string", - "description": "Order tag, length cannot exceed 20 characters (ASCII)" - }, - "remark": { - "type": "string", - "description": "Order placement remarks, length cannot exceed 20 characters (ASCII)" - }, - "funds": { - "type": "string", - "description": "When **type** is market, select one out of two: size or funds" - } + "clientOid": { + "type": "string", + "description": "Client Order Id,The ClientOid field is a unique ID created by the user(we recommend using a UUID), and can only contain numbers, letters, underscores (_), and hyphens (-). This field is returned when order information is obtained. You can use clientOid to tag your orders. ClientOid is different from the order ID created by the service provider. Please do not initiate requests using the same clientOid. The maximum length for the ClientOid is 40 characters.\n\nPlease remember the orderId created by the service provider, it used to check for updates in order status.", + "example": [ + "5c52e11203aa677f33e493fb" + ] + }, + "side": { + "type": "string", + "description": "specify if the order is to 'buy' or 'sell'", + "enum": [ + "buy", + "sell" + ], + "x-api-enum": [ + { + "value": "buy", + "name": "", + "description": "" }, - "required": [ - "type", - "symbol", - "side", - "price" - ] - }, - "description": "Order List" - } - }, - "required": [ - "orderList" - ] - }, - "example": "{\n \"orderList\": [\n {\n \"clientOid\": \"client order id 12\",\n \"symbol\": \"BTC-USDT\",\n \"type\": \"limit\",\n \"side\": \"buy\",\n \"price\": \"30000\",\n \"size\": \"0.00001\"\n },\n {\n \"clientOid\": \"client order id 13\",\n \"symbol\": \"ETH-USDT\",\n \"type\": \"limit\",\n \"side\": \"sell\",\n \"price\": \"2000\",\n \"size\": \"0.00001\"\n }\n ]\n}" - } - } - }, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": [\\n {\\n \\\"orderId\\\": \\\"6710d8336afcdb0007319c27\\\",\\n \\\"clientOid\\\": \\\"client order id 12\\\",\\n \\\"success\\\": true\\n },\\n {\\n \\\"success\\\": false,\\n \\\"failMsg\\\": \\\"The order funds should more then 0.1 USDT.\\\"\\n }\\n ]\\n}", - "x-request-example": "{\\\"orderList\\\": [{\\\"clientOid\\\": \\\"client order id 12\\\", \\\"symbol\\\": \\\"BTC-USDT\\\", \\\"type\\\": \\\"limit\\\", \\\"side\\\": \\\"buy\\\", \\\"price\\\": \\\"30000\\\", \\\"size\\\": \\\"0.00001\\\"}, {\\\"clientOid\\\": \\\"client order id 13\\\", \\\"symbol\\\": \\\"ETH-USDT\\\", \\\"type\\\": \\\"limit\\\", \\\"side\\\": \\\"sell\\\", \\\"price\\\": \\\"2000\\\", \\\"size\\\": \\\"0.00001\\\"}]}" - } - }, - "/api/v1/hf/orders/multi/sync": { - "post": { - "summary": "Batch Add Orders Sync", - "deprecated": false, - "description": "This endpoint supports sequential batch order placement from a single endpoint. A maximum of 5orders can be placed simultaneously. The order types must be limit orders of the same trading pair", + { + "value": "sell", + "name": "", + "description": "" + } + ], + "example": [ + "buy" + ] + }, + "symbol": { + "type": "string", + "description": "symbol", + "example": [ + "BTC-USDT", + "ETH-USDT", + "KCS-USDT" + ] + }, + "type": { + "type": "string", + "description": "specify if the order is an 'limit' order or 'market' order. \n\nThe type of order you specify when you place your order determines whether or not you need to request other parameters and also affects the execution of the matching engine.\n\nWhen placing a limit order, you must specify a price and size. The system will try to match the order according to market price or a price better than market price. If the order cannot be immediately matched, it will stay in the order book until it is matched or the user cancels.\n\nUnlike limit orders, the price for market orders fluctuates with market prices. When placing a market order, you do not need to specify a price, you only need to specify a quantity. Market orders are filled immediately and will not enter the order book. All market orders are takers and a taker fee will be charged.", + "enum": [ + "limit", + "market" + ], + "x-api-enum": [ + { + "value": "limit", + "name": "", + "description": "" + }, + { + "value": "market", + "name": "", + "description": "" + } + ], + "example": [ + "limit" + ] + }, + "remark": { + "type": "string", + "description": "Order placement remarks, length cannot exceed 20 characters (ASCII)" + }, + "stp": { + "type": "string", + "description": "[Self Trade Prevention](https://www.kucoin.com/docs-new/doc-338146) is divided into four strategies: CN, CO, CB , and DC", + "enum": [ + "DC", + "CO", + "CN", + "CB" + ], + "x-api-enum": [ + { + "value": "DC", + "name": "", + "description": "" + }, + { + "value": "CO", + "name": "", + "description": "" + }, + { + "value": "CN", + "name": "", + "description": "" + }, + { + "value": "CB", + "name": "", + "description": "" + } + ] + }, + "price": { + "type": "string", + "description": "Specify price for order\n\nWhen placing a limit order, the price must be based on priceIncrement for the trading pair. The price increment (priceIncrement) is the price precision for the trading pair. For example, for the BTC-USDT trading pair, the priceIncrement is 0.00001000. So the price for your orders cannot be less than 0.00001000 and must be a multiple of priceIncrement. Otherwise, the order will return an invalid priceIncrement error." + }, + "size": { + "type": "string", + "description": "Specify quantity for order\n\nWhen **type** is limit, size refers to the amount of trading targets (the asset name written in front) for the trading pair. Teh Size must be based on the baseIncrement of the trading pair. The baseIncrement represents the precision for the trading pair. The size of an order must be a positive-integer multiple of baseIncrement and must be between baseMinSize and baseMaxSize.\n\nWhen **type** is market, select one out of two: size or funds" + }, + "timeInForce": { + "type": "string", + "description": "[Time in force](https://www.kucoin.com/docs-new/doc-338146) is a special strategy used during trading", + "enum": [ + "GTC", + "GTT", + "IOC", + "FOK" + ], + "default": "GTC", + "x-api-enum": [ + { + "value": "GTC", + "name": "", + "description": "" + }, + { + "value": "GTT", + "name": "", + "description": "" + }, + { + "value": "IOC", + "name": "", + "description": "" + }, + { + "value": "FOK", + "name": "", + "description": "" + } + ] + }, + "postOnly": { + "type": "boolean", + "default": false, + "description": "passive order labels, this is disabled when the order timing strategy is IOC or FOK" + }, + "hidden": { + "type": "boolean", + "description": "[Hidden order](https://www.kucoin.com/docs-new/doc-338146) or not (not shown in order book)", + "default": false + }, + "iceberg": { + "type": "boolean", + "description": "Whether or not only visible portions of orders are shown in [Iceberg orders](https://www.kucoin.com/docs-new/doc-338146)", + "default": false + }, + "visibleSize": { + "type": "string", + "description": "Maximum visible quantity in iceberg orders" + }, + "tags": { + "type": "string", + "description": "Order tag, length cannot exceed 20 characters (ASCII)" + }, + "cancelAfter": { + "type": "integer", + "format": "int64", + "description": "Cancel after n seconds,the order timing strategy is GTT" + }, + "funds": { + "type": "string", + "description": "When **type** is market, select one out of two: size or funds" + } + }, + "required": [ + "symbol", + "type", + "side" + ] + }, + "example": "//limit order\n{\n \"type\": \"limit\",\n \"symbol\": \"BTC-USDT\",\n \"side\": \"buy\",\n \"price\": \"50000\",\n \"size\": \"0.00001\",\n \"clientOid\": \"5c52e11203aa677f33e493fb\",\n \"remark\": \"order remarks\"\n}\n\n//market order 1\n// {\n// \"type\": \"market\",\n// \"symbol\": \"BTC-USDT\",\n// \"side\": \"buy\",\n// \"size\": \"0.00001\",\n// \"clientOid\": \"5c52e11203aa677f33e493fc\",\n// \"remark\": \"order remarks\"\n// }\n\n//market order 2\n// {\n// \"type\": \"market\",\n// \"symbol\": \"BTC-USDT\",\n// \"side\": \"buy\",\n// \"funds\": \"1\",\n// \"clientOid\": \"5c52e11203aa677f33e493fc\",\n// \"remark\": \"order remarks\"\n// }\n" + } + } + }, + "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"orderId\\\":\\\"670fd33bf9406e0007ab3945\\\",\\\"clientOid\\\":\\\"5c52e11203aa677f33e493fb\\\"}}", + "x-request-example": "{\\\"type\\\": \\\"limit\\\", \\\"symbol\\\": \\\"BTC-USDT\\\", \\\"side\\\": \\\"buy\\\", \\\"price\\\": \\\"50000\\\", \\\"size\\\": \\\"0.00001\\\", \\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\", \\\"remark\\\": \\\"order remarks\\\"}" + }, + "delete": { + "summary": "Cancel All Orders By Symbol", + "deprecated": false, + "description": "This endpoint can cancel all spot orders for specific symbol. This endpoint only sends cancellation requests. The results of the requests must be obtained by checking the order status or subscribing to websocket.", + "tags": [], + "parameters": [ + { + "name": "symbol", + "in": "query", + "description": "symbol", + "required": true, + "schema": { + "type": "string", + "example": [ + "BTC-USDT", + "ETH-USDT", + "KCS-USDT" + ] + } + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "string" + } + }, + "required": [ + "code", + "data" + ] + } + } + } + } + }, + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470175", + "x-abandon": "normal", + "x-domain": "Spot", + "x-api-channel": "Private", + "x-api-permission": "Spot", + "x-api-rate-limit-pool": "Spot", + "x-sdk-service": "Spot", + "x-sdk-sub-service": "Order", + "x-sdk-method-name": "cancelAllOrdersBySymbol", + "x-sdk-method-description": "This endpoint can cancel all spot orders for specific symbol. This endpoint only sends cancellation requests. The results of the requests must be obtained by checking the order status or subscribing to websocket.", + "x-api-rate-limit": 2, + "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":\\\"success\\\"}", + "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\"}" + } + }, + "/api/v1/hf/orders/sync": { + "post": { + "summary": "Add Order Sync", + "deprecated": false, + "description": "Place order to the spot trading system The difference between this interface and \"Add order\" is that this interface will synchronously return the order information after the order matching is completed. For higher latency requirements, please select the \"Add order\" interface. If there is a requirement for returning data integrity, please select this interface", "tags": [], "parameters": [], "responses": { @@ -282,380 +333,80 @@ "type": "string" }, "data": { - "type": "array", - "items": { - "type": "object", - "properties": { - "orderId": { - "type": "string", - "description": "The unique order id generated by the trading system,which can be used later for further actions such as canceling the order." - }, - "clientOid": { - "type": "string", - "description": "The user self-defined order id." - }, - "orderTime": { - "type": "integer", - "format": "int64" - }, - "originSize": { - "type": "string", - "description": "original order size" - }, - "dealSize": { - "type": "string", - "description": "deal size" - }, - "remainSize": { - "type": "string", - "description": "remain size" - }, - "canceledSize": { - "type": "string", - "description": "Cumulative canceled size" - }, - "status": { - "type": "string", - "description": "Order Status. open:order is active; done:order has been completed", - "enum": [ - "open", - "done" - ], - "x-api-enum": [ - { - "value": "open", - "name": "", - "description": "" - }, - { - "value": "done", - "name": "", - "description": "" - } - ] - }, - "matchTime": { - "type": "integer", - "format": "int64" - }, - "success": { - "type": "boolean", - "description": "Add order success/failure" - }, - "failMsg": { - "type": "string", - "description": "error message" - } - }, - "required": [ - "success" - ] - } - } - }, - "required": [ - "code", - "data" - ] - } - } - } - } - }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470169", - "x-abandon": "normal", - "x-domain": "Spot", - "x-api-channel": "Private", - "x-api-permission": "Spot", - "x-api-rate-limit-pool": "Spot", - "x-sdk-service": "Spot", - "x-sdk-sub-service": "Order", - "x-sdk-method-name": "batchAddOrdersSync", - "x-sdk-method-description": "This endpoint supports sequential batch order placement from a single endpoint. A maximum of 5orders can be placed simultaneously. The order types must be limit orders of the same trading pair", - "x-api-rate-limit": 1, - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "orderList": { - "type": "array", - "items": { "type": "object", "properties": { - "clientOid": { + "orderId": { "type": "string", - "description": "Client Order Id,The ClientOid field is a unique ID created by the user(we recommend using a UUID), and can only contain numbers, letters, underscores (_), and hyphens (-). This field is returned when order information is obtained. You can use clientOid to tag your orders. ClientOid is different from the order ID created by the service provider. Please do not initiate requests using the same clientOid. The maximum length for the ClientOid is 40 characters.\n" + "description": "The unique order id generated by the trading system,which can be used later for further actions such as canceling the order." }, - "symbol": { + "clientOid": { "type": "string", - "description": "symbol", - "example": [ - "BTC-USDT", - "ETH-USDT", - "KCS-USDT" - ] + "description": "The user self-defined order id." }, - "type": { - "type": "string", - "description": "Specify if the order is an 'limit' order or 'market' order. ", - "enum": [ - "limit" - ], - "x-api-enum": [ - { - "value": "limit", - "name": "", - "description": "" - } - ] + "orderTime": { + "type": "integer", + "format": "int64" }, - "timeInForce": { + "originSize": { "type": "string", - "description": "[Time in force](https://www.kucoin.com/docs-new/doc-338146) is a special strategy used during trading", - "enum": [ - "GTC", - "GTT", - "IOC", - "FOK" - ], - "default": "GTC", - "x-api-enum": [ - { - "value": "GTC", - "name": "", - "description": "" - }, - { - "value": "GTT", - "name": "", - "description": "" - }, - { - "value": "IOC", - "name": "", - "description": "" - }, - { - "value": "FOK", - "name": "", - "description": "" - } - ] + "description": "original order size" }, - "side": { + "dealSize": { "type": "string", - "description": "Specify if the order is to 'buy' or 'sell'", - "enum": [ - "buy", - "sell" - ], - "x-api-enum": [ - { - "value": "buy", - "name": "", - "description": "" - }, - { - "value": "sell", - "name": "", - "description": "" - } - ] + "description": "deal size" }, - "price": { + "remainSize": { "type": "string", - "description": "Specify price for order" + "description": "remain size" }, - "size": { + "canceledSize": { "type": "string", - "description": "Specify quantity for order\n\nWhen **type** is limit, select one out of two: size or funds, size refers to the amount of trading targets (the asset name written in front) for the trading pair. Teh Size must be based on the baseIncrement of the trading pair. The baseIncrement represents the precision for the trading pair. The size of an order must be a positive-integer multiple of baseIncrement and must be between baseMinSize and baseMaxSize.\n\nWhen **type** is market, select one out of two: size or funds" + "description": "Cumulative canceled size" }, - "stp": { + "status": { "type": "string", - "description": "[Self Trade Prevention](https://www.kucoin.com/docs-new/doc-338146) is divided into four strategies: CN, CO, CB , and DC", + "description": "Order Status. open:order is active; done:order has been completed", "enum": [ - "DC", - "CO", - "CN", - "CB" + "open", + "done" ], "x-api-enum": [ { - "value": "DC", - "name": "", - "description": "" - }, - { - "value": "CO", - "name": "", - "description": "" - }, - { - "value": "CN", + "value": "open", "name": "", "description": "" }, { - "value": "CB", + "value": "done", "name": "", "description": "" } ] }, - "cancelAfter": { + "matchTime": { "type": "integer", - "description": "Cancel after n seconds,the order timing strategy is GTT", "format": "int64" - }, - "postOnly": { - "type": "boolean", - "default": false, - "description": "passive order labels, this is disabled when the order timing strategy is IOC or FOK" - }, - "hidden": { - "type": "boolean", - "description": "[Hidden order](https://www.kucoin.com/docs-new/doc-338146) or not (not shown in order book)", - "default": false - }, - "iceberg": { - "type": "boolean", - "description": "Whether or not only visible portions of orders are shown in [Iceberg orders](https://www.kucoin.com/docs-new/doc-338146)", - "default": false - }, - "visibleSize": { - "type": "string", - "description": "Maximum visible quantity in iceberg orders" - }, - "tags": { - "type": "string", - "description": "Order tag, length cannot exceed 20 characters (ASCII)" - }, - "remark": { - "type": "string", - "description": "Order placement remarks, length cannot exceed 20 characters (ASCII)" - }, - "funds": { - "type": "string", - "description": "When **type** is market, select one out of two: size or funds" } }, "required": [ - "type", - "symbol", - "side", - "price" + "orderId", + "clientOid", + "orderTime", + "originSize", + "dealSize", + "remainSize", + "canceledSize", + "status", + "matchTime" ] - }, - "description": "Order List" - } - }, - "required": [ - "orderList" - ] - }, - "example": "{\n \"orderList\": [\n {\n \"clientOid\": \"client order id 13\",\n \"symbol\": \"BTC-USDT\",\n \"type\": \"limit\",\n \"side\": \"buy\",\n \"price\": \"30000\",\n \"size\": \"0.00001\"\n },\n {\n \"clientOid\": \"client order id 14\",\n \"symbol\": \"ETH-USDT\",\n \"type\": \"limit\",\n \"side\": \"sell\",\n \"price\": \"2000\",\n \"size\": \"0.00001\"\n }\n ]\n}" - } - } - }, - "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":[{\\\"orderId\\\":\\\"6711195e5584bc0007bd5aef\\\",\\\"clientOid\\\":\\\"client order id 13\\\",\\\"orderTime\\\":1729173854299,\\\"originSize\\\":\\\"0.00001\\\",\\\"dealSize\\\":\\\"0\\\",\\\"remainSize\\\":\\\"0.00001\\\",\\\"canceledSize\\\":\\\"0\\\",\\\"status\\\":\\\"open\\\",\\\"matchTime\\\":1729173854326,\\\"success\\\":true},{\\\"success\\\":false,\\\"failMsg\\\":\\\"The order funds should more then 0.1 USDT.\\\"}]}", - "x-request-example": "{\\\"orderList\\\": [{\\\"clientOid\\\": \\\"client order id 13\\\", \\\"symbol\\\": \\\"BTC-USDT\\\", \\\"type\\\": \\\"limit\\\", \\\"side\\\": \\\"buy\\\", \\\"price\\\": \\\"30000\\\", \\\"size\\\": \\\"0.00001\\\"}, {\\\"clientOid\\\": \\\"client order id 14\\\", \\\"symbol\\\": \\\"ETH-USDT\\\", \\\"type\\\": \\\"limit\\\", \\\"side\\\": \\\"sell\\\", \\\"price\\\": \\\"2000\\\", \\\"size\\\": \\\"0.00001\\\"}]}" - } - }, - "/api/v1/hf/orders/sync": { - "post": { - "summary": "Add Order Sync", - "deprecated": false, - "description": "Place order to the spot trading system The difference between this interface and \"Add order\" is that this interface will synchronously return the order information after the order matching is completed. For higher latency requirements, please select the \"Add order\" interface. If there is a requirement for returning data integrity, please select this interface", - "tags": [], - "parameters": [], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "data": { - "type": "object", - "properties": { - "orderId": { - "type": "string", - "description": "The unique order id generated by the trading system,which can be used later for further actions such as canceling the order." - }, - "clientOid": { - "type": "string", - "description": "The user self-defined order id." - }, - "orderTime": { - "type": "integer", - "format": "int64" - }, - "originSize": { - "type": "string", - "description": "original order size" - }, - "dealSize": { - "type": "string", - "description": "deal size" - }, - "remainSize": { - "type": "string", - "description": "remain size" - }, - "canceledSize": { - "type": "string", - "description": "Cumulative canceled size" - }, - "status": { - "type": "string", - "description": "Order Status. open:order is active; done:order has been completed", - "enum": [ - "open", - "done" - ], - "x-api-enum": [ - { - "value": "open", - "name": "", - "description": "" - }, - { - "value": "done", - "name": "", - "description": "" - } - ] - }, - "matchTime": { - "type": "integer", - "format": "int64" - } - }, - "required": [ - "orderId", - "clientOid", - "orderTime", - "originSize", - "dealSize", - "remainSize", - "canceledSize", - "status", - "matchTime" - ] - } - }, - "required": [ - "code", - "data" - ] - } - } + } + }, + "required": [ + "code", + "data" + ] + } + } } } }, @@ -862,11 +613,11 @@ "x-request-example": "{\\\"type\\\": \\\"limit\\\", \\\"symbol\\\": \\\"BTC-USDT\\\", \\\"side\\\": \\\"buy\\\", \\\"price\\\": \\\"50000\\\", \\\"size\\\": \\\"0.00001\\\", \\\"clientOid\\\": \\\"5c52e11203aa677f33e493f\\\", \\\"remark\\\": \\\"order remarks\\\"}" } }, - "/api/v1/hf/orders/alter": { + "/api/v1/hf/orders/test": { "post": { - "summary": "Modify Order", + "summary": "Add Order Test", "deprecated": false, - "description": "This interface can modify the price and quantity of the order according to orderId or clientOid. The implementation of this interface is: cancel the order and place a new order on the same trading pair, and return the modification result to the client synchronously When the quantity of the new order updated by the user is less than the filled quantity of this order, the order will be considered as completed, and the order will be cancelled, and no new order will be placed", + "description": "Order test endpoint, the request parameters and return parameters of this endpoint are exactly the same as the order endpoint, and can be used to verify whether the signature is correct and other operations. After placing an order, the order will not enter the matching system, and the order cannot be queried.", "tags": [], "parameters": [], "responses": { @@ -883,17 +634,17 @@ "data": { "type": "object", "properties": { - "newOrderId": { + "orderId": { "type": "string", - "description": "The new order id" + "description": "The unique order id generated by the trading system,which can be used later for further actions such as canceling the order." }, "clientOid": { "type": "string", - "description": "The original client order id" + "description": "The user self-defined order id." } }, "required": [ - "newOrderId", + "orderId", "clientOid" ] } @@ -907,7 +658,7 @@ } } }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470171", + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470187", "x-abandon": "normal", "x-domain": "Spot", "x-api-channel": "Private", @@ -915,9 +666,9 @@ "x-api-rate-limit-pool": "Spot", "x-sdk-service": "Spot", "x-sdk-sub-service": "Order", - "x-sdk-method-name": "modifyOrder", - "x-sdk-method-description": "This interface can modify the price and quantity of the order according to orderId or clientOid. The implementation of this interface is: cancel the order and place a new order on the same trading pair, and return the modification result to the client synchronously When the quantity of the new order updated by the user is less than the filled quantity of this order, the order will be considered as completed, and the order will be cancelled, and no new order will be placed", - "x-api-rate-limit": 3, + "x-sdk-method-name": "addOrderTest", + "x-sdk-method-description": "Order test endpoint, the request parameters and return parameters of this endpoint are exactly the same as the order endpoint, and can be used to verify whether the signature is correct and other operations. After placing an order, the order will not enter the matching system, and the order cannot be queried.", + "x-api-rate-limit": 1, "requestBody": { "content": { "application/json": { @@ -926,11 +677,34 @@ "properties": { "clientOid": { "type": "string", - "description": "The old client order id,orderId and clientOid must choose one", + "description": "Client Order Id,The ClientOid field is a unique ID created by the user(we recommend using a UUID), and can only contain numbers, letters, underscores (_), and hyphens (-). This field is returned when order information is obtained. You can use clientOid to tag your orders. ClientOid is different from the order ID created by the service provider. Please do not initiate requests using the same clientOid. The maximum length for the ClientOid is 40 characters.\n\nPlease remember the orderId created by the service provider, it used to check for updates in order status.", "example": [ "5c52e11203aa677f33e493fb" ] }, + "side": { + "type": "string", + "description": "specify if the order is to 'buy' or 'sell'", + "enum": [ + "buy", + "sell" + ], + "x-api-enum": [ + { + "value": "buy", + "name": "", + "description": "" + }, + { + "value": "sell", + "name": "", + "description": "" + } + ], + "example": [ + "buy" + ] + }, "symbol": { "type": "string", "description": "symbol", @@ -940,101 +714,158 @@ "KCS-USDT" ] }, - "orderId": { + "type": { "type": "string", - "description": "The old order id, orderId and clientOid must choose one" + "description": "specify if the order is an 'limit' order or 'market' order. \n\nThe type of order you specify when you place your order determines whether or not you need to request other parameters and also affects the execution of the matching engine.\n\nWhen placing a limit order, you must specify a price and size. The system will try to match the order according to market price or a price better than market price. If the order cannot be immediately matched, it will stay in the order book until it is matched or the user cancels.\n\nUnlike limit orders, the price for market orders fluctuates with market prices. When placing a market order, you do not need to specify a price, you only need to specify a quantity. Market orders are filled immediately and will not enter the order book. All market orders are takers and a taker fee will be charged.", + "enum": [ + "limit", + "market" + ], + "x-api-enum": [ + { + "value": "limit", + "name": "", + "description": "" + }, + { + "value": "market", + "name": "", + "description": "" + } + ], + "example": [ + "limit" + ] }, - "newPrice": { + "remark": { "type": "string", - "description": "The modified price of the new order, newPrice and newSize must choose one" + "description": "Order placement remarks, length cannot exceed 20 characters (ASCII)" }, - "newSize": { + "stp": { "type": "string", - "description": "The modified size of the new order, newPrice and newSize must choose one" - } - }, - "required": [ - "symbol" - ] - }, - "example": "{\n \"symbol\": \"BTC-USDT\",\n \"orderId\": \"670fd33bf9406e0007ab3945\",\n \"newPrice\": \"30000\",\n \"newSize\": \"0.0001\"\n}" - } - } - }, - "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"newOrderId\\\":\\\"67112258f9406e0007408827\\\",\\\"clientOid\\\":\\\"client order id 12\\\"}}", - "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"orderId\\\": \\\"670fd33bf9406e0007ab3945\\\", \\\"newPrice\\\": \\\"30000\\\", \\\"newSize\\\": \\\"0.0001\\\"}" - } - }, - "/api/v1/hf/orders/dead-cancel-all/query": { - "get": { - "summary": "Get DCP", - "deprecated": false, - "description": "Get Disconnection Protect(Deadman Swich)Through this interface, you can query the settings of automatic order cancellation", - "tags": [], - "parameters": [], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "data": { - "type": "object", - "properties": { - "timeout": { - "type": "integer", - "description": "Auto cancel order trigger setting time, the unit is second. range: timeout=-1 (meaning unset) or 5 <= timeout <= 86400" - }, - "symbols": { - "type": "string", - "description": "List of trading pairs. Separated by commas, empty means all trading pairs" - }, - "currentTime": { - "type": "integer", - "description": "System current time (in seconds)" - }, - "triggerTime": { - "type": "integer", - "description": "Trigger cancellation time (in seconds)" - } + "description": "[Self Trade Prevention](https://www.kucoin.com/docs-new/doc-338146) is divided into four strategies: CN, CO, CB , and DC", + "enum": [ + "DC", + "CO", + "CN", + "CB" + ], + "x-api-enum": [ + { + "value": "DC", + "name": "", + "description": "" }, - "description": "If the data is empty, it means that DCP is not set.", - "additionalProperties": false - } + { + "value": "CO", + "name": "", + "description": "" + }, + { + "value": "CN", + "name": "", + "description": "" + }, + { + "value": "CB", + "name": "", + "description": "" + } + ] }, - "required": [ - "code", - "data" - ] - } - } + "price": { + "type": "string", + "description": "Specify price for order\n\nWhen placing a limit order, the price must be based on priceIncrement for the trading pair. The price increment (priceIncrement) is the price precision for the trading pair. For example, for the BTC-USDT trading pair, the priceIncrement is 0.00001000. So the price for your orders cannot be less than 0.00001000 and must be a multiple of priceIncrement. Otherwise, the order will return an invalid priceIncrement error." + }, + "size": { + "type": "string", + "description": "Specify quantity for order\n\nWhen **type** is limit, size refers to the amount of trading targets (the asset name written in front) for the trading pair. Teh Size must be based on the baseIncrement of the trading pair. The baseIncrement represents the precision for the trading pair. The size of an order must be a positive-integer multiple of baseIncrement and must be between baseMinSize and baseMaxSize.\n\nWhen **type** is market, select one out of two: size or funds" + }, + "timeInForce": { + "type": "string", + "description": "[Time in force](https://www.kucoin.com/docs-new/doc-338146) is a special strategy used during trading", + "enum": [ + "GTC", + "GTT", + "IOC", + "FOK" + ], + "default": "GTC", + "x-api-enum": [ + { + "value": "GTC", + "name": "", + "description": "" + }, + { + "value": "GTT", + "name": "", + "description": "" + }, + { + "value": "IOC", + "name": "", + "description": "" + }, + { + "value": "FOK", + "name": "", + "description": "" + } + ] + }, + "postOnly": { + "type": "boolean", + "default": false, + "description": "passive order labels, this is disabled when the order timing strategy is IOC or FOK" + }, + "hidden": { + "type": "boolean", + "description": "[Hidden order](https://www.kucoin.com/docs-new/doc-338146) or not (not shown in order book)", + "default": false + }, + "iceberg": { + "type": "boolean", + "description": "Whether or not only visible portions of orders are shown in [Iceberg orders](https://www.kucoin.com/docs-new/doc-338146)", + "default": false + }, + "visibleSize": { + "type": "string", + "description": "Maximum visible quantity in iceberg orders" + }, + "tags": { + "type": "string", + "description": "Order tag, length cannot exceed 20 characters (ASCII)" + }, + "cancelAfter": { + "type": "integer", + "format": "int64", + "description": "Cancel after n seconds,the order timing strategy is GTT" + }, + "funds": { + "type": "string", + "description": "When **type** is market, select one out of two: size or funds" + } + }, + "required": [ + "symbol", + "type", + "side" + ] + }, + "example": "//limit order\n{\n \"type\": \"limit\",\n \"symbol\": \"BTC-USDT\",\n \"side\": \"buy\",\n \"price\": \"50000\",\n \"size\": \"0.00001\",\n \"clientOid\": \"5c52e11203aa677f33e493f\",\n \"remark\": \"order remarks\"\n}\n\n//market order 1\n// {\n// \"type\": \"market\",\n// \"symbol\": \"BTC-USDT\",\n// \"side\": \"buy\",\n// \"size\": \"0.00001\",\n// \"clientOid\": \"5c52e11203aa677f33e493fc\",\n// \"remark\": \"order remarks\",\n// }\n\n//market order 2\n// {\n// \"type\": \"market\",\n// \"symbol\": \"BTC-USDT\",\n// \"side\": \"buy\",\n// \"funds\": \"1\",\n// \"clientOid\": \"5c52e11203aa677f33e493fc\",\n// \"remark\": \"order remarks\",\n// }\n" } } }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470172", - "x-abandon": "normal", - "x-domain": "Spot", - "x-api-channel": "Private", - "x-api-permission": "Spot", - "x-api-rate-limit-pool": "Spot", - "x-sdk-service": "Spot", - "x-sdk-sub-service": "Order", - "x-sdk-method-name": "getDCP", - "x-sdk-method-description": "Get Disconnection Protect(Deadman Swich)Through this interface, you can query the settings of automatic order cancellation", - "x-api-rate-limit": 2, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"timeout\\\": 5,\\n \\\"symbols\\\": \\\"BTC-USDT,ETH-USDT\\\",\\n \\\"currentTime\\\": 1729241305,\\n \\\"triggerTime\\\": 1729241308\\n }\\n}" + "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"orderId\\\":\\\"670fd33bf9406e0007ab3945\\\",\\\"clientOid\\\":\\\"5c52e11203aa677f33e493fb\\\"}}", + "x-request-example": "{\\\"type\\\": \\\"limit\\\", \\\"symbol\\\": \\\"BTC-USDT\\\", \\\"side\\\": \\\"buy\\\", \\\"price\\\": \\\"50000\\\", \\\"size\\\": \\\"0.00001\\\", \\\"clientOid\\\": \\\"5c52e11203aa677f33e493f\\\", \\\"remark\\\": \\\"order remarks\\\"}" } }, - "/api/v1/hf/orders/dead-cancel-all": { + "/api/v1/hf/orders/multi": { "post": { - "summary": "Set DCP", + "summary": "Batch Add Orders", "deprecated": false, - "description": "Set Disconnection Protect(Deadman Swich)Through this interface, Call this interface to automatically cancel all orders of the set trading pair after the specified time. If this interface is not called again for renewal or cancellation before the set time, the system will help the user to cancel the order of the corresponding trading pair. Otherwise it will not.", + "description": "This endpoint supports sequential batch order placement from a single endpoint. A maximum of 5orders can be placed simultaneously. The order types must be limit orders of the same trading pair", "tags": [], "parameters": [], "responses": { @@ -1049,22 +880,31 @@ "type": "string" }, "data": { - "type": "object", - "properties": { - "currentTime": { - "type": "integer", - "description": "System current time (in seconds)" + "type": "array", + "items": { + "type": "object", + "properties": { + "orderId": { + "type": "string", + "description": "The unique order id generated by the trading system,which can be used later for further actions such as canceling the order." + }, + "clientOid": { + "type": "string", + "description": "The user self-defined order id." + }, + "success": { + "type": "boolean", + "description": "Add order success/failure" + }, + "failMsg": { + "type": "string", + "description": "error message" + } }, - "triggerTime": { - "type": "integer", - "description": "Trigger cancellation time (in seconds)" - } - }, - "required": [ - "currentTime", - "triggerTime" - ], - "description": "If the data is empty, it means that DCP is not set." + "required": [ + "success" + ] + } } }, "required": [ @@ -1076,7 +916,7 @@ } } }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470173", + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470168", "x-abandon": "normal", "x-domain": "Spot", "x-api-channel": "Private", @@ -1084,164 +924,23 @@ "x-api-rate-limit-pool": "Spot", "x-sdk-service": "Spot", "x-sdk-sub-service": "Order", - "x-sdk-method-name": "setDCP", - "x-sdk-method-description": "Set Disconnection Protect(Deadman Swich)Through this interface, Call this interface to automatically cancel all orders of the set trading pair after the specified time. If this interface is not called again for renewal or cancellation before the set time, the system will help the user to cancel the order of the corresponding trading pair. Otherwise it will not.", - "x-api-rate-limit": 2, + "x-sdk-method-name": "batchAddOrders", + "x-sdk-method-description": "This endpoint supports sequential batch order placement from a single endpoint. A maximum of 5orders can be placed simultaneously. The order types must be limit orders of the same trading pair", + "x-api-rate-limit": 1, "requestBody": { "content": { "application/json": { "schema": { "type": "object", "properties": { - "timeout": { - "type": "integer", - "description": "Auto cancel order trigger setting time, the unit is second. range: timeout=-1 (meaning unset) or 5 <= timeout <= 86400. For example, timeout=5 means that the order will be automatically canceled if no user request is received for more than 5 seconds. When this parameter is changed, the previous setting will be overwritten." - }, - "symbols": { - "type": "string", - "description": "List of trading pairs. When this parameter is not empty, separate it with commas and support up to 50 trading pairs. Empty means all trading pairs. When this parameter is changed, the previous setting will be overwritten.", - "example": [ - "BTC-USDT,ETH-USDT" - ] - } - }, - "required": [ - "timeout" - ] - }, - "example": "{\n \"timeout\": 5,\n \"symbols\": \"BTC-USDT,ETH-USDT\"\n}" - } - } - }, - "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"currentTime\\\":1729656588,\\\"triggerTime\\\":1729656593}}", - "x-request-example": "{\\\"timeout\\\": 5, \\\"symbols\\\": \\\"BTC-USDT,ETH-USDT\\\"}" - } - }, - "/api/v1/hf/orders/{orderId}": { - "delete": { - "summary": "Cancel Order By OrderId", - "deprecated": false, - "description": "This endpoint can be used to cancel a spot order by orderId. This endpoint only sends cancellation requests. The results of the requests must be obtained by checking the order status or subscribing to websocket.", - "tags": [], - "parameters": [ - { - "name": "orderId", - "in": "path", - "description": "The unique order id generated by the trading system", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "symbol", - "in": "query", - "description": "symbol", - "required": true, - "schema": { - "type": "string", - "example": [ - "BTC-USDT", - "ETH-USDT", - "KCS-USDT" - ] - } - } - ], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "data": { + "orderList": { + "type": "array", + "items": { "type": "object", "properties": { - "orderId": { + "clientOid": { "type": "string", - "description": "order id" - } - }, - "required": [ - "orderId" - ] - } - }, - "required": [ - "code", - "data" - ] - } - } - } - } - }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470174", - "x-abandon": "normal", - "x-domain": "Spot", - "x-api-channel": "Private", - "x-api-permission": "Spot", - "x-api-rate-limit-pool": "Spot", - "x-sdk-service": "Spot", - "x-sdk-sub-service": "Order", - "x-sdk-method-name": "cancelOrderByOrderId", - "x-sdk-method-description": "This endpoint can be used to cancel a spot order by orderId. This endpoint only sends cancellation requests. The results of the requests must be obtained by checking the order status or subscribing to websocket.", - "x-api-rate-limit": 1, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"orderId\\\": \\\"671124f9365ccb00073debd4\\\"\\n }\\n}", - "x-request-example": "{\\\"orderId\\\": \\\"671124f9365ccb00073debd4\\\", \\\"symbol\\\": \\\"BTC-USDT\\\"}" - }, - "get": { - "summary": "Get Order By OrderId", - "deprecated": false, - "description": "This endpoint can be used to obtain information for a single Spot order using the order id. After the user successfully places an order, the order is in Active state, and the user can use inOrderBook to determine whether the order has entered the order. Canceled or fully filled orders are marked as completed Done status.", - "tags": [], - "parameters": [ - { - "name": "symbol", - "in": "query", - "description": "symbol", - "required": true, - "schema": { - "type": "string", - "example": [ - "BTC-USDT", - "ETH-USDT", - "KCS-USDT" - ] - } - }, - { - "name": "orderId", - "in": "path", - "description": "The unique order id generated by the trading system", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "data": { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "The unique order id generated by the trading system" + "description": "Client Order Id,The ClientOid field is a unique ID created by the user(we recommend using a UUID), and can only contain numbers, letters, underscores (_), and hyphens (-). This field is returned when order information is obtained. You can use clientOid to tag your orders. ClientOid is different from the order ID created by the service provider. Please do not initiate requests using the same clientOid. The maximum length for the ClientOid is 40 characters.\n" }, "symbol": { "type": "string", @@ -1252,24 +951,48 @@ "KCS-USDT" ] }, - "opType": { - "type": "string" - }, "type": { "type": "string", "description": "Specify if the order is an 'limit' order or 'market' order. ", "enum": [ - "limit", - "market" + "limit" ], "x-api-enum": [ { "value": "limit", "name": "", "description": "" + } + ] + }, + "timeInForce": { + "type": "string", + "description": "[Time in force](https://www.kucoin.com/docs-new/doc-338146) is a special strategy used during trading", + "enum": [ + "GTC", + "GTT", + "IOC", + "FOK" + ], + "default": "GTC", + "x-api-enum": [ + { + "value": "GTC", + "name": "", + "description": "" }, { - "value": "market", + "value": "GTT", + "name": "", + "description": "" + }, + { + "value": "IOC", + "name": "", + "description": "" + }, + { + "value": "FOK", "name": "", "description": "" } @@ -1277,7 +1000,7 @@ }, "side": { "type": "string", - "description": "Buy or sell", + "description": "Specify if the order is to 'buy' or 'sell'", "enum": [ "buy", "sell" @@ -1297,35 +1020,15 @@ }, "price": { "type": "string", - "description": "Order price" + "description": "Specify price for order" }, "size": { "type": "string", - "description": "Order size" - }, - "funds": { - "type": "string", - "description": "Order Funds" - }, - "dealSize": { - "type": "string", - "description": "Number of filled transactions" - }, - "dealFunds": { - "type": "string", - "description": "Funds of filled transactions" - }, - "fee": { - "type": "string", - "description": "[Handling fees](https://www.kucoin.com/docs-new/api-5327739)" - }, - "feeCurrency": { - "type": "string", - "description": "currency used to calculate trading fee" + "description": "Specify quantity for order\n\nWhen **type** is limit, select one out of two: size or funds, size refers to the amount of trading targets (the asset name written in front) for the trading pair. Teh Size must be based on the baseIncrement of the trading pair. The baseIncrement represents the precision for the trading pair. The size of an order must be a positive-integer multiple of baseIncrement and must be between baseMinSize and baseMaxSize.\n\nWhen **type** is market, select one out of two: size or funds" }, "stp": { "type": "string", - "description": "[Self Trade Prevention](https://www.kucoin.com/docs-new/api-5176570)", + "description": "[Self Trade Prevention](https://www.kucoin.com/docs-new/doc-338146) is divided into four strategies: CN, CO, CB , and DC", "enum": [ "DC", "CO", @@ -1355,194 +1058,72 @@ } ] }, - "timeInForce": { - "type": "string", - "description": "Time in force", - "enum": [ - "GTC", - "GTT", - "IOC", - "FOK" - ], - "x-api-enum": [ - { - "value": "GTC", - "name": "", - "description": "" - }, - { - "value": "GTT", - "name": "", - "description": "" - }, - { - "value": "IOC", - "name": "", - "description": "" - }, - { - "value": "FOK", - "name": "", - "description": "" - } - ] + "cancelAfter": { + "type": "integer", + "description": "Cancel after n seconds,the order timing strategy is GTT", + "format": "int64" }, "postOnly": { "type": "boolean", - "description": "Whether its a postOnly order." + "default": false, + "description": "passive order labels, this is disabled when the order timing strategy is IOC or FOK" }, "hidden": { "type": "boolean", - "description": "Whether its a hidden order." + "description": "[Hidden order](https://www.kucoin.com/docs-new/doc-338146) or not (not shown in order book)", + "default": false }, "iceberg": { "type": "boolean", - "description": "Whether its a iceberg order." + "description": "Whether or not only visible portions of orders are shown in [Iceberg orders](https://www.kucoin.com/docs-new/doc-338146)", + "default": false }, "visibleSize": { "type": "string", - "description": "Visible size of iceberg order in order book." - }, - "cancelAfter": { - "type": "integer", - "description": "A GTT timeInForce that expires in n seconds" - }, - "channel": { - "type": "string" - }, - "clientOid": { - "type": "string", - "description": "Client Order Id,unique identifier created by the user" - }, - "remark": { - "type": "string", - "description": "Order placement remarks" + "description": "Maximum visible quantity in iceberg orders" }, "tags": { "type": "string", - "description": "Order tag" - }, - "cancelExist": { - "type": "boolean", - "description": "Whether there is a cancellation record for the order." - }, - "createdAt": { - "type": "integer", - "format": "int64" - }, - "lastUpdatedAt": { - "type": "integer", - "format": "int64" - }, - "tradeType": { - "type": "string", - "description": "Trade type, redundancy param" - }, - "inOrderBook": { - "type": "boolean", - "description": "Whether to enter the orderbook: true: enter the orderbook; false: not enter the orderbook" - }, - "cancelledSize": { - "type": "string", - "description": "Number of canceled transactions" - }, - "cancelledFunds": { - "type": "string", - "description": "Funds of canceled transactions" - }, - "remainSize": { - "type": "string", - "description": "Number of remain transactions" + "description": "Order tag, length cannot exceed 20 characters (ASCII)" }, - "remainFunds": { + "remark": { "type": "string", - "description": "Funds of remain transactions" + "description": "Order placement remarks, length cannot exceed 20 characters (ASCII)" }, - "tax": { + "funds": { "type": "string", - "description": "Users in some regions need query this field" - }, - "active": { - "type": "boolean", - "description": "Order status: true-The status of the order isactive; false-The status of the order is done" + "description": "When **type** is market, select one out of two: size or funds" } }, "required": [ - "id", - "symbol", - "opType", "type", + "symbol", "side", - "price", - "size", - "funds", - "dealSize", - "dealFunds", - "fee", - "feeCurrency", - "timeInForce", - "postOnly", - "hidden", - "iceberg", - "visibleSize", - "cancelAfter", - "channel", - "clientOid", - "cancelExist", - "tradeType", - "inOrderBook", - "cancelledSize", - "cancelledFunds", - "remainSize", - "remainFunds", - "active", - "createdAt", - "lastUpdatedAt", - "tax" + "price" ] - } - }, - "required": [ - "code", - "data" - ] - } - } + }, + "description": "Order List" + } + }, + "required": [ + "orderList" + ] + }, + "example": "{\n \"orderList\": [\n {\n \"clientOid\": \"client order id 12\",\n \"symbol\": \"BTC-USDT\",\n \"type\": \"limit\",\n \"side\": \"buy\",\n \"price\": \"30000\",\n \"size\": \"0.00001\"\n },\n {\n \"clientOid\": \"client order id 13\",\n \"symbol\": \"ETH-USDT\",\n \"type\": \"limit\",\n \"side\": \"sell\",\n \"price\": \"2000\",\n \"size\": \"0.00001\"\n }\n ]\n}" } } }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470181", - "x-abandon": "normal", - "x-domain": "Spot", - "x-api-channel": "Private", - "x-api-permission": "General", - "x-api-rate-limit-pool": "Spot", - "x-sdk-service": "Spot", - "x-sdk-sub-service": "Order", - "x-sdk-method-name": "getOrderByOrderId", - "x-sdk-method-description": "This endpoint can be used to obtain information for a single Spot order using the order id. After the user successfully places an order, the order is in Active state, and the user can use inOrderBook to determine whether the order has entered the order. Canceled or fully filled orders are marked as completed Done status.", - "x-api-rate-limit": 2, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"id\\\": \\\"6717422bd51c29000775ea03\\\",\\n \\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\",\\n \\\"symbol\\\": \\\"BTC-USDT\\\",\\n \\\"opType\\\": \\\"DEAL\\\",\\n \\\"type\\\": \\\"limit\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"price\\\": \\\"70000\\\",\\n \\\"size\\\": \\\"0.00001\\\",\\n \\\"funds\\\": \\\"0.7\\\",\\n \\\"dealSize\\\": \\\"0.00001\\\",\\n \\\"dealFunds\\\": \\\"0.677176\\\",\\n \\\"remainSize\\\": \\\"0\\\",\\n \\\"remainFunds\\\": \\\"0.022824\\\",\\n \\\"cancelledSize\\\": \\\"0\\\",\\n \\\"cancelledFunds\\\": \\\"0\\\",\\n \\\"fee\\\": \\\"0.000677176\\\",\\n \\\"feeCurrency\\\": \\\"USDT\\\",\\n \\\"stp\\\": null,\\n \\\"timeInForce\\\": \\\"GTC\\\",\\n \\\"postOnly\\\": false,\\n \\\"hidden\\\": false,\\n \\\"iceberg\\\": false,\\n \\\"visibleSize\\\": \\\"0\\\",\\n \\\"cancelAfter\\\": 0,\\n \\\"channel\\\": \\\"API\\\",\\n \\\"remark\\\": \\\"order remarks\\\",\\n \\\"tags\\\": null,\\n \\\"cancelExist\\\": false,\\n \\\"tradeType\\\": \\\"TRADE\\\",\\n \\\"inOrderBook\\\": false,\\n \\\"active\\\": false,\\n \\\"tax\\\": \\\"0\\\",\\n \\\"createdAt\\\": 1729577515444,\\n \\\"lastUpdatedAt\\\": 1729577515481\\n }\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"orderId\\\": \\\"6717422bd51c29000775ea03\\\"}" + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": [\\n {\\n \\\"orderId\\\": \\\"6710d8336afcdb0007319c27\\\",\\n \\\"clientOid\\\": \\\"client order id 12\\\",\\n \\\"success\\\": true\\n },\\n {\\n \\\"success\\\": false,\\n \\\"failMsg\\\": \\\"The order funds should more then 0.1 USDT.\\\"\\n }\\n ]\\n}", + "x-request-example": "{\\\"orderList\\\": [{\\\"clientOid\\\": \\\"client order id 12\\\", \\\"symbol\\\": \\\"BTC-USDT\\\", \\\"type\\\": \\\"limit\\\", \\\"side\\\": \\\"buy\\\", \\\"price\\\": \\\"30000\\\", \\\"size\\\": \\\"0.00001\\\"}, {\\\"clientOid\\\": \\\"client order id 13\\\", \\\"symbol\\\": \\\"ETH-USDT\\\", \\\"type\\\": \\\"limit\\\", \\\"side\\\": \\\"sell\\\", \\\"price\\\": \\\"2000\\\", \\\"size\\\": \\\"0.00001\\\"}]}" } }, - "/api/v1/stop-order/{orderId}": { - "delete": { - "summary": "Cancel Stop Order By OrderId", - "deprecated": true, - "description": "This endpoint can be used to cancel a spot stop order by orderId. ", + "/api/v1/hf/orders/multi/sync": { + "post": { + "summary": "Batch Add Orders Sync", + "deprecated": false, + "description": "This endpoint supports sequential batch order placement from a single endpoint. A maximum of 5orders can be placed simultaneously. The order types must be limit orders of the same trading pair", "tags": [], - "parameters": [ - { - "name": "orderId", - "in": "path", - "description": "The unique order id generated by the trading system", - "required": true, - "schema": { - "type": "string" - } - } - ], + "parameters": [], "responses": { "200": { "description": "", @@ -1555,19 +1136,75 @@ "type": "string" }, "data": { - "type": "object", - "properties": { - "cancelledOrderIds": { - "type": "array", - "items": { - "type": "string" + "type": "array", + "items": { + "type": "object", + "properties": { + "orderId": { + "type": "string", + "description": "The unique order id generated by the trading system,which can be used later for further actions such as canceling the order." }, - "description": "order id array" - } - }, - "required": [ - "cancelledOrderIds" - ] + "clientOid": { + "type": "string", + "description": "The user self-defined order id." + }, + "orderTime": { + "type": "integer", + "format": "int64" + }, + "originSize": { + "type": "string", + "description": "original order size" + }, + "dealSize": { + "type": "string", + "description": "deal size" + }, + "remainSize": { + "type": "string", + "description": "remain size" + }, + "canceledSize": { + "type": "string", + "description": "Cumulative canceled size" + }, + "status": { + "type": "string", + "description": "Order Status. open:order is active; done:order has been completed", + "enum": [ + "open", + "done" + ], + "x-api-enum": [ + { + "value": "open", + "name": "", + "description": "" + }, + { + "value": "done", + "name": "", + "description": "" + } + ] + }, + "matchTime": { + "type": "integer", + "format": "int64" + }, + "success": { + "type": "boolean", + "description": "Add order success/failure" + }, + "failMsg": { + "type": "string", + "description": "error message" + } + }, + "required": [ + "success" + ] + } } }, "required": [ @@ -1579,213 +1216,223 @@ } } }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470335", - "x-abandon": "abandon", + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470169", + "x-abandon": "normal", "x-domain": "Spot", "x-api-channel": "Private", "x-api-permission": "Spot", "x-api-rate-limit-pool": "Spot", "x-sdk-service": "Spot", "x-sdk-sub-service": "Order", - "x-sdk-method-name": "cancelStopOrderByOrderId", - "x-sdk-method-description": "This endpoint can be used to cancel a spot stop order by orderId. ", - "x-api-rate-limit": 3, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"cancelledOrderIds\\\": [\\n \\\"671124f9365ccb00073debd4\\\"\\n ]\\n }\\n}", - "x-request-example": "{\\\"orderId\\\": \\\"671124f9365ccb00073debd4\\\"}" - }, - "get": { - "summary": "Get Stop Order By OrderId", - "deprecated": false, - "description": "This interface is to obtain Spot stop order details by orderId", - "tags": [], - "parameters": [ - { - "name": "orderId", - "in": "path", - "description": "The order id", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "data": { + "x-sdk-method-name": "batchAddOrdersSync", + "x-sdk-method-description": "This endpoint supports sequential batch order placement from a single endpoint. A maximum of 5orders can be placed simultaneously. The order types must be limit orders of the same trading pair", + "x-api-rate-limit": 1, + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "orderList": { + "type": "array", + "items": { "type": "object", "properties": { - "id": { + "clientOid": { "type": "string", - "description": "Order ID, the ID of an order." + "description": "Client Order Id,The ClientOid field is a unique ID created by the user(we recommend using a UUID), and can only contain numbers, letters, underscores (_), and hyphens (-). This field is returned when order information is obtained. You can use clientOid to tag your orders. ClientOid is different from the order ID created by the service provider. Please do not initiate requests using the same clientOid. The maximum length for the ClientOid is 40 characters.\n" }, "symbol": { "type": "string", - "description": "Symbol name" - }, - "userId": { - "type": "string", - "description": "User ID" + "description": "symbol", + "example": [ + "BTC-USDT", + "ETH-USDT", + "KCS-USDT" + ] }, - "status": { + "type": { "type": "string", - "description": "Order status, include NEW, TRIGGERED" + "description": "Specify if the order is an 'limit' order or 'market' order. ", + "enum": [ + "limit" + ], + "x-api-enum": [ + { + "value": "limit", + "name": "", + "description": "" + } + ] }, - "type": { + "timeInForce": { "type": "string", - "description": "Order type,limit, market, limit_stop or market_stop" + "description": "[Time in force](https://www.kucoin.com/docs-new/doc-338146) is a special strategy used during trading", + "enum": [ + "GTC", + "GTT", + "IOC", + "FOK" + ], + "default": "GTC", + "x-api-enum": [ + { + "value": "GTC", + "name": "", + "description": "" + }, + { + "value": "GTT", + "name": "", + "description": "" + }, + { + "value": "IOC", + "name": "", + "description": "" + }, + { + "value": "FOK", + "name": "", + "description": "" + } + ] }, "side": { "type": "string", - "description": "transaction direction,include buy and sell" + "description": "Specify if the order is to 'buy' or 'sell'", + "enum": [ + "buy", + "sell" + ], + "x-api-enum": [ + { + "value": "buy", + "name": "", + "description": "" + }, + { + "value": "sell", + "name": "", + "description": "" + } + ] }, "price": { "type": "string", - "description": "order price" + "description": "Specify price for order" }, "size": { "type": "string", - "description": "order quantity" - }, - "funds": { - "type": "string", - "description": "order funds" + "description": "Specify quantity for order\n\nWhen **type** is limit, select one out of two: size or funds, size refers to the amount of trading targets (the asset name written in front) for the trading pair. Teh Size must be based on the baseIncrement of the trading pair. The baseIncrement represents the precision for the trading pair. The size of an order must be a positive-integer multiple of baseIncrement and must be between baseMinSize and baseMaxSize.\n\nWhen **type** is market, select one out of two: size or funds" }, "stp": { - "type": "string" - }, - "timeInForce": { "type": "string", - "description": "time InForce,include GTC,GTT,IOC,FOK" + "description": "[Self Trade Prevention](https://www.kucoin.com/docs-new/doc-338146) is divided into four strategies: CN, CO, CB , and DC", + "enum": [ + "DC", + "CO", + "CN", + "CB" + ], + "x-api-enum": [ + { + "value": "DC", + "name": "", + "description": "" + }, + { + "value": "CO", + "name": "", + "description": "" + }, + { + "value": "CN", + "name": "", + "description": "" + }, + { + "value": "CB", + "name": "", + "description": "" + } + ] }, "cancelAfter": { "type": "integer", - "description": "cancel orders after n seconds,requires timeInForce to be GTT", + "description": "Cancel after n seconds,the order timing strategy is GTT", "format": "int64" }, "postOnly": { "type": "boolean", - "description": "postOnly" + "default": false, + "description": "passive order labels, this is disabled when the order timing strategy is IOC or FOK" }, "hidden": { "type": "boolean", - "description": "hidden order" + "description": "[Hidden order](https://www.kucoin.com/docs-new/doc-338146) or not (not shown in order book)", + "default": false }, "iceberg": { "type": "boolean", - "description": "Iceberg order" + "description": "Whether or not only visible portions of orders are shown in [Iceberg orders](https://www.kucoin.com/docs-new/doc-338146)", + "default": false }, "visibleSize": { "type": "string", - "description": "displayed quantity for iceberg order" - }, - "channel": { - "type": "string", - "description": "order source" - }, - "clientOid": { - "type": "string", - "description": "user-entered order unique mark" - }, - "remark": { - "type": "string", - "description": "Remarks at stop order creation" + "description": "Maximum visible quantity in iceberg orders" }, "tags": { "type": "string", - "description": "tag order source" - }, - "domainId": { - "type": "string", - "description": "domainId, e.g: kucoin" - }, - "tradeSource": { - "type": "string", - "description": "trade source: USER(Order by user), MARGIN_SYSTEM(Order by margin system)" - }, - "tradeType": { - "type": "string", - "description": "The type of trading : TRADE(Spot), MARGIN_TRADE (Cross Margin), MARGIN_ISOLATED_TRADE (Isolated Margin)." - }, - "feeCurrency": { - "type": "string", - "description": "The currency of the fee" - }, - "takerFeeRate": { - "type": "string", - "description": "Fee Rate of taker" - }, - "makerFeeRate": { - "type": "string", - "description": "Fee Rate of maker" - }, - "createdAt": { - "type": "integer", - "description": "order creation time", - "format": "int64" + "description": "Order tag, length cannot exceed 20 characters (ASCII)" }, - "stop": { + "remark": { "type": "string", - "description": "Stop order type, include loss and entry" - }, - "stopTriggerTime": { - "type": "integer", - "description": "The trigger time of the stop order", - "format": "int64" + "description": "Order placement remarks, length cannot exceed 20 characters (ASCII)" }, - "stopPrice": { + "funds": { "type": "string", - "description": "stop price" - }, - "orderTime": { - "type": "integer", - "description": "Time of place a stop order, accurate to nanoseconds", - "format": "int64" + "description": "When **type** is market, select one out of two: size or funds" } }, - "description": "the details" + "required": [ + "type", + "symbol", + "side", + "price" + ] }, - "code": { - "type": "string", - "description": "return status code" - } - }, - "required": [ - "data", - "code" - ] - } - } + "description": "Order List" + } + }, + "required": [ + "orderList" + ] + }, + "example": "{\n \"orderList\": [\n {\n \"clientOid\": \"client order id 13\",\n \"symbol\": \"BTC-USDT\",\n \"type\": \"limit\",\n \"side\": \"buy\",\n \"price\": \"30000\",\n \"size\": \"0.00001\"\n },\n {\n \"clientOid\": \"client order id 14\",\n \"symbol\": \"ETH-USDT\",\n \"type\": \"limit\",\n \"side\": \"sell\",\n \"price\": \"2000\",\n \"size\": \"0.00001\"\n }\n ]\n}" } } }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470339", - "x-abandon": "normal", - "x-domain": "Spot", - "x-api-channel": "Private", - "x-api-permission": "General", - "x-api-rate-limit-pool": "Spot", - "x-sdk-service": "Spot", - "x-sdk-sub-service": "Order", - "x-sdk-method-name": "getStopOrderByOrderId", - "x-sdk-method-description": "This interface is to obtain Spot stop order details by orderId", - "x-api-rate-limit": 3, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"id\\\": \\\"vs8hoo8q2ceshiue003b67c0\\\",\\n \\\"symbol\\\": \\\"KCS-USDT\\\",\\n \\\"userId\\\": \\\"60fe4956c43cbc0006562c2c\\\",\\n \\\"status\\\": \\\"NEW\\\",\\n \\\"type\\\": \\\"limit\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"price\\\": \\\"0.01000000000000000000\\\",\\n \\\"size\\\": \\\"0.01000000000000000000\\\",\\n \\\"funds\\\": null,\\n \\\"stp\\\": null,\\n \\\"timeInForce\\\": \\\"GTC\\\",\\n \\\"cancelAfter\\\": -1,\\n \\\"postOnly\\\": false,\\n \\\"hidden\\\": false,\\n \\\"iceberg\\\": false,\\n \\\"visibleSize\\\": null,\\n \\\"channel\\\": \\\"API\\\",\\n \\\"clientOid\\\": \\\"40e0eb9efe6311eb8e58acde48001122\\\",\\n \\\"remark\\\": null,\\n \\\"tags\\\": null,\\n \\\"orderTime\\\": 1629098781127530200,\\n \\\"domainId\\\": \\\"kucoin\\\",\\n \\\"tradeSource\\\": \\\"USER\\\",\\n \\\"tradeType\\\": \\\"TRADE\\\",\\n \\\"feeCurrency\\\": \\\"USDT\\\",\\n \\\"takerFeeRate\\\": \\\"0.00200000000000000000\\\",\\n \\\"makerFeeRate\\\": \\\"0.00200000000000000000\\\",\\n \\\"createdAt\\\": 1629098781128,\\n \\\"stop\\\": \\\"loss\\\",\\n \\\"stopTriggerTime\\\": null,\\n \\\"stopPrice\\\": \\\"10.00000000000000000000\\\"\\n }\\n}", - "x-request-example": "{\\\"orderId\\\": \\\"example_string_default_value\\\"}" + "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":[{\\\"orderId\\\":\\\"6711195e5584bc0007bd5aef\\\",\\\"clientOid\\\":\\\"client order id 13\\\",\\\"orderTime\\\":1729173854299,\\\"originSize\\\":\\\"0.00001\\\",\\\"dealSize\\\":\\\"0\\\",\\\"remainSize\\\":\\\"0.00001\\\",\\\"canceledSize\\\":\\\"0\\\",\\\"status\\\":\\\"open\\\",\\\"matchTime\\\":1729173854326,\\\"success\\\":true},{\\\"success\\\":false,\\\"failMsg\\\":\\\"The order funds should more then 0.1 USDT.\\\"}]}", + "x-request-example": "{\\\"orderList\\\": [{\\\"clientOid\\\": \\\"client order id 13\\\", \\\"symbol\\\": \\\"BTC-USDT\\\", \\\"type\\\": \\\"limit\\\", \\\"side\\\": \\\"buy\\\", \\\"price\\\": \\\"30000\\\", \\\"size\\\": \\\"0.00001\\\"}, {\\\"clientOid\\\": \\\"client order id 14\\\", \\\"symbol\\\": \\\"ETH-USDT\\\", \\\"type\\\": \\\"limit\\\", \\\"side\\\": \\\"sell\\\", \\\"price\\\": \\\"2000\\\", \\\"size\\\": \\\"0.00001\\\"}]}" } }, - "/api/v1/hf/orders": { + "/api/v1/hf/orders/{orderId}": { "delete": { - "summary": "Cancel All Orders By Symbol", + "summary": "Cancel Order By OrderId", "deprecated": false, - "description": "This endpoint can cancel all spot orders for specific symbol. This endpoint only sends cancellation requests. The results of the requests must be obtained by checking the order status or subscribing to websocket.", + "description": "This endpoint can be used to cancel a spot order by orderId. This endpoint only sends cancellation requests. The results of the requests must be obtained by checking the order status or subscribing to websocket.", "tags": [], "parameters": [ + { + "name": "orderId", + "in": "path", + "description": "The unique order id generated by the trading system", + "required": true, + "schema": { + "type": "string" + } + }, { "name": "symbol", "in": "query", @@ -1813,7 +1460,16 @@ "type": "string" }, "data": { - "type": "string" + "type": "object", + "properties": { + "orderId": { + "type": "string", + "description": "order id" + } + }, + "required": [ + "orderId" + ] } }, "required": [ @@ -1825,7 +1481,7 @@ } } }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470175", + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470174", "x-abandon": "normal", "x-domain": "Spot", "x-api-channel": "Private", @@ -1833,18 +1489,42 @@ "x-api-rate-limit-pool": "Spot", "x-sdk-service": "Spot", "x-sdk-sub-service": "Order", - "x-sdk-method-name": "cancelAllOrdersBySymbol", - "x-sdk-method-description": "This endpoint can cancel all spot orders for specific symbol. This endpoint only sends cancellation requests. The results of the requests must be obtained by checking the order status or subscribing to websocket.", - "x-api-rate-limit": 2, - "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":\\\"success\\\"}", - "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\"}" + "x-sdk-method-name": "cancelOrderByOrderId", + "x-sdk-method-description": "This endpoint can be used to cancel a spot order by orderId. This endpoint only sends cancellation requests. The results of the requests must be obtained by checking the order status or subscribing to websocket.", + "x-api-rate-limit": 1, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"orderId\\\": \\\"671124f9365ccb00073debd4\\\"\\n }\\n}", + "x-request-example": "{\\\"orderId\\\": \\\"671124f9365ccb00073debd4\\\", \\\"symbol\\\": \\\"BTC-USDT\\\"}" }, - "post": { - "summary": "Add Order", + "get": { + "summary": "Get Order By OrderId", "deprecated": false, - "description": "Place order to the Spot trading system, you can place two major types of orders: limit and market. Orders can only be placed if your account has sufficient funds. Once an order is placed, your funds will be put on hold for the duration of the order. The amount of funds on hold depends on the order type and parameters specified.", + "description": "This endpoint can be used to obtain information for a single Spot order using the order id. After the user successfully places an order, the order is in Active state, and the user can use inOrderBook to determine whether the order has entered the order. Canceled or fully filled orders are marked as completed Done status.", "tags": [], - "parameters": [], + "parameters": [ + { + "name": "symbol", + "in": "query", + "description": "symbol", + "required": true, + "schema": { + "type": "string", + "example": [ + "BTC-USDT", + "ETH-USDT", + "KCS-USDT" + ] + } + }, + { + "name": "orderId", + "in": "path", + "description": "The unique order id generated by the trading system", + "required": true, + "schema": { + "type": "string" + } + } + ], "responses": { "200": { "description": "", @@ -1859,231 +1539,1033 @@ "data": { "type": "object", "properties": { - "orderId": { + "id": { "type": "string", - "description": "The unique order id generated by the trading system,which can be used later for further actions such as canceling the order." + "description": "The unique order id generated by the trading system" }, - "clientOid": { + "symbol": { "type": "string", - "description": "The user self-defined order id." - } - }, - "required": [ - "orderId", - "clientOid" - ] - } - }, - "required": [ - "code", - "data" - ] - } - } - } - } - }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470188", - "x-abandon": "normal", - "x-domain": "Spot", - "x-api-channel": "Private", - "x-api-permission": "Spot", - "x-api-rate-limit-pool": "Spot", + "description": "symbol", + "example": [ + "BTC-USDT", + "ETH-USDT", + "KCS-USDT" + ] + }, + "opType": { + "type": "string" + }, + "type": { + "type": "string", + "description": "Specify if the order is an 'limit' order or 'market' order. ", + "enum": [ + "limit", + "market" + ], + "x-api-enum": [ + { + "value": "limit", + "name": "", + "description": "" + }, + { + "value": "market", + "name": "", + "description": "" + } + ] + }, + "side": { + "type": "string", + "description": "Buy or sell", + "enum": [ + "buy", + "sell" + ], + "x-api-enum": [ + { + "value": "buy", + "name": "", + "description": "" + }, + { + "value": "sell", + "name": "", + "description": "" + } + ] + }, + "price": { + "type": "string", + "description": "Order price" + }, + "size": { + "type": "string", + "description": "Order size" + }, + "funds": { + "type": "string", + "description": "Order Funds" + }, + "dealSize": { + "type": "string", + "description": "Number of filled transactions" + }, + "dealFunds": { + "type": "string", + "description": "Funds of filled transactions" + }, + "fee": { + "type": "string", + "description": "[Handling fees](https://www.kucoin.com/docs-new/api-5327739)" + }, + "feeCurrency": { + "type": "string", + "description": "currency used to calculate trading fee" + }, + "stp": { + "type": "string", + "description": "[Self Trade Prevention](https://www.kucoin.com/docs-new/api-5176570)", + "enum": [ + "DC", + "CO", + "CN", + "CB" + ], + "x-api-enum": [ + { + "value": "DC", + "name": "", + "description": "" + }, + { + "value": "CO", + "name": "", + "description": "" + }, + { + "value": "CN", + "name": "", + "description": "" + }, + { + "value": "CB", + "name": "", + "description": "" + } + ] + }, + "timeInForce": { + "type": "string", + "description": "Time in force", + "enum": [ + "GTC", + "GTT", + "IOC", + "FOK" + ], + "x-api-enum": [ + { + "value": "GTC", + "name": "", + "description": "" + }, + { + "value": "GTT", + "name": "", + "description": "" + }, + { + "value": "IOC", + "name": "", + "description": "" + }, + { + "value": "FOK", + "name": "", + "description": "" + } + ] + }, + "postOnly": { + "type": "boolean", + "description": "Whether its a postOnly order." + }, + "hidden": { + "type": "boolean", + "description": "Whether its a hidden order." + }, + "iceberg": { + "type": "boolean", + "description": "Whether its a iceberg order." + }, + "visibleSize": { + "type": "string", + "description": "Visible size of iceberg order in order book." + }, + "cancelAfter": { + "type": "integer", + "description": "A GTT timeInForce that expires in n seconds" + }, + "channel": { + "type": "string" + }, + "clientOid": { + "type": "string", + "description": "Client Order Id,unique identifier created by the user" + }, + "remark": { + "type": "string", + "description": "Order placement remarks" + }, + "tags": { + "type": "string", + "description": "Order tag" + }, + "cancelExist": { + "type": "boolean", + "description": "Whether there is a cancellation record for the order." + }, + "createdAt": { + "type": "integer", + "format": "int64" + }, + "lastUpdatedAt": { + "type": "integer", + "format": "int64" + }, + "tradeType": { + "type": "string", + "description": "Trade type, redundancy param" + }, + "inOrderBook": { + "type": "boolean", + "description": "Whether to enter the orderbook: true: enter the orderbook; false: not enter the orderbook" + }, + "cancelledSize": { + "type": "string", + "description": "Number of canceled transactions" + }, + "cancelledFunds": { + "type": "string", + "description": "Funds of canceled transactions" + }, + "remainSize": { + "type": "string", + "description": "Number of remain transactions" + }, + "remainFunds": { + "type": "string", + "description": "Funds of remain transactions" + }, + "tax": { + "type": "string", + "description": "Users in some regions need query this field" + }, + "active": { + "type": "boolean", + "description": "Order status: true-The status of the order isactive; false-The status of the order is done" + } + }, + "required": [ + "id", + "symbol", + "opType", + "type", + "side", + "price", + "size", + "funds", + "dealSize", + "dealFunds", + "fee", + "feeCurrency", + "timeInForce", + "postOnly", + "hidden", + "iceberg", + "visibleSize", + "cancelAfter", + "channel", + "clientOid", + "cancelExist", + "tradeType", + "inOrderBook", + "cancelledSize", + "cancelledFunds", + "remainSize", + "remainFunds", + "active", + "createdAt", + "lastUpdatedAt", + "tax" + ] + } + }, + "required": [ + "code", + "data" + ] + } + } + } + } + }, + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470181", + "x-abandon": "normal", + "x-domain": "Spot", + "x-api-channel": "Private", + "x-api-permission": "General", + "x-api-rate-limit-pool": "Spot", + "x-sdk-service": "Spot", + "x-sdk-sub-service": "Order", + "x-sdk-method-name": "getOrderByOrderId", + "x-sdk-method-description": "This endpoint can be used to obtain information for a single Spot order using the order id. After the user successfully places an order, the order is in Active state, and the user can use inOrderBook to determine whether the order has entered the order. Canceled or fully filled orders are marked as completed Done status.", + "x-api-rate-limit": 2, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"id\\\": \\\"6717422bd51c29000775ea03\\\",\\n \\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\",\\n \\\"symbol\\\": \\\"BTC-USDT\\\",\\n \\\"opType\\\": \\\"DEAL\\\",\\n \\\"type\\\": \\\"limit\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"price\\\": \\\"70000\\\",\\n \\\"size\\\": \\\"0.00001\\\",\\n \\\"funds\\\": \\\"0.7\\\",\\n \\\"dealSize\\\": \\\"0.00001\\\",\\n \\\"dealFunds\\\": \\\"0.677176\\\",\\n \\\"remainSize\\\": \\\"0\\\",\\n \\\"remainFunds\\\": \\\"0.022824\\\",\\n \\\"cancelledSize\\\": \\\"0\\\",\\n \\\"cancelledFunds\\\": \\\"0\\\",\\n \\\"fee\\\": \\\"0.000677176\\\",\\n \\\"feeCurrency\\\": \\\"USDT\\\",\\n \\\"stp\\\": null,\\n \\\"timeInForce\\\": \\\"GTC\\\",\\n \\\"postOnly\\\": false,\\n \\\"hidden\\\": false,\\n \\\"iceberg\\\": false,\\n \\\"visibleSize\\\": \\\"0\\\",\\n \\\"cancelAfter\\\": 0,\\n \\\"channel\\\": \\\"API\\\",\\n \\\"remark\\\": \\\"order remarks\\\",\\n \\\"tags\\\": null,\\n \\\"cancelExist\\\": false,\\n \\\"tradeType\\\": \\\"TRADE\\\",\\n \\\"inOrderBook\\\": false,\\n \\\"active\\\": false,\\n \\\"tax\\\": \\\"0\\\",\\n \\\"createdAt\\\": 1729577515444,\\n \\\"lastUpdatedAt\\\": 1729577515481\\n }\\n}", + "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"orderId\\\": \\\"6717422bd51c29000775ea03\\\"}" + } + }, + "/api/v1/hf/orders/sync/{orderId}": { + "delete": { + "summary": "Cancel Order By OrderId Sync", + "deprecated": false, + "description": "This endpoint can be used to cancel a spot order by orderId.", + "tags": [], + "parameters": [ + { + "name": "orderId", + "in": "path", + "description": "The unique order id generated by the trading system", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "symbol", + "in": "query", + "description": "symbol", + "required": true, + "schema": { + "type": "string", + "example": [ + "BTC-USDT", + "ETH-USDT", + "KCS-USDT" + ] + } + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "object", + "properties": { + "orderId": { + "type": "string", + "description": "order id" + }, + "originSize": { + "type": "string", + "description": "original order size" + }, + "dealSize": { + "type": "string", + "description": "deal size" + }, + "remainSize": { + "type": "string", + "description": "remain size" + }, + "canceledSize": { + "type": "string", + "description": "Cumulative canceled size" + }, + "status": { + "type": "string", + "description": "Order Status. open:order is active; done:order has been completed", + "enum": [ + "open", + "done" + ], + "x-api-enum": [ + { + "value": "open", + "name": "", + "description": "" + }, + { + "value": "done", + "name": "", + "description": "" + } + ] + } + }, + "required": [ + "orderId", + "dealSize", + "remainSize", + "canceledSize", + "status", + "originSize" + ] + } + }, + "required": [ + "code", + "data" + ] + } + } + } + } + }, + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470185", + "x-abandon": "normal", + "x-domain": "Spot", + "x-api-channel": "Private", + "x-api-permission": "Spot", + "x-api-rate-limit-pool": "Spot", + "x-sdk-service": "Spot", + "x-sdk-sub-service": "Order", + "x-sdk-method-name": "cancelOrderByOrderIdSync", + "x-sdk-method-description": "This endpoint can be used to cancel a spot order by orderId.", + "x-api-rate-limit": 1, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"orderId\\\": \\\"671128ee365ccb0007534d45\\\",\\n \\\"originSize\\\": \\\"0.00001\\\",\\n \\\"dealSize\\\": \\\"0\\\",\\n \\\"remainSize\\\": \\\"0\\\",\\n \\\"canceledSize\\\": \\\"0.00001\\\",\\n \\\"status\\\": \\\"done\\\"\\n }\\n}", + "x-request-example": "{\\\"orderId\\\": \\\"671128ee365ccb0007534d45\\\", \\\"symbol\\\": \\\"BTC-USDT\\\"}" + } + }, + "/api/v1/hf/orders/client-order/{clientOid}": { + "delete": { + "summary": "Cancel Order By ClientOid", + "deprecated": false, + "description": "This endpoint can be used to cancel a spot order by clientOid. This endpoint only sends cancellation requests. The results of the requests must be obtained by checking the order status or subscribing to websocket.", + "tags": [], + "parameters": [ + { + "name": "clientOid", + "in": "path", + "description": "Client Order Id,unique identifier created by the user", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "symbol", + "in": "query", + "description": "symbol", + "required": true, + "schema": { + "type": "string", + "example": [ + "BTC-USDT", + "ETH-USDT", + "KCS-USDT" + ] + } + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "object", + "properties": { + "clientOid": { + "type": "string", + "description": "Client Order Id,unique identifier created by the user" + } + }, + "required": [ + "clientOid" + ] + } + }, + "required": [ + "code", + "data" + ] + } + } + } + } + }, + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470184", + "x-abandon": "normal", + "x-domain": "Spot", + "x-api-channel": "Private", + "x-api-permission": "Spot", + "x-api-rate-limit-pool": "Spot", "x-sdk-service": "Spot", "x-sdk-sub-service": "Order", - "x-sdk-method-name": "addOrder", - "x-sdk-method-description": "Place order to the Spot trading system, you can place two major types of orders: limit and market. Orders can only be placed if your account has sufficient funds. Once an order is placed, your funds will be put on hold for the duration of the order. The amount of funds on hold depends on the order type and parameters specified.", + "x-sdk-method-name": "cancelOrderByClientOid", + "x-sdk-method-description": "This endpoint can be used to cancel a spot order by clientOid. This endpoint only sends cancellation requests. The results of the requests must be obtained by checking the order status or subscribing to websocket.", "x-api-rate-limit": 1, - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "clientOid": { - "type": "string", - "description": "Client Order Id,The ClientOid field is a unique ID created by the user(we recommend using a UUID), and can only contain numbers, letters, underscores (_), and hyphens (-). This field is returned when order information is obtained. You can use clientOid to tag your orders. ClientOid is different from the order ID created by the service provider. Please do not initiate requests using the same clientOid. The maximum length for the ClientOid is 40 characters.\n\nPlease remember the orderId created by the service provider, it used to check for updates in order status.", - "example": [ - "5c52e11203aa677f33e493fb" - ] - }, - "side": { - "type": "string", - "description": "specify if the order is to 'buy' or 'sell'", - "enum": [ - "buy", - "sell" - ], - "x-api-enum": [ - { - "value": "buy", - "name": "", - "description": "" - }, - { - "value": "sell", - "name": "", - "description": "" - } - ], - "example": [ - "buy" - ] - }, - "symbol": { - "type": "string", - "description": "symbol", - "example": [ - "BTC-USDT", - "ETH-USDT", - "KCS-USDT" - ] - }, - "type": { - "type": "string", - "description": "specify if the order is an 'limit' order or 'market' order. \n\nThe type of order you specify when you place your order determines whether or not you need to request other parameters and also affects the execution of the matching engine.\n\nWhen placing a limit order, you must specify a price and size. The system will try to match the order according to market price or a price better than market price. If the order cannot be immediately matched, it will stay in the order book until it is matched or the user cancels.\n\nUnlike limit orders, the price for market orders fluctuates with market prices. When placing a market order, you do not need to specify a price, you only need to specify a quantity. Market orders are filled immediately and will not enter the order book. All market orders are takers and a taker fee will be charged.", - "enum": [ - "limit", - "market" - ], - "x-api-enum": [ - { - "value": "limit", - "name": "", - "description": "" + "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"clientOid\\\":\\\"5c52e11203aa677f33e493fb\\\"}}", + "x-request-example": "{\\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\", \\\"symbol\\\": \\\"BTC-USDT\\\"}" + }, + "get": { + "summary": "Get Order By ClientOid", + "deprecated": false, + "description": "This endpoint can be used to obtain information for a single Spot order using the client order id. After the user successfully places an order, the order is in Active state, and the user can use inOrderBook to determine whether the order has entered the order. Canceled or fully filled orders are marked as completed Done status.", + "tags": [], + "parameters": [ + { + "name": "symbol", + "in": "query", + "description": "symbol", + "required": true, + "schema": { + "type": "string", + "example": [ + "BTC-USDT", + "ETH-USDT", + "KCS-USDT" + ] + } + }, + { + "name": "clientOid", + "in": "path", + "description": "Client Order Id,unique identifier created by the user", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The unique order id generated by the trading system" + }, + "symbol": { + "type": "string", + "description": "symbol", + "example": [ + "BTC-USDT", + "ETH-USDT", + "KCS-USDT" + ] + }, + "opType": { + "type": "string" + }, + "type": { + "type": "string", + "description": "Specify if the order is an 'limit' order or 'market' order. ", + "enum": [ + "limit", + "market" + ], + "x-api-enum": [ + { + "value": "limit", + "name": "", + "description": "" + }, + { + "value": "market", + "name": "", + "description": "" + } + ] + }, + "side": { + "type": "string", + "description": "Buy or sell", + "enum": [ + "buy", + "sell" + ], + "x-api-enum": [ + { + "value": "buy", + "name": "", + "description": "" + }, + { + "value": "sell", + "name": "", + "description": "" + } + ] + }, + "price": { + "type": "string", + "description": "Order price" + }, + "size": { + "type": "string", + "description": "Order size" + }, + "funds": { + "type": "string", + "description": "Order Funds" + }, + "dealSize": { + "type": "string", + "description": "Number of filled transactions" + }, + "dealFunds": { + "type": "string", + "description": "Funds of filled transactions" + }, + "fee": { + "type": "string", + "description": "[Handling fees](https://www.kucoin.com/docs-new/api-5327739)" + }, + "feeCurrency": { + "type": "string", + "description": "currency used to calculate trading fee" + }, + "stp": { + "type": "string", + "description": "[Self Trade Prevention](https://www.kucoin.com/docs-new/api-5176570)", + "enum": [ + "DC", + "CO", + "CN", + "CB" + ], + "x-api-enum": [ + { + "value": "DC", + "name": "", + "description": "" + }, + { + "value": "CO", + "name": "", + "description": "" + }, + { + "value": "CN", + "name": "", + "description": "" + }, + { + "value": "CB", + "name": "", + "description": "" + } + ] + }, + "timeInForce": { + "type": "string", + "description": "Time in force", + "enum": [ + "GTC", + "GTT", + "IOC", + "FOK" + ], + "x-api-enum": [ + { + "value": "GTC", + "name": "", + "description": "" + }, + { + "value": "GTT", + "name": "", + "description": "" + }, + { + "value": "IOC", + "name": "", + "description": "" + }, + { + "value": "FOK", + "name": "", + "description": "" + } + ] + }, + "postOnly": { + "type": "boolean", + "description": "Whether its a postOnly order." + }, + "hidden": { + "type": "boolean", + "description": "Whether its a hidden order." + }, + "iceberg": { + "type": "boolean", + "description": "Whether its a iceberg order." + }, + "visibleSize": { + "type": "string", + "description": "Visible size of iceberg order in order book." + }, + "cancelAfter": { + "type": "integer", + "description": "A GTT timeInForce that expires in n seconds" + }, + "channel": { + "type": "string" + }, + "clientOid": { + "type": "string", + "description": "Client Order Id,unique identifier created by the user" + }, + "remark": { + "type": "string", + "description": "Order placement remarks" + }, + "tags": { + "type": "string", + "description": "Order tag" + }, + "cancelExist": { + "type": "boolean", + "description": "Whether there is a cancellation record for the order." + }, + "createdAt": { + "type": "integer", + "format": "int64" + }, + "lastUpdatedAt": { + "type": "integer", + "format": "int64" + }, + "tradeType": { + "type": "string", + "description": "Trade type, redundancy param" + }, + "inOrderBook": { + "type": "boolean", + "description": "Whether to enter the orderbook: true: enter the orderbook; false: not enter the orderbook" + }, + "cancelledSize": { + "type": "string", + "description": "Number of canceled transactions" + }, + "cancelledFunds": { + "type": "string", + "description": "Funds of canceled transactions" + }, + "remainSize": { + "type": "string", + "description": "Number of remain transactions" + }, + "remainFunds": { + "type": "string", + "description": "Funds of remain transactions" + }, + "tax": { + "type": "string", + "description": "Users in some regions need query this field" + }, + "active": { + "type": "boolean", + "description": "Order status: true-The status of the order isactive; false-The status of the order is done" + } }, - { - "value": "market", - "name": "", - "description": "" - } - ], - "example": [ - "limit" - ] - }, - "remark": { - "type": "string", - "description": "Order placement remarks, length cannot exceed 20 characters (ASCII)" + "required": [ + "id", + "symbol", + "opType", + "type", + "side", + "price", + "size", + "funds", + "dealSize", + "dealFunds", + "fee", + "feeCurrency", + "timeInForce", + "postOnly", + "hidden", + "iceberg", + "visibleSize", + "cancelAfter", + "channel", + "clientOid", + "cancelExist", + "tradeType", + "inOrderBook", + "cancelledSize", + "cancelledFunds", + "remainSize", + "remainFunds", + "active", + "createdAt", + "lastUpdatedAt", + "tax" + ] + } }, - "stp": { - "type": "string", - "description": "[Self Trade Prevention](https://www.kucoin.com/docs-new/doc-338146) is divided into four strategies: CN, CO, CB , and DC", - "enum": [ - "DC", - "CO", - "CN", - "CB" - ], - "x-api-enum": [ - { - "value": "DC", - "name": "", - "description": "" - }, - { - "value": "CO", - "name": "", - "description": "" - }, - { - "value": "CN", - "name": "", - "description": "" + "required": [ + "code", + "data" + ] + } + } + } + } + }, + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470182", + "x-abandon": "normal", + "x-domain": "Spot", + "x-api-channel": "Private", + "x-api-permission": "General", + "x-api-rate-limit-pool": "Spot", + "x-sdk-service": "Spot", + "x-sdk-sub-service": "Order", + "x-sdk-method-name": "getOrderByClientOid", + "x-sdk-method-description": "This endpoint can be used to obtain information for a single Spot order using the client order id. After the user successfully places an order, the order is in Active state, and the user can use inOrderBook to determine whether the order has entered the order. Canceled or fully filled orders are marked as completed Done status.", + "x-api-rate-limit": 2, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"id\\\": \\\"6717422bd51c29000775ea03\\\",\\n \\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\",\\n \\\"symbol\\\": \\\"BTC-USDT\\\",\\n \\\"opType\\\": \\\"DEAL\\\",\\n \\\"type\\\": \\\"limit\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"price\\\": \\\"70000\\\",\\n \\\"size\\\": \\\"0.00001\\\",\\n \\\"funds\\\": \\\"0.7\\\",\\n \\\"dealSize\\\": \\\"0.00001\\\",\\n \\\"dealFunds\\\": \\\"0.677176\\\",\\n \\\"remainSize\\\": \\\"0\\\",\\n \\\"remainFunds\\\": \\\"0.022824\\\",\\n \\\"cancelledSize\\\": \\\"0\\\",\\n \\\"cancelledFunds\\\": \\\"0\\\",\\n \\\"fee\\\": \\\"0.000677176\\\",\\n \\\"feeCurrency\\\": \\\"USDT\\\",\\n \\\"stp\\\": null,\\n \\\"timeInForce\\\": \\\"GTC\\\",\\n \\\"postOnly\\\": false,\\n \\\"hidden\\\": false,\\n \\\"iceberg\\\": false,\\n \\\"visibleSize\\\": \\\"0\\\",\\n \\\"cancelAfter\\\": 0,\\n \\\"channel\\\": \\\"API\\\",\\n \\\"remark\\\": \\\"order remarks\\\",\\n \\\"tags\\\": null,\\n \\\"cancelExist\\\": false,\\n \\\"tradeType\\\": \\\"TRADE\\\",\\n \\\"inOrderBook\\\": false,\\n \\\"active\\\": false,\\n \\\"tax\\\": \\\"0\\\",\\n \\\"createdAt\\\": 1729577515444,\\n \\\"lastUpdatedAt\\\": 1729577515481\\n }\\n}", + "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\"}" + } + }, + "/api/v1/hf/orders/sync/client-order/{clientOid}": { + "delete": { + "summary": "Cancel Order By ClientOid Sync", + "deprecated": false, + "description": "This endpoint can be used to cancel a spot order by orderId.", + "tags": [], + "parameters": [ + { + "name": "clientOid", + "in": "path", + "description": "Client Order Id,unique identifier created by the user", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "symbol", + "in": "query", + "description": "symbol", + "required": true, + "schema": { + "type": "string", + "example": [ + "BTC-USDT", + "ETH-USDT", + "KCS-USDT" + ] + } + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "object", + "properties": { + "clientOid": { + "type": "string", + "description": "Client Order Id,unique identifier created by the user" + }, + "originSize": { + "type": "string", + "description": "original order size" + }, + "dealSize": { + "type": "string", + "description": "deal size" + }, + "remainSize": { + "type": "string", + "description": "remain size" + }, + "canceledSize": { + "type": "string", + "description": "Cumulative canceled size" + }, + "status": { + "type": "string", + "description": "Order Status. open:order is active; done:order has been completed", + "enum": [ + "open", + "done" + ], + "x-api-enum": [ + { + "value": "open", + "name": "", + "description": "" + }, + { + "value": "done", + "name": "", + "description": "" + } + ] + } }, - { - "value": "CB", - "name": "", - "description": "" - } - ] - }, - "price": { - "type": "string", - "description": "Specify price for order\n\nWhen placing a limit order, the price must be based on priceIncrement for the trading pair. The price increment (priceIncrement) is the price precision for the trading pair. For example, for the BTC-USDT trading pair, the priceIncrement is 0.00001000. So the price for your orders cannot be less than 0.00001000 and must be a multiple of priceIncrement. Otherwise, the order will return an invalid priceIncrement error." - }, - "size": { - "type": "string", - "description": "Specify quantity for order\n\nWhen **type** is limit, size refers to the amount of trading targets (the asset name written in front) for the trading pair. Teh Size must be based on the baseIncrement of the trading pair. The baseIncrement represents the precision for the trading pair. The size of an order must be a positive-integer multiple of baseIncrement and must be between baseMinSize and baseMaxSize.\n\nWhen **type** is market, select one out of two: size or funds" + "required": [ + "clientOid", + "originSize", + "dealSize", + "remainSize", + "canceledSize", + "status" + ] + } }, - "timeInForce": { - "type": "string", - "description": "[Time in force](https://www.kucoin.com/docs-new/doc-338146) is a special strategy used during trading", - "enum": [ - "GTC", - "GTT", - "IOC", - "FOK" - ], - "default": "GTC", - "x-api-enum": [ - { - "value": "GTC", - "name": "", - "description": "" - }, - { - "value": "GTT", - "name": "", - "description": "" - }, - { - "value": "IOC", - "name": "", - "description": "" + "required": [ + "code", + "data" + ] + } + } + } + } + }, + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470186", + "x-abandon": "normal", + "x-domain": "Spot", + "x-api-channel": "Private", + "x-api-permission": "Spot", + "x-api-rate-limit-pool": "Spot", + "x-sdk-service": "Spot", + "x-sdk-sub-service": "Order", + "x-sdk-method-name": "cancelOrderByClientOidSync", + "x-sdk-method-description": "This endpoint can be used to cancel a spot order by orderId.", + "x-api-rate-limit": 1, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\",\\n \\\"originSize\\\": \\\"0.00001\\\",\\n \\\"dealSize\\\": \\\"0\\\",\\n \\\"remainSize\\\": \\\"0\\\",\\n \\\"canceledSize\\\": \\\"0.00001\\\",\\n \\\"status\\\": \\\"done\\\"\\n }\\n}", + "x-request-example": "{\\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\", \\\"symbol\\\": \\\"BTC-USDT\\\"}" + } + }, + "/api/v1/hf/orders/cancel/{orderId}": { + "delete": { + "summary": "Cancel Partial Order", + "deprecated": false, + "description": "This interface can cancel the specified quantity of the order according to the orderId. The order execution order is: price first, time first, this interface will not change the queue order", + "tags": [], + "parameters": [ + { + "name": "orderId", + "in": "path", + "description": "The unique order id generated by the trading system", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "symbol", + "in": "query", + "description": "symbol", + "required": true, + "schema": { + "type": "string", + "example": [ + "BTC-USDT", + "ETH-USDT", + "KCS-USDT" + ] + } + }, + { + "name": "cancelSize", + "in": "query", + "description": "The size you want cancel", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "object", + "properties": { + "orderId": { + "type": "string", + "description": "order id" + }, + "cancelSize": { + "type": "string", + "description": "The size you canceled" + } }, - { - "value": "FOK", - "name": "", - "description": "" - } - ] - }, - "postOnly": { - "type": "boolean", - "default": false, - "description": "passive order labels, this is disabled when the order timing strategy is IOC or FOK" - }, - "hidden": { - "type": "boolean", - "description": "[Hidden order](https://www.kucoin.com/docs-new/doc-338146) or not (not shown in order book)", - "default": false - }, - "iceberg": { - "type": "boolean", - "description": "Whether or not only visible portions of orders are shown in [Iceberg orders](https://www.kucoin.com/docs-new/doc-338146)", - "default": false - }, - "visibleSize": { - "type": "string", - "description": "Maximum visible quantity in iceberg orders" - }, - "tags": { - "type": "string", - "description": "Order tag, length cannot exceed 20 characters (ASCII)" - }, - "cancelAfter": { - "type": "integer", - "format": "int64", - "description": "Cancel after n seconds,the order timing strategy is GTT" + "required": [ + "orderId", + "cancelSize" + ] + } }, - "funds": { - "type": "string", - "description": "When **type** is market, select one out of two: size or funds" - } - }, - "required": [ - "symbol", - "type", - "side" - ] - }, - "example": "//limit order\n{\n \"type\": \"limit\",\n \"symbol\": \"BTC-USDT\",\n \"side\": \"buy\",\n \"price\": \"50000\",\n \"size\": \"0.00001\",\n \"clientOid\": \"5c52e11203aa677f33e493fb\",\n \"remark\": \"order remarks\"\n}\n\n//market order 1\n// {\n// \"type\": \"market\",\n// \"symbol\": \"BTC-USDT\",\n// \"side\": \"buy\",\n// \"size\": \"0.00001\",\n// \"clientOid\": \"5c52e11203aa677f33e493fc\",\n// \"remark\": \"order remarks\"\n// }\n\n//market order 2\n// {\n// \"type\": \"market\",\n// \"symbol\": \"BTC-USDT\",\n// \"side\": \"buy\",\n// \"funds\": \"1\",\n// \"clientOid\": \"5c52e11203aa677f33e493fc\",\n// \"remark\": \"order remarks\"\n// }\n" + "required": [ + "code", + "data" + ] + } + } } } }, - "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"orderId\\\":\\\"670fd33bf9406e0007ab3945\\\",\\\"clientOid\\\":\\\"5c52e11203aa677f33e493fb\\\"}}", - "x-request-example": "{\\\"type\\\": \\\"limit\\\", \\\"symbol\\\": \\\"BTC-USDT\\\", \\\"side\\\": \\\"buy\\\", \\\"price\\\": \\\"50000\\\", \\\"size\\\": \\\"0.00001\\\", \\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\", \\\"remark\\\": \\\"order remarks\\\"}" + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470183", + "x-abandon": "normal", + "x-domain": "Spot", + "x-api-channel": "Private", + "x-api-permission": "Spot", + "x-api-rate-limit-pool": "Spot", + "x-sdk-service": "Spot", + "x-sdk-sub-service": "Order", + "x-sdk-method-name": "cancelPartialOrder", + "x-sdk-method-description": "This interface can cancel the specified quantity of the order according to the orderId. The order execution order is: price first, time first, this interface will not change the queue order", + "x-api-rate-limit": 2, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"orderId\\\": \\\"6711f73c1ef16c000717bb31\\\",\\n \\\"cancelSize\\\": \\\"0.00001\\\"\\n }\\n}", + "x-request-example": "{\\\"orderId\\\": \\\"6711f73c1ef16c000717bb31\\\", \\\"symbol\\\": \\\"BTC-USDT\\\", \\\"cancelSize\\\": \\\"0.00001\\\"}" } }, "/api/v1/hf/orders/cancelAll": { @@ -2166,23 +2648,13 @@ "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"succeedSymbols\\\": [\\n \\\"ETH-USDT\\\",\\n \\\"BTC-USDT\\\"\\n ],\\n \\\"failedSymbols\\\": []\\n }\\n}" } }, - "/api/v3/oco/order/{orderId}": { - "delete": { - "summary": "Cancel OCO Order By OrderId", - "deprecated": true, - "description": "This endpoint can be used to cancel a spot order by orderId. This endpoint only sends cancellation requests. The results of the requests must be obtained by checking the order status or subscribing to websocket.", + "/api/v1/hf/orders/alter": { + "post": { + "summary": "Modify Order", + "deprecated": false, + "description": "This interface can modify the price and quantity of the order according to orderId or clientOid. The implementation of this interface is: cancel the order and place a new order on the same trading pair, and return the modification result to the client synchronously When the quantity of the new order updated by the user is less than the filled quantity of this order, the order will be considered as completed, and the order will be cancelled, and no new order will be placed", "tags": [], - "parameters": [ - { - "name": "orderId", - "in": "path", - "description": "The unique order id generated by the trading system", - "required": true, - "schema": { - "type": "string" - } - } - ], + "parameters": [], "responses": { "200": { "description": "", @@ -2197,16 +2669,18 @@ "data": { "type": "object", "properties": { - "cancelledOrderIds": { - "type": "array", - "items": { - "type": "string" - }, - "description": "List of two order IDs related to the canceled OCO order" + "newOrderId": { + "type": "string", + "description": "The new order id" + }, + "clientOid": { + "type": "string", + "description": "The original client order id" } }, "required": [ - "cancelledOrderIds" + "newOrderId", + "clientOid" ] } }, @@ -2219,131 +2693,62 @@ } } }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470354", - "x-abandon": "abandon", + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470171", + "x-abandon": "normal", "x-domain": "Spot", "x-api-channel": "Private", "x-api-permission": "Spot", "x-api-rate-limit-pool": "Spot", "x-sdk-service": "Spot", "x-sdk-sub-service": "Order", - "x-sdk-method-name": "cancelOcoOrderByOrderId", - "x-sdk-method-description": "This endpoint can be used to cancel a spot order by orderId. This endpoint only sends cancellation requests. The results of the requests must be obtained by checking the order status or subscribing to websocket.", + "x-sdk-method-name": "modifyOrder", + "x-sdk-method-description": "This interface can modify the price and quantity of the order according to orderId or clientOid. The implementation of this interface is: cancel the order and place a new order on the same trading pair, and return the modification result to the client synchronously When the quantity of the new order updated by the user is less than the filled quantity of this order, the order will be considered as completed, and the order will be cancelled, and no new order will be placed", "x-api-rate-limit": 3, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"cancelledOrderIds\\\": [\\n \\\"vs93gpqc6kkmkk57003gok16\\\",\\n \\\"vs93gpqc6kkmkk57003gok17\\\"\\n ]\\n }\\n}", - "x-request-example": "{\\\"orderId\\\": \\\"674c316e688dea0007c7b986\\\"}" - }, - "get": { - "summary": "Get OCO Order By OrderId", - "deprecated": true, - "description": "Request via this interface to get a oco order information via the order ID.", - "tags": [], - "parameters": [ - { - "name": "orderId", - "in": "path", - "description": "The unique order id generated by the trading system", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "data": { - "type": "object", - "properties": { - "symbol": { - "type": "string", - "description": "symbol" - }, - "clientOid": { - "type": "string", - "description": "Client Order Id" - }, - "orderId": { - "type": "string", - "description": "The unique order id generated by the trading system,which can be used later for further actions such as canceling the order." - }, - "orderTime": { - "type": "integer", - "description": "Order placement time, milliseconds", - "format": "int64" - }, - "status": { - "type": "string", - "description": "Order status: NEW: New, DONE: Completed, TRIGGERED: Triggered, CANCELLED: Cancelled", - "enum": [ - "NEW", - "DONE", - "TRIGGERED", - "CANCELLED" - ], - "x-api-enum": [ - { - "value": "NEW", - "name": "NEW", - "description": "New" - }, - { - "value": "DONE", - "name": "DONE", - "description": "Completed" - }, - { - "value": "TRIGGERED", - "name": "TRIGGERED", - "description": "Triggered" - }, - { - "value": "CANCELLED", - "name": "CANCELLED", - "description": "Cancelled" - } - ] - } - }, - "required": [ - "orderId", - "symbol", - "clientOid", - "orderTime", - "status" - ] - } + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "clientOid": { + "type": "string", + "description": "The old client order id,orderId and clientOid must choose one", + "example": [ + "5c52e11203aa677f33e493fb" + ] }, - "required": [ - "code", - "data" - ] - } - } + "symbol": { + "type": "string", + "description": "symbol", + "example": [ + "BTC-USDT", + "ETH-USDT", + "KCS-USDT" + ] + }, + "orderId": { + "type": "string", + "description": "The old order id, orderId and clientOid must choose one" + }, + "newPrice": { + "type": "string", + "description": "The modified price of the new order, newPrice and newSize must choose one" + }, + "newSize": { + "type": "string", + "description": "The modified size of the new order, newPrice and newSize must choose one" + } + }, + "required": [ + "symbol" + ] + }, + "example": "{\n \"symbol\": \"BTC-USDT\",\n \"orderId\": \"670fd33bf9406e0007ab3945\",\n \"newPrice\": \"30000\",\n \"newSize\": \"0.0001\"\n}" } } }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470357", - "x-abandon": "abandon", - "x-domain": "Spot", - "x-api-channel": "Private", - "x-api-permission": "General", - "x-api-rate-limit-pool": "Spot", - "x-sdk-service": "Spot", - "x-sdk-sub-service": "Order", - "x-sdk-method-name": "getOcoOrderByOrderId", - "x-sdk-method-description": "Request via this interface to get a oco order information via the order ID.", - "x-api-rate-limit": 2, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"orderId\\\": \\\"674c3b6e688dea0007c7bab2\\\",\\n \\\"symbol\\\": \\\"BTC-USDT\\\",\\n \\\"clientOid\\\": \\\"5c52e1203aa6f37f1e493fb\\\",\\n \\\"orderTime\\\": 1733049198863,\\n \\\"status\\\": \\\"NEW\\\"\\n }\\n}", - "x-request-example": "{\\\"orderId\\\": \\\"674c3b6e688dea0007c7bab2\\\"}" + "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"newOrderId\\\":\\\"67112258f9406e0007408827\\\",\\\"clientOid\\\":\\\"client order id 12\\\"}}", + "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"orderId\\\": \\\"670fd33bf9406e0007ab3945\\\", \\\"newPrice\\\": \\\"30000\\\", \\\"newSize\\\": \\\"0.0001\\\"}" } }, "/api/v1/hf/orders/active/symbols": { @@ -2710,32 +3115,139 @@ "data" ] } - } + } + } + } + }, + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470178", + "x-abandon": "normal", + "x-domain": "Spot", + "x-api-channel": "Private", + "x-api-permission": "General", + "x-api-rate-limit-pool": "Spot", + "x-sdk-service": "Spot", + "x-sdk-sub-service": "Order", + "x-sdk-method-name": "getOpenOrders", + "x-sdk-method-description": "This interface is to obtain all Spot active order lists, and the return value of the active order interface is the paged data of all uncompleted order lists. The returned data is sorted in descending order according to the latest update time of the order. After the user successfully places an order, the order is in Active state, and the user can use inOrderBook to determine whether the order has entered the order. Canceled or fully filled orders are marked as completed Done status.", + "x-api-rate-limit": 2, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": [\\n {\\n \\\"id\\\": \\\"67120bbef094e200070976f6\\\",\\n \\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\",\\n \\\"symbol\\\": \\\"BTC-USDT\\\",\\n \\\"opType\\\": \\\"DEAL\\\",\\n \\\"type\\\": \\\"limit\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"price\\\": \\\"50000\\\",\\n \\\"size\\\": \\\"0.00001\\\",\\n \\\"funds\\\": \\\"0.5\\\",\\n \\\"dealSize\\\": \\\"0\\\",\\n \\\"dealFunds\\\": \\\"0\\\",\\n \\\"fee\\\": \\\"0\\\",\\n \\\"feeCurrency\\\": \\\"USDT\\\",\\n \\\"stp\\\": null,\\n \\\"timeInForce\\\": \\\"GTC\\\",\\n \\\"postOnly\\\": false,\\n \\\"hidden\\\": false,\\n \\\"iceberg\\\": false,\\n \\\"visibleSize\\\": \\\"0\\\",\\n \\\"cancelAfter\\\": 0,\\n \\\"channel\\\": \\\"API\\\",\\n \\\"remark\\\": \\\"order remarks\\\",\\n \\\"tags\\\": \\\"order tags\\\",\\n \\\"cancelExist\\\": false,\\n \\\"tradeType\\\": \\\"TRADE\\\",\\n \\\"inOrderBook\\\": true,\\n \\\"cancelledSize\\\": \\\"0\\\",\\n \\\"cancelledFunds\\\": \\\"0\\\",\\n \\\"remainSize\\\": \\\"0.00001\\\",\\n \\\"remainFunds\\\": \\\"0.5\\\",\\n \\\"tax\\\": \\\"0\\\",\\n \\\"active\\\": true,\\n \\\"createdAt\\\": 1729235902748,\\n \\\"lastUpdatedAt\\\": 1729235909862\\n }\\n ]\\n}", + "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\"}" + } + }, + "/api/v1/hf/orders/done": { + "get": { + "summary": "Get Closed Orders", + "deprecated": false, + "description": "This interface is to obtain all Spot closed order lists, and the return value of the active order interface is the paged data of all uncompleted order lists. The returned data is sorted in descending order according to the latest update time of the order. After the user successfully places an order, the order is in Active state, and the user can use inOrderBook to determine whether the order has entered the order. Canceled or fully filled orders are marked as completed Done status.", + "tags": [], + "parameters": [ + { + "name": "symbol", + "in": "query", + "description": "symbol", + "required": true, + "schema": { + "type": "string", + "example": [ + "BTC-USDT", + "ETH-USDT", + "KCS-USDT" + ] + } + }, + { + "name": "side", + "in": "query", + "description": "specify if the order is to 'buy' or 'sell'", + "required": false, + "schema": { + "type": "string", + "enum": [ + "buy", + "sell" + ], + "x-api-enum": [ + { + "value": "buy", + "name": "", + "description": "" + }, + { + "value": "sell", + "name": "", + "description": "" + } + ] + } + }, + { + "name": "type", + "in": "query", + "description": "specify if the order is an 'limit' order or 'market' order. ", + "required": false, + "schema": { + "type": "string", + "enum": [ + "limit", + "market" + ], + "x-api-enum": [ + { + "value": "limit", + "name": "", + "description": "" + }, + { + "value": "market", + "name": "", + "description": "" + } + ] + } + }, + { + "name": "lastId", + "in": "query", + "description": "The id of the last set of data from the previous batch of data. By default, the latest information is given.\nlastId is used to filter data and paginate. If lastId is not entered, the default is a maximum of 100 returned data items. The return results include lastId,which can be used as a query parameter to look up new data from the next page.", + "required": false, + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "limit", + "in": "query", + "description": "Default20,Max100", + "required": false, + "schema": { + "type": "integer", + "default": 20, + "minimum": 1, + "maximum": 100 + } + }, + { + "name": "startAt", + "in": "query", + "description": "Start time (milisecond)", + "required": false, + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "endAt", + "in": "query", + "description": "End time (milisecond)", + "required": false, + "schema": { + "type": "integer", + "format": "int64" } } - }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470178", - "x-abandon": "normal", - "x-domain": "Spot", - "x-api-channel": "Private", - "x-api-permission": "General", - "x-api-rate-limit-pool": "Spot", - "x-sdk-service": "Spot", - "x-sdk-sub-service": "Order", - "x-sdk-method-name": "getOpenOrders", - "x-sdk-method-description": "This interface is to obtain all Spot active order lists, and the return value of the active order interface is the paged data of all uncompleted order lists. The returned data is sorted in descending order according to the latest update time of the order. After the user successfully places an order, the order is in Active state, and the user can use inOrderBook to determine whether the order has entered the order. Canceled or fully filled orders are marked as completed Done status.", - "x-api-rate-limit": 2, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": [\\n {\\n \\\"id\\\": \\\"67120bbef094e200070976f6\\\",\\n \\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\",\\n \\\"symbol\\\": \\\"BTC-USDT\\\",\\n \\\"opType\\\": \\\"DEAL\\\",\\n \\\"type\\\": \\\"limit\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"price\\\": \\\"50000\\\",\\n \\\"size\\\": \\\"0.00001\\\",\\n \\\"funds\\\": \\\"0.5\\\",\\n \\\"dealSize\\\": \\\"0\\\",\\n \\\"dealFunds\\\": \\\"0\\\",\\n \\\"fee\\\": \\\"0\\\",\\n \\\"feeCurrency\\\": \\\"USDT\\\",\\n \\\"stp\\\": null,\\n \\\"timeInForce\\\": \\\"GTC\\\",\\n \\\"postOnly\\\": false,\\n \\\"hidden\\\": false,\\n \\\"iceberg\\\": false,\\n \\\"visibleSize\\\": \\\"0\\\",\\n \\\"cancelAfter\\\": 0,\\n \\\"channel\\\": \\\"API\\\",\\n \\\"remark\\\": \\\"order remarks\\\",\\n \\\"tags\\\": \\\"order tags\\\",\\n \\\"cancelExist\\\": false,\\n \\\"tradeType\\\": \\\"TRADE\\\",\\n \\\"inOrderBook\\\": true,\\n \\\"cancelledSize\\\": \\\"0\\\",\\n \\\"cancelledFunds\\\": \\\"0\\\",\\n \\\"remainSize\\\": \\\"0.00001\\\",\\n \\\"remainFunds\\\": \\\"0.5\\\",\\n \\\"tax\\\": \\\"0\\\",\\n \\\"active\\\": true,\\n \\\"createdAt\\\": 1729235902748,\\n \\\"lastUpdatedAt\\\": 1729235909862\\n }\\n ]\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\"}" - } - }, - "/api/v1/stop-order": { - "get": { - "summary": "Get Stop Orders List", - "deprecated": false, - "description": "This interface is to obtain all Spot active stop order lists", - "tags": [], - "parameters": [], + ], "responses": { "200": { "description": "", @@ -2750,20 +3262,10 @@ "data": { "type": "object", "properties": { - "currentPage": { - "type": "integer", - "description": "current page id" - }, - "pageSize": { - "type": "integer" - }, - "totalNum": { - "type": "integer", - "description": "the stop order count" - }, - "totalPage": { + "lastId": { "type": "integer", - "description": "total page count of the list" + "description": "The id of the last set of data from the previous batch of data. By default, the latest information is given.\nlastId is used to filter data and paginate. If lastId is not entered, the default is a maximum of 100 returned data items. The return results include lastId,which can be used as a query parameter to look up new data from the next page.", + "format": "int64" }, "items": { "type": "array", @@ -2772,310 +3274,271 @@ "properties": { "id": { "type": "string", - "description": "Order ID, the ID of an order." + "description": "The unique order id generated by the trading system" }, "symbol": { "type": "string", - "description": "Symbol name" - }, - "userId": { - "type": "string", - "description": "User ID" + "description": "symbol", + "example": [ + "BTC-USDT", + "ETH-USDT", + "KCS-USDT" + ] }, - "status": { - "type": "string", - "description": "Order status, include NEW, TRIGGERED" + "opType": { + "type": "string" }, "type": { "type": "string", - "description": "Order type,limit, market, limit_stop or market_stop" + "description": "Specify if the order is an 'limit' order or 'market' order. ", + "enum": [ + "limit", + "market" + ], + "x-api-enum": [ + { + "value": "limit", + "name": "", + "description": "" + }, + { + "value": "market", + "name": "", + "description": "" + } + ] }, "side": { "type": "string", - "description": "transaction direction,include buy and sell" + "description": "Buy or sell", + "enum": [ + "buy", + "sell" + ], + "x-api-enum": [ + { + "value": "buy", + "name": "", + "description": "" + }, + { + "value": "sell", + "name": "", + "description": "" + } + ] }, "price": { "type": "string", - "description": "order price" + "description": "Order price" }, "size": { "type": "string", - "description": "order quantity" + "description": "Order size" }, "funds": { "type": "string", - "description": "order funds" + "description": "Order Funds" + }, + "dealSize": { + "type": "string", + "description": "Number of filled transactions" + }, + "dealFunds": { + "type": "string", + "description": "Funds of filled transactions" + }, + "fee": { + "type": "string", + "description": "[Handling fees](https://www.kucoin.com/docs-new/api-5327739)" + }, + "feeCurrency": { + "type": "string", + "description": "currency used to calculate trading fee" }, "stp": { - "type": "string" + "type": "string", + "description": "[Self Trade Prevention](https://www.kucoin.com/docs-new/api-5176570)", + "enum": [ + "DC", + "CO", + "CN", + "CB" + ], + "x-api-enum": [ + { + "value": "DC", + "name": "", + "description": "" + }, + { + "value": "CO", + "name": "", + "description": "" + }, + { + "value": "CN", + "name": "", + "description": "" + }, + { + "value": "CB", + "name": "", + "description": "" + } + ] }, "timeInForce": { "type": "string", - "description": "time InForce,include GTC,GTT,IOC,FOK" - }, - "cancelAfter": { - "type": "integer", - "description": "cancel orders after n seconds,requires timeInForce to be GTT" + "description": "Time in force", + "enum": [ + "GTC", + "GTT", + "IOC", + "FOK" + ], + "x-api-enum": [ + { + "value": "GTC", + "name": "", + "description": "" + }, + { + "value": "GTT", + "name": "", + "description": "" + }, + { + "value": "IOC", + "name": "", + "description": "" + }, + { + "value": "FOK", + "name": "", + "description": "" + } + ] }, "postOnly": { "type": "boolean", - "description": "postOnly" + "description": "Whether its a postOnly order." }, "hidden": { "type": "boolean", - "description": "hidden order" + "description": "Whether its a hidden order." }, "iceberg": { "type": "boolean", - "description": "Iceberg order" + "description": "Whether its a iceberg order." }, "visibleSize": { "type": "string", - "description": "displayed quantity for iceberg order" + "description": "Visible size of iceberg order in order book." + }, + "cancelAfter": { + "type": "integer", + "description": "A GTT timeInForce that expires in n seconds" }, "channel": { - "type": "string", - "description": "order source" + "type": "string" }, "clientOid": { "type": "string", - "description": "user-entered order unique mark" + "description": "Client Order Id,unique identifier created by the user" }, "remark": { "type": "string", - "description": "Remarks at stop order creation" + "description": "Order placement remarks" }, "tags": { "type": "string", - "description": "tag order source" + "description": "Order tag" }, - "orderTime": { + "cancelExist": { + "type": "boolean", + "description": "Whether there is a cancellation record for the order." + }, + "createdAt": { "type": "integer", - "description": "Time of place a stop order, accurate to nanoseconds", "format": "int64" }, - "domainId": { - "type": "string", - "description": "domainId, e.g: kucoin" - }, - "tradeSource": { - "type": "string", - "description": "trade source: USER(Order by user), MARGIN_SYSTEM(Order by margin system)" + "lastUpdatedAt": { + "type": "integer", + "format": "int64" }, "tradeType": { "type": "string", - "description": "The type of trading : TRADE(Spot), MARGIN_TRADE (Cross Margin), MARGIN_ISOLATED_TRADE (Isolated Margin)." + "description": "Trade type, redundancy param" }, - "feeCurrency": { - "type": "string", - "description": "The currency of the fee" + "inOrderBook": { + "type": "boolean", + "description": "Whether to enter the orderbook: true: enter the orderbook; false: not enter the orderbook" }, - "takerFeeRate": { + "cancelledSize": { "type": "string", - "description": "Fee Rate of taker" + "description": "Number of canceled transactions" }, - "makerFeeRate": { + "cancelledFunds": { "type": "string", - "description": "Fee Rate of maker" - }, - "createdAt": { - "type": "integer", - "description": "order creation time", - "format": "int64" + "description": "Funds of canceled transactions" }, - "stop": { + "remainSize": { "type": "string", - "description": "Stop order type, include loss and entry" - }, - "stopTriggerTime": { - "type": "integer", - "description": "The trigger time of the stop order", - "format": "int64" + "description": "Number of remain transactions" }, - "stopPrice": { - "type": "string", - "description": "stop price" - } - } - }, - "description": "the list of stop orders" - } - } - } - }, - "required": [ - "data" - ] - } - } - } - } - }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470338", - "x-abandon": "normal", - "x-domain": "Spot", - "x-api-channel": "Private", - "x-api-permission": "General", - "x-api-rate-limit-pool": "Spot", - "x-sdk-service": "Spot", - "x-sdk-sub-service": "Order", - "x-sdk-method-name": "getStopOrdersList", - "x-sdk-method-description": "This interface is to obtain all Spot active stop order lists", - "x-api-rate-limit": 8, - "x-request-force-json": true, - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "symbol": { - "type": "string", - "description": "Only list orders for a specific symbol" - }, - "side": { - "type": "string", - "enum": [ - "buy", - "sell" - ], - "description": "buy or sell", - "x-api-enum": [ - { - "value": "buy", - "name": "buy", - "description": "" - }, - { - "value": "sell", - "name": "sell", - "description": "" - } - ] - }, - "type": { - "type": "string", - "description": "limit, market, limit_stop or market_stop", - "enum": [ - "limit", - "market", - "limit_stop", - "market_stop" - ], - "x-api-enum": [ - { - "value": "limit", - "name": "limit", - "description": "" - }, - { - "value": "market", - "name": "market", - "description": "" - }, - { - "value": "limit_stop", - "name": "limit_stop", - "description": "" - }, - { - "value": "market_stop", - "name": "market_stop", - "description": "" - } - ] - }, - "tradeType": { - "type": "string", - "description": "The type of trading : TRADE(Spot), MARGIN_TRADE (Cross Margin), MARGIN_ISOLATED_TRADE (Isolated Margin). Default is TRADE", - "enum": [ - "TRADE", - "MARGIN_TRADE", - "MARGIN_ISOLATED_TRADE" - ], - "x-api-enum": [ - { - "value": "TRADE", - "name": "TRADE", - "description": "" - }, - { - "value": "MARGIN_TRADE", - "name": "MARGIN_TRADE", - "description": "" - }, - { - "value": "MARGIN_ISOLATED_TRADE", - "name": "MARGIN_ISOLATED_TRADE", - "description": "" - } - ] - }, - "startAt": { - "type": "number", - "description": "Start time (milisecond)" - }, - "endAt": { - "type": "number", - "description": "End time (milisecond)" - }, - "currentPage": { - "type": "integer", - "description": "current page" - }, - "orderIds": { - "type": "string", - "description": "comma seperated order ID list" - }, - "pageSize": { - "type": "integer", - "description": "page size" - }, - "stop": { - "type": "string", - "description": "Order type: stop: stop loss order, oco: oco order" - } - } - }, - "example": "{\n \"symbol\": \"BTC-USDT\",\n \"orderId\": \"670fd33bf9406e0007ab3945\",\n \"newPrice\": \"30000\",\n \"newSize\": \"0.0001\"\n}" - } - } - }, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"currentPage\\\": 1,\\n \\\"pageSize\\\": 50,\\n \\\"totalNum\\\": 1,\\n \\\"totalPage\\\": 1,\\n \\\"items\\\": [\\n {\\n \\\"id\\\": \\\"vs8hoo8kqjnklv4m0038lrfq\\\",\\n \\\"symbol\\\": \\\"KCS-USDT\\\",\\n \\\"userId\\\": \\\"60fe4956c43cbc0006562c2c\\\",\\n \\\"status\\\": \\\"NEW\\\",\\n \\\"type\\\": \\\"limit\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"price\\\": \\\"0.01000000000000000000\\\",\\n \\\"size\\\": \\\"0.01000000000000000000\\\",\\n \\\"funds\\\": null,\\n \\\"stp\\\": null,\\n \\\"timeInForce\\\": \\\"GTC\\\",\\n \\\"cancelAfter\\\": -1,\\n \\\"postOnly\\\": false,\\n \\\"hidden\\\": false,\\n \\\"iceberg\\\": false,\\n \\\"visibleSize\\\": null,\\n \\\"channel\\\": \\\"API\\\",\\n \\\"clientOid\\\": \\\"404814a0fb4311eb9098acde48001122\\\",\\n \\\"remark\\\": null,\\n \\\"tags\\\": null,\\n \\\"orderTime\\\": 1628755183702150100,\\n \\\"domainId\\\": \\\"kucoin\\\",\\n \\\"tradeSource\\\": \\\"USER\\\",\\n \\\"tradeType\\\": \\\"TRADE\\\",\\n \\\"feeCurrency\\\": \\\"USDT\\\",\\n \\\"takerFeeRate\\\": \\\"0.00200000000000000000\\\",\\n \\\"makerFeeRate\\\": \\\"0.00200000000000000000\\\",\\n \\\"createdAt\\\": 1628755183704,\\n \\\"stop\\\": \\\"loss\\\",\\n \\\"stopTriggerTime\\\": null,\\n \\\"stopPrice\\\": \\\"10.00000000000000000000\\\"\\n }\\n ]\\n }\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"orderId\\\": \\\"670fd33bf9406e0007ab3945\\\", \\\"newPrice\\\": \\\"30000\\\", \\\"newSize\\\": \\\"0.0001\\\"}" - }, - "post": { - "summary": "Add Stop Order", - "deprecated": true, - "description": "Place stop order to the Spot trading system, you can place two major types of orders: limit and market. Orders can only be placed if your account has sufficient funds. Once an order is placed, your funds will be put on hold for the duration of the order. The amount of funds on hold depends on the order type and parameters specified.", - "tags": [], - "parameters": [], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "data": { - "type": "object", - "properties": { - "orderId": { - "type": "string", - "description": "The unique order id generated by the trading system,which can be used later for further actions such as canceling the order." - }, - "clientOid": { - "type": "string", - "description": "The user self-defined order id." + "remainFunds": { + "type": "string", + "description": "Funds of remain transactions" + }, + "tax": { + "type": "string", + "description": "Users in some regions need query this field" + }, + "active": { + "type": "boolean", + "description": "Order status: true-The status of the order isactive; false-The status of the order is done" + } + }, + "required": [ + "feeCurrency", + "id", + "symbol", + "opType", + "type", + "side", + "price", + "size", + "funds", + "dealSize", + "fee", + "timeInForce", + "dealFunds", + "clientOid", + "remainSize", + "remainFunds", + "cancelledSize", + "cancelledFunds", + "lastUpdatedAt", + "createdAt", + "tax", + "active", + "cancelExist", + "tradeType", + "inOrderBook", + "postOnly", + "hidden", + "iceberg", + "visibleSize", + "cancelAfter", + "channel" + ] + } } }, "required": [ - "orderId", - "clientOid" + "lastId", + "items" ] } }, @@ -3088,219 +3551,26 @@ } } }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470334", - "x-abandon": "abandon", + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470179", + "x-abandon": "normal", "x-domain": "Spot", "x-api-channel": "Private", - "x-api-permission": "Spot", + "x-api-permission": "General", "x-api-rate-limit-pool": "Spot", "x-sdk-service": "Spot", "x-sdk-sub-service": "Order", - "x-sdk-method-name": "addStopOrder", - "x-sdk-method-description": "Place stop order to the Spot trading system, you can place two major types of orders: limit and market. Orders can only be placed if your account has sufficient funds. Once an order is placed, your funds will be put on hold for the duration of the order. The amount of funds on hold depends on the order type and parameters specified.", - "x-api-rate-limit": 1, - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "clientOid": { - "type": "string", - "description": "Client Order Id,The ClientOid field is a unique ID created by the user(we recommend using a UUID), and can only contain numbers, letters, underscores (_), and hyphens (-). This field is returned when order information is obtained. You can use clientOid to tag your orders. ClientOid is different from the order ID created by the service provider. Please do not initiate requests using the same clientOid. The maximum length for the ClientOid is 40 characters.\n\nPlease remember the orderId created by the service provider, it used to check for updates in order status.", - "example": [ - "5c52e11203aa677f33e493fb" - ] - }, - "side": { - "type": "string", - "description": "specify if the order is to 'buy' or 'sell'", - "enum": [ - "buy", - "sell" - ], - "x-api-enum": [ - { - "value": "buy", - "name": "", - "description": "" - }, - { - "value": "sell", - "name": "", - "description": "" - } - ], - "example": [ - "buy" - ] - }, - "symbol": { - "type": "string", - "description": "symbol", - "example": [ - "BTC-USDT", - "ETH-USDT", - "KCS-USDT" - ] - }, - "type": { - "type": "string", - "description": "specify if the order is an 'limit' order or 'market' order. \n\nThe type of order you specify when you place your order determines whether or not you need to request other parameters and also affects the execution of the matching engine.\n\nWhen placing a limit order, you must specify a price and size. The system will try to match the order according to market price or a price better than market price. If the order cannot be immediately matched, it will stay in the order book until it is matched or the user cancels.\n\nUnlike limit orders, the price for market orders fluctuates with market prices. When placing a market order, you do not need to specify a price, you only need to specify a quantity. Market orders are filled immediately and will not enter the order book. All market orders are takers and a taker fee will be charged.", - "enum": [ - "limit", - "market" - ], - "x-api-enum": [ - { - "value": "limit", - "name": "", - "description": "" - }, - { - "value": "market", - "name": "", - "description": "" - } - ], - "example": [ - "limit" - ] - }, - "remark": { - "type": "string", - "description": "Order placement remarks, length cannot exceed 20 characters (ASCII)" - }, - "stp": { - "type": "string", - "description": "[Self Trade Prevention](https://www.kucoin.com/docs-new/doc-338146) is divided into four strategies: CN, CO, CB , and DC", - "enum": [ - "DC", - "CO", - "CN", - "CB" - ], - "x-api-enum": [ - { - "value": "DC", - "name": "", - "description": "" - }, - { - "value": "CO", - "name": "", - "description": "" - }, - { - "value": "CN", - "name": "", - "description": "" - }, - { - "value": "CB", - "name": "", - "description": "" - } - ] - }, - "price": { - "type": "string", - "description": "Specify price for order, not need for market order.\n\nWhen placing a limit order, the price must be based on priceIncrement for the trading pair. The price increment (priceIncrement) is the price precision for the trading pair. For example, for the BTC-USDT trading pair, the priceIncrement is 0.00001000. So the price for your orders cannot be less than 0.00001000 and must be a multiple of priceIncrement. Otherwise, the order will return an invalid priceIncrement error." - }, - "size": { - "type": "string", - "description": "Specify quantity for order\n\nWhen **type** is limit, size refers to the amount of trading targets (the asset name written in front) for the trading pair. Teh Size must be based on the baseIncrement of the trading pair. The baseIncrement represents the precision for the trading pair. The size of an order must be a positive-integer multiple of baseIncrement and must be between baseMinSize and baseMaxSize.\n\nWhen **type** is market, select one out of two: size or funds" - }, - "timeInForce": { - "type": "string", - "description": "[Time in force](https://www.kucoin.com/docs-new/doc-338146) is a special strategy used during trading. Required for limit orders.", - "enum": [ - "GTC", - "GTT", - "IOC", - "FOK" - ], - "default": "GTC", - "x-api-enum": [ - { - "value": "GTC", - "name": "", - "description": "" - }, - { - "value": "GTT", - "name": "", - "description": "" - }, - { - "value": "IOC", - "name": "", - "description": "" - }, - { - "value": "FOK", - "name": "", - "description": "" - } - ] - }, - "postOnly": { - "type": "boolean", - "description": "passive order labels, this is disabled when the order timing strategy is IOC or FOK if **type** is limit.", - "default": false - }, - "hidden": { - "type": "boolean", - "description": "[Hidden order](https://www.kucoin.com/docs-new/doc-338146) or not (not shown in order book)", - "default": false - }, - "iceberg": { - "type": "boolean", - "description": "Whether or not only visible portions of orders are shown in [Iceberg orders](https://www.kucoin.com/docs-new/doc-338146)", - "default": false - }, - "visibleSize": { - "type": "string", - "description": "When **type** is limit, this is Maximum visible quantity in iceberg orders." - }, - "cancelAfter": { - "type": "integer", - "description": "Cancel after n seconds,the order timing strategy is GTT when **type** is limit.", - "format": "int64" - }, - "funds": { - "type": "string", - "description": "When **type** is market, select one out of two: size or funds" - }, - "stopPrice": { - "type": "string", - "description": "The trigger price." - }, - "tradeType": { - "type": "string", - "description": "The type of trading : TRADE(Spot), MARGIN_TRADE (Cross Margin), MARGIN_ISOLATED_TRADE (Isolated Margin). Default is TRADE" - } - }, - "required": [ - "symbol", - "type", - "side", - "stopPrice" - ] - }, - "example": "//limit order\n{\n \"type\": \"limit\",\n \"symbol\": \"BTC-USDT\",\n \"side\": \"buy\",\n \"price\": \"50000\",\n \"size\": \"0.00001\",\n \"clientOid\": \"5c52e11203aa677f33e493fb\",\n \"remark\": \"order remarks\"\n}\n\n//market order 1\n// {\n// \"type\": \"market\",\n// \"symbol\": \"BTC-USDT\",\n// \"side\": \"buy\",\n// \"size\": \"0.00001\",\n// \"clientOid\": \"5c52e11203aa677f33e493fc\",\n// \"remark\": \"order remarks\"\n// }\n\n//market order 2\n// {\n// \"type\": \"market\",\n// \"symbol\": \"BTC-USDT\",\n// \"side\": \"buy\",\n// \"funds\": \"1\",\n// \"clientOid\": \"5c52e11203aa677f33e493fc\",\n// \"remark\": \"order remarks\"\n// }\n" - } - } - }, - "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"orderId\\\":\\\"670fd33bf9406e0007ab3945\\\",\\\"clientOid\\\":\\\"5c52e11203aa677f33e493fb\\\"}}", - "x-request-example": "{\\\"type\\\": \\\"limit\\\", \\\"symbol\\\": \\\"BTC-USDT\\\", \\\"side\\\": \\\"buy\\\", \\\"price\\\": \\\"50000\\\", \\\"size\\\": \\\"0.00001\\\", \\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\", \\\"remark\\\": \\\"order remarks\\\"}" + "x-sdk-method-name": "getClosedOrders", + "x-sdk-method-description": "This interface is to obtain all Spot closed order lists, and the return value of the active order interface is the paged data of all uncompleted order lists. The returned data is sorted in descending order according to the latest update time of the order. After the user successfully places an order, the order is in Active state, and the user can use inOrderBook to determine whether the order has entered the order. Canceled or fully filled orders are marked as completed Done status.", + "x-api-rate-limit": 2, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"lastId\\\": 19814995255305,\\n \\\"items\\\": [\\n {\\n \\\"id\\\": \\\"6717422bd51c29000775ea03\\\",\\n \\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\",\\n \\\"symbol\\\": \\\"BTC-USDT\\\",\\n \\\"opType\\\": \\\"DEAL\\\",\\n \\\"type\\\": \\\"limit\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"price\\\": \\\"70000\\\",\\n \\\"size\\\": \\\"0.00001\\\",\\n \\\"funds\\\": \\\"0.7\\\",\\n \\\"dealSize\\\": \\\"0.00001\\\",\\n \\\"dealFunds\\\": \\\"0.677176\\\",\\n \\\"remainSize\\\": \\\"0\\\",\\n \\\"remainFunds\\\": \\\"0.022824\\\",\\n \\\"cancelledSize\\\": \\\"0\\\",\\n \\\"cancelledFunds\\\": \\\"0\\\",\\n \\\"fee\\\": \\\"0.000677176\\\",\\n \\\"feeCurrency\\\": \\\"USDT\\\",\\n \\\"stp\\\": null,\\n \\\"timeInForce\\\": \\\"GTC\\\",\\n \\\"postOnly\\\": false,\\n \\\"hidden\\\": false,\\n \\\"iceberg\\\": false,\\n \\\"visibleSize\\\": \\\"0\\\",\\n \\\"cancelAfter\\\": 0,\\n \\\"channel\\\": \\\"API\\\",\\n \\\"remark\\\": \\\"order remarks\\\",\\n \\\"tags\\\": null,\\n \\\"cancelExist\\\": false,\\n \\\"tradeType\\\": \\\"TRADE\\\",\\n \\\"inOrderBook\\\": false,\\n \\\"active\\\": false,\\n \\\"tax\\\": \\\"0\\\",\\n \\\"createdAt\\\": 1729577515444,\\n \\\"lastUpdatedAt\\\": 1729577515481\\n }\\n ]\\n }\\n}", + "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"side\\\": \\\"buy\\\", \\\"type\\\": \\\"limit\\\", \\\"lastId\\\": 254062248624417, \\\"limit\\\": 20, \\\"startAt\\\": 1728663338000, \\\"endAt\\\": 1728692138000}" } }, - "/api/v1/hf/orders/done": { + "/api/v1/hf/fills": { "get": { - "summary": "Get Closed Orders", + "summary": "Get Trade History", "deprecated": false, - "description": "This interface is to obtain all Spot closed order lists, and the return value of the active order interface is the paged data of all uncompleted order lists. The returned data is sorted in descending order according to the latest update time of the order. After the user successfully places an order, the order is in Active state, and the user can use inOrderBook to determine whether the order has entered the order. Canceled or fully filled orders are marked as completed Done status.", + "description": "This endpoint can be used to obtain a list of the latest Spot transaction details. The returned data is sorted in descending order according to the latest update time of the order.", "tags": [], "parameters": [ { @@ -3317,6 +3587,15 @@ ] } }, + { + "name": "orderId", + "in": "query", + "description": "The unique order id generated by the trading system\n(If orderId is specified,please ignore the other query parameters)", + "required": false, + "schema": { + "type": "string" + } + }, { "name": "side", "in": "query", @@ -3424,19 +3703,15 @@ "data": { "type": "object", "properties": { - "lastId": { - "type": "integer", - "description": "The id of the last set of data from the previous batch of data. By default, the latest information is given.\nlastId is used to filter data and paginate. If lastId is not entered, the default is a maximum of 100 returned data items. The return results include lastId,which can be used as a query parameter to look up new data from the next page.", - "format": "int64" - }, "items": { "type": "array", "items": { "type": "object", "properties": { "id": { - "type": "string", - "description": "The unique order id generated by the trading system" + "type": "integer", + "description": "Id of transaction detail", + "format": "int64" }, "symbol": { "type": "string", @@ -3447,49 +3722,62 @@ "KCS-USDT" ] }, - "opType": { - "type": "string" + "tradeId": { + "type": "integer", + "description": "Trade Id, symbol latitude increment", + "format": "int64" }, - "type": { + "orderId": { "type": "string", - "description": "Specify if the order is an 'limit' order or 'market' order. ", + "description": "The unique order id generated by the trading system" + }, + "counterOrderId": { + "type": "string", + "description": "Counterparty order Id" + }, + "side": { + "type": "string", + "description": "Buy or sell", "enum": [ - "limit", - "market" + "buy", + "sell" ], "x-api-enum": [ { - "value": "limit", + "value": "buy", "name": "", "description": "" }, { - "value": "market", + "value": "sell", "name": "", "description": "" } ] }, - "side": { + "liquidity": { "type": "string", - "description": "Buy or sell", + "description": "Liquidity type: taker or maker", "enum": [ - "buy", - "sell" + "taker", + "maker" ], "x-api-enum": [ { - "value": "buy", + "value": "taker", "name": "", "description": "" }, { - "value": "sell", + "value": "maker", "name": "", "description": "" } ] }, + "forceTaker": { + "type": "boolean" + }, "price": { "type": "string", "description": "Order price" @@ -3502,205 +3790,92 @@ "type": "string", "description": "Order Funds" }, - "dealSize": { - "type": "string", - "description": "Number of filled transactions" - }, - "dealFunds": { - "type": "string", - "description": "Funds of filled transactions" - }, "fee": { "type": "string", "description": "[Handling fees](https://www.kucoin.com/docs-new/api-5327739)" }, + "feeRate": { + "type": "string", + "description": "Fee rate\n" + }, "feeCurrency": { "type": "string", "description": "currency used to calculate trading fee" }, - "stp": { + "stop": { "type": "string", - "description": "[Self Trade Prevention](https://www.kucoin.com/docs-new/api-5176570)", - "enum": [ - "DC", - "CO", - "CN", - "CB" - ], - "x-api-enum": [ - { - "value": "DC", - "name": "", - "description": "" - }, - { - "value": "CO", - "name": "", - "description": "" - }, - { - "value": "CN", - "name": "", - "description": "" - }, - { - "value": "CB", - "name": "", - "description": "" - } - ] + "description": "Take Profit and Stop Loss type, currently HFT does not support the Take Profit and Stop Loss type, so it is empty" }, - "timeInForce": { + "tradeType": { "type": "string", - "description": "Time in force", + "description": "Trade type, redundancy param" + }, + "taxRate": { + "type": "string", + "description": "Tax Rate, Users in some regions need query this field" + }, + "tax": { + "type": "string", + "description": "Users in some regions need query this field" + }, + "type": { + "type": "string", + "description": "Specify if the order is an 'limit' order or 'market' order. ", "enum": [ - "GTC", - "GTT", - "IOC", - "FOK" + "limit", + "market" ], "x-api-enum": [ { - "value": "GTC", - "name": "", - "description": "" - }, - { - "value": "GTT", - "name": "", - "description": "" - }, - { - "value": "IOC", + "value": "limit", "name": "", "description": "" }, { - "value": "FOK", + "value": "market", "name": "", "description": "" } ] }, - "postOnly": { - "type": "boolean", - "description": "Whether its a postOnly order." - }, - "hidden": { - "type": "boolean", - "description": "Whether its a hidden order." - }, - "iceberg": { - "type": "boolean", - "description": "Whether its a iceberg order." - }, - "visibleSize": { - "type": "string", - "description": "Visible size of iceberg order in order book." - }, - "cancelAfter": { - "type": "integer", - "description": "A GTT timeInForce that expires in n seconds" - }, - "channel": { - "type": "string" - }, - "clientOid": { - "type": "string", - "description": "Client Order Id,unique identifier created by the user" - }, - "remark": { - "type": "string", - "description": "Order placement remarks" - }, - "tags": { - "type": "string", - "description": "Order tag" - }, - "cancelExist": { - "type": "boolean", - "description": "Whether there is a cancellation record for the order." - }, "createdAt": { "type": "integer", "format": "int64" - }, - "lastUpdatedAt": { - "type": "integer", - "format": "int64" - }, - "tradeType": { - "type": "string", - "description": "Trade type, redundancy param" - }, - "inOrderBook": { - "type": "boolean", - "description": "Whether to enter the orderbook: true: enter the orderbook; false: not enter the orderbook" - }, - "cancelledSize": { - "type": "string", - "description": "Number of canceled transactions" - }, - "cancelledFunds": { - "type": "string", - "description": "Funds of canceled transactions" - }, - "remainSize": { - "type": "string", - "description": "Number of remain transactions" - }, - "remainFunds": { - "type": "string", - "description": "Funds of remain transactions" - }, - "tax": { - "type": "string", - "description": "Users in some regions need query this field" - }, - "active": { - "type": "boolean", - "description": "Order status: true-The status of the order isactive; false-The status of the order is done" } }, "required": [ - "feeCurrency", "id", "symbol", - "opType", - "type", + "tradeId", + "orderId", + "counterOrderId", "side", + "liquidity", + "forceTaker", "price", "size", "funds", - "dealSize", "fee", - "timeInForce", - "dealFunds", - "clientOid", - "remainSize", - "remainFunds", - "cancelledSize", - "cancelledFunds", - "lastUpdatedAt", - "createdAt", - "tax", - "active", - "cancelExist", - "tradeType", - "inOrderBook", - "postOnly", - "hidden", - "iceberg", - "visibleSize", - "cancelAfter", - "channel" + "feeRate", + "feeCurrency", + "stop", + "tradeType", + "taxRate", + "tax", + "type", + "createdAt" ] } + }, + "lastId": { + "type": "integer", + "description": "The id of the last set of data from the previous batch of data. By default, the latest information is given.\nlastId is used to filter data and paginate. If lastId is not entered, the default is a maximum of 100 returned data items. The return results include lastId,which can be used as a query parameter to look up new data from the next page.", + "format": "int64" } }, "required": [ - "lastId", - "items" + "items", + "lastId" ] } }, @@ -3713,7 +3888,7 @@ } } }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470179", + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470180", "x-abandon": "normal", "x-domain": "Spot", "x-api-channel": "Private", @@ -3721,39 +3896,20 @@ "x-api-rate-limit-pool": "Spot", "x-sdk-service": "Spot", "x-sdk-sub-service": "Order", - "x-sdk-method-name": "getClosedOrders", - "x-sdk-method-description": "This interface is to obtain all Spot closed order lists, and the return value of the active order interface is the paged data of all uncompleted order lists. The returned data is sorted in descending order according to the latest update time of the order. After the user successfully places an order, the order is in Active state, and the user can use inOrderBook to determine whether the order has entered the order. Canceled or fully filled orders are marked as completed Done status.", + "x-sdk-method-name": "getTradeHistory", + "x-sdk-method-description": "This endpoint can be used to obtain a list of the latest Spot transaction details. The returned data is sorted in descending order according to the latest update time of the order.", "x-api-rate-limit": 2, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"lastId\\\": 19814995255305,\\n \\\"items\\\": [\\n {\\n \\\"id\\\": \\\"6717422bd51c29000775ea03\\\",\\n \\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\",\\n \\\"symbol\\\": \\\"BTC-USDT\\\",\\n \\\"opType\\\": \\\"DEAL\\\",\\n \\\"type\\\": \\\"limit\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"price\\\": \\\"70000\\\",\\n \\\"size\\\": \\\"0.00001\\\",\\n \\\"funds\\\": \\\"0.7\\\",\\n \\\"dealSize\\\": \\\"0.00001\\\",\\n \\\"dealFunds\\\": \\\"0.677176\\\",\\n \\\"remainSize\\\": \\\"0\\\",\\n \\\"remainFunds\\\": \\\"0.022824\\\",\\n \\\"cancelledSize\\\": \\\"0\\\",\\n \\\"cancelledFunds\\\": \\\"0\\\",\\n \\\"fee\\\": \\\"0.000677176\\\",\\n \\\"feeCurrency\\\": \\\"USDT\\\",\\n \\\"stp\\\": null,\\n \\\"timeInForce\\\": \\\"GTC\\\",\\n \\\"postOnly\\\": false,\\n \\\"hidden\\\": false,\\n \\\"iceberg\\\": false,\\n \\\"visibleSize\\\": \\\"0\\\",\\n \\\"cancelAfter\\\": 0,\\n \\\"channel\\\": \\\"API\\\",\\n \\\"remark\\\": \\\"order remarks\\\",\\n \\\"tags\\\": null,\\n \\\"cancelExist\\\": false,\\n \\\"tradeType\\\": \\\"TRADE\\\",\\n \\\"inOrderBook\\\": false,\\n \\\"active\\\": false,\\n \\\"tax\\\": \\\"0\\\",\\n \\\"createdAt\\\": 1729577515444,\\n \\\"lastUpdatedAt\\\": 1729577515481\\n }\\n ]\\n }\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"side\\\": \\\"buy\\\", \\\"type\\\": \\\"limit\\\", \\\"lastId\\\": 254062248624417, \\\"limit\\\": 20, \\\"startAt\\\": 1728663338000, \\\"endAt\\\": 1728692138000}" + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"items\\\": [\\n {\\n \\\"id\\\": 19814995255305,\\n \\\"orderId\\\": \\\"6717422bd51c29000775ea03\\\",\\n \\\"counterOrderId\\\": \\\"67174228135f9e000709da8c\\\",\\n \\\"tradeId\\\": 11029373945659392,\\n \\\"symbol\\\": \\\"BTC-USDT\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"liquidity\\\": \\\"taker\\\",\\n \\\"type\\\": \\\"limit\\\",\\n \\\"forceTaker\\\": false,\\n \\\"price\\\": \\\"67717.6\\\",\\n \\\"size\\\": \\\"0.00001\\\",\\n \\\"funds\\\": \\\"0.677176\\\",\\n \\\"fee\\\": \\\"0.000677176\\\",\\n \\\"feeRate\\\": \\\"0.001\\\",\\n \\\"feeCurrency\\\": \\\"USDT\\\",\\n \\\"stop\\\": \\\"\\\",\\n \\\"tradeType\\\": \\\"TRADE\\\",\\n \\\"taxRate\\\": \\\"0\\\",\\n \\\"tax\\\": \\\"0\\\",\\n \\\"createdAt\\\": 1729577515473\\n }\\n ],\\n \\\"lastId\\\": 19814995255305\\n }\\n}", + "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"orderId\\\": \\\"example_string_default_value\\\", \\\"side\\\": \\\"buy\\\", \\\"type\\\": \\\"limit\\\", \\\"lastId\\\": 254062248624417, \\\"limit\\\": 100, \\\"startAt\\\": 1728663338000, \\\"endAt\\\": 1728692138000}" } }, - "/api/v1/stop-order/queryOrderByClientOid": { + "/api/v1/hf/orders/dead-cancel-all/query": { "get": { - "summary": "Get Stop Order By ClientOid", + "summary": "Get DCP", "deprecated": false, - "description": "This interface is to obtain Spot stop order details by orderId", + "description": "Get Disconnection Protect(Deadman Swich)Through this interface, you can query the settings of automatic order cancellation", "tags": [], - "parameters": [ - { - "name": "clientOid", - "in": "query", - "description": "The client order id", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "symbol", - "in": "query", - "description": "symbol name", - "required": false, - "schema": { - "type": "string" - } - } - ], + "parameters": [], "responses": { "200": { "description": "", @@ -3763,144 +3919,30 @@ "type": "object", "properties": { "code": { - "type": "string", - "description": "the return code" + "type": "string" }, "data": { - "type": "array", - "items": { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "Order ID, the ID of an order." - }, - "symbol": { - "type": "string", - "description": "Symbol name" - }, - "userId": { - "type": "string", - "description": "User ID" - }, - "status": { - "type": "string", - "description": "Order status, include NEW, TRIGGERED" - }, - "type": { - "type": "string", - "description": "Order type,limit, market, limit_stop or market_stop" - }, - "side": { - "type": "string", - "description": "transaction direction,include buy and sell" - }, - "price": { - "type": "string", - "description": "order price" - }, - "size": { - "type": "string", - "description": "order quantity" - }, - "funds": { - "type": "string", - "description": "order funds" - }, - "stp": { - "type": "string" - }, - "timeInForce": { - "type": "string", - "description": "time InForce,include GTC,GTT,IOC,FOK" - }, - "cancelAfter": { - "type": "integer", - "description": "cancel orders after n seconds,requires timeInForce to be GTT", - "format": "int64" - }, - "postOnly": { - "type": "boolean", - "description": "postOnly" - }, - "hidden": { - "type": "boolean", - "description": "hidden order" - }, - "iceberg": { - "type": "boolean", - "description": "Iceberg order" - }, - "visibleSize": { - "type": "string", - "description": "displayed quantity for iceberg order" - }, - "channel": { - "type": "string", - "description": "order source" - }, - "clientOid": { - "type": "string", - "description": "user-entered order unique mark" - }, - "remark": { - "type": "string", - "description": "Remarks at stop order creation" - }, - "tags": { - "type": "string", - "description": "tag order source" - }, - "domainId": { - "type": "string", - "description": "domainId, e.g: kucoin" - }, - "tradeSource": { - "type": "string", - "description": "trade source: USER(Order by user), MARGIN_SYSTEM(Order by margin system)" - }, - "tradeType": { - "type": "string", - "description": "The type of trading : TRADE(Spot), MARGIN_TRADE (Cross Margin), MARGIN_ISOLATED_TRADE (Isolated Margin)." - }, - "feeCurrency": { - "type": "string", - "description": "The currency of the fee" - }, - "takerFeeRate": { - "type": "string", - "description": "Fee Rate of taker" - }, - "makerFeeRate": { - "type": "string", - "description": "Fee Rate of maker" - }, - "createdAt": { - "type": "integer", - "description": "order creation time", - "format": "int64" - }, - "stop": { - "type": "string", - "description": "Stop order type, include loss and entry" - }, - "stopTriggerTime": { - "type": "integer", - "description": "The trigger time of the stop order", - "format": "int64" - }, - "stopPrice": { - "type": "string", - "description": "stop price" - }, - "orderTime": { - "type": "integer", - "description": "Time of place a stop order, accurate to nanoseconds", - "format": "int64" - } + "type": "object", + "properties": { + "timeout": { + "type": "integer", + "description": "Auto cancel order trigger setting time, the unit is second. range: timeout=-1 (meaning unset) or 5 <= timeout <= 86400" + }, + "symbols": { + "type": "string", + "description": "List of trading pairs. Separated by commas, empty means all trading pairs" + }, + "currentTime": { + "type": "integer", + "description": "System current time (in seconds)" + }, + "triggerTime": { + "type": "integer", + "description": "Trigger cancellation time (in seconds)" } }, - "description": "the return code" + "description": "If the data is empty, it means that DCP is not set.", + "additionalProperties": false } }, "required": [ @@ -3912,56 +3954,27 @@ } } }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470340", + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470172", "x-abandon": "normal", "x-domain": "Spot", "x-api-channel": "Private", - "x-api-permission": "General", + "x-api-permission": "Spot", "x-api-rate-limit-pool": "Spot", "x-sdk-service": "Spot", "x-sdk-sub-service": "Order", - "x-sdk-method-name": "getStopOrderByClientOid", - "x-sdk-method-description": "This interface is to obtain Spot stop order details by orderId", - "x-api-rate-limit": 3, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": [\\n {\\n \\\"id\\\": \\\"vs8hoo8os561f5np0032vngj\\\",\\n \\\"symbol\\\": \\\"KCS-USDT\\\",\\n \\\"userId\\\": \\\"60fe4956c43cbc0006562c2c\\\",\\n \\\"status\\\": \\\"NEW\\\",\\n \\\"type\\\": \\\"limit\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"price\\\": \\\"0.01000000000000000000\\\",\\n \\\"size\\\": \\\"0.01000000000000000000\\\",\\n \\\"funds\\\": null,\\n \\\"stp\\\": null,\\n \\\"timeInForce\\\": \\\"GTC\\\",\\n \\\"cancelAfter\\\": -1,\\n \\\"postOnly\\\": false,\\n \\\"hidden\\\": false,\\n \\\"iceberg\\\": false,\\n \\\"visibleSize\\\": null,\\n \\\"channel\\\": \\\"API\\\",\\n \\\"clientOid\\\": \\\"2b700942b5db41cebe578cff48960e09\\\",\\n \\\"remark\\\": null,\\n \\\"tags\\\": null,\\n \\\"orderTime\\\": 1629020492834532600,\\n \\\"domainId\\\": \\\"kucoin\\\",\\n \\\"tradeSource\\\": \\\"USER\\\",\\n \\\"tradeType\\\": \\\"TRADE\\\",\\n \\\"feeCurrency\\\": \\\"USDT\\\",\\n \\\"takerFeeRate\\\": \\\"0.00200000000000000000\\\",\\n \\\"makerFeeRate\\\": \\\"0.00200000000000000000\\\",\\n \\\"createdAt\\\": 1629020492837,\\n \\\"stop\\\": \\\"loss\\\",\\n \\\"stopTriggerTime\\\": null,\\n \\\"stopPrice\\\": \\\"1.00000000000000000000\\\"\\n }\\n ]\\n}", - "x-request-example": "{\\\"clientOid\\\": \\\"example_string_default_value\\\", \\\"symbol\\\": \\\"example_string_default_value\\\"}" + "x-sdk-method-name": "getDCP", + "x-sdk-method-description": "Get Disconnection Protect(Deadman Swich)Through this interface, you can query the settings of automatic order cancellation", + "x-api-rate-limit": 2, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"timeout\\\": 5,\\n \\\"symbols\\\": \\\"BTC-USDT,ETH-USDT\\\",\\n \\\"currentTime\\\": 1729241305,\\n \\\"triggerTime\\\": 1729241308\\n }\\n}" } }, - "/api/v1/stop-order/cancel": { - "delete": { - "summary": "Batch Cancel Stop Orders", + "/api/v1/hf/orders/dead-cancel-all": { + "post": { + "summary": "Set DCP", "deprecated": false, - "description": "This endpoint can be used to cancel a spot stop orders by batch.", + "description": "Set Disconnection Protect(Deadman Swich)Through this interface, Call this interface to automatically cancel all orders of the set trading pair after the specified time. If this interface is not called again for renewal or cancellation before the set time, the system will help the user to cancel the order of the corresponding trading pair. Otherwise it will not.", "tags": [], - "parameters": [ - { - "name": "symbol", - "in": "query", - "description": "Cancel the open order for the specified symbol", - "required": false, - "schema": { - "type": "string" - } - }, - { - "name": "tradeType", - "in": "query", - "description": "The type of trading : TRADE(Spot), MARGIN_TRADE (Cross Margin), MARGIN_ISOLATED_TRADE (Isolated Margin). Default is TRADE", - "required": false, - "schema": { - "type": "string" - } - }, - { - "name": "orderIds", - "in": "query", - "description": "Comma seperated order IDs.", - "required": false, - "schema": { - "type": "string" - } - } - ], + "parameters": [], "responses": { "200": { "description": "", @@ -3976,17 +3989,20 @@ "data": { "type": "object", "properties": { - "cancelledOrderIds": { - "type": "array", - "items": { - "type": "string" - }, - "description": "order id array" + "currentTime": { + "type": "integer", + "description": "System current time (in seconds)" + }, + "triggerTime": { + "type": "integer", + "description": "Trigger cancellation time (in seconds)" } }, "required": [ - "cancelledOrderIds" - ] + "currentTime", + "triggerTime" + ], + "description": "If the data is empty, it means that DCP is not set." } }, "required": [ @@ -3998,7 +4014,7 @@ } } }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470337", + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470173", "x-abandon": "normal", "x-domain": "Spot", "x-api-channel": "Private", @@ -4006,39 +4022,46 @@ "x-api-rate-limit-pool": "Spot", "x-sdk-service": "Spot", "x-sdk-sub-service": "Order", - "x-sdk-method-name": "batchCancelStopOrder", - "x-sdk-method-description": "This endpoint can be used to cancel a spot stop orders by batch.", - "x-api-rate-limit": 3, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"cancelledOrderIds\\\": [\\n \\\"671124f9365ccb00073debd4\\\"\\n ]\\n }\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"example_string_default_value\\\", \\\"tradeType\\\": \\\"example_string_default_value\\\", \\\"orderIds\\\": \\\"example_string_default_value\\\"}" + "x-sdk-method-name": "setDCP", + "x-sdk-method-description": "Set Disconnection Protect(Deadman Swich)Through this interface, Call this interface to automatically cancel all orders of the set trading pair after the specified time. If this interface is not called again for renewal or cancellation before the set time, the system will help the user to cancel the order of the corresponding trading pair. Otherwise it will not.", + "x-api-rate-limit": 2, + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "timeout": { + "type": "integer", + "description": "Auto cancel order trigger setting time, the unit is second. range: timeout=-1 (meaning unset) or 5 <= timeout <= 86400. For example, timeout=5 means that the order will be automatically canceled if no user request is received for more than 5 seconds. When this parameter is changed, the previous setting will be overwritten." + }, + "symbols": { + "type": "string", + "description": "List of trading pairs. When this parameter is not empty, separate it with commas and support up to 50 trading pairs. Empty means all trading pairs. When this parameter is changed, the previous setting will be overwritten.", + "example": [ + "BTC-USDT,ETH-USDT" + ] + } + }, + "required": [ + "timeout" + ] + }, + "example": "{\n \"timeout\": 5,\n \"symbols\": \"BTC-USDT,ETH-USDT\"\n}" + } + } + }, + "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"currentTime\\\":1729656588,\\\"triggerTime\\\":1729656593}}", + "x-request-example": "{\\\"timeout\\\": 5, \\\"symbols\\\": \\\"BTC-USDT,ETH-USDT\\\"}" } }, - "/api/v3/oco/orders": { - "delete": { - "summary": "Batch Cancel OCO Order", + "/api/v1/stop-order": { + "post": { + "summary": "Add Stop Order", "deprecated": true, - "description": "This interface can batch cancel OCO orders through orderIds. You will receive cancelledOrderIds field once the system has received the cancellation request. The cancellation request will be processed by the matching engine in sequence. To know if the request is processed (successfully or not), you may check the order status or the update message from the pushes.", + "description": "Place stop order to the Spot trading system, you can place two major types of orders: limit and market. Orders can only be placed if your account has sufficient funds. Once an order is placed, your funds will be put on hold for the duration of the order. The amount of funds on hold depends on the order type and parameters specified.", "tags": [], - "parameters": [ - { - "name": "orderIds", - "in": "query", - "description": "Specify the order id, there can be multiple orders, separated by commas. If not passed, all oco orders will be canceled by default.", - "required": false, - "schema": { - "type": "string" - } - }, - { - "name": "symbol", - "in": "query", - "description": "trading pair. If not passed, the oco orders of all symbols will be canceled by default.", - "required": false, - "schema": { - "type": "string" - } - } - ], + "parameters": [], "responses": { "200": { "description": "", @@ -4053,114 +4076,243 @@ "data": { "type": "object", "properties": { - "cancelledOrderIds": { - "type": "array", - "items": { - "type": "string" - }, - "description": "List of two order IDs related to the canceled OCO order" + "orderId": { + "type": "string", + "description": "The unique order id generated by the trading system,which can be used later for further actions such as canceling the order." + }, + "clientOid": { + "type": "string", + "description": "The user self-defined order id." } }, - "required": [ - "cancelledOrderIds" - ] - } + "required": [ + "orderId", + "clientOid" + ] + } + }, + "required": [ + "code", + "data" + ] + } + } + } + } + }, + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470334", + "x-abandon": "abandon", + "x-domain": "Spot", + "x-api-channel": "Private", + "x-api-permission": "Spot", + "x-api-rate-limit-pool": "Spot", + "x-sdk-service": "Spot", + "x-sdk-sub-service": "Order", + "x-sdk-method-name": "addStopOrder", + "x-sdk-method-description": "Place stop order to the Spot trading system, you can place two major types of orders: limit and market. Orders can only be placed if your account has sufficient funds. Once an order is placed, your funds will be put on hold for the duration of the order. The amount of funds on hold depends on the order type and parameters specified.", + "x-api-rate-limit": 1, + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "clientOid": { + "type": "string", + "description": "Client Order Id,The ClientOid field is a unique ID created by the user(we recommend using a UUID), and can only contain numbers, letters, underscores (_), and hyphens (-). This field is returned when order information is obtained. You can use clientOid to tag your orders. ClientOid is different from the order ID created by the service provider. Please do not initiate requests using the same clientOid. The maximum length for the ClientOid is 40 characters.\n\nPlease remember the orderId created by the service provider, it used to check for updates in order status.", + "example": [ + "5c52e11203aa677f33e493fb" + ] + }, + "side": { + "type": "string", + "description": "specify if the order is to 'buy' or 'sell'", + "enum": [ + "buy", + "sell" + ], + "x-api-enum": [ + { + "value": "buy", + "name": "", + "description": "" + }, + { + "value": "sell", + "name": "", + "description": "" + } + ], + "example": [ + "buy" + ] + }, + "symbol": { + "type": "string", + "description": "symbol", + "example": [ + "BTC-USDT", + "ETH-USDT", + "KCS-USDT" + ] + }, + "type": { + "type": "string", + "description": "specify if the order is an 'limit' order or 'market' order. \n\nThe type of order you specify when you place your order determines whether or not you need to request other parameters and also affects the execution of the matching engine.\n\nWhen placing a limit order, you must specify a price and size. The system will try to match the order according to market price or a price better than market price. If the order cannot be immediately matched, it will stay in the order book until it is matched or the user cancels.\n\nUnlike limit orders, the price for market orders fluctuates with market prices. When placing a market order, you do not need to specify a price, you only need to specify a quantity. Market orders are filled immediately and will not enter the order book. All market orders are takers and a taker fee will be charged.", + "enum": [ + "limit", + "market" + ], + "x-api-enum": [ + { + "value": "limit", + "name": "", + "description": "" + }, + { + "value": "market", + "name": "", + "description": "" + } + ], + "example": [ + "limit" + ] + }, + "remark": { + "type": "string", + "description": "Order placement remarks, length cannot exceed 20 characters (ASCII)" + }, + "stp": { + "type": "string", + "description": "[Self Trade Prevention](https://www.kucoin.com/docs-new/doc-338146) is divided into four strategies: CN, CO, CB , and DC", + "enum": [ + "DC", + "CO", + "CN", + "CB" + ], + "x-api-enum": [ + { + "value": "DC", + "name": "", + "description": "" + }, + { + "value": "CO", + "name": "", + "description": "" + }, + { + "value": "CN", + "name": "", + "description": "" + }, + { + "value": "CB", + "name": "", + "description": "" + } + ] + }, + "price": { + "type": "string", + "description": "Specify price for order, not need for market order.\n\nWhen placing a limit order, the price must be based on priceIncrement for the trading pair. The price increment (priceIncrement) is the price precision for the trading pair. For example, for the BTC-USDT trading pair, the priceIncrement is 0.00001000. So the price for your orders cannot be less than 0.00001000 and must be a multiple of priceIncrement. Otherwise, the order will return an invalid priceIncrement error." + }, + "size": { + "type": "string", + "description": "Specify quantity for order\n\nWhen **type** is limit, size refers to the amount of trading targets (the asset name written in front) for the trading pair. Teh Size must be based on the baseIncrement of the trading pair. The baseIncrement represents the precision for the trading pair. The size of an order must be a positive-integer multiple of baseIncrement and must be between baseMinSize and baseMaxSize.\n\nWhen **type** is market, select one out of two: size or funds" + }, + "timeInForce": { + "type": "string", + "description": "[Time in force](https://www.kucoin.com/docs-new/doc-338146) is a special strategy used during trading. Required for limit orders.", + "enum": [ + "GTC", + "GTT", + "IOC", + "FOK" + ], + "default": "GTC", + "x-api-enum": [ + { + "value": "GTC", + "name": "", + "description": "" + }, + { + "value": "GTT", + "name": "", + "description": "" + }, + { + "value": "IOC", + "name": "", + "description": "" + }, + { + "value": "FOK", + "name": "", + "description": "" + } + ] }, - "required": [ - "code", - "data" - ] - } - } + "postOnly": { + "type": "boolean", + "description": "passive order labels, this is disabled when the order timing strategy is IOC or FOK if **type** is limit.", + "default": false + }, + "hidden": { + "type": "boolean", + "description": "[Hidden order](https://www.kucoin.com/docs-new/doc-338146) or not (not shown in order book)", + "default": false + }, + "iceberg": { + "type": "boolean", + "description": "Whether or not only visible portions of orders are shown in [Iceberg orders](https://www.kucoin.com/docs-new/doc-338146)", + "default": false + }, + "visibleSize": { + "type": "string", + "description": "When **type** is limit, this is Maximum visible quantity in iceberg orders." + }, + "cancelAfter": { + "type": "integer", + "description": "Cancel after n seconds,the order timing strategy is GTT when **type** is limit.", + "format": "int64" + }, + "funds": { + "type": "string", + "description": "When **type** is market, select one out of two: size or funds" + }, + "stopPrice": { + "type": "string", + "description": "The trigger price." + }, + "tradeType": { + "type": "string", + "description": "The type of trading : TRADE(Spot), MARGIN_TRADE (Cross Margin), MARGIN_ISOLATED_TRADE (Isolated Margin). Default is TRADE" + } + }, + "required": [ + "symbol", + "type", + "side", + "stopPrice" + ] + }, + "example": "//limit order\n{\n \"type\": \"limit\",\n \"symbol\": \"BTC-USDT\",\n \"side\": \"buy\",\n \"price\": \"50000\",\n \"size\": \"0.00001\",\n \"clientOid\": \"5c52e11203aa677f33e493fb\",\n \"remark\": \"order remarks\"\n}\n\n//market order 1\n// {\n// \"type\": \"market\",\n// \"symbol\": \"BTC-USDT\",\n// \"side\": \"buy\",\n// \"size\": \"0.00001\",\n// \"clientOid\": \"5c52e11203aa677f33e493fc\",\n// \"remark\": \"order remarks\"\n// }\n\n//market order 2\n// {\n// \"type\": \"market\",\n// \"symbol\": \"BTC-USDT\",\n// \"side\": \"buy\",\n// \"funds\": \"1\",\n// \"clientOid\": \"5c52e11203aa677f33e493fc\",\n// \"remark\": \"order remarks\"\n// }\n" } } }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470356", - "x-abandon": "abandon", - "x-domain": "Spot", - "x-api-channel": "Private", - "x-api-permission": "Spot", - "x-api-rate-limit-pool": "Spot", - "x-sdk-service": "Spot", - "x-sdk-sub-service": "Order", - "x-sdk-method-name": "batchCancelOcoOrders", - "x-sdk-method-description": "This interface can batch cancel OCO orders through orderIds. You will receive cancelledOrderIds field once the system has received the cancellation request. The cancellation request will be processed by the matching engine in sequence. To know if the request is processed (successfully or not), you may check the order status or the update message from the pushes.", - "x-api-rate-limit": 3, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"cancelledOrderIds\\\": [\\n \\\"vs93gpqc750mkk57003gok6i\\\",\\n \\\"vs93gpqc750mkk57003gok6j\\\",\\n \\\"vs93gpqc75c39p83003tnriu\\\",\\n \\\"vs93gpqc75c39p83003tnriv\\\"\\n ]\\n }\\n}", - "x-request-example": "{\\\"orderIds\\\": \\\"674c388172cf2800072ee746,674c38bdfd8300000795167e\\\", \\\"symbol\\\": \\\"BTC-USDT\\\"}" + "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"orderId\\\":\\\"670fd33bf9406e0007ab3945\\\",\\\"clientOid\\\":\\\"5c52e11203aa677f33e493fb\\\"}}", + "x-request-example": "{\\\"type\\\": \\\"limit\\\", \\\"symbol\\\": \\\"BTC-USDT\\\", \\\"side\\\": \\\"buy\\\", \\\"price\\\": \\\"50000\\\", \\\"size\\\": \\\"0.00001\\\", \\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\", \\\"remark\\\": \\\"order remarks\\\"}" }, "get": { - "summary": "Get OCO Order List", - "deprecated": true, - "description": "Request via this endpoint to get your current OCO order list. Items are paginated and sorted to show the latest first. See the Pagination section for retrieving additional entries after the first page.", + "summary": "Get Stop Orders List", + "deprecated": false, + "description": "This interface is to obtain all Spot active stop order lists", "tags": [], - "parameters": [ - { - "name": "symbol", - "in": "query", - "description": "symbol", - "required": false, - "schema": { - "type": "string", - "example": [ - "BTC-USDT", - "ETH-USDT", - "KCS-USDT" - ] - } - }, - { - "name": "startAt", - "in": "query", - "description": "Start time (milliseconds)", - "required": false, - "schema": { - "type": "integer", - "format": "int64" - } - }, - { - "name": "endAt", - "in": "query", - "description": "End time (milliseconds)", - "required": false, - "schema": { - "type": "integer", - "format": "int64" - } - }, - { - "name": "orderIds", - "in": "query", - "description": "Specify orderId collection, up to 500 orders\n", - "required": false, - "schema": { - "type": "string" - } - }, - { - "name": "pageSize", - "in": "query", - "description": "Size per page, minimum value 10, maximum value 500", - "required": false, - "schema": { - "type": "integer", - "minimum": 10, - "maximum": 500, - "default": 50 - } - }, - { - "name": "currentPage", - "in": "query", - "description": "Page number, minimum value 1\n", - "required": false, - "schema": { - "type": "integer", - "default": 1 - } - } - ], + "parameters": [], "responses": { "200": { "description": "", @@ -4176,93 +4328,159 @@ "type": "object", "properties": { "currentPage": { - "type": "integer" + "type": "integer", + "description": "current page id" }, "pageSize": { "type": "integer" }, "totalNum": { - "type": "integer" + "type": "integer", + "description": "the stop order count" }, "totalPage": { - "type": "integer" + "type": "integer", + "description": "total page count of the list" }, "items": { "type": "array", "items": { "type": "object", "properties": { - "orderId": { + "id": { + "type": "string", + "description": "Order ID, the ID of an order." + }, + "symbol": { + "type": "string", + "description": "Symbol name" + }, + "userId": { + "type": "string", + "description": "User ID" + }, + "status": { + "type": "string", + "description": "Order status, include NEW, TRIGGERED" + }, + "type": { + "type": "string", + "description": "Order type,limit, market, limit_stop or market_stop" + }, + "side": { + "type": "string", + "description": "transaction direction,include buy and sell" + }, + "price": { + "type": "string", + "description": "order price" + }, + "size": { + "type": "string", + "description": "order quantity" + }, + "funds": { + "type": "string", + "description": "order funds" + }, + "stp": { + "type": "string" + }, + "timeInForce": { + "type": "string", + "description": "time InForce,include GTC,GTT,IOC,FOK" + }, + "cancelAfter": { + "type": "integer", + "description": "cancel orders after n seconds,requires timeInForce to be GTT" + }, + "postOnly": { + "type": "boolean", + "description": "postOnly" + }, + "hidden": { + "type": "boolean", + "description": "hidden order" + }, + "iceberg": { + "type": "boolean", + "description": "Iceberg order" + }, + "visibleSize": { + "type": "string", + "description": "displayed quantity for iceberg order" + }, + "channel": { + "type": "string", + "description": "order source" + }, + "clientOid": { + "type": "string", + "description": "user-entered order unique mark" + }, + "remark": { + "type": "string", + "description": "Remarks at stop order creation" + }, + "tags": { + "type": "string", + "description": "tag order source" + }, + "orderTime": { + "type": "integer", + "description": "Time of place a stop order, accurate to nanoseconds", + "format": "int64" + }, + "domainId": { + "type": "string", + "description": "domainId, e.g: kucoin" + }, + "tradeSource": { "type": "string", - "description": "The unique order id generated by the trading system,which can be used later for further actions such as canceling the order." + "description": "trade source: USER(Order by user), MARGIN_SYSTEM(Order by margin system)" }, - "symbol": { + "tradeType": { "type": "string", - "description": "symbol" + "description": "The type of trading : TRADE(Spot), MARGIN_TRADE (Cross Margin), MARGIN_ISOLATED_TRADE (Isolated Margin)." }, - "clientOid": { + "feeCurrency": { "type": "string", - "description": "Client Order Id" + "description": "The currency of the fee" }, - "orderTime": { + "takerFeeRate": { + "type": "string", + "description": "Fee Rate of taker" + }, + "makerFeeRate": { + "type": "string", + "description": "Fee Rate of maker" + }, + "createdAt": { "type": "integer", - "description": "Order placement time, milliseconds", + "description": "order creation time", "format": "int64" }, - "status": { + "stop": { "type": "string", - "description": "Order status: NEW: New, DONE: Completed, TRIGGERED: Triggered, CANCELLED: Cancelled", - "enum": [ - "NEW", - "DONE", - "TRIGGERED", - "CANCELLED" - ], - "x-api-enum": [ - { - "value": "NEW", - "name": "NEW", - "description": "New" - }, - { - "value": "DONE", - "name": "DONE", - "description": "Completed" - }, - { - "value": "TRIGGERED", - "name": "TRIGGERED", - "description": "Triggered" - }, - { - "value": "CANCELLED", - "name": "CANCELLED", - "description": "Cancelled" - } - ] + "description": "Stop order type, include loss and entry" + }, + "stopTriggerTime": { + "type": "integer", + "description": "The trigger time of the stop order", + "format": "int64" + }, + "stopPrice": { + "type": "string", + "description": "stop price" } - }, - "required": [ - "orderId", - "symbol", - "clientOid", - "orderTime", - "status" - ] - } + } + }, + "description": "the list of stop orders" } - }, - "required": [ - "currentPage", - "pageSize", - "totalNum", - "totalPage", - "items" - ] + } } }, "required": [ - "code", "data" ] } @@ -4270,141 +4488,168 @@ } } }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470360", - "x-abandon": "abandon", + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470338", + "x-abandon": "normal", "x-domain": "Spot", "x-api-channel": "Private", "x-api-permission": "General", "x-api-rate-limit-pool": "Spot", "x-sdk-service": "Spot", "x-sdk-sub-service": "Order", - "x-sdk-method-name": "getOcoOrderList", - "x-sdk-method-description": "Request via this endpoint to get your current OCO order list. Items are paginated and sorted to show the latest first. See the Pagination section for retrieving additional entries after the first page.", - "x-api-rate-limit": 2, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"currentPage\\\": 1,\\n \\\"pageSize\\\": 50,\\n \\\"totalNum\\\": 1,\\n \\\"totalPage\\\": 1,\\n \\\"items\\\": [\\n {\\n \\\"orderId\\\": \\\"674c3cfa72cf2800072ee7ce\\\",\\n \\\"symbol\\\": \\\"BTC-USDT\\\",\\n \\\"clientOid\\\": \\\"5c52e1203aa6f3g7f1e493fb\\\",\\n \\\"orderTime\\\": 1733049594803,\\n \\\"status\\\": \\\"NEW\\\"\\n }\\n ]\\n }\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"startAt\\\": 123456, \\\"endAt\\\": 123456, \\\"orderIds\\\": \\\"example_string_default_value\\\", \\\"pageSize\\\": 50, \\\"currentPage\\\": 1}" - } - }, - "/api/v1/hf/fills": { - "get": { - "summary": "Get Trade History", - "deprecated": false, - "description": "This endpoint can be used to obtain a list of the latest Spot transaction details. The returned data is sorted in descending order according to the latest update time of the order.", - "tags": [], - "parameters": [ - { - "name": "symbol", - "in": "query", - "description": "symbol", - "required": true, - "schema": { - "type": "string", - "example": [ - "BTC-USDT", - "ETH-USDT", - "KCS-USDT" - ] - } - }, - { - "name": "orderId", - "in": "query", - "description": "The unique order id generated by the trading system\n(If orderId is specified,please ignore the other query parameters)", - "required": false, - "schema": { - "type": "string" - } - }, - { - "name": "side", - "in": "query", - "description": "specify if the order is to 'buy' or 'sell'", - "required": false, - "schema": { - "type": "string", - "enum": [ - "buy", - "sell" - ], - "x-api-enum": [ - { - "value": "buy", - "name": "", - "description": "" - }, - { - "value": "sell", - "name": "", - "description": "" + "x-sdk-method-name": "getStopOrdersList", + "x-sdk-method-description": "This interface is to obtain all Spot active stop order lists", + "x-api-rate-limit": 8, + "x-request-force-json": true, + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "symbol": { + "type": "string", + "description": "Only list orders for a specific symbol" + }, + "side": { + "type": "string", + "enum": [ + "buy", + "sell" + ], + "description": "buy or sell", + "x-api-enum": [ + { + "value": "buy", + "name": "buy", + "description": "" + }, + { + "value": "sell", + "name": "sell", + "description": "" + } + ] + }, + "type": { + "type": "string", + "description": "limit, market, limit_stop or market_stop", + "enum": [ + "limit", + "market", + "limit_stop", + "market_stop" + ], + "x-api-enum": [ + { + "value": "limit", + "name": "limit", + "description": "" + }, + { + "value": "market", + "name": "market", + "description": "" + }, + { + "value": "limit_stop", + "name": "limit_stop", + "description": "" + }, + { + "value": "market_stop", + "name": "market_stop", + "description": "" + } + ] + }, + "tradeType": { + "type": "string", + "description": "The type of trading : TRADE(Spot), MARGIN_TRADE (Cross Margin), MARGIN_ISOLATED_TRADE (Isolated Margin). Default is TRADE", + "enum": [ + "TRADE", + "MARGIN_TRADE", + "MARGIN_ISOLATED_TRADE" + ], + "x-api-enum": [ + { + "value": "TRADE", + "name": "TRADE", + "description": "" + }, + { + "value": "MARGIN_TRADE", + "name": "MARGIN_TRADE", + "description": "" + }, + { + "value": "MARGIN_ISOLATED_TRADE", + "name": "MARGIN_ISOLATED_TRADE", + "description": "" + } + ] + }, + "startAt": { + "type": "number", + "description": "Start time (milisecond)" + }, + "endAt": { + "type": "number", + "description": "End time (milisecond)" + }, + "currentPage": { + "type": "integer", + "description": "current page" + }, + "orderIds": { + "type": "string", + "description": "comma seperated order ID list" + }, + "pageSize": { + "type": "integer", + "description": "page size" + }, + "stop": { + "type": "string", + "description": "Order type: stop: stop loss order, oco: oco order" + } } - ] + }, + "example": "{\n \"symbol\": \"BTC-USDT\",\n \"orderId\": \"670fd33bf9406e0007ab3945\",\n \"newPrice\": \"30000\",\n \"newSize\": \"0.0001\"\n}" } - }, + } + }, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"currentPage\\\": 1,\\n \\\"pageSize\\\": 50,\\n \\\"totalNum\\\": 1,\\n \\\"totalPage\\\": 1,\\n \\\"items\\\": [\\n {\\n \\\"id\\\": \\\"vs8hoo8kqjnklv4m0038lrfq\\\",\\n \\\"symbol\\\": \\\"KCS-USDT\\\",\\n \\\"userId\\\": \\\"60fe4956c43cbc0006562c2c\\\",\\n \\\"status\\\": \\\"NEW\\\",\\n \\\"type\\\": \\\"limit\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"price\\\": \\\"0.01000000000000000000\\\",\\n \\\"size\\\": \\\"0.01000000000000000000\\\",\\n \\\"funds\\\": null,\\n \\\"stp\\\": null,\\n \\\"timeInForce\\\": \\\"GTC\\\",\\n \\\"cancelAfter\\\": -1,\\n \\\"postOnly\\\": false,\\n \\\"hidden\\\": false,\\n \\\"iceberg\\\": false,\\n \\\"visibleSize\\\": null,\\n \\\"channel\\\": \\\"API\\\",\\n \\\"clientOid\\\": \\\"404814a0fb4311eb9098acde48001122\\\",\\n \\\"remark\\\": null,\\n \\\"tags\\\": null,\\n \\\"orderTime\\\": 1628755183702150100,\\n \\\"domainId\\\": \\\"kucoin\\\",\\n \\\"tradeSource\\\": \\\"USER\\\",\\n \\\"tradeType\\\": \\\"TRADE\\\",\\n \\\"feeCurrency\\\": \\\"USDT\\\",\\n \\\"takerFeeRate\\\": \\\"0.00200000000000000000\\\",\\n \\\"makerFeeRate\\\": \\\"0.00200000000000000000\\\",\\n \\\"createdAt\\\": 1628755183704,\\n \\\"stop\\\": \\\"loss\\\",\\n \\\"stopTriggerTime\\\": null,\\n \\\"stopPrice\\\": \\\"10.00000000000000000000\\\"\\n }\\n ]\\n }\\n}", + "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"orderId\\\": \\\"670fd33bf9406e0007ab3945\\\", \\\"newPrice\\\": \\\"30000\\\", \\\"newSize\\\": \\\"0.0001\\\"}" + } + }, + "/api/v1/stop-order/cancelOrderByClientOid": { + "delete": { + "summary": "Cancel Stop Order By ClientOid", + "deprecated": true, + "description": "This endpoint can be used to cancel a spot stop order by clientOid. ", + "tags": [], + "parameters": [ { - "name": "type", + "name": "symbol", "in": "query", - "description": "specify if the order is an 'limit' order or 'market' order. ", + "description": "symbol", "required": false, "schema": { "type": "string", - "enum": [ - "limit", - "market" - ], - "x-api-enum": [ - { - "value": "limit", - "name": "", - "description": "" - }, - { - "value": "market", - "name": "", - "description": "" - } + "example": [ + "BTC-USDT", + "ETH-USDT", + "KCS-USDT" ] } }, { - "name": "lastId", - "in": "query", - "description": "The id of the last set of data from the previous batch of data. By default, the latest information is given.\nlastId is used to filter data and paginate. If lastId is not entered, the default is a maximum of 100 returned data items. The return results include lastId,which can be used as a query parameter to look up new data from the next page.", - "required": false, - "schema": { - "type": "integer", - "format": "int64" - } - }, - { - "name": "limit", - "in": "query", - "description": "Default20,Max100", - "required": false, - "schema": { - "type": "integer", - "default": 20, - "minimum": 1, - "maximum": 100 - } - }, - { - "name": "startAt", - "in": "query", - "description": "Start time (milisecond)", - "required": false, - "schema": { - "type": "integer", - "format": "int64" - } - }, - { - "name": "endAt", + "name": "clientOid", "in": "query", - "description": "End time (milisecond)", - "required": false, + "description": "Unique order id created by users to identify their orders", + "required": true, "schema": { - "type": "integer", - "format": "int64" + "type": "string" } } ], @@ -4422,179 +4667,357 @@ "data": { "type": "object", "properties": { - "items": { - "type": "array", - "items": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "description": "Id of transaction detail", - "format": "int64" - }, - "symbol": { - "type": "string", - "description": "symbol", - "example": [ - "BTC-USDT", - "ETH-USDT", - "KCS-USDT" - ] - }, - "tradeId": { - "type": "integer", - "description": "Trade Id, symbol latitude increment", - "format": "int64" - }, - "orderId": { - "type": "string", - "description": "The unique order id generated by the trading system" - }, - "counterOrderId": { - "type": "string", - "description": "Counterparty order Id" - }, - "side": { - "type": "string", - "description": "Buy or sell", - "enum": [ - "buy", - "sell" - ], - "x-api-enum": [ - { - "value": "buy", - "name": "", - "description": "" - }, - { - "value": "sell", - "name": "", - "description": "" - } - ] - }, - "liquidity": { - "type": "string", - "description": "Liquidity type: taker or maker", - "enum": [ - "taker", - "maker" - ], - "x-api-enum": [ - { - "value": "taker", - "name": "", - "description": "" - }, - { - "value": "maker", - "name": "", - "description": "" - } - ] - }, - "forceTaker": { - "type": "boolean" - }, - "price": { - "type": "string", - "description": "Order price" - }, - "size": { - "type": "string", - "description": "Order size" - }, - "funds": { - "type": "string", - "description": "Order Funds" - }, - "fee": { - "type": "string", - "description": "[Handling fees](https://www.kucoin.com/docs-new/api-5327739)" - }, - "feeRate": { - "type": "string", - "description": "Fee rate\n" - }, - "feeCurrency": { - "type": "string", - "description": "currency used to calculate trading fee" - }, - "stop": { - "type": "string", - "description": "Take Profit and Stop Loss type, currently HFT does not support the Take Profit and Stop Loss type, so it is empty" - }, - "tradeType": { - "type": "string", - "description": "Trade type, redundancy param" - }, - "taxRate": { - "type": "string", - "description": "Tax Rate, Users in some regions need query this field" - }, - "tax": { - "type": "string", - "description": "Users in some regions need query this field" - }, - "type": { - "type": "string", - "description": "Specify if the order is an 'limit' order or 'market' order. ", - "enum": [ - "limit", - "market" - ], - "x-api-enum": [ - { - "value": "limit", - "name": "", - "description": "" - }, - { - "value": "market", - "name": "", - "description": "" - } - ] - }, - "createdAt": { - "type": "integer", - "format": "int64" - } - }, - "required": [ - "id", - "symbol", - "tradeId", - "orderId", - "counterOrderId", - "side", - "liquidity", - "forceTaker", - "price", - "size", - "funds", - "fee", - "feeRate", - "feeCurrency", - "stop", - "tradeType", - "taxRate", - "tax", - "type", - "createdAt" - ] - } + "clientOid": { + "type": "string", + "description": "Client Order Id,unique identifier created by the user" + }, + "cancelledOrderId": { + "type": "string", + "description": "Unique ID of the cancelled order" + } + }, + "required": [ + "clientOid", + "cancelledOrderId" + ] + } + }, + "required": [ + "code", + "data" + ] + } + } + } + } + }, + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470336", + "x-abandon": "abandon", + "x-domain": "Spot", + "x-api-channel": "Private", + "x-api-permission": "Spot", + "x-api-rate-limit-pool": "Spot", + "x-sdk-service": "Spot", + "x-sdk-sub-service": "Order", + "x-sdk-method-name": "cancelStopOrderByClientOid", + "x-sdk-method-description": "This endpoint can be used to cancel a spot stop order by clientOid. ", + "x-api-rate-limit": 5, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"cancelledOrderId\\\": \\\"vs8hoo8ksc8mario0035a74n\\\",\\n \\\"clientOid\\\": \\\"689ff597f4414061aa819cc414836abd\\\"\\n }\\n}", + "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"clientOid\\\": \\\"689ff597f4414061aa819cc414836abd\\\"}" + } + }, + "/api/v1/stop-order/{orderId}": { + "delete": { + "summary": "Cancel Stop Order By OrderId", + "deprecated": true, + "description": "This endpoint can be used to cancel a spot stop order by orderId. ", + "tags": [], + "parameters": [ + { + "name": "orderId", + "in": "path", + "description": "The unique order id generated by the trading system", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "object", + "properties": { + "cancelledOrderIds": { + "type": "array", + "items": { + "type": "string" + }, + "description": "order id array" + } + }, + "required": [ + "cancelledOrderIds" + ] + } + }, + "required": [ + "code", + "data" + ] + } + } + } + } + }, + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470335", + "x-abandon": "abandon", + "x-domain": "Spot", + "x-api-channel": "Private", + "x-api-permission": "Spot", + "x-api-rate-limit-pool": "Spot", + "x-sdk-service": "Spot", + "x-sdk-sub-service": "Order", + "x-sdk-method-name": "cancelStopOrderByOrderId", + "x-sdk-method-description": "This endpoint can be used to cancel a spot stop order by orderId. ", + "x-api-rate-limit": 3, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"cancelledOrderIds\\\": [\\n \\\"671124f9365ccb00073debd4\\\"\\n ]\\n }\\n}", + "x-request-example": "{\\\"orderId\\\": \\\"671124f9365ccb00073debd4\\\"}" + }, + "get": { + "summary": "Get Stop Order By OrderId", + "deprecated": false, + "description": "This interface is to obtain Spot stop order details by orderId", + "tags": [], + "parameters": [ + { + "name": "orderId", + "in": "path", + "description": "The order id", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Order ID, the ID of an order." }, - "lastId": { + "symbol": { + "type": "string", + "description": "Symbol name" + }, + "userId": { + "type": "string", + "description": "User ID" + }, + "status": { + "type": "string", + "description": "Order status, include NEW, TRIGGERED" + }, + "type": { + "type": "string", + "description": "Order type,limit, market, limit_stop or market_stop" + }, + "side": { + "type": "string", + "description": "transaction direction,include buy and sell" + }, + "price": { + "type": "string", + "description": "order price" + }, + "size": { + "type": "string", + "description": "order quantity" + }, + "funds": { + "type": "string", + "description": "order funds" + }, + "stp": { + "type": "string" + }, + "timeInForce": { + "type": "string", + "description": "time InForce,include GTC,GTT,IOC,FOK" + }, + "cancelAfter": { "type": "integer", - "description": "The id of the last set of data from the previous batch of data. By default, the latest information is given.\nlastId is used to filter data and paginate. If lastId is not entered, the default is a maximum of 100 returned data items. The return results include lastId,which can be used as a query parameter to look up new data from the next page.", + "description": "cancel orders after n seconds,requires timeInForce to be GTT", + "format": "int64" + }, + "postOnly": { + "type": "boolean", + "description": "postOnly" + }, + "hidden": { + "type": "boolean", + "description": "hidden order" + }, + "iceberg": { + "type": "boolean", + "description": "Iceberg order" + }, + "visibleSize": { + "type": "string", + "description": "displayed quantity for iceberg order" + }, + "channel": { + "type": "string", + "description": "order source" + }, + "clientOid": { + "type": "string", + "description": "user-entered order unique mark" + }, + "remark": { + "type": "string", + "description": "Remarks at stop order creation" + }, + "tags": { + "type": "string", + "description": "tag order source" + }, + "domainId": { + "type": "string", + "description": "domainId, e.g: kucoin" + }, + "tradeSource": { + "type": "string", + "description": "trade source: USER(Order by user), MARGIN_SYSTEM(Order by margin system)" + }, + "tradeType": { + "type": "string", + "description": "The type of trading : TRADE(Spot), MARGIN_TRADE (Cross Margin), MARGIN_ISOLATED_TRADE (Isolated Margin)." + }, + "feeCurrency": { + "type": "string", + "description": "The currency of the fee" + }, + "takerFeeRate": { + "type": "string", + "description": "Fee Rate of taker" + }, + "makerFeeRate": { + "type": "string", + "description": "Fee Rate of maker" + }, + "createdAt": { + "type": "integer", + "description": "order creation time", + "format": "int64" + }, + "stop": { + "type": "string", + "description": "Stop order type, include loss and entry" + }, + "stopTriggerTime": { + "type": "integer", + "description": "The trigger time of the stop order", + "format": "int64" + }, + "stopPrice": { + "type": "string", + "description": "stop price" + }, + "orderTime": { + "type": "integer", + "description": "Time of place a stop order, accurate to nanoseconds", "format": "int64" } }, + "description": "the details" + }, + "code": { + "type": "string", + "description": "return status code" + } + }, + "required": [ + "data", + "code" + ] + } + } + } + } + }, + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470339", + "x-abandon": "normal", + "x-domain": "Spot", + "x-api-channel": "Private", + "x-api-permission": "General", + "x-api-rate-limit-pool": "Spot", + "x-sdk-service": "Spot", + "x-sdk-sub-service": "Order", + "x-sdk-method-name": "getStopOrderByOrderId", + "x-sdk-method-description": "This interface is to obtain Spot stop order details by orderId", + "x-api-rate-limit": 3, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"id\\\": \\\"vs8hoo8q2ceshiue003b67c0\\\",\\n \\\"symbol\\\": \\\"KCS-USDT\\\",\\n \\\"userId\\\": \\\"60fe4956c43cbc0006562c2c\\\",\\n \\\"status\\\": \\\"NEW\\\",\\n \\\"type\\\": \\\"limit\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"price\\\": \\\"0.01000000000000000000\\\",\\n \\\"size\\\": \\\"0.01000000000000000000\\\",\\n \\\"funds\\\": null,\\n \\\"stp\\\": null,\\n \\\"timeInForce\\\": \\\"GTC\\\",\\n \\\"cancelAfter\\\": -1,\\n \\\"postOnly\\\": false,\\n \\\"hidden\\\": false,\\n \\\"iceberg\\\": false,\\n \\\"visibleSize\\\": null,\\n \\\"channel\\\": \\\"API\\\",\\n \\\"clientOid\\\": \\\"40e0eb9efe6311eb8e58acde48001122\\\",\\n \\\"remark\\\": null,\\n \\\"tags\\\": null,\\n \\\"orderTime\\\": 1629098781127530200,\\n \\\"domainId\\\": \\\"kucoin\\\",\\n \\\"tradeSource\\\": \\\"USER\\\",\\n \\\"tradeType\\\": \\\"TRADE\\\",\\n \\\"feeCurrency\\\": \\\"USDT\\\",\\n \\\"takerFeeRate\\\": \\\"0.00200000000000000000\\\",\\n \\\"makerFeeRate\\\": \\\"0.00200000000000000000\\\",\\n \\\"createdAt\\\": 1629098781128,\\n \\\"stop\\\": \\\"loss\\\",\\n \\\"stopTriggerTime\\\": null,\\n \\\"stopPrice\\\": \\\"10.00000000000000000000\\\"\\n }\\n}", + "x-request-example": "{\\\"orderId\\\": \\\"example_string_default_value\\\"}" + } + }, + "/api/v1/stop-order/cancel": { + "delete": { + "summary": "Batch Cancel Stop Orders", + "deprecated": false, + "description": "This endpoint can be used to cancel a spot stop orders by batch.", + "tags": [], + "parameters": [ + { + "name": "symbol", + "in": "query", + "description": "Cancel the open order for the specified symbol", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "tradeType", + "in": "query", + "description": "The type of trading : TRADE(Spot), MARGIN_TRADE (Cross Margin), MARGIN_ISOLATED_TRADE (Isolated Margin). Default is TRADE", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "orderIds", + "in": "query", + "description": "Comma seperated order IDs.", + "required": false, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "object", + "properties": { + "cancelledOrderIds": { + "type": "array", + "items": { + "type": "string" + }, + "description": "order id array" + } + }, "required": [ - "items", - "lastId" + "cancelledOrderIds" ] } }, @@ -4607,36 +5030,45 @@ } } }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470180", + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470337", "x-abandon": "normal", "x-domain": "Spot", "x-api-channel": "Private", - "x-api-permission": "General", + "x-api-permission": "Spot", "x-api-rate-limit-pool": "Spot", "x-sdk-service": "Spot", "x-sdk-sub-service": "Order", - "x-sdk-method-name": "getTradeHistory", - "x-sdk-method-description": "This endpoint can be used to obtain a list of the latest Spot transaction details. The returned data is sorted in descending order according to the latest update time of the order.", - "x-api-rate-limit": 2, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"items\\\": [\\n {\\n \\\"id\\\": 19814995255305,\\n \\\"orderId\\\": \\\"6717422bd51c29000775ea03\\\",\\n \\\"counterOrderId\\\": \\\"67174228135f9e000709da8c\\\",\\n \\\"tradeId\\\": 11029373945659392,\\n \\\"symbol\\\": \\\"BTC-USDT\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"liquidity\\\": \\\"taker\\\",\\n \\\"type\\\": \\\"limit\\\",\\n \\\"forceTaker\\\": false,\\n \\\"price\\\": \\\"67717.6\\\",\\n \\\"size\\\": \\\"0.00001\\\",\\n \\\"funds\\\": \\\"0.677176\\\",\\n \\\"fee\\\": \\\"0.000677176\\\",\\n \\\"feeRate\\\": \\\"0.001\\\",\\n \\\"feeCurrency\\\": \\\"USDT\\\",\\n \\\"stop\\\": \\\"\\\",\\n \\\"tradeType\\\": \\\"TRADE\\\",\\n \\\"taxRate\\\": \\\"0\\\",\\n \\\"tax\\\": \\\"0\\\",\\n \\\"createdAt\\\": 1729577515473\\n }\\n ],\\n \\\"lastId\\\": 19814995255305\\n }\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"orderId\\\": \\\"example_string_default_value\\\", \\\"side\\\": \\\"buy\\\", \\\"type\\\": \\\"limit\\\", \\\"lastId\\\": 254062248624417, \\\"limit\\\": 100, \\\"startAt\\\": 1728663338000, \\\"endAt\\\": 1728692138000}" + "x-sdk-method-name": "batchCancelStopOrder", + "x-sdk-method-description": "This endpoint can be used to cancel a spot stop orders by batch.", + "x-api-rate-limit": 3, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"cancelledOrderIds\\\": [\\n \\\"671124f9365ccb00073debd4\\\"\\n ]\\n }\\n}", + "x-request-example": "{\\\"symbol\\\": \\\"example_string_default_value\\\", \\\"tradeType\\\": \\\"example_string_default_value\\\", \\\"orderIds\\\": \\\"example_string_default_value\\\"}" } }, - "/api/v3/oco/order/details/{orderId}": { + "/api/v1/stop-order/queryOrderByClientOid": { "get": { - "summary": "Get OCO Order Detail By OrderId", - "deprecated": true, - "description": "Request via this interface to get a oco order detail via the order ID.", + "summary": "Get Stop Order By ClientOid", + "deprecated": false, + "description": "This interface is to obtain Spot stop order details by orderId", "tags": [], "parameters": [ { - "name": "orderId", - "in": "path", - "description": "The unique order id generated by the trading system", + "name": "clientOid", + "in": "query", + "description": "The client order id", "required": true, "schema": { "type": "string" } + }, + { + "name": "symbol", + "in": "query", + "description": "symbol name", + "required": false, + "schema": { + "type": "string" + } } ], "responses": { @@ -4648,79 +5080,144 @@ "type": "object", "properties": { "code": { - "type": "string" + "type": "string", + "description": "the return code" }, "data": { - "type": "object", - "properties": { - "orderId": { - "type": "string", - "description": "The unique order id generated by the trading system,which can be used later for further actions such as canceling the order." - }, - "symbol": { - "type": "string", - "description": "symbol" - }, - "clientOid": { - "type": "string", - "description": "Client Order Id" - }, - "orderTime": { - "type": "integer", - "description": "Order placement time, milliseconds", - "format": "int64" - }, - "status": { - "type": "string", - "description": "Order status: NEW: New, DONE: Completed, TRIGGERED: Triggered, CANCELLED: Cancelled" - }, - "orders": { - "type": "array", - "items": { - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "symbol": { - "type": "string" - }, - "side": { - "type": "string" - }, - "price": { - "type": "string" - }, - "stopPrice": { - "type": "string" - }, - "size": { - "type": "string" - }, - "status": { - "type": "string" - } - }, - "required": [ - "id", - "symbol", - "side", - "price", - "stopPrice", - "size", - "status" - ] + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Order ID, the ID of an order." + }, + "symbol": { + "type": "string", + "description": "Symbol name" + }, + "userId": { + "type": "string", + "description": "User ID" + }, + "status": { + "type": "string", + "description": "Order status, include NEW, TRIGGERED" + }, + "type": { + "type": "string", + "description": "Order type,limit, market, limit_stop or market_stop" + }, + "side": { + "type": "string", + "description": "transaction direction,include buy and sell" + }, + "price": { + "type": "string", + "description": "order price" + }, + "size": { + "type": "string", + "description": "order quantity" + }, + "funds": { + "type": "string", + "description": "order funds" + }, + "stp": { + "type": "string" + }, + "timeInForce": { + "type": "string", + "description": "time InForce,include GTC,GTT,IOC,FOK" + }, + "cancelAfter": { + "type": "integer", + "description": "cancel orders after n seconds,requires timeInForce to be GTT", + "format": "int64" + }, + "postOnly": { + "type": "boolean", + "description": "postOnly" + }, + "hidden": { + "type": "boolean", + "description": "hidden order" + }, + "iceberg": { + "type": "boolean", + "description": "Iceberg order" + }, + "visibleSize": { + "type": "string", + "description": "displayed quantity for iceberg order" + }, + "channel": { + "type": "string", + "description": "order source" + }, + "clientOid": { + "type": "string", + "description": "user-entered order unique mark" + }, + "remark": { + "type": "string", + "description": "Remarks at stop order creation" + }, + "tags": { + "type": "string", + "description": "tag order source" + }, + "domainId": { + "type": "string", + "description": "domainId, e.g: kucoin" + }, + "tradeSource": { + "type": "string", + "description": "trade source: USER(Order by user), MARGIN_SYSTEM(Order by margin system)" + }, + "tradeType": { + "type": "string", + "description": "The type of trading : TRADE(Spot), MARGIN_TRADE (Cross Margin), MARGIN_ISOLATED_TRADE (Isolated Margin)." + }, + "feeCurrency": { + "type": "string", + "description": "The currency of the fee" + }, + "takerFeeRate": { + "type": "string", + "description": "Fee Rate of taker" + }, + "makerFeeRate": { + "type": "string", + "description": "Fee Rate of maker" + }, + "createdAt": { + "type": "integer", + "description": "order creation time", + "format": "int64" + }, + "stop": { + "type": "string", + "description": "Stop order type, include loss and entry" + }, + "stopTriggerTime": { + "type": "integer", + "description": "The trigger time of the stop order", + "format": "int64" + }, + "stopPrice": { + "type": "string", + "description": "stop price" + }, + "orderTime": { + "type": "integer", + "description": "Time of place a stop order, accurate to nanoseconds", + "format": "int64" } } }, - "required": [ - "orderId", - "symbol", - "clientOid", - "orderTime", - "status", - "orders" - ] + "description": "the return code" } }, "required": [ @@ -4732,38 +5229,28 @@ } } }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470359", - "x-abandon": "abandon", + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470340", + "x-abandon": "normal", "x-domain": "Spot", "x-api-channel": "Private", "x-api-permission": "General", "x-api-rate-limit-pool": "Spot", "x-sdk-service": "Spot", "x-sdk-sub-service": "Order", - "x-sdk-method-name": "getOcoOrderDetailByOrderId", - "x-sdk-method-description": "Request via this interface to get a oco order detail via the order ID.", - "x-api-rate-limit": 2, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"orderId\\\": \\\"674c3b6e688dea0007c7bab2\\\",\\n \\\"symbol\\\": \\\"BTC-USDT\\\",\\n \\\"clientOid\\\": \\\"5c52e1203aa6f37f1e493fb\\\",\\n \\\"orderTime\\\": 1733049198863,\\n \\\"status\\\": \\\"NEW\\\",\\n \\\"orders\\\": [\\n {\\n \\\"id\\\": \\\"vs93gpqc7dn6h3fa003sfelj\\\",\\n \\\"symbol\\\": \\\"BTC-USDT\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"price\\\": \\\"94000.00000000000000000000\\\",\\n \\\"stopPrice\\\": \\\"94000.00000000000000000000\\\",\\n \\\"size\\\": \\\"0.10000000000000000000\\\",\\n \\\"status\\\": \\\"NEW\\\"\\n },\\n {\\n \\\"id\\\": \\\"vs93gpqc7dn6h3fa003sfelk\\\",\\n \\\"symbol\\\": \\\"BTC-USDT\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"price\\\": \\\"96000.00000000000000000000\\\",\\n \\\"stopPrice\\\": \\\"98000.00000000000000000000\\\",\\n \\\"size\\\": \\\"0.10000000000000000000\\\",\\n \\\"status\\\": \\\"NEW\\\"\\n }\\n ]\\n }\\n}", - "x-request-example": "{\\\"orderId\\\": \\\"674c3b6e688dea0007c7bab2\\\"}" + "x-sdk-method-name": "getStopOrderByClientOid", + "x-sdk-method-description": "This interface is to obtain Spot stop order details by orderId", + "x-api-rate-limit": 3, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": [\\n {\\n \\\"id\\\": \\\"vs8hoo8os561f5np0032vngj\\\",\\n \\\"symbol\\\": \\\"KCS-USDT\\\",\\n \\\"userId\\\": \\\"60fe4956c43cbc0006562c2c\\\",\\n \\\"status\\\": \\\"NEW\\\",\\n \\\"type\\\": \\\"limit\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"price\\\": \\\"0.01000000000000000000\\\",\\n \\\"size\\\": \\\"0.01000000000000000000\\\",\\n \\\"funds\\\": null,\\n \\\"stp\\\": null,\\n \\\"timeInForce\\\": \\\"GTC\\\",\\n \\\"cancelAfter\\\": -1,\\n \\\"postOnly\\\": false,\\n \\\"hidden\\\": false,\\n \\\"iceberg\\\": false,\\n \\\"visibleSize\\\": null,\\n \\\"channel\\\": \\\"API\\\",\\n \\\"clientOid\\\": \\\"2b700942b5db41cebe578cff48960e09\\\",\\n \\\"remark\\\": null,\\n \\\"tags\\\": null,\\n \\\"orderTime\\\": 1629020492834532600,\\n \\\"domainId\\\": \\\"kucoin\\\",\\n \\\"tradeSource\\\": \\\"USER\\\",\\n \\\"tradeType\\\": \\\"TRADE\\\",\\n \\\"feeCurrency\\\": \\\"USDT\\\",\\n \\\"takerFeeRate\\\": \\\"0.00200000000000000000\\\",\\n \\\"makerFeeRate\\\": \\\"0.00200000000000000000\\\",\\n \\\"createdAt\\\": 1629020492837,\\n \\\"stop\\\": \\\"loss\\\",\\n \\\"stopTriggerTime\\\": null,\\n \\\"stopPrice\\\": \\\"1.00000000000000000000\\\"\\n }\\n ]\\n}", + "x-request-example": "{\\\"clientOid\\\": \\\"example_string_default_value\\\", \\\"symbol\\\": \\\"example_string_default_value\\\"}" } }, - "/api/v3/oco/client-order/{clientOid}": { - "get": { - "summary": "Get OCO Order By ClientOid", + "/api/v3/oco/order": { + "post": { + "summary": "Add OCO Order", "deprecated": true, - "description": "Request via this interface to get a oco order information via the client order ID.", + "description": "Place OCO order to the Spot trading system", "tags": [], - "parameters": [ - { - "name": "clientOid", - "in": "path", - "description": "Client Order Id,unique identifier created by the user", - "required": true, - "schema": { - "type": "string" - } - } - ], + "parameters": [], "responses": { "200": { "description": "", @@ -4778,34 +5265,13 @@ "data": { "type": "object", "properties": { - "symbol": { - "type": "string", - "description": "symbol" - }, - "clientOid": { - "type": "string", - "description": "Client Order Id" - }, "orderId": { "type": "string", "description": "The unique order id generated by the trading system,which can be used later for further actions such as canceling the order." - }, - "orderTime": { - "type": "integer", - "description": "Order placement time, milliseconds", - "format": "int64" - }, - "status": { - "type": "string", - "description": "Order status: NEW: New, DONE: Completed, TRIGGERED: Triggered, CANCELLED: Cancelled" } }, "required": [ - "orderId", - "symbol", - "clientOid", - "orderTime", - "status" + "orderId" ] } }, @@ -4818,30 +5284,126 @@ } } }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470358", + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470353", "x-abandon": "abandon", "x-domain": "Spot", "x-api-channel": "Private", - "x-api-permission": "General", + "x-api-permission": "Spot", "x-api-rate-limit-pool": "Spot", "x-sdk-service": "Spot", "x-sdk-sub-service": "Order", - "x-sdk-method-name": "getOcoOrderByClientOid", - "x-sdk-method-description": "Request via this interface to get a oco order information via the client order ID.", + "x-sdk-method-name": "addOcoOrder", + "x-sdk-method-description": "Place OCO order to the Spot trading system", "x-api-rate-limit": 2, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"orderId\\\": \\\"674c3cfa72cf2800072ee7ce\\\",\\n \\\"symbol\\\": \\\"BTC-USDT\\\",\\n \\\"clientOid\\\": \\\"5c52e1203aa6f3g7f1e493fb\\\",\\n \\\"orderTime\\\": 1733049594803,\\n \\\"status\\\": \\\"NEW\\\"\\n }\\n}", - "x-request-example": "{\\\"clientOid\\\": \\\"5c52e1203aa6f3g7f1e493fb\\\"}" - }, + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "clientOid": { + "type": "string", + "description": "Client Order Id,The ClientOid field is a unique ID created by the user(we recommend using a UUID), and can only contain numbers, letters, underscores (_), and hyphens (-). This field is returned when order information is obtained. You can use clientOid to tag your orders. ClientOid is different from the order ID created by the service provider. Please do not initiate requests using the same clientOid. The maximum length for the ClientOid is 40 characters.\n\nPlease remember the orderId created by the service provider, it used to check for updates in order status.", + "example": [ + "5c52e11203aa677f33e493fb" + ] + }, + "side": { + "type": "string", + "description": "specify if the order is to 'buy' or 'sell'", + "enum": [ + "buy", + "sell" + ], + "x-api-enum": [ + { + "value": "buy", + "name": "", + "description": "" + }, + { + "value": "sell", + "name": "", + "description": "" + } + ], + "example": [ + "buy" + ] + }, + "symbol": { + "type": "string", + "description": "symbol", + "example": [ + "BTC-USDT", + "ETH-USDT", + "KCS-USDT" + ] + }, + "remark": { + "type": "string", + "description": "Order placement remarks, length cannot exceed 20 characters (ASCII)" + }, + "price": { + "type": "string", + "description": "Specify price for order" + }, + "size": { + "type": "string", + "description": "Specify quantity for order" + }, + "stopPrice": { + "type": "string", + "description": "trigger price." + }, + "limitPrice": { + "type": "string", + "description": "The limit order price after take-profit and stop-loss are triggered." + }, + "tradeType": { + "type": "string", + "description": "Transaction Type, currently only supports TRADE (spot transactions), the default is TRADE", + "enum": [ + "TRADE" + ], + "x-api-enum": [ + { + "value": "TRADE", + "name": "TRADE", + "description": "Spot Trading" + } + ] + } + }, + "required": [ + "symbol", + "side", + "clientOid", + "price", + "size", + "stopPrice", + "limitPrice" + ] + }, + "example": "{\n \"symbol\": \"BTC-USDT\",\n \"side\": \"buy\",\n \"price\": \"94000\",\n \"size\": \"0.1\",\n \"clientOid\": \"5c52e11203aa67f1e493fb\",\n \"stopPrice\": \"98000\",\n \"limitPrice\": \"96000\",\n \"remark\": \"this is remark\",\n \"tradeType\": \"TRADE\"\n}" + } + } + }, + "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"orderId\\\":\\\"674c316e688dea0007c7b986\\\"}}", + "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"side\\\": \\\"buy\\\", \\\"price\\\": \\\"94000\\\", \\\"size\\\": \\\"0.1\\\", \\\"clientOid\\\": \\\"5c52e11203aa67f1e493fb\\\", \\\"stopPrice\\\": \\\"98000\\\", \\\"limitPrice\\\": \\\"96000\\\", \\\"remark\\\": \\\"this is remark\\\", \\\"tradeType\\\": \\\"TRADE\\\"}" + } + }, + "/api/v3/oco/order/{orderId}": { "delete": { - "summary": "Cancel OCO Order By ClientOid", + "summary": "Cancel OCO Order By OrderId", "deprecated": true, - "description": "Request via this interface to cancel a stop order via the clientOid. You will receive cancelledOrderIds field once the system has received the cancellation request. The cancellation request will be processed by the matching engine in sequence. To know if the request is processed (successfully or not), you may check the order status or the update message from the pushes.", + "description": "This endpoint can be used to cancel a spot order by orderId. This endpoint only sends cancellation requests. The results of the requests must be obtained by checking the order status or subscribing to websocket.", "tags": [], "parameters": [ { - "name": "clientOid", + "name": "orderId", "in": "path", - "description": "Client Order Id,unique identifier created by the user", + "description": "The unique order id generated by the trading system", "required": true, "schema": { "type": "string" @@ -4884,7 +5446,7 @@ } } }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470355", + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470354", "x-abandon": "abandon", "x-domain": "Spot", "x-api-channel": "Private", @@ -4892,38 +5454,22 @@ "x-api-rate-limit-pool": "Spot", "x-sdk-service": "Spot", "x-sdk-sub-service": "Order", - "x-sdk-method-name": "cancelOcoOrderByClientOid", - "x-sdk-method-description": "Request via this interface to cancel a stop order via the clientOid. You will receive cancelledOrderIds field once the system has received the cancellation request. The cancellation request will be processed by the matching engine in sequence. To know if the request is processed (successfully or not), you may check the order status or the update message from the pushes.", - "x-api-rate-limit": 3, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"cancelledOrderIds\\\": [\\n \\\"vs93gpqc6r0mkk57003gok3h\\\",\\n \\\"vs93gpqc6r0mkk57003gok3i\\\"\\n ]\\n }\\n}", - "x-request-example": "{\\\"clientOid\\\": \\\"5c52e11203aa67f1e493fb\\\"}" - } - }, - "/api/v1/hf/orders/client-order/{clientOid}": { + "x-sdk-method-name": "cancelOcoOrderByOrderId", + "x-sdk-method-description": "This endpoint can be used to cancel a spot order by orderId. This endpoint only sends cancellation requests. The results of the requests must be obtained by checking the order status or subscribing to websocket.", + "x-api-rate-limit": 3, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"cancelledOrderIds\\\": [\\n \\\"vs93gpqc6kkmkk57003gok16\\\",\\n \\\"vs93gpqc6kkmkk57003gok17\\\"\\n ]\\n }\\n}", + "x-request-example": "{\\\"orderId\\\": \\\"674c316e688dea0007c7b986\\\"}" + }, "get": { - "summary": "Get Order By ClientOid", - "deprecated": false, - "description": "This endpoint can be used to obtain information for a single Spot order using the client order id. After the user successfully places an order, the order is in Active state, and the user can use inOrderBook to determine whether the order has entered the order. Canceled or fully filled orders are marked as completed Done status.", + "summary": "Get OCO Order By OrderId", + "deprecated": true, + "description": "Request via this interface to get a oco order information via the order ID.", "tags": [], "parameters": [ { - "name": "symbol", - "in": "query", - "description": "symbol", - "required": true, - "schema": { - "type": "string", - "example": [ - "BTC-USDT", - "ETH-USDT", - "KCS-USDT" - ] - } - }, - { - "name": "clientOid", + "name": "orderId", "in": "path", - "description": "Client Order Id,unique identifier created by the user", + "description": "The unique order id generated by the trading system", "required": true, "schema": { "type": "string" @@ -4944,266 +5490,62 @@ "data": { "type": "object", "properties": { - "id": { - "type": "string", - "description": "The unique order id generated by the trading system" - }, "symbol": { "type": "string", - "description": "symbol", - "example": [ - "BTC-USDT", - "ETH-USDT", - "KCS-USDT" - ] - }, - "opType": { - "type": "string" - }, - "type": { - "type": "string", - "description": "Specify if the order is an 'limit' order or 'market' order. ", - "enum": [ - "limit", - "market" - ], - "x-api-enum": [ - { - "value": "limit", - "name": "", - "description": "" - }, - { - "value": "market", - "name": "", - "description": "" - } - ] - }, - "side": { - "type": "string", - "description": "Buy or sell", - "enum": [ - "buy", - "sell" - ], - "x-api-enum": [ - { - "value": "buy", - "name": "", - "description": "" - }, - { - "value": "sell", - "name": "", - "description": "" - } - ] - }, - "price": { - "type": "string", - "description": "Order price" - }, - "size": { - "type": "string", - "description": "Order size" - }, - "funds": { - "type": "string", - "description": "Order Funds" - }, - "dealSize": { - "type": "string", - "description": "Number of filled transactions" - }, - "dealFunds": { - "type": "string", - "description": "Funds of filled transactions" - }, - "fee": { - "type": "string", - "description": "[Handling fees](https://www.kucoin.com/docs-new/api-5327739)" - }, - "feeCurrency": { - "type": "string", - "description": "currency used to calculate trading fee" - }, - "stp": { - "type": "string", - "description": "[Self Trade Prevention](https://www.kucoin.com/docs-new/api-5176570)", - "enum": [ - "DC", - "CO", - "CN", - "CB" - ], - "x-api-enum": [ - { - "value": "DC", - "name": "", - "description": "" - }, - { - "value": "CO", - "name": "", - "description": "" - }, - { - "value": "CN", - "name": "", - "description": "" - }, - { - "value": "CB", - "name": "", - "description": "" - } - ] - }, - "timeInForce": { - "type": "string", - "description": "Time in force", - "enum": [ - "GTC", - "GTT", - "IOC", - "FOK" - ], - "x-api-enum": [ - { - "value": "GTC", - "name": "", - "description": "" - }, - { - "value": "GTT", - "name": "", - "description": "" - }, - { - "value": "IOC", - "name": "", - "description": "" - }, - { - "value": "FOK", - "name": "", - "description": "" - } - ] - }, - "postOnly": { - "type": "boolean", - "description": "Whether its a postOnly order." - }, - "hidden": { - "type": "boolean", - "description": "Whether its a hidden order." - }, - "iceberg": { - "type": "boolean", - "description": "Whether its a iceberg order." - }, - "visibleSize": { - "type": "string", - "description": "Visible size of iceberg order in order book." - }, - "cancelAfter": { - "type": "integer", - "description": "A GTT timeInForce that expires in n seconds" - }, - "channel": { - "type": "string" + "description": "symbol" }, "clientOid": { "type": "string", - "description": "Client Order Id,unique identifier created by the user" - }, - "remark": { - "type": "string", - "description": "Order placement remarks" + "description": "Client Order Id" }, - "tags": { + "orderId": { "type": "string", - "description": "Order tag" - }, - "cancelExist": { - "type": "boolean", - "description": "Whether there is a cancellation record for the order." - }, - "createdAt": { - "type": "integer", - "format": "int64" + "description": "The unique order id generated by the trading system,which can be used later for further actions such as canceling the order." }, - "lastUpdatedAt": { + "orderTime": { "type": "integer", + "description": "Order placement time, milliseconds", "format": "int64" }, - "tradeType": { - "type": "string", - "description": "Trade type, redundancy param" - }, - "inOrderBook": { - "type": "boolean", - "description": "Whether to enter the orderbook: true: enter the orderbook; false: not enter the orderbook" - }, - "cancelledSize": { - "type": "string", - "description": "Number of canceled transactions" - }, - "cancelledFunds": { - "type": "string", - "description": "Funds of canceled transactions" - }, - "remainSize": { - "type": "string", - "description": "Number of remain transactions" - }, - "remainFunds": { - "type": "string", - "description": "Funds of remain transactions" - }, - "tax": { + "status": { "type": "string", - "description": "Users in some regions need query this field" - }, - "active": { - "type": "boolean", - "description": "Order status: true-The status of the order isactive; false-The status of the order is done" + "description": "Order status: NEW: New, DONE: Completed, TRIGGERED: Triggered, CANCELLED: Cancelled", + "enum": [ + "NEW", + "DONE", + "TRIGGERED", + "CANCELLED" + ], + "x-api-enum": [ + { + "value": "NEW", + "name": "NEW", + "description": "New" + }, + { + "value": "DONE", + "name": "DONE", + "description": "Completed" + }, + { + "value": "TRIGGERED", + "name": "TRIGGERED", + "description": "Triggered" + }, + { + "value": "CANCELLED", + "name": "CANCELLED", + "description": "Cancelled" + } + ] } }, "required": [ - "id", + "orderId", "symbol", - "opType", - "type", - "side", - "price", - "size", - "funds", - "dealSize", - "dealFunds", - "fee", - "feeCurrency", - "timeInForce", - "postOnly", - "hidden", - "iceberg", - "visibleSize", - "cancelAfter", - "channel", "clientOid", - "cancelExist", - "tradeType", - "inOrderBook", - "cancelledSize", - "cancelledFunds", - "remainSize", - "remainFunds", - "active", - "createdAt", - "lastUpdatedAt", - "tax" + "orderTime", + "status" ] } }, @@ -5216,24 +5558,26 @@ } } }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470182", - "x-abandon": "normal", + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470357", + "x-abandon": "abandon", "x-domain": "Spot", "x-api-channel": "Private", "x-api-permission": "General", "x-api-rate-limit-pool": "Spot", "x-sdk-service": "Spot", "x-sdk-sub-service": "Order", - "x-sdk-method-name": "getOrderByClientOid", - "x-sdk-method-description": "This endpoint can be used to obtain information for a single Spot order using the client order id. After the user successfully places an order, the order is in Active state, and the user can use inOrderBook to determine whether the order has entered the order. Canceled or fully filled orders are marked as completed Done status.", + "x-sdk-method-name": "getOcoOrderByOrderId", + "x-sdk-method-description": "Request via this interface to get a oco order information via the order ID.", "x-api-rate-limit": 2, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"id\\\": \\\"6717422bd51c29000775ea03\\\",\\n \\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\",\\n \\\"symbol\\\": \\\"BTC-USDT\\\",\\n \\\"opType\\\": \\\"DEAL\\\",\\n \\\"type\\\": \\\"limit\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"price\\\": \\\"70000\\\",\\n \\\"size\\\": \\\"0.00001\\\",\\n \\\"funds\\\": \\\"0.7\\\",\\n \\\"dealSize\\\": \\\"0.00001\\\",\\n \\\"dealFunds\\\": \\\"0.677176\\\",\\n \\\"remainSize\\\": \\\"0\\\",\\n \\\"remainFunds\\\": \\\"0.022824\\\",\\n \\\"cancelledSize\\\": \\\"0\\\",\\n \\\"cancelledFunds\\\": \\\"0\\\",\\n \\\"fee\\\": \\\"0.000677176\\\",\\n \\\"feeCurrency\\\": \\\"USDT\\\",\\n \\\"stp\\\": null,\\n \\\"timeInForce\\\": \\\"GTC\\\",\\n \\\"postOnly\\\": false,\\n \\\"hidden\\\": false,\\n \\\"iceberg\\\": false,\\n \\\"visibleSize\\\": \\\"0\\\",\\n \\\"cancelAfter\\\": 0,\\n \\\"channel\\\": \\\"API\\\",\\n \\\"remark\\\": \\\"order remarks\\\",\\n \\\"tags\\\": null,\\n \\\"cancelExist\\\": false,\\n \\\"tradeType\\\": \\\"TRADE\\\",\\n \\\"inOrderBook\\\": false,\\n \\\"active\\\": false,\\n \\\"tax\\\": \\\"0\\\",\\n \\\"createdAt\\\": 1729577515444,\\n \\\"lastUpdatedAt\\\": 1729577515481\\n }\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\"}" - }, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"orderId\\\": \\\"674c3b6e688dea0007c7bab2\\\",\\n \\\"symbol\\\": \\\"BTC-USDT\\\",\\n \\\"clientOid\\\": \\\"5c52e1203aa6f37f1e493fb\\\",\\n \\\"orderTime\\\": 1733049198863,\\n \\\"status\\\": \\\"NEW\\\"\\n }\\n}", + "x-request-example": "{\\\"orderId\\\": \\\"674c3b6e688dea0007c7bab2\\\"}" + } + }, + "/api/v3/oco/client-order/{clientOid}": { "delete": { - "summary": "Cancel Order By ClientOid", - "deprecated": false, - "description": "This endpoint can be used to cancel a spot order by clientOid. This endpoint only sends cancellation requests. The results of the requests must be obtained by checking the order status or subscribing to websocket.", + "summary": "Cancel OCO Order By ClientOid", + "deprecated": true, + "description": "Request via this interface to cancel a stop order via the clientOid. You will receive cancelledOrderIds field once the system has received the cancellation request. The cancellation request will be processed by the matching engine in sequence. To know if the request is processed (successfully or not), you may check the order status or the update message from the pushes.", "tags": [], "parameters": [ { @@ -5244,20 +5588,6 @@ "schema": { "type": "string" } - }, - { - "name": "symbol", - "in": "query", - "description": "symbol", - "required": true, - "schema": { - "type": "string", - "example": [ - "BTC-USDT", - "ETH-USDT", - "KCS-USDT" - ] - } } ], "responses": { @@ -5274,13 +5604,16 @@ "data": { "type": "object", "properties": { - "clientOid": { - "type": "string", - "description": "Client Order Id,unique identifier created by the user" + "cancelledOrderIds": { + "type": "array", + "items": { + "type": "string" + }, + "description": "List of two order IDs related to the canceled OCO order" } }, "required": [ - "clientOid" + "cancelledOrderIds" ] } }, @@ -5293,55 +5626,30 @@ } } }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470184", - "x-abandon": "normal", + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470355", + "x-abandon": "abandon", "x-domain": "Spot", "x-api-channel": "Private", "x-api-permission": "Spot", "x-api-rate-limit-pool": "Spot", "x-sdk-service": "Spot", "x-sdk-sub-service": "Order", - "x-sdk-method-name": "cancelOrderByClientOid", - "x-sdk-method-description": "This endpoint can be used to cancel a spot order by clientOid. This endpoint only sends cancellation requests. The results of the requests must be obtained by checking the order status or subscribing to websocket.", - "x-api-rate-limit": 1, - "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"clientOid\\\":\\\"5c52e11203aa677f33e493fb\\\"}}", - "x-request-example": "{\\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\", \\\"symbol\\\": \\\"BTC-USDT\\\"}" - } - }, - "/api/v1/hf/orders/cancel/{orderId}": { - "delete": { - "summary": "Cancel Partial Order", - "deprecated": false, - "description": "This interface can cancel the specified quantity of the order according to the orderId. The order execution order is: price first, time first, this interface will not change the queue order", + "x-sdk-method-name": "cancelOcoOrderByClientOid", + "x-sdk-method-description": "Request via this interface to cancel a stop order via the clientOid. You will receive cancelledOrderIds field once the system has received the cancellation request. The cancellation request will be processed by the matching engine in sequence. To know if the request is processed (successfully or not), you may check the order status or the update message from the pushes.", + "x-api-rate-limit": 3, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"cancelledOrderIds\\\": [\\n \\\"vs93gpqc6r0mkk57003gok3h\\\",\\n \\\"vs93gpqc6r0mkk57003gok3i\\\"\\n ]\\n }\\n}", + "x-request-example": "{\\\"clientOid\\\": \\\"5c52e11203aa67f1e493fb\\\"}" + }, + "get": { + "summary": "Get OCO Order By ClientOid", + "deprecated": true, + "description": "Request via this interface to get a oco order information via the client order ID.", "tags": [], "parameters": [ { - "name": "orderId", + "name": "clientOid", "in": "path", - "description": "The unique order id generated by the trading system", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "symbol", - "in": "query", - "description": "symbol", - "required": true, - "schema": { - "type": "string", - "example": [ - "BTC-USDT", - "ETH-USDT", - "KCS-USDT" - ] - } - }, - { - "name": "cancelSize", - "in": "query", - "description": "The size you want cancel", + "description": "Client Order Id,unique identifier created by the user", "required": true, "schema": { "type": "string" @@ -5362,18 +5670,34 @@ "data": { "type": "object", "properties": { + "symbol": { + "type": "string", + "description": "symbol" + }, + "clientOid": { + "type": "string", + "description": "Client Order Id" + }, "orderId": { "type": "string", - "description": "order id" + "description": "The unique order id generated by the trading system,which can be used later for further actions such as canceling the order." }, - "cancelSize": { + "orderTime": { + "type": "integer", + "description": "Order placement time, milliseconds", + "format": "int64" + }, + "status": { "type": "string", - "description": "The size you canceled" + "description": "Order status: NEW: New, DONE: Completed, TRIGGERED: Triggered, CANCELLED: Cancelled" } }, "required": [ "orderId", - "cancelSize" + "symbol", + "clientOid", + "orderTime", + "status" ] } }, @@ -5386,47 +5710,42 @@ } } }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470183", - "x-abandon": "normal", + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470358", + "x-abandon": "abandon", "x-domain": "Spot", "x-api-channel": "Private", - "x-api-permission": "Spot", + "x-api-permission": "General", "x-api-rate-limit-pool": "Spot", "x-sdk-service": "Spot", "x-sdk-sub-service": "Order", - "x-sdk-method-name": "cancelPartialOrder", - "x-sdk-method-description": "This interface can cancel the specified quantity of the order according to the orderId. The order execution order is: price first, time first, this interface will not change the queue order", + "x-sdk-method-name": "getOcoOrderByClientOid", + "x-sdk-method-description": "Request via this interface to get a oco order information via the client order ID.", "x-api-rate-limit": 2, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"orderId\\\": \\\"6711f73c1ef16c000717bb31\\\",\\n \\\"cancelSize\\\": \\\"0.00001\\\"\\n }\\n}", - "x-request-example": "{\\\"orderId\\\": \\\"6711f73c1ef16c000717bb31\\\", \\\"symbol\\\": \\\"BTC-USDT\\\", \\\"cancelSize\\\": \\\"0.00001\\\"}" + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"orderId\\\": \\\"674c3cfa72cf2800072ee7ce\\\",\\n \\\"symbol\\\": \\\"BTC-USDT\\\",\\n \\\"clientOid\\\": \\\"5c52e1203aa6f3g7f1e493fb\\\",\\n \\\"orderTime\\\": 1733049594803,\\n \\\"status\\\": \\\"NEW\\\"\\n }\\n}", + "x-request-example": "{\\\"clientOid\\\": \\\"5c52e1203aa6f3g7f1e493fb\\\"}" } }, - "/api/v1/stop-order/cancelOrderByClientOid": { + "/api/v3/oco/orders": { "delete": { - "summary": "Cancel Stop Order By ClientOid", + "summary": "Batch Cancel OCO Order", "deprecated": true, - "description": "This endpoint can be used to cancel a spot stop order by clientOid. ", + "description": "This interface can batch cancel OCO orders through orderIds. You will receive cancelledOrderIds field once the system has received the cancellation request. The cancellation request will be processed by the matching engine in sequence. To know if the request is processed (successfully or not), you may check the order status or the update message from the pushes.", "tags": [], "parameters": [ { - "name": "symbol", + "name": "orderIds", "in": "query", - "description": "symbol", + "description": "Specify the order id, there can be multiple orders, separated by commas. If not passed, all oco orders will be canceled by default.", "required": false, "schema": { - "type": "string", - "example": [ - "BTC-USDT", - "ETH-USDT", - "KCS-USDT" - ] + "type": "string" } }, { - "name": "clientOid", + "name": "symbol", "in": "query", - "description": "Unique order id created by users to identify their orders", - "required": true, + "description": "trading pair. If not passed, the oco orders of all symbols will be canceled by default.", + "required": false, "schema": { "type": "string" } @@ -5446,18 +5765,16 @@ "data": { "type": "object", "properties": { - "clientOid": { - "type": "string", - "description": "Client Order Id,unique identifier created by the user" - }, - "cancelledOrderId": { - "type": "string", - "description": "Unique ID of the cancelled order" + "cancelledOrderIds": { + "type": "array", + "items": { + "type": "string" + }, + "description": "List of two order IDs related to the canceled OCO order" } }, "required": [ - "clientOid", - "cancelledOrderId" + "cancelledOrderIds" ] } }, @@ -5470,7 +5787,7 @@ } } }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470336", + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470356", "x-abandon": "abandon", "x-domain": "Spot", "x-api-channel": "Private", @@ -5478,34 +5795,23 @@ "x-api-rate-limit-pool": "Spot", "x-sdk-service": "Spot", "x-sdk-sub-service": "Order", - "x-sdk-method-name": "cancelStopOrderByClientOid", - "x-sdk-method-description": "This endpoint can be used to cancel a spot stop order by clientOid. ", - "x-api-rate-limit": 5, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"cancelledOrderId\\\": \\\"vs8hoo8ksc8mario0035a74n\\\",\\n \\\"clientOid\\\": \\\"689ff597f4414061aa819cc414836abd\\\"\\n }\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"clientOid\\\": \\\"689ff597f4414061aa819cc414836abd\\\"}" - } - }, - "/api/v1/hf/orders/sync/{orderId}": { - "delete": { - "summary": "Cancel Order By OrderId Sync", - "deprecated": false, - "description": "This endpoint can be used to cancel a spot order by orderId.", + "x-sdk-method-name": "batchCancelOcoOrders", + "x-sdk-method-description": "This interface can batch cancel OCO orders through orderIds. You will receive cancelledOrderIds field once the system has received the cancellation request. The cancellation request will be processed by the matching engine in sequence. To know if the request is processed (successfully or not), you may check the order status or the update message from the pushes.", + "x-api-rate-limit": 3, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"cancelledOrderIds\\\": [\\n \\\"vs93gpqc750mkk57003gok6i\\\",\\n \\\"vs93gpqc750mkk57003gok6j\\\",\\n \\\"vs93gpqc75c39p83003tnriu\\\",\\n \\\"vs93gpqc75c39p83003tnriv\\\"\\n ]\\n }\\n}", + "x-request-example": "{\\\"orderIds\\\": \\\"674c388172cf2800072ee746,674c38bdfd8300000795167e\\\", \\\"symbol\\\": \\\"BTC-USDT\\\"}" + }, + "get": { + "summary": "Get OCO Order List", + "deprecated": true, + "description": "Request via this endpoint to get your current OCO order list. Items are paginated and sorted to show the latest first. See the Pagination section for retrieving additional entries after the first page.", "tags": [], "parameters": [ - { - "name": "orderId", - "in": "path", - "description": "The unique order id generated by the trading system", - "required": true, - "schema": { - "type": "string" - } - }, { "name": "symbol", "in": "query", "description": "symbol", - "required": true, + "required": false, "schema": { "type": "string", "example": [ @@ -5514,6 +5820,57 @@ "KCS-USDT" ] } + }, + { + "name": "startAt", + "in": "query", + "description": "Start time (milliseconds)", + "required": false, + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "endAt", + "in": "query", + "description": "End time (milliseconds)", + "required": false, + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "orderIds", + "in": "query", + "description": "Specify orderId collection, up to 500 orders\n", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "pageSize", + "in": "query", + "description": "Size per page, minimum value 10, maximum value 500", + "required": false, + "schema": { + "type": "integer", + "minimum": 10, + "maximum": 500, + "default": 50 + } + }, + { + "name": "currentPage", + "in": "query", + "description": "Page number, minimum value 1\n", + "required": false, + "schema": { + "type": "integer", + "default": 1 + } } ], "responses": { @@ -5530,54 +5887,89 @@ "data": { "type": "object", "properties": { - "orderId": { - "type": "string", - "description": "order id" - }, - "originSize": { - "type": "string", - "description": "original order size" + "currentPage": { + "type": "integer" }, - "dealSize": { - "type": "string", - "description": "deal size" + "pageSize": { + "type": "integer" }, - "remainSize": { - "type": "string", - "description": "remain size" + "totalNum": { + "type": "integer" }, - "canceledSize": { - "type": "string", - "description": "Cumulative canceled size" + "totalPage": { + "type": "integer" }, - "status": { - "type": "string", - "description": "Order Status. open:order is active; done:order has been completed", - "enum": [ - "open", - "done" - ], - "x-api-enum": [ - { - "value": "open", - "name": "", - "description": "" + "items": { + "type": "array", + "items": { + "type": "object", + "properties": { + "orderId": { + "type": "string", + "description": "The unique order id generated by the trading system,which can be used later for further actions such as canceling the order." + }, + "symbol": { + "type": "string", + "description": "symbol" + }, + "clientOid": { + "type": "string", + "description": "Client Order Id" + }, + "orderTime": { + "type": "integer", + "description": "Order placement time, milliseconds", + "format": "int64" + }, + "status": { + "type": "string", + "description": "Order status: NEW: New, DONE: Completed, TRIGGERED: Triggered, CANCELLED: Cancelled", + "enum": [ + "NEW", + "DONE", + "TRIGGERED", + "CANCELLED" + ], + "x-api-enum": [ + { + "value": "NEW", + "name": "NEW", + "description": "New" + }, + { + "value": "DONE", + "name": "DONE", + "description": "Completed" + }, + { + "value": "TRIGGERED", + "name": "TRIGGERED", + "description": "Triggered" + }, + { + "value": "CANCELLED", + "name": "CANCELLED", + "description": "Cancelled" + } + ] + } }, - { - "value": "done", - "name": "", - "description": "" - } - ] + "required": [ + "orderId", + "symbol", + "clientOid", + "orderTime", + "status" + ] + } } }, "required": [ - "orderId", - "dealSize", - "remainSize", - "canceledSize", - "status", - "originSize" + "currentPage", + "pageSize", + "totalNum", + "totalPage", + "items" ] } }, @@ -5590,50 +5982,36 @@ } } }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470185", - "x-abandon": "normal", + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470360", + "x-abandon": "abandon", "x-domain": "Spot", "x-api-channel": "Private", - "x-api-permission": "Spot", + "x-api-permission": "General", "x-api-rate-limit-pool": "Spot", "x-sdk-service": "Spot", "x-sdk-sub-service": "Order", - "x-sdk-method-name": "cancelOrderByOrderIdSync", - "x-sdk-method-description": "This endpoint can be used to cancel a spot order by orderId.", - "x-api-rate-limit": 1, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"orderId\\\": \\\"671128ee365ccb0007534d45\\\",\\n \\\"originSize\\\": \\\"0.00001\\\",\\n \\\"dealSize\\\": \\\"0\\\",\\n \\\"remainSize\\\": \\\"0\\\",\\n \\\"canceledSize\\\": \\\"0.00001\\\",\\n \\\"status\\\": \\\"done\\\"\\n }\\n}", - "x-request-example": "{\\\"orderId\\\": \\\"671128ee365ccb0007534d45\\\", \\\"symbol\\\": \\\"BTC-USDT\\\"}" + "x-sdk-method-name": "getOcoOrderList", + "x-sdk-method-description": "Request via this endpoint to get your current OCO order list. Items are paginated and sorted to show the latest first. See the Pagination section for retrieving additional entries after the first page.", + "x-api-rate-limit": 2, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"currentPage\\\": 1,\\n \\\"pageSize\\\": 50,\\n \\\"totalNum\\\": 1,\\n \\\"totalPage\\\": 1,\\n \\\"items\\\": [\\n {\\n \\\"orderId\\\": \\\"674c3cfa72cf2800072ee7ce\\\",\\n \\\"symbol\\\": \\\"BTC-USDT\\\",\\n \\\"clientOid\\\": \\\"5c52e1203aa6f3g7f1e493fb\\\",\\n \\\"orderTime\\\": 1733049594803,\\n \\\"status\\\": \\\"NEW\\\"\\n }\\n ]\\n }\\n}", + "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"startAt\\\": 123456, \\\"endAt\\\": 123456, \\\"orderIds\\\": \\\"example_string_default_value\\\", \\\"pageSize\\\": 50, \\\"currentPage\\\": 1}" } }, - "/api/v1/hf/orders/sync/client-order/{clientOid}": { - "delete": { - "summary": "Cancel Order By ClientOid Sync", - "deprecated": false, - "description": "This endpoint can be used to cancel a spot order by orderId.", + "/api/v3/oco/order/details/{orderId}": { + "get": { + "summary": "Get OCO Order Detail By OrderId", + "deprecated": true, + "description": "Request via this interface to get a oco order detail via the order ID.", "tags": [], "parameters": [ { - "name": "clientOid", + "name": "orderId", "in": "path", - "description": "Client Order Id,unique identifier created by the user", + "description": "The unique order id generated by the trading system", "required": true, "schema": { "type": "string" } - }, - { - "name": "symbol", - "in": "query", - "description": "symbol", - "required": true, - "schema": { - "type": "string", - "example": [ - "BTC-USDT", - "ETH-USDT", - "KCS-USDT" - ] - } } ], "responses": { @@ -5650,54 +6028,73 @@ "data": { "type": "object", "properties": { - "clientOid": { - "type": "string", - "description": "Client Order Id,unique identifier created by the user" - }, - "originSize": { + "orderId": { "type": "string", - "description": "original order size" + "description": "The unique order id generated by the trading system,which can be used later for further actions such as canceling the order." }, - "dealSize": { + "symbol": { "type": "string", - "description": "deal size" + "description": "symbol" }, - "remainSize": { + "clientOid": { "type": "string", - "description": "remain size" + "description": "Client Order Id" }, - "canceledSize": { - "type": "string", - "description": "Cumulative canceled size" + "orderTime": { + "type": "integer", + "description": "Order placement time, milliseconds", + "format": "int64" }, "status": { - "type": "string", - "description": "Order Status. open:order is active; done:order has been completed", - "enum": [ - "open", - "done" - ], - "x-api-enum": [ - { - "value": "open", - "name": "", - "description": "" + "type": "string", + "description": "Order status: NEW: New, DONE: Completed, TRIGGERED: Triggered, CANCELLED: Cancelled" + }, + "orders": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "symbol": { + "type": "string" + }, + "side": { + "type": "string" + }, + "price": { + "type": "string" + }, + "stopPrice": { + "type": "string" + }, + "size": { + "type": "string" + }, + "status": { + "type": "string" + } }, - { - "value": "done", - "name": "", - "description": "" - } - ] + "required": [ + "id", + "symbol", + "side", + "price", + "stopPrice", + "size", + "status" + ] + } } }, "required": [ + "orderId", + "symbol", "clientOid", - "originSize", - "dealSize", - "remainSize", - "canceledSize", - "status" + "orderTime", + "status", + "orders" ] } }, @@ -5710,26 +6107,26 @@ } } }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470186", - "x-abandon": "normal", + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470359", + "x-abandon": "abandon", "x-domain": "Spot", "x-api-channel": "Private", - "x-api-permission": "Spot", + "x-api-permission": "General", "x-api-rate-limit-pool": "Spot", "x-sdk-service": "Spot", "x-sdk-sub-service": "Order", - "x-sdk-method-name": "cancelOrderByClientOidSync", - "x-sdk-method-description": "This endpoint can be used to cancel a spot order by orderId.", - "x-api-rate-limit": 1, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\",\\n \\\"originSize\\\": \\\"0.00001\\\",\\n \\\"dealSize\\\": \\\"0\\\",\\n \\\"remainSize\\\": \\\"0\\\",\\n \\\"canceledSize\\\": \\\"0.00001\\\",\\n \\\"status\\\": \\\"done\\\"\\n }\\n}", - "x-request-example": "{\\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\", \\\"symbol\\\": \\\"BTC-USDT\\\"}" + "x-sdk-method-name": "getOcoOrderDetailByOrderId", + "x-sdk-method-description": "Request via this interface to get a oco order detail via the order ID.", + "x-api-rate-limit": 2, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"orderId\\\": \\\"674c3b6e688dea0007c7bab2\\\",\\n \\\"symbol\\\": \\\"BTC-USDT\\\",\\n \\\"clientOid\\\": \\\"5c52e1203aa6f37f1e493fb\\\",\\n \\\"orderTime\\\": 1733049198863,\\n \\\"status\\\": \\\"NEW\\\",\\n \\\"orders\\\": [\\n {\\n \\\"id\\\": \\\"vs93gpqc7dn6h3fa003sfelj\\\",\\n \\\"symbol\\\": \\\"BTC-USDT\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"price\\\": \\\"94000.00000000000000000000\\\",\\n \\\"stopPrice\\\": \\\"94000.00000000000000000000\\\",\\n \\\"size\\\": \\\"0.10000000000000000000\\\",\\n \\\"status\\\": \\\"NEW\\\"\\n },\\n {\\n \\\"id\\\": \\\"vs93gpqc7dn6h3fa003sfelk\\\",\\n \\\"symbol\\\": \\\"BTC-USDT\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"price\\\": \\\"96000.00000000000000000000\\\",\\n \\\"stopPrice\\\": \\\"98000.00000000000000000000\\\",\\n \\\"size\\\": \\\"0.10000000000000000000\\\",\\n \\\"status\\\": \\\"NEW\\\"\\n }\\n ]\\n }\\n}", + "x-request-example": "{\\\"orderId\\\": \\\"674c3b6e688dea0007c7bab2\\\"}" } }, - "/api/v1/hf/orders/test": { + "/api/v1/orders": { "post": { - "summary": "Add Order Test", - "deprecated": false, - "description": "Order test endpoint, the request parameters and return parameters of this endpoint are exactly the same as the order endpoint, and can be used to verify whether the signature is correct and other operations. After placing an order, the order will not enter the matching system, and the order cannot be queried.", + "summary": "Add Order - Old", + "deprecated": true, + "description": "Place order to the Spot trading system, you can place two major types of orders: limit and market. Orders can only be placed if your account has sufficient funds. Once an order is placed, your funds will be put on hold for the duration of the order. The amount of funds on hold depends on the order type and parameters specified.", "tags": [], "parameters": [], "responses": { @@ -5749,15 +6146,10 @@ "orderId": { "type": "string", "description": "The unique order id generated by the trading system,which can be used later for further actions such as canceling the order." - }, - "clientOid": { - "type": "string", - "description": "The user self-defined order id." } }, "required": [ - "orderId", - "clientOid" + "orderId" ] } }, @@ -5770,17 +6162,17 @@ } } }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470187", - "x-abandon": "normal", + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470333", + "x-abandon": "abandon", "x-domain": "Spot", "x-api-channel": "Private", "x-api-permission": "Spot", "x-api-rate-limit-pool": "Spot", "x-sdk-service": "Spot", "x-sdk-sub-service": "Order", - "x-sdk-method-name": "addOrderTest", - "x-sdk-method-description": "Order test endpoint, the request parameters and return parameters of this endpoint are exactly the same as the order endpoint, and can be used to verify whether the signature is correct and other operations. After placing an order, the order will not enter the matching system, and the order cannot be queried.", - "x-api-rate-limit": 1, + "x-sdk-method-name": "addOrderOld", + "x-sdk-method-description": "Place order to the Spot trading system, you can place two major types of orders: limit and market. Orders can only be placed if your account has sufficient funds. Once an order is placed, your funds will be put on hold for the duration of the order. The amount of funds on hold depends on the order type and parameters specified.", + "x-api-rate-limit": 2, "requestBody": { "content": { "application/json": { @@ -5833,20 +6225,18 @@ "limit", "market" ], + "default": "limit", "x-api-enum": [ { "value": "limit", - "name": "", - "description": "" + "name": "limit", + "description": "limit order" }, { "value": "market", - "name": "", - "description": "" + "name": "market", + "description": "market order" } - ], - "example": [ - "limit" ] }, "remark": { @@ -5919,187 +6309,59 @@ "name": "", "description": "" }, - { - "value": "FOK", - "name": "", - "description": "" - } - ] - }, - "postOnly": { - "type": "boolean", - "default": false, - "description": "passive order labels, this is disabled when the order timing strategy is IOC or FOK" - }, - "hidden": { - "type": "boolean", - "description": "[Hidden order](https://www.kucoin.com/docs-new/doc-338146) or not (not shown in order book)", - "default": false - }, - "iceberg": { - "type": "boolean", - "description": "Whether or not only visible portions of orders are shown in [Iceberg orders](https://www.kucoin.com/docs-new/doc-338146)", - "default": false - }, - "visibleSize": { - "type": "string", - "description": "Maximum visible quantity in iceberg orders" - }, - "tags": { - "type": "string", - "description": "Order tag, length cannot exceed 20 characters (ASCII)" - }, - "cancelAfter": { - "type": "integer", - "format": "int64", - "description": "Cancel after n seconds,the order timing strategy is GTT" - }, - "funds": { - "type": "string", - "description": "When **type** is market, select one out of two: size or funds" - } - }, - "required": [ - "symbol", - "type", - "side" - ] - }, - "example": "//limit order\n{\n \"type\": \"limit\",\n \"symbol\": \"BTC-USDT\",\n \"side\": \"buy\",\n \"price\": \"50000\",\n \"size\": \"0.00001\",\n \"clientOid\": \"5c52e11203aa677f33e493f\",\n \"remark\": \"order remarks\"\n}\n\n//market order 1\n// {\n// \"type\": \"market\",\n// \"symbol\": \"BTC-USDT\",\n// \"side\": \"buy\",\n// \"size\": \"0.00001\",\n// \"clientOid\": \"5c52e11203aa677f33e493fc\",\n// \"remark\": \"order remarks\",\n// }\n\n//market order 2\n// {\n// \"type\": \"market\",\n// \"symbol\": \"BTC-USDT\",\n// \"side\": \"buy\",\n// \"funds\": \"1\",\n// \"clientOid\": \"5c52e11203aa677f33e493fc\",\n// \"remark\": \"order remarks\",\n// }\n" - } - } - }, - "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"orderId\\\":\\\"670fd33bf9406e0007ab3945\\\",\\\"clientOid\\\":\\\"5c52e11203aa677f33e493fb\\\"}}", - "x-request-example": "{\\\"type\\\": \\\"limit\\\", \\\"symbol\\\": \\\"BTC-USDT\\\", \\\"side\\\": \\\"buy\\\", \\\"price\\\": \\\"50000\\\", \\\"size\\\": \\\"0.00001\\\", \\\"clientOid\\\": \\\"5c52e11203aa677f33e493f\\\", \\\"remark\\\": \\\"order remarks\\\"}" - } - }, - "/api/v3/oco/order": { - "post": { - "summary": "Add OCO Order", - "deprecated": true, - "description": "Place OCO order to the Spot trading system", - "tags": [], - "parameters": [], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "data": { - "type": "object", - "properties": { - "orderId": { - "type": "string", - "description": "The unique order id generated by the trading system,which can be used later for further actions such as canceling the order." - } - }, - "required": [ - "orderId" - ] - } - }, - "required": [ - "code", - "data" - ] - } - } - } - } - }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470353", - "x-abandon": "abandon", - "x-domain": "Spot", - "x-api-channel": "Private", - "x-api-permission": "Spot", - "x-api-rate-limit-pool": "Spot", - "x-sdk-service": "Spot", - "x-sdk-sub-service": "Order", - "x-sdk-method-name": "addOcoOrder", - "x-sdk-method-description": "Place OCO order to the Spot trading system", - "x-api-rate-limit": 2, - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "clientOid": { - "type": "string", - "description": "Client Order Id,The ClientOid field is a unique ID created by the user(we recommend using a UUID), and can only contain numbers, letters, underscores (_), and hyphens (-). This field is returned when order information is obtained. You can use clientOid to tag your orders. ClientOid is different from the order ID created by the service provider. Please do not initiate requests using the same clientOid. The maximum length for the ClientOid is 40 characters.\n\nPlease remember the orderId created by the service provider, it used to check for updates in order status.", - "example": [ - "5c52e11203aa677f33e493fb" - ] - }, - "side": { - "type": "string", - "description": "specify if the order is to 'buy' or 'sell'", - "enum": [ - "buy", - "sell" - ], - "x-api-enum": [ - { - "value": "buy", - "name": "", - "description": "" - }, - { - "value": "sell", - "name": "", - "description": "" - } - ], - "example": [ - "buy" - ] - }, - "symbol": { - "type": "string", - "description": "symbol", - "example": [ - "BTC-USDT", - "ETH-USDT", - "KCS-USDT" + { + "value": "FOK", + "name": "", + "description": "" + } ] }, - "remark": { - "type": "string", - "description": "Order placement remarks, length cannot exceed 20 characters (ASCII)" + "postOnly": { + "type": "boolean", + "default": false, + "description": "passive order labels, this is disabled when the order timing strategy is IOC or FOK" }, - "price": { - "type": "string", - "description": "Specify price for order" + "hidden": { + "type": "boolean", + "description": "Hidden or not (not shown in order book)", + "default": false }, - "size": { - "type": "string", - "description": "Specify quantity for order" + "iceberg": { + "type": "boolean", + "description": "Whether or not only visible portions of orders are shown in iceberg orders", + "default": false }, - "stopPrice": { + "visibleSize": { "type": "string", - "description": "trigger price." + "description": "Maximum visible quantity in iceberg orders" }, - "limitPrice": { + "cancelAfter": { + "type": "integer", + "format": "int64", + "description": "Cancel after n seconds,the order timing strategy is GTT" + }, + "funds": { "type": "string", - "description": "The limit order price after take-profit and stop-loss are triggered." + "description": "When **type** is market, select one out of two: size or funds" }, "tradeType": { "type": "string", - "description": "Transaction Type, currently only supports TRADE (spot transactions), the default is TRADE", + "description": "The type of trading : **TRADE**(Spot Trade), **MARGIN_TRADE** (Margin Trade). Default is **TRADE**. **Note: To improve the system performance and to accelerate order placing and processing, KuCoin has added a new interface for order placing of margin. For traders still using the current interface, please move to the new one as soon as possible. The current one will no longer accept margin orders by May 1st, 2021 (UTC). At the time, KuCoin will notify users via the announcement, please pay attention to it.**", "enum": [ - "TRADE" + "TRADE", + "MARGIN_TRADE" ], + "default": "TRADE", "x-api-enum": [ { "value": "TRADE", "name": "TRADE", - "description": "Spot Trading" + "description": "Spot" + }, + { + "value": "MARGIN_TRADE", + "name": "MARGIN_TRADE", + "description": "Margin" } ] } @@ -6107,33 +6369,27 @@ "required": [ "symbol", "side", - "clientOid", - "price", - "size", - "stopPrice", - "limitPrice" + "clientOid" ] }, - "example": "{\n \"symbol\": \"BTC-USDT\",\n \"side\": \"buy\",\n \"price\": \"94000\",\n \"size\": \"0.1\",\n \"clientOid\": \"5c52e11203aa67f1e493fb\",\n \"stopPrice\": \"98000\",\n \"limitPrice\": \"96000\",\n \"remark\": \"this is remark\",\n \"tradeType\": \"TRADE\"\n}" + "example": "//limit order\n{\n \"type\": \"limit\",\n \"symbol\": \"BTC-USDT\",\n \"side\": \"buy\",\n \"price\": \"50000\",\n \"size\": \"0.00001\",\n \"clientOid\": \"5c52e11203aa677f33e493fb\",\n \"remark\": \"order remarks\"\n}\n\n//market order 1\n// {\n// \"type\": \"market\",\n// \"symbol\": \"BTC-USDT\",\n// \"side\": \"buy\",\n// \"size\": \"0.00001\",\n// \"clientOid\": \"5c52e11203aa677f33e493fc\",\n// \"remark\": \"order remarks\"\n// }\n\n//market order 2\n// {\n// \"type\": \"market\",\n// \"symbol\": \"BTC-USDT\",\n// \"side\": \"buy\",\n// \"funds\": \"1\",\n// \"clientOid\": \"5c52e11203aa677f33e493fc\",\n// \"remark\": \"order remarks\"\n// }\n" } } }, - "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"orderId\\\":\\\"674c316e688dea0007c7b986\\\"}}", - "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"side\\\": \\\"buy\\\", \\\"price\\\": \\\"94000\\\", \\\"size\\\": \\\"0.1\\\", \\\"clientOid\\\": \\\"5c52e11203aa67f1e493fb\\\", \\\"stopPrice\\\": \\\"98000\\\", \\\"limitPrice\\\": \\\"96000\\\", \\\"remark\\\": \\\"this is remark\\\", \\\"tradeType\\\": \\\"TRADE\\\"}" - } - }, - "/api/v1/orders/{orderId}": { + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"orderId\\\": \\\"674a8635b38d120007709c0f\\\"\\n }\\n}", + "x-request-example": "{\\\"type\\\": \\\"limit\\\", \\\"symbol\\\": \\\"BTC-USDT\\\", \\\"side\\\": \\\"buy\\\", \\\"price\\\": \\\"50000\\\", \\\"size\\\": \\\"0.00001\\\", \\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\", \\\"remark\\\": \\\"order remarks\\\"}" + }, "delete": { - "summary": "Cancel Order By OrderId - Old", + "summary": "Batch Cancel Order - Old", "deprecated": true, - "description": "This endpoint can be used to cancel a spot order by orderId. This endpoint only sends cancellation requests. The results of the requests must be obtained by checking the order status or subscribing to websocket.", + "description": "Request via this endpoint to cancel all open orders. The response is a list of ids of the canceled orders.", "tags": [], "parameters": [ { "name": "symbol", "in": "query", "description": "symbol", - "required": true, + "required": false, "schema": { "type": "string", "example": [ @@ -6144,217 +6400,61 @@ } }, { - "name": "orderId", - "in": "path", - "description": "The unique order id generated by the trading system", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "data": { - "type": "object", - "properties": { - "cancelledOrderIds": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": [ - "cancelledOrderIds" - ] - } - }, - "required": [ - "code", - "data" - ] - } - } - } - } - }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470343", - "x-abandon": "abandon", - "x-domain": "Spot", - "x-api-channel": "Private", - "x-api-permission": "Spot", - "x-api-rate-limit-pool": "Spot", - "x-sdk-service": "Spot", - "x-sdk-sub-service": "Order", - "x-sdk-method-name": "cancelOrderByOrderIdOld", - "x-sdk-method-description": "This endpoint can be used to cancel a spot order by orderId. This endpoint only sends cancellation requests. The results of the requests must be obtained by checking the order status or subscribing to websocket.", - "x-api-rate-limit": 3, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"cancelledOrderIds\\\": [\\n \\\"674a97dfef434f0007efc431\\\"\\n ]\\n }\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"orderId\\\": \\\"674a97dfef434f0007efc431\\\"}" - }, - "get": { - "summary": "Get Order By OrderId - Old", - "deprecated": true, - "description": "Request via this endpoint to get a single order info by order ID.", - "tags": [], - "parameters": [ - { - "name": "orderId", - "in": "path", - "description": "The unique order id generated by the trading system", - "required": true, + "name": "tradeType", + "in": "query", + "description": "The type of trading :TRADE(Spot Trading), MARGIN_TRADE(Cross Margin Trading), MARGIN_ISOLATED_TRADE(Isolated Margin Trading), and the default is TRADE to cancel the spot trading orders.", + "required": false, "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "data": { - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "symbol": { - "type": "string" - }, - "opType": { - "type": "string" - }, - "type": { - "type": "string" - }, - "side": { - "type": "string" - }, - "price": { - "type": "string" - }, - "size": { - "type": "string" - }, - "funds": { - "type": "string" - }, - "dealFunds": { - "type": "string" - }, - "dealSize": { - "type": "string" - }, - "fee": { - "type": "string" - }, - "feeCurrency": { - "type": "string" - }, - "stp": { - "type": "string" - }, - "stop": { - "type": "string" - }, - "stopTriggered": { - "type": "boolean" - }, - "stopPrice": { - "type": "string" - }, - "timeInForce": { - "type": "string" - }, - "postOnly": { - "type": "boolean" - }, - "hidden": { - "type": "boolean" - }, - "iceberg": { - "type": "boolean" - }, - "visibleSize": { - "type": "string" - }, - "cancelAfter": { - "type": "integer" - }, - "channel": { - "type": "string" - }, - "clientOid": { - "type": "string" - }, - "remark": { - "type": "string" - }, - "tags": { - "type": "string" - }, - "isActive": { - "type": "boolean" - }, - "cancelExist": { - "type": "boolean" - }, - "createdAt": { - "type": "integer", - "format": "int64" - }, - "tradeType": { - "type": "string" + "type": "string", + "enum": [ + "TRADE", + "MARGIN_TRADE", + "MARGIN_ISOLATED_TRADE" + ], + "default": "TRADE", + "x-api-enum": [ + { + "value": "TRADE", + "name": "TRADE", + "description": "Spot Trading" + }, + { + "value": "MARGIN_TRADE", + "name": "MARGIN_TRADE", + "description": "Cross Margin Trading" + }, + { + "value": "MARGIN_ISOLATED_TRADE", + "name": "MARGIN_ISOLATED_TRADE", + "description": "Isolated Margin Trading" + } + ] + } + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "object", + "properties": { + "cancelledOrderIds": { + "type": "array", + "items": { + "type": "string" + } } }, "required": [ - "id", - "symbol", - "opType", - "type", - "side", - "price", - "size", - "funds", - "dealFunds", - "dealSize", - "fee", - "feeCurrency", - "stp", - "stop", - "stopTriggered", - "stopPrice", - "timeInForce", - "postOnly", - "hidden", - "iceberg", - "visibleSize", - "cancelAfter", - "channel", - "clientOid", - "remark", - "tags", - "isActive", - "cancelExist", - "createdAt", - "tradeType" + "cancelledOrderIds" ] } }, @@ -6367,22 +6467,20 @@ } } }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470348", + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470345", "x-abandon": "abandon", "x-domain": "Spot", "x-api-channel": "Private", - "x-api-permission": "General", + "x-api-permission": "Spot", "x-api-rate-limit-pool": "Spot", "x-sdk-service": "Spot", "x-sdk-sub-service": "Order", - "x-sdk-method-name": "getOrderByOrderIdOld", - "x-sdk-method-description": "Request via this endpoint to get a single order info by order ID.", - "x-api-rate-limit": 2, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"id\\\": \\\"674a97dfef434f0007efc431\\\",\\n \\\"symbol\\\": \\\"BTC-USDT\\\",\\n \\\"opType\\\": \\\"DEAL\\\",\\n \\\"type\\\": \\\"limit\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"price\\\": \\\"50000\\\",\\n \\\"size\\\": \\\"0.0001\\\",\\n \\\"funds\\\": \\\"0\\\",\\n \\\"dealFunds\\\": \\\"0\\\",\\n \\\"dealSize\\\": \\\"0\\\",\\n \\\"fee\\\": \\\"0\\\",\\n \\\"feeCurrency\\\": \\\"USDT\\\",\\n \\\"stp\\\": \\\"\\\",\\n \\\"stop\\\": \\\"\\\",\\n \\\"stopTriggered\\\": false,\\n \\\"stopPrice\\\": \\\"0\\\",\\n \\\"timeInForce\\\": \\\"GTC\\\",\\n \\\"postOnly\\\": false,\\n \\\"hidden\\\": false,\\n \\\"iceberg\\\": false,\\n \\\"visibleSize\\\": \\\"0\\\",\\n \\\"cancelAfter\\\": 0,\\n \\\"channel\\\": \\\"API\\\",\\n \\\"clientOid\\\": \\\"3d07008668054da6b3cb12e432c2b13a\\\",\\n \\\"remark\\\": null,\\n \\\"tags\\\": null,\\n \\\"isActive\\\": false,\\n \\\"cancelExist\\\": true,\\n \\\"createdAt\\\": 1732941791518,\\n \\\"tradeType\\\": \\\"TRADE\\\"\\n }\\n}", - "x-request-example": "{\\\"orderId\\\": \\\"674a97dfef434f0007efc431\\\"}" - } - }, - "/api/v1/orders": { + "x-sdk-method-name": "batchCancelOrderOld", + "x-sdk-method-description": "Request via this endpoint to cancel all open orders. The response is a list of ids of the canceled orders.", + "x-api-rate-limit": 20, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"cancelledOrderIds\\\": [\\n \\\"674a8635b38d120007709c0f\\\",\\n \\\"674a8630439c100007d3bce1\\\"\\n ]\\n }\\n}", + "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"tradeType\\\": \\\"TRADE\\\"}" + }, "get": { "summary": "Get Orders List - Old", "deprecated": true, @@ -6665,173 +6763,71 @@ }, "channel": { "type": "string" - }, - "clientOid": { - "type": "string" - }, - "remark": { - "type": "string" - }, - "tags": { - "type": "string" - }, - "isActive": { - "type": "boolean" - }, - "cancelExist": { - "type": "boolean" - }, - "createdAt": { - "type": "integer", - "format": "int64" - }, - "tradeType": { - "type": "string" - } - }, - "required": [ - "id", - "symbol", - "opType", - "type", - "side", - "price", - "size", - "funds", - "dealFunds", - "dealSize", - "fee", - "feeCurrency", - "stp", - "stop", - "stopTriggered", - "stopPrice", - "timeInForce", - "postOnly", - "hidden", - "iceberg", - "visibleSize", - "cancelAfter", - "channel", - "clientOid", - "remark", - "tags", - "isActive", - "cancelExist", - "createdAt", - "tradeType" - ] - } - } - }, - "required": [ - "currentPage", - "pageSize", - "totalNum", - "totalPage", - "items" - ] - } - }, - "required": [ - "code", - "data" - ] - } - } - } - } - }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470346", - "x-abandon": "abandon", - "x-domain": "Spot", - "x-api-channel": "Private", - "x-api-permission": "General", - "x-api-rate-limit-pool": "Spot", - "x-sdk-service": "Spot", - "x-sdk-sub-service": "Order", - "x-sdk-method-name": "getOrdersListOld", - "x-sdk-method-description": "Request via this endpoint to get your current order list. The return value is the data after Pagination, sorted in descending order according to time.", - "x-api-rate-limit": 2, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"currentPage\\\": 1,\\n \\\"pageSize\\\": 50,\\n \\\"totalNum\\\": 1,\\n \\\"totalPage\\\": 1,\\n \\\"items\\\": [\\n {\\n \\\"id\\\": \\\"674a9a872033a50007e2790d\\\",\\n \\\"symbol\\\": \\\"BTC-USDT\\\",\\n \\\"opType\\\": \\\"DEAL\\\",\\n \\\"type\\\": \\\"limit\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"price\\\": \\\"50000\\\",\\n \\\"size\\\": \\\"0.00001\\\",\\n \\\"funds\\\": \\\"0\\\",\\n \\\"dealFunds\\\": \\\"0\\\",\\n \\\"dealSize\\\": \\\"0\\\",\\n \\\"fee\\\": \\\"0\\\",\\n \\\"feeCurrency\\\": \\\"USDT\\\",\\n \\\"stp\\\": \\\"\\\",\\n \\\"stop\\\": \\\"\\\",\\n \\\"stopTriggered\\\": false,\\n \\\"stopPrice\\\": \\\"0\\\",\\n \\\"timeInForce\\\": \\\"GTC\\\",\\n \\\"postOnly\\\": false,\\n \\\"hidden\\\": false,\\n \\\"iceberg\\\": false,\\n \\\"visibleSize\\\": \\\"0\\\",\\n \\\"cancelAfter\\\": 0,\\n \\\"channel\\\": \\\"API\\\",\\n \\\"clientOid\\\": \\\"5c52e11203aa677f33e4923fb\\\",\\n \\\"remark\\\": \\\"order remarks\\\",\\n \\\"tags\\\": null,\\n \\\"isActive\\\": false,\\n \\\"cancelExist\\\": true,\\n \\\"createdAt\\\": 1732942471752,\\n \\\"tradeType\\\": \\\"TRADE\\\"\\n }\\n ]\\n }\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"status\\\": \\\"active\\\", \\\"side\\\": \\\"buy\\\", \\\"type\\\": \\\"limit\\\", \\\"tradeType\\\": \\\"TRADE\\\", \\\"startAt\\\": 123456, \\\"endAt\\\": 123456, \\\"currentPage\\\": 1, \\\"pageSize\\\": 50}" - }, - "delete": { - "summary": "Batch Cancel Order - Old", - "deprecated": true, - "description": "Request via this endpoint to cancel all open orders. The response is a list of ids of the canceled orders.", - "tags": [], - "parameters": [ - { - "name": "symbol", - "in": "query", - "description": "symbol", - "required": false, - "schema": { - "type": "string", - "example": [ - "BTC-USDT", - "ETH-USDT", - "KCS-USDT" - ] - } - }, - { - "name": "tradeType", - "in": "query", - "description": "The type of trading :TRADE(Spot Trading), MARGIN_TRADE(Cross Margin Trading), MARGIN_ISOLATED_TRADE(Isolated Margin Trading), and the default is TRADE to cancel the spot trading orders.", - "required": false, - "schema": { - "type": "string", - "enum": [ - "TRADE", - "MARGIN_TRADE", - "MARGIN_ISOLATED_TRADE" - ], - "default": "TRADE", - "x-api-enum": [ - { - "value": "TRADE", - "name": "TRADE", - "description": "Spot Trading" - }, - { - "value": "MARGIN_TRADE", - "name": "MARGIN_TRADE", - "description": "Cross Margin Trading" - }, - { - "value": "MARGIN_ISOLATED_TRADE", - "name": "MARGIN_ISOLATED_TRADE", - "description": "Isolated Margin Trading" - } - ] - } - } - ], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "data": { - "type": "object", - "properties": { - "cancelledOrderIds": { - "type": "array", - "items": { - "type": "string" + }, + "clientOid": { + "type": "string" + }, + "remark": { + "type": "string" + }, + "tags": { + "type": "string" + }, + "isActive": { + "type": "boolean" + }, + "cancelExist": { + "type": "boolean" + }, + "createdAt": { + "type": "integer", + "format": "int64" + }, + "tradeType": { + "type": "string" + } + }, + "required": [ + "id", + "symbol", + "opType", + "type", + "side", + "price", + "size", + "funds", + "dealFunds", + "dealSize", + "fee", + "feeCurrency", + "stp", + "stop", + "stopTriggered", + "stopPrice", + "timeInForce", + "postOnly", + "hidden", + "iceberg", + "visibleSize", + "cancelAfter", + "channel", + "clientOid", + "remark", + "tags", + "isActive", + "cancelExist", + "createdAt", + "tradeType" + ] } } }, "required": [ - "cancelledOrderIds" + "currentPage", + "pageSize", + "totalNum", + "totalPage", + "items" ] } }, @@ -6844,24 +6840,26 @@ } } }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470345", + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470346", "x-abandon": "abandon", "x-domain": "Spot", "x-api-channel": "Private", - "x-api-permission": "Spot", + "x-api-permission": "General", "x-api-rate-limit-pool": "Spot", "x-sdk-service": "Spot", "x-sdk-sub-service": "Order", - "x-sdk-method-name": "batchCancelOrderOld", - "x-sdk-method-description": "Request via this endpoint to cancel all open orders. The response is a list of ids of the canceled orders.", - "x-api-rate-limit": 20, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"cancelledOrderIds\\\": [\\n \\\"674a8635b38d120007709c0f\\\",\\n \\\"674a8630439c100007d3bce1\\\"\\n ]\\n }\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"tradeType\\\": \\\"TRADE\\\"}" - }, + "x-sdk-method-name": "getOrdersListOld", + "x-sdk-method-description": "Request via this endpoint to get your current order list. The return value is the data after Pagination, sorted in descending order according to time.", + "x-api-rate-limit": 2, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"currentPage\\\": 1,\\n \\\"pageSize\\\": 50,\\n \\\"totalNum\\\": 1,\\n \\\"totalPage\\\": 1,\\n \\\"items\\\": [\\n {\\n \\\"id\\\": \\\"674a9a872033a50007e2790d\\\",\\n \\\"symbol\\\": \\\"BTC-USDT\\\",\\n \\\"opType\\\": \\\"DEAL\\\",\\n \\\"type\\\": \\\"limit\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"price\\\": \\\"50000\\\",\\n \\\"size\\\": \\\"0.00001\\\",\\n \\\"funds\\\": \\\"0\\\",\\n \\\"dealFunds\\\": \\\"0\\\",\\n \\\"dealSize\\\": \\\"0\\\",\\n \\\"fee\\\": \\\"0\\\",\\n \\\"feeCurrency\\\": \\\"USDT\\\",\\n \\\"stp\\\": \\\"\\\",\\n \\\"stop\\\": \\\"\\\",\\n \\\"stopTriggered\\\": false,\\n \\\"stopPrice\\\": \\\"0\\\",\\n \\\"timeInForce\\\": \\\"GTC\\\",\\n \\\"postOnly\\\": false,\\n \\\"hidden\\\": false,\\n \\\"iceberg\\\": false,\\n \\\"visibleSize\\\": \\\"0\\\",\\n \\\"cancelAfter\\\": 0,\\n \\\"channel\\\": \\\"API\\\",\\n \\\"clientOid\\\": \\\"5c52e11203aa677f33e4923fb\\\",\\n \\\"remark\\\": \\\"order remarks\\\",\\n \\\"tags\\\": null,\\n \\\"isActive\\\": false,\\n \\\"cancelExist\\\": true,\\n \\\"createdAt\\\": 1732942471752,\\n \\\"tradeType\\\": \\\"TRADE\\\"\\n }\\n ]\\n }\\n}", + "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"status\\\": \\\"active\\\", \\\"side\\\": \\\"buy\\\", \\\"type\\\": \\\"limit\\\", \\\"tradeType\\\": \\\"TRADE\\\", \\\"startAt\\\": 123456, \\\"endAt\\\": 123456, \\\"currentPage\\\": 1, \\\"pageSize\\\": 50}" + } + }, + "/api/v1/orders/test": { "post": { - "summary": "Add Order - Old", + "summary": "Add Order Test - Old", "deprecated": true, - "description": "Place order to the Spot trading system, you can place two major types of orders: limit and market. Orders can only be placed if your account has sufficient funds. Once an order is placed, your funds will be put on hold for the duration of the order. The amount of funds on hold depends on the order type and parameters specified.", + "description": "Order test endpoint, the request parameters and return parameters of this endpoint are exactly the same as the order endpoint, and can be used to verify whether the signature is correct and other operations. After placing an order, the order will not enter the matching system, and the order cannot be queried.", "tags": [], "parameters": [], "responses": { @@ -6897,7 +6895,7 @@ } } }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470333", + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470341", "x-abandon": "abandon", "x-domain": "Spot", "x-api-channel": "Private", @@ -6905,8 +6903,8 @@ "x-api-rate-limit-pool": "Spot", "x-sdk-service": "Spot", "x-sdk-sub-service": "Order", - "x-sdk-method-name": "addOrderOld", - "x-sdk-method-description": "Place order to the Spot trading system, you can place two major types of orders: limit and market. Orders can only be placed if your account has sufficient funds. Once an order is placed, your funds will be put on hold for the duration of the order. The amount of funds on hold depends on the order type and parameters specified.", + "x-sdk-method-name": "addOrderTestOld", + "x-sdk-method-description": "Order test endpoint, the request parameters and return parameters of this endpoint are exactly the same as the order endpoint, and can be used to verify whether the signature is correct and other operations. After placing an order, the order will not enter the matching system, and the order cannot be queried.", "x-api-rate-limit": 2, "requestBody": { "content": { @@ -7039,253 +7037,509 @@ "name": "", "description": "" }, - { - "value": "IOC", - "name": "", - "description": "" + { + "value": "IOC", + "name": "", + "description": "" + }, + { + "value": "FOK", + "name": "", + "description": "" + } + ] + }, + "postOnly": { + "type": "boolean", + "default": false, + "description": "passive order labels, this is disabled when the order timing strategy is IOC or FOK" + }, + "hidden": { + "type": "boolean", + "description": "Hidden or not (not shown in order book)", + "default": false + }, + "iceberg": { + "type": "boolean", + "description": "Whether or not only visible portions of orders are shown in iceberg orders", + "default": false + }, + "visibleSize": { + "type": "string", + "description": "Maximum visible quantity in iceberg orders" + }, + "cancelAfter": { + "type": "integer", + "format": "int64", + "description": "Cancel after n seconds,the order timing strategy is GTT" + }, + "funds": { + "type": "string", + "description": "When **type** is market, select one out of two: size or funds" + }, + "tradeType": { + "type": "string", + "description": "The type of trading : **TRADE**(Spot Trade), **MARGIN_TRADE** (Margin Trade). Default is **TRADE**. **Note: To improve the system performance and to accelerate order placing and processing, KuCoin has added a new interface for order placing of margin. For traders still using the current interface, please move to the new one as soon as possible. The current one will no longer accept margin orders by May 1st, 2021 (UTC). At the time, KuCoin will notify users via the announcement, please pay attention to it.**", + "enum": [ + "TRADE", + "MARGIN_TRADE" + ], + "default": "TRADE", + "x-api-enum": [ + { + "value": "TRADE", + "name": "TRADE", + "description": "Spot" + }, + { + "value": "MARGIN_TRADE", + "name": "MARGIN_TRADE", + "description": "Margin" + } + ] + } + }, + "required": [ + "symbol", + "side", + "clientOid" + ] + }, + "example": "//limit order\n{\n \"type\": \"limit\",\n \"symbol\": \"BTC-USDT\",\n \"side\": \"buy\",\n \"price\": \"50000\",\n \"size\": \"0.00001\",\n \"clientOid\": \"5c52e11203aa677f33e493fb\",\n \"remark\": \"order remarks\"\n}\n\n//market order 1\n// {\n// \"type\": \"market\",\n// \"symbol\": \"BTC-USDT\",\n// \"side\": \"buy\",\n// \"size\": \"0.00001\",\n// \"clientOid\": \"5c52e11203aa677f33e493fc\",\n// \"remark\": \"order remarks\"\n// }\n\n//market order 2\n// {\n// \"type\": \"market\",\n// \"symbol\": \"BTC-USDT\",\n// \"side\": \"buy\",\n// \"funds\": \"1\",\n// \"clientOid\": \"5c52e11203aa677f33e493fc\",\n// \"remark\": \"order remarks\"\n// }\n" + } + } + }, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"orderId\\\": \\\"674a8776291d9e00074f1edf\\\"\\n }\\n}", + "x-request-example": "{\\\"type\\\": \\\"limit\\\", \\\"symbol\\\": \\\"BTC-USDT\\\", \\\"side\\\": \\\"buy\\\", \\\"price\\\": \\\"50000\\\", \\\"size\\\": \\\"0.00001\\\", \\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\", \\\"remark\\\": \\\"order remarks\\\"}" + } + }, + "/api/v1/orders/multi": { + "post": { + "summary": "Batch Add Orders - Old", + "deprecated": true, + "description": "Request via this endpoint to place 5 orders at the same time. The order type must be a limit order of the same symbol.", + "tags": [], + "parameters": [], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "type": "object", + "properties": { + "symbol": { + "type": "string" + }, + "type": { + "type": "string" + }, + "side": { + "type": "string" + }, + "price": { + "type": "string" + }, + "size": { + "type": "string" + }, + "funds": { + "type": "string" + }, + "stp": { + "type": "string" + }, + "stop": { + "type": "string" + }, + "stopPrice": { + "type": "string" + }, + "timeInForce": { + "type": "string" + }, + "cancelAfter": { + "type": "integer" + }, + "postOnly": { + "type": "boolean" + }, + "hidden": { + "type": "boolean" + }, + "iceberge": { + "type": "boolean" + }, + "iceberg": { + "type": "boolean" + }, + "visibleSize": { + "type": "string" + }, + "channel": { + "type": "string" + }, + "id": { + "type": "string" + }, + "status": { + "type": "string" + }, + "failMsg": { + "type": "string" + }, + "clientOid": { + "type": "string" + } + }, + "required": [ + "symbol", + "type", + "side", + "price", + "size", + "funds", + "stp", + "stop", + "stopPrice", + "timeInForce", + "cancelAfter", + "postOnly", + "hidden", + "iceberge", + "iceberg", + "visibleSize", + "channel", + "id", + "status", + "failMsg", + "clientOid" + ] + } + } + }, + "required": [ + "data" + ] + } + }, + "required": [ + "code", + "data" + ] + } + } + } + } + }, + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470342", + "x-abandon": "abandon", + "x-domain": "Spot", + "x-api-channel": "Private", + "x-api-permission": "Spot", + "x-api-rate-limit-pool": "Spot", + "x-sdk-service": "Spot", + "x-sdk-sub-service": "Order", + "x-sdk-method-name": "batchAddOrdersOld", + "x-sdk-method-description": "Request via this endpoint to place 5 orders at the same time. The order type must be a limit order of the same symbol.", + "x-api-rate-limit": 3, + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "orderList": { + "type": "array", + "items": { + "type": "object", + "properties": { + "clientOid": { + "type": "string", + "description": "Client Order Id,The ClientOid field is a unique ID created by the user(we recommend using a UUID), and can only contain numbers, letters, underscores (_), and hyphens (-). This field is returned when order information is obtained. You can use clientOid to tag your orders. ClientOid is different from the order ID created by the service provider. Please do not initiate requests using the same clientOid. The maximum length for the ClientOid is 40 characters.\n\nPlease remember the orderId created by the service provider, it used to check for updates in order status.", + "example": [ + "5c52e11203aa677f33e493fb" + ] + }, + "side": { + "type": "string", + "description": "specify if the order is to 'buy' or 'sell'", + "enum": [ + "buy", + "sell" + ], + "x-api-enum": [ + { + "value": "buy", + "name": "", + "description": "" + }, + { + "value": "sell", + "name": "", + "description": "" + } + ], + "example": [ + "buy" + ] + }, + "symbol": { + "type": "string", + "description": "symbol", + "example": [ + "BTC-USDT", + "ETH-USDT", + "KCS-USDT" + ] + }, + "type": { + "type": "string", + "description": "only limit (default is limit)", + "enum": [ + "limit" + ], + "default": "limit", + "x-api-enum": [ + { + "value": "limit", + "name": "limit", + "description": "limit order" + } + ] + }, + "remark": { + "type": "string", + "description": "Order placement remarks, length cannot exceed 20 characters (ASCII)" + }, + "stp": { + "type": "string", + "description": "[Self Trade Prevention](https://www.kucoin.com/docs-new/doc-338146) is divided into four strategies: CN, CO, CB , and DC", + "enum": [ + "DC", + "CO", + "CN", + "CB" + ], + "x-api-enum": [ + { + "value": "DC", + "name": "", + "description": "" + }, + { + "value": "CO", + "name": "", + "description": "" + }, + { + "value": "CN", + "name": "", + "description": "" + }, + { + "value": "CB", + "name": "", + "description": "" + } + ] + }, + "price": { + "type": "string", + "description": "Specify price for order\n\nWhen placing a limit order, the price must be based on priceIncrement for the trading pair. The price increment (priceIncrement) is the price precision for the trading pair. For example, for the BTC-USDT trading pair, the priceIncrement is 0.00001000. So the price for your orders cannot be less than 0.00001000 and must be a multiple of priceIncrement. Otherwise, the order will return an invalid priceIncrement error." + }, + "size": { + "type": "string", + "description": "Specify quantity for order\n\nWhen **type** is limit, size refers to the amount of trading targets (the asset name written in front) for the trading pair. Teh Size must be based on the baseIncrement of the trading pair. The baseIncrement represents the precision for the trading pair. The size of an order must be a positive-integer multiple of baseIncrement and must be between baseMinSize and baseMaxSize.\n\nWhen **type** is market, select one out of two: size or funds" + }, + "timeInForce": { + "type": "string", + "description": "[Time in force](https://www.kucoin.com/docs-new/doc-338146) is a special strategy used during trading", + "enum": [ + "GTC", + "GTT", + "IOC", + "FOK" + ], + "default": "GTC", + "x-api-enum": [ + { + "value": "GTC", + "name": "", + "description": "" + }, + { + "value": "GTT", + "name": "", + "description": "" + }, + { + "value": "IOC", + "name": "", + "description": "" + }, + { + "value": "FOK", + "name": "", + "description": "" + } + ] + }, + "postOnly": { + "type": "boolean", + "default": false, + "description": "passive order labels, this is disabled when the order timing strategy is IOC or FOK" + }, + "hidden": { + "type": "boolean", + "description": "Hidden or not (not shown in order book)", + "default": false + }, + "iceberg": { + "type": "boolean", + "description": "Whether or not only visible portions of orders are shown in iceberg orders", + "default": false + }, + "visibleSize": { + "type": "string", + "description": "Maximum visible quantity in iceberg orders" + }, + "cancelAfter": { + "type": "integer", + "format": "int64", + "description": "Cancel after n seconds,the order timing strategy is GTT" + }, + "tradeType": { + "type": "string", + "description": "The type of trading : **TRADE**(Spot Trade)", + "enum": [ + "TRADE" + ], + "default": "TRADE", + "x-api-enum": [ + { + "value": "TRADE", + "name": "TRADE", + "description": "Spot" + } + ] + }, + "stop": { + "type": "string", + "description": "Either loss or entry. Requires stopPrice to be defined", + "enum": [ + "loss", + "entry" + ], + "x-api-enum": [ + { + "value": "loss", + "name": "loss", + "description": "<=" + }, + { + "value": "entry", + "name": "entry", + "description": ">=" + } + ] + }, + "stopPrice": { + "type": "string", + "description": "Stop price, Need to be defined if stop is specified." + } }, - { - "value": "FOK", - "name": "", - "description": "" - } - ] - }, - "postOnly": { - "type": "boolean", - "default": false, - "description": "passive order labels, this is disabled when the order timing strategy is IOC or FOK" - }, - "hidden": { - "type": "boolean", - "description": "Hidden or not (not shown in order book)", - "default": false - }, - "iceberg": { - "type": "boolean", - "description": "Whether or not only visible portions of orders are shown in iceberg orders", - "default": false - }, - "visibleSize": { - "type": "string", - "description": "Maximum visible quantity in iceberg orders" - }, - "cancelAfter": { - "type": "integer", - "format": "int64", - "description": "Cancel after n seconds,the order timing strategy is GTT" - }, - "funds": { - "type": "string", - "description": "When **type** is market, select one out of two: size or funds" + "required": [ + "symbol", + "side", + "clientOid", + "price", + "size" + ] + } }, - "tradeType": { - "type": "string", - "description": "The type of trading : **TRADE**(Spot Trade), **MARGIN_TRADE** (Margin Trade). Default is **TRADE**. **Note: To improve the system performance and to accelerate order placing and processing, KuCoin has added a new interface for order placing of margin. For traders still using the current interface, please move to the new one as soon as possible. The current one will no longer accept margin orders by May 1st, 2021 (UTC). At the time, KuCoin will notify users via the announcement, please pay attention to it.**", - "enum": [ - "TRADE", - "MARGIN_TRADE" - ], - "default": "TRADE", - "x-api-enum": [ - { - "value": "TRADE", - "name": "TRADE", - "description": "Spot" - }, - { - "value": "MARGIN_TRADE", - "name": "MARGIN_TRADE", - "description": "Margin" - } - ] + "symbol": { + "type": "string" } }, "required": [ - "symbol", - "side", - "clientOid" + "symbol" ] }, - "example": "//limit order\n{\n \"type\": \"limit\",\n \"symbol\": \"BTC-USDT\",\n \"side\": \"buy\",\n \"price\": \"50000\",\n \"size\": \"0.00001\",\n \"clientOid\": \"5c52e11203aa677f33e493fb\",\n \"remark\": \"order remarks\"\n}\n\n//market order 1\n// {\n// \"type\": \"market\",\n// \"symbol\": \"BTC-USDT\",\n// \"side\": \"buy\",\n// \"size\": \"0.00001\",\n// \"clientOid\": \"5c52e11203aa677f33e493fc\",\n// \"remark\": \"order remarks\"\n// }\n\n//market order 2\n// {\n// \"type\": \"market\",\n// \"symbol\": \"BTC-USDT\",\n// \"side\": \"buy\",\n// \"funds\": \"1\",\n// \"clientOid\": \"5c52e11203aa677f33e493fc\",\n// \"remark\": \"order remarks\"\n// }\n" + "example": "{\n \"symbol\": \"BTC-USDT\",\n \"orderList\": [\n {\n \"clientOid\": \"3d07008668054da6b3cb12e432c2b13a\",\n \"side\": \"buy\",\n \"type\": \"limit\",\n \"price\": \"50000\",\n \"size\": \"0.0001\"\n },\n {\n \"clientOid\": \"37245dbe6e134b5c97732bfb36cd4a9d\",\n \"side\": \"buy\",\n \"type\": \"limit\",\n \"price\": \"49999\",\n \"size\": \"0.0001\"\n }\n ]\n}" } } }, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"orderId\\\": \\\"674a8635b38d120007709c0f\\\"\\n }\\n}", - "x-request-example": "{\\\"type\\\": \\\"limit\\\", \\\"symbol\\\": \\\"BTC-USDT\\\", \\\"side\\\": \\\"buy\\\", \\\"price\\\": \\\"50000\\\", \\\"size\\\": \\\"0.00001\\\", \\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\", \\\"remark\\\": \\\"order remarks\\\"}" + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"data\\\": [\\n {\\n \\\"symbol\\\": \\\"BTC-USDT\\\",\\n \\\"type\\\": \\\"limit\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"price\\\": \\\"50000\\\",\\n \\\"size\\\": \\\"0.0001\\\",\\n \\\"funds\\\": null,\\n \\\"stp\\\": \\\"\\\",\\n \\\"stop\\\": \\\"\\\",\\n \\\"stopPrice\\\": null,\\n \\\"timeInForce\\\": \\\"GTC\\\",\\n \\\"cancelAfter\\\": 0,\\n \\\"postOnly\\\": false,\\n \\\"hidden\\\": false,\\n \\\"iceberge\\\": false,\\n \\\"iceberg\\\": false,\\n \\\"visibleSize\\\": null,\\n \\\"channel\\\": \\\"API\\\",\\n \\\"id\\\": \\\"674a97dfef434f0007efc431\\\",\\n \\\"status\\\": \\\"success\\\",\\n \\\"failMsg\\\": null,\\n \\\"clientOid\\\": \\\"3d07008668054da6b3cb12e432c2b13a\\\"\\n },\\n {\\n \\\"symbol\\\": \\\"BTC-USDT\\\",\\n \\\"type\\\": \\\"limit\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"price\\\": \\\"49999\\\",\\n \\\"size\\\": \\\"0.0001\\\",\\n \\\"funds\\\": null,\\n \\\"stp\\\": \\\"\\\",\\n \\\"stop\\\": \\\"\\\",\\n \\\"stopPrice\\\": null,\\n \\\"timeInForce\\\": \\\"GTC\\\",\\n \\\"cancelAfter\\\": 0,\\n \\\"postOnly\\\": false,\\n \\\"hidden\\\": false,\\n \\\"iceberge\\\": false,\\n \\\"iceberg\\\": false,\\n \\\"visibleSize\\\": null,\\n \\\"channel\\\": \\\"API\\\",\\n \\\"id\\\": \\\"674a97dffb378b00077b9c20\\\",\\n \\\"status\\\": \\\"fail\\\",\\n \\\"failMsg\\\": \\\"Balance insufficient!\\\",\\n \\\"clientOid\\\": \\\"37245dbe6e134b5c97732bfb36cd4a9d\\\"\\n }\\n ]\\n }\\n}", + "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"orderList\\\": [{\\\"clientOid\\\": \\\"3d07008668054da6b3cb12e432c2b13a\\\", \\\"side\\\": \\\"buy\\\", \\\"type\\\": \\\"limit\\\", \\\"price\\\": \\\"50000\\\", \\\"size\\\": \\\"0.0001\\\"}, {\\\"clientOid\\\": \\\"37245dbe6e134b5c97732bfb36cd4a9d\\\", \\\"side\\\": \\\"buy\\\", \\\"type\\\": \\\"limit\\\", \\\"price\\\": \\\"49999\\\", \\\"size\\\": \\\"0.0001\\\"}]}" } }, - "/api/v1/limit/orders": { - "get": { - "summary": "Get Recent Orders List - Old", + "/api/v1/orders/{orderId}": { + "delete": { + "summary": "Cancel Order By OrderId - Old", "deprecated": true, - "description": "Request via this endpoint to get your current order list. The return value is the data after Pagination, sorted in descending order according to time.", + "description": "This endpoint can be used to cancel a spot order by orderId. This endpoint only sends cancellation requests. The results of the requests must be obtained by checking the order status or subscribing to websocket.", "tags": [], "parameters": [ { - "name": "currentPage", + "name": "symbol", "in": "query", - "description": "Current request page.", - "required": false, + "description": "symbol", + "required": true, "schema": { - "type": "integer", - "default": 1 + "type": "string", + "example": [ + "BTC-USDT", + "ETH-USDT", + "KCS-USDT" + ] } }, { - "name": "pageSize", - "in": "query", - "description": "Number of results per request. Minimum is 10, maximum is 500.", - "required": false, + "name": "orderId", + "in": "path", + "description": "The unique order id generated by the trading system", + "required": true, "schema": { - "type": "integer", - "default": 50, - "minimum": 10, - "maximum": 500 - } - } - ], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "data": { - "type": "array", - "items": { - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "symbol": { - "type": "string" - }, - "opType": { - "type": "string" - }, - "type": { - "type": "string" - }, - "side": { - "type": "string" - }, - "price": { - "type": "string" - }, - "size": { - "type": "string" - }, - "funds": { - "type": "string" - }, - "dealFunds": { - "type": "string" - }, - "dealSize": { - "type": "string" - }, - "fee": { - "type": "string" - }, - "feeCurrency": { - "type": "string" - }, - "stp": { - "type": "string" - }, - "stop": { - "type": "string" - }, - "stopTriggered": { - "type": "boolean" - }, - "stopPrice": { - "type": "string" - }, - "timeInForce": { - "type": "string" - }, - "postOnly": { - "type": "boolean" - }, - "hidden": { - "type": "boolean" - }, - "iceberg": { - "type": "boolean" - }, - "visibleSize": { - "type": "string" - }, - "cancelAfter": { - "type": "integer" - }, - "channel": { - "type": "string" - }, - "clientOid": { - "type": "string" - }, - "remark": { - "type": "string" - }, - "tags": { - "type": "string" - }, - "isActive": { - "type": "boolean" - }, - "cancelExist": { - "type": "boolean" - }, - "createdAt": { - "type": "integer", - "format": "int64" - }, - "tradeType": { - "type": "string" - } - }, - "required": [ - "id", - "symbol", - "opType", - "type", - "side", - "price", - "size", - "funds", - "dealFunds", - "dealSize", - "fee", - "feeCurrency", - "stp", - "stop", - "stopTriggered", - "stopPrice", - "timeInForce", - "postOnly", - "hidden", - "iceberg", - "visibleSize", - "cancelAfter", - "channel", - "clientOid", - "remark", - "tags", - "isActive", - "cancelExist", - "createdAt", - "tradeType" - ] - } + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "object", + "properties": { + "cancelledOrderIds": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "cancelledOrderIds" + ] } }, "required": [ @@ -7297,32 +7551,30 @@ } } }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470347", + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470343", "x-abandon": "abandon", "x-domain": "Spot", "x-api-channel": "Private", - "x-api-permission": "General", + "x-api-permission": "Spot", "x-api-rate-limit-pool": "Spot", "x-sdk-service": "Spot", "x-sdk-sub-service": "Order", - "x-sdk-method-name": "getRecentOrdersListOld", - "x-sdk-method-description": "Request via this endpoint to get your current order list. The return value is the data after Pagination, sorted in descending order according to time.", + "x-sdk-method-name": "cancelOrderByOrderIdOld", + "x-sdk-method-description": "This endpoint can be used to cancel a spot order by orderId. This endpoint only sends cancellation requests. The results of the requests must be obtained by checking the order status or subscribing to websocket.", "x-api-rate-limit": 3, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": [\\n {\\n \\\"id\\\": \\\"674a9a872033a50007e2790d\\\",\\n \\\"symbol\\\": \\\"BTC-USDT\\\",\\n \\\"opType\\\": \\\"DEAL\\\",\\n \\\"type\\\": \\\"limit\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"price\\\": \\\"50000\\\",\\n \\\"size\\\": \\\"0.00001\\\",\\n \\\"funds\\\": \\\"0\\\",\\n \\\"dealFunds\\\": \\\"0\\\",\\n \\\"dealSize\\\": \\\"0\\\",\\n \\\"fee\\\": \\\"0\\\",\\n \\\"feeCurrency\\\": \\\"USDT\\\",\\n \\\"stp\\\": \\\"\\\",\\n \\\"stop\\\": \\\"\\\",\\n \\\"stopTriggered\\\": false,\\n \\\"stopPrice\\\": \\\"0\\\",\\n \\\"timeInForce\\\": \\\"GTC\\\",\\n \\\"postOnly\\\": false,\\n \\\"hidden\\\": false,\\n \\\"iceberg\\\": false,\\n \\\"visibleSize\\\": \\\"0\\\",\\n \\\"cancelAfter\\\": 0,\\n \\\"channel\\\": \\\"API\\\",\\n \\\"clientOid\\\": \\\"5c52e11203aa677f33e4923fb\\\",\\n \\\"remark\\\": \\\"order remarks\\\",\\n \\\"tags\\\": null,\\n \\\"isActive\\\": false,\\n \\\"cancelExist\\\": true,\\n \\\"createdAt\\\": 1732942471752,\\n \\\"tradeType\\\": \\\"TRADE\\\"\\n }\\n ]\\n}", - "x-request-example": "{\\\"currentPage\\\": 1, \\\"pageSize\\\": 50}" - } - }, - "/api/v1/order/client-order/{clientOid}": { + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"cancelledOrderIds\\\": [\\n \\\"674a97dfef434f0007efc431\\\"\\n ]\\n }\\n}", + "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"orderId\\\": \\\"674a97dfef434f0007efc431\\\"}" + }, "get": { - "summary": "Get Order By ClientOid - Old", + "summary": "Get Order By OrderId - Old", "deprecated": true, - "description": "Request via this interface to check the information of a single active order via clientOid. The system will prompt that the order does not exists if the order does not exist or has been settled.", + "description": "Request via this endpoint to get a single order info by order ID.", "tags": [], "parameters": [ { - "name": "clientOid", + "name": "orderId", "in": "path", - "description": "Unique order id created by users to identify their orders", + "description": "The unique order id generated by the trading system", "required": true, "schema": { "type": "string" @@ -7478,7 +7730,7 @@ } } }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470349", + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470348", "x-abandon": "abandon", "x-domain": "Spot", "x-api-channel": "Private", @@ -7486,12 +7738,14 @@ "x-api-rate-limit-pool": "Spot", "x-sdk-service": "Spot", "x-sdk-sub-service": "Order", - "x-sdk-method-name": "getOrderByClientOidOld", - "x-sdk-method-description": "Request via this interface to check the information of a single active order via clientOid. The system will prompt that the order does not exists if the order does not exist or has been settled.", - "x-api-rate-limit": 3, + "x-sdk-method-name": "getOrderByOrderIdOld", + "x-sdk-method-description": "Request via this endpoint to get a single order info by order ID.", + "x-api-rate-limit": 2, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"id\\\": \\\"674a97dfef434f0007efc431\\\",\\n \\\"symbol\\\": \\\"BTC-USDT\\\",\\n \\\"opType\\\": \\\"DEAL\\\",\\n \\\"type\\\": \\\"limit\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"price\\\": \\\"50000\\\",\\n \\\"size\\\": \\\"0.0001\\\",\\n \\\"funds\\\": \\\"0\\\",\\n \\\"dealFunds\\\": \\\"0\\\",\\n \\\"dealSize\\\": \\\"0\\\",\\n \\\"fee\\\": \\\"0\\\",\\n \\\"feeCurrency\\\": \\\"USDT\\\",\\n \\\"stp\\\": \\\"\\\",\\n \\\"stop\\\": \\\"\\\",\\n \\\"stopTriggered\\\": false,\\n \\\"stopPrice\\\": \\\"0\\\",\\n \\\"timeInForce\\\": \\\"GTC\\\",\\n \\\"postOnly\\\": false,\\n \\\"hidden\\\": false,\\n \\\"iceberg\\\": false,\\n \\\"visibleSize\\\": \\\"0\\\",\\n \\\"cancelAfter\\\": 0,\\n \\\"channel\\\": \\\"API\\\",\\n \\\"clientOid\\\": \\\"3d07008668054da6b3cb12e432c2b13a\\\",\\n \\\"remark\\\": null,\\n \\\"tags\\\": null,\\n \\\"isActive\\\": false,\\n \\\"cancelExist\\\": true,\\n \\\"createdAt\\\": 1732941791518,\\n \\\"tradeType\\\": \\\"TRADE\\\"\\n }\\n}", - "x-request-example": "{\\\"clientOid\\\": \\\"3d07008668054da6b3cb12e432c2b13a\\\"}" - }, + "x-request-example": "{\\\"orderId\\\": \\\"674a97dfef434f0007efc431\\\"}" + } + }, + "/api/v1/order/client-order/{clientOid}": { "delete": { "summary": "Cancel Order By ClientOid - Old", "deprecated": false, @@ -7576,175 +7830,21 @@ "x-api-rate-limit": 3, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"cancelledOrderId\\\": \\\"674a9a872033a50007e2790d\\\",\\n \\\"clientOid\\\": \\\"5c52e11203aa677f33e4923fb\\\",\\n \\\"cancelledOcoOrderIds\\\": null\\n }\\n}", "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"clientOid\\\": \\\"5c52e11203aa677f33e4923fb\\\"}" - } - }, - "/api/v1/fills": { + }, "get": { - "summary": "Get Trade History - Old", + "summary": "Get Order By ClientOid - Old", "deprecated": true, - "description": "Request via this endpoint to get the recent fills. The return value is the data after Pagination, sorted in descending order according to time.", + "description": "Request via this interface to check the information of a single active order via clientOid. The system will prompt that the order does not exists if the order does not exist or has been settled.", "tags": [], "parameters": [ { - "name": "symbol", - "in": "query", - "description": "symbol", + "name": "clientOid", + "in": "path", + "description": "Unique order id created by users to identify their orders", "required": true, - "schema": { - "type": "string", - "example": [ - "BTC-USDT", - "ETH-USDT", - "KCS-USDT" - ] - } - }, - { - "name": "orderId", - "in": "query", - "description": "The unique order id generated by the trading system (If orderId is specified,please ignore the other query parameters)", - "required": false, "schema": { "type": "string" } - }, - { - "name": "side", - "in": "query", - "description": "specify if the order is to 'buy' or 'sell'", - "required": false, - "schema": { - "type": "string", - "enum": [ - "buy", - "sell" - ], - "x-api-enum": [ - { - "value": "buy", - "name": "buy", - "description": "buy" - }, - { - "value": "sell", - "name": "sell", - "description": "sell" - } - ] - } - }, - { - "name": "type", - "in": "query", - "description": "limit, market, limit_stop or market_stop\n", - "required": false, - "schema": { - "type": "string", - "enum": [ - "limit", - "market", - "limit_stop", - "market_stop" - ], - "x-api-enum": [ - { - "value": "limit", - "name": "limit", - "description": "limit" - }, - { - "value": "market", - "name": "market", - "description": "market" - }, - { - "value": "limit_stop", - "name": "limit_stop", - "description": "limit_stop" - }, - { - "value": "market_stop", - "name": "market_stop", - "description": "market_stop" - } - ] - } - }, - { - "name": "tradeType", - "in": "query", - "description": "The type of trading:TRADE - Spot Trading(TRADE as default), MARGIN_TRADE - Cross Margin Trading, MARGIN_ISOLATED_TRADE - Isolated Margin Trading.", - "required": false, - "schema": { - "type": "string", - "enum": [ - "TRADE", - "MARGIN_TRADE", - "MARGIN_ISOLATED_TRADE" - ], - "default": "TRADE", - "x-api-enum": [ - { - "value": "TRADE", - "name": "TRADE", - "description": "Spot Trading" - }, - { - "value": "MARGIN_TRADE", - "name": "MARGIN_TRADE", - "description": "Cross Margin Trading" - }, - { - "value": "MARGIN_ISOLATED_TRADE", - "name": "MARGIN_ISOLATED_TRADE", - "description": "Isolated Margin Trading" - } - ] - } - }, - { - "name": "startAt", - "in": "query", - "description": "Start time (milisecond)", - "required": false, - "schema": { - "type": "integer", - "format": "int64" - } - }, - { - "name": "endAt", - "in": "query", - "description": "End time (milisecond)", - "required": false, - "schema": { - "type": "integer", - "format": "int64" - } - }, - { - "name": "currentPage", - "in": "query", - "description": "Current request page.", - "required": false, - "schema": { - "type": "integer", - "default": 1 - } - }, - { - "name": "pageSize", - "in": "query", - "description": "Number of results per request. Minimum is 10, maximum is 500.", - "required": false, - "schema": { - "type": "integer", - "minimum": 10, - "maximum": 500, - "example": [ - 50 - ] - } } ], "responses": { @@ -7761,104 +7861,129 @@ "data": { "type": "object", "properties": { - "currentPage": { - "type": "integer" + "id": { + "type": "string" + }, + "symbol": { + "type": "string" + }, + "opType": { + "type": "string" + }, + "type": { + "type": "string" + }, + "side": { + "type": "string" + }, + "price": { + "type": "string" + }, + "size": { + "type": "string" + }, + "funds": { + "type": "string" }, - "pageSize": { - "type": "integer" + "dealFunds": { + "type": "string" }, - "totalNum": { - "type": "integer" + "dealSize": { + "type": "string" }, - "totalPage": { + "fee": { + "type": "string" + }, + "feeCurrency": { + "type": "string" + }, + "stp": { + "type": "string" + }, + "stop": { + "type": "string" + }, + "stopTriggered": { + "type": "boolean" + }, + "stopPrice": { + "type": "string" + }, + "timeInForce": { + "type": "string" + }, + "postOnly": { + "type": "boolean" + }, + "hidden": { + "type": "boolean" + }, + "iceberg": { + "type": "boolean" + }, + "visibleSize": { + "type": "string" + }, + "cancelAfter": { "type": "integer" }, - "items": { - "type": "array", - "items": { - "type": "object", - "properties": { - "symbol": { - "type": "string", - "description": "symbol", - "example": [ - "BTC-USDT", - "ETH-USDT", - "KCS-USDT" - ] - }, - "tradeId": { - "type": "string" - }, - "orderId": { - "type": "string", - "description": "The unique order id generated by the trading system" - }, - "counterOrderId": { - "type": "string", - "description": "Counterparty order Id" - }, - "side": { - "type": "string", - "description": "Buy or sell" - }, - "liquidity": { - "type": "string", - "description": "Liquidity type: taker or maker" - }, - "forceTaker": { - "type": "boolean" - }, - "price": { - "type": "string", - "description": "Order price" - }, - "size": { - "type": "string", - "description": "Order size" - }, - "funds": { - "type": "string", - "description": "Order Funds" - }, - "fee": { - "type": "string", - "description": "[Handling fees](https://www.kucoin.com/docs-new/api-5327739)" - }, - "feeRate": { - "type": "string", - "description": "Fee rate\n" - }, - "feeCurrency": { - "type": "string", - "description": "currency used to calculate trading fee" - }, - "stop": { - "type": "string", - "description": "Take Profit and Stop Loss type, currently HFT does not support the Take Profit and Stop Loss type, so it is empty" - }, - "tradeType": { - "type": "string", - "description": "Trade type, redundancy param" - }, - "type": { - "type": "string", - "description": "Specify if the order is an 'limit' order or 'market' order. " - }, - "createdAt": { - "type": "integer", - "format": "int64" - } - } - } + "channel": { + "type": "string" + }, + "clientOid": { + "type": "string" + }, + "remark": { + "type": "string" + }, + "tags": { + "type": "string" + }, + "isActive": { + "type": "boolean" + }, + "cancelExist": { + "type": "boolean" + }, + "createdAt": { + "type": "integer", + "format": "int64" + }, + "tradeType": { + "type": "string" } }, "required": [ - "currentPage", - "pageSize", - "totalNum", - "totalPage", - "items" + "id", + "symbol", + "opType", + "type", + "side", + "price", + "size", + "funds", + "dealFunds", + "dealSize", + "fee", + "feeCurrency", + "stp", + "stop", + "stopTriggered", + "stopPrice", + "timeInForce", + "postOnly", + "hidden", + "iceberg", + "visibleSize", + "cancelAfter", + "channel", + "clientOid", + "remark", + "tags", + "isActive", + "cancelExist", + "createdAt", + "tradeType" ] } }, @@ -7871,7 +7996,7 @@ } } }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470350", + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470349", "x-abandon": "abandon", "x-domain": "Spot", "x-api-channel": "Private", @@ -7879,18 +8004,18 @@ "x-api-rate-limit-pool": "Spot", "x-sdk-service": "Spot", "x-sdk-sub-service": "Order", - "x-sdk-method-name": "getTradeHistoryOld", - "x-sdk-method-description": "Request via this endpoint to get the recent fills. The return value is the data after Pagination, sorted in descending order according to time.", - "x-api-rate-limit": 10, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"currentPage\\\": 1,\\n \\\"pageSize\\\": 50,\\n \\\"totalNum\\\": 1,\\n \\\"totalPage\\\": 1,\\n \\\"items\\\": [\\n {\\n \\\"symbol\\\": \\\"DOGE-USDT\\\",\\n \\\"tradeId\\\": \\\"10862827223795713\\\",\\n \\\"orderId\\\": \\\"6745698ef4f1200007c561a8\\\",\\n \\\"counterOrderId\\\": \\\"6745695ef15b270007ac5076\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"liquidity\\\": \\\"taker\\\",\\n \\\"forceTaker\\\": false,\\n \\\"price\\\": \\\"0.40739\\\",\\n \\\"size\\\": \\\"10\\\",\\n \\\"funds\\\": \\\"4.0739\\\",\\n \\\"fee\\\": \\\"0.0040739\\\",\\n \\\"feeRate\\\": \\\"0.001\\\",\\n \\\"feeCurrency\\\": \\\"USDT\\\",\\n \\\"stop\\\": \\\"\\\",\\n \\\"tradeType\\\": \\\"TRADE\\\",\\n \\\"type\\\": \\\"market\\\",\\n \\\"createdAt\\\": 1732602254928\\n }\\n ]\\n }\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"orderId\\\": \\\"example_string_default_value\\\", \\\"side\\\": \\\"buy\\\", \\\"type\\\": \\\"limit\\\", \\\"tradeType\\\": \\\"TRADE\\\", \\\"startAt\\\": 1728663338000, \\\"endAt\\\": 1728692138000, \\\"currentPage\\\": 1, \\\"pageSize\\\": 50}" + "x-sdk-method-name": "getOrderByClientOidOld", + "x-sdk-method-description": "Request via this interface to check the information of a single active order via clientOid. The system will prompt that the order does not exists if the order does not exist or has been settled.", + "x-api-rate-limit": 3, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"id\\\": \\\"674a97dfef434f0007efc431\\\",\\n \\\"symbol\\\": \\\"BTC-USDT\\\",\\n \\\"opType\\\": \\\"DEAL\\\",\\n \\\"type\\\": \\\"limit\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"price\\\": \\\"50000\\\",\\n \\\"size\\\": \\\"0.0001\\\",\\n \\\"funds\\\": \\\"0\\\",\\n \\\"dealFunds\\\": \\\"0\\\",\\n \\\"dealSize\\\": \\\"0\\\",\\n \\\"fee\\\": \\\"0\\\",\\n \\\"feeCurrency\\\": \\\"USDT\\\",\\n \\\"stp\\\": \\\"\\\",\\n \\\"stop\\\": \\\"\\\",\\n \\\"stopTriggered\\\": false,\\n \\\"stopPrice\\\": \\\"0\\\",\\n \\\"timeInForce\\\": \\\"GTC\\\",\\n \\\"postOnly\\\": false,\\n \\\"hidden\\\": false,\\n \\\"iceberg\\\": false,\\n \\\"visibleSize\\\": \\\"0\\\",\\n \\\"cancelAfter\\\": 0,\\n \\\"channel\\\": \\\"API\\\",\\n \\\"clientOid\\\": \\\"3d07008668054da6b3cb12e432c2b13a\\\",\\n \\\"remark\\\": null,\\n \\\"tags\\\": null,\\n \\\"isActive\\\": false,\\n \\\"cancelExist\\\": true,\\n \\\"createdAt\\\": 1732941791518,\\n \\\"tradeType\\\": \\\"TRADE\\\"\\n }\\n}", + "x-request-example": "{\\\"clientOid\\\": \\\"3d07008668054da6b3cb12e432c2b13a\\\"}" } }, - "/api/v1/limit/fills": { + "/api/v1/limit/orders": { "get": { - "summary": "Get Recent Trade History - Old", + "summary": "Get Recent Orders List - Old", "deprecated": true, - "description": "Request via this endpoint to get a list of 1000 fills in the last 24 hours. The return value is the data after Pagination, sorted in descending order according to time.", + "description": "Request via this endpoint to get your current order list. The return value is the data after Pagination, sorted in descending order according to time.", "tags": [], "parameters": [ { @@ -7910,11 +8035,9 @@ "required": false, "schema": { "type": "integer", + "default": 50, "minimum": 10, - "maximum": 500, - "example": [ - 50 - ] + "maximum": 500 } } ], @@ -7934,59 +8057,130 @@ "items": { "type": "object", "properties": { - "symbol": { + "id": { "type": "string" }, - "tradeId": { + "symbol": { "type": "string" }, - "orderId": { + "opType": { "type": "string" }, - "counterOrderId": { + "type": { "type": "string" }, "side": { "type": "string" }, - "liquidity": { + "price": { "type": "string" }, - "forceTaker": { + "size": { + "type": "string" + }, + "funds": { + "type": "string" + }, + "dealFunds": { + "type": "string" + }, + "dealSize": { + "type": "string" + }, + "fee": { + "type": "string" + }, + "feeCurrency": { + "type": "string" + }, + "stp": { + "type": "string" + }, + "stop": { + "type": "string" + }, + "stopTriggered": { "type": "boolean" }, - "price": { + "stopPrice": { "type": "string" }, - "size": { + "timeInForce": { "type": "string" }, - "funds": { + "postOnly": { + "type": "boolean" + }, + "hidden": { + "type": "boolean" + }, + "iceberg": { + "type": "boolean" + }, + "visibleSize": { "type": "string" }, - "fee": { - "type": "string" + "cancelAfter": { + "type": "integer" }, - "feeRate": { + "channel": { "type": "string" }, - "feeCurrency": { + "clientOid": { "type": "string" }, - "stop": { + "remark": { "type": "string" }, - "tradeType": { + "tags": { "type": "string" }, - "type": { - "type": "string" + "isActive": { + "type": "boolean" + }, + "cancelExist": { + "type": "boolean" }, "createdAt": { "type": "integer", "format": "int64" + }, + "tradeType": { + "type": "string" } - } + }, + "required": [ + "id", + "symbol", + "opType", + "type", + "side", + "price", + "size", + "funds", + "dealFunds", + "dealSize", + "fee", + "feeCurrency", + "stp", + "stop", + "stopTriggered", + "stopPrice", + "timeInForce", + "postOnly", + "hidden", + "iceberg", + "visibleSize", + "cancelAfter", + "channel", + "clientOid", + "remark", + "tags", + "isActive", + "cancelExist", + "createdAt", + "tradeType" + ] } } }, @@ -7999,7 +8193,7 @@ } } }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470351", + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470347", "x-abandon": "abandon", "x-domain": "Spot", "x-api-channel": "Private", @@ -8007,392 +8201,353 @@ "x-api-rate-limit-pool": "Spot", "x-sdk-service": "Spot", "x-sdk-sub-service": "Order", - "x-sdk-method-name": "getRecentTradeHistoryOld", - "x-sdk-method-description": "Request via this endpoint to get a list of 1000 fills in the last 24 hours. The return value is the data after Pagination, sorted in descending order according to time.", - "x-api-rate-limit": 20, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": [\\n {\\n \\\"symbol\\\": \\\"BTC-USDT\\\",\\n \\\"tradeId\\\": \\\"11732720444522497\\\",\\n \\\"orderId\\\": \\\"674aab24754b1e00077dbc69\\\",\\n \\\"counterOrderId\\\": \\\"674aab1fb26bfb0007a18b67\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"liquidity\\\": \\\"taker\\\",\\n \\\"forceTaker\\\": false,\\n \\\"price\\\": \\\"96999.6\\\",\\n \\\"size\\\": \\\"0.00001\\\",\\n \\\"funds\\\": \\\"0.969996\\\",\\n \\\"fee\\\": \\\"0.000969996\\\",\\n \\\"feeRate\\\": \\\"0.001\\\",\\n \\\"feeCurrency\\\": \\\"USDT\\\",\\n \\\"stop\\\": \\\"\\\",\\n \\\"tradeType\\\": \\\"TRADE\\\",\\n \\\"type\\\": \\\"limit\\\",\\n \\\"createdAt\\\": 1732946724082\\n }\\n ]\\n}", + "x-sdk-method-name": "getRecentOrdersListOld", + "x-sdk-method-description": "Request via this endpoint to get your current order list. The return value is the data after Pagination, sorted in descending order according to time.", + "x-api-rate-limit": 3, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": [\\n {\\n \\\"id\\\": \\\"674a9a872033a50007e2790d\\\",\\n \\\"symbol\\\": \\\"BTC-USDT\\\",\\n \\\"opType\\\": \\\"DEAL\\\",\\n \\\"type\\\": \\\"limit\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"price\\\": \\\"50000\\\",\\n \\\"size\\\": \\\"0.00001\\\",\\n \\\"funds\\\": \\\"0\\\",\\n \\\"dealFunds\\\": \\\"0\\\",\\n \\\"dealSize\\\": \\\"0\\\",\\n \\\"fee\\\": \\\"0\\\",\\n \\\"feeCurrency\\\": \\\"USDT\\\",\\n \\\"stp\\\": \\\"\\\",\\n \\\"stop\\\": \\\"\\\",\\n \\\"stopTriggered\\\": false,\\n \\\"stopPrice\\\": \\\"0\\\",\\n \\\"timeInForce\\\": \\\"GTC\\\",\\n \\\"postOnly\\\": false,\\n \\\"hidden\\\": false,\\n \\\"iceberg\\\": false,\\n \\\"visibleSize\\\": \\\"0\\\",\\n \\\"cancelAfter\\\": 0,\\n \\\"channel\\\": \\\"API\\\",\\n \\\"clientOid\\\": \\\"5c52e11203aa677f33e4923fb\\\",\\n \\\"remark\\\": \\\"order remarks\\\",\\n \\\"tags\\\": null,\\n \\\"isActive\\\": false,\\n \\\"cancelExist\\\": true,\\n \\\"createdAt\\\": 1732942471752,\\n \\\"tradeType\\\": \\\"TRADE\\\"\\n }\\n ]\\n}", "x-request-example": "{\\\"currentPage\\\": 1, \\\"pageSize\\\": 50}" } }, - "/api/v1/orders/multi": { - "post": { - "summary": "Batch Add Orders - Old", + "/api/v1/fills": { + "get": { + "summary": "Get Trade History - Old", "deprecated": true, - "description": "Request via this endpoint to place 5 orders at the same time. The order type must be a limit order of the same symbol.", + "description": "Request via this endpoint to get the recent fills. The return value is the data after Pagination, sorted in descending order according to time.", "tags": [], - "parameters": [], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "data": { - "type": "object", - "properties": { - "data": { - "type": "array", - "items": { - "type": "object", - "properties": { - "symbol": { - "type": "string" - }, - "type": { - "type": "string" - }, - "side": { - "type": "string" - }, - "price": { - "type": "string" - }, - "size": { - "type": "string" - }, - "funds": { - "type": "string" - }, - "stp": { - "type": "string" - }, - "stop": { - "type": "string" - }, - "stopPrice": { - "type": "string" - }, - "timeInForce": { - "type": "string" - }, - "cancelAfter": { - "type": "integer" - }, - "postOnly": { - "type": "boolean" - }, - "hidden": { - "type": "boolean" - }, - "iceberge": { - "type": "boolean" - }, - "iceberg": { - "type": "boolean" - }, - "visibleSize": { - "type": "string" - }, - "channel": { - "type": "string" - }, - "id": { - "type": "string" - }, - "status": { - "type": "string" - }, - "failMsg": { - "type": "string" - }, - "clientOid": { - "type": "string" - } - }, - "required": [ - "symbol", - "type", - "side", - "price", - "size", - "funds", - "stp", - "stop", - "stopPrice", - "timeInForce", - "cancelAfter", - "postOnly", - "hidden", - "iceberge", - "iceberg", - "visibleSize", - "channel", - "id", - "status", - "failMsg", - "clientOid" - ] - } - } - }, - "required": [ - "data" - ] - } - }, - "required": [ - "code", - "data" - ] + "parameters": [ + { + "name": "symbol", + "in": "query", + "description": "symbol", + "required": true, + "schema": { + "type": "string", + "example": [ + "BTC-USDT", + "ETH-USDT", + "KCS-USDT" + ] + } + }, + { + "name": "orderId", + "in": "query", + "description": "The unique order id generated by the trading system (If orderId is specified,please ignore the other query parameters)", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "side", + "in": "query", + "description": "specify if the order is to 'buy' or 'sell'", + "required": false, + "schema": { + "type": "string", + "enum": [ + "buy", + "sell" + ], + "x-api-enum": [ + { + "value": "buy", + "name": "buy", + "description": "buy" + }, + { + "value": "sell", + "name": "sell", + "description": "sell" + } + ] + } + }, + { + "name": "type", + "in": "query", + "description": "limit, market, limit_stop or market_stop\n", + "required": false, + "schema": { + "type": "string", + "enum": [ + "limit", + "market", + "limit_stop", + "market_stop" + ], + "x-api-enum": [ + { + "value": "limit", + "name": "limit", + "description": "limit" + }, + { + "value": "market", + "name": "market", + "description": "market" + }, + { + "value": "limit_stop", + "name": "limit_stop", + "description": "limit_stop" + }, + { + "value": "market_stop", + "name": "market_stop", + "description": "market_stop" } - } + ] } - } - }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470342", - "x-abandon": "abandon", - "x-domain": "Spot", - "x-api-channel": "Private", - "x-api-permission": "Spot", - "x-api-rate-limit-pool": "Spot", - "x-sdk-service": "Spot", - "x-sdk-sub-service": "Order", - "x-sdk-method-name": "batchAddOrdersOld", - "x-sdk-method-description": "Request via this endpoint to place 5 orders at the same time. The order type must be a limit order of the same symbol.", - "x-api-rate-limit": 3, - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "orderList": { - "type": "array", - "items": { - "type": "object", - "properties": { - "clientOid": { - "type": "string", - "description": "Client Order Id,The ClientOid field is a unique ID created by the user(we recommend using a UUID), and can only contain numbers, letters, underscores (_), and hyphens (-). This field is returned when order information is obtained. You can use clientOid to tag your orders. ClientOid is different from the order ID created by the service provider. Please do not initiate requests using the same clientOid. The maximum length for the ClientOid is 40 characters.\n\nPlease remember the orderId created by the service provider, it used to check for updates in order status.", - "example": [ - "5c52e11203aa677f33e493fb" - ] - }, - "side": { - "type": "string", - "description": "specify if the order is to 'buy' or 'sell'", - "enum": [ - "buy", - "sell" - ], - "x-api-enum": [ - { - "value": "buy", - "name": "", - "description": "" - }, - { - "value": "sell", - "name": "", - "description": "" - } - ], - "example": [ - "buy" - ] - }, - "symbol": { - "type": "string", - "description": "symbol", - "example": [ - "BTC-USDT", - "ETH-USDT", - "KCS-USDT" - ] - }, - "type": { - "type": "string", - "description": "only limit (default is limit)", - "enum": [ - "limit" - ], - "default": "limit", - "x-api-enum": [ - { - "value": "limit", - "name": "limit", - "description": "limit order" - } - ] - }, - "remark": { - "type": "string", - "description": "Order placement remarks, length cannot exceed 20 characters (ASCII)" - }, - "stp": { - "type": "string", - "description": "[Self Trade Prevention](https://www.kucoin.com/docs-new/doc-338146) is divided into four strategies: CN, CO, CB , and DC", - "enum": [ - "DC", - "CO", - "CN", - "CB" - ], - "x-api-enum": [ - { - "value": "DC", - "name": "", - "description": "" - }, - { - "value": "CO", - "name": "", - "description": "" - }, - { - "value": "CN", - "name": "", - "description": "" - }, - { - "value": "CB", - "name": "", - "description": "" - } - ] - }, - "price": { - "type": "string", - "description": "Specify price for order\n\nWhen placing a limit order, the price must be based on priceIncrement for the trading pair. The price increment (priceIncrement) is the price precision for the trading pair. For example, for the BTC-USDT trading pair, the priceIncrement is 0.00001000. So the price for your orders cannot be less than 0.00001000 and must be a multiple of priceIncrement. Otherwise, the order will return an invalid priceIncrement error." - }, - "size": { - "type": "string", - "description": "Specify quantity for order\n\nWhen **type** is limit, size refers to the amount of trading targets (the asset name written in front) for the trading pair. Teh Size must be based on the baseIncrement of the trading pair. The baseIncrement represents the precision for the trading pair. The size of an order must be a positive-integer multiple of baseIncrement and must be between baseMinSize and baseMaxSize.\n\nWhen **type** is market, select one out of two: size or funds" - }, - "timeInForce": { - "type": "string", - "description": "[Time in force](https://www.kucoin.com/docs-new/doc-338146) is a special strategy used during trading", - "enum": [ - "GTC", - "GTT", - "IOC", - "FOK" - ], - "default": "GTC", - "x-api-enum": [ - { - "value": "GTC", - "name": "", - "description": "" - }, - { - "value": "GTT", - "name": "", - "description": "" - }, - { - "value": "IOC", - "name": "", - "description": "" - }, - { - "value": "FOK", - "name": "", - "description": "" - } - ] - }, - "postOnly": { - "type": "boolean", - "default": false, - "description": "passive order labels, this is disabled when the order timing strategy is IOC or FOK" - }, - "hidden": { - "type": "boolean", - "description": "Hidden or not (not shown in order book)", - "default": false - }, - "iceberg": { - "type": "boolean", - "description": "Whether or not only visible portions of orders are shown in iceberg orders", - "default": false + }, + { + "name": "tradeType", + "in": "query", + "description": "The type of trading:TRADE - Spot Trading(TRADE as default), MARGIN_TRADE - Cross Margin Trading, MARGIN_ISOLATED_TRADE - Isolated Margin Trading.", + "required": false, + "schema": { + "type": "string", + "enum": [ + "TRADE", + "MARGIN_TRADE", + "MARGIN_ISOLATED_TRADE" + ], + "default": "TRADE", + "x-api-enum": [ + { + "value": "TRADE", + "name": "TRADE", + "description": "Spot Trading" + }, + { + "value": "MARGIN_TRADE", + "name": "MARGIN_TRADE", + "description": "Cross Margin Trading" + }, + { + "value": "MARGIN_ISOLATED_TRADE", + "name": "MARGIN_ISOLATED_TRADE", + "description": "Isolated Margin Trading" + } + ] + } + }, + { + "name": "startAt", + "in": "query", + "description": "Start time (milisecond)", + "required": false, + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "endAt", + "in": "query", + "description": "End time (milisecond)", + "required": false, + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "currentPage", + "in": "query", + "description": "Current request page.", + "required": false, + "schema": { + "type": "integer", + "default": 1 + } + }, + { + "name": "pageSize", + "in": "query", + "description": "Number of results per request. Minimum is 10, maximum is 500.", + "required": false, + "schema": { + "type": "integer", + "minimum": 10, + "maximum": 500, + "example": [ + 50 + ] + } + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "object", + "properties": { + "currentPage": { + "type": "integer" }, - "visibleSize": { - "type": "string", - "description": "Maximum visible quantity in iceberg orders" + "pageSize": { + "type": "integer" }, - "cancelAfter": { - "type": "integer", - "format": "int64", - "description": "Cancel after n seconds,the order timing strategy is GTT" + "totalNum": { + "type": "integer" }, - "tradeType": { - "type": "string", - "description": "The type of trading : **TRADE**(Spot Trade)", - "enum": [ - "TRADE" - ], - "default": "TRADE", - "x-api-enum": [ - { - "value": "TRADE", - "name": "TRADE", - "description": "Spot" - } - ] + "totalPage": { + "type": "integer" }, - "stop": { - "type": "string", - "description": "Either loss or entry. Requires stopPrice to be defined", - "enum": [ - "loss", - "entry" - ], - "x-api-enum": [ - { - "value": "loss", - "name": "loss", - "description": "<=" - }, - { - "value": "entry", - "name": "entry", - "description": ">=" + "items": { + "type": "array", + "items": { + "type": "object", + "properties": { + "symbol": { + "type": "string", + "description": "symbol", + "example": [ + "BTC-USDT", + "ETH-USDT", + "KCS-USDT" + ] + }, + "tradeId": { + "type": "string" + }, + "orderId": { + "type": "string", + "description": "The unique order id generated by the trading system" + }, + "counterOrderId": { + "type": "string", + "description": "Counterparty order Id" + }, + "side": { + "type": "string", + "description": "Buy or sell" + }, + "liquidity": { + "type": "string", + "description": "Liquidity type: taker or maker" + }, + "forceTaker": { + "type": "boolean" + }, + "price": { + "type": "string", + "description": "Order price" + }, + "size": { + "type": "string", + "description": "Order size" + }, + "funds": { + "type": "string", + "description": "Order Funds" + }, + "fee": { + "type": "string", + "description": "[Handling fees](https://www.kucoin.com/docs-new/api-5327739)" + }, + "feeRate": { + "type": "string", + "description": "Fee rate\n" + }, + "feeCurrency": { + "type": "string", + "description": "currency used to calculate trading fee" + }, + "stop": { + "type": "string", + "description": "Take Profit and Stop Loss type, currently HFT does not support the Take Profit and Stop Loss type, so it is empty" + }, + "tradeType": { + "type": "string", + "description": "Trade type, redundancy param" + }, + "type": { + "type": "string", + "description": "Specify if the order is an 'limit' order or 'market' order. " + }, + "createdAt": { + "type": "integer", + "format": "int64" + } } - ] - }, - "stopPrice": { - "type": "string", - "description": "Stop price, Need to be defined if stop is specified." + } } }, "required": [ - "symbol", - "side", - "clientOid", - "price", - "size" + "currentPage", + "pageSize", + "totalNum", + "totalPage", + "items" ] } }, - "symbol": { - "type": "string" - } - }, - "required": [ - "symbol" - ] - }, - "example": "{\n \"symbol\": \"BTC-USDT\",\n \"orderList\": [\n {\n \"clientOid\": \"3d07008668054da6b3cb12e432c2b13a\",\n \"side\": \"buy\",\n \"type\": \"limit\",\n \"price\": \"50000\",\n \"size\": \"0.0001\"\n },\n {\n \"clientOid\": \"37245dbe6e134b5c97732bfb36cd4a9d\",\n \"side\": \"buy\",\n \"type\": \"limit\",\n \"price\": \"49999\",\n \"size\": \"0.0001\"\n }\n ]\n}" + "required": [ + "code", + "data" + ] + } + } } } }, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"data\\\": [\\n {\\n \\\"symbol\\\": \\\"BTC-USDT\\\",\\n \\\"type\\\": \\\"limit\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"price\\\": \\\"50000\\\",\\n \\\"size\\\": \\\"0.0001\\\",\\n \\\"funds\\\": null,\\n \\\"stp\\\": \\\"\\\",\\n \\\"stop\\\": \\\"\\\",\\n \\\"stopPrice\\\": null,\\n \\\"timeInForce\\\": \\\"GTC\\\",\\n \\\"cancelAfter\\\": 0,\\n \\\"postOnly\\\": false,\\n \\\"hidden\\\": false,\\n \\\"iceberge\\\": false,\\n \\\"iceberg\\\": false,\\n \\\"visibleSize\\\": null,\\n \\\"channel\\\": \\\"API\\\",\\n \\\"id\\\": \\\"674a97dfef434f0007efc431\\\",\\n \\\"status\\\": \\\"success\\\",\\n \\\"failMsg\\\": null,\\n \\\"clientOid\\\": \\\"3d07008668054da6b3cb12e432c2b13a\\\"\\n },\\n {\\n \\\"symbol\\\": \\\"BTC-USDT\\\",\\n \\\"type\\\": \\\"limit\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"price\\\": \\\"49999\\\",\\n \\\"size\\\": \\\"0.0001\\\",\\n \\\"funds\\\": null,\\n \\\"stp\\\": \\\"\\\",\\n \\\"stop\\\": \\\"\\\",\\n \\\"stopPrice\\\": null,\\n \\\"timeInForce\\\": \\\"GTC\\\",\\n \\\"cancelAfter\\\": 0,\\n \\\"postOnly\\\": false,\\n \\\"hidden\\\": false,\\n \\\"iceberge\\\": false,\\n \\\"iceberg\\\": false,\\n \\\"visibleSize\\\": null,\\n \\\"channel\\\": \\\"API\\\",\\n \\\"id\\\": \\\"674a97dffb378b00077b9c20\\\",\\n \\\"status\\\": \\\"fail\\\",\\n \\\"failMsg\\\": \\\"Balance insufficient!\\\",\\n \\\"clientOid\\\": \\\"37245dbe6e134b5c97732bfb36cd4a9d\\\"\\n }\\n ]\\n }\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"orderList\\\": [{\\\"clientOid\\\": \\\"3d07008668054da6b3cb12e432c2b13a\\\", \\\"side\\\": \\\"buy\\\", \\\"type\\\": \\\"limit\\\", \\\"price\\\": \\\"50000\\\", \\\"size\\\": \\\"0.0001\\\"}, {\\\"clientOid\\\": \\\"37245dbe6e134b5c97732bfb36cd4a9d\\\", \\\"side\\\": \\\"buy\\\", \\\"type\\\": \\\"limit\\\", \\\"price\\\": \\\"49999\\\", \\\"size\\\": \\\"0.0001\\\"}]}" + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470350", + "x-abandon": "abandon", + "x-domain": "Spot", + "x-api-channel": "Private", + "x-api-permission": "General", + "x-api-rate-limit-pool": "Spot", + "x-sdk-service": "Spot", + "x-sdk-sub-service": "Order", + "x-sdk-method-name": "getTradeHistoryOld", + "x-sdk-method-description": "Request via this endpoint to get the recent fills. The return value is the data after Pagination, sorted in descending order according to time.", + "x-api-rate-limit": 10, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"currentPage\\\": 1,\\n \\\"pageSize\\\": 50,\\n \\\"totalNum\\\": 1,\\n \\\"totalPage\\\": 1,\\n \\\"items\\\": [\\n {\\n \\\"symbol\\\": \\\"DOGE-USDT\\\",\\n \\\"tradeId\\\": \\\"10862827223795713\\\",\\n \\\"orderId\\\": \\\"6745698ef4f1200007c561a8\\\",\\n \\\"counterOrderId\\\": \\\"6745695ef15b270007ac5076\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"liquidity\\\": \\\"taker\\\",\\n \\\"forceTaker\\\": false,\\n \\\"price\\\": \\\"0.40739\\\",\\n \\\"size\\\": \\\"10\\\",\\n \\\"funds\\\": \\\"4.0739\\\",\\n \\\"fee\\\": \\\"0.0040739\\\",\\n \\\"feeRate\\\": \\\"0.001\\\",\\n \\\"feeCurrency\\\": \\\"USDT\\\",\\n \\\"stop\\\": \\\"\\\",\\n \\\"tradeType\\\": \\\"TRADE\\\",\\n \\\"type\\\": \\\"market\\\",\\n \\\"createdAt\\\": 1732602254928\\n }\\n ]\\n }\\n}", + "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"orderId\\\": \\\"example_string_default_value\\\", \\\"side\\\": \\\"buy\\\", \\\"type\\\": \\\"limit\\\", \\\"tradeType\\\": \\\"TRADE\\\", \\\"startAt\\\": 1728663338000, \\\"endAt\\\": 1728692138000, \\\"currentPage\\\": 1, \\\"pageSize\\\": 50}" } }, - "/api/v1/orders/test": { - "post": { - "summary": "Add Order Test - Old", + "/api/v1/limit/fills": { + "get": { + "summary": "Get Recent Trade History - Old", "deprecated": true, - "description": "Order test endpoint, the request parameters and return parameters of this endpoint are exactly the same as the order endpoint, and can be used to verify whether the signature is correct and other operations. After placing an order, the order will not enter the matching system, and the order cannot be queried.", + "description": "Request via this endpoint to get a list of 1000 fills in the last 24 hours. The return value is the data after Pagination, sorted in descending order according to time.", "tags": [], - "parameters": [], + "parameters": [ + { + "name": "currentPage", + "in": "query", + "description": "Current request page.", + "required": false, + "schema": { + "type": "integer", + "default": 1 + } + }, + { + "name": "pageSize", + "in": "query", + "description": "Number of results per request. Minimum is 10, maximum is 500.", + "required": false, + "schema": { + "type": "integer", + "minimum": 10, + "maximum": 500, + "example": [ + 50 + ] + } + } + ], "responses": { "200": { "description": "", @@ -8405,16 +8560,64 @@ "type": "string" }, "data": { - "type": "object", - "properties": { - "orderId": { - "type": "string", - "description": "The unique order id generated by the trading system,which can be used later for further actions such as canceling the order." + "type": "array", + "items": { + "type": "object", + "properties": { + "symbol": { + "type": "string" + }, + "tradeId": { + "type": "string" + }, + "orderId": { + "type": "string" + }, + "counterOrderId": { + "type": "string" + }, + "side": { + "type": "string" + }, + "liquidity": { + "type": "string" + }, + "forceTaker": { + "type": "boolean" + }, + "price": { + "type": "string" + }, + "size": { + "type": "string" + }, + "funds": { + "type": "string" + }, + "fee": { + "type": "string" + }, + "feeRate": { + "type": "string" + }, + "feeCurrency": { + "type": "string" + }, + "stop": { + "type": "string" + }, + "tradeType": { + "type": "string" + }, + "type": { + "type": "string" + }, + "createdAt": { + "type": "integer", + "format": "int64" + } } - }, - "required": [ - "orderId" - ] + } } }, "required": [ @@ -8426,222 +8629,19 @@ } } }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470341", + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470351", "x-abandon": "abandon", "x-domain": "Spot", "x-api-channel": "Private", - "x-api-permission": "Spot", + "x-api-permission": "General", "x-api-rate-limit-pool": "Spot", "x-sdk-service": "Spot", "x-sdk-sub-service": "Order", - "x-sdk-method-name": "addOrderTestOld", - "x-sdk-method-description": "Order test endpoint, the request parameters and return parameters of this endpoint are exactly the same as the order endpoint, and can be used to verify whether the signature is correct and other operations. After placing an order, the order will not enter the matching system, and the order cannot be queried.", - "x-api-rate-limit": 2, - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "clientOid": { - "type": "string", - "description": "Client Order Id,The ClientOid field is a unique ID created by the user(we recommend using a UUID), and can only contain numbers, letters, underscores (_), and hyphens (-). This field is returned when order information is obtained. You can use clientOid to tag your orders. ClientOid is different from the order ID created by the service provider. Please do not initiate requests using the same clientOid. The maximum length for the ClientOid is 40 characters.\n\nPlease remember the orderId created by the service provider, it used to check for updates in order status.", - "example": [ - "5c52e11203aa677f33e493fb" - ] - }, - "side": { - "type": "string", - "description": "specify if the order is to 'buy' or 'sell'", - "enum": [ - "buy", - "sell" - ], - "x-api-enum": [ - { - "value": "buy", - "name": "", - "description": "" - }, - { - "value": "sell", - "name": "", - "description": "" - } - ], - "example": [ - "buy" - ] - }, - "symbol": { - "type": "string", - "description": "symbol", - "example": [ - "BTC-USDT", - "ETH-USDT", - "KCS-USDT" - ] - }, - "type": { - "type": "string", - "description": "specify if the order is an 'limit' order or 'market' order. \n\nThe type of order you specify when you place your order determines whether or not you need to request other parameters and also affects the execution of the matching engine.\n\nWhen placing a limit order, you must specify a price and size. The system will try to match the order according to market price or a price better than market price. If the order cannot be immediately matched, it will stay in the order book until it is matched or the user cancels.\n\nUnlike limit orders, the price for market orders fluctuates with market prices. When placing a market order, you do not need to specify a price, you only need to specify a quantity. Market orders are filled immediately and will not enter the order book. All market orders are takers and a taker fee will be charged.", - "enum": [ - "limit", - "market" - ], - "default": "limit", - "x-api-enum": [ - { - "value": "limit", - "name": "limit", - "description": "limit order" - }, - { - "value": "market", - "name": "market", - "description": "market order" - } - ] - }, - "remark": { - "type": "string", - "description": "Order placement remarks, length cannot exceed 20 characters (ASCII)" - }, - "stp": { - "type": "string", - "description": "[Self Trade Prevention](https://www.kucoin.com/docs-new/doc-338146) is divided into four strategies: CN, CO, CB , and DC", - "enum": [ - "DC", - "CO", - "CN", - "CB" - ], - "x-api-enum": [ - { - "value": "DC", - "name": "", - "description": "" - }, - { - "value": "CO", - "name": "", - "description": "" - }, - { - "value": "CN", - "name": "", - "description": "" - }, - { - "value": "CB", - "name": "", - "description": "" - } - ] - }, - "price": { - "type": "string", - "description": "Specify price for order\n\nWhen placing a limit order, the price must be based on priceIncrement for the trading pair. The price increment (priceIncrement) is the price precision for the trading pair. For example, for the BTC-USDT trading pair, the priceIncrement is 0.00001000. So the price for your orders cannot be less than 0.00001000 and must be a multiple of priceIncrement. Otherwise, the order will return an invalid priceIncrement error." - }, - "size": { - "type": "string", - "description": "Specify quantity for order\n\nWhen **type** is limit, size refers to the amount of trading targets (the asset name written in front) for the trading pair. Teh Size must be based on the baseIncrement of the trading pair. The baseIncrement represents the precision for the trading pair. The size of an order must be a positive-integer multiple of baseIncrement and must be between baseMinSize and baseMaxSize.\n\nWhen **type** is market, select one out of two: size or funds" - }, - "timeInForce": { - "type": "string", - "description": "[Time in force](https://www.kucoin.com/docs-new/doc-338146) is a special strategy used during trading", - "enum": [ - "GTC", - "GTT", - "IOC", - "FOK" - ], - "default": "GTC", - "x-api-enum": [ - { - "value": "GTC", - "name": "", - "description": "" - }, - { - "value": "GTT", - "name": "", - "description": "" - }, - { - "value": "IOC", - "name": "", - "description": "" - }, - { - "value": "FOK", - "name": "", - "description": "" - } - ] - }, - "postOnly": { - "type": "boolean", - "default": false, - "description": "passive order labels, this is disabled when the order timing strategy is IOC or FOK" - }, - "hidden": { - "type": "boolean", - "description": "Hidden or not (not shown in order book)", - "default": false - }, - "iceberg": { - "type": "boolean", - "description": "Whether or not only visible portions of orders are shown in iceberg orders", - "default": false - }, - "visibleSize": { - "type": "string", - "description": "Maximum visible quantity in iceberg orders" - }, - "cancelAfter": { - "type": "integer", - "format": "int64", - "description": "Cancel after n seconds,the order timing strategy is GTT" - }, - "funds": { - "type": "string", - "description": "When **type** is market, select one out of two: size or funds" - }, - "tradeType": { - "type": "string", - "description": "The type of trading : **TRADE**(Spot Trade), **MARGIN_TRADE** (Margin Trade). Default is **TRADE**. **Note: To improve the system performance and to accelerate order placing and processing, KuCoin has added a new interface for order placing of margin. For traders still using the current interface, please move to the new one as soon as possible. The current one will no longer accept margin orders by May 1st, 2021 (UTC). At the time, KuCoin will notify users via the announcement, please pay attention to it.**", - "enum": [ - "TRADE", - "MARGIN_TRADE" - ], - "default": "TRADE", - "x-api-enum": [ - { - "value": "TRADE", - "name": "TRADE", - "description": "Spot" - }, - { - "value": "MARGIN_TRADE", - "name": "MARGIN_TRADE", - "description": "Margin" - } - ] - } - }, - "required": [ - "symbol", - "side", - "clientOid" - ] - }, - "example": "//limit order\n{\n \"type\": \"limit\",\n \"symbol\": \"BTC-USDT\",\n \"side\": \"buy\",\n \"price\": \"50000\",\n \"size\": \"0.00001\",\n \"clientOid\": \"5c52e11203aa677f33e493fb\",\n \"remark\": \"order remarks\"\n}\n\n//market order 1\n// {\n// \"type\": \"market\",\n// \"symbol\": \"BTC-USDT\",\n// \"side\": \"buy\",\n// \"size\": \"0.00001\",\n// \"clientOid\": \"5c52e11203aa677f33e493fc\",\n// \"remark\": \"order remarks\"\n// }\n\n//market order 2\n// {\n// \"type\": \"market\",\n// \"symbol\": \"BTC-USDT\",\n// \"side\": \"buy\",\n// \"funds\": \"1\",\n// \"clientOid\": \"5c52e11203aa677f33e493fc\",\n// \"remark\": \"order remarks\"\n// }\n" - } - } - }, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"orderId\\\": \\\"674a8776291d9e00074f1edf\\\"\\n }\\n}", - "x-request-example": "{\\\"type\\\": \\\"limit\\\", \\\"symbol\\\": \\\"BTC-USDT\\\", \\\"side\\\": \\\"buy\\\", \\\"price\\\": \\\"50000\\\", \\\"size\\\": \\\"0.00001\\\", \\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\", \\\"remark\\\": \\\"order remarks\\\"}" + "x-sdk-method-name": "getRecentTradeHistoryOld", + "x-sdk-method-description": "Request via this endpoint to get a list of 1000 fills in the last 24 hours. The return value is the data after Pagination, sorted in descending order according to time.", + "x-api-rate-limit": 20, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": [\\n {\\n \\\"symbol\\\": \\\"BTC-USDT\\\",\\n \\\"tradeId\\\": \\\"11732720444522497\\\",\\n \\\"orderId\\\": \\\"674aab24754b1e00077dbc69\\\",\\n \\\"counterOrderId\\\": \\\"674aab1fb26bfb0007a18b67\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"liquidity\\\": \\\"taker\\\",\\n \\\"forceTaker\\\": false,\\n \\\"price\\\": \\\"96999.6\\\",\\n \\\"size\\\": \\\"0.00001\\\",\\n \\\"funds\\\": \\\"0.969996\\\",\\n \\\"fee\\\": \\\"0.000969996\\\",\\n \\\"feeRate\\\": \\\"0.001\\\",\\n \\\"feeCurrency\\\": \\\"USDT\\\",\\n \\\"stop\\\": \\\"\\\",\\n \\\"tradeType\\\": \\\"TRADE\\\",\\n \\\"type\\\": \\\"limit\\\",\\n \\\"createdAt\\\": 1732946724082\\n }\\n ]\\n}", + "x-request-example": "{\\\"currentPage\\\": 1, \\\"pageSize\\\": 50}" } } }, diff --git a/spec/rest/entry/openapi-account.json b/spec/rest/entry/openapi-account.json index 0a1596d6..974ba12f 100644 --- a/spec/rest/entry/openapi-account.json +++ b/spec/rest/entry/openapi-account.json @@ -116,6 +116,99 @@ "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"level\\\": 0,\\n \\\"subQuantity\\\": 3,\\n \\\"spotSubQuantity\\\": 3,\\n \\\"marginSubQuantity\\\": 2,\\n \\\"futuresSubQuantity\\\": 2,\\n \\\"optionSubQuantity\\\": 0,\\n \\\"maxSubQuantity\\\": 5,\\n \\\"maxDefaultSubQuantity\\\": 5,\\n \\\"maxSpotSubQuantity\\\": 0,\\n \\\"maxMarginSubQuantity\\\": 0,\\n \\\"maxFuturesSubQuantity\\\": 0,\\n \\\"maxOptionSubQuantity\\\": 0\\n }\\n}" } }, + "/api/v1/user/api-key": { + "get": { + "summary": "Get Apikey Info", + "deprecated": false, + "description": "Get the information of the api key. Use the api key pending to be checked to call the endpoint. Both master and sub user's api key are applicable.", + "tags": [], + "parameters": [], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "object", + "properties": { + "remark": { + "type": "string", + "description": "Remarks" + }, + "apiKey": { + "type": "string", + "description": "Apikey" + }, + "apiVersion": { + "type": "integer", + "description": "API Version" + }, + "permission": { + "type": "string", + "description": "[Permissions](https://www.kucoin.com/docs-new/doc-338144), possible values: General, Spot, Margin, Futures, InnerTransfer, Transfer, Earn" + }, + "ipWhitelist": { + "type": "string", + "description": "IP whitelist\n\n" + }, + "createdAt": { + "type": "integer", + "description": "Apikey create time", + "format": "int64" + }, + "uid": { + "type": "integer", + "description": "Account UID" + }, + "isMaster": { + "type": "boolean", + "description": "Whether it is the master account." + }, + "subName": { + "type": "string", + "description": "Sub Name, There is no such param for the master account" + } + }, + "required": [ + "remark", + "apiKey", + "apiVersion", + "permission", + "createdAt", + "uid", + "isMaster" + ] + } + }, + "required": [ + "code", + "data" + ] + } + } + } + } + }, + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470130", + "x-abandon": "normal", + "x-domain": "Spot", + "x-api-channel": "Private", + "x-api-permission": "General", + "x-api-rate-limit-pool": "Management", + "x-sdk-service": "Account", + "x-sdk-sub-service": "Account", + "x-sdk-method-name": "getApikeyInfo", + "x-sdk-method-description": "Get the information of the api key. Use the api key pending to be checked to call the endpoint. Both master and sub user's api key are applicable.", + "x-api-rate-limit": 20, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"remark\\\": \\\"account1\\\",\\n \\\"apiKey\\\": \\\"6705f5c311545b000157d3eb\\\",\\n \\\"apiVersion\\\": 3,\\n \\\"permission\\\": \\\"General,Futures,Spot,Earn,InnerTransfer,Transfer,Margin\\\",\\n \\\"ipWhitelist\\\": \\\"203.**.154,103.**.34\\\",\\n \\\"createdAt\\\": 1728443843000,\\n \\\"uid\\\": 165111215,\\n \\\"isMaster\\\": true\\n }\\n}" + } + }, "/api/v1/hf/accounts/opened": { "get": { "summary": "Get Account Type - Spot ", @@ -162,97 +255,46 @@ "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":false}" } }, - "/api/v1/accounts/ledgers": { + "/api/v1/accounts": { "get": { - "summary": "Get Account Ledgers - Spot/Margin", + "summary": "Get Account List - Spot", "deprecated": false, - "description": "This interface is for transaction records from all types of your accounts, supporting inquiry of various currencies. Items are paginated and sorted to show the latest first. See the Pagination section for retrieving additional entries after the first page.", + "description": "Get a list of accounts. Please Deposit to the main account firstly, then transfer the funds to the trade account via Inner Transfer before transaction.", "tags": [], "parameters": [ { "name": "currency", "in": "query", - "description": "Currency ( you can choose more than one currency). You can specify 10 currencies at most for one time. If not specified, all currencies will be inquired by default.", + "description": "currency", "required": false, "schema": { "type": "string" } }, { - "name": "direction", + "name": "type", "in": "query", - "description": "direction: in, out", + "description": "Account type main、trade", "required": false, "schema": { "type": "string", "enum": [ - "in", - "out" + "main", + "trade" ], "x-api-enum": [ { - "value": "in", - "name": "", - "description": "" + "value": "main", + "name": "main", + "description": "Funding account" }, { - "value": "out", - "name": "", - "description": "" + "value": "trade", + "name": "trade", + "description": "Spot account" } ] } - }, - { - "name": "bizType", - "in": "query", - "description": "Type: DEPOSIT -deposit, WITHDRAW -withdraw, TRANSFER -transfer, SUB_TRANSFER -subaccount transfer,TRADE_EXCHANGE -trade, MARGIN_EXCHANGE -margin trade, KUCOIN_BONUS -bonus, BROKER_TRANSFER -Broker transfer record", - "required": false, - "schema": { - "type": "string" - } - }, - { - "name": "startAt", - "in": "query", - "description": "Start time (milisecond)", - "required": false, - "schema": { - "type": "integer", - "format": "int64" - } - }, - { - "name": "endAt", - "in": "query", - "description": "End time (milisecond)", - "required": false, - "schema": { - "type": "integer", - "format": "int64" - } - }, - { - "name": "currentPage", - "in": "query", - "description": "Current request page.", - "required": false, - "schema": { - "type": "integer", - "default": 1 - } - }, - { - "name": "pageSize", - "in": "query", - "description": "Number of results per request. Minimum is 10, maximum is 500.", - "required": false, - "schema": { - "type": "integer", - "default": 50, - "minimum": 10, - "maximum": 500 - } } ], "responses": { @@ -267,81 +309,60 @@ "type": "string" }, "data": { - "type": "object", - "properties": { - "currentPage": { - "type": "integer", - "description": "current page" - }, - "pageSize": { - "type": "integer", - "description": "page size" - }, - "totalNum": { - "type": "integer", - "description": "total number" - }, - "totalPage": { - "type": "integer", - "description": "total page" - }, - "items": { - "type": "array", - "items": { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "unique id" - }, - "currency": { - "type": "string", - "description": "The currency of an account" - }, - "amount": { - "type": "string", - "description": "The total amount of assets (fees included) involved in assets changes such as transaction, withdrawal and bonus distribution." - }, - "fee": { - "type": "string", - "description": "Fees generated in transaction, withdrawal, etc." - }, - "balance": { - "type": "string", - "description": "Remaining funds after the transaction." - }, - "accountType": { - "type": "string", - "description": "The account type of the master user: MAIN, TRADE, MARGIN or CONTRACT." - }, - "bizType": { - "type": "string", - "description": "Business type leading to the changes in funds, such as exchange, withdrawal, deposit, KUCOIN_BONUS, REFERRAL_BONUS, Lendings etc." - }, - "direction": { - "type": "string", - "description": "Side, out or in" - }, - "createdAt": { - "type": "integer", - "description": "Time of the event", - "format": "int64" + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Account ID" + }, + "currency": { + "type": "string", + "description": "Currency" + }, + "type": { + "type": "string", + "description": "Account type:,main、trade、isolated(abandon)、margin(abandon)\n", + "enum": [ + "main", + "trade" + ], + "x-api-enum": [ + { + "value": "main", + "name": "main", + "description": "Funding account" }, - "context": { - "type": "string", - "description": "Business related information such as order ID, serial No., etc." + { + "value": "trade", + "name": "trade", + "description": "Spot account" } - } + ] + }, + "balance": { + "type": "string", + "description": "Total funds in the account" + }, + "available": { + "type": "string", + "description": "Funds available to withdraw or trade" + }, + "holds": { + "type": "string", + "description": "Funds on hold (not available for use)" } - } - }, - "required": [ - "currentPage", - "pageSize", - "totalNum", - "totalPage", - "items" - ] + }, + "required": [ + "id", + "currency", + "type", + "balance", + "available", + "holds" + ] + } } }, "required": [ @@ -353,7 +374,7 @@ } } }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470121", + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470125", "x-abandon": "normal", "x-domain": "Spot", "x-api-channel": "Private", @@ -361,48 +382,126 @@ "x-api-rate-limit-pool": "Management", "x-sdk-service": "Account", "x-sdk-sub-service": "Account", - "x-sdk-method-name": "getSpotLedger", - "x-sdk-method-description": "This interface is for transaction records from all types of your accounts, supporting inquiry of various currencies. Items are paginated and sorted to show the latest first. See the Pagination section for retrieving additional entries after the first page.", - "x-api-rate-limit": 2, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"currentPage\\\": 1,\\n \\\"pageSize\\\": 50,\\n \\\"totalNum\\\": 1,\\n \\\"totalPage\\\": 1,\\n \\\"items\\\": [\\n {\\n \\\"id\\\": \\\"265329987780896\\\",\\n \\\"currency\\\": \\\"USDT\\\",\\n \\\"amount\\\": \\\"0.01\\\",\\n \\\"fee\\\": \\\"0\\\",\\n \\\"balance\\\": \\\"0\\\",\\n \\\"accountType\\\": \\\"TRADE\\\",\\n \\\"bizType\\\": \\\"SUB_TRANSFER\\\",\\n \\\"direction\\\": \\\"out\\\",\\n \\\"createdAt\\\": 1728658481484,\\n \\\"context\\\": \\\"\\\"\\n }\\n ]\\n }\\n}", - "x-request-example": "{\\\"currency\\\": \\\"BTC\\\", \\\"direction\\\": \\\"in\\\", \\\"bizType\\\": \\\"TRANSFER\\\", \\\"startAt\\\": 1728663338000, \\\"endAt\\\": 1728692138000, \\\"currentPage\\\": 1, \\\"pageSize\\\": 50}" + "x-sdk-method-name": "getSpotAccountList", + "x-sdk-method-description": "Get a list of accounts. Please Deposit to the main account firstly, then transfer the funds to the trade account via Inner Transfer before transaction.", + "x-api-rate-limit": 5, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": [\\n {\\n \\\"id\\\": \\\"548674591753\\\",\\n \\\"currency\\\": \\\"USDT\\\",\\n \\\"type\\\": \\\"trade\\\",\\n \\\"balance\\\": \\\"26.66759503\\\",\\n \\\"available\\\": \\\"26.66759503\\\",\\n \\\"holds\\\": \\\"0\\\"\\n },\\n {\\n \\\"id\\\": \\\"63355cd156298d0001b66e61\\\",\\n \\\"currency\\\": \\\"USDT\\\",\\n \\\"type\\\": \\\"main\\\",\\n \\\"balance\\\": \\\"0.01\\\",\\n \\\"available\\\": \\\"0.01\\\",\\n \\\"holds\\\": \\\"0\\\"\\n }\\n ]\\n}", + "x-request-example": "{\\\"currency\\\": \\\"USDT\\\", \\\"type\\\": \\\"main\\\"}" } }, - "/api/v1/hf/accounts/ledgers": { + "/api/v1/accounts/{accountId}": { "get": { - "summary": "Get Account Ledgers - Trade_hf", + "summary": "Get Account Detail - Spot", "deprecated": false, - "description": "This API endpoint returns all transfer (in and out) records in high-frequency trading account and supports multi-coin queries. The query results are sorted in descending order by createdAt and id.", + "description": "get Information for a single spot account. Use this endpoint when you know the accountId.", "tags": [], "parameters": [ { - "name": "currency", - "in": "query", - "description": "Currency ( you can choose more than one currency). You can specify 10 currencies at most for one time. If not specified, all currencies will be inquired by default.", - "required": false, + "name": "accountId", + "in": "path", + "description": "Path parameter. Account ID", + "required": true, "schema": { "type": "string" } - }, + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "object", + "properties": { + "currency": { + "type": "string", + "description": "The currency of the account" + }, + "balance": { + "type": "string", + "description": "Total funds in the account" + }, + "available": { + "type": "string", + "description": "Funds available to withdraw or trade" + }, + "holds": { + "type": "string", + "description": "Funds on hold (not available for use)" + } + }, + "required": [ + "currency", + "balance", + "available", + "holds" + ] + } + }, + "required": [ + "code", + "data" + ] + } + } + } + } + }, + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470126", + "x-abandon": "normal", + "x-domain": "Spot", + "x-api-channel": "Private", + "x-api-permission": "General", + "x-api-rate-limit-pool": "Management", + "x-sdk-service": "Account", + "x-sdk-sub-service": "Account", + "x-sdk-method-name": "getSpotAccountDetail", + "x-sdk-method-description": "get Information for a single spot account. Use this endpoint when you know the accountId.", + "x-api-rate-limit": 5, + "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"currency\\\":\\\"USDT\\\",\\\"balance\\\":\\\"26.66759503\\\",\\\"available\\\":\\\"26.66759503\\\",\\\"holds\\\":\\\"0\\\"}}", + "x-request-example": "{\\\"accountId\\\": \\\"548674591753\\\"}" + } + }, + "/api/v3/margin/accounts": { + "get": { + "summary": "Get Account - Cross Margin", + "deprecated": false, + "description": "Request via this endpoint to get the info of the cross margin account.", + "tags": [], + "parameters": [ { - "name": "direction", + "name": "quoteCurrency", "in": "query", - "description": "direction: in, out", + "description": "quote currency, currently only supports USDT, KCS, BTC, USDT as default", "required": false, "schema": { "type": "string", + "default": "USDT", "enum": [ - "in", - "out" + "USDT", + "KCS", + "BTC" ], "x-api-enum": [ { - "value": "in", + "value": "USDT", "name": "", "description": "" }, { - "value": "out", + "value": "KCS", + "name": "", + "description": "" + }, + { + "value": "BTC", "name": "", "description": "" } @@ -410,71 +509,36 @@ } }, { - "name": "bizType", + "name": "queryType", "in": "query", - "description": "Transaction type: TRANSFER-transfer funds,TRADE_EXCHANGE-Trade", + "description": "Query account type (default MARGIN), MARGIN - only query low frequency cross margin account, MARGIN_V2-only query high frequency cross margin account, ALL - consistent aggregate query with the web side", "required": false, "schema": { "type": "string", + "default": "MARGIN", "enum": [ - "TRADE_EXCHANGE", - "TRANSFER" + "MARGIN", + "MARGIN_V2", + "ALL" ], "x-api-enum": [ { - "value": "TRADE_EXCHANGE", + "value": "MARGIN", "name": "", "description": "" }, { - "value": "TRANSFER", + "value": "MARGIN_V2", + "name": "", + "description": "" + }, + { + "value": "ALL", "name": "", "description": "" } ] } - }, - { - "name": "lastId", - "in": "query", - "description": "The id of the last set of data from the previous batch of data. By default, the latest information is given.", - "required": false, - "schema": { - "type": "integer", - "format": "int64" - } - }, - { - "name": "limit", - "in": "query", - "description": "Default100,Max200", - "required": false, - "schema": { - "type": "integer", - "default": 100, - "maximum": 200, - "minimum": 1 - } - }, - { - "name": "startAt", - "in": "query", - "description": "Start time (milisecond)", - "required": false, - "schema": { - "type": "integer", - "format": "int64" - } - }, - { - "name": "endAt", - "in": "query", - "description": "End time (milisecond)", - "required": false, - "schema": { - "type": "integer", - "format": "int64" - } } ], "responses": { @@ -489,84 +553,117 @@ "type": "string" }, "data": { - "type": "array", - "items": { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "Unique id" - }, - "currency": { - "type": "string", - "description": "currency" - }, - "amount": { - "type": "string", - "description": "Change in funds balance" - }, - "fee": { - "type": "string", - "description": "Deposit or withdrawal fee" - }, - "tax": { - "type": "string" - }, - "balance": { - "type": "string", - "description": "Total balance of funds after change" - }, - "accountType": { - "type": "string", - "description": "Master account type TRADE_HF" - }, - "bizType": { - "type": "string", - "description": "Trnasaction type,such as TRANSFER, TRADE_EXCHANGE, etc." - }, - "direction": { - "type": "string", - "description": "Direction of transfer( out or in)", - "enum": [ - "in", - "out" - ], - "x-api-enum": [ - { - "value": "in", - "name": "", - "description": "" + "type": "object", + "properties": { + "totalAssetOfQuoteCurrency": { + "type": "string", + "description": "Total Assets in Quote Currency" + }, + "totalLiabilityOfQuoteCurrency": { + "type": "string", + "description": "Total Liability in Quote Currency" + }, + "debtRatio": { + "type": "string", + "description": "debt ratio" + }, + "status": { + "type": "string", + "description": "Position status; EFFECTIVE-effective, BANKRUPTCY-bankruptcy liquidation, LIQUIDATION-closing, REPAY-repayment, BORROW borrowing", + "enum": [ + "EFFECTIVE", + "BANKRUPTCY", + "LIQUIDATION", + "REPAY", + "BORROW" + ], + "x-api-enum": [ + { + "value": "EFFECTIVE", + "name": "EFFECTIVE", + "description": "Effective" + }, + { + "value": "BANKRUPTCY", + "name": "BANKRUPTCY", + "description": "Bankruptcy liquidation" + }, + { + "value": "LIQUIDATION", + "name": "LIQUIDATION", + "description": "Closing" + }, + { + "value": "REPAY", + "name": "REPAY", + "description": "Repayment" + }, + { + "value": "BORROW", + "name": "BORROW", + "description": "Borrowing" + } + ] + }, + "accounts": { + "type": "array", + "items": { + "type": "object", + "properties": { + "currency": { + "type": "string", + "description": "currency" }, - { - "value": "out", - "name": "", - "description": "" + "total": { + "type": "string", + "description": "Total Assets" + }, + "available": { + "type": "string", + "description": "Account available assets (total assets - frozen)" + }, + "hold": { + "type": "string", + "description": "Account frozen assets" + }, + "liability": { + "type": "string", + "description": "Liabilities" + }, + "maxBorrowSize": { + "type": "string", + "description": "The user's remaining maximum loan amount" + }, + "borrowEnabled": { + "type": "boolean", + "description": "Support borrow or not" + }, + "transferInEnabled": { + "type": "boolean", + "description": "Support transfer or not" } + }, + "required": [ + "currency", + "total", + "available", + "hold", + "liability", + "maxBorrowSize", + "borrowEnabled", + "transferInEnabled" ] }, - "createdAt": { - "type": "string", - "description": "Created time" - }, - "context": { - "type": "string", - "description": "Core transaction parameter" - } - }, - "required": [ - "id", - "currency", - "amount", - "fee", - "tax", - "balance", - "accountType", - "bizType", - "direction", - "createdAt", - "context" - ] - } + "description": "Margin account list" + } + }, + "required": [ + "totalAssetOfQuoteCurrency", + "totalLiabilityOfQuoteCurrency", + "debtRatio", + "status", + "accounts" + ] } }, "required": [ @@ -578,7 +675,7 @@ } } }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470122", + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470127", "x-abandon": "normal", "x-domain": "Spot", "x-api-channel": "Private", @@ -586,48 +683,55 @@ "x-api-rate-limit-pool": "Spot", "x-sdk-service": "Account", "x-sdk-sub-service": "Account", - "x-sdk-method-name": "getSpotHFLedger", - "x-sdk-method-description": "This API endpoint returns all transfer (in and out) records in high-frequency trading account and supports multi-coin queries. The query results are sorted in descending order by createdAt and id.", - "x-api-rate-limit": 2, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": [\\n {\\n \\\"id\\\": \\\"254062248624417\\\",\\n \\\"currency\\\": \\\"USDT\\\",\\n \\\"amount\\\": \\\"1.59760080\\\",\\n \\\"fee\\\": \\\"0.00159920\\\",\\n \\\"tax\\\": \\\"0\\\",\\n \\\"balance\\\": \\\"26.73759503\\\",\\n \\\"accountType\\\": \\\"TRADE_HF\\\",\\n \\\"bizType\\\": \\\"TRADE_EXCHANGE\\\",\\n \\\"direction\\\": \\\"in\\\",\\n \\\"createdAt\\\": \\\"1728443957539\\\",\\n \\\"context\\\": \\\"{\\\\\\\"symbol\\\\\\\":\\\\\\\"KCS-USDT\\\\\\\",\\\\\\\"orderId\\\\\\\":\\\\\\\"6705f6350dc7210007d6a36d\\\\\\\",\\\\\\\"tradeId\\\\\\\":\\\\\\\"10046097631627265\\\\\\\"}\\\"\\n }\\n ]\\n}", - "x-request-example": "{\\\"currency\\\": \\\"BTC\\\", \\\"direction\\\": \\\"in\\\", \\\"bizType\\\": \\\"TRANSFER\\\", \\\"lastId\\\": 254062248624417, \\\"limit\\\": 100, \\\"startAt\\\": 1728663338000, \\\"endAt\\\": 1728692138000}" + "x-sdk-method-name": "getCrossMarginAccount", + "x-sdk-method-description": "Request via this endpoint to get the info of the cross margin account.", + "x-api-rate-limit": 15, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"totalAssetOfQuoteCurrency\\\": \\\"0.02\\\",\\n \\\"totalLiabilityOfQuoteCurrency\\\": \\\"0\\\",\\n \\\"debtRatio\\\": \\\"0\\\",\\n \\\"status\\\": \\\"EFFECTIVE\\\",\\n \\\"accounts\\\": [\\n {\\n \\\"currency\\\": \\\"USDT\\\",\\n \\\"total\\\": \\\"0.02\\\",\\n \\\"available\\\": \\\"0.02\\\",\\n \\\"hold\\\": \\\"0\\\",\\n \\\"liability\\\": \\\"0\\\",\\n \\\"maxBorrowSize\\\": \\\"0\\\",\\n \\\"borrowEnabled\\\": true,\\n \\\"transferInEnabled\\\": true\\n }\\n ]\\n }\\n}", + "x-request-example": "{\\\"quoteCurrency\\\": \\\"USDT\\\", \\\"queryType\\\": \\\"MARGIN\\\"}" } }, - "/api/v3/hf/margin/account/ledgers": { + "/api/v3/isolated/accounts": { "get": { - "summary": "Get Account Ledgers - Margin_hf", + "summary": "Get Account - Isolated Margin", "deprecated": false, - "description": "This API endpoint returns all transfer (in and out) records in high-frequency margin trading account and supports multi-coin queries. The query results are sorted in descending order by createdAt and id.", + "description": "Request via this endpoint to get the info of the isolated margin account.", "tags": [], "parameters": [ { - "name": "currency", + "name": "symbol", "in": "query", - "description": "currency, optional,can select more than one,separate with commas,select no more than 10 currencys,the default will be to query for all currencys if left empty", + "description": "For isolated trading pairs, query all without passing", "required": false, "schema": { "type": "string" } }, { - "name": "direction", + "name": "quoteCurrency", "in": "query", - "description": "direction: in, out", + "description": "quote currency, currently only supports USDT, KCS, BTC, USDT as default", "required": false, "schema": { "type": "string", + "default": "USDT", "enum": [ - "in", - "out" + "USDT", + "KCS", + "BTC" ], "x-api-enum": [ { - "value": "in", + "value": "USDT", "name": "", "description": "" }, { - "value": "out", + "value": "KCS", + "name": "", + "description": "" + }, + { + "value": "BTC", "name": "", "description": "" } @@ -635,219 +739,35 @@ } }, { - "name": "bizType", - "in": "query", - "description": "Transaction type: TRANSFER- transfer funds, MARGIN_EXCHANGE - cross margin trade, ISOLATED_EXCHANGE - isolated margin trade, LIQUIDATION - liquidation, ASSERT_RETURN - forced liquidation asset return", - "required": false, - "schema": { - "type": "string" - } - }, - { - "name": "lastId", - "in": "query", - "description": "The id of the last set of data from the previous batch of data. By default, the latest information is given.", - "required": false, - "schema": { - "type": "integer", - "format": "int64" - } - }, - { - "name": "limit", - "in": "query", - "description": "Default100,Max200", - "required": false, - "schema": { - "type": "integer", - "default": 100, - "maximum": 200, - "minimum": 1 - } - }, - { - "name": "startAt", - "in": "query", - "description": "Start time (milisecond)", - "required": false, - "schema": { - "type": "integer", - "format": "int64" - } - }, - { - "name": "endAt", + "name": "queryType", "in": "query", - "description": "End time (milisecond)", + "description": "Query account type (default ISOLATED), ISOLATED- - only query low frequency isolated margin account, ISOLATED_V2-only query high frequency isolated margin account, ALL - consistent aggregate query with the web side", "required": false, "schema": { - "type": "integer", - "format": "int64" - } - } - ], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "data": { - "type": "array", - "items": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int64" - }, - "currency": { - "type": "string", - "description": "currency" - }, - "amount": { - "type": "string", - "description": "Change in funds balance" - }, - "fee": { - "type": "string", - "description": "Deposit or withdrawal fee" - }, - "balance": { - "type": "string", - "description": "Total balance of funds after change" - }, - "accountType": { - "type": "string", - "description": "Master account type TRADE_HF" - }, - "bizType": { - "type": "string", - "description": "Trnasaction type,such as TRANSFER, TRADE_EXCHANGE, etc." - }, - "direction": { - "type": "string", - "description": "Direction of transfer( out or in)" - }, - "createdAt": { - "type": "integer", - "description": "Ledger creation time", - "format": "int64" - }, - "context": { - "type": "string", - "description": "Core transaction parameter" - }, - "tax": { - "type": "string" - } - } - } - } - }, - "required": [ - "code", - "data" - ] - } - } - } - } - }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470123", - "x-abandon": "normal", - "x-domain": "Spot", - "x-api-channel": "Private", - "x-api-permission": "General", - "x-api-rate-limit-pool": "Spot", - "x-sdk-service": "Account", - "x-sdk-sub-service": "Account", - "x-sdk-method-name": "getMarginHFLedger", - "x-sdk-method-description": "This API endpoint returns all transfer (in and out) records in high-frequency margin trading account and supports multi-coin queries. The query results are sorted in descending order by createdAt and id.", - "x-api-rate-limit": 2, - "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":[{\\\"id\\\":1949641706720,\\\"currency\\\":\\\"USDT\\\",\\\"amount\\\":\\\"0.01000000\\\",\\\"fee\\\":\\\"0.00000000\\\",\\\"balance\\\":\\\"0.01000000\\\",\\\"accountType\\\":\\\"MARGIN_V2\\\",\\\"bizType\\\":\\\"TRANSFER\\\",\\\"direction\\\":\\\"in\\\",\\\"createdAt\\\":1728664091208,\\\"context\\\":\\\"{}\\\",\\\"tax\\\":\\\"0.00000000\\\"}]}", - "x-request-example": "{\\\"currency\\\": \\\"BTC\\\", \\\"direction\\\": \\\"in\\\", \\\"bizType\\\": \\\"TRANSFER\\\", \\\"lastId\\\": 254062248624417, \\\"limit\\\": 100, \\\"startAt\\\": 1728663338000, \\\"endAt\\\": 1728692138000}" - } - }, - "/api/v1/transaction-history": { - "get": { - "summary": "Get Account Ledgers - Futures", - "deprecated": false, - "description": "This interface can query the ledger records of the futures business line", - "tags": [], - "parameters": [ - { - "name": "currency", - "in": "query", - "description": "Currency of transaction history, XBT or USDT", - "required": false, - "schema": { - "type": "string" - } - }, - { - "name": "type", - "in": "query", - "description": "Type RealisedPNL-Realised profit and loss, Deposit-Deposit, Withdrawal-withdraw, Transferin-Transfer in, TransferOut-Transfer out", - "required": false, - "schema": { - "type": "string" - } - }, - { - "name": "offset", - "in": "query", - "description": "Start offset. Generally, the only attribute of the last returned result of the previous request is used, and the first page is returned by default", - "required": false, - "schema": { - "type": "integer", - "format": "int64" - } - }, - { - "name": "forward", - "in": "query", - "description": "This parameter functions to judge whether the lookup is forward or not. True means “yes” and False means “no”. This parameter is set as true by default", - "required": false, - "schema": { - "type": "boolean", - "default": true - } - }, - { - "name": "maxCount", - "in": "query", - "description": "Displayed size per page. The default size is 50", - "required": false, - "schema": { - "type": "integer", - "default": 50, - "format": "int64" - } - }, - { - "name": "startAt", - "in": "query", - "description": "Start time (milisecond)", - "required": false, - "schema": { - "type": "integer", - "format": "int64" - } - }, - { - "name": "endAt", - "in": "query", - "description": "End time (milisecond)", - "required": false, - "schema": { - "type": "integer", - "format": "int64" + "type": "string", + "default": "ISOLATED", + "enum": [ + "ISOLATED", + "ISOLATED_V2", + "ALL" + ], + "x-api-enum": [ + { + "value": "ISOLATED", + "name": "", + "description": "" + }, + { + "value": "ISOLATED_V2", + "name": "", + "description": "" + }, + { + "value": "ALL", + "name": "", + "description": "" + } + ] } } ], @@ -865,70 +785,182 @@ "data": { "type": "object", "properties": { - "dataList": { + "totalAssetOfQuoteCurrency": { + "type": "string", + "description": "Total Assets in Quote Currency" + }, + "totalLiabilityOfQuoteCurrency": { + "type": "string", + "description": "Total Liability in Quote Currency" + }, + "timestamp": { + "type": "integer", + "description": "timestamp", + "format": "int64" + }, + "assets": { "type": "array", "items": { "type": "object", "properties": { - "time": { - "type": "integer", - "description": "ledger time", - "format": "int64" - }, - "type": { + "symbol": { "type": "string", - "description": "Type: RealisedPNL, Deposit, Withdrawal, TransferIn, TransferOut" - }, - "amount": { - "type": "number", - "description": "Transaction amount" - }, - "fee": { - "type": "number", - "description": "Fee" - }, - "accountEquity": { - "type": "number", - "description": "Account equity" + "description": "Symbol" }, "status": { "type": "string", - "description": "Status: Completed, Pending" + "description": "Position status; EFFECTIVE-effective, BANKRUPTCY-bankruptcy liquidation, LIQUIDATION-closing, REPAY-repayment, BORROW borrowing", + "enum": [ + "EFFECTIVE", + "BANKRUPTCY", + "LIQUIDATION", + "REPAY", + "BORROW" + ], + "x-api-enum": [ + { + "value": "EFFECTIVE", + "name": "EFFECTIVE", + "description": "Effective" + }, + { + "value": "BANKRUPTCY", + "name": "BANKRUPTCY", + "description": "Bankruptcy liquidation" + }, + { + "value": "LIQUIDATION", + "name": "LIQUIDATION", + "description": "Closing" + }, + { + "value": "REPAY", + "name": "REPAY", + "description": "Repayment" + }, + { + "value": "BORROW", + "name": "BORROW", + "description": "Borrowing" + } + ] }, - "remark": { + "debtRatio": { "type": "string", - "description": "Ticker symbol of the contract" + "description": "debt ratio" }, - "offset": { - "type": "integer", - "description": "Offset" + "baseAsset": { + "type": "object", + "properties": { + "currency": { + "type": "string", + "description": "currency" + }, + "borrowEnabled": { + "type": "boolean", + "description": "Support borrow or not" + }, + "transferInEnabled": { + "type": "boolean", + "description": "Support transfer or not" + }, + "liability": { + "type": "string", + "description": "Liabilities" + }, + "total": { + "type": "string", + "description": "Total Assets" + }, + "available": { + "type": "string", + "description": "Account available assets (total assets - frozen)" + }, + "hold": { + "type": "string", + "description": "Account frozen assets" + }, + "maxBorrowSize": { + "type": "string", + "description": "The user's remaining maximum loan amount" + } + }, + "required": [ + "currency", + "borrowEnabled", + "transferInEnabled", + "liability", + "total", + "available", + "hold", + "maxBorrowSize" + ], + "description": "base asset" }, - "currency": { - "type": "string", - "description": "Currency" + "quoteAsset": { + "type": "object", + "properties": { + "currency": { + "type": "string", + "description": "currency" + }, + "borrowEnabled": { + "type": "boolean", + "description": "Support borrow or not" + }, + "transferInEnabled": { + "type": "boolean", + "description": "Support transfer or not" + }, + "liability": { + "type": "string", + "description": "Liabilities" + }, + "total": { + "type": "string", + "description": "Total Assets" + }, + "available": { + "type": "string", + "description": "Account available assets (total assets - frozen)" + }, + "hold": { + "type": "string", + "description": "Account frozen assets" + }, + "maxBorrowSize": { + "type": "string", + "description": "The user's remaining maximum loan amount" + } + }, + "required": [ + "currency", + "borrowEnabled", + "transferInEnabled", + "liability", + "total", + "available", + "hold", + "maxBorrowSize" + ], + "description": "quote asset" } }, "required": [ - "time", - "type", - "amount", - "fee", - "accountEquity", + "symbol", "status", - "remark", - "offset", - "currency" + "debtRatio", + "baseAsset", + "quoteAsset" ] } - }, - "hasMore": { - "type": "boolean", - "description": "Is it the last page. If it is false, it means it is the last page, and if it is true, it means need to turn the page." } }, "required": [ - "dataList", - "hasMore" + "totalAssetOfQuoteCurrency", + "totalLiabilityOfQuoteCurrency", + "timestamp", + "assets" ] } }, @@ -941,59 +973,39 @@ } } }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470124", + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470128", "x-abandon": "normal", - "x-domain": "Futures", + "x-domain": "Spot", "x-api-channel": "Private", "x-api-permission": "General", - "x-api-rate-limit-pool": "Futures", + "x-api-rate-limit-pool": "Spot", "x-sdk-service": "Account", "x-sdk-sub-service": "Account", - "x-sdk-method-name": "getFuturesLedger", - "x-sdk-method-description": "This interface can query the ledger records of the futures business line", - "x-api-rate-limit": 2, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"dataList\\\": [\\n {\\n \\\"time\\\": 1728665747000,\\n \\\"type\\\": \\\"TransferIn\\\",\\n \\\"amount\\\": 0.01,\\n \\\"fee\\\": 0.0,\\n \\\"accountEquity\\\": 14.02924938,\\n \\\"status\\\": \\\"Completed\\\",\\n \\\"remark\\\": \\\"Transferred from High-Frequency Trading Account\\\",\\n \\\"offset\\\": 51360793,\\n \\\"currency\\\": \\\"USDT\\\"\\n },\\n {\\n \\\"time\\\": 1728648000000,\\n \\\"type\\\": \\\"RealisedPNL\\\",\\n \\\"amount\\\": 0.00630042,\\n \\\"fee\\\": 0.0,\\n \\\"accountEquity\\\": 20.0,\\n \\\"status\\\": \\\"Completed\\\",\\n \\\"remark\\\": \\\"XBTUSDTM\\\",\\n \\\"offset\\\": 51352430,\\n \\\"currency\\\": \\\"USDT\\\"\\n }\\n ],\\n \\\"hasMore\\\": false\\n }\\n}", - "x-request-example": "{\\\"currency\\\": \\\"XBT\\\", \\\"type\\\": \\\"Transferin\\\", \\\"offset\\\": 254062248624417, \\\"forward\\\": true, \\\"maxCount\\\": 50, \\\"startAt\\\": 1728663338000, \\\"endAt\\\": 1728692138000}" + "x-sdk-method-name": "getIsolatedMarginAccount", + "x-sdk-method-description": "Request via this endpoint to get the info of the isolated margin account.", + "x-api-rate-limit": 15, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"totalAssetOfQuoteCurrency\\\": \\\"0.01\\\",\\n \\\"totalLiabilityOfQuoteCurrency\\\": \\\"0\\\",\\n \\\"timestamp\\\": 1728725465994,\\n \\\"assets\\\": [\\n {\\n \\\"symbol\\\": \\\"BTC-USDT\\\",\\n \\\"status\\\": \\\"EFFECTIVE\\\",\\n \\\"debtRatio\\\": \\\"0\\\",\\n \\\"baseAsset\\\": {\\n \\\"currency\\\": \\\"BTC\\\",\\n \\\"borrowEnabled\\\": true,\\n \\\"transferInEnabled\\\": true,\\n \\\"liability\\\": \\\"0\\\",\\n \\\"total\\\": \\\"0\\\",\\n \\\"available\\\": \\\"0\\\",\\n \\\"hold\\\": \\\"0\\\",\\n \\\"maxBorrowSize\\\": \\\"0\\\"\\n },\\n \\\"quoteAsset\\\": {\\n \\\"currency\\\": \\\"USDT\\\",\\n \\\"borrowEnabled\\\": true,\\n \\\"transferInEnabled\\\": true,\\n \\\"liability\\\": \\\"0\\\",\\n \\\"total\\\": \\\"0.01\\\",\\n \\\"available\\\": \\\"0.01\\\",\\n \\\"hold\\\": \\\"0\\\",\\n \\\"maxBorrowSize\\\": \\\"0\\\"\\n }\\n }\\n ]\\n }\\n}", + "x-request-example": "{\\\"symbol\\\": \\\"example_string_default_value\\\", \\\"quoteCurrency\\\": \\\"USDT\\\", \\\"queryType\\\": \\\"ISOLATED\\\"}" } }, - "/api/v1/accounts": { + "/api/v1/account-overview": { "get": { - "summary": "Get Account List - Spot", + "summary": "Get Account - Futures", "deprecated": false, - "description": "Get a list of accounts. Please Deposit to the main account firstly, then transfer the funds to the trade account via Inner Transfer before transaction.", + "description": "Request via this endpoint to get the info of the futures account.", "tags": [], "parameters": [ { "name": "currency", "in": "query", - "description": "currency", - "required": false, - "schema": { - "type": "string" - } - }, - { - "name": "type", - "in": "query", - "description": "Account type main、trade", + "description": "Currecny, Default XBT", "required": false, "schema": { "type": "string", - "enum": [ - "main", - "trade" - ], - "x-api-enum": [ - { - "value": "main", - "name": "main", - "description": "Funding account" - }, - { - "value": "trade", - "name": "trade", - "description": "Spot account" - } + "default": "XBT", + "example": [ + "USDT", + "ETH" ] } } @@ -1010,60 +1022,61 @@ "type": "string" }, "data": { - "type": "array", - "items": { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "Account ID" - }, - "currency": { - "type": "string", - "description": "Currency" - }, - "type": { - "type": "string", - "description": "Account type:,main、trade、isolated(abandon)、margin(abandon)\n", - "enum": [ - "main", - "trade" - ], - "x-api-enum": [ - { - "value": "main", - "name": "main", - "description": "Funding account" - }, - { - "value": "trade", - "name": "trade", - "description": "Spot account" - } - ] - }, - "balance": { - "type": "string", - "description": "Total funds in the account" - }, - "available": { - "type": "string", - "description": "Funds available to withdraw or trade" - }, - "holds": { - "type": "string", - "description": "Funds on hold (not available for use)" - } + "type": "object", + "properties": { + "accountEquity": { + "type": "number", + "description": "Account equity = marginBalance + Unrealised PNL" + }, + "unrealisedPNL": { + "type": "number", + "description": "Unrealised profit and loss" + }, + "marginBalance": { + "type": "number", + "description": "Margin balance = positionMargin + orderMargin + frozenFunds + availableBalance - unrealisedPNL" + }, + "positionMargin": { + "type": "number", + "description": "Position margin" + }, + "orderMargin": { + "type": "number", + "description": "Order margin" + }, + "frozenFunds": { + "type": "number", + "description": "Frozen funds for out-transfer" + }, + "availableBalance": { + "type": "number", + "description": "Available balance" + }, + "currency": { + "type": "string", + "description": "Currency", + "example": [ + "XBT", + "USDT", + "ETH" + ] }, - "required": [ - "id", - "currency", - "type", - "balance", - "available", - "holds" - ] - } + "riskRatio": { + "type": "number", + "description": "Cross margin risk rate" + } + }, + "required": [ + "accountEquity", + "unrealisedPNL", + "marginBalance", + "positionMargin", + "orderMargin", + "frozenFunds", + "availableBalance", + "currency", + "riskRatio" + ] } }, "required": [ @@ -1075,36 +1088,112 @@ } } }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470125", + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470129", "x-abandon": "normal", - "x-domain": "Spot", + "x-domain": "Futures", "x-api-channel": "Private", - "x-api-permission": "General", - "x-api-rate-limit-pool": "Management", + "x-api-permission": "Futures", + "x-api-rate-limit-pool": "Futures", "x-sdk-service": "Account", "x-sdk-sub-service": "Account", - "x-sdk-method-name": "getSpotAccountList", - "x-sdk-method-description": "Get a list of accounts. Please Deposit to the main account firstly, then transfer the funds to the trade account via Inner Transfer before transaction.", + "x-sdk-method-name": "getFuturesAccount", + "x-sdk-method-description": "Request via this endpoint to get the info of the futures account.", "x-api-rate-limit": 5, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": [\\n {\\n \\\"id\\\": \\\"548674591753\\\",\\n \\\"currency\\\": \\\"USDT\\\",\\n \\\"type\\\": \\\"trade\\\",\\n \\\"balance\\\": \\\"26.66759503\\\",\\n \\\"available\\\": \\\"26.66759503\\\",\\n \\\"holds\\\": \\\"0\\\"\\n },\\n {\\n \\\"id\\\": \\\"63355cd156298d0001b66e61\\\",\\n \\\"currency\\\": \\\"USDT\\\",\\n \\\"type\\\": \\\"main\\\",\\n \\\"balance\\\": \\\"0.01\\\",\\n \\\"available\\\": \\\"0.01\\\",\\n \\\"holds\\\": \\\"0\\\"\\n }\\n ]\\n}", - "x-request-example": "{\\\"currency\\\": \\\"USDT\\\", \\\"type\\\": \\\"main\\\"}" + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"currency\\\": \\\"USDT\\\",\\n \\\"accountEquity\\\": 48.921913718,\\n \\\"unrealisedPNL\\\": 1.59475,\\n \\\"marginBalance\\\": 47.548728628,\\n \\\"positionMargin\\\": 34.1577964733,\\n \\\"orderMargin\\\": 0,\\n \\\"frozenFunds\\\": 0,\\n \\\"availableBalance\\\": 14.7876172447,\\n \\\"riskRatio\\\": 0.0090285199\\n }\\n}", + "x-request-example": "{\\\"currency\\\": \\\"USDT\\\"}" } }, - "/api/v1/accounts/{accountId}": { + "/api/v1/accounts/ledgers": { "get": { - "summary": "Get Account Detail - Spot", + "summary": "Get Account Ledgers - Spot/Margin", "deprecated": false, - "description": "get Information for a single spot account. Use this endpoint when you know the accountId.", + "description": "This interface is for transaction records from all types of your accounts, supporting inquiry of various currencies. Items are paginated and sorted to show the latest first. See the Pagination section for retrieving additional entries after the first page.", "tags": [], "parameters": [ { - "name": "accountId", - "in": "path", - "description": "Path parameter. Account ID", - "required": true, + "name": "currency", + "in": "query", + "description": "Currency ( you can choose more than one currency). You can specify 10 currencies at most for one time. If not specified, all currencies will be inquired by default.", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "direction", + "in": "query", + "description": "direction: in, out", + "required": false, + "schema": { + "type": "string", + "enum": [ + "in", + "out" + ], + "x-api-enum": [ + { + "value": "in", + "name": "", + "description": "" + }, + { + "value": "out", + "name": "", + "description": "" + } + ] + } + }, + { + "name": "bizType", + "in": "query", + "description": "Type: DEPOSIT -deposit, WITHDRAW -withdraw, TRANSFER -transfer, SUB_TRANSFER -subaccount transfer,TRADE_EXCHANGE -trade, MARGIN_EXCHANGE -margin trade, KUCOIN_BONUS -bonus, BROKER_TRANSFER -Broker transfer record", + "required": false, "schema": { "type": "string" } + }, + { + "name": "startAt", + "in": "query", + "description": "Start time (milisecond)", + "required": false, + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "endAt", + "in": "query", + "description": "End time (milisecond)", + "required": false, + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "currentPage", + "in": "query", + "description": "Current request page.", + "required": false, + "schema": { + "type": "integer", + "default": 1 + } + }, + { + "name": "pageSize", + "in": "query", + "description": "Number of results per request. Minimum is 10, maximum is 500.", + "required": false, + "schema": { + "type": "integer", + "default": 50, + "minimum": 10, + "maximum": 500 + } } ], "responses": { @@ -1121,28 +1210,78 @@ "data": { "type": "object", "properties": { - "currency": { - "type": "string", - "description": "The currency of the account" + "currentPage": { + "type": "integer", + "description": "current page" }, - "balance": { - "type": "string", - "description": "Total funds in the account" + "pageSize": { + "type": "integer", + "description": "page size" }, - "available": { - "type": "string", - "description": "Funds available to withdraw or trade" + "totalNum": { + "type": "integer", + "description": "total number" }, - "holds": { - "type": "string", - "description": "Funds on hold (not available for use)" + "totalPage": { + "type": "integer", + "description": "total page" + }, + "items": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "unique id" + }, + "currency": { + "type": "string", + "description": "The currency of an account" + }, + "amount": { + "type": "string", + "description": "The total amount of assets (fees included) involved in assets changes such as transaction, withdrawal and bonus distribution." + }, + "fee": { + "type": "string", + "description": "Fees generated in transaction, withdrawal, etc." + }, + "balance": { + "type": "string", + "description": "Remaining funds after the transaction." + }, + "accountType": { + "type": "string", + "description": "The account type of the master user: MAIN, TRADE, MARGIN or CONTRACT." + }, + "bizType": { + "type": "string", + "description": "Business type leading to the changes in funds, such as exchange, withdrawal, deposit, KUCOIN_BONUS, REFERRAL_BONUS, Lendings etc." + }, + "direction": { + "type": "string", + "description": "Side, out or in" + }, + "createdAt": { + "type": "integer", + "description": "Time of the event", + "format": "int64" + }, + "context": { + "type": "string", + "description": "Business related information such as order ID, serial No., etc." + } + } + } } }, "required": [ - "currency", - "balance", - "available", - "holds" + "currentPage", + "pageSize", + "totalNum", + "totalPage", + "items" ] } }, @@ -1155,7 +1294,7 @@ } } }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470126", + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470121", "x-abandon": "normal", "x-domain": "Spot", "x-api-channel": "Private", @@ -1163,46 +1302,48 @@ "x-api-rate-limit-pool": "Management", "x-sdk-service": "Account", "x-sdk-sub-service": "Account", - "x-sdk-method-name": "getSpotAccountDetail", - "x-sdk-method-description": "get Information for a single spot account. Use this endpoint when you know the accountId.", - "x-api-rate-limit": 5, - "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"currency\\\":\\\"USDT\\\",\\\"balance\\\":\\\"26.66759503\\\",\\\"available\\\":\\\"26.66759503\\\",\\\"holds\\\":\\\"0\\\"}}", - "x-request-example": "{\\\"accountId\\\": \\\"548674591753\\\"}" + "x-sdk-method-name": "getSpotLedger", + "x-sdk-method-description": "This interface is for transaction records from all types of your accounts, supporting inquiry of various currencies. Items are paginated and sorted to show the latest first. See the Pagination section for retrieving additional entries after the first page.", + "x-api-rate-limit": 2, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"currentPage\\\": 1,\\n \\\"pageSize\\\": 50,\\n \\\"totalNum\\\": 1,\\n \\\"totalPage\\\": 1,\\n \\\"items\\\": [\\n {\\n \\\"id\\\": \\\"265329987780896\\\",\\n \\\"currency\\\": \\\"USDT\\\",\\n \\\"amount\\\": \\\"0.01\\\",\\n \\\"fee\\\": \\\"0\\\",\\n \\\"balance\\\": \\\"0\\\",\\n \\\"accountType\\\": \\\"TRADE\\\",\\n \\\"bizType\\\": \\\"SUB_TRANSFER\\\",\\n \\\"direction\\\": \\\"out\\\",\\n \\\"createdAt\\\": 1728658481484,\\n \\\"context\\\": \\\"\\\"\\n }\\n ]\\n }\\n}", + "x-request-example": "{\\\"currency\\\": \\\"BTC\\\", \\\"direction\\\": \\\"in\\\", \\\"bizType\\\": \\\"TRANSFER\\\", \\\"startAt\\\": 1728663338000, \\\"endAt\\\": 1728692138000, \\\"currentPage\\\": 1, \\\"pageSize\\\": 50}" } }, - "/api/v3/margin/accounts": { + "/api/v1/hf/accounts/ledgers": { "get": { - "summary": "Get Account - Cross Margin", + "summary": "Get Account Ledgers - Trade_hf", "deprecated": false, - "description": "Request via this endpoint to get the info of the cross margin account.", + "description": "This API endpoint returns all transfer (in and out) records in high-frequency trading account and supports multi-coin queries. The query results are sorted in descending order by createdAt and id.", "tags": [], "parameters": [ { - "name": "quoteCurrency", + "name": "currency", "in": "query", - "description": "quote currency, currently only supports USDT, KCS, BTC, USDT as default", + "description": "Currency ( you can choose more than one currency). You can specify 10 currencies at most for one time. If not specified, all currencies will be inquired by default.", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "direction", + "in": "query", + "description": "direction: in, out", "required": false, "schema": { "type": "string", - "default": "USDT", "enum": [ - "USDT", - "KCS", - "BTC" + "in", + "out" ], "x-api-enum": [ { - "value": "USDT", - "name": "", - "description": "" - }, - { - "value": "KCS", + "value": "in", "name": "", "description": "" }, { - "value": "BTC", + "value": "out", "name": "", "description": "" } @@ -1210,36 +1351,71 @@ } }, { - "name": "queryType", + "name": "bizType", "in": "query", - "description": "Query account type (default MARGIN), MARGIN - only query low frequency cross margin account, MARGIN_V2-only query high frequency cross margin account, ALL - consistent aggregate query with the web side", + "description": "Transaction type: TRANSFER-transfer funds,TRADE_EXCHANGE-Trade", "required": false, "schema": { "type": "string", - "default": "MARGIN", "enum": [ - "MARGIN", - "MARGIN_V2", - "ALL" + "TRADE_EXCHANGE", + "TRANSFER" ], "x-api-enum": [ { - "value": "MARGIN", - "name": "", - "description": "" - }, - { - "value": "MARGIN_V2", + "value": "TRADE_EXCHANGE", "name": "", "description": "" }, { - "value": "ALL", + "value": "TRANSFER", "name": "", "description": "" } ] } + }, + { + "name": "lastId", + "in": "query", + "description": "The id of the last set of data from the previous batch of data. By default, the latest information is given.", + "required": false, + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "limit", + "in": "query", + "description": "Default100,Max200", + "required": false, + "schema": { + "type": "integer", + "default": 100, + "maximum": 200, + "minimum": 1 + } + }, + { + "name": "startAt", + "in": "query", + "description": "Start time (milisecond)", + "required": false, + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "endAt", + "in": "query", + "description": "End time (milisecond)", + "required": false, + "schema": { + "type": "integer", + "format": "int64" + } } ], "responses": { @@ -1254,117 +1430,84 @@ "type": "string" }, "data": { - "type": "object", - "properties": { - "totalAssetOfQuoteCurrency": { - "type": "string", - "description": "Total Assets in Quote Currency" - }, - "totalLiabilityOfQuoteCurrency": { - "type": "string", - "description": "Total Liability in Quote Currency" - }, - "debtRatio": { - "type": "string", - "description": "debt ratio" - }, - "status": { - "type": "string", - "description": "Position status; EFFECTIVE-effective, BANKRUPTCY-bankruptcy liquidation, LIQUIDATION-closing, REPAY-repayment, BORROW borrowing", - "enum": [ - "EFFECTIVE", - "BANKRUPTCY", - "LIQUIDATION", - "REPAY", - "BORROW" - ], - "x-api-enum": [ - { - "value": "EFFECTIVE", - "name": "EFFECTIVE", - "description": "Effective" - }, - { - "value": "BANKRUPTCY", - "name": "BANKRUPTCY", - "description": "Bankruptcy liquidation" - }, - { - "value": "LIQUIDATION", - "name": "LIQUIDATION", - "description": "Closing" - }, - { - "value": "REPAY", - "name": "REPAY", - "description": "Repayment" - }, - { - "value": "BORROW", - "name": "BORROW", - "description": "Borrowing" - } - ] - }, - "accounts": { - "type": "array", - "items": { - "type": "object", - "properties": { - "currency": { - "type": "string", - "description": "currency" - }, - "total": { - "type": "string", - "description": "Total Assets" - }, - "available": { - "type": "string", - "description": "Account available assets (total assets - frozen)" - }, - "hold": { - "type": "string", - "description": "Account frozen assets" - }, - "liability": { - "type": "string", - "description": "Liabilities" - }, - "maxBorrowSize": { - "type": "string", - "description": "The user's remaining maximum loan amount" - }, - "borrowEnabled": { - "type": "boolean", - "description": "Support borrow or not" + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Unique id" + }, + "currency": { + "type": "string", + "description": "currency" + }, + "amount": { + "type": "string", + "description": "Change in funds balance" + }, + "fee": { + "type": "string", + "description": "Deposit or withdrawal fee" + }, + "tax": { + "type": "string" + }, + "balance": { + "type": "string", + "description": "Total balance of funds after change" + }, + "accountType": { + "type": "string", + "description": "Master account type TRADE_HF" + }, + "bizType": { + "type": "string", + "description": "Trnasaction type,such as TRANSFER, TRADE_EXCHANGE, etc." + }, + "direction": { + "type": "string", + "description": "Direction of transfer( out or in)", + "enum": [ + "in", + "out" + ], + "x-api-enum": [ + { + "value": "in", + "name": "", + "description": "" }, - "transferInEnabled": { - "type": "boolean", - "description": "Support transfer or not" + { + "value": "out", + "name": "", + "description": "" } - }, - "required": [ - "currency", - "total", - "available", - "hold", - "liability", - "maxBorrowSize", - "borrowEnabled", - "transferInEnabled" ] }, - "description": "Margin account list" - } - }, - "required": [ - "totalAssetOfQuoteCurrency", - "totalLiabilityOfQuoteCurrency", - "debtRatio", - "status", - "accounts" - ] + "createdAt": { + "type": "string", + "description": "Created time" + }, + "context": { + "type": "string", + "description": "Core transaction parameter" + } + }, + "required": [ + "id", + "currency", + "amount", + "fee", + "tax", + "balance", + "accountType", + "bizType", + "direction", + "createdAt", + "context" + ] + } } }, "required": [ @@ -1376,7 +1519,7 @@ } } }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470127", + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470122", "x-abandon": "normal", "x-domain": "Spot", "x-api-channel": "Private", @@ -1384,55 +1527,48 @@ "x-api-rate-limit-pool": "Spot", "x-sdk-service": "Account", "x-sdk-sub-service": "Account", - "x-sdk-method-name": "getCrossMarginAccount", - "x-sdk-method-description": "Request via this endpoint to get the info of the cross margin account.", - "x-api-rate-limit": 15, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"totalAssetOfQuoteCurrency\\\": \\\"0.02\\\",\\n \\\"totalLiabilityOfQuoteCurrency\\\": \\\"0\\\",\\n \\\"debtRatio\\\": \\\"0\\\",\\n \\\"status\\\": \\\"EFFECTIVE\\\",\\n \\\"accounts\\\": [\\n {\\n \\\"currency\\\": \\\"USDT\\\",\\n \\\"total\\\": \\\"0.02\\\",\\n \\\"available\\\": \\\"0.02\\\",\\n \\\"hold\\\": \\\"0\\\",\\n \\\"liability\\\": \\\"0\\\",\\n \\\"maxBorrowSize\\\": \\\"0\\\",\\n \\\"borrowEnabled\\\": true,\\n \\\"transferInEnabled\\\": true\\n }\\n ]\\n }\\n}", - "x-request-example": "{\\\"quoteCurrency\\\": \\\"USDT\\\", \\\"queryType\\\": \\\"MARGIN\\\"}" + "x-sdk-method-name": "getSpotHFLedger", + "x-sdk-method-description": "This API endpoint returns all transfer (in and out) records in high-frequency trading account and supports multi-coin queries. The query results are sorted in descending order by createdAt and id.", + "x-api-rate-limit": 2, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": [\\n {\\n \\\"id\\\": \\\"254062248624417\\\",\\n \\\"currency\\\": \\\"USDT\\\",\\n \\\"amount\\\": \\\"1.59760080\\\",\\n \\\"fee\\\": \\\"0.00159920\\\",\\n \\\"tax\\\": \\\"0\\\",\\n \\\"balance\\\": \\\"26.73759503\\\",\\n \\\"accountType\\\": \\\"TRADE_HF\\\",\\n \\\"bizType\\\": \\\"TRADE_EXCHANGE\\\",\\n \\\"direction\\\": \\\"in\\\",\\n \\\"createdAt\\\": \\\"1728443957539\\\",\\n \\\"context\\\": \\\"{\\\\\\\"symbol\\\\\\\":\\\\\\\"KCS-USDT\\\\\\\",\\\\\\\"orderId\\\\\\\":\\\\\\\"6705f6350dc7210007d6a36d\\\\\\\",\\\\\\\"tradeId\\\\\\\":\\\\\\\"10046097631627265\\\\\\\"}\\\"\\n }\\n ]\\n}", + "x-request-example": "{\\\"currency\\\": \\\"BTC\\\", \\\"direction\\\": \\\"in\\\", \\\"bizType\\\": \\\"TRANSFER\\\", \\\"lastId\\\": 254062248624417, \\\"limit\\\": 100, \\\"startAt\\\": 1728663338000, \\\"endAt\\\": 1728692138000}" } }, - "/api/v3/isolated/accounts": { + "/api/v3/hf/margin/account/ledgers": { "get": { - "summary": "Get Account - Isolated Margin", + "summary": "Get Account Ledgers - Margin_hf", "deprecated": false, - "description": "Request via this endpoint to get the info of the isolated margin account.", + "description": "This API endpoint returns all transfer (in and out) records in high-frequency margin trading account and supports multi-coin queries. The query results are sorted in descending order by createdAt and id.", "tags": [], "parameters": [ { - "name": "symbol", + "name": "currency", "in": "query", - "description": "For isolated trading pairs, query all without passing", + "description": "currency, optional,can select more than one,separate with commas,select no more than 10 currencys,the default will be to query for all currencys if left empty", "required": false, "schema": { "type": "string" } }, { - "name": "quoteCurrency", + "name": "direction", "in": "query", - "description": "quote currency, currently only supports USDT, KCS, BTC, USDT as default", + "description": "direction: in, out", "required": false, "schema": { "type": "string", - "default": "USDT", "enum": [ - "USDT", - "KCS", - "BTC" + "in", + "out" ], "x-api-enum": [ { - "value": "USDT", - "name": "", - "description": "" - }, - { - "value": "KCS", + "value": "in", "name": "", "description": "" }, { - "value": "BTC", + "value": "out", "name": "", "description": "" } @@ -1440,229 +1576,119 @@ } }, { - "name": "queryType", + "name": "bizType", "in": "query", - "description": "Query account type (default ISOLATED), ISOLATED- - only query low frequency isolated margin account, ISOLATED_V2-only query high frequency isolated margin account, ALL - consistent aggregate query with the web side", + "description": "Transaction type: TRANSFER- transfer funds, MARGIN_EXCHANGE - cross margin trade, ISOLATED_EXCHANGE - isolated margin trade, LIQUIDATION - liquidation, ASSERT_RETURN - forced liquidation asset return", "required": false, "schema": { - "type": "string", - "default": "ISOLATED", - "enum": [ - "ISOLATED", - "ISOLATED_V2", - "ALL" - ], - "x-api-enum": [ - { - "value": "ISOLATED", - "name": "", - "description": "" - }, - { - "value": "ISOLATED_V2", - "name": "", - "description": "" - }, - { - "value": "ALL", - "name": "", - "description": "" - } - ] + "type": "string" } - } - ], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "data": { - "type": "object", - "properties": { - "totalAssetOfQuoteCurrency": { - "type": "string", - "description": "Total Assets in Quote Currency" - }, - "totalLiabilityOfQuoteCurrency": { - "type": "string", - "description": "Total Liability in Quote Currency" - }, - "timestamp": { - "type": "integer", - "description": "timestamp", - "format": "int64" - }, - "assets": { - "type": "array", - "items": { - "type": "object", - "properties": { - "symbol": { - "type": "string", - "description": "Symbol" - }, - "status": { - "type": "string", - "description": "Position status; EFFECTIVE-effective, BANKRUPTCY-bankruptcy liquidation, LIQUIDATION-closing, REPAY-repayment, BORROW borrowing", - "enum": [ - "EFFECTIVE", - "BANKRUPTCY", - "LIQUIDATION", - "REPAY", - "BORROW" - ], - "x-api-enum": [ - { - "value": "EFFECTIVE", - "name": "EFFECTIVE", - "description": "Effective" - }, - { - "value": "BANKRUPTCY", - "name": "BANKRUPTCY", - "description": "Bankruptcy liquidation" - }, - { - "value": "LIQUIDATION", - "name": "LIQUIDATION", - "description": "Closing" - }, - { - "value": "REPAY", - "name": "REPAY", - "description": "Repayment" - }, - { - "value": "BORROW", - "name": "BORROW", - "description": "Borrowing" - } - ] - }, - "debtRatio": { - "type": "string", - "description": "debt ratio" - }, - "baseAsset": { - "type": "object", - "properties": { - "currency": { - "type": "string", - "description": "currency" - }, - "borrowEnabled": { - "type": "boolean", - "description": "Support borrow or not" - }, - "transferInEnabled": { - "type": "boolean", - "description": "Support transfer or not" - }, - "liability": { - "type": "string", - "description": "Liabilities" - }, - "total": { - "type": "string", - "description": "Total Assets" - }, - "available": { - "type": "string", - "description": "Account available assets (total assets - frozen)" - }, - "hold": { - "type": "string", - "description": "Account frozen assets" - }, - "maxBorrowSize": { - "type": "string", - "description": "The user's remaining maximum loan amount" - } - }, - "required": [ - "currency", - "borrowEnabled", - "transferInEnabled", - "liability", - "total", - "available", - "hold", - "maxBorrowSize" - ], - "description": "base asset" - }, - "quoteAsset": { - "type": "object", - "properties": { - "currency": { - "type": "string", - "description": "currency" - }, - "borrowEnabled": { - "type": "boolean", - "description": "Support borrow or not" - }, - "transferInEnabled": { - "type": "boolean", - "description": "Support transfer or not" - }, - "liability": { - "type": "string", - "description": "Liabilities" - }, - "total": { - "type": "string", - "description": "Total Assets" - }, - "available": { - "type": "string", - "description": "Account available assets (total assets - frozen)" - }, - "hold": { - "type": "string", - "description": "Account frozen assets" - }, - "maxBorrowSize": { - "type": "string", - "description": "The user's remaining maximum loan amount" - } - }, - "required": [ - "currency", - "borrowEnabled", - "transferInEnabled", - "liability", - "total", - "available", - "hold", - "maxBorrowSize" - ], - "description": "quote asset" - } - }, - "required": [ - "symbol", - "status", - "debtRatio", - "baseAsset", - "quoteAsset" - ] + }, + { + "name": "lastId", + "in": "query", + "description": "The id of the last set of data from the previous batch of data. By default, the latest information is given.", + "required": false, + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "limit", + "in": "query", + "description": "Default100,Max200", + "required": false, + "schema": { + "type": "integer", + "default": 100, + "maximum": 200, + "minimum": 1 + } + }, + { + "name": "startAt", + "in": "query", + "description": "Start time (milisecond)", + "required": false, + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "endAt", + "in": "query", + "description": "End time (milisecond)", + "required": false, + "schema": { + "type": "integer", + "format": "int64" + } + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "currency": { + "type": "string", + "description": "currency" + }, + "amount": { + "type": "string", + "description": "Change in funds balance" + }, + "fee": { + "type": "string", + "description": "Deposit or withdrawal fee" + }, + "balance": { + "type": "string", + "description": "Total balance of funds after change" + }, + "accountType": { + "type": "string", + "description": "Master account type TRADE_HF" + }, + "bizType": { + "type": "string", + "description": "Trnasaction type,such as TRANSFER, TRADE_EXCHANGE, etc." + }, + "direction": { + "type": "string", + "description": "Direction of transfer( out or in)" + }, + "createdAt": { + "type": "integer", + "description": "Ledger creation time", + "format": "int64" + }, + "context": { + "type": "string", + "description": "Core transaction parameter" + }, + "tax": { + "type": "string" } } - }, - "required": [ - "totalAssetOfQuoteCurrency", - "totalLiabilityOfQuoteCurrency", - "timestamp", - "assets" - ] + } } }, "required": [ @@ -1674,7 +1700,7 @@ } } }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470128", + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470123", "x-abandon": "normal", "x-domain": "Spot", "x-api-channel": "Private", @@ -1682,32 +1708,87 @@ "x-api-rate-limit-pool": "Spot", "x-sdk-service": "Account", "x-sdk-sub-service": "Account", - "x-sdk-method-name": "getIsolatedMarginAccount", - "x-sdk-method-description": "Request via this endpoint to get the info of the isolated margin account.", - "x-api-rate-limit": 15, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"totalAssetOfQuoteCurrency\\\": \\\"0.01\\\",\\n \\\"totalLiabilityOfQuoteCurrency\\\": \\\"0\\\",\\n \\\"timestamp\\\": 1728725465994,\\n \\\"assets\\\": [\\n {\\n \\\"symbol\\\": \\\"BTC-USDT\\\",\\n \\\"status\\\": \\\"EFFECTIVE\\\",\\n \\\"debtRatio\\\": \\\"0\\\",\\n \\\"baseAsset\\\": {\\n \\\"currency\\\": \\\"BTC\\\",\\n \\\"borrowEnabled\\\": true,\\n \\\"transferInEnabled\\\": true,\\n \\\"liability\\\": \\\"0\\\",\\n \\\"total\\\": \\\"0\\\",\\n \\\"available\\\": \\\"0\\\",\\n \\\"hold\\\": \\\"0\\\",\\n \\\"maxBorrowSize\\\": \\\"0\\\"\\n },\\n \\\"quoteAsset\\\": {\\n \\\"currency\\\": \\\"USDT\\\",\\n \\\"borrowEnabled\\\": true,\\n \\\"transferInEnabled\\\": true,\\n \\\"liability\\\": \\\"0\\\",\\n \\\"total\\\": \\\"0.01\\\",\\n \\\"available\\\": \\\"0.01\\\",\\n \\\"hold\\\": \\\"0\\\",\\n \\\"maxBorrowSize\\\": \\\"0\\\"\\n }\\n }\\n ]\\n }\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"example_string_default_value\\\", \\\"quoteCurrency\\\": \\\"USDT\\\", \\\"queryType\\\": \\\"ISOLATED\\\"}" + "x-sdk-method-name": "getMarginHFLedger", + "x-sdk-method-description": "This API endpoint returns all transfer (in and out) records in high-frequency margin trading account and supports multi-coin queries. The query results are sorted in descending order by createdAt and id.", + "x-api-rate-limit": 2, + "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":[{\\\"id\\\":1949641706720,\\\"currency\\\":\\\"USDT\\\",\\\"amount\\\":\\\"0.01000000\\\",\\\"fee\\\":\\\"0.00000000\\\",\\\"balance\\\":\\\"0.01000000\\\",\\\"accountType\\\":\\\"MARGIN_V2\\\",\\\"bizType\\\":\\\"TRANSFER\\\",\\\"direction\\\":\\\"in\\\",\\\"createdAt\\\":1728664091208,\\\"context\\\":\\\"{}\\\",\\\"tax\\\":\\\"0.00000000\\\"}]}", + "x-request-example": "{\\\"currency\\\": \\\"BTC\\\", \\\"direction\\\": \\\"in\\\", \\\"bizType\\\": \\\"TRANSFER\\\", \\\"lastId\\\": 254062248624417, \\\"limit\\\": 100, \\\"startAt\\\": 1728663338000, \\\"endAt\\\": 1728692138000}" } }, - "/api/v1/account-overview": { + "/api/v1/transaction-history": { "get": { - "summary": "Get Account - Futures", + "summary": "Get Account Ledgers - Futures", "deprecated": false, - "description": "Request via this endpoint to get the info of the futures account.", + "description": "This interface can query the ledger records of the futures business line", "tags": [], "parameters": [ { "name": "currency", "in": "query", - "description": "Currecny, Default XBT", + "description": "Currency of transaction history, XBT or USDT", "required": false, "schema": { - "type": "string", - "default": "XBT", - "example": [ - "USDT", - "ETH" - ] + "type": "string" + } + }, + { + "name": "type", + "in": "query", + "description": "Type RealisedPNL-Realised profit and loss, Deposit-Deposit, Withdrawal-withdraw, Transferin-Transfer in, TransferOut-Transfer out", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "offset", + "in": "query", + "description": "Start offset. Generally, the only attribute of the last returned result of the previous request is used, and the first page is returned by default", + "required": false, + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "forward", + "in": "query", + "description": "This parameter functions to judge whether the lookup is forward or not. True means “yes” and False means “no”. This parameter is set as true by default", + "required": false, + "schema": { + "type": "boolean", + "default": true + } + }, + { + "name": "maxCount", + "in": "query", + "description": "Displayed size per page. The default size is 50", + "required": false, + "schema": { + "type": "integer", + "default": 50, + "format": "int64" + } + }, + { + "name": "startAt", + "in": "query", + "description": "Start time (milisecond)", + "required": false, + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "endAt", + "in": "query", + "description": "End time (milisecond)", + "required": false, + "schema": { + "type": "integer", + "format": "int64" } } ], @@ -1725,58 +1806,70 @@ "data": { "type": "object", "properties": { - "accountEquity": { - "type": "number", - "description": "Account equity = marginBalance + Unrealised PNL" - }, - "unrealisedPNL": { - "type": "number", - "description": "Unrealised profit and loss" - }, - "marginBalance": { - "type": "number", - "description": "Margin balance = positionMargin + orderMargin + frozenFunds + availableBalance - unrealisedPNL" - }, - "positionMargin": { - "type": "number", - "description": "Position margin" - }, - "orderMargin": { - "type": "number", - "description": "Order margin" - }, - "frozenFunds": { - "type": "number", - "description": "Frozen funds for out-transfer" - }, - "availableBalance": { - "type": "number", - "description": "Available balance" - }, - "currency": { - "type": "string", - "description": "Currency", - "example": [ - "XBT", - "USDT", - "ETH" - ] + "dataList": { + "type": "array", + "items": { + "type": "object", + "properties": { + "time": { + "type": "integer", + "description": "ledger time", + "format": "int64" + }, + "type": { + "type": "string", + "description": "Type: RealisedPNL, Deposit, Withdrawal, TransferIn, TransferOut" + }, + "amount": { + "type": "number", + "description": "Transaction amount" + }, + "fee": { + "type": "number", + "description": "Fee" + }, + "accountEquity": { + "type": "number", + "description": "Account equity" + }, + "status": { + "type": "string", + "description": "Status: Completed, Pending" + }, + "remark": { + "type": "string", + "description": "Ticker symbol of the contract" + }, + "offset": { + "type": "integer", + "description": "Offset" + }, + "currency": { + "type": "string", + "description": "Currency" + } + }, + "required": [ + "time", + "type", + "amount", + "fee", + "accountEquity", + "status", + "remark", + "offset", + "currency" + ] + } }, - "riskRatio": { - "type": "number", - "description": "Cross margin risk rate" + "hasMore": { + "type": "boolean", + "description": "Is it the last page. If it is false, it means it is the last page, and if it is true, it means need to turn the page." } }, "required": [ - "accountEquity", - "unrealisedPNL", - "marginBalance", - "positionMargin", - "orderMargin", - "frozenFunds", - "availableBalance", - "currency", - "riskRatio" + "dataList", + "hasMore" ] } }, @@ -1789,26 +1882,26 @@ } } }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470129", + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470124", "x-abandon": "normal", "x-domain": "Futures", "x-api-channel": "Private", - "x-api-permission": "Futures", + "x-api-permission": "General", "x-api-rate-limit-pool": "Futures", "x-sdk-service": "Account", "x-sdk-sub-service": "Account", - "x-sdk-method-name": "getFuturesAccount", - "x-sdk-method-description": "Request via this endpoint to get the info of the futures account.", - "x-api-rate-limit": 5, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"currency\\\": \\\"USDT\\\",\\n \\\"accountEquity\\\": 48.921913718,\\n \\\"unrealisedPNL\\\": 1.59475,\\n \\\"marginBalance\\\": 47.548728628,\\n \\\"positionMargin\\\": 34.1577964733,\\n \\\"orderMargin\\\": 0,\\n \\\"frozenFunds\\\": 0,\\n \\\"availableBalance\\\": 14.7876172447,\\n \\\"riskRatio\\\": 0.0090285199\\n }\\n}", - "x-request-example": "{\\\"currency\\\": \\\"USDT\\\"}" + "x-sdk-method-name": "getFuturesLedger", + "x-sdk-method-description": "This interface can query the ledger records of the futures business line", + "x-api-rate-limit": 2, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"dataList\\\": [\\n {\\n \\\"time\\\": 1728665747000,\\n \\\"type\\\": \\\"TransferIn\\\",\\n \\\"amount\\\": 0.01,\\n \\\"fee\\\": 0.0,\\n \\\"accountEquity\\\": 14.02924938,\\n \\\"status\\\": \\\"Completed\\\",\\n \\\"remark\\\": \\\"Transferred from High-Frequency Trading Account\\\",\\n \\\"offset\\\": 51360793,\\n \\\"currency\\\": \\\"USDT\\\"\\n },\\n {\\n \\\"time\\\": 1728648000000,\\n \\\"type\\\": \\\"RealisedPNL\\\",\\n \\\"amount\\\": 0.00630042,\\n \\\"fee\\\": 0.0,\\n \\\"accountEquity\\\": 20.0,\\n \\\"status\\\": \\\"Completed\\\",\\n \\\"remark\\\": \\\"XBTUSDTM\\\",\\n \\\"offset\\\": 51352430,\\n \\\"currency\\\": \\\"USDT\\\"\\n }\\n ],\\n \\\"hasMore\\\": false\\n }\\n}", + "x-request-example": "{\\\"currency\\\": \\\"XBT\\\", \\\"type\\\": \\\"Transferin\\\", \\\"offset\\\": 254062248624417, \\\"forward\\\": true, \\\"maxCount\\\": 50, \\\"startAt\\\": 1728663338000, \\\"endAt\\\": 1728692138000}" } }, - "/api/v1/user/api-key": { - "get": { - "summary": "Get Apikey Info", + "/api/v2/sub/user/created": { + "post": { + "summary": "Add SubAccount", "deprecated": false, - "description": "Get the information of the api key. Use the api key pending to be checked to call the endpoint. Both master and sub user's api key are applicable.", + "description": "This endpoint can be used to create sub-accounts.", "tags": [], "parameters": [], "responses": { @@ -1825,52 +1918,28 @@ "data": { "type": "object", "properties": { - "remark": { - "type": "string", - "description": "Remarks" - }, - "apiKey": { - "type": "string", - "description": "Apikey" - }, - "apiVersion": { + "uid": { "type": "integer", - "description": "API Version" + "description": "Sub-account UID" }, - "permission": { + "subName": { "type": "string", - "description": "[Permissions](https://www.kucoin.com/docs-new/doc-338144), possible values: General, Spot, Margin, Futures, InnerTransfer, Transfer, Earn" + "description": "Sub-account name" }, - "ipWhitelist": { + "remarks": { "type": "string", - "description": "IP whitelist\n\n" - }, - "createdAt": { - "type": "integer", - "description": "Apikey create time", - "format": "int64" - }, - "uid": { - "type": "integer", - "description": "Account UID" - }, - "isMaster": { - "type": "boolean", - "description": "Whether it is the master account." + "description": "Remarks" }, - "subName": { + "access": { "type": "string", - "description": "Sub Name, There is no such param for the master account" + "description": "Permission" } }, "required": [ - "remark", - "apiKey", - "apiVersion", - "permission", - "createdAt", "uid", - "isMaster" + "subName", + "remarks", + "access" ] } }, @@ -1883,18 +1952,207 @@ } } }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470130", + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470135", + "x-abandon": "normal", + "x-domain": "Spot", + "x-api-channel": "Private", + "x-api-permission": "General", + "x-api-rate-limit-pool": "Management", + "x-sdk-service": "Account", + "x-sdk-sub-service": "SubAccount", + "x-sdk-method-name": "addSubAccount", + "x-sdk-method-description": "This endpoint can be used to create sub-accounts.", + "x-api-rate-limit": 15, + "requestBody": { + "content": { + "application/json": { + "schema": { + "title": "", + "type": "object", + "properties": { + "password": { + "type": "string", + "description": "Password(7-24 characters, must contain letters and numbers, cannot only contain numbers or include special characters)" + }, + "remarks": { + "type": "string", + "description": "Remarks(1~24 characters)" + }, + "subName": { + "type": "string", + "description": "Sub-account name(must contain 7-32 characters, at least one number and one letter. Cannot contain any spaces.)" + }, + "access": { + "type": "string", + "description": "Permission (types include Spot, Futures, Margin permissions, which can be used alone or in combination).", + "enum": [ + "Spot", + "Futures", + "Margin" + ], + "x-api-enum": [ + { + "value": "Spot", + "name": "", + "description": "Spot Account" + }, + { + "value": "Futures", + "name": "", + "description": "Futures Account" + }, + { + "value": "Margin", + "name": "", + "description": "Margin Account" + } + ] + } + }, + "required": [ + "password", + "subName", + "access" + ] + }, + "example": "{\n \"password\": \"1234567\",\n \"remarks\": \"TheRemark\",\n \"subName\": \"Name1234567\",\n \"access\": \"Spot\"\n}" + } + } + }, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"currentPage\\\": 1,\\n \\\"pageSize\\\": 10,\\n \\\"totalNum\\\": 1,\\n \\\"totalPage\\\": 1,\\n \\\"items\\\": [\\n {\\n \\\"userId\\\": \\\"63743f07e0c5230001761d08\\\",\\n \\\"uid\\\": 169579801,\\n \\\"subName\\\": \\\"testapi6\\\",\\n \\\"status\\\": 2,\\n \\\"type\\\": 0,\\n \\\"access\\\": \\\"All\\\",\\n \\\"createdAt\\\": 1668562696000,\\n \\\"remarks\\\": \\\"remarks\\\",\\n \\\"tradeTypes\\\": [\\n \\\"Spot\\\",\\n \\\"Futures\\\",\\n \\\"Margin\\\"\\n ],\\n \\\"openedTradeTypes\\\": [\\n \\\"Spot\\\"\\n ],\\n \\\"hostedStatus\\\": null\\n }\\n ]\\n }\\n}", + "x-request-example": "{\\\"password\\\": \\\"1234567\\\", \\\"remarks\\\": \\\"TheRemark\\\", \\\"subName\\\": \\\"Name1234567\\\", \\\"access\\\": \\\"Spot\\\"}" + } + }, + "/api/v3/sub/user/margin/enable": { + "post": { + "summary": "Add SubAccount Margin Permission", + "deprecated": false, + "description": "This endpoint can be used to add sub-accounts Margin permission. Before using this endpoints, you need to ensure that the master account apikey has Margin permissions and the Margin function has been activated.", + "tags": [], + "parameters": [], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "string" + } + }, + "required": [ + "code", + "data" + ] + } + } + } + } + }, + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470331", + "x-abandon": "normal", + "x-domain": "Spot", + "x-api-channel": "Private", + "x-api-permission": "Margin", + "x-api-rate-limit-pool": "Management", + "x-sdk-service": "Account", + "x-sdk-sub-service": "SubAccount", + "x-sdk-method-name": "addSubAccountMarginPermission", + "x-sdk-method-description": "This endpoint can be used to add sub-accounts Margin permission. Before using this endpoints, you need to ensure that the master account apikey has Margin permissions and the Margin function has been activated.", + "x-api-rate-limit": 15, + "requestBody": { + "content": { + "application/json": { + "schema": { + "title": "", + "type": "object", + "properties": { + "uid": { + "type": "string", + "description": "Sub account UID" + } + }, + "required": [ + "uid" + ] + }, + "example": "{\n \"uid\": \"169579801\"\n}" + } + } + }, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": null\\n}", + "x-request-example": "{\\\"uid\\\": \\\"169579801\\\"}" + } + }, + "/api/v3/sub/user/futures/enable": { + "post": { + "summary": "Add SubAccount Futures Permission", + "deprecated": false, + "description": "This endpoint can be used to add sub-accounts Futures permission. Before using this endpoints, you need to ensure that the master account apikey has Futures permissions and the Futures function has been activated.", + "tags": [], + "parameters": [], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "boolean" + } + }, + "required": [ + "code", + "data" + ] + } + } + } + } + }, + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470332", "x-abandon": "normal", "x-domain": "Spot", "x-api-channel": "Private", - "x-api-permission": "General", + "x-api-permission": "Futures", "x-api-rate-limit-pool": "Management", "x-sdk-service": "Account", - "x-sdk-sub-service": "Account", - "x-sdk-method-name": "getApikeyInfo", - "x-sdk-method-description": "Get the information of the api key. Use the api key pending to be checked to call the endpoint. Both master and sub user's api key are applicable.", - "x-api-rate-limit": 20, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"remark\\\": \\\"account1\\\",\\n \\\"apiKey\\\": \\\"6705f5c311545b000157d3eb\\\",\\n \\\"apiVersion\\\": 3,\\n \\\"permission\\\": \\\"General,Futures,Spot,Earn,InnerTransfer,Transfer,Margin\\\",\\n \\\"ipWhitelist\\\": \\\"203.**.154,103.**.34\\\",\\n \\\"createdAt\\\": 1728443843000,\\n \\\"uid\\\": 165111215,\\n \\\"isMaster\\\": true\\n }\\n}" + "x-sdk-sub-service": "SubAccount", + "x-sdk-method-name": "addSubAccountFuturesPermission", + "x-sdk-method-description": "This endpoint can be used to add sub-accounts Futures permission. Before using this endpoints, you need to ensure that the master account apikey has Futures permissions and the Futures function has been activated.", + "x-api-rate-limit": 15, + "requestBody": { + "content": { + "application/json": { + "schema": { + "title": "", + "type": "object", + "properties": { + "uid": { + "type": "string", + "description": "Sub account UID" + } + }, + "required": [ + "uid" + ] + }, + "example": "{\n \"uid\": \"169579801\"\n}" + } + } + }, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": null\\n}", + "x-request-example": "{\\\"uid\\\": \\\"169579801\\\"}" } }, "/api/v2/sub/user": { @@ -2712,217 +2970,25 @@ } }, "x-api-doc": "https://www.kucoin.com/docs-new/api-3470134", - "x-abandon": "normal", - "x-domain": "Futures", - "x-api-channel": "Private", - "x-api-permission": "General", - "x-api-rate-limit-pool": "Futures", - "x-sdk-service": "Account", - "x-sdk-sub-service": "SubAccount", - "x-sdk-method-name": "getFuturesSubAccountListV2", - "x-sdk-method-description": "This endpoint can be used to get Futures sub-account information. ", - "x-api-rate-limit": 6, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"summary\\\": {\\n \\\"accountEquityTotal\\\": 103.899081508,\\n \\\"unrealisedPNLTotal\\\": 38.81075,\\n \\\"marginBalanceTotal\\\": 65.336985668,\\n \\\"positionMarginTotal\\\": 68.9588320683,\\n \\\"orderMarginTotal\\\": 0,\\n \\\"frozenFundsTotal\\\": 0,\\n \\\"availableBalanceTotal\\\": 67.2492494397,\\n \\\"currency\\\": \\\"USDT\\\"\\n },\\n \\\"accounts\\\": [\\n {\\n \\\"accountName\\\": \\\"Name1234567\\\",\\n \\\"accountEquity\\\": 0,\\n \\\"unrealisedPNL\\\": 0,\\n \\\"marginBalance\\\": 0,\\n \\\"positionMargin\\\": 0,\\n \\\"orderMargin\\\": 0,\\n \\\"frozenFunds\\\": 0,\\n \\\"availableBalance\\\": 0,\\n \\\"currency\\\": \\\"USDT\\\"\\n },\\n {\\n \\\"accountName\\\": \\\"LTkucoin1491\\\",\\n \\\"accountEquity\\\": 0,\\n \\\"unrealisedPNL\\\": 0,\\n \\\"marginBalance\\\": 0,\\n \\\"positionMargin\\\": 0,\\n \\\"orderMargin\\\": 0,\\n \\\"frozenFunds\\\": 0,\\n \\\"availableBalance\\\": 0,\\n \\\"currency\\\": \\\"USDT\\\"\\n },\\n {\\n \\\"accountName\\\": \\\"manage112233\\\",\\n \\\"accountEquity\\\": 0,\\n \\\"unrealisedPNL\\\": 0,\\n \\\"marginBalance\\\": 0,\\n \\\"positionMargin\\\": 0,\\n \\\"orderMargin\\\": 0,\\n \\\"frozenFunds\\\": 0,\\n \\\"availableBalance\\\": 0,\\n \\\"currency\\\": \\\"USDT\\\"\\n },\\n {\\n \\\"accountName\\\": \\\"testapi6\\\",\\n \\\"accountEquity\\\": 27.30545128,\\n \\\"unrealisedPNL\\\": 22.549,\\n \\\"marginBalance\\\": 4.75645128,\\n \\\"positionMargin\\\": 24.1223749975,\\n \\\"orderMargin\\\": 0,\\n \\\"frozenFunds\\\": 0,\\n \\\"availableBalance\\\": 25.7320762825,\\n \\\"currency\\\": \\\"USDT\\\"\\n },\\n {\\n \\\"accountName\\\": \\\"main\\\",\\n \\\"accountEquity\\\": 76.593630228,\\n \\\"unrealisedPNL\\\": 16.26175,\\n \\\"marginBalance\\\": 60.580534388,\\n \\\"positionMargin\\\": 44.8364570708,\\n \\\"orderMargin\\\": 0,\\n \\\"frozenFunds\\\": 0,\\n \\\"availableBalance\\\": 41.5171731572,\\n \\\"currency\\\": \\\"USDT\\\"\\n }\\n ]\\n }\\n}", - "x-request-example": "{\\\"currency\\\": \\\"USDT\\\"}" - } - }, - "/api/v2/sub/user/created": { - "post": { - "summary": "Add SubAccount", - "deprecated": false, - "description": "This endpoint can be used to create sub-accounts.", - "tags": [], - "parameters": [], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "data": { - "type": "object", - "properties": { - "uid": { - "type": "integer", - "description": "Sub-account UID" - }, - "subName": { - "type": "string", - "description": "Sub-account name" - }, - "remarks": { - "type": "string", - "description": "Remarks" - }, - "access": { - "type": "string", - "description": "Permission" - } - }, - "required": [ - "uid", - "subName", - "remarks", - "access" - ] - } - }, - "required": [ - "code", - "data" - ] - } - } - } - } - }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470135", - "x-abandon": "normal", - "x-domain": "Spot", - "x-api-channel": "Private", - "x-api-permission": "General", - "x-api-rate-limit-pool": "Management", - "x-sdk-service": "Account", - "x-sdk-sub-service": "SubAccount", - "x-sdk-method-name": "addSubAccount", - "x-sdk-method-description": "This endpoint can be used to create sub-accounts.", - "x-api-rate-limit": 15, - "requestBody": { - "content": { - "application/json": { - "schema": { - "title": "", - "type": "object", - "properties": { - "password": { - "type": "string", - "description": "Password(7-24 characters, must contain letters and numbers, cannot only contain numbers or include special characters)" - }, - "remarks": { - "type": "string", - "description": "Remarks(1~24 characters)" - }, - "subName": { - "type": "string", - "description": "Sub-account name(must contain 7-32 characters, at least one number and one letter. Cannot contain any spaces.)" - }, - "access": { - "type": "string", - "description": "Permission (types include Spot, Futures, Margin permissions, which can be used alone or in combination).", - "enum": [ - "Spot", - "Futures", - "Margin" - ], - "x-api-enum": [ - { - "value": "Spot", - "name": "", - "description": "Spot Account" - }, - { - "value": "Futures", - "name": "", - "description": "Futures Account" - }, - { - "value": "Margin", - "name": "", - "description": "Margin Account" - } - ] - } - }, - "required": [ - "password", - "subName", - "access" - ] - }, - "example": "{\n \"password\": \"1234567\",\n \"remarks\": \"TheRemark\",\n \"subName\": \"Name1234567\",\n \"access\": \"Spot\"\n}" - } - } - }, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"currentPage\\\": 1,\\n \\\"pageSize\\\": 10,\\n \\\"totalNum\\\": 1,\\n \\\"totalPage\\\": 1,\\n \\\"items\\\": [\\n {\\n \\\"userId\\\": \\\"63743f07e0c5230001761d08\\\",\\n \\\"uid\\\": 169579801,\\n \\\"subName\\\": \\\"testapi6\\\",\\n \\\"status\\\": 2,\\n \\\"type\\\": 0,\\n \\\"access\\\": \\\"All\\\",\\n \\\"createdAt\\\": 1668562696000,\\n \\\"remarks\\\": \\\"remarks\\\",\\n \\\"tradeTypes\\\": [\\n \\\"Spot\\\",\\n \\\"Futures\\\",\\n \\\"Margin\\\"\\n ],\\n \\\"openedTradeTypes\\\": [\\n \\\"Spot\\\"\\n ],\\n \\\"hostedStatus\\\": null\\n }\\n ]\\n }\\n}", - "x-request-example": "{\\\"password\\\": \\\"1234567\\\", \\\"remarks\\\": \\\"TheRemark\\\", \\\"subName\\\": \\\"Name1234567\\\", \\\"access\\\": \\\"Spot\\\"}" - } - }, - "/api/v3/sub/user/margin/enable": { - "post": { - "summary": "Add SubAccount Margin Permission", - "deprecated": false, - "description": "This endpoint can be used to add sub-accounts Margin permission. Before using this endpoints, you need to ensure that the master account apikey has Margin permissions and the Margin function has been activated.", - "tags": [], - "parameters": [], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "data": { - "type": "string" - } - }, - "required": [ - "code", - "data" - ] - } - } - } - } - }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470331", - "x-abandon": "normal", - "x-domain": "Spot", - "x-api-channel": "Private", - "x-api-permission": "Margin", - "x-api-rate-limit-pool": "Management", - "x-sdk-service": "Account", - "x-sdk-sub-service": "SubAccount", - "x-sdk-method-name": "addSubAccountMarginPermission", - "x-sdk-method-description": "This endpoint can be used to add sub-accounts Margin permission. Before using this endpoints, you need to ensure that the master account apikey has Margin permissions and the Margin function has been activated.", - "x-api-rate-limit": 15, - "requestBody": { - "content": { - "application/json": { - "schema": { - "title": "", - "type": "object", - "properties": { - "uid": { - "type": "string", - "description": "Sub account UID" - } - }, - "required": [ - "uid" - ] - }, - "example": "{\n \"uid\": \"169579801\"\n}" - } - } - }, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": null\\n}", - "x-request-example": "{\\\"uid\\\": \\\"169579801\\\"}" + "x-abandon": "normal", + "x-domain": "Futures", + "x-api-channel": "Private", + "x-api-permission": "General", + "x-api-rate-limit-pool": "Futures", + "x-sdk-service": "Account", + "x-sdk-sub-service": "SubAccount", + "x-sdk-method-name": "getFuturesSubAccountListV2", + "x-sdk-method-description": "This endpoint can be used to get Futures sub-account information. ", + "x-api-rate-limit": 6, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"summary\\\": {\\n \\\"accountEquityTotal\\\": 103.899081508,\\n \\\"unrealisedPNLTotal\\\": 38.81075,\\n \\\"marginBalanceTotal\\\": 65.336985668,\\n \\\"positionMarginTotal\\\": 68.9588320683,\\n \\\"orderMarginTotal\\\": 0,\\n \\\"frozenFundsTotal\\\": 0,\\n \\\"availableBalanceTotal\\\": 67.2492494397,\\n \\\"currency\\\": \\\"USDT\\\"\\n },\\n \\\"accounts\\\": [\\n {\\n \\\"accountName\\\": \\\"Name1234567\\\",\\n \\\"accountEquity\\\": 0,\\n \\\"unrealisedPNL\\\": 0,\\n \\\"marginBalance\\\": 0,\\n \\\"positionMargin\\\": 0,\\n \\\"orderMargin\\\": 0,\\n \\\"frozenFunds\\\": 0,\\n \\\"availableBalance\\\": 0,\\n \\\"currency\\\": \\\"USDT\\\"\\n },\\n {\\n \\\"accountName\\\": \\\"LTkucoin1491\\\",\\n \\\"accountEquity\\\": 0,\\n \\\"unrealisedPNL\\\": 0,\\n \\\"marginBalance\\\": 0,\\n \\\"positionMargin\\\": 0,\\n \\\"orderMargin\\\": 0,\\n \\\"frozenFunds\\\": 0,\\n \\\"availableBalance\\\": 0,\\n \\\"currency\\\": \\\"USDT\\\"\\n },\\n {\\n \\\"accountName\\\": \\\"manage112233\\\",\\n \\\"accountEquity\\\": 0,\\n \\\"unrealisedPNL\\\": 0,\\n \\\"marginBalance\\\": 0,\\n \\\"positionMargin\\\": 0,\\n \\\"orderMargin\\\": 0,\\n \\\"frozenFunds\\\": 0,\\n \\\"availableBalance\\\": 0,\\n \\\"currency\\\": \\\"USDT\\\"\\n },\\n {\\n \\\"accountName\\\": \\\"testapi6\\\",\\n \\\"accountEquity\\\": 27.30545128,\\n \\\"unrealisedPNL\\\": 22.549,\\n \\\"marginBalance\\\": 4.75645128,\\n \\\"positionMargin\\\": 24.1223749975,\\n \\\"orderMargin\\\": 0,\\n \\\"frozenFunds\\\": 0,\\n \\\"availableBalance\\\": 25.7320762825,\\n \\\"currency\\\": \\\"USDT\\\"\\n },\\n {\\n \\\"accountName\\\": \\\"main\\\",\\n \\\"accountEquity\\\": 76.593630228,\\n \\\"unrealisedPNL\\\": 16.26175,\\n \\\"marginBalance\\\": 60.580534388,\\n \\\"positionMargin\\\": 44.8364570708,\\n \\\"orderMargin\\\": 0,\\n \\\"frozenFunds\\\": 0,\\n \\\"availableBalance\\\": 41.5171731572,\\n \\\"currency\\\": \\\"USDT\\\"\\n }\\n ]\\n }\\n}", + "x-request-example": "{\\\"currency\\\": \\\"USDT\\\"}" } }, - "/api/v3/sub/user/futures/enable": { + "/api/v1/sub/api-key": { "post": { - "summary": "Add SubAccount Futures Permission", + "summary": "Add SubAccount API", "deprecated": false, - "description": "This endpoint can be used to add sub-accounts Futures permission. Before using this endpoints, you need to ensure that the master account apikey has Futures permissions and the Futures function has been activated.", + "description": "This endpoint can be used to create APIs for sub-accounts.", "tags": [], "parameters": [], "responses": { @@ -2937,7 +3003,56 @@ "type": "string" }, "data": { - "type": "boolean" + "type": "object", + "properties": { + "subName": { + "type": "string", + "description": "Sub-account name" + }, + "remark": { + "type": "string", + "description": "Remarks" + }, + "apiKey": { + "type": "string", + "description": "API Key" + }, + "apiSecret": { + "type": "string", + "description": "API Secret Key\n" + }, + "apiVersion": { + "type": "integer", + "description": "API Version" + }, + "passphrase": { + "type": "string", + "description": "Password" + }, + "permission": { + "type": "string", + "description": "[Permissions](https://www.kucoin.com/docs-new/doc-338144)" + }, + "ipWhitelist": { + "type": "string", + "description": "IP whitelist" + }, + "createdAt": { + "type": "integer", + "description": "Time of the event", + "format": "int64" + } + }, + "required": [ + "subName", + "remark", + "apiKey", + "apiSecret", + "apiVersion", + "passphrase", + "permission", + "createdAt" + ] } }, "required": [ @@ -2949,17 +3064,17 @@ } } }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470332", + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470138", "x-abandon": "normal", "x-domain": "Spot", "x-api-channel": "Private", - "x-api-permission": "Futures", + "x-api-permission": "General", "x-api-rate-limit-pool": "Management", "x-sdk-service": "Account", "x-sdk-sub-service": "SubAccount", - "x-sdk-method-name": "addSubAccountFuturesPermission", - "x-sdk-method-description": "This endpoint can be used to add sub-accounts Futures permission. Before using this endpoints, you need to ensure that the master account apikey has Futures permissions and the Futures function has been activated.", - "x-api-rate-limit": 15, + "x-sdk-method-name": "addSubAccountApi", + "x-sdk-method-description": "This endpoint can be used to create APIs for sub-accounts.", + "x-api-rate-limit": 20, "requestBody": { "content": { "application/json": { @@ -2967,24 +3082,86 @@ "title": "", "type": "object", "properties": { - "uid": { + "passphrase": { "type": "string", - "description": "Sub account UID" + "description": "Password(Must contain 7-32 characters. Cannot contain any spaces.)" + }, + "remark": { + "type": "string", + "description": "Remarks(1~24 characters)" + }, + "permission": { + "type": "string", + "description": "[Permissions](https://www.kucoin.com/docs-new/doc-338144)(Only General、Spot、Futures、Margin、InnerTransfer(Flex Transfer) permissions can be set, such as \"General, Trade\". The default is \"General\")", + "default": "General", + "example": [ + "General, Trade" + ] + }, + "ipWhitelist": { + "type": "string", + "description": "IP whitelist(You may add up to 20 IPs. Use a halfwidth comma to each IP)" + }, + "expire": { + "type": "string", + "description": "API expiration time; Never expire(default)-1,30Day30,90Day90,180Day180,360Day360", + "default": "-1", + "enum": [ + "-1", + "30", + "90", + "180", + "360" + ], + "x-api-enum": [ + { + "value": "-1", + "name": "", + "description": "" + }, + { + "value": "30", + "name": "", + "description": "" + }, + { + "value": "90", + "name": "", + "description": "" + }, + { + "value": "180", + "name": "", + "description": "" + }, + { + "value": "360", + "name": "", + "description": "" + } + ], + "example": [ + "30" + ] + }, + "subName": { + "type": "string", + "description": "Sub-account name, create sub account name of API Key." } }, "required": [ - "uid" + "subName", + "remark", + "passphrase" ] }, - "example": "{\n \"uid\": \"169579801\"\n}" + "example": "{\n \"subName\": \"testapi6\",\n \"passphrase\": \"11223344\",\n \"remark\": \"TheRemark\",\n \"permission\": \"General,Spot,Futures\"\n}" } } }, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": null\\n}", - "x-request-example": "{\\\"uid\\\": \\\"169579801\\\"}" - } - }, - "/api/v1/sub/api-key": { + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"subName\\\": \\\"testapi6\\\",\\n \\\"remark\\\": \\\"TheRemark\\\",\\n \\\"apiKey\\\": \\\"670621e3a25958000159c82f\\\",\\n \\\"apiSecret\\\": \\\"46fd8974******896f005b2340\\\",\\n \\\"apiVersion\\\": 3,\\n \\\"passphrase\\\": \\\"11223344\\\",\\n \\\"permission\\\": \\\"General,Futures\\\",\\n \\\"createdAt\\\": 1728455139000\\n }\\n}", + "x-request-example": "{\\\"subName\\\": \\\"testapi6\\\", \\\"passphrase\\\": \\\"11223344\\\", \\\"remark\\\": \\\"TheRemark\\\", \\\"permission\\\": \\\"General,Spot,Futures\\\"}" + }, "get": { "summary": "Get SubAccount API List", "deprecated": false, @@ -3175,11 +3352,13 @@ "x-api-rate-limit": 30, "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"subName\\\":\\\"testapi6\\\",\\\"apiKey\\\":\\\"670621e3a25958000159c82f\\\"}}", "x-request-example": "{\\\"apiKey\\\": \\\"670621e3a25958000159c82f\\\", \\\"subName\\\": \\\"testapi6\\\", \\\"passphrase\\\": \\\"11223344\\\"}" - }, + } + }, + "/api/v1/sub/api-key/update": { "post": { - "summary": "Add SubAccount API", + "summary": "Modify SubAccount API", "deprecated": false, - "description": "This endpoint can be used to create APIs for sub-accounts.", + "description": "This endpoint can be used to modify sub-account APIs.", "tags": [], "parameters": [], "responses": { @@ -3200,26 +3379,10 @@ "type": "string", "description": "Sub-account name" }, - "remark": { - "type": "string", - "description": "Remarks" - }, "apiKey": { "type": "string", "description": "API Key" }, - "apiSecret": { - "type": "string", - "description": "API Secret Key\n" - }, - "apiVersion": { - "type": "integer", - "description": "API Version" - }, - "passphrase": { - "type": "string", - "description": "Password" - }, "permission": { "type": "string", "description": "[Permissions](https://www.kucoin.com/docs-new/doc-338144)" @@ -3227,22 +3390,12 @@ "ipWhitelist": { "type": "string", "description": "IP whitelist" - }, - "createdAt": { - "type": "integer", - "description": "Time of the event", - "format": "int64" } }, "required": [ "subName", - "remark", "apiKey", - "apiSecret", - "apiVersion", - "passphrase", - "permission", - "createdAt" + "permission" ] } }, @@ -3255,7 +3408,7 @@ } } }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470138", + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470139", "x-abandon": "normal", "x-domain": "Spot", "x-api-channel": "Private", @@ -3263,9 +3416,9 @@ "x-api-rate-limit-pool": "Management", "x-sdk-service": "Account", "x-sdk-sub-service": "SubAccount", - "x-sdk-method-name": "addSubAccountApi", - "x-sdk-method-description": "This endpoint can be used to create APIs for sub-accounts.", - "x-api-rate-limit": 20, + "x-sdk-method-name": "modifySubAccountApi", + "x-sdk-method-description": "This endpoint can be used to modify sub-account APIs.", + "x-api-rate-limit": 30, "requestBody": { "content": { "application/json": { @@ -3277,16 +3430,12 @@ "type": "string", "description": "Password(Must contain 7-32 characters. Cannot contain any spaces.)" }, - "remark": { - "type": "string", - "description": "Remarks(1~24 characters)" - }, "permission": { "type": "string", "description": "[Permissions](https://www.kucoin.com/docs-new/doc-338144)(Only General、Spot、Futures、Margin、InnerTransfer(Flex Transfer) permissions can be set, such as \"General, Trade\". The default is \"General\")", "default": "General", "example": [ - "General, Trade" + "General,Trade" ] }, "ipWhitelist": { @@ -3338,27 +3487,31 @@ "subName": { "type": "string", "description": "Sub-account name, create sub account name of API Key." + }, + "apiKey": { + "type": "string", + "description": "API-Key(Sub-account APIKey)" } }, "required": [ "subName", - "remark", - "passphrase" + "passphrase", + "apiKey" ] }, - "example": "{\n \"subName\": \"testapi6\",\n \"passphrase\": \"11223344\",\n \"remark\": \"TheRemark\",\n \"permission\": \"General,Spot,Futures\"\n}" + "example": "{\n \"subName\": \"testapi6\",\n \"apiKey\": \"670621e3a25958000159c82f\",\n \"passphrase\": \"11223344\",\n \"permission\": \"General,Spot,Futures\"\n}" } } }, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"subName\\\": \\\"testapi6\\\",\\n \\\"remark\\\": \\\"TheRemark\\\",\\n \\\"apiKey\\\": \\\"670621e3a25958000159c82f\\\",\\n \\\"apiSecret\\\": \\\"46fd8974******896f005b2340\\\",\\n \\\"apiVersion\\\": 3,\\n \\\"passphrase\\\": \\\"11223344\\\",\\n \\\"permission\\\": \\\"General,Futures\\\",\\n \\\"createdAt\\\": 1728455139000\\n }\\n}", - "x-request-example": "{\\\"subName\\\": \\\"testapi6\\\", \\\"passphrase\\\": \\\"11223344\\\", \\\"remark\\\": \\\"TheRemark\\\", \\\"permission\\\": \\\"General,Spot,Futures\\\"}" + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"subName\\\": \\\"testapi6\\\",\\n \\\"apiKey\\\": \\\"670621e3a25958000159c82f\\\",\\n \\\"permission\\\": \\\"General,Futures,Spot\\\"\\n }\\n}", + "x-request-example": "{\\\"subName\\\": \\\"testapi6\\\", \\\"apiKey\\\": \\\"670621e3a25958000159c82f\\\", \\\"passphrase\\\": \\\"11223344\\\", \\\"permission\\\": \\\"General,Spot,Futures\\\"}" } }, - "/api/v1/sub/api-key/update": { + "/api/v3/deposit-address/create": { "post": { - "summary": "Modify SubAccount API", + "summary": "Add Deposit Address(V3)", "deprecated": false, - "description": "This endpoint can be used to modify sub-account APIs.", + "description": "Request via this endpoint to create a deposit address for a currency you intend to deposit.", "tags": [], "parameters": [], "responses": { @@ -3375,27 +3528,59 @@ "data": { "type": "object", "properties": { - "subName": { + "address": { "type": "string", - "description": "Sub-account name" + "description": "Deposit address" }, - "apiKey": { + "memo": { "type": "string", - "description": "API Key" + "description": "Address remark. If there’s no remark, it is empty. When you withdraw from other platforms to the KuCoin, you need to fill in memo(tag). If you do not fill memo (tag), your deposit may not be available, please be cautious." + }, + "chainId": { + "type": "string", + "description": "The chainId of currency", + "example": [ + "eth", + "bech32", + "btc", + "kcc", + "trx", + "bsc", + "arbitrum", + "ton", + "optimism" + ] + }, + "to": { + "type": "string", + "description": "Deposit account type: main (funding account), trade (spot trading account)" }, - "permission": { + "expirationDate": { + "type": "integer", + "description": "Expiration time, Lightning network expiration time, non-Lightning network this field is invalid" + }, + "currency": { "type": "string", - "description": "[Permissions](https://www.kucoin.com/docs-new/doc-338144)" + "description": "currency", + "example": [ + "BTC", + "ETH", + "USDT" + ] }, - "ipWhitelist": { + "chainName": { "type": "string", - "description": "IP whitelist" + "description": "The chainName of currency" } }, "required": [ - "subName", - "apiKey", - "permission" + "address", + "memo", + "chainId", + "to", + "expirationDate", + "currency", + "chainName" ] } }, @@ -3408,17 +3593,17 @@ } } }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470139", + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470142", "x-abandon": "normal", "x-domain": "Spot", "x-api-channel": "Private", "x-api-permission": "General", "x-api-rate-limit-pool": "Management", "x-sdk-service": "Account", - "x-sdk-sub-service": "SubAccount", - "x-sdk-method-name": "modifySubAccountApi", - "x-sdk-method-description": "This endpoint can be used to modify sub-account APIs.", - "x-api-rate-limit": 30, + "x-sdk-sub-service": "Deposit", + "x-sdk-method-name": "addDepositAddressV3", + "x-sdk-method-description": "Request via this endpoint to create a deposit address for a currency you intend to deposit.", + "x-api-rate-limit": 20, "requestBody": { "content": { "application/json": { @@ -3426,85 +3611,67 @@ "title": "", "type": "object", "properties": { - "passphrase": { - "type": "string", - "description": "Password(Must contain 7-32 characters. Cannot contain any spaces.)" - }, - "permission": { + "currency": { "type": "string", - "description": "[Permissions](https://www.kucoin.com/docs-new/doc-338144)(Only General、Spot、Futures、Margin、InnerTransfer(Flex Transfer) permissions can be set, such as \"General, Trade\". The default is \"General\")", - "default": "General", + "description": "currency", "example": [ - "General,Trade" + "BTC", + "ETH", + "USDT" ] }, - "ipWhitelist": { + "chain": { "type": "string", - "description": "IP whitelist(You may add up to 20 IPs. Use a halfwidth comma to each IP)" + "description": "The chainId of currency, e.g. The available value for USDT are OMNI, ERC20, TRC20, default is ERC20. The available value for BTC are Native, Segwit, TRC20, the parameters are bech32, btc, trx, default is Native. This only apply for multi-chain currency, and there is no need for single chain currency.", + "default": "eth", + "example": [ + "eth", + "bech32", + "btc", + "kcc", + "trx", + "bsc", + "arbitrum", + "ton", + "optimism" + ] }, - "expire": { + "to": { "type": "string", - "description": "API expiration time; Never expire(default)-1,30Day30,90Day90,180Day180,360Day360", - "default": "-1", + "description": "Deposit account type: main (funding account), trade (spot trading account), the default is main", "enum": [ - "-1", - "30", - "90", - "180", - "360" + "main", + "trade" ], + "default": "main", "x-api-enum": [ { - "value": "-1", - "name": "", - "description": "" - }, - { - "value": "30", - "name": "", - "description": "" - }, - { - "value": "90", - "name": "", - "description": "" - }, - { - "value": "180", + "value": "main", "name": "", "description": "" }, { - "value": "360", + "value": "trade", "name": "", "description": "" } - ], - "example": [ - "30" ] }, - "subName": { - "type": "string", - "description": "Sub-account name, create sub account name of API Key." - }, - "apiKey": { + "amount": { "type": "string", - "description": "API-Key(Sub-account APIKey)" + "description": "Deposit amount. This parameter is only used when applying for invoices on the Lightning Network. This parameter is invalid if it is not passed through the Lightning Network." } }, "required": [ - "subName", - "passphrase", - "apiKey" + "currency" ] }, - "example": "{\n \"subName\": \"testapi6\",\n \"apiKey\": \"670621e3a25958000159c82f\",\n \"passphrase\": \"11223344\",\n \"permission\": \"General,Spot,Futures\"\n}" + "example": "{\n \"currency\": \"TON\",\n \"chain\": \"ton\",\n \"to\": \"trade\"\n}" } } }, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"subName\\\": \\\"testapi6\\\",\\n \\\"apiKey\\\": \\\"670621e3a25958000159c82f\\\",\\n \\\"permission\\\": \\\"General,Futures,Spot\\\"\\n }\\n}", - "x-request-example": "{\\\"subName\\\": \\\"testapi6\\\", \\\"apiKey\\\": \\\"670621e3a25958000159c82f\\\", \\\"passphrase\\\": \\\"11223344\\\", \\\"permission\\\": \\\"General,Spot,Futures\\\"}" + "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"address\\\":\\\"EQCA1BI4QRZ8qYmskSRDzJmkucGodYRTZCf_b9hckjla6dZl\\\",\\\"memo\\\":\\\"2090821203\\\",\\\"chainId\\\":\\\"ton\\\",\\\"to\\\":\\\"TRADE\\\",\\\"expirationDate\\\":0,\\\"currency\\\":\\\"TON\\\",\\\"chainName\\\":\\\"TON\\\"}}", + "x-request-example": "{\\\"currency\\\": \\\"TON\\\", \\\"chain\\\": \\\"ton\\\", \\\"to\\\": \\\"trade\\\"}" } }, "/api/v3/deposit-addresses": { @@ -3829,153 +3996,52 @@ }, "memo": { "type": "string", - "description": "Address remark. If there’s no remark, it is empty. " - }, - "isInner": { - "type": "boolean", - "description": "Internal deposit or not" - }, - "amount": { - "type": "string", - "description": "Deposit amount" - }, - "fee": { - "type": "string", - "description": "Fees charged for deposit" - }, - "walletTxId": { - "type": "string", - "description": "Wallet Txid" - }, - "createdAt": { - "type": "integer", - "description": "Creation time of the database record", - "format": "int64" - }, - "updatedAt": { - "type": "integer", - "description": "Update time of the database record", - "format": "int64" - }, - "remark": { - "type": "string", - "description": "remark" - }, - "arrears": { - "type": "boolean", - "description": "Whether there is any debt.A quick rollback will cause the deposit to fail. If the deposit fails, you will need to repay the balance." - } - } - } - } - }, - "required": [ - "currentPage", - "pageSize", - "totalNum", - "totalPage", - "items" - ] - } - }, - "required": [ - "code", - "data" - ] - } - } - } - } - }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470141", - "x-abandon": "normal", - "x-domain": "Spot", - "x-api-channel": "Private", - "x-api-permission": "General", - "x-api-rate-limit-pool": "Management", - "x-sdk-service": "Account", - "x-sdk-sub-service": "Deposit", - "x-sdk-method-name": "getDepositHistory", - "x-sdk-method-description": "Request via this endpoint to get deposit list Items are paginated and sorted to show the latest first. See the Pagination section for retrieving additional entries after the first page.", - "x-api-rate-limit": 5, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"currentPage\\\": 1,\\n \\\"pageSize\\\": 50,\\n \\\"totalNum\\\": 5,\\n \\\"totalPage\\\": 1,\\n \\\"items\\\": [\\n {\\n \\\"currency\\\": \\\"USDT\\\",\\n \\\"chain\\\": \\\"\\\",\\n \\\"status\\\": \\\"SUCCESS\\\",\\n \\\"address\\\": \\\"a435*****@gmail.com\\\",\\n \\\"memo\\\": \\\"\\\",\\n \\\"isInner\\\": true,\\n \\\"amount\\\": \\\"1.00000000\\\",\\n \\\"fee\\\": \\\"0.00000000\\\",\\n \\\"walletTxId\\\": null,\\n \\\"createdAt\\\": 1728555875000,\\n \\\"updatedAt\\\": 1728555875000,\\n \\\"remark\\\": \\\"\\\",\\n \\\"arrears\\\": false\\n },\\n {\\n \\\"currency\\\": \\\"USDT\\\",\\n \\\"chain\\\": \\\"trx\\\",\\n \\\"status\\\": \\\"SUCCESS\\\",\\n \\\"address\\\": \\\"TSv3L1fS7******X4nLP6rqNxYz\\\",\\n \\\"memo\\\": \\\"\\\",\\n \\\"isInner\\\": true,\\n \\\"amount\\\": \\\"6.00000000\\\",\\n \\\"fee\\\": \\\"0.00000000\\\",\\n \\\"walletTxId\\\": null,\\n \\\"createdAt\\\": 1721730920000,\\n \\\"updatedAt\\\": 1721730920000,\\n \\\"remark\\\": \\\"\\\",\\n \\\"arrears\\\": false\\n }\\n ]\\n }\\n}", - "x-request-example": "{\\\"currency\\\": \\\"BTC\\\", \\\"status\\\": \\\"SUCCESS\\\", \\\"startAt\\\": 1728663338000, \\\"endAt\\\": 1728692138000, \\\"currentPage\\\": 1, \\\"pageSize\\\": 50}" - } - }, - "/api/v3/deposit-address/create": { - "post": { - "summary": "Add Deposit Address(V3)", - "deprecated": false, - "description": "Request via this endpoint to create a deposit address for a currency you intend to deposit.", - "tags": [], - "parameters": [], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "data": { - "type": "object", - "properties": { - "address": { - "type": "string", - "description": "Deposit address" - }, - "memo": { - "type": "string", - "description": "Address remark. If there’s no remark, it is empty. When you withdraw from other platforms to the KuCoin, you need to fill in memo(tag). If you do not fill memo (tag), your deposit may not be available, please be cautious." - }, - "chainId": { - "type": "string", - "description": "The chainId of currency", - "example": [ - "eth", - "bech32", - "btc", - "kcc", - "trx", - "bsc", - "arbitrum", - "ton", - "optimism" - ] - }, - "to": { - "type": "string", - "description": "Deposit account type: main (funding account), trade (spot trading account)" - }, - "expirationDate": { - "type": "integer", - "description": "Expiration time, Lightning network expiration time, non-Lightning network this field is invalid" - }, - "currency": { - "type": "string", - "description": "currency", - "example": [ - "BTC", - "ETH", - "USDT" - ] - }, - "chainName": { - "type": "string", - "description": "The chainName of currency" + "description": "Address remark. If there’s no remark, it is empty. " + }, + "isInner": { + "type": "boolean", + "description": "Internal deposit or not" + }, + "amount": { + "type": "string", + "description": "Deposit amount" + }, + "fee": { + "type": "string", + "description": "Fees charged for deposit" + }, + "walletTxId": { + "type": "string", + "description": "Wallet Txid" + }, + "createdAt": { + "type": "integer", + "description": "Creation time of the database record", + "format": "int64" + }, + "updatedAt": { + "type": "integer", + "description": "Update time of the database record", + "format": "int64" + }, + "remark": { + "type": "string", + "description": "remark" + }, + "arrears": { + "type": "boolean", + "description": "Whether there is any debt.A quick rollback will cause the deposit to fail. If the deposit fails, you will need to repay the balance." + } + } + } } }, "required": [ - "address", - "memo", - "chainId", - "to", - "expirationDate", - "currency", - "chainName" + "currentPage", + "pageSize", + "totalNum", + "totalPage", + "items" ] } }, @@ -3988,7 +4054,7 @@ } } }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470142", + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470141", "x-abandon": "normal", "x-domain": "Spot", "x-api-channel": "Private", @@ -3996,77 +4062,11 @@ "x-api-rate-limit-pool": "Management", "x-sdk-service": "Account", "x-sdk-sub-service": "Deposit", - "x-sdk-method-name": "addDepositAddressV3", - "x-sdk-method-description": "Request via this endpoint to create a deposit address for a currency you intend to deposit.", - "x-api-rate-limit": 20, - "requestBody": { - "content": { - "application/json": { - "schema": { - "title": "", - "type": "object", - "properties": { - "currency": { - "type": "string", - "description": "currency", - "example": [ - "BTC", - "ETH", - "USDT" - ] - }, - "chain": { - "type": "string", - "description": "The chainId of currency, e.g. The available value for USDT are OMNI, ERC20, TRC20, default is ERC20. The available value for BTC are Native, Segwit, TRC20, the parameters are bech32, btc, trx, default is Native. This only apply for multi-chain currency, and there is no need for single chain currency.", - "default": "eth", - "example": [ - "eth", - "bech32", - "btc", - "kcc", - "trx", - "bsc", - "arbitrum", - "ton", - "optimism" - ] - }, - "to": { - "type": "string", - "description": "Deposit account type: main (funding account), trade (spot trading account), the default is main", - "enum": [ - "main", - "trade" - ], - "default": "main", - "x-api-enum": [ - { - "value": "main", - "name": "", - "description": "" - }, - { - "value": "trade", - "name": "", - "description": "" - } - ] - }, - "amount": { - "type": "string", - "description": "Deposit amount. This parameter is only used when applying for invoices on the Lightning Network. This parameter is invalid if it is not passed through the Lightning Network." - } - }, - "required": [ - "currency" - ] - }, - "example": "{\n \"currency\": \"TON\",\n \"chain\": \"ton\",\n \"to\": \"trade\"\n}" - } - } - }, - "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"address\\\":\\\"EQCA1BI4QRZ8qYmskSRDzJmkucGodYRTZCf_b9hckjla6dZl\\\",\\\"memo\\\":\\\"2090821203\\\",\\\"chainId\\\":\\\"ton\\\",\\\"to\\\":\\\"TRADE\\\",\\\"expirationDate\\\":0,\\\"currency\\\":\\\"TON\\\",\\\"chainName\\\":\\\"TON\\\"}}", - "x-request-example": "{\\\"currency\\\": \\\"TON\\\", \\\"chain\\\": \\\"ton\\\", \\\"to\\\": \\\"trade\\\"}" + "x-sdk-method-name": "getDepositHistory", + "x-sdk-method-description": "Request via this endpoint to get deposit list Items are paginated and sorted to show the latest first. See the Pagination section for retrieving additional entries after the first page.", + "x-api-rate-limit": 5, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"currentPage\\\": 1,\\n \\\"pageSize\\\": 50,\\n \\\"totalNum\\\": 5,\\n \\\"totalPage\\\": 1,\\n \\\"items\\\": [\\n {\\n \\\"currency\\\": \\\"USDT\\\",\\n \\\"chain\\\": \\\"\\\",\\n \\\"status\\\": \\\"SUCCESS\\\",\\n \\\"address\\\": \\\"a435*****@gmail.com\\\",\\n \\\"memo\\\": \\\"\\\",\\n \\\"isInner\\\": true,\\n \\\"amount\\\": \\\"1.00000000\\\",\\n \\\"fee\\\": \\\"0.00000000\\\",\\n \\\"walletTxId\\\": null,\\n \\\"createdAt\\\": 1728555875000,\\n \\\"updatedAt\\\": 1728555875000,\\n \\\"remark\\\": \\\"\\\",\\n \\\"arrears\\\": false\\n },\\n {\\n \\\"currency\\\": \\\"USDT\\\",\\n \\\"chain\\\": \\\"trx\\\",\\n \\\"status\\\": \\\"SUCCESS\\\",\\n \\\"address\\\": \\\"TSv3L1fS7******X4nLP6rqNxYz\\\",\\n \\\"memo\\\": \\\"\\\",\\n \\\"isInner\\\": true,\\n \\\"amount\\\": \\\"6.00000000\\\",\\n \\\"fee\\\": \\\"0.00000000\\\",\\n \\\"walletTxId\\\": null,\\n \\\"createdAt\\\": 1721730920000,\\n \\\"updatedAt\\\": 1721730920000,\\n \\\"remark\\\": \\\"\\\",\\n \\\"arrears\\\": false\\n }\\n ]\\n }\\n}", + "x-request-example": "{\\\"currency\\\": \\\"BTC\\\", \\\"status\\\": \\\"SUCCESS\\\", \\\"startAt\\\": 1728663338000, \\\"endAt\\\": 1728692138000, \\\"currentPage\\\": 1, \\\"pageSize\\\": 50}" } }, "/api/v1/withdrawals/quotas": { @@ -4219,28 +4219,191 @@ ] } }, - "required": [ - "code", - "data" - ] - } - } + "required": [ + "code", + "data" + ] + } + } + } + } + }, + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470143", + "x-abandon": "normal", + "x-domain": "Spot", + "x-api-channel": "Private", + "x-api-permission": "General", + "x-api-rate-limit-pool": "Management", + "x-sdk-service": "Account", + "x-sdk-sub-service": "Withdrawal", + "x-sdk-method-name": "getWithdrawalQuotas", + "x-sdk-method-description": "This interface can obtain the withdrawal quotas information of this currency.", + "x-api-rate-limit": 20, + "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"currency\\\":\\\"BTC\\\",\\\"limitBTCAmount\\\":\\\"15.79590095\\\",\\\"usedBTCAmount\\\":\\\"0.00000000\\\",\\\"quotaCurrency\\\":\\\"USDT\\\",\\\"limitQuotaCurrencyAmount\\\":\\\"999999.00000000\\\",\\\"usedQuotaCurrencyAmount\\\":\\\"0\\\",\\\"remainAmount\\\":\\\"15.79590095\\\",\\\"availableAmount\\\":\\\"0\\\",\\\"withdrawMinFee\\\":\\\"0.0005\\\",\\\"innerWithdrawMinFee\\\":\\\"0\\\",\\\"withdrawMinSize\\\":\\\"0.001\\\",\\\"isWithdrawEnabled\\\":true,\\\"precision\\\":8,\\\"chain\\\":\\\"BTC\\\",\\\"reason\\\":null,\\\"lockedAmount\\\":\\\"0\\\"}}", + "x-request-example": "{\\\"currency\\\": \\\"BTC\\\", \\\"chain\\\": \\\"eth\\\"}" + } + }, + "/api/v3/withdrawals": { + "post": { + "summary": "Withdraw(V3)", + "deprecated": false, + "description": "Use this interface to withdraw the specified currency", + "tags": [], + "parameters": [], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "object", + "properties": { + "withdrawalId": { + "type": "string", + "description": "Withdrawal id, a unique ID for a withdrawal" + } + }, + "required": [ + "withdrawalId" + ] + } + }, + "required": [ + "code", + "data" + ] + } + } + } + } + }, + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470146", + "x-abandon": "normal", + "x-domain": "Spot", + "x-api-channel": "Private", + "x-api-permission": "Withdrawal", + "x-api-rate-limit-pool": "Management", + "x-sdk-service": "Account", + "x-sdk-sub-service": "Withdrawal", + "x-sdk-method-name": "withdrawalV3", + "x-sdk-method-description": "Use this interface to withdraw the specified currency", + "x-api-rate-limit": 5, + "requestBody": { + "content": { + "application/json": { + "schema": { + "title": "", + "type": "object", + "properties": { + "currency": { + "type": "string", + "description": "currency", + "example": [ + "BTC", + "ETH", + "USDT" + ] + }, + "chain": { + "type": "string", + "description": "The chainId of currency, For a currency with multiple chains, it is recommended to specify chain parameter instead of using the default chain; you can query the chainId through the response of the GET /api/v3/currencies/{currency} interface.", + "default": "eth", + "example": [ + "eth", + "bech32", + "btc", + "kcc", + "trx", + "bsc", + "arbitrum", + "ton", + "optimism" + ] + }, + "amount": { + "type": "integer", + "format": "int64", + "description": "Withdrawal amount, a positive number which is a multiple of the amount precision" + }, + "memo": { + "type": "string", + "description": "Address remark. If there’s no remark, it is empty. When you withdraw from other platforms to the KuCoin, you need to fill in memo(tag). If you do not fill memo (tag), your deposit may not be available, please be cautious." + }, + "isInner": { + "type": "boolean", + "description": "Internal withdrawal or not. Default : false", + "default": false + }, + "remark": { + "type": "string", + "description": "remark" + }, + "feeDeductType": { + "type": "string", + "description": "Withdrawal fee deduction type: INTERNAL or EXTERNAL or not specified\n\n1. INTERNAL- deduct the transaction fees from your withdrawal amount\n2. EXTERNAL- deduct the transaction fees from your main account\n3. If you don't specify the feeDeductType parameter, when the balance in your main account is sufficient to support the withdrawal, the system will initially deduct the transaction fees from your main account. But if the balance in your main account is not sufficient to support the withdrawal, the system will deduct the fees from your withdrawal amount. For example: Suppose you are going to withdraw 1 BTC from the KuCoin platform (transaction fee: 0.0001BTC), if the balance in your main account is insufficient, the system will deduct the transaction fees from your withdrawal amount. In this case, you will be receiving 0.9999BTC." + }, + "toAddress": { + "type": "string", + "description": "Withdrawal address", + "example": [ + "0x023****2355", + "1572**401", + "a431***1e@gmail.com", + "55-12341234" + ] + }, + "withdrawType": { + "type": "string", + "description": "Withdrawal type, ADDRESS (withdrawal address), UID, MAIL (email), PHONE (mobile phone number). Note: If you withdraw by uid/mail/phone, there will have rate limited: 3 times/10 seconds, 50 times/24 hours (calculated on a rolling basis based on the first request time)", + "enum": [ + "ADDRESS", + "UID", + "MAIL", + "PHONE" + ], + "x-api-enum": [ + { + "value": "ADDRESS", + "name": "", + "description": "" + }, + { + "value": "UID", + "name": "", + "description": "" + }, + { + "value": "MAIL", + "name": "", + "description": "" + }, + { + "value": "PHONE", + "name": "", + "description": "" + } + ] + } + }, + "required": [ + "currency", + "toAddress", + "amount", + "withdrawType" + ] + }, + "example": "{\n \"currency\": \"USDT\",\n \"toAddress\": \"TKFRQXSDcY****GmLrjJggwX8\",\n \"amount\": 3,\n \"withdrawType\": \"ADDRESS\",\n \"chain\": \"trx\",\n \"isInner\": true,\n \"remark\": \"this is Remark\"\n}" } } }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470143", - "x-abandon": "normal", - "x-domain": "Spot", - "x-api-channel": "Private", - "x-api-permission": "General", - "x-api-rate-limit-pool": "Management", - "x-sdk-service": "Account", - "x-sdk-sub-service": "Withdrawal", - "x-sdk-method-name": "getWithdrawalQuotas", - "x-sdk-method-description": "This interface can obtain the withdrawal quotas information of this currency.", - "x-api-rate-limit": 20, - "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"currency\\\":\\\"BTC\\\",\\\"limitBTCAmount\\\":\\\"15.79590095\\\",\\\"usedBTCAmount\\\":\\\"0.00000000\\\",\\\"quotaCurrency\\\":\\\"USDT\\\",\\\"limitQuotaCurrencyAmount\\\":\\\"999999.00000000\\\",\\\"usedQuotaCurrencyAmount\\\":\\\"0\\\",\\\"remainAmount\\\":\\\"15.79590095\\\",\\\"availableAmount\\\":\\\"0\\\",\\\"withdrawMinFee\\\":\\\"0.0005\\\",\\\"innerWithdrawMinFee\\\":\\\"0\\\",\\\"withdrawMinSize\\\":\\\"0.001\\\",\\\"isWithdrawEnabled\\\":true,\\\"precision\\\":8,\\\"chain\\\":\\\"BTC\\\",\\\"reason\\\":null,\\\"lockedAmount\\\":\\\"0\\\"}}", - "x-request-example": "{\\\"currency\\\": \\\"BTC\\\", \\\"chain\\\": \\\"eth\\\"}" + "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"withdrawalId\\\":\\\"670deec84d64da0007d7c946\\\"}}", + "x-request-example": "{\\\"currency\\\": \\\"USDT\\\", \\\"toAddress\\\": \\\"TKFRQXSDcY****GmLrjJggwX8\\\", \\\"amount\\\": 3, \\\"withdrawType\\\": \\\"ADDRESS\\\", \\\"chain\\\": \\\"trx\\\", \\\"isInner\\\": true, \\\"remark\\\": \\\"this is Remark\\\"}" } }, "/api/v1/withdrawals/{withdrawalId}": { @@ -4687,167 +4850,151 @@ "x-request-example": "{\\\"currency\\\": \\\"USDT\\\", \\\"address\\\": \\\"TKFRQXSDc****16GmLrjJggwX8\\\", \\\"amount\\\": 3, \\\"chain\\\": \\\"trx\\\", \\\"isInner\\\": true}" } }, - "/api/v3/withdrawals": { - "post": { - "summary": "Withdraw(V3)", + "/api/v1/accounts/transferable": { + "get": { + "summary": "Get Transfer Quotas", "deprecated": false, - "description": "Use this interface to withdraw the specified currency", + "description": "This endpoint returns the transferable balance of a specified account.", "tags": [], - "parameters": [], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "data": { - "type": "object", - "properties": { - "withdrawalId": { - "type": "string", - "description": "Withdrawal id, a unique ID for a withdrawal" - } - }, - "required": [ - "withdrawalId" - ] - } - }, - "required": [ - "code", - "data" - ] - } - } + "parameters": [ + { + "name": "currency", + "in": "query", + "description": "currency", + "required": true, + "schema": { + "type": "string", + "example": [ + "BTC", + "ETH", + "USDT" + ] } - } - }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470146", - "x-abandon": "normal", - "x-domain": "Spot", - "x-api-channel": "Private", - "x-api-permission": "Withdrawal", - "x-api-rate-limit-pool": "Management", - "x-sdk-service": "Account", - "x-sdk-sub-service": "Withdrawal", - "x-sdk-method-name": "withdrawalV3", - "x-sdk-method-description": "Use this interface to withdraw the specified currency", - "x-api-rate-limit": 5, - "requestBody": { - "content": { - "application/json": { - "schema": { - "title": "", - "type": "object", - "properties": { - "currency": { - "type": "string", - "description": "currency", - "example": [ - "BTC", - "ETH", - "USDT" - ] - }, - "chain": { - "type": "string", - "description": "The chainId of currency, For a currency with multiple chains, it is recommended to specify chain parameter instead of using the default chain; you can query the chainId through the response of the GET /api/v3/currencies/{currency} interface.", - "default": "eth", - "example": [ - "eth", - "bech32", - "btc", - "kcc", - "trx", - "bsc", - "arbitrum", - "ton", - "optimism" - ] - }, - "amount": { - "type": "integer", - "format": "int64", - "description": "Withdrawal amount, a positive number which is a multiple of the amount precision" - }, - "memo": { - "type": "string", - "description": "Address remark. If there’s no remark, it is empty. When you withdraw from other platforms to the KuCoin, you need to fill in memo(tag). If you do not fill memo (tag), your deposit may not be available, please be cautious." - }, - "isInner": { - "type": "boolean", - "description": "Internal withdrawal or not. Default : false", - "default": false - }, - "remark": { - "type": "string", - "description": "remark" - }, - "feeDeductType": { - "type": "string", - "description": "Withdrawal fee deduction type: INTERNAL or EXTERNAL or not specified\n\n1. INTERNAL- deduct the transaction fees from your withdrawal amount\n2. EXTERNAL- deduct the transaction fees from your main account\n3. If you don't specify the feeDeductType parameter, when the balance in your main account is sufficient to support the withdrawal, the system will initially deduct the transaction fees from your main account. But if the balance in your main account is not sufficient to support the withdrawal, the system will deduct the fees from your withdrawal amount. For example: Suppose you are going to withdraw 1 BTC from the KuCoin platform (transaction fee: 0.0001BTC), if the balance in your main account is insufficient, the system will deduct the transaction fees from your withdrawal amount. In this case, you will be receiving 0.9999BTC." - }, - "toAddress": { - "type": "string", - "description": "Withdrawal address", - "example": [ - "0x023****2355", - "1572**401", - "a431***1e@gmail.com", - "55-12341234" - ] - }, - "withdrawType": { - "type": "string", - "description": "Withdrawal type, ADDRESS (withdrawal address), UID, MAIL (email), PHONE (mobile phone number). Note: If you withdraw by uid/mail/phone, there will have rate limited: 3 times/10 seconds, 50 times/24 hours (calculated on a rolling basis based on the first request time)", - "enum": [ - "ADDRESS", - "UID", - "MAIL", - "PHONE" - ], - "x-api-enum": [ - { - "value": "ADDRESS", - "name": "", - "description": "" - }, - { - "value": "UID", - "name": "", - "description": "" - }, - { - "value": "MAIL", - "name": "", - "description": "" - }, - { - "value": "PHONE", - "name": "", - "description": "" - } - ] - } + }, + { + "name": "type", + "in": "query", + "description": "The account type:MAIN、TRADE、MARGIN、ISOLATED", + "required": true, + "schema": { + "type": "string", + "enum": [ + "MAIN", + "TRADE", + "MARGIN", + "ISOLATED", + "OPTION" + ], + "x-api-enum": [ + { + "value": "MAIN", + "name": "MAIN", + "description": "Funding account" + }, + { + "value": "TRADE", + "name": "TRADE", + "description": "Spot account" }, - "required": [ - "currency", - "toAddress", - "amount", - "withdrawType" - ] - }, - "example": "{\n \"currency\": \"USDT\",\n \"toAddress\": \"TKFRQXSDcY****GmLrjJggwX8\",\n \"amount\": 3,\n \"withdrawType\": \"ADDRESS\",\n \"chain\": \"trx\",\n \"isInner\": true,\n \"remark\": \"this is Remark\"\n}" + { + "value": "MARGIN", + "name": "MARGIN", + "description": "Cross margin account" + }, + { + "value": "ISOLATED", + "name": "ISOLATED", + "description": "Isolated margin account" + }, + { + "value": "OPTION", + "name": "OPTION", + "description": "Option account" + } + ] + } + }, + { + "name": "tag", + "in": "query", + "description": "Trading pair, required when the account type is ISOLATED; other types are not passed, e.g.: BTC-USDT", + "required": false, + "schema": { + "type": "string", + "default": "BTC-USDT", + "example": [ + "ETH-USDT", + "KCS-USDT" + ] + } + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "object", + "properties": { + "currency": { + "type": "string", + "description": "Currency" + }, + "balance": { + "type": "string", + "description": "Total funds in an account." + }, + "available": { + "type": "string", + "description": "Funds available to withdraw or trade." + }, + "holds": { + "type": "string", + "description": "Funds on hold (not available for use)." + }, + "transferable": { + "type": "string", + "description": "Funds available to transfer." + } + }, + "required": [ + "currency", + "balance", + "available", + "holds", + "transferable" + ] + } + }, + "required": [ + "code", + "data" + ] + } + } } } }, - "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"withdrawalId\\\":\\\"670deec84d64da0007d7c946\\\"}}", - "x-request-example": "{\\\"currency\\\": \\\"USDT\\\", \\\"toAddress\\\": \\\"TKFRQXSDcY****GmLrjJggwX8\\\", \\\"amount\\\": 3, \\\"withdrawType\\\": \\\"ADDRESS\\\", \\\"chain\\\": \\\"trx\\\", \\\"isInner\\\": true, \\\"remark\\\": \\\"this is Remark\\\"}" + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470148", + "x-abandon": "normal", + "x-domain": "Spot", + "x-api-channel": "Private", + "x-api-permission": "General", + "x-api-rate-limit-pool": "Management", + "x-sdk-service": "Account", + "x-sdk-sub-service": "Transfer", + "x-sdk-method-name": "getTransferQuotas", + "x-sdk-method-description": "This endpoint returns the transferable balance of a specified account.", + "x-api-rate-limit": 20, + "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"currency\\\":\\\"USDT\\\",\\\"balance\\\":\\\"10.5\\\",\\\"available\\\":\\\"10.5\\\",\\\"holds\\\":\\\"0\\\",\\\"transferable\\\":\\\"10.5\\\"}}", + "x-request-example": "{\\\"currency\\\": \\\"BTC\\\", \\\"type\\\": \\\"MAIN\\\", \\\"tag\\\": \\\"ETH-USDT\\\"}" } }, "/api/v3/accounts/universal-transfer": { @@ -5092,153 +5239,6 @@ "x-request-example": "{\\\"clientOid\\\": \\\"64ccc0f164781800010d8c09\\\", \\\"type\\\": \\\"PARENT_TO_SUB\\\", \\\"currency\\\": \\\"USDT\\\", \\\"amount\\\": \\\"0.01\\\", \\\"fromAccountType\\\": \\\"TRADE\\\", \\\"toUserId\\\": \\\"63743f07e0c5230001761d08\\\", \\\"toAccountType\\\": \\\"TRADE\\\"}" } }, - "/api/v1/accounts/transferable": { - "get": { - "summary": "Get Transfer Quotas", - "deprecated": false, - "description": "This endpoint returns the transferable balance of a specified account.", - "tags": [], - "parameters": [ - { - "name": "currency", - "in": "query", - "description": "currency", - "required": true, - "schema": { - "type": "string", - "example": [ - "BTC", - "ETH", - "USDT" - ] - } - }, - { - "name": "type", - "in": "query", - "description": "The account type:MAIN、TRADE、MARGIN、ISOLATED", - "required": true, - "schema": { - "type": "string", - "enum": [ - "MAIN", - "TRADE", - "MARGIN", - "ISOLATED", - "OPTION" - ], - "x-api-enum": [ - { - "value": "MAIN", - "name": "MAIN", - "description": "Funding account" - }, - { - "value": "TRADE", - "name": "TRADE", - "description": "Spot account" - }, - { - "value": "MARGIN", - "name": "MARGIN", - "description": "Cross margin account" - }, - { - "value": "ISOLATED", - "name": "ISOLATED", - "description": "Isolated margin account" - }, - { - "value": "OPTION", - "name": "OPTION", - "description": "Option account" - } - ] - } - }, - { - "name": "tag", - "in": "query", - "description": "Trading pair, required when the account type is ISOLATED; other types are not passed, e.g.: BTC-USDT", - "required": false, - "schema": { - "type": "string", - "default": "BTC-USDT", - "example": [ - "ETH-USDT", - "KCS-USDT" - ] - } - } - ], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "data": { - "type": "object", - "properties": { - "currency": { - "type": "string", - "description": "Currency" - }, - "balance": { - "type": "string", - "description": "Total funds in an account." - }, - "available": { - "type": "string", - "description": "Funds available to withdraw or trade." - }, - "holds": { - "type": "string", - "description": "Funds on hold (not available for use)." - }, - "transferable": { - "type": "string", - "description": "Funds available to transfer." - } - }, - "required": [ - "currency", - "balance", - "available", - "holds", - "transferable" - ] - } - }, - "required": [ - "code", - "data" - ] - } - } - } - } - }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470148", - "x-abandon": "normal", - "x-domain": "Spot", - "x-api-channel": "Private", - "x-api-permission": "General", - "x-api-rate-limit-pool": "Management", - "x-sdk-service": "Account", - "x-sdk-sub-service": "Transfer", - "x-sdk-method-name": "getTransferQuotas", - "x-sdk-method-description": "This endpoint returns the transferable balance of a specified account.", - "x-api-rate-limit": 20, - "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"currency\\\":\\\"USDT\\\",\\\"balance\\\":\\\"10.5\\\",\\\"available\\\":\\\"10.5\\\",\\\"holds\\\":\\\"0\\\",\\\"transferable\\\":\\\"10.5\\\"}}", - "x-request-example": "{\\\"currency\\\": \\\"BTC\\\", \\\"type\\\": \\\"MAIN\\\", \\\"tag\\\": \\\"ETH-USDT\\\"}" - } - }, "/api/v1/base-fee": { "get": { "summary": "Get Basic Fee - Spot/Margin", diff --git a/spec/rest/entry/openapi-broker.json b/spec/rest/entry/openapi-broker.json index 706c42f2..d006d117 100644 --- a/spec/rest/entry/openapi-broker.json +++ b/spec/rest/entry/openapi-broker.json @@ -106,17 +106,17 @@ "x-request-example": "{\\\"begin\\\": \\\"20240610\\\", \\\"end\\\": \\\"20241010\\\", \\\"tradeType\\\": \\\"1\\\"}" } }, - "/api/v1/broker/nd/rebase/download": { + "/api/v1/broker/nd/info": { "get": { - "summary": "Get Broker Rebate", + "summary": "Get Broker Info", "deprecated": false, - "description": "This interface supports downloading Broker rebate orders", + "description": "This endpoint supports querying the basic information of the current Broker", "tags": [], "parameters": [ { "name": "begin", "in": "query", - "description": "Start time, for example: 20240610", + "description": "Start time, for example: 20230110", "required": true, "schema": { "type": "string" @@ -125,7 +125,7 @@ { "name": "end", "in": "query", - "description": "End time, for example: 20241010 (query data with a maximum interval of 6 months)\n", + "description": "End time, for example: 20230210 (query data with a maximum interval of 6 months)\n", "required": true, "schema": { "type": "string" @@ -171,13 +171,23 @@ "data": { "type": "object", "properties": { - "url": { - "type": "string", - "description": "Rebate order file (link is valid for 1 day)" + "accountSize": { + "type": "integer", + "description": "Number of sub-accounts created" + }, + "maxAccountSize": { + "type": "integer", + "description": "The maximum number of sub-accounts allowed to be created, null means no limit" + }, + "level": { + "type": "integer", + "description": "Broker level" } }, "required": [ - "url" + "accountSize", + "maxAccountSize", + "level" ] } }, @@ -190,7 +200,7 @@ } } }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470281", + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470282", "x-abandon": "normal", "x-domain": "Broker", "x-api-channel": "Private", @@ -198,64 +208,20 @@ "x-api-rate-limit-pool": "Broker", "x-sdk-service": "Broker", "x-sdk-sub-service": "NDBroker", - "x-sdk-method-name": "getRebase", - "x-sdk-method-description": "This interface supports downloading Broker rebate orders", - "x-api-rate-limit": 3, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"url\\\": \\\"https://kc-v2-promotion.s3.ap-northeast-1.amazonaws.com/broker/671aec522593f600019766d0_file.csv?X-Amz-Security-Token=IQo*********2cd90f14efb\\\"\\n }\\n}", - "x-request-example": "{\\\"begin\\\": \\\"20240610\\\", \\\"end\\\": \\\"20241010\\\", \\\"tradeType\\\": \\\"1\\\"}" + "x-sdk-method-name": "getBrokerInfo", + "x-sdk-method-description": "This endpoint supports querying the basic information of the current Broker", + "x-api-rate-limit": 2, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"accountSize\\\": 0,\\n \\\"maxAccountSize\\\": null,\\n \\\"level\\\": 0\\n }\\n}", + "x-request-example": "{\\\"begin\\\": \\\"20240510\\\", \\\"end\\\": \\\"20241010\\\", \\\"tradeType\\\": \\\"1\\\"}" } }, - "/api/v1/broker/nd/info": { - "get": { - "summary": "Get Broker Info", + "/api/v1/broker/nd/account": { + "post": { + "summary": "Add SubAccount", "deprecated": false, - "description": "This endpoint supports querying the basic information of the current Broker", + "description": "This endpoint supports Broker users to create sub-accounts", "tags": [], - "parameters": [ - { - "name": "begin", - "in": "query", - "description": "Start time, for example: 20230110", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "end", - "in": "query", - "description": "End time, for example: 20230210 (query data with a maximum interval of 6 months)\n", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "tradeType", - "in": "query", - "description": "Transaction type, 1: spot 2: futures", - "required": true, - "schema": { - "type": "string", - "enum": [ - "1", - "2" - ], - "x-api-enum": [ - { - "value": "1", - "name": "", - "description": "spot" - }, - { - "value": "2", - "name": "", - "description": "futures" - } - ] - } - } - ], + "parameters": [], "responses": { "200": { "description": "", @@ -270,22 +236,28 @@ "data": { "type": "object", "properties": { - "accountSize": { - "type": "integer", - "description": "Number of sub-accounts created" + "accountName": { + "type": "string", + "description": "Sub-Account name\n" }, - "maxAccountSize": { + "uid": { + "type": "string", + "description": "Sub-Account UID" + }, + "createdAt": { "type": "integer", - "description": "The maximum number of sub-accounts allowed to be created, null means no limit" + "description": "Creation time, unix timestamp (milliseconds)", + "format": "int64" }, "level": { "type": "integer", - "description": "Broker level" + "description": "Subaccount VIP level" } }, "required": [ - "accountSize", - "maxAccountSize", + "accountName", + "uid", + "createdAt", "level" ] } @@ -299,7 +271,7 @@ } } }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470282", + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470290", "x-abandon": "normal", "x-domain": "Broker", "x-api-channel": "Private", @@ -307,14 +279,31 @@ "x-api-rate-limit-pool": "Broker", "x-sdk-service": "Broker", "x-sdk-sub-service": "NDBroker", - "x-sdk-method-name": "getBrokerInfo", - "x-sdk-method-description": "This endpoint supports querying the basic information of the current Broker", - "x-api-rate-limit": 2, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"accountSize\\\": 0,\\n \\\"maxAccountSize\\\": null,\\n \\\"level\\\": 0\\n }\\n}", - "x-request-example": "{\\\"begin\\\": \\\"20240510\\\", \\\"end\\\": \\\"20241010\\\", \\\"tradeType\\\": \\\"1\\\"}" - } - }, - "/api/v1/broker/nd/account": { + "x-sdk-method-name": "addSubAccount", + "x-sdk-method-description": "This endpoint supports Broker users to create sub-accounts", + "x-api-rate-limit": 3, + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "accountName": { + "type": "string", + "description": "Sub Account Name, Note that this name is unique across the exchange. It is recommended to add a special identifier to prevent name duplication." + } + }, + "required": [ + "accountName" + ] + }, + "example": "{\n \"accountName\": \"Account1\"\n}" + } + } + }, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"accountName\\\": \\\"Account15\\\",\\n \\\"uid\\\": \\\"226383154\\\",\\n \\\"createdAt\\\": 1729819381908,\\n \\\"level\\\": 0\\n }\\n}", + "x-request-example": "{\\\"accountName\\\": \\\"Account1\\\"}" + }, "get": { "summary": "Get SubAccount", "deprecated": false, @@ -446,11 +435,13 @@ "x-api-rate-limit": 2, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"currentPage\\\": 1,\\n \\\"pageSize\\\": 20,\\n \\\"totalNum\\\": 1,\\n \\\"totalPage\\\": 1,\\n \\\"items\\\": [\\n {\\n \\\"accountName\\\": \\\"Account15\\\",\\n \\\"uid\\\": \\\"226383154\\\",\\n \\\"createdAt\\\": 1729819382000,\\n \\\"level\\\": 0\\n }\\n ]\\n }\\n}", "x-request-example": "{\\\"uid\\\": \\\"226383154\\\", \\\"currentPage\\\": 1, \\\"pageSize\\\": 20}" - }, + } + }, + "/api/v1/broker/nd/account/apikey": { "post": { - "summary": "Add SubAccount", + "summary": "Add SubAccount API", "deprecated": false, - "description": "This endpoint supports Broker users to create sub-accounts", + "description": "This interface supports the creation of Broker sub-account APIKEY", "tags": [], "parameters": [], "responses": { @@ -467,29 +458,55 @@ "data": { "type": "object", "properties": { - "accountName": { - "type": "string", - "description": "Sub-Account name\n" - }, "uid": { "type": "string", "description": "Sub-Account UID" }, + "label": { + "type": "string", + "description": "apikey remarks" + }, + "apiKey": { + "type": "string", + "description": "apiKey" + }, + "secretKey": { + "type": "string", + "description": "secretKey" + }, + "apiVersion": { + "type": "integer", + "description": "apiVersion" + }, + "permissions": { + "type": "array", + "items": { + "type": "string" + }, + "description": "[Permissions](https://www.kucoin.com/docs-new/doc-338144) group list" + }, + "ipWhitelist": { + "type": "array", + "items": { + "type": "string" + }, + "description": "IP whitelist list" + }, "createdAt": { "type": "integer", "description": "Creation time, unix timestamp (milliseconds)", "format": "int64" - }, - "level": { - "type": "integer", - "description": "Subaccount VIP level" } }, "required": [ - "accountName", "uid", - "createdAt", - "level" + "label", + "apiKey", + "secretKey", + "apiVersion", + "permissions", + "ipWhitelist", + "createdAt" ] } }, @@ -502,7 +519,7 @@ } } }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470290", + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470291", "x-abandon": "normal", "x-domain": "Broker", "x-api-channel": "Private", @@ -510,8 +527,8 @@ "x-api-rate-limit-pool": "Broker", "x-sdk-service": "Broker", "x-sdk-sub-service": "NDBroker", - "x-sdk-method-name": "addSubAccount", - "x-sdk-method-description": "This endpoint supports Broker users to create sub-accounts", + "x-sdk-method-name": "addSubAccountApi", + "x-sdk-method-description": "This interface supports the creation of Broker sub-account APIKEY", "x-api-rate-limit": 3, "requestBody": { "content": { @@ -519,49 +536,97 @@ "schema": { "type": "object", "properties": { - "accountName": { + "uid": { "type": "string", - "description": "Sub Account Name, Note that this name is unique across the exchange. It is recommended to add a special identifier to prevent name duplication." - } - }, - "required": [ - "accountName" - ] - }, - "example": "{\n \"accountName\": \"Account1\"\n}" - } - } - }, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"accountName\\\": \\\"Account15\\\",\\n \\\"uid\\\": \\\"226383154\\\",\\n \\\"createdAt\\\": 1729819381908,\\n \\\"level\\\": 0\\n }\\n}", - "x-request-example": "{\\\"accountName\\\": \\\"Account1\\\"}" - } - }, - "/api/v1/broker/nd/account/apikey": { - "get": { - "summary": "Get SubAccount API", - "deprecated": false, - "description": "This interface supports querying the Broker’s sub-account APIKEY", - "tags": [], - "parameters": [ - { - "name": "uid", - "in": "query", - "description": "Sub-account UID", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "apiKey", - "in": "query", - "description": "Sub-account apiKey\n", - "required": false, - "schema": { - "type": "string" - } - } - ], + "description": "Subaccount UID" + }, + "passphrase": { + "type": "string", + "description": "API passphrase" + }, + "ipWhitelist": { + "type": "array", + "items": { + "type": "string" + }, + "description": "IP whitelist list, supports up to 20 IPs" + }, + "permissions": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "general", + "spot", + "futures" + ], + "x-api-enum": [ + { + "value": "general", + "name": "General", + "description": "" + }, + { + "value": "spot", + "name": "Spot", + "description": "" + }, + { + "value": "futures", + "name": "Futures", + "description": "" + } + ] + }, + "description": "Permission group list(Only General、Spot、Futures permissions can be set, such as \"General, Trade\". )\n" + }, + "label": { + "type": "string", + "description": "apikey remarks (length 4~32)\n", + "minLength": 4, + "maxLength": 32 + } + }, + "required": [ + "uid", + "passphrase", + "ipWhitelist", + "permissions", + "label" + ] + }, + "example": "{\n \"uid\": \"226383154\",\n \"passphrase\": \"11223344\",\n \"ipWhitelist\": [\n \"127.0.0.1\",\"123.123.123.123\"\n ],\n \"permissions\": [\n \"general\",\"spot\"\n ],\n \"label\": \"This is remarks\"\n}" + } + } + }, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"uid\\\": \\\"226383154\\\",\\n \\\"label\\\": \\\"This is remarks\\\",\\n \\\"apiKey\\\": \\\"671afb36cee20f00015cfaf1\\\",\\n \\\"secretKey\\\": \\\"d694df2******5bae05b96\\\",\\n \\\"apiVersion\\\": 3,\\n \\\"permissions\\\": [\\n \\\"General\\\",\\n \\\"Spot\\\"\\n ],\\n \\\"ipWhitelist\\\": [\\n \\\"127.0.0.1\\\",\\n \\\"123.123.123.123\\\"\\n ],\\n \\\"createdAt\\\": 1729821494000\\n }\\n}", + "x-request-example": "{\\\"uid\\\": \\\"226383154\\\", \\\"passphrase\\\": \\\"11223344\\\", \\\"ipWhitelist\\\": [\\\"127.0.0.1\\\", \\\"123.123.123.123\\\"], \\\"permissions\\\": [\\\"general\\\", \\\"spot\\\"], \\\"label\\\": \\\"This is remarks\\\"}" + }, + "get": { + "summary": "Get SubAccount API", + "deprecated": false, + "description": "This interface supports querying the Broker’s sub-account APIKEY", + "tags": [], + "parameters": [ + { + "name": "uid", + "in": "query", + "description": "Sub-account UID", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "apiKey", + "in": "query", + "description": "Sub-account apiKey\n", + "required": false, + "schema": { + "type": "string" + } + } + ], "responses": { "200": { "description": "", @@ -733,11 +798,13 @@ "x-api-rate-limit": 3, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": true\\n}", "x-request-example": "{\\\"uid\\\": \\\"226383154\\\", \\\"apiKey\\\": \\\"671afb36cee20f00015cfaf1\\\"}" - }, + } + }, + "/api/v1/broker/nd/account/update-apikey": { "post": { - "summary": "Add SubAccount API", + "summary": "Modify SubAccount API", "deprecated": false, - "description": "This interface supports the creation of Broker sub-account APIKEY", + "description": "This interface supports modify the Broker’s sub-account APIKEY", "tags": [], "parameters": [], "responses": { @@ -766,10 +833,6 @@ "type": "string", "description": "apiKey" }, - "secretKey": { - "type": "string", - "description": "secretKey" - }, "apiVersion": { "type": "integer", "description": "apiVersion" @@ -798,7 +861,6 @@ "uid", "label", "apiKey", - "secretKey", "apiVersion", "permissions", "ipWhitelist", @@ -815,7 +877,7 @@ } } }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470291", + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470292", "x-abandon": "normal", "x-domain": "Broker", "x-api-channel": "Private", @@ -823,8 +885,8 @@ "x-api-rate-limit-pool": "Broker", "x-sdk-service": "Broker", "x-sdk-sub-service": "NDBroker", - "x-sdk-method-name": "addSubAccountApi", - "x-sdk-method-description": "This interface supports the creation of Broker sub-account APIKEY", + "x-sdk-method-name": "modifySubAccountApi", + "x-sdk-method-description": "This interface supports modify the Broker’s sub-account APIKEY", "x-api-rate-limit": 3, "requestBody": { "content": { @@ -836,10 +898,6 @@ "type": "string", "description": "Subaccount UID" }, - "passphrase": { - "type": "string", - "description": "API passphrase" - }, "ipWhitelist": { "type": "array", "items": { @@ -874,97 +932,42 @@ } ] }, - "description": "Permission group list(Only General、Spot、Futures permissions can be set, such as \"General, Trade\". )\n" + "description": "[Permissions](https://www.kucoin.com/docs-new/doc-338144) group list(Only General、Spot、Futures permissions can be set, such as \"General, Trade\". )\n" }, "label": { "type": "string", "description": "apikey remarks (length 4~32)\n", "minLength": 4, "maxLength": 32 + }, + "apiKey": { + "type": "string", + "description": "Subaccount apiKey" } }, "required": [ "uid", - "passphrase", + "apiKey", "ipWhitelist", "permissions", "label" ] }, - "example": "{\n \"uid\": \"226383154\",\n \"passphrase\": \"11223344\",\n \"ipWhitelist\": [\n \"127.0.0.1\",\"123.123.123.123\"\n ],\n \"permissions\": [\n \"general\",\"spot\"\n ],\n \"label\": \"This is remarks\"\n}" + "example": "{\n \"uid\": \"226383154\",\n \"apiKey\": \"671afb36cee20f00015cfaf1\",\n \"ipWhitelist\": [\n \"127.0.0.1\",\n \"123.123.123.123\"\n ],\n \"permissions\": [\n \"general\",\n \"spot\"\n ],\n \"label\": \"This is remarks\"\n}" } } }, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"uid\\\": \\\"226383154\\\",\\n \\\"label\\\": \\\"This is remarks\\\",\\n \\\"apiKey\\\": \\\"671afb36cee20f00015cfaf1\\\",\\n \\\"secretKey\\\": \\\"d694df2******5bae05b96\\\",\\n \\\"apiVersion\\\": 3,\\n \\\"permissions\\\": [\\n \\\"General\\\",\\n \\\"Spot\\\"\\n ],\\n \\\"ipWhitelist\\\": [\\n \\\"127.0.0.1\\\",\\n \\\"123.123.123.123\\\"\\n ],\\n \\\"createdAt\\\": 1729821494000\\n }\\n}", - "x-request-example": "{\\\"uid\\\": \\\"226383154\\\", \\\"passphrase\\\": \\\"11223344\\\", \\\"ipWhitelist\\\": [\\\"127.0.0.1\\\", \\\"123.123.123.123\\\"], \\\"permissions\\\": [\\\"general\\\", \\\"spot\\\"], \\\"label\\\": \\\"This is remarks\\\"}" + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"uid\\\": \\\"226383154\\\",\\n \\\"label\\\": \\\"This is remarks\\\",\\n \\\"apiKey\\\": \\\"671afb36cee20f00015cfaf1\\\",\\n \\\"apiVersion\\\": 3,\\n \\\"permissions\\\": [\\n \\\"General\\\",\\n \\\"Spot\\\"\\n ],\\n \\\"ipWhitelist\\\": [\\n \\\"127.**.1\\\",\\n \\\"123.**.123\\\"\\n ],\\n \\\"createdAt\\\": 1729821494000\\n }\\n}", + "x-request-example": "{\\\"uid\\\": \\\"226383154\\\", \\\"apiKey\\\": \\\"671afb36cee20f00015cfaf1\\\", \\\"ipWhitelist\\\": [\\\"127.0.0.1\\\", \\\"123.123.123.123\\\"], \\\"permissions\\\": [\\\"general\\\", \\\"spot\\\"], \\\"label\\\": \\\"This is remarks\\\"}" } }, - "/api/v1/asset/ndbroker/deposit/list": { - "get": { - "summary": "Get Deposit List", + "/api/v1/broker/nd/transfer": { + "post": { + "summary": "Transfer", "deprecated": false, - "description": "This endpoint can obtain the deposit records of each sub-account under the ND Broker.", + "description": "This endpoint supports fund transfer between Broker account and Broker sub-accounts. Please be aware that withdrawal from sub-account is not directly supported. Broker has to transfer funds from broker sub-account to broker account to initiate the withdrawals.", "tags": [], - "parameters": [ - { - "name": "currency", - "in": "query", - "description": "currency", - "required": false, - "schema": { - "type": "string" - } - }, - { - "name": "status", - "in": "query", - "description": "Status. Available value: PROCESSING, SUCCESS, FAILURE", - "required": false, - "schema": { - "type": "string" - } - }, - { - "name": "hash", - "in": "query", - "description": "hash", - "required": false, - "schema": { - "type": "string" - } - }, - { - "name": "startTimestamp", - "in": "query", - "description": "Start time (milisecond)", - "required": false, - "schema": { - "type": "integer", - "format": "int64" - } - }, - { - "name": "endTimestamp", - "in": "query", - "description": "End time (milisecond),Default sorting in descending order", - "required": false, - "schema": { - "type": "integer", - "format": "int64" - } - }, - { - "name": "limit", - "in": "query", - "description": "Maximum number of returned items, maximum 1000, default 1000", - "required": false, - "schema": { - "type": "integer", - "default": 1000, - "maximum": 1000 - } - } - ], + "parameters": [], "responses": { "200": { "description": "", @@ -973,128 +976,23 @@ "schema": { "type": "object", "properties": { - "success": { - "type": "boolean" - }, "code": { "type": "string" }, - "msg": { - "type": "string" - }, - "retry": { - "type": "boolean" - }, "data": { - "type": "array", - "items": { - "type": "object", - "properties": { - "uid": { - "type": "number", - "description": "deposit uid" - }, - "hash": { - "type": "string", - "description": "hash" - }, - "address": { - "type": "string", - "description": "Deposit address" - }, - "memo": { - "type": "string", - "description": "Address remark. If there’s no remark, it is empty. When you withdraw from other platforms to the KuCoin, you need to fill in memo(tag). If you do not fill memo (tag), your deposit may not be available, please be cautious." - }, - "amount": { - "type": "string", - "description": "Deposit amount" - }, - "fee": { - "type": "string", - "description": "Fees charged for deposit" - }, - "currency": { - "type": "string", - "description": "currency" - }, - "isInner": { - "type": "boolean", - "description": "Internal deposit or not" - }, - "walletTxId": { - "type": "string", - "description": "Wallet Txid" - }, - "status": { - "type": "string", - "enum": [ - "PROCESSING", - "SUCCESS", - "FAILURE" - ], - "description": "Status. Available value: PROCESSING, SUCCESS, FAILURE", - "x-api-enum": [ - { - "value": "PROCESSING", - "name": "", - "description": "" - }, - { - "value": "SUCCESS", - "name": "", - "description": "" - }, - { - "value": "FAILURE", - "name": "", - "description": "" - } - ] - }, - "remark": { - "type": "string", - "description": "remark" - }, - "chain": { - "type": "string", - "description": "chain name of currency" - }, - "createdAt": { - "type": "integer", - "format": "int64", - "description": "Creation time of the database record" - }, - "updatedAt": { - "type": "integer", - "format": "int64", - "description": "Update time of the database record" - } - }, - "required": [ - "uid", - "hash", - "address", - "memo", - "amount", - "fee", - "currency", - "isInner", - "walletTxId", - "status", - "remark", - "chain", - "createdAt", - "updatedAt" - ] - } + "type": "object", + "properties": { + "orderId": { + "type": "string" + } + }, + "required": [ + "orderId" + ] } }, "required": [ - "success", "code", - "msg", - "retry", "data" ] } @@ -1102,7 +1000,7 @@ } } }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470285", + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470293", "x-abandon": "normal", "x-domain": "Broker", "x-api-channel": "Private", @@ -1110,11 +1008,109 @@ "x-api-rate-limit-pool": "Broker", "x-sdk-service": "Broker", "x-sdk-sub-service": "NDBroker", - "x-sdk-method-name": "getDepositList", - "x-sdk-method-description": "This endpoint can obtain the deposit records of each sub-account under the ND Broker.", - "x-api-rate-limit": 10, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": [\\n {\\n \\\"uid\\\": 165111215,\\n \\\"hash\\\": \\\"6724e363a492800007ec602b\\\",\\n \\\"address\\\": \\\"xxxxxxx@gmail.com\\\",\\n \\\"memo\\\": \\\"\\\",\\n \\\"amount\\\": \\\"3.0\\\",\\n \\\"fee\\\": \\\"0.0\\\",\\n \\\"currency\\\": \\\"USDT\\\",\\n \\\"isInner\\\": true,\\n \\\"walletTxId\\\": \\\"bbbbbbbbb\\\",\\n \\\"status\\\": \\\"SUCCESS\\\",\\n \\\"chain\\\": \\\"\\\",\\n \\\"remark\\\": \\\"\\\",\\n \\\"createdAt\\\": 1730470760000,\\n \\\"updatedAt\\\": 1730470760000\\n }\\n ]\\n}", - "x-request-example": "{\\\"currency\\\": \\\"USDT\\\", \\\"status\\\": \\\"SUCCESS\\\", \\\"hash\\\": \\\"example_string_default_value\\\", \\\"startTimestamp\\\": 123456, \\\"endTimestamp\\\": 123456, \\\"limit\\\": 100}" + "x-sdk-method-name": "transfer", + "x-sdk-method-description": "This endpoint supports fund transfer between Broker account and Broker sub-accounts. Please be aware that withdrawal from sub-account is not directly supported. Broker has to transfer funds from broker sub-account to broker account to initiate the withdrawals.", + "x-api-rate-limit": 1, + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "currency": { + "type": "string", + "description": "Currency" + }, + "amount": { + "type": "string", + "description": "Transfer Amount (must be a positive integer in the currency's precision)" + }, + "direction": { + "type": "string", + "description": "Fund transfer direction: OUT (Broker account is transferred to Broker sub-account), IN (Broker sub-account is transferred to Broker account)", + "enum": [ + "OUT", + "IN" + ], + "x-api-enum": [ + { + "value": "OUT", + "name": "", + "description": "" + }, + { + "value": "IN", + "name": "", + "description": "" + } + ] + }, + "accountType": { + "type": "string", + "description": "Broker account types: MAIN (Funding account), TRADE (Spot trading account)", + "enum": [ + "MAIN", + "TRADE" + ], + "x-api-enum": [ + { + "value": "MAIN", + "name": "", + "description": "" + }, + { + "value": "TRADE", + "name": "", + "description": "" + } + ] + }, + "specialUid": { + "type": "string", + "description": "Broker subaccount uid, must be the Broker subaccount created by the current Broker user." + }, + "specialAccountType": { + "type": "string", + "description": "Broker sub-account types: MAIN (Funding account), TRADE (Spot trading account)", + "enum": [ + "MAIN", + "TRADE" + ], + "x-api-enum": [ + { + "value": "MAIN", + "name": "", + "description": "" + }, + { + "value": "TRADE", + "name": "", + "description": "" + } + ] + }, + "clientOid": { + "type": "string", + "description": "Client Order Id, The unique identifier created by the client. It is recommended to use UUID. The maximum length is 128 bits.", + "maxLength": 128 + } + }, + "required": [ + "currency", + "amount", + "direction", + "accountType", + "specialUid", + "specialAccountType", + "clientOid" + ] + }, + "example": "{\n \"currency\": \"USDT\",\n \"amount\": \"1\",\n \"clientOid\": \"e6c24d23-6bc2-401b-bf9e-55e2daddfbc1\",\n \"direction\": \"OUT\",\n \"accountType\": \"MAIN\",\n \"specialUid\": \"226383154\",\n \"specialAccountType\": \"MAIN\"\n}" + } + } + }, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"orderId\\\": \\\"671b4600c1e3dd000726866d\\\"\\n }\\n}", + "x-request-example": "{\\\"currency\\\": \\\"USDT\\\", \\\"amount\\\": \\\"1\\\", \\\"clientOid\\\": \\\"e6c24d23-6bc2-401b-bf9e-55e2daddfbc1\\\", \\\"direction\\\": \\\"OUT\\\", \\\"accountType\\\": \\\"MAIN\\\", \\\"specialUid\\\": \\\"226383154\\\", \\\"specialAccountType\\\": \\\"MAIN\\\"}" } }, "/api/v3/broker/nd/transfer/detail": { @@ -1338,21 +1334,70 @@ "x-request-example": "{\\\"orderId\\\": \\\"671b4600c1e3dd000726866d\\\"}" } }, - "/api/v3/broker/nd/withdraw/detail": { + "/api/v1/asset/ndbroker/deposit/list": { "get": { - "summary": "Get Withdraw Detail", + "summary": "Get Deposit List", "deprecated": false, - "description": "This endpoint supports querying the withdrawal records of sub-accounts created by a Broker (excluding main account of nd broker).", + "description": "This endpoint can obtain the deposit records of each sub-account under the ND Broker.", "tags": [], "parameters": [ { - "name": "withdrawalId", + "name": "currency", "in": "query", - "description": "Withdrawal ID", - "required": true, + "description": "currency", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "status", + "in": "query", + "description": "Status. Available value: PROCESSING, SUCCESS, FAILURE", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "hash", + "in": "query", + "description": "hash", + "required": false, "schema": { "type": "string" } + }, + { + "name": "startTimestamp", + "in": "query", + "description": "Start time (milisecond)", + "required": false, + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "endTimestamp", + "in": "query", + "description": "End time (milisecond),Default sorting in descending order", + "required": false, + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "limit", + "in": "query", + "description": "Maximum number of returned items, maximum 1000, default 1000", + "required": false, + "schema": { + "type": "integer", + "default": 1000, + "maximum": 1000 + } } ], "responses": { @@ -1363,133 +1408,136 @@ "schema": { "type": "object", "properties": { + "success": { + "type": "boolean" + }, + "code": { + "type": "string" + }, + "msg": { + "type": "string" + }, + "retry": { + "type": "boolean" + }, "data": { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "Withdrawal ID" - }, - "chain": { - "type": "string", - "description": "chain id of currency" - }, - "walletTxId": { - "type": "string", - "description": "Wallet Transaction ID" - }, - "uid": { - "type": "integer", - "description": "UID" - }, - "updatedAt": { - "type": "integer", - "description": "Update Time (milliseconds)", - "format": "int64" - }, - "amount": { - "type": "string", - "description": "Amount" - }, - "memo": { - "type": "string", - "description": "Memo" - }, - "fee": { - "type": "string", - "description": "Fee" - }, - "address": { - "type": "string", - "description": "Address" - }, - "remark": { - "type": "string", - "description": "Remark" - }, - "isInner": { - "type": "boolean", - "description": "Is Internal (true or false)" - }, - "currency": { - "type": "string", - "description": "Currency" - }, - "status": { - "type": "string", - "description": "Status (PROCESSING, WALLET_PROCESSING, REVIEW, SUCCESS, FAILURE)", - "enum": [ - "PROCESSING", - "WALLET_PROCESSING", - "REVIEW", - "SUCCESS", - "FAILURE" - ], - "x-api-enum": [ - { - "value": "PROCESSING", - "name": "", - "description": "" - }, - { - "value": "WALLET_PROCESSING", - "name": "", - "description": "" - }, - { - "value": "REVIEW", - "name": "", - "description": "" - }, - { - "value": "SUCCESS", - "name": "", - "description": "" - }, - { - "value": "FAILURE", - "name": "", - "description": "" - } - ] + "type": "array", + "items": { + "type": "object", + "properties": { + "uid": { + "type": "number", + "description": "deposit uid" + }, + "hash": { + "type": "string", + "description": "hash" + }, + "address": { + "type": "string", + "description": "Deposit address" + }, + "memo": { + "type": "string", + "description": "Address remark. If there’s no remark, it is empty. When you withdraw from other platforms to the KuCoin, you need to fill in memo(tag). If you do not fill memo (tag), your deposit may not be available, please be cautious." + }, + "amount": { + "type": "string", + "description": "Deposit amount" + }, + "fee": { + "type": "string", + "description": "Fees charged for deposit" + }, + "currency": { + "type": "string", + "description": "currency" + }, + "isInner": { + "type": "boolean", + "description": "Internal deposit or not" + }, + "walletTxId": { + "type": "string", + "description": "Wallet Txid" + }, + "status": { + "type": "string", + "enum": [ + "PROCESSING", + "SUCCESS", + "FAILURE" + ], + "description": "Status. Available value: PROCESSING, SUCCESS, FAILURE", + "x-api-enum": [ + { + "value": "PROCESSING", + "name": "", + "description": "" + }, + { + "value": "SUCCESS", + "name": "", + "description": "" + }, + { + "value": "FAILURE", + "name": "", + "description": "" + } + ] + }, + "remark": { + "type": "string", + "description": "remark" + }, + "chain": { + "type": "string", + "description": "chain name of currency" + }, + "createdAt": { + "type": "integer", + "format": "int64", + "description": "Creation time of the database record" + }, + "updatedAt": { + "type": "integer", + "format": "int64", + "description": "Update time of the database record" + } }, - "createdAt": { - "type": "integer", - "description": "Creation Time (milliseconds)", - "format": "int64" - } - }, - "required": [ - "id", - "chain", - "walletTxId", - "uid", - "updatedAt", - "amount", - "memo", - "fee", - "address", - "remark", - "isInner", - "currency", - "status", - "createdAt" - ] - }, - "code": { - "type": "string" + "required": [ + "uid", + "hash", + "address", + "memo", + "amount", + "fee", + "currency", + "isInner", + "walletTxId", + "status", + "remark", + "chain", + "createdAt", + "updatedAt" + ] + } } }, "required": [ - "data", - "code" + "success", + "code", + "msg", + "retry", + "data" ] } } } } }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470287", + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470285", "x-abandon": "normal", "x-domain": "Broker", "x-api-channel": "Private", @@ -1497,11 +1545,11 @@ "x-api-rate-limit-pool": "Broker", "x-sdk-service": "Broker", "x-sdk-sub-service": "NDBroker", - "x-sdk-method-name": "getWithdrawDetail", - "x-sdk-method-description": "This endpoint supports querying the withdrawal records of sub-accounts created by a Broker (excluding main account of nd broker).", - "x-api-rate-limit": 1, - "x-response-example": "{\\n \\\"data\\\": {\\n \\\"id\\\": \\\"66617a2***3c9a\\\",\\n \\\"chain\\\": \\\"ton\\\",\\n \\\"walletTxId\\\": \\\"AJ***eRI=\\\",\\n \\\"uid\\\": 157267400,\\n \\\"amount\\\": \\\"1.00000000\\\",\\n \\\"memo\\\": \\\"7025734\\\",\\n \\\"fee\\\": \\\"0.00000000\\\",\\n \\\"address\\\": \\\"EQDn***dKbGzr\\\",\\n \\\"remark\\\": \\\"\\\",\\n \\\"isInner\\\": false,\\n \\\"currency\\\": \\\"USDT\\\",\\n \\\"status\\\": \\\"SUCCESS\\\",\\n \\\"createdAt\\\": 1717664288000,\\n \\\"updatedAt\\\": 1717664375000\\n },\\n \\\"code\\\": \\\"200000\\\"\\n}", - "x-request-example": "{\\\"withdrawalId\\\": \\\"66617a2***3c9a\\\"}" + "x-sdk-method-name": "getDepositList", + "x-sdk-method-description": "This endpoint can obtain the deposit records of each sub-account under the ND Broker.", + "x-api-rate-limit": 10, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": [\\n {\\n \\\"uid\\\": 165111215,\\n \\\"hash\\\": \\\"6724e363a492800007ec602b\\\",\\n \\\"address\\\": \\\"xxxxxxx@gmail.com\\\",\\n \\\"memo\\\": \\\"\\\",\\n \\\"amount\\\": \\\"3.0\\\",\\n \\\"fee\\\": \\\"0.0\\\",\\n \\\"currency\\\": \\\"USDT\\\",\\n \\\"isInner\\\": true,\\n \\\"walletTxId\\\": \\\"bbbbbbbbb\\\",\\n \\\"status\\\": \\\"SUCCESS\\\",\\n \\\"chain\\\": \\\"\\\",\\n \\\"remark\\\": \\\"\\\",\\n \\\"createdAt\\\": 1730470760000,\\n \\\"updatedAt\\\": 1730470760000\\n }\\n ]\\n}", + "x-request-example": "{\\\"currency\\\": \\\"USDT\\\", \\\"status\\\": \\\"SUCCESS\\\", \\\"hash\\\": \\\"example_string_default_value\\\", \\\"startTimestamp\\\": 123456, \\\"endTimestamp\\\": 123456, \\\"limit\\\": 100}" } }, "/api/v3/broker/nd/deposit/detail": { @@ -1667,13 +1715,23 @@ "x-request-example": "{\\\"currency\\\": \\\"USDT\\\", \\\"hash\\\": \\\"30bb0e0b***4156c5188\\\"}" } }, - "/api/v1/broker/nd/account/update-apikey": { - "post": { - "summary": "Modify SubAccount API", + "/api/v3/broker/nd/withdraw/detail": { + "get": { + "summary": "Get Withdraw Detail", "deprecated": false, - "description": "This interface supports modify the Broker’s sub-account APIKEY", + "description": "This endpoint supports querying the withdrawal records of sub-accounts created by a Broker (excluding main account of nd broker).", "tags": [], - "parameters": [], + "parameters": [ + { + "name": "withdrawalId", + "in": "query", + "description": "Withdrawal ID", + "required": true, + "schema": { + "type": "string" + } + } + ], "responses": { "200": { "description": "", @@ -1682,69 +1740,133 @@ "schema": { "type": "object", "properties": { - "code": { - "type": "string" - }, "data": { "type": "object", "properties": { - "uid": { + "id": { "type": "string", - "description": "Sub-Account UID" + "description": "Withdrawal ID" }, - "label": { + "chain": { "type": "string", - "description": "apikey remarks" + "description": "chain id of currency" }, - "apiKey": { + "walletTxId": { "type": "string", - "description": "apiKey" + "description": "Wallet Transaction ID" }, - "apiVersion": { + "uid": { "type": "integer", - "description": "apiVersion" + "description": "UID" }, - "permissions": { - "type": "array", - "items": { - "type": "string" - }, - "description": "[Permissions](https://www.kucoin.com/docs-new/doc-338144) group list" + "updatedAt": { + "type": "integer", + "description": "Update Time (milliseconds)", + "format": "int64" }, - "ipWhitelist": { - "type": "array", - "items": { - "type": "string" - }, - "description": "IP whitelist list" + "amount": { + "type": "string", + "description": "Amount" + }, + "memo": { + "type": "string", + "description": "Memo" + }, + "fee": { + "type": "string", + "description": "Fee" + }, + "address": { + "type": "string", + "description": "Address" + }, + "remark": { + "type": "string", + "description": "Remark" + }, + "isInner": { + "type": "boolean", + "description": "Is Internal (true or false)" + }, + "currency": { + "type": "string", + "description": "Currency" + }, + "status": { + "type": "string", + "description": "Status (PROCESSING, WALLET_PROCESSING, REVIEW, SUCCESS, FAILURE)", + "enum": [ + "PROCESSING", + "WALLET_PROCESSING", + "REVIEW", + "SUCCESS", + "FAILURE" + ], + "x-api-enum": [ + { + "value": "PROCESSING", + "name": "", + "description": "" + }, + { + "value": "WALLET_PROCESSING", + "name": "", + "description": "" + }, + { + "value": "REVIEW", + "name": "", + "description": "" + }, + { + "value": "SUCCESS", + "name": "", + "description": "" + }, + { + "value": "FAILURE", + "name": "", + "description": "" + } + ] }, "createdAt": { "type": "integer", - "description": "Creation time, unix timestamp (milliseconds)", + "description": "Creation Time (milliseconds)", "format": "int64" } }, "required": [ + "id", + "chain", + "walletTxId", "uid", - "label", - "apiKey", - "apiVersion", - "permissions", - "ipWhitelist", + "updatedAt", + "amount", + "memo", + "fee", + "address", + "remark", + "isInner", + "currency", + "status", "createdAt" ] + }, + "code": { + "type": "string" } }, "required": [ - "code", - "data" + "data", + "code" ] } } } } }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470292", + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470287", "x-abandon": "normal", "x-domain": "Broker", "x-api-channel": "Private", @@ -1752,89 +1874,64 @@ "x-api-rate-limit-pool": "Broker", "x-sdk-service": "Broker", "x-sdk-sub-service": "NDBroker", - "x-sdk-method-name": "modifySubAccountApi", - "x-sdk-method-description": "This interface supports modify the Broker’s sub-account APIKEY", - "x-api-rate-limit": 3, - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "uid": { - "type": "string", - "description": "Subaccount UID" - }, - "ipWhitelist": { - "type": "array", - "items": { - "type": "string" - }, - "description": "IP whitelist list, supports up to 20 IPs" - }, - "permissions": { - "type": "array", - "items": { - "type": "string", - "enum": [ - "general", - "spot", - "futures" - ], - "x-api-enum": [ - { - "value": "general", - "name": "General", - "description": "" - }, - { - "value": "spot", - "name": "Spot", - "description": "" - }, - { - "value": "futures", - "name": "Futures", - "description": "" - } - ] - }, - "description": "[Permissions](https://www.kucoin.com/docs-new/doc-338144) group list(Only General、Spot、Futures permissions can be set, such as \"General, Trade\". )\n" - }, - "label": { - "type": "string", - "description": "apikey remarks (length 4~32)\n", - "minLength": 4, - "maxLength": 32 - }, - "apiKey": { - "type": "string", - "description": "Subaccount apiKey" - } - }, - "required": [ - "uid", - "apiKey", - "ipWhitelist", - "permissions", - "label" - ] - }, - "example": "{\n \"uid\": \"226383154\",\n \"apiKey\": \"671afb36cee20f00015cfaf1\",\n \"ipWhitelist\": [\n \"127.0.0.1\",\n \"123.123.123.123\"\n ],\n \"permissions\": [\n \"general\",\n \"spot\"\n ],\n \"label\": \"This is remarks\"\n}" - } - } - }, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"uid\\\": \\\"226383154\\\",\\n \\\"label\\\": \\\"This is remarks\\\",\\n \\\"apiKey\\\": \\\"671afb36cee20f00015cfaf1\\\",\\n \\\"apiVersion\\\": 3,\\n \\\"permissions\\\": [\\n \\\"General\\\",\\n \\\"Spot\\\"\\n ],\\n \\\"ipWhitelist\\\": [\\n \\\"127.**.1\\\",\\n \\\"123.**.123\\\"\\n ],\\n \\\"createdAt\\\": 1729821494000\\n }\\n}", - "x-request-example": "{\\\"uid\\\": \\\"226383154\\\", \\\"apiKey\\\": \\\"671afb36cee20f00015cfaf1\\\", \\\"ipWhitelist\\\": [\\\"127.0.0.1\\\", \\\"123.123.123.123\\\"], \\\"permissions\\\": [\\\"general\\\", \\\"spot\\\"], \\\"label\\\": \\\"This is remarks\\\"}" + "x-sdk-method-name": "getWithdrawDetail", + "x-sdk-method-description": "This endpoint supports querying the withdrawal records of sub-accounts created by a Broker (excluding main account of nd broker).", + "x-api-rate-limit": 1, + "x-response-example": "{\\n \\\"data\\\": {\\n \\\"id\\\": \\\"66617a2***3c9a\\\",\\n \\\"chain\\\": \\\"ton\\\",\\n \\\"walletTxId\\\": \\\"AJ***eRI=\\\",\\n \\\"uid\\\": 157267400,\\n \\\"amount\\\": \\\"1.00000000\\\",\\n \\\"memo\\\": \\\"7025734\\\",\\n \\\"fee\\\": \\\"0.00000000\\\",\\n \\\"address\\\": \\\"EQDn***dKbGzr\\\",\\n \\\"remark\\\": \\\"\\\",\\n \\\"isInner\\\": false,\\n \\\"currency\\\": \\\"USDT\\\",\\n \\\"status\\\": \\\"SUCCESS\\\",\\n \\\"createdAt\\\": 1717664288000,\\n \\\"updatedAt\\\": 1717664375000\\n },\\n \\\"code\\\": \\\"200000\\\"\\n}", + "x-request-example": "{\\\"withdrawalId\\\": \\\"66617a2***3c9a\\\"}" } }, - "/api/v1/broker/nd/transfer": { - "post": { - "summary": "Transfer", + "/api/v1/broker/nd/rebase/download": { + "get": { + "summary": "Get Broker Rebate", "deprecated": false, - "description": "This endpoint supports fund transfer between Broker account and Broker sub-accounts. Please be aware that withdrawal from sub-account is not directly supported. Broker has to transfer funds from broker sub-account to broker account to initiate the withdrawals.", + "description": "This interface supports downloading Broker rebate orders", "tags": [], - "parameters": [], + "parameters": [ + { + "name": "begin", + "in": "query", + "description": "Start time, for example: 20240610", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "end", + "in": "query", + "description": "End time, for example: 20241010 (query data with a maximum interval of 6 months)\n", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "tradeType", + "in": "query", + "description": "Transaction type, 1: spot 2: futures", + "required": true, + "schema": { + "type": "string", + "enum": [ + "1", + "2" + ], + "x-api-enum": [ + { + "value": "1", + "name": "", + "description": "spot" + }, + { + "value": "2", + "name": "", + "description": "futures" + } + ] + } + } + ], "responses": { "200": { "description": "", @@ -1849,12 +1946,13 @@ "data": { "type": "object", "properties": { - "orderId": { - "type": "string" + "url": { + "type": "string", + "description": "Rebate order file (link is valid for 1 day)" } }, "required": [ - "orderId" + "url" ] } }, @@ -1867,7 +1965,7 @@ } } }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470293", + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470281", "x-abandon": "normal", "x-domain": "Broker", "x-api-channel": "Private", @@ -1875,109 +1973,11 @@ "x-api-rate-limit-pool": "Broker", "x-sdk-service": "Broker", "x-sdk-sub-service": "NDBroker", - "x-sdk-method-name": "transfer", - "x-sdk-method-description": "This endpoint supports fund transfer between Broker account and Broker sub-accounts. Please be aware that withdrawal from sub-account is not directly supported. Broker has to transfer funds from broker sub-account to broker account to initiate the withdrawals.", - "x-api-rate-limit": 1, - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "currency": { - "type": "string", - "description": "Currency" - }, - "amount": { - "type": "string", - "description": "Transfer Amount (must be a positive integer in the currency's precision)" - }, - "direction": { - "type": "string", - "description": "Fund transfer direction: OUT (Broker account is transferred to Broker sub-account), IN (Broker sub-account is transferred to Broker account)", - "enum": [ - "OUT", - "IN" - ], - "x-api-enum": [ - { - "value": "OUT", - "name": "", - "description": "" - }, - { - "value": "IN", - "name": "", - "description": "" - } - ] - }, - "accountType": { - "type": "string", - "description": "Broker account types: MAIN (Funding account), TRADE (Spot trading account)", - "enum": [ - "MAIN", - "TRADE" - ], - "x-api-enum": [ - { - "value": "MAIN", - "name": "", - "description": "" - }, - { - "value": "TRADE", - "name": "", - "description": "" - } - ] - }, - "specialUid": { - "type": "string", - "description": "Broker subaccount uid, must be the Broker subaccount created by the current Broker user." - }, - "specialAccountType": { - "type": "string", - "description": "Broker sub-account types: MAIN (Funding account), TRADE (Spot trading account)", - "enum": [ - "MAIN", - "TRADE" - ], - "x-api-enum": [ - { - "value": "MAIN", - "name": "", - "description": "" - }, - { - "value": "TRADE", - "name": "", - "description": "" - } - ] - }, - "clientOid": { - "type": "string", - "description": "Client Order Id, The unique identifier created by the client. It is recommended to use UUID. The maximum length is 128 bits.", - "maxLength": 128 - } - }, - "required": [ - "currency", - "amount", - "direction", - "accountType", - "specialUid", - "specialAccountType", - "clientOid" - ] - }, - "example": "{\n \"currency\": \"USDT\",\n \"amount\": \"1\",\n \"clientOid\": \"e6c24d23-6bc2-401b-bf9e-55e2daddfbc1\",\n \"direction\": \"OUT\",\n \"accountType\": \"MAIN\",\n \"specialUid\": \"226383154\",\n \"specialAccountType\": \"MAIN\"\n}" - } - } - }, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"orderId\\\": \\\"671b4600c1e3dd000726866d\\\"\\n }\\n}", - "x-request-example": "{\\\"currency\\\": \\\"USDT\\\", \\\"amount\\\": \\\"1\\\", \\\"clientOid\\\": \\\"e6c24d23-6bc2-401b-bf9e-55e2daddfbc1\\\", \\\"direction\\\": \\\"OUT\\\", \\\"accountType\\\": \\\"MAIN\\\", \\\"specialUid\\\": \\\"226383154\\\", \\\"specialAccountType\\\": \\\"MAIN\\\"}" + "x-sdk-method-name": "getRebase", + "x-sdk-method-description": "This interface supports downloading Broker rebate orders", + "x-api-rate-limit": 3, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"url\\\": \\\"https://kc-v2-promotion.s3.ap-northeast-1.amazonaws.com/broker/671aec522593f600019766d0_file.csv?X-Amz-Security-Token=IQo*********2cd90f14efb\\\"\\n }\\n}", + "x-request-example": "{\\\"begin\\\": \\\"20240610\\\", \\\"end\\\": \\\"20241010\\\", \\\"tradeType\\\": \\\"1\\\"}" } } }, diff --git a/spec/rest/entry/openapi-futures.json b/spec/rest/entry/openapi-futures.json index bc486a48..44f65715 100644 --- a/spec/rest/entry/openapi-futures.json +++ b/spec/rest/entry/openapi-futures.json @@ -7,478 +7,23 @@ }, "tags": [], "paths": { - "/api/v1/contracts/active": { + "/api/v1/contracts/{symbol}": { "get": { - "summary": "Get All Symbols", + "summary": "Get Symbol", "deprecated": false, - "description": "Get detailed information of all contracts that can be traded. This API will return a list of tradable contracts, including some key parameters of the contract such as the symbol name, tick size, mark price,etc.", + "description": "Get information of specified contracts that can be traded. This API will return a list of tradable contracts, including some key parameters of the contract such as the symbol name, tick size, mark price,etc.", "tags": [], - "parameters": [], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "type": "string", - "description": "200000 is for success, other is error" - }, - "data": { - "type": "array", - "items": { - "type": "object", - "properties": { - "symbol": { - "type": "string", - "description": "Symbol", - "example": [ - "XBTUSDTM", - "XBTUSDCM", - "XBTUSDM" - ] - }, - "rootSymbol": { - "type": "string", - "description": "Contract group", - "example": [ - "USDT", - "USDC", - "XBT" - ] - }, - "type": { - "type": "string", - "description": "Type of the contract", - "enum": [ - "FFWCSX", - "FFICSX" - ], - "x-api-enum": [ - { - "value": "FFWCSX", - "name": "FFWCSX", - "description": "Standardized swap contracts standard financial futures on swap, expiration swap funding rate" - }, - { - "value": "FFICSX", - "name": "FFICSX", - "description": "Futures Contract" - } - ] - }, - "firstOpenDate": { - "type": "integer", - "description": "First Open Date(millisecond)", - "format": "int64" - }, - "expireDate": { - "type": "integer", - "description": "Expiration date(millisecond). Null means it will never expire", - "format": "int64" - }, - "settleDate": { - "type": "integer", - "description": "Settlement date(millisecond). Null indicates that automatic settlement is not supported", - "format": "int64" - }, - "baseCurrency": { - "type": "string", - "description": "Base currency" - }, - "quoteCurrency": { - "type": "string", - "description": "Quote currency" - }, - "settleCurrency": { - "type": "string", - "description": "Currency used to clear and settle the trades" - }, - "maxOrderQty": { - "type": "integer", - "description": "Maximum order quantity" - }, - "maxPrice": { - "type": "number", - "description": "Maximum order price" - }, - "lotSize": { - "type": "integer", - "description": "Minimum lot size" - }, - "tickSize": { - "type": "number", - "description": "Minimum price changes" - }, - "indexPriceTickSize": { - "type": "number", - "description": "Index price of tick size" - }, - "multiplier": { - "type": "number", - "description": "The basic unit of the contract API is lots. For the number of coins in each lot, please refer to the param multiplier. For example, for XBTUSDTM, multiplier=0.001, which corresponds to the value of each XBTUSDTM contract being 0.001 BTC. There is also a special case. All coin-swap contracts, such as each XBTUSDM contract, correspond to 1 USD." - }, - "initialMargin": { - "type": "number", - "description": "Initial margin requirement" - }, - "maintainMargin": { - "type": "number", - "description": "Maintenance margin requirement" - }, - "maxRiskLimit": { - "type": "integer", - "description": "Maximum risk limit (unit: XBT)" - }, - "minRiskLimit": { - "type": "integer", - "description": "Minimum risk limit (unit: XBT)" - }, - "riskStep": { - "type": "integer", - "description": "Risk limit increment value (unit: XBT)" - }, - "makerFeeRate": { - "type": "number", - "description": "Maker fee rate" - }, - "takerFeeRate": { - "type": "number", - "description": "Taker fee rate" - }, - "takerFixFee": { - "type": "number", - "description": "Deprecated param" - }, - "makerFixFee": { - "type": "number", - "description": "Deprecated param" - }, - "settlementFee": { - "type": "number", - "description": "Settlement fee" - }, - "isDeleverage": { - "type": "boolean", - "description": "Enabled ADL or not" - }, - "isQuanto": { - "type": "boolean", - "description": "Deprecated param" - }, - "isInverse": { - "type": "boolean", - "description": "Whether it is a reverse contract" - }, - "markMethod": { - "type": "string", - "description": "Marking method", - "enum": [ - "FairPrice" - ], - "x-api-enum": [ - { - "value": "FairPrice", - "name": "FairPrice", - "description": "Fair Price" - } - ] - }, - "fairMethod": { - "type": "string", - "description": "Fair price marking method, The Futures contract is null", - "enum": [ - "FundingRate" - ], - "x-api-enum": [ - { - "value": "FundingRate", - "name": "FundingRate", - "description": "FundingRate" - } - ] - }, - "fundingBaseSymbol": { - "type": "string", - "description": "Ticker symbol of the based currency" - }, - "fundingQuoteSymbol": { - "type": "string", - "description": "Ticker symbol of the quote currency" - }, - "fundingRateSymbol": { - "type": "string", - "description": "Funding rate symbol" - }, - "indexSymbol": { - "type": "string", - "description": "Index symbol" - }, - "settlementSymbol": { - "type": "string", - "description": "Settlement Symbol" - }, - "status": { - "type": "string", - "description": "Contract status", - "enum": [ - "Init", - "Open", - "BeingSettled", - "Settled", - "Paused", - "Closed", - "CancelOnly" - ], - "x-api-enum": [ - { - "value": "Init", - "name": "Init", - "description": "Initial" - }, - { - "value": "Open", - "name": "Open", - "description": "Online" - }, - { - "value": "BeingSettled", - "name": "BeingSettled", - "description": "Setting" - }, - { - "value": "Settled", - "name": "Settled", - "description": "Settled" - }, - { - "value": "Paused", - "name": "Paused", - "description": "Suspended" - }, - { - "value": "Closed", - "name": "Closed", - "description": "Offline" - }, - { - "value": "CancelOnly", - "name": "CancelOnly", - "description": "Orders can only be canceled" - } - ] - }, - "fundingFeeRate": { - "type": "number", - "description": "Funding fee rate" - }, - "predictedFundingFeeRate": { - "type": "number", - "description": "Predicted funding fee rate" - }, - "fundingRateGranularity": { - "type": "integer", - "description": "Funding interval(millisecond)" - }, - "openInterest": { - "type": "string", - "description": "Open interest" - }, - "turnoverOf24h": { - "type": "number", - "description": "24-hour turnover" - }, - "volumeOf24h": { - "type": "number", - "description": "24-hour volume" - }, - "markPrice": { - "type": "number", - "description": "Mark price" - }, - "indexPrice": { - "type": "number", - "description": "Index price" - }, - "lastTradePrice": { - "type": "number", - "description": "Last trade price" - }, - "nextFundingRateTime": { - "type": "integer", - "description": "Next funding rate time(millisecond)" - }, - "maxLeverage": { - "type": "integer", - "description": "Maximum leverage" - }, - "sourceExchanges": { - "type": "array", - "items": { - "type": "string" - }, - "description": "The contract index price source exchange" - }, - "premiumsSymbol1M": { - "type": "string", - "description": "Premium index symbol(1 minute)" - }, - "premiumsSymbol8H": { - "type": "string", - "description": "Premium index symbol(8 hours)" - }, - "fundingBaseSymbol1M": { - "type": "string", - "description": "Base currency interest rate symbol(1 minute)" - }, - "fundingQuoteSymbol1M": { - "type": "string", - "description": "Quote currency interest rate symbol(1 minute)" - }, - "lowPrice": { - "type": "number", - "description": "24-hour lowest price" - }, - "highPrice": { - "type": "number", - "description": "24-hour highest price" - }, - "priceChgPct": { - "type": "number", - "description": "24-hour price change% " - }, - "priceChg": { - "type": "number", - "description": "24-hour price change" - }, - "k": { - "type": "number" - }, - "m": { - "type": "number" - }, - "f": { - "type": "number" - }, - "mmrLimit": { - "type": "number" - }, - "mmrLevConstant": { - "type": "number" - }, - "supportCross": { - "type": "boolean", - "description": "Whether support Cross Margin" - } - }, - "required": [ - "symbol", - "rootSymbol", - "type", - "firstOpenDate", - "baseCurrency", - "quoteCurrency", - "settleCurrency", - "maxOrderQty", - "maxPrice", - "lotSize", - "tickSize", - "indexPriceTickSize", - "multiplier", - "initialMargin", - "maintainMargin", - "maxRiskLimit", - "minRiskLimit", - "riskStep", - "makerFeeRate", - "takerFeeRate", - "takerFixFee", - "makerFixFee", - "settlementFee", - "isDeleverage", - "isQuanto", - "isInverse", - "markMethod", - "fairMethod", - "fundingBaseSymbol", - "fundingQuoteSymbol", - "fundingRateSymbol", - "indexSymbol", - "settlementSymbol", - "status", - "fundingFeeRate", - "predictedFundingFeeRate", - "fundingRateGranularity", - "openInterest", - "turnoverOf24h", - "volumeOf24h", - "markPrice", - "indexPrice", - "lastTradePrice", - "nextFundingRateTime", - "maxLeverage", - "sourceExchanges", - "premiumsSymbol1M", - "premiumsSymbol8H", - "fundingBaseSymbol1M", - "fundingQuoteSymbol1M", - "lowPrice", - "highPrice", - "priceChgPct", - "priceChg", - "k", - "m", - "f", - "mmrLimit", - "mmrLevConstant", - "supportCross" - ] - }, - "description": "the list of all contracts" - } - }, - "required": [ - "code", - "data" - ] - } - } - } - } - }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470220", - "x-abandon": "normal", - "x-domain": "Futures", - "x-api-channel": "Public", - "x-api-permission": "NULL", - "x-api-rate-limit-pool": "Public", - "x-sdk-service": "Futures", - "x-sdk-sub-service": "Market", - "x-sdk-method-name": "GetAllSymbols", - "x-sdk-method-description": "Get detailed information of all contracts that can be traded. This API will return a list of tradable contracts, including some key parameters of the contract such as the symbol name, tick size, mark price,etc.", - "x-api-rate-limit": 3, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": [\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"rootSymbol\\\": \\\"USDT\\\",\\n \\\"type\\\": \\\"FFWCSX\\\",\\n \\\"firstOpenDate\\\": 1585555200000,\\n \\\"expireDate\\\": null,\\n \\\"settleDate\\\": null,\\n \\\"baseCurrency\\\": \\\"XBT\\\",\\n \\\"quoteCurrency\\\": \\\"USDT\\\",\\n \\\"settleCurrency\\\": \\\"USDT\\\",\\n \\\"maxOrderQty\\\": 1000000,\\n \\\"maxPrice\\\": 1000000.0,\\n \\\"lotSize\\\": 1,\\n \\\"tickSize\\\": 0.1,\\n \\\"indexPriceTickSize\\\": 0.01,\\n \\\"multiplier\\\": 0.001,\\n \\\"initialMargin\\\": 0.008,\\n \\\"maintainMargin\\\": 0.004,\\n \\\"maxRiskLimit\\\": 100000,\\n \\\"minRiskLimit\\\": 100000,\\n \\\"riskStep\\\": 50000,\\n \\\"makerFeeRate\\\": 2.0E-4,\\n \\\"takerFeeRate\\\": 6.0E-4,\\n \\\"takerFixFee\\\": 0.0,\\n \\\"makerFixFee\\\": 0.0,\\n \\\"settlementFee\\\": null,\\n \\\"isDeleverage\\\": true,\\n \\\"isQuanto\\\": true,\\n \\\"isInverse\\\": false,\\n \\\"markMethod\\\": \\\"FairPrice\\\",\\n \\\"fairMethod\\\": \\\"FundingRate\\\",\\n \\\"fundingBaseSymbol\\\": \\\".XBTINT8H\\\",\\n \\\"fundingQuoteSymbol\\\": \\\".USDTINT8H\\\",\\n \\\"fundingRateSymbol\\\": \\\".XBTUSDTMFPI8H\\\",\\n \\\"indexSymbol\\\": \\\".KXBTUSDT\\\",\\n \\\"settlementSymbol\\\": \\\"\\\",\\n \\\"status\\\": \\\"Open\\\",\\n \\\"fundingFeeRate\\\": 1.53E-4,\\n \\\"predictedFundingFeeRate\\\": 8.0E-5,\\n \\\"fundingRateGranularity\\\": 28800000,\\n \\\"openInterest\\\": \\\"6384957\\\",\\n \\\"turnoverOf24h\\\": 5.788402220999069E8,\\n \\\"volumeOf24h\\\": 8274.432,\\n \\\"markPrice\\\": 69732.33,\\n \\\"indexPrice\\\": 69732.32,\\n \\\"lastTradePrice\\\": 69732,\\n \\\"nextFundingRateTime\\\": 21265941,\\n \\\"maxLeverage\\\": 125,\\n \\\"sourceExchanges\\\": [\\n \\\"okex\\\",\\n \\\"binance\\\",\\n \\\"kucoin\\\",\\n \\\"bybit\\\",\\n \\\"bitmart\\\",\\n \\\"gateio\\\"\\n ],\\n \\\"premiumsSymbol1M\\\": \\\".XBTUSDTMPI\\\",\\n \\\"premiumsSymbol8H\\\": \\\".XBTUSDTMPI8H\\\",\\n \\\"fundingBaseSymbol1M\\\": \\\".XBTINT\\\",\\n \\\"fundingQuoteSymbol1M\\\": \\\".USDTINT\\\",\\n \\\"lowPrice\\\": 68817.5,\\n \\\"highPrice\\\": 71615.8,\\n \\\"priceChgPct\\\": 6.0E-4,\\n \\\"priceChg\\\": 48.0,\\n \\\"k\\\": 490.0,\\n \\\"m\\\": 300.0,\\n \\\"f\\\": 1.3,\\n \\\"mmrLimit\\\": 0.3,\\n \\\"mmrLevConstant\\\": 125.0,\\n \\\"supportCross\\\": true\\n }\\n ]\\n}" - } - }, - "/api/v1/contracts/{symbol}": { - "get": { - "summary": "Get Symbol", - "deprecated": false, - "description": "Get information of specified contracts that can be traded. This API will return a list of tradable contracts, including some key parameters of the contract such as the symbol name, tick size, mark price,etc.", - "tags": [], - "parameters": [ - { - "name": "symbol", - "in": "path", - "description": "Path Parameter. Symbol of the contract", - "required": true, - "schema": { - "type": "string" - } - } - ], + "parameters": [ + { + "name": "symbol", + "in": "path", + "description": "Path Parameter. Symbol of the contract", + "required": true, + "schema": { + "type": "string" + } + } + ], "responses": { "200": { "description": "", @@ -926,152 +471,13 @@ "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDTM\\\"}" } }, - "/api/v1/ticker": { + "/api/v1/contracts/active": { "get": { - "summary": "Get Ticker", + "summary": "Get All Symbols", "deprecated": false, - "description": "This endpoint returns \"last traded price/size\"、\"best bid/ask price/size\" etc. of a single symbol. These messages can also be obtained through Websocket.", + "description": "Get detailed information of all contracts that can be traded. This API will return a list of tradable contracts, including some key parameters of the contract such as the symbol name, tick size, mark price,etc.", "tags": [], - "parameters": [ - { - "name": "symbol", - "in": "query", - "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) \n\n", - "required": true, - "schema": { - "type": "string", - "example": [ - "XBTUSDTM", - "XBTUSDM", - "ETHUSDTM" - ] - } - } - ], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "type": "string", - "description": "200000 is for success, other is error" - }, - "data": { - "type": "object", - "properties": { - "sequence": { - "type": "integer", - "description": "Sequence number, used to judge whether the messages pushed by Websocket is continuous.", - "format": "int64" - }, - "symbol": { - "type": "string", - "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) " - }, - "side": { - "type": "string", - "description": "Filled side, The trade side indicates the taker order side. A taker order is the order that was matched with orders opened on the order book.", - "enum": [ - "buy", - "sell" - ], - "x-api-enum": [ - { - "value": "buy", - "name": "buy", - "description": "buy" - }, - { - "value": "sell", - "name": "sell", - "description": "sell" - } - ] - }, - "size": { - "type": "integer", - "description": "Filled quantity" - }, - "tradeId": { - "type": "string", - "description": "Transaction ID" - }, - "price": { - "type": "string", - "description": "Filled price" - }, - "bestBidPrice": { - "type": "string", - "description": "Best bid price" - }, - "bestBidSize": { - "type": "integer", - "description": "Best bid size" - }, - "bestAskPrice": { - "type": "string", - "description": "Best ask price" - }, - "bestAskSize": { - "type": "integer", - "description": "Best ask size" - }, - "ts": { - "type": "integer", - "description": "Filled time(nanosecond)", - "format": "int64" - } - }, - "required": [ - "sequence", - "symbol", - "side", - "size", - "tradeId", - "price", - "bestBidPrice", - "bestBidSize", - "bestAskPrice", - "bestAskSize", - "ts" - ] - } - }, - "required": [ - "code", - "data" - ] - } - } - } - } - }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470222", - "x-abandon": "normal", - "x-domain": "Futures", - "x-api-channel": "Public", - "x-api-permission": "NULL", - "x-api-rate-limit-pool": "Public", - "x-sdk-service": "Futures", - "x-sdk-sub-service": "Market", - "x-sdk-method-name": "getTicker", - "x-sdk-method-description": "This endpoint returns \"last traded price/size\"、\"best bid/ask price/size\" etc. of a single symbol. These messages can also be obtained through Websocket.", - "x-api-rate-limit": 2, - "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"sequence\\\":1697895100310,\\\"symbol\\\":\\\"XBTUSDM\\\",\\\"side\\\":\\\"sell\\\",\\\"size\\\":2936,\\\"tradeId\\\":\\\"1697901180000\\\",\\\"price\\\":\\\"67158.4\\\",\\\"bestBidPrice\\\":\\\"67169.6\\\",\\\"bestBidSize\\\":32345,\\\"bestAskPrice\\\":\\\"67169.7\\\",\\\"bestAskSize\\\":7251,\\\"ts\\\":1729163001780000000}}", - "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDTM\\\"}" - } - }, - "/api/v1/allTickers": { - "get": { - "summary": "Get All Tickers", - "deprecated": false, - "description": "This endpoint returns \"last traded price/size\"、\"best bid/ask price/size\" etc. of a single symbol. These messages can also be obtained through Websocket.", - "tags": [], - "parameters": [], + "parameters": [], "responses": { "200": { "description": "", @@ -1089,566 +495,457 @@ "items": { "type": "object", "properties": { - "sequence": { - "type": "integer", - "description": "Sequence number, used to judge whether the messages pushed by Websocket is continuous.", - "format": "int64" - }, "symbol": { "type": "string", - "description": "Symbol" + "description": "Symbol", + "example": [ + "XBTUSDTM", + "XBTUSDCM", + "XBTUSDM" + ] }, - "side": { + "rootSymbol": { "type": "string", - "description": "Trade direction", + "description": "Contract group", + "example": [ + "USDT", + "USDC", + "XBT" + ] + }, + "type": { + "type": "string", + "description": "Type of the contract", "enum": [ - "buy", - "sell" + "FFWCSX", + "FFICSX" ], "x-api-enum": [ { - "value": "buy", - "name": "BUY", - "description": "" + "value": "FFWCSX", + "name": "FFWCSX", + "description": "Standardized swap contracts standard financial futures on swap, expiration swap funding rate" }, { - "value": "sell", - "name": "SELL", - "description": "" + "value": "FFICSX", + "name": "FFICSX", + "description": "Futures Contract" } ] }, - "size": { + "firstOpenDate": { "type": "integer", - "description": "Filled side, The trade side indicates the taker order side. A taker order is the order that was matched with orders opened on the order book." + "description": "First Open Date(millisecond)", + "format": "int64" }, - "tradeId": { + "expireDate": { + "type": "integer", + "description": "Expiration date(millisecond). Null means it will never expire", + "format": "int64" + }, + "settleDate": { + "type": "integer", + "description": "Settlement date(millisecond). Null indicates that automatic settlement is not supported", + "format": "int64" + }, + "baseCurrency": { "type": "string", - "description": "Transaction ID" + "description": "Base currency" }, - "price": { + "quoteCurrency": { "type": "string", - "description": "Filled price" + "description": "Quote currency" }, - "bestBidPrice": { + "settleCurrency": { "type": "string", - "description": "Best bid price" + "description": "Currency used to clear and settle the trades" }, - "bestBidSize": { + "maxOrderQty": { "type": "integer", - "description": "Best bid size" + "description": "Maximum order quantity" }, - "bestAskPrice": { - "type": "string", - "description": "Best ask price" + "maxPrice": { + "type": "number", + "description": "Maximum order price" }, - "bestAskSize": { + "lotSize": { "type": "integer", - "description": "Best ask size" + "description": "Minimum lot size" }, - "ts": { + "tickSize": { + "type": "number", + "description": "Minimum price changes" + }, + "indexPriceTickSize": { + "type": "number", + "description": "Index price of tick size" + }, + "multiplier": { + "type": "number", + "description": "The basic unit of the contract API is lots. For the number of coins in each lot, please refer to the param multiplier. For example, for XBTUSDTM, multiplier=0.001, which corresponds to the value of each XBTUSDTM contract being 0.001 BTC. There is also a special case. All coin-swap contracts, such as each XBTUSDM contract, correspond to 1 USD." + }, + "initialMargin": { + "type": "number", + "description": "Initial margin requirement" + }, + "maintainMargin": { + "type": "number", + "description": "Maintenance margin requirement" + }, + "maxRiskLimit": { "type": "integer", - "description": "Filled time(nanosecond)", - "format": "int64" - } - }, - "required": [ - "sequence", - "symbol", - "side", - "tradeId", - "price", - "bestBidPrice", - "bestBidSize", - "bestAskPrice", - "bestAskSize", - "ts", - "size" - ] - } - } - }, - "required": [ - "code", - "data" - ] - } - } - } - } - }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470223", - "x-abandon": "normal", - "x-domain": "Futures", - "x-api-channel": "Public", - "x-api-permission": "NULL", - "x-api-rate-limit-pool": "Public", - "x-sdk-service": "Futures", - "x-sdk-sub-service": "Market", - "x-sdk-method-name": "getAllTickers", - "x-sdk-method-description": "This endpoint returns \"last traded price/size\"、\"best bid/ask price/size\" etc. of a single symbol. These messages can also be obtained through Websocket.", - "x-api-rate-limit": 5, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": [\\n {\\n \\\"sequence\\\": 1707992727046,\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"side\\\": \\\"sell\\\",\\n \\\"size\\\": 21,\\n \\\"tradeId\\\": \\\"1784299761369\\\",\\n \\\"price\\\": \\\"67153\\\",\\n \\\"bestBidPrice\\\": \\\"67153\\\",\\n \\\"bestBidSize\\\": 2767,\\n \\\"bestAskPrice\\\": \\\"67153.1\\\",\\n \\\"bestAskSize\\\": 5368,\\n \\\"ts\\\": 1729163466659000000\\n },\\n {\\n \\\"sequence\\\": 1697895166299,\\n \\\"symbol\\\": \\\"XBTUSDM\\\",\\n \\\"side\\\": \\\"sell\\\",\\n \\\"size\\\": 1956,\\n \\\"tradeId\\\": \\\"1697901245065\\\",\\n \\\"price\\\": \\\"67145.2\\\",\\n \\\"bestBidPrice\\\": \\\"67135.3\\\",\\n \\\"bestBidSize\\\": 1,\\n \\\"bestAskPrice\\\": \\\"67135.8\\\",\\n \\\"bestAskSize\\\": 3,\\n \\\"ts\\\": 1729163445340000000\\n }\\n ]\\n}" - } - }, - "/api/v1/level2/snapshot": { - "get": { - "summary": "Get Full OrderBook", - "deprecated": false, - "description": "Query for Full orderbook depth data. (aggregated by price) It is generally used by professional traders because it uses more server resources and traffic, and we have strict access rate limit control. To maintain up-to-date Order Book, please use Websocket incremental feed after retrieving the OrderBook.", - "tags": [], - "parameters": [ - { - "name": "symbol", - "in": "query", - "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) \n", - "required": false, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "type": "string", - "description": "200000 is for success, other is error" - }, - "data": { - "type": "object", - "properties": { - "sequence": { - "type": "integer", - "description": "Sequence number", - "format": "int64" - }, - "symbol": { - "type": "string", - "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) " - }, - "bids": { - "type": "array", - "items": { - "type": "array", - "items": { - "type": "number", - "description": "Price, Size" - } + "description": "Maximum risk limit (unit: XBT)" }, - "description": "bids, from high to low" - }, - "asks": { - "type": "array", - "items": { - "type": "array", - "items": { - "type": "number", - "description": "Price, Size" - } + "minRiskLimit": { + "type": "integer", + "description": "Minimum risk limit (unit: XBT)" }, - "description": "asks, from low to high" - }, - "ts": { - "type": "integer", - "format": "int64", - "description": "Timestamp(nanosecond)" - } - }, - "required": [ - "sequence", - "symbol", - "bids", - "asks", - "ts" - ] - } - }, - "required": [ - "code", - "data" - ] - } - } - } - } - }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470224", - "x-abandon": "normal", - "x-domain": "Futures", - "x-api-channel": "Public", - "x-api-permission": "NULL", - "x-api-rate-limit-pool": "Public", - "x-sdk-service": "Futures", - "x-sdk-sub-service": "Market", - "x-sdk-method-name": "getFullOrderBook", - "x-sdk-method-description": "Query for Full orderbook depth data. (aggregated by price) It is generally used by professional traders because it uses more server resources and traffic, and we have strict access rate limit control. To maintain up-to-date Order Book, please use Websocket incremental feed after retrieving the OrderBook.", - "x-api-rate-limit": 3, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"sequence\\\": 1697895963339,\\n \\\"symbol\\\": \\\"XBTUSDM\\\",\\n \\\"bids\\\": [\\n [\\n 66968,\\n 2\\n ],\\n [\\n 66964.8,\\n 25596\\n ]\\n ],\\n \\\"asks\\\": [\\n [\\n 66968.1,\\n 13501\\n ],\\n [\\n 66968.7,\\n 2032\\n ]\\n ],\\n \\\"ts\\\": 1729168101216000000\\n }\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDM\\\"}" - } - }, - "/api/v1/level2/depth{size}": { - "get": { - "summary": "Get Part OrderBook", - "deprecated": false, - "description": "Query for part orderbook depth data. (aggregated by price) You are recommended to request via this endpoint as the system reponse would be faster and cosume less traffic.", - "tags": [], - "parameters": [ - { - "name": "symbol", - "in": "query", - "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) ", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "size", - "in": "path", - "description": "Get the depth layer, optional value: 20, 100", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "data": { - "type": "object", - "properties": { - "sequence": { - "type": "integer", - "description": "Sequence number", - "format": "int64" - }, - "symbol": { - "type": "string", - "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) " - }, - "bids": { - "type": "array", - "items": { - "type": "array", - "items": { - "type": "number", - "description": "Price, Size" - } + "riskStep": { + "type": "integer", + "description": "Risk limit increment value (unit: XBT)" }, - "description": "bids, from high to low" - }, - "asks": { - "type": "array", - "items": { - "type": "array", - "items": { - "type": "number", - "description": "Price, Size" - } + "makerFeeRate": { + "type": "number", + "description": "Maker fee rate" }, - "description": "asks, from low to high" - }, - "ts": { - "type": "integer", - "description": "Timestamp(nanosecond)", - "format": "int64" - } - }, - "required": [ - "sequence", - "symbol", - "bids", - "asks", - "ts" - ] - } - }, - "required": [ - "code", - "data" - ] - } - } - } - } - }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470225", - "x-abandon": "normal", - "x-domain": "Futures", - "x-api-channel": "Public", - "x-api-permission": "NULL", - "x-api-rate-limit-pool": "Public", - "x-sdk-service": "Futures", - "x-sdk-sub-service": "Market", - "x-sdk-method-name": "getPartOrderBook", - "x-sdk-method-description": "Query for part orderbook depth data. (aggregated by price) You are recommended to request via this endpoint as the system reponse would be faster and cosume less traffic.", - "x-api-rate-limit": 5, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"sequence\\\": 1697895963339,\\n \\\"symbol\\\": \\\"XBTUSDM\\\",\\n \\\"bids\\\": [\\n [\\n 66968,\\n 2\\n ],\\n [\\n 66964.8,\\n 25596\\n ]\\n ],\\n \\\"asks\\\": [\\n [\\n 66968.1,\\n 13501\\n ],\\n [\\n 66968.7,\\n 2032\\n ]\\n ],\\n \\\"ts\\\": 1729168101216000000\\n }\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDM\\\", \\\"size\\\": \\\"20\\\"}" - } - }, - "/api/v1/interest/query": { - "get": { - "summary": "Get Interest Rate Index", - "deprecated": false, - "description": "Get interest rate Index.", - "tags": [], - "parameters": [ - { - "name": "symbol", - "in": "query", - "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: fundingBaseSymbol, fundingQuoteSymbol, fundingBaseSymbol1M, fundingQuoteSymbol1M](https://www.kucoin.com/docs-new/api-3470220) ", - "required": true, - "schema": { - "type": "string", - "example": [ - ".XBTINT8H", - ".USDTINT8H", - ".XBTINT", - ".USDTINT" - ] - } - }, - { - "name": "startAt", - "in": "query", - "description": "Start time (milisecond)", - "required": false, - "schema": { - "type": "integer", - "format": "int64" - } - }, - { - "name": "endAt", - "in": "query", - "description": "End time (milisecond)", - "required": false, - "schema": { - "type": "integer", - "format": "int64" - } - }, - { - "name": "reverse", - "in": "query", - "description": "This parameter functions to judge whether the lookup is reverse. True means “yes”. False means no. This parameter is set as True by default.", - "required": false, - "schema": { - "type": "boolean", - "default": true - } - }, - { - "name": "offset", - "in": "query", - "description": "Start offset. The unique attribute of the last returned result of the last request. The data of the first page will be returned by default.", - "required": false, - "schema": { - "type": "integer", - "format": "int64" - } - }, - { - "name": "forward", - "in": "query", - "description": "This parameter functions to judge whether the lookup is forward or not. True means “yes” and False means “no”. This parameter is set as true by default", - "required": false, - "schema": { - "type": "boolean", - "default": true - } - }, - { - "name": "maxCount", - "in": "query", - "description": "Max record count. The default record count is 10, The maximum length cannot exceed 100", - "required": false, - "schema": { - "type": "integer", - "format": "int64", - "default": 10, - "maximum": 100 - } - } - ], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "data": { - "type": "object", - "properties": { - "dataList": { - "type": "array", - "items": { - "type": "object", - "properties": { - "symbol": { - "type": "string", - "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: fundingBaseSymbol, fundingQuoteSymbol, fundingBaseSymbol1M, fundingQuoteSymbol1M](https://www.kucoin.com/docs-new/api-3470220) " + "takerFeeRate": { + "type": "number", + "description": "Taker fee rate" + }, + "takerFixFee": { + "type": "number", + "description": "Deprecated param" + }, + "makerFixFee": { + "type": "number", + "description": "Deprecated param" + }, + "settlementFee": { + "type": "number", + "description": "Settlement fee" + }, + "isDeleverage": { + "type": "boolean", + "description": "Enabled ADL or not" + }, + "isQuanto": { + "type": "boolean", + "description": "Deprecated param" + }, + "isInverse": { + "type": "boolean", + "description": "Whether it is a reverse contract" + }, + "markMethod": { + "type": "string", + "description": "Marking method", + "enum": [ + "FairPrice" + ], + "x-api-enum": [ + { + "value": "FairPrice", + "name": "FairPrice", + "description": "Fair Price" + } + ] + }, + "fairMethod": { + "type": "string", + "description": "Fair price marking method, The Futures contract is null", + "enum": [ + "FundingRate" + ], + "x-api-enum": [ + { + "value": "FundingRate", + "name": "FundingRate", + "description": "FundingRate" + } + ] + }, + "fundingBaseSymbol": { + "type": "string", + "description": "Ticker symbol of the based currency" + }, + "fundingQuoteSymbol": { + "type": "string", + "description": "Ticker symbol of the quote currency" + }, + "fundingRateSymbol": { + "type": "string", + "description": "Funding rate symbol" + }, + "indexSymbol": { + "type": "string", + "description": "Index symbol" + }, + "settlementSymbol": { + "type": "string", + "description": "Settlement Symbol" + }, + "status": { + "type": "string", + "description": "Contract status", + "enum": [ + "Init", + "Open", + "BeingSettled", + "Settled", + "Paused", + "Closed", + "CancelOnly" + ], + "x-api-enum": [ + { + "value": "Init", + "name": "Init", + "description": "Initial" }, - "granularity": { - "type": "integer", - "description": "Granularity (milisecond)" + { + "value": "Open", + "name": "Open", + "description": "Online" }, - "timePoint": { - "type": "integer", - "description": "Timestamp(milisecond)", - "format": "int64" + { + "value": "BeingSettled", + "name": "BeingSettled", + "description": "Setting" }, - "value": { - "type": "number", - "description": "Interest rate value" + { + "value": "Settled", + "name": "Settled", + "description": "Settled" + }, + { + "value": "Paused", + "name": "Paused", + "description": "Suspended" + }, + { + "value": "Closed", + "name": "Closed", + "description": "Offline" + }, + { + "value": "CancelOnly", + "name": "CancelOnly", + "description": "Orders can only be canceled" } - }, - "required": [ - "symbol", - "granularity", - "timePoint", - "value" ] - } - }, - "hasMore": { - "type": "boolean", - "description": "Whether there are more pages" - } - }, - "required": [ - "dataList", - "hasMore" - ] - } - }, - "required": [ - "code", - "data" - ] - } - } - } - } - }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470226", - "x-abandon": "normal", - "x-domain": "Futures", - "x-api-channel": "Public", - "x-api-permission": "NULL", - "x-api-rate-limit-pool": "Public", - "x-sdk-service": "Futures", - "x-sdk-sub-service": "Market", - "x-sdk-method-name": "getInterestRateIndex", - "x-sdk-method-description": "Get interest rate Index.", - "x-api-rate-limit": 5, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"dataList\\\": [\\n {\\n \\\"symbol\\\": \\\".XBTINT\\\",\\n \\\"granularity\\\": 60000,\\n \\\"timePoint\\\": 1728692100000,\\n \\\"value\\\": 3.0E-4\\n },\\n {\\n \\\"symbol\\\": \\\".XBTINT\\\",\\n \\\"granularity\\\": 60000,\\n \\\"timePoint\\\": 1728692040000,\\n \\\"value\\\": 3.0E-4\\n }\\n ],\\n \\\"hasMore\\\": true\\n }\\n}", - "x-request-example": "{\\\"symbol\\\": \\\".XBTINT8H\\\", \\\"startAt\\\": 1728663338000, \\\"endAt\\\": 1728692138000, \\\"reverse\\\": true, \\\"offset\\\": 254062248624417, \\\"forward\\\": true, \\\"maxCount\\\": 10}" - } - }, - "/api/v1/premium/query": { - "get": { - "summary": "Get Premium Index", - "deprecated": false, - "description": "Submit request to get premium index.", + }, + "fundingFeeRate": { + "type": "number", + "description": "Funding fee rate" + }, + "predictedFundingFeeRate": { + "type": "number", + "description": "Predicted funding fee rate" + }, + "fundingRateGranularity": { + "type": "integer", + "description": "Funding interval(millisecond)" + }, + "openInterest": { + "type": "string", + "description": "Open interest" + }, + "turnoverOf24h": { + "type": "number", + "description": "24-hour turnover" + }, + "volumeOf24h": { + "type": "number", + "description": "24-hour volume" + }, + "markPrice": { + "type": "number", + "description": "Mark price" + }, + "indexPrice": { + "type": "number", + "description": "Index price" + }, + "lastTradePrice": { + "type": "number", + "description": "Last trade price" + }, + "nextFundingRateTime": { + "type": "integer", + "description": "Next funding rate time(millisecond)" + }, + "maxLeverage": { + "type": "integer", + "description": "Maximum leverage" + }, + "sourceExchanges": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The contract index price source exchange" + }, + "premiumsSymbol1M": { + "type": "string", + "description": "Premium index symbol(1 minute)" + }, + "premiumsSymbol8H": { + "type": "string", + "description": "Premium index symbol(8 hours)" + }, + "fundingBaseSymbol1M": { + "type": "string", + "description": "Base currency interest rate symbol(1 minute)" + }, + "fundingQuoteSymbol1M": { + "type": "string", + "description": "Quote currency interest rate symbol(1 minute)" + }, + "lowPrice": { + "type": "number", + "description": "24-hour lowest price" + }, + "highPrice": { + "type": "number", + "description": "24-hour highest price" + }, + "priceChgPct": { + "type": "number", + "description": "24-hour price change% " + }, + "priceChg": { + "type": "number", + "description": "24-hour price change" + }, + "k": { + "type": "number" + }, + "m": { + "type": "number" + }, + "f": { + "type": "number" + }, + "mmrLimit": { + "type": "number" + }, + "mmrLevConstant": { + "type": "number" + }, + "supportCross": { + "type": "boolean", + "description": "Whether support Cross Margin" + } + }, + "required": [ + "symbol", + "rootSymbol", + "type", + "firstOpenDate", + "baseCurrency", + "quoteCurrency", + "settleCurrency", + "maxOrderQty", + "maxPrice", + "lotSize", + "tickSize", + "indexPriceTickSize", + "multiplier", + "initialMargin", + "maintainMargin", + "maxRiskLimit", + "minRiskLimit", + "riskStep", + "makerFeeRate", + "takerFeeRate", + "takerFixFee", + "makerFixFee", + "settlementFee", + "isDeleverage", + "isQuanto", + "isInverse", + "markMethod", + "fairMethod", + "fundingBaseSymbol", + "fundingQuoteSymbol", + "fundingRateSymbol", + "indexSymbol", + "settlementSymbol", + "status", + "fundingFeeRate", + "predictedFundingFeeRate", + "fundingRateGranularity", + "openInterest", + "turnoverOf24h", + "volumeOf24h", + "markPrice", + "indexPrice", + "lastTradePrice", + "nextFundingRateTime", + "maxLeverage", + "sourceExchanges", + "premiumsSymbol1M", + "premiumsSymbol8H", + "fundingBaseSymbol1M", + "fundingQuoteSymbol1M", + "lowPrice", + "highPrice", + "priceChgPct", + "priceChg", + "k", + "m", + "f", + "mmrLimit", + "mmrLevConstant", + "supportCross" + ] + }, + "description": "the list of all contracts" + } + }, + "required": [ + "code", + "data" + ] + } + } + } + } + }, + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470220", + "x-abandon": "normal", + "x-domain": "Futures", + "x-api-channel": "Public", + "x-api-permission": "NULL", + "x-api-rate-limit-pool": "Public", + "x-sdk-service": "Futures", + "x-sdk-sub-service": "Market", + "x-sdk-method-name": "GetAllSymbols", + "x-sdk-method-description": "Get detailed information of all contracts that can be traded. This API will return a list of tradable contracts, including some key parameters of the contract such as the symbol name, tick size, mark price,etc.", + "x-api-rate-limit": 3, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": [\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"rootSymbol\\\": \\\"USDT\\\",\\n \\\"type\\\": \\\"FFWCSX\\\",\\n \\\"firstOpenDate\\\": 1585555200000,\\n \\\"expireDate\\\": null,\\n \\\"settleDate\\\": null,\\n \\\"baseCurrency\\\": \\\"XBT\\\",\\n \\\"quoteCurrency\\\": \\\"USDT\\\",\\n \\\"settleCurrency\\\": \\\"USDT\\\",\\n \\\"maxOrderQty\\\": 1000000,\\n \\\"maxPrice\\\": 1000000.0,\\n \\\"lotSize\\\": 1,\\n \\\"tickSize\\\": 0.1,\\n \\\"indexPriceTickSize\\\": 0.01,\\n \\\"multiplier\\\": 0.001,\\n \\\"initialMargin\\\": 0.008,\\n \\\"maintainMargin\\\": 0.004,\\n \\\"maxRiskLimit\\\": 100000,\\n \\\"minRiskLimit\\\": 100000,\\n \\\"riskStep\\\": 50000,\\n \\\"makerFeeRate\\\": 2.0E-4,\\n \\\"takerFeeRate\\\": 6.0E-4,\\n \\\"takerFixFee\\\": 0.0,\\n \\\"makerFixFee\\\": 0.0,\\n \\\"settlementFee\\\": null,\\n \\\"isDeleverage\\\": true,\\n \\\"isQuanto\\\": true,\\n \\\"isInverse\\\": false,\\n \\\"markMethod\\\": \\\"FairPrice\\\",\\n \\\"fairMethod\\\": \\\"FundingRate\\\",\\n \\\"fundingBaseSymbol\\\": \\\".XBTINT8H\\\",\\n \\\"fundingQuoteSymbol\\\": \\\".USDTINT8H\\\",\\n \\\"fundingRateSymbol\\\": \\\".XBTUSDTMFPI8H\\\",\\n \\\"indexSymbol\\\": \\\".KXBTUSDT\\\",\\n \\\"settlementSymbol\\\": \\\"\\\",\\n \\\"status\\\": \\\"Open\\\",\\n \\\"fundingFeeRate\\\": 1.53E-4,\\n \\\"predictedFundingFeeRate\\\": 8.0E-5,\\n \\\"fundingRateGranularity\\\": 28800000,\\n \\\"openInterest\\\": \\\"6384957\\\",\\n \\\"turnoverOf24h\\\": 5.788402220999069E8,\\n \\\"volumeOf24h\\\": 8274.432,\\n \\\"markPrice\\\": 69732.33,\\n \\\"indexPrice\\\": 69732.32,\\n \\\"lastTradePrice\\\": 69732,\\n \\\"nextFundingRateTime\\\": 21265941,\\n \\\"maxLeverage\\\": 125,\\n \\\"sourceExchanges\\\": [\\n \\\"okex\\\",\\n \\\"binance\\\",\\n \\\"kucoin\\\",\\n \\\"bybit\\\",\\n \\\"bitmart\\\",\\n \\\"gateio\\\"\\n ],\\n \\\"premiumsSymbol1M\\\": \\\".XBTUSDTMPI\\\",\\n \\\"premiumsSymbol8H\\\": \\\".XBTUSDTMPI8H\\\",\\n \\\"fundingBaseSymbol1M\\\": \\\".XBTINT\\\",\\n \\\"fundingQuoteSymbol1M\\\": \\\".USDTINT\\\",\\n \\\"lowPrice\\\": 68817.5,\\n \\\"highPrice\\\": 71615.8,\\n \\\"priceChgPct\\\": 6.0E-4,\\n \\\"priceChg\\\": 48.0,\\n \\\"k\\\": 490.0,\\n \\\"m\\\": 300.0,\\n \\\"f\\\": 1.3,\\n \\\"mmrLimit\\\": 0.3,\\n \\\"mmrLevConstant\\\": 125.0,\\n \\\"supportCross\\\": true\\n }\\n ]\\n}" + } + }, + "/api/v1/ticker": { + "get": { + "summary": "Get Ticker", + "deprecated": false, + "description": "This endpoint returns \"last traded price/size\"、\"best bid/ask price/size\" etc. of a single symbol. These messages can also be obtained through Websocket.", "tags": [], "parameters": [ { "name": "symbol", "in": "query", - "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: premiumsSymbol1M, premiumsSymbol8H](https://www.kucoin.com/docs-new/api-3470220) ", + "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) \n\n", "required": true, "schema": { "type": "string", "example": [ - ".XBTUSDTMPI", - ".XBTUSDTMPI8H" + "XBTUSDTM", + "XBTUSDM", + "ETHUSDTM" ] } - }, - { - "name": "startAt", - "in": "query", - "description": "Start time (milisecond)", - "required": false, - "schema": { - "type": "integer", - "format": "int64" - } - }, - { - "name": "endAt", - "in": "query", - "description": "End time (milisecond)", - "required": false, - "schema": { - "type": "integer", - "format": "int64" - } - }, - { - "name": "reverse", - "in": "query", - "description": "This parameter functions to judge whether the lookup is reverse. True means “yes”. False means no. This parameter is set as True by default.", - "required": false, - "schema": { - "type": "boolean", - "default": true - } - }, - { - "name": "offset", - "in": "query", - "description": "Start offset. The unique attribute of the last returned result of the last request. The data of the first page will be returned by default.", - "required": false, - "schema": { - "type": "integer", - "format": "int64" - } - }, - { - "name": "forward", - "in": "query", - "description": "This parameter functions to judge whether the lookup is forward or not. True means “yes” and False means “no”. This parameter is set as true by default", - "required": false, - "schema": { - "type": "boolean", - "default": true - } - }, - { - "name": "maxCount", - "in": "query", - "description": "Max record count. The default record count is 10, The maximum length cannot exceed 100", - "required": false, - "schema": { - "type": "integer", - "format": "int64", - "default": 10, - "maximum": 100 - } } ], "responses": { @@ -1660,50 +957,87 @@ "type": "object", "properties": { "code": { - "type": "string" + "type": "string", + "description": "200000 is for success, other is error" }, "data": { "type": "object", "properties": { - "dataList": { - "type": "array", - "items": { - "type": "object", - "properties": { - "symbol": { - "type": "string", - "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: premiumsSymbol1M, premiumsSymbol8H](https://www.kucoin.com/docs-new/api-3470220) " - }, - "granularity": { - "type": "integer", - "description": "Granularity(milisecond)" - }, - "timePoint": { - "type": "integer", - "description": "Timestamp(milisecond)", - "format": "int64" - }, - "value": { - "type": "number", - "description": "Premium index" - } + "sequence": { + "type": "integer", + "description": "Sequence number, used to judge whether the messages pushed by Websocket is continuous.", + "format": "int64" + }, + "symbol": { + "type": "string", + "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) " + }, + "side": { + "type": "string", + "description": "Filled side, The trade side indicates the taker order side. A taker order is the order that was matched with orders opened on the order book.", + "enum": [ + "buy", + "sell" + ], + "x-api-enum": [ + { + "value": "buy", + "name": "buy", + "description": "buy" }, - "required": [ - "symbol", - "granularity", - "timePoint", - "value" - ] - } + { + "value": "sell", + "name": "sell", + "description": "sell" + } + ] }, - "hasMore": { - "type": "boolean", - "description": "Whether there are more pages" + "size": { + "type": "integer", + "description": "Filled quantity" + }, + "tradeId": { + "type": "string", + "description": "Transaction ID" + }, + "price": { + "type": "string", + "description": "Filled price" + }, + "bestBidPrice": { + "type": "string", + "description": "Best bid price" + }, + "bestBidSize": { + "type": "integer", + "description": "Best bid size" + }, + "bestAskPrice": { + "type": "string", + "description": "Best ask price" + }, + "bestAskSize": { + "type": "integer", + "description": "Best ask size" + }, + "ts": { + "type": "integer", + "description": "Filled time(nanosecond)", + "format": "int64" } }, "required": [ - "dataList", - "hasMore" + "sequence", + "symbol", + "side", + "size", + "tradeId", + "price", + "bestBidPrice", + "bestBidSize", + "bestAskPrice", + "bestAskSize", + "ts" ] } }, @@ -1716,7 +1050,7 @@ } } }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470227", + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470222", "x-abandon": "normal", "x-domain": "Futures", "x-api-channel": "Public", @@ -1724,18 +1058,18 @@ "x-api-rate-limit-pool": "Public", "x-sdk-service": "Futures", "x-sdk-sub-service": "Market", - "x-sdk-method-name": "getPremiumIndex", - "x-sdk-method-description": "Submit request to get premium index.", - "x-api-rate-limit": 3, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"hasMore\\\": true,\\n \\\"dataList\\\": [\\n {\\n \\\"symbol\\\": \\\".XBTUSDTMPI\\\",\\n \\\"granularity\\\": 60000,\\n \\\"timePoint\\\": 1730558040000,\\n \\\"value\\\": 0.00006\\n },\\n {\\n \\\"symbol\\\": \\\".XBTUSDTMPI\\\",\\n \\\"granularity\\\": 60000,\\n \\\"timePoint\\\": 1730557980000,\\n \\\"value\\\": -0.000025\\n }\\n ]\\n }\\n}", - "x-request-example": "{\\\"symbol\\\": \\\".XBTUSDTMPI\\\", \\\"startAt\\\": 1728663338000, \\\"endAt\\\": 1728692138000, \\\"reverse\\\": true, \\\"offset\\\": 254062248624417, \\\"forward\\\": true, \\\"maxCount\\\": 10}" + "x-sdk-method-name": "getTicker", + "x-sdk-method-description": "This endpoint returns \"last traded price/size\"、\"best bid/ask price/size\" etc. of a single symbol. These messages can also be obtained through Websocket.", + "x-api-rate-limit": 2, + "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"sequence\\\":1697895100310,\\\"symbol\\\":\\\"XBTUSDM\\\",\\\"side\\\":\\\"sell\\\",\\\"size\\\":2936,\\\"tradeId\\\":\\\"1697901180000\\\",\\\"price\\\":\\\"67158.4\\\",\\\"bestBidPrice\\\":\\\"67169.6\\\",\\\"bestBidSize\\\":32345,\\\"bestAskPrice\\\":\\\"67169.7\\\",\\\"bestAskSize\\\":7251,\\\"ts\\\":1729163001780000000}}", + "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDTM\\\"}" } }, - "/api/v1/trade-statistics": { + "/api/v1/allTickers": { "get": { - "summary": "Get 24hr Stats", + "summary": "Get All Tickers", "deprecated": false, - "description": "Get the statistics of the platform futures trading volume in the last 24 hours.", + "description": "This endpoint returns \"last traded price/size\"、\"best bid/ask price/size\" etc. of a single symbol. These messages can also be obtained through Websocket.", "tags": [], "parameters": [], "responses": { @@ -1747,19 +1081,91 @@ "type": "object", "properties": { "code": { - "type": "string" + "type": "string", + "description": "200000 is for success, other is error" }, "data": { - "type": "object", - "properties": { - "turnoverOf24h": { - "type": "number", - "description": "24-hour platform Futures trading volume. Unit is USD" - } - }, - "required": [ - "turnoverOf24h" - ] + "type": "array", + "items": { + "type": "object", + "properties": { + "sequence": { + "type": "integer", + "description": "Sequence number, used to judge whether the messages pushed by Websocket is continuous.", + "format": "int64" + }, + "symbol": { + "type": "string", + "description": "Symbol" + }, + "side": { + "type": "string", + "description": "Trade direction", + "enum": [ + "buy", + "sell" + ], + "x-api-enum": [ + { + "value": "buy", + "name": "BUY", + "description": "" + }, + { + "value": "sell", + "name": "SELL", + "description": "" + } + ] + }, + "size": { + "type": "integer", + "description": "Filled side, The trade side indicates the taker order side. A taker order is the order that was matched with orders opened on the order book." + }, + "tradeId": { + "type": "string", + "description": "Transaction ID" + }, + "price": { + "type": "string", + "description": "Filled price" + }, + "bestBidPrice": { + "type": "string", + "description": "Best bid price" + }, + "bestBidSize": { + "type": "integer", + "description": "Best bid size" + }, + "bestAskPrice": { + "type": "string", + "description": "Best ask price" + }, + "bestAskSize": { + "type": "integer", + "description": "Best ask size" + }, + "ts": { + "type": "integer", + "description": "Filled time(nanosecond)", + "format": "int64" + } + }, + "required": [ + "sequence", + "symbol", + "side", + "tradeId", + "price", + "bestBidPrice", + "bestBidSize", + "bestAskPrice", + "bestAskSize", + "ts", + "size" + ] + } } }, "required": [ @@ -1771,42 +1177,96 @@ } } }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470228", + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470223", "x-abandon": "normal", "x-domain": "Futures", "x-api-channel": "Public", "x-api-permission": "NULL", - "x-api-rate-limit-pool": "Futures", + "x-api-rate-limit-pool": "Public", "x-sdk-service": "Futures", "x-sdk-sub-service": "Market", - "x-sdk-method-name": "get24hrStats", - "x-sdk-method-description": "Get the statistics of the platform futures trading volume in the last 24 hours.", - "x-api-rate-limit": 3, - "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"turnoverOf24h\\\":1.1155733413273683E9}}" + "x-sdk-method-name": "getAllTickers", + "x-sdk-method-description": "This endpoint returns \"last traded price/size\"、\"best bid/ask price/size\" etc. of a single symbol. These messages can also be obtained through Websocket.", + "x-api-rate-limit": 5, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": [\\n {\\n \\\"sequence\\\": 1707992727046,\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"side\\\": \\\"sell\\\",\\n \\\"size\\\": 21,\\n \\\"tradeId\\\": \\\"1784299761369\\\",\\n \\\"price\\\": \\\"67153\\\",\\n \\\"bestBidPrice\\\": \\\"67153\\\",\\n \\\"bestBidSize\\\": 2767,\\n \\\"bestAskPrice\\\": \\\"67153.1\\\",\\n \\\"bestAskSize\\\": 5368,\\n \\\"ts\\\": 1729163466659000000\\n },\\n {\\n \\\"sequence\\\": 1697895166299,\\n \\\"symbol\\\": \\\"XBTUSDM\\\",\\n \\\"side\\\": \\\"sell\\\",\\n \\\"size\\\": 1956,\\n \\\"tradeId\\\": \\\"1697901245065\\\",\\n \\\"price\\\": \\\"67145.2\\\",\\n \\\"bestBidPrice\\\": \\\"67135.3\\\",\\n \\\"bestBidSize\\\": 1,\\n \\\"bestAskPrice\\\": \\\"67135.8\\\",\\n \\\"bestAskSize\\\": 3,\\n \\\"ts\\\": 1729163445340000000\\n }\\n ]\\n}" } }, - "/api/v1/timestamp": { + "/api/v1/level2/snapshot": { "get": { - "summary": "Get Server Time", + "summary": "Get Full OrderBook", "deprecated": false, - "description": "Get the API server time. This is the Unix timestamp.", + "description": "Query for Full orderbook depth data. (aggregated by price) It is generally used by professional traders because it uses more server resources and traffic, and we have strict access rate limit control. To maintain up-to-date Order Book, please use Websocket incremental feed after retrieving the OrderBook.", "tags": [], - "parameters": [], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "object", + "parameters": [ + { + "name": "symbol", + "in": "query", + "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) \n", + "required": false, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object", "properties": { "code": { - "type": "string" + "type": "string", + "description": "200000 is for success, other is error" }, "data": { - "type": "integer", - "format": "int64", - "description": "ServerTime(millisecond)" + "type": "object", + "properties": { + "sequence": { + "type": "integer", + "description": "Sequence number", + "format": "int64" + }, + "symbol": { + "type": "string", + "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) " + }, + "bids": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "number", + "description": "Price, Size" + } + }, + "description": "bids, from high to low" + }, + "asks": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "number", + "description": "Price, Size" + } + }, + "description": "asks, from low to high" + }, + "ts": { + "type": "integer", + "format": "int64", + "description": "Timestamp(nanosecond)" + } + }, + "required": [ + "sequence", + "symbol", + "bids", + "asks", + "ts" + ] } }, "required": [ @@ -1818,7 +1278,7 @@ } } }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470229", + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470224", "x-abandon": "normal", "x-domain": "Futures", "x-api-channel": "Public", @@ -1826,19 +1286,39 @@ "x-api-rate-limit-pool": "Public", "x-sdk-service": "Futures", "x-sdk-sub-service": "Market", - "x-sdk-method-name": "getServerTime", - "x-sdk-method-description": "Get the API server time. This is the Unix timestamp.", - "x-api-rate-limit": 2, - "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":1729260030774}" + "x-sdk-method-name": "getFullOrderBook", + "x-sdk-method-description": "Query for Full orderbook depth data. (aggregated by price) It is generally used by professional traders because it uses more server resources and traffic, and we have strict access rate limit control. To maintain up-to-date Order Book, please use Websocket incremental feed after retrieving the OrderBook.", + "x-api-rate-limit": 3, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"sequence\\\": 1697895963339,\\n \\\"symbol\\\": \\\"XBTUSDM\\\",\\n \\\"bids\\\": [\\n [\\n 66968,\\n 2\\n ],\\n [\\n 66964.8,\\n 25596\\n ]\\n ],\\n \\\"asks\\\": [\\n [\\n 66968.1,\\n 13501\\n ],\\n [\\n 66968.7,\\n 2032\\n ]\\n ],\\n \\\"ts\\\": 1729168101216000000\\n }\\n}", + "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDM\\\"}" } }, - "/api/v1/status": { + "/api/v1/level2/depth{size}": { "get": { - "summary": "Get Service Status", + "summary": "Get Part OrderBook", "deprecated": false, - "description": "Get the service status.", + "description": "Query for part orderbook depth data. (aggregated by price) You are recommended to request via this endpoint as the system reponse would be faster and cosume less traffic.", "tags": [], - "parameters": [], + "parameters": [ + { + "name": "symbol", + "in": "query", + "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) ", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "size", + "in": "path", + "description": "Get the depth layer, optional value: 20, 100", + "required": true, + "schema": { + "type": "string" + } + } + ], "responses": { "200": { "description": "", @@ -1853,39 +1333,49 @@ "data": { "type": "object", "properties": { - "msg": { - "type": "string" + "sequence": { + "type": "integer", + "description": "Sequence number", + "format": "int64" }, - "status": { + "symbol": { "type": "string", - "description": "Status of service: open:normal transaction, close:Stop Trading/Maintenance, cancelonly:can only cancel the order but not place order", - "enum": [ - "open", - "close", - "cancelonly" - ], - "x-api-enum": [ - { - "value": "open", - "name": "OPEN", - "description": "normal transaction" - }, - { - "value": "close", - "name": "CLOSE", - "description": "Stop Trading/Maintenance" - }, - { - "value": "cancelonly", - "name": "CANCELONLY", - "description": "can only cancel the order but not place order" + "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) " + }, + "bids": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "number", + "description": "Price, Size" } - ] + }, + "description": "bids, from high to low" + }, + "asks": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "number", + "description": "Price, Size" + } + }, + "description": "asks, from low to high" + }, + "ts": { + "type": "integer", + "description": "Timestamp(nanosecond)", + "format": "int64" } }, "required": [ - "msg", - "status" + "sequence", + "symbol", + "bids", + "asks", + "ts" ] } }, @@ -1898,7 +1388,7 @@ } } }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470230", + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470225", "x-abandon": "normal", "x-domain": "Futures", "x-api-channel": "Public", @@ -1906,216 +1396,27 @@ "x-api-rate-limit-pool": "Public", "x-sdk-service": "Futures", "x-sdk-sub-service": "Market", - "x-sdk-method-name": "getServiceStatus", - "x-sdk-method-description": "Get the service status.", - "x-api-rate-limit": 4, - "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"msg\\\":\\\"\\\",\\\"status\\\":\\\"open\\\"}}" + "x-sdk-method-name": "getPartOrderBook", + "x-sdk-method-description": "Query for part orderbook depth data. (aggregated by price) You are recommended to request via this endpoint as the system reponse would be faster and cosume less traffic.", + "x-api-rate-limit": 5, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"sequence\\\": 1697895963339,\\n \\\"symbol\\\": \\\"XBTUSDM\\\",\\n \\\"bids\\\": [\\n [\\n 66968,\\n 2\\n ],\\n [\\n 66964.8,\\n 25596\\n ]\\n ],\\n \\\"asks\\\": [\\n [\\n 66968.1,\\n 13501\\n ],\\n [\\n 66968.7,\\n 2032\\n ]\\n ],\\n \\\"ts\\\": 1729168101216000000\\n }\\n}", + "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDM\\\", \\\"size\\\": \\\"20\\\"}" } }, - "/api/v1/index/query": { + "/api/v1/trade/history": { "get": { - "summary": "Get Spot Index Price", + "summary": "Get Trade History", "deprecated": false, - "description": "Get Spot Index Price", + "description": "Request via this endpoint to get the trade history of the specified symbol, the returned quantity is the last 100 transaction records.", "tags": [], "parameters": [ { "name": "symbol", "in": "query", - "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: indexSymbol](https://www.kucoin.com/docs-new/api-3470220) ", + "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) ", "required": true, "schema": { - "type": "string", - "example": [ - ".KXBTUSDT", - ".BXBT" - ] - } - }, - { - "name": "startAt", - "in": "query", - "description": "Start time (milisecond)", - "required": false, - "schema": { - "type": "integer", - "format": "int64" - } - }, - { - "name": "endAt", - "in": "query", - "description": "End time (milisecond)", - "required": false, - "schema": { - "type": "integer", - "format": "int64" - } - }, - { - "name": "reverse", - "in": "query", - "description": "This parameter functions to judge whether the lookup is reverse. True means “yes”. False means no. This parameter is set as True by default.", - "required": false, - "schema": { - "type": "boolean", - "default": true - } - }, - { - "name": "offset", - "in": "query", - "description": "Start offset. The unique attribute of the last returned result of the last request. The data of the first page will be returned by default.", - "required": false, - "schema": { - "type": "integer", - "format": "int64" - } - }, - { - "name": "forward", - "in": "query", - "description": "This parameter functions to judge whether the lookup is forward or not. True means “yes” and False means “no”. This parameter is set as true by default", - "required": false, - "schema": { - "type": "boolean", - "default": true - } - }, - { - "name": "maxCount", - "in": "query", - "description": "Max record count. The default record count is 10, The maximum length cannot exceed 100", - "required": false, - "schema": { - "type": "integer", - "format": "int64", - "default": 10, - "maximum": 100 - } - } - ], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "data": { - "type": "object", - "properties": { - "dataList": { - "type": "array", - "items": { - "type": "object", - "properties": { - "symbol": { - "type": "string", - "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: indexSymbol](https://www.kucoin.com/docs-new/api-3470220) " - }, - "granularity": { - "type": "integer", - "description": "Granularity (milisecond)" - }, - "timePoint": { - "type": "integer", - "description": "Timestamp (milisecond)", - "format": "int64" - }, - "value": { - "type": "number", - "description": "Index Value" - }, - "decomposionList": { - "type": "array", - "items": { - "type": "object", - "properties": { - "exchange": { - "type": "string", - "description": "Exchange" - }, - "price": { - "type": "number", - "description": "Price" - }, - "weight": { - "type": "number", - "description": "Weight" - } - }, - "required": [ - "exchange", - "price", - "weight" - ] - }, - "description": "Component List" - } - }, - "required": [ - "symbol", - "granularity", - "timePoint", - "value", - "decomposionList" - ] - } - }, - "hasMore": { - "type": "boolean", - "description": "Whether there are more pages" - } - }, - "required": [ - "dataList", - "hasMore" - ] - } - }, - "required": [ - "code", - "data" - ] - } - } - } - } - }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470231", - "x-abandon": "normal", - "x-domain": "Futures", - "x-api-channel": "Public", - "x-api-permission": "NULL", - "x-api-rate-limit-pool": "Public", - "x-sdk-service": "Futures", - "x-sdk-sub-service": "Market", - "x-sdk-method-name": "getSpotIndexPrice", - "x-sdk-method-description": "Get Spot Index Price", - "x-api-rate-limit": 2, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"hasMore\\\": true,\\n \\\"dataList\\\": [\\n {\\n \\\"symbol\\\": \\\".KXBTUSDT\\\",\\n \\\"granularity\\\": 1000,\\n \\\"timePoint\\\": 1730557515000,\\n \\\"value\\\": 69202.94,\\n \\\"decomposionList\\\": [\\n {\\n \\\"exchange\\\": \\\"gateio\\\",\\n \\\"price\\\": 69209.27,\\n \\\"weight\\\": 0.0533\\n },\\n {\\n \\\"exchange\\\": \\\"bitmart\\\",\\n \\\"price\\\": 69230.77,\\n \\\"weight\\\": 0.0128\\n },\\n {\\n \\\"exchange\\\": \\\"okex\\\",\\n \\\"price\\\": 69195.34,\\n \\\"weight\\\": 0.11\\n },\\n {\\n \\\"exchange\\\": \\\"bybit\\\",\\n \\\"price\\\": 69190.33,\\n \\\"weight\\\": 0.0676\\n },\\n {\\n \\\"exchange\\\": \\\"binance\\\",\\n \\\"price\\\": 69204.55,\\n \\\"weight\\\": 0.6195\\n },\\n {\\n \\\"exchange\\\": \\\"kucoin\\\",\\n \\\"price\\\": 69202.91,\\n \\\"weight\\\": 0.1368\\n }\\n ]\\n },\\n {\\n \\\"symbol\\\": \\\".KXBTUSDT\\\",\\n \\\"granularity\\\": 1000,\\n \\\"timePoint\\\": 1730557514000,\\n \\\"value\\\": 69204.98,\\n \\\"decomposionList\\\": [\\n {\\n \\\"exchange\\\": \\\"gateio\\\",\\n \\\"price\\\": 69212.71,\\n \\\"weight\\\": 0.0808\\n },\\n {\\n \\\"exchange\\\": \\\"bitmart\\\",\\n \\\"price\\\": 69230.77,\\n \\\"weight\\\": 0.0134\\n },\\n {\\n \\\"exchange\\\": \\\"okex\\\",\\n \\\"price\\\": 69195.49,\\n \\\"weight\\\": 0.0536\\n },\\n {\\n \\\"exchange\\\": \\\"bybit\\\",\\n \\\"price\\\": 69195.97,\\n \\\"weight\\\": 0.0921\\n },\\n {\\n \\\"exchange\\\": \\\"binance\\\",\\n \\\"price\\\": 69204.56,\\n \\\"weight\\\": 0.5476\\n },\\n {\\n \\\"exchange\\\": \\\"kucoin\\\",\\n \\\"price\\\": 69207.8,\\n \\\"weight\\\": 0.2125\\n }\\n ]\\n }\\n ]\\n }\\n}", - "x-request-example": "{\\\"symbol\\\": \\\".KXBTUSDT\\\", \\\"startAt\\\": 123456, \\\"endAt\\\": 123456, \\\"reverse\\\": true, \\\"offset\\\": 123456, \\\"forward\\\": true, \\\"maxCount\\\": 10}" - } - }, - "/api/v1/trade/history": { - "get": { - "summary": "Get Trade History", - "deprecated": false, - "description": "Request via this endpoint to get the trade history of the specified symbol, the returned quantity is the last 100 transaction records.", - "tags": [], - "parameters": [ - { - "name": "symbol", - "in": "query", - "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) ", - "required": true, - "schema": { - "type": "string" + "type": "string" } } ], @@ -2228,92 +1529,6 @@ "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDM\\\"}" } }, - "/api/v1/mark-price/{symbol}/current": { - "get": { - "summary": "Get Mark Price", - "deprecated": false, - "description": "Get current mark price", - "tags": [], - "parameters": [ - { - "name": "symbol", - "in": "path", - "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) ", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "data": { - "type": "object", - "properties": { - "symbol": { - "type": "string", - "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) " - }, - "granularity": { - "type": "integer", - "description": "Granularity (milisecond)" - }, - "timePoint": { - "type": "integer", - "description": "Time point (milisecond)", - "format": "int64" - }, - "value": { - "type": "number", - "description": "Mark price" - }, - "indexPrice": { - "type": "number", - "description": "Index price" - } - }, - "required": [ - "symbol", - "granularity", - "timePoint", - "value", - "indexPrice" - ] - } - }, - "required": [ - "code", - "data" - ] - } - } - } - } - }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470233", - "x-abandon": "normal", - "x-domain": "Futures", - "x-api-channel": "Public", - "x-api-permission": "NULL", - "x-api-rate-limit-pool": "Public", - "x-sdk-service": "Futures", - "x-sdk-sub-service": "Market", - "x-sdk-method-name": "getMarkPrice", - "x-sdk-method-description": "Get current mark price", - "x-api-rate-limit": 3, - "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"symbol\\\":\\\"XBTUSDTM\\\",\\\"granularity\\\":1000,\\\"timePoint\\\":1729254307000,\\\"value\\\":67687.08,\\\"indexPrice\\\":67683.58}}", - "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDTM\\\"}" - } - }, "/api/v1/kline/query": { "get": { "summary": "Get Klines", @@ -2483,13 +1698,23 @@ "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDTM\\\", \\\"granularity\\\": 1, \\\"from\\\": 1728552342000, \\\"to\\\": 1729243542000}" } }, - "/api/v1/orders": { - "post": { - "summary": "Add Order", + "/api/v1/mark-price/{symbol}/current": { + "get": { + "summary": "Get Mark Price", "deprecated": false, - "description": "Place order to the futures trading system, you can place two major types of orders: limit and market. Orders can only be placed if your account has sufficient funds. Once an order is placed, your funds will be put on hold for the duration of the order. The amount of funds on hold depends on the order type and parameters specified.", + "description": "Get current mark price", "tags": [], - "parameters": [], + "parameters": [ + { + "name": "symbol", + "in": "path", + "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) ", + "required": true, + "schema": { + "type": "string" + } + } + ], "responses": { "200": { "description": "", @@ -2504,18 +1729,34 @@ "data": { "type": "object", "properties": { - "orderId": { + "symbol": { "type": "string", - "description": "The unique order id generated by the trading system,which can be used later for further actions such as canceling the order." + "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) " }, - "clientOid": { - "type": "string", - "description": "The user self-defined order id." + "granularity": { + "type": "integer", + "description": "Granularity (milisecond)" + }, + "timePoint": { + "type": "integer", + "description": "Time point (milisecond)", + "format": "int64" + }, + "value": { + "type": "number", + "description": "Mark price" + }, + "indexPrice": { + "type": "number", + "description": "Index price" } }, "required": [ - "orderId", - "clientOid" + "symbol", + "granularity", + "timePoint", + "value", + "indexPrice" ] } }, @@ -2528,368 +1769,393 @@ } } }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470235", + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470233", "x-abandon": "normal", "x-domain": "Futures", - "x-api-channel": "Private", - "x-api-permission": "Futures", - "x-api-rate-limit-pool": "Futures", + "x-api-channel": "Public", + "x-api-permission": "NULL", + "x-api-rate-limit-pool": "Public", "x-sdk-service": "Futures", - "x-sdk-sub-service": "Order", - "x-sdk-method-name": "addOrder", - "x-sdk-method-description": "Place order to the futures trading system, you can place two major types of orders: limit and market. Orders can only be placed if your account has sufficient funds. Once an order is placed, your funds will be put on hold for the duration of the order. The amount of funds on hold depends on the order type and parameters specified.", - "x-api-rate-limit": 2, - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "clientOid": { - "type": "string", - "description": "Unique order id created by users to identify their orders, the maximum length cannot exceed 40, e.g. UUID, Only allows numbers, characters, underline(_), and separator(-)", - "example": [ - "5c52e11203aa677f33e493fb" - ] - }, - "side": { - "type": "string", - "description": "specify if the order is to 'buy' or 'sell'", - "enum": [ - "buy", - "sell" - ], - "x-api-enum": [ - { - "value": "buy", - "name": "", - "description": "" + "x-sdk-sub-service": "Market", + "x-sdk-method-name": "getMarkPrice", + "x-sdk-method-description": "Get current mark price", + "x-api-rate-limit": 3, + "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"symbol\\\":\\\"XBTUSDTM\\\",\\\"granularity\\\":1000,\\\"timePoint\\\":1729254307000,\\\"value\\\":67687.08,\\\"indexPrice\\\":67683.58}}", + "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDTM\\\"}" + } + }, + "/api/v1/index/query": { + "get": { + "summary": "Get Spot Index Price", + "deprecated": false, + "description": "Get Spot Index Price", + "tags": [], + "parameters": [ + { + "name": "symbol", + "in": "query", + "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: indexSymbol](https://www.kucoin.com/docs-new/api-3470220) ", + "required": true, + "schema": { + "type": "string", + "example": [ + ".KXBTUSDT", + ".BXBT" + ] + } + }, + { + "name": "startAt", + "in": "query", + "description": "Start time (milisecond)", + "required": false, + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "endAt", + "in": "query", + "description": "End time (milisecond)", + "required": false, + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "reverse", + "in": "query", + "description": "This parameter functions to judge whether the lookup is reverse. True means “yes”. False means no. This parameter is set as True by default.", + "required": false, + "schema": { + "type": "boolean", + "default": true + } + }, + { + "name": "offset", + "in": "query", + "description": "Start offset. The unique attribute of the last returned result of the last request. The data of the first page will be returned by default.", + "required": false, + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "forward", + "in": "query", + "description": "This parameter functions to judge whether the lookup is forward or not. True means “yes” and False means “no”. This parameter is set as true by default", + "required": false, + "schema": { + "type": "boolean", + "default": true + } + }, + { + "name": "maxCount", + "in": "query", + "description": "Max record count. The default record count is 10, The maximum length cannot exceed 100", + "required": false, + "schema": { + "type": "integer", + "format": "int64", + "default": 10, + "maximum": 100 + } + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "object", + "properties": { + "dataList": { + "type": "array", + "items": { + "type": "object", + "properties": { + "symbol": { + "type": "string", + "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: indexSymbol](https://www.kucoin.com/docs-new/api-3470220) " + }, + "granularity": { + "type": "integer", + "description": "Granularity (milisecond)" + }, + "timePoint": { + "type": "integer", + "description": "Timestamp (milisecond)", + "format": "int64" + }, + "value": { + "type": "number", + "description": "Index Value" + }, + "decomposionList": { + "type": "array", + "items": { + "type": "object", + "properties": { + "exchange": { + "type": "string", + "description": "Exchange" + }, + "price": { + "type": "number", + "description": "Price" + }, + "weight": { + "type": "number", + "description": "Weight" + } + }, + "required": [ + "exchange", + "price", + "weight" + ] + }, + "description": "Component List" + } + }, + "required": [ + "symbol", + "granularity", + "timePoint", + "value", + "decomposionList" + ] + } + }, + "hasMore": { + "type": "boolean", + "description": "Whether there are more pages" + } }, - { - "value": "sell", - "name": "", - "description": "" - } - ], - "example": [ - "buy" - ] - }, - "symbol": { - "type": "string", - "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) ", - "example": [ - "XBTUSDTM" - ] - }, - "leverage": { - "type": "integer", - "description": "Used to calculate the margin to be frozen for the order. If you are to close the position, this parameter is not required.", - "example": [ - 3 - ] + "required": [ + "dataList", + "hasMore" + ] + } }, - "type": { - "type": "string", - "description": "specify if the order is an 'limit' order or 'market' order", - "enum": [ - "limit", - "market" - ], - "default": "limit", - "x-api-enum": [ - { - "value": "limit", - "name": "", - "description": "" - }, - { - "value": "market", - "name": "", - "description": "" - } - ], - "example": [ - "limit" - ] - }, - "remark": { - "type": "string", - "description": "remark for the order, length cannot exceed 100 utf8 characters" - }, - "stop": { - "type": "string", - "description": "Either 'down' or 'up'. If stop is used,parameter stopPrice and stopPriceType also need to be provieded.", - "enum": [ - "down", - "up" - ], - "x-api-enum": [ - { - "value": "down", - "name": "down", - "description": "Triggers when the price reaches or goes below the stopPrice." - }, - { - "value": "up", - "name": "up", - "description": "Triggers when the price reaches or goes above the stopPrice" - } - ] - }, - "stopPriceType": { - "type": "string", - "description": "Either 'TP', 'IP' or 'MP', Need to be defined if stop is specified.", - "enum": [ - "TP", - "MP", - "IP" - ], - "x-api-enum": [ - { - "value": "TP", - "name": "trade price", - "description": "TP for trade price, The last trade price is the last price at which an order was filled. This price can be found in the latest match message." - }, - { - "value": "MP", - "name": "mark price", - "description": "MP for mark price, The mark price can be obtained through relevant OPEN API for index services" - }, - { - "value": "IP", - "name": "index price", - "description": "IP for index price, The index price can be obtained through relevant OPEN API for index services" - } - ] - }, - "stopPrice": { - "type": "string", - "description": "Need to be defined if stop is specified. " - }, - "reduceOnly": { - "type": "boolean", - "description": "A mark to reduce the position size only. Set to false by default. Need to set the position size when reduceOnly is true. If set to true, only the orders reducing the position size will be executed. If the reduce-only order size exceeds the position size, the extra size will be canceled.", - "default": false - }, - "closeOrder": { - "type": "boolean", - "description": "A mark to close the position. Set to false by default. If closeOrder is set to true, the system will close the position and the position size will become 0. Side, Size and Leverage fields can be left empty and the system will determine the side and size automatically.", - "default": false - }, - "forceHold": { - "type": "boolean", - "description": "A mark to forcely hold the funds for an order, even though it's an order to reduce the position size. This helps the order stay on the order book and not get canceled when the position size changes. Set to false by default. The system will forcely freeze certain amount of funds for this order, including orders whose direction is opposite to the current positions. This feature is to ensure that the order won’t be canceled by the matching engine in such a circumstance that not enough funds are frozen for the order.", - "default": false - }, - "stp": { - "type": "string", - "description": "[Self Trade Prevention](https://www.kucoin.com/docs-new/doc-338146) is divided into these strategies: CN, CO, CB. Not supported DC at the moment.", - "enum": [ - "CN", - "CO", - "CB" - ], - "x-api-enum": [ - { - "value": "CN", - "name": "CN", - "description": "Cancel new, Cancel the new order" - }, - { - "value": "CO", - "name": "CO", - "description": "Cancel old, Cancel the old order" - }, - { - "value": "CB", - "name": "CB", - "description": "Cancel both, Cancel both sides" - } - ] - }, - "marginMode": { - "type": "string", - "description": "Margin mode: ISOLATED, CROSS, default: ISOLATED", - "enum": [ - "ISOLATED", - "CROSS" - ], - "default": "ISOLATED", - "x-api-enum": [ - { - "value": "ISOLATED", - "name": "ISOLATED", - "description": "Isolated Margin" - }, - { - "value": "CROSS", - "name": "CROSS", - "description": "Cross Margin" - } - ] - }, - "price": { - "type": "string", - "description": "Required for type is 'limit' order, indicating the operating price", - "example": [ - "0.1" - ] - }, - "size": { - "type": "integer", - "description": "**Choose one of size, qty, valueQty**, Order size (Lot), must be a positive integer. The quantity unit of coin-swap contracts is size(lot), and other units are not supported." - }, - "timeInForce": { - "type": "string", - "description": "Optional for type is 'limit' order, [Time in force](https://www.kucoin.com/docs-new/doc-338146) is a special strategy used during trading, default is GTC", - "enum": [ - "GTC", - "IOC" - ], - "default": "GTC", - "x-api-enum": [ - { - "value": "GTC", - "name": "Good Till Canceled", - "description": "order remains open on the order book until canceled. This is the default type if the field is left empty." - }, - { - "value": "IOC", - "name": "Immediate Or Cancel", - "description": "being matched or not, the remaining size of the order will be instantly canceled instead of entering the order book." - } - ] - }, - "postOnly": { - "type": "boolean", - "description": "Optional for type is 'limit' order, post only flag, invalid when timeInForce is IOC. When postOnly is true, not allowed choose hidden or iceberg. The post-only flag ensures that the trader always pays the maker fee and provides liquidity to the order book. If any part of the order is going to pay taker fee, the order will be fully rejected.", - "default": false - }, - "hidden": { - "type": "boolean", - "description": "Optional for type is 'limit' order, orders not displaying in order book. When hidden chose, not allowed choose postOnly.", - "default": false - }, - "iceberg": { - "type": "boolean", - "description": "Optional for type is 'limit' order, Only visible portion of the order is displayed in the order book. When iceberg chose, not allowed choose postOnly.", - "default": false - }, - "visibleSize": { - "type": "string", - "description": "Optional for type is 'limit' order, The maximum visible size of an iceberg order. please place order in size (lots), The units of qty (base currency) and valueQty (value) are not supported." - }, - "qty": { - "type": "string", - "description": "**Choose one of size, qty, valueQty**, Order size (Base currency) must be an integer multiple of the multiplier. The unit of the quantity of coin-swap is size(lot), which is not supported" - }, - "valueQty": { - "type": "string", - "description": "**Choose one of size, qty, valueQty**, Order size (Value), USDS-Swap correspond to USDT or USDC. The unit of the quantity of coin-swap is size(lot), which is not supported" - } - }, - "required": [ - "clientOid", - "symbol", - "side", - "leverage" - ] - }, - "example": "{\n \"clientOid\": \"5c52e11203aa677f33e493fb\",\n \"side\": \"buy\",\n \"symbol\": \"XBTUSDTM\",\n \"leverage\": 3,\n \"type\": \"limit\",\n \"remark\": \"order remarks\",\n \"reduceOnly\": false,\n \"marginMode\": \"ISOLATED\",\n \"price\": \"0.1\",\n \"size\": 1,\n \"timeInForce\": \"GTC\"\n}" + "required": [ + "code", + "data" + ] + } + } } } }, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"orderId\\\": \\\"234125150956625920\\\",\\n \\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\"\\n }\\n}", - "x-request-example": "{\\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\", \\\"side\\\": \\\"buy\\\", \\\"symbol\\\": \\\"XBTUSDTM\\\", \\\"leverage\\\": 3, \\\"type\\\": \\\"limit\\\", \\\"remark\\\": \\\"order remarks\\\", \\\"reduceOnly\\\": false, \\\"marginMode\\\": \\\"ISOLATED\\\", \\\"price\\\": \\\"0.1\\\", \\\"size\\\": 1, \\\"timeInForce\\\": \\\"GTC\\\"}" - }, + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470231", + "x-abandon": "normal", + "x-domain": "Futures", + "x-api-channel": "Public", + "x-api-permission": "NULL", + "x-api-rate-limit-pool": "Public", + "x-sdk-service": "Futures", + "x-sdk-sub-service": "Market", + "x-sdk-method-name": "getSpotIndexPrice", + "x-sdk-method-description": "Get Spot Index Price", + "x-api-rate-limit": 2, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"hasMore\\\": true,\\n \\\"dataList\\\": [\\n {\\n \\\"symbol\\\": \\\".KXBTUSDT\\\",\\n \\\"granularity\\\": 1000,\\n \\\"timePoint\\\": 1730557515000,\\n \\\"value\\\": 69202.94,\\n \\\"decomposionList\\\": [\\n {\\n \\\"exchange\\\": \\\"gateio\\\",\\n \\\"price\\\": 69209.27,\\n \\\"weight\\\": 0.0533\\n },\\n {\\n \\\"exchange\\\": \\\"bitmart\\\",\\n \\\"price\\\": 69230.77,\\n \\\"weight\\\": 0.0128\\n },\\n {\\n \\\"exchange\\\": \\\"okex\\\",\\n \\\"price\\\": 69195.34,\\n \\\"weight\\\": 0.11\\n },\\n {\\n \\\"exchange\\\": \\\"bybit\\\",\\n \\\"price\\\": 69190.33,\\n \\\"weight\\\": 0.0676\\n },\\n {\\n \\\"exchange\\\": \\\"binance\\\",\\n \\\"price\\\": 69204.55,\\n \\\"weight\\\": 0.6195\\n },\\n {\\n \\\"exchange\\\": \\\"kucoin\\\",\\n \\\"price\\\": 69202.91,\\n \\\"weight\\\": 0.1368\\n }\\n ]\\n },\\n {\\n \\\"symbol\\\": \\\".KXBTUSDT\\\",\\n \\\"granularity\\\": 1000,\\n \\\"timePoint\\\": 1730557514000,\\n \\\"value\\\": 69204.98,\\n \\\"decomposionList\\\": [\\n {\\n \\\"exchange\\\": \\\"gateio\\\",\\n \\\"price\\\": 69212.71,\\n \\\"weight\\\": 0.0808\\n },\\n {\\n \\\"exchange\\\": \\\"bitmart\\\",\\n \\\"price\\\": 69230.77,\\n \\\"weight\\\": 0.0134\\n },\\n {\\n \\\"exchange\\\": \\\"okex\\\",\\n \\\"price\\\": 69195.49,\\n \\\"weight\\\": 0.0536\\n },\\n {\\n \\\"exchange\\\": \\\"bybit\\\",\\n \\\"price\\\": 69195.97,\\n \\\"weight\\\": 0.0921\\n },\\n {\\n \\\"exchange\\\": \\\"binance\\\",\\n \\\"price\\\": 69204.56,\\n \\\"weight\\\": 0.5476\\n },\\n {\\n \\\"exchange\\\": \\\"kucoin\\\",\\n \\\"price\\\": 69207.8,\\n \\\"weight\\\": 0.2125\\n }\\n ]\\n }\\n ]\\n }\\n}", + "x-request-example": "{\\\"symbol\\\": \\\".KXBTUSDT\\\", \\\"startAt\\\": 123456, \\\"endAt\\\": 123456, \\\"reverse\\\": true, \\\"offset\\\": 123456, \\\"forward\\\": true, \\\"maxCount\\\": 10}" + } + }, + "/api/v1/interest/query": { "get": { - "summary": "Get Order List", + "summary": "Get Interest Rate Index", "deprecated": false, - "description": "List your current orders.", + "description": "Get interest rate Index.", "tags": [], "parameters": [ { - "name": "status", + "name": "symbol", "in": "query", - "description": "active or done, done as default. Only list orders for a specific status", + "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: fundingBaseSymbol, fundingQuoteSymbol, fundingBaseSymbol1M, fundingQuoteSymbol1M](https://www.kucoin.com/docs-new/api-3470220) ", "required": true, "schema": { "type": "string", - "enum": [ - "active", - "done" - ], - "x-api-enum": [ - { - "value": "active", - "name": "", - "description": "" - }, - { - "value": "done", - "name": "", - "description": "" - } + "example": [ + ".XBTINT8H", + ".USDTINT8H", + ".XBTINT", + ".USDTINT" ] } }, { - "name": "symbol", + "name": "startAt", "in": "query", - "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) ", + "description": "Start time (milisecond)", "required": false, "schema": { - "type": "string" + "type": "integer", + "format": "int64" } }, { - "name": "side", + "name": "endAt", "in": "query", - "description": "buy or sell", - "required": true, - "schema": { - "type": "string", - "enum": [ - "buy", - "sell" - ], - "x-api-enum": [ - { - "value": "buy", - "name": "", - "description": "" - }, - { - "value": "sell", - "name": "", - "description": "" - } - ] + "description": "End time (milisecond)", + "required": false, + "schema": { + "type": "integer", + "format": "int64" } }, { - "name": "type", + "name": "reverse", "in": "query", - "description": "limit, market, limit_stop or market_stop", + "description": "This parameter functions to judge whether the lookup is reverse. True means “yes”. False means no. This parameter is set as True by default.", + "required": false, + "schema": { + "type": "boolean", + "default": true + } + }, + { + "name": "offset", + "in": "query", + "description": "Start offset. The unique attribute of the last returned result of the last request. The data of the first page will be returned by default.", + "required": false, + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "forward", + "in": "query", + "description": "This parameter functions to judge whether the lookup is forward or not. True means “yes” and False means “no”. This parameter is set as true by default", + "required": false, + "schema": { + "type": "boolean", + "default": true + } + }, + { + "name": "maxCount", + "in": "query", + "description": "Max record count. The default record count is 10, The maximum length cannot exceed 100", + "required": false, + "schema": { + "type": "integer", + "format": "int64", + "default": 10, + "maximum": 100 + } + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "object", + "properties": { + "dataList": { + "type": "array", + "items": { + "type": "object", + "properties": { + "symbol": { + "type": "string", + "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: fundingBaseSymbol, fundingQuoteSymbol, fundingBaseSymbol1M, fundingQuoteSymbol1M](https://www.kucoin.com/docs-new/api-3470220) " + }, + "granularity": { + "type": "integer", + "description": "Granularity (milisecond)" + }, + "timePoint": { + "type": "integer", + "description": "Timestamp(milisecond)", + "format": "int64" + }, + "value": { + "type": "number", + "description": "Interest rate value" + } + }, + "required": [ + "symbol", + "granularity", + "timePoint", + "value" + ] + } + }, + "hasMore": { + "type": "boolean", + "description": "Whether there are more pages" + } + }, + "required": [ + "dataList", + "hasMore" + ] + } + }, + "required": [ + "code", + "data" + ] + } + } + } + } + }, + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470226", + "x-abandon": "normal", + "x-domain": "Futures", + "x-api-channel": "Public", + "x-api-permission": "NULL", + "x-api-rate-limit-pool": "Public", + "x-sdk-service": "Futures", + "x-sdk-sub-service": "Market", + "x-sdk-method-name": "getInterestRateIndex", + "x-sdk-method-description": "Get interest rate Index.", + "x-api-rate-limit": 5, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"dataList\\\": [\\n {\\n \\\"symbol\\\": \\\".XBTINT\\\",\\n \\\"granularity\\\": 60000,\\n \\\"timePoint\\\": 1728692100000,\\n \\\"value\\\": 3.0E-4\\n },\\n {\\n \\\"symbol\\\": \\\".XBTINT\\\",\\n \\\"granularity\\\": 60000,\\n \\\"timePoint\\\": 1728692040000,\\n \\\"value\\\": 3.0E-4\\n }\\n ],\\n \\\"hasMore\\\": true\\n }\\n}", + "x-request-example": "{\\\"symbol\\\": \\\".XBTINT8H\\\", \\\"startAt\\\": 1728663338000, \\\"endAt\\\": 1728692138000, \\\"reverse\\\": true, \\\"offset\\\": 254062248624417, \\\"forward\\\": true, \\\"maxCount\\\": 10}" + } + }, + "/api/v1/premium/query": { + "get": { + "summary": "Get Premium Index", + "deprecated": false, + "description": "Submit request to get premium index.", + "tags": [], + "parameters": [ + { + "name": "symbol", + "in": "query", + "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: premiumsSymbol1M, premiumsSymbol8H](https://www.kucoin.com/docs-new/api-3470220) ", "required": true, "schema": { "type": "string", - "enum": [ - "limit", - "market" - ], - "x-api-enum": [ - { - "value": "limit", - "name": "", - "description": "" - }, - { - "value": "market", - "name": "", - "description": "" - } + "example": [ + ".XBTUSDTMPI", + ".XBTUSDTMPI8H" ] } }, @@ -2914,21 +2180,45 @@ } }, { - "name": "currentPage", + "name": "reverse", "in": "query", - "description": "Current request page, The default currentPage is 1", - "required": true, + "description": "This parameter functions to judge whether the lookup is reverse. True means “yes”. False means no. This parameter is set as True by default.", + "required": false, "schema": { - "type": "integer" + "type": "boolean", + "default": true } }, { - "name": "pageSize", + "name": "offset", "in": "query", - "description": "pageSize, The default pageSize is 50, The maximum cannot exceed 1000", - "required": true, + "description": "Start offset. The unique attribute of the last returned result of the last request. The data of the first page will be returned by default.", + "required": false, "schema": { - "type": "integer" + "type": "integer", + "format": "int64" + } + }, + { + "name": "forward", + "in": "query", + "description": "This parameter functions to judge whether the lookup is forward or not. True means “yes” and False means “no”. This parameter is set as true by default", + "required": false, + "schema": { + "type": "boolean", + "default": true + } + }, + { + "name": "maxCount", + "in": "query", + "description": "Max record count. The default record count is 10, The maximum length cannot exceed 100", + "required": false, + "schema": { + "type": "integer", + "format": "int64", + "default": 10, + "maximum": 100 } } ], @@ -2946,231 +2236,45 @@ "data": { "type": "object", "properties": { - "currentPage": { - "type": "integer", - "description": "Current request page, The default currentPage is 1" - }, - "pageSize": { - "type": "integer", - "description": "pageSize, The default pageSize is 50, The maximum cannot exceed 1000" - }, - "totalNum": { - "type": "integer" - }, - "totalPage": { - "type": "integer" - }, - "items": { + "dataList": { "type": "array", "items": { "type": "object", "properties": { - "id": { - "type": "string", - "description": "Order ID" - }, "symbol": { "type": "string", - "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) " - }, - "type": { - "type": "string", - "description": "Order type, market order or limit order\n" - }, - "side": { - "type": "string", - "description": "Transaction side" + "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: premiumsSymbol1M, premiumsSymbol8H](https://www.kucoin.com/docs-new/api-3470220) " }, - "price": { - "type": "string", - "description": "Order price" + "granularity": { + "type": "integer", + "description": "Granularity(milisecond)" }, - "size": { + "timePoint": { "type": "integer", - "description": "Order quantity" + "description": "Timestamp(milisecond)", + "format": "int64" }, "value": { - "type": "string", - "description": "Order value" - }, - "dealValue": { - "type": "string", - "description": "Executed size of funds\n" - }, - "dealSize": { - "type": "integer", - "description": "Executed quantity" - }, - "stp": { - "type": "string", - "description": "self trade prevention" - }, - "stop": { - "type": "string", - "description": "Stop order type (stop limit or stop market)" - }, - "stopPriceType": { - "type": "string", - "description": "Trigger price type of stop orders" - }, - "stopTriggered": { - "type": "boolean", - "description": "Mark to show whether the stop order is triggered" - }, - "stopPrice": { - "type": "integer", - "description": "Trigger price of stop orders" - }, - "timeInForce": { - "type": "string", - "description": "Time in force policy type" - }, - "postOnly": { - "type": "boolean", - "description": "Mark of post only" - }, - "hidden": { - "type": "boolean", - "description": "Mark of the hidden order" - }, - "iceberg": { - "type": "boolean", - "description": "Mark of the iceberg order" - }, - "leverage": { - "type": "string", - "description": "Leverage of the order" - }, - "forceHold": { - "type": "boolean", - "description": "A mark to forcely hold the funds for an order" - }, - "closeOrder": { - "type": "boolean", - "description": "A mark to close the position" - }, - "visibleSize": { - "type": "integer", - "description": "Visible size of the iceberg order" - }, - "clientOid": { - "type": "string", - "description": "Unique order id created by users to identify their orders" - }, - "remark": { - "type": "string", - "description": "Remark of the order" - }, - "tags": { - "type": "string", - "description": "tag order source" - }, - "isActive": { - "type": "boolean", - "description": "Mark of the active orders" - }, - "cancelExist": { - "type": "boolean", - "description": "Mark of the canceled orders" - }, - "createdAt": { - "type": "integer", - "description": "Time the order created", - "format": "int64" - }, - "updatedAt": { - "type": "integer", - "description": "last update time", - "format": "int64" - }, - "endAt": { - "type": "integer", - "description": "End time", - "format": "int64" - }, - "orderTime": { - "type": "integer", - "description": "Order create time in nanosecond", - "format": "int64" - }, - "settleCurrency": { - "type": "string", - "description": "settlement currency" - }, - "marginMode": { - "type": "string", - "description": "Margin mode: ISOLATED (isolated), CROSS (cross margin)." - }, - "avgDealPrice": { - "type": "string", - "description": "Average transaction price, forward contract average transaction price = sum (transaction value) / sum (transaction quantity), reverse contract average transaction price = sum (transaction quantity) / sum (transaction value). Transaction quantity = lots * multiplier" - }, - "status": { - "type": "string", - "description": "order status: “open” or “done”" - }, - "filledSize": { - "type": "integer", - "description": "Value of the executed orders" - }, - "filledValue": { - "type": "string", - "description": "Executed order quantity" - }, - "reduceOnly": { - "type": "boolean", - "description": "A mark to reduce the position size only" + "type": "number", + "description": "Premium index" } }, "required": [ - "id", "symbol", - "type", - "side", - "price", - "size", - "value", - "dealValue", - "dealSize", - "stp", - "stop", - "stopPriceType", - "stopTriggered", - "stopPrice", - "timeInForce", - "postOnly", - "hidden", - "iceberg", - "leverage", - "forceHold", - "closeOrder", - "visibleSize", - "clientOid", - "remark", - "tags", - "isActive", - "cancelExist", - "createdAt", - "updatedAt", - "endAt", - "orderTime", - "settleCurrency", - "marginMode", - "avgDealPrice", - "status", - "filledSize", - "filledValue", - "reduceOnly" + "granularity", + "timePoint", + "value" ] } + }, + "hasMore": { + "type": "boolean", + "description": "Whether there are more pages" } }, "required": [ - "currentPage", - "pageSize", - "totalNum", - "totalPage", - "items" + "dataList", + "hasMore" ] } }, @@ -3183,36 +2287,28 @@ } } }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470244", + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470227", "x-abandon": "normal", "x-domain": "Futures", - "x-api-channel": "Private", - "x-api-permission": "Futures", - "x-api-rate-limit-pool": "Futures", + "x-api-channel": "Public", + "x-api-permission": "NULL", + "x-api-rate-limit-pool": "Public", "x-sdk-service": "Futures", - "x-sdk-sub-service": "Order", - "x-sdk-method-name": "GetOrderList", - "x-sdk-method-description": "List your current orders.", - "x-api-rate-limit": 2, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"currentPage\\\": 1,\\n \\\"pageSize\\\": 50,\\n \\\"totalNum\\\": 1,\\n \\\"totalPage\\\": 1,\\n \\\"items\\\": [\\n {\\n \\\"id\\\": \\\"230181737576050688\\\",\\n \\\"symbol\\\": \\\"PEOPLEUSDTM\\\",\\n \\\"type\\\": \\\"limit\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"price\\\": \\\"0.05\\\",\\n \\\"size\\\": 10,\\n \\\"value\\\": \\\"5\\\",\\n \\\"dealValue\\\": \\\"0\\\",\\n \\\"dealSize\\\": 0,\\n \\\"stp\\\": \\\"\\\",\\n \\\"stop\\\": \\\"\\\",\\n \\\"stopPriceType\\\": \\\"\\\",\\n \\\"stopTriggered\\\": false,\\n \\\"stopPrice\\\": null,\\n \\\"timeInForce\\\": \\\"GTC\\\",\\n \\\"postOnly\\\": false,\\n \\\"hidden\\\": false,\\n \\\"iceberg\\\": false,\\n \\\"leverage\\\": \\\"1\\\",\\n \\\"forceHold\\\": false,\\n \\\"closeOrder\\\": false,\\n \\\"visibleSize\\\": 0,\\n \\\"clientOid\\\": \\\"5a80bd847f1811ef8a7faa665a37b3d7\\\",\\n \\\"remark\\\": null,\\n \\\"tags\\\": \\\"\\\",\\n \\\"isActive\\\": true,\\n \\\"cancelExist\\\": false,\\n \\\"createdAt\\\": 1727692804813,\\n \\\"updatedAt\\\": 1727692804813,\\n \\\"endAt\\\": null,\\n \\\"orderTime\\\": 1727692804808418000,\\n \\\"settleCurrency\\\": \\\"USDT\\\",\\n \\\"marginMode\\\": \\\"ISOLATED\\\",\\n \\\"avgDealPrice\\\": \\\"0\\\",\\n \\\"filledSize\\\": 0,\\n \\\"filledValue\\\": \\\"0\\\",\\n \\\"status\\\": \\\"open\\\",\\n \\\"reduceOnly\\\": false\\n }\\n ]\\n }\\n}", - "x-request-example": "{\\\"status\\\": \\\"done\\\", \\\"symbol\\\": \\\"example_string_default_value\\\", \\\"side\\\": \\\"buy\\\", \\\"type\\\": \\\"limit\\\", \\\"startAt\\\": 123456, \\\"endAt\\\": 123456, \\\"currentPage\\\": 123456, \\\"pageSize\\\": 123456}" - }, - "delete": { - "summary": "Cancel All Orders - V1", - "deprecated": true, - "description": "Cancel all open orders (excluding stop orders). The response is a list of orderIDs of the canceled orders.", + "x-sdk-sub-service": "Market", + "x-sdk-method-name": "getPremiumIndex", + "x-sdk-method-description": "Submit request to get premium index.", + "x-api-rate-limit": 3, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"hasMore\\\": true,\\n \\\"dataList\\\": [\\n {\\n \\\"symbol\\\": \\\".XBTUSDTMPI\\\",\\n \\\"granularity\\\": 60000,\\n \\\"timePoint\\\": 1730558040000,\\n \\\"value\\\": 0.00006\\n },\\n {\\n \\\"symbol\\\": \\\".XBTUSDTMPI\\\",\\n \\\"granularity\\\": 60000,\\n \\\"timePoint\\\": 1730557980000,\\n \\\"value\\\": -0.000025\\n }\\n ]\\n }\\n}", + "x-request-example": "{\\\"symbol\\\": \\\".XBTUSDTMPI\\\", \\\"startAt\\\": 1728663338000, \\\"endAt\\\": 1728692138000, \\\"reverse\\\": true, \\\"offset\\\": 254062248624417, \\\"forward\\\": true, \\\"maxCount\\\": 10}" + } + }, + "/api/v1/trade-statistics": { + "get": { + "summary": "Get 24hr Stats", + "deprecated": false, + "description": "Get the statistics of the platform futures trading volume in the last 24 hours.", "tags": [], - "parameters": [ - { - "name": "symbol", - "in": "query", - "description": "Cancel all limit orders for a specific contract only, If not specified, all the limit orders will be deleted, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) ", - "required": false, - "schema": { - "type": "string" - } - } - ], + "parameters": [], "responses": { "200": { "description": "", @@ -3227,16 +2323,13 @@ "data": { "type": "object", "properties": { - "cancelledOrderIds": { - "type": "array", - "items": { - "type": "string" - }, - "description": "Unique ID of the cancelled order" + "turnoverOf24h": { + "type": "number", + "description": "24-hour platform Futures trading volume. Unit is USD" } }, "required": [ - "cancelledOrderIds" + "turnoverOf24h" ] } }, @@ -3249,166 +2342,74 @@ } } }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470362", - "x-abandon": "abandon", + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470228", + "x-abandon": "normal", "x-domain": "Futures", - "x-api-channel": "Private", - "x-api-permission": "Futures", + "x-api-channel": "Public", + "x-api-permission": "NULL", "x-api-rate-limit-pool": "Futures", "x-sdk-service": "Futures", - "x-sdk-sub-service": "Order", - "x-sdk-method-name": "cancelAllOrdersV1", - "x-sdk-method-description": "Cancel all open orders (excluding stop orders). The response is a list of orderIDs of the canceled orders.", - "x-api-rate-limit": 200, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"cancelledOrderIds\\\": [\\n \\\"235919172150824960\\\",\\n \\\"235919172150824961\\\"\\n ]\\n }\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDTM\\\"}" + "x-sdk-sub-service": "Market", + "x-sdk-method-name": "get24hrStats", + "x-sdk-method-description": "Get the statistics of the platform futures trading volume in the last 24 hours.", + "x-api-rate-limit": 3, + "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"turnoverOf24h\\\":1.1155733413273683E9}}" } }, - "/api/v1/fills": { + "/api/v1/timestamp": { "get": { - "summary": "Get Trade History", + "summary": "Get Server Time", "deprecated": false, - "description": "Get a list of recent fills. If you need to get your recent trade history with low latency, please query endpoint Get List of Orders Completed in 24h. The requested data is not real-time.", + "description": "Get the API server time. This is the Unix timestamp.", "tags": [], - "parameters": [ - { - "name": "orderId", - "in": "query", - "description": "List fills for a specific order only (If you specify orderId, other parameters can be ignored)", - "required": false, - "schema": { - "type": "string" - } - }, - { - "name": "symbol", - "in": "query", - "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) ", - "required": false, - "schema": { - "type": "string" - } - }, - { - "name": "side", - "in": "query", - "description": "Order side", - "required": false, - "schema": { - "type": "string", - "enum": [ - "buy", - "sell" - ], - "x-api-enum": [ - { - "value": "buy", - "name": "buy", - "description": "buy" - }, - { - "value": "sell", - "name": "sell", - "description": "sell" - } - ] - } - }, - { - "name": "type", - "in": "query", - "description": "Order Type", - "required": false, - "schema": { - "type": "string", - "enum": [ - "limit", - "market", - "limit_stop", - "market_stop" - ], - "x-api-enum": [ - { - "value": "limit", - "name": "limit", - "description": "Limit order" - }, - { - "value": "market", - "name": "market", - "description": "Market order" - }, - { - "value": "limit_stop", - "name": "limit_stop", - "description": "Stop limit order" - }, - { - "value": "market_stop", - "name": "market_stop", - "description": "Stop Market order" + "parameters": [], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "integer", + "format": "int64", + "description": "ServerTime(millisecond)" + } + }, + "required": [ + "code", + "data" + ] } - ] - } - }, - { - "name": "tradeTypes", - "in": "query", - "description": "Transaction type: trade, adl, liquid, settlement. Supports querying multiple types at the same time, separated by commas. Query all type when empty", - "required": false, - "schema": { - "type": "string", - "example": [ - "trade", - "adl", - "liquid", - "settlement", - "adl,liquid" - ] - } - }, - { - "name": "startAt", - "in": "query", - "description": "Start time (milisecond)", - "required": false, - "schema": { - "type": "integer", - "format": "int64" - } - }, - { - "name": "endAt", - "in": "query", - "description": "End time (milisecond)", - "required": false, - "schema": { - "type": "integer", - "format": "int64" - } - }, - { - "name": "currentPage", - "in": "query", - "description": "Current request page, The default currentPage is 1", - "required": false, - "schema": { - "type": "integer", - "default": 1 - } - }, - { - "name": "pageSize", - "in": "query", - "description": "pageSize, The default pageSize is 50, The maximum cannot exceed 1000", - "required": false, - "schema": { - "type": "integer", - "default": 50, - "maximum": 1000 + } } } - ], + }, + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470229", + "x-abandon": "normal", + "x-domain": "Futures", + "x-api-channel": "Public", + "x-api-permission": "NULL", + "x-api-rate-limit-pool": "Public", + "x-sdk-service": "Futures", + "x-sdk-sub-service": "Market", + "x-sdk-method-name": "getServerTime", + "x-sdk-method-description": "Get the API server time. This is the Unix timestamp.", + "x-api-rate-limit": 2, + "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":1729260030774}" + } + }, + "/api/v1/status": { + "get": { + "summary": "Get Service Status", + "deprecated": false, + "description": "Get the service status.", + "tags": [], + "parameters": [], "responses": { "200": { "description": "", @@ -3423,276 +2424,39 @@ "data": { "type": "object", "properties": { - "currentPage": { - "type": "integer" - }, - "pageSize": { - "type": "integer" - }, - "totalNum": { - "type": "integer" - }, - "totalPage": { - "type": "integer" + "msg": { + "type": "string" }, - "items": { - "type": "array", - "items": { - "type": "object", - "properties": { - "symbol": { - "type": "string", - "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) " - }, - "tradeId": { - "type": "string", - "description": "Trade ID\n" - }, - "orderId": { - "type": "string", - "description": "Order ID\n" - }, - "side": { - "type": "string", - "description": "Transaction side", - "enum": [ - "buy", - "sell" - ], - "x-api-enum": [ - { - "value": "buy", - "name": "buy", - "description": "buy" - }, - { - "value": "sell", - "name": "sell", - "description": "sell" - } - ] - }, - "liquidity": { - "type": "string", - "description": "Liquidity- taker or maker", - "enum": [ - "taker", - "maker" - ], - "x-api-enum": [ - { - "value": "taker", - "name": "taker", - "description": "taker" - }, - { - "value": "maker", - "name": "maker", - "description": "maker" - } - ] - }, - "forceTaker": { - "type": "boolean", - "description": "Whether to force processing as a taker\n" - }, - "price": { - "type": "string", - "description": "Filled price" - }, - "size": { - "type": "integer", - "description": "Filled amount" - }, - "value": { - "type": "string", - "description": "Order value" - }, - "openFeePay": { - "type": "string", - "description": "Opening transaction fee" - }, - "closeFeePay": { - "type": "string", - "description": "Closing transaction fee" - }, - "stop": { - "type": "string", - "description": "A mark to the stop order type" - }, - "feeRate": { - "type": "string", - "description": "Fee Rate" - }, - "fixFee": { - "type": "string", - "description": "Fixed fees(Deprecated field, no actual use of the value field)" - }, - "feeCurrency": { - "type": "string", - "description": "Charging currency" - }, - "tradeTime": { - "type": "integer", - "description": "trade time in nanosecond", - "format": "int64" - }, - "subTradeType": { - "type": "string", - "description": "Deprecated field, no actual use of the value field" - }, - "marginMode": { - "type": "string", - "description": "Margin mode: ISOLATED (isolated), CROSS (cross margin).", - "enum": [ - "ISOLATED", - "CROSS" - ], - "x-api-enum": [ - { - "value": "ISOLATED", - "name": "ISOLATED", - "description": "Isolated Margin" - }, - { - "value": "CROSS", - "name": "CROSS", - "description": "Cross Margin" - } - ] - }, - "settleCurrency": { - "type": "string", - "description": "Settle Currency" - }, - "displayType": { - "type": "string", - "enum": [ - "limit", - "market", - "limit_stop", - "market_stop" - ], - "description": "Order Type", - "x-api-enum": [ - { - "value": "limit", - "name": "limit", - "description": "Limit order" - }, - { - "value": "market", - "name": "market", - "description": "Market order" - }, - { - "value": "limit_stop", - "name": "limit_stop", - "description": "Stop limit order" - }, - { - "value": "market_stop", - "name": "market_stop", - "description": "Stop Market order" - } - ] - }, - "fee": { - "type": "string" - }, - "orderType": { - "type": "string", - "description": "Order type", - "enum": [ - "market", - "limit" - ], - "x-api-enum": [ - { - "value": "market", - "name": "market", - "description": "market" - }, - { - "value": "limit", - "name": "limit", - "description": "limit" - } - ] - }, - "tradeType": { - "type": "string", - "description": "Trade type (trade, liquid, adl or settlement)\n", - "enum": [ - "trade", - "liquid", - "adl", - "settlement" - ], - "x-api-enum": [ - { - "value": "trade", - "name": "trade", - "description": "trade" - }, - { - "value": "liquid", - "name": "liquid", - "description": "liquid" - }, - { - "value": "adl", - "name": "adl", - "description": "adl" - }, - { - "value": "settlement", - "name": "settlement", - "description": "settlement" - } - ] - }, - "createdAt": { - "type": "integer", - "description": "Time the order created\n", - "format": "int64" - } + "status": { + "type": "string", + "description": "Status of service: open:normal transaction, close:Stop Trading/Maintenance, cancelonly:can only cancel the order but not place order", + "enum": [ + "open", + "close", + "cancelonly" + ], + "x-api-enum": [ + { + "value": "open", + "name": "OPEN", + "description": "normal transaction" }, - "required": [ - "symbol", - "tradeId", - "orderId", - "side", - "liquidity", - "forceTaker", - "price", - "size", - "value", - "openFeePay", - "closeFeePay", - "stop", - "feeRate", - "fixFee", - "feeCurrency", - "tradeTime", - "subTradeType", - "marginMode", - "settleCurrency", - "displayType", - "fee", - "orderType", - "tradeType", - "createdAt" - ] - } + { + "value": "close", + "name": "CLOSE", + "description": "Stop Trading/Maintenance" + }, + { + "value": "cancelonly", + "name": "CANCELONLY", + "description": "can only cancel the order but not place order" + } + ] } }, "required": [ - "currentPage", - "pageSize", - "totalNum", - "totalPage", - "items" + "msg", + "status" ] } }, @@ -3705,26 +2469,25 @@ } } }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470248", + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470230", "x-abandon": "normal", "x-domain": "Futures", - "x-api-channel": "Private", - "x-api-permission": "Futures", - "x-api-rate-limit-pool": "Futures", + "x-api-channel": "Public", + "x-api-permission": "NULL", + "x-api-rate-limit-pool": "Public", "x-sdk-service": "Futures", - "x-sdk-sub-service": "Order", - "x-sdk-method-name": "getTradeHistory", - "x-sdk-method-description": "Get a list of recent fills. If you need to get your recent trade history with low latency, please query endpoint Get List of Orders Completed in 24h. The requested data is not real-time.", - "x-api-rate-limit": 5, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"currentPage\\\": 1,\\n \\\"pageSize\\\": 50,\\n \\\"totalNum\\\": 2,\\n \\\"totalPage\\\": 1,\\n \\\"items\\\": [\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"tradeId\\\": \\\"1784277229880\\\",\\n \\\"orderId\\\": \\\"236317213710184449\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"liquidity\\\": \\\"taker\\\",\\n \\\"forceTaker\\\": false,\\n \\\"price\\\": \\\"67430.9\\\",\\n \\\"size\\\": 1,\\n \\\"value\\\": \\\"67.4309\\\",\\n \\\"openFeePay\\\": \\\"0.04045854\\\",\\n \\\"closeFeePay\\\": \\\"0\\\",\\n \\\"stop\\\": \\\"\\\",\\n \\\"feeRate\\\": \\\"0.00060\\\",\\n \\\"fixFee\\\": \\\"0\\\",\\n \\\"feeCurrency\\\": \\\"USDT\\\",\\n \\\"marginMode\\\": \\\"ISOLATED\\\",\\n \\\"settleCurrency\\\": \\\"USDT\\\",\\n \\\"fee\\\": \\\"0.04045854\\\",\\n \\\"orderType\\\": \\\"market\\\",\\n \\\"displayType\\\": \\\"market\\\",\\n \\\"tradeType\\\": \\\"trade\\\",\\n \\\"subTradeType\\\": null,\\n \\\"tradeTime\\\": 1729155616320000000,\\n \\\"createdAt\\\": 1729155616493\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"tradeId\\\": \\\"1784277132002\\\",\\n \\\"orderId\\\": \\\"236317094436728832\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"liquidity\\\": \\\"taker\\\",\\n \\\"forceTaker\\\": false,\\n \\\"price\\\": \\\"67445\\\",\\n \\\"size\\\": 1,\\n \\\"value\\\": \\\"67.445\\\",\\n \\\"openFeePay\\\": \\\"0\\\",\\n \\\"closeFeePay\\\": \\\"0.040467\\\",\\n \\\"stop\\\": \\\"\\\",\\n \\\"feeRate\\\": \\\"0.00060\\\",\\n \\\"fixFee\\\": \\\"0\\\",\\n \\\"feeCurrency\\\": \\\"USDT\\\",\\n \\\"marginMode\\\": \\\"ISOLATED\\\",\\n \\\"settleCurrency\\\": \\\"USDT\\\",\\n \\\"fee\\\": \\\"0.040467\\\",\\n \\\"orderType\\\": \\\"market\\\",\\n \\\"displayType\\\": \\\"market\\\",\\n \\\"tradeType\\\": \\\"trade\\\",\\n \\\"subTradeType\\\": null,\\n \\\"tradeTime\\\": 1729155587944000000,\\n \\\"createdAt\\\": 1729155588104\\n }\\n ]\\n }\\n}", - "x-request-example": "{\\\"orderId\\\": \\\"236655147005071361\\\", \\\"symbol\\\": \\\"example_string_default_value\\\", \\\"side\\\": \\\"buy\\\", \\\"type\\\": \\\"limit\\\", \\\"tradeTypes\\\": \\\"trade\\\", \\\"startAt\\\": 123456, \\\"endAt\\\": 123456, \\\"currentPage\\\": 1, \\\"pageSize\\\": 50}" + "x-sdk-sub-service": "Market", + "x-sdk-method-name": "getServiceStatus", + "x-sdk-method-description": "Get the service status.", + "x-api-rate-limit": 4, + "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"msg\\\":\\\"\\\",\\\"status\\\":\\\"open\\\"}}" } }, - "/api/v1/orders/multi": { + "/api/v1/orders": { "post": { - "summary": "Batch Add Orders", + "summary": "Add Order", "deprecated": false, - "description": "Place multiple order to the futures trading system, you can place two major types of orders: limit and market. Orders can only be placed if your account has sufficient funds. Once an order is placed, your funds will be put on hold for the duration of the order. The amount of funds on hold depends on the order type and parameters specified. You can place up to 20 orders at one time, including limit orders, market orders, and stop orders Please be noted that the system would hold the fees from the orders entered the orderbook in advance.", + "description": "Place order to the futures trading system, you can place two major types of orders: limit and market. Orders can only be placed if your account has sufficient funds. Once an order is placed, your funds will be put on hold for the duration of the order. The amount of funds on hold depends on the order type and parameters specified.", "tags": [], "parameters": [], "responses": { @@ -3739,37 +2502,21 @@ "type": "string" }, "data": { - "type": "array", - "items": { - "type": "object", - "properties": { - "orderId": { - "type": "string", - "description": "The unique order id generated by the trading system,which can be used later for further actions such as canceling the order." - }, - "clientOid": { - "type": "string", - "description": "Unique order id created by users to identify their orders, the maximum length cannot exceed 40, e.g. UUID, Only allows numbers, characters, underline(_), and separator(-)" - }, - "symbol": { - "type": "string", - "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) " - }, - "code": { - "type": "string" - }, - "msg": { - "type": "string" - } + "type": "object", + "properties": { + "orderId": { + "type": "string", + "description": "The unique order id generated by the trading system,which can be used later for further actions such as canceling the order." }, - "required": [ - "orderId", - "clientOid", - "symbol", - "code", - "msg" - ] - } + "clientOid": { + "type": "string", + "description": "The user self-defined order id." + } + }, + "required": [ + "orderId", + "clientOid" + ] } }, "required": [ @@ -3781,7 +2528,7 @@ } } }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470236", + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470235", "x-abandon": "normal", "x-domain": "Futures", "x-api-channel": "Private", @@ -3789,292 +2536,399 @@ "x-api-rate-limit-pool": "Futures", "x-sdk-service": "Futures", "x-sdk-sub-service": "Order", - "x-sdk-method-name": "batchAddOrders", - "x-sdk-method-description": "Place multiple order to the futures trading system, you can place two major types of orders: limit and market. Orders can only be placed if your account has sufficient funds. Once an order is placed, your funds will be put on hold for the duration of the order. The amount of funds on hold depends on the order type and parameters specified. You can place up to 20 orders at one time, including limit orders, market orders, and stop orders Please be noted that the system would hold the fees from the orders entered the orderbook in advance.", - "x-api-rate-limit": 20, + "x-sdk-method-name": "addOrder", + "x-sdk-method-description": "Place order to the futures trading system, you can place two major types of orders: limit and market. Orders can only be placed if your account has sufficient funds. Once an order is placed, your funds will be put on hold for the duration of the order. The amount of funds on hold depends on the order type and parameters specified.", + "x-api-rate-limit": 2, "requestBody": { "content": { "application/json": { "schema": { - "type": "array", - "items": { - "type": "object", - "properties": { - "clientOid": { - "type": "string", - "description": "Unique order id created by users to identify their orders, the maximum length cannot exceed 40, e.g. UUID, Only allows numbers, characters, underline(_), and separator(-)", - "example": [ - "5c52e11203aa677f33e493fb" - ] - }, - "side": { - "type": "string", - "description": "specify if the order is to 'buy' or 'sell'", - "enum": [ - "buy", - "sell" - ], - "x-api-enum": [ - { - "value": "buy", - "name": "", - "description": "" - }, - { - "value": "sell", - "name": "", - "description": "" - } - ], - "example": [ - "buy" - ] - }, - "symbol": { - "type": "string", - "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-221752070) ", - "example": [ - "XBTUSDTM" - ] - }, - "leverage": { - "type": "integer", - "description": "Used to calculate the margin to be frozen for the order. If you are to close the position, this parameter is not required.", - "example": [ - 3 - ] - }, - "type": { - "type": "string", - "description": "specify if the order is an 'limit' order or 'market' order", - "enum": [ - "limit", - "market" - ], - "default": "limit", - "x-api-enum": [ - { - "value": "limit", - "name": "", - "description": "" - }, - { - "value": "market", - "name": "", - "description": "" - } - ], - "example": [ - "limit" - ] - }, - "remark": { - "type": "string", - "description": "remark for the order, length cannot exceed 100 utf8 characters" - }, - "stop": { - "type": "string", - "description": "Either 'down' or 'up'. If stop is used,parameter stopPrice and stopPriceType also need to be provieded.", - "enum": [ - "down", - "up" - ], - "x-api-enum": [ - { - "value": "down", - "name": "down", - "description": "Triggers when the price reaches or goes below the stopPrice." - }, - { - "value": "up", - "name": "up", - "description": "Triggers when the price reaches or goes above the stopPrice" - } - ] - }, - "stopPriceType": { - "type": "string", - "description": "Either 'TP', 'IP' or 'MP', Need to be defined if stop is specified.", - "enum": [ - "TP", - "MP", - "IP" - ], - "x-api-enum": [ - { - "value": "TP", - "name": "trade price", - "description": "TP for trade price, The last trade price is the last price at which an order was filled. This price can be found in the latest match message." - }, - { - "value": "MP", - "name": "mark price", - "description": "MP for mark price, The mark price can be obtained through relevant OPEN API for index services" - }, - { - "value": "IP", - "name": "index price", - "description": "IP for index price, The index price can be obtained through relevant OPEN API for index services" - } - ] - }, - "stopPrice": { - "type": "string", - "description": "Need to be defined if stop is specified. " - }, - "reduceOnly": { - "type": "boolean", - "description": "A mark to reduce the position size only. Set to false by default. Need to set the position size when reduceOnly is true. If set to true, only the orders reducing the position size will be executed. If the reduce-only order size exceeds the position size, the extra size will be canceled.", - "default": false - }, - "closeOrder": { - "type": "boolean", - "description": "A mark to close the position. Set to false by default. If closeOrder is set to true, the system will close the position and the position size will become 0. Side, Size and Leverage fields can be left empty and the system will determine the side and size automatically.", - "default": false - }, - "forceHold": { - "type": "boolean", - "description": "A mark to forcely hold the funds for an order, even though it's an order to reduce the position size. This helps the order stay on the order book and not get canceled when the position size changes. Set to false by default. The system will forcely freeze certain amount of funds for this order, including orders whose direction is opposite to the current positions. This feature is to ensure that the order won’t be canceled by the matching engine in such a circumstance that not enough funds are frozen for the order.", - "default": false - }, - "stp": { - "type": "string", - "description": "[Self Trade Prevention](https://www.kucoin.com/docs-new/doc-338146) is divided into these strategies: CN, CO, CB. Not supported DC at the moment.", - "enum": [ - "CN", - "CO", - "CB" - ], - "x-api-enum": [ - { - "value": "CN", - "name": "CN", - "description": "Cancel new, Cancel the new order" - }, - { - "value": "CO", - "name": "CO", - "description": "Cancel old, Cancel the old order" - }, - { - "value": "CB", - "name": "CB", - "description": "Cancel both, Cancel both sides" - } - ] - }, - "marginMode": { - "type": "string", - "description": "Margin mode: ISOLATED, CROSS, default: ISOLATED", - "enum": [ - "ISOLATED", - "CROSS" - ], - "default": "ISOLATED", - "x-api-enum": [ - { - "value": "ISOLATED", - "name": "", - "description": "" - }, - { - "value": "CROSS", - "name": "", - "description": "" - } - ] - }, - "price": { - "type": "string", - "description": "Required for type is 'limit' order, indicating the operating price", - "example": [ - "0.1" - ] - }, - "size": { - "type": "integer", - "description": "**Choose one of size, qty, valueQty**, Order size (Lot), must be a positive integer. The quantity unit of coin-swap contracts is size(lot), and other units are not supported." - }, - "timeInForce": { - "type": "string", - "description": "Optional for type is 'limit' order, [Time in force](https://www.kucoin.com/docs-new/doc-338146) is a special strategy used during trading, default is GTC", - "enum": [ - "GTC", - "IOC" - ], - "default": "GTC", - "x-api-enum": [ - { - "value": "GTC", - "name": "Good Till Canceled", - "description": "order remains open on the order book until canceled. This is the default type if the field is left empty." - }, - { - "value": "IOC", - "name": "Immediate Or Cancel", - "description": "being matched or not, the remaining size of the order will be instantly canceled instead of entering the order book." - } - ] - }, - "postOnly": { - "type": "boolean", - "description": "Optional for type is 'limit' order, post only flag, invalid when timeInForce is IOC. When postOnly is true, not allowed choose hidden or iceberg. The post-only flag ensures that the trader always pays the maker fee and provides liquidity to the order book. If any part of the order is going to pay taker fee, the order will be fully rejected.", - "default": false - }, - "hidden": { - "type": "boolean", - "description": "Optional for type is 'limit' order, orders not displaying in order book. When hidden chose, not allowed choose postOnly.", - "default": false - }, - "iceberg": { - "type": "boolean", - "description": "Optional for type is 'limit' order, Only visible portion of the order is displayed in the order book. When iceberg chose, not allowed choose postOnly.", - "default": false - }, - "visibleSize": { - "type": "string", - "description": "Optional for type is 'limit' order, The maximum visible size of an iceberg order. please place order in size (lots), The units of qty (base currency) and valueQty (value) are not supported." - }, - "qty": { - "type": "string", - "description": "**Choose one of size, qty, valueQty**, Order size (Base currency) must be an integer multiple of the multiplier. The unit of the quantity of coin-swap is size(lot), which is not supported" - }, - "valueQty": { - "type": "string", - "description": "**Choose one of size, qty, valueQty**, Order size (Value), USDS-Swap correspond to USDT or USDC. The unit of the quantity of coin-swap is size(lot), which is not supported" - } + "type": "object", + "properties": { + "clientOid": { + "type": "string", + "description": "Unique order id created by users to identify their orders, the maximum length cannot exceed 40, e.g. UUID, Only allows numbers, characters, underline(_), and separator(-)", + "example": [ + "5c52e11203aa677f33e493fb" + ] }, - "required": [ - "clientOid", - "symbol", - "type", - "side", - "leverage" - ] + "side": { + "type": "string", + "description": "specify if the order is to 'buy' or 'sell'", + "enum": [ + "buy", + "sell" + ], + "x-api-enum": [ + { + "value": "buy", + "name": "", + "description": "" + }, + { + "value": "sell", + "name": "", + "description": "" + } + ], + "example": [ + "buy" + ] + }, + "symbol": { + "type": "string", + "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) ", + "example": [ + "XBTUSDTM" + ] + }, + "leverage": { + "type": "integer", + "description": "Used to calculate the margin to be frozen for the order. If you are to close the position, this parameter is not required.", + "example": [ + 3 + ] + }, + "type": { + "type": "string", + "description": "specify if the order is an 'limit' order or 'market' order", + "enum": [ + "limit", + "market" + ], + "default": "limit", + "x-api-enum": [ + { + "value": "limit", + "name": "", + "description": "" + }, + { + "value": "market", + "name": "", + "description": "" + } + ], + "example": [ + "limit" + ] + }, + "remark": { + "type": "string", + "description": "remark for the order, length cannot exceed 100 utf8 characters" + }, + "stop": { + "type": "string", + "description": "Either 'down' or 'up'. If stop is used,parameter stopPrice and stopPriceType also need to be provieded.", + "enum": [ + "down", + "up" + ], + "x-api-enum": [ + { + "value": "down", + "name": "down", + "description": "Triggers when the price reaches or goes below the stopPrice." + }, + { + "value": "up", + "name": "up", + "description": "Triggers when the price reaches or goes above the stopPrice" + } + ] + }, + "stopPriceType": { + "type": "string", + "description": "Either 'TP', 'IP' or 'MP', Need to be defined if stop is specified.", + "enum": [ + "TP", + "MP", + "IP" + ], + "x-api-enum": [ + { + "value": "TP", + "name": "trade price", + "description": "TP for trade price, The last trade price is the last price at which an order was filled. This price can be found in the latest match message." + }, + { + "value": "MP", + "name": "mark price", + "description": "MP for mark price, The mark price can be obtained through relevant OPEN API for index services" + }, + { + "value": "IP", + "name": "index price", + "description": "IP for index price, The index price can be obtained through relevant OPEN API for index services" + } + ] + }, + "stopPrice": { + "type": "string", + "description": "Need to be defined if stop is specified. " + }, + "reduceOnly": { + "type": "boolean", + "description": "A mark to reduce the position size only. Set to false by default. Need to set the position size when reduceOnly is true. If set to true, only the orders reducing the position size will be executed. If the reduce-only order size exceeds the position size, the extra size will be canceled.", + "default": false + }, + "closeOrder": { + "type": "boolean", + "description": "A mark to close the position. Set to false by default. If closeOrder is set to true, the system will close the position and the position size will become 0. Side, Size and Leverage fields can be left empty and the system will determine the side and size automatically.", + "default": false + }, + "forceHold": { + "type": "boolean", + "description": "A mark to forcely hold the funds for an order, even though it's an order to reduce the position size. This helps the order stay on the order book and not get canceled when the position size changes. Set to false by default. The system will forcely freeze certain amount of funds for this order, including orders whose direction is opposite to the current positions. This feature is to ensure that the order won’t be canceled by the matching engine in such a circumstance that not enough funds are frozen for the order.", + "default": false + }, + "stp": { + "type": "string", + "description": "[Self Trade Prevention](https://www.kucoin.com/docs-new/doc-338146) is divided into these strategies: CN, CO, CB. Not supported DC at the moment.", + "enum": [ + "CN", + "CO", + "CB" + ], + "x-api-enum": [ + { + "value": "CN", + "name": "CN", + "description": "Cancel new, Cancel the new order" + }, + { + "value": "CO", + "name": "CO", + "description": "Cancel old, Cancel the old order" + }, + { + "value": "CB", + "name": "CB", + "description": "Cancel both, Cancel both sides" + } + ] + }, + "marginMode": { + "type": "string", + "description": "Margin mode: ISOLATED, CROSS, default: ISOLATED", + "enum": [ + "ISOLATED", + "CROSS" + ], + "default": "ISOLATED", + "x-api-enum": [ + { + "value": "ISOLATED", + "name": "ISOLATED", + "description": "Isolated Margin" + }, + { + "value": "CROSS", + "name": "CROSS", + "description": "Cross Margin" + } + ] + }, + "price": { + "type": "string", + "description": "Required for type is 'limit' order, indicating the operating price", + "example": [ + "0.1" + ] + }, + "size": { + "type": "integer", + "description": "**Choose one of size, qty, valueQty**, Order size (Lot), must be a positive integer. The quantity unit of coin-swap contracts is size(lot), and other units are not supported." + }, + "timeInForce": { + "type": "string", + "description": "Optional for type is 'limit' order, [Time in force](https://www.kucoin.com/docs-new/doc-338146) is a special strategy used during trading, default is GTC", + "enum": [ + "GTC", + "IOC" + ], + "default": "GTC", + "x-api-enum": [ + { + "value": "GTC", + "name": "Good Till Canceled", + "description": "order remains open on the order book until canceled. This is the default type if the field is left empty." + }, + { + "value": "IOC", + "name": "Immediate Or Cancel", + "description": "being matched or not, the remaining size of the order will be instantly canceled instead of entering the order book." + } + ] + }, + "postOnly": { + "type": "boolean", + "description": "Optional for type is 'limit' order, post only flag, invalid when timeInForce is IOC. When postOnly is true, not allowed choose hidden or iceberg. The post-only flag ensures that the trader always pays the maker fee and provides liquidity to the order book. If any part of the order is going to pay taker fee, the order will be fully rejected.", + "default": false + }, + "hidden": { + "type": "boolean", + "description": "Optional for type is 'limit' order, orders not displaying in order book. When hidden chose, not allowed choose postOnly.", + "default": false + }, + "iceberg": { + "type": "boolean", + "description": "Optional for type is 'limit' order, Only visible portion of the order is displayed in the order book. When iceberg chose, not allowed choose postOnly.", + "default": false + }, + "visibleSize": { + "type": "string", + "description": "Optional for type is 'limit' order, The maximum visible size of an iceberg order. please place order in size (lots), The units of qty (base currency) and valueQty (value) are not supported." + }, + "qty": { + "type": "string", + "description": "**Choose one of size, qty, valueQty**, Order size (Base currency) must be an integer multiple of the multiplier. The unit of the quantity of coin-swap is size(lot), which is not supported" + }, + "valueQty": { + "type": "string", + "description": "**Choose one of size, qty, valueQty**, Order size (Value), USDS-Swap correspond to USDT or USDC. The unit of the quantity of coin-swap is size(lot), which is not supported" + } + }, + "required": [ + "clientOid", + "symbol", + "side", + "leverage" + ] + }, + "example": "{\n \"clientOid\": \"5c52e11203aa677f33e493fb\",\n \"side\": \"buy\",\n \"symbol\": \"XBTUSDTM\",\n \"leverage\": 3,\n \"type\": \"limit\",\n \"remark\": \"order remarks\",\n \"reduceOnly\": false,\n \"marginMode\": \"ISOLATED\",\n \"price\": \"0.1\",\n \"size\": 1,\n \"timeInForce\": \"GTC\"\n}" + } + } + }, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"orderId\\\": \\\"234125150956625920\\\",\\n \\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\"\\n }\\n}", + "x-request-example": "{\\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\", \\\"side\\\": \\\"buy\\\", \\\"symbol\\\": \\\"XBTUSDTM\\\", \\\"leverage\\\": 3, \\\"type\\\": \\\"limit\\\", \\\"remark\\\": \\\"order remarks\\\", \\\"reduceOnly\\\": false, \\\"marginMode\\\": \\\"ISOLATED\\\", \\\"price\\\": \\\"0.1\\\", \\\"size\\\": 1, \\\"timeInForce\\\": \\\"GTC\\\"}" + }, + "get": { + "summary": "Get Order List", + "deprecated": false, + "description": "List your current orders.", + "tags": [], + "parameters": [ + { + "name": "status", + "in": "query", + "description": "active or done, done as default. Only list orders for a specific status", + "required": true, + "schema": { + "type": "string", + "enum": [ + "active", + "done" + ], + "x-api-enum": [ + { + "value": "active", + "name": "", + "description": "" + }, + { + "value": "done", + "name": "", + "description": "" + } + ] + } + }, + { + "name": "symbol", + "in": "query", + "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) ", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "side", + "in": "query", + "description": "buy or sell", + "required": true, + "schema": { + "type": "string", + "enum": [ + "buy", + "sell" + ], + "x-api-enum": [ + { + "value": "buy", + "name": "", + "description": "" + }, + { + "value": "sell", + "name": "", + "description": "" } - }, - "example": "[\n {\n \"clientOid\": \"5c52e11203aa677f33e493fb\",\n \"side\": \"buy\",\n \"symbol\": \"XBTUSDTM\",\n \"leverage\": 3,\n \"type\": \"limit\",\n \"remark\": \"order remarks\",\n \"reduceOnly\": false,\n \"marginMode\": \"ISOLATED\",\n \"price\": \"0.1\",\n \"size\": 1,\n \"timeInForce\": \"GTC\"\n },\n {\n \"clientOid\": \"5c52e11203aa677f33e493fc\",\n \"side\": \"buy\",\n \"symbol\": \"XBTUSDTM\",\n \"leverage\": 3,\n \"type\": \"limit\",\n \"remark\": \"order remarks\",\n \"reduceOnly\": false,\n \"marginMode\": \"ISOLATED\",\n \"price\": \"0.1\",\n \"size\": 1,\n \"timeInForce\": \"GTC\"\n }\n]" + ] } - } - }, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": [\\n {\\n \\\"orderId\\\": \\\"235919387779985408\\\",\\n \\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\",\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"code\\\": \\\"200000\\\",\\n \\\"msg\\\": \\\"success\\\"\\n },\\n {\\n \\\"orderId\\\": \\\"235919387855482880\\\",\\n \\\"clientOid\\\": \\\"5c52e11203aa677f33e493fc\\\",\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"code\\\": \\\"200000\\\",\\n \\\"msg\\\": \\\"success\\\"\\n }\\n ]\\n}", - "x-request-example": "[{\\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\", \\\"side\\\": \\\"buy\\\", \\\"symbol\\\": \\\"XBTUSDTM\\\", \\\"leverage\\\": 3, \\\"type\\\": \\\"limit\\\", \\\"remark\\\": \\\"order remarks\\\", \\\"reduceOnly\\\": false, \\\"marginMode\\\": \\\"ISOLATED\\\", \\\"price\\\": \\\"0.1\\\", \\\"size\\\": 1, \\\"timeInForce\\\": \\\"GTC\\\"}, {\\\"clientOid\\\": \\\"5c52e11203aa677f33e493fc\\\", \\\"side\\\": \\\"buy\\\", \\\"symbol\\\": \\\"XBTUSDTM\\\", \\\"leverage\\\": 3, \\\"type\\\": \\\"limit\\\", \\\"remark\\\": \\\"order remarks\\\", \\\"reduceOnly\\\": false, \\\"marginMode\\\": \\\"ISOLATED\\\", \\\"price\\\": \\\"0.1\\\", \\\"size\\\": 1, \\\"timeInForce\\\": \\\"GTC\\\"}]" - } - }, - "/api/v1/recentFills": { - "get": { - "summary": "Get Recent Trade History", - "deprecated": false, - "description": "Get a list of recent 1000 fills in the last 24 hours. If you need to get your recent traded order history with low latency, you may query this endpoint.", - "tags": [], - "parameters": [ + }, { - "name": "symbol", + "name": "type", "in": "query", - "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) ", + "description": "limit, market, limit_stop or market_stop", + "required": true, + "schema": { + "type": "string", + "enum": [ + "limit", + "market" + ], + "x-api-enum": [ + { + "value": "limit", + "name": "", + "description": "" + }, + { + "value": "market", + "name": "", + "description": "" + } + ] + } + }, + { + "name": "startAt", + "in": "query", + "description": "Start time (milisecond)", "required": false, "schema": { - "type": "string" + "type": "integer", + "format": "int64" + } + }, + { + "name": "endAt", + "in": "query", + "description": "End time (milisecond)", + "required": false, + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "currentPage", + "in": "query", + "description": "Current request page, The default currentPage is 1", + "required": true, + "schema": { + "type": "integer" + } + }, + { + "name": "pageSize", + "in": "query", + "description": "pageSize, The default pageSize is 50, The maximum cannot exceed 1000", + "required": true, + "schema": { + "type": "integer" } } ], @@ -4090,262 +2944,234 @@ "type": "string" }, "data": { - "type": "array", - "items": { - "type": "object", - "properties": { - "symbol": { - "type": "string", - "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) " - }, - "tradeId": { - "type": "string", - "description": "Trade ID\n" - }, - "orderId": { - "type": "string", - "description": "Order ID\n" - }, - "side": { - "type": "string", - "description": "Transaction side\n", - "enum": [ - "buy", - "sell" - ], - "x-api-enum": [ - { - "value": "buy", - "name": "buy", - "description": "buy" + "type": "object", + "properties": { + "currentPage": { + "type": "integer", + "description": "Current request page, The default currentPage is 1" + }, + "pageSize": { + "type": "integer", + "description": "pageSize, The default pageSize is 50, The maximum cannot exceed 1000" + }, + "totalNum": { + "type": "integer" + }, + "totalPage": { + "type": "integer" + }, + "items": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Order ID" }, - { - "value": "sell", - "name": "sell", - "description": "sell" - } - ] - }, - "liquidity": { - "type": "string", - "description": "Liquidity- taker or maker\n", - "enum": [ - "taker", - "maker" - ], - "x-api-enum": [ - { - "value": "taker", - "name": "taker", - "description": "taker" + "symbol": { + "type": "string", + "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) " + }, + "type": { + "type": "string", + "description": "Order type, market order or limit order\n" + }, + "side": { + "type": "string", + "description": "Transaction side" + }, + "price": { + "type": "string", + "description": "Order price" + }, + "size": { + "type": "integer", + "description": "Order quantity" + }, + "value": { + "type": "string", + "description": "Order value" + }, + "dealValue": { + "type": "string", + "description": "Executed size of funds\n" + }, + "dealSize": { + "type": "integer", + "description": "Executed quantity" + }, + "stp": { + "type": "string", + "description": "self trade prevention" + }, + "stop": { + "type": "string", + "description": "Stop order type (stop limit or stop market)" + }, + "stopPriceType": { + "type": "string", + "description": "Trigger price type of stop orders" + }, + "stopTriggered": { + "type": "boolean", + "description": "Mark to show whether the stop order is triggered" + }, + "stopPrice": { + "type": "integer", + "description": "Trigger price of stop orders" + }, + "timeInForce": { + "type": "string", + "description": "Time in force policy type" + }, + "postOnly": { + "type": "boolean", + "description": "Mark of post only" + }, + "hidden": { + "type": "boolean", + "description": "Mark of the hidden order" + }, + "iceberg": { + "type": "boolean", + "description": "Mark of the iceberg order" + }, + "leverage": { + "type": "string", + "description": "Leverage of the order" + }, + "forceHold": { + "type": "boolean", + "description": "A mark to forcely hold the funds for an order" + }, + "closeOrder": { + "type": "boolean", + "description": "A mark to close the position" + }, + "visibleSize": { + "type": "integer", + "description": "Visible size of the iceberg order" + }, + "clientOid": { + "type": "string", + "description": "Unique order id created by users to identify their orders" + }, + "remark": { + "type": "string", + "description": "Remark of the order" + }, + "tags": { + "type": "string", + "description": "tag order source" + }, + "isActive": { + "type": "boolean", + "description": "Mark of the active orders" + }, + "cancelExist": { + "type": "boolean", + "description": "Mark of the canceled orders" }, - { - "value": "maker", - "name": "maker", - "description": "maker" - } - ] - }, - "forceTaker": { - "type": "boolean", - "description": "Whether to force processing as a taker\n" - }, - "price": { - "type": "string", - "description": "Filled price\n" - }, - "size": { - "type": "integer", - "description": "Filled amount\n" - }, - "value": { - "type": "string", - "description": "Order value\n" - }, - "openFeePay": { - "type": "string", - "description": "Opening transaction fee\n" - }, - "closeFeePay": { - "type": "string", - "description": "Closing transaction fee\n" - }, - "stop": { - "type": "string", - "description": "A mark to the stop order type\n" - }, - "feeRate": { - "type": "string", - "description": "Fee Rate" - }, - "fixFee": { - "type": "string", - "description": "Fixed fees(Deprecated field, no actual use of the value field)\n" - }, - "feeCurrency": { - "type": "string", - "description": "Charging currency\n" - }, - "tradeTime": { - "type": "integer", - "description": "trade time in nanosecond\n", - "format": "int64" - }, - "subTradeType": { - "type": "string", - "description": "Deprecated field, no actual use of the value field" - }, - "marginMode": { - "type": "string", - "description": "Margin mode: ISOLATED (isolated), CROSS (cross margin).\n", - "enum": [ - "ISOLATED", - "CROSS" - ], - "x-api-enum": [ - { - "value": "ISOLATED", - "name": "ISOLATED", - "description": "Isolated Margin" + "createdAt": { + "type": "integer", + "description": "Time the order created", + "format": "int64" }, - { - "value": "CROSS", - "name": "CROSS", - "description": "Cross Margin" - } - ] - }, - "displayType": { - "type": "string", - "enum": [ - "limit", - "market", - "limit_stop", - "market_stop" - ], - "description": "Order Type", - "x-api-enum": [ - { - "value": "limit", - "name": "limit", - "description": "Limit order" + "updatedAt": { + "type": "integer", + "description": "last update time", + "format": "int64" }, - { - "value": "market", - "name": "market", - "description": "Market order" + "endAt": { + "type": "integer", + "description": "End time", + "format": "int64" }, - { - "value": "limit_stop", - "name": "limit_stop", - "description": "Stop limit order" + "orderTime": { + "type": "integer", + "description": "Order create time in nanosecond", + "format": "int64" }, - { - "value": "market_stop", - "name": "market_stop", - "description": "Stop Market order" - } - ] - }, - "fee": { - "type": "string", - "description": "Transaction fee\n" - }, - "settleCurrency": { - "type": "string", - "description": "Settle Currency" - }, - "orderType": { - "type": "string", - "description": "Order type\n", - "enum": [ - "market", - "limit" - ], - "x-api-enum": [ - { - "value": "market", - "name": "market", - "description": "market" + "settleCurrency": { + "type": "string", + "description": "settlement currency" }, - { - "value": "limit", - "name": "limit", - "description": "limit" - } - ] - }, - "tradeType": { - "type": "string", - "description": "Trade type (trade, liquid, cancel, adl or settlement)\n", - "enum": [ - "trade", - "cancel", - "liquid", - "adl", - "settlement" - ], - "x-api-enum": [ - { - "value": "trade", - "name": "trade", - "description": "trade" + "marginMode": { + "type": "string", + "description": "Margin mode: ISOLATED (isolated), CROSS (cross margin)." }, - { - "value": "cancel", - "name": "cancel", - "description": "Partially filled and cancelled orders" + "avgDealPrice": { + "type": "string", + "description": "Average transaction price, forward contract average transaction price = sum (transaction value) / sum (transaction quantity), reverse contract average transaction price = sum (transaction quantity) / sum (transaction value). Transaction quantity = lots * multiplier" }, - { - "value": "liquid", - "name": "liquid", - "description": "liquid" + "status": { + "type": "string", + "description": "order status: “open” or “done”" }, - { - "value": "adl", - "name": "adl", - "description": "adl" + "filledSize": { + "type": "integer", + "description": "Value of the executed orders" }, - { - "value": "settlement", - "name": "settlement", - "description": "settlement" + "filledValue": { + "type": "string", + "description": "Executed order quantity" + }, + "reduceOnly": { + "type": "boolean", + "description": "A mark to reduce the position size only" } - ] - }, - "createdAt": { - "type": "integer", - "description": "Time the order created\n", - "format": "int64" - } - }, - "required": [ - "symbol", - "tradeId", - "orderId", - "side", - "liquidity", - "forceTaker", - "price", - "size", - "value", - "openFeePay", - "closeFeePay", - "stop", - "feeRate", - "fixFee", - "feeCurrency", - "tradeTime", - "subTradeType", - "marginMode", - "displayType", - "fee", - "settleCurrency", - "orderType", - "tradeType", - "createdAt" - ] - } + }, + "required": [ + "id", + "symbol", + "type", + "side", + "price", + "size", + "value", + "dealValue", + "dealSize", + "stp", + "stop", + "stopPriceType", + "stopTriggered", + "stopPrice", + "timeInForce", + "postOnly", + "hidden", + "iceberg", + "leverage", + "forceHold", + "closeOrder", + "visibleSize", + "clientOid", + "remark", + "tags", + "isActive", + "cancelExist", + "createdAt", + "updatedAt", + "endAt", + "orderTime", + "settleCurrency", + "marginMode", + "avgDealPrice", + "status", + "filledSize", + "filledValue", + "reduceOnly" + ] + } + } + }, + "required": [ + "currentPage", + "pageSize", + "totalNum", + "totalPage", + "items" + ] } }, "required": [ @@ -4357,7 +3183,7 @@ } } }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470249", + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470244", "x-abandon": "normal", "x-domain": "Futures", "x-api-channel": "Private", @@ -4365,18 +3191,84 @@ "x-api-rate-limit-pool": "Futures", "x-sdk-service": "Futures", "x-sdk-sub-service": "Order", - "x-sdk-method-name": "getRecentTradeHistory", - "x-sdk-method-description": "Get a list of recent 1000 fills in the last 24 hours. If you need to get your recent traded order history with low latency, you may query this endpoint.", - "x-api-rate-limit": 3, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": [\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"tradeId\\\": \\\"1784277229880\\\",\\n \\\"orderId\\\": \\\"236317213710184449\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"liquidity\\\": \\\"taker\\\",\\n \\\"forceTaker\\\": false,\\n \\\"price\\\": \\\"67430.9\\\",\\n \\\"size\\\": 1,\\n \\\"value\\\": \\\"67.4309\\\",\\n \\\"openFeePay\\\": \\\"0.04045854\\\",\\n \\\"closeFeePay\\\": \\\"0\\\",\\n \\\"stop\\\": \\\"\\\",\\n \\\"feeRate\\\": \\\"0.00060\\\",\\n \\\"fixFee\\\": \\\"0\\\",\\n \\\"feeCurrency\\\": \\\"USDT\\\",\\n \\\"marginMode\\\": \\\"ISOLATED\\\",\\n \\\"fee\\\": \\\"0.04045854\\\",\\n \\\"settleCurrency\\\": \\\"USDT\\\",\\n \\\"orderType\\\": \\\"market\\\",\\n \\\"displayType\\\": \\\"market\\\",\\n \\\"tradeType\\\": \\\"trade\\\",\\n \\\"subTradeType\\\": null,\\n \\\"tradeTime\\\": 1729155616320000000,\\n \\\"createdAt\\\": 1729155616493\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"tradeId\\\": \\\"1784277132002\\\",\\n \\\"orderId\\\": \\\"236317094436728832\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"liquidity\\\": \\\"taker\\\",\\n \\\"forceTaker\\\": false,\\n \\\"price\\\": \\\"67445\\\",\\n \\\"size\\\": 1,\\n \\\"value\\\": \\\"67.445\\\",\\n \\\"openFeePay\\\": \\\"0\\\",\\n \\\"closeFeePay\\\": \\\"0.040467\\\",\\n \\\"stop\\\": \\\"\\\",\\n \\\"feeRate\\\": \\\"0.00060\\\",\\n \\\"fixFee\\\": \\\"0\\\",\\n \\\"feeCurrency\\\": \\\"USDT\\\",\\n \\\"marginMode\\\": \\\"ISOLATED\\\",\\n \\\"fee\\\": \\\"0.040467\\\",\\n \\\"settleCurrency\\\": \\\"USDT\\\",\\n \\\"orderType\\\": \\\"market\\\",\\n \\\"displayType\\\": \\\"market\\\",\\n \\\"tradeType\\\": \\\"trade\\\",\\n \\\"subTradeType\\\": null,\\n \\\"tradeTime\\\": 1729155587944000000,\\n \\\"createdAt\\\": 1729155588104\\n }\\n ]\\n}", + "x-sdk-method-name": "GetOrderList", + "x-sdk-method-description": "List your current orders.", + "x-api-rate-limit": 2, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"currentPage\\\": 1,\\n \\\"pageSize\\\": 50,\\n \\\"totalNum\\\": 1,\\n \\\"totalPage\\\": 1,\\n \\\"items\\\": [\\n {\\n \\\"id\\\": \\\"230181737576050688\\\",\\n \\\"symbol\\\": \\\"PEOPLEUSDTM\\\",\\n \\\"type\\\": \\\"limit\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"price\\\": \\\"0.05\\\",\\n \\\"size\\\": 10,\\n \\\"value\\\": \\\"5\\\",\\n \\\"dealValue\\\": \\\"0\\\",\\n \\\"dealSize\\\": 0,\\n \\\"stp\\\": \\\"\\\",\\n \\\"stop\\\": \\\"\\\",\\n \\\"stopPriceType\\\": \\\"\\\",\\n \\\"stopTriggered\\\": false,\\n \\\"stopPrice\\\": null,\\n \\\"timeInForce\\\": \\\"GTC\\\",\\n \\\"postOnly\\\": false,\\n \\\"hidden\\\": false,\\n \\\"iceberg\\\": false,\\n \\\"leverage\\\": \\\"1\\\",\\n \\\"forceHold\\\": false,\\n \\\"closeOrder\\\": false,\\n \\\"visibleSize\\\": 0,\\n \\\"clientOid\\\": \\\"5a80bd847f1811ef8a7faa665a37b3d7\\\",\\n \\\"remark\\\": null,\\n \\\"tags\\\": \\\"\\\",\\n \\\"isActive\\\": true,\\n \\\"cancelExist\\\": false,\\n \\\"createdAt\\\": 1727692804813,\\n \\\"updatedAt\\\": 1727692804813,\\n \\\"endAt\\\": null,\\n \\\"orderTime\\\": 1727692804808418000,\\n \\\"settleCurrency\\\": \\\"USDT\\\",\\n \\\"marginMode\\\": \\\"ISOLATED\\\",\\n \\\"avgDealPrice\\\": \\\"0\\\",\\n \\\"filledSize\\\": 0,\\n \\\"filledValue\\\": \\\"0\\\",\\n \\\"status\\\": \\\"open\\\",\\n \\\"reduceOnly\\\": false\\n }\\n ]\\n }\\n}", + "x-request-example": "{\\\"status\\\": \\\"done\\\", \\\"symbol\\\": \\\"example_string_default_value\\\", \\\"side\\\": \\\"buy\\\", \\\"type\\\": \\\"limit\\\", \\\"startAt\\\": 123456, \\\"endAt\\\": 123456, \\\"currentPage\\\": 123456, \\\"pageSize\\\": 123456}" + }, + "delete": { + "summary": "Cancel All Orders - V1", + "deprecated": true, + "description": "Cancel all open orders (excluding stop orders). The response is a list of orderIDs of the canceled orders.", + "tags": [], + "parameters": [ + { + "name": "symbol", + "in": "query", + "description": "Cancel all limit orders for a specific contract only, If not specified, all the limit orders will be deleted, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) ", + "required": false, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "object", + "properties": { + "cancelledOrderIds": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Unique ID of the cancelled order" + } + }, + "required": [ + "cancelledOrderIds" + ] + } + }, + "required": [ + "code", + "data" + ] + } + } + } + } + }, + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470362", + "x-abandon": "abandon", + "x-domain": "Futures", + "x-api-channel": "Private", + "x-api-permission": "Futures", + "x-api-rate-limit-pool": "Futures", + "x-sdk-service": "Futures", + "x-sdk-sub-service": "Order", + "x-sdk-method-name": "cancelAllOrdersV1", + "x-sdk-method-description": "Cancel all open orders (excluding stop orders). The response is a list of orderIDs of the canceled orders.", + "x-api-rate-limit": 200, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"cancelledOrderIds\\\": [\\n \\\"235919172150824960\\\",\\n \\\"235919172150824961\\\"\\n ]\\n }\\n}", "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDTM\\\"}" } }, - "/api/v1/st-orders": { + "/api/v1/orders/test": { "post": { - "summary": "Add Take Profit And Stop Loss Order", + "summary": "Add Order Test", "deprecated": false, - "description": "Place take profit and stop loss order supports both take-profit and stop-loss functions, and other functions are exactly the same as the place order interface.", + "description": "Place order to the futures trading system just for validation", "tags": [], "parameters": [], "responses": { @@ -4417,7 +3309,7 @@ } } }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470237", + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470238", "x-abandon": "normal", "x-domain": "Futures", "x-api-channel": "Private", @@ -4425,8 +3317,8 @@ "x-api-rate-limit-pool": "Futures", "x-sdk-service": "Futures", "x-sdk-sub-service": "Order", - "x-sdk-method-name": "addTPSLOrder", - "x-sdk-method-description": "Place take profit and stop loss order supports both take-profit and stop-loss functions, and other functions are exactly the same as the place order interface.", + "x-sdk-method-name": "addOrderTest", + "x-sdk-method-description": "Place order to the futures trading system just for validation", "x-api-rate-limit": 2, "requestBody": { "content": { @@ -4489,13 +3381,13 @@ "x-api-enum": [ { "value": "limit", - "name": "limit", - "description": "limit order" + "name": "", + "description": "" }, { "value": "market", - "name": "market", - "description": "market order" + "name": "", + "description": "" } ], "example": [ @@ -4506,9 +3398,29 @@ "type": "string", "description": "remark for the order, length cannot exceed 100 utf8 characters" }, + "stop": { + "type": "string", + "description": "Either 'down' or 'up'. If stop is used,parameter stopPrice and stopPriceType also need to be provieded.", + "enum": [ + "down", + "up" + ], + "x-api-enum": [ + { + "value": "down", + "name": "down", + "description": "Triggers when the price reaches or goes below the stopPrice." + }, + { + "value": "up", + "name": "up", + "description": "Triggers when the price reaches or goes above the stopPrice" + } + ] + }, "stopPriceType": { "type": "string", - "description": "Either 'TP', 'IP' or 'MP'", + "description": "Either 'TP', 'IP' or 'MP', Need to be defined if stop is specified.", "enum": [ "TP", "MP", @@ -4532,6 +3444,10 @@ } ] }, + "stopPrice": { + "type": "string", + "description": "Need to be defined if stop is specified. " + }, "reduceOnly": { "type": "boolean", "description": "A mark to reduce the position size only. Set to false by default. Need to set the position size when reduceOnly is true. If set to true, only the orders reducing the position size will be executed. If the reduce-only order size exceeds the position size, the extra size will be canceled.", @@ -4645,14 +3561,6 @@ "type": "string", "description": "Optional for type is 'limit' order, The maximum visible size of an iceberg order. please place order in size (lots), The units of qty (base currency) and valueQty (value) are not supported." }, - "triggerStopUpPrice": { - "type": "string", - "description": "Take profit price" - }, - "triggerStopDownPrice": { - "type": "string", - "description": "Stop loss price" - }, "qty": { "type": "string", "description": "**Choose one of size, qty, valueQty**, Order size (Base currency) must be an integer multiple of the multiplier. The unit of the quantity of coin-swap is size(lot), which is not supported" @@ -4670,31 +3578,21 @@ "leverage" ] }, - "example": "{\n \"clientOid\": \"5c52e11203aa677f33e493fb\",\n \"side\": \"buy\",\n \"symbol\": \"XBTUSDTM\",\n \"leverage\": 3,\n \"type\": \"limit\",\n \"remark\": \"order remarks\",\n \"reduceOnly\": false,\n \"marginMode\": \"ISOLATED\",\n \"price\": \"0.2\",\n \"size\": 1,\n \"timeInForce\": \"GTC\",\n \"triggerStopUpPrice\": \"0.3\",\n \"triggerStopDownPrice\": \"0.1\",\n \"stopPriceType\": \"TP\"\n}" + "example": "{\n \"clientOid\": \"5c52e11203aa677f33e493fb\",\n \"side\": \"buy\",\n \"symbol\": \"XBTUSDTM\",\n \"leverage\": 3,\n \"type\": \"limit\",\n \"remark\": \"order remarks\",\n \"reduceOnly\": false,\n \"marginMode\": \"ISOLATED\",\n \"price\": \"0.1\",\n \"size\": 1,\n \"timeInForce\": \"GTC\"\n}" } } }, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"orderId\\\": \\\"234125150956625920\\\",\\n \\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\"\\n }\\n}", - "x-request-example": "{\\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\", \\\"side\\\": \\\"buy\\\", \\\"symbol\\\": \\\"XBTUSDTM\\\", \\\"leverage\\\": 3, \\\"type\\\": \\\"limit\\\", \\\"remark\\\": \\\"order remarks\\\", \\\"reduceOnly\\\": false, \\\"marginMode\\\": \\\"ISOLATED\\\", \\\"price\\\": \\\"0.2\\\", \\\"size\\\": 1, \\\"timeInForce\\\": \\\"GTC\\\", \\\"triggerStopUpPrice\\\": \\\"0.3\\\", \\\"triggerStopDownPrice\\\": \\\"0.1\\\", \\\"stopPriceType\\\": \\\"TP\\\"}" + "x-request-example": "{\\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\", \\\"side\\\": \\\"buy\\\", \\\"symbol\\\": \\\"XBTUSDTM\\\", \\\"leverage\\\": 3, \\\"type\\\": \\\"limit\\\", \\\"remark\\\": \\\"order remarks\\\", \\\"reduceOnly\\\": false, \\\"marginMode\\\": \\\"ISOLATED\\\", \\\"price\\\": \\\"0.1\\\", \\\"size\\\": 1, \\\"timeInForce\\\": \\\"GTC\\\"}" } }, - "/api/v1/openOrderStatistics": { - "get": { - "summary": "Get Open Order Value", + "/api/v1/orders/multi": { + "post": { + "summary": "Batch Add Orders", "deprecated": false, - "description": "You can query this endpoint to get the the total number and value of the all your active orders.", + "description": "Place multiple order to the futures trading system, you can place two major types of orders: limit and market. Orders can only be placed if your account has sufficient funds. Once an order is placed, your funds will be put on hold for the duration of the order. The amount of funds on hold depends on the order type and parameters specified. You can place up to 20 orders at one time, including limit orders, market orders, and stop orders Please be noted that the system would hold the fees from the orders entered the orderbook in advance.", "tags": [], - "parameters": [ - { - "name": "symbol", - "in": "query", - "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) ", - "required": true, - "schema": { - "type": "string" - } - } - ], + "parameters": [], "responses": { "200": { "description": "", @@ -4706,68 +3604,334 @@ "code": { "type": "string" }, - "data": { - "type": "object", - "properties": { - "openOrderBuySize": { - "type": "integer", - "description": "Total number of the unexecuted buy orders\n" + "data": { + "type": "array", + "items": { + "type": "object", + "properties": { + "orderId": { + "type": "string", + "description": "The unique order id generated by the trading system,which can be used later for further actions such as canceling the order." + }, + "clientOid": { + "type": "string", + "description": "Unique order id created by users to identify their orders, the maximum length cannot exceed 40, e.g. UUID, Only allows numbers, characters, underline(_), and separator(-)" + }, + "symbol": { + "type": "string", + "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) " + }, + "code": { + "type": "string" + }, + "msg": { + "type": "string" + } + }, + "required": [ + "orderId", + "clientOid", + "symbol", + "code", + "msg" + ] + } + } + }, + "required": [ + "code", + "data" + ] + } + } + } + } + }, + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470236", + "x-abandon": "normal", + "x-domain": "Futures", + "x-api-channel": "Private", + "x-api-permission": "Futures", + "x-api-rate-limit-pool": "Futures", + "x-sdk-service": "Futures", + "x-sdk-sub-service": "Order", + "x-sdk-method-name": "batchAddOrders", + "x-sdk-method-description": "Place multiple order to the futures trading system, you can place two major types of orders: limit and market. Orders can only be placed if your account has sufficient funds. Once an order is placed, your funds will be put on hold for the duration of the order. The amount of funds on hold depends on the order type and parameters specified. You can place up to 20 orders at one time, including limit orders, market orders, and stop orders Please be noted that the system would hold the fees from the orders entered the orderbook in advance.", + "x-api-rate-limit": 20, + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "type": "object", + "properties": { + "clientOid": { + "type": "string", + "description": "Unique order id created by users to identify their orders, the maximum length cannot exceed 40, e.g. UUID, Only allows numbers, characters, underline(_), and separator(-)", + "example": [ + "5c52e11203aa677f33e493fb" + ] + }, + "side": { + "type": "string", + "description": "specify if the order is to 'buy' or 'sell'", + "enum": [ + "buy", + "sell" + ], + "x-api-enum": [ + { + "value": "buy", + "name": "", + "description": "" + }, + { + "value": "sell", + "name": "", + "description": "" + } + ], + "example": [ + "buy" + ] + }, + "symbol": { + "type": "string", + "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-221752070) ", + "example": [ + "XBTUSDTM" + ] + }, + "leverage": { + "type": "integer", + "description": "Used to calculate the margin to be frozen for the order. If you are to close the position, this parameter is not required.", + "example": [ + 3 + ] + }, + "type": { + "type": "string", + "description": "specify if the order is an 'limit' order or 'market' order", + "enum": [ + "limit", + "market" + ], + "default": "limit", + "x-api-enum": [ + { + "value": "limit", + "name": "", + "description": "" }, - "openOrderSellSize": { - "type": "integer", - "description": "Total number of the unexecuted sell orders\n" + { + "value": "market", + "name": "", + "description": "" + } + ], + "example": [ + "limit" + ] + }, + "remark": { + "type": "string", + "description": "remark for the order, length cannot exceed 100 utf8 characters" + }, + "stop": { + "type": "string", + "description": "Either 'down' or 'up'. If stop is used,parameter stopPrice and stopPriceType also need to be provieded.", + "enum": [ + "down", + "up" + ], + "x-api-enum": [ + { + "value": "down", + "name": "down", + "description": "Triggers when the price reaches or goes below the stopPrice." }, - "openOrderBuyCost": { - "type": "string", - "description": "Value of all the unexecuted buy orders\n" + { + "value": "up", + "name": "up", + "description": "Triggers when the price reaches or goes above the stopPrice" + } + ] + }, + "stopPriceType": { + "type": "string", + "description": "Either 'TP', 'IP' or 'MP', Need to be defined if stop is specified.", + "enum": [ + "TP", + "MP", + "IP" + ], + "x-api-enum": [ + { + "value": "TP", + "name": "trade price", + "description": "TP for trade price, The last trade price is the last price at which an order was filled. This price can be found in the latest match message." }, - "openOrderSellCost": { - "type": "string", - "description": "Value of all the unexecuted sell orders\n" + { + "value": "MP", + "name": "mark price", + "description": "MP for mark price, The mark price can be obtained through relevant OPEN API for index services" }, - "settleCurrency": { - "type": "string", - "description": "settlement currency\n" + { + "value": "IP", + "name": "index price", + "description": "IP for index price, The index price can be obtained through relevant OPEN API for index services" + } + ] + }, + "stopPrice": { + "type": "string", + "description": "Need to be defined if stop is specified. " + }, + "reduceOnly": { + "type": "boolean", + "description": "A mark to reduce the position size only. Set to false by default. Need to set the position size when reduceOnly is true. If set to true, only the orders reducing the position size will be executed. If the reduce-only order size exceeds the position size, the extra size will be canceled.", + "default": false + }, + "closeOrder": { + "type": "boolean", + "description": "A mark to close the position. Set to false by default. If closeOrder is set to true, the system will close the position and the position size will become 0. Side, Size and Leverage fields can be left empty and the system will determine the side and size automatically.", + "default": false + }, + "forceHold": { + "type": "boolean", + "description": "A mark to forcely hold the funds for an order, even though it's an order to reduce the position size. This helps the order stay on the order book and not get canceled when the position size changes. Set to false by default. The system will forcely freeze certain amount of funds for this order, including orders whose direction is opposite to the current positions. This feature is to ensure that the order won’t be canceled by the matching engine in such a circumstance that not enough funds are frozen for the order.", + "default": false + }, + "stp": { + "type": "string", + "description": "[Self Trade Prevention](https://www.kucoin.com/docs-new/doc-338146) is divided into these strategies: CN, CO, CB. Not supported DC at the moment.", + "enum": [ + "CN", + "CO", + "CB" + ], + "x-api-enum": [ + { + "value": "CN", + "name": "CN", + "description": "Cancel new, Cancel the new order" + }, + { + "value": "CO", + "name": "CO", + "description": "Cancel old, Cancel the old order" + }, + { + "value": "CB", + "name": "CB", + "description": "Cancel both, Cancel both sides" + } + ] + }, + "marginMode": { + "type": "string", + "description": "Margin mode: ISOLATED, CROSS, default: ISOLATED", + "enum": [ + "ISOLATED", + "CROSS" + ], + "default": "ISOLATED", + "x-api-enum": [ + { + "value": "ISOLATED", + "name": "", + "description": "" + }, + { + "value": "CROSS", + "name": "", + "description": "" } - }, - "required": [ - "openOrderBuySize", - "openOrderSellSize", - "openOrderBuyCost", - "openOrderSellCost", - "settleCurrency" ] + }, + "price": { + "type": "string", + "description": "Required for type is 'limit' order, indicating the operating price", + "example": [ + "0.1" + ] + }, + "size": { + "type": "integer", + "description": "**Choose one of size, qty, valueQty**, Order size (Lot), must be a positive integer. The quantity unit of coin-swap contracts is size(lot), and other units are not supported." + }, + "timeInForce": { + "type": "string", + "description": "Optional for type is 'limit' order, [Time in force](https://www.kucoin.com/docs-new/doc-338146) is a special strategy used during trading, default is GTC", + "enum": [ + "GTC", + "IOC" + ], + "default": "GTC", + "x-api-enum": [ + { + "value": "GTC", + "name": "Good Till Canceled", + "description": "order remains open on the order book until canceled. This is the default type if the field is left empty." + }, + { + "value": "IOC", + "name": "Immediate Or Cancel", + "description": "being matched or not, the remaining size of the order will be instantly canceled instead of entering the order book." + } + ] + }, + "postOnly": { + "type": "boolean", + "description": "Optional for type is 'limit' order, post only flag, invalid when timeInForce is IOC. When postOnly is true, not allowed choose hidden or iceberg. The post-only flag ensures that the trader always pays the maker fee and provides liquidity to the order book. If any part of the order is going to pay taker fee, the order will be fully rejected.", + "default": false + }, + "hidden": { + "type": "boolean", + "description": "Optional for type is 'limit' order, orders not displaying in order book. When hidden chose, not allowed choose postOnly.", + "default": false + }, + "iceberg": { + "type": "boolean", + "description": "Optional for type is 'limit' order, Only visible portion of the order is displayed in the order book. When iceberg chose, not allowed choose postOnly.", + "default": false + }, + "visibleSize": { + "type": "string", + "description": "Optional for type is 'limit' order, The maximum visible size of an iceberg order. please place order in size (lots), The units of qty (base currency) and valueQty (value) are not supported." + }, + "qty": { + "type": "string", + "description": "**Choose one of size, qty, valueQty**, Order size (Base currency) must be an integer multiple of the multiplier. The unit of the quantity of coin-swap is size(lot), which is not supported" + }, + "valueQty": { + "type": "string", + "description": "**Choose one of size, qty, valueQty**, Order size (Value), USDS-Swap correspond to USDT or USDC. The unit of the quantity of coin-swap is size(lot), which is not supported" } }, "required": [ - "code", - "data" + "clientOid", + "symbol", + "type", + "side", + "leverage" ] } - } + }, + "example": "[\n {\n \"clientOid\": \"5c52e11203aa677f33e493fb\",\n \"side\": \"buy\",\n \"symbol\": \"XBTUSDTM\",\n \"leverage\": 3,\n \"type\": \"limit\",\n \"remark\": \"order remarks\",\n \"reduceOnly\": false,\n \"marginMode\": \"ISOLATED\",\n \"price\": \"0.1\",\n \"size\": 1,\n \"timeInForce\": \"GTC\"\n },\n {\n \"clientOid\": \"5c52e11203aa677f33e493fc\",\n \"side\": \"buy\",\n \"symbol\": \"XBTUSDTM\",\n \"leverage\": 3,\n \"type\": \"limit\",\n \"remark\": \"order remarks\",\n \"reduceOnly\": false,\n \"marginMode\": \"ISOLATED\",\n \"price\": \"0.1\",\n \"size\": 1,\n \"timeInForce\": \"GTC\"\n }\n]" } } }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470250", - "x-abandon": "normal", - "x-domain": "Futures", - "x-api-channel": "Private", - "x-api-permission": "Futures", - "x-api-rate-limit-pool": "Futures", - "x-sdk-service": "Futures", - "x-sdk-sub-service": "Order", - "x-sdk-method-name": "GetOpenOrderValue", - "x-sdk-method-description": "You can query this endpoint to get the the total number and value of the all your active orders.", - "x-api-rate-limit": 10, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"openOrderBuySize\\\": 1,\\n \\\"openOrderSellSize\\\": 0,\\n \\\"openOrderBuyCost\\\": \\\"0.0001\\\",\\n \\\"openOrderSellCost\\\": \\\"0\\\",\\n \\\"settleCurrency\\\": \\\"USDT\\\"\\n }\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDTM\\\"}" + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": [\\n {\\n \\\"orderId\\\": \\\"235919387779985408\\\",\\n \\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\",\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"code\\\": \\\"200000\\\",\\n \\\"msg\\\": \\\"success\\\"\\n },\\n {\\n \\\"orderId\\\": \\\"235919387855482880\\\",\\n \\\"clientOid\\\": \\\"5c52e11203aa677f33e493fc\\\",\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"code\\\": \\\"200000\\\",\\n \\\"msg\\\": \\\"success\\\"\\n }\\n ]\\n}", + "x-request-example": "[{\\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\", \\\"side\\\": \\\"buy\\\", \\\"symbol\\\": \\\"XBTUSDTM\\\", \\\"leverage\\\": 3, \\\"type\\\": \\\"limit\\\", \\\"remark\\\": \\\"order remarks\\\", \\\"reduceOnly\\\": false, \\\"marginMode\\\": \\\"ISOLATED\\\", \\\"price\\\": \\\"0.1\\\", \\\"size\\\": 1, \\\"timeInForce\\\": \\\"GTC\\\"}, {\\\"clientOid\\\": \\\"5c52e11203aa677f33e493fc\\\", \\\"side\\\": \\\"buy\\\", \\\"symbol\\\": \\\"XBTUSDTM\\\", \\\"leverage\\\": 3, \\\"type\\\": \\\"limit\\\", \\\"remark\\\": \\\"order remarks\\\", \\\"reduceOnly\\\": false, \\\"marginMode\\\": \\\"ISOLATED\\\", \\\"price\\\": \\\"0.1\\\", \\\"size\\\": 1, \\\"timeInForce\\\": \\\"GTC\\\"}]" } }, - "/api/v1/orders/test": { + "/api/v1/st-orders": { "post": { - "summary": "Add Order Test", + "summary": "Add Take Profit And Stop Loss Order", "deprecated": false, - "description": "Place order to the futures trading system just for validation", + "description": "Place take profit and stop loss order supports both take-profit and stop-loss functions, and other functions are exactly the same as the place order interface.", "tags": [], "parameters": [], "responses": { @@ -4808,7 +3972,7 @@ } } }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470238", + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470237", "x-abandon": "normal", "x-domain": "Futures", "x-api-channel": "Private", @@ -4816,8 +3980,8 @@ "x-api-rate-limit-pool": "Futures", "x-sdk-service": "Futures", "x-sdk-sub-service": "Order", - "x-sdk-method-name": "addOrderTest", - "x-sdk-method-description": "Place order to the futures trading system just for validation", + "x-sdk-method-name": "addTPSLOrder", + "x-sdk-method-description": "Place take profit and stop loss order supports both take-profit and stop-loss functions, and other functions are exactly the same as the place order interface.", "x-api-rate-limit": 2, "requestBody": { "content": { @@ -4880,13 +4044,13 @@ "x-api-enum": [ { "value": "limit", - "name": "", - "description": "" + "name": "limit", + "description": "limit order" }, { "value": "market", - "name": "", - "description": "" + "name": "market", + "description": "market order" } ], "example": [ @@ -4897,29 +4061,9 @@ "type": "string", "description": "remark for the order, length cannot exceed 100 utf8 characters" }, - "stop": { - "type": "string", - "description": "Either 'down' or 'up'. If stop is used,parameter stopPrice and stopPriceType also need to be provieded.", - "enum": [ - "down", - "up" - ], - "x-api-enum": [ - { - "value": "down", - "name": "down", - "description": "Triggers when the price reaches or goes below the stopPrice." - }, - { - "value": "up", - "name": "up", - "description": "Triggers when the price reaches or goes above the stopPrice" - } - ] - }, "stopPriceType": { "type": "string", - "description": "Either 'TP', 'IP' or 'MP', Need to be defined if stop is specified.", + "description": "Either 'TP', 'IP' or 'MP'", "enum": [ "TP", "MP", @@ -4943,10 +4087,6 @@ } ] }, - "stopPrice": { - "type": "string", - "description": "Need to be defined if stop is specified. " - }, "reduceOnly": { "type": "boolean", "description": "A mark to reduce the position size only. Set to false by default. Need to set the position size when reduceOnly is true. If set to true, only the orders reducing the position size will be executed. If the reduce-only order size exceeds the position size, the extra size will be canceled.", @@ -5060,6 +4200,14 @@ "type": "string", "description": "Optional for type is 'limit' order, The maximum visible size of an iceberg order. please place order in size (lots), The units of qty (base currency) and valueQty (value) are not supported." }, + "triggerStopUpPrice": { + "type": "string", + "description": "Take profit price" + }, + "triggerStopDownPrice": { + "type": "string", + "description": "Stop loss price" + }, "qty": { "type": "string", "description": "**Choose one of size, qty, valueQty**, Order size (Base currency) must be an integer multiple of the multiplier. The unit of the quantity of coin-swap is size(lot), which is not supported" @@ -5077,12 +4225,12 @@ "leverage" ] }, - "example": "{\n \"clientOid\": \"5c52e11203aa677f33e493fb\",\n \"side\": \"buy\",\n \"symbol\": \"XBTUSDTM\",\n \"leverage\": 3,\n \"type\": \"limit\",\n \"remark\": \"order remarks\",\n \"reduceOnly\": false,\n \"marginMode\": \"ISOLATED\",\n \"price\": \"0.1\",\n \"size\": 1,\n \"timeInForce\": \"GTC\"\n}" + "example": "{\n \"clientOid\": \"5c52e11203aa677f33e493fb\",\n \"side\": \"buy\",\n \"symbol\": \"XBTUSDTM\",\n \"leverage\": 3,\n \"type\": \"limit\",\n \"remark\": \"order remarks\",\n \"reduceOnly\": false,\n \"marginMode\": \"ISOLATED\",\n \"price\": \"0.2\",\n \"size\": 1,\n \"timeInForce\": \"GTC\",\n \"triggerStopUpPrice\": \"0.3\",\n \"triggerStopDownPrice\": \"0.1\",\n \"stopPriceType\": \"TP\"\n}" } } }, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"orderId\\\": \\\"234125150956625920\\\",\\n \\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\"\\n }\\n}", - "x-request-example": "{\\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\", \\\"side\\\": \\\"buy\\\", \\\"symbol\\\": \\\"XBTUSDTM\\\", \\\"leverage\\\": 3, \\\"type\\\": \\\"limit\\\", \\\"remark\\\": \\\"order remarks\\\", \\\"reduceOnly\\\": false, \\\"marginMode\\\": \\\"ISOLATED\\\", \\\"price\\\": \\\"0.1\\\", \\\"size\\\": 1, \\\"timeInForce\\\": \\\"GTC\\\"}" + "x-request-example": "{\\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\", \\\"side\\\": \\\"buy\\\", \\\"symbol\\\": \\\"XBTUSDTM\\\", \\\"leverage\\\": 3, \\\"type\\\": \\\"limit\\\", \\\"remark\\\": \\\"order remarks\\\", \\\"reduceOnly\\\": false, \\\"marginMode\\\": \\\"ISOLATED\\\", \\\"price\\\": \\\"0.2\\\", \\\"size\\\": 1, \\\"timeInForce\\\": \\\"GTC\\\", \\\"triggerStopUpPrice\\\": \\\"0.3\\\", \\\"triggerStopDownPrice\\\": \\\"0.1\\\", \\\"stopPriceType\\\": \\\"TP\\\"}" } }, "/api/v1/orders/{orderId}": { @@ -5349,7 +4497,7 @@ { "name": "symbol", "in": "query", - "description": "Cancel all limit orders for a specific contract only, If not specified, all the limit orders will be deleted, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) ", + "description": "Cancel all limit orders for a specific symbol only, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) ", "required": true, "schema": { "type": "string" @@ -5390,37 +4538,193 @@ } } } - } - }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470242", - "x-abandon": "normal", - "x-domain": "Futures", - "x-api-channel": "Private", - "x-api-permission": "Futures", - "x-api-rate-limit-pool": "Futures", - "x-sdk-service": "Futures", - "x-sdk-sub-service": "Order", - "x-sdk-method-name": "cancelAllOrdersV3", - "x-sdk-method-description": "Cancel all open orders (excluding stop orders). The response is a list of orderIDs of the canceled orders.", - "x-api-rate-limit": 30, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"cancelledOrderIds\\\": [\\n \\\"235919172150824960\\\",\\n \\\"235919172150824961\\\"\\n ]\\n }\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDTM\\\"}" - } - }, - "/api/v1/stopOrders": { - "delete": { - "summary": "Cancel All Stop orders", - "deprecated": false, - "description": "Cancel all untriggered stop orders. The response is a list of orderIDs of the canceled stop orders. To cancel triggered stop orders, please use 'Cancel Multiple Futures Limit orders'.", - "tags": [], - "parameters": [ + } + }, + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470242", + "x-abandon": "normal", + "x-domain": "Futures", + "x-api-channel": "Private", + "x-api-permission": "Futures", + "x-api-rate-limit-pool": "Futures", + "x-sdk-service": "Futures", + "x-sdk-sub-service": "Order", + "x-sdk-method-name": "cancelAllOrdersV3", + "x-sdk-method-description": "Cancel all open orders (excluding stop orders). The response is a list of orderIDs of the canceled orders.", + "x-api-rate-limit": 10, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"cancelledOrderIds\\\": [\\n \\\"235919172150824960\\\",\\n \\\"235919172150824961\\\"\\n ]\\n }\\n}", + "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDTM\\\"}" + } + }, + "/api/v1/stopOrders": { + "delete": { + "summary": "Cancel All Stop orders", + "deprecated": false, + "description": "Cancel all untriggered stop orders. The response is a list of orderIDs of the canceled stop orders. To cancel triggered stop orders, please use 'Cancel Multiple Futures Limit orders'.", + "tags": [], + "parameters": [ + { + "name": "symbol", + "in": "query", + "description": "Cancel all limit orders for a specific contract only, If not specified, all the limit orders will be deleted, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) ", + "required": false, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "object", + "properties": { + "cancelledOrderIds": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Unique ID of the cancelled order" + } + }, + "required": [ + "cancelledOrderIds" + ] + } + }, + "required": [ + "code", + "data" + ] + } + } + } + } + }, + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470243", + "x-abandon": "normal", + "x-domain": "Futures", + "x-api-channel": "Private", + "x-api-permission": "Futures", + "x-api-rate-limit-pool": "Futures", + "x-sdk-service": "Futures", + "x-sdk-sub-service": "Order", + "x-sdk-method-name": "cancelAllStopOrders", + "x-sdk-method-description": "Cancel all untriggered stop orders. The response is a list of orderIDs of the canceled stop orders. To cancel triggered stop orders, please use 'Cancel Multiple Futures Limit orders'.", + "x-api-rate-limit": 15, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"cancelledOrderIds\\\": [\\n \\\"235919172150824960\\\",\\n \\\"235919172150824961\\\"\\n ]\\n }\\n}", + "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDTM\\\"}" + }, + "get": { + "summary": "Get Stop Order List", + "deprecated": false, + "description": "Get the un-triggered stop orders list. Stop orders that have been triggered can be queried through the general order interface", + "tags": [], + "parameters": [ + { + "name": "symbol", + "in": "query", + "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) ", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "side", + "in": "query", + "description": "buy or sell", + "required": false, + "schema": { + "type": "string", + "enum": [ + "buy", + "sell" + ], + "x-api-enum": [ + { + "value": "buy", + "name": "", + "description": "" + }, + { + "value": "sell", + "name": "", + "description": "" + } + ] + } + }, + { + "name": "type", + "in": "query", + "description": "limit, market", + "required": false, + "schema": { + "type": "string", + "enum": [ + "limit", + "market" + ], + "x-api-enum": [ + { + "value": "limit", + "name": "", + "description": "" + }, + { + "value": "market", + "name": "", + "description": "" + } + ] + } + }, + { + "name": "startAt", + "in": "query", + "description": "Start time (milisecond)", + "required": false, + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "endAt", + "in": "query", + "description": "End time (milisecond)", + "required": false, + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "currentPage", + "in": "query", + "description": "Current request page, The default currentPage is 1", + "required": false, + "schema": { + "type": "integer" + } + }, { - "name": "symbol", + "name": "pageSize", "in": "query", - "description": "Cancel all limit orders for a specific contract only, If not specified, all the limit orders will be deleted, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) ", + "description": "pageSize, The default pageSize is 50, The maximum cannot exceed 1000", "required": false, "schema": { - "type": "string" + "type": "integer", + "maximum": 1000, + "default": 50 } } ], @@ -5438,16 +4742,231 @@ "data": { "type": "object", "properties": { - "cancelledOrderIds": { + "currentPage": { + "type": "integer", + "description": "Current request page, The default currentPage is 1" + }, + "pageSize": { + "type": "integer", + "description": "pageSize, The default pageSize is 50, The maximum cannot exceed 1000" + }, + "totalNum": { + "type": "integer" + }, + "totalPage": { + "type": "integer" + }, + "items": { "type": "array", "items": { - "type": "string" - }, - "description": "Unique ID of the cancelled order" + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Order ID" + }, + "symbol": { + "type": "string", + "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) " + }, + "type": { + "type": "string", + "description": "Order type, market order or limit order\n" + }, + "side": { + "type": "string", + "description": "Transaction side" + }, + "price": { + "type": "string", + "description": "Order price" + }, + "size": { + "type": "integer", + "description": "Order quantity" + }, + "value": { + "type": "string", + "description": "Order value" + }, + "dealValue": { + "type": "string", + "description": "Executed size of funds\n" + }, + "dealSize": { + "type": "integer", + "description": "Executed quantity" + }, + "stp": { + "type": "string", + "description": "self trade prevention" + }, + "stop": { + "type": "string", + "description": "Stop order type (stop limit or stop market)" + }, + "stopPriceType": { + "type": "string", + "description": "Trigger price type of stop orders" + }, + "stopTriggered": { + "type": "boolean", + "description": "Mark to show whether the stop order is triggered" + }, + "stopPrice": { + "type": "string", + "description": "Trigger price of stop orders" + }, + "timeInForce": { + "type": "string", + "description": "Time in force policy type" + }, + "postOnly": { + "type": "boolean", + "description": "Mark of post only" + }, + "hidden": { + "type": "boolean", + "description": "Mark of the hidden order" + }, + "iceberg": { + "type": "boolean", + "description": "Mark of the iceberg order" + }, + "leverage": { + "type": "string", + "description": "Leverage of the order" + }, + "forceHold": { + "type": "boolean", + "description": "A mark to forcely hold the funds for an order" + }, + "closeOrder": { + "type": "boolean", + "description": "A mark to close the position" + }, + "visibleSize": { + "type": "integer", + "description": "Visible size of the iceberg order" + }, + "clientOid": { + "type": "string", + "description": "Unique order id created by users to identify their orders" + }, + "remark": { + "type": "string", + "description": "Remark of the order" + }, + "tags": { + "type": "string", + "description": "tag order source" + }, + "isActive": { + "type": "boolean", + "description": "Mark of the active orders" + }, + "cancelExist": { + "type": "boolean", + "description": "Mark of the canceled orders" + }, + "createdAt": { + "type": "integer", + "description": "Time the order created", + "format": "int64" + }, + "updatedAt": { + "type": "integer", + "description": "last update time", + "format": "int64" + }, + "endAt": { + "type": "integer", + "description": "End time", + "format": "int64" + }, + "orderTime": { + "type": "integer", + "description": "Order create time in nanosecond", + "format": "int64" + }, + "settleCurrency": { + "type": "string", + "description": "settlement currency" + }, + "marginMode": { + "type": "string", + "description": "Margin mode: ISOLATED (isolated), CROSS (cross margin)." + }, + "avgDealPrice": { + "type": "string", + "description": "Average transaction price, forward contract average transaction price = sum (transaction value) / sum (transaction quantity), reverse contract average transaction price = sum (transaction quantity) / sum (transaction value). Transaction quantity = lots * multiplier" + }, + "filledSize": { + "type": "integer", + "description": "Value of the executed orders" + }, + "filledValue": { + "type": "string", + "description": "Executed order quantity" + }, + "status": { + "type": "string", + "description": "order status: “open” or “done”" + }, + "reduceOnly": { + "type": "boolean", + "description": "A mark to reduce the position size only" + } + }, + "required": [ + "id", + "symbol", + "type", + "side", + "price", + "size", + "value", + "dealValue", + "dealSize", + "stp", + "stop", + "stopPriceType", + "stopTriggered", + "stopPrice", + "timeInForce", + "postOnly", + "hidden", + "iceberg", + "leverage", + "forceHold", + "closeOrder", + "visibleSize", + "clientOid", + "remark", + "tags", + "isActive", + "cancelExist", + "createdAt", + "updatedAt", + "endAt", + "orderTime", + "settleCurrency", + "marginMode", + "avgDealPrice", + "filledSize", + "filledValue", + "status", + "reduceOnly" + ] + } } }, "required": [ - "cancelledOrderIds" + "currentPage", + "pageSize", + "totalNum", + "totalPage", + "items" ] } }, @@ -5460,7 +4979,7 @@ } } }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470243", + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470247", "x-abandon": "normal", "x-domain": "Futures", "x-api-channel": "Private", @@ -5468,116 +4987,28 @@ "x-api-rate-limit-pool": "Futures", "x-sdk-service": "Futures", "x-sdk-sub-service": "Order", - "x-sdk-method-name": "cancelAllStopOrders", - "x-sdk-method-description": "Cancel all untriggered stop orders. The response is a list of orderIDs of the canceled stop orders. To cancel triggered stop orders, please use 'Cancel Multiple Futures Limit orders'.", - "x-api-rate-limit": 15, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"cancelledOrderIds\\\": [\\n \\\"235919172150824960\\\",\\n \\\"235919172150824961\\\"\\n ]\\n }\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDTM\\\"}" - }, + "x-sdk-method-name": "GetStopOrderList", + "x-sdk-method-description": "Get the un-triggered stop orders list. Stop orders that have been triggered can be queried through the general order interface", + "x-api-rate-limit": 6, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"currentPage\\\": 1,\\n \\\"pageSize\\\": 50,\\n \\\"totalNum\\\": 1,\\n \\\"totalPage\\\": 1,\\n \\\"items\\\": [\\n {\\n \\\"id\\\": \\\"230181737576050688\\\",\\n \\\"symbol\\\": \\\"PEOPLEUSDTM\\\",\\n \\\"type\\\": \\\"limit\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"price\\\": \\\"0.05\\\",\\n \\\"size\\\": 10,\\n \\\"value\\\": \\\"5\\\",\\n \\\"dealValue\\\": \\\"0\\\",\\n \\\"dealSize\\\": 0,\\n \\\"stp\\\": \\\"\\\",\\n \\\"stop\\\": \\\"\\\",\\n \\\"stopPriceType\\\": \\\"\\\",\\n \\\"stopTriggered\\\": false,\\n \\\"stopPrice\\\": null,\\n \\\"timeInForce\\\": \\\"GTC\\\",\\n \\\"postOnly\\\": false,\\n \\\"hidden\\\": false,\\n \\\"iceberg\\\": false,\\n \\\"leverage\\\": \\\"1\\\",\\n \\\"forceHold\\\": false,\\n \\\"closeOrder\\\": false,\\n \\\"visibleSize\\\": 0,\\n \\\"clientOid\\\": \\\"5a80bd847f1811ef8a7faa665a37b3d7\\\",\\n \\\"remark\\\": null,\\n \\\"tags\\\": \\\"\\\",\\n \\\"isActive\\\": true,\\n \\\"cancelExist\\\": false,\\n \\\"createdAt\\\": 1727692804813,\\n \\\"updatedAt\\\": 1727692804813,\\n \\\"endAt\\\": null,\\n \\\"orderTime\\\": 1727692804808418000,\\n \\\"settleCurrency\\\": \\\"USDT\\\",\\n \\\"marginMode\\\": \\\"ISOLATED\\\",\\n \\\"avgDealPrice\\\": \\\"0\\\",\\n \\\"filledSize\\\": 0,\\n \\\"filledValue\\\": \\\"0\\\",\\n \\\"status\\\": \\\"open\\\",\\n \\\"reduceOnly\\\": false\\n }\\n ]\\n }\\n}", + "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDTM\\\", \\\"side\\\": \\\"buy\\\", \\\"type\\\": \\\"limit\\\", \\\"startAt\\\": 123456, \\\"endAt\\\": 123456, \\\"currentPage\\\": 123456, \\\"pageSize\\\": 50}" + } + }, + "/api/v1/orders/{order-id}": { "get": { - "summary": "Get Stop Order List", + "summary": "Get Order By OrderId", "deprecated": false, - "description": "Get the un-triggered stop orders list. Stop orders that have been triggered can be queried through the general order interface", + "description": "Get a single order by order id (including a stop order).", "tags": [], "parameters": [ { - "name": "symbol", - "in": "query", - "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) ", - "required": false, + "name": "order-id", + "in": "path", + "description": "", + "required": true, "schema": { "type": "string" } - }, - { - "name": "side", - "in": "query", - "description": "buy or sell", - "required": false, - "schema": { - "type": "string", - "enum": [ - "buy", - "sell" - ], - "x-api-enum": [ - { - "value": "buy", - "name": "", - "description": "" - }, - { - "value": "sell", - "name": "", - "description": "" - } - ] - } - }, - { - "name": "type", - "in": "query", - "description": "limit, market", - "required": false, - "schema": { - "type": "string", - "enum": [ - "limit", - "market" - ], - "x-api-enum": [ - { - "value": "limit", - "name": "", - "description": "" - }, - { - "value": "market", - "name": "", - "description": "" - } - ] - } - }, - { - "name": "startAt", - "in": "query", - "description": "Start time (milisecond)", - "required": false, - "schema": { - "type": "integer", - "format": "int64" - } - }, - { - "name": "endAt", - "in": "query", - "description": "End time (milisecond)", - "required": false, - "schema": { - "type": "integer", - "format": "int64" - } - }, - { - "name": "currentPage", - "in": "query", - "description": "Current request page, The default currentPage is 1", - "required": false, - "schema": { - "type": "integer" - } - }, - { - "name": "pageSize", - "in": "query", - "description": "pageSize, The default pageSize is 50, The maximum cannot exceed 1000", - "required": false, - "schema": { - "type": "integer", - "maximum": 1000, - "default": 50 - } } ], "responses": { @@ -5594,231 +5025,321 @@ "data": { "type": "object", "properties": { - "currentPage": { + "id": { + "type": "string", + "description": "Order ID" + }, + "symbol": { + "type": "string", + "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) " + }, + "type": { + "type": "string", + "description": "Order type, market order or limit order", + "enum": [ + "market", + "limit" + ], + "x-api-enum": [ + { + "value": "market", + "name": "market", + "description": "Market Order" + }, + { + "value": "limit", + "name": "limit", + "description": "Limit Order" + } + ] + }, + "side": { + "type": "string", + "description": "Transaction side", + "enum": [ + "buy", + "sell" + ], + "x-api-enum": [ + { + "value": "buy", + "name": "buy", + "description": "buy" + }, + { + "value": "sell", + "name": "sell", + "description": "sell" + } + ] + }, + "price": { + "type": "string", + "description": "Order price" + }, + "size": { + "type": "integer", + "description": "Order quantity" + }, + "value": { + "type": "string", + "description": "Order value\n" + }, + "dealValue": { + "type": "string", + "description": "Executed size of funds\n" + }, + "dealSize": { + "type": "integer", + "description": "Executed quantity\n" + }, + "stp": { + "type": "string", + "description": "[Self Trade Prevention](https://www.kucoin.com/docs-new/doc-338146) is divided into these strategies: CN, CO, CB. Not supported DC at the moment.", + "enum": [ + "", + "CN", + "CO", + "CB" + ], + "x-api-enum": [ + { + "value": "", + "name": "NULL", + "description": "Null means not stp order" + }, + { + "value": "CN", + "name": "CN", + "description": "Cancel new, Cancel the new order" + }, + { + "value": "CO", + "name": "CO", + "description": "Cancel old, Cancel the old order" + }, + { + "value": "CB", + "name": "CB", + "description": "Cancel both, Cancel both sides" + } + ] + }, + "stop": { + "type": "string", + "description": "Stop order type (stop limit or stop market)\n" + }, + "stopPriceType": { + "type": "string", + "description": "Trigger price type of stop orders", + "enum": [ + "", + "TP", + "MP", + "IP" + ], + "x-api-enum": [ + { + "value": "", + "name": "NULL", + "description": "" + }, + { + "value": "TP", + "name": "trade price", + "description": "TP for trade price, The last trade price is the last price at which an order was filled. This price can be found in the latest match message." + }, + { + "value": "MP", + "name": "mark price", + "description": "MP for mark price, The mark price can be obtained through relevant OPEN API for index services" + }, + { + "value": "IP", + "name": "index price", + "description": "IP for index price, The index price can be obtained through relevant OPEN API for index services" + } + ] + }, + "stopTriggered": { + "type": "boolean", + "description": "Mark to show whether the stop order is triggered" + }, + "stopPrice": { + "type": "number", + "description": "Trigger price of stop orders" + }, + "timeInForce": { + "type": "string", + "description": "Time in force policy type\n" + }, + "postOnly": { + "type": "boolean", + "description": "Mark of post only\n" + }, + "hidden": { + "type": "boolean", + "description": "Mark of the hidden order\n" + }, + "iceberg": { + "type": "boolean", + "description": "Mark of the iceberg order\n" + }, + "leverage": { + "type": "string", + "description": "Leverage of the order\n" + }, + "forceHold": { + "type": "boolean", + "description": "A mark to forcely hold the funds for an order\n" + }, + "closeOrder": { + "type": "boolean", + "description": "A mark to close the position\n" + }, + "visibleSize": { "type": "integer", - "description": "Current request page, The default currentPage is 1" + "description": "Visible size of the iceberg order\n" }, - "pageSize": { + "clientOid": { + "type": "string", + "description": "Unique order id created by users to identify their orders\n" + }, + "remark": { + "type": "string", + "description": "Remark" + }, + "tags": { + "type": "string", + "description": "tag order source\n" + }, + "isActive": { + "type": "boolean", + "description": "Mark of the active orders\n" + }, + "cancelExist": { + "type": "boolean", + "description": "Mark of the canceled orders\n" + }, + "createdAt": { "type": "integer", - "description": "pageSize, The default pageSize is 50, The maximum cannot exceed 1000" + "description": "Time the order created\n", + "format": "int64" }, - "totalNum": { - "type": "integer" + "updatedAt": { + "type": "integer", + "description": "last update time\n", + "format": "int64" }, - "totalPage": { - "type": "integer" + "endAt": { + "type": "integer", + "description": "Order Endtime", + "format": "int64" }, - "items": { - "type": "array", - "items": { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "Order ID" - }, - "symbol": { - "type": "string", - "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) " - }, - "type": { - "type": "string", - "description": "Order type, market order or limit order\n" - }, - "side": { - "type": "string", - "description": "Transaction side" - }, - "price": { - "type": "string", - "description": "Order price" - }, - "size": { - "type": "integer", - "description": "Order quantity" - }, - "value": { - "type": "string", - "description": "Order value" - }, - "dealValue": { - "type": "string", - "description": "Executed size of funds\n" - }, - "dealSize": { - "type": "integer", - "description": "Executed quantity" - }, - "stp": { - "type": "string", - "description": "self trade prevention" - }, - "stop": { - "type": "string", - "description": "Stop order type (stop limit or stop market)" - }, - "stopPriceType": { - "type": "string", - "description": "Trigger price type of stop orders" - }, - "stopTriggered": { - "type": "boolean", - "description": "Mark to show whether the stop order is triggered" - }, - "stopPrice": { - "type": "string", - "description": "Trigger price of stop orders" - }, - "timeInForce": { - "type": "string", - "description": "Time in force policy type" - }, - "postOnly": { - "type": "boolean", - "description": "Mark of post only" - }, - "hidden": { - "type": "boolean", - "description": "Mark of the hidden order" - }, - "iceberg": { - "type": "boolean", - "description": "Mark of the iceberg order" - }, - "leverage": { - "type": "string", - "description": "Leverage of the order" - }, - "forceHold": { - "type": "boolean", - "description": "A mark to forcely hold the funds for an order" - }, - "closeOrder": { - "type": "boolean", - "description": "A mark to close the position" - }, - "visibleSize": { - "type": "integer", - "description": "Visible size of the iceberg order" - }, - "clientOid": { - "type": "string", - "description": "Unique order id created by users to identify their orders" - }, - "remark": { - "type": "string", - "description": "Remark of the order" - }, - "tags": { - "type": "string", - "description": "tag order source" - }, - "isActive": { - "type": "boolean", - "description": "Mark of the active orders" - }, - "cancelExist": { - "type": "boolean", - "description": "Mark of the canceled orders" - }, - "createdAt": { - "type": "integer", - "description": "Time the order created", - "format": "int64" - }, - "updatedAt": { - "type": "integer", - "description": "last update time", - "format": "int64" - }, - "endAt": { - "type": "integer", - "description": "End time", - "format": "int64" - }, - "orderTime": { - "type": "integer", - "description": "Order create time in nanosecond", - "format": "int64" - }, - "settleCurrency": { - "type": "string", - "description": "settlement currency" - }, - "marginMode": { - "type": "string", - "description": "Margin mode: ISOLATED (isolated), CROSS (cross margin)." - }, - "avgDealPrice": { - "type": "string", - "description": "Average transaction price, forward contract average transaction price = sum (transaction value) / sum (transaction quantity), reverse contract average transaction price = sum (transaction quantity) / sum (transaction value). Transaction quantity = lots * multiplier" - }, - "filledSize": { - "type": "integer", - "description": "Value of the executed orders" - }, - "filledValue": { - "type": "string", - "description": "Executed order quantity" - }, - "status": { - "type": "string", - "description": "order status: “open” or “done”" - }, - "reduceOnly": { - "type": "boolean", - "description": "A mark to reduce the position size only" - } + "orderTime": { + "type": "integer", + "description": "Order create time in nanosecond\n", + "format": "int64" + }, + "settleCurrency": { + "type": "string", + "description": "settlement currency\n" + }, + "marginMode": { + "type": "string", + "description": "Margin mode: ISOLATED (isolated), CROSS (cross margin).\n", + "enum": [ + "CROSS", + "ISOLATED" + ], + "x-api-enum": [ + { + "value": "CROSS", + "name": "CROSS", + "description": "Cross margin" }, - "required": [ - "id", - "symbol", - "type", - "side", - "price", - "size", - "value", - "dealValue", - "dealSize", - "stp", - "stop", - "stopPriceType", - "stopTriggered", - "stopPrice", - "timeInForce", - "postOnly", - "hidden", - "iceberg", - "leverage", - "forceHold", - "closeOrder", - "visibleSize", - "clientOid", - "remark", - "tags", - "isActive", - "cancelExist", - "createdAt", - "updatedAt", - "endAt", - "orderTime", - "settleCurrency", - "marginMode", - "avgDealPrice", - "filledSize", - "filledValue", - "status", - "reduceOnly" - ] - } + { + "value": "ISOLATED", + "name": "ISOLATED", + "description": "Isolated margin" + } + ] + }, + "avgDealPrice": { + "type": "string", + "description": "Average transaction price, forward contract average transaction price = sum (transaction value) / sum (transaction quantity), reverse contract average transaction price = sum (transaction quantity) / sum (transaction value). Transaction quantity = lots * multiplier\n" + }, + "filledSize": { + "type": "integer", + "description": "Value of the executed orders\n" + }, + "filledValue": { + "type": "string", + "description": "Executed order quantity\n" + }, + "status": { + "type": "string", + "description": "order status: “open” or “done”\n", + "enum": [ + "open", + "done" + ], + "x-api-enum": [ + { + "value": "open", + "name": "open", + "description": "open order" + }, + { + "value": "done", + "name": "done", + "description": "done order" + } + ] + }, + "reduceOnly": { + "type": "boolean", + "description": "A mark to reduce the position size only\n" } }, "required": [ - "currentPage", - "pageSize", - "totalNum", - "totalPage", - "items" + "id", + "symbol", + "type", + "side", + "price", + "size", + "value", + "dealValue", + "dealSize", + "stp", + "stop", + "stopPriceType", + "stopTriggered", + "stopPrice", + "timeInForce", + "postOnly", + "hidden", + "iceberg", + "leverage", + "forceHold", + "closeOrder", + "visibleSize", + "clientOid", + "remark", + "tags", + "isActive", + "cancelExist", + "createdAt", + "updatedAt", + "orderTime", + "settleCurrency", + "marginMode", + "avgDealPrice", + "filledSize", + "filledValue", + "status", + "reduceOnly" ] } }, @@ -5831,33 +5352,33 @@ } } }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470247", + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470245", "x-abandon": "normal", "x-domain": "Futures", "x-api-channel": "Private", - "x-api-permission": "Futures", + "x-api-permission": "General", "x-api-rate-limit-pool": "Futures", "x-sdk-service": "Futures", "x-sdk-sub-service": "Order", - "x-sdk-method-name": "GetStopOrderList", - "x-sdk-method-description": "Get the un-triggered stop orders list. Stop orders that have been triggered can be queried through the general order interface", - "x-api-rate-limit": 6, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"currentPage\\\": 1,\\n \\\"pageSize\\\": 50,\\n \\\"totalNum\\\": 1,\\n \\\"totalPage\\\": 1,\\n \\\"items\\\": [\\n {\\n \\\"id\\\": \\\"230181737576050688\\\",\\n \\\"symbol\\\": \\\"PEOPLEUSDTM\\\",\\n \\\"type\\\": \\\"limit\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"price\\\": \\\"0.05\\\",\\n \\\"size\\\": 10,\\n \\\"value\\\": \\\"5\\\",\\n \\\"dealValue\\\": \\\"0\\\",\\n \\\"dealSize\\\": 0,\\n \\\"stp\\\": \\\"\\\",\\n \\\"stop\\\": \\\"\\\",\\n \\\"stopPriceType\\\": \\\"\\\",\\n \\\"stopTriggered\\\": false,\\n \\\"stopPrice\\\": null,\\n \\\"timeInForce\\\": \\\"GTC\\\",\\n \\\"postOnly\\\": false,\\n \\\"hidden\\\": false,\\n \\\"iceberg\\\": false,\\n \\\"leverage\\\": \\\"1\\\",\\n \\\"forceHold\\\": false,\\n \\\"closeOrder\\\": false,\\n \\\"visibleSize\\\": 0,\\n \\\"clientOid\\\": \\\"5a80bd847f1811ef8a7faa665a37b3d7\\\",\\n \\\"remark\\\": null,\\n \\\"tags\\\": \\\"\\\",\\n \\\"isActive\\\": true,\\n \\\"cancelExist\\\": false,\\n \\\"createdAt\\\": 1727692804813,\\n \\\"updatedAt\\\": 1727692804813,\\n \\\"endAt\\\": null,\\n \\\"orderTime\\\": 1727692804808418000,\\n \\\"settleCurrency\\\": \\\"USDT\\\",\\n \\\"marginMode\\\": \\\"ISOLATED\\\",\\n \\\"avgDealPrice\\\": \\\"0\\\",\\n \\\"filledSize\\\": 0,\\n \\\"filledValue\\\": \\\"0\\\",\\n \\\"status\\\": \\\"open\\\",\\n \\\"reduceOnly\\\": false\\n }\\n ]\\n }\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDTM\\\", \\\"side\\\": \\\"buy\\\", \\\"type\\\": \\\"limit\\\", \\\"startAt\\\": 123456, \\\"endAt\\\": 123456, \\\"currentPage\\\": 123456, \\\"pageSize\\\": 50}" + "x-sdk-method-name": "getOrderByOrderId", + "x-sdk-method-description": "Get a single order by order id (including a stop order).", + "x-api-rate-limit": 5, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"id\\\": \\\"236655147005071361\\\",\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"type\\\": \\\"limit\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"price\\\": \\\"0.1\\\",\\n \\\"size\\\": 1,\\n \\\"value\\\": \\\"0.0001\\\",\\n \\\"dealValue\\\": \\\"0\\\",\\n \\\"dealSize\\\": 0,\\n \\\"stp\\\": \\\"\\\",\\n \\\"stop\\\": \\\"\\\",\\n \\\"stopPriceType\\\": \\\"\\\",\\n \\\"stopTriggered\\\": false,\\n \\\"stopPrice\\\": null,\\n \\\"timeInForce\\\": \\\"GTC\\\",\\n \\\"postOnly\\\": false,\\n \\\"hidden\\\": false,\\n \\\"iceberg\\\": false,\\n \\\"leverage\\\": \\\"3\\\",\\n \\\"forceHold\\\": false,\\n \\\"closeOrder\\\": false,\\n \\\"visibleSize\\\": 0,\\n \\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\",\\n \\\"remark\\\": null,\\n \\\"tags\\\": \\\"\\\",\\n \\\"isActive\\\": true,\\n \\\"cancelExist\\\": false,\\n \\\"createdAt\\\": 1729236185949,\\n \\\"updatedAt\\\": 1729236185949,\\n \\\"endAt\\\": null,\\n \\\"orderTime\\\": 1729236185885647952,\\n \\\"settleCurrency\\\": \\\"USDT\\\",\\n \\\"marginMode\\\": \\\"ISOLATED\\\",\\n \\\"avgDealPrice\\\": \\\"0\\\",\\n \\\"filledSize\\\": 0,\\n \\\"filledValue\\\": \\\"0\\\",\\n \\\"status\\\": \\\"open\\\",\\n \\\"reduceOnly\\\": false\\n }\\n}", + "x-request-example": "{\\\"order-id\\\": \\\"236655147005071361\\\"}" } }, - "/api/v1/orders/{order-id}": { + "/api/v1/orders/byClientOid": { "get": { - "summary": "Get Order By OrderId", + "summary": "Get Order By ClientOid", "deprecated": false, - "description": "Get a single order by order id (including a stop order).", + "description": "Get a single order by client order id (including a stop order).", "tags": [], "parameters": [ { - "name": "order-id", - "in": "path", - "description": "", - "required": true, + "name": "clientOid", + "in": "query", + "description": "The user self-defined order id.", + "required": false, "schema": { "type": "string" } @@ -5958,7 +5479,7 @@ { "value": "", "name": "NULL", - "description": "Null means not stp order" + "description": "None" }, { "value": "CN", @@ -5994,7 +5515,7 @@ { "value": "", "name": "NULL", - "description": "" + "description": "None" }, { "value": "TP", @@ -6045,153 +5566,496 @@ "type": "boolean", "description": "A mark to forcely hold the funds for an order\n" }, - "closeOrder": { + "closeOrder": { + "type": "boolean", + "description": "A mark to close the position\n" + }, + "visibleSize": { + "type": "integer", + "description": "Visible size of the iceberg order\n" + }, + "clientOid": { + "type": "string", + "description": "Unique order id created by users to identify their orders\n" + }, + "remark": { + "type": "string", + "description": "Remark" + }, + "tags": { + "type": "string", + "description": "tag order source\n" + }, + "isActive": { + "type": "boolean", + "description": "Mark of the active orders\n" + }, + "cancelExist": { + "type": "boolean", + "description": "Mark of the canceled orders\n" + }, + "createdAt": { + "type": "integer", + "description": "Time the order created\n", + "format": "int64" + }, + "updatedAt": { + "type": "integer", + "description": "last update time\n", + "format": "int64" + }, + "endAt": { + "type": "integer", + "description": "Order Endtime", + "format": "int64" + }, + "orderTime": { + "type": "integer", + "description": "Order create time in nanosecond\n", + "format": "int64" + }, + "settleCurrency": { + "type": "string", + "description": "settlement currency\n" + }, + "marginMode": { + "type": "string", + "description": "Margin mode: ISOLATED (isolated), CROSS (cross margin).\n", + "enum": [ + "CROSS", + "ISOLATED" + ], + "x-api-enum": [ + { + "value": "CROSS", + "name": "CROSS", + "description": "Cross margin" + }, + { + "value": "ISOLATED", + "name": "ISOLATED", + "description": "Isolated margin" + } + ] + }, + "avgDealPrice": { + "type": "string", + "description": "Average transaction price, forward contract average transaction price = sum (transaction value) / sum (transaction quantity), reverse contract average transaction price = sum (transaction quantity) / sum (transaction value). Transaction quantity = lots * multiplier\n" + }, + "filledSize": { + "type": "integer", + "description": "Value of the executed orders\n" + }, + "filledValue": { + "type": "string", + "description": "Executed order quantity\n" + }, + "status": { + "type": "string", + "description": "order status: “open” or “done”\n", + "enum": [ + "open", + "done" + ], + "x-api-enum": [ + { + "value": "open", + "name": "open", + "description": "open order" + }, + { + "value": "done", + "name": "done", + "description": "done order" + } + ] + }, + "reduceOnly": { "type": "boolean", - "description": "A mark to close the position\n" + "description": "A mark to reduce the position size only\n" + } + }, + "required": [ + "id", + "symbol", + "type", + "side", + "price", + "size", + "value", + "dealValue", + "dealSize", + "stp", + "stop", + "stopPriceType", + "stopTriggered", + "stopPrice", + "timeInForce", + "postOnly", + "hidden", + "iceberg", + "leverage", + "forceHold", + "closeOrder", + "visibleSize", + "clientOid", + "remark", + "tags", + "isActive", + "cancelExist", + "createdAt", + "updatedAt", + "endAt", + "orderTime", + "settleCurrency", + "marginMode", + "avgDealPrice", + "filledSize", + "filledValue", + "status", + "reduceOnly" + ] + } + }, + "required": [ + "code", + "data" + ] + } + } + } + } + }, + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470352", + "x-abandon": "normal", + "x-domain": "Futures", + "x-api-channel": "Private", + "x-api-permission": "General", + "x-api-rate-limit-pool": "Futures", + "x-sdk-service": "Futures", + "x-sdk-sub-service": "Order", + "x-sdk-method-name": "getOrderByClientOid", + "x-sdk-method-description": "Get a single order by client order id (including a stop order).", + "x-api-rate-limit": 5, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"id\\\": \\\"250444645610336256\\\",\\n \\\"symbol\\\": \\\"XRPUSDTM\\\",\\n \\\"type\\\": \\\"limit\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"price\\\": \\\"0.1\\\",\\n \\\"size\\\": 1,\\n \\\"value\\\": \\\"1\\\",\\n \\\"dealValue\\\": \\\"0\\\",\\n \\\"dealSize\\\": 0,\\n \\\"stp\\\": \\\"\\\",\\n \\\"stop\\\": \\\"\\\",\\n \\\"stopPriceType\\\": \\\"\\\",\\n \\\"stopTriggered\\\": false,\\n \\\"stopPrice\\\": null,\\n \\\"timeInForce\\\": \\\"GTC\\\",\\n \\\"postOnly\\\": false,\\n \\\"hidden\\\": false,\\n \\\"iceberg\\\": false,\\n \\\"leverage\\\": \\\"3\\\",\\n \\\"forceHold\\\": false,\\n \\\"closeOrder\\\": false,\\n \\\"visibleSize\\\": 0,\\n \\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\",\\n \\\"remark\\\": null,\\n \\\"tags\\\": \\\"\\\",\\n \\\"isActive\\\": true,\\n \\\"cancelExist\\\": false,\\n \\\"createdAt\\\": 1732523858568,\\n \\\"updatedAt\\\": 1732523858568,\\n \\\"endAt\\\": null,\\n \\\"orderTime\\\": 1732523858550892322,\\n \\\"settleCurrency\\\": \\\"USDT\\\",\\n \\\"marginMode\\\": \\\"ISOLATED\\\",\\n \\\"avgDealPrice\\\": \\\"0\\\",\\n \\\"filledSize\\\": 0,\\n \\\"filledValue\\\": \\\"0\\\",\\n \\\"status\\\": \\\"open\\\",\\n \\\"reduceOnly\\\": false\\n }\\n}", + "x-request-example": "{\\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\"}" + } + }, + "/api/v1/recentDoneOrders": { + "get": { + "summary": "Get Recent Closed Orders", + "deprecated": false, + "description": "Get a list of recent 1000 closed orders in the last 24 hours. If you need to get your recent traded order history with low latency, you may query this endpoint.", + "tags": [], + "parameters": [ + { + "name": "symbol", + "in": "query", + "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) ", + "required": false, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Order ID" + }, + "symbol": { + "type": "string", + "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) " + }, + "type": { + "type": "string", + "description": "Order type, market order or limit order" + }, + "side": { + "type": "string", + "description": "Transaction side" + }, + "price": { + "type": "string", + "description": "Order price" + }, + "size": { + "type": "integer", + "description": "Order quantity" + }, + "value": { + "type": "string", + "description": "Order value\n" + }, + "dealValue": { + "type": "string", + "description": "Executed size of funds\n" + }, + "dealSize": { + "type": "integer", + "description": "Executed quantity\n" + }, + "stp": { + "type": "string", + "description": "self trade prevention" + }, + "stop": { + "type": "string", + "description": "Stop order type (stop limit or stop market)\n" + }, + "stopPriceType": { + "type": "string", + "description": "Trigger price type of stop orders\n" + }, + "stopTriggered": { + "type": "boolean", + "description": "Mark to show whether the stop order is triggered" + }, + "stopPrice": { + "type": "integer", + "description": "Trigger price of stop orders\n" + }, + "timeInForce": { + "type": "string", + "description": "Time in force policy type\n" + }, + "postOnly": { + "type": "boolean", + "description": "Mark of post only\n" + }, + "hidden": { + "type": "boolean", + "description": "Mark of the hidden order\n" + }, + "iceberg": { + "type": "boolean", + "description": "Mark of the iceberg order\n" + }, + "leverage": { + "type": "string", + "description": "Leverage of the order\n" + }, + "forceHold": { + "type": "boolean", + "description": "A mark to forcely hold the funds for an order\n" + }, + "closeOrder": { + "type": "boolean", + "description": "A mark to close the position\n" + }, + "visibleSize": { + "type": "integer", + "description": "Visible size of the iceberg order\n" + }, + "clientOid": { + "type": "string", + "description": "Unique order id created by users to identify their orders\n" + }, + "remark": { + "type": "string", + "description": "Remark of the order\n" + }, + "tags": { + "type": "string", + "description": "tag order source\n" + }, + "isActive": { + "type": "boolean", + "description": "Mark of the active orders\n" + }, + "cancelExist": { + "type": "boolean", + "description": "Mark of the canceled orders\n" + }, + "createdAt": { + "type": "integer", + "description": "Time the order created\n", + "format": "int64" + }, + "updatedAt": { + "type": "integer", + "description": "last update time\n", + "format": "int64" + }, + "endAt": { + "type": "integer", + "description": "End time\n", + "format": "int64" + }, + "orderTime": { + "type": "integer", + "description": "Order create time in nanosecond\n", + "format": "int64" + }, + "settleCurrency": { + "type": "string", + "description": "settlement currency\n" + }, + "marginMode": { + "type": "string", + "description": "Margin mode: ISOLATED (isolated), CROSS (cross margin).\n" + }, + "avgDealPrice": { + "type": "string", + "description": "Average transaction price, forward contract average transaction price = sum (transaction value) / sum (transaction quantity), reverse contract average transaction price = sum (transaction quantity) / sum (transaction value). Transaction quantity = lots * multiplier\n" + }, + "filledSize": { + "type": "integer", + "description": "Value of the executed orders\n" + }, + "filledValue": { + "type": "string", + "description": "Executed order quantity\n" + }, + "status": { + "type": "string", + "description": "order status: “open” or “done”\n" + }, + "reduceOnly": { + "type": "boolean", + "description": "A mark to reduce the position size only\n" + } }, - "visibleSize": { + "required": [ + "id", + "symbol", + "type", + "side", + "price", + "size", + "value", + "dealValue", + "dealSize", + "stp", + "stop", + "stopPriceType", + "stopTriggered", + "stopPrice", + "timeInForce", + "postOnly", + "hidden", + "iceberg", + "leverage", + "forceHold", + "closeOrder", + "visibleSize", + "clientOid", + "remark", + "tags", + "isActive", + "cancelExist", + "createdAt", + "updatedAt", + "endAt", + "orderTime", + "settleCurrency", + "marginMode", + "avgDealPrice", + "filledSize", + "filledValue", + "status", + "reduceOnly" + ] + } + } + }, + "required": [ + "code", + "data" + ] + } + } + } + } + }, + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470246", + "x-abandon": "normal", + "x-domain": "Futures", + "x-api-channel": "Private", + "x-api-permission": "Futures", + "x-api-rate-limit-pool": "Futures", + "x-sdk-service": "Futures", + "x-sdk-sub-service": "Order", + "x-sdk-method-name": "GetRecentClosedOrders", + "x-sdk-method-description": "Get a list of recent 1000 closed orders in the last 24 hours. If you need to get your recent traded order history with low latency, you may query this endpoint.", + "x-api-rate-limit": 5, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": [\\n {\\n \\\"id\\\": \\\"236387137732231168\\\",\\n \\\"symbol\\\": \\\"XRPUSDTM\\\",\\n \\\"type\\\": \\\"market\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"price\\\": \\\"0\\\",\\n \\\"size\\\": 1,\\n \\\"value\\\": \\\"5.51\\\",\\n \\\"dealValue\\\": \\\"5.511\\\",\\n \\\"dealSize\\\": 1,\\n \\\"stp\\\": \\\"\\\",\\n \\\"stop\\\": \\\"\\\",\\n \\\"stopPriceType\\\": \\\"\\\",\\n \\\"stopTriggered\\\": false,\\n \\\"stopPrice\\\": null,\\n \\\"timeInForce\\\": \\\"GTC\\\",\\n \\\"postOnly\\\": false,\\n \\\"hidden\\\": false,\\n \\\"iceberg\\\": false,\\n \\\"leverage\\\": \\\"10.0\\\",\\n \\\"forceHold\\\": false,\\n \\\"closeOrder\\\": false,\\n \\\"visibleSize\\\": 0,\\n \\\"clientOid\\\": \\\"16698fe6-2746-4aeb-a7fa-61f633ab6090\\\",\\n \\\"remark\\\": null,\\n \\\"tags\\\": \\\"\\\",\\n \\\"isActive\\\": false,\\n \\\"cancelExist\\\": false,\\n \\\"createdAt\\\": 1729172287496,\\n \\\"updatedAt\\\": 1729172287568,\\n \\\"endAt\\\": 1729172287568,\\n \\\"orderTime\\\": 1729172287496950800,\\n \\\"settleCurrency\\\": \\\"USDT\\\",\\n \\\"marginMode\\\": \\\"ISOLATED\\\",\\n \\\"avgDealPrice\\\": \\\"0.5511\\\",\\n \\\"filledSize\\\": 1,\\n \\\"filledValue\\\": \\\"5.511\\\",\\n \\\"status\\\": \\\"done\\\",\\n \\\"reduceOnly\\\": false\\n },\\n {\\n \\\"id\\\": \\\"236317213710184449\\\",\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"type\\\": \\\"market\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"price\\\": \\\"0\\\",\\n \\\"size\\\": 1,\\n \\\"value\\\": \\\"67.4309\\\",\\n \\\"dealValue\\\": \\\"67.4309\\\",\\n \\\"dealSize\\\": 1,\\n \\\"stp\\\": \\\"\\\",\\n \\\"stop\\\": \\\"\\\",\\n \\\"stopPriceType\\\": \\\"\\\",\\n \\\"stopTriggered\\\": false,\\n \\\"stopPrice\\\": null,\\n \\\"timeInForce\\\": \\\"GTC\\\",\\n \\\"postOnly\\\": false,\\n \\\"hidden\\\": false,\\n \\\"iceberg\\\": false,\\n \\\"leverage\\\": \\\"3\\\",\\n \\\"forceHold\\\": false,\\n \\\"closeOrder\\\": false,\\n \\\"visibleSize\\\": 0,\\n \\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\",\\n \\\"remark\\\": null,\\n \\\"tags\\\": \\\"\\\",\\n \\\"isActive\\\": false,\\n \\\"cancelExist\\\": false,\\n \\\"createdAt\\\": 1729155616310,\\n \\\"updatedAt\\\": 1729155616324,\\n \\\"endAt\\\": 1729155616324,\\n \\\"orderTime\\\": 1729155616310180400,\\n \\\"settleCurrency\\\": \\\"USDT\\\",\\n \\\"marginMode\\\": \\\"ISOLATED\\\",\\n \\\"avgDealPrice\\\": \\\"67430.9\\\",\\n \\\"filledSize\\\": 1,\\n \\\"filledValue\\\": \\\"67.4309\\\",\\n \\\"status\\\": \\\"done\\\",\\n \\\"reduceOnly\\\": false\\n },\\n {\\n \\\"id\\\": \\\"236317094436728832\\\",\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"type\\\": \\\"market\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"price\\\": \\\"0\\\",\\n \\\"size\\\": 1,\\n \\\"value\\\": \\\"67.445\\\",\\n \\\"dealValue\\\": \\\"67.445\\\",\\n \\\"dealSize\\\": 1,\\n \\\"stp\\\": \\\"\\\",\\n \\\"stop\\\": \\\"\\\",\\n \\\"stopPriceType\\\": \\\"\\\",\\n \\\"stopTriggered\\\": false,\\n \\\"stopPrice\\\": null,\\n \\\"timeInForce\\\": \\\"GTC\\\",\\n \\\"postOnly\\\": false,\\n \\\"hidden\\\": false,\\n \\\"iceberg\\\": false,\\n \\\"leverage\\\": \\\"3\\\",\\n \\\"forceHold\\\": false,\\n \\\"closeOrder\\\": false,\\n \\\"visibleSize\\\": 0,\\n \\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\",\\n \\\"remark\\\": null,\\n \\\"tags\\\": \\\"\\\",\\n \\\"isActive\\\": false,\\n \\\"cancelExist\\\": false,\\n \\\"createdAt\\\": 1729155587873,\\n \\\"updatedAt\\\": 1729155587946,\\n \\\"endAt\\\": 1729155587946,\\n \\\"orderTime\\\": 1729155587873332000,\\n \\\"settleCurrency\\\": \\\"USDT\\\",\\n \\\"marginMode\\\": \\\"ISOLATED\\\",\\n \\\"avgDealPrice\\\": \\\"67445.0\\\",\\n \\\"filledSize\\\": 1,\\n \\\"filledValue\\\": \\\"67.445\\\",\\n \\\"status\\\": \\\"done\\\",\\n \\\"reduceOnly\\\": false\\n }\\n ]\\n}", + "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDTM\\\"}" + } + }, + "/api/v1/openOrderStatistics": { + "get": { + "summary": "Get Open Order Value", + "deprecated": false, + "description": "You can query this endpoint to get the the total number and value of the all your active orders.", + "tags": [], + "parameters": [ + { + "name": "symbol", + "in": "query", + "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) ", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "object", + "properties": { + "openOrderBuySize": { "type": "integer", - "description": "Visible size of the iceberg order\n" + "description": "Total number of the unexecuted buy orders\n" }, - "clientOid": { - "type": "string", - "description": "Unique order id created by users to identify their orders\n" + "openOrderSellSize": { + "type": "integer", + "description": "Total number of the unexecuted sell orders\n" }, - "remark": { + "openOrderBuyCost": { "type": "string", - "description": "Remark" + "description": "Value of all the unexecuted buy orders\n" }, - "tags": { + "openOrderSellCost": { "type": "string", - "description": "tag order source\n" - }, - "isActive": { - "type": "boolean", - "description": "Mark of the active orders\n" - }, - "cancelExist": { - "type": "boolean", - "description": "Mark of the canceled orders\n" - }, - "createdAt": { - "type": "integer", - "description": "Time the order created\n", - "format": "int64" - }, - "updatedAt": { - "type": "integer", - "description": "last update time\n", - "format": "int64" - }, - "endAt": { - "type": "integer", - "description": "Order Endtime", - "format": "int64" - }, - "orderTime": { - "type": "integer", - "description": "Order create time in nanosecond\n", - "format": "int64" + "description": "Value of all the unexecuted sell orders\n" }, "settleCurrency": { "type": "string", "description": "settlement currency\n" - }, - "marginMode": { - "type": "string", - "description": "Margin mode: ISOLATED (isolated), CROSS (cross margin).\n", - "enum": [ - "CROSS", - "ISOLATED" - ], - "x-api-enum": [ - { - "value": "CROSS", - "name": "CROSS", - "description": "Cross margin" - }, - { - "value": "ISOLATED", - "name": "ISOLATED", - "description": "Isolated margin" - } - ] - }, - "avgDealPrice": { - "type": "string", - "description": "Average transaction price, forward contract average transaction price = sum (transaction value) / sum (transaction quantity), reverse contract average transaction price = sum (transaction quantity) / sum (transaction value). Transaction quantity = lots * multiplier\n" - }, - "filledSize": { - "type": "integer", - "description": "Value of the executed orders\n" - }, - "filledValue": { - "type": "string", - "description": "Executed order quantity\n" - }, - "status": { - "type": "string", - "description": "order status: “open” or “done”\n", - "enum": [ - "open", - "done" - ], - "x-api-enum": [ - { - "value": "open", - "name": "open", - "description": "open order" - }, - { - "value": "done", - "name": "done", - "description": "done order" - } - ] - }, - "reduceOnly": { - "type": "boolean", - "description": "A mark to reduce the position size only\n" } }, "required": [ - "id", - "symbol", - "type", - "side", - "price", - "size", - "value", - "dealValue", - "dealSize", - "stp", - "stop", - "stopPriceType", - "stopTriggered", - "stopPrice", - "timeInForce", - "postOnly", - "hidden", - "iceberg", - "leverage", - "forceHold", - "closeOrder", - "visibleSize", - "clientOid", - "remark", - "tags", - "isActive", - "cancelExist", - "createdAt", - "updatedAt", - "orderTime", - "settleCurrency", - "marginMode", - "avgDealPrice", - "filledSize", - "filledValue", - "status", - "reduceOnly" + "openOrderBuySize", + "openOrderSellSize", + "openOrderBuyCost", + "openOrderSellCost", + "settleCurrency" ] } }, @@ -6204,32 +6068,32 @@ } } }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470245", + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470250", "x-abandon": "normal", "x-domain": "Futures", "x-api-channel": "Private", - "x-api-permission": "General", + "x-api-permission": "Futures", "x-api-rate-limit-pool": "Futures", "x-sdk-service": "Futures", "x-sdk-sub-service": "Order", - "x-sdk-method-name": "getOrderByOrderId", - "x-sdk-method-description": "Get a single order by order id (including a stop order).", - "x-api-rate-limit": 5, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"id\\\": \\\"236655147005071361\\\",\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"type\\\": \\\"limit\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"price\\\": \\\"0.1\\\",\\n \\\"size\\\": 1,\\n \\\"value\\\": \\\"0.0001\\\",\\n \\\"dealValue\\\": \\\"0\\\",\\n \\\"dealSize\\\": 0,\\n \\\"stp\\\": \\\"\\\",\\n \\\"stop\\\": \\\"\\\",\\n \\\"stopPriceType\\\": \\\"\\\",\\n \\\"stopTriggered\\\": false,\\n \\\"stopPrice\\\": null,\\n \\\"timeInForce\\\": \\\"GTC\\\",\\n \\\"postOnly\\\": false,\\n \\\"hidden\\\": false,\\n \\\"iceberg\\\": false,\\n \\\"leverage\\\": \\\"3\\\",\\n \\\"forceHold\\\": false,\\n \\\"closeOrder\\\": false,\\n \\\"visibleSize\\\": 0,\\n \\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\",\\n \\\"remark\\\": null,\\n \\\"tags\\\": \\\"\\\",\\n \\\"isActive\\\": true,\\n \\\"cancelExist\\\": false,\\n \\\"createdAt\\\": 1729236185949,\\n \\\"updatedAt\\\": 1729236185949,\\n \\\"endAt\\\": null,\\n \\\"orderTime\\\": 1729236185885647952,\\n \\\"settleCurrency\\\": \\\"USDT\\\",\\n \\\"marginMode\\\": \\\"ISOLATED\\\",\\n \\\"avgDealPrice\\\": \\\"0\\\",\\n \\\"filledSize\\\": 0,\\n \\\"filledValue\\\": \\\"0\\\",\\n \\\"status\\\": \\\"open\\\",\\n \\\"reduceOnly\\\": false\\n }\\n}", - "x-request-example": "{\\\"order-id\\\": \\\"236655147005071361\\\"}" + "x-sdk-method-name": "GetOpenOrderValue", + "x-sdk-method-description": "You can query this endpoint to get the the total number and value of the all your active orders.", + "x-api-rate-limit": 10, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"openOrderBuySize\\\": 1,\\n \\\"openOrderSellSize\\\": 0,\\n \\\"openOrderBuyCost\\\": \\\"0.0001\\\",\\n \\\"openOrderSellCost\\\": \\\"0\\\",\\n \\\"settleCurrency\\\": \\\"USDT\\\"\\n }\\n}", + "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDTM\\\"}" } }, - "/api/v1/orders/byClientOid": { + "/api/v1/recentFills": { "get": { - "summary": "Get Order By ClientOid", + "summary": "Get Recent Trade History", "deprecated": false, - "description": "Get a single order by client order id (including a stop order).", + "description": "Get a list of recent 1000 fills in the last 24 hours. If you need to get your recent traded order history with low latency, you may query this endpoint.", "tags": [], "parameters": [ { - "name": "clientOid", + "name": "symbol", "in": "query", - "description": "The user self-defined order id.", + "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) ", "required": false, "schema": { "type": "string" @@ -6248,324 +6112,717 @@ "type": "string" }, "data": { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "Order ID" - }, - "symbol": { - "type": "string", - "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) " - }, - "type": { - "type": "string", - "description": "Order type, market order or limit order", - "enum": [ - "market", - "limit" - ], - "x-api-enum": [ - { - "value": "market", - "name": "market", - "description": "Market Order" - }, - { - "value": "limit", - "name": "limit", - "description": "Limit Order" - } - ] - }, - "side": { - "type": "string", - "description": "Transaction side", - "enum": [ - "buy", - "sell" - ], - "x-api-enum": [ - { - "value": "buy", - "name": "buy", - "description": "buy" - }, - { - "value": "sell", - "name": "sell", - "description": "sell" - } - ] - }, - "price": { - "type": "string", - "description": "Order price" - }, - "size": { - "type": "integer", - "description": "Order quantity" - }, - "value": { - "type": "string", - "description": "Order value\n" - }, - "dealValue": { - "type": "string", - "description": "Executed size of funds\n" - }, - "dealSize": { - "type": "integer", - "description": "Executed quantity\n" - }, - "stp": { - "type": "string", - "description": "[Self Trade Prevention](https://www.kucoin.com/docs-new/doc-338146) is divided into these strategies: CN, CO, CB. Not supported DC at the moment.", - "enum": [ - "", - "CN", - "CO", - "CB" - ], - "x-api-enum": [ - { - "value": "", - "name": "NULL", - "description": "None" - }, - { - "value": "CN", - "name": "CN", - "description": "Cancel new, Cancel the new order" - }, - { - "value": "CO", - "name": "CO", - "description": "Cancel old, Cancel the old order" - }, - { - "value": "CB", - "name": "CB", - "description": "Cancel both, Cancel both sides" - } - ] - }, - "stop": { - "type": "string", - "description": "Stop order type (stop limit or stop market)\n" - }, - "stopPriceType": { - "type": "string", - "description": "Trigger price type of stop orders", - "enum": [ - "", - "TP", - "MP", - "IP" - ], - "x-api-enum": [ - { - "value": "", - "name": "NULL", - "description": "None" - }, - { - "value": "TP", - "name": "trade price", - "description": "TP for trade price, The last trade price is the last price at which an order was filled. This price can be found in the latest match message." - }, - { - "value": "MP", - "name": "mark price", - "description": "MP for mark price, The mark price can be obtained through relevant OPEN API for index services" - }, - { - "value": "IP", - "name": "index price", - "description": "IP for index price, The index price can be obtained through relevant OPEN API for index services" - } - ] - }, - "stopTriggered": { - "type": "boolean", - "description": "Mark to show whether the stop order is triggered" - }, - "stopPrice": { - "type": "number", - "description": "Trigger price of stop orders" - }, - "timeInForce": { - "type": "string", - "description": "Time in force policy type\n" - }, - "postOnly": { - "type": "boolean", - "description": "Mark of post only\n" - }, - "hidden": { - "type": "boolean", - "description": "Mark of the hidden order\n" - }, - "iceberg": { - "type": "boolean", - "description": "Mark of the iceberg order\n" - }, - "leverage": { - "type": "string", - "description": "Leverage of the order\n" - }, - "forceHold": { - "type": "boolean", - "description": "A mark to forcely hold the funds for an order\n" - }, - "closeOrder": { - "type": "boolean", - "description": "A mark to close the position\n" - }, - "visibleSize": { - "type": "integer", - "description": "Visible size of the iceberg order\n" - }, - "clientOid": { - "type": "string", - "description": "Unique order id created by users to identify their orders\n" - }, - "remark": { - "type": "string", - "description": "Remark" - }, - "tags": { - "type": "string", - "description": "tag order source\n" - }, - "isActive": { - "type": "boolean", - "description": "Mark of the active orders\n" - }, - "cancelExist": { - "type": "boolean", - "description": "Mark of the canceled orders\n" - }, - "createdAt": { - "type": "integer", - "description": "Time the order created\n", - "format": "int64" - }, - "updatedAt": { - "type": "integer", - "description": "last update time\n", - "format": "int64" - }, - "endAt": { - "type": "integer", - "description": "Order Endtime", - "format": "int64" - }, - "orderTime": { - "type": "integer", - "description": "Order create time in nanosecond\n", - "format": "int64" - }, - "settleCurrency": { - "type": "string", - "description": "settlement currency\n" + "type": "array", + "items": { + "type": "object", + "properties": { + "symbol": { + "type": "string", + "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) " + }, + "tradeId": { + "type": "string", + "description": "Trade ID\n" + }, + "orderId": { + "type": "string", + "description": "Order ID\n" + }, + "side": { + "type": "string", + "description": "Transaction side\n", + "enum": [ + "buy", + "sell" + ], + "x-api-enum": [ + { + "value": "buy", + "name": "buy", + "description": "buy" + }, + { + "value": "sell", + "name": "sell", + "description": "sell" + } + ] + }, + "liquidity": { + "type": "string", + "description": "Liquidity- taker or maker\n", + "enum": [ + "taker", + "maker" + ], + "x-api-enum": [ + { + "value": "taker", + "name": "taker", + "description": "taker" + }, + { + "value": "maker", + "name": "maker", + "description": "maker" + } + ] + }, + "forceTaker": { + "type": "boolean", + "description": "Whether to force processing as a taker\n" + }, + "price": { + "type": "string", + "description": "Filled price\n" + }, + "size": { + "type": "integer", + "description": "Filled amount\n" + }, + "value": { + "type": "string", + "description": "Order value\n" + }, + "openFeePay": { + "type": "string", + "description": "Opening transaction fee\n" + }, + "closeFeePay": { + "type": "string", + "description": "Closing transaction fee\n" + }, + "stop": { + "type": "string", + "description": "A mark to the stop order type\n" + }, + "feeRate": { + "type": "string", + "description": "Fee Rate" + }, + "fixFee": { + "type": "string", + "description": "Fixed fees(Deprecated field, no actual use of the value field)\n" + }, + "feeCurrency": { + "type": "string", + "description": "Charging currency\n" + }, + "tradeTime": { + "type": "integer", + "description": "trade time in nanosecond\n", + "format": "int64" + }, + "subTradeType": { + "type": "string", + "description": "Deprecated field, no actual use of the value field" + }, + "marginMode": { + "type": "string", + "description": "Margin mode: ISOLATED (isolated), CROSS (cross margin).\n", + "enum": [ + "ISOLATED", + "CROSS" + ], + "x-api-enum": [ + { + "value": "ISOLATED", + "name": "ISOLATED", + "description": "Isolated Margin" + }, + { + "value": "CROSS", + "name": "CROSS", + "description": "Cross Margin" + } + ] + }, + "displayType": { + "type": "string", + "enum": [ + "limit", + "market", + "limit_stop", + "market_stop" + ], + "description": "Order Type", + "x-api-enum": [ + { + "value": "limit", + "name": "limit", + "description": "Limit order" + }, + { + "value": "market", + "name": "market", + "description": "Market order" + }, + { + "value": "limit_stop", + "name": "limit_stop", + "description": "Stop limit order" + }, + { + "value": "market_stop", + "name": "market_stop", + "description": "Stop Market order" + } + ] + }, + "fee": { + "type": "string", + "description": "Transaction fee\n" + }, + "settleCurrency": { + "type": "string", + "description": "Settle Currency" + }, + "orderType": { + "type": "string", + "description": "Order type\n", + "enum": [ + "market", + "limit" + ], + "x-api-enum": [ + { + "value": "market", + "name": "market", + "description": "market" + }, + { + "value": "limit", + "name": "limit", + "description": "limit" + } + ] + }, + "tradeType": { + "type": "string", + "description": "Trade type (trade, liquid, cancel, adl or settlement)\n", + "enum": [ + "trade", + "cancel", + "liquid", + "adl", + "settlement" + ], + "x-api-enum": [ + { + "value": "trade", + "name": "trade", + "description": "trade" + }, + { + "value": "cancel", + "name": "cancel", + "description": "Partially filled and cancelled orders" + }, + { + "value": "liquid", + "name": "liquid", + "description": "liquid" + }, + { + "value": "adl", + "name": "adl", + "description": "adl" + }, + { + "value": "settlement", + "name": "settlement", + "description": "settlement" + } + ] + }, + "createdAt": { + "type": "integer", + "description": "Time the order created\n", + "format": "int64" + } }, - "marginMode": { - "type": "string", - "description": "Margin mode: ISOLATED (isolated), CROSS (cross margin).\n", - "enum": [ - "CROSS", - "ISOLATED" - ], - "x-api-enum": [ - { - "value": "CROSS", - "name": "CROSS", - "description": "Cross margin" - }, - { - "value": "ISOLATED", - "name": "ISOLATED", - "description": "Isolated margin" - } - ] + "required": [ + "symbol", + "tradeId", + "orderId", + "side", + "liquidity", + "forceTaker", + "price", + "size", + "value", + "openFeePay", + "closeFeePay", + "stop", + "feeRate", + "fixFee", + "feeCurrency", + "tradeTime", + "subTradeType", + "marginMode", + "displayType", + "fee", + "settleCurrency", + "orderType", + "tradeType", + "createdAt" + ] + } + } + }, + "required": [ + "code", + "data" + ] + } + } + } + } + }, + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470249", + "x-abandon": "normal", + "x-domain": "Futures", + "x-api-channel": "Private", + "x-api-permission": "Futures", + "x-api-rate-limit-pool": "Futures", + "x-sdk-service": "Futures", + "x-sdk-sub-service": "Order", + "x-sdk-method-name": "getRecentTradeHistory", + "x-sdk-method-description": "Get a list of recent 1000 fills in the last 24 hours. If you need to get your recent traded order history with low latency, you may query this endpoint.", + "x-api-rate-limit": 3, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": [\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"tradeId\\\": \\\"1784277229880\\\",\\n \\\"orderId\\\": \\\"236317213710184449\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"liquidity\\\": \\\"taker\\\",\\n \\\"forceTaker\\\": false,\\n \\\"price\\\": \\\"67430.9\\\",\\n \\\"size\\\": 1,\\n \\\"value\\\": \\\"67.4309\\\",\\n \\\"openFeePay\\\": \\\"0.04045854\\\",\\n \\\"closeFeePay\\\": \\\"0\\\",\\n \\\"stop\\\": \\\"\\\",\\n \\\"feeRate\\\": \\\"0.00060\\\",\\n \\\"fixFee\\\": \\\"0\\\",\\n \\\"feeCurrency\\\": \\\"USDT\\\",\\n \\\"marginMode\\\": \\\"ISOLATED\\\",\\n \\\"fee\\\": \\\"0.04045854\\\",\\n \\\"settleCurrency\\\": \\\"USDT\\\",\\n \\\"orderType\\\": \\\"market\\\",\\n \\\"displayType\\\": \\\"market\\\",\\n \\\"tradeType\\\": \\\"trade\\\",\\n \\\"subTradeType\\\": null,\\n \\\"tradeTime\\\": 1729155616320000000,\\n \\\"createdAt\\\": 1729155616493\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"tradeId\\\": \\\"1784277132002\\\",\\n \\\"orderId\\\": \\\"236317094436728832\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"liquidity\\\": \\\"taker\\\",\\n \\\"forceTaker\\\": false,\\n \\\"price\\\": \\\"67445\\\",\\n \\\"size\\\": 1,\\n \\\"value\\\": \\\"67.445\\\",\\n \\\"openFeePay\\\": \\\"0\\\",\\n \\\"closeFeePay\\\": \\\"0.040467\\\",\\n \\\"stop\\\": \\\"\\\",\\n \\\"feeRate\\\": \\\"0.00060\\\",\\n \\\"fixFee\\\": \\\"0\\\",\\n \\\"feeCurrency\\\": \\\"USDT\\\",\\n \\\"marginMode\\\": \\\"ISOLATED\\\",\\n \\\"fee\\\": \\\"0.040467\\\",\\n \\\"settleCurrency\\\": \\\"USDT\\\",\\n \\\"orderType\\\": \\\"market\\\",\\n \\\"displayType\\\": \\\"market\\\",\\n \\\"tradeType\\\": \\\"trade\\\",\\n \\\"subTradeType\\\": null,\\n \\\"tradeTime\\\": 1729155587944000000,\\n \\\"createdAt\\\": 1729155588104\\n }\\n ]\\n}", + "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDTM\\\"}" + } + }, + "/api/v1/fills": { + "get": { + "summary": "Get Trade History", + "deprecated": false, + "description": "Get a list of recent fills. If you need to get your recent trade history with low latency, please query endpoint Get List of Orders Completed in 24h. The requested data is not real-time.", + "tags": [], + "parameters": [ + { + "name": "orderId", + "in": "query", + "description": "List fills for a specific order only (If you specify orderId, other parameters can be ignored)", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "symbol", + "in": "query", + "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) ", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "side", + "in": "query", + "description": "Order side", + "required": false, + "schema": { + "type": "string", + "enum": [ + "buy", + "sell" + ], + "x-api-enum": [ + { + "value": "buy", + "name": "buy", + "description": "buy" + }, + { + "value": "sell", + "name": "sell", + "description": "sell" + } + ] + } + }, + { + "name": "type", + "in": "query", + "description": "Order Type", + "required": false, + "schema": { + "type": "string", + "enum": [ + "limit", + "market", + "limit_stop", + "market_stop" + ], + "x-api-enum": [ + { + "value": "limit", + "name": "limit", + "description": "Limit order" + }, + { + "value": "market", + "name": "market", + "description": "Market order" + }, + { + "value": "limit_stop", + "name": "limit_stop", + "description": "Stop limit order" + }, + { + "value": "market_stop", + "name": "market_stop", + "description": "Stop Market order" + } + ] + } + }, + { + "name": "tradeTypes", + "in": "query", + "description": "Transaction type: trade, adl, liquid, settlement. Supports querying multiple types at the same time, separated by commas. Query all type when empty", + "required": false, + "schema": { + "type": "string", + "example": [ + "trade", + "adl", + "liquid", + "settlement", + "adl,liquid" + ] + } + }, + { + "name": "startAt", + "in": "query", + "description": "Start time (milisecond)", + "required": false, + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "endAt", + "in": "query", + "description": "End time (milisecond)", + "required": false, + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "currentPage", + "in": "query", + "description": "Current request page, The default currentPage is 1", + "required": false, + "schema": { + "type": "integer", + "default": 1 + } + }, + { + "name": "pageSize", + "in": "query", + "description": "pageSize, The default pageSize is 50, The maximum cannot exceed 1000", + "required": false, + "schema": { + "type": "integer", + "default": 50, + "maximum": 1000 + } + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "object", + "properties": { + "currentPage": { + "type": "integer" }, - "avgDealPrice": { - "type": "string", - "description": "Average transaction price, forward contract average transaction price = sum (transaction value) / sum (transaction quantity), reverse contract average transaction price = sum (transaction quantity) / sum (transaction value). Transaction quantity = lots * multiplier\n" + "pageSize": { + "type": "integer" }, - "filledSize": { - "type": "integer", - "description": "Value of the executed orders\n" + "totalNum": { + "type": "integer" }, - "filledValue": { - "type": "string", - "description": "Executed order quantity\n" + "totalPage": { + "type": "integer" }, - "status": { - "type": "string", - "description": "order status: “open” or “done”\n", - "enum": [ - "open", - "done" - ], - "x-api-enum": [ - { - "value": "open", - "name": "open", - "description": "open order" + "items": { + "type": "array", + "items": { + "type": "object", + "properties": { + "symbol": { + "type": "string", + "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) " + }, + "tradeId": { + "type": "string", + "description": "Trade ID\n" + }, + "orderId": { + "type": "string", + "description": "Order ID\n" + }, + "side": { + "type": "string", + "description": "Transaction side", + "enum": [ + "buy", + "sell" + ], + "x-api-enum": [ + { + "value": "buy", + "name": "buy", + "description": "buy" + }, + { + "value": "sell", + "name": "sell", + "description": "sell" + } + ] + }, + "liquidity": { + "type": "string", + "description": "Liquidity- taker or maker", + "enum": [ + "taker", + "maker" + ], + "x-api-enum": [ + { + "value": "taker", + "name": "taker", + "description": "taker" + }, + { + "value": "maker", + "name": "maker", + "description": "maker" + } + ] + }, + "forceTaker": { + "type": "boolean", + "description": "Whether to force processing as a taker\n" + }, + "price": { + "type": "string", + "description": "Filled price" + }, + "size": { + "type": "integer", + "description": "Filled amount" + }, + "value": { + "type": "string", + "description": "Order value" + }, + "openFeePay": { + "type": "string", + "description": "Opening transaction fee" + }, + "closeFeePay": { + "type": "string", + "description": "Closing transaction fee" + }, + "stop": { + "type": "string", + "description": "A mark to the stop order type" + }, + "feeRate": { + "type": "string", + "description": "Fee Rate" + }, + "fixFee": { + "type": "string", + "description": "Fixed fees(Deprecated field, no actual use of the value field)" + }, + "feeCurrency": { + "type": "string", + "description": "Charging currency" + }, + "tradeTime": { + "type": "integer", + "description": "trade time in nanosecond", + "format": "int64" + }, + "subTradeType": { + "type": "string", + "description": "Deprecated field, no actual use of the value field" + }, + "marginMode": { + "type": "string", + "description": "Margin mode: ISOLATED (isolated), CROSS (cross margin).", + "enum": [ + "ISOLATED", + "CROSS" + ], + "x-api-enum": [ + { + "value": "ISOLATED", + "name": "ISOLATED", + "description": "Isolated Margin" + }, + { + "value": "CROSS", + "name": "CROSS", + "description": "Cross Margin" + } + ] + }, + "settleCurrency": { + "type": "string", + "description": "Settle Currency" + }, + "displayType": { + "type": "string", + "enum": [ + "limit", + "market", + "limit_stop", + "market_stop" + ], + "description": "Order Type", + "x-api-enum": [ + { + "value": "limit", + "name": "limit", + "description": "Limit order" + }, + { + "value": "market", + "name": "market", + "description": "Market order" + }, + { + "value": "limit_stop", + "name": "limit_stop", + "description": "Stop limit order" + }, + { + "value": "market_stop", + "name": "market_stop", + "description": "Stop Market order" + } + ] + }, + "fee": { + "type": "string" + }, + "orderType": { + "type": "string", + "description": "Order type", + "enum": [ + "market", + "limit" + ], + "x-api-enum": [ + { + "value": "market", + "name": "market", + "description": "market" + }, + { + "value": "limit", + "name": "limit", + "description": "limit" + } + ] + }, + "tradeType": { + "type": "string", + "description": "Trade type (trade, liquid, adl or settlement)\n", + "enum": [ + "trade", + "liquid", + "adl", + "settlement" + ], + "x-api-enum": [ + { + "value": "trade", + "name": "trade", + "description": "trade" + }, + { + "value": "liquid", + "name": "liquid", + "description": "liquid" + }, + { + "value": "adl", + "name": "adl", + "description": "adl" + }, + { + "value": "settlement", + "name": "settlement", + "description": "settlement" + } + ] + }, + "createdAt": { + "type": "integer", + "description": "Time the order created\n", + "format": "int64" + } }, - { - "value": "done", - "name": "done", - "description": "done order" - } - ] - }, - "reduceOnly": { - "type": "boolean", - "description": "A mark to reduce the position size only\n" - } - }, - "required": [ - "id", - "symbol", - "type", - "side", - "price", - "size", - "value", - "dealValue", - "dealSize", - "stp", - "stop", - "stopPriceType", - "stopTriggered", - "stopPrice", - "timeInForce", - "postOnly", - "hidden", - "iceberg", - "leverage", - "forceHold", - "closeOrder", - "visibleSize", - "clientOid", - "remark", - "tags", - "isActive", - "cancelExist", - "createdAt", - "updatedAt", - "endAt", - "orderTime", - "settleCurrency", - "marginMode", - "avgDealPrice", - "filledSize", - "filledValue", - "status", - "reduceOnly" + "required": [ + "symbol", + "tradeId", + "orderId", + "side", + "liquidity", + "forceTaker", + "price", + "size", + "value", + "openFeePay", + "closeFeePay", + "stop", + "feeRate", + "fixFee", + "feeCurrency", + "tradeTime", + "subTradeType", + "marginMode", + "settleCurrency", + "displayType", + "fee", + "orderType", + "tradeType", + "createdAt" + ] + } + } + }, + "required": [ + "currentPage", + "pageSize", + "totalNum", + "totalPage", + "items" ] } }, @@ -6578,252 +6835,81 @@ } } }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470352", + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470248", "x-abandon": "normal", "x-domain": "Futures", "x-api-channel": "Private", - "x-api-permission": "General", + "x-api-permission": "Futures", "x-api-rate-limit-pool": "Futures", "x-sdk-service": "Futures", "x-sdk-sub-service": "Order", - "x-sdk-method-name": "getOrderByClientOid", - "x-sdk-method-description": "Get a single order by client order id (including a stop order).", + "x-sdk-method-name": "getTradeHistory", + "x-sdk-method-description": "Get a list of recent fills. If you need to get your recent trade history with low latency, please query endpoint Get List of Orders Completed in 24h. The requested data is not real-time.", "x-api-rate-limit": 5, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"id\\\": \\\"250444645610336256\\\",\\n \\\"symbol\\\": \\\"XRPUSDTM\\\",\\n \\\"type\\\": \\\"limit\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"price\\\": \\\"0.1\\\",\\n \\\"size\\\": 1,\\n \\\"value\\\": \\\"1\\\",\\n \\\"dealValue\\\": \\\"0\\\",\\n \\\"dealSize\\\": 0,\\n \\\"stp\\\": \\\"\\\",\\n \\\"stop\\\": \\\"\\\",\\n \\\"stopPriceType\\\": \\\"\\\",\\n \\\"stopTriggered\\\": false,\\n \\\"stopPrice\\\": null,\\n \\\"timeInForce\\\": \\\"GTC\\\",\\n \\\"postOnly\\\": false,\\n \\\"hidden\\\": false,\\n \\\"iceberg\\\": false,\\n \\\"leverage\\\": \\\"3\\\",\\n \\\"forceHold\\\": false,\\n \\\"closeOrder\\\": false,\\n \\\"visibleSize\\\": 0,\\n \\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\",\\n \\\"remark\\\": null,\\n \\\"tags\\\": \\\"\\\",\\n \\\"isActive\\\": true,\\n \\\"cancelExist\\\": false,\\n \\\"createdAt\\\": 1732523858568,\\n \\\"updatedAt\\\": 1732523858568,\\n \\\"endAt\\\": null,\\n \\\"orderTime\\\": 1732523858550892322,\\n \\\"settleCurrency\\\": \\\"USDT\\\",\\n \\\"marginMode\\\": \\\"ISOLATED\\\",\\n \\\"avgDealPrice\\\": \\\"0\\\",\\n \\\"filledSize\\\": 0,\\n \\\"filledValue\\\": \\\"0\\\",\\n \\\"status\\\": \\\"open\\\",\\n \\\"reduceOnly\\\": false\\n }\\n}", - "x-request-example": "{\\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\"}" + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"currentPage\\\": 1,\\n \\\"pageSize\\\": 50,\\n \\\"totalNum\\\": 2,\\n \\\"totalPage\\\": 1,\\n \\\"items\\\": [\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"tradeId\\\": \\\"1784277229880\\\",\\n \\\"orderId\\\": \\\"236317213710184449\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"liquidity\\\": \\\"taker\\\",\\n \\\"forceTaker\\\": false,\\n \\\"price\\\": \\\"67430.9\\\",\\n \\\"size\\\": 1,\\n \\\"value\\\": \\\"67.4309\\\",\\n \\\"openFeePay\\\": \\\"0.04045854\\\",\\n \\\"closeFeePay\\\": \\\"0\\\",\\n \\\"stop\\\": \\\"\\\",\\n \\\"feeRate\\\": \\\"0.00060\\\",\\n \\\"fixFee\\\": \\\"0\\\",\\n \\\"feeCurrency\\\": \\\"USDT\\\",\\n \\\"marginMode\\\": \\\"ISOLATED\\\",\\n \\\"settleCurrency\\\": \\\"USDT\\\",\\n \\\"fee\\\": \\\"0.04045854\\\",\\n \\\"orderType\\\": \\\"market\\\",\\n \\\"displayType\\\": \\\"market\\\",\\n \\\"tradeType\\\": \\\"trade\\\",\\n \\\"subTradeType\\\": null,\\n \\\"tradeTime\\\": 1729155616320000000,\\n \\\"createdAt\\\": 1729155616493\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"tradeId\\\": \\\"1784277132002\\\",\\n \\\"orderId\\\": \\\"236317094436728832\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"liquidity\\\": \\\"taker\\\",\\n \\\"forceTaker\\\": false,\\n \\\"price\\\": \\\"67445\\\",\\n \\\"size\\\": 1,\\n \\\"value\\\": \\\"67.445\\\",\\n \\\"openFeePay\\\": \\\"0\\\",\\n \\\"closeFeePay\\\": \\\"0.040467\\\",\\n \\\"stop\\\": \\\"\\\",\\n \\\"feeRate\\\": \\\"0.00060\\\",\\n \\\"fixFee\\\": \\\"0\\\",\\n \\\"feeCurrency\\\": \\\"USDT\\\",\\n \\\"marginMode\\\": \\\"ISOLATED\\\",\\n \\\"settleCurrency\\\": \\\"USDT\\\",\\n \\\"fee\\\": \\\"0.040467\\\",\\n \\\"orderType\\\": \\\"market\\\",\\n \\\"displayType\\\": \\\"market\\\",\\n \\\"tradeType\\\": \\\"trade\\\",\\n \\\"subTradeType\\\": null,\\n \\\"tradeTime\\\": 1729155587944000000,\\n \\\"createdAt\\\": 1729155588104\\n }\\n ]\\n }\\n}", + "x-request-example": "{\\\"orderId\\\": \\\"236655147005071361\\\", \\\"symbol\\\": \\\"example_string_default_value\\\", \\\"side\\\": \\\"buy\\\", \\\"type\\\": \\\"limit\\\", \\\"tradeTypes\\\": \\\"trade\\\", \\\"startAt\\\": 123456, \\\"endAt\\\": 123456, \\\"currentPage\\\": 1, \\\"pageSize\\\": 50}" } }, - "/api/v1/recentDoneOrders": { + "/api/v2/position/getMarginMode": { "get": { - "summary": "Get Recent Closed Orders", + "summary": "Get Margin Mode", "deprecated": false, - "description": "Get a list of recent 1000 closed orders in the last 24 hours. If you need to get your recent traded order history with low latency, you may query this endpoint.", + "description": "This interface can query the margin mode of the current symbol.", "tags": [], "parameters": [ { - "name": "symbol", - "in": "query", - "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) ", - "required": false, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "data": { - "type": "array", - "items": { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "Order ID" - }, - "symbol": { - "type": "string", - "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) " - }, - "type": { - "type": "string", - "description": "Order type, market order or limit order" - }, - "side": { - "type": "string", - "description": "Transaction side" - }, - "price": { - "type": "string", - "description": "Order price" - }, - "size": { - "type": "integer", - "description": "Order quantity" - }, - "value": { - "type": "string", - "description": "Order value\n" - }, - "dealValue": { - "type": "string", - "description": "Executed size of funds\n" - }, - "dealSize": { - "type": "integer", - "description": "Executed quantity\n" - }, - "stp": { - "type": "string", - "description": "self trade prevention" - }, - "stop": { - "type": "string", - "description": "Stop order type (stop limit or stop market)\n" - }, - "stopPriceType": { - "type": "string", - "description": "Trigger price type of stop orders\n" - }, - "stopTriggered": { - "type": "boolean", - "description": "Mark to show whether the stop order is triggered" - }, - "stopPrice": { - "type": "integer", - "description": "Trigger price of stop orders\n" - }, - "timeInForce": { - "type": "string", - "description": "Time in force policy type\n" - }, - "postOnly": { - "type": "boolean", - "description": "Mark of post only\n" - }, - "hidden": { - "type": "boolean", - "description": "Mark of the hidden order\n" - }, - "iceberg": { - "type": "boolean", - "description": "Mark of the iceberg order\n" - }, - "leverage": { - "type": "string", - "description": "Leverage of the order\n" - }, - "forceHold": { - "type": "boolean", - "description": "A mark to forcely hold the funds for an order\n" - }, - "closeOrder": { - "type": "boolean", - "description": "A mark to close the position\n" - }, - "visibleSize": { - "type": "integer", - "description": "Visible size of the iceberg order\n" - }, - "clientOid": { - "type": "string", - "description": "Unique order id created by users to identify their orders\n" - }, - "remark": { - "type": "string", - "description": "Remark of the order\n" - }, - "tags": { - "type": "string", - "description": "tag order source\n" - }, - "isActive": { - "type": "boolean", - "description": "Mark of the active orders\n" - }, - "cancelExist": { - "type": "boolean", - "description": "Mark of the canceled orders\n" - }, - "createdAt": { - "type": "integer", - "description": "Time the order created\n", - "format": "int64" - }, - "updatedAt": { - "type": "integer", - "description": "last update time\n", - "format": "int64" - }, - "endAt": { - "type": "integer", - "description": "End time\n", - "format": "int64" - }, - "orderTime": { - "type": "integer", - "description": "Order create time in nanosecond\n", - "format": "int64" - }, - "settleCurrency": { - "type": "string", - "description": "settlement currency\n" - }, - "marginMode": { - "type": "string", - "description": "Margin mode: ISOLATED (isolated), CROSS (cross margin).\n" - }, - "avgDealPrice": { - "type": "string", - "description": "Average transaction price, forward contract average transaction price = sum (transaction value) / sum (transaction quantity), reverse contract average transaction price = sum (transaction quantity) / sum (transaction value). Transaction quantity = lots * multiplier\n" - }, - "filledSize": { - "type": "integer", - "description": "Value of the executed orders\n" - }, - "filledValue": { - "type": "string", - "description": "Executed order quantity\n" - }, - "status": { - "type": "string", - "description": "order status: “open” or “done”\n" - }, - "reduceOnly": { - "type": "boolean", - "description": "A mark to reduce the position size only\n" - } - }, - "required": [ - "id", - "symbol", - "type", - "side", - "price", - "size", - "value", - "dealValue", - "dealSize", - "stp", - "stop", - "stopPriceType", - "stopTriggered", - "stopPrice", - "timeInForce", - "postOnly", - "hidden", - "iceberg", - "leverage", - "forceHold", - "closeOrder", - "visibleSize", - "clientOid", - "remark", - "tags", - "isActive", - "cancelExist", - "createdAt", - "updatedAt", - "endAt", - "orderTime", - "settleCurrency", - "marginMode", - "avgDealPrice", - "filledSize", - "filledValue", - "status", - "reduceOnly" - ] - } + "name": "symbol", + "in": "query", + "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) ", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "object", + "properties": { + "symbol": { + "type": "string", + "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) " + }, + "marginMode": { + "type": "string", + "description": "Margin mode: ISOLATED (isolated), CROSS (cross margin).", + "enum": [ + "ISOLATED", + "CROSS" + ], + "x-api-enum": [ + { + "value": "ISOLATED", + "name": "ISOLATED", + "description": "isolated margin" + }, + { + "value": "CROSS", + "name": "CROSS", + "description": "cross margin" + } + ] + } + }, + "required": [ + "symbol", + "marginMode" + ] } }, "required": [ @@ -6835,61 +6921,28 @@ } } }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470246", + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470259", "x-abandon": "normal", "x-domain": "Futures", "x-api-channel": "Private", "x-api-permission": "Futures", "x-api-rate-limit-pool": "Futures", "x-sdk-service": "Futures", - "x-sdk-sub-service": "Order", - "x-sdk-method-name": "GetRecentClosedOrders", - "x-sdk-method-description": "Get a list of recent 1000 closed orders in the last 24 hours. If you need to get your recent traded order history with low latency, you may query this endpoint.", - "x-api-rate-limit": 5, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": [\\n {\\n \\\"id\\\": \\\"236387137732231168\\\",\\n \\\"symbol\\\": \\\"XRPUSDTM\\\",\\n \\\"type\\\": \\\"market\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"price\\\": \\\"0\\\",\\n \\\"size\\\": 1,\\n \\\"value\\\": \\\"5.51\\\",\\n \\\"dealValue\\\": \\\"5.511\\\",\\n \\\"dealSize\\\": 1,\\n \\\"stp\\\": \\\"\\\",\\n \\\"stop\\\": \\\"\\\",\\n \\\"stopPriceType\\\": \\\"\\\",\\n \\\"stopTriggered\\\": false,\\n \\\"stopPrice\\\": null,\\n \\\"timeInForce\\\": \\\"GTC\\\",\\n \\\"postOnly\\\": false,\\n \\\"hidden\\\": false,\\n \\\"iceberg\\\": false,\\n \\\"leverage\\\": \\\"10.0\\\",\\n \\\"forceHold\\\": false,\\n \\\"closeOrder\\\": false,\\n \\\"visibleSize\\\": 0,\\n \\\"clientOid\\\": \\\"16698fe6-2746-4aeb-a7fa-61f633ab6090\\\",\\n \\\"remark\\\": null,\\n \\\"tags\\\": \\\"\\\",\\n \\\"isActive\\\": false,\\n \\\"cancelExist\\\": false,\\n \\\"createdAt\\\": 1729172287496,\\n \\\"updatedAt\\\": 1729172287568,\\n \\\"endAt\\\": 1729172287568,\\n \\\"orderTime\\\": 1729172287496950800,\\n \\\"settleCurrency\\\": \\\"USDT\\\",\\n \\\"marginMode\\\": \\\"ISOLATED\\\",\\n \\\"avgDealPrice\\\": \\\"0.5511\\\",\\n \\\"filledSize\\\": 1,\\n \\\"filledValue\\\": \\\"5.511\\\",\\n \\\"status\\\": \\\"done\\\",\\n \\\"reduceOnly\\\": false\\n },\\n {\\n \\\"id\\\": \\\"236317213710184449\\\",\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"type\\\": \\\"market\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"price\\\": \\\"0\\\",\\n \\\"size\\\": 1,\\n \\\"value\\\": \\\"67.4309\\\",\\n \\\"dealValue\\\": \\\"67.4309\\\",\\n \\\"dealSize\\\": 1,\\n \\\"stp\\\": \\\"\\\",\\n \\\"stop\\\": \\\"\\\",\\n \\\"stopPriceType\\\": \\\"\\\",\\n \\\"stopTriggered\\\": false,\\n \\\"stopPrice\\\": null,\\n \\\"timeInForce\\\": \\\"GTC\\\",\\n \\\"postOnly\\\": false,\\n \\\"hidden\\\": false,\\n \\\"iceberg\\\": false,\\n \\\"leverage\\\": \\\"3\\\",\\n \\\"forceHold\\\": false,\\n \\\"closeOrder\\\": false,\\n \\\"visibleSize\\\": 0,\\n \\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\",\\n \\\"remark\\\": null,\\n \\\"tags\\\": \\\"\\\",\\n \\\"isActive\\\": false,\\n \\\"cancelExist\\\": false,\\n \\\"createdAt\\\": 1729155616310,\\n \\\"updatedAt\\\": 1729155616324,\\n \\\"endAt\\\": 1729155616324,\\n \\\"orderTime\\\": 1729155616310180400,\\n \\\"settleCurrency\\\": \\\"USDT\\\",\\n \\\"marginMode\\\": \\\"ISOLATED\\\",\\n \\\"avgDealPrice\\\": \\\"67430.9\\\",\\n \\\"filledSize\\\": 1,\\n \\\"filledValue\\\": \\\"67.4309\\\",\\n \\\"status\\\": \\\"done\\\",\\n \\\"reduceOnly\\\": false\\n },\\n {\\n \\\"id\\\": \\\"236317094436728832\\\",\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"type\\\": \\\"market\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"price\\\": \\\"0\\\",\\n \\\"size\\\": 1,\\n \\\"value\\\": \\\"67.445\\\",\\n \\\"dealValue\\\": \\\"67.445\\\",\\n \\\"dealSize\\\": 1,\\n \\\"stp\\\": \\\"\\\",\\n \\\"stop\\\": \\\"\\\",\\n \\\"stopPriceType\\\": \\\"\\\",\\n \\\"stopTriggered\\\": false,\\n \\\"stopPrice\\\": null,\\n \\\"timeInForce\\\": \\\"GTC\\\",\\n \\\"postOnly\\\": false,\\n \\\"hidden\\\": false,\\n \\\"iceberg\\\": false,\\n \\\"leverage\\\": \\\"3\\\",\\n \\\"forceHold\\\": false,\\n \\\"closeOrder\\\": false,\\n \\\"visibleSize\\\": 0,\\n \\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\",\\n \\\"remark\\\": null,\\n \\\"tags\\\": \\\"\\\",\\n \\\"isActive\\\": false,\\n \\\"cancelExist\\\": false,\\n \\\"createdAt\\\": 1729155587873,\\n \\\"updatedAt\\\": 1729155587946,\\n \\\"endAt\\\": 1729155587946,\\n \\\"orderTime\\\": 1729155587873332000,\\n \\\"settleCurrency\\\": \\\"USDT\\\",\\n \\\"marginMode\\\": \\\"ISOLATED\\\",\\n \\\"avgDealPrice\\\": \\\"67445.0\\\",\\n \\\"filledSize\\\": 1,\\n \\\"filledValue\\\": \\\"67.445\\\",\\n \\\"status\\\": \\\"done\\\",\\n \\\"reduceOnly\\\": false\\n }\\n ]\\n}", + "x-sdk-sub-service": "Positions", + "x-sdk-method-name": "getMarginMode", + "x-sdk-method-description": "This interface can query the margin mode of the current symbol.", + "x-api-rate-limit": 2, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"marginMode\\\": \\\"ISOLATED\\\"\\n }\\n}", "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDTM\\\"}" } }, - "/api/v2/getMaxOpenSize": { - "get": { - "summary": "Get Max Open Size", + "/api/v2/position/changeMarginMode": { + "post": { + "summary": "Switch Margin Mode", "deprecated": false, - "description": "Get Maximum Open Position Size.", + "description": "This interface can modify the margin mode of the current symbol.", "tags": [], - "parameters": [ - { - "name": "symbol", - "in": "query", - "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) ", - "required": true, - "schema": { - "type": "string", - "example": [ - "XBTUSDTM", - "XBTUSDM", - "ETHUSDTM" - ] - } - }, - { - "name": "price", - "in": "query", - "description": "Order price\n", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "leverage", - "in": "query", - "description": "Leverage\n", - "required": true, - "schema": { - "type": "integer" - } - } - ], + "parameters": [], "responses": { "200": { "description": "", @@ -6908,19 +6961,30 @@ "type": "string", "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) " }, - "maxBuyOpenSize": { - "type": "integer", - "description": "Maximum buy size\n" - }, - "maxSellOpenSize": { - "type": "integer", - "description": "Maximum buy size\n" + "marginMode": { + "type": "string", + "description": "Margin mode: ISOLATED (isolated), CROSS (cross margin).", + "enum": [ + "ISOLATED", + "CROSS" + ], + "x-api-enum": [ + { + "value": "ISOLATED", + "name": "ISOLATED", + "description": "isolated margin" + }, + { + "value": "CROSS", + "name": "CROSS", + "description": "cross margin" + } + ] } }, "required": [ "symbol", - "maxBuyOpenSize", - "maxSellOpenSize" + "marginMode" ] } }, @@ -6933,7 +6997,7 @@ } } }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470251", + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470262", "x-abandon": "normal", "x-domain": "Futures", "x-api-channel": "Private", @@ -6941,28 +7005,96 @@ "x-api-rate-limit-pool": "Futures", "x-sdk-service": "Futures", "x-sdk-sub-service": "Positions", - "x-sdk-method-name": "GetMaxOpenSize", - "x-sdk-method-description": "Get Maximum Open Position Size.", + "x-sdk-method-name": "switchMarginMode", + "x-sdk-method-description": "This interface can modify the margin mode of the current symbol.", "x-api-rate-limit": 2, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"maxBuyOpenSize\\\": 0,\\n \\\"maxSellOpenSize\\\": 0\\n }\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDTM\\\", \\\"price\\\": \\\"example_string_default_value\\\", \\\"leverage\\\": 123456}" + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "symbol": { + "type": "string", + "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) ", + "example": [ + "XBTUSDTM", + "XBTUSDCM", + "ETHUSDTM" + ] + }, + "marginMode": { + "type": "string", + "description": "Modified margin model: ISOLATED (isolated), CROSS (cross margin).", + "enum": [ + "ISOLATED", + "CROSS" + ], + "x-api-enum": [ + { + "value": "ISOLATED", + "name": "ISOLATED", + "description": "Isolated Margin Mode" + }, + { + "value": "CROSS", + "name": "CROSS", + "description": "Cross Margin MOde" + } + ] + } + }, + "required": [ + "symbol", + "marginMode" + ] + }, + "example": "{\n \"symbol\": \"XBTUSDTM\",\n \"marginMode\": \"ISOLATED\"\n}" + } + } + }, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"marginMode\\\": \\\"ISOLATED\\\"\\n }\\n}", + "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDTM\\\", \\\"marginMode\\\": \\\"ISOLATED\\\"}" } }, - "/api/v1/contracts/risk-limit/{symbol}": { + "/api/v2/getMaxOpenSize": { "get": { - "summary": "Get Isolated Margin Risk Limit", + "summary": "Get Max Open Size", "deprecated": false, - "description": "This interface can be used to obtain information about risk limit level of a specific contract(Only valid for isolated Margin).", + "description": "Get Maximum Open Position Size.", "tags": [], "parameters": [ { "name": "symbol", - "in": "path", + "in": "query", "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) ", "required": true, + "schema": { + "type": "string", + "example": [ + "XBTUSDTM", + "XBTUSDM", + "ETHUSDTM" + ] + } + }, + { + "name": "price", + "in": "query", + "description": "Order price\n", + "required": true, "schema": { "type": "string" } + }, + { + "name": "leverage", + "in": "query", + "description": "Leverage\n", + "required": true, + "schema": { + "type": "integer" + } } ], "responses": { @@ -6977,49 +7109,26 @@ "type": "string" }, "data": { - "type": "array", - "items": { - "type": "object", - "properties": { - "symbol": { - "type": "string", - "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) " - }, - "level": { - "type": "integer", - "description": "level\n" - }, - "maxRiskLimit": { - "type": "integer", - "description": "Upper limit USDT(includes)\n" - }, - "minRiskLimit": { - "type": "integer", - "description": "Lower limit USDT\n" - }, - "maxLeverage": { - "type": "integer", - "description": "Max leverage\n" - }, - "initialMargin": { - "type": "number", - "description": "Initial margin rate\n" - }, - "maintainMargin": { - "type": "number", - "description": "Maintenance margin rate\n" - } + "type": "object", + "properties": { + "symbol": { + "type": "string", + "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) " }, - "required": [ - "symbol", - "level", - "maxRiskLimit", - "minRiskLimit", - "maxLeverage", - "initialMargin", - "maintainMargin" - ] - } + "maxBuyOpenSize": { + "type": "integer", + "description": "Maximum buy size\n" + }, + "maxSellOpenSize": { + "type": "integer", + "description": "Maximum buy size\n" + } + }, + "required": [ + "symbol", + "maxBuyOpenSize", + "maxSellOpenSize" + ] } }, "required": [ @@ -7031,19 +7140,19 @@ } } }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470263", + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470251", "x-abandon": "normal", "x-domain": "Futures", "x-api-channel": "Private", "x-api-permission": "Futures", - "x-api-rate-limit-pool": "Public", + "x-api-rate-limit-pool": "Futures", "x-sdk-service": "Futures", "x-sdk-sub-service": "Positions", - "x-sdk-method-name": "getIsolatedMarginRiskLimit", - "x-sdk-method-description": "This interface can be used to obtain information about risk limit level of a specific contract(Only valid for isolated Margin).", - "x-api-rate-limit": 5, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": [\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"level\\\": 1,\\n \\\"maxRiskLimit\\\": 100000,\\n \\\"minRiskLimit\\\": 0,\\n \\\"maxLeverage\\\": 125,\\n \\\"initialMargin\\\": 0.008,\\n \\\"maintainMargin\\\": 0.004\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"level\\\": 2,\\n \\\"maxRiskLimit\\\": 500000,\\n \\\"minRiskLimit\\\": 100000,\\n \\\"maxLeverage\\\": 100,\\n \\\"initialMargin\\\": 0.01,\\n \\\"maintainMargin\\\": 0.005\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"level\\\": 3,\\n \\\"maxRiskLimit\\\": 1000000,\\n \\\"minRiskLimit\\\": 500000,\\n \\\"maxLeverage\\\": 75,\\n \\\"initialMargin\\\": 0.014,\\n \\\"maintainMargin\\\": 0.007\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"level\\\": 4,\\n \\\"maxRiskLimit\\\": 2000000,\\n \\\"minRiskLimit\\\": 1000000,\\n \\\"maxLeverage\\\": 50,\\n \\\"initialMargin\\\": 0.02,\\n \\\"maintainMargin\\\": 0.01\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"level\\\": 5,\\n \\\"maxRiskLimit\\\": 3000000,\\n \\\"minRiskLimit\\\": 2000000,\\n \\\"maxLeverage\\\": 30,\\n \\\"initialMargin\\\": 0.034,\\n \\\"maintainMargin\\\": 0.017\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"level\\\": 6,\\n \\\"maxRiskLimit\\\": 5000000,\\n \\\"minRiskLimit\\\": 3000000,\\n \\\"maxLeverage\\\": 20,\\n \\\"initialMargin\\\": 0.05,\\n \\\"maintainMargin\\\": 0.025\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"level\\\": 7,\\n \\\"maxRiskLimit\\\": 8000000,\\n \\\"minRiskLimit\\\": 5000000,\\n \\\"maxLeverage\\\": 10,\\n \\\"initialMargin\\\": 0.1,\\n \\\"maintainMargin\\\": 0.05\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"level\\\": 8,\\n \\\"maxRiskLimit\\\": 12000000,\\n \\\"minRiskLimit\\\": 8000000,\\n \\\"maxLeverage\\\": 5,\\n \\\"initialMargin\\\": 0.2,\\n \\\"maintainMargin\\\": 0.1\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"level\\\": 9,\\n \\\"maxRiskLimit\\\": 20000000,\\n \\\"minRiskLimit\\\": 12000000,\\n \\\"maxLeverage\\\": 4,\\n \\\"initialMargin\\\": 0.25,\\n \\\"maintainMargin\\\": 0.125\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"level\\\": 10,\\n \\\"maxRiskLimit\\\": 30000000,\\n \\\"minRiskLimit\\\": 20000000,\\n \\\"maxLeverage\\\": 3,\\n \\\"initialMargin\\\": 0.334,\\n \\\"maintainMargin\\\": 0.167\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"level\\\": 11,\\n \\\"maxRiskLimit\\\": 40000000,\\n \\\"minRiskLimit\\\": 30000000,\\n \\\"maxLeverage\\\": 2,\\n \\\"initialMargin\\\": 0.5,\\n \\\"maintainMargin\\\": 0.25\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"level\\\": 12,\\n \\\"maxRiskLimit\\\": 50000000,\\n \\\"minRiskLimit\\\": 40000000,\\n \\\"maxLeverage\\\": 1,\\n \\\"initialMargin\\\": 1.0,\\n \\\"maintainMargin\\\": 0.5\\n }\\n ]\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDTM\\\"}" + "x-sdk-method-name": "GetMaxOpenSize", + "x-sdk-method-description": "Get Maximum Open Position Size.", + "x-api-rate-limit": 2, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"maxBuyOpenSize\\\": 0,\\n \\\"maxSellOpenSize\\\": 0\\n }\\n}", + "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDTM\\\", \\\"price\\\": \\\"example_string_default_value\\\", \\\"leverage\\\": 123456}" } }, "/api/v1/position": { @@ -7346,77 +7455,6 @@ "x-request-example": "{\\\"symbol\\\": \\\"example_string_default_value\\\"}" } }, - "/api/v1/position/risk-limit-level/change": { - "post": { - "summary": "Modify Isolated Margin Risk Limit", - "deprecated": false, - "description": "This interface can be used to obtain information about risk limit level of a specific contract(Only valid for isolated Margin).", - "tags": [], - "parameters": [], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "data": { - "type": "boolean", - "description": "To adjust the level will cancel the open order, the response can only indicate whether the submit of the adjustment request is successful or not.\n" - } - }, - "required": [ - "code", - "data" - ] - } - } - } - } - }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470264", - "x-abandon": "normal", - "x-domain": "Futures", - "x-api-channel": "Private", - "x-api-permission": "Futures", - "x-api-rate-limit-pool": "Futures", - "x-sdk-service": "Futures", - "x-sdk-sub-service": "Positions", - "x-sdk-method-name": "modifyIsolatedMarginRiskLimt", - "x-sdk-method-description": "This interface can be used to obtain information about risk limit level of a specific contract(Only valid for isolated Margin).", - "x-api-rate-limit": 5, - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "symbol": { - "type": "string", - "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) " - }, - "level": { - "type": "integer", - "description": "level" - } - }, - "required": [ - "symbol", - "level" - ] - }, - "example": "{\n \"symbol\" : \"XBTUSDTM\",\n \"level\" : 2\n}" - } - } - }, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": true\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDTM\\\", \\\"level\\\": 2}" - } - }, "/api/v1/positions": { "get": { "summary": "Get Position List", @@ -7955,11 +7993,138 @@ "x-request-example": "{\\\"symbol\\\": \\\"example_string_default_value\\\", \\\"from\\\": 123456, \\\"to\\\": 123456, \\\"limit\\\": 10, \\\"pageId\\\": 1}" } }, - "/api/v1/margin/withdrawMargin": { + "/api/v1/margin/maxWithdrawMargin": { + "get": { + "summary": "Get Max Withdraw Margin", + "deprecated": false, + "description": "This interface can query the maximum amount of margin that the current position supports withdrawal.", + "tags": [], + "parameters": [ + { + "name": "symbol", + "in": "query", + "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) ", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "string", + "description": "The size of the position that can be deposited. If it is USDT-margin, it represents the amount of USDT. If it is coin-margin, this value represents the number of coins\n" + } + }, + "required": [ + "code", + "data" + ] + } + } + } + } + }, + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470258", + "x-abandon": "normal", + "x-domain": "Futures", + "x-api-channel": "Private", + "x-api-permission": "Futures", + "x-api-rate-limit-pool": "Futures", + "x-sdk-service": "Futures", + "x-sdk-sub-service": "Positions", + "x-sdk-method-name": "GetMaxWithdrawMargin", + "x-sdk-method-description": "This interface can query the maximum amount of margin that the current position supports withdrawal.", + "x-api-rate-limit": 10, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": \\\"21.1135719252\\\"\\n}", + "x-request-example": "{\\\"symbol\\\": \\\"example_string_default_value\\\"}" + } + }, + "/api/v2/getCrossUserLeverage": { + "get": { + "summary": "Get Cross Margin Leverage", + "deprecated": false, + "description": "This interface can query the current symbol’s cross-margin leverage multiple.", + "tags": [], + "parameters": [ + { + "name": "symbol", + "in": "query", + "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) ", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "object", + "properties": { + "symbol": { + "type": "string", + "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) " + }, + "leverage": { + "type": "string", + "description": "Leverage multiple" + } + }, + "required": [ + "symbol", + "leverage" + ] + } + }, + "required": [ + "code", + "data" + ] + } + } + } + } + }, + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470260", + "x-abandon": "normal", + "x-domain": "Futures", + "x-api-channel": "Private", + "x-api-permission": "Futures", + "x-api-rate-limit-pool": "Futures", + "x-sdk-service": "Futures", + "x-sdk-sub-service": "Positions", + "x-sdk-method-name": "getCrossMarginLeverage", + "x-sdk-method-description": "This interface can query the current symbol’s cross-margin leverage multiple.", + "x-api-rate-limit": 2, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"leverage\\\": \\\"3\\\"\\n }\\n}", + "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDTM\\\"}" + } + }, + "/api/v2/changeCrossUserLeverage": { "post": { - "summary": "Remove Isolated Margin", + "summary": "Modify Cross Margin Leverage", "deprecated": false, - "description": "Remove Isolated Margin Manually.", + "description": "This interface can modify the current symbol’s cross-margin leverage multiple.", "tags": [], "parameters": [], "responses": { @@ -7974,8 +8139,19 @@ "type": "string" }, "data": { - "type": "string", - "description": "The size of the position deposited. If it is USDT-margin, it represents the amount of USDT. If it is coin-margin, this value represents the number of coins\n" + "type": "object", + "properties": { + "symbol": { + "type": "string" + }, + "leverage": { + "type": "string" + } + }, + "required": [ + "symbol", + "leverage" + ] } }, "required": [ @@ -7987,7 +8163,7 @@ } } }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470256", + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470261", "x-abandon": "normal", "x-domain": "Futures", "x-api-channel": "Private", @@ -7995,9 +8171,9 @@ "x-api-rate-limit-pool": "Futures", "x-sdk-service": "Futures", "x-sdk-sub-service": "Positions", - "x-sdk-method-name": "RemoveIsolatedMargin", - "x-sdk-method-description": "Remove Isolated Margin Manually.", - "x-api-rate-limit": 10, + "x-sdk-method-name": "ModifyMarginLeverage", + "x-sdk-method-description": "This interface can modify the current symbol’s cross-margin leverage multiple.", + "x-api-rate-limit": 2, "requestBody": { "content": { "application/json": { @@ -8008,22 +8184,22 @@ "type": "string", "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) " }, - "withdrawAmount": { + "leverage": { "type": "string", - "description": "The size of the position that can be deposited. If it is USDT-margin, it represents the amount of USDT. If it is coin-margin, this value represents the number of coins\n" + "description": "Leverage multiple" } }, "required": [ "symbol", - "withdrawAmount" + "leverage" ] }, - "example": "{\n \"symbol\": \"XBTUSDTM\",\n \"withdrawAmount\": \"0.0000001\"\n}" + "example": "{\n \"symbol\": \"XBTUSDTM\",\n \"leverage\" : \"10\"\n}" } } }, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": \\\"0.1\\\"\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDTM\\\", \\\"withdrawAmount\\\": \\\"0.0000001\\\"}" + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"leverage\\\": \\\"3\\\"\\n }\\n}", + "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDTM\\\", \\\"leverage\\\": \\\"10\\\"}" } }, "/api/v1/position/margin/deposit-margin": { @@ -8292,224 +8468,11 @@ "x-request-example": "{\\\"symbol\\\": \\\"string\\\", \\\"margin\\\": 0, \\\"bizNo\\\": \\\"string\\\"}" } }, - "/api/v1/margin/maxWithdrawMargin": { - "get": { - "summary": "Get Max Withdraw Margin", - "deprecated": false, - "description": "This interface can query the maximum amount of margin that the current position supports withdrawal.", - "tags": [], - "parameters": [ - { - "name": "symbol", - "in": "query", - "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) ", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "data": { - "type": "string", - "description": "The size of the position that can be deposited. If it is USDT-margin, it represents the amount of USDT. If it is coin-margin, this value represents the number of coins\n" - } - }, - "required": [ - "code", - "data" - ] - } - } - } - } - }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470258", - "x-abandon": "normal", - "x-domain": "Futures", - "x-api-channel": "Private", - "x-api-permission": "Futures", - "x-api-rate-limit-pool": "Futures", - "x-sdk-service": "Futures", - "x-sdk-sub-service": "Positions", - "x-sdk-method-name": "GetMaxWithdrawMargin", - "x-sdk-method-description": "This interface can query the maximum amount of margin that the current position supports withdrawal.", - "x-api-rate-limit": 10, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": \\\"21.1135719252\\\"\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"example_string_default_value\\\"}" - } - }, - "/api/v2/position/getMarginMode": { - "get": { - "summary": "Get Margin Mode", - "deprecated": false, - "description": "This interface can query the margin mode of the current symbol.", - "tags": [], - "parameters": [ - { - "name": "symbol", - "in": "query", - "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) ", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "data": { - "type": "object", - "properties": { - "symbol": { - "type": "string", - "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) " - }, - "marginMode": { - "type": "string", - "description": "Margin mode: ISOLATED (isolated), CROSS (cross margin).", - "enum": [ - "ISOLATED", - "CROSS" - ], - "x-api-enum": [ - { - "value": "ISOLATED", - "name": "ISOLATED", - "description": "isolated margin" - }, - { - "value": "CROSS", - "name": "CROSS", - "description": "cross margin" - } - ] - } - }, - "required": [ - "symbol", - "marginMode" - ] - } - }, - "required": [ - "code", - "data" - ] - } - } - } - } - }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470259", - "x-abandon": "normal", - "x-domain": "Futures", - "x-api-channel": "Private", - "x-api-permission": "Futures", - "x-api-rate-limit-pool": "Futures", - "x-sdk-service": "Futures", - "x-sdk-sub-service": "Positions", - "x-sdk-method-name": "getMarginMode", - "x-sdk-method-description": "This interface can query the margin mode of the current symbol.", - "x-api-rate-limit": 2, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"marginMode\\\": \\\"ISOLATED\\\"\\n }\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDTM\\\"}" - } - }, - "/api/v2/getCrossUserLeverage": { - "get": { - "summary": "Get Cross Margin Leverage", - "deprecated": false, - "description": "This interface can query the current symbol’s cross-margin leverage multiple.", - "tags": [], - "parameters": [ - { - "name": "symbol", - "in": "query", - "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) ", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "data": { - "type": "object", - "properties": { - "symbol": { - "type": "string", - "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) " - }, - "leverage": { - "type": "string", - "description": "Leverage multiple" - } - }, - "required": [ - "symbol", - "leverage" - ] - } - }, - "required": [ - "code", - "data" - ] - } - } - } - } - }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470260", - "x-abandon": "normal", - "x-domain": "Futures", - "x-api-channel": "Private", - "x-api-permission": "Futures", - "x-api-rate-limit-pool": "Futures", - "x-sdk-service": "Futures", - "x-sdk-sub-service": "Positions", - "x-sdk-method-name": "getCrossMarginLeverage", - "x-sdk-method-description": "This interface can query the current symbol’s cross-margin leverage multiple.", - "x-api-rate-limit": 2, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"leverage\\\": \\\"3\\\"\\n }\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDTM\\\"}" - } - }, - "/api/v2/changeCrossUserLeverage": { + "/api/v1/margin/withdrawMargin": { "post": { - "summary": "Modify Cross Margin Leverage", + "summary": "Remove Isolated Margin", "deprecated": false, - "description": "This interface can modify the current symbol’s cross-margin leverage multiple.", + "description": "Remove Isolated Margin Manually.", "tags": [], "parameters": [], "responses": { @@ -8524,19 +8487,8 @@ "type": "string" }, "data": { - "type": "object", - "properties": { - "symbol": { - "type": "string" - }, - "leverage": { - "type": "string" - } - }, - "required": [ - "symbol", - "leverage" - ] + "type": "string", + "description": "The size of the position deposited. If it is USDT-margin, it represents the amount of USDT. If it is coin-margin, this value represents the number of coins\n" } }, "required": [ @@ -8548,7 +8500,7 @@ } } }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470261", + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470256", "x-abandon": "normal", "x-domain": "Futures", "x-api-channel": "Private", @@ -8556,9 +8508,9 @@ "x-api-rate-limit-pool": "Futures", "x-sdk-service": "Futures", "x-sdk-sub-service": "Positions", - "x-sdk-method-name": "ModifyMarginLeverage", - "x-sdk-method-description": "This interface can modify the current symbol’s cross-margin leverage multiple.", - "x-api-rate-limit": 2, + "x-sdk-method-name": "RemoveIsolatedMargin", + "x-sdk-method-description": "Remove Isolated Margin Manually.", + "x-api-rate-limit": 10, "requestBody": { "content": { "application/json": { @@ -8569,29 +8521,127 @@ "type": "string", "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) " }, - "leverage": { + "withdrawAmount": { "type": "string", - "description": "Leverage multiple" + "description": "The size of the position that can be deposited. If it is USDT-margin, it represents the amount of USDT. If it is coin-margin, this value represents the number of coins\n" } }, "required": [ "symbol", - "leverage" + "withdrawAmount" ] }, - "example": "{\n \"symbol\": \"XBTUSDTM\",\n \"leverage\" : \"10\"\n}" + "example": "{\n \"symbol\": \"XBTUSDTM\",\n \"withdrawAmount\": \"0.0000001\"\n}" } } }, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"leverage\\\": \\\"3\\\"\\n }\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDTM\\\", \\\"leverage\\\": \\\"10\\\"}" + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": \\\"0.1\\\"\\n}", + "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDTM\\\", \\\"withdrawAmount\\\": \\\"0.0000001\\\"}" } }, - "/api/v2/position/changeMarginMode": { + "/api/v1/contracts/risk-limit/{symbol}": { + "get": { + "summary": "Get Isolated Margin Risk Limit", + "deprecated": false, + "description": "This interface can be used to obtain information about risk limit level of a specific contract(Only valid for isolated Margin).", + "tags": [], + "parameters": [ + { + "name": "symbol", + "in": "path", + "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) ", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "array", + "items": { + "type": "object", + "properties": { + "symbol": { + "type": "string", + "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) " + }, + "level": { + "type": "integer", + "description": "level\n" + }, + "maxRiskLimit": { + "type": "integer", + "description": "Upper limit USDT(includes)\n" + }, + "minRiskLimit": { + "type": "integer", + "description": "Lower limit USDT\n" + }, + "maxLeverage": { + "type": "integer", + "description": "Max leverage\n" + }, + "initialMargin": { + "type": "number", + "description": "Initial margin rate\n" + }, + "maintainMargin": { + "type": "number", + "description": "Maintenance margin rate\n" + } + }, + "required": [ + "symbol", + "level", + "maxRiskLimit", + "minRiskLimit", + "maxLeverage", + "initialMargin", + "maintainMargin" + ] + } + } + }, + "required": [ + "code", + "data" + ] + } + } + } + } + }, + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470263", + "x-abandon": "normal", + "x-domain": "Futures", + "x-api-channel": "Private", + "x-api-permission": "Futures", + "x-api-rate-limit-pool": "Public", + "x-sdk-service": "Futures", + "x-sdk-sub-service": "Positions", + "x-sdk-method-name": "getIsolatedMarginRiskLimit", + "x-sdk-method-description": "This interface can be used to obtain information about risk limit level of a specific contract(Only valid for isolated Margin).", + "x-api-rate-limit": 5, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": [\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"level\\\": 1,\\n \\\"maxRiskLimit\\\": 100000,\\n \\\"minRiskLimit\\\": 0,\\n \\\"maxLeverage\\\": 125,\\n \\\"initialMargin\\\": 0.008,\\n \\\"maintainMargin\\\": 0.004\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"level\\\": 2,\\n \\\"maxRiskLimit\\\": 500000,\\n \\\"minRiskLimit\\\": 100000,\\n \\\"maxLeverage\\\": 100,\\n \\\"initialMargin\\\": 0.01,\\n \\\"maintainMargin\\\": 0.005\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"level\\\": 3,\\n \\\"maxRiskLimit\\\": 1000000,\\n \\\"minRiskLimit\\\": 500000,\\n \\\"maxLeverage\\\": 75,\\n \\\"initialMargin\\\": 0.014,\\n \\\"maintainMargin\\\": 0.007\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"level\\\": 4,\\n \\\"maxRiskLimit\\\": 2000000,\\n \\\"minRiskLimit\\\": 1000000,\\n \\\"maxLeverage\\\": 50,\\n \\\"initialMargin\\\": 0.02,\\n \\\"maintainMargin\\\": 0.01\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"level\\\": 5,\\n \\\"maxRiskLimit\\\": 3000000,\\n \\\"minRiskLimit\\\": 2000000,\\n \\\"maxLeverage\\\": 30,\\n \\\"initialMargin\\\": 0.034,\\n \\\"maintainMargin\\\": 0.017\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"level\\\": 6,\\n \\\"maxRiskLimit\\\": 5000000,\\n \\\"minRiskLimit\\\": 3000000,\\n \\\"maxLeverage\\\": 20,\\n \\\"initialMargin\\\": 0.05,\\n \\\"maintainMargin\\\": 0.025\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"level\\\": 7,\\n \\\"maxRiskLimit\\\": 8000000,\\n \\\"minRiskLimit\\\": 5000000,\\n \\\"maxLeverage\\\": 10,\\n \\\"initialMargin\\\": 0.1,\\n \\\"maintainMargin\\\": 0.05\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"level\\\": 8,\\n \\\"maxRiskLimit\\\": 12000000,\\n \\\"minRiskLimit\\\": 8000000,\\n \\\"maxLeverage\\\": 5,\\n \\\"initialMargin\\\": 0.2,\\n \\\"maintainMargin\\\": 0.1\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"level\\\": 9,\\n \\\"maxRiskLimit\\\": 20000000,\\n \\\"minRiskLimit\\\": 12000000,\\n \\\"maxLeverage\\\": 4,\\n \\\"initialMargin\\\": 0.25,\\n \\\"maintainMargin\\\": 0.125\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"level\\\": 10,\\n \\\"maxRiskLimit\\\": 30000000,\\n \\\"minRiskLimit\\\": 20000000,\\n \\\"maxLeverage\\\": 3,\\n \\\"initialMargin\\\": 0.334,\\n \\\"maintainMargin\\\": 0.167\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"level\\\": 11,\\n \\\"maxRiskLimit\\\": 40000000,\\n \\\"minRiskLimit\\\": 30000000,\\n \\\"maxLeverage\\\": 2,\\n \\\"initialMargin\\\": 0.5,\\n \\\"maintainMargin\\\": 0.25\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"level\\\": 12,\\n \\\"maxRiskLimit\\\": 50000000,\\n \\\"minRiskLimit\\\": 40000000,\\n \\\"maxLeverage\\\": 1,\\n \\\"initialMargin\\\": 1.0,\\n \\\"maintainMargin\\\": 0.5\\n }\\n ]\\n}", + "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDTM\\\"}" + } + }, + "/api/v1/position/risk-limit-level/change": { "post": { - "summary": "Switch Margin Mode", + "summary": "Modify Isolated Margin Risk Limit", "deprecated": false, - "description": "This interface can modify the margin mode of the current symbol.", + "description": "This interface can be used to obtain information about risk limit level of a specific contract(Only valid for isolated Margin).", "tags": [], "parameters": [], "responses": { @@ -8606,37 +8656,8 @@ "type": "string" }, "data": { - "type": "object", - "properties": { - "symbol": { - "type": "string", - "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) " - }, - "marginMode": { - "type": "string", - "description": "Margin mode: ISOLATED (isolated), CROSS (cross margin).", - "enum": [ - "ISOLATED", - "CROSS" - ], - "x-api-enum": [ - { - "value": "ISOLATED", - "name": "ISOLATED", - "description": "isolated margin" - }, - { - "value": "CROSS", - "name": "CROSS", - "description": "cross margin" - } - ] - } - }, - "required": [ - "symbol", - "marginMode" - ] + "type": "boolean", + "description": "To adjust the level will cancel the open order, the response can only indicate whether the submit of the adjustment request is successful or not.\n" } }, "required": [ @@ -8648,7 +8669,7 @@ } } }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470262", + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470264", "x-abandon": "normal", "x-domain": "Futures", "x-api-channel": "Private", @@ -8656,9 +8677,9 @@ "x-api-rate-limit-pool": "Futures", "x-sdk-service": "Futures", "x-sdk-sub-service": "Positions", - "x-sdk-method-name": "switchMarginMode", - "x-sdk-method-description": "This interface can modify the margin mode of the current symbol.", - "x-api-rate-limit": 2, + "x-sdk-method-name": "modifyIsolatedMarginRiskLimt", + "x-sdk-method-description": "This interface can be used to obtain information about risk limit level of a specific contract(Only valid for isolated Margin).", + "x-api-rate-limit": 5, "requestBody": { "content": { "application/json": { @@ -8667,45 +8688,24 @@ "properties": { "symbol": { "type": "string", - "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) ", - "example": [ - "XBTUSDTM", - "XBTUSDCM", - "ETHUSDTM" - ] + "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) " }, - "marginMode": { - "type": "string", - "description": "Modified margin model: ISOLATED (isolated), CROSS (cross margin).", - "enum": [ - "ISOLATED", - "CROSS" - ], - "x-api-enum": [ - { - "value": "ISOLATED", - "name": "ISOLATED", - "description": "Isolated Margin Mode" - }, - { - "value": "CROSS", - "name": "CROSS", - "description": "Cross Margin MOde" - } - ] + "level": { + "type": "integer", + "description": "level" } }, "required": [ "symbol", - "marginMode" + "level" ] }, - "example": "{\n \"symbol\": \"XBTUSDTM\",\n \"marginMode\": \"ISOLATED\"\n}" + "example": "{\n \"symbol\" : \"XBTUSDTM\",\n \"level\" : 2\n}" } } }, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"marginMode\\\": \\\"ISOLATED\\\"\\n }\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDTM\\\", \\\"marginMode\\\": \\\"ISOLATED\\\"}" + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": true\\n}", + "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDTM\\\", \\\"level\\\": 2}" } }, "/api/v1/funding-rate/{symbol}/current": { @@ -9108,11 +9108,11 @@ "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDTM\\\", \\\"from\\\": 1700310700000, \\\"to\\\": 1702310700000, \\\"reverse\\\": true, \\\"offset\\\": 123456, \\\"forward\\\": true, \\\"maxCount\\\": 123456}" } }, - "/api/v1/bullet-private": { + "/api/v1/bullet-public": { "post": { - "summary": "Get Private Token - Futures", + "summary": "Get Public Token - Futures", "deprecated": false, - "description": "This interface can obtain the token required for websocket to establish a Futures private connection. If you need use private channels(e.g. account balance notice), please make request as follows to obtain the server list and private token", + "description": "This interface can obtain the token required for websocket to establish a Futures connection. If you need use public channels (e.g. all public market data), please make request as follows to obtain the server list and public token", "tags": [], "parameters": [], "responses": { @@ -9170,11 +9170,11 @@ } }, "required": [ + "endpoint", + "encrypt", "protocol", "pingInterval", - "pingTimeout", - "encrypt", - "endpoint" + "pingTimeout" ] } } @@ -9194,25 +9194,25 @@ } } }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470296", + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470297", "x-abandon": "normal", "x-domain": "Futures", - "x-api-channel": "Private", - "x-api-permission": "General", - "x-api-rate-limit-pool": "Futures", + "x-api-channel": "Public", + "x-api-permission": "NULL", + "x-api-rate-limit-pool": "Public", "x-sdk-service": "Futures", "x-sdk-sub-service": "Market", - "x-sdk-method-name": "getPrivateToken", - "x-sdk-method-description": "This interface can obtain the token required for websocket to establish a Futures private connection. If you need use private channels(e.g. account balance notice), please make request as follows to obtain the server list and private token", + "x-sdk-method-name": "getPublicToken", + "x-sdk-method-description": "This interface can obtain the token required for websocket to establish a Futures connection. If you need use public channels (e.g. all public market data), please make request as follows to obtain the server list and public token", "x-api-rate-limit": 10, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"token\\\": \\\"2neAiuYvAU737TOajb2U3uT8AEZqSWYe0fBD4LoHuXJDSC7gIzJiH4kNTWhCPISWo6nDpAe7aUaaHJ4fG8oRjFgMfUI2sM4IySWHrBceFocY8pKy2REU1HwZIngtMdMrjqPnP-biofFWbNaP1cl0X1pZc2SQ-33hDH1LgNP-yg8bktVoIG0dIxSN4m3uzO8u.ueCCihQ5_4GPpXKxWTDiFQ==\\\",\\n \\\"instanceServers\\\": [\\n {\\n \\\"endpoint\\\": \\\"wss://ws-api-futures.kucoin.com/\\\",\\n \\\"encrypt\\\": true,\\n \\\"protocol\\\": \\\"websocket\\\",\\n \\\"pingInterval\\\": 18000,\\n \\\"pingTimeout\\\": 10000\\n }\\n ]\\n }\\n}" + "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"token\\\":\\\"2neAiuYvAU61ZDXANAGAsiL4-iAExhsBXZxftpOeh_55i3Ysy2q2LEsEWU64mdzUOPusi34M_wGoSf7iNyEWJ6dACm4ny9vJtLTRq_YsRUlG5ADnAawegdiYB9J6i9GjsxUuhPw3Blq6rhZlGykT3Vp1phUafnulOOpts-MEmEF-3bpfetLOAjsMMBS5qwTWJBvJHl5Vs9Y=.gJEIAywPXFr_4L-WG10eug==\\\",\\\"instanceServers\\\":[{\\\"endpoint\\\":\\\"wss://ws-api-futures.kucoin.com/\\\",\\\"encrypt\\\":true,\\\"protocol\\\":\\\"websocket\\\",\\\"pingInterval\\\":18000,\\\"pingTimeout\\\":10000}]}}" } }, - "/api/v1/bullet-public": { + "/api/v1/bullet-private": { "post": { - "summary": "Get Public Token - Futures", + "summary": "Get Private Token - Futures", "deprecated": false, - "description": "This interface can obtain the token required for websocket to establish a Futures connection. If you need use public channels (e.g. all public market data), please make request as follows to obtain the server list and public token", + "description": "This interface can obtain the token required for websocket to establish a Futures private connection. If you need use private channels(e.g. account balance notice), please make request as follows to obtain the server list and private token", "tags": [], "parameters": [], "responses": { @@ -9270,11 +9270,11 @@ } }, "required": [ - "endpoint", - "encrypt", "protocol", "pingInterval", - "pingTimeout" + "pingTimeout", + "encrypt", + "endpoint" ] } } @@ -9294,18 +9294,18 @@ } } }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470297", + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470296", "x-abandon": "normal", "x-domain": "Futures", - "x-api-channel": "Public", - "x-api-permission": "NULL", - "x-api-rate-limit-pool": "Public", + "x-api-channel": "Private", + "x-api-permission": "General", + "x-api-rate-limit-pool": "Futures", "x-sdk-service": "Futures", "x-sdk-sub-service": "Market", - "x-sdk-method-name": "getPublicToken", - "x-sdk-method-description": "This interface can obtain the token required for websocket to establish a Futures connection. If you need use public channels (e.g. all public market data), please make request as follows to obtain the server list and public token", + "x-sdk-method-name": "getPrivateToken", + "x-sdk-method-description": "This interface can obtain the token required for websocket to establish a Futures private connection. If you need use private channels(e.g. account balance notice), please make request as follows to obtain the server list and private token", "x-api-rate-limit": 10, - "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"token\\\":\\\"2neAiuYvAU61ZDXANAGAsiL4-iAExhsBXZxftpOeh_55i3Ysy2q2LEsEWU64mdzUOPusi34M_wGoSf7iNyEWJ6dACm4ny9vJtLTRq_YsRUlG5ADnAawegdiYB9J6i9GjsxUuhPw3Blq6rhZlGykT3Vp1phUafnulOOpts-MEmEF-3bpfetLOAjsMMBS5qwTWJBvJHl5Vs9Y=.gJEIAywPXFr_4L-WG10eug==\\\",\\\"instanceServers\\\":[{\\\"endpoint\\\":\\\"wss://ws-api-futures.kucoin.com/\\\",\\\"encrypt\\\":true,\\\"protocol\\\":\\\"websocket\\\",\\\"pingInterval\\\":18000,\\\"pingTimeout\\\":10000}]}}" + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"token\\\": \\\"2neAiuYvAU737TOajb2U3uT8AEZqSWYe0fBD4LoHuXJDSC7gIzJiH4kNTWhCPISWo6nDpAe7aUaaHJ4fG8oRjFgMfUI2sM4IySWHrBceFocY8pKy2REU1HwZIngtMdMrjqPnP-biofFWbNaP1cl0X1pZc2SQ-33hDH1LgNP-yg8bktVoIG0dIxSN4m3uzO8u.ueCCihQ5_4GPpXKxWTDiFQ==\\\",\\n \\\"instanceServers\\\": [\\n {\\n \\\"endpoint\\\": \\\"wss://ws-api-futures.kucoin.com/\\\",\\n \\\"encrypt\\\": true,\\n \\\"protocol\\\": \\\"websocket\\\",\\n \\\"pingInterval\\\": 18000,\\n \\\"pingTimeout\\\": 10000\\n }\\n ]\\n }\\n}" } }, "/api/v1/position/margin/auto-deposit-status": { diff --git a/spec/rest/entry/openapi-margin.json b/spec/rest/entry/openapi-margin.json index aeba004d..cc678f06 100644 --- a/spec/rest/entry/openapi-margin.json +++ b/spec/rest/entry/openapi-margin.json @@ -590,37 +590,13 @@ "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": [\\n {\\n \\\"symbol\\\": \\\"BTC-USDT\\\",\\n \\\"symbolName\\\": \\\"BTC-USDT\\\",\\n \\\"baseCurrency\\\": \\\"BTC\\\",\\n \\\"quoteCurrency\\\": \\\"USDT\\\",\\n \\\"maxLeverage\\\": 10,\\n \\\"flDebtRatio\\\": \\\"0.97\\\",\\n \\\"tradeEnable\\\": true,\\n \\\"autoRenewMaxDebtRatio\\\": \\\"0.96\\\",\\n \\\"baseBorrowEnable\\\": true,\\n \\\"quoteBorrowEnable\\\": true,\\n \\\"baseTransferInEnable\\\": true,\\n \\\"quoteTransferInEnable\\\": true,\\n \\\"baseBorrowCoefficient\\\": \\\"1\\\",\\n \\\"quoteBorrowCoefficient\\\": \\\"1\\\"\\n }\\n ]\\n}" } }, - "/api/v3/hf/margin/orders/{orderId}": { - "delete": { - "summary": "Cancel Order By OrderId", + "/api/v3/hf/margin/order": { + "post": { + "summary": "Add Order", "deprecated": false, - "description": "This endpoint can be used to cancel a margin order by orderId. This endpoint only sends cancellation requests. The results of the requests must be obtained by checking the order status or subscribing to websocket.", + "description": "Place order to the Cross-margin or Isolated-margin trading system, you can place two major types of orders: limit and market. Orders can only be placed if your account has sufficient funds. Once an order is placed, your funds will be put on hold for the duration of the order. The amount of funds on hold depends on the order type and parameters specified.", "tags": [], - "parameters": [ - { - "name": "orderId", - "in": "path", - "description": "The unique order id generated by the trading system", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "symbol", - "in": "query", - "description": "symbol", - "required": true, - "schema": { - "type": "string", - "example": [ - "BTC-USDT", - "ETH-USDT", - "KCS-USDT" - ] - } - } - ], + "parameters": [], "responses": { "200": { "description": "", @@ -637,11 +613,26 @@ "properties": { "orderId": { "type": "string", - "description": "order id" + "description": "The unique order id generated by the trading system,which can be used later for further actions such as canceling the order." + }, + "loanApplyId": { + "type": "string", + "description": "Borrow order id. The field is returned only after placing the order under the mode of Auto-Borrow." + }, + "borrowSize": { + "type": "string", + "description": "Borrowed amount. The field is returned only after placing the order under the mode of Auto-Borrow." + }, + "clientOid": { + "type": "string", + "description": "The user self-defined order id." } }, "required": [ - "orderId" + "orderId", + "borrowSize", + "clientOid", + "loanApplyId" ] } }, @@ -654,7 +645,7 @@ } } }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470195", + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470204", "x-abandon": "normal", "x-domain": "Spot", "x-api-channel": "Private", @@ -662,328 +653,249 @@ "x-api-rate-limit-pool": "Spot", "x-sdk-service": "Margin", "x-sdk-sub-service": "Order", - "x-sdk-method-name": "cancelOrderByOrderId", - "x-sdk-method-description": "This endpoint can be used to cancel a margin order by orderId. This endpoint only sends cancellation requests. The results of the requests must be obtained by checking the order status or subscribing to websocket.", + "x-sdk-method-name": "addOrder", + "x-sdk-method-description": "Place order to the Cross-margin or Isolated-margin trading system, you can place two major types of orders: limit and market. Orders can only be placed if your account has sufficient funds. Once an order is placed, your funds will be put on hold for the duration of the order. The amount of funds on hold depends on the order type and parameters specified.", "x-api-rate-limit": 5, - "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"orderId\\\":\\\"671663e02188630007e21c9c\\\"}}", - "x-request-example": "{\\\"orderId\\\": \\\"671663e02188630007e21c9c\\\", \\\"symbol\\\": \\\"BTC-USDT\\\"}" - }, - "get": { - "summary": "Get Order By OrderId", - "deprecated": false, - "description": "This endpoint can be used to obtain information for a single Margin order using the order id. After the user successfully places an order, the order is in Active state, and the user can use inOrderBook to determine whether the order has entered the order. Canceled or fully filled orders are marked as completed Done status.", - "tags": [], - "parameters": [ - { - "name": "symbol", - "in": "query", - "description": "symbol", - "required": true, - "schema": { - "type": "string", - "example": [ - "BTC-USDT", - "ETH-USDT", - "KCS-USDT" - ] - } - }, - { - "name": "orderId", - "in": "path", - "description": "The unique order id generated by the trading system", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "data": { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "The unique order id generated by the trading system" - }, - "symbol": { - "type": "string", - "description": "symbol", - "example": [ - "BTC-USDT", - "ETH-USDT", - "KCS-USDT" - ] - }, - "opType": { - "type": "string" - }, - "type": { - "type": "string", - "description": "Specify if the order is an 'limit' order or 'market' order. ", - "enum": [ - "limit", - "market" - ], - "x-api-enum": [ - { - "value": "limit", - "name": "", - "description": "" - }, - { - "value": "market", - "name": "", - "description": "" - } - ] - }, - "side": { - "type": "string", - "description": "Buy or sell", - "enum": [ - "buy", - "sell" - ], - "x-api-enum": [ - { - "value": "buy", - "name": "", - "description": "" - }, - { - "value": "sell", - "name": "", - "description": "" - } - ] - }, - "price": { - "type": "string", - "description": "Order price" - }, - "size": { - "type": "string", - "description": "Order size" - }, - "funds": { - "type": "string", - "description": "Order Funds" - }, - "dealSize": { - "type": "string", - "description": "Number of filled transactions" - }, - "dealFunds": { - "type": "string", - "description": "Funds of filled transactions" - }, - "fee": { - "type": "string", - "description": "[Handling fees](https://www.kucoin.com/docs-new/api-5327739)" - }, - "feeCurrency": { - "type": "string", - "description": "currency used to calculate trading fee" - }, - "stp": { - "type": "string", - "description": "[Self Trade Prevention](https://www.kucoin.com/docs-new/doc-338146) is divided into these strategies: CN, CO, CB , and DC", - "enum": [ - "DC", - "CO", - "CN", - "CB" - ], - "x-api-enum": [ - { - "value": "DC", - "name": "", - "description": "" - }, - { - "value": "CO", - "name": "", - "description": "" - }, - { - "value": "CN", - "name": "", - "description": "" - }, - { - "value": "CB", - "name": "", - "description": "" - } - ] - }, - "stop": { - "type": "string" - }, - "stopTriggered": { - "type": "boolean" - }, - "stopPrice": { - "type": "string" - }, - "timeInForce": { - "type": "string", - "description": "Time in force", - "enum": [ - "GTC", - "GTT", - "IOC", - "FOK" - ], - "x-api-enum": [ - { - "value": "GTC", - "name": "", - "description": "" - }, - { - "value": "GTT", - "name": "", - "description": "" - }, - { - "value": "IOC", - "name": "", - "description": "" - }, - { - "value": "FOK", - "name": "", - "description": "" - } - ] - }, - "postOnly": { - "type": "boolean", - "description": "Whether its a postOnly order." - }, - "hidden": { - "type": "boolean", - "description": "Whether its a hidden order." - }, - "iceberg": { - "type": "boolean", - "description": "Whether its a iceberg order." - }, - "visibleSize": { + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "clientOid": { + "type": "string", + "description": "Client Order Id,The ClientOid field is a unique ID created by the user(we recommend using a UUID), and can only contain numbers, letters, underscores (_), and hyphens (-). This field is returned when order information is obtained. You can use clientOid to tag your orders. ClientOid is different from the order ID created by the service provider. Please do not initiate requests using the same clientOid. The maximum length for the ClientOid is 40 characters.\n\nPlease remember the orderId created by the service provider, it used to check for updates in order status.", + "example": [ + "5c52e11203aa677f33e493fb" + ] + }, + "side": { + "type": "string", + "description": "specify if the order is to 'buy' or 'sell'", + "enum": [ + "buy", + "sell" + ], + "x-api-enum": [ + { + "value": "buy", + "name": "", + "description": "" + }, + { + "value": "sell", + "name": "", + "description": "" + } + ], + "example": [ + "buy" + ] + }, + "symbol": { + "type": "string", + "description": "symbol", + "example": [ + "BTC-USDT", + "ETH-USDT", + "KCS-USDT" + ] + }, + "type": { + "type": "string", + "description": "specify if the order is an 'limit' order or 'market' order. \n\nThe type of order you specify when you place your order determines whether or not you need to request other parameters and also affects the execution of the matching engine.\n\nWhen placing a limit order, you must specify a price and size. The system will try to match the order according to market price or a price better than market price. If the order cannot be immediately matched, it will stay in the order book until it is matched or the user cancels.\n\nUnlike limit orders, the price for market orders fluctuates with market prices. When placing a market order, you do not need to specify a price, you only need to specify a quantity. Market orders are filled immediately and will not enter the order book. All market orders are takers and a taker fee will be charged.", + "enum": [ + "limit", + "market" + ], + "default": "limit", + "x-api-enum": [ + { + "value": "limit", + "name": "", + "description": "" + }, + { + "value": "market", + "name": "", + "description": "" + } + ] + }, + "stp": { + "type": "string", + "description": "[Self Trade Prevention](https://www.kucoin.com/docs-new/doc-338146) is divided into these strategies: CN, CO, CB , and DC", + "enum": [ + "DC", + "CO", + "CN", + "CB" + ], + "x-api-enum": [ + { + "value": "DC", + "name": "", + "description": "" + }, + { + "value": "CO", + "name": "", + "description": "" + }, + { + "value": "CN", + "name": "", + "description": "" + }, + { + "value": "CB", + "name": "", + "description": "" + } + ] + }, + "price": { + "type": "string", + "description": "Specify price for order\n\nWhen placing a limit order, the price must be based on priceIncrement for the trading pair. The price increment (priceIncrement) is the price precision for the trading pair. For example, for the BTC-USDT trading pair, the priceIncrement is 0.00001000. So the price for your orders cannot be less than 0.00001000 and must be a multiple of priceIncrement. Otherwise, the order will return an invalid priceIncrement error." + }, + "size": { + "type": "string", + "description": "Specify quantity for order\n\nWhen **type** is limit, size refers to the amount of trading targets (the asset name written in front) for the trading pair. Teh Size must be based on the baseIncrement of the trading pair. The baseIncrement represents the precision for the trading pair. The size of an order must be a positive-integer multiple of baseIncrement and must be between baseMinSize and baseMaxSize.\n\nWhen **type** is market, select one out of two: size or funds" + }, + "timeInForce": { + "type": "string", + "description": "[Time in force](https://www.kucoin.com/docs-new/api-5176570) is a special strategy used during trading", + "enum": [ + "GTC", + "GTT", + "IOC", + "FOK" + ], + "default": "GTC", + "x-api-enum": [ + { + "value": "GTC", + "name": "", + "description": "" + }, + { + "value": "GTT", + "name": "", + "description": "" + }, + { + "value": "IOC", + "name": "", + "description": "" + }, + { + "value": "FOK", + "name": "", + "description": "" + } + ] + }, + "postOnly": { + "type": "boolean", + "default": false, + "description": "passive order labels, this is disabled when the order timing strategy is IOC or FOK" + }, + "hidden": { + "type": "boolean", + "description": "[Hidden order](https://www.kucoin.com/docs-new/doc-338146) or not (not shown in order book)", + "default": false + }, + "iceberg": { + "type": "boolean", + "description": "Whether or not only visible portions of orders are shown in [Iceberg orders](https://www.kucoin.com/docs-new/doc-338146)", + "default": false + }, + "visibleSize": { + "type": "string", + "description": "Maximum visible quantity in iceberg orders" + }, + "cancelAfter": { + "type": "integer", + "format": "int64", + "description": "Cancel after n seconds,the order timing strategy is GTT" + }, + "funds": { + "type": "string", + "description": "When **type** is market, select one out of two: size or funds" + }, + "isIsolated": { + "type": "boolean", + "description": "true - isolated margin ,false - cross margin. defult as false", + "default": false + }, + "autoBorrow": { + "type": "boolean", + "description": "When Margin Account has inefficient balance, our system autoborrows inefficient assets and opens positions according to the lowest market interest rate.", + "default": false + }, + "autoRepay": { + "type": "boolean", + "description": "AutoPay allows returning borrowed assets when you close a position. Our system automatically triggers the repayment and the maximum repayment amount equals to the filled-order amount.", + "default": false + } + }, + "required": [ + "symbol", + "side", + "clientOid" + ] + }, + "example": "//limit order\n{\n \"type\": \"limit\",\n \"symbol\": \"BTC-USDT\",\n \"side\": \"buy\",\n \"price\": \"50000\",\n \"size\": \"0.00001\",\n \"clientOid\": \"5c52e11203aa677f33e493fb\",\n \"remark\": \"order remarks\"\n}\n\n//market order 1\n// {\n// \"type\": \"market\",\n// \"symbol\": \"BTC-USDT\",\n// \"side\": \"buy\",\n// \"size\": \"0.00001\",\n// \"clientOid\": \"5c52e11203aa677f33e493fc\",\n// \"remark\": \"order remarks\"\n// }\n\n//market order 2\n// {\n// \"type\": \"market\",\n// \"symbol\": \"BTC-USDT\",\n// \"side\": \"buy\",\n// \"funds\": \"1\",\n// \"clientOid\": \"5c52e11203aa677f33e493fc\",\n// \"remark\": \"order remarks\"\n// }\n" + } + } + }, + "x-response-example": "{\\n \\\"success\\\": true,\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"orderId\\\": \\\"671663e02188630007e21c9c\\\",\\n \\\"clientOid\\\": \\\"5c52e11203aa677f33e1493fb\\\",\\n \\\"borrowSize\\\": \\\"10.2\\\",\\n \\\"loanApplyId\\\": \\\"600656d9a33ac90009de4f6f\\\"\\n }\\n}", + "x-request-example": "{\\\"type\\\": \\\"limit\\\", \\\"symbol\\\": \\\"BTC-USDT\\\", \\\"side\\\": \\\"buy\\\", \\\"price\\\": \\\"50000\\\", \\\"size\\\": \\\"0.00001\\\", \\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\", \\\"remark\\\": \\\"order remarks\\\"}" + } + }, + "/api/v3/hf/margin/order/test": { + "post": { + "summary": "Add Order Test", + "deprecated": false, + "description": " Order test endpoint, the request parameters and return parameters of this endpoint are exactly the same as the order endpoint, and can be used to verify whether the signature is correct and other operations. After placing an order, the order will not enter the matching system, and the order cannot be queried.", + "tags": [], + "parameters": [], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "object", + "properties": { + "orderId": { "type": "string", - "description": "Visible size of iceberg order in order book." + "description": "The unique order id generated by the trading system,which can be used later for further actions such as canceling the order." }, - "cancelAfter": { - "type": "integer", - "description": "A GTT timeInForce that expires in n seconds" + "loanApplyId": { + "type": "string", + "description": "Borrowed amount. The field is returned only after placing the order under the mode of Auto-Borrow." }, - "channel": { - "type": "string" + "borrowSize": { + "type": "number", + "description": "ID of the borrowing response. The field is returned only after placing the order under the mode of Auto-Borrow." }, "clientOid": { "type": "string", - "description": "Client Order Id,unique identifier created by the user" - }, - "remark": { - "type": "string", - "description": "Order placement remarks" - }, - "tags": { - "type": "string", - "description": "Order tag" - }, - "cancelExist": { - "type": "boolean", - "description": "Whether there is a cancellation record for the order." - }, - "createdAt": { - "type": "integer", - "format": "int64" - }, - "lastUpdatedAt": { - "type": "integer", - "format": "int64" - }, - "tradeType": { - "type": "string", - "description": "Trade type, redundancy param" - }, - "inOrderBook": { - "type": "boolean", - "description": "Whether to enter the orderbook: true: enter the orderbook; false: not enter the orderbook" - }, - "cancelledSize": { - "type": "string", - "description": "Number of canceled transactions" - }, - "cancelledFunds": { - "type": "string", - "description": "Funds of canceled transactions" - }, - "remainSize": { - "type": "string", - "description": "Number of remain transactions" - }, - "remainFunds": { - "type": "string", - "description": "Funds of remain transactions" - }, - "tax": { - "type": "string", - "description": "Users in some regions need query this field" - }, - "active": { - "type": "boolean", - "description": "Order status: true-The status of the order isactive; false-The status of the order is done" + "description": "The user self-defined order id." } }, "required": [ - "id", - "symbol", - "opType", - "type", - "side", - "price", - "size", - "funds", - "dealSize", - "dealFunds", - "fee", - "feeCurrency", - "stopTriggered", - "stopPrice", - "timeInForce", - "postOnly", - "hidden", - "iceberg", - "visibleSize", - "cancelAfter", - "channel", + "orderId", + "borrowSize", "clientOid", - "remark", - "cancelExist", - "createdAt", - "lastUpdatedAt", - "tradeType", - "inOrderBook", - "cancelledSize", - "cancelledFunds", - "remainSize", - "remainFunds", - "tax", - "active" + "loanApplyId" ] } }, @@ -996,153 +908,241 @@ } } }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470202", + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470205", "x-abandon": "normal", "x-domain": "Spot", "x-api-channel": "Private", - "x-api-permission": "General", + "x-api-permission": "Margin", "x-api-rate-limit-pool": "Spot", "x-sdk-service": "Margin", "x-sdk-sub-service": "Order", - "x-sdk-method-name": "getOrderByOrderId", - "x-sdk-method-description": "This endpoint can be used to obtain information for a single Margin order using the order id. After the user successfully places an order, the order is in Active state, and the user can use inOrderBook to determine whether the order has entered the order. Canceled or fully filled orders are marked as completed Done status.", + "x-sdk-method-name": "addOrderTest", + "x-sdk-method-description": " Order test endpoint, the request parameters and return parameters of this endpoint are exactly the same as the order endpoint, and can be used to verify whether the signature is correct and other operations. After placing an order, the order will not enter the matching system, and the order cannot be queried.", "x-api-rate-limit": 5, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"id\\\": \\\"671667306afcdb000723107f\\\",\\n \\\"symbol\\\": \\\"BTC-USDT\\\",\\n \\\"opType\\\": \\\"DEAL\\\",\\n \\\"type\\\": \\\"limit\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"price\\\": \\\"50000\\\",\\n \\\"size\\\": \\\"0.00001\\\",\\n \\\"funds\\\": \\\"0.5\\\",\\n \\\"dealSize\\\": \\\"0\\\",\\n \\\"dealFunds\\\": \\\"0\\\",\\n \\\"fee\\\": \\\"0\\\",\\n \\\"feeCurrency\\\": \\\"USDT\\\",\\n \\\"stp\\\": null,\\n \\\"stop\\\": null,\\n \\\"stopTriggered\\\": false,\\n \\\"stopPrice\\\": \\\"0\\\",\\n \\\"timeInForce\\\": \\\"GTC\\\",\\n \\\"postOnly\\\": false,\\n \\\"hidden\\\": false,\\n \\\"iceberg\\\": false,\\n \\\"visibleSize\\\": \\\"0\\\",\\n \\\"cancelAfter\\\": 0,\\n \\\"channel\\\": \\\"API\\\",\\n \\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\",\\n \\\"remark\\\": null,\\n \\\"tags\\\": null,\\n \\\"cancelExist\\\": false,\\n \\\"createdAt\\\": 1729521456248,\\n \\\"lastUpdatedAt\\\": 1729651011877,\\n \\\"tradeType\\\": \\\"MARGIN_TRADE\\\",\\n \\\"inOrderBook\\\": true,\\n \\\"cancelledSize\\\": \\\"0\\\",\\n \\\"cancelledFunds\\\": \\\"0\\\",\\n \\\"remainSize\\\": \\\"0.00001\\\",\\n \\\"remainFunds\\\": \\\"0.5\\\",\\n \\\"tax\\\": \\\"0\\\",\\n \\\"active\\\": true\\n }\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"orderId\\\": \\\"671667306afcdb000723107f\\\"}" - } - }, - "/api/v3/hf/margin/order/active/symbols": { - "get": { - "summary": "Get Symbols With Open Order", - "deprecated": false, - "description": "This interface can query all Margin symbol that has active orders", - "tags": [], - "parameters": [ - { - "name": "tradeType", - "in": "query", - "description": "Cross Margin: MARGIN_TRADE, Isolated Margin: MARGIN_ISOLATED_TRADE\n", - "required": true, - "schema": { - "type": "string", - "enum": [ - "MARGIN_TRADE", - "MARGIN_ISOLATED_TRADE" - ], - "x-api-enum": [ - { - "value": "MARGIN_TRADE", - "name": "", - "description": "" - }, - { - "value": "MARGIN_ISOLATED_TRADE", - "name": "", - "description": "" - } - ] - } - } - ], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "data": { - "type": "object", - "properties": { - "symbolSize": { - "type": "integer", - "description": "Symbol Size" - }, - "symbols": { - "type": "array", - "items": { - "type": "string" - }, - "description": "The symbol that has active orders" - } + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "clientOid": { + "type": "string", + "description": "Client Order Id,The ClientOid field is a unique ID created by the user(we recommend using a UUID), and can only contain numbers, letters, underscores (_), and hyphens (-). This field is returned when order information is obtained. You can use clientOid to tag your orders. ClientOid is different from the order ID created by the service provider. Please do not initiate requests using the same clientOid. The maximum length for the ClientOid is 40 characters.\n\nPlease remember the orderId created by the service provider, it used to check for updates in order status.", + "example": [ + "5c52e11203aa677f33e493fb" + ] + }, + "side": { + "type": "string", + "description": "specify if the order is to 'buy' or 'sell'", + "enum": [ + "buy", + "sell" + ], + "x-api-enum": [ + { + "value": "buy", + "name": "", + "description": "" }, - "required": [ - "symbolSize", - "symbols" - ] - } + { + "value": "sell", + "name": "", + "description": "" + } + ], + "example": [ + "buy" + ] }, - "required": [ - "code", - "data" - ] - } - } - } - } - }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470196", - "x-abandon": "normal", - "x-domain": "Spot", - "x-api-channel": "Private", - "x-api-permission": "Margin", - "x-api-rate-limit-pool": "Spot", - "x-sdk-service": "Margin", - "x-sdk-sub-service": "Order", - "x-sdk-method-name": "getSymbolsWithOpenOrder", - "x-sdk-method-description": "This interface can query all Margin symbol that has active orders", - "x-api-rate-limit": 2, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"symbolSize\\\": 1,\\n \\\"symbols\\\": [\\n \\\"BTC-USDT\\\"\\n ]\\n }\\n}", - "x-request-example": "{\\\"tradeType\\\": \\\"MARGIN_TRADE\\\"}" - } - }, - "/api/v3/hf/margin/orders": { - "delete": { - "summary": "Cancel All Orders By Symbol", - "deprecated": false, - "description": "This interface can cancel all open Margin orders by symbol This endpoint only sends cancellation requests. The results of the requests must be obtained by checking the order status or subscribing to websocket.", - "tags": [], - "parameters": [ - { - "name": "symbol", - "in": "query", - "description": "symbol", - "required": true, - "schema": { - "type": "string", - "example": [ - "BTC-USDT", - "ETH-USDT", - "KCS-USDT" - ] - } - }, - { - "name": "tradeType", - "in": "query", - "description": "Transaction type: MARGIN_TRADE - cross margin trade, MARGIN_ISOLATED_TRADE - isolated margin trade", - "required": true, - "schema": { - "type": "string", - "enum": [ - "MARGIN_TRADE", - "MARGIN_ISOLATED_TRADE" - ], - "x-api-enum": [ - { - "value": "MARGIN_TRADE", - "name": "", - "description": "" + "symbol": { + "type": "string", + "description": "symbol", + "example": [ + "BTC-USDT", + "ETH-USDT", + "KCS-USDT" + ] + }, + "type": { + "type": "string", + "description": "specify if the order is an 'limit' order or 'market' order. \n\nThe type of order you specify when you place your order determines whether or not you need to request other parameters and also affects the execution of the matching engine.\n\nWhen placing a limit order, you must specify a price and size. The system will try to match the order according to market price or a price better than market price. If the order cannot be immediately matched, it will stay in the order book until it is matched or the user cancels.\n\nUnlike limit orders, the price for market orders fluctuates with market prices. When placing a market order, you do not need to specify a price, you only need to specify a quantity. Market orders are filled immediately and will not enter the order book. All market orders are takers and a taker fee will be charged.", + "enum": [ + "limit", + "market" + ], + "default": "limit", + "x-api-enum": [ + { + "value": "limit", + "name": "", + "description": "" + }, + { + "value": "market", + "name": "", + "description": "" + } + ] + }, + "stp": { + "type": "string", + "description": "[Self Trade Prevention](https://www.kucoin.com/docs-new/doc-338146) is divided into these strategies: CN, CO, CB , and DC", + "enum": [ + "DC", + "CO", + "CN", + "CB" + ], + "x-api-enum": [ + { + "value": "DC", + "name": "", + "description": "" + }, + { + "value": "CO", + "name": "", + "description": "" + }, + { + "value": "CN", + "name": "", + "description": "" + }, + { + "value": "CB", + "name": "", + "description": "" + } + ] + }, + "price": { + "type": "string", + "description": "Specify price for order\n\nWhen placing a limit order, the price must be based on priceIncrement for the trading pair. The price increment (priceIncrement) is the price precision for the trading pair. For example, for the BTC-USDT trading pair, the priceIncrement is 0.00001000. So the price for your orders cannot be less than 0.00001000 and must be a multiple of priceIncrement. Otherwise, the order will return an invalid priceIncrement error." + }, + "size": { + "type": "string", + "description": "Specify quantity for order\n\nWhen **type** is limit, size refers to the amount of trading targets (the asset name written in front) for the trading pair. Teh Size must be based on the baseIncrement of the trading pair. The baseIncrement represents the precision for the trading pair. The size of an order must be a positive-integer multiple of baseIncrement and must be between baseMinSize and baseMaxSize.\n\nWhen **type** is market, select one out of two: size or funds" + }, + "timeInForce": { + "type": "string", + "description": "[Time in force](https://www.kucoin.com/docs-new/api-5176570) is a special strategy used during trading", + "enum": [ + "GTC", + "GTT", + "IOC", + "FOK" + ], + "default": "GTC", + "x-api-enum": [ + { + "value": "GTC", + "name": "", + "description": "" + }, + { + "value": "GTT", + "name": "", + "description": "" + }, + { + "value": "IOC", + "name": "", + "description": "" + }, + { + "value": "FOK", + "name": "", + "description": "" + } + ] + }, + "postOnly": { + "type": "boolean", + "default": false, + "description": "passive order labels, this is disabled when the order timing strategy is IOC or FOK" + }, + "hidden": { + "type": "boolean", + "description": "[Hidden order](https://www.kucoin.com/docs-new/doc-338146) or not (not shown in order book)", + "default": false + }, + "iceberg": { + "type": "boolean", + "description": "Whether or not only visible portions of orders are shown in [Iceberg orders](https://www.kucoin.com/docs-new/doc-338146)", + "default": false + }, + "visibleSize": { + "type": "string", + "description": "Maximum visible quantity in iceberg orders" + }, + "cancelAfter": { + "type": "integer", + "format": "int64", + "description": "Cancel after n seconds,the order timing strategy is GTT" + }, + "funds": { + "type": "string", + "description": "When **type** is market, select one out of two: size or funds" + }, + "isIsolated": { + "type": "boolean", + "description": "true - isolated margin ,false - cross margin. defult as false", + "default": false + }, + "autoBorrow": { + "type": "boolean", + "description": "When Margin Account has inefficient balance, our system autoborrows inefficient assets and opens positions according to the lowest market interest rate.", + "default": false + }, + "autoRepay": { + "type": "boolean", + "description": "AutoPay allows returning borrowed assets when you close a position. Our system automatically triggers the repayment and the maximum repayment amount equals to the filled-order amount.", + "default": false + } }, - { - "value": "MARGIN_ISOLATED_TRADE", - "name": "", - "description": "" - } + "required": [ + "symbol", + "side", + "clientOid" + ] + }, + "example": "//limit order\n{\n \"type\": \"limit\",\n \"symbol\": \"BTC-USDT\",\n \"side\": \"buy\",\n \"price\": \"50000\",\n \"size\": \"0.00001\",\n \"clientOid\": \"5c52e11203aa677f33e493fb\",\n \"remark\": \"order remarks\"\n}\n\n//market order 1\n// {\n// \"type\": \"market\",\n// \"symbol\": \"BTC-USDT\",\n// \"side\": \"buy\",\n// \"size\": \"0.00001\",\n// \"clientOid\": \"5c52e11203aa677f33e493fc\",\n// \"remark\": \"order remarks\"\n// }\n\n//market order 2\n// {\n// \"type\": \"market\",\n// \"symbol\": \"BTC-USDT\",\n// \"side\": \"buy\",\n// \"funds\": \"1\",\n// \"clientOid\": \"5c52e11203aa677f33e493fc\",\n// \"remark\": \"order remarks\"\n// }\n" + } + } + }, + "x-response-example": "{\\n \\\"success\\\": true,\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"orderId\\\": \\\"5bd6e9286d99522a52e458de\\\",\\n \\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\",\\n \\\"borrowSize\\\": 10.2,\\n \\\"loanApplyId\\\": \\\"600656d9a33ac90009de4f6f\\\"\\n }\\n}", + "x-request-example": "{\\\"type\\\": \\\"limit\\\", \\\"symbol\\\": \\\"BTC-USDT\\\", \\\"side\\\": \\\"buy\\\", \\\"price\\\": \\\"50000\\\", \\\"size\\\": \\\"0.00001\\\", \\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\", \\\"remark\\\": \\\"order remarks\\\"}" + } + }, + "/api/v3/hf/margin/orders/{orderId}": { + "delete": { + "summary": "Cancel Order By OrderId", + "deprecated": false, + "description": "This endpoint can be used to cancel a margin order by orderId. This endpoint only sends cancellation requests. The results of the requests must be obtained by checking the order status or subscribing to websocket.", + "tags": [], + "parameters": [ + { + "name": "orderId", + "in": "path", + "description": "The unique order id generated by the trading system", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "symbol", + "in": "query", + "description": "symbol", + "required": true, + "schema": { + "type": "string", + "example": [ + "BTC-USDT", + "ETH-USDT", + "KCS-USDT" ] } } @@ -1159,7 +1159,16 @@ "type": "string" }, "data": { - "type": "string" + "type": "object", + "properties": { + "orderId": { + "type": "string", + "description": "order id" + } + }, + "required": [ + "orderId" + ] } }, "required": [ @@ -1171,7 +1180,7 @@ } } }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470197", + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470195", "x-abandon": "normal", "x-domain": "Spot", "x-api-channel": "Private", @@ -1179,18 +1188,16 @@ "x-api-rate-limit-pool": "Spot", "x-sdk-service": "Margin", "x-sdk-sub-service": "Order", - "x-sdk-method-name": "cancelAllOrdersBySymbol", - "x-sdk-method-description": "This interface can cancel all open Margin orders by symbol This endpoint only sends cancellation requests. The results of the requests must be obtained by checking the order status or subscribing to websocket.", - "x-api-rate-limit": 10, - "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":\\\"success\\\"}", - "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"tradeType\\\": \\\"MARGIN_TRADE\\\"}" - } - }, - "/api/v3/hf/margin/orders/active": { + "x-sdk-method-name": "cancelOrderByOrderId", + "x-sdk-method-description": "This endpoint can be used to cancel a margin order by orderId. This endpoint only sends cancellation requests. The results of the requests must be obtained by checking the order status or subscribing to websocket.", + "x-api-rate-limit": 5, + "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"orderId\\\":\\\"671663e02188630007e21c9c\\\"}}", + "x-request-example": "{\\\"orderId\\\": \\\"671663e02188630007e21c9c\\\", \\\"symbol\\\": \\\"BTC-USDT\\\"}" + }, "get": { - "summary": "Get Open Orders", + "summary": "Get Order By OrderId", "deprecated": false, - "description": "This interface is to obtain all Margin active order lists, and the return value of the active order interface is the paged data of all uncompleted order lists. The returned data is sorted in descending order according to the latest update time of the order. After the user successfully places an order, the order is in Active state, and the user can use inOrderBook to determine whether the order has entered the order. Canceled or fully filled orders are marked as completed Done status.", + "description": "This endpoint can be used to obtain information for a single Margin order using the order id. After the user successfully places an order, the order is in Active state, and the user can use inOrderBook to determine whether the order has entered the order. Canceled or fully filled orders are marked as completed Done status.", "tags": [], "parameters": [ { @@ -1208,28 +1215,12 @@ } }, { - "name": "tradeType", - "in": "query", - "description": "Order type: MARGIN_TRADE - cross margin trading order, MARGIN_ISOLATED_TRADE - isolated margin trading order", + "name": "orderId", + "in": "path", + "description": "The unique order id generated by the trading system", "required": true, "schema": { - "type": "string", - "enum": [ - "MARGIN_TRADE", - "MARGIN_ISOLATED_TRADE" - ], - "x-api-enum": [ - { - "value": "MARGIN_TRADE", - "name": "", - "description": "" - }, - { - "value": "MARGIN_ISOLATED_TRADE", - "name": "", - "description": "" - } - ] + "type": "string" } } ], @@ -1245,1096 +1236,280 @@ "type": "string" }, "data": { - "type": "array", - "items": { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "The unique order id generated by the trading system" - }, - "symbol": { - "type": "string", - "description": "symbol", - "example": [ - "BTC-USDT", - "ETH-USDT", - "KCS-USDT" - ] - }, - "opType": { - "type": "string" - }, - "type": { - "type": "string", - "description": "Specify if the order is an 'limit' order or 'market' order. ", - "enum": [ - "limit", - "market" - ], - "x-api-enum": [ - { - "value": "limit", - "name": "", - "description": "" - }, - { - "value": "market", - "name": "", - "description": "" - } - ] - }, - "side": { - "type": "string", - "description": "Buy or sell", - "enum": [ - "buy", - "sell" - ], - "x-api-enum": [ - { - "value": "buy", - "name": "", - "description": "" - }, - { - "value": "sell", - "name": "", - "description": "" - } - ] - }, - "price": { - "type": "string", - "description": "Order price" - }, - "size": { - "type": "string", - "description": "Order size" - }, - "funds": { - "type": "string", - "description": "Order Funds" - }, - "dealSize": { - "type": "string", - "description": "Number of filled transactions" - }, - "dealFunds": { - "type": "string", - "description": "Funds of filled transactions" - }, - "fee": { - "type": "string", - "description": "trading fee" - }, - "feeCurrency": { - "type": "string", - "description": "currency used to calculate trading fee" - }, - "stp": { - "type": "string", - "description": "[Self Trade Prevention](https://www.kucoin.com/docs-new/doc-338146) is divided into these strategies: CN, CO, CB , and DC", - "enum": [ - "DC", - "CO", - "CN", - "CB" - ], - "x-api-enum": [ - { - "value": "DC", - "name": "", - "description": "" - }, - { - "value": "CO", - "name": "", - "description": "" - }, - { - "value": "CN", - "name": "", - "description": "" - }, - { - "value": "CB", - "name": "", - "description": "" - } - ] - }, - "stop": { - "type": "string" - }, - "stopTriggered": { - "type": "boolean" - }, - "stopPrice": { - "type": "string" - }, - "timeInForce": { - "type": "string", - "description": "Time in force", - "enum": [ - "GTC", - "GTT", - "IOC", - "FOK" - ], - "x-api-enum": [ - { - "value": "GTC", - "name": "", - "description": "" - }, - { - "value": "GTT", - "name": "", - "description": "" - }, - { - "value": "IOC", - "name": "", - "description": "" - }, - { - "value": "FOK", - "name": "", - "description": "" - } - ] - }, - "postOnly": { - "type": "boolean", - "description": "Whether its a postOnly order." - }, - "hidden": { - "type": "boolean", - "description": "Whether its a hidden order." - }, - "iceberg": { - "type": "boolean", - "description": "Whether its a iceberg order." - }, - "visibleSize": { - "type": "string", - "description": "Visible size of iceberg order in order book." - }, - "cancelAfter": { - "type": "integer", - "description": "A GTT timeInForce that expires in n seconds" - }, - "channel": { - "type": "string" - }, - "clientOid": { - "type": "string", - "description": "Client Order Id,unique identifier created by the user" - }, - "remark": { - "type": "string", - "description": "Order placement remarks" - }, - "tags": { - "type": "string", - "description": "Order tag" - }, - "cancelExist": { - "type": "boolean", - "description": "Whether there is a cancellation record for the order." - }, - "createdAt": { - "type": "integer", - "format": "int64" - }, - "lastUpdatedAt": { - "type": "integer", - "format": "int64" - }, - "tradeType": { - "type": "string", - "description": "Trade type, redundancy param" - }, - "inOrderBook": { - "type": "boolean", - "description": "Whether to enter the orderbook: true: enter the orderbook; false: not enter the orderbook" - }, - "cancelledSize": { - "type": "string", - "description": "Number of canceled transactions" - }, - "cancelledFunds": { - "type": "string", - "description": "Funds of canceled transactions" - }, - "remainSize": { - "type": "string", - "description": "Number of remain transactions" - }, - "remainFunds": { - "type": "string", - "description": "Funds of remain transactions" - }, - "tax": { - "type": "string", - "description": "Users in some regions need query this field" - }, - "active": { - "type": "boolean", - "description": "Order status: true-The status of the order isactive; false-The status of the order is done" - } + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The unique order id generated by the trading system" }, - "required": [ - "stopPrice", - "id", - "symbol", - "opType", - "type", - "side", - "price", - "size", - "funds", - "dealSize", - "dealFunds", - "fee", - "feeCurrency", - "stopTriggered", - "timeInForce", - "postOnly", - "hidden", - "iceberg", - "visibleSize", - "cancelAfter", - "channel", - "clientOid", - "cancelExist", - "tradeType", - "inOrderBook", - "cancelledSize", - "cancelledFunds", - "remainSize", - "remainFunds", - "tax", - "active", - "createdAt", - "lastUpdatedAt" - ] - } - } - }, - "required": [ - "code", - "data" - ] - } - } - } - } - }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470198", - "x-abandon": "normal", - "x-domain": "Spot", - "x-api-channel": "Private", - "x-api-permission": "General", - "x-api-rate-limit-pool": "Spot", - "x-sdk-service": "Margin", - "x-sdk-sub-service": "Order", - "x-sdk-method-name": "getOpenOrders", - "x-sdk-method-description": "This interface is to obtain all Margin active order lists, and the return value of the active order interface is the paged data of all uncompleted order lists. The returned data is sorted in descending order according to the latest update time of the order. After the user successfully places an order, the order is in Active state, and the user can use inOrderBook to determine whether the order has entered the order. Canceled or fully filled orders are marked as completed Done status.", - "x-api-rate-limit": 4, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": [\\n {\\n \\\"id\\\": \\\"671667306afcdb000723107f\\\",\\n \\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\",\\n \\\"symbol\\\": \\\"BTC-USDT\\\",\\n \\\"opType\\\": \\\"DEAL\\\",\\n \\\"type\\\": \\\"limit\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"price\\\": \\\"50000\\\",\\n \\\"size\\\": \\\"0.00001\\\",\\n \\\"funds\\\": \\\"0.5\\\",\\n \\\"dealSize\\\": \\\"0\\\",\\n \\\"dealFunds\\\": \\\"0\\\",\\n \\\"remainSize\\\": \\\"0.00001\\\",\\n \\\"remainFunds\\\": \\\"0.5\\\",\\n \\\"cancelledSize\\\": \\\"0\\\",\\n \\\"cancelledFunds\\\": \\\"0\\\",\\n \\\"fee\\\": \\\"0\\\",\\n \\\"feeCurrency\\\": \\\"USDT\\\",\\n \\\"stp\\\": null,\\n \\\"stop\\\": null,\\n \\\"stopTriggered\\\": false,\\n \\\"stopPrice\\\": \\\"0\\\",\\n \\\"timeInForce\\\": \\\"GTC\\\",\\n \\\"postOnly\\\": false,\\n \\\"hidden\\\": false,\\n \\\"iceberg\\\": false,\\n \\\"visibleSize\\\": \\\"0\\\",\\n \\\"cancelAfter\\\": 0,\\n \\\"channel\\\": \\\"API\\\",\\n \\\"remark\\\": null,\\n \\\"tags\\\": null,\\n \\\"cancelExist\\\": false,\\n \\\"tradeType\\\": \\\"MARGIN_TRADE\\\",\\n \\\"inOrderBook\\\": true,\\n \\\"active\\\": true,\\n \\\"tax\\\": \\\"0\\\",\\n \\\"createdAt\\\": 1729521456248,\\n \\\"lastUpdatedAt\\\": 1729521460940\\n }\\n ]\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"tradeType\\\": \\\"MARGIN_TRADE\\\"}" - } - }, - "/api/v3/hf/margin/orders/done": { - "get": { - "summary": "Get Closed Orders", - "deprecated": false, - "description": "This interface is to obtain all Margin closed order lists, and the return value of the active order interface is the paged data of all uncompleted order lists. The returned data is sorted in descending order according to the latest update time of the order. After the user successfully places an order, the order is in Active state, and the user can use inOrderBook to determine whether the order has entered the order. Canceled or fully filled orders are marked as completed Done status.", - "tags": [], - "parameters": [ - { - "name": "symbol", - "in": "query", - "description": "symbol", - "required": true, - "schema": { - "type": "string", - "example": [ - "BTC-USDT", - "ETH-USDT", - "KCS-USDT" - ] - } - }, - { - "name": "tradeType", - "in": "query", - "description": "Transaction type: MARGIN_TRADE - cross margin trade, MARGIN_ISOLATED_TRADE - isolated margin trade", - "required": true, - "schema": { - "type": "string", - "enum": [ - "MARGIN_TRADE", - "MARGIN_ISOLATED_TRADE" - ], - "x-api-enum": [ - { - "value": "MARGIN_TRADE", - "name": "", - "description": "" - }, - { - "value": "MARGIN_ISOLATED_TRADE", - "name": "", - "description": "" - } - ] - } - }, - { - "name": "side", - "in": "query", - "description": "specify if the order is to 'buy' or 'sell'", - "required": false, - "schema": { - "type": "string", - "enum": [ - "buy", - "sell" - ], - "x-api-enum": [ - { - "value": "buy", - "name": "", - "description": "" - }, - { - "value": "sell", - "name": "", - "description": "" - } - ] - } - }, - { - "name": "type", - "in": "query", - "description": "specify if the order is an 'limit' order or 'market' order. ", - "required": false, - "schema": { - "type": "string", - "enum": [ - "limit", - "market" - ], - "x-api-enum": [ - { - "value": "limit", - "name": "", - "description": "" - }, - { - "value": "market", - "name": "", - "description": "" - } - ] - } - }, - { - "name": "lastId", - "in": "query", - "description": "The id of the last set of data from the previous batch of data. By default, the latest information is given.\nlastId is used to filter data and paginate. If lastId is not entered, the default is a maximum of 100 returned data items. The return results include lastId,which can be used as a query parameter to look up new data from the next page.", - "required": false, - "schema": { - "type": "integer", - "format": "int64" - } - }, - { - "name": "limit", - "in": "query", - "description": "Default20,Max100", - "required": false, - "schema": { - "type": "integer", - "default": 20, - "minimum": 1, - "maximum": 100 - } - }, - { - "name": "startAt", - "in": "query", - "description": "Start time (milisecond)", - "required": false, - "schema": { - "type": "integer", - "format": "int64" - } - }, - { - "name": "endAt", - "in": "query", - "description": "End time (milisecond)", - "required": false, - "schema": { - "type": "integer", - "format": "int64" - } - } - ], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "data": { - "type": "object", - "properties": { - "lastId": { - "type": "integer", - "description": "The id of the last set of data from the previous batch of data. By default, the latest information is given.\nlastId is used to filter data and paginate. If lastId is not entered, the default is a maximum of 100 returned data items. The return results include lastId,which can be used as a query parameter to look up new data from the next page.", - "format": "int64" + "symbol": { + "type": "string", + "description": "symbol", + "example": [ + "BTC-USDT", + "ETH-USDT", + "KCS-USDT" + ] }, - "items": { - "type": "array", - "items": { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "The unique order id generated by the trading system" - }, - "symbol": { - "type": "string", - "description": "symbol", - "example": [ - "BTC-USDT", - "ETH-USDT", - "KCS-USDT" - ] - }, - "opType": { - "type": "string" - }, - "type": { - "type": "string", - "description": "Specify if the order is an 'limit' order or 'market' order. ", - "enum": [ - "limit", - "market" - ], - "x-api-enum": [ - { - "value": "limit", - "name": "", - "description": "" - }, - { - "value": "market", - "name": "", - "description": "" - } - ] - }, - "side": { - "type": "string", - "description": "Buy or sell" - }, - "price": { - "type": "string", - "description": "Order price" - }, - "size": { - "type": "string", - "description": "Order size" - }, - "funds": { - "type": "string", - "description": "Order Funds" - }, - "dealSize": { - "type": "string", - "description": "Number of filled transactions" - }, - "dealFunds": { - "type": "string", - "description": "Funds of filled transactions" - }, - "fee": { - "type": "string", - "description": "[Handling fees](https://www.kucoin.com/docs-new/api-5327739)" - }, - "feeCurrency": { - "type": "string", - "description": "currency used to calculate trading fee" - }, - "stp": { - "type": "string", - "description": "[Self Trade Prevention](https://www.kucoin.com/docs-new/doc-338146) is divided into these strategies: CN, CO, CB , and DC", - "enum": [ - "DC", - "CO", - "CN", - "CB" - ], - "x-api-enum": [ - { - "value": "DC", - "name": "", - "description": "" - }, - { - "value": "CO", - "name": "", - "description": "" - }, - { - "value": "CN", - "name": "", - "description": "" - }, - { - "value": "CB", - "name": "", - "description": "" - } - ] - }, - "stop": { - "type": "string" - }, - "stopTriggered": { - "type": "boolean" - }, - "stopPrice": { - "type": "string" - }, - "timeInForce": { - "type": "string", - "description": "Time in force", - "enum": [ - "GTC", - "GTT", - "IOC", - "FOK" - ], - "x-api-enum": [ - { - "value": "GTC", - "name": "", - "description": "" - }, - { - "value": "GTT", - "name": "", - "description": "" - }, - { - "value": "IOC", - "name": "", - "description": "" - }, - { - "value": "FOK", - "name": "", - "description": "" - } - ] - }, - "postOnly": { - "type": "boolean", - "description": "Whether its a postOnly order." - }, - "hidden": { - "type": "boolean", - "description": "Whether its a hidden order." - }, - "iceberg": { - "type": "boolean", - "description": "Whether its a iceberg order." - }, - "visibleSize": { - "type": "string", - "description": "Visible size of iceberg order in order book." - }, - "cancelAfter": { - "type": "integer", - "description": "A GTT timeInForce that expires in n seconds" - }, - "channel": { - "type": "string" - }, - "clientOid": { - "type": "string", - "description": "Client Order Id,unique identifier created by the user" - }, - "remark": { - "type": "string", - "description": "Order placement remarks" - }, - "tags": { - "type": "string", - "description": "Order tag" - }, - "cancelExist": { - "type": "boolean", - "description": "Whether there is a cancellation record for the order." - }, - "createdAt": { - "type": "integer", - "format": "int64" - }, - "lastUpdatedAt": { - "type": "integer", - "format": "int64" - }, - "tradeType": { - "type": "string", - "description": "Trade type, redundancy param" - }, - "inOrderBook": { - "type": "boolean", - "description": "Whether to enter the orderbook: true: enter the orderbook; false: not enter the orderbook" - }, - "cancelledSize": { - "type": "string", - "description": "Number of canceled transactions" - }, - "cancelledFunds": { - "type": "string", - "description": "Funds of canceled transactions" - }, - "remainSize": { - "type": "string", - "description": "Number of remain transactions" - }, - "remainFunds": { - "type": "string", - "description": "Funds of remain transactions" - }, - "tax": { - "type": "string", - "description": "Users in some regions need query this field" - }, - "active": { - "type": "boolean", - "description": "Order status: true-The status of the order isactive; false-The status of the order is done" - } + "opType": { + "type": "string" + }, + "type": { + "type": "string", + "description": "Specify if the order is an 'limit' order or 'market' order. ", + "enum": [ + "limit", + "market" + ], + "x-api-enum": [ + { + "value": "limit", + "name": "", + "description": "" }, - "required": [ - "id", - "symbol", - "opType", - "type", - "side", - "price", - "size", - "funds", - "dealSize", - "dealFunds", - "fee", - "feeCurrency", - "stopTriggered", - "stopPrice", - "timeInForce", - "postOnly", - "hidden", - "iceberg", - "visibleSize", - "cancelAfter", - "channel", - "clientOid", - "cancelExist", - "createdAt", - "lastUpdatedAt", - "tradeType", - "inOrderBook", - "cancelledSize", - "cancelledFunds", - "remainSize", - "remainFunds", - "tax", - "active" - ] - } - } - }, - "required": [ - "lastId", - "items" - ] - } - }, - "required": [ - "code", - "data" - ] - } - } - } - } - }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470199", - "x-abandon": "normal", - "x-domain": "Spot", - "x-api-channel": "Private", - "x-api-permission": "General", - "x-api-rate-limit-pool": "Spot", - "x-sdk-service": "Margin", - "x-sdk-sub-service": "Order", - "x-sdk-method-name": "getClosedOrders", - "x-sdk-method-description": "This interface is to obtain all Margin closed order lists, and the return value of the active order interface is the paged data of all uncompleted order lists. The returned data is sorted in descending order according to the latest update time of the order. After the user successfully places an order, the order is in Active state, and the user can use inOrderBook to determine whether the order has entered the order. Canceled or fully filled orders are marked as completed Done status.", - "x-api-rate-limit": 10, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"lastId\\\": 136112949351,\\n \\\"items\\\": [\\n {\\n \\\"id\\\": \\\"6716491f6afcdb00078365c8\\\",\\n \\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\",\\n \\\"symbol\\\": \\\"BTC-USDT\\\",\\n \\\"opType\\\": \\\"DEAL\\\",\\n \\\"type\\\": \\\"limit\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"price\\\": \\\"50000\\\",\\n \\\"size\\\": \\\"0.00001\\\",\\n \\\"funds\\\": \\\"0.5\\\",\\n \\\"dealSize\\\": \\\"0\\\",\\n \\\"dealFunds\\\": \\\"0\\\",\\n \\\"remainSize\\\": \\\"0\\\",\\n \\\"remainFunds\\\": \\\"0\\\",\\n \\\"cancelledSize\\\": \\\"0.00001\\\",\\n \\\"cancelledFunds\\\": \\\"0.5\\\",\\n \\\"fee\\\": \\\"0\\\",\\n \\\"feeCurrency\\\": \\\"USDT\\\",\\n \\\"stp\\\": null,\\n \\\"stop\\\": null,\\n \\\"stopTriggered\\\": false,\\n \\\"stopPrice\\\": \\\"0\\\",\\n \\\"timeInForce\\\": \\\"GTC\\\",\\n \\\"postOnly\\\": false,\\n \\\"hidden\\\": false,\\n \\\"iceberg\\\": false,\\n \\\"visibleSize\\\": \\\"0\\\",\\n \\\"cancelAfter\\\": 0,\\n \\\"channel\\\": \\\"API\\\",\\n \\\"remark\\\": null,\\n \\\"tags\\\": null,\\n \\\"cancelExist\\\": true,\\n \\\"tradeType\\\": \\\"MARGIN_TRADE\\\",\\n \\\"inOrderBook\\\": false,\\n \\\"active\\\": false,\\n \\\"tax\\\": \\\"0\\\",\\n \\\"createdAt\\\": 1729513759162,\\n \\\"lastUpdatedAt\\\": 1729521126597\\n }\\n ]\\n }\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"tradeType\\\": \\\"MARGIN_TRADE\\\", \\\"side\\\": \\\"buy\\\", \\\"type\\\": \\\"limit\\\", \\\"lastId\\\": 254062248624417, \\\"limit\\\": 20, \\\"startAt\\\": 1728663338000, \\\"endAt\\\": 1728692138000}" - } - }, - "/api/v3/hf/margin/fills": { - "get": { - "summary": "Get Trade History", - "deprecated": false, - "description": "This endpoint can be used to obtain a list of the latest Margin transaction details. The returned data is sorted in descending order according to the latest update time of the order.", - "tags": [], - "parameters": [ - { - "name": "symbol", - "in": "query", - "description": "symbol", - "required": true, - "schema": { - "type": "string", - "example": [ - "BTC-USDT", - "ETH-USDT", - "KCS-USDT" - ] - } - }, - { - "name": "tradeType", - "in": "query", - "description": "Trade type: MARGIN_TRADE - cross margin trade, MARGIN_ISOLATED_TRADE - isolated margin trade", - "required": true, - "schema": { - "type": "string", - "enum": [ - "MARGIN_TRADE", - "MARGIN_ISOLATED_TRADE" - ], - "x-api-enum": [ - { - "value": "MARGIN_TRADE", - "name": "", - "description": "" - }, - { - "value": "MARGIN_ISOLATED_TRADE", - "name": "", - "description": "" - } - ] - } - }, - { - "name": "orderId", - "in": "query", - "description": "The unique order id generated by the trading system\n(If orderId is specified,please ignore the other query parameters)", - "required": false, - "schema": { - "type": "string" - } - }, - { - "name": "side", - "in": "query", - "description": "specify if the order is to 'buy' or 'sell'", - "required": false, - "schema": { - "type": "string", - "enum": [ - "buy", - "sell" - ], - "x-api-enum": [ - { - "value": "buy", - "name": "", - "description": "" - }, - { - "value": "sell", - "name": "", - "description": "" - } - ] - } - }, - { - "name": "type", - "in": "query", - "description": "specify if the order is an 'limit' order or 'market' order. ", - "required": false, - "schema": { - "type": "string", - "enum": [ - "limit", - "market" - ], - "x-api-enum": [ - { - "value": "limit", - "name": "", - "description": "" - }, - { - "value": "market", - "name": "", - "description": "" - } - ] - } - }, - { - "name": "lastId", - "in": "query", - "description": "The id of the last set of data from the previous batch of data. By default, the latest information is given.\nlastId is used to filter data and paginate. If lastId is not entered, the default is a maximum of 100 returned data items. The return results include lastId,which can be used as a query parameter to look up new data from the next page.", - "required": false, - "schema": { - "type": "integer", - "format": "int64" - } - }, - { - "name": "limit", - "in": "query", - "description": "Default100,Max200", - "required": false, - "schema": { - "type": "integer", - "default": 20, - "minimum": 1, - "maximum": 200 - } - }, - { - "name": "startAt", - "in": "query", - "description": "Start time (milisecond)", - "required": false, - "schema": { - "type": "integer", - "format": "int64" - } - }, - { - "name": "endAt", - "in": "query", - "description": "End time (milisecond)", - "required": false, - "schema": { - "type": "integer", - "format": "int64" - } - } - ], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "data": { - "type": "object", - "properties": { - "items": { - "type": "array", - "items": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "description": "Id of transaction detail", - "format": "int64" - }, - "symbol": { - "type": "string", - "description": "symbol", - "example": [ - "BTC-USDT", - "ETH-USDT", - "KCS-USDT" - ] - }, - "tradeId": { - "type": "integer", - "description": "Trade Id, symbol latitude increment", - "format": "int64" - }, - "orderId": { - "type": "string", - "description": "The unique order id generated by the trading system" - }, - "counterOrderId": { - "type": "string", - "description": "Counterparty order Id" - }, - "side": { - "type": "string", - "description": "Buy or sell", - "enum": [ - "buy", - "sell" - ], - "x-api-enum": [ - { - "value": "buy", - "name": "", - "description": "" - }, - { - "value": "sell", - "name": "", - "description": "" - } - ] - }, - "liquidity": { - "type": "string", - "description": "Liquidity type: taker or maker", - "enum": [ - "taker", - "maker" - ], - "x-api-enum": [ - { - "value": "taker", - "name": "", - "description": "" - }, - { - "value": "maker", - "name": "", - "description": "" - } - ] - }, - "forceTaker": { - "type": "boolean" - }, - "price": { - "type": "string", - "description": "Order price" - }, - "size": { - "type": "string", - "description": "Order size" - }, - "funds": { - "type": "string", - "description": "Order Funds" - }, - "fee": { - "type": "string", - "description": "[Handling fees](https://www.kucoin.com/docs-new/api-5327739)" - }, - "feeRate": { - "type": "string", - "description": "Fee rate\n" - }, - "feeCurrency": { - "type": "string", - "description": "currency used to calculate trading fee" - }, - "stop": { - "type": "string", - "description": "Take Profit and Stop Loss type, currently HFT does not support the Take Profit and Stop Loss type, so it is empty" - }, - "tradeType": { - "type": "string", - "description": "Trade type, redundancy param" - }, - "tax": { - "type": "string", - "description": "Users in some regions need query this field" - }, - "taxRate": { - "type": "string", - "description": "Tax Rate, Users in some regions need query this field" - }, - "type": { - "type": "string", - "description": "Specify if the order is an 'limit' order or 'market' order. ", - "enum": [ - "limit", - "market" - ], - "x-api-enum": [ - { - "value": "limit", - "name": "", - "description": "" - }, - { - "value": "market", - "name": "", - "description": "" - } - ] - }, - "createdAt": { - "type": "integer", - "format": "int64" - } + { + "value": "market", + "name": "", + "description": "" + } + ] + }, + "side": { + "type": "string", + "description": "Buy or sell", + "enum": [ + "buy", + "sell" + ], + "x-api-enum": [ + { + "value": "buy", + "name": "", + "description": "" + }, + { + "value": "sell", + "name": "", + "description": "" + } + ] + }, + "price": { + "type": "string", + "description": "Order price" + }, + "size": { + "type": "string", + "description": "Order size" + }, + "funds": { + "type": "string", + "description": "Order Funds" + }, + "dealSize": { + "type": "string", + "description": "Number of filled transactions" + }, + "dealFunds": { + "type": "string", + "description": "Funds of filled transactions" + }, + "fee": { + "type": "string", + "description": "[Handling fees](https://www.kucoin.com/docs-new/api-5327739)" + }, + "feeCurrency": { + "type": "string", + "description": "currency used to calculate trading fee" + }, + "stp": { + "type": "string", + "description": "[Self Trade Prevention](https://www.kucoin.com/docs-new/doc-338146) is divided into these strategies: CN, CO, CB , and DC", + "enum": [ + "DC", + "CO", + "CN", + "CB" + ], + "x-api-enum": [ + { + "value": "DC", + "name": "", + "description": "" + }, + { + "value": "CO", + "name": "", + "description": "" + }, + { + "value": "CN", + "name": "", + "description": "" + }, + { + "value": "CB", + "name": "", + "description": "" + } + ] + }, + "stop": { + "type": "string" + }, + "stopTriggered": { + "type": "boolean" + }, + "stopPrice": { + "type": "string" + }, + "timeInForce": { + "type": "string", + "description": "Time in force", + "enum": [ + "GTC", + "GTT", + "IOC", + "FOK" + ], + "x-api-enum": [ + { + "value": "GTC", + "name": "", + "description": "" + }, + { + "value": "GTT", + "name": "", + "description": "" + }, + { + "value": "IOC", + "name": "", + "description": "" }, - "required": [ - "id", - "symbol", - "tradeId", - "orderId", - "counterOrderId", - "side", - "liquidity", - "forceTaker", - "price", - "size", - "funds", - "fee", - "feeRate", - "feeCurrency", - "stop", - "tradeType", - "tax", - "taxRate", - "type", - "createdAt" - ] - } + { + "value": "FOK", + "name": "", + "description": "" + } + ] }, - "lastId": { + "postOnly": { + "type": "boolean", + "description": "Whether its a postOnly order." + }, + "hidden": { + "type": "boolean", + "description": "Whether its a hidden order." + }, + "iceberg": { + "type": "boolean", + "description": "Whether its a iceberg order." + }, + "visibleSize": { + "type": "string", + "description": "Visible size of iceberg order in order book." + }, + "cancelAfter": { + "type": "integer", + "description": "A GTT timeInForce that expires in n seconds" + }, + "channel": { + "type": "string" + }, + "clientOid": { + "type": "string", + "description": "Client Order Id,unique identifier created by the user" + }, + "remark": { + "type": "string", + "description": "Order placement remarks" + }, + "tags": { + "type": "string", + "description": "Order tag" + }, + "cancelExist": { + "type": "boolean", + "description": "Whether there is a cancellation record for the order." + }, + "createdAt": { + "type": "integer", + "format": "int64" + }, + "lastUpdatedAt": { "type": "integer", - "description": "The id of the last set of data from the previous batch of data. By default, the latest information is given.\nlastId is used to filter data and paginate. If lastId is not entered, the default is a maximum of 100 returned data items. The return results include lastId,which can be used as a query parameter to look up new data from the next page.", "format": "int64" + }, + "tradeType": { + "type": "string", + "description": "Trade type, redundancy param" + }, + "inOrderBook": { + "type": "boolean", + "description": "Whether to enter the orderbook: true: enter the orderbook; false: not enter the orderbook" + }, + "cancelledSize": { + "type": "string", + "description": "Number of canceled transactions" + }, + "cancelledFunds": { + "type": "string", + "description": "Funds of canceled transactions" + }, + "remainSize": { + "type": "string", + "description": "Number of remain transactions" + }, + "remainFunds": { + "type": "string", + "description": "Funds of remain transactions" + }, + "tax": { + "type": "string", + "description": "Users in some regions need query this field" + }, + "active": { + "type": "boolean", + "description": "Order status: true-The status of the order isactive; false-The status of the order is done" } }, "required": [ - "items", - "lastId" + "id", + "symbol", + "opType", + "type", + "side", + "price", + "size", + "funds", + "dealSize", + "dealFunds", + "fee", + "feeCurrency", + "stopTriggered", + "stopPrice", + "timeInForce", + "postOnly", + "hidden", + "iceberg", + "visibleSize", + "cancelAfter", + "channel", + "clientOid", + "remark", + "cancelExist", + "createdAt", + "lastUpdatedAt", + "tradeType", + "inOrderBook", + "cancelledSize", + "cancelledFunds", + "remainSize", + "remainFunds", + "tax", + "active" ] } }, @@ -2347,7 +1522,7 @@ } } }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470200", + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470202", "x-abandon": "normal", "x-domain": "Spot", "x-api-channel": "Private", @@ -2355,11 +1530,11 @@ "x-api-rate-limit-pool": "Spot", "x-sdk-service": "Margin", "x-sdk-sub-service": "Order", - "x-sdk-method-name": "getTradeHistory", - "x-sdk-method-description": "This endpoint can be used to obtain a list of the latest Margin transaction details. The returned data is sorted in descending order according to the latest update time of the order.", + "x-sdk-method-name": "getOrderByOrderId", + "x-sdk-method-description": "This endpoint can be used to obtain information for a single Margin order using the order id. After the user successfully places an order, the order is in Active state, and the user can use inOrderBook to determine whether the order has entered the order. Canceled or fully filled orders are marked as completed Done status.", "x-api-rate-limit": 5, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"items\\\": [\\n {\\n \\\"id\\\": 137891621991,\\n \\\"symbol\\\": \\\"BTC-USDT\\\",\\n \\\"tradeId\\\": 11040911994273793,\\n \\\"orderId\\\": \\\"671868085584bc0007d85f46\\\",\\n \\\"counterOrderId\\\": \\\"67186805b7cbdf00071621f9\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"liquidity\\\": \\\"taker\\\",\\n \\\"forceTaker\\\": false,\\n \\\"price\\\": \\\"67141.6\\\",\\n \\\"size\\\": \\\"0.00001\\\",\\n \\\"funds\\\": \\\"0.671416\\\",\\n \\\"fee\\\": \\\"0.000671416\\\",\\n \\\"feeRate\\\": \\\"0.001\\\",\\n \\\"feeCurrency\\\": \\\"USDT\\\",\\n \\\"stop\\\": \\\"\\\",\\n \\\"tradeType\\\": \\\"MARGIN_TRADE\\\",\\n \\\"tax\\\": \\\"0\\\",\\n \\\"taxRate\\\": \\\"0\\\",\\n \\\"type\\\": \\\"limit\\\",\\n \\\"createdAt\\\": 1729652744998\\n }\\n ],\\n \\\"lastId\\\": 137891621991\\n }\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"tradeType\\\": \\\"MARGIN_TRADE\\\", \\\"orderId\\\": \\\"example_string_default_value\\\", \\\"side\\\": \\\"buy\\\", \\\"type\\\": \\\"limit\\\", \\\"lastId\\\": 254062248624417, \\\"limit\\\": 100, \\\"startAt\\\": 1728663338000, \\\"endAt\\\": 1728692138000}" + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"id\\\": \\\"671667306afcdb000723107f\\\",\\n \\\"symbol\\\": \\\"BTC-USDT\\\",\\n \\\"opType\\\": \\\"DEAL\\\",\\n \\\"type\\\": \\\"limit\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"price\\\": \\\"50000\\\",\\n \\\"size\\\": \\\"0.00001\\\",\\n \\\"funds\\\": \\\"0.5\\\",\\n \\\"dealSize\\\": \\\"0\\\",\\n \\\"dealFunds\\\": \\\"0\\\",\\n \\\"fee\\\": \\\"0\\\",\\n \\\"feeCurrency\\\": \\\"USDT\\\",\\n \\\"stp\\\": null,\\n \\\"stop\\\": null,\\n \\\"stopTriggered\\\": false,\\n \\\"stopPrice\\\": \\\"0\\\",\\n \\\"timeInForce\\\": \\\"GTC\\\",\\n \\\"postOnly\\\": false,\\n \\\"hidden\\\": false,\\n \\\"iceberg\\\": false,\\n \\\"visibleSize\\\": \\\"0\\\",\\n \\\"cancelAfter\\\": 0,\\n \\\"channel\\\": \\\"API\\\",\\n \\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\",\\n \\\"remark\\\": null,\\n \\\"tags\\\": null,\\n \\\"cancelExist\\\": false,\\n \\\"createdAt\\\": 1729521456248,\\n \\\"lastUpdatedAt\\\": 1729651011877,\\n \\\"tradeType\\\": \\\"MARGIN_TRADE\\\",\\n \\\"inOrderBook\\\": true,\\n \\\"cancelledSize\\\": \\\"0\\\",\\n \\\"cancelledFunds\\\": \\\"0\\\",\\n \\\"remainSize\\\": \\\"0.00001\\\",\\n \\\"remainFunds\\\": \\\"0.5\\\",\\n \\\"tax\\\": \\\"0\\\",\\n \\\"active\\\": true\\n }\\n}", + "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"orderId\\\": \\\"671667306afcdb000723107f\\\"}" } }, "/api/v3/hf/margin/orders/client-order/{clientOid}": { @@ -2717,114 +1892,44 @@ "description": "Users in some regions need query this field" }, "active": { - "type": "boolean", - "description": "Order status: true-The status of the order isactive; false-The status of the order is done" - } - }, - "required": [ - "id", - "symbol", - "opType", - "type", - "side", - "price", - "size", - "funds", - "dealSize", - "dealFunds", - "fee", - "feeCurrency", - "stopTriggered", - "stopPrice", - "timeInForce", - "postOnly", - "hidden", - "iceberg", - "visibleSize", - "cancelAfter", - "channel", - "clientOid", - "cancelExist", - "createdAt", - "lastUpdatedAt", - "tradeType", - "inOrderBook", - "cancelledSize", - "cancelledFunds", - "remainSize", - "remainFunds", - "tax", - "active" - ] - } - }, - "required": [ - "code", - "data" - ] - } - } - } - } - }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470203", - "x-abandon": "normal", - "x-domain": "Spot", - "x-api-channel": "Private", - "x-api-permission": "General", - "x-api-rate-limit-pool": "Spot", - "x-sdk-service": "Margin", - "x-sdk-sub-service": "Order", - "x-sdk-method-name": "getOrderByClientOid", - "x-sdk-method-description": "This endpoint can be used to obtain information for a single Margin order using the client order id. After the user successfully places an order, the order is in Active state, and the user can use inOrderBook to determine whether the order has entered the order. Canceled or fully filled orders are marked as completed Done status.", - "x-api-rate-limit": 5, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"id\\\": \\\"671667306afcdb000723107f\\\",\\n \\\"symbol\\\": \\\"BTC-USDT\\\",\\n \\\"opType\\\": \\\"DEAL\\\",\\n \\\"type\\\": \\\"limit\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"price\\\": \\\"50000\\\",\\n \\\"size\\\": \\\"0.00001\\\",\\n \\\"funds\\\": \\\"0.5\\\",\\n \\\"dealSize\\\": \\\"0\\\",\\n \\\"dealFunds\\\": \\\"0\\\",\\n \\\"fee\\\": \\\"0\\\",\\n \\\"feeCurrency\\\": \\\"USDT\\\",\\n \\\"stp\\\": null,\\n \\\"stop\\\": null,\\n \\\"stopTriggered\\\": false,\\n \\\"stopPrice\\\": \\\"0\\\",\\n \\\"timeInForce\\\": \\\"GTC\\\",\\n \\\"postOnly\\\": false,\\n \\\"hidden\\\": false,\\n \\\"iceberg\\\": false,\\n \\\"visibleSize\\\": \\\"0\\\",\\n \\\"cancelAfter\\\": 0,\\n \\\"channel\\\": \\\"API\\\",\\n \\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\",\\n \\\"remark\\\": null,\\n \\\"tags\\\": null,\\n \\\"cancelExist\\\": false,\\n \\\"createdAt\\\": 1729521456248,\\n \\\"lastUpdatedAt\\\": 1729651011877,\\n \\\"tradeType\\\": \\\"MARGIN_TRADE\\\",\\n \\\"inOrderBook\\\": true,\\n \\\"cancelledSize\\\": \\\"0\\\",\\n \\\"cancelledFunds\\\": \\\"0\\\",\\n \\\"remainSize\\\": \\\"0.00001\\\",\\n \\\"remainFunds\\\": \\\"0.5\\\",\\n \\\"tax\\\": \\\"0\\\",\\n \\\"active\\\": true\\n }\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\"}" - } - }, - "/api/v3/hf/margin/order": { - "post": { - "summary": "Add Order", - "deprecated": false, - "description": "Place order to the Cross-margin or Isolated-margin trading system, you can place two major types of orders: limit and market. Orders can only be placed if your account has sufficient funds. Once an order is placed, your funds will be put on hold for the duration of the order. The amount of funds on hold depends on the order type and parameters specified.", - "tags": [], - "parameters": [], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "data": { - "type": "object", - "properties": { - "orderId": { - "type": "string", - "description": "The unique order id generated by the trading system,which can be used later for further actions such as canceling the order." - }, - "loanApplyId": { - "type": "string", - "description": "Borrow order id. The field is returned only after placing the order under the mode of Auto-Borrow." - }, - "borrowSize": { - "type": "string", - "description": "Borrowed amount. The field is returned only after placing the order under the mode of Auto-Borrow." - }, - "clientOid": { - "type": "string", - "description": "The user self-defined order id." + "type": "boolean", + "description": "Order status: true-The status of the order isactive; false-The status of the order is done" } }, "required": [ - "orderId", - "borrowSize", + "id", + "symbol", + "opType", + "type", + "side", + "price", + "size", + "funds", + "dealSize", + "dealFunds", + "fee", + "feeCurrency", + "stopTriggered", + "stopPrice", + "timeInForce", + "postOnly", + "hidden", + "iceberg", + "visibleSize", + "cancelAfter", + "channel", "clientOid", - "loanApplyId" + "cancelExist", + "createdAt", + "lastUpdatedAt", + "tradeType", + "inOrderBook", + "cancelledSize", + "cancelledFunds", + "remainSize", + "remainFunds", + "tax", + "active" ] } }, @@ -2837,221 +1942,68 @@ } } }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470204", + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470203", "x-abandon": "normal", "x-domain": "Spot", "x-api-channel": "Private", - "x-api-permission": "Margin", + "x-api-permission": "General", "x-api-rate-limit-pool": "Spot", "x-sdk-service": "Margin", "x-sdk-sub-service": "Order", - "x-sdk-method-name": "addOrder", - "x-sdk-method-description": "Place order to the Cross-margin or Isolated-margin trading system, you can place two major types of orders: limit and market. Orders can only be placed if your account has sufficient funds. Once an order is placed, your funds will be put on hold for the duration of the order. The amount of funds on hold depends on the order type and parameters specified.", + "x-sdk-method-name": "getOrderByClientOid", + "x-sdk-method-description": "This endpoint can be used to obtain information for a single Margin order using the client order id. After the user successfully places an order, the order is in Active state, and the user can use inOrderBook to determine whether the order has entered the order. Canceled or fully filled orders are marked as completed Done status.", "x-api-rate-limit": 5, - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "clientOid": { - "type": "string", - "description": "Client Order Id,The ClientOid field is a unique ID created by the user(we recommend using a UUID), and can only contain numbers, letters, underscores (_), and hyphens (-). This field is returned when order information is obtained. You can use clientOid to tag your orders. ClientOid is different from the order ID created by the service provider. Please do not initiate requests using the same clientOid. The maximum length for the ClientOid is 40 characters.\n\nPlease remember the orderId created by the service provider, it used to check for updates in order status.", - "example": [ - "5c52e11203aa677f33e493fb" - ] - }, - "side": { - "type": "string", - "description": "specify if the order is to 'buy' or 'sell'", - "enum": [ - "buy", - "sell" - ], - "x-api-enum": [ - { - "value": "buy", - "name": "", - "description": "" - }, - { - "value": "sell", - "name": "", - "description": "" - } - ], - "example": [ - "buy" - ] - }, - "symbol": { - "type": "string", - "description": "symbol", - "example": [ - "BTC-USDT", - "ETH-USDT", - "KCS-USDT" - ] - }, - "type": { - "type": "string", - "description": "specify if the order is an 'limit' order or 'market' order. \n\nThe type of order you specify when you place your order determines whether or not you need to request other parameters and also affects the execution of the matching engine.\n\nWhen placing a limit order, you must specify a price and size. The system will try to match the order according to market price or a price better than market price. If the order cannot be immediately matched, it will stay in the order book until it is matched or the user cancels.\n\nUnlike limit orders, the price for market orders fluctuates with market prices. When placing a market order, you do not need to specify a price, you only need to specify a quantity. Market orders are filled immediately and will not enter the order book. All market orders are takers and a taker fee will be charged.", - "enum": [ - "limit", - "market" - ], - "default": "limit", - "x-api-enum": [ - { - "value": "limit", - "name": "", - "description": "" - }, - { - "value": "market", - "name": "", - "description": "" - } - ] - }, - "stp": { - "type": "string", - "description": "[Self Trade Prevention](https://www.kucoin.com/docs-new/doc-338146) is divided into these strategies: CN, CO, CB , and DC", - "enum": [ - "DC", - "CO", - "CN", - "CB" - ], - "x-api-enum": [ - { - "value": "DC", - "name": "", - "description": "" - }, - { - "value": "CO", - "name": "", - "description": "" - }, - { - "value": "CN", - "name": "", - "description": "" - }, - { - "value": "CB", - "name": "", - "description": "" - } - ] - }, - "price": { - "type": "string", - "description": "Specify price for order\n\nWhen placing a limit order, the price must be based on priceIncrement for the trading pair. The price increment (priceIncrement) is the price precision for the trading pair. For example, for the BTC-USDT trading pair, the priceIncrement is 0.00001000. So the price for your orders cannot be less than 0.00001000 and must be a multiple of priceIncrement. Otherwise, the order will return an invalid priceIncrement error." - }, - "size": { - "type": "string", - "description": "Specify quantity for order\n\nWhen **type** is limit, size refers to the amount of trading targets (the asset name written in front) for the trading pair. Teh Size must be based on the baseIncrement of the trading pair. The baseIncrement represents the precision for the trading pair. The size of an order must be a positive-integer multiple of baseIncrement and must be between baseMinSize and baseMaxSize.\n\nWhen **type** is market, select one out of two: size or funds" - }, - "timeInForce": { - "type": "string", - "description": "[Time in force](https://www.kucoin.com/docs-new/api-5176570) is a special strategy used during trading", - "enum": [ - "GTC", - "GTT", - "IOC", - "FOK" - ], - "default": "GTC", - "x-api-enum": [ - { - "value": "GTC", - "name": "", - "description": "" - }, - { - "value": "GTT", - "name": "", - "description": "" - }, - { - "value": "IOC", - "name": "", - "description": "" - }, - { - "value": "FOK", - "name": "", - "description": "" - } - ] - }, - "postOnly": { - "type": "boolean", - "default": false, - "description": "passive order labels, this is disabled when the order timing strategy is IOC or FOK" - }, - "hidden": { - "type": "boolean", - "description": "[Hidden order](https://www.kucoin.com/docs-new/doc-338146) or not (not shown in order book)", - "default": false - }, - "iceberg": { - "type": "boolean", - "description": "Whether or not only visible portions of orders are shown in [Iceberg orders](https://www.kucoin.com/docs-new/doc-338146)", - "default": false - }, - "visibleSize": { - "type": "string", - "description": "Maximum visible quantity in iceberg orders" - }, - "cancelAfter": { - "type": "integer", - "format": "int64", - "description": "Cancel after n seconds,the order timing strategy is GTT" - }, - "funds": { - "type": "string", - "description": "When **type** is market, select one out of two: size or funds" - }, - "isIsolated": { - "type": "boolean", - "description": "true - isolated margin ,false - cross margin. defult as false", - "default": false - }, - "autoBorrow": { - "type": "boolean", - "description": "When Margin Account has inefficient balance, our system autoborrows inefficient assets and opens positions according to the lowest market interest rate.", - "default": false - }, - "autoRepay": { - "type": "boolean", - "description": "AutoPay allows returning borrowed assets when you close a position. Our system automatically triggers the repayment and the maximum repayment amount equals to the filled-order amount.", - "default": false - } + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"id\\\": \\\"671667306afcdb000723107f\\\",\\n \\\"symbol\\\": \\\"BTC-USDT\\\",\\n \\\"opType\\\": \\\"DEAL\\\",\\n \\\"type\\\": \\\"limit\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"price\\\": \\\"50000\\\",\\n \\\"size\\\": \\\"0.00001\\\",\\n \\\"funds\\\": \\\"0.5\\\",\\n \\\"dealSize\\\": \\\"0\\\",\\n \\\"dealFunds\\\": \\\"0\\\",\\n \\\"fee\\\": \\\"0\\\",\\n \\\"feeCurrency\\\": \\\"USDT\\\",\\n \\\"stp\\\": null,\\n \\\"stop\\\": null,\\n \\\"stopTriggered\\\": false,\\n \\\"stopPrice\\\": \\\"0\\\",\\n \\\"timeInForce\\\": \\\"GTC\\\",\\n \\\"postOnly\\\": false,\\n \\\"hidden\\\": false,\\n \\\"iceberg\\\": false,\\n \\\"visibleSize\\\": \\\"0\\\",\\n \\\"cancelAfter\\\": 0,\\n \\\"channel\\\": \\\"API\\\",\\n \\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\",\\n \\\"remark\\\": null,\\n \\\"tags\\\": null,\\n \\\"cancelExist\\\": false,\\n \\\"createdAt\\\": 1729521456248,\\n \\\"lastUpdatedAt\\\": 1729651011877,\\n \\\"tradeType\\\": \\\"MARGIN_TRADE\\\",\\n \\\"inOrderBook\\\": true,\\n \\\"cancelledSize\\\": \\\"0\\\",\\n \\\"cancelledFunds\\\": \\\"0\\\",\\n \\\"remainSize\\\": \\\"0.00001\\\",\\n \\\"remainFunds\\\": \\\"0.5\\\",\\n \\\"tax\\\": \\\"0\\\",\\n \\\"active\\\": true\\n }\\n}", + "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\"}" + } + }, + "/api/v3/hf/margin/orders": { + "delete": { + "summary": "Cancel All Orders By Symbol", + "deprecated": false, + "description": "This interface can cancel all open Margin orders by symbol This endpoint only sends cancellation requests. The results of the requests must be obtained by checking the order status or subscribing to websocket.", + "tags": [], + "parameters": [ + { + "name": "symbol", + "in": "query", + "description": "symbol", + "required": true, + "schema": { + "type": "string", + "example": [ + "BTC-USDT", + "ETH-USDT", + "KCS-USDT" + ] + } + }, + { + "name": "tradeType", + "in": "query", + "description": "Transaction type: MARGIN_TRADE - cross margin trade, MARGIN_ISOLATED_TRADE - isolated margin trade", + "required": true, + "schema": { + "type": "string", + "enum": [ + "MARGIN_TRADE", + "MARGIN_ISOLATED_TRADE" + ], + "x-api-enum": [ + { + "value": "MARGIN_TRADE", + "name": "", + "description": "" }, - "required": [ - "symbol", - "side", - "clientOid" - ] - }, - "example": "//limit order\n{\n \"type\": \"limit\",\n \"symbol\": \"BTC-USDT\",\n \"side\": \"buy\",\n \"price\": \"50000\",\n \"size\": \"0.00001\",\n \"clientOid\": \"5c52e11203aa677f33e493fb\",\n \"remark\": \"order remarks\"\n}\n\n//market order 1\n// {\n// \"type\": \"market\",\n// \"symbol\": \"BTC-USDT\",\n// \"side\": \"buy\",\n// \"size\": \"0.00001\",\n// \"clientOid\": \"5c52e11203aa677f33e493fc\",\n// \"remark\": \"order remarks\"\n// }\n\n//market order 2\n// {\n// \"type\": \"market\",\n// \"symbol\": \"BTC-USDT\",\n// \"side\": \"buy\",\n// \"funds\": \"1\",\n// \"clientOid\": \"5c52e11203aa677f33e493fc\",\n// \"remark\": \"order remarks\"\n// }\n" + { + "value": "MARGIN_ISOLATED_TRADE", + "name": "", + "description": "" + } + ] } } - }, - "x-response-example": "{\\n \\\"success\\\": true,\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"orderId\\\": \\\"671663e02188630007e21c9c\\\",\\n \\\"clientOid\\\": \\\"5c52e11203aa677f33e1493fb\\\",\\n \\\"borrowSize\\\": \\\"10.2\\\",\\n \\\"loanApplyId\\\": \\\"600656d9a33ac90009de4f6f\\\"\\n }\\n}", - "x-request-example": "{\\\"type\\\": \\\"limit\\\", \\\"symbol\\\": \\\"BTC-USDT\\\", \\\"side\\\": \\\"buy\\\", \\\"price\\\": \\\"50000\\\", \\\"size\\\": \\\"0.00001\\\", \\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\", \\\"remark\\\": \\\"order remarks\\\"}" - } - }, - "/api/v3/hf/margin/order/test": { - "post": { - "summary": "Add Order Test", - "deprecated": false, - "description": " Order test endpoint, the request parameters and return parameters of this endpoint are exactly the same as the order endpoint, and can be used to verify whether the signature is correct and other operations. After placing an order, the order will not enter the matching system, and the order cannot be queried.", - "tags": [], - "parameters": [], + ], "responses": { "200": { "description": "", @@ -3064,31 +2016,7 @@ "type": "string" }, "data": { - "type": "object", - "properties": { - "orderId": { - "type": "string", - "description": "The unique order id generated by the trading system,which can be used later for further actions such as canceling the order." - }, - "loanApplyId": { - "type": "string", - "description": "Borrowed amount. The field is returned only after placing the order under the mode of Auto-Borrow." - }, - "borrowSize": { - "type": "number", - "description": "ID of the borrowing response. The field is returned only after placing the order under the mode of Auto-Borrow." - }, - "clientOid": { - "type": "string", - "description": "The user self-defined order id." - } - }, - "required": [ - "orderId", - "borrowSize", - "clientOid", - "loanApplyId" - ] + "type": "string" } }, "required": [ @@ -3100,7 +2028,7 @@ } } }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470205", + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470197", "x-abandon": "normal", "x-domain": "Spot", "x-api-channel": "Private", @@ -3108,213 +2036,149 @@ "x-api-rate-limit-pool": "Spot", "x-sdk-service": "Margin", "x-sdk-sub-service": "Order", - "x-sdk-method-name": "addOrderTest", - "x-sdk-method-description": " Order test endpoint, the request parameters and return parameters of this endpoint are exactly the same as the order endpoint, and can be used to verify whether the signature is correct and other operations. After placing an order, the order will not enter the matching system, and the order cannot be queried.", - "x-api-rate-limit": 5, - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "clientOid": { - "type": "string", - "description": "Client Order Id,The ClientOid field is a unique ID created by the user(we recommend using a UUID), and can only contain numbers, letters, underscores (_), and hyphens (-). This field is returned when order information is obtained. You can use clientOid to tag your orders. ClientOid is different from the order ID created by the service provider. Please do not initiate requests using the same clientOid. The maximum length for the ClientOid is 40 characters.\n\nPlease remember the orderId created by the service provider, it used to check for updates in order status.", - "example": [ - "5c52e11203aa677f33e493fb" - ] - }, - "side": { - "type": "string", - "description": "specify if the order is to 'buy' or 'sell'", - "enum": [ - "buy", - "sell" - ], - "x-api-enum": [ - { - "value": "buy", - "name": "", - "description": "" - }, - { - "value": "sell", - "name": "", - "description": "" - } - ], - "example": [ - "buy" - ] - }, - "symbol": { - "type": "string", - "description": "symbol", - "example": [ - "BTC-USDT", - "ETH-USDT", - "KCS-USDT" - ] - }, - "type": { - "type": "string", - "description": "specify if the order is an 'limit' order or 'market' order. \n\nThe type of order you specify when you place your order determines whether or not you need to request other parameters and also affects the execution of the matching engine.\n\nWhen placing a limit order, you must specify a price and size. The system will try to match the order according to market price or a price better than market price. If the order cannot be immediately matched, it will stay in the order book until it is matched or the user cancels.\n\nUnlike limit orders, the price for market orders fluctuates with market prices. When placing a market order, you do not need to specify a price, you only need to specify a quantity. Market orders are filled immediately and will not enter the order book. All market orders are takers and a taker fee will be charged.", - "enum": [ - "limit", - "market" - ], - "default": "limit", - "x-api-enum": [ - { - "value": "limit", - "name": "", - "description": "" - }, - { - "value": "market", - "name": "", - "description": "" - } - ] - }, - "stp": { - "type": "string", - "description": "[Self Trade Prevention](https://www.kucoin.com/docs-new/doc-338146) is divided into these strategies: CN, CO, CB , and DC", - "enum": [ - "DC", - "CO", - "CN", - "CB" - ], - "x-api-enum": [ - { - "value": "DC", - "name": "", - "description": "" - }, - { - "value": "CO", - "name": "", - "description": "" - }, - { - "value": "CN", - "name": "", - "description": "" - }, - { - "value": "CB", - "name": "", - "description": "" - } - ] - }, - "price": { - "type": "string", - "description": "Specify price for order\n\nWhen placing a limit order, the price must be based on priceIncrement for the trading pair. The price increment (priceIncrement) is the price precision for the trading pair. For example, for the BTC-USDT trading pair, the priceIncrement is 0.00001000. So the price for your orders cannot be less than 0.00001000 and must be a multiple of priceIncrement. Otherwise, the order will return an invalid priceIncrement error." - }, - "size": { - "type": "string", - "description": "Specify quantity for order\n\nWhen **type** is limit, size refers to the amount of trading targets (the asset name written in front) for the trading pair. Teh Size must be based on the baseIncrement of the trading pair. The baseIncrement represents the precision for the trading pair. The size of an order must be a positive-integer multiple of baseIncrement and must be between baseMinSize and baseMaxSize.\n\nWhen **type** is market, select one out of two: size or funds" - }, - "timeInForce": { - "type": "string", - "description": "[Time in force](https://www.kucoin.com/docs-new/api-5176570) is a special strategy used during trading", - "enum": [ - "GTC", - "GTT", - "IOC", - "FOK" - ], - "default": "GTC", - "x-api-enum": [ - { - "value": "GTC", - "name": "", - "description": "" - }, - { - "value": "GTT", - "name": "", - "description": "" - }, - { - "value": "IOC", - "name": "", - "description": "" + "x-sdk-method-name": "cancelAllOrdersBySymbol", + "x-sdk-method-description": "This interface can cancel all open Margin orders by symbol This endpoint only sends cancellation requests. The results of the requests must be obtained by checking the order status or subscribing to websocket.", + "x-api-rate-limit": 10, + "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":\\\"success\\\"}", + "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"tradeType\\\": \\\"MARGIN_TRADE\\\"}" + } + }, + "/api/v3/hf/margin/order/active/symbols": { + "get": { + "summary": "Get Symbols With Open Order", + "deprecated": false, + "description": "This interface can query all Margin symbol that has active orders", + "tags": [], + "parameters": [ + { + "name": "tradeType", + "in": "query", + "description": "Cross Margin: MARGIN_TRADE, Isolated Margin: MARGIN_ISOLATED_TRADE\n", + "required": true, + "schema": { + "type": "string", + "enum": [ + "MARGIN_TRADE", + "MARGIN_ISOLATED_TRADE" + ], + "x-api-enum": [ + { + "value": "MARGIN_TRADE", + "name": "", + "description": "" + }, + { + "value": "MARGIN_ISOLATED_TRADE", + "name": "", + "description": "" + } + ] + } + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "object", + "properties": { + "symbolSize": { + "type": "integer", + "description": "Symbol Size" + }, + "symbols": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The symbol that has active orders" + } }, - { - "value": "FOK", - "name": "", - "description": "" - } - ] - }, - "postOnly": { - "type": "boolean", - "default": false, - "description": "passive order labels, this is disabled when the order timing strategy is IOC or FOK" - }, - "hidden": { - "type": "boolean", - "description": "[Hidden order](https://www.kucoin.com/docs-new/doc-338146) or not (not shown in order book)", - "default": false - }, - "iceberg": { - "type": "boolean", - "description": "Whether or not only visible portions of orders are shown in [Iceberg orders](https://www.kucoin.com/docs-new/doc-338146)", - "default": false - }, - "visibleSize": { - "type": "string", - "description": "Maximum visible quantity in iceberg orders" - }, - "cancelAfter": { - "type": "integer", - "format": "int64", - "description": "Cancel after n seconds,the order timing strategy is GTT" - }, - "funds": { - "type": "string", - "description": "When **type** is market, select one out of two: size or funds" - }, - "isIsolated": { - "type": "boolean", - "description": "true - isolated margin ,false - cross margin. defult as false", - "default": false - }, - "autoBorrow": { - "type": "boolean", - "description": "When Margin Account has inefficient balance, our system autoborrows inefficient assets and opens positions according to the lowest market interest rate.", - "default": false + "required": [ + "symbolSize", + "symbols" + ] + } }, - "autoRepay": { - "type": "boolean", - "description": "AutoPay allows returning borrowed assets when you close a position. Our system automatically triggers the repayment and the maximum repayment amount equals to the filled-order amount.", - "default": false - } - }, - "required": [ - "symbol", - "side", - "clientOid" - ] - }, - "example": "//limit order\n{\n \"type\": \"limit\",\n \"symbol\": \"BTC-USDT\",\n \"side\": \"buy\",\n \"price\": \"50000\",\n \"size\": \"0.00001\",\n \"clientOid\": \"5c52e11203aa677f33e493fb\",\n \"remark\": \"order remarks\"\n}\n\n//market order 1\n// {\n// \"type\": \"market\",\n// \"symbol\": \"BTC-USDT\",\n// \"side\": \"buy\",\n// \"size\": \"0.00001\",\n// \"clientOid\": \"5c52e11203aa677f33e493fc\",\n// \"remark\": \"order remarks\"\n// }\n\n//market order 2\n// {\n// \"type\": \"market\",\n// \"symbol\": \"BTC-USDT\",\n// \"side\": \"buy\",\n// \"funds\": \"1\",\n// \"clientOid\": \"5c52e11203aa677f33e493fc\",\n// \"remark\": \"order remarks\"\n// }\n" + "required": [ + "code", + "data" + ] + } + } } } }, - "x-response-example": "{\\n \\\"success\\\": true,\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"orderId\\\": \\\"5bd6e9286d99522a52e458de\\\",\\n \\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\",\\n \\\"borrowSize\\\": 10.2,\\n \\\"loanApplyId\\\": \\\"600656d9a33ac90009de4f6f\\\"\\n }\\n}", - "x-request-example": "{\\\"type\\\": \\\"limit\\\", \\\"symbol\\\": \\\"BTC-USDT\\\", \\\"side\\\": \\\"buy\\\", \\\"price\\\": \\\"50000\\\", \\\"size\\\": \\\"0.00001\\\", \\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\", \\\"remark\\\": \\\"order remarks\\\"}" + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470196", + "x-abandon": "normal", + "x-domain": "Spot", + "x-api-channel": "Private", + "x-api-permission": "Margin", + "x-api-rate-limit-pool": "Spot", + "x-sdk-service": "Margin", + "x-sdk-sub-service": "Order", + "x-sdk-method-name": "getSymbolsWithOpenOrder", + "x-sdk-method-description": "This interface can query all Margin symbol that has active orders", + "x-api-rate-limit": 2, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"symbolSize\\\": 1,\\n \\\"symbols\\\": [\\n \\\"BTC-USDT\\\"\\n ]\\n }\\n}", + "x-request-example": "{\\\"tradeType\\\": \\\"MARGIN_TRADE\\\"}" } }, - "/api/v3/margin/borrow": { - "post": { - "summary": "Borrow", + "/api/v3/hf/margin/orders/active": { + "get": { + "summary": "Get Open Orders", "deprecated": false, - "description": "This API endpoint is used to initiate an application for cross or isolated margin borrowing.", + "description": "This interface is to obtain all Margin active order lists, and the return value of the active order interface is the paged data of all uncompleted order lists. The returned data is sorted in descending order according to the latest update time of the order. After the user successfully places an order, the order is in Active state, and the user can use inOrderBook to determine whether the order has entered the order. Canceled or fully filled orders are marked as completed Done status.", "tags": [], - "parameters": [], + "parameters": [ + { + "name": "symbol", + "in": "query", + "description": "symbol", + "required": true, + "schema": { + "type": "string", + "example": [ + "BTC-USDT", + "ETH-USDT", + "KCS-USDT" + ] + } + }, + { + "name": "tradeType", + "in": "query", + "description": "Order type: MARGIN_TRADE - cross margin trading order, MARGIN_ISOLATED_TRADE - isolated margin trading order", + "required": true, + "schema": { + "type": "string", + "enum": [ + "MARGIN_TRADE", + "MARGIN_ISOLATED_TRADE" + ], + "x-api-enum": [ + { + "value": "MARGIN_TRADE", + "name": "", + "description": "" + }, + { + "value": "MARGIN_ISOLATED_TRADE", + "name": "", + "description": "" + } + ] + } + } + ], "responses": { "200": { "description": "", @@ -3327,21 +2191,283 @@ "type": "string" }, "data": { - "type": "object", - "properties": { - "orderNo": { - "type": "string", - "description": "Borrow Order Id" + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The unique order id generated by the trading system" + }, + "symbol": { + "type": "string", + "description": "symbol", + "example": [ + "BTC-USDT", + "ETH-USDT", + "KCS-USDT" + ] + }, + "opType": { + "type": "string" + }, + "type": { + "type": "string", + "description": "Specify if the order is an 'limit' order or 'market' order. ", + "enum": [ + "limit", + "market" + ], + "x-api-enum": [ + { + "value": "limit", + "name": "", + "description": "" + }, + { + "value": "market", + "name": "", + "description": "" + } + ] + }, + "side": { + "type": "string", + "description": "Buy or sell", + "enum": [ + "buy", + "sell" + ], + "x-api-enum": [ + { + "value": "buy", + "name": "", + "description": "" + }, + { + "value": "sell", + "name": "", + "description": "" + } + ] + }, + "price": { + "type": "string", + "description": "Order price" + }, + "size": { + "type": "string", + "description": "Order size" + }, + "funds": { + "type": "string", + "description": "Order Funds" + }, + "dealSize": { + "type": "string", + "description": "Number of filled transactions" + }, + "dealFunds": { + "type": "string", + "description": "Funds of filled transactions" + }, + "fee": { + "type": "string", + "description": "trading fee" + }, + "feeCurrency": { + "type": "string", + "description": "currency used to calculate trading fee" + }, + "stp": { + "type": "string", + "description": "[Self Trade Prevention](https://www.kucoin.com/docs-new/doc-338146) is divided into these strategies: CN, CO, CB , and DC", + "enum": [ + "DC", + "CO", + "CN", + "CB" + ], + "x-api-enum": [ + { + "value": "DC", + "name": "", + "description": "" + }, + { + "value": "CO", + "name": "", + "description": "" + }, + { + "value": "CN", + "name": "", + "description": "" + }, + { + "value": "CB", + "name": "", + "description": "" + } + ] + }, + "stop": { + "type": "string" + }, + "stopTriggered": { + "type": "boolean" + }, + "stopPrice": { + "type": "string" + }, + "timeInForce": { + "type": "string", + "description": "Time in force", + "enum": [ + "GTC", + "GTT", + "IOC", + "FOK" + ], + "x-api-enum": [ + { + "value": "GTC", + "name": "", + "description": "" + }, + { + "value": "GTT", + "name": "", + "description": "" + }, + { + "value": "IOC", + "name": "", + "description": "" + }, + { + "value": "FOK", + "name": "", + "description": "" + } + ] + }, + "postOnly": { + "type": "boolean", + "description": "Whether its a postOnly order." + }, + "hidden": { + "type": "boolean", + "description": "Whether its a hidden order." + }, + "iceberg": { + "type": "boolean", + "description": "Whether its a iceberg order." + }, + "visibleSize": { + "type": "string", + "description": "Visible size of iceberg order in order book." + }, + "cancelAfter": { + "type": "integer", + "description": "A GTT timeInForce that expires in n seconds" + }, + "channel": { + "type": "string" + }, + "clientOid": { + "type": "string", + "description": "Client Order Id,unique identifier created by the user" + }, + "remark": { + "type": "string", + "description": "Order placement remarks" + }, + "tags": { + "type": "string", + "description": "Order tag" + }, + "cancelExist": { + "type": "boolean", + "description": "Whether there is a cancellation record for the order." + }, + "createdAt": { + "type": "integer", + "format": "int64" + }, + "lastUpdatedAt": { + "type": "integer", + "format": "int64" + }, + "tradeType": { + "type": "string", + "description": "Trade type, redundancy param" + }, + "inOrderBook": { + "type": "boolean", + "description": "Whether to enter the orderbook: true: enter the orderbook; false: not enter the orderbook" + }, + "cancelledSize": { + "type": "string", + "description": "Number of canceled transactions" + }, + "cancelledFunds": { + "type": "string", + "description": "Funds of canceled transactions" + }, + "remainSize": { + "type": "string", + "description": "Number of remain transactions" + }, + "remainFunds": { + "type": "string", + "description": "Funds of remain transactions" + }, + "tax": { + "type": "string", + "description": "Users in some regions need query this field" + }, + "active": { + "type": "boolean", + "description": "Order status: true-The status of the order isactive; false-The status of the order is done" + } }, - "actualSize": { - "type": "string", - "description": "Actual borrowed amount" - } - }, - "required": [ - "orderNo", - "actualSize" - ] + "required": [ + "stopPrice", + "id", + "symbol", + "opType", + "type", + "side", + "price", + "size", + "funds", + "dealSize", + "dealFunds", + "fee", + "feeCurrency", + "stopTriggered", + "timeInForce", + "postOnly", + "hidden", + "iceberg", + "visibleSize", + "cancelAfter", + "channel", + "clientOid", + "cancelExist", + "tradeType", + "inOrderBook", + "cancelledSize", + "cancelledFunds", + "remainSize", + "remainFunds", + "tax", + "active", + "createdAt", + "lastUpdatedAt" + ] + } } }, "required": [ @@ -3353,146 +2479,121 @@ } } }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470206", - "x-abandon": "normal", - "x-domain": "Spot", - "x-api-channel": "Private", - "x-api-permission": "Margin", - "x-api-rate-limit-pool": "Spot", - "x-sdk-service": "Margin", - "x-sdk-sub-service": "Debit", - "x-sdk-method-name": "borrow", - "x-sdk-method-description": "This API endpoint is used to initiate an application for cross or isolated margin borrowing.", - "x-api-rate-limit": 15, - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "currency": { - "type": "string", - "description": "currency", - "example": [ - "BTC", - "ETH", - "USDT" - ] - }, - "size": { - "type": "number", - "description": "Borrow amount" - }, - "timeInForce": { - "type": "string", - "enum": [ - "IOC", - "FOK" - ], - "description": "timeInForce: IOC, FOK", - "x-api-enum": [ - { - "value": "IOC", - "name": "", - "description": "" - }, - { - "value": "FOK", - "name": "", - "description": "" - } - ] - }, - "symbol": { - "type": "string", - "description": "symbol, mandatory for isolated margin account", - "example": [ - "BTC-USDT", - "ETH-USDT", - "KCS-USDT" - ] - }, - "isIsolated": { - "type": "boolean", - "description": "true-isolated, false-cross; default is false", - "default": false - }, - "isHf": { - "type": "boolean", - "description": "true: high frequency borrowing, false: low frequency borrowing; default false", - "default": false - } - }, - "required": [ - "currency", - "size", - "timeInForce" - ] - }, - "example": "{\n \"currency\": \"USDT\",\n \"size\": 10,\n \"timeInForce\": \"FOK\",\n \"isIsolated\": false,\n \"isHf\": false\n}" - } - } - }, - "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"orderNo\\\":\\\"67187162c0d6990007717b15\\\",\\\"actualSize\\\":\\\"10\\\"}}", - "x-request-example": "{\\\"currency\\\": \\\"USDT\\\", \\\"size\\\": 10, \\\"timeInForce\\\": \\\"FOK\\\", \\\"isIsolated\\\": false, \\\"isHf\\\": false}" - }, + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470198", + "x-abandon": "normal", + "x-domain": "Spot", + "x-api-channel": "Private", + "x-api-permission": "General", + "x-api-rate-limit-pool": "Spot", + "x-sdk-service": "Margin", + "x-sdk-sub-service": "Order", + "x-sdk-method-name": "getOpenOrders", + "x-sdk-method-description": "This interface is to obtain all Margin active order lists, and the return value of the active order interface is the paged data of all uncompleted order lists. The returned data is sorted in descending order according to the latest update time of the order. After the user successfully places an order, the order is in Active state, and the user can use inOrderBook to determine whether the order has entered the order. Canceled or fully filled orders are marked as completed Done status.", + "x-api-rate-limit": 4, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": [\\n {\\n \\\"id\\\": \\\"671667306afcdb000723107f\\\",\\n \\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\",\\n \\\"symbol\\\": \\\"BTC-USDT\\\",\\n \\\"opType\\\": \\\"DEAL\\\",\\n \\\"type\\\": \\\"limit\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"price\\\": \\\"50000\\\",\\n \\\"size\\\": \\\"0.00001\\\",\\n \\\"funds\\\": \\\"0.5\\\",\\n \\\"dealSize\\\": \\\"0\\\",\\n \\\"dealFunds\\\": \\\"0\\\",\\n \\\"remainSize\\\": \\\"0.00001\\\",\\n \\\"remainFunds\\\": \\\"0.5\\\",\\n \\\"cancelledSize\\\": \\\"0\\\",\\n \\\"cancelledFunds\\\": \\\"0\\\",\\n \\\"fee\\\": \\\"0\\\",\\n \\\"feeCurrency\\\": \\\"USDT\\\",\\n \\\"stp\\\": null,\\n \\\"stop\\\": null,\\n \\\"stopTriggered\\\": false,\\n \\\"stopPrice\\\": \\\"0\\\",\\n \\\"timeInForce\\\": \\\"GTC\\\",\\n \\\"postOnly\\\": false,\\n \\\"hidden\\\": false,\\n \\\"iceberg\\\": false,\\n \\\"visibleSize\\\": \\\"0\\\",\\n \\\"cancelAfter\\\": 0,\\n \\\"channel\\\": \\\"API\\\",\\n \\\"remark\\\": null,\\n \\\"tags\\\": null,\\n \\\"cancelExist\\\": false,\\n \\\"tradeType\\\": \\\"MARGIN_TRADE\\\",\\n \\\"inOrderBook\\\": true,\\n \\\"active\\\": true,\\n \\\"tax\\\": \\\"0\\\",\\n \\\"createdAt\\\": 1729521456248,\\n \\\"lastUpdatedAt\\\": 1729521460940\\n }\\n ]\\n}", + "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"tradeType\\\": \\\"MARGIN_TRADE\\\"}" + } + }, + "/api/v3/hf/margin/orders/done": { "get": { - "summary": "Get Borrow History", + "summary": "Get Closed Orders", "deprecated": false, - "description": "This API endpoint is used to get the borrowing orders for cross and isolated margin accounts", + "description": "This interface is to obtain all Margin closed order lists, and the return value of the active order interface is the paged data of all uncompleted order lists. The returned data is sorted in descending order according to the latest update time of the order. After the user successfully places an order, the order is in Active state, and the user can use inOrderBook to determine whether the order has entered the order. Canceled or fully filled orders are marked as completed Done status.", "tags": [], "parameters": [ { - "name": "currency", + "name": "symbol", "in": "query", - "description": "currency", + "description": "symbol", "required": true, "schema": { "type": "string", "example": [ - "BTC", - "ETH", - "KCS" + "BTC-USDT", + "ETH-USDT", + "KCS-USDT" ] } }, { - "name": "isIsolated", + "name": "tradeType", "in": "query", - "description": "true-isolated, false-cross; default is false", - "required": false, + "description": "Transaction type: MARGIN_TRADE - cross margin trade, MARGIN_ISOLATED_TRADE - isolated margin trade", + "required": true, "schema": { - "type": "boolean", - "default": false + "type": "string", + "enum": [ + "MARGIN_TRADE", + "MARGIN_ISOLATED_TRADE" + ], + "x-api-enum": [ + { + "value": "MARGIN_TRADE", + "name": "", + "description": "" + }, + { + "value": "MARGIN_ISOLATED_TRADE", + "name": "", + "description": "" + } + ] } }, { - "name": "symbol", + "name": "side", "in": "query", - "description": "symbol, mandatory for isolated margin account", + "description": "specify if the order is to 'buy' or 'sell'", "required": false, "schema": { "type": "string", - "example": [ - "BTC-USDT", - "ETH-USDT", - "KCS-USDT" + "enum": [ + "buy", + "sell" + ], + "x-api-enum": [ + { + "value": "buy", + "name": "", + "description": "" + }, + { + "value": "sell", + "name": "", + "description": "" + } ] } }, { - "name": "orderNo", + "name": "type", "in": "query", - "description": "Borrow Order Id", + "description": "specify if the order is an 'limit' order or 'market' order. ", "required": false, "schema": { - "type": "string" + "type": "string", + "enum": [ + "limit", + "market" + ], + "x-api-enum": [ + { + "value": "limit", + "name": "", + "description": "" + }, + { + "value": "market", + "name": "", + "description": "" + } + ] } }, { - "name": "startTime", + "name": "lastId", "in": "query", - "description": "The start and end times are not restricted. If the start time is empty or less than 1680278400000, the default value is set to 1680278400000 (April 1, 2023, 00:00:00)", + "description": "The id of the last set of data from the previous batch of data. By default, the latest information is given.\nlastId is used to filter data and paginate. If lastId is not entered, the default is a maximum of 100 returned data items. The return results include lastId,which can be used as a query parameter to look up new data from the next page.", "required": false, "schema": { "type": "integer", @@ -3500,35 +2601,35 @@ } }, { - "name": "endTime", + "name": "limit", "in": "query", - "description": "End time", + "description": "Default20,Max100", "required": false, "schema": { "type": "integer", - "format": "int64" + "default": 20, + "minimum": 1, + "maximum": 100 } }, { - "name": "currentPage", + "name": "startAt", "in": "query", - "description": "Current query page, with a starting value of 1. Default:1\n", + "description": "Start time (milisecond)", "required": false, "schema": { "type": "integer", - "default": 1 + "format": "int64" } }, { - "name": "pageSize", + "name": "endAt", "in": "query", - "description": "Number of results per page. Default is 50, minimum is 10, maximum is 500", + "description": "End time (milisecond)", "required": false, "schema": { "type": "integer", - "default": 50, - "minimum": 10, - "maximum": 500 + "format": "int64" } } ], @@ -3546,106 +2647,277 @@ "data": { "type": "object", "properties": { - "timestamp": { + "lastId": { "type": "integer", + "description": "The id of the last set of data from the previous batch of data. By default, the latest information is given.\nlastId is used to filter data and paginate. If lastId is not entered, the default is a maximum of 100 returned data items. The return results include lastId,which can be used as a query parameter to look up new data from the next page.", "format": "int64" }, - "currentPage": { - "type": "integer", - "description": "current page" - }, - "pageSize": { - "type": "integer", - "description": "page size" - }, - "totalNum": { - "type": "integer", - "description": "total number" - }, - "totalPage": { - "type": "integer", - "description": "total page" - }, "items": { "type": "array", "items": { "type": "object", "properties": { - "orderNo": { + "id": { "type": "string", - "description": "Borrow Order Id" + "description": "The unique order id generated by the trading system" }, "symbol": { "type": "string", - "description": "Isolated Margin symbol; empty for cross margin", + "description": "symbol", "example": [ "BTC-USDT", "ETH-USDT", "KCS-USDT" ] }, - "currency": { + "opType": { + "type": "string" + }, + "type": { "type": "string", - "description": "currency" + "description": "Specify if the order is an 'limit' order or 'market' order. ", + "enum": [ + "limit", + "market" + ], + "x-api-enum": [ + { + "value": "limit", + "name": "", + "description": "" + }, + { + "value": "market", + "name": "", + "description": "" + } + ] + }, + "side": { + "type": "string", + "description": "Buy or sell" + }, + "price": { + "type": "string", + "description": "Order price" }, "size": { "type": "string", - "description": "Initiated borrow amount" + "description": "Order size" }, - "actualSize": { + "funds": { "type": "string", - "description": "Actual borrow amount" + "description": "Order Funds" }, - "status": { + "dealSize": { "type": "string", - "description": "PENDING: Processing, SUCCESS: Successful, FAILED: Failed", + "description": "Number of filled transactions" + }, + "dealFunds": { + "type": "string", + "description": "Funds of filled transactions" + }, + "fee": { + "type": "string", + "description": "[Handling fees](https://www.kucoin.com/docs-new/api-5327739)" + }, + "feeCurrency": { + "type": "string", + "description": "currency used to calculate trading fee" + }, + "stp": { + "type": "string", + "description": "[Self Trade Prevention](https://www.kucoin.com/docs-new/doc-338146) is divided into these strategies: CN, CO, CB , and DC", "enum": [ - "PENDING", - "SUCCESS", - "FAILED" + "DC", + "CO", + "CN", + "CB" + ], + "x-api-enum": [ + { + "value": "DC", + "name": "", + "description": "" + }, + { + "value": "CO", + "name": "", + "description": "" + }, + { + "value": "CN", + "name": "", + "description": "" + }, + { + "value": "CB", + "name": "", + "description": "" + } + ] + }, + "stop": { + "type": "string" + }, + "stopTriggered": { + "type": "boolean" + }, + "stopPrice": { + "type": "string" + }, + "timeInForce": { + "type": "string", + "description": "Time in force", + "enum": [ + "GTC", + "GTT", + "IOC", + "FOK" ], "x-api-enum": [ { - "value": "PENDING", + "value": "GTC", "name": "", "description": "" }, { - "value": "SUCCESS", + "value": "GTT", "name": "", "description": "" }, { - "value": "FAILED", + "value": "IOC", + "name": "", + "description": "" + }, + { + "value": "FOK", "name": "", "description": "" } ] }, - "createdTime": { + "postOnly": { + "type": "boolean", + "description": "Whether its a postOnly order." + }, + "hidden": { + "type": "boolean", + "description": "Whether its a hidden order." + }, + "iceberg": { + "type": "boolean", + "description": "Whether its a iceberg order." + }, + "visibleSize": { + "type": "string", + "description": "Visible size of iceberg order in order book." + }, + "cancelAfter": { + "type": "integer", + "description": "A GTT timeInForce that expires in n seconds" + }, + "channel": { + "type": "string" + }, + "clientOid": { + "type": "string", + "description": "Client Order Id,unique identifier created by the user" + }, + "remark": { + "type": "string", + "description": "Order placement remarks" + }, + "tags": { + "type": "string", + "description": "Order tag" + }, + "cancelExist": { + "type": "boolean", + "description": "Whether there is a cancellation record for the order." + }, + "createdAt": { "type": "integer", - "description": "borrow time", "format": "int64" + }, + "lastUpdatedAt": { + "type": "integer", + "format": "int64" + }, + "tradeType": { + "type": "string", + "description": "Trade type, redundancy param" + }, + "inOrderBook": { + "type": "boolean", + "description": "Whether to enter the orderbook: true: enter the orderbook; false: not enter the orderbook" + }, + "cancelledSize": { + "type": "string", + "description": "Number of canceled transactions" + }, + "cancelledFunds": { + "type": "string", + "description": "Funds of canceled transactions" + }, + "remainSize": { + "type": "string", + "description": "Number of remain transactions" + }, + "remainFunds": { + "type": "string", + "description": "Funds of remain transactions" + }, + "tax": { + "type": "string", + "description": "Users in some regions need query this field" + }, + "active": { + "type": "boolean", + "description": "Order status: true-The status of the order isactive; false-The status of the order is done" } }, "required": [ - "orderNo", + "id", "symbol", - "currency", + "opType", + "type", + "side", + "price", "size", - "actualSize", - "status", - "createdTime" + "funds", + "dealSize", + "dealFunds", + "fee", + "feeCurrency", + "stopTriggered", + "stopPrice", + "timeInForce", + "postOnly", + "hidden", + "iceberg", + "visibleSize", + "cancelAfter", + "channel", + "clientOid", + "cancelExist", + "createdAt", + "lastUpdatedAt", + "tradeType", + "inOrderBook", + "cancelledSize", + "cancelledFunds", + "remainSize", + "remainFunds", + "tax", + "active" ] } } }, "required": [ - "timestamp", - "currentPage", - "pageSize", - "totalNum", - "totalPage", + "lastId", "items" ] } @@ -3659,79 +2931,130 @@ } } }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470207", + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470199", "x-abandon": "normal", "x-domain": "Spot", "x-api-channel": "Private", - "x-api-permission": "Margin", + "x-api-permission": "General", "x-api-rate-limit-pool": "Spot", "x-sdk-service": "Margin", - "x-sdk-sub-service": "Debit", - "x-sdk-method-name": "getBorrowHistory", - "x-sdk-method-description": "This API endpoint is used to get the borrowing orders for cross and isolated margin accounts", - "x-api-rate-limit": 15, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"timestamp\\\": 1729657580449,\\n \\\"currentPage\\\": 1,\\n \\\"pageSize\\\": 50,\\n \\\"totalNum\\\": 2,\\n \\\"totalPage\\\": 1,\\n \\\"items\\\": [\\n {\\n \\\"orderNo\\\": \\\"67187162c0d6990007717b15\\\",\\n \\\"symbol\\\": null,\\n \\\"currency\\\": \\\"USDT\\\",\\n \\\"size\\\": \\\"10\\\",\\n \\\"actualSize\\\": \\\"10\\\",\\n \\\"status\\\": \\\"SUCCESS\\\",\\n \\\"createdTime\\\": 1729655138000\\n },\\n {\\n \\\"orderNo\\\": \\\"67187155b088e70007149585\\\",\\n \\\"symbol\\\": null,\\n \\\"currency\\\": \\\"USDT\\\",\\n \\\"size\\\": \\\"0.1\\\",\\n \\\"actualSize\\\": \\\"0\\\",\\n \\\"status\\\": \\\"FAILED\\\",\\n \\\"createdTime\\\": 1729655125000\\n }\\n ]\\n }\\n}", - "x-request-example": "{\\\"currency\\\": \\\"BTC\\\", \\\"isIsolated\\\": true, \\\"symbol\\\": \\\"BTC-USDT\\\", \\\"orderNo\\\": \\\"example_string_default_value\\\", \\\"startTime\\\": 123456, \\\"endTime\\\": 123456, \\\"currentPage\\\": 1, \\\"pageSize\\\": 50}" + "x-sdk-sub-service": "Order", + "x-sdk-method-name": "getClosedOrders", + "x-sdk-method-description": "This interface is to obtain all Margin closed order lists, and the return value of the active order interface is the paged data of all uncompleted order lists. The returned data is sorted in descending order according to the latest update time of the order. After the user successfully places an order, the order is in Active state, and the user can use inOrderBook to determine whether the order has entered the order. Canceled or fully filled orders are marked as completed Done status.", + "x-api-rate-limit": 10, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"lastId\\\": 136112949351,\\n \\\"items\\\": [\\n {\\n \\\"id\\\": \\\"6716491f6afcdb00078365c8\\\",\\n \\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\",\\n \\\"symbol\\\": \\\"BTC-USDT\\\",\\n \\\"opType\\\": \\\"DEAL\\\",\\n \\\"type\\\": \\\"limit\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"price\\\": \\\"50000\\\",\\n \\\"size\\\": \\\"0.00001\\\",\\n \\\"funds\\\": \\\"0.5\\\",\\n \\\"dealSize\\\": \\\"0\\\",\\n \\\"dealFunds\\\": \\\"0\\\",\\n \\\"remainSize\\\": \\\"0\\\",\\n \\\"remainFunds\\\": \\\"0\\\",\\n \\\"cancelledSize\\\": \\\"0.00001\\\",\\n \\\"cancelledFunds\\\": \\\"0.5\\\",\\n \\\"fee\\\": \\\"0\\\",\\n \\\"feeCurrency\\\": \\\"USDT\\\",\\n \\\"stp\\\": null,\\n \\\"stop\\\": null,\\n \\\"stopTriggered\\\": false,\\n \\\"stopPrice\\\": \\\"0\\\",\\n \\\"timeInForce\\\": \\\"GTC\\\",\\n \\\"postOnly\\\": false,\\n \\\"hidden\\\": false,\\n \\\"iceberg\\\": false,\\n \\\"visibleSize\\\": \\\"0\\\",\\n \\\"cancelAfter\\\": 0,\\n \\\"channel\\\": \\\"API\\\",\\n \\\"remark\\\": null,\\n \\\"tags\\\": null,\\n \\\"cancelExist\\\": true,\\n \\\"tradeType\\\": \\\"MARGIN_TRADE\\\",\\n \\\"inOrderBook\\\": false,\\n \\\"active\\\": false,\\n \\\"tax\\\": \\\"0\\\",\\n \\\"createdAt\\\": 1729513759162,\\n \\\"lastUpdatedAt\\\": 1729521126597\\n }\\n ]\\n }\\n}", + "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"tradeType\\\": \\\"MARGIN_TRADE\\\", \\\"side\\\": \\\"buy\\\", \\\"type\\\": \\\"limit\\\", \\\"lastId\\\": 254062248624417, \\\"limit\\\": 20, \\\"startAt\\\": 1728663338000, \\\"endAt\\\": 1728692138000}" } }, - "/api/v3/margin/repay": { + "/api/v3/hf/margin/fills": { "get": { - "summary": "Get Repay History", + "summary": "Get Trade History", "deprecated": false, - "description": "This API endpoint is used to get the borrowing orders for cross and isolated margin accounts", + "description": "This endpoint can be used to obtain a list of the latest Margin transaction details. The returned data is sorted in descending order according to the latest update time of the order.", "tags": [], "parameters": [ { - "name": "currency", + "name": "symbol", "in": "query", - "description": "currency", + "description": "symbol", "required": true, "schema": { "type": "string", "example": [ - "BTC", - "ETH", - "KCS" + "BTC-USDT", + "ETH-USDT", + "KCS-USDT" ] } }, { - "name": "isIsolated", + "name": "tradeType", "in": "query", - "description": "true-isolated, false-cross; default is false", + "description": "Trade type: MARGIN_TRADE - cross margin trade, MARGIN_ISOLATED_TRADE - isolated margin trade", + "required": true, + "schema": { + "type": "string", + "enum": [ + "MARGIN_TRADE", + "MARGIN_ISOLATED_TRADE" + ], + "x-api-enum": [ + { + "value": "MARGIN_TRADE", + "name": "", + "description": "" + }, + { + "value": "MARGIN_ISOLATED_TRADE", + "name": "", + "description": "" + } + ] + } + }, + { + "name": "orderId", + "in": "query", + "description": "The unique order id generated by the trading system\n(If orderId is specified,please ignore the other query parameters)", "required": false, "schema": { - "type": "boolean", - "default": false + "type": "string" } }, { - "name": "symbol", + "name": "side", "in": "query", - "description": "symbol, mandatory for isolated margin account", + "description": "specify if the order is to 'buy' or 'sell'", "required": false, "schema": { "type": "string", - "example": [ - "BTC-USDT", - "ETH-USDT", - "KCS-USDT" + "enum": [ + "buy", + "sell" + ], + "x-api-enum": [ + { + "value": "buy", + "name": "", + "description": "" + }, + { + "value": "sell", + "name": "", + "description": "" + } ] } }, { - "name": "orderNo", + "name": "type", "in": "query", - "description": "Repay Order Id", + "description": "specify if the order is an 'limit' order or 'market' order. ", "required": false, "schema": { - "type": "string" + "type": "string", + "enum": [ + "limit", + "market" + ], + "x-api-enum": [ + { + "value": "limit", + "name": "", + "description": "" + }, + { + "value": "market", + "name": "", + "description": "" + } + ] } }, { - "name": "startTime", + "name": "lastId", "in": "query", - "description": "The start and end times are not restricted. If the start time is empty or less than 1680278400000, the default value is set to 1680278400000 (April 1, 2023, 00:00:00)", + "description": "The id of the last set of data from the previous batch of data. By default, the latest information is given.\nlastId is used to filter data and paginate. If lastId is not entered, the default is a maximum of 100 returned data items. The return results include lastId,which can be used as a query parameter to look up new data from the next page.", "required": false, "schema": { "type": "integer", @@ -3739,35 +3062,35 @@ } }, { - "name": "endTime", + "name": "limit", "in": "query", - "description": "End time", + "description": "Default100,Max200", "required": false, "schema": { "type": "integer", - "format": "int64" + "default": 20, + "minimum": 1, + "maximum": 200 } }, { - "name": "currentPage", + "name": "startAt", "in": "query", - "description": "Current query page, with a starting value of 1. Default:1\n", + "description": "Start time (milisecond)", "required": false, "schema": { "type": "integer", - "default": 1 + "format": "int64" } }, { - "name": "pageSize", + "name": "endAt", "in": "query", - "description": "Number of results per page. Default is 50, minimum is 10, maximum is 500", + "description": "End time (milisecond)", "required": false, "schema": { "type": "integer", - "default": 50, - "minimum": 10, - "maximum": 500 + "format": "int64" } } ], @@ -3785,107 +3108,179 @@ "data": { "type": "object", "properties": { - "timestamp": { - "type": "integer", - "format": "int64" - }, - "currentPage": { - "type": "integer", - "description": "current page" - }, - "pageSize": { - "type": "integer", - "description": "page size" - }, - "totalNum": { - "type": "integer", - "description": "total number" - }, - "totalPage": { - "type": "integer", - "description": "total page" - }, "items": { "type": "array", "items": { "type": "object", "properties": { - "orderNo": { - "type": "string", - "description": "Repay Order Id" + "id": { + "type": "integer", + "description": "Id of transaction detail", + "format": "int64" }, "symbol": { "type": "string", - "description": "Isolated Margin symbol; empty for cross margin" + "description": "symbol", + "example": [ + "BTC-USDT", + "ETH-USDT", + "KCS-USDT" + ] }, - "currency": { - "type": "string", - "description": "currency" + "tradeId": { + "type": "integer", + "description": "Trade Id, symbol latitude increment", + "format": "int64" }, - "size": { + "orderId": { "type": "string", - "description": "Amount of initiated repay" + "description": "The unique order id generated by the trading system" }, - "principal": { + "counterOrderId": { "type": "string", - "description": "Amount of principal paid" + "description": "Counterparty order Id" }, - "interest": { + "side": { "type": "string", - "description": "Amount of interest paid" + "description": "Buy or sell", + "enum": [ + "buy", + "sell" + ], + "x-api-enum": [ + { + "value": "buy", + "name": "", + "description": "" + }, + { + "value": "sell", + "name": "", + "description": "" + } + ] }, - "status": { + "liquidity": { "type": "string", - "description": "PENDING: Processing, SUCCESS: Successful, FAILED: Failed", + "description": "Liquidity type: taker or maker", "enum": [ - "PENDING", - "SUCCESS", - "FAILED" + "taker", + "maker" ], "x-api-enum": [ { - "value": "PENDING", + "value": "taker", "name": "", "description": "" }, { - "value": "SUCCESS", + "value": "maker", + "name": "", + "description": "" + } + ] + }, + "forceTaker": { + "type": "boolean" + }, + "price": { + "type": "string", + "description": "Order price" + }, + "size": { + "type": "string", + "description": "Order size" + }, + "funds": { + "type": "string", + "description": "Order Funds" + }, + "fee": { + "type": "string", + "description": "[Handling fees](https://www.kucoin.com/docs-new/api-5327739)" + }, + "feeRate": { + "type": "string", + "description": "Fee rate\n" + }, + "feeCurrency": { + "type": "string", + "description": "currency used to calculate trading fee" + }, + "stop": { + "type": "string", + "description": "Take Profit and Stop Loss type, currently HFT does not support the Take Profit and Stop Loss type, so it is empty" + }, + "tradeType": { + "type": "string", + "description": "Trade type, redundancy param" + }, + "tax": { + "type": "string", + "description": "Users in some regions need query this field" + }, + "taxRate": { + "type": "string", + "description": "Tax Rate, Users in some regions need query this field" + }, + "type": { + "type": "string", + "description": "Specify if the order is an 'limit' order or 'market' order. ", + "enum": [ + "limit", + "market" + ], + "x-api-enum": [ + { + "value": "limit", "name": "", "description": "" }, { - "value": "FAILED", + "value": "market", "name": "", "description": "" } ] }, - "createdTime": { + "createdAt": { "type": "integer", - "description": "Repayment time", "format": "int64" } }, "required": [ + "id", "symbol", - "orderNo", - "currency", + "tradeId", + "orderId", + "counterOrderId", + "side", + "liquidity", + "forceTaker", + "price", "size", - "principal", - "interest", - "status", - "createdTime" + "funds", + "fee", + "feeRate", + "feeCurrency", + "stop", + "tradeType", + "tax", + "taxRate", + "type", + "createdAt" ] } + }, + "lastId": { + "type": "integer", + "description": "The id of the last set of data from the previous batch of data. By default, the latest information is given.\nlastId is used to filter data and paginate. If lastId is not entered, the default is a maximum of 100 returned data items. The return results include lastId,which can be used as a query parameter to look up new data from the next page.", + "format": "int64" } }, "required": [ - "timestamp", - "currentPage", - "pageSize", - "totalNum", - "totalPage", - "items" + "items", + "lastId" ] } }, @@ -3898,24 +3293,26 @@ } } }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470208", + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470200", "x-abandon": "normal", "x-domain": "Spot", "x-api-channel": "Private", - "x-api-permission": "Margin", + "x-api-permission": "General", "x-api-rate-limit-pool": "Spot", "x-sdk-service": "Margin", - "x-sdk-sub-service": "Debit", - "x-sdk-method-name": "getRepayHistory", - "x-sdk-method-description": "This API endpoint is used to get the borrowing orders for cross and isolated margin accounts", - "x-api-rate-limit": 15, - "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"timestamp\\\":1729663471891,\\\"currentPage\\\":1,\\\"pageSize\\\":50,\\\"totalNum\\\":1,\\\"totalPage\\\":1,\\\"items\\\":[{\\\"orderNo\\\":\\\"671873361d5bd400075096ad\\\",\\\"symbol\\\":null,\\\"currency\\\":\\\"USDT\\\",\\\"size\\\":\\\"10\\\",\\\"principal\\\":\\\"9.99986518\\\",\\\"interest\\\":\\\"0.00013482\\\",\\\"status\\\":\\\"SUCCESS\\\",\\\"createdTime\\\":1729655606000}]}}", - "x-request-example": "{\\\"currency\\\": \\\"BTC\\\", \\\"isIsolated\\\": true, \\\"symbol\\\": \\\"BTC-USDT\\\", \\\"orderNo\\\": \\\"example_string_default_value\\\", \\\"startTime\\\": 123456, \\\"endTime\\\": 123456, \\\"currentPage\\\": 1, \\\"pageSize\\\": 50}" - }, + "x-sdk-sub-service": "Order", + "x-sdk-method-name": "getTradeHistory", + "x-sdk-method-description": "This endpoint can be used to obtain a list of the latest Margin transaction details. The returned data is sorted in descending order according to the latest update time of the order.", + "x-api-rate-limit": 5, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"items\\\": [\\n {\\n \\\"id\\\": 137891621991,\\n \\\"symbol\\\": \\\"BTC-USDT\\\",\\n \\\"tradeId\\\": 11040911994273793,\\n \\\"orderId\\\": \\\"671868085584bc0007d85f46\\\",\\n \\\"counterOrderId\\\": \\\"67186805b7cbdf00071621f9\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"liquidity\\\": \\\"taker\\\",\\n \\\"forceTaker\\\": false,\\n \\\"price\\\": \\\"67141.6\\\",\\n \\\"size\\\": \\\"0.00001\\\",\\n \\\"funds\\\": \\\"0.671416\\\",\\n \\\"fee\\\": \\\"0.000671416\\\",\\n \\\"feeRate\\\": \\\"0.001\\\",\\n \\\"feeCurrency\\\": \\\"USDT\\\",\\n \\\"stop\\\": \\\"\\\",\\n \\\"tradeType\\\": \\\"MARGIN_TRADE\\\",\\n \\\"tax\\\": \\\"0\\\",\\n \\\"taxRate\\\": \\\"0\\\",\\n \\\"type\\\": \\\"limit\\\",\\n \\\"createdAt\\\": 1729652744998\\n }\\n ],\\n \\\"lastId\\\": 137891621991\\n }\\n}", + "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"tradeType\\\": \\\"MARGIN_TRADE\\\", \\\"orderId\\\": \\\"example_string_default_value\\\", \\\"side\\\": \\\"buy\\\", \\\"type\\\": \\\"limit\\\", \\\"lastId\\\": 254062248624417, \\\"limit\\\": 100, \\\"startAt\\\": 1728663338000, \\\"endAt\\\": 1728692138000}" + } + }, + "/api/v3/margin/borrow": { "post": { - "summary": "Repay", + "summary": "Borrow", "deprecated": false, - "description": "This API endpoint is used to initiate an application for cross or isolated margin repayment.", + "description": "This API endpoint is used to initiate an application for cross or isolated margin borrowing.", "tags": [], "parameters": [], "responses": { @@ -3932,21 +3329,16 @@ "data": { "type": "object", "properties": { - "timestamp": { - "type": "integer", - "format": "int64" - }, "orderNo": { "type": "string", - "description": "Repay Order Id" + "description": "Borrow Order Id" }, "actualSize": { "type": "string", - "description": "Actual repay amount" + "description": "Actual borrowed amount" } }, "required": [ - "timestamp", "orderNo", "actualSize" ] @@ -3961,7 +3353,7 @@ } } }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470210", + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470206", "x-abandon": "normal", "x-domain": "Spot", "x-api-channel": "Private", @@ -3969,9 +3361,9 @@ "x-api-rate-limit-pool": "Spot", "x-sdk-service": "Margin", "x-sdk-sub-service": "Debit", - "x-sdk-method-name": "repay", - "x-sdk-method-description": "This API endpoint is used to initiate an application for cross or isolated margin repayment.", - "x-api-rate-limit": 10, + "x-sdk-method-name": "borrow", + "x-sdk-method-description": "This API endpoint is used to initiate an application for cross or isolated margin borrowing.", + "x-api-rate-limit": 15, "requestBody": { "content": { "application/json": { @@ -3991,6 +3383,26 @@ "type": "number", "description": "Borrow amount" }, + "timeInForce": { + "type": "string", + "enum": [ + "IOC", + "FOK" + ], + "description": "timeInForce: IOC, FOK", + "x-api-enum": [ + { + "value": "IOC", + "name": "", + "description": "" + }, + { + "value": "FOK", + "name": "", + "description": "" + } + ] + }, "symbol": { "type": "string", "description": "symbol, mandatory for isolated margin account", @@ -4013,29 +3425,28 @@ }, "required": [ "currency", - "size" + "size", + "timeInForce" ] }, - "example": "{\n \"currency\": \"USDT\",\n \"size\": 10\n}" + "example": "{\n \"currency\": \"USDT\",\n \"size\": 10,\n \"timeInForce\": \"FOK\",\n \"isIsolated\": false,\n \"isHf\": false\n}" } } }, - "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"timestamp\\\":1729655606816,\\\"orderNo\\\":\\\"671873361d5bd400075096ad\\\",\\\"actualSize\\\":\\\"10\\\"}}", - "x-request-example": "{\\\"currency\\\": \\\"USDT\\\", \\\"size\\\": 10}" - } - }, - "/api/v3/margin/interest": { + "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"orderNo\\\":\\\"67187162c0d6990007717b15\\\",\\\"actualSize\\\":\\\"10\\\"}}", + "x-request-example": "{\\\"currency\\\": \\\"USDT\\\", \\\"size\\\": 10, \\\"timeInForce\\\": \\\"FOK\\\", \\\"isIsolated\\\": false, \\\"isHf\\\": false}" + }, "get": { - "summary": "Get Interest History", + "summary": "Get Borrow History", "deprecated": false, - "description": "Request via this endpoint to get the interest records of the cross/isolated margin lending.", + "description": "This API endpoint is used to get the borrowing orders for cross and isolated margin accounts", "tags": [], "parameters": [ { "name": "currency", "in": "query", "description": "currency", - "required": false, + "required": true, "schema": { "type": "string", "example": [ @@ -4069,6 +3480,15 @@ ] } }, + { + "name": "orderNo", + "in": "query", + "description": "Borrow Order Id", + "required": false, + "schema": { + "type": "string" + } + }, { "name": "startTime", "in": "query", @@ -4151,28 +3571,70 @@ "items": { "type": "object", "properties": { + "orderNo": { + "type": "string", + "description": "Borrow Order Id" + }, + "symbol": { + "type": "string", + "description": "Isolated Margin symbol; empty for cross margin", + "example": [ + "BTC-USDT", + "ETH-USDT", + "KCS-USDT" + ] + }, "currency": { "type": "string", "description": "currency" }, - "dayRatio": { + "size": { "type": "string", - "description": "Daily interest rate" + "description": "Initiated borrow amount" }, - "interestAmount": { + "actualSize": { "type": "string", - "description": "Interest amount" + "description": "Actual borrow amount" + }, + "status": { + "type": "string", + "description": "PENDING: Processing, SUCCESS: Successful, FAILED: Failed", + "enum": [ + "PENDING", + "SUCCESS", + "FAILED" + ], + "x-api-enum": [ + { + "value": "PENDING", + "name": "", + "description": "" + }, + { + "value": "SUCCESS", + "name": "", + "description": "" + }, + { + "value": "FAILED", + "name": "", + "description": "" + } + ] }, "createdTime": { "type": "integer", - "description": "Interest Timestamp", + "description": "borrow time", "format": "int64" } }, "required": [ + "orderNo", + "symbol", "currency", - "dayRatio", - "interestAmount", + "size", + "actualSize", + "status", "createdTime" ] } @@ -4197,7 +3659,7 @@ } } }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470209", + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470207", "x-abandon": "normal", "x-domain": "Spot", "x-api-channel": "Private", @@ -4205,18 +3667,18 @@ "x-api-rate-limit-pool": "Spot", "x-sdk-service": "Margin", "x-sdk-sub-service": "Debit", - "x-sdk-method-name": "getInterestHistory", - "x-sdk-method-description": "Request via this endpoint to get the interest records of the cross/isolated margin lending.", - "x-api-rate-limit": 20, - "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"timestamp\\\":1729665170701,\\\"currentPage\\\":1,\\\"pageSize\\\":50,\\\"totalNum\\\":3,\\\"totalPage\\\":1,\\\"items\\\":[{\\\"currency\\\":\\\"USDT\\\",\\\"dayRatio\\\":\\\"0.000296\\\",\\\"interestAmount\\\":\\\"0.00000001\\\",\\\"createdTime\\\":1729663213375},{\\\"currency\\\":\\\"USDT\\\",\\\"dayRatio\\\":\\\"0.000296\\\",\\\"interestAmount\\\":\\\"0.00000001\\\",\\\"createdTime\\\":1729659618802},{\\\"currency\\\":\\\"USDT\\\",\\\"dayRatio\\\":\\\"0.000296\\\",\\\"interestAmount\\\":\\\"0.00000001\\\",\\\"createdTime\\\":1729656028077}]}}", - "x-request-example": "{\\\"currency\\\": \\\"BTC\\\", \\\"isIsolated\\\": true, \\\"symbol\\\": \\\"BTC-USDT\\\", \\\"startTime\\\": 123456, \\\"endTime\\\": 123456, \\\"currentPage\\\": 1, \\\"pageSize\\\": 50}" + "x-sdk-method-name": "getBorrowHistory", + "x-sdk-method-description": "This API endpoint is used to get the borrowing orders for cross and isolated margin accounts", + "x-api-rate-limit": 15, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"timestamp\\\": 1729657580449,\\n \\\"currentPage\\\": 1,\\n \\\"pageSize\\\": 50,\\n \\\"totalNum\\\": 2,\\n \\\"totalPage\\\": 1,\\n \\\"items\\\": [\\n {\\n \\\"orderNo\\\": \\\"67187162c0d6990007717b15\\\",\\n \\\"symbol\\\": null,\\n \\\"currency\\\": \\\"USDT\\\",\\n \\\"size\\\": \\\"10\\\",\\n \\\"actualSize\\\": \\\"10\\\",\\n \\\"status\\\": \\\"SUCCESS\\\",\\n \\\"createdTime\\\": 1729655138000\\n },\\n {\\n \\\"orderNo\\\": \\\"67187155b088e70007149585\\\",\\n \\\"symbol\\\": null,\\n \\\"currency\\\": \\\"USDT\\\",\\n \\\"size\\\": \\\"0.1\\\",\\n \\\"actualSize\\\": \\\"0\\\",\\n \\\"status\\\": \\\"FAILED\\\",\\n \\\"createdTime\\\": 1729655125000\\n }\\n ]\\n }\\n}", + "x-request-example": "{\\\"currency\\\": \\\"BTC\\\", \\\"isIsolated\\\": true, \\\"symbol\\\": \\\"BTC-USDT\\\", \\\"orderNo\\\": \\\"example_string_default_value\\\", \\\"startTime\\\": 123456, \\\"endTime\\\": 123456, \\\"currentPage\\\": 1, \\\"pageSize\\\": 50}" } }, - "/api/v3/position/update-user-leverage": { + "/api/v3/margin/repay": { "post": { - "summary": "Modify Leverage", + "summary": "Repay", "deprecated": false, - "description": "This endpoint allows modifying the leverage multiplier for cross margin or isolated margin.", + "description": "This API endpoint is used to initiate an application for cross or isolated margin repayment.", "tags": [], "parameters": [], "responses": { @@ -4231,7 +3693,26 @@ "type": "string" }, "data": { - "type": "string" + "type": "object", + "properties": { + "timestamp": { + "type": "integer", + "format": "int64" + }, + "orderNo": { + "type": "string", + "description": "Repay Order Id" + }, + "actualSize": { + "type": "string", + "description": "Actual repay amount" + } + }, + "required": [ + "timestamp", + "orderNo", + "actualSize" + ] } }, "required": [ @@ -4243,7 +3724,7 @@ } } }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470211", + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470210", "x-abandon": "normal", "x-domain": "Spot", "x-api-channel": "Private", @@ -4251,15 +3732,28 @@ "x-api-rate-limit-pool": "Spot", "x-sdk-service": "Margin", "x-sdk-sub-service": "Debit", - "x-sdk-method-name": "modifyLeverage", - "x-sdk-method-description": "This endpoint allows modifying the leverage multiplier for cross margin or isolated margin.", - "x-api-rate-limit": 5, + "x-sdk-method-name": "repay", + "x-sdk-method-description": "This API endpoint is used to initiate an application for cross or isolated margin repayment.", + "x-api-rate-limit": 10, "requestBody": { "content": { "application/json": { "schema": { "type": "object", "properties": { + "currency": { + "type": "string", + "description": "currency", + "example": [ + "BTC", + "ETH", + "USDT" + ] + }, + "size": { + "type": "number", + "description": "Borrow amount" + }, "symbol": { "type": "string", "description": "symbol, mandatory for isolated margin account", @@ -4274,139 +3768,28 @@ "description": "true-isolated, false-cross; default is false", "default": false }, - "leverage": { - "type": "string", - "description": "New leverage multiplier. Must be greater than 1 and up to two decimal places, and cannot be less than the user's current debt leverage or greater than the system's maximum leverage" - } - }, - "required": [ - "leverage" - ] - }, - "example": "{\n \"leverage\": \"5\"\n}" - } - } - }, - "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":null}", - "x-request-example": "{\\\"leverage\\\": \\\"5\\\"}" - } - }, - "/api/v3/project/list": { - "get": { - "summary": "Get Loan Market", - "deprecated": false, - "description": "This API endpoint is used to get the information about the currencies available for lending.", - "tags": [], - "parameters": [ - { - "name": "currency", - "in": "query", - "description": "currency", - "required": false, - "schema": { - "type": "string", - "example": [ - "BTC", - "ETH", - "KCS" - ] - } - } - ], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "data": { - "type": "array", - "items": { - "type": "object", - "properties": { - "currency": { - "type": "string", - "description": "Currency" - }, - "purchaseEnable": { - "type": "boolean", - "description": "Whether purchase is supported." - }, - "redeemEnable": { - "type": "boolean", - "description": "Whether redeem is supported." - }, - "increment": { - "type": "string", - "description": "Increment precision for purchase and redemption" - }, - "minPurchaseSize": { - "type": "string", - "description": "Minimum purchase amount" - }, - "minInterestRate": { - "type": "string", - "description": "Minimum lending rate" - }, - "maxInterestRate": { - "type": "string", - "description": "Maximum lending rate" - }, - "interestIncrement": { - "type": "string", - "description": "Increment precision for interest; default is 0.0001", - "default": "0.0001" - }, - "maxPurchaseSize": { - "type": "string", - "description": "Maximum purchase amount" - }, - "marketInterestRate": { - "type": "string", - "description": "Latest market lending rate" - }, - "autoPurchaseEnable": { - "type": "boolean", - "description": "Whether to allow automatic purchase: true: on, false: off" - } - } - } - } - }, - "required": [ - "code", - "data" - ] - } - } + "isHf": { + "type": "boolean", + "description": "true: high frequency borrowing, false: low frequency borrowing; default false", + "default": false + } + }, + "required": [ + "currency", + "size" + ] + }, + "example": "{\n \"currency\": \"USDT\",\n \"size\": 10\n}" } } }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470212", - "x-abandon": "normal", - "x-domain": "Spot", - "x-api-channel": "Private", - "x-api-permission": "General", - "x-api-rate-limit-pool": "Spot", - "x-sdk-service": "Margin", - "x-sdk-sub-service": "Credit", - "x-sdk-method-name": "getLoanMarket", - "x-sdk-method-description": "This API endpoint is used to get the information about the currencies available for lending.", - "x-api-rate-limit": 10, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": [\\n {\\n \\\"currency\\\": \\\"BTC\\\",\\n \\\"purchaseEnable\\\": true,\\n \\\"redeemEnable\\\": true,\\n \\\"increment\\\": \\\"0.00000001\\\",\\n \\\"minPurchaseSize\\\": \\\"0.001\\\",\\n \\\"maxPurchaseSize\\\": \\\"40\\\",\\n \\\"interestIncrement\\\": \\\"0.0001\\\",\\n \\\"minInterestRate\\\": \\\"0.005\\\",\\n \\\"marketInterestRate\\\": \\\"0.005\\\",\\n \\\"maxInterestRate\\\": \\\"0.32\\\",\\n \\\"autoPurchaseEnable\\\": false\\n }\\n ]\\n}", - "x-request-example": "{\\\"currency\\\": \\\"BTC\\\"}" - } - }, - "/api/v3/purchase/orders": { + "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"timestamp\\\":1729655606816,\\\"orderNo\\\":\\\"671873361d5bd400075096ad\\\",\\\"actualSize\\\":\\\"10\\\"}}", + "x-request-example": "{\\\"currency\\\": \\\"USDT\\\", \\\"size\\\": 10}" + }, "get": { - "summary": "Get Purchase Orders", + "summary": "Get Repay History", "deprecated": false, - "description": "This API endpoint provides pagination query for the purchase orders.", + "description": "This API endpoint is used to get the borrowing orders for cross and isolated margin accounts", "tags": [], "parameters": [ { @@ -4424,43 +3807,62 @@ } }, { - "name": "status", + "name": "isIsolated", "in": "query", - "description": "DONE-completed; PENDING-settling", - "required": true, + "description": "true-isolated, false-cross; default is false", + "required": false, + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "symbol", + "in": "query", + "description": "symbol, mandatory for isolated margin account", + "required": false, "schema": { "type": "string", - "enum": [ - "DONE", - "PENDING" - ], - "x-api-enum": [ - { - "value": "DONE", - "name": "", - "description": "" - }, - { - "value": "PENDING", - "name": "", - "description": "" - } + "example": [ + "BTC-USDT", + "ETH-USDT", + "KCS-USDT" ] } }, { - "name": "purchaseOrderNo", + "name": "orderNo", "in": "query", - "description": "", + "description": "Repay Order Id", "required": false, "schema": { "type": "string" } }, + { + "name": "startTime", + "in": "query", + "description": "The start and end times are not restricted. If the start time is empty or less than 1680278400000, the default value is set to 1680278400000 (April 1, 2023, 00:00:00)", + "required": false, + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "endTime", + "in": "query", + "description": "End time", + "required": false, + "schema": { + "type": "integer", + "format": "int64" + } + }, { "name": "currentPage", "in": "query", - "description": "Current page; default is 1", + "description": "Current query page, with a starting value of 1. Default:1\n", "required": false, "schema": { "type": "integer", @@ -4470,13 +3872,13 @@ { "name": "pageSize", "in": "query", - "description": "Page size; 1<=pageSize<=100; default is 50", + "description": "Number of results per page. Default is 50, minimum is 10, maximum is 500", "required": false, "schema": { "type": "integer", "default": 50, - "minimum": 1, - "maximum": 100 + "minimum": 10, + "maximum": 500 } } ], @@ -4494,96 +3896,102 @@ "data": { "type": "object", "properties": { + "timestamp": { + "type": "integer", + "format": "int64" + }, "currentPage": { "type": "integer", - "description": "Current Page" + "description": "current page" }, "pageSize": { "type": "integer", - "description": "Page Size" + "description": "page size" }, "totalNum": { "type": "integer", - "description": "Total Number" + "description": "total number" }, "totalPage": { "type": "integer", - "description": "Total Page" + "description": "total page" }, "items": { "type": "array", "items": { "type": "object", "properties": { - "currency": { + "orderNo": { "type": "string", - "description": "Currency", - "example": [ - "BTC", - "ETH", - "USDT" - ] + "description": "Repay Order Id" }, - "purchaseOrderNo": { + "symbol": { "type": "string", - "description": "Purchase order id" + "description": "Isolated Margin symbol; empty for cross margin" }, - "purchaseSize": { + "currency": { "type": "string", - "description": "Total purchase size" + "description": "currency" }, - "matchSize": { + "size": { "type": "string", - "description": "Executed size" + "description": "Amount of initiated repay" }, - "interestRate": { + "principal": { "type": "string", - "description": "Target annualized interest rate" + "description": "Amount of principal paid" }, - "incomeSize": { + "interest": { "type": "string", - "description": "Redeemed amount" - }, - "applyTime": { - "type": "integer", - "description": "Time of purchase", - "format": "int64" + "description": "Amount of interest paid" }, "status": { "type": "string", - "description": "Status: DONE-completed; PENDING-settling", + "description": "PENDING: Processing, SUCCESS: Successful, FAILED: Failed", "enum": [ - "DONE", - "PENDING" + "PENDING", + "SUCCESS", + "FAILED" ], "x-api-enum": [ { - "value": "DONE", + "value": "PENDING", "name": "", "description": "" }, { - "value": "PENDING", + "value": "SUCCESS", + "name": "", + "description": "" + }, + { + "value": "FAILED", "name": "", "description": "" } ] + }, + "createdTime": { + "type": "integer", + "description": "Repayment time", + "format": "int64" } }, "required": [ + "symbol", + "orderNo", "currency", - "purchaseOrderNo", - "purchaseSize", - "matchSize", - "interestRate", - "incomeSize", - "applyTime", - "status" + "size", + "principal", + "interest", + "status", + "createdTime" ] } } }, "required": [ + "timestamp", "currentPage", "pageSize", "totalNum", @@ -4601,33 +4009,33 @@ } } }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470213", + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470208", "x-abandon": "normal", "x-domain": "Spot", "x-api-channel": "Private", - "x-api-permission": "General", + "x-api-permission": "Margin", "x-api-rate-limit-pool": "Spot", "x-sdk-service": "Margin", - "x-sdk-sub-service": "Credit", - "x-sdk-method-name": "getPurchaseOrders", - "x-sdk-method-description": "This API endpoint provides pagination query for the purchase orders.", - "x-api-rate-limit": 10, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"currentPage\\\": 1,\\n \\\"pageSize\\\": 10,\\n \\\"totalNum\\\": 1,\\n \\\"totalPage\\\": 1,\\n \\\"items\\\": [\\n {\\n \\\"currency\\\": \\\"BTC\\\",\\n \\\"purchaseOrderNo\\\": \\\"671bb15a3b3f930007880bae\\\",\\n \\\"purchaseSize\\\": \\\"0.001\\\",\\n \\\"matchSize\\\": \\\"0\\\",\\n \\\"interestRate\\\": \\\"0.1\\\",\\n \\\"incomeSize\\\": \\\"0\\\",\\n \\\"applyTime\\\": 1729868122172,\\n \\\"status\\\": \\\"PENDING\\\"\\n }\\n ]\\n }\\n}", - "x-request-example": "{\\\"currency\\\": \\\"BTC\\\", \\\"status\\\": \\\"DONE\\\", \\\"purchaseOrderNo\\\": \\\"example_string_default_value\\\", \\\"currentPage\\\": 1, \\\"pageSize\\\": 50}" + "x-sdk-sub-service": "Debit", + "x-sdk-method-name": "getRepayHistory", + "x-sdk-method-description": "This API endpoint is used to get the borrowing orders for cross and isolated margin accounts", + "x-api-rate-limit": 15, + "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"timestamp\\\":1729663471891,\\\"currentPage\\\":1,\\\"pageSize\\\":50,\\\"totalNum\\\":1,\\\"totalPage\\\":1,\\\"items\\\":[{\\\"orderNo\\\":\\\"671873361d5bd400075096ad\\\",\\\"symbol\\\":null,\\\"currency\\\":\\\"USDT\\\",\\\"size\\\":\\\"10\\\",\\\"principal\\\":\\\"9.99986518\\\",\\\"interest\\\":\\\"0.00013482\\\",\\\"status\\\":\\\"SUCCESS\\\",\\\"createdTime\\\":1729655606000}]}}", + "x-request-example": "{\\\"currency\\\": \\\"BTC\\\", \\\"isIsolated\\\": true, \\\"symbol\\\": \\\"BTC-USDT\\\", \\\"orderNo\\\": \\\"example_string_default_value\\\", \\\"startTime\\\": 123456, \\\"endTime\\\": 123456, \\\"currentPage\\\": 1, \\\"pageSize\\\": 50}" } }, - "/api/v3/redeem/orders": { + "/api/v3/margin/interest": { "get": { - "summary": "Get Redeem Orders", + "summary": "Get Interest History", "deprecated": false, - "description": "This API endpoint provides pagination query for the redeem orders.", + "description": "Request via this endpoint to get the interest records of the cross/isolated margin lending.", "tags": [], "parameters": [ { "name": "currency", "in": "query", "description": "currency", - "required": true, + "required": false, "schema": { "type": "string", "example": [ @@ -4638,43 +4046,53 @@ } }, { - "name": "status", + "name": "isIsolated", "in": "query", - "description": "DONE-completed; PENDING-settling", - "required": true, + "description": "true-isolated, false-cross; default is false", + "required": false, + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "symbol", + "in": "query", + "description": "symbol, mandatory for isolated margin account", + "required": false, "schema": { "type": "string", - "enum": [ - "DONE", - "PENDING" - ], - "x-api-enum": [ - { - "value": "DONE", - "name": "", - "description": "" - }, - { - "value": "PENDING", - "name": "", - "description": "" - } + "example": [ + "BTC-USDT", + "ETH-USDT", + "KCS-USDT" ] } }, { - "name": "redeemOrderNo", + "name": "startTime", "in": "query", - "description": "Redeem order id", + "description": "The start and end times are not restricted. If the start time is empty or less than 1680278400000, the default value is set to 1680278400000 (April 1, 2023, 00:00:00)", "required": false, "schema": { - "type": "string" + "type": "integer", + "format": "int64" + } + }, + { + "name": "endTime", + "in": "query", + "description": "End time", + "required": false, + "schema": { + "type": "integer", + "format": "int64" } }, { "name": "currentPage", "in": "query", - "description": "Current page; default is 1", + "description": "Current query page, with a starting value of 1. Default:1\n", "required": false, "schema": { "type": "integer", @@ -4684,13 +4102,13 @@ { "name": "pageSize", "in": "query", - "description": "Page size; 1<=pageSize<=100; default is 50", + "description": "Number of results per page. Default is 50, minimum is 10, maximum is 500", "required": false, "schema": { "type": "integer", "default": 50, - "minimum": 1, - "maximum": 100 + "minimum": 10, + "maximum": 500 } } ], @@ -4708,21 +4126,25 @@ "data": { "type": "object", "properties": { + "timestamp": { + "type": "integer", + "format": "int64" + }, "currentPage": { "type": "integer", - "description": "Current Page" + "description": "current page" }, "pageSize": { "type": "integer", - "description": "Page Size" + "description": "page size" }, "totalNum": { "type": "integer", - "description": "Total Number" + "description": "total number" }, "totalPage": { "type": "integer", - "description": "Total Page" + "description": "total page" }, "items": { "type": "array", @@ -4731,57 +4153,229 @@ "properties": { "currency": { "type": "string", - "description": "Currency", - "example": [ - "BTC", - "ETH", - "USDT" - ] - }, - "purchaseOrderNo": { - "type": "string", - "description": "Purchase order id" - }, - "redeemOrderNo": { - "type": "string", - "description": "Redeem order id" - }, - "redeemSize": { - "type": "string", - "description": "Redemption size" + "description": "currency" }, - "receiptSize": { + "dayRatio": { "type": "string", - "description": "Redeemed size" + "description": "Daily interest rate" }, - "applyTime": { + "interestAmount": { "type": "string", - "description": "Time of redeem" + "description": "Interest amount" }, - "status": { - "type": "string", - "description": "Status: DONE-completed; PENDING-settling" + "createdTime": { + "type": "integer", + "description": "Interest Timestamp", + "format": "int64" } }, "required": [ "currency", - "purchaseOrderNo", - "redeemOrderNo", - "redeemSize", - "receiptSize", - "applyTime", - "status" + "dayRatio", + "interestAmount", + "createdTime" ] } } - }, - "required": [ - "currentPage", - "pageSize", - "totalNum", - "totalPage", - "items" - ] + }, + "required": [ + "timestamp", + "currentPage", + "pageSize", + "totalNum", + "totalPage", + "items" + ] + } + }, + "required": [ + "code", + "data" + ] + } + } + } + } + }, + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470209", + "x-abandon": "normal", + "x-domain": "Spot", + "x-api-channel": "Private", + "x-api-permission": "Margin", + "x-api-rate-limit-pool": "Spot", + "x-sdk-service": "Margin", + "x-sdk-sub-service": "Debit", + "x-sdk-method-name": "getInterestHistory", + "x-sdk-method-description": "Request via this endpoint to get the interest records of the cross/isolated margin lending.", + "x-api-rate-limit": 20, + "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"timestamp\\\":1729665170701,\\\"currentPage\\\":1,\\\"pageSize\\\":50,\\\"totalNum\\\":3,\\\"totalPage\\\":1,\\\"items\\\":[{\\\"currency\\\":\\\"USDT\\\",\\\"dayRatio\\\":\\\"0.000296\\\",\\\"interestAmount\\\":\\\"0.00000001\\\",\\\"createdTime\\\":1729663213375},{\\\"currency\\\":\\\"USDT\\\",\\\"dayRatio\\\":\\\"0.000296\\\",\\\"interestAmount\\\":\\\"0.00000001\\\",\\\"createdTime\\\":1729659618802},{\\\"currency\\\":\\\"USDT\\\",\\\"dayRatio\\\":\\\"0.000296\\\",\\\"interestAmount\\\":\\\"0.00000001\\\",\\\"createdTime\\\":1729656028077}]}}", + "x-request-example": "{\\\"currency\\\": \\\"BTC\\\", \\\"isIsolated\\\": true, \\\"symbol\\\": \\\"BTC-USDT\\\", \\\"startTime\\\": 123456, \\\"endTime\\\": 123456, \\\"currentPage\\\": 1, \\\"pageSize\\\": 50}" + } + }, + "/api/v3/position/update-user-leverage": { + "post": { + "summary": "Modify Leverage", + "deprecated": false, + "description": "This endpoint allows modifying the leverage multiplier for cross margin or isolated margin.", + "tags": [], + "parameters": [], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "string" + } + }, + "required": [ + "code", + "data" + ] + } + } + } + } + }, + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470211", + "x-abandon": "normal", + "x-domain": "Spot", + "x-api-channel": "Private", + "x-api-permission": "Margin", + "x-api-rate-limit-pool": "Spot", + "x-sdk-service": "Margin", + "x-sdk-sub-service": "Debit", + "x-sdk-method-name": "modifyLeverage", + "x-sdk-method-description": "This endpoint allows modifying the leverage multiplier for cross margin or isolated margin.", + "x-api-rate-limit": 5, + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "symbol": { + "type": "string", + "description": "symbol, mandatory for isolated margin account", + "example": [ + "BTC-USDT", + "ETH-USDT", + "KCS-USDT" + ] + }, + "isIsolated": { + "type": "boolean", + "description": "true-isolated, false-cross; default is false", + "default": false + }, + "leverage": { + "type": "string", + "description": "New leverage multiplier. Must be greater than 1 and up to two decimal places, and cannot be less than the user's current debt leverage or greater than the system's maximum leverage" + } + }, + "required": [ + "leverage" + ] + }, + "example": "{\n \"leverage\": \"5\"\n}" + } + } + }, + "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":null}", + "x-request-example": "{\\\"leverage\\\": \\\"5\\\"}" + } + }, + "/api/v3/project/list": { + "get": { + "summary": "Get Loan Market", + "deprecated": false, + "description": "This API endpoint is used to get the information about the currencies available for lending.", + "tags": [], + "parameters": [ + { + "name": "currency", + "in": "query", + "description": "currency", + "required": false, + "schema": { + "type": "string", + "example": [ + "BTC", + "ETH", + "KCS" + ] + } + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "array", + "items": { + "type": "object", + "properties": { + "currency": { + "type": "string", + "description": "Currency" + }, + "purchaseEnable": { + "type": "boolean", + "description": "Whether purchase is supported." + }, + "redeemEnable": { + "type": "boolean", + "description": "Whether redeem is supported." + }, + "increment": { + "type": "string", + "description": "Increment precision for purchase and redemption" + }, + "minPurchaseSize": { + "type": "string", + "description": "Minimum purchase amount" + }, + "minInterestRate": { + "type": "string", + "description": "Minimum lending rate" + }, + "maxInterestRate": { + "type": "string", + "description": "Maximum lending rate" + }, + "interestIncrement": { + "type": "string", + "description": "Increment precision for interest; default is 0.0001", + "default": "0.0001" + }, + "maxPurchaseSize": { + "type": "string", + "description": "Maximum purchase amount" + }, + "marketInterestRate": { + "type": "string", + "description": "Latest market lending rate" + }, + "autoPurchaseEnable": { + "type": "boolean", + "description": "Whether to allow automatic purchase: true: on, false: off" + } + } + } } }, "required": [ @@ -4793,7 +4387,7 @@ } } }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470214", + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470212", "x-abandon": "normal", "x-domain": "Spot", "x-api-channel": "Private", @@ -4801,11 +4395,11 @@ "x-api-rate-limit-pool": "Spot", "x-sdk-service": "Margin", "x-sdk-sub-service": "Credit", - "x-sdk-method-name": "getRedeemOrders", - "x-sdk-method-description": "This API endpoint provides pagination query for the redeem orders.", + "x-sdk-method-name": "getLoanMarket", + "x-sdk-method-description": "This API endpoint is used to get the information about the currencies available for lending.", "x-api-rate-limit": 10, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"currentPage\\\": 1,\\n \\\"pageSize\\\": 10,\\n \\\"totalNum\\\": 1,\\n \\\"totalPage\\\": 1,\\n \\\"items\\\": [\\n {\\n \\\"currency\\\": \\\"BTC\\\",\\n \\\"purchaseOrderNo\\\": \\\"671bafa804c26d000773c533\\\",\\n \\\"redeemOrderNo\\\": \\\"671bb01004c26d000773c55c\\\",\\n \\\"redeemSize\\\": \\\"0.001\\\",\\n \\\"receiptSize\\\": \\\"0.001\\\",\\n \\\"applyTime\\\": null,\\n \\\"status\\\": \\\"DONE\\\"\\n }\\n ]\\n }\\n}", - "x-request-example": "{\\\"currency\\\": \\\"BTC\\\", \\\"status\\\": \\\"DONE\\\", \\\"redeemOrderNo\\\": \\\"example_string_default_value\\\", \\\"currentPage\\\": 1, \\\"pageSize\\\": 50}" + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": [\\n {\\n \\\"currency\\\": \\\"BTC\\\",\\n \\\"purchaseEnable\\\": true,\\n \\\"redeemEnable\\\": true,\\n \\\"increment\\\": \\\"0.00000001\\\",\\n \\\"minPurchaseSize\\\": \\\"0.001\\\",\\n \\\"maxPurchaseSize\\\": \\\"40\\\",\\n \\\"interestIncrement\\\": \\\"0.0001\\\",\\n \\\"minInterestRate\\\": \\\"0.005\\\",\\n \\\"marketInterestRate\\\": \\\"0.005\\\",\\n \\\"maxInterestRate\\\": \\\"0.32\\\",\\n \\\"autoPurchaseEnable\\\": false\\n }\\n ]\\n}", + "x-request-example": "{\\\"currency\\\": \\\"BTC\\\"}" } }, "/api/v3/project/marketInterestRate": { @@ -5006,53 +4600,267 @@ } } }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470217", + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470217", + "x-abandon": "normal", + "x-domain": "Spot", + "x-api-channel": "Private", + "x-api-permission": "Margin", + "x-api-rate-limit-pool": "Spot", + "x-sdk-service": "Margin", + "x-sdk-sub-service": "Credit", + "x-sdk-method-name": "modifyPurchase", + "x-sdk-method-description": "This API endpoint is used to update the interest rates of subscription orders, which will take effect at the beginning of the next hour.,Please ensure that the funds are in the main(funding) account", + "x-api-rate-limit": 10, + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "currency": { + "type": "string", + "description": "Currency", + "example": [ + "BTC", + "ETH", + "USDT" + ] + }, + "interestRate": { + "type": "string", + "description": "Modified purchase interest rate" + }, + "purchaseOrderNo": { + "type": "string", + "description": "Purchase order id" + } + }, + "required": [ + "currency", + "purchaseOrderNo", + "interestRate" + ] + }, + "example": "{\n \"currency\": \"BTC\",\n \"purchaseOrderNo\": \"671bafa804c26d000773c533\",\n \"interestRate\": \"0.09\"\n}" + } + } + }, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": null\\n}", + "x-request-example": "{\\\"currency\\\": \\\"BTC\\\", \\\"purchaseOrderNo\\\": \\\"671bafa804c26d000773c533\\\", \\\"interestRate\\\": \\\"0.09\\\"}" + } + }, + "/api/v3/purchase/orders": { + "get": { + "summary": "Get Purchase Orders", + "deprecated": false, + "description": "This API endpoint provides pagination query for the purchase orders.", + "tags": [], + "parameters": [ + { + "name": "currency", + "in": "query", + "description": "currency", + "required": true, + "schema": { + "type": "string", + "example": [ + "BTC", + "ETH", + "KCS" + ] + } + }, + { + "name": "status", + "in": "query", + "description": "DONE-completed; PENDING-settling", + "required": true, + "schema": { + "type": "string", + "enum": [ + "DONE", + "PENDING" + ], + "x-api-enum": [ + { + "value": "DONE", + "name": "", + "description": "" + }, + { + "value": "PENDING", + "name": "", + "description": "" + } + ] + } + }, + { + "name": "purchaseOrderNo", + "in": "query", + "description": "", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "currentPage", + "in": "query", + "description": "Current page; default is 1", + "required": false, + "schema": { + "type": "integer", + "default": 1 + } + }, + { + "name": "pageSize", + "in": "query", + "description": "Page size; 1<=pageSize<=100; default is 50", + "required": false, + "schema": { + "type": "integer", + "default": 50, + "minimum": 1, + "maximum": 100 + } + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "object", + "properties": { + "currentPage": { + "type": "integer", + "description": "Current Page" + }, + "pageSize": { + "type": "integer", + "description": "Page Size" + }, + "totalNum": { + "type": "integer", + "description": "Total Number" + }, + "totalPage": { + "type": "integer", + "description": "Total Page" + }, + "items": { + "type": "array", + "items": { + "type": "object", + "properties": { + "currency": { + "type": "string", + "description": "Currency", + "example": [ + "BTC", + "ETH", + "USDT" + ] + }, + "purchaseOrderNo": { + "type": "string", + "description": "Purchase order id" + }, + "purchaseSize": { + "type": "string", + "description": "Total purchase size" + }, + "matchSize": { + "type": "string", + "description": "Executed size" + }, + "interestRate": { + "type": "string", + "description": "Target annualized interest rate" + }, + "incomeSize": { + "type": "string", + "description": "Redeemed amount" + }, + "applyTime": { + "type": "integer", + "description": "Time of purchase", + "format": "int64" + }, + "status": { + "type": "string", + "description": "Status: DONE-completed; PENDING-settling", + "enum": [ + "DONE", + "PENDING" + ], + "x-api-enum": [ + { + "value": "DONE", + "name": "", + "description": "" + }, + { + "value": "PENDING", + "name": "", + "description": "" + } + ] + } + }, + "required": [ + "currency", + "purchaseOrderNo", + "purchaseSize", + "matchSize", + "interestRate", + "incomeSize", + "applyTime", + "status" + ] + } + } + }, + "required": [ + "currentPage", + "pageSize", + "totalNum", + "totalPage", + "items" + ] + } + }, + "required": [ + "code", + "data" + ] + } + } + } + } + }, + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470213", "x-abandon": "normal", "x-domain": "Spot", "x-api-channel": "Private", - "x-api-permission": "Margin", + "x-api-permission": "General", "x-api-rate-limit-pool": "Spot", "x-sdk-service": "Margin", "x-sdk-sub-service": "Credit", - "x-sdk-method-name": "modifyPurchase", - "x-sdk-method-description": "This API endpoint is used to update the interest rates of subscription orders, which will take effect at the beginning of the next hour.,Please ensure that the funds are in the main(funding) account", + "x-sdk-method-name": "getPurchaseOrders", + "x-sdk-method-description": "This API endpoint provides pagination query for the purchase orders.", "x-api-rate-limit": 10, - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "currency": { - "type": "string", - "description": "Currency", - "example": [ - "BTC", - "ETH", - "USDT" - ] - }, - "interestRate": { - "type": "string", - "description": "Modified purchase interest rate" - }, - "purchaseOrderNo": { - "type": "string", - "description": "Purchase order id" - } - }, - "required": [ - "currency", - "purchaseOrderNo", - "interestRate" - ] - }, - "example": "{\n \"currency\": \"BTC\",\n \"purchaseOrderNo\": \"671bafa804c26d000773c533\",\n \"interestRate\": \"0.09\"\n}" - } - } - }, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": null\\n}", - "x-request-example": "{\\\"currency\\\": \\\"BTC\\\", \\\"purchaseOrderNo\\\": \\\"671bafa804c26d000773c533\\\", \\\"interestRate\\\": \\\"0.09\\\"}" + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"currentPage\\\": 1,\\n \\\"pageSize\\\": 10,\\n \\\"totalNum\\\": 1,\\n \\\"totalPage\\\": 1,\\n \\\"items\\\": [\\n {\\n \\\"currency\\\": \\\"BTC\\\",\\n \\\"purchaseOrderNo\\\": \\\"671bb15a3b3f930007880bae\\\",\\n \\\"purchaseSize\\\": \\\"0.001\\\",\\n \\\"matchSize\\\": \\\"0\\\",\\n \\\"interestRate\\\": \\\"0.1\\\",\\n \\\"incomeSize\\\": \\\"0\\\",\\n \\\"applyTime\\\": 1729868122172,\\n \\\"status\\\": \\\"PENDING\\\"\\n }\\n ]\\n }\\n}", + "x-request-example": "{\\\"currency\\\": \\\"BTC\\\", \\\"status\\\": \\\"DONE\\\", \\\"purchaseOrderNo\\\": \\\"example_string_default_value\\\", \\\"currentPage\\\": 1, \\\"pageSize\\\": 50}" } }, "/api/v3/redeem": { @@ -5144,6 +4952,198 @@ "x-request-example": "{\\\"currency\\\": \\\"BTC\\\", \\\"size\\\": \\\"0.001\\\", \\\"purchaseOrderNo\\\": \\\"671bafa804c26d000773c533\\\"}" } }, + "/api/v3/redeem/orders": { + "get": { + "summary": "Get Redeem Orders", + "deprecated": false, + "description": "This API endpoint provides pagination query for the redeem orders.", + "tags": [], + "parameters": [ + { + "name": "currency", + "in": "query", + "description": "currency", + "required": true, + "schema": { + "type": "string", + "example": [ + "BTC", + "ETH", + "KCS" + ] + } + }, + { + "name": "status", + "in": "query", + "description": "DONE-completed; PENDING-settling", + "required": true, + "schema": { + "type": "string", + "enum": [ + "DONE", + "PENDING" + ], + "x-api-enum": [ + { + "value": "DONE", + "name": "", + "description": "" + }, + { + "value": "PENDING", + "name": "", + "description": "" + } + ] + } + }, + { + "name": "redeemOrderNo", + "in": "query", + "description": "Redeem order id", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "currentPage", + "in": "query", + "description": "Current page; default is 1", + "required": false, + "schema": { + "type": "integer", + "default": 1 + } + }, + { + "name": "pageSize", + "in": "query", + "description": "Page size; 1<=pageSize<=100; default is 50", + "required": false, + "schema": { + "type": "integer", + "default": 50, + "minimum": 1, + "maximum": 100 + } + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "object", + "properties": { + "currentPage": { + "type": "integer", + "description": "Current Page" + }, + "pageSize": { + "type": "integer", + "description": "Page Size" + }, + "totalNum": { + "type": "integer", + "description": "Total Number" + }, + "totalPage": { + "type": "integer", + "description": "Total Page" + }, + "items": { + "type": "array", + "items": { + "type": "object", + "properties": { + "currency": { + "type": "string", + "description": "Currency", + "example": [ + "BTC", + "ETH", + "USDT" + ] + }, + "purchaseOrderNo": { + "type": "string", + "description": "Purchase order id" + }, + "redeemOrderNo": { + "type": "string", + "description": "Redeem order id" + }, + "redeemSize": { + "type": "string", + "description": "Redemption size" + }, + "receiptSize": { + "type": "string", + "description": "Redeemed size" + }, + "applyTime": { + "type": "string", + "description": "Time of redeem" + }, + "status": { + "type": "string", + "description": "Status: DONE-completed; PENDING-settling" + } + }, + "required": [ + "currency", + "purchaseOrderNo", + "redeemOrderNo", + "redeemSize", + "receiptSize", + "applyTime", + "status" + ] + } + } + }, + "required": [ + "currentPage", + "pageSize", + "totalNum", + "totalPage", + "items" + ] + } + }, + "required": [ + "code", + "data" + ] + } + } + } + } + }, + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470214", + "x-abandon": "normal", + "x-domain": "Spot", + "x-api-channel": "Private", + "x-api-permission": "General", + "x-api-rate-limit-pool": "Spot", + "x-sdk-service": "Margin", + "x-sdk-sub-service": "Credit", + "x-sdk-method-name": "getRedeemOrders", + "x-sdk-method-description": "This API endpoint provides pagination query for the redeem orders.", + "x-api-rate-limit": 10, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"currentPage\\\": 1,\\n \\\"pageSize\\\": 10,\\n \\\"totalNum\\\": 1,\\n \\\"totalPage\\\": 1,\\n \\\"items\\\": [\\n {\\n \\\"currency\\\": \\\"BTC\\\",\\n \\\"purchaseOrderNo\\\": \\\"671bafa804c26d000773c533\\\",\\n \\\"redeemOrderNo\\\": \\\"671bb01004c26d000773c55c\\\",\\n \\\"redeemSize\\\": \\\"0.001\\\",\\n \\\"receiptSize\\\": \\\"0.001\\\",\\n \\\"applyTime\\\": null,\\n \\\"status\\\": \\\"DONE\\\"\\n }\\n ]\\n }\\n}", + "x-request-example": "{\\\"currency\\\": \\\"BTC\\\", \\\"status\\\": \\\"DONE\\\", \\\"redeemOrderNo\\\": \\\"example_string_default_value\\\", \\\"currentPage\\\": 1, \\\"pageSize\\\": 50}" + } + }, "/api/v3/margin/currencies": { "get": { "summary": "Get Margin Risk Limit", diff --git a/spec/rest/entry/openapi-spot.json b/spec/rest/entry/openapi-spot.json index f2163119..21c72ce2 100644 --- a/spec/rest/entry/openapi-spot.json +++ b/spec/rest/entry/openapi-spot.json @@ -7,3827 +7,1448 @@ }, "tags": [], "paths": { - "/api/v3/currencies": { - "get": { - "summary": "Get All Currencies", - "deprecated": false, - "description": "Request via this endpoint to get the currency list.Not all currencies currently can be used for trading.", - "tags": [], - "parameters": [], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "data": { - "type": "array", - "items": { - "type": "object", - "properties": { - "currency": { - "type": "string", - "description": "A unique currency code that will never change" - }, - "name": { - "type": "string", - "description": "Currency name, will change after renaming" - }, - "fullName": { - "type": "string", - "description": "Full name of a currency, will change after renaming" - }, - "precision": { - "type": "integer", - "description": "Currency precision" - }, - "confirms": { - "type": "integer", - "description": "Number of block confirmations" - }, - "contractAddress": { - "type": "string", - "description": "Contract address" - }, - "isMarginEnabled": { - "type": "boolean", - "description": "Support margin or not" - }, - "isDebitEnabled": { - "type": "boolean", - "description": "Support debit or not" - }, - "chains": { - "type": "array", - "items": { - "type": "object", - "properties": { - "chainName": { - "type": "string", - "description": "chain name of currency" - }, - "withdrawalMinSize": { - "type": "string", - "description": "Minimum withdrawal amount" - }, - "depositMinSize": { - "type": "string", - "description": "Minimum deposit amount" - }, - "withdrawFeeRate": { - "type": "string", - "description": "withdraw fee rate" - }, - "withdrawalMinFee": { - "type": "string", - "description": "Minimum fees charged for withdrawal" - }, - "isWithdrawEnabled": { - "type": "boolean", - "description": "Support withdrawal or not" - }, - "isDepositEnabled": { - "type": "boolean", - "description": "Support deposit or not" - }, - "confirms": { - "type": "integer", - "description": "Number of block confirmations" - }, - "preConfirms": { - "type": "integer", - "description": "The number of blocks (confirmations) for advance on-chain verification" - }, - "contractAddress": { - "type": "string", - "description": "Contract address" - }, - "withdrawPrecision": { - "type": "integer", - "description": "Withdrawal precision bit, indicating the maximum supported length after the decimal point of the withdrawal amount" - }, - "maxWithdraw": { - "type": "string", - "description": "Maximum amount of single withdrawal" - }, - "maxDeposit": { - "type": "string", - "description": "Maximum amount of single deposit (only applicable to Lightning Network)" - }, - "needTag": { - "type": "boolean", - "description": "whether memo/tag is needed" - }, - "chainId": { - "type": "string", - "description": "chain id of currency" - }, - "depositFeeRate": { - "type": "string", - "description": "deposit fee rate (some currencies have this param, the default is empty)" - }, - "withdrawMaxFee": { - "type": "string", - "description": "withdraw max fee(some currencies have this param, the default is empty)" - }, - "depositTierFee": { - "type": "string" - } - }, - "required": [ - "chainName", - "withdrawalMinSize", - "depositMinSize", - "withdrawFeeRate", - "withdrawalMinFee", - "isWithdrawEnabled", - "isDepositEnabled", - "confirms", - "preConfirms", - "contractAddress", - "withdrawPrecision", - "maxWithdraw", - "maxDeposit", - "needTag", - "chainId" - ] - }, - "description": "chain list" - } - }, - "required": [ - "currency", - "name", - "fullName", - "precision", - "confirms", - "contractAddress", - "isMarginEnabled", - "isDebitEnabled", - "chains" - ] - } - } - }, - "required": [ - "code", - "data" - ] - } - } - } - } - }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470152", - "x-abandon": "normal", - "x-domain": "Spot", - "x-api-channel": "Public", - "x-api-permission": "NULL", - "x-api-rate-limit-pool": "Public", - "x-sdk-service": "Spot", - "x-sdk-sub-service": "Market", - "x-sdk-method-name": "getAllCurrencies", - "x-sdk-method-description": "Request via this endpoint to get the currency list.Not all currencies currently can be used for trading.", - "x-api-rate-limit": 3, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": [\\n {\\n \\\"currency\\\": \\\"BTC\\\",\\n \\\"name\\\": \\\"BTC\\\",\\n \\\"fullName\\\": \\\"Bitcoin\\\",\\n \\\"precision\\\": 8,\\n \\\"confirms\\\": null,\\n \\\"contractAddress\\\": null,\\n \\\"isMarginEnabled\\\": true,\\n \\\"isDebitEnabled\\\": true,\\n \\\"chains\\\": [\\n {\\n \\\"chainName\\\": \\\"BTC\\\",\\n \\\"withdrawalMinSize\\\": \\\"0.001\\\",\\n \\\"depositMinSize\\\": \\\"0.0002\\\",\\n \\\"withdrawFeeRate\\\": \\\"0\\\",\\n \\\"withdrawalMinFee\\\": \\\"0.0005\\\",\\n \\\"isWithdrawEnabled\\\": true,\\n \\\"isDepositEnabled\\\": true,\\n \\\"confirms\\\": 3,\\n \\\"preConfirms\\\": 1,\\n \\\"contractAddress\\\": \\\"\\\",\\n \\\"withdrawPrecision\\\": 8,\\n \\\"maxWithdraw\\\": null,\\n \\\"maxDeposit\\\": null,\\n \\\"needTag\\\": false,\\n \\\"chainId\\\": \\\"btc\\\"\\n },\\n {\\n \\\"chainName\\\": \\\"Lightning Network\\\",\\n \\\"withdrawalMinSize\\\": \\\"0.00001\\\",\\n \\\"depositMinSize\\\": \\\"0.00001\\\",\\n \\\"withdrawFeeRate\\\": \\\"0\\\",\\n \\\"withdrawalMinFee\\\": \\\"0.000015\\\",\\n \\\"isWithdrawEnabled\\\": true,\\n \\\"isDepositEnabled\\\": true,\\n \\\"confirms\\\": 1,\\n \\\"preConfirms\\\": 1,\\n \\\"contractAddress\\\": \\\"\\\",\\n \\\"withdrawPrecision\\\": 8,\\n \\\"maxWithdraw\\\": null,\\n \\\"maxDeposit\\\": \\\"0.03\\\",\\n \\\"needTag\\\": false,\\n \\\"chainId\\\": \\\"btcln\\\"\\n },\\n {\\n \\\"chainName\\\": \\\"KCC\\\",\\n \\\"withdrawalMinSize\\\": \\\"0.0008\\\",\\n \\\"depositMinSize\\\": null,\\n \\\"withdrawFeeRate\\\": \\\"0\\\",\\n \\\"withdrawalMinFee\\\": \\\"0.00002\\\",\\n \\\"isWithdrawEnabled\\\": true,\\n \\\"isDepositEnabled\\\": true,\\n \\\"confirms\\\": 20,\\n \\\"preConfirms\\\": 20,\\n \\\"contractAddress\\\": \\\"0xfa93c12cd345c658bc4644d1d4e1b9615952258c\\\",\\n \\\"withdrawPrecision\\\": 8,\\n \\\"maxWithdraw\\\": null,\\n \\\"maxDeposit\\\": null,\\n \\\"needTag\\\": false,\\n \\\"chainId\\\": \\\"kcc\\\"\\n },\\n {\\n \\\"chainName\\\": \\\"BTC-Segwit\\\",\\n \\\"withdrawalMinSize\\\": \\\"0.0008\\\",\\n \\\"depositMinSize\\\": \\\"0.0002\\\",\\n \\\"withdrawFeeRate\\\": \\\"0\\\",\\n \\\"withdrawalMinFee\\\": \\\"0.0005\\\",\\n \\\"isWithdrawEnabled\\\": false,\\n \\\"isDepositEnabled\\\": true,\\n \\\"confirms\\\": 2,\\n \\\"preConfirms\\\": 2,\\n \\\"contractAddress\\\": \\\"\\\",\\n \\\"withdrawPrecision\\\": 8,\\n \\\"maxWithdraw\\\": null,\\n \\\"maxDeposit\\\": null,\\n \\\"needTag\\\": false,\\n \\\"chainId\\\": \\\"bech32\\\"\\n }\\n ]\\n },\\n {\\n \\\"currency\\\": \\\"BTCP\\\",\\n \\\"name\\\": \\\"BTCP\\\",\\n \\\"fullName\\\": \\\"Bitcoin Private\\\",\\n \\\"precision\\\": 8,\\n \\\"confirms\\\": null,\\n \\\"contractAddress\\\": null,\\n \\\"isMarginEnabled\\\": false,\\n \\\"isDebitEnabled\\\": false,\\n \\\"chains\\\": [\\n {\\n \\\"chainName\\\": \\\"BTCP\\\",\\n \\\"withdrawalMinSize\\\": \\\"0.100000\\\",\\n \\\"depositMinSize\\\": null,\\n \\\"withdrawFeeRate\\\": \\\"0\\\",\\n \\\"withdrawalMinFee\\\": \\\"0.010000\\\",\\n \\\"isWithdrawEnabled\\\": false,\\n \\\"isDepositEnabled\\\": false,\\n \\\"confirms\\\": 6,\\n \\\"preConfirms\\\": 6,\\n \\\"contractAddress\\\": \\\"\\\",\\n \\\"withdrawPrecision\\\": 8,\\n \\\"maxWithdraw\\\": null,\\n \\\"maxDeposit\\\": null,\\n \\\"needTag\\\": false,\\n \\\"chainId\\\": \\\"btcp\\\"\\n }\\n ]\\n }\\n ]\\n}" - } - }, - "/api/v1/prices": { + "/api/v3/announcements": { "get": { - "summary": "Get Fiat Price", + "summary": "Get Announcements", "deprecated": false, - "description": "Request via this endpoint to get the fiat price of the currencies for the available trading pairs.", + "description": "This interface can obtain the latest news announcements, and the default page search is for announcements within a month.", "tags": [], "parameters": [ { - "name": "base", + "name": "currentPage", "in": "query", - "description": "Ticker symbol of a base currency,eg.USD,EUR. Default is USD", + "description": "page number", "required": false, "schema": { - "type": "string", - "default": "USD", - "example": [ - "USD", - "EUR" - ] + "type": "integer", + "format": "int64" } }, { - "name": "currencies", + "name": "pageSize", "in": "query", - "description": "Comma-separated cryptocurrencies to be converted into fiat, e.g.: BTC,ETH, etc. Default to return the fiat price of all currencies.", + "description": "page Size", "required": false, "schema": { - "type": "string" + "type": "integer", + "format": "int64" } - } - ], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "data": { - "type": "object", - "properties": { - "AGLD": { - "type": "string" - }, - "DFI": { - "type": "string" - }, - "PYTHUP": { - "type": "string" - }, - "ISLM": { - "type": "string" - }, - "NEAR": { - "type": "string" - }, - "AIOZ": { - "type": "string" - }, - "AUDIO": { - "type": "string" - }, - "BBL": { - "type": "string" - }, - "WLD": { - "type": "string" + }, + { + "name": "annType", + "in": "query", + "description": "Announcement types: latest-announcements , activities (latest activities), new-listings (new currency online), product-updates (product updates), vip (institutions and VIPs), maintenance-updates (system maintenance), product -updates (product news), delistings (currency offline), others, api-campaigns (API user activities), default : latest-announcements", + "required": false, + "schema": { + "type": "string", + "enum": [ + "latest-announcements ", + "activities ", + "product-updates ", + "vip ", + "maintenance-updates", + "delistings ", + "others", + "api-campaigns ", + "new-listings" + ], + "default": "latest-announcements", + "x-api-enum": [ + { + "value": "latest-announcements ", + "name": "LATEST-ANNOUNCEMENTS", + "description": "latest-announcements" + }, + { + "value": "activities ", + "name": "ACTIVITIES", + "description": "latest activities" + }, + { + "value": "product-updates ", + "name": "PRODUCT-UPDATES", + "description": "product updates" + }, + { + "value": "vip ", + "name": "VIPS", + "description": "institutions and VIPs" + }, + { + "value": "maintenance-updates", + "name": "MAINTENANCE-UPDATE", + "description": "system maintenance" + }, + { + "value": "delistings ", + "name": "DELISTINGS", + "description": "currency offline" + }, + { + "value": "others", + "name": "OTHERS", + "description": "others" + }, + { + "value": "api-campaigns ", + "name": "API-CAMPAIGNS", + "description": "API user activities" + }, + { + "value": "new-listings", + "name": "NEW-LISTINGS", + "description": "new currency online" + } + ] + } + }, + { + "name": "lang", + "in": "query", + "description": "Language type, the default is en_US, the specific value parameters are as follows", + "required": false, + "schema": { + "type": "string", + "default": "en_US", + "enum": [ + "zh_HK", + "ja_JP", + "ko_KR", + "en_US", + "pl_PL", + "es_ES", + "fr_FR", + "ar_AE", + "it_IT", + "id_ID", + "nl_NL", + "pt_PT", + "vi_VN", + "de_DE", + "tr_TR", + "ms_MY", + "ru_RU", + "th_TH", + "hi_IN", + "bn_BD", + "fil_PH", + "ur_PK" + ], + "x-api-enum": [ + { + "value": "zh_HK", + "name": "ZH_HK", + "description": "Chinese (Hong Kong)" + }, + { + "value": "ja_JP", + "name": "JA_JP", + "description": "Japanese (Japan)" + }, + { + "value": "ko_KR", + "name": "KO_KR", + "description": "Korean (Korea)" + }, + { + "value": "en_US", + "name": "EN_US", + "description": "English" + }, + { + "value": "pl_PL", + "name": "PL_PL", + "description": "Polish (Poland)" + }, + { + "value": "es_ES", + "name": "ES_ES", + "description": "Spanish (Spain)" + }, + { + "value": "fr_FR", + "name": "FR_FR", + "description": "French (France)" + }, + { + "value": "ar_AE", + "name": "AR_AE", + "description": "Arabic (Egypt)" + }, + { + "value": "it_IT", + "name": "IT_IT", + "description": "Italian (Italy)" + }, + { + "value": "id_ID", + "name": "ID_ID", + "description": "Indonesian (Indonesia)" + }, + { + "value": "nl_NL", + "name": "NL_NL", + "description": "Dutch (Netherlands)" + }, + { + "value": "pt_PT", + "name": "PT_PT", + "description": "Portuguese (Brazil)" + }, + { + "value": "vi_VN", + "name": "VI_VN", + "description": "Vietnamese (Vietnam)" + }, + { + "value": "de_DE", + "name": "DE_DE", + "description": "German (Germany)" + }, + { + "value": "tr_TR", + "name": "TR_TR", + "description": "Turkish (Turkey)" + }, + { + "value": "ms_MY", + "name": "MS_MY", + "description": "Malay (Malaysia)" + }, + { + "value": "ru_RU", + "name": "RU_RU", + "description": "Russian (Russia)" + }, + { + "value": "th_TH", + "name": "TH_TH", + "description": "Thai (Thailand)" + }, + { + "value": "hi_IN", + "name": "HI_IN", + "description": "Hindi (India)" + }, + { + "value": "bn_BD", + "name": "BN_BD", + "description": "Bengali (Bangladesh)" + }, + { + "value": "fil_PH", + "name": "FIL_PH", + "description": "Filipino (Philippines)" + }, + { + "value": "ur_PK", + "name": "UR_PK", + "description": "Urdu (Pakistan)" + } + ] + } + }, + { + "name": "startTime", + "in": "query", + "description": "Announcement online start time (milliseconds)", + "required": false, + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "endTime", + "in": "query", + "description": "Announcement online end time (milliseconds)", + "required": false, + "schema": { + "type": "integer", + "format": "int64" + } + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "object", + "properties": { + "totalNum": { + "type": "integer", + "description": "Total Number" }, - "HNT": { - "type": "string" - }, - "ETHFI": { - "type": "string" - }, - "DMAIL": { - "type": "string" - }, - "OPUP": { - "type": "string" - }, - "VET3S": { - "type": "string" - }, - "MANA3S": { - "type": "string" - }, - "TIDAL": { - "type": "string" - }, - "HALO": { - "type": "string" - }, - "OPUL": { - "type": "string" - }, - "MANA3L": { - "type": "string" - }, - "DGB": { - "type": "string" - }, - "AA": { - "type": "string" - }, - "BCH": { - "type": "string" - }, - "GMEE": { - "type": "string" - }, - "JST": { - "type": "string" - }, - "PBUX": { - "type": "string" - }, - "AR": { - "type": "string" - }, - "SEI": { - "type": "string" - }, - "PSTAKE": { - "type": "string" - }, - "LMWR": { - "type": "string" - }, - "UNFIDOWN": { - "type": "string" - }, - "BB": { - "type": "string" - }, - "JTO": { - "type": "string" - }, - "WEMIX": { - "type": "string" + "items": { + "type": "array", + "items": { + "type": "object", + "properties": { + "annId": { + "type": "integer", + "description": "Announcement ID" + }, + "annTitle": { + "type": "string", + "description": "Announcement title" + }, + "annType": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Announcement type" + }, + "annDesc": { + "type": "string", + "description": "Announcement description" + }, + "cTime": { + "type": "integer", + "description": "Announcement release time, Unix millisecond timestamp format", + "format": "int64" + }, + "language": { + "type": "string", + "description": "language type" + }, + "annUrl": { + "type": "string", + "description": "Announcement link" + } + }, + "required": [ + "annId", + "annTitle", + "annType", + "annDesc", + "cTime", + "language", + "annUrl" + ] + } }, - "G": { - "type": "string" + "currentPage": { + "type": "integer", + "description": "Current page" }, - "MARSH": { - "type": "string" + "pageSize": { + "type": "integer", + "description": "Page size" }, - "BN": { - "type": "string" + "totalPage": { + "type": "integer", + "description": "Total Page" + } + }, + "required": [ + "totalNum", + "items", + "currentPage", + "pageSize", + "totalPage" + ] + } + }, + "required": [ + "code", + "data" + ] + } + } + } + } + }, + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470157", + "x-abandon": "normal", + "x-domain": "Spot", + "x-api-channel": "Public", + "x-api-permission": "NULL", + "x-api-rate-limit-pool": "Public", + "x-sdk-service": "Spot", + "x-sdk-sub-service": "Market", + "x-sdk-method-name": "getAnnouncements", + "x-sdk-method-description": "This interface can obtain the latest news announcements, and the default page search is for announcements within a month.", + "x-api-rate-limit": 20, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"totalNum\\\": 195,\\n \\\"totalPage\\\": 13,\\n \\\"currentPage\\\": 1,\\n \\\"pageSize\\\": 15,\\n \\\"items\\\": [\\n {\\n \\\"annId\\\": 129045,\\n \\\"annTitle\\\": \\\"KuCoin Isolated Margin Adds the Scroll (SCR) Trading Pair\\\",\\n \\\"annType\\\": [\\n \\\"latest-announcements\\\"\\n ],\\n \\\"annDesc\\\": \\\"To enrich the variety of assets available,\\xa0KuCoin\\u2019s Isolated Margin Trading platform has added the Scroll (SCR)\\xa0asset and trading pair.\\\",\\n \\\"cTime\\\": 1729594043000,\\n \\\"language\\\": \\\"en_US\\\",\\n \\\"annUrl\\\": \\\"https://www.kucoin.com/announcement/kucoin-isolated-margin-adds-scr?lang=en_US\\\"\\n },\\n {\\n \\\"annId\\\": 129001,\\n \\\"annTitle\\\": \\\"DAPP-30D Fixed Promotion, Enjoy an APR of 200%!\\u200b\\\",\\n \\\"annType\\\": [\\n \\\"latest-announcements\\\",\\n \\\"activities\\\"\\n ],\\n \\\"annDesc\\\": \\\"KuCoin Earn will be launching the DAPP Fixed Promotion at 10:00:00 on October 22, 2024 (UTC). The available product is \\u201cDAPP-30D'' with an APR of 200%.\\\",\\n \\\"cTime\\\": 1729588460000,\\n \\\"language\\\": \\\"en_US\\\",\\n \\\"annUrl\\\": \\\"https://www.kucoin.com/announcement/dapp-30d-fixed-promotion-enjoy?lang=en_US\\\"\\n },\\n {\\n \\\"annId\\\": 128581,\\n \\\"annTitle\\\": \\\"NAYM (NAYM) Gets Listed on KuCoin! World Premiere!\\\",\\n \\\"annType\\\": [\\n \\\"latest-announcements\\\",\\n \\\"new-listings\\\"\\n ],\\n \\\"annDesc\\\": \\\"Trading:\\xa011:00 on October 22, 2024 (UTC)\\\",\\n \\\"cTime\\\": 1729497729000,\\n \\\"language\\\": \\\"en_US\\\",\\n \\\"annUrl\\\": \\\"https://www.kucoin.com/announcement/en-naym-naym-gets-listed-on-kucoin-world-premiere?lang=en_US\\\"\\n }\\n ]\\n }\\n}", + "x-request-example": "{\\\"currentPage\\\": 1, \\\"pageSize\\\": 50, \\\"annType\\\": \\\"latest-announcements\\\", \\\"lang\\\": \\\"en_US\\\", \\\"startTime\\\": 1729594043000, \\\"endTime\\\": 1729697729000}" + } + }, + "/api/v3/currencies/{currency}": { + "get": { + "summary": "Get Currency", + "deprecated": false, + "description": "Request via this endpoint to get the currency details of a specified currency", + "tags": [], + "parameters": [ + { + "name": "currency", + "in": "path", + "description": "Path parameter, Currency", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "chain", + "in": "query", + "description": "Support for querying the chain of currency, e.g. The available value for USDT are OMNI, ERC20, TRC20. This only apply for multi-chain currency, and there is no need for single chain currency.", + "required": false, + "schema": { + "type": "string", + "example": [ + "eth", + "bech32", + "btc", + "kcc", + "trx", + "bsc", + "arbitrum", + "ton", + "optimism" + ] + } + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "object", + "properties": { + "currency": { + "type": "string", + "description": "A unique currency code that will never change" }, - "FLIP": { - "type": "string" + "name": { + "type": "string", + "description": "Currency name, will change after renaming" }, - "FLR": { - "type": "string" + "fullName": { + "type": "string", + "description": "Full name of a currency, will change after renaming" }, - "BIGTIME": { - "type": "string" + "precision": { + "type": "integer", + "description": "Currency precision" }, - "FLY": { - "type": "string" + "confirms": { + "type": "integer", + "description": "Number of block confirmations" }, - "T": { - "type": "string" + "contractAddress": { + "type": "string", + "description": "Contract address" }, - "W": { - "type": "string" + "isMarginEnabled": { + "type": "boolean", + "description": "Support margin or not" }, - "BDX": { - "type": "string" + "isDebitEnabled": { + "type": "boolean", + "description": "Support debit or not" }, - "BABYDOGE": { - "type": "string" - }, - "SFP": { - "type": "string" - }, - "DIA": { - "type": "string" - }, - "ISME": { - "type": "string" - }, - "LYM": { - "type": "string" - }, - "VET3L": { - "type": "string" - }, - "JUP": { - "type": "string" - }, - "LYX": { - "type": "string" - }, - "AIEPK": { - "type": "string" - }, - "SILLY": { - "type": "string" - }, - "SCPT": { - "type": "string" - }, - "WOO": { - "type": "string" - }, - "BLUR": { - "type": "string" - }, - "STRK": { - "type": "string" - }, - "BFC": { - "type": "string" - }, - "DC": { - "type": "string" - }, - "KARATE": { - "type": "string" - }, - "SUSHI3L": { - "type": "string" - }, - "NETVR": { - "type": "string" - }, - "WAVES": { - "type": "string" - }, - "LITH": { - "type": "string" - }, - "HAPI": { - "type": "string" - }, - "SUSHI3S": { - "type": "string" - }, - "CEEK": { - "type": "string" - }, - "FLOKI": { - "type": "string" - }, - "SHR": { - "type": "string" - }, - "SAND": { - "type": "string" - }, - "TURT": { - "type": "string" - }, - "UMA": { - "type": "string" - }, - "BEPRO": { - "type": "string" - }, - "SCRT": { - "type": "string" - }, - "TUSD": { - "type": "string" - }, - "COOKIE": { - "type": "string" - }, - "LRDS": { - "type": "string" - }, - "SIN": { - "type": "string" - }, - "OAS": { - "type": "string" - }, - "ROOT": { - "type": "string" - }, - "ADA3L": { - "type": "string" - }, - "TIAUP": { - "type": "string" - }, - "HTR": { - "type": "string" - }, - "UNB": { - "type": "string" - }, - "UNA": { - "type": "string" - }, - "HARD": { - "type": "string" - }, - "G3": { - "type": "string" - }, - "ADA3S": { - "type": "string" - }, - "MYRO": { - "type": "string" - }, - "HTX": { - "type": "string" - }, - "FT": { - "type": "string" - }, - "BTCDOWN": { - "type": "string" - }, - "UNI": { - "type": "string" - }, - "FX": { - "type": "string" - }, - "OBI": { - "type": "string" - }, - "UNO": { - "type": "string" - }, - "WRX": { - "type": "string" - }, - "TIADOWN": { - "type": "string" - }, - "ETHDOWN": { - "type": "string" - }, - "WELL": { - "type": "string" - }, - "SWFTC": { - "type": "string" - }, - "SKL": { - "type": "string" - }, - "UOS": { - "type": "string" - }, - "AIPAD": { - "type": "string" - }, - "BRETT": { - "type": "string" - }, - "SKY": { - "type": "string" - }, - "FRM": { - "type": "string" - }, - "VISION": { - "type": "string" - }, - "LENDS": { - "type": "string" - }, - "SLF": { - "type": "string" - }, - "BULL": { - "type": "string" - }, - "FLOW": { - "type": "string" - }, - "ODDZ": { - "type": "string" - }, - "SLN": { - "type": "string" - }, - "UPO": { - "type": "string" - }, - "SLP": { - "type": "string" - }, - "ID": { - "type": "string" - }, - "SLIM": { - "type": "string" - }, - "SPOT": { - "type": "string" - }, - "DOP": { - "type": "string" - }, - "ISSP": { - "type": "string" - }, - "UQC": { - "type": "string" - }, - "IO": { - "type": "string" - }, - "DOT": { - "type": "string" - }, - "1INCH": { - "type": "string" - }, - "SMH": { - "type": "string" - }, - "MAK": { - "type": "string" - }, - "TOKO": { - "type": "string" - }, - "TURBO": { - "type": "string" - }, - "UNFI": { - "type": "string" - }, - "MAN": { - "type": "string" - }, - "EVER": { - "type": "string" - }, - "FTM": { - "type": "string" - }, - "SHRAP": { - "type": "string" - }, - "MAV": { - "type": "string" - }, - "MAX": { - "type": "string" - }, - "DPR": { - "type": "string" - }, - "FTT": { - "type": "string" - }, - "ARKM": { - "type": "string" - }, - "ATOM": { - "type": "string" - }, - "PENDLE": { - "type": "string" - }, - "QUICK": { - "type": "string" - }, - "BLZ": { - "type": "string" - }, - "BOBA": { - "type": "string" - }, - "MBL": { - "type": "string" - }, - "OFN": { - "type": "string" - }, - "UNIO": { - "type": "string" - }, - "SNS": { - "type": "string" - }, - "SNX": { - "type": "string" - }, - "NXRA": { - "type": "string" - }, - "TAIKO": { - "type": "string" - }, - "AVAX3L": { - "type": "string" - }, - "L3": { - "type": "string" - }, - "API3": { - "type": "string" - }, - "XRP3S": { - "type": "string" - }, - "QKC": { - "type": "string" - }, - "AVAX3S": { - "type": "string" - }, - "ROSE": { - "type": "string" - }, - "SATS": { - "type": "string" - }, - "BMX": { - "type": "string" - }, - "PORTAL": { - "type": "string" - }, - "TOMI": { - "type": "string" - }, - "XRP3L": { - "type": "string" - }, - "SOL": { - "type": "string" - }, - "SON": { - "type": "string" - }, - "BNC": { - "type": "string" - }, - "SOCIAL": { - "type": "string" - }, - "CGPT": { - "type": "string" - }, - "CELR": { - "type": "string" - }, - "BNB": { - "type": "string" - }, - "OGN": { - "type": "string" - }, - "CELO": { - "type": "string" - }, - "AUCTION": { - "type": "string" - }, - "MANTA": { - "type": "string" - }, - "LAYER": { - "type": "string" - }, - "AERO": { - "type": "string" - }, - "CETUS": { - "type": "string" - }, - "LL": { - "type": "string" - }, - "SPA": { - "type": "string" - }, - "PYTHDOWN": { - "type": "string" - }, - "NEIROCTO": { - "type": "string" - }, - "UTK": { - "type": "string" - }, - "GMRX": { - "type": "string" - }, - "BOB": { - "type": "string" - }, - "HOTCROSS": { - "type": "string" - }, - "AERGO": { - "type": "string" - }, - "MOCA": { - "type": "string" - }, - "SQD": { - "type": "string" - }, - "MV": { - "type": "string" - }, - "BNB3L": { - "type": "string" - }, - "BNB3S": { - "type": "string" - }, - "GALAX3L": { - "type": "string" - }, - "KAI": { - "type": "string" - }, - "SQR": { - "type": "string" - }, - "GALAX3S": { - "type": "string" - }, - "EGLD": { - "type": "string" - }, - "ZBCN": { - "type": "string" - }, - "KAS": { - "type": "string" - }, - "MEW": { - "type": "string" - }, - "PUNDIX": { - "type": "string" - }, - "LOOKS": { - "type": "string" - }, - "FXS": { - "type": "string" - }, - "BOSON": { - "type": "string" - }, - "BRISE": { - "type": "string" - }, - "AEVO": { - "type": "string" - }, - "FLUX": { - "type": "string" - }, - "PRCL": { - "type": "string" - }, - "UNFIUP": { - "type": "string" - }, - "SEIDOWN": { - "type": "string" - }, - "DOAI": { - "type": "string" - }, - "QNT": { - "type": "string" - }, - "REDO": { - "type": "string" - }, - "STRIKE": { - "type": "string" - }, - "ETHW": { - "type": "string" - }, - "OM": { - "type": "string" - }, - "OP": { - "type": "string" - }, - "WHALE": { - "type": "string" - }, - "1CAT": { - "type": "string" - }, - "NEON": { - "type": "string" - }, - "GTAI": { - "type": "string" - }, - "SSV": { - "type": "string" - }, - "ETH2": { - "type": "string" - }, - "KCS": { - "type": "string" - }, - "ARPA": { - "type": "string" - }, - "ARTFI": { - "type": "string" - }, - "BRL": { - "type": "string" - }, - "ALEX": { - "type": "string" - }, - "STG": { - "type": "string" - }, - "SHIB": { - "type": "string" - }, - "IOTX": { - "type": "string" - }, - "OLE": { - "type": "string" - }, - "KDA": { - "type": "string" - }, - "CERE": { - "type": "string" - }, - "DOCK": { - "type": "string" - }, - "STX": { - "type": "string" - }, - "OLT": { - "type": "string" - }, - "QI": { - "type": "string" - }, - "SDAO": { - "type": "string" - }, - "BLAST": { - "type": "string" - }, - "LINK3S": { - "type": "string" - }, - "IOST": { - "type": "string" - }, - "SUI": { - "type": "string" - }, - "CAKE": { - "type": "string" - }, - "BSW": { - "type": "string" - }, - "OMG": { - "type": "string" - }, - "VOLT": { - "type": "string" - }, - "LINK3L": { - "type": "string" - }, - "GEEQ": { - "type": "string" - }, - "PYUSD": { - "type": "string" - }, - "SUN": { - "type": "string" - }, - "TOWER": { - "type": "string" - }, - "BTC": { - "type": "string" - }, - "IOTA": { - "type": "string" - }, - "REEF": { - "type": "string" - }, - "TRIAS": { - "type": "string" - }, - "KEY": { - "type": "string" - }, - "ETH3L": { - "type": "string" - }, - "BTT": { - "type": "string" - }, - "ONE": { - "type": "string" - }, - "RENDER": { - "type": "string" - }, - "ETH3S": { - "type": "string" - }, - "ANKR": { - "type": "string" - }, - "ALGO": { - "type": "string" - }, - "SYLO": { - "type": "string" - }, - "ZCX": { - "type": "string" - }, - "SD": { - "type": "string" - }, - "ONT": { - "type": "string" - }, - "MJT": { - "type": "string" - }, - "DYM": { - "type": "string" - }, - "DYP": { - "type": "string" - }, - "BAKEUP": { - "type": "string" - }, - "OOE": { - "type": "string" - }, - "ZELIX": { - "type": "string" - }, - "DOGE3L": { - "type": "string" - }, - "ARTY": { - "type": "string" - }, - "QORPO": { - "type": "string" - }, - "ICE": { - "type": "string" - }, - "NOTAI": { - "type": "string" - }, - "DOGE3S": { - "type": "string" - }, - "NAKA": { - "type": "string" - }, - "GALAX": { - "type": "string" - }, - "MKR": { - "type": "string" - }, - "DODO": { - "type": "string" - }, - "ICP": { - "type": "string" - }, - "ZEC": { - "type": "string" - }, - "ZEE": { - "type": "string" - }, - "ICX": { - "type": "string" - }, - "KMNO": { - "type": "string" - }, - "TT": { - "type": "string" - }, - "DOT3L": { - "type": "string" - }, - "XAI": { - "type": "string" - }, - "ZEN": { - "type": "string" - }, - "DOGE": { - "type": "string" - }, - "ALPHA": { - "type": "string" - }, - "DUSK": { - "type": "string" - }, - "DOT3S": { - "type": "string" - }, - "SXP": { - "type": "string" - }, - "HBAR": { - "type": "string" - }, - "SYNT": { - "type": "string" - }, - "ZEX": { - "type": "string" - }, - "BONDLY": { - "type": "string" - }, - "MLK": { - "type": "string" - }, - "KICKS": { - "type": "string" - }, - "PEPE": { - "type": "string" - }, - "OUSD": { - "type": "string" - }, - "LUNCDOWN": { - "type": "string" - }, - "DOGS": { - "type": "string" - }, - "REV3L": { - "type": "string" - }, - "CTSI": { - "type": "string" - }, - "C98": { - "type": "string" - }, - "OSMO": { - "type": "string" - }, - "NTRN": { - "type": "string" - }, - "CFX2S": { - "type": "string" - }, - "SYN": { - "type": "string" - }, - "VIDT": { - "type": "string" - }, - "SYS": { - "type": "string" - }, - "GAS": { - "type": "string" - }, - "BOME": { - "type": "string" - }, - "COMBO": { - "type": "string" - }, - "XCH": { - "type": "string" - }, - "VR": { - "type": "string" - }, - "CFX2L": { - "type": "string" - }, - "VSYS": { - "type": "string" - }, - "PANDORA": { - "type": "string" - }, - "THETA": { - "type": "string" - }, - "XCN": { - "type": "string" - }, - "NEXG": { - "type": "string" - }, - "MELOS": { - "type": "string" - }, - "XCV": { - "type": "string" - }, - "ORN": { - "type": "string" - }, - "WLKN": { - "type": "string" - }, - "AAVE": { - "type": "string" - }, - "MNT": { - "type": "string" - }, - "BONK": { - "type": "string" - }, - "PERP": { - "type": "string" - }, - "XDC": { - "type": "string" - }, - "MNW": { - "type": "string" - }, - "XDB": { - "type": "string" - }, - "BOND": { - "type": "string" - }, - "SUIA": { - "type": "string" - }, - "MOG": { - "type": "string" - }, - "SUTER": { - "type": "string" - }, - "TIME": { - "type": "string" - }, - "RACA": { - "type": "string" - }, - "BICO": { - "type": "string" - }, - "MON": { - "type": "string" - }, - "SWEAT": { - "type": "string" - }, - "MOXIE": { - "type": "string" - }, - "BABYBNB": { - "type": "string" - }, - "IGU": { - "type": "string" - }, - "HMSTR": { - "type": "string" - }, - "XEC": { - "type": "string" - }, - "MONI": { - "type": "string" - }, - "XR": { - "type": "string" - }, - "PEOPLE": { - "type": "string" - }, - "PUMLX": { - "type": "string" - }, - "ZIL": { - "type": "string" - }, - "WLDDOWN": { - "type": "string" - }, - "VAI": { - "type": "string" - }, - "XEN": { - "type": "string" - }, - "MPC": { - "type": "string" - }, - "XEM": { - "type": "string" - }, - "JASMY3S": { - "type": "string" - }, - "OTK": { - "type": "string" - }, - "TRAC": { - "type": "string" - }, - "DFYN": { - "type": "string" - }, - "BIDP": { - "type": "string" - }, - "JASMY3L": { - "type": "string" - }, - "INJDOWN": { - "type": "string" - }, - "KLV": { - "type": "string" - }, - "WAXL": { - "type": "string" - }, - "TRBDOWN": { - "type": "string" - }, - "BCH3L": { - "type": "string" - }, - "GMT3S": { - "type": "string" - }, - "KMD": { - "type": "string" - }, - "BCH3S": { - "type": "string" - }, - "ECOX": { - "type": "string" - }, - "AAVE3S": { - "type": "string" - }, - "GMT3L": { - "type": "string" - }, - "EPIK": { - "type": "string" - }, - "SUIP": { - "type": "string" - }, - "AAVE3L": { - "type": "string" - }, - "ZK": { - "type": "string" - }, - "ZKF": { - "type": "string" - }, - "OMNIA": { - "type": "string" - }, - "ZKJ": { - "type": "string" - }, - "ZKL": { - "type": "string" - }, - "GAFI": { - "type": "string" - }, - "CARV": { - "type": "string" - }, - "KNC": { - "type": "string" - }, - "CATS": { - "type": "string" - }, - "PROM": { - "type": "string" - }, - "ALEPH": { - "type": "string" - }, - "PONKE": { - "type": "string" - }, - "OVR": { - "type": "string" - }, - "CATI": { - "type": "string" - }, - "ORDER": { - "type": "string" - }, - "GFT": { - "type": "string" - }, - "BIFI": { - "type": "string" - }, - "GGC": { - "type": "string" - }, - "GGG": { - "type": "string" - }, - "DAPPX": { - "type": "string" - }, - "SUKU": { - "type": "string" - }, - "ULTI": { - "type": "string" - }, - "CREDI": { - "type": "string" - }, - "ERTHA": { - "type": "string" - }, - "FURY": { - "type": "string" - }, - "KARRAT": { - "type": "string" - }, - "MOBILE": { - "type": "string" - }, - "SIDUS": { - "type": "string" - }, - "NAVI": { - "type": "string" - }, - "TAO": { - "type": "string" - }, - "USDJ": { - "type": "string" - }, - "MTL": { - "type": "string" - }, - "VET": { - "type": "string" - }, - "FITFI": { - "type": "string" - }, - "USDT": { - "type": "string" - }, - "OXT": { - "type": "string" - }, - "CANDY": { - "type": "string" - }, - "USDP": { - "type": "string" - }, - "MTS": { - "type": "string" - }, - "TADA": { - "type": "string" - }, - "MTV": { - "type": "string" - }, - "NAVX": { - "type": "string" - }, - "ILV": { - "type": "string" - }, - "VINU": { - "type": "string" - }, - "GHX": { - "type": "string" - }, - "EDU": { - "type": "string" - }, - "HYVE": { - "type": "string" - }, - "BTC3L": { - "type": "string" - }, - "ANYONE": { - "type": "string" - }, - "BEAT": { - "type": "string" - }, - "KING": { - "type": "string" - }, - "CREAM": { - "type": "string" - }, - "CAS": { - "type": "string" - }, - "IMX": { - "type": "string" - }, - "CAT": { - "type": "string" - }, - "BTC3S": { - "type": "string" - }, - "USDE": { - "type": "string" - }, - "USDD": { - "type": "string" - }, - "CWAR": { - "type": "string" - }, - "USDC": { - "type": "string" - }, - "KRL": { - "type": "string" - }, - "INJ": { - "type": "string" - }, - "GAME": { - "type": "string" - }, - "TRIBL": { - "type": "string" - }, - "XLM": { - "type": "string" - }, - "TRBUP": { - "type": "string" - }, - "VRADOWN": { - "type": "string" - }, - "SUPER": { - "type": "string" - }, - "EIGEN": { - "type": "string" - }, - "IOI": { - "type": "string" - }, - "KSM": { - "type": "string" - }, - "CCD": { - "type": "string" - }, - "EGO": { - "type": "string" - }, - "EGP": { - "type": "string" - }, - "MXC": { - "type": "string" - }, - "TEL": { - "type": "string" - }, - "MOVR": { - "type": "string" - }, - "XMR": { - "type": "string" - }, - "MXM": { - "type": "string" - }, - "OORT": { - "type": "string" - }, - "GLM": { - "type": "string" - }, - "RAY": { - "type": "string" - }, - "XTAG": { - "type": "string" - }, - "GLQ": { - "type": "string" - }, - "CWEB": { - "type": "string" - }, - "REVU": { - "type": "string" - }, - "REVV": { - "type": "string" - }, - "ZRO": { - "type": "string" - }, - "XNL": { - "type": "string" - }, - "XNO": { - "type": "string" - }, - "SAROS": { - "type": "string" - }, - "KACE": { - "type": "string" - }, - "ZRX": { - "type": "string" - }, - "WLTH": { - "type": "string" - }, - "ATOM3L": { - "type": "string" - }, - "GMM": { - "type": "string" - }, - "BEER": { - "type": "string" - }, - "GMT": { - "type": "string" - }, - "HEART": { - "type": "string" - }, - "GMX": { - "type": "string" - }, - "ABBC": { - "type": "string" - }, - "OMNI": { - "type": "string" - }, - "ATOM3S": { - "type": "string" - }, - "IRL": { - "type": "string" - }, - "CFG": { - "type": "string" - }, - "WSDM": { - "type": "string" - }, - "GNS": { - "type": "string" - }, - "VANRY": { - "type": "string" - }, - "CFX": { - "type": "string" - }, - "GRAIL": { - "type": "string" - }, - "BEFI": { - "type": "string" - }, - "VELO": { - "type": "string" - }, - "XPR": { - "type": "string" - }, - "DOVI": { - "type": "string" - }, - "ACE": { - "type": "string" - }, - "ACH": { - "type": "string" - }, - "ISP": { - "type": "string" - }, - "XCAD": { - "type": "string" - }, - "MINA": { - "type": "string" - }, - "TIA": { - "type": "string" - }, - "DRIFT": { - "type": "string" - }, - "ACQ": { - "type": "string" - }, - "ACS": { - "type": "string" - }, - "MIND": { - "type": "string" - }, - "STORE": { - "type": "string" - }, - "REN": { - "type": "string" - }, - "ELA": { - "type": "string" - }, - "DREAMS": { - "type": "string" - }, - "ADA": { - "type": "string" - }, - "ELF": { - "type": "string" - }, - "REQ": { - "type": "string" - }, - "STORJ": { - "type": "string" - }, - "LADYS": { - "type": "string" - }, - "PAXG": { - "type": "string" - }, - "REZ": { - "type": "string" - }, - "XRD": { - "type": "string" - }, - "CHO": { - "type": "string" - }, - "CHR": { - "type": "string" - }, - "ADS": { - "type": "string" - }, - "CHZ": { - "type": "string" - }, - "ADX": { - "type": "string" - }, - "XRP": { - "type": "string" - }, - "JASMY": { - "type": "string" - }, - "KAGI": { - "type": "string" - }, - "FIDA": { - "type": "string" - }, - "PBR": { - "type": "string" - }, - "AEG": { - "type": "string" - }, - "H2O": { - "type": "string" - }, - "CHMB": { - "type": "string" - }, - "SAND3L": { - "type": "string" - }, - "PBX": { - "type": "string" - }, - "SOLVE": { - "type": "string" - }, - "DECHAT": { - "type": "string" - }, - "GARI": { - "type": "string" - }, - "SHIB2L": { - "type": "string" - }, - "SHIB2S": { - "type": "string" - }, - "ENA": { - "type": "string" - }, - "VEMP": { - "type": "string" - }, - "ENJ": { - "type": "string" - }, - "AFG": { - "type": "string" - }, - "RATS": { - "type": "string" - }, - "GRT": { - "type": "string" - }, - "FORWARD": { - "type": "string" - }, - "TFUEL": { - "type": "string" - }, - "ENS": { - "type": "string" - }, - "KASDOWN": { - "type": "string" - }, - "XTM": { - "type": "string" - }, - "DEGEN": { - "type": "string" - }, - "TLM": { - "type": "string" - }, - "DYDXDOWN": { - "type": "string" - }, - "CKB": { - "type": "string" - }, - "LUNC": { - "type": "string" - }, - "AURORA": { - "type": "string" - }, - "LUNA": { - "type": "string" - }, - "XTZ": { - "type": "string" - }, - "ELON": { - "type": "string" - }, - "DMTR": { - "type": "string" - }, - "EOS": { - "type": "string" - }, - "GST": { - "type": "string" - }, - "FORT": { - "type": "string" - }, - "FLAME": { - "type": "string" - }, - "PATEX": { - "type": "string" - }, - "DEEP": { - "type": "string" - }, - "ID3L": { - "type": "string" - }, - "GTC": { - "type": "string" - }, - "ID3S": { - "type": "string" - }, - "RIO": { - "type": "string" - }, - "CLH": { - "type": "string" - }, - "BURGER": { - "type": "string" - }, - "VRA": { - "type": "string" - }, - "SUNDOG": { - "type": "string" - }, - "GTT": { - "type": "string" - }, - "INJUP": { - "type": "string" - }, - "CPOOL": { - "type": "string" - }, - "EPX": { - "type": "string" - }, - "CLV": { - "type": "string" - }, - "FEAR": { - "type": "string" - }, - "MEME": { - "type": "string" - }, - "ROOBEE": { - "type": "string" - }, - "DEFI": { - "type": "string" - }, - "TOKEN": { - "type": "string" - }, - "GRAPE": { - "type": "string" - }, - "KASUP": { - "type": "string" - }, - "XWG": { - "type": "string" - }, - "SKEY": { - "type": "string" - }, - "SFUND": { - "type": "string" - }, - "EQX": { - "type": "string" - }, - "ORDIUP": { - "type": "string" - }, - "TON": { - "type": "string" - }, - "DEGO": { - "type": "string" - }, - "IZI": { - "type": "string" - }, - "ERG": { - "type": "string" - }, - "ERN": { - "type": "string" - }, - "VENOM": { - "type": "string" - }, - "VOXEL": { - "type": "string" - }, - "RLC": { - "type": "string" - }, - "PHA": { - "type": "string" - }, - "DYDXUP": { - "type": "string" - }, - "APE3S": { - "type": "string" - }, - "ORBS": { - "type": "string" - }, - "OPDOWN": { - "type": "string" - }, - "ESE": { - "type": "string" - }, - "APE3L": { - "type": "string" - }, - "HMND": { - "type": "string" - }, - "COQ": { - "type": "string" - }, - "AURY": { - "type": "string" - }, - "CULT": { - "type": "string" - }, - "AKT": { - "type": "string" - }, - "GLMR": { - "type": "string" - }, - "XYM": { - "type": "string" - }, - "ORAI": { - "type": "string" - }, - "XYO": { - "type": "string" - }, - "ETC": { - "type": "string" - }, - "LAI": { - "type": "string" - }, - "PIP": { - "type": "string" - }, - "ETH": { - "type": "string" - }, - "NEO": { - "type": "string" - }, - "RMV": { - "type": "string" - }, - "KLAY": { - "type": "string" - }, - "PIT": { - "type": "string" - }, - "TARA": { - "type": "string" - }, - "KALT": { - "type": "string" - }, - "PIX": { - "type": "string" - }, - "ETN": { - "type": "string" - }, - "CSIX": { - "type": "string" - }, - "TRADE": { - "type": "string" - }, - "MAVIA": { - "type": "string" - }, - "HIGH": { - "type": "string" - }, - "TRB": { - "type": "string" - }, - "ORDI": { - "type": "string" - }, - "TRVL": { - "type": "string" - }, - "AMB": { - "type": "string" - }, - "TRU": { - "type": "string" - }, - "LOGX": { - "type": "string" - }, - "FINC": { - "type": "string" - }, - "INFRA": { - "type": "string" - }, - "NATIX": { - "type": "string" - }, - "NFP": { - "type": "string" - }, - "TRY": { - "type": "string" - }, - "TRX": { - "type": "string" - }, - "LBP": { - "type": "string" - }, - "LBR": { - "type": "string" - }, - "EUL": { - "type": "string" - }, - "NFT": { - "type": "string" - }, - "SEIUP": { - "type": "string" - }, - "PUFFER": { - "type": "string" - }, - "EUR": { - "type": "string" - }, - "ORCA": { - "type": "string" - }, - "NEAR3L": { - "type": "string" - }, - "AMP": { - "type": "string" - }, - "XDEFI": { - "type": "string" - }, - "HIFI": { - "type": "string" - }, - "TRUF": { - "type": "string" - }, - "AITECH": { - "type": "string" - }, - "AMU": { - "type": "string" - }, - "USTC": { - "type": "string" - }, - "KNGL": { - "type": "string" - }, - "FOXY": { - "type": "string" - }, - "NGC": { - "type": "string" - }, - "TENET": { - "type": "string" - }, - "NEAR3S": { - "type": "string" - }, - "MAHA": { - "type": "string" - }, - "NGL": { - "type": "string" - }, - "TST": { - "type": "string" - }, - "HIPPO": { - "type": "string" - }, - "AXS3S": { - "type": "string" - }, - "CRO": { - "type": "string" - }, - "ZPAY": { - "type": "string" - }, - "MNDE": { - "type": "string" - }, - "CRV": { - "type": "string" - }, - "SWASH": { - "type": "string" - }, - "AXS3L": { - "type": "string" - }, - "VERSE": { - "type": "string" - }, - "RPK": { - "type": "string" - }, - "RPL": { - "type": "string" - }, - "AZERO": { - "type": "string" - }, - "SOUL": { - "type": "string" - }, - "VXV": { - "type": "string" - }, - "LDO": { - "type": "string" - }, - "MAGIC": { - "type": "string" - }, - "ALICE": { - "type": "string" - }, - "SEAM": { - "type": "string" - }, - "PLU": { - "type": "string" - }, - "AOG": { - "type": "string" - }, - "SMOLE": { - "type": "string" - }, - "EWT": { - "type": "string" - }, - "TSUGT": { - "type": "string" - }, - "PMG": { - "type": "string" - }, - "OPAI": { - "type": "string" - }, - "LOCUS": { - "type": "string" - }, - "CTA": { - "type": "string" - }, - "NIM": { - "type": "string" - }, - "CTC": { - "type": "string" - }, - "APE": { - "type": "string" - }, - "MERL": { - "type": "string" - }, - "JAM": { - "type": "string" - }, - "CTI": { - "type": "string" - }, - "APP": { - "type": "string" - }, - "APT": { - "type": "string" - }, - "WLDUP": { - "type": "string" - }, - "ZEND": { - "type": "string" - }, - "FIRE": { - "type": "string" - }, - "DENT": { - "type": "string" - }, - "PYTH": { - "type": "string" - }, - "LFT": { - "type": "string" - }, - "DPET": { - "type": "string" - }, - "ORDIDOWN": { - "type": "string" - }, - "KPOL": { - "type": "string" - }, - "ETHUP": { - "type": "string" - }, - "BAND": { - "type": "string" - }, - "POL": { - "type": "string" - }, - "ASTR": { - "type": "string" - }, - "NKN": { - "type": "string" - }, - "RSR": { - "type": "string" - }, - "DVPN": { - "type": "string" - }, - "TWT": { - "type": "string" - }, - "ARB": { - "type": "string" - }, - "CVC": { - "type": "string" - }, - "ARC": { - "type": "string" - }, - "XETA": { - "type": "string" - }, - "MTRG": { - "type": "string" - }, - "LOKA": { - "type": "string" - }, - "LPOOL": { - "type": "string" - }, - "TURBOS": { - "type": "string" - }, - "CVX": { - "type": "string" - }, - "ARX": { - "type": "string" - }, - "MPLX": { - "type": "string" - }, - "SUSHI": { - "type": "string" - }, - "NLK": { - "type": "string" - }, - "PEPE2": { - "type": "string" - }, - "WBTC": { - "type": "string" - }, - "SUI3L": { - "type": "string" - }, - "CWS": { - "type": "string" - }, - "SUI3S": { - "type": "string" - }, - "INSP": { - "type": "string" - }, - "MANA": { - "type": "string" - }, - "VRTX": { - "type": "string" - }, - "CSPR": { - "type": "string" - }, - "ATA": { - "type": "string" - }, - "OPEN": { - "type": "string" - }, - "HAI": { - "type": "string" - }, - "NMR": { - "type": "string" - }, - "ATH": { - "type": "string" - }, - "LIT": { - "type": "string" - }, - "TLOS": { - "type": "string" - }, - "TNSR": { - "type": "string" - }, - "CXT": { - "type": "string" - }, - "POLYX": { - "type": "string" - }, - "ZERO": { - "type": "string" - }, - "ROUTE": { - "type": "string" - }, - "LOOM": { - "type": "string" - }, - "PRE": { - "type": "string" - }, - "VRAUP": { - "type": "string" - }, - "HBB": { - "type": "string" - }, - "RVN": { - "type": "string" - }, - "PRQ": { - "type": "string" - }, - "ONDO": { - "type": "string" - }, - "PEPEDOWN": { - "type": "string" - }, - "WOOP": { - "type": "string" - }, - "LUNCUP": { - "type": "string" - }, - "KAVA": { - "type": "string" - }, - "LKI": { - "type": "string" - }, - "AVA": { - "type": "string" - }, - "NOM": { - "type": "string" - }, - "MAPO": { - "type": "string" - }, - "PEPEUP": { - "type": "string" - }, - "STRAX": { - "type": "string" - }, - "NOT": { - "type": "string" - }, - "ZERC": { - "type": "string" - }, - "BCUT": { - "type": "string" - }, - "MASA": { - "type": "string" - }, - "WAN": { - "type": "string" - }, - "WAT": { - "type": "string" - }, - "WAX": { - "type": "string" - }, - "MASK": { - "type": "string" - }, - "EOS3L": { - "type": "string" - }, - "IDEA": { - "type": "string" - }, - "EOS3S": { - "type": "string" - }, - "YFI": { - "type": "string" - }, - "MOODENG": { - "type": "string" - }, - "XCUR": { - "type": "string" - }, - "HYDRA": { - "type": "string" - }, - "POPCAT": { - "type": "string" - }, - "LQTY": { - "type": "string" - }, - "PIXEL": { - "type": "string" - }, - "LMR": { - "type": "string" - }, - "ZETA": { - "type": "string" - }, - "YGG": { - "type": "string" - }, - "AXS": { - "type": "string" - }, - "BCHSV": { - "type": "string" - }, - "NRN": { - "type": "string" - }, - "FTON": { - "type": "string" - }, - "COMP": { - "type": "string" - }, - "XPRT": { - "type": "string" - }, - "HFT": { - "type": "string" - }, - "UXLINK": { - "type": "string" - }, - "STAMP": { - "type": "string" - }, - "RUNE": { - "type": "string" - }, - "ZEUS": { - "type": "string" - }, - "LTC3L": { - "type": "string" - }, - "DAPP": { - "type": "string" - }, - "FORTH": { - "type": "string" - }, - "ALPINE": { - "type": "string" - }, - "SENSO": { - "type": "string" - }, - "LTC3S": { - "type": "string" - }, - "DEXE": { - "type": "string" - }, - "GOAL": { - "type": "string" - }, - "AVAX": { - "type": "string" - }, - "LISTA": { - "type": "string" - }, - "AMPL": { - "type": "string" - }, - "WORK": { - "type": "string" - }, - "BRWL": { - "type": "string" - }, - "BANANA": { - "type": "string" - }, - "PUSH": { - "type": "string" - }, - "WEN": { - "type": "string" - }, - "NEIRO": { - "type": "string" - }, - "BTCUP": { - "type": "string" - }, - "SOL3S": { - "type": "string" - }, - "BRAWL": { - "type": "string" - }, - "LAY3R": { - "type": "string" - }, - "LPT": { - "type": "string" - }, - "GODS": { - "type": "string" - }, - "SAND3S": { - "type": "string" - }, - "RDNT": { - "type": "string" - }, - "SOL3L": { - "type": "string" - }, - "NIBI": { - "type": "string" - }, - "NUM": { - "type": "string" - }, - "PYR": { - "type": "string" - }, - "DAG": { - "type": "string" - }, - "DAI": { - "type": "string" - }, - "HIP": { - "type": "string" - }, - "DAO": { - "type": "string" - }, - "AVAIL": { - "type": "string" - }, - "DAR": { - "type": "string" - }, - "FET": { - "type": "string" - }, - "FCON": { - "type": "string" - }, - "XAVA": { - "type": "string" - }, - "LRC": { - "type": "string" - }, - "UNI3S": { - "type": "string" - }, - "POKT": { - "type": "string" - }, - "DASH": { - "type": "string" - }, - "BAKEDOWN": { - "type": "string" - }, - "POLC": { - "type": "string" - }, - "CIRUS": { - "type": "string" - }, - "UNI3L": { - "type": "string" - }, - "NWC": { - "type": "string" - }, - "POLK": { - "type": "string" - }, - "LSD": { - "type": "string" - }, - "MARS4": { - "type": "string" - }, - "LSK": { - "type": "string" - }, - "BLOCK": { - "type": "string" - }, - "ANALOS": { - "type": "string" - }, - "SAFE": { - "type": "string" - }, - "DCK": { - "type": "string" - }, - "LSS": { - "type": "string" - }, - "DCR": { - "type": "string" - }, - "LIKE": { - "type": "string" - }, - "DATA": { - "type": "string" - }, - "WIF": { - "type": "string" - }, - "BLOK": { - "type": "string" - }, - "LTC": { - "type": "string" - }, - "METIS": { - "type": "string" - }, - "WIN": { - "type": "string" - }, - "HLG": { - "type": "string" - }, - "LTO": { - "type": "string" - }, - "DYDX": { - "type": "string" - }, - "ARB3S": { - "type": "string" - }, - "MUBI": { - "type": "string" - }, - "ARB3L": { - "type": "string" - }, - "RBTC1": { - "type": "string" - }, - "POND": { - "type": "string" - }, - "LINA": { - "type": "string" - }, - "MYRIA": { - "type": "string" - }, - "LINK": { - "type": "string" - }, - "QTUM": { - "type": "string" - }, - "TUNE": { - "type": "string" - }, - "UFO": { - "type": "string" - }, - "CYBER": { - "type": "string" - }, - "WILD": { - "type": "string" - }, - "POLS": { - "type": "string" - }, - "NYM": { - "type": "string" - }, - "FIL": { - "type": "string" - }, - "BAL": { - "type": "string" - }, - "SCA": { - "type": "string" - }, - "STND": { - "type": "string" - }, - "WMTX": { - "type": "string" - }, - "SCLP": { - "type": "string" - }, - "MANEKI": { - "type": "string" - }, - "BAT": { - "type": "string" - }, - "AKRO": { - "type": "string" - }, - "FTM3L": { - "type": "string" - }, - "BAX": { - "type": "string" - }, - "FTM3S": { - "type": "string" - }, - "COTI": { - "type": "string" - } - }, - "required": [ - "AGLD", - "DFI", - "PYTHUP", - "ISLM", - "NEAR", - "AIOZ", - "AUDIO", - "BBL", - "WLD", - "HNT", - "ETHFI", - "DMAIL", - "OPUP", - "VET3S", - "MANA3S", - "TIDAL", - "HALO", - "OPUL", - "MANA3L", - "DGB", - "AA", - "BCH", - "GMEE", - "JST", - "PBUX", - "AR", - "SEI", - "PSTAKE", - "LMWR", - "UNFIDOWN", - "BB", - "JTO", - "WEMIX", - "G", - "MARSH", - "BN", - "FLIP", - "FLR", - "BIGTIME", - "FLY", - "T", - "W", - "BDX", - "BABYDOGE", - "SFP", - "DIA", - "ISME", - "LYM", - "VET3L", - "JUP", - "LYX", - "AIEPK", - "SILLY", - "SCPT", - "WOO", - "BLUR", - "STRK", - "BFC", - "DC", - "KARATE", - "SUSHI3L", - "NETVR", - "WAVES", - "LITH", - "HAPI", - "SUSHI3S", - "CEEK", - "FLOKI", - "SHR", - "SAND", - "TURT", - "UMA", - "BEPRO", - "SCRT", - "TUSD", - "COOKIE", - "LRDS", - "SIN", - "OAS", - "ROOT", - "ADA3L", - "TIAUP", - "HTR", - "UNB", - "UNA", - "HARD", - "G3", - "ADA3S", - "MYRO", - "HTX", - "FT", - "BTCDOWN", - "UNI", - "FX", - "OBI", - "UNO", - "WRX", - "TIADOWN", - "ETHDOWN", - "WELL", - "SWFTC", - "SKL", - "UOS", - "AIPAD", - "BRETT", - "SKY", - "FRM", - "VISION", - "LENDS", - "SLF", - "BULL", - "FLOW", - "ODDZ", - "SLN", - "UPO", - "SLP", - "ID", - "SLIM", - "SPOT", - "DOP", - "ISSP", - "UQC", - "IO", - "DOT", - "1INCH", - "SMH", - "MAK", - "TOKO", - "TURBO", - "UNFI", - "MAN", - "EVER", - "FTM", - "SHRAP", - "MAV", - "MAX", - "DPR", - "FTT", - "ARKM", - "ATOM", - "PENDLE", - "QUICK", - "BLZ", - "BOBA", - "MBL", - "OFN", - "UNIO", - "SNS", - "SNX", - "NXRA", - "TAIKO", - "AVAX3L", - "L3", - "API3", - "XRP3S", - "QKC", - "AVAX3S", - "ROSE", - "SATS", - "BMX", - "PORTAL", - "TOMI", - "XRP3L", - "SOL", - "SON", - "BNC", - "SOCIAL", - "CGPT", - "CELR", - "BNB", - "OGN", - "CELO", - "AUCTION", - "MANTA", - "LAYER", - "AERO", - "CETUS", - "LL", - "SPA", - "PYTHDOWN", - "NEIROCTO", - "UTK", - "GMRX", - "BOB", - "HOTCROSS", - "AERGO", - "MOCA", - "SQD", - "MV", - "BNB3L", - "BNB3S", - "GALAX3L", - "KAI", - "SQR", - "GALAX3S", - "EGLD", - "ZBCN", - "KAS", - "MEW", - "PUNDIX", - "LOOKS", - "FXS", - "BOSON", - "BRISE", - "AEVO", - "FLUX", - "PRCL", - "UNFIUP", - "SEIDOWN", - "DOAI", - "QNT", - "REDO", - "STRIKE", - "ETHW", - "OM", - "OP", - "WHALE", - "1CAT", - "NEON", - "GTAI", - "SSV", - "ETH2", - "KCS", - "ARPA", - "ARTFI", - "BRL", - "ALEX", - "STG", - "SHIB", - "IOTX", - "OLE", - "KDA", - "CERE", - "DOCK", - "STX", - "OLT", - "QI", - "SDAO", - "BLAST", - "LINK3S", - "IOST", - "SUI", - "CAKE", - "BSW", - "OMG", - "VOLT", - "LINK3L", - "GEEQ", - "PYUSD", - "SUN", - "TOWER", - "BTC", - "IOTA", - "REEF", - "TRIAS", - "KEY", - "ETH3L", - "BTT", - "ONE", - "RENDER", - "ETH3S", - "ANKR", - "ALGO", - "SYLO", - "ZCX", - "SD", - "ONT", - "MJT", - "DYM", - "DYP", - "BAKEUP", - "OOE", - "ZELIX", - "DOGE3L", - "ARTY", - "QORPO", - "ICE", - "NOTAI", - "DOGE3S", - "NAKA", - "GALAX", - "MKR", - "DODO", - "ICP", - "ZEC", - "ZEE", - "ICX", - "KMNO", - "TT", - "DOT3L", - "XAI", - "ZEN", - "DOGE", - "ALPHA", - "DUSK", - "DOT3S", - "SXP", - "HBAR", - "SYNT", - "ZEX", - "BONDLY", - "MLK", - "KICKS", - "PEPE", - "OUSD", - "LUNCDOWN", - "DOGS", - "REV3L", - "CTSI", - "C98", - "OSMO", - "NTRN", - "CFX2S", - "SYN", - "VIDT", - "SYS", - "GAS", - "BOME", - "COMBO", - "XCH", - "VR", - "CFX2L", - "VSYS", - "PANDORA", - "THETA", - "XCN", - "NEXG", - "MELOS", - "XCV", - "ORN", - "WLKN", - "AAVE", - "MNT", - "BONK", - "PERP", - "XDC", - "MNW", - "XDB", - "BOND", - "SUIA", - "MOG", - "SUTER", - "TIME", - "RACA", - "BICO", - "MON", - "SWEAT", - "MOXIE", - "BABYBNB", - "IGU", - "HMSTR", - "XEC", - "MONI", - "XR", - "PEOPLE", - "PUMLX", - "ZIL", - "WLDDOWN", - "VAI", - "XEN", - "MPC", - "XEM", - "JASMY3S", - "OTK", - "TRAC", - "DFYN", - "BIDP", - "JASMY3L", - "INJDOWN", - "KLV", - "WAXL", - "TRBDOWN", - "BCH3L", - "GMT3S", - "KMD", - "BCH3S", - "ECOX", - "AAVE3S", - "GMT3L", - "EPIK", - "SUIP", - "AAVE3L", - "ZK", - "ZKF", - "OMNIA", - "ZKJ", - "ZKL", - "GAFI", - "CARV", - "KNC", - "CATS", - "PROM", - "ALEPH", - "PONKE", - "OVR", - "CATI", - "ORDER", - "GFT", - "BIFI", - "GGC", - "GGG", - "DAPPX", - "SUKU", - "ULTI", - "CREDI", - "ERTHA", - "FURY", - "KARRAT", - "MOBILE", - "SIDUS", - "NAVI", - "TAO", - "USDJ", - "MTL", - "VET", - "FITFI", - "USDT", - "OXT", - "CANDY", - "USDP", - "MTS", - "TADA", - "MTV", - "NAVX", - "ILV", - "VINU", - "GHX", - "EDU", - "HYVE", - "BTC3L", - "ANYONE", - "BEAT", - "KING", - "CREAM", - "CAS", - "IMX", - "CAT", - "BTC3S", - "USDE", - "USDD", - "CWAR", - "USDC", - "KRL", - "INJ", - "GAME", - "TRIBL", - "XLM", - "TRBUP", - "VRADOWN", - "SUPER", - "EIGEN", - "IOI", - "KSM", - "CCD", - "EGO", - "EGP", - "MXC", - "TEL", - "MOVR", - "XMR", - "MXM", - "OORT", - "GLM", - "RAY", - "XTAG", - "GLQ", - "CWEB", - "REVU", - "REVV", - "ZRO", - "XNL", - "XNO", - "SAROS", - "KACE", - "ZRX", - "WLTH", - "ATOM3L", - "GMM", - "BEER", - "GMT", - "HEART", - "GMX", - "ABBC", - "OMNI", - "ATOM3S", - "IRL", - "CFG", - "WSDM", - "GNS", - "VANRY", - "CFX", - "GRAIL", - "BEFI", - "VELO", - "XPR", - "DOVI", - "ACE", - "ACH", - "ISP", - "XCAD", - "MINA", - "TIA", - "DRIFT", - "ACQ", - "ACS", - "MIND", - "STORE", - "REN", - "ELA", - "DREAMS", - "ADA", - "ELF", - "REQ", - "STORJ", - "LADYS", - "PAXG", - "REZ", - "XRD", - "CHO", - "CHR", - "ADS", - "CHZ", - "ADX", - "XRP", - "JASMY", - "KAGI", - "FIDA", - "PBR", - "AEG", - "H2O", - "CHMB", - "SAND3L", - "PBX", - "SOLVE", - "DECHAT", - "GARI", - "SHIB2L", - "SHIB2S", - "ENA", - "VEMP", - "ENJ", - "AFG", - "RATS", - "GRT", - "FORWARD", - "TFUEL", - "ENS", - "KASDOWN", - "XTM", - "DEGEN", - "TLM", - "DYDXDOWN", - "CKB", - "LUNC", - "AURORA", - "LUNA", - "XTZ", - "ELON", - "DMTR", - "EOS", - "GST", - "FORT", - "FLAME", - "PATEX", - "DEEP", - "ID3L", - "GTC", - "ID3S", - "RIO", - "CLH", - "BURGER", - "VRA", - "SUNDOG", - "GTT", - "INJUP", - "CPOOL", - "EPX", - "CLV", - "FEAR", - "MEME", - "ROOBEE", - "DEFI", - "TOKEN", - "GRAPE", - "KASUP", - "XWG", - "SKEY", - "SFUND", - "EQX", - "ORDIUP", - "TON", - "DEGO", - "IZI", - "ERG", - "ERN", - "VENOM", - "VOXEL", - "RLC", - "PHA", - "DYDXUP", - "APE3S", - "ORBS", - "OPDOWN", - "ESE", - "APE3L", - "HMND", - "COQ", - "AURY", - "CULT", - "AKT", - "GLMR", - "XYM", - "ORAI", - "XYO", - "ETC", - "LAI", - "PIP", - "ETH", - "NEO", - "RMV", - "KLAY", - "PIT", - "TARA", - "KALT", - "PIX", - "ETN", - "CSIX", - "TRADE", - "MAVIA", - "HIGH", - "TRB", - "ORDI", - "TRVL", - "AMB", - "TRU", - "LOGX", - "FINC", - "INFRA", - "NATIX", - "NFP", - "TRY", - "TRX", - "LBP", - "LBR", - "EUL", - "NFT", - "SEIUP", - "PUFFER", - "EUR", - "ORCA", - "NEAR3L", - "AMP", - "XDEFI", - "HIFI", - "TRUF", - "AITECH", - "AMU", - "USTC", - "KNGL", - "FOXY", - "NGC", - "TENET", - "NEAR3S", - "MAHA", - "NGL", - "TST", - "HIPPO", - "AXS3S", - "CRO", - "ZPAY", - "MNDE", - "CRV", - "SWASH", - "AXS3L", - "VERSE", - "RPK", - "RPL", - "AZERO", - "SOUL", - "VXV", - "LDO", - "MAGIC", - "ALICE", - "SEAM", - "PLU", - "AOG", - "SMOLE", - "EWT", - "TSUGT", - "PMG", - "OPAI", - "LOCUS", - "CTA", - "NIM", - "CTC", - "APE", - "MERL", - "JAM", - "CTI", - "APP", - "APT", - "WLDUP", - "ZEND", - "FIRE", - "DENT", - "PYTH", - "LFT", - "DPET", - "ORDIDOWN", - "KPOL", - "ETHUP", - "BAND", - "POL", - "ASTR", - "NKN", - "RSR", - "DVPN", - "TWT", - "ARB", - "CVC", - "ARC", - "XETA", - "MTRG", - "LOKA", - "LPOOL", - "TURBOS", - "CVX", - "ARX", - "MPLX", - "SUSHI", - "NLK", - "PEPE2", - "WBTC", - "SUI3L", - "CWS", - "SUI3S", - "INSP", - "MANA", - "VRTX", - "CSPR", - "ATA", - "OPEN", - "HAI", - "NMR", - "ATH", - "LIT", - "TLOS", - "TNSR", - "CXT", - "POLYX", - "ZERO", - "ROUTE", - "LOOM", - "PRE", - "VRAUP", - "HBB", - "RVN", - "PRQ", - "ONDO", - "PEPEDOWN", - "WOOP", - "LUNCUP", - "KAVA", - "LKI", - "AVA", - "NOM", - "MAPO", - "PEPEUP", - "STRAX", - "NOT", - "ZERC", - "BCUT", - "MASA", - "WAN", - "WAT", - "WAX", - "MASK", - "EOS3L", - "IDEA", - "EOS3S", - "YFI", - "MOODENG", - "XCUR", - "HYDRA", - "POPCAT", - "LQTY", - "PIXEL", - "LMR", - "ZETA", - "YGG", - "AXS", - "BCHSV", - "NRN", - "FTON", - "COMP", - "XPRT", - "HFT", - "UXLINK", - "STAMP", - "RUNE", - "ZEUS", - "LTC3L", - "DAPP", - "FORTH", - "ALPINE", - "SENSO", - "LTC3S", - "DEXE", - "GOAL", - "AVAX", - "LISTA", - "AMPL", - "WORK", - "BRWL", - "BANANA", - "PUSH", - "WEN", - "NEIRO", - "BTCUP", - "SOL3S", - "BRAWL", - "LAY3R", - "LPT", - "GODS", - "SAND3S", - "RDNT", - "SOL3L", - "NIBI", - "NUM", - "PYR", - "DAG", - "DAI", - "HIP", - "DAO", - "AVAIL", - "DAR", - "FET", - "FCON", - "XAVA", - "LRC", - "UNI3S", - "POKT", - "DASH", - "BAKEDOWN", - "POLC", - "CIRUS", - "UNI3L", - "NWC", - "POLK", - "LSD", - "MARS4", - "LSK", - "BLOCK", - "ANALOS", - "SAFE", - "DCK", - "LSS", - "DCR", - "LIKE", - "DATA", - "WIF", - "BLOK", - "LTC", - "METIS", - "WIN", - "HLG", - "LTO", - "DYDX", - "ARB3S", - "MUBI", - "ARB3L", - "RBTC1", - "POND", - "LINA", - "MYRIA", - "LINK", - "QTUM", - "TUNE", - "UFO", - "CYBER", - "WILD", - "POLS", - "NYM", - "FIL", - "BAL", - "SCA", - "STND", - "WMTX", - "SCLP", - "MANEKI", - "BAT", - "AKRO", - "FTM3L", - "BAX", - "FTM3S", - "COTI" + "chains": { + "type": "array", + "items": { + "type": "object", + "properties": { + "chainName": { + "type": "string", + "description": "chain name of currency" + }, + "withdrawalMinSize": { + "type": "string", + "description": "Minimum withdrawal amount" + }, + "depositMinSize": { + "type": "string", + "description": "Minimum deposit amount" + }, + "withdrawFeeRate": { + "type": "string", + "description": "withdraw fee rate" + }, + "withdrawalMinFee": { + "type": "string", + "description": "Minimum fees charged for withdrawal" + }, + "isWithdrawEnabled": { + "type": "boolean", + "description": "Support withdrawal or not" + }, + "isDepositEnabled": { + "type": "boolean", + "description": "Support deposit or not" + }, + "confirms": { + "type": "integer", + "description": "Number of block confirmations" + }, + "preConfirms": { + "type": "integer", + "description": "The number of blocks (confirmations) for advance on-chain verification" + }, + "contractAddress": { + "type": "string", + "description": "Contract address" + }, + "withdrawPrecision": { + "type": "integer", + "description": "Withdrawal precision bit, indicating the maximum supported length after the decimal point of the withdrawal amount" + }, + "maxWithdraw": { + "type": "number", + "description": "Maximum amount of single withdrawal" + }, + "maxDeposit": { + "type": "string", + "description": "Maximum amount of single deposit (only applicable to Lightning Network)" + }, + "needTag": { + "type": "boolean", + "description": "whether memo/tag is needed" + }, + "chainId": { + "type": "string", + "description": "chain id of currency" + } + }, + "required": [ + "chainName", + "withdrawalMinSize", + "depositMinSize", + "withdrawFeeRate", + "withdrawalMinFee", + "isWithdrawEnabled", + "isDepositEnabled", + "confirms", + "preConfirms", + "contractAddress", + "withdrawPrecision", + "maxWithdraw", + "maxDeposit", + "needTag", + "chainId" + ] + }, + "description": "chain list" + } + }, + "required": [ + "currency", + "name", + "fullName", + "precision", + "confirms", + "contractAddress", + "isMarginEnabled", + "isDebitEnabled", + "chains" + ] + } + }, + "required": [ + "code", + "data" + ] + } + } + } + } + }, + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470155", + "x-abandon": "normal", + "x-domain": "Spot", + "x-api-channel": "Public", + "x-api-permission": "NULL", + "x-api-rate-limit-pool": "Public", + "x-sdk-service": "Spot", + "x-sdk-sub-service": "Market", + "x-sdk-method-name": "getCurrency", + "x-sdk-method-description": "Request via this endpoint to get the currency details of a specified currency", + "x-api-rate-limit": 3, + "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"currency\\\":\\\"BTC\\\",\\\"name\\\":\\\"BTC\\\",\\\"fullName\\\":\\\"Bitcoin\\\",\\\"precision\\\":8,\\\"confirms\\\":null,\\\"contractAddress\\\":null,\\\"isMarginEnabled\\\":true,\\\"isDebitEnabled\\\":true,\\\"chains\\\":[{\\\"chainName\\\":\\\"BTC\\\",\\\"withdrawalMinSize\\\":\\\"0.001\\\",\\\"depositMinSize\\\":\\\"0.0002\\\",\\\"withdrawFeeRate\\\":\\\"0\\\",\\\"withdrawalMinFee\\\":\\\"0.0005\\\",\\\"isWithdrawEnabled\\\":true,\\\"isDepositEnabled\\\":true,\\\"confirms\\\":3,\\\"preConfirms\\\":1,\\\"contractAddress\\\":\\\"\\\",\\\"withdrawPrecision\\\":8,\\\"maxWithdraw\\\":null,\\\"maxDeposit\\\":null,\\\"needTag\\\":false,\\\"chainId\\\":\\\"btc\\\"},{\\\"chainName\\\":\\\"Lightning Network\\\",\\\"withdrawalMinSize\\\":\\\"0.00001\\\",\\\"depositMinSize\\\":\\\"0.00001\\\",\\\"withdrawFeeRate\\\":\\\"0\\\",\\\"withdrawalMinFee\\\":\\\"0.000015\\\",\\\"isWithdrawEnabled\\\":true,\\\"isDepositEnabled\\\":true,\\\"confirms\\\":1,\\\"preConfirms\\\":1,\\\"contractAddress\\\":\\\"\\\",\\\"withdrawPrecision\\\":8,\\\"maxWithdraw\\\":null,\\\"maxDeposit\\\":\\\"0.03\\\",\\\"needTag\\\":false,\\\"chainId\\\":\\\"btcln\\\"},{\\\"chainName\\\":\\\"KCC\\\",\\\"withdrawalMinSize\\\":\\\"0.0008\\\",\\\"depositMinSize\\\":null,\\\"withdrawFeeRate\\\":\\\"0\\\",\\\"withdrawalMinFee\\\":\\\"0.00002\\\",\\\"isWithdrawEnabled\\\":true,\\\"isDepositEnabled\\\":true,\\\"confirms\\\":20,\\\"preConfirms\\\":20,\\\"contractAddress\\\":\\\"0xfa93c12cd345c658bc4644d1d4e1b9615952258c\\\",\\\"withdrawPrecision\\\":8,\\\"maxWithdraw\\\":null,\\\"maxDeposit\\\":null,\\\"needTag\\\":false,\\\"chainId\\\":\\\"kcc\\\"},{\\\"chainName\\\":\\\"BTC-Segwit\\\",\\\"withdrawalMinSize\\\":\\\"0.0008\\\",\\\"depositMinSize\\\":\\\"0.0002\\\",\\\"withdrawFeeRate\\\":\\\"0\\\",\\\"withdrawalMinFee\\\":\\\"0.0005\\\",\\\"isWithdrawEnabled\\\":false,\\\"isDepositEnabled\\\":true,\\\"confirms\\\":2,\\\"preConfirms\\\":2,\\\"contractAddress\\\":\\\"\\\",\\\"withdrawPrecision\\\":8,\\\"maxWithdraw\\\":null,\\\"maxDeposit\\\":null,\\\"needTag\\\":false,\\\"chainId\\\":\\\"bech32\\\"}]}}", + "x-request-example": "{\\\"currency\\\": \\\"BTC\\\", \\\"chain\\\": \\\"eth\\\"}" + } + }, + "/api/v3/currencies": { + "get": { + "summary": "Get All Currencies", + "deprecated": false, + "description": "Request via this endpoint to get the currency list.Not all currencies currently can be used for trading.", + "tags": [], + "parameters": [], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "array", + "items": { + "type": "object", + "properties": { + "currency": { + "type": "string", + "description": "A unique currency code that will never change" + }, + "name": { + "type": "string", + "description": "Currency name, will change after renaming" + }, + "fullName": { + "type": "string", + "description": "Full name of a currency, will change after renaming" + }, + "precision": { + "type": "integer", + "description": "Currency precision" + }, + "confirms": { + "type": "integer", + "description": "Number of block confirmations" + }, + "contractAddress": { + "type": "string", + "description": "Contract address" + }, + "isMarginEnabled": { + "type": "boolean", + "description": "Support margin or not" + }, + "isDebitEnabled": { + "type": "boolean", + "description": "Support debit or not" + }, + "chains": { + "type": "array", + "items": { + "type": "object", + "properties": { + "chainName": { + "type": "string", + "description": "chain name of currency" + }, + "withdrawalMinSize": { + "type": "string", + "description": "Minimum withdrawal amount" + }, + "depositMinSize": { + "type": "string", + "description": "Minimum deposit amount" + }, + "withdrawFeeRate": { + "type": "string", + "description": "withdraw fee rate" + }, + "withdrawalMinFee": { + "type": "string", + "description": "Minimum fees charged for withdrawal" + }, + "isWithdrawEnabled": { + "type": "boolean", + "description": "Support withdrawal or not" + }, + "isDepositEnabled": { + "type": "boolean", + "description": "Support deposit or not" + }, + "confirms": { + "type": "integer", + "description": "Number of block confirmations" + }, + "preConfirms": { + "type": "integer", + "description": "The number of blocks (confirmations) for advance on-chain verification" + }, + "contractAddress": { + "type": "string", + "description": "Contract address" + }, + "withdrawPrecision": { + "type": "integer", + "description": "Withdrawal precision bit, indicating the maximum supported length after the decimal point of the withdrawal amount" + }, + "maxWithdraw": { + "type": "string", + "description": "Maximum amount of single withdrawal" + }, + "maxDeposit": { + "type": "string", + "description": "Maximum amount of single deposit (only applicable to Lightning Network)" + }, + "needTag": { + "type": "boolean", + "description": "whether memo/tag is needed" + }, + "chainId": { + "type": "string", + "description": "chain id of currency" + }, + "depositFeeRate": { + "type": "string", + "description": "deposit fee rate (some currencies have this param, the default is empty)" + }, + "withdrawMaxFee": { + "type": "string", + "description": "withdraw max fee(some currencies have this param, the default is empty)" + }, + "depositTierFee": { + "type": "string" + } + }, + "required": [ + "chainName", + "withdrawalMinSize", + "depositMinSize", + "withdrawFeeRate", + "withdrawalMinFee", + "isWithdrawEnabled", + "isDepositEnabled", + "confirms", + "preConfirms", + "contractAddress", + "withdrawPrecision", + "maxWithdraw", + "maxDeposit", + "needTag", + "chainId" + ] + }, + "description": "chain list" + } + }, + "required": [ + "currency", + "name", + "fullName", + "precision", + "confirms", + "contractAddress", + "isMarginEnabled", + "isDebitEnabled", + "chains" + ] + } + } + }, + "required": [ + "code", + "data" + ] + } + } + } + } + }, + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470152", + "x-abandon": "normal", + "x-domain": "Spot", + "x-api-channel": "Public", + "x-api-permission": "NULL", + "x-api-rate-limit-pool": "Public", + "x-sdk-service": "Spot", + "x-sdk-sub-service": "Market", + "x-sdk-method-name": "getAllCurrencies", + "x-sdk-method-description": "Request via this endpoint to get the currency list.Not all currencies currently can be used for trading.", + "x-api-rate-limit": 3, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": [\\n {\\n \\\"currency\\\": \\\"BTC\\\",\\n \\\"name\\\": \\\"BTC\\\",\\n \\\"fullName\\\": \\\"Bitcoin\\\",\\n \\\"precision\\\": 8,\\n \\\"confirms\\\": null,\\n \\\"contractAddress\\\": null,\\n \\\"isMarginEnabled\\\": true,\\n \\\"isDebitEnabled\\\": true,\\n \\\"chains\\\": [\\n {\\n \\\"chainName\\\": \\\"BTC\\\",\\n \\\"withdrawalMinSize\\\": \\\"0.001\\\",\\n \\\"depositMinSize\\\": \\\"0.0002\\\",\\n \\\"withdrawFeeRate\\\": \\\"0\\\",\\n \\\"withdrawalMinFee\\\": \\\"0.0005\\\",\\n \\\"isWithdrawEnabled\\\": true,\\n \\\"isDepositEnabled\\\": true,\\n \\\"confirms\\\": 3,\\n \\\"preConfirms\\\": 1,\\n \\\"contractAddress\\\": \\\"\\\",\\n \\\"withdrawPrecision\\\": 8,\\n \\\"maxWithdraw\\\": null,\\n \\\"maxDeposit\\\": null,\\n \\\"needTag\\\": false,\\n \\\"chainId\\\": \\\"btc\\\"\\n },\\n {\\n \\\"chainName\\\": \\\"Lightning Network\\\",\\n \\\"withdrawalMinSize\\\": \\\"0.00001\\\",\\n \\\"depositMinSize\\\": \\\"0.00001\\\",\\n \\\"withdrawFeeRate\\\": \\\"0\\\",\\n \\\"withdrawalMinFee\\\": \\\"0.000015\\\",\\n \\\"isWithdrawEnabled\\\": true,\\n \\\"isDepositEnabled\\\": true,\\n \\\"confirms\\\": 1,\\n \\\"preConfirms\\\": 1,\\n \\\"contractAddress\\\": \\\"\\\",\\n \\\"withdrawPrecision\\\": 8,\\n \\\"maxWithdraw\\\": null,\\n \\\"maxDeposit\\\": \\\"0.03\\\",\\n \\\"needTag\\\": false,\\n \\\"chainId\\\": \\\"btcln\\\"\\n },\\n {\\n \\\"chainName\\\": \\\"KCC\\\",\\n \\\"withdrawalMinSize\\\": \\\"0.0008\\\",\\n \\\"depositMinSize\\\": null,\\n \\\"withdrawFeeRate\\\": \\\"0\\\",\\n \\\"withdrawalMinFee\\\": \\\"0.00002\\\",\\n \\\"isWithdrawEnabled\\\": true,\\n \\\"isDepositEnabled\\\": true,\\n \\\"confirms\\\": 20,\\n \\\"preConfirms\\\": 20,\\n \\\"contractAddress\\\": \\\"0xfa93c12cd345c658bc4644d1d4e1b9615952258c\\\",\\n \\\"withdrawPrecision\\\": 8,\\n \\\"maxWithdraw\\\": null,\\n \\\"maxDeposit\\\": null,\\n \\\"needTag\\\": false,\\n \\\"chainId\\\": \\\"kcc\\\"\\n },\\n {\\n \\\"chainName\\\": \\\"BTC-Segwit\\\",\\n \\\"withdrawalMinSize\\\": \\\"0.0008\\\",\\n \\\"depositMinSize\\\": \\\"0.0002\\\",\\n \\\"withdrawFeeRate\\\": \\\"0\\\",\\n \\\"withdrawalMinFee\\\": \\\"0.0005\\\",\\n \\\"isWithdrawEnabled\\\": false,\\n \\\"isDepositEnabled\\\": true,\\n \\\"confirms\\\": 2,\\n \\\"preConfirms\\\": 2,\\n \\\"contractAddress\\\": \\\"\\\",\\n \\\"withdrawPrecision\\\": 8,\\n \\\"maxWithdraw\\\": null,\\n \\\"maxDeposit\\\": null,\\n \\\"needTag\\\": false,\\n \\\"chainId\\\": \\\"bech32\\\"\\n }\\n ]\\n },\\n {\\n \\\"currency\\\": \\\"BTCP\\\",\\n \\\"name\\\": \\\"BTCP\\\",\\n \\\"fullName\\\": \\\"Bitcoin Private\\\",\\n \\\"precision\\\": 8,\\n \\\"confirms\\\": null,\\n \\\"contractAddress\\\": null,\\n \\\"isMarginEnabled\\\": false,\\n \\\"isDebitEnabled\\\": false,\\n \\\"chains\\\": [\\n {\\n \\\"chainName\\\": \\\"BTCP\\\",\\n \\\"withdrawalMinSize\\\": \\\"0.100000\\\",\\n \\\"depositMinSize\\\": null,\\n \\\"withdrawFeeRate\\\": \\\"0\\\",\\n \\\"withdrawalMinFee\\\": \\\"0.010000\\\",\\n \\\"isWithdrawEnabled\\\": false,\\n \\\"isDepositEnabled\\\": false,\\n \\\"confirms\\\": 6,\\n \\\"preConfirms\\\": 6,\\n \\\"contractAddress\\\": \\\"\\\",\\n \\\"withdrawPrecision\\\": 8,\\n \\\"maxWithdraw\\\": null,\\n \\\"maxDeposit\\\": null,\\n \\\"needTag\\\": false,\\n \\\"chainId\\\": \\\"btcp\\\"\\n }\\n ]\\n }\\n ]\\n}" + } + }, + "/api/v2/symbols/{symbol}": { + "get": { + "summary": "Get Symbol ", + "deprecated": false, + "description": "Request via this endpoint to get detail currency pairs for trading. If you want to get the market information of the trading symbol, please use Get All Tickers.", + "tags": [], + "parameters": [ + { + "name": "symbol", + "in": "path", + "description": "Path parameter, Symbol", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "object", + "properties": { + "symbol": { + "type": "string", + "description": "unique code of a symbol, it would not change after renaming", + "example": [ + "BTC-USDT", + "BCHSV-USDT" + ] + }, + "name": { + "type": "string", + "description": "Name of trading pairs, it would change after renaming", + "example": [ + "BTC-USDT", + "BSV-USDT" + ] + }, + "baseCurrency": { + "type": "string", + "description": "Base currency,e.g. BTC." + }, + "quoteCurrency": { + "type": "string", + "description": "Quote currency,e.g. USDT." + }, + "feeCurrency": { + "type": "string", + "description": "The currency of charged fees." + }, + "market": { + "type": "string", + "description": "The trading market.", + "example": [ + "USDS", + "BTC", + "ALTS" + ] + }, + "baseMinSize": { + "type": "string", + "description": "The minimum order quantity requried to place an order." + }, + "quoteMinSize": { + "type": "string", + "description": "The minimum order funds required to place a market order." + }, + "baseMaxSize": { + "type": "string", + "description": "The maximum order size required to place an order." + }, + "quoteMaxSize": { + "type": "string", + "description": "The maximum order funds required to place a market order." + }, + "baseIncrement": { + "type": "string", + "description": "Quantity increment: The quantity for an order must be a positive integer multiple of this increment. Here, the size refers to the quantity of the base currency for the order. For example, for the ETH-USDT trading pair, if the baseIncrement is 0.0000001, the order quantity can be 1.0000001 but not 1.00000001." + }, + "quoteIncrement": { + "type": "string", + "description": "Quote increment: The funds for a market order must be a positive integer multiple of this increment. The funds refer to the quote currency amount. For example, for the ETH-USDT trading pair, if the quoteIncrement is 0.000001, the amount of USDT for the order can be 3000.000001 but not 3000.0000001." + }, + "priceIncrement": { + "type": "string", + "description": "Price increment: The price of an order must be a positive integer multiple of this increment. For example, for the ETH-USDT trading pair, if the priceIncrement is 0.01, the order price can be 3000.01 but not 3000.001." + }, + "priceLimitRate": { + "type": "string", + "description": "Threshold for price portection" + }, + "minFunds": { + "type": "string", + "description": "the minimum trading amounts" + }, + "isMarginEnabled": { + "type": "boolean", + "description": "Available for margin or not." + }, + "enableTrading": { + "type": "boolean", + "description": "Available for transaction or not." + }, + "feeCategory": { + "type": "integer", + "description": "[Fee Type](https://www.kucoin.com/vip/privilege)", + "enum": [ + 1, + 2, + 3 + ], + "x-api-enum": [ + { + "value": 1, + "name": "classA", + "description": "classA" + }, + { + "value": 2, + "name": "classB", + "description": "classB" + }, + { + "value": 3, + "name": "classC", + "description": "classC" + } + ] + }, + "makerFeeCoefficient": { + "type": "string", + "description": "The maker fee coefficient. The actual fee needs to be multiplied by this coefficient to get the final fee. Most currencies have a coefficient of 1. If set to 0, it means no fee" + }, + "takerFeeCoefficient": { + "type": "string", + "description": "The taker fee coefficient. The actual fee needs to be multiplied by this coefficient to get the final fee. Most currencies have a coefficient of 1. If set to 0, it means no fee" + }, + "st": { + "type": "boolean" + } + }, + "required": [ + "symbol", + "name", + "baseCurrency", + "quoteCurrency", + "feeCurrency", + "market", + "baseMinSize", + "quoteMinSize", + "baseMaxSize", + "quoteMaxSize", + "baseIncrement", + "quoteIncrement", + "priceIncrement", + "priceLimitRate", + "minFunds", + "isMarginEnabled", + "enableTrading", + "feeCategory", + "makerFeeCoefficient", + "takerFeeCoefficient", + "st" + ] + } + }, + "required": [ + "code", + "data" + ] + } + } + } + } + }, + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470159", + "x-abandon": "normal", + "x-domain": "Spot", + "x-api-channel": "Public", + "x-api-permission": "NULL", + "x-api-rate-limit-pool": "Public", + "x-sdk-service": "Spot", + "x-sdk-sub-service": "Market", + "x-sdk-method-name": "getSymbol", + "x-sdk-method-description": "Request via this endpoint to get detail currency pairs for trading. If you want to get the market information of the trading symbol, please use Get All Tickers.", + "x-api-rate-limit": 4, + "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"symbol\\\":\\\"BTC-USDT\\\",\\\"name\\\":\\\"BTC-USDT\\\",\\\"baseCurrency\\\":\\\"BTC\\\",\\\"quoteCurrency\\\":\\\"USDT\\\",\\\"feeCurrency\\\":\\\"USDT\\\",\\\"market\\\":\\\"USDS\\\",\\\"baseMinSize\\\":\\\"0.00001\\\",\\\"quoteMinSize\\\":\\\"0.1\\\",\\\"baseMaxSize\\\":\\\"10000000000\\\",\\\"quoteMaxSize\\\":\\\"99999999\\\",\\\"baseIncrement\\\":\\\"0.00000001\\\",\\\"quoteIncrement\\\":\\\"0.000001\\\",\\\"priceIncrement\\\":\\\"0.1\\\",\\\"priceLimitRate\\\":\\\"0.1\\\",\\\"minFunds\\\":\\\"0.1\\\",\\\"isMarginEnabled\\\":true,\\\"enableTrading\\\":true,\\\"feeCategory\\\":1,\\\"makerFeeCoefficient\\\":\\\"1.00\\\",\\\"takerFeeCoefficient\\\":\\\"1.00\\\",\\\"st\\\":false}}", + "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\"}" + } + }, + "/api/v2/symbols": { + "get": { + "summary": "Get All Symbols", + "deprecated": false, + "description": "Request via this endpoint to get a list of available currency pairs for trading. If you want to get the market information of the trading symbol, please use Get All Tickers.", + "tags": [], + "parameters": [ + { + "name": "market", + "in": "query", + "description": "[The trading market](https://www.kucoin.com/docs-new/api-222921786)", + "required": false, + "schema": { + "type": "string", + "example": [ + "ALTS", + "USDS", + "ETF" + ] + } + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "array", + "items": { + "type": "object", + "properties": { + "symbol": { + "type": "string", + "description": "unique code of a symbol, it would not change after renaming", + "example": [ + "BTC-USDT", + "BCHSV-USDT" + ] + }, + "name": { + "type": "string", + "description": "Name of trading pairs, it would change after renaming", + "example": [ + "BTC-USDT", + "BSV-USDT" + ] + }, + "baseCurrency": { + "type": "string", + "description": "Base currency,e.g. BTC." + }, + "quoteCurrency": { + "type": "string", + "description": "Quote currency,e.g. USDT." + }, + "feeCurrency": { + "type": "string", + "description": "The currency of charged fees." + }, + "market": { + "type": "string", + "description": "The trading market.", + "example": [ + "USDS", + "BTC", + "ALTS" + ] + }, + "baseMinSize": { + "type": "string", + "description": "The minimum order quantity requried to place an order." + }, + "quoteMinSize": { + "type": "string", + "description": "The minimum order funds required to place a market order." + }, + "baseMaxSize": { + "type": "string", + "description": "The maximum order size required to place an order." + }, + "quoteMaxSize": { + "type": "string", + "description": "The maximum order funds required to place a market order." + }, + "baseIncrement": { + "type": "string", + "description": "Quantity increment: The quantity for an order must be a positive integer multiple of this increment. Here, the size refers to the quantity of the base currency for the order. For example, for the ETH-USDT trading pair, if the baseIncrement is 0.0000001, the order quantity can be 1.0000001 but not 1.00000001." + }, + "quoteIncrement": { + "type": "string", + "description": "Quote increment: The funds for a market order must be a positive integer multiple of this increment. The funds refer to the quote currency amount. For example, for the ETH-USDT trading pair, if the quoteIncrement is 0.000001, the amount of USDT for the order can be 3000.000001 but not 3000.0000001." + }, + "priceIncrement": { + "type": "string", + "description": "Price increment: The price of an order must be a positive integer multiple of this increment. For example, for the ETH-USDT trading pair, if the priceIncrement is 0.01, the order price can be 3000.01 but not 3000.001.\n\nspecifies the min order price as well as the price increment.This also applies to quote currency." + }, + "priceLimitRate": { + "type": "string", + "description": "Threshold for price portection" + }, + "minFunds": { + "type": "string", + "description": "the minimum trading amounts" + }, + "isMarginEnabled": { + "type": "boolean", + "description": "Available for margin or not." + }, + "enableTrading": { + "type": "boolean", + "description": "Available for transaction or not." + }, + "feeCategory": { + "type": "integer", + "description": "[Fee Type](https://www.kucoin.com/vip/privilege)", + "enum": [ + 1, + 2, + 3 + ], + "x-api-enum": [ + { + "value": 1, + "name": "classA", + "description": "classA" + }, + { + "value": 2, + "name": "classB", + "description": "classB" + }, + { + "value": 3, + "name": "classC", + "description": "classC" + } + ] + }, + "makerFeeCoefficient": { + "type": "string", + "description": "The maker fee coefficient. The actual fee needs to be multiplied by this coefficient to get the final fee. Most currencies have a coefficient of 1. If set to 0, it means no fee" + }, + "takerFeeCoefficient": { + "type": "string", + "description": "The taker fee coefficient. The actual fee needs to be multiplied by this coefficient to get the final fee. Most currencies have a coefficient of 1. If set to 0, it means no fee" + }, + "st": { + "type": "boolean", + "description": "Whether it is an [Special Treatment](https://www.kucoin.com/legal/special-treatment) symbol" + } + }, + "required": [ + "symbol", + "name", + "baseCurrency", + "quoteCurrency", + "feeCurrency", + "market", + "baseMinSize", + "quoteMinSize", + "baseMaxSize", + "quoteMaxSize", + "baseIncrement", + "quoteIncrement", + "priceIncrement", + "priceLimitRate", + "minFunds", + "isMarginEnabled", + "enableTrading", + "feeCategory", + "makerFeeCoefficient", + "takerFeeCoefficient", + "st" + ] + } + } + }, + "required": [ + "code", + "data" + ] + } + } + } + } + }, + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470154", + "x-abandon": "normal", + "x-domain": "Spot", + "x-api-channel": "Public", + "x-api-permission": "NULL", + "x-api-rate-limit-pool": "Public", + "x-sdk-service": "Spot", + "x-sdk-sub-service": "Market", + "x-sdk-method-name": "getAllSymbols", + "x-sdk-method-description": "Request via this endpoint to get a list of available currency pairs for trading. If you want to get the market information of the trading symbol, please use Get All Tickers.", + "x-api-rate-limit": 4, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": [\\n {\\n \\\"symbol\\\": \\\"BTC-USDT\\\",\\n \\\"name\\\": \\\"BTC-USDT\\\",\\n \\\"baseCurrency\\\": \\\"BTC\\\",\\n \\\"quoteCurrency\\\": \\\"USDT\\\",\\n \\\"feeCurrency\\\": \\\"USDT\\\",\\n \\\"market\\\": \\\"USDS\\\",\\n \\\"baseMinSize\\\": \\\"0.00001\\\",\\n \\\"quoteMinSize\\\": \\\"0.1\\\",\\n \\\"baseMaxSize\\\": \\\"10000000000\\\",\\n \\\"quoteMaxSize\\\": \\\"99999999\\\",\\n \\\"baseIncrement\\\": \\\"0.00000001\\\",\\n \\\"quoteIncrement\\\": \\\"0.000001\\\",\\n \\\"priceIncrement\\\": \\\"0.1\\\",\\n \\\"priceLimitRate\\\": \\\"0.1\\\",\\n \\\"minFunds\\\": \\\"0.1\\\",\\n \\\"isMarginEnabled\\\": true,\\n \\\"enableTrading\\\": true,\\n \\\"feeCategory\\\": 1,\\n \\\"makerFeeCoefficient\\\": \\\"1.00\\\",\\n \\\"takerFeeCoefficient\\\": \\\"1.00\\\",\\n \\\"st\\\": false\\n }\\n ]\\n}", + "x-request-example": "{\\\"market\\\": \\\"ALTS\\\"}" + } + }, + "/api/v1/market/orderbook/level1": { + "get": { + "summary": "Get Ticker", + "deprecated": false, + "description": "Request via this endpoint to get Level 1 Market Data. The returned value includes the best bid price and size, the best ask price and size as well as the last traded price and the last traded size.", + "tags": [], + "parameters": [ + { + "name": "symbol", + "in": "query", + "description": "symbol", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "object", + "properties": { + "time": { + "type": "integer", + "description": "timestamp", + "format": "int64" + }, + "sequence": { + "type": "string", + "description": "Sequence" + }, + "price": { + "type": "string", + "description": "Last traded price" + }, + "size": { + "type": "string", + "description": "Last traded size" + }, + "bestBid": { + "type": "string", + "description": "Best bid price" + }, + "bestBidSize": { + "type": "string", + "description": "Best bid size" + }, + "bestAsk": { + "type": "string", + "description": "Best ask price" + }, + "bestAskSize": { + "type": "string", + "description": "Best ask size" + } + }, + "required": [ + "sequence", + "price", + "size", + "bestBid", + "bestBidSize", + "bestAsk", + "bestAskSize", + "time" + ] + } + }, + "required": [ + "code", + "data" + ] + } + } + } + } + }, + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470160", + "x-abandon": "normal", + "x-domain": "Spot", + "x-api-channel": "Public", + "x-api-permission": "NULL", + "x-api-rate-limit-pool": "Public", + "x-sdk-service": "Spot", + "x-sdk-sub-service": "Market", + "x-sdk-method-name": "getTicker", + "x-sdk-method-description": "Request via this endpoint to get Level 1 Market Data. The returned value includes the best bid price and size, the best ask price and size as well as the last traded price and the last traded size.", + "x-api-rate-limit": 2, + "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"time\\\":1729172965609,\\\"sequence\\\":\\\"14609309753\\\",\\\"price\\\":\\\"67269\\\",\\\"size\\\":\\\"0.000025\\\",\\\"bestBid\\\":\\\"67267.5\\\",\\\"bestBidSize\\\":\\\"0.000025\\\",\\\"bestAsk\\\":\\\"67267.6\\\",\\\"bestAskSize\\\":\\\"1.24808993\\\"}}", + "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\"}" + } + }, + "/api/v1/market/allTickers": { + "get": { + "summary": "Get All Tickers", + "deprecated": false, + "description": "Request market tickers for all the trading pairs in the market (including 24h volume), takes a snapshot every 2 seconds. On the rare occasion that we will change the currency name, if you still want the changed symbol name, you can use the symbolName field instead of the symbol field via “Get all tickers” endpoint.", + "tags": [], + "parameters": [], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "object", + "properties": { + "time": { + "type": "integer", + "description": "timestamp", + "format": "int64" + }, + "ticker": { + "type": "array", + "items": { + "type": "object", + "properties": { + "symbol": { + "type": "string", + "description": "Symbol" + }, + "symbolName": { + "type": "string", + "description": "Name of trading pairs, it would change after renaming" + }, + "buy": { + "type": "string", + "description": "Best bid price" + }, + "bestBidSize": { + "type": "string", + "description": "Best bid size" + }, + "sell": { + "type": "string", + "description": "Best ask price" + }, + "bestAskSize": { + "type": "string", + "description": "Best ask size" + }, + "changeRate": { + "type": "string", + "description": "24h change rate" + }, + "changePrice": { + "type": "string", + "description": "24h change price" + }, + "high": { + "type": "string", + "description": "Highest price in 24h" + }, + "low": { + "type": "string", + "description": "Lowest price in 24h" + }, + "vol": { + "type": "string", + "description": "24h volume, executed based on base currency" + }, + "volValue": { + "type": "string", + "description": "24h traded amount" + }, + "last": { + "type": "string", + "description": "Last traded price" + }, + "averagePrice": { + "type": "string", + "description": "Average trading price in the last 24 hours" + }, + "takerFeeRate": { + "type": "string", + "description": "Basic Taker Fee" + }, + "makerFeeRate": { + "type": "string", + "description": "Basic Maker Fee" + }, + "takerCoefficient": { + "type": "string", + "description": "The taker fee coefficient. The actual fee needs to be multiplied by this coefficient to get the final fee. Most currencies have a coefficient of 1. If set to 0, it means no fee", + "enum": [ + "1", + "0" + ], + "x-api-enum": [ + { + "value": "1", + "name": "1", + "description": "the taker fee coefficient is 1" + }, + { + "value": "0", + "name": "0", + "description": "no fee" + } + ] + }, + "makerCoefficient": { + "type": "string", + "description": "The maker fee coefficient. The actual fee needs to be multiplied by this coefficient to get the final fee. Most currencies have a coefficient of 1. If set to 0, it means no fee", + "enum": [ + "1", + "0" + ], + "x-api-enum": [ + { + "value": "1", + "name": "1", + "description": "the maker fee coefficient is 1" + }, + { + "value": "0", + "name": "0", + "description": "no fee" + } + ] + } + }, + "required": [ + "symbol", + "symbolName", + "buy", + "bestBidSize", + "sell", + "bestAskSize", + "changeRate", + "changePrice", + "high", + "low", + "vol", + "volValue", + "last", + "averagePrice", + "takerFeeRate", + "makerFeeRate", + "takerCoefficient", + "makerCoefficient" + ] + } + } + }, + "required": [ + "time", + "ticker" ] } }, @@ -3840,7 +1461,7 @@ } } }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470153", + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470167", "x-abandon": "normal", "x-domain": "Spot", "x-api-channel": "Public", @@ -3848,32 +1469,26 @@ "x-api-rate-limit-pool": "Public", "x-sdk-service": "Spot", "x-sdk-sub-service": "Market", - "x-sdk-method-name": "getFiatPrice", - "x-sdk-method-description": "Request via this endpoint to get the fiat price of the currencies for the available trading pairs.", - "x-api-rate-limit": 3, - "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"AGLD\\\":\\\"1.1174410000000001\\\",\\\"DFI\\\":\\\"0.0168915500000000\\\",\\\"PYTHUP\\\":\\\"0.0397880960000000\\\",\\\"ISLM\\\":\\\"0.0606196750000000\\\",\\\"NEAR\\\":\\\"4.7185395500000000\\\",\\\"AIOZ\\\":\\\"0.4862867350000000\\\",\\\"AUDIO\\\":\\\"0.1219390000000000\\\",\\\"BBL\\\":\\\"0.0067766100000000\\\",\\\"WLD\\\":\\\"2.2893547500000000\\\",\\\"HNT\\\":\\\"5.8990489999999984\\\",\\\"ETHFI\\\":\\\"1.5892050000000000\\\",\\\"DMAIL\\\":\\\"0.2726636000000000\\\",\\\"OPUP\\\":\\\"0.0986506500000000\\\",\\\"VET3S\\\":\\\"0.0003700448850000\\\",\\\"MANA3S\\\":\\\"0.0006056970000000\\\",\\\"TIDAL\\\":\\\"0.0001154422500000\\\",\\\"HALO\\\":\\\"0.0058270850000000\\\",\\\"OPUL\\\":\\\"0.0839480050000000\\\",\\\"MANA3L\\\":\\\"0.0029569407900000\\\",\\\"DGB\\\":\\\"0.0066556705000000\\\",\\\"AA\\\":\\\"0.2406796000000000\\\",\\\"BCH\\\":\\\"366.2167999999996484\\\",\\\"GMEE\\\":\\\"0.0113333305000000\\\",\\\"JST\\\":\\\"0.0302348750000000\\\",\\\"PBUX\\\":\\\"0.0208795550000000\\\",\\\"AR\\\":\\\"18.5457224999999909\\\",\\\"SEI\\\":\\\"0.4332832500000000\\\",\\\"PSTAKE\\\":\\\"0.0493153300000000\\\",\\\"LMWR\\\":\\\"0.1618190500000000\\\",\\\"UNFIDOWN\\\":\\\"0.0062058955000000\\\",\\\"BB\\\":\\\"0.3245376500000000\\\",\\\"JTO\\\":\\\"2.1239375000000002\\\",\\\"WEMIX\\\":\\\"0.7916040000000000\\\",\\\"G\\\":\\\"0.0324037900000000\\\",\\\"MARSH\\\":\\\"0.0617591050000000\\\",\\\"BN\\\":\\\"0.0036961510000000\\\",\\\"FLIP\\\":\\\"1.0976509000000000\\\",\\\"FLR\\\":\\\"0.0144827550000000\\\",\\\"BIGTIME\\\":\\\"0.1238780300000000\\\",\\\"FLY\\\":\\\"0.0005157420000000\\\",\\\"T\\\":\\\"0.0233483200000000\\\",\\\"W\\\":\\\"0.2865566500000000\\\",\\\"BDX\\\":\\\"0.0774012800000000\\\",\\\"BABYDOGE\\\":\\\"0.0000000029375305\\\",\\\"SFP\\\":\\\"0.7256370000000000\\\",\\\"DIA\\\":\\\"0.9179408000000000\\\",\\\"ISME\\\":\\\"0.0022388800000000\\\",\\\"LYM\\\":\\\"0.0010155919500000\\\",\\\"VET3L\\\":\\\"0.0000289755050000\\\",\\\"JUP\\\":\\\"0.8230882500000000\\\",\\\"LYX\\\":\\\"1.4501745500000001\\\",\\\"AIEPK\\\":\\\"0.0050094940000000\\\",\\\"SILLY\\\":\\\"0.0159420250000000\\\",\\\"SCPT\\\":\\\"0.0122038950000000\\\",\\\"WOO\\\":\\\"0.1796601250000000\\\",\\\"BLUR\\\":\\\"0.2462768000000000\\\",\\\"STRK\\\":\\\"0.3963117450000000\\\",\\\"BFC\\\":\\\"0.0383608100000000\\\",\\\"DC\\\":\\\"0.0003097450500000\\\",\\\"KARATE\\\":\\\"0.0007296350000000\\\",\\\"SUSHI3L\\\":\\\"0.5115441000000000\\\",\\\"NETVR\\\":\\\"0.0976111700000000\\\",\\\"WAVES\\\":\\\"1.0806594000000000\\\",\\\"LITH\\\":\\\"0.0001520239500000\\\",\\\"HAPI\\\":\\\"8.6533711499999987\\\",\\\"SUSHI3S\\\":\\\"1.2752620500000000\\\",\\\"CEEK\\\":\\\"0.0294852500000000\\\",\\\"FLOKI\\\":\\\"0.0001414292500000\\\",\\\"SHR\\\":\\\"0.0012463765000000\\\",\\\"SAND\\\":\\\"0.2566616050000000\\\",\\\"TURT\\\":\\\"0.0020889550000000\\\",\\\"UMA\\\":\\\"2.5207390000000000\\\",\\\"BEPRO\\\":\\\"0.0003955021500000\\\",\\\"SCRT\\\":\\\"0.1995002000000000\\\",\\\"TUSD\\\":\\\"0.9945025000000000\\\",\\\"COOKIE\\\":\\\"0.0220089900000000\\\",\\\"LRDS\\\":\\\"0.6218889000000000\\\",\\\"SIN\\\":\\\"0.0033633175000000\\\",\\\"OAS\\\":\\\"0.0331933950000000\\\",\\\"ROOT\\\":\\\"0.0183108400000000\\\",\\\"ADA3L\\\":\\\"0.0046396790000000\\\",\\\"TIAUP\\\":\\\"0.1228385500000000\\\",\\\"HTR\\\":\\\"0.0353023400000000\\\",\\\"UNB\\\":\\\"0.0003837080500000\\\",\\\"UNA\\\":\\\"0.0164917500000000\\\",\\\"HARD\\\":\\\"0.1087056200000000\\\",\\\"G3\\\":\\\"0.0502648550000000\\\",\\\"ADA3S\\\":\\\"0.0006191202850000\\\",\\\"MYRO\\\":\\\"0.1071863800000000\\\",\\\"HTX\\\":\\\"0.0000013693150000\\\",\\\"FT\\\":\\\"0.3585206500000000\\\",\\\"BTCDOWN\\\":\\\"0.1065467000000000\\\",\\\"UNI\\\":\\\"7.3571195999999993\\\",\\\"FX\\\":\\\"0.1379310000000000\\\",\\\"OBI\\\":\\\"0.0079030465000000\\\",\\\"UNO\\\":\\\"0.0137131400000000\\\",\\\"WRX\\\":\\\"0.1221389000000000\\\",\\\"TIADOWN\\\":\\\"0.0000914642450000\\\",\\\"ETHDOWN\\\":\\\"0.1306346500000000\\\",\\\"WELL\\\":\\\"0.0471244260000000\\\",\\\"SWFTC\\\":\\\"0.0028966509500000\\\",\\\"SKL\\\":\\\"0.0362418700000000\\\",\\\"UOS\\\":\\\"0.0867765900000000\\\",\\\"AIPAD\\\":\\\"0.0478660550000000\\\",\\\"BRETT\\\":\\\"0.1037481000000000\\\",\\\"SKY\\\":\\\"0.0520139800000000\\\",\\\"FRM\\\":\\\"0.0153123400000000\\\",\\\"VISION\\\":\\\"0.0014451770500000\\\",\\\"LENDS\\\":\\\"0.0047276350000000\\\",\\\"SLF\\\":\\\"0.3318340000000000\\\",\\\"BULL\\\":\\\"0.0023988000000000\\\",\\\"FLOW\\\":\\\"0.5372312500000000\\\",\\\"ODDZ\\\":\\\"0.0063368300000000\\\",\\\"SLN\\\":\\\"0.2804597000000000\\\",\\\"UPO\\\":\\\"0.0440779500000000\\\",\\\"SLP\\\":\\\"0.0023997995000000\\\",\\\"ID\\\":\\\"0.3718140000000000\\\",\\\"SLIM\\\":\\\"0.0906446550000000\\\",\\\"SPOT\\\":\\\"0.0021289350000000\\\",\\\"DOP\\\":\\\"0.0023028480000000\\\",\\\"ISSP\\\":\\\"0.0000874562500000\\\",\\\"UQC\\\":\\\"3.2339822000000003\\\",\\\"IO\\\":\\\"1.8185902499999999\\\",\\\"DOT\\\":\\\"4.2022978000000005\\\",\\\"1INCH\\\":\\\"0.2645676500000000\\\",\\\"SMH\\\":\\\"0.3448275000000000\\\",\\\"MAK\\\":\\\"0.0396701550000000\\\",\\\"TOKO\\\":\\\"0.0005923037000000\\\",\\\"TURBO\\\":\\\"0.0108085930000000\\\",\\\"UNFI\\\":\\\"2.8555714999999996\\\",\\\"MAN\\\":\\\"0.0210764565000000\\\",\\\"EVER\\\":\\\"0.0332733550000000\\\",\\\"FTM\\\":\\\"0.7259068650000000\\\",\\\"SHRAP\\\":\\\"0.0476361700000000\\\",\\\"MAV\\\":\\\"0.1738130500000000\\\",\\\"MAX\\\":\\\"0.2864966800000000\\\",\\\"DPR\\\":\\\"0.0018240875000000\\\",\\\"FTT\\\":\\\"2.0559715000000002\\\",\\\"ARKM\\\":\\\"1.7444273499999999\\\",\\\"ATOM\\\":\\\"4.2954512000000002\\\",\\\"PENDLE\\\":\\\"4.1554212500000007\\\",\\\"QUICK\\\":\\\"0.0365317250000000\\\",\\\"BLZ\\\":\\\"0.1217191100000000\\\",\\\"BOBA\\\":\\\"0.2014092450000000\\\",\\\"MBL\\\":\\\"0.0027856065000000\\\",\\\"OFN\\\":\\\"0.1252373500000000\\\",\\\"UNIO\\\":\\\"0.0025487250000000\\\",\\\"SNS\\\":\\\"0.0200899500000000\\\",\\\"SNX\\\":\\\"1.4282854999999999\\\",\\\"NXRA\\\":\\\"0.0272763550000000\\\",\\\"TAIKO\\\":\\\"1.4392800000000001\\\",\\\"AVAX3L\\\":\\\"0.1410875109550000\\\",\\\"L3\\\":\\\"0.0608395650000000\\\",\\\"API3\\\":\\\"1.3728132500000001\\\",\\\"XRP3S\\\":\\\"0.0028095945000000\\\",\\\"QKC\\\":\\\"0.0085157400000000\\\",\\\"AVAX3S\\\":\\\"0.5148424500000000\\\",\\\"ROSE\\\":\\\"0.0693453100000000\\\",\\\"SATS\\\":\\\"0.0000002701648500\\\",\\\"BMX\\\":\\\"0.3100449000000000\\\",\\\"PORTAL\\\":\\\"0.2811593500000000\\\",\\\"TOMI\\\":\\\"0.0309045400000000\\\",\\\"XRP3L\\\":\\\"2.1586201500000002\\\",\\\"SOL\\\":\\\"151.7250995000003583\\\",\\\"SON\\\":\\\"0.0002421788500000\\\",\\\"BNC\\\":\\\"0.1882058500000000\\\",\\\"SOCIAL\\\":\\\"0.0026486750000000\\\",\\\"CGPT\\\":\\\"0.1305147100000000\\\",\\\"CELR\\\":\\\"0.0127736100000000\\\",\\\"BNB\\\":\\\"591.0973035000118935\\\",\\\"OGN\\\":\\\"0.0852573500000000\\\",\\\"CELO\\\":\\\"0.7711142500000000\\\",\\\"AUCTION\\\":\\\"13.1634150000000014\\\",\\\"MANTA\\\":\\\"0.7564216000000000\\\",\\\"LAYER\\\":\\\"0.0372713550000000\\\",\\\"AERO\\\":\\\"1.3783104999999999\\\",\\\"CETUS\\\":\\\"0.1808295400000000\\\",\\\"LL\\\":\\\"0.0201199350000000\\\",\\\"SPA\\\":\\\"0.0067426270000000\\\",\\\"PYTHDOWN\\\":\\\"0.0011834080000000\\\",\\\"NEIROCTO\\\":\\\"0.0019964013000000\\\",\\\"UTK\\\":\\\"0.0365217300000000\\\",\\\"GMRX\\\":\\\"0.0007386305000000\\\",\\\"BOB\\\":\\\"0.0000380619595000\\\",\\\"HOTCROSS\\\":\\\"0.0056491740000000\\\",\\\"AERGO\\\":\\\"0.1007595950000000\\\",\\\"MOCA\\\":\\\"0.0783608000000000\\\",\\\"SQD\\\":\\\"0.0380809500000000\\\",\\\"MV\\\":\\\"0.0081359300000000\\\",\\\"BNB3L\\\":\\\"0.2761618500000000\\\",\\\"BNB3S\\\":\\\"0.0008545725000000\\\",\\\"GALAX3L\\\":\\\"0.0057571999600000\\\",\\\"KAI\\\":\\\"0.0020080954500000\\\",\\\"SQR\\\":\\\"0.0470764500000000\\\",\\\"GALAX3S\\\":\\\"0.1933033000000000\\\",\\\"EGLD\\\":\\\"25.5272299999999713\\\",\\\"ZBCN\\\":\\\"0.0010404795000000\\\",\\\"KAS\\\":\\\"0.1216691350000000\\\",\\\"MEW\\\":\\\"0.0086176890000000\\\",\\\"PUNDIX\\\":\\\"0.4130933500000000\\\",\\\"LOOKS\\\":\\\"0.0392803500000000\\\",\\\"FXS\\\":\\\"1.9060465000000000\\\",\\\"BOSON\\\":\\\"0.2732633000000000\\\",\\\"BRISE\\\":\\\"0.0000000860569500\\\",\\\"AEVO\\\":\\\"0.3388305000000000\\\",\\\"FLUX\\\":\\\"0.5276360500000000\\\",\\\"PRCL\\\":\\\"0.1969015000000000\\\",\\\"UNFIUP\\\":\\\"0.0011654170000000\\\",\\\"SEIDOWN\\\":\\\"0.0442778500000000\\\",\\\"DOAI\\\":\\\"0.0052363805000000\\\",\\\"QNT\\\":\\\"65.4312679999998206\\\",\\\"REDO\\\":\\\"0.2837580500000000\\\",\\\"STRIKE\\\":\\\"6.8225869999999997\\\",\\\"ETHW\\\":\\\"3.2418782499999998\\\",\\\"OM\\\":\\\"1.5396797750000000\\\",\\\"OP\\\":\\\"1.6911539999999999\\\",\\\"WHALE\\\":\\\"0.8134930500000000\\\",\\\"1CAT\\\":\\\"0.0018460765000000\\\",\\\"NEON\\\":\\\"0.4446775500000000\\\",\\\"GTAI\\\":\\\"0.7786105000000000\\\",\\\"SSV\\\":\\\"21.2393749999999841\\\",\\\"ETH2\\\":\\\"2601.6678843156403923\\\",\\\"KCS\\\":\\\"8.7646155000000020\\\",\\\"ARPA\\\":\\\"0.0393882960000000\\\",\\\"ARTFI\\\":\\\"0.0141029450000000\\\",\\\"BRL\\\":\\\"0.1742807323452485\\\",\\\"ALEX\\\":\\\"0.0924537500000000\\\",\\\"STG\\\":\\\"0.2943527500000000\\\",\\\"SHIB\\\":\\\"0.0000178060925000\\\",\\\"IOTX\\\":\\\"0.0394202800000000\\\",\\\"OLE\\\":\\\"0.0171414250000000\\\",\\\"KDA\\\":\\\"0.5653172000000000\\\",\\\"CERE\\\":\\\"0.0022548720000000\\\",\\\"DOCK\\\":\\\"0.0018990500000000\\\",\\\"STX\\\":\\\"1.8157916500000000\\\",\\\"OLT\\\":\\\"0.0007596200000000\\\",\\\"QI\\\":\\\"0.0131754090000000\\\",\\\"SDAO\\\":\\\"0.2748625000000000\\\",\\\"BLAST\\\":\\\"0.0087636160000000\\\",\\\"LINK3S\\\":\\\"0.0000702948350000\\\",\\\"IOST\\\":\\\"0.0049745115000000\\\",\\\"SUI\\\":\\\"2.0589700000000000\\\",\\\"CAKE\\\":\\\"1.7941024999999999\\\",\\\"BSW\\\":\\\"0.0586706500000000\\\",\\\"OMG\\\":\\\"0.2597700500000000\\\",\\\"VOLT\\\":\\\"0.0000002716641000\\\",\\\"LINK3L\\\":\\\"1.3408292499999999\\\",\\\"GEEQ\\\":\\\"0.0385607100000000\\\",\\\"PYUSD\\\":\\\"0.9988003500000000\\\",\\\"SUN\\\":\\\"0.0186106900000000\\\",\\\"TOWER\\\":\\\"0.0014812590000000\\\",\\\"BTC\\\":\\\"67133.4165000832051564\\\",\\\"IOTA\\\":\\\"0.1189405000000000\\\",\\\"REEF\\\":\\\"0.0019960015000000\\\",\\\"TRIAS\\\":\\\"3.3683149999999998\\\",\\\"KEY\\\":\\\"0.0037594713240047\\\",\\\"ETH3L\\\":\\\"0.0003305946200000\\\",\\\"BTT\\\":\\\"0.0000009117439000\\\",\\\"ONE\\\":\\\"0.0132003965000000\\\",\\\"RENDER\\\":\\\"5.2263854999999995\\\",\\\"ETH3S\\\":\\\"0.5517240000000000\\\",\\\"ANKR\\\":\\\"0.0264867500000000\\\",\\\"ALGO\\\":\\\"0.1188405500000000\\\",\\\"SYLO\\\":\\\"0.0007600198000000\\\",\\\"ZCX\\\":\\\"0.0784707450000000\\\",\\\"SD\\\":\\\"0.3851073500000000\\\",\\\"ONT\\\":\\\"0.1877960550000000\\\",\\\"MJT\\\":\\\"0.0132433750000000\\\",\\\"DYM\\\":\\\"1.6659666000000001\\\",\\\"DYP\\\":\\\"0.0205397250000000\\\",\\\"BAKEUP\\\":\\\"0.0389894955000000\\\",\\\"OOE\\\":\\\"0.0079360300000000\\\",\\\"ZELIX\\\":\\\"0.0000649675000000\\\",\\\"DOGE3L\\\":\\\"0.3837080500000000\\\",\\\"ARTY\\\":\\\"0.3980009000000000\\\",\\\"QORPO\\\":\\\"0.1204297550000000\\\",\\\"ICE\\\":\\\"0.0051504235000000\\\",\\\"NOTAI\\\":\\\"0.0000892753400000\\\",\\\"DOGE3S\\\":\\\"0.2291853500000000\\\",\\\"NAKA\\\":\\\"1.0695649500000000\\\",\\\"GALAX\\\":\\\"0.0212893500000000\\\",\\\"MKR\\\":\\\"1245.8767500000163833\\\",\\\"DODO\\\":\\\"0.1152423500000000\\\",\\\"ICP\\\":\\\"7.6731615000000027\\\",\\\"ZEC\\\":\\\"35.9400209999999543\\\",\\\"ZEE\\\":\\\"0.0065767100000000\\\",\\\"ICX\\\":\\\"0.1383308000000000\\\",\\\"KMNO\\\":\\\"0.0921499020000000\\\",\\\"TT\\\":\\\"0.0033883050000000\\\",\\\"DOT3L\\\":\\\"0.1454272500000000\\\",\\\"XAI\\\":\\\"0.2038980000000000\\\",\\\"ZEN\\\":\\\"8.0149905000000007\\\",\\\"DOGE\\\":\\\"0.1213093150000000\\\",\\\"ALPHA\\\":\\\"0.0567416150000000\\\",\\\"DUSK\\\":\\\"0.1964517250000000\\\",\\\"DOT3S\\\":\\\"0.0053613180000000\\\",\\\"SXP\\\":\\\"0.2538730000000000\\\",\\\"HBAR\\\":\\\"0.0510044850000000\\\",\\\"SYNT\\\":\\\"0.0467166300000000\\\",\\\"ZEX\\\":\\\"0.0571714000000000\\\",\\\"BONDLY\\\":\\\"0.0022208890000000\\\",\\\"MLK\\\":\\\"0.2080859050000000\\\",\\\"KICKS\\\":\\\"0.0001301249050000\\\",\\\"PEPE\\\":\\\"0.0000100249850000\\\",\\\"OUSD\\\":\\\"0.9982006500000000\\\",\\\"LUNCDOWN\\\":\\\"0.0000733333150000\\\",\\\"DOGS\\\":\\\"0.0007086455000000\\\",\\\"REV3L\\\":\\\"0.0094672640000000\\\",\\\"CTSI\\\":\\\"0.1257371000000000\\\",\\\"C98\\\":\\\"0.1219390000000000\\\",\\\"OSMO\\\":\\\"0.5370313500000000\\\",\\\"NTRN\\\":\\\"0.3869064500000000\\\",\\\"CFX2S\\\":\\\"0.0084757600000000\\\",\\\"SYN\\\":\\\"0.5636180500000000\\\",\\\"VIDT\\\":\\\"0.0308745550000000\\\",\\\"SYS\\\":\\\"0.0997501000000000\\\",\\\"GAS\\\":\\\"4.3029474500000008\\\",\\\"BOME\\\":\\\"0.0087336310000000\\\",\\\"COMBO\\\":\\\"0.4068964500000000\\\",\\\"XCH\\\":\\\"14.9825050000000010\\\",\\\"VR\\\":\\\"0.0063538215000000\\\",\\\"CFX2L\\\":\\\"0.0499660045000000\\\",\\\"VSYS\\\":\\\"0.0005201398000000\\\",\\\"PANDORA\\\":\\\"1629.2949450001102772\\\",\\\"THETA\\\":\\\"1.2461766000000000\\\",\\\"XCN\\\":\\\"0.0012699647000000\\\",\\\"NEXG\\\":\\\"0.0039180400000000\\\",\\\"MELOS\\\":\\\"0.0021244372500000\\\",\\\"XCV\\\":\\\"0.0013253370000000\\\",\\\"ORN\\\":\\\"0.8797599000000000\\\",\\\"WLKN\\\":\\\"0.0010624685000000\\\",\\\"AAVE\\\":\\\"154.2708259999996162\\\",\\\"MNT\\\":\\\"0.6168914000000000\\\",\\\"BONK\\\":\\\"0.0000227296295000\\\",\\\"PERP\\\":\\\"0.6037979500000000\\\",\\\"XDC\\\":\\\"0.0276361750000000\\\",\\\"MNW\\\":\\\"0.3681158500000000\\\",\\\"XDB\\\":\\\"0.0002578710000000\\\",\\\"BOND\\\":\\\"1.5662165000000000\\\",\\\"SUIA\\\":\\\"0.0809595000000000\\\",\\\"MOG\\\":\\\"0.0000019330330000\\\",\\\"SUTER\\\":\\\"0.0001840079500000\\\",\\\"TIME\\\":\\\"16.2648634999999969\\\",\\\"RACA\\\":\\\"0.0001949025000000\\\",\\\"BICO\\\":\\\"0.2021988500000000\\\",\\\"MON\\\":\\\"0.1066466500000000\\\",\\\"SWEAT\\\":\\\"0.0063718125000000\\\",\\\"MOXIE\\\":\\\"0.0022088950000000\\\",\\\"BABYBNB\\\":\\\"0.0289755050000000\\\",\\\"IGU\\\":\\\"0.0050674650000000\\\",\\\"HMSTR\\\":\\\"0.0037990995000000\\\",\\\"XEC\\\":\\\"0.0000354722550000\\\",\\\"MONI\\\":\\\"0.0058470750000000\\\",\\\"XR\\\":\\\"0.2374812000000000\\\",\\\"PEOPLE\\\":\\\"0.0796601500000000\\\",\\\"PUMLX\\\":\\\"0.0054572700000000\\\",\\\"ZIL\\\":\\\"0.0145927000000000\\\",\\\"WLDDOWN\\\":\\\"0.2089954500000000\\\",\\\"VAI\\\":\\\"0.0799999800000000\\\",\\\"XEN\\\":\\\"0.0000000839580000\\\",\\\"MPC\\\":\\\"0.1001499000000000\\\",\\\"XEM\\\":\\\"0.0176951480000000\\\",\\\"JASMY3S\\\":\\\"0.0019670160000000\\\",\\\"OTK\\\":\\\"0.0290464695000000\\\",\\\"TRAC\\\":\\\"0.4521738000000000\\\",\\\"DFYN\\\":\\\"0.0070664650000000\\\",\\\"BIDP\\\":\\\"0.0001939030000000\\\",\\\"JASMY3L\\\":\\\"0.0001653772700000\\\",\\\"INJDOWN\\\":\\\"0.0000194902500000\\\",\\\"KLV\\\":\\\"0.0019310340000000\\\",\\\"WAXL\\\":\\\"0.7858069000000000\\\",\\\"TRBDOWN\\\":\\\"0.0023138425000000\\\",\\\"BCH3L\\\":\\\"4.6390663064999996\\\",\\\"GMT3S\\\":\\\"0.0000457771000000\\\",\\\"KMD\\\":\\\"0.2493752500000000\\\",\\\"BCH3S\\\":\\\"0.9634180500000000\\\",\\\"ECOX\\\":\\\"0.0987506000000000\\\",\\\"AAVE3S\\\":\\\"0.0560719500000000\\\",\\\"GMT3L\\\":\\\"0.0053983694650000\\\",\\\"EPIK\\\":\\\"0.0045857060000000\\\",\\\"SUIP\\\":\\\"0.1067565950000000\\\",\\\"AAVE3L\\\":\\\"0.3638687346200000\\\",\\\"ZK\\\":\\\"0.1262368500000000\\\",\\\"ZKF\\\":\\\"0.0008595700000000\\\",\\\"OMNIA\\\":\\\"0.7624186000000000\\\",\\\"ZKJ\\\":\\\"1.1124435000000000\\\",\\\"ZKL\\\":\\\"0.1255372000000000\\\",\\\"GAFI\\\":\\\"3.0634675000000001\\\",\\\"CARV\\\":\\\"0.8703646000000000\\\",\\\"KNC\\\":\\\"0.4433782000000000\\\",\\\"CATS\\\":\\\"0.0000599700000000\\\",\\\"PROM\\\":\\\"5.2833570000000006\\\",\\\"ALEPH\\\":\\\"0.1756121500000000\\\",\\\"PONKE\\\":\\\"0.3958020000000000\\\",\\\"OVR\\\":\\\"0.1553223000000000\\\",\\\"CATI\\\":\\\"0.4105146400000000\\\",\\\"ORDER\\\":\\\"0.1183008200000000\\\",\\\"GFT\\\":\\\"0.0166616650000000\\\",\\\"BIFI\\\":\\\"0.0020489750000000\\\",\\\"GGC\\\":\\\"6.9965029985000000\\\",\\\"GGG\\\":\\\"0.0403798000000000\\\",\\\"DAPPX\\\":\\\"0.0043788095000000\\\",\\\"SUKU\\\":\\\"0.0618790450000000\\\",\\\"ULTI\\\":\\\"0.0168015950000000\\\",\\\"CREDI\\\":\\\"0.0192903500000000\\\",\\\"ERTHA\\\":\\\"0.0010014990000000\\\",\\\"FURY\\\":\\\"0.1405297000000000\\\",\\\"KARRAT\\\":\\\"0.5577210000000000\\\",\\\"MOBILE\\\":\\\"0.0009005495000000\\\",\\\"SIDUS\\\":\\\"0.0037671155000000\\\",\\\"NAVI\\\":\\\"0.1254672350000000\\\",\\\"TAO\\\":\\\"583.4081500000051807\\\",\\\"USDJ\\\":\\\"1.1386304000000001\\\",\\\"MTL\\\":\\\"0.9563216000000000\\\",\\\"VET\\\":\\\"0.0225387250000000\\\",\\\"FITFI\\\":\\\"0.0036421780000000\\\",\\\"USDT\\\":\\\"0.9995000000000000\\\",\\\"OXT\\\":\\\"0.0695652000000000\\\",\\\"CANDY\\\":\\\"0.0005597200000000\\\",\\\"USDP\\\":\\\"0.9932031500000000\\\",\\\"MTS\\\":\\\"0.0027516235000000\\\",\\\"TADA\\\":\\\"0.0283858000000000\\\",\\\"MTV\\\":\\\"0.0006559718500000\\\",\\\"NAVX\\\":\\\"0.1342228550000000\\\",\\\"ILV\\\":\\\"35.6771524999999671\\\",\\\"VINU\\\":\\\"0.0000000109045450\\\",\\\"GHX\\\":\\\"0.0903548000000000\\\",\\\"EDU\\\":\\\"0.5167415000000000\\\",\\\"HYVE\\\":\\\"0.0137331300000000\\\",\\\"BTC3L\\\":\\\"0.0058620675000000\\\",\\\"ANYONE\\\":\\\"0.9015490000000000\\\",\\\"BEAT\\\":\\\"0.0012593700000000\\\",\\\"KING\\\":\\\"0.0004821588000000\\\",\\\"CREAM\\\":\\\"15.6541689999999973\\\",\\\"CAS\\\":\\\"0.0038590695000000\\\",\\\"IMX\\\":\\\"1.4944524000000000\\\",\\\"CAT\\\":\\\"0.0000256981445000\\\",\\\"BTC3S\\\":\\\"0.0014142925000000\\\",\\\"USDE\\\":\\\"0.9985005000000000\\\",\\\"USDD\\\":\\\"1.0000997000000000\\\",\\\"CWAR\\\":\\\"0.0037981000000000\\\",\\\"USDC\\\":\\\"0.9997998500000000\\\",\\\"KRL\\\":\\\"0.3543127550000000\\\",\\\"INJ\\\":\\\"21.7691100000000194\\\",\\\"GAME\\\":\\\"0.0139630150000000\\\",\\\"TRIBL\\\":\\\"1.0994500000000000\\\",\\\"XLM\\\":\\\"0.0948525500000000\\\",\\\"TRBUP\\\":\\\"0.0012293850000000\\\",\\\"VRADOWN\\\":\\\"0.0013433280000000\\\",\\\"SUPER\\\":\\\"1.2853570000000000\\\",\\\"EIGEN\\\":\\\"3.1536223999999999\\\",\\\"IOI\\\":\\\"0.0146926500000000\\\",\\\"KSM\\\":\\\"17.5212350000000129\\\",\\\"CCD\\\":\\\"0.0034832575000000\\\",\\\"EGO\\\":\\\"0.0093553200000000\\\",\\\"EGP\\\":\\\"2.7946019999999998\\\",\\\"MXC\\\":\\\"0.0066866550000000\\\",\\\"TEL\\\":\\\"0.0014432780000000\\\",\\\"MOVR\\\":\\\"9.1340307000000027\\\",\\\"XMR\\\":\\\"155.5421899999990755\\\",\\\"MXM\\\":\\\"0.0092853550000000\\\",\\\"OORT\\\":\\\"0.1099949750000000\\\",\\\"GLM\\\":\\\"0.3231383500000000\\\",\\\"RAY\\\":\\\"2.0228880499999998\\\",\\\"XTAG\\\":\\\"0.0218190850000000\\\",\\\"GLQ\\\":\\\"0.0854572500000000\\\",\\\"CWEB\\\":\\\"0.0038480750000000\\\",\\\"REVU\\\":\\\"0.0105047450000000\\\",\\\"REVV\\\":\\\"0.0039760110000000\\\",\\\"ZRO\\\":\\\"3.7952014499999994\\\",\\\"XNL\\\":\\\"0.0093853050000000\\\",\\\"XNO\\\":\\\"0.8496749500000000\\\",\\\"SAROS\\\":\\\"0.0019290350000000\\\",\\\"KACE\\\":\\\"2.1165411999999998\\\",\\\"ZRX\\\":\\\"0.3186406000000000\\\",\\\"WLTH\\\":\\\"0.0374312750000000\\\",\\\"ATOM3L\\\":\\\"0.0321719060000000\\\",\\\"GMM\\\":\\\"0.0001497251000000\\\",\\\"BEER\\\":\\\"0.0000138670630000\\\",\\\"GMT\\\":\\\"0.1275362000000000\\\",\\\"HEART\\\":\\\"0.0159920000000000\\\",\\\"GMX\\\":\\\"22.7186349999999882\\\",\\\"ABBC\\\":\\\"0.0061769100000000\\\",\\\"OMNI\\\":\\\"8.9235359999999970\\\",\\\"ATOM3S\\\":\\\"0.0007945225400000\\\",\\\"IRL\\\":\\\"0.0099650150000000\\\",\\\"CFG\\\":\\\"0.3248375000000000\\\",\\\"WSDM\\\":\\\"0.0139830050000000\\\",\\\"GNS\\\":\\\"1.8390800000000001\\\",\\\"VANRY\\\":\\\"0.0809295150000000\\\",\\\"CFX\\\":\\\"0.1595202000000000\\\",\\\"GRAIL\\\":\\\"817.1212349999937891\\\",\\\"BEFI\\\":\\\"0.0175712100000000\\\",\\\"VELO\\\":\\\"0.0132043945000000\\\",\\\"XPR\\\":\\\"0.0008077959000000\\\",\\\"DOVI\\\":\\\"0.0584707500000000\\\",\\\"ACE\\\":\\\"0.0021349320000000\\\",\\\"ACH\\\":\\\"0.0190534685000000\\\",\\\"ISP\\\":\\\"0.0012161916000000\\\",\\\"XCAD\\\":\\\"0.2834582000000000\\\",\\\"MINA\\\":\\\"0.5630183500000000\\\",\\\"TIA\\\":\\\"5.9318325999999999\\\",\\\"DRIFT\\\":\\\"0.4350823500000000\\\",\\\"ACQ\\\":\\\"0.0056981495000000\\\",\\\"ACS\\\":\\\"0.0014917537500000\\\",\\\"MIND\\\":\\\"0.0018920535000000\\\",\\\"STORE\\\":\\\"0.0062358805000000\\\",\\\"REN\\\":\\\"0.0351224300000000\\\",\\\"ELA\\\":\\\"1.7282354500000000\\\",\\\"DREAMS\\\":\\\"0.0002498750000000\\\",\\\"ADA\\\":\\\"0.3463267500000000\\\",\\\"ELF\\\":\\\"0.3777110500000000\\\",\\\"REQ\\\":\\\"0.0959919800000000\\\",\\\"STORJ\\\":\\\"0.5662167500000000\\\",\\\"LADYS\\\":\\\"0.0000000837581000\\\",\\\"PAXG\\\":\\\"2697.9303600003123340\\\",\\\"REZ\\\":\\\"0.0409795000000000\\\",\\\"XRD\\\":\\\"0.0157821050000000\\\",\\\"CHO\\\":\\\"0.0205097400000000\\\",\\\"CHR\\\":\\\"0.1769115000000000\\\",\\\"ADS\\\":\\\"0.1889055000000000\\\",\\\"CHZ\\\":\\\"0.0738030800000000\\\",\\\"ADX\\\":\\\"0.1575212000000000\\\",\\\"XRP\\\":\\\"0.5525036100000000\\\",\\\"JASMY\\\":\\\"0.0188615645000000\\\",\\\"KAGI\\\":\\\"0.1834582250000000\\\",\\\"FIDA\\\":\\\"0.2282858000000000\\\",\\\"PBR\\\":\\\"0.0291953950000000\\\",\\\"AEG\\\":\\\"0.0093453250000000\\\",\\\"H2O\\\":\\\"0.1610194500000000\\\",\\\"CHMB\\\":\\\"0.0001715641750000\\\",\\\"SAND3L\\\":\\\"0.0015447972150000\\\",\\\"PBX\\\":\\\"0.0006879558500000\\\",\\\"SOLVE\\\":\\\"0.0084557700000000\\\",\\\"DECHAT\\\":\\\"0.1512243500000000\\\",\\\"GARI\\\":\\\"0.0076861550000000\\\",\\\"SHIB2L\\\":\\\"1.1996998499999999\\\",\\\"SHIB2S\\\":\\\"0.0240879500000000\\\",\\\"ENA\\\":\\\"0.3942028000000000\\\",\\\"VEMP\\\":\\\"0.0029335325000000\\\",\\\"ENJ\\\":\\\"0.1467266000000000\\\",\\\"AFG\\\":\\\"0.0072163900000000\\\",\\\"RATS\\\":\\\"0.0001211593900000\\\",\\\"GRT\\\":\\\"0.1646076550000000\\\",\\\"FORWARD\\\":\\\"0.0012873560000000\\\",\\\"TFUEL\\\":\\\"0.0598800450000000\\\",\\\"ENS\\\":\\\"17.0634640000000052\\\",\\\"KASDOWN\\\":\\\"0.0258770550000000\\\",\\\"XTM\\\":\\\"0.0251074400000000\\\",\\\"DEGEN\\\":\\\"0.0084857550000000\\\",\\\"TLM\\\":\\\"0.0100449750000000\\\",\\\"DYDXDOWN\\\":\\\"0.1042598440000000\\\",\\\"CKB\\\":\\\"0.0146026950000000\\\",\\\"LUNC\\\":\\\"0.0000889255150000\\\",\\\"AURORA\\\":\\\"0.1204397500000000\\\",\\\"LUNA\\\":\\\"0.3624187000000000\\\",\\\"XTZ\\\":\\\"0.6776610000000000\\\",\\\"ELON\\\":\\\"0.0000001410294500\\\",\\\"DMTR\\\":\\\"0.0891554000000000\\\",\\\"EOS\\\":\\\"0.4759619000000000\\\",\\\"GST\\\":\\\"0.0118940500000000\\\",\\\"FORT\\\":\\\"0.1155422000000000\\\",\\\"FLAME\\\":\\\"0.0247076400000000\\\",\\\"PATEX\\\":\\\"0.9605195000000000\\\",\\\"DEEP\\\":\\\"0.0328885475000000\\\",\\\"ID3L\\\":\\\"0.0016201895000000\\\",\\\"GTC\\\":\\\"0.6625685500000000\\\",\\\"ID3S\\\":\\\"0.0071674145000000\\\",\\\"RIO\\\":\\\"0.7616190000000000\\\",\\\"CLH\\\":\\\"0.0008555720000000\\\",\\\"BURGER\\\":\\\"0.4016990500000000\\\",\\\"VRA\\\":\\\"0.0029765110000000\\\",\\\"SUNDOG\\\":\\\"0.2173912500000000\\\",\\\"GTT\\\":\\\"0.0002038980000000\\\",\\\"INJUP\\\":\\\"0.2327835500000000\\\",\\\"CPOOL\\\":\\\"0.1557720750000000\\\",\\\"EPX\\\":\\\"0.0000740629500000\\\",\\\"CLV\\\":\\\"0.0329835000000000\\\",\\\"FEAR\\\":\\\"0.0560519600000000\\\",\\\"MEME\\\":\\\"0.0124847545000000\\\",\\\"ROOBEE\\\":\\\"0.0004520738500000\\\",\\\"DEFI\\\":\\\"0.0192903500000000\\\",\\\"TOKEN\\\":\\\"0.0477361200000000\\\",\\\"GRAPE\\\":\\\"0.0020599695000000\\\",\\\"KASUP\\\":\\\"0.3996001000000000\\\",\\\"XWG\\\":\\\"0.0003843077500000\\\",\\\"SKEY\\\":\\\"0.0621289200000000\\\",\\\"SFUND\\\":\\\"1.3243375000000000\\\",\\\"EQX\\\":\\\"0.0032823580000000\\\",\\\"ORDIUP\\\":\\\"0.0548315705000000\\\",\\\"TON\\\":\\\"5.1857058499999995\\\",\\\"DEGO\\\":\\\"2.2667660500000001\\\",\\\"IZI\\\":\\\"0.0088455750000000\\\",\\\"ERG\\\":\\\"0.6605695500000000\\\",\\\"ERN\\\":\\\"1.9255367500000001\\\",\\\"VENOM\\\":\\\"0.0817591000000000\\\",\\\"VOXEL\\\":\\\"0.1497251000000000\\\",\\\"RLC\\\":\\\"1.4649671500000000\\\",\\\"PHA\\\":\\\"0.1093453000000000\\\",\\\"DYDXUP\\\":\\\"0.0112573685000000\\\",\\\"APE3S\\\":\\\"0.0008475760000000\\\",\\\"ORBS\\\":\\\"0.0288955450000000\\\",\\\"OPDOWN\\\":\\\"0.6758619000000000\\\",\\\"ESE\\\":\\\"0.0139130400000000\\\",\\\"APE3L\\\":\\\"0.1339330000000000\\\",\\\"HMND\\\":\\\"0.0982208650000000\\\",\\\"COQ\\\":\\\"0.0000014432780000\\\",\\\"AURY\\\":\\\"0.3340329000000000\\\",\\\"CULT\\\":\\\"0.0000028025980000\\\",\\\"AKT\\\":\\\"2.4642672500000001\\\",\\\"GLMR\\\":\\\"0.1606196500000000\\\",\\\"XYM\\\":\\\"0.0142528700000000\\\",\\\"ORAI\\\":\\\"6.1769100000000012\\\",\\\"XYO\\\":\\\"0.0058680645000000\\\",\\\"ETC\\\":\\\"18.8458723500000169\\\",\\\"LAI\\\":\\\"0.0142828550000000\\\",\\\"PIP\\\":\\\"0.0178310800000000\\\",\\\"ETH\\\":\\\"2607.6655149998362673\\\",\\\"NEO\\\":\\\"10.3575186499999991\\\",\\\"RMV\\\":\\\"0.0081659150000000\\\",\\\"KLAY\\\":\\\"0.1251374000000000\\\",\\\"PIT\\\":\\\"0.0000000003268365\\\",\\\"TARA\\\":\\\"0.0043978000000000\\\",\\\"KALT\\\":\\\"0.1128735350000000\\\",\\\"PIX\\\":\\\"0.0001023687900000\\\",\\\"ETN\\\":\\\"0.0021579205000000\\\",\\\"CSIX\\\":\\\"0.0141729100000000\\\",\\\"TRADE\\\":\\\"0.4708644500000000\\\",\\\"MAVIA\\\":\\\"1.3592200500000001\\\",\\\"HIGH\\\":\\\"1.3043474999999999\\\",\\\"TRB\\\":\\\"62.5387150000000006\\\",\\\"ORDI\\\":\\\"35.7421200000000126\\\",\\\"TRVL\\\":\\\"0.0373643085000000\\\",\\\"AMB\\\":\\\"0.0059670150000000\\\",\\\"TRU\\\":\\\"0.0762018800000000\\\",\\\"LOGX\\\":\\\"0.0271963950000000\\\",\\\"FINC\\\":\\\"0.0362018900000000\\\",\\\"INFRA\\\":\\\"0.1978010500000000\\\",\\\"NATIX\\\":\\\"0.0008729633000000\\\",\\\"NFP\\\":\\\"0.2152923000000000\\\",\\\"TRY\\\":\\\"0.0292166033323590\\\",\\\"TRX\\\":\\\"0.1597201000000000\\\",\\\"LBP\\\":\\\"0.0001243378000000\\\",\\\"LBR\\\":\\\"0.0595702000000000\\\",\\\"EUL\\\":\\\"2.9735125000000000\\\",\\\"NFT\\\":\\\"0.0000004077960000\\\",\\\"SEIUP\\\":\\\"0.0478110825000000\\\",\\\"PUFFER\\\":\\\"0.3676161000000000\\\",\\\"EUR\\\":\\\"1.0811249323958897\\\",\\\"ORCA\\\":\\\"2.0664662499999999\\\",\\\"NEAR3L\\\":\\\"0.0117010765350000\\\",\\\"AMP\\\":\\\"0.0038330825000000\\\",\\\"XDEFI\\\":\\\"0.0472563600000000\\\",\\\"HIFI\\\":\\\"0.4947525000000000\\\",\\\"TRUF\\\":\\\"0.0459570100000000\\\",\\\"AITECH\\\":\\\"0.1045477000000000\\\",\\\"AMU\\\":\\\"0.0043978000000000\\\",\\\"USTC\\\":\\\"0.0214692600000000\\\",\\\"KNGL\\\":\\\"0.0499750000000000\\\",\\\"FOXY\\\":\\\"0.0102686631000000\\\",\\\"NGC\\\":\\\"0.0147935995000000\\\",\\\"TENET\\\":\\\"0.0043278350000000\\\",\\\"NEAR3S\\\":\\\"0.0072553705000000\\\",\\\"MAHA\\\":\\\"1.1904045000000000\\\",\\\"NGL\\\":\\\"0.0701748950000000\\\",\\\"TST\\\":\\\"0.0080359800000000\\\",\\\"HIPPO\\\":\\\"0.0104447750000000\\\",\\\"AXS3S\\\":\\\"0.0308705570000000\\\",\\\"CRO\\\":\\\"0.0781409100000000\\\",\\\"ZPAY\\\":\\\"0.0050574700000000\\\",\\\"MNDE\\\":\\\"0.1026786350000000\\\",\\\"CRV\\\":\\\"0.2534732000000000\\\",\\\"SWASH\\\":\\\"0.0056271850000000\\\",\\\"AXS3L\\\":\\\"0.0106388779000000\\\",\\\"VERSE\\\":\\\"0.0001803098000000\\\",\\\"RPK\\\":\\\"0.0049975000000000\\\",\\\"RPL\\\":\\\"10.9745099999999958\\\",\\\"AZERO\\\":\\\"0.3789104500000000\\\",\\\"SOUL\\\":\\\"0.0534332700000000\\\",\\\"VXV\\\":\\\"0.2619689500000000\\\",\\\"LDO\\\":\\\"1.0885554500000000\\\",\\\"MAGIC\\\":\\\"0.3390304000000000\\\",\\\"ALICE\\\":\\\"1.0324835000000000\\\",\\\"SEAM\\\":\\\"1.1933030499999999\\\",\\\"PLU\\\":\\\"1.9300345000000001\\\",\\\"AOG\\\":\\\"0.0031224380000000\\\",\\\"SMOLE\\\":\\\"0.0000387806000000\\\",\\\"EWT\\\":\\\"1.1094450000000000\\\",\\\"TSUGT\\\":\\\"0.0029185400000000\\\",\\\"PMG\\\":\\\"0.0800599500000000\\\",\\\"OPAI\\\":\\\"0.0006826585000000\\\",\\\"LOCUS\\\":\\\"0.0216591650000000\\\",\\\"CTA\\\":\\\"0.0825087250000000\\\",\\\"NIM\\\":\\\"0.0013673160000000\\\",\\\"CTC\\\":\\\"0.4033982000000000\\\",\\\"APE\\\":\\\"0.7035480500000000\\\",\\\"MERL\\\":\\\"0.2720639000000000\\\",\\\"JAM\\\":\\\"0.0004770613500000\\\",\\\"CTI\\\":\\\"0.0130314810000000\\\",\\\"APP\\\":\\\"0.0021989000000000\\\",\\\"APT\\\":\\\"9.9947001500000000\\\",\\\"WLDUP\\\":\\\"0.0093043455000000\\\",\\\"ZEND\\\":\\\"0.1280759300000000\\\",\\\"FIRE\\\":\\\"0.9113441000000000\\\",\\\"DENT\\\":\\\"0.0008630682500000\\\",\\\"PYTH\\\":\\\"0.3390603850000000\\\",\\\"LFT\\\":\\\"0.0155322300000000\\\",\\\"DPET\\\":\\\"0.0319040400000000\\\",\\\"ORDIDOWN\\\":\\\"0.3788105000000000\\\",\\\"KPOL\\\":\\\"0.0029175405000000\\\",\\\"ETHUP\\\":\\\"8.4971493000000032\\\",\\\"BAND\\\":\\\"1.0939527500000001\\\",\\\"POL\\\":\\\"0.3656171000000000\\\",\\\"ASTR\\\":\\\"0.0582608550000000\\\",\\\"NKN\\\":\\\"0.0691654000000000\\\",\\\"RSR\\\":\\\"0.0068055955000000\\\",\\\"DVPN\\\":\\\"0.0005979009000000\\\",\\\"TWT\\\":\\\"1.1119437500000000\\\",\\\"ARB\\\":\\\"0.5510243500000000\\\",\\\"CVC\\\":\\\"0.1409801746501747\\\",\\\"ARC\\\":\\\"0.0300849500000000\\\",\\\"XETA\\\":\\\"0.0022888550000000\\\",\\\"MTRG\\\":\\\"0.4007995000000000\\\",\\\"LOKA\\\":\\\"0.1867066000000000\\\",\\\"LPOOL\\\":\\\"0.0660069800000000\\\",\\\"TURBOS\\\":\\\"0.0034812585000000\\\",\\\"CVX\\\":\\\"1.7816087499999999\\\",\\\"ARX\\\":\\\"0.0007556220000000\\\",\\\"MPLX\\\":\\\"0.4355221300000000\\\",\\\"SUSHI\\\":\\\"0.7011492500000000\\\",\\\"NLK\\\":\\\"0.0114442750000000\\\",\\\"PEPE2\\\":\\\"0.0000000313843000\\\",\\\"WBTC\\\":\\\"66881.4425499645548419\\\",\\\"SUI3L\\\":\\\"0.0211204345000000\\\",\\\"CWS\\\":\\\"0.1927036000000000\\\",\\\"SUI3S\\\":\\\"0.0000579110300000\\\",\\\"INSP\\\":\\\"0.0264167850000000\\\",\\\"MANA\\\":\\\"0.2945026750000000\\\",\\\"VRTX\\\":\\\"0.0641679000000000\\\",\\\"CSPR\\\":\\\"0.0116441750000000\\\",\\\"ATA\\\":\\\"0.0785007300000000\\\",\\\"OPEN\\\":\\\"0.0080049955000000\\\",\\\"HAI\\\":\\\"0.0448275750000000\\\",\\\"NMR\\\":\\\"14.7436245000000072\\\",\\\"ATH\\\":\\\"0.0540929400000000\\\",\\\"LIT\\\":\\\"0.6282857000000000\\\",\\\"TLOS\\\":\\\"0.3263467450000000\\\",\\\"TNSR\\\":\\\"0.3662168000000000\\\",\\\"CXT\\\":\\\"0.0871364100000000\\\",\\\"POLYX\\\":\\\"0.2346826000000000\\\",\\\"ZERO\\\":\\\"0.0002507745500000\\\",\\\"ROUTE\\\":\\\"0.0610694500000000\\\",\\\"LOOM\\\":\\\"0.0580009850000000\\\",\\\"PRE\\\":\\\"0.0078680640000000\\\",\\\"VRAUP\\\":\\\"0.0134652640000000\\\",\\\"HBB\\\":\\\"0.0714742450000000\\\",\\\"RVN\\\":\\\"0.0165017450000000\\\",\\\"PRQ\\\":\\\"0.0715741950000000\\\",\\\"ONDO\\\":\\\"0.7134930750000000\\\",\\\"PEPEDOWN\\\":\\\"0.0000155022450000\\\",\\\"WOOP\\\":\\\"0.0020179905000000\\\",\\\"LUNCUP\\\":\\\"0.0168355780000000\\\",\\\"KAVA\\\":\\\"0.3522238000000000\\\",\\\"LKI\\\":\\\"0.0104187880000000\\\",\\\"AVA\\\":\\\"0.4857570000000000\\\",\\\"NOM\\\":\\\"0.0233883000000000\\\",\\\"MAPO\\\":\\\"0.0089015470000000\\\",\\\"PEPEUP\\\":\\\"0.0114252845000000\\\",\\\"STRAX\\\":\\\"0.0487156300000000\\\",\\\"NOT\\\":\\\"0.0078670645000000\\\",\\\"ZERC\\\":\\\"0.1108245600000000\\\",\\\"BCUT\\\":\\\"0.0255672100000000\\\",\\\"MASA\\\":\\\"0.0691354150000000\\\",\\\"WAN\\\":\\\"0.1785077544737212\\\",\\\"WAT\\\":\\\"0.0003273762300000\\\",\\\"WAX\\\":\\\"0.0327636100000000\\\",\\\"MASK\\\":\\\"2.2259864500000002\\\",\\\"EOS3L\\\":\\\"0.0002122138400000\\\",\\\"IDEA\\\":\\\"0.0005887055000000\\\",\\\"EOS3S\\\":\\\"0.0034472755000000\\\",\\\"YFI\\\":\\\"4919.4290549999908843\\\",\\\"MOODENG\\\":\\\"0.0774612500000000\\\",\\\"XCUR\\\":\\\"0.0048845565000000\\\",\\\"HYDRA\\\":\\\"0.2225886500000000\\\",\\\"POPCAT\\\":\\\"1.3382305500000000\\\",\\\"LQTY\\\":\\\"0.7848074000000000\\\",\\\"PIXEL\\\":\\\"0.1406596350000000\\\",\\\"LMR\\\":\\\"0.0145437245000000\\\",\\\"ZETA\\\":\\\"0.5997999500000000\\\",\\\"YGG\\\":\\\"0.4717640000000000\\\",\\\"AXS\\\":\\\"4.6006985000000006\\\",\\\"BCHSV\\\":\\\"49.8250749999999370\\\",\\\"NRN\\\":\\\"0.0395802000000000\\\",\\\"FTON\\\":\\\"0.0091954000000000\\\",\\\"COMP\\\":\\\"43.6581599999999881\\\",\\\"XPRT\\\":\\\"0.1819090000000000\\\",\\\"HFT\\\":\\\"0.1443278000000000\\\",\\\"UXLINK\\\":\\\"0.5085456000000000\\\",\\\"STAMP\\\":\\\"0.0335032400000000\\\",\\\"RUNE\\\":\\\"4.9233370999999996\\\",\\\"ZEUS\\\":\\\"0.2587705500000000\\\",\\\"LTC3L\\\":\\\"1.8294848000000001\\\",\\\"DAPP\\\":\\\"0.1763118000000000\\\",\\\"FORTH\\\":\\\"2.9508238500000004\\\",\\\"ALPINE\\\":\\\"1.5322335000000000\\\",\\\"SENSO\\\":\\\"0.0328835500000000\\\",\\\"LTC3S\\\":\\\"0.0006986505000000\\\",\\\"DEXE\\\":\\\"8.3795081500000028\\\",\\\"GOAL\\\":\\\"0.0175912000000000\\\",\\\"AVAX\\\":\\\"27.5602130000000058\\\",\\\"LISTA\\\":\\\"0.3782108000000000\\\",\\\"AMPL\\\":\\\"1.3743124999999999\\\",\\\"WORK\\\":\\\"0.1384307500000000\\\",\\\"BRWL\\\":\\\"0.0017391300000000\\\",\\\"BANANA\\\":\\\"57.1314200000001362\\\",\\\"PUSH\\\":\\\"0.0750624500000000\\\",\\\"WEN\\\":\\\"0.0001015492000000\\\",\\\"NEIRO\\\":\\\"0.0879560000000000\\\",\\\"BTCUP\\\":\\\"34.7711057499999789\\\",\\\"SOL3S\\\":\\\"0.0007816090000000\\\",\\\"BRAWL\\\":\\\"0.0004776610500000\\\",\\\"LAY3R\\\":\\\"0.2161918500000000\\\",\\\"LPT\\\":\\\"11.9304317999999945\\\",\\\"GODS\\\":\\\"0.1807096000000000\\\",\\\"SAND3S\\\":\\\"4.6152911999999992\\\",\\\"RDNT\\\":\\\"0.0640679500000000\\\",\\\"SOL3L\\\":\\\"1.8351913752850000\\\",\\\"NIBI\\\":\\\"0.0653772950000000\\\",\\\"NUM\\\":\\\"0.0436181800000000\\\",\\\"PYR\\\":\\\"2.5590198499999997\\\",\\\"DAG\\\":\\\"0.0226176855000000\\\",\\\"DAI\\\":\\\"0.9989006596042375\\\",\\\"HIP\\\":\\\"0.0034982500000000\\\",\\\"DAO\\\":\\\"0.2848575000000000\\\",\\\"AVAIL\\\":\\\"0.1300929210000000\\\",\\\"DAR\\\":\\\"0.1512243500000000\\\",\\\"FET\\\":\\\"1.3760116500000000\\\",\\\"FCON\\\":\\\"0.0001197600900000\\\",\\\"XAVA\\\":\\\"0.3789104500000000\\\",\\\"LRC\\\":\\\"0.1208395500000000\\\",\\\"UNI3S\\\":\\\"0.0000653573050000\\\",\\\"PZP\\\":\\\"0.0599600050000000\\\",\\\"POKT\\\":\\\"0.0424787500000000\\\",\\\"DASH\\\":\\\"23.6881500000000109\\\",\\\"BAKEDOWN\\\":\\\"0.0003324636850000\\\",\\\"POLC\\\":\\\"0.0061389290000000\\\",\\\"DBR\\\":\\\"0.0377671070000000\\\",\\\"CIRUS\\\":\\\"0.0055772100000000\\\",\\\"UNI3L\\\":\\\"0.0993921490650000\\\",\\\"NWC\\\":\\\"0.0681659000000000\\\",\\\"POLK\\\":\\\"0.0142628650000000\\\",\\\"LSD\\\":\\\"0.9420287500000000\\\",\\\"MARS4\\\":\\\"0.0005878059500000\\\",\\\"LSK\\\":\\\"0.8080957500000000\\\",\\\"BLOCK\\\":\\\"0.0261869000000000\\\",\\\"ANALOS\\\":\\\"0.0000446776500000\\\",\\\"SAFE\\\":\\\"0.8779608000000000\\\",\\\"DCK\\\":\\\"0.0234082900000000\\\",\\\"LSS\\\":\\\"0.0562718500000000\\\",\\\"DCR\\\":\\\"12.4337799999999929\\\",\\\"LIKE\\\":\\\"0.0559720000000000\\\",\\\"DATA\\\":\\\"0.0361819000000000\\\",\\\"WIF\\\":\\\"2.5696145499999999\\\",\\\"BLOK\\\":\\\"0.0006546725000000\\\",\\\"LTC\\\":\\\"71.6261690000000611\\\",\\\"METIS\\\":\\\"42.0289750000000612\\\",\\\"WIN\\\":\\\"0.0000868365600000\\\",\\\"HLG\\\":\\\"0.0018790600000000\\\",\\\"LTO\\\":\\\"0.1166116650000000\\\",\\\"DYDX\\\":\\\"0.9341327000000000\\\",\\\"ARB3S\\\":\\\"0.0509025360000000\\\",\\\"MUBI\\\":\\\"0.0303848000000000\\\",\\\"ARB3L\\\":\\\"0.0025917035000000\\\",\\\"RBTC1\\\":\\\"0.0000039480250000\\\",\\\"POND\\\":\\\"0.0118640650000000\\\",\\\"LINA\\\":\\\"0.0037771105000000\\\",\\\"MYRIA\\\":\\\"0.0025337325000000\\\",\\\"LINK\\\":\\\"11.0244849999999944\\\",\\\"QTUM\\\":\\\"2.4262016723130069\\\",\\\"TUNE\\\":\\\"0.0148025950000000\\\",\\\"UFO\\\":\\\"0.0000006479758500\\\",\\\"CYBER\\\":\\\"2.8755615000000001\\\",\\\"WILD\\\":\\\"0.2433782500000000\\\",\\\"POLS\\\":\\\"0.2809594500000000\\\",\\\"NYM\\\":\\\"0.0719640000000000\\\",\\\"FIL\\\":\\\"3.6786597500000005\\\",\\\"BAL\\\":\\\"2.0099945000000000\\\",\\\"SCA\\\":\\\"0.3999999000000000\\\",\\\"STND\\\":\\\"0.0133123405000000\\\",\\\"WMTX\\\":\\\"0.2138930000000000\\\",\\\"SCLP\\\":\\\"0.1545227000000000\\\",\\\"MANEKI\\\":\\\"0.0073963000000000\\\",\\\"BAT\\\":\\\"0.1721139000000000\\\",\\\"AKRO\\\":\\\"0.0042302838000000\\\",\\\"FTM3L\\\":\\\"8.2574692000000024\\\",\\\"BAX\\\":\\\"0.0000709645000000\\\",\\\"FTM3S\\\":\\\"0.0000255072400000\\\",\\\"COTI\\\":\\\"0.0951524000000000\\\"}}", - "x-request-example": "{\\\"base\\\": \\\"USD\\\", \\\"currencies\\\": \\\"example_string_default_value\\\"}" + "x-sdk-method-name": "getAllTickers", + "x-sdk-method-description": "Request market tickers for all the trading pairs in the market (including 24h volume), takes a snapshot every 2 seconds. On the rare occasion that we will change the currency name, if you still want the changed symbol name, you can use the symbolName field instead of the symbol field via “Get all tickers” endpoint.", + "x-api-rate-limit": 15, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"time\\\": 1729173207043,\\n \\\"ticker\\\": [\\n {\\n \\\"symbol\\\": \\\"BTC-USDT\\\",\\n \\\"symbolName\\\": \\\"BTC-USDT\\\",\\n \\\"buy\\\": \\\"67192.5\\\",\\n \\\"bestBidSize\\\": \\\"0.000025\\\",\\n \\\"sell\\\": \\\"67192.6\\\",\\n \\\"bestAskSize\\\": \\\"1.24949204\\\",\\n \\\"changeRate\\\": \\\"-0.0014\\\",\\n \\\"changePrice\\\": \\\"-98.5\\\",\\n \\\"high\\\": \\\"68321.4\\\",\\n \\\"low\\\": \\\"66683.3\\\",\\n \\\"vol\\\": \\\"1836.03034612\\\",\\n \\\"volValue\\\": \\\"124068431.06726933\\\",\\n \\\"last\\\": \\\"67193\\\",\\n \\\"averagePrice\\\": \\\"67281.21437289\\\",\\n \\\"takerFeeRate\\\": \\\"0.001\\\",\\n \\\"makerFeeRate\\\": \\\"0.001\\\",\\n \\\"takerCoefficient\\\": \\\"1\\\",\\n \\\"makerCoefficient\\\": \\\"1\\\"\\n }\\n ]\\n }\\n}" } }, - "/api/v2/symbols": { + "/api/v1/market/histories": { "get": { - "summary": "Get All Symbols", + "summary": "Get Trade History", "deprecated": false, - "description": "Request via this endpoint to get a list of available currency pairs for trading. If you want to get the market information of the trading symbol, please use Get All Tickers.", + "description": "Request via this endpoint to get the trade history of the specified symbol, the returned quantity is the last 100 transaction records.", "tags": [], "parameters": [ { - "name": "market", + "name": "symbol", "in": "query", - "description": "[The trading market](https://www.kucoin.com/docs-new/api-222921786)", - "required": false, + "description": "symbol", + "required": true, "schema": { - "type": "string", - "example": [ - "ALTS", - "USDS", - "ETF" - ] + "type": "string" } } ], @@ -3890,151 +1505,53 @@ }, "data": { "type": "array", - "items": { - "type": "object", - "properties": { - "symbol": { - "type": "string", - "description": "unique code of a symbol, it would not change after renaming", - "example": [ - "BTC-USDT", - "BCHSV-USDT" - ] - }, - "name": { - "type": "string", - "description": "Name of trading pairs, it would change after renaming", - "example": [ - "BTC-USDT", - "BSV-USDT" - ] - }, - "baseCurrency": { - "type": "string", - "description": "Base currency,e.g. BTC." - }, - "quoteCurrency": { - "type": "string", - "description": "Quote currency,e.g. USDT." - }, - "feeCurrency": { - "type": "string", - "description": "The currency of charged fees." - }, - "market": { - "type": "string", - "description": "The trading market.", - "example": [ - "USDS", - "BTC", - "ALTS" - ] - }, - "baseMinSize": { - "type": "string", - "description": "The minimum order quantity requried to place an order." - }, - "quoteMinSize": { - "type": "string", - "description": "The minimum order funds required to place a market order." - }, - "baseMaxSize": { - "type": "string", - "description": "The maximum order size required to place an order." - }, - "quoteMaxSize": { - "type": "string", - "description": "The maximum order funds required to place a market order." - }, - "baseIncrement": { - "type": "string", - "description": "Quantity increment: The quantity for an order must be a positive integer multiple of this increment. Here, the size refers to the quantity of the base currency for the order. For example, for the ETH-USDT trading pair, if the baseIncrement is 0.0000001, the order quantity can be 1.0000001 but not 1.00000001." - }, - "quoteIncrement": { + "items": { + "type": "object", + "properties": { + "sequence": { "type": "string", - "description": "Quote increment: The funds for a market order must be a positive integer multiple of this increment. The funds refer to the quote currency amount. For example, for the ETH-USDT trading pair, if the quoteIncrement is 0.000001, the amount of USDT for the order can be 3000.000001 but not 3000.0000001." + "description": "Sequence number" }, - "priceIncrement": { + "price": { "type": "string", - "description": "Price increment: The price of an order must be a positive integer multiple of this increment. For example, for the ETH-USDT trading pair, if the priceIncrement is 0.01, the order price can be 3000.01 but not 3000.001.\n\nspecifies the min order price as well as the price increment.This also applies to quote currency." + "description": "Filled price" }, - "priceLimitRate": { + "size": { "type": "string", - "description": "Threshold for price portection" + "description": "Filled amount" }, - "minFunds": { + "side": { "type": "string", - "description": "the minimum trading amounts" - }, - "isMarginEnabled": { - "type": "boolean", - "description": "Available for margin or not." - }, - "enableTrading": { - "type": "boolean", - "description": "Available for transaction or not." - }, - "feeCategory": { - "type": "integer", - "description": "[Fee Type](https://www.kucoin.com/vip/privilege)", + "description": "Filled side, The trade side indicates the taker order side. A taker order is the order that was matched with orders opened on the order book.", "enum": [ - 1, - 2, - 3 + "buy", + "sell" ], "x-api-enum": [ { - "value": 1, - "name": "classA", - "description": "classA" - }, - { - "value": 2, - "name": "classB", - "description": "classB" + "value": "buy", + "name": "buy", + "description": "buy" }, { - "value": 3, - "name": "classC", - "description": "classC" + "value": "sell", + "name": "sell", + "description": "sell" } ] }, - "makerFeeCoefficient": { - "type": "string", - "description": "The maker fee coefficient. The actual fee needs to be multiplied by this coefficient to get the final fee. Most currencies have a coefficient of 1. If set to 0, it means no fee" - }, - "takerFeeCoefficient": { - "type": "string", - "description": "The taker fee coefficient. The actual fee needs to be multiplied by this coefficient to get the final fee. Most currencies have a coefficient of 1. If set to 0, it means no fee" - }, - "st": { - "type": "boolean", - "description": "Whether it is an [Special Treatment](https://www.kucoin.com/legal/special-treatment) symbol" + "time": { + "type": "integer", + "format": "int64", + "description": "Filled timestamp(nanosecond)" } }, "required": [ - "symbol", - "name", - "baseCurrency", - "quoteCurrency", - "feeCurrency", - "market", - "baseMinSize", - "quoteMinSize", - "baseMaxSize", - "quoteMaxSize", - "baseIncrement", - "quoteIncrement", - "priceIncrement", - "priceLimitRate", - "minFunds", - "isMarginEnabled", - "enableTrading", - "feeCategory", - "makerFeeCoefficient", - "takerFeeCoefficient", - "st" + "sequence", + "price", + "size", + "side", + "time" ] } } @@ -4048,7 +1565,189 @@ } } }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470154", + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470162", + "x-abandon": "normal", + "x-domain": "Spot", + "x-api-channel": "Public", + "x-api-permission": "NULL", + "x-api-rate-limit-pool": "Public", + "x-sdk-service": "Spot", + "x-sdk-sub-service": "Market", + "x-sdk-method-name": "getTradeHistory", + "x-sdk-method-description": "Request via this endpoint to get the trade history of the specified symbol, the returned quantity is the last 100 transaction records.", + "x-api-rate-limit": 3, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": [\\n {\\n \\\"sequence\\\": \\\"10976028003549185\\\",\\n \\\"price\\\": \\\"67122\\\",\\n \\\"size\\\": \\\"0.000025\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"time\\\": 1729177117877000000\\n },\\n {\\n \\\"sequence\\\": \\\"10976028003549188\\\",\\n \\\"price\\\": \\\"67122\\\",\\n \\\"size\\\": \\\"0.01792257\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"time\\\": 1729177117877000000\\n },\\n {\\n \\\"sequence\\\": \\\"10976028003549191\\\",\\n \\\"price\\\": \\\"67122.9\\\",\\n \\\"size\\\": \\\"0.05654289\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"time\\\": 1729177117877000000\\n }\\n ]\\n}", + "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\"}" + } + }, + "/api/v1/market/candles": { + "get": { + "summary": "Get Klines", + "deprecated": false, + "description": "Get the Kline of the symbol. Data are returned in grouped buckets based on requested type. For each query, the system would return at most 1500 pieces of data. To obtain more data, please page the data by time.", + "tags": [], + "parameters": [ + { + "name": "symbol", + "in": "query", + "description": " symbol", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "type", + "in": "query", + "description": "Type of candlestick patterns: 1min, 3min, 5min, 15min, 30min, 1hour, 2hour, 4hour, 6hour, 8hour, 12hour, 1day, 1week, 1month", + "required": true, + "schema": { + "type": "string", + "enum": [ + "1min", + "3min", + "5min", + "15min", + "30min", + "1hour", + "2hour", + "4hour", + "6hour", + "8hour", + "12hour", + "1day", + "1week", + "1month" + ], + "x-api-enum": [ + { + "value": "1min", + "name": "1min", + "description": "1min" + }, + { + "value": "3min", + "name": "3min", + "description": "3min" + }, + { + "value": "5min", + "name": "5min", + "description": "5min" + }, + { + "value": "15min", + "name": "15min", + "description": "15min" + }, + { + "value": "30min", + "name": "30min", + "description": "30min" + }, + { + "value": "1hour", + "name": "1hour", + "description": "1hour" + }, + { + "value": "2hour", + "name": "2hour", + "description": "2hour" + }, + { + "value": "4hour", + "name": "4hour", + "description": "4hour" + }, + { + "value": "6hour", + "name": "6hour", + "description": "6hour" + }, + { + "value": "8hour", + "name": "8hour", + "description": "8hour" + }, + { + "value": "12hour", + "name": "12hour", + "description": "12hour" + }, + { + "value": "1day", + "name": "1day", + "description": "1day" + }, + { + "value": "1week", + "name": "1week", + "description": "1week" + }, + { + "value": "1month", + "name": "1month", + "description": "1month" + } + ] + } + }, + { + "name": "startAt", + "in": "query", + "description": "Start time (second), default is 0", + "required": false, + "schema": { + "type": "integer", + "format": "int64", + "default": 0 + } + }, + { + "name": "endAt", + "in": "query", + "description": "End time (second), default is 0", + "required": false, + "schema": { + "type": "integer", + "format": "int64", + "default": 0 + } + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "string", + "description": "Start time of the candle cycle, opening price, closing price, highest price, Lowest price, Transaction amount, Transaction volume" + } + } + } + }, + "required": [ + "code", + "data" + ] + } + } + } + } + }, + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470163", "x-abandon": "normal", "x-domain": "Spot", "x-api-channel": "Public", @@ -4056,47 +1755,36 @@ "x-api-rate-limit-pool": "Public", "x-sdk-service": "Spot", "x-sdk-sub-service": "Market", - "x-sdk-method-name": "getAllSymbols", - "x-sdk-method-description": "Request via this endpoint to get a list of available currency pairs for trading. If you want to get the market information of the trading symbol, please use Get All Tickers.", - "x-api-rate-limit": 4, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": [\\n {\\n \\\"symbol\\\": \\\"BTC-USDT\\\",\\n \\\"name\\\": \\\"BTC-USDT\\\",\\n \\\"baseCurrency\\\": \\\"BTC\\\",\\n \\\"quoteCurrency\\\": \\\"USDT\\\",\\n \\\"feeCurrency\\\": \\\"USDT\\\",\\n \\\"market\\\": \\\"USDS\\\",\\n \\\"baseMinSize\\\": \\\"0.00001\\\",\\n \\\"quoteMinSize\\\": \\\"0.1\\\",\\n \\\"baseMaxSize\\\": \\\"10000000000\\\",\\n \\\"quoteMaxSize\\\": \\\"99999999\\\",\\n \\\"baseIncrement\\\": \\\"0.00000001\\\",\\n \\\"quoteIncrement\\\": \\\"0.000001\\\",\\n \\\"priceIncrement\\\": \\\"0.1\\\",\\n \\\"priceLimitRate\\\": \\\"0.1\\\",\\n \\\"minFunds\\\": \\\"0.1\\\",\\n \\\"isMarginEnabled\\\": true,\\n \\\"enableTrading\\\": true,\\n \\\"feeCategory\\\": 1,\\n \\\"makerFeeCoefficient\\\": \\\"1.00\\\",\\n \\\"takerFeeCoefficient\\\": \\\"1.00\\\",\\n \\\"st\\\": false\\n }\\n ]\\n}", - "x-request-example": "{\\\"market\\\": \\\"ALTS\\\"}" + "x-sdk-method-name": "getKlines", + "x-sdk-method-description": "Get the Kline of the symbol. Data are returned in grouped buckets based on requested type. For each query, the system would return at most 1500 pieces of data. To obtain more data, please page the data by time.", + "x-api-rate-limit": 3, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": [\\n [\\n \\\"1566789720\\\",\\n \\\"10411.5\\\",\\n \\\"10401.9\\\",\\n \\\"10411.5\\\",\\n \\\"10396.3\\\",\\n \\\"29.11357276\\\",\\n \\\"302889.301529914\\\"\\n ],\\n [\\n \\\"1566789660\\\",\\n \\\"10416\\\",\\n \\\"10411.5\\\",\\n \\\"10422.3\\\",\\n \\\"10411.5\\\",\\n \\\"15.61781842\\\",\\n \\\"162703.708997029\\\"\\n ],\\n [\\n \\\"1566789600\\\",\\n \\\"10408.6\\\",\\n \\\"10416\\\",\\n \\\"10416\\\",\\n \\\"10405.4\\\",\\n \\\"12.45584973\\\",\\n \\\"129666.51508559\\\"\\n ]\\n ]\\n}", + "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"type\\\": \\\"1min\\\", \\\"startAt\\\": 1566703297, \\\"endAt\\\": 1566789757}" } }, - "/api/v3/currencies/{currency}": { + "/api/v1/market/orderbook/level2_{size}": { "get": { - "summary": "Get Currency", + "summary": "Get Part OrderBook", "deprecated": false, - "description": "Request via this endpoint to get the currency details of a specified currency", + "description": "Query for part orderbook depth data. (aggregated by price) You are recommended to request via this endpoint as the system reponse would be faster and cosume less traffic.", "tags": [], "parameters": [ { - "name": "currency", - "in": "path", - "description": "Path parameter, Currency", + "name": "symbol", + "in": "query", + "description": "symbol", "required": true, "schema": { "type": "string" } }, { - "name": "chain", - "in": "query", - "description": "Support for querying the chain of currency, e.g. The available value for USDT are OMNI, ERC20, TRC20. This only apply for multi-chain currency, and there is no need for single chain currency.", - "required": false, + "name": "size", + "in": "path", + "description": "Get the depth layer, optional value: 20, 100", + "required": true, "schema": { - "type": "string", - "example": [ - "eth", - "bech32", - "btc", - "kcc", - "trx", - "bsc", - "arbitrum", - "ton", - "optimism" - ] + "type": "integer" } } ], @@ -4114,135 +1802,43 @@ "data": { "type": "object", "properties": { - "currency": { - "type": "string", - "description": "A unique currency code that will never change" - }, - "name": { - "type": "string", - "description": "Currency name, will change after renaming" - }, - "fullName": { - "type": "string", - "description": "Full name of a currency, will change after renaming" - }, - "precision": { - "type": "integer", - "description": "Currency precision" - }, - "confirms": { + "time": { "type": "integer", - "description": "Number of block confirmations" + "description": "Timestamp(millisecond)", + "format": "int64" }, - "contractAddress": { + "sequence": { "type": "string", - "description": "Contract address" - }, - "isMarginEnabled": { - "type": "boolean", - "description": "Support margin or not" + "description": "Sequence number" }, - "isDebitEnabled": { - "type": "boolean", - "description": "Support debit or not" + "bids": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "string", + "description": "Price, Size" + } + }, + "description": "bids, from high to low" }, - "chains": { + "asks": { "type": "array", "items": { - "type": "object", - "properties": { - "chainName": { - "type": "string", - "description": "chain name of currency" - }, - "withdrawalMinSize": { - "type": "string", - "description": "Minimum withdrawal amount" - }, - "depositMinSize": { - "type": "string", - "description": "Minimum deposit amount" - }, - "withdrawFeeRate": { - "type": "string", - "description": "withdraw fee rate" - }, - "withdrawalMinFee": { - "type": "string", - "description": "Minimum fees charged for withdrawal" - }, - "isWithdrawEnabled": { - "type": "boolean", - "description": "Support withdrawal or not" - }, - "isDepositEnabled": { - "type": "boolean", - "description": "Support deposit or not" - }, - "confirms": { - "type": "integer", - "description": "Number of block confirmations" - }, - "preConfirms": { - "type": "integer", - "description": "The number of blocks (confirmations) for advance on-chain verification" - }, - "contractAddress": { - "type": "string", - "description": "Contract address" - }, - "withdrawPrecision": { - "type": "integer", - "description": "Withdrawal precision bit, indicating the maximum supported length after the decimal point of the withdrawal amount" - }, - "maxWithdraw": { - "type": "number", - "description": "Maximum amount of single withdrawal" - }, - "maxDeposit": { - "type": "string", - "description": "Maximum amount of single deposit (only applicable to Lightning Network)" - }, - "needTag": { - "type": "boolean", - "description": "whether memo/tag is needed" - }, - "chainId": { - "type": "string", - "description": "chain id of currency" - } - }, - "required": [ - "chainName", - "withdrawalMinSize", - "depositMinSize", - "withdrawFeeRate", - "withdrawalMinFee", - "isWithdrawEnabled", - "isDepositEnabled", - "confirms", - "preConfirms", - "contractAddress", - "withdrawPrecision", - "maxWithdraw", - "maxDeposit", - "needTag", - "chainId" - ] + "type": "array", + "items": { + "type": "string", + "description": "Price, Size" + } }, - "description": "chain list" + "description": "asks, from low to high" } }, "required": [ - "currency", - "name", - "fullName", - "precision", - "confirms", - "contractAddress", - "isMarginEnabled", - "isDebitEnabled", - "chains" + "sequence", + "bids", + "asks", + "time" ] } }, @@ -4255,55 +1851,7 @@ } } }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470155", - "x-abandon": "normal", - "x-domain": "Spot", - "x-api-channel": "Public", - "x-api-permission": "NULL", - "x-api-rate-limit-pool": "Public", - "x-sdk-service": "Spot", - "x-sdk-sub-service": "Market", - "x-sdk-method-name": "getCurrency", - "x-sdk-method-description": "Request via this endpoint to get the currency details of a specified currency", - "x-api-rate-limit": 3, - "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"currency\\\":\\\"BTC\\\",\\\"name\\\":\\\"BTC\\\",\\\"fullName\\\":\\\"Bitcoin\\\",\\\"precision\\\":8,\\\"confirms\\\":null,\\\"contractAddress\\\":null,\\\"isMarginEnabled\\\":true,\\\"isDebitEnabled\\\":true,\\\"chains\\\":[{\\\"chainName\\\":\\\"BTC\\\",\\\"withdrawalMinSize\\\":\\\"0.001\\\",\\\"depositMinSize\\\":\\\"0.0002\\\",\\\"withdrawFeeRate\\\":\\\"0\\\",\\\"withdrawalMinFee\\\":\\\"0.0005\\\",\\\"isWithdrawEnabled\\\":true,\\\"isDepositEnabled\\\":true,\\\"confirms\\\":3,\\\"preConfirms\\\":1,\\\"contractAddress\\\":\\\"\\\",\\\"withdrawPrecision\\\":8,\\\"maxWithdraw\\\":null,\\\"maxDeposit\\\":null,\\\"needTag\\\":false,\\\"chainId\\\":\\\"btc\\\"},{\\\"chainName\\\":\\\"Lightning Network\\\",\\\"withdrawalMinSize\\\":\\\"0.00001\\\",\\\"depositMinSize\\\":\\\"0.00001\\\",\\\"withdrawFeeRate\\\":\\\"0\\\",\\\"withdrawalMinFee\\\":\\\"0.000015\\\",\\\"isWithdrawEnabled\\\":true,\\\"isDepositEnabled\\\":true,\\\"confirms\\\":1,\\\"preConfirms\\\":1,\\\"contractAddress\\\":\\\"\\\",\\\"withdrawPrecision\\\":8,\\\"maxWithdraw\\\":null,\\\"maxDeposit\\\":\\\"0.03\\\",\\\"needTag\\\":false,\\\"chainId\\\":\\\"btcln\\\"},{\\\"chainName\\\":\\\"KCC\\\",\\\"withdrawalMinSize\\\":\\\"0.0008\\\",\\\"depositMinSize\\\":null,\\\"withdrawFeeRate\\\":\\\"0\\\",\\\"withdrawalMinFee\\\":\\\"0.00002\\\",\\\"isWithdrawEnabled\\\":true,\\\"isDepositEnabled\\\":true,\\\"confirms\\\":20,\\\"preConfirms\\\":20,\\\"contractAddress\\\":\\\"0xfa93c12cd345c658bc4644d1d4e1b9615952258c\\\",\\\"withdrawPrecision\\\":8,\\\"maxWithdraw\\\":null,\\\"maxDeposit\\\":null,\\\"needTag\\\":false,\\\"chainId\\\":\\\"kcc\\\"},{\\\"chainName\\\":\\\"BTC-Segwit\\\",\\\"withdrawalMinSize\\\":\\\"0.0008\\\",\\\"depositMinSize\\\":\\\"0.0002\\\",\\\"withdrawFeeRate\\\":\\\"0\\\",\\\"withdrawalMinFee\\\":\\\"0.0005\\\",\\\"isWithdrawEnabled\\\":false,\\\"isDepositEnabled\\\":true,\\\"confirms\\\":2,\\\"preConfirms\\\":2,\\\"contractAddress\\\":\\\"\\\",\\\"withdrawPrecision\\\":8,\\\"maxWithdraw\\\":null,\\\"maxDeposit\\\":null,\\\"needTag\\\":false,\\\"chainId\\\":\\\"bech32\\\"}]}}", - "x-request-example": "{\\\"currency\\\": \\\"BTC\\\", \\\"chain\\\": \\\"eth\\\"}" - } - }, - "/api/v1/timestamp": { - "get": { - "summary": "Get Server Time", - "deprecated": false, - "description": "Get the server time.", - "tags": [], - "parameters": [], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "data": { - "type": "integer", - "format": "int64", - "description": "ServerTime(millisecond)" - } - }, - "required": [ - "code", - "data" - ] - } - } - } - } - }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470156", + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470165", "x-abandon": "normal", "x-domain": "Spot", "x-api-channel": "Public", @@ -4311,271 +1859,136 @@ "x-api-rate-limit-pool": "Public", "x-sdk-service": "Spot", "x-sdk-sub-service": "Market", - "x-sdk-method-name": "getServerTime", - "x-sdk-method-description": "Get the server time.", - "x-api-rate-limit": 3, - "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":1729100692873}" + "x-sdk-method-name": "getPartOrderBook", + "x-sdk-method-description": "Query for part orderbook depth data. (aggregated by price) You are recommended to request via this endpoint as the system reponse would be faster and cosume less traffic.", + "x-api-rate-limit": 2, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"time\\\": 1729176273859,\\n \\\"sequence\\\": \\\"14610502970\\\",\\n \\\"bids\\\": [\\n [\\n \\\"66976.4\\\",\\n \\\"0.69109872\\\"\\n ],\\n [\\n \\\"66976.3\\\",\\n \\\"0.14377\\\"\\n ]\\n ],\\n \\\"asks\\\": [\\n [\\n \\\"66976.5\\\",\\n \\\"0.05408199\\\"\\n ],\\n [\\n \\\"66976.8\\\",\\n \\\"0.0005\\\"\\n ]\\n ]\\n }\\n}", + "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"size\\\": \\\"20\\\"}" } }, - "/api/v3/announcements": { + "/api/v3/market/orderbook/level2": { "get": { - "summary": "Get Announcements", + "summary": "Get Full OrderBook", "deprecated": false, - "description": "This interface can obtain the latest news announcements, and the default page search is for announcements within a month.", + "description": "Query for Full orderbook depth data. (aggregated by price) It is generally used by professional traders because it uses more server resources and traffic, and we have strict access rate limit control. To maintain up-to-date Order Book, please use Websocket incremental feed after retrieving the OrderBook.", "tags": [], "parameters": [ { - "name": "currentPage", - "in": "query", - "description": "page number", - "required": false, - "schema": { - "type": "integer", - "format": "int64" - } - }, - { - "name": "pageSize", - "in": "query", - "description": "page Size", - "required": false, - "schema": { - "type": "integer", - "format": "int64" - } - }, - { - "name": "annType", + "name": "symbol", "in": "query", - "description": "Announcement types: latest-announcements , activities (latest activities), new-listings (new currency online), product-updates (product updates), vip (institutions and VIPs), maintenance-updates (system maintenance), product -updates (product news), delistings (currency offline), others, api-campaigns (API user activities), default : latest-announcements", - "required": false, + "description": "symbol", + "required": true, "schema": { - "type": "string", - "enum": [ - "latest-announcements ", - "activities ", - "product-updates ", - "vip ", - "maintenance-updates", - "delistings ", - "others", - "api-campaigns ", - "new-listings" - ], - "default": "latest-announcements", - "x-api-enum": [ - { - "value": "latest-announcements ", - "name": "LATEST-ANNOUNCEMENTS", - "description": "latest-announcements" - }, - { - "value": "activities ", - "name": "ACTIVITIES", - "description": "latest activities" - }, - { - "value": "product-updates ", - "name": "PRODUCT-UPDATES", - "description": "product updates" - }, - { - "value": "vip ", - "name": "VIPS", - "description": "institutions and VIPs" - }, - { - "value": "maintenance-updates", - "name": "MAINTENANCE-UPDATE", - "description": "system maintenance" - }, - { - "value": "delistings ", - "name": "DELISTINGS", - "description": "currency offline" - }, - { - "value": "others", - "name": "OTHERS", - "description": "others" - }, - { - "value": "api-campaigns ", - "name": "API-CAMPAIGNS", - "description": "API user activities" - }, - { - "value": "new-listings", - "name": "NEW-LISTINGS", - "description": "new currency online" - } - ] + "type": "string" } - }, - { - "name": "lang", - "in": "query", - "description": "Language type, the default is en_US, the specific value parameters are as follows", - "required": false, - "schema": { - "type": "string", - "default": "en_US", - "enum": [ - "zh_HK", - "ja_JP", - "ko_KR", - "en_US", - "pl_PL", - "es_ES", - "fr_FR", - "ar_AE", - "it_IT", - "id_ID", - "nl_NL", - "pt_PT", - "vi_VN", - "de_DE", - "tr_TR", - "ms_MY", - "ru_RU", - "th_TH", - "hi_IN", - "bn_BD", - "fil_PH", - "ur_PK" - ], - "x-api-enum": [ - { - "value": "zh_HK", - "name": "ZH_HK", - "description": "Chinese (Hong Kong)" - }, - { - "value": "ja_JP", - "name": "JA_JP", - "description": "Japanese (Japan)" - }, - { - "value": "ko_KR", - "name": "KO_KR", - "description": "Korean (Korea)" - }, - { - "value": "en_US", - "name": "EN_US", - "description": "English" - }, - { - "value": "pl_PL", - "name": "PL_PL", - "description": "Polish (Poland)" - }, - { - "value": "es_ES", - "name": "ES_ES", - "description": "Spanish (Spain)" - }, - { - "value": "fr_FR", - "name": "FR_FR", - "description": "French (France)" - }, - { - "value": "ar_AE", - "name": "AR_AE", - "description": "Arabic (Egypt)" - }, - { - "value": "it_IT", - "name": "IT_IT", - "description": "Italian (Italy)" - }, - { - "value": "id_ID", - "name": "ID_ID", - "description": "Indonesian (Indonesia)" - }, - { - "value": "nl_NL", - "name": "NL_NL", - "description": "Dutch (Netherlands)" - }, - { - "value": "pt_PT", - "name": "PT_PT", - "description": "Portuguese (Brazil)" - }, - { - "value": "vi_VN", - "name": "VI_VN", - "description": "Vietnamese (Vietnam)" - }, - { - "value": "de_DE", - "name": "DE_DE", - "description": "German (Germany)" - }, - { - "value": "tr_TR", - "name": "TR_TR", - "description": "Turkish (Turkey)" - }, - { - "value": "ms_MY", - "name": "MS_MY", - "description": "Malay (Malaysia)" - }, - { - "value": "ru_RU", - "name": "RU_RU", - "description": "Russian (Russia)" - }, - { - "value": "th_TH", - "name": "TH_TH", - "description": "Thai (Thailand)" - }, - { - "value": "hi_IN", - "name": "HI_IN", - "description": "Hindi (India)" - }, - { - "value": "bn_BD", - "name": "BN_BD", - "description": "Bengali (Bangladesh)" - }, - { - "value": "fil_PH", - "name": "FIL_PH", - "description": "Filipino (Philippines)" - }, - { - "value": "ur_PK", - "name": "UR_PK", - "description": "Urdu (Pakistan)" + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "object", + "properties": { + "time": { + "type": "integer", + "description": "Timestamp(millisecond)", + "format": "int64" + }, + "sequence": { + "type": "string", + "description": "Sequence number" + }, + "bids": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "string", + "description": "Price, Size" + } + }, + "description": "bids, from high to low" + }, + "asks": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "string", + "description": "Price, Size" + } + }, + "description": "asks, from low to high" + } + }, + "required": [ + "time", + "sequence", + "bids", + "asks" + ] + } + }, + "required": [ + "code", + "data" + ] } - ] + } } - }, + } + }, + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470164", + "x-abandon": "normal", + "x-domain": "Spot", + "x-api-channel": "Private", + "x-api-permission": "General", + "x-api-rate-limit-pool": "Spot", + "x-sdk-service": "Spot", + "x-sdk-sub-service": "Market", + "x-sdk-method-name": "getFullOrderBook", + "x-sdk-method-description": "Query for Full orderbook depth data. (aggregated by price) It is generally used by professional traders because it uses more server resources and traffic, and we have strict access rate limit control. To maintain up-to-date Order Book, please use Websocket incremental feed after retrieving the OrderBook.", + "x-api-rate-limit": 3, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"time\\\": 1729176273859,\\n \\\"sequence\\\": \\\"14610502970\\\",\\n \\\"bids\\\": [\\n [\\n \\\"66976.4\\\",\\n \\\"0.69109872\\\"\\n ],\\n [\\n \\\"66976.3\\\",\\n \\\"0.14377\\\"\\n ]\\n ],\\n \\\"asks\\\": [\\n [\\n \\\"66976.5\\\",\\n \\\"0.05408199\\\"\\n ],\\n [\\n \\\"66976.8\\\",\\n \\\"0.0005\\\"\\n ]\\n ]\\n }\\n}", + "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\"}" + } + }, + "/api/v1/prices": { + "get": { + "summary": "Get Fiat Price", + "deprecated": false, + "description": "Request via this endpoint to get the fiat price of the currencies for the available trading pairs.", + "tags": [], + "parameters": [ { - "name": "startTime", + "name": "base", "in": "query", - "description": "Announcement online start time (milliseconds)", + "description": "Ticker symbol of a base currency,eg.USD,EUR. Default is USD", "required": false, "schema": { - "type": "integer", - "format": "int64" + "type": "string", + "default": "USD", + "example": [ + "USD", + "EUR" + ] } }, { - "name": "endTime", + "name": "currencies", "in": "query", - "description": "Announcement online end time (milliseconds)", + "description": "Comma-separated cryptocurrencies to be converted into fiat, e.g.: BTC,ETH, etc. Default to return the fiat price of all currencies.", "required": false, "schema": { - "type": "integer", - "format": "int64" + "type": "string" } } ], @@ -4593,2511 +2006,3592 @@ "data": { "type": "object", "properties": { - "totalNum": { - "type": "integer", - "description": "Total Number" + "AGLD": { + "type": "string" + }, + "DFI": { + "type": "string" + }, + "PYTHUP": { + "type": "string" + }, + "ISLM": { + "type": "string" + }, + "NEAR": { + "type": "string" + }, + "AIOZ": { + "type": "string" + }, + "AUDIO": { + "type": "string" + }, + "BBL": { + "type": "string" + }, + "WLD": { + "type": "string" + }, + "HNT": { + "type": "string" + }, + "ETHFI": { + "type": "string" + }, + "DMAIL": { + "type": "string" + }, + "OPUP": { + "type": "string" + }, + "VET3S": { + "type": "string" + }, + "MANA3S": { + "type": "string" + }, + "TIDAL": { + "type": "string" + }, + "HALO": { + "type": "string" + }, + "OPUL": { + "type": "string" + }, + "MANA3L": { + "type": "string" + }, + "DGB": { + "type": "string" + }, + "AA": { + "type": "string" + }, + "BCH": { + "type": "string" + }, + "GMEE": { + "type": "string" + }, + "JST": { + "type": "string" + }, + "PBUX": { + "type": "string" + }, + "AR": { + "type": "string" + }, + "SEI": { + "type": "string" + }, + "PSTAKE": { + "type": "string" + }, + "LMWR": { + "type": "string" + }, + "UNFIDOWN": { + "type": "string" + }, + "BB": { + "type": "string" + }, + "JTO": { + "type": "string" + }, + "WEMIX": { + "type": "string" + }, + "G": { + "type": "string" + }, + "MARSH": { + "type": "string" + }, + "BN": { + "type": "string" + }, + "FLIP": { + "type": "string" + }, + "FLR": { + "type": "string" + }, + "BIGTIME": { + "type": "string" + }, + "FLY": { + "type": "string" + }, + "T": { + "type": "string" + }, + "W": { + "type": "string" + }, + "BDX": { + "type": "string" + }, + "BABYDOGE": { + "type": "string" + }, + "SFP": { + "type": "string" + }, + "DIA": { + "type": "string" + }, + "ISME": { + "type": "string" + }, + "LYM": { + "type": "string" + }, + "VET3L": { + "type": "string" + }, + "JUP": { + "type": "string" + }, + "LYX": { + "type": "string" + }, + "AIEPK": { + "type": "string" + }, + "SILLY": { + "type": "string" + }, + "SCPT": { + "type": "string" + }, + "WOO": { + "type": "string" + }, + "BLUR": { + "type": "string" + }, + "STRK": { + "type": "string" + }, + "BFC": { + "type": "string" + }, + "DC": { + "type": "string" + }, + "KARATE": { + "type": "string" + }, + "SUSHI3L": { + "type": "string" + }, + "NETVR": { + "type": "string" + }, + "WAVES": { + "type": "string" + }, + "LITH": { + "type": "string" + }, + "HAPI": { + "type": "string" + }, + "SUSHI3S": { + "type": "string" + }, + "CEEK": { + "type": "string" + }, + "FLOKI": { + "type": "string" + }, + "SHR": { + "type": "string" + }, + "SAND": { + "type": "string" + }, + "TURT": { + "type": "string" + }, + "UMA": { + "type": "string" + }, + "BEPRO": { + "type": "string" + }, + "SCRT": { + "type": "string" + }, + "TUSD": { + "type": "string" + }, + "COOKIE": { + "type": "string" + }, + "LRDS": { + "type": "string" + }, + "SIN": { + "type": "string" + }, + "OAS": { + "type": "string" + }, + "ROOT": { + "type": "string" + }, + "ADA3L": { + "type": "string" + }, + "TIAUP": { + "type": "string" + }, + "HTR": { + "type": "string" + }, + "UNB": { + "type": "string" + }, + "UNA": { + "type": "string" + }, + "HARD": { + "type": "string" + }, + "G3": { + "type": "string" + }, + "ADA3S": { + "type": "string" + }, + "MYRO": { + "type": "string" + }, + "HTX": { + "type": "string" + }, + "FT": { + "type": "string" + }, + "BTCDOWN": { + "type": "string" + }, + "UNI": { + "type": "string" + }, + "FX": { + "type": "string" + }, + "OBI": { + "type": "string" + }, + "UNO": { + "type": "string" + }, + "WRX": { + "type": "string" + }, + "TIADOWN": { + "type": "string" + }, + "ETHDOWN": { + "type": "string" + }, + "WELL": { + "type": "string" + }, + "SWFTC": { + "type": "string" + }, + "SKL": { + "type": "string" + }, + "UOS": { + "type": "string" + }, + "AIPAD": { + "type": "string" + }, + "BRETT": { + "type": "string" + }, + "SKY": { + "type": "string" + }, + "FRM": { + "type": "string" + }, + "VISION": { + "type": "string" + }, + "LENDS": { + "type": "string" + }, + "SLF": { + "type": "string" + }, + "BULL": { + "type": "string" + }, + "FLOW": { + "type": "string" + }, + "ODDZ": { + "type": "string" + }, + "SLN": { + "type": "string" + }, + "UPO": { + "type": "string" + }, + "SLP": { + "type": "string" + }, + "ID": { + "type": "string" + }, + "SLIM": { + "type": "string" + }, + "SPOT": { + "type": "string" + }, + "DOP": { + "type": "string" + }, + "ISSP": { + "type": "string" + }, + "UQC": { + "type": "string" + }, + "IO": { + "type": "string" + }, + "DOT": { + "type": "string" + }, + "1INCH": { + "type": "string" + }, + "SMH": { + "type": "string" + }, + "MAK": { + "type": "string" + }, + "TOKO": { + "type": "string" + }, + "TURBO": { + "type": "string" + }, + "UNFI": { + "type": "string" + }, + "MAN": { + "type": "string" + }, + "EVER": { + "type": "string" + }, + "FTM": { + "type": "string" + }, + "SHRAP": { + "type": "string" + }, + "MAV": { + "type": "string" + }, + "MAX": { + "type": "string" + }, + "DPR": { + "type": "string" + }, + "FTT": { + "type": "string" + }, + "ARKM": { + "type": "string" + }, + "ATOM": { + "type": "string" + }, + "PENDLE": { + "type": "string" + }, + "QUICK": { + "type": "string" + }, + "BLZ": { + "type": "string" + }, + "BOBA": { + "type": "string" + }, + "MBL": { + "type": "string" + }, + "OFN": { + "type": "string" + }, + "UNIO": { + "type": "string" + }, + "SNS": { + "type": "string" + }, + "SNX": { + "type": "string" + }, + "NXRA": { + "type": "string" + }, + "TAIKO": { + "type": "string" + }, + "AVAX3L": { + "type": "string" + }, + "L3": { + "type": "string" + }, + "API3": { + "type": "string" + }, + "XRP3S": { + "type": "string" + }, + "QKC": { + "type": "string" + }, + "AVAX3S": { + "type": "string" + }, + "ROSE": { + "type": "string" + }, + "SATS": { + "type": "string" + }, + "BMX": { + "type": "string" + }, + "PORTAL": { + "type": "string" + }, + "TOMI": { + "type": "string" + }, + "XRP3L": { + "type": "string" + }, + "SOL": { + "type": "string" + }, + "SON": { + "type": "string" + }, + "BNC": { + "type": "string" + }, + "SOCIAL": { + "type": "string" + }, + "CGPT": { + "type": "string" + }, + "CELR": { + "type": "string" + }, + "BNB": { + "type": "string" + }, + "OGN": { + "type": "string" + }, + "CELO": { + "type": "string" + }, + "AUCTION": { + "type": "string" + }, + "MANTA": { + "type": "string" + }, + "LAYER": { + "type": "string" + }, + "AERO": { + "type": "string" + }, + "CETUS": { + "type": "string" + }, + "LL": { + "type": "string" + }, + "SPA": { + "type": "string" + }, + "PYTHDOWN": { + "type": "string" + }, + "NEIROCTO": { + "type": "string" + }, + "UTK": { + "type": "string" + }, + "GMRX": { + "type": "string" + }, + "BOB": { + "type": "string" + }, + "HOTCROSS": { + "type": "string" + }, + "AERGO": { + "type": "string" + }, + "MOCA": { + "type": "string" + }, + "SQD": { + "type": "string" + }, + "MV": { + "type": "string" + }, + "BNB3L": { + "type": "string" + }, + "BNB3S": { + "type": "string" + }, + "GALAX3L": { + "type": "string" + }, + "KAI": { + "type": "string" + }, + "SQR": { + "type": "string" + }, + "GALAX3S": { + "type": "string" + }, + "EGLD": { + "type": "string" + }, + "ZBCN": { + "type": "string" + }, + "KAS": { + "type": "string" + }, + "MEW": { + "type": "string" + }, + "PUNDIX": { + "type": "string" + }, + "LOOKS": { + "type": "string" + }, + "FXS": { + "type": "string" + }, + "BOSON": { + "type": "string" + }, + "BRISE": { + "type": "string" + }, + "AEVO": { + "type": "string" + }, + "FLUX": { + "type": "string" + }, + "PRCL": { + "type": "string" + }, + "UNFIUP": { + "type": "string" + }, + "SEIDOWN": { + "type": "string" + }, + "DOAI": { + "type": "string" + }, + "QNT": { + "type": "string" + }, + "REDO": { + "type": "string" + }, + "STRIKE": { + "type": "string" + }, + "ETHW": { + "type": "string" + }, + "OM": { + "type": "string" + }, + "OP": { + "type": "string" + }, + "WHALE": { + "type": "string" + }, + "1CAT": { + "type": "string" + }, + "NEON": { + "type": "string" + }, + "GTAI": { + "type": "string" + }, + "SSV": { + "type": "string" + }, + "ETH2": { + "type": "string" + }, + "KCS": { + "type": "string" + }, + "ARPA": { + "type": "string" + }, + "ARTFI": { + "type": "string" + }, + "BRL": { + "type": "string" + }, + "ALEX": { + "type": "string" + }, + "STG": { + "type": "string" + }, + "SHIB": { + "type": "string" + }, + "IOTX": { + "type": "string" + }, + "OLE": { + "type": "string" + }, + "KDA": { + "type": "string" + }, + "CERE": { + "type": "string" + }, + "DOCK": { + "type": "string" + }, + "STX": { + "type": "string" + }, + "OLT": { + "type": "string" + }, + "QI": { + "type": "string" + }, + "SDAO": { + "type": "string" + }, + "BLAST": { + "type": "string" + }, + "LINK3S": { + "type": "string" + }, + "IOST": { + "type": "string" + }, + "SUI": { + "type": "string" + }, + "CAKE": { + "type": "string" + }, + "BSW": { + "type": "string" + }, + "OMG": { + "type": "string" + }, + "VOLT": { + "type": "string" + }, + "LINK3L": { + "type": "string" + }, + "GEEQ": { + "type": "string" + }, + "PYUSD": { + "type": "string" + }, + "SUN": { + "type": "string" + }, + "TOWER": { + "type": "string" + }, + "BTC": { + "type": "string" + }, + "IOTA": { + "type": "string" + }, + "REEF": { + "type": "string" + }, + "TRIAS": { + "type": "string" + }, + "KEY": { + "type": "string" + }, + "ETH3L": { + "type": "string" + }, + "BTT": { + "type": "string" + }, + "ONE": { + "type": "string" + }, + "RENDER": { + "type": "string" + }, + "ETH3S": { + "type": "string" + }, + "ANKR": { + "type": "string" + }, + "ALGO": { + "type": "string" + }, + "SYLO": { + "type": "string" + }, + "ZCX": { + "type": "string" + }, + "SD": { + "type": "string" + }, + "ONT": { + "type": "string" + }, + "MJT": { + "type": "string" + }, + "DYM": { + "type": "string" + }, + "DYP": { + "type": "string" + }, + "BAKEUP": { + "type": "string" + }, + "OOE": { + "type": "string" + }, + "ZELIX": { + "type": "string" + }, + "DOGE3L": { + "type": "string" + }, + "ARTY": { + "type": "string" + }, + "QORPO": { + "type": "string" + }, + "ICE": { + "type": "string" + }, + "NOTAI": { + "type": "string" + }, + "DOGE3S": { + "type": "string" + }, + "NAKA": { + "type": "string" + }, + "GALAX": { + "type": "string" + }, + "MKR": { + "type": "string" + }, + "DODO": { + "type": "string" + }, + "ICP": { + "type": "string" + }, + "ZEC": { + "type": "string" + }, + "ZEE": { + "type": "string" + }, + "ICX": { + "type": "string" + }, + "KMNO": { + "type": "string" + }, + "TT": { + "type": "string" + }, + "DOT3L": { + "type": "string" + }, + "XAI": { + "type": "string" + }, + "ZEN": { + "type": "string" + }, + "DOGE": { + "type": "string" + }, + "ALPHA": { + "type": "string" + }, + "DUSK": { + "type": "string" + }, + "DOT3S": { + "type": "string" + }, + "SXP": { + "type": "string" + }, + "HBAR": { + "type": "string" + }, + "SYNT": { + "type": "string" + }, + "ZEX": { + "type": "string" + }, + "BONDLY": { + "type": "string" + }, + "MLK": { + "type": "string" + }, + "KICKS": { + "type": "string" + }, + "PEPE": { + "type": "string" + }, + "OUSD": { + "type": "string" + }, + "LUNCDOWN": { + "type": "string" + }, + "DOGS": { + "type": "string" + }, + "REV3L": { + "type": "string" + }, + "CTSI": { + "type": "string" + }, + "C98": { + "type": "string" + }, + "OSMO": { + "type": "string" + }, + "NTRN": { + "type": "string" + }, + "CFX2S": { + "type": "string" + }, + "SYN": { + "type": "string" + }, + "VIDT": { + "type": "string" + }, + "SYS": { + "type": "string" + }, + "GAS": { + "type": "string" + }, + "BOME": { + "type": "string" + }, + "COMBO": { + "type": "string" + }, + "XCH": { + "type": "string" + }, + "VR": { + "type": "string" + }, + "CFX2L": { + "type": "string" + }, + "VSYS": { + "type": "string" + }, + "PANDORA": { + "type": "string" + }, + "THETA": { + "type": "string" + }, + "XCN": { + "type": "string" + }, + "NEXG": { + "type": "string" + }, + "MELOS": { + "type": "string" + }, + "XCV": { + "type": "string" + }, + "ORN": { + "type": "string" + }, + "WLKN": { + "type": "string" + }, + "AAVE": { + "type": "string" + }, + "MNT": { + "type": "string" + }, + "BONK": { + "type": "string" + }, + "PERP": { + "type": "string" + }, + "XDC": { + "type": "string" + }, + "MNW": { + "type": "string" + }, + "XDB": { + "type": "string" + }, + "BOND": { + "type": "string" + }, + "SUIA": { + "type": "string" + }, + "MOG": { + "type": "string" + }, + "SUTER": { + "type": "string" + }, + "TIME": { + "type": "string" + }, + "RACA": { + "type": "string" + }, + "BICO": { + "type": "string" + }, + "MON": { + "type": "string" + }, + "SWEAT": { + "type": "string" + }, + "MOXIE": { + "type": "string" + }, + "BABYBNB": { + "type": "string" + }, + "IGU": { + "type": "string" + }, + "HMSTR": { + "type": "string" + }, + "XEC": { + "type": "string" + }, + "MONI": { + "type": "string" + }, + "XR": { + "type": "string" + }, + "PEOPLE": { + "type": "string" + }, + "PUMLX": { + "type": "string" + }, + "ZIL": { + "type": "string" + }, + "WLDDOWN": { + "type": "string" + }, + "VAI": { + "type": "string" + }, + "XEN": { + "type": "string" + }, + "MPC": { + "type": "string" + }, + "XEM": { + "type": "string" + }, + "JASMY3S": { + "type": "string" + }, + "OTK": { + "type": "string" + }, + "TRAC": { + "type": "string" + }, + "DFYN": { + "type": "string" + }, + "BIDP": { + "type": "string" + }, + "JASMY3L": { + "type": "string" + }, + "INJDOWN": { + "type": "string" + }, + "KLV": { + "type": "string" + }, + "WAXL": { + "type": "string" + }, + "TRBDOWN": { + "type": "string" + }, + "BCH3L": { + "type": "string" + }, + "GMT3S": { + "type": "string" + }, + "KMD": { + "type": "string" + }, + "BCH3S": { + "type": "string" + }, + "ECOX": { + "type": "string" + }, + "AAVE3S": { + "type": "string" + }, + "GMT3L": { + "type": "string" + }, + "EPIK": { + "type": "string" + }, + "SUIP": { + "type": "string" + }, + "AAVE3L": { + "type": "string" + }, + "ZK": { + "type": "string" + }, + "ZKF": { + "type": "string" + }, + "OMNIA": { + "type": "string" + }, + "ZKJ": { + "type": "string" + }, + "ZKL": { + "type": "string" + }, + "GAFI": { + "type": "string" + }, + "CARV": { + "type": "string" + }, + "KNC": { + "type": "string" + }, + "CATS": { + "type": "string" + }, + "PROM": { + "type": "string" + }, + "ALEPH": { + "type": "string" + }, + "PONKE": { + "type": "string" + }, + "OVR": { + "type": "string" + }, + "CATI": { + "type": "string" + }, + "ORDER": { + "type": "string" + }, + "GFT": { + "type": "string" + }, + "BIFI": { + "type": "string" + }, + "GGC": { + "type": "string" + }, + "GGG": { + "type": "string" + }, + "DAPPX": { + "type": "string" + }, + "SUKU": { + "type": "string" + }, + "ULTI": { + "type": "string" + }, + "CREDI": { + "type": "string" + }, + "ERTHA": { + "type": "string" + }, + "FURY": { + "type": "string" + }, + "KARRAT": { + "type": "string" + }, + "MOBILE": { + "type": "string" + }, + "SIDUS": { + "type": "string" + }, + "NAVI": { + "type": "string" + }, + "TAO": { + "type": "string" + }, + "USDJ": { + "type": "string" + }, + "MTL": { + "type": "string" + }, + "VET": { + "type": "string" + }, + "FITFI": { + "type": "string" + }, + "USDT": { + "type": "string" + }, + "OXT": { + "type": "string" + }, + "CANDY": { + "type": "string" + }, + "USDP": { + "type": "string" + }, + "MTS": { + "type": "string" + }, + "TADA": { + "type": "string" + }, + "MTV": { + "type": "string" + }, + "NAVX": { + "type": "string" + }, + "ILV": { + "type": "string" + }, + "VINU": { + "type": "string" + }, + "GHX": { + "type": "string" + }, + "EDU": { + "type": "string" + }, + "HYVE": { + "type": "string" + }, + "BTC3L": { + "type": "string" + }, + "ANYONE": { + "type": "string" + }, + "BEAT": { + "type": "string" + }, + "KING": { + "type": "string" + }, + "CREAM": { + "type": "string" + }, + "CAS": { + "type": "string" + }, + "IMX": { + "type": "string" + }, + "CAT": { + "type": "string" + }, + "BTC3S": { + "type": "string" + }, + "USDE": { + "type": "string" + }, + "USDD": { + "type": "string" + }, + "CWAR": { + "type": "string" + }, + "USDC": { + "type": "string" + }, + "KRL": { + "type": "string" + }, + "INJ": { + "type": "string" + }, + "GAME": { + "type": "string" + }, + "TRIBL": { + "type": "string" + }, + "XLM": { + "type": "string" + }, + "TRBUP": { + "type": "string" + }, + "VRADOWN": { + "type": "string" + }, + "SUPER": { + "type": "string" + }, + "EIGEN": { + "type": "string" + }, + "IOI": { + "type": "string" + }, + "KSM": { + "type": "string" + }, + "CCD": { + "type": "string" + }, + "EGO": { + "type": "string" + }, + "EGP": { + "type": "string" + }, + "MXC": { + "type": "string" + }, + "TEL": { + "type": "string" + }, + "MOVR": { + "type": "string" + }, + "XMR": { + "type": "string" + }, + "MXM": { + "type": "string" + }, + "OORT": { + "type": "string" + }, + "GLM": { + "type": "string" + }, + "RAY": { + "type": "string" + }, + "XTAG": { + "type": "string" + }, + "GLQ": { + "type": "string" + }, + "CWEB": { + "type": "string" + }, + "REVU": { + "type": "string" + }, + "REVV": { + "type": "string" + }, + "ZRO": { + "type": "string" + }, + "XNL": { + "type": "string" + }, + "XNO": { + "type": "string" + }, + "SAROS": { + "type": "string" + }, + "KACE": { + "type": "string" + }, + "ZRX": { + "type": "string" + }, + "WLTH": { + "type": "string" + }, + "ATOM3L": { + "type": "string" + }, + "GMM": { + "type": "string" + }, + "BEER": { + "type": "string" + }, + "GMT": { + "type": "string" + }, + "HEART": { + "type": "string" + }, + "GMX": { + "type": "string" + }, + "ABBC": { + "type": "string" + }, + "OMNI": { + "type": "string" + }, + "ATOM3S": { + "type": "string" + }, + "IRL": { + "type": "string" + }, + "CFG": { + "type": "string" + }, + "WSDM": { + "type": "string" + }, + "GNS": { + "type": "string" + }, + "VANRY": { + "type": "string" + }, + "CFX": { + "type": "string" + }, + "GRAIL": { + "type": "string" + }, + "BEFI": { + "type": "string" + }, + "VELO": { + "type": "string" + }, + "XPR": { + "type": "string" + }, + "DOVI": { + "type": "string" + }, + "ACE": { + "type": "string" + }, + "ACH": { + "type": "string" + }, + "ISP": { + "type": "string" + }, + "XCAD": { + "type": "string" + }, + "MINA": { + "type": "string" + }, + "TIA": { + "type": "string" + }, + "DRIFT": { + "type": "string" + }, + "ACQ": { + "type": "string" + }, + "ACS": { + "type": "string" + }, + "MIND": { + "type": "string" + }, + "STORE": { + "type": "string" + }, + "REN": { + "type": "string" + }, + "ELA": { + "type": "string" + }, + "DREAMS": { + "type": "string" + }, + "ADA": { + "type": "string" + }, + "ELF": { + "type": "string" + }, + "REQ": { + "type": "string" + }, + "STORJ": { + "type": "string" + }, + "LADYS": { + "type": "string" + }, + "PAXG": { + "type": "string" + }, + "REZ": { + "type": "string" + }, + "XRD": { + "type": "string" + }, + "CHO": { + "type": "string" + }, + "CHR": { + "type": "string" + }, + "ADS": { + "type": "string" + }, + "CHZ": { + "type": "string" + }, + "ADX": { + "type": "string" + }, + "XRP": { + "type": "string" + }, + "JASMY": { + "type": "string" + }, + "KAGI": { + "type": "string" + }, + "FIDA": { + "type": "string" + }, + "PBR": { + "type": "string" + }, + "AEG": { + "type": "string" + }, + "H2O": { + "type": "string" + }, + "CHMB": { + "type": "string" + }, + "SAND3L": { + "type": "string" + }, + "PBX": { + "type": "string" + }, + "SOLVE": { + "type": "string" + }, + "DECHAT": { + "type": "string" + }, + "GARI": { + "type": "string" + }, + "SHIB2L": { + "type": "string" + }, + "SHIB2S": { + "type": "string" + }, + "ENA": { + "type": "string" + }, + "VEMP": { + "type": "string" + }, + "ENJ": { + "type": "string" + }, + "AFG": { + "type": "string" + }, + "RATS": { + "type": "string" + }, + "GRT": { + "type": "string" + }, + "FORWARD": { + "type": "string" + }, + "TFUEL": { + "type": "string" + }, + "ENS": { + "type": "string" + }, + "KASDOWN": { + "type": "string" + }, + "XTM": { + "type": "string" + }, + "DEGEN": { + "type": "string" + }, + "TLM": { + "type": "string" + }, + "DYDXDOWN": { + "type": "string" + }, + "CKB": { + "type": "string" + }, + "LUNC": { + "type": "string" + }, + "AURORA": { + "type": "string" + }, + "LUNA": { + "type": "string" + }, + "XTZ": { + "type": "string" + }, + "ELON": { + "type": "string" + }, + "DMTR": { + "type": "string" + }, + "EOS": { + "type": "string" + }, + "GST": { + "type": "string" + }, + "FORT": { + "type": "string" + }, + "FLAME": { + "type": "string" + }, + "PATEX": { + "type": "string" + }, + "DEEP": { + "type": "string" }, - "items": { - "type": "array", - "items": { - "type": "object", - "properties": { - "annId": { - "type": "integer", - "description": "Announcement ID" - }, - "annTitle": { - "type": "string", - "description": "Announcement title" - }, - "annType": { - "type": "array", - "items": { - "type": "string" - }, - "description": "Announcement type" - }, - "annDesc": { - "type": "string", - "description": "Announcement description" - }, - "cTime": { - "type": "integer", - "description": "Announcement release time, Unix millisecond timestamp format", - "format": "int64" - }, - "language": { - "type": "string", - "description": "language type" - }, - "annUrl": { - "type": "string", - "description": "Announcement link" - } - }, - "required": [ - "annId", - "annTitle", - "annType", - "annDesc", - "cTime", - "language", - "annUrl" - ] - } + "ID3L": { + "type": "string" + }, + "GTC": { + "type": "string" + }, + "ID3S": { + "type": "string" + }, + "RIO": { + "type": "string" + }, + "CLH": { + "type": "string" + }, + "BURGER": { + "type": "string" + }, + "VRA": { + "type": "string" + }, + "SUNDOG": { + "type": "string" + }, + "GTT": { + "type": "string" + }, + "INJUP": { + "type": "string" + }, + "CPOOL": { + "type": "string" + }, + "EPX": { + "type": "string" + }, + "CLV": { + "type": "string" + }, + "FEAR": { + "type": "string" + }, + "MEME": { + "type": "string" + }, + "ROOBEE": { + "type": "string" + }, + "DEFI": { + "type": "string" + }, + "TOKEN": { + "type": "string" + }, + "GRAPE": { + "type": "string" + }, + "KASUP": { + "type": "string" + }, + "XWG": { + "type": "string" + }, + "SKEY": { + "type": "string" + }, + "SFUND": { + "type": "string" + }, + "EQX": { + "type": "string" + }, + "ORDIUP": { + "type": "string" + }, + "TON": { + "type": "string" + }, + "DEGO": { + "type": "string" + }, + "IZI": { + "type": "string" + }, + "ERG": { + "type": "string" + }, + "ERN": { + "type": "string" + }, + "VENOM": { + "type": "string" + }, + "VOXEL": { + "type": "string" + }, + "RLC": { + "type": "string" + }, + "PHA": { + "type": "string" + }, + "DYDXUP": { + "type": "string" + }, + "APE3S": { + "type": "string" + }, + "ORBS": { + "type": "string" + }, + "OPDOWN": { + "type": "string" + }, + "ESE": { + "type": "string" + }, + "APE3L": { + "type": "string" + }, + "HMND": { + "type": "string" + }, + "COQ": { + "type": "string" + }, + "AURY": { + "type": "string" + }, + "CULT": { + "type": "string" + }, + "AKT": { + "type": "string" + }, + "GLMR": { + "type": "string" + }, + "XYM": { + "type": "string" + }, + "ORAI": { + "type": "string" + }, + "XYO": { + "type": "string" + }, + "ETC": { + "type": "string" + }, + "LAI": { + "type": "string" + }, + "PIP": { + "type": "string" + }, + "ETH": { + "type": "string" + }, + "NEO": { + "type": "string" + }, + "RMV": { + "type": "string" + }, + "KLAY": { + "type": "string" + }, + "PIT": { + "type": "string" + }, + "TARA": { + "type": "string" + }, + "KALT": { + "type": "string" + }, + "PIX": { + "type": "string" + }, + "ETN": { + "type": "string" + }, + "CSIX": { + "type": "string" + }, + "TRADE": { + "type": "string" + }, + "MAVIA": { + "type": "string" + }, + "HIGH": { + "type": "string" + }, + "TRB": { + "type": "string" + }, + "ORDI": { + "type": "string" + }, + "TRVL": { + "type": "string" + }, + "AMB": { + "type": "string" }, - "currentPage": { - "type": "integer", - "description": "Current page" + "TRU": { + "type": "string" }, - "pageSize": { - "type": "integer", - "description": "Page size" + "LOGX": { + "type": "string" }, - "totalPage": { - "type": "integer", - "description": "Total Page" - } - }, - "required": [ - "totalNum", - "items", - "currentPage", - "pageSize", - "totalPage" - ] - } - }, - "required": [ - "code", - "data" - ] - } - } - } - } - }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470157", - "x-abandon": "normal", - "x-domain": "Spot", - "x-api-channel": "Public", - "x-api-permission": "NULL", - "x-api-rate-limit-pool": "Public", - "x-sdk-service": "Spot", - "x-sdk-sub-service": "Market", - "x-sdk-method-name": "getAnnouncements", - "x-sdk-method-description": "This interface can obtain the latest news announcements, and the default page search is for announcements within a month.", - "x-api-rate-limit": 20, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"totalNum\\\": 195,\\n \\\"totalPage\\\": 13,\\n \\\"currentPage\\\": 1,\\n \\\"pageSize\\\": 15,\\n \\\"items\\\": [\\n {\\n \\\"annId\\\": 129045,\\n \\\"annTitle\\\": \\\"KuCoin Isolated Margin Adds the Scroll (SCR) Trading Pair\\\",\\n \\\"annType\\\": [\\n \\\"latest-announcements\\\"\\n ],\\n \\\"annDesc\\\": \\\"To enrich the variety of assets available,\\xa0KuCoin\\u2019s Isolated Margin Trading platform has added the Scroll (SCR)\\xa0asset and trading pair.\\\",\\n \\\"cTime\\\": 1729594043000,\\n \\\"language\\\": \\\"en_US\\\",\\n \\\"annUrl\\\": \\\"https://www.kucoin.com/announcement/kucoin-isolated-margin-adds-scr?lang=en_US\\\"\\n },\\n {\\n \\\"annId\\\": 129001,\\n \\\"annTitle\\\": \\\"DAPP-30D Fixed Promotion, Enjoy an APR of 200%!\\u200b\\\",\\n \\\"annType\\\": [\\n \\\"latest-announcements\\\",\\n \\\"activities\\\"\\n ],\\n \\\"annDesc\\\": \\\"KuCoin Earn will be launching the DAPP Fixed Promotion at 10:00:00 on October 22, 2024 (UTC). The available product is \\u201cDAPP-30D'' with an APR of 200%.\\\",\\n \\\"cTime\\\": 1729588460000,\\n \\\"language\\\": \\\"en_US\\\",\\n \\\"annUrl\\\": \\\"https://www.kucoin.com/announcement/dapp-30d-fixed-promotion-enjoy?lang=en_US\\\"\\n },\\n {\\n \\\"annId\\\": 128581,\\n \\\"annTitle\\\": \\\"NAYM (NAYM) Gets Listed on KuCoin! World Premiere!\\\",\\n \\\"annType\\\": [\\n \\\"latest-announcements\\\",\\n \\\"new-listings\\\"\\n ],\\n \\\"annDesc\\\": \\\"Trading:\\xa011:00 on October 22, 2024 (UTC)\\\",\\n \\\"cTime\\\": 1729497729000,\\n \\\"language\\\": \\\"en_US\\\",\\n \\\"annUrl\\\": \\\"https://www.kucoin.com/announcement/en-naym-naym-gets-listed-on-kucoin-world-premiere?lang=en_US\\\"\\n }\\n ]\\n }\\n}", - "x-request-example": "{\\\"currentPage\\\": 1, \\\"pageSize\\\": 50, \\\"annType\\\": \\\"latest-announcements\\\", \\\"lang\\\": \\\"en_US\\\", \\\"startTime\\\": 1729594043000, \\\"endTime\\\": 1729697729000}" - } - }, - "/api/v1/status": { - "get": { - "summary": "Get Service Status", - "deprecated": false, - "description": "Get the service status", - "tags": [], - "parameters": [], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "data": { - "type": "object", - "properties": { - "status": { - "type": "string", - "description": "Status of service: open:normal transaction, close:Stop Trading/Maintenance, cancelonly:can only cancel the order but not place order", - "enum": [ - "open", - "close", - "cancelonly" - ], - "x-api-enum": [ - { - "value": "open", - "name": "OPEN", - "description": "normal transaction" - }, - { - "value": "close", - "name": "CLOSE", - "description": "Stop Trading/Maintenance" - }, - { - "value": "cancelonly", - "name": "CANCELONLY", - "description": "can only cancel the order but not place order" - } - ] + "FINC": { + "type": "string" }, - "msg": { - "type": "string", - "description": "Remark for operation" - } - }, - "required": [ - "status", - "msg" - ] - } - }, - "required": [ - "code", - "data" - ] - } - } - } - } - }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470158", - "x-abandon": "normal", - "x-domain": "Spot", - "x-api-channel": "Public", - "x-api-permission": "NULL", - "x-api-rate-limit-pool": "Public", - "x-sdk-service": "Spot", - "x-sdk-sub-service": "Market", - "x-sdk-method-name": "getServiceStatus", - "x-sdk-method-description": "Get the service status", - "x-api-rate-limit": 3, - "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"status\\\":\\\"open\\\",\\\"msg\\\":\\\"\\\"}}" - } - }, - "/api/v2/symbols/{symbol}": { - "get": { - "summary": "Get Symbol ", - "deprecated": false, - "description": "Request via this endpoint to get detail currency pairs for trading. If you want to get the market information of the trading symbol, please use Get All Tickers.", - "tags": [], - "parameters": [ - { - "name": "symbol", - "in": "path", - "description": "Path parameter, Symbol", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "data": { - "type": "object", - "properties": { - "symbol": { - "type": "string", - "description": "unique code of a symbol, it would not change after renaming", - "example": [ - "BTC-USDT", - "BCHSV-USDT" - ] + "INFRA": { + "type": "string" }, - "name": { - "type": "string", - "description": "Name of trading pairs, it would change after renaming", - "example": [ - "BTC-USDT", - "BSV-USDT" - ] + "NATIX": { + "type": "string" }, - "baseCurrency": { - "type": "string", - "description": "Base currency,e.g. BTC." + "NFP": { + "type": "string" }, - "quoteCurrency": { - "type": "string", - "description": "Quote currency,e.g. USDT." + "TRY": { + "type": "string" }, - "feeCurrency": { - "type": "string", - "description": "The currency of charged fees." + "TRX": { + "type": "string" }, - "market": { - "type": "string", - "description": "The trading market.", - "example": [ - "USDS", - "BTC", - "ALTS" - ] + "LBP": { + "type": "string" }, - "baseMinSize": { - "type": "string", - "description": "The minimum order quantity requried to place an order." + "LBR": { + "type": "string" }, - "quoteMinSize": { - "type": "string", - "description": "The minimum order funds required to place a market order." + "EUL": { + "type": "string" }, - "baseMaxSize": { - "type": "string", - "description": "The maximum order size required to place an order." + "NFT": { + "type": "string" }, - "quoteMaxSize": { - "type": "string", - "description": "The maximum order funds required to place a market order." + "SEIUP": { + "type": "string" }, - "baseIncrement": { - "type": "string", - "description": "Quantity increment: The quantity for an order must be a positive integer multiple of this increment. Here, the size refers to the quantity of the base currency for the order. For example, for the ETH-USDT trading pair, if the baseIncrement is 0.0000001, the order quantity can be 1.0000001 but not 1.00000001." + "PUFFER": { + "type": "string" }, - "quoteIncrement": { - "type": "string", - "description": "Quote increment: The funds for a market order must be a positive integer multiple of this increment. The funds refer to the quote currency amount. For example, for the ETH-USDT trading pair, if the quoteIncrement is 0.000001, the amount of USDT for the order can be 3000.000001 but not 3000.0000001." + "EUR": { + "type": "string" }, - "priceIncrement": { - "type": "string", - "description": "Price increment: The price of an order must be a positive integer multiple of this increment. For example, for the ETH-USDT trading pair, if the priceIncrement is 0.01, the order price can be 3000.01 but not 3000.001." + "ORCA": { + "type": "string" + }, + "NEAR3L": { + "type": "string" + }, + "AMP": { + "type": "string" + }, + "XDEFI": { + "type": "string" + }, + "HIFI": { + "type": "string" + }, + "TRUF": { + "type": "string" + }, + "AITECH": { + "type": "string" }, - "priceLimitRate": { - "type": "string", - "description": "Threshold for price portection" + "AMU": { + "type": "string" }, - "minFunds": { - "type": "string", - "description": "the minimum trading amounts" + "USTC": { + "type": "string" }, - "isMarginEnabled": { - "type": "boolean", - "description": "Available for margin or not." + "KNGL": { + "type": "string" }, - "enableTrading": { - "type": "boolean", - "description": "Available for transaction or not." + "FOXY": { + "type": "string" }, - "feeCategory": { - "type": "integer", - "description": "[Fee Type](https://www.kucoin.com/vip/privilege)", - "enum": [ - 1, - 2, - 3 - ], - "x-api-enum": [ - { - "value": 1, - "name": "classA", - "description": "classA" - }, - { - "value": 2, - "name": "classB", - "description": "classB" - }, - { - "value": 3, - "name": "classC", - "description": "classC" - } - ] + "NGC": { + "type": "string" }, - "makerFeeCoefficient": { - "type": "string", - "description": "The maker fee coefficient. The actual fee needs to be multiplied by this coefficient to get the final fee. Most currencies have a coefficient of 1. If set to 0, it means no fee" + "TENET": { + "type": "string" }, - "takerFeeCoefficient": { - "type": "string", - "description": "The taker fee coefficient. The actual fee needs to be multiplied by this coefficient to get the final fee. Most currencies have a coefficient of 1. If set to 0, it means no fee" + "NEAR3S": { + "type": "string" }, - "st": { - "type": "boolean" - } - }, - "required": [ - "symbol", - "name", - "baseCurrency", - "quoteCurrency", - "feeCurrency", - "market", - "baseMinSize", - "quoteMinSize", - "baseMaxSize", - "quoteMaxSize", - "baseIncrement", - "quoteIncrement", - "priceIncrement", - "priceLimitRate", - "minFunds", - "isMarginEnabled", - "enableTrading", - "feeCategory", - "makerFeeCoefficient", - "takerFeeCoefficient", - "st" - ] - } - }, - "required": [ - "code", - "data" - ] - } - } - } - } - }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470159", - "x-abandon": "normal", - "x-domain": "Spot", - "x-api-channel": "Public", - "x-api-permission": "NULL", - "x-api-rate-limit-pool": "Public", - "x-sdk-service": "Spot", - "x-sdk-sub-service": "Market", - "x-sdk-method-name": "getSymbol", - "x-sdk-method-description": "Request via this endpoint to get detail currency pairs for trading. If you want to get the market information of the trading symbol, please use Get All Tickers.", - "x-api-rate-limit": 4, - "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"symbol\\\":\\\"BTC-USDT\\\",\\\"name\\\":\\\"BTC-USDT\\\",\\\"baseCurrency\\\":\\\"BTC\\\",\\\"quoteCurrency\\\":\\\"USDT\\\",\\\"feeCurrency\\\":\\\"USDT\\\",\\\"market\\\":\\\"USDS\\\",\\\"baseMinSize\\\":\\\"0.00001\\\",\\\"quoteMinSize\\\":\\\"0.1\\\",\\\"baseMaxSize\\\":\\\"10000000000\\\",\\\"quoteMaxSize\\\":\\\"99999999\\\",\\\"baseIncrement\\\":\\\"0.00000001\\\",\\\"quoteIncrement\\\":\\\"0.000001\\\",\\\"priceIncrement\\\":\\\"0.1\\\",\\\"priceLimitRate\\\":\\\"0.1\\\",\\\"minFunds\\\":\\\"0.1\\\",\\\"isMarginEnabled\\\":true,\\\"enableTrading\\\":true,\\\"feeCategory\\\":1,\\\"makerFeeCoefficient\\\":\\\"1.00\\\",\\\"takerFeeCoefficient\\\":\\\"1.00\\\",\\\"st\\\":false}}", - "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\"}" - } - }, - "/api/v1/market/orderbook/level1": { - "get": { - "summary": "Get Ticker", - "deprecated": false, - "description": "Request via this endpoint to get Level 1 Market Data. The returned value includes the best bid price and size, the best ask price and size as well as the last traded price and the last traded size.", - "tags": [], - "parameters": [ - { - "name": "symbol", - "in": "query", - "description": "symbol", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "data": { - "type": "object", - "properties": { - "time": { - "type": "integer", - "description": "timestamp", - "format": "int64" + "MAHA": { + "type": "string" }, - "sequence": { - "type": "string", - "description": "Sequence" + "NGL": { + "type": "string" }, - "price": { - "type": "string", - "description": "Last traded price" + "TST": { + "type": "string" }, - "size": { - "type": "string", - "description": "Last traded size" + "HIPPO": { + "type": "string" }, - "bestBid": { - "type": "string", - "description": "Best bid price" + "AXS3S": { + "type": "string" }, - "bestBidSize": { - "type": "string", - "description": "Best bid size" + "CRO": { + "type": "string" }, - "bestAsk": { - "type": "string", - "description": "Best ask price" + "ZPAY": { + "type": "string" }, - "bestAskSize": { - "type": "string", - "description": "Best ask size" - } - }, - "required": [ - "sequence", - "price", - "size", - "bestBid", - "bestBidSize", - "bestAsk", - "bestAskSize", - "time" - ] - } - }, - "required": [ - "code", - "data" - ] - } - } - } - } - }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470160", - "x-abandon": "normal", - "x-domain": "Spot", - "x-api-channel": "Public", - "x-api-permission": "NULL", - "x-api-rate-limit-pool": "Public", - "x-sdk-service": "Spot", - "x-sdk-sub-service": "Market", - "x-sdk-method-name": "getTicker", - "x-sdk-method-description": "Request via this endpoint to get Level 1 Market Data. The returned value includes the best bid price and size, the best ask price and size as well as the last traded price and the last traded size.", - "x-api-rate-limit": 2, - "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"time\\\":1729172965609,\\\"sequence\\\":\\\"14609309753\\\",\\\"price\\\":\\\"67269\\\",\\\"size\\\":\\\"0.000025\\\",\\\"bestBid\\\":\\\"67267.5\\\",\\\"bestBidSize\\\":\\\"0.000025\\\",\\\"bestAsk\\\":\\\"67267.6\\\",\\\"bestAskSize\\\":\\\"1.24808993\\\"}}", - "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\"}" - } - }, - "/api/v1/market/stats": { - "get": { - "summary": "Get 24hr Stats", - "deprecated": false, - "description": "Request via this endpoint to get the statistics of the specified ticker in the last 24 hours.", - "tags": [], - "parameters": [ - { - "name": "symbol", - "in": "query", - "description": "symbol", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "data": { - "type": "object", - "properties": { - "time": { - "type": "integer", - "description": "timestamp", - "format": "int64" + "MNDE": { + "type": "string" }, - "symbol": { - "type": "string", - "description": "Symbol" + "CRV": { + "type": "string" }, - "buy": { - "type": "string", - "description": "Best bid price\n" + "SWASH": { + "type": "string" }, - "sell": { - "type": "string", - "description": "Best ask price" + "AXS3L": { + "type": "string" }, - "changeRate": { - "type": "string", - "description": "24h change rate" + "VERSE": { + "type": "string" }, - "changePrice": { - "type": "string", - "description": "24h change price" + "RPK": { + "type": "string" }, - "high": { - "type": "string", - "description": "Highest price in 24h" + "RPL": { + "type": "string" }, - "low": { - "type": "string", - "description": "Lowest price in 24h" + "AZERO": { + "type": "string" }, - "vol": { - "type": "string", - "description": "24h volume, executed based on base currency" + "SOUL": { + "type": "string" }, - "volValue": { - "type": "string", - "description": "24h traded amount" + "VXV": { + "type": "string" }, - "last": { - "type": "string", - "description": "Last traded price" + "LDO": { + "type": "string" }, - "averagePrice": { - "type": "string", - "description": "Average trading price in the last 24 hours" + "MAGIC": { + "type": "string" }, - "takerFeeRate": { - "type": "string", - "description": "Basic Taker Fee" + "ALICE": { + "type": "string" }, - "makerFeeRate": { - "type": "string", - "description": "Basic Maker Fee" + "SEAM": { + "type": "string" }, - "takerCoefficient": { - "type": "string", - "description": "The taker fee coefficient. The actual fee needs to be multiplied by this coefficient to get the final fee. Most currencies have a coefficient of 1. If set to 0, it means no fee" + "PLU": { + "type": "string" }, - "makerCoefficient": { - "type": "string", - "description": "The maker fee coefficient. The actual fee needs to be multiplied by this coefficient to get the final fee. Most currencies have a coefficient of 1. If set to 0, it means no fee" - } - }, - "required": [ - "time", - "symbol", - "buy", - "sell", - "changeRate", - "changePrice", - "high", - "low", - "vol", - "volValue", - "last", - "averagePrice", - "takerFeeRate", - "makerFeeRate", - "takerCoefficient", - "makerCoefficient" - ] - } - }, - "required": [ - "code", - "data" - ] - } - } - } - } - }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470161", - "x-abandon": "normal", - "x-domain": "Spot", - "x-api-channel": "Public", - "x-api-permission": "NULL", - "x-api-rate-limit-pool": "Public", - "x-sdk-service": "Spot", - "x-sdk-sub-service": "Market", - "x-sdk-method-name": "get24hrStats", - "x-sdk-method-description": "Request via this endpoint to get the statistics of the specified ticker in the last 24 hours.", - "x-api-rate-limit": 15, - "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"time\\\":1729175612158,\\\"symbol\\\":\\\"BTC-USDT\\\",\\\"buy\\\":\\\"66982.4\\\",\\\"sell\\\":\\\"66982.5\\\",\\\"changeRate\\\":\\\"-0.0114\\\",\\\"changePrice\\\":\\\"-778.1\\\",\\\"high\\\":\\\"68107.7\\\",\\\"low\\\":\\\"66683.3\\\",\\\"vol\\\":\\\"1738.02898182\\\",\\\"volValue\\\":\\\"117321982.415978333\\\",\\\"last\\\":\\\"66981.5\\\",\\\"averagePrice\\\":\\\"67281.21437289\\\",\\\"takerFeeRate\\\":\\\"0.001\\\",\\\"makerFeeRate\\\":\\\"0.001\\\",\\\"takerCoefficient\\\":\\\"1\\\",\\\"makerCoefficient\\\":\\\"1\\\"}}", - "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\"}" - } - }, - "/api/v1/market/histories": { - "get": { - "summary": "Get Trade History", - "deprecated": false, - "description": "Request via this endpoint to get the trade history of the specified symbol, the returned quantity is the last 100 transaction records.", - "tags": [], - "parameters": [ - { - "name": "symbol", - "in": "query", - "description": "symbol", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "data": { - "type": "array", - "items": { - "type": "object", - "properties": { - "sequence": { - "type": "string", - "description": "Sequence number" - }, - "price": { - "type": "string", - "description": "Filled price" - }, - "size": { - "type": "string", - "description": "Filled amount" - }, - "side": { - "type": "string", - "description": "Filled side, The trade side indicates the taker order side. A taker order is the order that was matched with orders opened on the order book.", - "enum": [ - "buy", - "sell" - ], - "x-api-enum": [ - { - "value": "buy", - "name": "buy", - "description": "buy" - }, - { - "value": "sell", - "name": "sell", - "description": "sell" - } - ] - }, - "time": { - "type": "integer", - "format": "int64", - "description": "Filled timestamp(nanosecond)" - } + "AOG": { + "type": "string" + }, + "SMOLE": { + "type": "string" + }, + "EWT": { + "type": "string" + }, + "TSUGT": { + "type": "string" + }, + "PMG": { + "type": "string" + }, + "OPAI": { + "type": "string" + }, + "LOCUS": { + "type": "string" + }, + "CTA": { + "type": "string" + }, + "NIM": { + "type": "string" + }, + "CTC": { + "type": "string" + }, + "APE": { + "type": "string" + }, + "MERL": { + "type": "string" + }, + "JAM": { + "type": "string" + }, + "CTI": { + "type": "string" + }, + "APP": { + "type": "string" + }, + "APT": { + "type": "string" + }, + "WLDUP": { + "type": "string" + }, + "ZEND": { + "type": "string" + }, + "FIRE": { + "type": "string" + }, + "DENT": { + "type": "string" + }, + "PYTH": { + "type": "string" + }, + "LFT": { + "type": "string" + }, + "DPET": { + "type": "string" }, - "required": [ - "sequence", - "price", - "size", - "side", - "time" - ] - } - } - }, - "required": [ - "code", - "data" - ] - } - } - } - } - }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470162", - "x-abandon": "normal", - "x-domain": "Spot", - "x-api-channel": "Public", - "x-api-permission": "NULL", - "x-api-rate-limit-pool": "Public", - "x-sdk-service": "Spot", - "x-sdk-sub-service": "Market", - "x-sdk-method-name": "getTradeHistory", - "x-sdk-method-description": "Request via this endpoint to get the trade history of the specified symbol, the returned quantity is the last 100 transaction records.", - "x-api-rate-limit": 3, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": [\\n {\\n \\\"sequence\\\": \\\"10976028003549185\\\",\\n \\\"price\\\": \\\"67122\\\",\\n \\\"size\\\": \\\"0.000025\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"time\\\": 1729177117877000000\\n },\\n {\\n \\\"sequence\\\": \\\"10976028003549188\\\",\\n \\\"price\\\": \\\"67122\\\",\\n \\\"size\\\": \\\"0.01792257\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"time\\\": 1729177117877000000\\n },\\n {\\n \\\"sequence\\\": \\\"10976028003549191\\\",\\n \\\"price\\\": \\\"67122.9\\\",\\n \\\"size\\\": \\\"0.05654289\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"time\\\": 1729177117877000000\\n }\\n ]\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\"}" - } - }, - "/api/v1/market/candles": { - "get": { - "summary": "Get Klines", - "deprecated": false, - "description": "Get the Kline of the symbol. Data are returned in grouped buckets based on requested type. For each query, the system would return at most 1500 pieces of data. To obtain more data, please page the data by time.", - "tags": [], - "parameters": [ - { - "name": "symbol", - "in": "query", - "description": " symbol", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "type", - "in": "query", - "description": "Type of candlestick patterns: 1min, 3min, 5min, 15min, 30min, 1hour, 2hour, 4hour, 6hour, 8hour, 12hour, 1day, 1week, 1month", - "required": true, - "schema": { - "type": "string", - "enum": [ - "1min", - "3min", - "5min", - "15min", - "30min", - "1hour", - "2hour", - "4hour", - "6hour", - "8hour", - "12hour", - "1day", - "1week", - "1month" - ], - "x-api-enum": [ - { - "value": "1min", - "name": "1min", - "description": "1min" - }, - { - "value": "3min", - "name": "3min", - "description": "3min" - }, - { - "value": "5min", - "name": "5min", - "description": "5min" - }, - { - "value": "15min", - "name": "15min", - "description": "15min" - }, - { - "value": "30min", - "name": "30min", - "description": "30min" - }, - { - "value": "1hour", - "name": "1hour", - "description": "1hour" - }, - { - "value": "2hour", - "name": "2hour", - "description": "2hour" - }, - { - "value": "4hour", - "name": "4hour", - "description": "4hour" - }, - { - "value": "6hour", - "name": "6hour", - "description": "6hour" - }, - { - "value": "8hour", - "name": "8hour", - "description": "8hour" - }, - { - "value": "12hour", - "name": "12hour", - "description": "12hour" - }, - { - "value": "1day", - "name": "1day", - "description": "1day" - }, - { - "value": "1week", - "name": "1week", - "description": "1week" - }, - { - "value": "1month", - "name": "1month", - "description": "1month" - } - ] - } - }, - { - "name": "startAt", - "in": "query", - "description": "Start time (second), default is 0", - "required": false, - "schema": { - "type": "integer", - "format": "int64", - "default": 0 - } - }, - { - "name": "endAt", - "in": "query", - "description": "End time (second), default is 0", - "required": false, - "schema": { - "type": "integer", - "format": "int64", - "default": 0 - } - } - ], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "data": { - "type": "array", - "items": { - "type": "array", - "items": { - "type": "string", - "description": "Start time of the candle cycle, opening price, closing price, highest price, Lowest price, Transaction amount, Transaction volume" - } - } - } - }, - "required": [ - "code", - "data" - ] - } - } - } - } - }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470163", - "x-abandon": "normal", - "x-domain": "Spot", - "x-api-channel": "Public", - "x-api-permission": "NULL", - "x-api-rate-limit-pool": "Public", - "x-sdk-service": "Spot", - "x-sdk-sub-service": "Market", - "x-sdk-method-name": "getKlines", - "x-sdk-method-description": "Get the Kline of the symbol. Data are returned in grouped buckets based on requested type. For each query, the system would return at most 1500 pieces of data. To obtain more data, please page the data by time.", - "x-api-rate-limit": 3, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": [\\n [\\n \\\"1566789720\\\",\\n \\\"10411.5\\\",\\n \\\"10401.9\\\",\\n \\\"10411.5\\\",\\n \\\"10396.3\\\",\\n \\\"29.11357276\\\",\\n \\\"302889.301529914\\\"\\n ],\\n [\\n \\\"1566789660\\\",\\n \\\"10416\\\",\\n \\\"10411.5\\\",\\n \\\"10422.3\\\",\\n \\\"10411.5\\\",\\n \\\"15.61781842\\\",\\n \\\"162703.708997029\\\"\\n ],\\n [\\n \\\"1566789600\\\",\\n \\\"10408.6\\\",\\n \\\"10416\\\",\\n \\\"10416\\\",\\n \\\"10405.4\\\",\\n \\\"12.45584973\\\",\\n \\\"129666.51508559\\\"\\n ]\\n ]\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"type\\\": \\\"1min\\\", \\\"startAt\\\": 1566703297, \\\"endAt\\\": 1566789757}" - } - }, - "/api/v3/market/orderbook/level2": { - "get": { - "summary": "Get Full OrderBook", - "deprecated": false, - "description": "Query for Full orderbook depth data. (aggregated by price) It is generally used by professional traders because it uses more server resources and traffic, and we have strict access rate limit control. To maintain up-to-date Order Book, please use Websocket incremental feed after retrieving the OrderBook.", - "tags": [], - "parameters": [ - { - "name": "symbol", - "in": "query", - "description": "symbol", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "data": { - "type": "object", - "properties": { - "time": { - "type": "integer", - "description": "Timestamp(millisecond)", - "format": "int64" + "ORDIDOWN": { + "type": "string" + }, + "KPOL": { + "type": "string" }, - "sequence": { - "type": "string", - "description": "Sequence number" + "ETHUP": { + "type": "string" }, - "bids": { - "type": "array", - "items": { - "type": "array", - "items": { - "type": "string", - "description": "Price, Size" - } - }, - "description": "bids, from high to low" + "BAND": { + "type": "string" }, - "asks": { - "type": "array", - "items": { - "type": "array", - "items": { - "type": "string", - "description": "Price, Size" - } - }, - "description": "asks, from low to high" - } - }, - "required": [ - "time", - "sequence", - "bids", - "asks" - ] - } - }, - "required": [ - "code", - "data" - ] - } - } - } - } - }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470164", - "x-abandon": "normal", - "x-domain": "Spot", - "x-api-channel": "Private", - "x-api-permission": "General", - "x-api-rate-limit-pool": "Spot", - "x-sdk-service": "Spot", - "x-sdk-sub-service": "Market", - "x-sdk-method-name": "getFullOrderBook", - "x-sdk-method-description": "Query for Full orderbook depth data. (aggregated by price) It is generally used by professional traders because it uses more server resources and traffic, and we have strict access rate limit control. To maintain up-to-date Order Book, please use Websocket incremental feed after retrieving the OrderBook.", - "x-api-rate-limit": 3, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"time\\\": 1729176273859,\\n \\\"sequence\\\": \\\"14610502970\\\",\\n \\\"bids\\\": [\\n [\\n \\\"66976.4\\\",\\n \\\"0.69109872\\\"\\n ],\\n [\\n \\\"66976.3\\\",\\n \\\"0.14377\\\"\\n ]\\n ],\\n \\\"asks\\\": [\\n [\\n \\\"66976.5\\\",\\n \\\"0.05408199\\\"\\n ],\\n [\\n \\\"66976.8\\\",\\n \\\"0.0005\\\"\\n ]\\n ]\\n }\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\"}" - } - }, - "/api/v1/market/orderbook/level2_{size}": { - "get": { - "summary": "Get Part OrderBook", - "deprecated": false, - "description": "Query for part orderbook depth data. (aggregated by price) You are recommended to request via this endpoint as the system reponse would be faster and cosume less traffic.", - "tags": [], - "parameters": [ - { - "name": "symbol", - "in": "query", - "description": "symbol", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "size", - "in": "path", - "description": "Get the depth layer, optional value: 20, 100", - "required": true, - "schema": { - "type": "integer" - } - } - ], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "data": { - "type": "object", - "properties": { - "time": { - "type": "integer", - "description": "Timestamp(millisecond)", - "format": "int64" + "POL": { + "type": "string" }, - "sequence": { - "type": "string", - "description": "Sequence number" + "ASTR": { + "type": "string" }, - "bids": { - "type": "array", - "items": { - "type": "array", - "items": { - "type": "string", - "description": "Price, Size" - } - }, - "description": "bids, from high to low" + "NKN": { + "type": "string" }, - "asks": { - "type": "array", - "items": { - "type": "array", - "items": { - "type": "string", - "description": "Price, Size" - } - }, - "description": "asks, from low to high" - } - }, - "required": [ - "sequence", - "bids", - "asks", - "time" - ] - } - }, - "required": [ - "code", - "data" - ] - } - } - } - } - }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470165", - "x-abandon": "normal", - "x-domain": "Spot", - "x-api-channel": "Public", - "x-api-permission": "NULL", - "x-api-rate-limit-pool": "Public", - "x-sdk-service": "Spot", - "x-sdk-sub-service": "Market", - "x-sdk-method-name": "getPartOrderBook", - "x-sdk-method-description": "Query for part orderbook depth data. (aggregated by price) You are recommended to request via this endpoint as the system reponse would be faster and cosume less traffic.", - "x-api-rate-limit": 2, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"time\\\": 1729176273859,\\n \\\"sequence\\\": \\\"14610502970\\\",\\n \\\"bids\\\": [\\n [\\n \\\"66976.4\\\",\\n \\\"0.69109872\\\"\\n ],\\n [\\n \\\"66976.3\\\",\\n \\\"0.14377\\\"\\n ]\\n ],\\n \\\"asks\\\": [\\n [\\n \\\"66976.5\\\",\\n \\\"0.05408199\\\"\\n ],\\n [\\n \\\"66976.8\\\",\\n \\\"0.0005\\\"\\n ]\\n ]\\n }\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"size\\\": \\\"20\\\"}" - } - }, - "/api/v1/markets": { - "get": { - "summary": "Get Market List", - "deprecated": false, - "description": "Request via this endpoint to get the transaction currency for the entire trading market.", - "tags": [], - "parameters": [], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "data": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": [ - "code", - "data" - ] - } - } - } - } - }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470166", - "x-abandon": "normal", - "x-domain": "Spot", - "x-api-channel": "Public", - "x-api-permission": "NULL", - "x-api-rate-limit-pool": "Public", - "x-sdk-service": "Spot", - "x-sdk-sub-service": "Market", - "x-sdk-method-name": "getMarketList", - "x-sdk-method-description": "Request via this endpoint to get the transaction currency for the entire trading market.", - "x-api-rate-limit": 3, - "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":[\\\"USDS\\\",\\\"TON\\\",\\\"AI\\\",\\\"DePIN\\\",\\\"PoW\\\",\\\"BRC-20\\\",\\\"ETF\\\",\\\"KCS\\\",\\\"Meme\\\",\\\"Solana\\\",\\\"FIAT\\\",\\\"VR&AR\\\",\\\"DeFi\\\",\\\"Polkadot\\\",\\\"BTC\\\",\\\"ALTS\\\",\\\"Layer 1\\\"]}" - } - }, - "/api/v1/market/allTickers": { - "get": { - "summary": "Get All Tickers", - "deprecated": false, - "description": "Request market tickers for all the trading pairs in the market (including 24h volume), takes a snapshot every 2 seconds. On the rare occasion that we will change the currency name, if you still want the changed symbol name, you can use the symbolName field instead of the symbol field via “Get all tickers” endpoint.", - "tags": [], - "parameters": [], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "data": { - "type": "object", - "properties": { - "time": { - "type": "integer", - "description": "timestamp", - "format": "int64" + "RSR": { + "type": "string" + }, + "DVPN": { + "type": "string" + }, + "TWT": { + "type": "string" + }, + "ARB": { + "type": "string" + }, + "CVC": { + "type": "string" }, - "ticker": { - "type": "array", - "items": { - "type": "object", - "properties": { - "symbol": { - "type": "string", - "description": "Symbol" - }, - "symbolName": { - "type": "string", - "description": "Name of trading pairs, it would change after renaming" - }, - "buy": { - "type": "string", - "description": "Best bid price" - }, - "bestBidSize": { - "type": "string", - "description": "Best bid size" - }, - "sell": { - "type": "string", - "description": "Best ask price" - }, - "bestAskSize": { - "type": "string", - "description": "Best ask size" - }, - "changeRate": { - "type": "string", - "description": "24h change rate" - }, - "changePrice": { - "type": "string", - "description": "24h change price" - }, - "high": { - "type": "string", - "description": "Highest price in 24h" - }, - "low": { - "type": "string", - "description": "Lowest price in 24h" - }, - "vol": { - "type": "string", - "description": "24h volume, executed based on base currency" - }, - "volValue": { - "type": "string", - "description": "24h traded amount" - }, - "last": { - "type": "string", - "description": "Last traded price" - }, - "averagePrice": { - "type": "string", - "description": "Average trading price in the last 24 hours" - }, - "takerFeeRate": { - "type": "string", - "description": "Basic Taker Fee" - }, - "makerFeeRate": { - "type": "string", - "description": "Basic Maker Fee" - }, - "takerCoefficient": { - "type": "string", - "description": "The taker fee coefficient. The actual fee needs to be multiplied by this coefficient to get the final fee. Most currencies have a coefficient of 1. If set to 0, it means no fee", - "enum": [ - "1", - "0" - ], - "x-api-enum": [ - { - "value": "1", - "name": "1", - "description": "the taker fee coefficient is 1" - }, - { - "value": "0", - "name": "0", - "description": "no fee" - } - ] - }, - "makerCoefficient": { - "type": "string", - "description": "The maker fee coefficient. The actual fee needs to be multiplied by this coefficient to get the final fee. Most currencies have a coefficient of 1. If set to 0, it means no fee", - "enum": [ - "1", - "0" - ], - "x-api-enum": [ - { - "value": "1", - "name": "1", - "description": "the maker fee coefficient is 1" - }, - { - "value": "0", - "name": "0", - "description": "no fee" - } - ] - } - }, - "required": [ - "symbol", - "symbolName", - "buy", - "bestBidSize", - "sell", - "bestAskSize", - "changeRate", - "changePrice", - "high", - "low", - "vol", - "volValue", - "last", - "averagePrice", - "takerFeeRate", - "makerFeeRate", - "takerCoefficient", - "makerCoefficient" - ] - } - } - }, - "required": [ - "time", - "ticker" - ] - } - }, - "required": [ - "code", - "data" - ] - } - } - } - } - }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470167", - "x-abandon": "normal", - "x-domain": "Spot", - "x-api-channel": "Public", - "x-api-permission": "NULL", - "x-api-rate-limit-pool": "Public", - "x-sdk-service": "Spot", - "x-sdk-sub-service": "Market", - "x-sdk-method-name": "getAllTickers", - "x-sdk-method-description": "Request market tickers for all the trading pairs in the market (including 24h volume), takes a snapshot every 2 seconds. On the rare occasion that we will change the currency name, if you still want the changed symbol name, you can use the symbolName field instead of the symbol field via “Get all tickers” endpoint.", - "x-api-rate-limit": 15, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"time\\\": 1729173207043,\\n \\\"ticker\\\": [\\n {\\n \\\"symbol\\\": \\\"BTC-USDT\\\",\\n \\\"symbolName\\\": \\\"BTC-USDT\\\",\\n \\\"buy\\\": \\\"67192.5\\\",\\n \\\"bestBidSize\\\": \\\"0.000025\\\",\\n \\\"sell\\\": \\\"67192.6\\\",\\n \\\"bestAskSize\\\": \\\"1.24949204\\\",\\n \\\"changeRate\\\": \\\"-0.0014\\\",\\n \\\"changePrice\\\": \\\"-98.5\\\",\\n \\\"high\\\": \\\"68321.4\\\",\\n \\\"low\\\": \\\"66683.3\\\",\\n \\\"vol\\\": \\\"1836.03034612\\\",\\n \\\"volValue\\\": \\\"124068431.06726933\\\",\\n \\\"last\\\": \\\"67193\\\",\\n \\\"averagePrice\\\": \\\"67281.21437289\\\",\\n \\\"takerFeeRate\\\": \\\"0.001\\\",\\n \\\"makerFeeRate\\\": \\\"0.001\\\",\\n \\\"takerCoefficient\\\": \\\"1\\\",\\n \\\"makerCoefficient\\\": \\\"1\\\"\\n }\\n ]\\n }\\n}" - } - }, - "/api/v1/hf/orders/multi": { - "post": { - "summary": "Batch Add Orders", - "deprecated": false, - "description": "This endpoint supports sequential batch order placement from a single endpoint. A maximum of 5orders can be placed simultaneously. The order types must be limit orders of the same trading pair", - "tags": [], - "parameters": [], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "data": { - "type": "array", - "items": { - "type": "object", - "properties": { - "orderId": { - "type": "string", - "description": "The unique order id generated by the trading system,which can be used later for further actions such as canceling the order." - }, - "clientOid": { - "type": "string", - "description": "The user self-defined order id." - }, - "success": { - "type": "boolean", - "description": "Add order success/failure" - }, - "failMsg": { - "type": "string", - "description": "error message" - } + "ARC": { + "type": "string" + }, + "XETA": { + "type": "string" + }, + "MTRG": { + "type": "string" + }, + "LOKA": { + "type": "string" + }, + "LPOOL": { + "type": "string" + }, + "TURBOS": { + "type": "string" + }, + "CVX": { + "type": "string" + }, + "ARX": { + "type": "string" + }, + "MPLX": { + "type": "string" + }, + "SUSHI": { + "type": "string" + }, + "NLK": { + "type": "string" + }, + "PEPE2": { + "type": "string" + }, + "WBTC": { + "type": "string" + }, + "SUI3L": { + "type": "string" + }, + "CWS": { + "type": "string" + }, + "SUI3S": { + "type": "string" + }, + "INSP": { + "type": "string" + }, + "MANA": { + "type": "string" + }, + "VRTX": { + "type": "string" }, - "required": [ - "success" - ] - } - } - }, - "required": [ - "code", - "data" - ] - } - } - } - } - }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470168", - "x-abandon": "normal", - "x-domain": "Spot", - "x-api-channel": "Private", - "x-api-permission": "Spot", - "x-api-rate-limit-pool": "Spot", - "x-sdk-service": "Spot", - "x-sdk-sub-service": "Order", - "x-sdk-method-name": "batchAddOrders", - "x-sdk-method-description": "This endpoint supports sequential batch order placement from a single endpoint. A maximum of 5orders can be placed simultaneously. The order types must be limit orders of the same trading pair", - "x-api-rate-limit": 1, - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "orderList": { - "type": "array", - "items": { - "type": "object", - "properties": { - "clientOid": { - "type": "string", - "description": "Client Order Id,The ClientOid field is a unique ID created by the user(we recommend using a UUID), and can only contain numbers, letters, underscores (_), and hyphens (-). This field is returned when order information is obtained. You can use clientOid to tag your orders. ClientOid is different from the order ID created by the service provider. Please do not initiate requests using the same clientOid. The maximum length for the ClientOid is 40 characters.\n" + "CSPR": { + "type": "string" }, - "symbol": { - "type": "string", - "description": "symbol", - "example": [ - "BTC-USDT", - "ETH-USDT", - "KCS-USDT" - ] + "ATA": { + "type": "string" }, - "type": { - "type": "string", - "description": "Specify if the order is an 'limit' order or 'market' order. ", - "enum": [ - "limit" - ], - "x-api-enum": [ - { - "value": "limit", - "name": "", - "description": "" - } - ] + "OPEN": { + "type": "string" }, - "timeInForce": { - "type": "string", - "description": "[Time in force](https://www.kucoin.com/docs-new/doc-338146) is a special strategy used during trading", - "enum": [ - "GTC", - "GTT", - "IOC", - "FOK" - ], - "default": "GTC", - "x-api-enum": [ - { - "value": "GTC", - "name": "", - "description": "" - }, - { - "value": "GTT", - "name": "", - "description": "" - }, - { - "value": "IOC", - "name": "", - "description": "" - }, - { - "value": "FOK", - "name": "", - "description": "" - } - ] + "HAI": { + "type": "string" }, - "side": { - "type": "string", - "description": "Specify if the order is to 'buy' or 'sell'", - "enum": [ - "buy", - "sell" - ], - "x-api-enum": [ - { - "value": "buy", - "name": "", - "description": "" - }, - { - "value": "sell", - "name": "", - "description": "" - } - ] + "NMR": { + "type": "string" + }, + "ATH": { + "type": "string" + }, + "LIT": { + "type": "string" + }, + "TLOS": { + "type": "string" + }, + "TNSR": { + "type": "string" + }, + "CXT": { + "type": "string" + }, + "POLYX": { + "type": "string" + }, + "ZERO": { + "type": "string" + }, + "ROUTE": { + "type": "string" + }, + "LOOM": { + "type": "string" + }, + "PRE": { + "type": "string" + }, + "VRAUP": { + "type": "string" + }, + "HBB": { + "type": "string" + }, + "RVN": { + "type": "string" + }, + "PRQ": { + "type": "string" + }, + "ONDO": { + "type": "string" + }, + "PEPEDOWN": { + "type": "string" + }, + "WOOP": { + "type": "string" + }, + "LUNCUP": { + "type": "string" + }, + "KAVA": { + "type": "string" + }, + "LKI": { + "type": "string" + }, + "AVA": { + "type": "string" + }, + "NOM": { + "type": "string" + }, + "MAPO": { + "type": "string" + }, + "PEPEUP": { + "type": "string" + }, + "STRAX": { + "type": "string" + }, + "NOT": { + "type": "string" + }, + "ZERC": { + "type": "string" + }, + "BCUT": { + "type": "string" + }, + "MASA": { + "type": "string" + }, + "WAN": { + "type": "string" + }, + "WAT": { + "type": "string" + }, + "WAX": { + "type": "string" + }, + "MASK": { + "type": "string" + }, + "EOS3L": { + "type": "string" + }, + "IDEA": { + "type": "string" + }, + "EOS3S": { + "type": "string" + }, + "YFI": { + "type": "string" + }, + "MOODENG": { + "type": "string" + }, + "XCUR": { + "type": "string" + }, + "HYDRA": { + "type": "string" + }, + "POPCAT": { + "type": "string" + }, + "LQTY": { + "type": "string" + }, + "PIXEL": { + "type": "string" + }, + "LMR": { + "type": "string" + }, + "ZETA": { + "type": "string" }, - "price": { - "type": "string", - "description": "Specify price for order" + "YGG": { + "type": "string" }, - "size": { - "type": "string", - "description": "Specify quantity for order\n\nWhen **type** is limit, select one out of two: size or funds, size refers to the amount of trading targets (the asset name written in front) for the trading pair. Teh Size must be based on the baseIncrement of the trading pair. The baseIncrement represents the precision for the trading pair. The size of an order must be a positive-integer multiple of baseIncrement and must be between baseMinSize and baseMaxSize.\n\nWhen **type** is market, select one out of two: size or funds" + "AXS": { + "type": "string" }, - "stp": { - "type": "string", - "description": "[Self Trade Prevention](https://www.kucoin.com/docs-new/doc-338146) is divided into four strategies: CN, CO, CB , and DC", - "enum": [ - "DC", - "CO", - "CN", - "CB" - ], - "x-api-enum": [ - { - "value": "DC", - "name": "", - "description": "" - }, - { - "value": "CO", - "name": "", - "description": "" - }, - { - "value": "CN", - "name": "", - "description": "" - }, - { - "value": "CB", - "name": "", - "description": "" - } - ] + "BCHSV": { + "type": "string" }, - "cancelAfter": { - "type": "integer", - "description": "Cancel after n seconds,the order timing strategy is GTT", - "format": "int64" + "NRN": { + "type": "string" }, - "postOnly": { - "type": "boolean", - "default": false, - "description": "passive order labels, this is disabled when the order timing strategy is IOC or FOK" + "FTON": { + "type": "string" }, - "hidden": { - "type": "boolean", - "description": "[Hidden order](https://www.kucoin.com/docs-new/doc-338146) or not (not shown in order book)", - "default": false + "COMP": { + "type": "string" }, - "iceberg": { - "type": "boolean", - "description": "Whether or not only visible portions of orders are shown in [Iceberg orders](https://www.kucoin.com/docs-new/doc-338146)", - "default": false + "XPRT": { + "type": "string" }, - "visibleSize": { - "type": "string", - "description": "Maximum visible quantity in iceberg orders" + "HFT": { + "type": "string" }, - "tags": { - "type": "string", - "description": "Order tag, length cannot exceed 20 characters (ASCII)" + "UXLINK": { + "type": "string" }, - "remark": { - "type": "string", - "description": "Order placement remarks, length cannot exceed 20 characters (ASCII)" + "STAMP": { + "type": "string" }, - "funds": { - "type": "string", - "description": "When **type** is market, select one out of two: size or funds" - } - }, - "required": [ - "type", - "symbol", - "side", - "price" - ] - }, - "description": "Order List" - } - }, - "required": [ - "orderList" - ] - }, - "example": "{\n \"orderList\": [\n {\n \"clientOid\": \"client order id 12\",\n \"symbol\": \"BTC-USDT\",\n \"type\": \"limit\",\n \"side\": \"buy\",\n \"price\": \"30000\",\n \"size\": \"0.00001\"\n },\n {\n \"clientOid\": \"client order id 13\",\n \"symbol\": \"ETH-USDT\",\n \"type\": \"limit\",\n \"side\": \"sell\",\n \"price\": \"2000\",\n \"size\": \"0.00001\"\n }\n ]\n}" - } - } - }, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": [\\n {\\n \\\"orderId\\\": \\\"6710d8336afcdb0007319c27\\\",\\n \\\"clientOid\\\": \\\"client order id 12\\\",\\n \\\"success\\\": true\\n },\\n {\\n \\\"success\\\": false,\\n \\\"failMsg\\\": \\\"The order funds should more then 0.1 USDT.\\\"\\n }\\n ]\\n}", - "x-request-example": "{\\\"orderList\\\": [{\\\"clientOid\\\": \\\"client order id 12\\\", \\\"symbol\\\": \\\"BTC-USDT\\\", \\\"type\\\": \\\"limit\\\", \\\"side\\\": \\\"buy\\\", \\\"price\\\": \\\"30000\\\", \\\"size\\\": \\\"0.00001\\\"}, {\\\"clientOid\\\": \\\"client order id 13\\\", \\\"symbol\\\": \\\"ETH-USDT\\\", \\\"type\\\": \\\"limit\\\", \\\"side\\\": \\\"sell\\\", \\\"price\\\": \\\"2000\\\", \\\"size\\\": \\\"0.00001\\\"}]}" - } - }, - "/api/v1/hf/orders/multi/sync": { - "post": { - "summary": "Batch Add Orders Sync", - "deprecated": false, - "description": "This endpoint supports sequential batch order placement from a single endpoint. A maximum of 5orders can be placed simultaneously. The order types must be limit orders of the same trading pair", - "tags": [], - "parameters": [], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "data": { - "type": "array", - "items": { - "type": "object", - "properties": { - "orderId": { - "type": "string", - "description": "The unique order id generated by the trading system,which can be used later for further actions such as canceling the order." - }, - "clientOid": { - "type": "string", - "description": "The user self-defined order id." - }, - "orderTime": { - "type": "integer", - "format": "int64" - }, - "originSize": { - "type": "string", - "description": "original order size" - }, - "dealSize": { - "type": "string", - "description": "deal size" - }, - "remainSize": { - "type": "string", - "description": "remain size" - }, - "canceledSize": { - "type": "string", - "description": "Cumulative canceled size" - }, - "status": { - "type": "string", - "description": "Order Status. open:order is active; done:order has been completed", - "enum": [ - "open", - "done" - ], - "x-api-enum": [ - { - "value": "open", - "name": "", - "description": "" - }, - { - "value": "done", - "name": "", - "description": "" - } - ] - }, - "matchTime": { - "type": "integer", - "format": "int64" - }, - "success": { - "type": "boolean", - "description": "Add order success/failure" - }, - "failMsg": { - "type": "string", - "description": "error message" - } + "RUNE": { + "type": "string" }, - "required": [ - "success" - ] - } - } - }, - "required": [ - "code", - "data" - ] - } - } - } - } - }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470169", - "x-abandon": "normal", - "x-domain": "Spot", - "x-api-channel": "Private", - "x-api-permission": "Spot", - "x-api-rate-limit-pool": "Spot", - "x-sdk-service": "Spot", - "x-sdk-sub-service": "Order", - "x-sdk-method-name": "batchAddOrdersSync", - "x-sdk-method-description": "This endpoint supports sequential batch order placement from a single endpoint. A maximum of 5orders can be placed simultaneously. The order types must be limit orders of the same trading pair", - "x-api-rate-limit": 1, - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "orderList": { - "type": "array", - "items": { - "type": "object", - "properties": { - "clientOid": { - "type": "string", - "description": "Client Order Id,The ClientOid field is a unique ID created by the user(we recommend using a UUID), and can only contain numbers, letters, underscores (_), and hyphens (-). This field is returned when order information is obtained. You can use clientOid to tag your orders. ClientOid is different from the order ID created by the service provider. Please do not initiate requests using the same clientOid. The maximum length for the ClientOid is 40 characters.\n" + "ZEUS": { + "type": "string" }, - "symbol": { - "type": "string", - "description": "symbol", - "example": [ - "BTC-USDT", - "ETH-USDT", - "KCS-USDT" - ] + "LTC3L": { + "type": "string" + }, + "DAPP": { + "type": "string" + }, + "FORTH": { + "type": "string" + }, + "ALPINE": { + "type": "string" }, - "type": { - "type": "string", - "description": "Specify if the order is an 'limit' order or 'market' order. ", - "enum": [ - "limit" - ], - "x-api-enum": [ - { - "value": "limit", - "name": "", - "description": "" - } - ] + "SENSO": { + "type": "string" }, - "timeInForce": { - "type": "string", - "description": "[Time in force](https://www.kucoin.com/docs-new/doc-338146) is a special strategy used during trading", - "enum": [ - "GTC", - "GTT", - "IOC", - "FOK" - ], - "default": "GTC", - "x-api-enum": [ - { - "value": "GTC", - "name": "", - "description": "" - }, - { - "value": "GTT", - "name": "", - "description": "" - }, - { - "value": "IOC", - "name": "", - "description": "" - }, - { - "value": "FOK", - "name": "", - "description": "" - } - ] + "LTC3S": { + "type": "string" }, - "side": { - "type": "string", - "description": "Specify if the order is to 'buy' or 'sell'", - "enum": [ - "buy", - "sell" - ], - "x-api-enum": [ - { - "value": "buy", - "name": "", - "description": "" - }, - { - "value": "sell", - "name": "", - "description": "" - } - ] + "DEXE": { + "type": "string" }, - "price": { - "type": "string", - "description": "Specify price for order" + "GOAL": { + "type": "string" }, - "size": { - "type": "string", - "description": "Specify quantity for order\n\nWhen **type** is limit, select one out of two: size or funds, size refers to the amount of trading targets (the asset name written in front) for the trading pair. Teh Size must be based on the baseIncrement of the trading pair. The baseIncrement represents the precision for the trading pair. The size of an order must be a positive-integer multiple of baseIncrement and must be between baseMinSize and baseMaxSize.\n\nWhen **type** is market, select one out of two: size or funds" + "AVAX": { + "type": "string" }, - "stp": { - "type": "string", - "description": "[Self Trade Prevention](https://www.kucoin.com/docs-new/doc-338146) is divided into four strategies: CN, CO, CB , and DC", - "enum": [ - "DC", - "CO", - "CN", - "CB" - ], - "x-api-enum": [ - { - "value": "DC", - "name": "", - "description": "" - }, - { - "value": "CO", - "name": "", - "description": "" - }, - { - "value": "CN", - "name": "", - "description": "" - }, - { - "value": "CB", - "name": "", - "description": "" - } - ] + "LISTA": { + "type": "string" }, - "cancelAfter": { - "type": "integer", - "description": "Cancel after n seconds,the order timing strategy is GTT", - "format": "int64" + "AMPL": { + "type": "string" }, - "postOnly": { - "type": "boolean", - "default": false, - "description": "passive order labels, this is disabled when the order timing strategy is IOC or FOK" + "WORK": { + "type": "string" }, - "hidden": { - "type": "boolean", - "description": "[Hidden order](https://www.kucoin.com/docs-new/doc-338146) or not (not shown in order book)", - "default": false + "BRWL": { + "type": "string" }, - "iceberg": { - "type": "boolean", - "description": "Whether or not only visible portions of orders are shown in [Iceberg orders](https://www.kucoin.com/docs-new/doc-338146)", - "default": false + "BANANA": { + "type": "string" }, - "visibleSize": { - "type": "string", - "description": "Maximum visible quantity in iceberg orders" + "PUSH": { + "type": "string" }, - "tags": { - "type": "string", - "description": "Order tag, length cannot exceed 20 characters (ASCII)" + "WEN": { + "type": "string" }, - "remark": { - "type": "string", - "description": "Order placement remarks, length cannot exceed 20 characters (ASCII)" + "NEIRO": { + "type": "string" }, - "funds": { - "type": "string", - "description": "When **type** is market, select one out of two: size or funds" - } - }, - "required": [ - "type", - "symbol", - "side", - "price" - ] - }, - "description": "Order List" - } - }, - "required": [ - "orderList" - ] - }, - "example": "{\n \"orderList\": [\n {\n \"clientOid\": \"client order id 13\",\n \"symbol\": \"BTC-USDT\",\n \"type\": \"limit\",\n \"side\": \"buy\",\n \"price\": \"30000\",\n \"size\": \"0.00001\"\n },\n {\n \"clientOid\": \"client order id 14\",\n \"symbol\": \"ETH-USDT\",\n \"type\": \"limit\",\n \"side\": \"sell\",\n \"price\": \"2000\",\n \"size\": \"0.00001\"\n }\n ]\n}" - } - } - }, - "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":[{\\\"orderId\\\":\\\"6711195e5584bc0007bd5aef\\\",\\\"clientOid\\\":\\\"client order id 13\\\",\\\"orderTime\\\":1729173854299,\\\"originSize\\\":\\\"0.00001\\\",\\\"dealSize\\\":\\\"0\\\",\\\"remainSize\\\":\\\"0.00001\\\",\\\"canceledSize\\\":\\\"0\\\",\\\"status\\\":\\\"open\\\",\\\"matchTime\\\":1729173854326,\\\"success\\\":true},{\\\"success\\\":false,\\\"failMsg\\\":\\\"The order funds should more then 0.1 USDT.\\\"}]}", - "x-request-example": "{\\\"orderList\\\": [{\\\"clientOid\\\": \\\"client order id 13\\\", \\\"symbol\\\": \\\"BTC-USDT\\\", \\\"type\\\": \\\"limit\\\", \\\"side\\\": \\\"buy\\\", \\\"price\\\": \\\"30000\\\", \\\"size\\\": \\\"0.00001\\\"}, {\\\"clientOid\\\": \\\"client order id 14\\\", \\\"symbol\\\": \\\"ETH-USDT\\\", \\\"type\\\": \\\"limit\\\", \\\"side\\\": \\\"sell\\\", \\\"price\\\": \\\"2000\\\", \\\"size\\\": \\\"0.00001\\\"}]}" - } - }, - "/api/v1/hf/orders/sync": { - "post": { - "summary": "Add Order Sync", - "deprecated": false, - "description": "Place order to the spot trading system The difference between this interface and \"Add order\" is that this interface will synchronously return the order information after the order matching is completed. For higher latency requirements, please select the \"Add order\" interface. If there is a requirement for returning data integrity, please select this interface", - "tags": [], - "parameters": [], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "data": { - "type": "object", - "properties": { - "orderId": { - "type": "string", - "description": "The unique order id generated by the trading system,which can be used later for further actions such as canceling the order." + "BTCUP": { + "type": "string" }, - "clientOid": { - "type": "string", - "description": "The user self-defined order id." + "SOL3S": { + "type": "string" }, - "orderTime": { - "type": "integer", - "format": "int64" + "BRAWL": { + "type": "string" }, - "originSize": { - "type": "string", - "description": "original order size" + "LAY3R": { + "type": "string" }, - "dealSize": { - "type": "string", - "description": "deal size" + "LPT": { + "type": "string" }, - "remainSize": { - "type": "string", - "description": "remain size" + "GODS": { + "type": "string" }, - "canceledSize": { - "type": "string", - "description": "Cumulative canceled size" + "SAND3S": { + "type": "string" }, - "status": { - "type": "string", - "description": "Order Status. open:order is active; done:order has been completed", - "enum": [ - "open", - "done" - ], - "x-api-enum": [ - { - "value": "open", - "name": "", - "description": "" - }, - { - "value": "done", - "name": "", - "description": "" - } - ] + "RDNT": { + "type": "string" }, - "matchTime": { - "type": "integer", - "format": "int64" - } - }, - "required": [ - "orderId", - "clientOid", - "orderTime", - "originSize", - "dealSize", - "remainSize", - "canceledSize", - "status", - "matchTime" - ] - } - }, - "required": [ - "code", - "data" - ] - } - } - } - } - }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470170", - "x-abandon": "normal", - "x-domain": "Spot", - "x-api-channel": "Private", - "x-api-permission": "Spot", - "x-api-rate-limit-pool": "Spot", - "x-sdk-service": "Spot", - "x-sdk-sub-service": "Order", - "x-sdk-method-name": "addOrderSync", - "x-sdk-method-description": "Place order to the spot trading system The difference between this interface and \"Add order\" is that this interface will synchronously return the order information after the order matching is completed. For higher latency requirements, please select the \"Add order\" interface. If there is a requirement for returning data integrity, please select this interface", - "x-api-rate-limit": 1, - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "clientOid": { - "type": "string", - "description": "Client Order Id,The ClientOid field is a unique ID created by the user(we recommend using a UUID), and can only contain numbers, letters, underscores (_), and hyphens (-). This field is returned when order information is obtained. You can use clientOid to tag your orders. ClientOid is different from the order ID created by the service provider. Please do not initiate requests using the same clientOid. The maximum length for the ClientOid is 40 characters.\n\nPlease remember the orderId created by the service provider, it used to check for updates in order status.", - "example": [ - "5c52e11203aa677f33e493fb" - ] - }, - "side": { - "type": "string", - "description": "specify if the order is to 'buy' or 'sell'", - "enum": [ - "buy", - "sell" - ], - "x-api-enum": [ - { - "value": "buy", - "name": "", - "description": "" - }, - { - "value": "sell", - "name": "", - "description": "" - } - ], - "example": [ - "buy" - ] - }, - "symbol": { - "type": "string", - "description": "symbol", - "example": [ - "BTC-USDT", - "ETH-USDT", - "KCS-USDT" - ] - }, - "type": { - "type": "string", - "description": "specify if the order is an 'limit' order or 'market' order. \n\nThe type of order you specify when you place your order determines whether or not you need to request other parameters and also affects the execution of the matching engine.\n\nWhen placing a limit order, you must specify a price and size. The system will try to match the order according to market price or a price better than market price. If the order cannot be immediately matched, it will stay in the order book until it is matched or the user cancels.\n\nUnlike limit orders, the price for market orders fluctuates with market prices. When placing a market order, you do not need to specify a price, you only need to specify a quantity. Market orders are filled immediately and will not enter the order book. All market orders are takers and a taker fee will be charged.", - "enum": [ - "limit", - "market" - ], - "x-api-enum": [ - { - "value": "limit", - "name": "", - "description": "" - }, - { - "value": "market", - "name": "", - "description": "" - } - ], - "example": [ - "limit" - ] - }, - "remark": { - "type": "string", - "description": "Order placement remarks, length cannot exceed 20 characters (ASCII)" - }, - "stp": { - "type": "string", - "description": "[Self Trade Prevention](https://www.kucoin.com/docs-new/doc-338146) is divided into four strategies: CN, CO, CB , and DC", - "enum": [ - "DC", - "CO", - "CN", - "CB" - ], - "x-api-enum": [ - { - "value": "DC", - "name": "", - "description": "" - }, - { - "value": "CO", - "name": "", - "description": "" - }, - { - "value": "CN", - "name": "", - "description": "" - }, - { - "value": "CB", - "name": "", - "description": "" - } - ] - }, - "price": { - "type": "string", - "description": "Specify price for order\n\nWhen placing a limit order, the price must be based on priceIncrement for the trading pair. The price increment (priceIncrement) is the price precision for the trading pair. For example, for the BTC-USDT trading pair, the priceIncrement is 0.00001000. So the price for your orders cannot be less than 0.00001000 and must be a multiple of priceIncrement. Otherwise, the order will return an invalid priceIncrement error." - }, - "size": { - "type": "string", - "description": "Specify quantity for order\n\nWhen **type** is limit, size refers to the amount of trading targets (the asset name written in front) for the trading pair. Teh Size must be based on the baseIncrement of the trading pair. The baseIncrement represents the precision for the trading pair. The size of an order must be a positive-integer multiple of baseIncrement and must be between baseMinSize and baseMaxSize.\n\nWhen **type** is market, select one out of two: size or funds" - }, - "timeInForce": { - "type": "string", - "description": "[Time in force](https://www.kucoin.com/docs-new/doc-338146) is a special strategy used during trading", - "enum": [ - "GTC", - "GTT", - "IOC", - "FOK" - ], - "default": "GTC", - "x-api-enum": [ - { - "value": "GTC", - "name": "", - "description": "" - }, - { - "value": "GTT", - "name": "", - "description": "" - }, - { - "value": "IOC", - "name": "", - "description": "" - }, - { - "value": "FOK", - "name": "", - "description": "" - } - ] - }, - "postOnly": { - "type": "boolean", - "default": false, - "description": "passive order labels, this is disabled when the order timing strategy is IOC or FOK" - }, - "hidden": { - "type": "boolean", - "description": "[Hidden order](https://www.kucoin.com/docs-new/doc-338146) or not (not shown in order book)", - "default": false - }, - "iceberg": { - "type": "boolean", - "description": "Whether or not only visible portions of orders are shown in [Iceberg orders](https://www.kucoin.com/docs-new/doc-338146)", - "default": false - }, - "visibleSize": { - "type": "string", - "description": "Maximum visible quantity in iceberg orders" - }, - "tags": { - "type": "string", - "description": "Order tag, length cannot exceed 20 characters (ASCII)" - }, - "cancelAfter": { - "type": "integer", - "format": "int64", - "description": "Cancel after n seconds,the order timing strategy is GTT" - }, - "funds": { - "type": "string", - "description": "When **type** is market, select one out of two: size or funds" - } - }, - "required": [ - "symbol", - "type", - "side" - ] - }, - "example": "//limit order\n{\n \"type\": \"limit\",\n \"symbol\": \"BTC-USDT\",\n \"side\": \"buy\",\n \"price\": \"50000\",\n \"size\": \"0.00001\",\n \"clientOid\": \"5c52e11203aa677f33e493f\",\n \"remark\": \"order remarks\"\n}\n\n//market order 1\n// {\n// \"type\": \"market\",\n// \"symbol\": \"BTC-USDT\",\n// \"side\": \"buy\",\n// \"size\": \"0.00001\",\n// \"clientOid\": \"5c52e11203aa677f33e493fc\",\n// \"remark\": \"order remarks\",\n// }\n\n//market order 2\n// {\n// \"type\": \"market\",\n// \"symbol\": \"BTC-USDT\",\n// \"side\": \"buy\",\n// \"funds\": \"1\",\n// \"clientOid\": \"5c52e11203aa677f33e493fc\",\n// \"remark\": \"order remarks\",\n// }\n" - } - } - }, - "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"orderId\\\":\\\"67111a7cb7cbdf000703e1f6\\\",\\\"clientOid\\\":\\\"5c52e11203aa677f33e493f\\\",\\\"orderTime\\\":1729174140586,\\\"originSize\\\":\\\"0.00001\\\",\\\"dealSize\\\":\\\"0\\\",\\\"remainSize\\\":\\\"0.00001\\\",\\\"canceledSize\\\":\\\"0\\\",\\\"status\\\":\\\"open\\\",\\\"matchTime\\\":1729174140588}}", - "x-request-example": "{\\\"type\\\": \\\"limit\\\", \\\"symbol\\\": \\\"BTC-USDT\\\", \\\"side\\\": \\\"buy\\\", \\\"price\\\": \\\"50000\\\", \\\"size\\\": \\\"0.00001\\\", \\\"clientOid\\\": \\\"5c52e11203aa677f33e493f\\\", \\\"remark\\\": \\\"order remarks\\\"}" - } - }, - "/api/v1/hf/orders/alter": { - "post": { - "summary": "Modify Order", - "deprecated": false, - "description": "This interface can modify the price and quantity of the order according to orderId or clientOid. The implementation of this interface is: cancel the order and place a new order on the same trading pair, and return the modification result to the client synchronously When the quantity of the new order updated by the user is less than the filled quantity of this order, the order will be considered as completed, and the order will be cancelled, and no new order will be placed", - "tags": [], - "parameters": [], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "data": { - "type": "object", - "properties": { - "newOrderId": { - "type": "string", - "description": "The new order id" + "SOL3L": { + "type": "string" }, - "clientOid": { - "type": "string", - "description": "The original client order id" - } - }, - "required": [ - "newOrderId", - "clientOid" - ] - } - }, - "required": [ - "code", - "data" - ] - } - } - } - } - }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470171", - "x-abandon": "normal", - "x-domain": "Spot", - "x-api-channel": "Private", - "x-api-permission": "Spot", - "x-api-rate-limit-pool": "Spot", - "x-sdk-service": "Spot", - "x-sdk-sub-service": "Order", - "x-sdk-method-name": "modifyOrder", - "x-sdk-method-description": "This interface can modify the price and quantity of the order according to orderId or clientOid. The implementation of this interface is: cancel the order and place a new order on the same trading pair, and return the modification result to the client synchronously When the quantity of the new order updated by the user is less than the filled quantity of this order, the order will be considered as completed, and the order will be cancelled, and no new order will be placed", - "x-api-rate-limit": 3, - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "clientOid": { - "type": "string", - "description": "The old client order id,orderId and clientOid must choose one", - "example": [ - "5c52e11203aa677f33e493fb" - ] - }, - "symbol": { - "type": "string", - "description": "symbol", - "example": [ - "BTC-USDT", - "ETH-USDT", - "KCS-USDT" - ] - }, - "orderId": { - "type": "string", - "description": "The old order id, orderId and clientOid must choose one" - }, - "newPrice": { - "type": "string", - "description": "The modified price of the new order, newPrice and newSize must choose one" - }, - "newSize": { - "type": "string", - "description": "The modified size of the new order, newPrice and newSize must choose one" - } - }, - "required": [ - "symbol" - ] - }, - "example": "{\n \"symbol\": \"BTC-USDT\",\n \"orderId\": \"670fd33bf9406e0007ab3945\",\n \"newPrice\": \"30000\",\n \"newSize\": \"0.0001\"\n}" - } - } - }, - "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"newOrderId\\\":\\\"67112258f9406e0007408827\\\",\\\"clientOid\\\":\\\"client order id 12\\\"}}", - "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"orderId\\\": \\\"670fd33bf9406e0007ab3945\\\", \\\"newPrice\\\": \\\"30000\\\", \\\"newSize\\\": \\\"0.0001\\\"}" - } - }, - "/api/v1/hf/orders/dead-cancel-all/query": { - "get": { - "summary": "Get DCP", - "deprecated": false, - "description": "Get Disconnection Protect(Deadman Swich)Through this interface, you can query the settings of automatic order cancellation", - "tags": [], - "parameters": [], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "data": { - "type": "object", - "properties": { - "timeout": { - "type": "integer", - "description": "Auto cancel order trigger setting time, the unit is second. range: timeout=-1 (meaning unset) or 5 <= timeout <= 86400" + "NIBI": { + "type": "string" + }, + "NUM": { + "type": "string" + }, + "PYR": { + "type": "string" + }, + "DAG": { + "type": "string" + }, + "DAI": { + "type": "string" + }, + "HIP": { + "type": "string" + }, + "DAO": { + "type": "string" + }, + "AVAIL": { + "type": "string" + }, + "DAR": { + "type": "string" + }, + "FET": { + "type": "string" + }, + "FCON": { + "type": "string" + }, + "XAVA": { + "type": "string" + }, + "LRC": { + "type": "string" + }, + "UNI3S": { + "type": "string" + }, + "POKT": { + "type": "string" + }, + "DASH": { + "type": "string" + }, + "BAKEDOWN": { + "type": "string" + }, + "POLC": { + "type": "string" + }, + "CIRUS": { + "type": "string" + }, + "UNI3L": { + "type": "string" + }, + "NWC": { + "type": "string" + }, + "POLK": { + "type": "string" + }, + "LSD": { + "type": "string" + }, + "MARS4": { + "type": "string" + }, + "LSK": { + "type": "string" + }, + "BLOCK": { + "type": "string" + }, + "ANALOS": { + "type": "string" + }, + "SAFE": { + "type": "string" + }, + "DCK": { + "type": "string" + }, + "LSS": { + "type": "string" + }, + "DCR": { + "type": "string" + }, + "LIKE": { + "type": "string" + }, + "DATA": { + "type": "string" + }, + "WIF": { + "type": "string" + }, + "BLOK": { + "type": "string" + }, + "LTC": { + "type": "string" + }, + "METIS": { + "type": "string" + }, + "WIN": { + "type": "string" + }, + "HLG": { + "type": "string" + }, + "LTO": { + "type": "string" + }, + "DYDX": { + "type": "string" + }, + "ARB3S": { + "type": "string" + }, + "MUBI": { + "type": "string" + }, + "ARB3L": { + "type": "string" + }, + "RBTC1": { + "type": "string" + }, + "POND": { + "type": "string" + }, + "LINA": { + "type": "string" + }, + "MYRIA": { + "type": "string" + }, + "LINK": { + "type": "string" + }, + "QTUM": { + "type": "string" + }, + "TUNE": { + "type": "string" + }, + "UFO": { + "type": "string" }, - "symbols": { - "type": "string", - "description": "List of trading pairs. Separated by commas, empty means all trading pairs" + "CYBER": { + "type": "string" }, - "currentTime": { - "type": "integer", - "description": "System current time (in seconds)" + "WILD": { + "type": "string" }, - "triggerTime": { - "type": "integer", - "description": "Trigger cancellation time (in seconds)" - } - }, - "description": "If the data is empty, it means that DCP is not set.", - "additionalProperties": false - } - }, - "required": [ - "code", - "data" - ] - } - } - } - } - }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470172", - "x-abandon": "normal", - "x-domain": "Spot", - "x-api-channel": "Private", - "x-api-permission": "Spot", - "x-api-rate-limit-pool": "Spot", - "x-sdk-service": "Spot", - "x-sdk-sub-service": "Order", - "x-sdk-method-name": "getDCP", - "x-sdk-method-description": "Get Disconnection Protect(Deadman Swich)Through this interface, you can query the settings of automatic order cancellation", - "x-api-rate-limit": 2, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"timeout\\\": 5,\\n \\\"symbols\\\": \\\"BTC-USDT,ETH-USDT\\\",\\n \\\"currentTime\\\": 1729241305,\\n \\\"triggerTime\\\": 1729241308\\n }\\n}" - } - }, - "/api/v1/hf/orders/dead-cancel-all": { - "post": { - "summary": "Set DCP", - "deprecated": false, - "description": "Set Disconnection Protect(Deadman Swich)Through this interface, Call this interface to automatically cancel all orders of the set trading pair after the specified time. If this interface is not called again for renewal or cancellation before the set time, the system will help the user to cancel the order of the corresponding trading pair. Otherwise it will not.", - "tags": [], - "parameters": [], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "data": { - "type": "object", - "properties": { - "currentTime": { - "type": "integer", - "description": "System current time (in seconds)" + "POLS": { + "type": "string" }, - "triggerTime": { - "type": "integer", - "description": "Trigger cancellation time (in seconds)" - } - }, - "required": [ - "currentTime", - "triggerTime" - ], - "description": "If the data is empty, it means that DCP is not set." - } - }, - "required": [ - "code", - "data" - ] - } - } - } - } - }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470173", - "x-abandon": "normal", - "x-domain": "Spot", - "x-api-channel": "Private", - "x-api-permission": "Spot", - "x-api-rate-limit-pool": "Spot", - "x-sdk-service": "Spot", - "x-sdk-sub-service": "Order", - "x-sdk-method-name": "setDCP", - "x-sdk-method-description": "Set Disconnection Protect(Deadman Swich)Through this interface, Call this interface to automatically cancel all orders of the set trading pair after the specified time. If this interface is not called again for renewal or cancellation before the set time, the system will help the user to cancel the order of the corresponding trading pair. Otherwise it will not.", - "x-api-rate-limit": 2, - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "timeout": { - "type": "integer", - "description": "Auto cancel order trigger setting time, the unit is second. range: timeout=-1 (meaning unset) or 5 <= timeout <= 86400. For example, timeout=5 means that the order will be automatically canceled if no user request is received for more than 5 seconds. When this parameter is changed, the previous setting will be overwritten." - }, - "symbols": { - "type": "string", - "description": "List of trading pairs. When this parameter is not empty, separate it with commas and support up to 50 trading pairs. Empty means all trading pairs. When this parameter is changed, the previous setting will be overwritten.", - "example": [ - "BTC-USDT,ETH-USDT" - ] - } - }, - "required": [ - "timeout" - ] - }, - "example": "{\n \"timeout\": 5,\n \"symbols\": \"BTC-USDT,ETH-USDT\"\n}" - } - } - }, - "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"currentTime\\\":1729656588,\\\"triggerTime\\\":1729656593}}", - "x-request-example": "{\\\"timeout\\\": 5, \\\"symbols\\\": \\\"BTC-USDT,ETH-USDT\\\"}" - } - }, - "/api/v1/hf/orders/{orderId}": { - "delete": { - "summary": "Cancel Order By OrderId", - "deprecated": false, - "description": "This endpoint can be used to cancel a spot order by orderId. This endpoint only sends cancellation requests. The results of the requests must be obtained by checking the order status or subscribing to websocket.", - "tags": [], - "parameters": [ - { - "name": "orderId", - "in": "path", - "description": "The unique order id generated by the trading system", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "symbol", - "in": "query", - "description": "symbol", - "required": true, - "schema": { - "type": "string", - "example": [ - "BTC-USDT", - "ETH-USDT", - "KCS-USDT" - ] - } - } - ], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "data": { - "type": "object", - "properties": { - "orderId": { - "type": "string", - "description": "order id" + "NYM": { + "type": "string" + }, + "FIL": { + "type": "string" + }, + "BAL": { + "type": "string" + }, + "SCA": { + "type": "string" + }, + "STND": { + "type": "string" + }, + "WMTX": { + "type": "string" + }, + "SCLP": { + "type": "string" + }, + "MANEKI": { + "type": "string" + }, + "BAT": { + "type": "string" + }, + "AKRO": { + "type": "string" + }, + "FTM3L": { + "type": "string" + }, + "BAX": { + "type": "string" + }, + "FTM3S": { + "type": "string" + }, + "COTI": { + "type": "string" } }, "required": [ - "orderId" + "AGLD", + "DFI", + "PYTHUP", + "ISLM", + "NEAR", + "AIOZ", + "AUDIO", + "BBL", + "WLD", + "HNT", + "ETHFI", + "DMAIL", + "OPUP", + "VET3S", + "MANA3S", + "TIDAL", + "HALO", + "OPUL", + "MANA3L", + "DGB", + "AA", + "BCH", + "GMEE", + "JST", + "PBUX", + "AR", + "SEI", + "PSTAKE", + "LMWR", + "UNFIDOWN", + "BB", + "JTO", + "WEMIX", + "G", + "MARSH", + "BN", + "FLIP", + "FLR", + "BIGTIME", + "FLY", + "T", + "W", + "BDX", + "BABYDOGE", + "SFP", + "DIA", + "ISME", + "LYM", + "VET3L", + "JUP", + "LYX", + "AIEPK", + "SILLY", + "SCPT", + "WOO", + "BLUR", + "STRK", + "BFC", + "DC", + "KARATE", + "SUSHI3L", + "NETVR", + "WAVES", + "LITH", + "HAPI", + "SUSHI3S", + "CEEK", + "FLOKI", + "SHR", + "SAND", + "TURT", + "UMA", + "BEPRO", + "SCRT", + "TUSD", + "COOKIE", + "LRDS", + "SIN", + "OAS", + "ROOT", + "ADA3L", + "TIAUP", + "HTR", + "UNB", + "UNA", + "HARD", + "G3", + "ADA3S", + "MYRO", + "HTX", + "FT", + "BTCDOWN", + "UNI", + "FX", + "OBI", + "UNO", + "WRX", + "TIADOWN", + "ETHDOWN", + "WELL", + "SWFTC", + "SKL", + "UOS", + "AIPAD", + "BRETT", + "SKY", + "FRM", + "VISION", + "LENDS", + "SLF", + "BULL", + "FLOW", + "ODDZ", + "SLN", + "UPO", + "SLP", + "ID", + "SLIM", + "SPOT", + "DOP", + "ISSP", + "UQC", + "IO", + "DOT", + "1INCH", + "SMH", + "MAK", + "TOKO", + "TURBO", + "UNFI", + "MAN", + "EVER", + "FTM", + "SHRAP", + "MAV", + "MAX", + "DPR", + "FTT", + "ARKM", + "ATOM", + "PENDLE", + "QUICK", + "BLZ", + "BOBA", + "MBL", + "OFN", + "UNIO", + "SNS", + "SNX", + "NXRA", + "TAIKO", + "AVAX3L", + "L3", + "API3", + "XRP3S", + "QKC", + "AVAX3S", + "ROSE", + "SATS", + "BMX", + "PORTAL", + "TOMI", + "XRP3L", + "SOL", + "SON", + "BNC", + "SOCIAL", + "CGPT", + "CELR", + "BNB", + "OGN", + "CELO", + "AUCTION", + "MANTA", + "LAYER", + "AERO", + "CETUS", + "LL", + "SPA", + "PYTHDOWN", + "NEIROCTO", + "UTK", + "GMRX", + "BOB", + "HOTCROSS", + "AERGO", + "MOCA", + "SQD", + "MV", + "BNB3L", + "BNB3S", + "GALAX3L", + "KAI", + "SQR", + "GALAX3S", + "EGLD", + "ZBCN", + "KAS", + "MEW", + "PUNDIX", + "LOOKS", + "FXS", + "BOSON", + "BRISE", + "AEVO", + "FLUX", + "PRCL", + "UNFIUP", + "SEIDOWN", + "DOAI", + "QNT", + "REDO", + "STRIKE", + "ETHW", + "OM", + "OP", + "WHALE", + "1CAT", + "NEON", + "GTAI", + "SSV", + "ETH2", + "KCS", + "ARPA", + "ARTFI", + "BRL", + "ALEX", + "STG", + "SHIB", + "IOTX", + "OLE", + "KDA", + "CERE", + "DOCK", + "STX", + "OLT", + "QI", + "SDAO", + "BLAST", + "LINK3S", + "IOST", + "SUI", + "CAKE", + "BSW", + "OMG", + "VOLT", + "LINK3L", + "GEEQ", + "PYUSD", + "SUN", + "TOWER", + "BTC", + "IOTA", + "REEF", + "TRIAS", + "KEY", + "ETH3L", + "BTT", + "ONE", + "RENDER", + "ETH3S", + "ANKR", + "ALGO", + "SYLO", + "ZCX", + "SD", + "ONT", + "MJT", + "DYM", + "DYP", + "BAKEUP", + "OOE", + "ZELIX", + "DOGE3L", + "ARTY", + "QORPO", + "ICE", + "NOTAI", + "DOGE3S", + "NAKA", + "GALAX", + "MKR", + "DODO", + "ICP", + "ZEC", + "ZEE", + "ICX", + "KMNO", + "TT", + "DOT3L", + "XAI", + "ZEN", + "DOGE", + "ALPHA", + "DUSK", + "DOT3S", + "SXP", + "HBAR", + "SYNT", + "ZEX", + "BONDLY", + "MLK", + "KICKS", + "PEPE", + "OUSD", + "LUNCDOWN", + "DOGS", + "REV3L", + "CTSI", + "C98", + "OSMO", + "NTRN", + "CFX2S", + "SYN", + "VIDT", + "SYS", + "GAS", + "BOME", + "COMBO", + "XCH", + "VR", + "CFX2L", + "VSYS", + "PANDORA", + "THETA", + "XCN", + "NEXG", + "MELOS", + "XCV", + "ORN", + "WLKN", + "AAVE", + "MNT", + "BONK", + "PERP", + "XDC", + "MNW", + "XDB", + "BOND", + "SUIA", + "MOG", + "SUTER", + "TIME", + "RACA", + "BICO", + "MON", + "SWEAT", + "MOXIE", + "BABYBNB", + "IGU", + "HMSTR", + "XEC", + "MONI", + "XR", + "PEOPLE", + "PUMLX", + "ZIL", + "WLDDOWN", + "VAI", + "XEN", + "MPC", + "XEM", + "JASMY3S", + "OTK", + "TRAC", + "DFYN", + "BIDP", + "JASMY3L", + "INJDOWN", + "KLV", + "WAXL", + "TRBDOWN", + "BCH3L", + "GMT3S", + "KMD", + "BCH3S", + "ECOX", + "AAVE3S", + "GMT3L", + "EPIK", + "SUIP", + "AAVE3L", + "ZK", + "ZKF", + "OMNIA", + "ZKJ", + "ZKL", + "GAFI", + "CARV", + "KNC", + "CATS", + "PROM", + "ALEPH", + "PONKE", + "OVR", + "CATI", + "ORDER", + "GFT", + "BIFI", + "GGC", + "GGG", + "DAPPX", + "SUKU", + "ULTI", + "CREDI", + "ERTHA", + "FURY", + "KARRAT", + "MOBILE", + "SIDUS", + "NAVI", + "TAO", + "USDJ", + "MTL", + "VET", + "FITFI", + "USDT", + "OXT", + "CANDY", + "USDP", + "MTS", + "TADA", + "MTV", + "NAVX", + "ILV", + "VINU", + "GHX", + "EDU", + "HYVE", + "BTC3L", + "ANYONE", + "BEAT", + "KING", + "CREAM", + "CAS", + "IMX", + "CAT", + "BTC3S", + "USDE", + "USDD", + "CWAR", + "USDC", + "KRL", + "INJ", + "GAME", + "TRIBL", + "XLM", + "TRBUP", + "VRADOWN", + "SUPER", + "EIGEN", + "IOI", + "KSM", + "CCD", + "EGO", + "EGP", + "MXC", + "TEL", + "MOVR", + "XMR", + "MXM", + "OORT", + "GLM", + "RAY", + "XTAG", + "GLQ", + "CWEB", + "REVU", + "REVV", + "ZRO", + "XNL", + "XNO", + "SAROS", + "KACE", + "ZRX", + "WLTH", + "ATOM3L", + "GMM", + "BEER", + "GMT", + "HEART", + "GMX", + "ABBC", + "OMNI", + "ATOM3S", + "IRL", + "CFG", + "WSDM", + "GNS", + "VANRY", + "CFX", + "GRAIL", + "BEFI", + "VELO", + "XPR", + "DOVI", + "ACE", + "ACH", + "ISP", + "XCAD", + "MINA", + "TIA", + "DRIFT", + "ACQ", + "ACS", + "MIND", + "STORE", + "REN", + "ELA", + "DREAMS", + "ADA", + "ELF", + "REQ", + "STORJ", + "LADYS", + "PAXG", + "REZ", + "XRD", + "CHO", + "CHR", + "ADS", + "CHZ", + "ADX", + "XRP", + "JASMY", + "KAGI", + "FIDA", + "PBR", + "AEG", + "H2O", + "CHMB", + "SAND3L", + "PBX", + "SOLVE", + "DECHAT", + "GARI", + "SHIB2L", + "SHIB2S", + "ENA", + "VEMP", + "ENJ", + "AFG", + "RATS", + "GRT", + "FORWARD", + "TFUEL", + "ENS", + "KASDOWN", + "XTM", + "DEGEN", + "TLM", + "DYDXDOWN", + "CKB", + "LUNC", + "AURORA", + "LUNA", + "XTZ", + "ELON", + "DMTR", + "EOS", + "GST", + "FORT", + "FLAME", + "PATEX", + "DEEP", + "ID3L", + "GTC", + "ID3S", + "RIO", + "CLH", + "BURGER", + "VRA", + "SUNDOG", + "GTT", + "INJUP", + "CPOOL", + "EPX", + "CLV", + "FEAR", + "MEME", + "ROOBEE", + "DEFI", + "TOKEN", + "GRAPE", + "KASUP", + "XWG", + "SKEY", + "SFUND", + "EQX", + "ORDIUP", + "TON", + "DEGO", + "IZI", + "ERG", + "ERN", + "VENOM", + "VOXEL", + "RLC", + "PHA", + "DYDXUP", + "APE3S", + "ORBS", + "OPDOWN", + "ESE", + "APE3L", + "HMND", + "COQ", + "AURY", + "CULT", + "AKT", + "GLMR", + "XYM", + "ORAI", + "XYO", + "ETC", + "LAI", + "PIP", + "ETH", + "NEO", + "RMV", + "KLAY", + "PIT", + "TARA", + "KALT", + "PIX", + "ETN", + "CSIX", + "TRADE", + "MAVIA", + "HIGH", + "TRB", + "ORDI", + "TRVL", + "AMB", + "TRU", + "LOGX", + "FINC", + "INFRA", + "NATIX", + "NFP", + "TRY", + "TRX", + "LBP", + "LBR", + "EUL", + "NFT", + "SEIUP", + "PUFFER", + "EUR", + "ORCA", + "NEAR3L", + "AMP", + "XDEFI", + "HIFI", + "TRUF", + "AITECH", + "AMU", + "USTC", + "KNGL", + "FOXY", + "NGC", + "TENET", + "NEAR3S", + "MAHA", + "NGL", + "TST", + "HIPPO", + "AXS3S", + "CRO", + "ZPAY", + "MNDE", + "CRV", + "SWASH", + "AXS3L", + "VERSE", + "RPK", + "RPL", + "AZERO", + "SOUL", + "VXV", + "LDO", + "MAGIC", + "ALICE", + "SEAM", + "PLU", + "AOG", + "SMOLE", + "EWT", + "TSUGT", + "PMG", + "OPAI", + "LOCUS", + "CTA", + "NIM", + "CTC", + "APE", + "MERL", + "JAM", + "CTI", + "APP", + "APT", + "WLDUP", + "ZEND", + "FIRE", + "DENT", + "PYTH", + "LFT", + "DPET", + "ORDIDOWN", + "KPOL", + "ETHUP", + "BAND", + "POL", + "ASTR", + "NKN", + "RSR", + "DVPN", + "TWT", + "ARB", + "CVC", + "ARC", + "XETA", + "MTRG", + "LOKA", + "LPOOL", + "TURBOS", + "CVX", + "ARX", + "MPLX", + "SUSHI", + "NLK", + "PEPE2", + "WBTC", + "SUI3L", + "CWS", + "SUI3S", + "INSP", + "MANA", + "VRTX", + "CSPR", + "ATA", + "OPEN", + "HAI", + "NMR", + "ATH", + "LIT", + "TLOS", + "TNSR", + "CXT", + "POLYX", + "ZERO", + "ROUTE", + "LOOM", + "PRE", + "VRAUP", + "HBB", + "RVN", + "PRQ", + "ONDO", + "PEPEDOWN", + "WOOP", + "LUNCUP", + "KAVA", + "LKI", + "AVA", + "NOM", + "MAPO", + "PEPEUP", + "STRAX", + "NOT", + "ZERC", + "BCUT", + "MASA", + "WAN", + "WAT", + "WAX", + "MASK", + "EOS3L", + "IDEA", + "EOS3S", + "YFI", + "MOODENG", + "XCUR", + "HYDRA", + "POPCAT", + "LQTY", + "PIXEL", + "LMR", + "ZETA", + "YGG", + "AXS", + "BCHSV", + "NRN", + "FTON", + "COMP", + "XPRT", + "HFT", + "UXLINK", + "STAMP", + "RUNE", + "ZEUS", + "LTC3L", + "DAPP", + "FORTH", + "ALPINE", + "SENSO", + "LTC3S", + "DEXE", + "GOAL", + "AVAX", + "LISTA", + "AMPL", + "WORK", + "BRWL", + "BANANA", + "PUSH", + "WEN", + "NEIRO", + "BTCUP", + "SOL3S", + "BRAWL", + "LAY3R", + "LPT", + "GODS", + "SAND3S", + "RDNT", + "SOL3L", + "NIBI", + "NUM", + "PYR", + "DAG", + "DAI", + "HIP", + "DAO", + "AVAIL", + "DAR", + "FET", + "FCON", + "XAVA", + "LRC", + "UNI3S", + "POKT", + "DASH", + "BAKEDOWN", + "POLC", + "CIRUS", + "UNI3L", + "NWC", + "POLK", + "LSD", + "MARS4", + "LSK", + "BLOCK", + "ANALOS", + "SAFE", + "DCK", + "LSS", + "DCR", + "LIKE", + "DATA", + "WIF", + "BLOK", + "LTC", + "METIS", + "WIN", + "HLG", + "LTO", + "DYDX", + "ARB3S", + "MUBI", + "ARB3L", + "RBTC1", + "POND", + "LINA", + "MYRIA", + "LINK", + "QTUM", + "TUNE", + "UFO", + "CYBER", + "WILD", + "POLS", + "NYM", + "FIL", + "BAL", + "SCA", + "STND", + "WMTX", + "SCLP", + "MANEKI", + "BAT", + "AKRO", + "FTM3L", + "BAX", + "FTM3S", + "COTI" ] } }, @@ -7110,24 +5604,26 @@ } } }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470174", + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470153", "x-abandon": "normal", "x-domain": "Spot", - "x-api-channel": "Private", - "x-api-permission": "Spot", - "x-api-rate-limit-pool": "Spot", + "x-api-channel": "Public", + "x-api-permission": "NULL", + "x-api-rate-limit-pool": "Public", "x-sdk-service": "Spot", - "x-sdk-sub-service": "Order", - "x-sdk-method-name": "cancelOrderByOrderId", - "x-sdk-method-description": "This endpoint can be used to cancel a spot order by orderId. This endpoint only sends cancellation requests. The results of the requests must be obtained by checking the order status or subscribing to websocket.", - "x-api-rate-limit": 1, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"orderId\\\": \\\"671124f9365ccb00073debd4\\\"\\n }\\n}", - "x-request-example": "{\\\"orderId\\\": \\\"671124f9365ccb00073debd4\\\", \\\"symbol\\\": \\\"BTC-USDT\\\"}" - }, + "x-sdk-sub-service": "Market", + "x-sdk-method-name": "getFiatPrice", + "x-sdk-method-description": "Request via this endpoint to get the fiat price of the currencies for the available trading pairs.", + "x-api-rate-limit": 3, + "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"AGLD\\\":\\\"1.1174410000000001\\\",\\\"DFI\\\":\\\"0.0168915500000000\\\",\\\"PYTHUP\\\":\\\"0.0397880960000000\\\",\\\"ISLM\\\":\\\"0.0606196750000000\\\",\\\"NEAR\\\":\\\"4.7185395500000000\\\",\\\"AIOZ\\\":\\\"0.4862867350000000\\\",\\\"AUDIO\\\":\\\"0.1219390000000000\\\",\\\"BBL\\\":\\\"0.0067766100000000\\\",\\\"WLD\\\":\\\"2.2893547500000000\\\",\\\"HNT\\\":\\\"5.8990489999999984\\\",\\\"ETHFI\\\":\\\"1.5892050000000000\\\",\\\"DMAIL\\\":\\\"0.2726636000000000\\\",\\\"OPUP\\\":\\\"0.0986506500000000\\\",\\\"VET3S\\\":\\\"0.0003700448850000\\\",\\\"MANA3S\\\":\\\"0.0006056970000000\\\",\\\"TIDAL\\\":\\\"0.0001154422500000\\\",\\\"HALO\\\":\\\"0.0058270850000000\\\",\\\"OPUL\\\":\\\"0.0839480050000000\\\",\\\"MANA3L\\\":\\\"0.0029569407900000\\\",\\\"DGB\\\":\\\"0.0066556705000000\\\",\\\"AA\\\":\\\"0.2406796000000000\\\",\\\"BCH\\\":\\\"366.2167999999996484\\\",\\\"GMEE\\\":\\\"0.0113333305000000\\\",\\\"JST\\\":\\\"0.0302348750000000\\\",\\\"PBUX\\\":\\\"0.0208795550000000\\\",\\\"AR\\\":\\\"18.5457224999999909\\\",\\\"SEI\\\":\\\"0.4332832500000000\\\",\\\"PSTAKE\\\":\\\"0.0493153300000000\\\",\\\"LMWR\\\":\\\"0.1618190500000000\\\",\\\"UNFIDOWN\\\":\\\"0.0062058955000000\\\",\\\"BB\\\":\\\"0.3245376500000000\\\",\\\"JTO\\\":\\\"2.1239375000000002\\\",\\\"WEMIX\\\":\\\"0.7916040000000000\\\",\\\"G\\\":\\\"0.0324037900000000\\\",\\\"MARSH\\\":\\\"0.0617591050000000\\\",\\\"BN\\\":\\\"0.0036961510000000\\\",\\\"FLIP\\\":\\\"1.0976509000000000\\\",\\\"FLR\\\":\\\"0.0144827550000000\\\",\\\"BIGTIME\\\":\\\"0.1238780300000000\\\",\\\"FLY\\\":\\\"0.0005157420000000\\\",\\\"T\\\":\\\"0.0233483200000000\\\",\\\"W\\\":\\\"0.2865566500000000\\\",\\\"BDX\\\":\\\"0.0774012800000000\\\",\\\"BABYDOGE\\\":\\\"0.0000000029375305\\\",\\\"SFP\\\":\\\"0.7256370000000000\\\",\\\"DIA\\\":\\\"0.9179408000000000\\\",\\\"ISME\\\":\\\"0.0022388800000000\\\",\\\"LYM\\\":\\\"0.0010155919500000\\\",\\\"VET3L\\\":\\\"0.0000289755050000\\\",\\\"JUP\\\":\\\"0.8230882500000000\\\",\\\"LYX\\\":\\\"1.4501745500000001\\\",\\\"AIEPK\\\":\\\"0.0050094940000000\\\",\\\"SILLY\\\":\\\"0.0159420250000000\\\",\\\"SCPT\\\":\\\"0.0122038950000000\\\",\\\"WOO\\\":\\\"0.1796601250000000\\\",\\\"BLUR\\\":\\\"0.2462768000000000\\\",\\\"STRK\\\":\\\"0.3963117450000000\\\",\\\"BFC\\\":\\\"0.0383608100000000\\\",\\\"DC\\\":\\\"0.0003097450500000\\\",\\\"KARATE\\\":\\\"0.0007296350000000\\\",\\\"SUSHI3L\\\":\\\"0.5115441000000000\\\",\\\"NETVR\\\":\\\"0.0976111700000000\\\",\\\"WAVES\\\":\\\"1.0806594000000000\\\",\\\"LITH\\\":\\\"0.0001520239500000\\\",\\\"HAPI\\\":\\\"8.6533711499999987\\\",\\\"SUSHI3S\\\":\\\"1.2752620500000000\\\",\\\"CEEK\\\":\\\"0.0294852500000000\\\",\\\"FLOKI\\\":\\\"0.0001414292500000\\\",\\\"SHR\\\":\\\"0.0012463765000000\\\",\\\"SAND\\\":\\\"0.2566616050000000\\\",\\\"TURT\\\":\\\"0.0020889550000000\\\",\\\"UMA\\\":\\\"2.5207390000000000\\\",\\\"BEPRO\\\":\\\"0.0003955021500000\\\",\\\"SCRT\\\":\\\"0.1995002000000000\\\",\\\"TUSD\\\":\\\"0.9945025000000000\\\",\\\"COOKIE\\\":\\\"0.0220089900000000\\\",\\\"LRDS\\\":\\\"0.6218889000000000\\\",\\\"SIN\\\":\\\"0.0033633175000000\\\",\\\"OAS\\\":\\\"0.0331933950000000\\\",\\\"ROOT\\\":\\\"0.0183108400000000\\\",\\\"ADA3L\\\":\\\"0.0046396790000000\\\",\\\"TIAUP\\\":\\\"0.1228385500000000\\\",\\\"HTR\\\":\\\"0.0353023400000000\\\",\\\"UNB\\\":\\\"0.0003837080500000\\\",\\\"UNA\\\":\\\"0.0164917500000000\\\",\\\"HARD\\\":\\\"0.1087056200000000\\\",\\\"G3\\\":\\\"0.0502648550000000\\\",\\\"ADA3S\\\":\\\"0.0006191202850000\\\",\\\"MYRO\\\":\\\"0.1071863800000000\\\",\\\"HTX\\\":\\\"0.0000013693150000\\\",\\\"FT\\\":\\\"0.3585206500000000\\\",\\\"BTCDOWN\\\":\\\"0.1065467000000000\\\",\\\"UNI\\\":\\\"7.3571195999999993\\\",\\\"FX\\\":\\\"0.1379310000000000\\\",\\\"OBI\\\":\\\"0.0079030465000000\\\",\\\"UNO\\\":\\\"0.0137131400000000\\\",\\\"WRX\\\":\\\"0.1221389000000000\\\",\\\"TIADOWN\\\":\\\"0.0000914642450000\\\",\\\"ETHDOWN\\\":\\\"0.1306346500000000\\\",\\\"WELL\\\":\\\"0.0471244260000000\\\",\\\"SWFTC\\\":\\\"0.0028966509500000\\\",\\\"SKL\\\":\\\"0.0362418700000000\\\",\\\"UOS\\\":\\\"0.0867765900000000\\\",\\\"AIPAD\\\":\\\"0.0478660550000000\\\",\\\"BRETT\\\":\\\"0.1037481000000000\\\",\\\"SKY\\\":\\\"0.0520139800000000\\\",\\\"FRM\\\":\\\"0.0153123400000000\\\",\\\"VISION\\\":\\\"0.0014451770500000\\\",\\\"LENDS\\\":\\\"0.0047276350000000\\\",\\\"SLF\\\":\\\"0.3318340000000000\\\",\\\"BULL\\\":\\\"0.0023988000000000\\\",\\\"FLOW\\\":\\\"0.5372312500000000\\\",\\\"ODDZ\\\":\\\"0.0063368300000000\\\",\\\"SLN\\\":\\\"0.2804597000000000\\\",\\\"UPO\\\":\\\"0.0440779500000000\\\",\\\"SLP\\\":\\\"0.0023997995000000\\\",\\\"ID\\\":\\\"0.3718140000000000\\\",\\\"SLIM\\\":\\\"0.0906446550000000\\\",\\\"SPOT\\\":\\\"0.0021289350000000\\\",\\\"DOP\\\":\\\"0.0023028480000000\\\",\\\"ISSP\\\":\\\"0.0000874562500000\\\",\\\"UQC\\\":\\\"3.2339822000000003\\\",\\\"IO\\\":\\\"1.8185902499999999\\\",\\\"DOT\\\":\\\"4.2022978000000005\\\",\\\"1INCH\\\":\\\"0.2645676500000000\\\",\\\"SMH\\\":\\\"0.3448275000000000\\\",\\\"MAK\\\":\\\"0.0396701550000000\\\",\\\"TOKO\\\":\\\"0.0005923037000000\\\",\\\"TURBO\\\":\\\"0.0108085930000000\\\",\\\"UNFI\\\":\\\"2.8555714999999996\\\",\\\"MAN\\\":\\\"0.0210764565000000\\\",\\\"EVER\\\":\\\"0.0332733550000000\\\",\\\"FTM\\\":\\\"0.7259068650000000\\\",\\\"SHRAP\\\":\\\"0.0476361700000000\\\",\\\"MAV\\\":\\\"0.1738130500000000\\\",\\\"MAX\\\":\\\"0.2864966800000000\\\",\\\"DPR\\\":\\\"0.0018240875000000\\\",\\\"FTT\\\":\\\"2.0559715000000002\\\",\\\"ARKM\\\":\\\"1.7444273499999999\\\",\\\"ATOM\\\":\\\"4.2954512000000002\\\",\\\"PENDLE\\\":\\\"4.1554212500000007\\\",\\\"QUICK\\\":\\\"0.0365317250000000\\\",\\\"BLZ\\\":\\\"0.1217191100000000\\\",\\\"BOBA\\\":\\\"0.2014092450000000\\\",\\\"MBL\\\":\\\"0.0027856065000000\\\",\\\"OFN\\\":\\\"0.1252373500000000\\\",\\\"UNIO\\\":\\\"0.0025487250000000\\\",\\\"SNS\\\":\\\"0.0200899500000000\\\",\\\"SNX\\\":\\\"1.4282854999999999\\\",\\\"NXRA\\\":\\\"0.0272763550000000\\\",\\\"TAIKO\\\":\\\"1.4392800000000001\\\",\\\"AVAX3L\\\":\\\"0.1410875109550000\\\",\\\"L3\\\":\\\"0.0608395650000000\\\",\\\"API3\\\":\\\"1.3728132500000001\\\",\\\"XRP3S\\\":\\\"0.0028095945000000\\\",\\\"QKC\\\":\\\"0.0085157400000000\\\",\\\"AVAX3S\\\":\\\"0.5148424500000000\\\",\\\"ROSE\\\":\\\"0.0693453100000000\\\",\\\"SATS\\\":\\\"0.0000002701648500\\\",\\\"BMX\\\":\\\"0.3100449000000000\\\",\\\"PORTAL\\\":\\\"0.2811593500000000\\\",\\\"TOMI\\\":\\\"0.0309045400000000\\\",\\\"XRP3L\\\":\\\"2.1586201500000002\\\",\\\"SOL\\\":\\\"151.7250995000003583\\\",\\\"SON\\\":\\\"0.0002421788500000\\\",\\\"BNC\\\":\\\"0.1882058500000000\\\",\\\"SOCIAL\\\":\\\"0.0026486750000000\\\",\\\"CGPT\\\":\\\"0.1305147100000000\\\",\\\"CELR\\\":\\\"0.0127736100000000\\\",\\\"BNB\\\":\\\"591.0973035000118935\\\",\\\"OGN\\\":\\\"0.0852573500000000\\\",\\\"CELO\\\":\\\"0.7711142500000000\\\",\\\"AUCTION\\\":\\\"13.1634150000000014\\\",\\\"MANTA\\\":\\\"0.7564216000000000\\\",\\\"LAYER\\\":\\\"0.0372713550000000\\\",\\\"AERO\\\":\\\"1.3783104999999999\\\",\\\"CETUS\\\":\\\"0.1808295400000000\\\",\\\"LL\\\":\\\"0.0201199350000000\\\",\\\"SPA\\\":\\\"0.0067426270000000\\\",\\\"PYTHDOWN\\\":\\\"0.0011834080000000\\\",\\\"NEIROCTO\\\":\\\"0.0019964013000000\\\",\\\"UTK\\\":\\\"0.0365217300000000\\\",\\\"GMRX\\\":\\\"0.0007386305000000\\\",\\\"BOB\\\":\\\"0.0000380619595000\\\",\\\"HOTCROSS\\\":\\\"0.0056491740000000\\\",\\\"AERGO\\\":\\\"0.1007595950000000\\\",\\\"MOCA\\\":\\\"0.0783608000000000\\\",\\\"SQD\\\":\\\"0.0380809500000000\\\",\\\"MV\\\":\\\"0.0081359300000000\\\",\\\"BNB3L\\\":\\\"0.2761618500000000\\\",\\\"BNB3S\\\":\\\"0.0008545725000000\\\",\\\"GALAX3L\\\":\\\"0.0057571999600000\\\",\\\"KAI\\\":\\\"0.0020080954500000\\\",\\\"SQR\\\":\\\"0.0470764500000000\\\",\\\"GALAX3S\\\":\\\"0.1933033000000000\\\",\\\"EGLD\\\":\\\"25.5272299999999713\\\",\\\"ZBCN\\\":\\\"0.0010404795000000\\\",\\\"KAS\\\":\\\"0.1216691350000000\\\",\\\"MEW\\\":\\\"0.0086176890000000\\\",\\\"PUNDIX\\\":\\\"0.4130933500000000\\\",\\\"LOOKS\\\":\\\"0.0392803500000000\\\",\\\"FXS\\\":\\\"1.9060465000000000\\\",\\\"BOSON\\\":\\\"0.2732633000000000\\\",\\\"BRISE\\\":\\\"0.0000000860569500\\\",\\\"AEVO\\\":\\\"0.3388305000000000\\\",\\\"FLUX\\\":\\\"0.5276360500000000\\\",\\\"PRCL\\\":\\\"0.1969015000000000\\\",\\\"UNFIUP\\\":\\\"0.0011654170000000\\\",\\\"SEIDOWN\\\":\\\"0.0442778500000000\\\",\\\"DOAI\\\":\\\"0.0052363805000000\\\",\\\"QNT\\\":\\\"65.4312679999998206\\\",\\\"REDO\\\":\\\"0.2837580500000000\\\",\\\"STRIKE\\\":\\\"6.8225869999999997\\\",\\\"ETHW\\\":\\\"3.2418782499999998\\\",\\\"OM\\\":\\\"1.5396797750000000\\\",\\\"OP\\\":\\\"1.6911539999999999\\\",\\\"WHALE\\\":\\\"0.8134930500000000\\\",\\\"1CAT\\\":\\\"0.0018460765000000\\\",\\\"NEON\\\":\\\"0.4446775500000000\\\",\\\"GTAI\\\":\\\"0.7786105000000000\\\",\\\"SSV\\\":\\\"21.2393749999999841\\\",\\\"ETH2\\\":\\\"2601.6678843156403923\\\",\\\"KCS\\\":\\\"8.7646155000000020\\\",\\\"ARPA\\\":\\\"0.0393882960000000\\\",\\\"ARTFI\\\":\\\"0.0141029450000000\\\",\\\"BRL\\\":\\\"0.1742807323452485\\\",\\\"ALEX\\\":\\\"0.0924537500000000\\\",\\\"STG\\\":\\\"0.2943527500000000\\\",\\\"SHIB\\\":\\\"0.0000178060925000\\\",\\\"IOTX\\\":\\\"0.0394202800000000\\\",\\\"OLE\\\":\\\"0.0171414250000000\\\",\\\"KDA\\\":\\\"0.5653172000000000\\\",\\\"CERE\\\":\\\"0.0022548720000000\\\",\\\"DOCK\\\":\\\"0.0018990500000000\\\",\\\"STX\\\":\\\"1.8157916500000000\\\",\\\"OLT\\\":\\\"0.0007596200000000\\\",\\\"QI\\\":\\\"0.0131754090000000\\\",\\\"SDAO\\\":\\\"0.2748625000000000\\\",\\\"BLAST\\\":\\\"0.0087636160000000\\\",\\\"LINK3S\\\":\\\"0.0000702948350000\\\",\\\"IOST\\\":\\\"0.0049745115000000\\\",\\\"SUI\\\":\\\"2.0589700000000000\\\",\\\"CAKE\\\":\\\"1.7941024999999999\\\",\\\"BSW\\\":\\\"0.0586706500000000\\\",\\\"OMG\\\":\\\"0.2597700500000000\\\",\\\"VOLT\\\":\\\"0.0000002716641000\\\",\\\"LINK3L\\\":\\\"1.3408292499999999\\\",\\\"GEEQ\\\":\\\"0.0385607100000000\\\",\\\"PYUSD\\\":\\\"0.9988003500000000\\\",\\\"SUN\\\":\\\"0.0186106900000000\\\",\\\"TOWER\\\":\\\"0.0014812590000000\\\",\\\"BTC\\\":\\\"67133.4165000832051564\\\",\\\"IOTA\\\":\\\"0.1189405000000000\\\",\\\"REEF\\\":\\\"0.0019960015000000\\\",\\\"TRIAS\\\":\\\"3.3683149999999998\\\",\\\"KEY\\\":\\\"0.0037594713240047\\\",\\\"ETH3L\\\":\\\"0.0003305946200000\\\",\\\"BTT\\\":\\\"0.0000009117439000\\\",\\\"ONE\\\":\\\"0.0132003965000000\\\",\\\"RENDER\\\":\\\"5.2263854999999995\\\",\\\"ETH3S\\\":\\\"0.5517240000000000\\\",\\\"ANKR\\\":\\\"0.0264867500000000\\\",\\\"ALGO\\\":\\\"0.1188405500000000\\\",\\\"SYLO\\\":\\\"0.0007600198000000\\\",\\\"ZCX\\\":\\\"0.0784707450000000\\\",\\\"SD\\\":\\\"0.3851073500000000\\\",\\\"ONT\\\":\\\"0.1877960550000000\\\",\\\"MJT\\\":\\\"0.0132433750000000\\\",\\\"DYM\\\":\\\"1.6659666000000001\\\",\\\"DYP\\\":\\\"0.0205397250000000\\\",\\\"BAKEUP\\\":\\\"0.0389894955000000\\\",\\\"OOE\\\":\\\"0.0079360300000000\\\",\\\"ZELIX\\\":\\\"0.0000649675000000\\\",\\\"DOGE3L\\\":\\\"0.3837080500000000\\\",\\\"ARTY\\\":\\\"0.3980009000000000\\\",\\\"QORPO\\\":\\\"0.1204297550000000\\\",\\\"ICE\\\":\\\"0.0051504235000000\\\",\\\"NOTAI\\\":\\\"0.0000892753400000\\\",\\\"DOGE3S\\\":\\\"0.2291853500000000\\\",\\\"NAKA\\\":\\\"1.0695649500000000\\\",\\\"GALAX\\\":\\\"0.0212893500000000\\\",\\\"MKR\\\":\\\"1245.8767500000163833\\\",\\\"DODO\\\":\\\"0.1152423500000000\\\",\\\"ICP\\\":\\\"7.6731615000000027\\\",\\\"ZEC\\\":\\\"35.9400209999999543\\\",\\\"ZEE\\\":\\\"0.0065767100000000\\\",\\\"ICX\\\":\\\"0.1383308000000000\\\",\\\"KMNO\\\":\\\"0.0921499020000000\\\",\\\"TT\\\":\\\"0.0033883050000000\\\",\\\"DOT3L\\\":\\\"0.1454272500000000\\\",\\\"XAI\\\":\\\"0.2038980000000000\\\",\\\"ZEN\\\":\\\"8.0149905000000007\\\",\\\"DOGE\\\":\\\"0.1213093150000000\\\",\\\"ALPHA\\\":\\\"0.0567416150000000\\\",\\\"DUSK\\\":\\\"0.1964517250000000\\\",\\\"DOT3S\\\":\\\"0.0053613180000000\\\",\\\"SXP\\\":\\\"0.2538730000000000\\\",\\\"HBAR\\\":\\\"0.0510044850000000\\\",\\\"SYNT\\\":\\\"0.0467166300000000\\\",\\\"ZEX\\\":\\\"0.0571714000000000\\\",\\\"BONDLY\\\":\\\"0.0022208890000000\\\",\\\"MLK\\\":\\\"0.2080859050000000\\\",\\\"KICKS\\\":\\\"0.0001301249050000\\\",\\\"PEPE\\\":\\\"0.0000100249850000\\\",\\\"OUSD\\\":\\\"0.9982006500000000\\\",\\\"LUNCDOWN\\\":\\\"0.0000733333150000\\\",\\\"DOGS\\\":\\\"0.0007086455000000\\\",\\\"REV3L\\\":\\\"0.0094672640000000\\\",\\\"CTSI\\\":\\\"0.1257371000000000\\\",\\\"C98\\\":\\\"0.1219390000000000\\\",\\\"OSMO\\\":\\\"0.5370313500000000\\\",\\\"NTRN\\\":\\\"0.3869064500000000\\\",\\\"CFX2S\\\":\\\"0.0084757600000000\\\",\\\"SYN\\\":\\\"0.5636180500000000\\\",\\\"VIDT\\\":\\\"0.0308745550000000\\\",\\\"SYS\\\":\\\"0.0997501000000000\\\",\\\"GAS\\\":\\\"4.3029474500000008\\\",\\\"BOME\\\":\\\"0.0087336310000000\\\",\\\"COMBO\\\":\\\"0.4068964500000000\\\",\\\"XCH\\\":\\\"14.9825050000000010\\\",\\\"VR\\\":\\\"0.0063538215000000\\\",\\\"CFX2L\\\":\\\"0.0499660045000000\\\",\\\"VSYS\\\":\\\"0.0005201398000000\\\",\\\"PANDORA\\\":\\\"1629.2949450001102772\\\",\\\"THETA\\\":\\\"1.2461766000000000\\\",\\\"XCN\\\":\\\"0.0012699647000000\\\",\\\"NEXG\\\":\\\"0.0039180400000000\\\",\\\"MELOS\\\":\\\"0.0021244372500000\\\",\\\"XCV\\\":\\\"0.0013253370000000\\\",\\\"ORN\\\":\\\"0.8797599000000000\\\",\\\"WLKN\\\":\\\"0.0010624685000000\\\",\\\"AAVE\\\":\\\"154.2708259999996162\\\",\\\"MNT\\\":\\\"0.6168914000000000\\\",\\\"BONK\\\":\\\"0.0000227296295000\\\",\\\"PERP\\\":\\\"0.6037979500000000\\\",\\\"XDC\\\":\\\"0.0276361750000000\\\",\\\"MNW\\\":\\\"0.3681158500000000\\\",\\\"XDB\\\":\\\"0.0002578710000000\\\",\\\"BOND\\\":\\\"1.5662165000000000\\\",\\\"SUIA\\\":\\\"0.0809595000000000\\\",\\\"MOG\\\":\\\"0.0000019330330000\\\",\\\"SUTER\\\":\\\"0.0001840079500000\\\",\\\"TIME\\\":\\\"16.2648634999999969\\\",\\\"RACA\\\":\\\"0.0001949025000000\\\",\\\"BICO\\\":\\\"0.2021988500000000\\\",\\\"MON\\\":\\\"0.1066466500000000\\\",\\\"SWEAT\\\":\\\"0.0063718125000000\\\",\\\"MOXIE\\\":\\\"0.0022088950000000\\\",\\\"BABYBNB\\\":\\\"0.0289755050000000\\\",\\\"IGU\\\":\\\"0.0050674650000000\\\",\\\"HMSTR\\\":\\\"0.0037990995000000\\\",\\\"XEC\\\":\\\"0.0000354722550000\\\",\\\"MONI\\\":\\\"0.0058470750000000\\\",\\\"XR\\\":\\\"0.2374812000000000\\\",\\\"PEOPLE\\\":\\\"0.0796601500000000\\\",\\\"PUMLX\\\":\\\"0.0054572700000000\\\",\\\"ZIL\\\":\\\"0.0145927000000000\\\",\\\"WLDDOWN\\\":\\\"0.2089954500000000\\\",\\\"VAI\\\":\\\"0.0799999800000000\\\",\\\"XEN\\\":\\\"0.0000000839580000\\\",\\\"MPC\\\":\\\"0.1001499000000000\\\",\\\"XEM\\\":\\\"0.0176951480000000\\\",\\\"JASMY3S\\\":\\\"0.0019670160000000\\\",\\\"OTK\\\":\\\"0.0290464695000000\\\",\\\"TRAC\\\":\\\"0.4521738000000000\\\",\\\"DFYN\\\":\\\"0.0070664650000000\\\",\\\"BIDP\\\":\\\"0.0001939030000000\\\",\\\"JASMY3L\\\":\\\"0.0001653772700000\\\",\\\"INJDOWN\\\":\\\"0.0000194902500000\\\",\\\"KLV\\\":\\\"0.0019310340000000\\\",\\\"WAXL\\\":\\\"0.7858069000000000\\\",\\\"TRBDOWN\\\":\\\"0.0023138425000000\\\",\\\"BCH3L\\\":\\\"4.6390663064999996\\\",\\\"GMT3S\\\":\\\"0.0000457771000000\\\",\\\"KMD\\\":\\\"0.2493752500000000\\\",\\\"BCH3S\\\":\\\"0.9634180500000000\\\",\\\"ECOX\\\":\\\"0.0987506000000000\\\",\\\"AAVE3S\\\":\\\"0.0560719500000000\\\",\\\"GMT3L\\\":\\\"0.0053983694650000\\\",\\\"EPIK\\\":\\\"0.0045857060000000\\\",\\\"SUIP\\\":\\\"0.1067565950000000\\\",\\\"AAVE3L\\\":\\\"0.3638687346200000\\\",\\\"ZK\\\":\\\"0.1262368500000000\\\",\\\"ZKF\\\":\\\"0.0008595700000000\\\",\\\"OMNIA\\\":\\\"0.7624186000000000\\\",\\\"ZKJ\\\":\\\"1.1124435000000000\\\",\\\"ZKL\\\":\\\"0.1255372000000000\\\",\\\"GAFI\\\":\\\"3.0634675000000001\\\",\\\"CARV\\\":\\\"0.8703646000000000\\\",\\\"KNC\\\":\\\"0.4433782000000000\\\",\\\"CATS\\\":\\\"0.0000599700000000\\\",\\\"PROM\\\":\\\"5.2833570000000006\\\",\\\"ALEPH\\\":\\\"0.1756121500000000\\\",\\\"PONKE\\\":\\\"0.3958020000000000\\\",\\\"OVR\\\":\\\"0.1553223000000000\\\",\\\"CATI\\\":\\\"0.4105146400000000\\\",\\\"ORDER\\\":\\\"0.1183008200000000\\\",\\\"GFT\\\":\\\"0.0166616650000000\\\",\\\"BIFI\\\":\\\"0.0020489750000000\\\",\\\"GGC\\\":\\\"6.9965029985000000\\\",\\\"GGG\\\":\\\"0.0403798000000000\\\",\\\"DAPPX\\\":\\\"0.0043788095000000\\\",\\\"SUKU\\\":\\\"0.0618790450000000\\\",\\\"ULTI\\\":\\\"0.0168015950000000\\\",\\\"CREDI\\\":\\\"0.0192903500000000\\\",\\\"ERTHA\\\":\\\"0.0010014990000000\\\",\\\"FURY\\\":\\\"0.1405297000000000\\\",\\\"KARRAT\\\":\\\"0.5577210000000000\\\",\\\"MOBILE\\\":\\\"0.0009005495000000\\\",\\\"SIDUS\\\":\\\"0.0037671155000000\\\",\\\"NAVI\\\":\\\"0.1254672350000000\\\",\\\"TAO\\\":\\\"583.4081500000051807\\\",\\\"USDJ\\\":\\\"1.1386304000000001\\\",\\\"MTL\\\":\\\"0.9563216000000000\\\",\\\"VET\\\":\\\"0.0225387250000000\\\",\\\"FITFI\\\":\\\"0.0036421780000000\\\",\\\"USDT\\\":\\\"0.9995000000000000\\\",\\\"OXT\\\":\\\"0.0695652000000000\\\",\\\"CANDY\\\":\\\"0.0005597200000000\\\",\\\"USDP\\\":\\\"0.9932031500000000\\\",\\\"MTS\\\":\\\"0.0027516235000000\\\",\\\"TADA\\\":\\\"0.0283858000000000\\\",\\\"MTV\\\":\\\"0.0006559718500000\\\",\\\"NAVX\\\":\\\"0.1342228550000000\\\",\\\"ILV\\\":\\\"35.6771524999999671\\\",\\\"VINU\\\":\\\"0.0000000109045450\\\",\\\"GHX\\\":\\\"0.0903548000000000\\\",\\\"EDU\\\":\\\"0.5167415000000000\\\",\\\"HYVE\\\":\\\"0.0137331300000000\\\",\\\"BTC3L\\\":\\\"0.0058620675000000\\\",\\\"ANYONE\\\":\\\"0.9015490000000000\\\",\\\"BEAT\\\":\\\"0.0012593700000000\\\",\\\"KING\\\":\\\"0.0004821588000000\\\",\\\"CREAM\\\":\\\"15.6541689999999973\\\",\\\"CAS\\\":\\\"0.0038590695000000\\\",\\\"IMX\\\":\\\"1.4944524000000000\\\",\\\"CAT\\\":\\\"0.0000256981445000\\\",\\\"BTC3S\\\":\\\"0.0014142925000000\\\",\\\"USDE\\\":\\\"0.9985005000000000\\\",\\\"USDD\\\":\\\"1.0000997000000000\\\",\\\"CWAR\\\":\\\"0.0037981000000000\\\",\\\"USDC\\\":\\\"0.9997998500000000\\\",\\\"KRL\\\":\\\"0.3543127550000000\\\",\\\"INJ\\\":\\\"21.7691100000000194\\\",\\\"GAME\\\":\\\"0.0139630150000000\\\",\\\"TRIBL\\\":\\\"1.0994500000000000\\\",\\\"XLM\\\":\\\"0.0948525500000000\\\",\\\"TRBUP\\\":\\\"0.0012293850000000\\\",\\\"VRADOWN\\\":\\\"0.0013433280000000\\\",\\\"SUPER\\\":\\\"1.2853570000000000\\\",\\\"EIGEN\\\":\\\"3.1536223999999999\\\",\\\"IOI\\\":\\\"0.0146926500000000\\\",\\\"KSM\\\":\\\"17.5212350000000129\\\",\\\"CCD\\\":\\\"0.0034832575000000\\\",\\\"EGO\\\":\\\"0.0093553200000000\\\",\\\"EGP\\\":\\\"2.7946019999999998\\\",\\\"MXC\\\":\\\"0.0066866550000000\\\",\\\"TEL\\\":\\\"0.0014432780000000\\\",\\\"MOVR\\\":\\\"9.1340307000000027\\\",\\\"XMR\\\":\\\"155.5421899999990755\\\",\\\"MXM\\\":\\\"0.0092853550000000\\\",\\\"OORT\\\":\\\"0.1099949750000000\\\",\\\"GLM\\\":\\\"0.3231383500000000\\\",\\\"RAY\\\":\\\"2.0228880499999998\\\",\\\"XTAG\\\":\\\"0.0218190850000000\\\",\\\"GLQ\\\":\\\"0.0854572500000000\\\",\\\"CWEB\\\":\\\"0.0038480750000000\\\",\\\"REVU\\\":\\\"0.0105047450000000\\\",\\\"REVV\\\":\\\"0.0039760110000000\\\",\\\"ZRO\\\":\\\"3.7952014499999994\\\",\\\"XNL\\\":\\\"0.0093853050000000\\\",\\\"XNO\\\":\\\"0.8496749500000000\\\",\\\"SAROS\\\":\\\"0.0019290350000000\\\",\\\"KACE\\\":\\\"2.1165411999999998\\\",\\\"ZRX\\\":\\\"0.3186406000000000\\\",\\\"WLTH\\\":\\\"0.0374312750000000\\\",\\\"ATOM3L\\\":\\\"0.0321719060000000\\\",\\\"GMM\\\":\\\"0.0001497251000000\\\",\\\"BEER\\\":\\\"0.0000138670630000\\\",\\\"GMT\\\":\\\"0.1275362000000000\\\",\\\"HEART\\\":\\\"0.0159920000000000\\\",\\\"GMX\\\":\\\"22.7186349999999882\\\",\\\"ABBC\\\":\\\"0.0061769100000000\\\",\\\"OMNI\\\":\\\"8.9235359999999970\\\",\\\"ATOM3S\\\":\\\"0.0007945225400000\\\",\\\"IRL\\\":\\\"0.0099650150000000\\\",\\\"CFG\\\":\\\"0.3248375000000000\\\",\\\"WSDM\\\":\\\"0.0139830050000000\\\",\\\"GNS\\\":\\\"1.8390800000000001\\\",\\\"VANRY\\\":\\\"0.0809295150000000\\\",\\\"CFX\\\":\\\"0.1595202000000000\\\",\\\"GRAIL\\\":\\\"817.1212349999937891\\\",\\\"BEFI\\\":\\\"0.0175712100000000\\\",\\\"VELO\\\":\\\"0.0132043945000000\\\",\\\"XPR\\\":\\\"0.0008077959000000\\\",\\\"DOVI\\\":\\\"0.0584707500000000\\\",\\\"ACE\\\":\\\"0.0021349320000000\\\",\\\"ACH\\\":\\\"0.0190534685000000\\\",\\\"ISP\\\":\\\"0.0012161916000000\\\",\\\"XCAD\\\":\\\"0.2834582000000000\\\",\\\"MINA\\\":\\\"0.5630183500000000\\\",\\\"TIA\\\":\\\"5.9318325999999999\\\",\\\"DRIFT\\\":\\\"0.4350823500000000\\\",\\\"ACQ\\\":\\\"0.0056981495000000\\\",\\\"ACS\\\":\\\"0.0014917537500000\\\",\\\"MIND\\\":\\\"0.0018920535000000\\\",\\\"STORE\\\":\\\"0.0062358805000000\\\",\\\"REN\\\":\\\"0.0351224300000000\\\",\\\"ELA\\\":\\\"1.7282354500000000\\\",\\\"DREAMS\\\":\\\"0.0002498750000000\\\",\\\"ADA\\\":\\\"0.3463267500000000\\\",\\\"ELF\\\":\\\"0.3777110500000000\\\",\\\"REQ\\\":\\\"0.0959919800000000\\\",\\\"STORJ\\\":\\\"0.5662167500000000\\\",\\\"LADYS\\\":\\\"0.0000000837581000\\\",\\\"PAXG\\\":\\\"2697.9303600003123340\\\",\\\"REZ\\\":\\\"0.0409795000000000\\\",\\\"XRD\\\":\\\"0.0157821050000000\\\",\\\"CHO\\\":\\\"0.0205097400000000\\\",\\\"CHR\\\":\\\"0.1769115000000000\\\",\\\"ADS\\\":\\\"0.1889055000000000\\\",\\\"CHZ\\\":\\\"0.0738030800000000\\\",\\\"ADX\\\":\\\"0.1575212000000000\\\",\\\"XRP\\\":\\\"0.5525036100000000\\\",\\\"JASMY\\\":\\\"0.0188615645000000\\\",\\\"KAGI\\\":\\\"0.1834582250000000\\\",\\\"FIDA\\\":\\\"0.2282858000000000\\\",\\\"PBR\\\":\\\"0.0291953950000000\\\",\\\"AEG\\\":\\\"0.0093453250000000\\\",\\\"H2O\\\":\\\"0.1610194500000000\\\",\\\"CHMB\\\":\\\"0.0001715641750000\\\",\\\"SAND3L\\\":\\\"0.0015447972150000\\\",\\\"PBX\\\":\\\"0.0006879558500000\\\",\\\"SOLVE\\\":\\\"0.0084557700000000\\\",\\\"DECHAT\\\":\\\"0.1512243500000000\\\",\\\"GARI\\\":\\\"0.0076861550000000\\\",\\\"SHIB2L\\\":\\\"1.1996998499999999\\\",\\\"SHIB2S\\\":\\\"0.0240879500000000\\\",\\\"ENA\\\":\\\"0.3942028000000000\\\",\\\"VEMP\\\":\\\"0.0029335325000000\\\",\\\"ENJ\\\":\\\"0.1467266000000000\\\",\\\"AFG\\\":\\\"0.0072163900000000\\\",\\\"RATS\\\":\\\"0.0001211593900000\\\",\\\"GRT\\\":\\\"0.1646076550000000\\\",\\\"FORWARD\\\":\\\"0.0012873560000000\\\",\\\"TFUEL\\\":\\\"0.0598800450000000\\\",\\\"ENS\\\":\\\"17.0634640000000052\\\",\\\"KASDOWN\\\":\\\"0.0258770550000000\\\",\\\"XTM\\\":\\\"0.0251074400000000\\\",\\\"DEGEN\\\":\\\"0.0084857550000000\\\",\\\"TLM\\\":\\\"0.0100449750000000\\\",\\\"DYDXDOWN\\\":\\\"0.1042598440000000\\\",\\\"CKB\\\":\\\"0.0146026950000000\\\",\\\"LUNC\\\":\\\"0.0000889255150000\\\",\\\"AURORA\\\":\\\"0.1204397500000000\\\",\\\"LUNA\\\":\\\"0.3624187000000000\\\",\\\"XTZ\\\":\\\"0.6776610000000000\\\",\\\"ELON\\\":\\\"0.0000001410294500\\\",\\\"DMTR\\\":\\\"0.0891554000000000\\\",\\\"EOS\\\":\\\"0.4759619000000000\\\",\\\"GST\\\":\\\"0.0118940500000000\\\",\\\"FORT\\\":\\\"0.1155422000000000\\\",\\\"FLAME\\\":\\\"0.0247076400000000\\\",\\\"PATEX\\\":\\\"0.9605195000000000\\\",\\\"DEEP\\\":\\\"0.0328885475000000\\\",\\\"ID3L\\\":\\\"0.0016201895000000\\\",\\\"GTC\\\":\\\"0.6625685500000000\\\",\\\"ID3S\\\":\\\"0.0071674145000000\\\",\\\"RIO\\\":\\\"0.7616190000000000\\\",\\\"CLH\\\":\\\"0.0008555720000000\\\",\\\"BURGER\\\":\\\"0.4016990500000000\\\",\\\"VRA\\\":\\\"0.0029765110000000\\\",\\\"SUNDOG\\\":\\\"0.2173912500000000\\\",\\\"GTT\\\":\\\"0.0002038980000000\\\",\\\"INJUP\\\":\\\"0.2327835500000000\\\",\\\"CPOOL\\\":\\\"0.1557720750000000\\\",\\\"EPX\\\":\\\"0.0000740629500000\\\",\\\"CLV\\\":\\\"0.0329835000000000\\\",\\\"FEAR\\\":\\\"0.0560519600000000\\\",\\\"MEME\\\":\\\"0.0124847545000000\\\",\\\"ROOBEE\\\":\\\"0.0004520738500000\\\",\\\"DEFI\\\":\\\"0.0192903500000000\\\",\\\"TOKEN\\\":\\\"0.0477361200000000\\\",\\\"GRAPE\\\":\\\"0.0020599695000000\\\",\\\"KASUP\\\":\\\"0.3996001000000000\\\",\\\"XWG\\\":\\\"0.0003843077500000\\\",\\\"SKEY\\\":\\\"0.0621289200000000\\\",\\\"SFUND\\\":\\\"1.3243375000000000\\\",\\\"EQX\\\":\\\"0.0032823580000000\\\",\\\"ORDIUP\\\":\\\"0.0548315705000000\\\",\\\"TON\\\":\\\"5.1857058499999995\\\",\\\"DEGO\\\":\\\"2.2667660500000001\\\",\\\"IZI\\\":\\\"0.0088455750000000\\\",\\\"ERG\\\":\\\"0.6605695500000000\\\",\\\"ERN\\\":\\\"1.9255367500000001\\\",\\\"VENOM\\\":\\\"0.0817591000000000\\\",\\\"VOXEL\\\":\\\"0.1497251000000000\\\",\\\"RLC\\\":\\\"1.4649671500000000\\\",\\\"PHA\\\":\\\"0.1093453000000000\\\",\\\"DYDXUP\\\":\\\"0.0112573685000000\\\",\\\"APE3S\\\":\\\"0.0008475760000000\\\",\\\"ORBS\\\":\\\"0.0288955450000000\\\",\\\"OPDOWN\\\":\\\"0.6758619000000000\\\",\\\"ESE\\\":\\\"0.0139130400000000\\\",\\\"APE3L\\\":\\\"0.1339330000000000\\\",\\\"HMND\\\":\\\"0.0982208650000000\\\",\\\"COQ\\\":\\\"0.0000014432780000\\\",\\\"AURY\\\":\\\"0.3340329000000000\\\",\\\"CULT\\\":\\\"0.0000028025980000\\\",\\\"AKT\\\":\\\"2.4642672500000001\\\",\\\"GLMR\\\":\\\"0.1606196500000000\\\",\\\"XYM\\\":\\\"0.0142528700000000\\\",\\\"ORAI\\\":\\\"6.1769100000000012\\\",\\\"XYO\\\":\\\"0.0058680645000000\\\",\\\"ETC\\\":\\\"18.8458723500000169\\\",\\\"LAI\\\":\\\"0.0142828550000000\\\",\\\"PIP\\\":\\\"0.0178310800000000\\\",\\\"ETH\\\":\\\"2607.6655149998362673\\\",\\\"NEO\\\":\\\"10.3575186499999991\\\",\\\"RMV\\\":\\\"0.0081659150000000\\\",\\\"KLAY\\\":\\\"0.1251374000000000\\\",\\\"PIT\\\":\\\"0.0000000003268365\\\",\\\"TARA\\\":\\\"0.0043978000000000\\\",\\\"KALT\\\":\\\"0.1128735350000000\\\",\\\"PIX\\\":\\\"0.0001023687900000\\\",\\\"ETN\\\":\\\"0.0021579205000000\\\",\\\"CSIX\\\":\\\"0.0141729100000000\\\",\\\"TRADE\\\":\\\"0.4708644500000000\\\",\\\"MAVIA\\\":\\\"1.3592200500000001\\\",\\\"HIGH\\\":\\\"1.3043474999999999\\\",\\\"TRB\\\":\\\"62.5387150000000006\\\",\\\"ORDI\\\":\\\"35.7421200000000126\\\",\\\"TRVL\\\":\\\"0.0373643085000000\\\",\\\"AMB\\\":\\\"0.0059670150000000\\\",\\\"TRU\\\":\\\"0.0762018800000000\\\",\\\"LOGX\\\":\\\"0.0271963950000000\\\",\\\"FINC\\\":\\\"0.0362018900000000\\\",\\\"INFRA\\\":\\\"0.1978010500000000\\\",\\\"NATIX\\\":\\\"0.0008729633000000\\\",\\\"NFP\\\":\\\"0.2152923000000000\\\",\\\"TRY\\\":\\\"0.0292166033323590\\\",\\\"TRX\\\":\\\"0.1597201000000000\\\",\\\"LBP\\\":\\\"0.0001243378000000\\\",\\\"LBR\\\":\\\"0.0595702000000000\\\",\\\"EUL\\\":\\\"2.9735125000000000\\\",\\\"NFT\\\":\\\"0.0000004077960000\\\",\\\"SEIUP\\\":\\\"0.0478110825000000\\\",\\\"PUFFER\\\":\\\"0.3676161000000000\\\",\\\"EUR\\\":\\\"1.0811249323958897\\\",\\\"ORCA\\\":\\\"2.0664662499999999\\\",\\\"NEAR3L\\\":\\\"0.0117010765350000\\\",\\\"AMP\\\":\\\"0.0038330825000000\\\",\\\"XDEFI\\\":\\\"0.0472563600000000\\\",\\\"HIFI\\\":\\\"0.4947525000000000\\\",\\\"TRUF\\\":\\\"0.0459570100000000\\\",\\\"AITECH\\\":\\\"0.1045477000000000\\\",\\\"AMU\\\":\\\"0.0043978000000000\\\",\\\"USTC\\\":\\\"0.0214692600000000\\\",\\\"KNGL\\\":\\\"0.0499750000000000\\\",\\\"FOXY\\\":\\\"0.0102686631000000\\\",\\\"NGC\\\":\\\"0.0147935995000000\\\",\\\"TENET\\\":\\\"0.0043278350000000\\\",\\\"NEAR3S\\\":\\\"0.0072553705000000\\\",\\\"MAHA\\\":\\\"1.1904045000000000\\\",\\\"NGL\\\":\\\"0.0701748950000000\\\",\\\"TST\\\":\\\"0.0080359800000000\\\",\\\"HIPPO\\\":\\\"0.0104447750000000\\\",\\\"AXS3S\\\":\\\"0.0308705570000000\\\",\\\"CRO\\\":\\\"0.0781409100000000\\\",\\\"ZPAY\\\":\\\"0.0050574700000000\\\",\\\"MNDE\\\":\\\"0.1026786350000000\\\",\\\"CRV\\\":\\\"0.2534732000000000\\\",\\\"SWASH\\\":\\\"0.0056271850000000\\\",\\\"AXS3L\\\":\\\"0.0106388779000000\\\",\\\"VERSE\\\":\\\"0.0001803098000000\\\",\\\"RPK\\\":\\\"0.0049975000000000\\\",\\\"RPL\\\":\\\"10.9745099999999958\\\",\\\"AZERO\\\":\\\"0.3789104500000000\\\",\\\"SOUL\\\":\\\"0.0534332700000000\\\",\\\"VXV\\\":\\\"0.2619689500000000\\\",\\\"LDO\\\":\\\"1.0885554500000000\\\",\\\"MAGIC\\\":\\\"0.3390304000000000\\\",\\\"ALICE\\\":\\\"1.0324835000000000\\\",\\\"SEAM\\\":\\\"1.1933030499999999\\\",\\\"PLU\\\":\\\"1.9300345000000001\\\",\\\"AOG\\\":\\\"0.0031224380000000\\\",\\\"SMOLE\\\":\\\"0.0000387806000000\\\",\\\"EWT\\\":\\\"1.1094450000000000\\\",\\\"TSUGT\\\":\\\"0.0029185400000000\\\",\\\"PMG\\\":\\\"0.0800599500000000\\\",\\\"OPAI\\\":\\\"0.0006826585000000\\\",\\\"LOCUS\\\":\\\"0.0216591650000000\\\",\\\"CTA\\\":\\\"0.0825087250000000\\\",\\\"NIM\\\":\\\"0.0013673160000000\\\",\\\"CTC\\\":\\\"0.4033982000000000\\\",\\\"APE\\\":\\\"0.7035480500000000\\\",\\\"MERL\\\":\\\"0.2720639000000000\\\",\\\"JAM\\\":\\\"0.0004770613500000\\\",\\\"CTI\\\":\\\"0.0130314810000000\\\",\\\"APP\\\":\\\"0.0021989000000000\\\",\\\"APT\\\":\\\"9.9947001500000000\\\",\\\"WLDUP\\\":\\\"0.0093043455000000\\\",\\\"ZEND\\\":\\\"0.1280759300000000\\\",\\\"FIRE\\\":\\\"0.9113441000000000\\\",\\\"DENT\\\":\\\"0.0008630682500000\\\",\\\"PYTH\\\":\\\"0.3390603850000000\\\",\\\"LFT\\\":\\\"0.0155322300000000\\\",\\\"DPET\\\":\\\"0.0319040400000000\\\",\\\"ORDIDOWN\\\":\\\"0.3788105000000000\\\",\\\"KPOL\\\":\\\"0.0029175405000000\\\",\\\"ETHUP\\\":\\\"8.4971493000000032\\\",\\\"BAND\\\":\\\"1.0939527500000001\\\",\\\"POL\\\":\\\"0.3656171000000000\\\",\\\"ASTR\\\":\\\"0.0582608550000000\\\",\\\"NKN\\\":\\\"0.0691654000000000\\\",\\\"RSR\\\":\\\"0.0068055955000000\\\",\\\"DVPN\\\":\\\"0.0005979009000000\\\",\\\"TWT\\\":\\\"1.1119437500000000\\\",\\\"ARB\\\":\\\"0.5510243500000000\\\",\\\"CVC\\\":\\\"0.1409801746501747\\\",\\\"ARC\\\":\\\"0.0300849500000000\\\",\\\"XETA\\\":\\\"0.0022888550000000\\\",\\\"MTRG\\\":\\\"0.4007995000000000\\\",\\\"LOKA\\\":\\\"0.1867066000000000\\\",\\\"LPOOL\\\":\\\"0.0660069800000000\\\",\\\"TURBOS\\\":\\\"0.0034812585000000\\\",\\\"CVX\\\":\\\"1.7816087499999999\\\",\\\"ARX\\\":\\\"0.0007556220000000\\\",\\\"MPLX\\\":\\\"0.4355221300000000\\\",\\\"SUSHI\\\":\\\"0.7011492500000000\\\",\\\"NLK\\\":\\\"0.0114442750000000\\\",\\\"PEPE2\\\":\\\"0.0000000313843000\\\",\\\"WBTC\\\":\\\"66881.4425499645548419\\\",\\\"SUI3L\\\":\\\"0.0211204345000000\\\",\\\"CWS\\\":\\\"0.1927036000000000\\\",\\\"SUI3S\\\":\\\"0.0000579110300000\\\",\\\"INSP\\\":\\\"0.0264167850000000\\\",\\\"MANA\\\":\\\"0.2945026750000000\\\",\\\"VRTX\\\":\\\"0.0641679000000000\\\",\\\"CSPR\\\":\\\"0.0116441750000000\\\",\\\"ATA\\\":\\\"0.0785007300000000\\\",\\\"OPEN\\\":\\\"0.0080049955000000\\\",\\\"HAI\\\":\\\"0.0448275750000000\\\",\\\"NMR\\\":\\\"14.7436245000000072\\\",\\\"ATH\\\":\\\"0.0540929400000000\\\",\\\"LIT\\\":\\\"0.6282857000000000\\\",\\\"TLOS\\\":\\\"0.3263467450000000\\\",\\\"TNSR\\\":\\\"0.3662168000000000\\\",\\\"CXT\\\":\\\"0.0871364100000000\\\",\\\"POLYX\\\":\\\"0.2346826000000000\\\",\\\"ZERO\\\":\\\"0.0002507745500000\\\",\\\"ROUTE\\\":\\\"0.0610694500000000\\\",\\\"LOOM\\\":\\\"0.0580009850000000\\\",\\\"PRE\\\":\\\"0.0078680640000000\\\",\\\"VRAUP\\\":\\\"0.0134652640000000\\\",\\\"HBB\\\":\\\"0.0714742450000000\\\",\\\"RVN\\\":\\\"0.0165017450000000\\\",\\\"PRQ\\\":\\\"0.0715741950000000\\\",\\\"ONDO\\\":\\\"0.7134930750000000\\\",\\\"PEPEDOWN\\\":\\\"0.0000155022450000\\\",\\\"WOOP\\\":\\\"0.0020179905000000\\\",\\\"LUNCUP\\\":\\\"0.0168355780000000\\\",\\\"KAVA\\\":\\\"0.3522238000000000\\\",\\\"LKI\\\":\\\"0.0104187880000000\\\",\\\"AVA\\\":\\\"0.4857570000000000\\\",\\\"NOM\\\":\\\"0.0233883000000000\\\",\\\"MAPO\\\":\\\"0.0089015470000000\\\",\\\"PEPEUP\\\":\\\"0.0114252845000000\\\",\\\"STRAX\\\":\\\"0.0487156300000000\\\",\\\"NOT\\\":\\\"0.0078670645000000\\\",\\\"ZERC\\\":\\\"0.1108245600000000\\\",\\\"BCUT\\\":\\\"0.0255672100000000\\\",\\\"MASA\\\":\\\"0.0691354150000000\\\",\\\"WAN\\\":\\\"0.1785077544737212\\\",\\\"WAT\\\":\\\"0.0003273762300000\\\",\\\"WAX\\\":\\\"0.0327636100000000\\\",\\\"MASK\\\":\\\"2.2259864500000002\\\",\\\"EOS3L\\\":\\\"0.0002122138400000\\\",\\\"IDEA\\\":\\\"0.0005887055000000\\\",\\\"EOS3S\\\":\\\"0.0034472755000000\\\",\\\"YFI\\\":\\\"4919.4290549999908843\\\",\\\"MOODENG\\\":\\\"0.0774612500000000\\\",\\\"XCUR\\\":\\\"0.0048845565000000\\\",\\\"HYDRA\\\":\\\"0.2225886500000000\\\",\\\"POPCAT\\\":\\\"1.3382305500000000\\\",\\\"LQTY\\\":\\\"0.7848074000000000\\\",\\\"PIXEL\\\":\\\"0.1406596350000000\\\",\\\"LMR\\\":\\\"0.0145437245000000\\\",\\\"ZETA\\\":\\\"0.5997999500000000\\\",\\\"YGG\\\":\\\"0.4717640000000000\\\",\\\"AXS\\\":\\\"4.6006985000000006\\\",\\\"BCHSV\\\":\\\"49.8250749999999370\\\",\\\"NRN\\\":\\\"0.0395802000000000\\\",\\\"FTON\\\":\\\"0.0091954000000000\\\",\\\"COMP\\\":\\\"43.6581599999999881\\\",\\\"XPRT\\\":\\\"0.1819090000000000\\\",\\\"HFT\\\":\\\"0.1443278000000000\\\",\\\"UXLINK\\\":\\\"0.5085456000000000\\\",\\\"STAMP\\\":\\\"0.0335032400000000\\\",\\\"RUNE\\\":\\\"4.9233370999999996\\\",\\\"ZEUS\\\":\\\"0.2587705500000000\\\",\\\"LTC3L\\\":\\\"1.8294848000000001\\\",\\\"DAPP\\\":\\\"0.1763118000000000\\\",\\\"FORTH\\\":\\\"2.9508238500000004\\\",\\\"ALPINE\\\":\\\"1.5322335000000000\\\",\\\"SENSO\\\":\\\"0.0328835500000000\\\",\\\"LTC3S\\\":\\\"0.0006986505000000\\\",\\\"DEXE\\\":\\\"8.3795081500000028\\\",\\\"GOAL\\\":\\\"0.0175912000000000\\\",\\\"AVAX\\\":\\\"27.5602130000000058\\\",\\\"LISTA\\\":\\\"0.3782108000000000\\\",\\\"AMPL\\\":\\\"1.3743124999999999\\\",\\\"WORK\\\":\\\"0.1384307500000000\\\",\\\"BRWL\\\":\\\"0.0017391300000000\\\",\\\"BANANA\\\":\\\"57.1314200000001362\\\",\\\"PUSH\\\":\\\"0.0750624500000000\\\",\\\"WEN\\\":\\\"0.0001015492000000\\\",\\\"NEIRO\\\":\\\"0.0879560000000000\\\",\\\"BTCUP\\\":\\\"34.7711057499999789\\\",\\\"SOL3S\\\":\\\"0.0007816090000000\\\",\\\"BRAWL\\\":\\\"0.0004776610500000\\\",\\\"LAY3R\\\":\\\"0.2161918500000000\\\",\\\"LPT\\\":\\\"11.9304317999999945\\\",\\\"GODS\\\":\\\"0.1807096000000000\\\",\\\"SAND3S\\\":\\\"4.6152911999999992\\\",\\\"RDNT\\\":\\\"0.0640679500000000\\\",\\\"SOL3L\\\":\\\"1.8351913752850000\\\",\\\"NIBI\\\":\\\"0.0653772950000000\\\",\\\"NUM\\\":\\\"0.0436181800000000\\\",\\\"PYR\\\":\\\"2.5590198499999997\\\",\\\"DAG\\\":\\\"0.0226176855000000\\\",\\\"DAI\\\":\\\"0.9989006596042375\\\",\\\"HIP\\\":\\\"0.0034982500000000\\\",\\\"DAO\\\":\\\"0.2848575000000000\\\",\\\"AVAIL\\\":\\\"0.1300929210000000\\\",\\\"DAR\\\":\\\"0.1512243500000000\\\",\\\"FET\\\":\\\"1.3760116500000000\\\",\\\"FCON\\\":\\\"0.0001197600900000\\\",\\\"XAVA\\\":\\\"0.3789104500000000\\\",\\\"LRC\\\":\\\"0.1208395500000000\\\",\\\"UNI3S\\\":\\\"0.0000653573050000\\\",\\\"PZP\\\":\\\"0.0599600050000000\\\",\\\"POKT\\\":\\\"0.0424787500000000\\\",\\\"DASH\\\":\\\"23.6881500000000109\\\",\\\"BAKEDOWN\\\":\\\"0.0003324636850000\\\",\\\"POLC\\\":\\\"0.0061389290000000\\\",\\\"DBR\\\":\\\"0.0377671070000000\\\",\\\"CIRUS\\\":\\\"0.0055772100000000\\\",\\\"UNI3L\\\":\\\"0.0993921490650000\\\",\\\"NWC\\\":\\\"0.0681659000000000\\\",\\\"POLK\\\":\\\"0.0142628650000000\\\",\\\"LSD\\\":\\\"0.9420287500000000\\\",\\\"MARS4\\\":\\\"0.0005878059500000\\\",\\\"LSK\\\":\\\"0.8080957500000000\\\",\\\"BLOCK\\\":\\\"0.0261869000000000\\\",\\\"ANALOS\\\":\\\"0.0000446776500000\\\",\\\"SAFE\\\":\\\"0.8779608000000000\\\",\\\"DCK\\\":\\\"0.0234082900000000\\\",\\\"LSS\\\":\\\"0.0562718500000000\\\",\\\"DCR\\\":\\\"12.4337799999999929\\\",\\\"LIKE\\\":\\\"0.0559720000000000\\\",\\\"DATA\\\":\\\"0.0361819000000000\\\",\\\"WIF\\\":\\\"2.5696145499999999\\\",\\\"BLOK\\\":\\\"0.0006546725000000\\\",\\\"LTC\\\":\\\"71.6261690000000611\\\",\\\"METIS\\\":\\\"42.0289750000000612\\\",\\\"WIN\\\":\\\"0.0000868365600000\\\",\\\"HLG\\\":\\\"0.0018790600000000\\\",\\\"LTO\\\":\\\"0.1166116650000000\\\",\\\"DYDX\\\":\\\"0.9341327000000000\\\",\\\"ARB3S\\\":\\\"0.0509025360000000\\\",\\\"MUBI\\\":\\\"0.0303848000000000\\\",\\\"ARB3L\\\":\\\"0.0025917035000000\\\",\\\"RBTC1\\\":\\\"0.0000039480250000\\\",\\\"POND\\\":\\\"0.0118640650000000\\\",\\\"LINA\\\":\\\"0.0037771105000000\\\",\\\"MYRIA\\\":\\\"0.0025337325000000\\\",\\\"LINK\\\":\\\"11.0244849999999944\\\",\\\"QTUM\\\":\\\"2.4262016723130069\\\",\\\"TUNE\\\":\\\"0.0148025950000000\\\",\\\"UFO\\\":\\\"0.0000006479758500\\\",\\\"CYBER\\\":\\\"2.8755615000000001\\\",\\\"WILD\\\":\\\"0.2433782500000000\\\",\\\"POLS\\\":\\\"0.2809594500000000\\\",\\\"NYM\\\":\\\"0.0719640000000000\\\",\\\"FIL\\\":\\\"3.6786597500000005\\\",\\\"BAL\\\":\\\"2.0099945000000000\\\",\\\"SCA\\\":\\\"0.3999999000000000\\\",\\\"STND\\\":\\\"0.0133123405000000\\\",\\\"WMTX\\\":\\\"0.2138930000000000\\\",\\\"SCLP\\\":\\\"0.1545227000000000\\\",\\\"MANEKI\\\":\\\"0.0073963000000000\\\",\\\"BAT\\\":\\\"0.1721139000000000\\\",\\\"AKRO\\\":\\\"0.0042302838000000\\\",\\\"FTM3L\\\":\\\"8.2574692000000024\\\",\\\"BAX\\\":\\\"0.0000709645000000\\\",\\\"FTM3S\\\":\\\"0.0000255072400000\\\",\\\"COTI\\\":\\\"0.0951524000000000\\\"}}", + "x-request-example": "{\\\"base\\\": \\\"USD\\\", \\\"currencies\\\": \\\"example_string_default_value\\\"}" + } + }, + "/api/v1/market/stats": { "get": { - "summary": "Get Order By OrderId", + "summary": "Get 24hr Stats", "deprecated": false, - "description": "This endpoint can be used to obtain information for a single Spot order using the order id. After the user successfully places an order, the order is in Active state, and the user can use inOrderBook to determine whether the order has entered the order. Canceled or fully filled orders are marked as completed Done status.", + "description": "Request via this endpoint to get the statistics of the specified ticker in the last 24 hours.", "tags": [], "parameters": [ { @@ -7135,20 +5631,6 @@ "in": "query", "description": "symbol", "required": true, - "schema": { - "type": "string", - "example": [ - "BTC-USDT", - "ETH-USDT", - "KCS-USDT" - ] - } - }, - { - "name": "orderId", - "in": "path", - "description": "The unique order id generated by the trading system", - "required": true, "schema": { "type": "string" } @@ -7163,271 +5645,94 @@ "type": "object", "properties": { "code": { - "type": "string" - }, - "data": { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "The unique order id generated by the trading system" - }, - "symbol": { - "type": "string", - "description": "symbol", - "example": [ - "BTC-USDT", - "ETH-USDT", - "KCS-USDT" - ] - }, - "opType": { - "type": "string" - }, - "type": { - "type": "string", - "description": "Specify if the order is an 'limit' order or 'market' order. ", - "enum": [ - "limit", - "market" - ], - "x-api-enum": [ - { - "value": "limit", - "name": "", - "description": "" - }, - { - "value": "market", - "name": "", - "description": "" - } - ] - }, - "side": { - "type": "string", - "description": "Buy or sell", - "enum": [ - "buy", - "sell" - ], - "x-api-enum": [ - { - "value": "buy", - "name": "", - "description": "" - }, - { - "value": "sell", - "name": "", - "description": "" - } - ] - }, - "price": { - "type": "string", - "description": "Order price" - }, - "size": { - "type": "string", - "description": "Order size" - }, - "funds": { - "type": "string", - "description": "Order Funds" - }, - "dealSize": { - "type": "string", - "description": "Number of filled transactions" - }, - "dealFunds": { - "type": "string", - "description": "Funds of filled transactions" - }, - "fee": { - "type": "string", - "description": "[Handling fees](https://www.kucoin.com/docs-new/api-5327739)" - }, - "feeCurrency": { - "type": "string", - "description": "currency used to calculate trading fee" - }, - "stp": { - "type": "string", - "description": "[Self Trade Prevention](https://www.kucoin.com/docs-new/api-5176570)", - "enum": [ - "DC", - "CO", - "CN", - "CB" - ], - "x-api-enum": [ - { - "value": "DC", - "name": "", - "description": "" - }, - { - "value": "CO", - "name": "", - "description": "" - }, - { - "value": "CN", - "name": "", - "description": "" - }, - { - "value": "CB", - "name": "", - "description": "" - } - ] + "type": "string" + }, + "data": { + "type": "object", + "properties": { + "time": { + "type": "integer", + "description": "timestamp", + "format": "int64" }, - "timeInForce": { + "symbol": { "type": "string", - "description": "Time in force", - "enum": [ - "GTC", - "GTT", - "IOC", - "FOK" - ], - "x-api-enum": [ - { - "value": "GTC", - "name": "", - "description": "" - }, - { - "value": "GTT", - "name": "", - "description": "" - }, - { - "value": "IOC", - "name": "", - "description": "" - }, - { - "value": "FOK", - "name": "", - "description": "" - } - ] - }, - "postOnly": { - "type": "boolean", - "description": "Whether its a postOnly order." - }, - "hidden": { - "type": "boolean", - "description": "Whether its a hidden order." - }, - "iceberg": { - "type": "boolean", - "description": "Whether its a iceberg order." + "description": "Symbol" }, - "visibleSize": { + "buy": { "type": "string", - "description": "Visible size of iceberg order in order book." - }, - "cancelAfter": { - "type": "integer", - "description": "A GTT timeInForce that expires in n seconds" - }, - "channel": { - "type": "string" + "description": "Best bid price\n" }, - "clientOid": { + "sell": { "type": "string", - "description": "Client Order Id,unique identifier created by the user" + "description": "Best ask price" }, - "remark": { + "changeRate": { "type": "string", - "description": "Order placement remarks" + "description": "24h change rate" }, - "tags": { + "changePrice": { "type": "string", - "description": "Order tag" - }, - "cancelExist": { - "type": "boolean", - "description": "Whether there is a cancellation record for the order." + "description": "24h change price" }, - "createdAt": { - "type": "integer", - "format": "int64" + "high": { + "type": "string", + "description": "Highest price in 24h" }, - "lastUpdatedAt": { - "type": "integer", - "format": "int64" + "low": { + "type": "string", + "description": "Lowest price in 24h" }, - "tradeType": { + "vol": { "type": "string", - "description": "Trade type, redundancy param" + "description": "24h volume, executed based on base currency" }, - "inOrderBook": { - "type": "boolean", - "description": "Whether to enter the orderbook: true: enter the orderbook; false: not enter the orderbook" + "volValue": { + "type": "string", + "description": "24h traded amount" }, - "cancelledSize": { + "last": { "type": "string", - "description": "Number of canceled transactions" + "description": "Last traded price" }, - "cancelledFunds": { + "averagePrice": { "type": "string", - "description": "Funds of canceled transactions" + "description": "Average trading price in the last 24 hours" }, - "remainSize": { + "takerFeeRate": { "type": "string", - "description": "Number of remain transactions" + "description": "Basic Taker Fee" }, - "remainFunds": { + "makerFeeRate": { "type": "string", - "description": "Funds of remain transactions" + "description": "Basic Maker Fee" }, - "tax": { + "takerCoefficient": { "type": "string", - "description": "Users in some regions need query this field" + "description": "The taker fee coefficient. The actual fee needs to be multiplied by this coefficient to get the final fee. Most currencies have a coefficient of 1. If set to 0, it means no fee" }, - "active": { - "type": "boolean", - "description": "Order status: true-The status of the order isactive; false-The status of the order is done" + "makerCoefficient": { + "type": "string", + "description": "The maker fee coefficient. The actual fee needs to be multiplied by this coefficient to get the final fee. Most currencies have a coefficient of 1. If set to 0, it means no fee" } }, "required": [ - "id", + "time", "symbol", - "opType", - "type", - "side", - "price", - "size", - "funds", - "dealSize", - "dealFunds", - "fee", - "feeCurrency", - "timeInForce", - "postOnly", - "hidden", - "iceberg", - "visibleSize", - "cancelAfter", - "channel", - "clientOid", - "cancelExist", - "tradeType", - "inOrderBook", - "cancelledSize", - "cancelledFunds", - "remainSize", - "remainFunds", - "active", - "createdAt", - "lastUpdatedAt", - "tax" + "buy", + "sell", + "changeRate", + "changePrice", + "high", + "low", + "vol", + "volValue", + "last", + "averagePrice", + "takerFeeRate", + "makerFeeRate", + "takerCoefficient", + "makerCoefficient" ] } }, @@ -7440,38 +5745,123 @@ } } }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470181", + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470161", + "x-abandon": "normal", + "x-domain": "Spot", + "x-api-channel": "Public", + "x-api-permission": "NULL", + "x-api-rate-limit-pool": "Public", + "x-sdk-service": "Spot", + "x-sdk-sub-service": "Market", + "x-sdk-method-name": "get24hrStats", + "x-sdk-method-description": "Request via this endpoint to get the statistics of the specified ticker in the last 24 hours.", + "x-api-rate-limit": 15, + "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"time\\\":1729175612158,\\\"symbol\\\":\\\"BTC-USDT\\\",\\\"buy\\\":\\\"66982.4\\\",\\\"sell\\\":\\\"66982.5\\\",\\\"changeRate\\\":\\\"-0.0114\\\",\\\"changePrice\\\":\\\"-778.1\\\",\\\"high\\\":\\\"68107.7\\\",\\\"low\\\":\\\"66683.3\\\",\\\"vol\\\":\\\"1738.02898182\\\",\\\"volValue\\\":\\\"117321982.415978333\\\",\\\"last\\\":\\\"66981.5\\\",\\\"averagePrice\\\":\\\"67281.21437289\\\",\\\"takerFeeRate\\\":\\\"0.001\\\",\\\"makerFeeRate\\\":\\\"0.001\\\",\\\"takerCoefficient\\\":\\\"1\\\",\\\"makerCoefficient\\\":\\\"1\\\"}}", + "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\"}" + } + }, + "/api/v1/markets": { + "get": { + "summary": "Get Market List", + "deprecated": false, + "description": "Request via this endpoint to get the transaction currency for the entire trading market.", + "tags": [], + "parameters": [], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "code", + "data" + ] + } + } + } + } + }, + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470166", + "x-abandon": "normal", + "x-domain": "Spot", + "x-api-channel": "Public", + "x-api-permission": "NULL", + "x-api-rate-limit-pool": "Public", + "x-sdk-service": "Spot", + "x-sdk-sub-service": "Market", + "x-sdk-method-name": "getMarketList", + "x-sdk-method-description": "Request via this endpoint to get the transaction currency for the entire trading market.", + "x-api-rate-limit": 3, + "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":[\\\"USDS\\\",\\\"TON\\\",\\\"AI\\\",\\\"DePIN\\\",\\\"PoW\\\",\\\"BRC-20\\\",\\\"ETF\\\",\\\"KCS\\\",\\\"Meme\\\",\\\"Solana\\\",\\\"FIAT\\\",\\\"VR&AR\\\",\\\"DeFi\\\",\\\"Polkadot\\\",\\\"BTC\\\",\\\"ALTS\\\",\\\"Layer 1\\\"]}" + } + }, + "/api/v1/timestamp": { + "get": { + "summary": "Get Server Time", + "deprecated": false, + "description": "Get the server time.", + "tags": [], + "parameters": [], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "integer", + "format": "int64", + "description": "ServerTime(millisecond)" + } + }, + "required": [ + "code", + "data" + ] + } + } + } + } + }, + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470156", "x-abandon": "normal", "x-domain": "Spot", - "x-api-channel": "Private", - "x-api-permission": "General", - "x-api-rate-limit-pool": "Spot", + "x-api-channel": "Public", + "x-api-permission": "NULL", + "x-api-rate-limit-pool": "Public", "x-sdk-service": "Spot", - "x-sdk-sub-service": "Order", - "x-sdk-method-name": "getOrderByOrderId", - "x-sdk-method-description": "This endpoint can be used to obtain information for a single Spot order using the order id. After the user successfully places an order, the order is in Active state, and the user can use inOrderBook to determine whether the order has entered the order. Canceled or fully filled orders are marked as completed Done status.", - "x-api-rate-limit": 2, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"id\\\": \\\"6717422bd51c29000775ea03\\\",\\n \\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\",\\n \\\"symbol\\\": \\\"BTC-USDT\\\",\\n \\\"opType\\\": \\\"DEAL\\\",\\n \\\"type\\\": \\\"limit\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"price\\\": \\\"70000\\\",\\n \\\"size\\\": \\\"0.00001\\\",\\n \\\"funds\\\": \\\"0.7\\\",\\n \\\"dealSize\\\": \\\"0.00001\\\",\\n \\\"dealFunds\\\": \\\"0.677176\\\",\\n \\\"remainSize\\\": \\\"0\\\",\\n \\\"remainFunds\\\": \\\"0.022824\\\",\\n \\\"cancelledSize\\\": \\\"0\\\",\\n \\\"cancelledFunds\\\": \\\"0\\\",\\n \\\"fee\\\": \\\"0.000677176\\\",\\n \\\"feeCurrency\\\": \\\"USDT\\\",\\n \\\"stp\\\": null,\\n \\\"timeInForce\\\": \\\"GTC\\\",\\n \\\"postOnly\\\": false,\\n \\\"hidden\\\": false,\\n \\\"iceberg\\\": false,\\n \\\"visibleSize\\\": \\\"0\\\",\\n \\\"cancelAfter\\\": 0,\\n \\\"channel\\\": \\\"API\\\",\\n \\\"remark\\\": \\\"order remarks\\\",\\n \\\"tags\\\": null,\\n \\\"cancelExist\\\": false,\\n \\\"tradeType\\\": \\\"TRADE\\\",\\n \\\"inOrderBook\\\": false,\\n \\\"active\\\": false,\\n \\\"tax\\\": \\\"0\\\",\\n \\\"createdAt\\\": 1729577515444,\\n \\\"lastUpdatedAt\\\": 1729577515481\\n }\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"orderId\\\": \\\"6717422bd51c29000775ea03\\\"}" + "x-sdk-sub-service": "Market", + "x-sdk-method-name": "getServerTime", + "x-sdk-method-description": "Get the server time.", + "x-api-rate-limit": 3, + "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":1729100692873}" } }, - "/api/v1/stop-order/{orderId}": { - "delete": { - "summary": "Cancel Stop Order By OrderId", - "deprecated": true, - "description": "This endpoint can be used to cancel a spot stop order by orderId. ", + "/api/v1/status": { + "get": { + "summary": "Get Service Status", + "deprecated": false, + "description": "Get the service status", "tags": [], - "parameters": [ - { - "name": "orderId", - "in": "path", - "description": "The unique order id generated by the trading system", - "required": true, - "schema": { - "type": "string" - } - } - ], + "parameters": [], "responses": { "200": { "description": "", @@ -7486,16 +5876,40 @@ "data": { "type": "object", "properties": { - "cancelledOrderIds": { - "type": "array", - "items": { - "type": "string" - }, - "description": "order id array" + "status": { + "type": "string", + "description": "Status of service: open:normal transaction, close:Stop Trading/Maintenance, cancelonly:can only cancel the order but not place order", + "enum": [ + "open", + "close", + "cancelonly" + ], + "x-api-enum": [ + { + "value": "open", + "name": "OPEN", + "description": "normal transaction" + }, + { + "value": "close", + "name": "CLOSE", + "description": "Stop Trading/Maintenance" + }, + { + "value": "cancelonly", + "name": "CANCELONLY", + "description": "can only cancel the order but not place order" + } + ] + }, + "msg": { + "type": "string", + "description": "Remark for operation" } }, "required": [ - "cancelledOrderIds" + "status", + "msg" ] } }, @@ -7508,36 +5922,27 @@ } } }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470335", - "x-abandon": "abandon", + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470158", + "x-abandon": "normal", "x-domain": "Spot", - "x-api-channel": "Private", - "x-api-permission": "Spot", - "x-api-rate-limit-pool": "Spot", + "x-api-channel": "Public", + "x-api-permission": "NULL", + "x-api-rate-limit-pool": "Public", "x-sdk-service": "Spot", - "x-sdk-sub-service": "Order", - "x-sdk-method-name": "cancelStopOrderByOrderId", - "x-sdk-method-description": "This endpoint can be used to cancel a spot stop order by orderId. ", + "x-sdk-sub-service": "Market", + "x-sdk-method-name": "getServiceStatus", + "x-sdk-method-description": "Get the service status", "x-api-rate-limit": 3, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"cancelledOrderIds\\\": [\\n \\\"671124f9365ccb00073debd4\\\"\\n ]\\n }\\n}", - "x-request-example": "{\\\"orderId\\\": \\\"671124f9365ccb00073debd4\\\"}" - }, - "get": { - "summary": "Get Stop Order By OrderId", + "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"status\\\":\\\"open\\\",\\\"msg\\\":\\\"\\\"}}" + } + }, + "/api/v1/hf/orders": { + "post": { + "summary": "Add Order", "deprecated": false, - "description": "This interface is to obtain Spot stop order details by orderId", + "description": "Place order to the Spot trading system, you can place two major types of orders: limit and market. Orders can only be placed if your account has sufficient funds. Once an order is placed, your funds will be put on hold for the duration of the order. The amount of funds on hold depends on the order type and parameters specified.", "tags": [], - "parameters": [ - { - "name": "orderId", - "in": "path", - "description": "The order id", - "required": true, - "schema": { - "type": "string" - } - } - ], + "parameters": [], "responses": { "200": { "description": "", @@ -7546,169 +5951,238 @@ "schema": { "type": "object", "properties": { + "code": { + "type": "string" + }, "data": { "type": "object", - "properties": { - "id": { - "type": "string", - "description": "Order ID, the ID of an order." - }, - "symbol": { - "type": "string", - "description": "Symbol name" - }, - "userId": { - "type": "string", - "description": "User ID" - }, - "status": { - "type": "string", - "description": "Order status, include NEW, TRIGGERED" - }, - "type": { - "type": "string", - "description": "Order type,limit, market, limit_stop or market_stop" - }, - "side": { - "type": "string", - "description": "transaction direction,include buy and sell" - }, - "price": { - "type": "string", - "description": "order price" - }, - "size": { - "type": "string", - "description": "order quantity" - }, - "funds": { - "type": "string", - "description": "order funds" - }, - "stp": { - "type": "string" - }, - "timeInForce": { - "type": "string", - "description": "time InForce,include GTC,GTT,IOC,FOK" - }, - "cancelAfter": { - "type": "integer", - "description": "cancel orders after n seconds,requires timeInForce to be GTT", - "format": "int64" - }, - "postOnly": { - "type": "boolean", - "description": "postOnly" - }, - "hidden": { - "type": "boolean", - "description": "hidden order" - }, - "iceberg": { - "type": "boolean", - "description": "Iceberg order" - }, - "visibleSize": { - "type": "string", - "description": "displayed quantity for iceberg order" - }, - "channel": { - "type": "string", - "description": "order source" - }, - "clientOid": { - "type": "string", - "description": "user-entered order unique mark" - }, - "remark": { - "type": "string", - "description": "Remarks at stop order creation" - }, - "tags": { - "type": "string", - "description": "tag order source" - }, - "domainId": { - "type": "string", - "description": "domainId, e.g: kucoin" - }, - "tradeSource": { - "type": "string", - "description": "trade source: USER(Order by user), MARGIN_SYSTEM(Order by margin system)" - }, - "tradeType": { - "type": "string", - "description": "The type of trading : TRADE(Spot), MARGIN_TRADE (Cross Margin), MARGIN_ISOLATED_TRADE (Isolated Margin)." - }, - "feeCurrency": { - "type": "string", - "description": "The currency of the fee" - }, - "takerFeeRate": { - "type": "string", - "description": "Fee Rate of taker" - }, - "makerFeeRate": { - "type": "string", - "description": "Fee Rate of maker" - }, - "createdAt": { - "type": "integer", - "description": "order creation time", - "format": "int64" - }, - "stop": { - "type": "string", - "description": "Stop order type, include loss and entry" - }, - "stopTriggerTime": { - "type": "integer", - "description": "The trigger time of the stop order", - "format": "int64" - }, - "stopPrice": { + "properties": { + "orderId": { "type": "string", - "description": "stop price" + "description": "The unique order id generated by the trading system,which can be used later for further actions such as canceling the order." }, - "orderTime": { - "type": "integer", - "description": "Time of place a stop order, accurate to nanoseconds", - "format": "int64" + "clientOid": { + "type": "string", + "description": "The user self-defined order id." } }, - "description": "the details" - }, - "code": { - "type": "string", - "description": "return status code" + "required": [ + "orderId", + "clientOid" + ] } }, "required": [ - "data", - "code" + "code", + "data" ] } } } } }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470339", + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470188", "x-abandon": "normal", "x-domain": "Spot", "x-api-channel": "Private", - "x-api-permission": "General", + "x-api-permission": "Spot", "x-api-rate-limit-pool": "Spot", "x-sdk-service": "Spot", "x-sdk-sub-service": "Order", - "x-sdk-method-name": "getStopOrderByOrderId", - "x-sdk-method-description": "This interface is to obtain Spot stop order details by orderId", - "x-api-rate-limit": 3, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"id\\\": \\\"vs8hoo8q2ceshiue003b67c0\\\",\\n \\\"symbol\\\": \\\"KCS-USDT\\\",\\n \\\"userId\\\": \\\"60fe4956c43cbc0006562c2c\\\",\\n \\\"status\\\": \\\"NEW\\\",\\n \\\"type\\\": \\\"limit\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"price\\\": \\\"0.01000000000000000000\\\",\\n \\\"size\\\": \\\"0.01000000000000000000\\\",\\n \\\"funds\\\": null,\\n \\\"stp\\\": null,\\n \\\"timeInForce\\\": \\\"GTC\\\",\\n \\\"cancelAfter\\\": -1,\\n \\\"postOnly\\\": false,\\n \\\"hidden\\\": false,\\n \\\"iceberg\\\": false,\\n \\\"visibleSize\\\": null,\\n \\\"channel\\\": \\\"API\\\",\\n \\\"clientOid\\\": \\\"40e0eb9efe6311eb8e58acde48001122\\\",\\n \\\"remark\\\": null,\\n \\\"tags\\\": null,\\n \\\"orderTime\\\": 1629098781127530200,\\n \\\"domainId\\\": \\\"kucoin\\\",\\n \\\"tradeSource\\\": \\\"USER\\\",\\n \\\"tradeType\\\": \\\"TRADE\\\",\\n \\\"feeCurrency\\\": \\\"USDT\\\",\\n \\\"takerFeeRate\\\": \\\"0.00200000000000000000\\\",\\n \\\"makerFeeRate\\\": \\\"0.00200000000000000000\\\",\\n \\\"createdAt\\\": 1629098781128,\\n \\\"stop\\\": \\\"loss\\\",\\n \\\"stopTriggerTime\\\": null,\\n \\\"stopPrice\\\": \\\"10.00000000000000000000\\\"\\n }\\n}", - "x-request-example": "{\\\"orderId\\\": \\\"example_string_default_value\\\"}" - } - }, - "/api/v1/hf/orders": { + "x-sdk-method-name": "addOrder", + "x-sdk-method-description": "Place order to the Spot trading system, you can place two major types of orders: limit and market. Orders can only be placed if your account has sufficient funds. Once an order is placed, your funds will be put on hold for the duration of the order. The amount of funds on hold depends on the order type and parameters specified.", + "x-api-rate-limit": 1, + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "clientOid": { + "type": "string", + "description": "Client Order Id,The ClientOid field is a unique ID created by the user(we recommend using a UUID), and can only contain numbers, letters, underscores (_), and hyphens (-). This field is returned when order information is obtained. You can use clientOid to tag your orders. ClientOid is different from the order ID created by the service provider. Please do not initiate requests using the same clientOid. The maximum length for the ClientOid is 40 characters.\n\nPlease remember the orderId created by the service provider, it used to check for updates in order status.", + "example": [ + "5c52e11203aa677f33e493fb" + ] + }, + "side": { + "type": "string", + "description": "specify if the order is to 'buy' or 'sell'", + "enum": [ + "buy", + "sell" + ], + "x-api-enum": [ + { + "value": "buy", + "name": "", + "description": "" + }, + { + "value": "sell", + "name": "", + "description": "" + } + ], + "example": [ + "buy" + ] + }, + "symbol": { + "type": "string", + "description": "symbol", + "example": [ + "BTC-USDT", + "ETH-USDT", + "KCS-USDT" + ] + }, + "type": { + "type": "string", + "description": "specify if the order is an 'limit' order or 'market' order. \n\nThe type of order you specify when you place your order determines whether or not you need to request other parameters and also affects the execution of the matching engine.\n\nWhen placing a limit order, you must specify a price and size. The system will try to match the order according to market price or a price better than market price. If the order cannot be immediately matched, it will stay in the order book until it is matched or the user cancels.\n\nUnlike limit orders, the price for market orders fluctuates with market prices. When placing a market order, you do not need to specify a price, you only need to specify a quantity. Market orders are filled immediately and will not enter the order book. All market orders are takers and a taker fee will be charged.", + "enum": [ + "limit", + "market" + ], + "x-api-enum": [ + { + "value": "limit", + "name": "", + "description": "" + }, + { + "value": "market", + "name": "", + "description": "" + } + ], + "example": [ + "limit" + ] + }, + "remark": { + "type": "string", + "description": "Order placement remarks, length cannot exceed 20 characters (ASCII)" + }, + "stp": { + "type": "string", + "description": "[Self Trade Prevention](https://www.kucoin.com/docs-new/doc-338146) is divided into four strategies: CN, CO, CB , and DC", + "enum": [ + "DC", + "CO", + "CN", + "CB" + ], + "x-api-enum": [ + { + "value": "DC", + "name": "", + "description": "" + }, + { + "value": "CO", + "name": "", + "description": "" + }, + { + "value": "CN", + "name": "", + "description": "" + }, + { + "value": "CB", + "name": "", + "description": "" + } + ] + }, + "price": { + "type": "string", + "description": "Specify price for order\n\nWhen placing a limit order, the price must be based on priceIncrement for the trading pair. The price increment (priceIncrement) is the price precision for the trading pair. For example, for the BTC-USDT trading pair, the priceIncrement is 0.00001000. So the price for your orders cannot be less than 0.00001000 and must be a multiple of priceIncrement. Otherwise, the order will return an invalid priceIncrement error." + }, + "size": { + "type": "string", + "description": "Specify quantity for order\n\nWhen **type** is limit, size refers to the amount of trading targets (the asset name written in front) for the trading pair. Teh Size must be based on the baseIncrement of the trading pair. The baseIncrement represents the precision for the trading pair. The size of an order must be a positive-integer multiple of baseIncrement and must be between baseMinSize and baseMaxSize.\n\nWhen **type** is market, select one out of two: size or funds" + }, + "timeInForce": { + "type": "string", + "description": "[Time in force](https://www.kucoin.com/docs-new/doc-338146) is a special strategy used during trading", + "enum": [ + "GTC", + "GTT", + "IOC", + "FOK" + ], + "default": "GTC", + "x-api-enum": [ + { + "value": "GTC", + "name": "", + "description": "" + }, + { + "value": "GTT", + "name": "", + "description": "" + }, + { + "value": "IOC", + "name": "", + "description": "" + }, + { + "value": "FOK", + "name": "", + "description": "" + } + ] + }, + "postOnly": { + "type": "boolean", + "default": false, + "description": "passive order labels, this is disabled when the order timing strategy is IOC or FOK" + }, + "hidden": { + "type": "boolean", + "description": "[Hidden order](https://www.kucoin.com/docs-new/doc-338146) or not (not shown in order book)", + "default": false + }, + "iceberg": { + "type": "boolean", + "description": "Whether or not only visible portions of orders are shown in [Iceberg orders](https://www.kucoin.com/docs-new/doc-338146)", + "default": false + }, + "visibleSize": { + "type": "string", + "description": "Maximum visible quantity in iceberg orders" + }, + "tags": { + "type": "string", + "description": "Order tag, length cannot exceed 20 characters (ASCII)" + }, + "cancelAfter": { + "type": "integer", + "format": "int64", + "description": "Cancel after n seconds,the order timing strategy is GTT" + }, + "funds": { + "type": "string", + "description": "When **type** is market, select one out of two: size or funds" + } + }, + "required": [ + "symbol", + "type", + "side" + ] + }, + "example": "//limit order\n{\n \"type\": \"limit\",\n \"symbol\": \"BTC-USDT\",\n \"side\": \"buy\",\n \"price\": \"50000\",\n \"size\": \"0.00001\",\n \"clientOid\": \"5c52e11203aa677f33e493fb\",\n \"remark\": \"order remarks\"\n}\n\n//market order 1\n// {\n// \"type\": \"market\",\n// \"symbol\": \"BTC-USDT\",\n// \"side\": \"buy\",\n// \"size\": \"0.00001\",\n// \"clientOid\": \"5c52e11203aa677f33e493fc\",\n// \"remark\": \"order remarks\"\n// }\n\n//market order 2\n// {\n// \"type\": \"market\",\n// \"symbol\": \"BTC-USDT\",\n// \"side\": \"buy\",\n// \"funds\": \"1\",\n// \"clientOid\": \"5c52e11203aa677f33e493fc\",\n// \"remark\": \"order remarks\"\n// }\n" + } + } + }, + "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"orderId\\\":\\\"670fd33bf9406e0007ab3945\\\",\\\"clientOid\\\":\\\"5c52e11203aa677f33e493fb\\\"}}", + "x-request-example": "{\\\"type\\\": \\\"limit\\\", \\\"symbol\\\": \\\"BTC-USDT\\\", \\\"side\\\": \\\"buy\\\", \\\"price\\\": \\\"50000\\\", \\\"size\\\": \\\"0.00001\\\", \\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\", \\\"remark\\\": \\\"order remarks\\\"}" + }, "delete": { "summary": "Cancel All Orders By Symbol", "deprecated": false, @@ -7767,11 +6241,13 @@ "x-api-rate-limit": 2, "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":\\\"success\\\"}", "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\"}" - }, + } + }, + "/api/v1/hf/orders/sync": { "post": { - "summary": "Add Order", + "summary": "Add Order Sync", "deprecated": false, - "description": "Place order to the Spot trading system, you can place two major types of orders: limit and market. Orders can only be placed if your account has sufficient funds. Once an order is placed, your funds will be put on hold for the duration of the order. The amount of funds on hold depends on the order type and parameters specified.", + "description": "Place order to the spot trading system The difference between this interface and \"Add order\" is that this interface will synchronously return the order information after the order matching is completed. For higher latency requirements, please select the \"Add order\" interface. If there is a requirement for returning data integrity, please select this interface", "tags": [], "parameters": [], "responses": { @@ -7790,16 +6266,67 @@ "properties": { "orderId": { "type": "string", - "description": "The unique order id generated by the trading system,which can be used later for further actions such as canceling the order." + "description": "The unique order id generated by the trading system,which can be used later for further actions such as canceling the order." + }, + "clientOid": { + "type": "string", + "description": "The user self-defined order id." + }, + "orderTime": { + "type": "integer", + "format": "int64" + }, + "originSize": { + "type": "string", + "description": "original order size" + }, + "dealSize": { + "type": "string", + "description": "deal size" + }, + "remainSize": { + "type": "string", + "description": "remain size" }, - "clientOid": { + "canceledSize": { "type": "string", - "description": "The user self-defined order id." + "description": "Cumulative canceled size" + }, + "status": { + "type": "string", + "description": "Order Status. open:order is active; done:order has been completed", + "enum": [ + "open", + "done" + ], + "x-api-enum": [ + { + "value": "open", + "name": "", + "description": "" + }, + { + "value": "done", + "name": "", + "description": "" + } + ] + }, + "matchTime": { + "type": "integer", + "format": "int64" } }, "required": [ "orderId", - "clientOid" + "clientOid", + "orderTime", + "originSize", + "dealSize", + "remainSize", + "canceledSize", + "status", + "matchTime" ] } }, @@ -7812,7 +6339,7 @@ } } }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470188", + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470170", "x-abandon": "normal", "x-domain": "Spot", "x-api-channel": "Private", @@ -7820,8 +6347,8 @@ "x-api-rate-limit-pool": "Spot", "x-sdk-service": "Spot", "x-sdk-sub-service": "Order", - "x-sdk-method-name": "addOrder", - "x-sdk-method-description": "Place order to the Spot trading system, you can place two major types of orders: limit and market. Orders can only be placed if your account has sufficient funds. Once an order is placed, your funds will be put on hold for the duration of the order. The amount of funds on hold depends on the order type and parameters specified.", + "x-sdk-method-name": "addOrderSync", + "x-sdk-method-description": "Place order to the spot trading system The difference between this interface and \"Add order\" is that this interface will synchronously return the order information after the order matching is completed. For higher latency requirements, please select the \"Add order\" interface. If there is a requirement for returning data integrity, please select this interface", "x-api-rate-limit": 1, "requestBody": { "content": { @@ -8007,19 +6534,19 @@ "side" ] }, - "example": "//limit order\n{\n \"type\": \"limit\",\n \"symbol\": \"BTC-USDT\",\n \"side\": \"buy\",\n \"price\": \"50000\",\n \"size\": \"0.00001\",\n \"clientOid\": \"5c52e11203aa677f33e493fb\",\n \"remark\": \"order remarks\"\n}\n\n//market order 1\n// {\n// \"type\": \"market\",\n// \"symbol\": \"BTC-USDT\",\n// \"side\": \"buy\",\n// \"size\": \"0.00001\",\n// \"clientOid\": \"5c52e11203aa677f33e493fc\",\n// \"remark\": \"order remarks\"\n// }\n\n//market order 2\n// {\n// \"type\": \"market\",\n// \"symbol\": \"BTC-USDT\",\n// \"side\": \"buy\",\n// \"funds\": \"1\",\n// \"clientOid\": \"5c52e11203aa677f33e493fc\",\n// \"remark\": \"order remarks\"\n// }\n" + "example": "//limit order\n{\n \"type\": \"limit\",\n \"symbol\": \"BTC-USDT\",\n \"side\": \"buy\",\n \"price\": \"50000\",\n \"size\": \"0.00001\",\n \"clientOid\": \"5c52e11203aa677f33e493f\",\n \"remark\": \"order remarks\"\n}\n\n//market order 1\n// {\n// \"type\": \"market\",\n// \"symbol\": \"BTC-USDT\",\n// \"side\": \"buy\",\n// \"size\": \"0.00001\",\n// \"clientOid\": \"5c52e11203aa677f33e493fc\",\n// \"remark\": \"order remarks\",\n// }\n\n//market order 2\n// {\n// \"type\": \"market\",\n// \"symbol\": \"BTC-USDT\",\n// \"side\": \"buy\",\n// \"funds\": \"1\",\n// \"clientOid\": \"5c52e11203aa677f33e493fc\",\n// \"remark\": \"order remarks\",\n// }\n" } } }, - "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"orderId\\\":\\\"670fd33bf9406e0007ab3945\\\",\\\"clientOid\\\":\\\"5c52e11203aa677f33e493fb\\\"}}", - "x-request-example": "{\\\"type\\\": \\\"limit\\\", \\\"symbol\\\": \\\"BTC-USDT\\\", \\\"side\\\": \\\"buy\\\", \\\"price\\\": \\\"50000\\\", \\\"size\\\": \\\"0.00001\\\", \\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\", \\\"remark\\\": \\\"order remarks\\\"}" + "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"orderId\\\":\\\"67111a7cb7cbdf000703e1f6\\\",\\\"clientOid\\\":\\\"5c52e11203aa677f33e493f\\\",\\\"orderTime\\\":1729174140586,\\\"originSize\\\":\\\"0.00001\\\",\\\"dealSize\\\":\\\"0\\\",\\\"remainSize\\\":\\\"0.00001\\\",\\\"canceledSize\\\":\\\"0\\\",\\\"status\\\":\\\"open\\\",\\\"matchTime\\\":1729174140588}}", + "x-request-example": "{\\\"type\\\": \\\"limit\\\", \\\"symbol\\\": \\\"BTC-USDT\\\", \\\"side\\\": \\\"buy\\\", \\\"price\\\": \\\"50000\\\", \\\"size\\\": \\\"0.00001\\\", \\\"clientOid\\\": \\\"5c52e11203aa677f33e493f\\\", \\\"remark\\\": \\\"order remarks\\\"}" } }, - "/api/v1/hf/orders/cancelAll": { - "delete": { - "summary": "Cancel All Orders", + "/api/v1/hf/orders/test": { + "post": { + "summary": "Add Order Test", "deprecated": false, - "description": "This endpoint can cancel all spot orders for all symbol. This endpoint only sends cancellation requests. The results of the requests must be obtained by checking the order status or subscribing to websocket.", + "description": "Order test endpoint, the request parameters and return parameters of this endpoint are exactly the same as the order endpoint, and can be used to verify whether the signature is correct and other operations. After placing an order, the order will not enter the matching system, and the order cannot be queried.", "tags": [], "parameters": [], "responses": { @@ -8036,82 +6563,240 @@ "data": { "type": "object", "properties": { - "succeedSymbols": { - "type": "array", - "items": { - "type": "string" - }, - "description": "The Symbols Successfully cancelled" + "orderId": { + "type": "string", + "description": "The unique order id generated by the trading system,which can be used later for further actions such as canceling the order." }, - "failedSymbols": { - "type": "array", - "items": { - "type": "object", - "properties": { - "symbol": { - "type": "string", - "description": "symbol", - "example": [ - "BTC-USDT", - "ETH-USDT", - "KCS-USDT" - ] - }, - "error": { - "type": "string", - "description": "error message" - } - } - }, - "description": "The Symbols Failed to cancel" + "clientOid": { + "type": "string", + "description": "The user self-defined order id." } }, - "required": [ - "succeedSymbols", - "failedSymbols" - ] - } + "required": [ + "orderId", + "clientOid" + ] + } + }, + "required": [ + "code", + "data" + ] + } + } + } + } + }, + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470187", + "x-abandon": "normal", + "x-domain": "Spot", + "x-api-channel": "Private", + "x-api-permission": "Spot", + "x-api-rate-limit-pool": "Spot", + "x-sdk-service": "Spot", + "x-sdk-sub-service": "Order", + "x-sdk-method-name": "addOrderTest", + "x-sdk-method-description": "Order test endpoint, the request parameters and return parameters of this endpoint are exactly the same as the order endpoint, and can be used to verify whether the signature is correct and other operations. After placing an order, the order will not enter the matching system, and the order cannot be queried.", + "x-api-rate-limit": 1, + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "clientOid": { + "type": "string", + "description": "Client Order Id,The ClientOid field is a unique ID created by the user(we recommend using a UUID), and can only contain numbers, letters, underscores (_), and hyphens (-). This field is returned when order information is obtained. You can use clientOid to tag your orders. ClientOid is different from the order ID created by the service provider. Please do not initiate requests using the same clientOid. The maximum length for the ClientOid is 40 characters.\n\nPlease remember the orderId created by the service provider, it used to check for updates in order status.", + "example": [ + "5c52e11203aa677f33e493fb" + ] + }, + "side": { + "type": "string", + "description": "specify if the order is to 'buy' or 'sell'", + "enum": [ + "buy", + "sell" + ], + "x-api-enum": [ + { + "value": "buy", + "name": "", + "description": "" + }, + { + "value": "sell", + "name": "", + "description": "" + } + ], + "example": [ + "buy" + ] + }, + "symbol": { + "type": "string", + "description": "symbol", + "example": [ + "BTC-USDT", + "ETH-USDT", + "KCS-USDT" + ] + }, + "type": { + "type": "string", + "description": "specify if the order is an 'limit' order or 'market' order. \n\nThe type of order you specify when you place your order determines whether or not you need to request other parameters and also affects the execution of the matching engine.\n\nWhen placing a limit order, you must specify a price and size. The system will try to match the order according to market price or a price better than market price. If the order cannot be immediately matched, it will stay in the order book until it is matched or the user cancels.\n\nUnlike limit orders, the price for market orders fluctuates with market prices. When placing a market order, you do not need to specify a price, you only need to specify a quantity. Market orders are filled immediately and will not enter the order book. All market orders are takers and a taker fee will be charged.", + "enum": [ + "limit", + "market" + ], + "x-api-enum": [ + { + "value": "limit", + "name": "", + "description": "" + }, + { + "value": "market", + "name": "", + "description": "" + } + ], + "example": [ + "limit" + ] + }, + "remark": { + "type": "string", + "description": "Order placement remarks, length cannot exceed 20 characters (ASCII)" + }, + "stp": { + "type": "string", + "description": "[Self Trade Prevention](https://www.kucoin.com/docs-new/doc-338146) is divided into four strategies: CN, CO, CB , and DC", + "enum": [ + "DC", + "CO", + "CN", + "CB" + ], + "x-api-enum": [ + { + "value": "DC", + "name": "", + "description": "" + }, + { + "value": "CO", + "name": "", + "description": "" + }, + { + "value": "CN", + "name": "", + "description": "" + }, + { + "value": "CB", + "name": "", + "description": "" + } + ] + }, + "price": { + "type": "string", + "description": "Specify price for order\n\nWhen placing a limit order, the price must be based on priceIncrement for the trading pair. The price increment (priceIncrement) is the price precision for the trading pair. For example, for the BTC-USDT trading pair, the priceIncrement is 0.00001000. So the price for your orders cannot be less than 0.00001000 and must be a multiple of priceIncrement. Otherwise, the order will return an invalid priceIncrement error." + }, + "size": { + "type": "string", + "description": "Specify quantity for order\n\nWhen **type** is limit, size refers to the amount of trading targets (the asset name written in front) for the trading pair. Teh Size must be based on the baseIncrement of the trading pair. The baseIncrement represents the precision for the trading pair. The size of an order must be a positive-integer multiple of baseIncrement and must be between baseMinSize and baseMaxSize.\n\nWhen **type** is market, select one out of two: size or funds" + }, + "timeInForce": { + "type": "string", + "description": "[Time in force](https://www.kucoin.com/docs-new/doc-338146) is a special strategy used during trading", + "enum": [ + "GTC", + "GTT", + "IOC", + "FOK" + ], + "default": "GTC", + "x-api-enum": [ + { + "value": "GTC", + "name": "", + "description": "" + }, + { + "value": "GTT", + "name": "", + "description": "" + }, + { + "value": "IOC", + "name": "", + "description": "" + }, + { + "value": "FOK", + "name": "", + "description": "" + } + ] }, - "required": [ - "code", - "data" - ] - } - } + "postOnly": { + "type": "boolean", + "default": false, + "description": "passive order labels, this is disabled when the order timing strategy is IOC or FOK" + }, + "hidden": { + "type": "boolean", + "description": "[Hidden order](https://www.kucoin.com/docs-new/doc-338146) or not (not shown in order book)", + "default": false + }, + "iceberg": { + "type": "boolean", + "description": "Whether or not only visible portions of orders are shown in [Iceberg orders](https://www.kucoin.com/docs-new/doc-338146)", + "default": false + }, + "visibleSize": { + "type": "string", + "description": "Maximum visible quantity in iceberg orders" + }, + "tags": { + "type": "string", + "description": "Order tag, length cannot exceed 20 characters (ASCII)" + }, + "cancelAfter": { + "type": "integer", + "format": "int64", + "description": "Cancel after n seconds,the order timing strategy is GTT" + }, + "funds": { + "type": "string", + "description": "When **type** is market, select one out of two: size or funds" + } + }, + "required": [ + "symbol", + "type", + "side" + ] + }, + "example": "//limit order\n{\n \"type\": \"limit\",\n \"symbol\": \"BTC-USDT\",\n \"side\": \"buy\",\n \"price\": \"50000\",\n \"size\": \"0.00001\",\n \"clientOid\": \"5c52e11203aa677f33e493f\",\n \"remark\": \"order remarks\"\n}\n\n//market order 1\n// {\n// \"type\": \"market\",\n// \"symbol\": \"BTC-USDT\",\n// \"side\": \"buy\",\n// \"size\": \"0.00001\",\n// \"clientOid\": \"5c52e11203aa677f33e493fc\",\n// \"remark\": \"order remarks\",\n// }\n\n//market order 2\n// {\n// \"type\": \"market\",\n// \"symbol\": \"BTC-USDT\",\n// \"side\": \"buy\",\n// \"funds\": \"1\",\n// \"clientOid\": \"5c52e11203aa677f33e493fc\",\n// \"remark\": \"order remarks\",\n// }\n" } } }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470176", - "x-abandon": "normal", - "x-domain": "Spot", - "x-api-channel": "Private", - "x-api-permission": "Spot", - "x-api-rate-limit-pool": "Spot", - "x-sdk-service": "Spot", - "x-sdk-sub-service": "Order", - "x-sdk-method-name": "cancelAllOrders", - "x-sdk-method-description": "This endpoint can cancel all spot orders for all symbol. This endpoint only sends cancellation requests. The results of the requests must be obtained by checking the order status or subscribing to websocket.", - "x-api-rate-limit": 30, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"succeedSymbols\\\": [\\n \\\"ETH-USDT\\\",\\n \\\"BTC-USDT\\\"\\n ],\\n \\\"failedSymbols\\\": []\\n }\\n}" + "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"orderId\\\":\\\"670fd33bf9406e0007ab3945\\\",\\\"clientOid\\\":\\\"5c52e11203aa677f33e493fb\\\"}}", + "x-request-example": "{\\\"type\\\": \\\"limit\\\", \\\"symbol\\\": \\\"BTC-USDT\\\", \\\"side\\\": \\\"buy\\\", \\\"price\\\": \\\"50000\\\", \\\"size\\\": \\\"0.00001\\\", \\\"clientOid\\\": \\\"5c52e11203aa677f33e493f\\\", \\\"remark\\\": \\\"order remarks\\\"}" } }, - "/api/v3/oco/order/{orderId}": { - "delete": { - "summary": "Cancel OCO Order By OrderId", - "deprecated": true, - "description": "This endpoint can be used to cancel a spot order by orderId. This endpoint only sends cancellation requests. The results of the requests must be obtained by checking the order status or subscribing to websocket.", + "/api/v1/hf/orders/multi": { + "post": { + "summary": "Batch Add Orders", + "deprecated": false, + "description": "This endpoint supports sequential batch order placement from a single endpoint. A maximum of 5orders can be placed simultaneously. The order types must be limit orders of the same trading pair", "tags": [], - "parameters": [ - { - "name": "orderId", - "in": "path", - "description": "The unique order id generated by the trading system", - "required": true, - "schema": { - "type": "string" - } - } - ], + "parameters": [], "responses": { "200": { "description": "", @@ -8124,19 +6809,31 @@ "type": "string" }, "data": { - "type": "object", - "properties": { - "cancelledOrderIds": { - "type": "array", - "items": { - "type": "string" + "type": "array", + "items": { + "type": "object", + "properties": { + "orderId": { + "type": "string", + "description": "The unique order id generated by the trading system,which can be used later for further actions such as canceling the order." }, - "description": "List of two order IDs related to the canceled OCO order" - } - }, - "required": [ - "cancelledOrderIds" - ] + "clientOid": { + "type": "string", + "description": "The user self-defined order id." + }, + "success": { + "type": "boolean", + "description": "Add order success/failure" + }, + "failMsg": { + "type": "string", + "description": "error message" + } + }, + "required": [ + "success" + ] + } } }, "required": [ @@ -8148,490 +6845,890 @@ } } }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470354", - "x-abandon": "abandon", + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470168", + "x-abandon": "normal", "x-domain": "Spot", "x-api-channel": "Private", "x-api-permission": "Spot", "x-api-rate-limit-pool": "Spot", "x-sdk-service": "Spot", "x-sdk-sub-service": "Order", - "x-sdk-method-name": "cancelOcoOrderByOrderId", - "x-sdk-method-description": "This endpoint can be used to cancel a spot order by orderId. This endpoint only sends cancellation requests. The results of the requests must be obtained by checking the order status or subscribing to websocket.", - "x-api-rate-limit": 3, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"cancelledOrderIds\\\": [\\n \\\"vs93gpqc6kkmkk57003gok16\\\",\\n \\\"vs93gpqc6kkmkk57003gok17\\\"\\n ]\\n }\\n}", - "x-request-example": "{\\\"orderId\\\": \\\"674c316e688dea0007c7b986\\\"}" - }, - "get": { - "summary": "Get OCO Order By OrderId", - "deprecated": true, - "description": "Request via this interface to get a oco order information via the order ID.", - "tags": [], - "parameters": [ - { - "name": "orderId", - "in": "path", - "description": "The unique order id generated by the trading system", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "data": { + "x-sdk-method-name": "batchAddOrders", + "x-sdk-method-description": "This endpoint supports sequential batch order placement from a single endpoint. A maximum of 5orders can be placed simultaneously. The order types must be limit orders of the same trading pair", + "x-api-rate-limit": 1, + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "orderList": { + "type": "array", + "items": { "type": "object", "properties": { + "clientOid": { + "type": "string", + "description": "Client Order Id,The ClientOid field is a unique ID created by the user(we recommend using a UUID), and can only contain numbers, letters, underscores (_), and hyphens (-). This field is returned when order information is obtained. You can use clientOid to tag your orders. ClientOid is different from the order ID created by the service provider. Please do not initiate requests using the same clientOid. The maximum length for the ClientOid is 40 characters.\n" + }, "symbol": { "type": "string", - "description": "symbol" + "description": "symbol", + "example": [ + "BTC-USDT", + "ETH-USDT", + "KCS-USDT" + ] + }, + "type": { + "type": "string", + "description": "Specify if the order is an 'limit' order or 'market' order. ", + "enum": [ + "limit" + ], + "x-api-enum": [ + { + "value": "limit", + "name": "", + "description": "" + } + ] + }, + "timeInForce": { + "type": "string", + "description": "[Time in force](https://www.kucoin.com/docs-new/doc-338146) is a special strategy used during trading", + "enum": [ + "GTC", + "GTT", + "IOC", + "FOK" + ], + "default": "GTC", + "x-api-enum": [ + { + "value": "GTC", + "name": "", + "description": "" + }, + { + "value": "GTT", + "name": "", + "description": "" + }, + { + "value": "IOC", + "name": "", + "description": "" + }, + { + "value": "FOK", + "name": "", + "description": "" + } + ] + }, + "side": { + "type": "string", + "description": "Specify if the order is to 'buy' or 'sell'", + "enum": [ + "buy", + "sell" + ], + "x-api-enum": [ + { + "value": "buy", + "name": "", + "description": "" + }, + { + "value": "sell", + "name": "", + "description": "" + } + ] }, - "clientOid": { + "price": { "type": "string", - "description": "Client Order Id" + "description": "Specify price for order" }, - "orderId": { + "size": { "type": "string", - "description": "The unique order id generated by the trading system,which can be used later for further actions such as canceling the order." - }, - "orderTime": { - "type": "integer", - "description": "Order placement time, milliseconds", - "format": "int64" + "description": "Specify quantity for order\n\nWhen **type** is limit, select one out of two: size or funds, size refers to the amount of trading targets (the asset name written in front) for the trading pair. Teh Size must be based on the baseIncrement of the trading pair. The baseIncrement represents the precision for the trading pair. The size of an order must be a positive-integer multiple of baseIncrement and must be between baseMinSize and baseMaxSize.\n\nWhen **type** is market, select one out of two: size or funds" }, - "status": { + "stp": { "type": "string", - "description": "Order status: NEW: New, DONE: Completed, TRIGGERED: Triggered, CANCELLED: Cancelled", + "description": "[Self Trade Prevention](https://www.kucoin.com/docs-new/doc-338146) is divided into four strategies: CN, CO, CB , and DC", "enum": [ - "NEW", - "DONE", - "TRIGGERED", - "CANCELLED" + "DC", + "CO", + "CN", + "CB" ], "x-api-enum": [ { - "value": "NEW", - "name": "NEW", - "description": "New" + "value": "DC", + "name": "", + "description": "" }, { - "value": "DONE", - "name": "DONE", - "description": "Completed" + "value": "CO", + "name": "", + "description": "" }, { - "value": "TRIGGERED", - "name": "TRIGGERED", - "description": "Triggered" + "value": "CN", + "name": "", + "description": "" }, { - "value": "CANCELLED", - "name": "CANCELLED", - "description": "Cancelled" + "value": "CB", + "name": "", + "description": "" } ] + }, + "cancelAfter": { + "type": "integer", + "description": "Cancel after n seconds,the order timing strategy is GTT", + "format": "int64" + }, + "postOnly": { + "type": "boolean", + "default": false, + "description": "passive order labels, this is disabled when the order timing strategy is IOC or FOK" + }, + "hidden": { + "type": "boolean", + "description": "[Hidden order](https://www.kucoin.com/docs-new/doc-338146) or not (not shown in order book)", + "default": false + }, + "iceberg": { + "type": "boolean", + "description": "Whether or not only visible portions of orders are shown in [Iceberg orders](https://www.kucoin.com/docs-new/doc-338146)", + "default": false + }, + "visibleSize": { + "type": "string", + "description": "Maximum visible quantity in iceberg orders" + }, + "tags": { + "type": "string", + "description": "Order tag, length cannot exceed 20 characters (ASCII)" + }, + "remark": { + "type": "string", + "description": "Order placement remarks, length cannot exceed 20 characters (ASCII)" + }, + "funds": { + "type": "string", + "description": "When **type** is market, select one out of two: size or funds" } }, "required": [ - "orderId", + "type", "symbol", - "clientOid", - "orderTime", - "status" - ] - } - }, - "required": [ - "code", - "data" - ] - } - } - } - } - }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470357", - "x-abandon": "abandon", - "x-domain": "Spot", - "x-api-channel": "Private", - "x-api-permission": "General", - "x-api-rate-limit-pool": "Spot", - "x-sdk-service": "Spot", - "x-sdk-sub-service": "Order", - "x-sdk-method-name": "getOcoOrderByOrderId", - "x-sdk-method-description": "Request via this interface to get a oco order information via the order ID.", - "x-api-rate-limit": 2, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"orderId\\\": \\\"674c3b6e688dea0007c7bab2\\\",\\n \\\"symbol\\\": \\\"BTC-USDT\\\",\\n \\\"clientOid\\\": \\\"5c52e1203aa6f37f1e493fb\\\",\\n \\\"orderTime\\\": 1733049198863,\\n \\\"status\\\": \\\"NEW\\\"\\n }\\n}", - "x-request-example": "{\\\"orderId\\\": \\\"674c3b6e688dea0007c7bab2\\\"}" - } - }, - "/api/v1/hf/orders/active/symbols": { - "get": { - "summary": "Get Symbols With Open Order", - "deprecated": false, - "description": "This interface can query all spot symbol that has active orders", - "tags": [], - "parameters": [], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "data": { - "type": "object", - "properties": { - "symbols": { - "type": "array", - "items": { - "type": "string" - }, - "description": "The symbol that has active orders" - } - }, - "required": [ - "symbols" + "side", + "price" ] - } - }, - "required": [ - "code", - "data" - ] - } - } - } - } - }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470177", - "x-abandon": "normal", - "x-domain": "Spot", - "x-api-channel": "Private", - "x-api-permission": "Spot", - "x-api-rate-limit-pool": "Spot", - "x-sdk-service": "Spot", - "x-sdk-sub-service": "Order", - "x-sdk-method-name": "getSymbolsWithOpenOrder", - "x-sdk-method-description": "This interface can query all spot symbol that has active orders", - "x-api-rate-limit": 2, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"symbols\\\": [\\n \\\"ETH-USDT\\\",\\n \\\"BTC-USDT\\\"\\n ]\\n }\\n}" - } - }, - "/api/v1/hf/orders/active": { - "get": { - "summary": "Get Open Orders", - "deprecated": false, - "description": "This interface is to obtain all Spot active order lists, and the return value of the active order interface is the paged data of all uncompleted order lists. The returned data is sorted in descending order according to the latest update time of the order. After the user successfully places an order, the order is in Active state, and the user can use inOrderBook to determine whether the order has entered the order. Canceled or fully filled orders are marked as completed Done status.", - "tags": [], - "parameters": [ - { - "name": "symbol", - "in": "query", - "description": "symbol", - "required": true, - "schema": { - "type": "string", - "example": [ - "BTC-USDT", - "ETH-USDT", - "KCS-USDT" - ] - } - } - ], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "type": "string" }, - "data": { - "type": "array", - "items": { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "The unique order id generated by the trading system" - }, - "symbol": { - "type": "string", - "description": "symbol", - "example": [ - "BTC-USDT", - "ETH-USDT", - "KCS-USDT" - ] - }, - "opType": { - "type": "string" - }, - "type": { - "type": "string", - "description": "Specify if the order is an 'limit' order or 'market' order. ", - "enum": [ - "limit", - "market" - ], - "x-api-enum": [ - { - "value": "limit", - "name": "", - "description": "" - }, - { - "value": "market", - "name": "", - "description": "" - } - ] - }, - "side": { + "description": "Order List" + } + }, + "required": [ + "orderList" + ] + }, + "example": "{\n \"orderList\": [\n {\n \"clientOid\": \"client order id 12\",\n \"symbol\": \"BTC-USDT\",\n \"type\": \"limit\",\n \"side\": \"buy\",\n \"price\": \"30000\",\n \"size\": \"0.00001\"\n },\n {\n \"clientOid\": \"client order id 13\",\n \"symbol\": \"ETH-USDT\",\n \"type\": \"limit\",\n \"side\": \"sell\",\n \"price\": \"2000\",\n \"size\": \"0.00001\"\n }\n ]\n}" + } + } + }, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": [\\n {\\n \\\"orderId\\\": \\\"6710d8336afcdb0007319c27\\\",\\n \\\"clientOid\\\": \\\"client order id 12\\\",\\n \\\"success\\\": true\\n },\\n {\\n \\\"success\\\": false,\\n \\\"failMsg\\\": \\\"The order funds should more then 0.1 USDT.\\\"\\n }\\n ]\\n}", + "x-request-example": "{\\\"orderList\\\": [{\\\"clientOid\\\": \\\"client order id 12\\\", \\\"symbol\\\": \\\"BTC-USDT\\\", \\\"type\\\": \\\"limit\\\", \\\"side\\\": \\\"buy\\\", \\\"price\\\": \\\"30000\\\", \\\"size\\\": \\\"0.00001\\\"}, {\\\"clientOid\\\": \\\"client order id 13\\\", \\\"symbol\\\": \\\"ETH-USDT\\\", \\\"type\\\": \\\"limit\\\", \\\"side\\\": \\\"sell\\\", \\\"price\\\": \\\"2000\\\", \\\"size\\\": \\\"0.00001\\\"}]}" + } + }, + "/api/v1/hf/orders/multi/sync": { + "post": { + "summary": "Batch Add Orders Sync", + "deprecated": false, + "description": "This endpoint supports sequential batch order placement from a single endpoint. A maximum of 5orders can be placed simultaneously. The order types must be limit orders of the same trading pair", + "tags": [], + "parameters": [], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "array", + "items": { + "type": "object", + "properties": { + "orderId": { "type": "string", - "description": "Buy or sell", - "enum": [ - "buy", - "sell" - ], - "x-api-enum": [ - { - "value": "buy", - "name": "", - "description": "" - }, - { - "value": "sell", - "name": "", - "description": "" - } - ] + "description": "The unique order id generated by the trading system,which can be used later for further actions such as canceling the order." }, - "price": { + "clientOid": { "type": "string", - "description": "Order price" + "description": "The user self-defined order id." }, - "size": { - "type": "string", - "description": "Order size" + "orderTime": { + "type": "integer", + "format": "int64" }, - "funds": { + "originSize": { "type": "string", - "description": "Order Funds" + "description": "original order size" }, "dealSize": { "type": "string", - "description": "Number of filled transactions" - }, - "dealFunds": { - "type": "string", - "description": "Funds of filled transactions" - }, - "fee": { - "type": "string", - "description": "[Handling fees](https://www.kucoin.com/docs-new/api-5327739)" + "description": "deal size" }, - "feeCurrency": { + "remainSize": { "type": "string", - "description": "currency used to calculate trading fee" + "description": "remain size" }, - "stp": { + "canceledSize": { "type": "string", - "description": "[Self Trade Prevention](https://www.kucoin.com/docs-new/api-5176570)", - "enum": [ - "DC", - "CO", - "CN", - "CB" - ], - "x-api-enum": [ - { - "value": "DC", - "name": "", - "description": "" - }, - { - "value": "CO", - "name": "", - "description": "" - }, - { - "value": "CN", - "name": "", - "description": "" - }, - { - "value": "CB", - "name": "", - "description": "" - } - ] + "description": "Cumulative canceled size" }, - "timeInForce": { + "status": { "type": "string", - "description": "Time in force", + "description": "Order Status. open:order is active; done:order has been completed", "enum": [ - "GTC", - "GTT", - "IOC", - "FOK" + "open", + "done" ], "x-api-enum": [ { - "value": "GTC", - "name": "", - "description": "" - }, - { - "value": "GTT", - "name": "", - "description": "" - }, - { - "value": "IOC", + "value": "open", "name": "", "description": "" }, { - "value": "FOK", + "value": "done", "name": "", "description": "" } ] }, - "postOnly": { - "type": "boolean", - "description": "Whether its a postOnly order." - }, - "hidden": { - "type": "boolean", - "description": "Whether its a hidden order." - }, - "iceberg": { - "type": "boolean", - "description": "Whether its a iceberg order." - }, - "visibleSize": { - "type": "string", - "description": "Visible size of iceberg order in order book." - }, - "cancelAfter": { - "type": "integer", - "description": "A GTT timeInForce that expires in n seconds" - }, - "channel": { - "type": "string" - }, - "clientOid": { - "type": "string", - "description": "Client Order Id,unique identifier created by the user" - }, - "remark": { - "type": "string", - "description": "Order placement remarks" - }, - "tags": { - "type": "string", - "description": "Order tag" - }, - "cancelExist": { - "type": "boolean", - "description": "Whether there is a cancellation record for the order." - }, - "createdAt": { - "type": "integer", - "format": "int64" - }, - "lastUpdatedAt": { + "matchTime": { "type": "integer", "format": "int64" }, - "tradeType": { - "type": "string", - "description": "Trade type, redundancy param" - }, - "inOrderBook": { + "success": { "type": "boolean", - "description": "Whether to enter the orderbook: true: enter the orderbook; false: not enter the orderbook" - }, - "cancelledSize": { - "type": "string", - "description": "Number of canceled transactions" - }, - "cancelledFunds": { - "type": "string", - "description": "Funds of canceled transactions" - }, - "remainSize": { - "type": "string", - "description": "Number of remain transactions" - }, - "remainFunds": { - "type": "string", - "description": "Funds of remain transactions" + "description": "Add order success/failure" }, - "tax": { + "failMsg": { "type": "string", - "description": "Users in some regions need query this field" - }, - "active": { - "type": "boolean", - "description": "Order status: true-The status of the order isactive; false-The status of the order is done" + "description": "error message" } }, - "required": [ - "id", - "symbol", - "opType", - "type", - "side", - "price", - "size", - "funds", - "dealSize", - "dealFunds", - "fee", - "feeCurrency", - "timeInForce", - "postOnly", - "hidden", - "iceberg", - "visibleSize", - "cancelAfter", - "channel", - "clientOid", - "cancelExist", - "tradeType", - "inOrderBook", - "cancelledSize", - "cancelledFunds", - "remainSize", - "remainFunds", - "active", - "createdAt", - "lastUpdatedAt", - "tax" - ] - } + "required": [ + "success" + ] + } + } + }, + "required": [ + "code", + "data" + ] + } + } + } + } + }, + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470169", + "x-abandon": "normal", + "x-domain": "Spot", + "x-api-channel": "Private", + "x-api-permission": "Spot", + "x-api-rate-limit-pool": "Spot", + "x-sdk-service": "Spot", + "x-sdk-sub-service": "Order", + "x-sdk-method-name": "batchAddOrdersSync", + "x-sdk-method-description": "This endpoint supports sequential batch order placement from a single endpoint. A maximum of 5orders can be placed simultaneously. The order types must be limit orders of the same trading pair", + "x-api-rate-limit": 1, + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "orderList": { + "type": "array", + "items": { + "type": "object", + "properties": { + "clientOid": { + "type": "string", + "description": "Client Order Id,The ClientOid field is a unique ID created by the user(we recommend using a UUID), and can only contain numbers, letters, underscores (_), and hyphens (-). This field is returned when order information is obtained. You can use clientOid to tag your orders. ClientOid is different from the order ID created by the service provider. Please do not initiate requests using the same clientOid. The maximum length for the ClientOid is 40 characters.\n" + }, + "symbol": { + "type": "string", + "description": "symbol", + "example": [ + "BTC-USDT", + "ETH-USDT", + "KCS-USDT" + ] + }, + "type": { + "type": "string", + "description": "Specify if the order is an 'limit' order or 'market' order. ", + "enum": [ + "limit" + ], + "x-api-enum": [ + { + "value": "limit", + "name": "", + "description": "" + } + ] + }, + "timeInForce": { + "type": "string", + "description": "[Time in force](https://www.kucoin.com/docs-new/doc-338146) is a special strategy used during trading", + "enum": [ + "GTC", + "GTT", + "IOC", + "FOK" + ], + "default": "GTC", + "x-api-enum": [ + { + "value": "GTC", + "name": "", + "description": "" + }, + { + "value": "GTT", + "name": "", + "description": "" + }, + { + "value": "IOC", + "name": "", + "description": "" + }, + { + "value": "FOK", + "name": "", + "description": "" + } + ] + }, + "side": { + "type": "string", + "description": "Specify if the order is to 'buy' or 'sell'", + "enum": [ + "buy", + "sell" + ], + "x-api-enum": [ + { + "value": "buy", + "name": "", + "description": "" + }, + { + "value": "sell", + "name": "", + "description": "" + } + ] + }, + "price": { + "type": "string", + "description": "Specify price for order" + }, + "size": { + "type": "string", + "description": "Specify quantity for order\n\nWhen **type** is limit, select one out of two: size or funds, size refers to the amount of trading targets (the asset name written in front) for the trading pair. Teh Size must be based on the baseIncrement of the trading pair. The baseIncrement represents the precision for the trading pair. The size of an order must be a positive-integer multiple of baseIncrement and must be between baseMinSize and baseMaxSize.\n\nWhen **type** is market, select one out of two: size or funds" + }, + "stp": { + "type": "string", + "description": "[Self Trade Prevention](https://www.kucoin.com/docs-new/doc-338146) is divided into four strategies: CN, CO, CB , and DC", + "enum": [ + "DC", + "CO", + "CN", + "CB" + ], + "x-api-enum": [ + { + "value": "DC", + "name": "", + "description": "" + }, + { + "value": "CO", + "name": "", + "description": "" + }, + { + "value": "CN", + "name": "", + "description": "" + }, + { + "value": "CB", + "name": "", + "description": "" + } + ] + }, + "cancelAfter": { + "type": "integer", + "description": "Cancel after n seconds,the order timing strategy is GTT", + "format": "int64" + }, + "postOnly": { + "type": "boolean", + "default": false, + "description": "passive order labels, this is disabled when the order timing strategy is IOC or FOK" + }, + "hidden": { + "type": "boolean", + "description": "[Hidden order](https://www.kucoin.com/docs-new/doc-338146) or not (not shown in order book)", + "default": false + }, + "iceberg": { + "type": "boolean", + "description": "Whether or not only visible portions of orders are shown in [Iceberg orders](https://www.kucoin.com/docs-new/doc-338146)", + "default": false + }, + "visibleSize": { + "type": "string", + "description": "Maximum visible quantity in iceberg orders" + }, + "tags": { + "type": "string", + "description": "Order tag, length cannot exceed 20 characters (ASCII)" + }, + "remark": { + "type": "string", + "description": "Order placement remarks, length cannot exceed 20 characters (ASCII)" + }, + "funds": { + "type": "string", + "description": "When **type** is market, select one out of two: size or funds" + } + }, + "required": [ + "type", + "symbol", + "side", + "price" + ] + }, + "description": "Order List" + } + }, + "required": [ + "orderList" + ] + }, + "example": "{\n \"orderList\": [\n {\n \"clientOid\": \"client order id 13\",\n \"symbol\": \"BTC-USDT\",\n \"type\": \"limit\",\n \"side\": \"buy\",\n \"price\": \"30000\",\n \"size\": \"0.00001\"\n },\n {\n \"clientOid\": \"client order id 14\",\n \"symbol\": \"ETH-USDT\",\n \"type\": \"limit\",\n \"side\": \"sell\",\n \"price\": \"2000\",\n \"size\": \"0.00001\"\n }\n ]\n}" + } + } + }, + "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":[{\\\"orderId\\\":\\\"6711195e5584bc0007bd5aef\\\",\\\"clientOid\\\":\\\"client order id 13\\\",\\\"orderTime\\\":1729173854299,\\\"originSize\\\":\\\"0.00001\\\",\\\"dealSize\\\":\\\"0\\\",\\\"remainSize\\\":\\\"0.00001\\\",\\\"canceledSize\\\":\\\"0\\\",\\\"status\\\":\\\"open\\\",\\\"matchTime\\\":1729173854326,\\\"success\\\":true},{\\\"success\\\":false,\\\"failMsg\\\":\\\"The order funds should more then 0.1 USDT.\\\"}]}", + "x-request-example": "{\\\"orderList\\\": [{\\\"clientOid\\\": \\\"client order id 13\\\", \\\"symbol\\\": \\\"BTC-USDT\\\", \\\"type\\\": \\\"limit\\\", \\\"side\\\": \\\"buy\\\", \\\"price\\\": \\\"30000\\\", \\\"size\\\": \\\"0.00001\\\"}, {\\\"clientOid\\\": \\\"client order id 14\\\", \\\"symbol\\\": \\\"ETH-USDT\\\", \\\"type\\\": \\\"limit\\\", \\\"side\\\": \\\"sell\\\", \\\"price\\\": \\\"2000\\\", \\\"size\\\": \\\"0.00001\\\"}]}" + } + }, + "/api/v1/hf/orders/{orderId}": { + "delete": { + "summary": "Cancel Order By OrderId", + "deprecated": false, + "description": "This endpoint can be used to cancel a spot order by orderId. This endpoint only sends cancellation requests. The results of the requests must be obtained by checking the order status or subscribing to websocket.", + "tags": [], + "parameters": [ + { + "name": "orderId", + "in": "path", + "description": "The unique order id generated by the trading system", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "symbol", + "in": "query", + "description": "symbol", + "required": true, + "schema": { + "type": "string", + "example": [ + "BTC-USDT", + "ETH-USDT", + "KCS-USDT" + ] + } + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "object", + "properties": { + "orderId": { + "type": "string", + "description": "order id" + } + }, + "required": [ + "orderId" + ] + } + }, + "required": [ + "code", + "data" + ] + } + } + } + } + }, + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470174", + "x-abandon": "normal", + "x-domain": "Spot", + "x-api-channel": "Private", + "x-api-permission": "Spot", + "x-api-rate-limit-pool": "Spot", + "x-sdk-service": "Spot", + "x-sdk-sub-service": "Order", + "x-sdk-method-name": "cancelOrderByOrderId", + "x-sdk-method-description": "This endpoint can be used to cancel a spot order by orderId. This endpoint only sends cancellation requests. The results of the requests must be obtained by checking the order status or subscribing to websocket.", + "x-api-rate-limit": 1, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"orderId\\\": \\\"671124f9365ccb00073debd4\\\"\\n }\\n}", + "x-request-example": "{\\\"orderId\\\": \\\"671124f9365ccb00073debd4\\\", \\\"symbol\\\": \\\"BTC-USDT\\\"}" + }, + "get": { + "summary": "Get Order By OrderId", + "deprecated": false, + "description": "This endpoint can be used to obtain information for a single Spot order using the order id. After the user successfully places an order, the order is in Active state, and the user can use inOrderBook to determine whether the order has entered the order. Canceled or fully filled orders are marked as completed Done status.", + "tags": [], + "parameters": [ + { + "name": "symbol", + "in": "query", + "description": "symbol", + "required": true, + "schema": { + "type": "string", + "example": [ + "BTC-USDT", + "ETH-USDT", + "KCS-USDT" + ] + } + }, + { + "name": "orderId", + "in": "path", + "description": "The unique order id generated by the trading system", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The unique order id generated by the trading system" + }, + "symbol": { + "type": "string", + "description": "symbol", + "example": [ + "BTC-USDT", + "ETH-USDT", + "KCS-USDT" + ] + }, + "opType": { + "type": "string" + }, + "type": { + "type": "string", + "description": "Specify if the order is an 'limit' order or 'market' order. ", + "enum": [ + "limit", + "market" + ], + "x-api-enum": [ + { + "value": "limit", + "name": "", + "description": "" + }, + { + "value": "market", + "name": "", + "description": "" + } + ] + }, + "side": { + "type": "string", + "description": "Buy or sell", + "enum": [ + "buy", + "sell" + ], + "x-api-enum": [ + { + "value": "buy", + "name": "", + "description": "" + }, + { + "value": "sell", + "name": "", + "description": "" + } + ] + }, + "price": { + "type": "string", + "description": "Order price" + }, + "size": { + "type": "string", + "description": "Order size" + }, + "funds": { + "type": "string", + "description": "Order Funds" + }, + "dealSize": { + "type": "string", + "description": "Number of filled transactions" + }, + "dealFunds": { + "type": "string", + "description": "Funds of filled transactions" + }, + "fee": { + "type": "string", + "description": "[Handling fees](https://www.kucoin.com/docs-new/api-5327739)" + }, + "feeCurrency": { + "type": "string", + "description": "currency used to calculate trading fee" + }, + "stp": { + "type": "string", + "description": "[Self Trade Prevention](https://www.kucoin.com/docs-new/api-5176570)", + "enum": [ + "DC", + "CO", + "CN", + "CB" + ], + "x-api-enum": [ + { + "value": "DC", + "name": "", + "description": "" + }, + { + "value": "CO", + "name": "", + "description": "" + }, + { + "value": "CN", + "name": "", + "description": "" + }, + { + "value": "CB", + "name": "", + "description": "" + } + ] + }, + "timeInForce": { + "type": "string", + "description": "Time in force", + "enum": [ + "GTC", + "GTT", + "IOC", + "FOK" + ], + "x-api-enum": [ + { + "value": "GTC", + "name": "", + "description": "" + }, + { + "value": "GTT", + "name": "", + "description": "" + }, + { + "value": "IOC", + "name": "", + "description": "" + }, + { + "value": "FOK", + "name": "", + "description": "" + } + ] + }, + "postOnly": { + "type": "boolean", + "description": "Whether its a postOnly order." + }, + "hidden": { + "type": "boolean", + "description": "Whether its a hidden order." + }, + "iceberg": { + "type": "boolean", + "description": "Whether its a iceberg order." + }, + "visibleSize": { + "type": "string", + "description": "Visible size of iceberg order in order book." + }, + "cancelAfter": { + "type": "integer", + "description": "A GTT timeInForce that expires in n seconds" + }, + "channel": { + "type": "string" + }, + "clientOid": { + "type": "string", + "description": "Client Order Id,unique identifier created by the user" + }, + "remark": { + "type": "string", + "description": "Order placement remarks" + }, + "tags": { + "type": "string", + "description": "Order tag" + }, + "cancelExist": { + "type": "boolean", + "description": "Whether there is a cancellation record for the order." + }, + "createdAt": { + "type": "integer", + "format": "int64" + }, + "lastUpdatedAt": { + "type": "integer", + "format": "int64" + }, + "tradeType": { + "type": "string", + "description": "Trade type, redundancy param" + }, + "inOrderBook": { + "type": "boolean", + "description": "Whether to enter the orderbook: true: enter the orderbook; false: not enter the orderbook" + }, + "cancelledSize": { + "type": "string", + "description": "Number of canceled transactions" + }, + "cancelledFunds": { + "type": "string", + "description": "Funds of canceled transactions" + }, + "remainSize": { + "type": "string", + "description": "Number of remain transactions" + }, + "remainFunds": { + "type": "string", + "description": "Funds of remain transactions" + }, + "tax": { + "type": "string", + "description": "Users in some regions need query this field" + }, + "active": { + "type": "boolean", + "description": "Order status: true-The status of the order isactive; false-The status of the order is done" + } + }, + "required": [ + "id", + "symbol", + "opType", + "type", + "side", + "price", + "size", + "funds", + "dealSize", + "dealFunds", + "fee", + "feeCurrency", + "timeInForce", + "postOnly", + "hidden", + "iceberg", + "visibleSize", + "cancelAfter", + "channel", + "clientOid", + "cancelExist", + "tradeType", + "inOrderBook", + "cancelledSize", + "cancelledFunds", + "remainSize", + "remainFunds", + "active", + "createdAt", + "lastUpdatedAt", + "tax" + ] } }, "required": [ @@ -8643,7 +7740,7 @@ } } }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470178", + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470181", "x-abandon": "normal", "x-domain": "Spot", "x-api-channel": "Private", @@ -8651,188 +7748,111 @@ "x-api-rate-limit-pool": "Spot", "x-sdk-service": "Spot", "x-sdk-sub-service": "Order", - "x-sdk-method-name": "getOpenOrders", - "x-sdk-method-description": "This interface is to obtain all Spot active order lists, and the return value of the active order interface is the paged data of all uncompleted order lists. The returned data is sorted in descending order according to the latest update time of the order. After the user successfully places an order, the order is in Active state, and the user can use inOrderBook to determine whether the order has entered the order. Canceled or fully filled orders are marked as completed Done status.", - "x-api-rate-limit": 2, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": [\\n {\\n \\\"id\\\": \\\"67120bbef094e200070976f6\\\",\\n \\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\",\\n \\\"symbol\\\": \\\"BTC-USDT\\\",\\n \\\"opType\\\": \\\"DEAL\\\",\\n \\\"type\\\": \\\"limit\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"price\\\": \\\"50000\\\",\\n \\\"size\\\": \\\"0.00001\\\",\\n \\\"funds\\\": \\\"0.5\\\",\\n \\\"dealSize\\\": \\\"0\\\",\\n \\\"dealFunds\\\": \\\"0\\\",\\n \\\"fee\\\": \\\"0\\\",\\n \\\"feeCurrency\\\": \\\"USDT\\\",\\n \\\"stp\\\": null,\\n \\\"timeInForce\\\": \\\"GTC\\\",\\n \\\"postOnly\\\": false,\\n \\\"hidden\\\": false,\\n \\\"iceberg\\\": false,\\n \\\"visibleSize\\\": \\\"0\\\",\\n \\\"cancelAfter\\\": 0,\\n \\\"channel\\\": \\\"API\\\",\\n \\\"remark\\\": \\\"order remarks\\\",\\n \\\"tags\\\": \\\"order tags\\\",\\n \\\"cancelExist\\\": false,\\n \\\"tradeType\\\": \\\"TRADE\\\",\\n \\\"inOrderBook\\\": true,\\n \\\"cancelledSize\\\": \\\"0\\\",\\n \\\"cancelledFunds\\\": \\\"0\\\",\\n \\\"remainSize\\\": \\\"0.00001\\\",\\n \\\"remainFunds\\\": \\\"0.5\\\",\\n \\\"tax\\\": \\\"0\\\",\\n \\\"active\\\": true,\\n \\\"createdAt\\\": 1729235902748,\\n \\\"lastUpdatedAt\\\": 1729235909862\\n }\\n ]\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\"}" - } - }, - "/api/v1/stop-order": { - "get": { - "summary": "Get Stop Orders List", - "deprecated": false, - "description": "This interface is to obtain all Spot active stop order lists", - "tags": [], - "parameters": [], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "data": { - "type": "object", - "properties": { - "currentPage": { - "type": "integer", - "description": "current page id" - }, - "pageSize": { - "type": "integer" - }, - "totalNum": { - "type": "integer", - "description": "the stop order count" - }, - "totalPage": { - "type": "integer", - "description": "total page count of the list" - }, - "items": { - "type": "array", - "items": { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "Order ID, the ID of an order." - }, - "symbol": { - "type": "string", - "description": "Symbol name" - }, - "userId": { - "type": "string", - "description": "User ID" - }, - "status": { - "type": "string", - "description": "Order status, include NEW, TRIGGERED" - }, - "type": { - "type": "string", - "description": "Order type,limit, market, limit_stop or market_stop" - }, - "side": { - "type": "string", - "description": "transaction direction,include buy and sell" - }, - "price": { - "type": "string", - "description": "order price" - }, - "size": { - "type": "string", - "description": "order quantity" - }, - "funds": { - "type": "string", - "description": "order funds" - }, - "stp": { - "type": "string" - }, - "timeInForce": { - "type": "string", - "description": "time InForce,include GTC,GTT,IOC,FOK" - }, - "cancelAfter": { - "type": "integer", - "description": "cancel orders after n seconds,requires timeInForce to be GTT" - }, - "postOnly": { - "type": "boolean", - "description": "postOnly" - }, - "hidden": { - "type": "boolean", - "description": "hidden order" - }, - "iceberg": { - "type": "boolean", - "description": "Iceberg order" - }, - "visibleSize": { - "type": "string", - "description": "displayed quantity for iceberg order" - }, - "channel": { - "type": "string", - "description": "order source" - }, - "clientOid": { - "type": "string", - "description": "user-entered order unique mark" - }, - "remark": { - "type": "string", - "description": "Remarks at stop order creation" - }, - "tags": { - "type": "string", - "description": "tag order source" - }, - "orderTime": { - "type": "integer", - "description": "Time of place a stop order, accurate to nanoseconds", - "format": "int64" - }, - "domainId": { - "type": "string", - "description": "domainId, e.g: kucoin" - }, - "tradeSource": { - "type": "string", - "description": "trade source: USER(Order by user), MARGIN_SYSTEM(Order by margin system)" - }, - "tradeType": { - "type": "string", - "description": "The type of trading : TRADE(Spot), MARGIN_TRADE (Cross Margin), MARGIN_ISOLATED_TRADE (Isolated Margin)." - }, - "feeCurrency": { - "type": "string", - "description": "The currency of the fee" - }, - "takerFeeRate": { - "type": "string", - "description": "Fee Rate of taker" - }, - "makerFeeRate": { - "type": "string", - "description": "Fee Rate of maker" - }, - "createdAt": { - "type": "integer", - "description": "order creation time", - "format": "int64" - }, - "stop": { - "type": "string", - "description": "Stop order type, include loss and entry" - }, - "stopTriggerTime": { - "type": "integer", - "description": "The trigger time of the stop order", - "format": "int64" - }, - "stopPrice": { - "type": "string", - "description": "stop price" - } + "x-sdk-method-name": "getOrderByOrderId", + "x-sdk-method-description": "This endpoint can be used to obtain information for a single Spot order using the order id. After the user successfully places an order, the order is in Active state, and the user can use inOrderBook to determine whether the order has entered the order. Canceled or fully filled orders are marked as completed Done status.", + "x-api-rate-limit": 2, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"id\\\": \\\"6717422bd51c29000775ea03\\\",\\n \\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\",\\n \\\"symbol\\\": \\\"BTC-USDT\\\",\\n \\\"opType\\\": \\\"DEAL\\\",\\n \\\"type\\\": \\\"limit\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"price\\\": \\\"70000\\\",\\n \\\"size\\\": \\\"0.00001\\\",\\n \\\"funds\\\": \\\"0.7\\\",\\n \\\"dealSize\\\": \\\"0.00001\\\",\\n \\\"dealFunds\\\": \\\"0.677176\\\",\\n \\\"remainSize\\\": \\\"0\\\",\\n \\\"remainFunds\\\": \\\"0.022824\\\",\\n \\\"cancelledSize\\\": \\\"0\\\",\\n \\\"cancelledFunds\\\": \\\"0\\\",\\n \\\"fee\\\": \\\"0.000677176\\\",\\n \\\"feeCurrency\\\": \\\"USDT\\\",\\n \\\"stp\\\": null,\\n \\\"timeInForce\\\": \\\"GTC\\\",\\n \\\"postOnly\\\": false,\\n \\\"hidden\\\": false,\\n \\\"iceberg\\\": false,\\n \\\"visibleSize\\\": \\\"0\\\",\\n \\\"cancelAfter\\\": 0,\\n \\\"channel\\\": \\\"API\\\",\\n \\\"remark\\\": \\\"order remarks\\\",\\n \\\"tags\\\": null,\\n \\\"cancelExist\\\": false,\\n \\\"tradeType\\\": \\\"TRADE\\\",\\n \\\"inOrderBook\\\": false,\\n \\\"active\\\": false,\\n \\\"tax\\\": \\\"0\\\",\\n \\\"createdAt\\\": 1729577515444,\\n \\\"lastUpdatedAt\\\": 1729577515481\\n }\\n}", + "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"orderId\\\": \\\"6717422bd51c29000775ea03\\\"}" + } + }, + "/api/v1/hf/orders/sync/{orderId}": { + "delete": { + "summary": "Cancel Order By OrderId Sync", + "deprecated": false, + "description": "This endpoint can be used to cancel a spot order by orderId.", + "tags": [], + "parameters": [ + { + "name": "orderId", + "in": "path", + "description": "The unique order id generated by the trading system", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "symbol", + "in": "query", + "description": "symbol", + "required": true, + "schema": { + "type": "string", + "example": [ + "BTC-USDT", + "ETH-USDT", + "KCS-USDT" + ] + } + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "object", + "properties": { + "orderId": { + "type": "string", + "description": "order id" + }, + "originSize": { + "type": "string", + "description": "original order size" + }, + "dealSize": { + "type": "string", + "description": "deal size" + }, + "remainSize": { + "type": "string", + "description": "remain size" + }, + "canceledSize": { + "type": "string", + "description": "Cumulative canceled size" + }, + "status": { + "type": "string", + "description": "Order Status. open:order is active; done:order has been completed", + "enum": [ + "open", + "done" + ], + "x-api-enum": [ + { + "value": "open", + "name": "", + "description": "" + }, + { + "value": "done", + "name": "", + "description": "" } - }, - "description": "the list of stop orders" + ] } - } + }, + "required": [ + "orderId", + "dealSize", + "remainSize", + "canceledSize", + "status", + "originSize" + ] } }, "required": [ + "code", "data" ] } @@ -8840,145 +7860,129 @@ } } }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470338", + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470185", "x-abandon": "normal", "x-domain": "Spot", "x-api-channel": "Private", - "x-api-permission": "General", + "x-api-permission": "Spot", "x-api-rate-limit-pool": "Spot", "x-sdk-service": "Spot", "x-sdk-sub-service": "Order", - "x-sdk-method-name": "getStopOrdersList", - "x-sdk-method-description": "This interface is to obtain all Spot active stop order lists", - "x-api-rate-limit": 8, - "x-request-force-json": true, - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "symbol": { - "type": "string", - "description": "Only list orders for a specific symbol" - }, - "side": { - "type": "string", - "enum": [ - "buy", - "sell" - ], - "description": "buy or sell", - "x-api-enum": [ - { - "value": "buy", - "name": "buy", - "description": "" - }, - { - "value": "sell", - "name": "sell", - "description": "" - } - ] - }, - "type": { - "type": "string", - "description": "limit, market, limit_stop or market_stop", - "enum": [ - "limit", - "market", - "limit_stop", - "market_stop" - ], - "x-api-enum": [ - { - "value": "limit", - "name": "limit", - "description": "" - }, - { - "value": "market", - "name": "market", - "description": "" - }, - { - "value": "limit_stop", - "name": "limit_stop", - "description": "" - }, - { - "value": "market_stop", - "name": "market_stop", - "description": "" - } - ] - }, - "tradeType": { - "type": "string", - "description": "The type of trading : TRADE(Spot), MARGIN_TRADE (Cross Margin), MARGIN_ISOLATED_TRADE (Isolated Margin). Default is TRADE", - "enum": [ - "TRADE", - "MARGIN_TRADE", - "MARGIN_ISOLATED_TRADE" - ], - "x-api-enum": [ - { - "value": "TRADE", - "name": "TRADE", - "description": "" - }, - { - "value": "MARGIN_TRADE", - "name": "MARGIN_TRADE", - "description": "" - }, - { - "value": "MARGIN_ISOLATED_TRADE", - "name": "MARGIN_ISOLATED_TRADE", - "description": "" - } - ] - }, - "startAt": { - "type": "number", - "description": "Start time (milisecond)" - }, - "endAt": { - "type": "number", - "description": "End time (milisecond)" - }, - "currentPage": { - "type": "integer", - "description": "current page" - }, - "orderIds": { - "type": "string", - "description": "comma seperated order ID list" - }, - "pageSize": { - "type": "integer", - "description": "page size" + "x-sdk-method-name": "cancelOrderByOrderIdSync", + "x-sdk-method-description": "This endpoint can be used to cancel a spot order by orderId.", + "x-api-rate-limit": 1, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"orderId\\\": \\\"671128ee365ccb0007534d45\\\",\\n \\\"originSize\\\": \\\"0.00001\\\",\\n \\\"dealSize\\\": \\\"0\\\",\\n \\\"remainSize\\\": \\\"0\\\",\\n \\\"canceledSize\\\": \\\"0.00001\\\",\\n \\\"status\\\": \\\"done\\\"\\n }\\n}", + "x-request-example": "{\\\"orderId\\\": \\\"671128ee365ccb0007534d45\\\", \\\"symbol\\\": \\\"BTC-USDT\\\"}" + } + }, + "/api/v1/hf/orders/client-order/{clientOid}": { + "delete": { + "summary": "Cancel Order By ClientOid", + "deprecated": false, + "description": "This endpoint can be used to cancel a spot order by clientOid. This endpoint only sends cancellation requests. The results of the requests must be obtained by checking the order status or subscribing to websocket.", + "tags": [], + "parameters": [ + { + "name": "clientOid", + "in": "path", + "description": "Client Order Id,unique identifier created by the user", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "symbol", + "in": "query", + "description": "symbol", + "required": true, + "schema": { + "type": "string", + "example": [ + "BTC-USDT", + "ETH-USDT", + "KCS-USDT" + ] + } + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "object", + "properties": { + "clientOid": { + "type": "string", + "description": "Client Order Id,unique identifier created by the user" + } + }, + "required": [ + "clientOid" + ] + } }, - "stop": { - "type": "string", - "description": "Order type: stop: stop loss order, oco: oco order" - } + "required": [ + "code", + "data" + ] } - }, - "example": "{\n \"symbol\": \"BTC-USDT\",\n \"orderId\": \"670fd33bf9406e0007ab3945\",\n \"newPrice\": \"30000\",\n \"newSize\": \"0.0001\"\n}" + } } } }, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"currentPage\\\": 1,\\n \\\"pageSize\\\": 50,\\n \\\"totalNum\\\": 1,\\n \\\"totalPage\\\": 1,\\n \\\"items\\\": [\\n {\\n \\\"id\\\": \\\"vs8hoo8kqjnklv4m0038lrfq\\\",\\n \\\"symbol\\\": \\\"KCS-USDT\\\",\\n \\\"userId\\\": \\\"60fe4956c43cbc0006562c2c\\\",\\n \\\"status\\\": \\\"NEW\\\",\\n \\\"type\\\": \\\"limit\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"price\\\": \\\"0.01000000000000000000\\\",\\n \\\"size\\\": \\\"0.01000000000000000000\\\",\\n \\\"funds\\\": null,\\n \\\"stp\\\": null,\\n \\\"timeInForce\\\": \\\"GTC\\\",\\n \\\"cancelAfter\\\": -1,\\n \\\"postOnly\\\": false,\\n \\\"hidden\\\": false,\\n \\\"iceberg\\\": false,\\n \\\"visibleSize\\\": null,\\n \\\"channel\\\": \\\"API\\\",\\n \\\"clientOid\\\": \\\"404814a0fb4311eb9098acde48001122\\\",\\n \\\"remark\\\": null,\\n \\\"tags\\\": null,\\n \\\"orderTime\\\": 1628755183702150100,\\n \\\"domainId\\\": \\\"kucoin\\\",\\n \\\"tradeSource\\\": \\\"USER\\\",\\n \\\"tradeType\\\": \\\"TRADE\\\",\\n \\\"feeCurrency\\\": \\\"USDT\\\",\\n \\\"takerFeeRate\\\": \\\"0.00200000000000000000\\\",\\n \\\"makerFeeRate\\\": \\\"0.00200000000000000000\\\",\\n \\\"createdAt\\\": 1628755183704,\\n \\\"stop\\\": \\\"loss\\\",\\n \\\"stopTriggerTime\\\": null,\\n \\\"stopPrice\\\": \\\"10.00000000000000000000\\\"\\n }\\n ]\\n }\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"orderId\\\": \\\"670fd33bf9406e0007ab3945\\\", \\\"newPrice\\\": \\\"30000\\\", \\\"newSize\\\": \\\"0.0001\\\"}" + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470184", + "x-abandon": "normal", + "x-domain": "Spot", + "x-api-channel": "Private", + "x-api-permission": "Spot", + "x-api-rate-limit-pool": "Spot", + "x-sdk-service": "Spot", + "x-sdk-sub-service": "Order", + "x-sdk-method-name": "cancelOrderByClientOid", + "x-sdk-method-description": "This endpoint can be used to cancel a spot order by clientOid. This endpoint only sends cancellation requests. The results of the requests must be obtained by checking the order status or subscribing to websocket.", + "x-api-rate-limit": 1, + "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"clientOid\\\":\\\"5c52e11203aa677f33e493fb\\\"}}", + "x-request-example": "{\\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\", \\\"symbol\\\": \\\"BTC-USDT\\\"}" }, - "post": { - "summary": "Add Stop Order", - "deprecated": true, - "description": "Place stop order to the Spot trading system, you can place two major types of orders: limit and market. Orders can only be placed if your account has sufficient funds. Once an order is placed, your funds will be put on hold for the duration of the order. The amount of funds on hold depends on the order type and parameters specified.", + "get": { + "summary": "Get Order By ClientOid", + "deprecated": false, + "description": "This endpoint can be used to obtain information for a single Spot order using the client order id. After the user successfully places an order, the order is in Active state, and the user can use inOrderBook to determine whether the order has entered the order. Canceled or fully filled orders are marked as completed Done status.", "tags": [], - "parameters": [], + "parameters": [ + { + "name": "symbol", + "in": "query", + "description": "symbol", + "required": true, + "schema": { + "type": "string", + "example": [ + "BTC-USDT", + "ETH-USDT", + "KCS-USDT" + ] + } + }, + { + "name": "clientOid", + "in": "path", + "description": "Client Order Id,unique identifier created by the user", + "required": true, + "schema": { + "type": "string" + } + } + ], "responses": { "200": { "description": "", @@ -8993,245 +7997,309 @@ "data": { "type": "object", "properties": { - "orderId": { + "id": { + "type": "string", + "description": "The unique order id generated by the trading system" + }, + "symbol": { + "type": "string", + "description": "symbol", + "example": [ + "BTC-USDT", + "ETH-USDT", + "KCS-USDT" + ] + }, + "opType": { + "type": "string" + }, + "type": { + "type": "string", + "description": "Specify if the order is an 'limit' order or 'market' order. ", + "enum": [ + "limit", + "market" + ], + "x-api-enum": [ + { + "value": "limit", + "name": "", + "description": "" + }, + { + "value": "market", + "name": "", + "description": "" + } + ] + }, + "side": { + "type": "string", + "description": "Buy or sell", + "enum": [ + "buy", + "sell" + ], + "x-api-enum": [ + { + "value": "buy", + "name": "", + "description": "" + }, + { + "value": "sell", + "name": "", + "description": "" + } + ] + }, + "price": { + "type": "string", + "description": "Order price" + }, + "size": { + "type": "string", + "description": "Order size" + }, + "funds": { + "type": "string", + "description": "Order Funds" + }, + "dealSize": { + "type": "string", + "description": "Number of filled transactions" + }, + "dealFunds": { + "type": "string", + "description": "Funds of filled transactions" + }, + "fee": { + "type": "string", + "description": "[Handling fees](https://www.kucoin.com/docs-new/api-5327739)" + }, + "feeCurrency": { + "type": "string", + "description": "currency used to calculate trading fee" + }, + "stp": { + "type": "string", + "description": "[Self Trade Prevention](https://www.kucoin.com/docs-new/api-5176570)", + "enum": [ + "DC", + "CO", + "CN", + "CB" + ], + "x-api-enum": [ + { + "value": "DC", + "name": "", + "description": "" + }, + { + "value": "CO", + "name": "", + "description": "" + }, + { + "value": "CN", + "name": "", + "description": "" + }, + { + "value": "CB", + "name": "", + "description": "" + } + ] + }, + "timeInForce": { + "type": "string", + "description": "Time in force", + "enum": [ + "GTC", + "GTT", + "IOC", + "FOK" + ], + "x-api-enum": [ + { + "value": "GTC", + "name": "", + "description": "" + }, + { + "value": "GTT", + "name": "", + "description": "" + }, + { + "value": "IOC", + "name": "", + "description": "" + }, + { + "value": "FOK", + "name": "", + "description": "" + } + ] + }, + "postOnly": { + "type": "boolean", + "description": "Whether its a postOnly order." + }, + "hidden": { + "type": "boolean", + "description": "Whether its a hidden order." + }, + "iceberg": { + "type": "boolean", + "description": "Whether its a iceberg order." + }, + "visibleSize": { + "type": "string", + "description": "Visible size of iceberg order in order book." + }, + "cancelAfter": { + "type": "integer", + "description": "A GTT timeInForce that expires in n seconds" + }, + "channel": { + "type": "string" + }, + "clientOid": { + "type": "string", + "description": "Client Order Id,unique identifier created by the user" + }, + "remark": { "type": "string", - "description": "The unique order id generated by the trading system,which can be used later for further actions such as canceling the order." + "description": "Order placement remarks" }, - "clientOid": { + "tags": { "type": "string", - "description": "The user self-defined order id." + "description": "Order tag" + }, + "cancelExist": { + "type": "boolean", + "description": "Whether there is a cancellation record for the order." + }, + "createdAt": { + "type": "integer", + "format": "int64" + }, + "lastUpdatedAt": { + "type": "integer", + "format": "int64" + }, + "tradeType": { + "type": "string", + "description": "Trade type, redundancy param" + }, + "inOrderBook": { + "type": "boolean", + "description": "Whether to enter the orderbook: true: enter the orderbook; false: not enter the orderbook" + }, + "cancelledSize": { + "type": "string", + "description": "Number of canceled transactions" + }, + "cancelledFunds": { + "type": "string", + "description": "Funds of canceled transactions" + }, + "remainSize": { + "type": "string", + "description": "Number of remain transactions" + }, + "remainFunds": { + "type": "string", + "description": "Funds of remain transactions" + }, + "tax": { + "type": "string", + "description": "Users in some regions need query this field" + }, + "active": { + "type": "boolean", + "description": "Order status: true-The status of the order isactive; false-The status of the order is done" } - }, - "required": [ - "orderId", - "clientOid" - ] - } - }, - "required": [ - "code", - "data" - ] - } - } - } - } - }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470334", - "x-abandon": "abandon", - "x-domain": "Spot", - "x-api-channel": "Private", - "x-api-permission": "Spot", - "x-api-rate-limit-pool": "Spot", - "x-sdk-service": "Spot", - "x-sdk-sub-service": "Order", - "x-sdk-method-name": "addStopOrder", - "x-sdk-method-description": "Place stop order to the Spot trading system, you can place two major types of orders: limit and market. Orders can only be placed if your account has sufficient funds. Once an order is placed, your funds will be put on hold for the duration of the order. The amount of funds on hold depends on the order type and parameters specified.", - "x-api-rate-limit": 1, - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "clientOid": { - "type": "string", - "description": "Client Order Id,The ClientOid field is a unique ID created by the user(we recommend using a UUID), and can only contain numbers, letters, underscores (_), and hyphens (-). This field is returned when order information is obtained. You can use clientOid to tag your orders. ClientOid is different from the order ID created by the service provider. Please do not initiate requests using the same clientOid. The maximum length for the ClientOid is 40 characters.\n\nPlease remember the orderId created by the service provider, it used to check for updates in order status.", - "example": [ - "5c52e11203aa677f33e493fb" - ] - }, - "side": { - "type": "string", - "description": "specify if the order is to 'buy' or 'sell'", - "enum": [ - "buy", - "sell" - ], - "x-api-enum": [ - { - "value": "buy", - "name": "", - "description": "" - }, - { - "value": "sell", - "name": "", - "description": "" - } - ], - "example": [ - "buy" - ] - }, - "symbol": { - "type": "string", - "description": "symbol", - "example": [ - "BTC-USDT", - "ETH-USDT", - "KCS-USDT" - ] - }, - "type": { - "type": "string", - "description": "specify if the order is an 'limit' order or 'market' order. \n\nThe type of order you specify when you place your order determines whether or not you need to request other parameters and also affects the execution of the matching engine.\n\nWhen placing a limit order, you must specify a price and size. The system will try to match the order according to market price or a price better than market price. If the order cannot be immediately matched, it will stay in the order book until it is matched or the user cancels.\n\nUnlike limit orders, the price for market orders fluctuates with market prices. When placing a market order, you do not need to specify a price, you only need to specify a quantity. Market orders are filled immediately and will not enter the order book. All market orders are takers and a taker fee will be charged.", - "enum": [ - "limit", - "market" - ], - "x-api-enum": [ - { - "value": "limit", - "name": "", - "description": "" - }, - { - "value": "market", - "name": "", - "description": "" - } - ], - "example": [ - "limit" - ] - }, - "remark": { - "type": "string", - "description": "Order placement remarks, length cannot exceed 20 characters (ASCII)" - }, - "stp": { - "type": "string", - "description": "[Self Trade Prevention](https://www.kucoin.com/docs-new/doc-338146) is divided into four strategies: CN, CO, CB , and DC", - "enum": [ - "DC", - "CO", - "CN", - "CB" - ], - "x-api-enum": [ - { - "value": "DC", - "name": "", - "description": "" - }, - { - "value": "CO", - "name": "", - "description": "" - }, - { - "value": "CN", - "name": "", - "description": "" - }, - { - "value": "CB", - "name": "", - "description": "" - } - ] - }, - "price": { - "type": "string", - "description": "Specify price for order, not need for market order.\n\nWhen placing a limit order, the price must be based on priceIncrement for the trading pair. The price increment (priceIncrement) is the price precision for the trading pair. For example, for the BTC-USDT trading pair, the priceIncrement is 0.00001000. So the price for your orders cannot be less than 0.00001000 and must be a multiple of priceIncrement. Otherwise, the order will return an invalid priceIncrement error." - }, - "size": { - "type": "string", - "description": "Specify quantity for order\n\nWhen **type** is limit, size refers to the amount of trading targets (the asset name written in front) for the trading pair. Teh Size must be based on the baseIncrement of the trading pair. The baseIncrement represents the precision for the trading pair. The size of an order must be a positive-integer multiple of baseIncrement and must be between baseMinSize and baseMaxSize.\n\nWhen **type** is market, select one out of two: size or funds" - }, - "timeInForce": { - "type": "string", - "description": "[Time in force](https://www.kucoin.com/docs-new/doc-338146) is a special strategy used during trading. Required for limit orders.", - "enum": [ - "GTC", - "GTT", - "IOC", - "FOK" - ], - "default": "GTC", - "x-api-enum": [ - { - "value": "GTC", - "name": "", - "description": "" - }, - { - "value": "GTT", - "name": "", - "description": "" - }, - { - "value": "IOC", - "name": "", - "description": "" - }, - { - "value": "FOK", - "name": "", - "description": "" - } - ] - }, - "postOnly": { - "type": "boolean", - "description": "passive order labels, this is disabled when the order timing strategy is IOC or FOK if **type** is limit.", - "default": false - }, - "hidden": { - "type": "boolean", - "description": "[Hidden order](https://www.kucoin.com/docs-new/doc-338146) or not (not shown in order book)", - "default": false - }, - "iceberg": { - "type": "boolean", - "description": "Whether or not only visible portions of orders are shown in [Iceberg orders](https://www.kucoin.com/docs-new/doc-338146)", - "default": false - }, - "visibleSize": { - "type": "string", - "description": "When **type** is limit, this is Maximum visible quantity in iceberg orders." - }, - "cancelAfter": { - "type": "integer", - "description": "Cancel after n seconds,the order timing strategy is GTT when **type** is limit.", - "format": "int64" - }, - "funds": { - "type": "string", - "description": "When **type** is market, select one out of two: size or funds" - }, - "stopPrice": { - "type": "string", - "description": "The trigger price." + }, + "required": [ + "id", + "symbol", + "opType", + "type", + "side", + "price", + "size", + "funds", + "dealSize", + "dealFunds", + "fee", + "feeCurrency", + "timeInForce", + "postOnly", + "hidden", + "iceberg", + "visibleSize", + "cancelAfter", + "channel", + "clientOid", + "cancelExist", + "tradeType", + "inOrderBook", + "cancelledSize", + "cancelledFunds", + "remainSize", + "remainFunds", + "active", + "createdAt", + "lastUpdatedAt", + "tax" + ] + } }, - "tradeType": { - "type": "string", - "description": "The type of trading : TRADE(Spot), MARGIN_TRADE (Cross Margin), MARGIN_ISOLATED_TRADE (Isolated Margin). Default is TRADE" - } - }, - "required": [ - "symbol", - "type", - "side", - "stopPrice" - ] - }, - "example": "//limit order\n{\n \"type\": \"limit\",\n \"symbol\": \"BTC-USDT\",\n \"side\": \"buy\",\n \"price\": \"50000\",\n \"size\": \"0.00001\",\n \"clientOid\": \"5c52e11203aa677f33e493fb\",\n \"remark\": \"order remarks\"\n}\n\n//market order 1\n// {\n// \"type\": \"market\",\n// \"symbol\": \"BTC-USDT\",\n// \"side\": \"buy\",\n// \"size\": \"0.00001\",\n// \"clientOid\": \"5c52e11203aa677f33e493fc\",\n// \"remark\": \"order remarks\"\n// }\n\n//market order 2\n// {\n// \"type\": \"market\",\n// \"symbol\": \"BTC-USDT\",\n// \"side\": \"buy\",\n// \"funds\": \"1\",\n// \"clientOid\": \"5c52e11203aa677f33e493fc\",\n// \"remark\": \"order remarks\"\n// }\n" + "required": [ + "code", + "data" + ] + } + } } } }, - "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"orderId\\\":\\\"670fd33bf9406e0007ab3945\\\",\\\"clientOid\\\":\\\"5c52e11203aa677f33e493fb\\\"}}", - "x-request-example": "{\\\"type\\\": \\\"limit\\\", \\\"symbol\\\": \\\"BTC-USDT\\\", \\\"side\\\": \\\"buy\\\", \\\"price\\\": \\\"50000\\\", \\\"size\\\": \\\"0.00001\\\", \\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\", \\\"remark\\\": \\\"order remarks\\\"}" + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470182", + "x-abandon": "normal", + "x-domain": "Spot", + "x-api-channel": "Private", + "x-api-permission": "General", + "x-api-rate-limit-pool": "Spot", + "x-sdk-service": "Spot", + "x-sdk-sub-service": "Order", + "x-sdk-method-name": "getOrderByClientOid", + "x-sdk-method-description": "This endpoint can be used to obtain information for a single Spot order using the client order id. After the user successfully places an order, the order is in Active state, and the user can use inOrderBook to determine whether the order has entered the order. Canceled or fully filled orders are marked as completed Done status.", + "x-api-rate-limit": 2, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"id\\\": \\\"6717422bd51c29000775ea03\\\",\\n \\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\",\\n \\\"symbol\\\": \\\"BTC-USDT\\\",\\n \\\"opType\\\": \\\"DEAL\\\",\\n \\\"type\\\": \\\"limit\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"price\\\": \\\"70000\\\",\\n \\\"size\\\": \\\"0.00001\\\",\\n \\\"funds\\\": \\\"0.7\\\",\\n \\\"dealSize\\\": \\\"0.00001\\\",\\n \\\"dealFunds\\\": \\\"0.677176\\\",\\n \\\"remainSize\\\": \\\"0\\\",\\n \\\"remainFunds\\\": \\\"0.022824\\\",\\n \\\"cancelledSize\\\": \\\"0\\\",\\n \\\"cancelledFunds\\\": \\\"0\\\",\\n \\\"fee\\\": \\\"0.000677176\\\",\\n \\\"feeCurrency\\\": \\\"USDT\\\",\\n \\\"stp\\\": null,\\n \\\"timeInForce\\\": \\\"GTC\\\",\\n \\\"postOnly\\\": false,\\n \\\"hidden\\\": false,\\n \\\"iceberg\\\": false,\\n \\\"visibleSize\\\": \\\"0\\\",\\n \\\"cancelAfter\\\": 0,\\n \\\"channel\\\": \\\"API\\\",\\n \\\"remark\\\": \\\"order remarks\\\",\\n \\\"tags\\\": null,\\n \\\"cancelExist\\\": false,\\n \\\"tradeType\\\": \\\"TRADE\\\",\\n \\\"inOrderBook\\\": false,\\n \\\"active\\\": false,\\n \\\"tax\\\": \\\"0\\\",\\n \\\"createdAt\\\": 1729577515444,\\n \\\"lastUpdatedAt\\\": 1729577515481\\n }\\n}", + "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\"}" } }, - "/api/v1/hf/orders/done": { - "get": { - "summary": "Get Closed Orders", + "/api/v1/hf/orders/sync/client-order/{clientOid}": { + "delete": { + "summary": "Cancel Order By ClientOid Sync", "deprecated": false, - "description": "This interface is to obtain all Spot closed order lists, and the return value of the active order interface is the paged data of all uncompleted order lists. The returned data is sorted in descending order according to the latest update time of the order. After the user successfully places an order, the order is in Active state, and the user can use inOrderBook to determine whether the order has entered the order. Canceled or fully filled orders are marked as completed Done status.", + "description": "This endpoint can be used to cancel a spot order by orderId.", "tags": [], "parameters": [ + { + "name": "clientOid", + "in": "path", + "description": "Client Order Id,unique identifier created by the user", + "required": true, + "schema": { + "type": "string" + } + }, { "name": "symbol", "in": "query", @@ -9245,97 +8313,134 @@ "KCS-USDT" ] } - }, - { - "name": "side", - "in": "query", - "description": "specify if the order is to 'buy' or 'sell'", - "required": false, - "schema": { - "type": "string", - "enum": [ - "buy", - "sell" - ], - "x-api-enum": [ - { - "value": "buy", - "name": "", - "description": "" - }, - { - "value": "sell", - "name": "", - "description": "" - } - ] - } - }, - { - "name": "type", - "in": "query", - "description": "specify if the order is an 'limit' order or 'market' order. ", - "required": false, - "schema": { - "type": "string", - "enum": [ - "limit", - "market" - ], - "x-api-enum": [ - { - "value": "limit", - "name": "", - "description": "" - }, - { - "value": "market", - "name": "", - "description": "" + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "object", + "properties": { + "clientOid": { + "type": "string", + "description": "Client Order Id,unique identifier created by the user" + }, + "originSize": { + "type": "string", + "description": "original order size" + }, + "dealSize": { + "type": "string", + "description": "deal size" + }, + "remainSize": { + "type": "string", + "description": "remain size" + }, + "canceledSize": { + "type": "string", + "description": "Cumulative canceled size" + }, + "status": { + "type": "string", + "description": "Order Status. open:order is active; done:order has been completed", + "enum": [ + "open", + "done" + ], + "x-api-enum": [ + { + "value": "open", + "name": "", + "description": "" + }, + { + "value": "done", + "name": "", + "description": "" + } + ] + } + }, + "required": [ + "clientOid", + "originSize", + "dealSize", + "remainSize", + "canceledSize", + "status" + ] + } + }, + "required": [ + "code", + "data" + ] } - ] - } - }, - { - "name": "lastId", - "in": "query", - "description": "The id of the last set of data from the previous batch of data. By default, the latest information is given.\nlastId is used to filter data and paginate. If lastId is not entered, the default is a maximum of 100 returned data items. The return results include lastId,which can be used as a query parameter to look up new data from the next page.", - "required": false, - "schema": { - "type": "integer", - "format": "int64" + } } - }, + } + }, + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470186", + "x-abandon": "normal", + "x-domain": "Spot", + "x-api-channel": "Private", + "x-api-permission": "Spot", + "x-api-rate-limit-pool": "Spot", + "x-sdk-service": "Spot", + "x-sdk-sub-service": "Order", + "x-sdk-method-name": "cancelOrderByClientOidSync", + "x-sdk-method-description": "This endpoint can be used to cancel a spot order by orderId.", + "x-api-rate-limit": 1, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\",\\n \\\"originSize\\\": \\\"0.00001\\\",\\n \\\"dealSize\\\": \\\"0\\\",\\n \\\"remainSize\\\": \\\"0\\\",\\n \\\"canceledSize\\\": \\\"0.00001\\\",\\n \\\"status\\\": \\\"done\\\"\\n }\\n}", + "x-request-example": "{\\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\", \\\"symbol\\\": \\\"BTC-USDT\\\"}" + } + }, + "/api/v1/hf/orders/cancel/{orderId}": { + "delete": { + "summary": "Cancel Partial Order", + "deprecated": false, + "description": "This interface can cancel the specified quantity of the order according to the orderId. The order execution order is: price first, time first, this interface will not change the queue order", + "tags": [], + "parameters": [ { - "name": "limit", - "in": "query", - "description": "Default20,Max100", - "required": false, + "name": "orderId", + "in": "path", + "description": "The unique order id generated by the trading system", + "required": true, "schema": { - "type": "integer", - "default": 20, - "minimum": 1, - "maximum": 100 + "type": "string" } }, { - "name": "startAt", + "name": "symbol", "in": "query", - "description": "Start time (milisecond)", - "required": false, + "description": "symbol", + "required": true, "schema": { - "type": "integer", - "format": "int64" + "type": "string", + "example": [ + "BTC-USDT", + "ETH-USDT", + "KCS-USDT" + ] } }, { - "name": "endAt", + "name": "cancelSize", "in": "query", - "description": "End time (milisecond)", - "required": false, + "description": "The size you want cancel", + "required": true, "schema": { - "type": "integer", - "format": "int64" + "type": "string" } } ], @@ -9353,283 +8458,259 @@ "data": { "type": "object", "properties": { - "lastId": { - "type": "integer", - "description": "The id of the last set of data from the previous batch of data. By default, the latest information is given.\nlastId is used to filter data and paginate. If lastId is not entered, the default is a maximum of 100 returned data items. The return results include lastId,which can be used as a query parameter to look up new data from the next page.", - "format": "int64" + "orderId": { + "type": "string", + "description": "order id" }, - "items": { - "type": "array", - "items": { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "The unique order id generated by the trading system" - }, - "symbol": { - "type": "string", - "description": "symbol", - "example": [ - "BTC-USDT", - "ETH-USDT", - "KCS-USDT" - ] - }, - "opType": { - "type": "string" - }, - "type": { - "type": "string", - "description": "Specify if the order is an 'limit' order or 'market' order. ", - "enum": [ - "limit", - "market" - ], - "x-api-enum": [ - { - "value": "limit", - "name": "", - "description": "" - }, - { - "value": "market", - "name": "", - "description": "" - } - ] - }, - "side": { - "type": "string", - "description": "Buy or sell", - "enum": [ - "buy", - "sell" - ], - "x-api-enum": [ - { - "value": "buy", - "name": "", - "description": "" - }, - { - "value": "sell", - "name": "", - "description": "" - } - ] - }, - "price": { - "type": "string", - "description": "Order price" - }, - "size": { - "type": "string", - "description": "Order size" - }, - "funds": { - "type": "string", - "description": "Order Funds" - }, - "dealSize": { - "type": "string", - "description": "Number of filled transactions" - }, - "dealFunds": { - "type": "string", - "description": "Funds of filled transactions" - }, - "fee": { - "type": "string", - "description": "[Handling fees](https://www.kucoin.com/docs-new/api-5327739)" - }, - "feeCurrency": { - "type": "string", - "description": "currency used to calculate trading fee" - }, - "stp": { - "type": "string", - "description": "[Self Trade Prevention](https://www.kucoin.com/docs-new/api-5176570)", - "enum": [ - "DC", - "CO", - "CN", - "CB" - ], - "x-api-enum": [ - { - "value": "DC", - "name": "", - "description": "" - }, - { - "value": "CO", - "name": "", - "description": "" - }, - { - "value": "CN", - "name": "", - "description": "" - }, - { - "value": "CB", - "name": "", - "description": "" - } - ] - }, - "timeInForce": { - "type": "string", - "description": "Time in force", - "enum": [ - "GTC", - "GTT", - "IOC", - "FOK" - ], - "x-api-enum": [ - { - "value": "GTC", - "name": "", - "description": "" - }, - { - "value": "GTT", - "name": "", - "description": "" - }, - { - "value": "IOC", - "name": "", - "description": "" - }, - { - "value": "FOK", - "name": "", - "description": "" - } - ] - }, - "postOnly": { - "type": "boolean", - "description": "Whether its a postOnly order." - }, - "hidden": { - "type": "boolean", - "description": "Whether its a hidden order." - }, - "iceberg": { - "type": "boolean", - "description": "Whether its a iceberg order." - }, - "visibleSize": { - "type": "string", - "description": "Visible size of iceberg order in order book." - }, - "cancelAfter": { - "type": "integer", - "description": "A GTT timeInForce that expires in n seconds" - }, - "channel": { - "type": "string" - }, - "clientOid": { - "type": "string", - "description": "Client Order Id,unique identifier created by the user" - }, - "remark": { - "type": "string", - "description": "Order placement remarks" - }, - "tags": { - "type": "string", - "description": "Order tag" - }, - "cancelExist": { - "type": "boolean", - "description": "Whether there is a cancellation record for the order." - }, - "createdAt": { - "type": "integer", - "format": "int64" - }, - "lastUpdatedAt": { - "type": "integer", - "format": "int64" - }, - "tradeType": { - "type": "string", - "description": "Trade type, redundancy param" - }, - "inOrderBook": { - "type": "boolean", - "description": "Whether to enter the orderbook: true: enter the orderbook; false: not enter the orderbook" - }, - "cancelledSize": { - "type": "string", - "description": "Number of canceled transactions" - }, - "cancelledFunds": { - "type": "string", - "description": "Funds of canceled transactions" - }, - "remainSize": { - "type": "string", - "description": "Number of remain transactions" - }, - "remainFunds": { + "cancelSize": { + "type": "string", + "description": "The size you canceled" + } + }, + "required": [ + "orderId", + "cancelSize" + ] + } + }, + "required": [ + "code", + "data" + ] + } + } + } + } + }, + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470183", + "x-abandon": "normal", + "x-domain": "Spot", + "x-api-channel": "Private", + "x-api-permission": "Spot", + "x-api-rate-limit-pool": "Spot", + "x-sdk-service": "Spot", + "x-sdk-sub-service": "Order", + "x-sdk-method-name": "cancelPartialOrder", + "x-sdk-method-description": "This interface can cancel the specified quantity of the order according to the orderId. The order execution order is: price first, time first, this interface will not change the queue order", + "x-api-rate-limit": 2, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"orderId\\\": \\\"6711f73c1ef16c000717bb31\\\",\\n \\\"cancelSize\\\": \\\"0.00001\\\"\\n }\\n}", + "x-request-example": "{\\\"orderId\\\": \\\"6711f73c1ef16c000717bb31\\\", \\\"symbol\\\": \\\"BTC-USDT\\\", \\\"cancelSize\\\": \\\"0.00001\\\"}" + } + }, + "/api/v1/hf/orders/cancelAll": { + "delete": { + "summary": "Cancel All Orders", + "deprecated": false, + "description": "This endpoint can cancel all spot orders for all symbol. This endpoint only sends cancellation requests. The results of the requests must be obtained by checking the order status or subscribing to websocket.", + "tags": [], + "parameters": [], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "object", + "properties": { + "succeedSymbols": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The Symbols Successfully cancelled" + }, + "failedSymbols": { + "type": "array", + "items": { + "type": "object", + "properties": { + "symbol": { "type": "string", - "description": "Funds of remain transactions" + "description": "symbol", + "example": [ + "BTC-USDT", + "ETH-USDT", + "KCS-USDT" + ] }, - "tax": { + "error": { "type": "string", - "description": "Users in some regions need query this field" - }, - "active": { - "type": "boolean", - "description": "Order status: true-The status of the order isactive; false-The status of the order is done" + "description": "error message" } - }, - "required": [ - "feeCurrency", - "id", - "symbol", - "opType", - "type", - "side", - "price", - "size", - "funds", - "dealSize", - "fee", - "timeInForce", - "dealFunds", - "clientOid", - "remainSize", - "remainFunds", - "cancelledSize", - "cancelledFunds", - "lastUpdatedAt", - "createdAt", - "tax", - "active", - "cancelExist", - "tradeType", - "inOrderBook", - "postOnly", - "hidden", - "iceberg", - "visibleSize", - "cancelAfter", - "channel" - ] - } + } + }, + "description": "The Symbols Failed to cancel" + } + }, + "required": [ + "succeedSymbols", + "failedSymbols" + ] + } + }, + "required": [ + "code", + "data" + ] + } + } + } + } + }, + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470176", + "x-abandon": "normal", + "x-domain": "Spot", + "x-api-channel": "Private", + "x-api-permission": "Spot", + "x-api-rate-limit-pool": "Spot", + "x-sdk-service": "Spot", + "x-sdk-sub-service": "Order", + "x-sdk-method-name": "cancelAllOrders", + "x-sdk-method-description": "This endpoint can cancel all spot orders for all symbol. This endpoint only sends cancellation requests. The results of the requests must be obtained by checking the order status or subscribing to websocket.", + "x-api-rate-limit": 30, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"succeedSymbols\\\": [\\n \\\"ETH-USDT\\\",\\n \\\"BTC-USDT\\\"\\n ],\\n \\\"failedSymbols\\\": []\\n }\\n}" + } + }, + "/api/v1/hf/orders/alter": { + "post": { + "summary": "Modify Order", + "deprecated": false, + "description": "This interface can modify the price and quantity of the order according to orderId or clientOid. The implementation of this interface is: cancel the order and place a new order on the same trading pair, and return the modification result to the client synchronously When the quantity of the new order updated by the user is less than the filled quantity of this order, the order will be considered as completed, and the order will be cancelled, and no new order will be placed", + "tags": [], + "parameters": [], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "object", + "properties": { + "newOrderId": { + "type": "string", + "description": "The new order id" + }, + "clientOid": { + "type": "string", + "description": "The original client order id" + } + }, + "required": [ + "newOrderId", + "clientOid" + ] + } + }, + "required": [ + "code", + "data" + ] + } + } + } + } + }, + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470171", + "x-abandon": "normal", + "x-domain": "Spot", + "x-api-channel": "Private", + "x-api-permission": "Spot", + "x-api-rate-limit-pool": "Spot", + "x-sdk-service": "Spot", + "x-sdk-sub-service": "Order", + "x-sdk-method-name": "modifyOrder", + "x-sdk-method-description": "This interface can modify the price and quantity of the order according to orderId or clientOid. The implementation of this interface is: cancel the order and place a new order on the same trading pair, and return the modification result to the client synchronously When the quantity of the new order updated by the user is less than the filled quantity of this order, the order will be considered as completed, and the order will be cancelled, and no new order will be placed", + "x-api-rate-limit": 3, + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "clientOid": { + "type": "string", + "description": "The old client order id,orderId and clientOid must choose one", + "example": [ + "5c52e11203aa677f33e493fb" + ] + }, + "symbol": { + "type": "string", + "description": "symbol", + "example": [ + "BTC-USDT", + "ETH-USDT", + "KCS-USDT" + ] + }, + "orderId": { + "type": "string", + "description": "The old order id, orderId and clientOid must choose one" + }, + "newPrice": { + "type": "string", + "description": "The modified price of the new order, newPrice and newSize must choose one" + }, + "newSize": { + "type": "string", + "description": "The modified size of the new order, newPrice and newSize must choose one" + } + }, + "required": [ + "symbol" + ] + }, + "example": "{\n \"symbol\": \"BTC-USDT\",\n \"orderId\": \"670fd33bf9406e0007ab3945\",\n \"newPrice\": \"30000\",\n \"newSize\": \"0.0001\"\n}" + } + } + }, + "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"newOrderId\\\":\\\"67112258f9406e0007408827\\\",\\\"clientOid\\\":\\\"client order id 12\\\"}}", + "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"orderId\\\": \\\"670fd33bf9406e0007ab3945\\\", \\\"newPrice\\\": \\\"30000\\\", \\\"newSize\\\": \\\"0.0001\\\"}" + } + }, + "/api/v1/hf/orders/active/symbols": { + "get": { + "summary": "Get Symbols With Open Order", + "deprecated": false, + "description": "This interface can query all spot symbol that has active orders", + "tags": [], + "parameters": [], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "object", + "properties": { + "symbols": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The symbol that has active orders" } }, "required": [ - "lastId", - "items" + "symbols" ] } }, @@ -9642,44 +8723,39 @@ } } }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470179", + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470177", "x-abandon": "normal", "x-domain": "Spot", "x-api-channel": "Private", - "x-api-permission": "General", + "x-api-permission": "Spot", "x-api-rate-limit-pool": "Spot", "x-sdk-service": "Spot", "x-sdk-sub-service": "Order", - "x-sdk-method-name": "getClosedOrders", - "x-sdk-method-description": "This interface is to obtain all Spot closed order lists, and the return value of the active order interface is the paged data of all uncompleted order lists. The returned data is sorted in descending order according to the latest update time of the order. After the user successfully places an order, the order is in Active state, and the user can use inOrderBook to determine whether the order has entered the order. Canceled or fully filled orders are marked as completed Done status.", + "x-sdk-method-name": "getSymbolsWithOpenOrder", + "x-sdk-method-description": "This interface can query all spot symbol that has active orders", "x-api-rate-limit": 2, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"lastId\\\": 19814995255305,\\n \\\"items\\\": [\\n {\\n \\\"id\\\": \\\"6717422bd51c29000775ea03\\\",\\n \\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\",\\n \\\"symbol\\\": \\\"BTC-USDT\\\",\\n \\\"opType\\\": \\\"DEAL\\\",\\n \\\"type\\\": \\\"limit\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"price\\\": \\\"70000\\\",\\n \\\"size\\\": \\\"0.00001\\\",\\n \\\"funds\\\": \\\"0.7\\\",\\n \\\"dealSize\\\": \\\"0.00001\\\",\\n \\\"dealFunds\\\": \\\"0.677176\\\",\\n \\\"remainSize\\\": \\\"0\\\",\\n \\\"remainFunds\\\": \\\"0.022824\\\",\\n \\\"cancelledSize\\\": \\\"0\\\",\\n \\\"cancelledFunds\\\": \\\"0\\\",\\n \\\"fee\\\": \\\"0.000677176\\\",\\n \\\"feeCurrency\\\": \\\"USDT\\\",\\n \\\"stp\\\": null,\\n \\\"timeInForce\\\": \\\"GTC\\\",\\n \\\"postOnly\\\": false,\\n \\\"hidden\\\": false,\\n \\\"iceberg\\\": false,\\n \\\"visibleSize\\\": \\\"0\\\",\\n \\\"cancelAfter\\\": 0,\\n \\\"channel\\\": \\\"API\\\",\\n \\\"remark\\\": \\\"order remarks\\\",\\n \\\"tags\\\": null,\\n \\\"cancelExist\\\": false,\\n \\\"tradeType\\\": \\\"TRADE\\\",\\n \\\"inOrderBook\\\": false,\\n \\\"active\\\": false,\\n \\\"tax\\\": \\\"0\\\",\\n \\\"createdAt\\\": 1729577515444,\\n \\\"lastUpdatedAt\\\": 1729577515481\\n }\\n ]\\n }\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"side\\\": \\\"buy\\\", \\\"type\\\": \\\"limit\\\", \\\"lastId\\\": 254062248624417, \\\"limit\\\": 20, \\\"startAt\\\": 1728663338000, \\\"endAt\\\": 1728692138000}" + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"symbols\\\": [\\n \\\"ETH-USDT\\\",\\n \\\"BTC-USDT\\\"\\n ]\\n }\\n}" } }, - "/api/v1/stop-order/queryOrderByClientOid": { + "/api/v1/hf/orders/active": { "get": { - "summary": "Get Stop Order By ClientOid", + "summary": "Get Open Orders", "deprecated": false, - "description": "This interface is to obtain Spot stop order details by orderId", + "description": "This interface is to obtain all Spot active order lists, and the return value of the active order interface is the paged data of all uncompleted order lists. The returned data is sorted in descending order according to the latest update time of the order. After the user successfully places an order, the order is in Active state, and the user can use inOrderBook to determine whether the order has entered the order. Canceled or fully filled orders are marked as completed Done status.", "tags": [], "parameters": [ - { - "name": "clientOid", - "in": "query", - "description": "The client order id", - "required": true, - "schema": { - "type": "string" - } - }, { "name": "symbol", "in": "query", - "description": "symbol name", - "required": false, + "description": "symbol", + "required": true, "schema": { - "type": "string" + "type": "string", + "example": [ + "BTC-USDT", + "ETH-USDT", + "KCS-USDT" + ] } } ], @@ -9692,8 +8768,7 @@ "type": "object", "properties": { "code": { - "type": "string", - "description": "the return code" + "type": "string" }, "data": { "type": "array", @@ -9702,134 +8777,266 @@ "properties": { "id": { "type": "string", - "description": "Order ID, the ID of an order." + "description": "The unique order id generated by the trading system" }, "symbol": { "type": "string", - "description": "Symbol name" - }, - "userId": { - "type": "string", - "description": "User ID" + "description": "symbol", + "example": [ + "BTC-USDT", + "ETH-USDT", + "KCS-USDT" + ] }, - "status": { - "type": "string", - "description": "Order status, include NEW, TRIGGERED" + "opType": { + "type": "string" }, "type": { "type": "string", - "description": "Order type,limit, market, limit_stop or market_stop" + "description": "Specify if the order is an 'limit' order or 'market' order. ", + "enum": [ + "limit", + "market" + ], + "x-api-enum": [ + { + "value": "limit", + "name": "", + "description": "" + }, + { + "value": "market", + "name": "", + "description": "" + } + ] }, "side": { "type": "string", - "description": "transaction direction,include buy and sell" + "description": "Buy or sell", + "enum": [ + "buy", + "sell" + ], + "x-api-enum": [ + { + "value": "buy", + "name": "", + "description": "" + }, + { + "value": "sell", + "name": "", + "description": "" + } + ] }, "price": { "type": "string", - "description": "order price" + "description": "Order price" }, "size": { "type": "string", - "description": "order quantity" + "description": "Order size" }, "funds": { "type": "string", - "description": "order funds" + "description": "Order Funds" + }, + "dealSize": { + "type": "string", + "description": "Number of filled transactions" + }, + "dealFunds": { + "type": "string", + "description": "Funds of filled transactions" + }, + "fee": { + "type": "string", + "description": "[Handling fees](https://www.kucoin.com/docs-new/api-5327739)" + }, + "feeCurrency": { + "type": "string", + "description": "currency used to calculate trading fee" }, "stp": { - "type": "string" + "type": "string", + "description": "[Self Trade Prevention](https://www.kucoin.com/docs-new/api-5176570)", + "enum": [ + "DC", + "CO", + "CN", + "CB" + ], + "x-api-enum": [ + { + "value": "DC", + "name": "", + "description": "" + }, + { + "value": "CO", + "name": "", + "description": "" + }, + { + "value": "CN", + "name": "", + "description": "" + }, + { + "value": "CB", + "name": "", + "description": "" + } + ] }, "timeInForce": { "type": "string", - "description": "time InForce,include GTC,GTT,IOC,FOK" - }, - "cancelAfter": { - "type": "integer", - "description": "cancel orders after n seconds,requires timeInForce to be GTT", - "format": "int64" + "description": "Time in force", + "enum": [ + "GTC", + "GTT", + "IOC", + "FOK" + ], + "x-api-enum": [ + { + "value": "GTC", + "name": "", + "description": "" + }, + { + "value": "GTT", + "name": "", + "description": "" + }, + { + "value": "IOC", + "name": "", + "description": "" + }, + { + "value": "FOK", + "name": "", + "description": "" + } + ] }, "postOnly": { "type": "boolean", - "description": "postOnly" + "description": "Whether its a postOnly order." }, "hidden": { "type": "boolean", - "description": "hidden order" + "description": "Whether its a hidden order." }, "iceberg": { "type": "boolean", - "description": "Iceberg order" + "description": "Whether its a iceberg order." }, "visibleSize": { "type": "string", - "description": "displayed quantity for iceberg order" + "description": "Visible size of iceberg order in order book." + }, + "cancelAfter": { + "type": "integer", + "description": "A GTT timeInForce that expires in n seconds" }, "channel": { - "type": "string", - "description": "order source" + "type": "string" }, "clientOid": { "type": "string", - "description": "user-entered order unique mark" + "description": "Client Order Id,unique identifier created by the user" }, "remark": { "type": "string", - "description": "Remarks at stop order creation" + "description": "Order placement remarks" }, "tags": { "type": "string", - "description": "tag order source" + "description": "Order tag" }, - "domainId": { - "type": "string", - "description": "domainId, e.g: kucoin" + "cancelExist": { + "type": "boolean", + "description": "Whether there is a cancellation record for the order." }, - "tradeSource": { - "type": "string", - "description": "trade source: USER(Order by user), MARGIN_SYSTEM(Order by margin system)" + "createdAt": { + "type": "integer", + "format": "int64" }, - "tradeType": { - "type": "string", - "description": "The type of trading : TRADE(Spot), MARGIN_TRADE (Cross Margin), MARGIN_ISOLATED_TRADE (Isolated Margin)." + "lastUpdatedAt": { + "type": "integer", + "format": "int64" }, - "feeCurrency": { + "tradeType": { "type": "string", - "description": "The currency of the fee" + "description": "Trade type, redundancy param" }, - "takerFeeRate": { - "type": "string", - "description": "Fee Rate of taker" + "inOrderBook": { + "type": "boolean", + "description": "Whether to enter the orderbook: true: enter the orderbook; false: not enter the orderbook" }, - "makerFeeRate": { + "cancelledSize": { "type": "string", - "description": "Fee Rate of maker" + "description": "Number of canceled transactions" }, - "createdAt": { - "type": "integer", - "description": "order creation time", - "format": "int64" + "cancelledFunds": { + "type": "string", + "description": "Funds of canceled transactions" }, - "stop": { + "remainSize": { "type": "string", - "description": "Stop order type, include loss and entry" + "description": "Number of remain transactions" }, - "stopTriggerTime": { - "type": "integer", - "description": "The trigger time of the stop order", - "format": "int64" + "remainFunds": { + "type": "string", + "description": "Funds of remain transactions" }, - "stopPrice": { + "tax": { "type": "string", - "description": "stop price" + "description": "Users in some regions need query this field" }, - "orderTime": { - "type": "integer", - "description": "Time of place a stop order, accurate to nanoseconds", - "format": "int64" + "active": { + "type": "boolean", + "description": "Order status: true-The status of the order isactive; false-The status of the order is done" } - } - }, - "description": "the return code" + }, + "required": [ + "id", + "symbol", + "opType", + "type", + "side", + "price", + "size", + "funds", + "dealSize", + "dealFunds", + "fee", + "feeCurrency", + "timeInForce", + "postOnly", + "hidden", + "iceberg", + "visibleSize", + "cancelAfter", + "channel", + "clientOid", + "cancelExist", + "tradeType", + "inOrderBook", + "cancelledSize", + "cancelledFunds", + "remainSize", + "remainFunds", + "active", + "createdAt", + "lastUpdatedAt", + "tax" + ] + } } }, "required": [ @@ -9841,7 +9048,7 @@ } } }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470340", + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470178", "x-abandon": "normal", "x-domain": "Spot", "x-api-channel": "Private", @@ -9849,209 +9056,88 @@ "x-api-rate-limit-pool": "Spot", "x-sdk-service": "Spot", "x-sdk-sub-service": "Order", - "x-sdk-method-name": "getStopOrderByClientOid", - "x-sdk-method-description": "This interface is to obtain Spot stop order details by orderId", - "x-api-rate-limit": 3, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": [\\n {\\n \\\"id\\\": \\\"vs8hoo8os561f5np0032vngj\\\",\\n \\\"symbol\\\": \\\"KCS-USDT\\\",\\n \\\"userId\\\": \\\"60fe4956c43cbc0006562c2c\\\",\\n \\\"status\\\": \\\"NEW\\\",\\n \\\"type\\\": \\\"limit\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"price\\\": \\\"0.01000000000000000000\\\",\\n \\\"size\\\": \\\"0.01000000000000000000\\\",\\n \\\"funds\\\": null,\\n \\\"stp\\\": null,\\n \\\"timeInForce\\\": \\\"GTC\\\",\\n \\\"cancelAfter\\\": -1,\\n \\\"postOnly\\\": false,\\n \\\"hidden\\\": false,\\n \\\"iceberg\\\": false,\\n \\\"visibleSize\\\": null,\\n \\\"channel\\\": \\\"API\\\",\\n \\\"clientOid\\\": \\\"2b700942b5db41cebe578cff48960e09\\\",\\n \\\"remark\\\": null,\\n \\\"tags\\\": null,\\n \\\"orderTime\\\": 1629020492834532600,\\n \\\"domainId\\\": \\\"kucoin\\\",\\n \\\"tradeSource\\\": \\\"USER\\\",\\n \\\"tradeType\\\": \\\"TRADE\\\",\\n \\\"feeCurrency\\\": \\\"USDT\\\",\\n \\\"takerFeeRate\\\": \\\"0.00200000000000000000\\\",\\n \\\"makerFeeRate\\\": \\\"0.00200000000000000000\\\",\\n \\\"createdAt\\\": 1629020492837,\\n \\\"stop\\\": \\\"loss\\\",\\n \\\"stopTriggerTime\\\": null,\\n \\\"stopPrice\\\": \\\"1.00000000000000000000\\\"\\n }\\n ]\\n}", - "x-request-example": "{\\\"clientOid\\\": \\\"example_string_default_value\\\", \\\"symbol\\\": \\\"example_string_default_value\\\"}" + "x-sdk-method-name": "getOpenOrders", + "x-sdk-method-description": "This interface is to obtain all Spot active order lists, and the return value of the active order interface is the paged data of all uncompleted order lists. The returned data is sorted in descending order according to the latest update time of the order. After the user successfully places an order, the order is in Active state, and the user can use inOrderBook to determine whether the order has entered the order. Canceled or fully filled orders are marked as completed Done status.", + "x-api-rate-limit": 2, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": [\\n {\\n \\\"id\\\": \\\"67120bbef094e200070976f6\\\",\\n \\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\",\\n \\\"symbol\\\": \\\"BTC-USDT\\\",\\n \\\"opType\\\": \\\"DEAL\\\",\\n \\\"type\\\": \\\"limit\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"price\\\": \\\"50000\\\",\\n \\\"size\\\": \\\"0.00001\\\",\\n \\\"funds\\\": \\\"0.5\\\",\\n \\\"dealSize\\\": \\\"0\\\",\\n \\\"dealFunds\\\": \\\"0\\\",\\n \\\"fee\\\": \\\"0\\\",\\n \\\"feeCurrency\\\": \\\"USDT\\\",\\n \\\"stp\\\": null,\\n \\\"timeInForce\\\": \\\"GTC\\\",\\n \\\"postOnly\\\": false,\\n \\\"hidden\\\": false,\\n \\\"iceberg\\\": false,\\n \\\"visibleSize\\\": \\\"0\\\",\\n \\\"cancelAfter\\\": 0,\\n \\\"channel\\\": \\\"API\\\",\\n \\\"remark\\\": \\\"order remarks\\\",\\n \\\"tags\\\": \\\"order tags\\\",\\n \\\"cancelExist\\\": false,\\n \\\"tradeType\\\": \\\"TRADE\\\",\\n \\\"inOrderBook\\\": true,\\n \\\"cancelledSize\\\": \\\"0\\\",\\n \\\"cancelledFunds\\\": \\\"0\\\",\\n \\\"remainSize\\\": \\\"0.00001\\\",\\n \\\"remainFunds\\\": \\\"0.5\\\",\\n \\\"tax\\\": \\\"0\\\",\\n \\\"active\\\": true,\\n \\\"createdAt\\\": 1729235902748,\\n \\\"lastUpdatedAt\\\": 1729235909862\\n }\\n ]\\n}", + "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\"}" } }, - "/api/v1/stop-order/cancel": { - "delete": { - "summary": "Batch Cancel Stop Orders", + "/api/v1/hf/orders/done": { + "get": { + "summary": "Get Closed Orders", "deprecated": false, - "description": "This endpoint can be used to cancel a spot stop orders by batch.", + "description": "This interface is to obtain all Spot closed order lists, and the return value of the active order interface is the paged data of all uncompleted order lists. The returned data is sorted in descending order according to the latest update time of the order. After the user successfully places an order, the order is in Active state, and the user can use inOrderBook to determine whether the order has entered the order. Canceled or fully filled orders are marked as completed Done status.", "tags": [], "parameters": [ { "name": "symbol", "in": "query", - "description": "Cancel the open order for the specified symbol", - "required": false, - "schema": { - "type": "string" - } - }, - { - "name": "tradeType", - "in": "query", - "description": "The type of trading : TRADE(Spot), MARGIN_TRADE (Cross Margin), MARGIN_ISOLATED_TRADE (Isolated Margin). Default is TRADE", - "required": false, - "schema": { - "type": "string" - } - }, - { - "name": "orderIds", - "in": "query", - "description": "Comma seperated order IDs.", - "required": false, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "data": { - "type": "object", - "properties": { - "cancelledOrderIds": { - "type": "array", - "items": { - "type": "string" - }, - "description": "order id array" - } - }, - "required": [ - "cancelledOrderIds" - ] - } - }, - "required": [ - "code", - "data" - ] - } - } - } - } - }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470337", - "x-abandon": "normal", - "x-domain": "Spot", - "x-api-channel": "Private", - "x-api-permission": "Spot", - "x-api-rate-limit-pool": "Spot", - "x-sdk-service": "Spot", - "x-sdk-sub-service": "Order", - "x-sdk-method-name": "batchCancelStopOrder", - "x-sdk-method-description": "This endpoint can be used to cancel a spot stop orders by batch.", - "x-api-rate-limit": 3, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"cancelledOrderIds\\\": [\\n \\\"671124f9365ccb00073debd4\\\"\\n ]\\n }\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"example_string_default_value\\\", \\\"tradeType\\\": \\\"example_string_default_value\\\", \\\"orderIds\\\": \\\"example_string_default_value\\\"}" - } - }, - "/api/v3/oco/orders": { - "delete": { - "summary": "Batch Cancel OCO Order", - "deprecated": true, - "description": "This interface can batch cancel OCO orders through orderIds. You will receive cancelledOrderIds field once the system has received the cancellation request. The cancellation request will be processed by the matching engine in sequence. To know if the request is processed (successfully or not), you may check the order status or the update message from the pushes.", - "tags": [], - "parameters": [ - { - "name": "orderIds", - "in": "query", - "description": "Specify the order id, there can be multiple orders, separated by commas. If not passed, all oco orders will be canceled by default.", - "required": false, + "description": "symbol", + "required": true, "schema": { - "type": "string" + "type": "string", + "example": [ + "BTC-USDT", + "ETH-USDT", + "KCS-USDT" + ] } }, { - "name": "symbol", - "in": "query", - "description": "trading pair. If not passed, the oco orders of all symbols will be canceled by default.", - "required": false, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "data": { - "type": "object", - "properties": { - "cancelledOrderIds": { - "type": "array", - "items": { - "type": "string" - }, - "description": "List of two order IDs related to the canceled OCO order" - } - }, - "required": [ - "cancelledOrderIds" - ] - } - }, - "required": [ - "code", - "data" - ] - } - } - } - } - }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470356", - "x-abandon": "abandon", - "x-domain": "Spot", - "x-api-channel": "Private", - "x-api-permission": "Spot", - "x-api-rate-limit-pool": "Spot", - "x-sdk-service": "Spot", - "x-sdk-sub-service": "Order", - "x-sdk-method-name": "batchCancelOcoOrders", - "x-sdk-method-description": "This interface can batch cancel OCO orders through orderIds. You will receive cancelledOrderIds field once the system has received the cancellation request. The cancellation request will be processed by the matching engine in sequence. To know if the request is processed (successfully or not), you may check the order status or the update message from the pushes.", - "x-api-rate-limit": 3, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"cancelledOrderIds\\\": [\\n \\\"vs93gpqc750mkk57003gok6i\\\",\\n \\\"vs93gpqc750mkk57003gok6j\\\",\\n \\\"vs93gpqc75c39p83003tnriu\\\",\\n \\\"vs93gpqc75c39p83003tnriv\\\"\\n ]\\n }\\n}", - "x-request-example": "{\\\"orderIds\\\": \\\"674c388172cf2800072ee746,674c38bdfd8300000795167e\\\", \\\"symbol\\\": \\\"BTC-USDT\\\"}" - }, - "get": { - "summary": "Get OCO Order List", - "deprecated": true, - "description": "Request via this endpoint to get your current OCO order list. Items are paginated and sorted to show the latest first. See the Pagination section for retrieving additional entries after the first page.", - "tags": [], - "parameters": [ - { - "name": "symbol", + "name": "side", "in": "query", - "description": "symbol", + "description": "specify if the order is to 'buy' or 'sell'", "required": false, "schema": { "type": "string", - "example": [ - "BTC-USDT", - "ETH-USDT", - "KCS-USDT" + "enum": [ + "buy", + "sell" + ], + "x-api-enum": [ + { + "value": "buy", + "name": "", + "description": "" + }, + { + "value": "sell", + "name": "", + "description": "" + } ] } }, { - "name": "startAt", + "name": "type", "in": "query", - "description": "Start time (milliseconds)", + "description": "specify if the order is an 'limit' order or 'market' order. ", "required": false, "schema": { - "type": "integer", - "format": "int64" + "type": "string", + "enum": [ + "limit", + "market" + ], + "x-api-enum": [ + { + "value": "limit", + "name": "", + "description": "" + }, + { + "value": "market", + "name": "", + "description": "" + } + ] } }, { - "name": "endAt", + "name": "lastId", "in": "query", - "description": "End time (milliseconds)", + "description": "The id of the last set of data from the previous batch of data. By default, the latest information is given.\nlastId is used to filter data and paginate. If lastId is not entered, the default is a maximum of 100 returned data items. The return results include lastId,which can be used as a query parameter to look up new data from the next page.", "required": false, "schema": { "type": "integer", @@ -10059,34 +9145,35 @@ } }, { - "name": "orderIds", + "name": "limit", "in": "query", - "description": "Specify orderId collection, up to 500 orders\n", + "description": "Default20,Max100", "required": false, "schema": { - "type": "string" + "type": "integer", + "default": 20, + "minimum": 1, + "maximum": 100 } }, { - "name": "pageSize", + "name": "startAt", "in": "query", - "description": "Size per page, minimum value 10, maximum value 500", + "description": "Start time (milisecond)", "required": false, "schema": { "type": "integer", - "minimum": 10, - "maximum": 500, - "default": 50 + "format": "int64" } }, { - "name": "currentPage", + "name": "endAt", "in": "query", - "description": "Page number, minimum value 1\n", + "description": "End time (milisecond)", "required": false, "schema": { "type": "integer", - "default": 1 + "format": "int64" } } ], @@ -10104,88 +9191,282 @@ "data": { "type": "object", "properties": { - "currentPage": { - "type": "integer" - }, - "pageSize": { - "type": "integer" - }, - "totalNum": { - "type": "integer" - }, - "totalPage": { - "type": "integer" + "lastId": { + "type": "integer", + "description": "The id of the last set of data from the previous batch of data. By default, the latest information is given.\nlastId is used to filter data and paginate. If lastId is not entered, the default is a maximum of 100 returned data items. The return results include lastId,which can be used as a query parameter to look up new data from the next page.", + "format": "int64" }, "items": { "type": "array", "items": { "type": "object", "properties": { - "orderId": { + "id": { + "type": "string", + "description": "The unique order id generated by the trading system" + }, + "symbol": { + "type": "string", + "description": "symbol", + "example": [ + "BTC-USDT", + "ETH-USDT", + "KCS-USDT" + ] + }, + "opType": { + "type": "string" + }, + "type": { + "type": "string", + "description": "Specify if the order is an 'limit' order or 'market' order. ", + "enum": [ + "limit", + "market" + ], + "x-api-enum": [ + { + "value": "limit", + "name": "", + "description": "" + }, + { + "value": "market", + "name": "", + "description": "" + } + ] + }, + "side": { + "type": "string", + "description": "Buy or sell", + "enum": [ + "buy", + "sell" + ], + "x-api-enum": [ + { + "value": "buy", + "name": "", + "description": "" + }, + { + "value": "sell", + "name": "", + "description": "" + } + ] + }, + "price": { + "type": "string", + "description": "Order price" + }, + "size": { + "type": "string", + "description": "Order size" + }, + "funds": { + "type": "string", + "description": "Order Funds" + }, + "dealSize": { + "type": "string", + "description": "Number of filled transactions" + }, + "dealFunds": { + "type": "string", + "description": "Funds of filled transactions" + }, + "fee": { + "type": "string", + "description": "[Handling fees](https://www.kucoin.com/docs-new/api-5327739)" + }, + "feeCurrency": { + "type": "string", + "description": "currency used to calculate trading fee" + }, + "stp": { + "type": "string", + "description": "[Self Trade Prevention](https://www.kucoin.com/docs-new/api-5176570)", + "enum": [ + "DC", + "CO", + "CN", + "CB" + ], + "x-api-enum": [ + { + "value": "DC", + "name": "", + "description": "" + }, + { + "value": "CO", + "name": "", + "description": "" + }, + { + "value": "CN", + "name": "", + "description": "" + }, + { + "value": "CB", + "name": "", + "description": "" + } + ] + }, + "timeInForce": { + "type": "string", + "description": "Time in force", + "enum": [ + "GTC", + "GTT", + "IOC", + "FOK" + ], + "x-api-enum": [ + { + "value": "GTC", + "name": "", + "description": "" + }, + { + "value": "GTT", + "name": "", + "description": "" + }, + { + "value": "IOC", + "name": "", + "description": "" + }, + { + "value": "FOK", + "name": "", + "description": "" + } + ] + }, + "postOnly": { + "type": "boolean", + "description": "Whether its a postOnly order." + }, + "hidden": { + "type": "boolean", + "description": "Whether its a hidden order." + }, + "iceberg": { + "type": "boolean", + "description": "Whether its a iceberg order." + }, + "visibleSize": { + "type": "string", + "description": "Visible size of iceberg order in order book." + }, + "cancelAfter": { + "type": "integer", + "description": "A GTT timeInForce that expires in n seconds" + }, + "channel": { + "type": "string" + }, + "clientOid": { "type": "string", - "description": "The unique order id generated by the trading system,which can be used later for further actions such as canceling the order." + "description": "Client Order Id,unique identifier created by the user" }, - "symbol": { + "remark": { "type": "string", - "description": "symbol" + "description": "Order placement remarks" }, - "clientOid": { + "tags": { "type": "string", - "description": "Client Order Id" + "description": "Order tag" }, - "orderTime": { + "cancelExist": { + "type": "boolean", + "description": "Whether there is a cancellation record for the order." + }, + "createdAt": { "type": "integer", - "description": "Order placement time, milliseconds", "format": "int64" }, - "status": { + "lastUpdatedAt": { + "type": "integer", + "format": "int64" + }, + "tradeType": { "type": "string", - "description": "Order status: NEW: New, DONE: Completed, TRIGGERED: Triggered, CANCELLED: Cancelled", - "enum": [ - "NEW", - "DONE", - "TRIGGERED", - "CANCELLED" - ], - "x-api-enum": [ - { - "value": "NEW", - "name": "NEW", - "description": "New" - }, - { - "value": "DONE", - "name": "DONE", - "description": "Completed" - }, - { - "value": "TRIGGERED", - "name": "TRIGGERED", - "description": "Triggered" - }, - { - "value": "CANCELLED", - "name": "CANCELLED", - "description": "Cancelled" - } - ] + "description": "Trade type, redundancy param" + }, + "inOrderBook": { + "type": "boolean", + "description": "Whether to enter the orderbook: true: enter the orderbook; false: not enter the orderbook" + }, + "cancelledSize": { + "type": "string", + "description": "Number of canceled transactions" + }, + "cancelledFunds": { + "type": "string", + "description": "Funds of canceled transactions" + }, + "remainSize": { + "type": "string", + "description": "Number of remain transactions" + }, + "remainFunds": { + "type": "string", + "description": "Funds of remain transactions" + }, + "tax": { + "type": "string", + "description": "Users in some regions need query this field" + }, + "active": { + "type": "boolean", + "description": "Order status: true-The status of the order isactive; false-The status of the order is done" } }, "required": [ - "orderId", + "feeCurrency", + "id", "symbol", + "opType", + "type", + "side", + "price", + "size", + "funds", + "dealSize", + "fee", + "timeInForce", + "dealFunds", "clientOid", - "orderTime", - "status" + "remainSize", + "remainFunds", + "cancelledSize", + "cancelledFunds", + "lastUpdatedAt", + "createdAt", + "tax", + "active", + "cancelExist", + "tradeType", + "inOrderBook", + "postOnly", + "hidden", + "iceberg", + "visibleSize", + "cancelAfter", + "channel" ] } } }, "required": [ - "currentPage", - "pageSize", - "totalNum", - "totalPage", + "lastId", "items" ] } @@ -10199,19 +9480,19 @@ } } }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470360", - "x-abandon": "abandon", + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470179", + "x-abandon": "normal", "x-domain": "Spot", "x-api-channel": "Private", "x-api-permission": "General", "x-api-rate-limit-pool": "Spot", "x-sdk-service": "Spot", "x-sdk-sub-service": "Order", - "x-sdk-method-name": "getOcoOrderList", - "x-sdk-method-description": "Request via this endpoint to get your current OCO order list. Items are paginated and sorted to show the latest first. See the Pagination section for retrieving additional entries after the first page.", + "x-sdk-method-name": "getClosedOrders", + "x-sdk-method-description": "This interface is to obtain all Spot closed order lists, and the return value of the active order interface is the paged data of all uncompleted order lists. The returned data is sorted in descending order according to the latest update time of the order. After the user successfully places an order, the order is in Active state, and the user can use inOrderBook to determine whether the order has entered the order. Canceled or fully filled orders are marked as completed Done status.", "x-api-rate-limit": 2, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"currentPage\\\": 1,\\n \\\"pageSize\\\": 50,\\n \\\"totalNum\\\": 1,\\n \\\"totalPage\\\": 1,\\n \\\"items\\\": [\\n {\\n \\\"orderId\\\": \\\"674c3cfa72cf2800072ee7ce\\\",\\n \\\"symbol\\\": \\\"BTC-USDT\\\",\\n \\\"clientOid\\\": \\\"5c52e1203aa6f3g7f1e493fb\\\",\\n \\\"orderTime\\\": 1733049594803,\\n \\\"status\\\": \\\"NEW\\\"\\n }\\n ]\\n }\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"startAt\\\": 123456, \\\"endAt\\\": 123456, \\\"orderIds\\\": \\\"example_string_default_value\\\", \\\"pageSize\\\": 50, \\\"currentPage\\\": 1}" + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"lastId\\\": 19814995255305,\\n \\\"items\\\": [\\n {\\n \\\"id\\\": \\\"6717422bd51c29000775ea03\\\",\\n \\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\",\\n \\\"symbol\\\": \\\"BTC-USDT\\\",\\n \\\"opType\\\": \\\"DEAL\\\",\\n \\\"type\\\": \\\"limit\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"price\\\": \\\"70000\\\",\\n \\\"size\\\": \\\"0.00001\\\",\\n \\\"funds\\\": \\\"0.7\\\",\\n \\\"dealSize\\\": \\\"0.00001\\\",\\n \\\"dealFunds\\\": \\\"0.677176\\\",\\n \\\"remainSize\\\": \\\"0\\\",\\n \\\"remainFunds\\\": \\\"0.022824\\\",\\n \\\"cancelledSize\\\": \\\"0\\\",\\n \\\"cancelledFunds\\\": \\\"0\\\",\\n \\\"fee\\\": \\\"0.000677176\\\",\\n \\\"feeCurrency\\\": \\\"USDT\\\",\\n \\\"stp\\\": null,\\n \\\"timeInForce\\\": \\\"GTC\\\",\\n \\\"postOnly\\\": false,\\n \\\"hidden\\\": false,\\n \\\"iceberg\\\": false,\\n \\\"visibleSize\\\": \\\"0\\\",\\n \\\"cancelAfter\\\": 0,\\n \\\"channel\\\": \\\"API\\\",\\n \\\"remark\\\": \\\"order remarks\\\",\\n \\\"tags\\\": null,\\n \\\"cancelExist\\\": false,\\n \\\"tradeType\\\": \\\"TRADE\\\",\\n \\\"inOrderBook\\\": false,\\n \\\"active\\\": false,\\n \\\"tax\\\": \\\"0\\\",\\n \\\"createdAt\\\": 1729577515444,\\n \\\"lastUpdatedAt\\\": 1729577515481\\n }\\n ]\\n }\\n}", + "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"side\\\": \\\"buy\\\", \\\"type\\\": \\\"limit\\\", \\\"lastId\\\": 254062248624417, \\\"limit\\\": 20, \\\"startAt\\\": 1728663338000, \\\"endAt\\\": 1728692138000}" } }, "/api/v1/hf/fills": { @@ -10517,57 +9798,450 @@ }, "lastId": { "type": "integer", - "description": "The id of the last set of data from the previous batch of data. By default, the latest information is given.\nlastId is used to filter data and paginate. If lastId is not entered, the default is a maximum of 100 returned data items. The return results include lastId,which can be used as a query parameter to look up new data from the next page.", - "format": "int64" + "description": "The id of the last set of data from the previous batch of data. By default, the latest information is given.\nlastId is used to filter data and paginate. If lastId is not entered, the default is a maximum of 100 returned data items. The return results include lastId,which can be used as a query parameter to look up new data from the next page.", + "format": "int64" + } + }, + "required": [ + "items", + "lastId" + ] + } + }, + "required": [ + "code", + "data" + ] + } + } + } + } + }, + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470180", + "x-abandon": "normal", + "x-domain": "Spot", + "x-api-channel": "Private", + "x-api-permission": "General", + "x-api-rate-limit-pool": "Spot", + "x-sdk-service": "Spot", + "x-sdk-sub-service": "Order", + "x-sdk-method-name": "getTradeHistory", + "x-sdk-method-description": "This endpoint can be used to obtain a list of the latest Spot transaction details. The returned data is sorted in descending order according to the latest update time of the order.", + "x-api-rate-limit": 2, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"items\\\": [\\n {\\n \\\"id\\\": 19814995255305,\\n \\\"orderId\\\": \\\"6717422bd51c29000775ea03\\\",\\n \\\"counterOrderId\\\": \\\"67174228135f9e000709da8c\\\",\\n \\\"tradeId\\\": 11029373945659392,\\n \\\"symbol\\\": \\\"BTC-USDT\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"liquidity\\\": \\\"taker\\\",\\n \\\"type\\\": \\\"limit\\\",\\n \\\"forceTaker\\\": false,\\n \\\"price\\\": \\\"67717.6\\\",\\n \\\"size\\\": \\\"0.00001\\\",\\n \\\"funds\\\": \\\"0.677176\\\",\\n \\\"fee\\\": \\\"0.000677176\\\",\\n \\\"feeRate\\\": \\\"0.001\\\",\\n \\\"feeCurrency\\\": \\\"USDT\\\",\\n \\\"stop\\\": \\\"\\\",\\n \\\"tradeType\\\": \\\"TRADE\\\",\\n \\\"taxRate\\\": \\\"0\\\",\\n \\\"tax\\\": \\\"0\\\",\\n \\\"createdAt\\\": 1729577515473\\n }\\n ],\\n \\\"lastId\\\": 19814995255305\\n }\\n}", + "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"orderId\\\": \\\"example_string_default_value\\\", \\\"side\\\": \\\"buy\\\", \\\"type\\\": \\\"limit\\\", \\\"lastId\\\": 254062248624417, \\\"limit\\\": 100, \\\"startAt\\\": 1728663338000, \\\"endAt\\\": 1728692138000}" + } + }, + "/api/v1/hf/orders/dead-cancel-all/query": { + "get": { + "summary": "Get DCP", + "deprecated": false, + "description": "Get Disconnection Protect(Deadman Swich)Through this interface, you can query the settings of automatic order cancellation", + "tags": [], + "parameters": [], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "object", + "properties": { + "timeout": { + "type": "integer", + "description": "Auto cancel order trigger setting time, the unit is second. range: timeout=-1 (meaning unset) or 5 <= timeout <= 86400" + }, + "symbols": { + "type": "string", + "description": "List of trading pairs. Separated by commas, empty means all trading pairs" + }, + "currentTime": { + "type": "integer", + "description": "System current time (in seconds)" + }, + "triggerTime": { + "type": "integer", + "description": "Trigger cancellation time (in seconds)" + } + }, + "description": "If the data is empty, it means that DCP is not set.", + "additionalProperties": false + } + }, + "required": [ + "code", + "data" + ] + } + } + } + } + }, + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470172", + "x-abandon": "normal", + "x-domain": "Spot", + "x-api-channel": "Private", + "x-api-permission": "Spot", + "x-api-rate-limit-pool": "Spot", + "x-sdk-service": "Spot", + "x-sdk-sub-service": "Order", + "x-sdk-method-name": "getDCP", + "x-sdk-method-description": "Get Disconnection Protect(Deadman Swich)Through this interface, you can query the settings of automatic order cancellation", + "x-api-rate-limit": 2, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"timeout\\\": 5,\\n \\\"symbols\\\": \\\"BTC-USDT,ETH-USDT\\\",\\n \\\"currentTime\\\": 1729241305,\\n \\\"triggerTime\\\": 1729241308\\n }\\n}" + } + }, + "/api/v1/hf/orders/dead-cancel-all": { + "post": { + "summary": "Set DCP", + "deprecated": false, + "description": "Set Disconnection Protect(Deadman Swich)Through this interface, Call this interface to automatically cancel all orders of the set trading pair after the specified time. If this interface is not called again for renewal or cancellation before the set time, the system will help the user to cancel the order of the corresponding trading pair. Otherwise it will not.", + "tags": [], + "parameters": [], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "object", + "properties": { + "currentTime": { + "type": "integer", + "description": "System current time (in seconds)" + }, + "triggerTime": { + "type": "integer", + "description": "Trigger cancellation time (in seconds)" } }, "required": [ - "items", - "lastId" + "currentTime", + "triggerTime" + ], + "description": "If the data is empty, it means that DCP is not set." + } + }, + "required": [ + "code", + "data" + ] + } + } + } + } + }, + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470173", + "x-abandon": "normal", + "x-domain": "Spot", + "x-api-channel": "Private", + "x-api-permission": "Spot", + "x-api-rate-limit-pool": "Spot", + "x-sdk-service": "Spot", + "x-sdk-sub-service": "Order", + "x-sdk-method-name": "setDCP", + "x-sdk-method-description": "Set Disconnection Protect(Deadman Swich)Through this interface, Call this interface to automatically cancel all orders of the set trading pair after the specified time. If this interface is not called again for renewal or cancellation before the set time, the system will help the user to cancel the order of the corresponding trading pair. Otherwise it will not.", + "x-api-rate-limit": 2, + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "timeout": { + "type": "integer", + "description": "Auto cancel order trigger setting time, the unit is second. range: timeout=-1 (meaning unset) or 5 <= timeout <= 86400. For example, timeout=5 means that the order will be automatically canceled if no user request is received for more than 5 seconds. When this parameter is changed, the previous setting will be overwritten." + }, + "symbols": { + "type": "string", + "description": "List of trading pairs. When this parameter is not empty, separate it with commas and support up to 50 trading pairs. Empty means all trading pairs. When this parameter is changed, the previous setting will be overwritten.", + "example": [ + "BTC-USDT,ETH-USDT" + ] + } + }, + "required": [ + "timeout" + ] + }, + "example": "{\n \"timeout\": 5,\n \"symbols\": \"BTC-USDT,ETH-USDT\"\n}" + } + } + }, + "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"currentTime\\\":1729656588,\\\"triggerTime\\\":1729656593}}", + "x-request-example": "{\\\"timeout\\\": 5, \\\"symbols\\\": \\\"BTC-USDT,ETH-USDT\\\"}" + } + }, + "/api/v1/stop-order": { + "post": { + "summary": "Add Stop Order", + "deprecated": true, + "description": "Place stop order to the Spot trading system, you can place two major types of orders: limit and market. Orders can only be placed if your account has sufficient funds. Once an order is placed, your funds will be put on hold for the duration of the order. The amount of funds on hold depends on the order type and parameters specified.", + "tags": [], + "parameters": [], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "object", + "properties": { + "orderId": { + "type": "string", + "description": "The unique order id generated by the trading system,which can be used later for further actions such as canceling the order." + }, + "clientOid": { + "type": "string", + "description": "The user self-defined order id." + } + }, + "required": [ + "orderId", + "clientOid" ] } }, - "required": [ - "code", - "data" - ] - } - } + "required": [ + "code", + "data" + ] + } + } + } + } + }, + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470334", + "x-abandon": "abandon", + "x-domain": "Spot", + "x-api-channel": "Private", + "x-api-permission": "Spot", + "x-api-rate-limit-pool": "Spot", + "x-sdk-service": "Spot", + "x-sdk-sub-service": "Order", + "x-sdk-method-name": "addStopOrder", + "x-sdk-method-description": "Place stop order to the Spot trading system, you can place two major types of orders: limit and market. Orders can only be placed if your account has sufficient funds. Once an order is placed, your funds will be put on hold for the duration of the order. The amount of funds on hold depends on the order type and parameters specified.", + "x-api-rate-limit": 1, + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "clientOid": { + "type": "string", + "description": "Client Order Id,The ClientOid field is a unique ID created by the user(we recommend using a UUID), and can only contain numbers, letters, underscores (_), and hyphens (-). This field is returned when order information is obtained. You can use clientOid to tag your orders. ClientOid is different from the order ID created by the service provider. Please do not initiate requests using the same clientOid. The maximum length for the ClientOid is 40 characters.\n\nPlease remember the orderId created by the service provider, it used to check for updates in order status.", + "example": [ + "5c52e11203aa677f33e493fb" + ] + }, + "side": { + "type": "string", + "description": "specify if the order is to 'buy' or 'sell'", + "enum": [ + "buy", + "sell" + ], + "x-api-enum": [ + { + "value": "buy", + "name": "", + "description": "" + }, + { + "value": "sell", + "name": "", + "description": "" + } + ], + "example": [ + "buy" + ] + }, + "symbol": { + "type": "string", + "description": "symbol", + "example": [ + "BTC-USDT", + "ETH-USDT", + "KCS-USDT" + ] + }, + "type": { + "type": "string", + "description": "specify if the order is an 'limit' order or 'market' order. \n\nThe type of order you specify when you place your order determines whether or not you need to request other parameters and also affects the execution of the matching engine.\n\nWhen placing a limit order, you must specify a price and size. The system will try to match the order according to market price or a price better than market price. If the order cannot be immediately matched, it will stay in the order book until it is matched or the user cancels.\n\nUnlike limit orders, the price for market orders fluctuates with market prices. When placing a market order, you do not need to specify a price, you only need to specify a quantity. Market orders are filled immediately and will not enter the order book. All market orders are takers and a taker fee will be charged.", + "enum": [ + "limit", + "market" + ], + "x-api-enum": [ + { + "value": "limit", + "name": "", + "description": "" + }, + { + "value": "market", + "name": "", + "description": "" + } + ], + "example": [ + "limit" + ] + }, + "remark": { + "type": "string", + "description": "Order placement remarks, length cannot exceed 20 characters (ASCII)" + }, + "stp": { + "type": "string", + "description": "[Self Trade Prevention](https://www.kucoin.com/docs-new/doc-338146) is divided into four strategies: CN, CO, CB , and DC", + "enum": [ + "DC", + "CO", + "CN", + "CB" + ], + "x-api-enum": [ + { + "value": "DC", + "name": "", + "description": "" + }, + { + "value": "CO", + "name": "", + "description": "" + }, + { + "value": "CN", + "name": "", + "description": "" + }, + { + "value": "CB", + "name": "", + "description": "" + } + ] + }, + "price": { + "type": "string", + "description": "Specify price for order, not need for market order.\n\nWhen placing a limit order, the price must be based on priceIncrement for the trading pair. The price increment (priceIncrement) is the price precision for the trading pair. For example, for the BTC-USDT trading pair, the priceIncrement is 0.00001000. So the price for your orders cannot be less than 0.00001000 and must be a multiple of priceIncrement. Otherwise, the order will return an invalid priceIncrement error." + }, + "size": { + "type": "string", + "description": "Specify quantity for order\n\nWhen **type** is limit, size refers to the amount of trading targets (the asset name written in front) for the trading pair. Teh Size must be based on the baseIncrement of the trading pair. The baseIncrement represents the precision for the trading pair. The size of an order must be a positive-integer multiple of baseIncrement and must be between baseMinSize and baseMaxSize.\n\nWhen **type** is market, select one out of two: size or funds" + }, + "timeInForce": { + "type": "string", + "description": "[Time in force](https://www.kucoin.com/docs-new/doc-338146) is a special strategy used during trading. Required for limit orders.", + "enum": [ + "GTC", + "GTT", + "IOC", + "FOK" + ], + "default": "GTC", + "x-api-enum": [ + { + "value": "GTC", + "name": "", + "description": "" + }, + { + "value": "GTT", + "name": "", + "description": "" + }, + { + "value": "IOC", + "name": "", + "description": "" + }, + { + "value": "FOK", + "name": "", + "description": "" + } + ] + }, + "postOnly": { + "type": "boolean", + "description": "passive order labels, this is disabled when the order timing strategy is IOC or FOK if **type** is limit.", + "default": false + }, + "hidden": { + "type": "boolean", + "description": "[Hidden order](https://www.kucoin.com/docs-new/doc-338146) or not (not shown in order book)", + "default": false + }, + "iceberg": { + "type": "boolean", + "description": "Whether or not only visible portions of orders are shown in [Iceberg orders](https://www.kucoin.com/docs-new/doc-338146)", + "default": false + }, + "visibleSize": { + "type": "string", + "description": "When **type** is limit, this is Maximum visible quantity in iceberg orders." + }, + "cancelAfter": { + "type": "integer", + "description": "Cancel after n seconds,the order timing strategy is GTT when **type** is limit.", + "format": "int64" + }, + "funds": { + "type": "string", + "description": "When **type** is market, select one out of two: size or funds" + }, + "stopPrice": { + "type": "string", + "description": "The trigger price." + }, + "tradeType": { + "type": "string", + "description": "The type of trading : TRADE(Spot), MARGIN_TRADE (Cross Margin), MARGIN_ISOLATED_TRADE (Isolated Margin). Default is TRADE" + } + }, + "required": [ + "symbol", + "type", + "side", + "stopPrice" + ] + }, + "example": "//limit order\n{\n \"type\": \"limit\",\n \"symbol\": \"BTC-USDT\",\n \"side\": \"buy\",\n \"price\": \"50000\",\n \"size\": \"0.00001\",\n \"clientOid\": \"5c52e11203aa677f33e493fb\",\n \"remark\": \"order remarks\"\n}\n\n//market order 1\n// {\n// \"type\": \"market\",\n// \"symbol\": \"BTC-USDT\",\n// \"side\": \"buy\",\n// \"size\": \"0.00001\",\n// \"clientOid\": \"5c52e11203aa677f33e493fc\",\n// \"remark\": \"order remarks\"\n// }\n\n//market order 2\n// {\n// \"type\": \"market\",\n// \"symbol\": \"BTC-USDT\",\n// \"side\": \"buy\",\n// \"funds\": \"1\",\n// \"clientOid\": \"5c52e11203aa677f33e493fc\",\n// \"remark\": \"order remarks\"\n// }\n" } } }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470180", - "x-abandon": "normal", - "x-domain": "Spot", - "x-api-channel": "Private", - "x-api-permission": "General", - "x-api-rate-limit-pool": "Spot", - "x-sdk-service": "Spot", - "x-sdk-sub-service": "Order", - "x-sdk-method-name": "getTradeHistory", - "x-sdk-method-description": "This endpoint can be used to obtain a list of the latest Spot transaction details. The returned data is sorted in descending order according to the latest update time of the order.", - "x-api-rate-limit": 2, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"items\\\": [\\n {\\n \\\"id\\\": 19814995255305,\\n \\\"orderId\\\": \\\"6717422bd51c29000775ea03\\\",\\n \\\"counterOrderId\\\": \\\"67174228135f9e000709da8c\\\",\\n \\\"tradeId\\\": 11029373945659392,\\n \\\"symbol\\\": \\\"BTC-USDT\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"liquidity\\\": \\\"taker\\\",\\n \\\"type\\\": \\\"limit\\\",\\n \\\"forceTaker\\\": false,\\n \\\"price\\\": \\\"67717.6\\\",\\n \\\"size\\\": \\\"0.00001\\\",\\n \\\"funds\\\": \\\"0.677176\\\",\\n \\\"fee\\\": \\\"0.000677176\\\",\\n \\\"feeRate\\\": \\\"0.001\\\",\\n \\\"feeCurrency\\\": \\\"USDT\\\",\\n \\\"stop\\\": \\\"\\\",\\n \\\"tradeType\\\": \\\"TRADE\\\",\\n \\\"taxRate\\\": \\\"0\\\",\\n \\\"tax\\\": \\\"0\\\",\\n \\\"createdAt\\\": 1729577515473\\n }\\n ],\\n \\\"lastId\\\": 19814995255305\\n }\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"orderId\\\": \\\"example_string_default_value\\\", \\\"side\\\": \\\"buy\\\", \\\"type\\\": \\\"limit\\\", \\\"lastId\\\": 254062248624417, \\\"limit\\\": 100, \\\"startAt\\\": 1728663338000, \\\"endAt\\\": 1728692138000}" - } - }, - "/api/v3/oco/order/details/{orderId}": { + "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"orderId\\\":\\\"670fd33bf9406e0007ab3945\\\",\\\"clientOid\\\":\\\"5c52e11203aa677f33e493fb\\\"}}", + "x-request-example": "{\\\"type\\\": \\\"limit\\\", \\\"symbol\\\": \\\"BTC-USDT\\\", \\\"side\\\": \\\"buy\\\", \\\"price\\\": \\\"50000\\\", \\\"size\\\": \\\"0.00001\\\", \\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\", \\\"remark\\\": \\\"order remarks\\\"}" + }, "get": { - "summary": "Get OCO Order Detail By OrderId", - "deprecated": true, - "description": "Request via this interface to get a oco order detail via the order ID.", + "summary": "Get Stop Orders List", + "deprecated": false, + "description": "This interface is to obtain all Spot active stop order lists", "tags": [], - "parameters": [ - { - "name": "orderId", - "in": "path", - "description": "The unique order id generated by the trading system", - "required": true, - "schema": { - "type": "string" - } - } - ], + "parameters": [], "responses": { "200": { "description": "", @@ -10582,78 +10256,160 @@ "data": { "type": "object", "properties": { - "orderId": { - "type": "string", - "description": "The unique order id generated by the trading system,which can be used later for further actions such as canceling the order." - }, - "symbol": { - "type": "string", - "description": "symbol" + "currentPage": { + "type": "integer", + "description": "current page id" }, - "clientOid": { - "type": "string", - "description": "Client Order Id" + "pageSize": { + "type": "integer" }, - "orderTime": { + "totalNum": { "type": "integer", - "description": "Order placement time, milliseconds", - "format": "int64" + "description": "the stop order count" }, - "status": { - "type": "string", - "description": "Order status: NEW: New, DONE: Completed, TRIGGERED: Triggered, CANCELLED: Cancelled" + "totalPage": { + "type": "integer", + "description": "total page count of the list" }, - "orders": { + "items": { "type": "array", "items": { "type": "object", "properties": { "id": { - "type": "string" + "type": "string", + "description": "Order ID, the ID of an order." }, "symbol": { - "type": "string" + "type": "string", + "description": "Symbol name" + }, + "userId": { + "type": "string", + "description": "User ID" + }, + "status": { + "type": "string", + "description": "Order status, include NEW, TRIGGERED" + }, + "type": { + "type": "string", + "description": "Order type,limit, market, limit_stop or market_stop" }, "side": { - "type": "string" + "type": "string", + "description": "transaction direction,include buy and sell" }, "price": { - "type": "string" - }, - "stopPrice": { - "type": "string" + "type": "string", + "description": "order price" }, "size": { - "type": "string" + "type": "string", + "description": "order quantity" }, - "status": { + "funds": { + "type": "string", + "description": "order funds" + }, + "stp": { "type": "string" + }, + "timeInForce": { + "type": "string", + "description": "time InForce,include GTC,GTT,IOC,FOK" + }, + "cancelAfter": { + "type": "integer", + "description": "cancel orders after n seconds,requires timeInForce to be GTT" + }, + "postOnly": { + "type": "boolean", + "description": "postOnly" + }, + "hidden": { + "type": "boolean", + "description": "hidden order" + }, + "iceberg": { + "type": "boolean", + "description": "Iceberg order" + }, + "visibleSize": { + "type": "string", + "description": "displayed quantity for iceberg order" + }, + "channel": { + "type": "string", + "description": "order source" + }, + "clientOid": { + "type": "string", + "description": "user-entered order unique mark" + }, + "remark": { + "type": "string", + "description": "Remarks at stop order creation" + }, + "tags": { + "type": "string", + "description": "tag order source" + }, + "orderTime": { + "type": "integer", + "description": "Time of place a stop order, accurate to nanoseconds", + "format": "int64" + }, + "domainId": { + "type": "string", + "description": "domainId, e.g: kucoin" + }, + "tradeSource": { + "type": "string", + "description": "trade source: USER(Order by user), MARGIN_SYSTEM(Order by margin system)" + }, + "tradeType": { + "type": "string", + "description": "The type of trading : TRADE(Spot), MARGIN_TRADE (Cross Margin), MARGIN_ISOLATED_TRADE (Isolated Margin)." + }, + "feeCurrency": { + "type": "string", + "description": "The currency of the fee" + }, + "takerFeeRate": { + "type": "string", + "description": "Fee Rate of taker" + }, + "makerFeeRate": { + "type": "string", + "description": "Fee Rate of maker" + }, + "createdAt": { + "type": "integer", + "description": "order creation time", + "format": "int64" + }, + "stop": { + "type": "string", + "description": "Stop order type, include loss and entry" + }, + "stopTriggerTime": { + "type": "integer", + "description": "The trigger time of the stop order", + "format": "int64" + }, + "stopPrice": { + "type": "string", + "description": "stop price" } - }, - "required": [ - "id", - "symbol", - "side", - "price", - "stopPrice", - "size", - "status" - ] - } + } + }, + "description": "the list of stop orders" } - }, - "required": [ - "orderId", - "symbol", - "clientOid", - "orderTime", - "status", - "orders" - ] + } } }, "required": [ - "code", "data" ] } @@ -10661,32 +10417,165 @@ } } }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470359", - "x-abandon": "abandon", + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470338", + "x-abandon": "normal", "x-domain": "Spot", "x-api-channel": "Private", "x-api-permission": "General", "x-api-rate-limit-pool": "Spot", "x-sdk-service": "Spot", "x-sdk-sub-service": "Order", - "x-sdk-method-name": "getOcoOrderDetailByOrderId", - "x-sdk-method-description": "Request via this interface to get a oco order detail via the order ID.", - "x-api-rate-limit": 2, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"orderId\\\": \\\"674c3b6e688dea0007c7bab2\\\",\\n \\\"symbol\\\": \\\"BTC-USDT\\\",\\n \\\"clientOid\\\": \\\"5c52e1203aa6f37f1e493fb\\\",\\n \\\"orderTime\\\": 1733049198863,\\n \\\"status\\\": \\\"NEW\\\",\\n \\\"orders\\\": [\\n {\\n \\\"id\\\": \\\"vs93gpqc7dn6h3fa003sfelj\\\",\\n \\\"symbol\\\": \\\"BTC-USDT\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"price\\\": \\\"94000.00000000000000000000\\\",\\n \\\"stopPrice\\\": \\\"94000.00000000000000000000\\\",\\n \\\"size\\\": \\\"0.10000000000000000000\\\",\\n \\\"status\\\": \\\"NEW\\\"\\n },\\n {\\n \\\"id\\\": \\\"vs93gpqc7dn6h3fa003sfelk\\\",\\n \\\"symbol\\\": \\\"BTC-USDT\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"price\\\": \\\"96000.00000000000000000000\\\",\\n \\\"stopPrice\\\": \\\"98000.00000000000000000000\\\",\\n \\\"size\\\": \\\"0.10000000000000000000\\\",\\n \\\"status\\\": \\\"NEW\\\"\\n }\\n ]\\n }\\n}", - "x-request-example": "{\\\"orderId\\\": \\\"674c3b6e688dea0007c7bab2\\\"}" + "x-sdk-method-name": "getStopOrdersList", + "x-sdk-method-description": "This interface is to obtain all Spot active stop order lists", + "x-api-rate-limit": 8, + "x-request-force-json": true, + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "symbol": { + "type": "string", + "description": "Only list orders for a specific symbol" + }, + "side": { + "type": "string", + "enum": [ + "buy", + "sell" + ], + "description": "buy or sell", + "x-api-enum": [ + { + "value": "buy", + "name": "buy", + "description": "" + }, + { + "value": "sell", + "name": "sell", + "description": "" + } + ] + }, + "type": { + "type": "string", + "description": "limit, market, limit_stop or market_stop", + "enum": [ + "limit", + "market", + "limit_stop", + "market_stop" + ], + "x-api-enum": [ + { + "value": "limit", + "name": "limit", + "description": "" + }, + { + "value": "market", + "name": "market", + "description": "" + }, + { + "value": "limit_stop", + "name": "limit_stop", + "description": "" + }, + { + "value": "market_stop", + "name": "market_stop", + "description": "" + } + ] + }, + "tradeType": { + "type": "string", + "description": "The type of trading : TRADE(Spot), MARGIN_TRADE (Cross Margin), MARGIN_ISOLATED_TRADE (Isolated Margin). Default is TRADE", + "enum": [ + "TRADE", + "MARGIN_TRADE", + "MARGIN_ISOLATED_TRADE" + ], + "x-api-enum": [ + { + "value": "TRADE", + "name": "TRADE", + "description": "" + }, + { + "value": "MARGIN_TRADE", + "name": "MARGIN_TRADE", + "description": "" + }, + { + "value": "MARGIN_ISOLATED_TRADE", + "name": "MARGIN_ISOLATED_TRADE", + "description": "" + } + ] + }, + "startAt": { + "type": "number", + "description": "Start time (milisecond)" + }, + "endAt": { + "type": "number", + "description": "End time (milisecond)" + }, + "currentPage": { + "type": "integer", + "description": "current page" + }, + "orderIds": { + "type": "string", + "description": "comma seperated order ID list" + }, + "pageSize": { + "type": "integer", + "description": "page size" + }, + "stop": { + "type": "string", + "description": "Order type: stop: stop loss order, oco: oco order" + } + } + }, + "example": "{\n \"symbol\": \"BTC-USDT\",\n \"orderId\": \"670fd33bf9406e0007ab3945\",\n \"newPrice\": \"30000\",\n \"newSize\": \"0.0001\"\n}" + } + } + }, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"currentPage\\\": 1,\\n \\\"pageSize\\\": 50,\\n \\\"totalNum\\\": 1,\\n \\\"totalPage\\\": 1,\\n \\\"items\\\": [\\n {\\n \\\"id\\\": \\\"vs8hoo8kqjnklv4m0038lrfq\\\",\\n \\\"symbol\\\": \\\"KCS-USDT\\\",\\n \\\"userId\\\": \\\"60fe4956c43cbc0006562c2c\\\",\\n \\\"status\\\": \\\"NEW\\\",\\n \\\"type\\\": \\\"limit\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"price\\\": \\\"0.01000000000000000000\\\",\\n \\\"size\\\": \\\"0.01000000000000000000\\\",\\n \\\"funds\\\": null,\\n \\\"stp\\\": null,\\n \\\"timeInForce\\\": \\\"GTC\\\",\\n \\\"cancelAfter\\\": -1,\\n \\\"postOnly\\\": false,\\n \\\"hidden\\\": false,\\n \\\"iceberg\\\": false,\\n \\\"visibleSize\\\": null,\\n \\\"channel\\\": \\\"API\\\",\\n \\\"clientOid\\\": \\\"404814a0fb4311eb9098acde48001122\\\",\\n \\\"remark\\\": null,\\n \\\"tags\\\": null,\\n \\\"orderTime\\\": 1628755183702150100,\\n \\\"domainId\\\": \\\"kucoin\\\",\\n \\\"tradeSource\\\": \\\"USER\\\",\\n \\\"tradeType\\\": \\\"TRADE\\\",\\n \\\"feeCurrency\\\": \\\"USDT\\\",\\n \\\"takerFeeRate\\\": \\\"0.00200000000000000000\\\",\\n \\\"makerFeeRate\\\": \\\"0.00200000000000000000\\\",\\n \\\"createdAt\\\": 1628755183704,\\n \\\"stop\\\": \\\"loss\\\",\\n \\\"stopTriggerTime\\\": null,\\n \\\"stopPrice\\\": \\\"10.00000000000000000000\\\"\\n }\\n ]\\n }\\n}", + "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"orderId\\\": \\\"670fd33bf9406e0007ab3945\\\", \\\"newPrice\\\": \\\"30000\\\", \\\"newSize\\\": \\\"0.0001\\\"}" } }, - "/api/v3/oco/client-order/{clientOid}": { - "get": { - "summary": "Get OCO Order By ClientOid", + "/api/v1/stop-order/cancelOrderByClientOid": { + "delete": { + "summary": "Cancel Stop Order By ClientOid", "deprecated": true, - "description": "Request via this interface to get a oco order information via the client order ID.", + "description": "This endpoint can be used to cancel a spot stop order by clientOid. ", "tags": [], "parameters": [ + { + "name": "symbol", + "in": "query", + "description": "symbol", + "required": false, + "schema": { + "type": "string", + "example": [ + "BTC-USDT", + "ETH-USDT", + "KCS-USDT" + ] + } + }, { "name": "clientOid", - "in": "path", - "description": "Client Order Id,unique identifier created by the user", + "in": "query", + "description": "Unique order id created by users to identify their orders", "required": true, "schema": { "type": "string" @@ -10707,34 +10596,18 @@ "data": { "type": "object", "properties": { - "symbol": { - "type": "string", - "description": "symbol" - }, "clientOid": { "type": "string", - "description": "Client Order Id" - }, - "orderId": { - "type": "string", - "description": "The unique order id generated by the trading system,which can be used later for further actions such as canceling the order." - }, - "orderTime": { - "type": "integer", - "description": "Order placement time, milliseconds", - "format": "int64" + "description": "Client Order Id,unique identifier created by the user" }, - "status": { + "cancelledOrderId": { "type": "string", - "description": "Order status: NEW: New, DONE: Completed, TRIGGERED: Triggered, CANCELLED: Cancelled" + "description": "Unique ID of the cancelled order" } }, "required": [ - "orderId", - "symbol", "clientOid", - "orderTime", - "status" + "cancelledOrderId" ] } }, @@ -10747,30 +10620,32 @@ } } }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470358", + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470336", "x-abandon": "abandon", "x-domain": "Spot", "x-api-channel": "Private", - "x-api-permission": "General", + "x-api-permission": "Spot", "x-api-rate-limit-pool": "Spot", "x-sdk-service": "Spot", "x-sdk-sub-service": "Order", - "x-sdk-method-name": "getOcoOrderByClientOid", - "x-sdk-method-description": "Request via this interface to get a oco order information via the client order ID.", - "x-api-rate-limit": 2, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"orderId\\\": \\\"674c3cfa72cf2800072ee7ce\\\",\\n \\\"symbol\\\": \\\"BTC-USDT\\\",\\n \\\"clientOid\\\": \\\"5c52e1203aa6f3g7f1e493fb\\\",\\n \\\"orderTime\\\": 1733049594803,\\n \\\"status\\\": \\\"NEW\\\"\\n }\\n}", - "x-request-example": "{\\\"clientOid\\\": \\\"5c52e1203aa6f3g7f1e493fb\\\"}" - }, + "x-sdk-method-name": "cancelStopOrderByClientOid", + "x-sdk-method-description": "This endpoint can be used to cancel a spot stop order by clientOid. ", + "x-api-rate-limit": 5, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"cancelledOrderId\\\": \\\"vs8hoo8ksc8mario0035a74n\\\",\\n \\\"clientOid\\\": \\\"689ff597f4414061aa819cc414836abd\\\"\\n }\\n}", + "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"clientOid\\\": \\\"689ff597f4414061aa819cc414836abd\\\"}" + } + }, + "/api/v1/stop-order/{orderId}": { "delete": { - "summary": "Cancel OCO Order By ClientOid", + "summary": "Cancel Stop Order By OrderId", "deprecated": true, - "description": "Request via this interface to cancel a stop order via the clientOid. You will receive cancelledOrderIds field once the system has received the cancellation request. The cancellation request will be processed by the matching engine in sequence. To know if the request is processed (successfully or not), you may check the order status or the update message from the pushes.", + "description": "This endpoint can be used to cancel a spot stop order by orderId. ", "tags": [], "parameters": [ { - "name": "clientOid", + "name": "orderId", "in": "path", - "description": "Client Order Id,unique identifier created by the user", + "description": "The unique order id generated by the trading system", "required": true, "schema": { "type": "string" @@ -10796,7 +10671,7 @@ "items": { "type": "string" }, - "description": "List of two order IDs related to the canceled OCO order" + "description": "order id array" } }, "required": [ @@ -10813,7 +10688,7 @@ } } }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470355", + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470335", "x-abandon": "abandon", "x-domain": "Spot", "x-api-channel": "Private", @@ -10821,38 +10696,22 @@ "x-api-rate-limit-pool": "Spot", "x-sdk-service": "Spot", "x-sdk-sub-service": "Order", - "x-sdk-method-name": "cancelOcoOrderByClientOid", - "x-sdk-method-description": "Request via this interface to cancel a stop order via the clientOid. You will receive cancelledOrderIds field once the system has received the cancellation request. The cancellation request will be processed by the matching engine in sequence. To know if the request is processed (successfully or not), you may check the order status or the update message from the pushes.", + "x-sdk-method-name": "cancelStopOrderByOrderId", + "x-sdk-method-description": "This endpoint can be used to cancel a spot stop order by orderId. ", "x-api-rate-limit": 3, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"cancelledOrderIds\\\": [\\n \\\"vs93gpqc6r0mkk57003gok3h\\\",\\n \\\"vs93gpqc6r0mkk57003gok3i\\\"\\n ]\\n }\\n}", - "x-request-example": "{\\\"clientOid\\\": \\\"5c52e11203aa67f1e493fb\\\"}" - } - }, - "/api/v1/hf/orders/client-order/{clientOid}": { + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"cancelledOrderIds\\\": [\\n \\\"671124f9365ccb00073debd4\\\"\\n ]\\n }\\n}", + "x-request-example": "{\\\"orderId\\\": \\\"671124f9365ccb00073debd4\\\"}" + }, "get": { - "summary": "Get Order By ClientOid", - "deprecated": false, - "description": "This endpoint can be used to obtain information for a single Spot order using the client order id. After the user successfully places an order, the order is in Active state, and the user can use inOrderBook to determine whether the order has entered the order. Canceled or fully filled orders are marked as completed Done status.", - "tags": [], - "parameters": [ - { - "name": "symbol", - "in": "query", - "description": "symbol", - "required": true, - "schema": { - "type": "string", - "example": [ - "BTC-USDT", - "ETH-USDT", - "KCS-USDT" - ] - } - }, + "summary": "Get Stop Order By OrderId", + "deprecated": false, + "description": "This interface is to obtain Spot stop order details by orderId", + "tags": [], + "parameters": [ { - "name": "clientOid", + "name": "orderId", "in": "path", - "description": "Client Order Id,unique identifier created by the user", + "description": "The order id", "required": true, "schema": { "type": "string" @@ -10867,273 +10726,427 @@ "schema": { "type": "object", "properties": { - "code": { - "type": "string" - }, "data": { "type": "object", "properties": { "id": { "type": "string", - "description": "The unique order id generated by the trading system" + "description": "Order ID, the ID of an order." }, "symbol": { "type": "string", - "description": "symbol", - "example": [ - "BTC-USDT", - "ETH-USDT", - "KCS-USDT" - ] + "description": "Symbol name" }, - "opType": { - "type": "string" + "userId": { + "type": "string", + "description": "User ID" + }, + "status": { + "type": "string", + "description": "Order status, include NEW, TRIGGERED" }, "type": { "type": "string", - "description": "Specify if the order is an 'limit' order or 'market' order. ", - "enum": [ - "limit", - "market" - ], - "x-api-enum": [ - { - "value": "limit", - "name": "", - "description": "" - }, - { - "value": "market", - "name": "", - "description": "" - } - ] + "description": "Order type,limit, market, limit_stop or market_stop" }, "side": { "type": "string", - "description": "Buy or sell", - "enum": [ - "buy", - "sell" - ], - "x-api-enum": [ - { - "value": "buy", - "name": "", - "description": "" - }, - { - "value": "sell", - "name": "", - "description": "" - } - ] + "description": "transaction direction,include buy and sell" }, "price": { "type": "string", - "description": "Order price" + "description": "order price" }, "size": { "type": "string", - "description": "Order size" + "description": "order quantity" }, "funds": { "type": "string", - "description": "Order Funds" - }, - "dealSize": { - "type": "string", - "description": "Number of filled transactions" - }, - "dealFunds": { - "type": "string", - "description": "Funds of filled transactions" - }, - "fee": { - "type": "string", - "description": "[Handling fees](https://www.kucoin.com/docs-new/api-5327739)" - }, - "feeCurrency": { - "type": "string", - "description": "currency used to calculate trading fee" + "description": "order funds" }, "stp": { - "type": "string", - "description": "[Self Trade Prevention](https://www.kucoin.com/docs-new/api-5176570)", - "enum": [ - "DC", - "CO", - "CN", - "CB" - ], - "x-api-enum": [ - { - "value": "DC", - "name": "", - "description": "" - }, - { - "value": "CO", - "name": "", - "description": "" - }, - { - "value": "CN", - "name": "", - "description": "" - }, - { - "value": "CB", - "name": "", - "description": "" - } - ] + "type": "string" }, "timeInForce": { "type": "string", - "description": "Time in force", - "enum": [ - "GTC", - "GTT", - "IOC", - "FOK" - ], - "x-api-enum": [ - { - "value": "GTC", - "name": "", - "description": "" - }, - { - "value": "GTT", - "name": "", - "description": "" - }, - { - "value": "IOC", - "name": "", - "description": "" - }, - { - "value": "FOK", - "name": "", - "description": "" - } - ] + "description": "time InForce,include GTC,GTT,IOC,FOK" + }, + "cancelAfter": { + "type": "integer", + "description": "cancel orders after n seconds,requires timeInForce to be GTT", + "format": "int64" }, "postOnly": { "type": "boolean", - "description": "Whether its a postOnly order." + "description": "postOnly" }, "hidden": { "type": "boolean", - "description": "Whether its a hidden order." + "description": "hidden order" }, "iceberg": { "type": "boolean", - "description": "Whether its a iceberg order." + "description": "Iceberg order" }, "visibleSize": { "type": "string", - "description": "Visible size of iceberg order in order book." - }, - "cancelAfter": { - "type": "integer", - "description": "A GTT timeInForce that expires in n seconds" + "description": "displayed quantity for iceberg order" }, "channel": { - "type": "string" + "type": "string", + "description": "order source" }, "clientOid": { "type": "string", - "description": "Client Order Id,unique identifier created by the user" + "description": "user-entered order unique mark" }, "remark": { "type": "string", - "description": "Order placement remarks" + "description": "Remarks at stop order creation" }, "tags": { "type": "string", - "description": "Order tag" - }, - "cancelExist": { - "type": "boolean", - "description": "Whether there is a cancellation record for the order." + "description": "tag order source" }, - "createdAt": { - "type": "integer", - "format": "int64" + "domainId": { + "type": "string", + "description": "domainId, e.g: kucoin" }, - "lastUpdatedAt": { - "type": "integer", - "format": "int64" + "tradeSource": { + "type": "string", + "description": "trade source: USER(Order by user), MARGIN_SYSTEM(Order by margin system)" }, "tradeType": { "type": "string", - "description": "Trade type, redundancy param" - }, - "inOrderBook": { - "type": "boolean", - "description": "Whether to enter the orderbook: true: enter the orderbook; false: not enter the orderbook" + "description": "The type of trading : TRADE(Spot), MARGIN_TRADE (Cross Margin), MARGIN_ISOLATED_TRADE (Isolated Margin)." }, - "cancelledSize": { + "feeCurrency": { "type": "string", - "description": "Number of canceled transactions" + "description": "The currency of the fee" }, - "cancelledFunds": { + "takerFeeRate": { "type": "string", - "description": "Funds of canceled transactions" + "description": "Fee Rate of taker" }, - "remainSize": { + "makerFeeRate": { "type": "string", - "description": "Number of remain transactions" + "description": "Fee Rate of maker" }, - "remainFunds": { + "createdAt": { + "type": "integer", + "description": "order creation time", + "format": "int64" + }, + "stop": { "type": "string", - "description": "Funds of remain transactions" + "description": "Stop order type, include loss and entry" }, - "tax": { + "stopTriggerTime": { + "type": "integer", + "description": "The trigger time of the stop order", + "format": "int64" + }, + "stopPrice": { "type": "string", - "description": "Users in some regions need query this field" + "description": "stop price" }, - "active": { - "type": "boolean", - "description": "Order status: true-The status of the order isactive; false-The status of the order is done" + "orderTime": { + "type": "integer", + "description": "Time of place a stop order, accurate to nanoseconds", + "format": "int64" + } + }, + "description": "the details" + }, + "code": { + "type": "string", + "description": "return status code" + } + }, + "required": [ + "data", + "code" + ] + } + } + } + } + }, + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470339", + "x-abandon": "normal", + "x-domain": "Spot", + "x-api-channel": "Private", + "x-api-permission": "General", + "x-api-rate-limit-pool": "Spot", + "x-sdk-service": "Spot", + "x-sdk-sub-service": "Order", + "x-sdk-method-name": "getStopOrderByOrderId", + "x-sdk-method-description": "This interface is to obtain Spot stop order details by orderId", + "x-api-rate-limit": 3, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"id\\\": \\\"vs8hoo8q2ceshiue003b67c0\\\",\\n \\\"symbol\\\": \\\"KCS-USDT\\\",\\n \\\"userId\\\": \\\"60fe4956c43cbc0006562c2c\\\",\\n \\\"status\\\": \\\"NEW\\\",\\n \\\"type\\\": \\\"limit\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"price\\\": \\\"0.01000000000000000000\\\",\\n \\\"size\\\": \\\"0.01000000000000000000\\\",\\n \\\"funds\\\": null,\\n \\\"stp\\\": null,\\n \\\"timeInForce\\\": \\\"GTC\\\",\\n \\\"cancelAfter\\\": -1,\\n \\\"postOnly\\\": false,\\n \\\"hidden\\\": false,\\n \\\"iceberg\\\": false,\\n \\\"visibleSize\\\": null,\\n \\\"channel\\\": \\\"API\\\",\\n \\\"clientOid\\\": \\\"40e0eb9efe6311eb8e58acde48001122\\\",\\n \\\"remark\\\": null,\\n \\\"tags\\\": null,\\n \\\"orderTime\\\": 1629098781127530200,\\n \\\"domainId\\\": \\\"kucoin\\\",\\n \\\"tradeSource\\\": \\\"USER\\\",\\n \\\"tradeType\\\": \\\"TRADE\\\",\\n \\\"feeCurrency\\\": \\\"USDT\\\",\\n \\\"takerFeeRate\\\": \\\"0.00200000000000000000\\\",\\n \\\"makerFeeRate\\\": \\\"0.00200000000000000000\\\",\\n \\\"createdAt\\\": 1629098781128,\\n \\\"stop\\\": \\\"loss\\\",\\n \\\"stopTriggerTime\\\": null,\\n \\\"stopPrice\\\": \\\"10.00000000000000000000\\\"\\n }\\n}", + "x-request-example": "{\\\"orderId\\\": \\\"example_string_default_value\\\"}" + } + }, + "/api/v1/stop-order/cancel": { + "delete": { + "summary": "Batch Cancel Stop Orders", + "deprecated": false, + "description": "This endpoint can be used to cancel a spot stop orders by batch.", + "tags": [], + "parameters": [ + { + "name": "symbol", + "in": "query", + "description": "Cancel the open order for the specified symbol", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "tradeType", + "in": "query", + "description": "The type of trading : TRADE(Spot), MARGIN_TRADE (Cross Margin), MARGIN_ISOLATED_TRADE (Isolated Margin). Default is TRADE", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "orderIds", + "in": "query", + "description": "Comma seperated order IDs.", + "required": false, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "object", + "properties": { + "cancelledOrderIds": { + "type": "array", + "items": { + "type": "string" + }, + "description": "order id array" + } + }, + "required": [ + "cancelledOrderIds" + ] + } + }, + "required": [ + "code", + "data" + ] + } + } + } + } + }, + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470337", + "x-abandon": "normal", + "x-domain": "Spot", + "x-api-channel": "Private", + "x-api-permission": "Spot", + "x-api-rate-limit-pool": "Spot", + "x-sdk-service": "Spot", + "x-sdk-sub-service": "Order", + "x-sdk-method-name": "batchCancelStopOrder", + "x-sdk-method-description": "This endpoint can be used to cancel a spot stop orders by batch.", + "x-api-rate-limit": 3, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"cancelledOrderIds\\\": [\\n \\\"671124f9365ccb00073debd4\\\"\\n ]\\n }\\n}", + "x-request-example": "{\\\"symbol\\\": \\\"example_string_default_value\\\", \\\"tradeType\\\": \\\"example_string_default_value\\\", \\\"orderIds\\\": \\\"example_string_default_value\\\"}" + } + }, + "/api/v1/stop-order/queryOrderByClientOid": { + "get": { + "summary": "Get Stop Order By ClientOid", + "deprecated": false, + "description": "This interface is to obtain Spot stop order details by orderId", + "tags": [], + "parameters": [ + { + "name": "clientOid", + "in": "query", + "description": "The client order id", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "symbol", + "in": "query", + "description": "symbol name", + "required": false, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "string", + "description": "the return code" + }, + "data": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Order ID, the ID of an order." + }, + "symbol": { + "type": "string", + "description": "Symbol name" + }, + "userId": { + "type": "string", + "description": "User ID" + }, + "status": { + "type": "string", + "description": "Order status, include NEW, TRIGGERED" + }, + "type": { + "type": "string", + "description": "Order type,limit, market, limit_stop or market_stop" + }, + "side": { + "type": "string", + "description": "transaction direction,include buy and sell" + }, + "price": { + "type": "string", + "description": "order price" + }, + "size": { + "type": "string", + "description": "order quantity" + }, + "funds": { + "type": "string", + "description": "order funds" + }, + "stp": { + "type": "string" + }, + "timeInForce": { + "type": "string", + "description": "time InForce,include GTC,GTT,IOC,FOK" + }, + "cancelAfter": { + "type": "integer", + "description": "cancel orders after n seconds,requires timeInForce to be GTT", + "format": "int64" + }, + "postOnly": { + "type": "boolean", + "description": "postOnly" + }, + "hidden": { + "type": "boolean", + "description": "hidden order" + }, + "iceberg": { + "type": "boolean", + "description": "Iceberg order" + }, + "visibleSize": { + "type": "string", + "description": "displayed quantity for iceberg order" + }, + "channel": { + "type": "string", + "description": "order source" + }, + "clientOid": { + "type": "string", + "description": "user-entered order unique mark" + }, + "remark": { + "type": "string", + "description": "Remarks at stop order creation" + }, + "tags": { + "type": "string", + "description": "tag order source" + }, + "domainId": { + "type": "string", + "description": "domainId, e.g: kucoin" + }, + "tradeSource": { + "type": "string", + "description": "trade source: USER(Order by user), MARGIN_SYSTEM(Order by margin system)" + }, + "tradeType": { + "type": "string", + "description": "The type of trading : TRADE(Spot), MARGIN_TRADE (Cross Margin), MARGIN_ISOLATED_TRADE (Isolated Margin)." + }, + "feeCurrency": { + "type": "string", + "description": "The currency of the fee" + }, + "takerFeeRate": { + "type": "string", + "description": "Fee Rate of taker" + }, + "makerFeeRate": { + "type": "string", + "description": "Fee Rate of maker" + }, + "createdAt": { + "type": "integer", + "description": "order creation time", + "format": "int64" + }, + "stop": { + "type": "string", + "description": "Stop order type, include loss and entry" + }, + "stopTriggerTime": { + "type": "integer", + "description": "The trigger time of the stop order", + "format": "int64" + }, + "stopPrice": { + "type": "string", + "description": "stop price" + }, + "orderTime": { + "type": "integer", + "description": "Time of place a stop order, accurate to nanoseconds", + "format": "int64" + } } }, - "required": [ - "id", - "symbol", - "opType", - "type", - "side", - "price", - "size", - "funds", - "dealSize", - "dealFunds", - "fee", - "feeCurrency", - "timeInForce", - "postOnly", - "hidden", - "iceberg", - "visibleSize", - "cancelAfter", - "channel", - "clientOid", - "cancelExist", - "tradeType", - "inOrderBook", - "cancelledSize", - "cancelledFunds", - "remainSize", - "remainFunds", - "active", - "createdAt", - "lastUpdatedAt", - "tax" - ] + "description": "the return code" } }, "required": [ @@ -11145,7 +11158,7 @@ } } }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470182", + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470340", "x-abandon": "normal", "x-domain": "Spot", "x-api-channel": "Private", @@ -11153,42 +11166,20 @@ "x-api-rate-limit-pool": "Spot", "x-sdk-service": "Spot", "x-sdk-sub-service": "Order", - "x-sdk-method-name": "getOrderByClientOid", - "x-sdk-method-description": "This endpoint can be used to obtain information for a single Spot order using the client order id. After the user successfully places an order, the order is in Active state, and the user can use inOrderBook to determine whether the order has entered the order. Canceled or fully filled orders are marked as completed Done status.", - "x-api-rate-limit": 2, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"id\\\": \\\"6717422bd51c29000775ea03\\\",\\n \\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\",\\n \\\"symbol\\\": \\\"BTC-USDT\\\",\\n \\\"opType\\\": \\\"DEAL\\\",\\n \\\"type\\\": \\\"limit\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"price\\\": \\\"70000\\\",\\n \\\"size\\\": \\\"0.00001\\\",\\n \\\"funds\\\": \\\"0.7\\\",\\n \\\"dealSize\\\": \\\"0.00001\\\",\\n \\\"dealFunds\\\": \\\"0.677176\\\",\\n \\\"remainSize\\\": \\\"0\\\",\\n \\\"remainFunds\\\": \\\"0.022824\\\",\\n \\\"cancelledSize\\\": \\\"0\\\",\\n \\\"cancelledFunds\\\": \\\"0\\\",\\n \\\"fee\\\": \\\"0.000677176\\\",\\n \\\"feeCurrency\\\": \\\"USDT\\\",\\n \\\"stp\\\": null,\\n \\\"timeInForce\\\": \\\"GTC\\\",\\n \\\"postOnly\\\": false,\\n \\\"hidden\\\": false,\\n \\\"iceberg\\\": false,\\n \\\"visibleSize\\\": \\\"0\\\",\\n \\\"cancelAfter\\\": 0,\\n \\\"channel\\\": \\\"API\\\",\\n \\\"remark\\\": \\\"order remarks\\\",\\n \\\"tags\\\": null,\\n \\\"cancelExist\\\": false,\\n \\\"tradeType\\\": \\\"TRADE\\\",\\n \\\"inOrderBook\\\": false,\\n \\\"active\\\": false,\\n \\\"tax\\\": \\\"0\\\",\\n \\\"createdAt\\\": 1729577515444,\\n \\\"lastUpdatedAt\\\": 1729577515481\\n }\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\"}" - }, - "delete": { - "summary": "Cancel Order By ClientOid", - "deprecated": false, - "description": "This endpoint can be used to cancel a spot order by clientOid. This endpoint only sends cancellation requests. The results of the requests must be obtained by checking the order status or subscribing to websocket.", + "x-sdk-method-name": "getStopOrderByClientOid", + "x-sdk-method-description": "This interface is to obtain Spot stop order details by orderId", + "x-api-rate-limit": 3, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": [\\n {\\n \\\"id\\\": \\\"vs8hoo8os561f5np0032vngj\\\",\\n \\\"symbol\\\": \\\"KCS-USDT\\\",\\n \\\"userId\\\": \\\"60fe4956c43cbc0006562c2c\\\",\\n \\\"status\\\": \\\"NEW\\\",\\n \\\"type\\\": \\\"limit\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"price\\\": \\\"0.01000000000000000000\\\",\\n \\\"size\\\": \\\"0.01000000000000000000\\\",\\n \\\"funds\\\": null,\\n \\\"stp\\\": null,\\n \\\"timeInForce\\\": \\\"GTC\\\",\\n \\\"cancelAfter\\\": -1,\\n \\\"postOnly\\\": false,\\n \\\"hidden\\\": false,\\n \\\"iceberg\\\": false,\\n \\\"visibleSize\\\": null,\\n \\\"channel\\\": \\\"API\\\",\\n \\\"clientOid\\\": \\\"2b700942b5db41cebe578cff48960e09\\\",\\n \\\"remark\\\": null,\\n \\\"tags\\\": null,\\n \\\"orderTime\\\": 1629020492834532600,\\n \\\"domainId\\\": \\\"kucoin\\\",\\n \\\"tradeSource\\\": \\\"USER\\\",\\n \\\"tradeType\\\": \\\"TRADE\\\",\\n \\\"feeCurrency\\\": \\\"USDT\\\",\\n \\\"takerFeeRate\\\": \\\"0.00200000000000000000\\\",\\n \\\"makerFeeRate\\\": \\\"0.00200000000000000000\\\",\\n \\\"createdAt\\\": 1629020492837,\\n \\\"stop\\\": \\\"loss\\\",\\n \\\"stopTriggerTime\\\": null,\\n \\\"stopPrice\\\": \\\"1.00000000000000000000\\\"\\n }\\n ]\\n}", + "x-request-example": "{\\\"clientOid\\\": \\\"example_string_default_value\\\", \\\"symbol\\\": \\\"example_string_default_value\\\"}" + } + }, + "/api/v3/oco/order": { + "post": { + "summary": "Add OCO Order", + "deprecated": true, + "description": "Place OCO order to the Spot trading system", "tags": [], - "parameters": [ - { - "name": "clientOid", - "in": "path", - "description": "Client Order Id,unique identifier created by the user", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "symbol", - "in": "query", - "description": "symbol", - "required": true, - "schema": { - "type": "string", - "example": [ - "BTC-USDT", - "ETH-USDT", - "KCS-USDT" - ] - } - } - ], + "parameters": [], "responses": { "200": { "description": "", @@ -11203,13 +11194,13 @@ "data": { "type": "object", "properties": { - "clientOid": { + "orderId": { "type": "string", - "description": "Client Order Id,unique identifier created by the user" + "description": "The unique order id generated by the trading system,which can be used later for further actions such as canceling the order." } }, "required": [ - "clientOid" + "orderId" ] } }, @@ -11222,139 +11213,126 @@ } } }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470184", - "x-abandon": "normal", + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470353", + "x-abandon": "abandon", "x-domain": "Spot", "x-api-channel": "Private", "x-api-permission": "Spot", "x-api-rate-limit-pool": "Spot", "x-sdk-service": "Spot", "x-sdk-sub-service": "Order", - "x-sdk-method-name": "cancelOrderByClientOid", - "x-sdk-method-description": "This endpoint can be used to cancel a spot order by clientOid. This endpoint only sends cancellation requests. The results of the requests must be obtained by checking the order status or subscribing to websocket.", - "x-api-rate-limit": 1, - "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"clientOid\\\":\\\"5c52e11203aa677f33e493fb\\\"}}", - "x-request-example": "{\\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\", \\\"symbol\\\": \\\"BTC-USDT\\\"}" - } - }, - "/api/v1/hf/orders/cancel/{orderId}": { - "delete": { - "summary": "Cancel Partial Order", - "deprecated": false, - "description": "This interface can cancel the specified quantity of the order according to the orderId. The order execution order is: price first, time first, this interface will not change the queue order", - "tags": [], - "parameters": [ - { - "name": "orderId", - "in": "path", - "description": "The unique order id generated by the trading system", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "symbol", - "in": "query", - "description": "symbol", - "required": true, - "schema": { - "type": "string", - "example": [ - "BTC-USDT", - "ETH-USDT", - "KCS-USDT" - ] - } - }, - { - "name": "cancelSize", - "in": "query", - "description": "The size you want cancel", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "data": { - "type": "object", - "properties": { - "orderId": { - "type": "string", - "description": "order id" - }, - "cancelSize": { - "type": "string", - "description": "The size you canceled" - } + "x-sdk-method-name": "addOcoOrder", + "x-sdk-method-description": "Place OCO order to the Spot trading system", + "x-api-rate-limit": 2, + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "clientOid": { + "type": "string", + "description": "Client Order Id,The ClientOid field is a unique ID created by the user(we recommend using a UUID), and can only contain numbers, letters, underscores (_), and hyphens (-). This field is returned when order information is obtained. You can use clientOid to tag your orders. ClientOid is different from the order ID created by the service provider. Please do not initiate requests using the same clientOid. The maximum length for the ClientOid is 40 characters.\n\nPlease remember the orderId created by the service provider, it used to check for updates in order status.", + "example": [ + "5c52e11203aa677f33e493fb" + ] + }, + "side": { + "type": "string", + "description": "specify if the order is to 'buy' or 'sell'", + "enum": [ + "buy", + "sell" + ], + "x-api-enum": [ + { + "value": "buy", + "name": "", + "description": "" }, - "required": [ - "orderId", - "cancelSize" - ] - } + { + "value": "sell", + "name": "", + "description": "" + } + ], + "example": [ + "buy" + ] }, - "required": [ - "code", - "data" - ] - } - } + "symbol": { + "type": "string", + "description": "symbol", + "example": [ + "BTC-USDT", + "ETH-USDT", + "KCS-USDT" + ] + }, + "remark": { + "type": "string", + "description": "Order placement remarks, length cannot exceed 20 characters (ASCII)" + }, + "price": { + "type": "string", + "description": "Specify price for order" + }, + "size": { + "type": "string", + "description": "Specify quantity for order" + }, + "stopPrice": { + "type": "string", + "description": "trigger price." + }, + "limitPrice": { + "type": "string", + "description": "The limit order price after take-profit and stop-loss are triggered." + }, + "tradeType": { + "type": "string", + "description": "Transaction Type, currently only supports TRADE (spot transactions), the default is TRADE", + "enum": [ + "TRADE" + ], + "x-api-enum": [ + { + "value": "TRADE", + "name": "TRADE", + "description": "Spot Trading" + } + ] + } + }, + "required": [ + "symbol", + "side", + "clientOid", + "price", + "size", + "stopPrice", + "limitPrice" + ] + }, + "example": "{\n \"symbol\": \"BTC-USDT\",\n \"side\": \"buy\",\n \"price\": \"94000\",\n \"size\": \"0.1\",\n \"clientOid\": \"5c52e11203aa67f1e493fb\",\n \"stopPrice\": \"98000\",\n \"limitPrice\": \"96000\",\n \"remark\": \"this is remark\",\n \"tradeType\": \"TRADE\"\n}" } } }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470183", - "x-abandon": "normal", - "x-domain": "Spot", - "x-api-channel": "Private", - "x-api-permission": "Spot", - "x-api-rate-limit-pool": "Spot", - "x-sdk-service": "Spot", - "x-sdk-sub-service": "Order", - "x-sdk-method-name": "cancelPartialOrder", - "x-sdk-method-description": "This interface can cancel the specified quantity of the order according to the orderId. The order execution order is: price first, time first, this interface will not change the queue order", - "x-api-rate-limit": 2, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"orderId\\\": \\\"6711f73c1ef16c000717bb31\\\",\\n \\\"cancelSize\\\": \\\"0.00001\\\"\\n }\\n}", - "x-request-example": "{\\\"orderId\\\": \\\"6711f73c1ef16c000717bb31\\\", \\\"symbol\\\": \\\"BTC-USDT\\\", \\\"cancelSize\\\": \\\"0.00001\\\"}" + "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"orderId\\\":\\\"674c316e688dea0007c7b986\\\"}}", + "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"side\\\": \\\"buy\\\", \\\"price\\\": \\\"94000\\\", \\\"size\\\": \\\"0.1\\\", \\\"clientOid\\\": \\\"5c52e11203aa67f1e493fb\\\", \\\"stopPrice\\\": \\\"98000\\\", \\\"limitPrice\\\": \\\"96000\\\", \\\"remark\\\": \\\"this is remark\\\", \\\"tradeType\\\": \\\"TRADE\\\"}" } }, - "/api/v1/stop-order/cancelOrderByClientOid": { + "/api/v3/oco/order/{orderId}": { "delete": { - "summary": "Cancel Stop Order By ClientOid", + "summary": "Cancel OCO Order By OrderId", "deprecated": true, - "description": "This endpoint can be used to cancel a spot stop order by clientOid. ", + "description": "This endpoint can be used to cancel a spot order by orderId. This endpoint only sends cancellation requests. The results of the requests must be obtained by checking the order status or subscribing to websocket.", "tags": [], "parameters": [ { - "name": "symbol", - "in": "query", - "description": "symbol", - "required": false, - "schema": { - "type": "string", - "example": [ - "BTC-USDT", - "ETH-USDT", - "KCS-USDT" - ] - } - }, - { - "name": "clientOid", - "in": "query", - "description": "Unique order id created by users to identify their orders", + "name": "orderId", + "in": "path", + "description": "The unique order id generated by the trading system", "required": true, "schema": { "type": "string" @@ -11375,18 +11353,16 @@ "data": { "type": "object", "properties": { - "clientOid": { - "type": "string", - "description": "Client Order Id,unique identifier created by the user" - }, - "cancelledOrderId": { - "type": "string", - "description": "Unique ID of the cancelled order" + "cancelledOrderIds": { + "type": "array", + "items": { + "type": "string" + }, + "description": "List of two order IDs related to the canceled OCO order" } }, "required": [ - "clientOid", - "cancelledOrderId" + "cancelledOrderIds" ] } }, @@ -11399,7 +11375,7 @@ } } }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470336", + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470354", "x-abandon": "abandon", "x-domain": "Spot", "x-api-channel": "Private", @@ -11407,18 +11383,16 @@ "x-api-rate-limit-pool": "Spot", "x-sdk-service": "Spot", "x-sdk-sub-service": "Order", - "x-sdk-method-name": "cancelStopOrderByClientOid", - "x-sdk-method-description": "This endpoint can be used to cancel a spot stop order by clientOid. ", - "x-api-rate-limit": 5, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"cancelledOrderId\\\": \\\"vs8hoo8ksc8mario0035a74n\\\",\\n \\\"clientOid\\\": \\\"689ff597f4414061aa819cc414836abd\\\"\\n }\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"clientOid\\\": \\\"689ff597f4414061aa819cc414836abd\\\"}" - } - }, - "/api/v1/hf/orders/sync/{orderId}": { - "delete": { - "summary": "Cancel Order By OrderId Sync", - "deprecated": false, - "description": "This endpoint can be used to cancel a spot order by orderId.", + "x-sdk-method-name": "cancelOcoOrderByOrderId", + "x-sdk-method-description": "This endpoint can be used to cancel a spot order by orderId. This endpoint only sends cancellation requests. The results of the requests must be obtained by checking the order status or subscribing to websocket.", + "x-api-rate-limit": 3, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"cancelledOrderIds\\\": [\\n \\\"vs93gpqc6kkmkk57003gok16\\\",\\n \\\"vs93gpqc6kkmkk57003gok17\\\"\\n ]\\n }\\n}", + "x-request-example": "{\\\"orderId\\\": \\\"674c316e688dea0007c7b986\\\"}" + }, + "get": { + "summary": "Get OCO Order By OrderId", + "deprecated": true, + "description": "Request via this interface to get a oco order information via the order ID.", "tags": [], "parameters": [ { @@ -11429,20 +11403,6 @@ "schema": { "type": "string" } - }, - { - "name": "symbol", - "in": "query", - "description": "symbol", - "required": true, - "schema": { - "type": "string", - "example": [ - "BTC-USDT", - "ETH-USDT", - "KCS-USDT" - ] - } } ], "responses": { @@ -11459,54 +11419,62 @@ "data": { "type": "object", "properties": { - "orderId": { - "type": "string", - "description": "order id" - }, - "originSize": { + "symbol": { "type": "string", - "description": "original order size" + "description": "symbol" }, - "dealSize": { + "clientOid": { "type": "string", - "description": "deal size" + "description": "Client Order Id" }, - "remainSize": { + "orderId": { "type": "string", - "description": "remain size" + "description": "The unique order id generated by the trading system,which can be used later for further actions such as canceling the order." }, - "canceledSize": { - "type": "string", - "description": "Cumulative canceled size" + "orderTime": { + "type": "integer", + "description": "Order placement time, milliseconds", + "format": "int64" }, "status": { "type": "string", - "description": "Order Status. open:order is active; done:order has been completed", + "description": "Order status: NEW: New, DONE: Completed, TRIGGERED: Triggered, CANCELLED: Cancelled", "enum": [ - "open", - "done" + "NEW", + "DONE", + "TRIGGERED", + "CANCELLED" ], "x-api-enum": [ { - "value": "open", - "name": "", - "description": "" + "value": "NEW", + "name": "NEW", + "description": "New" }, { - "value": "done", - "name": "", - "description": "" + "value": "DONE", + "name": "DONE", + "description": "Completed" + }, + { + "value": "TRIGGERED", + "name": "TRIGGERED", + "description": "Triggered" + }, + { + "value": "CANCELLED", + "name": "CANCELLED", + "description": "Cancelled" } ] } }, "required": [ "orderId", - "dealSize", - "remainSize", - "canceledSize", - "status", - "originSize" + "symbol", + "clientOid", + "orderTime", + "status" ] } }, @@ -11519,26 +11487,26 @@ } } }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470185", - "x-abandon": "normal", + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470357", + "x-abandon": "abandon", "x-domain": "Spot", "x-api-channel": "Private", - "x-api-permission": "Spot", + "x-api-permission": "General", "x-api-rate-limit-pool": "Spot", "x-sdk-service": "Spot", "x-sdk-sub-service": "Order", - "x-sdk-method-name": "cancelOrderByOrderIdSync", - "x-sdk-method-description": "This endpoint can be used to cancel a spot order by orderId.", - "x-api-rate-limit": 1, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"orderId\\\": \\\"671128ee365ccb0007534d45\\\",\\n \\\"originSize\\\": \\\"0.00001\\\",\\n \\\"dealSize\\\": \\\"0\\\",\\n \\\"remainSize\\\": \\\"0\\\",\\n \\\"canceledSize\\\": \\\"0.00001\\\",\\n \\\"status\\\": \\\"done\\\"\\n }\\n}", - "x-request-example": "{\\\"orderId\\\": \\\"671128ee365ccb0007534d45\\\", \\\"symbol\\\": \\\"BTC-USDT\\\"}" + "x-sdk-method-name": "getOcoOrderByOrderId", + "x-sdk-method-description": "Request via this interface to get a oco order information via the order ID.", + "x-api-rate-limit": 2, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"orderId\\\": \\\"674c3b6e688dea0007c7bab2\\\",\\n \\\"symbol\\\": \\\"BTC-USDT\\\",\\n \\\"clientOid\\\": \\\"5c52e1203aa6f37f1e493fb\\\",\\n \\\"orderTime\\\": 1733049198863,\\n \\\"status\\\": \\\"NEW\\\"\\n }\\n}", + "x-request-example": "{\\\"orderId\\\": \\\"674c3b6e688dea0007c7bab2\\\"}" } }, - "/api/v1/hf/orders/sync/client-order/{clientOid}": { + "/api/v3/oco/client-order/{clientOid}": { "delete": { - "summary": "Cancel Order By ClientOid Sync", - "deprecated": false, - "description": "This endpoint can be used to cancel a spot order by orderId.", + "summary": "Cancel OCO Order By ClientOid", + "deprecated": true, + "description": "Request via this interface to cancel a stop order via the clientOid. You will receive cancelledOrderIds field once the system has received the cancellation request. The cancellation request will be processed by the matching engine in sequence. To know if the request is processed (successfully or not), you may check the order status or the update message from the pushes.", "tags": [], "parameters": [ { @@ -11549,20 +11517,6 @@ "schema": { "type": "string" } - }, - { - "name": "symbol", - "in": "query", - "description": "symbol", - "required": true, - "schema": { - "type": "string", - "example": [ - "BTC-USDT", - "ETH-USDT", - "KCS-USDT" - ] - } } ], "responses": { @@ -11579,54 +11533,16 @@ "data": { "type": "object", "properties": { - "clientOid": { - "type": "string", - "description": "Client Order Id,unique identifier created by the user" - }, - "originSize": { - "type": "string", - "description": "original order size" - }, - "dealSize": { - "type": "string", - "description": "deal size" - }, - "remainSize": { - "type": "string", - "description": "remain size" - }, - "canceledSize": { - "type": "string", - "description": "Cumulative canceled size" - }, - "status": { - "type": "string", - "description": "Order Status. open:order is active; done:order has been completed", - "enum": [ - "open", - "done" - ], - "x-api-enum": [ - { - "value": "open", - "name": "", - "description": "" - }, - { - "value": "done", - "name": "", - "description": "" - } - ] + "cancelledOrderIds": { + "type": "array", + "items": { + "type": "string" + }, + "description": "List of two order IDs related to the canceled OCO order" } }, "required": [ - "clientOid", - "originSize", - "dealSize", - "remainSize", - "canceledSize", - "status" + "cancelledOrderIds" ] } }, @@ -11639,28 +11555,36 @@ } } }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470186", - "x-abandon": "normal", + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470355", + "x-abandon": "abandon", "x-domain": "Spot", "x-api-channel": "Private", "x-api-permission": "Spot", "x-api-rate-limit-pool": "Spot", "x-sdk-service": "Spot", "x-sdk-sub-service": "Order", - "x-sdk-method-name": "cancelOrderByClientOidSync", - "x-sdk-method-description": "This endpoint can be used to cancel a spot order by orderId.", - "x-api-rate-limit": 1, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\",\\n \\\"originSize\\\": \\\"0.00001\\\",\\n \\\"dealSize\\\": \\\"0\\\",\\n \\\"remainSize\\\": \\\"0\\\",\\n \\\"canceledSize\\\": \\\"0.00001\\\",\\n \\\"status\\\": \\\"done\\\"\\n }\\n}", - "x-request-example": "{\\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\", \\\"symbol\\\": \\\"BTC-USDT\\\"}" - } - }, - "/api/v1/hf/orders/test": { - "post": { - "summary": "Add Order Test", - "deprecated": false, - "description": "Order test endpoint, the request parameters and return parameters of this endpoint are exactly the same as the order endpoint, and can be used to verify whether the signature is correct and other operations. After placing an order, the order will not enter the matching system, and the order cannot be queried.", + "x-sdk-method-name": "cancelOcoOrderByClientOid", + "x-sdk-method-description": "Request via this interface to cancel a stop order via the clientOid. You will receive cancelledOrderIds field once the system has received the cancellation request. The cancellation request will be processed by the matching engine in sequence. To know if the request is processed (successfully or not), you may check the order status or the update message from the pushes.", + "x-api-rate-limit": 3, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"cancelledOrderIds\\\": [\\n \\\"vs93gpqc6r0mkk57003gok3h\\\",\\n \\\"vs93gpqc6r0mkk57003gok3i\\\"\\n ]\\n }\\n}", + "x-request-example": "{\\\"clientOid\\\": \\\"5c52e11203aa67f1e493fb\\\"}" + }, + "get": { + "summary": "Get OCO Order By ClientOid", + "deprecated": true, + "description": "Request via this interface to get a oco order information via the client order ID.", "tags": [], - "parameters": [], + "parameters": [ + { + "name": "clientOid", + "in": "path", + "description": "Client Order Id,unique identifier created by the user", + "required": true, + "schema": { + "type": "string" + } + } + ], "responses": { "200": { "description": "", @@ -11675,240 +11599,350 @@ "data": { "type": "object", "properties": { + "symbol": { + "type": "string", + "description": "symbol" + }, + "clientOid": { + "type": "string", + "description": "Client Order Id" + }, "orderId": { "type": "string", "description": "The unique order id generated by the trading system,which can be used later for further actions such as canceling the order." }, - "clientOid": { + "orderTime": { + "type": "integer", + "description": "Order placement time, milliseconds", + "format": "int64" + }, + "status": { "type": "string", - "description": "The user self-defined order id." + "description": "Order status: NEW: New, DONE: Completed, TRIGGERED: Triggered, CANCELLED: Cancelled" } }, - "required": [ - "orderId", - "clientOid" - ] - } - }, - "required": [ - "code", - "data" - ] - } - } - } - } - }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470187", - "x-abandon": "normal", - "x-domain": "Spot", - "x-api-channel": "Private", - "x-api-permission": "Spot", - "x-api-rate-limit-pool": "Spot", - "x-sdk-service": "Spot", - "x-sdk-sub-service": "Order", - "x-sdk-method-name": "addOrderTest", - "x-sdk-method-description": "Order test endpoint, the request parameters and return parameters of this endpoint are exactly the same as the order endpoint, and can be used to verify whether the signature is correct and other operations. After placing an order, the order will not enter the matching system, and the order cannot be queried.", - "x-api-rate-limit": 1, - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "clientOid": { - "type": "string", - "description": "Client Order Id,The ClientOid field is a unique ID created by the user(we recommend using a UUID), and can only contain numbers, letters, underscores (_), and hyphens (-). This field is returned when order information is obtained. You can use clientOid to tag your orders. ClientOid is different from the order ID created by the service provider. Please do not initiate requests using the same clientOid. The maximum length for the ClientOid is 40 characters.\n\nPlease remember the orderId created by the service provider, it used to check for updates in order status.", - "example": [ - "5c52e11203aa677f33e493fb" - ] - }, - "side": { - "type": "string", - "description": "specify if the order is to 'buy' or 'sell'", - "enum": [ - "buy", - "sell" - ], - "x-api-enum": [ - { - "value": "buy", - "name": "", - "description": "" - }, - { - "value": "sell", - "name": "", - "description": "" - } - ], - "example": [ - "buy" - ] - }, - "symbol": { - "type": "string", - "description": "symbol", - "example": [ - "BTC-USDT", - "ETH-USDT", - "KCS-USDT" - ] - }, - "type": { - "type": "string", - "description": "specify if the order is an 'limit' order or 'market' order. \n\nThe type of order you specify when you place your order determines whether or not you need to request other parameters and also affects the execution of the matching engine.\n\nWhen placing a limit order, you must specify a price and size. The system will try to match the order according to market price or a price better than market price. If the order cannot be immediately matched, it will stay in the order book until it is matched or the user cancels.\n\nUnlike limit orders, the price for market orders fluctuates with market prices. When placing a market order, you do not need to specify a price, you only need to specify a quantity. Market orders are filled immediately and will not enter the order book. All market orders are takers and a taker fee will be charged.", - "enum": [ - "limit", - "market" - ], - "x-api-enum": [ - { - "value": "limit", - "name": "", - "description": "" - }, - { - "value": "market", - "name": "", - "description": "" - } - ], - "example": [ - "limit" - ] - }, - "remark": { - "type": "string", - "description": "Order placement remarks, length cannot exceed 20 characters (ASCII)" - }, - "stp": { - "type": "string", - "description": "[Self Trade Prevention](https://www.kucoin.com/docs-new/doc-338146) is divided into four strategies: CN, CO, CB , and DC", - "enum": [ - "DC", - "CO", - "CN", - "CB" - ], - "x-api-enum": [ - { - "value": "DC", - "name": "", - "description": "" - }, - { - "value": "CO", - "name": "", - "description": "" - }, - { - "value": "CN", - "name": "", - "description": "" - }, - { - "value": "CB", - "name": "", - "description": "" - } - ] - }, - "price": { - "type": "string", - "description": "Specify price for order\n\nWhen placing a limit order, the price must be based on priceIncrement for the trading pair. The price increment (priceIncrement) is the price precision for the trading pair. For example, for the BTC-USDT trading pair, the priceIncrement is 0.00001000. So the price for your orders cannot be less than 0.00001000 and must be a multiple of priceIncrement. Otherwise, the order will return an invalid priceIncrement error." - }, - "size": { - "type": "string", - "description": "Specify quantity for order\n\nWhen **type** is limit, size refers to the amount of trading targets (the asset name written in front) for the trading pair. Teh Size must be based on the baseIncrement of the trading pair. The baseIncrement represents the precision for the trading pair. The size of an order must be a positive-integer multiple of baseIncrement and must be between baseMinSize and baseMaxSize.\n\nWhen **type** is market, select one out of two: size or funds" - }, - "timeInForce": { - "type": "string", - "description": "[Time in force](https://www.kucoin.com/docs-new/doc-338146) is a special strategy used during trading", - "enum": [ - "GTC", - "GTT", - "IOC", - "FOK" - ], - "default": "GTC", - "x-api-enum": [ - { - "value": "GTC", - "name": "", - "description": "" - }, - { - "value": "GTT", - "name": "", - "description": "" - }, - { - "value": "IOC", - "name": "", - "description": "" - }, - { - "value": "FOK", - "name": "", - "description": "" - } - ] - }, - "postOnly": { - "type": "boolean", - "default": false, - "description": "passive order labels, this is disabled when the order timing strategy is IOC or FOK" - }, - "hidden": { - "type": "boolean", - "description": "[Hidden order](https://www.kucoin.com/docs-new/doc-338146) or not (not shown in order book)", - "default": false - }, - "iceberg": { - "type": "boolean", - "description": "Whether or not only visible portions of orders are shown in [Iceberg orders](https://www.kucoin.com/docs-new/doc-338146)", - "default": false - }, - "visibleSize": { - "type": "string", - "description": "Maximum visible quantity in iceberg orders" + "required": [ + "orderId", + "symbol", + "clientOid", + "orderTime", + "status" + ] + } }, - "tags": { - "type": "string", - "description": "Order tag, length cannot exceed 20 characters (ASCII)" + "required": [ + "code", + "data" + ] + } + } + } + } + }, + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470358", + "x-abandon": "abandon", + "x-domain": "Spot", + "x-api-channel": "Private", + "x-api-permission": "General", + "x-api-rate-limit-pool": "Spot", + "x-sdk-service": "Spot", + "x-sdk-sub-service": "Order", + "x-sdk-method-name": "getOcoOrderByClientOid", + "x-sdk-method-description": "Request via this interface to get a oco order information via the client order ID.", + "x-api-rate-limit": 2, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"orderId\\\": \\\"674c3cfa72cf2800072ee7ce\\\",\\n \\\"symbol\\\": \\\"BTC-USDT\\\",\\n \\\"clientOid\\\": \\\"5c52e1203aa6f3g7f1e493fb\\\",\\n \\\"orderTime\\\": 1733049594803,\\n \\\"status\\\": \\\"NEW\\\"\\n }\\n}", + "x-request-example": "{\\\"clientOid\\\": \\\"5c52e1203aa6f3g7f1e493fb\\\"}" + } + }, + "/api/v3/oco/orders": { + "delete": { + "summary": "Batch Cancel OCO Order", + "deprecated": true, + "description": "This interface can batch cancel OCO orders through orderIds. You will receive cancelledOrderIds field once the system has received the cancellation request. The cancellation request will be processed by the matching engine in sequence. To know if the request is processed (successfully or not), you may check the order status or the update message from the pushes.", + "tags": [], + "parameters": [ + { + "name": "orderIds", + "in": "query", + "description": "Specify the order id, there can be multiple orders, separated by commas. If not passed, all oco orders will be canceled by default.", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "symbol", + "in": "query", + "description": "trading pair. If not passed, the oco orders of all symbols will be canceled by default.", + "required": false, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "object", + "properties": { + "cancelledOrderIds": { + "type": "array", + "items": { + "type": "string" + }, + "description": "List of two order IDs related to the canceled OCO order" + } + }, + "required": [ + "cancelledOrderIds" + ] + } }, - "cancelAfter": { - "type": "integer", - "format": "int64", - "description": "Cancel after n seconds,the order timing strategy is GTT" + "required": [ + "code", + "data" + ] + } + } + } + } + }, + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470356", + "x-abandon": "abandon", + "x-domain": "Spot", + "x-api-channel": "Private", + "x-api-permission": "Spot", + "x-api-rate-limit-pool": "Spot", + "x-sdk-service": "Spot", + "x-sdk-sub-service": "Order", + "x-sdk-method-name": "batchCancelOcoOrders", + "x-sdk-method-description": "This interface can batch cancel OCO orders through orderIds. You will receive cancelledOrderIds field once the system has received the cancellation request. The cancellation request will be processed by the matching engine in sequence. To know if the request is processed (successfully or not), you may check the order status or the update message from the pushes.", + "x-api-rate-limit": 3, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"cancelledOrderIds\\\": [\\n \\\"vs93gpqc750mkk57003gok6i\\\",\\n \\\"vs93gpqc750mkk57003gok6j\\\",\\n \\\"vs93gpqc75c39p83003tnriu\\\",\\n \\\"vs93gpqc75c39p83003tnriv\\\"\\n ]\\n }\\n}", + "x-request-example": "{\\\"orderIds\\\": \\\"674c388172cf2800072ee746,674c38bdfd8300000795167e\\\", \\\"symbol\\\": \\\"BTC-USDT\\\"}" + }, + "get": { + "summary": "Get OCO Order List", + "deprecated": true, + "description": "Request via this endpoint to get your current OCO order list. Items are paginated and sorted to show the latest first. See the Pagination section for retrieving additional entries after the first page.", + "tags": [], + "parameters": [ + { + "name": "symbol", + "in": "query", + "description": "symbol", + "required": false, + "schema": { + "type": "string", + "example": [ + "BTC-USDT", + "ETH-USDT", + "KCS-USDT" + ] + } + }, + { + "name": "startAt", + "in": "query", + "description": "Start time (milliseconds)", + "required": false, + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "endAt", + "in": "query", + "description": "End time (milliseconds)", + "required": false, + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "orderIds", + "in": "query", + "description": "Specify orderId collection, up to 500 orders\n", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "pageSize", + "in": "query", + "description": "Size per page, minimum value 10, maximum value 500", + "required": false, + "schema": { + "type": "integer", + "minimum": 10, + "maximum": 500, + "default": 50 + } + }, + { + "name": "currentPage", + "in": "query", + "description": "Page number, minimum value 1\n", + "required": false, + "schema": { + "type": "integer", + "default": 1 + } + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "object", + "properties": { + "currentPage": { + "type": "integer" + }, + "pageSize": { + "type": "integer" + }, + "totalNum": { + "type": "integer" + }, + "totalPage": { + "type": "integer" + }, + "items": { + "type": "array", + "items": { + "type": "object", + "properties": { + "orderId": { + "type": "string", + "description": "The unique order id generated by the trading system,which can be used later for further actions such as canceling the order." + }, + "symbol": { + "type": "string", + "description": "symbol" + }, + "clientOid": { + "type": "string", + "description": "Client Order Id" + }, + "orderTime": { + "type": "integer", + "description": "Order placement time, milliseconds", + "format": "int64" + }, + "status": { + "type": "string", + "description": "Order status: NEW: New, DONE: Completed, TRIGGERED: Triggered, CANCELLED: Cancelled", + "enum": [ + "NEW", + "DONE", + "TRIGGERED", + "CANCELLED" + ], + "x-api-enum": [ + { + "value": "NEW", + "name": "NEW", + "description": "New" + }, + { + "value": "DONE", + "name": "DONE", + "description": "Completed" + }, + { + "value": "TRIGGERED", + "name": "TRIGGERED", + "description": "Triggered" + }, + { + "value": "CANCELLED", + "name": "CANCELLED", + "description": "Cancelled" + } + ] + } + }, + "required": [ + "orderId", + "symbol", + "clientOid", + "orderTime", + "status" + ] + } + } + }, + "required": [ + "currentPage", + "pageSize", + "totalNum", + "totalPage", + "items" + ] + } }, - "funds": { - "type": "string", - "description": "When **type** is market, select one out of two: size or funds" - } - }, - "required": [ - "symbol", - "type", - "side" - ] - }, - "example": "//limit order\n{\n \"type\": \"limit\",\n \"symbol\": \"BTC-USDT\",\n \"side\": \"buy\",\n \"price\": \"50000\",\n \"size\": \"0.00001\",\n \"clientOid\": \"5c52e11203aa677f33e493f\",\n \"remark\": \"order remarks\"\n}\n\n//market order 1\n// {\n// \"type\": \"market\",\n// \"symbol\": \"BTC-USDT\",\n// \"side\": \"buy\",\n// \"size\": \"0.00001\",\n// \"clientOid\": \"5c52e11203aa677f33e493fc\",\n// \"remark\": \"order remarks\",\n// }\n\n//market order 2\n// {\n// \"type\": \"market\",\n// \"symbol\": \"BTC-USDT\",\n// \"side\": \"buy\",\n// \"funds\": \"1\",\n// \"clientOid\": \"5c52e11203aa677f33e493fc\",\n// \"remark\": \"order remarks\",\n// }\n" + "required": [ + "code", + "data" + ] + } + } } } }, - "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"orderId\\\":\\\"670fd33bf9406e0007ab3945\\\",\\\"clientOid\\\":\\\"5c52e11203aa677f33e493fb\\\"}}", - "x-request-example": "{\\\"type\\\": \\\"limit\\\", \\\"symbol\\\": \\\"BTC-USDT\\\", \\\"side\\\": \\\"buy\\\", \\\"price\\\": \\\"50000\\\", \\\"size\\\": \\\"0.00001\\\", \\\"clientOid\\\": \\\"5c52e11203aa677f33e493f\\\", \\\"remark\\\": \\\"order remarks\\\"}" + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470360", + "x-abandon": "abandon", + "x-domain": "Spot", + "x-api-channel": "Private", + "x-api-permission": "General", + "x-api-rate-limit-pool": "Spot", + "x-sdk-service": "Spot", + "x-sdk-sub-service": "Order", + "x-sdk-method-name": "getOcoOrderList", + "x-sdk-method-description": "Request via this endpoint to get your current OCO order list. Items are paginated and sorted to show the latest first. See the Pagination section for retrieving additional entries after the first page.", + "x-api-rate-limit": 2, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"currentPage\\\": 1,\\n \\\"pageSize\\\": 50,\\n \\\"totalNum\\\": 1,\\n \\\"totalPage\\\": 1,\\n \\\"items\\\": [\\n {\\n \\\"orderId\\\": \\\"674c3cfa72cf2800072ee7ce\\\",\\n \\\"symbol\\\": \\\"BTC-USDT\\\",\\n \\\"clientOid\\\": \\\"5c52e1203aa6f3g7f1e493fb\\\",\\n \\\"orderTime\\\": 1733049594803,\\n \\\"status\\\": \\\"NEW\\\"\\n }\\n ]\\n }\\n}", + "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"startAt\\\": 123456, \\\"endAt\\\": 123456, \\\"orderIds\\\": \\\"example_string_default_value\\\", \\\"pageSize\\\": 50, \\\"currentPage\\\": 1}" } }, - "/api/v3/oco/order": { - "post": { - "summary": "Add OCO Order", + "/api/v3/oco/order/details/{orderId}": { + "get": { + "summary": "Get OCO Order Detail By OrderId", "deprecated": true, - "description": "Place OCO order to the Spot trading system", + "description": "Request via this interface to get a oco order detail via the order ID.", "tags": [], - "parameters": [], + "parameters": [ + { + "name": "orderId", + "in": "path", + "description": "The unique order id generated by the trading system", + "required": true, + "schema": { + "type": "string" + } + } + ], "responses": { "200": { "description": "", @@ -11926,129 +11960,95 @@ "orderId": { "type": "string", "description": "The unique order id generated by the trading system,which can be used later for further actions such as canceling the order." + }, + "symbol": { + "type": "string", + "description": "symbol" + }, + "clientOid": { + "type": "string", + "description": "Client Order Id" + }, + "orderTime": { + "type": "integer", + "description": "Order placement time, milliseconds", + "format": "int64" + }, + "status": { + "type": "string", + "description": "Order status: NEW: New, DONE: Completed, TRIGGERED: Triggered, CANCELLED: Cancelled" + }, + "orders": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "symbol": { + "type": "string" + }, + "side": { + "type": "string" + }, + "price": { + "type": "string" + }, + "stopPrice": { + "type": "string" + }, + "size": { + "type": "string" + }, + "status": { + "type": "string" + } + }, + "required": [ + "id", + "symbol", + "side", + "price", + "stopPrice", + "size", + "status" + ] + } } }, "required": [ - "orderId" - ] - } - }, - "required": [ - "code", - "data" - ] - } - } - } - } - }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470353", - "x-abandon": "abandon", - "x-domain": "Spot", - "x-api-channel": "Private", - "x-api-permission": "Spot", - "x-api-rate-limit-pool": "Spot", - "x-sdk-service": "Spot", - "x-sdk-sub-service": "Order", - "x-sdk-method-name": "addOcoOrder", - "x-sdk-method-description": "Place OCO order to the Spot trading system", - "x-api-rate-limit": 2, - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "clientOid": { - "type": "string", - "description": "Client Order Id,The ClientOid field is a unique ID created by the user(we recommend using a UUID), and can only contain numbers, letters, underscores (_), and hyphens (-). This field is returned when order information is obtained. You can use clientOid to tag your orders. ClientOid is different from the order ID created by the service provider. Please do not initiate requests using the same clientOid. The maximum length for the ClientOid is 40 characters.\n\nPlease remember the orderId created by the service provider, it used to check for updates in order status.", - "example": [ - "5c52e11203aa677f33e493fb" - ] - }, - "side": { - "type": "string", - "description": "specify if the order is to 'buy' or 'sell'", - "enum": [ - "buy", - "sell" - ], - "x-api-enum": [ - { - "value": "buy", - "name": "", - "description": "" - }, - { - "value": "sell", - "name": "", - "description": "" - } - ], - "example": [ - "buy" - ] - }, - "symbol": { - "type": "string", - "description": "symbol", - "example": [ - "BTC-USDT", - "ETH-USDT", - "KCS-USDT" - ] - }, - "remark": { - "type": "string", - "description": "Order placement remarks, length cannot exceed 20 characters (ASCII)" - }, - "price": { - "type": "string", - "description": "Specify price for order" - }, - "size": { - "type": "string", - "description": "Specify quantity for order" - }, - "stopPrice": { - "type": "string", - "description": "trigger price." - }, - "limitPrice": { - "type": "string", - "description": "The limit order price after take-profit and stop-loss are triggered." - }, - "tradeType": { - "type": "string", - "description": "Transaction Type, currently only supports TRADE (spot transactions), the default is TRADE", - "enum": [ - "TRADE" - ], - "x-api-enum": [ - { - "value": "TRADE", - "name": "TRADE", - "description": "Spot Trading" - } - ] - } - }, - "required": [ - "symbol", - "side", - "clientOid", - "price", - "size", - "stopPrice", - "limitPrice" - ] - }, - "example": "{\n \"symbol\": \"BTC-USDT\",\n \"side\": \"buy\",\n \"price\": \"94000\",\n \"size\": \"0.1\",\n \"clientOid\": \"5c52e11203aa67f1e493fb\",\n \"stopPrice\": \"98000\",\n \"limitPrice\": \"96000\",\n \"remark\": \"this is remark\",\n \"tradeType\": \"TRADE\"\n}" + "orderId", + "symbol", + "clientOid", + "orderTime", + "status", + "orders" + ] + } + }, + "required": [ + "code", + "data" + ] + } + } } } }, - "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"orderId\\\":\\\"674c316e688dea0007c7b986\\\"}}", - "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"side\\\": \\\"buy\\\", \\\"price\\\": \\\"94000\\\", \\\"size\\\": \\\"0.1\\\", \\\"clientOid\\\": \\\"5c52e11203aa67f1e493fb\\\", \\\"stopPrice\\\": \\\"98000\\\", \\\"limitPrice\\\": \\\"96000\\\", \\\"remark\\\": \\\"this is remark\\\", \\\"tradeType\\\": \\\"TRADE\\\"}" + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470359", + "x-abandon": "abandon", + "x-domain": "Spot", + "x-api-channel": "Private", + "x-api-permission": "General", + "x-api-rate-limit-pool": "Spot", + "x-sdk-service": "Spot", + "x-sdk-sub-service": "Order", + "x-sdk-method-name": "getOcoOrderDetailByOrderId", + "x-sdk-method-description": "Request via this interface to get a oco order detail via the order ID.", + "x-api-rate-limit": 2, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"orderId\\\": \\\"674c3b6e688dea0007c7bab2\\\",\\n \\\"symbol\\\": \\\"BTC-USDT\\\",\\n \\\"clientOid\\\": \\\"5c52e1203aa6f37f1e493fb\\\",\\n \\\"orderTime\\\": 1733049198863,\\n \\\"status\\\": \\\"NEW\\\",\\n \\\"orders\\\": [\\n {\\n \\\"id\\\": \\\"vs93gpqc7dn6h3fa003sfelj\\\",\\n \\\"symbol\\\": \\\"BTC-USDT\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"price\\\": \\\"94000.00000000000000000000\\\",\\n \\\"stopPrice\\\": \\\"94000.00000000000000000000\\\",\\n \\\"size\\\": \\\"0.10000000000000000000\\\",\\n \\\"status\\\": \\\"NEW\\\"\\n },\\n {\\n \\\"id\\\": \\\"vs93gpqc7dn6h3fa003sfelk\\\",\\n \\\"symbol\\\": \\\"BTC-USDT\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"price\\\": \\\"96000.00000000000000000000\\\",\\n \\\"stopPrice\\\": \\\"98000.00000000000000000000\\\",\\n \\\"size\\\": \\\"0.10000000000000000000\\\",\\n \\\"status\\\": \\\"NEW\\\"\\n }\\n ]\\n }\\n}", + "x-request-example": "{\\\"orderId\\\": \\\"674c3b6e688dea0007c7bab2\\\"}" } }, "/api/v1/bullet-public": { @@ -12228,41 +12228,297 @@ ] } }, - "required": [ - "code", - "data" - ] - } - } + "required": [ + "code", + "data" + ] + } + } + } + } + }, + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470295", + "x-abandon": "normal", + "x-domain": "Spot", + "x-api-channel": "Private", + "x-api-permission": "General", + "x-api-rate-limit-pool": "Spot", + "x-sdk-service": "Spot", + "x-sdk-sub-service": "Market", + "x-sdk-method-name": "getPrivateToken", + "x-sdk-method-description": "This interface can obtain the token required for websocket to establish a Spot/Margin private connection. If you need use private channels(e.g. account balance notice), please make request as follows to obtain the server list and private token", + "x-api-rate-limit": 10, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"token\\\": \\\"2neAiuYvAU737TOajb2U3uT8AEZqSWYe0fBD4LoHuXJDSC7gIzJiH4kNTWhCPISWo6nDpAe7aUaaHJ4fG8oRjFgMfUI2sM4IySWHrBceFocY8pKy2REU1HwZIngtMdMrjqPnP-biofFWbNaP1cl0X1pZc2SQ-33hDH1LgNP-yg80ZJv_Ctaj8sAFhTOZ8m1L.jut4vBQxXAseWKxODdGVGg==\\\",\\n \\\"instanceServers\\\": [\\n {\\n \\\"endpoint\\\": \\\"wss://ws-api-spot.kucoin.com/\\\",\\n \\\"encrypt\\\": true,\\n \\\"protocol\\\": \\\"websocket\\\",\\n \\\"pingInterval\\\": 18000,\\n \\\"pingTimeout\\\": 10000\\n }\\n ]\\n }\\n}" + } + }, + "/api/v1/orders": { + "post": { + "summary": "Add Order - Old", + "deprecated": true, + "description": "Place order to the Spot trading system, you can place two major types of orders: limit and market. Orders can only be placed if your account has sufficient funds. Once an order is placed, your funds will be put on hold for the duration of the order. The amount of funds on hold depends on the order type and parameters specified.", + "tags": [], + "parameters": [], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "object", + "properties": { + "orderId": { + "type": "string", + "description": "The unique order id generated by the trading system,which can be used later for further actions such as canceling the order." + } + }, + "required": [ + "orderId" + ] + } + }, + "required": [ + "code", + "data" + ] + } + } + } + } + }, + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470333", + "x-abandon": "abandon", + "x-domain": "Spot", + "x-api-channel": "Private", + "x-api-permission": "Spot", + "x-api-rate-limit-pool": "Spot", + "x-sdk-service": "Spot", + "x-sdk-sub-service": "Order", + "x-sdk-method-name": "addOrderOld", + "x-sdk-method-description": "Place order to the Spot trading system, you can place two major types of orders: limit and market. Orders can only be placed if your account has sufficient funds. Once an order is placed, your funds will be put on hold for the duration of the order. The amount of funds on hold depends on the order type and parameters specified.", + "x-api-rate-limit": 2, + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "clientOid": { + "type": "string", + "description": "Client Order Id,The ClientOid field is a unique ID created by the user(we recommend using a UUID), and can only contain numbers, letters, underscores (_), and hyphens (-). This field is returned when order information is obtained. You can use clientOid to tag your orders. ClientOid is different from the order ID created by the service provider. Please do not initiate requests using the same clientOid. The maximum length for the ClientOid is 40 characters.\n\nPlease remember the orderId created by the service provider, it used to check for updates in order status.", + "example": [ + "5c52e11203aa677f33e493fb" + ] + }, + "side": { + "type": "string", + "description": "specify if the order is to 'buy' or 'sell'", + "enum": [ + "buy", + "sell" + ], + "x-api-enum": [ + { + "value": "buy", + "name": "", + "description": "" + }, + { + "value": "sell", + "name": "", + "description": "" + } + ], + "example": [ + "buy" + ] + }, + "symbol": { + "type": "string", + "description": "symbol", + "example": [ + "BTC-USDT", + "ETH-USDT", + "KCS-USDT" + ] + }, + "type": { + "type": "string", + "description": "specify if the order is an 'limit' order or 'market' order. \n\nThe type of order you specify when you place your order determines whether or not you need to request other parameters and also affects the execution of the matching engine.\n\nWhen placing a limit order, you must specify a price and size. The system will try to match the order according to market price or a price better than market price. If the order cannot be immediately matched, it will stay in the order book until it is matched or the user cancels.\n\nUnlike limit orders, the price for market orders fluctuates with market prices. When placing a market order, you do not need to specify a price, you only need to specify a quantity. Market orders are filled immediately and will not enter the order book. All market orders are takers and a taker fee will be charged.", + "enum": [ + "limit", + "market" + ], + "default": "limit", + "x-api-enum": [ + { + "value": "limit", + "name": "limit", + "description": "limit order" + }, + { + "value": "market", + "name": "market", + "description": "market order" + } + ] + }, + "remark": { + "type": "string", + "description": "Order placement remarks, length cannot exceed 20 characters (ASCII)" + }, + "stp": { + "type": "string", + "description": "[Self Trade Prevention](https://www.kucoin.com/docs-new/doc-338146) is divided into four strategies: CN, CO, CB , and DC", + "enum": [ + "DC", + "CO", + "CN", + "CB" + ], + "x-api-enum": [ + { + "value": "DC", + "name": "", + "description": "" + }, + { + "value": "CO", + "name": "", + "description": "" + }, + { + "value": "CN", + "name": "", + "description": "" + }, + { + "value": "CB", + "name": "", + "description": "" + } + ] + }, + "price": { + "type": "string", + "description": "Specify price for order\n\nWhen placing a limit order, the price must be based on priceIncrement for the trading pair. The price increment (priceIncrement) is the price precision for the trading pair. For example, for the BTC-USDT trading pair, the priceIncrement is 0.00001000. So the price for your orders cannot be less than 0.00001000 and must be a multiple of priceIncrement. Otherwise, the order will return an invalid priceIncrement error." + }, + "size": { + "type": "string", + "description": "Specify quantity for order\n\nWhen **type** is limit, size refers to the amount of trading targets (the asset name written in front) for the trading pair. Teh Size must be based on the baseIncrement of the trading pair. The baseIncrement represents the precision for the trading pair. The size of an order must be a positive-integer multiple of baseIncrement and must be between baseMinSize and baseMaxSize.\n\nWhen **type** is market, select one out of two: size or funds" + }, + "timeInForce": { + "type": "string", + "description": "[Time in force](https://www.kucoin.com/docs-new/doc-338146) is a special strategy used during trading", + "enum": [ + "GTC", + "GTT", + "IOC", + "FOK" + ], + "default": "GTC", + "x-api-enum": [ + { + "value": "GTC", + "name": "", + "description": "" + }, + { + "value": "GTT", + "name": "", + "description": "" + }, + { + "value": "IOC", + "name": "", + "description": "" + }, + { + "value": "FOK", + "name": "", + "description": "" + } + ] + }, + "postOnly": { + "type": "boolean", + "default": false, + "description": "passive order labels, this is disabled when the order timing strategy is IOC or FOK" + }, + "hidden": { + "type": "boolean", + "description": "Hidden or not (not shown in order book)", + "default": false + }, + "iceberg": { + "type": "boolean", + "description": "Whether or not only visible portions of orders are shown in iceberg orders", + "default": false + }, + "visibleSize": { + "type": "string", + "description": "Maximum visible quantity in iceberg orders" + }, + "cancelAfter": { + "type": "integer", + "format": "int64", + "description": "Cancel after n seconds,the order timing strategy is GTT" + }, + "funds": { + "type": "string", + "description": "When **type** is market, select one out of two: size or funds" + }, + "tradeType": { + "type": "string", + "description": "The type of trading : **TRADE**(Spot Trade), **MARGIN_TRADE** (Margin Trade). Default is **TRADE**. **Note: To improve the system performance and to accelerate order placing and processing, KuCoin has added a new interface for order placing of margin. For traders still using the current interface, please move to the new one as soon as possible. The current one will no longer accept margin orders by May 1st, 2021 (UTC). At the time, KuCoin will notify users via the announcement, please pay attention to it.**", + "enum": [ + "TRADE", + "MARGIN_TRADE" + ], + "default": "TRADE", + "x-api-enum": [ + { + "value": "TRADE", + "name": "TRADE", + "description": "Spot" + }, + { + "value": "MARGIN_TRADE", + "name": "MARGIN_TRADE", + "description": "Margin" + } + ] + } + }, + "required": [ + "symbol", + "side", + "clientOid" + ] + }, + "example": "//limit order\n{\n \"type\": \"limit\",\n \"symbol\": \"BTC-USDT\",\n \"side\": \"buy\",\n \"price\": \"50000\",\n \"size\": \"0.00001\",\n \"clientOid\": \"5c52e11203aa677f33e493fb\",\n \"remark\": \"order remarks\"\n}\n\n//market order 1\n// {\n// \"type\": \"market\",\n// \"symbol\": \"BTC-USDT\",\n// \"side\": \"buy\",\n// \"size\": \"0.00001\",\n// \"clientOid\": \"5c52e11203aa677f33e493fc\",\n// \"remark\": \"order remarks\"\n// }\n\n//market order 2\n// {\n// \"type\": \"market\",\n// \"symbol\": \"BTC-USDT\",\n// \"side\": \"buy\",\n// \"funds\": \"1\",\n// \"clientOid\": \"5c52e11203aa677f33e493fc\",\n// \"remark\": \"order remarks\"\n// }\n" } } }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470295", - "x-abandon": "normal", - "x-domain": "Spot", - "x-api-channel": "Private", - "x-api-permission": "General", - "x-api-rate-limit-pool": "Spot", - "x-sdk-service": "Spot", - "x-sdk-sub-service": "Market", - "x-sdk-method-name": "getPrivateToken", - "x-sdk-method-description": "This interface can obtain the token required for websocket to establish a Spot/Margin private connection. If you need use private channels(e.g. account balance notice), please make request as follows to obtain the server list and private token", - "x-api-rate-limit": 10, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"token\\\": \\\"2neAiuYvAU737TOajb2U3uT8AEZqSWYe0fBD4LoHuXJDSC7gIzJiH4kNTWhCPISWo6nDpAe7aUaaHJ4fG8oRjFgMfUI2sM4IySWHrBceFocY8pKy2REU1HwZIngtMdMrjqPnP-biofFWbNaP1cl0X1pZc2SQ-33hDH1LgNP-yg80ZJv_Ctaj8sAFhTOZ8m1L.jut4vBQxXAseWKxODdGVGg==\\\",\\n \\\"instanceServers\\\": [\\n {\\n \\\"endpoint\\\": \\\"wss://ws-api-spot.kucoin.com/\\\",\\n \\\"encrypt\\\": true,\\n \\\"protocol\\\": \\\"websocket\\\",\\n \\\"pingInterval\\\": 18000,\\n \\\"pingTimeout\\\": 10000\\n }\\n ]\\n }\\n}" - } - }, - "/api/v1/orders/{orderId}": { + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"orderId\\\": \\\"674a8635b38d120007709c0f\\\"\\n }\\n}", + "x-request-example": "{\\\"type\\\": \\\"limit\\\", \\\"symbol\\\": \\\"BTC-USDT\\\", \\\"side\\\": \\\"buy\\\", \\\"price\\\": \\\"50000\\\", \\\"size\\\": \\\"0.00001\\\", \\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\", \\\"remark\\\": \\\"order remarks\\\"}" + }, "delete": { - "summary": "Cancel Order By OrderId - Old", + "summary": "Batch Cancel Order - Old", "deprecated": true, - "description": "This endpoint can be used to cancel a spot order by orderId. This endpoint only sends cancellation requests. The results of the requests must be obtained by checking the order status or subscribing to websocket.", + "description": "Request via this endpoint to cancel all open orders. The response is a list of ids of the canceled orders.", "tags": [], "parameters": [ { "name": "symbol", "in": "query", "description": "symbol", - "required": true, + "required": false, "schema": { "type": "string", "example": [ @@ -12273,217 +12529,61 @@ } }, { - "name": "orderId", - "in": "path", - "description": "The unique order id generated by the trading system", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "data": { - "type": "object", - "properties": { - "cancelledOrderIds": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": [ - "cancelledOrderIds" - ] - } - }, - "required": [ - "code", - "data" - ] - } - } - } - } - }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470343", - "x-abandon": "abandon", - "x-domain": "Spot", - "x-api-channel": "Private", - "x-api-permission": "Spot", - "x-api-rate-limit-pool": "Spot", - "x-sdk-service": "Spot", - "x-sdk-sub-service": "Order", - "x-sdk-method-name": "cancelOrderByOrderIdOld", - "x-sdk-method-description": "This endpoint can be used to cancel a spot order by orderId. This endpoint only sends cancellation requests. The results of the requests must be obtained by checking the order status or subscribing to websocket.", - "x-api-rate-limit": 3, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"cancelledOrderIds\\\": [\\n \\\"674a97dfef434f0007efc431\\\"\\n ]\\n }\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"orderId\\\": \\\"674a97dfef434f0007efc431\\\"}" - }, - "get": { - "summary": "Get Order By OrderId - Old", - "deprecated": true, - "description": "Request via this endpoint to get a single order info by order ID.", - "tags": [], - "parameters": [ - { - "name": "orderId", - "in": "path", - "description": "The unique order id generated by the trading system", - "required": true, + "name": "tradeType", + "in": "query", + "description": "The type of trading :TRADE(Spot Trading), MARGIN_TRADE(Cross Margin Trading), MARGIN_ISOLATED_TRADE(Isolated Margin Trading), and the default is TRADE to cancel the spot trading orders.", + "required": false, "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "data": { - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "symbol": { - "type": "string" - }, - "opType": { - "type": "string" - }, - "type": { - "type": "string" - }, - "side": { - "type": "string" - }, - "price": { - "type": "string" - }, - "size": { - "type": "string" - }, - "funds": { - "type": "string" - }, - "dealFunds": { - "type": "string" - }, - "dealSize": { - "type": "string" - }, - "fee": { - "type": "string" - }, - "feeCurrency": { - "type": "string" - }, - "stp": { - "type": "string" - }, - "stop": { - "type": "string" - }, - "stopTriggered": { - "type": "boolean" - }, - "stopPrice": { - "type": "string" - }, - "timeInForce": { - "type": "string" - }, - "postOnly": { - "type": "boolean" - }, - "hidden": { - "type": "boolean" - }, - "iceberg": { - "type": "boolean" - }, - "visibleSize": { - "type": "string" - }, - "cancelAfter": { - "type": "integer" - }, - "channel": { - "type": "string" - }, - "clientOid": { - "type": "string" - }, - "remark": { - "type": "string" - }, - "tags": { - "type": "string" - }, - "isActive": { - "type": "boolean" - }, - "cancelExist": { - "type": "boolean" - }, - "createdAt": { - "type": "integer", - "format": "int64" - }, - "tradeType": { - "type": "string" + "type": "string", + "enum": [ + "TRADE", + "MARGIN_TRADE", + "MARGIN_ISOLATED_TRADE" + ], + "default": "TRADE", + "x-api-enum": [ + { + "value": "TRADE", + "name": "TRADE", + "description": "Spot Trading" + }, + { + "value": "MARGIN_TRADE", + "name": "MARGIN_TRADE", + "description": "Cross Margin Trading" + }, + { + "value": "MARGIN_ISOLATED_TRADE", + "name": "MARGIN_ISOLATED_TRADE", + "description": "Isolated Margin Trading" + } + ] + } + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "object", + "properties": { + "cancelledOrderIds": { + "type": "array", + "items": { + "type": "string" + } } }, "required": [ - "id", - "symbol", - "opType", - "type", - "side", - "price", - "size", - "funds", - "dealFunds", - "dealSize", - "fee", - "feeCurrency", - "stp", - "stop", - "stopTriggered", - "stopPrice", - "timeInForce", - "postOnly", - "hidden", - "iceberg", - "visibleSize", - "cancelAfter", - "channel", - "clientOid", - "remark", - "tags", - "isActive", - "cancelExist", - "createdAt", - "tradeType" + "cancelledOrderIds" ] } }, @@ -12496,22 +12596,20 @@ } } }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470348", + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470345", "x-abandon": "abandon", "x-domain": "Spot", "x-api-channel": "Private", - "x-api-permission": "General", + "x-api-permission": "Spot", "x-api-rate-limit-pool": "Spot", "x-sdk-service": "Spot", "x-sdk-sub-service": "Order", - "x-sdk-method-name": "getOrderByOrderIdOld", - "x-sdk-method-description": "Request via this endpoint to get a single order info by order ID.", - "x-api-rate-limit": 2, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"id\\\": \\\"674a97dfef434f0007efc431\\\",\\n \\\"symbol\\\": \\\"BTC-USDT\\\",\\n \\\"opType\\\": \\\"DEAL\\\",\\n \\\"type\\\": \\\"limit\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"price\\\": \\\"50000\\\",\\n \\\"size\\\": \\\"0.0001\\\",\\n \\\"funds\\\": \\\"0\\\",\\n \\\"dealFunds\\\": \\\"0\\\",\\n \\\"dealSize\\\": \\\"0\\\",\\n \\\"fee\\\": \\\"0\\\",\\n \\\"feeCurrency\\\": \\\"USDT\\\",\\n \\\"stp\\\": \\\"\\\",\\n \\\"stop\\\": \\\"\\\",\\n \\\"stopTriggered\\\": false,\\n \\\"stopPrice\\\": \\\"0\\\",\\n \\\"timeInForce\\\": \\\"GTC\\\",\\n \\\"postOnly\\\": false,\\n \\\"hidden\\\": false,\\n \\\"iceberg\\\": false,\\n \\\"visibleSize\\\": \\\"0\\\",\\n \\\"cancelAfter\\\": 0,\\n \\\"channel\\\": \\\"API\\\",\\n \\\"clientOid\\\": \\\"3d07008668054da6b3cb12e432c2b13a\\\",\\n \\\"remark\\\": null,\\n \\\"tags\\\": null,\\n \\\"isActive\\\": false,\\n \\\"cancelExist\\\": true,\\n \\\"createdAt\\\": 1732941791518,\\n \\\"tradeType\\\": \\\"TRADE\\\"\\n }\\n}", - "x-request-example": "{\\\"orderId\\\": \\\"674a97dfef434f0007efc431\\\"}" - } - }, - "/api/v1/orders": { + "x-sdk-method-name": "batchCancelOrderOld", + "x-sdk-method-description": "Request via this endpoint to cancel all open orders. The response is a list of ids of the canceled orders.", + "x-api-rate-limit": 20, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"cancelledOrderIds\\\": [\\n \\\"674a8635b38d120007709c0f\\\",\\n \\\"674a8630439c100007d3bce1\\\"\\n ]\\n }\\n}", + "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"tradeType\\\": \\\"TRADE\\\"}" + }, "get": { "summary": "Get Orders List - Old", "deprecated": true, @@ -12794,173 +12892,71 @@ }, "channel": { "type": "string" - }, - "clientOid": { - "type": "string" - }, - "remark": { - "type": "string" - }, - "tags": { - "type": "string" - }, - "isActive": { - "type": "boolean" - }, - "cancelExist": { - "type": "boolean" - }, - "createdAt": { - "type": "integer", - "format": "int64" - }, - "tradeType": { - "type": "string" - } - }, - "required": [ - "id", - "symbol", - "opType", - "type", - "side", - "price", - "size", - "funds", - "dealFunds", - "dealSize", - "fee", - "feeCurrency", - "stp", - "stop", - "stopTriggered", - "stopPrice", - "timeInForce", - "postOnly", - "hidden", - "iceberg", - "visibleSize", - "cancelAfter", - "channel", - "clientOid", - "remark", - "tags", - "isActive", - "cancelExist", - "createdAt", - "tradeType" - ] - } - } - }, - "required": [ - "currentPage", - "pageSize", - "totalNum", - "totalPage", - "items" - ] - } - }, - "required": [ - "code", - "data" - ] - } - } - } - } - }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470346", - "x-abandon": "abandon", - "x-domain": "Spot", - "x-api-channel": "Private", - "x-api-permission": "General", - "x-api-rate-limit-pool": "Spot", - "x-sdk-service": "Spot", - "x-sdk-sub-service": "Order", - "x-sdk-method-name": "getOrdersListOld", - "x-sdk-method-description": "Request via this endpoint to get your current order list. The return value is the data after Pagination, sorted in descending order according to time.", - "x-api-rate-limit": 2, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"currentPage\\\": 1,\\n \\\"pageSize\\\": 50,\\n \\\"totalNum\\\": 1,\\n \\\"totalPage\\\": 1,\\n \\\"items\\\": [\\n {\\n \\\"id\\\": \\\"674a9a872033a50007e2790d\\\",\\n \\\"symbol\\\": \\\"BTC-USDT\\\",\\n \\\"opType\\\": \\\"DEAL\\\",\\n \\\"type\\\": \\\"limit\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"price\\\": \\\"50000\\\",\\n \\\"size\\\": \\\"0.00001\\\",\\n \\\"funds\\\": \\\"0\\\",\\n \\\"dealFunds\\\": \\\"0\\\",\\n \\\"dealSize\\\": \\\"0\\\",\\n \\\"fee\\\": \\\"0\\\",\\n \\\"feeCurrency\\\": \\\"USDT\\\",\\n \\\"stp\\\": \\\"\\\",\\n \\\"stop\\\": \\\"\\\",\\n \\\"stopTriggered\\\": false,\\n \\\"stopPrice\\\": \\\"0\\\",\\n \\\"timeInForce\\\": \\\"GTC\\\",\\n \\\"postOnly\\\": false,\\n \\\"hidden\\\": false,\\n \\\"iceberg\\\": false,\\n \\\"visibleSize\\\": \\\"0\\\",\\n \\\"cancelAfter\\\": 0,\\n \\\"channel\\\": \\\"API\\\",\\n \\\"clientOid\\\": \\\"5c52e11203aa677f33e4923fb\\\",\\n \\\"remark\\\": \\\"order remarks\\\",\\n \\\"tags\\\": null,\\n \\\"isActive\\\": false,\\n \\\"cancelExist\\\": true,\\n \\\"createdAt\\\": 1732942471752,\\n \\\"tradeType\\\": \\\"TRADE\\\"\\n }\\n ]\\n }\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"status\\\": \\\"active\\\", \\\"side\\\": \\\"buy\\\", \\\"type\\\": \\\"limit\\\", \\\"tradeType\\\": \\\"TRADE\\\", \\\"startAt\\\": 123456, \\\"endAt\\\": 123456, \\\"currentPage\\\": 1, \\\"pageSize\\\": 50}" - }, - "delete": { - "summary": "Batch Cancel Order - Old", - "deprecated": true, - "description": "Request via this endpoint to cancel all open orders. The response is a list of ids of the canceled orders.", - "tags": [], - "parameters": [ - { - "name": "symbol", - "in": "query", - "description": "symbol", - "required": false, - "schema": { - "type": "string", - "example": [ - "BTC-USDT", - "ETH-USDT", - "KCS-USDT" - ] - } - }, - { - "name": "tradeType", - "in": "query", - "description": "The type of trading :TRADE(Spot Trading), MARGIN_TRADE(Cross Margin Trading), MARGIN_ISOLATED_TRADE(Isolated Margin Trading), and the default is TRADE to cancel the spot trading orders.", - "required": false, - "schema": { - "type": "string", - "enum": [ - "TRADE", - "MARGIN_TRADE", - "MARGIN_ISOLATED_TRADE" - ], - "default": "TRADE", - "x-api-enum": [ - { - "value": "TRADE", - "name": "TRADE", - "description": "Spot Trading" - }, - { - "value": "MARGIN_TRADE", - "name": "MARGIN_TRADE", - "description": "Cross Margin Trading" - }, - { - "value": "MARGIN_ISOLATED_TRADE", - "name": "MARGIN_ISOLATED_TRADE", - "description": "Isolated Margin Trading" - } - ] - } - } - ], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "data": { - "type": "object", - "properties": { - "cancelledOrderIds": { - "type": "array", - "items": { - "type": "string" + }, + "clientOid": { + "type": "string" + }, + "remark": { + "type": "string" + }, + "tags": { + "type": "string" + }, + "isActive": { + "type": "boolean" + }, + "cancelExist": { + "type": "boolean" + }, + "createdAt": { + "type": "integer", + "format": "int64" + }, + "tradeType": { + "type": "string" + } + }, + "required": [ + "id", + "symbol", + "opType", + "type", + "side", + "price", + "size", + "funds", + "dealFunds", + "dealSize", + "fee", + "feeCurrency", + "stp", + "stop", + "stopTriggered", + "stopPrice", + "timeInForce", + "postOnly", + "hidden", + "iceberg", + "visibleSize", + "cancelAfter", + "channel", + "clientOid", + "remark", + "tags", + "isActive", + "cancelExist", + "createdAt", + "tradeType" + ] } } }, "required": [ - "cancelledOrderIds" + "currentPage", + "pageSize", + "totalNum", + "totalPage", + "items" ] } }, @@ -12973,24 +12969,26 @@ } } }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470345", + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470346", "x-abandon": "abandon", "x-domain": "Spot", "x-api-channel": "Private", - "x-api-permission": "Spot", + "x-api-permission": "General", "x-api-rate-limit-pool": "Spot", "x-sdk-service": "Spot", "x-sdk-sub-service": "Order", - "x-sdk-method-name": "batchCancelOrderOld", - "x-sdk-method-description": "Request via this endpoint to cancel all open orders. The response is a list of ids of the canceled orders.", - "x-api-rate-limit": 20, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"cancelledOrderIds\\\": [\\n \\\"674a8635b38d120007709c0f\\\",\\n \\\"674a8630439c100007d3bce1\\\"\\n ]\\n }\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"tradeType\\\": \\\"TRADE\\\"}" - }, + "x-sdk-method-name": "getOrdersListOld", + "x-sdk-method-description": "Request via this endpoint to get your current order list. The return value is the data after Pagination, sorted in descending order according to time.", + "x-api-rate-limit": 2, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"currentPage\\\": 1,\\n \\\"pageSize\\\": 50,\\n \\\"totalNum\\\": 1,\\n \\\"totalPage\\\": 1,\\n \\\"items\\\": [\\n {\\n \\\"id\\\": \\\"674a9a872033a50007e2790d\\\",\\n \\\"symbol\\\": \\\"BTC-USDT\\\",\\n \\\"opType\\\": \\\"DEAL\\\",\\n \\\"type\\\": \\\"limit\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"price\\\": \\\"50000\\\",\\n \\\"size\\\": \\\"0.00001\\\",\\n \\\"funds\\\": \\\"0\\\",\\n \\\"dealFunds\\\": \\\"0\\\",\\n \\\"dealSize\\\": \\\"0\\\",\\n \\\"fee\\\": \\\"0\\\",\\n \\\"feeCurrency\\\": \\\"USDT\\\",\\n \\\"stp\\\": \\\"\\\",\\n \\\"stop\\\": \\\"\\\",\\n \\\"stopTriggered\\\": false,\\n \\\"stopPrice\\\": \\\"0\\\",\\n \\\"timeInForce\\\": \\\"GTC\\\",\\n \\\"postOnly\\\": false,\\n \\\"hidden\\\": false,\\n \\\"iceberg\\\": false,\\n \\\"visibleSize\\\": \\\"0\\\",\\n \\\"cancelAfter\\\": 0,\\n \\\"channel\\\": \\\"API\\\",\\n \\\"clientOid\\\": \\\"5c52e11203aa677f33e4923fb\\\",\\n \\\"remark\\\": \\\"order remarks\\\",\\n \\\"tags\\\": null,\\n \\\"isActive\\\": false,\\n \\\"cancelExist\\\": true,\\n \\\"createdAt\\\": 1732942471752,\\n \\\"tradeType\\\": \\\"TRADE\\\"\\n }\\n ]\\n }\\n}", + "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"status\\\": \\\"active\\\", \\\"side\\\": \\\"buy\\\", \\\"type\\\": \\\"limit\\\", \\\"tradeType\\\": \\\"TRADE\\\", \\\"startAt\\\": 123456, \\\"endAt\\\": 123456, \\\"currentPage\\\": 1, \\\"pageSize\\\": 50}" + } + }, + "/api/v1/orders/test": { "post": { - "summary": "Add Order - Old", + "summary": "Add Order Test - Old", "deprecated": true, - "description": "Place order to the Spot trading system, you can place two major types of orders: limit and market. Orders can only be placed if your account has sufficient funds. Once an order is placed, your funds will be put on hold for the duration of the order. The amount of funds on hold depends on the order type and parameters specified.", + "description": "Order test endpoint, the request parameters and return parameters of this endpoint are exactly the same as the order endpoint, and can be used to verify whether the signature is correct and other operations. After placing an order, the order will not enter the matching system, and the order cannot be queried.", "tags": [], "parameters": [], "responses": { @@ -13026,7 +13024,7 @@ } } }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470333", + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470341", "x-abandon": "abandon", "x-domain": "Spot", "x-api-channel": "Private", @@ -13034,8 +13032,8 @@ "x-api-rate-limit-pool": "Spot", "x-sdk-service": "Spot", "x-sdk-sub-service": "Order", - "x-sdk-method-name": "addOrderOld", - "x-sdk-method-description": "Place order to the Spot trading system, you can place two major types of orders: limit and market. Orders can only be placed if your account has sufficient funds. Once an order is placed, your funds will be put on hold for the duration of the order. The amount of funds on hold depends on the order type and parameters specified.", + "x-sdk-method-name": "addOrderTestOld", + "x-sdk-method-description": "Order test endpoint, the request parameters and return parameters of this endpoint are exactly the same as the order endpoint, and can be used to verify whether the signature is correct and other operations. After placing an order, the order will not enter the matching system, and the order cannot be queried.", "x-api-rate-limit": 2, "requestBody": { "content": { @@ -13168,253 +13166,509 @@ "name": "", "description": "" }, - { - "value": "IOC", - "name": "", - "description": "" + { + "value": "IOC", + "name": "", + "description": "" + }, + { + "value": "FOK", + "name": "", + "description": "" + } + ] + }, + "postOnly": { + "type": "boolean", + "default": false, + "description": "passive order labels, this is disabled when the order timing strategy is IOC or FOK" + }, + "hidden": { + "type": "boolean", + "description": "Hidden or not (not shown in order book)", + "default": false + }, + "iceberg": { + "type": "boolean", + "description": "Whether or not only visible portions of orders are shown in iceberg orders", + "default": false + }, + "visibleSize": { + "type": "string", + "description": "Maximum visible quantity in iceberg orders" + }, + "cancelAfter": { + "type": "integer", + "format": "int64", + "description": "Cancel after n seconds,the order timing strategy is GTT" + }, + "funds": { + "type": "string", + "description": "When **type** is market, select one out of two: size or funds" + }, + "tradeType": { + "type": "string", + "description": "The type of trading : **TRADE**(Spot Trade), **MARGIN_TRADE** (Margin Trade). Default is **TRADE**. **Note: To improve the system performance and to accelerate order placing and processing, KuCoin has added a new interface for order placing of margin. For traders still using the current interface, please move to the new one as soon as possible. The current one will no longer accept margin orders by May 1st, 2021 (UTC). At the time, KuCoin will notify users via the announcement, please pay attention to it.**", + "enum": [ + "TRADE", + "MARGIN_TRADE" + ], + "default": "TRADE", + "x-api-enum": [ + { + "value": "TRADE", + "name": "TRADE", + "description": "Spot" + }, + { + "value": "MARGIN_TRADE", + "name": "MARGIN_TRADE", + "description": "Margin" + } + ] + } + }, + "required": [ + "symbol", + "side", + "clientOid" + ] + }, + "example": "//limit order\n{\n \"type\": \"limit\",\n \"symbol\": \"BTC-USDT\",\n \"side\": \"buy\",\n \"price\": \"50000\",\n \"size\": \"0.00001\",\n \"clientOid\": \"5c52e11203aa677f33e493fb\",\n \"remark\": \"order remarks\"\n}\n\n//market order 1\n// {\n// \"type\": \"market\",\n// \"symbol\": \"BTC-USDT\",\n// \"side\": \"buy\",\n// \"size\": \"0.00001\",\n// \"clientOid\": \"5c52e11203aa677f33e493fc\",\n// \"remark\": \"order remarks\"\n// }\n\n//market order 2\n// {\n// \"type\": \"market\",\n// \"symbol\": \"BTC-USDT\",\n// \"side\": \"buy\",\n// \"funds\": \"1\",\n// \"clientOid\": \"5c52e11203aa677f33e493fc\",\n// \"remark\": \"order remarks\"\n// }\n" + } + } + }, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"orderId\\\": \\\"674a8776291d9e00074f1edf\\\"\\n }\\n}", + "x-request-example": "{\\\"type\\\": \\\"limit\\\", \\\"symbol\\\": \\\"BTC-USDT\\\", \\\"side\\\": \\\"buy\\\", \\\"price\\\": \\\"50000\\\", \\\"size\\\": \\\"0.00001\\\", \\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\", \\\"remark\\\": \\\"order remarks\\\"}" + } + }, + "/api/v1/orders/multi": { + "post": { + "summary": "Batch Add Orders - Old", + "deprecated": true, + "description": "Request via this endpoint to place 5 orders at the same time. The order type must be a limit order of the same symbol.", + "tags": [], + "parameters": [], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "type": "object", + "properties": { + "symbol": { + "type": "string" + }, + "type": { + "type": "string" + }, + "side": { + "type": "string" + }, + "price": { + "type": "string" + }, + "size": { + "type": "string" + }, + "funds": { + "type": "string" + }, + "stp": { + "type": "string" + }, + "stop": { + "type": "string" + }, + "stopPrice": { + "type": "string" + }, + "timeInForce": { + "type": "string" + }, + "cancelAfter": { + "type": "integer" + }, + "postOnly": { + "type": "boolean" + }, + "hidden": { + "type": "boolean" + }, + "iceberge": { + "type": "boolean" + }, + "iceberg": { + "type": "boolean" + }, + "visibleSize": { + "type": "string" + }, + "channel": { + "type": "string" + }, + "id": { + "type": "string" + }, + "status": { + "type": "string" + }, + "failMsg": { + "type": "string" + }, + "clientOid": { + "type": "string" + } + }, + "required": [ + "symbol", + "type", + "side", + "price", + "size", + "funds", + "stp", + "stop", + "stopPrice", + "timeInForce", + "cancelAfter", + "postOnly", + "hidden", + "iceberge", + "iceberg", + "visibleSize", + "channel", + "id", + "status", + "failMsg", + "clientOid" + ] + } + } + }, + "required": [ + "data" + ] + } + }, + "required": [ + "code", + "data" + ] + } + } + } + } + }, + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470342", + "x-abandon": "abandon", + "x-domain": "Spot", + "x-api-channel": "Private", + "x-api-permission": "Spot", + "x-api-rate-limit-pool": "Spot", + "x-sdk-service": "Spot", + "x-sdk-sub-service": "Order", + "x-sdk-method-name": "batchAddOrdersOld", + "x-sdk-method-description": "Request via this endpoint to place 5 orders at the same time. The order type must be a limit order of the same symbol.", + "x-api-rate-limit": 3, + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "orderList": { + "type": "array", + "items": { + "type": "object", + "properties": { + "clientOid": { + "type": "string", + "description": "Client Order Id,The ClientOid field is a unique ID created by the user(we recommend using a UUID), and can only contain numbers, letters, underscores (_), and hyphens (-). This field is returned when order information is obtained. You can use clientOid to tag your orders. ClientOid is different from the order ID created by the service provider. Please do not initiate requests using the same clientOid. The maximum length for the ClientOid is 40 characters.\n\nPlease remember the orderId created by the service provider, it used to check for updates in order status.", + "example": [ + "5c52e11203aa677f33e493fb" + ] + }, + "side": { + "type": "string", + "description": "specify if the order is to 'buy' or 'sell'", + "enum": [ + "buy", + "sell" + ], + "x-api-enum": [ + { + "value": "buy", + "name": "", + "description": "" + }, + { + "value": "sell", + "name": "", + "description": "" + } + ], + "example": [ + "buy" + ] + }, + "symbol": { + "type": "string", + "description": "symbol", + "example": [ + "BTC-USDT", + "ETH-USDT", + "KCS-USDT" + ] + }, + "type": { + "type": "string", + "description": "only limit (default is limit)", + "enum": [ + "limit" + ], + "default": "limit", + "x-api-enum": [ + { + "value": "limit", + "name": "limit", + "description": "limit order" + } + ] + }, + "remark": { + "type": "string", + "description": "Order placement remarks, length cannot exceed 20 characters (ASCII)" + }, + "stp": { + "type": "string", + "description": "[Self Trade Prevention](https://www.kucoin.com/docs-new/doc-338146) is divided into four strategies: CN, CO, CB , and DC", + "enum": [ + "DC", + "CO", + "CN", + "CB" + ], + "x-api-enum": [ + { + "value": "DC", + "name": "", + "description": "" + }, + { + "value": "CO", + "name": "", + "description": "" + }, + { + "value": "CN", + "name": "", + "description": "" + }, + { + "value": "CB", + "name": "", + "description": "" + } + ] + }, + "price": { + "type": "string", + "description": "Specify price for order\n\nWhen placing a limit order, the price must be based on priceIncrement for the trading pair. The price increment (priceIncrement) is the price precision for the trading pair. For example, for the BTC-USDT trading pair, the priceIncrement is 0.00001000. So the price for your orders cannot be less than 0.00001000 and must be a multiple of priceIncrement. Otherwise, the order will return an invalid priceIncrement error." + }, + "size": { + "type": "string", + "description": "Specify quantity for order\n\nWhen **type** is limit, size refers to the amount of trading targets (the asset name written in front) for the trading pair. Teh Size must be based on the baseIncrement of the trading pair. The baseIncrement represents the precision for the trading pair. The size of an order must be a positive-integer multiple of baseIncrement and must be between baseMinSize and baseMaxSize.\n\nWhen **type** is market, select one out of two: size or funds" + }, + "timeInForce": { + "type": "string", + "description": "[Time in force](https://www.kucoin.com/docs-new/doc-338146) is a special strategy used during trading", + "enum": [ + "GTC", + "GTT", + "IOC", + "FOK" + ], + "default": "GTC", + "x-api-enum": [ + { + "value": "GTC", + "name": "", + "description": "" + }, + { + "value": "GTT", + "name": "", + "description": "" + }, + { + "value": "IOC", + "name": "", + "description": "" + }, + { + "value": "FOK", + "name": "", + "description": "" + } + ] + }, + "postOnly": { + "type": "boolean", + "default": false, + "description": "passive order labels, this is disabled when the order timing strategy is IOC or FOK" + }, + "hidden": { + "type": "boolean", + "description": "Hidden or not (not shown in order book)", + "default": false + }, + "iceberg": { + "type": "boolean", + "description": "Whether or not only visible portions of orders are shown in iceberg orders", + "default": false + }, + "visibleSize": { + "type": "string", + "description": "Maximum visible quantity in iceberg orders" + }, + "cancelAfter": { + "type": "integer", + "format": "int64", + "description": "Cancel after n seconds,the order timing strategy is GTT" + }, + "tradeType": { + "type": "string", + "description": "The type of trading : **TRADE**(Spot Trade)", + "enum": [ + "TRADE" + ], + "default": "TRADE", + "x-api-enum": [ + { + "value": "TRADE", + "name": "TRADE", + "description": "Spot" + } + ] + }, + "stop": { + "type": "string", + "description": "Either loss or entry. Requires stopPrice to be defined", + "enum": [ + "loss", + "entry" + ], + "x-api-enum": [ + { + "value": "loss", + "name": "loss", + "description": "<=" + }, + { + "value": "entry", + "name": "entry", + "description": ">=" + } + ] + }, + "stopPrice": { + "type": "string", + "description": "Stop price, Need to be defined if stop is specified." + } }, - { - "value": "FOK", - "name": "", - "description": "" - } - ] - }, - "postOnly": { - "type": "boolean", - "default": false, - "description": "passive order labels, this is disabled when the order timing strategy is IOC or FOK" - }, - "hidden": { - "type": "boolean", - "description": "Hidden or not (not shown in order book)", - "default": false - }, - "iceberg": { - "type": "boolean", - "description": "Whether or not only visible portions of orders are shown in iceberg orders", - "default": false - }, - "visibleSize": { - "type": "string", - "description": "Maximum visible quantity in iceberg orders" - }, - "cancelAfter": { - "type": "integer", - "format": "int64", - "description": "Cancel after n seconds,the order timing strategy is GTT" - }, - "funds": { - "type": "string", - "description": "When **type** is market, select one out of two: size or funds" + "required": [ + "symbol", + "side", + "clientOid", + "price", + "size" + ] + } }, - "tradeType": { - "type": "string", - "description": "The type of trading : **TRADE**(Spot Trade), **MARGIN_TRADE** (Margin Trade). Default is **TRADE**. **Note: To improve the system performance and to accelerate order placing and processing, KuCoin has added a new interface for order placing of margin. For traders still using the current interface, please move to the new one as soon as possible. The current one will no longer accept margin orders by May 1st, 2021 (UTC). At the time, KuCoin will notify users via the announcement, please pay attention to it.**", - "enum": [ - "TRADE", - "MARGIN_TRADE" - ], - "default": "TRADE", - "x-api-enum": [ - { - "value": "TRADE", - "name": "TRADE", - "description": "Spot" - }, - { - "value": "MARGIN_TRADE", - "name": "MARGIN_TRADE", - "description": "Margin" - } - ] + "symbol": { + "type": "string" } }, "required": [ - "symbol", - "side", - "clientOid" + "symbol" ] }, - "example": "//limit order\n{\n \"type\": \"limit\",\n \"symbol\": \"BTC-USDT\",\n \"side\": \"buy\",\n \"price\": \"50000\",\n \"size\": \"0.00001\",\n \"clientOid\": \"5c52e11203aa677f33e493fb\",\n \"remark\": \"order remarks\"\n}\n\n//market order 1\n// {\n// \"type\": \"market\",\n// \"symbol\": \"BTC-USDT\",\n// \"side\": \"buy\",\n// \"size\": \"0.00001\",\n// \"clientOid\": \"5c52e11203aa677f33e493fc\",\n// \"remark\": \"order remarks\"\n// }\n\n//market order 2\n// {\n// \"type\": \"market\",\n// \"symbol\": \"BTC-USDT\",\n// \"side\": \"buy\",\n// \"funds\": \"1\",\n// \"clientOid\": \"5c52e11203aa677f33e493fc\",\n// \"remark\": \"order remarks\"\n// }\n" + "example": "{\n \"symbol\": \"BTC-USDT\",\n \"orderList\": [\n {\n \"clientOid\": \"3d07008668054da6b3cb12e432c2b13a\",\n \"side\": \"buy\",\n \"type\": \"limit\",\n \"price\": \"50000\",\n \"size\": \"0.0001\"\n },\n {\n \"clientOid\": \"37245dbe6e134b5c97732bfb36cd4a9d\",\n \"side\": \"buy\",\n \"type\": \"limit\",\n \"price\": \"49999\",\n \"size\": \"0.0001\"\n }\n ]\n}" } } }, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"orderId\\\": \\\"674a8635b38d120007709c0f\\\"\\n }\\n}", - "x-request-example": "{\\\"type\\\": \\\"limit\\\", \\\"symbol\\\": \\\"BTC-USDT\\\", \\\"side\\\": \\\"buy\\\", \\\"price\\\": \\\"50000\\\", \\\"size\\\": \\\"0.00001\\\", \\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\", \\\"remark\\\": \\\"order remarks\\\"}" + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"data\\\": [\\n {\\n \\\"symbol\\\": \\\"BTC-USDT\\\",\\n \\\"type\\\": \\\"limit\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"price\\\": \\\"50000\\\",\\n \\\"size\\\": \\\"0.0001\\\",\\n \\\"funds\\\": null,\\n \\\"stp\\\": \\\"\\\",\\n \\\"stop\\\": \\\"\\\",\\n \\\"stopPrice\\\": null,\\n \\\"timeInForce\\\": \\\"GTC\\\",\\n \\\"cancelAfter\\\": 0,\\n \\\"postOnly\\\": false,\\n \\\"hidden\\\": false,\\n \\\"iceberge\\\": false,\\n \\\"iceberg\\\": false,\\n \\\"visibleSize\\\": null,\\n \\\"channel\\\": \\\"API\\\",\\n \\\"id\\\": \\\"674a97dfef434f0007efc431\\\",\\n \\\"status\\\": \\\"success\\\",\\n \\\"failMsg\\\": null,\\n \\\"clientOid\\\": \\\"3d07008668054da6b3cb12e432c2b13a\\\"\\n },\\n {\\n \\\"symbol\\\": \\\"BTC-USDT\\\",\\n \\\"type\\\": \\\"limit\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"price\\\": \\\"49999\\\",\\n \\\"size\\\": \\\"0.0001\\\",\\n \\\"funds\\\": null,\\n \\\"stp\\\": \\\"\\\",\\n \\\"stop\\\": \\\"\\\",\\n \\\"stopPrice\\\": null,\\n \\\"timeInForce\\\": \\\"GTC\\\",\\n \\\"cancelAfter\\\": 0,\\n \\\"postOnly\\\": false,\\n \\\"hidden\\\": false,\\n \\\"iceberge\\\": false,\\n \\\"iceberg\\\": false,\\n \\\"visibleSize\\\": null,\\n \\\"channel\\\": \\\"API\\\",\\n \\\"id\\\": \\\"674a97dffb378b00077b9c20\\\",\\n \\\"status\\\": \\\"fail\\\",\\n \\\"failMsg\\\": \\\"Balance insufficient!\\\",\\n \\\"clientOid\\\": \\\"37245dbe6e134b5c97732bfb36cd4a9d\\\"\\n }\\n ]\\n }\\n}", + "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"orderList\\\": [{\\\"clientOid\\\": \\\"3d07008668054da6b3cb12e432c2b13a\\\", \\\"side\\\": \\\"buy\\\", \\\"type\\\": \\\"limit\\\", \\\"price\\\": \\\"50000\\\", \\\"size\\\": \\\"0.0001\\\"}, {\\\"clientOid\\\": \\\"37245dbe6e134b5c97732bfb36cd4a9d\\\", \\\"side\\\": \\\"buy\\\", \\\"type\\\": \\\"limit\\\", \\\"price\\\": \\\"49999\\\", \\\"size\\\": \\\"0.0001\\\"}]}" } }, - "/api/v1/limit/orders": { - "get": { - "summary": "Get Recent Orders List - Old", + "/api/v1/orders/{orderId}": { + "delete": { + "summary": "Cancel Order By OrderId - Old", "deprecated": true, - "description": "Request via this endpoint to get your current order list. The return value is the data after Pagination, sorted in descending order according to time.", + "description": "This endpoint can be used to cancel a spot order by orderId. This endpoint only sends cancellation requests. The results of the requests must be obtained by checking the order status or subscribing to websocket.", "tags": [], "parameters": [ { - "name": "currentPage", + "name": "symbol", "in": "query", - "description": "Current request page.", - "required": false, + "description": "symbol", + "required": true, "schema": { - "type": "integer", - "default": 1 + "type": "string", + "example": [ + "BTC-USDT", + "ETH-USDT", + "KCS-USDT" + ] } }, { - "name": "pageSize", - "in": "query", - "description": "Number of results per request. Minimum is 10, maximum is 500.", - "required": false, + "name": "orderId", + "in": "path", + "description": "The unique order id generated by the trading system", + "required": true, "schema": { - "type": "integer", - "default": 50, - "minimum": 10, - "maximum": 500 - } - } - ], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "data": { - "type": "array", - "items": { - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "symbol": { - "type": "string" - }, - "opType": { - "type": "string" - }, - "type": { - "type": "string" - }, - "side": { - "type": "string" - }, - "price": { - "type": "string" - }, - "size": { - "type": "string" - }, - "funds": { - "type": "string" - }, - "dealFunds": { - "type": "string" - }, - "dealSize": { - "type": "string" - }, - "fee": { - "type": "string" - }, - "feeCurrency": { - "type": "string" - }, - "stp": { - "type": "string" - }, - "stop": { - "type": "string" - }, - "stopTriggered": { - "type": "boolean" - }, - "stopPrice": { - "type": "string" - }, - "timeInForce": { - "type": "string" - }, - "postOnly": { - "type": "boolean" - }, - "hidden": { - "type": "boolean" - }, - "iceberg": { - "type": "boolean" - }, - "visibleSize": { - "type": "string" - }, - "cancelAfter": { - "type": "integer" - }, - "channel": { - "type": "string" - }, - "clientOid": { - "type": "string" - }, - "remark": { - "type": "string" - }, - "tags": { - "type": "string" - }, - "isActive": { - "type": "boolean" - }, - "cancelExist": { - "type": "boolean" - }, - "createdAt": { - "type": "integer", - "format": "int64" - }, - "tradeType": { - "type": "string" - } - }, - "required": [ - "id", - "symbol", - "opType", - "type", - "side", - "price", - "size", - "funds", - "dealFunds", - "dealSize", - "fee", - "feeCurrency", - "stp", - "stop", - "stopTriggered", - "stopPrice", - "timeInForce", - "postOnly", - "hidden", - "iceberg", - "visibleSize", - "cancelAfter", - "channel", - "clientOid", - "remark", - "tags", - "isActive", - "cancelExist", - "createdAt", - "tradeType" - ] - } + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "object", + "properties": { + "cancelledOrderIds": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "cancelledOrderIds" + ] } }, "required": [ @@ -13426,32 +13680,30 @@ } } }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470347", + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470343", "x-abandon": "abandon", "x-domain": "Spot", "x-api-channel": "Private", - "x-api-permission": "General", + "x-api-permission": "Spot", "x-api-rate-limit-pool": "Spot", "x-sdk-service": "Spot", "x-sdk-sub-service": "Order", - "x-sdk-method-name": "getRecentOrdersListOld", - "x-sdk-method-description": "Request via this endpoint to get your current order list. The return value is the data after Pagination, sorted in descending order according to time.", + "x-sdk-method-name": "cancelOrderByOrderIdOld", + "x-sdk-method-description": "This endpoint can be used to cancel a spot order by orderId. This endpoint only sends cancellation requests. The results of the requests must be obtained by checking the order status or subscribing to websocket.", "x-api-rate-limit": 3, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": [\\n {\\n \\\"id\\\": \\\"674a9a872033a50007e2790d\\\",\\n \\\"symbol\\\": \\\"BTC-USDT\\\",\\n \\\"opType\\\": \\\"DEAL\\\",\\n \\\"type\\\": \\\"limit\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"price\\\": \\\"50000\\\",\\n \\\"size\\\": \\\"0.00001\\\",\\n \\\"funds\\\": \\\"0\\\",\\n \\\"dealFunds\\\": \\\"0\\\",\\n \\\"dealSize\\\": \\\"0\\\",\\n \\\"fee\\\": \\\"0\\\",\\n \\\"feeCurrency\\\": \\\"USDT\\\",\\n \\\"stp\\\": \\\"\\\",\\n \\\"stop\\\": \\\"\\\",\\n \\\"stopTriggered\\\": false,\\n \\\"stopPrice\\\": \\\"0\\\",\\n \\\"timeInForce\\\": \\\"GTC\\\",\\n \\\"postOnly\\\": false,\\n \\\"hidden\\\": false,\\n \\\"iceberg\\\": false,\\n \\\"visibleSize\\\": \\\"0\\\",\\n \\\"cancelAfter\\\": 0,\\n \\\"channel\\\": \\\"API\\\",\\n \\\"clientOid\\\": \\\"5c52e11203aa677f33e4923fb\\\",\\n \\\"remark\\\": \\\"order remarks\\\",\\n \\\"tags\\\": null,\\n \\\"isActive\\\": false,\\n \\\"cancelExist\\\": true,\\n \\\"createdAt\\\": 1732942471752,\\n \\\"tradeType\\\": \\\"TRADE\\\"\\n }\\n ]\\n}", - "x-request-example": "{\\\"currentPage\\\": 1, \\\"pageSize\\\": 50}" - } - }, - "/api/v1/order/client-order/{clientOid}": { + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"cancelledOrderIds\\\": [\\n \\\"674a97dfef434f0007efc431\\\"\\n ]\\n }\\n}", + "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"orderId\\\": \\\"674a97dfef434f0007efc431\\\"}" + }, "get": { - "summary": "Get Order By ClientOid - Old", + "summary": "Get Order By OrderId - Old", "deprecated": true, - "description": "Request via this interface to check the information of a single active order via clientOid. The system will prompt that the order does not exists if the order does not exist or has been settled.", + "description": "Request via this endpoint to get a single order info by order ID.", "tags": [], "parameters": [ { - "name": "clientOid", + "name": "orderId", "in": "path", - "description": "Unique order id created by users to identify their orders", + "description": "The unique order id generated by the trading system", "required": true, "schema": { "type": "string" @@ -13607,7 +13859,7 @@ } } }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470349", + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470348", "x-abandon": "abandon", "x-domain": "Spot", "x-api-channel": "Private", @@ -13615,12 +13867,14 @@ "x-api-rate-limit-pool": "Spot", "x-sdk-service": "Spot", "x-sdk-sub-service": "Order", - "x-sdk-method-name": "getOrderByClientOidOld", - "x-sdk-method-description": "Request via this interface to check the information of a single active order via clientOid. The system will prompt that the order does not exists if the order does not exist or has been settled.", - "x-api-rate-limit": 3, + "x-sdk-method-name": "getOrderByOrderIdOld", + "x-sdk-method-description": "Request via this endpoint to get a single order info by order ID.", + "x-api-rate-limit": 2, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"id\\\": \\\"674a97dfef434f0007efc431\\\",\\n \\\"symbol\\\": \\\"BTC-USDT\\\",\\n \\\"opType\\\": \\\"DEAL\\\",\\n \\\"type\\\": \\\"limit\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"price\\\": \\\"50000\\\",\\n \\\"size\\\": \\\"0.0001\\\",\\n \\\"funds\\\": \\\"0\\\",\\n \\\"dealFunds\\\": \\\"0\\\",\\n \\\"dealSize\\\": \\\"0\\\",\\n \\\"fee\\\": \\\"0\\\",\\n \\\"feeCurrency\\\": \\\"USDT\\\",\\n \\\"stp\\\": \\\"\\\",\\n \\\"stop\\\": \\\"\\\",\\n \\\"stopTriggered\\\": false,\\n \\\"stopPrice\\\": \\\"0\\\",\\n \\\"timeInForce\\\": \\\"GTC\\\",\\n \\\"postOnly\\\": false,\\n \\\"hidden\\\": false,\\n \\\"iceberg\\\": false,\\n \\\"visibleSize\\\": \\\"0\\\",\\n \\\"cancelAfter\\\": 0,\\n \\\"channel\\\": \\\"API\\\",\\n \\\"clientOid\\\": \\\"3d07008668054da6b3cb12e432c2b13a\\\",\\n \\\"remark\\\": null,\\n \\\"tags\\\": null,\\n \\\"isActive\\\": false,\\n \\\"cancelExist\\\": true,\\n \\\"createdAt\\\": 1732941791518,\\n \\\"tradeType\\\": \\\"TRADE\\\"\\n }\\n}", - "x-request-example": "{\\\"clientOid\\\": \\\"3d07008668054da6b3cb12e432c2b13a\\\"}" - }, + "x-request-example": "{\\\"orderId\\\": \\\"674a97dfef434f0007efc431\\\"}" + } + }, + "/api/v1/order/client-order/{clientOid}": { "delete": { "summary": "Cancel Order By ClientOid - Old", "deprecated": false, @@ -13705,175 +13959,21 @@ "x-api-rate-limit": 3, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"cancelledOrderId\\\": \\\"674a9a872033a50007e2790d\\\",\\n \\\"clientOid\\\": \\\"5c52e11203aa677f33e4923fb\\\",\\n \\\"cancelledOcoOrderIds\\\": null\\n }\\n}", "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"clientOid\\\": \\\"5c52e11203aa677f33e4923fb\\\"}" - } - }, - "/api/v1/fills": { + }, "get": { - "summary": "Get Trade History - Old", + "summary": "Get Order By ClientOid - Old", "deprecated": true, - "description": "Request via this endpoint to get the recent fills. The return value is the data after Pagination, sorted in descending order according to time.", + "description": "Request via this interface to check the information of a single active order via clientOid. The system will prompt that the order does not exists if the order does not exist or has been settled.", "tags": [], "parameters": [ { - "name": "symbol", - "in": "query", - "description": "symbol", + "name": "clientOid", + "in": "path", + "description": "Unique order id created by users to identify their orders", "required": true, - "schema": { - "type": "string", - "example": [ - "BTC-USDT", - "ETH-USDT", - "KCS-USDT" - ] - } - }, - { - "name": "orderId", - "in": "query", - "description": "The unique order id generated by the trading system (If orderId is specified,please ignore the other query parameters)", - "required": false, "schema": { "type": "string" } - }, - { - "name": "side", - "in": "query", - "description": "specify if the order is to 'buy' or 'sell'", - "required": false, - "schema": { - "type": "string", - "enum": [ - "buy", - "sell" - ], - "x-api-enum": [ - { - "value": "buy", - "name": "buy", - "description": "buy" - }, - { - "value": "sell", - "name": "sell", - "description": "sell" - } - ] - } - }, - { - "name": "type", - "in": "query", - "description": "limit, market, limit_stop or market_stop\n", - "required": false, - "schema": { - "type": "string", - "enum": [ - "limit", - "market", - "limit_stop", - "market_stop" - ], - "x-api-enum": [ - { - "value": "limit", - "name": "limit", - "description": "limit" - }, - { - "value": "market", - "name": "market", - "description": "market" - }, - { - "value": "limit_stop", - "name": "limit_stop", - "description": "limit_stop" - }, - { - "value": "market_stop", - "name": "market_stop", - "description": "market_stop" - } - ] - } - }, - { - "name": "tradeType", - "in": "query", - "description": "The type of trading:TRADE - Spot Trading(TRADE as default), MARGIN_TRADE - Cross Margin Trading, MARGIN_ISOLATED_TRADE - Isolated Margin Trading.", - "required": false, - "schema": { - "type": "string", - "enum": [ - "TRADE", - "MARGIN_TRADE", - "MARGIN_ISOLATED_TRADE" - ], - "default": "TRADE", - "x-api-enum": [ - { - "value": "TRADE", - "name": "TRADE", - "description": "Spot Trading" - }, - { - "value": "MARGIN_TRADE", - "name": "MARGIN_TRADE", - "description": "Cross Margin Trading" - }, - { - "value": "MARGIN_ISOLATED_TRADE", - "name": "MARGIN_ISOLATED_TRADE", - "description": "Isolated Margin Trading" - } - ] - } - }, - { - "name": "startAt", - "in": "query", - "description": "Start time (milisecond)", - "required": false, - "schema": { - "type": "integer", - "format": "int64" - } - }, - { - "name": "endAt", - "in": "query", - "description": "End time (milisecond)", - "required": false, - "schema": { - "type": "integer", - "format": "int64" - } - }, - { - "name": "currentPage", - "in": "query", - "description": "Current request page.", - "required": false, - "schema": { - "type": "integer", - "default": 1 - } - }, - { - "name": "pageSize", - "in": "query", - "description": "Number of results per request. Minimum is 10, maximum is 500.", - "required": false, - "schema": { - "type": "integer", - "minimum": 10, - "maximum": 500, - "example": [ - 50 - ] - } } ], "responses": { @@ -13890,104 +13990,129 @@ "data": { "type": "object", "properties": { - "currentPage": { - "type": "integer" + "id": { + "type": "string" + }, + "symbol": { + "type": "string" + }, + "opType": { + "type": "string" + }, + "type": { + "type": "string" + }, + "side": { + "type": "string" + }, + "price": { + "type": "string" + }, + "size": { + "type": "string" + }, + "funds": { + "type": "string" }, - "pageSize": { - "type": "integer" + "dealFunds": { + "type": "string" }, - "totalNum": { - "type": "integer" + "dealSize": { + "type": "string" }, - "totalPage": { + "fee": { + "type": "string" + }, + "feeCurrency": { + "type": "string" + }, + "stp": { + "type": "string" + }, + "stop": { + "type": "string" + }, + "stopTriggered": { + "type": "boolean" + }, + "stopPrice": { + "type": "string" + }, + "timeInForce": { + "type": "string" + }, + "postOnly": { + "type": "boolean" + }, + "hidden": { + "type": "boolean" + }, + "iceberg": { + "type": "boolean" + }, + "visibleSize": { + "type": "string" + }, + "cancelAfter": { "type": "integer" }, - "items": { - "type": "array", - "items": { - "type": "object", - "properties": { - "symbol": { - "type": "string", - "description": "symbol", - "example": [ - "BTC-USDT", - "ETH-USDT", - "KCS-USDT" - ] - }, - "tradeId": { - "type": "string" - }, - "orderId": { - "type": "string", - "description": "The unique order id generated by the trading system" - }, - "counterOrderId": { - "type": "string", - "description": "Counterparty order Id" - }, - "side": { - "type": "string", - "description": "Buy or sell" - }, - "liquidity": { - "type": "string", - "description": "Liquidity type: taker or maker" - }, - "forceTaker": { - "type": "boolean" - }, - "price": { - "type": "string", - "description": "Order price" - }, - "size": { - "type": "string", - "description": "Order size" - }, - "funds": { - "type": "string", - "description": "Order Funds" - }, - "fee": { - "type": "string", - "description": "[Handling fees](https://www.kucoin.com/docs-new/api-5327739)" - }, - "feeRate": { - "type": "string", - "description": "Fee rate\n" - }, - "feeCurrency": { - "type": "string", - "description": "currency used to calculate trading fee" - }, - "stop": { - "type": "string", - "description": "Take Profit and Stop Loss type, currently HFT does not support the Take Profit and Stop Loss type, so it is empty" - }, - "tradeType": { - "type": "string", - "description": "Trade type, redundancy param" - }, - "type": { - "type": "string", - "description": "Specify if the order is an 'limit' order or 'market' order. " - }, - "createdAt": { - "type": "integer", - "format": "int64" - } - } - } + "channel": { + "type": "string" + }, + "clientOid": { + "type": "string" + }, + "remark": { + "type": "string" + }, + "tags": { + "type": "string" + }, + "isActive": { + "type": "boolean" + }, + "cancelExist": { + "type": "boolean" + }, + "createdAt": { + "type": "integer", + "format": "int64" + }, + "tradeType": { + "type": "string" } }, "required": [ - "currentPage", - "pageSize", - "totalNum", - "totalPage", - "items" + "id", + "symbol", + "opType", + "type", + "side", + "price", + "size", + "funds", + "dealFunds", + "dealSize", + "fee", + "feeCurrency", + "stp", + "stop", + "stopTriggered", + "stopPrice", + "timeInForce", + "postOnly", + "hidden", + "iceberg", + "visibleSize", + "cancelAfter", + "channel", + "clientOid", + "remark", + "tags", + "isActive", + "cancelExist", + "createdAt", + "tradeType" ] } }, @@ -14000,7 +14125,7 @@ } } }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470350", + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470349", "x-abandon": "abandon", "x-domain": "Spot", "x-api-channel": "Private", @@ -14008,18 +14133,18 @@ "x-api-rate-limit-pool": "Spot", "x-sdk-service": "Spot", "x-sdk-sub-service": "Order", - "x-sdk-method-name": "getTradeHistoryOld", - "x-sdk-method-description": "Request via this endpoint to get the recent fills. The return value is the data after Pagination, sorted in descending order according to time.", - "x-api-rate-limit": 10, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"currentPage\\\": 1,\\n \\\"pageSize\\\": 50,\\n \\\"totalNum\\\": 1,\\n \\\"totalPage\\\": 1,\\n \\\"items\\\": [\\n {\\n \\\"symbol\\\": \\\"DOGE-USDT\\\",\\n \\\"tradeId\\\": \\\"10862827223795713\\\",\\n \\\"orderId\\\": \\\"6745698ef4f1200007c561a8\\\",\\n \\\"counterOrderId\\\": \\\"6745695ef15b270007ac5076\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"liquidity\\\": \\\"taker\\\",\\n \\\"forceTaker\\\": false,\\n \\\"price\\\": \\\"0.40739\\\",\\n \\\"size\\\": \\\"10\\\",\\n \\\"funds\\\": \\\"4.0739\\\",\\n \\\"fee\\\": \\\"0.0040739\\\",\\n \\\"feeRate\\\": \\\"0.001\\\",\\n \\\"feeCurrency\\\": \\\"USDT\\\",\\n \\\"stop\\\": \\\"\\\",\\n \\\"tradeType\\\": \\\"TRADE\\\",\\n \\\"type\\\": \\\"market\\\",\\n \\\"createdAt\\\": 1732602254928\\n }\\n ]\\n }\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"orderId\\\": \\\"example_string_default_value\\\", \\\"side\\\": \\\"buy\\\", \\\"type\\\": \\\"limit\\\", \\\"tradeType\\\": \\\"TRADE\\\", \\\"startAt\\\": 1728663338000, \\\"endAt\\\": 1728692138000, \\\"currentPage\\\": 1, \\\"pageSize\\\": 50}" + "x-sdk-method-name": "getOrderByClientOidOld", + "x-sdk-method-description": "Request via this interface to check the information of a single active order via clientOid. The system will prompt that the order does not exists if the order does not exist or has been settled.", + "x-api-rate-limit": 3, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"id\\\": \\\"674a97dfef434f0007efc431\\\",\\n \\\"symbol\\\": \\\"BTC-USDT\\\",\\n \\\"opType\\\": \\\"DEAL\\\",\\n \\\"type\\\": \\\"limit\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"price\\\": \\\"50000\\\",\\n \\\"size\\\": \\\"0.0001\\\",\\n \\\"funds\\\": \\\"0\\\",\\n \\\"dealFunds\\\": \\\"0\\\",\\n \\\"dealSize\\\": \\\"0\\\",\\n \\\"fee\\\": \\\"0\\\",\\n \\\"feeCurrency\\\": \\\"USDT\\\",\\n \\\"stp\\\": \\\"\\\",\\n \\\"stop\\\": \\\"\\\",\\n \\\"stopTriggered\\\": false,\\n \\\"stopPrice\\\": \\\"0\\\",\\n \\\"timeInForce\\\": \\\"GTC\\\",\\n \\\"postOnly\\\": false,\\n \\\"hidden\\\": false,\\n \\\"iceberg\\\": false,\\n \\\"visibleSize\\\": \\\"0\\\",\\n \\\"cancelAfter\\\": 0,\\n \\\"channel\\\": \\\"API\\\",\\n \\\"clientOid\\\": \\\"3d07008668054da6b3cb12e432c2b13a\\\",\\n \\\"remark\\\": null,\\n \\\"tags\\\": null,\\n \\\"isActive\\\": false,\\n \\\"cancelExist\\\": true,\\n \\\"createdAt\\\": 1732941791518,\\n \\\"tradeType\\\": \\\"TRADE\\\"\\n }\\n}", + "x-request-example": "{\\\"clientOid\\\": \\\"3d07008668054da6b3cb12e432c2b13a\\\"}" } }, - "/api/v1/limit/fills": { + "/api/v1/limit/orders": { "get": { - "summary": "Get Recent Trade History - Old", + "summary": "Get Recent Orders List - Old", "deprecated": true, - "description": "Request via this endpoint to get a list of 1000 fills in the last 24 hours. The return value is the data after Pagination, sorted in descending order according to time.", + "description": "Request via this endpoint to get your current order list. The return value is the data after Pagination, sorted in descending order according to time.", "tags": [], "parameters": [ { @@ -14039,11 +14164,9 @@ "required": false, "schema": { "type": "integer", + "default": 50, "minimum": 10, - "maximum": 500, - "example": [ - 50 - ] + "maximum": 500 } } ], @@ -14063,59 +14186,130 @@ "items": { "type": "object", "properties": { - "symbol": { + "id": { "type": "string" }, - "tradeId": { + "symbol": { "type": "string" }, - "orderId": { + "opType": { "type": "string" }, - "counterOrderId": { + "type": { "type": "string" }, "side": { "type": "string" }, - "liquidity": { + "price": { "type": "string" }, - "forceTaker": { + "size": { + "type": "string" + }, + "funds": { + "type": "string" + }, + "dealFunds": { + "type": "string" + }, + "dealSize": { + "type": "string" + }, + "fee": { + "type": "string" + }, + "feeCurrency": { + "type": "string" + }, + "stp": { + "type": "string" + }, + "stop": { + "type": "string" + }, + "stopTriggered": { "type": "boolean" }, - "price": { + "stopPrice": { "type": "string" }, - "size": { + "timeInForce": { "type": "string" }, - "funds": { + "postOnly": { + "type": "boolean" + }, + "hidden": { + "type": "boolean" + }, + "iceberg": { + "type": "boolean" + }, + "visibleSize": { "type": "string" }, - "fee": { - "type": "string" + "cancelAfter": { + "type": "integer" }, - "feeRate": { + "channel": { "type": "string" }, - "feeCurrency": { + "clientOid": { "type": "string" }, - "stop": { + "remark": { "type": "string" }, - "tradeType": { + "tags": { "type": "string" }, - "type": { - "type": "string" + "isActive": { + "type": "boolean" + }, + "cancelExist": { + "type": "boolean" }, "createdAt": { "type": "integer", "format": "int64" + }, + "tradeType": { + "type": "string" } - } + }, + "required": [ + "id", + "symbol", + "opType", + "type", + "side", + "price", + "size", + "funds", + "dealFunds", + "dealSize", + "fee", + "feeCurrency", + "stp", + "stop", + "stopTriggered", + "stopPrice", + "timeInForce", + "postOnly", + "hidden", + "iceberg", + "visibleSize", + "cancelAfter", + "channel", + "clientOid", + "remark", + "tags", + "isActive", + "cancelExist", + "createdAt", + "tradeType" + ] } } }, @@ -14128,7 +14322,7 @@ } } }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470351", + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470347", "x-abandon": "abandon", "x-domain": "Spot", "x-api-channel": "Private", @@ -14136,392 +14330,353 @@ "x-api-rate-limit-pool": "Spot", "x-sdk-service": "Spot", "x-sdk-sub-service": "Order", - "x-sdk-method-name": "getRecentTradeHistoryOld", - "x-sdk-method-description": "Request via this endpoint to get a list of 1000 fills in the last 24 hours. The return value is the data after Pagination, sorted in descending order according to time.", - "x-api-rate-limit": 20, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": [\\n {\\n \\\"symbol\\\": \\\"BTC-USDT\\\",\\n \\\"tradeId\\\": \\\"11732720444522497\\\",\\n \\\"orderId\\\": \\\"674aab24754b1e00077dbc69\\\",\\n \\\"counterOrderId\\\": \\\"674aab1fb26bfb0007a18b67\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"liquidity\\\": \\\"taker\\\",\\n \\\"forceTaker\\\": false,\\n \\\"price\\\": \\\"96999.6\\\",\\n \\\"size\\\": \\\"0.00001\\\",\\n \\\"funds\\\": \\\"0.969996\\\",\\n \\\"fee\\\": \\\"0.000969996\\\",\\n \\\"feeRate\\\": \\\"0.001\\\",\\n \\\"feeCurrency\\\": \\\"USDT\\\",\\n \\\"stop\\\": \\\"\\\",\\n \\\"tradeType\\\": \\\"TRADE\\\",\\n \\\"type\\\": \\\"limit\\\",\\n \\\"createdAt\\\": 1732946724082\\n }\\n ]\\n}", + "x-sdk-method-name": "getRecentOrdersListOld", + "x-sdk-method-description": "Request via this endpoint to get your current order list. The return value is the data after Pagination, sorted in descending order according to time.", + "x-api-rate-limit": 3, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": [\\n {\\n \\\"id\\\": \\\"674a9a872033a50007e2790d\\\",\\n \\\"symbol\\\": \\\"BTC-USDT\\\",\\n \\\"opType\\\": \\\"DEAL\\\",\\n \\\"type\\\": \\\"limit\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"price\\\": \\\"50000\\\",\\n \\\"size\\\": \\\"0.00001\\\",\\n \\\"funds\\\": \\\"0\\\",\\n \\\"dealFunds\\\": \\\"0\\\",\\n \\\"dealSize\\\": \\\"0\\\",\\n \\\"fee\\\": \\\"0\\\",\\n \\\"feeCurrency\\\": \\\"USDT\\\",\\n \\\"stp\\\": \\\"\\\",\\n \\\"stop\\\": \\\"\\\",\\n \\\"stopTriggered\\\": false,\\n \\\"stopPrice\\\": \\\"0\\\",\\n \\\"timeInForce\\\": \\\"GTC\\\",\\n \\\"postOnly\\\": false,\\n \\\"hidden\\\": false,\\n \\\"iceberg\\\": false,\\n \\\"visibleSize\\\": \\\"0\\\",\\n \\\"cancelAfter\\\": 0,\\n \\\"channel\\\": \\\"API\\\",\\n \\\"clientOid\\\": \\\"5c52e11203aa677f33e4923fb\\\",\\n \\\"remark\\\": \\\"order remarks\\\",\\n \\\"tags\\\": null,\\n \\\"isActive\\\": false,\\n \\\"cancelExist\\\": true,\\n \\\"createdAt\\\": 1732942471752,\\n \\\"tradeType\\\": \\\"TRADE\\\"\\n }\\n ]\\n}", "x-request-example": "{\\\"currentPage\\\": 1, \\\"pageSize\\\": 50}" } }, - "/api/v1/orders/multi": { - "post": { - "summary": "Batch Add Orders - Old", + "/api/v1/fills": { + "get": { + "summary": "Get Trade History - Old", "deprecated": true, - "description": "Request via this endpoint to place 5 orders at the same time. The order type must be a limit order of the same symbol.", + "description": "Request via this endpoint to get the recent fills. The return value is the data after Pagination, sorted in descending order according to time.", "tags": [], - "parameters": [], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "data": { - "type": "object", - "properties": { - "data": { - "type": "array", - "items": { - "type": "object", - "properties": { - "symbol": { - "type": "string" - }, - "type": { - "type": "string" - }, - "side": { - "type": "string" - }, - "price": { - "type": "string" - }, - "size": { - "type": "string" - }, - "funds": { - "type": "string" - }, - "stp": { - "type": "string" - }, - "stop": { - "type": "string" - }, - "stopPrice": { - "type": "string" - }, - "timeInForce": { - "type": "string" - }, - "cancelAfter": { - "type": "integer" - }, - "postOnly": { - "type": "boolean" - }, - "hidden": { - "type": "boolean" - }, - "iceberge": { - "type": "boolean" - }, - "iceberg": { - "type": "boolean" - }, - "visibleSize": { - "type": "string" - }, - "channel": { - "type": "string" - }, - "id": { - "type": "string" - }, - "status": { - "type": "string" - }, - "failMsg": { - "type": "string" - }, - "clientOid": { - "type": "string" - } - }, - "required": [ - "symbol", - "type", - "side", - "price", - "size", - "funds", - "stp", - "stop", - "stopPrice", - "timeInForce", - "cancelAfter", - "postOnly", - "hidden", - "iceberge", - "iceberg", - "visibleSize", - "channel", - "id", - "status", - "failMsg", - "clientOid" - ] - } - } - }, - "required": [ - "data" - ] - } - }, - "required": [ - "code", - "data" - ] + "parameters": [ + { + "name": "symbol", + "in": "query", + "description": "symbol", + "required": true, + "schema": { + "type": "string", + "example": [ + "BTC-USDT", + "ETH-USDT", + "KCS-USDT" + ] + } + }, + { + "name": "orderId", + "in": "query", + "description": "The unique order id generated by the trading system (If orderId is specified,please ignore the other query parameters)", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "side", + "in": "query", + "description": "specify if the order is to 'buy' or 'sell'", + "required": false, + "schema": { + "type": "string", + "enum": [ + "buy", + "sell" + ], + "x-api-enum": [ + { + "value": "buy", + "name": "buy", + "description": "buy" + }, + { + "value": "sell", + "name": "sell", + "description": "sell" + } + ] + } + }, + { + "name": "type", + "in": "query", + "description": "limit, market, limit_stop or market_stop\n", + "required": false, + "schema": { + "type": "string", + "enum": [ + "limit", + "market", + "limit_stop", + "market_stop" + ], + "x-api-enum": [ + { + "value": "limit", + "name": "limit", + "description": "limit" + }, + { + "value": "market", + "name": "market", + "description": "market" + }, + { + "value": "limit_stop", + "name": "limit_stop", + "description": "limit_stop" + }, + { + "value": "market_stop", + "name": "market_stop", + "description": "market_stop" } - } + ] } - } - }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470342", - "x-abandon": "abandon", - "x-domain": "Spot", - "x-api-channel": "Private", - "x-api-permission": "Spot", - "x-api-rate-limit-pool": "Spot", - "x-sdk-service": "Spot", - "x-sdk-sub-service": "Order", - "x-sdk-method-name": "batchAddOrdersOld", - "x-sdk-method-description": "Request via this endpoint to place 5 orders at the same time. The order type must be a limit order of the same symbol.", - "x-api-rate-limit": 3, - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "orderList": { - "type": "array", - "items": { - "type": "object", - "properties": { - "clientOid": { - "type": "string", - "description": "Client Order Id,The ClientOid field is a unique ID created by the user(we recommend using a UUID), and can only contain numbers, letters, underscores (_), and hyphens (-). This field is returned when order information is obtained. You can use clientOid to tag your orders. ClientOid is different from the order ID created by the service provider. Please do not initiate requests using the same clientOid. The maximum length for the ClientOid is 40 characters.\n\nPlease remember the orderId created by the service provider, it used to check for updates in order status.", - "example": [ - "5c52e11203aa677f33e493fb" - ] - }, - "side": { - "type": "string", - "description": "specify if the order is to 'buy' or 'sell'", - "enum": [ - "buy", - "sell" - ], - "x-api-enum": [ - { - "value": "buy", - "name": "", - "description": "" - }, - { - "value": "sell", - "name": "", - "description": "" - } - ], - "example": [ - "buy" - ] - }, - "symbol": { - "type": "string", - "description": "symbol", - "example": [ - "BTC-USDT", - "ETH-USDT", - "KCS-USDT" - ] - }, - "type": { - "type": "string", - "description": "only limit (default is limit)", - "enum": [ - "limit" - ], - "default": "limit", - "x-api-enum": [ - { - "value": "limit", - "name": "limit", - "description": "limit order" - } - ] - }, - "remark": { - "type": "string", - "description": "Order placement remarks, length cannot exceed 20 characters (ASCII)" - }, - "stp": { - "type": "string", - "description": "[Self Trade Prevention](https://www.kucoin.com/docs-new/doc-338146) is divided into four strategies: CN, CO, CB , and DC", - "enum": [ - "DC", - "CO", - "CN", - "CB" - ], - "x-api-enum": [ - { - "value": "DC", - "name": "", - "description": "" - }, - { - "value": "CO", - "name": "", - "description": "" - }, - { - "value": "CN", - "name": "", - "description": "" - }, - { - "value": "CB", - "name": "", - "description": "" - } - ] - }, - "price": { - "type": "string", - "description": "Specify price for order\n\nWhen placing a limit order, the price must be based on priceIncrement for the trading pair. The price increment (priceIncrement) is the price precision for the trading pair. For example, for the BTC-USDT trading pair, the priceIncrement is 0.00001000. So the price for your orders cannot be less than 0.00001000 and must be a multiple of priceIncrement. Otherwise, the order will return an invalid priceIncrement error." - }, - "size": { - "type": "string", - "description": "Specify quantity for order\n\nWhen **type** is limit, size refers to the amount of trading targets (the asset name written in front) for the trading pair. Teh Size must be based on the baseIncrement of the trading pair. The baseIncrement represents the precision for the trading pair. The size of an order must be a positive-integer multiple of baseIncrement and must be between baseMinSize and baseMaxSize.\n\nWhen **type** is market, select one out of two: size or funds" - }, - "timeInForce": { - "type": "string", - "description": "[Time in force](https://www.kucoin.com/docs-new/doc-338146) is a special strategy used during trading", - "enum": [ - "GTC", - "GTT", - "IOC", - "FOK" - ], - "default": "GTC", - "x-api-enum": [ - { - "value": "GTC", - "name": "", - "description": "" - }, - { - "value": "GTT", - "name": "", - "description": "" - }, - { - "value": "IOC", - "name": "", - "description": "" - }, - { - "value": "FOK", - "name": "", - "description": "" - } - ] - }, - "postOnly": { - "type": "boolean", - "default": false, - "description": "passive order labels, this is disabled when the order timing strategy is IOC or FOK" - }, - "hidden": { - "type": "boolean", - "description": "Hidden or not (not shown in order book)", - "default": false - }, - "iceberg": { - "type": "boolean", - "description": "Whether or not only visible portions of orders are shown in iceberg orders", - "default": false + }, + { + "name": "tradeType", + "in": "query", + "description": "The type of trading:TRADE - Spot Trading(TRADE as default), MARGIN_TRADE - Cross Margin Trading, MARGIN_ISOLATED_TRADE - Isolated Margin Trading.", + "required": false, + "schema": { + "type": "string", + "enum": [ + "TRADE", + "MARGIN_TRADE", + "MARGIN_ISOLATED_TRADE" + ], + "default": "TRADE", + "x-api-enum": [ + { + "value": "TRADE", + "name": "TRADE", + "description": "Spot Trading" + }, + { + "value": "MARGIN_TRADE", + "name": "MARGIN_TRADE", + "description": "Cross Margin Trading" + }, + { + "value": "MARGIN_ISOLATED_TRADE", + "name": "MARGIN_ISOLATED_TRADE", + "description": "Isolated Margin Trading" + } + ] + } + }, + { + "name": "startAt", + "in": "query", + "description": "Start time (milisecond)", + "required": false, + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "endAt", + "in": "query", + "description": "End time (milisecond)", + "required": false, + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "currentPage", + "in": "query", + "description": "Current request page.", + "required": false, + "schema": { + "type": "integer", + "default": 1 + } + }, + { + "name": "pageSize", + "in": "query", + "description": "Number of results per request. Minimum is 10, maximum is 500.", + "required": false, + "schema": { + "type": "integer", + "minimum": 10, + "maximum": 500, + "example": [ + 50 + ] + } + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "object", + "properties": { + "currentPage": { + "type": "integer" }, - "visibleSize": { - "type": "string", - "description": "Maximum visible quantity in iceberg orders" + "pageSize": { + "type": "integer" }, - "cancelAfter": { - "type": "integer", - "format": "int64", - "description": "Cancel after n seconds,the order timing strategy is GTT" + "totalNum": { + "type": "integer" }, - "tradeType": { - "type": "string", - "description": "The type of trading : **TRADE**(Spot Trade)", - "enum": [ - "TRADE" - ], - "default": "TRADE", - "x-api-enum": [ - { - "value": "TRADE", - "name": "TRADE", - "description": "Spot" - } - ] + "totalPage": { + "type": "integer" }, - "stop": { - "type": "string", - "description": "Either loss or entry. Requires stopPrice to be defined", - "enum": [ - "loss", - "entry" - ], - "x-api-enum": [ - { - "value": "loss", - "name": "loss", - "description": "<=" - }, - { - "value": "entry", - "name": "entry", - "description": ">=" + "items": { + "type": "array", + "items": { + "type": "object", + "properties": { + "symbol": { + "type": "string", + "description": "symbol", + "example": [ + "BTC-USDT", + "ETH-USDT", + "KCS-USDT" + ] + }, + "tradeId": { + "type": "string" + }, + "orderId": { + "type": "string", + "description": "The unique order id generated by the trading system" + }, + "counterOrderId": { + "type": "string", + "description": "Counterparty order Id" + }, + "side": { + "type": "string", + "description": "Buy or sell" + }, + "liquidity": { + "type": "string", + "description": "Liquidity type: taker or maker" + }, + "forceTaker": { + "type": "boolean" + }, + "price": { + "type": "string", + "description": "Order price" + }, + "size": { + "type": "string", + "description": "Order size" + }, + "funds": { + "type": "string", + "description": "Order Funds" + }, + "fee": { + "type": "string", + "description": "[Handling fees](https://www.kucoin.com/docs-new/api-5327739)" + }, + "feeRate": { + "type": "string", + "description": "Fee rate\n" + }, + "feeCurrency": { + "type": "string", + "description": "currency used to calculate trading fee" + }, + "stop": { + "type": "string", + "description": "Take Profit and Stop Loss type, currently HFT does not support the Take Profit and Stop Loss type, so it is empty" + }, + "tradeType": { + "type": "string", + "description": "Trade type, redundancy param" + }, + "type": { + "type": "string", + "description": "Specify if the order is an 'limit' order or 'market' order. " + }, + "createdAt": { + "type": "integer", + "format": "int64" + } } - ] - }, - "stopPrice": { - "type": "string", - "description": "Stop price, Need to be defined if stop is specified." + } } }, "required": [ - "symbol", - "side", - "clientOid", - "price", - "size" + "currentPage", + "pageSize", + "totalNum", + "totalPage", + "items" ] } }, - "symbol": { - "type": "string" - } - }, - "required": [ - "symbol" - ] - }, - "example": "{\n \"symbol\": \"BTC-USDT\",\n \"orderList\": [\n {\n \"clientOid\": \"3d07008668054da6b3cb12e432c2b13a\",\n \"side\": \"buy\",\n \"type\": \"limit\",\n \"price\": \"50000\",\n \"size\": \"0.0001\"\n },\n {\n \"clientOid\": \"37245dbe6e134b5c97732bfb36cd4a9d\",\n \"side\": \"buy\",\n \"type\": \"limit\",\n \"price\": \"49999\",\n \"size\": \"0.0001\"\n }\n ]\n}" + "required": [ + "code", + "data" + ] + } + } } } }, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"data\\\": [\\n {\\n \\\"symbol\\\": \\\"BTC-USDT\\\",\\n \\\"type\\\": \\\"limit\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"price\\\": \\\"50000\\\",\\n \\\"size\\\": \\\"0.0001\\\",\\n \\\"funds\\\": null,\\n \\\"stp\\\": \\\"\\\",\\n \\\"stop\\\": \\\"\\\",\\n \\\"stopPrice\\\": null,\\n \\\"timeInForce\\\": \\\"GTC\\\",\\n \\\"cancelAfter\\\": 0,\\n \\\"postOnly\\\": false,\\n \\\"hidden\\\": false,\\n \\\"iceberge\\\": false,\\n \\\"iceberg\\\": false,\\n \\\"visibleSize\\\": null,\\n \\\"channel\\\": \\\"API\\\",\\n \\\"id\\\": \\\"674a97dfef434f0007efc431\\\",\\n \\\"status\\\": \\\"success\\\",\\n \\\"failMsg\\\": null,\\n \\\"clientOid\\\": \\\"3d07008668054da6b3cb12e432c2b13a\\\"\\n },\\n {\\n \\\"symbol\\\": \\\"BTC-USDT\\\",\\n \\\"type\\\": \\\"limit\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"price\\\": \\\"49999\\\",\\n \\\"size\\\": \\\"0.0001\\\",\\n \\\"funds\\\": null,\\n \\\"stp\\\": \\\"\\\",\\n \\\"stop\\\": \\\"\\\",\\n \\\"stopPrice\\\": null,\\n \\\"timeInForce\\\": \\\"GTC\\\",\\n \\\"cancelAfter\\\": 0,\\n \\\"postOnly\\\": false,\\n \\\"hidden\\\": false,\\n \\\"iceberge\\\": false,\\n \\\"iceberg\\\": false,\\n \\\"visibleSize\\\": null,\\n \\\"channel\\\": \\\"API\\\",\\n \\\"id\\\": \\\"674a97dffb378b00077b9c20\\\",\\n \\\"status\\\": \\\"fail\\\",\\n \\\"failMsg\\\": \\\"Balance insufficient!\\\",\\n \\\"clientOid\\\": \\\"37245dbe6e134b5c97732bfb36cd4a9d\\\"\\n }\\n ]\\n }\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"orderList\\\": [{\\\"clientOid\\\": \\\"3d07008668054da6b3cb12e432c2b13a\\\", \\\"side\\\": \\\"buy\\\", \\\"type\\\": \\\"limit\\\", \\\"price\\\": \\\"50000\\\", \\\"size\\\": \\\"0.0001\\\"}, {\\\"clientOid\\\": \\\"37245dbe6e134b5c97732bfb36cd4a9d\\\", \\\"side\\\": \\\"buy\\\", \\\"type\\\": \\\"limit\\\", \\\"price\\\": \\\"49999\\\", \\\"size\\\": \\\"0.0001\\\"}]}" + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470350", + "x-abandon": "abandon", + "x-domain": "Spot", + "x-api-channel": "Private", + "x-api-permission": "General", + "x-api-rate-limit-pool": "Spot", + "x-sdk-service": "Spot", + "x-sdk-sub-service": "Order", + "x-sdk-method-name": "getTradeHistoryOld", + "x-sdk-method-description": "Request via this endpoint to get the recent fills. The return value is the data after Pagination, sorted in descending order according to time.", + "x-api-rate-limit": 10, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"currentPage\\\": 1,\\n \\\"pageSize\\\": 50,\\n \\\"totalNum\\\": 1,\\n \\\"totalPage\\\": 1,\\n \\\"items\\\": [\\n {\\n \\\"symbol\\\": \\\"DOGE-USDT\\\",\\n \\\"tradeId\\\": \\\"10862827223795713\\\",\\n \\\"orderId\\\": \\\"6745698ef4f1200007c561a8\\\",\\n \\\"counterOrderId\\\": \\\"6745695ef15b270007ac5076\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"liquidity\\\": \\\"taker\\\",\\n \\\"forceTaker\\\": false,\\n \\\"price\\\": \\\"0.40739\\\",\\n \\\"size\\\": \\\"10\\\",\\n \\\"funds\\\": \\\"4.0739\\\",\\n \\\"fee\\\": \\\"0.0040739\\\",\\n \\\"feeRate\\\": \\\"0.001\\\",\\n \\\"feeCurrency\\\": \\\"USDT\\\",\\n \\\"stop\\\": \\\"\\\",\\n \\\"tradeType\\\": \\\"TRADE\\\",\\n \\\"type\\\": \\\"market\\\",\\n \\\"createdAt\\\": 1732602254928\\n }\\n ]\\n }\\n}", + "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"orderId\\\": \\\"example_string_default_value\\\", \\\"side\\\": \\\"buy\\\", \\\"type\\\": \\\"limit\\\", \\\"tradeType\\\": \\\"TRADE\\\", \\\"startAt\\\": 1728663338000, \\\"endAt\\\": 1728692138000, \\\"currentPage\\\": 1, \\\"pageSize\\\": 50}" } }, - "/api/v1/orders/test": { - "post": { - "summary": "Add Order Test - Old", + "/api/v1/limit/fills": { + "get": { + "summary": "Get Recent Trade History - Old", "deprecated": true, - "description": "Order test endpoint, the request parameters and return parameters of this endpoint are exactly the same as the order endpoint, and can be used to verify whether the signature is correct and other operations. After placing an order, the order will not enter the matching system, and the order cannot be queried.", + "description": "Request via this endpoint to get a list of 1000 fills in the last 24 hours. The return value is the data after Pagination, sorted in descending order according to time.", "tags": [], - "parameters": [], + "parameters": [ + { + "name": "currentPage", + "in": "query", + "description": "Current request page.", + "required": false, + "schema": { + "type": "integer", + "default": 1 + } + }, + { + "name": "pageSize", + "in": "query", + "description": "Number of results per request. Minimum is 10, maximum is 500.", + "required": false, + "schema": { + "type": "integer", + "minimum": 10, + "maximum": 500, + "example": [ + 50 + ] + } + } + ], "responses": { "200": { "description": "", @@ -14534,16 +14689,64 @@ "type": "string" }, "data": { - "type": "object", - "properties": { - "orderId": { - "type": "string", - "description": "The unique order id generated by the trading system,which can be used later for further actions such as canceling the order." + "type": "array", + "items": { + "type": "object", + "properties": { + "symbol": { + "type": "string" + }, + "tradeId": { + "type": "string" + }, + "orderId": { + "type": "string" + }, + "counterOrderId": { + "type": "string" + }, + "side": { + "type": "string" + }, + "liquidity": { + "type": "string" + }, + "forceTaker": { + "type": "boolean" + }, + "price": { + "type": "string" + }, + "size": { + "type": "string" + }, + "funds": { + "type": "string" + }, + "fee": { + "type": "string" + }, + "feeRate": { + "type": "string" + }, + "feeCurrency": { + "type": "string" + }, + "stop": { + "type": "string" + }, + "tradeType": { + "type": "string" + }, + "type": { + "type": "string" + }, + "createdAt": { + "type": "integer", + "format": "int64" + } } - }, - "required": [ - "orderId" - ] + } } }, "required": [ @@ -14555,222 +14758,19 @@ } } }, - "x-api-doc": "https://www.kucoin.com/docs-new/api-3470341", + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470351", "x-abandon": "abandon", "x-domain": "Spot", "x-api-channel": "Private", - "x-api-permission": "Spot", + "x-api-permission": "General", "x-api-rate-limit-pool": "Spot", "x-sdk-service": "Spot", "x-sdk-sub-service": "Order", - "x-sdk-method-name": "addOrderTestOld", - "x-sdk-method-description": "Order test endpoint, the request parameters and return parameters of this endpoint are exactly the same as the order endpoint, and can be used to verify whether the signature is correct and other operations. After placing an order, the order will not enter the matching system, and the order cannot be queried.", - "x-api-rate-limit": 2, - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "clientOid": { - "type": "string", - "description": "Client Order Id,The ClientOid field is a unique ID created by the user(we recommend using a UUID), and can only contain numbers, letters, underscores (_), and hyphens (-). This field is returned when order information is obtained. You can use clientOid to tag your orders. ClientOid is different from the order ID created by the service provider. Please do not initiate requests using the same clientOid. The maximum length for the ClientOid is 40 characters.\n\nPlease remember the orderId created by the service provider, it used to check for updates in order status.", - "example": [ - "5c52e11203aa677f33e493fb" - ] - }, - "side": { - "type": "string", - "description": "specify if the order is to 'buy' or 'sell'", - "enum": [ - "buy", - "sell" - ], - "x-api-enum": [ - { - "value": "buy", - "name": "", - "description": "" - }, - { - "value": "sell", - "name": "", - "description": "" - } - ], - "example": [ - "buy" - ] - }, - "symbol": { - "type": "string", - "description": "symbol", - "example": [ - "BTC-USDT", - "ETH-USDT", - "KCS-USDT" - ] - }, - "type": { - "type": "string", - "description": "specify if the order is an 'limit' order or 'market' order. \n\nThe type of order you specify when you place your order determines whether or not you need to request other parameters and also affects the execution of the matching engine.\n\nWhen placing a limit order, you must specify a price and size. The system will try to match the order according to market price or a price better than market price. If the order cannot be immediately matched, it will stay in the order book until it is matched or the user cancels.\n\nUnlike limit orders, the price for market orders fluctuates with market prices. When placing a market order, you do not need to specify a price, you only need to specify a quantity. Market orders are filled immediately and will not enter the order book. All market orders are takers and a taker fee will be charged.", - "enum": [ - "limit", - "market" - ], - "default": "limit", - "x-api-enum": [ - { - "value": "limit", - "name": "limit", - "description": "limit order" - }, - { - "value": "market", - "name": "market", - "description": "market order" - } - ] - }, - "remark": { - "type": "string", - "description": "Order placement remarks, length cannot exceed 20 characters (ASCII)" - }, - "stp": { - "type": "string", - "description": "[Self Trade Prevention](https://www.kucoin.com/docs-new/doc-338146) is divided into four strategies: CN, CO, CB , and DC", - "enum": [ - "DC", - "CO", - "CN", - "CB" - ], - "x-api-enum": [ - { - "value": "DC", - "name": "", - "description": "" - }, - { - "value": "CO", - "name": "", - "description": "" - }, - { - "value": "CN", - "name": "", - "description": "" - }, - { - "value": "CB", - "name": "", - "description": "" - } - ] - }, - "price": { - "type": "string", - "description": "Specify price for order\n\nWhen placing a limit order, the price must be based on priceIncrement for the trading pair. The price increment (priceIncrement) is the price precision for the trading pair. For example, for the BTC-USDT trading pair, the priceIncrement is 0.00001000. So the price for your orders cannot be less than 0.00001000 and must be a multiple of priceIncrement. Otherwise, the order will return an invalid priceIncrement error." - }, - "size": { - "type": "string", - "description": "Specify quantity for order\n\nWhen **type** is limit, size refers to the amount of trading targets (the asset name written in front) for the trading pair. Teh Size must be based on the baseIncrement of the trading pair. The baseIncrement represents the precision for the trading pair. The size of an order must be a positive-integer multiple of baseIncrement and must be between baseMinSize and baseMaxSize.\n\nWhen **type** is market, select one out of two: size or funds" - }, - "timeInForce": { - "type": "string", - "description": "[Time in force](https://www.kucoin.com/docs-new/doc-338146) is a special strategy used during trading", - "enum": [ - "GTC", - "GTT", - "IOC", - "FOK" - ], - "default": "GTC", - "x-api-enum": [ - { - "value": "GTC", - "name": "", - "description": "" - }, - { - "value": "GTT", - "name": "", - "description": "" - }, - { - "value": "IOC", - "name": "", - "description": "" - }, - { - "value": "FOK", - "name": "", - "description": "" - } - ] - }, - "postOnly": { - "type": "boolean", - "default": false, - "description": "passive order labels, this is disabled when the order timing strategy is IOC or FOK" - }, - "hidden": { - "type": "boolean", - "description": "Hidden or not (not shown in order book)", - "default": false - }, - "iceberg": { - "type": "boolean", - "description": "Whether or not only visible portions of orders are shown in iceberg orders", - "default": false - }, - "visibleSize": { - "type": "string", - "description": "Maximum visible quantity in iceberg orders" - }, - "cancelAfter": { - "type": "integer", - "format": "int64", - "description": "Cancel after n seconds,the order timing strategy is GTT" - }, - "funds": { - "type": "string", - "description": "When **type** is market, select one out of two: size or funds" - }, - "tradeType": { - "type": "string", - "description": "The type of trading : **TRADE**(Spot Trade), **MARGIN_TRADE** (Margin Trade). Default is **TRADE**. **Note: To improve the system performance and to accelerate order placing and processing, KuCoin has added a new interface for order placing of margin. For traders still using the current interface, please move to the new one as soon as possible. The current one will no longer accept margin orders by May 1st, 2021 (UTC). At the time, KuCoin will notify users via the announcement, please pay attention to it.**", - "enum": [ - "TRADE", - "MARGIN_TRADE" - ], - "default": "TRADE", - "x-api-enum": [ - { - "value": "TRADE", - "name": "TRADE", - "description": "Spot" - }, - { - "value": "MARGIN_TRADE", - "name": "MARGIN_TRADE", - "description": "Margin" - } - ] - } - }, - "required": [ - "symbol", - "side", - "clientOid" - ] - }, - "example": "//limit order\n{\n \"type\": \"limit\",\n \"symbol\": \"BTC-USDT\",\n \"side\": \"buy\",\n \"price\": \"50000\",\n \"size\": \"0.00001\",\n \"clientOid\": \"5c52e11203aa677f33e493fb\",\n \"remark\": \"order remarks\"\n}\n\n//market order 1\n// {\n// \"type\": \"market\",\n// \"symbol\": \"BTC-USDT\",\n// \"side\": \"buy\",\n// \"size\": \"0.00001\",\n// \"clientOid\": \"5c52e11203aa677f33e493fc\",\n// \"remark\": \"order remarks\"\n// }\n\n//market order 2\n// {\n// \"type\": \"market\",\n// \"symbol\": \"BTC-USDT\",\n// \"side\": \"buy\",\n// \"funds\": \"1\",\n// \"clientOid\": \"5c52e11203aa677f33e493fc\",\n// \"remark\": \"order remarks\"\n// }\n" - } - } - }, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"orderId\\\": \\\"674a8776291d9e00074f1edf\\\"\\n }\\n}", - "x-request-example": "{\\\"type\\\": \\\"limit\\\", \\\"symbol\\\": \\\"BTC-USDT\\\", \\\"side\\\": \\\"buy\\\", \\\"price\\\": \\\"50000\\\", \\\"size\\\": \\\"0.00001\\\", \\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\", \\\"remark\\\": \\\"order remarks\\\"}" + "x-sdk-method-name": "getRecentTradeHistoryOld", + "x-sdk-method-description": "Request via this endpoint to get a list of 1000 fills in the last 24 hours. The return value is the data after Pagination, sorted in descending order according to time.", + "x-api-rate-limit": 20, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": [\\n {\\n \\\"symbol\\\": \\\"BTC-USDT\\\",\\n \\\"tradeId\\\": \\\"11732720444522497\\\",\\n \\\"orderId\\\": \\\"674aab24754b1e00077dbc69\\\",\\n \\\"counterOrderId\\\": \\\"674aab1fb26bfb0007a18b67\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"liquidity\\\": \\\"taker\\\",\\n \\\"forceTaker\\\": false,\\n \\\"price\\\": \\\"96999.6\\\",\\n \\\"size\\\": \\\"0.00001\\\",\\n \\\"funds\\\": \\\"0.969996\\\",\\n \\\"fee\\\": \\\"0.000969996\\\",\\n \\\"feeRate\\\": \\\"0.001\\\",\\n \\\"feeCurrency\\\": \\\"USDT\\\",\\n \\\"stop\\\": \\\"\\\",\\n \\\"tradeType\\\": \\\"TRADE\\\",\\n \\\"type\\\": \\\"limit\\\",\\n \\\"createdAt\\\": 1732946724082\\n }\\n ]\\n}", + "x-request-example": "{\\\"currentPage\\\": 1, \\\"pageSize\\\": 50}" } } }, diff --git a/spec/ws.csv b/spec/ws.csv index ccc47b8e..b180dcfb 100644 --- a/spec/ws.csv +++ b/spec/ws.csv @@ -1,14 +1,14 @@ service,topic,method,pubic Spot,"/market/ticker:{symbol},{symbol}",ticker,True -Spot,/market/snapshot:{symbol},symbolSnapshot,True +Spot,/market/ticker:all,allTickers,True Spot,"/spotMarket/level1:{symbol},{symbol}",orderbookLevel1,True Spot,"/spotMarket/level2Depth5:{symbol},{symbol}",orderbookLevel5,True Spot,"/market/level2:{symbol},{symbol}",orderbookLevel50,True +Spot,"/market/level2:{symbol},{symbol}",orderbookIncrement,True Spot,/market/candles:{symbol}_{type},klines,True -Spot,/market/ticker:all,allTickers,True -Spot,/market/snapshot:{market},marketSnapshot,True Spot,"/market/match:{symbol},{symbol}",trade,True -Spot,"/market/level2:{symbol},{symbol}",orderbookIncrement,True +Spot,/market/snapshot:{symbol},symbolSnapshot,True +Spot,/market/snapshot:{market},marketSnapshot,True Spot,/spotMarket/tradeOrdersV2,orderV2,False Spot,/spotMarket/tradeOrders,orderV1,False Spot,/account/balance,account,False @@ -19,18 +19,18 @@ Margin,/margin/isolatedPosition:{symbol},isolatedMarginPosition,False Futures,/contractMarket/tickerV2:{symbol},tickerV2,True Futures,/contractMarket/ticker:{symbol},tickerV1,True Futures,/contractMarket/level2Depth5:{symbol},orderbookLevel5,True -Futures,/contractMarket/execution:{symbol},execution,True -Futures,/contractMarket/level2:{symbol},orderbookIncrement,True Futures,/contractMarket/level2Depth50:{symbol},orderbookLevel50,True +Futures,/contractMarket/level2:{symbol},orderbookIncrement,True Futures,/contractMarket/limitCandle:{symbol}_{type},klines,True +Futures,/contractMarket/execution:{symbol},execution,True Futures,/contract/instrument:{symbol},instrument,True Futures,/contract/announcement:{symbol},announcement,True Futures,/contractMarket/snapshot:{symbol},symbolSnapshot,True Futures,/contractMarket/tradeOrders:{symbol},order,False +Futures,/contractMarket/tradeOrders,allOrder,False Futures,/contractAccount/wallet,balance,False Futures,/contract/position:{symbol},position,False -Futures,/contractMarket/advancedOrders,stopOrders,False +Futures,/contract/positionAll,allPosition,False Futures,/contract/marginMode,marginMode,False Futures,/contract/crossLeverage,crossLeverage,False -Futures,/contractMarket/tradeOrders,allOrder,False -Futures,/contract/positionAll,allPosition,False +Futures,/contractMarket/advancedOrders,stopOrders,False diff --git a/spec/ws/openapi-futures-private.json b/spec/ws/openapi-futures-private.json index 39e24e48..3006a566 100644 --- a/spec/ws/openapi-futures-private.json +++ b/spec/ws/openapi-futures-private.json @@ -35,6 +35,34 @@ } } }, + "/allOrder/contractMarket/tradeOrders": { + "trace": { + "summary": "All Order change pushes.", + "deprecated": "false", + "description": "Push order changes for all symbol", + "tags": [], + "parameters": [], + "x-sdk-service": "Futures", + "x-sdk-sub-service": "futures_private", + "x-sdk-private": true, + "x-sdk-method-name": "allOrder", + "x-topic": "/contractMarket/tradeOrders", + "x-push_frequency": "realtime", + "x-response-example": "{\\\"topic\\\":\\\"/contractMarket/tradeOrders:XBTUSDTM\\\",\\\"type\\\":\\\"message\\\",\\\"subject\\\":\\\"symbolOrderChange\\\",\\\"userId\\\":\\\"633559791e1cbc0001f319bc\\\",\\\"channelType\\\":\\\"private\\\",\\\"data\\\":{\\\"symbol\\\":\\\"XBTUSDTM\\\",\\\"side\\\":\\\"buy\\\",\\\"canceledSize\\\":\\\"0\\\",\\\"orderId\\\":\\\"247899236673269761\\\",\\\"liquidity\\\":\\\"maker\\\",\\\"marginMode\\\":\\\"ISOLATED\\\",\\\"type\\\":\\\"open\\\",\\\"orderTime\\\":1731916985768138917,\\\"size\\\":\\\"1\\\",\\\"filledSize\\\":\\\"0\\\",\\\"price\\\":\\\"91670\\\",\\\"remainSize\\\":\\\"1\\\",\\\"status\\\":\\\"open\\\",\\\"ts\\\":1731916985789000000}}", + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Futures_futures_private_allOrders" + } + } + } + } + } + } + }, "/balance/contractAccount/wallet": { "trace": { "summary": "the balance change push", @@ -91,27 +119,27 @@ } } }, - "/stopOrders/contractMarket/advancedOrders": { + "/allPosition/contract/positionAll": { "trace": { - "summary": "stop order change pushes.", + "summary": "All symbol position change events push", "deprecated": "false", - "description": "Subscribe this topic to get the realtime push of stop order changes.", + "description": "Subscribe this topic to get the realtime push of position change event of all symbol", "tags": [], "parameters": [], "x-sdk-service": "Futures", "x-sdk-sub-service": "futures_private", "x-sdk-private": true, - "x-sdk-method-name": "stopOrders", - "x-topic": "/contractMarket/advancedOrders", + "x-sdk-method-name": "allPosition", + "x-topic": "/contract/positionAll", "x-push_frequency": "realtime", - "x-response-example": "{\\\"topic\\\":\\\"/contractMarket/advancedOrders\\\",\\\"type\\\":\\\"message\\\",\\\"data\\\":{\\\"createdAt\\\":1730194206837,\\\"marginMode\\\":\\\"ISOLATED\\\",\\\"orderId\\\":\\\"240673378116083712\\\",\\\"orderPrice\\\":\\\"0.1\\\",\\\"orderType\\\":\\\"stop\\\",\\\"side\\\":\\\"buy\\\",\\\"size\\\":1,\\\"stop\\\":\\\"down\\\",\\\"stopPrice\\\":\\\"1000\\\",\\\"stopPriceType\\\":\\\"TP\\\",\\\"symbol\\\":\\\"XBTUSDTM\\\",\\\"ts\\\":1730194206843133000,\\\"type\\\":\\\"open\\\"},\\\"subject\\\":\\\"stopOrder\\\",\\\"id\\\":\\\"6720ab1ea52a9b0001734392\\\",\\\"userId\\\":\\\"66f12e8befb04d0001882b49\\\",\\\"channelType\\\":\\\"private\\\"}", + "x-response-example": "{\\\"topic\\\":\\\"/contract/position:XBTUSDTM\\\",\\\"type\\\":\\\"message\\\",\\\"data\\\":{\\\"symbol\\\":\\\"XBTUSDTM\\\",\\\"maintMarginReq\\\":0.005,\\\"riskLimit\\\":500000,\\\"realLeverage\\\":4.9685590767,\\\"crossMode\\\":false,\\\"delevPercentage\\\":0.10,\\\"openingTimestamp\\\":1731916913097,\\\"autoDeposit\\\":true,\\\"currentTimestamp\\\":1731924561514,\\\"currentQty\\\":1,\\\"currentCost\\\":91.5306,\\\"currentComm\\\":0.09179284,\\\"unrealisedCost\\\":91.6945,\\\"realisedCost\\\":-0.07210716,\\\"isOpen\\\":true,\\\"markPrice\\\":91839.79,\\\"markValue\\\":91.83979,\\\"posCost\\\":91.6945,\\\"posCross\\\":0,\\\"posInit\\\":18.3389,\\\"posComm\\\":0.06602004,\\\"posLoss\\\":0,\\\"posMargin\\\":18.40492004,\\\"posFunding\\\":0,\\\"posMaint\\\":0.5634627025,\\\"maintMargin\\\":18.55021004,\\\"avgEntryPrice\\\":91694.5,\\\"liquidationPrice\\\":73853.0426625,\\\"bankruptPrice\\\":73355.6,\\\"settleCurrency\\\":\\\"USDT\\\",\\\"changeReason\\\":\\\"positionChange\\\",\\\"riskLimitLevel\\\":2,\\\"realisedGrossCost\\\":-0.1639,\\\"realisedGrossPnl\\\":0.1639,\\\"realisedPnl\\\":0.07210716,\\\"unrealisedPnl\\\":0.14529,\\\"unrealisedPnlPcnt\\\":0.0016,\\\"unrealisedRoePcnt\\\":0.0079,\\\"leverage\\\":4.9685590767,\\\"marginMode\\\":\\\"ISOLATED\\\",\\\"positionSide\\\":\\\"BOTH\\\"},\\\"subject\\\":\\\"position.change\\\",\\\"userId\\\":\\\"633559791e1cbc0001f319bc\\\",\\\"channelType\\\":\\\"private\\\"}", "responses": { "200": { "description": "", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Futures_futures_private_stopOrders" + "$ref": "#/components/schemas/Futures_futures_private_allPosition" } } } @@ -175,55 +203,27 @@ } } }, - "/allOrder/contractMarket/tradeOrders": { - "trace": { - "summary": "All Order change pushes.", - "deprecated": "false", - "description": "Push order changes for all symbol", - "tags": [], - "parameters": [], - "x-sdk-service": "Futures", - "x-sdk-sub-service": "futures_private", - "x-sdk-private": true, - "x-sdk-method-name": "allOrder", - "x-topic": "/contractMarket/tradeOrders", - "x-push_frequency": "realtime", - "x-response-example": "{\\\"topic\\\":\\\"/contractMarket/tradeOrders:XBTUSDTM\\\",\\\"type\\\":\\\"message\\\",\\\"subject\\\":\\\"symbolOrderChange\\\",\\\"userId\\\":\\\"633559791e1cbc0001f319bc\\\",\\\"channelType\\\":\\\"private\\\",\\\"data\\\":{\\\"symbol\\\":\\\"XBTUSDTM\\\",\\\"side\\\":\\\"buy\\\",\\\"canceledSize\\\":\\\"0\\\",\\\"orderId\\\":\\\"247899236673269761\\\",\\\"liquidity\\\":\\\"maker\\\",\\\"marginMode\\\":\\\"ISOLATED\\\",\\\"type\\\":\\\"open\\\",\\\"orderTime\\\":1731916985768138917,\\\"size\\\":\\\"1\\\",\\\"filledSize\\\":\\\"0\\\",\\\"price\\\":\\\"91670\\\",\\\"remainSize\\\":\\\"1\\\",\\\"status\\\":\\\"open\\\",\\\"ts\\\":1731916985789000000}}", - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Futures_futures_private_allOrders" - } - } - } - } - } - } - }, - "/allPosition/contract/positionAll": { + "/stopOrders/contractMarket/advancedOrders": { "trace": { - "summary": "All symbol position change events push", + "summary": "stop order change pushes.", "deprecated": "false", - "description": "Subscribe this topic to get the realtime push of position change event of all symbol", + "description": "Subscribe this topic to get the realtime push of stop order changes.", "tags": [], "parameters": [], "x-sdk-service": "Futures", "x-sdk-sub-service": "futures_private", "x-sdk-private": true, - "x-sdk-method-name": "allPosition", - "x-topic": "/contract/positionAll", + "x-sdk-method-name": "stopOrders", + "x-topic": "/contractMarket/advancedOrders", "x-push_frequency": "realtime", - "x-response-example": "{\\\"topic\\\":\\\"/contract/position:XBTUSDTM\\\",\\\"type\\\":\\\"message\\\",\\\"data\\\":{\\\"symbol\\\":\\\"XBTUSDTM\\\",\\\"maintMarginReq\\\":0.005,\\\"riskLimit\\\":500000,\\\"realLeverage\\\":4.9685590767,\\\"crossMode\\\":false,\\\"delevPercentage\\\":0.10,\\\"openingTimestamp\\\":1731916913097,\\\"autoDeposit\\\":true,\\\"currentTimestamp\\\":1731924561514,\\\"currentQty\\\":1,\\\"currentCost\\\":91.5306,\\\"currentComm\\\":0.09179284,\\\"unrealisedCost\\\":91.6945,\\\"realisedCost\\\":-0.07210716,\\\"isOpen\\\":true,\\\"markPrice\\\":91839.79,\\\"markValue\\\":91.83979,\\\"posCost\\\":91.6945,\\\"posCross\\\":0,\\\"posInit\\\":18.3389,\\\"posComm\\\":0.06602004,\\\"posLoss\\\":0,\\\"posMargin\\\":18.40492004,\\\"posFunding\\\":0,\\\"posMaint\\\":0.5634627025,\\\"maintMargin\\\":18.55021004,\\\"avgEntryPrice\\\":91694.5,\\\"liquidationPrice\\\":73853.0426625,\\\"bankruptPrice\\\":73355.6,\\\"settleCurrency\\\":\\\"USDT\\\",\\\"changeReason\\\":\\\"positionChange\\\",\\\"riskLimitLevel\\\":2,\\\"realisedGrossCost\\\":-0.1639,\\\"realisedGrossPnl\\\":0.1639,\\\"realisedPnl\\\":0.07210716,\\\"unrealisedPnl\\\":0.14529,\\\"unrealisedPnlPcnt\\\":0.0016,\\\"unrealisedRoePcnt\\\":0.0079,\\\"leverage\\\":4.9685590767,\\\"marginMode\\\":\\\"ISOLATED\\\",\\\"positionSide\\\":\\\"BOTH\\\"},\\\"subject\\\":\\\"position.change\\\",\\\"userId\\\":\\\"633559791e1cbc0001f319bc\\\",\\\"channelType\\\":\\\"private\\\"}", + "x-response-example": "{\\\"topic\\\":\\\"/contractMarket/advancedOrders\\\",\\\"type\\\":\\\"message\\\",\\\"data\\\":{\\\"createdAt\\\":1730194206837,\\\"marginMode\\\":\\\"ISOLATED\\\",\\\"orderId\\\":\\\"240673378116083712\\\",\\\"orderPrice\\\":\\\"0.1\\\",\\\"orderType\\\":\\\"stop\\\",\\\"side\\\":\\\"buy\\\",\\\"size\\\":1,\\\"stop\\\":\\\"down\\\",\\\"stopPrice\\\":\\\"1000\\\",\\\"stopPriceType\\\":\\\"TP\\\",\\\"symbol\\\":\\\"XBTUSDTM\\\",\\\"ts\\\":1730194206843133000,\\\"type\\\":\\\"open\\\"},\\\"subject\\\":\\\"stopOrder\\\",\\\"id\\\":\\\"6720ab1ea52a9b0001734392\\\",\\\"userId\\\":\\\"66f12e8befb04d0001882b49\\\",\\\"channelType\\\":\\\"private\\\"}", "responses": { "200": { "description": "", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Futures_futures_private_allPosition" + "$ref": "#/components/schemas/Futures_futures_private_stopOrders" } } } @@ -541,7 +541,7 @@ "data" ] }, - "Futures_futures_private_balance": { + "Futures_futures_private_allOrders": { "type": "object", "properties": { "topic": { @@ -551,10 +551,23 @@ "type": "string" }, "subject": { - "type": "string" - }, - "id": { - "type": "string" + "type": "string", + "enum": [ + "orderChange", + "symbolOrderChange" + ], + "x-api-enum": [ + { + "value": "orderChange", + "name": "orderChange", + "description": "orderChange" + }, + { + "value": "symbolOrderChange", + "name": "symbolOrderChange", + "description": "symbolOrderChange" + } + ] }, "userId": { "type": "string" @@ -565,70 +578,364 @@ "data": { "type": "object", "properties": { - "crossPosMargin": { - "type": "string", - "description": "Margin of the cross margin position" - }, - "isolatedOrderMargin": { - "type": "string", - "description": "Margin of the isolated margin order" - }, - "holdBalance": { + "symbol": { "type": "string", - "description": "Frozen Balance" + "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-221752070) " }, - "equity": { + "orderType": { "type": "string", - "description": "Equity" + "enum": [ + "limit", + "market" + ], + "description": "User-specified order type", + "x-api-enum": [ + { + "value": "limit", + "name": "limit", + "description": "limit" + }, + { + "value": "market", + "name": "market", + "description": "market" + } + ] }, - "version": { + "side": { "type": "string", - "description": "Version. When holding a cross margin position, the available balance may change with fluctuations in the mark price, leading to discrepancies in the available balance for the same version number." + "enum": [ + "buy", + "sell" + ], + "description": "buy or sell", + "x-api-enum": [ + { + "value": "buy", + "name": "buy", + "description": "buy" + }, + { + "value": "sell", + "name": "sell", + "description": "sell" + } + ] }, - "availableBalance": { + "canceledSize": { "type": "string", - "description": "Available Balance" + "description": "Cumulative number of cancellations" }, - "isolatedPosMargin": { + "orderId": { "type": "string", - "description": "Margin of the isolated margin position, including isolated margin funding fees" + "description": "The unique order id generated by the trading system" }, - "walletBalance": { + "marginMode": { "type": "string", - "description": "Wallet Balance" + "enum": [ + "ISOLATED", + "CROSS" + ], + "description": "Margin Mode", + "x-api-enum": [ + { + "value": "ISOLATED", + "name": "ISOLATED", + "description": "Isolated Margin" + }, + { + "value": "CROSS", + "name": "CROSS", + "description": "Cross Margin" + } + ] }, - "isolatedFundingFeeMargin": { + "type": { "type": "string", - "description": "Isolated margin funding fee" + "description": "Order Type", + "enum": [ + "open", + "match", + "update", + "filled", + "canceled" + ], + "x-api-enum": [ + { + "value": "open", + "name": "open", + "description": "the order is in the order book(maker order)" + }, + { + "value": "match", + "name": "match", + "description": "the message sent when the order is match, 1. When the status is open and the type is match, it is a maker match. 2. When the status is match and the type is match, it is a taker match." + }, + { + "value": "update", + "name": "update", + "description": "The message sent due to the order being modified: STP triggering, partial cancellation of the order. Includes these three situations: 1. When the status is open and the type is update: partial amounts of the order have been canceled, or STP triggers 2. When the status is match and the type is update: STP triggers 3. When the status is done and the type is update: partial amounts of the order have been filled and the unfilled part got canceled, or STP is triggered." + }, + { + "value": "filled", + "name": "filled", + "description": "The message sent when the status of the order changes to DONE after the transaction" + }, + { + "value": "canceled", + "name": "canceled", + "description": "The message sent when the status of the order changes to DONE due to being canceled" + } + ] }, - "crossUnPnl": { - "type": "string", - "description": "Unrealized PNL in cross margin mode" + "orderTime": { + "type": "integer", + "format": "int64", + "description": "Order time(Nanosecond)" }, - "totalCrossMargin": { + "size": { "type": "string", - "description": "Total margin under cross margin mode" + "description": "User-specified order size" }, - "currency": { + "filledSize": { "type": "string", - "description": "Currency Symbol" + "description": "Cumulative number of filled" }, - "isolatedUnPnl": { + "price": { "type": "string", - "description": " Unrealized PNL in isolated margin mode" + "description": "Price" }, - "crossOrderMargin": { + "remainSize": { "type": "string", - "description": "Margin of the cross margin order" + "description": "Remain size" }, - "timestamp": { + "status": { "type": "string", - "description": "Last modified time" - } - }, - "required": [ - "crossPosMargin", - "isolatedOrderMargin", + "description": "Order Status", + "enum": [ + "open", + "match", + "done" + ], + "x-api-enum": [ + { + "value": "open", + "name": "open", + "description": "the order is in the order book(maker order)" + }, + { + "value": "match", + "name": "match", + "description": "when taker order executes with orders in the order book, the taker order status is “match”" + }, + { + "value": "done", + "name": "done", + "description": "the order is fully executed successfully" + } + ] + }, + "ts": { + "type": "integer", + "format": "int64", + "description": "Push time(Nanosecond)" + }, + "liquidity": { + "type": "string", + "enum": [ + "taker", + "maker" + ], + "description": "Actual transaction order type, If the counterparty order is an [Hidden/Iceberg Order](https://www.kucoin.com/docs-new/doc-338146), even if it is a maker order, this param will be displayed as taker. For actual trading fee, please refer to the **feeType** ", + "x-api-enum": [ + { + "value": "taker", + "name": "taker", + "description": "taker" + }, + { + "value": "maker", + "name": "maker", + "description": "maker" + } + ] + }, + "feeType": { + "type": "string", + "enum": [ + "takerFee", + "makerFee" + ], + "description": "Actual Fee Type", + "x-api-enum": [ + { + "value": "takerFee", + "name": "takerFee", + "description": "takerFee" + }, + { + "value": "makerFee", + "name": "makerFee", + "description": "makerFee" + } + ] + }, + "matchPrice": { + "type": "string", + "description": "Match Price(when the type is \"match\")" + }, + "matchSize": { + "type": "string", + "description": "Match Size (when the type is \"match\")" + }, + "tradeId": { + "type": "string", + "description": "Trade id, it is generated by Matching engine." + }, + "oldSize": { + "type": "string", + "description": "The size before order update" + }, + "clientOid": { + "type": "string", + "description": "Client Order Id,The ClientOid field is a unique ID created by the user" + }, + "tradeType": { + "type": "string", + "description": "normal order or liquid order", + "enum": [ + "trade", + "liquid" + ], + "x-api-enum": [ + { + "value": "trade", + "name": "trade", + "description": "Normal trade order" + }, + { + "value": "liquid", + "name": "liquid", + "description": "Liquid order, except type=update, all other types will be pushed" + } + ] + } + }, + "required": [ + "symbol", + "side", + "canceledSize", + "orderId", + "marginMode", + "type", + "orderTime", + "size", + "filledSize", + "price", + "remainSize", + "status", + "ts", + "tradeType" + ] + } + }, + "required": [ + "topic", + "type", + "subject", + "userId", + "channelType", + "data" + ] + }, + "Futures_futures_private_balance": { + "type": "object", + "properties": { + "topic": { + "type": "string" + }, + "type": { + "type": "string" + }, + "subject": { + "type": "string" + }, + "id": { + "type": "string" + }, + "userId": { + "type": "string" + }, + "channelType": { + "type": "string" + }, + "data": { + "type": "object", + "properties": { + "crossPosMargin": { + "type": "string", + "description": "Margin of the cross margin position" + }, + "isolatedOrderMargin": { + "type": "string", + "description": "Margin of the isolated margin order" + }, + "holdBalance": { + "type": "string", + "description": "Frozen Balance" + }, + "equity": { + "type": "string", + "description": "Equity" + }, + "version": { + "type": "string", + "description": "Version. When holding a cross margin position, the available balance may change with fluctuations in the mark price, leading to discrepancies in the available balance for the same version number." + }, + "availableBalance": { + "type": "string", + "description": "Available Balance" + }, + "isolatedPosMargin": { + "type": "string", + "description": "Margin of the isolated margin position, including isolated margin funding fees" + }, + "walletBalance": { + "type": "string", + "description": "Wallet Balance" + }, + "isolatedFundingFeeMargin": { + "type": "string", + "description": "Isolated margin funding fee" + }, + "crossUnPnl": { + "type": "string", + "description": "Unrealized PNL in cross margin mode" + }, + "totalCrossMargin": { + "type": "string", + "description": "Total margin under cross margin mode" + }, + "currency": { + "type": "string", + "description": "Currency Symbol" + }, + "isolatedUnPnl": { + "type": "string", + "description": " Unrealized PNL in isolated margin mode" + }, + "crossOrderMargin": { + "type": "string", + "description": "Margin of the cross margin order" + }, + "timestamp": { + "type": "string", + "description": "Last modified time" + } + }, + "required": [ + "crossPosMargin", + "isolatedOrderMargin", "holdBalance", "equity", "version", @@ -939,615 +1246,42 @@ "channelType" ] }, - "Futures_futures_private_stopOrders": { + "Futures_futures_private_allPosition": { "type": "object", "properties": { + "userId": { + "type": "string", + "description": "Deprecated, will detele later" + }, "topic": { "type": "string" }, - "type": { + "subject": { "type": "string" }, "data": { "type": "object", "properties": { - "createdAt": { + "symbol": { + "type": "string", + "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-221752070) ", + "example": [ + "XBTUSDTM", + "XBTUSDM", + "ETHUSDTM" + ] + }, + "crossMode": { + "type": "boolean", + "description": "Whether it is cross margin." + }, + "delevPercentage": { + "type": "number", + "description": "ADL ranking percentile\n" + }, + "openingTimestamp": { "type": "integer", - "format": "int64" - }, - "marginMode": { - "type": "string", - "enum": [ - "ISOLATED", - "CROSS" - ], - "description": "Margin Mode", - "x-api-enum": [ - { - "value": "ISOLATED", - "name": "ISOLATED", - "description": "Isolated Margin" - }, - { - "value": "CROSS", - "name": "CROSS", - "description": "Cross Margin" - } - ] - }, - "orderId": { - "type": "string", - "description": "The unique order id generated by the trading system" - }, - "orderPrice": { - "type": "string", - "description": "Order price" - }, - "orderType": { - "type": "string", - "description": "User-specified order type", - "enum": [ - "stop" - ], - "x-api-enum": [ - { - "value": "stop", - "name": "stop", - "description": "Stop order" - } - ] - }, - "side": { - "type": "string", - "enum": [ - "buy", - "sell" - ], - "description": "buy or sell", - "x-api-enum": [ - { - "value": "buy", - "name": "buy", - "description": "buy" - }, - { - "value": "sell", - "name": "sell", - "description": "sell" - } - ] - }, - "size": { - "type": "integer", - "description": "User-specified order size" - }, - "stop": { - "type": "string", - "description": "Either 'down' or 'up'", - "enum": [ - "down", - "up" - ], - "x-api-enum": [ - { - "value": "down", - "name": "down", - "description": "Triggers when the price reaches or goes below the stopPrice" - }, - { - "value": "up", - "name": "up", - "description": "Triggers when the price reaches or goes above the stopPrice" - } - ] - }, - "stopPrice": { - "type": "string", - "description": "Stop Price" - }, - "stopPriceType": { - "type": "string" - }, - "symbol": { - "type": "string", - "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-221752070) " - }, - "ts": { - "type": "integer", - "format": "int64" - }, - "type": { - "type": "string", - "description": "Order Type", - "enum": [ - "open", - "triggered", - "cancel" - ], - "x-api-enum": [ - { - "value": "open", - "name": "open", - "description": "the order is in the order book(maker order)" - }, - { - "value": "triggered", - "name": "triggered", - "description": "when the stop order has been triggered" - }, - { - "value": "cancel", - "name": "cancel", - "description": "when the order has been canceled" - } - ] - } - }, - "required": [ - "createdAt", - "marginMode", - "orderId", - "orderPrice", - "orderType", - "side", - "size", - "stop", - "stopPrice", - "stopPriceType", - "symbol", - "ts", - "type" - ] - }, - "subject": { - "type": "string" - }, - "id": { - "type": "string" - }, - "userId": { - "type": "string" - }, - "channelType": { - "type": "string" - } - }, - "required": [ - "topic", - "type", - "data", - "subject", - "id", - "userId", - "channelType" - ] - }, - "Futures_futures_private_marginMode": { - "type": "object", - "properties": { - "topic": { - "type": "string" - }, - "type": { - "type": "string" - }, - "data": { - "type": "object", - "properties": { - "SYMBOL": { - "type": "string", - "description": "The SYMBOL is the key with value \n\"CROSS\" or \"ISOLATED\"" - } - }, - "required": [ - "SYMBOL" - ] - }, - "subject": { - "type": "string" - }, - "userId": { - "type": "string" - }, - "channelType": { - "type": "string" - } - }, - "required": [ - "topic", - "type", - "data", - "subject", - "userId", - "channelType" - ] - }, - "Futures_futures_private_crossLeverage": { - "type": "object", - "properties": { - "topic": { - "type": "string" - }, - "type": { - "type": "string" - }, - "subject": { - "type": "string" - }, - "userId": { - "type": "string" - }, - "channelType": { - "type": "string" - }, - "data": { - "type": "object", - "properties": {}, - "additionalProperties": { - "type": "object", - "properties": { - "leverage": { - "type": "string" - } - }, - "required": [ - "leverage" - ] - } - } - }, - "required": [ - "topic", - "type", - "subject", - "userId", - "channelType", - "data" - ] - }, - "Futures_futures_private_allOrders": { - "type": "object", - "properties": { - "topic": { - "type": "string" - }, - "type": { - "type": "string" - }, - "subject": { - "type": "string", - "enum": [ - "orderChange", - "symbolOrderChange" - ], - "x-api-enum": [ - { - "value": "orderChange", - "name": "orderChange", - "description": "orderChange" - }, - { - "value": "symbolOrderChange", - "name": "symbolOrderChange", - "description": "symbolOrderChange" - } - ] - }, - "userId": { - "type": "string" - }, - "channelType": { - "type": "string" - }, - "data": { - "type": "object", - "properties": { - "symbol": { - "type": "string", - "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-221752070) " - }, - "orderType": { - "type": "string", - "enum": [ - "limit", - "market" - ], - "description": "User-specified order type", - "x-api-enum": [ - { - "value": "limit", - "name": "limit", - "description": "limit" - }, - { - "value": "market", - "name": "market", - "description": "market" - } - ] - }, - "side": { - "type": "string", - "enum": [ - "buy", - "sell" - ], - "description": "buy or sell", - "x-api-enum": [ - { - "value": "buy", - "name": "buy", - "description": "buy" - }, - { - "value": "sell", - "name": "sell", - "description": "sell" - } - ] - }, - "canceledSize": { - "type": "string", - "description": "Cumulative number of cancellations" - }, - "orderId": { - "type": "string", - "description": "The unique order id generated by the trading system" - }, - "marginMode": { - "type": "string", - "enum": [ - "ISOLATED", - "CROSS" - ], - "description": "Margin Mode", - "x-api-enum": [ - { - "value": "ISOLATED", - "name": "ISOLATED", - "description": "Isolated Margin" - }, - { - "value": "CROSS", - "name": "CROSS", - "description": "Cross Margin" - } - ] - }, - "type": { - "type": "string", - "description": "Order Type", - "enum": [ - "open", - "match", - "update", - "filled", - "canceled" - ], - "x-api-enum": [ - { - "value": "open", - "name": "open", - "description": "the order is in the order book(maker order)" - }, - { - "value": "match", - "name": "match", - "description": "the message sent when the order is match, 1. When the status is open and the type is match, it is a maker match. 2. When the status is match and the type is match, it is a taker match." - }, - { - "value": "update", - "name": "update", - "description": "The message sent due to the order being modified: STP triggering, partial cancellation of the order. Includes these three situations: 1. When the status is open and the type is update: partial amounts of the order have been canceled, or STP triggers 2. When the status is match and the type is update: STP triggers 3. When the status is done and the type is update: partial amounts of the order have been filled and the unfilled part got canceled, or STP is triggered." - }, - { - "value": "filled", - "name": "filled", - "description": "The message sent when the status of the order changes to DONE after the transaction" - }, - { - "value": "canceled", - "name": "canceled", - "description": "The message sent when the status of the order changes to DONE due to being canceled" - } - ] - }, - "orderTime": { - "type": "integer", - "format": "int64", - "description": "Order time(Nanosecond)" - }, - "size": { - "type": "string", - "description": "User-specified order size" - }, - "filledSize": { - "type": "string", - "description": "Cumulative number of filled" - }, - "price": { - "type": "string", - "description": "Price" - }, - "remainSize": { - "type": "string", - "description": "Remain size" - }, - "status": { - "type": "string", - "description": "Order Status", - "enum": [ - "open", - "match", - "done" - ], - "x-api-enum": [ - { - "value": "open", - "name": "open", - "description": "the order is in the order book(maker order)" - }, - { - "value": "match", - "name": "match", - "description": "when taker order executes with orders in the order book, the taker order status is “match”" - }, - { - "value": "done", - "name": "done", - "description": "the order is fully executed successfully" - } - ] - }, - "ts": { - "type": "integer", - "format": "int64", - "description": "Push time(Nanosecond)" - }, - "liquidity": { - "type": "string", - "enum": [ - "taker", - "maker" - ], - "description": "Actual transaction order type, If the counterparty order is an [Hidden/Iceberg Order](https://www.kucoin.com/docs-new/doc-338146), even if it is a maker order, this param will be displayed as taker. For actual trading fee, please refer to the **feeType** ", - "x-api-enum": [ - { - "value": "taker", - "name": "taker", - "description": "taker" - }, - { - "value": "maker", - "name": "maker", - "description": "maker" - } - ] - }, - "feeType": { - "type": "string", - "enum": [ - "takerFee", - "makerFee" - ], - "description": "Actual Fee Type", - "x-api-enum": [ - { - "value": "takerFee", - "name": "takerFee", - "description": "takerFee" - }, - { - "value": "makerFee", - "name": "makerFee", - "description": "makerFee" - } - ] - }, - "matchPrice": { - "type": "string", - "description": "Match Price(when the type is \"match\")" - }, - "matchSize": { - "type": "string", - "description": "Match Size (when the type is \"match\")" - }, - "tradeId": { - "type": "string", - "description": "Trade id, it is generated by Matching engine." - }, - "oldSize": { - "type": "string", - "description": "The size before order update" - }, - "clientOid": { - "type": "string", - "description": "Client Order Id,The ClientOid field is a unique ID created by the user" - }, - "tradeType": { - "type": "string", - "description": "normal order or liquid order", - "enum": [ - "trade", - "liquid" - ], - "x-api-enum": [ - { - "value": "trade", - "name": "trade", - "description": "Normal trade order" - }, - { - "value": "liquid", - "name": "liquid", - "description": "Liquid order, except type=update, all other types will be pushed" - } - ] - } - }, - "required": [ - "symbol", - "side", - "canceledSize", - "orderId", - "marginMode", - "type", - "orderTime", - "size", - "filledSize", - "price", - "remainSize", - "status", - "ts", - "tradeType" - ] - } - }, - "required": [ - "topic", - "type", - "subject", - "userId", - "channelType", - "data" - ] - }, - "Futures_futures_private_allPosition": { - "type": "object", - "properties": { - "userId": { - "type": "string", - "description": "Deprecated, will detele later" - }, - "topic": { - "type": "string" - }, - "subject": { - "type": "string" - }, - "data": { - "type": "object", - "properties": { - "symbol": { - "type": "string", - "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-221752070) ", - "example": [ - "XBTUSDTM", - "XBTUSDM", - "ETHUSDTM" - ] - }, - "crossMode": { - "type": "boolean", - "description": "Whether it is cross margin." - }, - "delevPercentage": { - "type": "number", - "description": "ADL ranking percentile\n" - }, - "openingTimestamp": { - "type": "integer", - "description": "Open time\n", + "description": "Open time\n", "format": "int64" }, "currentTimestamp": { @@ -1641,146 +1375,411 @@ }, "marginMode": { "type": "string", - "description": "Margin Mode: CROSS,ISOLATED\n", + "description": "Margin Mode: CROSS,ISOLATED\n", + "enum": [ + "CROSS", + "ISOLATED" + ], + "x-api-enum": [ + { + "value": "CROSS", + "name": "CROSS", + "description": "cross margin" + }, + { + "value": "ISOLATED", + "name": "ISOLATED", + "description": "isolated margin" + } + ] + }, + "positionSide": { + "type": "string", + "description": "Position Side\n", + "enum": [ + "BOTH" + ], + "x-api-enum": [ + { + "value": "BOTH", + "name": "BOTH", + "description": "One-way position" + } + ] + }, + "leverage": { + "type": "number", + "description": "Leverage" + }, + "autoDeposit": { + "type": "boolean", + "description": "Auto deposit margin or not **Only applicable to Isolated Margin**\n" + }, + "maintMarginReq": { + "type": "number", + "description": "Maintenance margin requirement **Only applicable to Isolated Margin**\n" + }, + "riskLimit": { + "type": "integer", + "description": "Risk limit **Only applicable to Isolated Margin**\n" + }, + "realLeverage": { + "type": "number", + "description": "Leverage of the order **Only applicable to Isolated Margin**\n" + }, + "posCross": { + "type": "number", + "description": "added margin **Only applicable to Isolated Margin**\n" + }, + "posComm": { + "type": "number", + "description": "Bankruptcy cost **Only applicable to Isolated Margin**\n" + }, + "posLoss": { + "type": "number", + "description": "Funding fees paid out **Only applicable to Isolated Margin**\n" + }, + "posFunding": { + "type": "number", + "description": "The current remaining unsettled funding fee for the position **Only applicable to Isolated Margin**\n" + }, + "posMaint": { + "type": "number", + "description": "Maintenance margin **Only applicable to Isolated Margin**\n" + }, + "maintMargin": { + "type": "number", + "description": "Position margin **Only applicable to Isolated Margin**\n" + }, + "fundingTime": { + "type": "integer", + "format": "int64", + "description": "Funding time" + }, + "qty": { + "type": "integer", + "description": "Position size" + }, + "fundingRate": { + "type": "number", + "description": "Funding rate" + }, + "fundingFee": { + "type": "number", + "description": "Funding fees" + }, + "ts": { + "type": "integer", + "format": "int64", + "description": "Funding Fee Settlement Time (nanosecond)" + }, + "success": { + "type": "boolean", + "description": "Adjustment isolated margin risk limit level successful or not" + }, + "msg": { + "type": "string", + "description": "Adjustment isolated margin risk limit level failure reason" + } + }, + "required": [ + "symbol", + "crossMode", + "delevPercentage", + "openingTimestamp", + "currentTimestamp", + "currentQty", + "currentCost", + "currentComm", + "unrealisedCost", + "realisedGrossCost", + "realisedCost", + "isOpen", + "markPrice", + "markValue", + "posCost", + "posInit", + "posMargin", + "realisedGrossPnl", + "realisedPnl", + "unrealisedPnl", + "unrealisedPnlPcnt", + "unrealisedRoePcnt", + "avgEntryPrice", + "liquidationPrice", + "bankruptPrice", + "settleCurrency", + "marginMode", + "positionSide", + "leverage" + ] + }, + "type": { + "type": "string" + }, + "channelType": { + "type": "string" + } + }, + "required": [ + "userId", + "topic", + "subject", + "data", + "type", + "channelType" + ] + }, + "Futures_futures_private_marginMode": { + "type": "object", + "properties": { + "topic": { + "type": "string" + }, + "type": { + "type": "string" + }, + "data": { + "type": "object", + "properties": { + "SYMBOL": { + "type": "string", + "description": "The SYMBOL is the key with value \n\"CROSS\" or \"ISOLATED\"" + } + }, + "required": [ + "SYMBOL" + ] + }, + "subject": { + "type": "string" + }, + "userId": { + "type": "string" + }, + "channelType": { + "type": "string" + } + }, + "required": [ + "topic", + "type", + "data", + "subject", + "userId", + "channelType" + ] + }, + "Futures_futures_private_crossLeverage": { + "type": "object", + "properties": { + "topic": { + "type": "string" + }, + "type": { + "type": "string" + }, + "subject": { + "type": "string" + }, + "userId": { + "type": "string" + }, + "channelType": { + "type": "string" + }, + "data": { + "type": "object", + "properties": {}, + "additionalProperties": { + "type": "object", + "properties": { + "leverage": { + "type": "string" + } + }, + "required": [ + "leverage" + ] + } + } + }, + "required": [ + "topic", + "type", + "subject", + "userId", + "channelType", + "data" + ] + }, + "Futures_futures_private_stopOrders": { + "type": "object", + "properties": { + "topic": { + "type": "string" + }, + "type": { + "type": "string" + }, + "data": { + "type": "object", + "properties": { + "createdAt": { + "type": "integer", + "format": "int64" + }, + "marginMode": { + "type": "string", "enum": [ - "CROSS", - "ISOLATED" + "ISOLATED", + "CROSS" ], + "description": "Margin Mode", "x-api-enum": [ - { - "value": "CROSS", - "name": "CROSS", - "description": "cross margin" - }, { "value": "ISOLATED", "name": "ISOLATED", - "description": "isolated margin" + "description": "Isolated Margin" + }, + { + "value": "CROSS", + "name": "CROSS", + "description": "Cross Margin" } ] }, - "positionSide": { + "orderId": { "type": "string", - "description": "Position Side\n", + "description": "The unique order id generated by the trading system" + }, + "orderPrice": { + "type": "string", + "description": "Order price" + }, + "orderType": { + "type": "string", + "description": "User-specified order type", "enum": [ - "BOTH" + "stop" ], "x-api-enum": [ { - "value": "BOTH", - "name": "BOTH", - "description": "One-way position" + "value": "stop", + "name": "stop", + "description": "Stop order" } ] }, - "leverage": { - "type": "number", - "description": "Leverage" - }, - "autoDeposit": { - "type": "boolean", - "description": "Auto deposit margin or not **Only applicable to Isolated Margin**\n" - }, - "maintMarginReq": { - "type": "number", - "description": "Maintenance margin requirement **Only applicable to Isolated Margin**\n" + "side": { + "type": "string", + "enum": [ + "buy", + "sell" + ], + "description": "buy or sell", + "x-api-enum": [ + { + "value": "buy", + "name": "buy", + "description": "buy" + }, + { + "value": "sell", + "name": "sell", + "description": "sell" + } + ] }, - "riskLimit": { + "size": { "type": "integer", - "description": "Risk limit **Only applicable to Isolated Margin**\n" - }, - "realLeverage": { - "type": "number", - "description": "Leverage of the order **Only applicable to Isolated Margin**\n" - }, - "posCross": { - "type": "number", - "description": "added margin **Only applicable to Isolated Margin**\n" - }, - "posComm": { - "type": "number", - "description": "Bankruptcy cost **Only applicable to Isolated Margin**\n" - }, - "posLoss": { - "type": "number", - "description": "Funding fees paid out **Only applicable to Isolated Margin**\n" - }, - "posFunding": { - "type": "number", - "description": "The current remaining unsettled funding fee for the position **Only applicable to Isolated Margin**\n" - }, - "posMaint": { - "type": "number", - "description": "Maintenance margin **Only applicable to Isolated Margin**\n" - }, - "maintMargin": { - "type": "number", - "description": "Position margin **Only applicable to Isolated Margin**\n" + "description": "User-specified order size" }, - "fundingTime": { - "type": "integer", - "format": "int64", - "description": "Funding time" + "stop": { + "type": "string", + "description": "Either 'down' or 'up'", + "enum": [ + "down", + "up" + ], + "x-api-enum": [ + { + "value": "down", + "name": "down", + "description": "Triggers when the price reaches or goes below the stopPrice" + }, + { + "value": "up", + "name": "up", + "description": "Triggers when the price reaches or goes above the stopPrice" + } + ] }, - "qty": { - "type": "integer", - "description": "Position size" + "stopPrice": { + "type": "string", + "description": "Stop Price" }, - "fundingRate": { - "type": "number", - "description": "Funding rate" + "stopPriceType": { + "type": "string" }, - "fundingFee": { - "type": "number", - "description": "Funding fees" + "symbol": { + "type": "string", + "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-221752070) " }, "ts": { "type": "integer", - "format": "int64", - "description": "Funding Fee Settlement Time (nanosecond)" - }, - "success": { - "type": "boolean", - "description": "Adjustment isolated margin risk limit level successful or not" + "format": "int64" }, - "msg": { + "type": { "type": "string", - "description": "Adjustment isolated margin risk limit level failure reason" + "description": "Order Type", + "enum": [ + "open", + "triggered", + "cancel" + ], + "x-api-enum": [ + { + "value": "open", + "name": "open", + "description": "the order is in the order book(maker order)" + }, + { + "value": "triggered", + "name": "triggered", + "description": "when the stop order has been triggered" + }, + { + "value": "cancel", + "name": "cancel", + "description": "when the order has been canceled" + } + ] } }, "required": [ - "symbol", - "crossMode", - "delevPercentage", - "openingTimestamp", - "currentTimestamp", - "currentQty", - "currentCost", - "currentComm", - "unrealisedCost", - "realisedGrossCost", - "realisedCost", - "isOpen", - "markPrice", - "markValue", - "posCost", - "posInit", - "posMargin", - "realisedGrossPnl", - "realisedPnl", - "unrealisedPnl", - "unrealisedPnlPcnt", - "unrealisedRoePcnt", - "avgEntryPrice", - "liquidationPrice", - "bankruptPrice", - "settleCurrency", + "createdAt", "marginMode", - "positionSide", - "leverage" + "orderId", + "orderPrice", + "orderType", + "side", + "size", + "stop", + "stopPrice", + "stopPriceType", + "symbol", + "ts", + "type" ] }, - "type": { + "subject": { + "type": "string" + }, + "id": { + "type": "string" + }, + "userId": { "type": "string" }, "channelType": { @@ -1788,11 +1787,12 @@ } }, "required": [ - "userId", "topic", - "subject", - "data", "type", + "data", + "subject", + "id", + "userId", "channelType" ] } diff --git a/spec/ws/openapi-futures-public.json b/spec/ws/openapi-futures-public.json index c4b4c816..515c5b86 100644 --- a/spec/ws/openapi-futures-public.json +++ b/spec/ws/openapi-futures-public.json @@ -91,27 +91,27 @@ } } }, - "/execution/contractMarket/execution:_symbol_": { + "/orderbookLevel50/contractMarket/level2Depth50:_symbol_": { "trace": { - "summary": "Match execution data.", + "summary": "Orderbook - Level50", "deprecated": "false", - "description": "For each order executed, the system will send you the match messages in the format as following.", + "description": "The depth50 market data.", "tags": [], "parameters": [], "x-sdk-service": "Futures", "x-sdk-sub-service": "futures_public", "x-sdk-private": false, - "x-sdk-method-name": "execution", - "x-topic": "/contractMarket/execution:{symbol}", - "x-push_frequency": "realtime", - "x-response-example": "{\\\"topic\\\":\\\"/contractMarket/execution:XBTUSDTM\\\",\\\"type\\\":\\\"message\\\",\\\"subject\\\":\\\"match\\\",\\\"sn\\\":1794100537695,\\\"data\\\":{\\\"symbol\\\":\\\"XBTUSDTM\\\",\\\"sequence\\\":1794100537695,\\\"side\\\":\\\"buy\\\",\\\"size\\\":2,\\\"price\\\":\\\"90503.9\\\",\\\"takerOrderId\\\":\\\"247822202957807616\\\",\\\"makerOrderId\\\":\\\"247822167163555840\\\",\\\"tradeId\\\":\\\"1794100537695\\\",\\\"ts\\\":1731898619520000000}}", + "x-sdk-method-name": "orderbookLevel50", + "x-topic": "/contractMarket/level2Depth50:{symbol}", + "x-push_frequency": "100ms", + "x-response-example": "{\\\"topic\\\":\\\"/contractMarket/level2Depth50:XBTUSDTM\\\",\\\"type\\\":\\\"message\\\",\\\"subject\\\":\\\"level2\\\",\\\"sn\\\":1731680249700,\\\"data\\\":{\\\"bids\\\":[[\\\"89778.6\\\",1534],[\\\"89778.2\\\",54]],\\\"sequence\\\":1709294490099,\\\"timestamp\\\":1731680249700,\\\"ts\\\":1731680249700,\\\"asks\\\":[[\\\"89778.7\\\",854],[\\\"89779.2\\\",4]]}}", "responses": { "200": { "description": "", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Futures_futures_public_matchExecution" + "$ref": "#/components/schemas/Futures_futures_public_orderbookLevel50" } } } @@ -147,27 +147,27 @@ } } }, - "/orderbookLevel50/contractMarket/level2Depth50:_symbol_": { + "/klines/contractMarket/limitCandle:_symbol___type_": { "trace": { - "summary": "Orderbook - Level50", + "summary": "Klines", "deprecated": "false", - "description": "The depth50 market data.", + "description": "Subscribe to this topic to get K-Line data.", "tags": [], "parameters": [], "x-sdk-service": "Futures", "x-sdk-sub-service": "futures_public", "x-sdk-private": false, - "x-sdk-method-name": "orderbookLevel50", - "x-topic": "/contractMarket/level2Depth50:{symbol}", - "x-push_frequency": "100ms", - "x-response-example": "{\\\"topic\\\":\\\"/contractMarket/level2Depth50:XBTUSDTM\\\",\\\"type\\\":\\\"message\\\",\\\"subject\\\":\\\"level2\\\",\\\"sn\\\":1731680249700,\\\"data\\\":{\\\"bids\\\":[[\\\"89778.6\\\",1534],[\\\"89778.2\\\",54]],\\\"sequence\\\":1709294490099,\\\"timestamp\\\":1731680249700,\\\"ts\\\":1731680249700,\\\"asks\\\":[[\\\"89778.7\\\",854],[\\\"89779.2\\\",4]]}}", + "x-sdk-method-name": "klines", + "x-topic": "/contractMarket/limitCandle:{symbol}_{type}", + "x-push_frequency": "1s", + "x-response-example": "{\\\"topic\\\":\\\"/contractMarket/limitCandle:XBTUSDTM_1min\\\",\\\"type\\\":\\\"message\\\",\\\"data\\\":{\\\"symbol\\\":\\\"XBTUSDTM\\\",\\\"candles\\\":[\\\"1731898200\\\",\\\"90638.6\\\",\\\"90638.6\\\",\\\"90638.6\\\",\\\"90638.6\\\",\\\"21.0\\\",\\\"21\\\"],\\\"time\\\":1731898208357},\\\"subject\\\":\\\"candle.stick\\\"}", "responses": { "200": { "description": "", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Futures_futures_public_orderbookLevel50" + "$ref": "#/components/schemas/Futures_futures_public_klines" } } } @@ -175,27 +175,27 @@ } } }, - "/klines/contractMarket/limitCandle:_symbol___type_": { + "/execution/contractMarket/execution:_symbol_": { "trace": { - "summary": "Klines", + "summary": "Match execution data.", "deprecated": "false", - "description": "Subscribe to this topic to get K-Line data.", + "description": "For each order executed, the system will send you the match messages in the format as following.", "tags": [], "parameters": [], "x-sdk-service": "Futures", "x-sdk-sub-service": "futures_public", "x-sdk-private": false, - "x-sdk-method-name": "klines", - "x-topic": "/contractMarket/limitCandle:{symbol}_{type}", - "x-push_frequency": "1s", - "x-response-example": "{\\\"topic\\\":\\\"/contractMarket/limitCandle:XBTUSDTM_1min\\\",\\\"type\\\":\\\"message\\\",\\\"data\\\":{\\\"symbol\\\":\\\"XBTUSDTM\\\",\\\"candles\\\":[\\\"1731898200\\\",\\\"90638.6\\\",\\\"90638.6\\\",\\\"90638.6\\\",\\\"90638.6\\\",\\\"21.0\\\",\\\"21\\\"],\\\"time\\\":1731898208357},\\\"subject\\\":\\\"candle.stick\\\"}", + "x-sdk-method-name": "execution", + "x-topic": "/contractMarket/execution:{symbol}", + "x-push_frequency": "realtime", + "x-response-example": "{\\\"topic\\\":\\\"/contractMarket/execution:XBTUSDTM\\\",\\\"type\\\":\\\"message\\\",\\\"subject\\\":\\\"match\\\",\\\"sn\\\":1794100537695,\\\"data\\\":{\\\"symbol\\\":\\\"XBTUSDTM\\\",\\\"sequence\\\":1794100537695,\\\"side\\\":\\\"buy\\\",\\\"size\\\":2,\\\"price\\\":\\\"90503.9\\\",\\\"takerOrderId\\\":\\\"247822202957807616\\\",\\\"makerOrderId\\\":\\\"247822167163555840\\\",\\\"tradeId\\\":\\\"1794100537695\\\",\\\"ts\\\":1731898619520000000}}", "responses": { "200": { "description": "", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Futures_futures_public_klines" + "$ref": "#/components/schemas/Futures_futures_public_matchExecution" } } } @@ -498,7 +498,7 @@ "data" ] }, - "Futures_futures_public_matchExecution": { + "Futures_futures_public_orderbookLevel50": { "type": "object", "properties": { "topic": { @@ -516,46 +516,47 @@ "data": { "type": "object", "properties": { - "symbol": { - "type": "string" + "bids": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "AnyType" + }, + "minItems": 2, + "maxItems": 2 + } }, "sequence": { "type": "integer", "format": "int64" }, - "side": { - "type": "string" - }, - "size": { - "type": "integer" - }, - "price": { - "type": "string" - }, - "takerOrderId": { - "type": "string" - }, - "makerOrderId": { - "type": "string" - }, - "tradeId": { - "type": "string" + "timestamp": { + "type": "integer", + "format": "int64" }, "ts": { "type": "integer", "format": "int64" + }, + "asks": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "AnyType" + }, + "minItems": 2, + "maxItems": 2 + } } }, "required": [ - "symbol", + "bids", "sequence", - "side", - "size", - "price", - "takerOrderId", - "makerOrderId", - "tradeId", - "ts" + "timestamp", + "ts", + "asks" ] } }, @@ -613,7 +614,7 @@ "data" ] }, - "Futures_futures_public_orderbookLevel50": { + "Futures_futures_public_klines": { "type": "object", "properties": { "topic": { @@ -622,68 +623,44 @@ "type": { "type": "string" }, - "subject": { - "type": "string" - }, - "sn": { - "type": "integer" - }, "data": { "type": "object", "properties": { - "bids": { + "symbol": { + "type": "string", + "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) " + }, + "candles": { "type": "array", "items": { - "type": "array", - "items": { - "type": "AnyType" - }, - "minItems": 2, - "maxItems": 2 - } - }, - "sequence": { - "type": "integer", - "format": "int64" - }, - "timestamp": { - "type": "integer", - "format": "int64" + "type": "string" + }, + "description": "Start time, open price, close price, high price, low price, Transaction volume(This value is incorrect, please do not use it, we will fix it in subsequent versions), Transaction amount" }, - "ts": { + "time": { "type": "integer", + "description": "timestamp(ms)", "format": "int64" - }, - "asks": { - "type": "array", - "items": { - "type": "array", - "items": { - "type": "AnyType" - }, - "minItems": 2, - "maxItems": 2 - } } }, "required": [ - "bids", - "sequence", - "timestamp", - "ts", - "asks" + "symbol", + "candles", + "time" ] + }, + "subject": { + "type": "string" } }, "required": [ "topic", "type", - "subject", - "sn", - "data" + "data", + "subject" ] }, - "Futures_futures_public_klines": { + "Futures_futures_public_matchExecution": { "type": "object", "properties": { "topic": { @@ -692,41 +669,64 @@ "type": { "type": "string" }, + "subject": { + "type": "string" + }, + "sn": { + "type": "integer" + }, "data": { "type": "object", "properties": { "symbol": { - "type": "string", - "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) " + "type": "string" }, - "candles": { - "type": "array", - "items": { - "type": "string" - }, - "description": "Start time, open price, close price, high price, low price, Transaction volume(This value is incorrect, please do not use it, we will fix it in subsequent versions), Transaction amount" + "sequence": { + "type": "integer", + "format": "int64" }, - "time": { + "side": { + "type": "string" + }, + "size": { + "type": "integer" + }, + "price": { + "type": "string" + }, + "takerOrderId": { + "type": "string" + }, + "makerOrderId": { + "type": "string" + }, + "tradeId": { + "type": "string" + }, + "ts": { "type": "integer", - "description": "timestamp(ms)", "format": "int64" } }, "required": [ "symbol", - "candles", - "time" + "sequence", + "side", + "size", + "price", + "takerOrderId", + "makerOrderId", + "tradeId", + "ts" ] - }, - "subject": { - "type": "string" } }, "required": [ "topic", "type", - "data", - "subject" + "subject", + "sn", + "data" ] }, "Futures_futures_public_instrument": { diff --git a/spec/ws/openapi-spot-public.json b/spec/ws/openapi-spot-public.json index 56424f00..100d831f 100644 --- a/spec/ws/openapi-spot-public.json +++ b/spec/ws/openapi-spot-public.json @@ -35,27 +35,27 @@ } } }, - "/symbolSnapshot/market/snapshot:_symbol_": { + "/allTickers/market/ticker:all": { "trace": { - "summary": "Symbol Snapshot", + "summary": "Get All Tickers", "deprecated": "false", - "description": "Subscribe to get snapshot data for a single symbol.", + "description": "Subscribe to this topic to get the push of all market symbols BBO change.", "tags": [], "parameters": [], "x-sdk-service": "Spot", "x-sdk-sub-service": "spot_public", "x-sdk-private": false, - "x-sdk-method-name": "symbolSnapshot", - "x-topic": "/market/snapshot:{symbol}", - "x-push_frequency": "once every 2s", - "x-response-example": "{\\\"topic\\\":\\\"/market/snapshot:BTC-USDT\\\",\\\"type\\\":\\\"message\\\",\\\"subject\\\":\\\"trade.snapshot\\\",\\\"data\\\":{\\\"sequence\\\":\\\"14691517895\\\",\\\"data\\\":{\\\"askSize\\\":1.15955795,\\\"averagePrice\\\":66867.89967612,\\\"baseCurrency\\\":\\\"BTC\\\",\\\"bidSize\\\":0.81772627,\\\"board\\\":1,\\\"buy\\\":67158.1,\\\"changePrice\\\":315.20000000000000000000,\\\"changeRate\\\":0.0047,\\\"close\\\":67158.1,\\\"datetime\\\":1729758286011,\\\"high\\\":67611.80000000000000000000,\\\"lastTradedPrice\\\":67158.1,\\\"low\\\":65257.10000000000000000000,\\\"makerCoefficient\\\":1.000000,\\\"makerFeeRate\\\":0.001,\\\"marginTrade\\\":true,\\\"mark\\\":0,\\\"market\\\":\\\"USDS\\\",\\\"marketChange1h\\\":{\\\"changePrice\\\":-102.10000000000000000000,\\\"changeRate\\\":-0.0015,\\\"high\\\":67310.60000000000000000000,\\\"low\\\":67051.80000000000000000000,\\\"open\\\":67260.20000000000000000000,\\\"vol\\\":53.73698081000000000000,\\\"volValue\\\":3609965.13819127700000000000},\\\"marketChange24h\\\":{\\\"changePrice\\\":315.20000000000000000000,\\\"changeRate\\\":0.0047,\\\"high\\\":67611.80000000000000000000,\\\"low\\\":65257.10000000000000000000,\\\"open\\\":66842.90000000000000000000,\\\"vol\\\":2227.69895852000000000000,\\\"volValue\\\":147972941.07857507300000000000},\\\"marketChange4h\\\":{\\\"changePrice\\\":-166.30000000000000000000,\\\"changeRate\\\":-0.0024,\\\"high\\\":67476.60000000000000000000,\\\"low\\\":67051.80000000000000000000,\\\"open\\\":67324.40000000000000000000,\\\"vol\\\":173.76971188000000000000,\\\"volValue\\\":11695949.43841656500000000000},\\\"markets\\\":[\\\"USDS\\\",\\\"PoW\\\"],\\\"open\\\":66842.90000000000000000000,\\\"quoteCurrency\\\":\\\"USDT\\\",\\\"sell\\\":67158.2,\\\"siteTypes\\\":[\\\"turkey\\\",\\\"thailand\\\",\\\"global\\\"],\\\"sort\\\":100,\\\"symbol\\\":\\\"BTC-USDT\\\",\\\"symbolCode\\\":\\\"BTC-USDT\\\",\\\"takerCoefficient\\\":1.000000,\\\"takerFeeRate\\\":0.001,\\\"trading\\\":true,\\\"vol\\\":2227.69895852000000000000,\\\"volValue\\\":147972941.07857507300000000000}}}", + "x-sdk-method-name": "allTickers", + "x-topic": "/market/ticker:all", + "x-push_frequency": "once every 100ms", + "x-response-example": "{\\\"topic\\\":\\\"/market/ticker:all\\\",\\\"type\\\":\\\"message\\\",\\\"subject\\\":\\\"BTC-USDT\\\",\\\"data\\\":{\\\"bestAsk\\\":\\\"67218.7\\\",\\\"bestAskSize\\\":\\\"1.92318539\\\",\\\"bestBid\\\":\\\"67218.6\\\",\\\"bestBidSize\\\":\\\"0.01045638\\\",\\\"price\\\":\\\"67220\\\",\\\"sequence\\\":\\\"14691455768\\\",\\\"size\\\":\\\"0.00004316\\\",\\\"time\\\":1729757723612}}", "responses": { "200": { "description": "", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Spot_spot_public_symbolSnapshot" + "$ref": "#/components/schemas/Spot_spot_public_allTickers" } } } @@ -147,27 +147,27 @@ } } }, - "/klines/market/candles:_symbol___type_": { + "/orderbookIncrement/market/level2:_symbol_,_symbol_": { "trace": { - "summary": "Klines", + "summary": "Orderbook - Increment", "deprecated": "false", - "description": "Subscribe to this topic to get K-Line data.", + "description": "The system will return the increment change orderbook data(All depth), A topic supports up to 100 symbols. If there is no change in the market, data will not be pushed", "tags": [], "parameters": [], "x-sdk-service": "Spot", "x-sdk-sub-service": "spot_public", "x-sdk-private": false, - "x-sdk-method-name": "klines", - "x-topic": "/market/candles:{symbol}_{type}", + "x-sdk-method-name": "orderbookIncrement", + "x-topic": "/market/level2:{symbol},{symbol}", "x-push_frequency": "real-time", - "x-response-example": "{\\\"topic\\\":\\\"/market/candles:BTC-USDT_1hour\\\",\\\"type\\\":\\\"message\\\",\\\"subject\\\":\\\"trade.candles.update\\\",\\\"data\\\":{\\\"symbol\\\":\\\"BTC-USDT\\\",\\\"candles\\\":[\\\"1729839600\\\",\\\"67644.9\\\",\\\"67437.6\\\",\\\"67724.8\\\",\\\"67243.8\\\",\\\"44.88321441\\\",\\\"3027558.991928447\\\"],\\\"time\\\":1729842192785164840}}", + "x-response-example": "{\\\"topic\\\":\\\"/market/level2:BTC-USDT\\\",\\\"type\\\":\\\"message\\\",\\\"subject\\\":\\\"trade.l2update\\\",\\\"data\\\":{\\\"changes\\\":{\\\"asks\\\":[[\\\"67993.3\\\",\\\"1.21427407\\\",\\\"14701689783\\\"]],\\\"bids\\\":[]},\\\"sequenceEnd\\\":14701689783,\\\"sequenceStart\\\":14701689783,\\\"symbol\\\":\\\"BTC-USDT\\\",\\\"time\\\":1729816425625}}", "responses": { "200": { "description": "", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Spot_spot_public_klines" + "$ref": "#/components/schemas/Spot_spot_public_orderbookIncrement" } } } @@ -175,27 +175,27 @@ } } }, - "/allTickers/market/ticker:all": { + "/klines/market/candles:_symbol___type_": { "trace": { - "summary": "Get All Tickers", + "summary": "Klines", "deprecated": "false", - "description": "Subscribe to this topic to get the push of all market symbols BBO change.", + "description": "Subscribe to this topic to get K-Line data.", "tags": [], "parameters": [], "x-sdk-service": "Spot", "x-sdk-sub-service": "spot_public", "x-sdk-private": false, - "x-sdk-method-name": "allTickers", - "x-topic": "/market/ticker:all", - "x-push_frequency": "once every 100ms", - "x-response-example": "{\\\"topic\\\":\\\"/market/ticker:all\\\",\\\"type\\\":\\\"message\\\",\\\"subject\\\":\\\"BTC-USDT\\\",\\\"data\\\":{\\\"bestAsk\\\":\\\"67218.7\\\",\\\"bestAskSize\\\":\\\"1.92318539\\\",\\\"bestBid\\\":\\\"67218.6\\\",\\\"bestBidSize\\\":\\\"0.01045638\\\",\\\"price\\\":\\\"67220\\\",\\\"sequence\\\":\\\"14691455768\\\",\\\"size\\\":\\\"0.00004316\\\",\\\"time\\\":1729757723612}}", + "x-sdk-method-name": "klines", + "x-topic": "/market/candles:{symbol}_{type}", + "x-push_frequency": "real-time", + "x-response-example": "{\\\"topic\\\":\\\"/market/candles:BTC-USDT_1hour\\\",\\\"type\\\":\\\"message\\\",\\\"subject\\\":\\\"trade.candles.update\\\",\\\"data\\\":{\\\"symbol\\\":\\\"BTC-USDT\\\",\\\"candles\\\":[\\\"1729839600\\\",\\\"67644.9\\\",\\\"67437.6\\\",\\\"67724.8\\\",\\\"67243.8\\\",\\\"44.88321441\\\",\\\"3027558.991928447\\\"],\\\"time\\\":1729842192785164840}}", "responses": { "200": { "description": "", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Spot_spot_public_allTickers" + "$ref": "#/components/schemas/Spot_spot_public_klines" } } } @@ -203,27 +203,27 @@ } } }, - "/marketSnapshot/market/snapshot:_market_": { + "/trade/market/match:_symbol_,_symbol_": { "trace": { - "summary": "Market Snapshot", + "summary": "Trade", "deprecated": "false", - "description": "Subscribe this topic to get the snapshot data of for the entire market.", + "description": "Subscribe to this topic to get the matching event data flow of Level 3. A topic supports up to 100 symbols.", "tags": [], "parameters": [], "x-sdk-service": "Spot", "x-sdk-sub-service": "spot_public", "x-sdk-private": false, - "x-sdk-method-name": "marketSnapshot", - "x-topic": "/market/snapshot:{market}", - "x-push_frequency": "once every 2s", - "x-response-example": "{\\\"topic\\\":\\\"/market/snapshot:BTC\\\",\\\"type\\\":\\\"message\\\",\\\"subject\\\":\\\"trade.snapshot\\\",\\\"data\\\":{\\\"sequence\\\":\\\"1729785948015\\\",\\\"data\\\":{\\\"askSize\\\":1375.1096,\\\"averagePrice\\\":0.00000262,\\\"baseCurrency\\\":\\\"CHR\\\",\\\"bidSize\\\":152.0912,\\\"board\\\":0,\\\"buy\\\":0.00000263,\\\"changePrice\\\":0.00000005300000000000,\\\"changeRate\\\":0.0200,\\\"close\\\":0.000002698,\\\"datetime\\\":1729785948008,\\\"high\\\":0.00000274600000000000,\\\"lastTradedPrice\\\":0.000002698,\\\"low\\\":0.00000255800000000000,\\\"makerCoefficient\\\":1.000000,\\\"makerFeeRate\\\":0.001,\\\"marginTrade\\\":false,\\\"mark\\\":0,\\\"market\\\":\\\"BTC\\\",\\\"marketChange1h\\\":{\\\"changePrice\\\":-0.00000000900000000000,\\\"changeRate\\\":-0.0033,\\\"high\\\":0.00000270700000000000,\\\"low\\\":0.00000264200000000000,\\\"open\\\":0.00000270700000000000,\\\"vol\\\":27.10350000000000000000,\\\"volValue\\\":0.00007185015660000000},\\\"marketChange24h\\\":{\\\"changePrice\\\":0.00000005300000000000,\\\"changeRate\\\":0.0200,\\\"high\\\":0.00000274600000000000,\\\"low\\\":0.00000255800000000000,\\\"open\\\":0.00000264500000000000,\\\"vol\\\":6824.94800000000000000000,\\\"volValue\\\":0.01789509649520000000},\\\"marketChange4h\\\":{\\\"changePrice\\\":0.00000000600000000000,\\\"changeRate\\\":0.0022,\\\"high\\\":0.00000270700000000000,\\\"low\\\":0.00000264200000000000,\\\"open\\\":0.00000269200000000000,\\\"vol\\\":92.69020000000000000000,\\\"volValue\\\":0.00024903875740000000},\\\"markets\\\":[\\\"BTC\\\",\\\"DePIN\\\",\\\"Layer 1\\\"],\\\"open\\\":0.00000264500000000000,\\\"quoteCurrency\\\":\\\"BTC\\\",\\\"sell\\\":0.000002695,\\\"siteTypes\\\":[\\\"global\\\"],\\\"sort\\\":100,\\\"symbol\\\":\\\"CHR-BTC\\\",\\\"symbolCode\\\":\\\"CHR-BTC\\\",\\\"takerCoefficient\\\":1.000000,\\\"takerFeeRate\\\":0.001,\\\"trading\\\":true,\\\"vol\\\":6824.94800000000000000000,\\\"volValue\\\":0.01789509649520000000}}}", + "x-sdk-method-name": "trade", + "x-topic": "/market/match:{symbol},{symbol}", + "x-push_frequency": "real-time", + "x-response-example": "{\\\"topic\\\":\\\"/market/match:BTC-USDT\\\",\\\"type\\\":\\\"message\\\",\\\"subject\\\":\\\"trade.l3match\\\",\\\"data\\\":{\\\"makerOrderId\\\":\\\"671b5007389355000701b1d3\\\",\\\"price\\\":\\\"67523\\\",\\\"sequence\\\":\\\"11067996711960577\\\",\\\"side\\\":\\\"buy\\\",\\\"size\\\":\\\"0.003\\\",\\\"symbol\\\":\\\"BTC-USDT\\\",\\\"takerOrderId\\\":\\\"671b50161777ff00074c168d\\\",\\\"time\\\":\\\"1729843222921000000\\\",\\\"tradeId\\\":\\\"11067996711960577\\\",\\\"type\\\":\\\"match\\\"}}", "responses": { "200": { "description": "", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Spot_spot_public_marketSnapshot" + "$ref": "#/components/schemas/Spot_spot_public_trade" } } } @@ -231,27 +231,27 @@ } } }, - "/trade/market/match:_symbol_,_symbol_": { + "/symbolSnapshot/market/snapshot:_symbol_": { "trace": { - "summary": "Trade", + "summary": "Symbol Snapshot", "deprecated": "false", - "description": "Subscribe to this topic to get the matching event data flow of Level 3. A topic supports up to 100 symbols.", + "description": "Subscribe to get snapshot data for a single symbol.", "tags": [], "parameters": [], "x-sdk-service": "Spot", "x-sdk-sub-service": "spot_public", "x-sdk-private": false, - "x-sdk-method-name": "trade", - "x-topic": "/market/match:{symbol},{symbol}", - "x-push_frequency": "real-time", - "x-response-example": "{\\\"topic\\\":\\\"/market/match:BTC-USDT\\\",\\\"type\\\":\\\"message\\\",\\\"subject\\\":\\\"trade.l3match\\\",\\\"data\\\":{\\\"makerOrderId\\\":\\\"671b5007389355000701b1d3\\\",\\\"price\\\":\\\"67523\\\",\\\"sequence\\\":\\\"11067996711960577\\\",\\\"side\\\":\\\"buy\\\",\\\"size\\\":\\\"0.003\\\",\\\"symbol\\\":\\\"BTC-USDT\\\",\\\"takerOrderId\\\":\\\"671b50161777ff00074c168d\\\",\\\"time\\\":\\\"1729843222921000000\\\",\\\"tradeId\\\":\\\"11067996711960577\\\",\\\"type\\\":\\\"match\\\"}}", + "x-sdk-method-name": "symbolSnapshot", + "x-topic": "/market/snapshot:{symbol}", + "x-push_frequency": "once every 2s", + "x-response-example": "{\\\"topic\\\":\\\"/market/snapshot:BTC-USDT\\\",\\\"type\\\":\\\"message\\\",\\\"subject\\\":\\\"trade.snapshot\\\",\\\"data\\\":{\\\"sequence\\\":\\\"14691517895\\\",\\\"data\\\":{\\\"askSize\\\":1.15955795,\\\"averagePrice\\\":66867.89967612,\\\"baseCurrency\\\":\\\"BTC\\\",\\\"bidSize\\\":0.81772627,\\\"board\\\":1,\\\"buy\\\":67158.1,\\\"changePrice\\\":315.20000000000000000000,\\\"changeRate\\\":0.0047,\\\"close\\\":67158.1,\\\"datetime\\\":1729758286011,\\\"high\\\":67611.80000000000000000000,\\\"lastTradedPrice\\\":67158.1,\\\"low\\\":65257.10000000000000000000,\\\"makerCoefficient\\\":1.000000,\\\"makerFeeRate\\\":0.001,\\\"marginTrade\\\":true,\\\"mark\\\":0,\\\"market\\\":\\\"USDS\\\",\\\"marketChange1h\\\":{\\\"changePrice\\\":-102.10000000000000000000,\\\"changeRate\\\":-0.0015,\\\"high\\\":67310.60000000000000000000,\\\"low\\\":67051.80000000000000000000,\\\"open\\\":67260.20000000000000000000,\\\"vol\\\":53.73698081000000000000,\\\"volValue\\\":3609965.13819127700000000000},\\\"marketChange24h\\\":{\\\"changePrice\\\":315.20000000000000000000,\\\"changeRate\\\":0.0047,\\\"high\\\":67611.80000000000000000000,\\\"low\\\":65257.10000000000000000000,\\\"open\\\":66842.90000000000000000000,\\\"vol\\\":2227.69895852000000000000,\\\"volValue\\\":147972941.07857507300000000000},\\\"marketChange4h\\\":{\\\"changePrice\\\":-166.30000000000000000000,\\\"changeRate\\\":-0.0024,\\\"high\\\":67476.60000000000000000000,\\\"low\\\":67051.80000000000000000000,\\\"open\\\":67324.40000000000000000000,\\\"vol\\\":173.76971188000000000000,\\\"volValue\\\":11695949.43841656500000000000},\\\"markets\\\":[\\\"USDS\\\",\\\"PoW\\\"],\\\"open\\\":66842.90000000000000000000,\\\"quoteCurrency\\\":\\\"USDT\\\",\\\"sell\\\":67158.2,\\\"siteTypes\\\":[\\\"turkey\\\",\\\"thailand\\\",\\\"global\\\"],\\\"sort\\\":100,\\\"symbol\\\":\\\"BTC-USDT\\\",\\\"symbolCode\\\":\\\"BTC-USDT\\\",\\\"takerCoefficient\\\":1.000000,\\\"takerFeeRate\\\":0.001,\\\"trading\\\":true,\\\"vol\\\":2227.69895852000000000000,\\\"volValue\\\":147972941.07857507300000000000}}}", "responses": { "200": { "description": "", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Spot_spot_public_trade" + "$ref": "#/components/schemas/Spot_spot_public_symbolSnapshot" } } } @@ -259,27 +259,27 @@ } } }, - "/orderbookIncrement/market/level2:_symbol_,_symbol_": { + "/marketSnapshot/market/snapshot:_market_": { "trace": { - "summary": "Orderbook - Increment", + "summary": "Market Snapshot", "deprecated": "false", - "description": "The system will return the increment change orderbook data(All depth), A topic supports up to 100 symbols. If there is no change in the market, data will not be pushed", + "description": "Subscribe this topic to get the snapshot data of for the entire market.", "tags": [], "parameters": [], "x-sdk-service": "Spot", "x-sdk-sub-service": "spot_public", "x-sdk-private": false, - "x-sdk-method-name": "orderbookIncrement", - "x-topic": "/market/level2:{symbol},{symbol}", - "x-push_frequency": "real-time", - "x-response-example": "{\\\"topic\\\":\\\"/market/level2:BTC-USDT\\\",\\\"type\\\":\\\"message\\\",\\\"subject\\\":\\\"trade.l2update\\\",\\\"data\\\":{\\\"changes\\\":{\\\"asks\\\":[[\\\"67993.3\\\",\\\"1.21427407\\\",\\\"14701689783\\\"]],\\\"bids\\\":[]},\\\"sequenceEnd\\\":14701689783,\\\"sequenceStart\\\":14701689783,\\\"symbol\\\":\\\"BTC-USDT\\\",\\\"time\\\":1729816425625}}", + "x-sdk-method-name": "marketSnapshot", + "x-topic": "/market/snapshot:{market}", + "x-push_frequency": "once every 2s", + "x-response-example": "{\\\"topic\\\":\\\"/market/snapshot:BTC\\\",\\\"type\\\":\\\"message\\\",\\\"subject\\\":\\\"trade.snapshot\\\",\\\"data\\\":{\\\"sequence\\\":\\\"1729785948015\\\",\\\"data\\\":{\\\"askSize\\\":1375.1096,\\\"averagePrice\\\":0.00000262,\\\"baseCurrency\\\":\\\"CHR\\\",\\\"bidSize\\\":152.0912,\\\"board\\\":0,\\\"buy\\\":0.00000263,\\\"changePrice\\\":0.00000005300000000000,\\\"changeRate\\\":0.0200,\\\"close\\\":0.000002698,\\\"datetime\\\":1729785948008,\\\"high\\\":0.00000274600000000000,\\\"lastTradedPrice\\\":0.000002698,\\\"low\\\":0.00000255800000000000,\\\"makerCoefficient\\\":1.000000,\\\"makerFeeRate\\\":0.001,\\\"marginTrade\\\":false,\\\"mark\\\":0,\\\"market\\\":\\\"BTC\\\",\\\"marketChange1h\\\":{\\\"changePrice\\\":-0.00000000900000000000,\\\"changeRate\\\":-0.0033,\\\"high\\\":0.00000270700000000000,\\\"low\\\":0.00000264200000000000,\\\"open\\\":0.00000270700000000000,\\\"vol\\\":27.10350000000000000000,\\\"volValue\\\":0.00007185015660000000},\\\"marketChange24h\\\":{\\\"changePrice\\\":0.00000005300000000000,\\\"changeRate\\\":0.0200,\\\"high\\\":0.00000274600000000000,\\\"low\\\":0.00000255800000000000,\\\"open\\\":0.00000264500000000000,\\\"vol\\\":6824.94800000000000000000,\\\"volValue\\\":0.01789509649520000000},\\\"marketChange4h\\\":{\\\"changePrice\\\":0.00000000600000000000,\\\"changeRate\\\":0.0022,\\\"high\\\":0.00000270700000000000,\\\"low\\\":0.00000264200000000000,\\\"open\\\":0.00000269200000000000,\\\"vol\\\":92.69020000000000000000,\\\"volValue\\\":0.00024903875740000000},\\\"markets\\\":[\\\"BTC\\\",\\\"DePIN\\\",\\\"Layer 1\\\"],\\\"open\\\":0.00000264500000000000,\\\"quoteCurrency\\\":\\\"BTC\\\",\\\"sell\\\":0.000002695,\\\"siteTypes\\\":[\\\"global\\\"],\\\"sort\\\":100,\\\"symbol\\\":\\\"CHR-BTC\\\",\\\"symbolCode\\\":\\\"CHR-BTC\\\",\\\"takerCoefficient\\\":1.000000,\\\"takerFeeRate\\\":0.001,\\\"trading\\\":true,\\\"vol\\\":6824.94800000000000000000,\\\"volValue\\\":0.01789509649520000000}}}", "responses": { "200": { "description": "", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Spot_spot_public_orderbookIncrement" + "$ref": "#/components/schemas/Spot_spot_public_marketSnapshot" } } } @@ -359,7 +359,7 @@ ], "x-apidog-refs": {} }, - "Spot_spot_public_symbolSnapshot": { + "Spot_spot_public_allTickers": { "type": "object", "properties": { "topic": { @@ -374,10 +374,434 @@ "data": { "type": "object", "properties": { + "bestAsk": { + "type": "string" + }, + "bestAskSize": { + "type": "string" + }, + "bestBid": { + "type": "string" + }, + "bestBidSize": { + "type": "string" + }, + "price": { + "type": "string" + }, "sequence": { "type": "string" }, - "data": { + "size": { + "type": "string" + }, + "time": { + "type": "integer", + "description": "The matching time of the latest transaction", + "format": "int64" + } + }, + "required": [ + "bestAsk", + "bestAskSize", + "bestBid", + "bestBidSize", + "price", + "sequence", + "size", + "time" + ] + } + }, + "required": [ + "topic", + "type", + "subject", + "data" + ] + }, + "Spot_spot_public_orderbookLevel1": { + "type": "object", + "properties": { + "topic": { + "type": "string" + }, + "type": { + "type": "string" + }, + "subject": { + "type": "string" + }, + "data": { + "type": "object", + "properties": { + "asks": { + "type": "array", + "items": { + "type": "string" + }, + "description": "price, size" + }, + "bids": { + "type": "array", + "items": { + "type": "string" + } + }, + "timestamp": { + "type": "integer", + "format": "int64" + } + }, + "required": [ + "asks", + "bids", + "timestamp" + ] + } + }, + "required": [ + "topic", + "type", + "subject", + "data" + ] + }, + "Spot_spot_public_orderbookLevel5": { + "type": "object", + "properties": { + "topic": { + "type": "string" + }, + "type": { + "type": "string" + }, + "subject": { + "type": "string" + }, + "data": { + "type": "object", + "properties": { + "asks": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "string" + } + }, + "description": "price, size" + }, + "bids": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "timestamp": { + "type": "integer", + "format": "int64" + } + }, + "required": [ + "asks", + "bids", + "timestamp" + ] + } + }, + "required": [ + "topic", + "type", + "subject", + "data" + ] + }, + "Spot_spot_public_orderbookLevel50": { + "type": "object", + "properties": { + "type": { + "type": "string" + }, + "topic": { + "type": "string" + }, + "subject": { + "type": "string" + }, + "data": { + "type": "object", + "properties": { + "changes": { + "type": "object", + "properties": { + "asks": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "bids": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "required": [ + "asks", + "bids" + ] + }, + "sequenceEnd": { + "type": "integer", + "format": "int64" + }, + "sequenceStart": { + "type": "integer", + "format": "int64" + }, + "symbol": { + "type": "string" + }, + "time": { + "type": "integer", + "format": "int64" + } + }, + "required": [ + "changes", + "sequenceEnd", + "sequenceStart", + "symbol", + "time" + ] + } + }, + "required": [ + "type", + "topic", + "subject", + "data" + ] + }, + "Spot_spot_public_orderbookIncrement": { + "type": "object", + "properties": { + "topic": { + "type": "string" + }, + "type": { + "type": "string" + }, + "subject": { + "type": "string" + }, + "data": { + "type": "object", + "properties": { + "changes": { + "type": "object", + "properties": { + "asks": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "string" + } + }, + "description": "price,size,sequence" + }, + "bids": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "required": [ + "asks", + "bids" + ] + }, + "sequenceEnd": { + "type": "integer", + "format": "int64" + }, + "sequenceStart": { + "type": "integer", + "format": "int64" + }, + "symbol": { + "type": "string" + }, + "time": { + "type": "integer", + "description": "milliseconds", + "format": "int64" + } + }, + "required": [ + "changes", + "sequenceEnd", + "sequenceStart", + "symbol", + "time" + ] + } + }, + "required": [ + "topic", + "type", + "subject", + "data" + ] + }, + "Spot_spot_public_klines": { + "type": "object", + "properties": { + "topic": { + "type": "string" + }, + "type": { + "type": "string" + }, + "subject": { + "type": "string" + }, + "data": { + "type": "object", + "properties": { + "symbol": { + "type": "string", + "description": "symbol" + }, + "candles": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Start time of the candle cycle,open price,close price, high price,low price,Transaction volume,Transaction amount" + }, + "time": { + "type": "integer", + "description": "now(us)", + "format": "int64" + } + }, + "required": [ + "symbol", + "candles", + "time" + ] + } + }, + "required": [ + "topic", + "type", + "subject", + "data" + ] + }, + "Spot_spot_public_trade": { + "type": "object", + "properties": { + "topic": { + "type": "string" + }, + "type": { + "type": "string" + }, + "subject": { + "type": "string" + }, + "data": { + "type": "object", + "properties": { + "makerOrderId": { + "type": "string" + }, + "price": { + "type": "string" + }, + "sequence": { + "type": "string" + }, + "side": { + "type": "string" + }, + "size": { + "type": "string" + }, + "symbol": { + "type": "string" + }, + "takerOrderId": { + "type": "string" + }, + "time": { + "type": "string" + }, + "tradeId": { + "type": "string" + }, + "type": { + "type": "string" + } + }, + "required": [ + "makerOrderId", + "price", + "sequence", + "side", + "size", + "symbol", + "takerOrderId", + "time", + "tradeId", + "type" + ] + } + }, + "required": [ + "topic", + "type", + "subject", + "data" + ] + }, + "Spot_spot_public_symbolSnapshot": { + "type": "object", + "properties": { + "topic": { + "type": "string" + }, + "type": { + "type": "string" + }, + "subject": { + "type": "string" + }, + "data": { + "type": "object", + "properties": { + "sequence": { + "type": "string" + }, + "data": { "type": "object", "properties": { "askSize": { @@ -620,336 +1044,55 @@ "trading": { "type": "boolean" }, - "vol": { - "type": "number" - }, - "volValue": { - "type": "number", - "description": "24-hour rolling transaction volume, refreshed every 2s" - } - }, - "required": [ - "askSize", - "averagePrice", - "baseCurrency", - "bidSize", - "board", - "buy", - "changePrice", - "changeRate", - "close", - "datetime", - "high", - "lastTradedPrice", - "low", - "makerCoefficient", - "makerFeeRate", - "marginTrade", - "mark", - "market", - "marketChange1h", - "marketChange24h", - "marketChange4h", - "markets", - "open", - "quoteCurrency", - "sell", - "siteTypes", - "sort", - "symbol", - "symbolCode", - "takerCoefficient", - "takerFeeRate", - "trading", - "vol", - "volValue" - ] - } - }, - "required": [ - "sequence", - "data" - ] - } - }, - "required": [ - "topic", - "type", - "subject", - "data" - ] - }, - "Spot_spot_public_orderbookLevel1": { - "type": "object", - "properties": { - "topic": { - "type": "string" - }, - "type": { - "type": "string" - }, - "subject": { - "type": "string" - }, - "data": { - "type": "object", - "properties": { - "asks": { - "type": "array", - "items": { - "type": "string" - }, - "description": "price, size" - }, - "bids": { - "type": "array", - "items": { - "type": "string" - } - }, - "timestamp": { - "type": "integer", - "format": "int64" - } - }, - "required": [ - "asks", - "bids", - "timestamp" - ] - } - }, - "required": [ - "topic", - "type", - "subject", - "data" - ] - }, - "Spot_spot_public_orderbookLevel5": { - "type": "object", - "properties": { - "topic": { - "type": "string" - }, - "type": { - "type": "string" - }, - "subject": { - "type": "string" - }, - "data": { - "type": "object", - "properties": { - "asks": { - "type": "array", - "items": { - "type": "array", - "items": { - "type": "string" - } - }, - "description": "price, size" - }, - "bids": { - "type": "array", - "items": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "timestamp": { - "type": "integer", - "format": "int64" - } - }, - "required": [ - "asks", - "bids", - "timestamp" - ] - } - }, - "required": [ - "topic", - "type", - "subject", - "data" - ] - }, - "Spot_spot_public_orderbookLevel50": { - "type": "object", - "properties": { - "type": { - "type": "string" - }, - "topic": { - "type": "string" - }, - "subject": { - "type": "string" - }, - "data": { - "type": "object", - "properties": { - "changes": { - "type": "object", - "properties": { - "asks": { - "type": "array", - "items": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "bids": { - "type": "array", - "items": { - "type": "array", - "items": { - "type": "string" - } - } - } - }, - "required": [ - "asks", - "bids" - ] - }, - "sequenceEnd": { - "type": "integer", - "format": "int64" - }, - "sequenceStart": { - "type": "integer", - "format": "int64" - }, - "symbol": { - "type": "string" - }, - "time": { - "type": "integer", - "format": "int64" - } - }, - "required": [ - "changes", - "sequenceEnd", - "sequenceStart", - "symbol", - "time" - ] - } - }, - "required": [ - "type", - "topic", - "subject", - "data" - ] - }, - "Spot_spot_public_klines": { - "type": "object", - "properties": { - "topic": { - "type": "string" - }, - "type": { - "type": "string" - }, - "subject": { - "type": "string" - }, - "data": { - "type": "object", - "properties": { - "symbol": { - "type": "string", - "description": "symbol" - }, - "candles": { - "type": "array", - "items": { - "type": "string" + "vol": { + "type": "number" + }, + "volValue": { + "type": "number", + "description": "24-hour rolling transaction volume, refreshed every 2s" + } }, - "description": "Start time of the candle cycle,open price,close price, high price,low price,Transaction volume,Transaction amount" - }, - "time": { - "type": "integer", - "description": "now(us)", - "format": "int64" - } - }, - "required": [ - "symbol", - "candles", - "time" - ] - } - }, - "required": [ - "topic", - "type", - "subject", - "data" - ] - }, - "Spot_spot_public_allTickers": { - "type": "object", - "properties": { - "topic": { - "type": "string" - }, - "type": { - "type": "string" - }, - "subject": { - "type": "string" - }, - "data": { - "type": "object", - "properties": { - "bestAsk": { - "type": "string" - }, - "bestAskSize": { - "type": "string" - }, - "bestBid": { - "type": "string" - }, - "bestBidSize": { - "type": "string" - }, - "price": { - "type": "string" - }, - "sequence": { - "type": "string" - }, - "size": { - "type": "string" - }, - "time": { - "type": "integer", - "description": "The matching time of the latest transaction", - "format": "int64" + "required": [ + "askSize", + "averagePrice", + "baseCurrency", + "bidSize", + "board", + "buy", + "changePrice", + "changeRate", + "close", + "datetime", + "high", + "lastTradedPrice", + "low", + "makerCoefficient", + "makerFeeRate", + "marginTrade", + "mark", + "market", + "marketChange1h", + "marketChange24h", + "marketChange4h", + "markets", + "open", + "quoteCurrency", + "sell", + "siteTypes", + "sort", + "symbol", + "symbolCode", + "takerCoefficient", + "takerFeeRate", + "trading", + "vol", + "volValue" + ] } }, "required": [ - "bestAsk", - "bestAskSize", - "bestBid", - "bestBidSize", - "price", "sequence", - "size", - "time" + "data" ] } }, @@ -1284,149 +1427,6 @@ "subject", "data" ] - }, - "Spot_spot_public_trade": { - "type": "object", - "properties": { - "topic": { - "type": "string" - }, - "type": { - "type": "string" - }, - "subject": { - "type": "string" - }, - "data": { - "type": "object", - "properties": { - "makerOrderId": { - "type": "string" - }, - "price": { - "type": "string" - }, - "sequence": { - "type": "string" - }, - "side": { - "type": "string" - }, - "size": { - "type": "string" - }, - "symbol": { - "type": "string" - }, - "takerOrderId": { - "type": "string" - }, - "time": { - "type": "string" - }, - "tradeId": { - "type": "string" - }, - "type": { - "type": "string" - } - }, - "required": [ - "makerOrderId", - "price", - "sequence", - "side", - "size", - "symbol", - "takerOrderId", - "time", - "tradeId", - "type" - ] - } - }, - "required": [ - "topic", - "type", - "subject", - "data" - ] - }, - "Spot_spot_public_orderbookIncrement": { - "type": "object", - "properties": { - "topic": { - "type": "string" - }, - "type": { - "type": "string" - }, - "subject": { - "type": "string" - }, - "data": { - "type": "object", - "properties": { - "changes": { - "type": "object", - "properties": { - "asks": { - "type": "array", - "items": { - "type": "array", - "items": { - "type": "string" - } - }, - "description": "price,size,sequence" - }, - "bids": { - "type": "array", - "items": { - "type": "array", - "items": { - "type": "string" - } - } - } - }, - "required": [ - "asks", - "bids" - ] - }, - "sequenceEnd": { - "type": "integer", - "format": "int64" - }, - "sequenceStart": { - "type": "integer", - "format": "int64" - }, - "symbol": { - "type": "string" - }, - "time": { - "type": "integer", - "description": "milliseconds", - "format": "int64" - } - }, - "required": [ - "changes", - "sequenceEnd", - "sequenceStart", - "symbol", - "time" - ] - } - }, - "required": [ - "topic", - "type", - "subject", - "data" - ] } } } From d919d4987b4960078d9bc476d69274e500427b8b Mon Sep 17 00:00:00 2001 From: "Isaac.Tang" Date: Wed, 15 Jan 2025 14:39:35 +0800 Subject: [PATCH 2/6] feat(sdk): Keep the order of all APIs consistent with the documentation --- generator/preprocessor/api_meta.py | 8 +- .../generate/account/account/api_account.go | 284 ++--- .../account/account/api_account.template | 202 +-- .../account/account/api_account_test.go | 360 +++--- .../generate/account/deposit/api_deposit.go | 94 +- .../account/deposit/api_deposit.template | 84 +- .../account/deposit/api_deposit_test.go | 144 +-- .../account/subaccount/api_sub_account.go | 226 ++-- .../subaccount/api_sub_account.template | 178 +-- .../subaccount/api_sub_account_test.go | 302 ++--- .../generate/account/transfer/api_transfer.go | 122 +- .../account/transfer/api_transfer.template | 70 +- .../account/transfer/api_transfer_test.go | 120 +- .../account/withdrawal/api_withdrawal.go | 94 +- .../withdrawal/api_withdrawal.template | 84 +- .../account/withdrawal/api_withdrawal_test.go | 144 +-- .../generate/broker/ndbroker/api_nd_broker.go | 164 +-- .../broker/ndbroker/api_nd_broker.template | 154 +-- .../broker/ndbroker/api_nd_broker_test.go | 264 ++-- sdk/golang/pkg/generate/earn/earn/api_earn.go | 132 +- .../pkg/generate/earn/earn/api_earn.template | 122 +- .../pkg/generate/earn/earn/api_earn_test.go | 196 +-- .../futures/fundingfees/api_funding_fees.go | 40 +- .../fundingfees/api_funding_fees.template | 42 +- .../fundingfees/api_funding_fees_test.go | 56 +- .../pkg/generate/futures/market/api_market.go | 246 ++-- .../futures/market/api_market.template | 184 +-- .../futures/market/api_market_test.go | 344 ++--- .../pkg/generate/futures/order/api_order.go | 242 ++-- .../generate/futures/order/api_order.template | 206 +-- .../generate/futures/order/api_order_test.go | 354 +++--- .../futures/positions/api_positions.go | 214 ++-- .../futures/positions/api_positions.template | 194 +-- .../futures/positions/api_positions_test.go | 318 ++--- .../pkg/generate/margin/credit/api_credit.go | 88 +- .../margin/credit/api_credit.template | 88 +- .../generate/margin/credit/api_credit_test.go | 128 +- .../pkg/generate/margin/debit/api_debit.go | 60 +- .../generate/margin/debit/api_debit.template | 52 +- .../generate/margin/debit/api_debit_test.go | 88 +- .../pkg/generate/margin/market/api_market.go | 78 +- .../margin/market/api_market.template | 62 +- .../generate/margin/market/api_market_test.go | 118 +- .../pkg/generate/margin/order/api_order.go | 190 +-- .../generate/margin/order/api_order.template | 168 +-- .../generate/margin/order/api_order_test.go | 288 ++--- .../pkg/generate/spot/market/api_market.go | 286 ++--- .../generate/spot/market/api_market.template | 218 ++-- .../generate/spot/market/api_market_test.go | 408 +++--- .../pkg/generate/spot/order/api_order.go | 780 ++++++------ .../generate/spot/order/api_order.template | 664 +++++----- .../pkg/generate/spot/order/api_order_test.go | 1128 ++++++++--------- .../viplending/viplending/api_vip_lending.go | 28 +- .../viplending/api_vip_lending.template | 20 +- .../viplending/api_vip_lending_test.go | 40 +- .../generate/account/account/api_account.py | 352 ++--- .../account/account/api_account.template | 202 +-- .../account/account/api_account_test.py | 322 ++--- .../generate/account/deposit/api_deposit.py | 120 +- .../account/deposit/api_deposit.template | 84 +- .../account/deposit/api_deposit_test.py | 134 +- .../account/subaccount/api_sub_account.py | 310 ++--- .../subaccount/api_sub_account.template | 178 +-- .../subaccount/api_sub_account_test.py | 264 ++-- .../generate/account/transfer/api_transfer.py | 156 +-- .../account/transfer/api_transfer.template | 70 +- .../account/transfer/api_transfer_test.py | 122 +- .../account/withdrawal/api_withdrawal.py | 120 +- .../withdrawal/api_withdrawal.template | 84 +- .../account/withdrawal/api_withdrawal_test.py | 138 +- .../generate/broker/ndbroker/api_nd_broker.py | 194 +-- .../broker/ndbroker/api_nd_broker.template | 154 +-- .../broker/ndbroker/api_nd_broker_test.py | 234 ++-- .../generate/earn/earn/api_earn.py | 160 +-- .../generate/earn/earn/api_earn.template | 118 +- .../generate/earn/earn/api_earn_test.py | 172 +-- .../futures/fundingfees/api_funding_fees.py | 52 +- .../fundingfees/api_funding_fees.template | 38 +- .../fundingfees/api_funding_fees_test.py | 38 +- .../generate/futures/market/api_market.py | 266 ++-- .../futures/market/api_market.template | 184 +-- .../futures/market/api_market_test.py | 320 ++--- .../generate/futures/order/api_order.py | 308 ++--- .../generate/futures/order/api_order.template | 206 +-- .../generate/futures/order/api_order_test.py | 354 +++--- .../futures/positions/api_positions.py | 290 ++--- .../futures/positions/api_positions.template | 190 +-- .../futures/positions/api_positions_test.py | 300 ++--- .../generate/margin/credit/api_credit.py | 98 +- .../margin/credit/api_credit.template | 80 +- .../generate/margin/credit/api_credit_test.py | 98 +- .../generate/margin/debit/api_debit.py | 66 +- .../generate/margin/debit/api_debit.template | 52 +- .../generate/margin/debit/api_debit_test.py | 86 +- .../generate/margin/market/api_market.py | 90 +- .../margin/market/api_market.template | 62 +- .../generate/margin/market/api_market_test.py | 96 +- .../generate/margin/order/api_order.py | 232 ++-- .../generate/margin/order/api_order.template | 168 +-- .../generate/margin/order/api_order_test.py | 238 ++-- .../generate/spot/market/api_market.py | 318 ++--- .../generate/spot/market/api_market.template | 218 ++-- .../generate/spot/market/api_market_test.py | 356 +++--- .../generate/spot/order/api_order.py | 1000 +++++++-------- .../generate/spot/order/api_order.template | 658 +++++----- .../generate/spot/order/api_order_test.py | 1080 ++++++++-------- .../viplending/viplending/api_vip_lending.py | 26 +- .../viplending/api_vip_lending.template | 20 +- .../viplending/api_vip_lending_test.py | 34 +- spec/rest/api/openapi-account-account.json | 45 +- spec/rest/api/openapi-account-deposit.json | 21 +- spec/rest/api/openapi-account-fee.json | 7 +- spec/rest/api/openapi-account-subaccount.json | 39 +- spec/rest/api/openapi-account-transfer.json | 21 +- spec/rest/api/openapi-account-withdrawal.json | 18 +- .../rest/api/openapi-affiliate-affiliate.json | 3 +- spec/rest/api/openapi-broker-apibroker.json | 3 +- spec/rest/api/openapi-broker-ndbroker.json | 39 +- spec/rest/api/openapi-earn-earn.json | 27 +- .../rest/api/openapi-futures-fundingfees.json | 9 +- spec/rest/api/openapi-futures-market.json | 51 +- spec/rest/api/openapi-futures-order.json | 54 +- spec/rest/api/openapi-futures-positions.json | 42 +- spec/rest/api/openapi-margin-credit.json | 21 +- spec/rest/api/openapi-margin-debit.json | 18 +- spec/rest/api/openapi-margin-market.json | 18 +- spec/rest/api/openapi-margin-order.json | 39 +- spec/rest/api/openapi-margin-risklimit.json | 3 +- spec/rest/api/openapi-spot-market.json | 54 +- spec/rest/api/openapi-spot-order.json | 144 ++- .../api/openapi-viplending-viplending.json | 6 +- spec/rest/entry/openapi-account.json | 151 ++- spec/rest/entry/openapi-affiliate.json | 3 +- spec/rest/entry/openapi-broker.json | 42 +- spec/rest/entry/openapi-earn.json | 27 +- spec/rest/entry/openapi-futures.json | 156 ++- spec/rest/entry/openapi-margin.json | 99 +- spec/rest/entry/openapi-spot.json | 198 ++- spec/rest/entry/openapi-viplending.json | 6 +- 139 files changed, 12050 insertions(+), 11592 deletions(-) diff --git a/generator/preprocessor/api_meta.py b/generator/preprocessor/api_meta.py index b3b0763f..1ab2d214 100644 --- a/generator/preprocessor/api_meta.py +++ b/generator/preprocessor/api_meta.py @@ -8,7 +8,6 @@ class ApiMetaUtil: - doc_id = [] @staticmethod @@ -43,7 +42,7 @@ def group_api(api_collection, entry) -> dict: raise Exception("illegal customApiFields" + api_name) x_fields = { - 'x-api-doc' : api_doc, + 'x-api-doc': api_doc, } for k in api_fields: x_fields[f'x-{k}'] = api_fields[k] @@ -256,7 +255,7 @@ def generate_path_operation(api): result = { 'name': query_para['name'], 'in': 'query', - 'description': ApiMetaUtil.escape_url(query_para['description'], ApiMetaUtil.doc_id), + 'description': ApiMetaUtil.escape_url(query_para['description'], ApiMetaUtil.doc_id), 'required': query_para['required'], 'schema': schema, } @@ -361,8 +360,11 @@ def generator_openapi(service, api_collection, entry): paths = {} schemas = {} + api_idx = 0 for api in api_collection: + api_idx = api_idx + 1 path_operation = ApiMetaUtil.generate_path_operation(api) + path_operation['operationId'] = "{:03d}".format(api_idx) method = api['api']['method'] path = api['api']['path'] diff --git a/sdk/golang/pkg/generate/account/account/api_account.go b/sdk/golang/pkg/generate/account/account/api_account.go index 168071ec..9f1cb60a 100644 --- a/sdk/golang/pkg/generate/account/account/api_account.go +++ b/sdk/golang/pkg/generate/account/account/api_account.go @@ -9,23 +9,23 @@ import ( type AccountAPI interface { - // GetFuturesAccount Get Account - Futures - // Description: Request via this endpoint to get the info of the futures account. - // Documentation: https://www.kucoin.com/docs-new/api-3470129 - // +---------------------+---------+ - // | Extra API Info | Value | - // +---------------------+---------+ - // | API-DOMAIN | FUTURES | - // | API-CHANNEL | PRIVATE | - // | API-PERMISSION | FUTURES | - // | API-RATE-LIMIT-POOL | FUTURES | - // | API-RATE-LIMIT | 5 | - // +---------------------+---------+ - GetFuturesAccount(req *GetFuturesAccountReq, ctx context.Context) (*GetFuturesAccountResp, error) + // GetAccountInfo Get Account Summary Info + // Description: This endpoint can be used to obtain account summary information. + // Documentation: https://www.kucoin.com/docs-new/api-3470119 + // +---------------------+------------+ + // | Extra API Info | Value | + // +---------------------+------------+ + // | API-DOMAIN | SPOT | + // | API-CHANNEL | PRIVATE | + // | API-PERMISSION | GENERAL | + // | API-RATE-LIMIT-POOL | MANAGEMENT | + // | API-RATE-LIMIT | 20 | + // +---------------------+------------+ + GetAccountInfo(ctx context.Context) (*GetAccountInfoResp, error) - // GetSpotAccountDetail Get Account Detail - Spot - // Description: get Information for a single spot account. Use this endpoint when you know the accountId. - // Documentation: https://www.kucoin.com/docs-new/api-3470126 + // GetApikeyInfo Get Apikey Info + // Description: Get the information of the api key. Use the api key pending to be checked to call the endpoint. Both master and sub user's api key are applicable. + // Documentation: https://www.kucoin.com/docs-new/api-3470130 // +---------------------+------------+ // | Extra API Info | Value | // +---------------------+------------+ @@ -33,9 +33,23 @@ type AccountAPI interface { // | API-CHANNEL | PRIVATE | // | API-PERMISSION | GENERAL | // | API-RATE-LIMIT-POOL | MANAGEMENT | - // | API-RATE-LIMIT | 5 | + // | API-RATE-LIMIT | 20 | // +---------------------+------------+ - GetSpotAccountDetail(req *GetSpotAccountDetailReq, ctx context.Context) (*GetSpotAccountDetailResp, error) + GetApikeyInfo(ctx context.Context) (*GetApikeyInfoResp, error) + + // GetSpotAccountType Get Account Type - Spot + // Description: This interface determines whether the current user is a spot high-frequency user or a spot low-frequency user. + // Documentation: https://www.kucoin.com/docs-new/api-3470120 + // +---------------------+---------+ + // | Extra API Info | Value | + // +---------------------+---------+ + // | API-DOMAIN | SPOT | + // | API-CHANNEL | PRIVATE | + // | API-PERMISSION | GENERAL | + // | API-RATE-LIMIT-POOL | SPOT | + // | API-RATE-LIMIT | 30 | + // +---------------------+---------+ + GetSpotAccountType(ctx context.Context) (*GetSpotAccountTypeResp, error) // GetSpotAccountList Get Account List - Spot // Description: Get a list of accounts. Please Deposit to the main account firstly, then transfer the funds to the trade account via Inner Transfer before transaction. @@ -51,9 +65,9 @@ type AccountAPI interface { // +---------------------+------------+ GetSpotAccountList(req *GetSpotAccountListReq, ctx context.Context) (*GetSpotAccountListResp, error) - // GetSpotLedger Get Account Ledgers - Spot/Margin - // Description: This interface is for transaction records from all types of your accounts, supporting inquiry of various currencies. Items are paginated and sorted to show the latest first. See the Pagination section for retrieving additional entries after the first page. - // Documentation: https://www.kucoin.com/docs-new/api-3470121 + // GetSpotAccountDetail Get Account Detail - Spot + // Description: get Information for a single spot account. Use this endpoint when you know the accountId. + // Documentation: https://www.kucoin.com/docs-new/api-3470126 // +---------------------+------------+ // | Extra API Info | Value | // +---------------------+------------+ @@ -61,13 +75,13 @@ type AccountAPI interface { // | API-CHANNEL | PRIVATE | // | API-PERMISSION | GENERAL | // | API-RATE-LIMIT-POOL | MANAGEMENT | - // | API-RATE-LIMIT | 2 | + // | API-RATE-LIMIT | 5 | // +---------------------+------------+ - GetSpotLedger(req *GetSpotLedgerReq, ctx context.Context) (*GetSpotLedgerResp, error) + GetSpotAccountDetail(req *GetSpotAccountDetailReq, ctx context.Context) (*GetSpotAccountDetailResp, error) - // GetSpotHFLedger Get Account Ledgers - Trade_hf - // Description: This API endpoint returns all transfer (in and out) records in high-frequency trading account and supports multi-coin queries. The query results are sorted in descending order by createdAt and id. - // Documentation: https://www.kucoin.com/docs-new/api-3470122 + // GetCrossMarginAccount Get Account - Cross Margin + // Description: Request via this endpoint to get the info of the cross margin account. + // Documentation: https://www.kucoin.com/docs-new/api-3470127 // +---------------------+---------+ // | Extra API Info | Value | // +---------------------+---------+ @@ -75,13 +89,13 @@ type AccountAPI interface { // | API-CHANNEL | PRIVATE | // | API-PERMISSION | GENERAL | // | API-RATE-LIMIT-POOL | SPOT | - // | API-RATE-LIMIT | 2 | + // | API-RATE-LIMIT | 15 | // +---------------------+---------+ - GetSpotHFLedger(req *GetSpotHFLedgerReq, ctx context.Context) (*GetSpotHFLedgerResp, error) + GetCrossMarginAccount(req *GetCrossMarginAccountReq, ctx context.Context) (*GetCrossMarginAccountResp, error) - // GetSpotAccountType Get Account Type - Spot - // Description: This interface determines whether the current user is a spot high-frequency user or a spot low-frequency user. - // Documentation: https://www.kucoin.com/docs-new/api-3470120 + // GetIsolatedMarginAccount Get Account - Isolated Margin + // Description: Request via this endpoint to get the info of the isolated margin account. + // Documentation: https://www.kucoin.com/docs-new/api-3470128 // +---------------------+---------+ // | Extra API Info | Value | // +---------------------+---------+ @@ -89,28 +103,41 @@ type AccountAPI interface { // | API-CHANNEL | PRIVATE | // | API-PERMISSION | GENERAL | // | API-RATE-LIMIT-POOL | SPOT | - // | API-RATE-LIMIT | 30 | + // | API-RATE-LIMIT | 15 | // +---------------------+---------+ - GetSpotAccountType(ctx context.Context) (*GetSpotAccountTypeResp, error) + GetIsolatedMarginAccount(req *GetIsolatedMarginAccountReq, ctx context.Context) (*GetIsolatedMarginAccountResp, error) - // GetIsolatedMarginAccountDetailV1 Get Account Detail - Isolated Margin - V1 - // Description: Request via this endpoint to get the info of the isolated margin account. - // Documentation: https://www.kucoin.com/docs-new/api-3470315 + // GetFuturesAccount Get Account - Futures + // Description: Request via this endpoint to get the info of the futures account. + // Documentation: https://www.kucoin.com/docs-new/api-3470129 // +---------------------+---------+ // | Extra API Info | Value | // +---------------------+---------+ - // | API-DOMAIN | SPOT | + // | API-DOMAIN | FUTURES | // | API-CHANNEL | PRIVATE | - // | API-PERMISSION | GENERAL | - // | API-RATE-LIMIT-POOL | SPOT | - // | API-RATE-LIMIT | 50 | + // | API-PERMISSION | FUTURES | + // | API-RATE-LIMIT-POOL | FUTURES | + // | API-RATE-LIMIT | 5 | // +---------------------+---------+ - // Deprecated - GetIsolatedMarginAccountDetailV1(req *GetIsolatedMarginAccountDetailV1Req, ctx context.Context) (*GetIsolatedMarginAccountDetailV1Resp, error) + GetFuturesAccount(req *GetFuturesAccountReq, ctx context.Context) (*GetFuturesAccountResp, error) - // GetIsolatedMarginAccountListV1 Get Account List - Isolated Margin - V1 - // Description: Request via this endpoint to get the info list of the isolated margin account. - // Documentation: https://www.kucoin.com/docs-new/api-3470314 + // GetSpotLedger Get Account Ledgers - Spot/Margin + // Description: This interface is for transaction records from all types of your accounts, supporting inquiry of various currencies. Items are paginated and sorted to show the latest first. See the Pagination section for retrieving additional entries after the first page. + // Documentation: https://www.kucoin.com/docs-new/api-3470121 + // +---------------------+------------+ + // | Extra API Info | Value | + // +---------------------+------------+ + // | API-DOMAIN | SPOT | + // | API-CHANNEL | PRIVATE | + // | API-PERMISSION | GENERAL | + // | API-RATE-LIMIT-POOL | MANAGEMENT | + // | API-RATE-LIMIT | 2 | + // +---------------------+------------+ + GetSpotLedger(req *GetSpotLedgerReq, ctx context.Context) (*GetSpotLedgerResp, error) + + // GetSpotHFLedger Get Account Ledgers - Trade_hf + // Description: This API endpoint returns all transfer (in and out) records in high-frequency trading account and supports multi-coin queries. The query results are sorted in descending order by createdAt and id. + // Documentation: https://www.kucoin.com/docs-new/api-3470122 // +---------------------+---------+ // | Extra API Info | Value | // +---------------------+---------+ @@ -118,14 +145,13 @@ type AccountAPI interface { // | API-CHANNEL | PRIVATE | // | API-PERMISSION | GENERAL | // | API-RATE-LIMIT-POOL | SPOT | - // | API-RATE-LIMIT | 50 | + // | API-RATE-LIMIT | 2 | // +---------------------+---------+ - // Deprecated - GetIsolatedMarginAccountListV1(req *GetIsolatedMarginAccountListV1Req, ctx context.Context) (*GetIsolatedMarginAccountListV1Resp, error) + GetSpotHFLedger(req *GetSpotHFLedgerReq, ctx context.Context) (*GetSpotHFLedgerResp, error) - // GetMarginAccountDetail Get Account Detail - Margin - // Description: Request via this endpoint to get the info of the margin account. - // Documentation: https://www.kucoin.com/docs-new/api-3470311 + // GetMarginHFLedger Get Account Ledgers - Margin_hf + // Description: This API endpoint returns all transfer (in and out) records in high-frequency margin trading account and supports multi-coin queries. The query results are sorted in descending order by createdAt and id. + // Documentation: https://www.kucoin.com/docs-new/api-3470123 // +---------------------+---------+ // | Extra API Info | Value | // +---------------------+---------+ @@ -133,10 +159,9 @@ type AccountAPI interface { // | API-CHANNEL | PRIVATE | // | API-PERMISSION | GENERAL | // | API-RATE-LIMIT-POOL | SPOT | - // | API-RATE-LIMIT | 40 | + // | API-RATE-LIMIT | 2 | // +---------------------+---------+ - // Deprecated - GetMarginAccountDetail(ctx context.Context) (*GetMarginAccountDetailResp, error) + GetMarginHFLedger(req *GetMarginHFLedgerReq, ctx context.Context) (*GetMarginHFLedgerResp, error) // GetFuturesLedger Get Account Ledgers - Futures // Description: This interface can query the ledger records of the futures business line @@ -152,37 +177,9 @@ type AccountAPI interface { // +---------------------+---------+ GetFuturesLedger(req *GetFuturesLedgerReq, ctx context.Context) (*GetFuturesLedgerResp, error) - // GetApikeyInfo Get Apikey Info - // Description: Get the information of the api key. Use the api key pending to be checked to call the endpoint. Both master and sub user's api key are applicable. - // Documentation: https://www.kucoin.com/docs-new/api-3470130 - // +---------------------+------------+ - // | Extra API Info | Value | - // +---------------------+------------+ - // | API-DOMAIN | SPOT | - // | API-CHANNEL | PRIVATE | - // | API-PERMISSION | GENERAL | - // | API-RATE-LIMIT-POOL | MANAGEMENT | - // | API-RATE-LIMIT | 20 | - // +---------------------+------------+ - GetApikeyInfo(ctx context.Context) (*GetApikeyInfoResp, error) - - // GetAccountInfo Get Account Summary Info - // Description: This endpoint can be used to obtain account summary information. - // Documentation: https://www.kucoin.com/docs-new/api-3470119 - // +---------------------+------------+ - // | Extra API Info | Value | - // +---------------------+------------+ - // | API-DOMAIN | SPOT | - // | API-CHANNEL | PRIVATE | - // | API-PERMISSION | GENERAL | - // | API-RATE-LIMIT-POOL | MANAGEMENT | - // | API-RATE-LIMIT | 20 | - // +---------------------+------------+ - GetAccountInfo(ctx context.Context) (*GetAccountInfoResp, error) - - // GetMarginHFLedger Get Account Ledgers - Margin_hf - // Description: This API endpoint returns all transfer (in and out) records in high-frequency margin trading account and supports multi-coin queries. The query results are sorted in descending order by createdAt and id. - // Documentation: https://www.kucoin.com/docs-new/api-3470123 + // GetMarginAccountDetail Get Account Detail - Margin + // Description: Request via this endpoint to get the info of the margin account. + // Documentation: https://www.kucoin.com/docs-new/api-3470311 // +---------------------+---------+ // | Extra API Info | Value | // +---------------------+---------+ @@ -190,13 +187,14 @@ type AccountAPI interface { // | API-CHANNEL | PRIVATE | // | API-PERMISSION | GENERAL | // | API-RATE-LIMIT-POOL | SPOT | - // | API-RATE-LIMIT | 2 | + // | API-RATE-LIMIT | 40 | // +---------------------+---------+ - GetMarginHFLedger(req *GetMarginHFLedgerReq, ctx context.Context) (*GetMarginHFLedgerResp, error) + // Deprecated + GetMarginAccountDetail(ctx context.Context) (*GetMarginAccountDetailResp, error) - // GetIsolatedMarginAccount Get Account - Isolated Margin - // Description: Request via this endpoint to get the info of the isolated margin account. - // Documentation: https://www.kucoin.com/docs-new/api-3470128 + // GetIsolatedMarginAccountListV1 Get Account List - Isolated Margin - V1 + // Description: Request via this endpoint to get the info list of the isolated margin account. + // Documentation: https://www.kucoin.com/docs-new/api-3470314 // +---------------------+---------+ // | Extra API Info | Value | // +---------------------+---------+ @@ -204,13 +202,14 @@ type AccountAPI interface { // | API-CHANNEL | PRIVATE | // | API-PERMISSION | GENERAL | // | API-RATE-LIMIT-POOL | SPOT | - // | API-RATE-LIMIT | 15 | + // | API-RATE-LIMIT | 50 | // +---------------------+---------+ - GetIsolatedMarginAccount(req *GetIsolatedMarginAccountReq, ctx context.Context) (*GetIsolatedMarginAccountResp, error) + // Deprecated + GetIsolatedMarginAccountListV1(req *GetIsolatedMarginAccountListV1Req, ctx context.Context) (*GetIsolatedMarginAccountListV1Resp, error) - // GetCrossMarginAccount Get Account - Cross Margin - // Description: Request via this endpoint to get the info of the cross margin account. - // Documentation: https://www.kucoin.com/docs-new/api-3470127 + // GetIsolatedMarginAccountDetailV1 Get Account Detail - Isolated Margin - V1 + // Description: Request via this endpoint to get the info of the isolated margin account. + // Documentation: https://www.kucoin.com/docs-new/api-3470315 // +---------------------+---------+ // | Extra API Info | Value | // +---------------------+---------+ @@ -218,9 +217,10 @@ type AccountAPI interface { // | API-CHANNEL | PRIVATE | // | API-PERMISSION | GENERAL | // | API-RATE-LIMIT-POOL | SPOT | - // | API-RATE-LIMIT | 15 | + // | API-RATE-LIMIT | 50 | // +---------------------+---------+ - GetCrossMarginAccount(req *GetCrossMarginAccountReq, ctx context.Context) (*GetCrossMarginAccountResp, error) + // Deprecated + GetIsolatedMarginAccountDetailV1(req *GetIsolatedMarginAccountDetailV1Req, ctx context.Context) (*GetIsolatedMarginAccountDetailV1Resp, error) } type AccountAPIImpl struct { @@ -231,92 +231,92 @@ func NewAccountAPIImp(transport interfaces.Transport) *AccountAPIImpl { return &AccountAPIImpl{transport: transport} } -func (impl *AccountAPIImpl) GetFuturesAccount(req *GetFuturesAccountReq, ctx context.Context) (*GetFuturesAccountResp, error) { - resp := &GetFuturesAccountResp{} - err := impl.transport.Call(ctx, "futures", false, "Get", "/api/v1/account-overview", req, resp, false) +func (impl *AccountAPIImpl) GetAccountInfo(ctx context.Context) (*GetAccountInfoResp, error) { + resp := &GetAccountInfoResp{} + err := impl.transport.Call(ctx, "spot", false, "Get", "/api/v2/user-info", nil, resp, false) return resp, err } -func (impl *AccountAPIImpl) GetSpotAccountDetail(req *GetSpotAccountDetailReq, ctx context.Context) (*GetSpotAccountDetailResp, error) { - resp := &GetSpotAccountDetailResp{} - err := impl.transport.Call(ctx, "spot", false, "Get", "/api/v1/accounts/{accountId}", req, resp, false) +func (impl *AccountAPIImpl) GetApikeyInfo(ctx context.Context) (*GetApikeyInfoResp, error) { + resp := &GetApikeyInfoResp{} + err := impl.transport.Call(ctx, "spot", false, "Get", "/api/v1/user/api-key", nil, resp, false) return resp, err } -func (impl *AccountAPIImpl) GetSpotAccountList(req *GetSpotAccountListReq, ctx context.Context) (*GetSpotAccountListResp, error) { - resp := &GetSpotAccountListResp{} - err := impl.transport.Call(ctx, "spot", false, "Get", "/api/v1/accounts", req, resp, false) +func (impl *AccountAPIImpl) GetSpotAccountType(ctx context.Context) (*GetSpotAccountTypeResp, error) { + resp := &GetSpotAccountTypeResp{} + err := impl.transport.Call(ctx, "spot", false, "Get", "/api/v1/hf/accounts/opened", nil, resp, false) return resp, err } -func (impl *AccountAPIImpl) GetSpotLedger(req *GetSpotLedgerReq, ctx context.Context) (*GetSpotLedgerResp, error) { - resp := &GetSpotLedgerResp{} - err := impl.transport.Call(ctx, "spot", false, "Get", "/api/v1/accounts/ledgers", req, resp, false) +func (impl *AccountAPIImpl) GetSpotAccountList(req *GetSpotAccountListReq, ctx context.Context) (*GetSpotAccountListResp, error) { + resp := &GetSpotAccountListResp{} + err := impl.transport.Call(ctx, "spot", false, "Get", "/api/v1/accounts", req, resp, false) return resp, err } -func (impl *AccountAPIImpl) GetSpotHFLedger(req *GetSpotHFLedgerReq, ctx context.Context) (*GetSpotHFLedgerResp, error) { - resp := &GetSpotHFLedgerResp{} - err := impl.transport.Call(ctx, "spot", false, "Get", "/api/v1/hf/accounts/ledgers", req, resp, false) +func (impl *AccountAPIImpl) GetSpotAccountDetail(req *GetSpotAccountDetailReq, ctx context.Context) (*GetSpotAccountDetailResp, error) { + resp := &GetSpotAccountDetailResp{} + err := impl.transport.Call(ctx, "spot", false, "Get", "/api/v1/accounts/{accountId}", req, resp, false) return resp, err } -func (impl *AccountAPIImpl) GetSpotAccountType(ctx context.Context) (*GetSpotAccountTypeResp, error) { - resp := &GetSpotAccountTypeResp{} - err := impl.transport.Call(ctx, "spot", false, "Get", "/api/v1/hf/accounts/opened", nil, resp, false) +func (impl *AccountAPIImpl) GetCrossMarginAccount(req *GetCrossMarginAccountReq, ctx context.Context) (*GetCrossMarginAccountResp, error) { + resp := &GetCrossMarginAccountResp{} + err := impl.transport.Call(ctx, "spot", false, "Get", "/api/v3/margin/accounts", req, resp, false) return resp, err } -func (impl *AccountAPIImpl) GetIsolatedMarginAccountDetailV1(req *GetIsolatedMarginAccountDetailV1Req, ctx context.Context) (*GetIsolatedMarginAccountDetailV1Resp, error) { - resp := &GetIsolatedMarginAccountDetailV1Resp{} - err := impl.transport.Call(ctx, "spot", false, "Get", "/api/v1/isolated/account/{symbol}", req, resp, false) +func (impl *AccountAPIImpl) GetIsolatedMarginAccount(req *GetIsolatedMarginAccountReq, ctx context.Context) (*GetIsolatedMarginAccountResp, error) { + resp := &GetIsolatedMarginAccountResp{} + err := impl.transport.Call(ctx, "spot", false, "Get", "/api/v3/isolated/accounts", req, resp, false) return resp, err } -func (impl *AccountAPIImpl) GetIsolatedMarginAccountListV1(req *GetIsolatedMarginAccountListV1Req, ctx context.Context) (*GetIsolatedMarginAccountListV1Resp, error) { - resp := &GetIsolatedMarginAccountListV1Resp{} - err := impl.transport.Call(ctx, "spot", false, "Get", "/api/v1/isolated/accounts", req, resp, false) +func (impl *AccountAPIImpl) GetFuturesAccount(req *GetFuturesAccountReq, ctx context.Context) (*GetFuturesAccountResp, error) { + resp := &GetFuturesAccountResp{} + err := impl.transport.Call(ctx, "futures", false, "Get", "/api/v1/account-overview", req, resp, false) return resp, err } -func (impl *AccountAPIImpl) GetMarginAccountDetail(ctx context.Context) (*GetMarginAccountDetailResp, error) { - resp := &GetMarginAccountDetailResp{} - err := impl.transport.Call(ctx, "spot", false, "Get", "/api/v1/margin/account", nil, resp, false) +func (impl *AccountAPIImpl) GetSpotLedger(req *GetSpotLedgerReq, ctx context.Context) (*GetSpotLedgerResp, error) { + resp := &GetSpotLedgerResp{} + err := impl.transport.Call(ctx, "spot", false, "Get", "/api/v1/accounts/ledgers", req, resp, false) return resp, err } -func (impl *AccountAPIImpl) GetFuturesLedger(req *GetFuturesLedgerReq, ctx context.Context) (*GetFuturesLedgerResp, error) { - resp := &GetFuturesLedgerResp{} - err := impl.transport.Call(ctx, "futures", false, "Get", "/api/v1/transaction-history", req, resp, false) +func (impl *AccountAPIImpl) GetSpotHFLedger(req *GetSpotHFLedgerReq, ctx context.Context) (*GetSpotHFLedgerResp, error) { + resp := &GetSpotHFLedgerResp{} + err := impl.transport.Call(ctx, "spot", false, "Get", "/api/v1/hf/accounts/ledgers", req, resp, false) return resp, err } -func (impl *AccountAPIImpl) GetApikeyInfo(ctx context.Context) (*GetApikeyInfoResp, error) { - resp := &GetApikeyInfoResp{} - err := impl.transport.Call(ctx, "spot", false, "Get", "/api/v1/user/api-key", nil, resp, false) +func (impl *AccountAPIImpl) GetMarginHFLedger(req *GetMarginHFLedgerReq, ctx context.Context) (*GetMarginHFLedgerResp, error) { + resp := &GetMarginHFLedgerResp{} + err := impl.transport.Call(ctx, "spot", false, "Get", "/api/v3/hf/margin/account/ledgers", req, resp, false) return resp, err } -func (impl *AccountAPIImpl) GetAccountInfo(ctx context.Context) (*GetAccountInfoResp, error) { - resp := &GetAccountInfoResp{} - err := impl.transport.Call(ctx, "spot", false, "Get", "/api/v2/user-info", nil, resp, false) +func (impl *AccountAPIImpl) GetFuturesLedger(req *GetFuturesLedgerReq, ctx context.Context) (*GetFuturesLedgerResp, error) { + resp := &GetFuturesLedgerResp{} + err := impl.transport.Call(ctx, "futures", false, "Get", "/api/v1/transaction-history", req, resp, false) return resp, err } -func (impl *AccountAPIImpl) GetMarginHFLedger(req *GetMarginHFLedgerReq, ctx context.Context) (*GetMarginHFLedgerResp, error) { - resp := &GetMarginHFLedgerResp{} - err := impl.transport.Call(ctx, "spot", false, "Get", "/api/v3/hf/margin/account/ledgers", req, resp, false) +func (impl *AccountAPIImpl) GetMarginAccountDetail(ctx context.Context) (*GetMarginAccountDetailResp, error) { + resp := &GetMarginAccountDetailResp{} + err := impl.transport.Call(ctx, "spot", false, "Get", "/api/v1/margin/account", nil, resp, false) return resp, err } -func (impl *AccountAPIImpl) GetIsolatedMarginAccount(req *GetIsolatedMarginAccountReq, ctx context.Context) (*GetIsolatedMarginAccountResp, error) { - resp := &GetIsolatedMarginAccountResp{} - err := impl.transport.Call(ctx, "spot", false, "Get", "/api/v3/isolated/accounts", req, resp, false) +func (impl *AccountAPIImpl) GetIsolatedMarginAccountListV1(req *GetIsolatedMarginAccountListV1Req, ctx context.Context) (*GetIsolatedMarginAccountListV1Resp, error) { + resp := &GetIsolatedMarginAccountListV1Resp{} + err := impl.transport.Call(ctx, "spot", false, "Get", "/api/v1/isolated/accounts", req, resp, false) return resp, err } -func (impl *AccountAPIImpl) GetCrossMarginAccount(req *GetCrossMarginAccountReq, ctx context.Context) (*GetCrossMarginAccountResp, error) { - resp := &GetCrossMarginAccountResp{} - err := impl.transport.Call(ctx, "spot", false, "Get", "/api/v3/margin/accounts", req, resp, false) +func (impl *AccountAPIImpl) GetIsolatedMarginAccountDetailV1(req *GetIsolatedMarginAccountDetailV1Req, ctx context.Context) (*GetIsolatedMarginAccountDetailV1Resp, error) { + resp := &GetIsolatedMarginAccountDetailV1Resp{} + err := impl.transport.Call(ctx, "spot", false, "Get", "/api/v1/isolated/account/{symbol}", req, resp, false) return resp, err } diff --git a/sdk/golang/pkg/generate/account/account/api_account.template b/sdk/golang/pkg/generate/account/account/api_account.template index 2794c19b..eabb92c4 100644 --- a/sdk/golang/pkg/generate/account/account/api_account.template +++ b/sdk/golang/pkg/generate/account/account/api_account.template @@ -1,16 +1,13 @@ # API FUNCTION TEMPLATE -func TestAccountGetFuturesAccountReq(t *testing.T) { - // GetFuturesAccount - // Get Account - Futures - // /api/v1/account-overview +func TestAccountGetAccountInfoReq(t *testing.T) { + // GetAccountInfo + // Get Account Summary Info + // /api/v2/user-info - builder := account.NewGetFuturesAccountReqBuilder() - builder.SetCurrency(?) - req := builder.Build() - resp, err := accountApi.GetFuturesAccount(req, context.TODO()) + resp, err := accountApi.GetAccountInfo(context.TODO()) if err != nil { panic(err) } @@ -24,16 +21,13 @@ func TestAccountGetFuturesAccountReq(t *testing.T) { } -func TestAccountGetSpotAccountDetailReq(t *testing.T) { - // GetSpotAccountDetail - // Get Account Detail - Spot - // /api/v1/accounts/{accountId} +func TestAccountGetApikeyInfoReq(t *testing.T) { + // GetApikeyInfo + // Get Apikey Info + // /api/v1/user/api-key - builder := account.NewGetSpotAccountDetailReqBuilder() - builder.SetAccountId(?) - req := builder.Build() - resp, err := accountApi.GetSpotAccountDetail(req, context.TODO()) + resp, err := accountApi.GetApikeyInfo(context.TODO()) if err != nil { panic(err) } @@ -47,16 +41,13 @@ func TestAccountGetSpotAccountDetailReq(t *testing.T) { } -func TestAccountGetSpotAccountListReq(t *testing.T) { - // GetSpotAccountList - // Get Account List - Spot - // /api/v1/accounts +func TestAccountGetSpotAccountTypeReq(t *testing.T) { + // GetSpotAccountType + // Get Account Type - Spot + // /api/v1/hf/accounts/opened - builder := account.NewGetSpotAccountListReqBuilder() - builder.SetCurrency(?).SetType(?) - req := builder.Build() - resp, err := accountApi.GetSpotAccountList(req, context.TODO()) + resp, err := accountApi.GetSpotAccountType(context.TODO()) if err != nil { panic(err) } @@ -70,16 +61,16 @@ func TestAccountGetSpotAccountListReq(t *testing.T) { } -func TestAccountGetSpotLedgerReq(t *testing.T) { - // GetSpotLedger - // Get Account Ledgers - Spot/Margin - // /api/v1/accounts/ledgers +func TestAccountGetSpotAccountListReq(t *testing.T) { + // GetSpotAccountList + // Get Account List - Spot + // /api/v1/accounts - builder := account.NewGetSpotLedgerReqBuilder() - builder.SetCurrency(?).SetDirection(?).SetBizType(?).SetStartAt(?).SetEndAt(?).SetCurrentPage(?).SetPageSize(?) + builder := account.NewGetSpotAccountListReqBuilder() + builder.SetCurrency(?).SetType(?) req := builder.Build() - resp, err := accountApi.GetSpotLedger(req, context.TODO()) + resp, err := accountApi.GetSpotAccountList(req, context.TODO()) if err != nil { panic(err) } @@ -93,16 +84,16 @@ func TestAccountGetSpotLedgerReq(t *testing.T) { } -func TestAccountGetSpotHFLedgerReq(t *testing.T) { - // GetSpotHFLedger - // Get Account Ledgers - Trade_hf - // /api/v1/hf/accounts/ledgers +func TestAccountGetSpotAccountDetailReq(t *testing.T) { + // GetSpotAccountDetail + // Get Account Detail - Spot + // /api/v1/accounts/{accountId} - builder := account.NewGetSpotHFLedgerReqBuilder() - builder.SetCurrency(?).SetDirection(?).SetBizType(?).SetLastId(?).SetLimit(?).SetStartAt(?).SetEndAt(?) + builder := account.NewGetSpotAccountDetailReqBuilder() + builder.SetAccountId(?) req := builder.Build() - resp, err := accountApi.GetSpotHFLedger(req, context.TODO()) + resp, err := accountApi.GetSpotAccountDetail(req, context.TODO()) if err != nil { panic(err) } @@ -116,13 +107,16 @@ func TestAccountGetSpotHFLedgerReq(t *testing.T) { } -func TestAccountGetSpotAccountTypeReq(t *testing.T) { - // GetSpotAccountType - // Get Account Type - Spot - // /api/v1/hf/accounts/opened +func TestAccountGetCrossMarginAccountReq(t *testing.T) { + // GetCrossMarginAccount + // Get Account - Cross Margin + // /api/v3/margin/accounts + builder := account.NewGetCrossMarginAccountReqBuilder() + builder.SetQuoteCurrency(?).SetQueryType(?) + req := builder.Build() - resp, err := accountApi.GetSpotAccountType(context.TODO()) + resp, err := accountApi.GetCrossMarginAccount(req, context.TODO()) if err != nil { panic(err) } @@ -136,16 +130,16 @@ func TestAccountGetSpotAccountTypeReq(t *testing.T) { } -func TestAccountGetIsolatedMarginAccountDetailV1Req(t *testing.T) { - // GetIsolatedMarginAccountDetailV1 - // Get Account Detail - Isolated Margin - V1 - // /api/v1/isolated/account/{symbol} +func TestAccountGetIsolatedMarginAccountReq(t *testing.T) { + // GetIsolatedMarginAccount + // Get Account - Isolated Margin + // /api/v3/isolated/accounts - builder := account.NewGetIsolatedMarginAccountDetailV1ReqBuilder() - builder.SetSymbol(?) + builder := account.NewGetIsolatedMarginAccountReqBuilder() + builder.SetSymbol(?).SetQuoteCurrency(?).SetQueryType(?) req := builder.Build() - resp, err := accountApi.GetIsolatedMarginAccountDetailV1(req, context.TODO()) + resp, err := accountApi.GetIsolatedMarginAccount(req, context.TODO()) if err != nil { panic(err) } @@ -159,16 +153,16 @@ func TestAccountGetIsolatedMarginAccountDetailV1Req(t *testing.T) { } -func TestAccountGetIsolatedMarginAccountListV1Req(t *testing.T) { - // GetIsolatedMarginAccountListV1 - // Get Account List - Isolated Margin - V1 - // /api/v1/isolated/accounts +func TestAccountGetFuturesAccountReq(t *testing.T) { + // GetFuturesAccount + // Get Account - Futures + // /api/v1/account-overview - builder := account.NewGetIsolatedMarginAccountListV1ReqBuilder() - builder.SetBalanceCurrency(?) + builder := account.NewGetFuturesAccountReqBuilder() + builder.SetCurrency(?) req := builder.Build() - resp, err := accountApi.GetIsolatedMarginAccountListV1(req, context.TODO()) + resp, err := accountApi.GetFuturesAccount(req, context.TODO()) if err != nil { panic(err) } @@ -182,13 +176,16 @@ func TestAccountGetIsolatedMarginAccountListV1Req(t *testing.T) { } -func TestAccountGetMarginAccountDetailReq(t *testing.T) { - // GetMarginAccountDetail - // Get Account Detail - Margin - // /api/v1/margin/account +func TestAccountGetSpotLedgerReq(t *testing.T) { + // GetSpotLedger + // Get Account Ledgers - Spot/Margin + // /api/v1/accounts/ledgers + builder := account.NewGetSpotLedgerReqBuilder() + builder.SetCurrency(?).SetDirection(?).SetBizType(?).SetStartAt(?).SetEndAt(?).SetCurrentPage(?).SetPageSize(?) + req := builder.Build() - resp, err := accountApi.GetMarginAccountDetail(context.TODO()) + resp, err := accountApi.GetSpotLedger(req, context.TODO()) if err != nil { panic(err) } @@ -202,16 +199,16 @@ func TestAccountGetMarginAccountDetailReq(t *testing.T) { } -func TestAccountGetFuturesLedgerReq(t *testing.T) { - // GetFuturesLedger - // Get Account Ledgers - Futures - // /api/v1/transaction-history +func TestAccountGetSpotHFLedgerReq(t *testing.T) { + // GetSpotHFLedger + // Get Account Ledgers - Trade_hf + // /api/v1/hf/accounts/ledgers - builder := account.NewGetFuturesLedgerReqBuilder() - builder.SetCurrency(?).SetType(?).SetOffset(?).SetForward(?).SetMaxCount(?).SetStartAt(?).SetEndAt(?) + builder := account.NewGetSpotHFLedgerReqBuilder() + builder.SetCurrency(?).SetDirection(?).SetBizType(?).SetLastId(?).SetLimit(?).SetStartAt(?).SetEndAt(?) req := builder.Build() - resp, err := accountApi.GetFuturesLedger(req, context.TODO()) + resp, err := accountApi.GetSpotHFLedger(req, context.TODO()) if err != nil { panic(err) } @@ -225,13 +222,16 @@ func TestAccountGetFuturesLedgerReq(t *testing.T) { } -func TestAccountGetApikeyInfoReq(t *testing.T) { - // GetApikeyInfo - // Get Apikey Info - // /api/v1/user/api-key +func TestAccountGetMarginHFLedgerReq(t *testing.T) { + // GetMarginHFLedger + // Get Account Ledgers - Margin_hf + // /api/v3/hf/margin/account/ledgers + builder := account.NewGetMarginHFLedgerReqBuilder() + builder.SetCurrency(?).SetDirection(?).SetBizType(?).SetLastId(?).SetLimit(?).SetStartAt(?).SetEndAt(?) + req := builder.Build() - resp, err := accountApi.GetApikeyInfo(context.TODO()) + resp, err := accountApi.GetMarginHFLedger(req, context.TODO()) if err != nil { panic(err) } @@ -245,13 +245,16 @@ func TestAccountGetApikeyInfoReq(t *testing.T) { } -func TestAccountGetAccountInfoReq(t *testing.T) { - // GetAccountInfo - // Get Account Summary Info - // /api/v2/user-info +func TestAccountGetFuturesLedgerReq(t *testing.T) { + // GetFuturesLedger + // Get Account Ledgers - Futures + // /api/v1/transaction-history + builder := account.NewGetFuturesLedgerReqBuilder() + builder.SetCurrency(?).SetType(?).SetOffset(?).SetForward(?).SetMaxCount(?).SetStartAt(?).SetEndAt(?) + req := builder.Build() - resp, err := accountApi.GetAccountInfo(context.TODO()) + resp, err := accountApi.GetFuturesLedger(req, context.TODO()) if err != nil { panic(err) } @@ -265,16 +268,13 @@ func TestAccountGetAccountInfoReq(t *testing.T) { } -func TestAccountGetMarginHFLedgerReq(t *testing.T) { - // GetMarginHFLedger - // Get Account Ledgers - Margin_hf - // /api/v3/hf/margin/account/ledgers +func TestAccountGetMarginAccountDetailReq(t *testing.T) { + // GetMarginAccountDetail + // Get Account Detail - Margin + // /api/v1/margin/account - builder := account.NewGetMarginHFLedgerReqBuilder() - builder.SetCurrency(?).SetDirection(?).SetBizType(?).SetLastId(?).SetLimit(?).SetStartAt(?).SetEndAt(?) - req := builder.Build() - resp, err := accountApi.GetMarginHFLedger(req, context.TODO()) + resp, err := accountApi.GetMarginAccountDetail(context.TODO()) if err != nil { panic(err) } @@ -288,16 +288,16 @@ func TestAccountGetMarginHFLedgerReq(t *testing.T) { } -func TestAccountGetIsolatedMarginAccountReq(t *testing.T) { - // GetIsolatedMarginAccount - // Get Account - Isolated Margin - // /api/v3/isolated/accounts +func TestAccountGetIsolatedMarginAccountListV1Req(t *testing.T) { + // GetIsolatedMarginAccountListV1 + // Get Account List - Isolated Margin - V1 + // /api/v1/isolated/accounts - builder := account.NewGetIsolatedMarginAccountReqBuilder() - builder.SetSymbol(?).SetQuoteCurrency(?).SetQueryType(?) + builder := account.NewGetIsolatedMarginAccountListV1ReqBuilder() + builder.SetBalanceCurrency(?) req := builder.Build() - resp, err := accountApi.GetIsolatedMarginAccount(req, context.TODO()) + resp, err := accountApi.GetIsolatedMarginAccountListV1(req, context.TODO()) if err != nil { panic(err) } @@ -311,16 +311,16 @@ func TestAccountGetIsolatedMarginAccountReq(t *testing.T) { } -func TestAccountGetCrossMarginAccountReq(t *testing.T) { - // GetCrossMarginAccount - // Get Account - Cross Margin - // /api/v3/margin/accounts +func TestAccountGetIsolatedMarginAccountDetailV1Req(t *testing.T) { + // GetIsolatedMarginAccountDetailV1 + // Get Account Detail - Isolated Margin - V1 + // /api/v1/isolated/account/{symbol} - builder := account.NewGetCrossMarginAccountReqBuilder() - builder.SetQuoteCurrency(?).SetQueryType(?) + builder := account.NewGetIsolatedMarginAccountDetailV1ReqBuilder() + builder.SetSymbol(?) req := builder.Build() - resp, err := accountApi.GetCrossMarginAccount(req, context.TODO()) + resp, err := accountApi.GetIsolatedMarginAccountDetailV1(req, context.TODO()) if err != nil { panic(err) } diff --git a/sdk/golang/pkg/generate/account/account/api_account_test.go b/sdk/golang/pkg/generate/account/account/api_account_test.go index 64ea172d..dc4947c3 100644 --- a/sdk/golang/pkg/generate/account/account/api_account_test.go +++ b/sdk/golang/pkg/generate/account/account/api_account_test.go @@ -7,57 +7,70 @@ import ( "testing" ) -func TestAccountGetFuturesAccountReqModel(t *testing.T) { - // GetFuturesAccount - // Get Account - Futures - // /api/v1/account-overview +func TestAccountGetAccountInfoReqModel(t *testing.T) { + // GetAccountInfo + // Get Account Summary Info + // /api/v2/user-info - data := "{\"currency\": \"USDT\"}" - req := &GetFuturesAccountReq{} - err := json.Unmarshal([]byte(data), req) - req.ToMap() - assert.Nil(t, err) } -func TestAccountGetFuturesAccountRespModel(t *testing.T) { - // GetFuturesAccount - // Get Account - Futures - // /api/v1/account-overview +func TestAccountGetAccountInfoRespModel(t *testing.T) { + // GetAccountInfo + // Get Account Summary Info + // /api/v2/user-info - data := "{\n \"code\": \"200000\",\n \"data\": {\n \"currency\": \"USDT\",\n \"accountEquity\": 48.921913718,\n \"unrealisedPNL\": 1.59475,\n \"marginBalance\": 47.548728628,\n \"positionMargin\": 34.1577964733,\n \"orderMargin\": 0,\n \"frozenFunds\": 0,\n \"availableBalance\": 14.7876172447,\n \"riskRatio\": 0.0090285199\n }\n}" + data := "{\n \"code\": \"200000\",\n \"data\": {\n \"level\": 0,\n \"subQuantity\": 3,\n \"spotSubQuantity\": 3,\n \"marginSubQuantity\": 2,\n \"futuresSubQuantity\": 2,\n \"optionSubQuantity\": 0,\n \"maxSubQuantity\": 5,\n \"maxDefaultSubQuantity\": 5,\n \"maxSpotSubQuantity\": 0,\n \"maxMarginSubQuantity\": 0,\n \"maxFuturesSubQuantity\": 0,\n \"maxOptionSubQuantity\": 0\n }\n}" commonResp := &types.RestResponse{} err := json.Unmarshal([]byte(data), commonResp) assert.Nil(t, err) assert.NotNil(t, commonResp.Data) - resp := &GetFuturesAccountResp{} + resp := &GetAccountInfoResp{} err = json.Unmarshal([]byte(commonResp.Data), resp) resp.ToMap() assert.Nil(t, err) } -func TestAccountGetSpotAccountDetailReqModel(t *testing.T) { - // GetSpotAccountDetail - // Get Account Detail - Spot - // /api/v1/accounts/{accountId} +func TestAccountGetApikeyInfoReqModel(t *testing.T) { + // GetApikeyInfo + // Get Apikey Info + // /api/v1/user/api-key - data := "{\"accountId\": \"548674591753\"}" - req := &GetSpotAccountDetailReq{} - err := json.Unmarshal([]byte(data), req) - req.ToMap() +} + +func TestAccountGetApikeyInfoRespModel(t *testing.T) { + // GetApikeyInfo + // Get Apikey Info + // /api/v1/user/api-key + + data := "{\n \"code\": \"200000\",\n \"data\": {\n \"remark\": \"account1\",\n \"apiKey\": \"6705f5c311545b000157d3eb\",\n \"apiVersion\": 3,\n \"permission\": \"General,Futures,Spot,Earn,InnerTransfer,Transfer,Margin\",\n \"ipWhitelist\": \"203.**.154,103.**.34\",\n \"createdAt\": 1728443843000,\n \"uid\": 165111215,\n \"isMaster\": true\n }\n}" + commonResp := &types.RestResponse{} + err := json.Unmarshal([]byte(data), commonResp) + assert.Nil(t, err) + assert.NotNil(t, commonResp.Data) + resp := &GetApikeyInfoResp{} + err = json.Unmarshal([]byte(commonResp.Data), resp) + resp.ToMap() assert.Nil(t, err) } -func TestAccountGetSpotAccountDetailRespModel(t *testing.T) { - // GetSpotAccountDetail - // Get Account Detail - Spot - // /api/v1/accounts/{accountId} +func TestAccountGetSpotAccountTypeReqModel(t *testing.T) { + // GetSpotAccountType + // Get Account Type - Spot + // /api/v1/hf/accounts/opened - data := "{\"code\":\"200000\",\"data\":{\"currency\":\"USDT\",\"balance\":\"26.66759503\",\"available\":\"26.66759503\",\"holds\":\"0\"}}" +} + +func TestAccountGetSpotAccountTypeRespModel(t *testing.T) { + // GetSpotAccountType + // Get Account Type - Spot + // /api/v1/hf/accounts/opened + + data := "{\"code\":\"200000\",\"data\":false}" commonResp := &types.RestResponse{} err := json.Unmarshal([]byte(data), commonResp) assert.Nil(t, err) assert.NotNil(t, commonResp.Data) - resp := &GetSpotAccountDetailResp{} + resp := &GetSpotAccountTypeResp{} err = json.Unmarshal([]byte(commonResp.Data), resp) resp.ToMap() assert.Nil(t, err) @@ -91,317 +104,304 @@ func TestAccountGetSpotAccountListRespModel(t *testing.T) { assert.Nil(t, err) } -func TestAccountGetSpotLedgerReqModel(t *testing.T) { - // GetSpotLedger - // Get Account Ledgers - Spot/Margin - // /api/v1/accounts/ledgers +func TestAccountGetSpotAccountDetailReqModel(t *testing.T) { + // GetSpotAccountDetail + // Get Account Detail - Spot + // /api/v1/accounts/{accountId} - data := "{\"currency\": \"BTC\", \"direction\": \"in\", \"bizType\": \"TRANSFER\", \"startAt\": 1728663338000, \"endAt\": 1728692138000, \"currentPage\": 1, \"pageSize\": 50}" - req := &GetSpotLedgerReq{} + data := "{\"accountId\": \"548674591753\"}" + req := &GetSpotAccountDetailReq{} err := json.Unmarshal([]byte(data), req) req.ToMap() assert.Nil(t, err) } -func TestAccountGetSpotLedgerRespModel(t *testing.T) { - // GetSpotLedger - // Get Account Ledgers - Spot/Margin - // /api/v1/accounts/ledgers +func TestAccountGetSpotAccountDetailRespModel(t *testing.T) { + // GetSpotAccountDetail + // Get Account Detail - Spot + // /api/v1/accounts/{accountId} - data := "{\n \"code\": \"200000\",\n \"data\": {\n \"currentPage\": 1,\n \"pageSize\": 50,\n \"totalNum\": 1,\n \"totalPage\": 1,\n \"items\": [\n {\n \"id\": \"265329987780896\",\n \"currency\": \"USDT\",\n \"amount\": \"0.01\",\n \"fee\": \"0\",\n \"balance\": \"0\",\n \"accountType\": \"TRADE\",\n \"bizType\": \"SUB_TRANSFER\",\n \"direction\": \"out\",\n \"createdAt\": 1728658481484,\n \"context\": \"\"\n }\n ]\n }\n}" + data := "{\"code\":\"200000\",\"data\":{\"currency\":\"USDT\",\"balance\":\"26.66759503\",\"available\":\"26.66759503\",\"holds\":\"0\"}}" commonResp := &types.RestResponse{} err := json.Unmarshal([]byte(data), commonResp) assert.Nil(t, err) assert.NotNil(t, commonResp.Data) - resp := &GetSpotLedgerResp{} + resp := &GetSpotAccountDetailResp{} err = json.Unmarshal([]byte(commonResp.Data), resp) resp.ToMap() assert.Nil(t, err) } -func TestAccountGetSpotHFLedgerReqModel(t *testing.T) { - // GetSpotHFLedger - // Get Account Ledgers - Trade_hf - // /api/v1/hf/accounts/ledgers +func TestAccountGetCrossMarginAccountReqModel(t *testing.T) { + // GetCrossMarginAccount + // Get Account - Cross Margin + // /api/v3/margin/accounts - data := "{\"currency\": \"BTC\", \"direction\": \"in\", \"bizType\": \"TRANSFER\", \"lastId\": 254062248624417, \"limit\": 100, \"startAt\": 1728663338000, \"endAt\": 1728692138000}" - req := &GetSpotHFLedgerReq{} + data := "{\"quoteCurrency\": \"USDT\", \"queryType\": \"MARGIN\"}" + req := &GetCrossMarginAccountReq{} err := json.Unmarshal([]byte(data), req) req.ToMap() assert.Nil(t, err) } -func TestAccountGetSpotHFLedgerRespModel(t *testing.T) { - // GetSpotHFLedger - // Get Account Ledgers - Trade_hf - // /api/v1/hf/accounts/ledgers +func TestAccountGetCrossMarginAccountRespModel(t *testing.T) { + // GetCrossMarginAccount + // Get Account - Cross Margin + // /api/v3/margin/accounts - data := "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"id\": \"254062248624417\",\n \"currency\": \"USDT\",\n \"amount\": \"1.59760080\",\n \"fee\": \"0.00159920\",\n \"tax\": \"0\",\n \"balance\": \"26.73759503\",\n \"accountType\": \"TRADE_HF\",\n \"bizType\": \"TRADE_EXCHANGE\",\n \"direction\": \"in\",\n \"createdAt\": \"1728443957539\",\n \"context\": \"{\\\"symbol\\\":\\\"KCS-USDT\\\",\\\"orderId\\\":\\\"6705f6350dc7210007d6a36d\\\",\\\"tradeId\\\":\\\"10046097631627265\\\"}\"\n }\n ]\n}" + data := "{\n \"code\": \"200000\",\n \"data\": {\n \"totalAssetOfQuoteCurrency\": \"0.02\",\n \"totalLiabilityOfQuoteCurrency\": \"0\",\n \"debtRatio\": \"0\",\n \"status\": \"EFFECTIVE\",\n \"accounts\": [\n {\n \"currency\": \"USDT\",\n \"total\": \"0.02\",\n \"available\": \"0.02\",\n \"hold\": \"0\",\n \"liability\": \"0\",\n \"maxBorrowSize\": \"0\",\n \"borrowEnabled\": true,\n \"transferInEnabled\": true\n }\n ]\n }\n}" commonResp := &types.RestResponse{} err := json.Unmarshal([]byte(data), commonResp) assert.Nil(t, err) assert.NotNil(t, commonResp.Data) - resp := &GetSpotHFLedgerResp{} + resp := &GetCrossMarginAccountResp{} err = json.Unmarshal([]byte(commonResp.Data), resp) resp.ToMap() assert.Nil(t, err) } -func TestAccountGetSpotAccountTypeReqModel(t *testing.T) { - // GetSpotAccountType - // Get Account Type - Spot - // /api/v1/hf/accounts/opened +func TestAccountGetIsolatedMarginAccountReqModel(t *testing.T) { + // GetIsolatedMarginAccount + // Get Account - Isolated Margin + // /api/v3/isolated/accounts + data := "{\"symbol\": \"example_string_default_value\", \"quoteCurrency\": \"USDT\", \"queryType\": \"ISOLATED\"}" + req := &GetIsolatedMarginAccountReq{} + err := json.Unmarshal([]byte(data), req) + req.ToMap() + assert.Nil(t, err) } -func TestAccountGetSpotAccountTypeRespModel(t *testing.T) { - // GetSpotAccountType - // Get Account Type - Spot - // /api/v1/hf/accounts/opened +func TestAccountGetIsolatedMarginAccountRespModel(t *testing.T) { + // GetIsolatedMarginAccount + // Get Account - Isolated Margin + // /api/v3/isolated/accounts - data := "{\"code\":\"200000\",\"data\":false}" + data := "{\n \"code\": \"200000\",\n \"data\": {\n \"totalAssetOfQuoteCurrency\": \"0.01\",\n \"totalLiabilityOfQuoteCurrency\": \"0\",\n \"timestamp\": 1728725465994,\n \"assets\": [\n {\n \"symbol\": \"BTC-USDT\",\n \"status\": \"EFFECTIVE\",\n \"debtRatio\": \"0\",\n \"baseAsset\": {\n \"currency\": \"BTC\",\n \"borrowEnabled\": true,\n \"transferInEnabled\": true,\n \"liability\": \"0\",\n \"total\": \"0\",\n \"available\": \"0\",\n \"hold\": \"0\",\n \"maxBorrowSize\": \"0\"\n },\n \"quoteAsset\": {\n \"currency\": \"USDT\",\n \"borrowEnabled\": true,\n \"transferInEnabled\": true,\n \"liability\": \"0\",\n \"total\": \"0.01\",\n \"available\": \"0.01\",\n \"hold\": \"0\",\n \"maxBorrowSize\": \"0\"\n }\n }\n ]\n }\n}" commonResp := &types.RestResponse{} err := json.Unmarshal([]byte(data), commonResp) assert.Nil(t, err) assert.NotNil(t, commonResp.Data) - resp := &GetSpotAccountTypeResp{} + resp := &GetIsolatedMarginAccountResp{} err = json.Unmarshal([]byte(commonResp.Data), resp) resp.ToMap() assert.Nil(t, err) } -func TestAccountGetIsolatedMarginAccountDetailV1ReqModel(t *testing.T) { - // GetIsolatedMarginAccountDetailV1 - // Get Account Detail - Isolated Margin - V1 - // /api/v1/isolated/account/{symbol} +func TestAccountGetFuturesAccountReqModel(t *testing.T) { + // GetFuturesAccount + // Get Account - Futures + // /api/v1/account-overview - data := "{\"symbol\": \"example_string_default_value\"}" - req := &GetIsolatedMarginAccountDetailV1Req{} + data := "{\"currency\": \"USDT\"}" + req := &GetFuturesAccountReq{} err := json.Unmarshal([]byte(data), req) req.ToMap() assert.Nil(t, err) } -func TestAccountGetIsolatedMarginAccountDetailV1RespModel(t *testing.T) { - // GetIsolatedMarginAccountDetailV1 - // Get Account Detail - Isolated Margin - V1 - // /api/v1/isolated/account/{symbol} +func TestAccountGetFuturesAccountRespModel(t *testing.T) { + // GetFuturesAccount + // Get Account - Futures + // /api/v1/account-overview - data := "{\n \"code\": \"200000\",\n \"data\": {\n \"symbol\": \"BTC-USDT\",\n \"status\": \"CLEAR\",\n \"debtRatio\": \"0\",\n \"baseAsset\": {\n \"currency\": \"BTC\",\n \"totalBalance\": \"0\",\n \"holdBalance\": \"0\",\n \"availableBalance\": \"0\",\n \"liability\": \"0\",\n \"interest\": \"0\",\n \"borrowableAmount\": \"0\"\n },\n \"quoteAsset\": {\n \"currency\": \"USDT\",\n \"totalBalance\": \"0.01\",\n \"holdBalance\": \"0\",\n \"availableBalance\": \"0.01\",\n \"liability\": \"0\",\n \"interest\": \"0\",\n \"borrowableAmount\": \"0\"\n }\n }\n}" + data := "{\n \"code\": \"200000\",\n \"data\": {\n \"currency\": \"USDT\",\n \"accountEquity\": 48.921913718,\n \"unrealisedPNL\": 1.59475,\n \"marginBalance\": 47.548728628,\n \"positionMargin\": 34.1577964733,\n \"orderMargin\": 0,\n \"frozenFunds\": 0,\n \"availableBalance\": 14.7876172447,\n \"riskRatio\": 0.0090285199\n }\n}" commonResp := &types.RestResponse{} err := json.Unmarshal([]byte(data), commonResp) assert.Nil(t, err) assert.NotNil(t, commonResp.Data) - resp := &GetIsolatedMarginAccountDetailV1Resp{} + resp := &GetFuturesAccountResp{} err = json.Unmarshal([]byte(commonResp.Data), resp) resp.ToMap() assert.Nil(t, err) } -func TestAccountGetIsolatedMarginAccountListV1ReqModel(t *testing.T) { - // GetIsolatedMarginAccountListV1 - // Get Account List - Isolated Margin - V1 - // /api/v1/isolated/accounts +func TestAccountGetSpotLedgerReqModel(t *testing.T) { + // GetSpotLedger + // Get Account Ledgers - Spot/Margin + // /api/v1/accounts/ledgers - data := "{\"balanceCurrency\": \"USDT\"}" - req := &GetIsolatedMarginAccountListV1Req{} + data := "{\"currency\": \"BTC\", \"direction\": \"in\", \"bizType\": \"TRANSFER\", \"startAt\": 1728663338000, \"endAt\": 1728692138000, \"currentPage\": 1, \"pageSize\": 50}" + req := &GetSpotLedgerReq{} err := json.Unmarshal([]byte(data), req) req.ToMap() assert.Nil(t, err) } -func TestAccountGetIsolatedMarginAccountListV1RespModel(t *testing.T) { - // GetIsolatedMarginAccountListV1 - // Get Account List - Isolated Margin - V1 - // /api/v1/isolated/accounts +func TestAccountGetSpotLedgerRespModel(t *testing.T) { + // GetSpotLedger + // Get Account Ledgers - Spot/Margin + // /api/v1/accounts/ledgers - data := "{\n \"code\": \"200000\",\n \"data\": {\n \"totalConversionBalance\": \"0.01\",\n \"liabilityConversionBalance\": \"0\",\n \"assets\": [\n {\n \"symbol\": \"BTC-USDT\",\n \"status\": \"CLEAR\",\n \"debtRatio\": \"0\",\n \"baseAsset\": {\n \"currency\": \"BTC\",\n \"totalBalance\": \"0\",\n \"holdBalance\": \"0\",\n \"availableBalance\": \"0\",\n \"liability\": \"0\",\n \"interest\": \"0\",\n \"borrowableAmount\": \"0\"\n },\n \"quoteAsset\": {\n \"currency\": \"USDT\",\n \"totalBalance\": \"0.01\",\n \"holdBalance\": \"0\",\n \"availableBalance\": \"0.01\",\n \"liability\": \"0\",\n \"interest\": \"0\",\n \"borrowableAmount\": \"0\"\n }\n }\n ]\n }\n}" + data := "{\n \"code\": \"200000\",\n \"data\": {\n \"currentPage\": 1,\n \"pageSize\": 50,\n \"totalNum\": 1,\n \"totalPage\": 1,\n \"items\": [\n {\n \"id\": \"265329987780896\",\n \"currency\": \"USDT\",\n \"amount\": \"0.01\",\n \"fee\": \"0\",\n \"balance\": \"0\",\n \"accountType\": \"TRADE\",\n \"bizType\": \"SUB_TRANSFER\",\n \"direction\": \"out\",\n \"createdAt\": 1728658481484,\n \"context\": \"\"\n }\n ]\n }\n}" commonResp := &types.RestResponse{} err := json.Unmarshal([]byte(data), commonResp) assert.Nil(t, err) assert.NotNil(t, commonResp.Data) - resp := &GetIsolatedMarginAccountListV1Resp{} + resp := &GetSpotLedgerResp{} err = json.Unmarshal([]byte(commonResp.Data), resp) resp.ToMap() assert.Nil(t, err) } -func TestAccountGetMarginAccountDetailReqModel(t *testing.T) { - // GetMarginAccountDetail - // Get Account Detail - Margin - // /api/v1/margin/account +func TestAccountGetSpotHFLedgerReqModel(t *testing.T) { + // GetSpotHFLedger + // Get Account Ledgers - Trade_hf + // /api/v1/hf/accounts/ledgers + data := "{\"currency\": \"BTC\", \"direction\": \"in\", \"bizType\": \"TRANSFER\", \"lastId\": 254062248624417, \"limit\": 100, \"startAt\": 1728663338000, \"endAt\": 1728692138000}" + req := &GetSpotHFLedgerReq{} + err := json.Unmarshal([]byte(data), req) + req.ToMap() + assert.Nil(t, err) } -func TestAccountGetMarginAccountDetailRespModel(t *testing.T) { - // GetMarginAccountDetail - // Get Account Detail - Margin - // /api/v1/margin/account +func TestAccountGetSpotHFLedgerRespModel(t *testing.T) { + // GetSpotHFLedger + // Get Account Ledgers - Trade_hf + // /api/v1/hf/accounts/ledgers - data := "{\n \"code\": \"200000\",\n \"data\": {\n \"debtRatio\": \"0\",\n \"accounts\": [\n {\n \"currency\": \"USDT\",\n \"totalBalance\": \"0.03\",\n \"availableBalance\": \"0.02\",\n \"holdBalance\": \"0.01\",\n \"liability\": \"0\",\n \"maxBorrowSize\": \"0\"\n }\n ]\n }\n}" + data := "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"id\": \"254062248624417\",\n \"currency\": \"USDT\",\n \"amount\": \"1.59760080\",\n \"fee\": \"0.00159920\",\n \"tax\": \"0\",\n \"balance\": \"26.73759503\",\n \"accountType\": \"TRADE_HF\",\n \"bizType\": \"TRADE_EXCHANGE\",\n \"direction\": \"in\",\n \"createdAt\": \"1728443957539\",\n \"context\": \"{\\\"symbol\\\":\\\"KCS-USDT\\\",\\\"orderId\\\":\\\"6705f6350dc7210007d6a36d\\\",\\\"tradeId\\\":\\\"10046097631627265\\\"}\"\n }\n ]\n}" commonResp := &types.RestResponse{} err := json.Unmarshal([]byte(data), commonResp) assert.Nil(t, err) assert.NotNil(t, commonResp.Data) - resp := &GetMarginAccountDetailResp{} + resp := &GetSpotHFLedgerResp{} err = json.Unmarshal([]byte(commonResp.Data), resp) resp.ToMap() assert.Nil(t, err) } -func TestAccountGetFuturesLedgerReqModel(t *testing.T) { - // GetFuturesLedger - // Get Account Ledgers - Futures - // /api/v1/transaction-history +func TestAccountGetMarginHFLedgerReqModel(t *testing.T) { + // GetMarginHFLedger + // Get Account Ledgers - Margin_hf + // /api/v3/hf/margin/account/ledgers - data := "{\"currency\": \"XBT\", \"type\": \"Transferin\", \"offset\": 254062248624417, \"forward\": true, \"maxCount\": 50, \"startAt\": 1728663338000, \"endAt\": 1728692138000}" - req := &GetFuturesLedgerReq{} + data := "{\"currency\": \"BTC\", \"direction\": \"in\", \"bizType\": \"TRANSFER\", \"lastId\": 254062248624417, \"limit\": 100, \"startAt\": 1728663338000, \"endAt\": 1728692138000}" + req := &GetMarginHFLedgerReq{} err := json.Unmarshal([]byte(data), req) req.ToMap() assert.Nil(t, err) } -func TestAccountGetFuturesLedgerRespModel(t *testing.T) { - // GetFuturesLedger - // Get Account Ledgers - Futures - // /api/v1/transaction-history +func TestAccountGetMarginHFLedgerRespModel(t *testing.T) { + // GetMarginHFLedger + // Get Account Ledgers - Margin_hf + // /api/v3/hf/margin/account/ledgers - data := "{\n \"code\": \"200000\",\n \"data\": {\n \"dataList\": [\n {\n \"time\": 1728665747000,\n \"type\": \"TransferIn\",\n \"amount\": 0.01,\n \"fee\": 0.0,\n \"accountEquity\": 14.02924938,\n \"status\": \"Completed\",\n \"remark\": \"Transferred from High-Frequency Trading Account\",\n \"offset\": 51360793,\n \"currency\": \"USDT\"\n },\n {\n \"time\": 1728648000000,\n \"type\": \"RealisedPNL\",\n \"amount\": 0.00630042,\n \"fee\": 0.0,\n \"accountEquity\": 20.0,\n \"status\": \"Completed\",\n \"remark\": \"XBTUSDTM\",\n \"offset\": 51352430,\n \"currency\": \"USDT\"\n }\n ],\n \"hasMore\": false\n }\n}" + data := "{\"code\":\"200000\",\"data\":[{\"id\":1949641706720,\"currency\":\"USDT\",\"amount\":\"0.01000000\",\"fee\":\"0.00000000\",\"balance\":\"0.01000000\",\"accountType\":\"MARGIN_V2\",\"bizType\":\"TRANSFER\",\"direction\":\"in\",\"createdAt\":1728664091208,\"context\":\"{}\",\"tax\":\"0.00000000\"}]}" commonResp := &types.RestResponse{} err := json.Unmarshal([]byte(data), commonResp) assert.Nil(t, err) assert.NotNil(t, commonResp.Data) - resp := &GetFuturesLedgerResp{} + resp := &GetMarginHFLedgerResp{} err = json.Unmarshal([]byte(commonResp.Data), resp) resp.ToMap() assert.Nil(t, err) } -func TestAccountGetApikeyInfoReqModel(t *testing.T) { - // GetApikeyInfo - // Get Apikey Info - // /api/v1/user/api-key - -} - -func TestAccountGetApikeyInfoRespModel(t *testing.T) { - // GetApikeyInfo - // Get Apikey Info - // /api/v1/user/api-key +func TestAccountGetFuturesLedgerReqModel(t *testing.T) { + // GetFuturesLedger + // Get Account Ledgers - Futures + // /api/v1/transaction-history - data := "{\n \"code\": \"200000\",\n \"data\": {\n \"remark\": \"account1\",\n \"apiKey\": \"6705f5c311545b000157d3eb\",\n \"apiVersion\": 3,\n \"permission\": \"General,Futures,Spot,Earn,InnerTransfer,Transfer,Margin\",\n \"ipWhitelist\": \"203.**.154,103.**.34\",\n \"createdAt\": 1728443843000,\n \"uid\": 165111215,\n \"isMaster\": true\n }\n}" - commonResp := &types.RestResponse{} - err := json.Unmarshal([]byte(data), commonResp) - assert.Nil(t, err) - assert.NotNil(t, commonResp.Data) - resp := &GetApikeyInfoResp{} - err = json.Unmarshal([]byte(commonResp.Data), resp) - resp.ToMap() + data := "{\"currency\": \"XBT\", \"type\": \"Transferin\", \"offset\": 254062248624417, \"forward\": true, \"maxCount\": 50, \"startAt\": 1728663338000, \"endAt\": 1728692138000}" + req := &GetFuturesLedgerReq{} + err := json.Unmarshal([]byte(data), req) + req.ToMap() assert.Nil(t, err) } -func TestAccountGetAccountInfoReqModel(t *testing.T) { - // GetAccountInfo - // Get Account Summary Info - // /api/v2/user-info - -} - -func TestAccountGetAccountInfoRespModel(t *testing.T) { - // GetAccountInfo - // Get Account Summary Info - // /api/v2/user-info +func TestAccountGetFuturesLedgerRespModel(t *testing.T) { + // GetFuturesLedger + // Get Account Ledgers - Futures + // /api/v1/transaction-history - data := "{\n \"code\": \"200000\",\n \"data\": {\n \"level\": 0,\n \"subQuantity\": 3,\n \"spotSubQuantity\": 3,\n \"marginSubQuantity\": 2,\n \"futuresSubQuantity\": 2,\n \"optionSubQuantity\": 0,\n \"maxSubQuantity\": 5,\n \"maxDefaultSubQuantity\": 5,\n \"maxSpotSubQuantity\": 0,\n \"maxMarginSubQuantity\": 0,\n \"maxFuturesSubQuantity\": 0,\n \"maxOptionSubQuantity\": 0\n }\n}" + data := "{\n \"code\": \"200000\",\n \"data\": {\n \"dataList\": [\n {\n \"time\": 1728665747000,\n \"type\": \"TransferIn\",\n \"amount\": 0.01,\n \"fee\": 0.0,\n \"accountEquity\": 14.02924938,\n \"status\": \"Completed\",\n \"remark\": \"Transferred from High-Frequency Trading Account\",\n \"offset\": 51360793,\n \"currency\": \"USDT\"\n },\n {\n \"time\": 1728648000000,\n \"type\": \"RealisedPNL\",\n \"amount\": 0.00630042,\n \"fee\": 0.0,\n \"accountEquity\": 20.0,\n \"status\": \"Completed\",\n \"remark\": \"XBTUSDTM\",\n \"offset\": 51352430,\n \"currency\": \"USDT\"\n }\n ],\n \"hasMore\": false\n }\n}" commonResp := &types.RestResponse{} err := json.Unmarshal([]byte(data), commonResp) assert.Nil(t, err) assert.NotNil(t, commonResp.Data) - resp := &GetAccountInfoResp{} + resp := &GetFuturesLedgerResp{} err = json.Unmarshal([]byte(commonResp.Data), resp) resp.ToMap() assert.Nil(t, err) } -func TestAccountGetMarginHFLedgerReqModel(t *testing.T) { - // GetMarginHFLedger - // Get Account Ledgers - Margin_hf - // /api/v3/hf/margin/account/ledgers +func TestAccountGetMarginAccountDetailReqModel(t *testing.T) { + // GetMarginAccountDetail + // Get Account Detail - Margin + // /api/v1/margin/account - data := "{\"currency\": \"BTC\", \"direction\": \"in\", \"bizType\": \"TRANSFER\", \"lastId\": 254062248624417, \"limit\": 100, \"startAt\": 1728663338000, \"endAt\": 1728692138000}" - req := &GetMarginHFLedgerReq{} - err := json.Unmarshal([]byte(data), req) - req.ToMap() - assert.Nil(t, err) } -func TestAccountGetMarginHFLedgerRespModel(t *testing.T) { - // GetMarginHFLedger - // Get Account Ledgers - Margin_hf - // /api/v3/hf/margin/account/ledgers +func TestAccountGetMarginAccountDetailRespModel(t *testing.T) { + // GetMarginAccountDetail + // Get Account Detail - Margin + // /api/v1/margin/account - data := "{\"code\":\"200000\",\"data\":[{\"id\":1949641706720,\"currency\":\"USDT\",\"amount\":\"0.01000000\",\"fee\":\"0.00000000\",\"balance\":\"0.01000000\",\"accountType\":\"MARGIN_V2\",\"bizType\":\"TRANSFER\",\"direction\":\"in\",\"createdAt\":1728664091208,\"context\":\"{}\",\"tax\":\"0.00000000\"}]}" + data := "{\n \"code\": \"200000\",\n \"data\": {\n \"debtRatio\": \"0\",\n \"accounts\": [\n {\n \"currency\": \"USDT\",\n \"totalBalance\": \"0.03\",\n \"availableBalance\": \"0.02\",\n \"holdBalance\": \"0.01\",\n \"liability\": \"0\",\n \"maxBorrowSize\": \"0\"\n }\n ]\n }\n}" commonResp := &types.RestResponse{} err := json.Unmarshal([]byte(data), commonResp) assert.Nil(t, err) assert.NotNil(t, commonResp.Data) - resp := &GetMarginHFLedgerResp{} + resp := &GetMarginAccountDetailResp{} err = json.Unmarshal([]byte(commonResp.Data), resp) resp.ToMap() assert.Nil(t, err) } -func TestAccountGetIsolatedMarginAccountReqModel(t *testing.T) { - // GetIsolatedMarginAccount - // Get Account - Isolated Margin - // /api/v3/isolated/accounts +func TestAccountGetIsolatedMarginAccountListV1ReqModel(t *testing.T) { + // GetIsolatedMarginAccountListV1 + // Get Account List - Isolated Margin - V1 + // /api/v1/isolated/accounts - data := "{\"symbol\": \"example_string_default_value\", \"quoteCurrency\": \"USDT\", \"queryType\": \"ISOLATED\"}" - req := &GetIsolatedMarginAccountReq{} + data := "{\"balanceCurrency\": \"USDT\"}" + req := &GetIsolatedMarginAccountListV1Req{} err := json.Unmarshal([]byte(data), req) req.ToMap() assert.Nil(t, err) } -func TestAccountGetIsolatedMarginAccountRespModel(t *testing.T) { - // GetIsolatedMarginAccount - // Get Account - Isolated Margin - // /api/v3/isolated/accounts +func TestAccountGetIsolatedMarginAccountListV1RespModel(t *testing.T) { + // GetIsolatedMarginAccountListV1 + // Get Account List - Isolated Margin - V1 + // /api/v1/isolated/accounts - data := "{\n \"code\": \"200000\",\n \"data\": {\n \"totalAssetOfQuoteCurrency\": \"0.01\",\n \"totalLiabilityOfQuoteCurrency\": \"0\",\n \"timestamp\": 1728725465994,\n \"assets\": [\n {\n \"symbol\": \"BTC-USDT\",\n \"status\": \"EFFECTIVE\",\n \"debtRatio\": \"0\",\n \"baseAsset\": {\n \"currency\": \"BTC\",\n \"borrowEnabled\": true,\n \"transferInEnabled\": true,\n \"liability\": \"0\",\n \"total\": \"0\",\n \"available\": \"0\",\n \"hold\": \"0\",\n \"maxBorrowSize\": \"0\"\n },\n \"quoteAsset\": {\n \"currency\": \"USDT\",\n \"borrowEnabled\": true,\n \"transferInEnabled\": true,\n \"liability\": \"0\",\n \"total\": \"0.01\",\n \"available\": \"0.01\",\n \"hold\": \"0\",\n \"maxBorrowSize\": \"0\"\n }\n }\n ]\n }\n}" + data := "{\n \"code\": \"200000\",\n \"data\": {\n \"totalConversionBalance\": \"0.01\",\n \"liabilityConversionBalance\": \"0\",\n \"assets\": [\n {\n \"symbol\": \"BTC-USDT\",\n \"status\": \"CLEAR\",\n \"debtRatio\": \"0\",\n \"baseAsset\": {\n \"currency\": \"BTC\",\n \"totalBalance\": \"0\",\n \"holdBalance\": \"0\",\n \"availableBalance\": \"0\",\n \"liability\": \"0\",\n \"interest\": \"0\",\n \"borrowableAmount\": \"0\"\n },\n \"quoteAsset\": {\n \"currency\": \"USDT\",\n \"totalBalance\": \"0.01\",\n \"holdBalance\": \"0\",\n \"availableBalance\": \"0.01\",\n \"liability\": \"0\",\n \"interest\": \"0\",\n \"borrowableAmount\": \"0\"\n }\n }\n ]\n }\n}" commonResp := &types.RestResponse{} err := json.Unmarshal([]byte(data), commonResp) assert.Nil(t, err) assert.NotNil(t, commonResp.Data) - resp := &GetIsolatedMarginAccountResp{} + resp := &GetIsolatedMarginAccountListV1Resp{} err = json.Unmarshal([]byte(commonResp.Data), resp) resp.ToMap() assert.Nil(t, err) } -func TestAccountGetCrossMarginAccountReqModel(t *testing.T) { - // GetCrossMarginAccount - // Get Account - Cross Margin - // /api/v3/margin/accounts +func TestAccountGetIsolatedMarginAccountDetailV1ReqModel(t *testing.T) { + // GetIsolatedMarginAccountDetailV1 + // Get Account Detail - Isolated Margin - V1 + // /api/v1/isolated/account/{symbol} - data := "{\"quoteCurrency\": \"USDT\", \"queryType\": \"MARGIN\"}" - req := &GetCrossMarginAccountReq{} + data := "{\"symbol\": \"example_string_default_value\"}" + req := &GetIsolatedMarginAccountDetailV1Req{} err := json.Unmarshal([]byte(data), req) req.ToMap() assert.Nil(t, err) } -func TestAccountGetCrossMarginAccountRespModel(t *testing.T) { - // GetCrossMarginAccount - // Get Account - Cross Margin - // /api/v3/margin/accounts +func TestAccountGetIsolatedMarginAccountDetailV1RespModel(t *testing.T) { + // GetIsolatedMarginAccountDetailV1 + // Get Account Detail - Isolated Margin - V1 + // /api/v1/isolated/account/{symbol} - data := "{\n \"code\": \"200000\",\n \"data\": {\n \"totalAssetOfQuoteCurrency\": \"0.02\",\n \"totalLiabilityOfQuoteCurrency\": \"0\",\n \"debtRatio\": \"0\",\n \"status\": \"EFFECTIVE\",\n \"accounts\": [\n {\n \"currency\": \"USDT\",\n \"total\": \"0.02\",\n \"available\": \"0.02\",\n \"hold\": \"0\",\n \"liability\": \"0\",\n \"maxBorrowSize\": \"0\",\n \"borrowEnabled\": true,\n \"transferInEnabled\": true\n }\n ]\n }\n}" + data := "{\n \"code\": \"200000\",\n \"data\": {\n \"symbol\": \"BTC-USDT\",\n \"status\": \"CLEAR\",\n \"debtRatio\": \"0\",\n \"baseAsset\": {\n \"currency\": \"BTC\",\n \"totalBalance\": \"0\",\n \"holdBalance\": \"0\",\n \"availableBalance\": \"0\",\n \"liability\": \"0\",\n \"interest\": \"0\",\n \"borrowableAmount\": \"0\"\n },\n \"quoteAsset\": {\n \"currency\": \"USDT\",\n \"totalBalance\": \"0.01\",\n \"holdBalance\": \"0\",\n \"availableBalance\": \"0.01\",\n \"liability\": \"0\",\n \"interest\": \"0\",\n \"borrowableAmount\": \"0\"\n }\n }\n}" commonResp := &types.RestResponse{} err := json.Unmarshal([]byte(data), commonResp) assert.Nil(t, err) assert.NotNil(t, commonResp.Data) - resp := &GetCrossMarginAccountResp{} + resp := &GetIsolatedMarginAccountDetailV1Resp{} err = json.Unmarshal([]byte(commonResp.Data), resp) resp.ToMap() assert.Nil(t, err) diff --git a/sdk/golang/pkg/generate/account/deposit/api_deposit.go b/sdk/golang/pkg/generate/account/deposit/api_deposit.go index e530f699..e14aa500 100644 --- a/sdk/golang/pkg/generate/account/deposit/api_deposit.go +++ b/sdk/golang/pkg/generate/account/deposit/api_deposit.go @@ -9,9 +9,9 @@ import ( type DepositAPI interface { - // GetDepositAddressV1 Get Deposit Addresses - V1 - // Description: Get all deposit addresses for the currency you intend to deposit. If the returned data is empty, you may need to Add Deposit Address first. - // Documentation: https://www.kucoin.com/docs-new/api-3470305 + // AddDepositAddressV3 Add Deposit Address(V3) + // Description: Request via this endpoint to create a deposit address for a currency you intend to deposit. + // Documentation: https://www.kucoin.com/docs-new/api-3470142 // +---------------------+------------+ // | Extra API Info | Value | // +---------------------+------------+ @@ -19,14 +19,13 @@ type DepositAPI interface { // | API-CHANNEL | PRIVATE | // | API-PERMISSION | GENERAL | // | API-RATE-LIMIT-POOL | MANAGEMENT | - // | API-RATE-LIMIT | 5 | + // | API-RATE-LIMIT | 20 | // +---------------------+------------+ - // Deprecated - GetDepositAddressV1(req *GetDepositAddressV1Req, ctx context.Context) (*GetDepositAddressV1Resp, error) + AddDepositAddressV3(req *AddDepositAddressV3Req, ctx context.Context) (*AddDepositAddressV3Resp, error) - // AddDepositAddressV1 Add Deposit Address - V1 - // Description: Request via this endpoint to create a deposit address for a currency you intend to deposit. - // Documentation: https://www.kucoin.com/docs-new/api-3470309 + // GetDepositAddressV3 Get Deposit Address(V3) + // Description: Get all deposit addresses for the currency you intend to deposit. If the returned data is empty, you may need to Add Deposit Address first. + // Documentation: https://www.kucoin.com/docs-new/api-3470140 // +---------------------+------------+ // | Extra API Info | Value | // +---------------------+------------+ @@ -34,10 +33,9 @@ type DepositAPI interface { // | API-CHANNEL | PRIVATE | // | API-PERMISSION | GENERAL | // | API-RATE-LIMIT-POOL | MANAGEMENT | - // | API-RATE-LIMIT | 20 | + // | API-RATE-LIMIT | 5 | // +---------------------+------------+ - // Deprecated - AddDepositAddressV1(req *AddDepositAddressV1Req, ctx context.Context) (*AddDepositAddressV1Resp, error) + GetDepositAddressV3(req *GetDepositAddressV3Req, ctx context.Context) (*GetDepositAddressV3Resp, error) // GetDepositHistory Get Deposit History // Description: Request via this endpoint to get deposit list Items are paginated and sorted to show the latest first. See the Pagination section for retrieving additional entries after the first page. @@ -53,9 +51,9 @@ type DepositAPI interface { // +---------------------+------------+ GetDepositHistory(req *GetDepositHistoryReq, ctx context.Context) (*GetDepositHistoryResp, error) - // GetDepositHistoryOld Get Deposit History - Old - // Description: Request via this endpoint to get the V1 historical deposits list on KuCoin. The return value is the data after Pagination, sorted in descending order according to time. - // Documentation: https://www.kucoin.com/docs-new/api-3470306 + // GetDepositAddressV2 Get Deposit Addresses(V2) + // Description: Get all deposit addresses for the currency you intend to deposit. If the returned data is empty, you may need to Add Deposit Address first. + // Documentation: https://www.kucoin.com/docs-new/api-3470300 // +---------------------+------------+ // | Extra API Info | Value | // +---------------------+------------+ @@ -66,11 +64,11 @@ type DepositAPI interface { // | API-RATE-LIMIT | 5 | // +---------------------+------------+ // Deprecated - GetDepositHistoryOld(req *GetDepositHistoryOldReq, ctx context.Context) (*GetDepositHistoryOldResp, error) + GetDepositAddressV2(req *GetDepositAddressV2Req, ctx context.Context) (*GetDepositAddressV2Resp, error) - // GetDepositAddressV2 Get Deposit Addresses(V2) + // GetDepositAddressV1 Get Deposit Addresses - V1 // Description: Get all deposit addresses for the currency you intend to deposit. If the returned data is empty, you may need to Add Deposit Address first. - // Documentation: https://www.kucoin.com/docs-new/api-3470300 + // Documentation: https://www.kucoin.com/docs-new/api-3470305 // +---------------------+------------+ // | Extra API Info | Value | // +---------------------+------------+ @@ -81,11 +79,11 @@ type DepositAPI interface { // | API-RATE-LIMIT | 5 | // +---------------------+------------+ // Deprecated - GetDepositAddressV2(req *GetDepositAddressV2Req, ctx context.Context) (*GetDepositAddressV2Resp, error) + GetDepositAddressV1(req *GetDepositAddressV1Req, ctx context.Context) (*GetDepositAddressV1Resp, error) - // AddDepositAddressV3 Add Deposit Address(V3) - // Description: Request via this endpoint to create a deposit address for a currency you intend to deposit. - // Documentation: https://www.kucoin.com/docs-new/api-3470142 + // GetDepositHistoryOld Get Deposit History - Old + // Description: Request via this endpoint to get the V1 historical deposits list on KuCoin. The return value is the data after Pagination, sorted in descending order according to time. + // Documentation: https://www.kucoin.com/docs-new/api-3470306 // +---------------------+------------+ // | Extra API Info | Value | // +---------------------+------------+ @@ -93,13 +91,14 @@ type DepositAPI interface { // | API-CHANNEL | PRIVATE | // | API-PERMISSION | GENERAL | // | API-RATE-LIMIT-POOL | MANAGEMENT | - // | API-RATE-LIMIT | 20 | + // | API-RATE-LIMIT | 5 | // +---------------------+------------+ - AddDepositAddressV3(req *AddDepositAddressV3Req, ctx context.Context) (*AddDepositAddressV3Resp, error) + // Deprecated + GetDepositHistoryOld(req *GetDepositHistoryOldReq, ctx context.Context) (*GetDepositHistoryOldResp, error) - // GetDepositAddressV3 Get Deposit Address(V3) - // Description: Get all deposit addresses for the currency you intend to deposit. If the returned data is empty, you may need to Add Deposit Address first. - // Documentation: https://www.kucoin.com/docs-new/api-3470140 + // AddDepositAddressV1 Add Deposit Address - V1 + // Description: Request via this endpoint to create a deposit address for a currency you intend to deposit. + // Documentation: https://www.kucoin.com/docs-new/api-3470309 // +---------------------+------------+ // | Extra API Info | Value | // +---------------------+------------+ @@ -107,9 +106,10 @@ type DepositAPI interface { // | API-CHANNEL | PRIVATE | // | API-PERMISSION | GENERAL | // | API-RATE-LIMIT-POOL | MANAGEMENT | - // | API-RATE-LIMIT | 5 | + // | API-RATE-LIMIT | 20 | // +---------------------+------------+ - GetDepositAddressV3(req *GetDepositAddressV3Req, ctx context.Context) (*GetDepositAddressV3Resp, error) + // Deprecated + AddDepositAddressV1(req *AddDepositAddressV1Req, ctx context.Context) (*AddDepositAddressV1Resp, error) } type DepositAPIImpl struct { @@ -120,15 +120,15 @@ func NewDepositAPIImp(transport interfaces.Transport) *DepositAPIImpl { return &DepositAPIImpl{transport: transport} } -func (impl *DepositAPIImpl) GetDepositAddressV1(req *GetDepositAddressV1Req, ctx context.Context) (*GetDepositAddressV1Resp, error) { - resp := &GetDepositAddressV1Resp{} - err := impl.transport.Call(ctx, "spot", false, "Get", "/api/v1/deposit-addresses", req, resp, false) +func (impl *DepositAPIImpl) AddDepositAddressV3(req *AddDepositAddressV3Req, ctx context.Context) (*AddDepositAddressV3Resp, error) { + resp := &AddDepositAddressV3Resp{} + err := impl.transport.Call(ctx, "spot", false, "Post", "/api/v3/deposit-address/create", req, resp, false) return resp, err } -func (impl *DepositAPIImpl) AddDepositAddressV1(req *AddDepositAddressV1Req, ctx context.Context) (*AddDepositAddressV1Resp, error) { - resp := &AddDepositAddressV1Resp{} - err := impl.transport.Call(ctx, "spot", false, "Post", "/api/v1/deposit-addresses", req, resp, false) +func (impl *DepositAPIImpl) GetDepositAddressV3(req *GetDepositAddressV3Req, ctx context.Context) (*GetDepositAddressV3Resp, error) { + resp := &GetDepositAddressV3Resp{} + err := impl.transport.Call(ctx, "spot", false, "Get", "/api/v3/deposit-addresses", req, resp, false) return resp, err } @@ -138,26 +138,26 @@ func (impl *DepositAPIImpl) GetDepositHistory(req *GetDepositHistoryReq, ctx con return resp, err } -func (impl *DepositAPIImpl) GetDepositHistoryOld(req *GetDepositHistoryOldReq, ctx context.Context) (*GetDepositHistoryOldResp, error) { - resp := &GetDepositHistoryOldResp{} - err := impl.transport.Call(ctx, "spot", false, "Get", "/api/v1/hist-deposits", req, resp, false) - return resp, err -} - func (impl *DepositAPIImpl) GetDepositAddressV2(req *GetDepositAddressV2Req, ctx context.Context) (*GetDepositAddressV2Resp, error) { resp := &GetDepositAddressV2Resp{} err := impl.transport.Call(ctx, "spot", false, "Get", "/api/v2/deposit-addresses", req, resp, false) return resp, err } -func (impl *DepositAPIImpl) AddDepositAddressV3(req *AddDepositAddressV3Req, ctx context.Context) (*AddDepositAddressV3Resp, error) { - resp := &AddDepositAddressV3Resp{} - err := impl.transport.Call(ctx, "spot", false, "Post", "/api/v3/deposit-address/create", req, resp, false) +func (impl *DepositAPIImpl) GetDepositAddressV1(req *GetDepositAddressV1Req, ctx context.Context) (*GetDepositAddressV1Resp, error) { + resp := &GetDepositAddressV1Resp{} + err := impl.transport.Call(ctx, "spot", false, "Get", "/api/v1/deposit-addresses", req, resp, false) return resp, err } -func (impl *DepositAPIImpl) GetDepositAddressV3(req *GetDepositAddressV3Req, ctx context.Context) (*GetDepositAddressV3Resp, error) { - resp := &GetDepositAddressV3Resp{} - err := impl.transport.Call(ctx, "spot", false, "Get", "/api/v3/deposit-addresses", req, resp, false) +func (impl *DepositAPIImpl) GetDepositHistoryOld(req *GetDepositHistoryOldReq, ctx context.Context) (*GetDepositHistoryOldResp, error) { + resp := &GetDepositHistoryOldResp{} + err := impl.transport.Call(ctx, "spot", false, "Get", "/api/v1/hist-deposits", req, resp, false) + return resp, err +} + +func (impl *DepositAPIImpl) AddDepositAddressV1(req *AddDepositAddressV1Req, ctx context.Context) (*AddDepositAddressV1Resp, error) { + resp := &AddDepositAddressV1Resp{} + err := impl.transport.Call(ctx, "spot", false, "Post", "/api/v1/deposit-addresses", req, resp, false) return resp, err } diff --git a/sdk/golang/pkg/generate/account/deposit/api_deposit.template b/sdk/golang/pkg/generate/account/deposit/api_deposit.template index 451a3fc0..993bec7e 100644 --- a/sdk/golang/pkg/generate/account/deposit/api_deposit.template +++ b/sdk/golang/pkg/generate/account/deposit/api_deposit.template @@ -1,16 +1,16 @@ # API FUNCTION TEMPLATE -func TestDepositGetDepositAddressV1Req(t *testing.T) { - // GetDepositAddressV1 - // Get Deposit Addresses - V1 - // /api/v1/deposit-addresses +func TestDepositAddDepositAddressV3Req(t *testing.T) { + // AddDepositAddressV3 + // Add Deposit Address(V3) + // /api/v3/deposit-address/create - builder := deposit.NewGetDepositAddressV1ReqBuilder() - builder.SetCurrency(?).SetChain(?) + builder := deposit.NewAddDepositAddressV3ReqBuilder() + builder.SetCurrency(?).SetChain(?).SetTo(?).SetAmount(?) req := builder.Build() - resp, err := depositApi.GetDepositAddressV1(req, context.TODO()) + resp, err := depositApi.AddDepositAddressV3(req, context.TODO()) if err != nil { panic(err) } @@ -24,16 +24,16 @@ func TestDepositGetDepositAddressV1Req(t *testing.T) { } -func TestDepositAddDepositAddressV1Req(t *testing.T) { - // AddDepositAddressV1 - // Add Deposit Address - V1 - // /api/v1/deposit-addresses +func TestDepositGetDepositAddressV3Req(t *testing.T) { + // GetDepositAddressV3 + // Get Deposit Address(V3) + // /api/v3/deposit-addresses - builder := deposit.NewAddDepositAddressV1ReqBuilder() - builder.SetCurrency(?).SetChain(?) + builder := deposit.NewGetDepositAddressV3ReqBuilder() + builder.SetCurrency(?).SetAmount(?).SetChain(?) req := builder.Build() - resp, err := depositApi.AddDepositAddressV1(req, context.TODO()) + resp, err := depositApi.GetDepositAddressV3(req, context.TODO()) if err != nil { panic(err) } @@ -70,16 +70,16 @@ func TestDepositGetDepositHistoryReq(t *testing.T) { } -func TestDepositGetDepositHistoryOldReq(t *testing.T) { - // GetDepositHistoryOld - // Get Deposit History - Old - // /api/v1/hist-deposits +func TestDepositGetDepositAddressV2Req(t *testing.T) { + // GetDepositAddressV2 + // Get Deposit Addresses(V2) + // /api/v2/deposit-addresses - builder := deposit.NewGetDepositHistoryOldReqBuilder() - builder.SetCurrency(?).SetStatus(?).SetStartAt(?).SetEndAt(?) + builder := deposit.NewGetDepositAddressV2ReqBuilder() + builder.SetCurrency(?) req := builder.Build() - resp, err := depositApi.GetDepositHistoryOld(req, context.TODO()) + resp, err := depositApi.GetDepositAddressV2(req, context.TODO()) if err != nil { panic(err) } @@ -93,16 +93,16 @@ func TestDepositGetDepositHistoryOldReq(t *testing.T) { } -func TestDepositGetDepositAddressV2Req(t *testing.T) { - // GetDepositAddressV2 - // Get Deposit Addresses(V2) - // /api/v2/deposit-addresses +func TestDepositGetDepositAddressV1Req(t *testing.T) { + // GetDepositAddressV1 + // Get Deposit Addresses - V1 + // /api/v1/deposit-addresses - builder := deposit.NewGetDepositAddressV2ReqBuilder() - builder.SetCurrency(?) + builder := deposit.NewGetDepositAddressV1ReqBuilder() + builder.SetCurrency(?).SetChain(?) req := builder.Build() - resp, err := depositApi.GetDepositAddressV2(req, context.TODO()) + resp, err := depositApi.GetDepositAddressV1(req, context.TODO()) if err != nil { panic(err) } @@ -116,16 +116,16 @@ func TestDepositGetDepositAddressV2Req(t *testing.T) { } -func TestDepositAddDepositAddressV3Req(t *testing.T) { - // AddDepositAddressV3 - // Add Deposit Address(V3) - // /api/v3/deposit-address/create +func TestDepositGetDepositHistoryOldReq(t *testing.T) { + // GetDepositHistoryOld + // Get Deposit History - Old + // /api/v1/hist-deposits - builder := deposit.NewAddDepositAddressV3ReqBuilder() - builder.SetCurrency(?).SetChain(?).SetTo(?).SetAmount(?) + builder := deposit.NewGetDepositHistoryOldReqBuilder() + builder.SetCurrency(?).SetStatus(?).SetStartAt(?).SetEndAt(?) req := builder.Build() - resp, err := depositApi.AddDepositAddressV3(req, context.TODO()) + resp, err := depositApi.GetDepositHistoryOld(req, context.TODO()) if err != nil { panic(err) } @@ -139,16 +139,16 @@ func TestDepositAddDepositAddressV3Req(t *testing.T) { } -func TestDepositGetDepositAddressV3Req(t *testing.T) { - // GetDepositAddressV3 - // Get Deposit Address(V3) - // /api/v3/deposit-addresses +func TestDepositAddDepositAddressV1Req(t *testing.T) { + // AddDepositAddressV1 + // Add Deposit Address - V1 + // /api/v1/deposit-addresses - builder := deposit.NewGetDepositAddressV3ReqBuilder() - builder.SetCurrency(?).SetAmount(?).SetChain(?) + builder := deposit.NewAddDepositAddressV1ReqBuilder() + builder.SetCurrency(?).SetChain(?) req := builder.Build() - resp, err := depositApi.GetDepositAddressV3(req, context.TODO()) + resp, err := depositApi.AddDepositAddressV1(req, context.TODO()) if err != nil { panic(err) } diff --git a/sdk/golang/pkg/generate/account/deposit/api_deposit_test.go b/sdk/golang/pkg/generate/account/deposit/api_deposit_test.go index ff6b1cee..6a1fdfd7 100644 --- a/sdk/golang/pkg/generate/account/deposit/api_deposit_test.go +++ b/sdk/golang/pkg/generate/account/deposit/api_deposit_test.go @@ -7,57 +7,57 @@ import ( "testing" ) -func TestDepositGetDepositAddressV1ReqModel(t *testing.T) { - // GetDepositAddressV1 - // Get Deposit Addresses - V1 - // /api/v1/deposit-addresses +func TestDepositAddDepositAddressV3ReqModel(t *testing.T) { + // AddDepositAddressV3 + // Add Deposit Address(V3) + // /api/v3/deposit-address/create - data := "{\"currency\": \"BTC\", \"chain\": \"eth\"}" - req := &GetDepositAddressV1Req{} + data := "{\"currency\": \"TON\", \"chain\": \"ton\", \"to\": \"trade\"}" + req := &AddDepositAddressV3Req{} err := json.Unmarshal([]byte(data), req) req.ToMap() assert.Nil(t, err) } -func TestDepositGetDepositAddressV1RespModel(t *testing.T) { - // GetDepositAddressV1 - // Get Deposit Addresses - V1 - // /api/v1/deposit-addresses +func TestDepositAddDepositAddressV3RespModel(t *testing.T) { + // AddDepositAddressV3 + // Add Deposit Address(V3) + // /api/v3/deposit-address/create - data := "{\n \"code\": \"200000\",\n \"data\": {\n \"address\": \"0xea220bf61c3c2b0adc2cfa29fec3d2677745a379\",\n \"memo\": \"\",\n \"chain\": \"ERC20\",\n \"chainId\": \"eth\",\n \"to\": \"MAIN\",\n \"currency\": \"USDT\"\n }\n}" + data := "{\"code\":\"200000\",\"data\":{\"address\":\"EQCA1BI4QRZ8qYmskSRDzJmkucGodYRTZCf_b9hckjla6dZl\",\"memo\":\"2090821203\",\"chainId\":\"ton\",\"to\":\"TRADE\",\"expirationDate\":0,\"currency\":\"TON\",\"chainName\":\"TON\"}}" commonResp := &types.RestResponse{} err := json.Unmarshal([]byte(data), commonResp) assert.Nil(t, err) assert.NotNil(t, commonResp.Data) - resp := &GetDepositAddressV1Resp{} + resp := &AddDepositAddressV3Resp{} err = json.Unmarshal([]byte(commonResp.Data), resp) resp.ToMap() assert.Nil(t, err) } -func TestDepositAddDepositAddressV1ReqModel(t *testing.T) { - // AddDepositAddressV1 - // Add Deposit Address - V1 - // /api/v1/deposit-addresses +func TestDepositGetDepositAddressV3ReqModel(t *testing.T) { + // GetDepositAddressV3 + // Get Deposit Address(V3) + // /api/v3/deposit-addresses - data := "{\"currency\": \"ETH\", \"chain\": \"eth\"}" - req := &AddDepositAddressV1Req{} + data := "{\"currency\": \"BTC\", \"amount\": \"example_string_default_value\", \"chain\": \"example_string_default_value\"}" + req := &GetDepositAddressV3Req{} err := json.Unmarshal([]byte(data), req) req.ToMap() assert.Nil(t, err) } -func TestDepositAddDepositAddressV1RespModel(t *testing.T) { - // AddDepositAddressV1 - // Add Deposit Address - V1 - // /api/v1/deposit-addresses +func TestDepositGetDepositAddressV3RespModel(t *testing.T) { + // GetDepositAddressV3 + // Get Deposit Address(V3) + // /api/v3/deposit-addresses - data := "{\"code\":\"200000\",\"data\":{\"address\":\"0x02028456f38e78609904e8a002c787ede7a73d7c\",\"memo\":null,\"chain\":\"ERC20\",\"chainId\":\"eth\",\"to\":\"MAIN\",\"currency\":\"ETH\"}}" + data := "{\"code\":\"200000\",\"data\":[{\"address\":\"TSv3L1fS7yA3SxzKD8c1qdX4nLP6rqNxYz\",\"memo\":\"\",\"chainId\":\"trx\",\"to\":\"TRADE\",\"expirationDate\":0,\"currency\":\"USDT\",\"contractAddress\":\"TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t\",\"chainName\":\"TRC20\"},{\"address\":\"0x551e823a3b36865e8c5dc6e6ac6cc0b00d98533e\",\"memo\":\"\",\"chainId\":\"kcc\",\"to\":\"TRADE\",\"expirationDate\":0,\"currency\":\"USDT\",\"contractAddress\":\"0x0039f574ee5cc39bdd162e9a88e3eb1f111baf48\",\"chainName\":\"KCC\"},{\"address\":\"EQCA1BI4QRZ8qYmskSRDzJmkucGodYRTZCf_b9hckjla6dZl\",\"memo\":\"2085202643\",\"chainId\":\"ton\",\"to\":\"TRADE\",\"expirationDate\":0,\"currency\":\"USDT\",\"contractAddress\":\"EQCxE6mUtQJKFnGfaROTKOt1lZbDiiX1kCixRv7Nw2Id_sDs\",\"chainName\":\"TON\"},{\"address\":\"0x0a2586d5a901c8e7e68f6b0dc83bfd8bd8600ff5\",\"memo\":\"\",\"chainId\":\"eth\",\"to\":\"MAIN\",\"expirationDate\":0,\"currency\":\"USDT\",\"contractAddress\":\"0xdac17f958d2ee523a2206206994597c13d831ec7\",\"chainName\":\"ERC20\"}]}" commonResp := &types.RestResponse{} err := json.Unmarshal([]byte(data), commonResp) assert.Nil(t, err) assert.NotNil(t, commonResp.Data) - resp := &AddDepositAddressV1Resp{} + resp := &GetDepositAddressV3Resp{} err = json.Unmarshal([]byte(commonResp.Data), resp) resp.ToMap() assert.Nil(t, err) @@ -91,113 +91,113 @@ func TestDepositGetDepositHistoryRespModel(t *testing.T) { assert.Nil(t, err) } -func TestDepositGetDepositHistoryOldReqModel(t *testing.T) { - // GetDepositHistoryOld - // Get Deposit History - Old - // /api/v1/hist-deposits +func TestDepositGetDepositAddressV2ReqModel(t *testing.T) { + // GetDepositAddressV2 + // Get Deposit Addresses(V2) + // /api/v2/deposit-addresses - data := "{\"currency\": \"BTC\", \"status\": \"SUCCESS\", \"startAt\": 1728663338000, \"endAt\": 1728692138000}" - req := &GetDepositHistoryOldReq{} + data := "{\"currency\": \"BTC\"}" + req := &GetDepositAddressV2Req{} err := json.Unmarshal([]byte(data), req) req.ToMap() assert.Nil(t, err) } -func TestDepositGetDepositHistoryOldRespModel(t *testing.T) { - // GetDepositHistoryOld - // Get Deposit History - Old - // /api/v1/hist-deposits +func TestDepositGetDepositAddressV2RespModel(t *testing.T) { + // GetDepositAddressV2 + // Get Deposit Addresses(V2) + // /api/v2/deposit-addresses - data := "{\n \"code\": \"200000\",\n \"data\": {\n \"currentPage\": 1,\n \"pageSize\": 50,\n \"totalNum\": 0,\n \"totalPage\": 0,\n \"items\": [\n {\n \"currency\": \"BTC\",\n \"createAt\": 1528536998,\n \"amount\": \"0.03266638\",\n \"walletTxId\": \"55c643bc2c68d6f17266383ac1be9e454038864b929ae7cee0bc408cc5c869e8@12ffGWmMMD1zA1WbFm7Ho3JZ1w6NYXjpFk@234\",\n \"isInner\": false,\n \"status\": \"SUCCESS\"\n }\n ]\n }\n}" + data := "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"address\": \"0x02028456*****87ede7a73d7c\",\n \"memo\": \"\",\n \"chain\": \"ERC20\",\n \"chainId\": \"eth\",\n \"to\": \"MAIN\",\n \"currency\": \"ETH\",\n \"contractAddress\": \"\"\n }\n ]\n}" commonResp := &types.RestResponse{} err := json.Unmarshal([]byte(data), commonResp) assert.Nil(t, err) assert.NotNil(t, commonResp.Data) - resp := &GetDepositHistoryOldResp{} + resp := &GetDepositAddressV2Resp{} err = json.Unmarshal([]byte(commonResp.Data), resp) resp.ToMap() assert.Nil(t, err) } -func TestDepositGetDepositAddressV2ReqModel(t *testing.T) { - // GetDepositAddressV2 - // Get Deposit Addresses(V2) - // /api/v2/deposit-addresses +func TestDepositGetDepositAddressV1ReqModel(t *testing.T) { + // GetDepositAddressV1 + // Get Deposit Addresses - V1 + // /api/v1/deposit-addresses - data := "{\"currency\": \"BTC\"}" - req := &GetDepositAddressV2Req{} + data := "{\"currency\": \"BTC\", \"chain\": \"eth\"}" + req := &GetDepositAddressV1Req{} err := json.Unmarshal([]byte(data), req) req.ToMap() assert.Nil(t, err) } -func TestDepositGetDepositAddressV2RespModel(t *testing.T) { - // GetDepositAddressV2 - // Get Deposit Addresses(V2) - // /api/v2/deposit-addresses +func TestDepositGetDepositAddressV1RespModel(t *testing.T) { + // GetDepositAddressV1 + // Get Deposit Addresses - V1 + // /api/v1/deposit-addresses - data := "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"address\": \"0x02028456*****87ede7a73d7c\",\n \"memo\": \"\",\n \"chain\": \"ERC20\",\n \"chainId\": \"eth\",\n \"to\": \"MAIN\",\n \"currency\": \"ETH\",\n \"contractAddress\": \"\"\n }\n ]\n}" + data := "{\n \"code\": \"200000\",\n \"data\": {\n \"address\": \"0xea220bf61c3c2b0adc2cfa29fec3d2677745a379\",\n \"memo\": \"\",\n \"chain\": \"ERC20\",\n \"chainId\": \"eth\",\n \"to\": \"MAIN\",\n \"currency\": \"USDT\"\n }\n}" commonResp := &types.RestResponse{} err := json.Unmarshal([]byte(data), commonResp) assert.Nil(t, err) assert.NotNil(t, commonResp.Data) - resp := &GetDepositAddressV2Resp{} + resp := &GetDepositAddressV1Resp{} err = json.Unmarshal([]byte(commonResp.Data), resp) resp.ToMap() assert.Nil(t, err) } -func TestDepositAddDepositAddressV3ReqModel(t *testing.T) { - // AddDepositAddressV3 - // Add Deposit Address(V3) - // /api/v3/deposit-address/create +func TestDepositGetDepositHistoryOldReqModel(t *testing.T) { + // GetDepositHistoryOld + // Get Deposit History - Old + // /api/v1/hist-deposits - data := "{\"currency\": \"TON\", \"chain\": \"ton\", \"to\": \"trade\"}" - req := &AddDepositAddressV3Req{} + data := "{\"currency\": \"BTC\", \"status\": \"SUCCESS\", \"startAt\": 1728663338000, \"endAt\": 1728692138000}" + req := &GetDepositHistoryOldReq{} err := json.Unmarshal([]byte(data), req) req.ToMap() assert.Nil(t, err) } -func TestDepositAddDepositAddressV3RespModel(t *testing.T) { - // AddDepositAddressV3 - // Add Deposit Address(V3) - // /api/v3/deposit-address/create +func TestDepositGetDepositHistoryOldRespModel(t *testing.T) { + // GetDepositHistoryOld + // Get Deposit History - Old + // /api/v1/hist-deposits - data := "{\"code\":\"200000\",\"data\":{\"address\":\"EQCA1BI4QRZ8qYmskSRDzJmkucGodYRTZCf_b9hckjla6dZl\",\"memo\":\"2090821203\",\"chainId\":\"ton\",\"to\":\"TRADE\",\"expirationDate\":0,\"currency\":\"TON\",\"chainName\":\"TON\"}}" + data := "{\n \"code\": \"200000\",\n \"data\": {\n \"currentPage\": 1,\n \"pageSize\": 50,\n \"totalNum\": 0,\n \"totalPage\": 0,\n \"items\": [\n {\n \"currency\": \"BTC\",\n \"createAt\": 1528536998,\n \"amount\": \"0.03266638\",\n \"walletTxId\": \"55c643bc2c68d6f17266383ac1be9e454038864b929ae7cee0bc408cc5c869e8@12ffGWmMMD1zA1WbFm7Ho3JZ1w6NYXjpFk@234\",\n \"isInner\": false,\n \"status\": \"SUCCESS\"\n }\n ]\n }\n}" commonResp := &types.RestResponse{} err := json.Unmarshal([]byte(data), commonResp) assert.Nil(t, err) assert.NotNil(t, commonResp.Data) - resp := &AddDepositAddressV3Resp{} + resp := &GetDepositHistoryOldResp{} err = json.Unmarshal([]byte(commonResp.Data), resp) resp.ToMap() assert.Nil(t, err) } -func TestDepositGetDepositAddressV3ReqModel(t *testing.T) { - // GetDepositAddressV3 - // Get Deposit Address(V3) - // /api/v3/deposit-addresses +func TestDepositAddDepositAddressV1ReqModel(t *testing.T) { + // AddDepositAddressV1 + // Add Deposit Address - V1 + // /api/v1/deposit-addresses - data := "{\"currency\": \"BTC\", \"amount\": \"example_string_default_value\", \"chain\": \"example_string_default_value\"}" - req := &GetDepositAddressV3Req{} + data := "{\"currency\": \"ETH\", \"chain\": \"eth\"}" + req := &AddDepositAddressV1Req{} err := json.Unmarshal([]byte(data), req) req.ToMap() assert.Nil(t, err) } -func TestDepositGetDepositAddressV3RespModel(t *testing.T) { - // GetDepositAddressV3 - // Get Deposit Address(V3) - // /api/v3/deposit-addresses +func TestDepositAddDepositAddressV1RespModel(t *testing.T) { + // AddDepositAddressV1 + // Add Deposit Address - V1 + // /api/v1/deposit-addresses - data := "{\"code\":\"200000\",\"data\":[{\"address\":\"TSv3L1fS7yA3SxzKD8c1qdX4nLP6rqNxYz\",\"memo\":\"\",\"chainId\":\"trx\",\"to\":\"TRADE\",\"expirationDate\":0,\"currency\":\"USDT\",\"contractAddress\":\"TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t\",\"chainName\":\"TRC20\"},{\"address\":\"0x551e823a3b36865e8c5dc6e6ac6cc0b00d98533e\",\"memo\":\"\",\"chainId\":\"kcc\",\"to\":\"TRADE\",\"expirationDate\":0,\"currency\":\"USDT\",\"contractAddress\":\"0x0039f574ee5cc39bdd162e9a88e3eb1f111baf48\",\"chainName\":\"KCC\"},{\"address\":\"EQCA1BI4QRZ8qYmskSRDzJmkucGodYRTZCf_b9hckjla6dZl\",\"memo\":\"2085202643\",\"chainId\":\"ton\",\"to\":\"TRADE\",\"expirationDate\":0,\"currency\":\"USDT\",\"contractAddress\":\"EQCxE6mUtQJKFnGfaROTKOt1lZbDiiX1kCixRv7Nw2Id_sDs\",\"chainName\":\"TON\"},{\"address\":\"0x0a2586d5a901c8e7e68f6b0dc83bfd8bd8600ff5\",\"memo\":\"\",\"chainId\":\"eth\",\"to\":\"MAIN\",\"expirationDate\":0,\"currency\":\"USDT\",\"contractAddress\":\"0xdac17f958d2ee523a2206206994597c13d831ec7\",\"chainName\":\"ERC20\"}]}" + data := "{\"code\":\"200000\",\"data\":{\"address\":\"0x02028456f38e78609904e8a002c787ede7a73d7c\",\"memo\":null,\"chain\":\"ERC20\",\"chainId\":\"eth\",\"to\":\"MAIN\",\"currency\":\"ETH\"}}" commonResp := &types.RestResponse{} err := json.Unmarshal([]byte(data), commonResp) assert.Nil(t, err) assert.NotNil(t, commonResp.Data) - resp := &GetDepositAddressV3Resp{} + resp := &AddDepositAddressV1Resp{} err = json.Unmarshal([]byte(commonResp.Data), resp) resp.ToMap() assert.Nil(t, err) diff --git a/sdk/golang/pkg/generate/account/subaccount/api_sub_account.go b/sdk/golang/pkg/generate/account/subaccount/api_sub_account.go index 7ebfca01..093058f1 100644 --- a/sdk/golang/pkg/generate/account/subaccount/api_sub_account.go +++ b/sdk/golang/pkg/generate/account/subaccount/api_sub_account.go @@ -9,23 +9,9 @@ import ( type SubAccountAPI interface { - // GetFuturesSubAccountListV2 Get SubAccount List - Futures Balance(V2) - // Description: This endpoint can be used to get Futures sub-account information. - // Documentation: https://www.kucoin.com/docs-new/api-3470134 - // +---------------------+---------+ - // | Extra API Info | Value | - // +---------------------+---------+ - // | API-DOMAIN | FUTURES | - // | API-CHANNEL | PRIVATE | - // | API-PERMISSION | GENERAL | - // | API-RATE-LIMIT-POOL | FUTURES | - // | API-RATE-LIMIT | 6 | - // +---------------------+---------+ - GetFuturesSubAccountListV2(req *GetFuturesSubAccountListV2Req, ctx context.Context) (*GetFuturesSubAccountListV2Resp, error) - - // GetSpotSubAccountListV1 Get SubAccount List - Spot Balance(V1) - // Description: This endpoint returns the account info of all sub-users. - // Documentation: https://www.kucoin.com/docs-new/api-3470299 + // AddSubAccount Add SubAccount + // Description: This endpoint can be used to create sub-accounts. + // Documentation: https://www.kucoin.com/docs-new/api-3470135 // +---------------------+------------+ // | Extra API Info | Value | // +---------------------+------------+ @@ -33,42 +19,41 @@ type SubAccountAPI interface { // | API-CHANNEL | PRIVATE | // | API-PERMISSION | GENERAL | // | API-RATE-LIMIT-POOL | MANAGEMENT | - // | API-RATE-LIMIT | 20 | + // | API-RATE-LIMIT | 15 | // +---------------------+------------+ - // Deprecated - GetSpotSubAccountListV1(ctx context.Context) (*GetSpotSubAccountListV1Resp, error) + AddSubAccount(req *AddSubAccountReq, ctx context.Context) (*AddSubAccountResp, error) - // GetSpotSubAccountDetail Get SubAccount Detail - Balance - // Description: This endpoint returns the account info of a sub-user specified by the subUserId. - // Documentation: https://www.kucoin.com/docs-new/api-3470132 + // AddSubAccountMarginPermission Add SubAccount Margin Permission + // Description: This endpoint can be used to add sub-accounts Margin permission. Before using this endpoints, you need to ensure that the master account apikey has Margin permissions and the Margin function has been activated. + // Documentation: https://www.kucoin.com/docs-new/api-3470331 // +---------------------+------------+ // | Extra API Info | Value | // +---------------------+------------+ // | API-DOMAIN | SPOT | // | API-CHANNEL | PRIVATE | - // | API-PERMISSION | GENERAL | + // | API-PERMISSION | MARGIN | // | API-RATE-LIMIT-POOL | MANAGEMENT | // | API-RATE-LIMIT | 15 | // +---------------------+------------+ - GetSpotSubAccountDetail(req *GetSpotSubAccountDetailReq, ctx context.Context) (*GetSpotSubAccountDetailResp, error) + AddSubAccountMarginPermission(req *AddSubAccountMarginPermissionReq, ctx context.Context) (*AddSubAccountMarginPermissionResp, error) - // DeleteSubAccountApi Delete SubAccount API - // Description: This endpoint can be used to delete sub-account APIs. - // Documentation: https://www.kucoin.com/docs-new/api-3470137 + // AddSubAccountFuturesPermission Add SubAccount Futures Permission + // Description: This endpoint can be used to add sub-accounts Futures permission. Before using this endpoints, you need to ensure that the master account apikey has Futures permissions and the Futures function has been activated. + // Documentation: https://www.kucoin.com/docs-new/api-3470332 // +---------------------+------------+ // | Extra API Info | Value | // +---------------------+------------+ // | API-DOMAIN | SPOT | // | API-CHANNEL | PRIVATE | - // | API-PERMISSION | GENERAL | + // | API-PERMISSION | FUTURES | // | API-RATE-LIMIT-POOL | MANAGEMENT | - // | API-RATE-LIMIT | 30 | + // | API-RATE-LIMIT | 15 | // +---------------------+------------+ - DeleteSubAccountApi(req *DeleteSubAccountApiReq, ctx context.Context) (*DeleteSubAccountApiResp, error) + AddSubAccountFuturesPermission(req *AddSubAccountFuturesPermissionReq, ctx context.Context) (*AddSubAccountFuturesPermissionResp, error) - // GetSubAccountApiList Get SubAccount API List - // Description: This endpoint can be used to obtain a list of APIs pertaining to a sub-account.(Not contain ND Broker Sub Account) - // Documentation: https://www.kucoin.com/docs-new/api-3470136 + // GetSpotSubAccountsSummaryV2 Get SubAccount List - Summary Info + // Description: This endpoint can be used to get a paginated list of sub-accounts. Pagination is required. + // Documentation: https://www.kucoin.com/docs-new/api-3470131 // +---------------------+------------+ // | Extra API Info | Value | // +---------------------+------------+ @@ -78,11 +63,11 @@ type SubAccountAPI interface { // | API-RATE-LIMIT-POOL | MANAGEMENT | // | API-RATE-LIMIT | 20 | // +---------------------+------------+ - GetSubAccountApiList(req *GetSubAccountApiListReq, ctx context.Context) (*GetSubAccountApiListResp, error) + GetSpotSubAccountsSummaryV2(req *GetSpotSubAccountsSummaryV2Req, ctx context.Context) (*GetSpotSubAccountsSummaryV2Resp, error) - // AddSubAccountApi Add SubAccount API - // Description: This endpoint can be used to create APIs for sub-accounts. - // Documentation: https://www.kucoin.com/docs-new/api-3470138 + // GetSpotSubAccountDetail Get SubAccount Detail - Balance + // Description: This endpoint returns the account info of a sub-user specified by the subUserId. + // Documentation: https://www.kucoin.com/docs-new/api-3470132 // +---------------------+------------+ // | Extra API Info | Value | // +---------------------+------------+ @@ -90,13 +75,13 @@ type SubAccountAPI interface { // | API-CHANNEL | PRIVATE | // | API-PERMISSION | GENERAL | // | API-RATE-LIMIT-POOL | MANAGEMENT | - // | API-RATE-LIMIT | 20 | + // | API-RATE-LIMIT | 15 | // +---------------------+------------+ - AddSubAccountApi(req *AddSubAccountApiReq, ctx context.Context) (*AddSubAccountApiResp, error) + GetSpotSubAccountDetail(req *GetSpotSubAccountDetailReq, ctx context.Context) (*GetSpotSubAccountDetailResp, error) - // ModifySubAccountApi Modify SubAccount API - // Description: This endpoint can be used to modify sub-account APIs. - // Documentation: https://www.kucoin.com/docs-new/api-3470139 + // GetSpotSubAccountListV2 Get SubAccount List - Spot Balance(V2) + // Description: This endpoint can be used to get paginated Spot sub-account information. Pagination is required. + // Documentation: https://www.kucoin.com/docs-new/api-3470133 // +---------------------+------------+ // | Extra API Info | Value | // +---------------------+------------+ @@ -104,13 +89,27 @@ type SubAccountAPI interface { // | API-CHANNEL | PRIVATE | // | API-PERMISSION | GENERAL | // | API-RATE-LIMIT-POOL | MANAGEMENT | - // | API-RATE-LIMIT | 30 | + // | API-RATE-LIMIT | 20 | // +---------------------+------------+ - ModifySubAccountApi(req *ModifySubAccountApiReq, ctx context.Context) (*ModifySubAccountApiResp, error) + GetSpotSubAccountListV2(req *GetSpotSubAccountListV2Req, ctx context.Context) (*GetSpotSubAccountListV2Resp, error) - // GetSpotSubAccountsSummaryV1 Get SubAccount List - Summary Info(V1) - // Description: You can get the user info of all sub-account via this interface It is recommended to use the GET /api/v2/sub/user interface for paging query - // Documentation: https://www.kucoin.com/docs-new/api-3470298 + // GetFuturesSubAccountListV2 Get SubAccount List - Futures Balance(V2) + // Description: This endpoint can be used to get Futures sub-account information. + // Documentation: https://www.kucoin.com/docs-new/api-3470134 + // +---------------------+---------+ + // | Extra API Info | Value | + // +---------------------+---------+ + // | API-DOMAIN | FUTURES | + // | API-CHANNEL | PRIVATE | + // | API-PERMISSION | GENERAL | + // | API-RATE-LIMIT-POOL | FUTURES | + // | API-RATE-LIMIT | 6 | + // +---------------------+---------+ + GetFuturesSubAccountListV2(req *GetFuturesSubAccountListV2Req, ctx context.Context) (*GetFuturesSubAccountListV2Resp, error) + + // AddSubAccountApi Add SubAccount API + // Description: This endpoint can be used to create APIs for sub-accounts. + // Documentation: https://www.kucoin.com/docs-new/api-3470138 // +---------------------+------------+ // | Extra API Info | Value | // +---------------------+------------+ @@ -120,12 +119,11 @@ type SubAccountAPI interface { // | API-RATE-LIMIT-POOL | MANAGEMENT | // | API-RATE-LIMIT | 20 | // +---------------------+------------+ - // Deprecated - GetSpotSubAccountsSummaryV1(ctx context.Context) (*GetSpotSubAccountsSummaryV1Resp, error) + AddSubAccountApi(req *AddSubAccountApiReq, ctx context.Context) (*AddSubAccountApiResp, error) - // GetSpotSubAccountListV2 Get SubAccount List - Spot Balance(V2) - // Description: This endpoint can be used to get paginated Spot sub-account information. Pagination is required. - // Documentation: https://www.kucoin.com/docs-new/api-3470133 + // ModifySubAccountApi Modify SubAccount API + // Description: This endpoint can be used to modify sub-account APIs. + // Documentation: https://www.kucoin.com/docs-new/api-3470139 // +---------------------+------------+ // | Extra API Info | Value | // +---------------------+------------+ @@ -133,13 +131,13 @@ type SubAccountAPI interface { // | API-CHANNEL | PRIVATE | // | API-PERMISSION | GENERAL | // | API-RATE-LIMIT-POOL | MANAGEMENT | - // | API-RATE-LIMIT | 20 | + // | API-RATE-LIMIT | 30 | // +---------------------+------------+ - GetSpotSubAccountListV2(req *GetSpotSubAccountListV2Req, ctx context.Context) (*GetSpotSubAccountListV2Resp, error) + ModifySubAccountApi(req *ModifySubAccountApiReq, ctx context.Context) (*ModifySubAccountApiResp, error) - // AddSubAccount Add SubAccount - // Description: This endpoint can be used to create sub-accounts. - // Documentation: https://www.kucoin.com/docs-new/api-3470135 + // GetSubAccountApiList Get SubAccount API List + // Description: This endpoint can be used to obtain a list of APIs pertaining to a sub-account.(Not contain ND Broker Sub Account) + // Documentation: https://www.kucoin.com/docs-new/api-3470136 // +---------------------+------------+ // | Extra API Info | Value | // +---------------------+------------+ @@ -147,13 +145,13 @@ type SubAccountAPI interface { // | API-CHANNEL | PRIVATE | // | API-PERMISSION | GENERAL | // | API-RATE-LIMIT-POOL | MANAGEMENT | - // | API-RATE-LIMIT | 15 | + // | API-RATE-LIMIT | 20 | // +---------------------+------------+ - AddSubAccount(req *AddSubAccountReq, ctx context.Context) (*AddSubAccountResp, error) + GetSubAccountApiList(req *GetSubAccountApiListReq, ctx context.Context) (*GetSubAccountApiListResp, error) - // GetSpotSubAccountsSummaryV2 Get SubAccount List - Summary Info - // Description: This endpoint can be used to get a paginated list of sub-accounts. Pagination is required. - // Documentation: https://www.kucoin.com/docs-new/api-3470131 + // DeleteSubAccountApi Delete SubAccount API + // Description: This endpoint can be used to delete sub-account APIs. + // Documentation: https://www.kucoin.com/docs-new/api-3470137 // +---------------------+------------+ // | Extra API Info | Value | // +---------------------+------------+ @@ -161,37 +159,39 @@ type SubAccountAPI interface { // | API-CHANNEL | PRIVATE | // | API-PERMISSION | GENERAL | // | API-RATE-LIMIT-POOL | MANAGEMENT | - // | API-RATE-LIMIT | 20 | + // | API-RATE-LIMIT | 30 | // +---------------------+------------+ - GetSpotSubAccountsSummaryV2(req *GetSpotSubAccountsSummaryV2Req, ctx context.Context) (*GetSpotSubAccountsSummaryV2Resp, error) + DeleteSubAccountApi(req *DeleteSubAccountApiReq, ctx context.Context) (*DeleteSubAccountApiResp, error) - // AddSubAccountFuturesPermission Add SubAccount Futures Permission - // Description: This endpoint can be used to add sub-accounts Futures permission. Before using this endpoints, you need to ensure that the master account apikey has Futures permissions and the Futures function has been activated. - // Documentation: https://www.kucoin.com/docs-new/api-3470332 + // GetSpotSubAccountsSummaryV1 Get SubAccount List - Summary Info(V1) + // Description: You can get the user info of all sub-account via this interface It is recommended to use the GET /api/v2/sub/user interface for paging query + // Documentation: https://www.kucoin.com/docs-new/api-3470298 // +---------------------+------------+ // | Extra API Info | Value | // +---------------------+------------+ // | API-DOMAIN | SPOT | // | API-CHANNEL | PRIVATE | - // | API-PERMISSION | FUTURES | + // | API-PERMISSION | GENERAL | // | API-RATE-LIMIT-POOL | MANAGEMENT | - // | API-RATE-LIMIT | 15 | + // | API-RATE-LIMIT | 20 | // +---------------------+------------+ - AddSubAccountFuturesPermission(req *AddSubAccountFuturesPermissionReq, ctx context.Context) (*AddSubAccountFuturesPermissionResp, error) + // Deprecated + GetSpotSubAccountsSummaryV1(ctx context.Context) (*GetSpotSubAccountsSummaryV1Resp, error) - // AddSubAccountMarginPermission Add SubAccount Margin Permission - // Description: This endpoint can be used to add sub-accounts Margin permission. Before using this endpoints, you need to ensure that the master account apikey has Margin permissions and the Margin function has been activated. - // Documentation: https://www.kucoin.com/docs-new/api-3470331 + // GetSpotSubAccountListV1 Get SubAccount List - Spot Balance(V1) + // Description: This endpoint returns the account info of all sub-users. + // Documentation: https://www.kucoin.com/docs-new/api-3470299 // +---------------------+------------+ // | Extra API Info | Value | // +---------------------+------------+ // | API-DOMAIN | SPOT | // | API-CHANNEL | PRIVATE | - // | API-PERMISSION | MARGIN | + // | API-PERMISSION | GENERAL | // | API-RATE-LIMIT-POOL | MANAGEMENT | - // | API-RATE-LIMIT | 15 | + // | API-RATE-LIMIT | 20 | // +---------------------+------------+ - AddSubAccountMarginPermission(req *AddSubAccountMarginPermissionReq, ctx context.Context) (*AddSubAccountMarginPermissionResp, error) + // Deprecated + GetSpotSubAccountListV1(ctx context.Context) (*GetSpotSubAccountListV1Resp, error) } type SubAccountAPIImpl struct { @@ -202,15 +202,27 @@ func NewSubAccountAPIImp(transport interfaces.Transport) *SubAccountAPIImpl { return &SubAccountAPIImpl{transport: transport} } -func (impl *SubAccountAPIImpl) GetFuturesSubAccountListV2(req *GetFuturesSubAccountListV2Req, ctx context.Context) (*GetFuturesSubAccountListV2Resp, error) { - resp := &GetFuturesSubAccountListV2Resp{} - err := impl.transport.Call(ctx, "futures", false, "Get", "/api/v1/account-overview-all", req, resp, false) +func (impl *SubAccountAPIImpl) AddSubAccount(req *AddSubAccountReq, ctx context.Context) (*AddSubAccountResp, error) { + resp := &AddSubAccountResp{} + err := impl.transport.Call(ctx, "spot", false, "Post", "/api/v2/sub/user/created", req, resp, false) return resp, err } -func (impl *SubAccountAPIImpl) GetSpotSubAccountListV1(ctx context.Context) (*GetSpotSubAccountListV1Resp, error) { - resp := &GetSpotSubAccountListV1Resp{} - err := impl.transport.Call(ctx, "spot", false, "Get", "/api/v1/sub-accounts", nil, resp, false) +func (impl *SubAccountAPIImpl) AddSubAccountMarginPermission(req *AddSubAccountMarginPermissionReq, ctx context.Context) (*AddSubAccountMarginPermissionResp, error) { + resp := &AddSubAccountMarginPermissionResp{} + err := impl.transport.Call(ctx, "spot", false, "Post", "/api/v3/sub/user/margin/enable", req, resp, false) + return resp, err +} + +func (impl *SubAccountAPIImpl) AddSubAccountFuturesPermission(req *AddSubAccountFuturesPermissionReq, ctx context.Context) (*AddSubAccountFuturesPermissionResp, error) { + resp := &AddSubAccountFuturesPermissionResp{} + err := impl.transport.Call(ctx, "spot", false, "Post", "/api/v3/sub/user/futures/enable", req, resp, false) + return resp, err +} + +func (impl *SubAccountAPIImpl) GetSpotSubAccountsSummaryV2(req *GetSpotSubAccountsSummaryV2Req, ctx context.Context) (*GetSpotSubAccountsSummaryV2Resp, error) { + resp := &GetSpotSubAccountsSummaryV2Resp{} + err := impl.transport.Call(ctx, "spot", false, "Get", "/api/v2/sub/user", req, resp, false) return resp, err } @@ -220,15 +232,15 @@ func (impl *SubAccountAPIImpl) GetSpotSubAccountDetail(req *GetSpotSubAccountDet return resp, err } -func (impl *SubAccountAPIImpl) DeleteSubAccountApi(req *DeleteSubAccountApiReq, ctx context.Context) (*DeleteSubAccountApiResp, error) { - resp := &DeleteSubAccountApiResp{} - err := impl.transport.Call(ctx, "spot", false, "Delete", "/api/v1/sub/api-key", req, resp, false) +func (impl *SubAccountAPIImpl) GetSpotSubAccountListV2(req *GetSpotSubAccountListV2Req, ctx context.Context) (*GetSpotSubAccountListV2Resp, error) { + resp := &GetSpotSubAccountListV2Resp{} + err := impl.transport.Call(ctx, "spot", false, "Get", "/api/v2/sub-accounts", req, resp, false) return resp, err } -func (impl *SubAccountAPIImpl) GetSubAccountApiList(req *GetSubAccountApiListReq, ctx context.Context) (*GetSubAccountApiListResp, error) { - resp := &GetSubAccountApiListResp{} - err := impl.transport.Call(ctx, "spot", false, "Get", "/api/v1/sub/api-key", req, resp, false) +func (impl *SubAccountAPIImpl) GetFuturesSubAccountListV2(req *GetFuturesSubAccountListV2Req, ctx context.Context) (*GetFuturesSubAccountListV2Resp, error) { + resp := &GetFuturesSubAccountListV2Resp{} + err := impl.transport.Call(ctx, "futures", false, "Get", "/api/v1/account-overview-all", req, resp, false) return resp, err } @@ -244,38 +256,26 @@ func (impl *SubAccountAPIImpl) ModifySubAccountApi(req *ModifySubAccountApiReq, return resp, err } -func (impl *SubAccountAPIImpl) GetSpotSubAccountsSummaryV1(ctx context.Context) (*GetSpotSubAccountsSummaryV1Resp, error) { - resp := &GetSpotSubAccountsSummaryV1Resp{} - err := impl.transport.Call(ctx, "spot", false, "Get", "/api/v1/sub/user", nil, resp, false) - return resp, err -} - -func (impl *SubAccountAPIImpl) GetSpotSubAccountListV2(req *GetSpotSubAccountListV2Req, ctx context.Context) (*GetSpotSubAccountListV2Resp, error) { - resp := &GetSpotSubAccountListV2Resp{} - err := impl.transport.Call(ctx, "spot", false, "Get", "/api/v2/sub-accounts", req, resp, false) - return resp, err -} - -func (impl *SubAccountAPIImpl) AddSubAccount(req *AddSubAccountReq, ctx context.Context) (*AddSubAccountResp, error) { - resp := &AddSubAccountResp{} - err := impl.transport.Call(ctx, "spot", false, "Post", "/api/v2/sub/user/created", req, resp, false) +func (impl *SubAccountAPIImpl) GetSubAccountApiList(req *GetSubAccountApiListReq, ctx context.Context) (*GetSubAccountApiListResp, error) { + resp := &GetSubAccountApiListResp{} + err := impl.transport.Call(ctx, "spot", false, "Get", "/api/v1/sub/api-key", req, resp, false) return resp, err } -func (impl *SubAccountAPIImpl) GetSpotSubAccountsSummaryV2(req *GetSpotSubAccountsSummaryV2Req, ctx context.Context) (*GetSpotSubAccountsSummaryV2Resp, error) { - resp := &GetSpotSubAccountsSummaryV2Resp{} - err := impl.transport.Call(ctx, "spot", false, "Get", "/api/v2/sub/user", req, resp, false) +func (impl *SubAccountAPIImpl) DeleteSubAccountApi(req *DeleteSubAccountApiReq, ctx context.Context) (*DeleteSubAccountApiResp, error) { + resp := &DeleteSubAccountApiResp{} + err := impl.transport.Call(ctx, "spot", false, "Delete", "/api/v1/sub/api-key", req, resp, false) return resp, err } -func (impl *SubAccountAPIImpl) AddSubAccountFuturesPermission(req *AddSubAccountFuturesPermissionReq, ctx context.Context) (*AddSubAccountFuturesPermissionResp, error) { - resp := &AddSubAccountFuturesPermissionResp{} - err := impl.transport.Call(ctx, "spot", false, "Post", "/api/v3/sub/user/futures/enable", req, resp, false) +func (impl *SubAccountAPIImpl) GetSpotSubAccountsSummaryV1(ctx context.Context) (*GetSpotSubAccountsSummaryV1Resp, error) { + resp := &GetSpotSubAccountsSummaryV1Resp{} + err := impl.transport.Call(ctx, "spot", false, "Get", "/api/v1/sub/user", nil, resp, false) return resp, err } -func (impl *SubAccountAPIImpl) AddSubAccountMarginPermission(req *AddSubAccountMarginPermissionReq, ctx context.Context) (*AddSubAccountMarginPermissionResp, error) { - resp := &AddSubAccountMarginPermissionResp{} - err := impl.transport.Call(ctx, "spot", false, "Post", "/api/v3/sub/user/margin/enable", req, resp, false) +func (impl *SubAccountAPIImpl) GetSpotSubAccountListV1(ctx context.Context) (*GetSpotSubAccountListV1Resp, error) { + resp := &GetSpotSubAccountListV1Resp{} + err := impl.transport.Call(ctx, "spot", false, "Get", "/api/v1/sub-accounts", nil, resp, false) return resp, err } diff --git a/sdk/golang/pkg/generate/account/subaccount/api_sub_account.template b/sdk/golang/pkg/generate/account/subaccount/api_sub_account.template index efb1f6de..2d8d3f91 100644 --- a/sdk/golang/pkg/generate/account/subaccount/api_sub_account.template +++ b/sdk/golang/pkg/generate/account/subaccount/api_sub_account.template @@ -1,16 +1,16 @@ # API FUNCTION TEMPLATE -func TestSubAccountGetFuturesSubAccountListV2Req(t *testing.T) { - // GetFuturesSubAccountListV2 - // Get SubAccount List - Futures Balance(V2) - // /api/v1/account-overview-all +func TestSubAccountAddSubAccountReq(t *testing.T) { + // AddSubAccount + // Add SubAccount + // /api/v2/sub/user/created - builder := subaccount.NewGetFuturesSubAccountListV2ReqBuilder() - builder.SetCurrency(?) + builder := subaccount.NewAddSubAccountReqBuilder() + builder.SetPassword(?).SetRemarks(?).SetSubName(?).SetAccess(?) req := builder.Build() - resp, err := subaccountApi.GetFuturesSubAccountListV2(req, context.TODO()) + resp, err := subaccountApi.AddSubAccount(req, context.TODO()) if err != nil { panic(err) } @@ -24,13 +24,16 @@ func TestSubAccountGetFuturesSubAccountListV2Req(t *testing.T) { } -func TestSubAccountGetSpotSubAccountListV1Req(t *testing.T) { - // GetSpotSubAccountListV1 - // Get SubAccount List - Spot Balance(V1) - // /api/v1/sub-accounts +func TestSubAccountAddSubAccountMarginPermissionReq(t *testing.T) { + // AddSubAccountMarginPermission + // Add SubAccount Margin Permission + // /api/v3/sub/user/margin/enable + builder := subaccount.NewAddSubAccountMarginPermissionReqBuilder() + builder.SetUid(?) + req := builder.Build() - resp, err := subaccountApi.GetSpotSubAccountListV1(context.TODO()) + resp, err := subaccountApi.AddSubAccountMarginPermission(req, context.TODO()) if err != nil { panic(err) } @@ -44,16 +47,16 @@ func TestSubAccountGetSpotSubAccountListV1Req(t *testing.T) { } -func TestSubAccountGetSpotSubAccountDetailReq(t *testing.T) { - // GetSpotSubAccountDetail - // Get SubAccount Detail - Balance - // /api/v1/sub-accounts/{subUserId} +func TestSubAccountAddSubAccountFuturesPermissionReq(t *testing.T) { + // AddSubAccountFuturesPermission + // Add SubAccount Futures Permission + // /api/v3/sub/user/futures/enable - builder := subaccount.NewGetSpotSubAccountDetailReqBuilder() - builder.SetSubUserId(?).SetIncludeBaseAmount(?) + builder := subaccount.NewAddSubAccountFuturesPermissionReqBuilder() + builder.SetUid(?) req := builder.Build() - resp, err := subaccountApi.GetSpotSubAccountDetail(req, context.TODO()) + resp, err := subaccountApi.AddSubAccountFuturesPermission(req, context.TODO()) if err != nil { panic(err) } @@ -67,16 +70,16 @@ func TestSubAccountGetSpotSubAccountDetailReq(t *testing.T) { } -func TestSubAccountDeleteSubAccountApiReq(t *testing.T) { - // DeleteSubAccountApi - // Delete SubAccount API - // /api/v1/sub/api-key +func TestSubAccountGetSpotSubAccountsSummaryV2Req(t *testing.T) { + // GetSpotSubAccountsSummaryV2 + // Get SubAccount List - Summary Info + // /api/v2/sub/user - builder := subaccount.NewDeleteSubAccountApiReqBuilder() - builder.SetApiKey(?).SetSubName(?).SetPassphrase(?) + builder := subaccount.NewGetSpotSubAccountsSummaryV2ReqBuilder() + builder.SetCurrentPage(?).SetPageSize(?) req := builder.Build() - resp, err := subaccountApi.DeleteSubAccountApi(req, context.TODO()) + resp, err := subaccountApi.GetSpotSubAccountsSummaryV2(req, context.TODO()) if err != nil { panic(err) } @@ -90,16 +93,16 @@ func TestSubAccountDeleteSubAccountApiReq(t *testing.T) { } -func TestSubAccountGetSubAccountApiListReq(t *testing.T) { - // GetSubAccountApiList - // Get SubAccount API List - // /api/v1/sub/api-key +func TestSubAccountGetSpotSubAccountDetailReq(t *testing.T) { + // GetSpotSubAccountDetail + // Get SubAccount Detail - Balance + // /api/v1/sub-accounts/{subUserId} - builder := subaccount.NewGetSubAccountApiListReqBuilder() - builder.SetApiKey(?).SetSubName(?) + builder := subaccount.NewGetSpotSubAccountDetailReqBuilder() + builder.SetSubUserId(?).SetIncludeBaseAmount(?) req := builder.Build() - resp, err := subaccountApi.GetSubAccountApiList(req, context.TODO()) + resp, err := subaccountApi.GetSpotSubAccountDetail(req, context.TODO()) if err != nil { panic(err) } @@ -113,16 +116,16 @@ func TestSubAccountGetSubAccountApiListReq(t *testing.T) { } -func TestSubAccountAddSubAccountApiReq(t *testing.T) { - // AddSubAccountApi - // Add SubAccount API - // /api/v1/sub/api-key +func TestSubAccountGetSpotSubAccountListV2Req(t *testing.T) { + // GetSpotSubAccountListV2 + // Get SubAccount List - Spot Balance(V2) + // /api/v2/sub-accounts - builder := subaccount.NewAddSubAccountApiReqBuilder() - builder.SetPassphrase(?).SetRemark(?).SetPermission(?).SetIpWhitelist(?).SetExpire(?).SetSubName(?) + builder := subaccount.NewGetSpotSubAccountListV2ReqBuilder() + builder.SetCurrentPage(?).SetPageSize(?) req := builder.Build() - resp, err := subaccountApi.AddSubAccountApi(req, context.TODO()) + resp, err := subaccountApi.GetSpotSubAccountListV2(req, context.TODO()) if err != nil { panic(err) } @@ -136,16 +139,16 @@ func TestSubAccountAddSubAccountApiReq(t *testing.T) { } -func TestSubAccountModifySubAccountApiReq(t *testing.T) { - // ModifySubAccountApi - // Modify SubAccount API - // /api/v1/sub/api-key/update +func TestSubAccountGetFuturesSubAccountListV2Req(t *testing.T) { + // GetFuturesSubAccountListV2 + // Get SubAccount List - Futures Balance(V2) + // /api/v1/account-overview-all - builder := subaccount.NewModifySubAccountApiReqBuilder() - builder.SetPassphrase(?).SetPermission(?).SetIpWhitelist(?).SetExpire(?).SetSubName(?).SetApiKey(?) + builder := subaccount.NewGetFuturesSubAccountListV2ReqBuilder() + builder.SetCurrency(?) req := builder.Build() - resp, err := subaccountApi.ModifySubAccountApi(req, context.TODO()) + resp, err := subaccountApi.GetFuturesSubAccountListV2(req, context.TODO()) if err != nil { panic(err) } @@ -159,13 +162,16 @@ func TestSubAccountModifySubAccountApiReq(t *testing.T) { } -func TestSubAccountGetSpotSubAccountsSummaryV1Req(t *testing.T) { - // GetSpotSubAccountsSummaryV1 - // Get SubAccount List - Summary Info(V1) - // /api/v1/sub/user +func TestSubAccountAddSubAccountApiReq(t *testing.T) { + // AddSubAccountApi + // Add SubAccount API + // /api/v1/sub/api-key + builder := subaccount.NewAddSubAccountApiReqBuilder() + builder.SetPassphrase(?).SetRemark(?).SetPermission(?).SetIpWhitelist(?).SetExpire(?).SetSubName(?) + req := builder.Build() - resp, err := subaccountApi.GetSpotSubAccountsSummaryV1(context.TODO()) + resp, err := subaccountApi.AddSubAccountApi(req, context.TODO()) if err != nil { panic(err) } @@ -179,16 +185,16 @@ func TestSubAccountGetSpotSubAccountsSummaryV1Req(t *testing.T) { } -func TestSubAccountGetSpotSubAccountListV2Req(t *testing.T) { - // GetSpotSubAccountListV2 - // Get SubAccount List - Spot Balance(V2) - // /api/v2/sub-accounts +func TestSubAccountModifySubAccountApiReq(t *testing.T) { + // ModifySubAccountApi + // Modify SubAccount API + // /api/v1/sub/api-key/update - builder := subaccount.NewGetSpotSubAccountListV2ReqBuilder() - builder.SetCurrentPage(?).SetPageSize(?) + builder := subaccount.NewModifySubAccountApiReqBuilder() + builder.SetPassphrase(?).SetPermission(?).SetIpWhitelist(?).SetExpire(?).SetSubName(?).SetApiKey(?) req := builder.Build() - resp, err := subaccountApi.GetSpotSubAccountListV2(req, context.TODO()) + resp, err := subaccountApi.ModifySubAccountApi(req, context.TODO()) if err != nil { panic(err) } @@ -202,16 +208,16 @@ func TestSubAccountGetSpotSubAccountListV2Req(t *testing.T) { } -func TestSubAccountAddSubAccountReq(t *testing.T) { - // AddSubAccount - // Add SubAccount - // /api/v2/sub/user/created +func TestSubAccountGetSubAccountApiListReq(t *testing.T) { + // GetSubAccountApiList + // Get SubAccount API List + // /api/v1/sub/api-key - builder := subaccount.NewAddSubAccountReqBuilder() - builder.SetPassword(?).SetRemarks(?).SetSubName(?).SetAccess(?) + builder := subaccount.NewGetSubAccountApiListReqBuilder() + builder.SetApiKey(?).SetSubName(?) req := builder.Build() - resp, err := subaccountApi.AddSubAccount(req, context.TODO()) + resp, err := subaccountApi.GetSubAccountApiList(req, context.TODO()) if err != nil { panic(err) } @@ -225,16 +231,16 @@ func TestSubAccountAddSubAccountReq(t *testing.T) { } -func TestSubAccountGetSpotSubAccountsSummaryV2Req(t *testing.T) { - // GetSpotSubAccountsSummaryV2 - // Get SubAccount List - Summary Info - // /api/v2/sub/user +func TestSubAccountDeleteSubAccountApiReq(t *testing.T) { + // DeleteSubAccountApi + // Delete SubAccount API + // /api/v1/sub/api-key - builder := subaccount.NewGetSpotSubAccountsSummaryV2ReqBuilder() - builder.SetCurrentPage(?).SetPageSize(?) + builder := subaccount.NewDeleteSubAccountApiReqBuilder() + builder.SetApiKey(?).SetSubName(?).SetPassphrase(?) req := builder.Build() - resp, err := subaccountApi.GetSpotSubAccountsSummaryV2(req, context.TODO()) + resp, err := subaccountApi.DeleteSubAccountApi(req, context.TODO()) if err != nil { panic(err) } @@ -248,16 +254,13 @@ func TestSubAccountGetSpotSubAccountsSummaryV2Req(t *testing.T) { } -func TestSubAccountAddSubAccountFuturesPermissionReq(t *testing.T) { - // AddSubAccountFuturesPermission - // Add SubAccount Futures Permission - // /api/v3/sub/user/futures/enable +func TestSubAccountGetSpotSubAccountsSummaryV1Req(t *testing.T) { + // GetSpotSubAccountsSummaryV1 + // Get SubAccount List - Summary Info(V1) + // /api/v1/sub/user - builder := subaccount.NewAddSubAccountFuturesPermissionReqBuilder() - builder.SetUid(?) - req := builder.Build() - resp, err := subaccountApi.AddSubAccountFuturesPermission(req, context.TODO()) + resp, err := subaccountApi.GetSpotSubAccountsSummaryV1(context.TODO()) if err != nil { panic(err) } @@ -271,16 +274,13 @@ func TestSubAccountAddSubAccountFuturesPermissionReq(t *testing.T) { } -func TestSubAccountAddSubAccountMarginPermissionReq(t *testing.T) { - // AddSubAccountMarginPermission - // Add SubAccount Margin Permission - // /api/v3/sub/user/margin/enable +func TestSubAccountGetSpotSubAccountListV1Req(t *testing.T) { + // GetSpotSubAccountListV1 + // Get SubAccount List - Spot Balance(V1) + // /api/v1/sub-accounts - builder := subaccount.NewAddSubAccountMarginPermissionReqBuilder() - builder.SetUid(?) - req := builder.Build() - resp, err := subaccountApi.AddSubAccountMarginPermission(req, context.TODO()) + resp, err := subaccountApi.GetSpotSubAccountListV1(context.TODO()) if err != nil { panic(err) } diff --git a/sdk/golang/pkg/generate/account/subaccount/api_sub_account_test.go b/sdk/golang/pkg/generate/account/subaccount/api_sub_account_test.go index b99f5b7e..96274ab3 100644 --- a/sdk/golang/pkg/generate/account/subaccount/api_sub_account_test.go +++ b/sdk/golang/pkg/generate/account/subaccount/api_sub_account_test.go @@ -7,52 +7,113 @@ import ( "testing" ) -func TestSubAccountGetFuturesSubAccountListV2ReqModel(t *testing.T) { - // GetFuturesSubAccountListV2 - // Get SubAccount List - Futures Balance(V2) - // /api/v1/account-overview-all +func TestSubAccountAddSubAccountReqModel(t *testing.T) { + // AddSubAccount + // Add SubAccount + // /api/v2/sub/user/created - data := "{\"currency\": \"USDT\"}" - req := &GetFuturesSubAccountListV2Req{} + data := "{\"password\": \"1234567\", \"remarks\": \"TheRemark\", \"subName\": \"Name1234567\", \"access\": \"Spot\"}" + req := &AddSubAccountReq{} err := json.Unmarshal([]byte(data), req) req.ToMap() assert.Nil(t, err) } -func TestSubAccountGetFuturesSubAccountListV2RespModel(t *testing.T) { - // GetFuturesSubAccountListV2 - // Get SubAccount List - Futures Balance(V2) - // /api/v1/account-overview-all +func TestSubAccountAddSubAccountRespModel(t *testing.T) { + // AddSubAccount + // Add SubAccount + // /api/v2/sub/user/created - data := "{\n \"code\": \"200000\",\n \"data\": {\n \"summary\": {\n \"accountEquityTotal\": 103.899081508,\n \"unrealisedPNLTotal\": 38.81075,\n \"marginBalanceTotal\": 65.336985668,\n \"positionMarginTotal\": 68.9588320683,\n \"orderMarginTotal\": 0,\n \"frozenFundsTotal\": 0,\n \"availableBalanceTotal\": 67.2492494397,\n \"currency\": \"USDT\"\n },\n \"accounts\": [\n {\n \"accountName\": \"Name1234567\",\n \"accountEquity\": 0,\n \"unrealisedPNL\": 0,\n \"marginBalance\": 0,\n \"positionMargin\": 0,\n \"orderMargin\": 0,\n \"frozenFunds\": 0,\n \"availableBalance\": 0,\n \"currency\": \"USDT\"\n },\n {\n \"accountName\": \"LTkucoin1491\",\n \"accountEquity\": 0,\n \"unrealisedPNL\": 0,\n \"marginBalance\": 0,\n \"positionMargin\": 0,\n \"orderMargin\": 0,\n \"frozenFunds\": 0,\n \"availableBalance\": 0,\n \"currency\": \"USDT\"\n },\n {\n \"accountName\": \"manage112233\",\n \"accountEquity\": 0,\n \"unrealisedPNL\": 0,\n \"marginBalance\": 0,\n \"positionMargin\": 0,\n \"orderMargin\": 0,\n \"frozenFunds\": 0,\n \"availableBalance\": 0,\n \"currency\": \"USDT\"\n },\n {\n \"accountName\": \"testapi6\",\n \"accountEquity\": 27.30545128,\n \"unrealisedPNL\": 22.549,\n \"marginBalance\": 4.75645128,\n \"positionMargin\": 24.1223749975,\n \"orderMargin\": 0,\n \"frozenFunds\": 0,\n \"availableBalance\": 25.7320762825,\n \"currency\": \"USDT\"\n },\n {\n \"accountName\": \"main\",\n \"accountEquity\": 76.593630228,\n \"unrealisedPNL\": 16.26175,\n \"marginBalance\": 60.580534388,\n \"positionMargin\": 44.8364570708,\n \"orderMargin\": 0,\n \"frozenFunds\": 0,\n \"availableBalance\": 41.5171731572,\n \"currency\": \"USDT\"\n }\n ]\n }\n}" + data := "{\n \"code\": \"200000\",\n \"data\": {\n \"currentPage\": 1,\n \"pageSize\": 10,\n \"totalNum\": 1,\n \"totalPage\": 1,\n \"items\": [\n {\n \"userId\": \"63743f07e0c5230001761d08\",\n \"uid\": 169579801,\n \"subName\": \"testapi6\",\n \"status\": 2,\n \"type\": 0,\n \"access\": \"All\",\n \"createdAt\": 1668562696000,\n \"remarks\": \"remarks\",\n \"tradeTypes\": [\n \"Spot\",\n \"Futures\",\n \"Margin\"\n ],\n \"openedTradeTypes\": [\n \"Spot\"\n ],\n \"hostedStatus\": null\n }\n ]\n }\n}" commonResp := &types.RestResponse{} err := json.Unmarshal([]byte(data), commonResp) assert.Nil(t, err) assert.NotNil(t, commonResp.Data) - resp := &GetFuturesSubAccountListV2Resp{} + resp := &AddSubAccountResp{} err = json.Unmarshal([]byte(commonResp.Data), resp) resp.ToMap() assert.Nil(t, err) } -func TestSubAccountGetSpotSubAccountListV1ReqModel(t *testing.T) { - // GetSpotSubAccountListV1 - // Get SubAccount List - Spot Balance(V1) - // /api/v1/sub-accounts +func TestSubAccountAddSubAccountMarginPermissionReqModel(t *testing.T) { + // AddSubAccountMarginPermission + // Add SubAccount Margin Permission + // /api/v3/sub/user/margin/enable + data := "{\"uid\": \"169579801\"}" + req := &AddSubAccountMarginPermissionReq{} + err := json.Unmarshal([]byte(data), req) + req.ToMap() + assert.Nil(t, err) } -func TestSubAccountGetSpotSubAccountListV1RespModel(t *testing.T) { - // GetSpotSubAccountListV1 - // Get SubAccount List - Spot Balance(V1) - // /api/v1/sub-accounts +func TestSubAccountAddSubAccountMarginPermissionRespModel(t *testing.T) { + // AddSubAccountMarginPermission + // Add SubAccount Margin Permission + // /api/v3/sub/user/margin/enable - data := "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"subUserId\": \"63743f07e0c5230001761d08\",\n \"subName\": \"testapi6\",\n \"mainAccounts\": [\n {\n \"currency\": \"USDT\",\n \"balance\": \"0.01\",\n \"available\": \"0.01\",\n \"holds\": \"0\",\n \"baseCurrency\": \"BTC\",\n \"baseCurrencyPrice\": \"62489.8\",\n \"baseAmount\": \"0.00000016\",\n \"tag\": \"DEFAULT\"\n }\n ],\n \"tradeAccounts\": [\n {\n \"currency\": \"USDT\",\n \"balance\": \"0.01\",\n \"available\": \"0.01\",\n \"holds\": \"0\",\n \"baseCurrency\": \"BTC\",\n \"baseCurrencyPrice\": \"62489.8\",\n \"baseAmount\": \"0.00000016\",\n \"tag\": \"DEFAULT\"\n }\n ],\n \"marginAccounts\": [\n {\n \"currency\": \"USDT\",\n \"balance\": \"0.01\",\n \"available\": \"0.01\",\n \"holds\": \"0\",\n \"baseCurrency\": \"BTC\",\n \"baseCurrencyPrice\": \"62489.8\",\n \"baseAmount\": \"0.00000016\",\n \"tag\": \"DEFAULT\"\n }\n ],\n \"tradeHFAccounts\": []\n },\n {\n \"subUserId\": \"670538a31037eb000115b076\",\n \"subName\": \"Name1234567\",\n \"mainAccounts\": [],\n \"tradeAccounts\": [],\n \"marginAccounts\": [],\n \"tradeHFAccounts\": []\n },\n {\n \"subUserId\": \"66b0c0905fc1480001c14c36\",\n \"subName\": \"LTkucoin1491\",\n \"mainAccounts\": [],\n \"tradeAccounts\": [],\n \"marginAccounts\": [],\n \"tradeHFAccounts\": []\n }\n ]\n}" + data := "{\n \"code\": \"200000\",\n \"data\": null\n}" commonResp := &types.RestResponse{} err := json.Unmarshal([]byte(data), commonResp) assert.Nil(t, err) assert.NotNil(t, commonResp.Data) - resp := &GetSpotSubAccountListV1Resp{} + resp := &AddSubAccountMarginPermissionResp{} + err = json.Unmarshal([]byte(commonResp.Data), resp) + resp.ToMap() + assert.Nil(t, err) +} + +func TestSubAccountAddSubAccountFuturesPermissionReqModel(t *testing.T) { + // AddSubAccountFuturesPermission + // Add SubAccount Futures Permission + // /api/v3/sub/user/futures/enable + + data := "{\"uid\": \"169579801\"}" + req := &AddSubAccountFuturesPermissionReq{} + err := json.Unmarshal([]byte(data), req) + req.ToMap() + assert.Nil(t, err) +} + +func TestSubAccountAddSubAccountFuturesPermissionRespModel(t *testing.T) { + // AddSubAccountFuturesPermission + // Add SubAccount Futures Permission + // /api/v3/sub/user/futures/enable + + data := "{\n \"code\": \"200000\",\n \"data\": null\n}" + commonResp := &types.RestResponse{} + err := json.Unmarshal([]byte(data), commonResp) + assert.Nil(t, err) + assert.NotNil(t, commonResp.Data) + resp := &AddSubAccountFuturesPermissionResp{} + err = json.Unmarshal([]byte(commonResp.Data), resp) + resp.ToMap() + assert.Nil(t, err) +} + +func TestSubAccountGetSpotSubAccountsSummaryV2ReqModel(t *testing.T) { + // GetSpotSubAccountsSummaryV2 + // Get SubAccount List - Summary Info + // /api/v2/sub/user + + data := "{\"currentPage\": 1, \"pageSize\": 10}" + req := &GetSpotSubAccountsSummaryV2Req{} + err := json.Unmarshal([]byte(data), req) + req.ToMap() + assert.Nil(t, err) +} + +func TestSubAccountGetSpotSubAccountsSummaryV2RespModel(t *testing.T) { + // GetSpotSubAccountsSummaryV2 + // Get SubAccount List - Summary Info + // /api/v2/sub/user + + data := "{\n \"code\": \"200000\",\n \"data\": {\n \"currentPage\": 1,\n \"pageSize\": 10,\n \"totalNum\": 1,\n \"totalPage\": 1,\n \"items\": [\n {\n \"userId\": \"63743f07e0c5230001761d08\",\n \"uid\": 169579801,\n \"subName\": \"testapi6\",\n \"status\": 2,\n \"type\": 0,\n \"access\": \"All\",\n \"createdAt\": 1668562696000,\n \"remarks\": \"remarks\",\n \"tradeTypes\": [\n \"Spot\",\n \"Futures\",\n \"Margin\"\n ],\n \"openedTradeTypes\": [\n \"Spot\"\n ],\n \"hostedStatus\": null\n }\n ]\n }\n}" + commonResp := &types.RestResponse{} + err := json.Unmarshal([]byte(data), commonResp) + assert.Nil(t, err) + assert.NotNil(t, commonResp.Data) + resp := &GetSpotSubAccountsSummaryV2Resp{} err = json.Unmarshal([]byte(commonResp.Data), resp) resp.ToMap() assert.Nil(t, err) @@ -86,57 +147,57 @@ func TestSubAccountGetSpotSubAccountDetailRespModel(t *testing.T) { assert.Nil(t, err) } -func TestSubAccountDeleteSubAccountApiReqModel(t *testing.T) { - // DeleteSubAccountApi - // Delete SubAccount API - // /api/v1/sub/api-key +func TestSubAccountGetSpotSubAccountListV2ReqModel(t *testing.T) { + // GetSpotSubAccountListV2 + // Get SubAccount List - Spot Balance(V2) + // /api/v2/sub-accounts - data := "{\"apiKey\": \"670621e3a25958000159c82f\", \"subName\": \"testapi6\", \"passphrase\": \"11223344\"}" - req := &DeleteSubAccountApiReq{} + data := "{\"currentPage\": 1, \"pageSize\": 10}" + req := &GetSpotSubAccountListV2Req{} err := json.Unmarshal([]byte(data), req) req.ToMap() assert.Nil(t, err) } -func TestSubAccountDeleteSubAccountApiRespModel(t *testing.T) { - // DeleteSubAccountApi - // Delete SubAccount API - // /api/v1/sub/api-key +func TestSubAccountGetSpotSubAccountListV2RespModel(t *testing.T) { + // GetSpotSubAccountListV2 + // Get SubAccount List - Spot Balance(V2) + // /api/v2/sub-accounts - data := "{\"code\":\"200000\",\"data\":{\"subName\":\"testapi6\",\"apiKey\":\"670621e3a25958000159c82f\"}}" + data := "{\n \"code\": \"200000\",\n \"data\": {\n \"currentPage\": 1,\n \"pageSize\": 10,\n \"totalNum\": 3,\n \"totalPage\": 1,\n \"items\": [\n {\n \"subUserId\": \"63743f07e0c5230001761d08\",\n \"subName\": \"testapi6\",\n \"mainAccounts\": [\n {\n \"currency\": \"USDT\",\n \"balance\": \"0.01\",\n \"available\": \"0.01\",\n \"holds\": \"0\",\n \"baseCurrency\": \"BTC\",\n \"baseCurrencyPrice\": \"62514.5\",\n \"baseAmount\": \"0.00000015\",\n \"tag\": \"DEFAULT\"\n }\n ],\n \"tradeAccounts\": [\n {\n \"currency\": \"USDT\",\n \"balance\": \"0.01\",\n \"available\": \"0.01\",\n \"holds\": \"0\",\n \"baseCurrency\": \"BTC\",\n \"baseCurrencyPrice\": \"62514.5\",\n \"baseAmount\": \"0.00000015\",\n \"tag\": \"DEFAULT\"\n }\n ],\n \"marginAccounts\": [\n {\n \"currency\": \"USDT\",\n \"balance\": \"0.01\",\n \"available\": \"0.01\",\n \"holds\": \"0\",\n \"baseCurrency\": \"BTC\",\n \"baseCurrencyPrice\": \"62514.5\",\n \"baseAmount\": \"0.00000015\",\n \"tag\": \"DEFAULT\"\n }\n ],\n \"tradeHFAccounts\": []\n },\n {\n \"subUserId\": \"670538a31037eb000115b076\",\n \"subName\": \"Name1234567\",\n \"mainAccounts\": [],\n \"tradeAccounts\": [],\n \"marginAccounts\": [],\n \"tradeHFAccounts\": []\n },\n {\n \"subUserId\": \"66b0c0905fc1480001c14c36\",\n \"subName\": \"LTkucoin1491\",\n \"mainAccounts\": [],\n \"tradeAccounts\": [],\n \"marginAccounts\": [],\n \"tradeHFAccounts\": []\n }\n ]\n }\n}" commonResp := &types.RestResponse{} err := json.Unmarshal([]byte(data), commonResp) assert.Nil(t, err) assert.NotNil(t, commonResp.Data) - resp := &DeleteSubAccountApiResp{} + resp := &GetSpotSubAccountListV2Resp{} err = json.Unmarshal([]byte(commonResp.Data), resp) resp.ToMap() assert.Nil(t, err) } -func TestSubAccountGetSubAccountApiListReqModel(t *testing.T) { - // GetSubAccountApiList - // Get SubAccount API List - // /api/v1/sub/api-key +func TestSubAccountGetFuturesSubAccountListV2ReqModel(t *testing.T) { + // GetFuturesSubAccountListV2 + // Get SubAccount List - Futures Balance(V2) + // /api/v1/account-overview-all - data := "{\"apiKey\": \"example_string_default_value\", \"subName\": \"testapi6\"}" - req := &GetSubAccountApiListReq{} + data := "{\"currency\": \"USDT\"}" + req := &GetFuturesSubAccountListV2Req{} err := json.Unmarshal([]byte(data), req) req.ToMap() assert.Nil(t, err) } -func TestSubAccountGetSubAccountApiListRespModel(t *testing.T) { - // GetSubAccountApiList - // Get SubAccount API List - // /api/v1/sub/api-key +func TestSubAccountGetFuturesSubAccountListV2RespModel(t *testing.T) { + // GetFuturesSubAccountListV2 + // Get SubAccount List - Futures Balance(V2) + // /api/v1/account-overview-all - data := "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"subName\": \"apiSdkTest\",\n \"remark\": \"sdk_test_integration\",\n \"apiKey\": \"673eab2a955ebf000195d7e4\",\n \"apiVersion\": 3,\n \"permission\": \"General\",\n \"ipWhitelist\": \"10.**.1\",\n \"createdAt\": 1732160298000,\n \"uid\": 215112467,\n \"isMaster\": false\n }\n ]\n}" + data := "{\n \"code\": \"200000\",\n \"data\": {\n \"summary\": {\n \"accountEquityTotal\": 103.899081508,\n \"unrealisedPNLTotal\": 38.81075,\n \"marginBalanceTotal\": 65.336985668,\n \"positionMarginTotal\": 68.9588320683,\n \"orderMarginTotal\": 0,\n \"frozenFundsTotal\": 0,\n \"availableBalanceTotal\": 67.2492494397,\n \"currency\": \"USDT\"\n },\n \"accounts\": [\n {\n \"accountName\": \"Name1234567\",\n \"accountEquity\": 0,\n \"unrealisedPNL\": 0,\n \"marginBalance\": 0,\n \"positionMargin\": 0,\n \"orderMargin\": 0,\n \"frozenFunds\": 0,\n \"availableBalance\": 0,\n \"currency\": \"USDT\"\n },\n {\n \"accountName\": \"LTkucoin1491\",\n \"accountEquity\": 0,\n \"unrealisedPNL\": 0,\n \"marginBalance\": 0,\n \"positionMargin\": 0,\n \"orderMargin\": 0,\n \"frozenFunds\": 0,\n \"availableBalance\": 0,\n \"currency\": \"USDT\"\n },\n {\n \"accountName\": \"manage112233\",\n \"accountEquity\": 0,\n \"unrealisedPNL\": 0,\n \"marginBalance\": 0,\n \"positionMargin\": 0,\n \"orderMargin\": 0,\n \"frozenFunds\": 0,\n \"availableBalance\": 0,\n \"currency\": \"USDT\"\n },\n {\n \"accountName\": \"testapi6\",\n \"accountEquity\": 27.30545128,\n \"unrealisedPNL\": 22.549,\n \"marginBalance\": 4.75645128,\n \"positionMargin\": 24.1223749975,\n \"orderMargin\": 0,\n \"frozenFunds\": 0,\n \"availableBalance\": 25.7320762825,\n \"currency\": \"USDT\"\n },\n {\n \"accountName\": \"main\",\n \"accountEquity\": 76.593630228,\n \"unrealisedPNL\": 16.26175,\n \"marginBalance\": 60.580534388,\n \"positionMargin\": 44.8364570708,\n \"orderMargin\": 0,\n \"frozenFunds\": 0,\n \"availableBalance\": 41.5171731572,\n \"currency\": \"USDT\"\n }\n ]\n }\n}" commonResp := &types.RestResponse{} err := json.Unmarshal([]byte(data), commonResp) assert.Nil(t, err) assert.NotNil(t, commonResp.Data) - resp := &GetSubAccountApiListResp{} + resp := &GetFuturesSubAccountListV2Resp{} err = json.Unmarshal([]byte(commonResp.Data), resp) resp.ToMap() assert.Nil(t, err) @@ -198,164 +259,103 @@ func TestSubAccountModifySubAccountApiRespModel(t *testing.T) { assert.Nil(t, err) } -func TestSubAccountGetSpotSubAccountsSummaryV1ReqModel(t *testing.T) { - // GetSpotSubAccountsSummaryV1 - // Get SubAccount List - Summary Info(V1) - // /api/v1/sub/user - -} - -func TestSubAccountGetSpotSubAccountsSummaryV1RespModel(t *testing.T) { - // GetSpotSubAccountsSummaryV1 - // Get SubAccount List - Summary Info(V1) - // /api/v1/sub/user - - data := "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"userId\": \"63743f07e0c5230001761d08\",\n \"uid\": 169579801,\n \"subName\": \"testapi6\",\n \"type\": 0,\n \"remarks\": \"remarks\",\n \"access\": \"All\"\n },\n {\n \"userId\": \"670538a31037eb000115b076\",\n \"uid\": 225139445,\n \"subName\": \"Name1234567\",\n \"type\": 0,\n \"remarks\": \"TheRemark\",\n \"access\": \"All\"\n }\n ]\n}" - commonResp := &types.RestResponse{} - err := json.Unmarshal([]byte(data), commonResp) - assert.Nil(t, err) - assert.NotNil(t, commonResp.Data) - resp := &GetSpotSubAccountsSummaryV1Resp{} - err = json.Unmarshal([]byte(commonResp.Data), resp) - resp.ToMap() - assert.Nil(t, err) -} - -func TestSubAccountGetSpotSubAccountListV2ReqModel(t *testing.T) { - // GetSpotSubAccountListV2 - // Get SubAccount List - Spot Balance(V2) - // /api/v2/sub-accounts - - data := "{\"currentPage\": 1, \"pageSize\": 10}" - req := &GetSpotSubAccountListV2Req{} - err := json.Unmarshal([]byte(data), req) - req.ToMap() - assert.Nil(t, err) -} - -func TestSubAccountGetSpotSubAccountListV2RespModel(t *testing.T) { - // GetSpotSubAccountListV2 - // Get SubAccount List - Spot Balance(V2) - // /api/v2/sub-accounts - - data := "{\n \"code\": \"200000\",\n \"data\": {\n \"currentPage\": 1,\n \"pageSize\": 10,\n \"totalNum\": 3,\n \"totalPage\": 1,\n \"items\": [\n {\n \"subUserId\": \"63743f07e0c5230001761d08\",\n \"subName\": \"testapi6\",\n \"mainAccounts\": [\n {\n \"currency\": \"USDT\",\n \"balance\": \"0.01\",\n \"available\": \"0.01\",\n \"holds\": \"0\",\n \"baseCurrency\": \"BTC\",\n \"baseCurrencyPrice\": \"62514.5\",\n \"baseAmount\": \"0.00000015\",\n \"tag\": \"DEFAULT\"\n }\n ],\n \"tradeAccounts\": [\n {\n \"currency\": \"USDT\",\n \"balance\": \"0.01\",\n \"available\": \"0.01\",\n \"holds\": \"0\",\n \"baseCurrency\": \"BTC\",\n \"baseCurrencyPrice\": \"62514.5\",\n \"baseAmount\": \"0.00000015\",\n \"tag\": \"DEFAULT\"\n }\n ],\n \"marginAccounts\": [\n {\n \"currency\": \"USDT\",\n \"balance\": \"0.01\",\n \"available\": \"0.01\",\n \"holds\": \"0\",\n \"baseCurrency\": \"BTC\",\n \"baseCurrencyPrice\": \"62514.5\",\n \"baseAmount\": \"0.00000015\",\n \"tag\": \"DEFAULT\"\n }\n ],\n \"tradeHFAccounts\": []\n },\n {\n \"subUserId\": \"670538a31037eb000115b076\",\n \"subName\": \"Name1234567\",\n \"mainAccounts\": [],\n \"tradeAccounts\": [],\n \"marginAccounts\": [],\n \"tradeHFAccounts\": []\n },\n {\n \"subUserId\": \"66b0c0905fc1480001c14c36\",\n \"subName\": \"LTkucoin1491\",\n \"mainAccounts\": [],\n \"tradeAccounts\": [],\n \"marginAccounts\": [],\n \"tradeHFAccounts\": []\n }\n ]\n }\n}" - commonResp := &types.RestResponse{} - err := json.Unmarshal([]byte(data), commonResp) - assert.Nil(t, err) - assert.NotNil(t, commonResp.Data) - resp := &GetSpotSubAccountListV2Resp{} - err = json.Unmarshal([]byte(commonResp.Data), resp) - resp.ToMap() - assert.Nil(t, err) -} - -func TestSubAccountAddSubAccountReqModel(t *testing.T) { - // AddSubAccount - // Add SubAccount - // /api/v2/sub/user/created +func TestSubAccountGetSubAccountApiListReqModel(t *testing.T) { + // GetSubAccountApiList + // Get SubAccount API List + // /api/v1/sub/api-key - data := "{\"password\": \"1234567\", \"remarks\": \"TheRemark\", \"subName\": \"Name1234567\", \"access\": \"Spot\"}" - req := &AddSubAccountReq{} + data := "{\"apiKey\": \"example_string_default_value\", \"subName\": \"testapi6\"}" + req := &GetSubAccountApiListReq{} err := json.Unmarshal([]byte(data), req) req.ToMap() assert.Nil(t, err) } -func TestSubAccountAddSubAccountRespModel(t *testing.T) { - // AddSubAccount - // Add SubAccount - // /api/v2/sub/user/created +func TestSubAccountGetSubAccountApiListRespModel(t *testing.T) { + // GetSubAccountApiList + // Get SubAccount API List + // /api/v1/sub/api-key - data := "{\n \"code\": \"200000\",\n \"data\": {\n \"currentPage\": 1,\n \"pageSize\": 10,\n \"totalNum\": 1,\n \"totalPage\": 1,\n \"items\": [\n {\n \"userId\": \"63743f07e0c5230001761d08\",\n \"uid\": 169579801,\n \"subName\": \"testapi6\",\n \"status\": 2,\n \"type\": 0,\n \"access\": \"All\",\n \"createdAt\": 1668562696000,\n \"remarks\": \"remarks\",\n \"tradeTypes\": [\n \"Spot\",\n \"Futures\",\n \"Margin\"\n ],\n \"openedTradeTypes\": [\n \"Spot\"\n ],\n \"hostedStatus\": null\n }\n ]\n }\n}" + data := "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"subName\": \"apiSdkTest\",\n \"remark\": \"sdk_test_integration\",\n \"apiKey\": \"673eab2a955ebf000195d7e4\",\n \"apiVersion\": 3,\n \"permission\": \"General\",\n \"ipWhitelist\": \"10.**.1\",\n \"createdAt\": 1732160298000,\n \"uid\": 215112467,\n \"isMaster\": false\n }\n ]\n}" commonResp := &types.RestResponse{} err := json.Unmarshal([]byte(data), commonResp) assert.Nil(t, err) assert.NotNil(t, commonResp.Data) - resp := &AddSubAccountResp{} + resp := &GetSubAccountApiListResp{} err = json.Unmarshal([]byte(commonResp.Data), resp) resp.ToMap() assert.Nil(t, err) } -func TestSubAccountGetSpotSubAccountsSummaryV2ReqModel(t *testing.T) { - // GetSpotSubAccountsSummaryV2 - // Get SubAccount List - Summary Info - // /api/v2/sub/user +func TestSubAccountDeleteSubAccountApiReqModel(t *testing.T) { + // DeleteSubAccountApi + // Delete SubAccount API + // /api/v1/sub/api-key - data := "{\"currentPage\": 1, \"pageSize\": 10}" - req := &GetSpotSubAccountsSummaryV2Req{} + data := "{\"apiKey\": \"670621e3a25958000159c82f\", \"subName\": \"testapi6\", \"passphrase\": \"11223344\"}" + req := &DeleteSubAccountApiReq{} err := json.Unmarshal([]byte(data), req) req.ToMap() assert.Nil(t, err) } -func TestSubAccountGetSpotSubAccountsSummaryV2RespModel(t *testing.T) { - // GetSpotSubAccountsSummaryV2 - // Get SubAccount List - Summary Info - // /api/v2/sub/user +func TestSubAccountDeleteSubAccountApiRespModel(t *testing.T) { + // DeleteSubAccountApi + // Delete SubAccount API + // /api/v1/sub/api-key - data := "{\n \"code\": \"200000\",\n \"data\": {\n \"currentPage\": 1,\n \"pageSize\": 10,\n \"totalNum\": 1,\n \"totalPage\": 1,\n \"items\": [\n {\n \"userId\": \"63743f07e0c5230001761d08\",\n \"uid\": 169579801,\n \"subName\": \"testapi6\",\n \"status\": 2,\n \"type\": 0,\n \"access\": \"All\",\n \"createdAt\": 1668562696000,\n \"remarks\": \"remarks\",\n \"tradeTypes\": [\n \"Spot\",\n \"Futures\",\n \"Margin\"\n ],\n \"openedTradeTypes\": [\n \"Spot\"\n ],\n \"hostedStatus\": null\n }\n ]\n }\n}" + data := "{\"code\":\"200000\",\"data\":{\"subName\":\"testapi6\",\"apiKey\":\"670621e3a25958000159c82f\"}}" commonResp := &types.RestResponse{} err := json.Unmarshal([]byte(data), commonResp) assert.Nil(t, err) assert.NotNil(t, commonResp.Data) - resp := &GetSpotSubAccountsSummaryV2Resp{} + resp := &DeleteSubAccountApiResp{} err = json.Unmarshal([]byte(commonResp.Data), resp) resp.ToMap() assert.Nil(t, err) } -func TestSubAccountAddSubAccountFuturesPermissionReqModel(t *testing.T) { - // AddSubAccountFuturesPermission - // Add SubAccount Futures Permission - // /api/v3/sub/user/futures/enable +func TestSubAccountGetSpotSubAccountsSummaryV1ReqModel(t *testing.T) { + // GetSpotSubAccountsSummaryV1 + // Get SubAccount List - Summary Info(V1) + // /api/v1/sub/user - data := "{\"uid\": \"169579801\"}" - req := &AddSubAccountFuturesPermissionReq{} - err := json.Unmarshal([]byte(data), req) - req.ToMap() - assert.Nil(t, err) } -func TestSubAccountAddSubAccountFuturesPermissionRespModel(t *testing.T) { - // AddSubAccountFuturesPermission - // Add SubAccount Futures Permission - // /api/v3/sub/user/futures/enable +func TestSubAccountGetSpotSubAccountsSummaryV1RespModel(t *testing.T) { + // GetSpotSubAccountsSummaryV1 + // Get SubAccount List - Summary Info(V1) + // /api/v1/sub/user - data := "{\n \"code\": \"200000\",\n \"data\": null\n}" + data := "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"userId\": \"63743f07e0c5230001761d08\",\n \"uid\": 169579801,\n \"subName\": \"testapi6\",\n \"type\": 0,\n \"remarks\": \"remarks\",\n \"access\": \"All\"\n },\n {\n \"userId\": \"670538a31037eb000115b076\",\n \"uid\": 225139445,\n \"subName\": \"Name1234567\",\n \"type\": 0,\n \"remarks\": \"TheRemark\",\n \"access\": \"All\"\n }\n ]\n}" commonResp := &types.RestResponse{} err := json.Unmarshal([]byte(data), commonResp) assert.Nil(t, err) assert.NotNil(t, commonResp.Data) - resp := &AddSubAccountFuturesPermissionResp{} + resp := &GetSpotSubAccountsSummaryV1Resp{} err = json.Unmarshal([]byte(commonResp.Data), resp) resp.ToMap() assert.Nil(t, err) } -func TestSubAccountAddSubAccountMarginPermissionReqModel(t *testing.T) { - // AddSubAccountMarginPermission - // Add SubAccount Margin Permission - // /api/v3/sub/user/margin/enable +func TestSubAccountGetSpotSubAccountListV1ReqModel(t *testing.T) { + // GetSpotSubAccountListV1 + // Get SubAccount List - Spot Balance(V1) + // /api/v1/sub-accounts - data := "{\"uid\": \"169579801\"}" - req := &AddSubAccountMarginPermissionReq{} - err := json.Unmarshal([]byte(data), req) - req.ToMap() - assert.Nil(t, err) } -func TestSubAccountAddSubAccountMarginPermissionRespModel(t *testing.T) { - // AddSubAccountMarginPermission - // Add SubAccount Margin Permission - // /api/v3/sub/user/margin/enable +func TestSubAccountGetSpotSubAccountListV1RespModel(t *testing.T) { + // GetSpotSubAccountListV1 + // Get SubAccount List - Spot Balance(V1) + // /api/v1/sub-accounts - data := "{\n \"code\": \"200000\",\n \"data\": null\n}" + data := "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"subUserId\": \"63743f07e0c5230001761d08\",\n \"subName\": \"testapi6\",\n \"mainAccounts\": [\n {\n \"currency\": \"USDT\",\n \"balance\": \"0.01\",\n \"available\": \"0.01\",\n \"holds\": \"0\",\n \"baseCurrency\": \"BTC\",\n \"baseCurrencyPrice\": \"62489.8\",\n \"baseAmount\": \"0.00000016\",\n \"tag\": \"DEFAULT\"\n }\n ],\n \"tradeAccounts\": [\n {\n \"currency\": \"USDT\",\n \"balance\": \"0.01\",\n \"available\": \"0.01\",\n \"holds\": \"0\",\n \"baseCurrency\": \"BTC\",\n \"baseCurrencyPrice\": \"62489.8\",\n \"baseAmount\": \"0.00000016\",\n \"tag\": \"DEFAULT\"\n }\n ],\n \"marginAccounts\": [\n {\n \"currency\": \"USDT\",\n \"balance\": \"0.01\",\n \"available\": \"0.01\",\n \"holds\": \"0\",\n \"baseCurrency\": \"BTC\",\n \"baseCurrencyPrice\": \"62489.8\",\n \"baseAmount\": \"0.00000016\",\n \"tag\": \"DEFAULT\"\n }\n ],\n \"tradeHFAccounts\": []\n },\n {\n \"subUserId\": \"670538a31037eb000115b076\",\n \"subName\": \"Name1234567\",\n \"mainAccounts\": [],\n \"tradeAccounts\": [],\n \"marginAccounts\": [],\n \"tradeHFAccounts\": []\n },\n {\n \"subUserId\": \"66b0c0905fc1480001c14c36\",\n \"subName\": \"LTkucoin1491\",\n \"mainAccounts\": [],\n \"tradeAccounts\": [],\n \"marginAccounts\": [],\n \"tradeHFAccounts\": []\n }\n ]\n}" commonResp := &types.RestResponse{} err := json.Unmarshal([]byte(data), commonResp) assert.Nil(t, err) assert.NotNil(t, commonResp.Data) - resp := &AddSubAccountMarginPermissionResp{} + resp := &GetSpotSubAccountListV1Resp{} err = json.Unmarshal([]byte(commonResp.Data), resp) resp.ToMap() assert.Nil(t, err) diff --git a/sdk/golang/pkg/generate/account/transfer/api_transfer.go b/sdk/golang/pkg/generate/account/transfer/api_transfer.go index bde4a401..5cb8880f 100644 --- a/sdk/golang/pkg/generate/account/transfer/api_transfer.go +++ b/sdk/golang/pkg/generate/account/transfer/api_transfer.go @@ -23,35 +23,34 @@ type TransferAPI interface { // +---------------------+------------+ GetTransferQuotas(req *GetTransferQuotasReq, ctx context.Context) (*GetTransferQuotasResp, error) - // FuturesAccountTransferIn Futures Account Transfer In - // Description: The amount to be transferred will be deducted from the payAccount. Please ensure that you have sufficient funds in your payAccount Account, or the transfer will fail. - // Documentation: https://www.kucoin.com/docs-new/api-3470304 - // +---------------------+------------+ - // | Extra API Info | Value | - // +---------------------+------------+ - // | API-DOMAIN | FUTURES | - // | API-CHANNEL | PRIVATE | - // | API-PERMISSION | FUTURES | - // | API-RATE-LIMIT-POOL | MANAGEMENT | - // | API-RATE-LIMIT | 20 | - // +---------------------+------------+ - // Deprecated - FuturesAccountTransferIn(req *FuturesAccountTransferInReq, ctx context.Context) (*FuturesAccountTransferInResp, error) + // FlexTransfer Flex Transfer + // Description: This interface can be used for transfers between master and sub accounts and inner transfers + // Documentation: https://www.kucoin.com/docs-new/api-3470147 + // +---------------------+---------------+ + // | Extra API Info | Value | + // +---------------------+---------------+ + // | API-DOMAIN | SPOT | + // | API-CHANNEL | PRIVATE | + // | API-PERMISSION | FLEXTRANSFERS | + // | API-RATE-LIMIT-POOL | MANAGEMENT | + // | API-RATE-LIMIT | 4 | + // +---------------------+---------------+ + FlexTransfer(req *FlexTransferReq, ctx context.Context) (*FlexTransferResp, error) - // GetFuturesAccountTransferOutLedger Get Futures Account Transfer Out Ledger - // Description: This endpoint can get futures account transfer out ledger - // Documentation: https://www.kucoin.com/docs-new/api-3470307 + // SubAccountTransfer SubAccount Transfer + // Description: Funds in the main account, trading account and margin account of a Master Account can be transferred to the main account, trading account, futures account and margin account of its Sub-Account. The futures account of both the Master Account and Sub-Account can only accept funds transferred in from the main account, trading account and margin account and cannot transfer out to these accounts. + // Documentation: https://www.kucoin.com/docs-new/api-3470301 // +---------------------+------------+ // | Extra API Info | Value | // +---------------------+------------+ - // | API-DOMAIN | FUTURES | + // | API-DOMAIN | SPOT | // | API-CHANNEL | PRIVATE | - // | API-PERMISSION | GENERAL | + // | API-PERMISSION | SPOT | // | API-RATE-LIMIT-POOL | MANAGEMENT | - // | API-RATE-LIMIT | 20 | + // | API-RATE-LIMIT | 30 | // +---------------------+------------+ // Deprecated - GetFuturesAccountTransferOutLedger(req *GetFuturesAccountTransferOutLedgerReq, ctx context.Context) (*GetFuturesAccountTransferOutLedgerResp, error) + SubAccountTransfer(req *SubAccountTransferReq, ctx context.Context) (*SubAccountTransferResp, error) // InnerTransfer Inner Transfer // Description: This API endpoint can be used to transfer funds between accounts internally. Users can transfer funds between their account free of charge. @@ -68,38 +67,24 @@ type TransferAPI interface { // Deprecated InnerTransfer(req *InnerTransferReq, ctx context.Context) (*InnerTransferResp, error) - // SubAccountTransfer SubAccount Transfer - // Description: Funds in the main account, trading account and margin account of a Master Account can be transferred to the main account, trading account, futures account and margin account of its Sub-Account. The futures account of both the Master Account and Sub-Account can only accept funds transferred in from the main account, trading account and margin account and cannot transfer out to these accounts. - // Documentation: https://www.kucoin.com/docs-new/api-3470301 + // FuturesAccountTransferOut Futures Account Transfer Out + // Description: The amount to be transferred will be deducted from the KuCoin Futures Account. Please ensure that you have sufficient funds in your KuCoin Futures Account, or the transfer will fail. + // Documentation: https://www.kucoin.com/docs-new/api-3470303 // +---------------------+------------+ // | Extra API Info | Value | // +---------------------+------------+ - // | API-DOMAIN | SPOT | + // | API-DOMAIN | FUTURES | // | API-CHANNEL | PRIVATE | - // | API-PERMISSION | SPOT | + // | API-PERMISSION | FUTURES | // | API-RATE-LIMIT-POOL | MANAGEMENT | - // | API-RATE-LIMIT | 30 | + // | API-RATE-LIMIT | 20 | // +---------------------+------------+ // Deprecated - SubAccountTransfer(req *SubAccountTransferReq, ctx context.Context) (*SubAccountTransferResp, error) - - // FlexTransfer Flex Transfer - // Description: This interface can be used for transfers between master and sub accounts and inner transfers - // Documentation: https://www.kucoin.com/docs-new/api-3470147 - // +---------------------+---------------+ - // | Extra API Info | Value | - // +---------------------+---------------+ - // | API-DOMAIN | SPOT | - // | API-CHANNEL | PRIVATE | - // | API-PERMISSION | FLEXTRANSFERS | - // | API-RATE-LIMIT-POOL | MANAGEMENT | - // | API-RATE-LIMIT | 4 | - // +---------------------+---------------+ - FlexTransfer(req *FlexTransferReq, ctx context.Context) (*FlexTransferResp, error) + FuturesAccountTransferOut(req *FuturesAccountTransferOutReq, ctx context.Context) (*FuturesAccountTransferOutResp, error) - // FuturesAccountTransferOut Futures Account Transfer Out - // Description: The amount to be transferred will be deducted from the KuCoin Futures Account. Please ensure that you have sufficient funds in your KuCoin Futures Account, or the transfer will fail. - // Documentation: https://www.kucoin.com/docs-new/api-3470303 + // FuturesAccountTransferIn Futures Account Transfer In + // Description: The amount to be transferred will be deducted from the payAccount. Please ensure that you have sufficient funds in your payAccount Account, or the transfer will fail. + // Documentation: https://www.kucoin.com/docs-new/api-3470304 // +---------------------+------------+ // | Extra API Info | Value | // +---------------------+------------+ @@ -110,7 +95,22 @@ type TransferAPI interface { // | API-RATE-LIMIT | 20 | // +---------------------+------------+ // Deprecated - FuturesAccountTransferOut(req *FuturesAccountTransferOutReq, ctx context.Context) (*FuturesAccountTransferOutResp, error) + FuturesAccountTransferIn(req *FuturesAccountTransferInReq, ctx context.Context) (*FuturesAccountTransferInResp, error) + + // GetFuturesAccountTransferOutLedger Get Futures Account Transfer Out Ledger + // Description: This endpoint can get futures account transfer out ledger + // Documentation: https://www.kucoin.com/docs-new/api-3470307 + // +---------------------+------------+ + // | Extra API Info | Value | + // +---------------------+------------+ + // | API-DOMAIN | FUTURES | + // | API-CHANNEL | PRIVATE | + // | API-PERMISSION | GENERAL | + // | API-RATE-LIMIT-POOL | MANAGEMENT | + // | API-RATE-LIMIT | 20 | + // +---------------------+------------+ + // Deprecated + GetFuturesAccountTransferOutLedger(req *GetFuturesAccountTransferOutLedgerReq, ctx context.Context) (*GetFuturesAccountTransferOutLedgerResp, error) } type TransferAPIImpl struct { @@ -127,15 +127,15 @@ func (impl *TransferAPIImpl) GetTransferQuotas(req *GetTransferQuotasReq, ctx co return resp, err } -func (impl *TransferAPIImpl) FuturesAccountTransferIn(req *FuturesAccountTransferInReq, ctx context.Context) (*FuturesAccountTransferInResp, error) { - resp := &FuturesAccountTransferInResp{} - err := impl.transport.Call(ctx, "futures", false, "Post", "/api/v1/transfer-in", req, resp, false) +func (impl *TransferAPIImpl) FlexTransfer(req *FlexTransferReq, ctx context.Context) (*FlexTransferResp, error) { + resp := &FlexTransferResp{} + err := impl.transport.Call(ctx, "spot", false, "Post", "/api/v3/accounts/universal-transfer", req, resp, false) return resp, err } -func (impl *TransferAPIImpl) GetFuturesAccountTransferOutLedger(req *GetFuturesAccountTransferOutLedgerReq, ctx context.Context) (*GetFuturesAccountTransferOutLedgerResp, error) { - resp := &GetFuturesAccountTransferOutLedgerResp{} - err := impl.transport.Call(ctx, "futures", false, "Get", "/api/v1/transfer-list", req, resp, false) +func (impl *TransferAPIImpl) SubAccountTransfer(req *SubAccountTransferReq, ctx context.Context) (*SubAccountTransferResp, error) { + resp := &SubAccountTransferResp{} + err := impl.transport.Call(ctx, "spot", false, "Post", "/api/v2/accounts/sub-transfer", req, resp, false) return resp, err } @@ -145,20 +145,20 @@ func (impl *TransferAPIImpl) InnerTransfer(req *InnerTransferReq, ctx context.Co return resp, err } -func (impl *TransferAPIImpl) SubAccountTransfer(req *SubAccountTransferReq, ctx context.Context) (*SubAccountTransferResp, error) { - resp := &SubAccountTransferResp{} - err := impl.transport.Call(ctx, "spot", false, "Post", "/api/v2/accounts/sub-transfer", req, resp, false) +func (impl *TransferAPIImpl) FuturesAccountTransferOut(req *FuturesAccountTransferOutReq, ctx context.Context) (*FuturesAccountTransferOutResp, error) { + resp := &FuturesAccountTransferOutResp{} + err := impl.transport.Call(ctx, "futures", false, "Post", "/api/v3/transfer-out", req, resp, false) return resp, err } -func (impl *TransferAPIImpl) FlexTransfer(req *FlexTransferReq, ctx context.Context) (*FlexTransferResp, error) { - resp := &FlexTransferResp{} - err := impl.transport.Call(ctx, "spot", false, "Post", "/api/v3/accounts/universal-transfer", req, resp, false) +func (impl *TransferAPIImpl) FuturesAccountTransferIn(req *FuturesAccountTransferInReq, ctx context.Context) (*FuturesAccountTransferInResp, error) { + resp := &FuturesAccountTransferInResp{} + err := impl.transport.Call(ctx, "futures", false, "Post", "/api/v1/transfer-in", req, resp, false) return resp, err } -func (impl *TransferAPIImpl) FuturesAccountTransferOut(req *FuturesAccountTransferOutReq, ctx context.Context) (*FuturesAccountTransferOutResp, error) { - resp := &FuturesAccountTransferOutResp{} - err := impl.transport.Call(ctx, "futures", false, "Post", "/api/v3/transfer-out", req, resp, false) +func (impl *TransferAPIImpl) GetFuturesAccountTransferOutLedger(req *GetFuturesAccountTransferOutLedgerReq, ctx context.Context) (*GetFuturesAccountTransferOutLedgerResp, error) { + resp := &GetFuturesAccountTransferOutLedgerResp{} + err := impl.transport.Call(ctx, "futures", false, "Get", "/api/v1/transfer-list", req, resp, false) return resp, err } diff --git a/sdk/golang/pkg/generate/account/transfer/api_transfer.template b/sdk/golang/pkg/generate/account/transfer/api_transfer.template index 13efdb5a..150e36f2 100644 --- a/sdk/golang/pkg/generate/account/transfer/api_transfer.template +++ b/sdk/golang/pkg/generate/account/transfer/api_transfer.template @@ -24,16 +24,16 @@ func TestTransferGetTransferQuotasReq(t *testing.T) { } -func TestTransferFuturesAccountTransferInReq(t *testing.T) { - // FuturesAccountTransferIn - // Futures Account Transfer In - // /api/v1/transfer-in +func TestTransferFlexTransferReq(t *testing.T) { + // FlexTransfer + // Flex Transfer + // /api/v3/accounts/universal-transfer - builder := transfer.NewFuturesAccountTransferInReqBuilder() - builder.SetCurrency(?).SetAmount(?).SetPayAccountType(?) + builder := transfer.NewFlexTransferReqBuilder() + builder.SetClientOid(?).SetCurrency(?).SetAmount(?).SetFromUserId(?).SetFromAccountType(?).SetFromAccountTag(?).SetType(?).SetToUserId(?).SetToAccountType(?).SetToAccountTag(?) req := builder.Build() - resp, err := transferApi.FuturesAccountTransferIn(req, context.TODO()) + resp, err := transferApi.FlexTransfer(req, context.TODO()) if err != nil { panic(err) } @@ -47,16 +47,16 @@ func TestTransferFuturesAccountTransferInReq(t *testing.T) { } -func TestTransferGetFuturesAccountTransferOutLedgerReq(t *testing.T) { - // GetFuturesAccountTransferOutLedger - // Get Futures Account Transfer Out Ledger - // /api/v1/transfer-list +func TestTransferSubAccountTransferReq(t *testing.T) { + // SubAccountTransfer + // SubAccount Transfer + // /api/v2/accounts/sub-transfer - builder := transfer.NewGetFuturesAccountTransferOutLedgerReqBuilder() - builder.SetCurrency(?).SetType(?).SetTag(?).SetStartAt(?).SetEndAt(?).SetCurrentPage(?).SetPageSize(?) + builder := transfer.NewSubAccountTransferReqBuilder() + builder.SetClientOid(?).SetCurrency(?).SetAmount(?).SetDirection(?).SetAccountType(?).SetSubAccountType(?).SetSubUserId(?) req := builder.Build() - resp, err := transferApi.GetFuturesAccountTransferOutLedger(req, context.TODO()) + resp, err := transferApi.SubAccountTransfer(req, context.TODO()) if err != nil { panic(err) } @@ -93,16 +93,16 @@ func TestTransferInnerTransferReq(t *testing.T) { } -func TestTransferSubAccountTransferReq(t *testing.T) { - // SubAccountTransfer - // SubAccount Transfer - // /api/v2/accounts/sub-transfer +func TestTransferFuturesAccountTransferOutReq(t *testing.T) { + // FuturesAccountTransferOut + // Futures Account Transfer Out + // /api/v3/transfer-out - builder := transfer.NewSubAccountTransferReqBuilder() - builder.SetClientOid(?).SetCurrency(?).SetAmount(?).SetDirection(?).SetAccountType(?).SetSubAccountType(?).SetSubUserId(?) + builder := transfer.NewFuturesAccountTransferOutReqBuilder() + builder.SetCurrency(?).SetAmount(?).SetRecAccountType(?) req := builder.Build() - resp, err := transferApi.SubAccountTransfer(req, context.TODO()) + resp, err := transferApi.FuturesAccountTransferOut(req, context.TODO()) if err != nil { panic(err) } @@ -116,16 +116,16 @@ func TestTransferSubAccountTransferReq(t *testing.T) { } -func TestTransferFlexTransferReq(t *testing.T) { - // FlexTransfer - // Flex Transfer - // /api/v3/accounts/universal-transfer +func TestTransferFuturesAccountTransferInReq(t *testing.T) { + // FuturesAccountTransferIn + // Futures Account Transfer In + // /api/v1/transfer-in - builder := transfer.NewFlexTransferReqBuilder() - builder.SetClientOid(?).SetCurrency(?).SetAmount(?).SetFromUserId(?).SetFromAccountType(?).SetFromAccountTag(?).SetType(?).SetToUserId(?).SetToAccountType(?).SetToAccountTag(?) + builder := transfer.NewFuturesAccountTransferInReqBuilder() + builder.SetCurrency(?).SetAmount(?).SetPayAccountType(?) req := builder.Build() - resp, err := transferApi.FlexTransfer(req, context.TODO()) + resp, err := transferApi.FuturesAccountTransferIn(req, context.TODO()) if err != nil { panic(err) } @@ -139,16 +139,16 @@ func TestTransferFlexTransferReq(t *testing.T) { } -func TestTransferFuturesAccountTransferOutReq(t *testing.T) { - // FuturesAccountTransferOut - // Futures Account Transfer Out - // /api/v3/transfer-out +func TestTransferGetFuturesAccountTransferOutLedgerReq(t *testing.T) { + // GetFuturesAccountTransferOutLedger + // Get Futures Account Transfer Out Ledger + // /api/v1/transfer-list - builder := transfer.NewFuturesAccountTransferOutReqBuilder() - builder.SetCurrency(?).SetAmount(?).SetRecAccountType(?) + builder := transfer.NewGetFuturesAccountTransferOutLedgerReqBuilder() + builder.SetCurrency(?).SetType(?).SetTag(?).SetStartAt(?).SetEndAt(?).SetCurrentPage(?).SetPageSize(?) req := builder.Build() - resp, err := transferApi.FuturesAccountTransferOut(req, context.TODO()) + resp, err := transferApi.GetFuturesAccountTransferOutLedger(req, context.TODO()) if err != nil { panic(err) } diff --git a/sdk/golang/pkg/generate/account/transfer/api_transfer_test.go b/sdk/golang/pkg/generate/account/transfer/api_transfer_test.go index 0ef1df21..6eb8952a 100644 --- a/sdk/golang/pkg/generate/account/transfer/api_transfer_test.go +++ b/sdk/golang/pkg/generate/account/transfer/api_transfer_test.go @@ -35,57 +35,57 @@ func TestTransferGetTransferQuotasRespModel(t *testing.T) { assert.Nil(t, err) } -func TestTransferFuturesAccountTransferInReqModel(t *testing.T) { - // FuturesAccountTransferIn - // Futures Account Transfer In - // /api/v1/transfer-in +func TestTransferFlexTransferReqModel(t *testing.T) { + // FlexTransfer + // Flex Transfer + // /api/v3/accounts/universal-transfer - data := "{\"currency\": \"USDT\", \"amount\": 0.01, \"payAccountType\": \"MAIN\"}" - req := &FuturesAccountTransferInReq{} + data := "{\"clientOid\": \"64ccc0f164781800010d8c09\", \"type\": \"PARENT_TO_SUB\", \"currency\": \"USDT\", \"amount\": \"0.01\", \"fromAccountType\": \"TRADE\", \"toUserId\": \"63743f07e0c5230001761d08\", \"toAccountType\": \"TRADE\"}" + req := &FlexTransferReq{} err := json.Unmarshal([]byte(data), req) req.ToMap() assert.Nil(t, err) } -func TestTransferFuturesAccountTransferInRespModel(t *testing.T) { - // FuturesAccountTransferIn - // Futures Account Transfer In - // /api/v1/transfer-in +func TestTransferFlexTransferRespModel(t *testing.T) { + // FlexTransfer + // Flex Transfer + // /api/v3/accounts/universal-transfer - data := "{\"code\":\"200000\",\"data\":null}" + data := "{\n \"code\": \"200000\",\n \"data\": {\n \"orderId\": \"6705f7248c6954000733ecac\"\n }\n}" commonResp := &types.RestResponse{} err := json.Unmarshal([]byte(data), commonResp) assert.Nil(t, err) assert.NotNil(t, commonResp.Data) - resp := &FuturesAccountTransferInResp{} + resp := &FlexTransferResp{} err = json.Unmarshal([]byte(commonResp.Data), resp) resp.ToMap() assert.Nil(t, err) } -func TestTransferGetFuturesAccountTransferOutLedgerReqModel(t *testing.T) { - // GetFuturesAccountTransferOutLedger - // Get Futures Account Transfer Out Ledger - // /api/v1/transfer-list +func TestTransferSubAccountTransferReqModel(t *testing.T) { + // SubAccountTransfer + // SubAccount Transfer + // /api/v2/accounts/sub-transfer - data := "{\"currency\": \"XBT\", \"type\": \"MAIN\", \"tag\": [\"mock_a\", \"mock_b\"], \"startAt\": 1728663338000, \"endAt\": 1728692138000, \"currentPage\": 1, \"pageSize\": 50}" - req := &GetFuturesAccountTransferOutLedgerReq{} + data := "{\"clientOid\": \"64ccc0f164781800010d8c09\", \"currency\": \"USDT\", \"amount\": \"0.01\", \"direction\": \"OUT\", \"accountType\": \"MAIN\", \"subAccountType\": \"MAIN\", \"subUserId\": \"63743f07e0c5230001761d08\"}" + req := &SubAccountTransferReq{} err := json.Unmarshal([]byte(data), req) req.ToMap() assert.Nil(t, err) } -func TestTransferGetFuturesAccountTransferOutLedgerRespModel(t *testing.T) { - // GetFuturesAccountTransferOutLedger - // Get Futures Account Transfer Out Ledger - // /api/v1/transfer-list +func TestTransferSubAccountTransferRespModel(t *testing.T) { + // SubAccountTransfer + // SubAccount Transfer + // /api/v2/accounts/sub-transfer - data := "{\"code\":\"200000\",\"data\":{\"currentPage\":1,\"pageSize\":50,\"totalNum\":1,\"totalPage\":1,\"items\":[{\"applyId\":\"670bf84c577f6c00017a1c48\",\"currency\":\"USDT\",\"recRemark\":\"\",\"recSystem\":\"KUCOIN\",\"status\":\"SUCCESS\",\"amount\":\"0.01\",\"reason\":\"\",\"offset\":1519769124134806,\"createdAt\":1728837708000,\"remark\":\"\"}]}}" + data := "{\"code\":\"200000\",\"data\":{\"orderId\":\"670be6b0b1b9080007040a9b\"}}" commonResp := &types.RestResponse{} err := json.Unmarshal([]byte(data), commonResp) assert.Nil(t, err) assert.NotNil(t, commonResp.Data) - resp := &GetFuturesAccountTransferOutLedgerResp{} + resp := &SubAccountTransferResp{} err = json.Unmarshal([]byte(commonResp.Data), resp) resp.ToMap() assert.Nil(t, err) @@ -119,85 +119,85 @@ func TestTransferInnerTransferRespModel(t *testing.T) { assert.Nil(t, err) } -func TestTransferSubAccountTransferReqModel(t *testing.T) { - // SubAccountTransfer - // SubAccount Transfer - // /api/v2/accounts/sub-transfer +func TestTransferFuturesAccountTransferOutReqModel(t *testing.T) { + // FuturesAccountTransferOut + // Futures Account Transfer Out + // /api/v3/transfer-out - data := "{\"clientOid\": \"64ccc0f164781800010d8c09\", \"currency\": \"USDT\", \"amount\": \"0.01\", \"direction\": \"OUT\", \"accountType\": \"MAIN\", \"subAccountType\": \"MAIN\", \"subUserId\": \"63743f07e0c5230001761d08\"}" - req := &SubAccountTransferReq{} + data := "{\"currency\": \"USDT\", \"amount\": 0.01, \"recAccountType\": \"MAIN\"}" + req := &FuturesAccountTransferOutReq{} err := json.Unmarshal([]byte(data), req) req.ToMap() assert.Nil(t, err) } -func TestTransferSubAccountTransferRespModel(t *testing.T) { - // SubAccountTransfer - // SubAccount Transfer - // /api/v2/accounts/sub-transfer +func TestTransferFuturesAccountTransferOutRespModel(t *testing.T) { + // FuturesAccountTransferOut + // Futures Account Transfer Out + // /api/v3/transfer-out - data := "{\"code\":\"200000\",\"data\":{\"orderId\":\"670be6b0b1b9080007040a9b\"}}" + data := "{\n \"code\": \"200000\",\n \"data\": {\n \"applyId\": \"670bf84c577f6c00017a1c48\",\n \"bizNo\": \"670bf84c577f6c00017a1c47\",\n \"payAccountType\": \"CONTRACT\",\n \"payTag\": \"DEFAULT\",\n \"remark\": \"\",\n \"recAccountType\": \"MAIN\",\n \"recTag\": \"DEFAULT\",\n \"recRemark\": \"\",\n \"recSystem\": \"KUCOIN\",\n \"status\": \"PROCESSING\",\n \"currency\": \"USDT\",\n \"amount\": \"0.01\",\n \"fee\": \"0\",\n \"sn\": 1519769124134806,\n \"reason\": \"\",\n \"createdAt\": 1728837708000,\n \"updatedAt\": 1728837708000\n }\n}" commonResp := &types.RestResponse{} err := json.Unmarshal([]byte(data), commonResp) assert.Nil(t, err) assert.NotNil(t, commonResp.Data) - resp := &SubAccountTransferResp{} + resp := &FuturesAccountTransferOutResp{} err = json.Unmarshal([]byte(commonResp.Data), resp) resp.ToMap() assert.Nil(t, err) } -func TestTransferFlexTransferReqModel(t *testing.T) { - // FlexTransfer - // Flex Transfer - // /api/v3/accounts/universal-transfer +func TestTransferFuturesAccountTransferInReqModel(t *testing.T) { + // FuturesAccountTransferIn + // Futures Account Transfer In + // /api/v1/transfer-in - data := "{\"clientOid\": \"64ccc0f164781800010d8c09\", \"type\": \"PARENT_TO_SUB\", \"currency\": \"USDT\", \"amount\": \"0.01\", \"fromAccountType\": \"TRADE\", \"toUserId\": \"63743f07e0c5230001761d08\", \"toAccountType\": \"TRADE\"}" - req := &FlexTransferReq{} + data := "{\"currency\": \"USDT\", \"amount\": 0.01, \"payAccountType\": \"MAIN\"}" + req := &FuturesAccountTransferInReq{} err := json.Unmarshal([]byte(data), req) req.ToMap() assert.Nil(t, err) } -func TestTransferFlexTransferRespModel(t *testing.T) { - // FlexTransfer - // Flex Transfer - // /api/v3/accounts/universal-transfer +func TestTransferFuturesAccountTransferInRespModel(t *testing.T) { + // FuturesAccountTransferIn + // Futures Account Transfer In + // /api/v1/transfer-in - data := "{\n \"code\": \"200000\",\n \"data\": {\n \"orderId\": \"6705f7248c6954000733ecac\"\n }\n}" + data := "{\"code\":\"200000\",\"data\":null}" commonResp := &types.RestResponse{} err := json.Unmarshal([]byte(data), commonResp) assert.Nil(t, err) assert.NotNil(t, commonResp.Data) - resp := &FlexTransferResp{} + resp := &FuturesAccountTransferInResp{} err = json.Unmarshal([]byte(commonResp.Data), resp) resp.ToMap() assert.Nil(t, err) } -func TestTransferFuturesAccountTransferOutReqModel(t *testing.T) { - // FuturesAccountTransferOut - // Futures Account Transfer Out - // /api/v3/transfer-out +func TestTransferGetFuturesAccountTransferOutLedgerReqModel(t *testing.T) { + // GetFuturesAccountTransferOutLedger + // Get Futures Account Transfer Out Ledger + // /api/v1/transfer-list - data := "{\"currency\": \"USDT\", \"amount\": 0.01, \"recAccountType\": \"MAIN\"}" - req := &FuturesAccountTransferOutReq{} + data := "{\"currency\": \"XBT\", \"type\": \"MAIN\", \"tag\": [\"mock_a\", \"mock_b\"], \"startAt\": 1728663338000, \"endAt\": 1728692138000, \"currentPage\": 1, \"pageSize\": 50}" + req := &GetFuturesAccountTransferOutLedgerReq{} err := json.Unmarshal([]byte(data), req) req.ToMap() assert.Nil(t, err) } -func TestTransferFuturesAccountTransferOutRespModel(t *testing.T) { - // FuturesAccountTransferOut - // Futures Account Transfer Out - // /api/v3/transfer-out +func TestTransferGetFuturesAccountTransferOutLedgerRespModel(t *testing.T) { + // GetFuturesAccountTransferOutLedger + // Get Futures Account Transfer Out Ledger + // /api/v1/transfer-list - data := "{\n \"code\": \"200000\",\n \"data\": {\n \"applyId\": \"670bf84c577f6c00017a1c48\",\n \"bizNo\": \"670bf84c577f6c00017a1c47\",\n \"payAccountType\": \"CONTRACT\",\n \"payTag\": \"DEFAULT\",\n \"remark\": \"\",\n \"recAccountType\": \"MAIN\",\n \"recTag\": \"DEFAULT\",\n \"recRemark\": \"\",\n \"recSystem\": \"KUCOIN\",\n \"status\": \"PROCESSING\",\n \"currency\": \"USDT\",\n \"amount\": \"0.01\",\n \"fee\": \"0\",\n \"sn\": 1519769124134806,\n \"reason\": \"\",\n \"createdAt\": 1728837708000,\n \"updatedAt\": 1728837708000\n }\n}" + data := "{\"code\":\"200000\",\"data\":{\"currentPage\":1,\"pageSize\":50,\"totalNum\":1,\"totalPage\":1,\"items\":[{\"applyId\":\"670bf84c577f6c00017a1c48\",\"currency\":\"USDT\",\"recRemark\":\"\",\"recSystem\":\"KUCOIN\",\"status\":\"SUCCESS\",\"amount\":\"0.01\",\"reason\":\"\",\"offset\":1519769124134806,\"createdAt\":1728837708000,\"remark\":\"\"}]}}" commonResp := &types.RestResponse{} err := json.Unmarshal([]byte(data), commonResp) assert.Nil(t, err) assert.NotNil(t, commonResp.Data) - resp := &FuturesAccountTransferOutResp{} + resp := &GetFuturesAccountTransferOutLedgerResp{} err = json.Unmarshal([]byte(commonResp.Data), resp) resp.ToMap() assert.Nil(t, err) diff --git a/sdk/golang/pkg/generate/account/withdrawal/api_withdrawal.go b/sdk/golang/pkg/generate/account/withdrawal/api_withdrawal.go index 39b3b565..bfaa142f 100644 --- a/sdk/golang/pkg/generate/account/withdrawal/api_withdrawal.go +++ b/sdk/golang/pkg/generate/account/withdrawal/api_withdrawal.go @@ -9,9 +9,9 @@ import ( type WithdrawalAPI interface { - // GetWithdrawalHistoryOld Get Withdrawal History - Old - // Description: Request via this endpoint to get deposit list Items are paginated and sorted to show the latest first. See the Pagination section for retrieving additional entries after the first page. - // Documentation: https://www.kucoin.com/docs-new/api-3470308 + // GetWithdrawalQuotas Get Withdrawal Quotas + // Description: This interface can obtain the withdrawal quotas information of this currency. + // Documentation: https://www.kucoin.com/docs-new/api-3470143 // +---------------------+------------+ // | Extra API Info | Value | // +---------------------+------------+ @@ -21,26 +21,25 @@ type WithdrawalAPI interface { // | API-RATE-LIMIT-POOL | MANAGEMENT | // | API-RATE-LIMIT | 20 | // +---------------------+------------+ - // Deprecated - GetWithdrawalHistoryOld(req *GetWithdrawalHistoryOldReq, ctx context.Context) (*GetWithdrawalHistoryOldResp, error) + GetWithdrawalQuotas(req *GetWithdrawalQuotasReq, ctx context.Context) (*GetWithdrawalQuotasResp, error) - // GetWithdrawalHistory Get Withdrawal History - // Description: Request via this endpoint to get deposit list Items are paginated and sorted to show the latest first. See the Pagination section for retrieving additional entries after the first page. - // Documentation: https://www.kucoin.com/docs-new/api-3470145 + // WithdrawalV3 Withdraw(V3) + // Description: Use this interface to withdraw the specified currency + // Documentation: https://www.kucoin.com/docs-new/api-3470146 // +---------------------+------------+ // | Extra API Info | Value | // +---------------------+------------+ // | API-DOMAIN | SPOT | // | API-CHANNEL | PRIVATE | - // | API-PERMISSION | GENERAL | + // | API-PERMISSION | WITHDRAWAL | // | API-RATE-LIMIT-POOL | MANAGEMENT | - // | API-RATE-LIMIT | 20 | + // | API-RATE-LIMIT | 5 | // +---------------------+------------+ - GetWithdrawalHistory(req *GetWithdrawalHistoryReq, ctx context.Context) (*GetWithdrawalHistoryResp, error) + WithdrawalV3(req *WithdrawalV3Req, ctx context.Context) (*WithdrawalV3Resp, error) - // WithdrawalV1 Withdraw - V1 - // Description: Use this interface to withdraw the specified currency - // Documentation: https://www.kucoin.com/docs-new/api-3470310 + // CancelWithdrawal Cancel Withdrawal + // Description: This interface can cancel the withdrawal, Only withdrawals requests of PROCESSING status could be canceled. + // Documentation: https://www.kucoin.com/docs-new/api-3470144 // +---------------------+------------+ // | Extra API Info | Value | // +---------------------+------------+ @@ -48,14 +47,13 @@ type WithdrawalAPI interface { // | API-CHANNEL | PRIVATE | // | API-PERMISSION | WITHDRAWAL | // | API-RATE-LIMIT-POOL | MANAGEMENT | - // | API-RATE-LIMIT | 5 | + // | API-RATE-LIMIT | 20 | // +---------------------+------------+ - // Deprecated - WithdrawalV1(req *WithdrawalV1Req, ctx context.Context) (*WithdrawalV1Resp, error) + CancelWithdrawal(req *CancelWithdrawalReq, ctx context.Context) (*CancelWithdrawalResp, error) - // GetWithdrawalQuotas Get Withdrawal Quotas - // Description: This interface can obtain the withdrawal quotas information of this currency. - // Documentation: https://www.kucoin.com/docs-new/api-3470143 + // GetWithdrawalHistory Get Withdrawal History + // Description: Request via this endpoint to get deposit list Items are paginated and sorted to show the latest first. See the Pagination section for retrieving additional entries after the first page. + // Documentation: https://www.kucoin.com/docs-new/api-3470145 // +---------------------+------------+ // | Extra API Info | Value | // +---------------------+------------+ @@ -65,25 +63,26 @@ type WithdrawalAPI interface { // | API-RATE-LIMIT-POOL | MANAGEMENT | // | API-RATE-LIMIT | 20 | // +---------------------+------------+ - GetWithdrawalQuotas(req *GetWithdrawalQuotasReq, ctx context.Context) (*GetWithdrawalQuotasResp, error) + GetWithdrawalHistory(req *GetWithdrawalHistoryReq, ctx context.Context) (*GetWithdrawalHistoryResp, error) - // CancelWithdrawal Cancel Withdrawal - // Description: This interface can cancel the withdrawal, Only withdrawals requests of PROCESSING status could be canceled. - // Documentation: https://www.kucoin.com/docs-new/api-3470144 + // GetWithdrawalHistoryOld Get Withdrawal History - Old + // Description: Request via this endpoint to get deposit list Items are paginated and sorted to show the latest first. See the Pagination section for retrieving additional entries after the first page. + // Documentation: https://www.kucoin.com/docs-new/api-3470308 // +---------------------+------------+ // | Extra API Info | Value | // +---------------------+------------+ // | API-DOMAIN | SPOT | // | API-CHANNEL | PRIVATE | - // | API-PERMISSION | WITHDRAWAL | + // | API-PERMISSION | GENERAL | // | API-RATE-LIMIT-POOL | MANAGEMENT | // | API-RATE-LIMIT | 20 | // +---------------------+------------+ - CancelWithdrawal(req *CancelWithdrawalReq, ctx context.Context) (*CancelWithdrawalResp, error) + // Deprecated + GetWithdrawalHistoryOld(req *GetWithdrawalHistoryOldReq, ctx context.Context) (*GetWithdrawalHistoryOldResp, error) - // WithdrawalV3 Withdraw(V3) + // WithdrawalV1 Withdraw - V1 // Description: Use this interface to withdraw the specified currency - // Documentation: https://www.kucoin.com/docs-new/api-3470146 + // Documentation: https://www.kucoin.com/docs-new/api-3470310 // +---------------------+------------+ // | Extra API Info | Value | // +---------------------+------------+ @@ -93,7 +92,8 @@ type WithdrawalAPI interface { // | API-RATE-LIMIT-POOL | MANAGEMENT | // | API-RATE-LIMIT | 5 | // +---------------------+------------+ - WithdrawalV3(req *WithdrawalV3Req, ctx context.Context) (*WithdrawalV3Resp, error) + // Deprecated + WithdrawalV1(req *WithdrawalV1Req, ctx context.Context) (*WithdrawalV1Resp, error) } type WithdrawalAPIImpl struct { @@ -104,38 +104,38 @@ func NewWithdrawalAPIImp(transport interfaces.Transport) *WithdrawalAPIImpl { return &WithdrawalAPIImpl{transport: transport} } -func (impl *WithdrawalAPIImpl) GetWithdrawalHistoryOld(req *GetWithdrawalHistoryOldReq, ctx context.Context) (*GetWithdrawalHistoryOldResp, error) { - resp := &GetWithdrawalHistoryOldResp{} - err := impl.transport.Call(ctx, "spot", false, "Get", "/api/v1/hist-withdrawals", req, resp, false) +func (impl *WithdrawalAPIImpl) GetWithdrawalQuotas(req *GetWithdrawalQuotasReq, ctx context.Context) (*GetWithdrawalQuotasResp, error) { + resp := &GetWithdrawalQuotasResp{} + err := impl.transport.Call(ctx, "spot", false, "Get", "/api/v1/withdrawals/quotas", req, resp, false) return resp, err } -func (impl *WithdrawalAPIImpl) GetWithdrawalHistory(req *GetWithdrawalHistoryReq, ctx context.Context) (*GetWithdrawalHistoryResp, error) { - resp := &GetWithdrawalHistoryResp{} - err := impl.transport.Call(ctx, "spot", false, "Get", "/api/v1/withdrawals", req, resp, false) +func (impl *WithdrawalAPIImpl) WithdrawalV3(req *WithdrawalV3Req, ctx context.Context) (*WithdrawalV3Resp, error) { + resp := &WithdrawalV3Resp{} + err := impl.transport.Call(ctx, "spot", false, "Post", "/api/v3/withdrawals", req, resp, false) return resp, err } -func (impl *WithdrawalAPIImpl) WithdrawalV1(req *WithdrawalV1Req, ctx context.Context) (*WithdrawalV1Resp, error) { - resp := &WithdrawalV1Resp{} - err := impl.transport.Call(ctx, "spot", false, "Post", "/api/v1/withdrawals", req, resp, false) +func (impl *WithdrawalAPIImpl) CancelWithdrawal(req *CancelWithdrawalReq, ctx context.Context) (*CancelWithdrawalResp, error) { + resp := &CancelWithdrawalResp{} + err := impl.transport.Call(ctx, "spot", false, "Delete", "/api/v1/withdrawals/{withdrawalId}", req, resp, false) return resp, err } -func (impl *WithdrawalAPIImpl) GetWithdrawalQuotas(req *GetWithdrawalQuotasReq, ctx context.Context) (*GetWithdrawalQuotasResp, error) { - resp := &GetWithdrawalQuotasResp{} - err := impl.transport.Call(ctx, "spot", false, "Get", "/api/v1/withdrawals/quotas", req, resp, false) +func (impl *WithdrawalAPIImpl) GetWithdrawalHistory(req *GetWithdrawalHistoryReq, ctx context.Context) (*GetWithdrawalHistoryResp, error) { + resp := &GetWithdrawalHistoryResp{} + err := impl.transport.Call(ctx, "spot", false, "Get", "/api/v1/withdrawals", req, resp, false) return resp, err } -func (impl *WithdrawalAPIImpl) CancelWithdrawal(req *CancelWithdrawalReq, ctx context.Context) (*CancelWithdrawalResp, error) { - resp := &CancelWithdrawalResp{} - err := impl.transport.Call(ctx, "spot", false, "Delete", "/api/v1/withdrawals/{withdrawalId}", req, resp, false) +func (impl *WithdrawalAPIImpl) GetWithdrawalHistoryOld(req *GetWithdrawalHistoryOldReq, ctx context.Context) (*GetWithdrawalHistoryOldResp, error) { + resp := &GetWithdrawalHistoryOldResp{} + err := impl.transport.Call(ctx, "spot", false, "Get", "/api/v1/hist-withdrawals", req, resp, false) return resp, err } -func (impl *WithdrawalAPIImpl) WithdrawalV3(req *WithdrawalV3Req, ctx context.Context) (*WithdrawalV3Resp, error) { - resp := &WithdrawalV3Resp{} - err := impl.transport.Call(ctx, "spot", false, "Post", "/api/v3/withdrawals", req, resp, false) +func (impl *WithdrawalAPIImpl) WithdrawalV1(req *WithdrawalV1Req, ctx context.Context) (*WithdrawalV1Resp, error) { + resp := &WithdrawalV1Resp{} + err := impl.transport.Call(ctx, "spot", false, "Post", "/api/v1/withdrawals", req, resp, false) return resp, err } diff --git a/sdk/golang/pkg/generate/account/withdrawal/api_withdrawal.template b/sdk/golang/pkg/generate/account/withdrawal/api_withdrawal.template index bc6ce16c..8e9c457d 100644 --- a/sdk/golang/pkg/generate/account/withdrawal/api_withdrawal.template +++ b/sdk/golang/pkg/generate/account/withdrawal/api_withdrawal.template @@ -1,16 +1,16 @@ # API FUNCTION TEMPLATE -func TestWithdrawalGetWithdrawalHistoryOldReq(t *testing.T) { - // GetWithdrawalHistoryOld - // Get Withdrawal History - Old - // /api/v1/hist-withdrawals +func TestWithdrawalGetWithdrawalQuotasReq(t *testing.T) { + // GetWithdrawalQuotas + // Get Withdrawal Quotas + // /api/v1/withdrawals/quotas - builder := withdrawal.NewGetWithdrawalHistoryOldReqBuilder() - builder.SetCurrency(?).SetStatus(?).SetStartAt(?).SetEndAt(?).SetCurrentPage(?).SetPageSize(?) + builder := withdrawal.NewGetWithdrawalQuotasReqBuilder() + builder.SetCurrency(?).SetChain(?) req := builder.Build() - resp, err := withdrawalApi.GetWithdrawalHistoryOld(req, context.TODO()) + resp, err := withdrawalApi.GetWithdrawalQuotas(req, context.TODO()) if err != nil { panic(err) } @@ -24,16 +24,16 @@ func TestWithdrawalGetWithdrawalHistoryOldReq(t *testing.T) { } -func TestWithdrawalGetWithdrawalHistoryReq(t *testing.T) { - // GetWithdrawalHistory - // Get Withdrawal History - // /api/v1/withdrawals +func TestWithdrawalWithdrawalV3Req(t *testing.T) { + // WithdrawalV3 + // Withdraw(V3) + // /api/v3/withdrawals - builder := withdrawal.NewGetWithdrawalHistoryReqBuilder() - builder.SetCurrency(?).SetStatus(?).SetStartAt(?).SetEndAt(?).SetCurrentPage(?).SetPageSize(?) + builder := withdrawal.NewWithdrawalV3ReqBuilder() + builder.SetCurrency(?).SetChain(?).SetAmount(?).SetMemo(?).SetIsInner(?).SetRemark(?).SetFeeDeductType(?).SetToAddress(?).SetWithdrawType(?) req := builder.Build() - resp, err := withdrawalApi.GetWithdrawalHistory(req, context.TODO()) + resp, err := withdrawalApi.WithdrawalV3(req, context.TODO()) if err != nil { panic(err) } @@ -47,16 +47,16 @@ func TestWithdrawalGetWithdrawalHistoryReq(t *testing.T) { } -func TestWithdrawalWithdrawalV1Req(t *testing.T) { - // WithdrawalV1 - // Withdraw - V1 - // /api/v1/withdrawals +func TestWithdrawalCancelWithdrawalReq(t *testing.T) { + // CancelWithdrawal + // Cancel Withdrawal + // /api/v1/withdrawals/{withdrawalId} - builder := withdrawal.NewWithdrawalV1ReqBuilder() - builder.SetCurrency(?).SetChain(?).SetAddress(?).SetAmount(?).SetMemo(?).SetIsInner(?).SetRemark(?).SetFeeDeductType(?) + builder := withdrawal.NewCancelWithdrawalReqBuilder() + builder.SetWithdrawalId(?) req := builder.Build() - resp, err := withdrawalApi.WithdrawalV1(req, context.TODO()) + resp, err := withdrawalApi.CancelWithdrawal(req, context.TODO()) if err != nil { panic(err) } @@ -70,16 +70,16 @@ func TestWithdrawalWithdrawalV1Req(t *testing.T) { } -func TestWithdrawalGetWithdrawalQuotasReq(t *testing.T) { - // GetWithdrawalQuotas - // Get Withdrawal Quotas - // /api/v1/withdrawals/quotas +func TestWithdrawalGetWithdrawalHistoryReq(t *testing.T) { + // GetWithdrawalHistory + // Get Withdrawal History + // /api/v1/withdrawals - builder := withdrawal.NewGetWithdrawalQuotasReqBuilder() - builder.SetCurrency(?).SetChain(?) + builder := withdrawal.NewGetWithdrawalHistoryReqBuilder() + builder.SetCurrency(?).SetStatus(?).SetStartAt(?).SetEndAt(?).SetCurrentPage(?).SetPageSize(?) req := builder.Build() - resp, err := withdrawalApi.GetWithdrawalQuotas(req, context.TODO()) + resp, err := withdrawalApi.GetWithdrawalHistory(req, context.TODO()) if err != nil { panic(err) } @@ -93,16 +93,16 @@ func TestWithdrawalGetWithdrawalQuotasReq(t *testing.T) { } -func TestWithdrawalCancelWithdrawalReq(t *testing.T) { - // CancelWithdrawal - // Cancel Withdrawal - // /api/v1/withdrawals/{withdrawalId} +func TestWithdrawalGetWithdrawalHistoryOldReq(t *testing.T) { + // GetWithdrawalHistoryOld + // Get Withdrawal History - Old + // /api/v1/hist-withdrawals - builder := withdrawal.NewCancelWithdrawalReqBuilder() - builder.SetWithdrawalId(?) + builder := withdrawal.NewGetWithdrawalHistoryOldReqBuilder() + builder.SetCurrency(?).SetStatus(?).SetStartAt(?).SetEndAt(?).SetCurrentPage(?).SetPageSize(?) req := builder.Build() - resp, err := withdrawalApi.CancelWithdrawal(req, context.TODO()) + resp, err := withdrawalApi.GetWithdrawalHistoryOld(req, context.TODO()) if err != nil { panic(err) } @@ -116,16 +116,16 @@ func TestWithdrawalCancelWithdrawalReq(t *testing.T) { } -func TestWithdrawalWithdrawalV3Req(t *testing.T) { - // WithdrawalV3 - // Withdraw(V3) - // /api/v3/withdrawals +func TestWithdrawalWithdrawalV1Req(t *testing.T) { + // WithdrawalV1 + // Withdraw - V1 + // /api/v1/withdrawals - builder := withdrawal.NewWithdrawalV3ReqBuilder() - builder.SetCurrency(?).SetChain(?).SetAmount(?).SetMemo(?).SetIsInner(?).SetRemark(?).SetFeeDeductType(?).SetToAddress(?).SetWithdrawType(?) + builder := withdrawal.NewWithdrawalV1ReqBuilder() + builder.SetCurrency(?).SetChain(?).SetAddress(?).SetAmount(?).SetMemo(?).SetIsInner(?).SetRemark(?).SetFeeDeductType(?) req := builder.Build() - resp, err := withdrawalApi.WithdrawalV3(req, context.TODO()) + resp, err := withdrawalApi.WithdrawalV1(req, context.TODO()) if err != nil { panic(err) } diff --git a/sdk/golang/pkg/generate/account/withdrawal/api_withdrawal_test.go b/sdk/golang/pkg/generate/account/withdrawal/api_withdrawal_test.go index 5435009f..e6c3ea2d 100644 --- a/sdk/golang/pkg/generate/account/withdrawal/api_withdrawal_test.go +++ b/sdk/golang/pkg/generate/account/withdrawal/api_withdrawal_test.go @@ -7,169 +7,169 @@ import ( "testing" ) -func TestWithdrawalGetWithdrawalHistoryOldReqModel(t *testing.T) { - // GetWithdrawalHistoryOld - // Get Withdrawal History - Old - // /api/v1/hist-withdrawals +func TestWithdrawalGetWithdrawalQuotasReqModel(t *testing.T) { + // GetWithdrawalQuotas + // Get Withdrawal Quotas + // /api/v1/withdrawals/quotas - data := "{\"currency\": \"BTC\", \"status\": \"SUCCESS\", \"startAt\": 1728663338000, \"endAt\": 1728692138000, \"currentPage\": 1, \"pageSize\": 50}" - req := &GetWithdrawalHistoryOldReq{} + data := "{\"currency\": \"BTC\", \"chain\": \"eth\"}" + req := &GetWithdrawalQuotasReq{} err := json.Unmarshal([]byte(data), req) req.ToMap() assert.Nil(t, err) } -func TestWithdrawalGetWithdrawalHistoryOldRespModel(t *testing.T) { - // GetWithdrawalHistoryOld - // Get Withdrawal History - Old - // /api/v1/hist-withdrawals +func TestWithdrawalGetWithdrawalQuotasRespModel(t *testing.T) { + // GetWithdrawalQuotas + // Get Withdrawal Quotas + // /api/v1/withdrawals/quotas - data := "{\n \"code\": \"200000\",\n \"data\": {\n \"currentPage\": 1,\n \"pageSize\": 50,\n \"totalNum\": 1,\n \"totalPage\": 1,\n \"items\": [\n {\n \"currency\": \"BTC\",\n \"createAt\": 1526723468,\n \"amount\": \"0.534\",\n \"address\": \"33xW37ZSW4tQvg443Pc7NLCAs167Yc2XUV\",\n \"walletTxId\": \"aeacea864c020acf58e51606169240e96774838dcd4f7ce48acf38e3651323f4\",\n \"isInner\": false,\n \"status\": \"SUCCESS\"\n }\n ]\n }\n}" + data := "{\"code\":\"200000\",\"data\":{\"currency\":\"BTC\",\"limitBTCAmount\":\"15.79590095\",\"usedBTCAmount\":\"0.00000000\",\"quotaCurrency\":\"USDT\",\"limitQuotaCurrencyAmount\":\"999999.00000000\",\"usedQuotaCurrencyAmount\":\"0\",\"remainAmount\":\"15.79590095\",\"availableAmount\":\"0\",\"withdrawMinFee\":\"0.0005\",\"innerWithdrawMinFee\":\"0\",\"withdrawMinSize\":\"0.001\",\"isWithdrawEnabled\":true,\"precision\":8,\"chain\":\"BTC\",\"reason\":null,\"lockedAmount\":\"0\"}}" commonResp := &types.RestResponse{} err := json.Unmarshal([]byte(data), commonResp) assert.Nil(t, err) assert.NotNil(t, commonResp.Data) - resp := &GetWithdrawalHistoryOldResp{} + resp := &GetWithdrawalQuotasResp{} err = json.Unmarshal([]byte(commonResp.Data), resp) resp.ToMap() assert.Nil(t, err) } -func TestWithdrawalGetWithdrawalHistoryReqModel(t *testing.T) { - // GetWithdrawalHistory - // Get Withdrawal History - // /api/v1/withdrawals +func TestWithdrawalWithdrawalV3ReqModel(t *testing.T) { + // WithdrawalV3 + // Withdraw(V3) + // /api/v3/withdrawals - data := "{\"currency\": \"BTC\", \"status\": \"SUCCESS\", \"startAt\": 1728663338000, \"endAt\": 1728692138000, \"currentPage\": 1, \"pageSize\": 50}" - req := &GetWithdrawalHistoryReq{} + data := "{\"currency\": \"USDT\", \"toAddress\": \"TKFRQXSDcY****GmLrjJggwX8\", \"amount\": 3, \"withdrawType\": \"ADDRESS\", \"chain\": \"trx\", \"isInner\": true, \"remark\": \"this is Remark\"}" + req := &WithdrawalV3Req{} err := json.Unmarshal([]byte(data), req) req.ToMap() assert.Nil(t, err) } -func TestWithdrawalGetWithdrawalHistoryRespModel(t *testing.T) { - // GetWithdrawalHistory - // Get Withdrawal History - // /api/v1/withdrawals +func TestWithdrawalWithdrawalV3RespModel(t *testing.T) { + // WithdrawalV3 + // Withdraw(V3) + // /api/v3/withdrawals - data := "{\n \"code\": \"200000\",\n \"data\": {\n \"currentPage\": 1,\n \"pageSize\": 50,\n \"totalNum\": 5,\n \"totalPage\": 1,\n \"items\": [\n {\n \"currency\": \"USDT\",\n \"chain\": \"\",\n \"status\": \"SUCCESS\",\n \"address\": \"a435*****@gmail.com\",\n \"memo\": \"\",\n \"isInner\": true,\n \"amount\": \"1.00000000\",\n \"fee\": \"0.00000000\",\n \"walletTxId\": null,\n \"createdAt\": 1728555875000,\n \"updatedAt\": 1728555875000,\n \"remark\": \"\",\n \"arrears\": false\n },\n {\n \"currency\": \"USDT\",\n \"chain\": \"trx\",\n \"status\": \"SUCCESS\",\n \"address\": \"TSv3L1fS7******X4nLP6rqNxYz\",\n \"memo\": \"\",\n \"isInner\": true,\n \"amount\": \"6.00000000\",\n \"fee\": \"0.00000000\",\n \"walletTxId\": null,\n \"createdAt\": 1721730920000,\n \"updatedAt\": 1721730920000,\n \"remark\": \"\",\n \"arrears\": false\n }\n ]\n }\n}" + data := "{\"code\":\"200000\",\"data\":{\"withdrawalId\":\"670deec84d64da0007d7c946\"}}" commonResp := &types.RestResponse{} err := json.Unmarshal([]byte(data), commonResp) assert.Nil(t, err) assert.NotNil(t, commonResp.Data) - resp := &GetWithdrawalHistoryResp{} + resp := &WithdrawalV3Resp{} err = json.Unmarshal([]byte(commonResp.Data), resp) resp.ToMap() assert.Nil(t, err) } -func TestWithdrawalWithdrawalV1ReqModel(t *testing.T) { - // WithdrawalV1 - // Withdraw - V1 - // /api/v1/withdrawals +func TestWithdrawalCancelWithdrawalReqModel(t *testing.T) { + // CancelWithdrawal + // Cancel Withdrawal + // /api/v1/withdrawals/{withdrawalId} - data := "{\"currency\": \"USDT\", \"address\": \"TKFRQXSDc****16GmLrjJggwX8\", \"amount\": 3, \"chain\": \"trx\", \"isInner\": true}" - req := &WithdrawalV1Req{} + data := "{\"withdrawalId\": \"670b891f7e0f440007730692\"}" + req := &CancelWithdrawalReq{} err := json.Unmarshal([]byte(data), req) req.ToMap() assert.Nil(t, err) } -func TestWithdrawalWithdrawalV1RespModel(t *testing.T) { - // WithdrawalV1 - // Withdraw - V1 - // /api/v1/withdrawals +func TestWithdrawalCancelWithdrawalRespModel(t *testing.T) { + // CancelWithdrawal + // Cancel Withdrawal + // /api/v1/withdrawals/{withdrawalId} - data := "{\"code\":\"200000\",\"data\":{\"withdrawalId\":\"670a973cf07b3800070e216c\"}}" + data := "{\"code\":\"200000\",\"data\":null}" commonResp := &types.RestResponse{} err := json.Unmarshal([]byte(data), commonResp) assert.Nil(t, err) assert.NotNil(t, commonResp.Data) - resp := &WithdrawalV1Resp{} + resp := &CancelWithdrawalResp{} err = json.Unmarshal([]byte(commonResp.Data), resp) resp.ToMap() assert.Nil(t, err) } -func TestWithdrawalGetWithdrawalQuotasReqModel(t *testing.T) { - // GetWithdrawalQuotas - // Get Withdrawal Quotas - // /api/v1/withdrawals/quotas +func TestWithdrawalGetWithdrawalHistoryReqModel(t *testing.T) { + // GetWithdrawalHistory + // Get Withdrawal History + // /api/v1/withdrawals - data := "{\"currency\": \"BTC\", \"chain\": \"eth\"}" - req := &GetWithdrawalQuotasReq{} + data := "{\"currency\": \"BTC\", \"status\": \"SUCCESS\", \"startAt\": 1728663338000, \"endAt\": 1728692138000, \"currentPage\": 1, \"pageSize\": 50}" + req := &GetWithdrawalHistoryReq{} err := json.Unmarshal([]byte(data), req) req.ToMap() assert.Nil(t, err) } -func TestWithdrawalGetWithdrawalQuotasRespModel(t *testing.T) { - // GetWithdrawalQuotas - // Get Withdrawal Quotas - // /api/v1/withdrawals/quotas +func TestWithdrawalGetWithdrawalHistoryRespModel(t *testing.T) { + // GetWithdrawalHistory + // Get Withdrawal History + // /api/v1/withdrawals - data := "{\"code\":\"200000\",\"data\":{\"currency\":\"BTC\",\"limitBTCAmount\":\"15.79590095\",\"usedBTCAmount\":\"0.00000000\",\"quotaCurrency\":\"USDT\",\"limitQuotaCurrencyAmount\":\"999999.00000000\",\"usedQuotaCurrencyAmount\":\"0\",\"remainAmount\":\"15.79590095\",\"availableAmount\":\"0\",\"withdrawMinFee\":\"0.0005\",\"innerWithdrawMinFee\":\"0\",\"withdrawMinSize\":\"0.001\",\"isWithdrawEnabled\":true,\"precision\":8,\"chain\":\"BTC\",\"reason\":null,\"lockedAmount\":\"0\"}}" + data := "{\n \"code\": \"200000\",\n \"data\": {\n \"currentPage\": 1,\n \"pageSize\": 50,\n \"totalNum\": 5,\n \"totalPage\": 1,\n \"items\": [\n {\n \"currency\": \"USDT\",\n \"chain\": \"\",\n \"status\": \"SUCCESS\",\n \"address\": \"a435*****@gmail.com\",\n \"memo\": \"\",\n \"isInner\": true,\n \"amount\": \"1.00000000\",\n \"fee\": \"0.00000000\",\n \"walletTxId\": null,\n \"createdAt\": 1728555875000,\n \"updatedAt\": 1728555875000,\n \"remark\": \"\",\n \"arrears\": false\n },\n {\n \"currency\": \"USDT\",\n \"chain\": \"trx\",\n \"status\": \"SUCCESS\",\n \"address\": \"TSv3L1fS7******X4nLP6rqNxYz\",\n \"memo\": \"\",\n \"isInner\": true,\n \"amount\": \"6.00000000\",\n \"fee\": \"0.00000000\",\n \"walletTxId\": null,\n \"createdAt\": 1721730920000,\n \"updatedAt\": 1721730920000,\n \"remark\": \"\",\n \"arrears\": false\n }\n ]\n }\n}" commonResp := &types.RestResponse{} err := json.Unmarshal([]byte(data), commonResp) assert.Nil(t, err) assert.NotNil(t, commonResp.Data) - resp := &GetWithdrawalQuotasResp{} + resp := &GetWithdrawalHistoryResp{} err = json.Unmarshal([]byte(commonResp.Data), resp) resp.ToMap() assert.Nil(t, err) } -func TestWithdrawalCancelWithdrawalReqModel(t *testing.T) { - // CancelWithdrawal - // Cancel Withdrawal - // /api/v1/withdrawals/{withdrawalId} +func TestWithdrawalGetWithdrawalHistoryOldReqModel(t *testing.T) { + // GetWithdrawalHistoryOld + // Get Withdrawal History - Old + // /api/v1/hist-withdrawals - data := "{\"withdrawalId\": \"670b891f7e0f440007730692\"}" - req := &CancelWithdrawalReq{} + data := "{\"currency\": \"BTC\", \"status\": \"SUCCESS\", \"startAt\": 1728663338000, \"endAt\": 1728692138000, \"currentPage\": 1, \"pageSize\": 50}" + req := &GetWithdrawalHistoryOldReq{} err := json.Unmarshal([]byte(data), req) req.ToMap() assert.Nil(t, err) } -func TestWithdrawalCancelWithdrawalRespModel(t *testing.T) { - // CancelWithdrawal - // Cancel Withdrawal - // /api/v1/withdrawals/{withdrawalId} +func TestWithdrawalGetWithdrawalHistoryOldRespModel(t *testing.T) { + // GetWithdrawalHistoryOld + // Get Withdrawal History - Old + // /api/v1/hist-withdrawals - data := "{\"code\":\"200000\",\"data\":null}" + data := "{\n \"code\": \"200000\",\n \"data\": {\n \"currentPage\": 1,\n \"pageSize\": 50,\n \"totalNum\": 1,\n \"totalPage\": 1,\n \"items\": [\n {\n \"currency\": \"BTC\",\n \"createAt\": 1526723468,\n \"amount\": \"0.534\",\n \"address\": \"33xW37ZSW4tQvg443Pc7NLCAs167Yc2XUV\",\n \"walletTxId\": \"aeacea864c020acf58e51606169240e96774838dcd4f7ce48acf38e3651323f4\",\n \"isInner\": false,\n \"status\": \"SUCCESS\"\n }\n ]\n }\n}" commonResp := &types.RestResponse{} err := json.Unmarshal([]byte(data), commonResp) assert.Nil(t, err) assert.NotNil(t, commonResp.Data) - resp := &CancelWithdrawalResp{} + resp := &GetWithdrawalHistoryOldResp{} err = json.Unmarshal([]byte(commonResp.Data), resp) resp.ToMap() assert.Nil(t, err) } -func TestWithdrawalWithdrawalV3ReqModel(t *testing.T) { - // WithdrawalV3 - // Withdraw(V3) - // /api/v3/withdrawals +func TestWithdrawalWithdrawalV1ReqModel(t *testing.T) { + // WithdrawalV1 + // Withdraw - V1 + // /api/v1/withdrawals - data := "{\"currency\": \"USDT\", \"toAddress\": \"TKFRQXSDcY****GmLrjJggwX8\", \"amount\": 3, \"withdrawType\": \"ADDRESS\", \"chain\": \"trx\", \"isInner\": true, \"remark\": \"this is Remark\"}" - req := &WithdrawalV3Req{} + data := "{\"currency\": \"USDT\", \"address\": \"TKFRQXSDc****16GmLrjJggwX8\", \"amount\": 3, \"chain\": \"trx\", \"isInner\": true}" + req := &WithdrawalV1Req{} err := json.Unmarshal([]byte(data), req) req.ToMap() assert.Nil(t, err) } -func TestWithdrawalWithdrawalV3RespModel(t *testing.T) { - // WithdrawalV3 - // Withdraw(V3) - // /api/v3/withdrawals +func TestWithdrawalWithdrawalV1RespModel(t *testing.T) { + // WithdrawalV1 + // Withdraw - V1 + // /api/v1/withdrawals - data := "{\"code\":\"200000\",\"data\":{\"withdrawalId\":\"670deec84d64da0007d7c946\"}}" + data := "{\"code\":\"200000\",\"data\":{\"withdrawalId\":\"670a973cf07b3800070e216c\"}}" commonResp := &types.RestResponse{} err := json.Unmarshal([]byte(data), commonResp) assert.Nil(t, err) assert.NotNil(t, commonResp.Data) - resp := &WithdrawalV3Resp{} + resp := &WithdrawalV1Resp{} err = json.Unmarshal([]byte(commonResp.Data), resp) resp.ToMap() assert.Nil(t, err) diff --git a/sdk/golang/pkg/generate/broker/ndbroker/api_nd_broker.go b/sdk/golang/pkg/generate/broker/ndbroker/api_nd_broker.go index 0c6f2a9a..c41c2d91 100644 --- a/sdk/golang/pkg/generate/broker/ndbroker/api_nd_broker.go +++ b/sdk/golang/pkg/generate/broker/ndbroker/api_nd_broker.go @@ -9,9 +9,9 @@ import ( type NDBrokerAPI interface { - // GetDepositList Get Deposit List - // Description: This endpoint can obtain the deposit records of each sub-account under the ND Broker. - // Documentation: https://www.kucoin.com/docs-new/api-3470285 + // GetBrokerInfo Get Broker Info + // Description: This endpoint supports querying the basic information of the current Broker + // Documentation: https://www.kucoin.com/docs-new/api-3470282 // +---------------------+---------+ // | Extra API Info | Value | // +---------------------+---------+ @@ -19,13 +19,13 @@ type NDBrokerAPI interface { // | API-CHANNEL | PRIVATE | // | API-PERMISSION | GENERAL | // | API-RATE-LIMIT-POOL | BROKER | - // | API-RATE-LIMIT | 10 | + // | API-RATE-LIMIT | 2 | // +---------------------+---------+ - GetDepositList(req *GetDepositListReq, ctx context.Context) (*GetDepositListResp, error) + GetBrokerInfo(req *GetBrokerInfoReq, ctx context.Context) (*GetBrokerInfoResp, error) - // DeleteSubAccountAPI Delete SubAccount API - // Description: This interface supports deleting Broker’s sub-account APIKEY - // Documentation: https://www.kucoin.com/docs-new/api-3470289 + // AddSubAccount Add SubAccount + // Description: This endpoint supports Broker users to create sub-accounts + // Documentation: https://www.kucoin.com/docs-new/api-3470290 // +---------------------+---------+ // | Extra API Info | Value | // +---------------------+---------+ @@ -35,11 +35,11 @@ type NDBrokerAPI interface { // | API-RATE-LIMIT-POOL | BROKER | // | API-RATE-LIMIT | 3 | // +---------------------+---------+ - DeleteSubAccountAPI(req *DeleteSubAccountAPIReq, ctx context.Context) (*DeleteSubAccountAPIResp, error) + AddSubAccount(req *AddSubAccountReq, ctx context.Context) (*AddSubAccountResp, error) - // GetSubAccountAPI Get SubAccount API - // Description: This interface supports querying the Broker’s sub-account APIKEY - // Documentation: https://www.kucoin.com/docs-new/api-3470284 + // GetSubAccount Get SubAccount + // Description: This interface supports querying sub-accounts created by Broker + // Documentation: https://www.kucoin.com/docs-new/api-3470283 // +---------------------+---------+ // | Extra API Info | Value | // +---------------------+---------+ @@ -49,7 +49,7 @@ type NDBrokerAPI interface { // | API-RATE-LIMIT-POOL | BROKER | // | API-RATE-LIMIT | 2 | // +---------------------+---------+ - GetSubAccountAPI(req *GetSubAccountAPIReq, ctx context.Context) (*GetSubAccountAPIResp, error) + GetSubAccount(req *GetSubAccountReq, ctx context.Context) (*GetSubAccountResp, error) // AddSubAccountApi Add SubAccount API // Description: This interface supports the creation of Broker sub-account APIKEY @@ -65,9 +65,9 @@ type NDBrokerAPI interface { // +---------------------+---------+ AddSubAccountApi(req *AddSubAccountApiReq, ctx context.Context) (*AddSubAccountApiResp, error) - // GetSubAccount Get SubAccount - // Description: This interface supports querying sub-accounts created by Broker - // Documentation: https://www.kucoin.com/docs-new/api-3470283 + // GetSubAccountAPI Get SubAccount API + // Description: This interface supports querying the Broker’s sub-account APIKEY + // Documentation: https://www.kucoin.com/docs-new/api-3470284 // +---------------------+---------+ // | Extra API Info | Value | // +---------------------+---------+ @@ -77,11 +77,11 @@ type NDBrokerAPI interface { // | API-RATE-LIMIT-POOL | BROKER | // | API-RATE-LIMIT | 2 | // +---------------------+---------+ - GetSubAccount(req *GetSubAccountReq, ctx context.Context) (*GetSubAccountResp, error) + GetSubAccountAPI(req *GetSubAccountAPIReq, ctx context.Context) (*GetSubAccountAPIResp, error) - // AddSubAccount Add SubAccount - // Description: This endpoint supports Broker users to create sub-accounts - // Documentation: https://www.kucoin.com/docs-new/api-3470290 + // ModifySubAccountApi Modify SubAccount API + // Description: This interface supports modify the Broker’s sub-account APIKEY + // Documentation: https://www.kucoin.com/docs-new/api-3470292 // +---------------------+---------+ // | Extra API Info | Value | // +---------------------+---------+ @@ -91,11 +91,11 @@ type NDBrokerAPI interface { // | API-RATE-LIMIT-POOL | BROKER | // | API-RATE-LIMIT | 3 | // +---------------------+---------+ - AddSubAccount(req *AddSubAccountReq, ctx context.Context) (*AddSubAccountResp, error) + ModifySubAccountApi(req *ModifySubAccountApiReq, ctx context.Context) (*ModifySubAccountApiResp, error) - // ModifySubAccountApi Modify SubAccount API - // Description: This interface supports modify the Broker’s sub-account APIKEY - // Documentation: https://www.kucoin.com/docs-new/api-3470292 + // DeleteSubAccountAPI Delete SubAccount API + // Description: This interface supports deleting Broker’s sub-account APIKEY + // Documentation: https://www.kucoin.com/docs-new/api-3470289 // +---------------------+---------+ // | Extra API Info | Value | // +---------------------+---------+ @@ -105,11 +105,11 @@ type NDBrokerAPI interface { // | API-RATE-LIMIT-POOL | BROKER | // | API-RATE-LIMIT | 3 | // +---------------------+---------+ - ModifySubAccountApi(req *ModifySubAccountApiReq, ctx context.Context) (*ModifySubAccountApiResp, error) + DeleteSubAccountAPI(req *DeleteSubAccountAPIReq, ctx context.Context) (*DeleteSubAccountAPIResp, error) - // GetBrokerInfo Get Broker Info - // Description: This endpoint supports querying the basic information of the current Broker - // Documentation: https://www.kucoin.com/docs-new/api-3470282 + // Transfer Transfer + // Description: This endpoint supports fund transfer between Broker account and Broker sub-accounts. Please be aware that withdrawal from sub-account is not directly supported. Broker has to transfer funds from broker sub-account to broker account to initiate the withdrawals. + // Documentation: https://www.kucoin.com/docs-new/api-3470293 // +---------------------+---------+ // | Extra API Info | Value | // +---------------------+---------+ @@ -117,13 +117,13 @@ type NDBrokerAPI interface { // | API-CHANNEL | PRIVATE | // | API-PERMISSION | GENERAL | // | API-RATE-LIMIT-POOL | BROKER | - // | API-RATE-LIMIT | 2 | + // | API-RATE-LIMIT | 1 | // +---------------------+---------+ - GetBrokerInfo(req *GetBrokerInfoReq, ctx context.Context) (*GetBrokerInfoResp, error) + Transfer(req *TransferReq, ctx context.Context) (*TransferResp, error) - // GetRebase Get Broker Rebate - // Description: This interface supports downloading Broker rebate orders - // Documentation: https://www.kucoin.com/docs-new/api-3470281 + // GetTransferHistory Get Transfer History + // Description: This endpoint supports querying transfer records of the broker itself and its created sub-accounts. + // Documentation: https://www.kucoin.com/docs-new/api-3470286 // +---------------------+---------+ // | Extra API Info | Value | // +---------------------+---------+ @@ -131,13 +131,13 @@ type NDBrokerAPI interface { // | API-CHANNEL | PRIVATE | // | API-PERMISSION | GENERAL | // | API-RATE-LIMIT-POOL | BROKER | - // | API-RATE-LIMIT | 3 | + // | API-RATE-LIMIT | 1 | // +---------------------+---------+ - GetRebase(req *GetRebaseReq, ctx context.Context) (*GetRebaseResp, error) + GetTransferHistory(req *GetTransferHistoryReq, ctx context.Context) (*GetTransferHistoryResp, error) - // Transfer Transfer - // Description: This endpoint supports fund transfer between Broker account and Broker sub-accounts. Please be aware that withdrawal from sub-account is not directly supported. Broker has to transfer funds from broker sub-account to broker account to initiate the withdrawals. - // Documentation: https://www.kucoin.com/docs-new/api-3470293 + // GetDepositList Get Deposit List + // Description: This endpoint can obtain the deposit records of each sub-account under the ND Broker. + // Documentation: https://www.kucoin.com/docs-new/api-3470285 // +---------------------+---------+ // | Extra API Info | Value | // +---------------------+---------+ @@ -145,9 +145,9 @@ type NDBrokerAPI interface { // | API-CHANNEL | PRIVATE | // | API-PERMISSION | GENERAL | // | API-RATE-LIMIT-POOL | BROKER | - // | API-RATE-LIMIT | 1 | + // | API-RATE-LIMIT | 10 | // +---------------------+---------+ - Transfer(req *TransferReq, ctx context.Context) (*TransferResp, error) + GetDepositList(req *GetDepositListReq, ctx context.Context) (*GetDepositListResp, error) // GetDepositDetail Get Deposit Detail // Description: This endpoint supports querying the deposit record of sub-accounts created by a Broker (excluding main account of nd broker) @@ -163,9 +163,9 @@ type NDBrokerAPI interface { // +---------------------+---------+ GetDepositDetail(req *GetDepositDetailReq, ctx context.Context) (*GetDepositDetailResp, error) - // GetTransferHistory Get Transfer History - // Description: This endpoint supports querying transfer records of the broker itself and its created sub-accounts. - // Documentation: https://www.kucoin.com/docs-new/api-3470286 + // GetWithdrawDetail Get Withdraw Detail + // Description: This endpoint supports querying the withdrawal records of sub-accounts created by a Broker (excluding main account of nd broker). + // Documentation: https://www.kucoin.com/docs-new/api-3470287 // +---------------------+---------+ // | Extra API Info | Value | // +---------------------+---------+ @@ -175,11 +175,11 @@ type NDBrokerAPI interface { // | API-RATE-LIMIT-POOL | BROKER | // | API-RATE-LIMIT | 1 | // +---------------------+---------+ - GetTransferHistory(req *GetTransferHistoryReq, ctx context.Context) (*GetTransferHistoryResp, error) + GetWithdrawDetail(req *GetWithdrawDetailReq, ctx context.Context) (*GetWithdrawDetailResp, error) - // GetWithdrawDetail Get Withdraw Detail - // Description: This endpoint supports querying the withdrawal records of sub-accounts created by a Broker (excluding main account of nd broker). - // Documentation: https://www.kucoin.com/docs-new/api-3470287 + // GetRebase Get Broker Rebate + // Description: This interface supports downloading Broker rebate orders + // Documentation: https://www.kucoin.com/docs-new/api-3470281 // +---------------------+---------+ // | Extra API Info | Value | // +---------------------+---------+ @@ -187,9 +187,9 @@ type NDBrokerAPI interface { // | API-CHANNEL | PRIVATE | // | API-PERMISSION | GENERAL | // | API-RATE-LIMIT-POOL | BROKER | - // | API-RATE-LIMIT | 1 | + // | API-RATE-LIMIT | 3 | // +---------------------+---------+ - GetWithdrawDetail(req *GetWithdrawDetailReq, ctx context.Context) (*GetWithdrawDetailResp, error) + GetRebase(req *GetRebaseReq, ctx context.Context) (*GetRebaseResp, error) } type NDBrokerAPIImpl struct { @@ -200,21 +200,21 @@ func NewNDBrokerAPIImp(transport interfaces.Transport) *NDBrokerAPIImpl { return &NDBrokerAPIImpl{transport: transport} } -func (impl *NDBrokerAPIImpl) GetDepositList(req *GetDepositListReq, ctx context.Context) (*GetDepositListResp, error) { - resp := &GetDepositListResp{} - err := impl.transport.Call(ctx, "broker", true, "Get", "/api/v1/asset/ndbroker/deposit/list", req, resp, false) +func (impl *NDBrokerAPIImpl) GetBrokerInfo(req *GetBrokerInfoReq, ctx context.Context) (*GetBrokerInfoResp, error) { + resp := &GetBrokerInfoResp{} + err := impl.transport.Call(ctx, "broker", true, "Get", "/api/v1/broker/nd/info", req, resp, false) return resp, err } -func (impl *NDBrokerAPIImpl) DeleteSubAccountAPI(req *DeleteSubAccountAPIReq, ctx context.Context) (*DeleteSubAccountAPIResp, error) { - resp := &DeleteSubAccountAPIResp{} - err := impl.transport.Call(ctx, "broker", true, "Delete", "/api/v1/broker/nd/account/apikey", req, resp, false) +func (impl *NDBrokerAPIImpl) AddSubAccount(req *AddSubAccountReq, ctx context.Context) (*AddSubAccountResp, error) { + resp := &AddSubAccountResp{} + err := impl.transport.Call(ctx, "broker", true, "Post", "/api/v1/broker/nd/account", req, resp, false) return resp, err } -func (impl *NDBrokerAPIImpl) GetSubAccountAPI(req *GetSubAccountAPIReq, ctx context.Context) (*GetSubAccountAPIResp, error) { - resp := &GetSubAccountAPIResp{} - err := impl.transport.Call(ctx, "broker", true, "Get", "/api/v1/broker/nd/account/apikey", req, resp, false) +func (impl *NDBrokerAPIImpl) GetSubAccount(req *GetSubAccountReq, ctx context.Context) (*GetSubAccountResp, error) { + resp := &GetSubAccountResp{} + err := impl.transport.Call(ctx, "broker", true, "Get", "/api/v1/broker/nd/account", req, resp, false) return resp, err } @@ -224,15 +224,9 @@ func (impl *NDBrokerAPIImpl) AddSubAccountApi(req *AddSubAccountApiReq, ctx cont return resp, err } -func (impl *NDBrokerAPIImpl) GetSubAccount(req *GetSubAccountReq, ctx context.Context) (*GetSubAccountResp, error) { - resp := &GetSubAccountResp{} - err := impl.transport.Call(ctx, "broker", true, "Get", "/api/v1/broker/nd/account", req, resp, false) - return resp, err -} - -func (impl *NDBrokerAPIImpl) AddSubAccount(req *AddSubAccountReq, ctx context.Context) (*AddSubAccountResp, error) { - resp := &AddSubAccountResp{} - err := impl.transport.Call(ctx, "broker", true, "Post", "/api/v1/broker/nd/account", req, resp, false) +func (impl *NDBrokerAPIImpl) GetSubAccountAPI(req *GetSubAccountAPIReq, ctx context.Context) (*GetSubAccountAPIResp, error) { + resp := &GetSubAccountAPIResp{} + err := impl.transport.Call(ctx, "broker", true, "Get", "/api/v1/broker/nd/account/apikey", req, resp, false) return resp, err } @@ -242,15 +236,9 @@ func (impl *NDBrokerAPIImpl) ModifySubAccountApi(req *ModifySubAccountApiReq, ct return resp, err } -func (impl *NDBrokerAPIImpl) GetBrokerInfo(req *GetBrokerInfoReq, ctx context.Context) (*GetBrokerInfoResp, error) { - resp := &GetBrokerInfoResp{} - err := impl.transport.Call(ctx, "broker", true, "Get", "/api/v1/broker/nd/info", req, resp, false) - return resp, err -} - -func (impl *NDBrokerAPIImpl) GetRebase(req *GetRebaseReq, ctx context.Context) (*GetRebaseResp, error) { - resp := &GetRebaseResp{} - err := impl.transport.Call(ctx, "broker", true, "Get", "/api/v1/broker/nd/rebase/download", req, resp, false) +func (impl *NDBrokerAPIImpl) DeleteSubAccountAPI(req *DeleteSubAccountAPIReq, ctx context.Context) (*DeleteSubAccountAPIResp, error) { + resp := &DeleteSubAccountAPIResp{} + err := impl.transport.Call(ctx, "broker", true, "Delete", "/api/v1/broker/nd/account/apikey", req, resp, false) return resp, err } @@ -260,20 +248,32 @@ func (impl *NDBrokerAPIImpl) Transfer(req *TransferReq, ctx context.Context) (*T return resp, err } -func (impl *NDBrokerAPIImpl) GetDepositDetail(req *GetDepositDetailReq, ctx context.Context) (*GetDepositDetailResp, error) { - resp := &GetDepositDetailResp{} - err := impl.transport.Call(ctx, "broker", true, "Get", "/api/v3/broker/nd/deposit/detail", req, resp, false) - return resp, err -} - func (impl *NDBrokerAPIImpl) GetTransferHistory(req *GetTransferHistoryReq, ctx context.Context) (*GetTransferHistoryResp, error) { resp := &GetTransferHistoryResp{} err := impl.transport.Call(ctx, "broker", true, "Get", "/api/v3/broker/nd/transfer/detail", req, resp, false) return resp, err } +func (impl *NDBrokerAPIImpl) GetDepositList(req *GetDepositListReq, ctx context.Context) (*GetDepositListResp, error) { + resp := &GetDepositListResp{} + err := impl.transport.Call(ctx, "broker", true, "Get", "/api/v1/asset/ndbroker/deposit/list", req, resp, false) + return resp, err +} + +func (impl *NDBrokerAPIImpl) GetDepositDetail(req *GetDepositDetailReq, ctx context.Context) (*GetDepositDetailResp, error) { + resp := &GetDepositDetailResp{} + err := impl.transport.Call(ctx, "broker", true, "Get", "/api/v3/broker/nd/deposit/detail", req, resp, false) + return resp, err +} + func (impl *NDBrokerAPIImpl) GetWithdrawDetail(req *GetWithdrawDetailReq, ctx context.Context) (*GetWithdrawDetailResp, error) { resp := &GetWithdrawDetailResp{} err := impl.transport.Call(ctx, "broker", true, "Get", "/api/v3/broker/nd/withdraw/detail", req, resp, false) return resp, err } + +func (impl *NDBrokerAPIImpl) GetRebase(req *GetRebaseReq, ctx context.Context) (*GetRebaseResp, error) { + resp := &GetRebaseResp{} + err := impl.transport.Call(ctx, "broker", true, "Get", "/api/v1/broker/nd/rebase/download", req, resp, false) + return resp, err +} diff --git a/sdk/golang/pkg/generate/broker/ndbroker/api_nd_broker.template b/sdk/golang/pkg/generate/broker/ndbroker/api_nd_broker.template index a2e0bd0c..022234d3 100644 --- a/sdk/golang/pkg/generate/broker/ndbroker/api_nd_broker.template +++ b/sdk/golang/pkg/generate/broker/ndbroker/api_nd_broker.template @@ -1,16 +1,16 @@ # API FUNCTION TEMPLATE -func TestNDBrokerGetDepositListReq(t *testing.T) { - // GetDepositList - // Get Deposit List - // /api/v1/asset/ndbroker/deposit/list +func TestNDBrokerGetBrokerInfoReq(t *testing.T) { + // GetBrokerInfo + // Get Broker Info + // /api/v1/broker/nd/info - builder := ndbroker.NewGetDepositListReqBuilder() - builder.SetCurrency(?).SetStatus(?).SetHash(?).SetStartTimestamp(?).SetEndTimestamp(?).SetLimit(?) + builder := ndbroker.NewGetBrokerInfoReqBuilder() + builder.SetBegin(?).SetEnd(?).SetTradeType(?) req := builder.Build() - resp, err := ndbrokerApi.GetDepositList(req, context.TODO()) + resp, err := ndbrokerApi.GetBrokerInfo(req, context.TODO()) if err != nil { panic(err) } @@ -24,16 +24,16 @@ func TestNDBrokerGetDepositListReq(t *testing.T) { } -func TestNDBrokerDeleteSubAccountAPIReq(t *testing.T) { - // DeleteSubAccountAPI - // Delete SubAccount API - // /api/v1/broker/nd/account/apikey +func TestNDBrokerAddSubAccountReq(t *testing.T) { + // AddSubAccount + // Add SubAccount + // /api/v1/broker/nd/account - builder := ndbroker.NewDeleteSubAccountAPIReqBuilder() - builder.SetUid(?).SetApiKey(?) + builder := ndbroker.NewAddSubAccountReqBuilder() + builder.SetAccountName(?) req := builder.Build() - resp, err := ndbrokerApi.DeleteSubAccountAPI(req, context.TODO()) + resp, err := ndbrokerApi.AddSubAccount(req, context.TODO()) if err != nil { panic(err) } @@ -47,16 +47,16 @@ func TestNDBrokerDeleteSubAccountAPIReq(t *testing.T) { } -func TestNDBrokerGetSubAccountAPIReq(t *testing.T) { - // GetSubAccountAPI - // Get SubAccount API - // /api/v1/broker/nd/account/apikey +func TestNDBrokerGetSubAccountReq(t *testing.T) { + // GetSubAccount + // Get SubAccount + // /api/v1/broker/nd/account - builder := ndbroker.NewGetSubAccountAPIReqBuilder() - builder.SetUid(?).SetApiKey(?) + builder := ndbroker.NewGetSubAccountReqBuilder() + builder.SetUid(?).SetCurrentPage(?).SetPageSize(?) req := builder.Build() - resp, err := ndbrokerApi.GetSubAccountAPI(req, context.TODO()) + resp, err := ndbrokerApi.GetSubAccount(req, context.TODO()) if err != nil { panic(err) } @@ -93,16 +93,16 @@ func TestNDBrokerAddSubAccountApiReq(t *testing.T) { } -func TestNDBrokerGetSubAccountReq(t *testing.T) { - // GetSubAccount - // Get SubAccount - // /api/v1/broker/nd/account +func TestNDBrokerGetSubAccountAPIReq(t *testing.T) { + // GetSubAccountAPI + // Get SubAccount API + // /api/v1/broker/nd/account/apikey - builder := ndbroker.NewGetSubAccountReqBuilder() - builder.SetUid(?).SetCurrentPage(?).SetPageSize(?) + builder := ndbroker.NewGetSubAccountAPIReqBuilder() + builder.SetUid(?).SetApiKey(?) req := builder.Build() - resp, err := ndbrokerApi.GetSubAccount(req, context.TODO()) + resp, err := ndbrokerApi.GetSubAccountAPI(req, context.TODO()) if err != nil { panic(err) } @@ -116,16 +116,16 @@ func TestNDBrokerGetSubAccountReq(t *testing.T) { } -func TestNDBrokerAddSubAccountReq(t *testing.T) { - // AddSubAccount - // Add SubAccount - // /api/v1/broker/nd/account +func TestNDBrokerModifySubAccountApiReq(t *testing.T) { + // ModifySubAccountApi + // Modify SubAccount API + // /api/v1/broker/nd/account/update-apikey - builder := ndbroker.NewAddSubAccountReqBuilder() - builder.SetAccountName(?) + builder := ndbroker.NewModifySubAccountApiReqBuilder() + builder.SetUid(?).SetIpWhitelist(?).SetPermissions(?).SetLabel(?).SetApiKey(?) req := builder.Build() - resp, err := ndbrokerApi.AddSubAccount(req, context.TODO()) + resp, err := ndbrokerApi.ModifySubAccountApi(req, context.TODO()) if err != nil { panic(err) } @@ -139,16 +139,16 @@ func TestNDBrokerAddSubAccountReq(t *testing.T) { } -func TestNDBrokerModifySubAccountApiReq(t *testing.T) { - // ModifySubAccountApi - // Modify SubAccount API - // /api/v1/broker/nd/account/update-apikey +func TestNDBrokerDeleteSubAccountAPIReq(t *testing.T) { + // DeleteSubAccountAPI + // Delete SubAccount API + // /api/v1/broker/nd/account/apikey - builder := ndbroker.NewModifySubAccountApiReqBuilder() - builder.SetUid(?).SetIpWhitelist(?).SetPermissions(?).SetLabel(?).SetApiKey(?) + builder := ndbroker.NewDeleteSubAccountAPIReqBuilder() + builder.SetUid(?).SetApiKey(?) req := builder.Build() - resp, err := ndbrokerApi.ModifySubAccountApi(req, context.TODO()) + resp, err := ndbrokerApi.DeleteSubAccountAPI(req, context.TODO()) if err != nil { panic(err) } @@ -162,16 +162,16 @@ func TestNDBrokerModifySubAccountApiReq(t *testing.T) { } -func TestNDBrokerGetBrokerInfoReq(t *testing.T) { - // GetBrokerInfo - // Get Broker Info - // /api/v1/broker/nd/info +func TestNDBrokerTransferReq(t *testing.T) { + // Transfer + // Transfer + // /api/v1/broker/nd/transfer - builder := ndbroker.NewGetBrokerInfoReqBuilder() - builder.SetBegin(?).SetEnd(?).SetTradeType(?) + builder := ndbroker.NewTransferReqBuilder() + builder.SetCurrency(?).SetAmount(?).SetDirection(?).SetAccountType(?).SetSpecialUid(?).SetSpecialAccountType(?).SetClientOid(?) req := builder.Build() - resp, err := ndbrokerApi.GetBrokerInfo(req, context.TODO()) + resp, err := ndbrokerApi.Transfer(req, context.TODO()) if err != nil { panic(err) } @@ -185,16 +185,16 @@ func TestNDBrokerGetBrokerInfoReq(t *testing.T) { } -func TestNDBrokerGetRebaseReq(t *testing.T) { - // GetRebase - // Get Broker Rebate - // /api/v1/broker/nd/rebase/download +func TestNDBrokerGetTransferHistoryReq(t *testing.T) { + // GetTransferHistory + // Get Transfer History + // /api/v3/broker/nd/transfer/detail - builder := ndbroker.NewGetRebaseReqBuilder() - builder.SetBegin(?).SetEnd(?).SetTradeType(?) + builder := ndbroker.NewGetTransferHistoryReqBuilder() + builder.SetOrderId(?) req := builder.Build() - resp, err := ndbrokerApi.GetRebase(req, context.TODO()) + resp, err := ndbrokerApi.GetTransferHistory(req, context.TODO()) if err != nil { panic(err) } @@ -208,16 +208,16 @@ func TestNDBrokerGetRebaseReq(t *testing.T) { } -func TestNDBrokerTransferReq(t *testing.T) { - // Transfer - // Transfer - // /api/v1/broker/nd/transfer +func TestNDBrokerGetDepositListReq(t *testing.T) { + // GetDepositList + // Get Deposit List + // /api/v1/asset/ndbroker/deposit/list - builder := ndbroker.NewTransferReqBuilder() - builder.SetCurrency(?).SetAmount(?).SetDirection(?).SetAccountType(?).SetSpecialUid(?).SetSpecialAccountType(?).SetClientOid(?) + builder := ndbroker.NewGetDepositListReqBuilder() + builder.SetCurrency(?).SetStatus(?).SetHash(?).SetStartTimestamp(?).SetEndTimestamp(?).SetLimit(?) req := builder.Build() - resp, err := ndbrokerApi.Transfer(req, context.TODO()) + resp, err := ndbrokerApi.GetDepositList(req, context.TODO()) if err != nil { panic(err) } @@ -254,16 +254,16 @@ func TestNDBrokerGetDepositDetailReq(t *testing.T) { } -func TestNDBrokerGetTransferHistoryReq(t *testing.T) { - // GetTransferHistory - // Get Transfer History - // /api/v3/broker/nd/transfer/detail +func TestNDBrokerGetWithdrawDetailReq(t *testing.T) { + // GetWithdrawDetail + // Get Withdraw Detail + // /api/v3/broker/nd/withdraw/detail - builder := ndbroker.NewGetTransferHistoryReqBuilder() - builder.SetOrderId(?) + builder := ndbroker.NewGetWithdrawDetailReqBuilder() + builder.SetWithdrawalId(?) req := builder.Build() - resp, err := ndbrokerApi.GetTransferHistory(req, context.TODO()) + resp, err := ndbrokerApi.GetWithdrawDetail(req, context.TODO()) if err != nil { panic(err) } @@ -277,16 +277,16 @@ func TestNDBrokerGetTransferHistoryReq(t *testing.T) { } -func TestNDBrokerGetWithdrawDetailReq(t *testing.T) { - // GetWithdrawDetail - // Get Withdraw Detail - // /api/v3/broker/nd/withdraw/detail +func TestNDBrokerGetRebaseReq(t *testing.T) { + // GetRebase + // Get Broker Rebate + // /api/v1/broker/nd/rebase/download - builder := ndbroker.NewGetWithdrawDetailReqBuilder() - builder.SetWithdrawalId(?) + builder := ndbroker.NewGetRebaseReqBuilder() + builder.SetBegin(?).SetEnd(?).SetTradeType(?) req := builder.Build() - resp, err := ndbrokerApi.GetWithdrawDetail(req, context.TODO()) + resp, err := ndbrokerApi.GetRebase(req, context.TODO()) if err != nil { panic(err) } diff --git a/sdk/golang/pkg/generate/broker/ndbroker/api_nd_broker_test.go b/sdk/golang/pkg/generate/broker/ndbroker/api_nd_broker_test.go index 76579ee9..5c574a55 100644 --- a/sdk/golang/pkg/generate/broker/ndbroker/api_nd_broker_test.go +++ b/sdk/golang/pkg/generate/broker/ndbroker/api_nd_broker_test.go @@ -7,85 +7,85 @@ import ( "testing" ) -func TestNDBrokerGetDepositListReqModel(t *testing.T) { - // GetDepositList - // Get Deposit List - // /api/v1/asset/ndbroker/deposit/list +func TestNDBrokerGetBrokerInfoReqModel(t *testing.T) { + // GetBrokerInfo + // Get Broker Info + // /api/v1/broker/nd/info - data := "{\"currency\": \"USDT\", \"status\": \"SUCCESS\", \"hash\": \"example_string_default_value\", \"startTimestamp\": 123456, \"endTimestamp\": 123456, \"limit\": 100}" - req := &GetDepositListReq{} + data := "{\"begin\": \"20240510\", \"end\": \"20241010\", \"tradeType\": \"1\"}" + req := &GetBrokerInfoReq{} err := json.Unmarshal([]byte(data), req) req.ToMap() assert.Nil(t, err) } -func TestNDBrokerGetDepositListRespModel(t *testing.T) { - // GetDepositList - // Get Deposit List - // /api/v1/asset/ndbroker/deposit/list +func TestNDBrokerGetBrokerInfoRespModel(t *testing.T) { + // GetBrokerInfo + // Get Broker Info + // /api/v1/broker/nd/info - data := "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"uid\": 165111215,\n \"hash\": \"6724e363a492800007ec602b\",\n \"address\": \"xxxxxxx@gmail.com\",\n \"memo\": \"\",\n \"amount\": \"3.0\",\n \"fee\": \"0.0\",\n \"currency\": \"USDT\",\n \"isInner\": true,\n \"walletTxId\": \"bbbbbbbbb\",\n \"status\": \"SUCCESS\",\n \"chain\": \"\",\n \"remark\": \"\",\n \"createdAt\": 1730470760000,\n \"updatedAt\": 1730470760000\n }\n ]\n}" + data := "{\n \"code\": \"200000\",\n \"data\": {\n \"accountSize\": 0,\n \"maxAccountSize\": null,\n \"level\": 0\n }\n}" commonResp := &types.RestResponse{} err := json.Unmarshal([]byte(data), commonResp) assert.Nil(t, err) assert.NotNil(t, commonResp.Data) - resp := &GetDepositListResp{} + resp := &GetBrokerInfoResp{} err = json.Unmarshal([]byte(commonResp.Data), resp) resp.ToMap() assert.Nil(t, err) } -func TestNDBrokerDeleteSubAccountAPIReqModel(t *testing.T) { - // DeleteSubAccountAPI - // Delete SubAccount API - // /api/v1/broker/nd/account/apikey +func TestNDBrokerAddSubAccountReqModel(t *testing.T) { + // AddSubAccount + // Add SubAccount + // /api/v1/broker/nd/account - data := "{\"uid\": \"226383154\", \"apiKey\": \"671afb36cee20f00015cfaf1\"}" - req := &DeleteSubAccountAPIReq{} + data := "{\"accountName\": \"Account1\"}" + req := &AddSubAccountReq{} err := json.Unmarshal([]byte(data), req) req.ToMap() assert.Nil(t, err) } -func TestNDBrokerDeleteSubAccountAPIRespModel(t *testing.T) { - // DeleteSubAccountAPI - // Delete SubAccount API - // /api/v1/broker/nd/account/apikey +func TestNDBrokerAddSubAccountRespModel(t *testing.T) { + // AddSubAccount + // Add SubAccount + // /api/v1/broker/nd/account - data := "{\n \"code\": \"200000\",\n \"data\": true\n}" + data := "{\n \"code\": \"200000\",\n \"data\": {\n \"accountName\": \"Account15\",\n \"uid\": \"226383154\",\n \"createdAt\": 1729819381908,\n \"level\": 0\n }\n}" commonResp := &types.RestResponse{} err := json.Unmarshal([]byte(data), commonResp) assert.Nil(t, err) assert.NotNil(t, commonResp.Data) - resp := &DeleteSubAccountAPIResp{} + resp := &AddSubAccountResp{} err = json.Unmarshal([]byte(commonResp.Data), resp) resp.ToMap() assert.Nil(t, err) } -func TestNDBrokerGetSubAccountAPIReqModel(t *testing.T) { - // GetSubAccountAPI - // Get SubAccount API - // /api/v1/broker/nd/account/apikey +func TestNDBrokerGetSubAccountReqModel(t *testing.T) { + // GetSubAccount + // Get SubAccount + // /api/v1/broker/nd/account - data := "{\"uid\": \"226383154\", \"apiKey\": \"671afb36cee20f00015cfaf1\"}" - req := &GetSubAccountAPIReq{} + data := "{\"uid\": \"226383154\", \"currentPage\": 1, \"pageSize\": 20}" + req := &GetSubAccountReq{} err := json.Unmarshal([]byte(data), req) req.ToMap() assert.Nil(t, err) } -func TestNDBrokerGetSubAccountAPIRespModel(t *testing.T) { - // GetSubAccountAPI - // Get SubAccount API - // /api/v1/broker/nd/account/apikey +func TestNDBrokerGetSubAccountRespModel(t *testing.T) { + // GetSubAccount + // Get SubAccount + // /api/v1/broker/nd/account - data := "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"uid\": \"226383154\",\n \"label\": \"This is remarks\",\n \"apiKey\": \"671afb36cee20f00015cfaf1\",\n \"apiVersion\": 3,\n \"permissions\": [\n \"General\",\n \"Spot\"\n ],\n \"ipWhitelist\": [\n \"127.**.1\",\n \"203.**.154\"\n ],\n \"createdAt\": 1729821494000\n }\n ]\n}" + data := "{\n \"code\": \"200000\",\n \"data\": {\n \"currentPage\": 1,\n \"pageSize\": 20,\n \"totalNum\": 1,\n \"totalPage\": 1,\n \"items\": [\n {\n \"accountName\": \"Account15\",\n \"uid\": \"226383154\",\n \"createdAt\": 1729819382000,\n \"level\": 0\n }\n ]\n }\n}" commonResp := &types.RestResponse{} err := json.Unmarshal([]byte(data), commonResp) assert.Nil(t, err) assert.NotNil(t, commonResp.Data) - resp := &GetSubAccountAPIResp{} + resp := &GetSubAccountResp{} err = json.Unmarshal([]byte(commonResp.Data), resp) resp.ToMap() assert.Nil(t, err) @@ -119,169 +119,169 @@ func TestNDBrokerAddSubAccountApiRespModel(t *testing.T) { assert.Nil(t, err) } -func TestNDBrokerGetSubAccountReqModel(t *testing.T) { - // GetSubAccount - // Get SubAccount - // /api/v1/broker/nd/account +func TestNDBrokerGetSubAccountAPIReqModel(t *testing.T) { + // GetSubAccountAPI + // Get SubAccount API + // /api/v1/broker/nd/account/apikey - data := "{\"uid\": \"226383154\", \"currentPage\": 1, \"pageSize\": 20}" - req := &GetSubAccountReq{} + data := "{\"uid\": \"226383154\", \"apiKey\": \"671afb36cee20f00015cfaf1\"}" + req := &GetSubAccountAPIReq{} err := json.Unmarshal([]byte(data), req) req.ToMap() assert.Nil(t, err) } -func TestNDBrokerGetSubAccountRespModel(t *testing.T) { - // GetSubAccount - // Get SubAccount - // /api/v1/broker/nd/account +func TestNDBrokerGetSubAccountAPIRespModel(t *testing.T) { + // GetSubAccountAPI + // Get SubAccount API + // /api/v1/broker/nd/account/apikey - data := "{\n \"code\": \"200000\",\n \"data\": {\n \"currentPage\": 1,\n \"pageSize\": 20,\n \"totalNum\": 1,\n \"totalPage\": 1,\n \"items\": [\n {\n \"accountName\": \"Account15\",\n \"uid\": \"226383154\",\n \"createdAt\": 1729819382000,\n \"level\": 0\n }\n ]\n }\n}" + data := "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"uid\": \"226383154\",\n \"label\": \"This is remarks\",\n \"apiKey\": \"671afb36cee20f00015cfaf1\",\n \"apiVersion\": 3,\n \"permissions\": [\n \"General\",\n \"Spot\"\n ],\n \"ipWhitelist\": [\n \"127.**.1\",\n \"203.**.154\"\n ],\n \"createdAt\": 1729821494000\n }\n ]\n}" commonResp := &types.RestResponse{} err := json.Unmarshal([]byte(data), commonResp) assert.Nil(t, err) assert.NotNil(t, commonResp.Data) - resp := &GetSubAccountResp{} + resp := &GetSubAccountAPIResp{} err = json.Unmarshal([]byte(commonResp.Data), resp) resp.ToMap() assert.Nil(t, err) } -func TestNDBrokerAddSubAccountReqModel(t *testing.T) { - // AddSubAccount - // Add SubAccount - // /api/v1/broker/nd/account +func TestNDBrokerModifySubAccountApiReqModel(t *testing.T) { + // ModifySubAccountApi + // Modify SubAccount API + // /api/v1/broker/nd/account/update-apikey - data := "{\"accountName\": \"Account1\"}" - req := &AddSubAccountReq{} + data := "{\"uid\": \"226383154\", \"apiKey\": \"671afb36cee20f00015cfaf1\", \"ipWhitelist\": [\"127.0.0.1\", \"123.123.123.123\"], \"permissions\": [\"general\", \"spot\"], \"label\": \"This is remarks\"}" + req := &ModifySubAccountApiReq{} err := json.Unmarshal([]byte(data), req) req.ToMap() assert.Nil(t, err) } -func TestNDBrokerAddSubAccountRespModel(t *testing.T) { - // AddSubAccount - // Add SubAccount - // /api/v1/broker/nd/account +func TestNDBrokerModifySubAccountApiRespModel(t *testing.T) { + // ModifySubAccountApi + // Modify SubAccount API + // /api/v1/broker/nd/account/update-apikey - data := "{\n \"code\": \"200000\",\n \"data\": {\n \"accountName\": \"Account15\",\n \"uid\": \"226383154\",\n \"createdAt\": 1729819381908,\n \"level\": 0\n }\n}" + data := "{\n \"code\": \"200000\",\n \"data\": {\n \"uid\": \"226383154\",\n \"label\": \"This is remarks\",\n \"apiKey\": \"671afb36cee20f00015cfaf1\",\n \"apiVersion\": 3,\n \"permissions\": [\n \"General\",\n \"Spot\"\n ],\n \"ipWhitelist\": [\n \"127.**.1\",\n \"123.**.123\"\n ],\n \"createdAt\": 1729821494000\n }\n}" commonResp := &types.RestResponse{} err := json.Unmarshal([]byte(data), commonResp) assert.Nil(t, err) assert.NotNil(t, commonResp.Data) - resp := &AddSubAccountResp{} + resp := &ModifySubAccountApiResp{} err = json.Unmarshal([]byte(commonResp.Data), resp) resp.ToMap() assert.Nil(t, err) } -func TestNDBrokerModifySubAccountApiReqModel(t *testing.T) { - // ModifySubAccountApi - // Modify SubAccount API - // /api/v1/broker/nd/account/update-apikey +func TestNDBrokerDeleteSubAccountAPIReqModel(t *testing.T) { + // DeleteSubAccountAPI + // Delete SubAccount API + // /api/v1/broker/nd/account/apikey - data := "{\"uid\": \"226383154\", \"apiKey\": \"671afb36cee20f00015cfaf1\", \"ipWhitelist\": [\"127.0.0.1\", \"123.123.123.123\"], \"permissions\": [\"general\", \"spot\"], \"label\": \"This is remarks\"}" - req := &ModifySubAccountApiReq{} + data := "{\"uid\": \"226383154\", \"apiKey\": \"671afb36cee20f00015cfaf1\"}" + req := &DeleteSubAccountAPIReq{} err := json.Unmarshal([]byte(data), req) req.ToMap() assert.Nil(t, err) } -func TestNDBrokerModifySubAccountApiRespModel(t *testing.T) { - // ModifySubAccountApi - // Modify SubAccount API - // /api/v1/broker/nd/account/update-apikey +func TestNDBrokerDeleteSubAccountAPIRespModel(t *testing.T) { + // DeleteSubAccountAPI + // Delete SubAccount API + // /api/v1/broker/nd/account/apikey - data := "{\n \"code\": \"200000\",\n \"data\": {\n \"uid\": \"226383154\",\n \"label\": \"This is remarks\",\n \"apiKey\": \"671afb36cee20f00015cfaf1\",\n \"apiVersion\": 3,\n \"permissions\": [\n \"General\",\n \"Spot\"\n ],\n \"ipWhitelist\": [\n \"127.**.1\",\n \"123.**.123\"\n ],\n \"createdAt\": 1729821494000\n }\n}" + data := "{\n \"code\": \"200000\",\n \"data\": true\n}" commonResp := &types.RestResponse{} err := json.Unmarshal([]byte(data), commonResp) assert.Nil(t, err) assert.NotNil(t, commonResp.Data) - resp := &ModifySubAccountApiResp{} + resp := &DeleteSubAccountAPIResp{} err = json.Unmarshal([]byte(commonResp.Data), resp) resp.ToMap() assert.Nil(t, err) } -func TestNDBrokerGetBrokerInfoReqModel(t *testing.T) { - // GetBrokerInfo - // Get Broker Info - // /api/v1/broker/nd/info +func TestNDBrokerTransferReqModel(t *testing.T) { + // Transfer + // Transfer + // /api/v1/broker/nd/transfer - data := "{\"begin\": \"20240510\", \"end\": \"20241010\", \"tradeType\": \"1\"}" - req := &GetBrokerInfoReq{} + data := "{\"currency\": \"USDT\", \"amount\": \"1\", \"clientOid\": \"e6c24d23-6bc2-401b-bf9e-55e2daddfbc1\", \"direction\": \"OUT\", \"accountType\": \"MAIN\", \"specialUid\": \"226383154\", \"specialAccountType\": \"MAIN\"}" + req := &TransferReq{} err := json.Unmarshal([]byte(data), req) req.ToMap() assert.Nil(t, err) } -func TestNDBrokerGetBrokerInfoRespModel(t *testing.T) { - // GetBrokerInfo - // Get Broker Info - // /api/v1/broker/nd/info +func TestNDBrokerTransferRespModel(t *testing.T) { + // Transfer + // Transfer + // /api/v1/broker/nd/transfer - data := "{\n \"code\": \"200000\",\n \"data\": {\n \"accountSize\": 0,\n \"maxAccountSize\": null,\n \"level\": 0\n }\n}" + data := "{\n \"code\": \"200000\",\n \"data\": {\n \"orderId\": \"671b4600c1e3dd000726866d\"\n }\n}" commonResp := &types.RestResponse{} err := json.Unmarshal([]byte(data), commonResp) assert.Nil(t, err) assert.NotNil(t, commonResp.Data) - resp := &GetBrokerInfoResp{} + resp := &TransferResp{} err = json.Unmarshal([]byte(commonResp.Data), resp) resp.ToMap() assert.Nil(t, err) } -func TestNDBrokerGetRebaseReqModel(t *testing.T) { - // GetRebase - // Get Broker Rebate - // /api/v1/broker/nd/rebase/download +func TestNDBrokerGetTransferHistoryReqModel(t *testing.T) { + // GetTransferHistory + // Get Transfer History + // /api/v3/broker/nd/transfer/detail - data := "{\"begin\": \"20240610\", \"end\": \"20241010\", \"tradeType\": \"1\"}" - req := &GetRebaseReq{} + data := "{\"orderId\": \"671b4600c1e3dd000726866d\"}" + req := &GetTransferHistoryReq{} err := json.Unmarshal([]byte(data), req) req.ToMap() assert.Nil(t, err) } -func TestNDBrokerGetRebaseRespModel(t *testing.T) { - // GetRebase - // Get Broker Rebate - // /api/v1/broker/nd/rebase/download +func TestNDBrokerGetTransferHistoryRespModel(t *testing.T) { + // GetTransferHistory + // Get Transfer History + // /api/v3/broker/nd/transfer/detail - data := "{\n \"code\": \"200000\",\n \"data\": {\n \"url\": \"https://kc-v2-promotion.s3.ap-northeast-1.amazonaws.com/broker/671aec522593f600019766d0_file.csv?X-Amz-Security-Token=IQo*********2cd90f14efb\"\n }\n}" + data := "{\n \"code\": \"200000\",\n \"data\": {\n \"orderId\": \"671b4600c1e3dd000726866d\",\n \"currency\": \"USDT\",\n \"amount\": \"1\",\n \"fromUid\": 165111215,\n \"fromAccountType\": \"MAIN\",\n \"fromAccountTag\": \"DEFAULT\",\n \"toUid\": 226383154,\n \"toAccountType\": \"MAIN\",\n \"toAccountTag\": \"DEFAULT\",\n \"status\": \"SUCCESS\",\n \"reason\": null,\n \"createdAt\": 1729840640000\n }\n}" commonResp := &types.RestResponse{} err := json.Unmarshal([]byte(data), commonResp) assert.Nil(t, err) assert.NotNil(t, commonResp.Data) - resp := &GetRebaseResp{} + resp := &GetTransferHistoryResp{} err = json.Unmarshal([]byte(commonResp.Data), resp) resp.ToMap() assert.Nil(t, err) } -func TestNDBrokerTransferReqModel(t *testing.T) { - // Transfer - // Transfer - // /api/v1/broker/nd/transfer +func TestNDBrokerGetDepositListReqModel(t *testing.T) { + // GetDepositList + // Get Deposit List + // /api/v1/asset/ndbroker/deposit/list - data := "{\"currency\": \"USDT\", \"amount\": \"1\", \"clientOid\": \"e6c24d23-6bc2-401b-bf9e-55e2daddfbc1\", \"direction\": \"OUT\", \"accountType\": \"MAIN\", \"specialUid\": \"226383154\", \"specialAccountType\": \"MAIN\"}" - req := &TransferReq{} + data := "{\"currency\": \"USDT\", \"status\": \"SUCCESS\", \"hash\": \"example_string_default_value\", \"startTimestamp\": 123456, \"endTimestamp\": 123456, \"limit\": 100}" + req := &GetDepositListReq{} err := json.Unmarshal([]byte(data), req) req.ToMap() assert.Nil(t, err) } -func TestNDBrokerTransferRespModel(t *testing.T) { - // Transfer - // Transfer - // /api/v1/broker/nd/transfer +func TestNDBrokerGetDepositListRespModel(t *testing.T) { + // GetDepositList + // Get Deposit List + // /api/v1/asset/ndbroker/deposit/list - data := "{\n \"code\": \"200000\",\n \"data\": {\n \"orderId\": \"671b4600c1e3dd000726866d\"\n }\n}" + data := "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"uid\": 165111215,\n \"hash\": \"6724e363a492800007ec602b\",\n \"address\": \"xxxxxxx@gmail.com\",\n \"memo\": \"\",\n \"amount\": \"3.0\",\n \"fee\": \"0.0\",\n \"currency\": \"USDT\",\n \"isInner\": true,\n \"walletTxId\": \"bbbbbbbbb\",\n \"status\": \"SUCCESS\",\n \"chain\": \"\",\n \"remark\": \"\",\n \"createdAt\": 1730470760000,\n \"updatedAt\": 1730470760000\n }\n ]\n}" commonResp := &types.RestResponse{} err := json.Unmarshal([]byte(data), commonResp) assert.Nil(t, err) assert.NotNil(t, commonResp.Data) - resp := &TransferResp{} + resp := &GetDepositListResp{} err = json.Unmarshal([]byte(commonResp.Data), resp) resp.ToMap() assert.Nil(t, err) @@ -315,57 +315,57 @@ func TestNDBrokerGetDepositDetailRespModel(t *testing.T) { assert.Nil(t, err) } -func TestNDBrokerGetTransferHistoryReqModel(t *testing.T) { - // GetTransferHistory - // Get Transfer History - // /api/v3/broker/nd/transfer/detail +func TestNDBrokerGetWithdrawDetailReqModel(t *testing.T) { + // GetWithdrawDetail + // Get Withdraw Detail + // /api/v3/broker/nd/withdraw/detail - data := "{\"orderId\": \"671b4600c1e3dd000726866d\"}" - req := &GetTransferHistoryReq{} + data := "{\"withdrawalId\": \"66617a2***3c9a\"}" + req := &GetWithdrawDetailReq{} err := json.Unmarshal([]byte(data), req) req.ToMap() assert.Nil(t, err) } -func TestNDBrokerGetTransferHistoryRespModel(t *testing.T) { - // GetTransferHistory - // Get Transfer History - // /api/v3/broker/nd/transfer/detail +func TestNDBrokerGetWithdrawDetailRespModel(t *testing.T) { + // GetWithdrawDetail + // Get Withdraw Detail + // /api/v3/broker/nd/withdraw/detail - data := "{\n \"code\": \"200000\",\n \"data\": {\n \"orderId\": \"671b4600c1e3dd000726866d\",\n \"currency\": \"USDT\",\n \"amount\": \"1\",\n \"fromUid\": 165111215,\n \"fromAccountType\": \"MAIN\",\n \"fromAccountTag\": \"DEFAULT\",\n \"toUid\": 226383154,\n \"toAccountType\": \"MAIN\",\n \"toAccountTag\": \"DEFAULT\",\n \"status\": \"SUCCESS\",\n \"reason\": null,\n \"createdAt\": 1729840640000\n }\n}" + data := "{\n \"data\": {\n \"id\": \"66617a2***3c9a\",\n \"chain\": \"ton\",\n \"walletTxId\": \"AJ***eRI=\",\n \"uid\": 157267400,\n \"amount\": \"1.00000000\",\n \"memo\": \"7025734\",\n \"fee\": \"0.00000000\",\n \"address\": \"EQDn***dKbGzr\",\n \"remark\": \"\",\n \"isInner\": false,\n \"currency\": \"USDT\",\n \"status\": \"SUCCESS\",\n \"createdAt\": 1717664288000,\n \"updatedAt\": 1717664375000\n },\n \"code\": \"200000\"\n}" commonResp := &types.RestResponse{} err := json.Unmarshal([]byte(data), commonResp) assert.Nil(t, err) assert.NotNil(t, commonResp.Data) - resp := &GetTransferHistoryResp{} + resp := &GetWithdrawDetailResp{} err = json.Unmarshal([]byte(commonResp.Data), resp) resp.ToMap() assert.Nil(t, err) } -func TestNDBrokerGetWithdrawDetailReqModel(t *testing.T) { - // GetWithdrawDetail - // Get Withdraw Detail - // /api/v3/broker/nd/withdraw/detail +func TestNDBrokerGetRebaseReqModel(t *testing.T) { + // GetRebase + // Get Broker Rebate + // /api/v1/broker/nd/rebase/download - data := "{\"withdrawalId\": \"66617a2***3c9a\"}" - req := &GetWithdrawDetailReq{} + data := "{\"begin\": \"20240610\", \"end\": \"20241010\", \"tradeType\": \"1\"}" + req := &GetRebaseReq{} err := json.Unmarshal([]byte(data), req) req.ToMap() assert.Nil(t, err) } -func TestNDBrokerGetWithdrawDetailRespModel(t *testing.T) { - // GetWithdrawDetail - // Get Withdraw Detail - // /api/v3/broker/nd/withdraw/detail +func TestNDBrokerGetRebaseRespModel(t *testing.T) { + // GetRebase + // Get Broker Rebate + // /api/v1/broker/nd/rebase/download - data := "{\n \"data\": {\n \"id\": \"66617a2***3c9a\",\n \"chain\": \"ton\",\n \"walletTxId\": \"AJ***eRI=\",\n \"uid\": 157267400,\n \"amount\": \"1.00000000\",\n \"memo\": \"7025734\",\n \"fee\": \"0.00000000\",\n \"address\": \"EQDn***dKbGzr\",\n \"remark\": \"\",\n \"isInner\": false,\n \"currency\": \"USDT\",\n \"status\": \"SUCCESS\",\n \"createdAt\": 1717664288000,\n \"updatedAt\": 1717664375000\n },\n \"code\": \"200000\"\n}" + data := "{\n \"code\": \"200000\",\n \"data\": {\n \"url\": \"https://kc-v2-promotion.s3.ap-northeast-1.amazonaws.com/broker/671aec522593f600019766d0_file.csv?X-Amz-Security-Token=IQo*********2cd90f14efb\"\n }\n}" commonResp := &types.RestResponse{} err := json.Unmarshal([]byte(data), commonResp) assert.Nil(t, err) assert.NotNil(t, commonResp.Data) - resp := &GetWithdrawDetailResp{} + resp := &GetRebaseResp{} err = json.Unmarshal([]byte(commonResp.Data), resp) resp.ToMap() assert.Nil(t, err) diff --git a/sdk/golang/pkg/generate/earn/earn/api_earn.go b/sdk/golang/pkg/generate/earn/earn/api_earn.go index fc23f4e7..66099db6 100644 --- a/sdk/golang/pkg/generate/earn/earn/api_earn.go +++ b/sdk/golang/pkg/generate/earn/earn/api_earn.go @@ -9,47 +9,33 @@ import ( type EarnAPI interface { - // GetETHStakingProducts Get ETH Staking Products - // Description: This endpoint can get available ETH staking products. If no products are available, an empty list is returned. - // Documentation: https://www.kucoin.com/docs-new/api-3470276 - // +---------------------+---------+ - // | Extra API Info | Value | - // +---------------------+---------+ - // | API-DOMAIN | SPOT | - // | API-CHANNEL | PRIVATE | - // | API-PERMISSION | GENERAL | - // | API-RATE-LIMIT-POOL | EARN | - // | API-RATE-LIMIT | 5 | - // +---------------------+---------+ - GetETHStakingProducts(req *GetETHStakingProductsReq, ctx context.Context) (*GetETHStakingProductsResp, error) - - // GetAccountHolding Get Account Holding - // Description: This endpoint can get current holding assets information. If no current holding assets are available, an empty list is returned. - // Documentation: https://www.kucoin.com/docs-new/api-3470273 + // Purchase purchase + // Description: This endpoint allows subscribing earn product + // Documentation: https://www.kucoin.com/docs-new/api-3470268 // +---------------------+---------+ // | Extra API Info | Value | // +---------------------+---------+ // | API-DOMAIN | SPOT | // | API-CHANNEL | PRIVATE | - // | API-PERMISSION | GENERAL | + // | API-PERMISSION | EARN | // | API-RATE-LIMIT-POOL | EARN | // | API-RATE-LIMIT | 5 | // +---------------------+---------+ - GetAccountHolding(req *GetAccountHoldingReq, ctx context.Context) (*GetAccountHoldingResp, error) + Purchase(req *PurchaseReq, ctx context.Context) (*PurchaseResp, error) - // GetKcsStakingProducts Get KCS Staking Products - // Description: This endpoint can get available KCS staking products. If no products are available, an empty list is returned. - // Documentation: https://www.kucoin.com/docs-new/api-3470275 + // GetRedeemPreview Get Redeem Preview + // Description: This endpoint allows subscribing earn products + // Documentation: https://www.kucoin.com/docs-new/api-3470269 // +---------------------+---------+ // | Extra API Info | Value | // +---------------------+---------+ // | API-DOMAIN | SPOT | // | API-CHANNEL | PRIVATE | - // | API-PERMISSION | GENERAL | + // | API-PERMISSION | EARN | // | API-RATE-LIMIT-POOL | EARN | // | API-RATE-LIMIT | 5 | // +---------------------+---------+ - GetKcsStakingProducts(req *GetKcsStakingProductsReq, ctx context.Context) (*GetKcsStakingProductsResp, error) + GetRedeemPreview(req *GetRedeemPreviewReq, ctx context.Context) (*GetRedeemPreviewResp, error) // Redeem Redeem // Description: This endpoint allows initiating redemption by holding ID. If the current holding is fully redeemed or in the process of being redeemed, it indicates that the holding does not exist. @@ -65,19 +51,19 @@ type EarnAPI interface { // +---------------------+---------+ Redeem(req *RedeemReq, ctx context.Context) (*RedeemResp, error) - // Purchase purchase - // Description: This endpoint allows subscribing earn product - // Documentation: https://www.kucoin.com/docs-new/api-3470268 + // GetSavingsProducts Get Savings Products + // Description: This endpoint can get available savings products. If no products are available, an empty list is returned. + // Documentation: https://www.kucoin.com/docs-new/api-3470271 // +---------------------+---------+ // | Extra API Info | Value | // +---------------------+---------+ // | API-DOMAIN | SPOT | // | API-CHANNEL | PRIVATE | - // | API-PERMISSION | EARN | + // | API-PERMISSION | GENERAL | // | API-RATE-LIMIT-POOL | EARN | // | API-RATE-LIMIT | 5 | // +---------------------+---------+ - Purchase(req *PurchaseReq, ctx context.Context) (*PurchaseResp, error) + GetSavingsProducts(req *GetSavingsProductsReq, ctx context.Context) (*GetSavingsProductsResp, error) // GetPromotionProducts Get Promotion Products // Description: This endpoint can get available limited-time promotion products. If no products are available, an empty list is returned. @@ -93,23 +79,23 @@ type EarnAPI interface { // +---------------------+---------+ GetPromotionProducts(req *GetPromotionProductsReq, ctx context.Context) (*GetPromotionProductsResp, error) - // GetRedeemPreview Get Redeem Preview - // Description: This endpoint allows subscribing earn products - // Documentation: https://www.kucoin.com/docs-new/api-3470269 + // GetAccountHolding Get Account Holding + // Description: This endpoint can get current holding assets information. If no current holding assets are available, an empty list is returned. + // Documentation: https://www.kucoin.com/docs-new/api-3470273 // +---------------------+---------+ // | Extra API Info | Value | // +---------------------+---------+ // | API-DOMAIN | SPOT | // | API-CHANNEL | PRIVATE | - // | API-PERMISSION | EARN | + // | API-PERMISSION | GENERAL | // | API-RATE-LIMIT-POOL | EARN | // | API-RATE-LIMIT | 5 | // +---------------------+---------+ - GetRedeemPreview(req *GetRedeemPreviewReq, ctx context.Context) (*GetRedeemPreviewResp, error) + GetAccountHolding(req *GetAccountHoldingReq, ctx context.Context) (*GetAccountHoldingResp, error) - // GetSavingsProducts Get Savings Products - // Description: This endpoint can get available savings products. If no products are available, an empty list is returned. - // Documentation: https://www.kucoin.com/docs-new/api-3470271 + // GetStakingProducts Get Staking Products + // Description: This endpoint can get available staking products. If no products are available, an empty list is returned. + // Documentation: https://www.kucoin.com/docs-new/api-3470274 // +---------------------+---------+ // | Extra API Info | Value | // +---------------------+---------+ @@ -119,11 +105,11 @@ type EarnAPI interface { // | API-RATE-LIMIT-POOL | EARN | // | API-RATE-LIMIT | 5 | // +---------------------+---------+ - GetSavingsProducts(req *GetSavingsProductsReq, ctx context.Context) (*GetSavingsProductsResp, error) + GetStakingProducts(req *GetStakingProductsReq, ctx context.Context) (*GetStakingProductsResp, error) - // GetStakingProducts Get Staking Products - // Description: This endpoint can get available staking products. If no products are available, an empty list is returned. - // Documentation: https://www.kucoin.com/docs-new/api-3470274 + // GetKcsStakingProducts Get KCS Staking Products + // Description: This endpoint can get available KCS staking products. If no products are available, an empty list is returned. + // Documentation: https://www.kucoin.com/docs-new/api-3470275 // +---------------------+---------+ // | Extra API Info | Value | // +---------------------+---------+ @@ -133,7 +119,21 @@ type EarnAPI interface { // | API-RATE-LIMIT-POOL | EARN | // | API-RATE-LIMIT | 5 | // +---------------------+---------+ - GetStakingProducts(req *GetStakingProductsReq, ctx context.Context) (*GetStakingProductsResp, error) + GetKcsStakingProducts(req *GetKcsStakingProductsReq, ctx context.Context) (*GetKcsStakingProductsResp, error) + + // GetETHStakingProducts Get ETH Staking Products + // Description: This endpoint can get available ETH staking products. If no products are available, an empty list is returned. + // Documentation: https://www.kucoin.com/docs-new/api-3470276 + // +---------------------+---------+ + // | Extra API Info | Value | + // +---------------------+---------+ + // | API-DOMAIN | SPOT | + // | API-CHANNEL | PRIVATE | + // | API-PERMISSION | GENERAL | + // | API-RATE-LIMIT-POOL | EARN | + // | API-RATE-LIMIT | 5 | + // +---------------------+---------+ + GetETHStakingProducts(req *GetETHStakingProductsReq, ctx context.Context) (*GetETHStakingProductsResp, error) } type EarnAPIImpl struct { @@ -144,21 +144,15 @@ func NewEarnAPIImp(transport interfaces.Transport) *EarnAPIImpl { return &EarnAPIImpl{transport: transport} } -func (impl *EarnAPIImpl) GetETHStakingProducts(req *GetETHStakingProductsReq, ctx context.Context) (*GetETHStakingProductsResp, error) { - resp := &GetETHStakingProductsResp{} - err := impl.transport.Call(ctx, "spot", false, "Get", "/api/v1/earn/eth-staking/products", req, resp, false) - return resp, err -} - -func (impl *EarnAPIImpl) GetAccountHolding(req *GetAccountHoldingReq, ctx context.Context) (*GetAccountHoldingResp, error) { - resp := &GetAccountHoldingResp{} - err := impl.transport.Call(ctx, "spot", false, "Get", "/api/v1/earn/hold-assets", req, resp, false) +func (impl *EarnAPIImpl) Purchase(req *PurchaseReq, ctx context.Context) (*PurchaseResp, error) { + resp := &PurchaseResp{} + err := impl.transport.Call(ctx, "spot", false, "Post", "/api/v1/earn/orders", req, resp, false) return resp, err } -func (impl *EarnAPIImpl) GetKcsStakingProducts(req *GetKcsStakingProductsReq, ctx context.Context) (*GetKcsStakingProductsResp, error) { - resp := &GetKcsStakingProductsResp{} - err := impl.transport.Call(ctx, "spot", false, "Get", "/api/v1/earn/kcs-staking/products", req, resp, false) +func (impl *EarnAPIImpl) GetRedeemPreview(req *GetRedeemPreviewReq, ctx context.Context) (*GetRedeemPreviewResp, error) { + resp := &GetRedeemPreviewResp{} + err := impl.transport.Call(ctx, "spot", false, "Get", "/api/v1/earn/redeem-preview", req, resp, false) return resp, err } @@ -168,9 +162,9 @@ func (impl *EarnAPIImpl) Redeem(req *RedeemReq, ctx context.Context) (*RedeemRes return resp, err } -func (impl *EarnAPIImpl) Purchase(req *PurchaseReq, ctx context.Context) (*PurchaseResp, error) { - resp := &PurchaseResp{} - err := impl.transport.Call(ctx, "spot", false, "Post", "/api/v1/earn/orders", req, resp, false) +func (impl *EarnAPIImpl) GetSavingsProducts(req *GetSavingsProductsReq, ctx context.Context) (*GetSavingsProductsResp, error) { + resp := &GetSavingsProductsResp{} + err := impl.transport.Call(ctx, "spot", false, "Get", "/api/v1/earn/saving/products", req, resp, false) return resp, err } @@ -180,15 +174,9 @@ func (impl *EarnAPIImpl) GetPromotionProducts(req *GetPromotionProductsReq, ctx return resp, err } -func (impl *EarnAPIImpl) GetRedeemPreview(req *GetRedeemPreviewReq, ctx context.Context) (*GetRedeemPreviewResp, error) { - resp := &GetRedeemPreviewResp{} - err := impl.transport.Call(ctx, "spot", false, "Get", "/api/v1/earn/redeem-preview", req, resp, false) - return resp, err -} - -func (impl *EarnAPIImpl) GetSavingsProducts(req *GetSavingsProductsReq, ctx context.Context) (*GetSavingsProductsResp, error) { - resp := &GetSavingsProductsResp{} - err := impl.transport.Call(ctx, "spot", false, "Get", "/api/v1/earn/saving/products", req, resp, false) +func (impl *EarnAPIImpl) GetAccountHolding(req *GetAccountHoldingReq, ctx context.Context) (*GetAccountHoldingResp, error) { + resp := &GetAccountHoldingResp{} + err := impl.transport.Call(ctx, "spot", false, "Get", "/api/v1/earn/hold-assets", req, resp, false) return resp, err } @@ -197,3 +185,15 @@ func (impl *EarnAPIImpl) GetStakingProducts(req *GetStakingProductsReq, ctx cont err := impl.transport.Call(ctx, "spot", false, "Get", "/api/v1/earn/staking/products", req, resp, false) return resp, err } + +func (impl *EarnAPIImpl) GetKcsStakingProducts(req *GetKcsStakingProductsReq, ctx context.Context) (*GetKcsStakingProductsResp, error) { + resp := &GetKcsStakingProductsResp{} + err := impl.transport.Call(ctx, "spot", false, "Get", "/api/v1/earn/kcs-staking/products", req, resp, false) + return resp, err +} + +func (impl *EarnAPIImpl) GetETHStakingProducts(req *GetETHStakingProductsReq, ctx context.Context) (*GetETHStakingProductsResp, error) { + resp := &GetETHStakingProductsResp{} + err := impl.transport.Call(ctx, "spot", false, "Get", "/api/v1/earn/eth-staking/products", req, resp, false) + return resp, err +} diff --git a/sdk/golang/pkg/generate/earn/earn/api_earn.template b/sdk/golang/pkg/generate/earn/earn/api_earn.template index a0c1a846..6713b77d 100644 --- a/sdk/golang/pkg/generate/earn/earn/api_earn.template +++ b/sdk/golang/pkg/generate/earn/earn/api_earn.template @@ -1,16 +1,16 @@ # API FUNCTION TEMPLATE -func TestEarnGetETHStakingProductsReq(t *testing.T) { - // GetETHStakingProducts - // Get ETH Staking Products - // /api/v1/earn/eth-staking/products +func TestEarnPurchaseReq(t *testing.T) { + // Purchase + // purchase + // /api/v1/earn/orders - builder := earn.NewGetETHStakingProductsReqBuilder() - builder.SetCurrency(?) + builder := earn.NewPurchaseReqBuilder() + builder.SetProductId(?).SetAmount(?).SetAccountType(?) req := builder.Build() - resp, err := earnApi.GetETHStakingProducts(req, context.TODO()) + resp, err := earnApi.Purchase(req, context.TODO()) if err != nil { panic(err) } @@ -24,16 +24,16 @@ func TestEarnGetETHStakingProductsReq(t *testing.T) { } -func TestEarnGetAccountHoldingReq(t *testing.T) { - // GetAccountHolding - // Get Account Holding - // /api/v1/earn/hold-assets +func TestEarnGetRedeemPreviewReq(t *testing.T) { + // GetRedeemPreview + // Get Redeem Preview + // /api/v1/earn/redeem-preview - builder := earn.NewGetAccountHoldingReqBuilder() - builder.SetCurrency(?).SetProductId(?).SetProductCategory(?).SetCurrentPage(?).SetPageSize(?) + builder := earn.NewGetRedeemPreviewReqBuilder() + builder.SetOrderId(?).SetFromAccountType(?) req := builder.Build() - resp, err := earnApi.GetAccountHolding(req, context.TODO()) + resp, err := earnApi.GetRedeemPreview(req, context.TODO()) if err != nil { panic(err) } @@ -47,16 +47,16 @@ func TestEarnGetAccountHoldingReq(t *testing.T) { } -func TestEarnGetKcsStakingProductsReq(t *testing.T) { - // GetKcsStakingProducts - // Get KCS Staking Products - // /api/v1/earn/kcs-staking/products +func TestEarnRedeemReq(t *testing.T) { + // Redeem + // Redeem + // /api/v1/earn/orders - builder := earn.NewGetKcsStakingProductsReqBuilder() - builder.SetCurrency(?) + builder := earn.NewRedeemReqBuilder() + builder.SetOrderId(?).SetAmount(?).SetFromAccountType(?).SetConfirmPunishRedeem(?) req := builder.Build() - resp, err := earnApi.GetKcsStakingProducts(req, context.TODO()) + resp, err := earnApi.Redeem(req, context.TODO()) if err != nil { panic(err) } @@ -70,16 +70,16 @@ func TestEarnGetKcsStakingProductsReq(t *testing.T) { } -func TestEarnRedeemReq(t *testing.T) { - // Redeem - // Redeem - // /api/v1/earn/orders +func TestEarnGetSavingsProductsReq(t *testing.T) { + // GetSavingsProducts + // Get Savings Products + // /api/v1/earn/saving/products - builder := earn.NewRedeemReqBuilder() - builder.SetOrderId(?).SetAmount(?).SetFromAccountType(?).SetConfirmPunishRedeem(?) + builder := earn.NewGetSavingsProductsReqBuilder() + builder.SetCurrency(?) req := builder.Build() - resp, err := earnApi.Redeem(req, context.TODO()) + resp, err := earnApi.GetSavingsProducts(req, context.TODO()) if err != nil { panic(err) } @@ -93,16 +93,16 @@ func TestEarnRedeemReq(t *testing.T) { } -func TestEarnPurchaseReq(t *testing.T) { - // Purchase - // purchase - // /api/v1/earn/orders +func TestEarnGetPromotionProductsReq(t *testing.T) { + // GetPromotionProducts + // Get Promotion Products + // /api/v1/earn/promotion/products - builder := earn.NewPurchaseReqBuilder() - builder.SetProductId(?).SetAmount(?).SetAccountType(?) + builder := earn.NewGetPromotionProductsReqBuilder() + builder.SetCurrency(?) req := builder.Build() - resp, err := earnApi.Purchase(req, context.TODO()) + resp, err := earnApi.GetPromotionProducts(req, context.TODO()) if err != nil { panic(err) } @@ -116,16 +116,16 @@ func TestEarnPurchaseReq(t *testing.T) { } -func TestEarnGetPromotionProductsReq(t *testing.T) { - // GetPromotionProducts - // Get Promotion Products - // /api/v1/earn/promotion/products +func TestEarnGetAccountHoldingReq(t *testing.T) { + // GetAccountHolding + // Get Account Holding + // /api/v1/earn/hold-assets - builder := earn.NewGetPromotionProductsReqBuilder() - builder.SetCurrency(?) + builder := earn.NewGetAccountHoldingReqBuilder() + builder.SetCurrency(?).SetProductId(?).SetProductCategory(?).SetCurrentPage(?).SetPageSize(?) req := builder.Build() - resp, err := earnApi.GetPromotionProducts(req, context.TODO()) + resp, err := earnApi.GetAccountHolding(req, context.TODO()) if err != nil { panic(err) } @@ -139,16 +139,16 @@ func TestEarnGetPromotionProductsReq(t *testing.T) { } -func TestEarnGetRedeemPreviewReq(t *testing.T) { - // GetRedeemPreview - // Get Redeem Preview - // /api/v1/earn/redeem-preview +func TestEarnGetStakingProductsReq(t *testing.T) { + // GetStakingProducts + // Get Staking Products + // /api/v1/earn/staking/products - builder := earn.NewGetRedeemPreviewReqBuilder() - builder.SetOrderId(?).SetFromAccountType(?) + builder := earn.NewGetStakingProductsReqBuilder() + builder.SetCurrency(?) req := builder.Build() - resp, err := earnApi.GetRedeemPreview(req, context.TODO()) + resp, err := earnApi.GetStakingProducts(req, context.TODO()) if err != nil { panic(err) } @@ -162,16 +162,16 @@ func TestEarnGetRedeemPreviewReq(t *testing.T) { } -func TestEarnGetSavingsProductsReq(t *testing.T) { - // GetSavingsProducts - // Get Savings Products - // /api/v1/earn/saving/products +func TestEarnGetKcsStakingProductsReq(t *testing.T) { + // GetKcsStakingProducts + // Get KCS Staking Products + // /api/v1/earn/kcs-staking/products - builder := earn.NewGetSavingsProductsReqBuilder() + builder := earn.NewGetKcsStakingProductsReqBuilder() builder.SetCurrency(?) req := builder.Build() - resp, err := earnApi.GetSavingsProducts(req, context.TODO()) + resp, err := earnApi.GetKcsStakingProducts(req, context.TODO()) if err != nil { panic(err) } @@ -185,16 +185,16 @@ func TestEarnGetSavingsProductsReq(t *testing.T) { } -func TestEarnGetStakingProductsReq(t *testing.T) { - // GetStakingProducts - // Get Staking Products - // /api/v1/earn/staking/products +func TestEarnGetETHStakingProductsReq(t *testing.T) { + // GetETHStakingProducts + // Get ETH Staking Products + // /api/v1/earn/eth-staking/products - builder := earn.NewGetStakingProductsReqBuilder() + builder := earn.NewGetETHStakingProductsReqBuilder() builder.SetCurrency(?) req := builder.Build() - resp, err := earnApi.GetStakingProducts(req, context.TODO()) + resp, err := earnApi.GetETHStakingProducts(req, context.TODO()) if err != nil { panic(err) } diff --git a/sdk/golang/pkg/generate/earn/earn/api_earn_test.go b/sdk/golang/pkg/generate/earn/earn/api_earn_test.go index 1fa14795..9a01fa65 100644 --- a/sdk/golang/pkg/generate/earn/earn/api_earn_test.go +++ b/sdk/golang/pkg/generate/earn/earn/api_earn_test.go @@ -7,85 +7,57 @@ import ( "testing" ) -func TestEarnGetETHStakingProductsReqModel(t *testing.T) { - // GetETHStakingProducts - // Get ETH Staking Products - // /api/v1/earn/eth-staking/products - - data := "{\"currency\": \"BTC\"}" - req := &GetETHStakingProductsReq{} - err := json.Unmarshal([]byte(data), req) - req.ToMap() - assert.Nil(t, err) -} - -func TestEarnGetETHStakingProductsRespModel(t *testing.T) { - // GetETHStakingProducts - // Get ETH Staking Products - // /api/v1/earn/eth-staking/products - - data := "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"id\": \"ETH2\",\n \"category\": \"ETH2\",\n \"type\": \"DEMAND\",\n \"precision\": 8,\n \"currency\": \"ETH\",\n \"incomeCurrency\": \"ETH2\",\n \"returnRate\": \"0.028\",\n \"userLowerLimit\": \"0.01\",\n \"userUpperLimit\": \"8557.3597075\",\n \"productUpperLimit\": \"8557.3597075\",\n \"productRemainAmount\": \"8557.3597075\",\n \"redeemPeriod\": 5,\n \"redeemType\": \"MANUAL\",\n \"incomeReleaseType\": \"DAILY\",\n \"applyStartTime\": 1729255485000,\n \"applyEndTime\": null,\n \"lockStartTime\": 1729255485000,\n \"lockEndTime\": null,\n \"interestDate\": 1729267200000,\n \"newUserOnly\": 0,\n \"earlyRedeemSupported\": 0,\n \"duration\": 0,\n \"status\": \"ONGOING\"\n }\n ]\n}" - commonResp := &types.RestResponse{} - err := json.Unmarshal([]byte(data), commonResp) - assert.Nil(t, err) - assert.NotNil(t, commonResp.Data) - resp := &GetETHStakingProductsResp{} - err = json.Unmarshal([]byte(commonResp.Data), resp) - resp.ToMap() - assert.Nil(t, err) -} - -func TestEarnGetAccountHoldingReqModel(t *testing.T) { - // GetAccountHolding - // Get Account Holding - // /api/v1/earn/hold-assets +func TestEarnPurchaseReqModel(t *testing.T) { + // Purchase + // purchase + // /api/v1/earn/orders - data := "{\"currency\": \"KCS\", \"productId\": \"example_string_default_value\", \"productCategory\": \"DEMAND\", \"currentPage\": 1, \"pageSize\": 10}" - req := &GetAccountHoldingReq{} + data := "{\"productId\": \"2611\", \"amount\": \"1\", \"accountType\": \"TRADE\"}" + req := &PurchaseReq{} err := json.Unmarshal([]byte(data), req) req.ToMap() assert.Nil(t, err) } -func TestEarnGetAccountHoldingRespModel(t *testing.T) { - // GetAccountHolding - // Get Account Holding - // /api/v1/earn/hold-assets +func TestEarnPurchaseRespModel(t *testing.T) { + // Purchase + // purchase + // /api/v1/earn/orders - data := "{\n \"code\": \"200000\",\n \"data\": {\n \"totalNum\": 1,\n \"totalPage\": 1,\n \"currentPage\": 1,\n \"pageSize\": 15,\n \"items\": [\n {\n \"orderId\": \"2767291\",\n \"productId\": \"2611\",\n \"productCategory\": \"KCS_STAKING\",\n \"productType\": \"DEMAND\",\n \"currency\": \"KCS\",\n \"incomeCurrency\": \"KCS\",\n \"returnRate\": \"0.03471727\",\n \"holdAmount\": \"1\",\n \"redeemedAmount\": \"0\",\n \"redeemingAmount\": \"1\",\n \"lockStartTime\": 1701252000000,\n \"lockEndTime\": null,\n \"purchaseTime\": 1729257513000,\n \"redeemPeriod\": 3,\n \"status\": \"REDEEMING\",\n \"earlyRedeemSupported\": 0\n }\n ]\n }\n}" + data := "{\n \"code\": \"200000\",\n \"data\": {\n \"orderId\": \"2767291\",\n \"orderTxId\": \"6603694\"\n }\n}" commonResp := &types.RestResponse{} err := json.Unmarshal([]byte(data), commonResp) assert.Nil(t, err) assert.NotNil(t, commonResp.Data) - resp := &GetAccountHoldingResp{} + resp := &PurchaseResp{} err = json.Unmarshal([]byte(commonResp.Data), resp) resp.ToMap() assert.Nil(t, err) } -func TestEarnGetKcsStakingProductsReqModel(t *testing.T) { - // GetKcsStakingProducts - // Get KCS Staking Products - // /api/v1/earn/kcs-staking/products +func TestEarnGetRedeemPreviewReqModel(t *testing.T) { + // GetRedeemPreview + // Get Redeem Preview + // /api/v1/earn/redeem-preview - data := "{\"currency\": \"BTC\"}" - req := &GetKcsStakingProductsReq{} + data := "{\"orderId\": \"2767291\", \"fromAccountType\": \"MAIN\"}" + req := &GetRedeemPreviewReq{} err := json.Unmarshal([]byte(data), req) req.ToMap() assert.Nil(t, err) } -func TestEarnGetKcsStakingProductsRespModel(t *testing.T) { - // GetKcsStakingProducts - // Get KCS Staking Products - // /api/v1/earn/kcs-staking/products +func TestEarnGetRedeemPreviewRespModel(t *testing.T) { + // GetRedeemPreview + // Get Redeem Preview + // /api/v1/earn/redeem-preview - data := "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"id\": \"2611\",\n \"currency\": \"KCS\",\n \"category\": \"KCS_STAKING\",\n \"type\": \"DEMAND\",\n \"precision\": 8,\n \"productUpperLimit\": \"100000000\",\n \"userUpperLimit\": \"100000000\",\n \"userLowerLimit\": \"1\",\n \"redeemPeriod\": 3,\n \"lockStartTime\": 1701252000000,\n \"lockEndTime\": null,\n \"applyStartTime\": 1701252000000,\n \"applyEndTime\": null,\n \"returnRate\": \"0.03471727\",\n \"incomeCurrency\": \"KCS\",\n \"earlyRedeemSupported\": 0,\n \"productRemainAmount\": \"58065850.54998251\",\n \"status\": \"ONGOING\",\n \"redeemType\": \"MANUAL\",\n \"incomeReleaseType\": \"DAILY\",\n \"interestDate\": 1729267200000,\n \"duration\": 0,\n \"newUserOnly\": 0\n }\n ]\n}" + data := "{\n \"code\": \"200000\",\n \"data\": {\n \"currency\": \"KCS\",\n \"redeemAmount\": \"1\",\n \"penaltyInterestAmount\": \"0\",\n \"redeemPeriod\": 3,\n \"deliverTime\": 1729518951000,\n \"manualRedeemable\": true,\n \"redeemAll\": false\n }\n}" commonResp := &types.RestResponse{} err := json.Unmarshal([]byte(data), commonResp) assert.Nil(t, err) assert.NotNil(t, commonResp.Data) - resp := &GetKcsStakingProductsResp{} + resp := &GetRedeemPreviewResp{} err = json.Unmarshal([]byte(commonResp.Data), resp) resp.ToMap() assert.Nil(t, err) @@ -119,29 +91,29 @@ func TestEarnRedeemRespModel(t *testing.T) { assert.Nil(t, err) } -func TestEarnPurchaseReqModel(t *testing.T) { - // Purchase - // purchase - // /api/v1/earn/orders +func TestEarnGetSavingsProductsReqModel(t *testing.T) { + // GetSavingsProducts + // Get Savings Products + // /api/v1/earn/saving/products - data := "{\"productId\": \"2611\", \"amount\": \"1\", \"accountType\": \"TRADE\"}" - req := &PurchaseReq{} + data := "{\"currency\": \"BTC\"}" + req := &GetSavingsProductsReq{} err := json.Unmarshal([]byte(data), req) req.ToMap() assert.Nil(t, err) } -func TestEarnPurchaseRespModel(t *testing.T) { - // Purchase - // purchase - // /api/v1/earn/orders +func TestEarnGetSavingsProductsRespModel(t *testing.T) { + // GetSavingsProducts + // Get Savings Products + // /api/v1/earn/saving/products - data := "{\n \"code\": \"200000\",\n \"data\": {\n \"orderId\": \"2767291\",\n \"orderTxId\": \"6603694\"\n }\n}" + data := "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"id\": \"2172\",\n \"currency\": \"BTC\",\n \"category\": \"DEMAND\",\n \"type\": \"DEMAND\",\n \"precision\": 8,\n \"productUpperLimit\": \"480\",\n \"productRemainAmount\": \"132.36153083\",\n \"userUpperLimit\": \"20\",\n \"userLowerLimit\": \"0.01\",\n \"redeemPeriod\": 0,\n \"lockStartTime\": 1644807600000,\n \"lockEndTime\": null,\n \"applyStartTime\": 1644807600000,\n \"applyEndTime\": null,\n \"returnRate\": \"0.00047208\",\n \"incomeCurrency\": \"BTC\",\n \"earlyRedeemSupported\": 0,\n \"status\": \"ONGOING\",\n \"redeemType\": \"MANUAL\",\n \"incomeReleaseType\": \"DAILY\",\n \"interestDate\": 1729267200000,\n \"duration\": 0,\n \"newUserOnly\": 0\n }\n ]\n}" commonResp := &types.RestResponse{} err := json.Unmarshal([]byte(data), commonResp) assert.Nil(t, err) assert.NotNil(t, commonResp.Data) - resp := &PurchaseResp{} + resp := &GetSavingsProductsResp{} err = json.Unmarshal([]byte(commonResp.Data), resp) resp.ToMap() assert.Nil(t, err) @@ -175,85 +147,113 @@ func TestEarnGetPromotionProductsRespModel(t *testing.T) { assert.Nil(t, err) } -func TestEarnGetRedeemPreviewReqModel(t *testing.T) { - // GetRedeemPreview - // Get Redeem Preview - // /api/v1/earn/redeem-preview +func TestEarnGetAccountHoldingReqModel(t *testing.T) { + // GetAccountHolding + // Get Account Holding + // /api/v1/earn/hold-assets - data := "{\"orderId\": \"2767291\", \"fromAccountType\": \"MAIN\"}" - req := &GetRedeemPreviewReq{} + data := "{\"currency\": \"KCS\", \"productId\": \"example_string_default_value\", \"productCategory\": \"DEMAND\", \"currentPage\": 1, \"pageSize\": 10}" + req := &GetAccountHoldingReq{} err := json.Unmarshal([]byte(data), req) req.ToMap() assert.Nil(t, err) } -func TestEarnGetRedeemPreviewRespModel(t *testing.T) { - // GetRedeemPreview - // Get Redeem Preview - // /api/v1/earn/redeem-preview +func TestEarnGetAccountHoldingRespModel(t *testing.T) { + // GetAccountHolding + // Get Account Holding + // /api/v1/earn/hold-assets - data := "{\n \"code\": \"200000\",\n \"data\": {\n \"currency\": \"KCS\",\n \"redeemAmount\": \"1\",\n \"penaltyInterestAmount\": \"0\",\n \"redeemPeriod\": 3,\n \"deliverTime\": 1729518951000,\n \"manualRedeemable\": true,\n \"redeemAll\": false\n }\n}" + data := "{\n \"code\": \"200000\",\n \"data\": {\n \"totalNum\": 1,\n \"totalPage\": 1,\n \"currentPage\": 1,\n \"pageSize\": 15,\n \"items\": [\n {\n \"orderId\": \"2767291\",\n \"productId\": \"2611\",\n \"productCategory\": \"KCS_STAKING\",\n \"productType\": \"DEMAND\",\n \"currency\": \"KCS\",\n \"incomeCurrency\": \"KCS\",\n \"returnRate\": \"0.03471727\",\n \"holdAmount\": \"1\",\n \"redeemedAmount\": \"0\",\n \"redeemingAmount\": \"1\",\n \"lockStartTime\": 1701252000000,\n \"lockEndTime\": null,\n \"purchaseTime\": 1729257513000,\n \"redeemPeriod\": 3,\n \"status\": \"REDEEMING\",\n \"earlyRedeemSupported\": 0\n }\n ]\n }\n}" commonResp := &types.RestResponse{} err := json.Unmarshal([]byte(data), commonResp) assert.Nil(t, err) assert.NotNil(t, commonResp.Data) - resp := &GetRedeemPreviewResp{} + resp := &GetAccountHoldingResp{} err = json.Unmarshal([]byte(commonResp.Data), resp) resp.ToMap() assert.Nil(t, err) } -func TestEarnGetSavingsProductsReqModel(t *testing.T) { - // GetSavingsProducts - // Get Savings Products - // /api/v1/earn/saving/products +func TestEarnGetStakingProductsReqModel(t *testing.T) { + // GetStakingProducts + // Get Staking Products + // /api/v1/earn/staking/products data := "{\"currency\": \"BTC\"}" - req := &GetSavingsProductsReq{} + req := &GetStakingProductsReq{} err := json.Unmarshal([]byte(data), req) req.ToMap() assert.Nil(t, err) } -func TestEarnGetSavingsProductsRespModel(t *testing.T) { - // GetSavingsProducts - // Get Savings Products - // /api/v1/earn/saving/products +func TestEarnGetStakingProductsRespModel(t *testing.T) { + // GetStakingProducts + // Get Staking Products + // /api/v1/earn/staking/products - data := "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"id\": \"2172\",\n \"currency\": \"BTC\",\n \"category\": \"DEMAND\",\n \"type\": \"DEMAND\",\n \"precision\": 8,\n \"productUpperLimit\": \"480\",\n \"productRemainAmount\": \"132.36153083\",\n \"userUpperLimit\": \"20\",\n \"userLowerLimit\": \"0.01\",\n \"redeemPeriod\": 0,\n \"lockStartTime\": 1644807600000,\n \"lockEndTime\": null,\n \"applyStartTime\": 1644807600000,\n \"applyEndTime\": null,\n \"returnRate\": \"0.00047208\",\n \"incomeCurrency\": \"BTC\",\n \"earlyRedeemSupported\": 0,\n \"status\": \"ONGOING\",\n \"redeemType\": \"MANUAL\",\n \"incomeReleaseType\": \"DAILY\",\n \"interestDate\": 1729267200000,\n \"duration\": 0,\n \"newUserOnly\": 0\n }\n ]\n}" + data := "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"id\": \"2535\",\n \"currency\": \"STX\",\n \"category\": \"STAKING\",\n \"type\": \"DEMAND\",\n \"precision\": 8,\n \"productUpperLimit\": \"1000000\",\n \"userUpperLimit\": \"10000\",\n \"userLowerLimit\": \"1\",\n \"redeemPeriod\": 14,\n \"lockStartTime\": 1688614514000,\n \"lockEndTime\": null,\n \"applyStartTime\": 1688614512000,\n \"applyEndTime\": null,\n \"returnRate\": \"0.045\",\n \"incomeCurrency\": \"BTC\",\n \"earlyRedeemSupported\": 0,\n \"productRemainAmount\": \"254032.90178701\",\n \"status\": \"ONGOING\",\n \"redeemType\": \"MANUAL\",\n \"incomeReleaseType\": \"DAILY\",\n \"interestDate\": 1729267200000,\n \"duration\": 0,\n \"newUserOnly\": 0\n }\n ]\n}" commonResp := &types.RestResponse{} err := json.Unmarshal([]byte(data), commonResp) assert.Nil(t, err) assert.NotNil(t, commonResp.Data) - resp := &GetSavingsProductsResp{} + resp := &GetStakingProductsResp{} err = json.Unmarshal([]byte(commonResp.Data), resp) resp.ToMap() assert.Nil(t, err) } -func TestEarnGetStakingProductsReqModel(t *testing.T) { - // GetStakingProducts - // Get Staking Products - // /api/v1/earn/staking/products +func TestEarnGetKcsStakingProductsReqModel(t *testing.T) { + // GetKcsStakingProducts + // Get KCS Staking Products + // /api/v1/earn/kcs-staking/products data := "{\"currency\": \"BTC\"}" - req := &GetStakingProductsReq{} + req := &GetKcsStakingProductsReq{} err := json.Unmarshal([]byte(data), req) req.ToMap() assert.Nil(t, err) } -func TestEarnGetStakingProductsRespModel(t *testing.T) { - // GetStakingProducts - // Get Staking Products - // /api/v1/earn/staking/products +func TestEarnGetKcsStakingProductsRespModel(t *testing.T) { + // GetKcsStakingProducts + // Get KCS Staking Products + // /api/v1/earn/kcs-staking/products - data := "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"id\": \"2535\",\n \"currency\": \"STX\",\n \"category\": \"STAKING\",\n \"type\": \"DEMAND\",\n \"precision\": 8,\n \"productUpperLimit\": \"1000000\",\n \"userUpperLimit\": \"10000\",\n \"userLowerLimit\": \"1\",\n \"redeemPeriod\": 14,\n \"lockStartTime\": 1688614514000,\n \"lockEndTime\": null,\n \"applyStartTime\": 1688614512000,\n \"applyEndTime\": null,\n \"returnRate\": \"0.045\",\n \"incomeCurrency\": \"BTC\",\n \"earlyRedeemSupported\": 0,\n \"productRemainAmount\": \"254032.90178701\",\n \"status\": \"ONGOING\",\n \"redeemType\": \"MANUAL\",\n \"incomeReleaseType\": \"DAILY\",\n \"interestDate\": 1729267200000,\n \"duration\": 0,\n \"newUserOnly\": 0\n }\n ]\n}" + data := "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"id\": \"2611\",\n \"currency\": \"KCS\",\n \"category\": \"KCS_STAKING\",\n \"type\": \"DEMAND\",\n \"precision\": 8,\n \"productUpperLimit\": \"100000000\",\n \"userUpperLimit\": \"100000000\",\n \"userLowerLimit\": \"1\",\n \"redeemPeriod\": 3,\n \"lockStartTime\": 1701252000000,\n \"lockEndTime\": null,\n \"applyStartTime\": 1701252000000,\n \"applyEndTime\": null,\n \"returnRate\": \"0.03471727\",\n \"incomeCurrency\": \"KCS\",\n \"earlyRedeemSupported\": 0,\n \"productRemainAmount\": \"58065850.54998251\",\n \"status\": \"ONGOING\",\n \"redeemType\": \"MANUAL\",\n \"incomeReleaseType\": \"DAILY\",\n \"interestDate\": 1729267200000,\n \"duration\": 0,\n \"newUserOnly\": 0\n }\n ]\n}" commonResp := &types.RestResponse{} err := json.Unmarshal([]byte(data), commonResp) assert.Nil(t, err) assert.NotNil(t, commonResp.Data) - resp := &GetStakingProductsResp{} + resp := &GetKcsStakingProductsResp{} + err = json.Unmarshal([]byte(commonResp.Data), resp) + resp.ToMap() + assert.Nil(t, err) +} + +func TestEarnGetETHStakingProductsReqModel(t *testing.T) { + // GetETHStakingProducts + // Get ETH Staking Products + // /api/v1/earn/eth-staking/products + + data := "{\"currency\": \"BTC\"}" + req := &GetETHStakingProductsReq{} + err := json.Unmarshal([]byte(data), req) + req.ToMap() + assert.Nil(t, err) +} + +func TestEarnGetETHStakingProductsRespModel(t *testing.T) { + // GetETHStakingProducts + // Get ETH Staking Products + // /api/v1/earn/eth-staking/products + + data := "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"id\": \"ETH2\",\n \"category\": \"ETH2\",\n \"type\": \"DEMAND\",\n \"precision\": 8,\n \"currency\": \"ETH\",\n \"incomeCurrency\": \"ETH2\",\n \"returnRate\": \"0.028\",\n \"userLowerLimit\": \"0.01\",\n \"userUpperLimit\": \"8557.3597075\",\n \"productUpperLimit\": \"8557.3597075\",\n \"productRemainAmount\": \"8557.3597075\",\n \"redeemPeriod\": 5,\n \"redeemType\": \"MANUAL\",\n \"incomeReleaseType\": \"DAILY\",\n \"applyStartTime\": 1729255485000,\n \"applyEndTime\": null,\n \"lockStartTime\": 1729255485000,\n \"lockEndTime\": null,\n \"interestDate\": 1729267200000,\n \"newUserOnly\": 0,\n \"earlyRedeemSupported\": 0,\n \"duration\": 0,\n \"status\": \"ONGOING\"\n }\n ]\n}" + commonResp := &types.RestResponse{} + err := json.Unmarshal([]byte(data), commonResp) + assert.Nil(t, err) + assert.NotNil(t, commonResp.Data) + resp := &GetETHStakingProductsResp{} err = json.Unmarshal([]byte(commonResp.Data), resp) resp.ToMap() assert.Nil(t, err) diff --git a/sdk/golang/pkg/generate/futures/fundingfees/api_funding_fees.go b/sdk/golang/pkg/generate/futures/fundingfees/api_funding_fees.go index 8da151d2..1f7b09a1 100644 --- a/sdk/golang/pkg/generate/futures/fundingfees/api_funding_fees.go +++ b/sdk/golang/pkg/generate/futures/fundingfees/api_funding_fees.go @@ -9,6 +9,20 @@ import ( type FundingFeesAPI interface { + // GetCurrentFundingRate Get Current Funding Rate + // Description: get Current Funding Rate + // Documentation: https://www.kucoin.com/docs-new/api-3470265 + // +---------------------+---------+ + // | Extra API Info | Value | + // +---------------------+---------+ + // | API-DOMAIN | FUTURES | + // | API-CHANNEL | PRIVATE | + // | API-PERMISSION | FUTURES | + // | API-RATE-LIMIT-POOL | PUBLIC | + // | API-RATE-LIMIT | 2 | + // +---------------------+---------+ + GetCurrentFundingRate(req *GetCurrentFundingRateReq, ctx context.Context) (*GetCurrentFundingRateResp, error) + // GetPublicFundingHistory Get Public Funding History // Description: Query the funding rate at each settlement time point within a certain time range of the corresponding contract // Documentation: https://www.kucoin.com/docs-new/api-3470266 @@ -36,20 +50,6 @@ type FundingFeesAPI interface { // | API-RATE-LIMIT | 5 | // +---------------------+---------+ GetPrivateFundingHistory(req *GetPrivateFundingHistoryReq, ctx context.Context) (*GetPrivateFundingHistoryResp, error) - - // GetCurrentFundingRate Get Current Funding Rate - // Description: get Current Funding Rate - // Documentation: https://www.kucoin.com/docs-new/api-3470265 - // +---------------------+---------+ - // | Extra API Info | Value | - // +---------------------+---------+ - // | API-DOMAIN | FUTURES | - // | API-CHANNEL | PRIVATE | - // | API-PERMISSION | FUTURES | - // | API-RATE-LIMIT-POOL | PUBLIC | - // | API-RATE-LIMIT | 2 | - // +---------------------+---------+ - GetCurrentFundingRate(req *GetCurrentFundingRateReq, ctx context.Context) (*GetCurrentFundingRateResp, error) } type FundingFeesAPIImpl struct { @@ -60,6 +60,12 @@ func NewFundingFeesAPIImp(transport interfaces.Transport) *FundingFeesAPIImpl { return &FundingFeesAPIImpl{transport: transport} } +func (impl *FundingFeesAPIImpl) GetCurrentFundingRate(req *GetCurrentFundingRateReq, ctx context.Context) (*GetCurrentFundingRateResp, error) { + resp := &GetCurrentFundingRateResp{} + err := impl.transport.Call(ctx, "futures", false, "Get", "/api/v1/funding-rate/{symbol}/current", req, resp, false) + return resp, err +} + func (impl *FundingFeesAPIImpl) GetPublicFundingHistory(req *GetPublicFundingHistoryReq, ctx context.Context) (*GetPublicFundingHistoryResp, error) { resp := &GetPublicFundingHistoryResp{} err := impl.transport.Call(ctx, "futures", false, "Get", "/api/v1/contract/funding-rates", req, resp, false) @@ -71,9 +77,3 @@ func (impl *FundingFeesAPIImpl) GetPrivateFundingHistory(req *GetPrivateFundingH err := impl.transport.Call(ctx, "futures", false, "Get", "/api/v1/funding-history", req, resp, false) return resp, err } - -func (impl *FundingFeesAPIImpl) GetCurrentFundingRate(req *GetCurrentFundingRateReq, ctx context.Context) (*GetCurrentFundingRateResp, error) { - resp := &GetCurrentFundingRateResp{} - err := impl.transport.Call(ctx, "futures", false, "Get", "/api/v1/funding-rate/{symbol}/current", req, resp, false) - return resp, err -} diff --git a/sdk/golang/pkg/generate/futures/fundingfees/api_funding_fees.template b/sdk/golang/pkg/generate/futures/fundingfees/api_funding_fees.template index 9509be7d..c109713e 100644 --- a/sdk/golang/pkg/generate/futures/fundingfees/api_funding_fees.template +++ b/sdk/golang/pkg/generate/futures/fundingfees/api_funding_fees.template @@ -1,16 +1,16 @@ # API FUNCTION TEMPLATE -func TestFundingFeesGetPublicFundingHistoryReq(t *testing.T) { - // GetPublicFundingHistory - // Get Public Funding History - // /api/v1/contract/funding-rates +func TestFundingFeesGetCurrentFundingRateReq(t *testing.T) { + // GetCurrentFundingRate + // Get Current Funding Rate + // /api/v1/funding-rate/{symbol}/current - builder := fundingfees.NewGetPublicFundingHistoryReqBuilder() - builder.SetSymbol(?).SetFrom(?).SetTo(?) + builder := fundingfees.NewGetCurrentFundingRateReqBuilder() + builder.SetSymbol(?) req := builder.Build() - resp, err := fundingfeesApi.GetPublicFundingHistory(req, context.TODO()) + resp, err := fundingfeesApi.GetCurrentFundingRate(req, context.TODO()) if err != nil { panic(err) } @@ -24,16 +24,16 @@ func TestFundingFeesGetPublicFundingHistoryReq(t *testing.T) { } -func TestFundingFeesGetPrivateFundingHistoryReq(t *testing.T) { - // GetPrivateFundingHistory - // Get Private Funding History - // /api/v1/funding-history +func TestFundingFeesGetPublicFundingHistoryReq(t *testing.T) { + // GetPublicFundingHistory + // Get Public Funding History + // /api/v1/contract/funding-rates - builder := fundingfees.NewGetPrivateFundingHistoryReqBuilder() - builder.SetSymbol(?).SetFrom(?).SetTo(?).SetReverse(?).SetOffset(?).SetForward(?).SetMaxCount(?) + builder := fundingfees.NewGetPublicFundingHistoryReqBuilder() + builder.SetSymbol(?).SetFrom(?).SetTo(?) req := builder.Build() - resp, err := fundingfeesApi.GetPrivateFundingHistory(req, context.TODO()) + resp, err := fundingfeesApi.GetPublicFundingHistory(req, context.TODO()) if err != nil { panic(err) } @@ -47,16 +47,16 @@ func TestFundingFeesGetPrivateFundingHistoryReq(t *testing.T) { } -func TestFundingFeesGetCurrentFundingRateReq(t *testing.T) { - // GetCurrentFundingRate - // Get Current Funding Rate - // /api/v1/funding-rate/{symbol}/current +func TestFundingFeesGetPrivateFundingHistoryReq(t *testing.T) { + // GetPrivateFundingHistory + // Get Private Funding History + // /api/v1/funding-history - builder := fundingfees.NewGetCurrentFundingRateReqBuilder() - builder.SetSymbol(?) + builder := fundingfees.NewGetPrivateFundingHistoryReqBuilder() + builder.SetSymbol(?).SetFrom(?).SetTo(?).SetReverse(?).SetOffset(?).SetForward(?).SetMaxCount(?) req := builder.Build() - resp, err := fundingfeesApi.GetCurrentFundingRate(req, context.TODO()) + resp, err := fundingfeesApi.GetPrivateFundingHistory(req, context.TODO()) if err != nil { panic(err) } diff --git a/sdk/golang/pkg/generate/futures/fundingfees/api_funding_fees_test.go b/sdk/golang/pkg/generate/futures/fundingfees/api_funding_fees_test.go index 5f602882..bf89e668 100644 --- a/sdk/golang/pkg/generate/futures/fundingfees/api_funding_fees_test.go +++ b/sdk/golang/pkg/generate/futures/fundingfees/api_funding_fees_test.go @@ -7,6 +7,34 @@ import ( "testing" ) +func TestFundingFeesGetCurrentFundingRateReqModel(t *testing.T) { + // GetCurrentFundingRate + // Get Current Funding Rate + // /api/v1/funding-rate/{symbol}/current + + data := "{\"symbol\": \"XBTUSDTM\"}" + req := &GetCurrentFundingRateReq{} + err := json.Unmarshal([]byte(data), req) + req.ToMap() + assert.Nil(t, err) +} + +func TestFundingFeesGetCurrentFundingRateRespModel(t *testing.T) { + // GetCurrentFundingRate + // Get Current Funding Rate + // /api/v1/funding-rate/{symbol}/current + + data := "{\n \"code\": \"200000\",\n \"data\": {\n \"symbol\": \".XBTUSDTMFPI8H\",\n \"granularity\": 28800000,\n \"timePoint\": 1731441600000,\n \"value\": 6.41E-4,\n \"predictedValue\": 5.2E-5,\n \"fundingRateCap\": 0.003,\n \"fundingRateFloor\": -0.003\n }\n}" + commonResp := &types.RestResponse{} + err := json.Unmarshal([]byte(data), commonResp) + assert.Nil(t, err) + assert.NotNil(t, commonResp.Data) + resp := &GetCurrentFundingRateResp{} + err = json.Unmarshal([]byte(commonResp.Data), resp) + resp.ToMap() + assert.Nil(t, err) +} + func TestFundingFeesGetPublicFundingHistoryReqModel(t *testing.T) { // GetPublicFundingHistory // Get Public Funding History @@ -62,31 +90,3 @@ func TestFundingFeesGetPrivateFundingHistoryRespModel(t *testing.T) { resp.ToMap() assert.Nil(t, err) } - -func TestFundingFeesGetCurrentFundingRateReqModel(t *testing.T) { - // GetCurrentFundingRate - // Get Current Funding Rate - // /api/v1/funding-rate/{symbol}/current - - data := "{\"symbol\": \"XBTUSDTM\"}" - req := &GetCurrentFundingRateReq{} - err := json.Unmarshal([]byte(data), req) - req.ToMap() - assert.Nil(t, err) -} - -func TestFundingFeesGetCurrentFundingRateRespModel(t *testing.T) { - // GetCurrentFundingRate - // Get Current Funding Rate - // /api/v1/funding-rate/{symbol}/current - - data := "{\n \"code\": \"200000\",\n \"data\": {\n \"symbol\": \".XBTUSDTMFPI8H\",\n \"granularity\": 28800000,\n \"timePoint\": 1731441600000,\n \"value\": 6.41E-4,\n \"predictedValue\": 5.2E-5,\n \"fundingRateCap\": 0.003,\n \"fundingRateFloor\": -0.003\n }\n}" - commonResp := &types.RestResponse{} - err := json.Unmarshal([]byte(data), commonResp) - assert.Nil(t, err) - assert.NotNil(t, commonResp.Data) - resp := &GetCurrentFundingRateResp{} - err = json.Unmarshal([]byte(commonResp.Data), resp) - resp.ToMap() - assert.Nil(t, err) -} diff --git a/sdk/golang/pkg/generate/futures/market/api_market.go b/sdk/golang/pkg/generate/futures/market/api_market.go index c635ff2c..bb31708f 100644 --- a/sdk/golang/pkg/generate/futures/market/api_market.go +++ b/sdk/golang/pkg/generate/futures/market/api_market.go @@ -9,9 +9,9 @@ import ( type MarketAPI interface { - // GetAllTickers Get All Tickers - // Description: This endpoint returns \"last traded price/size\"、\"best bid/ask price/size\" etc. of a single symbol. These messages can also be obtained through Websocket. - // Documentation: https://www.kucoin.com/docs-new/api-3470223 + // GetSymbol Get Symbol + // Description: Get information of specified contracts that can be traded. This API will return a list of tradable contracts, including some key parameters of the contract such as the symbol name, tick size, mark price,etc. + // Documentation: https://www.kucoin.com/docs-new/api-3470221 // +---------------------+---------+ // | Extra API Info | Value | // +---------------------+---------+ @@ -19,27 +19,27 @@ type MarketAPI interface { // | API-CHANNEL | PUBLIC | // | API-PERMISSION | NULL | // | API-RATE-LIMIT-POOL | PUBLIC | - // | API-RATE-LIMIT | 5 | + // | API-RATE-LIMIT | 3 | // +---------------------+---------+ - GetAllTickers(ctx context.Context) (*GetAllTickersResp, error) + GetSymbol(req *GetSymbolReq, ctx context.Context) (*GetSymbolResp, error) - // GetPrivateToken Get Private Token - Futures - // Description: This interface can obtain the token required for websocket to establish a Futures private connection. If you need use private channels(e.g. account balance notice), please make request as follows to obtain the server list and private token - // Documentation: https://www.kucoin.com/docs-new/api-3470296 + // GetAllSymbols Get All Symbols + // Description: Get detailed information of all contracts that can be traded. This API will return a list of tradable contracts, including some key parameters of the contract such as the symbol name, tick size, mark price,etc. + // Documentation: https://www.kucoin.com/docs-new/api-3470220 // +---------------------+---------+ // | Extra API Info | Value | // +---------------------+---------+ // | API-DOMAIN | FUTURES | - // | API-CHANNEL | PRIVATE | - // | API-PERMISSION | GENERAL | - // | API-RATE-LIMIT-POOL | FUTURES | - // | API-RATE-LIMIT | 10 | + // | API-CHANNEL | PUBLIC | + // | API-PERMISSION | NULL | + // | API-RATE-LIMIT-POOL | PUBLIC | + // | API-RATE-LIMIT | 3 | // +---------------------+---------+ - GetPrivateToken(ctx context.Context) (*GetPrivateTokenResp, error) + GetAllSymbols(ctx context.Context) (*GetAllSymbolsResp, error) - // GetPublicToken Get Public Token - Futures - // Description: This interface can obtain the token required for websocket to establish a Futures connection. If you need use public channels (e.g. all public market data), please make request as follows to obtain the server list and public token - // Documentation: https://www.kucoin.com/docs-new/api-3470297 + // GetTicker Get Ticker + // Description: This endpoint returns \"last traded price/size\"、\"best bid/ask price/size\" etc. of a single symbol. These messages can also be obtained through Websocket. + // Documentation: https://www.kucoin.com/docs-new/api-3470222 // +---------------------+---------+ // | Extra API Info | Value | // +---------------------+---------+ @@ -47,13 +47,13 @@ type MarketAPI interface { // | API-CHANNEL | PUBLIC | // | API-PERMISSION | NULL | // | API-RATE-LIMIT-POOL | PUBLIC | - // | API-RATE-LIMIT | 10 | + // | API-RATE-LIMIT | 2 | // +---------------------+---------+ - GetPublicToken(ctx context.Context) (*GetPublicTokenResp, error) + GetTicker(req *GetTickerReq, ctx context.Context) (*GetTickerResp, error) - // GetAllSymbols Get All Symbols - // Description: Get detailed information of all contracts that can be traded. This API will return a list of tradable contracts, including some key parameters of the contract such as the symbol name, tick size, mark price,etc. - // Documentation: https://www.kucoin.com/docs-new/api-3470220 + // GetAllTickers Get All Tickers + // Description: This endpoint returns \"last traded price/size\"、\"best bid/ask price/size\" etc. of a single symbol. These messages can also be obtained through Websocket. + // Documentation: https://www.kucoin.com/docs-new/api-3470223 // +---------------------+---------+ // | Extra API Info | Value | // +---------------------+---------+ @@ -61,13 +61,13 @@ type MarketAPI interface { // | API-CHANNEL | PUBLIC | // | API-PERMISSION | NULL | // | API-RATE-LIMIT-POOL | PUBLIC | - // | API-RATE-LIMIT | 3 | + // | API-RATE-LIMIT | 5 | // +---------------------+---------+ - GetAllSymbols(ctx context.Context) (*GetAllSymbolsResp, error) + GetAllTickers(ctx context.Context) (*GetAllTickersResp, error) - // GetSymbol Get Symbol - // Description: Get information of specified contracts that can be traded. This API will return a list of tradable contracts, including some key parameters of the contract such as the symbol name, tick size, mark price,etc. - // Documentation: https://www.kucoin.com/docs-new/api-3470221 + // GetFullOrderBook Get Full OrderBook + // Description: Query for Full orderbook depth data. (aggregated by price) It is generally used by professional traders because it uses more server resources and traffic, and we have strict access rate limit control. To maintain up-to-date Order Book, please use Websocket incremental feed after retrieving the OrderBook. + // Documentation: https://www.kucoin.com/docs-new/api-3470224 // +---------------------+---------+ // | Extra API Info | Value | // +---------------------+---------+ @@ -77,11 +77,11 @@ type MarketAPI interface { // | API-RATE-LIMIT-POOL | PUBLIC | // | API-RATE-LIMIT | 3 | // +---------------------+---------+ - GetSymbol(req *GetSymbolReq, ctx context.Context) (*GetSymbolResp, error) + GetFullOrderBook(req *GetFullOrderBookReq, ctx context.Context) (*GetFullOrderBookResp, error) - // GetSpotIndexPrice Get Spot Index Price - // Description: Get Spot Index Price - // Documentation: https://www.kucoin.com/docs-new/api-3470231 + // GetPartOrderBook Get Part OrderBook + // Description: Query for part orderbook depth data. (aggregated by price) You are recommended to request via this endpoint as the system reponse would be faster and cosume less traffic. + // Documentation: https://www.kucoin.com/docs-new/api-3470225 // +---------------------+---------+ // | Extra API Info | Value | // +---------------------+---------+ @@ -89,13 +89,13 @@ type MarketAPI interface { // | API-CHANNEL | PUBLIC | // | API-PERMISSION | NULL | // | API-RATE-LIMIT-POOL | PUBLIC | - // | API-RATE-LIMIT | 2 | + // | API-RATE-LIMIT | 5 | // +---------------------+---------+ - GetSpotIndexPrice(req *GetSpotIndexPriceReq, ctx context.Context) (*GetSpotIndexPriceResp, error) + GetPartOrderBook(req *GetPartOrderBookReq, ctx context.Context) (*GetPartOrderBookResp, error) - // GetInterestRateIndex Get Interest Rate Index - // Description: Get interest rate Index. - // Documentation: https://www.kucoin.com/docs-new/api-3470226 + // GetTradeHistory Get Trade History + // Description: Request via this endpoint to get the trade history of the specified symbol, the returned quantity is the last 100 transaction records. + // Documentation: https://www.kucoin.com/docs-new/api-3470232 // +---------------------+---------+ // | Extra API Info | Value | // +---------------------+---------+ @@ -105,7 +105,7 @@ type MarketAPI interface { // | API-RATE-LIMIT-POOL | PUBLIC | // | API-RATE-LIMIT | 5 | // +---------------------+---------+ - GetInterestRateIndex(req *GetInterestRateIndexReq, ctx context.Context) (*GetInterestRateIndexResp, error) + GetTradeHistory(req *GetTradeHistoryReq, ctx context.Context) (*GetTradeHistoryResp, error) // GetKlines Get Klines // Description: Get the Kline of the symbol. Data are returned in grouped buckets based on requested type. For each query, the system would return at most 500 pieces of data. To obtain more data, please page the data by time. @@ -121,9 +121,9 @@ type MarketAPI interface { // +---------------------+---------+ GetKlines(req *GetKlinesReq, ctx context.Context) (*GetKlinesResp, error) - // GetPartOrderBook Get Part OrderBook - // Description: Query for part orderbook depth data. (aggregated by price) You are recommended to request via this endpoint as the system reponse would be faster and cosume less traffic. - // Documentation: https://www.kucoin.com/docs-new/api-3470225 + // GetMarkPrice Get Mark Price + // Description: Get current mark price + // Documentation: https://www.kucoin.com/docs-new/api-3470233 // +---------------------+---------+ // | Extra API Info | Value | // +---------------------+---------+ @@ -131,13 +131,13 @@ type MarketAPI interface { // | API-CHANNEL | PUBLIC | // | API-PERMISSION | NULL | // | API-RATE-LIMIT-POOL | PUBLIC | - // | API-RATE-LIMIT | 5 | + // | API-RATE-LIMIT | 3 | // +---------------------+---------+ - GetPartOrderBook(req *GetPartOrderBookReq, ctx context.Context) (*GetPartOrderBookResp, error) + GetMarkPrice(req *GetMarkPriceReq, ctx context.Context) (*GetMarkPriceResp, error) - // GetFullOrderBook Get Full OrderBook - // Description: Query for Full orderbook depth data. (aggregated by price) It is generally used by professional traders because it uses more server resources and traffic, and we have strict access rate limit control. To maintain up-to-date Order Book, please use Websocket incremental feed after retrieving the OrderBook. - // Documentation: https://www.kucoin.com/docs-new/api-3470224 + // GetSpotIndexPrice Get Spot Index Price + // Description: Get Spot Index Price + // Documentation: https://www.kucoin.com/docs-new/api-3470231 // +---------------------+---------+ // | Extra API Info | Value | // +---------------------+---------+ @@ -145,13 +145,13 @@ type MarketAPI interface { // | API-CHANNEL | PUBLIC | // | API-PERMISSION | NULL | // | API-RATE-LIMIT-POOL | PUBLIC | - // | API-RATE-LIMIT | 3 | + // | API-RATE-LIMIT | 2 | // +---------------------+---------+ - GetFullOrderBook(req *GetFullOrderBookReq, ctx context.Context) (*GetFullOrderBookResp, error) + GetSpotIndexPrice(req *GetSpotIndexPriceReq, ctx context.Context) (*GetSpotIndexPriceResp, error) - // GetMarkPrice Get Mark Price - // Description: Get current mark price - // Documentation: https://www.kucoin.com/docs-new/api-3470233 + // GetInterestRateIndex Get Interest Rate Index + // Description: Get interest rate Index. + // Documentation: https://www.kucoin.com/docs-new/api-3470226 // +---------------------+---------+ // | Extra API Info | Value | // +---------------------+---------+ @@ -159,9 +159,9 @@ type MarketAPI interface { // | API-CHANNEL | PUBLIC | // | API-PERMISSION | NULL | // | API-RATE-LIMIT-POOL | PUBLIC | - // | API-RATE-LIMIT | 3 | + // | API-RATE-LIMIT | 5 | // +---------------------+---------+ - GetMarkPrice(req *GetMarkPriceReq, ctx context.Context) (*GetMarkPriceResp, error) + GetInterestRateIndex(req *GetInterestRateIndexReq, ctx context.Context) (*GetInterestRateIndexResp, error) // GetPremiumIndex Get Premium Index // Description: Submit request to get premium index. @@ -177,23 +177,23 @@ type MarketAPI interface { // +---------------------+---------+ GetPremiumIndex(req *GetPremiumIndexReq, ctx context.Context) (*GetPremiumIndexResp, error) - // GetServiceStatus Get Service Status - // Description: Get the service status. - // Documentation: https://www.kucoin.com/docs-new/api-3470230 + // Get24hrStats Get 24hr Stats + // Description: Get the statistics of the platform futures trading volume in the last 24 hours. + // Documentation: https://www.kucoin.com/docs-new/api-3470228 // +---------------------+---------+ // | Extra API Info | Value | // +---------------------+---------+ // | API-DOMAIN | FUTURES | // | API-CHANNEL | PUBLIC | // | API-PERMISSION | NULL | - // | API-RATE-LIMIT-POOL | PUBLIC | - // | API-RATE-LIMIT | 4 | + // | API-RATE-LIMIT-POOL | FUTURES | + // | API-RATE-LIMIT | 3 | // +---------------------+---------+ - GetServiceStatus(ctx context.Context) (*GetServiceStatusResp, error) + Get24hrStats(ctx context.Context) (*Get24hrStatsResp, error) - // GetTicker Get Ticker - // Description: This endpoint returns \"last traded price/size\"、\"best bid/ask price/size\" etc. of a single symbol. These messages can also be obtained through Websocket. - // Documentation: https://www.kucoin.com/docs-new/api-3470222 + // GetServerTime Get Server Time + // Description: Get the API server time. This is the Unix timestamp. + // Documentation: https://www.kucoin.com/docs-new/api-3470229 // +---------------------+---------+ // | Extra API Info | Value | // +---------------------+---------+ @@ -203,11 +203,11 @@ type MarketAPI interface { // | API-RATE-LIMIT-POOL | PUBLIC | // | API-RATE-LIMIT | 2 | // +---------------------+---------+ - GetTicker(req *GetTickerReq, ctx context.Context) (*GetTickerResp, error) + GetServerTime(ctx context.Context) (*GetServerTimeResp, error) - // GetServerTime Get Server Time - // Description: Get the API server time. This is the Unix timestamp. - // Documentation: https://www.kucoin.com/docs-new/api-3470229 + // GetServiceStatus Get Service Status + // Description: Get the service status. + // Documentation: https://www.kucoin.com/docs-new/api-3470230 // +---------------------+---------+ // | Extra API Info | Value | // +---------------------+---------+ @@ -215,13 +215,13 @@ type MarketAPI interface { // | API-CHANNEL | PUBLIC | // | API-PERMISSION | NULL | // | API-RATE-LIMIT-POOL | PUBLIC | - // | API-RATE-LIMIT | 2 | + // | API-RATE-LIMIT | 4 | // +---------------------+---------+ - GetServerTime(ctx context.Context) (*GetServerTimeResp, error) + GetServiceStatus(ctx context.Context) (*GetServiceStatusResp, error) - // GetTradeHistory Get Trade History - // Description: Request via this endpoint to get the trade history of the specified symbol, the returned quantity is the last 100 transaction records. - // Documentation: https://www.kucoin.com/docs-new/api-3470232 + // GetPublicToken Get Public Token - Futures + // Description: This interface can obtain the token required for websocket to establish a Futures connection. If you need use public channels (e.g. all public market data), please make request as follows to obtain the server list and public token + // Documentation: https://www.kucoin.com/docs-new/api-3470297 // +---------------------+---------+ // | Extra API Info | Value | // +---------------------+---------+ @@ -229,23 +229,23 @@ type MarketAPI interface { // | API-CHANNEL | PUBLIC | // | API-PERMISSION | NULL | // | API-RATE-LIMIT-POOL | PUBLIC | - // | API-RATE-LIMIT | 5 | + // | API-RATE-LIMIT | 10 | // +---------------------+---------+ - GetTradeHistory(req *GetTradeHistoryReq, ctx context.Context) (*GetTradeHistoryResp, error) + GetPublicToken(ctx context.Context) (*GetPublicTokenResp, error) - // Get24hrStats Get 24hr Stats - // Description: Get the statistics of the platform futures trading volume in the last 24 hours. - // Documentation: https://www.kucoin.com/docs-new/api-3470228 + // GetPrivateToken Get Private Token - Futures + // Description: This interface can obtain the token required for websocket to establish a Futures private connection. If you need use private channels(e.g. account balance notice), please make request as follows to obtain the server list and private token + // Documentation: https://www.kucoin.com/docs-new/api-3470296 // +---------------------+---------+ // | Extra API Info | Value | // +---------------------+---------+ // | API-DOMAIN | FUTURES | - // | API-CHANNEL | PUBLIC | - // | API-PERMISSION | NULL | + // | API-CHANNEL | PRIVATE | + // | API-PERMISSION | GENERAL | // | API-RATE-LIMIT-POOL | FUTURES | - // | API-RATE-LIMIT | 3 | + // | API-RATE-LIMIT | 10 | // +---------------------+---------+ - Get24hrStats(ctx context.Context) (*Get24hrStatsResp, error) + GetPrivateToken(ctx context.Context) (*GetPrivateTokenResp, error) } type MarketAPIImpl struct { @@ -256,45 +256,45 @@ func NewMarketAPIImp(transport interfaces.Transport) *MarketAPIImpl { return &MarketAPIImpl{transport: transport} } -func (impl *MarketAPIImpl) GetAllTickers(ctx context.Context) (*GetAllTickersResp, error) { - resp := &GetAllTickersResp{} - err := impl.transport.Call(ctx, "futures", false, "Get", "/api/v1/allTickers", nil, resp, false) +func (impl *MarketAPIImpl) GetSymbol(req *GetSymbolReq, ctx context.Context) (*GetSymbolResp, error) { + resp := &GetSymbolResp{} + err := impl.transport.Call(ctx, "futures", false, "Get", "/api/v1/contracts/{symbol}", req, resp, false) return resp, err } -func (impl *MarketAPIImpl) GetPrivateToken(ctx context.Context) (*GetPrivateTokenResp, error) { - resp := &GetPrivateTokenResp{} - err := impl.transport.Call(ctx, "futures", false, "Post", "/api/v1/bullet-private", nil, resp, false) +func (impl *MarketAPIImpl) GetAllSymbols(ctx context.Context) (*GetAllSymbolsResp, error) { + resp := &GetAllSymbolsResp{} + err := impl.transport.Call(ctx, "futures", false, "Get", "/api/v1/contracts/active", nil, resp, false) return resp, err } -func (impl *MarketAPIImpl) GetPublicToken(ctx context.Context) (*GetPublicTokenResp, error) { - resp := &GetPublicTokenResp{} - err := impl.transport.Call(ctx, "futures", false, "Post", "/api/v1/bullet-public", nil, resp, false) +func (impl *MarketAPIImpl) GetTicker(req *GetTickerReq, ctx context.Context) (*GetTickerResp, error) { + resp := &GetTickerResp{} + err := impl.transport.Call(ctx, "futures", false, "Get", "/api/v1/ticker", req, resp, false) return resp, err } -func (impl *MarketAPIImpl) GetAllSymbols(ctx context.Context) (*GetAllSymbolsResp, error) { - resp := &GetAllSymbolsResp{} - err := impl.transport.Call(ctx, "futures", false, "Get", "/api/v1/contracts/active", nil, resp, false) +func (impl *MarketAPIImpl) GetAllTickers(ctx context.Context) (*GetAllTickersResp, error) { + resp := &GetAllTickersResp{} + err := impl.transport.Call(ctx, "futures", false, "Get", "/api/v1/allTickers", nil, resp, false) return resp, err } -func (impl *MarketAPIImpl) GetSymbol(req *GetSymbolReq, ctx context.Context) (*GetSymbolResp, error) { - resp := &GetSymbolResp{} - err := impl.transport.Call(ctx, "futures", false, "Get", "/api/v1/contracts/{symbol}", req, resp, false) +func (impl *MarketAPIImpl) GetFullOrderBook(req *GetFullOrderBookReq, ctx context.Context) (*GetFullOrderBookResp, error) { + resp := &GetFullOrderBookResp{} + err := impl.transport.Call(ctx, "futures", false, "Get", "/api/v1/level2/snapshot", req, resp, false) return resp, err } -func (impl *MarketAPIImpl) GetSpotIndexPrice(req *GetSpotIndexPriceReq, ctx context.Context) (*GetSpotIndexPriceResp, error) { - resp := &GetSpotIndexPriceResp{} - err := impl.transport.Call(ctx, "futures", false, "Get", "/api/v1/index/query", req, resp, false) +func (impl *MarketAPIImpl) GetPartOrderBook(req *GetPartOrderBookReq, ctx context.Context) (*GetPartOrderBookResp, error) { + resp := &GetPartOrderBookResp{} + err := impl.transport.Call(ctx, "futures", false, "Get", "/api/v1/level2/depth{size}", req, resp, false) return resp, err } -func (impl *MarketAPIImpl) GetInterestRateIndex(req *GetInterestRateIndexReq, ctx context.Context) (*GetInterestRateIndexResp, error) { - resp := &GetInterestRateIndexResp{} - err := impl.transport.Call(ctx, "futures", false, "Get", "/api/v1/interest/query", req, resp, false) +func (impl *MarketAPIImpl) GetTradeHistory(req *GetTradeHistoryReq, ctx context.Context) (*GetTradeHistoryResp, error) { + resp := &GetTradeHistoryResp{} + err := impl.transport.Call(ctx, "futures", false, "Get", "/api/v1/trade/history", req, resp, false) return resp, err } @@ -304,21 +304,21 @@ func (impl *MarketAPIImpl) GetKlines(req *GetKlinesReq, ctx context.Context) (*G return resp, err } -func (impl *MarketAPIImpl) GetPartOrderBook(req *GetPartOrderBookReq, ctx context.Context) (*GetPartOrderBookResp, error) { - resp := &GetPartOrderBookResp{} - err := impl.transport.Call(ctx, "futures", false, "Get", "/api/v1/level2/depth{size}", req, resp, false) +func (impl *MarketAPIImpl) GetMarkPrice(req *GetMarkPriceReq, ctx context.Context) (*GetMarkPriceResp, error) { + resp := &GetMarkPriceResp{} + err := impl.transport.Call(ctx, "futures", false, "Get", "/api/v1/mark-price/{symbol}/current", req, resp, false) return resp, err } -func (impl *MarketAPIImpl) GetFullOrderBook(req *GetFullOrderBookReq, ctx context.Context) (*GetFullOrderBookResp, error) { - resp := &GetFullOrderBookResp{} - err := impl.transport.Call(ctx, "futures", false, "Get", "/api/v1/level2/snapshot", req, resp, false) +func (impl *MarketAPIImpl) GetSpotIndexPrice(req *GetSpotIndexPriceReq, ctx context.Context) (*GetSpotIndexPriceResp, error) { + resp := &GetSpotIndexPriceResp{} + err := impl.transport.Call(ctx, "futures", false, "Get", "/api/v1/index/query", req, resp, false) return resp, err } -func (impl *MarketAPIImpl) GetMarkPrice(req *GetMarkPriceReq, ctx context.Context) (*GetMarkPriceResp, error) { - resp := &GetMarkPriceResp{} - err := impl.transport.Call(ctx, "futures", false, "Get", "/api/v1/mark-price/{symbol}/current", req, resp, false) +func (impl *MarketAPIImpl) GetInterestRateIndex(req *GetInterestRateIndexReq, ctx context.Context) (*GetInterestRateIndexResp, error) { + resp := &GetInterestRateIndexResp{} + err := impl.transport.Call(ctx, "futures", false, "Get", "/api/v1/interest/query", req, resp, false) return resp, err } @@ -328,15 +328,9 @@ func (impl *MarketAPIImpl) GetPremiumIndex(req *GetPremiumIndexReq, ctx context. return resp, err } -func (impl *MarketAPIImpl) GetServiceStatus(ctx context.Context) (*GetServiceStatusResp, error) { - resp := &GetServiceStatusResp{} - err := impl.transport.Call(ctx, "futures", false, "Get", "/api/v1/status", nil, resp, false) - return resp, err -} - -func (impl *MarketAPIImpl) GetTicker(req *GetTickerReq, ctx context.Context) (*GetTickerResp, error) { - resp := &GetTickerResp{} - err := impl.transport.Call(ctx, "futures", false, "Get", "/api/v1/ticker", req, resp, false) +func (impl *MarketAPIImpl) Get24hrStats(ctx context.Context) (*Get24hrStatsResp, error) { + resp := &Get24hrStatsResp{} + err := impl.transport.Call(ctx, "futures", false, "Get", "/api/v1/trade-statistics", nil, resp, false) return resp, err } @@ -346,14 +340,20 @@ func (impl *MarketAPIImpl) GetServerTime(ctx context.Context) (*GetServerTimeRes return resp, err } -func (impl *MarketAPIImpl) GetTradeHistory(req *GetTradeHistoryReq, ctx context.Context) (*GetTradeHistoryResp, error) { - resp := &GetTradeHistoryResp{} - err := impl.transport.Call(ctx, "futures", false, "Get", "/api/v1/trade/history", req, resp, false) +func (impl *MarketAPIImpl) GetServiceStatus(ctx context.Context) (*GetServiceStatusResp, error) { + resp := &GetServiceStatusResp{} + err := impl.transport.Call(ctx, "futures", false, "Get", "/api/v1/status", nil, resp, false) return resp, err } -func (impl *MarketAPIImpl) Get24hrStats(ctx context.Context) (*Get24hrStatsResp, error) { - resp := &Get24hrStatsResp{} - err := impl.transport.Call(ctx, "futures", false, "Get", "/api/v1/trade-statistics", nil, resp, false) +func (impl *MarketAPIImpl) GetPublicToken(ctx context.Context) (*GetPublicTokenResp, error) { + resp := &GetPublicTokenResp{} + err := impl.transport.Call(ctx, "futures", false, "Post", "/api/v1/bullet-public", nil, resp, false) + return resp, err +} + +func (impl *MarketAPIImpl) GetPrivateToken(ctx context.Context) (*GetPrivateTokenResp, error) { + resp := &GetPrivateTokenResp{} + err := impl.transport.Call(ctx, "futures", false, "Post", "/api/v1/bullet-private", nil, resp, false) return resp, err } diff --git a/sdk/golang/pkg/generate/futures/market/api_market.template b/sdk/golang/pkg/generate/futures/market/api_market.template index 5abd76c4..c0581c56 100644 --- a/sdk/golang/pkg/generate/futures/market/api_market.template +++ b/sdk/golang/pkg/generate/futures/market/api_market.template @@ -1,13 +1,16 @@ # API FUNCTION TEMPLATE -func TestMarketGetAllTickersReq(t *testing.T) { - // GetAllTickers - // Get All Tickers - // /api/v1/allTickers +func TestMarketGetSymbolReq(t *testing.T) { + // GetSymbol + // Get Symbol + // /api/v1/contracts/{symbol} + builder := market.NewGetSymbolReqBuilder() + builder.SetSymbol(?) + req := builder.Build() - resp, err := marketApi.GetAllTickers(context.TODO()) + resp, err := marketApi.GetSymbol(req, context.TODO()) if err != nil { panic(err) } @@ -21,13 +24,13 @@ func TestMarketGetAllTickersReq(t *testing.T) { } -func TestMarketGetPrivateTokenReq(t *testing.T) { - // GetPrivateToken - // Get Private Token - Futures - // /api/v1/bullet-private +func TestMarketGetAllSymbolsReq(t *testing.T) { + // GetAllSymbols + // Get All Symbols + // /api/v1/contracts/active - resp, err := marketApi.GetPrivateToken(context.TODO()) + resp, err := marketApi.GetAllSymbols(context.TODO()) if err != nil { panic(err) } @@ -41,13 +44,16 @@ func TestMarketGetPrivateTokenReq(t *testing.T) { } -func TestMarketGetPublicTokenReq(t *testing.T) { - // GetPublicToken - // Get Public Token - Futures - // /api/v1/bullet-public +func TestMarketGetTickerReq(t *testing.T) { + // GetTicker + // Get Ticker + // /api/v1/ticker + builder := market.NewGetTickerReqBuilder() + builder.SetSymbol(?) + req := builder.Build() - resp, err := marketApi.GetPublicToken(context.TODO()) + resp, err := marketApi.GetTicker(req, context.TODO()) if err != nil { panic(err) } @@ -61,13 +67,13 @@ func TestMarketGetPublicTokenReq(t *testing.T) { } -func TestMarketGetAllSymbolsReq(t *testing.T) { - // GetAllSymbols - // Get All Symbols - // /api/v1/contracts/active +func TestMarketGetAllTickersReq(t *testing.T) { + // GetAllTickers + // Get All Tickers + // /api/v1/allTickers - resp, err := marketApi.GetAllSymbols(context.TODO()) + resp, err := marketApi.GetAllTickers(context.TODO()) if err != nil { panic(err) } @@ -81,16 +87,16 @@ func TestMarketGetAllSymbolsReq(t *testing.T) { } -func TestMarketGetSymbolReq(t *testing.T) { - // GetSymbol - // Get Symbol - // /api/v1/contracts/{symbol} +func TestMarketGetFullOrderBookReq(t *testing.T) { + // GetFullOrderBook + // Get Full OrderBook + // /api/v1/level2/snapshot - builder := market.NewGetSymbolReqBuilder() + builder := market.NewGetFullOrderBookReqBuilder() builder.SetSymbol(?) req := builder.Build() - resp, err := marketApi.GetSymbol(req, context.TODO()) + resp, err := marketApi.GetFullOrderBook(req, context.TODO()) if err != nil { panic(err) } @@ -104,16 +110,16 @@ func TestMarketGetSymbolReq(t *testing.T) { } -func TestMarketGetSpotIndexPriceReq(t *testing.T) { - // GetSpotIndexPrice - // Get Spot Index Price - // /api/v1/index/query +func TestMarketGetPartOrderBookReq(t *testing.T) { + // GetPartOrderBook + // Get Part OrderBook + // /api/v1/level2/depth{size} - builder := market.NewGetSpotIndexPriceReqBuilder() - builder.SetSymbol(?).SetStartAt(?).SetEndAt(?).SetReverse(?).SetOffset(?).SetForward(?).SetMaxCount(?) + builder := market.NewGetPartOrderBookReqBuilder() + builder.SetSymbol(?).SetSize(?) req := builder.Build() - resp, err := marketApi.GetSpotIndexPrice(req, context.TODO()) + resp, err := marketApi.GetPartOrderBook(req, context.TODO()) if err != nil { panic(err) } @@ -127,16 +133,16 @@ func TestMarketGetSpotIndexPriceReq(t *testing.T) { } -func TestMarketGetInterestRateIndexReq(t *testing.T) { - // GetInterestRateIndex - // Get Interest Rate Index - // /api/v1/interest/query +func TestMarketGetTradeHistoryReq(t *testing.T) { + // GetTradeHistory + // Get Trade History + // /api/v1/trade/history - builder := market.NewGetInterestRateIndexReqBuilder() - builder.SetSymbol(?).SetStartAt(?).SetEndAt(?).SetReverse(?).SetOffset(?).SetForward(?).SetMaxCount(?) + builder := market.NewGetTradeHistoryReqBuilder() + builder.SetSymbol(?) req := builder.Build() - resp, err := marketApi.GetInterestRateIndex(req, context.TODO()) + resp, err := marketApi.GetTradeHistory(req, context.TODO()) if err != nil { panic(err) } @@ -173,16 +179,16 @@ func TestMarketGetKlinesReq(t *testing.T) { } -func TestMarketGetPartOrderBookReq(t *testing.T) { - // GetPartOrderBook - // Get Part OrderBook - // /api/v1/level2/depth{size} +func TestMarketGetMarkPriceReq(t *testing.T) { + // GetMarkPrice + // Get Mark Price + // /api/v1/mark-price/{symbol}/current - builder := market.NewGetPartOrderBookReqBuilder() - builder.SetSymbol(?).SetSize(?) + builder := market.NewGetMarkPriceReqBuilder() + builder.SetSymbol(?) req := builder.Build() - resp, err := marketApi.GetPartOrderBook(req, context.TODO()) + resp, err := marketApi.GetMarkPrice(req, context.TODO()) if err != nil { panic(err) } @@ -196,16 +202,16 @@ func TestMarketGetPartOrderBookReq(t *testing.T) { } -func TestMarketGetFullOrderBookReq(t *testing.T) { - // GetFullOrderBook - // Get Full OrderBook - // /api/v1/level2/snapshot +func TestMarketGetSpotIndexPriceReq(t *testing.T) { + // GetSpotIndexPrice + // Get Spot Index Price + // /api/v1/index/query - builder := market.NewGetFullOrderBookReqBuilder() - builder.SetSymbol(?) + builder := market.NewGetSpotIndexPriceReqBuilder() + builder.SetSymbol(?).SetStartAt(?).SetEndAt(?).SetReverse(?).SetOffset(?).SetForward(?).SetMaxCount(?) req := builder.Build() - resp, err := marketApi.GetFullOrderBook(req, context.TODO()) + resp, err := marketApi.GetSpotIndexPrice(req, context.TODO()) if err != nil { panic(err) } @@ -219,16 +225,16 @@ func TestMarketGetFullOrderBookReq(t *testing.T) { } -func TestMarketGetMarkPriceReq(t *testing.T) { - // GetMarkPrice - // Get Mark Price - // /api/v1/mark-price/{symbol}/current +func TestMarketGetInterestRateIndexReq(t *testing.T) { + // GetInterestRateIndex + // Get Interest Rate Index + // /api/v1/interest/query - builder := market.NewGetMarkPriceReqBuilder() - builder.SetSymbol(?) + builder := market.NewGetInterestRateIndexReqBuilder() + builder.SetSymbol(?).SetStartAt(?).SetEndAt(?).SetReverse(?).SetOffset(?).SetForward(?).SetMaxCount(?) req := builder.Build() - resp, err := marketApi.GetMarkPrice(req, context.TODO()) + resp, err := marketApi.GetInterestRateIndex(req, context.TODO()) if err != nil { panic(err) } @@ -265,13 +271,13 @@ func TestMarketGetPremiumIndexReq(t *testing.T) { } -func TestMarketGetServiceStatusReq(t *testing.T) { - // GetServiceStatus - // Get Service Status - // /api/v1/status +func TestMarketGet24hrStatsReq(t *testing.T) { + // Get24hrStats + // Get 24hr Stats + // /api/v1/trade-statistics - resp, err := marketApi.GetServiceStatus(context.TODO()) + resp, err := marketApi.Get24hrStats(context.TODO()) if err != nil { panic(err) } @@ -285,16 +291,13 @@ func TestMarketGetServiceStatusReq(t *testing.T) { } -func TestMarketGetTickerReq(t *testing.T) { - // GetTicker - // Get Ticker - // /api/v1/ticker +func TestMarketGetServerTimeReq(t *testing.T) { + // GetServerTime + // Get Server Time + // /api/v1/timestamp - builder := market.NewGetTickerReqBuilder() - builder.SetSymbol(?) - req := builder.Build() - resp, err := marketApi.GetTicker(req, context.TODO()) + resp, err := marketApi.GetServerTime(context.TODO()) if err != nil { panic(err) } @@ -308,13 +311,13 @@ func TestMarketGetTickerReq(t *testing.T) { } -func TestMarketGetServerTimeReq(t *testing.T) { - // GetServerTime - // Get Server Time - // /api/v1/timestamp +func TestMarketGetServiceStatusReq(t *testing.T) { + // GetServiceStatus + // Get Service Status + // /api/v1/status - resp, err := marketApi.GetServerTime(context.TODO()) + resp, err := marketApi.GetServiceStatus(context.TODO()) if err != nil { panic(err) } @@ -328,16 +331,13 @@ func TestMarketGetServerTimeReq(t *testing.T) { } -func TestMarketGetTradeHistoryReq(t *testing.T) { - // GetTradeHistory - // Get Trade History - // /api/v1/trade/history +func TestMarketGetPublicTokenReq(t *testing.T) { + // GetPublicToken + // Get Public Token - Futures + // /api/v1/bullet-public - builder := market.NewGetTradeHistoryReqBuilder() - builder.SetSymbol(?) - req := builder.Build() - resp, err := marketApi.GetTradeHistory(req, context.TODO()) + resp, err := marketApi.GetPublicToken(context.TODO()) if err != nil { panic(err) } @@ -351,13 +351,13 @@ func TestMarketGetTradeHistoryReq(t *testing.T) { } -func TestMarketGet24hrStatsReq(t *testing.T) { - // Get24hrStats - // Get 24hr Stats - // /api/v1/trade-statistics +func TestMarketGetPrivateTokenReq(t *testing.T) { + // GetPrivateToken + // Get Private Token - Futures + // /api/v1/bullet-private - resp, err := marketApi.Get24hrStats(context.TODO()) + resp, err := marketApi.GetPrivateToken(context.TODO()) if err != nil { panic(err) } diff --git a/sdk/golang/pkg/generate/futures/market/api_market_test.go b/sdk/golang/pkg/generate/futures/market/api_market_test.go index 2d984189..68cfef8c 100644 --- a/sdk/golang/pkg/generate/futures/market/api_market_test.go +++ b/sdk/golang/pkg/generate/futures/market/api_market_test.go @@ -7,177 +7,187 @@ import ( "testing" ) -func TestMarketGetAllTickersReqModel(t *testing.T) { - // GetAllTickers - // Get All Tickers - // /api/v1/allTickers +func TestMarketGetSymbolReqModel(t *testing.T) { + // GetSymbol + // Get Symbol + // /api/v1/contracts/{symbol} + data := "{\"symbol\": \"XBTUSDTM\"}" + req := &GetSymbolReq{} + err := json.Unmarshal([]byte(data), req) + req.ToMap() + assert.Nil(t, err) } -func TestMarketGetAllTickersRespModel(t *testing.T) { - // GetAllTickers - // Get All Tickers - // /api/v1/allTickers +func TestMarketGetSymbolRespModel(t *testing.T) { + // GetSymbol + // Get Symbol + // /api/v1/contracts/{symbol} - data := "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"sequence\": 1707992727046,\n \"symbol\": \"XBTUSDTM\",\n \"side\": \"sell\",\n \"size\": 21,\n \"tradeId\": \"1784299761369\",\n \"price\": \"67153\",\n \"bestBidPrice\": \"67153\",\n \"bestBidSize\": 2767,\n \"bestAskPrice\": \"67153.1\",\n \"bestAskSize\": 5368,\n \"ts\": 1729163466659000000\n },\n {\n \"sequence\": 1697895166299,\n \"symbol\": \"XBTUSDM\",\n \"side\": \"sell\",\n \"size\": 1956,\n \"tradeId\": \"1697901245065\",\n \"price\": \"67145.2\",\n \"bestBidPrice\": \"67135.3\",\n \"bestBidSize\": 1,\n \"bestAskPrice\": \"67135.8\",\n \"bestAskSize\": 3,\n \"ts\": 1729163445340000000\n }\n ]\n}" + data := "{\n \"code\": \"200000\",\n \"data\": {\n \"symbol\": \"XBTUSDM\",\n \"rootSymbol\": \"XBT\",\n \"type\": \"FFWCSX\",\n \"firstOpenDate\": 1552638575000,\n \"expireDate\": null,\n \"settleDate\": null,\n \"baseCurrency\": \"XBT\",\n \"quoteCurrency\": \"USD\",\n \"settleCurrency\": \"XBT\",\n \"maxOrderQty\": 10000000,\n \"maxPrice\": 1000000.0,\n \"lotSize\": 1,\n \"tickSize\": 0.1,\n \"indexPriceTickSize\": 0.1,\n \"multiplier\": -1.0,\n \"initialMargin\": 0.014,\n \"maintainMargin\": 0.007,\n \"maxRiskLimit\": 1,\n \"minRiskLimit\": 1,\n \"riskStep\": 0,\n \"makerFeeRate\": 2.0E-4,\n \"takerFeeRate\": 6.0E-4,\n \"takerFixFee\": 0.0,\n \"makerFixFee\": 0.0,\n \"settlementFee\": null,\n \"isDeleverage\": true,\n \"isQuanto\": false,\n \"isInverse\": true,\n \"markMethod\": \"FairPrice\",\n \"fairMethod\": \"FundingRate\",\n \"fundingBaseSymbol\": \".XBTINT8H\",\n \"fundingQuoteSymbol\": \".USDINT8H\",\n \"fundingRateSymbol\": \".XBTUSDMFPI8H\",\n \"indexSymbol\": \".BXBT\",\n \"settlementSymbol\": null,\n \"status\": \"Open\",\n \"fundingFeeRate\": 1.75E-4,\n \"predictedFundingFeeRate\": 1.76E-4,\n \"fundingRateGranularity\": 28800000,\n \"openInterest\": \"61725904\",\n \"turnoverOf24h\": 209.56303473,\n \"volumeOf24h\": 1.4354731E7,\n \"markPrice\": 68336.7,\n \"indexPrice\": 68335.29,\n \"lastTradePrice\": 68349.3,\n \"nextFundingRateTime\": 17402942,\n \"maxLeverage\": 75,\n \"sourceExchanges\": [\n \"kraken\",\n \"bitstamp\",\n \"crypto\"\n ],\n \"premiumsSymbol1M\": \".XBTUSDMPI\",\n \"premiumsSymbol8H\": \".XBTUSDMPI8H\",\n \"fundingBaseSymbol1M\": \".XBTINT\",\n \"fundingQuoteSymbol1M\": \".USDINT\",\n \"lowPrice\": 67436.7,\n \"highPrice\": 69471.8,\n \"priceChgPct\": 0.0097,\n \"priceChg\": 658.7,\n \"k\": 2645000.0,\n \"m\": 1640000.0,\n \"f\": 1.3,\n \"mmrLimit\": 0.3,\n \"mmrLevConstant\": 75.0,\n \"supportCross\": true\n }\n}" commonResp := &types.RestResponse{} err := json.Unmarshal([]byte(data), commonResp) assert.Nil(t, err) assert.NotNil(t, commonResp.Data) - resp := &GetAllTickersResp{} + resp := &GetSymbolResp{} err = json.Unmarshal([]byte(commonResp.Data), resp) resp.ToMap() assert.Nil(t, err) } -func TestMarketGetPrivateTokenReqModel(t *testing.T) { - // GetPrivateToken - // Get Private Token - Futures - // /api/v1/bullet-private +func TestMarketGetAllSymbolsReqModel(t *testing.T) { + // GetAllSymbols + // Get All Symbols + // /api/v1/contracts/active } -func TestMarketGetPrivateTokenRespModel(t *testing.T) { - // GetPrivateToken - // Get Private Token - Futures - // /api/v1/bullet-private +func TestMarketGetAllSymbolsRespModel(t *testing.T) { + // GetAllSymbols + // Get All Symbols + // /api/v1/contracts/active - data := "{\n \"code\": \"200000\",\n \"data\": {\n \"token\": \"2neAiuYvAU737TOajb2U3uT8AEZqSWYe0fBD4LoHuXJDSC7gIzJiH4kNTWhCPISWo6nDpAe7aUaaHJ4fG8oRjFgMfUI2sM4IySWHrBceFocY8pKy2REU1HwZIngtMdMrjqPnP-biofFWbNaP1cl0X1pZc2SQ-33hDH1LgNP-yg8bktVoIG0dIxSN4m3uzO8u.ueCCihQ5_4GPpXKxWTDiFQ==\",\n \"instanceServers\": [\n {\n \"endpoint\": \"wss://ws-api-futures.kucoin.com/\",\n \"encrypt\": true,\n \"protocol\": \"websocket\",\n \"pingInterval\": 18000,\n \"pingTimeout\": 10000\n }\n ]\n }\n}" + data := "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"symbol\": \"XBTUSDTM\",\n \"rootSymbol\": \"USDT\",\n \"type\": \"FFWCSX\",\n \"firstOpenDate\": 1585555200000,\n \"expireDate\": null,\n \"settleDate\": null,\n \"baseCurrency\": \"XBT\",\n \"quoteCurrency\": \"USDT\",\n \"settleCurrency\": \"USDT\",\n \"maxOrderQty\": 1000000,\n \"maxPrice\": 1000000.0,\n \"lotSize\": 1,\n \"tickSize\": 0.1,\n \"indexPriceTickSize\": 0.01,\n \"multiplier\": 0.001,\n \"initialMargin\": 0.008,\n \"maintainMargin\": 0.004,\n \"maxRiskLimit\": 100000,\n \"minRiskLimit\": 100000,\n \"riskStep\": 50000,\n \"makerFeeRate\": 2.0E-4,\n \"takerFeeRate\": 6.0E-4,\n \"takerFixFee\": 0.0,\n \"makerFixFee\": 0.0,\n \"settlementFee\": null,\n \"isDeleverage\": true,\n \"isQuanto\": true,\n \"isInverse\": false,\n \"markMethod\": \"FairPrice\",\n \"fairMethod\": \"FundingRate\",\n \"fundingBaseSymbol\": \".XBTINT8H\",\n \"fundingQuoteSymbol\": \".USDTINT8H\",\n \"fundingRateSymbol\": \".XBTUSDTMFPI8H\",\n \"indexSymbol\": \".KXBTUSDT\",\n \"settlementSymbol\": \"\",\n \"status\": \"Open\",\n \"fundingFeeRate\": 1.53E-4,\n \"predictedFundingFeeRate\": 8.0E-5,\n \"fundingRateGranularity\": 28800000,\n \"openInterest\": \"6384957\",\n \"turnoverOf24h\": 5.788402220999069E8,\n \"volumeOf24h\": 8274.432,\n \"markPrice\": 69732.33,\n \"indexPrice\": 69732.32,\n \"lastTradePrice\": 69732,\n \"nextFundingRateTime\": 21265941,\n \"maxLeverage\": 125,\n \"sourceExchanges\": [\n \"okex\",\n \"binance\",\n \"kucoin\",\n \"bybit\",\n \"bitmart\",\n \"gateio\"\n ],\n \"premiumsSymbol1M\": \".XBTUSDTMPI\",\n \"premiumsSymbol8H\": \".XBTUSDTMPI8H\",\n \"fundingBaseSymbol1M\": \".XBTINT\",\n \"fundingQuoteSymbol1M\": \".USDTINT\",\n \"lowPrice\": 68817.5,\n \"highPrice\": 71615.8,\n \"priceChgPct\": 6.0E-4,\n \"priceChg\": 48.0,\n \"k\": 490.0,\n \"m\": 300.0,\n \"f\": 1.3,\n \"mmrLimit\": 0.3,\n \"mmrLevConstant\": 125.0,\n \"supportCross\": true\n }\n ]\n}" commonResp := &types.RestResponse{} err := json.Unmarshal([]byte(data), commonResp) assert.Nil(t, err) assert.NotNil(t, commonResp.Data) - resp := &GetPrivateTokenResp{} + resp := &GetAllSymbolsResp{} err = json.Unmarshal([]byte(commonResp.Data), resp) resp.ToMap() assert.Nil(t, err) } -func TestMarketGetPublicTokenReqModel(t *testing.T) { - // GetPublicToken - // Get Public Token - Futures - // /api/v1/bullet-public +func TestMarketGetTickerReqModel(t *testing.T) { + // GetTicker + // Get Ticker + // /api/v1/ticker + data := "{\"symbol\": \"XBTUSDTM\"}" + req := &GetTickerReq{} + err := json.Unmarshal([]byte(data), req) + req.ToMap() + assert.Nil(t, err) } -func TestMarketGetPublicTokenRespModel(t *testing.T) { - // GetPublicToken - // Get Public Token - Futures - // /api/v1/bullet-public +func TestMarketGetTickerRespModel(t *testing.T) { + // GetTicker + // Get Ticker + // /api/v1/ticker - data := "{\"code\":\"200000\",\"data\":{\"token\":\"2neAiuYvAU61ZDXANAGAsiL4-iAExhsBXZxftpOeh_55i3Ysy2q2LEsEWU64mdzUOPusi34M_wGoSf7iNyEWJ6dACm4ny9vJtLTRq_YsRUlG5ADnAawegdiYB9J6i9GjsxUuhPw3Blq6rhZlGykT3Vp1phUafnulOOpts-MEmEF-3bpfetLOAjsMMBS5qwTWJBvJHl5Vs9Y=.gJEIAywPXFr_4L-WG10eug==\",\"instanceServers\":[{\"endpoint\":\"wss://ws-api-futures.kucoin.com/\",\"encrypt\":true,\"protocol\":\"websocket\",\"pingInterval\":18000,\"pingTimeout\":10000}]}}" + data := "{\"code\":\"200000\",\"data\":{\"sequence\":1697895100310,\"symbol\":\"XBTUSDM\",\"side\":\"sell\",\"size\":2936,\"tradeId\":\"1697901180000\",\"price\":\"67158.4\",\"bestBidPrice\":\"67169.6\",\"bestBidSize\":32345,\"bestAskPrice\":\"67169.7\",\"bestAskSize\":7251,\"ts\":1729163001780000000}}" commonResp := &types.RestResponse{} err := json.Unmarshal([]byte(data), commonResp) assert.Nil(t, err) assert.NotNil(t, commonResp.Data) - resp := &GetPublicTokenResp{} + resp := &GetTickerResp{} err = json.Unmarshal([]byte(commonResp.Data), resp) resp.ToMap() assert.Nil(t, err) } -func TestMarketGetAllSymbolsReqModel(t *testing.T) { - // GetAllSymbols - // Get All Symbols - // /api/v1/contracts/active +func TestMarketGetAllTickersReqModel(t *testing.T) { + // GetAllTickers + // Get All Tickers + // /api/v1/allTickers } -func TestMarketGetAllSymbolsRespModel(t *testing.T) { - // GetAllSymbols - // Get All Symbols - // /api/v1/contracts/active +func TestMarketGetAllTickersRespModel(t *testing.T) { + // GetAllTickers + // Get All Tickers + // /api/v1/allTickers - data := "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"symbol\": \"XBTUSDTM\",\n \"rootSymbol\": \"USDT\",\n \"type\": \"FFWCSX\",\n \"firstOpenDate\": 1585555200000,\n \"expireDate\": null,\n \"settleDate\": null,\n \"baseCurrency\": \"XBT\",\n \"quoteCurrency\": \"USDT\",\n \"settleCurrency\": \"USDT\",\n \"maxOrderQty\": 1000000,\n \"maxPrice\": 1000000.0,\n \"lotSize\": 1,\n \"tickSize\": 0.1,\n \"indexPriceTickSize\": 0.01,\n \"multiplier\": 0.001,\n \"initialMargin\": 0.008,\n \"maintainMargin\": 0.004,\n \"maxRiskLimit\": 100000,\n \"minRiskLimit\": 100000,\n \"riskStep\": 50000,\n \"makerFeeRate\": 2.0E-4,\n \"takerFeeRate\": 6.0E-4,\n \"takerFixFee\": 0.0,\n \"makerFixFee\": 0.0,\n \"settlementFee\": null,\n \"isDeleverage\": true,\n \"isQuanto\": true,\n \"isInverse\": false,\n \"markMethod\": \"FairPrice\",\n \"fairMethod\": \"FundingRate\",\n \"fundingBaseSymbol\": \".XBTINT8H\",\n \"fundingQuoteSymbol\": \".USDTINT8H\",\n \"fundingRateSymbol\": \".XBTUSDTMFPI8H\",\n \"indexSymbol\": \".KXBTUSDT\",\n \"settlementSymbol\": \"\",\n \"status\": \"Open\",\n \"fundingFeeRate\": 1.53E-4,\n \"predictedFundingFeeRate\": 8.0E-5,\n \"fundingRateGranularity\": 28800000,\n \"openInterest\": \"6384957\",\n \"turnoverOf24h\": 5.788402220999069E8,\n \"volumeOf24h\": 8274.432,\n \"markPrice\": 69732.33,\n \"indexPrice\": 69732.32,\n \"lastTradePrice\": 69732,\n \"nextFundingRateTime\": 21265941,\n \"maxLeverage\": 125,\n \"sourceExchanges\": [\n \"okex\",\n \"binance\",\n \"kucoin\",\n \"bybit\",\n \"bitmart\",\n \"gateio\"\n ],\n \"premiumsSymbol1M\": \".XBTUSDTMPI\",\n \"premiumsSymbol8H\": \".XBTUSDTMPI8H\",\n \"fundingBaseSymbol1M\": \".XBTINT\",\n \"fundingQuoteSymbol1M\": \".USDTINT\",\n \"lowPrice\": 68817.5,\n \"highPrice\": 71615.8,\n \"priceChgPct\": 6.0E-4,\n \"priceChg\": 48.0,\n \"k\": 490.0,\n \"m\": 300.0,\n \"f\": 1.3,\n \"mmrLimit\": 0.3,\n \"mmrLevConstant\": 125.0,\n \"supportCross\": true\n }\n ]\n}" + data := "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"sequence\": 1707992727046,\n \"symbol\": \"XBTUSDTM\",\n \"side\": \"sell\",\n \"size\": 21,\n \"tradeId\": \"1784299761369\",\n \"price\": \"67153\",\n \"bestBidPrice\": \"67153\",\n \"bestBidSize\": 2767,\n \"bestAskPrice\": \"67153.1\",\n \"bestAskSize\": 5368,\n \"ts\": 1729163466659000000\n },\n {\n \"sequence\": 1697895166299,\n \"symbol\": \"XBTUSDM\",\n \"side\": \"sell\",\n \"size\": 1956,\n \"tradeId\": \"1697901245065\",\n \"price\": \"67145.2\",\n \"bestBidPrice\": \"67135.3\",\n \"bestBidSize\": 1,\n \"bestAskPrice\": \"67135.8\",\n \"bestAskSize\": 3,\n \"ts\": 1729163445340000000\n }\n ]\n}" commonResp := &types.RestResponse{} err := json.Unmarshal([]byte(data), commonResp) assert.Nil(t, err) assert.NotNil(t, commonResp.Data) - resp := &GetAllSymbolsResp{} + resp := &GetAllTickersResp{} err = json.Unmarshal([]byte(commonResp.Data), resp) resp.ToMap() assert.Nil(t, err) } -func TestMarketGetSymbolReqModel(t *testing.T) { - // GetSymbol - // Get Symbol - // /api/v1/contracts/{symbol} +func TestMarketGetFullOrderBookReqModel(t *testing.T) { + // GetFullOrderBook + // Get Full OrderBook + // /api/v1/level2/snapshot - data := "{\"symbol\": \"XBTUSDTM\"}" - req := &GetSymbolReq{} + data := "{\"symbol\": \"XBTUSDM\"}" + req := &GetFullOrderBookReq{} err := json.Unmarshal([]byte(data), req) req.ToMap() assert.Nil(t, err) } -func TestMarketGetSymbolRespModel(t *testing.T) { - // GetSymbol - // Get Symbol - // /api/v1/contracts/{symbol} +func TestMarketGetFullOrderBookRespModel(t *testing.T) { + // GetFullOrderBook + // Get Full OrderBook + // /api/v1/level2/snapshot - data := "{\n \"code\": \"200000\",\n \"data\": {\n \"symbol\": \"XBTUSDM\",\n \"rootSymbol\": \"XBT\",\n \"type\": \"FFWCSX\",\n \"firstOpenDate\": 1552638575000,\n \"expireDate\": null,\n \"settleDate\": null,\n \"baseCurrency\": \"XBT\",\n \"quoteCurrency\": \"USD\",\n \"settleCurrency\": \"XBT\",\n \"maxOrderQty\": 10000000,\n \"maxPrice\": 1000000.0,\n \"lotSize\": 1,\n \"tickSize\": 0.1,\n \"indexPriceTickSize\": 0.1,\n \"multiplier\": -1.0,\n \"initialMargin\": 0.014,\n \"maintainMargin\": 0.007,\n \"maxRiskLimit\": 1,\n \"minRiskLimit\": 1,\n \"riskStep\": 0,\n \"makerFeeRate\": 2.0E-4,\n \"takerFeeRate\": 6.0E-4,\n \"takerFixFee\": 0.0,\n \"makerFixFee\": 0.0,\n \"settlementFee\": null,\n \"isDeleverage\": true,\n \"isQuanto\": false,\n \"isInverse\": true,\n \"markMethod\": \"FairPrice\",\n \"fairMethod\": \"FundingRate\",\n \"fundingBaseSymbol\": \".XBTINT8H\",\n \"fundingQuoteSymbol\": \".USDINT8H\",\n \"fundingRateSymbol\": \".XBTUSDMFPI8H\",\n \"indexSymbol\": \".BXBT\",\n \"settlementSymbol\": null,\n \"status\": \"Open\",\n \"fundingFeeRate\": 1.75E-4,\n \"predictedFundingFeeRate\": 1.76E-4,\n \"fundingRateGranularity\": 28800000,\n \"openInterest\": \"61725904\",\n \"turnoverOf24h\": 209.56303473,\n \"volumeOf24h\": 1.4354731E7,\n \"markPrice\": 68336.7,\n \"indexPrice\": 68335.29,\n \"lastTradePrice\": 68349.3,\n \"nextFundingRateTime\": 17402942,\n \"maxLeverage\": 75,\n \"sourceExchanges\": [\n \"kraken\",\n \"bitstamp\",\n \"crypto\"\n ],\n \"premiumsSymbol1M\": \".XBTUSDMPI\",\n \"premiumsSymbol8H\": \".XBTUSDMPI8H\",\n \"fundingBaseSymbol1M\": \".XBTINT\",\n \"fundingQuoteSymbol1M\": \".USDINT\",\n \"lowPrice\": 67436.7,\n \"highPrice\": 69471.8,\n \"priceChgPct\": 0.0097,\n \"priceChg\": 658.7,\n \"k\": 2645000.0,\n \"m\": 1640000.0,\n \"f\": 1.3,\n \"mmrLimit\": 0.3,\n \"mmrLevConstant\": 75.0,\n \"supportCross\": true\n }\n}" + data := "{\n \"code\": \"200000\",\n \"data\": {\n \"sequence\": 1697895963339,\n \"symbol\": \"XBTUSDM\",\n \"bids\": [\n [\n 66968,\n 2\n ],\n [\n 66964.8,\n 25596\n ]\n ],\n \"asks\": [\n [\n 66968.1,\n 13501\n ],\n [\n 66968.7,\n 2032\n ]\n ],\n \"ts\": 1729168101216000000\n }\n}" commonResp := &types.RestResponse{} err := json.Unmarshal([]byte(data), commonResp) assert.Nil(t, err) assert.NotNil(t, commonResp.Data) - resp := &GetSymbolResp{} + resp := &GetFullOrderBookResp{} err = json.Unmarshal([]byte(commonResp.Data), resp) resp.ToMap() assert.Nil(t, err) } -func TestMarketGetSpotIndexPriceReqModel(t *testing.T) { - // GetSpotIndexPrice - // Get Spot Index Price - // /api/v1/index/query +func TestMarketGetPartOrderBookReqModel(t *testing.T) { + // GetPartOrderBook + // Get Part OrderBook + // /api/v1/level2/depth{size} - data := "{\"symbol\": \".KXBTUSDT\", \"startAt\": 123456, \"endAt\": 123456, \"reverse\": true, \"offset\": 123456, \"forward\": true, \"maxCount\": 10}" - req := &GetSpotIndexPriceReq{} + data := "{\"symbol\": \"XBTUSDM\", \"size\": \"20\"}" + req := &GetPartOrderBookReq{} err := json.Unmarshal([]byte(data), req) req.ToMap() assert.Nil(t, err) } -func TestMarketGetSpotIndexPriceRespModel(t *testing.T) { - // GetSpotIndexPrice - // Get Spot Index Price - // /api/v1/index/query +func TestMarketGetPartOrderBookRespModel(t *testing.T) { + // GetPartOrderBook + // Get Part OrderBook + // /api/v1/level2/depth{size} - data := "{\n \"code\": \"200000\",\n \"data\": {\n \"hasMore\": true,\n \"dataList\": [\n {\n \"symbol\": \".KXBTUSDT\",\n \"granularity\": 1000,\n \"timePoint\": 1730557515000,\n \"value\": 69202.94,\n \"decomposionList\": [\n {\n \"exchange\": \"gateio\",\n \"price\": 69209.27,\n \"weight\": 0.0533\n },\n {\n \"exchange\": \"bitmart\",\n \"price\": 69230.77,\n \"weight\": 0.0128\n },\n {\n \"exchange\": \"okex\",\n \"price\": 69195.34,\n \"weight\": 0.11\n },\n {\n \"exchange\": \"bybit\",\n \"price\": 69190.33,\n \"weight\": 0.0676\n },\n {\n \"exchange\": \"binance\",\n \"price\": 69204.55,\n \"weight\": 0.6195\n },\n {\n \"exchange\": \"kucoin\",\n \"price\": 69202.91,\n \"weight\": 0.1368\n }\n ]\n },\n {\n \"symbol\": \".KXBTUSDT\",\n \"granularity\": 1000,\n \"timePoint\": 1730557514000,\n \"value\": 69204.98,\n \"decomposionList\": [\n {\n \"exchange\": \"gateio\",\n \"price\": 69212.71,\n \"weight\": 0.0808\n },\n {\n \"exchange\": \"bitmart\",\n \"price\": 69230.77,\n \"weight\": 0.0134\n },\n {\n \"exchange\": \"okex\",\n \"price\": 69195.49,\n \"weight\": 0.0536\n },\n {\n \"exchange\": \"bybit\",\n \"price\": 69195.97,\n \"weight\": 0.0921\n },\n {\n \"exchange\": \"binance\",\n \"price\": 69204.56,\n \"weight\": 0.5476\n },\n {\n \"exchange\": \"kucoin\",\n \"price\": 69207.8,\n \"weight\": 0.2125\n }\n ]\n }\n ]\n }\n}" + data := "{\n \"code\": \"200000\",\n \"data\": {\n \"sequence\": 1697895963339,\n \"symbol\": \"XBTUSDM\",\n \"bids\": [\n [\n 66968,\n 2\n ],\n [\n 66964.8,\n 25596\n ]\n ],\n \"asks\": [\n [\n 66968.1,\n 13501\n ],\n [\n 66968.7,\n 2032\n ]\n ],\n \"ts\": 1729168101216000000\n }\n}" commonResp := &types.RestResponse{} err := json.Unmarshal([]byte(data), commonResp) assert.Nil(t, err) assert.NotNil(t, commonResp.Data) - resp := &GetSpotIndexPriceResp{} + resp := &GetPartOrderBookResp{} err = json.Unmarshal([]byte(commonResp.Data), resp) resp.ToMap() assert.Nil(t, err) } -func TestMarketGetInterestRateIndexReqModel(t *testing.T) { - // GetInterestRateIndex - // Get Interest Rate Index - // /api/v1/interest/query +func TestMarketGetTradeHistoryReqModel(t *testing.T) { + // GetTradeHistory + // Get Trade History + // /api/v1/trade/history - data := "{\"symbol\": \".XBTINT8H\", \"startAt\": 1728663338000, \"endAt\": 1728692138000, \"reverse\": true, \"offset\": 254062248624417, \"forward\": true, \"maxCount\": 10}" - req := &GetInterestRateIndexReq{} + data := "{\"symbol\": \"XBTUSDM\"}" + req := &GetTradeHistoryReq{} err := json.Unmarshal([]byte(data), req) req.ToMap() assert.Nil(t, err) } -func TestMarketGetInterestRateIndexRespModel(t *testing.T) { - // GetInterestRateIndex - // Get Interest Rate Index - // /api/v1/interest/query +func TestMarketGetTradeHistoryRespModel(t *testing.T) { + // GetTradeHistory + // Get Trade History + // /api/v1/trade/history - data := "{\n \"code\": \"200000\",\n \"data\": {\n \"dataList\": [\n {\n \"symbol\": \".XBTINT\",\n \"granularity\": 60000,\n \"timePoint\": 1728692100000,\n \"value\": 3.0E-4\n },\n {\n \"symbol\": \".XBTINT\",\n \"granularity\": 60000,\n \"timePoint\": 1728692040000,\n \"value\": 3.0E-4\n }\n ],\n \"hasMore\": true\n }\n}" + data := "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"sequence\": 1697915257909,\n \"contractId\": 1,\n \"tradeId\": \"1697915257909\",\n \"makerOrderId\": \"236679665752801280\",\n \"takerOrderId\": \"236679667975745536\",\n \"ts\": 1729242032152000000,\n \"size\": 1,\n \"price\": \"67878\",\n \"side\": \"sell\"\n },\n {\n \"sequence\": 1697915257749,\n \"contractId\": 1,\n \"tradeId\": \"1697915257749\",\n \"makerOrderId\": \"236679660971245570\",\n \"takerOrderId\": \"236679665400492032\",\n \"ts\": 1729242031535000000,\n \"size\": 1,\n \"price\": \"67867.8\",\n \"side\": \"sell\"\n },\n {\n \"sequence\": 1697915257701,\n \"contractId\": 1,\n \"tradeId\": \"1697915257701\",\n \"makerOrderId\": \"236679660971245570\",\n \"takerOrderId\": \"236679661919211521\",\n \"ts\": 1729242030932000000,\n \"size\": 1,\n \"price\": \"67867.8\",\n \"side\": \"sell\"\n }\n ]\n}" commonResp := &types.RestResponse{} err := json.Unmarshal([]byte(data), commonResp) assert.Nil(t, err) assert.NotNil(t, commonResp.Data) - resp := &GetInterestRateIndexResp{} + resp := &GetTradeHistoryResp{} err = json.Unmarshal([]byte(commonResp.Data), resp) resp.ToMap() assert.Nil(t, err) @@ -211,85 +221,85 @@ func TestMarketGetKlinesRespModel(t *testing.T) { assert.Nil(t, err) } -func TestMarketGetPartOrderBookReqModel(t *testing.T) { - // GetPartOrderBook - // Get Part OrderBook - // /api/v1/level2/depth{size} +func TestMarketGetMarkPriceReqModel(t *testing.T) { + // GetMarkPrice + // Get Mark Price + // /api/v1/mark-price/{symbol}/current - data := "{\"symbol\": \"XBTUSDM\", \"size\": \"20\"}" - req := &GetPartOrderBookReq{} + data := "{\"symbol\": \"XBTUSDTM\"}" + req := &GetMarkPriceReq{} err := json.Unmarshal([]byte(data), req) req.ToMap() assert.Nil(t, err) } -func TestMarketGetPartOrderBookRespModel(t *testing.T) { - // GetPartOrderBook - // Get Part OrderBook - // /api/v1/level2/depth{size} +func TestMarketGetMarkPriceRespModel(t *testing.T) { + // GetMarkPrice + // Get Mark Price + // /api/v1/mark-price/{symbol}/current - data := "{\n \"code\": \"200000\",\n \"data\": {\n \"sequence\": 1697895963339,\n \"symbol\": \"XBTUSDM\",\n \"bids\": [\n [\n 66968,\n 2\n ],\n [\n 66964.8,\n 25596\n ]\n ],\n \"asks\": [\n [\n 66968.1,\n 13501\n ],\n [\n 66968.7,\n 2032\n ]\n ],\n \"ts\": 1729168101216000000\n }\n}" + data := "{\"code\":\"200000\",\"data\":{\"symbol\":\"XBTUSDTM\",\"granularity\":1000,\"timePoint\":1729254307000,\"value\":67687.08,\"indexPrice\":67683.58}}" commonResp := &types.RestResponse{} err := json.Unmarshal([]byte(data), commonResp) assert.Nil(t, err) assert.NotNil(t, commonResp.Data) - resp := &GetPartOrderBookResp{} + resp := &GetMarkPriceResp{} err = json.Unmarshal([]byte(commonResp.Data), resp) resp.ToMap() assert.Nil(t, err) } -func TestMarketGetFullOrderBookReqModel(t *testing.T) { - // GetFullOrderBook - // Get Full OrderBook - // /api/v1/level2/snapshot +func TestMarketGetSpotIndexPriceReqModel(t *testing.T) { + // GetSpotIndexPrice + // Get Spot Index Price + // /api/v1/index/query - data := "{\"symbol\": \"XBTUSDM\"}" - req := &GetFullOrderBookReq{} + data := "{\"symbol\": \".KXBTUSDT\", \"startAt\": 123456, \"endAt\": 123456, \"reverse\": true, \"offset\": 123456, \"forward\": true, \"maxCount\": 10}" + req := &GetSpotIndexPriceReq{} err := json.Unmarshal([]byte(data), req) req.ToMap() assert.Nil(t, err) } -func TestMarketGetFullOrderBookRespModel(t *testing.T) { - // GetFullOrderBook - // Get Full OrderBook - // /api/v1/level2/snapshot +func TestMarketGetSpotIndexPriceRespModel(t *testing.T) { + // GetSpotIndexPrice + // Get Spot Index Price + // /api/v1/index/query - data := "{\n \"code\": \"200000\",\n \"data\": {\n \"sequence\": 1697895963339,\n \"symbol\": \"XBTUSDM\",\n \"bids\": [\n [\n 66968,\n 2\n ],\n [\n 66964.8,\n 25596\n ]\n ],\n \"asks\": [\n [\n 66968.1,\n 13501\n ],\n [\n 66968.7,\n 2032\n ]\n ],\n \"ts\": 1729168101216000000\n }\n}" + data := "{\n \"code\": \"200000\",\n \"data\": {\n \"hasMore\": true,\n \"dataList\": [\n {\n \"symbol\": \".KXBTUSDT\",\n \"granularity\": 1000,\n \"timePoint\": 1730557515000,\n \"value\": 69202.94,\n \"decomposionList\": [\n {\n \"exchange\": \"gateio\",\n \"price\": 69209.27,\n \"weight\": 0.0533\n },\n {\n \"exchange\": \"bitmart\",\n \"price\": 69230.77,\n \"weight\": 0.0128\n },\n {\n \"exchange\": \"okex\",\n \"price\": 69195.34,\n \"weight\": 0.11\n },\n {\n \"exchange\": \"bybit\",\n \"price\": 69190.33,\n \"weight\": 0.0676\n },\n {\n \"exchange\": \"binance\",\n \"price\": 69204.55,\n \"weight\": 0.6195\n },\n {\n \"exchange\": \"kucoin\",\n \"price\": 69202.91,\n \"weight\": 0.1368\n }\n ]\n },\n {\n \"symbol\": \".KXBTUSDT\",\n \"granularity\": 1000,\n \"timePoint\": 1730557514000,\n \"value\": 69204.98,\n \"decomposionList\": [\n {\n \"exchange\": \"gateio\",\n \"price\": 69212.71,\n \"weight\": 0.0808\n },\n {\n \"exchange\": \"bitmart\",\n \"price\": 69230.77,\n \"weight\": 0.0134\n },\n {\n \"exchange\": \"okex\",\n \"price\": 69195.49,\n \"weight\": 0.0536\n },\n {\n \"exchange\": \"bybit\",\n \"price\": 69195.97,\n \"weight\": 0.0921\n },\n {\n \"exchange\": \"binance\",\n \"price\": 69204.56,\n \"weight\": 0.5476\n },\n {\n \"exchange\": \"kucoin\",\n \"price\": 69207.8,\n \"weight\": 0.2125\n }\n ]\n }\n ]\n }\n}" commonResp := &types.RestResponse{} err := json.Unmarshal([]byte(data), commonResp) assert.Nil(t, err) assert.NotNil(t, commonResp.Data) - resp := &GetFullOrderBookResp{} + resp := &GetSpotIndexPriceResp{} err = json.Unmarshal([]byte(commonResp.Data), resp) resp.ToMap() assert.Nil(t, err) } -func TestMarketGetMarkPriceReqModel(t *testing.T) { - // GetMarkPrice - // Get Mark Price - // /api/v1/mark-price/{symbol}/current +func TestMarketGetInterestRateIndexReqModel(t *testing.T) { + // GetInterestRateIndex + // Get Interest Rate Index + // /api/v1/interest/query - data := "{\"symbol\": \"XBTUSDTM\"}" - req := &GetMarkPriceReq{} + data := "{\"symbol\": \".XBTINT8H\", \"startAt\": 1728663338000, \"endAt\": 1728692138000, \"reverse\": true, \"offset\": 254062248624417, \"forward\": true, \"maxCount\": 10}" + req := &GetInterestRateIndexReq{} err := json.Unmarshal([]byte(data), req) req.ToMap() assert.Nil(t, err) } -func TestMarketGetMarkPriceRespModel(t *testing.T) { - // GetMarkPrice - // Get Mark Price - // /api/v1/mark-price/{symbol}/current +func TestMarketGetInterestRateIndexRespModel(t *testing.T) { + // GetInterestRateIndex + // Get Interest Rate Index + // /api/v1/interest/query - data := "{\"code\":\"200000\",\"data\":{\"symbol\":\"XBTUSDTM\",\"granularity\":1000,\"timePoint\":1729254307000,\"value\":67687.08,\"indexPrice\":67683.58}}" + data := "{\n \"code\": \"200000\",\n \"data\": {\n \"dataList\": [\n {\n \"symbol\": \".XBTINT\",\n \"granularity\": 60000,\n \"timePoint\": 1728692100000,\n \"value\": 3.0E-4\n },\n {\n \"symbol\": \".XBTINT\",\n \"granularity\": 60000,\n \"timePoint\": 1728692040000,\n \"value\": 3.0E-4\n }\n ],\n \"hasMore\": true\n }\n}" commonResp := &types.RestResponse{} err := json.Unmarshal([]byte(data), commonResp) assert.Nil(t, err) assert.NotNil(t, commonResp.Data) - resp := &GetMarkPriceResp{} + resp := &GetInterestRateIndexResp{} err = json.Unmarshal([]byte(commonResp.Data), resp) resp.ToMap() assert.Nil(t, err) @@ -323,126 +333,116 @@ func TestMarketGetPremiumIndexRespModel(t *testing.T) { assert.Nil(t, err) } -func TestMarketGetServiceStatusReqModel(t *testing.T) { - // GetServiceStatus - // Get Service Status - // /api/v1/status +func TestMarketGet24hrStatsReqModel(t *testing.T) { + // Get24hrStats + // Get 24hr Stats + // /api/v1/trade-statistics } -func TestMarketGetServiceStatusRespModel(t *testing.T) { - // GetServiceStatus - // Get Service Status - // /api/v1/status +func TestMarketGet24hrStatsRespModel(t *testing.T) { + // Get24hrStats + // Get 24hr Stats + // /api/v1/trade-statistics - data := "{\"code\":\"200000\",\"data\":{\"msg\":\"\",\"status\":\"open\"}}" + data := "{\"code\":\"200000\",\"data\":{\"turnoverOf24h\":1.1155733413273683E9}}" commonResp := &types.RestResponse{} err := json.Unmarshal([]byte(data), commonResp) assert.Nil(t, err) assert.NotNil(t, commonResp.Data) - resp := &GetServiceStatusResp{} + resp := &Get24hrStatsResp{} err = json.Unmarshal([]byte(commonResp.Data), resp) resp.ToMap() assert.Nil(t, err) } -func TestMarketGetTickerReqModel(t *testing.T) { - // GetTicker - // Get Ticker - // /api/v1/ticker +func TestMarketGetServerTimeReqModel(t *testing.T) { + // GetServerTime + // Get Server Time + // /api/v1/timestamp - data := "{\"symbol\": \"XBTUSDTM\"}" - req := &GetTickerReq{} - err := json.Unmarshal([]byte(data), req) - req.ToMap() - assert.Nil(t, err) } -func TestMarketGetTickerRespModel(t *testing.T) { - // GetTicker - // Get Ticker - // /api/v1/ticker +func TestMarketGetServerTimeRespModel(t *testing.T) { + // GetServerTime + // Get Server Time + // /api/v1/timestamp - data := "{\"code\":\"200000\",\"data\":{\"sequence\":1697895100310,\"symbol\":\"XBTUSDM\",\"side\":\"sell\",\"size\":2936,\"tradeId\":\"1697901180000\",\"price\":\"67158.4\",\"bestBidPrice\":\"67169.6\",\"bestBidSize\":32345,\"bestAskPrice\":\"67169.7\",\"bestAskSize\":7251,\"ts\":1729163001780000000}}" + data := "{\"code\":\"200000\",\"data\":1729260030774}" commonResp := &types.RestResponse{} err := json.Unmarshal([]byte(data), commonResp) assert.Nil(t, err) assert.NotNil(t, commonResp.Data) - resp := &GetTickerResp{} + resp := &GetServerTimeResp{} err = json.Unmarshal([]byte(commonResp.Data), resp) resp.ToMap() assert.Nil(t, err) } -func TestMarketGetServerTimeReqModel(t *testing.T) { - // GetServerTime - // Get Server Time - // /api/v1/timestamp +func TestMarketGetServiceStatusReqModel(t *testing.T) { + // GetServiceStatus + // Get Service Status + // /api/v1/status } -func TestMarketGetServerTimeRespModel(t *testing.T) { - // GetServerTime - // Get Server Time - // /api/v1/timestamp +func TestMarketGetServiceStatusRespModel(t *testing.T) { + // GetServiceStatus + // Get Service Status + // /api/v1/status - data := "{\"code\":\"200000\",\"data\":1729260030774}" + data := "{\"code\":\"200000\",\"data\":{\"msg\":\"\",\"status\":\"open\"}}" commonResp := &types.RestResponse{} err := json.Unmarshal([]byte(data), commonResp) assert.Nil(t, err) assert.NotNil(t, commonResp.Data) - resp := &GetServerTimeResp{} + resp := &GetServiceStatusResp{} err = json.Unmarshal([]byte(commonResp.Data), resp) resp.ToMap() assert.Nil(t, err) } -func TestMarketGetTradeHistoryReqModel(t *testing.T) { - // GetTradeHistory - // Get Trade History - // /api/v1/trade/history +func TestMarketGetPublicTokenReqModel(t *testing.T) { + // GetPublicToken + // Get Public Token - Futures + // /api/v1/bullet-public - data := "{\"symbol\": \"XBTUSDM\"}" - req := &GetTradeHistoryReq{} - err := json.Unmarshal([]byte(data), req) - req.ToMap() - assert.Nil(t, err) } -func TestMarketGetTradeHistoryRespModel(t *testing.T) { - // GetTradeHistory - // Get Trade History - // /api/v1/trade/history +func TestMarketGetPublicTokenRespModel(t *testing.T) { + // GetPublicToken + // Get Public Token - Futures + // /api/v1/bullet-public - data := "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"sequence\": 1697915257909,\n \"contractId\": 1,\n \"tradeId\": \"1697915257909\",\n \"makerOrderId\": \"236679665752801280\",\n \"takerOrderId\": \"236679667975745536\",\n \"ts\": 1729242032152000000,\n \"size\": 1,\n \"price\": \"67878\",\n \"side\": \"sell\"\n },\n {\n \"sequence\": 1697915257749,\n \"contractId\": 1,\n \"tradeId\": \"1697915257749\",\n \"makerOrderId\": \"236679660971245570\",\n \"takerOrderId\": \"236679665400492032\",\n \"ts\": 1729242031535000000,\n \"size\": 1,\n \"price\": \"67867.8\",\n \"side\": \"sell\"\n },\n {\n \"sequence\": 1697915257701,\n \"contractId\": 1,\n \"tradeId\": \"1697915257701\",\n \"makerOrderId\": \"236679660971245570\",\n \"takerOrderId\": \"236679661919211521\",\n \"ts\": 1729242030932000000,\n \"size\": 1,\n \"price\": \"67867.8\",\n \"side\": \"sell\"\n }\n ]\n}" + data := "{\"code\":\"200000\",\"data\":{\"token\":\"2neAiuYvAU61ZDXANAGAsiL4-iAExhsBXZxftpOeh_55i3Ysy2q2LEsEWU64mdzUOPusi34M_wGoSf7iNyEWJ6dACm4ny9vJtLTRq_YsRUlG5ADnAawegdiYB9J6i9GjsxUuhPw3Blq6rhZlGykT3Vp1phUafnulOOpts-MEmEF-3bpfetLOAjsMMBS5qwTWJBvJHl5Vs9Y=.gJEIAywPXFr_4L-WG10eug==\",\"instanceServers\":[{\"endpoint\":\"wss://ws-api-futures.kucoin.com/\",\"encrypt\":true,\"protocol\":\"websocket\",\"pingInterval\":18000,\"pingTimeout\":10000}]}}" commonResp := &types.RestResponse{} err := json.Unmarshal([]byte(data), commonResp) assert.Nil(t, err) assert.NotNil(t, commonResp.Data) - resp := &GetTradeHistoryResp{} + resp := &GetPublicTokenResp{} err = json.Unmarshal([]byte(commonResp.Data), resp) resp.ToMap() assert.Nil(t, err) } -func TestMarketGet24hrStatsReqModel(t *testing.T) { - // Get24hrStats - // Get 24hr Stats - // /api/v1/trade-statistics +func TestMarketGetPrivateTokenReqModel(t *testing.T) { + // GetPrivateToken + // Get Private Token - Futures + // /api/v1/bullet-private } -func TestMarketGet24hrStatsRespModel(t *testing.T) { - // Get24hrStats - // Get 24hr Stats - // /api/v1/trade-statistics +func TestMarketGetPrivateTokenRespModel(t *testing.T) { + // GetPrivateToken + // Get Private Token - Futures + // /api/v1/bullet-private - data := "{\"code\":\"200000\",\"data\":{\"turnoverOf24h\":1.1155733413273683E9}}" + data := "{\n \"code\": \"200000\",\n \"data\": {\n \"token\": \"2neAiuYvAU737TOajb2U3uT8AEZqSWYe0fBD4LoHuXJDSC7gIzJiH4kNTWhCPISWo6nDpAe7aUaaHJ4fG8oRjFgMfUI2sM4IySWHrBceFocY8pKy2REU1HwZIngtMdMrjqPnP-biofFWbNaP1cl0X1pZc2SQ-33hDH1LgNP-yg8bktVoIG0dIxSN4m3uzO8u.ueCCihQ5_4GPpXKxWTDiFQ==\",\n \"instanceServers\": [\n {\n \"endpoint\": \"wss://ws-api-futures.kucoin.com/\",\n \"encrypt\": true,\n \"protocol\": \"websocket\",\n \"pingInterval\": 18000,\n \"pingTimeout\": 10000\n }\n ]\n }\n}" commonResp := &types.RestResponse{} err := json.Unmarshal([]byte(data), commonResp) assert.Nil(t, err) assert.NotNil(t, commonResp.Data) - resp := &Get24hrStatsResp{} + resp := &GetPrivateTokenResp{} err = json.Unmarshal([]byte(commonResp.Data), resp) resp.ToMap() assert.Nil(t, err) diff --git a/sdk/golang/pkg/generate/futures/order/api_order.go b/sdk/golang/pkg/generate/futures/order/api_order.go index 27d419a1..c603eb23 100644 --- a/sdk/golang/pkg/generate/futures/order/api_order.go +++ b/sdk/golang/pkg/generate/futures/order/api_order.go @@ -9,9 +9,9 @@ import ( type OrderAPI interface { - // GetTradeHistory Get Trade History - // Description: Get a list of recent fills. If you need to get your recent trade history with low latency, please query endpoint Get List of Orders Completed in 24h. The requested data is not real-time. - // Documentation: https://www.kucoin.com/docs-new/api-3470248 + // AddOrder Add Order + // Description: Place order to the futures trading system, you can place two major types of orders: limit and market. Orders can only be placed if your account has sufficient funds. Once an order is placed, your funds will be put on hold for the duration of the order. The amount of funds on hold depends on the order type and parameters specified. + // Documentation: https://www.kucoin.com/docs-new/api-3470235 // +---------------------+---------+ // | Extra API Info | Value | // +---------------------+---------+ @@ -19,13 +19,13 @@ type OrderAPI interface { // | API-CHANNEL | PRIVATE | // | API-PERMISSION | FUTURES | // | API-RATE-LIMIT-POOL | FUTURES | - // | API-RATE-LIMIT | 5 | + // | API-RATE-LIMIT | 2 | // +---------------------+---------+ - GetTradeHistory(req *GetTradeHistoryReq, ctx context.Context) (*GetTradeHistoryResp, error) + AddOrder(req *AddOrderReq, ctx context.Context) (*AddOrderResp, error) - // GetOpenOrderValue Get Open Order Value - // Description: You can query this endpoint to get the the total number and value of the all your active orders. - // Documentation: https://www.kucoin.com/docs-new/api-3470250 + // AddOrderTest Add Order Test + // Description: Place order to the futures trading system just for validation + // Documentation: https://www.kucoin.com/docs-new/api-3470238 // +---------------------+---------+ // | Extra API Info | Value | // +---------------------+---------+ @@ -33,27 +33,27 @@ type OrderAPI interface { // | API-CHANNEL | PRIVATE | // | API-PERMISSION | FUTURES | // | API-RATE-LIMIT-POOL | FUTURES | - // | API-RATE-LIMIT | 10 | + // | API-RATE-LIMIT | 2 | // +---------------------+---------+ - GetOpenOrderValue(req *GetOpenOrderValueReq, ctx context.Context) (*GetOpenOrderValueResp, error) + AddOrderTest(req *AddOrderTestReq, ctx context.Context) (*AddOrderTestResp, error) - // GetOrderByClientOid Get Order By ClientOid - // Description: Get a single order by client order id (including a stop order). - // Documentation: https://www.kucoin.com/docs-new/api-3470352 + // BatchAddOrders Batch Add Orders + // Description: Place multiple order to the futures trading system, you can place two major types of orders: limit and market. Orders can only be placed if your account has sufficient funds. Once an order is placed, your funds will be put on hold for the duration of the order. The amount of funds on hold depends on the order type and parameters specified. You can place up to 20 orders at one time, including limit orders, market orders, and stop orders Please be noted that the system would hold the fees from the orders entered the orderbook in advance. + // Documentation: https://www.kucoin.com/docs-new/api-3470236 // +---------------------+---------+ // | Extra API Info | Value | // +---------------------+---------+ // | API-DOMAIN | FUTURES | // | API-CHANNEL | PRIVATE | - // | API-PERMISSION | GENERAL | + // | API-PERMISSION | FUTURES | // | API-RATE-LIMIT-POOL | FUTURES | - // | API-RATE-LIMIT | 5 | + // | API-RATE-LIMIT | 20 | // +---------------------+---------+ - GetOrderByClientOid(req *GetOrderByClientOidReq, ctx context.Context) (*GetOrderByClientOidResp, error) + BatchAddOrders(req *BatchAddOrdersReq, ctx context.Context) (*BatchAddOrdersResp, error) - // CancelOrderByClientOid Cancel Order By ClientOid - // Description: Cancel order by client defined orderId. - // Documentation: https://www.kucoin.com/docs-new/api-3470240 + // AddTPSLOrder Add Take Profit And Stop Loss Order + // Description: Place take profit and stop loss order supports both take-profit and stop-loss functions, and other functions are exactly the same as the place order interface. + // Documentation: https://www.kucoin.com/docs-new/api-3470237 // +---------------------+---------+ // | Extra API Info | Value | // +---------------------+---------+ @@ -61,13 +61,13 @@ type OrderAPI interface { // | API-CHANNEL | PRIVATE | // | API-PERMISSION | FUTURES | // | API-RATE-LIMIT-POOL | FUTURES | - // | API-RATE-LIMIT | 1 | + // | API-RATE-LIMIT | 2 | // +---------------------+---------+ - CancelOrderByClientOid(req *CancelOrderByClientOidReq, ctx context.Context) (*CancelOrderByClientOidResp, error) + AddTPSLOrder(req *AddTPSLOrderReq, ctx context.Context) (*AddTPSLOrderResp, error) - // CancelAllOrdersV1 Cancel All Orders - V1 - // Description: Cancel all open orders (excluding stop orders). The response is a list of orderIDs of the canceled orders. - // Documentation: https://www.kucoin.com/docs-new/api-3470362 + // CancelOrderById Cancel Order By OrderId + // Description: Cancel order by system generated orderId. + // Documentation: https://www.kucoin.com/docs-new/api-3470239 // +---------------------+---------+ // | Extra API Info | Value | // +---------------------+---------+ @@ -75,14 +75,13 @@ type OrderAPI interface { // | API-CHANNEL | PRIVATE | // | API-PERMISSION | FUTURES | // | API-RATE-LIMIT-POOL | FUTURES | - // | API-RATE-LIMIT | 200 | + // | API-RATE-LIMIT | 1 | // +---------------------+---------+ - // Deprecated - CancelAllOrdersV1(req *CancelAllOrdersV1Req, ctx context.Context) (*CancelAllOrdersV1Resp, error) + CancelOrderById(req *CancelOrderByIdReq, ctx context.Context) (*CancelOrderByIdResp, error) - // GetOrderList Get Order List - // Description: List your current orders. - // Documentation: https://www.kucoin.com/docs-new/api-3470244 + // CancelOrderByClientOid Cancel Order By ClientOid + // Description: Cancel order by client defined orderId. + // Documentation: https://www.kucoin.com/docs-new/api-3470240 // +---------------------+---------+ // | Extra API Info | Value | // +---------------------+---------+ @@ -90,9 +89,9 @@ type OrderAPI interface { // | API-CHANNEL | PRIVATE | // | API-PERMISSION | FUTURES | // | API-RATE-LIMIT-POOL | FUTURES | - // | API-RATE-LIMIT | 2 | + // | API-RATE-LIMIT | 1 | // +---------------------+---------+ - GetOrderList(req *GetOrderListReq, ctx context.Context) (*GetOrderListResp, error) + CancelOrderByClientOid(req *CancelOrderByClientOidReq, ctx context.Context) (*CancelOrderByClientOidResp, error) // BatchCancelOrders Batch Cancel Orders // Description: Cancel a bach of orders by client defined orderId or system generated orderId @@ -108,9 +107,9 @@ type OrderAPI interface { // +---------------------+---------+ BatchCancelOrders(req *BatchCancelOrdersReq, ctx context.Context) (*BatchCancelOrdersResp, error) - // BatchAddOrders Batch Add Orders - // Description: Place multiple order to the futures trading system, you can place two major types of orders: limit and market. Orders can only be placed if your account has sufficient funds. Once an order is placed, your funds will be put on hold for the duration of the order. The amount of funds on hold depends on the order type and parameters specified. You can place up to 20 orders at one time, including limit orders, market orders, and stop orders Please be noted that the system would hold the fees from the orders entered the orderbook in advance. - // Documentation: https://www.kucoin.com/docs-new/api-3470236 + // CancelAllOrdersV3 Cancel All Orders + // Description: Cancel all open orders (excluding stop orders). The response is a list of orderIDs of the canceled orders. + // Documentation: https://www.kucoin.com/docs-new/api-3470242 // +---------------------+---------+ // | Extra API Info | Value | // +---------------------+---------+ @@ -118,13 +117,13 @@ type OrderAPI interface { // | API-CHANNEL | PRIVATE | // | API-PERMISSION | FUTURES | // | API-RATE-LIMIT-POOL | FUTURES | - // | API-RATE-LIMIT | 20 | + // | API-RATE-LIMIT | 10 | // +---------------------+---------+ - BatchAddOrders(req *BatchAddOrdersReq, ctx context.Context) (*BatchAddOrdersResp, error) + CancelAllOrdersV3(req *CancelAllOrdersV3Req, ctx context.Context) (*CancelAllOrdersV3Resp, error) - // CancelOrderById Cancel Order By OrderId - // Description: Cancel order by system generated orderId. - // Documentation: https://www.kucoin.com/docs-new/api-3470239 + // CancelAllStopOrders Cancel All Stop orders + // Description: Cancel all untriggered stop orders. The response is a list of orderIDs of the canceled stop orders. To cancel triggered stop orders, please use 'Cancel Multiple Futures Limit orders'. + // Documentation: https://www.kucoin.com/docs-new/api-3470243 // +---------------------+---------+ // | Extra API Info | Value | // +---------------------+---------+ @@ -132,9 +131,9 @@ type OrderAPI interface { // | API-CHANNEL | PRIVATE | // | API-PERMISSION | FUTURES | // | API-RATE-LIMIT-POOL | FUTURES | - // | API-RATE-LIMIT | 1 | + // | API-RATE-LIMIT | 15 | // +---------------------+---------+ - CancelOrderById(req *CancelOrderByIdReq, ctx context.Context) (*CancelOrderByIdResp, error) + CancelAllStopOrders(req *CancelAllStopOrdersReq, ctx context.Context) (*CancelAllStopOrdersResp, error) // GetOrderByOrderId Get Order By OrderId // Description: Get a single order by order id (including a stop order). @@ -150,23 +149,23 @@ type OrderAPI interface { // +---------------------+---------+ GetOrderByOrderId(req *GetOrderByOrderIdReq, ctx context.Context) (*GetOrderByOrderIdResp, error) - // AddOrder Add Order - // Description: Place order to the futures trading system, you can place two major types of orders: limit and market. Orders can only be placed if your account has sufficient funds. Once an order is placed, your funds will be put on hold for the duration of the order. The amount of funds on hold depends on the order type and parameters specified. - // Documentation: https://www.kucoin.com/docs-new/api-3470235 + // GetOrderByClientOid Get Order By ClientOid + // Description: Get a single order by client order id (including a stop order). + // Documentation: https://www.kucoin.com/docs-new/api-3470352 // +---------------------+---------+ // | Extra API Info | Value | // +---------------------+---------+ // | API-DOMAIN | FUTURES | // | API-CHANNEL | PRIVATE | - // | API-PERMISSION | FUTURES | + // | API-PERMISSION | GENERAL | // | API-RATE-LIMIT-POOL | FUTURES | - // | API-RATE-LIMIT | 2 | + // | API-RATE-LIMIT | 5 | // +---------------------+---------+ - AddOrder(req *AddOrderReq, ctx context.Context) (*AddOrderResp, error) + GetOrderByClientOid(req *GetOrderByClientOidReq, ctx context.Context) (*GetOrderByClientOidResp, error) - // AddOrderTest Add Order Test - // Description: Place order to the futures trading system just for validation - // Documentation: https://www.kucoin.com/docs-new/api-3470238 + // GetOrderList Get Order List + // Description: List your current orders. + // Documentation: https://www.kucoin.com/docs-new/api-3470244 // +---------------------+---------+ // | Extra API Info | Value | // +---------------------+---------+ @@ -176,7 +175,7 @@ type OrderAPI interface { // | API-RATE-LIMIT-POOL | FUTURES | // | API-RATE-LIMIT | 2 | // +---------------------+---------+ - AddOrderTest(req *AddOrderTestReq, ctx context.Context) (*AddOrderTestResp, error) + GetOrderList(req *GetOrderListReq, ctx context.Context) (*GetOrderListResp, error) // GetRecentClosedOrders Get Recent Closed Orders // Description: Get a list of recent 1000 closed orders in the last 24 hours. If you need to get your recent traded order history with low latency, you may query this endpoint. @@ -192,9 +191,9 @@ type OrderAPI interface { // +---------------------+---------+ GetRecentClosedOrders(req *GetRecentClosedOrdersReq, ctx context.Context) (*GetRecentClosedOrdersResp, error) - // GetRecentTradeHistory Get Recent Trade History - // Description: Get a list of recent 1000 fills in the last 24 hours. If you need to get your recent traded order history with low latency, you may query this endpoint. - // Documentation: https://www.kucoin.com/docs-new/api-3470249 + // GetStopOrderList Get Stop Order List + // Description: Get the un-triggered stop orders list. Stop orders that have been triggered can be queried through the general order interface + // Documentation: https://www.kucoin.com/docs-new/api-3470247 // +---------------------+---------+ // | Extra API Info | Value | // +---------------------+---------+ @@ -202,13 +201,13 @@ type OrderAPI interface { // | API-CHANNEL | PRIVATE | // | API-PERMISSION | FUTURES | // | API-RATE-LIMIT-POOL | FUTURES | - // | API-RATE-LIMIT | 3 | + // | API-RATE-LIMIT | 6 | // +---------------------+---------+ - GetRecentTradeHistory(req *GetRecentTradeHistoryReq, ctx context.Context) (*GetRecentTradeHistoryResp, error) + GetStopOrderList(req *GetStopOrderListReq, ctx context.Context) (*GetStopOrderListResp, error) - // AddTPSLOrder Add Take Profit And Stop Loss Order - // Description: Place take profit and stop loss order supports both take-profit and stop-loss functions, and other functions are exactly the same as the place order interface. - // Documentation: https://www.kucoin.com/docs-new/api-3470237 + // GetOpenOrderValue Get Open Order Value + // Description: You can query this endpoint to get the the total number and value of the all your active orders. + // Documentation: https://www.kucoin.com/docs-new/api-3470250 // +---------------------+---------+ // | Extra API Info | Value | // +---------------------+---------+ @@ -216,13 +215,13 @@ type OrderAPI interface { // | API-CHANNEL | PRIVATE | // | API-PERMISSION | FUTURES | // | API-RATE-LIMIT-POOL | FUTURES | - // | API-RATE-LIMIT | 2 | + // | API-RATE-LIMIT | 10 | // +---------------------+---------+ - AddTPSLOrder(req *AddTPSLOrderReq, ctx context.Context) (*AddTPSLOrderResp, error) + GetOpenOrderValue(req *GetOpenOrderValueReq, ctx context.Context) (*GetOpenOrderValueResp, error) - // CancelAllStopOrders Cancel All Stop orders - // Description: Cancel all untriggered stop orders. The response is a list of orderIDs of the canceled stop orders. To cancel triggered stop orders, please use 'Cancel Multiple Futures Limit orders'. - // Documentation: https://www.kucoin.com/docs-new/api-3470243 + // GetRecentTradeHistory Get Recent Trade History + // Description: Get a list of recent 1000 fills in the last 24 hours. If you need to get your recent traded order history with low latency, you may query this endpoint. + // Documentation: https://www.kucoin.com/docs-new/api-3470249 // +---------------------+---------+ // | Extra API Info | Value | // +---------------------+---------+ @@ -230,13 +229,13 @@ type OrderAPI interface { // | API-CHANNEL | PRIVATE | // | API-PERMISSION | FUTURES | // | API-RATE-LIMIT-POOL | FUTURES | - // | API-RATE-LIMIT | 15 | + // | API-RATE-LIMIT | 3 | // +---------------------+---------+ - CancelAllStopOrders(req *CancelAllStopOrdersReq, ctx context.Context) (*CancelAllStopOrdersResp, error) + GetRecentTradeHistory(req *GetRecentTradeHistoryReq, ctx context.Context) (*GetRecentTradeHistoryResp, error) - // GetStopOrderList Get Stop Order List - // Description: Get the un-triggered stop orders list. Stop orders that have been triggered can be queried through the general order interface - // Documentation: https://www.kucoin.com/docs-new/api-3470247 + // GetTradeHistory Get Trade History + // Description: Get a list of recent fills. If you need to get your recent trade history with low latency, please query endpoint Get List of Orders Completed in 24h. The requested data is not real-time. + // Documentation: https://www.kucoin.com/docs-new/api-3470248 // +---------------------+---------+ // | Extra API Info | Value | // +---------------------+---------+ @@ -244,13 +243,13 @@ type OrderAPI interface { // | API-CHANNEL | PRIVATE | // | API-PERMISSION | FUTURES | // | API-RATE-LIMIT-POOL | FUTURES | - // | API-RATE-LIMIT | 6 | + // | API-RATE-LIMIT | 5 | // +---------------------+---------+ - GetStopOrderList(req *GetStopOrderListReq, ctx context.Context) (*GetStopOrderListResp, error) + GetTradeHistory(req *GetTradeHistoryReq, ctx context.Context) (*GetTradeHistoryResp, error) - // CancelAllOrdersV3 Cancel All Orders + // CancelAllOrdersV1 Cancel All Orders - V1 // Description: Cancel all open orders (excluding stop orders). The response is a list of orderIDs of the canceled orders. - // Documentation: https://www.kucoin.com/docs-new/api-3470242 + // Documentation: https://www.kucoin.com/docs-new/api-3470362 // +---------------------+---------+ // | Extra API Info | Value | // +---------------------+---------+ @@ -258,9 +257,10 @@ type OrderAPI interface { // | API-CHANNEL | PRIVATE | // | API-PERMISSION | FUTURES | // | API-RATE-LIMIT-POOL | FUTURES | - // | API-RATE-LIMIT | 10 | + // | API-RATE-LIMIT | 200 | // +---------------------+---------+ - CancelAllOrdersV3(req *CancelAllOrdersV3Req, ctx context.Context) (*CancelAllOrdersV3Resp, error) + // Deprecated + CancelAllOrdersV1(req *CancelAllOrdersV1Req, ctx context.Context) (*CancelAllOrdersV1Resp, error) } type OrderAPIImpl struct { @@ -271,39 +271,39 @@ func NewOrderAPIImp(transport interfaces.Transport) *OrderAPIImpl { return &OrderAPIImpl{transport: transport} } -func (impl *OrderAPIImpl) GetTradeHistory(req *GetTradeHistoryReq, ctx context.Context) (*GetTradeHistoryResp, error) { - resp := &GetTradeHistoryResp{} - err := impl.transport.Call(ctx, "futures", false, "Get", "/api/v1/fills", req, resp, false) +func (impl *OrderAPIImpl) AddOrder(req *AddOrderReq, ctx context.Context) (*AddOrderResp, error) { + resp := &AddOrderResp{} + err := impl.transport.Call(ctx, "futures", false, "Post", "/api/v1/orders", req, resp, false) return resp, err } -func (impl *OrderAPIImpl) GetOpenOrderValue(req *GetOpenOrderValueReq, ctx context.Context) (*GetOpenOrderValueResp, error) { - resp := &GetOpenOrderValueResp{} - err := impl.transport.Call(ctx, "futures", false, "Get", "/api/v1/openOrderStatistics", req, resp, false) +func (impl *OrderAPIImpl) AddOrderTest(req *AddOrderTestReq, ctx context.Context) (*AddOrderTestResp, error) { + resp := &AddOrderTestResp{} + err := impl.transport.Call(ctx, "futures", false, "Post", "/api/v1/orders/test", req, resp, false) return resp, err } -func (impl *OrderAPIImpl) GetOrderByClientOid(req *GetOrderByClientOidReq, ctx context.Context) (*GetOrderByClientOidResp, error) { - resp := &GetOrderByClientOidResp{} - err := impl.transport.Call(ctx, "futures", false, "Get", "/api/v1/orders/byClientOid", req, resp, false) +func (impl *OrderAPIImpl) BatchAddOrders(req *BatchAddOrdersReq, ctx context.Context) (*BatchAddOrdersResp, error) { + resp := &BatchAddOrdersResp{} + err := impl.transport.Call(ctx, "futures", false, "Post", "/api/v1/orders/multi", req, resp, false) return resp, err } -func (impl *OrderAPIImpl) CancelOrderByClientOid(req *CancelOrderByClientOidReq, ctx context.Context) (*CancelOrderByClientOidResp, error) { - resp := &CancelOrderByClientOidResp{} - err := impl.transport.Call(ctx, "futures", false, "Delete", "/api/v1/orders/client-order/{clientOid}", req, resp, false) +func (impl *OrderAPIImpl) AddTPSLOrder(req *AddTPSLOrderReq, ctx context.Context) (*AddTPSLOrderResp, error) { + resp := &AddTPSLOrderResp{} + err := impl.transport.Call(ctx, "futures", false, "Post", "/api/v1/st-orders", req, resp, false) return resp, err } -func (impl *OrderAPIImpl) CancelAllOrdersV1(req *CancelAllOrdersV1Req, ctx context.Context) (*CancelAllOrdersV1Resp, error) { - resp := &CancelAllOrdersV1Resp{} - err := impl.transport.Call(ctx, "futures", false, "Delete", "/api/v1/orders", req, resp, false) +func (impl *OrderAPIImpl) CancelOrderById(req *CancelOrderByIdReq, ctx context.Context) (*CancelOrderByIdResp, error) { + resp := &CancelOrderByIdResp{} + err := impl.transport.Call(ctx, "futures", false, "Delete", "/api/v1/orders/{orderId}", req, resp, false) return resp, err } -func (impl *OrderAPIImpl) GetOrderList(req *GetOrderListReq, ctx context.Context) (*GetOrderListResp, error) { - resp := &GetOrderListResp{} - err := impl.transport.Call(ctx, "futures", false, "Get", "/api/v1/orders", req, resp, false) +func (impl *OrderAPIImpl) CancelOrderByClientOid(req *CancelOrderByClientOidReq, ctx context.Context) (*CancelOrderByClientOidResp, error) { + resp := &CancelOrderByClientOidResp{} + err := impl.transport.Call(ctx, "futures", false, "Delete", "/api/v1/orders/client-order/{clientOid}", req, resp, false) return resp, err } @@ -313,15 +313,15 @@ func (impl *OrderAPIImpl) BatchCancelOrders(req *BatchCancelOrdersReq, ctx conte return resp, err } -func (impl *OrderAPIImpl) BatchAddOrders(req *BatchAddOrdersReq, ctx context.Context) (*BatchAddOrdersResp, error) { - resp := &BatchAddOrdersResp{} - err := impl.transport.Call(ctx, "futures", false, "Post", "/api/v1/orders/multi", req, resp, false) +func (impl *OrderAPIImpl) CancelAllOrdersV3(req *CancelAllOrdersV3Req, ctx context.Context) (*CancelAllOrdersV3Resp, error) { + resp := &CancelAllOrdersV3Resp{} + err := impl.transport.Call(ctx, "futures", false, "Delete", "/api/v3/orders", req, resp, false) return resp, err } -func (impl *OrderAPIImpl) CancelOrderById(req *CancelOrderByIdReq, ctx context.Context) (*CancelOrderByIdResp, error) { - resp := &CancelOrderByIdResp{} - err := impl.transport.Call(ctx, "futures", false, "Delete", "/api/v1/orders/{orderId}", req, resp, false) +func (impl *OrderAPIImpl) CancelAllStopOrders(req *CancelAllStopOrdersReq, ctx context.Context) (*CancelAllStopOrdersResp, error) { + resp := &CancelAllStopOrdersResp{} + err := impl.transport.Call(ctx, "futures", false, "Delete", "/api/v1/stopOrders", req, resp, false) return resp, err } @@ -331,15 +331,15 @@ func (impl *OrderAPIImpl) GetOrderByOrderId(req *GetOrderByOrderIdReq, ctx conte return resp, err } -func (impl *OrderAPIImpl) AddOrder(req *AddOrderReq, ctx context.Context) (*AddOrderResp, error) { - resp := &AddOrderResp{} - err := impl.transport.Call(ctx, "futures", false, "Post", "/api/v1/orders", req, resp, false) +func (impl *OrderAPIImpl) GetOrderByClientOid(req *GetOrderByClientOidReq, ctx context.Context) (*GetOrderByClientOidResp, error) { + resp := &GetOrderByClientOidResp{} + err := impl.transport.Call(ctx, "futures", false, "Get", "/api/v1/orders/byClientOid", req, resp, false) return resp, err } -func (impl *OrderAPIImpl) AddOrderTest(req *AddOrderTestReq, ctx context.Context) (*AddOrderTestResp, error) { - resp := &AddOrderTestResp{} - err := impl.transport.Call(ctx, "futures", false, "Post", "/api/v1/orders/test", req, resp, false) +func (impl *OrderAPIImpl) GetOrderList(req *GetOrderListReq, ctx context.Context) (*GetOrderListResp, error) { + resp := &GetOrderListResp{} + err := impl.transport.Call(ctx, "futures", false, "Get", "/api/v1/orders", req, resp, false) return resp, err } @@ -349,32 +349,32 @@ func (impl *OrderAPIImpl) GetRecentClosedOrders(req *GetRecentClosedOrdersReq, c return resp, err } -func (impl *OrderAPIImpl) GetRecentTradeHistory(req *GetRecentTradeHistoryReq, ctx context.Context) (*GetRecentTradeHistoryResp, error) { - resp := &GetRecentTradeHistoryResp{} - err := impl.transport.Call(ctx, "futures", false, "Get", "/api/v1/recentFills", req, resp, false) +func (impl *OrderAPIImpl) GetStopOrderList(req *GetStopOrderListReq, ctx context.Context) (*GetStopOrderListResp, error) { + resp := &GetStopOrderListResp{} + err := impl.transport.Call(ctx, "futures", false, "Get", "/api/v1/stopOrders", req, resp, false) return resp, err } -func (impl *OrderAPIImpl) AddTPSLOrder(req *AddTPSLOrderReq, ctx context.Context) (*AddTPSLOrderResp, error) { - resp := &AddTPSLOrderResp{} - err := impl.transport.Call(ctx, "futures", false, "Post", "/api/v1/st-orders", req, resp, false) +func (impl *OrderAPIImpl) GetOpenOrderValue(req *GetOpenOrderValueReq, ctx context.Context) (*GetOpenOrderValueResp, error) { + resp := &GetOpenOrderValueResp{} + err := impl.transport.Call(ctx, "futures", false, "Get", "/api/v1/openOrderStatistics", req, resp, false) return resp, err } -func (impl *OrderAPIImpl) CancelAllStopOrders(req *CancelAllStopOrdersReq, ctx context.Context) (*CancelAllStopOrdersResp, error) { - resp := &CancelAllStopOrdersResp{} - err := impl.transport.Call(ctx, "futures", false, "Delete", "/api/v1/stopOrders", req, resp, false) +func (impl *OrderAPIImpl) GetRecentTradeHistory(req *GetRecentTradeHistoryReq, ctx context.Context) (*GetRecentTradeHistoryResp, error) { + resp := &GetRecentTradeHistoryResp{} + err := impl.transport.Call(ctx, "futures", false, "Get", "/api/v1/recentFills", req, resp, false) return resp, err } -func (impl *OrderAPIImpl) GetStopOrderList(req *GetStopOrderListReq, ctx context.Context) (*GetStopOrderListResp, error) { - resp := &GetStopOrderListResp{} - err := impl.transport.Call(ctx, "futures", false, "Get", "/api/v1/stopOrders", req, resp, false) +func (impl *OrderAPIImpl) GetTradeHistory(req *GetTradeHistoryReq, ctx context.Context) (*GetTradeHistoryResp, error) { + resp := &GetTradeHistoryResp{} + err := impl.transport.Call(ctx, "futures", false, "Get", "/api/v1/fills", req, resp, false) return resp, err } -func (impl *OrderAPIImpl) CancelAllOrdersV3(req *CancelAllOrdersV3Req, ctx context.Context) (*CancelAllOrdersV3Resp, error) { - resp := &CancelAllOrdersV3Resp{} - err := impl.transport.Call(ctx, "futures", false, "Delete", "/api/v3/orders", req, resp, false) +func (impl *OrderAPIImpl) CancelAllOrdersV1(req *CancelAllOrdersV1Req, ctx context.Context) (*CancelAllOrdersV1Resp, error) { + resp := &CancelAllOrdersV1Resp{} + err := impl.transport.Call(ctx, "futures", false, "Delete", "/api/v1/orders", req, resp, false) return resp, err } diff --git a/sdk/golang/pkg/generate/futures/order/api_order.template b/sdk/golang/pkg/generate/futures/order/api_order.template index 6b84ede7..3181f0ee 100644 --- a/sdk/golang/pkg/generate/futures/order/api_order.template +++ b/sdk/golang/pkg/generate/futures/order/api_order.template @@ -1,16 +1,16 @@ # API FUNCTION TEMPLATE -func TestOrderGetTradeHistoryReq(t *testing.T) { - // GetTradeHistory - // Get Trade History - // /api/v1/fills +func TestOrderAddOrderReq(t *testing.T) { + // AddOrder + // Add Order + // /api/v1/orders - builder := order.NewGetTradeHistoryReqBuilder() - builder.SetOrderId(?).SetSymbol(?).SetSide(?).SetType(?).SetTradeTypes(?).SetStartAt(?).SetEndAt(?).SetCurrentPage(?).SetPageSize(?) + builder := order.NewAddOrderReqBuilder() + builder.SetClientOid(?).SetSide(?).SetSymbol(?).SetLeverage(?).SetType(?).SetRemark(?).SetStop(?).SetStopPriceType(?).SetStopPrice(?).SetReduceOnly(?).SetCloseOrder(?).SetForceHold(?).SetStp(?).SetMarginMode(?).SetPrice(?).SetSize(?).SetTimeInForce(?).SetPostOnly(?).SetHidden(?).SetIceberg(?).SetVisibleSize(?).SetQty(?).SetValueQty(?) req := builder.Build() - resp, err := orderApi.GetTradeHistory(req, context.TODO()) + resp, err := orderApi.AddOrder(req, context.TODO()) if err != nil { panic(err) } @@ -24,16 +24,16 @@ func TestOrderGetTradeHistoryReq(t *testing.T) { } -func TestOrderGetOpenOrderValueReq(t *testing.T) { - // GetOpenOrderValue - // Get Open Order Value - // /api/v1/openOrderStatistics +func TestOrderAddOrderTestReq(t *testing.T) { + // AddOrderTest + // Add Order Test + // /api/v1/orders/test - builder := order.NewGetOpenOrderValueReqBuilder() - builder.SetSymbol(?) + builder := order.NewAddOrderTestReqBuilder() + builder.SetClientOid(?).SetSide(?).SetSymbol(?).SetLeverage(?).SetType(?).SetRemark(?).SetStop(?).SetStopPriceType(?).SetStopPrice(?).SetReduceOnly(?).SetCloseOrder(?).SetForceHold(?).SetStp(?).SetMarginMode(?).SetPrice(?).SetSize(?).SetTimeInForce(?).SetPostOnly(?).SetHidden(?).SetIceberg(?).SetVisibleSize(?).SetQty(?).SetValueQty(?) req := builder.Build() - resp, err := orderApi.GetOpenOrderValue(req, context.TODO()) + resp, err := orderApi.AddOrderTest(req, context.TODO()) if err != nil { panic(err) } @@ -47,16 +47,16 @@ func TestOrderGetOpenOrderValueReq(t *testing.T) { } -func TestOrderGetOrderByClientOidReq(t *testing.T) { - // GetOrderByClientOid - // Get Order By ClientOid - // /api/v1/orders/byClientOid +func TestOrderBatchAddOrdersReq(t *testing.T) { + // BatchAddOrders + // Batch Add Orders + // /api/v1/orders/multi - builder := order.NewGetOrderByClientOidReqBuilder() - builder.SetClientOid(?) + builder := order.NewBatchAddOrdersReqBuilder() + builder.SetItems(?) req := builder.Build() - resp, err := orderApi.GetOrderByClientOid(req, context.TODO()) + resp, err := orderApi.BatchAddOrders(req, context.TODO()) if err != nil { panic(err) } @@ -70,16 +70,16 @@ func TestOrderGetOrderByClientOidReq(t *testing.T) { } -func TestOrderCancelOrderByClientOidReq(t *testing.T) { - // CancelOrderByClientOid - // Cancel Order By ClientOid - // /api/v1/orders/client-order/{clientOid} +func TestOrderAddTPSLOrderReq(t *testing.T) { + // AddTPSLOrder + // Add Take Profit And Stop Loss Order + // /api/v1/st-orders - builder := order.NewCancelOrderByClientOidReqBuilder() - builder.SetSymbol(?).SetClientOid(?) + builder := order.NewAddTPSLOrderReqBuilder() + builder.SetClientOid(?).SetSide(?).SetSymbol(?).SetLeverage(?).SetType(?).SetRemark(?).SetStopPriceType(?).SetReduceOnly(?).SetCloseOrder(?).SetForceHold(?).SetStp(?).SetMarginMode(?).SetPrice(?).SetSize(?).SetTimeInForce(?).SetPostOnly(?).SetHidden(?).SetIceberg(?).SetVisibleSize(?).SetTriggerStopUpPrice(?).SetTriggerStopDownPrice(?).SetQty(?).SetValueQty(?) req := builder.Build() - resp, err := orderApi.CancelOrderByClientOid(req, context.TODO()) + resp, err := orderApi.AddTPSLOrder(req, context.TODO()) if err != nil { panic(err) } @@ -93,16 +93,16 @@ func TestOrderCancelOrderByClientOidReq(t *testing.T) { } -func TestOrderCancelAllOrdersV1Req(t *testing.T) { - // CancelAllOrdersV1 - // Cancel All Orders - V1 - // /api/v1/orders +func TestOrderCancelOrderByIdReq(t *testing.T) { + // CancelOrderById + // Cancel Order By OrderId + // /api/v1/orders/{orderId} - builder := order.NewCancelAllOrdersV1ReqBuilder() - builder.SetSymbol(?) + builder := order.NewCancelOrderByIdReqBuilder() + builder.SetOrderId(?) req := builder.Build() - resp, err := orderApi.CancelAllOrdersV1(req, context.TODO()) + resp, err := orderApi.CancelOrderById(req, context.TODO()) if err != nil { panic(err) } @@ -116,16 +116,16 @@ func TestOrderCancelAllOrdersV1Req(t *testing.T) { } -func TestOrderGetOrderListReq(t *testing.T) { - // GetOrderList - // Get Order List - // /api/v1/orders +func TestOrderCancelOrderByClientOidReq(t *testing.T) { + // CancelOrderByClientOid + // Cancel Order By ClientOid + // /api/v1/orders/client-order/{clientOid} - builder := order.NewGetOrderListReqBuilder() - builder.SetStatus(?).SetSymbol(?).SetSide(?).SetType(?).SetStartAt(?).SetEndAt(?).SetCurrentPage(?).SetPageSize(?) + builder := order.NewCancelOrderByClientOidReqBuilder() + builder.SetSymbol(?).SetClientOid(?) req := builder.Build() - resp, err := orderApi.GetOrderList(req, context.TODO()) + resp, err := orderApi.CancelOrderByClientOid(req, context.TODO()) if err != nil { panic(err) } @@ -162,16 +162,16 @@ func TestOrderBatchCancelOrdersReq(t *testing.T) { } -func TestOrderBatchAddOrdersReq(t *testing.T) { - // BatchAddOrders - // Batch Add Orders - // /api/v1/orders/multi +func TestOrderCancelAllOrdersV3Req(t *testing.T) { + // CancelAllOrdersV3 + // Cancel All Orders + // /api/v3/orders - builder := order.NewBatchAddOrdersReqBuilder() - builder.SetItems(?) + builder := order.NewCancelAllOrdersV3ReqBuilder() + builder.SetSymbol(?) req := builder.Build() - resp, err := orderApi.BatchAddOrders(req, context.TODO()) + resp, err := orderApi.CancelAllOrdersV3(req, context.TODO()) if err != nil { panic(err) } @@ -185,16 +185,16 @@ func TestOrderBatchAddOrdersReq(t *testing.T) { } -func TestOrderCancelOrderByIdReq(t *testing.T) { - // CancelOrderById - // Cancel Order By OrderId - // /api/v1/orders/{orderId} +func TestOrderCancelAllStopOrdersReq(t *testing.T) { + // CancelAllStopOrders + // Cancel All Stop orders + // /api/v1/stopOrders - builder := order.NewCancelOrderByIdReqBuilder() - builder.SetOrderId(?) + builder := order.NewCancelAllStopOrdersReqBuilder() + builder.SetSymbol(?) req := builder.Build() - resp, err := orderApi.CancelOrderById(req, context.TODO()) + resp, err := orderApi.CancelAllStopOrders(req, context.TODO()) if err != nil { panic(err) } @@ -231,16 +231,16 @@ func TestOrderGetOrderByOrderIdReq(t *testing.T) { } -func TestOrderAddOrderReq(t *testing.T) { - // AddOrder - // Add Order - // /api/v1/orders +func TestOrderGetOrderByClientOidReq(t *testing.T) { + // GetOrderByClientOid + // Get Order By ClientOid + // /api/v1/orders/byClientOid - builder := order.NewAddOrderReqBuilder() - builder.SetClientOid(?).SetSide(?).SetSymbol(?).SetLeverage(?).SetType(?).SetRemark(?).SetStop(?).SetStopPriceType(?).SetStopPrice(?).SetReduceOnly(?).SetCloseOrder(?).SetForceHold(?).SetStp(?).SetMarginMode(?).SetPrice(?).SetSize(?).SetTimeInForce(?).SetPostOnly(?).SetHidden(?).SetIceberg(?).SetVisibleSize(?).SetQty(?).SetValueQty(?) + builder := order.NewGetOrderByClientOidReqBuilder() + builder.SetClientOid(?) req := builder.Build() - resp, err := orderApi.AddOrder(req, context.TODO()) + resp, err := orderApi.GetOrderByClientOid(req, context.TODO()) if err != nil { panic(err) } @@ -254,16 +254,16 @@ func TestOrderAddOrderReq(t *testing.T) { } -func TestOrderAddOrderTestReq(t *testing.T) { - // AddOrderTest - // Add Order Test - // /api/v1/orders/test +func TestOrderGetOrderListReq(t *testing.T) { + // GetOrderList + // Get Order List + // /api/v1/orders - builder := order.NewAddOrderTestReqBuilder() - builder.SetClientOid(?).SetSide(?).SetSymbol(?).SetLeverage(?).SetType(?).SetRemark(?).SetStop(?).SetStopPriceType(?).SetStopPrice(?).SetReduceOnly(?).SetCloseOrder(?).SetForceHold(?).SetStp(?).SetMarginMode(?).SetPrice(?).SetSize(?).SetTimeInForce(?).SetPostOnly(?).SetHidden(?).SetIceberg(?).SetVisibleSize(?).SetQty(?).SetValueQty(?) + builder := order.NewGetOrderListReqBuilder() + builder.SetStatus(?).SetSymbol(?).SetSide(?).SetType(?).SetStartAt(?).SetEndAt(?).SetCurrentPage(?).SetPageSize(?) req := builder.Build() - resp, err := orderApi.AddOrderTest(req, context.TODO()) + resp, err := orderApi.GetOrderList(req, context.TODO()) if err != nil { panic(err) } @@ -300,16 +300,16 @@ func TestOrderGetRecentClosedOrdersReq(t *testing.T) { } -func TestOrderGetRecentTradeHistoryReq(t *testing.T) { - // GetRecentTradeHistory - // Get Recent Trade History - // /api/v1/recentFills +func TestOrderGetStopOrderListReq(t *testing.T) { + // GetStopOrderList + // Get Stop Order List + // /api/v1/stopOrders - builder := order.NewGetRecentTradeHistoryReqBuilder() - builder.SetSymbol(?) + builder := order.NewGetStopOrderListReqBuilder() + builder.SetSymbol(?).SetSide(?).SetType(?).SetStartAt(?).SetEndAt(?).SetCurrentPage(?).SetPageSize(?) req := builder.Build() - resp, err := orderApi.GetRecentTradeHistory(req, context.TODO()) + resp, err := orderApi.GetStopOrderList(req, context.TODO()) if err != nil { panic(err) } @@ -323,16 +323,16 @@ func TestOrderGetRecentTradeHistoryReq(t *testing.T) { } -func TestOrderAddTPSLOrderReq(t *testing.T) { - // AddTPSLOrder - // Add Take Profit And Stop Loss Order - // /api/v1/st-orders +func TestOrderGetOpenOrderValueReq(t *testing.T) { + // GetOpenOrderValue + // Get Open Order Value + // /api/v1/openOrderStatistics - builder := order.NewAddTPSLOrderReqBuilder() - builder.SetClientOid(?).SetSide(?).SetSymbol(?).SetLeverage(?).SetType(?).SetRemark(?).SetStopPriceType(?).SetReduceOnly(?).SetCloseOrder(?).SetForceHold(?).SetStp(?).SetMarginMode(?).SetPrice(?).SetSize(?).SetTimeInForce(?).SetPostOnly(?).SetHidden(?).SetIceberg(?).SetVisibleSize(?).SetTriggerStopUpPrice(?).SetTriggerStopDownPrice(?).SetQty(?).SetValueQty(?) + builder := order.NewGetOpenOrderValueReqBuilder() + builder.SetSymbol(?) req := builder.Build() - resp, err := orderApi.AddTPSLOrder(req, context.TODO()) + resp, err := orderApi.GetOpenOrderValue(req, context.TODO()) if err != nil { panic(err) } @@ -346,16 +346,16 @@ func TestOrderAddTPSLOrderReq(t *testing.T) { } -func TestOrderCancelAllStopOrdersReq(t *testing.T) { - // CancelAllStopOrders - // Cancel All Stop orders - // /api/v1/stopOrders +func TestOrderGetRecentTradeHistoryReq(t *testing.T) { + // GetRecentTradeHistory + // Get Recent Trade History + // /api/v1/recentFills - builder := order.NewCancelAllStopOrdersReqBuilder() + builder := order.NewGetRecentTradeHistoryReqBuilder() builder.SetSymbol(?) req := builder.Build() - resp, err := orderApi.CancelAllStopOrders(req, context.TODO()) + resp, err := orderApi.GetRecentTradeHistory(req, context.TODO()) if err != nil { panic(err) } @@ -369,16 +369,16 @@ func TestOrderCancelAllStopOrdersReq(t *testing.T) { } -func TestOrderGetStopOrderListReq(t *testing.T) { - // GetStopOrderList - // Get Stop Order List - // /api/v1/stopOrders +func TestOrderGetTradeHistoryReq(t *testing.T) { + // GetTradeHistory + // Get Trade History + // /api/v1/fills - builder := order.NewGetStopOrderListReqBuilder() - builder.SetSymbol(?).SetSide(?).SetType(?).SetStartAt(?).SetEndAt(?).SetCurrentPage(?).SetPageSize(?) + builder := order.NewGetTradeHistoryReqBuilder() + builder.SetOrderId(?).SetSymbol(?).SetSide(?).SetType(?).SetTradeTypes(?).SetStartAt(?).SetEndAt(?).SetCurrentPage(?).SetPageSize(?) req := builder.Build() - resp, err := orderApi.GetStopOrderList(req, context.TODO()) + resp, err := orderApi.GetTradeHistory(req, context.TODO()) if err != nil { panic(err) } @@ -392,16 +392,16 @@ func TestOrderGetStopOrderListReq(t *testing.T) { } -func TestOrderCancelAllOrdersV3Req(t *testing.T) { - // CancelAllOrdersV3 - // Cancel All Orders - // /api/v3/orders +func TestOrderCancelAllOrdersV1Req(t *testing.T) { + // CancelAllOrdersV1 + // Cancel All Orders - V1 + // /api/v1/orders - builder := order.NewCancelAllOrdersV3ReqBuilder() + builder := order.NewCancelAllOrdersV1ReqBuilder() builder.SetSymbol(?) req := builder.Build() - resp, err := orderApi.CancelAllOrdersV3(req, context.TODO()) + resp, err := orderApi.CancelAllOrdersV1(req, context.TODO()) if err != nil { panic(err) } diff --git a/sdk/golang/pkg/generate/futures/order/api_order_test.go b/sdk/golang/pkg/generate/futures/order/api_order_test.go index 9a599441..17d5e6ac 100644 --- a/sdk/golang/pkg/generate/futures/order/api_order_test.go +++ b/sdk/golang/pkg/generate/futures/order/api_order_test.go @@ -7,169 +7,169 @@ import ( "testing" ) -func TestOrderGetTradeHistoryReqModel(t *testing.T) { - // GetTradeHistory - // Get Trade History - // /api/v1/fills +func TestOrderAddOrderReqModel(t *testing.T) { + // AddOrder + // Add Order + // /api/v1/orders - data := "{\"orderId\": \"236655147005071361\", \"symbol\": \"example_string_default_value\", \"side\": \"buy\", \"type\": \"limit\", \"tradeTypes\": \"trade\", \"startAt\": 123456, \"endAt\": 123456, \"currentPage\": 1, \"pageSize\": 50}" - req := &GetTradeHistoryReq{} + data := "{\"clientOid\": \"5c52e11203aa677f33e493fb\", \"side\": \"buy\", \"symbol\": \"XBTUSDTM\", \"leverage\": 3, \"type\": \"limit\", \"remark\": \"order remarks\", \"reduceOnly\": false, \"marginMode\": \"ISOLATED\", \"price\": \"0.1\", \"size\": 1, \"timeInForce\": \"GTC\"}" + req := &AddOrderReq{} err := json.Unmarshal([]byte(data), req) req.ToMap() assert.Nil(t, err) } -func TestOrderGetTradeHistoryRespModel(t *testing.T) { - // GetTradeHistory - // Get Trade History - // /api/v1/fills +func TestOrderAddOrderRespModel(t *testing.T) { + // AddOrder + // Add Order + // /api/v1/orders - data := "{\n \"code\": \"200000\",\n \"data\": {\n \"currentPage\": 1,\n \"pageSize\": 50,\n \"totalNum\": 2,\n \"totalPage\": 1,\n \"items\": [\n {\n \"symbol\": \"XBTUSDTM\",\n \"tradeId\": \"1784277229880\",\n \"orderId\": \"236317213710184449\",\n \"side\": \"buy\",\n \"liquidity\": \"taker\",\n \"forceTaker\": false,\n \"price\": \"67430.9\",\n \"size\": 1,\n \"value\": \"67.4309\",\n \"openFeePay\": \"0.04045854\",\n \"closeFeePay\": \"0\",\n \"stop\": \"\",\n \"feeRate\": \"0.00060\",\n \"fixFee\": \"0\",\n \"feeCurrency\": \"USDT\",\n \"marginMode\": \"ISOLATED\",\n \"settleCurrency\": \"USDT\",\n \"fee\": \"0.04045854\",\n \"orderType\": \"market\",\n \"displayType\": \"market\",\n \"tradeType\": \"trade\",\n \"subTradeType\": null,\n \"tradeTime\": 1729155616320000000,\n \"createdAt\": 1729155616493\n },\n {\n \"symbol\": \"XBTUSDTM\",\n \"tradeId\": \"1784277132002\",\n \"orderId\": \"236317094436728832\",\n \"side\": \"buy\",\n \"liquidity\": \"taker\",\n \"forceTaker\": false,\n \"price\": \"67445\",\n \"size\": 1,\n \"value\": \"67.445\",\n \"openFeePay\": \"0\",\n \"closeFeePay\": \"0.040467\",\n \"stop\": \"\",\n \"feeRate\": \"0.00060\",\n \"fixFee\": \"0\",\n \"feeCurrency\": \"USDT\",\n \"marginMode\": \"ISOLATED\",\n \"settleCurrency\": \"USDT\",\n \"fee\": \"0.040467\",\n \"orderType\": \"market\",\n \"displayType\": \"market\",\n \"tradeType\": \"trade\",\n \"subTradeType\": null,\n \"tradeTime\": 1729155587944000000,\n \"createdAt\": 1729155588104\n }\n ]\n }\n}" + data := "{\n \"code\": \"200000\",\n \"data\": {\n \"orderId\": \"234125150956625920\",\n \"clientOid\": \"5c52e11203aa677f33e493fb\"\n }\n}" commonResp := &types.RestResponse{} err := json.Unmarshal([]byte(data), commonResp) assert.Nil(t, err) assert.NotNil(t, commonResp.Data) - resp := &GetTradeHistoryResp{} + resp := &AddOrderResp{} err = json.Unmarshal([]byte(commonResp.Data), resp) resp.ToMap() assert.Nil(t, err) } -func TestOrderGetOpenOrderValueReqModel(t *testing.T) { - // GetOpenOrderValue - // Get Open Order Value - // /api/v1/openOrderStatistics +func TestOrderAddOrderTestReqModel(t *testing.T) { + // AddOrderTest + // Add Order Test + // /api/v1/orders/test - data := "{\"symbol\": \"XBTUSDTM\"}" - req := &GetOpenOrderValueReq{} + data := "{\"clientOid\": \"5c52e11203aa677f33e493fb\", \"side\": \"buy\", \"symbol\": \"XBTUSDTM\", \"leverage\": 3, \"type\": \"limit\", \"remark\": \"order remarks\", \"reduceOnly\": false, \"marginMode\": \"ISOLATED\", \"price\": \"0.1\", \"size\": 1, \"timeInForce\": \"GTC\"}" + req := &AddOrderTestReq{} err := json.Unmarshal([]byte(data), req) req.ToMap() assert.Nil(t, err) } -func TestOrderGetOpenOrderValueRespModel(t *testing.T) { - // GetOpenOrderValue - // Get Open Order Value - // /api/v1/openOrderStatistics +func TestOrderAddOrderTestRespModel(t *testing.T) { + // AddOrderTest + // Add Order Test + // /api/v1/orders/test - data := "{\n \"code\": \"200000\",\n \"data\": {\n \"openOrderBuySize\": 1,\n \"openOrderSellSize\": 0,\n \"openOrderBuyCost\": \"0.0001\",\n \"openOrderSellCost\": \"0\",\n \"settleCurrency\": \"USDT\"\n }\n}" + data := "{\n \"code\": \"200000\",\n \"data\": {\n \"orderId\": \"234125150956625920\",\n \"clientOid\": \"5c52e11203aa677f33e493fb\"\n }\n}" commonResp := &types.RestResponse{} err := json.Unmarshal([]byte(data), commonResp) assert.Nil(t, err) assert.NotNil(t, commonResp.Data) - resp := &GetOpenOrderValueResp{} + resp := &AddOrderTestResp{} err = json.Unmarshal([]byte(commonResp.Data), resp) resp.ToMap() assert.Nil(t, err) } -func TestOrderGetOrderByClientOidReqModel(t *testing.T) { - // GetOrderByClientOid - // Get Order By ClientOid - // /api/v1/orders/byClientOid +func TestOrderBatchAddOrdersReqModel(t *testing.T) { + // BatchAddOrders + // Batch Add Orders + // /api/v1/orders/multi - data := "{\"clientOid\": \"5c52e11203aa677f33e493fb\"}" - req := &GetOrderByClientOidReq{} + data := "[{\"clientOid\": \"5c52e11203aa677f33e493fb\", \"side\": \"buy\", \"symbol\": \"XBTUSDTM\", \"leverage\": 3, \"type\": \"limit\", \"remark\": \"order remarks\", \"reduceOnly\": false, \"marginMode\": \"ISOLATED\", \"price\": \"0.1\", \"size\": 1, \"timeInForce\": \"GTC\"}, {\"clientOid\": \"5c52e11203aa677f33e493fc\", \"side\": \"buy\", \"symbol\": \"XBTUSDTM\", \"leverage\": 3, \"type\": \"limit\", \"remark\": \"order remarks\", \"reduceOnly\": false, \"marginMode\": \"ISOLATED\", \"price\": \"0.1\", \"size\": 1, \"timeInForce\": \"GTC\"}]" + req := &BatchAddOrdersReq{} err := json.Unmarshal([]byte(data), req) req.ToMap() assert.Nil(t, err) } -func TestOrderGetOrderByClientOidRespModel(t *testing.T) { - // GetOrderByClientOid - // Get Order By ClientOid - // /api/v1/orders/byClientOid +func TestOrderBatchAddOrdersRespModel(t *testing.T) { + // BatchAddOrders + // Batch Add Orders + // /api/v1/orders/multi - data := "{\n \"code\": \"200000\",\n \"data\": {\n \"id\": \"250444645610336256\",\n \"symbol\": \"XRPUSDTM\",\n \"type\": \"limit\",\n \"side\": \"buy\",\n \"price\": \"0.1\",\n \"size\": 1,\n \"value\": \"1\",\n \"dealValue\": \"0\",\n \"dealSize\": 0,\n \"stp\": \"\",\n \"stop\": \"\",\n \"stopPriceType\": \"\",\n \"stopTriggered\": false,\n \"stopPrice\": null,\n \"timeInForce\": \"GTC\",\n \"postOnly\": false,\n \"hidden\": false,\n \"iceberg\": false,\n \"leverage\": \"3\",\n \"forceHold\": false,\n \"closeOrder\": false,\n \"visibleSize\": 0,\n \"clientOid\": \"5c52e11203aa677f33e493fb\",\n \"remark\": null,\n \"tags\": \"\",\n \"isActive\": true,\n \"cancelExist\": false,\n \"createdAt\": 1732523858568,\n \"updatedAt\": 1732523858568,\n \"endAt\": null,\n \"orderTime\": 1732523858550892322,\n \"settleCurrency\": \"USDT\",\n \"marginMode\": \"ISOLATED\",\n \"avgDealPrice\": \"0\",\n \"filledSize\": 0,\n \"filledValue\": \"0\",\n \"status\": \"open\",\n \"reduceOnly\": false\n }\n}" + data := "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"orderId\": \"235919387779985408\",\n \"clientOid\": \"5c52e11203aa677f33e493fb\",\n \"symbol\": \"XBTUSDTM\",\n \"code\": \"200000\",\n \"msg\": \"success\"\n },\n {\n \"orderId\": \"235919387855482880\",\n \"clientOid\": \"5c52e11203aa677f33e493fc\",\n \"symbol\": \"XBTUSDTM\",\n \"code\": \"200000\",\n \"msg\": \"success\"\n }\n ]\n}" commonResp := &types.RestResponse{} err := json.Unmarshal([]byte(data), commonResp) assert.Nil(t, err) assert.NotNil(t, commonResp.Data) - resp := &GetOrderByClientOidResp{} + resp := &BatchAddOrdersResp{} err = json.Unmarshal([]byte(commonResp.Data), resp) resp.ToMap() assert.Nil(t, err) } -func TestOrderCancelOrderByClientOidReqModel(t *testing.T) { - // CancelOrderByClientOid - // Cancel Order By ClientOid - // /api/v1/orders/client-order/{clientOid} +func TestOrderAddTPSLOrderReqModel(t *testing.T) { + // AddTPSLOrder + // Add Take Profit And Stop Loss Order + // /api/v1/st-orders - data := "{\"symbol\": \"XBTUSDTM\", \"clientOid\": \"example_string_default_value\"}" - req := &CancelOrderByClientOidReq{} + data := "{\"clientOid\": \"5c52e11203aa677f33e493fb\", \"side\": \"buy\", \"symbol\": \"XBTUSDTM\", \"leverage\": 3, \"type\": \"limit\", \"remark\": \"order remarks\", \"reduceOnly\": false, \"marginMode\": \"ISOLATED\", \"price\": \"0.2\", \"size\": 1, \"timeInForce\": \"GTC\", \"triggerStopUpPrice\": \"0.3\", \"triggerStopDownPrice\": \"0.1\", \"stopPriceType\": \"TP\"}" + req := &AddTPSLOrderReq{} err := json.Unmarshal([]byte(data), req) req.ToMap() assert.Nil(t, err) } -func TestOrderCancelOrderByClientOidRespModel(t *testing.T) { - // CancelOrderByClientOid - // Cancel Order By ClientOid - // /api/v1/orders/client-order/{clientOid} +func TestOrderAddTPSLOrderRespModel(t *testing.T) { + // AddTPSLOrder + // Add Take Profit And Stop Loss Order + // /api/v1/st-orders - data := "{\n \"code\": \"200000\",\n \"data\": {\n \"clientOid\": \"017485b0-2957-4681-8a14-5d46b35aee0d\"\n }\n}" + data := "{\n \"code\": \"200000\",\n \"data\": {\n \"orderId\": \"234125150956625920\",\n \"clientOid\": \"5c52e11203aa677f33e493fb\"\n }\n}" commonResp := &types.RestResponse{} err := json.Unmarshal([]byte(data), commonResp) assert.Nil(t, err) assert.NotNil(t, commonResp.Data) - resp := &CancelOrderByClientOidResp{} + resp := &AddTPSLOrderResp{} err = json.Unmarshal([]byte(commonResp.Data), resp) resp.ToMap() assert.Nil(t, err) } -func TestOrderCancelAllOrdersV1ReqModel(t *testing.T) { - // CancelAllOrdersV1 - // Cancel All Orders - V1 - // /api/v1/orders +func TestOrderCancelOrderByIdReqModel(t *testing.T) { + // CancelOrderById + // Cancel Order By OrderId + // /api/v1/orders/{orderId} - data := "{\"symbol\": \"XBTUSDTM\"}" - req := &CancelAllOrdersV1Req{} + data := "{\"orderId\": \"example_string_default_value\"}" + req := &CancelOrderByIdReq{} err := json.Unmarshal([]byte(data), req) req.ToMap() assert.Nil(t, err) } -func TestOrderCancelAllOrdersV1RespModel(t *testing.T) { - // CancelAllOrdersV1 - // Cancel All Orders - V1 - // /api/v1/orders +func TestOrderCancelOrderByIdRespModel(t *testing.T) { + // CancelOrderById + // Cancel Order By OrderId + // /api/v1/orders/{orderId} - data := "{\n \"code\": \"200000\",\n \"data\": {\n \"cancelledOrderIds\": [\n \"235919172150824960\",\n \"235919172150824961\"\n ]\n }\n}" + data := "{\n \"code\": \"200000\",\n \"data\": {\n \"cancelledOrderIds\": [\n \"235303670076489728\"\n ]\n }\n}" commonResp := &types.RestResponse{} err := json.Unmarshal([]byte(data), commonResp) assert.Nil(t, err) assert.NotNil(t, commonResp.Data) - resp := &CancelAllOrdersV1Resp{} + resp := &CancelOrderByIdResp{} err = json.Unmarshal([]byte(commonResp.Data), resp) resp.ToMap() assert.Nil(t, err) } -func TestOrderGetOrderListReqModel(t *testing.T) { - // GetOrderList - // Get Order List - // /api/v1/orders +func TestOrderCancelOrderByClientOidReqModel(t *testing.T) { + // CancelOrderByClientOid + // Cancel Order By ClientOid + // /api/v1/orders/client-order/{clientOid} - data := "{\"status\": \"done\", \"symbol\": \"example_string_default_value\", \"side\": \"buy\", \"type\": \"limit\", \"startAt\": 123456, \"endAt\": 123456, \"currentPage\": 123456, \"pageSize\": 123456}" - req := &GetOrderListReq{} + data := "{\"symbol\": \"XBTUSDTM\", \"clientOid\": \"example_string_default_value\"}" + req := &CancelOrderByClientOidReq{} err := json.Unmarshal([]byte(data), req) req.ToMap() assert.Nil(t, err) } -func TestOrderGetOrderListRespModel(t *testing.T) { - // GetOrderList - // Get Order List - // /api/v1/orders +func TestOrderCancelOrderByClientOidRespModel(t *testing.T) { + // CancelOrderByClientOid + // Cancel Order By ClientOid + // /api/v1/orders/client-order/{clientOid} - data := "{\n \"code\": \"200000\",\n \"data\": {\n \"currentPage\": 1,\n \"pageSize\": 50,\n \"totalNum\": 1,\n \"totalPage\": 1,\n \"items\": [\n {\n \"id\": \"230181737576050688\",\n \"symbol\": \"PEOPLEUSDTM\",\n \"type\": \"limit\",\n \"side\": \"buy\",\n \"price\": \"0.05\",\n \"size\": 10,\n \"value\": \"5\",\n \"dealValue\": \"0\",\n \"dealSize\": 0,\n \"stp\": \"\",\n \"stop\": \"\",\n \"stopPriceType\": \"\",\n \"stopTriggered\": false,\n \"stopPrice\": null,\n \"timeInForce\": \"GTC\",\n \"postOnly\": false,\n \"hidden\": false,\n \"iceberg\": false,\n \"leverage\": \"1\",\n \"forceHold\": false,\n \"closeOrder\": false,\n \"visibleSize\": 0,\n \"clientOid\": \"5a80bd847f1811ef8a7faa665a37b3d7\",\n \"remark\": null,\n \"tags\": \"\",\n \"isActive\": true,\n \"cancelExist\": false,\n \"createdAt\": 1727692804813,\n \"updatedAt\": 1727692804813,\n \"endAt\": null,\n \"orderTime\": 1727692804808418000,\n \"settleCurrency\": \"USDT\",\n \"marginMode\": \"ISOLATED\",\n \"avgDealPrice\": \"0\",\n \"filledSize\": 0,\n \"filledValue\": \"0\",\n \"status\": \"open\",\n \"reduceOnly\": false\n }\n ]\n }\n}" + data := "{\n \"code\": \"200000\",\n \"data\": {\n \"clientOid\": \"017485b0-2957-4681-8a14-5d46b35aee0d\"\n }\n}" commonResp := &types.RestResponse{} err := json.Unmarshal([]byte(data), commonResp) assert.Nil(t, err) assert.NotNil(t, commonResp.Data) - resp := &GetOrderListResp{} + resp := &CancelOrderByClientOidResp{} err = json.Unmarshal([]byte(commonResp.Data), resp) resp.ToMap() assert.Nil(t, err) @@ -203,57 +203,57 @@ func TestOrderBatchCancelOrdersRespModel(t *testing.T) { assert.Nil(t, err) } -func TestOrderBatchAddOrdersReqModel(t *testing.T) { - // BatchAddOrders - // Batch Add Orders - // /api/v1/orders/multi +func TestOrderCancelAllOrdersV3ReqModel(t *testing.T) { + // CancelAllOrdersV3 + // Cancel All Orders + // /api/v3/orders - data := "[{\"clientOid\": \"5c52e11203aa677f33e493fb\", \"side\": \"buy\", \"symbol\": \"XBTUSDTM\", \"leverage\": 3, \"type\": \"limit\", \"remark\": \"order remarks\", \"reduceOnly\": false, \"marginMode\": \"ISOLATED\", \"price\": \"0.1\", \"size\": 1, \"timeInForce\": \"GTC\"}, {\"clientOid\": \"5c52e11203aa677f33e493fc\", \"side\": \"buy\", \"symbol\": \"XBTUSDTM\", \"leverage\": 3, \"type\": \"limit\", \"remark\": \"order remarks\", \"reduceOnly\": false, \"marginMode\": \"ISOLATED\", \"price\": \"0.1\", \"size\": 1, \"timeInForce\": \"GTC\"}]" - req := &BatchAddOrdersReq{} + data := "{\"symbol\": \"XBTUSDTM\"}" + req := &CancelAllOrdersV3Req{} err := json.Unmarshal([]byte(data), req) req.ToMap() assert.Nil(t, err) } -func TestOrderBatchAddOrdersRespModel(t *testing.T) { - // BatchAddOrders - // Batch Add Orders - // /api/v1/orders/multi +func TestOrderCancelAllOrdersV3RespModel(t *testing.T) { + // CancelAllOrdersV3 + // Cancel All Orders + // /api/v3/orders - data := "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"orderId\": \"235919387779985408\",\n \"clientOid\": \"5c52e11203aa677f33e493fb\",\n \"symbol\": \"XBTUSDTM\",\n \"code\": \"200000\",\n \"msg\": \"success\"\n },\n {\n \"orderId\": \"235919387855482880\",\n \"clientOid\": \"5c52e11203aa677f33e493fc\",\n \"symbol\": \"XBTUSDTM\",\n \"code\": \"200000\",\n \"msg\": \"success\"\n }\n ]\n}" + data := "{\n \"code\": \"200000\",\n \"data\": {\n \"cancelledOrderIds\": [\n \"235919172150824960\",\n \"235919172150824961\"\n ]\n }\n}" commonResp := &types.RestResponse{} err := json.Unmarshal([]byte(data), commonResp) assert.Nil(t, err) assert.NotNil(t, commonResp.Data) - resp := &BatchAddOrdersResp{} + resp := &CancelAllOrdersV3Resp{} err = json.Unmarshal([]byte(commonResp.Data), resp) resp.ToMap() assert.Nil(t, err) } -func TestOrderCancelOrderByIdReqModel(t *testing.T) { - // CancelOrderById - // Cancel Order By OrderId - // /api/v1/orders/{orderId} +func TestOrderCancelAllStopOrdersReqModel(t *testing.T) { + // CancelAllStopOrders + // Cancel All Stop orders + // /api/v1/stopOrders - data := "{\"orderId\": \"example_string_default_value\"}" - req := &CancelOrderByIdReq{} + data := "{\"symbol\": \"XBTUSDTM\"}" + req := &CancelAllStopOrdersReq{} err := json.Unmarshal([]byte(data), req) req.ToMap() assert.Nil(t, err) } -func TestOrderCancelOrderByIdRespModel(t *testing.T) { - // CancelOrderById - // Cancel Order By OrderId - // /api/v1/orders/{orderId} +func TestOrderCancelAllStopOrdersRespModel(t *testing.T) { + // CancelAllStopOrders + // Cancel All Stop orders + // /api/v1/stopOrders - data := "{\n \"code\": \"200000\",\n \"data\": {\n \"cancelledOrderIds\": [\n \"235303670076489728\"\n ]\n }\n}" + data := "{\n \"code\": \"200000\",\n \"data\": {\n \"cancelledOrderIds\": [\n \"235919172150824960\",\n \"235919172150824961\"\n ]\n }\n}" commonResp := &types.RestResponse{} err := json.Unmarshal([]byte(data), commonResp) assert.Nil(t, err) assert.NotNil(t, commonResp.Data) - resp := &CancelOrderByIdResp{} + resp := &CancelAllStopOrdersResp{} err = json.Unmarshal([]byte(commonResp.Data), resp) resp.ToMap() assert.Nil(t, err) @@ -287,57 +287,57 @@ func TestOrderGetOrderByOrderIdRespModel(t *testing.T) { assert.Nil(t, err) } -func TestOrderAddOrderReqModel(t *testing.T) { - // AddOrder - // Add Order - // /api/v1/orders +func TestOrderGetOrderByClientOidReqModel(t *testing.T) { + // GetOrderByClientOid + // Get Order By ClientOid + // /api/v1/orders/byClientOid - data := "{\"clientOid\": \"5c52e11203aa677f33e493fb\", \"side\": \"buy\", \"symbol\": \"XBTUSDTM\", \"leverage\": 3, \"type\": \"limit\", \"remark\": \"order remarks\", \"reduceOnly\": false, \"marginMode\": \"ISOLATED\", \"price\": \"0.1\", \"size\": 1, \"timeInForce\": \"GTC\"}" - req := &AddOrderReq{} + data := "{\"clientOid\": \"5c52e11203aa677f33e493fb\"}" + req := &GetOrderByClientOidReq{} err := json.Unmarshal([]byte(data), req) req.ToMap() assert.Nil(t, err) } -func TestOrderAddOrderRespModel(t *testing.T) { - // AddOrder - // Add Order - // /api/v1/orders +func TestOrderGetOrderByClientOidRespModel(t *testing.T) { + // GetOrderByClientOid + // Get Order By ClientOid + // /api/v1/orders/byClientOid - data := "{\n \"code\": \"200000\",\n \"data\": {\n \"orderId\": \"234125150956625920\",\n \"clientOid\": \"5c52e11203aa677f33e493fb\"\n }\n}" + data := "{\n \"code\": \"200000\",\n \"data\": {\n \"id\": \"250444645610336256\",\n \"symbol\": \"XRPUSDTM\",\n \"type\": \"limit\",\n \"side\": \"buy\",\n \"price\": \"0.1\",\n \"size\": 1,\n \"value\": \"1\",\n \"dealValue\": \"0\",\n \"dealSize\": 0,\n \"stp\": \"\",\n \"stop\": \"\",\n \"stopPriceType\": \"\",\n \"stopTriggered\": false,\n \"stopPrice\": null,\n \"timeInForce\": \"GTC\",\n \"postOnly\": false,\n \"hidden\": false,\n \"iceberg\": false,\n \"leverage\": \"3\",\n \"forceHold\": false,\n \"closeOrder\": false,\n \"visibleSize\": 0,\n \"clientOid\": \"5c52e11203aa677f33e493fb\",\n \"remark\": null,\n \"tags\": \"\",\n \"isActive\": true,\n \"cancelExist\": false,\n \"createdAt\": 1732523858568,\n \"updatedAt\": 1732523858568,\n \"endAt\": null,\n \"orderTime\": 1732523858550892322,\n \"settleCurrency\": \"USDT\",\n \"marginMode\": \"ISOLATED\",\n \"avgDealPrice\": \"0\",\n \"filledSize\": 0,\n \"filledValue\": \"0\",\n \"status\": \"open\",\n \"reduceOnly\": false\n }\n}" commonResp := &types.RestResponse{} err := json.Unmarshal([]byte(data), commonResp) assert.Nil(t, err) assert.NotNil(t, commonResp.Data) - resp := &AddOrderResp{} + resp := &GetOrderByClientOidResp{} err = json.Unmarshal([]byte(commonResp.Data), resp) resp.ToMap() assert.Nil(t, err) } -func TestOrderAddOrderTestReqModel(t *testing.T) { - // AddOrderTest - // Add Order Test - // /api/v1/orders/test +func TestOrderGetOrderListReqModel(t *testing.T) { + // GetOrderList + // Get Order List + // /api/v1/orders - data := "{\"clientOid\": \"5c52e11203aa677f33e493fb\", \"side\": \"buy\", \"symbol\": \"XBTUSDTM\", \"leverage\": 3, \"type\": \"limit\", \"remark\": \"order remarks\", \"reduceOnly\": false, \"marginMode\": \"ISOLATED\", \"price\": \"0.1\", \"size\": 1, \"timeInForce\": \"GTC\"}" - req := &AddOrderTestReq{} + data := "{\"status\": \"done\", \"symbol\": \"example_string_default_value\", \"side\": \"buy\", \"type\": \"limit\", \"startAt\": 123456, \"endAt\": 123456, \"currentPage\": 123456, \"pageSize\": 123456}" + req := &GetOrderListReq{} err := json.Unmarshal([]byte(data), req) req.ToMap() assert.Nil(t, err) } -func TestOrderAddOrderTestRespModel(t *testing.T) { - // AddOrderTest - // Add Order Test - // /api/v1/orders/test +func TestOrderGetOrderListRespModel(t *testing.T) { + // GetOrderList + // Get Order List + // /api/v1/orders - data := "{\n \"code\": \"200000\",\n \"data\": {\n \"orderId\": \"234125150956625920\",\n \"clientOid\": \"5c52e11203aa677f33e493fb\"\n }\n}" + data := "{\n \"code\": \"200000\",\n \"data\": {\n \"currentPage\": 1,\n \"pageSize\": 50,\n \"totalNum\": 1,\n \"totalPage\": 1,\n \"items\": [\n {\n \"id\": \"230181737576050688\",\n \"symbol\": \"PEOPLEUSDTM\",\n \"type\": \"limit\",\n \"side\": \"buy\",\n \"price\": \"0.05\",\n \"size\": 10,\n \"value\": \"5\",\n \"dealValue\": \"0\",\n \"dealSize\": 0,\n \"stp\": \"\",\n \"stop\": \"\",\n \"stopPriceType\": \"\",\n \"stopTriggered\": false,\n \"stopPrice\": null,\n \"timeInForce\": \"GTC\",\n \"postOnly\": false,\n \"hidden\": false,\n \"iceberg\": false,\n \"leverage\": \"1\",\n \"forceHold\": false,\n \"closeOrder\": false,\n \"visibleSize\": 0,\n \"clientOid\": \"5a80bd847f1811ef8a7faa665a37b3d7\",\n \"remark\": null,\n \"tags\": \"\",\n \"isActive\": true,\n \"cancelExist\": false,\n \"createdAt\": 1727692804813,\n \"updatedAt\": 1727692804813,\n \"endAt\": null,\n \"orderTime\": 1727692804808418000,\n \"settleCurrency\": \"USDT\",\n \"marginMode\": \"ISOLATED\",\n \"avgDealPrice\": \"0\",\n \"filledSize\": 0,\n \"filledValue\": \"0\",\n \"status\": \"open\",\n \"reduceOnly\": false\n }\n ]\n }\n}" commonResp := &types.RestResponse{} err := json.Unmarshal([]byte(data), commonResp) assert.Nil(t, err) assert.NotNil(t, commonResp.Data) - resp := &AddOrderTestResp{} + resp := &GetOrderListResp{} err = json.Unmarshal([]byte(commonResp.Data), resp) resp.ToMap() assert.Nil(t, err) @@ -371,141 +371,141 @@ func TestOrderGetRecentClosedOrdersRespModel(t *testing.T) { assert.Nil(t, err) } -func TestOrderGetRecentTradeHistoryReqModel(t *testing.T) { - // GetRecentTradeHistory - // Get Recent Trade History - // /api/v1/recentFills +func TestOrderGetStopOrderListReqModel(t *testing.T) { + // GetStopOrderList + // Get Stop Order List + // /api/v1/stopOrders - data := "{\"symbol\": \"XBTUSDTM\"}" - req := &GetRecentTradeHistoryReq{} + data := "{\"symbol\": \"XBTUSDTM\", \"side\": \"buy\", \"type\": \"limit\", \"startAt\": 123456, \"endAt\": 123456, \"currentPage\": 123456, \"pageSize\": 50}" + req := &GetStopOrderListReq{} err := json.Unmarshal([]byte(data), req) req.ToMap() assert.Nil(t, err) } -func TestOrderGetRecentTradeHistoryRespModel(t *testing.T) { - // GetRecentTradeHistory - // Get Recent Trade History - // /api/v1/recentFills +func TestOrderGetStopOrderListRespModel(t *testing.T) { + // GetStopOrderList + // Get Stop Order List + // /api/v1/stopOrders - data := "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"symbol\": \"XBTUSDTM\",\n \"tradeId\": \"1784277229880\",\n \"orderId\": \"236317213710184449\",\n \"side\": \"buy\",\n \"liquidity\": \"taker\",\n \"forceTaker\": false,\n \"price\": \"67430.9\",\n \"size\": 1,\n \"value\": \"67.4309\",\n \"openFeePay\": \"0.04045854\",\n \"closeFeePay\": \"0\",\n \"stop\": \"\",\n \"feeRate\": \"0.00060\",\n \"fixFee\": \"0\",\n \"feeCurrency\": \"USDT\",\n \"marginMode\": \"ISOLATED\",\n \"fee\": \"0.04045854\",\n \"settleCurrency\": \"USDT\",\n \"orderType\": \"market\",\n \"displayType\": \"market\",\n \"tradeType\": \"trade\",\n \"subTradeType\": null,\n \"tradeTime\": 1729155616320000000,\n \"createdAt\": 1729155616493\n },\n {\n \"symbol\": \"XBTUSDTM\",\n \"tradeId\": \"1784277132002\",\n \"orderId\": \"236317094436728832\",\n \"side\": \"buy\",\n \"liquidity\": \"taker\",\n \"forceTaker\": false,\n \"price\": \"67445\",\n \"size\": 1,\n \"value\": \"67.445\",\n \"openFeePay\": \"0\",\n \"closeFeePay\": \"0.040467\",\n \"stop\": \"\",\n \"feeRate\": \"0.00060\",\n \"fixFee\": \"0\",\n \"feeCurrency\": \"USDT\",\n \"marginMode\": \"ISOLATED\",\n \"fee\": \"0.040467\",\n \"settleCurrency\": \"USDT\",\n \"orderType\": \"market\",\n \"displayType\": \"market\",\n \"tradeType\": \"trade\",\n \"subTradeType\": null,\n \"tradeTime\": 1729155587944000000,\n \"createdAt\": 1729155588104\n }\n ]\n}" + data := "{\n \"code\": \"200000\",\n \"data\": {\n \"currentPage\": 1,\n \"pageSize\": 50,\n \"totalNum\": 1,\n \"totalPage\": 1,\n \"items\": [\n {\n \"id\": \"230181737576050688\",\n \"symbol\": \"PEOPLEUSDTM\",\n \"type\": \"limit\",\n \"side\": \"buy\",\n \"price\": \"0.05\",\n \"size\": 10,\n \"value\": \"5\",\n \"dealValue\": \"0\",\n \"dealSize\": 0,\n \"stp\": \"\",\n \"stop\": \"\",\n \"stopPriceType\": \"\",\n \"stopTriggered\": false,\n \"stopPrice\": null,\n \"timeInForce\": \"GTC\",\n \"postOnly\": false,\n \"hidden\": false,\n \"iceberg\": false,\n \"leverage\": \"1\",\n \"forceHold\": false,\n \"closeOrder\": false,\n \"visibleSize\": 0,\n \"clientOid\": \"5a80bd847f1811ef8a7faa665a37b3d7\",\n \"remark\": null,\n \"tags\": \"\",\n \"isActive\": true,\n \"cancelExist\": false,\n \"createdAt\": 1727692804813,\n \"updatedAt\": 1727692804813,\n \"endAt\": null,\n \"orderTime\": 1727692804808418000,\n \"settleCurrency\": \"USDT\",\n \"marginMode\": \"ISOLATED\",\n \"avgDealPrice\": \"0\",\n \"filledSize\": 0,\n \"filledValue\": \"0\",\n \"status\": \"open\",\n \"reduceOnly\": false\n }\n ]\n }\n}" commonResp := &types.RestResponse{} err := json.Unmarshal([]byte(data), commonResp) assert.Nil(t, err) assert.NotNil(t, commonResp.Data) - resp := &GetRecentTradeHistoryResp{} + resp := &GetStopOrderListResp{} err = json.Unmarshal([]byte(commonResp.Data), resp) resp.ToMap() assert.Nil(t, err) } -func TestOrderAddTPSLOrderReqModel(t *testing.T) { - // AddTPSLOrder - // Add Take Profit And Stop Loss Order - // /api/v1/st-orders +func TestOrderGetOpenOrderValueReqModel(t *testing.T) { + // GetOpenOrderValue + // Get Open Order Value + // /api/v1/openOrderStatistics - data := "{\"clientOid\": \"5c52e11203aa677f33e493fb\", \"side\": \"buy\", \"symbol\": \"XBTUSDTM\", \"leverage\": 3, \"type\": \"limit\", \"remark\": \"order remarks\", \"reduceOnly\": false, \"marginMode\": \"ISOLATED\", \"price\": \"0.2\", \"size\": 1, \"timeInForce\": \"GTC\", \"triggerStopUpPrice\": \"0.3\", \"triggerStopDownPrice\": \"0.1\", \"stopPriceType\": \"TP\"}" - req := &AddTPSLOrderReq{} + data := "{\"symbol\": \"XBTUSDTM\"}" + req := &GetOpenOrderValueReq{} err := json.Unmarshal([]byte(data), req) req.ToMap() assert.Nil(t, err) } -func TestOrderAddTPSLOrderRespModel(t *testing.T) { - // AddTPSLOrder - // Add Take Profit And Stop Loss Order - // /api/v1/st-orders +func TestOrderGetOpenOrderValueRespModel(t *testing.T) { + // GetOpenOrderValue + // Get Open Order Value + // /api/v1/openOrderStatistics - data := "{\n \"code\": \"200000\",\n \"data\": {\n \"orderId\": \"234125150956625920\",\n \"clientOid\": \"5c52e11203aa677f33e493fb\"\n }\n}" + data := "{\n \"code\": \"200000\",\n \"data\": {\n \"openOrderBuySize\": 1,\n \"openOrderSellSize\": 0,\n \"openOrderBuyCost\": \"0.0001\",\n \"openOrderSellCost\": \"0\",\n \"settleCurrency\": \"USDT\"\n }\n}" commonResp := &types.RestResponse{} err := json.Unmarshal([]byte(data), commonResp) assert.Nil(t, err) assert.NotNil(t, commonResp.Data) - resp := &AddTPSLOrderResp{} + resp := &GetOpenOrderValueResp{} err = json.Unmarshal([]byte(commonResp.Data), resp) resp.ToMap() assert.Nil(t, err) } -func TestOrderCancelAllStopOrdersReqModel(t *testing.T) { - // CancelAllStopOrders - // Cancel All Stop orders - // /api/v1/stopOrders +func TestOrderGetRecentTradeHistoryReqModel(t *testing.T) { + // GetRecentTradeHistory + // Get Recent Trade History + // /api/v1/recentFills data := "{\"symbol\": \"XBTUSDTM\"}" - req := &CancelAllStopOrdersReq{} + req := &GetRecentTradeHistoryReq{} err := json.Unmarshal([]byte(data), req) req.ToMap() assert.Nil(t, err) } -func TestOrderCancelAllStopOrdersRespModel(t *testing.T) { - // CancelAllStopOrders - // Cancel All Stop orders - // /api/v1/stopOrders +func TestOrderGetRecentTradeHistoryRespModel(t *testing.T) { + // GetRecentTradeHistory + // Get Recent Trade History + // /api/v1/recentFills - data := "{\n \"code\": \"200000\",\n \"data\": {\n \"cancelledOrderIds\": [\n \"235919172150824960\",\n \"235919172150824961\"\n ]\n }\n}" + data := "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"symbol\": \"XBTUSDTM\",\n \"tradeId\": \"1784277229880\",\n \"orderId\": \"236317213710184449\",\n \"side\": \"buy\",\n \"liquidity\": \"taker\",\n \"forceTaker\": false,\n \"price\": \"67430.9\",\n \"size\": 1,\n \"value\": \"67.4309\",\n \"openFeePay\": \"0.04045854\",\n \"closeFeePay\": \"0\",\n \"stop\": \"\",\n \"feeRate\": \"0.00060\",\n \"fixFee\": \"0\",\n \"feeCurrency\": \"USDT\",\n \"marginMode\": \"ISOLATED\",\n \"fee\": \"0.04045854\",\n \"settleCurrency\": \"USDT\",\n \"orderType\": \"market\",\n \"displayType\": \"market\",\n \"tradeType\": \"trade\",\n \"subTradeType\": null,\n \"tradeTime\": 1729155616320000000,\n \"createdAt\": 1729155616493\n },\n {\n \"symbol\": \"XBTUSDTM\",\n \"tradeId\": \"1784277132002\",\n \"orderId\": \"236317094436728832\",\n \"side\": \"buy\",\n \"liquidity\": \"taker\",\n \"forceTaker\": false,\n \"price\": \"67445\",\n \"size\": 1,\n \"value\": \"67.445\",\n \"openFeePay\": \"0\",\n \"closeFeePay\": \"0.040467\",\n \"stop\": \"\",\n \"feeRate\": \"0.00060\",\n \"fixFee\": \"0\",\n \"feeCurrency\": \"USDT\",\n \"marginMode\": \"ISOLATED\",\n \"fee\": \"0.040467\",\n \"settleCurrency\": \"USDT\",\n \"orderType\": \"market\",\n \"displayType\": \"market\",\n \"tradeType\": \"trade\",\n \"subTradeType\": null,\n \"tradeTime\": 1729155587944000000,\n \"createdAt\": 1729155588104\n }\n ]\n}" commonResp := &types.RestResponse{} err := json.Unmarshal([]byte(data), commonResp) assert.Nil(t, err) assert.NotNil(t, commonResp.Data) - resp := &CancelAllStopOrdersResp{} + resp := &GetRecentTradeHistoryResp{} err = json.Unmarshal([]byte(commonResp.Data), resp) resp.ToMap() assert.Nil(t, err) } -func TestOrderGetStopOrderListReqModel(t *testing.T) { - // GetStopOrderList - // Get Stop Order List - // /api/v1/stopOrders +func TestOrderGetTradeHistoryReqModel(t *testing.T) { + // GetTradeHistory + // Get Trade History + // /api/v1/fills - data := "{\"symbol\": \"XBTUSDTM\", \"side\": \"buy\", \"type\": \"limit\", \"startAt\": 123456, \"endAt\": 123456, \"currentPage\": 123456, \"pageSize\": 50}" - req := &GetStopOrderListReq{} + data := "{\"orderId\": \"236655147005071361\", \"symbol\": \"example_string_default_value\", \"side\": \"buy\", \"type\": \"limit\", \"tradeTypes\": \"trade\", \"startAt\": 123456, \"endAt\": 123456, \"currentPage\": 1, \"pageSize\": 50}" + req := &GetTradeHistoryReq{} err := json.Unmarshal([]byte(data), req) req.ToMap() assert.Nil(t, err) } -func TestOrderGetStopOrderListRespModel(t *testing.T) { - // GetStopOrderList - // Get Stop Order List - // /api/v1/stopOrders +func TestOrderGetTradeHistoryRespModel(t *testing.T) { + // GetTradeHistory + // Get Trade History + // /api/v1/fills - data := "{\n \"code\": \"200000\",\n \"data\": {\n \"currentPage\": 1,\n \"pageSize\": 50,\n \"totalNum\": 1,\n \"totalPage\": 1,\n \"items\": [\n {\n \"id\": \"230181737576050688\",\n \"symbol\": \"PEOPLEUSDTM\",\n \"type\": \"limit\",\n \"side\": \"buy\",\n \"price\": \"0.05\",\n \"size\": 10,\n \"value\": \"5\",\n \"dealValue\": \"0\",\n \"dealSize\": 0,\n \"stp\": \"\",\n \"stop\": \"\",\n \"stopPriceType\": \"\",\n \"stopTriggered\": false,\n \"stopPrice\": null,\n \"timeInForce\": \"GTC\",\n \"postOnly\": false,\n \"hidden\": false,\n \"iceberg\": false,\n \"leverage\": \"1\",\n \"forceHold\": false,\n \"closeOrder\": false,\n \"visibleSize\": 0,\n \"clientOid\": \"5a80bd847f1811ef8a7faa665a37b3d7\",\n \"remark\": null,\n \"tags\": \"\",\n \"isActive\": true,\n \"cancelExist\": false,\n \"createdAt\": 1727692804813,\n \"updatedAt\": 1727692804813,\n \"endAt\": null,\n \"orderTime\": 1727692804808418000,\n \"settleCurrency\": \"USDT\",\n \"marginMode\": \"ISOLATED\",\n \"avgDealPrice\": \"0\",\n \"filledSize\": 0,\n \"filledValue\": \"0\",\n \"status\": \"open\",\n \"reduceOnly\": false\n }\n ]\n }\n}" + data := "{\n \"code\": \"200000\",\n \"data\": {\n \"currentPage\": 1,\n \"pageSize\": 50,\n \"totalNum\": 2,\n \"totalPage\": 1,\n \"items\": [\n {\n \"symbol\": \"XBTUSDTM\",\n \"tradeId\": \"1784277229880\",\n \"orderId\": \"236317213710184449\",\n \"side\": \"buy\",\n \"liquidity\": \"taker\",\n \"forceTaker\": false,\n \"price\": \"67430.9\",\n \"size\": 1,\n \"value\": \"67.4309\",\n \"openFeePay\": \"0.04045854\",\n \"closeFeePay\": \"0\",\n \"stop\": \"\",\n \"feeRate\": \"0.00060\",\n \"fixFee\": \"0\",\n \"feeCurrency\": \"USDT\",\n \"marginMode\": \"ISOLATED\",\n \"settleCurrency\": \"USDT\",\n \"fee\": \"0.04045854\",\n \"orderType\": \"market\",\n \"displayType\": \"market\",\n \"tradeType\": \"trade\",\n \"subTradeType\": null,\n \"tradeTime\": 1729155616320000000,\n \"createdAt\": 1729155616493\n },\n {\n \"symbol\": \"XBTUSDTM\",\n \"tradeId\": \"1784277132002\",\n \"orderId\": \"236317094436728832\",\n \"side\": \"buy\",\n \"liquidity\": \"taker\",\n \"forceTaker\": false,\n \"price\": \"67445\",\n \"size\": 1,\n \"value\": \"67.445\",\n \"openFeePay\": \"0\",\n \"closeFeePay\": \"0.040467\",\n \"stop\": \"\",\n \"feeRate\": \"0.00060\",\n \"fixFee\": \"0\",\n \"feeCurrency\": \"USDT\",\n \"marginMode\": \"ISOLATED\",\n \"settleCurrency\": \"USDT\",\n \"fee\": \"0.040467\",\n \"orderType\": \"market\",\n \"displayType\": \"market\",\n \"tradeType\": \"trade\",\n \"subTradeType\": null,\n \"tradeTime\": 1729155587944000000,\n \"createdAt\": 1729155588104\n }\n ]\n }\n}" commonResp := &types.RestResponse{} err := json.Unmarshal([]byte(data), commonResp) assert.Nil(t, err) assert.NotNil(t, commonResp.Data) - resp := &GetStopOrderListResp{} + resp := &GetTradeHistoryResp{} err = json.Unmarshal([]byte(commonResp.Data), resp) resp.ToMap() assert.Nil(t, err) } -func TestOrderCancelAllOrdersV3ReqModel(t *testing.T) { - // CancelAllOrdersV3 - // Cancel All Orders - // /api/v3/orders +func TestOrderCancelAllOrdersV1ReqModel(t *testing.T) { + // CancelAllOrdersV1 + // Cancel All Orders - V1 + // /api/v1/orders data := "{\"symbol\": \"XBTUSDTM\"}" - req := &CancelAllOrdersV3Req{} + req := &CancelAllOrdersV1Req{} err := json.Unmarshal([]byte(data), req) req.ToMap() assert.Nil(t, err) } -func TestOrderCancelAllOrdersV3RespModel(t *testing.T) { - // CancelAllOrdersV3 - // Cancel All Orders - // /api/v3/orders +func TestOrderCancelAllOrdersV1RespModel(t *testing.T) { + // CancelAllOrdersV1 + // Cancel All Orders - V1 + // /api/v1/orders data := "{\n \"code\": \"200000\",\n \"data\": {\n \"cancelledOrderIds\": [\n \"235919172150824960\",\n \"235919172150824961\"\n ]\n }\n}" commonResp := &types.RestResponse{} err := json.Unmarshal([]byte(data), commonResp) assert.Nil(t, err) assert.NotNil(t, commonResp.Data) - resp := &CancelAllOrdersV3Resp{} + resp := &CancelAllOrdersV1Resp{} err = json.Unmarshal([]byte(commonResp.Data), resp) resp.ToMap() assert.Nil(t, err) diff --git a/sdk/golang/pkg/generate/futures/positions/api_positions.go b/sdk/golang/pkg/generate/futures/positions/api_positions.go index ec741b89..799c371b 100644 --- a/sdk/golang/pkg/generate/futures/positions/api_positions.go +++ b/sdk/golang/pkg/generate/futures/positions/api_positions.go @@ -9,23 +9,9 @@ import ( type PositionsAPI interface { - // GetIsolatedMarginRiskLimit Get Isolated Margin Risk Limit - // Description: This interface can be used to obtain information about risk limit level of a specific contract(Only valid for isolated Margin). - // Documentation: https://www.kucoin.com/docs-new/api-3470263 - // +---------------------+---------+ - // | Extra API Info | Value | - // +---------------------+---------+ - // | API-DOMAIN | FUTURES | - // | API-CHANNEL | PRIVATE | - // | API-PERMISSION | FUTURES | - // | API-RATE-LIMIT-POOL | PUBLIC | - // | API-RATE-LIMIT | 5 | - // +---------------------+---------+ - GetIsolatedMarginRiskLimit(req *GetIsolatedMarginRiskLimitReq, ctx context.Context) (*GetIsolatedMarginRiskLimitResp, error) - - // GetPositionsHistory Get Positions History - // Description: This interface can query position history information records. - // Documentation: https://www.kucoin.com/docs-new/api-3470254 + // GetMarginMode Get Margin Mode + // Description: This interface can query the margin mode of the current symbol. + // Documentation: https://www.kucoin.com/docs-new/api-3470259 // +---------------------+---------+ // | Extra API Info | Value | // +---------------------+---------+ @@ -35,11 +21,11 @@ type PositionsAPI interface { // | API-RATE-LIMIT-POOL | FUTURES | // | API-RATE-LIMIT | 2 | // +---------------------+---------+ - GetPositionsHistory(req *GetPositionsHistoryReq, ctx context.Context) (*GetPositionsHistoryResp, error) + GetMarginMode(req *GetMarginModeReq, ctx context.Context) (*GetMarginModeResp, error) - // GetMaxWithdrawMargin Get Max Withdraw Margin - // Description: This interface can query the maximum amount of margin that the current position supports withdrawal. - // Documentation: https://www.kucoin.com/docs-new/api-3470258 + // SwitchMarginMode Switch Margin Mode + // Description: This interface can modify the margin mode of the current symbol. + // Documentation: https://www.kucoin.com/docs-new/api-3470262 // +---------------------+---------+ // | Extra API Info | Value | // +---------------------+---------+ @@ -47,13 +33,13 @@ type PositionsAPI interface { // | API-CHANNEL | PRIVATE | // | API-PERMISSION | FUTURES | // | API-RATE-LIMIT-POOL | FUTURES | - // | API-RATE-LIMIT | 10 | + // | API-RATE-LIMIT | 2 | // +---------------------+---------+ - GetMaxWithdrawMargin(req *GetMaxWithdrawMarginReq, ctx context.Context) (*GetMaxWithdrawMarginResp, error) + SwitchMarginMode(req *SwitchMarginModeReq, ctx context.Context) (*SwitchMarginModeResp, error) - // RemoveIsolatedMargin Remove Isolated Margin - // Description: Remove Isolated Margin Manually. - // Documentation: https://www.kucoin.com/docs-new/api-3470256 + // GetMaxOpenSize Get Max Open Size + // Description: Get Maximum Open Position Size. + // Documentation: https://www.kucoin.com/docs-new/api-3470251 // +---------------------+---------+ // | Extra API Info | Value | // +---------------------+---------+ @@ -61,9 +47,9 @@ type PositionsAPI interface { // | API-CHANNEL | PRIVATE | // | API-PERMISSION | FUTURES | // | API-RATE-LIMIT-POOL | FUTURES | - // | API-RATE-LIMIT | 10 | + // | API-RATE-LIMIT | 2 | // +---------------------+---------+ - RemoveIsolatedMargin(req *RemoveIsolatedMarginReq, ctx context.Context) (*RemoveIsolatedMarginResp, error) + GetMaxOpenSize(req *GetMaxOpenSizeReq, ctx context.Context) (*GetMaxOpenSizeResp, error) // GetPositionDetails Get Position Details // Description: Get the position details of a specified position. @@ -79,9 +65,9 @@ type PositionsAPI interface { // +---------------------+---------+ GetPositionDetails(req *GetPositionDetailsReq, ctx context.Context) (*GetPositionDetailsResp, error) - // ModifyAutoDepositStatus Modify Isolated Margin Auto-Deposit Status - // Description: This endpoint is only applicable to isolated margin and is no longer recommended. It is recommended to use cross margin instead. - // Documentation: https://www.kucoin.com/docs-new/api-3470255 + // GetPositionList Get Position List + // Description: Get the position details of a specified position. + // Documentation: https://www.kucoin.com/docs-new/api-3470253 // +---------------------+---------+ // | Extra API Info | Value | // +---------------------+---------+ @@ -89,14 +75,13 @@ type PositionsAPI interface { // | API-CHANNEL | PRIVATE | // | API-PERMISSION | FUTURES | // | API-RATE-LIMIT-POOL | FUTURES | - // | API-RATE-LIMIT | 4 | + // | API-RATE-LIMIT | 2 | // +---------------------+---------+ - // Deprecated - ModifyAutoDepositStatus(req *ModifyAutoDepositStatusReq, ctx context.Context) (*ModifyAutoDepositStatusResp, error) + GetPositionList(req *GetPositionListReq, ctx context.Context) (*GetPositionListResp, error) - // AddIsolatedMargin Add Isolated Margin - // Description: Add Isolated Margin Manually. - // Documentation: https://www.kucoin.com/docs-new/api-3470257 + // GetPositionsHistory Get Positions History + // Description: This interface can query position history information records. + // Documentation: https://www.kucoin.com/docs-new/api-3470254 // +---------------------+---------+ // | Extra API Info | Value | // +---------------------+---------+ @@ -104,13 +89,13 @@ type PositionsAPI interface { // | API-CHANNEL | PRIVATE | // | API-PERMISSION | FUTURES | // | API-RATE-LIMIT-POOL | FUTURES | - // | API-RATE-LIMIT | 4 | + // | API-RATE-LIMIT | 2 | // +---------------------+---------+ - AddIsolatedMargin(req *AddIsolatedMarginReq, ctx context.Context) (*AddIsolatedMarginResp, error) + GetPositionsHistory(req *GetPositionsHistoryReq, ctx context.Context) (*GetPositionsHistoryResp, error) - // ModifyIsolatedMarginRiskLimt Modify Isolated Margin Risk Limit - // Description: This interface can be used to obtain information about risk limit level of a specific contract(Only valid for isolated Margin). - // Documentation: https://www.kucoin.com/docs-new/api-3470264 + // GetMaxWithdrawMargin Get Max Withdraw Margin + // Description: This interface can query the maximum amount of margin that the current position supports withdrawal. + // Documentation: https://www.kucoin.com/docs-new/api-3470258 // +---------------------+---------+ // | Extra API Info | Value | // +---------------------+---------+ @@ -118,13 +103,13 @@ type PositionsAPI interface { // | API-CHANNEL | PRIVATE | // | API-PERMISSION | FUTURES | // | API-RATE-LIMIT-POOL | FUTURES | - // | API-RATE-LIMIT | 5 | + // | API-RATE-LIMIT | 10 | // +---------------------+---------+ - ModifyIsolatedMarginRiskLimt(req *ModifyIsolatedMarginRiskLimtReq, ctx context.Context) (*ModifyIsolatedMarginRiskLimtResp, error) + GetMaxWithdrawMargin(req *GetMaxWithdrawMarginReq, ctx context.Context) (*GetMaxWithdrawMarginResp, error) - // GetPositionList Get Position List - // Description: Get the position details of a specified position. - // Documentation: https://www.kucoin.com/docs-new/api-3470253 + // GetCrossMarginLeverage Get Cross Margin Leverage + // Description: This interface can query the current symbol’s cross-margin leverage multiple. + // Documentation: https://www.kucoin.com/docs-new/api-3470260 // +---------------------+---------+ // | Extra API Info | Value | // +---------------------+---------+ @@ -134,7 +119,7 @@ type PositionsAPI interface { // | API-RATE-LIMIT-POOL | FUTURES | // | API-RATE-LIMIT | 2 | // +---------------------+---------+ - GetPositionList(req *GetPositionListReq, ctx context.Context) (*GetPositionListResp, error) + GetCrossMarginLeverage(req *GetCrossMarginLeverageReq, ctx context.Context) (*GetCrossMarginLeverageResp, error) // ModifyMarginLeverage Modify Cross Margin Leverage // Description: This interface can modify the current symbol’s cross-margin leverage multiple. @@ -150,9 +135,9 @@ type PositionsAPI interface { // +---------------------+---------+ ModifyMarginLeverage(req *ModifyMarginLeverageReq, ctx context.Context) (*ModifyMarginLeverageResp, error) - // GetCrossMarginLeverage Get Cross Margin Leverage - // Description: This interface can query the current symbol’s cross-margin leverage multiple. - // Documentation: https://www.kucoin.com/docs-new/api-3470260 + // AddIsolatedMargin Add Isolated Margin + // Description: Add Isolated Margin Manually. + // Documentation: https://www.kucoin.com/docs-new/api-3470257 // +---------------------+---------+ // | Extra API Info | Value | // +---------------------+---------+ @@ -160,13 +145,13 @@ type PositionsAPI interface { // | API-CHANNEL | PRIVATE | // | API-PERMISSION | FUTURES | // | API-RATE-LIMIT-POOL | FUTURES | - // | API-RATE-LIMIT | 2 | + // | API-RATE-LIMIT | 4 | // +---------------------+---------+ - GetCrossMarginLeverage(req *GetCrossMarginLeverageReq, ctx context.Context) (*GetCrossMarginLeverageResp, error) + AddIsolatedMargin(req *AddIsolatedMarginReq, ctx context.Context) (*AddIsolatedMarginResp, error) - // GetMaxOpenSize Get Max Open Size - // Description: Get Maximum Open Position Size. - // Documentation: https://www.kucoin.com/docs-new/api-3470251 + // RemoveIsolatedMargin Remove Isolated Margin + // Description: Remove Isolated Margin Manually. + // Documentation: https://www.kucoin.com/docs-new/api-3470256 // +---------------------+---------+ // | Extra API Info | Value | // +---------------------+---------+ @@ -174,13 +159,27 @@ type PositionsAPI interface { // | API-CHANNEL | PRIVATE | // | API-PERMISSION | FUTURES | // | API-RATE-LIMIT-POOL | FUTURES | - // | API-RATE-LIMIT | 2 | + // | API-RATE-LIMIT | 10 | // +---------------------+---------+ - GetMaxOpenSize(req *GetMaxOpenSizeReq, ctx context.Context) (*GetMaxOpenSizeResp, error) + RemoveIsolatedMargin(req *RemoveIsolatedMarginReq, ctx context.Context) (*RemoveIsolatedMarginResp, error) - // SwitchMarginMode Switch Margin Mode - // Description: This interface can modify the margin mode of the current symbol. - // Documentation: https://www.kucoin.com/docs-new/api-3470262 + // GetIsolatedMarginRiskLimit Get Isolated Margin Risk Limit + // Description: This interface can be used to obtain information about risk limit level of a specific contract(Only valid for isolated Margin). + // Documentation: https://www.kucoin.com/docs-new/api-3470263 + // +---------------------+---------+ + // | Extra API Info | Value | + // +---------------------+---------+ + // | API-DOMAIN | FUTURES | + // | API-CHANNEL | PRIVATE | + // | API-PERMISSION | FUTURES | + // | API-RATE-LIMIT-POOL | PUBLIC | + // | API-RATE-LIMIT | 5 | + // +---------------------+---------+ + GetIsolatedMarginRiskLimit(req *GetIsolatedMarginRiskLimitReq, ctx context.Context) (*GetIsolatedMarginRiskLimitResp, error) + + // ModifyIsolatedMarginRiskLimt Modify Isolated Margin Risk Limit + // Description: This interface can be used to obtain information about risk limit level of a specific contract(Only valid for isolated Margin). + // Documentation: https://www.kucoin.com/docs-new/api-3470264 // +---------------------+---------+ // | Extra API Info | Value | // +---------------------+---------+ @@ -188,13 +187,13 @@ type PositionsAPI interface { // | API-CHANNEL | PRIVATE | // | API-PERMISSION | FUTURES | // | API-RATE-LIMIT-POOL | FUTURES | - // | API-RATE-LIMIT | 2 | + // | API-RATE-LIMIT | 5 | // +---------------------+---------+ - SwitchMarginMode(req *SwitchMarginModeReq, ctx context.Context) (*SwitchMarginModeResp, error) + ModifyIsolatedMarginRiskLimt(req *ModifyIsolatedMarginRiskLimtReq, ctx context.Context) (*ModifyIsolatedMarginRiskLimtResp, error) - // GetMarginMode Get Margin Mode - // Description: This interface can query the margin mode of the current symbol. - // Documentation: https://www.kucoin.com/docs-new/api-3470259 + // ModifyAutoDepositStatus Modify Isolated Margin Auto-Deposit Status + // Description: This endpoint is only applicable to isolated margin and is no longer recommended. It is recommended to use cross margin instead. + // Documentation: https://www.kucoin.com/docs-new/api-3470255 // +---------------------+---------+ // | Extra API Info | Value | // +---------------------+---------+ @@ -202,9 +201,10 @@ type PositionsAPI interface { // | API-CHANNEL | PRIVATE | // | API-PERMISSION | FUTURES | // | API-RATE-LIMIT-POOL | FUTURES | - // | API-RATE-LIMIT | 2 | + // | API-RATE-LIMIT | 4 | // +---------------------+---------+ - GetMarginMode(req *GetMarginModeReq, ctx context.Context) (*GetMarginModeResp, error) + // Deprecated + ModifyAutoDepositStatus(req *ModifyAutoDepositStatusReq, ctx context.Context) (*ModifyAutoDepositStatusResp, error) } type PositionsAPIImpl struct { @@ -215,27 +215,21 @@ func NewPositionsAPIImp(transport interfaces.Transport) *PositionsAPIImpl { return &PositionsAPIImpl{transport: transport} } -func (impl *PositionsAPIImpl) GetIsolatedMarginRiskLimit(req *GetIsolatedMarginRiskLimitReq, ctx context.Context) (*GetIsolatedMarginRiskLimitResp, error) { - resp := &GetIsolatedMarginRiskLimitResp{} - err := impl.transport.Call(ctx, "futures", false, "Get", "/api/v1/contracts/risk-limit/{symbol}", req, resp, false) - return resp, err -} - -func (impl *PositionsAPIImpl) GetPositionsHistory(req *GetPositionsHistoryReq, ctx context.Context) (*GetPositionsHistoryResp, error) { - resp := &GetPositionsHistoryResp{} - err := impl.transport.Call(ctx, "futures", false, "Get", "/api/v1/history-positions", req, resp, false) +func (impl *PositionsAPIImpl) GetMarginMode(req *GetMarginModeReq, ctx context.Context) (*GetMarginModeResp, error) { + resp := &GetMarginModeResp{} + err := impl.transport.Call(ctx, "futures", false, "Get", "/api/v2/position/getMarginMode", req, resp, false) return resp, err } -func (impl *PositionsAPIImpl) GetMaxWithdrawMargin(req *GetMaxWithdrawMarginReq, ctx context.Context) (*GetMaxWithdrawMarginResp, error) { - resp := &GetMaxWithdrawMarginResp{} - err := impl.transport.Call(ctx, "futures", false, "Get", "/api/v1/margin/maxWithdrawMargin", req, resp, false) +func (impl *PositionsAPIImpl) SwitchMarginMode(req *SwitchMarginModeReq, ctx context.Context) (*SwitchMarginModeResp, error) { + resp := &SwitchMarginModeResp{} + err := impl.transport.Call(ctx, "futures", false, "Post", "/api/v2/position/changeMarginMode", req, resp, false) return resp, err } -func (impl *PositionsAPIImpl) RemoveIsolatedMargin(req *RemoveIsolatedMarginReq, ctx context.Context) (*RemoveIsolatedMarginResp, error) { - resp := &RemoveIsolatedMarginResp{} - err := impl.transport.Call(ctx, "futures", false, "Post", "/api/v1/margin/withdrawMargin", req, resp, false) +func (impl *PositionsAPIImpl) GetMaxOpenSize(req *GetMaxOpenSizeReq, ctx context.Context) (*GetMaxOpenSizeResp, error) { + resp := &GetMaxOpenSizeResp{} + err := impl.transport.Call(ctx, "futures", false, "Get", "/api/v2/getMaxOpenSize", req, resp, false) return resp, err } @@ -245,27 +239,27 @@ func (impl *PositionsAPIImpl) GetPositionDetails(req *GetPositionDetailsReq, ctx return resp, err } -func (impl *PositionsAPIImpl) ModifyAutoDepositStatus(req *ModifyAutoDepositStatusReq, ctx context.Context) (*ModifyAutoDepositStatusResp, error) { - resp := &ModifyAutoDepositStatusResp{} - err := impl.transport.Call(ctx, "futures", false, "Post", "/api/v1/position/margin/auto-deposit-status", req, resp, false) +func (impl *PositionsAPIImpl) GetPositionList(req *GetPositionListReq, ctx context.Context) (*GetPositionListResp, error) { + resp := &GetPositionListResp{} + err := impl.transport.Call(ctx, "futures", false, "Get", "/api/v1/positions", req, resp, false) return resp, err } -func (impl *PositionsAPIImpl) AddIsolatedMargin(req *AddIsolatedMarginReq, ctx context.Context) (*AddIsolatedMarginResp, error) { - resp := &AddIsolatedMarginResp{} - err := impl.transport.Call(ctx, "futures", false, "Post", "/api/v1/position/margin/deposit-margin", req, resp, false) +func (impl *PositionsAPIImpl) GetPositionsHistory(req *GetPositionsHistoryReq, ctx context.Context) (*GetPositionsHistoryResp, error) { + resp := &GetPositionsHistoryResp{} + err := impl.transport.Call(ctx, "futures", false, "Get", "/api/v1/history-positions", req, resp, false) return resp, err } -func (impl *PositionsAPIImpl) ModifyIsolatedMarginRiskLimt(req *ModifyIsolatedMarginRiskLimtReq, ctx context.Context) (*ModifyIsolatedMarginRiskLimtResp, error) { - resp := &ModifyIsolatedMarginRiskLimtResp{} - err := impl.transport.Call(ctx, "futures", false, "Post", "/api/v1/position/risk-limit-level/change", req, resp, false) +func (impl *PositionsAPIImpl) GetMaxWithdrawMargin(req *GetMaxWithdrawMarginReq, ctx context.Context) (*GetMaxWithdrawMarginResp, error) { + resp := &GetMaxWithdrawMarginResp{} + err := impl.transport.Call(ctx, "futures", false, "Get", "/api/v1/margin/maxWithdrawMargin", req, resp, false) return resp, err } -func (impl *PositionsAPIImpl) GetPositionList(req *GetPositionListReq, ctx context.Context) (*GetPositionListResp, error) { - resp := &GetPositionListResp{} - err := impl.transport.Call(ctx, "futures", false, "Get", "/api/v1/positions", req, resp, false) +func (impl *PositionsAPIImpl) GetCrossMarginLeverage(req *GetCrossMarginLeverageReq, ctx context.Context) (*GetCrossMarginLeverageResp, error) { + resp := &GetCrossMarginLeverageResp{} + err := impl.transport.Call(ctx, "futures", false, "Get", "/api/v2/getCrossUserLeverage", req, resp, false) return resp, err } @@ -275,26 +269,32 @@ func (impl *PositionsAPIImpl) ModifyMarginLeverage(req *ModifyMarginLeverageReq, return resp, err } -func (impl *PositionsAPIImpl) GetCrossMarginLeverage(req *GetCrossMarginLeverageReq, ctx context.Context) (*GetCrossMarginLeverageResp, error) { - resp := &GetCrossMarginLeverageResp{} - err := impl.transport.Call(ctx, "futures", false, "Get", "/api/v2/getCrossUserLeverage", req, resp, false) +func (impl *PositionsAPIImpl) AddIsolatedMargin(req *AddIsolatedMarginReq, ctx context.Context) (*AddIsolatedMarginResp, error) { + resp := &AddIsolatedMarginResp{} + err := impl.transport.Call(ctx, "futures", false, "Post", "/api/v1/position/margin/deposit-margin", req, resp, false) return resp, err } -func (impl *PositionsAPIImpl) GetMaxOpenSize(req *GetMaxOpenSizeReq, ctx context.Context) (*GetMaxOpenSizeResp, error) { - resp := &GetMaxOpenSizeResp{} - err := impl.transport.Call(ctx, "futures", false, "Get", "/api/v2/getMaxOpenSize", req, resp, false) +func (impl *PositionsAPIImpl) RemoveIsolatedMargin(req *RemoveIsolatedMarginReq, ctx context.Context) (*RemoveIsolatedMarginResp, error) { + resp := &RemoveIsolatedMarginResp{} + err := impl.transport.Call(ctx, "futures", false, "Post", "/api/v1/margin/withdrawMargin", req, resp, false) return resp, err } -func (impl *PositionsAPIImpl) SwitchMarginMode(req *SwitchMarginModeReq, ctx context.Context) (*SwitchMarginModeResp, error) { - resp := &SwitchMarginModeResp{} - err := impl.transport.Call(ctx, "futures", false, "Post", "/api/v2/position/changeMarginMode", req, resp, false) +func (impl *PositionsAPIImpl) GetIsolatedMarginRiskLimit(req *GetIsolatedMarginRiskLimitReq, ctx context.Context) (*GetIsolatedMarginRiskLimitResp, error) { + resp := &GetIsolatedMarginRiskLimitResp{} + err := impl.transport.Call(ctx, "futures", false, "Get", "/api/v1/contracts/risk-limit/{symbol}", req, resp, false) return resp, err } -func (impl *PositionsAPIImpl) GetMarginMode(req *GetMarginModeReq, ctx context.Context) (*GetMarginModeResp, error) { - resp := &GetMarginModeResp{} - err := impl.transport.Call(ctx, "futures", false, "Get", "/api/v2/position/getMarginMode", req, resp, false) +func (impl *PositionsAPIImpl) ModifyIsolatedMarginRiskLimt(req *ModifyIsolatedMarginRiskLimtReq, ctx context.Context) (*ModifyIsolatedMarginRiskLimtResp, error) { + resp := &ModifyIsolatedMarginRiskLimtResp{} + err := impl.transport.Call(ctx, "futures", false, "Post", "/api/v1/position/risk-limit-level/change", req, resp, false) + return resp, err +} + +func (impl *PositionsAPIImpl) ModifyAutoDepositStatus(req *ModifyAutoDepositStatusReq, ctx context.Context) (*ModifyAutoDepositStatusResp, error) { + resp := &ModifyAutoDepositStatusResp{} + err := impl.transport.Call(ctx, "futures", false, "Post", "/api/v1/position/margin/auto-deposit-status", req, resp, false) return resp, err } diff --git a/sdk/golang/pkg/generate/futures/positions/api_positions.template b/sdk/golang/pkg/generate/futures/positions/api_positions.template index 316d9232..434af491 100644 --- a/sdk/golang/pkg/generate/futures/positions/api_positions.template +++ b/sdk/golang/pkg/generate/futures/positions/api_positions.template @@ -1,16 +1,16 @@ # API FUNCTION TEMPLATE -func TestPositionsGetIsolatedMarginRiskLimitReq(t *testing.T) { - // GetIsolatedMarginRiskLimit - // Get Isolated Margin Risk Limit - // /api/v1/contracts/risk-limit/{symbol} +func TestPositionsGetMarginModeReq(t *testing.T) { + // GetMarginMode + // Get Margin Mode + // /api/v2/position/getMarginMode - builder := positions.NewGetIsolatedMarginRiskLimitReqBuilder() + builder := positions.NewGetMarginModeReqBuilder() builder.SetSymbol(?) req := builder.Build() - resp, err := positionsApi.GetIsolatedMarginRiskLimit(req, context.TODO()) + resp, err := positionsApi.GetMarginMode(req, context.TODO()) if err != nil { panic(err) } @@ -24,16 +24,16 @@ func TestPositionsGetIsolatedMarginRiskLimitReq(t *testing.T) { } -func TestPositionsGetPositionsHistoryReq(t *testing.T) { - // GetPositionsHistory - // Get Positions History - // /api/v1/history-positions +func TestPositionsSwitchMarginModeReq(t *testing.T) { + // SwitchMarginMode + // Switch Margin Mode + // /api/v2/position/changeMarginMode - builder := positions.NewGetPositionsHistoryReqBuilder() - builder.SetSymbol(?).SetFrom(?).SetTo(?).SetLimit(?).SetPageId(?) + builder := positions.NewSwitchMarginModeReqBuilder() + builder.SetSymbol(?).SetMarginMode(?) req := builder.Build() - resp, err := positionsApi.GetPositionsHistory(req, context.TODO()) + resp, err := positionsApi.SwitchMarginMode(req, context.TODO()) if err != nil { panic(err) } @@ -47,16 +47,16 @@ func TestPositionsGetPositionsHistoryReq(t *testing.T) { } -func TestPositionsGetMaxWithdrawMarginReq(t *testing.T) { - // GetMaxWithdrawMargin - // Get Max Withdraw Margin - // /api/v1/margin/maxWithdrawMargin +func TestPositionsGetMaxOpenSizeReq(t *testing.T) { + // GetMaxOpenSize + // Get Max Open Size + // /api/v2/getMaxOpenSize - builder := positions.NewGetMaxWithdrawMarginReqBuilder() - builder.SetSymbol(?) + builder := positions.NewGetMaxOpenSizeReqBuilder() + builder.SetSymbol(?).SetPrice(?).SetLeverage(?) req := builder.Build() - resp, err := positionsApi.GetMaxWithdrawMargin(req, context.TODO()) + resp, err := positionsApi.GetMaxOpenSize(req, context.TODO()) if err != nil { panic(err) } @@ -70,16 +70,16 @@ func TestPositionsGetMaxWithdrawMarginReq(t *testing.T) { } -func TestPositionsRemoveIsolatedMarginReq(t *testing.T) { - // RemoveIsolatedMargin - // Remove Isolated Margin - // /api/v1/margin/withdrawMargin +func TestPositionsGetPositionDetailsReq(t *testing.T) { + // GetPositionDetails + // Get Position Details + // /api/v1/position - builder := positions.NewRemoveIsolatedMarginReqBuilder() - builder.SetSymbol(?).SetWithdrawAmount(?) + builder := positions.NewGetPositionDetailsReqBuilder() + builder.SetSymbol(?) req := builder.Build() - resp, err := positionsApi.RemoveIsolatedMargin(req, context.TODO()) + resp, err := positionsApi.GetPositionDetails(req, context.TODO()) if err != nil { panic(err) } @@ -93,16 +93,16 @@ func TestPositionsRemoveIsolatedMarginReq(t *testing.T) { } -func TestPositionsGetPositionDetailsReq(t *testing.T) { - // GetPositionDetails - // Get Position Details - // /api/v1/position +func TestPositionsGetPositionListReq(t *testing.T) { + // GetPositionList + // Get Position List + // /api/v1/positions - builder := positions.NewGetPositionDetailsReqBuilder() - builder.SetSymbol(?) + builder := positions.NewGetPositionListReqBuilder() + builder.SetCurrency(?) req := builder.Build() - resp, err := positionsApi.GetPositionDetails(req, context.TODO()) + resp, err := positionsApi.GetPositionList(req, context.TODO()) if err != nil { panic(err) } @@ -116,16 +116,16 @@ func TestPositionsGetPositionDetailsReq(t *testing.T) { } -func TestPositionsModifyAutoDepositStatusReq(t *testing.T) { - // ModifyAutoDepositStatus - // Modify Isolated Margin Auto-Deposit Status - // /api/v1/position/margin/auto-deposit-status +func TestPositionsGetPositionsHistoryReq(t *testing.T) { + // GetPositionsHistory + // Get Positions History + // /api/v1/history-positions - builder := positions.NewModifyAutoDepositStatusReqBuilder() - builder.SetSymbol(?).SetStatus(?) + builder := positions.NewGetPositionsHistoryReqBuilder() + builder.SetSymbol(?).SetFrom(?).SetTo(?).SetLimit(?).SetPageId(?) req := builder.Build() - resp, err := positionsApi.ModifyAutoDepositStatus(req, context.TODO()) + resp, err := positionsApi.GetPositionsHistory(req, context.TODO()) if err != nil { panic(err) } @@ -139,16 +139,16 @@ func TestPositionsModifyAutoDepositStatusReq(t *testing.T) { } -func TestPositionsAddIsolatedMarginReq(t *testing.T) { - // AddIsolatedMargin - // Add Isolated Margin - // /api/v1/position/margin/deposit-margin +func TestPositionsGetMaxWithdrawMarginReq(t *testing.T) { + // GetMaxWithdrawMargin + // Get Max Withdraw Margin + // /api/v1/margin/maxWithdrawMargin - builder := positions.NewAddIsolatedMarginReqBuilder() - builder.SetSymbol(?).SetMargin(?).SetBizNo(?) + builder := positions.NewGetMaxWithdrawMarginReqBuilder() + builder.SetSymbol(?) req := builder.Build() - resp, err := positionsApi.AddIsolatedMargin(req, context.TODO()) + resp, err := positionsApi.GetMaxWithdrawMargin(req, context.TODO()) if err != nil { panic(err) } @@ -162,16 +162,16 @@ func TestPositionsAddIsolatedMarginReq(t *testing.T) { } -func TestPositionsModifyIsolatedMarginRiskLimtReq(t *testing.T) { - // ModifyIsolatedMarginRiskLimt - // Modify Isolated Margin Risk Limit - // /api/v1/position/risk-limit-level/change +func TestPositionsGetCrossMarginLeverageReq(t *testing.T) { + // GetCrossMarginLeverage + // Get Cross Margin Leverage + // /api/v2/getCrossUserLeverage - builder := positions.NewModifyIsolatedMarginRiskLimtReqBuilder() - builder.SetSymbol(?).SetLevel(?) + builder := positions.NewGetCrossMarginLeverageReqBuilder() + builder.SetSymbol(?) req := builder.Build() - resp, err := positionsApi.ModifyIsolatedMarginRiskLimt(req, context.TODO()) + resp, err := positionsApi.GetCrossMarginLeverage(req, context.TODO()) if err != nil { panic(err) } @@ -185,16 +185,16 @@ func TestPositionsModifyIsolatedMarginRiskLimtReq(t *testing.T) { } -func TestPositionsGetPositionListReq(t *testing.T) { - // GetPositionList - // Get Position List - // /api/v1/positions +func TestPositionsModifyMarginLeverageReq(t *testing.T) { + // ModifyMarginLeverage + // Modify Cross Margin Leverage + // /api/v2/changeCrossUserLeverage - builder := positions.NewGetPositionListReqBuilder() - builder.SetCurrency(?) + builder := positions.NewModifyMarginLeverageReqBuilder() + builder.SetSymbol(?).SetLeverage(?) req := builder.Build() - resp, err := positionsApi.GetPositionList(req, context.TODO()) + resp, err := positionsApi.ModifyMarginLeverage(req, context.TODO()) if err != nil { panic(err) } @@ -208,16 +208,16 @@ func TestPositionsGetPositionListReq(t *testing.T) { } -func TestPositionsModifyMarginLeverageReq(t *testing.T) { - // ModifyMarginLeverage - // Modify Cross Margin Leverage - // /api/v2/changeCrossUserLeverage +func TestPositionsAddIsolatedMarginReq(t *testing.T) { + // AddIsolatedMargin + // Add Isolated Margin + // /api/v1/position/margin/deposit-margin - builder := positions.NewModifyMarginLeverageReqBuilder() - builder.SetSymbol(?).SetLeverage(?) + builder := positions.NewAddIsolatedMarginReqBuilder() + builder.SetSymbol(?).SetMargin(?).SetBizNo(?) req := builder.Build() - resp, err := positionsApi.ModifyMarginLeverage(req, context.TODO()) + resp, err := positionsApi.AddIsolatedMargin(req, context.TODO()) if err != nil { panic(err) } @@ -231,16 +231,16 @@ func TestPositionsModifyMarginLeverageReq(t *testing.T) { } -func TestPositionsGetCrossMarginLeverageReq(t *testing.T) { - // GetCrossMarginLeverage - // Get Cross Margin Leverage - // /api/v2/getCrossUserLeverage +func TestPositionsRemoveIsolatedMarginReq(t *testing.T) { + // RemoveIsolatedMargin + // Remove Isolated Margin + // /api/v1/margin/withdrawMargin - builder := positions.NewGetCrossMarginLeverageReqBuilder() - builder.SetSymbol(?) + builder := positions.NewRemoveIsolatedMarginReqBuilder() + builder.SetSymbol(?).SetWithdrawAmount(?) req := builder.Build() - resp, err := positionsApi.GetCrossMarginLeverage(req, context.TODO()) + resp, err := positionsApi.RemoveIsolatedMargin(req, context.TODO()) if err != nil { panic(err) } @@ -254,16 +254,16 @@ func TestPositionsGetCrossMarginLeverageReq(t *testing.T) { } -func TestPositionsGetMaxOpenSizeReq(t *testing.T) { - // GetMaxOpenSize - // Get Max Open Size - // /api/v2/getMaxOpenSize +func TestPositionsGetIsolatedMarginRiskLimitReq(t *testing.T) { + // GetIsolatedMarginRiskLimit + // Get Isolated Margin Risk Limit + // /api/v1/contracts/risk-limit/{symbol} - builder := positions.NewGetMaxOpenSizeReqBuilder() - builder.SetSymbol(?).SetPrice(?).SetLeverage(?) + builder := positions.NewGetIsolatedMarginRiskLimitReqBuilder() + builder.SetSymbol(?) req := builder.Build() - resp, err := positionsApi.GetMaxOpenSize(req, context.TODO()) + resp, err := positionsApi.GetIsolatedMarginRiskLimit(req, context.TODO()) if err != nil { panic(err) } @@ -277,16 +277,16 @@ func TestPositionsGetMaxOpenSizeReq(t *testing.T) { } -func TestPositionsSwitchMarginModeReq(t *testing.T) { - // SwitchMarginMode - // Switch Margin Mode - // /api/v2/position/changeMarginMode +func TestPositionsModifyIsolatedMarginRiskLimtReq(t *testing.T) { + // ModifyIsolatedMarginRiskLimt + // Modify Isolated Margin Risk Limit + // /api/v1/position/risk-limit-level/change - builder := positions.NewSwitchMarginModeReqBuilder() - builder.SetSymbol(?).SetMarginMode(?) + builder := positions.NewModifyIsolatedMarginRiskLimtReqBuilder() + builder.SetSymbol(?).SetLevel(?) req := builder.Build() - resp, err := positionsApi.SwitchMarginMode(req, context.TODO()) + resp, err := positionsApi.ModifyIsolatedMarginRiskLimt(req, context.TODO()) if err != nil { panic(err) } @@ -300,16 +300,16 @@ func TestPositionsSwitchMarginModeReq(t *testing.T) { } -func TestPositionsGetMarginModeReq(t *testing.T) { - // GetMarginMode - // Get Margin Mode - // /api/v2/position/getMarginMode +func TestPositionsModifyAutoDepositStatusReq(t *testing.T) { + // ModifyAutoDepositStatus + // Modify Isolated Margin Auto-Deposit Status + // /api/v1/position/margin/auto-deposit-status - builder := positions.NewGetMarginModeReqBuilder() - builder.SetSymbol(?) + builder := positions.NewModifyAutoDepositStatusReqBuilder() + builder.SetSymbol(?).SetStatus(?) req := builder.Build() - resp, err := positionsApi.GetMarginMode(req, context.TODO()) + resp, err := positionsApi.ModifyAutoDepositStatus(req, context.TODO()) if err != nil { panic(err) } diff --git a/sdk/golang/pkg/generate/futures/positions/api_positions_test.go b/sdk/golang/pkg/generate/futures/positions/api_positions_test.go index b92a487f..02b60200 100644 --- a/sdk/golang/pkg/generate/futures/positions/api_positions_test.go +++ b/sdk/golang/pkg/generate/futures/positions/api_positions_test.go @@ -7,113 +7,85 @@ import ( "testing" ) -func TestPositionsGetIsolatedMarginRiskLimitReqModel(t *testing.T) { - // GetIsolatedMarginRiskLimit - // Get Isolated Margin Risk Limit - // /api/v1/contracts/risk-limit/{symbol} +func TestPositionsGetMarginModeReqModel(t *testing.T) { + // GetMarginMode + // Get Margin Mode + // /api/v2/position/getMarginMode data := "{\"symbol\": \"XBTUSDTM\"}" - req := &GetIsolatedMarginRiskLimitReq{} - err := json.Unmarshal([]byte(data), req) - req.ToMap() - assert.Nil(t, err) -} - -func TestPositionsGetIsolatedMarginRiskLimitRespModel(t *testing.T) { - // GetIsolatedMarginRiskLimit - // Get Isolated Margin Risk Limit - // /api/v1/contracts/risk-limit/{symbol} - - data := "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"symbol\": \"XBTUSDTM\",\n \"level\": 1,\n \"maxRiskLimit\": 100000,\n \"minRiskLimit\": 0,\n \"maxLeverage\": 125,\n \"initialMargin\": 0.008,\n \"maintainMargin\": 0.004\n },\n {\n \"symbol\": \"XBTUSDTM\",\n \"level\": 2,\n \"maxRiskLimit\": 500000,\n \"minRiskLimit\": 100000,\n \"maxLeverage\": 100,\n \"initialMargin\": 0.01,\n \"maintainMargin\": 0.005\n },\n {\n \"symbol\": \"XBTUSDTM\",\n \"level\": 3,\n \"maxRiskLimit\": 1000000,\n \"minRiskLimit\": 500000,\n \"maxLeverage\": 75,\n \"initialMargin\": 0.014,\n \"maintainMargin\": 0.007\n },\n {\n \"symbol\": \"XBTUSDTM\",\n \"level\": 4,\n \"maxRiskLimit\": 2000000,\n \"minRiskLimit\": 1000000,\n \"maxLeverage\": 50,\n \"initialMargin\": 0.02,\n \"maintainMargin\": 0.01\n },\n {\n \"symbol\": \"XBTUSDTM\",\n \"level\": 5,\n \"maxRiskLimit\": 3000000,\n \"minRiskLimit\": 2000000,\n \"maxLeverage\": 30,\n \"initialMargin\": 0.034,\n \"maintainMargin\": 0.017\n },\n {\n \"symbol\": \"XBTUSDTM\",\n \"level\": 6,\n \"maxRiskLimit\": 5000000,\n \"minRiskLimit\": 3000000,\n \"maxLeverage\": 20,\n \"initialMargin\": 0.05,\n \"maintainMargin\": 0.025\n },\n {\n \"symbol\": \"XBTUSDTM\",\n \"level\": 7,\n \"maxRiskLimit\": 8000000,\n \"minRiskLimit\": 5000000,\n \"maxLeverage\": 10,\n \"initialMargin\": 0.1,\n \"maintainMargin\": 0.05\n },\n {\n \"symbol\": \"XBTUSDTM\",\n \"level\": 8,\n \"maxRiskLimit\": 12000000,\n \"minRiskLimit\": 8000000,\n \"maxLeverage\": 5,\n \"initialMargin\": 0.2,\n \"maintainMargin\": 0.1\n },\n {\n \"symbol\": \"XBTUSDTM\",\n \"level\": 9,\n \"maxRiskLimit\": 20000000,\n \"minRiskLimit\": 12000000,\n \"maxLeverage\": 4,\n \"initialMargin\": 0.25,\n \"maintainMargin\": 0.125\n },\n {\n \"symbol\": \"XBTUSDTM\",\n \"level\": 10,\n \"maxRiskLimit\": 30000000,\n \"minRiskLimit\": 20000000,\n \"maxLeverage\": 3,\n \"initialMargin\": 0.334,\n \"maintainMargin\": 0.167\n },\n {\n \"symbol\": \"XBTUSDTM\",\n \"level\": 11,\n \"maxRiskLimit\": 40000000,\n \"minRiskLimit\": 30000000,\n \"maxLeverage\": 2,\n \"initialMargin\": 0.5,\n \"maintainMargin\": 0.25\n },\n {\n \"symbol\": \"XBTUSDTM\",\n \"level\": 12,\n \"maxRiskLimit\": 50000000,\n \"minRiskLimit\": 40000000,\n \"maxLeverage\": 1,\n \"initialMargin\": 1.0,\n \"maintainMargin\": 0.5\n }\n ]\n}" - commonResp := &types.RestResponse{} - err := json.Unmarshal([]byte(data), commonResp) - assert.Nil(t, err) - assert.NotNil(t, commonResp.Data) - resp := &GetIsolatedMarginRiskLimitResp{} - err = json.Unmarshal([]byte(commonResp.Data), resp) - resp.ToMap() - assert.Nil(t, err) -} - -func TestPositionsGetPositionsHistoryReqModel(t *testing.T) { - // GetPositionsHistory - // Get Positions History - // /api/v1/history-positions - - data := "{\"symbol\": \"example_string_default_value\", \"from\": 123456, \"to\": 123456, \"limit\": 10, \"pageId\": 1}" - req := &GetPositionsHistoryReq{} + req := &GetMarginModeReq{} err := json.Unmarshal([]byte(data), req) req.ToMap() assert.Nil(t, err) } -func TestPositionsGetPositionsHistoryRespModel(t *testing.T) { - // GetPositionsHistory - // Get Positions History - // /api/v1/history-positions +func TestPositionsGetMarginModeRespModel(t *testing.T) { + // GetMarginMode + // Get Margin Mode + // /api/v2/position/getMarginMode - data := "{\n \"code\": \"200000\",\n \"data\": {\n \"currentPage\": 1,\n \"pageSize\": 10,\n \"totalNum\": 3,\n \"totalPage\": 1,\n \"items\": [\n {\n \"closeId\": \"500000000027312193\",\n \"userId\": \"633559791e1cbc0001f319bc\",\n \"symbol\": \"XBTUSDTM\",\n \"settleCurrency\": \"USDT\",\n \"leverage\": \"0.0\",\n \"type\": \"CLOSE_SHORT\",\n \"pnl\": \"-3.79237944\",\n \"realisedGrossCost\": \"3.795\",\n \"withdrawPnl\": \"0.0\",\n \"tradeFee\": \"0.078657\",\n \"fundingFee\": \"0.08127756\",\n \"openTime\": 1727073653603,\n \"closeTime\": 1729155587945,\n \"openPrice\": \"63650.0\",\n \"closePrice\": \"67445.0\",\n \"marginMode\": \"ISOLATED\"\n },\n {\n \"closeId\": \"500000000026809668\",\n \"userId\": \"633559791e1cbc0001f319bc\",\n \"symbol\": \"SUIUSDTM\",\n \"settleCurrency\": \"USDT\",\n \"leverage\": \"0.0\",\n \"type\": \"LIQUID_SHORT\",\n \"pnl\": \"-1.10919296\",\n \"realisedGrossCost\": \"1.11297635\",\n \"withdrawPnl\": \"0.0\",\n \"tradeFee\": \"0.00200295\",\n \"fundingFee\": \"0.00578634\",\n \"openTime\": 1726473389296,\n \"closeTime\": 1728738683541,\n \"openPrice\": \"1.1072\",\n \"closePrice\": \"2.22017635\",\n \"marginMode\": \"ISOLATED\"\n },\n {\n \"closeId\": \"500000000026819355\",\n \"userId\": \"633559791e1cbc0001f319bc\",\n \"symbol\": \"XBTUSDTM\",\n \"settleCurrency\": \"USDT\",\n \"leverage\": \"0.0\",\n \"type\": \"LIQUID_SHORT\",\n \"pnl\": \"-5.941896296\",\n \"realisedGrossCost\": \"5.86937042\",\n \"withdrawPnl\": \"0.0\",\n \"tradeFee\": \"0.074020096\",\n \"fundingFee\": \"0.00149422\",\n \"openTime\": 1726490775358,\n \"closeTime\": 1727061049859,\n \"openPrice\": \"58679.6\",\n \"closePrice\": \"64548.97042\",\n \"marginMode\": \"ISOLATED\"\n }\n ]\n }\n}" + data := "{\n \"code\": \"200000\",\n \"data\": {\n \"symbol\": \"XBTUSDTM\",\n \"marginMode\": \"ISOLATED\"\n }\n}" commonResp := &types.RestResponse{} err := json.Unmarshal([]byte(data), commonResp) assert.Nil(t, err) assert.NotNil(t, commonResp.Data) - resp := &GetPositionsHistoryResp{} + resp := &GetMarginModeResp{} err = json.Unmarshal([]byte(commonResp.Data), resp) resp.ToMap() assert.Nil(t, err) } -func TestPositionsGetMaxWithdrawMarginReqModel(t *testing.T) { - // GetMaxWithdrawMargin - // Get Max Withdraw Margin - // /api/v1/margin/maxWithdrawMargin +func TestPositionsSwitchMarginModeReqModel(t *testing.T) { + // SwitchMarginMode + // Switch Margin Mode + // /api/v2/position/changeMarginMode - data := "{\"symbol\": \"example_string_default_value\"}" - req := &GetMaxWithdrawMarginReq{} + data := "{\"symbol\": \"XBTUSDTM\", \"marginMode\": \"ISOLATED\"}" + req := &SwitchMarginModeReq{} err := json.Unmarshal([]byte(data), req) req.ToMap() assert.Nil(t, err) } -func TestPositionsGetMaxWithdrawMarginRespModel(t *testing.T) { - // GetMaxWithdrawMargin - // Get Max Withdraw Margin - // /api/v1/margin/maxWithdrawMargin +func TestPositionsSwitchMarginModeRespModel(t *testing.T) { + // SwitchMarginMode + // Switch Margin Mode + // /api/v2/position/changeMarginMode - data := "{\n \"code\": \"200000\",\n \"data\": \"21.1135719252\"\n}" + data := "{\n \"code\": \"200000\",\n \"data\": {\n \"symbol\": \"XBTUSDTM\",\n \"marginMode\": \"ISOLATED\"\n }\n}" commonResp := &types.RestResponse{} err := json.Unmarshal([]byte(data), commonResp) assert.Nil(t, err) assert.NotNil(t, commonResp.Data) - resp := &GetMaxWithdrawMarginResp{} + resp := &SwitchMarginModeResp{} err = json.Unmarshal([]byte(commonResp.Data), resp) resp.ToMap() assert.Nil(t, err) } -func TestPositionsRemoveIsolatedMarginReqModel(t *testing.T) { - // RemoveIsolatedMargin - // Remove Isolated Margin - // /api/v1/margin/withdrawMargin +func TestPositionsGetMaxOpenSizeReqModel(t *testing.T) { + // GetMaxOpenSize + // Get Max Open Size + // /api/v2/getMaxOpenSize - data := "{\"symbol\": \"XBTUSDTM\", \"withdrawAmount\": \"0.0000001\"}" - req := &RemoveIsolatedMarginReq{} + data := "{\"symbol\": \"XBTUSDTM\", \"price\": \"example_string_default_value\", \"leverage\": 123456}" + req := &GetMaxOpenSizeReq{} err := json.Unmarshal([]byte(data), req) req.ToMap() assert.Nil(t, err) } -func TestPositionsRemoveIsolatedMarginRespModel(t *testing.T) { - // RemoveIsolatedMargin - // Remove Isolated Margin - // /api/v1/margin/withdrawMargin +func TestPositionsGetMaxOpenSizeRespModel(t *testing.T) { + // GetMaxOpenSize + // Get Max Open Size + // /api/v2/getMaxOpenSize - data := "{\n \"code\": \"200000\",\n \"data\": \"0.1\"\n}" + data := "{\n \"code\": \"200000\",\n \"data\": {\n \"symbol\": \"XBTUSDTM\",\n \"maxBuyOpenSize\": 0,\n \"maxSellOpenSize\": 0\n }\n}" commonResp := &types.RestResponse{} err := json.Unmarshal([]byte(data), commonResp) assert.Nil(t, err) assert.NotNil(t, commonResp.Data) - resp := &RemoveIsolatedMarginResp{} + resp := &GetMaxOpenSizeResp{} err = json.Unmarshal([]byte(commonResp.Data), resp) resp.ToMap() assert.Nil(t, err) @@ -147,113 +119,113 @@ func TestPositionsGetPositionDetailsRespModel(t *testing.T) { assert.Nil(t, err) } -func TestPositionsModifyAutoDepositStatusReqModel(t *testing.T) { - // ModifyAutoDepositStatus - // Modify Isolated Margin Auto-Deposit Status - // /api/v1/position/margin/auto-deposit-status +func TestPositionsGetPositionListReqModel(t *testing.T) { + // GetPositionList + // Get Position List + // /api/v1/positions - data := "{\"symbol\": \"XBTUSDTM\", \"status\": true}" - req := &ModifyAutoDepositStatusReq{} + data := "{\"currency\": \"USDT\"}" + req := &GetPositionListReq{} err := json.Unmarshal([]byte(data), req) req.ToMap() assert.Nil(t, err) } -func TestPositionsModifyAutoDepositStatusRespModel(t *testing.T) { - // ModifyAutoDepositStatus - // Modify Isolated Margin Auto-Deposit Status - // /api/v1/position/margin/auto-deposit-status +func TestPositionsGetPositionListRespModel(t *testing.T) { + // GetPositionList + // Get Position List + // /api/v1/positions - data := "{\n \"code\": \"200000\",\n \"data\": true\n}" + data := "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"id\": \"500000000001046430\",\n \"symbol\": \"ETHUSDM\",\n \"crossMode\": true,\n \"delevPercentage\": 0.71,\n \"openingTimestamp\": 1730635780702,\n \"currentTimestamp\": 1730636040926,\n \"currentQty\": 1,\n \"currentCost\": -4.069805E-4,\n \"currentComm\": 2.441E-7,\n \"unrealisedCost\": -4.069805E-4,\n \"realisedGrossCost\": 0.0,\n \"realisedCost\": 2.441E-7,\n \"isOpen\": true,\n \"markPrice\": 2454.12,\n \"markValue\": -4.07478E-4,\n \"posCost\": -4.069805E-4,\n \"posInit\": 4.06981E-5,\n \"posMargin\": 4.07478E-5,\n \"realisedGrossPnl\": 0.0,\n \"realisedPnl\": -2.441E-7,\n \"unrealisedPnl\": -4.975E-7,\n \"unrealisedPnlPcnt\": -0.0012,\n \"unrealisedRoePcnt\": -0.0122,\n \"avgEntryPrice\": 2457.12,\n \"liquidationPrice\": 1429.96,\n \"bankruptPrice\": 1414.96,\n \"settleCurrency\": \"ETH\",\n \"isInverse\": true,\n \"marginMode\": \"CROSS\",\n \"positionSide\": \"BOTH\",\n \"leverage\": 10\n },\n {\n \"id\": \"500000000000988255\",\n \"symbol\": \"XBTUSDTM\",\n \"autoDeposit\": true,\n \"crossMode\": false,\n \"maintMarginReq\": 0.005,\n \"riskLimit\": 500000,\n \"realLeverage\": 2.97,\n \"delevPercentage\": 0.5,\n \"openingTimestamp\": 1729155616322,\n \"currentTimestamp\": 1730636040926,\n \"currentQty\": 1,\n \"currentCost\": 67.4309,\n \"currentComm\": -0.15936162,\n \"unrealisedCost\": 67.4309,\n \"realisedGrossCost\": 0.0,\n \"realisedCost\": -0.15936162,\n \"isOpen\": true,\n \"markPrice\": 68323.06,\n \"markValue\": 68.32306,\n \"posCost\": 67.4309,\n \"posCross\": 0.06225152,\n \"posCrossMargin\": 0,\n \"posInit\": 22.2769666644,\n \"posComm\": 0.0539821899,\n \"posCommCommon\": 0.0539447199,\n \"posLoss\": 0.26210915,\n \"posMargin\": 22.1310912243,\n \"posFunding\": -0.19982016,\n \"posMaint\": 0.4046228699,\n \"maintMargin\": 23.0232512243,\n \"realisedGrossPnl\": 0.0,\n \"realisedPnl\": -0.2402787,\n \"unrealisedPnl\": 0.89216,\n \"unrealisedPnlPcnt\": 0.0132,\n \"unrealisedRoePcnt\": 0.04,\n \"avgEntryPrice\": 67430.9,\n \"liquidationPrice\": 45704.44,\n \"bankruptPrice\": 45353.8,\n \"settleCurrency\": \"USDT\",\n \"isInverse\": false,\n \"maintainMargin\": 0.005,\n \"marginMode\": \"ISOLATED\",\n \"positionSide\": \"BOTH\",\n \"leverage\": 2.97\n }\n ]\n}" commonResp := &types.RestResponse{} err := json.Unmarshal([]byte(data), commonResp) assert.Nil(t, err) assert.NotNil(t, commonResp.Data) - resp := &ModifyAutoDepositStatusResp{} + resp := &GetPositionListResp{} err = json.Unmarshal([]byte(commonResp.Data), resp) resp.ToMap() assert.Nil(t, err) } -func TestPositionsAddIsolatedMarginReqModel(t *testing.T) { - // AddIsolatedMargin - // Add Isolated Margin - // /api/v1/position/margin/deposit-margin +func TestPositionsGetPositionsHistoryReqModel(t *testing.T) { + // GetPositionsHistory + // Get Positions History + // /api/v1/history-positions - data := "{\"symbol\": \"string\", \"margin\": 0, \"bizNo\": \"string\"}" - req := &AddIsolatedMarginReq{} + data := "{\"symbol\": \"example_string_default_value\", \"from\": 123456, \"to\": 123456, \"limit\": 10, \"pageId\": 1}" + req := &GetPositionsHistoryReq{} err := json.Unmarshal([]byte(data), req) req.ToMap() assert.Nil(t, err) } -func TestPositionsAddIsolatedMarginRespModel(t *testing.T) { - // AddIsolatedMargin - // Add Isolated Margin - // /api/v1/position/margin/deposit-margin +func TestPositionsGetPositionsHistoryRespModel(t *testing.T) { + // GetPositionsHistory + // Get Positions History + // /api/v1/history-positions - data := "{\n \"code\": \"200000\",\n \"data\": {\n \"id\": \"6200c9b83aecfb000152ddcd\",\n \"symbol\": \"XBTUSDTM\",\n \"autoDeposit\": false,\n \"maintMarginReq\": 0.005,\n \"riskLimit\": 500000,\n \"realLeverage\": 18.72,\n \"crossMode\": false,\n \"delevPercentage\": 0.66,\n \"openingTimestamp\": 1646287090131,\n \"currentTimestamp\": 1646295055021,\n \"currentQty\": 1,\n \"currentCost\": 43.388,\n \"currentComm\": 0.0260328,\n \"unrealisedCost\": 43.388,\n \"realisedGrossCost\": 0,\n \"realisedCost\": 0.0260328,\n \"isOpen\": true,\n \"markPrice\": 43536.65,\n \"markValue\": 43.53665,\n \"posCost\": 43.388,\n \"posCross\": 0.000024985,\n \"posInit\": 2.1694,\n \"posComm\": 0.02733446,\n \"posLoss\": 0,\n \"posMargin\": 2.19675944,\n \"posMaint\": 0.24861326,\n \"maintMargin\": 2.34540944,\n \"realisedGrossPnl\": 0,\n \"realisedPnl\": -0.0260328,\n \"unrealisedPnl\": 0.14865,\n \"unrealisedPnlPcnt\": 0.0034,\n \"unrealisedRoePcnt\": 0.0685,\n \"avgEntryPrice\": 43388,\n \"liquidationPrice\": 41440,\n \"bankruptPrice\": 41218,\n \"userId\": 1234321123,\n \"settleCurrency\": \"USDT\"\n }\n}" + data := "{\n \"code\": \"200000\",\n \"data\": {\n \"currentPage\": 1,\n \"pageSize\": 10,\n \"totalNum\": 3,\n \"totalPage\": 1,\n \"items\": [\n {\n \"closeId\": \"500000000027312193\",\n \"userId\": \"633559791e1cbc0001f319bc\",\n \"symbol\": \"XBTUSDTM\",\n \"settleCurrency\": \"USDT\",\n \"leverage\": \"0.0\",\n \"type\": \"CLOSE_SHORT\",\n \"pnl\": \"-3.79237944\",\n \"realisedGrossCost\": \"3.795\",\n \"withdrawPnl\": \"0.0\",\n \"tradeFee\": \"0.078657\",\n \"fundingFee\": \"0.08127756\",\n \"openTime\": 1727073653603,\n \"closeTime\": 1729155587945,\n \"openPrice\": \"63650.0\",\n \"closePrice\": \"67445.0\",\n \"marginMode\": \"ISOLATED\"\n },\n {\n \"closeId\": \"500000000026809668\",\n \"userId\": \"633559791e1cbc0001f319bc\",\n \"symbol\": \"SUIUSDTM\",\n \"settleCurrency\": \"USDT\",\n \"leverage\": \"0.0\",\n \"type\": \"LIQUID_SHORT\",\n \"pnl\": \"-1.10919296\",\n \"realisedGrossCost\": \"1.11297635\",\n \"withdrawPnl\": \"0.0\",\n \"tradeFee\": \"0.00200295\",\n \"fundingFee\": \"0.00578634\",\n \"openTime\": 1726473389296,\n \"closeTime\": 1728738683541,\n \"openPrice\": \"1.1072\",\n \"closePrice\": \"2.22017635\",\n \"marginMode\": \"ISOLATED\"\n },\n {\n \"closeId\": \"500000000026819355\",\n \"userId\": \"633559791e1cbc0001f319bc\",\n \"symbol\": \"XBTUSDTM\",\n \"settleCurrency\": \"USDT\",\n \"leverage\": \"0.0\",\n \"type\": \"LIQUID_SHORT\",\n \"pnl\": \"-5.941896296\",\n \"realisedGrossCost\": \"5.86937042\",\n \"withdrawPnl\": \"0.0\",\n \"tradeFee\": \"0.074020096\",\n \"fundingFee\": \"0.00149422\",\n \"openTime\": 1726490775358,\n \"closeTime\": 1727061049859,\n \"openPrice\": \"58679.6\",\n \"closePrice\": \"64548.97042\",\n \"marginMode\": \"ISOLATED\"\n }\n ]\n }\n}" commonResp := &types.RestResponse{} err := json.Unmarshal([]byte(data), commonResp) assert.Nil(t, err) assert.NotNil(t, commonResp.Data) - resp := &AddIsolatedMarginResp{} + resp := &GetPositionsHistoryResp{} err = json.Unmarshal([]byte(commonResp.Data), resp) resp.ToMap() assert.Nil(t, err) } -func TestPositionsModifyIsolatedMarginRiskLimtReqModel(t *testing.T) { - // ModifyIsolatedMarginRiskLimt - // Modify Isolated Margin Risk Limit - // /api/v1/position/risk-limit-level/change +func TestPositionsGetMaxWithdrawMarginReqModel(t *testing.T) { + // GetMaxWithdrawMargin + // Get Max Withdraw Margin + // /api/v1/margin/maxWithdrawMargin - data := "{\"symbol\": \"XBTUSDTM\", \"level\": 2}" - req := &ModifyIsolatedMarginRiskLimtReq{} + data := "{\"symbol\": \"example_string_default_value\"}" + req := &GetMaxWithdrawMarginReq{} err := json.Unmarshal([]byte(data), req) req.ToMap() assert.Nil(t, err) } -func TestPositionsModifyIsolatedMarginRiskLimtRespModel(t *testing.T) { - // ModifyIsolatedMarginRiskLimt - // Modify Isolated Margin Risk Limit - // /api/v1/position/risk-limit-level/change +func TestPositionsGetMaxWithdrawMarginRespModel(t *testing.T) { + // GetMaxWithdrawMargin + // Get Max Withdraw Margin + // /api/v1/margin/maxWithdrawMargin - data := "{\n \"code\": \"200000\",\n \"data\": true\n}" + data := "{\n \"code\": \"200000\",\n \"data\": \"21.1135719252\"\n}" commonResp := &types.RestResponse{} err := json.Unmarshal([]byte(data), commonResp) assert.Nil(t, err) assert.NotNil(t, commonResp.Data) - resp := &ModifyIsolatedMarginRiskLimtResp{} + resp := &GetMaxWithdrawMarginResp{} err = json.Unmarshal([]byte(commonResp.Data), resp) resp.ToMap() assert.Nil(t, err) } -func TestPositionsGetPositionListReqModel(t *testing.T) { - // GetPositionList - // Get Position List - // /api/v1/positions +func TestPositionsGetCrossMarginLeverageReqModel(t *testing.T) { + // GetCrossMarginLeverage + // Get Cross Margin Leverage + // /api/v2/getCrossUserLeverage - data := "{\"currency\": \"USDT\"}" - req := &GetPositionListReq{} + data := "{\"symbol\": \"XBTUSDTM\"}" + req := &GetCrossMarginLeverageReq{} err := json.Unmarshal([]byte(data), req) req.ToMap() assert.Nil(t, err) } -func TestPositionsGetPositionListRespModel(t *testing.T) { - // GetPositionList - // Get Position List - // /api/v1/positions +func TestPositionsGetCrossMarginLeverageRespModel(t *testing.T) { + // GetCrossMarginLeverage + // Get Cross Margin Leverage + // /api/v2/getCrossUserLeverage - data := "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"id\": \"500000000001046430\",\n \"symbol\": \"ETHUSDM\",\n \"crossMode\": true,\n \"delevPercentage\": 0.71,\n \"openingTimestamp\": 1730635780702,\n \"currentTimestamp\": 1730636040926,\n \"currentQty\": 1,\n \"currentCost\": -4.069805E-4,\n \"currentComm\": 2.441E-7,\n \"unrealisedCost\": -4.069805E-4,\n \"realisedGrossCost\": 0.0,\n \"realisedCost\": 2.441E-7,\n \"isOpen\": true,\n \"markPrice\": 2454.12,\n \"markValue\": -4.07478E-4,\n \"posCost\": -4.069805E-4,\n \"posInit\": 4.06981E-5,\n \"posMargin\": 4.07478E-5,\n \"realisedGrossPnl\": 0.0,\n \"realisedPnl\": -2.441E-7,\n \"unrealisedPnl\": -4.975E-7,\n \"unrealisedPnlPcnt\": -0.0012,\n \"unrealisedRoePcnt\": -0.0122,\n \"avgEntryPrice\": 2457.12,\n \"liquidationPrice\": 1429.96,\n \"bankruptPrice\": 1414.96,\n \"settleCurrency\": \"ETH\",\n \"isInverse\": true,\n \"marginMode\": \"CROSS\",\n \"positionSide\": \"BOTH\",\n \"leverage\": 10\n },\n {\n \"id\": \"500000000000988255\",\n \"symbol\": \"XBTUSDTM\",\n \"autoDeposit\": true,\n \"crossMode\": false,\n \"maintMarginReq\": 0.005,\n \"riskLimit\": 500000,\n \"realLeverage\": 2.97,\n \"delevPercentage\": 0.5,\n \"openingTimestamp\": 1729155616322,\n \"currentTimestamp\": 1730636040926,\n \"currentQty\": 1,\n \"currentCost\": 67.4309,\n \"currentComm\": -0.15936162,\n \"unrealisedCost\": 67.4309,\n \"realisedGrossCost\": 0.0,\n \"realisedCost\": -0.15936162,\n \"isOpen\": true,\n \"markPrice\": 68323.06,\n \"markValue\": 68.32306,\n \"posCost\": 67.4309,\n \"posCross\": 0.06225152,\n \"posCrossMargin\": 0,\n \"posInit\": 22.2769666644,\n \"posComm\": 0.0539821899,\n \"posCommCommon\": 0.0539447199,\n \"posLoss\": 0.26210915,\n \"posMargin\": 22.1310912243,\n \"posFunding\": -0.19982016,\n \"posMaint\": 0.4046228699,\n \"maintMargin\": 23.0232512243,\n \"realisedGrossPnl\": 0.0,\n \"realisedPnl\": -0.2402787,\n \"unrealisedPnl\": 0.89216,\n \"unrealisedPnlPcnt\": 0.0132,\n \"unrealisedRoePcnt\": 0.04,\n \"avgEntryPrice\": 67430.9,\n \"liquidationPrice\": 45704.44,\n \"bankruptPrice\": 45353.8,\n \"settleCurrency\": \"USDT\",\n \"isInverse\": false,\n \"maintainMargin\": 0.005,\n \"marginMode\": \"ISOLATED\",\n \"positionSide\": \"BOTH\",\n \"leverage\": 2.97\n }\n ]\n}" + data := "{\n \"code\": \"200000\",\n \"data\": {\n \"symbol\": \"XBTUSDTM\",\n \"leverage\": \"3\"\n }\n}" commonResp := &types.RestResponse{} err := json.Unmarshal([]byte(data), commonResp) assert.Nil(t, err) assert.NotNil(t, commonResp.Data) - resp := &GetPositionListResp{} + resp := &GetCrossMarginLeverageResp{} err = json.Unmarshal([]byte(commonResp.Data), resp) resp.ToMap() assert.Nil(t, err) @@ -287,113 +259,141 @@ func TestPositionsModifyMarginLeverageRespModel(t *testing.T) { assert.Nil(t, err) } -func TestPositionsGetCrossMarginLeverageReqModel(t *testing.T) { - // GetCrossMarginLeverage - // Get Cross Margin Leverage - // /api/v2/getCrossUserLeverage +func TestPositionsAddIsolatedMarginReqModel(t *testing.T) { + // AddIsolatedMargin + // Add Isolated Margin + // /api/v1/position/margin/deposit-margin - data := "{\"symbol\": \"XBTUSDTM\"}" - req := &GetCrossMarginLeverageReq{} + data := "{\"symbol\": \"string\", \"margin\": 0, \"bizNo\": \"string\"}" + req := &AddIsolatedMarginReq{} err := json.Unmarshal([]byte(data), req) req.ToMap() assert.Nil(t, err) } -func TestPositionsGetCrossMarginLeverageRespModel(t *testing.T) { - // GetCrossMarginLeverage - // Get Cross Margin Leverage - // /api/v2/getCrossUserLeverage +func TestPositionsAddIsolatedMarginRespModel(t *testing.T) { + // AddIsolatedMargin + // Add Isolated Margin + // /api/v1/position/margin/deposit-margin - data := "{\n \"code\": \"200000\",\n \"data\": {\n \"symbol\": \"XBTUSDTM\",\n \"leverage\": \"3\"\n }\n}" + data := "{\n \"code\": \"200000\",\n \"data\": {\n \"id\": \"6200c9b83aecfb000152ddcd\",\n \"symbol\": \"XBTUSDTM\",\n \"autoDeposit\": false,\n \"maintMarginReq\": 0.005,\n \"riskLimit\": 500000,\n \"realLeverage\": 18.72,\n \"crossMode\": false,\n \"delevPercentage\": 0.66,\n \"openingTimestamp\": 1646287090131,\n \"currentTimestamp\": 1646295055021,\n \"currentQty\": 1,\n \"currentCost\": 43.388,\n \"currentComm\": 0.0260328,\n \"unrealisedCost\": 43.388,\n \"realisedGrossCost\": 0,\n \"realisedCost\": 0.0260328,\n \"isOpen\": true,\n \"markPrice\": 43536.65,\n \"markValue\": 43.53665,\n \"posCost\": 43.388,\n \"posCross\": 0.000024985,\n \"posInit\": 2.1694,\n \"posComm\": 0.02733446,\n \"posLoss\": 0,\n \"posMargin\": 2.19675944,\n \"posMaint\": 0.24861326,\n \"maintMargin\": 2.34540944,\n \"realisedGrossPnl\": 0,\n \"realisedPnl\": -0.0260328,\n \"unrealisedPnl\": 0.14865,\n \"unrealisedPnlPcnt\": 0.0034,\n \"unrealisedRoePcnt\": 0.0685,\n \"avgEntryPrice\": 43388,\n \"liquidationPrice\": 41440,\n \"bankruptPrice\": 41218,\n \"userId\": 1234321123,\n \"settleCurrency\": \"USDT\"\n }\n}" commonResp := &types.RestResponse{} err := json.Unmarshal([]byte(data), commonResp) assert.Nil(t, err) assert.NotNil(t, commonResp.Data) - resp := &GetCrossMarginLeverageResp{} + resp := &AddIsolatedMarginResp{} err = json.Unmarshal([]byte(commonResp.Data), resp) resp.ToMap() assert.Nil(t, err) } -func TestPositionsGetMaxOpenSizeReqModel(t *testing.T) { - // GetMaxOpenSize - // Get Max Open Size - // /api/v2/getMaxOpenSize +func TestPositionsRemoveIsolatedMarginReqModel(t *testing.T) { + // RemoveIsolatedMargin + // Remove Isolated Margin + // /api/v1/margin/withdrawMargin - data := "{\"symbol\": \"XBTUSDTM\", \"price\": \"example_string_default_value\", \"leverage\": 123456}" - req := &GetMaxOpenSizeReq{} + data := "{\"symbol\": \"XBTUSDTM\", \"withdrawAmount\": \"0.0000001\"}" + req := &RemoveIsolatedMarginReq{} err := json.Unmarshal([]byte(data), req) req.ToMap() assert.Nil(t, err) } -func TestPositionsGetMaxOpenSizeRespModel(t *testing.T) { - // GetMaxOpenSize - // Get Max Open Size - // /api/v2/getMaxOpenSize +func TestPositionsRemoveIsolatedMarginRespModel(t *testing.T) { + // RemoveIsolatedMargin + // Remove Isolated Margin + // /api/v1/margin/withdrawMargin - data := "{\n \"code\": \"200000\",\n \"data\": {\n \"symbol\": \"XBTUSDTM\",\n \"maxBuyOpenSize\": 0,\n \"maxSellOpenSize\": 0\n }\n}" + data := "{\n \"code\": \"200000\",\n \"data\": \"0.1\"\n}" commonResp := &types.RestResponse{} err := json.Unmarshal([]byte(data), commonResp) assert.Nil(t, err) assert.NotNil(t, commonResp.Data) - resp := &GetMaxOpenSizeResp{} + resp := &RemoveIsolatedMarginResp{} err = json.Unmarshal([]byte(commonResp.Data), resp) resp.ToMap() assert.Nil(t, err) } -func TestPositionsSwitchMarginModeReqModel(t *testing.T) { - // SwitchMarginMode - // Switch Margin Mode - // /api/v2/position/changeMarginMode +func TestPositionsGetIsolatedMarginRiskLimitReqModel(t *testing.T) { + // GetIsolatedMarginRiskLimit + // Get Isolated Margin Risk Limit + // /api/v1/contracts/risk-limit/{symbol} - data := "{\"symbol\": \"XBTUSDTM\", \"marginMode\": \"ISOLATED\"}" - req := &SwitchMarginModeReq{} + data := "{\"symbol\": \"XBTUSDTM\"}" + req := &GetIsolatedMarginRiskLimitReq{} err := json.Unmarshal([]byte(data), req) req.ToMap() assert.Nil(t, err) } -func TestPositionsSwitchMarginModeRespModel(t *testing.T) { - // SwitchMarginMode - // Switch Margin Mode - // /api/v2/position/changeMarginMode +func TestPositionsGetIsolatedMarginRiskLimitRespModel(t *testing.T) { + // GetIsolatedMarginRiskLimit + // Get Isolated Margin Risk Limit + // /api/v1/contracts/risk-limit/{symbol} - data := "{\n \"code\": \"200000\",\n \"data\": {\n \"symbol\": \"XBTUSDTM\",\n \"marginMode\": \"ISOLATED\"\n }\n}" + data := "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"symbol\": \"XBTUSDTM\",\n \"level\": 1,\n \"maxRiskLimit\": 100000,\n \"minRiskLimit\": 0,\n \"maxLeverage\": 125,\n \"initialMargin\": 0.008,\n \"maintainMargin\": 0.004\n },\n {\n \"symbol\": \"XBTUSDTM\",\n \"level\": 2,\n \"maxRiskLimit\": 500000,\n \"minRiskLimit\": 100000,\n \"maxLeverage\": 100,\n \"initialMargin\": 0.01,\n \"maintainMargin\": 0.005\n },\n {\n \"symbol\": \"XBTUSDTM\",\n \"level\": 3,\n \"maxRiskLimit\": 1000000,\n \"minRiskLimit\": 500000,\n \"maxLeverage\": 75,\n \"initialMargin\": 0.014,\n \"maintainMargin\": 0.007\n },\n {\n \"symbol\": \"XBTUSDTM\",\n \"level\": 4,\n \"maxRiskLimit\": 2000000,\n \"minRiskLimit\": 1000000,\n \"maxLeverage\": 50,\n \"initialMargin\": 0.02,\n \"maintainMargin\": 0.01\n },\n {\n \"symbol\": \"XBTUSDTM\",\n \"level\": 5,\n \"maxRiskLimit\": 3000000,\n \"minRiskLimit\": 2000000,\n \"maxLeverage\": 30,\n \"initialMargin\": 0.034,\n \"maintainMargin\": 0.017\n },\n {\n \"symbol\": \"XBTUSDTM\",\n \"level\": 6,\n \"maxRiskLimit\": 5000000,\n \"minRiskLimit\": 3000000,\n \"maxLeverage\": 20,\n \"initialMargin\": 0.05,\n \"maintainMargin\": 0.025\n },\n {\n \"symbol\": \"XBTUSDTM\",\n \"level\": 7,\n \"maxRiskLimit\": 8000000,\n \"minRiskLimit\": 5000000,\n \"maxLeverage\": 10,\n \"initialMargin\": 0.1,\n \"maintainMargin\": 0.05\n },\n {\n \"symbol\": \"XBTUSDTM\",\n \"level\": 8,\n \"maxRiskLimit\": 12000000,\n \"minRiskLimit\": 8000000,\n \"maxLeverage\": 5,\n \"initialMargin\": 0.2,\n \"maintainMargin\": 0.1\n },\n {\n \"symbol\": \"XBTUSDTM\",\n \"level\": 9,\n \"maxRiskLimit\": 20000000,\n \"minRiskLimit\": 12000000,\n \"maxLeverage\": 4,\n \"initialMargin\": 0.25,\n \"maintainMargin\": 0.125\n },\n {\n \"symbol\": \"XBTUSDTM\",\n \"level\": 10,\n \"maxRiskLimit\": 30000000,\n \"minRiskLimit\": 20000000,\n \"maxLeverage\": 3,\n \"initialMargin\": 0.334,\n \"maintainMargin\": 0.167\n },\n {\n \"symbol\": \"XBTUSDTM\",\n \"level\": 11,\n \"maxRiskLimit\": 40000000,\n \"minRiskLimit\": 30000000,\n \"maxLeverage\": 2,\n \"initialMargin\": 0.5,\n \"maintainMargin\": 0.25\n },\n {\n \"symbol\": \"XBTUSDTM\",\n \"level\": 12,\n \"maxRiskLimit\": 50000000,\n \"minRiskLimit\": 40000000,\n \"maxLeverage\": 1,\n \"initialMargin\": 1.0,\n \"maintainMargin\": 0.5\n }\n ]\n}" commonResp := &types.RestResponse{} err := json.Unmarshal([]byte(data), commonResp) assert.Nil(t, err) assert.NotNil(t, commonResp.Data) - resp := &SwitchMarginModeResp{} + resp := &GetIsolatedMarginRiskLimitResp{} err = json.Unmarshal([]byte(commonResp.Data), resp) resp.ToMap() assert.Nil(t, err) } -func TestPositionsGetMarginModeReqModel(t *testing.T) { - // GetMarginMode - // Get Margin Mode - // /api/v2/position/getMarginMode +func TestPositionsModifyIsolatedMarginRiskLimtReqModel(t *testing.T) { + // ModifyIsolatedMarginRiskLimt + // Modify Isolated Margin Risk Limit + // /api/v1/position/risk-limit-level/change - data := "{\"symbol\": \"XBTUSDTM\"}" - req := &GetMarginModeReq{} + data := "{\"symbol\": \"XBTUSDTM\", \"level\": 2}" + req := &ModifyIsolatedMarginRiskLimtReq{} err := json.Unmarshal([]byte(data), req) req.ToMap() assert.Nil(t, err) } -func TestPositionsGetMarginModeRespModel(t *testing.T) { - // GetMarginMode - // Get Margin Mode - // /api/v2/position/getMarginMode +func TestPositionsModifyIsolatedMarginRiskLimtRespModel(t *testing.T) { + // ModifyIsolatedMarginRiskLimt + // Modify Isolated Margin Risk Limit + // /api/v1/position/risk-limit-level/change - data := "{\n \"code\": \"200000\",\n \"data\": {\n \"symbol\": \"XBTUSDTM\",\n \"marginMode\": \"ISOLATED\"\n }\n}" + data := "{\n \"code\": \"200000\",\n \"data\": true\n}" commonResp := &types.RestResponse{} err := json.Unmarshal([]byte(data), commonResp) assert.Nil(t, err) assert.NotNil(t, commonResp.Data) - resp := &GetMarginModeResp{} + resp := &ModifyIsolatedMarginRiskLimtResp{} + err = json.Unmarshal([]byte(commonResp.Data), resp) + resp.ToMap() + assert.Nil(t, err) +} + +func TestPositionsModifyAutoDepositStatusReqModel(t *testing.T) { + // ModifyAutoDepositStatus + // Modify Isolated Margin Auto-Deposit Status + // /api/v1/position/margin/auto-deposit-status + + data := "{\"symbol\": \"XBTUSDTM\", \"status\": true}" + req := &ModifyAutoDepositStatusReq{} + err := json.Unmarshal([]byte(data), req) + req.ToMap() + assert.Nil(t, err) +} + +func TestPositionsModifyAutoDepositStatusRespModel(t *testing.T) { + // ModifyAutoDepositStatus + // Modify Isolated Margin Auto-Deposit Status + // /api/v1/position/margin/auto-deposit-status + + data := "{\n \"code\": \"200000\",\n \"data\": true\n}" + commonResp := &types.RestResponse{} + err := json.Unmarshal([]byte(data), commonResp) + assert.Nil(t, err) + assert.NotNil(t, commonResp.Data) + resp := &ModifyAutoDepositStatusResp{} err = json.Unmarshal([]byte(commonResp.Data), resp) resp.ToMap() assert.Nil(t, err) diff --git a/sdk/golang/pkg/generate/margin/credit/api_credit.go b/sdk/golang/pkg/generate/margin/credit/api_credit.go index b3192b1a..3ba78c7f 100644 --- a/sdk/golang/pkg/generate/margin/credit/api_credit.go +++ b/sdk/golang/pkg/generate/margin/credit/api_credit.go @@ -9,20 +9,6 @@ import ( type CreditAPI interface { - // ModifyPurchase Modify Purchase - // Description: This API endpoint is used to update the interest rates of subscription orders, which will take effect at the beginning of the next hour.,Please ensure that the funds are in the main(funding) account - // Documentation: https://www.kucoin.com/docs-new/api-3470217 - // +---------------------+---------+ - // | Extra API Info | Value | - // +---------------------+---------+ - // | API-DOMAIN | SPOT | - // | API-CHANNEL | PRIVATE | - // | API-PERMISSION | MARGIN | - // | API-RATE-LIMIT-POOL | SPOT | - // | API-RATE-LIMIT | 10 | - // +---------------------+---------+ - ModifyPurchase(req *ModifyPurchaseReq, ctx context.Context) (*ModifyPurchaseResp, error) - // GetLoanMarket Get Loan Market // Description: This API endpoint is used to get the information about the currencies available for lending. // Documentation: https://www.kucoin.com/docs-new/api-3470212 @@ -51,23 +37,23 @@ type CreditAPI interface { // +---------------------+--------+ GetLoanMarketInterestRate(req *GetLoanMarketInterestRateReq, ctx context.Context) (*GetLoanMarketInterestRateResp, error) - // GetPurchaseOrders Get Purchase Orders - // Description: This API endpoint provides pagination query for the purchase orders. - // Documentation: https://www.kucoin.com/docs-new/api-3470213 + // Purchase Purchase + // Description: Invest credit in the market and earn interest + // Documentation: https://www.kucoin.com/docs-new/api-3470216 // +---------------------+---------+ // | Extra API Info | Value | // +---------------------+---------+ // | API-DOMAIN | SPOT | // | API-CHANNEL | PRIVATE | - // | API-PERMISSION | GENERAL | + // | API-PERMISSION | MARGIN | // | API-RATE-LIMIT-POOL | SPOT | - // | API-RATE-LIMIT | 10 | + // | API-RATE-LIMIT | 15 | // +---------------------+---------+ - GetPurchaseOrders(req *GetPurchaseOrdersReq, ctx context.Context) (*GetPurchaseOrdersResp, error) + Purchase(req *PurchaseReq, ctx context.Context) (*PurchaseResp, error) - // Purchase Purchase - // Description: Invest credit in the market and earn interest - // Documentation: https://www.kucoin.com/docs-new/api-3470216 + // ModifyPurchase Modify Purchase + // Description: This API endpoint is used to update the interest rates of subscription orders, which will take effect at the beginning of the next hour.,Please ensure that the funds are in the main(funding) account + // Documentation: https://www.kucoin.com/docs-new/api-3470217 // +---------------------+---------+ // | Extra API Info | Value | // +---------------------+---------+ @@ -75,13 +61,13 @@ type CreditAPI interface { // | API-CHANNEL | PRIVATE | // | API-PERMISSION | MARGIN | // | API-RATE-LIMIT-POOL | SPOT | - // | API-RATE-LIMIT | 15 | + // | API-RATE-LIMIT | 10 | // +---------------------+---------+ - Purchase(req *PurchaseReq, ctx context.Context) (*PurchaseResp, error) + ModifyPurchase(req *ModifyPurchaseReq, ctx context.Context) (*ModifyPurchaseResp, error) - // GetRedeemOrders Get Redeem Orders - // Description: This API endpoint provides pagination query for the redeem orders. - // Documentation: https://www.kucoin.com/docs-new/api-3470214 + // GetPurchaseOrders Get Purchase Orders + // Description: This API endpoint provides pagination query for the purchase orders. + // Documentation: https://www.kucoin.com/docs-new/api-3470213 // +---------------------+---------+ // | Extra API Info | Value | // +---------------------+---------+ @@ -91,7 +77,7 @@ type CreditAPI interface { // | API-RATE-LIMIT-POOL | SPOT | // | API-RATE-LIMIT | 10 | // +---------------------+---------+ - GetRedeemOrders(req *GetRedeemOrdersReq, ctx context.Context) (*GetRedeemOrdersResp, error) + GetPurchaseOrders(req *GetPurchaseOrdersReq, ctx context.Context) (*GetPurchaseOrdersResp, error) // Redeem Redeem // Description: Redeem your loan order @@ -106,6 +92,20 @@ type CreditAPI interface { // | API-RATE-LIMIT | 15 | // +---------------------+---------+ Redeem(req *RedeemReq, ctx context.Context) (*RedeemResp, error) + + // GetRedeemOrders Get Redeem Orders + // Description: This API endpoint provides pagination query for the redeem orders. + // Documentation: https://www.kucoin.com/docs-new/api-3470214 + // +---------------------+---------+ + // | Extra API Info | Value | + // +---------------------+---------+ + // | API-DOMAIN | SPOT | + // | API-CHANNEL | PRIVATE | + // | API-PERMISSION | GENERAL | + // | API-RATE-LIMIT-POOL | SPOT | + // | API-RATE-LIMIT | 10 | + // +---------------------+---------+ + GetRedeemOrders(req *GetRedeemOrdersReq, ctx context.Context) (*GetRedeemOrdersResp, error) } type CreditAPIImpl struct { @@ -116,12 +116,6 @@ func NewCreditAPIImp(transport interfaces.Transport) *CreditAPIImpl { return &CreditAPIImpl{transport: transport} } -func (impl *CreditAPIImpl) ModifyPurchase(req *ModifyPurchaseReq, ctx context.Context) (*ModifyPurchaseResp, error) { - resp := &ModifyPurchaseResp{} - err := impl.transport.Call(ctx, "spot", false, "Post", "/api/v3/lend/purchase/update", req, resp, false) - return resp, err -} - func (impl *CreditAPIImpl) GetLoanMarket(req *GetLoanMarketReq, ctx context.Context) (*GetLoanMarketResp, error) { resp := &GetLoanMarketResp{} err := impl.transport.Call(ctx, "spot", false, "Get", "/api/v3/project/list", req, resp, false) @@ -134,21 +128,21 @@ func (impl *CreditAPIImpl) GetLoanMarketInterestRate(req *GetLoanMarketInterestR return resp, err } -func (impl *CreditAPIImpl) GetPurchaseOrders(req *GetPurchaseOrdersReq, ctx context.Context) (*GetPurchaseOrdersResp, error) { - resp := &GetPurchaseOrdersResp{} - err := impl.transport.Call(ctx, "spot", false, "Get", "/api/v3/purchase/orders", req, resp, false) - return resp, err -} - func (impl *CreditAPIImpl) Purchase(req *PurchaseReq, ctx context.Context) (*PurchaseResp, error) { resp := &PurchaseResp{} err := impl.transport.Call(ctx, "spot", false, "Post", "/api/v3/purchase", req, resp, false) return resp, err } -func (impl *CreditAPIImpl) GetRedeemOrders(req *GetRedeemOrdersReq, ctx context.Context) (*GetRedeemOrdersResp, error) { - resp := &GetRedeemOrdersResp{} - err := impl.transport.Call(ctx, "spot", false, "Get", "/api/v3/redeem/orders", req, resp, false) +func (impl *CreditAPIImpl) ModifyPurchase(req *ModifyPurchaseReq, ctx context.Context) (*ModifyPurchaseResp, error) { + resp := &ModifyPurchaseResp{} + err := impl.transport.Call(ctx, "spot", false, "Post", "/api/v3/lend/purchase/update", req, resp, false) + return resp, err +} + +func (impl *CreditAPIImpl) GetPurchaseOrders(req *GetPurchaseOrdersReq, ctx context.Context) (*GetPurchaseOrdersResp, error) { + resp := &GetPurchaseOrdersResp{} + err := impl.transport.Call(ctx, "spot", false, "Get", "/api/v3/purchase/orders", req, resp, false) return resp, err } @@ -157,3 +151,9 @@ func (impl *CreditAPIImpl) Redeem(req *RedeemReq, ctx context.Context) (*RedeemR err := impl.transport.Call(ctx, "spot", false, "Post", "/api/v3/redeem", req, resp, false) return resp, err } + +func (impl *CreditAPIImpl) GetRedeemOrders(req *GetRedeemOrdersReq, ctx context.Context) (*GetRedeemOrdersResp, error) { + resp := &GetRedeemOrdersResp{} + err := impl.transport.Call(ctx, "spot", false, "Get", "/api/v3/redeem/orders", req, resp, false) + return resp, err +} diff --git a/sdk/golang/pkg/generate/margin/credit/api_credit.template b/sdk/golang/pkg/generate/margin/credit/api_credit.template index 1f159e60..361309dc 100644 --- a/sdk/golang/pkg/generate/margin/credit/api_credit.template +++ b/sdk/golang/pkg/generate/margin/credit/api_credit.template @@ -1,29 +1,6 @@ # API FUNCTION TEMPLATE -func TestCreditModifyPurchaseReq(t *testing.T) { - // ModifyPurchase - // Modify Purchase - // /api/v3/lend/purchase/update - - builder := credit.NewModifyPurchaseReqBuilder() - builder.SetCurrency(?).SetInterestRate(?).SetPurchaseOrderNo(?) - req := builder.Build() - - resp, err := creditApi.ModifyPurchase(req, context.TODO()) - if err != nil { - panic(err) - } - data, err := json.Marshal(resp.ToMap()) - if err != nil { - panic(err) - } - fmt.Println("code:", resp.CommonResponse.Code) - fmt.Println("message:", resp.CommonResponse.Message) - fmt.Println("data:", string(data)) -} - - func TestCreditGetLoanMarketReq(t *testing.T) { // GetLoanMarket // Get Loan Market @@ -70,16 +47,16 @@ func TestCreditGetLoanMarketInterestRateReq(t *testing.T) { } -func TestCreditGetPurchaseOrdersReq(t *testing.T) { - // GetPurchaseOrders - // Get Purchase Orders - // /api/v3/purchase/orders +func TestCreditPurchaseReq(t *testing.T) { + // Purchase + // Purchase + // /api/v3/purchase - builder := credit.NewGetPurchaseOrdersReqBuilder() - builder.SetCurrency(?).SetStatus(?).SetPurchaseOrderNo(?).SetCurrentPage(?).SetPageSize(?) + builder := credit.NewPurchaseReqBuilder() + builder.SetCurrency(?).SetSize(?).SetInterestRate(?) req := builder.Build() - resp, err := creditApi.GetPurchaseOrders(req, context.TODO()) + resp, err := creditApi.Purchase(req, context.TODO()) if err != nil { panic(err) } @@ -93,16 +70,16 @@ func TestCreditGetPurchaseOrdersReq(t *testing.T) { } -func TestCreditPurchaseReq(t *testing.T) { - // Purchase - // Purchase - // /api/v3/purchase +func TestCreditModifyPurchaseReq(t *testing.T) { + // ModifyPurchase + // Modify Purchase + // /api/v3/lend/purchase/update - builder := credit.NewPurchaseReqBuilder() - builder.SetCurrency(?).SetSize(?).SetInterestRate(?) + builder := credit.NewModifyPurchaseReqBuilder() + builder.SetCurrency(?).SetInterestRate(?).SetPurchaseOrderNo(?) req := builder.Build() - resp, err := creditApi.Purchase(req, context.TODO()) + resp, err := creditApi.ModifyPurchase(req, context.TODO()) if err != nil { panic(err) } @@ -116,16 +93,16 @@ func TestCreditPurchaseReq(t *testing.T) { } -func TestCreditGetRedeemOrdersReq(t *testing.T) { - // GetRedeemOrders - // Get Redeem Orders - // /api/v3/redeem/orders +func TestCreditGetPurchaseOrdersReq(t *testing.T) { + // GetPurchaseOrders + // Get Purchase Orders + // /api/v3/purchase/orders - builder := credit.NewGetRedeemOrdersReqBuilder() - builder.SetCurrency(?).SetStatus(?).SetRedeemOrderNo(?).SetCurrentPage(?).SetPageSize(?) + builder := credit.NewGetPurchaseOrdersReqBuilder() + builder.SetCurrency(?).SetStatus(?).SetPurchaseOrderNo(?).SetCurrentPage(?).SetPageSize(?) req := builder.Build() - resp, err := creditApi.GetRedeemOrders(req, context.TODO()) + resp, err := creditApi.GetPurchaseOrders(req, context.TODO()) if err != nil { panic(err) } @@ -161,3 +138,26 @@ func TestCreditRedeemReq(t *testing.T) { fmt.Println("data:", string(data)) } + +func TestCreditGetRedeemOrdersReq(t *testing.T) { + // GetRedeemOrders + // Get Redeem Orders + // /api/v3/redeem/orders + + builder := credit.NewGetRedeemOrdersReqBuilder() + builder.SetCurrency(?).SetStatus(?).SetRedeemOrderNo(?).SetCurrentPage(?).SetPageSize(?) + req := builder.Build() + + resp, err := creditApi.GetRedeemOrders(req, context.TODO()) + if err != nil { + panic(err) + } + data, err := json.Marshal(resp.ToMap()) + if err != nil { + panic(err) + } + fmt.Println("code:", resp.CommonResponse.Code) + fmt.Println("message:", resp.CommonResponse.Message) + fmt.Println("data:", string(data)) +} + diff --git a/sdk/golang/pkg/generate/margin/credit/api_credit_test.go b/sdk/golang/pkg/generate/margin/credit/api_credit_test.go index c6edb7bb..1ee2794a 100644 --- a/sdk/golang/pkg/generate/margin/credit/api_credit_test.go +++ b/sdk/golang/pkg/generate/margin/credit/api_credit_test.go @@ -7,34 +7,6 @@ import ( "testing" ) -func TestCreditModifyPurchaseReqModel(t *testing.T) { - // ModifyPurchase - // Modify Purchase - // /api/v3/lend/purchase/update - - data := "{\"currency\": \"BTC\", \"purchaseOrderNo\": \"671bafa804c26d000773c533\", \"interestRate\": \"0.09\"}" - req := &ModifyPurchaseReq{} - err := json.Unmarshal([]byte(data), req) - req.ToMap() - assert.Nil(t, err) -} - -func TestCreditModifyPurchaseRespModel(t *testing.T) { - // ModifyPurchase - // Modify Purchase - // /api/v3/lend/purchase/update - - data := "{\n \"code\": \"200000\",\n \"data\": null\n}" - commonResp := &types.RestResponse{} - err := json.Unmarshal([]byte(data), commonResp) - assert.Nil(t, err) - assert.NotNil(t, commonResp.Data) - resp := &ModifyPurchaseResp{} - err = json.Unmarshal([]byte(commonResp.Data), resp) - resp.ToMap() - assert.Nil(t, err) -} - func TestCreditGetLoanMarketReqModel(t *testing.T) { // GetLoanMarket // Get Loan Market @@ -91,85 +63,85 @@ func TestCreditGetLoanMarketInterestRateRespModel(t *testing.T) { assert.Nil(t, err) } -func TestCreditGetPurchaseOrdersReqModel(t *testing.T) { - // GetPurchaseOrders - // Get Purchase Orders - // /api/v3/purchase/orders +func TestCreditPurchaseReqModel(t *testing.T) { + // Purchase + // Purchase + // /api/v3/purchase - data := "{\"currency\": \"BTC\", \"status\": \"DONE\", \"purchaseOrderNo\": \"example_string_default_value\", \"currentPage\": 1, \"pageSize\": 50}" - req := &GetPurchaseOrdersReq{} + data := "{\"currency\": \"BTC\", \"size\": \"0.001\", \"interestRate\": \"0.1\"}" + req := &PurchaseReq{} err := json.Unmarshal([]byte(data), req) req.ToMap() assert.Nil(t, err) } -func TestCreditGetPurchaseOrdersRespModel(t *testing.T) { - // GetPurchaseOrders - // Get Purchase Orders - // /api/v3/purchase/orders +func TestCreditPurchaseRespModel(t *testing.T) { + // Purchase + // Purchase + // /api/v3/purchase - data := "{\n \"code\": \"200000\",\n \"data\": {\n \"currentPage\": 1,\n \"pageSize\": 10,\n \"totalNum\": 1,\n \"totalPage\": 1,\n \"items\": [\n {\n \"currency\": \"BTC\",\n \"purchaseOrderNo\": \"671bb15a3b3f930007880bae\",\n \"purchaseSize\": \"0.001\",\n \"matchSize\": \"0\",\n \"interestRate\": \"0.1\",\n \"incomeSize\": \"0\",\n \"applyTime\": 1729868122172,\n \"status\": \"PENDING\"\n }\n ]\n }\n}" + data := "{\n \"code\": \"200000\",\n \"data\": {\n \"orderNo\": \"671bafa804c26d000773c533\"\n }\n}" commonResp := &types.RestResponse{} err := json.Unmarshal([]byte(data), commonResp) assert.Nil(t, err) assert.NotNil(t, commonResp.Data) - resp := &GetPurchaseOrdersResp{} + resp := &PurchaseResp{} err = json.Unmarshal([]byte(commonResp.Data), resp) resp.ToMap() assert.Nil(t, err) } -func TestCreditPurchaseReqModel(t *testing.T) { - // Purchase - // Purchase - // /api/v3/purchase +func TestCreditModifyPurchaseReqModel(t *testing.T) { + // ModifyPurchase + // Modify Purchase + // /api/v3/lend/purchase/update - data := "{\"currency\": \"BTC\", \"size\": \"0.001\", \"interestRate\": \"0.1\"}" - req := &PurchaseReq{} + data := "{\"currency\": \"BTC\", \"purchaseOrderNo\": \"671bafa804c26d000773c533\", \"interestRate\": \"0.09\"}" + req := &ModifyPurchaseReq{} err := json.Unmarshal([]byte(data), req) req.ToMap() assert.Nil(t, err) } -func TestCreditPurchaseRespModel(t *testing.T) { - // Purchase - // Purchase - // /api/v3/purchase +func TestCreditModifyPurchaseRespModel(t *testing.T) { + // ModifyPurchase + // Modify Purchase + // /api/v3/lend/purchase/update - data := "{\n \"code\": \"200000\",\n \"data\": {\n \"orderNo\": \"671bafa804c26d000773c533\"\n }\n}" + data := "{\n \"code\": \"200000\",\n \"data\": null\n}" commonResp := &types.RestResponse{} err := json.Unmarshal([]byte(data), commonResp) assert.Nil(t, err) assert.NotNil(t, commonResp.Data) - resp := &PurchaseResp{} + resp := &ModifyPurchaseResp{} err = json.Unmarshal([]byte(commonResp.Data), resp) resp.ToMap() assert.Nil(t, err) } -func TestCreditGetRedeemOrdersReqModel(t *testing.T) { - // GetRedeemOrders - // Get Redeem Orders - // /api/v3/redeem/orders +func TestCreditGetPurchaseOrdersReqModel(t *testing.T) { + // GetPurchaseOrders + // Get Purchase Orders + // /api/v3/purchase/orders - data := "{\"currency\": \"BTC\", \"status\": \"DONE\", \"redeemOrderNo\": \"example_string_default_value\", \"currentPage\": 1, \"pageSize\": 50}" - req := &GetRedeemOrdersReq{} + data := "{\"currency\": \"BTC\", \"status\": \"DONE\", \"purchaseOrderNo\": \"example_string_default_value\", \"currentPage\": 1, \"pageSize\": 50}" + req := &GetPurchaseOrdersReq{} err := json.Unmarshal([]byte(data), req) req.ToMap() assert.Nil(t, err) } -func TestCreditGetRedeemOrdersRespModel(t *testing.T) { - // GetRedeemOrders - // Get Redeem Orders - // /api/v3/redeem/orders +func TestCreditGetPurchaseOrdersRespModel(t *testing.T) { + // GetPurchaseOrders + // Get Purchase Orders + // /api/v3/purchase/orders - data := "{\n \"code\": \"200000\",\n \"data\": {\n \"currentPage\": 1,\n \"pageSize\": 10,\n \"totalNum\": 1,\n \"totalPage\": 1,\n \"items\": [\n {\n \"currency\": \"BTC\",\n \"purchaseOrderNo\": \"671bafa804c26d000773c533\",\n \"redeemOrderNo\": \"671bb01004c26d000773c55c\",\n \"redeemSize\": \"0.001\",\n \"receiptSize\": \"0.001\",\n \"applyTime\": null,\n \"status\": \"DONE\"\n }\n ]\n }\n}" + data := "{\n \"code\": \"200000\",\n \"data\": {\n \"currentPage\": 1,\n \"pageSize\": 10,\n \"totalNum\": 1,\n \"totalPage\": 1,\n \"items\": [\n {\n \"currency\": \"BTC\",\n \"purchaseOrderNo\": \"671bb15a3b3f930007880bae\",\n \"purchaseSize\": \"0.001\",\n \"matchSize\": \"0\",\n \"interestRate\": \"0.1\",\n \"incomeSize\": \"0\",\n \"applyTime\": 1729868122172,\n \"status\": \"PENDING\"\n }\n ]\n }\n}" commonResp := &types.RestResponse{} err := json.Unmarshal([]byte(data), commonResp) assert.Nil(t, err) assert.NotNil(t, commonResp.Data) - resp := &GetRedeemOrdersResp{} + resp := &GetPurchaseOrdersResp{} err = json.Unmarshal([]byte(commonResp.Data), resp) resp.ToMap() assert.Nil(t, err) @@ -202,3 +174,31 @@ func TestCreditRedeemRespModel(t *testing.T) { resp.ToMap() assert.Nil(t, err) } + +func TestCreditGetRedeemOrdersReqModel(t *testing.T) { + // GetRedeemOrders + // Get Redeem Orders + // /api/v3/redeem/orders + + data := "{\"currency\": \"BTC\", \"status\": \"DONE\", \"redeemOrderNo\": \"example_string_default_value\", \"currentPage\": 1, \"pageSize\": 50}" + req := &GetRedeemOrdersReq{} + err := json.Unmarshal([]byte(data), req) + req.ToMap() + assert.Nil(t, err) +} + +func TestCreditGetRedeemOrdersRespModel(t *testing.T) { + // GetRedeemOrders + // Get Redeem Orders + // /api/v3/redeem/orders + + data := "{\n \"code\": \"200000\",\n \"data\": {\n \"currentPage\": 1,\n \"pageSize\": 10,\n \"totalNum\": 1,\n \"totalPage\": 1,\n \"items\": [\n {\n \"currency\": \"BTC\",\n \"purchaseOrderNo\": \"671bafa804c26d000773c533\",\n \"redeemOrderNo\": \"671bb01004c26d000773c55c\",\n \"redeemSize\": \"0.001\",\n \"receiptSize\": \"0.001\",\n \"applyTime\": null,\n \"status\": \"DONE\"\n }\n ]\n }\n}" + commonResp := &types.RestResponse{} + err := json.Unmarshal([]byte(data), commonResp) + assert.Nil(t, err) + assert.NotNil(t, commonResp.Data) + resp := &GetRedeemOrdersResp{} + err = json.Unmarshal([]byte(commonResp.Data), resp) + resp.ToMap() + assert.Nil(t, err) +} diff --git a/sdk/golang/pkg/generate/margin/debit/api_debit.go b/sdk/golang/pkg/generate/margin/debit/api_debit.go index e2ea02ac..08378908 100644 --- a/sdk/golang/pkg/generate/margin/debit/api_debit.go +++ b/sdk/golang/pkg/generate/margin/debit/api_debit.go @@ -9,9 +9,9 @@ import ( type DebitAPI interface { - // GetBorrowHistory Get Borrow History - // Description: This API endpoint is used to get the borrowing orders for cross and isolated margin accounts - // Documentation: https://www.kucoin.com/docs-new/api-3470207 + // Borrow Borrow + // Description: This API endpoint is used to initiate an application for cross or isolated margin borrowing. + // Documentation: https://www.kucoin.com/docs-new/api-3470206 // +---------------------+---------+ // | Extra API Info | Value | // +---------------------+---------+ @@ -21,11 +21,11 @@ type DebitAPI interface { // | API-RATE-LIMIT-POOL | SPOT | // | API-RATE-LIMIT | 15 | // +---------------------+---------+ - GetBorrowHistory(req *GetBorrowHistoryReq, ctx context.Context) (*GetBorrowHistoryResp, error) + Borrow(req *BorrowReq, ctx context.Context) (*BorrowResp, error) - // Borrow Borrow - // Description: This API endpoint is used to initiate an application for cross or isolated margin borrowing. - // Documentation: https://www.kucoin.com/docs-new/api-3470206 + // GetBorrowHistory Get Borrow History + // Description: This API endpoint is used to get the borrowing orders for cross and isolated margin accounts + // Documentation: https://www.kucoin.com/docs-new/api-3470207 // +---------------------+---------+ // | Extra API Info | Value | // +---------------------+---------+ @@ -35,11 +35,11 @@ type DebitAPI interface { // | API-RATE-LIMIT-POOL | SPOT | // | API-RATE-LIMIT | 15 | // +---------------------+---------+ - Borrow(req *BorrowReq, ctx context.Context) (*BorrowResp, error) + GetBorrowHistory(req *GetBorrowHistoryReq, ctx context.Context) (*GetBorrowHistoryResp, error) - // GetInterestHistory Get Interest History - // Description: Request via this endpoint to get the interest records of the cross/isolated margin lending. - // Documentation: https://www.kucoin.com/docs-new/api-3470209 + // Repay Repay + // Description: This API endpoint is used to initiate an application for cross or isolated margin repayment. + // Documentation: https://www.kucoin.com/docs-new/api-3470210 // +---------------------+---------+ // | Extra API Info | Value | // +---------------------+---------+ @@ -47,9 +47,9 @@ type DebitAPI interface { // | API-CHANNEL | PRIVATE | // | API-PERMISSION | MARGIN | // | API-RATE-LIMIT-POOL | SPOT | - // | API-RATE-LIMIT | 20 | + // | API-RATE-LIMIT | 10 | // +---------------------+---------+ - GetInterestHistory(req *GetInterestHistoryReq, ctx context.Context) (*GetInterestHistoryResp, error) + Repay(req *RepayReq, ctx context.Context) (*RepayResp, error) // GetRepayHistory Get Repay History // Description: This API endpoint is used to get the borrowing orders for cross and isolated margin accounts @@ -65,9 +65,9 @@ type DebitAPI interface { // +---------------------+---------+ GetRepayHistory(req *GetRepayHistoryReq, ctx context.Context) (*GetRepayHistoryResp, error) - // Repay Repay - // Description: This API endpoint is used to initiate an application for cross or isolated margin repayment. - // Documentation: https://www.kucoin.com/docs-new/api-3470210 + // GetInterestHistory Get Interest History + // Description: Request via this endpoint to get the interest records of the cross/isolated margin lending. + // Documentation: https://www.kucoin.com/docs-new/api-3470209 // +---------------------+---------+ // | Extra API Info | Value | // +---------------------+---------+ @@ -75,9 +75,9 @@ type DebitAPI interface { // | API-CHANNEL | PRIVATE | // | API-PERMISSION | MARGIN | // | API-RATE-LIMIT-POOL | SPOT | - // | API-RATE-LIMIT | 10 | + // | API-RATE-LIMIT | 20 | // +---------------------+---------+ - Repay(req *RepayReq, ctx context.Context) (*RepayResp, error) + GetInterestHistory(req *GetInterestHistoryReq, ctx context.Context) (*GetInterestHistoryResp, error) // ModifyLeverage Modify Leverage // Description: This endpoint allows modifying the leverage multiplier for cross margin or isolated margin. @@ -102,21 +102,21 @@ func NewDebitAPIImp(transport interfaces.Transport) *DebitAPIImpl { return &DebitAPIImpl{transport: transport} } -func (impl *DebitAPIImpl) GetBorrowHistory(req *GetBorrowHistoryReq, ctx context.Context) (*GetBorrowHistoryResp, error) { - resp := &GetBorrowHistoryResp{} - err := impl.transport.Call(ctx, "spot", false, "Get", "/api/v3/margin/borrow", req, resp, false) - return resp, err -} - func (impl *DebitAPIImpl) Borrow(req *BorrowReq, ctx context.Context) (*BorrowResp, error) { resp := &BorrowResp{} err := impl.transport.Call(ctx, "spot", false, "Post", "/api/v3/margin/borrow", req, resp, false) return resp, err } -func (impl *DebitAPIImpl) GetInterestHistory(req *GetInterestHistoryReq, ctx context.Context) (*GetInterestHistoryResp, error) { - resp := &GetInterestHistoryResp{} - err := impl.transport.Call(ctx, "spot", false, "Get", "/api/v3/margin/interest", req, resp, false) +func (impl *DebitAPIImpl) GetBorrowHistory(req *GetBorrowHistoryReq, ctx context.Context) (*GetBorrowHistoryResp, error) { + resp := &GetBorrowHistoryResp{} + err := impl.transport.Call(ctx, "spot", false, "Get", "/api/v3/margin/borrow", req, resp, false) + return resp, err +} + +func (impl *DebitAPIImpl) Repay(req *RepayReq, ctx context.Context) (*RepayResp, error) { + resp := &RepayResp{} + err := impl.transport.Call(ctx, "spot", false, "Post", "/api/v3/margin/repay", req, resp, false) return resp, err } @@ -126,9 +126,9 @@ func (impl *DebitAPIImpl) GetRepayHistory(req *GetRepayHistoryReq, ctx context.C return resp, err } -func (impl *DebitAPIImpl) Repay(req *RepayReq, ctx context.Context) (*RepayResp, error) { - resp := &RepayResp{} - err := impl.transport.Call(ctx, "spot", false, "Post", "/api/v3/margin/repay", req, resp, false) +func (impl *DebitAPIImpl) GetInterestHistory(req *GetInterestHistoryReq, ctx context.Context) (*GetInterestHistoryResp, error) { + resp := &GetInterestHistoryResp{} + err := impl.transport.Call(ctx, "spot", false, "Get", "/api/v3/margin/interest", req, resp, false) return resp, err } diff --git a/sdk/golang/pkg/generate/margin/debit/api_debit.template b/sdk/golang/pkg/generate/margin/debit/api_debit.template index 035b5346..b0a83fe0 100644 --- a/sdk/golang/pkg/generate/margin/debit/api_debit.template +++ b/sdk/golang/pkg/generate/margin/debit/api_debit.template @@ -1,16 +1,16 @@ # API FUNCTION TEMPLATE -func TestDebitGetBorrowHistoryReq(t *testing.T) { - // GetBorrowHistory - // Get Borrow History +func TestDebitBorrowReq(t *testing.T) { + // Borrow + // Borrow // /api/v3/margin/borrow - builder := debit.NewGetBorrowHistoryReqBuilder() - builder.SetCurrency(?).SetIsIsolated(?).SetSymbol(?).SetOrderNo(?).SetStartTime(?).SetEndTime(?).SetCurrentPage(?).SetPageSize(?) + builder := debit.NewBorrowReqBuilder() + builder.SetCurrency(?).SetSize(?).SetTimeInForce(?).SetSymbol(?).SetIsIsolated(?).SetIsHf(?) req := builder.Build() - resp, err := debitApi.GetBorrowHistory(req, context.TODO()) + resp, err := debitApi.Borrow(req, context.TODO()) if err != nil { panic(err) } @@ -24,16 +24,16 @@ func TestDebitGetBorrowHistoryReq(t *testing.T) { } -func TestDebitBorrowReq(t *testing.T) { - // Borrow - // Borrow +func TestDebitGetBorrowHistoryReq(t *testing.T) { + // GetBorrowHistory + // Get Borrow History // /api/v3/margin/borrow - builder := debit.NewBorrowReqBuilder() - builder.SetCurrency(?).SetSize(?).SetTimeInForce(?).SetSymbol(?).SetIsIsolated(?).SetIsHf(?) + builder := debit.NewGetBorrowHistoryReqBuilder() + builder.SetCurrency(?).SetIsIsolated(?).SetSymbol(?).SetOrderNo(?).SetStartTime(?).SetEndTime(?).SetCurrentPage(?).SetPageSize(?) req := builder.Build() - resp, err := debitApi.Borrow(req, context.TODO()) + resp, err := debitApi.GetBorrowHistory(req, context.TODO()) if err != nil { panic(err) } @@ -47,16 +47,16 @@ func TestDebitBorrowReq(t *testing.T) { } -func TestDebitGetInterestHistoryReq(t *testing.T) { - // GetInterestHistory - // Get Interest History - // /api/v3/margin/interest +func TestDebitRepayReq(t *testing.T) { + // Repay + // Repay + // /api/v3/margin/repay - builder := debit.NewGetInterestHistoryReqBuilder() - builder.SetCurrency(?).SetIsIsolated(?).SetSymbol(?).SetStartTime(?).SetEndTime(?).SetCurrentPage(?).SetPageSize(?) + builder := debit.NewRepayReqBuilder() + builder.SetCurrency(?).SetSize(?).SetSymbol(?).SetIsIsolated(?).SetIsHf(?) req := builder.Build() - resp, err := debitApi.GetInterestHistory(req, context.TODO()) + resp, err := debitApi.Repay(req, context.TODO()) if err != nil { panic(err) } @@ -93,16 +93,16 @@ func TestDebitGetRepayHistoryReq(t *testing.T) { } -func TestDebitRepayReq(t *testing.T) { - // Repay - // Repay - // /api/v3/margin/repay +func TestDebitGetInterestHistoryReq(t *testing.T) { + // GetInterestHistory + // Get Interest History + // /api/v3/margin/interest - builder := debit.NewRepayReqBuilder() - builder.SetCurrency(?).SetSize(?).SetSymbol(?).SetIsIsolated(?).SetIsHf(?) + builder := debit.NewGetInterestHistoryReqBuilder() + builder.SetCurrency(?).SetIsIsolated(?).SetSymbol(?).SetStartTime(?).SetEndTime(?).SetCurrentPage(?).SetPageSize(?) req := builder.Build() - resp, err := debitApi.Repay(req, context.TODO()) + resp, err := debitApi.GetInterestHistory(req, context.TODO()) if err != nil { panic(err) } diff --git a/sdk/golang/pkg/generate/margin/debit/api_debit_test.go b/sdk/golang/pkg/generate/margin/debit/api_debit_test.go index 005dacce..2a9cff24 100644 --- a/sdk/golang/pkg/generate/margin/debit/api_debit_test.go +++ b/sdk/golang/pkg/generate/margin/debit/api_debit_test.go @@ -7,85 +7,85 @@ import ( "testing" ) -func TestDebitGetBorrowHistoryReqModel(t *testing.T) { - // GetBorrowHistory - // Get Borrow History +func TestDebitBorrowReqModel(t *testing.T) { + // Borrow + // Borrow // /api/v3/margin/borrow - data := "{\"currency\": \"BTC\", \"isIsolated\": true, \"symbol\": \"BTC-USDT\", \"orderNo\": \"example_string_default_value\", \"startTime\": 123456, \"endTime\": 123456, \"currentPage\": 1, \"pageSize\": 50}" - req := &GetBorrowHistoryReq{} + data := "{\"currency\": \"USDT\", \"size\": 10, \"timeInForce\": \"FOK\", \"isIsolated\": false, \"isHf\": false}" + req := &BorrowReq{} err := json.Unmarshal([]byte(data), req) req.ToMap() assert.Nil(t, err) } -func TestDebitGetBorrowHistoryRespModel(t *testing.T) { - // GetBorrowHistory - // Get Borrow History +func TestDebitBorrowRespModel(t *testing.T) { + // Borrow + // Borrow // /api/v3/margin/borrow - data := "{\n \"code\": \"200000\",\n \"data\": {\n \"timestamp\": 1729657580449,\n \"currentPage\": 1,\n \"pageSize\": 50,\n \"totalNum\": 2,\n \"totalPage\": 1,\n \"items\": [\n {\n \"orderNo\": \"67187162c0d6990007717b15\",\n \"symbol\": null,\n \"currency\": \"USDT\",\n \"size\": \"10\",\n \"actualSize\": \"10\",\n \"status\": \"SUCCESS\",\n \"createdTime\": 1729655138000\n },\n {\n \"orderNo\": \"67187155b088e70007149585\",\n \"symbol\": null,\n \"currency\": \"USDT\",\n \"size\": \"0.1\",\n \"actualSize\": \"0\",\n \"status\": \"FAILED\",\n \"createdTime\": 1729655125000\n }\n ]\n }\n}" + data := "{\"code\":\"200000\",\"data\":{\"orderNo\":\"67187162c0d6990007717b15\",\"actualSize\":\"10\"}}" commonResp := &types.RestResponse{} err := json.Unmarshal([]byte(data), commonResp) assert.Nil(t, err) assert.NotNil(t, commonResp.Data) - resp := &GetBorrowHistoryResp{} + resp := &BorrowResp{} err = json.Unmarshal([]byte(commonResp.Data), resp) resp.ToMap() assert.Nil(t, err) } -func TestDebitBorrowReqModel(t *testing.T) { - // Borrow - // Borrow +func TestDebitGetBorrowHistoryReqModel(t *testing.T) { + // GetBorrowHistory + // Get Borrow History // /api/v3/margin/borrow - data := "{\"currency\": \"USDT\", \"size\": 10, \"timeInForce\": \"FOK\", \"isIsolated\": false, \"isHf\": false}" - req := &BorrowReq{} + data := "{\"currency\": \"BTC\", \"isIsolated\": true, \"symbol\": \"BTC-USDT\", \"orderNo\": \"example_string_default_value\", \"startTime\": 123456, \"endTime\": 123456, \"currentPage\": 1, \"pageSize\": 50}" + req := &GetBorrowHistoryReq{} err := json.Unmarshal([]byte(data), req) req.ToMap() assert.Nil(t, err) } -func TestDebitBorrowRespModel(t *testing.T) { - // Borrow - // Borrow +func TestDebitGetBorrowHistoryRespModel(t *testing.T) { + // GetBorrowHistory + // Get Borrow History // /api/v3/margin/borrow - data := "{\"code\":\"200000\",\"data\":{\"orderNo\":\"67187162c0d6990007717b15\",\"actualSize\":\"10\"}}" + data := "{\n \"code\": \"200000\",\n \"data\": {\n \"timestamp\": 1729657580449,\n \"currentPage\": 1,\n \"pageSize\": 50,\n \"totalNum\": 2,\n \"totalPage\": 1,\n \"items\": [\n {\n \"orderNo\": \"67187162c0d6990007717b15\",\n \"symbol\": null,\n \"currency\": \"USDT\",\n \"size\": \"10\",\n \"actualSize\": \"10\",\n \"status\": \"SUCCESS\",\n \"createdTime\": 1729655138000\n },\n {\n \"orderNo\": \"67187155b088e70007149585\",\n \"symbol\": null,\n \"currency\": \"USDT\",\n \"size\": \"0.1\",\n \"actualSize\": \"0\",\n \"status\": \"FAILED\",\n \"createdTime\": 1729655125000\n }\n ]\n }\n}" commonResp := &types.RestResponse{} err := json.Unmarshal([]byte(data), commonResp) assert.Nil(t, err) assert.NotNil(t, commonResp.Data) - resp := &BorrowResp{} + resp := &GetBorrowHistoryResp{} err = json.Unmarshal([]byte(commonResp.Data), resp) resp.ToMap() assert.Nil(t, err) } -func TestDebitGetInterestHistoryReqModel(t *testing.T) { - // GetInterestHistory - // Get Interest History - // /api/v3/margin/interest +func TestDebitRepayReqModel(t *testing.T) { + // Repay + // Repay + // /api/v3/margin/repay - data := "{\"currency\": \"BTC\", \"isIsolated\": true, \"symbol\": \"BTC-USDT\", \"startTime\": 123456, \"endTime\": 123456, \"currentPage\": 1, \"pageSize\": 50}" - req := &GetInterestHistoryReq{} + data := "{\"currency\": \"USDT\", \"size\": 10}" + req := &RepayReq{} err := json.Unmarshal([]byte(data), req) req.ToMap() assert.Nil(t, err) } -func TestDebitGetInterestHistoryRespModel(t *testing.T) { - // GetInterestHistory - // Get Interest History - // /api/v3/margin/interest +func TestDebitRepayRespModel(t *testing.T) { + // Repay + // Repay + // /api/v3/margin/repay - data := "{\"code\":\"200000\",\"data\":{\"timestamp\":1729665170701,\"currentPage\":1,\"pageSize\":50,\"totalNum\":3,\"totalPage\":1,\"items\":[{\"currency\":\"USDT\",\"dayRatio\":\"0.000296\",\"interestAmount\":\"0.00000001\",\"createdTime\":1729663213375},{\"currency\":\"USDT\",\"dayRatio\":\"0.000296\",\"interestAmount\":\"0.00000001\",\"createdTime\":1729659618802},{\"currency\":\"USDT\",\"dayRatio\":\"0.000296\",\"interestAmount\":\"0.00000001\",\"createdTime\":1729656028077}]}}" + data := "{\"code\":\"200000\",\"data\":{\"timestamp\":1729655606816,\"orderNo\":\"671873361d5bd400075096ad\",\"actualSize\":\"10\"}}" commonResp := &types.RestResponse{} err := json.Unmarshal([]byte(data), commonResp) assert.Nil(t, err) assert.NotNil(t, commonResp.Data) - resp := &GetInterestHistoryResp{} + resp := &RepayResp{} err = json.Unmarshal([]byte(commonResp.Data), resp) resp.ToMap() assert.Nil(t, err) @@ -119,29 +119,29 @@ func TestDebitGetRepayHistoryRespModel(t *testing.T) { assert.Nil(t, err) } -func TestDebitRepayReqModel(t *testing.T) { - // Repay - // Repay - // /api/v3/margin/repay +func TestDebitGetInterestHistoryReqModel(t *testing.T) { + // GetInterestHistory + // Get Interest History + // /api/v3/margin/interest - data := "{\"currency\": \"USDT\", \"size\": 10}" - req := &RepayReq{} + data := "{\"currency\": \"BTC\", \"isIsolated\": true, \"symbol\": \"BTC-USDT\", \"startTime\": 123456, \"endTime\": 123456, \"currentPage\": 1, \"pageSize\": 50}" + req := &GetInterestHistoryReq{} err := json.Unmarshal([]byte(data), req) req.ToMap() assert.Nil(t, err) } -func TestDebitRepayRespModel(t *testing.T) { - // Repay - // Repay - // /api/v3/margin/repay +func TestDebitGetInterestHistoryRespModel(t *testing.T) { + // GetInterestHistory + // Get Interest History + // /api/v3/margin/interest - data := "{\"code\":\"200000\",\"data\":{\"timestamp\":1729655606816,\"orderNo\":\"671873361d5bd400075096ad\",\"actualSize\":\"10\"}}" + data := "{\"code\":\"200000\",\"data\":{\"timestamp\":1729665170701,\"currentPage\":1,\"pageSize\":50,\"totalNum\":3,\"totalPage\":1,\"items\":[{\"currency\":\"USDT\",\"dayRatio\":\"0.000296\",\"interestAmount\":\"0.00000001\",\"createdTime\":1729663213375},{\"currency\":\"USDT\",\"dayRatio\":\"0.000296\",\"interestAmount\":\"0.00000001\",\"createdTime\":1729659618802},{\"currency\":\"USDT\",\"dayRatio\":\"0.000296\",\"interestAmount\":\"0.00000001\",\"createdTime\":1729656028077}]}}" commonResp := &types.RestResponse{} err := json.Unmarshal([]byte(data), commonResp) assert.Nil(t, err) assert.NotNil(t, commonResp.Data) - resp := &RepayResp{} + resp := &GetInterestHistoryResp{} err = json.Unmarshal([]byte(commonResp.Data), resp) resp.ToMap() assert.Nil(t, err) diff --git a/sdk/golang/pkg/generate/margin/market/api_market.go b/sdk/golang/pkg/generate/margin/market/api_market.go index ae29f7d9..74ab29e9 100644 --- a/sdk/golang/pkg/generate/margin/market/api_market.go +++ b/sdk/golang/pkg/generate/margin/market/api_market.go @@ -9,9 +9,9 @@ import ( type MarketAPI interface { - // GetIsolatedMarginSymbols Get Symbols - Isolated Margin - // Description: This endpoint allows querying the configuration of isolated margin symbol. - // Documentation: https://www.kucoin.com/docs-new/api-3470194 + // GetCrossMarginSymbols Get Symbols - Cross Margin + // Description: This endpoint allows querying the configuration of cross margin symbol. + // Documentation: https://www.kucoin.com/docs-new/api-3470189 // +---------------------+--------+ // | Extra API Info | Value | // +---------------------+--------+ @@ -21,7 +21,7 @@ type MarketAPI interface { // | API-RATE-LIMIT-POOL | PUBLIC | // | API-RATE-LIMIT | 3 | // +---------------------+--------+ - GetIsolatedMarginSymbols(ctx context.Context) (*GetIsolatedMarginSymbolsResp, error) + GetCrossMarginSymbols(req *GetCrossMarginSymbolsReq, ctx context.Context) (*GetCrossMarginSymbolsResp, error) // GetMarginConfig Get Margin Config // Description: Request via this endpoint to get the configure info of the cross margin. @@ -37,9 +37,9 @@ type MarketAPI interface { // +---------------------+--------+ GetMarginConfig(ctx context.Context) (*GetMarginConfigResp, error) - // GetMarkPriceDetail Get Mark Price Detail - // Description: This endpoint returns the current Mark price for specified margin trading pairs. - // Documentation: https://www.kucoin.com/docs-new/api-3470193 + // GetETFInfo Get ETF Info + // Description: This interface returns leveraged token information + // Documentation: https://www.kucoin.com/docs-new/api-3470191 // +---------------------+--------+ // | Extra API Info | Value | // +---------------------+--------+ @@ -47,13 +47,13 @@ type MarketAPI interface { // | API-CHANNEL | PUBLIC | // | API-PERMISSION | NULL | // | API-RATE-LIMIT-POOL | PUBLIC | - // | API-RATE-LIMIT | 2 | + // | API-RATE-LIMIT | 3 | // +---------------------+--------+ - GetMarkPriceDetail(req *GetMarkPriceDetailReq, ctx context.Context) (*GetMarkPriceDetailResp, error) + GetETFInfo(req *GetETFInfoReq, ctx context.Context) (*GetETFInfoResp, error) - // GetETFInfo Get ETF Info - // Description: This interface returns leveraged token information - // Documentation: https://www.kucoin.com/docs-new/api-3470191 + // GetMarkPriceList Get Mark Price List + // Description: This endpoint returns the current Mark price for all margin trading pairs. + // Documentation: https://www.kucoin.com/docs-new/api-3470192 // +---------------------+--------+ // | Extra API Info | Value | // +---------------------+--------+ @@ -61,13 +61,13 @@ type MarketAPI interface { // | API-CHANNEL | PUBLIC | // | API-PERMISSION | NULL | // | API-RATE-LIMIT-POOL | PUBLIC | - // | API-RATE-LIMIT | 3 | + // | API-RATE-LIMIT | 10 | // +---------------------+--------+ - GetETFInfo(req *GetETFInfoReq, ctx context.Context) (*GetETFInfoResp, error) + GetMarkPriceList(ctx context.Context) (*GetMarkPriceListResp, error) - // GetCrossMarginSymbols Get Symbols - Cross Margin - // Description: This endpoint allows querying the configuration of cross margin symbol. - // Documentation: https://www.kucoin.com/docs-new/api-3470189 + // GetMarkPriceDetail Get Mark Price Detail + // Description: This endpoint returns the current Mark price for specified margin trading pairs. + // Documentation: https://www.kucoin.com/docs-new/api-3470193 // +---------------------+--------+ // | Extra API Info | Value | // +---------------------+--------+ @@ -75,13 +75,13 @@ type MarketAPI interface { // | API-CHANNEL | PUBLIC | // | API-PERMISSION | NULL | // | API-RATE-LIMIT-POOL | PUBLIC | - // | API-RATE-LIMIT | 3 | + // | API-RATE-LIMIT | 2 | // +---------------------+--------+ - GetCrossMarginSymbols(req *GetCrossMarginSymbolsReq, ctx context.Context) (*GetCrossMarginSymbolsResp, error) + GetMarkPriceDetail(req *GetMarkPriceDetailReq, ctx context.Context) (*GetMarkPriceDetailResp, error) - // GetMarkPriceList Get Mark Price List - // Description: This endpoint returns the current Mark price for all margin trading pairs. - // Documentation: https://www.kucoin.com/docs-new/api-3470192 + // GetIsolatedMarginSymbols Get Symbols - Isolated Margin + // Description: This endpoint allows querying the configuration of isolated margin symbol. + // Documentation: https://www.kucoin.com/docs-new/api-3470194 // +---------------------+--------+ // | Extra API Info | Value | // +---------------------+--------+ @@ -89,9 +89,9 @@ type MarketAPI interface { // | API-CHANNEL | PUBLIC | // | API-PERMISSION | NULL | // | API-RATE-LIMIT-POOL | PUBLIC | - // | API-RATE-LIMIT | 10 | + // | API-RATE-LIMIT | 3 | // +---------------------+--------+ - GetMarkPriceList(ctx context.Context) (*GetMarkPriceListResp, error) + GetIsolatedMarginSymbols(ctx context.Context) (*GetIsolatedMarginSymbolsResp, error) } type MarketAPIImpl struct { @@ -102,9 +102,9 @@ func NewMarketAPIImp(transport interfaces.Transport) *MarketAPIImpl { return &MarketAPIImpl{transport: transport} } -func (impl *MarketAPIImpl) GetIsolatedMarginSymbols(ctx context.Context) (*GetIsolatedMarginSymbolsResp, error) { - resp := &GetIsolatedMarginSymbolsResp{} - err := impl.transport.Call(ctx, "spot", false, "Get", "/api/v1/isolated/symbols", nil, resp, false) +func (impl *MarketAPIImpl) GetCrossMarginSymbols(req *GetCrossMarginSymbolsReq, ctx context.Context) (*GetCrossMarginSymbolsResp, error) { + resp := &GetCrossMarginSymbolsResp{} + err := impl.transport.Call(ctx, "spot", false, "Get", "/api/v3/margin/symbols", req, resp, false) return resp, err } @@ -114,26 +114,26 @@ func (impl *MarketAPIImpl) GetMarginConfig(ctx context.Context) (*GetMarginConfi return resp, err } -func (impl *MarketAPIImpl) GetMarkPriceDetail(req *GetMarkPriceDetailReq, ctx context.Context) (*GetMarkPriceDetailResp, error) { - resp := &GetMarkPriceDetailResp{} - err := impl.transport.Call(ctx, "spot", false, "Get", "/api/v1/mark-price/{symbol}/current", req, resp, false) - return resp, err -} - func (impl *MarketAPIImpl) GetETFInfo(req *GetETFInfoReq, ctx context.Context) (*GetETFInfoResp, error) { resp := &GetETFInfoResp{} err := impl.transport.Call(ctx, "spot", false, "Get", "/api/v3/etf/info", req, resp, false) return resp, err } -func (impl *MarketAPIImpl) GetCrossMarginSymbols(req *GetCrossMarginSymbolsReq, ctx context.Context) (*GetCrossMarginSymbolsResp, error) { - resp := &GetCrossMarginSymbolsResp{} - err := impl.transport.Call(ctx, "spot", false, "Get", "/api/v3/margin/symbols", req, resp, false) - return resp, err -} - func (impl *MarketAPIImpl) GetMarkPriceList(ctx context.Context) (*GetMarkPriceListResp, error) { resp := &GetMarkPriceListResp{} err := impl.transport.Call(ctx, "spot", false, "Get", "/api/v3/mark-price/all-symbols", nil, resp, false) return resp, err } + +func (impl *MarketAPIImpl) GetMarkPriceDetail(req *GetMarkPriceDetailReq, ctx context.Context) (*GetMarkPriceDetailResp, error) { + resp := &GetMarkPriceDetailResp{} + err := impl.transport.Call(ctx, "spot", false, "Get", "/api/v1/mark-price/{symbol}/current", req, resp, false) + return resp, err +} + +func (impl *MarketAPIImpl) GetIsolatedMarginSymbols(ctx context.Context) (*GetIsolatedMarginSymbolsResp, error) { + resp := &GetIsolatedMarginSymbolsResp{} + err := impl.transport.Call(ctx, "spot", false, "Get", "/api/v1/isolated/symbols", nil, resp, false) + return resp, err +} diff --git a/sdk/golang/pkg/generate/margin/market/api_market.template b/sdk/golang/pkg/generate/margin/market/api_market.template index 06f88210..0aa7a1d4 100644 --- a/sdk/golang/pkg/generate/margin/market/api_market.template +++ b/sdk/golang/pkg/generate/margin/market/api_market.template @@ -1,13 +1,16 @@ # API FUNCTION TEMPLATE -func TestMarketGetIsolatedMarginSymbolsReq(t *testing.T) { - // GetIsolatedMarginSymbols - // Get Symbols - Isolated Margin - // /api/v1/isolated/symbols +func TestMarketGetCrossMarginSymbolsReq(t *testing.T) { + // GetCrossMarginSymbols + // Get Symbols - Cross Margin + // /api/v3/margin/symbols + builder := market.NewGetCrossMarginSymbolsReqBuilder() + builder.SetSymbol(?) + req := builder.Build() - resp, err := marketApi.GetIsolatedMarginSymbols(context.TODO()) + resp, err := marketApi.GetCrossMarginSymbols(req, context.TODO()) if err != nil { panic(err) } @@ -41,16 +44,16 @@ func TestMarketGetMarginConfigReq(t *testing.T) { } -func TestMarketGetMarkPriceDetailReq(t *testing.T) { - // GetMarkPriceDetail - // Get Mark Price Detail - // /api/v1/mark-price/{symbol}/current +func TestMarketGetETFInfoReq(t *testing.T) { + // GetETFInfo + // Get ETF Info + // /api/v3/etf/info - builder := market.NewGetMarkPriceDetailReqBuilder() - builder.SetSymbol(?) + builder := market.NewGetETFInfoReqBuilder() + builder.SetCurrency(?) req := builder.Build() - resp, err := marketApi.GetMarkPriceDetail(req, context.TODO()) + resp, err := marketApi.GetETFInfo(req, context.TODO()) if err != nil { panic(err) } @@ -64,16 +67,13 @@ func TestMarketGetMarkPriceDetailReq(t *testing.T) { } -func TestMarketGetETFInfoReq(t *testing.T) { - // GetETFInfo - // Get ETF Info - // /api/v3/etf/info +func TestMarketGetMarkPriceListReq(t *testing.T) { + // GetMarkPriceList + // Get Mark Price List + // /api/v3/mark-price/all-symbols - builder := market.NewGetETFInfoReqBuilder() - builder.SetCurrency(?) - req := builder.Build() - resp, err := marketApi.GetETFInfo(req, context.TODO()) + resp, err := marketApi.GetMarkPriceList(context.TODO()) if err != nil { panic(err) } @@ -87,16 +87,16 @@ func TestMarketGetETFInfoReq(t *testing.T) { } -func TestMarketGetCrossMarginSymbolsReq(t *testing.T) { - // GetCrossMarginSymbols - // Get Symbols - Cross Margin - // /api/v3/margin/symbols +func TestMarketGetMarkPriceDetailReq(t *testing.T) { + // GetMarkPriceDetail + // Get Mark Price Detail + // /api/v1/mark-price/{symbol}/current - builder := market.NewGetCrossMarginSymbolsReqBuilder() + builder := market.NewGetMarkPriceDetailReqBuilder() builder.SetSymbol(?) req := builder.Build() - resp, err := marketApi.GetCrossMarginSymbols(req, context.TODO()) + resp, err := marketApi.GetMarkPriceDetail(req, context.TODO()) if err != nil { panic(err) } @@ -110,13 +110,13 @@ func TestMarketGetCrossMarginSymbolsReq(t *testing.T) { } -func TestMarketGetMarkPriceListReq(t *testing.T) { - // GetMarkPriceList - // Get Mark Price List - // /api/v3/mark-price/all-symbols +func TestMarketGetIsolatedMarginSymbolsReq(t *testing.T) { + // GetIsolatedMarginSymbols + // Get Symbols - Isolated Margin + // /api/v1/isolated/symbols - resp, err := marketApi.GetMarkPriceList(context.TODO()) + resp, err := marketApi.GetIsolatedMarginSymbols(context.TODO()) if err != nil { panic(err) } diff --git a/sdk/golang/pkg/generate/margin/market/api_market_test.go b/sdk/golang/pkg/generate/margin/market/api_market_test.go index ca9b6903..d08df5a0 100644 --- a/sdk/golang/pkg/generate/margin/market/api_market_test.go +++ b/sdk/golang/pkg/generate/margin/market/api_market_test.go @@ -7,24 +7,29 @@ import ( "testing" ) -func TestMarketGetIsolatedMarginSymbolsReqModel(t *testing.T) { - // GetIsolatedMarginSymbols - // Get Symbols - Isolated Margin - // /api/v1/isolated/symbols +func TestMarketGetCrossMarginSymbolsReqModel(t *testing.T) { + // GetCrossMarginSymbols + // Get Symbols - Cross Margin + // /api/v3/margin/symbols + data := "{\"symbol\": \"BTC-USDT\"}" + req := &GetCrossMarginSymbolsReq{} + err := json.Unmarshal([]byte(data), req) + req.ToMap() + assert.Nil(t, err) } -func TestMarketGetIsolatedMarginSymbolsRespModel(t *testing.T) { - // GetIsolatedMarginSymbols - // Get Symbols - Isolated Margin - // /api/v1/isolated/symbols +func TestMarketGetCrossMarginSymbolsRespModel(t *testing.T) { + // GetCrossMarginSymbols + // Get Symbols - Cross Margin + // /api/v3/margin/symbols - data := "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"symbol\": \"BTC-USDT\",\n \"symbolName\": \"BTC-USDT\",\n \"baseCurrency\": \"BTC\",\n \"quoteCurrency\": \"USDT\",\n \"maxLeverage\": 10,\n \"flDebtRatio\": \"0.97\",\n \"tradeEnable\": true,\n \"autoRenewMaxDebtRatio\": \"0.96\",\n \"baseBorrowEnable\": true,\n \"quoteBorrowEnable\": true,\n \"baseTransferInEnable\": true,\n \"quoteTransferInEnable\": true,\n \"baseBorrowCoefficient\": \"1\",\n \"quoteBorrowCoefficient\": \"1\"\n }\n ]\n}" + data := "{\n \"code\": \"200000\",\n \"data\": {\n \"timestamp\": 1729665839353,\n \"items\": [\n {\n \"symbol\": \"BTC-USDT\",\n \"name\": \"BTC-USDT\",\n \"enableTrading\": true,\n \"market\": \"USDS\",\n \"baseCurrency\": \"BTC\",\n \"quoteCurrency\": \"USDT\",\n \"baseIncrement\": \"0.00000001\",\n \"baseMinSize\": \"0.00001\",\n \"baseMaxSize\": \"10000000000\",\n \"quoteIncrement\": \"0.000001\",\n \"quoteMinSize\": \"0.1\",\n \"quoteMaxSize\": \"99999999\",\n \"priceIncrement\": \"0.1\",\n \"feeCurrency\": \"USDT\",\n \"priceLimitRate\": \"0.1\",\n \"minFunds\": \"0.1\"\n }\n ]\n }\n}" commonResp := &types.RestResponse{} err := json.Unmarshal([]byte(data), commonResp) assert.Nil(t, err) assert.NotNil(t, commonResp.Data) - resp := &GetIsolatedMarginSymbolsResp{} + resp := &GetCrossMarginSymbolsResp{} err = json.Unmarshal([]byte(commonResp.Data), resp) resp.ToMap() assert.Nil(t, err) @@ -53,108 +58,103 @@ func TestMarketGetMarginConfigRespModel(t *testing.T) { assert.Nil(t, err) } -func TestMarketGetMarkPriceDetailReqModel(t *testing.T) { - // GetMarkPriceDetail - // Get Mark Price Detail - // /api/v1/mark-price/{symbol}/current +func TestMarketGetETFInfoReqModel(t *testing.T) { + // GetETFInfo + // Get ETF Info + // /api/v3/etf/info - data := "{\"symbol\": \"USDT-BTC\"}" - req := &GetMarkPriceDetailReq{} + data := "{\"currency\": \"BTCUP\"}" + req := &GetETFInfoReq{} err := json.Unmarshal([]byte(data), req) req.ToMap() assert.Nil(t, err) } -func TestMarketGetMarkPriceDetailRespModel(t *testing.T) { - // GetMarkPriceDetail - // Get Mark Price Detail - // /api/v1/mark-price/{symbol}/current +func TestMarketGetETFInfoRespModel(t *testing.T) { + // GetETFInfo + // Get ETF Info + // /api/v3/etf/info - data := "{\n \"code\": \"200000\",\n \"data\": {\n \"symbol\": \"USDT-BTC\",\n \"timePoint\": 1729676888000,\n \"value\": 1.5045E-5\n }\n}" + data := "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"currency\": \"BTCUP\",\n \"netAsset\": \"33.846\",\n \"targetLeverage\": \"2-4\",\n \"actualLeverage\": \"2.1648\",\n \"issuedSize\": \"107134.87655291\",\n \"basket\": \"118.324559 XBTUSDTM\"\n }\n ]\n}" commonResp := &types.RestResponse{} err := json.Unmarshal([]byte(data), commonResp) assert.Nil(t, err) assert.NotNil(t, commonResp.Data) - resp := &GetMarkPriceDetailResp{} + resp := &GetETFInfoResp{} err = json.Unmarshal([]byte(commonResp.Data), resp) resp.ToMap() assert.Nil(t, err) } -func TestMarketGetETFInfoReqModel(t *testing.T) { - // GetETFInfo - // Get ETF Info - // /api/v3/etf/info +func TestMarketGetMarkPriceListReqModel(t *testing.T) { + // GetMarkPriceList + // Get Mark Price List + // /api/v3/mark-price/all-symbols - data := "{\"currency\": \"BTCUP\"}" - req := &GetETFInfoReq{} - err := json.Unmarshal([]byte(data), req) - req.ToMap() - assert.Nil(t, err) } -func TestMarketGetETFInfoRespModel(t *testing.T) { - // GetETFInfo - // Get ETF Info - // /api/v3/etf/info +func TestMarketGetMarkPriceListRespModel(t *testing.T) { + // GetMarkPriceList + // Get Mark Price List + // /api/v3/mark-price/all-symbols - data := "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"currency\": \"BTCUP\",\n \"netAsset\": \"33.846\",\n \"targetLeverage\": \"2-4\",\n \"actualLeverage\": \"2.1648\",\n \"issuedSize\": \"107134.87655291\",\n \"basket\": \"118.324559 XBTUSDTM\"\n }\n ]\n}" + data := "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"symbol\": \"USDT-BTC\",\n \"timePoint\": 1729676522000,\n \"value\": 1.504E-5\n },\n {\n \"symbol\": \"USDC-BTC\",\n \"timePoint\": 1729676522000,\n \"value\": 1.5049024E-5\n }\n ]\n}" commonResp := &types.RestResponse{} err := json.Unmarshal([]byte(data), commonResp) assert.Nil(t, err) assert.NotNil(t, commonResp.Data) - resp := &GetETFInfoResp{} + resp := &GetMarkPriceListResp{} err = json.Unmarshal([]byte(commonResp.Data), resp) resp.ToMap() assert.Nil(t, err) } -func TestMarketGetCrossMarginSymbolsReqModel(t *testing.T) { - // GetCrossMarginSymbols - // Get Symbols - Cross Margin - // /api/v3/margin/symbols +func TestMarketGetMarkPriceDetailReqModel(t *testing.T) { + // GetMarkPriceDetail + // Get Mark Price Detail + // /api/v1/mark-price/{symbol}/current - data := "{\"symbol\": \"BTC-USDT\"}" - req := &GetCrossMarginSymbolsReq{} + data := "{\"symbol\": \"USDT-BTC\"}" + req := &GetMarkPriceDetailReq{} err := json.Unmarshal([]byte(data), req) req.ToMap() assert.Nil(t, err) } -func TestMarketGetCrossMarginSymbolsRespModel(t *testing.T) { - // GetCrossMarginSymbols - // Get Symbols - Cross Margin - // /api/v3/margin/symbols +func TestMarketGetMarkPriceDetailRespModel(t *testing.T) { + // GetMarkPriceDetail + // Get Mark Price Detail + // /api/v1/mark-price/{symbol}/current - data := "{\n \"code\": \"200000\",\n \"data\": {\n \"timestamp\": 1729665839353,\n \"items\": [\n {\n \"symbol\": \"BTC-USDT\",\n \"name\": \"BTC-USDT\",\n \"enableTrading\": true,\n \"market\": \"USDS\",\n \"baseCurrency\": \"BTC\",\n \"quoteCurrency\": \"USDT\",\n \"baseIncrement\": \"0.00000001\",\n \"baseMinSize\": \"0.00001\",\n \"baseMaxSize\": \"10000000000\",\n \"quoteIncrement\": \"0.000001\",\n \"quoteMinSize\": \"0.1\",\n \"quoteMaxSize\": \"99999999\",\n \"priceIncrement\": \"0.1\",\n \"feeCurrency\": \"USDT\",\n \"priceLimitRate\": \"0.1\",\n \"minFunds\": \"0.1\"\n }\n ]\n }\n}" + data := "{\n \"code\": \"200000\",\n \"data\": {\n \"symbol\": \"USDT-BTC\",\n \"timePoint\": 1729676888000,\n \"value\": 1.5045E-5\n }\n}" commonResp := &types.RestResponse{} err := json.Unmarshal([]byte(data), commonResp) assert.Nil(t, err) assert.NotNil(t, commonResp.Data) - resp := &GetCrossMarginSymbolsResp{} + resp := &GetMarkPriceDetailResp{} err = json.Unmarshal([]byte(commonResp.Data), resp) resp.ToMap() assert.Nil(t, err) } -func TestMarketGetMarkPriceListReqModel(t *testing.T) { - // GetMarkPriceList - // Get Mark Price List - // /api/v3/mark-price/all-symbols +func TestMarketGetIsolatedMarginSymbolsReqModel(t *testing.T) { + // GetIsolatedMarginSymbols + // Get Symbols - Isolated Margin + // /api/v1/isolated/symbols } -func TestMarketGetMarkPriceListRespModel(t *testing.T) { - // GetMarkPriceList - // Get Mark Price List - // /api/v3/mark-price/all-symbols +func TestMarketGetIsolatedMarginSymbolsRespModel(t *testing.T) { + // GetIsolatedMarginSymbols + // Get Symbols - Isolated Margin + // /api/v1/isolated/symbols - data := "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"symbol\": \"USDT-BTC\",\n \"timePoint\": 1729676522000,\n \"value\": 1.504E-5\n },\n {\n \"symbol\": \"USDC-BTC\",\n \"timePoint\": 1729676522000,\n \"value\": 1.5049024E-5\n }\n ]\n}" + data := "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"symbol\": \"BTC-USDT\",\n \"symbolName\": \"BTC-USDT\",\n \"baseCurrency\": \"BTC\",\n \"quoteCurrency\": \"USDT\",\n \"maxLeverage\": 10,\n \"flDebtRatio\": \"0.97\",\n \"tradeEnable\": true,\n \"autoRenewMaxDebtRatio\": \"0.96\",\n \"baseBorrowEnable\": true,\n \"quoteBorrowEnable\": true,\n \"baseTransferInEnable\": true,\n \"quoteTransferInEnable\": true,\n \"baseBorrowCoefficient\": \"1\",\n \"quoteBorrowCoefficient\": \"1\"\n }\n ]\n}" commonResp := &types.RestResponse{} err := json.Unmarshal([]byte(data), commonResp) assert.Nil(t, err) assert.NotNil(t, commonResp.Data) - resp := &GetMarkPriceListResp{} + resp := &GetIsolatedMarginSymbolsResp{} err = json.Unmarshal([]byte(commonResp.Data), resp) resp.ToMap() assert.Nil(t, err) diff --git a/sdk/golang/pkg/generate/margin/order/api_order.go b/sdk/golang/pkg/generate/margin/order/api_order.go index 3176b361..ceebde7e 100644 --- a/sdk/golang/pkg/generate/margin/order/api_order.go +++ b/sdk/golang/pkg/generate/margin/order/api_order.go @@ -9,9 +9,9 @@ import ( type OrderAPI interface { - // AddOrderV1 Add Order - V1 + // AddOrder Add Order // Description: Place order to the Cross-margin or Isolated-margin trading system, you can place two major types of orders: limit and market. Orders can only be placed if your account has sufficient funds. Once an order is placed, your funds will be put on hold for the duration of the order. The amount of funds on hold depends on the order type and parameters specified. - // Documentation: https://www.kucoin.com/docs-new/api-3470312 + // Documentation: https://www.kucoin.com/docs-new/api-3470204 // +---------------------+---------+ // | Extra API Info | Value | // +---------------------+---------+ @@ -21,12 +21,11 @@ type OrderAPI interface { // | API-RATE-LIMIT-POOL | SPOT | // | API-RATE-LIMIT | 5 | // +---------------------+---------+ - // Deprecated - AddOrderV1(req *AddOrderV1Req, ctx context.Context) (*AddOrderV1Resp, error) + AddOrder(req *AddOrderReq, ctx context.Context) (*AddOrderResp, error) - // AddOrderTestV1 Add Order Test - V1 - // Description: Order test endpoint, the request parameters and return parameters of this endpoint are exactly the same as the order endpoint, and can be used to verify whether the signature is correct and other operations. After placing an order, the order will not enter the matching system, and the order cannot be queried. - // Documentation: https://www.kucoin.com/docs-new/api-3470313 + // AddOrderTest Add Order Test + // Description: Order test endpoint, the request parameters and return parameters of this endpoint are exactly the same as the order endpoint, and can be used to verify whether the signature is correct and other operations. After placing an order, the order will not enter the matching system, and the order cannot be queried. + // Documentation: https://www.kucoin.com/docs-new/api-3470205 // +---------------------+---------+ // | Extra API Info | Value | // +---------------------+---------+ @@ -36,26 +35,25 @@ type OrderAPI interface { // | API-RATE-LIMIT-POOL | SPOT | // | API-RATE-LIMIT | 5 | // +---------------------+---------+ - // Deprecated - AddOrderTestV1(req *AddOrderTestV1Req, ctx context.Context) (*AddOrderTestV1Resp, error) + AddOrderTest(req *AddOrderTestReq, ctx context.Context) (*AddOrderTestResp, error) - // GetTradeHistory Get Trade History - // Description: This endpoint can be used to obtain a list of the latest Margin transaction details. The returned data is sorted in descending order according to the latest update time of the order. - // Documentation: https://www.kucoin.com/docs-new/api-3470200 + // CancelOrderByOrderId Cancel Order By OrderId + // Description: This endpoint can be used to cancel a margin order by orderId. This endpoint only sends cancellation requests. The results of the requests must be obtained by checking the order status or subscribing to websocket. + // Documentation: https://www.kucoin.com/docs-new/api-3470195 // +---------------------+---------+ // | Extra API Info | Value | // +---------------------+---------+ // | API-DOMAIN | SPOT | // | API-CHANNEL | PRIVATE | - // | API-PERMISSION | GENERAL | + // | API-PERMISSION | MARGIN | // | API-RATE-LIMIT-POOL | SPOT | // | API-RATE-LIMIT | 5 | // +---------------------+---------+ - GetTradeHistory(req *GetTradeHistoryReq, ctx context.Context) (*GetTradeHistoryResp, error) + CancelOrderByOrderId(req *CancelOrderByOrderIdReq, ctx context.Context) (*CancelOrderByOrderIdResp, error) - // GetSymbolsWithOpenOrder Get Symbols With Open Order - // Description: This interface can query all Margin symbol that has active orders - // Documentation: https://www.kucoin.com/docs-new/api-3470196 + // CancelOrderByClientOid Cancel Order By ClientOid + // Description: This endpoint can be used to cancel a margin order by clientOid. This endpoint only sends cancellation requests. The results of the requests must be obtained by checking the order status or subscribing to websocket. + // Documentation: https://www.kucoin.com/docs-new/api-3470201 // +---------------------+---------+ // | Extra API Info | Value | // +---------------------+---------+ @@ -63,13 +61,13 @@ type OrderAPI interface { // | API-CHANNEL | PRIVATE | // | API-PERMISSION | MARGIN | // | API-RATE-LIMIT-POOL | SPOT | - // | API-RATE-LIMIT | 2 | + // | API-RATE-LIMIT | 5 | // +---------------------+---------+ - GetSymbolsWithOpenOrder(req *GetSymbolsWithOpenOrderReq, ctx context.Context) (*GetSymbolsWithOpenOrderResp, error) + CancelOrderByClientOid(req *CancelOrderByClientOidReq, ctx context.Context) (*CancelOrderByClientOidResp, error) - // AddOrder Add Order - // Description: Place order to the Cross-margin or Isolated-margin trading system, you can place two major types of orders: limit and market. Orders can only be placed if your account has sufficient funds. Once an order is placed, your funds will be put on hold for the duration of the order. The amount of funds on hold depends on the order type and parameters specified. - // Documentation: https://www.kucoin.com/docs-new/api-3470204 + // CancelAllOrdersBySymbol Cancel All Orders By Symbol + // Description: This interface can cancel all open Margin orders by symbol This endpoint only sends cancellation requests. The results of the requests must be obtained by checking the order status or subscribing to websocket. + // Documentation: https://www.kucoin.com/docs-new/api-3470197 // +---------------------+---------+ // | Extra API Info | Value | // +---------------------+---------+ @@ -77,13 +75,13 @@ type OrderAPI interface { // | API-CHANNEL | PRIVATE | // | API-PERMISSION | MARGIN | // | API-RATE-LIMIT-POOL | SPOT | - // | API-RATE-LIMIT | 5 | + // | API-RATE-LIMIT | 10 | // +---------------------+---------+ - AddOrder(req *AddOrderReq, ctx context.Context) (*AddOrderResp, error) + CancelAllOrdersBySymbol(req *CancelAllOrdersBySymbolReq, ctx context.Context) (*CancelAllOrdersBySymbolResp, error) - // AddOrderTest Add Order Test - // Description: Order test endpoint, the request parameters and return parameters of this endpoint are exactly the same as the order endpoint, and can be used to verify whether the signature is correct and other operations. After placing an order, the order will not enter the matching system, and the order cannot be queried. - // Documentation: https://www.kucoin.com/docs-new/api-3470205 + // GetSymbolsWithOpenOrder Get Symbols With Open Order + // Description: This interface can query all Margin symbol that has active orders + // Documentation: https://www.kucoin.com/docs-new/api-3470196 // +---------------------+---------+ // | Extra API Info | Value | // +---------------------+---------+ @@ -91,9 +89,9 @@ type OrderAPI interface { // | API-CHANNEL | PRIVATE | // | API-PERMISSION | MARGIN | // | API-RATE-LIMIT-POOL | SPOT | - // | API-RATE-LIMIT | 5 | + // | API-RATE-LIMIT | 2 | // +---------------------+---------+ - AddOrderTest(req *AddOrderTestReq, ctx context.Context) (*AddOrderTestResp, error) + GetSymbolsWithOpenOrder(req *GetSymbolsWithOpenOrderReq, ctx context.Context) (*GetSymbolsWithOpenOrderResp, error) // GetOpenOrders Get Open Orders // Description: This interface is to obtain all Margin active order lists, and the return value of the active order interface is the paged data of all uncompleted order lists. The returned data is sorted in descending order according to the latest update time of the order. After the user successfully places an order, the order is in Active state, and the user can use inOrderBook to determine whether the order has entered the order. Canceled or fully filled orders are marked as completed Done status. @@ -109,23 +107,23 @@ type OrderAPI interface { // +---------------------+---------+ GetOpenOrders(req *GetOpenOrdersReq, ctx context.Context) (*GetOpenOrdersResp, error) - // CancelOrderByClientOid Cancel Order By ClientOid - // Description: This endpoint can be used to cancel a margin order by clientOid. This endpoint only sends cancellation requests. The results of the requests must be obtained by checking the order status or subscribing to websocket. - // Documentation: https://www.kucoin.com/docs-new/api-3470201 + // GetClosedOrders Get Closed Orders + // Description: This interface is to obtain all Margin closed order lists, and the return value of the active order interface is the paged data of all uncompleted order lists. The returned data is sorted in descending order according to the latest update time of the order. After the user successfully places an order, the order is in Active state, and the user can use inOrderBook to determine whether the order has entered the order. Canceled or fully filled orders are marked as completed Done status. + // Documentation: https://www.kucoin.com/docs-new/api-3470199 // +---------------------+---------+ // | Extra API Info | Value | // +---------------------+---------+ // | API-DOMAIN | SPOT | // | API-CHANNEL | PRIVATE | - // | API-PERMISSION | MARGIN | + // | API-PERMISSION | GENERAL | // | API-RATE-LIMIT-POOL | SPOT | - // | API-RATE-LIMIT | 5 | + // | API-RATE-LIMIT | 10 | // +---------------------+---------+ - CancelOrderByClientOid(req *CancelOrderByClientOidReq, ctx context.Context) (*CancelOrderByClientOidResp, error) + GetClosedOrders(req *GetClosedOrdersReq, ctx context.Context) (*GetClosedOrdersResp, error) - // GetOrderByClientOid Get Order By ClientOid - // Description: This endpoint can be used to obtain information for a single Margin order using the client order id. After the user successfully places an order, the order is in Active state, and the user can use inOrderBook to determine whether the order has entered the order. Canceled or fully filled orders are marked as completed Done status. - // Documentation: https://www.kucoin.com/docs-new/api-3470203 + // GetTradeHistory Get Trade History + // Description: This endpoint can be used to obtain a list of the latest Margin transaction details. The returned data is sorted in descending order according to the latest update time of the order. + // Documentation: https://www.kucoin.com/docs-new/api-3470200 // +---------------------+---------+ // | Extra API Info | Value | // +---------------------+---------+ @@ -135,25 +133,25 @@ type OrderAPI interface { // | API-RATE-LIMIT-POOL | SPOT | // | API-RATE-LIMIT | 5 | // +---------------------+---------+ - GetOrderByClientOid(req *GetOrderByClientOidReq, ctx context.Context) (*GetOrderByClientOidResp, error) + GetTradeHistory(req *GetTradeHistoryReq, ctx context.Context) (*GetTradeHistoryResp, error) - // CancelAllOrdersBySymbol Cancel All Orders By Symbol - // Description: This interface can cancel all open Margin orders by symbol This endpoint only sends cancellation requests. The results of the requests must be obtained by checking the order status or subscribing to websocket. - // Documentation: https://www.kucoin.com/docs-new/api-3470197 + // GetOrderByOrderId Get Order By OrderId + // Description: This endpoint can be used to obtain information for a single Margin order using the order id. After the user successfully places an order, the order is in Active state, and the user can use inOrderBook to determine whether the order has entered the order. Canceled or fully filled orders are marked as completed Done status. + // Documentation: https://www.kucoin.com/docs-new/api-3470202 // +---------------------+---------+ // | Extra API Info | Value | // +---------------------+---------+ // | API-DOMAIN | SPOT | // | API-CHANNEL | PRIVATE | - // | API-PERMISSION | MARGIN | + // | API-PERMISSION | GENERAL | // | API-RATE-LIMIT-POOL | SPOT | - // | API-RATE-LIMIT | 10 | + // | API-RATE-LIMIT | 5 | // +---------------------+---------+ - CancelAllOrdersBySymbol(req *CancelAllOrdersBySymbolReq, ctx context.Context) (*CancelAllOrdersBySymbolResp, error) + GetOrderByOrderId(req *GetOrderByOrderIdReq, ctx context.Context) (*GetOrderByOrderIdResp, error) - // GetClosedOrders Get Closed Orders - // Description: This interface is to obtain all Margin closed order lists, and the return value of the active order interface is the paged data of all uncompleted order lists. The returned data is sorted in descending order according to the latest update time of the order. After the user successfully places an order, the order is in Active state, and the user can use inOrderBook to determine whether the order has entered the order. Canceled or fully filled orders are marked as completed Done status. - // Documentation: https://www.kucoin.com/docs-new/api-3470199 + // GetOrderByClientOid Get Order By ClientOid + // Description: This endpoint can be used to obtain information for a single Margin order using the client order id. After the user successfully places an order, the order is in Active state, and the user can use inOrderBook to determine whether the order has entered the order. Canceled or fully filled orders are marked as completed Done status. + // Documentation: https://www.kucoin.com/docs-new/api-3470203 // +---------------------+---------+ // | Extra API Info | Value | // +---------------------+---------+ @@ -161,13 +159,13 @@ type OrderAPI interface { // | API-CHANNEL | PRIVATE | // | API-PERMISSION | GENERAL | // | API-RATE-LIMIT-POOL | SPOT | - // | API-RATE-LIMIT | 10 | + // | API-RATE-LIMIT | 5 | // +---------------------+---------+ - GetClosedOrders(req *GetClosedOrdersReq, ctx context.Context) (*GetClosedOrdersResp, error) + GetOrderByClientOid(req *GetOrderByClientOidReq, ctx context.Context) (*GetOrderByClientOidResp, error) - // CancelOrderByOrderId Cancel Order By OrderId - // Description: This endpoint can be used to cancel a margin order by orderId. This endpoint only sends cancellation requests. The results of the requests must be obtained by checking the order status or subscribing to websocket. - // Documentation: https://www.kucoin.com/docs-new/api-3470195 + // AddOrderV1 Add Order - V1 + // Description: Place order to the Cross-margin or Isolated-margin trading system, you can place two major types of orders: limit and market. Orders can only be placed if your account has sufficient funds. Once an order is placed, your funds will be put on hold for the duration of the order. The amount of funds on hold depends on the order type and parameters specified. + // Documentation: https://www.kucoin.com/docs-new/api-3470312 // +---------------------+---------+ // | Extra API Info | Value | // +---------------------+---------+ @@ -177,21 +175,23 @@ type OrderAPI interface { // | API-RATE-LIMIT-POOL | SPOT | // | API-RATE-LIMIT | 5 | // +---------------------+---------+ - CancelOrderByOrderId(req *CancelOrderByOrderIdReq, ctx context.Context) (*CancelOrderByOrderIdResp, error) + // Deprecated + AddOrderV1(req *AddOrderV1Req, ctx context.Context) (*AddOrderV1Resp, error) - // GetOrderByOrderId Get Order By OrderId - // Description: This endpoint can be used to obtain information for a single Margin order using the order id. After the user successfully places an order, the order is in Active state, and the user can use inOrderBook to determine whether the order has entered the order. Canceled or fully filled orders are marked as completed Done status. - // Documentation: https://www.kucoin.com/docs-new/api-3470202 + // AddOrderTestV1 Add Order Test - V1 + // Description: Order test endpoint, the request parameters and return parameters of this endpoint are exactly the same as the order endpoint, and can be used to verify whether the signature is correct and other operations. After placing an order, the order will not enter the matching system, and the order cannot be queried. + // Documentation: https://www.kucoin.com/docs-new/api-3470313 // +---------------------+---------+ // | Extra API Info | Value | // +---------------------+---------+ // | API-DOMAIN | SPOT | // | API-CHANNEL | PRIVATE | - // | API-PERMISSION | GENERAL | + // | API-PERMISSION | MARGIN | // | API-RATE-LIMIT-POOL | SPOT | // | API-RATE-LIMIT | 5 | // +---------------------+---------+ - GetOrderByOrderId(req *GetOrderByOrderIdReq, ctx context.Context) (*GetOrderByOrderIdResp, error) + // Deprecated + AddOrderTestV1(req *AddOrderTestV1Req, ctx context.Context) (*AddOrderTestV1Resp, error) } type OrderAPIImpl struct { @@ -202,30 +202,6 @@ func NewOrderAPIImp(transport interfaces.Transport) *OrderAPIImpl { return &OrderAPIImpl{transport: transport} } -func (impl *OrderAPIImpl) AddOrderV1(req *AddOrderV1Req, ctx context.Context) (*AddOrderV1Resp, error) { - resp := &AddOrderV1Resp{} - err := impl.transport.Call(ctx, "spot", false, "Post", "/api/v1/margin/order", req, resp, false) - return resp, err -} - -func (impl *OrderAPIImpl) AddOrderTestV1(req *AddOrderTestV1Req, ctx context.Context) (*AddOrderTestV1Resp, error) { - resp := &AddOrderTestV1Resp{} - err := impl.transport.Call(ctx, "spot", false, "Post", "/api/v1/margin/order/test", req, resp, false) - return resp, err -} - -func (impl *OrderAPIImpl) GetTradeHistory(req *GetTradeHistoryReq, ctx context.Context) (*GetTradeHistoryResp, error) { - resp := &GetTradeHistoryResp{} - err := impl.transport.Call(ctx, "spot", false, "Get", "/api/v3/hf/margin/fills", req, resp, false) - return resp, err -} - -func (impl *OrderAPIImpl) GetSymbolsWithOpenOrder(req *GetSymbolsWithOpenOrderReq, ctx context.Context) (*GetSymbolsWithOpenOrderResp, error) { - resp := &GetSymbolsWithOpenOrderResp{} - err := impl.transport.Call(ctx, "spot", false, "Get", "/api/v3/hf/margin/order/active/symbols", req, resp, false) - return resp, err -} - func (impl *OrderAPIImpl) AddOrder(req *AddOrderReq, ctx context.Context) (*AddOrderResp, error) { resp := &AddOrderResp{} err := impl.transport.Call(ctx, "spot", false, "Post", "/api/v3/hf/margin/order", req, resp, false) @@ -238,9 +214,9 @@ func (impl *OrderAPIImpl) AddOrderTest(req *AddOrderTestReq, ctx context.Context return resp, err } -func (impl *OrderAPIImpl) GetOpenOrders(req *GetOpenOrdersReq, ctx context.Context) (*GetOpenOrdersResp, error) { - resp := &GetOpenOrdersResp{} - err := impl.transport.Call(ctx, "spot", false, "Get", "/api/v3/hf/margin/orders/active", req, resp, false) +func (impl *OrderAPIImpl) CancelOrderByOrderId(req *CancelOrderByOrderIdReq, ctx context.Context) (*CancelOrderByOrderIdResp, error) { + resp := &CancelOrderByOrderIdResp{} + err := impl.transport.Call(ctx, "spot", false, "Delete", "/api/v3/hf/margin/orders/{orderId}", req, resp, false) return resp, err } @@ -250,27 +226,33 @@ func (impl *OrderAPIImpl) CancelOrderByClientOid(req *CancelOrderByClientOidReq, return resp, err } -func (impl *OrderAPIImpl) GetOrderByClientOid(req *GetOrderByClientOidReq, ctx context.Context) (*GetOrderByClientOidResp, error) { - resp := &GetOrderByClientOidResp{} - err := impl.transport.Call(ctx, "spot", false, "Get", "/api/v3/hf/margin/orders/client-order/{clientOid}", req, resp, false) - return resp, err -} - func (impl *OrderAPIImpl) CancelAllOrdersBySymbol(req *CancelAllOrdersBySymbolReq, ctx context.Context) (*CancelAllOrdersBySymbolResp, error) { resp := &CancelAllOrdersBySymbolResp{} err := impl.transport.Call(ctx, "spot", false, "Delete", "/api/v3/hf/margin/orders", req, resp, false) return resp, err } +func (impl *OrderAPIImpl) GetSymbolsWithOpenOrder(req *GetSymbolsWithOpenOrderReq, ctx context.Context) (*GetSymbolsWithOpenOrderResp, error) { + resp := &GetSymbolsWithOpenOrderResp{} + err := impl.transport.Call(ctx, "spot", false, "Get", "/api/v3/hf/margin/order/active/symbols", req, resp, false) + return resp, err +} + +func (impl *OrderAPIImpl) GetOpenOrders(req *GetOpenOrdersReq, ctx context.Context) (*GetOpenOrdersResp, error) { + resp := &GetOpenOrdersResp{} + err := impl.transport.Call(ctx, "spot", false, "Get", "/api/v3/hf/margin/orders/active", req, resp, false) + return resp, err +} + func (impl *OrderAPIImpl) GetClosedOrders(req *GetClosedOrdersReq, ctx context.Context) (*GetClosedOrdersResp, error) { resp := &GetClosedOrdersResp{} err := impl.transport.Call(ctx, "spot", false, "Get", "/api/v3/hf/margin/orders/done", req, resp, false) return resp, err } -func (impl *OrderAPIImpl) CancelOrderByOrderId(req *CancelOrderByOrderIdReq, ctx context.Context) (*CancelOrderByOrderIdResp, error) { - resp := &CancelOrderByOrderIdResp{} - err := impl.transport.Call(ctx, "spot", false, "Delete", "/api/v3/hf/margin/orders/{orderId}", req, resp, false) +func (impl *OrderAPIImpl) GetTradeHistory(req *GetTradeHistoryReq, ctx context.Context) (*GetTradeHistoryResp, error) { + resp := &GetTradeHistoryResp{} + err := impl.transport.Call(ctx, "spot", false, "Get", "/api/v3/hf/margin/fills", req, resp, false) return resp, err } @@ -279,3 +261,21 @@ func (impl *OrderAPIImpl) GetOrderByOrderId(req *GetOrderByOrderIdReq, ctx conte err := impl.transport.Call(ctx, "spot", false, "Get", "/api/v3/hf/margin/orders/{orderId}", req, resp, false) return resp, err } + +func (impl *OrderAPIImpl) GetOrderByClientOid(req *GetOrderByClientOidReq, ctx context.Context) (*GetOrderByClientOidResp, error) { + resp := &GetOrderByClientOidResp{} + err := impl.transport.Call(ctx, "spot", false, "Get", "/api/v3/hf/margin/orders/client-order/{clientOid}", req, resp, false) + return resp, err +} + +func (impl *OrderAPIImpl) AddOrderV1(req *AddOrderV1Req, ctx context.Context) (*AddOrderV1Resp, error) { + resp := &AddOrderV1Resp{} + err := impl.transport.Call(ctx, "spot", false, "Post", "/api/v1/margin/order", req, resp, false) + return resp, err +} + +func (impl *OrderAPIImpl) AddOrderTestV1(req *AddOrderTestV1Req, ctx context.Context) (*AddOrderTestV1Resp, error) { + resp := &AddOrderTestV1Resp{} + err := impl.transport.Call(ctx, "spot", false, "Post", "/api/v1/margin/order/test", req, resp, false) + return resp, err +} diff --git a/sdk/golang/pkg/generate/margin/order/api_order.template b/sdk/golang/pkg/generate/margin/order/api_order.template index 1d3a2a58..e7d0da92 100644 --- a/sdk/golang/pkg/generate/margin/order/api_order.template +++ b/sdk/golang/pkg/generate/margin/order/api_order.template @@ -1,16 +1,16 @@ # API FUNCTION TEMPLATE -func TestOrderAddOrderV1Req(t *testing.T) { - // AddOrderV1 - // Add Order - V1 - // /api/v1/margin/order +func TestOrderAddOrderReq(t *testing.T) { + // AddOrder + // Add Order + // /api/v3/hf/margin/order - builder := order.NewAddOrderV1ReqBuilder() - builder.SetClientOid(?).SetSide(?).SetSymbol(?).SetType(?).SetStp(?).SetPrice(?).SetSize(?).SetTimeInForce(?).SetPostOnly(?).SetHidden(?).SetIceberg(?).SetVisibleSize(?).SetCancelAfter(?).SetFunds(?).SetAutoBorrow(?).SetAutoRepay(?).SetMarginModel(?) + builder := order.NewAddOrderReqBuilder() + builder.SetClientOid(?).SetSide(?).SetSymbol(?).SetType(?).SetStp(?).SetPrice(?).SetSize(?).SetTimeInForce(?).SetPostOnly(?).SetHidden(?).SetIceberg(?).SetVisibleSize(?).SetCancelAfter(?).SetFunds(?).SetIsIsolated(?).SetAutoBorrow(?).SetAutoRepay(?) req := builder.Build() - resp, err := orderApi.AddOrderV1(req, context.TODO()) + resp, err := orderApi.AddOrder(req, context.TODO()) if err != nil { panic(err) } @@ -24,16 +24,16 @@ func TestOrderAddOrderV1Req(t *testing.T) { } -func TestOrderAddOrderTestV1Req(t *testing.T) { - // AddOrderTestV1 - // Add Order Test - V1 - // /api/v1/margin/order/test +func TestOrderAddOrderTestReq(t *testing.T) { + // AddOrderTest + // Add Order Test + // /api/v3/hf/margin/order/test - builder := order.NewAddOrderTestV1ReqBuilder() - builder.SetClientOid(?).SetSide(?).SetSymbol(?).SetType(?).SetStp(?).SetPrice(?).SetSize(?).SetTimeInForce(?).SetPostOnly(?).SetHidden(?).SetIceberg(?).SetVisibleSize(?).SetCancelAfter(?).SetFunds(?).SetAutoBorrow(?).SetAutoRepay(?).SetMarginModel(?) + builder := order.NewAddOrderTestReqBuilder() + builder.SetClientOid(?).SetSide(?).SetSymbol(?).SetType(?).SetStp(?).SetPrice(?).SetSize(?).SetTimeInForce(?).SetPostOnly(?).SetHidden(?).SetIceberg(?).SetVisibleSize(?).SetCancelAfter(?).SetFunds(?).SetIsIsolated(?).SetAutoBorrow(?).SetAutoRepay(?) req := builder.Build() - resp, err := orderApi.AddOrderTestV1(req, context.TODO()) + resp, err := orderApi.AddOrderTest(req, context.TODO()) if err != nil { panic(err) } @@ -47,16 +47,16 @@ func TestOrderAddOrderTestV1Req(t *testing.T) { } -func TestOrderGetTradeHistoryReq(t *testing.T) { - // GetTradeHistory - // Get Trade History - // /api/v3/hf/margin/fills +func TestOrderCancelOrderByOrderIdReq(t *testing.T) { + // CancelOrderByOrderId + // Cancel Order By OrderId + // /api/v3/hf/margin/orders/{orderId} - builder := order.NewGetTradeHistoryReqBuilder() - builder.SetSymbol(?).SetTradeType(?).SetOrderId(?).SetSide(?).SetType(?).SetLastId(?).SetLimit(?).SetStartAt(?).SetEndAt(?) + builder := order.NewCancelOrderByOrderIdReqBuilder() + builder.SetOrderId(?).SetSymbol(?) req := builder.Build() - resp, err := orderApi.GetTradeHistory(req, context.TODO()) + resp, err := orderApi.CancelOrderByOrderId(req, context.TODO()) if err != nil { panic(err) } @@ -70,16 +70,16 @@ func TestOrderGetTradeHistoryReq(t *testing.T) { } -func TestOrderGetSymbolsWithOpenOrderReq(t *testing.T) { - // GetSymbolsWithOpenOrder - // Get Symbols With Open Order - // /api/v3/hf/margin/order/active/symbols +func TestOrderCancelOrderByClientOidReq(t *testing.T) { + // CancelOrderByClientOid + // Cancel Order By ClientOid + // /api/v3/hf/margin/orders/client-order/{clientOid} - builder := order.NewGetSymbolsWithOpenOrderReqBuilder() - builder.SetTradeType(?) + builder := order.NewCancelOrderByClientOidReqBuilder() + builder.SetClientOid(?).SetSymbol(?) req := builder.Build() - resp, err := orderApi.GetSymbolsWithOpenOrder(req, context.TODO()) + resp, err := orderApi.CancelOrderByClientOid(req, context.TODO()) if err != nil { panic(err) } @@ -93,16 +93,16 @@ func TestOrderGetSymbolsWithOpenOrderReq(t *testing.T) { } -func TestOrderAddOrderReq(t *testing.T) { - // AddOrder - // Add Order - // /api/v3/hf/margin/order +func TestOrderCancelAllOrdersBySymbolReq(t *testing.T) { + // CancelAllOrdersBySymbol + // Cancel All Orders By Symbol + // /api/v3/hf/margin/orders - builder := order.NewAddOrderReqBuilder() - builder.SetClientOid(?).SetSide(?).SetSymbol(?).SetType(?).SetStp(?).SetPrice(?).SetSize(?).SetTimeInForce(?).SetPostOnly(?).SetHidden(?).SetIceberg(?).SetVisibleSize(?).SetCancelAfter(?).SetFunds(?).SetIsIsolated(?).SetAutoBorrow(?).SetAutoRepay(?) + builder := order.NewCancelAllOrdersBySymbolReqBuilder() + builder.SetSymbol(?).SetTradeType(?) req := builder.Build() - resp, err := orderApi.AddOrder(req, context.TODO()) + resp, err := orderApi.CancelAllOrdersBySymbol(req, context.TODO()) if err != nil { panic(err) } @@ -116,16 +116,16 @@ func TestOrderAddOrderReq(t *testing.T) { } -func TestOrderAddOrderTestReq(t *testing.T) { - // AddOrderTest - // Add Order Test - // /api/v3/hf/margin/order/test +func TestOrderGetSymbolsWithOpenOrderReq(t *testing.T) { + // GetSymbolsWithOpenOrder + // Get Symbols With Open Order + // /api/v3/hf/margin/order/active/symbols - builder := order.NewAddOrderTestReqBuilder() - builder.SetClientOid(?).SetSide(?).SetSymbol(?).SetType(?).SetStp(?).SetPrice(?).SetSize(?).SetTimeInForce(?).SetPostOnly(?).SetHidden(?).SetIceberg(?).SetVisibleSize(?).SetCancelAfter(?).SetFunds(?).SetIsIsolated(?).SetAutoBorrow(?).SetAutoRepay(?) + builder := order.NewGetSymbolsWithOpenOrderReqBuilder() + builder.SetTradeType(?) req := builder.Build() - resp, err := orderApi.AddOrderTest(req, context.TODO()) + resp, err := orderApi.GetSymbolsWithOpenOrder(req, context.TODO()) if err != nil { panic(err) } @@ -162,16 +162,16 @@ func TestOrderGetOpenOrdersReq(t *testing.T) { } -func TestOrderCancelOrderByClientOidReq(t *testing.T) { - // CancelOrderByClientOid - // Cancel Order By ClientOid - // /api/v3/hf/margin/orders/client-order/{clientOid} +func TestOrderGetClosedOrdersReq(t *testing.T) { + // GetClosedOrders + // Get Closed Orders + // /api/v3/hf/margin/orders/done - builder := order.NewCancelOrderByClientOidReqBuilder() - builder.SetClientOid(?).SetSymbol(?) + builder := order.NewGetClosedOrdersReqBuilder() + builder.SetSymbol(?).SetTradeType(?).SetSide(?).SetType(?).SetLastId(?).SetLimit(?).SetStartAt(?).SetEndAt(?) req := builder.Build() - resp, err := orderApi.CancelOrderByClientOid(req, context.TODO()) + resp, err := orderApi.GetClosedOrders(req, context.TODO()) if err != nil { panic(err) } @@ -185,16 +185,16 @@ func TestOrderCancelOrderByClientOidReq(t *testing.T) { } -func TestOrderGetOrderByClientOidReq(t *testing.T) { - // GetOrderByClientOid - // Get Order By ClientOid - // /api/v3/hf/margin/orders/client-order/{clientOid} +func TestOrderGetTradeHistoryReq(t *testing.T) { + // GetTradeHistory + // Get Trade History + // /api/v3/hf/margin/fills - builder := order.NewGetOrderByClientOidReqBuilder() - builder.SetSymbol(?).SetClientOid(?) + builder := order.NewGetTradeHistoryReqBuilder() + builder.SetSymbol(?).SetTradeType(?).SetOrderId(?).SetSide(?).SetType(?).SetLastId(?).SetLimit(?).SetStartAt(?).SetEndAt(?) req := builder.Build() - resp, err := orderApi.GetOrderByClientOid(req, context.TODO()) + resp, err := orderApi.GetTradeHistory(req, context.TODO()) if err != nil { panic(err) } @@ -208,16 +208,16 @@ func TestOrderGetOrderByClientOidReq(t *testing.T) { } -func TestOrderCancelAllOrdersBySymbolReq(t *testing.T) { - // CancelAllOrdersBySymbol - // Cancel All Orders By Symbol - // /api/v3/hf/margin/orders +func TestOrderGetOrderByOrderIdReq(t *testing.T) { + // GetOrderByOrderId + // Get Order By OrderId + // /api/v3/hf/margin/orders/{orderId} - builder := order.NewCancelAllOrdersBySymbolReqBuilder() - builder.SetSymbol(?).SetTradeType(?) + builder := order.NewGetOrderByOrderIdReqBuilder() + builder.SetSymbol(?).SetOrderId(?) req := builder.Build() - resp, err := orderApi.CancelAllOrdersBySymbol(req, context.TODO()) + resp, err := orderApi.GetOrderByOrderId(req, context.TODO()) if err != nil { panic(err) } @@ -231,16 +231,16 @@ func TestOrderCancelAllOrdersBySymbolReq(t *testing.T) { } -func TestOrderGetClosedOrdersReq(t *testing.T) { - // GetClosedOrders - // Get Closed Orders - // /api/v3/hf/margin/orders/done +func TestOrderGetOrderByClientOidReq(t *testing.T) { + // GetOrderByClientOid + // Get Order By ClientOid + // /api/v3/hf/margin/orders/client-order/{clientOid} - builder := order.NewGetClosedOrdersReqBuilder() - builder.SetSymbol(?).SetTradeType(?).SetSide(?).SetType(?).SetLastId(?).SetLimit(?).SetStartAt(?).SetEndAt(?) + builder := order.NewGetOrderByClientOidReqBuilder() + builder.SetSymbol(?).SetClientOid(?) req := builder.Build() - resp, err := orderApi.GetClosedOrders(req, context.TODO()) + resp, err := orderApi.GetOrderByClientOid(req, context.TODO()) if err != nil { panic(err) } @@ -254,16 +254,16 @@ func TestOrderGetClosedOrdersReq(t *testing.T) { } -func TestOrderCancelOrderByOrderIdReq(t *testing.T) { - // CancelOrderByOrderId - // Cancel Order By OrderId - // /api/v3/hf/margin/orders/{orderId} +func TestOrderAddOrderV1Req(t *testing.T) { + // AddOrderV1 + // Add Order - V1 + // /api/v1/margin/order - builder := order.NewCancelOrderByOrderIdReqBuilder() - builder.SetOrderId(?).SetSymbol(?) + builder := order.NewAddOrderV1ReqBuilder() + builder.SetClientOid(?).SetSide(?).SetSymbol(?).SetType(?).SetStp(?).SetPrice(?).SetSize(?).SetTimeInForce(?).SetPostOnly(?).SetHidden(?).SetIceberg(?).SetVisibleSize(?).SetCancelAfter(?).SetFunds(?).SetAutoBorrow(?).SetAutoRepay(?).SetMarginModel(?) req := builder.Build() - resp, err := orderApi.CancelOrderByOrderId(req, context.TODO()) + resp, err := orderApi.AddOrderV1(req, context.TODO()) if err != nil { panic(err) } @@ -277,16 +277,16 @@ func TestOrderCancelOrderByOrderIdReq(t *testing.T) { } -func TestOrderGetOrderByOrderIdReq(t *testing.T) { - // GetOrderByOrderId - // Get Order By OrderId - // /api/v3/hf/margin/orders/{orderId} +func TestOrderAddOrderTestV1Req(t *testing.T) { + // AddOrderTestV1 + // Add Order Test - V1 + // /api/v1/margin/order/test - builder := order.NewGetOrderByOrderIdReqBuilder() - builder.SetSymbol(?).SetOrderId(?) + builder := order.NewAddOrderTestV1ReqBuilder() + builder.SetClientOid(?).SetSide(?).SetSymbol(?).SetType(?).SetStp(?).SetPrice(?).SetSize(?).SetTimeInForce(?).SetPostOnly(?).SetHidden(?).SetIceberg(?).SetVisibleSize(?).SetCancelAfter(?).SetFunds(?).SetAutoBorrow(?).SetAutoRepay(?).SetMarginModel(?) req := builder.Build() - resp, err := orderApi.GetOrderByOrderId(req, context.TODO()) + resp, err := orderApi.AddOrderTestV1(req, context.TODO()) if err != nil { panic(err) } diff --git a/sdk/golang/pkg/generate/margin/order/api_order_test.go b/sdk/golang/pkg/generate/margin/order/api_order_test.go index 9321d6e0..51e1856c 100644 --- a/sdk/golang/pkg/generate/margin/order/api_order_test.go +++ b/sdk/golang/pkg/generate/margin/order/api_order_test.go @@ -7,169 +7,169 @@ import ( "testing" ) -func TestOrderAddOrderV1ReqModel(t *testing.T) { - // AddOrderV1 - // Add Order - V1 - // /api/v1/margin/order +func TestOrderAddOrderReqModel(t *testing.T) { + // AddOrder + // Add Order + // /api/v3/hf/margin/order - data := "{\"type\": \"limit\", \"symbol\": \"BTC-USDT\", \"side\": \"buy\", \"price\": \"50000\", \"size\": \"0.00001\", \"clientOid\": \"5c52e11203aa677f33e4193fb\", \"remark\": \"order remarks\"}" - req := &AddOrderV1Req{} + data := "{\"type\": \"limit\", \"symbol\": \"BTC-USDT\", \"side\": \"buy\", \"price\": \"50000\", \"size\": \"0.00001\", \"clientOid\": \"5c52e11203aa677f33e493fb\", \"remark\": \"order remarks\"}" + req := &AddOrderReq{} err := json.Unmarshal([]byte(data), req) req.ToMap() assert.Nil(t, err) } -func TestOrderAddOrderV1RespModel(t *testing.T) { - // AddOrderV1 - // Add Order - V1 - // /api/v1/margin/order +func TestOrderAddOrderRespModel(t *testing.T) { + // AddOrder + // Add Order + // /api/v3/hf/margin/order - data := "{\n \"code\": \"200000\",\n \"data\": {\n \"orderId\": \"671bb90194422f00073ff4f0\",\n \"loanApplyId\": null,\n \"borrowSize\": null,\n \"clientOid\": null\n }\n}" + data := "{\n \"success\": true,\n \"code\": \"200000\",\n \"data\": {\n \"orderId\": \"671663e02188630007e21c9c\",\n \"clientOid\": \"5c52e11203aa677f33e1493fb\",\n \"borrowSize\": \"10.2\",\n \"loanApplyId\": \"600656d9a33ac90009de4f6f\"\n }\n}" commonResp := &types.RestResponse{} err := json.Unmarshal([]byte(data), commonResp) assert.Nil(t, err) assert.NotNil(t, commonResp.Data) - resp := &AddOrderV1Resp{} + resp := &AddOrderResp{} err = json.Unmarshal([]byte(commonResp.Data), resp) resp.ToMap() assert.Nil(t, err) } -func TestOrderAddOrderTestV1ReqModel(t *testing.T) { - // AddOrderTestV1 - // Add Order Test - V1 - // /api/v1/margin/order/test +func TestOrderAddOrderTestReqModel(t *testing.T) { + // AddOrderTest + // Add Order Test + // /api/v3/hf/margin/order/test - data := "{\"type\": \"limit\", \"symbol\": \"BTC-USDT\", \"side\": \"buy\", \"price\": \"50000\", \"size\": \"0.00001\", \"clientOid\": \"5c52e11203aa677f33e4193fb\", \"remark\": \"order remarks\"}" - req := &AddOrderTestV1Req{} + data := "{\"type\": \"limit\", \"symbol\": \"BTC-USDT\", \"side\": \"buy\", \"price\": \"50000\", \"size\": \"0.00001\", \"clientOid\": \"5c52e11203aa677f33e493fb\", \"remark\": \"order remarks\"}" + req := &AddOrderTestReq{} err := json.Unmarshal([]byte(data), req) req.ToMap() assert.Nil(t, err) } -func TestOrderAddOrderTestV1RespModel(t *testing.T) { - // AddOrderTestV1 - // Add Order Test - V1 - // /api/v1/margin/order/test +func TestOrderAddOrderTestRespModel(t *testing.T) { + // AddOrderTest + // Add Order Test + // /api/v3/hf/margin/order/test - data := "{\n \"code\": \"200000\",\n \"data\": {\n \"orderId\": \"671bb90194422f00073ff4f0\",\n \"loanApplyId\": null,\n \"borrowSize\": null,\n \"clientOid\": null\n }\n}" + data := "{\n \"success\": true,\n \"code\": \"200000\",\n \"data\": {\n \"orderId\": \"5bd6e9286d99522a52e458de\",\n \"clientOid\": \"5c52e11203aa677f33e493fb\",\n \"borrowSize\": 10.2,\n \"loanApplyId\": \"600656d9a33ac90009de4f6f\"\n }\n}" commonResp := &types.RestResponse{} err := json.Unmarshal([]byte(data), commonResp) assert.Nil(t, err) assert.NotNil(t, commonResp.Data) - resp := &AddOrderTestV1Resp{} + resp := &AddOrderTestResp{} err = json.Unmarshal([]byte(commonResp.Data), resp) resp.ToMap() assert.Nil(t, err) } -func TestOrderGetTradeHistoryReqModel(t *testing.T) { - // GetTradeHistory - // Get Trade History - // /api/v3/hf/margin/fills +func TestOrderCancelOrderByOrderIdReqModel(t *testing.T) { + // CancelOrderByOrderId + // Cancel Order By OrderId + // /api/v3/hf/margin/orders/{orderId} - data := "{\"symbol\": \"BTC-USDT\", \"tradeType\": \"MARGIN_TRADE\", \"orderId\": \"example_string_default_value\", \"side\": \"buy\", \"type\": \"limit\", \"lastId\": 254062248624417, \"limit\": 100, \"startAt\": 1728663338000, \"endAt\": 1728692138000}" - req := &GetTradeHistoryReq{} + data := "{\"orderId\": \"671663e02188630007e21c9c\", \"symbol\": \"BTC-USDT\"}" + req := &CancelOrderByOrderIdReq{} err := json.Unmarshal([]byte(data), req) req.ToMap() assert.Nil(t, err) } -func TestOrderGetTradeHistoryRespModel(t *testing.T) { - // GetTradeHistory - // Get Trade History - // /api/v3/hf/margin/fills +func TestOrderCancelOrderByOrderIdRespModel(t *testing.T) { + // CancelOrderByOrderId + // Cancel Order By OrderId + // /api/v3/hf/margin/orders/{orderId} - data := "{\n \"code\": \"200000\",\n \"data\": {\n \"items\": [\n {\n \"id\": 137891621991,\n \"symbol\": \"BTC-USDT\",\n \"tradeId\": 11040911994273793,\n \"orderId\": \"671868085584bc0007d85f46\",\n \"counterOrderId\": \"67186805b7cbdf00071621f9\",\n \"side\": \"buy\",\n \"liquidity\": \"taker\",\n \"forceTaker\": false,\n \"price\": \"67141.6\",\n \"size\": \"0.00001\",\n \"funds\": \"0.671416\",\n \"fee\": \"0.000671416\",\n \"feeRate\": \"0.001\",\n \"feeCurrency\": \"USDT\",\n \"stop\": \"\",\n \"tradeType\": \"MARGIN_TRADE\",\n \"tax\": \"0\",\n \"taxRate\": \"0\",\n \"type\": \"limit\",\n \"createdAt\": 1729652744998\n }\n ],\n \"lastId\": 137891621991\n }\n}" + data := "{\"code\":\"200000\",\"data\":{\"orderId\":\"671663e02188630007e21c9c\"}}" commonResp := &types.RestResponse{} err := json.Unmarshal([]byte(data), commonResp) assert.Nil(t, err) assert.NotNil(t, commonResp.Data) - resp := &GetTradeHistoryResp{} + resp := &CancelOrderByOrderIdResp{} err = json.Unmarshal([]byte(commonResp.Data), resp) resp.ToMap() assert.Nil(t, err) } -func TestOrderGetSymbolsWithOpenOrderReqModel(t *testing.T) { - // GetSymbolsWithOpenOrder - // Get Symbols With Open Order - // /api/v3/hf/margin/order/active/symbols +func TestOrderCancelOrderByClientOidReqModel(t *testing.T) { + // CancelOrderByClientOid + // Cancel Order By ClientOid + // /api/v3/hf/margin/orders/client-order/{clientOid} - data := "{\"tradeType\": \"MARGIN_TRADE\"}" - req := &GetSymbolsWithOpenOrderReq{} + data := "{\"clientOid\": \"5c52e11203aa677f33e1493fb\", \"symbol\": \"BTC-USDT\"}" + req := &CancelOrderByClientOidReq{} err := json.Unmarshal([]byte(data), req) req.ToMap() assert.Nil(t, err) } -func TestOrderGetSymbolsWithOpenOrderRespModel(t *testing.T) { - // GetSymbolsWithOpenOrder - // Get Symbols With Open Order - // /api/v3/hf/margin/order/active/symbols +func TestOrderCancelOrderByClientOidRespModel(t *testing.T) { + // CancelOrderByClientOid + // Cancel Order By ClientOid + // /api/v3/hf/margin/orders/client-order/{clientOid} - data := "{\n \"code\": \"200000\",\n \"data\": {\n \"symbolSize\": 1,\n \"symbols\": [\n \"BTC-USDT\"\n ]\n }\n}" + data := "{\"code\":\"200000\",\"data\":{\"clientOid\":\"5c52e11203aa677f33e1493fb\"}}" commonResp := &types.RestResponse{} err := json.Unmarshal([]byte(data), commonResp) assert.Nil(t, err) assert.NotNil(t, commonResp.Data) - resp := &GetSymbolsWithOpenOrderResp{} + resp := &CancelOrderByClientOidResp{} err = json.Unmarshal([]byte(commonResp.Data), resp) resp.ToMap() assert.Nil(t, err) } -func TestOrderAddOrderReqModel(t *testing.T) { - // AddOrder - // Add Order - // /api/v3/hf/margin/order +func TestOrderCancelAllOrdersBySymbolReqModel(t *testing.T) { + // CancelAllOrdersBySymbol + // Cancel All Orders By Symbol + // /api/v3/hf/margin/orders - data := "{\"type\": \"limit\", \"symbol\": \"BTC-USDT\", \"side\": \"buy\", \"price\": \"50000\", \"size\": \"0.00001\", \"clientOid\": \"5c52e11203aa677f33e493fb\", \"remark\": \"order remarks\"}" - req := &AddOrderReq{} + data := "{\"symbol\": \"BTC-USDT\", \"tradeType\": \"MARGIN_TRADE\"}" + req := &CancelAllOrdersBySymbolReq{} err := json.Unmarshal([]byte(data), req) req.ToMap() assert.Nil(t, err) } -func TestOrderAddOrderRespModel(t *testing.T) { - // AddOrder - // Add Order - // /api/v3/hf/margin/order +func TestOrderCancelAllOrdersBySymbolRespModel(t *testing.T) { + // CancelAllOrdersBySymbol + // Cancel All Orders By Symbol + // /api/v3/hf/margin/orders - data := "{\n \"success\": true,\n \"code\": \"200000\",\n \"data\": {\n \"orderId\": \"671663e02188630007e21c9c\",\n \"clientOid\": \"5c52e11203aa677f33e1493fb\",\n \"borrowSize\": \"10.2\",\n \"loanApplyId\": \"600656d9a33ac90009de4f6f\"\n }\n}" + data := "{\"code\":\"200000\",\"data\":\"success\"}" commonResp := &types.RestResponse{} err := json.Unmarshal([]byte(data), commonResp) assert.Nil(t, err) assert.NotNil(t, commonResp.Data) - resp := &AddOrderResp{} + resp := &CancelAllOrdersBySymbolResp{} err = json.Unmarshal([]byte(commonResp.Data), resp) resp.ToMap() assert.Nil(t, err) } -func TestOrderAddOrderTestReqModel(t *testing.T) { - // AddOrderTest - // Add Order Test - // /api/v3/hf/margin/order/test +func TestOrderGetSymbolsWithOpenOrderReqModel(t *testing.T) { + // GetSymbolsWithOpenOrder + // Get Symbols With Open Order + // /api/v3/hf/margin/order/active/symbols - data := "{\"type\": \"limit\", \"symbol\": \"BTC-USDT\", \"side\": \"buy\", \"price\": \"50000\", \"size\": \"0.00001\", \"clientOid\": \"5c52e11203aa677f33e493fb\", \"remark\": \"order remarks\"}" - req := &AddOrderTestReq{} + data := "{\"tradeType\": \"MARGIN_TRADE\"}" + req := &GetSymbolsWithOpenOrderReq{} err := json.Unmarshal([]byte(data), req) req.ToMap() assert.Nil(t, err) } -func TestOrderAddOrderTestRespModel(t *testing.T) { - // AddOrderTest - // Add Order Test - // /api/v3/hf/margin/order/test +func TestOrderGetSymbolsWithOpenOrderRespModel(t *testing.T) { + // GetSymbolsWithOpenOrder + // Get Symbols With Open Order + // /api/v3/hf/margin/order/active/symbols - data := "{\n \"success\": true,\n \"code\": \"200000\",\n \"data\": {\n \"orderId\": \"5bd6e9286d99522a52e458de\",\n \"clientOid\": \"5c52e11203aa677f33e493fb\",\n \"borrowSize\": 10.2,\n \"loanApplyId\": \"600656d9a33ac90009de4f6f\"\n }\n}" + data := "{\n \"code\": \"200000\",\n \"data\": {\n \"symbolSize\": 1,\n \"symbols\": [\n \"BTC-USDT\"\n ]\n }\n}" commonResp := &types.RestResponse{} err := json.Unmarshal([]byte(data), commonResp) assert.Nil(t, err) assert.NotNil(t, commonResp.Data) - resp := &AddOrderTestResp{} + resp := &GetSymbolsWithOpenOrderResp{} err = json.Unmarshal([]byte(commonResp.Data), resp) resp.ToMap() assert.Nil(t, err) @@ -203,169 +203,169 @@ func TestOrderGetOpenOrdersRespModel(t *testing.T) { assert.Nil(t, err) } -func TestOrderCancelOrderByClientOidReqModel(t *testing.T) { - // CancelOrderByClientOid - // Cancel Order By ClientOid - // /api/v3/hf/margin/orders/client-order/{clientOid} +func TestOrderGetClosedOrdersReqModel(t *testing.T) { + // GetClosedOrders + // Get Closed Orders + // /api/v3/hf/margin/orders/done - data := "{\"clientOid\": \"5c52e11203aa677f33e1493fb\", \"symbol\": \"BTC-USDT\"}" - req := &CancelOrderByClientOidReq{} + data := "{\"symbol\": \"BTC-USDT\", \"tradeType\": \"MARGIN_TRADE\", \"side\": \"buy\", \"type\": \"limit\", \"lastId\": 254062248624417, \"limit\": 20, \"startAt\": 1728663338000, \"endAt\": 1728692138000}" + req := &GetClosedOrdersReq{} err := json.Unmarshal([]byte(data), req) req.ToMap() assert.Nil(t, err) } -func TestOrderCancelOrderByClientOidRespModel(t *testing.T) { - // CancelOrderByClientOid - // Cancel Order By ClientOid - // /api/v3/hf/margin/orders/client-order/{clientOid} +func TestOrderGetClosedOrdersRespModel(t *testing.T) { + // GetClosedOrders + // Get Closed Orders + // /api/v3/hf/margin/orders/done - data := "{\"code\":\"200000\",\"data\":{\"clientOid\":\"5c52e11203aa677f33e1493fb\"}}" + data := "{\n \"code\": \"200000\",\n \"data\": {\n \"lastId\": 136112949351,\n \"items\": [\n {\n \"id\": \"6716491f6afcdb00078365c8\",\n \"clientOid\": \"5c52e11203aa677f33e493fb\",\n \"symbol\": \"BTC-USDT\",\n \"opType\": \"DEAL\",\n \"type\": \"limit\",\n \"side\": \"buy\",\n \"price\": \"50000\",\n \"size\": \"0.00001\",\n \"funds\": \"0.5\",\n \"dealSize\": \"0\",\n \"dealFunds\": \"0\",\n \"remainSize\": \"0\",\n \"remainFunds\": \"0\",\n \"cancelledSize\": \"0.00001\",\n \"cancelledFunds\": \"0.5\",\n \"fee\": \"0\",\n \"feeCurrency\": \"USDT\",\n \"stp\": null,\n \"stop\": null,\n \"stopTriggered\": false,\n \"stopPrice\": \"0\",\n \"timeInForce\": \"GTC\",\n \"postOnly\": false,\n \"hidden\": false,\n \"iceberg\": false,\n \"visibleSize\": \"0\",\n \"cancelAfter\": 0,\n \"channel\": \"API\",\n \"remark\": null,\n \"tags\": null,\n \"cancelExist\": true,\n \"tradeType\": \"MARGIN_TRADE\",\n \"inOrderBook\": false,\n \"active\": false,\n \"tax\": \"0\",\n \"createdAt\": 1729513759162,\n \"lastUpdatedAt\": 1729521126597\n }\n ]\n }\n}" commonResp := &types.RestResponse{} err := json.Unmarshal([]byte(data), commonResp) assert.Nil(t, err) assert.NotNil(t, commonResp.Data) - resp := &CancelOrderByClientOidResp{} + resp := &GetClosedOrdersResp{} err = json.Unmarshal([]byte(commonResp.Data), resp) resp.ToMap() assert.Nil(t, err) } -func TestOrderGetOrderByClientOidReqModel(t *testing.T) { - // GetOrderByClientOid - // Get Order By ClientOid - // /api/v3/hf/margin/orders/client-order/{clientOid} +func TestOrderGetTradeHistoryReqModel(t *testing.T) { + // GetTradeHistory + // Get Trade History + // /api/v3/hf/margin/fills - data := "{\"symbol\": \"BTC-USDT\", \"clientOid\": \"5c52e11203aa677f33e493fb\"}" - req := &GetOrderByClientOidReq{} + data := "{\"symbol\": \"BTC-USDT\", \"tradeType\": \"MARGIN_TRADE\", \"orderId\": \"example_string_default_value\", \"side\": \"buy\", \"type\": \"limit\", \"lastId\": 254062248624417, \"limit\": 100, \"startAt\": 1728663338000, \"endAt\": 1728692138000}" + req := &GetTradeHistoryReq{} err := json.Unmarshal([]byte(data), req) req.ToMap() assert.Nil(t, err) } -func TestOrderGetOrderByClientOidRespModel(t *testing.T) { - // GetOrderByClientOid - // Get Order By ClientOid - // /api/v3/hf/margin/orders/client-order/{clientOid} +func TestOrderGetTradeHistoryRespModel(t *testing.T) { + // GetTradeHistory + // Get Trade History + // /api/v3/hf/margin/fills - data := "{\n \"code\": \"200000\",\n \"data\": {\n \"id\": \"671667306afcdb000723107f\",\n \"symbol\": \"BTC-USDT\",\n \"opType\": \"DEAL\",\n \"type\": \"limit\",\n \"side\": \"buy\",\n \"price\": \"50000\",\n \"size\": \"0.00001\",\n \"funds\": \"0.5\",\n \"dealSize\": \"0\",\n \"dealFunds\": \"0\",\n \"fee\": \"0\",\n \"feeCurrency\": \"USDT\",\n \"stp\": null,\n \"stop\": null,\n \"stopTriggered\": false,\n \"stopPrice\": \"0\",\n \"timeInForce\": \"GTC\",\n \"postOnly\": false,\n \"hidden\": false,\n \"iceberg\": false,\n \"visibleSize\": \"0\",\n \"cancelAfter\": 0,\n \"channel\": \"API\",\n \"clientOid\": \"5c52e11203aa677f33e493fb\",\n \"remark\": null,\n \"tags\": null,\n \"cancelExist\": false,\n \"createdAt\": 1729521456248,\n \"lastUpdatedAt\": 1729651011877,\n \"tradeType\": \"MARGIN_TRADE\",\n \"inOrderBook\": true,\n \"cancelledSize\": \"0\",\n \"cancelledFunds\": \"0\",\n \"remainSize\": \"0.00001\",\n \"remainFunds\": \"0.5\",\n \"tax\": \"0\",\n \"active\": true\n }\n}" + data := "{\n \"code\": \"200000\",\n \"data\": {\n \"items\": [\n {\n \"id\": 137891621991,\n \"symbol\": \"BTC-USDT\",\n \"tradeId\": 11040911994273793,\n \"orderId\": \"671868085584bc0007d85f46\",\n \"counterOrderId\": \"67186805b7cbdf00071621f9\",\n \"side\": \"buy\",\n \"liquidity\": \"taker\",\n \"forceTaker\": false,\n \"price\": \"67141.6\",\n \"size\": \"0.00001\",\n \"funds\": \"0.671416\",\n \"fee\": \"0.000671416\",\n \"feeRate\": \"0.001\",\n \"feeCurrency\": \"USDT\",\n \"stop\": \"\",\n \"tradeType\": \"MARGIN_TRADE\",\n \"tax\": \"0\",\n \"taxRate\": \"0\",\n \"type\": \"limit\",\n \"createdAt\": 1729652744998\n }\n ],\n \"lastId\": 137891621991\n }\n}" commonResp := &types.RestResponse{} err := json.Unmarshal([]byte(data), commonResp) assert.Nil(t, err) assert.NotNil(t, commonResp.Data) - resp := &GetOrderByClientOidResp{} + resp := &GetTradeHistoryResp{} err = json.Unmarshal([]byte(commonResp.Data), resp) resp.ToMap() assert.Nil(t, err) } -func TestOrderCancelAllOrdersBySymbolReqModel(t *testing.T) { - // CancelAllOrdersBySymbol - // Cancel All Orders By Symbol - // /api/v3/hf/margin/orders +func TestOrderGetOrderByOrderIdReqModel(t *testing.T) { + // GetOrderByOrderId + // Get Order By OrderId + // /api/v3/hf/margin/orders/{orderId} - data := "{\"symbol\": \"BTC-USDT\", \"tradeType\": \"MARGIN_TRADE\"}" - req := &CancelAllOrdersBySymbolReq{} + data := "{\"symbol\": \"BTC-USDT\", \"orderId\": \"671667306afcdb000723107f\"}" + req := &GetOrderByOrderIdReq{} err := json.Unmarshal([]byte(data), req) req.ToMap() assert.Nil(t, err) } -func TestOrderCancelAllOrdersBySymbolRespModel(t *testing.T) { - // CancelAllOrdersBySymbol - // Cancel All Orders By Symbol - // /api/v3/hf/margin/orders +func TestOrderGetOrderByOrderIdRespModel(t *testing.T) { + // GetOrderByOrderId + // Get Order By OrderId + // /api/v3/hf/margin/orders/{orderId} - data := "{\"code\":\"200000\",\"data\":\"success\"}" + data := "{\n \"code\": \"200000\",\n \"data\": {\n \"id\": \"671667306afcdb000723107f\",\n \"symbol\": \"BTC-USDT\",\n \"opType\": \"DEAL\",\n \"type\": \"limit\",\n \"side\": \"buy\",\n \"price\": \"50000\",\n \"size\": \"0.00001\",\n \"funds\": \"0.5\",\n \"dealSize\": \"0\",\n \"dealFunds\": \"0\",\n \"fee\": \"0\",\n \"feeCurrency\": \"USDT\",\n \"stp\": null,\n \"stop\": null,\n \"stopTriggered\": false,\n \"stopPrice\": \"0\",\n \"timeInForce\": \"GTC\",\n \"postOnly\": false,\n \"hidden\": false,\n \"iceberg\": false,\n \"visibleSize\": \"0\",\n \"cancelAfter\": 0,\n \"channel\": \"API\",\n \"clientOid\": \"5c52e11203aa677f33e493fb\",\n \"remark\": null,\n \"tags\": null,\n \"cancelExist\": false,\n \"createdAt\": 1729521456248,\n \"lastUpdatedAt\": 1729651011877,\n \"tradeType\": \"MARGIN_TRADE\",\n \"inOrderBook\": true,\n \"cancelledSize\": \"0\",\n \"cancelledFunds\": \"0\",\n \"remainSize\": \"0.00001\",\n \"remainFunds\": \"0.5\",\n \"tax\": \"0\",\n \"active\": true\n }\n}" commonResp := &types.RestResponse{} err := json.Unmarshal([]byte(data), commonResp) assert.Nil(t, err) assert.NotNil(t, commonResp.Data) - resp := &CancelAllOrdersBySymbolResp{} + resp := &GetOrderByOrderIdResp{} err = json.Unmarshal([]byte(commonResp.Data), resp) resp.ToMap() assert.Nil(t, err) } -func TestOrderGetClosedOrdersReqModel(t *testing.T) { - // GetClosedOrders - // Get Closed Orders - // /api/v3/hf/margin/orders/done +func TestOrderGetOrderByClientOidReqModel(t *testing.T) { + // GetOrderByClientOid + // Get Order By ClientOid + // /api/v3/hf/margin/orders/client-order/{clientOid} - data := "{\"symbol\": \"BTC-USDT\", \"tradeType\": \"MARGIN_TRADE\", \"side\": \"buy\", \"type\": \"limit\", \"lastId\": 254062248624417, \"limit\": 20, \"startAt\": 1728663338000, \"endAt\": 1728692138000}" - req := &GetClosedOrdersReq{} + data := "{\"symbol\": \"BTC-USDT\", \"clientOid\": \"5c52e11203aa677f33e493fb\"}" + req := &GetOrderByClientOidReq{} err := json.Unmarshal([]byte(data), req) req.ToMap() assert.Nil(t, err) } -func TestOrderGetClosedOrdersRespModel(t *testing.T) { - // GetClosedOrders - // Get Closed Orders - // /api/v3/hf/margin/orders/done +func TestOrderGetOrderByClientOidRespModel(t *testing.T) { + // GetOrderByClientOid + // Get Order By ClientOid + // /api/v3/hf/margin/orders/client-order/{clientOid} - data := "{\n \"code\": \"200000\",\n \"data\": {\n \"lastId\": 136112949351,\n \"items\": [\n {\n \"id\": \"6716491f6afcdb00078365c8\",\n \"clientOid\": \"5c52e11203aa677f33e493fb\",\n \"symbol\": \"BTC-USDT\",\n \"opType\": \"DEAL\",\n \"type\": \"limit\",\n \"side\": \"buy\",\n \"price\": \"50000\",\n \"size\": \"0.00001\",\n \"funds\": \"0.5\",\n \"dealSize\": \"0\",\n \"dealFunds\": \"0\",\n \"remainSize\": \"0\",\n \"remainFunds\": \"0\",\n \"cancelledSize\": \"0.00001\",\n \"cancelledFunds\": \"0.5\",\n \"fee\": \"0\",\n \"feeCurrency\": \"USDT\",\n \"stp\": null,\n \"stop\": null,\n \"stopTriggered\": false,\n \"stopPrice\": \"0\",\n \"timeInForce\": \"GTC\",\n \"postOnly\": false,\n \"hidden\": false,\n \"iceberg\": false,\n \"visibleSize\": \"0\",\n \"cancelAfter\": 0,\n \"channel\": \"API\",\n \"remark\": null,\n \"tags\": null,\n \"cancelExist\": true,\n \"tradeType\": \"MARGIN_TRADE\",\n \"inOrderBook\": false,\n \"active\": false,\n \"tax\": \"0\",\n \"createdAt\": 1729513759162,\n \"lastUpdatedAt\": 1729521126597\n }\n ]\n }\n}" + data := "{\n \"code\": \"200000\",\n \"data\": {\n \"id\": \"671667306afcdb000723107f\",\n \"symbol\": \"BTC-USDT\",\n \"opType\": \"DEAL\",\n \"type\": \"limit\",\n \"side\": \"buy\",\n \"price\": \"50000\",\n \"size\": \"0.00001\",\n \"funds\": \"0.5\",\n \"dealSize\": \"0\",\n \"dealFunds\": \"0\",\n \"fee\": \"0\",\n \"feeCurrency\": \"USDT\",\n \"stp\": null,\n \"stop\": null,\n \"stopTriggered\": false,\n \"stopPrice\": \"0\",\n \"timeInForce\": \"GTC\",\n \"postOnly\": false,\n \"hidden\": false,\n \"iceberg\": false,\n \"visibleSize\": \"0\",\n \"cancelAfter\": 0,\n \"channel\": \"API\",\n \"clientOid\": \"5c52e11203aa677f33e493fb\",\n \"remark\": null,\n \"tags\": null,\n \"cancelExist\": false,\n \"createdAt\": 1729521456248,\n \"lastUpdatedAt\": 1729651011877,\n \"tradeType\": \"MARGIN_TRADE\",\n \"inOrderBook\": true,\n \"cancelledSize\": \"0\",\n \"cancelledFunds\": \"0\",\n \"remainSize\": \"0.00001\",\n \"remainFunds\": \"0.5\",\n \"tax\": \"0\",\n \"active\": true\n }\n}" commonResp := &types.RestResponse{} err := json.Unmarshal([]byte(data), commonResp) assert.Nil(t, err) assert.NotNil(t, commonResp.Data) - resp := &GetClosedOrdersResp{} + resp := &GetOrderByClientOidResp{} err = json.Unmarshal([]byte(commonResp.Data), resp) resp.ToMap() assert.Nil(t, err) } -func TestOrderCancelOrderByOrderIdReqModel(t *testing.T) { - // CancelOrderByOrderId - // Cancel Order By OrderId - // /api/v3/hf/margin/orders/{orderId} +func TestOrderAddOrderV1ReqModel(t *testing.T) { + // AddOrderV1 + // Add Order - V1 + // /api/v1/margin/order - data := "{\"orderId\": \"671663e02188630007e21c9c\", \"symbol\": \"BTC-USDT\"}" - req := &CancelOrderByOrderIdReq{} + data := "{\"type\": \"limit\", \"symbol\": \"BTC-USDT\", \"side\": \"buy\", \"price\": \"50000\", \"size\": \"0.00001\", \"clientOid\": \"5c52e11203aa677f33e4193fb\", \"remark\": \"order remarks\"}" + req := &AddOrderV1Req{} err := json.Unmarshal([]byte(data), req) req.ToMap() assert.Nil(t, err) } -func TestOrderCancelOrderByOrderIdRespModel(t *testing.T) { - // CancelOrderByOrderId - // Cancel Order By OrderId - // /api/v3/hf/margin/orders/{orderId} +func TestOrderAddOrderV1RespModel(t *testing.T) { + // AddOrderV1 + // Add Order - V1 + // /api/v1/margin/order - data := "{\"code\":\"200000\",\"data\":{\"orderId\":\"671663e02188630007e21c9c\"}}" + data := "{\n \"code\": \"200000\",\n \"data\": {\n \"orderId\": \"671bb90194422f00073ff4f0\",\n \"loanApplyId\": null,\n \"borrowSize\": null,\n \"clientOid\": null\n }\n}" commonResp := &types.RestResponse{} err := json.Unmarshal([]byte(data), commonResp) assert.Nil(t, err) assert.NotNil(t, commonResp.Data) - resp := &CancelOrderByOrderIdResp{} + resp := &AddOrderV1Resp{} err = json.Unmarshal([]byte(commonResp.Data), resp) resp.ToMap() assert.Nil(t, err) } -func TestOrderGetOrderByOrderIdReqModel(t *testing.T) { - // GetOrderByOrderId - // Get Order By OrderId - // /api/v3/hf/margin/orders/{orderId} +func TestOrderAddOrderTestV1ReqModel(t *testing.T) { + // AddOrderTestV1 + // Add Order Test - V1 + // /api/v1/margin/order/test - data := "{\"symbol\": \"BTC-USDT\", \"orderId\": \"671667306afcdb000723107f\"}" - req := &GetOrderByOrderIdReq{} + data := "{\"type\": \"limit\", \"symbol\": \"BTC-USDT\", \"side\": \"buy\", \"price\": \"50000\", \"size\": \"0.00001\", \"clientOid\": \"5c52e11203aa677f33e4193fb\", \"remark\": \"order remarks\"}" + req := &AddOrderTestV1Req{} err := json.Unmarshal([]byte(data), req) req.ToMap() assert.Nil(t, err) } -func TestOrderGetOrderByOrderIdRespModel(t *testing.T) { - // GetOrderByOrderId - // Get Order By OrderId - // /api/v3/hf/margin/orders/{orderId} +func TestOrderAddOrderTestV1RespModel(t *testing.T) { + // AddOrderTestV1 + // Add Order Test - V1 + // /api/v1/margin/order/test - data := "{\n \"code\": \"200000\",\n \"data\": {\n \"id\": \"671667306afcdb000723107f\",\n \"symbol\": \"BTC-USDT\",\n \"opType\": \"DEAL\",\n \"type\": \"limit\",\n \"side\": \"buy\",\n \"price\": \"50000\",\n \"size\": \"0.00001\",\n \"funds\": \"0.5\",\n \"dealSize\": \"0\",\n \"dealFunds\": \"0\",\n \"fee\": \"0\",\n \"feeCurrency\": \"USDT\",\n \"stp\": null,\n \"stop\": null,\n \"stopTriggered\": false,\n \"stopPrice\": \"0\",\n \"timeInForce\": \"GTC\",\n \"postOnly\": false,\n \"hidden\": false,\n \"iceberg\": false,\n \"visibleSize\": \"0\",\n \"cancelAfter\": 0,\n \"channel\": \"API\",\n \"clientOid\": \"5c52e11203aa677f33e493fb\",\n \"remark\": null,\n \"tags\": null,\n \"cancelExist\": false,\n \"createdAt\": 1729521456248,\n \"lastUpdatedAt\": 1729651011877,\n \"tradeType\": \"MARGIN_TRADE\",\n \"inOrderBook\": true,\n \"cancelledSize\": \"0\",\n \"cancelledFunds\": \"0\",\n \"remainSize\": \"0.00001\",\n \"remainFunds\": \"0.5\",\n \"tax\": \"0\",\n \"active\": true\n }\n}" + data := "{\n \"code\": \"200000\",\n \"data\": {\n \"orderId\": \"671bb90194422f00073ff4f0\",\n \"loanApplyId\": null,\n \"borrowSize\": null,\n \"clientOid\": null\n }\n}" commonResp := &types.RestResponse{} err := json.Unmarshal([]byte(data), commonResp) assert.Nil(t, err) assert.NotNil(t, commonResp.Data) - resp := &GetOrderByOrderIdResp{} + resp := &AddOrderTestV1Resp{} err = json.Unmarshal([]byte(commonResp.Data), resp) resp.ToMap() assert.Nil(t, err) diff --git a/sdk/golang/pkg/generate/spot/market/api_market.go b/sdk/golang/pkg/generate/spot/market/api_market.go index 49e95970..22cfddb0 100644 --- a/sdk/golang/pkg/generate/spot/market/api_market.go +++ b/sdk/golang/pkg/generate/spot/market/api_market.go @@ -9,23 +9,9 @@ import ( type MarketAPI interface { - // GetPrivateToken Get Private Token - Spot/Margin - // Description: This interface can obtain the token required for websocket to establish a Spot/Margin private connection. If you need use private channels(e.g. account balance notice), please make request as follows to obtain the server list and private token - // Documentation: https://www.kucoin.com/docs-new/api-3470295 - // +---------------------+---------+ - // | Extra API Info | Value | - // +---------------------+---------+ - // | API-DOMAIN | SPOT | - // | API-CHANNEL | PRIVATE | - // | API-PERMISSION | GENERAL | - // | API-RATE-LIMIT-POOL | SPOT | - // | API-RATE-LIMIT | 10 | - // +---------------------+---------+ - GetPrivateToken(ctx context.Context) (*GetPrivateTokenResp, error) - - // GetPublicToken Get Public Token - Spot/Margin - // Description: This interface can obtain the token required for websocket to establish a Spot/Margin connection. If you need use public channels (e.g. all public market data), please make request as follows to obtain the server list and public token - // Documentation: https://www.kucoin.com/docs-new/api-3470294 + // GetAnnouncements Get Announcements + // Description: This interface can obtain the latest news announcements, and the default page search is for announcements within a month. + // Documentation: https://www.kucoin.com/docs-new/api-3470157 // +---------------------+--------+ // | Extra API Info | Value | // +---------------------+--------+ @@ -33,13 +19,13 @@ type MarketAPI interface { // | API-CHANNEL | PUBLIC | // | API-PERMISSION | NULL | // | API-RATE-LIMIT-POOL | PUBLIC | - // | API-RATE-LIMIT | 10 | + // | API-RATE-LIMIT | 20 | // +---------------------+--------+ - GetPublicToken(ctx context.Context) (*GetPublicTokenResp, error) + GetAnnouncements(req *GetAnnouncementsReq, ctx context.Context) (*GetAnnouncementsResp, error) - // GetAllTickers Get All Tickers - // Description: Request market tickers for all the trading pairs in the market (including 24h volume), takes a snapshot every 2 seconds. On the rare occasion that we will change the currency name, if you still want the changed symbol name, you can use the symbolName field instead of the symbol field via “Get all tickers” endpoint. - // Documentation: https://www.kucoin.com/docs-new/api-3470167 + // GetCurrency Get Currency + // Description: Request via this endpoint to get the currency details of a specified currency + // Documentation: https://www.kucoin.com/docs-new/api-3470155 // +---------------------+--------+ // | Extra API Info | Value | // +---------------------+--------+ @@ -47,13 +33,13 @@ type MarketAPI interface { // | API-CHANNEL | PUBLIC | // | API-PERMISSION | NULL | // | API-RATE-LIMIT-POOL | PUBLIC | - // | API-RATE-LIMIT | 15 | + // | API-RATE-LIMIT | 3 | // +---------------------+--------+ - GetAllTickers(ctx context.Context) (*GetAllTickersResp, error) + GetCurrency(req *GetCurrencyReq, ctx context.Context) (*GetCurrencyResp, error) - // GetKlines Get Klines - // Description: Get the Kline of the symbol. Data are returned in grouped buckets based on requested type. For each query, the system would return at most 1500 pieces of data. To obtain more data, please page the data by time. - // Documentation: https://www.kucoin.com/docs-new/api-3470163 + // GetAllCurrencies Get All Currencies + // Description: Request via this endpoint to get the currency list.Not all currencies currently can be used for trading. + // Documentation: https://www.kucoin.com/docs-new/api-3470152 // +---------------------+--------+ // | Extra API Info | Value | // +---------------------+--------+ @@ -63,11 +49,11 @@ type MarketAPI interface { // | API-RATE-LIMIT-POOL | PUBLIC | // | API-RATE-LIMIT | 3 | // +---------------------+--------+ - GetKlines(req *GetKlinesReq, ctx context.Context) (*GetKlinesResp, error) + GetAllCurrencies(ctx context.Context) (*GetAllCurrenciesResp, error) - // GetTradeHistory Get Trade History - // Description: Request via this endpoint to get the trade history of the specified symbol, the returned quantity is the last 100 transaction records. - // Documentation: https://www.kucoin.com/docs-new/api-3470162 + // GetSymbol Get Symbol + // Description: Request via this endpoint to get detail currency pairs for trading. If you want to get the market information of the trading symbol, please use Get All Tickers. + // Documentation: https://www.kucoin.com/docs-new/api-3470159 // +---------------------+--------+ // | Extra API Info | Value | // +---------------------+--------+ @@ -75,13 +61,13 @@ type MarketAPI interface { // | API-CHANNEL | PUBLIC | // | API-PERMISSION | NULL | // | API-RATE-LIMIT-POOL | PUBLIC | - // | API-RATE-LIMIT | 3 | + // | API-RATE-LIMIT | 4 | // +---------------------+--------+ - GetTradeHistory(req *GetTradeHistoryReq, ctx context.Context) (*GetTradeHistoryResp, error) + GetSymbol(req *GetSymbolReq, ctx context.Context) (*GetSymbolResp, error) - // GetTicker Get Ticker - // Description: Request via this endpoint to get Level 1 Market Data. The returned value includes the best bid price and size, the best ask price and size as well as the last traded price and the last traded size. - // Documentation: https://www.kucoin.com/docs-new/api-3470160 + // GetAllSymbols Get All Symbols + // Description: Request via this endpoint to get a list of available currency pairs for trading. If you want to get the market information of the trading symbol, please use Get All Tickers. + // Documentation: https://www.kucoin.com/docs-new/api-3470154 // +---------------------+--------+ // | Extra API Info | Value | // +---------------------+--------+ @@ -89,13 +75,13 @@ type MarketAPI interface { // | API-CHANNEL | PUBLIC | // | API-PERMISSION | NULL | // | API-RATE-LIMIT-POOL | PUBLIC | - // | API-RATE-LIMIT | 2 | + // | API-RATE-LIMIT | 4 | // +---------------------+--------+ - GetTicker(req *GetTickerReq, ctx context.Context) (*GetTickerResp, error) + GetAllSymbols(req *GetAllSymbolsReq, ctx context.Context) (*GetAllSymbolsResp, error) - // GetPartOrderBook Get Part OrderBook - // Description: Query for part orderbook depth data. (aggregated by price) You are recommended to request via this endpoint as the system reponse would be faster and cosume less traffic. - // Documentation: https://www.kucoin.com/docs-new/api-3470165 + // GetTicker Get Ticker + // Description: Request via this endpoint to get Level 1 Market Data. The returned value includes the best bid price and size, the best ask price and size as well as the last traded price and the last traded size. + // Documentation: https://www.kucoin.com/docs-new/api-3470160 // +---------------------+--------+ // | Extra API Info | Value | // +---------------------+--------+ @@ -105,11 +91,11 @@ type MarketAPI interface { // | API-RATE-LIMIT-POOL | PUBLIC | // | API-RATE-LIMIT | 2 | // +---------------------+--------+ - GetPartOrderBook(req *GetPartOrderBookReq, ctx context.Context) (*GetPartOrderBookResp, error) + GetTicker(req *GetTickerReq, ctx context.Context) (*GetTickerResp, error) - // Get24hrStats Get 24hr Stats - // Description: Request via this endpoint to get the statistics of the specified ticker in the last 24 hours. - // Documentation: https://www.kucoin.com/docs-new/api-3470161 + // GetAllTickers Get All Tickers + // Description: Request market tickers for all the trading pairs in the market (including 24h volume), takes a snapshot every 2 seconds. On the rare occasion that we will change the currency name, if you still want the changed symbol name, you can use the symbolName field instead of the symbol field via “Get all tickers” endpoint. + // Documentation: https://www.kucoin.com/docs-new/api-3470167 // +---------------------+--------+ // | Extra API Info | Value | // +---------------------+--------+ @@ -119,11 +105,11 @@ type MarketAPI interface { // | API-RATE-LIMIT-POOL | PUBLIC | // | API-RATE-LIMIT | 15 | // +---------------------+--------+ - Get24hrStats(req *Get24hrStatsReq, ctx context.Context) (*Get24hrStatsResp, error) + GetAllTickers(ctx context.Context) (*GetAllTickersResp, error) - // GetMarketList Get Market List - // Description: Request via this endpoint to get the transaction currency for the entire trading market. - // Documentation: https://www.kucoin.com/docs-new/api-3470166 + // GetTradeHistory Get Trade History + // Description: Request via this endpoint to get the trade history of the specified symbol, the returned quantity is the last 100 transaction records. + // Documentation: https://www.kucoin.com/docs-new/api-3470162 // +---------------------+--------+ // | Extra API Info | Value | // +---------------------+--------+ @@ -133,11 +119,11 @@ type MarketAPI interface { // | API-RATE-LIMIT-POOL | PUBLIC | // | API-RATE-LIMIT | 3 | // +---------------------+--------+ - GetMarketList(ctx context.Context) (*GetMarketListResp, error) + GetTradeHistory(req *GetTradeHistoryReq, ctx context.Context) (*GetTradeHistoryResp, error) - // GetFiatPrice Get Fiat Price - // Description: Request via this endpoint to get the fiat price of the currencies for the available trading pairs. - // Documentation: https://www.kucoin.com/docs-new/api-3470153 + // GetKlines Get Klines + // Description: Get the Kline of the symbol. Data are returned in grouped buckets based on requested type. For each query, the system would return at most 1500 pieces of data. To obtain more data, please page the data by time. + // Documentation: https://www.kucoin.com/docs-new/api-3470163 // +---------------------+--------+ // | Extra API Info | Value | // +---------------------+--------+ @@ -147,11 +133,11 @@ type MarketAPI interface { // | API-RATE-LIMIT-POOL | PUBLIC | // | API-RATE-LIMIT | 3 | // +---------------------+--------+ - GetFiatPrice(req *GetFiatPriceReq, ctx context.Context) (*GetFiatPriceResp, error) + GetKlines(req *GetKlinesReq, ctx context.Context) (*GetKlinesResp, error) - // GetServiceStatus Get Service Status - // Description: Get the service status - // Documentation: https://www.kucoin.com/docs-new/api-3470158 + // GetPartOrderBook Get Part OrderBook + // Description: Query for part orderbook depth data. (aggregated by price) You are recommended to request via this endpoint as the system reponse would be faster and cosume less traffic. + // Documentation: https://www.kucoin.com/docs-new/api-3470165 // +---------------------+--------+ // | Extra API Info | Value | // +---------------------+--------+ @@ -159,13 +145,27 @@ type MarketAPI interface { // | API-CHANNEL | PUBLIC | // | API-PERMISSION | NULL | // | API-RATE-LIMIT-POOL | PUBLIC | - // | API-RATE-LIMIT | 3 | + // | API-RATE-LIMIT | 2 | // +---------------------+--------+ - GetServiceStatus(ctx context.Context) (*GetServiceStatusResp, error) + GetPartOrderBook(req *GetPartOrderBookReq, ctx context.Context) (*GetPartOrderBookResp, error) - // GetServerTime Get Server Time - // Description: Get the server time. - // Documentation: https://www.kucoin.com/docs-new/api-3470156 + // GetFullOrderBook Get Full OrderBook + // Description: Query for Full orderbook depth data. (aggregated by price) It is generally used by professional traders because it uses more server resources and traffic, and we have strict access rate limit control. To maintain up-to-date Order Book, please use Websocket incremental feed after retrieving the OrderBook. + // Documentation: https://www.kucoin.com/docs-new/api-3470164 + // +---------------------+---------+ + // | Extra API Info | Value | + // +---------------------+---------+ + // | API-DOMAIN | SPOT | + // | API-CHANNEL | PRIVATE | + // | API-PERMISSION | GENERAL | + // | API-RATE-LIMIT-POOL | SPOT | + // | API-RATE-LIMIT | 3 | + // +---------------------+---------+ + GetFullOrderBook(req *GetFullOrderBookReq, ctx context.Context) (*GetFullOrderBookResp, error) + + // GetFiatPrice Get Fiat Price + // Description: Request via this endpoint to get the fiat price of the currencies for the available trading pairs. + // Documentation: https://www.kucoin.com/docs-new/api-3470153 // +---------------------+--------+ // | Extra API Info | Value | // +---------------------+--------+ @@ -175,11 +175,11 @@ type MarketAPI interface { // | API-RATE-LIMIT-POOL | PUBLIC | // | API-RATE-LIMIT | 3 | // +---------------------+--------+ - GetServerTime(ctx context.Context) (*GetServerTimeResp, error) + GetFiatPrice(req *GetFiatPriceReq, ctx context.Context) (*GetFiatPriceResp, error) - // GetAllSymbols Get All Symbols - // Description: Request via this endpoint to get a list of available currency pairs for trading. If you want to get the market information of the trading symbol, please use Get All Tickers. - // Documentation: https://www.kucoin.com/docs-new/api-3470154 + // Get24hrStats Get 24hr Stats + // Description: Request via this endpoint to get the statistics of the specified ticker in the last 24 hours. + // Documentation: https://www.kucoin.com/docs-new/api-3470161 // +---------------------+--------+ // | Extra API Info | Value | // +---------------------+--------+ @@ -187,13 +187,13 @@ type MarketAPI interface { // | API-CHANNEL | PUBLIC | // | API-PERMISSION | NULL | // | API-RATE-LIMIT-POOL | PUBLIC | - // | API-RATE-LIMIT | 4 | + // | API-RATE-LIMIT | 15 | // +---------------------+--------+ - GetAllSymbols(req *GetAllSymbolsReq, ctx context.Context) (*GetAllSymbolsResp, error) + Get24hrStats(req *Get24hrStatsReq, ctx context.Context) (*Get24hrStatsResp, error) - // GetSymbol Get Symbol - // Description: Request via this endpoint to get detail currency pairs for trading. If you want to get the market information of the trading symbol, please use Get All Tickers. - // Documentation: https://www.kucoin.com/docs-new/api-3470159 + // GetMarketList Get Market List + // Description: Request via this endpoint to get the transaction currency for the entire trading market. + // Documentation: https://www.kucoin.com/docs-new/api-3470166 // +---------------------+--------+ // | Extra API Info | Value | // +---------------------+--------+ @@ -201,13 +201,13 @@ type MarketAPI interface { // | API-CHANNEL | PUBLIC | // | API-PERMISSION | NULL | // | API-RATE-LIMIT-POOL | PUBLIC | - // | API-RATE-LIMIT | 4 | + // | API-RATE-LIMIT | 3 | // +---------------------+--------+ - GetSymbol(req *GetSymbolReq, ctx context.Context) (*GetSymbolResp, error) + GetMarketList(ctx context.Context) (*GetMarketListResp, error) - // GetAnnouncements Get Announcements - // Description: This interface can obtain the latest news announcements, and the default page search is for announcements within a month. - // Documentation: https://www.kucoin.com/docs-new/api-3470157 + // GetServerTime Get Server Time + // Description: Get the server time. + // Documentation: https://www.kucoin.com/docs-new/api-3470156 // +---------------------+--------+ // | Extra API Info | Value | // +---------------------+--------+ @@ -215,13 +215,13 @@ type MarketAPI interface { // | API-CHANNEL | PUBLIC | // | API-PERMISSION | NULL | // | API-RATE-LIMIT-POOL | PUBLIC | - // | API-RATE-LIMIT | 20 | + // | API-RATE-LIMIT | 3 | // +---------------------+--------+ - GetAnnouncements(req *GetAnnouncementsReq, ctx context.Context) (*GetAnnouncementsResp, error) + GetServerTime(ctx context.Context) (*GetServerTimeResp, error) - // GetCurrency Get Currency - // Description: Request via this endpoint to get the currency details of a specified currency - // Documentation: https://www.kucoin.com/docs-new/api-3470155 + // GetServiceStatus Get Service Status + // Description: Get the service status + // Documentation: https://www.kucoin.com/docs-new/api-3470158 // +---------------------+--------+ // | Extra API Info | Value | // +---------------------+--------+ @@ -231,11 +231,11 @@ type MarketAPI interface { // | API-RATE-LIMIT-POOL | PUBLIC | // | API-RATE-LIMIT | 3 | // +---------------------+--------+ - GetCurrency(req *GetCurrencyReq, ctx context.Context) (*GetCurrencyResp, error) + GetServiceStatus(ctx context.Context) (*GetServiceStatusResp, error) - // GetAllCurrencies Get All Currencies - // Description: Request via this endpoint to get the currency list.Not all currencies currently can be used for trading. - // Documentation: https://www.kucoin.com/docs-new/api-3470152 + // GetPublicToken Get Public Token - Spot/Margin + // Description: This interface can obtain the token required for websocket to establish a Spot/Margin connection. If you need use public channels (e.g. all public market data), please make request as follows to obtain the server list and public token + // Documentation: https://www.kucoin.com/docs-new/api-3470294 // +---------------------+--------+ // | Extra API Info | Value | // +---------------------+--------+ @@ -243,13 +243,13 @@ type MarketAPI interface { // | API-CHANNEL | PUBLIC | // | API-PERMISSION | NULL | // | API-RATE-LIMIT-POOL | PUBLIC | - // | API-RATE-LIMIT | 3 | + // | API-RATE-LIMIT | 10 | // +---------------------+--------+ - GetAllCurrencies(ctx context.Context) (*GetAllCurrenciesResp, error) + GetPublicToken(ctx context.Context) (*GetPublicTokenResp, error) - // GetFullOrderBook Get Full OrderBook - // Description: Query for Full orderbook depth data. (aggregated by price) It is generally used by professional traders because it uses more server resources and traffic, and we have strict access rate limit control. To maintain up-to-date Order Book, please use Websocket incremental feed after retrieving the OrderBook. - // Documentation: https://www.kucoin.com/docs-new/api-3470164 + // GetPrivateToken Get Private Token - Spot/Margin + // Description: This interface can obtain the token required for websocket to establish a Spot/Margin private connection. If you need use private channels(e.g. account balance notice), please make request as follows to obtain the server list and private token + // Documentation: https://www.kucoin.com/docs-new/api-3470295 // +---------------------+---------+ // | Extra API Info | Value | // +---------------------+---------+ @@ -257,9 +257,9 @@ type MarketAPI interface { // | API-CHANNEL | PRIVATE | // | API-PERMISSION | GENERAL | // | API-RATE-LIMIT-POOL | SPOT | - // | API-RATE-LIMIT | 3 | + // | API-RATE-LIMIT | 10 | // +---------------------+---------+ - GetFullOrderBook(req *GetFullOrderBookReq, ctx context.Context) (*GetFullOrderBookResp, error) + GetPrivateToken(ctx context.Context) (*GetPrivateTokenResp, error) } type MarketAPIImpl struct { @@ -270,33 +270,33 @@ func NewMarketAPIImp(transport interfaces.Transport) *MarketAPIImpl { return &MarketAPIImpl{transport: transport} } -func (impl *MarketAPIImpl) GetPrivateToken(ctx context.Context) (*GetPrivateTokenResp, error) { - resp := &GetPrivateTokenResp{} - err := impl.transport.Call(ctx, "spot", false, "Post", "/api/v1/bullet-private", nil, resp, false) +func (impl *MarketAPIImpl) GetAnnouncements(req *GetAnnouncementsReq, ctx context.Context) (*GetAnnouncementsResp, error) { + resp := &GetAnnouncementsResp{} + err := impl.transport.Call(ctx, "spot", false, "Get", "/api/v3/announcements", req, resp, false) return resp, err } -func (impl *MarketAPIImpl) GetPublicToken(ctx context.Context) (*GetPublicTokenResp, error) { - resp := &GetPublicTokenResp{} - err := impl.transport.Call(ctx, "spot", false, "Post", "/api/v1/bullet-public", nil, resp, false) +func (impl *MarketAPIImpl) GetCurrency(req *GetCurrencyReq, ctx context.Context) (*GetCurrencyResp, error) { + resp := &GetCurrencyResp{} + err := impl.transport.Call(ctx, "spot", false, "Get", "/api/v3/currencies/{currency}", req, resp, false) return resp, err } -func (impl *MarketAPIImpl) GetAllTickers(ctx context.Context) (*GetAllTickersResp, error) { - resp := &GetAllTickersResp{} - err := impl.transport.Call(ctx, "spot", false, "Get", "/api/v1/market/allTickers", nil, resp, false) +func (impl *MarketAPIImpl) GetAllCurrencies(ctx context.Context) (*GetAllCurrenciesResp, error) { + resp := &GetAllCurrenciesResp{} + err := impl.transport.Call(ctx, "spot", false, "Get", "/api/v3/currencies", nil, resp, false) return resp, err } -func (impl *MarketAPIImpl) GetKlines(req *GetKlinesReq, ctx context.Context) (*GetKlinesResp, error) { - resp := &GetKlinesResp{} - err := impl.transport.Call(ctx, "spot", false, "Get", "/api/v1/market/candles", req, resp, false) +func (impl *MarketAPIImpl) GetSymbol(req *GetSymbolReq, ctx context.Context) (*GetSymbolResp, error) { + resp := &GetSymbolResp{} + err := impl.transport.Call(ctx, "spot", false, "Get", "/api/v2/symbols/{symbol}", req, resp, false) return resp, err } -func (impl *MarketAPIImpl) GetTradeHistory(req *GetTradeHistoryReq, ctx context.Context) (*GetTradeHistoryResp, error) { - resp := &GetTradeHistoryResp{} - err := impl.transport.Call(ctx, "spot", false, "Get", "/api/v1/market/histories", req, resp, false) +func (impl *MarketAPIImpl) GetAllSymbols(req *GetAllSymbolsReq, ctx context.Context) (*GetAllSymbolsResp, error) { + resp := &GetAllSymbolsResp{} + err := impl.transport.Call(ctx, "spot", false, "Get", "/api/v2/symbols", req, resp, false) return resp, err } @@ -306,74 +306,74 @@ func (impl *MarketAPIImpl) GetTicker(req *GetTickerReq, ctx context.Context) (*G return resp, err } -func (impl *MarketAPIImpl) GetPartOrderBook(req *GetPartOrderBookReq, ctx context.Context) (*GetPartOrderBookResp, error) { - resp := &GetPartOrderBookResp{} - err := impl.transport.Call(ctx, "spot", false, "Get", "/api/v1/market/orderbook/level2_{size}", req, resp, false) +func (impl *MarketAPIImpl) GetAllTickers(ctx context.Context) (*GetAllTickersResp, error) { + resp := &GetAllTickersResp{} + err := impl.transport.Call(ctx, "spot", false, "Get", "/api/v1/market/allTickers", nil, resp, false) return resp, err } -func (impl *MarketAPIImpl) Get24hrStats(req *Get24hrStatsReq, ctx context.Context) (*Get24hrStatsResp, error) { - resp := &Get24hrStatsResp{} - err := impl.transport.Call(ctx, "spot", false, "Get", "/api/v1/market/stats", req, resp, false) +func (impl *MarketAPIImpl) GetTradeHistory(req *GetTradeHistoryReq, ctx context.Context) (*GetTradeHistoryResp, error) { + resp := &GetTradeHistoryResp{} + err := impl.transport.Call(ctx, "spot", false, "Get", "/api/v1/market/histories", req, resp, false) return resp, err } -func (impl *MarketAPIImpl) GetMarketList(ctx context.Context) (*GetMarketListResp, error) { - resp := &GetMarketListResp{} - err := impl.transport.Call(ctx, "spot", false, "Get", "/api/v1/markets", nil, resp, false) +func (impl *MarketAPIImpl) GetKlines(req *GetKlinesReq, ctx context.Context) (*GetKlinesResp, error) { + resp := &GetKlinesResp{} + err := impl.transport.Call(ctx, "spot", false, "Get", "/api/v1/market/candles", req, resp, false) return resp, err } -func (impl *MarketAPIImpl) GetFiatPrice(req *GetFiatPriceReq, ctx context.Context) (*GetFiatPriceResp, error) { - resp := &GetFiatPriceResp{} - err := impl.transport.Call(ctx, "spot", false, "Get", "/api/v1/prices", req, resp, false) +func (impl *MarketAPIImpl) GetPartOrderBook(req *GetPartOrderBookReq, ctx context.Context) (*GetPartOrderBookResp, error) { + resp := &GetPartOrderBookResp{} + err := impl.transport.Call(ctx, "spot", false, "Get", "/api/v1/market/orderbook/level2_{size}", req, resp, false) return resp, err } -func (impl *MarketAPIImpl) GetServiceStatus(ctx context.Context) (*GetServiceStatusResp, error) { - resp := &GetServiceStatusResp{} - err := impl.transport.Call(ctx, "spot", false, "Get", "/api/v1/status", nil, resp, false) +func (impl *MarketAPIImpl) GetFullOrderBook(req *GetFullOrderBookReq, ctx context.Context) (*GetFullOrderBookResp, error) { + resp := &GetFullOrderBookResp{} + err := impl.transport.Call(ctx, "spot", false, "Get", "/api/v3/market/orderbook/level2", req, resp, false) return resp, err } -func (impl *MarketAPIImpl) GetServerTime(ctx context.Context) (*GetServerTimeResp, error) { - resp := &GetServerTimeResp{} - err := impl.transport.Call(ctx, "spot", false, "Get", "/api/v1/timestamp", nil, resp, false) +func (impl *MarketAPIImpl) GetFiatPrice(req *GetFiatPriceReq, ctx context.Context) (*GetFiatPriceResp, error) { + resp := &GetFiatPriceResp{} + err := impl.transport.Call(ctx, "spot", false, "Get", "/api/v1/prices", req, resp, false) return resp, err } -func (impl *MarketAPIImpl) GetAllSymbols(req *GetAllSymbolsReq, ctx context.Context) (*GetAllSymbolsResp, error) { - resp := &GetAllSymbolsResp{} - err := impl.transport.Call(ctx, "spot", false, "Get", "/api/v2/symbols", req, resp, false) +func (impl *MarketAPIImpl) Get24hrStats(req *Get24hrStatsReq, ctx context.Context) (*Get24hrStatsResp, error) { + resp := &Get24hrStatsResp{} + err := impl.transport.Call(ctx, "spot", false, "Get", "/api/v1/market/stats", req, resp, false) return resp, err } -func (impl *MarketAPIImpl) GetSymbol(req *GetSymbolReq, ctx context.Context) (*GetSymbolResp, error) { - resp := &GetSymbolResp{} - err := impl.transport.Call(ctx, "spot", false, "Get", "/api/v2/symbols/{symbol}", req, resp, false) +func (impl *MarketAPIImpl) GetMarketList(ctx context.Context) (*GetMarketListResp, error) { + resp := &GetMarketListResp{} + err := impl.transport.Call(ctx, "spot", false, "Get", "/api/v1/markets", nil, resp, false) return resp, err } -func (impl *MarketAPIImpl) GetAnnouncements(req *GetAnnouncementsReq, ctx context.Context) (*GetAnnouncementsResp, error) { - resp := &GetAnnouncementsResp{} - err := impl.transport.Call(ctx, "spot", false, "Get", "/api/v3/announcements", req, resp, false) +func (impl *MarketAPIImpl) GetServerTime(ctx context.Context) (*GetServerTimeResp, error) { + resp := &GetServerTimeResp{} + err := impl.transport.Call(ctx, "spot", false, "Get", "/api/v1/timestamp", nil, resp, false) return resp, err } -func (impl *MarketAPIImpl) GetCurrency(req *GetCurrencyReq, ctx context.Context) (*GetCurrencyResp, error) { - resp := &GetCurrencyResp{} - err := impl.transport.Call(ctx, "spot", false, "Get", "/api/v3/currencies/{currency}", req, resp, false) +func (impl *MarketAPIImpl) GetServiceStatus(ctx context.Context) (*GetServiceStatusResp, error) { + resp := &GetServiceStatusResp{} + err := impl.transport.Call(ctx, "spot", false, "Get", "/api/v1/status", nil, resp, false) return resp, err } -func (impl *MarketAPIImpl) GetAllCurrencies(ctx context.Context) (*GetAllCurrenciesResp, error) { - resp := &GetAllCurrenciesResp{} - err := impl.transport.Call(ctx, "spot", false, "Get", "/api/v3/currencies", nil, resp, false) +func (impl *MarketAPIImpl) GetPublicToken(ctx context.Context) (*GetPublicTokenResp, error) { + resp := &GetPublicTokenResp{} + err := impl.transport.Call(ctx, "spot", false, "Post", "/api/v1/bullet-public", nil, resp, false) return resp, err } -func (impl *MarketAPIImpl) GetFullOrderBook(req *GetFullOrderBookReq, ctx context.Context) (*GetFullOrderBookResp, error) { - resp := &GetFullOrderBookResp{} - err := impl.transport.Call(ctx, "spot", false, "Get", "/api/v3/market/orderbook/level2", req, resp, false) +func (impl *MarketAPIImpl) GetPrivateToken(ctx context.Context) (*GetPrivateTokenResp, error) { + resp := &GetPrivateTokenResp{} + err := impl.transport.Call(ctx, "spot", false, "Post", "/api/v1/bullet-private", nil, resp, false) return resp, err } diff --git a/sdk/golang/pkg/generate/spot/market/api_market.template b/sdk/golang/pkg/generate/spot/market/api_market.template index dac0530b..f18eef53 100644 --- a/sdk/golang/pkg/generate/spot/market/api_market.template +++ b/sdk/golang/pkg/generate/spot/market/api_market.template @@ -1,13 +1,16 @@ # API FUNCTION TEMPLATE -func TestMarketGetPrivateTokenReq(t *testing.T) { - // GetPrivateToken - // Get Private Token - Spot/Margin - // /api/v1/bullet-private +func TestMarketGetAnnouncementsReq(t *testing.T) { + // GetAnnouncements + // Get Announcements + // /api/v3/announcements + builder := market.NewGetAnnouncementsReqBuilder() + builder.SetCurrentPage(?).SetPageSize(?).SetAnnType(?).SetLang(?).SetStartTime(?).SetEndTime(?) + req := builder.Build() - resp, err := marketApi.GetPrivateToken(context.TODO()) + resp, err := marketApi.GetAnnouncements(req, context.TODO()) if err != nil { panic(err) } @@ -21,13 +24,16 @@ func TestMarketGetPrivateTokenReq(t *testing.T) { } -func TestMarketGetPublicTokenReq(t *testing.T) { - // GetPublicToken - // Get Public Token - Spot/Margin - // /api/v1/bullet-public +func TestMarketGetCurrencyReq(t *testing.T) { + // GetCurrency + // Get Currency + // /api/v3/currencies/{currency} + builder := market.NewGetCurrencyReqBuilder() + builder.SetCurrency(?).SetChain(?) + req := builder.Build() - resp, err := marketApi.GetPublicToken(context.TODO()) + resp, err := marketApi.GetCurrency(req, context.TODO()) if err != nil { panic(err) } @@ -41,13 +47,13 @@ func TestMarketGetPublicTokenReq(t *testing.T) { } -func TestMarketGetAllTickersReq(t *testing.T) { - // GetAllTickers - // Get All Tickers - // /api/v1/market/allTickers +func TestMarketGetAllCurrenciesReq(t *testing.T) { + // GetAllCurrencies + // Get All Currencies + // /api/v3/currencies - resp, err := marketApi.GetAllTickers(context.TODO()) + resp, err := marketApi.GetAllCurrencies(context.TODO()) if err != nil { panic(err) } @@ -61,16 +67,16 @@ func TestMarketGetAllTickersReq(t *testing.T) { } -func TestMarketGetKlinesReq(t *testing.T) { - // GetKlines - // Get Klines - // /api/v1/market/candles +func TestMarketGetSymbolReq(t *testing.T) { + // GetSymbol + // Get Symbol + // /api/v2/symbols/{symbol} - builder := market.NewGetKlinesReqBuilder() - builder.SetSymbol(?).SetType(?).SetStartAt(?).SetEndAt(?) + builder := market.NewGetSymbolReqBuilder() + builder.SetSymbol(?) req := builder.Build() - resp, err := marketApi.GetKlines(req, context.TODO()) + resp, err := marketApi.GetSymbol(req, context.TODO()) if err != nil { panic(err) } @@ -84,16 +90,16 @@ func TestMarketGetKlinesReq(t *testing.T) { } -func TestMarketGetTradeHistoryReq(t *testing.T) { - // GetTradeHistory - // Get Trade History - // /api/v1/market/histories +func TestMarketGetAllSymbolsReq(t *testing.T) { + // GetAllSymbols + // Get All Symbols + // /api/v2/symbols - builder := market.NewGetTradeHistoryReqBuilder() - builder.SetSymbol(?) + builder := market.NewGetAllSymbolsReqBuilder() + builder.SetMarket(?) req := builder.Build() - resp, err := marketApi.GetTradeHistory(req, context.TODO()) + resp, err := marketApi.GetAllSymbols(req, context.TODO()) if err != nil { panic(err) } @@ -130,16 +136,13 @@ func TestMarketGetTickerReq(t *testing.T) { } -func TestMarketGetPartOrderBookReq(t *testing.T) { - // GetPartOrderBook - // Get Part OrderBook - // /api/v1/market/orderbook/level2_{size} +func TestMarketGetAllTickersReq(t *testing.T) { + // GetAllTickers + // Get All Tickers + // /api/v1/market/allTickers - builder := market.NewGetPartOrderBookReqBuilder() - builder.SetSymbol(?).SetSize(?) - req := builder.Build() - resp, err := marketApi.GetPartOrderBook(req, context.TODO()) + resp, err := marketApi.GetAllTickers(context.TODO()) if err != nil { panic(err) } @@ -153,16 +156,16 @@ func TestMarketGetPartOrderBookReq(t *testing.T) { } -func TestMarketGet24hrStatsReq(t *testing.T) { - // Get24hrStats - // Get 24hr Stats - // /api/v1/market/stats +func TestMarketGetTradeHistoryReq(t *testing.T) { + // GetTradeHistory + // Get Trade History + // /api/v1/market/histories - builder := market.NewGet24hrStatsReqBuilder() + builder := market.NewGetTradeHistoryReqBuilder() builder.SetSymbol(?) req := builder.Build() - resp, err := marketApi.Get24hrStats(req, context.TODO()) + resp, err := marketApi.GetTradeHistory(req, context.TODO()) if err != nil { panic(err) } @@ -176,13 +179,16 @@ func TestMarketGet24hrStatsReq(t *testing.T) { } -func TestMarketGetMarketListReq(t *testing.T) { - // GetMarketList - // Get Market List - // /api/v1/markets +func TestMarketGetKlinesReq(t *testing.T) { + // GetKlines + // Get Klines + // /api/v1/market/candles + builder := market.NewGetKlinesReqBuilder() + builder.SetSymbol(?).SetType(?).SetStartAt(?).SetEndAt(?) + req := builder.Build() - resp, err := marketApi.GetMarketList(context.TODO()) + resp, err := marketApi.GetKlines(req, context.TODO()) if err != nil { panic(err) } @@ -196,16 +202,16 @@ func TestMarketGetMarketListReq(t *testing.T) { } -func TestMarketGetFiatPriceReq(t *testing.T) { - // GetFiatPrice - // Get Fiat Price - // /api/v1/prices +func TestMarketGetPartOrderBookReq(t *testing.T) { + // GetPartOrderBook + // Get Part OrderBook + // /api/v1/market/orderbook/level2_{size} - builder := market.NewGetFiatPriceReqBuilder() - builder.SetBase(?).SetCurrencies(?) + builder := market.NewGetPartOrderBookReqBuilder() + builder.SetSymbol(?).SetSize(?) req := builder.Build() - resp, err := marketApi.GetFiatPrice(req, context.TODO()) + resp, err := marketApi.GetPartOrderBook(req, context.TODO()) if err != nil { panic(err) } @@ -219,13 +225,16 @@ func TestMarketGetFiatPriceReq(t *testing.T) { } -func TestMarketGetServiceStatusReq(t *testing.T) { - // GetServiceStatus - // Get Service Status - // /api/v1/status +func TestMarketGetFullOrderBookReq(t *testing.T) { + // GetFullOrderBook + // Get Full OrderBook + // /api/v3/market/orderbook/level2 + builder := market.NewGetFullOrderBookReqBuilder() + builder.SetSymbol(?) + req := builder.Build() - resp, err := marketApi.GetServiceStatus(context.TODO()) + resp, err := marketApi.GetFullOrderBook(req, context.TODO()) if err != nil { panic(err) } @@ -239,13 +248,16 @@ func TestMarketGetServiceStatusReq(t *testing.T) { } -func TestMarketGetServerTimeReq(t *testing.T) { - // GetServerTime - // Get Server Time - // /api/v1/timestamp +func TestMarketGetFiatPriceReq(t *testing.T) { + // GetFiatPrice + // Get Fiat Price + // /api/v1/prices + builder := market.NewGetFiatPriceReqBuilder() + builder.SetBase(?).SetCurrencies(?) + req := builder.Build() - resp, err := marketApi.GetServerTime(context.TODO()) + resp, err := marketApi.GetFiatPrice(req, context.TODO()) if err != nil { panic(err) } @@ -259,16 +271,16 @@ func TestMarketGetServerTimeReq(t *testing.T) { } -func TestMarketGetAllSymbolsReq(t *testing.T) { - // GetAllSymbols - // Get All Symbols - // /api/v2/symbols +func TestMarketGet24hrStatsReq(t *testing.T) { + // Get24hrStats + // Get 24hr Stats + // /api/v1/market/stats - builder := market.NewGetAllSymbolsReqBuilder() - builder.SetMarket(?) + builder := market.NewGet24hrStatsReqBuilder() + builder.SetSymbol(?) req := builder.Build() - resp, err := marketApi.GetAllSymbols(req, context.TODO()) + resp, err := marketApi.Get24hrStats(req, context.TODO()) if err != nil { panic(err) } @@ -282,16 +294,13 @@ func TestMarketGetAllSymbolsReq(t *testing.T) { } -func TestMarketGetSymbolReq(t *testing.T) { - // GetSymbol - // Get Symbol - // /api/v2/symbols/{symbol} +func TestMarketGetMarketListReq(t *testing.T) { + // GetMarketList + // Get Market List + // /api/v1/markets - builder := market.NewGetSymbolReqBuilder() - builder.SetSymbol(?) - req := builder.Build() - resp, err := marketApi.GetSymbol(req, context.TODO()) + resp, err := marketApi.GetMarketList(context.TODO()) if err != nil { panic(err) } @@ -305,16 +314,13 @@ func TestMarketGetSymbolReq(t *testing.T) { } -func TestMarketGetAnnouncementsReq(t *testing.T) { - // GetAnnouncements - // Get Announcements - // /api/v3/announcements +func TestMarketGetServerTimeReq(t *testing.T) { + // GetServerTime + // Get Server Time + // /api/v1/timestamp - builder := market.NewGetAnnouncementsReqBuilder() - builder.SetCurrentPage(?).SetPageSize(?).SetAnnType(?).SetLang(?).SetStartTime(?).SetEndTime(?) - req := builder.Build() - resp, err := marketApi.GetAnnouncements(req, context.TODO()) + resp, err := marketApi.GetServerTime(context.TODO()) if err != nil { panic(err) } @@ -328,16 +334,13 @@ func TestMarketGetAnnouncementsReq(t *testing.T) { } -func TestMarketGetCurrencyReq(t *testing.T) { - // GetCurrency - // Get Currency - // /api/v3/currencies/{currency} +func TestMarketGetServiceStatusReq(t *testing.T) { + // GetServiceStatus + // Get Service Status + // /api/v1/status - builder := market.NewGetCurrencyReqBuilder() - builder.SetCurrency(?).SetChain(?) - req := builder.Build() - resp, err := marketApi.GetCurrency(req, context.TODO()) + resp, err := marketApi.GetServiceStatus(context.TODO()) if err != nil { panic(err) } @@ -351,13 +354,13 @@ func TestMarketGetCurrencyReq(t *testing.T) { } -func TestMarketGetAllCurrenciesReq(t *testing.T) { - // GetAllCurrencies - // Get All Currencies - // /api/v3/currencies +func TestMarketGetPublicTokenReq(t *testing.T) { + // GetPublicToken + // Get Public Token - Spot/Margin + // /api/v1/bullet-public - resp, err := marketApi.GetAllCurrencies(context.TODO()) + resp, err := marketApi.GetPublicToken(context.TODO()) if err != nil { panic(err) } @@ -371,16 +374,13 @@ func TestMarketGetAllCurrenciesReq(t *testing.T) { } -func TestMarketGetFullOrderBookReq(t *testing.T) { - // GetFullOrderBook - // Get Full OrderBook - // /api/v3/market/orderbook/level2 +func TestMarketGetPrivateTokenReq(t *testing.T) { + // GetPrivateToken + // Get Private Token - Spot/Margin + // /api/v1/bullet-private - builder := market.NewGetFullOrderBookReqBuilder() - builder.SetSymbol(?) - req := builder.Build() - resp, err := marketApi.GetFullOrderBook(req, context.TODO()) + resp, err := marketApi.GetPrivateToken(context.TODO()) if err != nil { panic(err) } diff --git a/sdk/golang/pkg/generate/spot/market/api_market_test.go b/sdk/golang/pkg/generate/spot/market/api_market_test.go index 72a5d67d..2c033f16 100644 --- a/sdk/golang/pkg/generate/spot/market/api_market_test.go +++ b/sdk/golang/pkg/generate/spot/market/api_market_test.go @@ -7,126 +7,136 @@ import ( "testing" ) -func TestMarketGetPrivateTokenReqModel(t *testing.T) { - // GetPrivateToken - // Get Private Token - Spot/Margin - // /api/v1/bullet-private +func TestMarketGetAnnouncementsReqModel(t *testing.T) { + // GetAnnouncements + // Get Announcements + // /api/v3/announcements + data := "{\"currentPage\": 1, \"pageSize\": 50, \"annType\": \"latest-announcements\", \"lang\": \"en_US\", \"startTime\": 1729594043000, \"endTime\": 1729697729000}" + req := &GetAnnouncementsReq{} + err := json.Unmarshal([]byte(data), req) + req.ToMap() + assert.Nil(t, err) } -func TestMarketGetPrivateTokenRespModel(t *testing.T) { - // GetPrivateToken - // Get Private Token - Spot/Margin - // /api/v1/bullet-private +func TestMarketGetAnnouncementsRespModel(t *testing.T) { + // GetAnnouncements + // Get Announcements + // /api/v3/announcements - data := "{\n \"code\": \"200000\",\n \"data\": {\n \"token\": \"2neAiuYvAU737TOajb2U3uT8AEZqSWYe0fBD4LoHuXJDSC7gIzJiH4kNTWhCPISWo6nDpAe7aUaaHJ4fG8oRjFgMfUI2sM4IySWHrBceFocY8pKy2REU1HwZIngtMdMrjqPnP-biofFWbNaP1cl0X1pZc2SQ-33hDH1LgNP-yg80ZJv_Ctaj8sAFhTOZ8m1L.jut4vBQxXAseWKxODdGVGg==\",\n \"instanceServers\": [\n {\n \"endpoint\": \"wss://ws-api-spot.kucoin.com/\",\n \"encrypt\": true,\n \"protocol\": \"websocket\",\n \"pingInterval\": 18000,\n \"pingTimeout\": 10000\n }\n ]\n }\n}" + data := "{\n \"code\": \"200000\",\n \"data\": {\n \"totalNum\": 195,\n \"totalPage\": 13,\n \"currentPage\": 1,\n \"pageSize\": 15,\n \"items\": [\n {\n \"annId\": 129045,\n \"annTitle\": \"KuCoin Isolated Margin Adds the Scroll (SCR) Trading Pair\",\n \"annType\": [\n \"latest-announcements\"\n ],\n \"annDesc\": \"To enrich the variety of assets available,\xa0KuCoin\u2019s Isolated Margin Trading platform has added the Scroll (SCR)\xa0asset and trading pair.\",\n \"cTime\": 1729594043000,\n \"language\": \"en_US\",\n \"annUrl\": \"https://www.kucoin.com/announcement/kucoin-isolated-margin-adds-scr?lang=en_US\"\n },\n {\n \"annId\": 129001,\n \"annTitle\": \"DAPP-30D Fixed Promotion, Enjoy an APR of 200%!\u200b\",\n \"annType\": [\n \"latest-announcements\",\n \"activities\"\n ],\n \"annDesc\": \"KuCoin Earn will be launching the DAPP Fixed Promotion at 10:00:00 on October 22, 2024 (UTC). The available product is \u201cDAPP-30D'' with an APR of 200%.\",\n \"cTime\": 1729588460000,\n \"language\": \"en_US\",\n \"annUrl\": \"https://www.kucoin.com/announcement/dapp-30d-fixed-promotion-enjoy?lang=en_US\"\n },\n {\n \"annId\": 128581,\n \"annTitle\": \"NAYM (NAYM) Gets Listed on KuCoin! World Premiere!\",\n \"annType\": [\n \"latest-announcements\",\n \"new-listings\"\n ],\n \"annDesc\": \"Trading:\xa011:00 on October 22, 2024 (UTC)\",\n \"cTime\": 1729497729000,\n \"language\": \"en_US\",\n \"annUrl\": \"https://www.kucoin.com/announcement/en-naym-naym-gets-listed-on-kucoin-world-premiere?lang=en_US\"\n }\n ]\n }\n}" commonResp := &types.RestResponse{} err := json.Unmarshal([]byte(data), commonResp) assert.Nil(t, err) assert.NotNil(t, commonResp.Data) - resp := &GetPrivateTokenResp{} + resp := &GetAnnouncementsResp{} err = json.Unmarshal([]byte(commonResp.Data), resp) resp.ToMap() assert.Nil(t, err) } -func TestMarketGetPublicTokenReqModel(t *testing.T) { - // GetPublicToken - // Get Public Token - Spot/Margin - // /api/v1/bullet-public +func TestMarketGetCurrencyReqModel(t *testing.T) { + // GetCurrency + // Get Currency + // /api/v3/currencies/{currency} + data := "{\"currency\": \"BTC\", \"chain\": \"eth\"}" + req := &GetCurrencyReq{} + err := json.Unmarshal([]byte(data), req) + req.ToMap() + assert.Nil(t, err) } -func TestMarketGetPublicTokenRespModel(t *testing.T) { - // GetPublicToken - // Get Public Token - Spot/Margin - // /api/v1/bullet-public +func TestMarketGetCurrencyRespModel(t *testing.T) { + // GetCurrency + // Get Currency + // /api/v3/currencies/{currency} - data := "{\n \"code\": \"200000\",\n \"data\": {\n \"token\": \"2neAiuYvAU61ZDXANAGAsiL4-iAExhsBXZxftpOeh_55i3Ysy2q2LEsEWU64mdzUOPusi34M_wGoSf7iNyEWJ93g2WHl-j4M7tCZ_S21PuIByWXUJFDywtiYB9J6i9GjsxUuhPw3Blq6rhZlGykT3Vp1phUafnulOOpts-MEmEF-3bpfetLOAq79RbGaLlE4JBvJHl5Vs9Y=.ymP9jIr6v-vucrZr8761yA==\",\n \"instanceServers\": [\n {\n \"endpoint\": \"wss://ws-api-spot.kucoin.com/\",\n \"encrypt\": true,\n \"protocol\": \"websocket\",\n \"pingInterval\": 18000,\n \"pingTimeout\": 10000\n }\n ]\n }\n}" + data := "{\"code\":\"200000\",\"data\":{\"currency\":\"BTC\",\"name\":\"BTC\",\"fullName\":\"Bitcoin\",\"precision\":8,\"confirms\":null,\"contractAddress\":null,\"isMarginEnabled\":true,\"isDebitEnabled\":true,\"chains\":[{\"chainName\":\"BTC\",\"withdrawalMinSize\":\"0.001\",\"depositMinSize\":\"0.0002\",\"withdrawFeeRate\":\"0\",\"withdrawalMinFee\":\"0.0005\",\"isWithdrawEnabled\":true,\"isDepositEnabled\":true,\"confirms\":3,\"preConfirms\":1,\"contractAddress\":\"\",\"withdrawPrecision\":8,\"maxWithdraw\":null,\"maxDeposit\":null,\"needTag\":false,\"chainId\":\"btc\"},{\"chainName\":\"Lightning Network\",\"withdrawalMinSize\":\"0.00001\",\"depositMinSize\":\"0.00001\",\"withdrawFeeRate\":\"0\",\"withdrawalMinFee\":\"0.000015\",\"isWithdrawEnabled\":true,\"isDepositEnabled\":true,\"confirms\":1,\"preConfirms\":1,\"contractAddress\":\"\",\"withdrawPrecision\":8,\"maxWithdraw\":null,\"maxDeposit\":\"0.03\",\"needTag\":false,\"chainId\":\"btcln\"},{\"chainName\":\"KCC\",\"withdrawalMinSize\":\"0.0008\",\"depositMinSize\":null,\"withdrawFeeRate\":\"0\",\"withdrawalMinFee\":\"0.00002\",\"isWithdrawEnabled\":true,\"isDepositEnabled\":true,\"confirms\":20,\"preConfirms\":20,\"contractAddress\":\"0xfa93c12cd345c658bc4644d1d4e1b9615952258c\",\"withdrawPrecision\":8,\"maxWithdraw\":null,\"maxDeposit\":null,\"needTag\":false,\"chainId\":\"kcc\"},{\"chainName\":\"BTC-Segwit\",\"withdrawalMinSize\":\"0.0008\",\"depositMinSize\":\"0.0002\",\"withdrawFeeRate\":\"0\",\"withdrawalMinFee\":\"0.0005\",\"isWithdrawEnabled\":false,\"isDepositEnabled\":true,\"confirms\":2,\"preConfirms\":2,\"contractAddress\":\"\",\"withdrawPrecision\":8,\"maxWithdraw\":null,\"maxDeposit\":null,\"needTag\":false,\"chainId\":\"bech32\"}]}}" commonResp := &types.RestResponse{} err := json.Unmarshal([]byte(data), commonResp) assert.Nil(t, err) assert.NotNil(t, commonResp.Data) - resp := &GetPublicTokenResp{} + resp := &GetCurrencyResp{} err = json.Unmarshal([]byte(commonResp.Data), resp) resp.ToMap() assert.Nil(t, err) } -func TestMarketGetAllTickersReqModel(t *testing.T) { - // GetAllTickers - // Get All Tickers - // /api/v1/market/allTickers +func TestMarketGetAllCurrenciesReqModel(t *testing.T) { + // GetAllCurrencies + // Get All Currencies + // /api/v3/currencies } -func TestMarketGetAllTickersRespModel(t *testing.T) { - // GetAllTickers - // Get All Tickers - // /api/v1/market/allTickers +func TestMarketGetAllCurrenciesRespModel(t *testing.T) { + // GetAllCurrencies + // Get All Currencies + // /api/v3/currencies - data := "{\n \"code\": \"200000\",\n \"data\": {\n \"time\": 1729173207043,\n \"ticker\": [\n {\n \"symbol\": \"BTC-USDT\",\n \"symbolName\": \"BTC-USDT\",\n \"buy\": \"67192.5\",\n \"bestBidSize\": \"0.000025\",\n \"sell\": \"67192.6\",\n \"bestAskSize\": \"1.24949204\",\n \"changeRate\": \"-0.0014\",\n \"changePrice\": \"-98.5\",\n \"high\": \"68321.4\",\n \"low\": \"66683.3\",\n \"vol\": \"1836.03034612\",\n \"volValue\": \"124068431.06726933\",\n \"last\": \"67193\",\n \"averagePrice\": \"67281.21437289\",\n \"takerFeeRate\": \"0.001\",\n \"makerFeeRate\": \"0.001\",\n \"takerCoefficient\": \"1\",\n \"makerCoefficient\": \"1\"\n }\n ]\n }\n}" + data := "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"currency\": \"BTC\",\n \"name\": \"BTC\",\n \"fullName\": \"Bitcoin\",\n \"precision\": 8,\n \"confirms\": null,\n \"contractAddress\": null,\n \"isMarginEnabled\": true,\n \"isDebitEnabled\": true,\n \"chains\": [\n {\n \"chainName\": \"BTC\",\n \"withdrawalMinSize\": \"0.001\",\n \"depositMinSize\": \"0.0002\",\n \"withdrawFeeRate\": \"0\",\n \"withdrawalMinFee\": \"0.0005\",\n \"isWithdrawEnabled\": true,\n \"isDepositEnabled\": true,\n \"confirms\": 3,\n \"preConfirms\": 1,\n \"contractAddress\": \"\",\n \"withdrawPrecision\": 8,\n \"maxWithdraw\": null,\n \"maxDeposit\": null,\n \"needTag\": false,\n \"chainId\": \"btc\"\n },\n {\n \"chainName\": \"Lightning Network\",\n \"withdrawalMinSize\": \"0.00001\",\n \"depositMinSize\": \"0.00001\",\n \"withdrawFeeRate\": \"0\",\n \"withdrawalMinFee\": \"0.000015\",\n \"isWithdrawEnabled\": true,\n \"isDepositEnabled\": true,\n \"confirms\": 1,\n \"preConfirms\": 1,\n \"contractAddress\": \"\",\n \"withdrawPrecision\": 8,\n \"maxWithdraw\": null,\n \"maxDeposit\": \"0.03\",\n \"needTag\": false,\n \"chainId\": \"btcln\"\n },\n {\n \"chainName\": \"KCC\",\n \"withdrawalMinSize\": \"0.0008\",\n \"depositMinSize\": null,\n \"withdrawFeeRate\": \"0\",\n \"withdrawalMinFee\": \"0.00002\",\n \"isWithdrawEnabled\": true,\n \"isDepositEnabled\": true,\n \"confirms\": 20,\n \"preConfirms\": 20,\n \"contractAddress\": \"0xfa93c12cd345c658bc4644d1d4e1b9615952258c\",\n \"withdrawPrecision\": 8,\n \"maxWithdraw\": null,\n \"maxDeposit\": null,\n \"needTag\": false,\n \"chainId\": \"kcc\"\n },\n {\n \"chainName\": \"BTC-Segwit\",\n \"withdrawalMinSize\": \"0.0008\",\n \"depositMinSize\": \"0.0002\",\n \"withdrawFeeRate\": \"0\",\n \"withdrawalMinFee\": \"0.0005\",\n \"isWithdrawEnabled\": false,\n \"isDepositEnabled\": true,\n \"confirms\": 2,\n \"preConfirms\": 2,\n \"contractAddress\": \"\",\n \"withdrawPrecision\": 8,\n \"maxWithdraw\": null,\n \"maxDeposit\": null,\n \"needTag\": false,\n \"chainId\": \"bech32\"\n }\n ]\n },\n {\n \"currency\": \"BTCP\",\n \"name\": \"BTCP\",\n \"fullName\": \"Bitcoin Private\",\n \"precision\": 8,\n \"confirms\": null,\n \"contractAddress\": null,\n \"isMarginEnabled\": false,\n \"isDebitEnabled\": false,\n \"chains\": [\n {\n \"chainName\": \"BTCP\",\n \"withdrawalMinSize\": \"0.100000\",\n \"depositMinSize\": null,\n \"withdrawFeeRate\": \"0\",\n \"withdrawalMinFee\": \"0.010000\",\n \"isWithdrawEnabled\": false,\n \"isDepositEnabled\": false,\n \"confirms\": 6,\n \"preConfirms\": 6,\n \"contractAddress\": \"\",\n \"withdrawPrecision\": 8,\n \"maxWithdraw\": null,\n \"maxDeposit\": null,\n \"needTag\": false,\n \"chainId\": \"btcp\"\n }\n ]\n }\n ]\n}" commonResp := &types.RestResponse{} err := json.Unmarshal([]byte(data), commonResp) assert.Nil(t, err) assert.NotNil(t, commonResp.Data) - resp := &GetAllTickersResp{} + resp := &GetAllCurrenciesResp{} err = json.Unmarshal([]byte(commonResp.Data), resp) resp.ToMap() assert.Nil(t, err) } -func TestMarketGetKlinesReqModel(t *testing.T) { - // GetKlines - // Get Klines - // /api/v1/market/candles +func TestMarketGetSymbolReqModel(t *testing.T) { + // GetSymbol + // Get Symbol + // /api/v2/symbols/{symbol} - data := "{\"symbol\": \"BTC-USDT\", \"type\": \"1min\", \"startAt\": 1566703297, \"endAt\": 1566789757}" - req := &GetKlinesReq{} + data := "{\"symbol\": \"BTC-USDT\"}" + req := &GetSymbolReq{} err := json.Unmarshal([]byte(data), req) req.ToMap() assert.Nil(t, err) } -func TestMarketGetKlinesRespModel(t *testing.T) { - // GetKlines - // Get Klines - // /api/v1/market/candles +func TestMarketGetSymbolRespModel(t *testing.T) { + // GetSymbol + // Get Symbol + // /api/v2/symbols/{symbol} - data := "{\n \"code\": \"200000\",\n \"data\": [\n [\n \"1566789720\",\n \"10411.5\",\n \"10401.9\",\n \"10411.5\",\n \"10396.3\",\n \"29.11357276\",\n \"302889.301529914\"\n ],\n [\n \"1566789660\",\n \"10416\",\n \"10411.5\",\n \"10422.3\",\n \"10411.5\",\n \"15.61781842\",\n \"162703.708997029\"\n ],\n [\n \"1566789600\",\n \"10408.6\",\n \"10416\",\n \"10416\",\n \"10405.4\",\n \"12.45584973\",\n \"129666.51508559\"\n ]\n ]\n}" + data := "{\"code\":\"200000\",\"data\":{\"symbol\":\"BTC-USDT\",\"name\":\"BTC-USDT\",\"baseCurrency\":\"BTC\",\"quoteCurrency\":\"USDT\",\"feeCurrency\":\"USDT\",\"market\":\"USDS\",\"baseMinSize\":\"0.00001\",\"quoteMinSize\":\"0.1\",\"baseMaxSize\":\"10000000000\",\"quoteMaxSize\":\"99999999\",\"baseIncrement\":\"0.00000001\",\"quoteIncrement\":\"0.000001\",\"priceIncrement\":\"0.1\",\"priceLimitRate\":\"0.1\",\"minFunds\":\"0.1\",\"isMarginEnabled\":true,\"enableTrading\":true,\"feeCategory\":1,\"makerFeeCoefficient\":\"1.00\",\"takerFeeCoefficient\":\"1.00\",\"st\":false}}" commonResp := &types.RestResponse{} err := json.Unmarshal([]byte(data), commonResp) assert.Nil(t, err) assert.NotNil(t, commonResp.Data) - resp := &GetKlinesResp{} + resp := &GetSymbolResp{} err = json.Unmarshal([]byte(commonResp.Data), resp) resp.ToMap() assert.Nil(t, err) } -func TestMarketGetTradeHistoryReqModel(t *testing.T) { - // GetTradeHistory - // Get Trade History - // /api/v1/market/histories +func TestMarketGetAllSymbolsReqModel(t *testing.T) { + // GetAllSymbols + // Get All Symbols + // /api/v2/symbols - data := "{\"symbol\": \"BTC-USDT\"}" - req := &GetTradeHistoryReq{} + data := "{\"market\": \"ALTS\"}" + req := &GetAllSymbolsReq{} err := json.Unmarshal([]byte(data), req) req.ToMap() assert.Nil(t, err) } -func TestMarketGetTradeHistoryRespModel(t *testing.T) { - // GetTradeHistory - // Get Trade History - // /api/v1/market/histories +func TestMarketGetAllSymbolsRespModel(t *testing.T) { + // GetAllSymbols + // Get All Symbols + // /api/v2/symbols - data := "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"sequence\": \"10976028003549185\",\n \"price\": \"67122\",\n \"size\": \"0.000025\",\n \"side\": \"buy\",\n \"time\": 1729177117877000000\n },\n {\n \"sequence\": \"10976028003549188\",\n \"price\": \"67122\",\n \"size\": \"0.01792257\",\n \"side\": \"buy\",\n \"time\": 1729177117877000000\n },\n {\n \"sequence\": \"10976028003549191\",\n \"price\": \"67122.9\",\n \"size\": \"0.05654289\",\n \"side\": \"buy\",\n \"time\": 1729177117877000000\n }\n ]\n}" + data := "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"symbol\": \"BTC-USDT\",\n \"name\": \"BTC-USDT\",\n \"baseCurrency\": \"BTC\",\n \"quoteCurrency\": \"USDT\",\n \"feeCurrency\": \"USDT\",\n \"market\": \"USDS\",\n \"baseMinSize\": \"0.00001\",\n \"quoteMinSize\": \"0.1\",\n \"baseMaxSize\": \"10000000000\",\n \"quoteMaxSize\": \"99999999\",\n \"baseIncrement\": \"0.00000001\",\n \"quoteIncrement\": \"0.000001\",\n \"priceIncrement\": \"0.1\",\n \"priceLimitRate\": \"0.1\",\n \"minFunds\": \"0.1\",\n \"isMarginEnabled\": true,\n \"enableTrading\": true,\n \"feeCategory\": 1,\n \"makerFeeCoefficient\": \"1.00\",\n \"takerFeeCoefficient\": \"1.00\",\n \"st\": false\n }\n ]\n}" commonResp := &types.RestResponse{} err := json.Unmarshal([]byte(data), commonResp) assert.Nil(t, err) assert.NotNil(t, commonResp.Data) - resp := &GetTradeHistoryResp{} + resp := &GetAllSymbolsResp{} err = json.Unmarshal([]byte(commonResp.Data), resp) resp.ToMap() assert.Nil(t, err) @@ -160,317 +170,307 @@ func TestMarketGetTickerRespModel(t *testing.T) { assert.Nil(t, err) } -func TestMarketGetPartOrderBookReqModel(t *testing.T) { - // GetPartOrderBook - // Get Part OrderBook - // /api/v1/market/orderbook/level2_{size} +func TestMarketGetAllTickersReqModel(t *testing.T) { + // GetAllTickers + // Get All Tickers + // /api/v1/market/allTickers - data := "{\"symbol\": \"BTC-USDT\", \"size\": \"20\"}" - req := &GetPartOrderBookReq{} - err := json.Unmarshal([]byte(data), req) - req.ToMap() - assert.Nil(t, err) } -func TestMarketGetPartOrderBookRespModel(t *testing.T) { - // GetPartOrderBook - // Get Part OrderBook - // /api/v1/market/orderbook/level2_{size} +func TestMarketGetAllTickersRespModel(t *testing.T) { + // GetAllTickers + // Get All Tickers + // /api/v1/market/allTickers - data := "{\n \"code\": \"200000\",\n \"data\": {\n \"time\": 1729176273859,\n \"sequence\": \"14610502970\",\n \"bids\": [\n [\n \"66976.4\",\n \"0.69109872\"\n ],\n [\n \"66976.3\",\n \"0.14377\"\n ]\n ],\n \"asks\": [\n [\n \"66976.5\",\n \"0.05408199\"\n ],\n [\n \"66976.8\",\n \"0.0005\"\n ]\n ]\n }\n}" + data := "{\n \"code\": \"200000\",\n \"data\": {\n \"time\": 1729173207043,\n \"ticker\": [\n {\n \"symbol\": \"BTC-USDT\",\n \"symbolName\": \"BTC-USDT\",\n \"buy\": \"67192.5\",\n \"bestBidSize\": \"0.000025\",\n \"sell\": \"67192.6\",\n \"bestAskSize\": \"1.24949204\",\n \"changeRate\": \"-0.0014\",\n \"changePrice\": \"-98.5\",\n \"high\": \"68321.4\",\n \"low\": \"66683.3\",\n \"vol\": \"1836.03034612\",\n \"volValue\": \"124068431.06726933\",\n \"last\": \"67193\",\n \"averagePrice\": \"67281.21437289\",\n \"takerFeeRate\": \"0.001\",\n \"makerFeeRate\": \"0.001\",\n \"takerCoefficient\": \"1\",\n \"makerCoefficient\": \"1\"\n }\n ]\n }\n}" commonResp := &types.RestResponse{} err := json.Unmarshal([]byte(data), commonResp) assert.Nil(t, err) assert.NotNil(t, commonResp.Data) - resp := &GetPartOrderBookResp{} + resp := &GetAllTickersResp{} err = json.Unmarshal([]byte(commonResp.Data), resp) resp.ToMap() assert.Nil(t, err) } -func TestMarketGet24hrStatsReqModel(t *testing.T) { - // Get24hrStats - // Get 24hr Stats - // /api/v1/market/stats +func TestMarketGetTradeHistoryReqModel(t *testing.T) { + // GetTradeHistory + // Get Trade History + // /api/v1/market/histories data := "{\"symbol\": \"BTC-USDT\"}" - req := &Get24hrStatsReq{} + req := &GetTradeHistoryReq{} err := json.Unmarshal([]byte(data), req) req.ToMap() assert.Nil(t, err) } -func TestMarketGet24hrStatsRespModel(t *testing.T) { - // Get24hrStats - // Get 24hr Stats - // /api/v1/market/stats +func TestMarketGetTradeHistoryRespModel(t *testing.T) { + // GetTradeHistory + // Get Trade History + // /api/v1/market/histories - data := "{\"code\":\"200000\",\"data\":{\"time\":1729175612158,\"symbol\":\"BTC-USDT\",\"buy\":\"66982.4\",\"sell\":\"66982.5\",\"changeRate\":\"-0.0114\",\"changePrice\":\"-778.1\",\"high\":\"68107.7\",\"low\":\"66683.3\",\"vol\":\"1738.02898182\",\"volValue\":\"117321982.415978333\",\"last\":\"66981.5\",\"averagePrice\":\"67281.21437289\",\"takerFeeRate\":\"0.001\",\"makerFeeRate\":\"0.001\",\"takerCoefficient\":\"1\",\"makerCoefficient\":\"1\"}}" + data := "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"sequence\": \"10976028003549185\",\n \"price\": \"67122\",\n \"size\": \"0.000025\",\n \"side\": \"buy\",\n \"time\": 1729177117877000000\n },\n {\n \"sequence\": \"10976028003549188\",\n \"price\": \"67122\",\n \"size\": \"0.01792257\",\n \"side\": \"buy\",\n \"time\": 1729177117877000000\n },\n {\n \"sequence\": \"10976028003549191\",\n \"price\": \"67122.9\",\n \"size\": \"0.05654289\",\n \"side\": \"buy\",\n \"time\": 1729177117877000000\n }\n ]\n}" commonResp := &types.RestResponse{} err := json.Unmarshal([]byte(data), commonResp) assert.Nil(t, err) assert.NotNil(t, commonResp.Data) - resp := &Get24hrStatsResp{} + resp := &GetTradeHistoryResp{} err = json.Unmarshal([]byte(commonResp.Data), resp) resp.ToMap() assert.Nil(t, err) } -func TestMarketGetMarketListReqModel(t *testing.T) { - // GetMarketList - // Get Market List - // /api/v1/markets +func TestMarketGetKlinesReqModel(t *testing.T) { + // GetKlines + // Get Klines + // /api/v1/market/candles + data := "{\"symbol\": \"BTC-USDT\", \"type\": \"1min\", \"startAt\": 1566703297, \"endAt\": 1566789757}" + req := &GetKlinesReq{} + err := json.Unmarshal([]byte(data), req) + req.ToMap() + assert.Nil(t, err) } -func TestMarketGetMarketListRespModel(t *testing.T) { - // GetMarketList - // Get Market List - // /api/v1/markets +func TestMarketGetKlinesRespModel(t *testing.T) { + // GetKlines + // Get Klines + // /api/v1/market/candles - data := "{\"code\":\"200000\",\"data\":[\"USDS\",\"TON\",\"AI\",\"DePIN\",\"PoW\",\"BRC-20\",\"ETF\",\"KCS\",\"Meme\",\"Solana\",\"FIAT\",\"VR&AR\",\"DeFi\",\"Polkadot\",\"BTC\",\"ALTS\",\"Layer 1\"]}" + data := "{\n \"code\": \"200000\",\n \"data\": [\n [\n \"1566789720\",\n \"10411.5\",\n \"10401.9\",\n \"10411.5\",\n \"10396.3\",\n \"29.11357276\",\n \"302889.301529914\"\n ],\n [\n \"1566789660\",\n \"10416\",\n \"10411.5\",\n \"10422.3\",\n \"10411.5\",\n \"15.61781842\",\n \"162703.708997029\"\n ],\n [\n \"1566789600\",\n \"10408.6\",\n \"10416\",\n \"10416\",\n \"10405.4\",\n \"12.45584973\",\n \"129666.51508559\"\n ]\n ]\n}" commonResp := &types.RestResponse{} err := json.Unmarshal([]byte(data), commonResp) assert.Nil(t, err) assert.NotNil(t, commonResp.Data) - resp := &GetMarketListResp{} + resp := &GetKlinesResp{} err = json.Unmarshal([]byte(commonResp.Data), resp) resp.ToMap() assert.Nil(t, err) } -func TestMarketGetFiatPriceReqModel(t *testing.T) { - // GetFiatPrice - // Get Fiat Price - // /api/v1/prices +func TestMarketGetPartOrderBookReqModel(t *testing.T) { + // GetPartOrderBook + // Get Part OrderBook + // /api/v1/market/orderbook/level2_{size} - data := "{\"base\": \"USD\", \"currencies\": \"example_string_default_value\"}" - req := &GetFiatPriceReq{} + data := "{\"symbol\": \"BTC-USDT\", \"size\": \"20\"}" + req := &GetPartOrderBookReq{} err := json.Unmarshal([]byte(data), req) req.ToMap() assert.Nil(t, err) } -func TestMarketGetFiatPriceRespModel(t *testing.T) { - // GetFiatPrice - // Get Fiat Price - // /api/v1/prices +func TestMarketGetPartOrderBookRespModel(t *testing.T) { + // GetPartOrderBook + // Get Part OrderBook + // /api/v1/market/orderbook/level2_{size} - data := "{\"code\":\"200000\",\"data\":{\"AGLD\":\"1.1174410000000001\",\"DFI\":\"0.0168915500000000\",\"PYTHUP\":\"0.0397880960000000\",\"ISLM\":\"0.0606196750000000\",\"NEAR\":\"4.7185395500000000\",\"AIOZ\":\"0.4862867350000000\",\"AUDIO\":\"0.1219390000000000\",\"BBL\":\"0.0067766100000000\",\"WLD\":\"2.2893547500000000\",\"HNT\":\"5.8990489999999984\",\"ETHFI\":\"1.5892050000000000\",\"DMAIL\":\"0.2726636000000000\",\"OPUP\":\"0.0986506500000000\",\"VET3S\":\"0.0003700448850000\",\"MANA3S\":\"0.0006056970000000\",\"TIDAL\":\"0.0001154422500000\",\"HALO\":\"0.0058270850000000\",\"OPUL\":\"0.0839480050000000\",\"MANA3L\":\"0.0029569407900000\",\"DGB\":\"0.0066556705000000\",\"AA\":\"0.2406796000000000\",\"BCH\":\"366.2167999999996484\",\"GMEE\":\"0.0113333305000000\",\"JST\":\"0.0302348750000000\",\"PBUX\":\"0.0208795550000000\",\"AR\":\"18.5457224999999909\",\"SEI\":\"0.4332832500000000\",\"PSTAKE\":\"0.0493153300000000\",\"LMWR\":\"0.1618190500000000\",\"UNFIDOWN\":\"0.0062058955000000\",\"BB\":\"0.3245376500000000\",\"JTO\":\"2.1239375000000002\",\"WEMIX\":\"0.7916040000000000\",\"G\":\"0.0324037900000000\",\"MARSH\":\"0.0617591050000000\",\"BN\":\"0.0036961510000000\",\"FLIP\":\"1.0976509000000000\",\"FLR\":\"0.0144827550000000\",\"BIGTIME\":\"0.1238780300000000\",\"FLY\":\"0.0005157420000000\",\"T\":\"0.0233483200000000\",\"W\":\"0.2865566500000000\",\"BDX\":\"0.0774012800000000\",\"BABYDOGE\":\"0.0000000029375305\",\"SFP\":\"0.7256370000000000\",\"DIA\":\"0.9179408000000000\",\"ISME\":\"0.0022388800000000\",\"LYM\":\"0.0010155919500000\",\"VET3L\":\"0.0000289755050000\",\"JUP\":\"0.8230882500000000\",\"LYX\":\"1.4501745500000001\",\"AIEPK\":\"0.0050094940000000\",\"SILLY\":\"0.0159420250000000\",\"SCPT\":\"0.0122038950000000\",\"WOO\":\"0.1796601250000000\",\"BLUR\":\"0.2462768000000000\",\"STRK\":\"0.3963117450000000\",\"BFC\":\"0.0383608100000000\",\"DC\":\"0.0003097450500000\",\"KARATE\":\"0.0007296350000000\",\"SUSHI3L\":\"0.5115441000000000\",\"NETVR\":\"0.0976111700000000\",\"WAVES\":\"1.0806594000000000\",\"LITH\":\"0.0001520239500000\",\"HAPI\":\"8.6533711499999987\",\"SUSHI3S\":\"1.2752620500000000\",\"CEEK\":\"0.0294852500000000\",\"FLOKI\":\"0.0001414292500000\",\"SHR\":\"0.0012463765000000\",\"SAND\":\"0.2566616050000000\",\"TURT\":\"0.0020889550000000\",\"UMA\":\"2.5207390000000000\",\"BEPRO\":\"0.0003955021500000\",\"SCRT\":\"0.1995002000000000\",\"TUSD\":\"0.9945025000000000\",\"COOKIE\":\"0.0220089900000000\",\"LRDS\":\"0.6218889000000000\",\"SIN\":\"0.0033633175000000\",\"OAS\":\"0.0331933950000000\",\"ROOT\":\"0.0183108400000000\",\"ADA3L\":\"0.0046396790000000\",\"TIAUP\":\"0.1228385500000000\",\"HTR\":\"0.0353023400000000\",\"UNB\":\"0.0003837080500000\",\"UNA\":\"0.0164917500000000\",\"HARD\":\"0.1087056200000000\",\"G3\":\"0.0502648550000000\",\"ADA3S\":\"0.0006191202850000\",\"MYRO\":\"0.1071863800000000\",\"HTX\":\"0.0000013693150000\",\"FT\":\"0.3585206500000000\",\"BTCDOWN\":\"0.1065467000000000\",\"UNI\":\"7.3571195999999993\",\"FX\":\"0.1379310000000000\",\"OBI\":\"0.0079030465000000\",\"UNO\":\"0.0137131400000000\",\"WRX\":\"0.1221389000000000\",\"TIADOWN\":\"0.0000914642450000\",\"ETHDOWN\":\"0.1306346500000000\",\"WELL\":\"0.0471244260000000\",\"SWFTC\":\"0.0028966509500000\",\"SKL\":\"0.0362418700000000\",\"UOS\":\"0.0867765900000000\",\"AIPAD\":\"0.0478660550000000\",\"BRETT\":\"0.1037481000000000\",\"SKY\":\"0.0520139800000000\",\"FRM\":\"0.0153123400000000\",\"VISION\":\"0.0014451770500000\",\"LENDS\":\"0.0047276350000000\",\"SLF\":\"0.3318340000000000\",\"BULL\":\"0.0023988000000000\",\"FLOW\":\"0.5372312500000000\",\"ODDZ\":\"0.0063368300000000\",\"SLN\":\"0.2804597000000000\",\"UPO\":\"0.0440779500000000\",\"SLP\":\"0.0023997995000000\",\"ID\":\"0.3718140000000000\",\"SLIM\":\"0.0906446550000000\",\"SPOT\":\"0.0021289350000000\",\"DOP\":\"0.0023028480000000\",\"ISSP\":\"0.0000874562500000\",\"UQC\":\"3.2339822000000003\",\"IO\":\"1.8185902499999999\",\"DOT\":\"4.2022978000000005\",\"1INCH\":\"0.2645676500000000\",\"SMH\":\"0.3448275000000000\",\"MAK\":\"0.0396701550000000\",\"TOKO\":\"0.0005923037000000\",\"TURBO\":\"0.0108085930000000\",\"UNFI\":\"2.8555714999999996\",\"MAN\":\"0.0210764565000000\",\"EVER\":\"0.0332733550000000\",\"FTM\":\"0.7259068650000000\",\"SHRAP\":\"0.0476361700000000\",\"MAV\":\"0.1738130500000000\",\"MAX\":\"0.2864966800000000\",\"DPR\":\"0.0018240875000000\",\"FTT\":\"2.0559715000000002\",\"ARKM\":\"1.7444273499999999\",\"ATOM\":\"4.2954512000000002\",\"PENDLE\":\"4.1554212500000007\",\"QUICK\":\"0.0365317250000000\",\"BLZ\":\"0.1217191100000000\",\"BOBA\":\"0.2014092450000000\",\"MBL\":\"0.0027856065000000\",\"OFN\":\"0.1252373500000000\",\"UNIO\":\"0.0025487250000000\",\"SNS\":\"0.0200899500000000\",\"SNX\":\"1.4282854999999999\",\"NXRA\":\"0.0272763550000000\",\"TAIKO\":\"1.4392800000000001\",\"AVAX3L\":\"0.1410875109550000\",\"L3\":\"0.0608395650000000\",\"API3\":\"1.3728132500000001\",\"XRP3S\":\"0.0028095945000000\",\"QKC\":\"0.0085157400000000\",\"AVAX3S\":\"0.5148424500000000\",\"ROSE\":\"0.0693453100000000\",\"SATS\":\"0.0000002701648500\",\"BMX\":\"0.3100449000000000\",\"PORTAL\":\"0.2811593500000000\",\"TOMI\":\"0.0309045400000000\",\"XRP3L\":\"2.1586201500000002\",\"SOL\":\"151.7250995000003583\",\"SON\":\"0.0002421788500000\",\"BNC\":\"0.1882058500000000\",\"SOCIAL\":\"0.0026486750000000\",\"CGPT\":\"0.1305147100000000\",\"CELR\":\"0.0127736100000000\",\"BNB\":\"591.0973035000118935\",\"OGN\":\"0.0852573500000000\",\"CELO\":\"0.7711142500000000\",\"AUCTION\":\"13.1634150000000014\",\"MANTA\":\"0.7564216000000000\",\"LAYER\":\"0.0372713550000000\",\"AERO\":\"1.3783104999999999\",\"CETUS\":\"0.1808295400000000\",\"LL\":\"0.0201199350000000\",\"SPA\":\"0.0067426270000000\",\"PYTHDOWN\":\"0.0011834080000000\",\"NEIROCTO\":\"0.0019964013000000\",\"UTK\":\"0.0365217300000000\",\"GMRX\":\"0.0007386305000000\",\"BOB\":\"0.0000380619595000\",\"HOTCROSS\":\"0.0056491740000000\",\"AERGO\":\"0.1007595950000000\",\"MOCA\":\"0.0783608000000000\",\"SQD\":\"0.0380809500000000\",\"MV\":\"0.0081359300000000\",\"BNB3L\":\"0.2761618500000000\",\"BNB3S\":\"0.0008545725000000\",\"GALAX3L\":\"0.0057571999600000\",\"KAI\":\"0.0020080954500000\",\"SQR\":\"0.0470764500000000\",\"GALAX3S\":\"0.1933033000000000\",\"EGLD\":\"25.5272299999999713\",\"ZBCN\":\"0.0010404795000000\",\"KAS\":\"0.1216691350000000\",\"MEW\":\"0.0086176890000000\",\"PUNDIX\":\"0.4130933500000000\",\"LOOKS\":\"0.0392803500000000\",\"FXS\":\"1.9060465000000000\",\"BOSON\":\"0.2732633000000000\",\"BRISE\":\"0.0000000860569500\",\"AEVO\":\"0.3388305000000000\",\"FLUX\":\"0.5276360500000000\",\"PRCL\":\"0.1969015000000000\",\"UNFIUP\":\"0.0011654170000000\",\"SEIDOWN\":\"0.0442778500000000\",\"DOAI\":\"0.0052363805000000\",\"QNT\":\"65.4312679999998206\",\"REDO\":\"0.2837580500000000\",\"STRIKE\":\"6.8225869999999997\",\"ETHW\":\"3.2418782499999998\",\"OM\":\"1.5396797750000000\",\"OP\":\"1.6911539999999999\",\"WHALE\":\"0.8134930500000000\",\"1CAT\":\"0.0018460765000000\",\"NEON\":\"0.4446775500000000\",\"GTAI\":\"0.7786105000000000\",\"SSV\":\"21.2393749999999841\",\"ETH2\":\"2601.6678843156403923\",\"KCS\":\"8.7646155000000020\",\"ARPA\":\"0.0393882960000000\",\"ARTFI\":\"0.0141029450000000\",\"BRL\":\"0.1742807323452485\",\"ALEX\":\"0.0924537500000000\",\"STG\":\"0.2943527500000000\",\"SHIB\":\"0.0000178060925000\",\"IOTX\":\"0.0394202800000000\",\"OLE\":\"0.0171414250000000\",\"KDA\":\"0.5653172000000000\",\"CERE\":\"0.0022548720000000\",\"DOCK\":\"0.0018990500000000\",\"STX\":\"1.8157916500000000\",\"OLT\":\"0.0007596200000000\",\"QI\":\"0.0131754090000000\",\"SDAO\":\"0.2748625000000000\",\"BLAST\":\"0.0087636160000000\",\"LINK3S\":\"0.0000702948350000\",\"IOST\":\"0.0049745115000000\",\"SUI\":\"2.0589700000000000\",\"CAKE\":\"1.7941024999999999\",\"BSW\":\"0.0586706500000000\",\"OMG\":\"0.2597700500000000\",\"VOLT\":\"0.0000002716641000\",\"LINK3L\":\"1.3408292499999999\",\"GEEQ\":\"0.0385607100000000\",\"PYUSD\":\"0.9988003500000000\",\"SUN\":\"0.0186106900000000\",\"TOWER\":\"0.0014812590000000\",\"BTC\":\"67133.4165000832051564\",\"IOTA\":\"0.1189405000000000\",\"REEF\":\"0.0019960015000000\",\"TRIAS\":\"3.3683149999999998\",\"KEY\":\"0.0037594713240047\",\"ETH3L\":\"0.0003305946200000\",\"BTT\":\"0.0000009117439000\",\"ONE\":\"0.0132003965000000\",\"RENDER\":\"5.2263854999999995\",\"ETH3S\":\"0.5517240000000000\",\"ANKR\":\"0.0264867500000000\",\"ALGO\":\"0.1188405500000000\",\"SYLO\":\"0.0007600198000000\",\"ZCX\":\"0.0784707450000000\",\"SD\":\"0.3851073500000000\",\"ONT\":\"0.1877960550000000\",\"MJT\":\"0.0132433750000000\",\"DYM\":\"1.6659666000000001\",\"DYP\":\"0.0205397250000000\",\"BAKEUP\":\"0.0389894955000000\",\"OOE\":\"0.0079360300000000\",\"ZELIX\":\"0.0000649675000000\",\"DOGE3L\":\"0.3837080500000000\",\"ARTY\":\"0.3980009000000000\",\"QORPO\":\"0.1204297550000000\",\"ICE\":\"0.0051504235000000\",\"NOTAI\":\"0.0000892753400000\",\"DOGE3S\":\"0.2291853500000000\",\"NAKA\":\"1.0695649500000000\",\"GALAX\":\"0.0212893500000000\",\"MKR\":\"1245.8767500000163833\",\"DODO\":\"0.1152423500000000\",\"ICP\":\"7.6731615000000027\",\"ZEC\":\"35.9400209999999543\",\"ZEE\":\"0.0065767100000000\",\"ICX\":\"0.1383308000000000\",\"KMNO\":\"0.0921499020000000\",\"TT\":\"0.0033883050000000\",\"DOT3L\":\"0.1454272500000000\",\"XAI\":\"0.2038980000000000\",\"ZEN\":\"8.0149905000000007\",\"DOGE\":\"0.1213093150000000\",\"ALPHA\":\"0.0567416150000000\",\"DUSK\":\"0.1964517250000000\",\"DOT3S\":\"0.0053613180000000\",\"SXP\":\"0.2538730000000000\",\"HBAR\":\"0.0510044850000000\",\"SYNT\":\"0.0467166300000000\",\"ZEX\":\"0.0571714000000000\",\"BONDLY\":\"0.0022208890000000\",\"MLK\":\"0.2080859050000000\",\"KICKS\":\"0.0001301249050000\",\"PEPE\":\"0.0000100249850000\",\"OUSD\":\"0.9982006500000000\",\"LUNCDOWN\":\"0.0000733333150000\",\"DOGS\":\"0.0007086455000000\",\"REV3L\":\"0.0094672640000000\",\"CTSI\":\"0.1257371000000000\",\"C98\":\"0.1219390000000000\",\"OSMO\":\"0.5370313500000000\",\"NTRN\":\"0.3869064500000000\",\"CFX2S\":\"0.0084757600000000\",\"SYN\":\"0.5636180500000000\",\"VIDT\":\"0.0308745550000000\",\"SYS\":\"0.0997501000000000\",\"GAS\":\"4.3029474500000008\",\"BOME\":\"0.0087336310000000\",\"COMBO\":\"0.4068964500000000\",\"XCH\":\"14.9825050000000010\",\"VR\":\"0.0063538215000000\",\"CFX2L\":\"0.0499660045000000\",\"VSYS\":\"0.0005201398000000\",\"PANDORA\":\"1629.2949450001102772\",\"THETA\":\"1.2461766000000000\",\"XCN\":\"0.0012699647000000\",\"NEXG\":\"0.0039180400000000\",\"MELOS\":\"0.0021244372500000\",\"XCV\":\"0.0013253370000000\",\"ORN\":\"0.8797599000000000\",\"WLKN\":\"0.0010624685000000\",\"AAVE\":\"154.2708259999996162\",\"MNT\":\"0.6168914000000000\",\"BONK\":\"0.0000227296295000\",\"PERP\":\"0.6037979500000000\",\"XDC\":\"0.0276361750000000\",\"MNW\":\"0.3681158500000000\",\"XDB\":\"0.0002578710000000\",\"BOND\":\"1.5662165000000000\",\"SUIA\":\"0.0809595000000000\",\"MOG\":\"0.0000019330330000\",\"SUTER\":\"0.0001840079500000\",\"TIME\":\"16.2648634999999969\",\"RACA\":\"0.0001949025000000\",\"BICO\":\"0.2021988500000000\",\"MON\":\"0.1066466500000000\",\"SWEAT\":\"0.0063718125000000\",\"MOXIE\":\"0.0022088950000000\",\"BABYBNB\":\"0.0289755050000000\",\"IGU\":\"0.0050674650000000\",\"HMSTR\":\"0.0037990995000000\",\"XEC\":\"0.0000354722550000\",\"MONI\":\"0.0058470750000000\",\"XR\":\"0.2374812000000000\",\"PEOPLE\":\"0.0796601500000000\",\"PUMLX\":\"0.0054572700000000\",\"ZIL\":\"0.0145927000000000\",\"WLDDOWN\":\"0.2089954500000000\",\"VAI\":\"0.0799999800000000\",\"XEN\":\"0.0000000839580000\",\"MPC\":\"0.1001499000000000\",\"XEM\":\"0.0176951480000000\",\"JASMY3S\":\"0.0019670160000000\",\"OTK\":\"0.0290464695000000\",\"TRAC\":\"0.4521738000000000\",\"DFYN\":\"0.0070664650000000\",\"BIDP\":\"0.0001939030000000\",\"JASMY3L\":\"0.0001653772700000\",\"INJDOWN\":\"0.0000194902500000\",\"KLV\":\"0.0019310340000000\",\"WAXL\":\"0.7858069000000000\",\"TRBDOWN\":\"0.0023138425000000\",\"BCH3L\":\"4.6390663064999996\",\"GMT3S\":\"0.0000457771000000\",\"KMD\":\"0.2493752500000000\",\"BCH3S\":\"0.9634180500000000\",\"ECOX\":\"0.0987506000000000\",\"AAVE3S\":\"0.0560719500000000\",\"GMT3L\":\"0.0053983694650000\",\"EPIK\":\"0.0045857060000000\",\"SUIP\":\"0.1067565950000000\",\"AAVE3L\":\"0.3638687346200000\",\"ZK\":\"0.1262368500000000\",\"ZKF\":\"0.0008595700000000\",\"OMNIA\":\"0.7624186000000000\",\"ZKJ\":\"1.1124435000000000\",\"ZKL\":\"0.1255372000000000\",\"GAFI\":\"3.0634675000000001\",\"CARV\":\"0.8703646000000000\",\"KNC\":\"0.4433782000000000\",\"CATS\":\"0.0000599700000000\",\"PROM\":\"5.2833570000000006\",\"ALEPH\":\"0.1756121500000000\",\"PONKE\":\"0.3958020000000000\",\"OVR\":\"0.1553223000000000\",\"CATI\":\"0.4105146400000000\",\"ORDER\":\"0.1183008200000000\",\"GFT\":\"0.0166616650000000\",\"BIFI\":\"0.0020489750000000\",\"GGC\":\"6.9965029985000000\",\"GGG\":\"0.0403798000000000\",\"DAPPX\":\"0.0043788095000000\",\"SUKU\":\"0.0618790450000000\",\"ULTI\":\"0.0168015950000000\",\"CREDI\":\"0.0192903500000000\",\"ERTHA\":\"0.0010014990000000\",\"FURY\":\"0.1405297000000000\",\"KARRAT\":\"0.5577210000000000\",\"MOBILE\":\"0.0009005495000000\",\"SIDUS\":\"0.0037671155000000\",\"NAVI\":\"0.1254672350000000\",\"TAO\":\"583.4081500000051807\",\"USDJ\":\"1.1386304000000001\",\"MTL\":\"0.9563216000000000\",\"VET\":\"0.0225387250000000\",\"FITFI\":\"0.0036421780000000\",\"USDT\":\"0.9995000000000000\",\"OXT\":\"0.0695652000000000\",\"CANDY\":\"0.0005597200000000\",\"USDP\":\"0.9932031500000000\",\"MTS\":\"0.0027516235000000\",\"TADA\":\"0.0283858000000000\",\"MTV\":\"0.0006559718500000\",\"NAVX\":\"0.1342228550000000\",\"ILV\":\"35.6771524999999671\",\"VINU\":\"0.0000000109045450\",\"GHX\":\"0.0903548000000000\",\"EDU\":\"0.5167415000000000\",\"HYVE\":\"0.0137331300000000\",\"BTC3L\":\"0.0058620675000000\",\"ANYONE\":\"0.9015490000000000\",\"BEAT\":\"0.0012593700000000\",\"KING\":\"0.0004821588000000\",\"CREAM\":\"15.6541689999999973\",\"CAS\":\"0.0038590695000000\",\"IMX\":\"1.4944524000000000\",\"CAT\":\"0.0000256981445000\",\"BTC3S\":\"0.0014142925000000\",\"USDE\":\"0.9985005000000000\",\"USDD\":\"1.0000997000000000\",\"CWAR\":\"0.0037981000000000\",\"USDC\":\"0.9997998500000000\",\"KRL\":\"0.3543127550000000\",\"INJ\":\"21.7691100000000194\",\"GAME\":\"0.0139630150000000\",\"TRIBL\":\"1.0994500000000000\",\"XLM\":\"0.0948525500000000\",\"TRBUP\":\"0.0012293850000000\",\"VRADOWN\":\"0.0013433280000000\",\"SUPER\":\"1.2853570000000000\",\"EIGEN\":\"3.1536223999999999\",\"IOI\":\"0.0146926500000000\",\"KSM\":\"17.5212350000000129\",\"CCD\":\"0.0034832575000000\",\"EGO\":\"0.0093553200000000\",\"EGP\":\"2.7946019999999998\",\"MXC\":\"0.0066866550000000\",\"TEL\":\"0.0014432780000000\",\"MOVR\":\"9.1340307000000027\",\"XMR\":\"155.5421899999990755\",\"MXM\":\"0.0092853550000000\",\"OORT\":\"0.1099949750000000\",\"GLM\":\"0.3231383500000000\",\"RAY\":\"2.0228880499999998\",\"XTAG\":\"0.0218190850000000\",\"GLQ\":\"0.0854572500000000\",\"CWEB\":\"0.0038480750000000\",\"REVU\":\"0.0105047450000000\",\"REVV\":\"0.0039760110000000\",\"ZRO\":\"3.7952014499999994\",\"XNL\":\"0.0093853050000000\",\"XNO\":\"0.8496749500000000\",\"SAROS\":\"0.0019290350000000\",\"KACE\":\"2.1165411999999998\",\"ZRX\":\"0.3186406000000000\",\"WLTH\":\"0.0374312750000000\",\"ATOM3L\":\"0.0321719060000000\",\"GMM\":\"0.0001497251000000\",\"BEER\":\"0.0000138670630000\",\"GMT\":\"0.1275362000000000\",\"HEART\":\"0.0159920000000000\",\"GMX\":\"22.7186349999999882\",\"ABBC\":\"0.0061769100000000\",\"OMNI\":\"8.9235359999999970\",\"ATOM3S\":\"0.0007945225400000\",\"IRL\":\"0.0099650150000000\",\"CFG\":\"0.3248375000000000\",\"WSDM\":\"0.0139830050000000\",\"GNS\":\"1.8390800000000001\",\"VANRY\":\"0.0809295150000000\",\"CFX\":\"0.1595202000000000\",\"GRAIL\":\"817.1212349999937891\",\"BEFI\":\"0.0175712100000000\",\"VELO\":\"0.0132043945000000\",\"XPR\":\"0.0008077959000000\",\"DOVI\":\"0.0584707500000000\",\"ACE\":\"0.0021349320000000\",\"ACH\":\"0.0190534685000000\",\"ISP\":\"0.0012161916000000\",\"XCAD\":\"0.2834582000000000\",\"MINA\":\"0.5630183500000000\",\"TIA\":\"5.9318325999999999\",\"DRIFT\":\"0.4350823500000000\",\"ACQ\":\"0.0056981495000000\",\"ACS\":\"0.0014917537500000\",\"MIND\":\"0.0018920535000000\",\"STORE\":\"0.0062358805000000\",\"REN\":\"0.0351224300000000\",\"ELA\":\"1.7282354500000000\",\"DREAMS\":\"0.0002498750000000\",\"ADA\":\"0.3463267500000000\",\"ELF\":\"0.3777110500000000\",\"REQ\":\"0.0959919800000000\",\"STORJ\":\"0.5662167500000000\",\"LADYS\":\"0.0000000837581000\",\"PAXG\":\"2697.9303600003123340\",\"REZ\":\"0.0409795000000000\",\"XRD\":\"0.0157821050000000\",\"CHO\":\"0.0205097400000000\",\"CHR\":\"0.1769115000000000\",\"ADS\":\"0.1889055000000000\",\"CHZ\":\"0.0738030800000000\",\"ADX\":\"0.1575212000000000\",\"XRP\":\"0.5525036100000000\",\"JASMY\":\"0.0188615645000000\",\"KAGI\":\"0.1834582250000000\",\"FIDA\":\"0.2282858000000000\",\"PBR\":\"0.0291953950000000\",\"AEG\":\"0.0093453250000000\",\"H2O\":\"0.1610194500000000\",\"CHMB\":\"0.0001715641750000\",\"SAND3L\":\"0.0015447972150000\",\"PBX\":\"0.0006879558500000\",\"SOLVE\":\"0.0084557700000000\",\"DECHAT\":\"0.1512243500000000\",\"GARI\":\"0.0076861550000000\",\"SHIB2L\":\"1.1996998499999999\",\"SHIB2S\":\"0.0240879500000000\",\"ENA\":\"0.3942028000000000\",\"VEMP\":\"0.0029335325000000\",\"ENJ\":\"0.1467266000000000\",\"AFG\":\"0.0072163900000000\",\"RATS\":\"0.0001211593900000\",\"GRT\":\"0.1646076550000000\",\"FORWARD\":\"0.0012873560000000\",\"TFUEL\":\"0.0598800450000000\",\"ENS\":\"17.0634640000000052\",\"KASDOWN\":\"0.0258770550000000\",\"XTM\":\"0.0251074400000000\",\"DEGEN\":\"0.0084857550000000\",\"TLM\":\"0.0100449750000000\",\"DYDXDOWN\":\"0.1042598440000000\",\"CKB\":\"0.0146026950000000\",\"LUNC\":\"0.0000889255150000\",\"AURORA\":\"0.1204397500000000\",\"LUNA\":\"0.3624187000000000\",\"XTZ\":\"0.6776610000000000\",\"ELON\":\"0.0000001410294500\",\"DMTR\":\"0.0891554000000000\",\"EOS\":\"0.4759619000000000\",\"GST\":\"0.0118940500000000\",\"FORT\":\"0.1155422000000000\",\"FLAME\":\"0.0247076400000000\",\"PATEX\":\"0.9605195000000000\",\"DEEP\":\"0.0328885475000000\",\"ID3L\":\"0.0016201895000000\",\"GTC\":\"0.6625685500000000\",\"ID3S\":\"0.0071674145000000\",\"RIO\":\"0.7616190000000000\",\"CLH\":\"0.0008555720000000\",\"BURGER\":\"0.4016990500000000\",\"VRA\":\"0.0029765110000000\",\"SUNDOG\":\"0.2173912500000000\",\"GTT\":\"0.0002038980000000\",\"INJUP\":\"0.2327835500000000\",\"CPOOL\":\"0.1557720750000000\",\"EPX\":\"0.0000740629500000\",\"CLV\":\"0.0329835000000000\",\"FEAR\":\"0.0560519600000000\",\"MEME\":\"0.0124847545000000\",\"ROOBEE\":\"0.0004520738500000\",\"DEFI\":\"0.0192903500000000\",\"TOKEN\":\"0.0477361200000000\",\"GRAPE\":\"0.0020599695000000\",\"KASUP\":\"0.3996001000000000\",\"XWG\":\"0.0003843077500000\",\"SKEY\":\"0.0621289200000000\",\"SFUND\":\"1.3243375000000000\",\"EQX\":\"0.0032823580000000\",\"ORDIUP\":\"0.0548315705000000\",\"TON\":\"5.1857058499999995\",\"DEGO\":\"2.2667660500000001\",\"IZI\":\"0.0088455750000000\",\"ERG\":\"0.6605695500000000\",\"ERN\":\"1.9255367500000001\",\"VENOM\":\"0.0817591000000000\",\"VOXEL\":\"0.1497251000000000\",\"RLC\":\"1.4649671500000000\",\"PHA\":\"0.1093453000000000\",\"DYDXUP\":\"0.0112573685000000\",\"APE3S\":\"0.0008475760000000\",\"ORBS\":\"0.0288955450000000\",\"OPDOWN\":\"0.6758619000000000\",\"ESE\":\"0.0139130400000000\",\"APE3L\":\"0.1339330000000000\",\"HMND\":\"0.0982208650000000\",\"COQ\":\"0.0000014432780000\",\"AURY\":\"0.3340329000000000\",\"CULT\":\"0.0000028025980000\",\"AKT\":\"2.4642672500000001\",\"GLMR\":\"0.1606196500000000\",\"XYM\":\"0.0142528700000000\",\"ORAI\":\"6.1769100000000012\",\"XYO\":\"0.0058680645000000\",\"ETC\":\"18.8458723500000169\",\"LAI\":\"0.0142828550000000\",\"PIP\":\"0.0178310800000000\",\"ETH\":\"2607.6655149998362673\",\"NEO\":\"10.3575186499999991\",\"RMV\":\"0.0081659150000000\",\"KLAY\":\"0.1251374000000000\",\"PIT\":\"0.0000000003268365\",\"TARA\":\"0.0043978000000000\",\"KALT\":\"0.1128735350000000\",\"PIX\":\"0.0001023687900000\",\"ETN\":\"0.0021579205000000\",\"CSIX\":\"0.0141729100000000\",\"TRADE\":\"0.4708644500000000\",\"MAVIA\":\"1.3592200500000001\",\"HIGH\":\"1.3043474999999999\",\"TRB\":\"62.5387150000000006\",\"ORDI\":\"35.7421200000000126\",\"TRVL\":\"0.0373643085000000\",\"AMB\":\"0.0059670150000000\",\"TRU\":\"0.0762018800000000\",\"LOGX\":\"0.0271963950000000\",\"FINC\":\"0.0362018900000000\",\"INFRA\":\"0.1978010500000000\",\"NATIX\":\"0.0008729633000000\",\"NFP\":\"0.2152923000000000\",\"TRY\":\"0.0292166033323590\",\"TRX\":\"0.1597201000000000\",\"LBP\":\"0.0001243378000000\",\"LBR\":\"0.0595702000000000\",\"EUL\":\"2.9735125000000000\",\"NFT\":\"0.0000004077960000\",\"SEIUP\":\"0.0478110825000000\",\"PUFFER\":\"0.3676161000000000\",\"EUR\":\"1.0811249323958897\",\"ORCA\":\"2.0664662499999999\",\"NEAR3L\":\"0.0117010765350000\",\"AMP\":\"0.0038330825000000\",\"XDEFI\":\"0.0472563600000000\",\"HIFI\":\"0.4947525000000000\",\"TRUF\":\"0.0459570100000000\",\"AITECH\":\"0.1045477000000000\",\"AMU\":\"0.0043978000000000\",\"USTC\":\"0.0214692600000000\",\"KNGL\":\"0.0499750000000000\",\"FOXY\":\"0.0102686631000000\",\"NGC\":\"0.0147935995000000\",\"TENET\":\"0.0043278350000000\",\"NEAR3S\":\"0.0072553705000000\",\"MAHA\":\"1.1904045000000000\",\"NGL\":\"0.0701748950000000\",\"TST\":\"0.0080359800000000\",\"HIPPO\":\"0.0104447750000000\",\"AXS3S\":\"0.0308705570000000\",\"CRO\":\"0.0781409100000000\",\"ZPAY\":\"0.0050574700000000\",\"MNDE\":\"0.1026786350000000\",\"CRV\":\"0.2534732000000000\",\"SWASH\":\"0.0056271850000000\",\"AXS3L\":\"0.0106388779000000\",\"VERSE\":\"0.0001803098000000\",\"RPK\":\"0.0049975000000000\",\"RPL\":\"10.9745099999999958\",\"AZERO\":\"0.3789104500000000\",\"SOUL\":\"0.0534332700000000\",\"VXV\":\"0.2619689500000000\",\"LDO\":\"1.0885554500000000\",\"MAGIC\":\"0.3390304000000000\",\"ALICE\":\"1.0324835000000000\",\"SEAM\":\"1.1933030499999999\",\"PLU\":\"1.9300345000000001\",\"AOG\":\"0.0031224380000000\",\"SMOLE\":\"0.0000387806000000\",\"EWT\":\"1.1094450000000000\",\"TSUGT\":\"0.0029185400000000\",\"PMG\":\"0.0800599500000000\",\"OPAI\":\"0.0006826585000000\",\"LOCUS\":\"0.0216591650000000\",\"CTA\":\"0.0825087250000000\",\"NIM\":\"0.0013673160000000\",\"CTC\":\"0.4033982000000000\",\"APE\":\"0.7035480500000000\",\"MERL\":\"0.2720639000000000\",\"JAM\":\"0.0004770613500000\",\"CTI\":\"0.0130314810000000\",\"APP\":\"0.0021989000000000\",\"APT\":\"9.9947001500000000\",\"WLDUP\":\"0.0093043455000000\",\"ZEND\":\"0.1280759300000000\",\"FIRE\":\"0.9113441000000000\",\"DENT\":\"0.0008630682500000\",\"PYTH\":\"0.3390603850000000\",\"LFT\":\"0.0155322300000000\",\"DPET\":\"0.0319040400000000\",\"ORDIDOWN\":\"0.3788105000000000\",\"KPOL\":\"0.0029175405000000\",\"ETHUP\":\"8.4971493000000032\",\"BAND\":\"1.0939527500000001\",\"POL\":\"0.3656171000000000\",\"ASTR\":\"0.0582608550000000\",\"NKN\":\"0.0691654000000000\",\"RSR\":\"0.0068055955000000\",\"DVPN\":\"0.0005979009000000\",\"TWT\":\"1.1119437500000000\",\"ARB\":\"0.5510243500000000\",\"CVC\":\"0.1409801746501747\",\"ARC\":\"0.0300849500000000\",\"XETA\":\"0.0022888550000000\",\"MTRG\":\"0.4007995000000000\",\"LOKA\":\"0.1867066000000000\",\"LPOOL\":\"0.0660069800000000\",\"TURBOS\":\"0.0034812585000000\",\"CVX\":\"1.7816087499999999\",\"ARX\":\"0.0007556220000000\",\"MPLX\":\"0.4355221300000000\",\"SUSHI\":\"0.7011492500000000\",\"NLK\":\"0.0114442750000000\",\"PEPE2\":\"0.0000000313843000\",\"WBTC\":\"66881.4425499645548419\",\"SUI3L\":\"0.0211204345000000\",\"CWS\":\"0.1927036000000000\",\"SUI3S\":\"0.0000579110300000\",\"INSP\":\"0.0264167850000000\",\"MANA\":\"0.2945026750000000\",\"VRTX\":\"0.0641679000000000\",\"CSPR\":\"0.0116441750000000\",\"ATA\":\"0.0785007300000000\",\"OPEN\":\"0.0080049955000000\",\"HAI\":\"0.0448275750000000\",\"NMR\":\"14.7436245000000072\",\"ATH\":\"0.0540929400000000\",\"LIT\":\"0.6282857000000000\",\"TLOS\":\"0.3263467450000000\",\"TNSR\":\"0.3662168000000000\",\"CXT\":\"0.0871364100000000\",\"POLYX\":\"0.2346826000000000\",\"ZERO\":\"0.0002507745500000\",\"ROUTE\":\"0.0610694500000000\",\"LOOM\":\"0.0580009850000000\",\"PRE\":\"0.0078680640000000\",\"VRAUP\":\"0.0134652640000000\",\"HBB\":\"0.0714742450000000\",\"RVN\":\"0.0165017450000000\",\"PRQ\":\"0.0715741950000000\",\"ONDO\":\"0.7134930750000000\",\"PEPEDOWN\":\"0.0000155022450000\",\"WOOP\":\"0.0020179905000000\",\"LUNCUP\":\"0.0168355780000000\",\"KAVA\":\"0.3522238000000000\",\"LKI\":\"0.0104187880000000\",\"AVA\":\"0.4857570000000000\",\"NOM\":\"0.0233883000000000\",\"MAPO\":\"0.0089015470000000\",\"PEPEUP\":\"0.0114252845000000\",\"STRAX\":\"0.0487156300000000\",\"NOT\":\"0.0078670645000000\",\"ZERC\":\"0.1108245600000000\",\"BCUT\":\"0.0255672100000000\",\"MASA\":\"0.0691354150000000\",\"WAN\":\"0.1785077544737212\",\"WAT\":\"0.0003273762300000\",\"WAX\":\"0.0327636100000000\",\"MASK\":\"2.2259864500000002\",\"EOS3L\":\"0.0002122138400000\",\"IDEA\":\"0.0005887055000000\",\"EOS3S\":\"0.0034472755000000\",\"YFI\":\"4919.4290549999908843\",\"MOODENG\":\"0.0774612500000000\",\"XCUR\":\"0.0048845565000000\",\"HYDRA\":\"0.2225886500000000\",\"POPCAT\":\"1.3382305500000000\",\"LQTY\":\"0.7848074000000000\",\"PIXEL\":\"0.1406596350000000\",\"LMR\":\"0.0145437245000000\",\"ZETA\":\"0.5997999500000000\",\"YGG\":\"0.4717640000000000\",\"AXS\":\"4.6006985000000006\",\"BCHSV\":\"49.8250749999999370\",\"NRN\":\"0.0395802000000000\",\"FTON\":\"0.0091954000000000\",\"COMP\":\"43.6581599999999881\",\"XPRT\":\"0.1819090000000000\",\"HFT\":\"0.1443278000000000\",\"UXLINK\":\"0.5085456000000000\",\"STAMP\":\"0.0335032400000000\",\"RUNE\":\"4.9233370999999996\",\"ZEUS\":\"0.2587705500000000\",\"LTC3L\":\"1.8294848000000001\",\"DAPP\":\"0.1763118000000000\",\"FORTH\":\"2.9508238500000004\",\"ALPINE\":\"1.5322335000000000\",\"SENSO\":\"0.0328835500000000\",\"LTC3S\":\"0.0006986505000000\",\"DEXE\":\"8.3795081500000028\",\"GOAL\":\"0.0175912000000000\",\"AVAX\":\"27.5602130000000058\",\"LISTA\":\"0.3782108000000000\",\"AMPL\":\"1.3743124999999999\",\"WORK\":\"0.1384307500000000\",\"BRWL\":\"0.0017391300000000\",\"BANANA\":\"57.1314200000001362\",\"PUSH\":\"0.0750624500000000\",\"WEN\":\"0.0001015492000000\",\"NEIRO\":\"0.0879560000000000\",\"BTCUP\":\"34.7711057499999789\",\"SOL3S\":\"0.0007816090000000\",\"BRAWL\":\"0.0004776610500000\",\"LAY3R\":\"0.2161918500000000\",\"LPT\":\"11.9304317999999945\",\"GODS\":\"0.1807096000000000\",\"SAND3S\":\"4.6152911999999992\",\"RDNT\":\"0.0640679500000000\",\"SOL3L\":\"1.8351913752850000\",\"NIBI\":\"0.0653772950000000\",\"NUM\":\"0.0436181800000000\",\"PYR\":\"2.5590198499999997\",\"DAG\":\"0.0226176855000000\",\"DAI\":\"0.9989006596042375\",\"HIP\":\"0.0034982500000000\",\"DAO\":\"0.2848575000000000\",\"AVAIL\":\"0.1300929210000000\",\"DAR\":\"0.1512243500000000\",\"FET\":\"1.3760116500000000\",\"FCON\":\"0.0001197600900000\",\"XAVA\":\"0.3789104500000000\",\"LRC\":\"0.1208395500000000\",\"UNI3S\":\"0.0000653573050000\",\"PZP\":\"0.0599600050000000\",\"POKT\":\"0.0424787500000000\",\"DASH\":\"23.6881500000000109\",\"BAKEDOWN\":\"0.0003324636850000\",\"POLC\":\"0.0061389290000000\",\"DBR\":\"0.0377671070000000\",\"CIRUS\":\"0.0055772100000000\",\"UNI3L\":\"0.0993921490650000\",\"NWC\":\"0.0681659000000000\",\"POLK\":\"0.0142628650000000\",\"LSD\":\"0.9420287500000000\",\"MARS4\":\"0.0005878059500000\",\"LSK\":\"0.8080957500000000\",\"BLOCK\":\"0.0261869000000000\",\"ANALOS\":\"0.0000446776500000\",\"SAFE\":\"0.8779608000000000\",\"DCK\":\"0.0234082900000000\",\"LSS\":\"0.0562718500000000\",\"DCR\":\"12.4337799999999929\",\"LIKE\":\"0.0559720000000000\",\"DATA\":\"0.0361819000000000\",\"WIF\":\"2.5696145499999999\",\"BLOK\":\"0.0006546725000000\",\"LTC\":\"71.6261690000000611\",\"METIS\":\"42.0289750000000612\",\"WIN\":\"0.0000868365600000\",\"HLG\":\"0.0018790600000000\",\"LTO\":\"0.1166116650000000\",\"DYDX\":\"0.9341327000000000\",\"ARB3S\":\"0.0509025360000000\",\"MUBI\":\"0.0303848000000000\",\"ARB3L\":\"0.0025917035000000\",\"RBTC1\":\"0.0000039480250000\",\"POND\":\"0.0118640650000000\",\"LINA\":\"0.0037771105000000\",\"MYRIA\":\"0.0025337325000000\",\"LINK\":\"11.0244849999999944\",\"QTUM\":\"2.4262016723130069\",\"TUNE\":\"0.0148025950000000\",\"UFO\":\"0.0000006479758500\",\"CYBER\":\"2.8755615000000001\",\"WILD\":\"0.2433782500000000\",\"POLS\":\"0.2809594500000000\",\"NYM\":\"0.0719640000000000\",\"FIL\":\"3.6786597500000005\",\"BAL\":\"2.0099945000000000\",\"SCA\":\"0.3999999000000000\",\"STND\":\"0.0133123405000000\",\"WMTX\":\"0.2138930000000000\",\"SCLP\":\"0.1545227000000000\",\"MANEKI\":\"0.0073963000000000\",\"BAT\":\"0.1721139000000000\",\"AKRO\":\"0.0042302838000000\",\"FTM3L\":\"8.2574692000000024\",\"BAX\":\"0.0000709645000000\",\"FTM3S\":\"0.0000255072400000\",\"COTI\":\"0.0951524000000000\"}}" + data := "{\n \"code\": \"200000\",\n \"data\": {\n \"time\": 1729176273859,\n \"sequence\": \"14610502970\",\n \"bids\": [\n [\n \"66976.4\",\n \"0.69109872\"\n ],\n [\n \"66976.3\",\n \"0.14377\"\n ]\n ],\n \"asks\": [\n [\n \"66976.5\",\n \"0.05408199\"\n ],\n [\n \"66976.8\",\n \"0.0005\"\n ]\n ]\n }\n}" commonResp := &types.RestResponse{} err := json.Unmarshal([]byte(data), commonResp) assert.Nil(t, err) assert.NotNil(t, commonResp.Data) - resp := &GetFiatPriceResp{} + resp := &GetPartOrderBookResp{} err = json.Unmarshal([]byte(commonResp.Data), resp) resp.ToMap() assert.Nil(t, err) } -func TestMarketGetServiceStatusReqModel(t *testing.T) { - // GetServiceStatus - // Get Service Status - // /api/v1/status +func TestMarketGetFullOrderBookReqModel(t *testing.T) { + // GetFullOrderBook + // Get Full OrderBook + // /api/v3/market/orderbook/level2 + data := "{\"symbol\": \"BTC-USDT\"}" + req := &GetFullOrderBookReq{} + err := json.Unmarshal([]byte(data), req) + req.ToMap() + assert.Nil(t, err) } -func TestMarketGetServiceStatusRespModel(t *testing.T) { - // GetServiceStatus - // Get Service Status - // /api/v1/status +func TestMarketGetFullOrderBookRespModel(t *testing.T) { + // GetFullOrderBook + // Get Full OrderBook + // /api/v3/market/orderbook/level2 - data := "{\"code\":\"200000\",\"data\":{\"status\":\"open\",\"msg\":\"\"}}" + data := "{\n \"code\": \"200000\",\n \"data\": {\n \"time\": 1729176273859,\n \"sequence\": \"14610502970\",\n \"bids\": [\n [\n \"66976.4\",\n \"0.69109872\"\n ],\n [\n \"66976.3\",\n \"0.14377\"\n ]\n ],\n \"asks\": [\n [\n \"66976.5\",\n \"0.05408199\"\n ],\n [\n \"66976.8\",\n \"0.0005\"\n ]\n ]\n }\n}" commonResp := &types.RestResponse{} err := json.Unmarshal([]byte(data), commonResp) assert.Nil(t, err) assert.NotNil(t, commonResp.Data) - resp := &GetServiceStatusResp{} + resp := &GetFullOrderBookResp{} err = json.Unmarshal([]byte(commonResp.Data), resp) resp.ToMap() assert.Nil(t, err) } -func TestMarketGetServerTimeReqModel(t *testing.T) { - // GetServerTime - // Get Server Time - // /api/v1/timestamp +func TestMarketGetFiatPriceReqModel(t *testing.T) { + // GetFiatPrice + // Get Fiat Price + // /api/v1/prices + data := "{\"base\": \"USD\", \"currencies\": \"example_string_default_value\"}" + req := &GetFiatPriceReq{} + err := json.Unmarshal([]byte(data), req) + req.ToMap() + assert.Nil(t, err) } -func TestMarketGetServerTimeRespModel(t *testing.T) { - // GetServerTime - // Get Server Time - // /api/v1/timestamp +func TestMarketGetFiatPriceRespModel(t *testing.T) { + // GetFiatPrice + // Get Fiat Price + // /api/v1/prices - data := "{\"code\":\"200000\",\"data\":1729100692873}" + data := "{\"code\":\"200000\",\"data\":{\"AGLD\":\"1.1174410000000001\",\"DFI\":\"0.0168915500000000\",\"PYTHUP\":\"0.0397880960000000\",\"ISLM\":\"0.0606196750000000\",\"NEAR\":\"4.7185395500000000\",\"AIOZ\":\"0.4862867350000000\",\"AUDIO\":\"0.1219390000000000\",\"BBL\":\"0.0067766100000000\",\"WLD\":\"2.2893547500000000\",\"HNT\":\"5.8990489999999984\",\"ETHFI\":\"1.5892050000000000\",\"DMAIL\":\"0.2726636000000000\",\"OPUP\":\"0.0986506500000000\",\"VET3S\":\"0.0003700448850000\",\"MANA3S\":\"0.0006056970000000\",\"TIDAL\":\"0.0001154422500000\",\"HALO\":\"0.0058270850000000\",\"OPUL\":\"0.0839480050000000\",\"MANA3L\":\"0.0029569407900000\",\"DGB\":\"0.0066556705000000\",\"AA\":\"0.2406796000000000\",\"BCH\":\"366.2167999999996484\",\"GMEE\":\"0.0113333305000000\",\"JST\":\"0.0302348750000000\",\"PBUX\":\"0.0208795550000000\",\"AR\":\"18.5457224999999909\",\"SEI\":\"0.4332832500000000\",\"PSTAKE\":\"0.0493153300000000\",\"LMWR\":\"0.1618190500000000\",\"UNFIDOWN\":\"0.0062058955000000\",\"BB\":\"0.3245376500000000\",\"JTO\":\"2.1239375000000002\",\"WEMIX\":\"0.7916040000000000\",\"G\":\"0.0324037900000000\",\"MARSH\":\"0.0617591050000000\",\"BN\":\"0.0036961510000000\",\"FLIP\":\"1.0976509000000000\",\"FLR\":\"0.0144827550000000\",\"BIGTIME\":\"0.1238780300000000\",\"FLY\":\"0.0005157420000000\",\"T\":\"0.0233483200000000\",\"W\":\"0.2865566500000000\",\"BDX\":\"0.0774012800000000\",\"BABYDOGE\":\"0.0000000029375305\",\"SFP\":\"0.7256370000000000\",\"DIA\":\"0.9179408000000000\",\"ISME\":\"0.0022388800000000\",\"LYM\":\"0.0010155919500000\",\"VET3L\":\"0.0000289755050000\",\"JUP\":\"0.8230882500000000\",\"LYX\":\"1.4501745500000001\",\"AIEPK\":\"0.0050094940000000\",\"SILLY\":\"0.0159420250000000\",\"SCPT\":\"0.0122038950000000\",\"WOO\":\"0.1796601250000000\",\"BLUR\":\"0.2462768000000000\",\"STRK\":\"0.3963117450000000\",\"BFC\":\"0.0383608100000000\",\"DC\":\"0.0003097450500000\",\"KARATE\":\"0.0007296350000000\",\"SUSHI3L\":\"0.5115441000000000\",\"NETVR\":\"0.0976111700000000\",\"WAVES\":\"1.0806594000000000\",\"LITH\":\"0.0001520239500000\",\"HAPI\":\"8.6533711499999987\",\"SUSHI3S\":\"1.2752620500000000\",\"CEEK\":\"0.0294852500000000\",\"FLOKI\":\"0.0001414292500000\",\"SHR\":\"0.0012463765000000\",\"SAND\":\"0.2566616050000000\",\"TURT\":\"0.0020889550000000\",\"UMA\":\"2.5207390000000000\",\"BEPRO\":\"0.0003955021500000\",\"SCRT\":\"0.1995002000000000\",\"TUSD\":\"0.9945025000000000\",\"COOKIE\":\"0.0220089900000000\",\"LRDS\":\"0.6218889000000000\",\"SIN\":\"0.0033633175000000\",\"OAS\":\"0.0331933950000000\",\"ROOT\":\"0.0183108400000000\",\"ADA3L\":\"0.0046396790000000\",\"TIAUP\":\"0.1228385500000000\",\"HTR\":\"0.0353023400000000\",\"UNB\":\"0.0003837080500000\",\"UNA\":\"0.0164917500000000\",\"HARD\":\"0.1087056200000000\",\"G3\":\"0.0502648550000000\",\"ADA3S\":\"0.0006191202850000\",\"MYRO\":\"0.1071863800000000\",\"HTX\":\"0.0000013693150000\",\"FT\":\"0.3585206500000000\",\"BTCDOWN\":\"0.1065467000000000\",\"UNI\":\"7.3571195999999993\",\"FX\":\"0.1379310000000000\",\"OBI\":\"0.0079030465000000\",\"UNO\":\"0.0137131400000000\",\"WRX\":\"0.1221389000000000\",\"TIADOWN\":\"0.0000914642450000\",\"ETHDOWN\":\"0.1306346500000000\",\"WELL\":\"0.0471244260000000\",\"SWFTC\":\"0.0028966509500000\",\"SKL\":\"0.0362418700000000\",\"UOS\":\"0.0867765900000000\",\"AIPAD\":\"0.0478660550000000\",\"BRETT\":\"0.1037481000000000\",\"SKY\":\"0.0520139800000000\",\"FRM\":\"0.0153123400000000\",\"VISION\":\"0.0014451770500000\",\"LENDS\":\"0.0047276350000000\",\"SLF\":\"0.3318340000000000\",\"BULL\":\"0.0023988000000000\",\"FLOW\":\"0.5372312500000000\",\"ODDZ\":\"0.0063368300000000\",\"SLN\":\"0.2804597000000000\",\"UPO\":\"0.0440779500000000\",\"SLP\":\"0.0023997995000000\",\"ID\":\"0.3718140000000000\",\"SLIM\":\"0.0906446550000000\",\"SPOT\":\"0.0021289350000000\",\"DOP\":\"0.0023028480000000\",\"ISSP\":\"0.0000874562500000\",\"UQC\":\"3.2339822000000003\",\"IO\":\"1.8185902499999999\",\"DOT\":\"4.2022978000000005\",\"1INCH\":\"0.2645676500000000\",\"SMH\":\"0.3448275000000000\",\"MAK\":\"0.0396701550000000\",\"TOKO\":\"0.0005923037000000\",\"TURBO\":\"0.0108085930000000\",\"UNFI\":\"2.8555714999999996\",\"MAN\":\"0.0210764565000000\",\"EVER\":\"0.0332733550000000\",\"FTM\":\"0.7259068650000000\",\"SHRAP\":\"0.0476361700000000\",\"MAV\":\"0.1738130500000000\",\"MAX\":\"0.2864966800000000\",\"DPR\":\"0.0018240875000000\",\"FTT\":\"2.0559715000000002\",\"ARKM\":\"1.7444273499999999\",\"ATOM\":\"4.2954512000000002\",\"PENDLE\":\"4.1554212500000007\",\"QUICK\":\"0.0365317250000000\",\"BLZ\":\"0.1217191100000000\",\"BOBA\":\"0.2014092450000000\",\"MBL\":\"0.0027856065000000\",\"OFN\":\"0.1252373500000000\",\"UNIO\":\"0.0025487250000000\",\"SNS\":\"0.0200899500000000\",\"SNX\":\"1.4282854999999999\",\"NXRA\":\"0.0272763550000000\",\"TAIKO\":\"1.4392800000000001\",\"AVAX3L\":\"0.1410875109550000\",\"L3\":\"0.0608395650000000\",\"API3\":\"1.3728132500000001\",\"XRP3S\":\"0.0028095945000000\",\"QKC\":\"0.0085157400000000\",\"AVAX3S\":\"0.5148424500000000\",\"ROSE\":\"0.0693453100000000\",\"SATS\":\"0.0000002701648500\",\"BMX\":\"0.3100449000000000\",\"PORTAL\":\"0.2811593500000000\",\"TOMI\":\"0.0309045400000000\",\"XRP3L\":\"2.1586201500000002\",\"SOL\":\"151.7250995000003583\",\"SON\":\"0.0002421788500000\",\"BNC\":\"0.1882058500000000\",\"SOCIAL\":\"0.0026486750000000\",\"CGPT\":\"0.1305147100000000\",\"CELR\":\"0.0127736100000000\",\"BNB\":\"591.0973035000118935\",\"OGN\":\"0.0852573500000000\",\"CELO\":\"0.7711142500000000\",\"AUCTION\":\"13.1634150000000014\",\"MANTA\":\"0.7564216000000000\",\"LAYER\":\"0.0372713550000000\",\"AERO\":\"1.3783104999999999\",\"CETUS\":\"0.1808295400000000\",\"LL\":\"0.0201199350000000\",\"SPA\":\"0.0067426270000000\",\"PYTHDOWN\":\"0.0011834080000000\",\"NEIROCTO\":\"0.0019964013000000\",\"UTK\":\"0.0365217300000000\",\"GMRX\":\"0.0007386305000000\",\"BOB\":\"0.0000380619595000\",\"HOTCROSS\":\"0.0056491740000000\",\"AERGO\":\"0.1007595950000000\",\"MOCA\":\"0.0783608000000000\",\"SQD\":\"0.0380809500000000\",\"MV\":\"0.0081359300000000\",\"BNB3L\":\"0.2761618500000000\",\"BNB3S\":\"0.0008545725000000\",\"GALAX3L\":\"0.0057571999600000\",\"KAI\":\"0.0020080954500000\",\"SQR\":\"0.0470764500000000\",\"GALAX3S\":\"0.1933033000000000\",\"EGLD\":\"25.5272299999999713\",\"ZBCN\":\"0.0010404795000000\",\"KAS\":\"0.1216691350000000\",\"MEW\":\"0.0086176890000000\",\"PUNDIX\":\"0.4130933500000000\",\"LOOKS\":\"0.0392803500000000\",\"FXS\":\"1.9060465000000000\",\"BOSON\":\"0.2732633000000000\",\"BRISE\":\"0.0000000860569500\",\"AEVO\":\"0.3388305000000000\",\"FLUX\":\"0.5276360500000000\",\"PRCL\":\"0.1969015000000000\",\"UNFIUP\":\"0.0011654170000000\",\"SEIDOWN\":\"0.0442778500000000\",\"DOAI\":\"0.0052363805000000\",\"QNT\":\"65.4312679999998206\",\"REDO\":\"0.2837580500000000\",\"STRIKE\":\"6.8225869999999997\",\"ETHW\":\"3.2418782499999998\",\"OM\":\"1.5396797750000000\",\"OP\":\"1.6911539999999999\",\"WHALE\":\"0.8134930500000000\",\"1CAT\":\"0.0018460765000000\",\"NEON\":\"0.4446775500000000\",\"GTAI\":\"0.7786105000000000\",\"SSV\":\"21.2393749999999841\",\"ETH2\":\"2601.6678843156403923\",\"KCS\":\"8.7646155000000020\",\"ARPA\":\"0.0393882960000000\",\"ARTFI\":\"0.0141029450000000\",\"BRL\":\"0.1742807323452485\",\"ALEX\":\"0.0924537500000000\",\"STG\":\"0.2943527500000000\",\"SHIB\":\"0.0000178060925000\",\"IOTX\":\"0.0394202800000000\",\"OLE\":\"0.0171414250000000\",\"KDA\":\"0.5653172000000000\",\"CERE\":\"0.0022548720000000\",\"DOCK\":\"0.0018990500000000\",\"STX\":\"1.8157916500000000\",\"OLT\":\"0.0007596200000000\",\"QI\":\"0.0131754090000000\",\"SDAO\":\"0.2748625000000000\",\"BLAST\":\"0.0087636160000000\",\"LINK3S\":\"0.0000702948350000\",\"IOST\":\"0.0049745115000000\",\"SUI\":\"2.0589700000000000\",\"CAKE\":\"1.7941024999999999\",\"BSW\":\"0.0586706500000000\",\"OMG\":\"0.2597700500000000\",\"VOLT\":\"0.0000002716641000\",\"LINK3L\":\"1.3408292499999999\",\"GEEQ\":\"0.0385607100000000\",\"PYUSD\":\"0.9988003500000000\",\"SUN\":\"0.0186106900000000\",\"TOWER\":\"0.0014812590000000\",\"BTC\":\"67133.4165000832051564\",\"IOTA\":\"0.1189405000000000\",\"REEF\":\"0.0019960015000000\",\"TRIAS\":\"3.3683149999999998\",\"KEY\":\"0.0037594713240047\",\"ETH3L\":\"0.0003305946200000\",\"BTT\":\"0.0000009117439000\",\"ONE\":\"0.0132003965000000\",\"RENDER\":\"5.2263854999999995\",\"ETH3S\":\"0.5517240000000000\",\"ANKR\":\"0.0264867500000000\",\"ALGO\":\"0.1188405500000000\",\"SYLO\":\"0.0007600198000000\",\"ZCX\":\"0.0784707450000000\",\"SD\":\"0.3851073500000000\",\"ONT\":\"0.1877960550000000\",\"MJT\":\"0.0132433750000000\",\"DYM\":\"1.6659666000000001\",\"DYP\":\"0.0205397250000000\",\"BAKEUP\":\"0.0389894955000000\",\"OOE\":\"0.0079360300000000\",\"ZELIX\":\"0.0000649675000000\",\"DOGE3L\":\"0.3837080500000000\",\"ARTY\":\"0.3980009000000000\",\"QORPO\":\"0.1204297550000000\",\"ICE\":\"0.0051504235000000\",\"NOTAI\":\"0.0000892753400000\",\"DOGE3S\":\"0.2291853500000000\",\"NAKA\":\"1.0695649500000000\",\"GALAX\":\"0.0212893500000000\",\"MKR\":\"1245.8767500000163833\",\"DODO\":\"0.1152423500000000\",\"ICP\":\"7.6731615000000027\",\"ZEC\":\"35.9400209999999543\",\"ZEE\":\"0.0065767100000000\",\"ICX\":\"0.1383308000000000\",\"KMNO\":\"0.0921499020000000\",\"TT\":\"0.0033883050000000\",\"DOT3L\":\"0.1454272500000000\",\"XAI\":\"0.2038980000000000\",\"ZEN\":\"8.0149905000000007\",\"DOGE\":\"0.1213093150000000\",\"ALPHA\":\"0.0567416150000000\",\"DUSK\":\"0.1964517250000000\",\"DOT3S\":\"0.0053613180000000\",\"SXP\":\"0.2538730000000000\",\"HBAR\":\"0.0510044850000000\",\"SYNT\":\"0.0467166300000000\",\"ZEX\":\"0.0571714000000000\",\"BONDLY\":\"0.0022208890000000\",\"MLK\":\"0.2080859050000000\",\"KICKS\":\"0.0001301249050000\",\"PEPE\":\"0.0000100249850000\",\"OUSD\":\"0.9982006500000000\",\"LUNCDOWN\":\"0.0000733333150000\",\"DOGS\":\"0.0007086455000000\",\"REV3L\":\"0.0094672640000000\",\"CTSI\":\"0.1257371000000000\",\"C98\":\"0.1219390000000000\",\"OSMO\":\"0.5370313500000000\",\"NTRN\":\"0.3869064500000000\",\"CFX2S\":\"0.0084757600000000\",\"SYN\":\"0.5636180500000000\",\"VIDT\":\"0.0308745550000000\",\"SYS\":\"0.0997501000000000\",\"GAS\":\"4.3029474500000008\",\"BOME\":\"0.0087336310000000\",\"COMBO\":\"0.4068964500000000\",\"XCH\":\"14.9825050000000010\",\"VR\":\"0.0063538215000000\",\"CFX2L\":\"0.0499660045000000\",\"VSYS\":\"0.0005201398000000\",\"PANDORA\":\"1629.2949450001102772\",\"THETA\":\"1.2461766000000000\",\"XCN\":\"0.0012699647000000\",\"NEXG\":\"0.0039180400000000\",\"MELOS\":\"0.0021244372500000\",\"XCV\":\"0.0013253370000000\",\"ORN\":\"0.8797599000000000\",\"WLKN\":\"0.0010624685000000\",\"AAVE\":\"154.2708259999996162\",\"MNT\":\"0.6168914000000000\",\"BONK\":\"0.0000227296295000\",\"PERP\":\"0.6037979500000000\",\"XDC\":\"0.0276361750000000\",\"MNW\":\"0.3681158500000000\",\"XDB\":\"0.0002578710000000\",\"BOND\":\"1.5662165000000000\",\"SUIA\":\"0.0809595000000000\",\"MOG\":\"0.0000019330330000\",\"SUTER\":\"0.0001840079500000\",\"TIME\":\"16.2648634999999969\",\"RACA\":\"0.0001949025000000\",\"BICO\":\"0.2021988500000000\",\"MON\":\"0.1066466500000000\",\"SWEAT\":\"0.0063718125000000\",\"MOXIE\":\"0.0022088950000000\",\"BABYBNB\":\"0.0289755050000000\",\"IGU\":\"0.0050674650000000\",\"HMSTR\":\"0.0037990995000000\",\"XEC\":\"0.0000354722550000\",\"MONI\":\"0.0058470750000000\",\"XR\":\"0.2374812000000000\",\"PEOPLE\":\"0.0796601500000000\",\"PUMLX\":\"0.0054572700000000\",\"ZIL\":\"0.0145927000000000\",\"WLDDOWN\":\"0.2089954500000000\",\"VAI\":\"0.0799999800000000\",\"XEN\":\"0.0000000839580000\",\"MPC\":\"0.1001499000000000\",\"XEM\":\"0.0176951480000000\",\"JASMY3S\":\"0.0019670160000000\",\"OTK\":\"0.0290464695000000\",\"TRAC\":\"0.4521738000000000\",\"DFYN\":\"0.0070664650000000\",\"BIDP\":\"0.0001939030000000\",\"JASMY3L\":\"0.0001653772700000\",\"INJDOWN\":\"0.0000194902500000\",\"KLV\":\"0.0019310340000000\",\"WAXL\":\"0.7858069000000000\",\"TRBDOWN\":\"0.0023138425000000\",\"BCH3L\":\"4.6390663064999996\",\"GMT3S\":\"0.0000457771000000\",\"KMD\":\"0.2493752500000000\",\"BCH3S\":\"0.9634180500000000\",\"ECOX\":\"0.0987506000000000\",\"AAVE3S\":\"0.0560719500000000\",\"GMT3L\":\"0.0053983694650000\",\"EPIK\":\"0.0045857060000000\",\"SUIP\":\"0.1067565950000000\",\"AAVE3L\":\"0.3638687346200000\",\"ZK\":\"0.1262368500000000\",\"ZKF\":\"0.0008595700000000\",\"OMNIA\":\"0.7624186000000000\",\"ZKJ\":\"1.1124435000000000\",\"ZKL\":\"0.1255372000000000\",\"GAFI\":\"3.0634675000000001\",\"CARV\":\"0.8703646000000000\",\"KNC\":\"0.4433782000000000\",\"CATS\":\"0.0000599700000000\",\"PROM\":\"5.2833570000000006\",\"ALEPH\":\"0.1756121500000000\",\"PONKE\":\"0.3958020000000000\",\"OVR\":\"0.1553223000000000\",\"CATI\":\"0.4105146400000000\",\"ORDER\":\"0.1183008200000000\",\"GFT\":\"0.0166616650000000\",\"BIFI\":\"0.0020489750000000\",\"GGC\":\"6.9965029985000000\",\"GGG\":\"0.0403798000000000\",\"DAPPX\":\"0.0043788095000000\",\"SUKU\":\"0.0618790450000000\",\"ULTI\":\"0.0168015950000000\",\"CREDI\":\"0.0192903500000000\",\"ERTHA\":\"0.0010014990000000\",\"FURY\":\"0.1405297000000000\",\"KARRAT\":\"0.5577210000000000\",\"MOBILE\":\"0.0009005495000000\",\"SIDUS\":\"0.0037671155000000\",\"NAVI\":\"0.1254672350000000\",\"TAO\":\"583.4081500000051807\",\"USDJ\":\"1.1386304000000001\",\"MTL\":\"0.9563216000000000\",\"VET\":\"0.0225387250000000\",\"FITFI\":\"0.0036421780000000\",\"USDT\":\"0.9995000000000000\",\"OXT\":\"0.0695652000000000\",\"CANDY\":\"0.0005597200000000\",\"USDP\":\"0.9932031500000000\",\"MTS\":\"0.0027516235000000\",\"TADA\":\"0.0283858000000000\",\"MTV\":\"0.0006559718500000\",\"NAVX\":\"0.1342228550000000\",\"ILV\":\"35.6771524999999671\",\"VINU\":\"0.0000000109045450\",\"GHX\":\"0.0903548000000000\",\"EDU\":\"0.5167415000000000\",\"HYVE\":\"0.0137331300000000\",\"BTC3L\":\"0.0058620675000000\",\"ANYONE\":\"0.9015490000000000\",\"BEAT\":\"0.0012593700000000\",\"KING\":\"0.0004821588000000\",\"CREAM\":\"15.6541689999999973\",\"CAS\":\"0.0038590695000000\",\"IMX\":\"1.4944524000000000\",\"CAT\":\"0.0000256981445000\",\"BTC3S\":\"0.0014142925000000\",\"USDE\":\"0.9985005000000000\",\"USDD\":\"1.0000997000000000\",\"CWAR\":\"0.0037981000000000\",\"USDC\":\"0.9997998500000000\",\"KRL\":\"0.3543127550000000\",\"INJ\":\"21.7691100000000194\",\"GAME\":\"0.0139630150000000\",\"TRIBL\":\"1.0994500000000000\",\"XLM\":\"0.0948525500000000\",\"TRBUP\":\"0.0012293850000000\",\"VRADOWN\":\"0.0013433280000000\",\"SUPER\":\"1.2853570000000000\",\"EIGEN\":\"3.1536223999999999\",\"IOI\":\"0.0146926500000000\",\"KSM\":\"17.5212350000000129\",\"CCD\":\"0.0034832575000000\",\"EGO\":\"0.0093553200000000\",\"EGP\":\"2.7946019999999998\",\"MXC\":\"0.0066866550000000\",\"TEL\":\"0.0014432780000000\",\"MOVR\":\"9.1340307000000027\",\"XMR\":\"155.5421899999990755\",\"MXM\":\"0.0092853550000000\",\"OORT\":\"0.1099949750000000\",\"GLM\":\"0.3231383500000000\",\"RAY\":\"2.0228880499999998\",\"XTAG\":\"0.0218190850000000\",\"GLQ\":\"0.0854572500000000\",\"CWEB\":\"0.0038480750000000\",\"REVU\":\"0.0105047450000000\",\"REVV\":\"0.0039760110000000\",\"ZRO\":\"3.7952014499999994\",\"XNL\":\"0.0093853050000000\",\"XNO\":\"0.8496749500000000\",\"SAROS\":\"0.0019290350000000\",\"KACE\":\"2.1165411999999998\",\"ZRX\":\"0.3186406000000000\",\"WLTH\":\"0.0374312750000000\",\"ATOM3L\":\"0.0321719060000000\",\"GMM\":\"0.0001497251000000\",\"BEER\":\"0.0000138670630000\",\"GMT\":\"0.1275362000000000\",\"HEART\":\"0.0159920000000000\",\"GMX\":\"22.7186349999999882\",\"ABBC\":\"0.0061769100000000\",\"OMNI\":\"8.9235359999999970\",\"ATOM3S\":\"0.0007945225400000\",\"IRL\":\"0.0099650150000000\",\"CFG\":\"0.3248375000000000\",\"WSDM\":\"0.0139830050000000\",\"GNS\":\"1.8390800000000001\",\"VANRY\":\"0.0809295150000000\",\"CFX\":\"0.1595202000000000\",\"GRAIL\":\"817.1212349999937891\",\"BEFI\":\"0.0175712100000000\",\"VELO\":\"0.0132043945000000\",\"XPR\":\"0.0008077959000000\",\"DOVI\":\"0.0584707500000000\",\"ACE\":\"0.0021349320000000\",\"ACH\":\"0.0190534685000000\",\"ISP\":\"0.0012161916000000\",\"XCAD\":\"0.2834582000000000\",\"MINA\":\"0.5630183500000000\",\"TIA\":\"5.9318325999999999\",\"DRIFT\":\"0.4350823500000000\",\"ACQ\":\"0.0056981495000000\",\"ACS\":\"0.0014917537500000\",\"MIND\":\"0.0018920535000000\",\"STORE\":\"0.0062358805000000\",\"REN\":\"0.0351224300000000\",\"ELA\":\"1.7282354500000000\",\"DREAMS\":\"0.0002498750000000\",\"ADA\":\"0.3463267500000000\",\"ELF\":\"0.3777110500000000\",\"REQ\":\"0.0959919800000000\",\"STORJ\":\"0.5662167500000000\",\"LADYS\":\"0.0000000837581000\",\"PAXG\":\"2697.9303600003123340\",\"REZ\":\"0.0409795000000000\",\"XRD\":\"0.0157821050000000\",\"CHO\":\"0.0205097400000000\",\"CHR\":\"0.1769115000000000\",\"ADS\":\"0.1889055000000000\",\"CHZ\":\"0.0738030800000000\",\"ADX\":\"0.1575212000000000\",\"XRP\":\"0.5525036100000000\",\"JASMY\":\"0.0188615645000000\",\"KAGI\":\"0.1834582250000000\",\"FIDA\":\"0.2282858000000000\",\"PBR\":\"0.0291953950000000\",\"AEG\":\"0.0093453250000000\",\"H2O\":\"0.1610194500000000\",\"CHMB\":\"0.0001715641750000\",\"SAND3L\":\"0.0015447972150000\",\"PBX\":\"0.0006879558500000\",\"SOLVE\":\"0.0084557700000000\",\"DECHAT\":\"0.1512243500000000\",\"GARI\":\"0.0076861550000000\",\"SHIB2L\":\"1.1996998499999999\",\"SHIB2S\":\"0.0240879500000000\",\"ENA\":\"0.3942028000000000\",\"VEMP\":\"0.0029335325000000\",\"ENJ\":\"0.1467266000000000\",\"AFG\":\"0.0072163900000000\",\"RATS\":\"0.0001211593900000\",\"GRT\":\"0.1646076550000000\",\"FORWARD\":\"0.0012873560000000\",\"TFUEL\":\"0.0598800450000000\",\"ENS\":\"17.0634640000000052\",\"KASDOWN\":\"0.0258770550000000\",\"XTM\":\"0.0251074400000000\",\"DEGEN\":\"0.0084857550000000\",\"TLM\":\"0.0100449750000000\",\"DYDXDOWN\":\"0.1042598440000000\",\"CKB\":\"0.0146026950000000\",\"LUNC\":\"0.0000889255150000\",\"AURORA\":\"0.1204397500000000\",\"LUNA\":\"0.3624187000000000\",\"XTZ\":\"0.6776610000000000\",\"ELON\":\"0.0000001410294500\",\"DMTR\":\"0.0891554000000000\",\"EOS\":\"0.4759619000000000\",\"GST\":\"0.0118940500000000\",\"FORT\":\"0.1155422000000000\",\"FLAME\":\"0.0247076400000000\",\"PATEX\":\"0.9605195000000000\",\"DEEP\":\"0.0328885475000000\",\"ID3L\":\"0.0016201895000000\",\"GTC\":\"0.6625685500000000\",\"ID3S\":\"0.0071674145000000\",\"RIO\":\"0.7616190000000000\",\"CLH\":\"0.0008555720000000\",\"BURGER\":\"0.4016990500000000\",\"VRA\":\"0.0029765110000000\",\"SUNDOG\":\"0.2173912500000000\",\"GTT\":\"0.0002038980000000\",\"INJUP\":\"0.2327835500000000\",\"CPOOL\":\"0.1557720750000000\",\"EPX\":\"0.0000740629500000\",\"CLV\":\"0.0329835000000000\",\"FEAR\":\"0.0560519600000000\",\"MEME\":\"0.0124847545000000\",\"ROOBEE\":\"0.0004520738500000\",\"DEFI\":\"0.0192903500000000\",\"TOKEN\":\"0.0477361200000000\",\"GRAPE\":\"0.0020599695000000\",\"KASUP\":\"0.3996001000000000\",\"XWG\":\"0.0003843077500000\",\"SKEY\":\"0.0621289200000000\",\"SFUND\":\"1.3243375000000000\",\"EQX\":\"0.0032823580000000\",\"ORDIUP\":\"0.0548315705000000\",\"TON\":\"5.1857058499999995\",\"DEGO\":\"2.2667660500000001\",\"IZI\":\"0.0088455750000000\",\"ERG\":\"0.6605695500000000\",\"ERN\":\"1.9255367500000001\",\"VENOM\":\"0.0817591000000000\",\"VOXEL\":\"0.1497251000000000\",\"RLC\":\"1.4649671500000000\",\"PHA\":\"0.1093453000000000\",\"DYDXUP\":\"0.0112573685000000\",\"APE3S\":\"0.0008475760000000\",\"ORBS\":\"0.0288955450000000\",\"OPDOWN\":\"0.6758619000000000\",\"ESE\":\"0.0139130400000000\",\"APE3L\":\"0.1339330000000000\",\"HMND\":\"0.0982208650000000\",\"COQ\":\"0.0000014432780000\",\"AURY\":\"0.3340329000000000\",\"CULT\":\"0.0000028025980000\",\"AKT\":\"2.4642672500000001\",\"GLMR\":\"0.1606196500000000\",\"XYM\":\"0.0142528700000000\",\"ORAI\":\"6.1769100000000012\",\"XYO\":\"0.0058680645000000\",\"ETC\":\"18.8458723500000169\",\"LAI\":\"0.0142828550000000\",\"PIP\":\"0.0178310800000000\",\"ETH\":\"2607.6655149998362673\",\"NEO\":\"10.3575186499999991\",\"RMV\":\"0.0081659150000000\",\"KLAY\":\"0.1251374000000000\",\"PIT\":\"0.0000000003268365\",\"TARA\":\"0.0043978000000000\",\"KALT\":\"0.1128735350000000\",\"PIX\":\"0.0001023687900000\",\"ETN\":\"0.0021579205000000\",\"CSIX\":\"0.0141729100000000\",\"TRADE\":\"0.4708644500000000\",\"MAVIA\":\"1.3592200500000001\",\"HIGH\":\"1.3043474999999999\",\"TRB\":\"62.5387150000000006\",\"ORDI\":\"35.7421200000000126\",\"TRVL\":\"0.0373643085000000\",\"AMB\":\"0.0059670150000000\",\"TRU\":\"0.0762018800000000\",\"LOGX\":\"0.0271963950000000\",\"FINC\":\"0.0362018900000000\",\"INFRA\":\"0.1978010500000000\",\"NATIX\":\"0.0008729633000000\",\"NFP\":\"0.2152923000000000\",\"TRY\":\"0.0292166033323590\",\"TRX\":\"0.1597201000000000\",\"LBP\":\"0.0001243378000000\",\"LBR\":\"0.0595702000000000\",\"EUL\":\"2.9735125000000000\",\"NFT\":\"0.0000004077960000\",\"SEIUP\":\"0.0478110825000000\",\"PUFFER\":\"0.3676161000000000\",\"EUR\":\"1.0811249323958897\",\"ORCA\":\"2.0664662499999999\",\"NEAR3L\":\"0.0117010765350000\",\"AMP\":\"0.0038330825000000\",\"XDEFI\":\"0.0472563600000000\",\"HIFI\":\"0.4947525000000000\",\"TRUF\":\"0.0459570100000000\",\"AITECH\":\"0.1045477000000000\",\"AMU\":\"0.0043978000000000\",\"USTC\":\"0.0214692600000000\",\"KNGL\":\"0.0499750000000000\",\"FOXY\":\"0.0102686631000000\",\"NGC\":\"0.0147935995000000\",\"TENET\":\"0.0043278350000000\",\"NEAR3S\":\"0.0072553705000000\",\"MAHA\":\"1.1904045000000000\",\"NGL\":\"0.0701748950000000\",\"TST\":\"0.0080359800000000\",\"HIPPO\":\"0.0104447750000000\",\"AXS3S\":\"0.0308705570000000\",\"CRO\":\"0.0781409100000000\",\"ZPAY\":\"0.0050574700000000\",\"MNDE\":\"0.1026786350000000\",\"CRV\":\"0.2534732000000000\",\"SWASH\":\"0.0056271850000000\",\"AXS3L\":\"0.0106388779000000\",\"VERSE\":\"0.0001803098000000\",\"RPK\":\"0.0049975000000000\",\"RPL\":\"10.9745099999999958\",\"AZERO\":\"0.3789104500000000\",\"SOUL\":\"0.0534332700000000\",\"VXV\":\"0.2619689500000000\",\"LDO\":\"1.0885554500000000\",\"MAGIC\":\"0.3390304000000000\",\"ALICE\":\"1.0324835000000000\",\"SEAM\":\"1.1933030499999999\",\"PLU\":\"1.9300345000000001\",\"AOG\":\"0.0031224380000000\",\"SMOLE\":\"0.0000387806000000\",\"EWT\":\"1.1094450000000000\",\"TSUGT\":\"0.0029185400000000\",\"PMG\":\"0.0800599500000000\",\"OPAI\":\"0.0006826585000000\",\"LOCUS\":\"0.0216591650000000\",\"CTA\":\"0.0825087250000000\",\"NIM\":\"0.0013673160000000\",\"CTC\":\"0.4033982000000000\",\"APE\":\"0.7035480500000000\",\"MERL\":\"0.2720639000000000\",\"JAM\":\"0.0004770613500000\",\"CTI\":\"0.0130314810000000\",\"APP\":\"0.0021989000000000\",\"APT\":\"9.9947001500000000\",\"WLDUP\":\"0.0093043455000000\",\"ZEND\":\"0.1280759300000000\",\"FIRE\":\"0.9113441000000000\",\"DENT\":\"0.0008630682500000\",\"PYTH\":\"0.3390603850000000\",\"LFT\":\"0.0155322300000000\",\"DPET\":\"0.0319040400000000\",\"ORDIDOWN\":\"0.3788105000000000\",\"KPOL\":\"0.0029175405000000\",\"ETHUP\":\"8.4971493000000032\",\"BAND\":\"1.0939527500000001\",\"POL\":\"0.3656171000000000\",\"ASTR\":\"0.0582608550000000\",\"NKN\":\"0.0691654000000000\",\"RSR\":\"0.0068055955000000\",\"DVPN\":\"0.0005979009000000\",\"TWT\":\"1.1119437500000000\",\"ARB\":\"0.5510243500000000\",\"CVC\":\"0.1409801746501747\",\"ARC\":\"0.0300849500000000\",\"XETA\":\"0.0022888550000000\",\"MTRG\":\"0.4007995000000000\",\"LOKA\":\"0.1867066000000000\",\"LPOOL\":\"0.0660069800000000\",\"TURBOS\":\"0.0034812585000000\",\"CVX\":\"1.7816087499999999\",\"ARX\":\"0.0007556220000000\",\"MPLX\":\"0.4355221300000000\",\"SUSHI\":\"0.7011492500000000\",\"NLK\":\"0.0114442750000000\",\"PEPE2\":\"0.0000000313843000\",\"WBTC\":\"66881.4425499645548419\",\"SUI3L\":\"0.0211204345000000\",\"CWS\":\"0.1927036000000000\",\"SUI3S\":\"0.0000579110300000\",\"INSP\":\"0.0264167850000000\",\"MANA\":\"0.2945026750000000\",\"VRTX\":\"0.0641679000000000\",\"CSPR\":\"0.0116441750000000\",\"ATA\":\"0.0785007300000000\",\"OPEN\":\"0.0080049955000000\",\"HAI\":\"0.0448275750000000\",\"NMR\":\"14.7436245000000072\",\"ATH\":\"0.0540929400000000\",\"LIT\":\"0.6282857000000000\",\"TLOS\":\"0.3263467450000000\",\"TNSR\":\"0.3662168000000000\",\"CXT\":\"0.0871364100000000\",\"POLYX\":\"0.2346826000000000\",\"ZERO\":\"0.0002507745500000\",\"ROUTE\":\"0.0610694500000000\",\"LOOM\":\"0.0580009850000000\",\"PRE\":\"0.0078680640000000\",\"VRAUP\":\"0.0134652640000000\",\"HBB\":\"0.0714742450000000\",\"RVN\":\"0.0165017450000000\",\"PRQ\":\"0.0715741950000000\",\"ONDO\":\"0.7134930750000000\",\"PEPEDOWN\":\"0.0000155022450000\",\"WOOP\":\"0.0020179905000000\",\"LUNCUP\":\"0.0168355780000000\",\"KAVA\":\"0.3522238000000000\",\"LKI\":\"0.0104187880000000\",\"AVA\":\"0.4857570000000000\",\"NOM\":\"0.0233883000000000\",\"MAPO\":\"0.0089015470000000\",\"PEPEUP\":\"0.0114252845000000\",\"STRAX\":\"0.0487156300000000\",\"NOT\":\"0.0078670645000000\",\"ZERC\":\"0.1108245600000000\",\"BCUT\":\"0.0255672100000000\",\"MASA\":\"0.0691354150000000\",\"WAN\":\"0.1785077544737212\",\"WAT\":\"0.0003273762300000\",\"WAX\":\"0.0327636100000000\",\"MASK\":\"2.2259864500000002\",\"EOS3L\":\"0.0002122138400000\",\"IDEA\":\"0.0005887055000000\",\"EOS3S\":\"0.0034472755000000\",\"YFI\":\"4919.4290549999908843\",\"MOODENG\":\"0.0774612500000000\",\"XCUR\":\"0.0048845565000000\",\"HYDRA\":\"0.2225886500000000\",\"POPCAT\":\"1.3382305500000000\",\"LQTY\":\"0.7848074000000000\",\"PIXEL\":\"0.1406596350000000\",\"LMR\":\"0.0145437245000000\",\"ZETA\":\"0.5997999500000000\",\"YGG\":\"0.4717640000000000\",\"AXS\":\"4.6006985000000006\",\"BCHSV\":\"49.8250749999999370\",\"NRN\":\"0.0395802000000000\",\"FTON\":\"0.0091954000000000\",\"COMP\":\"43.6581599999999881\",\"XPRT\":\"0.1819090000000000\",\"HFT\":\"0.1443278000000000\",\"UXLINK\":\"0.5085456000000000\",\"STAMP\":\"0.0335032400000000\",\"RUNE\":\"4.9233370999999996\",\"ZEUS\":\"0.2587705500000000\",\"LTC3L\":\"1.8294848000000001\",\"DAPP\":\"0.1763118000000000\",\"FORTH\":\"2.9508238500000004\",\"ALPINE\":\"1.5322335000000000\",\"SENSO\":\"0.0328835500000000\",\"LTC3S\":\"0.0006986505000000\",\"DEXE\":\"8.3795081500000028\",\"GOAL\":\"0.0175912000000000\",\"AVAX\":\"27.5602130000000058\",\"LISTA\":\"0.3782108000000000\",\"AMPL\":\"1.3743124999999999\",\"WORK\":\"0.1384307500000000\",\"BRWL\":\"0.0017391300000000\",\"BANANA\":\"57.1314200000001362\",\"PUSH\":\"0.0750624500000000\",\"WEN\":\"0.0001015492000000\",\"NEIRO\":\"0.0879560000000000\",\"BTCUP\":\"34.7711057499999789\",\"SOL3S\":\"0.0007816090000000\",\"BRAWL\":\"0.0004776610500000\",\"LAY3R\":\"0.2161918500000000\",\"LPT\":\"11.9304317999999945\",\"GODS\":\"0.1807096000000000\",\"SAND3S\":\"4.6152911999999992\",\"RDNT\":\"0.0640679500000000\",\"SOL3L\":\"1.8351913752850000\",\"NIBI\":\"0.0653772950000000\",\"NUM\":\"0.0436181800000000\",\"PYR\":\"2.5590198499999997\",\"DAG\":\"0.0226176855000000\",\"DAI\":\"0.9989006596042375\",\"HIP\":\"0.0034982500000000\",\"DAO\":\"0.2848575000000000\",\"AVAIL\":\"0.1300929210000000\",\"DAR\":\"0.1512243500000000\",\"FET\":\"1.3760116500000000\",\"FCON\":\"0.0001197600900000\",\"XAVA\":\"0.3789104500000000\",\"LRC\":\"0.1208395500000000\",\"UNI3S\":\"0.0000653573050000\",\"PZP\":\"0.0599600050000000\",\"POKT\":\"0.0424787500000000\",\"DASH\":\"23.6881500000000109\",\"BAKEDOWN\":\"0.0003324636850000\",\"POLC\":\"0.0061389290000000\",\"DBR\":\"0.0377671070000000\",\"CIRUS\":\"0.0055772100000000\",\"UNI3L\":\"0.0993921490650000\",\"NWC\":\"0.0681659000000000\",\"POLK\":\"0.0142628650000000\",\"LSD\":\"0.9420287500000000\",\"MARS4\":\"0.0005878059500000\",\"LSK\":\"0.8080957500000000\",\"BLOCK\":\"0.0261869000000000\",\"ANALOS\":\"0.0000446776500000\",\"SAFE\":\"0.8779608000000000\",\"DCK\":\"0.0234082900000000\",\"LSS\":\"0.0562718500000000\",\"DCR\":\"12.4337799999999929\",\"LIKE\":\"0.0559720000000000\",\"DATA\":\"0.0361819000000000\",\"WIF\":\"2.5696145499999999\",\"BLOK\":\"0.0006546725000000\",\"LTC\":\"71.6261690000000611\",\"METIS\":\"42.0289750000000612\",\"WIN\":\"0.0000868365600000\",\"HLG\":\"0.0018790600000000\",\"LTO\":\"0.1166116650000000\",\"DYDX\":\"0.9341327000000000\",\"ARB3S\":\"0.0509025360000000\",\"MUBI\":\"0.0303848000000000\",\"ARB3L\":\"0.0025917035000000\",\"RBTC1\":\"0.0000039480250000\",\"POND\":\"0.0118640650000000\",\"LINA\":\"0.0037771105000000\",\"MYRIA\":\"0.0025337325000000\",\"LINK\":\"11.0244849999999944\",\"QTUM\":\"2.4262016723130069\",\"TUNE\":\"0.0148025950000000\",\"UFO\":\"0.0000006479758500\",\"CYBER\":\"2.8755615000000001\",\"WILD\":\"0.2433782500000000\",\"POLS\":\"0.2809594500000000\",\"NYM\":\"0.0719640000000000\",\"FIL\":\"3.6786597500000005\",\"BAL\":\"2.0099945000000000\",\"SCA\":\"0.3999999000000000\",\"STND\":\"0.0133123405000000\",\"WMTX\":\"0.2138930000000000\",\"SCLP\":\"0.1545227000000000\",\"MANEKI\":\"0.0073963000000000\",\"BAT\":\"0.1721139000000000\",\"AKRO\":\"0.0042302838000000\",\"FTM3L\":\"8.2574692000000024\",\"BAX\":\"0.0000709645000000\",\"FTM3S\":\"0.0000255072400000\",\"COTI\":\"0.0951524000000000\"}}" commonResp := &types.RestResponse{} err := json.Unmarshal([]byte(data), commonResp) assert.Nil(t, err) assert.NotNil(t, commonResp.Data) - resp := &GetServerTimeResp{} + resp := &GetFiatPriceResp{} err = json.Unmarshal([]byte(commonResp.Data), resp) resp.ToMap() assert.Nil(t, err) } -func TestMarketGetAllSymbolsReqModel(t *testing.T) { - // GetAllSymbols - // Get All Symbols - // /api/v2/symbols +func TestMarketGet24hrStatsReqModel(t *testing.T) { + // Get24hrStats + // Get 24hr Stats + // /api/v1/market/stats - data := "{\"market\": \"ALTS\"}" - req := &GetAllSymbolsReq{} + data := "{\"symbol\": \"BTC-USDT\"}" + req := &Get24hrStatsReq{} err := json.Unmarshal([]byte(data), req) req.ToMap() assert.Nil(t, err) } -func TestMarketGetAllSymbolsRespModel(t *testing.T) { - // GetAllSymbols - // Get All Symbols - // /api/v2/symbols +func TestMarketGet24hrStatsRespModel(t *testing.T) { + // Get24hrStats + // Get 24hr Stats + // /api/v1/market/stats - data := "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"symbol\": \"BTC-USDT\",\n \"name\": \"BTC-USDT\",\n \"baseCurrency\": \"BTC\",\n \"quoteCurrency\": \"USDT\",\n \"feeCurrency\": \"USDT\",\n \"market\": \"USDS\",\n \"baseMinSize\": \"0.00001\",\n \"quoteMinSize\": \"0.1\",\n \"baseMaxSize\": \"10000000000\",\n \"quoteMaxSize\": \"99999999\",\n \"baseIncrement\": \"0.00000001\",\n \"quoteIncrement\": \"0.000001\",\n \"priceIncrement\": \"0.1\",\n \"priceLimitRate\": \"0.1\",\n \"minFunds\": \"0.1\",\n \"isMarginEnabled\": true,\n \"enableTrading\": true,\n \"feeCategory\": 1,\n \"makerFeeCoefficient\": \"1.00\",\n \"takerFeeCoefficient\": \"1.00\",\n \"st\": false\n }\n ]\n}" + data := "{\"code\":\"200000\",\"data\":{\"time\":1729175612158,\"symbol\":\"BTC-USDT\",\"buy\":\"66982.4\",\"sell\":\"66982.5\",\"changeRate\":\"-0.0114\",\"changePrice\":\"-778.1\",\"high\":\"68107.7\",\"low\":\"66683.3\",\"vol\":\"1738.02898182\",\"volValue\":\"117321982.415978333\",\"last\":\"66981.5\",\"averagePrice\":\"67281.21437289\",\"takerFeeRate\":\"0.001\",\"makerFeeRate\":\"0.001\",\"takerCoefficient\":\"1\",\"makerCoefficient\":\"1\"}}" commonResp := &types.RestResponse{} err := json.Unmarshal([]byte(data), commonResp) assert.Nil(t, err) assert.NotNil(t, commonResp.Data) - resp := &GetAllSymbolsResp{} + resp := &Get24hrStatsResp{} err = json.Unmarshal([]byte(commonResp.Data), resp) resp.ToMap() assert.Nil(t, err) } -func TestMarketGetSymbolReqModel(t *testing.T) { - // GetSymbol - // Get Symbol - // /api/v2/symbols/{symbol} +func TestMarketGetMarketListReqModel(t *testing.T) { + // GetMarketList + // Get Market List + // /api/v1/markets - data := "{\"symbol\": \"BTC-USDT\"}" - req := &GetSymbolReq{} - err := json.Unmarshal([]byte(data), req) - req.ToMap() - assert.Nil(t, err) } -func TestMarketGetSymbolRespModel(t *testing.T) { - // GetSymbol - // Get Symbol - // /api/v2/symbols/{symbol} +func TestMarketGetMarketListRespModel(t *testing.T) { + // GetMarketList + // Get Market List + // /api/v1/markets - data := "{\"code\":\"200000\",\"data\":{\"symbol\":\"BTC-USDT\",\"name\":\"BTC-USDT\",\"baseCurrency\":\"BTC\",\"quoteCurrency\":\"USDT\",\"feeCurrency\":\"USDT\",\"market\":\"USDS\",\"baseMinSize\":\"0.00001\",\"quoteMinSize\":\"0.1\",\"baseMaxSize\":\"10000000000\",\"quoteMaxSize\":\"99999999\",\"baseIncrement\":\"0.00000001\",\"quoteIncrement\":\"0.000001\",\"priceIncrement\":\"0.1\",\"priceLimitRate\":\"0.1\",\"minFunds\":\"0.1\",\"isMarginEnabled\":true,\"enableTrading\":true,\"feeCategory\":1,\"makerFeeCoefficient\":\"1.00\",\"takerFeeCoefficient\":\"1.00\",\"st\":false}}" + data := "{\"code\":\"200000\",\"data\":[\"USDS\",\"TON\",\"AI\",\"DePIN\",\"PoW\",\"BRC-20\",\"ETF\",\"KCS\",\"Meme\",\"Solana\",\"FIAT\",\"VR&AR\",\"DeFi\",\"Polkadot\",\"BTC\",\"ALTS\",\"Layer 1\"]}" commonResp := &types.RestResponse{} err := json.Unmarshal([]byte(data), commonResp) assert.Nil(t, err) assert.NotNil(t, commonResp.Data) - resp := &GetSymbolResp{} + resp := &GetMarketListResp{} err = json.Unmarshal([]byte(commonResp.Data), resp) resp.ToMap() assert.Nil(t, err) } -func TestMarketGetAnnouncementsReqModel(t *testing.T) { - // GetAnnouncements - // Get Announcements - // /api/v3/announcements +func TestMarketGetServerTimeReqModel(t *testing.T) { + // GetServerTime + // Get Server Time + // /api/v1/timestamp - data := "{\"currentPage\": 1, \"pageSize\": 50, \"annType\": \"latest-announcements\", \"lang\": \"en_US\", \"startTime\": 1729594043000, \"endTime\": 1729697729000}" - req := &GetAnnouncementsReq{} - err := json.Unmarshal([]byte(data), req) - req.ToMap() - assert.Nil(t, err) } -func TestMarketGetAnnouncementsRespModel(t *testing.T) { - // GetAnnouncements - // Get Announcements - // /api/v3/announcements +func TestMarketGetServerTimeRespModel(t *testing.T) { + // GetServerTime + // Get Server Time + // /api/v1/timestamp - data := "{\n \"code\": \"200000\",\n \"data\": {\n \"totalNum\": 195,\n \"totalPage\": 13,\n \"currentPage\": 1,\n \"pageSize\": 15,\n \"items\": [\n {\n \"annId\": 129045,\n \"annTitle\": \"KuCoin Isolated Margin Adds the Scroll (SCR) Trading Pair\",\n \"annType\": [\n \"latest-announcements\"\n ],\n \"annDesc\": \"To enrich the variety of assets available,\xa0KuCoin\u2019s Isolated Margin Trading platform has added the Scroll (SCR)\xa0asset and trading pair.\",\n \"cTime\": 1729594043000,\n \"language\": \"en_US\",\n \"annUrl\": \"https://www.kucoin.com/announcement/kucoin-isolated-margin-adds-scr?lang=en_US\"\n },\n {\n \"annId\": 129001,\n \"annTitle\": \"DAPP-30D Fixed Promotion, Enjoy an APR of 200%!\u200b\",\n \"annType\": [\n \"latest-announcements\",\n \"activities\"\n ],\n \"annDesc\": \"KuCoin Earn will be launching the DAPP Fixed Promotion at 10:00:00 on October 22, 2024 (UTC). The available product is \u201cDAPP-30D'' with an APR of 200%.\",\n \"cTime\": 1729588460000,\n \"language\": \"en_US\",\n \"annUrl\": \"https://www.kucoin.com/announcement/dapp-30d-fixed-promotion-enjoy?lang=en_US\"\n },\n {\n \"annId\": 128581,\n \"annTitle\": \"NAYM (NAYM) Gets Listed on KuCoin! World Premiere!\",\n \"annType\": [\n \"latest-announcements\",\n \"new-listings\"\n ],\n \"annDesc\": \"Trading:\xa011:00 on October 22, 2024 (UTC)\",\n \"cTime\": 1729497729000,\n \"language\": \"en_US\",\n \"annUrl\": \"https://www.kucoin.com/announcement/en-naym-naym-gets-listed-on-kucoin-world-premiere?lang=en_US\"\n }\n ]\n }\n}" + data := "{\"code\":\"200000\",\"data\":1729100692873}" commonResp := &types.RestResponse{} err := json.Unmarshal([]byte(data), commonResp) assert.Nil(t, err) assert.NotNil(t, commonResp.Data) - resp := &GetAnnouncementsResp{} + resp := &GetServerTimeResp{} err = json.Unmarshal([]byte(commonResp.Data), resp) resp.ToMap() assert.Nil(t, err) } -func TestMarketGetCurrencyReqModel(t *testing.T) { - // GetCurrency - // Get Currency - // /api/v3/currencies/{currency} +func TestMarketGetServiceStatusReqModel(t *testing.T) { + // GetServiceStatus + // Get Service Status + // /api/v1/status - data := "{\"currency\": \"BTC\", \"chain\": \"eth\"}" - req := &GetCurrencyReq{} - err := json.Unmarshal([]byte(data), req) - req.ToMap() - assert.Nil(t, err) } -func TestMarketGetCurrencyRespModel(t *testing.T) { - // GetCurrency - // Get Currency - // /api/v3/currencies/{currency} +func TestMarketGetServiceStatusRespModel(t *testing.T) { + // GetServiceStatus + // Get Service Status + // /api/v1/status - data := "{\"code\":\"200000\",\"data\":{\"currency\":\"BTC\",\"name\":\"BTC\",\"fullName\":\"Bitcoin\",\"precision\":8,\"confirms\":null,\"contractAddress\":null,\"isMarginEnabled\":true,\"isDebitEnabled\":true,\"chains\":[{\"chainName\":\"BTC\",\"withdrawalMinSize\":\"0.001\",\"depositMinSize\":\"0.0002\",\"withdrawFeeRate\":\"0\",\"withdrawalMinFee\":\"0.0005\",\"isWithdrawEnabled\":true,\"isDepositEnabled\":true,\"confirms\":3,\"preConfirms\":1,\"contractAddress\":\"\",\"withdrawPrecision\":8,\"maxWithdraw\":null,\"maxDeposit\":null,\"needTag\":false,\"chainId\":\"btc\"},{\"chainName\":\"Lightning Network\",\"withdrawalMinSize\":\"0.00001\",\"depositMinSize\":\"0.00001\",\"withdrawFeeRate\":\"0\",\"withdrawalMinFee\":\"0.000015\",\"isWithdrawEnabled\":true,\"isDepositEnabled\":true,\"confirms\":1,\"preConfirms\":1,\"contractAddress\":\"\",\"withdrawPrecision\":8,\"maxWithdraw\":null,\"maxDeposit\":\"0.03\",\"needTag\":false,\"chainId\":\"btcln\"},{\"chainName\":\"KCC\",\"withdrawalMinSize\":\"0.0008\",\"depositMinSize\":null,\"withdrawFeeRate\":\"0\",\"withdrawalMinFee\":\"0.00002\",\"isWithdrawEnabled\":true,\"isDepositEnabled\":true,\"confirms\":20,\"preConfirms\":20,\"contractAddress\":\"0xfa93c12cd345c658bc4644d1d4e1b9615952258c\",\"withdrawPrecision\":8,\"maxWithdraw\":null,\"maxDeposit\":null,\"needTag\":false,\"chainId\":\"kcc\"},{\"chainName\":\"BTC-Segwit\",\"withdrawalMinSize\":\"0.0008\",\"depositMinSize\":\"0.0002\",\"withdrawFeeRate\":\"0\",\"withdrawalMinFee\":\"0.0005\",\"isWithdrawEnabled\":false,\"isDepositEnabled\":true,\"confirms\":2,\"preConfirms\":2,\"contractAddress\":\"\",\"withdrawPrecision\":8,\"maxWithdraw\":null,\"maxDeposit\":null,\"needTag\":false,\"chainId\":\"bech32\"}]}}" + data := "{\"code\":\"200000\",\"data\":{\"status\":\"open\",\"msg\":\"\"}}" commonResp := &types.RestResponse{} err := json.Unmarshal([]byte(data), commonResp) assert.Nil(t, err) assert.NotNil(t, commonResp.Data) - resp := &GetCurrencyResp{} + resp := &GetServiceStatusResp{} err = json.Unmarshal([]byte(commonResp.Data), resp) resp.ToMap() assert.Nil(t, err) } -func TestMarketGetAllCurrenciesReqModel(t *testing.T) { - // GetAllCurrencies - // Get All Currencies - // /api/v3/currencies +func TestMarketGetPublicTokenReqModel(t *testing.T) { + // GetPublicToken + // Get Public Token - Spot/Margin + // /api/v1/bullet-public } -func TestMarketGetAllCurrenciesRespModel(t *testing.T) { - // GetAllCurrencies - // Get All Currencies - // /api/v3/currencies +func TestMarketGetPublicTokenRespModel(t *testing.T) { + // GetPublicToken + // Get Public Token - Spot/Margin + // /api/v1/bullet-public - data := "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"currency\": \"BTC\",\n \"name\": \"BTC\",\n \"fullName\": \"Bitcoin\",\n \"precision\": 8,\n \"confirms\": null,\n \"contractAddress\": null,\n \"isMarginEnabled\": true,\n \"isDebitEnabled\": true,\n \"chains\": [\n {\n \"chainName\": \"BTC\",\n \"withdrawalMinSize\": \"0.001\",\n \"depositMinSize\": \"0.0002\",\n \"withdrawFeeRate\": \"0\",\n \"withdrawalMinFee\": \"0.0005\",\n \"isWithdrawEnabled\": true,\n \"isDepositEnabled\": true,\n \"confirms\": 3,\n \"preConfirms\": 1,\n \"contractAddress\": \"\",\n \"withdrawPrecision\": 8,\n \"maxWithdraw\": null,\n \"maxDeposit\": null,\n \"needTag\": false,\n \"chainId\": \"btc\"\n },\n {\n \"chainName\": \"Lightning Network\",\n \"withdrawalMinSize\": \"0.00001\",\n \"depositMinSize\": \"0.00001\",\n \"withdrawFeeRate\": \"0\",\n \"withdrawalMinFee\": \"0.000015\",\n \"isWithdrawEnabled\": true,\n \"isDepositEnabled\": true,\n \"confirms\": 1,\n \"preConfirms\": 1,\n \"contractAddress\": \"\",\n \"withdrawPrecision\": 8,\n \"maxWithdraw\": null,\n \"maxDeposit\": \"0.03\",\n \"needTag\": false,\n \"chainId\": \"btcln\"\n },\n {\n \"chainName\": \"KCC\",\n \"withdrawalMinSize\": \"0.0008\",\n \"depositMinSize\": null,\n \"withdrawFeeRate\": \"0\",\n \"withdrawalMinFee\": \"0.00002\",\n \"isWithdrawEnabled\": true,\n \"isDepositEnabled\": true,\n \"confirms\": 20,\n \"preConfirms\": 20,\n \"contractAddress\": \"0xfa93c12cd345c658bc4644d1d4e1b9615952258c\",\n \"withdrawPrecision\": 8,\n \"maxWithdraw\": null,\n \"maxDeposit\": null,\n \"needTag\": false,\n \"chainId\": \"kcc\"\n },\n {\n \"chainName\": \"BTC-Segwit\",\n \"withdrawalMinSize\": \"0.0008\",\n \"depositMinSize\": \"0.0002\",\n \"withdrawFeeRate\": \"0\",\n \"withdrawalMinFee\": \"0.0005\",\n \"isWithdrawEnabled\": false,\n \"isDepositEnabled\": true,\n \"confirms\": 2,\n \"preConfirms\": 2,\n \"contractAddress\": \"\",\n \"withdrawPrecision\": 8,\n \"maxWithdraw\": null,\n \"maxDeposit\": null,\n \"needTag\": false,\n \"chainId\": \"bech32\"\n }\n ]\n },\n {\n \"currency\": \"BTCP\",\n \"name\": \"BTCP\",\n \"fullName\": \"Bitcoin Private\",\n \"precision\": 8,\n \"confirms\": null,\n \"contractAddress\": null,\n \"isMarginEnabled\": false,\n \"isDebitEnabled\": false,\n \"chains\": [\n {\n \"chainName\": \"BTCP\",\n \"withdrawalMinSize\": \"0.100000\",\n \"depositMinSize\": null,\n \"withdrawFeeRate\": \"0\",\n \"withdrawalMinFee\": \"0.010000\",\n \"isWithdrawEnabled\": false,\n \"isDepositEnabled\": false,\n \"confirms\": 6,\n \"preConfirms\": 6,\n \"contractAddress\": \"\",\n \"withdrawPrecision\": 8,\n \"maxWithdraw\": null,\n \"maxDeposit\": null,\n \"needTag\": false,\n \"chainId\": \"btcp\"\n }\n ]\n }\n ]\n}" + data := "{\n \"code\": \"200000\",\n \"data\": {\n \"token\": \"2neAiuYvAU61ZDXANAGAsiL4-iAExhsBXZxftpOeh_55i3Ysy2q2LEsEWU64mdzUOPusi34M_wGoSf7iNyEWJ93g2WHl-j4M7tCZ_S21PuIByWXUJFDywtiYB9J6i9GjsxUuhPw3Blq6rhZlGykT3Vp1phUafnulOOpts-MEmEF-3bpfetLOAq79RbGaLlE4JBvJHl5Vs9Y=.ymP9jIr6v-vucrZr8761yA==\",\n \"instanceServers\": [\n {\n \"endpoint\": \"wss://ws-api-spot.kucoin.com/\",\n \"encrypt\": true,\n \"protocol\": \"websocket\",\n \"pingInterval\": 18000,\n \"pingTimeout\": 10000\n }\n ]\n }\n}" commonResp := &types.RestResponse{} err := json.Unmarshal([]byte(data), commonResp) assert.Nil(t, err) assert.NotNil(t, commonResp.Data) - resp := &GetAllCurrenciesResp{} + resp := &GetPublicTokenResp{} err = json.Unmarshal([]byte(commonResp.Data), resp) resp.ToMap() assert.Nil(t, err) } -func TestMarketGetFullOrderBookReqModel(t *testing.T) { - // GetFullOrderBook - // Get Full OrderBook - // /api/v3/market/orderbook/level2 +func TestMarketGetPrivateTokenReqModel(t *testing.T) { + // GetPrivateToken + // Get Private Token - Spot/Margin + // /api/v1/bullet-private - data := "{\"symbol\": \"BTC-USDT\"}" - req := &GetFullOrderBookReq{} - err := json.Unmarshal([]byte(data), req) - req.ToMap() - assert.Nil(t, err) } -func TestMarketGetFullOrderBookRespModel(t *testing.T) { - // GetFullOrderBook - // Get Full OrderBook - // /api/v3/market/orderbook/level2 +func TestMarketGetPrivateTokenRespModel(t *testing.T) { + // GetPrivateToken + // Get Private Token - Spot/Margin + // /api/v1/bullet-private - data := "{\n \"code\": \"200000\",\n \"data\": {\n \"time\": 1729176273859,\n \"sequence\": \"14610502970\",\n \"bids\": [\n [\n \"66976.4\",\n \"0.69109872\"\n ],\n [\n \"66976.3\",\n \"0.14377\"\n ]\n ],\n \"asks\": [\n [\n \"66976.5\",\n \"0.05408199\"\n ],\n [\n \"66976.8\",\n \"0.0005\"\n ]\n ]\n }\n}" + data := "{\n \"code\": \"200000\",\n \"data\": {\n \"token\": \"2neAiuYvAU737TOajb2U3uT8AEZqSWYe0fBD4LoHuXJDSC7gIzJiH4kNTWhCPISWo6nDpAe7aUaaHJ4fG8oRjFgMfUI2sM4IySWHrBceFocY8pKy2REU1HwZIngtMdMrjqPnP-biofFWbNaP1cl0X1pZc2SQ-33hDH1LgNP-yg80ZJv_Ctaj8sAFhTOZ8m1L.jut4vBQxXAseWKxODdGVGg==\",\n \"instanceServers\": [\n {\n \"endpoint\": \"wss://ws-api-spot.kucoin.com/\",\n \"encrypt\": true,\n \"protocol\": \"websocket\",\n \"pingInterval\": 18000,\n \"pingTimeout\": 10000\n }\n ]\n }\n}" commonResp := &types.RestResponse{} err := json.Unmarshal([]byte(data), commonResp) assert.Nil(t, err) assert.NotNil(t, commonResp.Data) - resp := &GetFullOrderBookResp{} + resp := &GetPrivateTokenResp{} err = json.Unmarshal([]byte(commonResp.Data), resp) resp.ToMap() assert.Nil(t, err) diff --git a/sdk/golang/pkg/generate/spot/order/api_order.go b/sdk/golang/pkg/generate/spot/order/api_order.go index 24413d26..8b8d02fb 100644 --- a/sdk/golang/pkg/generate/spot/order/api_order.go +++ b/sdk/golang/pkg/generate/spot/order/api_order.go @@ -9,52 +9,51 @@ import ( type OrderAPI interface { - // GetTradeHistoryOld Get Trade History - Old - // Description: Request via this endpoint to get the recent fills. The return value is the data after Pagination, sorted in descending order according to time. - // Documentation: https://www.kucoin.com/docs-new/api-3470350 + // AddOrder Add Order + // Description: Place order to the Spot trading system, you can place two major types of orders: limit and market. Orders can only be placed if your account has sufficient funds. Once an order is placed, your funds will be put on hold for the duration of the order. The amount of funds on hold depends on the order type and parameters specified. + // Documentation: https://www.kucoin.com/docs-new/api-3470188 // +---------------------+---------+ // | Extra API Info | Value | // +---------------------+---------+ // | API-DOMAIN | SPOT | // | API-CHANNEL | PRIVATE | - // | API-PERMISSION | GENERAL | + // | API-PERMISSION | SPOT | // | API-RATE-LIMIT-POOL | SPOT | - // | API-RATE-LIMIT | 10 | + // | API-RATE-LIMIT | 1 | // +---------------------+---------+ - // Deprecated - GetTradeHistoryOld(req *GetTradeHistoryOldReq, ctx context.Context) (*GetTradeHistoryOldResp, error) + AddOrder(req *AddOrderReq, ctx context.Context) (*AddOrderResp, error) - // GetTradeHistory Get Trade History - // Description: This endpoint can be used to obtain a list of the latest Spot transaction details. The returned data is sorted in descending order according to the latest update time of the order. - // Documentation: https://www.kucoin.com/docs-new/api-3470180 + // AddOrderSync Add Order Sync + // Description: Place order to the spot trading system The difference between this interface and \"Add order\" is that this interface will synchronously return the order information after the order matching is completed. For higher latency requirements, please select the \"Add order\" interface. If there is a requirement for returning data integrity, please select this interface + // Documentation: https://www.kucoin.com/docs-new/api-3470170 // +---------------------+---------+ // | Extra API Info | Value | // +---------------------+---------+ // | API-DOMAIN | SPOT | // | API-CHANNEL | PRIVATE | - // | API-PERMISSION | GENERAL | + // | API-PERMISSION | SPOT | // | API-RATE-LIMIT-POOL | SPOT | - // | API-RATE-LIMIT | 2 | + // | API-RATE-LIMIT | 1 | // +---------------------+---------+ - GetTradeHistory(req *GetTradeHistoryReq, ctx context.Context) (*GetTradeHistoryResp, error) + AddOrderSync(req *AddOrderSyncReq, ctx context.Context) (*AddOrderSyncResp, error) - // GetOpenOrders Get Open Orders - // Description: This interface is to obtain all Spot active order lists, and the return value of the active order interface is the paged data of all uncompleted order lists. The returned data is sorted in descending order according to the latest update time of the order. After the user successfully places an order, the order is in Active state, and the user can use inOrderBook to determine whether the order has entered the order. Canceled or fully filled orders are marked as completed Done status. - // Documentation: https://www.kucoin.com/docs-new/api-3470178 + // AddOrderTest Add Order Test + // Description: Order test endpoint, the request parameters and return parameters of this endpoint are exactly the same as the order endpoint, and can be used to verify whether the signature is correct and other operations. After placing an order, the order will not enter the matching system, and the order cannot be queried. + // Documentation: https://www.kucoin.com/docs-new/api-3470187 // +---------------------+---------+ // | Extra API Info | Value | // +---------------------+---------+ // | API-DOMAIN | SPOT | // | API-CHANNEL | PRIVATE | - // | API-PERMISSION | GENERAL | + // | API-PERMISSION | SPOT | // | API-RATE-LIMIT-POOL | SPOT | - // | API-RATE-LIMIT | 2 | + // | API-RATE-LIMIT | 1 | // +---------------------+---------+ - GetOpenOrders(req *GetOpenOrdersReq, ctx context.Context) (*GetOpenOrdersResp, error) + AddOrderTest(req *AddOrderTestReq, ctx context.Context) (*AddOrderTestResp, error) - // GetSymbolsWithOpenOrder Get Symbols With Open Order - // Description: This interface can query all spot symbol that has active orders - // Documentation: https://www.kucoin.com/docs-new/api-3470177 + // BatchAddOrders Batch Add Orders + // Description: This endpoint supports sequential batch order placement from a single endpoint. A maximum of 5orders can be placed simultaneously. The order types must be limit orders of the same trading pair + // Documentation: https://www.kucoin.com/docs-new/api-3470168 // +---------------------+---------+ // | Extra API Info | Value | // +---------------------+---------+ @@ -62,13 +61,13 @@ type OrderAPI interface { // | API-CHANNEL | PRIVATE | // | API-PERMISSION | SPOT | // | API-RATE-LIMIT-POOL | SPOT | - // | API-RATE-LIMIT | 2 | + // | API-RATE-LIMIT | 1 | // +---------------------+---------+ - GetSymbolsWithOpenOrder(ctx context.Context) (*GetSymbolsWithOpenOrderResp, error) + BatchAddOrders(req *BatchAddOrdersReq, ctx context.Context) (*BatchAddOrdersResp, error) - // ModifyOrder Modify Order - // Description: This interface can modify the price and quantity of the order according to orderId or clientOid. The implementation of this interface is: cancel the order and place a new order on the same trading pair, and return the modification result to the client synchronously When the quantity of the new order updated by the user is less than the filled quantity of this order, the order will be considered as completed, and the order will be cancelled, and no new order will be placed - // Documentation: https://www.kucoin.com/docs-new/api-3470171 + // BatchAddOrdersSync Batch Add Orders Sync + // Description: This endpoint supports sequential batch order placement from a single endpoint. A maximum of 5orders can be placed simultaneously. The order types must be limit orders of the same trading pair + // Documentation: https://www.kucoin.com/docs-new/api-3470169 // +---------------------+---------+ // | Extra API Info | Value | // +---------------------+---------+ @@ -76,13 +75,13 @@ type OrderAPI interface { // | API-CHANNEL | PRIVATE | // | API-PERMISSION | SPOT | // | API-RATE-LIMIT-POOL | SPOT | - // | API-RATE-LIMIT | 3 | + // | API-RATE-LIMIT | 1 | // +---------------------+---------+ - ModifyOrder(req *ModifyOrderReq, ctx context.Context) (*ModifyOrderResp, error) + BatchAddOrdersSync(req *BatchAddOrdersSyncReq, ctx context.Context) (*BatchAddOrdersSyncResp, error) - // CancelAllOrders Cancel All Orders - // Description: This endpoint can cancel all spot orders for all symbol. This endpoint only sends cancellation requests. The results of the requests must be obtained by checking the order status or subscribing to websocket. - // Documentation: https://www.kucoin.com/docs-new/api-3470176 + // CancelOrderByOrderId Cancel Order By OrderId + // Description: This endpoint can be used to cancel a spot order by orderId. This endpoint only sends cancellation requests. The results of the requests must be obtained by checking the order status or subscribing to websocket. + // Documentation: https://www.kucoin.com/docs-new/api-3470174 // +---------------------+---------+ // | Extra API Info | Value | // +---------------------+---------+ @@ -90,13 +89,13 @@ type OrderAPI interface { // | API-CHANNEL | PRIVATE | // | API-PERMISSION | SPOT | // | API-RATE-LIMIT-POOL | SPOT | - // | API-RATE-LIMIT | 30 | + // | API-RATE-LIMIT | 1 | // +---------------------+---------+ - CancelAllOrders(ctx context.Context) (*CancelAllOrdersResp, error) + CancelOrderByOrderId(req *CancelOrderByOrderIdReq, ctx context.Context) (*CancelOrderByOrderIdResp, error) - // CancelPartialOrder Cancel Partial Order - // Description: This interface can cancel the specified quantity of the order according to the orderId. The order execution order is: price first, time first, this interface will not change the queue order - // Documentation: https://www.kucoin.com/docs-new/api-3470183 + // CancelOrderByOrderIdSync Cancel Order By OrderId Sync + // Description: This endpoint can be used to cancel a spot order by orderId. + // Documentation: https://www.kucoin.com/docs-new/api-3470185 // +---------------------+---------+ // | Extra API Info | Value | // +---------------------+---------+ @@ -104,9 +103,9 @@ type OrderAPI interface { // | API-CHANNEL | PRIVATE | // | API-PERMISSION | SPOT | // | API-RATE-LIMIT-POOL | SPOT | - // | API-RATE-LIMIT | 2 | + // | API-RATE-LIMIT | 1 | // +---------------------+---------+ - CancelPartialOrder(req *CancelPartialOrderReq, ctx context.Context) (*CancelPartialOrderResp, error) + CancelOrderByOrderIdSync(req *CancelOrderByOrderIdSyncReq, ctx context.Context) (*CancelOrderByOrderIdSyncResp, error) // CancelOrderByClientOid Cancel Order By ClientOid // Description: This endpoint can be used to cancel a spot order by clientOid. This endpoint only sends cancellation requests. The results of the requests must be obtained by checking the order status or subscribing to websocket. @@ -122,23 +121,23 @@ type OrderAPI interface { // +---------------------+---------+ CancelOrderByClientOid(req *CancelOrderByClientOidReq, ctx context.Context) (*CancelOrderByClientOidResp, error) - // GetOrderByClientOid Get Order By ClientOid - // Description: This endpoint can be used to obtain information for a single Spot order using the client order id. After the user successfully places an order, the order is in Active state, and the user can use inOrderBook to determine whether the order has entered the order. Canceled or fully filled orders are marked as completed Done status. - // Documentation: https://www.kucoin.com/docs-new/api-3470182 + // CancelOrderByClientOidSync Cancel Order By ClientOid Sync + // Description: This endpoint can be used to cancel a spot order by orderId. + // Documentation: https://www.kucoin.com/docs-new/api-3470186 // +---------------------+---------+ // | Extra API Info | Value | // +---------------------+---------+ // | API-DOMAIN | SPOT | // | API-CHANNEL | PRIVATE | - // | API-PERMISSION | GENERAL | + // | API-PERMISSION | SPOT | // | API-RATE-LIMIT-POOL | SPOT | - // | API-RATE-LIMIT | 2 | + // | API-RATE-LIMIT | 1 | // +---------------------+---------+ - GetOrderByClientOid(req *GetOrderByClientOidReq, ctx context.Context) (*GetOrderByClientOidResp, error) + CancelOrderByClientOidSync(req *CancelOrderByClientOidSyncReq, ctx context.Context) (*CancelOrderByClientOidSyncResp, error) - // SetDCP Set DCP - // Description: Set Disconnection Protect(Deadman Swich)Through this interface, Call this interface to automatically cancel all orders of the set trading pair after the specified time. If this interface is not called again for renewal or cancellation before the set time, the system will help the user to cancel the order of the corresponding trading pair. Otherwise it will not. - // Documentation: https://www.kucoin.com/docs-new/api-3470173 + // CancelPartialOrder Cancel Partial Order + // Description: This interface can cancel the specified quantity of the order according to the orderId. The order execution order is: price first, time first, this interface will not change the queue order + // Documentation: https://www.kucoin.com/docs-new/api-3470183 // +---------------------+---------+ // | Extra API Info | Value | // +---------------------+---------+ @@ -148,11 +147,11 @@ type OrderAPI interface { // | API-RATE-LIMIT-POOL | SPOT | // | API-RATE-LIMIT | 2 | // +---------------------+---------+ - SetDCP(req *SetDCPReq, ctx context.Context) (*SetDCPResp, error) + CancelPartialOrder(req *CancelPartialOrderReq, ctx context.Context) (*CancelPartialOrderResp, error) - // GetDCP Get DCP - // Description: Get Disconnection Protect(Deadman Swich)Through this interface, you can query the settings of automatic order cancellation - // Documentation: https://www.kucoin.com/docs-new/api-3470172 + // CancelAllOrdersBySymbol Cancel All Orders By Symbol + // Description: This endpoint can cancel all spot orders for specific symbol. This endpoint only sends cancellation requests. The results of the requests must be obtained by checking the order status or subscribing to websocket. + // Documentation: https://www.kucoin.com/docs-new/api-3470175 // +---------------------+---------+ // | Extra API Info | Value | // +---------------------+---------+ @@ -162,11 +161,11 @@ type OrderAPI interface { // | API-RATE-LIMIT-POOL | SPOT | // | API-RATE-LIMIT | 2 | // +---------------------+---------+ - GetDCP(ctx context.Context) (*GetDCPResp, error) + CancelAllOrdersBySymbol(req *CancelAllOrdersBySymbolReq, ctx context.Context) (*CancelAllOrdersBySymbolResp, error) - // CancelAllOrdersBySymbol Cancel All Orders By Symbol - // Description: This endpoint can cancel all spot orders for specific symbol. This endpoint only sends cancellation requests. The results of the requests must be obtained by checking the order status or subscribing to websocket. - // Documentation: https://www.kucoin.com/docs-new/api-3470175 + // CancelAllOrders Cancel All Orders + // Description: This endpoint can cancel all spot orders for all symbol. This endpoint only sends cancellation requests. The results of the requests must be obtained by checking the order status or subscribing to websocket. + // Documentation: https://www.kucoin.com/docs-new/api-3470176 // +---------------------+---------+ // | Extra API Info | Value | // +---------------------+---------+ @@ -174,55 +173,55 @@ type OrderAPI interface { // | API-CHANNEL | PRIVATE | // | API-PERMISSION | SPOT | // | API-RATE-LIMIT-POOL | SPOT | - // | API-RATE-LIMIT | 2 | + // | API-RATE-LIMIT | 30 | // +---------------------+---------+ - CancelAllOrdersBySymbol(req *CancelAllOrdersBySymbolReq, ctx context.Context) (*CancelAllOrdersBySymbolResp, error) + CancelAllOrders(ctx context.Context) (*CancelAllOrdersResp, error) - // GetClosedOrders Get Closed Orders - // Description: This interface is to obtain all Spot closed order lists, and the return value of the active order interface is the paged data of all uncompleted order lists. The returned data is sorted in descending order according to the latest update time of the order. After the user successfully places an order, the order is in Active state, and the user can use inOrderBook to determine whether the order has entered the order. Canceled or fully filled orders are marked as completed Done status. - // Documentation: https://www.kucoin.com/docs-new/api-3470179 + // ModifyOrder Modify Order + // Description: This interface can modify the price and quantity of the order according to orderId or clientOid. The implementation of this interface is: cancel the order and place a new order on the same trading pair, and return the modification result to the client synchronously When the quantity of the new order updated by the user is less than the filled quantity of this order, the order will be considered as completed, and the order will be cancelled, and no new order will be placed + // Documentation: https://www.kucoin.com/docs-new/api-3470171 // +---------------------+---------+ // | Extra API Info | Value | // +---------------------+---------+ // | API-DOMAIN | SPOT | // | API-CHANNEL | PRIVATE | - // | API-PERMISSION | GENERAL | + // | API-PERMISSION | SPOT | // | API-RATE-LIMIT-POOL | SPOT | - // | API-RATE-LIMIT | 2 | + // | API-RATE-LIMIT | 3 | // +---------------------+---------+ - GetClosedOrders(req *GetClosedOrdersReq, ctx context.Context) (*GetClosedOrdersResp, error) + ModifyOrder(req *ModifyOrderReq, ctx context.Context) (*ModifyOrderResp, error) - // BatchAddOrders Batch Add Orders - // Description: This endpoint supports sequential batch order placement from a single endpoint. A maximum of 5orders can be placed simultaneously. The order types must be limit orders of the same trading pair - // Documentation: https://www.kucoin.com/docs-new/api-3470168 + // GetOrderByOrderId Get Order By OrderId + // Description: This endpoint can be used to obtain information for a single Spot order using the order id. After the user successfully places an order, the order is in Active state, and the user can use inOrderBook to determine whether the order has entered the order. Canceled or fully filled orders are marked as completed Done status. + // Documentation: https://www.kucoin.com/docs-new/api-3470181 // +---------------------+---------+ // | Extra API Info | Value | // +---------------------+---------+ // | API-DOMAIN | SPOT | // | API-CHANNEL | PRIVATE | - // | API-PERMISSION | SPOT | + // | API-PERMISSION | GENERAL | // | API-RATE-LIMIT-POOL | SPOT | - // | API-RATE-LIMIT | 1 | + // | API-RATE-LIMIT | 2 | // +---------------------+---------+ - BatchAddOrders(req *BatchAddOrdersReq, ctx context.Context) (*BatchAddOrdersResp, error) + GetOrderByOrderId(req *GetOrderByOrderIdReq, ctx context.Context) (*GetOrderByOrderIdResp, error) - // BatchAddOrdersSync Batch Add Orders Sync - // Description: This endpoint supports sequential batch order placement from a single endpoint. A maximum of 5orders can be placed simultaneously. The order types must be limit orders of the same trading pair - // Documentation: https://www.kucoin.com/docs-new/api-3470169 + // GetOrderByClientOid Get Order By ClientOid + // Description: This endpoint can be used to obtain information for a single Spot order using the client order id. After the user successfully places an order, the order is in Active state, and the user can use inOrderBook to determine whether the order has entered the order. Canceled or fully filled orders are marked as completed Done status. + // Documentation: https://www.kucoin.com/docs-new/api-3470182 // +---------------------+---------+ // | Extra API Info | Value | // +---------------------+---------+ // | API-DOMAIN | SPOT | // | API-CHANNEL | PRIVATE | - // | API-PERMISSION | SPOT | + // | API-PERMISSION | GENERAL | // | API-RATE-LIMIT-POOL | SPOT | - // | API-RATE-LIMIT | 1 | + // | API-RATE-LIMIT | 2 | // +---------------------+---------+ - BatchAddOrdersSync(req *BatchAddOrdersSyncReq, ctx context.Context) (*BatchAddOrdersSyncResp, error) + GetOrderByClientOid(req *GetOrderByClientOidReq, ctx context.Context) (*GetOrderByClientOidResp, error) - // CancelOrderByOrderId Cancel Order By OrderId - // Description: This endpoint can be used to cancel a spot order by orderId. This endpoint only sends cancellation requests. The results of the requests must be obtained by checking the order status or subscribing to websocket. - // Documentation: https://www.kucoin.com/docs-new/api-3470174 + // GetSymbolsWithOpenOrder Get Symbols With Open Order + // Description: This interface can query all spot symbol that has active orders + // Documentation: https://www.kucoin.com/docs-new/api-3470177 // +---------------------+---------+ // | Extra API Info | Value | // +---------------------+---------+ @@ -230,13 +229,13 @@ type OrderAPI interface { // | API-CHANNEL | PRIVATE | // | API-PERMISSION | SPOT | // | API-RATE-LIMIT-POOL | SPOT | - // | API-RATE-LIMIT | 1 | + // | API-RATE-LIMIT | 2 | // +---------------------+---------+ - CancelOrderByOrderId(req *CancelOrderByOrderIdReq, ctx context.Context) (*CancelOrderByOrderIdResp, error) + GetSymbolsWithOpenOrder(ctx context.Context) (*GetSymbolsWithOpenOrderResp, error) - // GetOrderByOrderId Get Order By OrderId - // Description: This endpoint can be used to obtain information for a single Spot order using the order id. After the user successfully places an order, the order is in Active state, and the user can use inOrderBook to determine whether the order has entered the order. Canceled or fully filled orders are marked as completed Done status. - // Documentation: https://www.kucoin.com/docs-new/api-3470181 + // GetOpenOrders Get Open Orders + // Description: This interface is to obtain all Spot active order lists, and the return value of the active order interface is the paged data of all uncompleted order lists. The returned data is sorted in descending order according to the latest update time of the order. After the user successfully places an order, the order is in Active state, and the user can use inOrderBook to determine whether the order has entered the order. Canceled or fully filled orders are marked as completed Done status. + // Documentation: https://www.kucoin.com/docs-new/api-3470178 // +---------------------+---------+ // | Extra API Info | Value | // +---------------------+---------+ @@ -246,39 +245,39 @@ type OrderAPI interface { // | API-RATE-LIMIT-POOL | SPOT | // | API-RATE-LIMIT | 2 | // +---------------------+---------+ - GetOrderByOrderId(req *GetOrderByOrderIdReq, ctx context.Context) (*GetOrderByOrderIdResp, error) + GetOpenOrders(req *GetOpenOrdersReq, ctx context.Context) (*GetOpenOrdersResp, error) - // AddOrder Add Order - // Description: Place order to the Spot trading system, you can place two major types of orders: limit and market. Orders can only be placed if your account has sufficient funds. Once an order is placed, your funds will be put on hold for the duration of the order. The amount of funds on hold depends on the order type and parameters specified. - // Documentation: https://www.kucoin.com/docs-new/api-3470188 + // GetClosedOrders Get Closed Orders + // Description: This interface is to obtain all Spot closed order lists, and the return value of the active order interface is the paged data of all uncompleted order lists. The returned data is sorted in descending order according to the latest update time of the order. After the user successfully places an order, the order is in Active state, and the user can use inOrderBook to determine whether the order has entered the order. Canceled or fully filled orders are marked as completed Done status. + // Documentation: https://www.kucoin.com/docs-new/api-3470179 // +---------------------+---------+ // | Extra API Info | Value | // +---------------------+---------+ // | API-DOMAIN | SPOT | // | API-CHANNEL | PRIVATE | - // | API-PERMISSION | SPOT | + // | API-PERMISSION | GENERAL | // | API-RATE-LIMIT-POOL | SPOT | - // | API-RATE-LIMIT | 1 | + // | API-RATE-LIMIT | 2 | // +---------------------+---------+ - AddOrder(req *AddOrderReq, ctx context.Context) (*AddOrderResp, error) + GetClosedOrders(req *GetClosedOrdersReq, ctx context.Context) (*GetClosedOrdersResp, error) - // CancelOrderByClientOidSync Cancel Order By ClientOid Sync - // Description: This endpoint can be used to cancel a spot order by orderId. - // Documentation: https://www.kucoin.com/docs-new/api-3470186 + // GetTradeHistory Get Trade History + // Description: This endpoint can be used to obtain a list of the latest Spot transaction details. The returned data is sorted in descending order according to the latest update time of the order. + // Documentation: https://www.kucoin.com/docs-new/api-3470180 // +---------------------+---------+ // | Extra API Info | Value | // +---------------------+---------+ // | API-DOMAIN | SPOT | // | API-CHANNEL | PRIVATE | - // | API-PERMISSION | SPOT | + // | API-PERMISSION | GENERAL | // | API-RATE-LIMIT-POOL | SPOT | - // | API-RATE-LIMIT | 1 | + // | API-RATE-LIMIT | 2 | // +---------------------+---------+ - CancelOrderByClientOidSync(req *CancelOrderByClientOidSyncReq, ctx context.Context) (*CancelOrderByClientOidSyncResp, error) + GetTradeHistory(req *GetTradeHistoryReq, ctx context.Context) (*GetTradeHistoryResp, error) - // CancelOrderByOrderIdSync Cancel Order By OrderId Sync - // Description: This endpoint can be used to cancel a spot order by orderId. - // Documentation: https://www.kucoin.com/docs-new/api-3470185 + // GetDCP Get DCP + // Description: Get Disconnection Protect(Deadman Swich)Through this interface, you can query the settings of automatic order cancellation + // Documentation: https://www.kucoin.com/docs-new/api-3470172 // +---------------------+---------+ // | Extra API Info | Value | // +---------------------+---------+ @@ -286,13 +285,13 @@ type OrderAPI interface { // | API-CHANNEL | PRIVATE | // | API-PERMISSION | SPOT | // | API-RATE-LIMIT-POOL | SPOT | - // | API-RATE-LIMIT | 1 | + // | API-RATE-LIMIT | 2 | // +---------------------+---------+ - CancelOrderByOrderIdSync(req *CancelOrderByOrderIdSyncReq, ctx context.Context) (*CancelOrderByOrderIdSyncResp, error) + GetDCP(ctx context.Context) (*GetDCPResp, error) - // AddOrderSync Add Order Sync - // Description: Place order to the spot trading system The difference between this interface and \"Add order\" is that this interface will synchronously return the order information after the order matching is completed. For higher latency requirements, please select the \"Add order\" interface. If there is a requirement for returning data integrity, please select this interface - // Documentation: https://www.kucoin.com/docs-new/api-3470170 + // SetDCP Set DCP + // Description: Set Disconnection Protect(Deadman Swich)Through this interface, Call this interface to automatically cancel all orders of the set trading pair after the specified time. If this interface is not called again for renewal or cancellation before the set time, the system will help the user to cancel the order of the corresponding trading pair. Otherwise it will not. + // Documentation: https://www.kucoin.com/docs-new/api-3470173 // +---------------------+---------+ // | Extra API Info | Value | // +---------------------+---------+ @@ -300,13 +299,13 @@ type OrderAPI interface { // | API-CHANNEL | PRIVATE | // | API-PERMISSION | SPOT | // | API-RATE-LIMIT-POOL | SPOT | - // | API-RATE-LIMIT | 1 | + // | API-RATE-LIMIT | 2 | // +---------------------+---------+ - AddOrderSync(req *AddOrderSyncReq, ctx context.Context) (*AddOrderSyncResp, error) + SetDCP(req *SetDCPReq, ctx context.Context) (*SetDCPResp, error) - // AddOrderTest Add Order Test - // Description: Order test endpoint, the request parameters and return parameters of this endpoint are exactly the same as the order endpoint, and can be used to verify whether the signature is correct and other operations. After placing an order, the order will not enter the matching system, and the order cannot be queried. - // Documentation: https://www.kucoin.com/docs-new/api-3470187 + // AddStopOrder Add Stop Order + // Description: Place stop order to the Spot trading system, you can place two major types of orders: limit and market. Orders can only be placed if your account has sufficient funds. Once an order is placed, your funds will be put on hold for the duration of the order. The amount of funds on hold depends on the order type and parameters specified. + // Documentation: https://www.kucoin.com/docs-new/api-3470334 // +---------------------+---------+ // | Extra API Info | Value | // +---------------------+---------+ @@ -316,41 +315,42 @@ type OrderAPI interface { // | API-RATE-LIMIT-POOL | SPOT | // | API-RATE-LIMIT | 1 | // +---------------------+---------+ - AddOrderTest(req *AddOrderTestReq, ctx context.Context) (*AddOrderTestResp, error) + // Deprecated + AddStopOrder(req *AddStopOrderReq, ctx context.Context) (*AddStopOrderResp, error) - // GetRecentTradeHistoryOld Get Recent Trade History - Old - // Description: Request via this endpoint to get a list of 1000 fills in the last 24 hours. The return value is the data after Pagination, sorted in descending order according to time. - // Documentation: https://www.kucoin.com/docs-new/api-3470351 + // CancelStopOrderByClientOid Cancel Stop Order By ClientOid + // Description: This endpoint can be used to cancel a spot stop order by clientOid. + // Documentation: https://www.kucoin.com/docs-new/api-3470336 // +---------------------+---------+ // | Extra API Info | Value | // +---------------------+---------+ // | API-DOMAIN | SPOT | // | API-CHANNEL | PRIVATE | - // | API-PERMISSION | GENERAL | + // | API-PERMISSION | SPOT | // | API-RATE-LIMIT-POOL | SPOT | - // | API-RATE-LIMIT | 20 | + // | API-RATE-LIMIT | 5 | // +---------------------+---------+ // Deprecated - GetRecentTradeHistoryOld(req *GetRecentTradeHistoryOldReq, ctx context.Context) (*GetRecentTradeHistoryOldResp, error) + CancelStopOrderByClientOid(req *CancelStopOrderByClientOidReq, ctx context.Context) (*CancelStopOrderByClientOidResp, error) - // GetRecentOrdersListOld Get Recent Orders List - Old - // Description: Request via this endpoint to get your current order list. The return value is the data after Pagination, sorted in descending order according to time. - // Documentation: https://www.kucoin.com/docs-new/api-3470347 + // CancelStopOrderByOrderId Cancel Stop Order By OrderId + // Description: This endpoint can be used to cancel a spot stop order by orderId. + // Documentation: https://www.kucoin.com/docs-new/api-3470335 // +---------------------+---------+ // | Extra API Info | Value | // +---------------------+---------+ // | API-DOMAIN | SPOT | // | API-CHANNEL | PRIVATE | - // | API-PERMISSION | GENERAL | + // | API-PERMISSION | SPOT | // | API-RATE-LIMIT-POOL | SPOT | // | API-RATE-LIMIT | 3 | // +---------------------+---------+ // Deprecated - GetRecentOrdersListOld(req *GetRecentOrdersListOldReq, ctx context.Context) (*GetRecentOrdersListOldResp, error) + CancelStopOrderByOrderId(req *CancelStopOrderByOrderIdReq, ctx context.Context) (*CancelStopOrderByOrderIdResp, error) - // CancelOrderByClientOidOld Cancel Order By ClientOid - Old - // Description: This endpoint can be used to cancel a spot order by clientOid. This endpoint only sends cancellation requests. The results of the requests must be obtained by checking the order status or subscribing to websocket. - // Documentation: https://www.kucoin.com/docs-new/api-3470344 + // BatchCancelStopOrder Batch Cancel Stop Orders + // Description: This endpoint can be used to cancel a spot stop orders by batch. + // Documentation: https://www.kucoin.com/docs-new/api-3470337 // +---------------------+---------+ // | Extra API Info | Value | // +---------------------+---------+ @@ -360,41 +360,39 @@ type OrderAPI interface { // | API-RATE-LIMIT-POOL | SPOT | // | API-RATE-LIMIT | 3 | // +---------------------+---------+ - CancelOrderByClientOidOld(req *CancelOrderByClientOidOldReq, ctx context.Context) (*CancelOrderByClientOidOldResp, error) + BatchCancelStopOrder(req *BatchCancelStopOrderReq, ctx context.Context) (*BatchCancelStopOrderResp, error) - // GetOrderByClientOidOld Get Order By ClientOid - Old - // Description: Request via this interface to check the information of a single active order via clientOid. The system will prompt that the order does not exists if the order does not exist or has been settled. - // Documentation: https://www.kucoin.com/docs-new/api-3470349 - // +---------------------+---------+ + // GetStopOrdersList Get Stop Orders List + // Description: This interface is to obtain all Spot active stop order lists + // Documentation: https://www.kucoin.com/docs-new/api-3470338 + // +---------------------+---------+ // | Extra API Info | Value | // +---------------------+---------+ // | API-DOMAIN | SPOT | // | API-CHANNEL | PRIVATE | // | API-PERMISSION | GENERAL | // | API-RATE-LIMIT-POOL | SPOT | - // | API-RATE-LIMIT | 3 | + // | API-RATE-LIMIT | 8 | // +---------------------+---------+ - // Deprecated - GetOrderByClientOidOld(req *GetOrderByClientOidOldReq, ctx context.Context) (*GetOrderByClientOidOldResp, error) + GetStopOrdersList(req *GetStopOrdersListReq, ctx context.Context) (*GetStopOrdersListResp, error) - // BatchCancelOrderOld Batch Cancel Order - Old - // Description: Request via this endpoint to cancel all open orders. The response is a list of ids of the canceled orders. - // Documentation: https://www.kucoin.com/docs-new/api-3470345 + // GetStopOrderByOrderId Get Stop Order By OrderId + // Description: This interface is to obtain Spot stop order details by orderId + // Documentation: https://www.kucoin.com/docs-new/api-3470339 // +---------------------+---------+ // | Extra API Info | Value | // +---------------------+---------+ // | API-DOMAIN | SPOT | // | API-CHANNEL | PRIVATE | - // | API-PERMISSION | SPOT | + // | API-PERMISSION | GENERAL | // | API-RATE-LIMIT-POOL | SPOT | - // | API-RATE-LIMIT | 20 | + // | API-RATE-LIMIT | 3 | // +---------------------+---------+ - // Deprecated - BatchCancelOrderOld(req *BatchCancelOrderOldReq, ctx context.Context) (*BatchCancelOrderOldResp, error) + GetStopOrderByOrderId(req *GetStopOrderByOrderIdReq, ctx context.Context) (*GetStopOrderByOrderIdResp, error) - // GetOrdersListOld Get Orders List - Old - // Description: Request via this endpoint to get your current order list. The return value is the data after Pagination, sorted in descending order according to time. - // Documentation: https://www.kucoin.com/docs-new/api-3470346 + // GetStopOrderByClientOid Get Stop Order By ClientOid + // Description: This interface is to obtain Spot stop order details by orderId + // Documentation: https://www.kucoin.com/docs-new/api-3470340 // +---------------------+---------+ // | Extra API Info | Value | // +---------------------+---------+ @@ -402,14 +400,13 @@ type OrderAPI interface { // | API-CHANNEL | PRIVATE | // | API-PERMISSION | GENERAL | // | API-RATE-LIMIT-POOL | SPOT | - // | API-RATE-LIMIT | 2 | + // | API-RATE-LIMIT | 3 | // +---------------------+---------+ - // Deprecated - GetOrdersListOld(req *GetOrdersListOldReq, ctx context.Context) (*GetOrdersListOldResp, error) + GetStopOrderByClientOid(req *GetStopOrderByClientOidReq, ctx context.Context) (*GetStopOrderByClientOidResp, error) - // BatchAddOrdersOld Batch Add Orders - Old - // Description: Request via this endpoint to place 5 orders at the same time. The order type must be a limit order of the same symbol. - // Documentation: https://www.kucoin.com/docs-new/api-3470342 + // AddOcoOrder Add OCO Order + // Description: Place OCO order to the Spot trading system + // Documentation: https://www.kucoin.com/docs-new/api-3470353 // +---------------------+---------+ // | Extra API Info | Value | // +---------------------+---------+ @@ -417,14 +414,14 @@ type OrderAPI interface { // | API-CHANNEL | PRIVATE | // | API-PERMISSION | SPOT | // | API-RATE-LIMIT-POOL | SPOT | - // | API-RATE-LIMIT | 3 | + // | API-RATE-LIMIT | 2 | // +---------------------+---------+ // Deprecated - BatchAddOrdersOld(req *BatchAddOrdersOldReq, ctx context.Context) (*BatchAddOrdersOldResp, error) + AddOcoOrder(req *AddOcoOrderReq, ctx context.Context) (*AddOcoOrderResp, error) - // CancelOrderByOrderIdOld Cancel Order By OrderId - Old + // CancelOcoOrderByOrderId Cancel OCO Order By OrderId // Description: This endpoint can be used to cancel a spot order by orderId. This endpoint only sends cancellation requests. The results of the requests must be obtained by checking the order status or subscribing to websocket. - // Documentation: https://www.kucoin.com/docs-new/api-3470343 + // Documentation: https://www.kucoin.com/docs-new/api-3470354 // +---------------------+---------+ // | Extra API Info | Value | // +---------------------+---------+ @@ -435,26 +432,26 @@ type OrderAPI interface { // | API-RATE-LIMIT | 3 | // +---------------------+---------+ // Deprecated - CancelOrderByOrderIdOld(req *CancelOrderByOrderIdOldReq, ctx context.Context) (*CancelOrderByOrderIdOldResp, error) + CancelOcoOrderByOrderId(req *CancelOcoOrderByOrderIdReq, ctx context.Context) (*CancelOcoOrderByOrderIdResp, error) - // GetOrderByOrderIdOld Get Order By OrderId - Old - // Description: Request via this endpoint to get a single order info by order ID. - // Documentation: https://www.kucoin.com/docs-new/api-3470348 + // CancelOcoOrderByClientOid Cancel OCO Order By ClientOid + // Description: Request via this interface to cancel a stop order via the clientOid. You will receive cancelledOrderIds field once the system has received the cancellation request. The cancellation request will be processed by the matching engine in sequence. To know if the request is processed (successfully or not), you may check the order status or the update message from the pushes. + // Documentation: https://www.kucoin.com/docs-new/api-3470355 // +---------------------+---------+ // | Extra API Info | Value | // +---------------------+---------+ // | API-DOMAIN | SPOT | // | API-CHANNEL | PRIVATE | - // | API-PERMISSION | GENERAL | + // | API-PERMISSION | SPOT | // | API-RATE-LIMIT-POOL | SPOT | - // | API-RATE-LIMIT | 2 | + // | API-RATE-LIMIT | 3 | // +---------------------+---------+ // Deprecated - GetOrderByOrderIdOld(req *GetOrderByOrderIdOldReq, ctx context.Context) (*GetOrderByOrderIdOldResp, error) + CancelOcoOrderByClientOid(req *CancelOcoOrderByClientOidReq, ctx context.Context) (*CancelOcoOrderByClientOidResp, error) - // AddOrderOld Add Order - Old - // Description: Place order to the Spot trading system, you can place two major types of orders: limit and market. Orders can only be placed if your account has sufficient funds. Once an order is placed, your funds will be put on hold for the duration of the order. The amount of funds on hold depends on the order type and parameters specified. - // Documentation: https://www.kucoin.com/docs-new/api-3470333 + // BatchCancelOcoOrders Batch Cancel OCO Order + // Description: This interface can batch cancel OCO orders through orderIds. You will receive cancelledOrderIds field once the system has received the cancellation request. The cancellation request will be processed by the matching engine in sequence. To know if the request is processed (successfully or not), you may check the order status or the update message from the pushes. + // Documentation: https://www.kucoin.com/docs-new/api-3470356 // +---------------------+---------+ // | Extra API Info | Value | // +---------------------+---------+ @@ -462,58 +459,59 @@ type OrderAPI interface { // | API-CHANNEL | PRIVATE | // | API-PERMISSION | SPOT | // | API-RATE-LIMIT-POOL | SPOT | - // | API-RATE-LIMIT | 2 | + // | API-RATE-LIMIT | 3 | // +---------------------+---------+ // Deprecated - AddOrderOld(req *AddOrderOldReq, ctx context.Context) (*AddOrderOldResp, error) + BatchCancelOcoOrders(req *BatchCancelOcoOrdersReq, ctx context.Context) (*BatchCancelOcoOrdersResp, error) - // AddOrderTestOld Add Order Test - Old - // Description: Order test endpoint, the request parameters and return parameters of this endpoint are exactly the same as the order endpoint, and can be used to verify whether the signature is correct and other operations. After placing an order, the order will not enter the matching system, and the order cannot be queried. - // Documentation: https://www.kucoin.com/docs-new/api-3470341 + // GetOcoOrderByOrderId Get OCO Order By OrderId + // Description: Request via this interface to get a oco order information via the order ID. + // Documentation: https://www.kucoin.com/docs-new/api-3470357 // +---------------------+---------+ // | Extra API Info | Value | // +---------------------+---------+ // | API-DOMAIN | SPOT | // | API-CHANNEL | PRIVATE | - // | API-PERMISSION | SPOT | + // | API-PERMISSION | GENERAL | // | API-RATE-LIMIT-POOL | SPOT | // | API-RATE-LIMIT | 2 | // +---------------------+---------+ // Deprecated - AddOrderTestOld(req *AddOrderTestOldReq, ctx context.Context) (*AddOrderTestOldResp, error) + GetOcoOrderByOrderId(req *GetOcoOrderByOrderIdReq, ctx context.Context) (*GetOcoOrderByOrderIdResp, error) - // BatchCancelStopOrder Batch Cancel Stop Orders - // Description: This endpoint can be used to cancel a spot stop orders by batch. - // Documentation: https://www.kucoin.com/docs-new/api-3470337 + // GetOcoOrderByClientOid Get OCO Order By ClientOid + // Description: Request via this interface to get a oco order information via the client order ID. + // Documentation: https://www.kucoin.com/docs-new/api-3470358 // +---------------------+---------+ // | Extra API Info | Value | // +---------------------+---------+ // | API-DOMAIN | SPOT | // | API-CHANNEL | PRIVATE | - // | API-PERMISSION | SPOT | + // | API-PERMISSION | GENERAL | // | API-RATE-LIMIT-POOL | SPOT | - // | API-RATE-LIMIT | 3 | + // | API-RATE-LIMIT | 2 | // +---------------------+---------+ - BatchCancelStopOrder(req *BatchCancelStopOrderReq, ctx context.Context) (*BatchCancelStopOrderResp, error) + // Deprecated + GetOcoOrderByClientOid(req *GetOcoOrderByClientOidReq, ctx context.Context) (*GetOcoOrderByClientOidResp, error) - // CancelStopOrderByClientOid Cancel Stop Order By ClientOid - // Description: This endpoint can be used to cancel a spot stop order by clientOid. - // Documentation: https://www.kucoin.com/docs-new/api-3470336 + // GetOcoOrderDetailByOrderId Get OCO Order Detail By OrderId + // Description: Request via this interface to get a oco order detail via the order ID. + // Documentation: https://www.kucoin.com/docs-new/api-3470359 // +---------------------+---------+ // | Extra API Info | Value | // +---------------------+---------+ // | API-DOMAIN | SPOT | // | API-CHANNEL | PRIVATE | - // | API-PERMISSION | SPOT | + // | API-PERMISSION | GENERAL | // | API-RATE-LIMIT-POOL | SPOT | - // | API-RATE-LIMIT | 5 | + // | API-RATE-LIMIT | 2 | // +---------------------+---------+ // Deprecated - CancelStopOrderByClientOid(req *CancelStopOrderByClientOidReq, ctx context.Context) (*CancelStopOrderByClientOidResp, error) + GetOcoOrderDetailByOrderId(req *GetOcoOrderDetailByOrderIdReq, ctx context.Context) (*GetOcoOrderDetailByOrderIdResp, error) - // GetStopOrdersList Get Stop Orders List - // Description: This interface is to obtain all Spot active stop order lists - // Documentation: https://www.kucoin.com/docs-new/api-3470338 + // GetOcoOrderList Get OCO Order List + // Description: Request via this endpoint to get your current OCO order list. Items are paginated and sorted to show the latest first. See the Pagination section for retrieving additional entries after the first page. + // Documentation: https://www.kucoin.com/docs-new/api-3470360 // +---------------------+---------+ // | Extra API Info | Value | // +---------------------+---------+ @@ -521,13 +519,14 @@ type OrderAPI interface { // | API-CHANNEL | PRIVATE | // | API-PERMISSION | GENERAL | // | API-RATE-LIMIT-POOL | SPOT | - // | API-RATE-LIMIT | 8 | + // | API-RATE-LIMIT | 2 | // +---------------------+---------+ - GetStopOrdersList(req *GetStopOrdersListReq, ctx context.Context) (*GetStopOrdersListResp, error) + // Deprecated + GetOcoOrderList(req *GetOcoOrderListReq, ctx context.Context) (*GetOcoOrderListResp, error) - // CancelStopOrderByOrderId Cancel Stop Order By OrderId - // Description: This endpoint can be used to cancel a spot stop order by orderId. - // Documentation: https://www.kucoin.com/docs-new/api-3470335 + // AddOrderOld Add Order - Old + // Description: Place order to the Spot trading system, you can place two major types of orders: limit and market. Orders can only be placed if your account has sufficient funds. Once an order is placed, your funds will be put on hold for the duration of the order. The amount of funds on hold depends on the order type and parameters specified. + // Documentation: https://www.kucoin.com/docs-new/api-3470333 // +---------------------+---------+ // | Extra API Info | Value | // +---------------------+---------+ @@ -535,28 +534,29 @@ type OrderAPI interface { // | API-CHANNEL | PRIVATE | // | API-PERMISSION | SPOT | // | API-RATE-LIMIT-POOL | SPOT | - // | API-RATE-LIMIT | 3 | + // | API-RATE-LIMIT | 2 | // +---------------------+---------+ // Deprecated - CancelStopOrderByOrderId(req *CancelStopOrderByOrderIdReq, ctx context.Context) (*CancelStopOrderByOrderIdResp, error) + AddOrderOld(req *AddOrderOldReq, ctx context.Context) (*AddOrderOldResp, error) - // GetStopOrderByOrderId Get Stop Order By OrderId - // Description: This interface is to obtain Spot stop order details by orderId - // Documentation: https://www.kucoin.com/docs-new/api-3470339 + // AddOrderTestOld Add Order Test - Old + // Description: Order test endpoint, the request parameters and return parameters of this endpoint are exactly the same as the order endpoint, and can be used to verify whether the signature is correct and other operations. After placing an order, the order will not enter the matching system, and the order cannot be queried. + // Documentation: https://www.kucoin.com/docs-new/api-3470341 // +---------------------+---------+ // | Extra API Info | Value | // +---------------------+---------+ // | API-DOMAIN | SPOT | // | API-CHANNEL | PRIVATE | - // | API-PERMISSION | GENERAL | + // | API-PERMISSION | SPOT | // | API-RATE-LIMIT-POOL | SPOT | - // | API-RATE-LIMIT | 3 | + // | API-RATE-LIMIT | 2 | // +---------------------+---------+ - GetStopOrderByOrderId(req *GetStopOrderByOrderIdReq, ctx context.Context) (*GetStopOrderByOrderIdResp, error) + // Deprecated + AddOrderTestOld(req *AddOrderTestOldReq, ctx context.Context) (*AddOrderTestOldResp, error) - // AddStopOrder Add Stop Order - // Description: Place stop order to the Spot trading system, you can place two major types of orders: limit and market. Orders can only be placed if your account has sufficient funds. Once an order is placed, your funds will be put on hold for the duration of the order. The amount of funds on hold depends on the order type and parameters specified. - // Documentation: https://www.kucoin.com/docs-new/api-3470334 + // BatchAddOrdersOld Batch Add Orders - Old + // Description: Request via this endpoint to place 5 orders at the same time. The order type must be a limit order of the same symbol. + // Documentation: https://www.kucoin.com/docs-new/api-3470342 // +---------------------+---------+ // | Extra API Info | Value | // +---------------------+---------+ @@ -564,28 +564,29 @@ type OrderAPI interface { // | API-CHANNEL | PRIVATE | // | API-PERMISSION | SPOT | // | API-RATE-LIMIT-POOL | SPOT | - // | API-RATE-LIMIT | 1 | + // | API-RATE-LIMIT | 3 | // +---------------------+---------+ // Deprecated - AddStopOrder(req *AddStopOrderReq, ctx context.Context) (*AddStopOrderResp, error) + BatchAddOrdersOld(req *BatchAddOrdersOldReq, ctx context.Context) (*BatchAddOrdersOldResp, error) - // GetStopOrderByClientOid Get Stop Order By ClientOid - // Description: This interface is to obtain Spot stop order details by orderId - // Documentation: https://www.kucoin.com/docs-new/api-3470340 + // CancelOrderByOrderIdOld Cancel Order By OrderId - Old + // Description: This endpoint can be used to cancel a spot order by orderId. This endpoint only sends cancellation requests. The results of the requests must be obtained by checking the order status or subscribing to websocket. + // Documentation: https://www.kucoin.com/docs-new/api-3470343 // +---------------------+---------+ // | Extra API Info | Value | // +---------------------+---------+ // | API-DOMAIN | SPOT | // | API-CHANNEL | PRIVATE | - // | API-PERMISSION | GENERAL | + // | API-PERMISSION | SPOT | // | API-RATE-LIMIT-POOL | SPOT | // | API-RATE-LIMIT | 3 | // +---------------------+---------+ - GetStopOrderByClientOid(req *GetStopOrderByClientOidReq, ctx context.Context) (*GetStopOrderByClientOidResp, error) + // Deprecated + CancelOrderByOrderIdOld(req *CancelOrderByOrderIdOldReq, ctx context.Context) (*CancelOrderByOrderIdOldResp, error) - // CancelOcoOrderByClientOid Cancel OCO Order By ClientOid - // Description: Request via this interface to cancel a stop order via the clientOid. You will receive cancelledOrderIds field once the system has received the cancellation request. The cancellation request will be processed by the matching engine in sequence. To know if the request is processed (successfully or not), you may check the order status or the update message from the pushes. - // Documentation: https://www.kucoin.com/docs-new/api-3470355 + // CancelOrderByClientOidOld Cancel Order By ClientOid - Old + // Description: This endpoint can be used to cancel a spot order by clientOid. This endpoint only sends cancellation requests. The results of the requests must be obtained by checking the order status or subscribing to websocket. + // Documentation: https://www.kucoin.com/docs-new/api-3470344 // +---------------------+---------+ // | Extra API Info | Value | // +---------------------+---------+ @@ -595,27 +596,26 @@ type OrderAPI interface { // | API-RATE-LIMIT-POOL | SPOT | // | API-RATE-LIMIT | 3 | // +---------------------+---------+ - // Deprecated - CancelOcoOrderByClientOid(req *CancelOcoOrderByClientOidReq, ctx context.Context) (*CancelOcoOrderByClientOidResp, error) + CancelOrderByClientOidOld(req *CancelOrderByClientOidOldReq, ctx context.Context) (*CancelOrderByClientOidOldResp, error) - // GetOcoOrderByClientOid Get OCO Order By ClientOid - // Description: Request via this interface to get a oco order information via the client order ID. - // Documentation: https://www.kucoin.com/docs-new/api-3470358 + // BatchCancelOrderOld Batch Cancel Order - Old + // Description: Request via this endpoint to cancel all open orders. The response is a list of ids of the canceled orders. + // Documentation: https://www.kucoin.com/docs-new/api-3470345 // +---------------------+---------+ // | Extra API Info | Value | // +---------------------+---------+ // | API-DOMAIN | SPOT | // | API-CHANNEL | PRIVATE | - // | API-PERMISSION | GENERAL | + // | API-PERMISSION | SPOT | // | API-RATE-LIMIT-POOL | SPOT | - // | API-RATE-LIMIT | 2 | + // | API-RATE-LIMIT | 20 | // +---------------------+---------+ // Deprecated - GetOcoOrderByClientOid(req *GetOcoOrderByClientOidReq, ctx context.Context) (*GetOcoOrderByClientOidResp, error) + BatchCancelOrderOld(req *BatchCancelOrderOldReq, ctx context.Context) (*BatchCancelOrderOldResp, error) - // GetOcoOrderDetailByOrderId Get OCO Order Detail By OrderId - // Description: Request via this interface to get a oco order detail via the order ID. - // Documentation: https://www.kucoin.com/docs-new/api-3470359 + // GetOrdersListOld Get Orders List - Old + // Description: Request via this endpoint to get your current order list. The return value is the data after Pagination, sorted in descending order according to time. + // Documentation: https://www.kucoin.com/docs-new/api-3470346 // +---------------------+---------+ // | Extra API Info | Value | // +---------------------+---------+ @@ -626,26 +626,26 @@ type OrderAPI interface { // | API-RATE-LIMIT | 2 | // +---------------------+---------+ // Deprecated - GetOcoOrderDetailByOrderId(req *GetOcoOrderDetailByOrderIdReq, ctx context.Context) (*GetOcoOrderDetailByOrderIdResp, error) + GetOrdersListOld(req *GetOrdersListOldReq, ctx context.Context) (*GetOrdersListOldResp, error) - // CancelOcoOrderByOrderId Cancel OCO Order By OrderId - // Description: This endpoint can be used to cancel a spot order by orderId. This endpoint only sends cancellation requests. The results of the requests must be obtained by checking the order status or subscribing to websocket. - // Documentation: https://www.kucoin.com/docs-new/api-3470354 + // GetRecentOrdersListOld Get Recent Orders List - Old + // Description: Request via this endpoint to get your current order list. The return value is the data after Pagination, sorted in descending order according to time. + // Documentation: https://www.kucoin.com/docs-new/api-3470347 // +---------------------+---------+ // | Extra API Info | Value | // +---------------------+---------+ // | API-DOMAIN | SPOT | // | API-CHANNEL | PRIVATE | - // | API-PERMISSION | SPOT | + // | API-PERMISSION | GENERAL | // | API-RATE-LIMIT-POOL | SPOT | // | API-RATE-LIMIT | 3 | // +---------------------+---------+ // Deprecated - CancelOcoOrderByOrderId(req *CancelOcoOrderByOrderIdReq, ctx context.Context) (*CancelOcoOrderByOrderIdResp, error) + GetRecentOrdersListOld(req *GetRecentOrdersListOldReq, ctx context.Context) (*GetRecentOrdersListOldResp, error) - // GetOcoOrderByOrderId Get OCO Order By OrderId - // Description: Request via this interface to get a oco order information via the order ID. - // Documentation: https://www.kucoin.com/docs-new/api-3470357 + // GetOrderByOrderIdOld Get Order By OrderId - Old + // Description: Request via this endpoint to get a single order info by order ID. + // Documentation: https://www.kucoin.com/docs-new/api-3470348 // +---------------------+---------+ // | Extra API Info | Value | // +---------------------+---------+ @@ -656,41 +656,41 @@ type OrderAPI interface { // | API-RATE-LIMIT | 2 | // +---------------------+---------+ // Deprecated - GetOcoOrderByOrderId(req *GetOcoOrderByOrderIdReq, ctx context.Context) (*GetOcoOrderByOrderIdResp, error) + GetOrderByOrderIdOld(req *GetOrderByOrderIdOldReq, ctx context.Context) (*GetOrderByOrderIdOldResp, error) - // AddOcoOrder Add OCO Order - // Description: Place OCO order to the Spot trading system - // Documentation: https://www.kucoin.com/docs-new/api-3470353 + // GetOrderByClientOidOld Get Order By ClientOid - Old + // Description: Request via this interface to check the information of a single active order via clientOid. The system will prompt that the order does not exists if the order does not exist or has been settled. + // Documentation: https://www.kucoin.com/docs-new/api-3470349 // +---------------------+---------+ // | Extra API Info | Value | // +---------------------+---------+ // | API-DOMAIN | SPOT | // | API-CHANNEL | PRIVATE | - // | API-PERMISSION | SPOT | + // | API-PERMISSION | GENERAL | // | API-RATE-LIMIT-POOL | SPOT | - // | API-RATE-LIMIT | 2 | + // | API-RATE-LIMIT | 3 | // +---------------------+---------+ // Deprecated - AddOcoOrder(req *AddOcoOrderReq, ctx context.Context) (*AddOcoOrderResp, error) + GetOrderByClientOidOld(req *GetOrderByClientOidOldReq, ctx context.Context) (*GetOrderByClientOidOldResp, error) - // BatchCancelOcoOrders Batch Cancel OCO Order - // Description: This interface can batch cancel OCO orders through orderIds. You will receive cancelledOrderIds field once the system has received the cancellation request. The cancellation request will be processed by the matching engine in sequence. To know if the request is processed (successfully or not), you may check the order status or the update message from the pushes. - // Documentation: https://www.kucoin.com/docs-new/api-3470356 + // GetTradeHistoryOld Get Trade History - Old + // Description: Request via this endpoint to get the recent fills. The return value is the data after Pagination, sorted in descending order according to time. + // Documentation: https://www.kucoin.com/docs-new/api-3470350 // +---------------------+---------+ // | Extra API Info | Value | // +---------------------+---------+ // | API-DOMAIN | SPOT | // | API-CHANNEL | PRIVATE | - // | API-PERMISSION | SPOT | + // | API-PERMISSION | GENERAL | // | API-RATE-LIMIT-POOL | SPOT | - // | API-RATE-LIMIT | 3 | + // | API-RATE-LIMIT | 10 | // +---------------------+---------+ // Deprecated - BatchCancelOcoOrders(req *BatchCancelOcoOrdersReq, ctx context.Context) (*BatchCancelOcoOrdersResp, error) + GetTradeHistoryOld(req *GetTradeHistoryOldReq, ctx context.Context) (*GetTradeHistoryOldResp, error) - // GetOcoOrderList Get OCO Order List - // Description: Request via this endpoint to get your current OCO order list. Items are paginated and sorted to show the latest first. See the Pagination section for retrieving additional entries after the first page. - // Documentation: https://www.kucoin.com/docs-new/api-3470360 + // GetRecentTradeHistoryOld Get Recent Trade History - Old + // Description: Request via this endpoint to get a list of 1000 fills in the last 24 hours. The return value is the data after Pagination, sorted in descending order according to time. + // Documentation: https://www.kucoin.com/docs-new/api-3470351 // +---------------------+---------+ // | Extra API Info | Value | // +---------------------+---------+ @@ -698,10 +698,10 @@ type OrderAPI interface { // | API-CHANNEL | PRIVATE | // | API-PERMISSION | GENERAL | // | API-RATE-LIMIT-POOL | SPOT | - // | API-RATE-LIMIT | 2 | + // | API-RATE-LIMIT | 20 | // +---------------------+---------+ // Deprecated - GetOcoOrderList(req *GetOcoOrderListReq, ctx context.Context) (*GetOcoOrderListResp, error) + GetRecentTradeHistoryOld(req *GetRecentTradeHistoryOldReq, ctx context.Context) (*GetRecentTradeHistoryOldResp, error) } type OrderAPIImpl struct { @@ -712,45 +712,45 @@ func NewOrderAPIImp(transport interfaces.Transport) *OrderAPIImpl { return &OrderAPIImpl{transport: transport} } -func (impl *OrderAPIImpl) GetTradeHistoryOld(req *GetTradeHistoryOldReq, ctx context.Context) (*GetTradeHistoryOldResp, error) { - resp := &GetTradeHistoryOldResp{} - err := impl.transport.Call(ctx, "spot", false, "Get", "/api/v1/fills", req, resp, false) +func (impl *OrderAPIImpl) AddOrder(req *AddOrderReq, ctx context.Context) (*AddOrderResp, error) { + resp := &AddOrderResp{} + err := impl.transport.Call(ctx, "spot", false, "Post", "/api/v1/hf/orders", req, resp, false) return resp, err } -func (impl *OrderAPIImpl) GetTradeHistory(req *GetTradeHistoryReq, ctx context.Context) (*GetTradeHistoryResp, error) { - resp := &GetTradeHistoryResp{} - err := impl.transport.Call(ctx, "spot", false, "Get", "/api/v1/hf/fills", req, resp, false) +func (impl *OrderAPIImpl) AddOrderSync(req *AddOrderSyncReq, ctx context.Context) (*AddOrderSyncResp, error) { + resp := &AddOrderSyncResp{} + err := impl.transport.Call(ctx, "spot", false, "Post", "/api/v1/hf/orders/sync", req, resp, false) return resp, err } -func (impl *OrderAPIImpl) GetOpenOrders(req *GetOpenOrdersReq, ctx context.Context) (*GetOpenOrdersResp, error) { - resp := &GetOpenOrdersResp{} - err := impl.transport.Call(ctx, "spot", false, "Get", "/api/v1/hf/orders/active", req, resp, false) +func (impl *OrderAPIImpl) AddOrderTest(req *AddOrderTestReq, ctx context.Context) (*AddOrderTestResp, error) { + resp := &AddOrderTestResp{} + err := impl.transport.Call(ctx, "spot", false, "Post", "/api/v1/hf/orders/test", req, resp, false) return resp, err } -func (impl *OrderAPIImpl) GetSymbolsWithOpenOrder(ctx context.Context) (*GetSymbolsWithOpenOrderResp, error) { - resp := &GetSymbolsWithOpenOrderResp{} - err := impl.transport.Call(ctx, "spot", false, "Get", "/api/v1/hf/orders/active/symbols", nil, resp, false) +func (impl *OrderAPIImpl) BatchAddOrders(req *BatchAddOrdersReq, ctx context.Context) (*BatchAddOrdersResp, error) { + resp := &BatchAddOrdersResp{} + err := impl.transport.Call(ctx, "spot", false, "Post", "/api/v1/hf/orders/multi", req, resp, false) return resp, err } -func (impl *OrderAPIImpl) ModifyOrder(req *ModifyOrderReq, ctx context.Context) (*ModifyOrderResp, error) { - resp := &ModifyOrderResp{} - err := impl.transport.Call(ctx, "spot", false, "Post", "/api/v1/hf/orders/alter", req, resp, false) +func (impl *OrderAPIImpl) BatchAddOrdersSync(req *BatchAddOrdersSyncReq, ctx context.Context) (*BatchAddOrdersSyncResp, error) { + resp := &BatchAddOrdersSyncResp{} + err := impl.transport.Call(ctx, "spot", false, "Post", "/api/v1/hf/orders/multi/sync", req, resp, false) return resp, err } -func (impl *OrderAPIImpl) CancelAllOrders(ctx context.Context) (*CancelAllOrdersResp, error) { - resp := &CancelAllOrdersResp{} - err := impl.transport.Call(ctx, "spot", false, "Delete", "/api/v1/hf/orders/cancelAll", nil, resp, false) +func (impl *OrderAPIImpl) CancelOrderByOrderId(req *CancelOrderByOrderIdReq, ctx context.Context) (*CancelOrderByOrderIdResp, error) { + resp := &CancelOrderByOrderIdResp{} + err := impl.transport.Call(ctx, "spot", false, "Delete", "/api/v1/hf/orders/{orderId}", req, resp, false) return resp, err } -func (impl *OrderAPIImpl) CancelPartialOrder(req *CancelPartialOrderReq, ctx context.Context) (*CancelPartialOrderResp, error) { - resp := &CancelPartialOrderResp{} - err := impl.transport.Call(ctx, "spot", false, "Delete", "/api/v1/hf/orders/cancel/{orderId}", req, resp, false) +func (impl *OrderAPIImpl) CancelOrderByOrderIdSync(req *CancelOrderByOrderIdSyncReq, ctx context.Context) (*CancelOrderByOrderIdSyncResp, error) { + resp := &CancelOrderByOrderIdSyncResp{} + err := impl.transport.Call(ctx, "spot", false, "Delete", "/api/v1/hf/orders/sync/{orderId}", req, resp, false) return resp, err } @@ -760,21 +760,15 @@ func (impl *OrderAPIImpl) CancelOrderByClientOid(req *CancelOrderByClientOidReq, return resp, err } -func (impl *OrderAPIImpl) GetOrderByClientOid(req *GetOrderByClientOidReq, ctx context.Context) (*GetOrderByClientOidResp, error) { - resp := &GetOrderByClientOidResp{} - err := impl.transport.Call(ctx, "spot", false, "Get", "/api/v1/hf/orders/client-order/{clientOid}", req, resp, false) - return resp, err -} - -func (impl *OrderAPIImpl) SetDCP(req *SetDCPReq, ctx context.Context) (*SetDCPResp, error) { - resp := &SetDCPResp{} - err := impl.transport.Call(ctx, "spot", false, "Post", "/api/v1/hf/orders/dead-cancel-all", req, resp, false) +func (impl *OrderAPIImpl) CancelOrderByClientOidSync(req *CancelOrderByClientOidSyncReq, ctx context.Context) (*CancelOrderByClientOidSyncResp, error) { + resp := &CancelOrderByClientOidSyncResp{} + err := impl.transport.Call(ctx, "spot", false, "Delete", "/api/v1/hf/orders/sync/client-order/{clientOid}", req, resp, false) return resp, err } -func (impl *OrderAPIImpl) GetDCP(ctx context.Context) (*GetDCPResp, error) { - resp := &GetDCPResp{} - err := impl.transport.Call(ctx, "spot", false, "Get", "/api/v1/hf/orders/dead-cancel-all/query", nil, resp, false) +func (impl *OrderAPIImpl) CancelPartialOrder(req *CancelPartialOrderReq, ctx context.Context) (*CancelPartialOrderResp, error) { + resp := &CancelPartialOrderResp{} + err := impl.transport.Call(ctx, "spot", false, "Delete", "/api/v1/hf/orders/cancel/{orderId}", req, resp, false) return resp, err } @@ -784,218 +778,224 @@ func (impl *OrderAPIImpl) CancelAllOrdersBySymbol(req *CancelAllOrdersBySymbolRe return resp, err } -func (impl *OrderAPIImpl) GetClosedOrders(req *GetClosedOrdersReq, ctx context.Context) (*GetClosedOrdersResp, error) { - resp := &GetClosedOrdersResp{} - err := impl.transport.Call(ctx, "spot", false, "Get", "/api/v1/hf/orders/done", req, resp, false) +func (impl *OrderAPIImpl) CancelAllOrders(ctx context.Context) (*CancelAllOrdersResp, error) { + resp := &CancelAllOrdersResp{} + err := impl.transport.Call(ctx, "spot", false, "Delete", "/api/v1/hf/orders/cancelAll", nil, resp, false) return resp, err } -func (impl *OrderAPIImpl) BatchAddOrders(req *BatchAddOrdersReq, ctx context.Context) (*BatchAddOrdersResp, error) { - resp := &BatchAddOrdersResp{} - err := impl.transport.Call(ctx, "spot", false, "Post", "/api/v1/hf/orders/multi", req, resp, false) +func (impl *OrderAPIImpl) ModifyOrder(req *ModifyOrderReq, ctx context.Context) (*ModifyOrderResp, error) { + resp := &ModifyOrderResp{} + err := impl.transport.Call(ctx, "spot", false, "Post", "/api/v1/hf/orders/alter", req, resp, false) return resp, err } -func (impl *OrderAPIImpl) BatchAddOrdersSync(req *BatchAddOrdersSyncReq, ctx context.Context) (*BatchAddOrdersSyncResp, error) { - resp := &BatchAddOrdersSyncResp{} - err := impl.transport.Call(ctx, "spot", false, "Post", "/api/v1/hf/orders/multi/sync", req, resp, false) +func (impl *OrderAPIImpl) GetOrderByOrderId(req *GetOrderByOrderIdReq, ctx context.Context) (*GetOrderByOrderIdResp, error) { + resp := &GetOrderByOrderIdResp{} + err := impl.transport.Call(ctx, "spot", false, "Get", "/api/v1/hf/orders/{orderId}", req, resp, false) return resp, err } -func (impl *OrderAPIImpl) CancelOrderByOrderId(req *CancelOrderByOrderIdReq, ctx context.Context) (*CancelOrderByOrderIdResp, error) { - resp := &CancelOrderByOrderIdResp{} - err := impl.transport.Call(ctx, "spot", false, "Delete", "/api/v1/hf/orders/{orderId}", req, resp, false) +func (impl *OrderAPIImpl) GetOrderByClientOid(req *GetOrderByClientOidReq, ctx context.Context) (*GetOrderByClientOidResp, error) { + resp := &GetOrderByClientOidResp{} + err := impl.transport.Call(ctx, "spot", false, "Get", "/api/v1/hf/orders/client-order/{clientOid}", req, resp, false) return resp, err } -func (impl *OrderAPIImpl) GetOrderByOrderId(req *GetOrderByOrderIdReq, ctx context.Context) (*GetOrderByOrderIdResp, error) { - resp := &GetOrderByOrderIdResp{} - err := impl.transport.Call(ctx, "spot", false, "Get", "/api/v1/hf/orders/{orderId}", req, resp, false) +func (impl *OrderAPIImpl) GetSymbolsWithOpenOrder(ctx context.Context) (*GetSymbolsWithOpenOrderResp, error) { + resp := &GetSymbolsWithOpenOrderResp{} + err := impl.transport.Call(ctx, "spot", false, "Get", "/api/v1/hf/orders/active/symbols", nil, resp, false) return resp, err } -func (impl *OrderAPIImpl) AddOrder(req *AddOrderReq, ctx context.Context) (*AddOrderResp, error) { - resp := &AddOrderResp{} - err := impl.transport.Call(ctx, "spot", false, "Post", "/api/v1/hf/orders", req, resp, false) +func (impl *OrderAPIImpl) GetOpenOrders(req *GetOpenOrdersReq, ctx context.Context) (*GetOpenOrdersResp, error) { + resp := &GetOpenOrdersResp{} + err := impl.transport.Call(ctx, "spot", false, "Get", "/api/v1/hf/orders/active", req, resp, false) return resp, err } -func (impl *OrderAPIImpl) CancelOrderByClientOidSync(req *CancelOrderByClientOidSyncReq, ctx context.Context) (*CancelOrderByClientOidSyncResp, error) { - resp := &CancelOrderByClientOidSyncResp{} - err := impl.transport.Call(ctx, "spot", false, "Delete", "/api/v1/hf/orders/sync/client-order/{clientOid}", req, resp, false) +func (impl *OrderAPIImpl) GetClosedOrders(req *GetClosedOrdersReq, ctx context.Context) (*GetClosedOrdersResp, error) { + resp := &GetClosedOrdersResp{} + err := impl.transport.Call(ctx, "spot", false, "Get", "/api/v1/hf/orders/done", req, resp, false) return resp, err } -func (impl *OrderAPIImpl) CancelOrderByOrderIdSync(req *CancelOrderByOrderIdSyncReq, ctx context.Context) (*CancelOrderByOrderIdSyncResp, error) { - resp := &CancelOrderByOrderIdSyncResp{} - err := impl.transport.Call(ctx, "spot", false, "Delete", "/api/v1/hf/orders/sync/{orderId}", req, resp, false) +func (impl *OrderAPIImpl) GetTradeHistory(req *GetTradeHistoryReq, ctx context.Context) (*GetTradeHistoryResp, error) { + resp := &GetTradeHistoryResp{} + err := impl.transport.Call(ctx, "spot", false, "Get", "/api/v1/hf/fills", req, resp, false) return resp, err } -func (impl *OrderAPIImpl) AddOrderSync(req *AddOrderSyncReq, ctx context.Context) (*AddOrderSyncResp, error) { - resp := &AddOrderSyncResp{} - err := impl.transport.Call(ctx, "spot", false, "Post", "/api/v1/hf/orders/sync", req, resp, false) +func (impl *OrderAPIImpl) GetDCP(ctx context.Context) (*GetDCPResp, error) { + resp := &GetDCPResp{} + err := impl.transport.Call(ctx, "spot", false, "Get", "/api/v1/hf/orders/dead-cancel-all/query", nil, resp, false) return resp, err } -func (impl *OrderAPIImpl) AddOrderTest(req *AddOrderTestReq, ctx context.Context) (*AddOrderTestResp, error) { - resp := &AddOrderTestResp{} - err := impl.transport.Call(ctx, "spot", false, "Post", "/api/v1/hf/orders/test", req, resp, false) +func (impl *OrderAPIImpl) SetDCP(req *SetDCPReq, ctx context.Context) (*SetDCPResp, error) { + resp := &SetDCPResp{} + err := impl.transport.Call(ctx, "spot", false, "Post", "/api/v1/hf/orders/dead-cancel-all", req, resp, false) return resp, err } -func (impl *OrderAPIImpl) GetRecentTradeHistoryOld(req *GetRecentTradeHistoryOldReq, ctx context.Context) (*GetRecentTradeHistoryOldResp, error) { - resp := &GetRecentTradeHistoryOldResp{} - err := impl.transport.Call(ctx, "spot", false, "Get", "/api/v1/limit/fills", req, resp, false) +func (impl *OrderAPIImpl) AddStopOrder(req *AddStopOrderReq, ctx context.Context) (*AddStopOrderResp, error) { + resp := &AddStopOrderResp{} + err := impl.transport.Call(ctx, "spot", false, "Post", "/api/v1/stop-order", req, resp, false) return resp, err } -func (impl *OrderAPIImpl) GetRecentOrdersListOld(req *GetRecentOrdersListOldReq, ctx context.Context) (*GetRecentOrdersListOldResp, error) { - resp := &GetRecentOrdersListOldResp{} - err := impl.transport.Call(ctx, "spot", false, "Get", "/api/v1/limit/orders", req, resp, false) +func (impl *OrderAPIImpl) CancelStopOrderByClientOid(req *CancelStopOrderByClientOidReq, ctx context.Context) (*CancelStopOrderByClientOidResp, error) { + resp := &CancelStopOrderByClientOidResp{} + err := impl.transport.Call(ctx, "spot", false, "Delete", "/api/v1/stop-order/cancelOrderByClientOid", req, resp, false) return resp, err } -func (impl *OrderAPIImpl) CancelOrderByClientOidOld(req *CancelOrderByClientOidOldReq, ctx context.Context) (*CancelOrderByClientOidOldResp, error) { - resp := &CancelOrderByClientOidOldResp{} - err := impl.transport.Call(ctx, "spot", false, "Delete", "/api/v1/order/client-order/{clientOid}", req, resp, false) +func (impl *OrderAPIImpl) CancelStopOrderByOrderId(req *CancelStopOrderByOrderIdReq, ctx context.Context) (*CancelStopOrderByOrderIdResp, error) { + resp := &CancelStopOrderByOrderIdResp{} + err := impl.transport.Call(ctx, "spot", false, "Delete", "/api/v1/stop-order/{orderId}", req, resp, false) return resp, err } -func (impl *OrderAPIImpl) GetOrderByClientOidOld(req *GetOrderByClientOidOldReq, ctx context.Context) (*GetOrderByClientOidOldResp, error) { - resp := &GetOrderByClientOidOldResp{} - err := impl.transport.Call(ctx, "spot", false, "Get", "/api/v1/order/client-order/{clientOid}", req, resp, false) +func (impl *OrderAPIImpl) BatchCancelStopOrder(req *BatchCancelStopOrderReq, ctx context.Context) (*BatchCancelStopOrderResp, error) { + resp := &BatchCancelStopOrderResp{} + err := impl.transport.Call(ctx, "spot", false, "Delete", "/api/v1/stop-order/cancel", req, resp, false) return resp, err } -func (impl *OrderAPIImpl) BatchCancelOrderOld(req *BatchCancelOrderOldReq, ctx context.Context) (*BatchCancelOrderOldResp, error) { - resp := &BatchCancelOrderOldResp{} - err := impl.transport.Call(ctx, "spot", false, "Delete", "/api/v1/orders", req, resp, false) +func (impl *OrderAPIImpl) GetStopOrdersList(req *GetStopOrdersListReq, ctx context.Context) (*GetStopOrdersListResp, error) { + resp := &GetStopOrdersListResp{} + err := impl.transport.Call(ctx, "spot", false, "Get", "/api/v1/stop-order", req, resp, true) return resp, err } -func (impl *OrderAPIImpl) GetOrdersListOld(req *GetOrdersListOldReq, ctx context.Context) (*GetOrdersListOldResp, error) { - resp := &GetOrdersListOldResp{} - err := impl.transport.Call(ctx, "spot", false, "Get", "/api/v1/orders", req, resp, false) +func (impl *OrderAPIImpl) GetStopOrderByOrderId(req *GetStopOrderByOrderIdReq, ctx context.Context) (*GetStopOrderByOrderIdResp, error) { + resp := &GetStopOrderByOrderIdResp{} + err := impl.transport.Call(ctx, "spot", false, "Get", "/api/v1/stop-order/{orderId}", req, resp, false) return resp, err } -func (impl *OrderAPIImpl) BatchAddOrdersOld(req *BatchAddOrdersOldReq, ctx context.Context) (*BatchAddOrdersOldResp, error) { - resp := &BatchAddOrdersOldResp{} - err := impl.transport.Call(ctx, "spot", false, "Post", "/api/v1/orders/multi", req, resp, false) +func (impl *OrderAPIImpl) GetStopOrderByClientOid(req *GetStopOrderByClientOidReq, ctx context.Context) (*GetStopOrderByClientOidResp, error) { + resp := &GetStopOrderByClientOidResp{} + err := impl.transport.Call(ctx, "spot", false, "Get", "/api/v1/stop-order/queryOrderByClientOid", req, resp, false) return resp, err } -func (impl *OrderAPIImpl) CancelOrderByOrderIdOld(req *CancelOrderByOrderIdOldReq, ctx context.Context) (*CancelOrderByOrderIdOldResp, error) { - resp := &CancelOrderByOrderIdOldResp{} - err := impl.transport.Call(ctx, "spot", false, "Delete", "/api/v1/orders/{orderId}", req, resp, false) +func (impl *OrderAPIImpl) AddOcoOrder(req *AddOcoOrderReq, ctx context.Context) (*AddOcoOrderResp, error) { + resp := &AddOcoOrderResp{} + err := impl.transport.Call(ctx, "spot", false, "Post", "/api/v3/oco/order", req, resp, false) return resp, err } -func (impl *OrderAPIImpl) GetOrderByOrderIdOld(req *GetOrderByOrderIdOldReq, ctx context.Context) (*GetOrderByOrderIdOldResp, error) { - resp := &GetOrderByOrderIdOldResp{} - err := impl.transport.Call(ctx, "spot", false, "Get", "/api/v1/orders/{orderId}", req, resp, false) +func (impl *OrderAPIImpl) CancelOcoOrderByOrderId(req *CancelOcoOrderByOrderIdReq, ctx context.Context) (*CancelOcoOrderByOrderIdResp, error) { + resp := &CancelOcoOrderByOrderIdResp{} + err := impl.transport.Call(ctx, "spot", false, "Delete", "/api/v3/oco/order/{orderId}", req, resp, false) return resp, err } -func (impl *OrderAPIImpl) AddOrderOld(req *AddOrderOldReq, ctx context.Context) (*AddOrderOldResp, error) { - resp := &AddOrderOldResp{} - err := impl.transport.Call(ctx, "spot", false, "Post", "/api/v1/orders", req, resp, false) +func (impl *OrderAPIImpl) CancelOcoOrderByClientOid(req *CancelOcoOrderByClientOidReq, ctx context.Context) (*CancelOcoOrderByClientOidResp, error) { + resp := &CancelOcoOrderByClientOidResp{} + err := impl.transport.Call(ctx, "spot", false, "Delete", "/api/v3/oco/client-order/{clientOid}", req, resp, false) return resp, err } -func (impl *OrderAPIImpl) AddOrderTestOld(req *AddOrderTestOldReq, ctx context.Context) (*AddOrderTestOldResp, error) { - resp := &AddOrderTestOldResp{} - err := impl.transport.Call(ctx, "spot", false, "Post", "/api/v1/orders/test", req, resp, false) +func (impl *OrderAPIImpl) BatchCancelOcoOrders(req *BatchCancelOcoOrdersReq, ctx context.Context) (*BatchCancelOcoOrdersResp, error) { + resp := &BatchCancelOcoOrdersResp{} + err := impl.transport.Call(ctx, "spot", false, "Delete", "/api/v3/oco/orders", req, resp, false) return resp, err } -func (impl *OrderAPIImpl) BatchCancelStopOrder(req *BatchCancelStopOrderReq, ctx context.Context) (*BatchCancelStopOrderResp, error) { - resp := &BatchCancelStopOrderResp{} - err := impl.transport.Call(ctx, "spot", false, "Delete", "/api/v1/stop-order/cancel", req, resp, false) +func (impl *OrderAPIImpl) GetOcoOrderByOrderId(req *GetOcoOrderByOrderIdReq, ctx context.Context) (*GetOcoOrderByOrderIdResp, error) { + resp := &GetOcoOrderByOrderIdResp{} + err := impl.transport.Call(ctx, "spot", false, "Get", "/api/v3/oco/order/{orderId}", req, resp, false) return resp, err } -func (impl *OrderAPIImpl) CancelStopOrderByClientOid(req *CancelStopOrderByClientOidReq, ctx context.Context) (*CancelStopOrderByClientOidResp, error) { - resp := &CancelStopOrderByClientOidResp{} - err := impl.transport.Call(ctx, "spot", false, "Delete", "/api/v1/stop-order/cancelOrderByClientOid", req, resp, false) +func (impl *OrderAPIImpl) GetOcoOrderByClientOid(req *GetOcoOrderByClientOidReq, ctx context.Context) (*GetOcoOrderByClientOidResp, error) { + resp := &GetOcoOrderByClientOidResp{} + err := impl.transport.Call(ctx, "spot", false, "Get", "/api/v3/oco/client-order/{clientOid}", req, resp, false) return resp, err } -func (impl *OrderAPIImpl) GetStopOrdersList(req *GetStopOrdersListReq, ctx context.Context) (*GetStopOrdersListResp, error) { - resp := &GetStopOrdersListResp{} - err := impl.transport.Call(ctx, "spot", false, "Get", "/api/v1/stop-order", req, resp, true) +func (impl *OrderAPIImpl) GetOcoOrderDetailByOrderId(req *GetOcoOrderDetailByOrderIdReq, ctx context.Context) (*GetOcoOrderDetailByOrderIdResp, error) { + resp := &GetOcoOrderDetailByOrderIdResp{} + err := impl.transport.Call(ctx, "spot", false, "Get", "/api/v3/oco/order/details/{orderId}", req, resp, false) return resp, err } -func (impl *OrderAPIImpl) CancelStopOrderByOrderId(req *CancelStopOrderByOrderIdReq, ctx context.Context) (*CancelStopOrderByOrderIdResp, error) { - resp := &CancelStopOrderByOrderIdResp{} - err := impl.transport.Call(ctx, "spot", false, "Delete", "/api/v1/stop-order/{orderId}", req, resp, false) +func (impl *OrderAPIImpl) GetOcoOrderList(req *GetOcoOrderListReq, ctx context.Context) (*GetOcoOrderListResp, error) { + resp := &GetOcoOrderListResp{} + err := impl.transport.Call(ctx, "spot", false, "Get", "/api/v3/oco/orders", req, resp, false) return resp, err } -func (impl *OrderAPIImpl) GetStopOrderByOrderId(req *GetStopOrderByOrderIdReq, ctx context.Context) (*GetStopOrderByOrderIdResp, error) { - resp := &GetStopOrderByOrderIdResp{} - err := impl.transport.Call(ctx, "spot", false, "Get", "/api/v1/stop-order/{orderId}", req, resp, false) +func (impl *OrderAPIImpl) AddOrderOld(req *AddOrderOldReq, ctx context.Context) (*AddOrderOldResp, error) { + resp := &AddOrderOldResp{} + err := impl.transport.Call(ctx, "spot", false, "Post", "/api/v1/orders", req, resp, false) return resp, err } -func (impl *OrderAPIImpl) AddStopOrder(req *AddStopOrderReq, ctx context.Context) (*AddStopOrderResp, error) { - resp := &AddStopOrderResp{} - err := impl.transport.Call(ctx, "spot", false, "Post", "/api/v1/stop-order", req, resp, false) +func (impl *OrderAPIImpl) AddOrderTestOld(req *AddOrderTestOldReq, ctx context.Context) (*AddOrderTestOldResp, error) { + resp := &AddOrderTestOldResp{} + err := impl.transport.Call(ctx, "spot", false, "Post", "/api/v1/orders/test", req, resp, false) return resp, err } -func (impl *OrderAPIImpl) GetStopOrderByClientOid(req *GetStopOrderByClientOidReq, ctx context.Context) (*GetStopOrderByClientOidResp, error) { - resp := &GetStopOrderByClientOidResp{} - err := impl.transport.Call(ctx, "spot", false, "Get", "/api/v1/stop-order/queryOrderByClientOid", req, resp, false) +func (impl *OrderAPIImpl) BatchAddOrdersOld(req *BatchAddOrdersOldReq, ctx context.Context) (*BatchAddOrdersOldResp, error) { + resp := &BatchAddOrdersOldResp{} + err := impl.transport.Call(ctx, "spot", false, "Post", "/api/v1/orders/multi", req, resp, false) return resp, err } -func (impl *OrderAPIImpl) CancelOcoOrderByClientOid(req *CancelOcoOrderByClientOidReq, ctx context.Context) (*CancelOcoOrderByClientOidResp, error) { - resp := &CancelOcoOrderByClientOidResp{} - err := impl.transport.Call(ctx, "spot", false, "Delete", "/api/v3/oco/client-order/{clientOid}", req, resp, false) +func (impl *OrderAPIImpl) CancelOrderByOrderIdOld(req *CancelOrderByOrderIdOldReq, ctx context.Context) (*CancelOrderByOrderIdOldResp, error) { + resp := &CancelOrderByOrderIdOldResp{} + err := impl.transport.Call(ctx, "spot", false, "Delete", "/api/v1/orders/{orderId}", req, resp, false) return resp, err } -func (impl *OrderAPIImpl) GetOcoOrderByClientOid(req *GetOcoOrderByClientOidReq, ctx context.Context) (*GetOcoOrderByClientOidResp, error) { - resp := &GetOcoOrderByClientOidResp{} - err := impl.transport.Call(ctx, "spot", false, "Get", "/api/v3/oco/client-order/{clientOid}", req, resp, false) +func (impl *OrderAPIImpl) CancelOrderByClientOidOld(req *CancelOrderByClientOidOldReq, ctx context.Context) (*CancelOrderByClientOidOldResp, error) { + resp := &CancelOrderByClientOidOldResp{} + err := impl.transport.Call(ctx, "spot", false, "Delete", "/api/v1/order/client-order/{clientOid}", req, resp, false) return resp, err } -func (impl *OrderAPIImpl) GetOcoOrderDetailByOrderId(req *GetOcoOrderDetailByOrderIdReq, ctx context.Context) (*GetOcoOrderDetailByOrderIdResp, error) { - resp := &GetOcoOrderDetailByOrderIdResp{} - err := impl.transport.Call(ctx, "spot", false, "Get", "/api/v3/oco/order/details/{orderId}", req, resp, false) +func (impl *OrderAPIImpl) BatchCancelOrderOld(req *BatchCancelOrderOldReq, ctx context.Context) (*BatchCancelOrderOldResp, error) { + resp := &BatchCancelOrderOldResp{} + err := impl.transport.Call(ctx, "spot", false, "Delete", "/api/v1/orders", req, resp, false) return resp, err } -func (impl *OrderAPIImpl) CancelOcoOrderByOrderId(req *CancelOcoOrderByOrderIdReq, ctx context.Context) (*CancelOcoOrderByOrderIdResp, error) { - resp := &CancelOcoOrderByOrderIdResp{} - err := impl.transport.Call(ctx, "spot", false, "Delete", "/api/v3/oco/order/{orderId}", req, resp, false) +func (impl *OrderAPIImpl) GetOrdersListOld(req *GetOrdersListOldReq, ctx context.Context) (*GetOrdersListOldResp, error) { + resp := &GetOrdersListOldResp{} + err := impl.transport.Call(ctx, "spot", false, "Get", "/api/v1/orders", req, resp, false) return resp, err } -func (impl *OrderAPIImpl) GetOcoOrderByOrderId(req *GetOcoOrderByOrderIdReq, ctx context.Context) (*GetOcoOrderByOrderIdResp, error) { - resp := &GetOcoOrderByOrderIdResp{} - err := impl.transport.Call(ctx, "spot", false, "Get", "/api/v3/oco/order/{orderId}", req, resp, false) +func (impl *OrderAPIImpl) GetRecentOrdersListOld(req *GetRecentOrdersListOldReq, ctx context.Context) (*GetRecentOrdersListOldResp, error) { + resp := &GetRecentOrdersListOldResp{} + err := impl.transport.Call(ctx, "spot", false, "Get", "/api/v1/limit/orders", req, resp, false) return resp, err } -func (impl *OrderAPIImpl) AddOcoOrder(req *AddOcoOrderReq, ctx context.Context) (*AddOcoOrderResp, error) { - resp := &AddOcoOrderResp{} - err := impl.transport.Call(ctx, "spot", false, "Post", "/api/v3/oco/order", req, resp, false) +func (impl *OrderAPIImpl) GetOrderByOrderIdOld(req *GetOrderByOrderIdOldReq, ctx context.Context) (*GetOrderByOrderIdOldResp, error) { + resp := &GetOrderByOrderIdOldResp{} + err := impl.transport.Call(ctx, "spot", false, "Get", "/api/v1/orders/{orderId}", req, resp, false) return resp, err } -func (impl *OrderAPIImpl) BatchCancelOcoOrders(req *BatchCancelOcoOrdersReq, ctx context.Context) (*BatchCancelOcoOrdersResp, error) { - resp := &BatchCancelOcoOrdersResp{} - err := impl.transport.Call(ctx, "spot", false, "Delete", "/api/v3/oco/orders", req, resp, false) +func (impl *OrderAPIImpl) GetOrderByClientOidOld(req *GetOrderByClientOidOldReq, ctx context.Context) (*GetOrderByClientOidOldResp, error) { + resp := &GetOrderByClientOidOldResp{} + err := impl.transport.Call(ctx, "spot", false, "Get", "/api/v1/order/client-order/{clientOid}", req, resp, false) return resp, err } -func (impl *OrderAPIImpl) GetOcoOrderList(req *GetOcoOrderListReq, ctx context.Context) (*GetOcoOrderListResp, error) { - resp := &GetOcoOrderListResp{} - err := impl.transport.Call(ctx, "spot", false, "Get", "/api/v3/oco/orders", req, resp, false) +func (impl *OrderAPIImpl) GetTradeHistoryOld(req *GetTradeHistoryOldReq, ctx context.Context) (*GetTradeHistoryOldResp, error) { + resp := &GetTradeHistoryOldResp{} + err := impl.transport.Call(ctx, "spot", false, "Get", "/api/v1/fills", req, resp, false) + return resp, err +} + +func (impl *OrderAPIImpl) GetRecentTradeHistoryOld(req *GetRecentTradeHistoryOldReq, ctx context.Context) (*GetRecentTradeHistoryOldResp, error) { + resp := &GetRecentTradeHistoryOldResp{} + err := impl.transport.Call(ctx, "spot", false, "Get", "/api/v1/limit/fills", req, resp, false) return resp, err } diff --git a/sdk/golang/pkg/generate/spot/order/api_order.template b/sdk/golang/pkg/generate/spot/order/api_order.template index d6a925c4..dd2f23cb 100644 --- a/sdk/golang/pkg/generate/spot/order/api_order.template +++ b/sdk/golang/pkg/generate/spot/order/api_order.template @@ -1,16 +1,16 @@ # API FUNCTION TEMPLATE -func TestOrderGetTradeHistoryOldReq(t *testing.T) { - // GetTradeHistoryOld - // Get Trade History - Old - // /api/v1/fills +func TestOrderAddOrderReq(t *testing.T) { + // AddOrder + // Add Order + // /api/v1/hf/orders - builder := order.NewGetTradeHistoryOldReqBuilder() - builder.SetSymbol(?).SetOrderId(?).SetSide(?).SetType(?).SetTradeType(?).SetStartAt(?).SetEndAt(?).SetCurrentPage(?).SetPageSize(?) + builder := order.NewAddOrderReqBuilder() + builder.SetClientOid(?).SetSide(?).SetSymbol(?).SetType(?).SetRemark(?).SetStp(?).SetPrice(?).SetSize(?).SetTimeInForce(?).SetPostOnly(?).SetHidden(?).SetIceberg(?).SetVisibleSize(?).SetTags(?).SetCancelAfter(?).SetFunds(?) req := builder.Build() - resp, err := orderApi.GetTradeHistoryOld(req, context.TODO()) + resp, err := orderApi.AddOrder(req, context.TODO()) if err != nil { panic(err) } @@ -24,16 +24,16 @@ func TestOrderGetTradeHistoryOldReq(t *testing.T) { } -func TestOrderGetTradeHistoryReq(t *testing.T) { - // GetTradeHistory - // Get Trade History - // /api/v1/hf/fills +func TestOrderAddOrderSyncReq(t *testing.T) { + // AddOrderSync + // Add Order Sync + // /api/v1/hf/orders/sync - builder := order.NewGetTradeHistoryReqBuilder() - builder.SetSymbol(?).SetOrderId(?).SetSide(?).SetType(?).SetLastId(?).SetLimit(?).SetStartAt(?).SetEndAt(?) + builder := order.NewAddOrderSyncReqBuilder() + builder.SetClientOid(?).SetSide(?).SetSymbol(?).SetType(?).SetRemark(?).SetStp(?).SetPrice(?).SetSize(?).SetTimeInForce(?).SetPostOnly(?).SetHidden(?).SetIceberg(?).SetVisibleSize(?).SetTags(?).SetCancelAfter(?).SetFunds(?) req := builder.Build() - resp, err := orderApi.GetTradeHistory(req, context.TODO()) + resp, err := orderApi.AddOrderSync(req, context.TODO()) if err != nil { panic(err) } @@ -47,16 +47,16 @@ func TestOrderGetTradeHistoryReq(t *testing.T) { } -func TestOrderGetOpenOrdersReq(t *testing.T) { - // GetOpenOrders - // Get Open Orders - // /api/v1/hf/orders/active +func TestOrderAddOrderTestReq(t *testing.T) { + // AddOrderTest + // Add Order Test + // /api/v1/hf/orders/test - builder := order.NewGetOpenOrdersReqBuilder() - builder.SetSymbol(?) + builder := order.NewAddOrderTestReqBuilder() + builder.SetClientOid(?).SetSide(?).SetSymbol(?).SetType(?).SetRemark(?).SetStp(?).SetPrice(?).SetSize(?).SetTimeInForce(?).SetPostOnly(?).SetHidden(?).SetIceberg(?).SetVisibleSize(?).SetTags(?).SetCancelAfter(?).SetFunds(?) req := builder.Build() - resp, err := orderApi.GetOpenOrders(req, context.TODO()) + resp, err := orderApi.AddOrderTest(req, context.TODO()) if err != nil { panic(err) } @@ -70,13 +70,16 @@ func TestOrderGetOpenOrdersReq(t *testing.T) { } -func TestOrderGetSymbolsWithOpenOrderReq(t *testing.T) { - // GetSymbolsWithOpenOrder - // Get Symbols With Open Order - // /api/v1/hf/orders/active/symbols +func TestOrderBatchAddOrdersReq(t *testing.T) { + // BatchAddOrders + // Batch Add Orders + // /api/v1/hf/orders/multi + builder := order.NewBatchAddOrdersReqBuilder() + builder.SetOrderList(?) + req := builder.Build() - resp, err := orderApi.GetSymbolsWithOpenOrder(context.TODO()) + resp, err := orderApi.BatchAddOrders(req, context.TODO()) if err != nil { panic(err) } @@ -90,16 +93,16 @@ func TestOrderGetSymbolsWithOpenOrderReq(t *testing.T) { } -func TestOrderModifyOrderReq(t *testing.T) { - // ModifyOrder - // Modify Order - // /api/v1/hf/orders/alter +func TestOrderBatchAddOrdersSyncReq(t *testing.T) { + // BatchAddOrdersSync + // Batch Add Orders Sync + // /api/v1/hf/orders/multi/sync - builder := order.NewModifyOrderReqBuilder() - builder.SetClientOid(?).SetSymbol(?).SetOrderId(?).SetNewPrice(?).SetNewSize(?) + builder := order.NewBatchAddOrdersSyncReqBuilder() + builder.SetOrderList(?) req := builder.Build() - resp, err := orderApi.ModifyOrder(req, context.TODO()) + resp, err := orderApi.BatchAddOrdersSync(req, context.TODO()) if err != nil { panic(err) } @@ -113,13 +116,16 @@ func TestOrderModifyOrderReq(t *testing.T) { } -func TestOrderCancelAllOrdersReq(t *testing.T) { - // CancelAllOrders - // Cancel All Orders - // /api/v1/hf/orders/cancelAll +func TestOrderCancelOrderByOrderIdReq(t *testing.T) { + // CancelOrderByOrderId + // Cancel Order By OrderId + // /api/v1/hf/orders/{orderId} + builder := order.NewCancelOrderByOrderIdReqBuilder() + builder.SetOrderId(?).SetSymbol(?) + req := builder.Build() - resp, err := orderApi.CancelAllOrders(context.TODO()) + resp, err := orderApi.CancelOrderByOrderId(req, context.TODO()) if err != nil { panic(err) } @@ -133,16 +139,16 @@ func TestOrderCancelAllOrdersReq(t *testing.T) { } -func TestOrderCancelPartialOrderReq(t *testing.T) { - // CancelPartialOrder - // Cancel Partial Order - // /api/v1/hf/orders/cancel/{orderId} +func TestOrderCancelOrderByOrderIdSyncReq(t *testing.T) { + // CancelOrderByOrderIdSync + // Cancel Order By OrderId Sync + // /api/v1/hf/orders/sync/{orderId} - builder := order.NewCancelPartialOrderReqBuilder() - builder.SetOrderId(?).SetSymbol(?).SetCancelSize(?) + builder := order.NewCancelOrderByOrderIdSyncReqBuilder() + builder.SetOrderId(?).SetSymbol(?) req := builder.Build() - resp, err := orderApi.CancelPartialOrder(req, context.TODO()) + resp, err := orderApi.CancelOrderByOrderIdSync(req, context.TODO()) if err != nil { panic(err) } @@ -179,16 +185,16 @@ func TestOrderCancelOrderByClientOidReq(t *testing.T) { } -func TestOrderGetOrderByClientOidReq(t *testing.T) { - // GetOrderByClientOid - // Get Order By ClientOid - // /api/v1/hf/orders/client-order/{clientOid} +func TestOrderCancelOrderByClientOidSyncReq(t *testing.T) { + // CancelOrderByClientOidSync + // Cancel Order By ClientOid Sync + // /api/v1/hf/orders/sync/client-order/{clientOid} - builder := order.NewGetOrderByClientOidReqBuilder() - builder.SetSymbol(?).SetClientOid(?) + builder := order.NewCancelOrderByClientOidSyncReqBuilder() + builder.SetClientOid(?).SetSymbol(?) req := builder.Build() - resp, err := orderApi.GetOrderByClientOid(req, context.TODO()) + resp, err := orderApi.CancelOrderByClientOidSync(req, context.TODO()) if err != nil { panic(err) } @@ -202,36 +208,16 @@ func TestOrderGetOrderByClientOidReq(t *testing.T) { } -func TestOrderSetDCPReq(t *testing.T) { - // SetDCP - // Set DCP - // /api/v1/hf/orders/dead-cancel-all +func TestOrderCancelPartialOrderReq(t *testing.T) { + // CancelPartialOrder + // Cancel Partial Order + // /api/v1/hf/orders/cancel/{orderId} - builder := order.NewSetDCPReqBuilder() - builder.SetTimeout(?).SetSymbols(?) + builder := order.NewCancelPartialOrderReqBuilder() + builder.SetOrderId(?).SetSymbol(?).SetCancelSize(?) req := builder.Build() - resp, err := orderApi.SetDCP(req, context.TODO()) - if err != nil { - panic(err) - } - data, err := json.Marshal(resp.ToMap()) - if err != nil { - panic(err) - } - fmt.Println("code:", resp.CommonResponse.Code) - fmt.Println("message:", resp.CommonResponse.Message) - fmt.Println("data:", string(data)) -} - - -func TestOrderGetDCPReq(t *testing.T) { - // GetDCP - // Get DCP - // /api/v1/hf/orders/dead-cancel-all/query - - - resp, err := orderApi.GetDCP(context.TODO()) + resp, err := orderApi.CancelPartialOrder(req, context.TODO()) if err != nil { panic(err) } @@ -268,16 +254,13 @@ func TestOrderCancelAllOrdersBySymbolReq(t *testing.T) { } -func TestOrderGetClosedOrdersReq(t *testing.T) { - // GetClosedOrders - // Get Closed Orders - // /api/v1/hf/orders/done +func TestOrderCancelAllOrdersReq(t *testing.T) { + // CancelAllOrders + // Cancel All Orders + // /api/v1/hf/orders/cancelAll - builder := order.NewGetClosedOrdersReqBuilder() - builder.SetSymbol(?).SetSide(?).SetType(?).SetLastId(?).SetLimit(?).SetStartAt(?).SetEndAt(?) - req := builder.Build() - resp, err := orderApi.GetClosedOrders(req, context.TODO()) + resp, err := orderApi.CancelAllOrders(context.TODO()) if err != nil { panic(err) } @@ -291,16 +274,16 @@ func TestOrderGetClosedOrdersReq(t *testing.T) { } -func TestOrderBatchAddOrdersReq(t *testing.T) { - // BatchAddOrders - // Batch Add Orders - // /api/v1/hf/orders/multi +func TestOrderModifyOrderReq(t *testing.T) { + // ModifyOrder + // Modify Order + // /api/v1/hf/orders/alter - builder := order.NewBatchAddOrdersReqBuilder() - builder.SetOrderList(?) + builder := order.NewModifyOrderReqBuilder() + builder.SetClientOid(?).SetSymbol(?).SetOrderId(?).SetNewPrice(?).SetNewSize(?) req := builder.Build() - resp, err := orderApi.BatchAddOrders(req, context.TODO()) + resp, err := orderApi.ModifyOrder(req, context.TODO()) if err != nil { panic(err) } @@ -314,16 +297,16 @@ func TestOrderBatchAddOrdersReq(t *testing.T) { } -func TestOrderBatchAddOrdersSyncReq(t *testing.T) { - // BatchAddOrdersSync - // Batch Add Orders Sync - // /api/v1/hf/orders/multi/sync +func TestOrderGetOrderByOrderIdReq(t *testing.T) { + // GetOrderByOrderId + // Get Order By OrderId + // /api/v1/hf/orders/{orderId} - builder := order.NewBatchAddOrdersSyncReqBuilder() - builder.SetOrderList(?) + builder := order.NewGetOrderByOrderIdReqBuilder() + builder.SetSymbol(?).SetOrderId(?) req := builder.Build() - resp, err := orderApi.BatchAddOrdersSync(req, context.TODO()) + resp, err := orderApi.GetOrderByOrderId(req, context.TODO()) if err != nil { panic(err) } @@ -337,16 +320,16 @@ func TestOrderBatchAddOrdersSyncReq(t *testing.T) { } -func TestOrderCancelOrderByOrderIdReq(t *testing.T) { - // CancelOrderByOrderId - // Cancel Order By OrderId - // /api/v1/hf/orders/{orderId} +func TestOrderGetOrderByClientOidReq(t *testing.T) { + // GetOrderByClientOid + // Get Order By ClientOid + // /api/v1/hf/orders/client-order/{clientOid} - builder := order.NewCancelOrderByOrderIdReqBuilder() - builder.SetOrderId(?).SetSymbol(?) + builder := order.NewGetOrderByClientOidReqBuilder() + builder.SetSymbol(?).SetClientOid(?) req := builder.Build() - resp, err := orderApi.CancelOrderByOrderId(req, context.TODO()) + resp, err := orderApi.GetOrderByClientOid(req, context.TODO()) if err != nil { panic(err) } @@ -360,16 +343,13 @@ func TestOrderCancelOrderByOrderIdReq(t *testing.T) { } -func TestOrderGetOrderByOrderIdReq(t *testing.T) { - // GetOrderByOrderId - // Get Order By OrderId - // /api/v1/hf/orders/{orderId} +func TestOrderGetSymbolsWithOpenOrderReq(t *testing.T) { + // GetSymbolsWithOpenOrder + // Get Symbols With Open Order + // /api/v1/hf/orders/active/symbols - builder := order.NewGetOrderByOrderIdReqBuilder() - builder.SetSymbol(?).SetOrderId(?) - req := builder.Build() - resp, err := orderApi.GetOrderByOrderId(req, context.TODO()) + resp, err := orderApi.GetSymbolsWithOpenOrder(context.TODO()) if err != nil { panic(err) } @@ -383,16 +363,16 @@ func TestOrderGetOrderByOrderIdReq(t *testing.T) { } -func TestOrderAddOrderReq(t *testing.T) { - // AddOrder - // Add Order - // /api/v1/hf/orders +func TestOrderGetOpenOrdersReq(t *testing.T) { + // GetOpenOrders + // Get Open Orders + // /api/v1/hf/orders/active - builder := order.NewAddOrderReqBuilder() - builder.SetClientOid(?).SetSide(?).SetSymbol(?).SetType(?).SetRemark(?).SetStp(?).SetPrice(?).SetSize(?).SetTimeInForce(?).SetPostOnly(?).SetHidden(?).SetIceberg(?).SetVisibleSize(?).SetTags(?).SetCancelAfter(?).SetFunds(?) + builder := order.NewGetOpenOrdersReqBuilder() + builder.SetSymbol(?) req := builder.Build() - resp, err := orderApi.AddOrder(req, context.TODO()) + resp, err := orderApi.GetOpenOrders(req, context.TODO()) if err != nil { panic(err) } @@ -406,16 +386,16 @@ func TestOrderAddOrderReq(t *testing.T) { } -func TestOrderCancelOrderByClientOidSyncReq(t *testing.T) { - // CancelOrderByClientOidSync - // Cancel Order By ClientOid Sync - // /api/v1/hf/orders/sync/client-order/{clientOid} +func TestOrderGetClosedOrdersReq(t *testing.T) { + // GetClosedOrders + // Get Closed Orders + // /api/v1/hf/orders/done - builder := order.NewCancelOrderByClientOidSyncReqBuilder() - builder.SetClientOid(?).SetSymbol(?) + builder := order.NewGetClosedOrdersReqBuilder() + builder.SetSymbol(?).SetSide(?).SetType(?).SetLastId(?).SetLimit(?).SetStartAt(?).SetEndAt(?) req := builder.Build() - resp, err := orderApi.CancelOrderByClientOidSync(req, context.TODO()) + resp, err := orderApi.GetClosedOrders(req, context.TODO()) if err != nil { panic(err) } @@ -429,16 +409,16 @@ func TestOrderCancelOrderByClientOidSyncReq(t *testing.T) { } -func TestOrderCancelOrderByOrderIdSyncReq(t *testing.T) { - // CancelOrderByOrderIdSync - // Cancel Order By OrderId Sync - // /api/v1/hf/orders/sync/{orderId} +func TestOrderGetTradeHistoryReq(t *testing.T) { + // GetTradeHistory + // Get Trade History + // /api/v1/hf/fills - builder := order.NewCancelOrderByOrderIdSyncReqBuilder() - builder.SetOrderId(?).SetSymbol(?) + builder := order.NewGetTradeHistoryReqBuilder() + builder.SetSymbol(?).SetOrderId(?).SetSide(?).SetType(?).SetLastId(?).SetLimit(?).SetStartAt(?).SetEndAt(?) req := builder.Build() - resp, err := orderApi.CancelOrderByOrderIdSync(req, context.TODO()) + resp, err := orderApi.GetTradeHistory(req, context.TODO()) if err != nil { panic(err) } @@ -452,16 +432,13 @@ func TestOrderCancelOrderByOrderIdSyncReq(t *testing.T) { } -func TestOrderAddOrderSyncReq(t *testing.T) { - // AddOrderSync - // Add Order Sync - // /api/v1/hf/orders/sync +func TestOrderGetDCPReq(t *testing.T) { + // GetDCP + // Get DCP + // /api/v1/hf/orders/dead-cancel-all/query - builder := order.NewAddOrderSyncReqBuilder() - builder.SetClientOid(?).SetSide(?).SetSymbol(?).SetType(?).SetRemark(?).SetStp(?).SetPrice(?).SetSize(?).SetTimeInForce(?).SetPostOnly(?).SetHidden(?).SetIceberg(?).SetVisibleSize(?).SetTags(?).SetCancelAfter(?).SetFunds(?) - req := builder.Build() - resp, err := orderApi.AddOrderSync(req, context.TODO()) + resp, err := orderApi.GetDCP(context.TODO()) if err != nil { panic(err) } @@ -475,16 +452,16 @@ func TestOrderAddOrderSyncReq(t *testing.T) { } -func TestOrderAddOrderTestReq(t *testing.T) { - // AddOrderTest - // Add Order Test - // /api/v1/hf/orders/test +func TestOrderSetDCPReq(t *testing.T) { + // SetDCP + // Set DCP + // /api/v1/hf/orders/dead-cancel-all - builder := order.NewAddOrderTestReqBuilder() - builder.SetClientOid(?).SetSide(?).SetSymbol(?).SetType(?).SetRemark(?).SetStp(?).SetPrice(?).SetSize(?).SetTimeInForce(?).SetPostOnly(?).SetHidden(?).SetIceberg(?).SetVisibleSize(?).SetTags(?).SetCancelAfter(?).SetFunds(?) + builder := order.NewSetDCPReqBuilder() + builder.SetTimeout(?).SetSymbols(?) req := builder.Build() - resp, err := orderApi.AddOrderTest(req, context.TODO()) + resp, err := orderApi.SetDCP(req, context.TODO()) if err != nil { panic(err) } @@ -498,16 +475,16 @@ func TestOrderAddOrderTestReq(t *testing.T) { } -func TestOrderGetRecentTradeHistoryOldReq(t *testing.T) { - // GetRecentTradeHistoryOld - // Get Recent Trade History - Old - // /api/v1/limit/fills +func TestOrderAddStopOrderReq(t *testing.T) { + // AddStopOrder + // Add Stop Order + // /api/v1/stop-order - builder := order.NewGetRecentTradeHistoryOldReqBuilder() - builder.SetCurrentPage(?).SetPageSize(?) + builder := order.NewAddStopOrderReqBuilder() + builder.SetClientOid(?).SetSide(?).SetSymbol(?).SetType(?).SetRemark(?).SetStp(?).SetPrice(?).SetSize(?).SetTimeInForce(?).SetPostOnly(?).SetHidden(?).SetIceberg(?).SetVisibleSize(?).SetCancelAfter(?).SetFunds(?).SetStopPrice(?).SetTradeType(?) req := builder.Build() - resp, err := orderApi.GetRecentTradeHistoryOld(req, context.TODO()) + resp, err := orderApi.AddStopOrder(req, context.TODO()) if err != nil { panic(err) } @@ -521,16 +498,16 @@ func TestOrderGetRecentTradeHistoryOldReq(t *testing.T) { } -func TestOrderGetRecentOrdersListOldReq(t *testing.T) { - // GetRecentOrdersListOld - // Get Recent Orders List - Old - // /api/v1/limit/orders +func TestOrderCancelStopOrderByClientOidReq(t *testing.T) { + // CancelStopOrderByClientOid + // Cancel Stop Order By ClientOid + // /api/v1/stop-order/cancelOrderByClientOid - builder := order.NewGetRecentOrdersListOldReqBuilder() - builder.SetCurrentPage(?).SetPageSize(?) + builder := order.NewCancelStopOrderByClientOidReqBuilder() + builder.SetSymbol(?).SetClientOid(?) req := builder.Build() - resp, err := orderApi.GetRecentOrdersListOld(req, context.TODO()) + resp, err := orderApi.CancelStopOrderByClientOid(req, context.TODO()) if err != nil { panic(err) } @@ -544,16 +521,16 @@ func TestOrderGetRecentOrdersListOldReq(t *testing.T) { } -func TestOrderCancelOrderByClientOidOldReq(t *testing.T) { - // CancelOrderByClientOidOld - // Cancel Order By ClientOid - Old - // /api/v1/order/client-order/{clientOid} +func TestOrderCancelStopOrderByOrderIdReq(t *testing.T) { + // CancelStopOrderByOrderId + // Cancel Stop Order By OrderId + // /api/v1/stop-order/{orderId} - builder := order.NewCancelOrderByClientOidOldReqBuilder() - builder.SetSymbol(?).SetClientOid(?) + builder := order.NewCancelStopOrderByOrderIdReqBuilder() + builder.SetOrderId(?) req := builder.Build() - resp, err := orderApi.CancelOrderByClientOidOld(req, context.TODO()) + resp, err := orderApi.CancelStopOrderByOrderId(req, context.TODO()) if err != nil { panic(err) } @@ -567,16 +544,16 @@ func TestOrderCancelOrderByClientOidOldReq(t *testing.T) { } -func TestOrderGetOrderByClientOidOldReq(t *testing.T) { - // GetOrderByClientOidOld - // Get Order By ClientOid - Old - // /api/v1/order/client-order/{clientOid} +func TestOrderBatchCancelStopOrderReq(t *testing.T) { + // BatchCancelStopOrder + // Batch Cancel Stop Orders + // /api/v1/stop-order/cancel - builder := order.NewGetOrderByClientOidOldReqBuilder() - builder.SetClientOid(?) + builder := order.NewBatchCancelStopOrderReqBuilder() + builder.SetSymbol(?).SetTradeType(?).SetOrderIds(?) req := builder.Build() - resp, err := orderApi.GetOrderByClientOidOld(req, context.TODO()) + resp, err := orderApi.BatchCancelStopOrder(req, context.TODO()) if err != nil { panic(err) } @@ -590,16 +567,16 @@ func TestOrderGetOrderByClientOidOldReq(t *testing.T) { } -func TestOrderBatchCancelOrderOldReq(t *testing.T) { - // BatchCancelOrderOld - // Batch Cancel Order - Old - // /api/v1/orders +func TestOrderGetStopOrdersListReq(t *testing.T) { + // GetStopOrdersList + // Get Stop Orders List + // /api/v1/stop-order - builder := order.NewBatchCancelOrderOldReqBuilder() - builder.SetSymbol(?).SetTradeType(?) + builder := order.NewGetStopOrdersListReqBuilder() + builder.SetSymbol(?).SetSide(?).SetType(?).SetTradeType(?).SetStartAt(?).SetEndAt(?).SetCurrentPage(?).SetOrderIds(?).SetPageSize(?).SetStop(?) req := builder.Build() - resp, err := orderApi.BatchCancelOrderOld(req, context.TODO()) + resp, err := orderApi.GetStopOrdersList(req, context.TODO()) if err != nil { panic(err) } @@ -613,16 +590,16 @@ func TestOrderBatchCancelOrderOldReq(t *testing.T) { } -func TestOrderGetOrdersListOldReq(t *testing.T) { - // GetOrdersListOld - // Get Orders List - Old - // /api/v1/orders +func TestOrderGetStopOrderByOrderIdReq(t *testing.T) { + // GetStopOrderByOrderId + // Get Stop Order By OrderId + // /api/v1/stop-order/{orderId} - builder := order.NewGetOrdersListOldReqBuilder() - builder.SetSymbol(?).SetStatus(?).SetSide(?).SetType(?).SetTradeType(?).SetStartAt(?).SetEndAt(?).SetCurrentPage(?).SetPageSize(?) + builder := order.NewGetStopOrderByOrderIdReqBuilder() + builder.SetOrderId(?) req := builder.Build() - resp, err := orderApi.GetOrdersListOld(req, context.TODO()) + resp, err := orderApi.GetStopOrderByOrderId(req, context.TODO()) if err != nil { panic(err) } @@ -636,16 +613,16 @@ func TestOrderGetOrdersListOldReq(t *testing.T) { } -func TestOrderBatchAddOrdersOldReq(t *testing.T) { - // BatchAddOrdersOld - // Batch Add Orders - Old - // /api/v1/orders/multi +func TestOrderGetStopOrderByClientOidReq(t *testing.T) { + // GetStopOrderByClientOid + // Get Stop Order By ClientOid + // /api/v1/stop-order/queryOrderByClientOid - builder := order.NewBatchAddOrdersOldReqBuilder() - builder.SetOrderList(?).SetSymbol(?) + builder := order.NewGetStopOrderByClientOidReqBuilder() + builder.SetClientOid(?).SetSymbol(?) req := builder.Build() - resp, err := orderApi.BatchAddOrdersOld(req, context.TODO()) + resp, err := orderApi.GetStopOrderByClientOid(req, context.TODO()) if err != nil { panic(err) } @@ -659,16 +636,16 @@ func TestOrderBatchAddOrdersOldReq(t *testing.T) { } -func TestOrderCancelOrderByOrderIdOldReq(t *testing.T) { - // CancelOrderByOrderIdOld - // Cancel Order By OrderId - Old - // /api/v1/orders/{orderId} +func TestOrderAddOcoOrderReq(t *testing.T) { + // AddOcoOrder + // Add OCO Order + // /api/v3/oco/order - builder := order.NewCancelOrderByOrderIdOldReqBuilder() - builder.SetSymbol(?).SetOrderId(?) + builder := order.NewAddOcoOrderReqBuilder() + builder.SetClientOid(?).SetSide(?).SetSymbol(?).SetRemark(?).SetPrice(?).SetSize(?).SetStopPrice(?).SetLimitPrice(?).SetTradeType(?) req := builder.Build() - resp, err := orderApi.CancelOrderByOrderIdOld(req, context.TODO()) + resp, err := orderApi.AddOcoOrder(req, context.TODO()) if err != nil { panic(err) } @@ -682,16 +659,16 @@ func TestOrderCancelOrderByOrderIdOldReq(t *testing.T) { } -func TestOrderGetOrderByOrderIdOldReq(t *testing.T) { - // GetOrderByOrderIdOld - // Get Order By OrderId - Old - // /api/v1/orders/{orderId} +func TestOrderCancelOcoOrderByOrderIdReq(t *testing.T) { + // CancelOcoOrderByOrderId + // Cancel OCO Order By OrderId + // /api/v3/oco/order/{orderId} - builder := order.NewGetOrderByOrderIdOldReqBuilder() + builder := order.NewCancelOcoOrderByOrderIdReqBuilder() builder.SetOrderId(?) req := builder.Build() - resp, err := orderApi.GetOrderByOrderIdOld(req, context.TODO()) + resp, err := orderApi.CancelOcoOrderByOrderId(req, context.TODO()) if err != nil { panic(err) } @@ -705,16 +682,16 @@ func TestOrderGetOrderByOrderIdOldReq(t *testing.T) { } -func TestOrderAddOrderOldReq(t *testing.T) { - // AddOrderOld - // Add Order - Old - // /api/v1/orders +func TestOrderCancelOcoOrderByClientOidReq(t *testing.T) { + // CancelOcoOrderByClientOid + // Cancel OCO Order By ClientOid + // /api/v3/oco/client-order/{clientOid} - builder := order.NewAddOrderOldReqBuilder() - builder.SetClientOid(?).SetSide(?).SetSymbol(?).SetType(?).SetRemark(?).SetStp(?).SetPrice(?).SetSize(?).SetTimeInForce(?).SetPostOnly(?).SetHidden(?).SetIceberg(?).SetVisibleSize(?).SetCancelAfter(?).SetFunds(?).SetTradeType(?) + builder := order.NewCancelOcoOrderByClientOidReqBuilder() + builder.SetClientOid(?) req := builder.Build() - resp, err := orderApi.AddOrderOld(req, context.TODO()) + resp, err := orderApi.CancelOcoOrderByClientOid(req, context.TODO()) if err != nil { panic(err) } @@ -728,16 +705,16 @@ func TestOrderAddOrderOldReq(t *testing.T) { } -func TestOrderAddOrderTestOldReq(t *testing.T) { - // AddOrderTestOld - // Add Order Test - Old - // /api/v1/orders/test +func TestOrderBatchCancelOcoOrdersReq(t *testing.T) { + // BatchCancelOcoOrders + // Batch Cancel OCO Order + // /api/v3/oco/orders - builder := order.NewAddOrderTestOldReqBuilder() - builder.SetClientOid(?).SetSide(?).SetSymbol(?).SetType(?).SetRemark(?).SetStp(?).SetPrice(?).SetSize(?).SetTimeInForce(?).SetPostOnly(?).SetHidden(?).SetIceberg(?).SetVisibleSize(?).SetCancelAfter(?).SetFunds(?).SetTradeType(?) + builder := order.NewBatchCancelOcoOrdersReqBuilder() + builder.SetOrderIds(?).SetSymbol(?) req := builder.Build() - resp, err := orderApi.AddOrderTestOld(req, context.TODO()) + resp, err := orderApi.BatchCancelOcoOrders(req, context.TODO()) if err != nil { panic(err) } @@ -751,16 +728,16 @@ func TestOrderAddOrderTestOldReq(t *testing.T) { } -func TestOrderBatchCancelStopOrderReq(t *testing.T) { - // BatchCancelStopOrder - // Batch Cancel Stop Orders - // /api/v1/stop-order/cancel +func TestOrderGetOcoOrderByOrderIdReq(t *testing.T) { + // GetOcoOrderByOrderId + // Get OCO Order By OrderId + // /api/v3/oco/order/{orderId} - builder := order.NewBatchCancelStopOrderReqBuilder() - builder.SetSymbol(?).SetTradeType(?).SetOrderIds(?) + builder := order.NewGetOcoOrderByOrderIdReqBuilder() + builder.SetOrderId(?) req := builder.Build() - resp, err := orderApi.BatchCancelStopOrder(req, context.TODO()) + resp, err := orderApi.GetOcoOrderByOrderId(req, context.TODO()) if err != nil { panic(err) } @@ -774,16 +751,16 @@ func TestOrderBatchCancelStopOrderReq(t *testing.T) { } -func TestOrderCancelStopOrderByClientOidReq(t *testing.T) { - // CancelStopOrderByClientOid - // Cancel Stop Order By ClientOid - // /api/v1/stop-order/cancelOrderByClientOid +func TestOrderGetOcoOrderByClientOidReq(t *testing.T) { + // GetOcoOrderByClientOid + // Get OCO Order By ClientOid + // /api/v3/oco/client-order/{clientOid} - builder := order.NewCancelStopOrderByClientOidReqBuilder() - builder.SetSymbol(?).SetClientOid(?) + builder := order.NewGetOcoOrderByClientOidReqBuilder() + builder.SetClientOid(?) req := builder.Build() - resp, err := orderApi.CancelStopOrderByClientOid(req, context.TODO()) + resp, err := orderApi.GetOcoOrderByClientOid(req, context.TODO()) if err != nil { panic(err) } @@ -797,16 +774,16 @@ func TestOrderCancelStopOrderByClientOidReq(t *testing.T) { } -func TestOrderGetStopOrdersListReq(t *testing.T) { - // GetStopOrdersList - // Get Stop Orders List - // /api/v1/stop-order +func TestOrderGetOcoOrderDetailByOrderIdReq(t *testing.T) { + // GetOcoOrderDetailByOrderId + // Get OCO Order Detail By OrderId + // /api/v3/oco/order/details/{orderId} - builder := order.NewGetStopOrdersListReqBuilder() - builder.SetSymbol(?).SetSide(?).SetType(?).SetTradeType(?).SetStartAt(?).SetEndAt(?).SetCurrentPage(?).SetOrderIds(?).SetPageSize(?).SetStop(?) + builder := order.NewGetOcoOrderDetailByOrderIdReqBuilder() + builder.SetOrderId(?) req := builder.Build() - resp, err := orderApi.GetStopOrdersList(req, context.TODO()) + resp, err := orderApi.GetOcoOrderDetailByOrderId(req, context.TODO()) if err != nil { panic(err) } @@ -820,16 +797,16 @@ func TestOrderGetStopOrdersListReq(t *testing.T) { } -func TestOrderCancelStopOrderByOrderIdReq(t *testing.T) { - // CancelStopOrderByOrderId - // Cancel Stop Order By OrderId - // /api/v1/stop-order/{orderId} +func TestOrderGetOcoOrderListReq(t *testing.T) { + // GetOcoOrderList + // Get OCO Order List + // /api/v3/oco/orders - builder := order.NewCancelStopOrderByOrderIdReqBuilder() - builder.SetOrderId(?) + builder := order.NewGetOcoOrderListReqBuilder() + builder.SetSymbol(?).SetStartAt(?).SetEndAt(?).SetOrderIds(?).SetPageSize(?).SetCurrentPage(?) req := builder.Build() - resp, err := orderApi.CancelStopOrderByOrderId(req, context.TODO()) + resp, err := orderApi.GetOcoOrderList(req, context.TODO()) if err != nil { panic(err) } @@ -843,16 +820,16 @@ func TestOrderCancelStopOrderByOrderIdReq(t *testing.T) { } -func TestOrderGetStopOrderByOrderIdReq(t *testing.T) { - // GetStopOrderByOrderId - // Get Stop Order By OrderId - // /api/v1/stop-order/{orderId} +func TestOrderAddOrderOldReq(t *testing.T) { + // AddOrderOld + // Add Order - Old + // /api/v1/orders - builder := order.NewGetStopOrderByOrderIdReqBuilder() - builder.SetOrderId(?) + builder := order.NewAddOrderOldReqBuilder() + builder.SetClientOid(?).SetSide(?).SetSymbol(?).SetType(?).SetRemark(?).SetStp(?).SetPrice(?).SetSize(?).SetTimeInForce(?).SetPostOnly(?).SetHidden(?).SetIceberg(?).SetVisibleSize(?).SetCancelAfter(?).SetFunds(?).SetTradeType(?) req := builder.Build() - resp, err := orderApi.GetStopOrderByOrderId(req, context.TODO()) + resp, err := orderApi.AddOrderOld(req, context.TODO()) if err != nil { panic(err) } @@ -866,16 +843,16 @@ func TestOrderGetStopOrderByOrderIdReq(t *testing.T) { } -func TestOrderAddStopOrderReq(t *testing.T) { - // AddStopOrder - // Add Stop Order - // /api/v1/stop-order +func TestOrderAddOrderTestOldReq(t *testing.T) { + // AddOrderTestOld + // Add Order Test - Old + // /api/v1/orders/test - builder := order.NewAddStopOrderReqBuilder() - builder.SetClientOid(?).SetSide(?).SetSymbol(?).SetType(?).SetRemark(?).SetStp(?).SetPrice(?).SetSize(?).SetTimeInForce(?).SetPostOnly(?).SetHidden(?).SetIceberg(?).SetVisibleSize(?).SetCancelAfter(?).SetFunds(?).SetStopPrice(?).SetTradeType(?) + builder := order.NewAddOrderTestOldReqBuilder() + builder.SetClientOid(?).SetSide(?).SetSymbol(?).SetType(?).SetRemark(?).SetStp(?).SetPrice(?).SetSize(?).SetTimeInForce(?).SetPostOnly(?).SetHidden(?).SetIceberg(?).SetVisibleSize(?).SetCancelAfter(?).SetFunds(?).SetTradeType(?) req := builder.Build() - resp, err := orderApi.AddStopOrder(req, context.TODO()) + resp, err := orderApi.AddOrderTestOld(req, context.TODO()) if err != nil { panic(err) } @@ -889,16 +866,16 @@ func TestOrderAddStopOrderReq(t *testing.T) { } -func TestOrderGetStopOrderByClientOidReq(t *testing.T) { - // GetStopOrderByClientOid - // Get Stop Order By ClientOid - // /api/v1/stop-order/queryOrderByClientOid +func TestOrderBatchAddOrdersOldReq(t *testing.T) { + // BatchAddOrdersOld + // Batch Add Orders - Old + // /api/v1/orders/multi - builder := order.NewGetStopOrderByClientOidReqBuilder() - builder.SetClientOid(?).SetSymbol(?) + builder := order.NewBatchAddOrdersOldReqBuilder() + builder.SetOrderList(?).SetSymbol(?) req := builder.Build() - resp, err := orderApi.GetStopOrderByClientOid(req, context.TODO()) + resp, err := orderApi.BatchAddOrdersOld(req, context.TODO()) if err != nil { panic(err) } @@ -912,16 +889,16 @@ func TestOrderGetStopOrderByClientOidReq(t *testing.T) { } -func TestOrderCancelOcoOrderByClientOidReq(t *testing.T) { - // CancelOcoOrderByClientOid - // Cancel OCO Order By ClientOid - // /api/v3/oco/client-order/{clientOid} +func TestOrderCancelOrderByOrderIdOldReq(t *testing.T) { + // CancelOrderByOrderIdOld + // Cancel Order By OrderId - Old + // /api/v1/orders/{orderId} - builder := order.NewCancelOcoOrderByClientOidReqBuilder() - builder.SetClientOid(?) + builder := order.NewCancelOrderByOrderIdOldReqBuilder() + builder.SetSymbol(?).SetOrderId(?) req := builder.Build() - resp, err := orderApi.CancelOcoOrderByClientOid(req, context.TODO()) + resp, err := orderApi.CancelOrderByOrderIdOld(req, context.TODO()) if err != nil { panic(err) } @@ -935,16 +912,16 @@ func TestOrderCancelOcoOrderByClientOidReq(t *testing.T) { } -func TestOrderGetOcoOrderByClientOidReq(t *testing.T) { - // GetOcoOrderByClientOid - // Get OCO Order By ClientOid - // /api/v3/oco/client-order/{clientOid} +func TestOrderCancelOrderByClientOidOldReq(t *testing.T) { + // CancelOrderByClientOidOld + // Cancel Order By ClientOid - Old + // /api/v1/order/client-order/{clientOid} - builder := order.NewGetOcoOrderByClientOidReqBuilder() - builder.SetClientOid(?) + builder := order.NewCancelOrderByClientOidOldReqBuilder() + builder.SetSymbol(?).SetClientOid(?) req := builder.Build() - resp, err := orderApi.GetOcoOrderByClientOid(req, context.TODO()) + resp, err := orderApi.CancelOrderByClientOidOld(req, context.TODO()) if err != nil { panic(err) } @@ -958,16 +935,16 @@ func TestOrderGetOcoOrderByClientOidReq(t *testing.T) { } -func TestOrderGetOcoOrderDetailByOrderIdReq(t *testing.T) { - // GetOcoOrderDetailByOrderId - // Get OCO Order Detail By OrderId - // /api/v3/oco/order/details/{orderId} +func TestOrderBatchCancelOrderOldReq(t *testing.T) { + // BatchCancelOrderOld + // Batch Cancel Order - Old + // /api/v1/orders - builder := order.NewGetOcoOrderDetailByOrderIdReqBuilder() - builder.SetOrderId(?) + builder := order.NewBatchCancelOrderOldReqBuilder() + builder.SetSymbol(?).SetTradeType(?) req := builder.Build() - resp, err := orderApi.GetOcoOrderDetailByOrderId(req, context.TODO()) + resp, err := orderApi.BatchCancelOrderOld(req, context.TODO()) if err != nil { panic(err) } @@ -981,16 +958,16 @@ func TestOrderGetOcoOrderDetailByOrderIdReq(t *testing.T) { } -func TestOrderCancelOcoOrderByOrderIdReq(t *testing.T) { - // CancelOcoOrderByOrderId - // Cancel OCO Order By OrderId - // /api/v3/oco/order/{orderId} +func TestOrderGetOrdersListOldReq(t *testing.T) { + // GetOrdersListOld + // Get Orders List - Old + // /api/v1/orders - builder := order.NewCancelOcoOrderByOrderIdReqBuilder() - builder.SetOrderId(?) + builder := order.NewGetOrdersListOldReqBuilder() + builder.SetSymbol(?).SetStatus(?).SetSide(?).SetType(?).SetTradeType(?).SetStartAt(?).SetEndAt(?).SetCurrentPage(?).SetPageSize(?) req := builder.Build() - resp, err := orderApi.CancelOcoOrderByOrderId(req, context.TODO()) + resp, err := orderApi.GetOrdersListOld(req, context.TODO()) if err != nil { panic(err) } @@ -1004,16 +981,39 @@ func TestOrderCancelOcoOrderByOrderIdReq(t *testing.T) { } -func TestOrderGetOcoOrderByOrderIdReq(t *testing.T) { - // GetOcoOrderByOrderId - // Get OCO Order By OrderId - // /api/v3/oco/order/{orderId} +func TestOrderGetRecentOrdersListOldReq(t *testing.T) { + // GetRecentOrdersListOld + // Get Recent Orders List - Old + // /api/v1/limit/orders - builder := order.NewGetOcoOrderByOrderIdReqBuilder() + builder := order.NewGetRecentOrdersListOldReqBuilder() + builder.SetCurrentPage(?).SetPageSize(?) + req := builder.Build() + + resp, err := orderApi.GetRecentOrdersListOld(req, context.TODO()) + if err != nil { + panic(err) + } + data, err := json.Marshal(resp.ToMap()) + if err != nil { + panic(err) + } + fmt.Println("code:", resp.CommonResponse.Code) + fmt.Println("message:", resp.CommonResponse.Message) + fmt.Println("data:", string(data)) +} + + +func TestOrderGetOrderByOrderIdOldReq(t *testing.T) { + // GetOrderByOrderIdOld + // Get Order By OrderId - Old + // /api/v1/orders/{orderId} + + builder := order.NewGetOrderByOrderIdOldReqBuilder() builder.SetOrderId(?) req := builder.Build() - resp, err := orderApi.GetOcoOrderByOrderId(req, context.TODO()) + resp, err := orderApi.GetOrderByOrderIdOld(req, context.TODO()) if err != nil { panic(err) } @@ -1027,16 +1027,16 @@ func TestOrderGetOcoOrderByOrderIdReq(t *testing.T) { } -func TestOrderAddOcoOrderReq(t *testing.T) { - // AddOcoOrder - // Add OCO Order - // /api/v3/oco/order +func TestOrderGetOrderByClientOidOldReq(t *testing.T) { + // GetOrderByClientOidOld + // Get Order By ClientOid - Old + // /api/v1/order/client-order/{clientOid} - builder := order.NewAddOcoOrderReqBuilder() - builder.SetClientOid(?).SetSide(?).SetSymbol(?).SetRemark(?).SetPrice(?).SetSize(?).SetStopPrice(?).SetLimitPrice(?).SetTradeType(?) + builder := order.NewGetOrderByClientOidOldReqBuilder() + builder.SetClientOid(?) req := builder.Build() - resp, err := orderApi.AddOcoOrder(req, context.TODO()) + resp, err := orderApi.GetOrderByClientOidOld(req, context.TODO()) if err != nil { panic(err) } @@ -1050,16 +1050,16 @@ func TestOrderAddOcoOrderReq(t *testing.T) { } -func TestOrderBatchCancelOcoOrdersReq(t *testing.T) { - // BatchCancelOcoOrders - // Batch Cancel OCO Order - // /api/v3/oco/orders +func TestOrderGetTradeHistoryOldReq(t *testing.T) { + // GetTradeHistoryOld + // Get Trade History - Old + // /api/v1/fills - builder := order.NewBatchCancelOcoOrdersReqBuilder() - builder.SetOrderIds(?).SetSymbol(?) + builder := order.NewGetTradeHistoryOldReqBuilder() + builder.SetSymbol(?).SetOrderId(?).SetSide(?).SetType(?).SetTradeType(?).SetStartAt(?).SetEndAt(?).SetCurrentPage(?).SetPageSize(?) req := builder.Build() - resp, err := orderApi.BatchCancelOcoOrders(req, context.TODO()) + resp, err := orderApi.GetTradeHistoryOld(req, context.TODO()) if err != nil { panic(err) } @@ -1073,16 +1073,16 @@ func TestOrderBatchCancelOcoOrdersReq(t *testing.T) { } -func TestOrderGetOcoOrderListReq(t *testing.T) { - // GetOcoOrderList - // Get OCO Order List - // /api/v3/oco/orders +func TestOrderGetRecentTradeHistoryOldReq(t *testing.T) { + // GetRecentTradeHistoryOld + // Get Recent Trade History - Old + // /api/v1/limit/fills - builder := order.NewGetOcoOrderListReqBuilder() - builder.SetSymbol(?).SetStartAt(?).SetEndAt(?).SetOrderIds(?).SetPageSize(?).SetCurrentPage(?) + builder := order.NewGetRecentTradeHistoryOldReqBuilder() + builder.SetCurrentPage(?).SetPageSize(?) req := builder.Build() - resp, err := orderApi.GetOcoOrderList(req, context.TODO()) + resp, err := orderApi.GetRecentTradeHistoryOld(req, context.TODO()) if err != nil { panic(err) } diff --git a/sdk/golang/pkg/generate/spot/order/api_order_test.go b/sdk/golang/pkg/generate/spot/order/api_order_test.go index cfcd80b3..9561f2f3 100644 --- a/sdk/golang/pkg/generate/spot/order/api_order_test.go +++ b/sdk/golang/pkg/generate/spot/order/api_order_test.go @@ -7,187 +7,197 @@ import ( "testing" ) -func TestOrderGetTradeHistoryOldReqModel(t *testing.T) { - // GetTradeHistoryOld - // Get Trade History - Old - // /api/v1/fills +func TestOrderAddOrderReqModel(t *testing.T) { + // AddOrder + // Add Order + // /api/v1/hf/orders - data := "{\"symbol\": \"BTC-USDT\", \"orderId\": \"example_string_default_value\", \"side\": \"buy\", \"type\": \"limit\", \"tradeType\": \"TRADE\", \"startAt\": 1728663338000, \"endAt\": 1728692138000, \"currentPage\": 1, \"pageSize\": 50}" - req := &GetTradeHistoryOldReq{} + data := "{\"type\": \"limit\", \"symbol\": \"BTC-USDT\", \"side\": \"buy\", \"price\": \"50000\", \"size\": \"0.00001\", \"clientOid\": \"5c52e11203aa677f33e493fb\", \"remark\": \"order remarks\"}" + req := &AddOrderReq{} err := json.Unmarshal([]byte(data), req) req.ToMap() assert.Nil(t, err) } -func TestOrderGetTradeHistoryOldRespModel(t *testing.T) { - // GetTradeHistoryOld - // Get Trade History - Old - // /api/v1/fills +func TestOrderAddOrderRespModel(t *testing.T) { + // AddOrder + // Add Order + // /api/v1/hf/orders - data := "{\n \"code\": \"200000\",\n \"data\": {\n \"currentPage\": 1,\n \"pageSize\": 50,\n \"totalNum\": 1,\n \"totalPage\": 1,\n \"items\": [\n {\n \"symbol\": \"DOGE-USDT\",\n \"tradeId\": \"10862827223795713\",\n \"orderId\": \"6745698ef4f1200007c561a8\",\n \"counterOrderId\": \"6745695ef15b270007ac5076\",\n \"side\": \"buy\",\n \"liquidity\": \"taker\",\n \"forceTaker\": false,\n \"price\": \"0.40739\",\n \"size\": \"10\",\n \"funds\": \"4.0739\",\n \"fee\": \"0.0040739\",\n \"feeRate\": \"0.001\",\n \"feeCurrency\": \"USDT\",\n \"stop\": \"\",\n \"tradeType\": \"TRADE\",\n \"type\": \"market\",\n \"createdAt\": 1732602254928\n }\n ]\n }\n}" + data := "{\"code\":\"200000\",\"data\":{\"orderId\":\"670fd33bf9406e0007ab3945\",\"clientOid\":\"5c52e11203aa677f33e493fb\"}}" commonResp := &types.RestResponse{} err := json.Unmarshal([]byte(data), commonResp) assert.Nil(t, err) assert.NotNil(t, commonResp.Data) - resp := &GetTradeHistoryOldResp{} + resp := &AddOrderResp{} err = json.Unmarshal([]byte(commonResp.Data), resp) resp.ToMap() assert.Nil(t, err) } -func TestOrderGetTradeHistoryReqModel(t *testing.T) { - // GetTradeHistory - // Get Trade History - // /api/v1/hf/fills +func TestOrderAddOrderSyncReqModel(t *testing.T) { + // AddOrderSync + // Add Order Sync + // /api/v1/hf/orders/sync - data := "{\"symbol\": \"BTC-USDT\", \"orderId\": \"example_string_default_value\", \"side\": \"buy\", \"type\": \"limit\", \"lastId\": 254062248624417, \"limit\": 100, \"startAt\": 1728663338000, \"endAt\": 1728692138000}" - req := &GetTradeHistoryReq{} + data := "{\"type\": \"limit\", \"symbol\": \"BTC-USDT\", \"side\": \"buy\", \"price\": \"50000\", \"size\": \"0.00001\", \"clientOid\": \"5c52e11203aa677f33e493f\", \"remark\": \"order remarks\"}" + req := &AddOrderSyncReq{} err := json.Unmarshal([]byte(data), req) req.ToMap() assert.Nil(t, err) } -func TestOrderGetTradeHistoryRespModel(t *testing.T) { - // GetTradeHistory - // Get Trade History - // /api/v1/hf/fills +func TestOrderAddOrderSyncRespModel(t *testing.T) { + // AddOrderSync + // Add Order Sync + // /api/v1/hf/orders/sync - data := "{\n \"code\": \"200000\",\n \"data\": {\n \"items\": [\n {\n \"id\": 19814995255305,\n \"orderId\": \"6717422bd51c29000775ea03\",\n \"counterOrderId\": \"67174228135f9e000709da8c\",\n \"tradeId\": 11029373945659392,\n \"symbol\": \"BTC-USDT\",\n \"side\": \"buy\",\n \"liquidity\": \"taker\",\n \"type\": \"limit\",\n \"forceTaker\": false,\n \"price\": \"67717.6\",\n \"size\": \"0.00001\",\n \"funds\": \"0.677176\",\n \"fee\": \"0.000677176\",\n \"feeRate\": \"0.001\",\n \"feeCurrency\": \"USDT\",\n \"stop\": \"\",\n \"tradeType\": \"TRADE\",\n \"taxRate\": \"0\",\n \"tax\": \"0\",\n \"createdAt\": 1729577515473\n }\n ],\n \"lastId\": 19814995255305\n }\n}" + data := "{\"code\":\"200000\",\"data\":{\"orderId\":\"67111a7cb7cbdf000703e1f6\",\"clientOid\":\"5c52e11203aa677f33e493f\",\"orderTime\":1729174140586,\"originSize\":\"0.00001\",\"dealSize\":\"0\",\"remainSize\":\"0.00001\",\"canceledSize\":\"0\",\"status\":\"open\",\"matchTime\":1729174140588}}" commonResp := &types.RestResponse{} err := json.Unmarshal([]byte(data), commonResp) assert.Nil(t, err) assert.NotNil(t, commonResp.Data) - resp := &GetTradeHistoryResp{} + resp := &AddOrderSyncResp{} err = json.Unmarshal([]byte(commonResp.Data), resp) resp.ToMap() assert.Nil(t, err) } -func TestOrderGetOpenOrdersReqModel(t *testing.T) { - // GetOpenOrders - // Get Open Orders - // /api/v1/hf/orders/active +func TestOrderAddOrderTestReqModel(t *testing.T) { + // AddOrderTest + // Add Order Test + // /api/v1/hf/orders/test - data := "{\"symbol\": \"BTC-USDT\"}" - req := &GetOpenOrdersReq{} + data := "{\"type\": \"limit\", \"symbol\": \"BTC-USDT\", \"side\": \"buy\", \"price\": \"50000\", \"size\": \"0.00001\", \"clientOid\": \"5c52e11203aa677f33e493f\", \"remark\": \"order remarks\"}" + req := &AddOrderTestReq{} err := json.Unmarshal([]byte(data), req) req.ToMap() assert.Nil(t, err) } -func TestOrderGetOpenOrdersRespModel(t *testing.T) { - // GetOpenOrders - // Get Open Orders - // /api/v1/hf/orders/active +func TestOrderAddOrderTestRespModel(t *testing.T) { + // AddOrderTest + // Add Order Test + // /api/v1/hf/orders/test - data := "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"id\": \"67120bbef094e200070976f6\",\n \"clientOid\": \"5c52e11203aa677f33e493fb\",\n \"symbol\": \"BTC-USDT\",\n \"opType\": \"DEAL\",\n \"type\": \"limit\",\n \"side\": \"buy\",\n \"price\": \"50000\",\n \"size\": \"0.00001\",\n \"funds\": \"0.5\",\n \"dealSize\": \"0\",\n \"dealFunds\": \"0\",\n \"fee\": \"0\",\n \"feeCurrency\": \"USDT\",\n \"stp\": null,\n \"timeInForce\": \"GTC\",\n \"postOnly\": false,\n \"hidden\": false,\n \"iceberg\": false,\n \"visibleSize\": \"0\",\n \"cancelAfter\": 0,\n \"channel\": \"API\",\n \"remark\": \"order remarks\",\n \"tags\": \"order tags\",\n \"cancelExist\": false,\n \"tradeType\": \"TRADE\",\n \"inOrderBook\": true,\n \"cancelledSize\": \"0\",\n \"cancelledFunds\": \"0\",\n \"remainSize\": \"0.00001\",\n \"remainFunds\": \"0.5\",\n \"tax\": \"0\",\n \"active\": true,\n \"createdAt\": 1729235902748,\n \"lastUpdatedAt\": 1729235909862\n }\n ]\n}" + data := "{\"code\":\"200000\",\"data\":{\"orderId\":\"670fd33bf9406e0007ab3945\",\"clientOid\":\"5c52e11203aa677f33e493fb\"}}" commonResp := &types.RestResponse{} err := json.Unmarshal([]byte(data), commonResp) assert.Nil(t, err) assert.NotNil(t, commonResp.Data) - resp := &GetOpenOrdersResp{} + resp := &AddOrderTestResp{} err = json.Unmarshal([]byte(commonResp.Data), resp) resp.ToMap() assert.Nil(t, err) } -func TestOrderGetSymbolsWithOpenOrderReqModel(t *testing.T) { - // GetSymbolsWithOpenOrder - // Get Symbols With Open Order - // /api/v1/hf/orders/active/symbols +func TestOrderBatchAddOrdersReqModel(t *testing.T) { + // BatchAddOrders + // Batch Add Orders + // /api/v1/hf/orders/multi + data := "{\"orderList\": [{\"clientOid\": \"client order id 12\", \"symbol\": \"BTC-USDT\", \"type\": \"limit\", \"side\": \"buy\", \"price\": \"30000\", \"size\": \"0.00001\"}, {\"clientOid\": \"client order id 13\", \"symbol\": \"ETH-USDT\", \"type\": \"limit\", \"side\": \"sell\", \"price\": \"2000\", \"size\": \"0.00001\"}]}" + req := &BatchAddOrdersReq{} + err := json.Unmarshal([]byte(data), req) + req.ToMap() + assert.Nil(t, err) } -func TestOrderGetSymbolsWithOpenOrderRespModel(t *testing.T) { - // GetSymbolsWithOpenOrder - // Get Symbols With Open Order - // /api/v1/hf/orders/active/symbols +func TestOrderBatchAddOrdersRespModel(t *testing.T) { + // BatchAddOrders + // Batch Add Orders + // /api/v1/hf/orders/multi - data := "{\n \"code\": \"200000\",\n \"data\": {\n \"symbols\": [\n \"ETH-USDT\",\n \"BTC-USDT\"\n ]\n }\n}" + data := "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"orderId\": \"6710d8336afcdb0007319c27\",\n \"clientOid\": \"client order id 12\",\n \"success\": true\n },\n {\n \"success\": false,\n \"failMsg\": \"The order funds should more then 0.1 USDT.\"\n }\n ]\n}" commonResp := &types.RestResponse{} err := json.Unmarshal([]byte(data), commonResp) assert.Nil(t, err) assert.NotNil(t, commonResp.Data) - resp := &GetSymbolsWithOpenOrderResp{} + resp := &BatchAddOrdersResp{} err = json.Unmarshal([]byte(commonResp.Data), resp) resp.ToMap() assert.Nil(t, err) } -func TestOrderModifyOrderReqModel(t *testing.T) { - // ModifyOrder - // Modify Order - // /api/v1/hf/orders/alter +func TestOrderBatchAddOrdersSyncReqModel(t *testing.T) { + // BatchAddOrdersSync + // Batch Add Orders Sync + // /api/v1/hf/orders/multi/sync - data := "{\"symbol\": \"BTC-USDT\", \"orderId\": \"670fd33bf9406e0007ab3945\", \"newPrice\": \"30000\", \"newSize\": \"0.0001\"}" - req := &ModifyOrderReq{} + data := "{\"orderList\": [{\"clientOid\": \"client order id 13\", \"symbol\": \"BTC-USDT\", \"type\": \"limit\", \"side\": \"buy\", \"price\": \"30000\", \"size\": \"0.00001\"}, {\"clientOid\": \"client order id 14\", \"symbol\": \"ETH-USDT\", \"type\": \"limit\", \"side\": \"sell\", \"price\": \"2000\", \"size\": \"0.00001\"}]}" + req := &BatchAddOrdersSyncReq{} err := json.Unmarshal([]byte(data), req) req.ToMap() assert.Nil(t, err) } -func TestOrderModifyOrderRespModel(t *testing.T) { - // ModifyOrder - // Modify Order - // /api/v1/hf/orders/alter +func TestOrderBatchAddOrdersSyncRespModel(t *testing.T) { + // BatchAddOrdersSync + // Batch Add Orders Sync + // /api/v1/hf/orders/multi/sync - data := "{\"code\":\"200000\",\"data\":{\"newOrderId\":\"67112258f9406e0007408827\",\"clientOid\":\"client order id 12\"}}" + data := "{\"code\":\"200000\",\"data\":[{\"orderId\":\"6711195e5584bc0007bd5aef\",\"clientOid\":\"client order id 13\",\"orderTime\":1729173854299,\"originSize\":\"0.00001\",\"dealSize\":\"0\",\"remainSize\":\"0.00001\",\"canceledSize\":\"0\",\"status\":\"open\",\"matchTime\":1729173854326,\"success\":true},{\"success\":false,\"failMsg\":\"The order funds should more then 0.1 USDT.\"}]}" commonResp := &types.RestResponse{} err := json.Unmarshal([]byte(data), commonResp) assert.Nil(t, err) assert.NotNil(t, commonResp.Data) - resp := &ModifyOrderResp{} + resp := &BatchAddOrdersSyncResp{} err = json.Unmarshal([]byte(commonResp.Data), resp) resp.ToMap() assert.Nil(t, err) } -func TestOrderCancelAllOrdersReqModel(t *testing.T) { - // CancelAllOrders - // Cancel All Orders - // /api/v1/hf/orders/cancelAll +func TestOrderCancelOrderByOrderIdReqModel(t *testing.T) { + // CancelOrderByOrderId + // Cancel Order By OrderId + // /api/v1/hf/orders/{orderId} + data := "{\"orderId\": \"671124f9365ccb00073debd4\", \"symbol\": \"BTC-USDT\"}" + req := &CancelOrderByOrderIdReq{} + err := json.Unmarshal([]byte(data), req) + req.ToMap() + assert.Nil(t, err) } -func TestOrderCancelAllOrdersRespModel(t *testing.T) { - // CancelAllOrders - // Cancel All Orders - // /api/v1/hf/orders/cancelAll +func TestOrderCancelOrderByOrderIdRespModel(t *testing.T) { + // CancelOrderByOrderId + // Cancel Order By OrderId + // /api/v1/hf/orders/{orderId} - data := "{\n \"code\": \"200000\",\n \"data\": {\n \"succeedSymbols\": [\n \"ETH-USDT\",\n \"BTC-USDT\"\n ],\n \"failedSymbols\": []\n }\n}" + data := "{\n \"code\": \"200000\",\n \"data\": {\n \"orderId\": \"671124f9365ccb00073debd4\"\n }\n}" commonResp := &types.RestResponse{} err := json.Unmarshal([]byte(data), commonResp) assert.Nil(t, err) assert.NotNil(t, commonResp.Data) - resp := &CancelAllOrdersResp{} + resp := &CancelOrderByOrderIdResp{} err = json.Unmarshal([]byte(commonResp.Data), resp) resp.ToMap() assert.Nil(t, err) } -func TestOrderCancelPartialOrderReqModel(t *testing.T) { - // CancelPartialOrder - // Cancel Partial Order - // /api/v1/hf/orders/cancel/{orderId} +func TestOrderCancelOrderByOrderIdSyncReqModel(t *testing.T) { + // CancelOrderByOrderIdSync + // Cancel Order By OrderId Sync + // /api/v1/hf/orders/sync/{orderId} - data := "{\"orderId\": \"6711f73c1ef16c000717bb31\", \"symbol\": \"BTC-USDT\", \"cancelSize\": \"0.00001\"}" - req := &CancelPartialOrderReq{} + data := "{\"orderId\": \"671128ee365ccb0007534d45\", \"symbol\": \"BTC-USDT\"}" + req := &CancelOrderByOrderIdSyncReq{} err := json.Unmarshal([]byte(data), req) req.ToMap() assert.Nil(t, err) } -func TestOrderCancelPartialOrderRespModel(t *testing.T) { - // CancelPartialOrder - // Cancel Partial Order - // /api/v1/hf/orders/cancel/{orderId} +func TestOrderCancelOrderByOrderIdSyncRespModel(t *testing.T) { + // CancelOrderByOrderIdSync + // Cancel Order By OrderId Sync + // /api/v1/hf/orders/sync/{orderId} - data := "{\n \"code\": \"200000\",\n \"data\": {\n \"orderId\": \"6711f73c1ef16c000717bb31\",\n \"cancelSize\": \"0.00001\"\n }\n}" + data := "{\n \"code\": \"200000\",\n \"data\": {\n \"orderId\": \"671128ee365ccb0007534d45\",\n \"originSize\": \"0.00001\",\n \"dealSize\": \"0\",\n \"remainSize\": \"0\",\n \"canceledSize\": \"0.00001\",\n \"status\": \"done\"\n }\n}" commonResp := &types.RestResponse{} err := json.Unmarshal([]byte(data), commonResp) assert.Nil(t, err) assert.NotNil(t, commonResp.Data) - resp := &CancelPartialOrderResp{} + resp := &CancelOrderByOrderIdSyncResp{} err = json.Unmarshal([]byte(commonResp.Data), resp) resp.ToMap() assert.Nil(t, err) @@ -221,80 +231,57 @@ func TestOrderCancelOrderByClientOidRespModel(t *testing.T) { assert.Nil(t, err) } -func TestOrderGetOrderByClientOidReqModel(t *testing.T) { - // GetOrderByClientOid - // Get Order By ClientOid - // /api/v1/hf/orders/client-order/{clientOid} +func TestOrderCancelOrderByClientOidSyncReqModel(t *testing.T) { + // CancelOrderByClientOidSync + // Cancel Order By ClientOid Sync + // /api/v1/hf/orders/sync/client-order/{clientOid} - data := "{\"symbol\": \"BTC-USDT\", \"clientOid\": \"5c52e11203aa677f33e493fb\"}" - req := &GetOrderByClientOidReq{} + data := "{\"clientOid\": \"5c52e11203aa677f33e493fb\", \"symbol\": \"BTC-USDT\"}" + req := &CancelOrderByClientOidSyncReq{} err := json.Unmarshal([]byte(data), req) req.ToMap() assert.Nil(t, err) } -func TestOrderGetOrderByClientOidRespModel(t *testing.T) { - // GetOrderByClientOid - // Get Order By ClientOid - // /api/v1/hf/orders/client-order/{clientOid} +func TestOrderCancelOrderByClientOidSyncRespModel(t *testing.T) { + // CancelOrderByClientOidSync + // Cancel Order By ClientOid Sync + // /api/v1/hf/orders/sync/client-order/{clientOid} - data := "{\n \"code\": \"200000\",\n \"data\": {\n \"id\": \"6717422bd51c29000775ea03\",\n \"clientOid\": \"5c52e11203aa677f33e493fb\",\n \"symbol\": \"BTC-USDT\",\n \"opType\": \"DEAL\",\n \"type\": \"limit\",\n \"side\": \"buy\",\n \"price\": \"70000\",\n \"size\": \"0.00001\",\n \"funds\": \"0.7\",\n \"dealSize\": \"0.00001\",\n \"dealFunds\": \"0.677176\",\n \"remainSize\": \"0\",\n \"remainFunds\": \"0.022824\",\n \"cancelledSize\": \"0\",\n \"cancelledFunds\": \"0\",\n \"fee\": \"0.000677176\",\n \"feeCurrency\": \"USDT\",\n \"stp\": null,\n \"timeInForce\": \"GTC\",\n \"postOnly\": false,\n \"hidden\": false,\n \"iceberg\": false,\n \"visibleSize\": \"0\",\n \"cancelAfter\": 0,\n \"channel\": \"API\",\n \"remark\": \"order remarks\",\n \"tags\": null,\n \"cancelExist\": false,\n \"tradeType\": \"TRADE\",\n \"inOrderBook\": false,\n \"active\": false,\n \"tax\": \"0\",\n \"createdAt\": 1729577515444,\n \"lastUpdatedAt\": 1729577515481\n }\n}" + data := "{\n \"code\": \"200000\",\n \"data\": {\n \"clientOid\": \"5c52e11203aa677f33e493fb\",\n \"originSize\": \"0.00001\",\n \"dealSize\": \"0\",\n \"remainSize\": \"0\",\n \"canceledSize\": \"0.00001\",\n \"status\": \"done\"\n }\n}" commonResp := &types.RestResponse{} err := json.Unmarshal([]byte(data), commonResp) assert.Nil(t, err) assert.NotNil(t, commonResp.Data) - resp := &GetOrderByClientOidResp{} + resp := &CancelOrderByClientOidSyncResp{} err = json.Unmarshal([]byte(commonResp.Data), resp) resp.ToMap() assert.Nil(t, err) } -func TestOrderSetDCPReqModel(t *testing.T) { - // SetDCP - // Set DCP - // /api/v1/hf/orders/dead-cancel-all +func TestOrderCancelPartialOrderReqModel(t *testing.T) { + // CancelPartialOrder + // Cancel Partial Order + // /api/v1/hf/orders/cancel/{orderId} - data := "{\"timeout\": 5, \"symbols\": \"BTC-USDT,ETH-USDT\"}" - req := &SetDCPReq{} + data := "{\"orderId\": \"6711f73c1ef16c000717bb31\", \"symbol\": \"BTC-USDT\", \"cancelSize\": \"0.00001\"}" + req := &CancelPartialOrderReq{} err := json.Unmarshal([]byte(data), req) req.ToMap() assert.Nil(t, err) } -func TestOrderSetDCPRespModel(t *testing.T) { - // SetDCP - // Set DCP - // /api/v1/hf/orders/dead-cancel-all - - data := "{\"code\":\"200000\",\"data\":{\"currentTime\":1729656588,\"triggerTime\":1729656593}}" - commonResp := &types.RestResponse{} - err := json.Unmarshal([]byte(data), commonResp) - assert.Nil(t, err) - assert.NotNil(t, commonResp.Data) - resp := &SetDCPResp{} - err = json.Unmarshal([]byte(commonResp.Data), resp) - resp.ToMap() - assert.Nil(t, err) -} - -func TestOrderGetDCPReqModel(t *testing.T) { - // GetDCP - // Get DCP - // /api/v1/hf/orders/dead-cancel-all/query - -} - -func TestOrderGetDCPRespModel(t *testing.T) { - // GetDCP - // Get DCP - // /api/v1/hf/orders/dead-cancel-all/query +func TestOrderCancelPartialOrderRespModel(t *testing.T) { + // CancelPartialOrder + // Cancel Partial Order + // /api/v1/hf/orders/cancel/{orderId} - data := "{\n \"code\": \"200000\",\n \"data\": {\n \"timeout\": 5,\n \"symbols\": \"BTC-USDT,ETH-USDT\",\n \"currentTime\": 1729241305,\n \"triggerTime\": 1729241308\n }\n}" + data := "{\n \"code\": \"200000\",\n \"data\": {\n \"orderId\": \"6711f73c1ef16c000717bb31\",\n \"cancelSize\": \"0.00001\"\n }\n}" commonResp := &types.RestResponse{} err := json.Unmarshal([]byte(data), commonResp) assert.Nil(t, err) assert.NotNil(t, commonResp.Data) - resp := &GetDCPResp{} + resp := &CancelPartialOrderResp{} err = json.Unmarshal([]byte(commonResp.Data), resp) resp.ToMap() assert.Nil(t, err) @@ -328,1009 +315,1022 @@ func TestOrderCancelAllOrdersBySymbolRespModel(t *testing.T) { assert.Nil(t, err) } -func TestOrderGetClosedOrdersReqModel(t *testing.T) { - // GetClosedOrders - // Get Closed Orders - // /api/v1/hf/orders/done +func TestOrderCancelAllOrdersReqModel(t *testing.T) { + // CancelAllOrders + // Cancel All Orders + // /api/v1/hf/orders/cancelAll - data := "{\"symbol\": \"BTC-USDT\", \"side\": \"buy\", \"type\": \"limit\", \"lastId\": 254062248624417, \"limit\": 20, \"startAt\": 1728663338000, \"endAt\": 1728692138000}" - req := &GetClosedOrdersReq{} - err := json.Unmarshal([]byte(data), req) - req.ToMap() - assert.Nil(t, err) } -func TestOrderGetClosedOrdersRespModel(t *testing.T) { - // GetClosedOrders - // Get Closed Orders - // /api/v1/hf/orders/done +func TestOrderCancelAllOrdersRespModel(t *testing.T) { + // CancelAllOrders + // Cancel All Orders + // /api/v1/hf/orders/cancelAll - data := "{\n \"code\": \"200000\",\n \"data\": {\n \"lastId\": 19814995255305,\n \"items\": [\n {\n \"id\": \"6717422bd51c29000775ea03\",\n \"clientOid\": \"5c52e11203aa677f33e493fb\",\n \"symbol\": \"BTC-USDT\",\n \"opType\": \"DEAL\",\n \"type\": \"limit\",\n \"side\": \"buy\",\n \"price\": \"70000\",\n \"size\": \"0.00001\",\n \"funds\": \"0.7\",\n \"dealSize\": \"0.00001\",\n \"dealFunds\": \"0.677176\",\n \"remainSize\": \"0\",\n \"remainFunds\": \"0.022824\",\n \"cancelledSize\": \"0\",\n \"cancelledFunds\": \"0\",\n \"fee\": \"0.000677176\",\n \"feeCurrency\": \"USDT\",\n \"stp\": null,\n \"timeInForce\": \"GTC\",\n \"postOnly\": false,\n \"hidden\": false,\n \"iceberg\": false,\n \"visibleSize\": \"0\",\n \"cancelAfter\": 0,\n \"channel\": \"API\",\n \"remark\": \"order remarks\",\n \"tags\": null,\n \"cancelExist\": false,\n \"tradeType\": \"TRADE\",\n \"inOrderBook\": false,\n \"active\": false,\n \"tax\": \"0\",\n \"createdAt\": 1729577515444,\n \"lastUpdatedAt\": 1729577515481\n }\n ]\n }\n}" + data := "{\n \"code\": \"200000\",\n \"data\": {\n \"succeedSymbols\": [\n \"ETH-USDT\",\n \"BTC-USDT\"\n ],\n \"failedSymbols\": []\n }\n}" commonResp := &types.RestResponse{} err := json.Unmarshal([]byte(data), commonResp) assert.Nil(t, err) assert.NotNil(t, commonResp.Data) - resp := &GetClosedOrdersResp{} + resp := &CancelAllOrdersResp{} err = json.Unmarshal([]byte(commonResp.Data), resp) resp.ToMap() assert.Nil(t, err) } -func TestOrderBatchAddOrdersReqModel(t *testing.T) { - // BatchAddOrders - // Batch Add Orders - // /api/v1/hf/orders/multi +func TestOrderModifyOrderReqModel(t *testing.T) { + // ModifyOrder + // Modify Order + // /api/v1/hf/orders/alter - data := "{\"orderList\": [{\"clientOid\": \"client order id 12\", \"symbol\": \"BTC-USDT\", \"type\": \"limit\", \"side\": \"buy\", \"price\": \"30000\", \"size\": \"0.00001\"}, {\"clientOid\": \"client order id 13\", \"symbol\": \"ETH-USDT\", \"type\": \"limit\", \"side\": \"sell\", \"price\": \"2000\", \"size\": \"0.00001\"}]}" - req := &BatchAddOrdersReq{} + data := "{\"symbol\": \"BTC-USDT\", \"orderId\": \"670fd33bf9406e0007ab3945\", \"newPrice\": \"30000\", \"newSize\": \"0.0001\"}" + req := &ModifyOrderReq{} err := json.Unmarshal([]byte(data), req) req.ToMap() assert.Nil(t, err) } -func TestOrderBatchAddOrdersRespModel(t *testing.T) { - // BatchAddOrders - // Batch Add Orders - // /api/v1/hf/orders/multi +func TestOrderModifyOrderRespModel(t *testing.T) { + // ModifyOrder + // Modify Order + // /api/v1/hf/orders/alter - data := "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"orderId\": \"6710d8336afcdb0007319c27\",\n \"clientOid\": \"client order id 12\",\n \"success\": true\n },\n {\n \"success\": false,\n \"failMsg\": \"The order funds should more then 0.1 USDT.\"\n }\n ]\n}" + data := "{\"code\":\"200000\",\"data\":{\"newOrderId\":\"67112258f9406e0007408827\",\"clientOid\":\"client order id 12\"}}" commonResp := &types.RestResponse{} err := json.Unmarshal([]byte(data), commonResp) assert.Nil(t, err) assert.NotNil(t, commonResp.Data) - resp := &BatchAddOrdersResp{} + resp := &ModifyOrderResp{} err = json.Unmarshal([]byte(commonResp.Data), resp) resp.ToMap() assert.Nil(t, err) } -func TestOrderBatchAddOrdersSyncReqModel(t *testing.T) { - // BatchAddOrdersSync - // Batch Add Orders Sync - // /api/v1/hf/orders/multi/sync +func TestOrderGetOrderByOrderIdReqModel(t *testing.T) { + // GetOrderByOrderId + // Get Order By OrderId + // /api/v1/hf/orders/{orderId} - data := "{\"orderList\": [{\"clientOid\": \"client order id 13\", \"symbol\": \"BTC-USDT\", \"type\": \"limit\", \"side\": \"buy\", \"price\": \"30000\", \"size\": \"0.00001\"}, {\"clientOid\": \"client order id 14\", \"symbol\": \"ETH-USDT\", \"type\": \"limit\", \"side\": \"sell\", \"price\": \"2000\", \"size\": \"0.00001\"}]}" - req := &BatchAddOrdersSyncReq{} + data := "{\"symbol\": \"BTC-USDT\", \"orderId\": \"6717422bd51c29000775ea03\"}" + req := &GetOrderByOrderIdReq{} err := json.Unmarshal([]byte(data), req) req.ToMap() assert.Nil(t, err) } -func TestOrderBatchAddOrdersSyncRespModel(t *testing.T) { - // BatchAddOrdersSync - // Batch Add Orders Sync - // /api/v1/hf/orders/multi/sync +func TestOrderGetOrderByOrderIdRespModel(t *testing.T) { + // GetOrderByOrderId + // Get Order By OrderId + // /api/v1/hf/orders/{orderId} - data := "{\"code\":\"200000\",\"data\":[{\"orderId\":\"6711195e5584bc0007bd5aef\",\"clientOid\":\"client order id 13\",\"orderTime\":1729173854299,\"originSize\":\"0.00001\",\"dealSize\":\"0\",\"remainSize\":\"0.00001\",\"canceledSize\":\"0\",\"status\":\"open\",\"matchTime\":1729173854326,\"success\":true},{\"success\":false,\"failMsg\":\"The order funds should more then 0.1 USDT.\"}]}" + data := "{\n \"code\": \"200000\",\n \"data\": {\n \"id\": \"6717422bd51c29000775ea03\",\n \"clientOid\": \"5c52e11203aa677f33e493fb\",\n \"symbol\": \"BTC-USDT\",\n \"opType\": \"DEAL\",\n \"type\": \"limit\",\n \"side\": \"buy\",\n \"price\": \"70000\",\n \"size\": \"0.00001\",\n \"funds\": \"0.7\",\n \"dealSize\": \"0.00001\",\n \"dealFunds\": \"0.677176\",\n \"remainSize\": \"0\",\n \"remainFunds\": \"0.022824\",\n \"cancelledSize\": \"0\",\n \"cancelledFunds\": \"0\",\n \"fee\": \"0.000677176\",\n \"feeCurrency\": \"USDT\",\n \"stp\": null,\n \"timeInForce\": \"GTC\",\n \"postOnly\": false,\n \"hidden\": false,\n \"iceberg\": false,\n \"visibleSize\": \"0\",\n \"cancelAfter\": 0,\n \"channel\": \"API\",\n \"remark\": \"order remarks\",\n \"tags\": null,\n \"cancelExist\": false,\n \"tradeType\": \"TRADE\",\n \"inOrderBook\": false,\n \"active\": false,\n \"tax\": \"0\",\n \"createdAt\": 1729577515444,\n \"lastUpdatedAt\": 1729577515481\n }\n}" commonResp := &types.RestResponse{} err := json.Unmarshal([]byte(data), commonResp) assert.Nil(t, err) assert.NotNil(t, commonResp.Data) - resp := &BatchAddOrdersSyncResp{} + resp := &GetOrderByOrderIdResp{} err = json.Unmarshal([]byte(commonResp.Data), resp) resp.ToMap() assert.Nil(t, err) } -func TestOrderCancelOrderByOrderIdReqModel(t *testing.T) { - // CancelOrderByOrderId - // Cancel Order By OrderId - // /api/v1/hf/orders/{orderId} +func TestOrderGetOrderByClientOidReqModel(t *testing.T) { + // GetOrderByClientOid + // Get Order By ClientOid + // /api/v1/hf/orders/client-order/{clientOid} - data := "{\"orderId\": \"671124f9365ccb00073debd4\", \"symbol\": \"BTC-USDT\"}" - req := &CancelOrderByOrderIdReq{} + data := "{\"symbol\": \"BTC-USDT\", \"clientOid\": \"5c52e11203aa677f33e493fb\"}" + req := &GetOrderByClientOidReq{} err := json.Unmarshal([]byte(data), req) req.ToMap() assert.Nil(t, err) } -func TestOrderCancelOrderByOrderIdRespModel(t *testing.T) { - // CancelOrderByOrderId - // Cancel Order By OrderId - // /api/v1/hf/orders/{orderId} +func TestOrderGetOrderByClientOidRespModel(t *testing.T) { + // GetOrderByClientOid + // Get Order By ClientOid + // /api/v1/hf/orders/client-order/{clientOid} - data := "{\n \"code\": \"200000\",\n \"data\": {\n \"orderId\": \"671124f9365ccb00073debd4\"\n }\n}" + data := "{\n \"code\": \"200000\",\n \"data\": {\n \"id\": \"6717422bd51c29000775ea03\",\n \"clientOid\": \"5c52e11203aa677f33e493fb\",\n \"symbol\": \"BTC-USDT\",\n \"opType\": \"DEAL\",\n \"type\": \"limit\",\n \"side\": \"buy\",\n \"price\": \"70000\",\n \"size\": \"0.00001\",\n \"funds\": \"0.7\",\n \"dealSize\": \"0.00001\",\n \"dealFunds\": \"0.677176\",\n \"remainSize\": \"0\",\n \"remainFunds\": \"0.022824\",\n \"cancelledSize\": \"0\",\n \"cancelledFunds\": \"0\",\n \"fee\": \"0.000677176\",\n \"feeCurrency\": \"USDT\",\n \"stp\": null,\n \"timeInForce\": \"GTC\",\n \"postOnly\": false,\n \"hidden\": false,\n \"iceberg\": false,\n \"visibleSize\": \"0\",\n \"cancelAfter\": 0,\n \"channel\": \"API\",\n \"remark\": \"order remarks\",\n \"tags\": null,\n \"cancelExist\": false,\n \"tradeType\": \"TRADE\",\n \"inOrderBook\": false,\n \"active\": false,\n \"tax\": \"0\",\n \"createdAt\": 1729577515444,\n \"lastUpdatedAt\": 1729577515481\n }\n}" commonResp := &types.RestResponse{} err := json.Unmarshal([]byte(data), commonResp) assert.Nil(t, err) assert.NotNil(t, commonResp.Data) - resp := &CancelOrderByOrderIdResp{} + resp := &GetOrderByClientOidResp{} err = json.Unmarshal([]byte(commonResp.Data), resp) resp.ToMap() assert.Nil(t, err) } -func TestOrderGetOrderByOrderIdReqModel(t *testing.T) { - // GetOrderByOrderId - // Get Order By OrderId - // /api/v1/hf/orders/{orderId} +func TestOrderGetSymbolsWithOpenOrderReqModel(t *testing.T) { + // GetSymbolsWithOpenOrder + // Get Symbols With Open Order + // /api/v1/hf/orders/active/symbols - data := "{\"symbol\": \"BTC-USDT\", \"orderId\": \"6717422bd51c29000775ea03\"}" - req := &GetOrderByOrderIdReq{} - err := json.Unmarshal([]byte(data), req) - req.ToMap() - assert.Nil(t, err) } -func TestOrderGetOrderByOrderIdRespModel(t *testing.T) { - // GetOrderByOrderId - // Get Order By OrderId - // /api/v1/hf/orders/{orderId} +func TestOrderGetSymbolsWithOpenOrderRespModel(t *testing.T) { + // GetSymbolsWithOpenOrder + // Get Symbols With Open Order + // /api/v1/hf/orders/active/symbols - data := "{\n \"code\": \"200000\",\n \"data\": {\n \"id\": \"6717422bd51c29000775ea03\",\n \"clientOid\": \"5c52e11203aa677f33e493fb\",\n \"symbol\": \"BTC-USDT\",\n \"opType\": \"DEAL\",\n \"type\": \"limit\",\n \"side\": \"buy\",\n \"price\": \"70000\",\n \"size\": \"0.00001\",\n \"funds\": \"0.7\",\n \"dealSize\": \"0.00001\",\n \"dealFunds\": \"0.677176\",\n \"remainSize\": \"0\",\n \"remainFunds\": \"0.022824\",\n \"cancelledSize\": \"0\",\n \"cancelledFunds\": \"0\",\n \"fee\": \"0.000677176\",\n \"feeCurrency\": \"USDT\",\n \"stp\": null,\n \"timeInForce\": \"GTC\",\n \"postOnly\": false,\n \"hidden\": false,\n \"iceberg\": false,\n \"visibleSize\": \"0\",\n \"cancelAfter\": 0,\n \"channel\": \"API\",\n \"remark\": \"order remarks\",\n \"tags\": null,\n \"cancelExist\": false,\n \"tradeType\": \"TRADE\",\n \"inOrderBook\": false,\n \"active\": false,\n \"tax\": \"0\",\n \"createdAt\": 1729577515444,\n \"lastUpdatedAt\": 1729577515481\n }\n}" + data := "{\n \"code\": \"200000\",\n \"data\": {\n \"symbols\": [\n \"ETH-USDT\",\n \"BTC-USDT\"\n ]\n }\n}" commonResp := &types.RestResponse{} err := json.Unmarshal([]byte(data), commonResp) assert.Nil(t, err) assert.NotNil(t, commonResp.Data) - resp := &GetOrderByOrderIdResp{} + resp := &GetSymbolsWithOpenOrderResp{} err = json.Unmarshal([]byte(commonResp.Data), resp) resp.ToMap() assert.Nil(t, err) } -func TestOrderAddOrderReqModel(t *testing.T) { - // AddOrder - // Add Order - // /api/v1/hf/orders +func TestOrderGetOpenOrdersReqModel(t *testing.T) { + // GetOpenOrders + // Get Open Orders + // /api/v1/hf/orders/active - data := "{\"type\": \"limit\", \"symbol\": \"BTC-USDT\", \"side\": \"buy\", \"price\": \"50000\", \"size\": \"0.00001\", \"clientOid\": \"5c52e11203aa677f33e493fb\", \"remark\": \"order remarks\"}" - req := &AddOrderReq{} + data := "{\"symbol\": \"BTC-USDT\"}" + req := &GetOpenOrdersReq{} err := json.Unmarshal([]byte(data), req) req.ToMap() assert.Nil(t, err) } -func TestOrderAddOrderRespModel(t *testing.T) { - // AddOrder - // Add Order - // /api/v1/hf/orders +func TestOrderGetOpenOrdersRespModel(t *testing.T) { + // GetOpenOrders + // Get Open Orders + // /api/v1/hf/orders/active - data := "{\"code\":\"200000\",\"data\":{\"orderId\":\"670fd33bf9406e0007ab3945\",\"clientOid\":\"5c52e11203aa677f33e493fb\"}}" + data := "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"id\": \"67120bbef094e200070976f6\",\n \"clientOid\": \"5c52e11203aa677f33e493fb\",\n \"symbol\": \"BTC-USDT\",\n \"opType\": \"DEAL\",\n \"type\": \"limit\",\n \"side\": \"buy\",\n \"price\": \"50000\",\n \"size\": \"0.00001\",\n \"funds\": \"0.5\",\n \"dealSize\": \"0\",\n \"dealFunds\": \"0\",\n \"fee\": \"0\",\n \"feeCurrency\": \"USDT\",\n \"stp\": null,\n \"timeInForce\": \"GTC\",\n \"postOnly\": false,\n \"hidden\": false,\n \"iceberg\": false,\n \"visibleSize\": \"0\",\n \"cancelAfter\": 0,\n \"channel\": \"API\",\n \"remark\": \"order remarks\",\n \"tags\": \"order tags\",\n \"cancelExist\": false,\n \"tradeType\": \"TRADE\",\n \"inOrderBook\": true,\n \"cancelledSize\": \"0\",\n \"cancelledFunds\": \"0\",\n \"remainSize\": \"0.00001\",\n \"remainFunds\": \"0.5\",\n \"tax\": \"0\",\n \"active\": true,\n \"createdAt\": 1729235902748,\n \"lastUpdatedAt\": 1729235909862\n }\n ]\n}" commonResp := &types.RestResponse{} err := json.Unmarshal([]byte(data), commonResp) assert.Nil(t, err) assert.NotNil(t, commonResp.Data) - resp := &AddOrderResp{} + resp := &GetOpenOrdersResp{} err = json.Unmarshal([]byte(commonResp.Data), resp) resp.ToMap() assert.Nil(t, err) } -func TestOrderCancelOrderByClientOidSyncReqModel(t *testing.T) { - // CancelOrderByClientOidSync - // Cancel Order By ClientOid Sync - // /api/v1/hf/orders/sync/client-order/{clientOid} +func TestOrderGetClosedOrdersReqModel(t *testing.T) { + // GetClosedOrders + // Get Closed Orders + // /api/v1/hf/orders/done - data := "{\"clientOid\": \"5c52e11203aa677f33e493fb\", \"symbol\": \"BTC-USDT\"}" - req := &CancelOrderByClientOidSyncReq{} + data := "{\"symbol\": \"BTC-USDT\", \"side\": \"buy\", \"type\": \"limit\", \"lastId\": 254062248624417, \"limit\": 20, \"startAt\": 1728663338000, \"endAt\": 1728692138000}" + req := &GetClosedOrdersReq{} err := json.Unmarshal([]byte(data), req) req.ToMap() assert.Nil(t, err) } -func TestOrderCancelOrderByClientOidSyncRespModel(t *testing.T) { - // CancelOrderByClientOidSync - // Cancel Order By ClientOid Sync - // /api/v1/hf/orders/sync/client-order/{clientOid} +func TestOrderGetClosedOrdersRespModel(t *testing.T) { + // GetClosedOrders + // Get Closed Orders + // /api/v1/hf/orders/done - data := "{\n \"code\": \"200000\",\n \"data\": {\n \"clientOid\": \"5c52e11203aa677f33e493fb\",\n \"originSize\": \"0.00001\",\n \"dealSize\": \"0\",\n \"remainSize\": \"0\",\n \"canceledSize\": \"0.00001\",\n \"status\": \"done\"\n }\n}" + data := "{\n \"code\": \"200000\",\n \"data\": {\n \"lastId\": 19814995255305,\n \"items\": [\n {\n \"id\": \"6717422bd51c29000775ea03\",\n \"clientOid\": \"5c52e11203aa677f33e493fb\",\n \"symbol\": \"BTC-USDT\",\n \"opType\": \"DEAL\",\n \"type\": \"limit\",\n \"side\": \"buy\",\n \"price\": \"70000\",\n \"size\": \"0.00001\",\n \"funds\": \"0.7\",\n \"dealSize\": \"0.00001\",\n \"dealFunds\": \"0.677176\",\n \"remainSize\": \"0\",\n \"remainFunds\": \"0.022824\",\n \"cancelledSize\": \"0\",\n \"cancelledFunds\": \"0\",\n \"fee\": \"0.000677176\",\n \"feeCurrency\": \"USDT\",\n \"stp\": null,\n \"timeInForce\": \"GTC\",\n \"postOnly\": false,\n \"hidden\": false,\n \"iceberg\": false,\n \"visibleSize\": \"0\",\n \"cancelAfter\": 0,\n \"channel\": \"API\",\n \"remark\": \"order remarks\",\n \"tags\": null,\n \"cancelExist\": false,\n \"tradeType\": \"TRADE\",\n \"inOrderBook\": false,\n \"active\": false,\n \"tax\": \"0\",\n \"createdAt\": 1729577515444,\n \"lastUpdatedAt\": 1729577515481\n }\n ]\n }\n}" commonResp := &types.RestResponse{} err := json.Unmarshal([]byte(data), commonResp) assert.Nil(t, err) assert.NotNil(t, commonResp.Data) - resp := &CancelOrderByClientOidSyncResp{} + resp := &GetClosedOrdersResp{} err = json.Unmarshal([]byte(commonResp.Data), resp) resp.ToMap() assert.Nil(t, err) } -func TestOrderCancelOrderByOrderIdSyncReqModel(t *testing.T) { - // CancelOrderByOrderIdSync - // Cancel Order By OrderId Sync - // /api/v1/hf/orders/sync/{orderId} +func TestOrderGetTradeHistoryReqModel(t *testing.T) { + // GetTradeHistory + // Get Trade History + // /api/v1/hf/fills - data := "{\"orderId\": \"671128ee365ccb0007534d45\", \"symbol\": \"BTC-USDT\"}" - req := &CancelOrderByOrderIdSyncReq{} + data := "{\"symbol\": \"BTC-USDT\", \"orderId\": \"example_string_default_value\", \"side\": \"buy\", \"type\": \"limit\", \"lastId\": 254062248624417, \"limit\": 100, \"startAt\": 1728663338000, \"endAt\": 1728692138000}" + req := &GetTradeHistoryReq{} err := json.Unmarshal([]byte(data), req) req.ToMap() assert.Nil(t, err) } -func TestOrderCancelOrderByOrderIdSyncRespModel(t *testing.T) { - // CancelOrderByOrderIdSync - // Cancel Order By OrderId Sync - // /api/v1/hf/orders/sync/{orderId} +func TestOrderGetTradeHistoryRespModel(t *testing.T) { + // GetTradeHistory + // Get Trade History + // /api/v1/hf/fills - data := "{\n \"code\": \"200000\",\n \"data\": {\n \"orderId\": \"671128ee365ccb0007534d45\",\n \"originSize\": \"0.00001\",\n \"dealSize\": \"0\",\n \"remainSize\": \"0\",\n \"canceledSize\": \"0.00001\",\n \"status\": \"done\"\n }\n}" + data := "{\n \"code\": \"200000\",\n \"data\": {\n \"items\": [\n {\n \"id\": 19814995255305,\n \"orderId\": \"6717422bd51c29000775ea03\",\n \"counterOrderId\": \"67174228135f9e000709da8c\",\n \"tradeId\": 11029373945659392,\n \"symbol\": \"BTC-USDT\",\n \"side\": \"buy\",\n \"liquidity\": \"taker\",\n \"type\": \"limit\",\n \"forceTaker\": false,\n \"price\": \"67717.6\",\n \"size\": \"0.00001\",\n \"funds\": \"0.677176\",\n \"fee\": \"0.000677176\",\n \"feeRate\": \"0.001\",\n \"feeCurrency\": \"USDT\",\n \"stop\": \"\",\n \"tradeType\": \"TRADE\",\n \"taxRate\": \"0\",\n \"tax\": \"0\",\n \"createdAt\": 1729577515473\n }\n ],\n \"lastId\": 19814995255305\n }\n}" commonResp := &types.RestResponse{} err := json.Unmarshal([]byte(data), commonResp) assert.Nil(t, err) assert.NotNil(t, commonResp.Data) - resp := &CancelOrderByOrderIdSyncResp{} + resp := &GetTradeHistoryResp{} err = json.Unmarshal([]byte(commonResp.Data), resp) resp.ToMap() assert.Nil(t, err) } -func TestOrderAddOrderSyncReqModel(t *testing.T) { - // AddOrderSync - // Add Order Sync - // /api/v1/hf/orders/sync +func TestOrderGetDCPReqModel(t *testing.T) { + // GetDCP + // Get DCP + // /api/v1/hf/orders/dead-cancel-all/query - data := "{\"type\": \"limit\", \"symbol\": \"BTC-USDT\", \"side\": \"buy\", \"price\": \"50000\", \"size\": \"0.00001\", \"clientOid\": \"5c52e11203aa677f33e493f\", \"remark\": \"order remarks\"}" - req := &AddOrderSyncReq{} +} + +func TestOrderGetDCPRespModel(t *testing.T) { + // GetDCP + // Get DCP + // /api/v1/hf/orders/dead-cancel-all/query + + data := "{\n \"code\": \"200000\",\n \"data\": {\n \"timeout\": 5,\n \"symbols\": \"BTC-USDT,ETH-USDT\",\n \"currentTime\": 1729241305,\n \"triggerTime\": 1729241308\n }\n}" + commonResp := &types.RestResponse{} + err := json.Unmarshal([]byte(data), commonResp) + assert.Nil(t, err) + assert.NotNil(t, commonResp.Data) + resp := &GetDCPResp{} + err = json.Unmarshal([]byte(commonResp.Data), resp) + resp.ToMap() + assert.Nil(t, err) +} + +func TestOrderSetDCPReqModel(t *testing.T) { + // SetDCP + // Set DCP + // /api/v1/hf/orders/dead-cancel-all + + data := "{\"timeout\": 5, \"symbols\": \"BTC-USDT,ETH-USDT\"}" + req := &SetDCPReq{} err := json.Unmarshal([]byte(data), req) req.ToMap() assert.Nil(t, err) } -func TestOrderAddOrderSyncRespModel(t *testing.T) { - // AddOrderSync - // Add Order Sync - // /api/v1/hf/orders/sync +func TestOrderSetDCPRespModel(t *testing.T) { + // SetDCP + // Set DCP + // /api/v1/hf/orders/dead-cancel-all - data := "{\"code\":\"200000\",\"data\":{\"orderId\":\"67111a7cb7cbdf000703e1f6\",\"clientOid\":\"5c52e11203aa677f33e493f\",\"orderTime\":1729174140586,\"originSize\":\"0.00001\",\"dealSize\":\"0\",\"remainSize\":\"0.00001\",\"canceledSize\":\"0\",\"status\":\"open\",\"matchTime\":1729174140588}}" + data := "{\"code\":\"200000\",\"data\":{\"currentTime\":1729656588,\"triggerTime\":1729656593}}" commonResp := &types.RestResponse{} err := json.Unmarshal([]byte(data), commonResp) assert.Nil(t, err) assert.NotNil(t, commonResp.Data) - resp := &AddOrderSyncResp{} + resp := &SetDCPResp{} err = json.Unmarshal([]byte(commonResp.Data), resp) resp.ToMap() assert.Nil(t, err) } -func TestOrderAddOrderTestReqModel(t *testing.T) { - // AddOrderTest - // Add Order Test - // /api/v1/hf/orders/test +func TestOrderAddStopOrderReqModel(t *testing.T) { + // AddStopOrder + // Add Stop Order + // /api/v1/stop-order - data := "{\"type\": \"limit\", \"symbol\": \"BTC-USDT\", \"side\": \"buy\", \"price\": \"50000\", \"size\": \"0.00001\", \"clientOid\": \"5c52e11203aa677f33e493f\", \"remark\": \"order remarks\"}" - req := &AddOrderTestReq{} + data := "{\"type\": \"limit\", \"symbol\": \"BTC-USDT\", \"side\": \"buy\", \"price\": \"50000\", \"size\": \"0.00001\", \"clientOid\": \"5c52e11203aa677f33e493fb\", \"remark\": \"order remarks\"}" + req := &AddStopOrderReq{} err := json.Unmarshal([]byte(data), req) req.ToMap() assert.Nil(t, err) } -func TestOrderAddOrderTestRespModel(t *testing.T) { - // AddOrderTest - // Add Order Test - // /api/v1/hf/orders/test +func TestOrderAddStopOrderRespModel(t *testing.T) { + // AddStopOrder + // Add Stop Order + // /api/v1/stop-order data := "{\"code\":\"200000\",\"data\":{\"orderId\":\"670fd33bf9406e0007ab3945\",\"clientOid\":\"5c52e11203aa677f33e493fb\"}}" commonResp := &types.RestResponse{} err := json.Unmarshal([]byte(data), commonResp) assert.Nil(t, err) assert.NotNil(t, commonResp.Data) - resp := &AddOrderTestResp{} + resp := &AddStopOrderResp{} err = json.Unmarshal([]byte(commonResp.Data), resp) resp.ToMap() assert.Nil(t, err) } -func TestOrderGetRecentTradeHistoryOldReqModel(t *testing.T) { - // GetRecentTradeHistoryOld - // Get Recent Trade History - Old - // /api/v1/limit/fills +func TestOrderCancelStopOrderByClientOidReqModel(t *testing.T) { + // CancelStopOrderByClientOid + // Cancel Stop Order By ClientOid + // /api/v1/stop-order/cancelOrderByClientOid - data := "{\"currentPage\": 1, \"pageSize\": 50}" - req := &GetRecentTradeHistoryOldReq{} + data := "{\"symbol\": \"BTC-USDT\", \"clientOid\": \"689ff597f4414061aa819cc414836abd\"}" + req := &CancelStopOrderByClientOidReq{} err := json.Unmarshal([]byte(data), req) req.ToMap() assert.Nil(t, err) } -func TestOrderGetRecentTradeHistoryOldRespModel(t *testing.T) { - // GetRecentTradeHistoryOld - // Get Recent Trade History - Old - // /api/v1/limit/fills +func TestOrderCancelStopOrderByClientOidRespModel(t *testing.T) { + // CancelStopOrderByClientOid + // Cancel Stop Order By ClientOid + // /api/v1/stop-order/cancelOrderByClientOid - data := "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"symbol\": \"BTC-USDT\",\n \"tradeId\": \"11732720444522497\",\n \"orderId\": \"674aab24754b1e00077dbc69\",\n \"counterOrderId\": \"674aab1fb26bfb0007a18b67\",\n \"side\": \"buy\",\n \"liquidity\": \"taker\",\n \"forceTaker\": false,\n \"price\": \"96999.6\",\n \"size\": \"0.00001\",\n \"funds\": \"0.969996\",\n \"fee\": \"0.000969996\",\n \"feeRate\": \"0.001\",\n \"feeCurrency\": \"USDT\",\n \"stop\": \"\",\n \"tradeType\": \"TRADE\",\n \"type\": \"limit\",\n \"createdAt\": 1732946724082\n }\n ]\n}" + data := "{\n \"code\": \"200000\",\n \"data\": {\n \"cancelledOrderId\": \"vs8hoo8ksc8mario0035a74n\",\n \"clientOid\": \"689ff597f4414061aa819cc414836abd\"\n }\n}" commonResp := &types.RestResponse{} err := json.Unmarshal([]byte(data), commonResp) assert.Nil(t, err) assert.NotNil(t, commonResp.Data) - resp := &GetRecentTradeHistoryOldResp{} + resp := &CancelStopOrderByClientOidResp{} err = json.Unmarshal([]byte(commonResp.Data), resp) resp.ToMap() assert.Nil(t, err) } -func TestOrderGetRecentOrdersListOldReqModel(t *testing.T) { - // GetRecentOrdersListOld - // Get Recent Orders List - Old - // /api/v1/limit/orders +func TestOrderCancelStopOrderByOrderIdReqModel(t *testing.T) { + // CancelStopOrderByOrderId + // Cancel Stop Order By OrderId + // /api/v1/stop-order/{orderId} - data := "{\"currentPage\": 1, \"pageSize\": 50}" - req := &GetRecentOrdersListOldReq{} + data := "{\"orderId\": \"671124f9365ccb00073debd4\"}" + req := &CancelStopOrderByOrderIdReq{} err := json.Unmarshal([]byte(data), req) req.ToMap() assert.Nil(t, err) } -func TestOrderGetRecentOrdersListOldRespModel(t *testing.T) { - // GetRecentOrdersListOld - // Get Recent Orders List - Old - // /api/v1/limit/orders +func TestOrderCancelStopOrderByOrderIdRespModel(t *testing.T) { + // CancelStopOrderByOrderId + // Cancel Stop Order By OrderId + // /api/v1/stop-order/{orderId} - data := "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"id\": \"674a9a872033a50007e2790d\",\n \"symbol\": \"BTC-USDT\",\n \"opType\": \"DEAL\",\n \"type\": \"limit\",\n \"side\": \"buy\",\n \"price\": \"50000\",\n \"size\": \"0.00001\",\n \"funds\": \"0\",\n \"dealFunds\": \"0\",\n \"dealSize\": \"0\",\n \"fee\": \"0\",\n \"feeCurrency\": \"USDT\",\n \"stp\": \"\",\n \"stop\": \"\",\n \"stopTriggered\": false,\n \"stopPrice\": \"0\",\n \"timeInForce\": \"GTC\",\n \"postOnly\": false,\n \"hidden\": false,\n \"iceberg\": false,\n \"visibleSize\": \"0\",\n \"cancelAfter\": 0,\n \"channel\": \"API\",\n \"clientOid\": \"5c52e11203aa677f33e4923fb\",\n \"remark\": \"order remarks\",\n \"tags\": null,\n \"isActive\": false,\n \"cancelExist\": true,\n \"createdAt\": 1732942471752,\n \"tradeType\": \"TRADE\"\n }\n ]\n}" + data := "{\n \"code\": \"200000\",\n \"data\": {\n \"cancelledOrderIds\": [\n \"671124f9365ccb00073debd4\"\n ]\n }\n}" commonResp := &types.RestResponse{} err := json.Unmarshal([]byte(data), commonResp) assert.Nil(t, err) assert.NotNil(t, commonResp.Data) - resp := &GetRecentOrdersListOldResp{} + resp := &CancelStopOrderByOrderIdResp{} err = json.Unmarshal([]byte(commonResp.Data), resp) resp.ToMap() assert.Nil(t, err) } -func TestOrderCancelOrderByClientOidOldReqModel(t *testing.T) { - // CancelOrderByClientOidOld - // Cancel Order By ClientOid - Old - // /api/v1/order/client-order/{clientOid} +func TestOrderBatchCancelStopOrderReqModel(t *testing.T) { + // BatchCancelStopOrder + // Batch Cancel Stop Orders + // /api/v1/stop-order/cancel - data := "{\"symbol\": \"BTC-USDT\", \"clientOid\": \"5c52e11203aa677f33e4923fb\"}" - req := &CancelOrderByClientOidOldReq{} + data := "{\"symbol\": \"example_string_default_value\", \"tradeType\": \"example_string_default_value\", \"orderIds\": \"example_string_default_value\"}" + req := &BatchCancelStopOrderReq{} err := json.Unmarshal([]byte(data), req) req.ToMap() assert.Nil(t, err) } -func TestOrderCancelOrderByClientOidOldRespModel(t *testing.T) { - // CancelOrderByClientOidOld - // Cancel Order By ClientOid - Old - // /api/v1/order/client-order/{clientOid} +func TestOrderBatchCancelStopOrderRespModel(t *testing.T) { + // BatchCancelStopOrder + // Batch Cancel Stop Orders + // /api/v1/stop-order/cancel - data := "{\n \"code\": \"200000\",\n \"data\": {\n \"cancelledOrderId\": \"674a9a872033a50007e2790d\",\n \"clientOid\": \"5c52e11203aa677f33e4923fb\",\n \"cancelledOcoOrderIds\": null\n }\n}" + data := "{\n \"code\": \"200000\",\n \"data\": {\n \"cancelledOrderIds\": [\n \"671124f9365ccb00073debd4\"\n ]\n }\n}" commonResp := &types.RestResponse{} err := json.Unmarshal([]byte(data), commonResp) assert.Nil(t, err) assert.NotNil(t, commonResp.Data) - resp := &CancelOrderByClientOidOldResp{} + resp := &BatchCancelStopOrderResp{} err = json.Unmarshal([]byte(commonResp.Data), resp) resp.ToMap() assert.Nil(t, err) } -func TestOrderGetOrderByClientOidOldReqModel(t *testing.T) { - // GetOrderByClientOidOld - // Get Order By ClientOid - Old - // /api/v1/order/client-order/{clientOid} +func TestOrderGetStopOrdersListReqModel(t *testing.T) { + // GetStopOrdersList + // Get Stop Orders List + // /api/v1/stop-order - data := "{\"clientOid\": \"3d07008668054da6b3cb12e432c2b13a\"}" - req := &GetOrderByClientOidOldReq{} + data := "{\"symbol\": \"BTC-USDT\", \"orderId\": \"670fd33bf9406e0007ab3945\", \"newPrice\": \"30000\", \"newSize\": \"0.0001\"}" + req := &GetStopOrdersListReq{} err := json.Unmarshal([]byte(data), req) req.ToMap() assert.Nil(t, err) } -func TestOrderGetOrderByClientOidOldRespModel(t *testing.T) { - // GetOrderByClientOidOld - // Get Order By ClientOid - Old - // /api/v1/order/client-order/{clientOid} +func TestOrderGetStopOrdersListRespModel(t *testing.T) { + // GetStopOrdersList + // Get Stop Orders List + // /api/v1/stop-order - data := "{\n \"code\": \"200000\",\n \"data\": {\n \"id\": \"674a97dfef434f0007efc431\",\n \"symbol\": \"BTC-USDT\",\n \"opType\": \"DEAL\",\n \"type\": \"limit\",\n \"side\": \"buy\",\n \"price\": \"50000\",\n \"size\": \"0.0001\",\n \"funds\": \"0\",\n \"dealFunds\": \"0\",\n \"dealSize\": \"0\",\n \"fee\": \"0\",\n \"feeCurrency\": \"USDT\",\n \"stp\": \"\",\n \"stop\": \"\",\n \"stopTriggered\": false,\n \"stopPrice\": \"0\",\n \"timeInForce\": \"GTC\",\n \"postOnly\": false,\n \"hidden\": false,\n \"iceberg\": false,\n \"visibleSize\": \"0\",\n \"cancelAfter\": 0,\n \"channel\": \"API\",\n \"clientOid\": \"3d07008668054da6b3cb12e432c2b13a\",\n \"remark\": null,\n \"tags\": null,\n \"isActive\": false,\n \"cancelExist\": true,\n \"createdAt\": 1732941791518,\n \"tradeType\": \"TRADE\"\n }\n}" + data := "{\n \"code\": \"200000\",\n \"data\": {\n \"currentPage\": 1,\n \"pageSize\": 50,\n \"totalNum\": 1,\n \"totalPage\": 1,\n \"items\": [\n {\n \"id\": \"vs8hoo8kqjnklv4m0038lrfq\",\n \"symbol\": \"KCS-USDT\",\n \"userId\": \"60fe4956c43cbc0006562c2c\",\n \"status\": \"NEW\",\n \"type\": \"limit\",\n \"side\": \"buy\",\n \"price\": \"0.01000000000000000000\",\n \"size\": \"0.01000000000000000000\",\n \"funds\": null,\n \"stp\": null,\n \"timeInForce\": \"GTC\",\n \"cancelAfter\": -1,\n \"postOnly\": false,\n \"hidden\": false,\n \"iceberg\": false,\n \"visibleSize\": null,\n \"channel\": \"API\",\n \"clientOid\": \"404814a0fb4311eb9098acde48001122\",\n \"remark\": null,\n \"tags\": null,\n \"orderTime\": 1628755183702150100,\n \"domainId\": \"kucoin\",\n \"tradeSource\": \"USER\",\n \"tradeType\": \"TRADE\",\n \"feeCurrency\": \"USDT\",\n \"takerFeeRate\": \"0.00200000000000000000\",\n \"makerFeeRate\": \"0.00200000000000000000\",\n \"createdAt\": 1628755183704,\n \"stop\": \"loss\",\n \"stopTriggerTime\": null,\n \"stopPrice\": \"10.00000000000000000000\"\n }\n ]\n }\n}" commonResp := &types.RestResponse{} err := json.Unmarshal([]byte(data), commonResp) assert.Nil(t, err) assert.NotNil(t, commonResp.Data) - resp := &GetOrderByClientOidOldResp{} + resp := &GetStopOrdersListResp{} err = json.Unmarshal([]byte(commonResp.Data), resp) resp.ToMap() assert.Nil(t, err) } -func TestOrderBatchCancelOrderOldReqModel(t *testing.T) { - // BatchCancelOrderOld - // Batch Cancel Order - Old - // /api/v1/orders +func TestOrderGetStopOrderByOrderIdReqModel(t *testing.T) { + // GetStopOrderByOrderId + // Get Stop Order By OrderId + // /api/v1/stop-order/{orderId} - data := "{\"symbol\": \"BTC-USDT\", \"tradeType\": \"TRADE\"}" - req := &BatchCancelOrderOldReq{} + data := "{\"orderId\": \"example_string_default_value\"}" + req := &GetStopOrderByOrderIdReq{} err := json.Unmarshal([]byte(data), req) req.ToMap() assert.Nil(t, err) } -func TestOrderBatchCancelOrderOldRespModel(t *testing.T) { - // BatchCancelOrderOld - // Batch Cancel Order - Old - // /api/v1/orders +func TestOrderGetStopOrderByOrderIdRespModel(t *testing.T) { + // GetStopOrderByOrderId + // Get Stop Order By OrderId + // /api/v1/stop-order/{orderId} - data := "{\n \"code\": \"200000\",\n \"data\": {\n \"cancelledOrderIds\": [\n \"674a8635b38d120007709c0f\",\n \"674a8630439c100007d3bce1\"\n ]\n }\n}" + data := "{\n \"code\": \"200000\",\n \"data\": {\n \"id\": \"vs8hoo8q2ceshiue003b67c0\",\n \"symbol\": \"KCS-USDT\",\n \"userId\": \"60fe4956c43cbc0006562c2c\",\n \"status\": \"NEW\",\n \"type\": \"limit\",\n \"side\": \"buy\",\n \"price\": \"0.01000000000000000000\",\n \"size\": \"0.01000000000000000000\",\n \"funds\": null,\n \"stp\": null,\n \"timeInForce\": \"GTC\",\n \"cancelAfter\": -1,\n \"postOnly\": false,\n \"hidden\": false,\n \"iceberg\": false,\n \"visibleSize\": null,\n \"channel\": \"API\",\n \"clientOid\": \"40e0eb9efe6311eb8e58acde48001122\",\n \"remark\": null,\n \"tags\": null,\n \"orderTime\": 1629098781127530200,\n \"domainId\": \"kucoin\",\n \"tradeSource\": \"USER\",\n \"tradeType\": \"TRADE\",\n \"feeCurrency\": \"USDT\",\n \"takerFeeRate\": \"0.00200000000000000000\",\n \"makerFeeRate\": \"0.00200000000000000000\",\n \"createdAt\": 1629098781128,\n \"stop\": \"loss\",\n \"stopTriggerTime\": null,\n \"stopPrice\": \"10.00000000000000000000\"\n }\n}" commonResp := &types.RestResponse{} err := json.Unmarshal([]byte(data), commonResp) assert.Nil(t, err) assert.NotNil(t, commonResp.Data) - resp := &BatchCancelOrderOldResp{} + resp := &GetStopOrderByOrderIdResp{} err = json.Unmarshal([]byte(commonResp.Data), resp) resp.ToMap() assert.Nil(t, err) } -func TestOrderGetOrdersListOldReqModel(t *testing.T) { - // GetOrdersListOld - // Get Orders List - Old - // /api/v1/orders +func TestOrderGetStopOrderByClientOidReqModel(t *testing.T) { + // GetStopOrderByClientOid + // Get Stop Order By ClientOid + // /api/v1/stop-order/queryOrderByClientOid - data := "{\"symbol\": \"BTC-USDT\", \"status\": \"active\", \"side\": \"buy\", \"type\": \"limit\", \"tradeType\": \"TRADE\", \"startAt\": 123456, \"endAt\": 123456, \"currentPage\": 1, \"pageSize\": 50}" - req := &GetOrdersListOldReq{} + data := "{\"clientOid\": \"example_string_default_value\", \"symbol\": \"example_string_default_value\"}" + req := &GetStopOrderByClientOidReq{} err := json.Unmarshal([]byte(data), req) req.ToMap() assert.Nil(t, err) } -func TestOrderGetOrdersListOldRespModel(t *testing.T) { - // GetOrdersListOld - // Get Orders List - Old - // /api/v1/orders +func TestOrderGetStopOrderByClientOidRespModel(t *testing.T) { + // GetStopOrderByClientOid + // Get Stop Order By ClientOid + // /api/v1/stop-order/queryOrderByClientOid - data := "{\n \"code\": \"200000\",\n \"data\": {\n \"currentPage\": 1,\n \"pageSize\": 50,\n \"totalNum\": 1,\n \"totalPage\": 1,\n \"items\": [\n {\n \"id\": \"674a9a872033a50007e2790d\",\n \"symbol\": \"BTC-USDT\",\n \"opType\": \"DEAL\",\n \"type\": \"limit\",\n \"side\": \"buy\",\n \"price\": \"50000\",\n \"size\": \"0.00001\",\n \"funds\": \"0\",\n \"dealFunds\": \"0\",\n \"dealSize\": \"0\",\n \"fee\": \"0\",\n \"feeCurrency\": \"USDT\",\n \"stp\": \"\",\n \"stop\": \"\",\n \"stopTriggered\": false,\n \"stopPrice\": \"0\",\n \"timeInForce\": \"GTC\",\n \"postOnly\": false,\n \"hidden\": false,\n \"iceberg\": false,\n \"visibleSize\": \"0\",\n \"cancelAfter\": 0,\n \"channel\": \"API\",\n \"clientOid\": \"5c52e11203aa677f33e4923fb\",\n \"remark\": \"order remarks\",\n \"tags\": null,\n \"isActive\": false,\n \"cancelExist\": true,\n \"createdAt\": 1732942471752,\n \"tradeType\": \"TRADE\"\n }\n ]\n }\n}" + data := "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"id\": \"vs8hoo8os561f5np0032vngj\",\n \"symbol\": \"KCS-USDT\",\n \"userId\": \"60fe4956c43cbc0006562c2c\",\n \"status\": \"NEW\",\n \"type\": \"limit\",\n \"side\": \"buy\",\n \"price\": \"0.01000000000000000000\",\n \"size\": \"0.01000000000000000000\",\n \"funds\": null,\n \"stp\": null,\n \"timeInForce\": \"GTC\",\n \"cancelAfter\": -1,\n \"postOnly\": false,\n \"hidden\": false,\n \"iceberg\": false,\n \"visibleSize\": null,\n \"channel\": \"API\",\n \"clientOid\": \"2b700942b5db41cebe578cff48960e09\",\n \"remark\": null,\n \"tags\": null,\n \"orderTime\": 1629020492834532600,\n \"domainId\": \"kucoin\",\n \"tradeSource\": \"USER\",\n \"tradeType\": \"TRADE\",\n \"feeCurrency\": \"USDT\",\n \"takerFeeRate\": \"0.00200000000000000000\",\n \"makerFeeRate\": \"0.00200000000000000000\",\n \"createdAt\": 1629020492837,\n \"stop\": \"loss\",\n \"stopTriggerTime\": null,\n \"stopPrice\": \"1.00000000000000000000\"\n }\n ]\n}" commonResp := &types.RestResponse{} err := json.Unmarshal([]byte(data), commonResp) assert.Nil(t, err) assert.NotNil(t, commonResp.Data) - resp := &GetOrdersListOldResp{} + resp := &GetStopOrderByClientOidResp{} err = json.Unmarshal([]byte(commonResp.Data), resp) resp.ToMap() assert.Nil(t, err) } -func TestOrderBatchAddOrdersOldReqModel(t *testing.T) { - // BatchAddOrdersOld - // Batch Add Orders - Old - // /api/v1/orders/multi +func TestOrderAddOcoOrderReqModel(t *testing.T) { + // AddOcoOrder + // Add OCO Order + // /api/v3/oco/order - data := "{\"symbol\": \"BTC-USDT\", \"orderList\": [{\"clientOid\": \"3d07008668054da6b3cb12e432c2b13a\", \"side\": \"buy\", \"type\": \"limit\", \"price\": \"50000\", \"size\": \"0.0001\"}, {\"clientOid\": \"37245dbe6e134b5c97732bfb36cd4a9d\", \"side\": \"buy\", \"type\": \"limit\", \"price\": \"49999\", \"size\": \"0.0001\"}]}" - req := &BatchAddOrdersOldReq{} + data := "{\"symbol\": \"BTC-USDT\", \"side\": \"buy\", \"price\": \"94000\", \"size\": \"0.1\", \"clientOid\": \"5c52e11203aa67f1e493fb\", \"stopPrice\": \"98000\", \"limitPrice\": \"96000\", \"remark\": \"this is remark\", \"tradeType\": \"TRADE\"}" + req := &AddOcoOrderReq{} err := json.Unmarshal([]byte(data), req) req.ToMap() assert.Nil(t, err) } -func TestOrderBatchAddOrdersOldRespModel(t *testing.T) { - // BatchAddOrdersOld - // Batch Add Orders - Old - // /api/v1/orders/multi +func TestOrderAddOcoOrderRespModel(t *testing.T) { + // AddOcoOrder + // Add OCO Order + // /api/v3/oco/order - data := "{\n \"code\": \"200000\",\n \"data\": {\n \"data\": [\n {\n \"symbol\": \"BTC-USDT\",\n \"type\": \"limit\",\n \"side\": \"buy\",\n \"price\": \"50000\",\n \"size\": \"0.0001\",\n \"funds\": null,\n \"stp\": \"\",\n \"stop\": \"\",\n \"stopPrice\": null,\n \"timeInForce\": \"GTC\",\n \"cancelAfter\": 0,\n \"postOnly\": false,\n \"hidden\": false,\n \"iceberge\": false,\n \"iceberg\": false,\n \"visibleSize\": null,\n \"channel\": \"API\",\n \"id\": \"674a97dfef434f0007efc431\",\n \"status\": \"success\",\n \"failMsg\": null,\n \"clientOid\": \"3d07008668054da6b3cb12e432c2b13a\"\n },\n {\n \"symbol\": \"BTC-USDT\",\n \"type\": \"limit\",\n \"side\": \"buy\",\n \"price\": \"49999\",\n \"size\": \"0.0001\",\n \"funds\": null,\n \"stp\": \"\",\n \"stop\": \"\",\n \"stopPrice\": null,\n \"timeInForce\": \"GTC\",\n \"cancelAfter\": 0,\n \"postOnly\": false,\n \"hidden\": false,\n \"iceberge\": false,\n \"iceberg\": false,\n \"visibleSize\": null,\n \"channel\": \"API\",\n \"id\": \"674a97dffb378b00077b9c20\",\n \"status\": \"fail\",\n \"failMsg\": \"Balance insufficient!\",\n \"clientOid\": \"37245dbe6e134b5c97732bfb36cd4a9d\"\n }\n ]\n }\n}" + data := "{\"code\":\"200000\",\"data\":{\"orderId\":\"674c316e688dea0007c7b986\"}}" commonResp := &types.RestResponse{} err := json.Unmarshal([]byte(data), commonResp) assert.Nil(t, err) assert.NotNil(t, commonResp.Data) - resp := &BatchAddOrdersOldResp{} + resp := &AddOcoOrderResp{} err = json.Unmarshal([]byte(commonResp.Data), resp) resp.ToMap() assert.Nil(t, err) } -func TestOrderCancelOrderByOrderIdOldReqModel(t *testing.T) { - // CancelOrderByOrderIdOld - // Cancel Order By OrderId - Old - // /api/v1/orders/{orderId} +func TestOrderCancelOcoOrderByOrderIdReqModel(t *testing.T) { + // CancelOcoOrderByOrderId + // Cancel OCO Order By OrderId + // /api/v3/oco/order/{orderId} - data := "{\"symbol\": \"BTC-USDT\", \"orderId\": \"674a97dfef434f0007efc431\"}" - req := &CancelOrderByOrderIdOldReq{} + data := "{\"orderId\": \"674c316e688dea0007c7b986\"}" + req := &CancelOcoOrderByOrderIdReq{} err := json.Unmarshal([]byte(data), req) req.ToMap() assert.Nil(t, err) } -func TestOrderCancelOrderByOrderIdOldRespModel(t *testing.T) { - // CancelOrderByOrderIdOld - // Cancel Order By OrderId - Old - // /api/v1/orders/{orderId} +func TestOrderCancelOcoOrderByOrderIdRespModel(t *testing.T) { + // CancelOcoOrderByOrderId + // Cancel OCO Order By OrderId + // /api/v3/oco/order/{orderId} - data := "{\n \"code\": \"200000\",\n \"data\": {\n \"cancelledOrderIds\": [\n \"674a97dfef434f0007efc431\"\n ]\n }\n}" + data := "{\n \"code\": \"200000\",\n \"data\": {\n \"cancelledOrderIds\": [\n \"vs93gpqc6kkmkk57003gok16\",\n \"vs93gpqc6kkmkk57003gok17\"\n ]\n }\n}" commonResp := &types.RestResponse{} err := json.Unmarshal([]byte(data), commonResp) assert.Nil(t, err) assert.NotNil(t, commonResp.Data) - resp := &CancelOrderByOrderIdOldResp{} + resp := &CancelOcoOrderByOrderIdResp{} err = json.Unmarshal([]byte(commonResp.Data), resp) resp.ToMap() assert.Nil(t, err) } -func TestOrderGetOrderByOrderIdOldReqModel(t *testing.T) { - // GetOrderByOrderIdOld - // Get Order By OrderId - Old - // /api/v1/orders/{orderId} +func TestOrderCancelOcoOrderByClientOidReqModel(t *testing.T) { + // CancelOcoOrderByClientOid + // Cancel OCO Order By ClientOid + // /api/v3/oco/client-order/{clientOid} - data := "{\"orderId\": \"674a97dfef434f0007efc431\"}" - req := &GetOrderByOrderIdOldReq{} + data := "{\"clientOid\": \"5c52e11203aa67f1e493fb\"}" + req := &CancelOcoOrderByClientOidReq{} err := json.Unmarshal([]byte(data), req) req.ToMap() assert.Nil(t, err) } -func TestOrderGetOrderByOrderIdOldRespModel(t *testing.T) { - // GetOrderByOrderIdOld - // Get Order By OrderId - Old - // /api/v1/orders/{orderId} +func TestOrderCancelOcoOrderByClientOidRespModel(t *testing.T) { + // CancelOcoOrderByClientOid + // Cancel OCO Order By ClientOid + // /api/v3/oco/client-order/{clientOid} - data := "{\n \"code\": \"200000\",\n \"data\": {\n \"id\": \"674a97dfef434f0007efc431\",\n \"symbol\": \"BTC-USDT\",\n \"opType\": \"DEAL\",\n \"type\": \"limit\",\n \"side\": \"buy\",\n \"price\": \"50000\",\n \"size\": \"0.0001\",\n \"funds\": \"0\",\n \"dealFunds\": \"0\",\n \"dealSize\": \"0\",\n \"fee\": \"0\",\n \"feeCurrency\": \"USDT\",\n \"stp\": \"\",\n \"stop\": \"\",\n \"stopTriggered\": false,\n \"stopPrice\": \"0\",\n \"timeInForce\": \"GTC\",\n \"postOnly\": false,\n \"hidden\": false,\n \"iceberg\": false,\n \"visibleSize\": \"0\",\n \"cancelAfter\": 0,\n \"channel\": \"API\",\n \"clientOid\": \"3d07008668054da6b3cb12e432c2b13a\",\n \"remark\": null,\n \"tags\": null,\n \"isActive\": false,\n \"cancelExist\": true,\n \"createdAt\": 1732941791518,\n \"tradeType\": \"TRADE\"\n }\n}" + data := "{\n \"code\": \"200000\",\n \"data\": {\n \"cancelledOrderIds\": [\n \"vs93gpqc6r0mkk57003gok3h\",\n \"vs93gpqc6r0mkk57003gok3i\"\n ]\n }\n}" commonResp := &types.RestResponse{} err := json.Unmarshal([]byte(data), commonResp) assert.Nil(t, err) assert.NotNil(t, commonResp.Data) - resp := &GetOrderByOrderIdOldResp{} + resp := &CancelOcoOrderByClientOidResp{} err = json.Unmarshal([]byte(commonResp.Data), resp) resp.ToMap() assert.Nil(t, err) } -func TestOrderAddOrderOldReqModel(t *testing.T) { - // AddOrderOld - // Add Order - Old - // /api/v1/orders +func TestOrderBatchCancelOcoOrdersReqModel(t *testing.T) { + // BatchCancelOcoOrders + // Batch Cancel OCO Order + // /api/v3/oco/orders - data := "{\"type\": \"limit\", \"symbol\": \"BTC-USDT\", \"side\": \"buy\", \"price\": \"50000\", \"size\": \"0.00001\", \"clientOid\": \"5c52e11203aa677f33e493fb\", \"remark\": \"order remarks\"}" - req := &AddOrderOldReq{} + data := "{\"orderIds\": \"674c388172cf2800072ee746,674c38bdfd8300000795167e\", \"symbol\": \"BTC-USDT\"}" + req := &BatchCancelOcoOrdersReq{} err := json.Unmarshal([]byte(data), req) req.ToMap() assert.Nil(t, err) } -func TestOrderAddOrderOldRespModel(t *testing.T) { - // AddOrderOld - // Add Order - Old - // /api/v1/orders +func TestOrderBatchCancelOcoOrdersRespModel(t *testing.T) { + // BatchCancelOcoOrders + // Batch Cancel OCO Order + // /api/v3/oco/orders - data := "{\n \"code\": \"200000\",\n \"data\": {\n \"orderId\": \"674a8635b38d120007709c0f\"\n }\n}" + data := "{\n \"code\": \"200000\",\n \"data\": {\n \"cancelledOrderIds\": [\n \"vs93gpqc750mkk57003gok6i\",\n \"vs93gpqc750mkk57003gok6j\",\n \"vs93gpqc75c39p83003tnriu\",\n \"vs93gpqc75c39p83003tnriv\"\n ]\n }\n}" commonResp := &types.RestResponse{} err := json.Unmarshal([]byte(data), commonResp) assert.Nil(t, err) assert.NotNil(t, commonResp.Data) - resp := &AddOrderOldResp{} + resp := &BatchCancelOcoOrdersResp{} err = json.Unmarshal([]byte(commonResp.Data), resp) resp.ToMap() assert.Nil(t, err) } -func TestOrderAddOrderTestOldReqModel(t *testing.T) { - // AddOrderTestOld - // Add Order Test - Old - // /api/v1/orders/test +func TestOrderGetOcoOrderByOrderIdReqModel(t *testing.T) { + // GetOcoOrderByOrderId + // Get OCO Order By OrderId + // /api/v3/oco/order/{orderId} - data := "{\"type\": \"limit\", \"symbol\": \"BTC-USDT\", \"side\": \"buy\", \"price\": \"50000\", \"size\": \"0.00001\", \"clientOid\": \"5c52e11203aa677f33e493fb\", \"remark\": \"order remarks\"}" - req := &AddOrderTestOldReq{} + data := "{\"orderId\": \"674c3b6e688dea0007c7bab2\"}" + req := &GetOcoOrderByOrderIdReq{} err := json.Unmarshal([]byte(data), req) req.ToMap() assert.Nil(t, err) } -func TestOrderAddOrderTestOldRespModel(t *testing.T) { - // AddOrderTestOld - // Add Order Test - Old - // /api/v1/orders/test +func TestOrderGetOcoOrderByOrderIdRespModel(t *testing.T) { + // GetOcoOrderByOrderId + // Get OCO Order By OrderId + // /api/v3/oco/order/{orderId} - data := "{\n \"code\": \"200000\",\n \"data\": {\n \"orderId\": \"674a8776291d9e00074f1edf\"\n }\n}" + data := "{\n \"code\": \"200000\",\n \"data\": {\n \"orderId\": \"674c3b6e688dea0007c7bab2\",\n \"symbol\": \"BTC-USDT\",\n \"clientOid\": \"5c52e1203aa6f37f1e493fb\",\n \"orderTime\": 1733049198863,\n \"status\": \"NEW\"\n }\n}" commonResp := &types.RestResponse{} err := json.Unmarshal([]byte(data), commonResp) assert.Nil(t, err) assert.NotNil(t, commonResp.Data) - resp := &AddOrderTestOldResp{} + resp := &GetOcoOrderByOrderIdResp{} err = json.Unmarshal([]byte(commonResp.Data), resp) resp.ToMap() assert.Nil(t, err) } -func TestOrderBatchCancelStopOrderReqModel(t *testing.T) { - // BatchCancelStopOrder - // Batch Cancel Stop Orders - // /api/v1/stop-order/cancel +func TestOrderGetOcoOrderByClientOidReqModel(t *testing.T) { + // GetOcoOrderByClientOid + // Get OCO Order By ClientOid + // /api/v3/oco/client-order/{clientOid} - data := "{\"symbol\": \"example_string_default_value\", \"tradeType\": \"example_string_default_value\", \"orderIds\": \"example_string_default_value\"}" - req := &BatchCancelStopOrderReq{} + data := "{\"clientOid\": \"5c52e1203aa6f3g7f1e493fb\"}" + req := &GetOcoOrderByClientOidReq{} err := json.Unmarshal([]byte(data), req) req.ToMap() assert.Nil(t, err) } -func TestOrderBatchCancelStopOrderRespModel(t *testing.T) { - // BatchCancelStopOrder - // Batch Cancel Stop Orders - // /api/v1/stop-order/cancel +func TestOrderGetOcoOrderByClientOidRespModel(t *testing.T) { + // GetOcoOrderByClientOid + // Get OCO Order By ClientOid + // /api/v3/oco/client-order/{clientOid} - data := "{\n \"code\": \"200000\",\n \"data\": {\n \"cancelledOrderIds\": [\n \"671124f9365ccb00073debd4\"\n ]\n }\n}" + data := "{\n \"code\": \"200000\",\n \"data\": {\n \"orderId\": \"674c3cfa72cf2800072ee7ce\",\n \"symbol\": \"BTC-USDT\",\n \"clientOid\": \"5c52e1203aa6f3g7f1e493fb\",\n \"orderTime\": 1733049594803,\n \"status\": \"NEW\"\n }\n}" commonResp := &types.RestResponse{} err := json.Unmarshal([]byte(data), commonResp) assert.Nil(t, err) assert.NotNil(t, commonResp.Data) - resp := &BatchCancelStopOrderResp{} + resp := &GetOcoOrderByClientOidResp{} err = json.Unmarshal([]byte(commonResp.Data), resp) resp.ToMap() assert.Nil(t, err) } -func TestOrderCancelStopOrderByClientOidReqModel(t *testing.T) { - // CancelStopOrderByClientOid - // Cancel Stop Order By ClientOid - // /api/v1/stop-order/cancelOrderByClientOid +func TestOrderGetOcoOrderDetailByOrderIdReqModel(t *testing.T) { + // GetOcoOrderDetailByOrderId + // Get OCO Order Detail By OrderId + // /api/v3/oco/order/details/{orderId} - data := "{\"symbol\": \"BTC-USDT\", \"clientOid\": \"689ff597f4414061aa819cc414836abd\"}" - req := &CancelStopOrderByClientOidReq{} + data := "{\"orderId\": \"674c3b6e688dea0007c7bab2\"}" + req := &GetOcoOrderDetailByOrderIdReq{} err := json.Unmarshal([]byte(data), req) req.ToMap() assert.Nil(t, err) } -func TestOrderCancelStopOrderByClientOidRespModel(t *testing.T) { - // CancelStopOrderByClientOid - // Cancel Stop Order By ClientOid - // /api/v1/stop-order/cancelOrderByClientOid +func TestOrderGetOcoOrderDetailByOrderIdRespModel(t *testing.T) { + // GetOcoOrderDetailByOrderId + // Get OCO Order Detail By OrderId + // /api/v3/oco/order/details/{orderId} - data := "{\n \"code\": \"200000\",\n \"data\": {\n \"cancelledOrderId\": \"vs8hoo8ksc8mario0035a74n\",\n \"clientOid\": \"689ff597f4414061aa819cc414836abd\"\n }\n}" + data := "{\n \"code\": \"200000\",\n \"data\": {\n \"orderId\": \"674c3b6e688dea0007c7bab2\",\n \"symbol\": \"BTC-USDT\",\n \"clientOid\": \"5c52e1203aa6f37f1e493fb\",\n \"orderTime\": 1733049198863,\n \"status\": \"NEW\",\n \"orders\": [\n {\n \"id\": \"vs93gpqc7dn6h3fa003sfelj\",\n \"symbol\": \"BTC-USDT\",\n \"side\": \"buy\",\n \"price\": \"94000.00000000000000000000\",\n \"stopPrice\": \"94000.00000000000000000000\",\n \"size\": \"0.10000000000000000000\",\n \"status\": \"NEW\"\n },\n {\n \"id\": \"vs93gpqc7dn6h3fa003sfelk\",\n \"symbol\": \"BTC-USDT\",\n \"side\": \"buy\",\n \"price\": \"96000.00000000000000000000\",\n \"stopPrice\": \"98000.00000000000000000000\",\n \"size\": \"0.10000000000000000000\",\n \"status\": \"NEW\"\n }\n ]\n }\n}" commonResp := &types.RestResponse{} err := json.Unmarshal([]byte(data), commonResp) assert.Nil(t, err) assert.NotNil(t, commonResp.Data) - resp := &CancelStopOrderByClientOidResp{} + resp := &GetOcoOrderDetailByOrderIdResp{} err = json.Unmarshal([]byte(commonResp.Data), resp) resp.ToMap() assert.Nil(t, err) } -func TestOrderGetStopOrdersListReqModel(t *testing.T) { - // GetStopOrdersList - // Get Stop Orders List - // /api/v1/stop-order +func TestOrderGetOcoOrderListReqModel(t *testing.T) { + // GetOcoOrderList + // Get OCO Order List + // /api/v3/oco/orders - data := "{\"symbol\": \"BTC-USDT\", \"orderId\": \"670fd33bf9406e0007ab3945\", \"newPrice\": \"30000\", \"newSize\": \"0.0001\"}" - req := &GetStopOrdersListReq{} + data := "{\"symbol\": \"BTC-USDT\", \"startAt\": 123456, \"endAt\": 123456, \"orderIds\": \"example_string_default_value\", \"pageSize\": 50, \"currentPage\": 1}" + req := &GetOcoOrderListReq{} err := json.Unmarshal([]byte(data), req) req.ToMap() assert.Nil(t, err) } -func TestOrderGetStopOrdersListRespModel(t *testing.T) { - // GetStopOrdersList - // Get Stop Orders List - // /api/v1/stop-order +func TestOrderGetOcoOrderListRespModel(t *testing.T) { + // GetOcoOrderList + // Get OCO Order List + // /api/v3/oco/orders - data := "{\n \"code\": \"200000\",\n \"data\": {\n \"currentPage\": 1,\n \"pageSize\": 50,\n \"totalNum\": 1,\n \"totalPage\": 1,\n \"items\": [\n {\n \"id\": \"vs8hoo8kqjnklv4m0038lrfq\",\n \"symbol\": \"KCS-USDT\",\n \"userId\": \"60fe4956c43cbc0006562c2c\",\n \"status\": \"NEW\",\n \"type\": \"limit\",\n \"side\": \"buy\",\n \"price\": \"0.01000000000000000000\",\n \"size\": \"0.01000000000000000000\",\n \"funds\": null,\n \"stp\": null,\n \"timeInForce\": \"GTC\",\n \"cancelAfter\": -1,\n \"postOnly\": false,\n \"hidden\": false,\n \"iceberg\": false,\n \"visibleSize\": null,\n \"channel\": \"API\",\n \"clientOid\": \"404814a0fb4311eb9098acde48001122\",\n \"remark\": null,\n \"tags\": null,\n \"orderTime\": 1628755183702150100,\n \"domainId\": \"kucoin\",\n \"tradeSource\": \"USER\",\n \"tradeType\": \"TRADE\",\n \"feeCurrency\": \"USDT\",\n \"takerFeeRate\": \"0.00200000000000000000\",\n \"makerFeeRate\": \"0.00200000000000000000\",\n \"createdAt\": 1628755183704,\n \"stop\": \"loss\",\n \"stopTriggerTime\": null,\n \"stopPrice\": \"10.00000000000000000000\"\n }\n ]\n }\n}" + data := "{\n \"code\": \"200000\",\n \"data\": {\n \"currentPage\": 1,\n \"pageSize\": 50,\n \"totalNum\": 1,\n \"totalPage\": 1,\n \"items\": [\n {\n \"orderId\": \"674c3cfa72cf2800072ee7ce\",\n \"symbol\": \"BTC-USDT\",\n \"clientOid\": \"5c52e1203aa6f3g7f1e493fb\",\n \"orderTime\": 1733049594803,\n \"status\": \"NEW\"\n }\n ]\n }\n}" commonResp := &types.RestResponse{} err := json.Unmarshal([]byte(data), commonResp) assert.Nil(t, err) assert.NotNil(t, commonResp.Data) - resp := &GetStopOrdersListResp{} + resp := &GetOcoOrderListResp{} err = json.Unmarshal([]byte(commonResp.Data), resp) resp.ToMap() assert.Nil(t, err) } -func TestOrderCancelStopOrderByOrderIdReqModel(t *testing.T) { - // CancelStopOrderByOrderId - // Cancel Stop Order By OrderId - // /api/v1/stop-order/{orderId} +func TestOrderAddOrderOldReqModel(t *testing.T) { + // AddOrderOld + // Add Order - Old + // /api/v1/orders - data := "{\"orderId\": \"671124f9365ccb00073debd4\"}" - req := &CancelStopOrderByOrderIdReq{} + data := "{\"type\": \"limit\", \"symbol\": \"BTC-USDT\", \"side\": \"buy\", \"price\": \"50000\", \"size\": \"0.00001\", \"clientOid\": \"5c52e11203aa677f33e493fb\", \"remark\": \"order remarks\"}" + req := &AddOrderOldReq{} err := json.Unmarshal([]byte(data), req) req.ToMap() assert.Nil(t, err) } -func TestOrderCancelStopOrderByOrderIdRespModel(t *testing.T) { - // CancelStopOrderByOrderId - // Cancel Stop Order By OrderId - // /api/v1/stop-order/{orderId} +func TestOrderAddOrderOldRespModel(t *testing.T) { + // AddOrderOld + // Add Order - Old + // /api/v1/orders - data := "{\n \"code\": \"200000\",\n \"data\": {\n \"cancelledOrderIds\": [\n \"671124f9365ccb00073debd4\"\n ]\n }\n}" + data := "{\n \"code\": \"200000\",\n \"data\": {\n \"orderId\": \"674a8635b38d120007709c0f\"\n }\n}" commonResp := &types.RestResponse{} err := json.Unmarshal([]byte(data), commonResp) assert.Nil(t, err) assert.NotNil(t, commonResp.Data) - resp := &CancelStopOrderByOrderIdResp{} + resp := &AddOrderOldResp{} err = json.Unmarshal([]byte(commonResp.Data), resp) resp.ToMap() assert.Nil(t, err) } -func TestOrderGetStopOrderByOrderIdReqModel(t *testing.T) { - // GetStopOrderByOrderId - // Get Stop Order By OrderId - // /api/v1/stop-order/{orderId} +func TestOrderAddOrderTestOldReqModel(t *testing.T) { + // AddOrderTestOld + // Add Order Test - Old + // /api/v1/orders/test - data := "{\"orderId\": \"example_string_default_value\"}" - req := &GetStopOrderByOrderIdReq{} + data := "{\"type\": \"limit\", \"symbol\": \"BTC-USDT\", \"side\": \"buy\", \"price\": \"50000\", \"size\": \"0.00001\", \"clientOid\": \"5c52e11203aa677f33e493fb\", \"remark\": \"order remarks\"}" + req := &AddOrderTestOldReq{} err := json.Unmarshal([]byte(data), req) req.ToMap() assert.Nil(t, err) } -func TestOrderGetStopOrderByOrderIdRespModel(t *testing.T) { - // GetStopOrderByOrderId - // Get Stop Order By OrderId - // /api/v1/stop-order/{orderId} +func TestOrderAddOrderTestOldRespModel(t *testing.T) { + // AddOrderTestOld + // Add Order Test - Old + // /api/v1/orders/test - data := "{\n \"code\": \"200000\",\n \"data\": {\n \"id\": \"vs8hoo8q2ceshiue003b67c0\",\n \"symbol\": \"KCS-USDT\",\n \"userId\": \"60fe4956c43cbc0006562c2c\",\n \"status\": \"NEW\",\n \"type\": \"limit\",\n \"side\": \"buy\",\n \"price\": \"0.01000000000000000000\",\n \"size\": \"0.01000000000000000000\",\n \"funds\": null,\n \"stp\": null,\n \"timeInForce\": \"GTC\",\n \"cancelAfter\": -1,\n \"postOnly\": false,\n \"hidden\": false,\n \"iceberg\": false,\n \"visibleSize\": null,\n \"channel\": \"API\",\n \"clientOid\": \"40e0eb9efe6311eb8e58acde48001122\",\n \"remark\": null,\n \"tags\": null,\n \"orderTime\": 1629098781127530200,\n \"domainId\": \"kucoin\",\n \"tradeSource\": \"USER\",\n \"tradeType\": \"TRADE\",\n \"feeCurrency\": \"USDT\",\n \"takerFeeRate\": \"0.00200000000000000000\",\n \"makerFeeRate\": \"0.00200000000000000000\",\n \"createdAt\": 1629098781128,\n \"stop\": \"loss\",\n \"stopTriggerTime\": null,\n \"stopPrice\": \"10.00000000000000000000\"\n }\n}" + data := "{\n \"code\": \"200000\",\n \"data\": {\n \"orderId\": \"674a8776291d9e00074f1edf\"\n }\n}" commonResp := &types.RestResponse{} err := json.Unmarshal([]byte(data), commonResp) assert.Nil(t, err) assert.NotNil(t, commonResp.Data) - resp := &GetStopOrderByOrderIdResp{} + resp := &AddOrderTestOldResp{} err = json.Unmarshal([]byte(commonResp.Data), resp) resp.ToMap() assert.Nil(t, err) } -func TestOrderAddStopOrderReqModel(t *testing.T) { - // AddStopOrder - // Add Stop Order - // /api/v1/stop-order +func TestOrderBatchAddOrdersOldReqModel(t *testing.T) { + // BatchAddOrdersOld + // Batch Add Orders - Old + // /api/v1/orders/multi - data := "{\"type\": \"limit\", \"symbol\": \"BTC-USDT\", \"side\": \"buy\", \"price\": \"50000\", \"size\": \"0.00001\", \"clientOid\": \"5c52e11203aa677f33e493fb\", \"remark\": \"order remarks\"}" - req := &AddStopOrderReq{} + data := "{\"symbol\": \"BTC-USDT\", \"orderList\": [{\"clientOid\": \"3d07008668054da6b3cb12e432c2b13a\", \"side\": \"buy\", \"type\": \"limit\", \"price\": \"50000\", \"size\": \"0.0001\"}, {\"clientOid\": \"37245dbe6e134b5c97732bfb36cd4a9d\", \"side\": \"buy\", \"type\": \"limit\", \"price\": \"49999\", \"size\": \"0.0001\"}]}" + req := &BatchAddOrdersOldReq{} err := json.Unmarshal([]byte(data), req) req.ToMap() assert.Nil(t, err) } -func TestOrderAddStopOrderRespModel(t *testing.T) { - // AddStopOrder - // Add Stop Order - // /api/v1/stop-order +func TestOrderBatchAddOrdersOldRespModel(t *testing.T) { + // BatchAddOrdersOld + // Batch Add Orders - Old + // /api/v1/orders/multi - data := "{\"code\":\"200000\",\"data\":{\"orderId\":\"670fd33bf9406e0007ab3945\",\"clientOid\":\"5c52e11203aa677f33e493fb\"}}" + data := "{\n \"code\": \"200000\",\n \"data\": {\n \"data\": [\n {\n \"symbol\": \"BTC-USDT\",\n \"type\": \"limit\",\n \"side\": \"buy\",\n \"price\": \"50000\",\n \"size\": \"0.0001\",\n \"funds\": null,\n \"stp\": \"\",\n \"stop\": \"\",\n \"stopPrice\": null,\n \"timeInForce\": \"GTC\",\n \"cancelAfter\": 0,\n \"postOnly\": false,\n \"hidden\": false,\n \"iceberge\": false,\n \"iceberg\": false,\n \"visibleSize\": null,\n \"channel\": \"API\",\n \"id\": \"674a97dfef434f0007efc431\",\n \"status\": \"success\",\n \"failMsg\": null,\n \"clientOid\": \"3d07008668054da6b3cb12e432c2b13a\"\n },\n {\n \"symbol\": \"BTC-USDT\",\n \"type\": \"limit\",\n \"side\": \"buy\",\n \"price\": \"49999\",\n \"size\": \"0.0001\",\n \"funds\": null,\n \"stp\": \"\",\n \"stop\": \"\",\n \"stopPrice\": null,\n \"timeInForce\": \"GTC\",\n \"cancelAfter\": 0,\n \"postOnly\": false,\n \"hidden\": false,\n \"iceberge\": false,\n \"iceberg\": false,\n \"visibleSize\": null,\n \"channel\": \"API\",\n \"id\": \"674a97dffb378b00077b9c20\",\n \"status\": \"fail\",\n \"failMsg\": \"Balance insufficient!\",\n \"clientOid\": \"37245dbe6e134b5c97732bfb36cd4a9d\"\n }\n ]\n }\n}" commonResp := &types.RestResponse{} err := json.Unmarshal([]byte(data), commonResp) assert.Nil(t, err) assert.NotNil(t, commonResp.Data) - resp := &AddStopOrderResp{} + resp := &BatchAddOrdersOldResp{} err = json.Unmarshal([]byte(commonResp.Data), resp) resp.ToMap() assert.Nil(t, err) } -func TestOrderGetStopOrderByClientOidReqModel(t *testing.T) { - // GetStopOrderByClientOid - // Get Stop Order By ClientOid - // /api/v1/stop-order/queryOrderByClientOid +func TestOrderCancelOrderByOrderIdOldReqModel(t *testing.T) { + // CancelOrderByOrderIdOld + // Cancel Order By OrderId - Old + // /api/v1/orders/{orderId} - data := "{\"clientOid\": \"example_string_default_value\", \"symbol\": \"example_string_default_value\"}" - req := &GetStopOrderByClientOidReq{} + data := "{\"symbol\": \"BTC-USDT\", \"orderId\": \"674a97dfef434f0007efc431\"}" + req := &CancelOrderByOrderIdOldReq{} err := json.Unmarshal([]byte(data), req) req.ToMap() assert.Nil(t, err) } -func TestOrderGetStopOrderByClientOidRespModel(t *testing.T) { - // GetStopOrderByClientOid - // Get Stop Order By ClientOid - // /api/v1/stop-order/queryOrderByClientOid +func TestOrderCancelOrderByOrderIdOldRespModel(t *testing.T) { + // CancelOrderByOrderIdOld + // Cancel Order By OrderId - Old + // /api/v1/orders/{orderId} - data := "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"id\": \"vs8hoo8os561f5np0032vngj\",\n \"symbol\": \"KCS-USDT\",\n \"userId\": \"60fe4956c43cbc0006562c2c\",\n \"status\": \"NEW\",\n \"type\": \"limit\",\n \"side\": \"buy\",\n \"price\": \"0.01000000000000000000\",\n \"size\": \"0.01000000000000000000\",\n \"funds\": null,\n \"stp\": null,\n \"timeInForce\": \"GTC\",\n \"cancelAfter\": -1,\n \"postOnly\": false,\n \"hidden\": false,\n \"iceberg\": false,\n \"visibleSize\": null,\n \"channel\": \"API\",\n \"clientOid\": \"2b700942b5db41cebe578cff48960e09\",\n \"remark\": null,\n \"tags\": null,\n \"orderTime\": 1629020492834532600,\n \"domainId\": \"kucoin\",\n \"tradeSource\": \"USER\",\n \"tradeType\": \"TRADE\",\n \"feeCurrency\": \"USDT\",\n \"takerFeeRate\": \"0.00200000000000000000\",\n \"makerFeeRate\": \"0.00200000000000000000\",\n \"createdAt\": 1629020492837,\n \"stop\": \"loss\",\n \"stopTriggerTime\": null,\n \"stopPrice\": \"1.00000000000000000000\"\n }\n ]\n}" + data := "{\n \"code\": \"200000\",\n \"data\": {\n \"cancelledOrderIds\": [\n \"674a97dfef434f0007efc431\"\n ]\n }\n}" commonResp := &types.RestResponse{} err := json.Unmarshal([]byte(data), commonResp) assert.Nil(t, err) assert.NotNil(t, commonResp.Data) - resp := &GetStopOrderByClientOidResp{} + resp := &CancelOrderByOrderIdOldResp{} err = json.Unmarshal([]byte(commonResp.Data), resp) resp.ToMap() assert.Nil(t, err) } -func TestOrderCancelOcoOrderByClientOidReqModel(t *testing.T) { - // CancelOcoOrderByClientOid - // Cancel OCO Order By ClientOid - // /api/v3/oco/client-order/{clientOid} +func TestOrderCancelOrderByClientOidOldReqModel(t *testing.T) { + // CancelOrderByClientOidOld + // Cancel Order By ClientOid - Old + // /api/v1/order/client-order/{clientOid} - data := "{\"clientOid\": \"5c52e11203aa67f1e493fb\"}" - req := &CancelOcoOrderByClientOidReq{} + data := "{\"symbol\": \"BTC-USDT\", \"clientOid\": \"5c52e11203aa677f33e4923fb\"}" + req := &CancelOrderByClientOidOldReq{} err := json.Unmarshal([]byte(data), req) req.ToMap() assert.Nil(t, err) } -func TestOrderCancelOcoOrderByClientOidRespModel(t *testing.T) { - // CancelOcoOrderByClientOid - // Cancel OCO Order By ClientOid - // /api/v3/oco/client-order/{clientOid} +func TestOrderCancelOrderByClientOidOldRespModel(t *testing.T) { + // CancelOrderByClientOidOld + // Cancel Order By ClientOid - Old + // /api/v1/order/client-order/{clientOid} - data := "{\n \"code\": \"200000\",\n \"data\": {\n \"cancelledOrderIds\": [\n \"vs93gpqc6r0mkk57003gok3h\",\n \"vs93gpqc6r0mkk57003gok3i\"\n ]\n }\n}" + data := "{\n \"code\": \"200000\",\n \"data\": {\n \"cancelledOrderId\": \"674a9a872033a50007e2790d\",\n \"clientOid\": \"5c52e11203aa677f33e4923fb\",\n \"cancelledOcoOrderIds\": null\n }\n}" commonResp := &types.RestResponse{} err := json.Unmarshal([]byte(data), commonResp) assert.Nil(t, err) assert.NotNil(t, commonResp.Data) - resp := &CancelOcoOrderByClientOidResp{} + resp := &CancelOrderByClientOidOldResp{} err = json.Unmarshal([]byte(commonResp.Data), resp) resp.ToMap() assert.Nil(t, err) } -func TestOrderGetOcoOrderByClientOidReqModel(t *testing.T) { - // GetOcoOrderByClientOid - // Get OCO Order By ClientOid - // /api/v3/oco/client-order/{clientOid} +func TestOrderBatchCancelOrderOldReqModel(t *testing.T) { + // BatchCancelOrderOld + // Batch Cancel Order - Old + // /api/v1/orders - data := "{\"clientOid\": \"5c52e1203aa6f3g7f1e493fb\"}" - req := &GetOcoOrderByClientOidReq{} + data := "{\"symbol\": \"BTC-USDT\", \"tradeType\": \"TRADE\"}" + req := &BatchCancelOrderOldReq{} err := json.Unmarshal([]byte(data), req) req.ToMap() assert.Nil(t, err) } -func TestOrderGetOcoOrderByClientOidRespModel(t *testing.T) { - // GetOcoOrderByClientOid - // Get OCO Order By ClientOid - // /api/v3/oco/client-order/{clientOid} +func TestOrderBatchCancelOrderOldRespModel(t *testing.T) { + // BatchCancelOrderOld + // Batch Cancel Order - Old + // /api/v1/orders - data := "{\n \"code\": \"200000\",\n \"data\": {\n \"orderId\": \"674c3cfa72cf2800072ee7ce\",\n \"symbol\": \"BTC-USDT\",\n \"clientOid\": \"5c52e1203aa6f3g7f1e493fb\",\n \"orderTime\": 1733049594803,\n \"status\": \"NEW\"\n }\n}" + data := "{\n \"code\": \"200000\",\n \"data\": {\n \"cancelledOrderIds\": [\n \"674a8635b38d120007709c0f\",\n \"674a8630439c100007d3bce1\"\n ]\n }\n}" commonResp := &types.RestResponse{} err := json.Unmarshal([]byte(data), commonResp) assert.Nil(t, err) assert.NotNil(t, commonResp.Data) - resp := &GetOcoOrderByClientOidResp{} + resp := &BatchCancelOrderOldResp{} err = json.Unmarshal([]byte(commonResp.Data), resp) resp.ToMap() assert.Nil(t, err) } -func TestOrderGetOcoOrderDetailByOrderIdReqModel(t *testing.T) { - // GetOcoOrderDetailByOrderId - // Get OCO Order Detail By OrderId - // /api/v3/oco/order/details/{orderId} +func TestOrderGetOrdersListOldReqModel(t *testing.T) { + // GetOrdersListOld + // Get Orders List - Old + // /api/v1/orders - data := "{\"orderId\": \"674c3b6e688dea0007c7bab2\"}" - req := &GetOcoOrderDetailByOrderIdReq{} + data := "{\"symbol\": \"BTC-USDT\", \"status\": \"active\", \"side\": \"buy\", \"type\": \"limit\", \"tradeType\": \"TRADE\", \"startAt\": 123456, \"endAt\": 123456, \"currentPage\": 1, \"pageSize\": 50}" + req := &GetOrdersListOldReq{} err := json.Unmarshal([]byte(data), req) req.ToMap() assert.Nil(t, err) } -func TestOrderGetOcoOrderDetailByOrderIdRespModel(t *testing.T) { - // GetOcoOrderDetailByOrderId - // Get OCO Order Detail By OrderId - // /api/v3/oco/order/details/{orderId} +func TestOrderGetOrdersListOldRespModel(t *testing.T) { + // GetOrdersListOld + // Get Orders List - Old + // /api/v1/orders - data := "{\n \"code\": \"200000\",\n \"data\": {\n \"orderId\": \"674c3b6e688dea0007c7bab2\",\n \"symbol\": \"BTC-USDT\",\n \"clientOid\": \"5c52e1203aa6f37f1e493fb\",\n \"orderTime\": 1733049198863,\n \"status\": \"NEW\",\n \"orders\": [\n {\n \"id\": \"vs93gpqc7dn6h3fa003sfelj\",\n \"symbol\": \"BTC-USDT\",\n \"side\": \"buy\",\n \"price\": \"94000.00000000000000000000\",\n \"stopPrice\": \"94000.00000000000000000000\",\n \"size\": \"0.10000000000000000000\",\n \"status\": \"NEW\"\n },\n {\n \"id\": \"vs93gpqc7dn6h3fa003sfelk\",\n \"symbol\": \"BTC-USDT\",\n \"side\": \"buy\",\n \"price\": \"96000.00000000000000000000\",\n \"stopPrice\": \"98000.00000000000000000000\",\n \"size\": \"0.10000000000000000000\",\n \"status\": \"NEW\"\n }\n ]\n }\n}" + data := "{\n \"code\": \"200000\",\n \"data\": {\n \"currentPage\": 1,\n \"pageSize\": 50,\n \"totalNum\": 1,\n \"totalPage\": 1,\n \"items\": [\n {\n \"id\": \"674a9a872033a50007e2790d\",\n \"symbol\": \"BTC-USDT\",\n \"opType\": \"DEAL\",\n \"type\": \"limit\",\n \"side\": \"buy\",\n \"price\": \"50000\",\n \"size\": \"0.00001\",\n \"funds\": \"0\",\n \"dealFunds\": \"0\",\n \"dealSize\": \"0\",\n \"fee\": \"0\",\n \"feeCurrency\": \"USDT\",\n \"stp\": \"\",\n \"stop\": \"\",\n \"stopTriggered\": false,\n \"stopPrice\": \"0\",\n \"timeInForce\": \"GTC\",\n \"postOnly\": false,\n \"hidden\": false,\n \"iceberg\": false,\n \"visibleSize\": \"0\",\n \"cancelAfter\": 0,\n \"channel\": \"API\",\n \"clientOid\": \"5c52e11203aa677f33e4923fb\",\n \"remark\": \"order remarks\",\n \"tags\": null,\n \"isActive\": false,\n \"cancelExist\": true,\n \"createdAt\": 1732942471752,\n \"tradeType\": \"TRADE\"\n }\n ]\n }\n}" commonResp := &types.RestResponse{} err := json.Unmarshal([]byte(data), commonResp) assert.Nil(t, err) assert.NotNil(t, commonResp.Data) - resp := &GetOcoOrderDetailByOrderIdResp{} + resp := &GetOrdersListOldResp{} err = json.Unmarshal([]byte(commonResp.Data), resp) resp.ToMap() assert.Nil(t, err) } -func TestOrderCancelOcoOrderByOrderIdReqModel(t *testing.T) { - // CancelOcoOrderByOrderId - // Cancel OCO Order By OrderId - // /api/v3/oco/order/{orderId} +func TestOrderGetRecentOrdersListOldReqModel(t *testing.T) { + // GetRecentOrdersListOld + // Get Recent Orders List - Old + // /api/v1/limit/orders - data := "{\"orderId\": \"674c316e688dea0007c7b986\"}" - req := &CancelOcoOrderByOrderIdReq{} + data := "{\"currentPage\": 1, \"pageSize\": 50}" + req := &GetRecentOrdersListOldReq{} err := json.Unmarshal([]byte(data), req) req.ToMap() assert.Nil(t, err) } -func TestOrderCancelOcoOrderByOrderIdRespModel(t *testing.T) { - // CancelOcoOrderByOrderId - // Cancel OCO Order By OrderId - // /api/v3/oco/order/{orderId} +func TestOrderGetRecentOrdersListOldRespModel(t *testing.T) { + // GetRecentOrdersListOld + // Get Recent Orders List - Old + // /api/v1/limit/orders - data := "{\n \"code\": \"200000\",\n \"data\": {\n \"cancelledOrderIds\": [\n \"vs93gpqc6kkmkk57003gok16\",\n \"vs93gpqc6kkmkk57003gok17\"\n ]\n }\n}" + data := "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"id\": \"674a9a872033a50007e2790d\",\n \"symbol\": \"BTC-USDT\",\n \"opType\": \"DEAL\",\n \"type\": \"limit\",\n \"side\": \"buy\",\n \"price\": \"50000\",\n \"size\": \"0.00001\",\n \"funds\": \"0\",\n \"dealFunds\": \"0\",\n \"dealSize\": \"0\",\n \"fee\": \"0\",\n \"feeCurrency\": \"USDT\",\n \"stp\": \"\",\n \"stop\": \"\",\n \"stopTriggered\": false,\n \"stopPrice\": \"0\",\n \"timeInForce\": \"GTC\",\n \"postOnly\": false,\n \"hidden\": false,\n \"iceberg\": false,\n \"visibleSize\": \"0\",\n \"cancelAfter\": 0,\n \"channel\": \"API\",\n \"clientOid\": \"5c52e11203aa677f33e4923fb\",\n \"remark\": \"order remarks\",\n \"tags\": null,\n \"isActive\": false,\n \"cancelExist\": true,\n \"createdAt\": 1732942471752,\n \"tradeType\": \"TRADE\"\n }\n ]\n}" commonResp := &types.RestResponse{} err := json.Unmarshal([]byte(data), commonResp) assert.Nil(t, err) assert.NotNil(t, commonResp.Data) - resp := &CancelOcoOrderByOrderIdResp{} + resp := &GetRecentOrdersListOldResp{} err = json.Unmarshal([]byte(commonResp.Data), resp) resp.ToMap() assert.Nil(t, err) } -func TestOrderGetOcoOrderByOrderIdReqModel(t *testing.T) { - // GetOcoOrderByOrderId - // Get OCO Order By OrderId - // /api/v3/oco/order/{orderId} +func TestOrderGetOrderByOrderIdOldReqModel(t *testing.T) { + // GetOrderByOrderIdOld + // Get Order By OrderId - Old + // /api/v1/orders/{orderId} - data := "{\"orderId\": \"674c3b6e688dea0007c7bab2\"}" - req := &GetOcoOrderByOrderIdReq{} + data := "{\"orderId\": \"674a97dfef434f0007efc431\"}" + req := &GetOrderByOrderIdOldReq{} err := json.Unmarshal([]byte(data), req) req.ToMap() assert.Nil(t, err) } -func TestOrderGetOcoOrderByOrderIdRespModel(t *testing.T) { - // GetOcoOrderByOrderId - // Get OCO Order By OrderId - // /api/v3/oco/order/{orderId} +func TestOrderGetOrderByOrderIdOldRespModel(t *testing.T) { + // GetOrderByOrderIdOld + // Get Order By OrderId - Old + // /api/v1/orders/{orderId} - data := "{\n \"code\": \"200000\",\n \"data\": {\n \"orderId\": \"674c3b6e688dea0007c7bab2\",\n \"symbol\": \"BTC-USDT\",\n \"clientOid\": \"5c52e1203aa6f37f1e493fb\",\n \"orderTime\": 1733049198863,\n \"status\": \"NEW\"\n }\n}" + data := "{\n \"code\": \"200000\",\n \"data\": {\n \"id\": \"674a97dfef434f0007efc431\",\n \"symbol\": \"BTC-USDT\",\n \"opType\": \"DEAL\",\n \"type\": \"limit\",\n \"side\": \"buy\",\n \"price\": \"50000\",\n \"size\": \"0.0001\",\n \"funds\": \"0\",\n \"dealFunds\": \"0\",\n \"dealSize\": \"0\",\n \"fee\": \"0\",\n \"feeCurrency\": \"USDT\",\n \"stp\": \"\",\n \"stop\": \"\",\n \"stopTriggered\": false,\n \"stopPrice\": \"0\",\n \"timeInForce\": \"GTC\",\n \"postOnly\": false,\n \"hidden\": false,\n \"iceberg\": false,\n \"visibleSize\": \"0\",\n \"cancelAfter\": 0,\n \"channel\": \"API\",\n \"clientOid\": \"3d07008668054da6b3cb12e432c2b13a\",\n \"remark\": null,\n \"tags\": null,\n \"isActive\": false,\n \"cancelExist\": true,\n \"createdAt\": 1732941791518,\n \"tradeType\": \"TRADE\"\n }\n}" commonResp := &types.RestResponse{} err := json.Unmarshal([]byte(data), commonResp) assert.Nil(t, err) assert.NotNil(t, commonResp.Data) - resp := &GetOcoOrderByOrderIdResp{} + resp := &GetOrderByOrderIdOldResp{} err = json.Unmarshal([]byte(commonResp.Data), resp) resp.ToMap() assert.Nil(t, err) } -func TestOrderAddOcoOrderReqModel(t *testing.T) { - // AddOcoOrder - // Add OCO Order - // /api/v3/oco/order +func TestOrderGetOrderByClientOidOldReqModel(t *testing.T) { + // GetOrderByClientOidOld + // Get Order By ClientOid - Old + // /api/v1/order/client-order/{clientOid} - data := "{\"symbol\": \"BTC-USDT\", \"side\": \"buy\", \"price\": \"94000\", \"size\": \"0.1\", \"clientOid\": \"5c52e11203aa67f1e493fb\", \"stopPrice\": \"98000\", \"limitPrice\": \"96000\", \"remark\": \"this is remark\", \"tradeType\": \"TRADE\"}" - req := &AddOcoOrderReq{} + data := "{\"clientOid\": \"3d07008668054da6b3cb12e432c2b13a\"}" + req := &GetOrderByClientOidOldReq{} err := json.Unmarshal([]byte(data), req) req.ToMap() assert.Nil(t, err) } -func TestOrderAddOcoOrderRespModel(t *testing.T) { - // AddOcoOrder - // Add OCO Order - // /api/v3/oco/order +func TestOrderGetOrderByClientOidOldRespModel(t *testing.T) { + // GetOrderByClientOidOld + // Get Order By ClientOid - Old + // /api/v1/order/client-order/{clientOid} - data := "{\"code\":\"200000\",\"data\":{\"orderId\":\"674c316e688dea0007c7b986\"}}" + data := "{\n \"code\": \"200000\",\n \"data\": {\n \"id\": \"674a97dfef434f0007efc431\",\n \"symbol\": \"BTC-USDT\",\n \"opType\": \"DEAL\",\n \"type\": \"limit\",\n \"side\": \"buy\",\n \"price\": \"50000\",\n \"size\": \"0.0001\",\n \"funds\": \"0\",\n \"dealFunds\": \"0\",\n \"dealSize\": \"0\",\n \"fee\": \"0\",\n \"feeCurrency\": \"USDT\",\n \"stp\": \"\",\n \"stop\": \"\",\n \"stopTriggered\": false,\n \"stopPrice\": \"0\",\n \"timeInForce\": \"GTC\",\n \"postOnly\": false,\n \"hidden\": false,\n \"iceberg\": false,\n \"visibleSize\": \"0\",\n \"cancelAfter\": 0,\n \"channel\": \"API\",\n \"clientOid\": \"3d07008668054da6b3cb12e432c2b13a\",\n \"remark\": null,\n \"tags\": null,\n \"isActive\": false,\n \"cancelExist\": true,\n \"createdAt\": 1732941791518,\n \"tradeType\": \"TRADE\"\n }\n}" commonResp := &types.RestResponse{} err := json.Unmarshal([]byte(data), commonResp) assert.Nil(t, err) assert.NotNil(t, commonResp.Data) - resp := &AddOcoOrderResp{} + resp := &GetOrderByClientOidOldResp{} err = json.Unmarshal([]byte(commonResp.Data), resp) resp.ToMap() assert.Nil(t, err) } -func TestOrderBatchCancelOcoOrdersReqModel(t *testing.T) { - // BatchCancelOcoOrders - // Batch Cancel OCO Order - // /api/v3/oco/orders +func TestOrderGetTradeHistoryOldReqModel(t *testing.T) { + // GetTradeHistoryOld + // Get Trade History - Old + // /api/v1/fills - data := "{\"orderIds\": \"674c388172cf2800072ee746,674c38bdfd8300000795167e\", \"symbol\": \"BTC-USDT\"}" - req := &BatchCancelOcoOrdersReq{} + data := "{\"symbol\": \"BTC-USDT\", \"orderId\": \"example_string_default_value\", \"side\": \"buy\", \"type\": \"limit\", \"tradeType\": \"TRADE\", \"startAt\": 1728663338000, \"endAt\": 1728692138000, \"currentPage\": 1, \"pageSize\": 50}" + req := &GetTradeHistoryOldReq{} err := json.Unmarshal([]byte(data), req) req.ToMap() assert.Nil(t, err) } -func TestOrderBatchCancelOcoOrdersRespModel(t *testing.T) { - // BatchCancelOcoOrders - // Batch Cancel OCO Order - // /api/v3/oco/orders +func TestOrderGetTradeHistoryOldRespModel(t *testing.T) { + // GetTradeHistoryOld + // Get Trade History - Old + // /api/v1/fills - data := "{\n \"code\": \"200000\",\n \"data\": {\n \"cancelledOrderIds\": [\n \"vs93gpqc750mkk57003gok6i\",\n \"vs93gpqc750mkk57003gok6j\",\n \"vs93gpqc75c39p83003tnriu\",\n \"vs93gpqc75c39p83003tnriv\"\n ]\n }\n}" + data := "{\n \"code\": \"200000\",\n \"data\": {\n \"currentPage\": 1,\n \"pageSize\": 50,\n \"totalNum\": 1,\n \"totalPage\": 1,\n \"items\": [\n {\n \"symbol\": \"DOGE-USDT\",\n \"tradeId\": \"10862827223795713\",\n \"orderId\": \"6745698ef4f1200007c561a8\",\n \"counterOrderId\": \"6745695ef15b270007ac5076\",\n \"side\": \"buy\",\n \"liquidity\": \"taker\",\n \"forceTaker\": false,\n \"price\": \"0.40739\",\n \"size\": \"10\",\n \"funds\": \"4.0739\",\n \"fee\": \"0.0040739\",\n \"feeRate\": \"0.001\",\n \"feeCurrency\": \"USDT\",\n \"stop\": \"\",\n \"tradeType\": \"TRADE\",\n \"type\": \"market\",\n \"createdAt\": 1732602254928\n }\n ]\n }\n}" commonResp := &types.RestResponse{} err := json.Unmarshal([]byte(data), commonResp) assert.Nil(t, err) assert.NotNil(t, commonResp.Data) - resp := &BatchCancelOcoOrdersResp{} + resp := &GetTradeHistoryOldResp{} err = json.Unmarshal([]byte(commonResp.Data), resp) resp.ToMap() assert.Nil(t, err) } -func TestOrderGetOcoOrderListReqModel(t *testing.T) { - // GetOcoOrderList - // Get OCO Order List - // /api/v3/oco/orders +func TestOrderGetRecentTradeHistoryOldReqModel(t *testing.T) { + // GetRecentTradeHistoryOld + // Get Recent Trade History - Old + // /api/v1/limit/fills - data := "{\"symbol\": \"BTC-USDT\", \"startAt\": 123456, \"endAt\": 123456, \"orderIds\": \"example_string_default_value\", \"pageSize\": 50, \"currentPage\": 1}" - req := &GetOcoOrderListReq{} + data := "{\"currentPage\": 1, \"pageSize\": 50}" + req := &GetRecentTradeHistoryOldReq{} err := json.Unmarshal([]byte(data), req) req.ToMap() assert.Nil(t, err) } -func TestOrderGetOcoOrderListRespModel(t *testing.T) { - // GetOcoOrderList - // Get OCO Order List - // /api/v3/oco/orders +func TestOrderGetRecentTradeHistoryOldRespModel(t *testing.T) { + // GetRecentTradeHistoryOld + // Get Recent Trade History - Old + // /api/v1/limit/fills - data := "{\n \"code\": \"200000\",\n \"data\": {\n \"currentPage\": 1,\n \"pageSize\": 50,\n \"totalNum\": 1,\n \"totalPage\": 1,\n \"items\": [\n {\n \"orderId\": \"674c3cfa72cf2800072ee7ce\",\n \"symbol\": \"BTC-USDT\",\n \"clientOid\": \"5c52e1203aa6f3g7f1e493fb\",\n \"orderTime\": 1733049594803,\n \"status\": \"NEW\"\n }\n ]\n }\n}" + data := "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"symbol\": \"BTC-USDT\",\n \"tradeId\": \"11732720444522497\",\n \"orderId\": \"674aab24754b1e00077dbc69\",\n \"counterOrderId\": \"674aab1fb26bfb0007a18b67\",\n \"side\": \"buy\",\n \"liquidity\": \"taker\",\n \"forceTaker\": false,\n \"price\": \"96999.6\",\n \"size\": \"0.00001\",\n \"funds\": \"0.969996\",\n \"fee\": \"0.000969996\",\n \"feeRate\": \"0.001\",\n \"feeCurrency\": \"USDT\",\n \"stop\": \"\",\n \"tradeType\": \"TRADE\",\n \"type\": \"limit\",\n \"createdAt\": 1732946724082\n }\n ]\n}" commonResp := &types.RestResponse{} err := json.Unmarshal([]byte(data), commonResp) assert.Nil(t, err) assert.NotNil(t, commonResp.Data) - resp := &GetOcoOrderListResp{} + resp := &GetRecentTradeHistoryOldResp{} err = json.Unmarshal([]byte(commonResp.Data), resp) resp.ToMap() assert.Nil(t, err) diff --git a/sdk/golang/pkg/generate/viplending/viplending/api_vip_lending.go b/sdk/golang/pkg/generate/viplending/viplending/api_vip_lending.go index 2b76162a..13f6c439 100644 --- a/sdk/golang/pkg/generate/viplending/viplending/api_vip_lending.go +++ b/sdk/golang/pkg/generate/viplending/viplending/api_vip_lending.go @@ -9,9 +9,9 @@ import ( type VIPLendingAPI interface { - // GetAccounts Get Accounts - // Description: Accounts participating in OTC lending, This interface is only for querying accounts currently running OTC lending. - // Documentation: https://www.kucoin.com/docs-new/api-3470278 + // GetAccountDetail Get Account Detail + // Description: The following information is only applicable to loans. Get information on off-exchange funding and loans, This endpoint is only for querying accounts that are currently involved in loans. + // Documentation: https://www.kucoin.com/docs-new/api-3470277 // +---------------------+------------+ // | Extra API Info | Value | // +---------------------+------------+ @@ -21,11 +21,11 @@ type VIPLendingAPI interface { // | API-RATE-LIMIT-POOL | MANAGEMENT | // | API-RATE-LIMIT | 1 | // +---------------------+------------+ - GetAccounts(ctx context.Context) (*GetAccountsResp, error) + GetAccountDetail(ctx context.Context) (*GetAccountDetailResp, error) - // GetAccountDetail Get Account Detail - // Description: The following information is only applicable to loans. Get information on off-exchange funding and loans, This endpoint is only for querying accounts that are currently involved in loans. - // Documentation: https://www.kucoin.com/docs-new/api-3470277 + // GetAccounts Get Accounts + // Description: Accounts participating in OTC lending, This interface is only for querying accounts currently running OTC lending. + // Documentation: https://www.kucoin.com/docs-new/api-3470278 // +---------------------+------------+ // | Extra API Info | Value | // +---------------------+------------+ @@ -35,7 +35,7 @@ type VIPLendingAPI interface { // | API-RATE-LIMIT-POOL | MANAGEMENT | // | API-RATE-LIMIT | 1 | // +---------------------+------------+ - GetAccountDetail(ctx context.Context) (*GetAccountDetailResp, error) + GetAccounts(ctx context.Context) (*GetAccountsResp, error) } type VIPLendingAPIImpl struct { @@ -46,14 +46,14 @@ func NewVIPLendingAPIImp(transport interfaces.Transport) *VIPLendingAPIImpl { return &VIPLendingAPIImpl{transport: transport} } -func (impl *VIPLendingAPIImpl) GetAccounts(ctx context.Context) (*GetAccountsResp, error) { - resp := &GetAccountsResp{} - err := impl.transport.Call(ctx, "spot", false, "Get", "/api/v1/otc-loan/accounts", nil, resp, false) - return resp, err -} - func (impl *VIPLendingAPIImpl) GetAccountDetail(ctx context.Context) (*GetAccountDetailResp, error) { resp := &GetAccountDetailResp{} err := impl.transport.Call(ctx, "spot", false, "Get", "/api/v1/otc-loan/loan", nil, resp, false) return resp, err } + +func (impl *VIPLendingAPIImpl) GetAccounts(ctx context.Context) (*GetAccountsResp, error) { + resp := &GetAccountsResp{} + err := impl.transport.Call(ctx, "spot", false, "Get", "/api/v1/otc-loan/accounts", nil, resp, false) + return resp, err +} diff --git a/sdk/golang/pkg/generate/viplending/viplending/api_vip_lending.template b/sdk/golang/pkg/generate/viplending/viplending/api_vip_lending.template index 0312f3ce..7f233f03 100644 --- a/sdk/golang/pkg/generate/viplending/viplending/api_vip_lending.template +++ b/sdk/golang/pkg/generate/viplending/viplending/api_vip_lending.template @@ -1,13 +1,13 @@ # API FUNCTION TEMPLATE -func TestVIPLendingGetAccountsReq(t *testing.T) { - // GetAccounts - // Get Accounts - // /api/v1/otc-loan/accounts +func TestVIPLendingGetAccountDetailReq(t *testing.T) { + // GetAccountDetail + // Get Account Detail + // /api/v1/otc-loan/loan - resp, err := viplendingApi.GetAccounts(context.TODO()) + resp, err := viplendingApi.GetAccountDetail(context.TODO()) if err != nil { panic(err) } @@ -21,13 +21,13 @@ func TestVIPLendingGetAccountsReq(t *testing.T) { } -func TestVIPLendingGetAccountDetailReq(t *testing.T) { - // GetAccountDetail - // Get Account Detail - // /api/v1/otc-loan/loan +func TestVIPLendingGetAccountsReq(t *testing.T) { + // GetAccounts + // Get Accounts + // /api/v1/otc-loan/accounts - resp, err := viplendingApi.GetAccountDetail(context.TODO()) + resp, err := viplendingApi.GetAccounts(context.TODO()) if err != nil { panic(err) } diff --git a/sdk/golang/pkg/generate/viplending/viplending/api_vip_lending_test.go b/sdk/golang/pkg/generate/viplending/viplending/api_vip_lending_test.go index 813e5300..45816cc4 100644 --- a/sdk/golang/pkg/generate/viplending/viplending/api_vip_lending_test.go +++ b/sdk/golang/pkg/generate/viplending/viplending/api_vip_lending_test.go @@ -7,47 +7,47 @@ import ( "testing" ) -func TestVIPLendingGetAccountsReqModel(t *testing.T) { - // GetAccounts - // Get Accounts - // /api/v1/otc-loan/accounts +func TestVIPLendingGetAccountDetailReqModel(t *testing.T) { + // GetAccountDetail + // Get Account Detail + // /api/v1/otc-loan/loan } -func TestVIPLendingGetAccountsRespModel(t *testing.T) { - // GetAccounts - // Get Accounts - // /api/v1/otc-loan/accounts +func TestVIPLendingGetAccountDetailRespModel(t *testing.T) { + // GetAccountDetail + // Get Account Detail + // /api/v1/otc-loan/loan - data := "\n{\n \"code\": \"200000\",\n \"data\": [{\n \"uid\": \"1260004199\",\n \"marginCcy\": \"USDT\",\n \"marginQty\": \"900\",\n \"marginFactor\": \"0.9000000000\",\n \"accountType\": \"TRADE\",\n \"isParent\": true\n }]\n}" + data := "{\n \"code\": \"200000\",\n \"data\": {\n \"parentUid\": \"1260004199\",\n \"orders\": [{\n \"orderId\": \"671a2be815f4140007a588e1\",\n \"principal\": \"100\",\n \"interest\": \"0\",\n \"currency\": \"USDT\"\n }],\n \"ltv\": {\n \"transferLtv\": \"0.6000\",\n \"onlyClosePosLtv\": \"0.7500\",\n \"delayedLiquidationLtv\": \"0.7500\",\n \"instantLiquidationLtv\": \"0.8000\",\n \"currentLtv\": \"0.1111\"\n },\n \"totalMarginAmount\": \"900.00000000\",\n \"transferMarginAmount\": \"166.66666666\",\n \"margins\": [{\n \"marginCcy\": \"USDT\",\n \"marginQty\": \"1000.00000000\",\n \"marginFactor\": \"0.9000000000\"\n }]\n }\n}" commonResp := &types.RestResponse{} err := json.Unmarshal([]byte(data), commonResp) assert.Nil(t, err) assert.NotNil(t, commonResp.Data) - resp := &GetAccountsResp{} + resp := &GetAccountDetailResp{} err = json.Unmarshal([]byte(commonResp.Data), resp) resp.ToMap() assert.Nil(t, err) } -func TestVIPLendingGetAccountDetailReqModel(t *testing.T) { - // GetAccountDetail - // Get Account Detail - // /api/v1/otc-loan/loan +func TestVIPLendingGetAccountsReqModel(t *testing.T) { + // GetAccounts + // Get Accounts + // /api/v1/otc-loan/accounts } -func TestVIPLendingGetAccountDetailRespModel(t *testing.T) { - // GetAccountDetail - // Get Account Detail - // /api/v1/otc-loan/loan +func TestVIPLendingGetAccountsRespModel(t *testing.T) { + // GetAccounts + // Get Accounts + // /api/v1/otc-loan/accounts - data := "{\n \"code\": \"200000\",\n \"data\": {\n \"parentUid\": \"1260004199\",\n \"orders\": [{\n \"orderId\": \"671a2be815f4140007a588e1\",\n \"principal\": \"100\",\n \"interest\": \"0\",\n \"currency\": \"USDT\"\n }],\n \"ltv\": {\n \"transferLtv\": \"0.6000\",\n \"onlyClosePosLtv\": \"0.7500\",\n \"delayedLiquidationLtv\": \"0.7500\",\n \"instantLiquidationLtv\": \"0.8000\",\n \"currentLtv\": \"0.1111\"\n },\n \"totalMarginAmount\": \"900.00000000\",\n \"transferMarginAmount\": \"166.66666666\",\n \"margins\": [{\n \"marginCcy\": \"USDT\",\n \"marginQty\": \"1000.00000000\",\n \"marginFactor\": \"0.9000000000\"\n }]\n }\n}" + data := "\n{\n \"code\": \"200000\",\n \"data\": [{\n \"uid\": \"1260004199\",\n \"marginCcy\": \"USDT\",\n \"marginQty\": \"900\",\n \"marginFactor\": \"0.9000000000\",\n \"accountType\": \"TRADE\",\n \"isParent\": true\n }]\n}" commonResp := &types.RestResponse{} err := json.Unmarshal([]byte(data), commonResp) assert.Nil(t, err) assert.NotNil(t, commonResp.Data) - resp := &GetAccountDetailResp{} + resp := &GetAccountsResp{} err = json.Unmarshal([]byte(commonResp.Data), resp) resp.ToMap() assert.Nil(t, err) diff --git a/sdk/python/kucoin_universal_sdk/generate/account/account/api_account.py b/sdk/python/kucoin_universal_sdk/generate/account/account/api_account.py index 1bc8c964..c9bc1f61 100644 --- a/sdk/python/kucoin_universal_sdk/generate/account/account/api_account.py +++ b/sdk/python/kucoin_universal_sdk/generate/account/account/api_account.py @@ -35,31 +35,29 @@ class AccountAPI(ABC): @abstractmethod - def get_futures_account(self, req: GetFuturesAccountReq, - **kwargs: Any) -> GetFuturesAccountResp: + def get_account_info(self, **kwargs: Any) -> GetAccountInfoResp: """ - summary: Get Account - Futures - description: Request via this endpoint to get the info of the futures account. - documentation: https://www.kucoin.com/docs-new/api-3470129 - +---------------------+---------+ - | Extra API Info | Value | - +---------------------+---------+ - | API-DOMAIN | FUTURES | - | API-CHANNEL | PRIVATE | - | API-PERMISSION | FUTURES | - | API-RATE-LIMIT-POOL | FUTURES | - | API-RATE-LIMIT | 5 | - +---------------------+---------+ + summary: Get Account Summary Info + description: This endpoint can be used to obtain account summary information. + documentation: https://www.kucoin.com/docs-new/api-3470119 + +---------------------+------------+ + | Extra API Info | Value | + +---------------------+------------+ + | API-DOMAIN | SPOT | + | API-CHANNEL | PRIVATE | + | API-PERMISSION | GENERAL | + | API-RATE-LIMIT-POOL | MANAGEMENT | + | API-RATE-LIMIT | 20 | + +---------------------+------------+ """ pass @abstractmethod - def get_spot_account_detail(self, req: GetSpotAccountDetailReq, - **kwargs: Any) -> GetSpotAccountDetailResp: + def get_apikey_info(self, **kwargs: Any) -> GetApikeyInfoResp: """ - summary: Get Account Detail - Spot - description: get Information for a single spot account. Use this endpoint when you know the accountId. - documentation: https://www.kucoin.com/docs-new/api-3470126 + summary: Get Apikey Info + description: Get the information of the api key. Use the api key pending to be checked to call the endpoint. Both master and sub user's api key are applicable. + documentation: https://www.kucoin.com/docs-new/api-3470130 +---------------------+------------+ | Extra API Info | Value | +---------------------+------------+ @@ -67,11 +65,29 @@ def get_spot_account_detail(self, req: GetSpotAccountDetailReq, | API-CHANNEL | PRIVATE | | API-PERMISSION | GENERAL | | API-RATE-LIMIT-POOL | MANAGEMENT | - | API-RATE-LIMIT | 5 | + | API-RATE-LIMIT | 20 | +---------------------+------------+ """ pass + @abstractmethod + def get_spot_account_type(self, **kwargs: Any) -> GetSpotAccountTypeResp: + """ + summary: Get Account Type - Spot + description: This interface determines whether the current user is a spot high-frequency user or a spot low-frequency user. + documentation: https://www.kucoin.com/docs-new/api-3470120 + +---------------------+---------+ + | Extra API Info | Value | + +---------------------+---------+ + | API-DOMAIN | SPOT | + | API-CHANNEL | PRIVATE | + | API-PERMISSION | GENERAL | + | API-RATE-LIMIT-POOL | SPOT | + | API-RATE-LIMIT | 30 | + +---------------------+---------+ + """ + pass + @abstractmethod def get_spot_account_list(self, req: GetSpotAccountListReq, **kwargs: Any) -> GetSpotAccountListResp: @@ -92,12 +108,12 @@ def get_spot_account_list(self, req: GetSpotAccountListReq, pass @abstractmethod - def get_spot_ledger(self, req: GetSpotLedgerReq, - **kwargs: Any) -> GetSpotLedgerResp: + def get_spot_account_detail(self, req: GetSpotAccountDetailReq, + **kwargs: Any) -> GetSpotAccountDetailResp: """ - summary: Get Account Ledgers - Spot/Margin - description: This interface is for transaction records from all types of your accounts, supporting inquiry of various currencies. Items are paginated and sorted to show the latest first. See the Pagination section for retrieving additional entries after the first page. - documentation: https://www.kucoin.com/docs-new/api-3470121 + summary: Get Account Detail - Spot + description: get Information for a single spot account. Use this endpoint when you know the accountId. + documentation: https://www.kucoin.com/docs-new/api-3470126 +---------------------+------------+ | Extra API Info | Value | +---------------------+------------+ @@ -105,18 +121,18 @@ def get_spot_ledger(self, req: GetSpotLedgerReq, | API-CHANNEL | PRIVATE | | API-PERMISSION | GENERAL | | API-RATE-LIMIT-POOL | MANAGEMENT | - | API-RATE-LIMIT | 2 | + | API-RATE-LIMIT | 5 | +---------------------+------------+ """ pass @abstractmethod - def get_spot_hf_ledger(self, req: GetSpotHfLedgerReq, - **kwargs: Any) -> GetSpotHfLedgerResp: + def get_cross_margin_account(self, req: GetCrossMarginAccountReq, + **kwargs: Any) -> GetCrossMarginAccountResp: """ - summary: Get Account Ledgers - Trade_hf - description: This API endpoint returns all transfer (in and out) records in high-frequency trading account and supports multi-coin queries. The query results are sorted in descending order by createdAt and id. - documentation: https://www.kucoin.com/docs-new/api-3470122 + summary: Get Account - Cross Margin + description: Request via this endpoint to get the info of the cross margin account. + documentation: https://www.kucoin.com/docs-new/api-3470127 +---------------------+---------+ | Extra API Info | Value | +---------------------+---------+ @@ -124,17 +140,19 @@ def get_spot_hf_ledger(self, req: GetSpotHfLedgerReq, | API-CHANNEL | PRIVATE | | API-PERMISSION | GENERAL | | API-RATE-LIMIT-POOL | SPOT | - | API-RATE-LIMIT | 2 | + | API-RATE-LIMIT | 15 | +---------------------+---------+ """ pass @abstractmethod - def get_spot_account_type(self, **kwargs: Any) -> GetSpotAccountTypeResp: + def get_isolated_margin_account( + self, req: GetIsolatedMarginAccountReq, + **kwargs: Any) -> GetIsolatedMarginAccountResp: """ - summary: Get Account Type - Spot - description: This interface determines whether the current user is a spot high-frequency user or a spot low-frequency user. - documentation: https://www.kucoin.com/docs-new/api-3470120 + summary: Get Account - Isolated Margin + description: Request via this endpoint to get the info of the isolated margin account. + documentation: https://www.kucoin.com/docs-new/api-3470128 +---------------------+---------+ | Extra API Info | Value | +---------------------+---------+ @@ -142,41 +160,56 @@ def get_spot_account_type(self, **kwargs: Any) -> GetSpotAccountTypeResp: | API-CHANNEL | PRIVATE | | API-PERMISSION | GENERAL | | API-RATE-LIMIT-POOL | SPOT | - | API-RATE-LIMIT | 30 | + | API-RATE-LIMIT | 15 | +---------------------+---------+ """ pass @abstractmethod - @deprecated('') - def get_isolated_margin_account_detail_v1( - self, req: GetIsolatedMarginAccountDetailV1Req, - **kwargs: Any) -> GetIsolatedMarginAccountDetailV1Resp: + def get_futures_account(self, req: GetFuturesAccountReq, + **kwargs: Any) -> GetFuturesAccountResp: """ - summary: Get Account Detail - Isolated Margin - V1 - description: Request via this endpoint to get the info of the isolated margin account. - documentation: https://www.kucoin.com/docs-new/api-3470315 + summary: Get Account - Futures + description: Request via this endpoint to get the info of the futures account. + documentation: https://www.kucoin.com/docs-new/api-3470129 +---------------------+---------+ | Extra API Info | Value | +---------------------+---------+ - | API-DOMAIN | SPOT | + | API-DOMAIN | FUTURES | | API-CHANNEL | PRIVATE | - | API-PERMISSION | GENERAL | - | API-RATE-LIMIT-POOL | SPOT | - | API-RATE-LIMIT | 50 | + | API-PERMISSION | FUTURES | + | API-RATE-LIMIT-POOL | FUTURES | + | API-RATE-LIMIT | 5 | +---------------------+---------+ """ pass @abstractmethod - @deprecated('') - def get_isolated_margin_account_list_v1( - self, req: GetIsolatedMarginAccountListV1Req, - **kwargs: Any) -> GetIsolatedMarginAccountListV1Resp: + def get_spot_ledger(self, req: GetSpotLedgerReq, + **kwargs: Any) -> GetSpotLedgerResp: """ - summary: Get Account List - Isolated Margin - V1 - description: Request via this endpoint to get the info list of the isolated margin account. - documentation: https://www.kucoin.com/docs-new/api-3470314 + summary: Get Account Ledgers - Spot/Margin + description: This interface is for transaction records from all types of your accounts, supporting inquiry of various currencies. Items are paginated and sorted to show the latest first. See the Pagination section for retrieving additional entries after the first page. + documentation: https://www.kucoin.com/docs-new/api-3470121 + +---------------------+------------+ + | Extra API Info | Value | + +---------------------+------------+ + | API-DOMAIN | SPOT | + | API-CHANNEL | PRIVATE | + | API-PERMISSION | GENERAL | + | API-RATE-LIMIT-POOL | MANAGEMENT | + | API-RATE-LIMIT | 2 | + +---------------------+------------+ + """ + pass + + @abstractmethod + def get_spot_hf_ledger(self, req: GetSpotHfLedgerReq, + **kwargs: Any) -> GetSpotHfLedgerResp: + """ + summary: Get Account Ledgers - Trade_hf + description: This API endpoint returns all transfer (in and out) records in high-frequency trading account and supports multi-coin queries. The query results are sorted in descending order by createdAt and id. + documentation: https://www.kucoin.com/docs-new/api-3470122 +---------------------+---------+ | Extra API Info | Value | +---------------------+---------+ @@ -184,19 +217,18 @@ def get_isolated_margin_account_list_v1( | API-CHANNEL | PRIVATE | | API-PERMISSION | GENERAL | | API-RATE-LIMIT-POOL | SPOT | - | API-RATE-LIMIT | 50 | + | API-RATE-LIMIT | 2 | +---------------------+---------+ """ pass @abstractmethod - @deprecated('') - def get_margin_account_detail(self, - **kwargs: Any) -> GetMarginAccountDetailResp: + def get_margin_hf_ledger(self, req: GetMarginHfLedgerReq, + **kwargs: Any) -> GetMarginHfLedgerResp: """ - summary: Get Account Detail - Margin - description: Request via this endpoint to get the info of the margin account. - documentation: https://www.kucoin.com/docs-new/api-3470311 + summary: Get Account Ledgers - Margin_hf + description: This API endpoint returns all transfer (in and out) records in high-frequency margin trading account and supports multi-coin queries. The query results are sorted in descending order by createdAt and id. + documentation: https://www.kucoin.com/docs-new/api-3470123 +---------------------+---------+ | Extra API Info | Value | +---------------------+---------+ @@ -204,7 +236,7 @@ def get_margin_account_detail(self, | API-CHANNEL | PRIVATE | | API-PERMISSION | GENERAL | | API-RATE-LIMIT-POOL | SPOT | - | API-RATE-LIMIT | 40 | + | API-RATE-LIMIT | 2 | +---------------------+---------+ """ pass @@ -229,48 +261,13 @@ def get_futures_ledger(self, req: GetFuturesLedgerReq, pass @abstractmethod - def get_apikey_info(self, **kwargs: Any) -> GetApikeyInfoResp: - """ - summary: Get Apikey Info - description: Get the information of the api key. Use the api key pending to be checked to call the endpoint. Both master and sub user's api key are applicable. - documentation: https://www.kucoin.com/docs-new/api-3470130 - +---------------------+------------+ - | Extra API Info | Value | - +---------------------+------------+ - | API-DOMAIN | SPOT | - | API-CHANNEL | PRIVATE | - | API-PERMISSION | GENERAL | - | API-RATE-LIMIT-POOL | MANAGEMENT | - | API-RATE-LIMIT | 20 | - +---------------------+------------+ - """ - pass - - @abstractmethod - def get_account_info(self, **kwargs: Any) -> GetAccountInfoResp: - """ - summary: Get Account Summary Info - description: This endpoint can be used to obtain account summary information. - documentation: https://www.kucoin.com/docs-new/api-3470119 - +---------------------+------------+ - | Extra API Info | Value | - +---------------------+------------+ - | API-DOMAIN | SPOT | - | API-CHANNEL | PRIVATE | - | API-PERMISSION | GENERAL | - | API-RATE-LIMIT-POOL | MANAGEMENT | - | API-RATE-LIMIT | 20 | - +---------------------+------------+ - """ - pass - - @abstractmethod - def get_margin_hf_ledger(self, req: GetMarginHfLedgerReq, - **kwargs: Any) -> GetMarginHfLedgerResp: + @deprecated('') + def get_margin_account_detail(self, + **kwargs: Any) -> GetMarginAccountDetailResp: """ - summary: Get Account Ledgers - Margin_hf - description: This API endpoint returns all transfer (in and out) records in high-frequency margin trading account and supports multi-coin queries. The query results are sorted in descending order by createdAt and id. - documentation: https://www.kucoin.com/docs-new/api-3470123 + summary: Get Account Detail - Margin + description: Request via this endpoint to get the info of the margin account. + documentation: https://www.kucoin.com/docs-new/api-3470311 +---------------------+---------+ | Extra API Info | Value | +---------------------+---------+ @@ -278,19 +275,20 @@ def get_margin_hf_ledger(self, req: GetMarginHfLedgerReq, | API-CHANNEL | PRIVATE | | API-PERMISSION | GENERAL | | API-RATE-LIMIT-POOL | SPOT | - | API-RATE-LIMIT | 2 | + | API-RATE-LIMIT | 40 | +---------------------+---------+ """ pass @abstractmethod - def get_isolated_margin_account( - self, req: GetIsolatedMarginAccountReq, - **kwargs: Any) -> GetIsolatedMarginAccountResp: + @deprecated('') + def get_isolated_margin_account_list_v1( + self, req: GetIsolatedMarginAccountListV1Req, + **kwargs: Any) -> GetIsolatedMarginAccountListV1Resp: """ - summary: Get Account - Isolated Margin - description: Request via this endpoint to get the info of the isolated margin account. - documentation: https://www.kucoin.com/docs-new/api-3470128 + summary: Get Account List - Isolated Margin - V1 + description: Request via this endpoint to get the info list of the isolated margin account. + documentation: https://www.kucoin.com/docs-new/api-3470314 +---------------------+---------+ | Extra API Info | Value | +---------------------+---------+ @@ -298,18 +296,20 @@ def get_isolated_margin_account( | API-CHANNEL | PRIVATE | | API-PERMISSION | GENERAL | | API-RATE-LIMIT-POOL | SPOT | - | API-RATE-LIMIT | 15 | + | API-RATE-LIMIT | 50 | +---------------------+---------+ """ pass @abstractmethod - def get_cross_margin_account(self, req: GetCrossMarginAccountReq, - **kwargs: Any) -> GetCrossMarginAccountResp: + @deprecated('') + def get_isolated_margin_account_detail_v1( + self, req: GetIsolatedMarginAccountDetailV1Req, + **kwargs: Any) -> GetIsolatedMarginAccountDetailV1Resp: """ - summary: Get Account - Cross Margin - description: Request via this endpoint to get the info of the cross margin account. - documentation: https://www.kucoin.com/docs-new/api-3470127 + summary: Get Account Detail - Isolated Margin - V1 + description: Request via this endpoint to get the info of the isolated margin account. + documentation: https://www.kucoin.com/docs-new/api-3470315 +---------------------+---------+ | Extra API Info | Value | +---------------------+---------+ @@ -317,7 +317,7 @@ def get_cross_margin_account(self, req: GetCrossMarginAccountReq, | API-CHANNEL | PRIVATE | | API-PERMISSION | GENERAL | | API-RATE-LIMIT-POOL | SPOT | - | API-RATE-LIMIT | 15 | + | API-RATE-LIMIT | 50 | +---------------------+---------+ """ pass @@ -328,17 +328,19 @@ class AccountAPIImpl(AccountAPI): def __init__(self, transport: Transport): self.transport = transport - def get_futures_account(self, req: GetFuturesAccountReq, - **kwargs: Any) -> GetFuturesAccountResp: - return self.transport.call("futures", False, "GET", - "/api/v1/account-overview", req, - GetFuturesAccountResp(), False, **kwargs) + def get_account_info(self, **kwargs: Any) -> GetAccountInfoResp: + return self.transport.call("spot", False, "GET", "/api/v2/user-info", + None, GetAccountInfoResp(), False, **kwargs) - def get_spot_account_detail(self, req: GetSpotAccountDetailReq, - **kwargs: Any) -> GetSpotAccountDetailResp: + def get_apikey_info(self, **kwargs: Any) -> GetApikeyInfoResp: return self.transport.call("spot", False, "GET", - "/api/v1/accounts/{accountId}", req, - GetSpotAccountDetailResp(), False, **kwargs) + "/api/v1/user/api-key", None, + GetApikeyInfoResp(), False, **kwargs) + + def get_spot_account_type(self, **kwargs: Any) -> GetSpotAccountTypeResp: + return self.transport.call("spot", False, "GET", + "/api/v1/hf/accounts/opened", None, + GetSpotAccountTypeResp(), False, **kwargs) def get_spot_account_list(self, req: GetSpotAccountListReq, **kwargs: Any) -> GetSpotAccountListResp: @@ -346,6 +348,33 @@ def get_spot_account_list(self, req: GetSpotAccountListReq, "/api/v1/accounts", req, GetSpotAccountListResp(), False, **kwargs) + def get_spot_account_detail(self, req: GetSpotAccountDetailReq, + **kwargs: Any) -> GetSpotAccountDetailResp: + return self.transport.call("spot", False, "GET", + "/api/v1/accounts/{accountId}", req, + GetSpotAccountDetailResp(), False, **kwargs) + + def get_cross_margin_account(self, req: GetCrossMarginAccountReq, + **kwargs: Any) -> GetCrossMarginAccountResp: + return self.transport.call("spot", False, "GET", + "/api/v3/margin/accounts", req, + GetCrossMarginAccountResp(), False, + **kwargs) + + def get_isolated_margin_account( + self, req: GetIsolatedMarginAccountReq, + **kwargs: Any) -> GetIsolatedMarginAccountResp: + return self.transport.call("spot", False, "GET", + "/api/v3/isolated/accounts", req, + GetIsolatedMarginAccountResp(), False, + **kwargs) + + def get_futures_account(self, req: GetFuturesAccountReq, + **kwargs: Any) -> GetFuturesAccountResp: + return self.transport.call("futures", False, "GET", + "/api/v1/account-overview", req, + GetFuturesAccountResp(), False, **kwargs) + def get_spot_ledger(self, req: GetSpotLedgerReq, **kwargs: Any) -> GetSpotLedgerResp: return self.transport.call("spot", False, "GET", @@ -358,33 +387,11 @@ def get_spot_hf_ledger(self, req: GetSpotHfLedgerReq, "/api/v1/hf/accounts/ledgers", req, GetSpotHfLedgerResp(), False, **kwargs) - def get_spot_account_type(self, **kwargs: Any) -> GetSpotAccountTypeResp: - return self.transport.call("spot", False, "GET", - "/api/v1/hf/accounts/opened", None, - GetSpotAccountTypeResp(), False, **kwargs) - - def get_isolated_margin_account_detail_v1( - self, req: GetIsolatedMarginAccountDetailV1Req, - **kwargs: Any) -> GetIsolatedMarginAccountDetailV1Resp: - return self.transport.call("spot", False, "GET", - "/api/v1/isolated/account/{symbol}", req, - GetIsolatedMarginAccountDetailV1Resp(), - False, **kwargs) - - def get_isolated_margin_account_list_v1( - self, req: GetIsolatedMarginAccountListV1Req, - **kwargs: Any) -> GetIsolatedMarginAccountListV1Resp: - return self.transport.call("spot", False, "GET", - "/api/v1/isolated/accounts", req, - GetIsolatedMarginAccountListV1Resp(), False, - **kwargs) - - def get_margin_account_detail(self, - **kwargs: Any) -> GetMarginAccountDetailResp: + def get_margin_hf_ledger(self, req: GetMarginHfLedgerReq, + **kwargs: Any) -> GetMarginHfLedgerResp: return self.transport.call("spot", False, "GET", - "/api/v1/margin/account", None, - GetMarginAccountDetailResp(), False, - **kwargs) + "/api/v3/hf/margin/account/ledgers", req, + GetMarginHfLedgerResp(), False, **kwargs) def get_futures_ledger(self, req: GetFuturesLedgerReq, **kwargs: Any) -> GetFuturesLedgerResp: @@ -392,32 +399,25 @@ def get_futures_ledger(self, req: GetFuturesLedgerReq, "/api/v1/transaction-history", req, GetFuturesLedgerResp(), False, **kwargs) - def get_apikey_info(self, **kwargs: Any) -> GetApikeyInfoResp: - return self.transport.call("spot", False, "GET", - "/api/v1/user/api-key", None, - GetApikeyInfoResp(), False, **kwargs) - - def get_account_info(self, **kwargs: Any) -> GetAccountInfoResp: - return self.transport.call("spot", False, "GET", "/api/v2/user-info", - None, GetAccountInfoResp(), False, **kwargs) - - def get_margin_hf_ledger(self, req: GetMarginHfLedgerReq, - **kwargs: Any) -> GetMarginHfLedgerResp: + def get_margin_account_detail(self, + **kwargs: Any) -> GetMarginAccountDetailResp: return self.transport.call("spot", False, "GET", - "/api/v3/hf/margin/account/ledgers", req, - GetMarginHfLedgerResp(), False, **kwargs) + "/api/v1/margin/account", None, + GetMarginAccountDetailResp(), False, + **kwargs) - def get_isolated_margin_account( - self, req: GetIsolatedMarginAccountReq, - **kwargs: Any) -> GetIsolatedMarginAccountResp: + def get_isolated_margin_account_list_v1( + self, req: GetIsolatedMarginAccountListV1Req, + **kwargs: Any) -> GetIsolatedMarginAccountListV1Resp: return self.transport.call("spot", False, "GET", - "/api/v3/isolated/accounts", req, - GetIsolatedMarginAccountResp(), False, + "/api/v1/isolated/accounts", req, + GetIsolatedMarginAccountListV1Resp(), False, **kwargs) - def get_cross_margin_account(self, req: GetCrossMarginAccountReq, - **kwargs: Any) -> GetCrossMarginAccountResp: + def get_isolated_margin_account_detail_v1( + self, req: GetIsolatedMarginAccountDetailV1Req, + **kwargs: Any) -> GetIsolatedMarginAccountDetailV1Resp: return self.transport.call("spot", False, "GET", - "/api/v3/margin/accounts", req, - GetCrossMarginAccountResp(), False, - **kwargs) + "/api/v1/isolated/account/{symbol}", req, + GetIsolatedMarginAccountDetailV1Resp(), + False, **kwargs) diff --git a/sdk/python/kucoin_universal_sdk/generate/account/account/api_account.template b/sdk/python/kucoin_universal_sdk/generate/account/account/api_account.template index 2eb462fc..21386e4f 100644 --- a/sdk/python/kucoin_universal_sdk/generate/account/account/api_account.template +++ b/sdk/python/kucoin_universal_sdk/generate/account/account/api_account.template @@ -1,18 +1,15 @@ # API FUNCTION TEMPLATE -def test_get_futures_account_req(self): +def test_get_account_info_req(self): """ - get_futures_account - Get Account - Futures - /api/v1/account-overview + get_account_info + Get Account Summary Info + /api/v2/user-info """ - builder = GetFuturesAccountReqBuilder() - builder.set_currency(?) - req = builder.build() try: - resp = self.api.get_futures_account(req) + resp = self.api.get_account_info() print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) @@ -20,18 +17,15 @@ def test_get_futures_account_req(self): print("error: ", e) raise e -def test_get_spot_account_detail_req(self): +def test_get_apikey_info_req(self): """ - get_spot_account_detail - Get Account Detail - Spot - /api/v1/accounts/{accountId} + get_apikey_info + Get Apikey Info + /api/v1/user/api-key """ - builder = GetSpotAccountDetailReqBuilder() - builder.set_account_id(?) - req = builder.build() try: - resp = self.api.get_spot_account_detail(req) + resp = self.api.get_apikey_info() print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) @@ -39,18 +33,15 @@ def test_get_spot_account_detail_req(self): print("error: ", e) raise e -def test_get_spot_account_list_req(self): +def test_get_spot_account_type_req(self): """ - get_spot_account_list - Get Account List - Spot - /api/v1/accounts + get_spot_account_type + Get Account Type - Spot + /api/v1/hf/accounts/opened """ - builder = GetSpotAccountListReqBuilder() - builder.set_currency(?).set_type(?) - req = builder.build() try: - resp = self.api.get_spot_account_list(req) + resp = self.api.get_spot_account_type() print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) @@ -58,18 +49,18 @@ def test_get_spot_account_list_req(self): print("error: ", e) raise e -def test_get_spot_ledger_req(self): +def test_get_spot_account_list_req(self): """ - get_spot_ledger - Get Account Ledgers - Spot/Margin - /api/v1/accounts/ledgers + get_spot_account_list + Get Account List - Spot + /api/v1/accounts """ - builder = GetSpotLedgerReqBuilder() - builder.set_currency(?).set_direction(?).set_biz_type(?).set_start_at(?).set_end_at(?).set_current_page(?).set_page_size(?) + builder = GetSpotAccountListReqBuilder() + builder.set_currency(?).set_type(?) req = builder.build() try: - resp = self.api.get_spot_ledger(req) + resp = self.api.get_spot_account_list(req) print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) @@ -77,18 +68,18 @@ def test_get_spot_ledger_req(self): print("error: ", e) raise e -def test_get_spot_hf_ledger_req(self): +def test_get_spot_account_detail_req(self): """ - get_spot_hf_ledger - Get Account Ledgers - Trade_hf - /api/v1/hf/accounts/ledgers + get_spot_account_detail + Get Account Detail - Spot + /api/v1/accounts/{accountId} """ - builder = GetSpotHfLedgerReqBuilder() - builder.set_currency(?).set_direction(?).set_biz_type(?).set_last_id(?).set_limit(?).set_start_at(?).set_end_at(?) + builder = GetSpotAccountDetailReqBuilder() + builder.set_account_id(?) req = builder.build() try: - resp = self.api.get_spot_hf_ledger(req) + resp = self.api.get_spot_account_detail(req) print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) @@ -96,15 +87,18 @@ def test_get_spot_hf_ledger_req(self): print("error: ", e) raise e -def test_get_spot_account_type_req(self): +def test_get_cross_margin_account_req(self): """ - get_spot_account_type - Get Account Type - Spot - /api/v1/hf/accounts/opened + get_cross_margin_account + Get Account - Cross Margin + /api/v3/margin/accounts """ + builder = GetCrossMarginAccountReqBuilder() + builder.set_quote_currency(?).set_query_type(?) + req = builder.build() try: - resp = self.api.get_spot_account_type() + resp = self.api.get_cross_margin_account(req) print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) @@ -112,18 +106,18 @@ def test_get_spot_account_type_req(self): print("error: ", e) raise e -def test_get_isolated_margin_account_detail_v1_req(self): +def test_get_isolated_margin_account_req(self): """ - get_isolated_margin_account_detail_v1 - Get Account Detail - Isolated Margin - V1 - /api/v1/isolated/account/{symbol} + get_isolated_margin_account + Get Account - Isolated Margin + /api/v3/isolated/accounts """ - builder = GetIsolatedMarginAccountDetailV1ReqBuilder() - builder.set_symbol(?) + builder = GetIsolatedMarginAccountReqBuilder() + builder.set_symbol(?).set_quote_currency(?).set_query_type(?) req = builder.build() try: - resp = self.api.get_isolated_margin_account_detail_v1(req) + resp = self.api.get_isolated_margin_account(req) print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) @@ -131,18 +125,18 @@ def test_get_isolated_margin_account_detail_v1_req(self): print("error: ", e) raise e -def test_get_isolated_margin_account_list_v1_req(self): +def test_get_futures_account_req(self): """ - get_isolated_margin_account_list_v1 - Get Account List - Isolated Margin - V1 - /api/v1/isolated/accounts + get_futures_account + Get Account - Futures + /api/v1/account-overview """ - builder = GetIsolatedMarginAccountListV1ReqBuilder() - builder.set_balance_currency(?) + builder = GetFuturesAccountReqBuilder() + builder.set_currency(?) req = builder.build() try: - resp = self.api.get_isolated_margin_account_list_v1(req) + resp = self.api.get_futures_account(req) print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) @@ -150,15 +144,18 @@ def test_get_isolated_margin_account_list_v1_req(self): print("error: ", e) raise e -def test_get_margin_account_detail_req(self): +def test_get_spot_ledger_req(self): """ - get_margin_account_detail - Get Account Detail - Margin - /api/v1/margin/account + get_spot_ledger + Get Account Ledgers - Spot/Margin + /api/v1/accounts/ledgers """ + builder = GetSpotLedgerReqBuilder() + builder.set_currency(?).set_direction(?).set_biz_type(?).set_start_at(?).set_end_at(?).set_current_page(?).set_page_size(?) + req = builder.build() try: - resp = self.api.get_margin_account_detail() + resp = self.api.get_spot_ledger(req) print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) @@ -166,18 +163,18 @@ def test_get_margin_account_detail_req(self): print("error: ", e) raise e -def test_get_futures_ledger_req(self): +def test_get_spot_hf_ledger_req(self): """ - get_futures_ledger - Get Account Ledgers - Futures - /api/v1/transaction-history + get_spot_hf_ledger + Get Account Ledgers - Trade_hf + /api/v1/hf/accounts/ledgers """ - builder = GetFuturesLedgerReqBuilder() - builder.set_currency(?).set_type(?).set_offset(?).set_forward(?).set_max_count(?).set_start_at(?).set_end_at(?) + builder = GetSpotHfLedgerReqBuilder() + builder.set_currency(?).set_direction(?).set_biz_type(?).set_last_id(?).set_limit(?).set_start_at(?).set_end_at(?) req = builder.build() try: - resp = self.api.get_futures_ledger(req) + resp = self.api.get_spot_hf_ledger(req) print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) @@ -185,15 +182,18 @@ def test_get_futures_ledger_req(self): print("error: ", e) raise e -def test_get_apikey_info_req(self): +def test_get_margin_hf_ledger_req(self): """ - get_apikey_info - Get Apikey Info - /api/v1/user/api-key + get_margin_hf_ledger + Get Account Ledgers - Margin_hf + /api/v3/hf/margin/account/ledgers """ + builder = GetMarginHfLedgerReqBuilder() + builder.set_currency(?).set_direction(?).set_biz_type(?).set_last_id(?).set_limit(?).set_start_at(?).set_end_at(?) + req = builder.build() try: - resp = self.api.get_apikey_info() + resp = self.api.get_margin_hf_ledger(req) print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) @@ -201,15 +201,18 @@ def test_get_apikey_info_req(self): print("error: ", e) raise e -def test_get_account_info_req(self): +def test_get_futures_ledger_req(self): """ - get_account_info - Get Account Summary Info - /api/v2/user-info + get_futures_ledger + Get Account Ledgers - Futures + /api/v1/transaction-history """ + builder = GetFuturesLedgerReqBuilder() + builder.set_currency(?).set_type(?).set_offset(?).set_forward(?).set_max_count(?).set_start_at(?).set_end_at(?) + req = builder.build() try: - resp = self.api.get_account_info() + resp = self.api.get_futures_ledger(req) print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) @@ -217,18 +220,15 @@ def test_get_account_info_req(self): print("error: ", e) raise e -def test_get_margin_hf_ledger_req(self): +def test_get_margin_account_detail_req(self): """ - get_margin_hf_ledger - Get Account Ledgers - Margin_hf - /api/v3/hf/margin/account/ledgers + get_margin_account_detail + Get Account Detail - Margin + /api/v1/margin/account """ - builder = GetMarginHfLedgerReqBuilder() - builder.set_currency(?).set_direction(?).set_biz_type(?).set_last_id(?).set_limit(?).set_start_at(?).set_end_at(?) - req = builder.build() try: - resp = self.api.get_margin_hf_ledger(req) + resp = self.api.get_margin_account_detail() print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) @@ -236,18 +236,18 @@ def test_get_margin_hf_ledger_req(self): print("error: ", e) raise e -def test_get_isolated_margin_account_req(self): +def test_get_isolated_margin_account_list_v1_req(self): """ - get_isolated_margin_account - Get Account - Isolated Margin - /api/v3/isolated/accounts + get_isolated_margin_account_list_v1 + Get Account List - Isolated Margin - V1 + /api/v1/isolated/accounts """ - builder = GetIsolatedMarginAccountReqBuilder() - builder.set_symbol(?).set_quote_currency(?).set_query_type(?) + builder = GetIsolatedMarginAccountListV1ReqBuilder() + builder.set_balance_currency(?) req = builder.build() try: - resp = self.api.get_isolated_margin_account(req) + resp = self.api.get_isolated_margin_account_list_v1(req) print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) @@ -255,18 +255,18 @@ def test_get_isolated_margin_account_req(self): print("error: ", e) raise e -def test_get_cross_margin_account_req(self): +def test_get_isolated_margin_account_detail_v1_req(self): """ - get_cross_margin_account - Get Account - Cross Margin - /api/v3/margin/accounts + get_isolated_margin_account_detail_v1 + Get Account Detail - Isolated Margin - V1 + /api/v1/isolated/account/{symbol} """ - builder = GetCrossMarginAccountReqBuilder() - builder.set_quote_currency(?).set_query_type(?) + builder = GetIsolatedMarginAccountDetailV1ReqBuilder() + builder.set_symbol(?) req = builder.build() try: - resp = self.api.get_cross_margin_account(req) + resp = self.api.get_isolated_margin_account_detail_v1(req) print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) diff --git a/sdk/python/kucoin_universal_sdk/generate/account/account/api_account_test.py b/sdk/python/kucoin_universal_sdk/generate/account/account/api_account_test.py index 214e5291..faf064a4 100644 --- a/sdk/python/kucoin_universal_sdk/generate/account/account/api_account_test.py +++ b/sdk/python/kucoin_universal_sdk/generate/account/account/api_account_test.py @@ -31,43 +31,56 @@ class AccountAPITest(unittest.TestCase): - def test_get_futures_account_req_model(self): + def test_get_account_info_req_model(self): """ - get_futures_account - Get Account - Futures - /api/v1/account-overview + get_account_info + Get Account Summary Info + /api/v2/user-info """ - data = "{\"currency\": \"USDT\"}" - req = GetFuturesAccountReq.from_json(data) - def test_get_futures_account_resp_model(self): + def test_get_account_info_resp_model(self): """ - get_futures_account - Get Account - Futures - /api/v1/account-overview + get_account_info + Get Account Summary Info + /api/v2/user-info """ - data = "{\n \"code\": \"200000\",\n \"data\": {\n \"currency\": \"USDT\",\n \"accountEquity\": 48.921913718,\n \"unrealisedPNL\": 1.59475,\n \"marginBalance\": 47.548728628,\n \"positionMargin\": 34.1577964733,\n \"orderMargin\": 0,\n \"frozenFunds\": 0,\n \"availableBalance\": 14.7876172447,\n \"riskRatio\": 0.0090285199\n }\n}" + data = "{\n \"code\": \"200000\",\n \"data\": {\n \"level\": 0,\n \"subQuantity\": 3,\n \"spotSubQuantity\": 3,\n \"marginSubQuantity\": 2,\n \"futuresSubQuantity\": 2,\n \"optionSubQuantity\": 0,\n \"maxSubQuantity\": 5,\n \"maxDefaultSubQuantity\": 5,\n \"maxSpotSubQuantity\": 0,\n \"maxMarginSubQuantity\": 0,\n \"maxFuturesSubQuantity\": 0,\n \"maxOptionSubQuantity\": 0\n }\n}" common_response = RestResponse.from_json(data) - resp = GetFuturesAccountResp.from_dict(common_response.data) + resp = GetAccountInfoResp.from_dict(common_response.data) - def test_get_spot_account_detail_req_model(self): + def test_get_apikey_info_req_model(self): """ - get_spot_account_detail - Get Account Detail - Spot - /api/v1/accounts/{accountId} + get_apikey_info + Get Apikey Info + /api/v1/user/api-key """ - data = "{\"accountId\": \"548674591753\"}" - req = GetSpotAccountDetailReq.from_json(data) - def test_get_spot_account_detail_resp_model(self): + def test_get_apikey_info_resp_model(self): """ - get_spot_account_detail - Get Account Detail - Spot - /api/v1/accounts/{accountId} + get_apikey_info + Get Apikey Info + /api/v1/user/api-key """ - data = "{\"code\":\"200000\",\"data\":{\"currency\":\"USDT\",\"balance\":\"26.66759503\",\"available\":\"26.66759503\",\"holds\":\"0\"}}" + data = "{\n \"code\": \"200000\",\n \"data\": {\n \"remark\": \"account1\",\n \"apiKey\": \"6705f5c311545b000157d3eb\",\n \"apiVersion\": 3,\n \"permission\": \"General,Futures,Spot,Earn,InnerTransfer,Transfer,Margin\",\n \"ipWhitelist\": \"203.**.154,103.**.34\",\n \"createdAt\": 1728443843000,\n \"uid\": 165111215,\n \"isMaster\": true\n }\n}" common_response = RestResponse.from_json(data) - resp = GetSpotAccountDetailResp.from_dict(common_response.data) + resp = GetApikeyInfoResp.from_dict(common_response.data) + + def test_get_spot_account_type_req_model(self): + """ + get_spot_account_type + Get Account Type - Spot + /api/v1/hf/accounts/opened + """ + + def test_get_spot_account_type_resp_model(self): + """ + get_spot_account_type + Get Account Type - Spot + /api/v1/hf/accounts/opened + """ + data = "{\"code\":\"200000\",\"data\":false}" + common_response = RestResponse.from_json(data) + resp = GetSpotAccountTypeResp.from_dict(common_response.data) def test_get_spot_account_list_req_model(self): """ @@ -88,6 +101,82 @@ def test_get_spot_account_list_resp_model(self): common_response = RestResponse.from_json(data) resp = GetSpotAccountListResp.from_dict(common_response.data) + def test_get_spot_account_detail_req_model(self): + """ + get_spot_account_detail + Get Account Detail - Spot + /api/v1/accounts/{accountId} + """ + data = "{\"accountId\": \"548674591753\"}" + req = GetSpotAccountDetailReq.from_json(data) + + def test_get_spot_account_detail_resp_model(self): + """ + get_spot_account_detail + Get Account Detail - Spot + /api/v1/accounts/{accountId} + """ + data = "{\"code\":\"200000\",\"data\":{\"currency\":\"USDT\",\"balance\":\"26.66759503\",\"available\":\"26.66759503\",\"holds\":\"0\"}}" + common_response = RestResponse.from_json(data) + resp = GetSpotAccountDetailResp.from_dict(common_response.data) + + def test_get_cross_margin_account_req_model(self): + """ + get_cross_margin_account + Get Account - Cross Margin + /api/v3/margin/accounts + """ + data = "{\"quoteCurrency\": \"USDT\", \"queryType\": \"MARGIN\"}" + req = GetCrossMarginAccountReq.from_json(data) + + def test_get_cross_margin_account_resp_model(self): + """ + get_cross_margin_account + Get Account - Cross Margin + /api/v3/margin/accounts + """ + data = "{\n \"code\": \"200000\",\n \"data\": {\n \"totalAssetOfQuoteCurrency\": \"0.02\",\n \"totalLiabilityOfQuoteCurrency\": \"0\",\n \"debtRatio\": \"0\",\n \"status\": \"EFFECTIVE\",\n \"accounts\": [\n {\n \"currency\": \"USDT\",\n \"total\": \"0.02\",\n \"available\": \"0.02\",\n \"hold\": \"0\",\n \"liability\": \"0\",\n \"maxBorrowSize\": \"0\",\n \"borrowEnabled\": true,\n \"transferInEnabled\": true\n }\n ]\n }\n}" + common_response = RestResponse.from_json(data) + resp = GetCrossMarginAccountResp.from_dict(common_response.data) + + def test_get_isolated_margin_account_req_model(self): + """ + get_isolated_margin_account + Get Account - Isolated Margin + /api/v3/isolated/accounts + """ + data = "{\"symbol\": \"example_string_default_value\", \"quoteCurrency\": \"USDT\", \"queryType\": \"ISOLATED\"}" + req = GetIsolatedMarginAccountReq.from_json(data) + + def test_get_isolated_margin_account_resp_model(self): + """ + get_isolated_margin_account + Get Account - Isolated Margin + /api/v3/isolated/accounts + """ + data = "{\n \"code\": \"200000\",\n \"data\": {\n \"totalAssetOfQuoteCurrency\": \"0.01\",\n \"totalLiabilityOfQuoteCurrency\": \"0\",\n \"timestamp\": 1728725465994,\n \"assets\": [\n {\n \"symbol\": \"BTC-USDT\",\n \"status\": \"EFFECTIVE\",\n \"debtRatio\": \"0\",\n \"baseAsset\": {\n \"currency\": \"BTC\",\n \"borrowEnabled\": true,\n \"transferInEnabled\": true,\n \"liability\": \"0\",\n \"total\": \"0\",\n \"available\": \"0\",\n \"hold\": \"0\",\n \"maxBorrowSize\": \"0\"\n },\n \"quoteAsset\": {\n \"currency\": \"USDT\",\n \"borrowEnabled\": true,\n \"transferInEnabled\": true,\n \"liability\": \"0\",\n \"total\": \"0.01\",\n \"available\": \"0.01\",\n \"hold\": \"0\",\n \"maxBorrowSize\": \"0\"\n }\n }\n ]\n }\n}" + common_response = RestResponse.from_json(data) + resp = GetIsolatedMarginAccountResp.from_dict(common_response.data) + + def test_get_futures_account_req_model(self): + """ + get_futures_account + Get Account - Futures + /api/v1/account-overview + """ + data = "{\"currency\": \"USDT\"}" + req = GetFuturesAccountReq.from_json(data) + + def test_get_futures_account_resp_model(self): + """ + get_futures_account + Get Account - Futures + /api/v1/account-overview + """ + data = "{\n \"code\": \"200000\",\n \"data\": {\n \"currency\": \"USDT\",\n \"accountEquity\": 48.921913718,\n \"unrealisedPNL\": 1.59475,\n \"marginBalance\": 47.548728628,\n \"positionMargin\": 34.1577964733,\n \"orderMargin\": 0,\n \"frozenFunds\": 0,\n \"availableBalance\": 14.7876172447,\n \"riskRatio\": 0.0090285199\n }\n}" + common_response = RestResponse.from_json(data) + resp = GetFuturesAccountResp.from_dict(common_response.data) + def test_get_spot_ledger_req_model(self): """ get_spot_ledger @@ -126,79 +215,24 @@ def test_get_spot_hf_ledger_resp_model(self): common_response = RestResponse.from_json(data) resp = GetSpotHfLedgerResp.from_dict(common_response.data) - def test_get_spot_account_type_req_model(self): - """ - get_spot_account_type - Get Account Type - Spot - /api/v1/hf/accounts/opened - """ - - def test_get_spot_account_type_resp_model(self): - """ - get_spot_account_type - Get Account Type - Spot - /api/v1/hf/accounts/opened - """ - data = "{\"code\":\"200000\",\"data\":false}" - common_response = RestResponse.from_json(data) - resp = GetSpotAccountTypeResp.from_dict(common_response.data) - - def test_get_isolated_margin_account_detail_v1_req_model(self): - """ - get_isolated_margin_account_detail_v1 - Get Account Detail - Isolated Margin - V1 - /api/v1/isolated/account/{symbol} - """ - data = "{\"symbol\": \"example_string_default_value\"}" - req = GetIsolatedMarginAccountDetailV1Req.from_json(data) - - def test_get_isolated_margin_account_detail_v1_resp_model(self): - """ - get_isolated_margin_account_detail_v1 - Get Account Detail - Isolated Margin - V1 - /api/v1/isolated/account/{symbol} - """ - data = "{\n \"code\": \"200000\",\n \"data\": {\n \"symbol\": \"BTC-USDT\",\n \"status\": \"CLEAR\",\n \"debtRatio\": \"0\",\n \"baseAsset\": {\n \"currency\": \"BTC\",\n \"totalBalance\": \"0\",\n \"holdBalance\": \"0\",\n \"availableBalance\": \"0\",\n \"liability\": \"0\",\n \"interest\": \"0\",\n \"borrowableAmount\": \"0\"\n },\n \"quoteAsset\": {\n \"currency\": \"USDT\",\n \"totalBalance\": \"0.01\",\n \"holdBalance\": \"0\",\n \"availableBalance\": \"0.01\",\n \"liability\": \"0\",\n \"interest\": \"0\",\n \"borrowableAmount\": \"0\"\n }\n }\n}" - common_response = RestResponse.from_json(data) - resp = GetIsolatedMarginAccountDetailV1Resp.from_dict( - common_response.data) - - def test_get_isolated_margin_account_list_v1_req_model(self): - """ - get_isolated_margin_account_list_v1 - Get Account List - Isolated Margin - V1 - /api/v1/isolated/accounts - """ - data = "{\"balanceCurrency\": \"USDT\"}" - req = GetIsolatedMarginAccountListV1Req.from_json(data) - - def test_get_isolated_margin_account_list_v1_resp_model(self): - """ - get_isolated_margin_account_list_v1 - Get Account List - Isolated Margin - V1 - /api/v1/isolated/accounts - """ - data = "{\n \"code\": \"200000\",\n \"data\": {\n \"totalConversionBalance\": \"0.01\",\n \"liabilityConversionBalance\": \"0\",\n \"assets\": [\n {\n \"symbol\": \"BTC-USDT\",\n \"status\": \"CLEAR\",\n \"debtRatio\": \"0\",\n \"baseAsset\": {\n \"currency\": \"BTC\",\n \"totalBalance\": \"0\",\n \"holdBalance\": \"0\",\n \"availableBalance\": \"0\",\n \"liability\": \"0\",\n \"interest\": \"0\",\n \"borrowableAmount\": \"0\"\n },\n \"quoteAsset\": {\n \"currency\": \"USDT\",\n \"totalBalance\": \"0.01\",\n \"holdBalance\": \"0\",\n \"availableBalance\": \"0.01\",\n \"liability\": \"0\",\n \"interest\": \"0\",\n \"borrowableAmount\": \"0\"\n }\n }\n ]\n }\n}" - common_response = RestResponse.from_json(data) - resp = GetIsolatedMarginAccountListV1Resp.from_dict( - common_response.data) - - def test_get_margin_account_detail_req_model(self): + def test_get_margin_hf_ledger_req_model(self): """ - get_margin_account_detail - Get Account Detail - Margin - /api/v1/margin/account + get_margin_hf_ledger + Get Account Ledgers - Margin_hf + /api/v3/hf/margin/account/ledgers """ + data = "{\"currency\": \"BTC\", \"direction\": \"in\", \"bizType\": \"TRANSFER\", \"lastId\": 254062248624417, \"limit\": 100, \"startAt\": 1728663338000, \"endAt\": 1728692138000}" + req = GetMarginHfLedgerReq.from_json(data) - def test_get_margin_account_detail_resp_model(self): + def test_get_margin_hf_ledger_resp_model(self): """ - get_margin_account_detail - Get Account Detail - Margin - /api/v1/margin/account + get_margin_hf_ledger + Get Account Ledgers - Margin_hf + /api/v3/hf/margin/account/ledgers """ - data = "{\n \"code\": \"200000\",\n \"data\": {\n \"debtRatio\": \"0\",\n \"accounts\": [\n {\n \"currency\": \"USDT\",\n \"totalBalance\": \"0.03\",\n \"availableBalance\": \"0.02\",\n \"holdBalance\": \"0.01\",\n \"liability\": \"0\",\n \"maxBorrowSize\": \"0\"\n }\n ]\n }\n}" + data = "{\"code\":\"200000\",\"data\":[{\"id\":1949641706720,\"currency\":\"USDT\",\"amount\":\"0.01000000\",\"fee\":\"0.00000000\",\"balance\":\"0.01000000\",\"accountType\":\"MARGIN_V2\",\"bizType\":\"TRANSFER\",\"direction\":\"in\",\"createdAt\":1728664091208,\"context\":\"{}\",\"tax\":\"0.00000000\"}]}" common_response = RestResponse.from_json(data) - resp = GetMarginAccountDetailResp.from_dict(common_response.data) + resp = GetMarginHfLedgerResp.from_dict(common_response.data) def test_get_futures_ledger_req_model(self): """ @@ -219,93 +253,59 @@ def test_get_futures_ledger_resp_model(self): common_response = RestResponse.from_json(data) resp = GetFuturesLedgerResp.from_dict(common_response.data) - def test_get_apikey_info_req_model(self): - """ - get_apikey_info - Get Apikey Info - /api/v1/user/api-key - """ - - def test_get_apikey_info_resp_model(self): - """ - get_apikey_info - Get Apikey Info - /api/v1/user/api-key - """ - data = "{\n \"code\": \"200000\",\n \"data\": {\n \"remark\": \"account1\",\n \"apiKey\": \"6705f5c311545b000157d3eb\",\n \"apiVersion\": 3,\n \"permission\": \"General,Futures,Spot,Earn,InnerTransfer,Transfer,Margin\",\n \"ipWhitelist\": \"203.**.154,103.**.34\",\n \"createdAt\": 1728443843000,\n \"uid\": 165111215,\n \"isMaster\": true\n }\n}" - common_response = RestResponse.from_json(data) - resp = GetApikeyInfoResp.from_dict(common_response.data) - - def test_get_account_info_req_model(self): - """ - get_account_info - Get Account Summary Info - /api/v2/user-info - """ - - def test_get_account_info_resp_model(self): - """ - get_account_info - Get Account Summary Info - /api/v2/user-info - """ - data = "{\n \"code\": \"200000\",\n \"data\": {\n \"level\": 0,\n \"subQuantity\": 3,\n \"spotSubQuantity\": 3,\n \"marginSubQuantity\": 2,\n \"futuresSubQuantity\": 2,\n \"optionSubQuantity\": 0,\n \"maxSubQuantity\": 5,\n \"maxDefaultSubQuantity\": 5,\n \"maxSpotSubQuantity\": 0,\n \"maxMarginSubQuantity\": 0,\n \"maxFuturesSubQuantity\": 0,\n \"maxOptionSubQuantity\": 0\n }\n}" - common_response = RestResponse.from_json(data) - resp = GetAccountInfoResp.from_dict(common_response.data) - - def test_get_margin_hf_ledger_req_model(self): + def test_get_margin_account_detail_req_model(self): """ - get_margin_hf_ledger - Get Account Ledgers - Margin_hf - /api/v3/hf/margin/account/ledgers + get_margin_account_detail + Get Account Detail - Margin + /api/v1/margin/account """ - data = "{\"currency\": \"BTC\", \"direction\": \"in\", \"bizType\": \"TRANSFER\", \"lastId\": 254062248624417, \"limit\": 100, \"startAt\": 1728663338000, \"endAt\": 1728692138000}" - req = GetMarginHfLedgerReq.from_json(data) - def test_get_margin_hf_ledger_resp_model(self): + def test_get_margin_account_detail_resp_model(self): """ - get_margin_hf_ledger - Get Account Ledgers - Margin_hf - /api/v3/hf/margin/account/ledgers + get_margin_account_detail + Get Account Detail - Margin + /api/v1/margin/account """ - data = "{\"code\":\"200000\",\"data\":[{\"id\":1949641706720,\"currency\":\"USDT\",\"amount\":\"0.01000000\",\"fee\":\"0.00000000\",\"balance\":\"0.01000000\",\"accountType\":\"MARGIN_V2\",\"bizType\":\"TRANSFER\",\"direction\":\"in\",\"createdAt\":1728664091208,\"context\":\"{}\",\"tax\":\"0.00000000\"}]}" + data = "{\n \"code\": \"200000\",\n \"data\": {\n \"debtRatio\": \"0\",\n \"accounts\": [\n {\n \"currency\": \"USDT\",\n \"totalBalance\": \"0.03\",\n \"availableBalance\": \"0.02\",\n \"holdBalance\": \"0.01\",\n \"liability\": \"0\",\n \"maxBorrowSize\": \"0\"\n }\n ]\n }\n}" common_response = RestResponse.from_json(data) - resp = GetMarginHfLedgerResp.from_dict(common_response.data) + resp = GetMarginAccountDetailResp.from_dict(common_response.data) - def test_get_isolated_margin_account_req_model(self): + def test_get_isolated_margin_account_list_v1_req_model(self): """ - get_isolated_margin_account - Get Account - Isolated Margin - /api/v3/isolated/accounts + get_isolated_margin_account_list_v1 + Get Account List - Isolated Margin - V1 + /api/v1/isolated/accounts """ - data = "{\"symbol\": \"example_string_default_value\", \"quoteCurrency\": \"USDT\", \"queryType\": \"ISOLATED\"}" - req = GetIsolatedMarginAccountReq.from_json(data) + data = "{\"balanceCurrency\": \"USDT\"}" + req = GetIsolatedMarginAccountListV1Req.from_json(data) - def test_get_isolated_margin_account_resp_model(self): + def test_get_isolated_margin_account_list_v1_resp_model(self): """ - get_isolated_margin_account - Get Account - Isolated Margin - /api/v3/isolated/accounts + get_isolated_margin_account_list_v1 + Get Account List - Isolated Margin - V1 + /api/v1/isolated/accounts """ - data = "{\n \"code\": \"200000\",\n \"data\": {\n \"totalAssetOfQuoteCurrency\": \"0.01\",\n \"totalLiabilityOfQuoteCurrency\": \"0\",\n \"timestamp\": 1728725465994,\n \"assets\": [\n {\n \"symbol\": \"BTC-USDT\",\n \"status\": \"EFFECTIVE\",\n \"debtRatio\": \"0\",\n \"baseAsset\": {\n \"currency\": \"BTC\",\n \"borrowEnabled\": true,\n \"transferInEnabled\": true,\n \"liability\": \"0\",\n \"total\": \"0\",\n \"available\": \"0\",\n \"hold\": \"0\",\n \"maxBorrowSize\": \"0\"\n },\n \"quoteAsset\": {\n \"currency\": \"USDT\",\n \"borrowEnabled\": true,\n \"transferInEnabled\": true,\n \"liability\": \"0\",\n \"total\": \"0.01\",\n \"available\": \"0.01\",\n \"hold\": \"0\",\n \"maxBorrowSize\": \"0\"\n }\n }\n ]\n }\n}" + data = "{\n \"code\": \"200000\",\n \"data\": {\n \"totalConversionBalance\": \"0.01\",\n \"liabilityConversionBalance\": \"0\",\n \"assets\": [\n {\n \"symbol\": \"BTC-USDT\",\n \"status\": \"CLEAR\",\n \"debtRatio\": \"0\",\n \"baseAsset\": {\n \"currency\": \"BTC\",\n \"totalBalance\": \"0\",\n \"holdBalance\": \"0\",\n \"availableBalance\": \"0\",\n \"liability\": \"0\",\n \"interest\": \"0\",\n \"borrowableAmount\": \"0\"\n },\n \"quoteAsset\": {\n \"currency\": \"USDT\",\n \"totalBalance\": \"0.01\",\n \"holdBalance\": \"0\",\n \"availableBalance\": \"0.01\",\n \"liability\": \"0\",\n \"interest\": \"0\",\n \"borrowableAmount\": \"0\"\n }\n }\n ]\n }\n}" common_response = RestResponse.from_json(data) - resp = GetIsolatedMarginAccountResp.from_dict(common_response.data) + resp = GetIsolatedMarginAccountListV1Resp.from_dict( + common_response.data) - def test_get_cross_margin_account_req_model(self): + def test_get_isolated_margin_account_detail_v1_req_model(self): """ - get_cross_margin_account - Get Account - Cross Margin - /api/v3/margin/accounts + get_isolated_margin_account_detail_v1 + Get Account Detail - Isolated Margin - V1 + /api/v1/isolated/account/{symbol} """ - data = "{\"quoteCurrency\": \"USDT\", \"queryType\": \"MARGIN\"}" - req = GetCrossMarginAccountReq.from_json(data) + data = "{\"symbol\": \"example_string_default_value\"}" + req = GetIsolatedMarginAccountDetailV1Req.from_json(data) - def test_get_cross_margin_account_resp_model(self): + def test_get_isolated_margin_account_detail_v1_resp_model(self): """ - get_cross_margin_account - Get Account - Cross Margin - /api/v3/margin/accounts + get_isolated_margin_account_detail_v1 + Get Account Detail - Isolated Margin - V1 + /api/v1/isolated/account/{symbol} """ - data = "{\n \"code\": \"200000\",\n \"data\": {\n \"totalAssetOfQuoteCurrency\": \"0.02\",\n \"totalLiabilityOfQuoteCurrency\": \"0\",\n \"debtRatio\": \"0\",\n \"status\": \"EFFECTIVE\",\n \"accounts\": [\n {\n \"currency\": \"USDT\",\n \"total\": \"0.02\",\n \"available\": \"0.02\",\n \"hold\": \"0\",\n \"liability\": \"0\",\n \"maxBorrowSize\": \"0\",\n \"borrowEnabled\": true,\n \"transferInEnabled\": true\n }\n ]\n }\n}" + data = "{\n \"code\": \"200000\",\n \"data\": {\n \"symbol\": \"BTC-USDT\",\n \"status\": \"CLEAR\",\n \"debtRatio\": \"0\",\n \"baseAsset\": {\n \"currency\": \"BTC\",\n \"totalBalance\": \"0\",\n \"holdBalance\": \"0\",\n \"availableBalance\": \"0\",\n \"liability\": \"0\",\n \"interest\": \"0\",\n \"borrowableAmount\": \"0\"\n },\n \"quoteAsset\": {\n \"currency\": \"USDT\",\n \"totalBalance\": \"0.01\",\n \"holdBalance\": \"0\",\n \"availableBalance\": \"0.01\",\n \"liability\": \"0\",\n \"interest\": \"0\",\n \"borrowableAmount\": \"0\"\n }\n }\n}" common_response = RestResponse.from_json(data) - resp = GetCrossMarginAccountResp.from_dict(common_response.data) + resp = GetIsolatedMarginAccountDetailV1Resp.from_dict( + common_response.data) diff --git a/sdk/python/kucoin_universal_sdk/generate/account/deposit/api_deposit.py b/sdk/python/kucoin_universal_sdk/generate/account/deposit/api_deposit.py index e100ba1f..cc5aa1ca 100644 --- a/sdk/python/kucoin_universal_sdk/generate/account/deposit/api_deposit.py +++ b/sdk/python/kucoin_universal_sdk/generate/account/deposit/api_deposit.py @@ -23,13 +23,12 @@ class DepositAPI(ABC): @abstractmethod - @deprecated('') - def get_deposit_address_v1(self, req: GetDepositAddressV1Req, - **kwargs: Any) -> GetDepositAddressV1Resp: + def add_deposit_address_v3(self, req: AddDepositAddressV3Req, + **kwargs: Any) -> AddDepositAddressV3Resp: """ - summary: Get Deposit Addresses - V1 - description: Get all deposit addresses for the currency you intend to deposit. If the returned data is empty, you may need to Add Deposit Address first. - documentation: https://www.kucoin.com/docs-new/api-3470305 + summary: Add Deposit Address(V3) + description: Request via this endpoint to create a deposit address for a currency you intend to deposit. + documentation: https://www.kucoin.com/docs-new/api-3470142 +---------------------+------------+ | Extra API Info | Value | +---------------------+------------+ @@ -37,19 +36,18 @@ def get_deposit_address_v1(self, req: GetDepositAddressV1Req, | API-CHANNEL | PRIVATE | | API-PERMISSION | GENERAL | | API-RATE-LIMIT-POOL | MANAGEMENT | - | API-RATE-LIMIT | 5 | + | API-RATE-LIMIT | 20 | +---------------------+------------+ """ pass @abstractmethod - @deprecated('') - def add_deposit_address_v1(self, req: AddDepositAddressV1Req, - **kwargs: Any) -> AddDepositAddressV1Resp: + def get_deposit_address_v3(self, req: GetDepositAddressV3Req, + **kwargs: Any) -> GetDepositAddressV3Resp: """ - summary: Add Deposit Address - V1 - description: Request via this endpoint to create a deposit address for a currency you intend to deposit. - documentation: https://www.kucoin.com/docs-new/api-3470309 + summary: Get Deposit Address(V3) + description: Get all deposit addresses for the currency you intend to deposit. If the returned data is empty, you may need to Add Deposit Address first. + documentation: https://www.kucoin.com/docs-new/api-3470140 +---------------------+------------+ | Extra API Info | Value | +---------------------+------------+ @@ -57,7 +55,7 @@ def add_deposit_address_v1(self, req: AddDepositAddressV1Req, | API-CHANNEL | PRIVATE | | API-PERMISSION | GENERAL | | API-RATE-LIMIT-POOL | MANAGEMENT | - | API-RATE-LIMIT | 20 | + | API-RATE-LIMIT | 5 | +---------------------+------------+ """ pass @@ -83,12 +81,12 @@ def get_deposit_history(self, req: GetDepositHistoryReq, @abstractmethod @deprecated('') - def get_deposit_history_old(self, req: GetDepositHistoryOldReq, - **kwargs: Any) -> GetDepositHistoryOldResp: + def get_deposit_address_v2(self, req: GetDepositAddressV2Req, + **kwargs: Any) -> GetDepositAddressV2Resp: """ - summary: Get Deposit History - Old - description: Request via this endpoint to get the V1 historical deposits list on KuCoin. The return value is the data after Pagination, sorted in descending order according to time. - documentation: https://www.kucoin.com/docs-new/api-3470306 + summary: Get Deposit Addresses(V2) + description: Get all deposit addresses for the currency you intend to deposit. If the returned data is empty, you may need to Add Deposit Address first. + documentation: https://www.kucoin.com/docs-new/api-3470300 +---------------------+------------+ | Extra API Info | Value | +---------------------+------------+ @@ -103,12 +101,12 @@ def get_deposit_history_old(self, req: GetDepositHistoryOldReq, @abstractmethod @deprecated('') - def get_deposit_address_v2(self, req: GetDepositAddressV2Req, - **kwargs: Any) -> GetDepositAddressV2Resp: + def get_deposit_address_v1(self, req: GetDepositAddressV1Req, + **kwargs: Any) -> GetDepositAddressV1Resp: """ - summary: Get Deposit Addresses(V2) + summary: Get Deposit Addresses - V1 description: Get all deposit addresses for the currency you intend to deposit. If the returned data is empty, you may need to Add Deposit Address first. - documentation: https://www.kucoin.com/docs-new/api-3470300 + documentation: https://www.kucoin.com/docs-new/api-3470305 +---------------------+------------+ | Extra API Info | Value | +---------------------+------------+ @@ -122,12 +120,13 @@ def get_deposit_address_v2(self, req: GetDepositAddressV2Req, pass @abstractmethod - def add_deposit_address_v3(self, req: AddDepositAddressV3Req, - **kwargs: Any) -> AddDepositAddressV3Resp: + @deprecated('') + def get_deposit_history_old(self, req: GetDepositHistoryOldReq, + **kwargs: Any) -> GetDepositHistoryOldResp: """ - summary: Add Deposit Address(V3) - description: Request via this endpoint to create a deposit address for a currency you intend to deposit. - documentation: https://www.kucoin.com/docs-new/api-3470142 + summary: Get Deposit History - Old + description: Request via this endpoint to get the V1 historical deposits list on KuCoin. The return value is the data after Pagination, sorted in descending order according to time. + documentation: https://www.kucoin.com/docs-new/api-3470306 +---------------------+------------+ | Extra API Info | Value | +---------------------+------------+ @@ -135,18 +134,19 @@ def add_deposit_address_v3(self, req: AddDepositAddressV3Req, | API-CHANNEL | PRIVATE | | API-PERMISSION | GENERAL | | API-RATE-LIMIT-POOL | MANAGEMENT | - | API-RATE-LIMIT | 20 | + | API-RATE-LIMIT | 5 | +---------------------+------------+ """ pass @abstractmethod - def get_deposit_address_v3(self, req: GetDepositAddressV3Req, - **kwargs: Any) -> GetDepositAddressV3Resp: + @deprecated('') + def add_deposit_address_v1(self, req: AddDepositAddressV1Req, + **kwargs: Any) -> AddDepositAddressV1Resp: """ - summary: Get Deposit Address(V3) - description: Get all deposit addresses for the currency you intend to deposit. If the returned data is empty, you may need to Add Deposit Address first. - documentation: https://www.kucoin.com/docs-new/api-3470140 + summary: Add Deposit Address - V1 + description: Request via this endpoint to create a deposit address for a currency you intend to deposit. + documentation: https://www.kucoin.com/docs-new/api-3470309 +---------------------+------------+ | Extra API Info | Value | +---------------------+------------+ @@ -154,7 +154,7 @@ def get_deposit_address_v3(self, req: GetDepositAddressV3Req, | API-CHANNEL | PRIVATE | | API-PERMISSION | GENERAL | | API-RATE-LIMIT-POOL | MANAGEMENT | - | API-RATE-LIMIT | 5 | + | API-RATE-LIMIT | 20 | +---------------------+------------+ """ pass @@ -165,17 +165,17 @@ class DepositAPIImpl(DepositAPI): def __init__(self, transport: Transport): self.transport = transport - def get_deposit_address_v1(self, req: GetDepositAddressV1Req, - **kwargs: Any) -> GetDepositAddressV1Resp: - return self.transport.call("spot", False, "GET", - "/api/v1/deposit-addresses", req, - GetDepositAddressV1Resp(), False, **kwargs) - - def add_deposit_address_v1(self, req: AddDepositAddressV1Req, - **kwargs: Any) -> AddDepositAddressV1Resp: + def add_deposit_address_v3(self, req: AddDepositAddressV3Req, + **kwargs: Any) -> AddDepositAddressV3Resp: return self.transport.call("spot", False, "POST", - "/api/v1/deposit-addresses", req, - AddDepositAddressV1Resp(), False, **kwargs) + "/api/v3/deposit-address/create", req, + AddDepositAddressV3Resp(), False, **kwargs) + + def get_deposit_address_v3(self, req: GetDepositAddressV3Req, + **kwargs: Any) -> GetDepositAddressV3Resp: + return self.transport.call("spot", False, "GET", + "/api/v3/deposit-addresses", req, + GetDepositAddressV3Resp(), False, **kwargs) def get_deposit_history(self, req: GetDepositHistoryReq, **kwargs: Any) -> GetDepositHistoryResp: @@ -183,26 +183,26 @@ def get_deposit_history(self, req: GetDepositHistoryReq, "/api/v1/deposits", req, GetDepositHistoryResp(), False, **kwargs) - def get_deposit_history_old(self, req: GetDepositHistoryOldReq, - **kwargs: Any) -> GetDepositHistoryOldResp: - return self.transport.call("spot", False, "GET", - "/api/v1/hist-deposits", req, - GetDepositHistoryOldResp(), False, **kwargs) - def get_deposit_address_v2(self, req: GetDepositAddressV2Req, **kwargs: Any) -> GetDepositAddressV2Resp: return self.transport.call("spot", False, "GET", "/api/v2/deposit-addresses", req, GetDepositAddressV2Resp(), False, **kwargs) - def add_deposit_address_v3(self, req: AddDepositAddressV3Req, - **kwargs: Any) -> AddDepositAddressV3Resp: - return self.transport.call("spot", False, "POST", - "/api/v3/deposit-address/create", req, - AddDepositAddressV3Resp(), False, **kwargs) + def get_deposit_address_v1(self, req: GetDepositAddressV1Req, + **kwargs: Any) -> GetDepositAddressV1Resp: + return self.transport.call("spot", False, "GET", + "/api/v1/deposit-addresses", req, + GetDepositAddressV1Resp(), False, **kwargs) - def get_deposit_address_v3(self, req: GetDepositAddressV3Req, - **kwargs: Any) -> GetDepositAddressV3Resp: + def get_deposit_history_old(self, req: GetDepositHistoryOldReq, + **kwargs: Any) -> GetDepositHistoryOldResp: return self.transport.call("spot", False, "GET", - "/api/v3/deposit-addresses", req, - GetDepositAddressV3Resp(), False, **kwargs) + "/api/v1/hist-deposits", req, + GetDepositHistoryOldResp(), False, **kwargs) + + def add_deposit_address_v1(self, req: AddDepositAddressV1Req, + **kwargs: Any) -> AddDepositAddressV1Resp: + return self.transport.call("spot", False, "POST", + "/api/v1/deposit-addresses", req, + AddDepositAddressV1Resp(), False, **kwargs) diff --git a/sdk/python/kucoin_universal_sdk/generate/account/deposit/api_deposit.template b/sdk/python/kucoin_universal_sdk/generate/account/deposit/api_deposit.template index cd98ad4a..8f7eb611 100644 --- a/sdk/python/kucoin_universal_sdk/generate/account/deposit/api_deposit.template +++ b/sdk/python/kucoin_universal_sdk/generate/account/deposit/api_deposit.template @@ -1,18 +1,18 @@ # API FUNCTION TEMPLATE -def test_get_deposit_address_v1_req(self): +def test_add_deposit_address_v3_req(self): """ - get_deposit_address_v1 - Get Deposit Addresses - V1 - /api/v1/deposit-addresses + add_deposit_address_v3 + Add Deposit Address(V3) + /api/v3/deposit-address/create """ - builder = GetDepositAddressV1ReqBuilder() - builder.set_currency(?).set_chain(?) + builder = AddDepositAddressV3ReqBuilder() + builder.set_currency(?).set_chain(?).set_to(?).set_amount(?) req = builder.build() try: - resp = self.api.get_deposit_address_v1(req) + resp = self.api.add_deposit_address_v3(req) print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) @@ -20,18 +20,18 @@ def test_get_deposit_address_v1_req(self): print("error: ", e) raise e -def test_add_deposit_address_v1_req(self): +def test_get_deposit_address_v3_req(self): """ - add_deposit_address_v1 - Add Deposit Address - V1 - /api/v1/deposit-addresses + get_deposit_address_v3 + Get Deposit Address(V3) + /api/v3/deposit-addresses """ - builder = AddDepositAddressV1ReqBuilder() - builder.set_currency(?).set_chain(?) + builder = GetDepositAddressV3ReqBuilder() + builder.set_currency(?).set_amount(?).set_chain(?) req = builder.build() try: - resp = self.api.add_deposit_address_v1(req) + resp = self.api.get_deposit_address_v3(req) print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) @@ -58,18 +58,18 @@ def test_get_deposit_history_req(self): print("error: ", e) raise e -def test_get_deposit_history_old_req(self): +def test_get_deposit_address_v2_req(self): """ - get_deposit_history_old - Get Deposit History - Old - /api/v1/hist-deposits + get_deposit_address_v2 + Get Deposit Addresses(V2) + /api/v2/deposit-addresses """ - builder = GetDepositHistoryOldReqBuilder() - builder.set_currency(?).set_status(?).set_start_at(?).set_end_at(?) + builder = GetDepositAddressV2ReqBuilder() + builder.set_currency(?) req = builder.build() try: - resp = self.api.get_deposit_history_old(req) + resp = self.api.get_deposit_address_v2(req) print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) @@ -77,18 +77,18 @@ def test_get_deposit_history_old_req(self): print("error: ", e) raise e -def test_get_deposit_address_v2_req(self): +def test_get_deposit_address_v1_req(self): """ - get_deposit_address_v2 - Get Deposit Addresses(V2) - /api/v2/deposit-addresses + get_deposit_address_v1 + Get Deposit Addresses - V1 + /api/v1/deposit-addresses """ - builder = GetDepositAddressV2ReqBuilder() - builder.set_currency(?) + builder = GetDepositAddressV1ReqBuilder() + builder.set_currency(?).set_chain(?) req = builder.build() try: - resp = self.api.get_deposit_address_v2(req) + resp = self.api.get_deposit_address_v1(req) print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) @@ -96,18 +96,18 @@ def test_get_deposit_address_v2_req(self): print("error: ", e) raise e -def test_add_deposit_address_v3_req(self): +def test_get_deposit_history_old_req(self): """ - add_deposit_address_v3 - Add Deposit Address(V3) - /api/v3/deposit-address/create + get_deposit_history_old + Get Deposit History - Old + /api/v1/hist-deposits """ - builder = AddDepositAddressV3ReqBuilder() - builder.set_currency(?).set_chain(?).set_to(?).set_amount(?) + builder = GetDepositHistoryOldReqBuilder() + builder.set_currency(?).set_status(?).set_start_at(?).set_end_at(?) req = builder.build() try: - resp = self.api.add_deposit_address_v3(req) + resp = self.api.get_deposit_history_old(req) print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) @@ -115,18 +115,18 @@ def test_add_deposit_address_v3_req(self): print("error: ", e) raise e -def test_get_deposit_address_v3_req(self): +def test_add_deposit_address_v1_req(self): """ - get_deposit_address_v3 - Get Deposit Address(V3) - /api/v3/deposit-addresses + add_deposit_address_v1 + Add Deposit Address - V1 + /api/v1/deposit-addresses """ - builder = GetDepositAddressV3ReqBuilder() - builder.set_currency(?).set_amount(?).set_chain(?) + builder = AddDepositAddressV1ReqBuilder() + builder.set_currency(?).set_chain(?) req = builder.build() try: - resp = self.api.get_deposit_address_v3(req) + resp = self.api.add_deposit_address_v1(req) print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) diff --git a/sdk/python/kucoin_universal_sdk/generate/account/deposit/api_deposit_test.py b/sdk/python/kucoin_universal_sdk/generate/account/deposit/api_deposit_test.py index 8b3a6d0b..5d7006e2 100644 --- a/sdk/python/kucoin_universal_sdk/generate/account/deposit/api_deposit_test.py +++ b/sdk/python/kucoin_universal_sdk/generate/account/deposit/api_deposit_test.py @@ -19,43 +19,43 @@ class DepositAPITest(unittest.TestCase): - def test_get_deposit_address_v1_req_model(self): + def test_add_deposit_address_v3_req_model(self): """ - get_deposit_address_v1 - Get Deposit Addresses - V1 - /api/v1/deposit-addresses + add_deposit_address_v3 + Add Deposit Address(V3) + /api/v3/deposit-address/create """ - data = "{\"currency\": \"BTC\", \"chain\": \"eth\"}" - req = GetDepositAddressV1Req.from_json(data) + data = "{\"currency\": \"TON\", \"chain\": \"ton\", \"to\": \"trade\"}" + req = AddDepositAddressV3Req.from_json(data) - def test_get_deposit_address_v1_resp_model(self): + def test_add_deposit_address_v3_resp_model(self): """ - get_deposit_address_v1 - Get Deposit Addresses - V1 - /api/v1/deposit-addresses + add_deposit_address_v3 + Add Deposit Address(V3) + /api/v3/deposit-address/create """ - data = "{\n \"code\": \"200000\",\n \"data\": {\n \"address\": \"0xea220bf61c3c2b0adc2cfa29fec3d2677745a379\",\n \"memo\": \"\",\n \"chain\": \"ERC20\",\n \"chainId\": \"eth\",\n \"to\": \"MAIN\",\n \"currency\": \"USDT\"\n }\n}" + data = "{\"code\":\"200000\",\"data\":{\"address\":\"EQCA1BI4QRZ8qYmskSRDzJmkucGodYRTZCf_b9hckjla6dZl\",\"memo\":\"2090821203\",\"chainId\":\"ton\",\"to\":\"TRADE\",\"expirationDate\":0,\"currency\":\"TON\",\"chainName\":\"TON\"}}" common_response = RestResponse.from_json(data) - resp = GetDepositAddressV1Resp.from_dict(common_response.data) + resp = AddDepositAddressV3Resp.from_dict(common_response.data) - def test_add_deposit_address_v1_req_model(self): + def test_get_deposit_address_v3_req_model(self): """ - add_deposit_address_v1 - Add Deposit Address - V1 - /api/v1/deposit-addresses + get_deposit_address_v3 + Get Deposit Address(V3) + /api/v3/deposit-addresses """ - data = "{\"currency\": \"ETH\", \"chain\": \"eth\"}" - req = AddDepositAddressV1Req.from_json(data) + data = "{\"currency\": \"BTC\", \"amount\": \"example_string_default_value\", \"chain\": \"example_string_default_value\"}" + req = GetDepositAddressV3Req.from_json(data) - def test_add_deposit_address_v1_resp_model(self): + def test_get_deposit_address_v3_resp_model(self): """ - add_deposit_address_v1 - Add Deposit Address - V1 - /api/v1/deposit-addresses + get_deposit_address_v3 + Get Deposit Address(V3) + /api/v3/deposit-addresses """ - data = "{\"code\":\"200000\",\"data\":{\"address\":\"0x02028456f38e78609904e8a002c787ede7a73d7c\",\"memo\":null,\"chain\":\"ERC20\",\"chainId\":\"eth\",\"to\":\"MAIN\",\"currency\":\"ETH\"}}" + data = "{\"code\":\"200000\",\"data\":[{\"address\":\"TSv3L1fS7yA3SxzKD8c1qdX4nLP6rqNxYz\",\"memo\":\"\",\"chainId\":\"trx\",\"to\":\"TRADE\",\"expirationDate\":0,\"currency\":\"USDT\",\"contractAddress\":\"TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t\",\"chainName\":\"TRC20\"},{\"address\":\"0x551e823a3b36865e8c5dc6e6ac6cc0b00d98533e\",\"memo\":\"\",\"chainId\":\"kcc\",\"to\":\"TRADE\",\"expirationDate\":0,\"currency\":\"USDT\",\"contractAddress\":\"0x0039f574ee5cc39bdd162e9a88e3eb1f111baf48\",\"chainName\":\"KCC\"},{\"address\":\"EQCA1BI4QRZ8qYmskSRDzJmkucGodYRTZCf_b9hckjla6dZl\",\"memo\":\"2085202643\",\"chainId\":\"ton\",\"to\":\"TRADE\",\"expirationDate\":0,\"currency\":\"USDT\",\"contractAddress\":\"EQCxE6mUtQJKFnGfaROTKOt1lZbDiiX1kCixRv7Nw2Id_sDs\",\"chainName\":\"TON\"},{\"address\":\"0x0a2586d5a901c8e7e68f6b0dc83bfd8bd8600ff5\",\"memo\":\"\",\"chainId\":\"eth\",\"to\":\"MAIN\",\"expirationDate\":0,\"currency\":\"USDT\",\"contractAddress\":\"0xdac17f958d2ee523a2206206994597c13d831ec7\",\"chainName\":\"ERC20\"}]}" common_response = RestResponse.from_json(data) - resp = AddDepositAddressV1Resp.from_dict(common_response.data) + resp = GetDepositAddressV3Resp.from_dict(common_response.data) def test_get_deposit_history_req_model(self): """ @@ -76,25 +76,6 @@ def test_get_deposit_history_resp_model(self): common_response = RestResponse.from_json(data) resp = GetDepositHistoryResp.from_dict(common_response.data) - def test_get_deposit_history_old_req_model(self): - """ - get_deposit_history_old - Get Deposit History - Old - /api/v1/hist-deposits - """ - data = "{\"currency\": \"BTC\", \"status\": \"SUCCESS\", \"startAt\": 1728663338000, \"endAt\": 1728692138000}" - req = GetDepositHistoryOldReq.from_json(data) - - def test_get_deposit_history_old_resp_model(self): - """ - get_deposit_history_old - Get Deposit History - Old - /api/v1/hist-deposits - """ - data = "{\n \"code\": \"200000\",\n \"data\": {\n \"currentPage\": 1,\n \"pageSize\": 50,\n \"totalNum\": 0,\n \"totalPage\": 0,\n \"items\": [\n {\n \"currency\": \"BTC\",\n \"createAt\": 1528536998,\n \"amount\": \"0.03266638\",\n \"walletTxId\": \"55c643bc2c68d6f17266383ac1be9e454038864b929ae7cee0bc408cc5c869e8@12ffGWmMMD1zA1WbFm7Ho3JZ1w6NYXjpFk@234\",\n \"isInner\": false,\n \"status\": \"SUCCESS\"\n }\n ]\n }\n}" - common_response = RestResponse.from_json(data) - resp = GetDepositHistoryOldResp.from_dict(common_response.data) - def test_get_deposit_address_v2_req_model(self): """ get_deposit_address_v2 @@ -114,40 +95,59 @@ def test_get_deposit_address_v2_resp_model(self): common_response = RestResponse.from_json(data) resp = GetDepositAddressV2Resp.from_dict(common_response.data) - def test_add_deposit_address_v3_req_model(self): + def test_get_deposit_address_v1_req_model(self): """ - add_deposit_address_v3 - Add Deposit Address(V3) - /api/v3/deposit-address/create + get_deposit_address_v1 + Get Deposit Addresses - V1 + /api/v1/deposit-addresses """ - data = "{\"currency\": \"TON\", \"chain\": \"ton\", \"to\": \"trade\"}" - req = AddDepositAddressV3Req.from_json(data) + data = "{\"currency\": \"BTC\", \"chain\": \"eth\"}" + req = GetDepositAddressV1Req.from_json(data) - def test_add_deposit_address_v3_resp_model(self): + def test_get_deposit_address_v1_resp_model(self): """ - add_deposit_address_v3 - Add Deposit Address(V3) - /api/v3/deposit-address/create + get_deposit_address_v1 + Get Deposit Addresses - V1 + /api/v1/deposit-addresses """ - data = "{\"code\":\"200000\",\"data\":{\"address\":\"EQCA1BI4QRZ8qYmskSRDzJmkucGodYRTZCf_b9hckjla6dZl\",\"memo\":\"2090821203\",\"chainId\":\"ton\",\"to\":\"TRADE\",\"expirationDate\":0,\"currency\":\"TON\",\"chainName\":\"TON\"}}" + data = "{\n \"code\": \"200000\",\n \"data\": {\n \"address\": \"0xea220bf61c3c2b0adc2cfa29fec3d2677745a379\",\n \"memo\": \"\",\n \"chain\": \"ERC20\",\n \"chainId\": \"eth\",\n \"to\": \"MAIN\",\n \"currency\": \"USDT\"\n }\n}" common_response = RestResponse.from_json(data) - resp = AddDepositAddressV3Resp.from_dict(common_response.data) + resp = GetDepositAddressV1Resp.from_dict(common_response.data) - def test_get_deposit_address_v3_req_model(self): + def test_get_deposit_history_old_req_model(self): """ - get_deposit_address_v3 - Get Deposit Address(V3) - /api/v3/deposit-addresses + get_deposit_history_old + Get Deposit History - Old + /api/v1/hist-deposits """ - data = "{\"currency\": \"BTC\", \"amount\": \"example_string_default_value\", \"chain\": \"example_string_default_value\"}" - req = GetDepositAddressV3Req.from_json(data) + data = "{\"currency\": \"BTC\", \"status\": \"SUCCESS\", \"startAt\": 1728663338000, \"endAt\": 1728692138000}" + req = GetDepositHistoryOldReq.from_json(data) - def test_get_deposit_address_v3_resp_model(self): + def test_get_deposit_history_old_resp_model(self): """ - get_deposit_address_v3 - Get Deposit Address(V3) - /api/v3/deposit-addresses + get_deposit_history_old + Get Deposit History - Old + /api/v1/hist-deposits """ - data = "{\"code\":\"200000\",\"data\":[{\"address\":\"TSv3L1fS7yA3SxzKD8c1qdX4nLP6rqNxYz\",\"memo\":\"\",\"chainId\":\"trx\",\"to\":\"TRADE\",\"expirationDate\":0,\"currency\":\"USDT\",\"contractAddress\":\"TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t\",\"chainName\":\"TRC20\"},{\"address\":\"0x551e823a3b36865e8c5dc6e6ac6cc0b00d98533e\",\"memo\":\"\",\"chainId\":\"kcc\",\"to\":\"TRADE\",\"expirationDate\":0,\"currency\":\"USDT\",\"contractAddress\":\"0x0039f574ee5cc39bdd162e9a88e3eb1f111baf48\",\"chainName\":\"KCC\"},{\"address\":\"EQCA1BI4QRZ8qYmskSRDzJmkucGodYRTZCf_b9hckjla6dZl\",\"memo\":\"2085202643\",\"chainId\":\"ton\",\"to\":\"TRADE\",\"expirationDate\":0,\"currency\":\"USDT\",\"contractAddress\":\"EQCxE6mUtQJKFnGfaROTKOt1lZbDiiX1kCixRv7Nw2Id_sDs\",\"chainName\":\"TON\"},{\"address\":\"0x0a2586d5a901c8e7e68f6b0dc83bfd8bd8600ff5\",\"memo\":\"\",\"chainId\":\"eth\",\"to\":\"MAIN\",\"expirationDate\":0,\"currency\":\"USDT\",\"contractAddress\":\"0xdac17f958d2ee523a2206206994597c13d831ec7\",\"chainName\":\"ERC20\"}]}" + data = "{\n \"code\": \"200000\",\n \"data\": {\n \"currentPage\": 1,\n \"pageSize\": 50,\n \"totalNum\": 0,\n \"totalPage\": 0,\n \"items\": [\n {\n \"currency\": \"BTC\",\n \"createAt\": 1528536998,\n \"amount\": \"0.03266638\",\n \"walletTxId\": \"55c643bc2c68d6f17266383ac1be9e454038864b929ae7cee0bc408cc5c869e8@12ffGWmMMD1zA1WbFm7Ho3JZ1w6NYXjpFk@234\",\n \"isInner\": false,\n \"status\": \"SUCCESS\"\n }\n ]\n }\n}" common_response = RestResponse.from_json(data) - resp = GetDepositAddressV3Resp.from_dict(common_response.data) + resp = GetDepositHistoryOldResp.from_dict(common_response.data) + + def test_add_deposit_address_v1_req_model(self): + """ + add_deposit_address_v1 + Add Deposit Address - V1 + /api/v1/deposit-addresses + """ + data = "{\"currency\": \"ETH\", \"chain\": \"eth\"}" + req = AddDepositAddressV1Req.from_json(data) + + def test_add_deposit_address_v1_resp_model(self): + """ + add_deposit_address_v1 + Add Deposit Address - V1 + /api/v1/deposit-addresses + """ + data = "{\"code\":\"200000\",\"data\":{\"address\":\"0x02028456f38e78609904e8a002c787ede7a73d7c\",\"memo\":null,\"chain\":\"ERC20\",\"chainId\":\"eth\",\"to\":\"MAIN\",\"currency\":\"ETH\"}}" + common_response = RestResponse.from_json(data) + resp = AddDepositAddressV1Resp.from_dict(common_response.data) diff --git a/sdk/python/kucoin_universal_sdk/generate/account/subaccount/api_sub_account.py b/sdk/python/kucoin_universal_sdk/generate/account/subaccount/api_sub_account.py index c793b53b..dab6df9d 100644 --- a/sdk/python/kucoin_universal_sdk/generate/account/subaccount/api_sub_account.py +++ b/sdk/python/kucoin_universal_sdk/generate/account/subaccount/api_sub_account.py @@ -33,33 +33,12 @@ class SubAccountAPI(ABC): @abstractmethod - def get_futures_sub_account_list_v2( - self, req: GetFuturesSubAccountListV2Req, - **kwargs: Any) -> GetFuturesSubAccountListV2Resp: - """ - summary: Get SubAccount List - Futures Balance(V2) - description: This endpoint can be used to get Futures sub-account information. - documentation: https://www.kucoin.com/docs-new/api-3470134 - +---------------------+---------+ - | Extra API Info | Value | - +---------------------+---------+ - | API-DOMAIN | FUTURES | - | API-CHANNEL | PRIVATE | - | API-PERMISSION | GENERAL | - | API-RATE-LIMIT-POOL | FUTURES | - | API-RATE-LIMIT | 6 | - +---------------------+---------+ - """ - pass - - @abstractmethod - @deprecated('') - def get_spot_sub_account_list_v1( - self, **kwargs: Any) -> GetSpotSubAccountListV1Resp: + def add_sub_account(self, req: AddSubAccountReq, + **kwargs: Any) -> AddSubAccountResp: """ - summary: Get SubAccount List - Spot Balance(V1) - description: This endpoint returns the account info of all sub-users. - documentation: https://www.kucoin.com/docs-new/api-3470299 + summary: Add SubAccount + description: This endpoint can be used to create sub-accounts. + documentation: https://www.kucoin.com/docs-new/api-3470135 +---------------------+------------+ | Extra API Info | Value | +---------------------+------------+ @@ -67,25 +46,25 @@ def get_spot_sub_account_list_v1( | API-CHANNEL | PRIVATE | | API-PERMISSION | GENERAL | | API-RATE-LIMIT-POOL | MANAGEMENT | - | API-RATE-LIMIT | 20 | + | API-RATE-LIMIT | 15 | +---------------------+------------+ """ pass @abstractmethod - def get_spot_sub_account_detail( - self, req: GetSpotSubAccountDetailReq, - **kwargs: Any) -> GetSpotSubAccountDetailResp: + def add_sub_account_margin_permission( + self, req: AddSubAccountMarginPermissionReq, + **kwargs: Any) -> AddSubAccountMarginPermissionResp: """ - summary: Get SubAccount Detail - Balance - description: This endpoint returns the account info of a sub-user specified by the subUserId. - documentation: https://www.kucoin.com/docs-new/api-3470132 + summary: Add SubAccount Margin Permission + description: This endpoint can be used to add sub-accounts Margin permission. Before using this endpoints, you need to ensure that the master account apikey has Margin permissions and the Margin function has been activated. + documentation: https://www.kucoin.com/docs-new/api-3470331 +---------------------+------------+ | Extra API Info | Value | +---------------------+------------+ | API-DOMAIN | SPOT | | API-CHANNEL | PRIVATE | - | API-PERMISSION | GENERAL | + | API-PERMISSION | MARGIN | | API-RATE-LIMIT-POOL | MANAGEMENT | | API-RATE-LIMIT | 15 | +---------------------+------------+ @@ -93,31 +72,33 @@ def get_spot_sub_account_detail( pass @abstractmethod - def delete_sub_account_api(self, req: DeleteSubAccountApiReq, - **kwargs: Any) -> DeleteSubAccountApiResp: + def add_sub_account_futures_permission( + self, req: AddSubAccountFuturesPermissionReq, + **kwargs: Any) -> AddSubAccountFuturesPermissionResp: """ - summary: Delete SubAccount API - description: This endpoint can be used to delete sub-account APIs. - documentation: https://www.kucoin.com/docs-new/api-3470137 + summary: Add SubAccount Futures Permission + description: This endpoint can be used to add sub-accounts Futures permission. Before using this endpoints, you need to ensure that the master account apikey has Futures permissions and the Futures function has been activated. + documentation: https://www.kucoin.com/docs-new/api-3470332 +---------------------+------------+ | Extra API Info | Value | +---------------------+------------+ | API-DOMAIN | SPOT | | API-CHANNEL | PRIVATE | - | API-PERMISSION | GENERAL | + | API-PERMISSION | FUTURES | | API-RATE-LIMIT-POOL | MANAGEMENT | - | API-RATE-LIMIT | 30 | + | API-RATE-LIMIT | 15 | +---------------------+------------+ """ pass @abstractmethod - def get_sub_account_api_list(self, req: GetSubAccountApiListReq, - **kwargs: Any) -> GetSubAccountApiListResp: + def get_spot_sub_accounts_summary_v2( + self, req: GetSpotSubAccountsSummaryV2Req, + **kwargs: Any) -> GetSpotSubAccountsSummaryV2Resp: """ - summary: Get SubAccount API List - description: This endpoint can be used to obtain a list of APIs pertaining to a sub-account.(Not contain ND Broker Sub Account) - documentation: https://www.kucoin.com/docs-new/api-3470136 + summary: Get SubAccount List - Summary Info + description: This endpoint can be used to get a paginated list of sub-accounts. Pagination is required. + documentation: https://www.kucoin.com/docs-new/api-3470131 +---------------------+------------+ | Extra API Info | Value | +---------------------+------------+ @@ -131,12 +112,13 @@ def get_sub_account_api_list(self, req: GetSubAccountApiListReq, pass @abstractmethod - def add_sub_account_api(self, req: AddSubAccountApiReq, - **kwargs: Any) -> AddSubAccountApiResp: + def get_spot_sub_account_detail( + self, req: GetSpotSubAccountDetailReq, + **kwargs: Any) -> GetSpotSubAccountDetailResp: """ - summary: Add SubAccount API - description: This endpoint can be used to create APIs for sub-accounts. - documentation: https://www.kucoin.com/docs-new/api-3470138 + summary: Get SubAccount Detail - Balance + description: This endpoint returns the account info of a sub-user specified by the subUserId. + documentation: https://www.kucoin.com/docs-new/api-3470132 +---------------------+------------+ | Extra API Info | Value | +---------------------+------------+ @@ -144,18 +126,19 @@ def add_sub_account_api(self, req: AddSubAccountApiReq, | API-CHANNEL | PRIVATE | | API-PERMISSION | GENERAL | | API-RATE-LIMIT-POOL | MANAGEMENT | - | API-RATE-LIMIT | 20 | + | API-RATE-LIMIT | 15 | +---------------------+------------+ """ pass @abstractmethod - def modify_sub_account_api(self, req: ModifySubAccountApiReq, - **kwargs: Any) -> ModifySubAccountApiResp: + def get_spot_sub_account_list_v2( + self, req: GetSpotSubAccountListV2Req, + **kwargs: Any) -> GetSpotSubAccountListV2Resp: """ - summary: Modify SubAccount API - description: This endpoint can be used to modify sub-account APIs. - documentation: https://www.kucoin.com/docs-new/api-3470139 + summary: Get SubAccount List - Spot Balance(V2) + description: This endpoint can be used to get paginated Spot sub-account information. Pagination is required. + documentation: https://www.kucoin.com/docs-new/api-3470133 +---------------------+------------+ | Extra API Info | Value | +---------------------+------------+ @@ -163,19 +146,38 @@ def modify_sub_account_api(self, req: ModifySubAccountApiReq, | API-CHANNEL | PRIVATE | | API-PERMISSION | GENERAL | | API-RATE-LIMIT-POOL | MANAGEMENT | - | API-RATE-LIMIT | 30 | + | API-RATE-LIMIT | 20 | +---------------------+------------+ """ pass @abstractmethod - @deprecated('') - def get_spot_sub_accounts_summary_v1( - self, **kwargs: Any) -> GetSpotSubAccountsSummaryV1Resp: + def get_futures_sub_account_list_v2( + self, req: GetFuturesSubAccountListV2Req, + **kwargs: Any) -> GetFuturesSubAccountListV2Resp: """ - summary: Get SubAccount List - Summary Info(V1) - description: You can get the user info of all sub-account via this interface It is recommended to use the GET /api/v2/sub/user interface for paging query - documentation: https://www.kucoin.com/docs-new/api-3470298 + summary: Get SubAccount List - Futures Balance(V2) + description: This endpoint can be used to get Futures sub-account information. + documentation: https://www.kucoin.com/docs-new/api-3470134 + +---------------------+---------+ + | Extra API Info | Value | + +---------------------+---------+ + | API-DOMAIN | FUTURES | + | API-CHANNEL | PRIVATE | + | API-PERMISSION | GENERAL | + | API-RATE-LIMIT-POOL | FUTURES | + | API-RATE-LIMIT | 6 | + +---------------------+---------+ + """ + pass + + @abstractmethod + def add_sub_account_api(self, req: AddSubAccountApiReq, + **kwargs: Any) -> AddSubAccountApiResp: + """ + summary: Add SubAccount API + description: This endpoint can be used to create APIs for sub-accounts. + documentation: https://www.kucoin.com/docs-new/api-3470138 +---------------------+------------+ | Extra API Info | Value | +---------------------+------------+ @@ -189,13 +191,12 @@ def get_spot_sub_accounts_summary_v1( pass @abstractmethod - def get_spot_sub_account_list_v2( - self, req: GetSpotSubAccountListV2Req, - **kwargs: Any) -> GetSpotSubAccountListV2Resp: + def modify_sub_account_api(self, req: ModifySubAccountApiReq, + **kwargs: Any) -> ModifySubAccountApiResp: """ - summary: Get SubAccount List - Spot Balance(V2) - description: This endpoint can be used to get paginated Spot sub-account information. Pagination is required. - documentation: https://www.kucoin.com/docs-new/api-3470133 + summary: Modify SubAccount API + description: This endpoint can be used to modify sub-account APIs. + documentation: https://www.kucoin.com/docs-new/api-3470139 +---------------------+------------+ | Extra API Info | Value | +---------------------+------------+ @@ -203,18 +204,18 @@ def get_spot_sub_account_list_v2( | API-CHANNEL | PRIVATE | | API-PERMISSION | GENERAL | | API-RATE-LIMIT-POOL | MANAGEMENT | - | API-RATE-LIMIT | 20 | + | API-RATE-LIMIT | 30 | +---------------------+------------+ """ pass @abstractmethod - def add_sub_account(self, req: AddSubAccountReq, - **kwargs: Any) -> AddSubAccountResp: + def get_sub_account_api_list(self, req: GetSubAccountApiListReq, + **kwargs: Any) -> GetSubAccountApiListResp: """ - summary: Add SubAccount - description: This endpoint can be used to create sub-accounts. - documentation: https://www.kucoin.com/docs-new/api-3470135 + summary: Get SubAccount API List + description: This endpoint can be used to obtain a list of APIs pertaining to a sub-account.(Not contain ND Broker Sub Account) + documentation: https://www.kucoin.com/docs-new/api-3470136 +---------------------+------------+ | Extra API Info | Value | +---------------------+------------+ @@ -222,19 +223,18 @@ def add_sub_account(self, req: AddSubAccountReq, | API-CHANNEL | PRIVATE | | API-PERMISSION | GENERAL | | API-RATE-LIMIT-POOL | MANAGEMENT | - | API-RATE-LIMIT | 15 | + | API-RATE-LIMIT | 20 | +---------------------+------------+ """ pass @abstractmethod - def get_spot_sub_accounts_summary_v2( - self, req: GetSpotSubAccountsSummaryV2Req, - **kwargs: Any) -> GetSpotSubAccountsSummaryV2Resp: + def delete_sub_account_api(self, req: DeleteSubAccountApiReq, + **kwargs: Any) -> DeleteSubAccountApiResp: """ - summary: Get SubAccount List - Summary Info - description: This endpoint can be used to get a paginated list of sub-accounts. Pagination is required. - documentation: https://www.kucoin.com/docs-new/api-3470131 + summary: Delete SubAccount API + description: This endpoint can be used to delete sub-account APIs. + documentation: https://www.kucoin.com/docs-new/api-3470137 +---------------------+------------+ | Extra API Info | Value | +---------------------+------------+ @@ -242,47 +242,47 @@ def get_spot_sub_accounts_summary_v2( | API-CHANNEL | PRIVATE | | API-PERMISSION | GENERAL | | API-RATE-LIMIT-POOL | MANAGEMENT | - | API-RATE-LIMIT | 20 | + | API-RATE-LIMIT | 30 | +---------------------+------------+ """ pass @abstractmethod - def add_sub_account_futures_permission( - self, req: AddSubAccountFuturesPermissionReq, - **kwargs: Any) -> AddSubAccountFuturesPermissionResp: + @deprecated('') + def get_spot_sub_accounts_summary_v1( + self, **kwargs: Any) -> GetSpotSubAccountsSummaryV1Resp: """ - summary: Add SubAccount Futures Permission - description: This endpoint can be used to add sub-accounts Futures permission. Before using this endpoints, you need to ensure that the master account apikey has Futures permissions and the Futures function has been activated. - documentation: https://www.kucoin.com/docs-new/api-3470332 + summary: Get SubAccount List - Summary Info(V1) + description: You can get the user info of all sub-account via this interface It is recommended to use the GET /api/v2/sub/user interface for paging query + documentation: https://www.kucoin.com/docs-new/api-3470298 +---------------------+------------+ | Extra API Info | Value | +---------------------+------------+ | API-DOMAIN | SPOT | | API-CHANNEL | PRIVATE | - | API-PERMISSION | FUTURES | + | API-PERMISSION | GENERAL | | API-RATE-LIMIT-POOL | MANAGEMENT | - | API-RATE-LIMIT | 15 | + | API-RATE-LIMIT | 20 | +---------------------+------------+ """ pass @abstractmethod - def add_sub_account_margin_permission( - self, req: AddSubAccountMarginPermissionReq, - **kwargs: Any) -> AddSubAccountMarginPermissionResp: + @deprecated('') + def get_spot_sub_account_list_v1( + self, **kwargs: Any) -> GetSpotSubAccountListV1Resp: """ - summary: Add SubAccount Margin Permission - description: This endpoint can be used to add sub-accounts Margin permission. Before using this endpoints, you need to ensure that the master account apikey has Margin permissions and the Margin function has been activated. - documentation: https://www.kucoin.com/docs-new/api-3470331 + summary: Get SubAccount List - Spot Balance(V1) + description: This endpoint returns the account info of all sub-users. + documentation: https://www.kucoin.com/docs-new/api-3470299 +---------------------+------------+ | Extra API Info | Value | +---------------------+------------+ | API-DOMAIN | SPOT | | API-CHANNEL | PRIVATE | - | API-PERMISSION | MARGIN | + | API-PERMISSION | GENERAL | | API-RATE-LIMIT-POOL | MANAGEMENT | - | API-RATE-LIMIT | 15 | + | API-RATE-LIMIT | 20 | +---------------------+------------+ """ pass @@ -293,19 +293,34 @@ class SubAccountAPIImpl(SubAccountAPI): def __init__(self, transport: Transport): self.transport = transport - def get_futures_sub_account_list_v2( - self, req: GetFuturesSubAccountListV2Req, - **kwargs: Any) -> GetFuturesSubAccountListV2Resp: - return self.transport.call("futures", False, "GET", - "/api/v1/account-overview-all", req, - GetFuturesSubAccountListV2Resp(), False, + def add_sub_account(self, req: AddSubAccountReq, + **kwargs: Any) -> AddSubAccountResp: + return self.transport.call("spot", False, "POST", + "/api/v2/sub/user/created", req, + AddSubAccountResp(), False, **kwargs) + + def add_sub_account_margin_permission( + self, req: AddSubAccountMarginPermissionReq, + **kwargs: Any) -> AddSubAccountMarginPermissionResp: + return self.transport.call("spot", False, "POST", + "/api/v3/sub/user/margin/enable", req, + AddSubAccountMarginPermissionResp(), False, **kwargs) - def get_spot_sub_account_list_v1( - self, **kwargs: Any) -> GetSpotSubAccountListV1Resp: + def add_sub_account_futures_permission( + self, req: AddSubAccountFuturesPermissionReq, + **kwargs: Any) -> AddSubAccountFuturesPermissionResp: + return self.transport.call("spot", False, "POST", + "/api/v3/sub/user/futures/enable", req, + AddSubAccountFuturesPermissionResp(), False, + **kwargs) + + def get_spot_sub_accounts_summary_v2( + self, req: GetSpotSubAccountsSummaryV2Req, + **kwargs: Any) -> GetSpotSubAccountsSummaryV2Resp: return self.transport.call("spot", False, "GET", - "/api/v1/sub-accounts", None, - GetSpotSubAccountListV1Resp(), False, + "/api/v2/sub/user", req, + GetSpotSubAccountsSummaryV2Resp(), False, **kwargs) def get_spot_sub_account_detail( @@ -316,17 +331,21 @@ def get_spot_sub_account_detail( GetSpotSubAccountDetailResp(), False, **kwargs) - def delete_sub_account_api(self, req: DeleteSubAccountApiReq, - **kwargs: Any) -> DeleteSubAccountApiResp: - return self.transport.call("spot", False, "DELETE", - "/api/v1/sub/api-key", req, - DeleteSubAccountApiResp(), False, **kwargs) - - def get_sub_account_api_list(self, req: GetSubAccountApiListReq, - **kwargs: Any) -> GetSubAccountApiListResp: + def get_spot_sub_account_list_v2( + self, req: GetSpotSubAccountListV2Req, + **kwargs: Any) -> GetSpotSubAccountListV2Resp: return self.transport.call("spot", False, "GET", - "/api/v1/sub/api-key", req, - GetSubAccountApiListResp(), False, **kwargs) + "/api/v2/sub-accounts", req, + GetSpotSubAccountListV2Resp(), False, + **kwargs) + + def get_futures_sub_account_list_v2( + self, req: GetFuturesSubAccountListV2Req, + **kwargs: Any) -> GetFuturesSubAccountListV2Resp: + return self.transport.call("futures", False, "GET", + "/api/v1/account-overview-all", req, + GetFuturesSubAccountListV2Resp(), False, + **kwargs) def add_sub_account_api(self, req: AddSubAccountApiReq, **kwargs: Any) -> AddSubAccountApiResp: @@ -340,6 +359,18 @@ def modify_sub_account_api(self, req: ModifySubAccountApiReq, "/api/v1/sub/api-key/update", req, ModifySubAccountApiResp(), False, **kwargs) + def get_sub_account_api_list(self, req: GetSubAccountApiListReq, + **kwargs: Any) -> GetSubAccountApiListResp: + return self.transport.call("spot", False, "GET", + "/api/v1/sub/api-key", req, + GetSubAccountApiListResp(), False, **kwargs) + + def delete_sub_account_api(self, req: DeleteSubAccountApiReq, + **kwargs: Any) -> DeleteSubAccountApiResp: + return self.transport.call("spot", False, "DELETE", + "/api/v1/sub/api-key", req, + DeleteSubAccountApiResp(), False, **kwargs) + def get_spot_sub_accounts_summary_v1( self, **kwargs: Any) -> GetSpotSubAccountsSummaryV1Resp: return self.transport.call("spot", False, "GET", @@ -347,40 +378,9 @@ def get_spot_sub_accounts_summary_v1( GetSpotSubAccountsSummaryV1Resp(), False, **kwargs) - def get_spot_sub_account_list_v2( - self, req: GetSpotSubAccountListV2Req, - **kwargs: Any) -> GetSpotSubAccountListV2Resp: - return self.transport.call("spot", False, "GET", - "/api/v2/sub-accounts", req, - GetSpotSubAccountListV2Resp(), False, - **kwargs) - - def add_sub_account(self, req: AddSubAccountReq, - **kwargs: Any) -> AddSubAccountResp: - return self.transport.call("spot", False, "POST", - "/api/v2/sub/user/created", req, - AddSubAccountResp(), False, **kwargs) - - def get_spot_sub_accounts_summary_v2( - self, req: GetSpotSubAccountsSummaryV2Req, - **kwargs: Any) -> GetSpotSubAccountsSummaryV2Resp: + def get_spot_sub_account_list_v1( + self, **kwargs: Any) -> GetSpotSubAccountListV1Resp: return self.transport.call("spot", False, "GET", - "/api/v2/sub/user", req, - GetSpotSubAccountsSummaryV2Resp(), False, - **kwargs) - - def add_sub_account_futures_permission( - self, req: AddSubAccountFuturesPermissionReq, - **kwargs: Any) -> AddSubAccountFuturesPermissionResp: - return self.transport.call("spot", False, "POST", - "/api/v3/sub/user/futures/enable", req, - AddSubAccountFuturesPermissionResp(), False, - **kwargs) - - def add_sub_account_margin_permission( - self, req: AddSubAccountMarginPermissionReq, - **kwargs: Any) -> AddSubAccountMarginPermissionResp: - return self.transport.call("spot", False, "POST", - "/api/v3/sub/user/margin/enable", req, - AddSubAccountMarginPermissionResp(), False, + "/api/v1/sub-accounts", None, + GetSpotSubAccountListV1Resp(), False, **kwargs) diff --git a/sdk/python/kucoin_universal_sdk/generate/account/subaccount/api_sub_account.template b/sdk/python/kucoin_universal_sdk/generate/account/subaccount/api_sub_account.template index 3bc4c032..ab5bd448 100644 --- a/sdk/python/kucoin_universal_sdk/generate/account/subaccount/api_sub_account.template +++ b/sdk/python/kucoin_universal_sdk/generate/account/subaccount/api_sub_account.template @@ -1,18 +1,18 @@ # API FUNCTION TEMPLATE -def test_get_futures_sub_account_list_v2_req(self): +def test_add_sub_account_req(self): """ - get_futures_sub_account_list_v2 - Get SubAccount List - Futures Balance(V2) - /api/v1/account-overview-all + add_sub_account + Add SubAccount + /api/v2/sub/user/created """ - builder = GetFuturesSubAccountListV2ReqBuilder() - builder.set_currency(?) + builder = AddSubAccountReqBuilder() + builder.set_password(?).set_remarks(?).set_sub_name(?).set_access(?) req = builder.build() try: - resp = self.api.get_futures_sub_account_list_v2(req) + resp = self.api.add_sub_account(req) print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) @@ -20,15 +20,18 @@ def test_get_futures_sub_account_list_v2_req(self): print("error: ", e) raise e -def test_get_spot_sub_account_list_v1_req(self): +def test_add_sub_account_margin_permission_req(self): """ - get_spot_sub_account_list_v1 - Get SubAccount List - Spot Balance(V1) - /api/v1/sub-accounts + add_sub_account_margin_permission + Add SubAccount Margin Permission + /api/v3/sub/user/margin/enable """ + builder = AddSubAccountMarginPermissionReqBuilder() + builder.set_uid(?) + req = builder.build() try: - resp = self.api.get_spot_sub_account_list_v1() + resp = self.api.add_sub_account_margin_permission(req) print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) @@ -36,18 +39,18 @@ def test_get_spot_sub_account_list_v1_req(self): print("error: ", e) raise e -def test_get_spot_sub_account_detail_req(self): +def test_add_sub_account_futures_permission_req(self): """ - get_spot_sub_account_detail - Get SubAccount Detail - Balance - /api/v1/sub-accounts/{subUserId} + add_sub_account_futures_permission + Add SubAccount Futures Permission + /api/v3/sub/user/futures/enable """ - builder = GetSpotSubAccountDetailReqBuilder() - builder.set_sub_user_id(?).set_include_base_amount(?) + builder = AddSubAccountFuturesPermissionReqBuilder() + builder.set_uid(?) req = builder.build() try: - resp = self.api.get_spot_sub_account_detail(req) + resp = self.api.add_sub_account_futures_permission(req) print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) @@ -55,18 +58,18 @@ def test_get_spot_sub_account_detail_req(self): print("error: ", e) raise e -def test_delete_sub_account_api_req(self): +def test_get_spot_sub_accounts_summary_v2_req(self): """ - delete_sub_account_api - Delete SubAccount API - /api/v1/sub/api-key + get_spot_sub_accounts_summary_v2 + Get SubAccount List - Summary Info + /api/v2/sub/user """ - builder = DeleteSubAccountApiReqBuilder() - builder.set_api_key(?).set_sub_name(?).set_passphrase(?) + builder = GetSpotSubAccountsSummaryV2ReqBuilder() + builder.set_current_page(?).set_page_size(?) req = builder.build() try: - resp = self.api.delete_sub_account_api(req) + resp = self.api.get_spot_sub_accounts_summary_v2(req) print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) @@ -74,18 +77,18 @@ def test_delete_sub_account_api_req(self): print("error: ", e) raise e -def test_get_sub_account_api_list_req(self): +def test_get_spot_sub_account_detail_req(self): """ - get_sub_account_api_list - Get SubAccount API List - /api/v1/sub/api-key + get_spot_sub_account_detail + Get SubAccount Detail - Balance + /api/v1/sub-accounts/{subUserId} """ - builder = GetSubAccountApiListReqBuilder() - builder.set_api_key(?).set_sub_name(?) + builder = GetSpotSubAccountDetailReqBuilder() + builder.set_sub_user_id(?).set_include_base_amount(?) req = builder.build() try: - resp = self.api.get_sub_account_api_list(req) + resp = self.api.get_spot_sub_account_detail(req) print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) @@ -93,18 +96,18 @@ def test_get_sub_account_api_list_req(self): print("error: ", e) raise e -def test_add_sub_account_api_req(self): +def test_get_spot_sub_account_list_v2_req(self): """ - add_sub_account_api - Add SubAccount API - /api/v1/sub/api-key + get_spot_sub_account_list_v2 + Get SubAccount List - Spot Balance(V2) + /api/v2/sub-accounts """ - builder = AddSubAccountApiReqBuilder() - builder.set_passphrase(?).set_remark(?).set_permission(?).set_ip_whitelist(?).set_expire(?).set_sub_name(?) + builder = GetSpotSubAccountListV2ReqBuilder() + builder.set_current_page(?).set_page_size(?) req = builder.build() try: - resp = self.api.add_sub_account_api(req) + resp = self.api.get_spot_sub_account_list_v2(req) print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) @@ -112,18 +115,18 @@ def test_add_sub_account_api_req(self): print("error: ", e) raise e -def test_modify_sub_account_api_req(self): +def test_get_futures_sub_account_list_v2_req(self): """ - modify_sub_account_api - Modify SubAccount API - /api/v1/sub/api-key/update + get_futures_sub_account_list_v2 + Get SubAccount List - Futures Balance(V2) + /api/v1/account-overview-all """ - builder = ModifySubAccountApiReqBuilder() - builder.set_passphrase(?).set_permission(?).set_ip_whitelist(?).set_expire(?).set_sub_name(?).set_api_key(?) + builder = GetFuturesSubAccountListV2ReqBuilder() + builder.set_currency(?) req = builder.build() try: - resp = self.api.modify_sub_account_api(req) + resp = self.api.get_futures_sub_account_list_v2(req) print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) @@ -131,15 +134,18 @@ def test_modify_sub_account_api_req(self): print("error: ", e) raise e -def test_get_spot_sub_accounts_summary_v1_req(self): +def test_add_sub_account_api_req(self): """ - get_spot_sub_accounts_summary_v1 - Get SubAccount List - Summary Info(V1) - /api/v1/sub/user + add_sub_account_api + Add SubAccount API + /api/v1/sub/api-key """ + builder = AddSubAccountApiReqBuilder() + builder.set_passphrase(?).set_remark(?).set_permission(?).set_ip_whitelist(?).set_expire(?).set_sub_name(?) + req = builder.build() try: - resp = self.api.get_spot_sub_accounts_summary_v1() + resp = self.api.add_sub_account_api(req) print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) @@ -147,18 +153,18 @@ def test_get_spot_sub_accounts_summary_v1_req(self): print("error: ", e) raise e -def test_get_spot_sub_account_list_v2_req(self): +def test_modify_sub_account_api_req(self): """ - get_spot_sub_account_list_v2 - Get SubAccount List - Spot Balance(V2) - /api/v2/sub-accounts + modify_sub_account_api + Modify SubAccount API + /api/v1/sub/api-key/update """ - builder = GetSpotSubAccountListV2ReqBuilder() - builder.set_current_page(?).set_page_size(?) + builder = ModifySubAccountApiReqBuilder() + builder.set_passphrase(?).set_permission(?).set_ip_whitelist(?).set_expire(?).set_sub_name(?).set_api_key(?) req = builder.build() try: - resp = self.api.get_spot_sub_account_list_v2(req) + resp = self.api.modify_sub_account_api(req) print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) @@ -166,18 +172,18 @@ def test_get_spot_sub_account_list_v2_req(self): print("error: ", e) raise e -def test_add_sub_account_req(self): +def test_get_sub_account_api_list_req(self): """ - add_sub_account - Add SubAccount - /api/v2/sub/user/created + get_sub_account_api_list + Get SubAccount API List + /api/v1/sub/api-key """ - builder = AddSubAccountReqBuilder() - builder.set_password(?).set_remarks(?).set_sub_name(?).set_access(?) + builder = GetSubAccountApiListReqBuilder() + builder.set_api_key(?).set_sub_name(?) req = builder.build() try: - resp = self.api.add_sub_account(req) + resp = self.api.get_sub_account_api_list(req) print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) @@ -185,18 +191,18 @@ def test_add_sub_account_req(self): print("error: ", e) raise e -def test_get_spot_sub_accounts_summary_v2_req(self): +def test_delete_sub_account_api_req(self): """ - get_spot_sub_accounts_summary_v2 - Get SubAccount List - Summary Info - /api/v2/sub/user + delete_sub_account_api + Delete SubAccount API + /api/v1/sub/api-key """ - builder = GetSpotSubAccountsSummaryV2ReqBuilder() - builder.set_current_page(?).set_page_size(?) + builder = DeleteSubAccountApiReqBuilder() + builder.set_api_key(?).set_sub_name(?).set_passphrase(?) req = builder.build() try: - resp = self.api.get_spot_sub_accounts_summary_v2(req) + resp = self.api.delete_sub_account_api(req) print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) @@ -204,18 +210,15 @@ def test_get_spot_sub_accounts_summary_v2_req(self): print("error: ", e) raise e -def test_add_sub_account_futures_permission_req(self): +def test_get_spot_sub_accounts_summary_v1_req(self): """ - add_sub_account_futures_permission - Add SubAccount Futures Permission - /api/v3/sub/user/futures/enable + get_spot_sub_accounts_summary_v1 + Get SubAccount List - Summary Info(V1) + /api/v1/sub/user """ - builder = AddSubAccountFuturesPermissionReqBuilder() - builder.set_uid(?) - req = builder.build() try: - resp = self.api.add_sub_account_futures_permission(req) + resp = self.api.get_spot_sub_accounts_summary_v1() print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) @@ -223,18 +226,15 @@ def test_add_sub_account_futures_permission_req(self): print("error: ", e) raise e -def test_add_sub_account_margin_permission_req(self): +def test_get_spot_sub_account_list_v1_req(self): """ - add_sub_account_margin_permission - Add SubAccount Margin Permission - /api/v3/sub/user/margin/enable + get_spot_sub_account_list_v1 + Get SubAccount List - Spot Balance(V1) + /api/v1/sub-accounts """ - builder = AddSubAccountMarginPermissionReqBuilder() - builder.set_uid(?) - req = builder.build() try: - resp = self.api.add_sub_account_margin_permission(req) + resp = self.api.get_spot_sub_account_list_v1() print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) diff --git a/sdk/python/kucoin_universal_sdk/generate/account/subaccount/api_sub_account_test.py b/sdk/python/kucoin_universal_sdk/generate/account/subaccount/api_sub_account_test.py index d12ae2c3..3c3c7fb5 100644 --- a/sdk/python/kucoin_universal_sdk/generate/account/subaccount/api_sub_account_test.py +++ b/sdk/python/kucoin_universal_sdk/generate/account/subaccount/api_sub_account_test.py @@ -29,41 +29,83 @@ class SubAccountAPITest(unittest.TestCase): - def test_get_futures_sub_account_list_v2_req_model(self): + def test_add_sub_account_req_model(self): """ - get_futures_sub_account_list_v2 - Get SubAccount List - Futures Balance(V2) - /api/v1/account-overview-all + add_sub_account + Add SubAccount + /api/v2/sub/user/created """ - data = "{\"currency\": \"USDT\"}" - req = GetFuturesSubAccountListV2Req.from_json(data) + data = "{\"password\": \"1234567\", \"remarks\": \"TheRemark\", \"subName\": \"Name1234567\", \"access\": \"Spot\"}" + req = AddSubAccountReq.from_json(data) - def test_get_futures_sub_account_list_v2_resp_model(self): + def test_add_sub_account_resp_model(self): """ - get_futures_sub_account_list_v2 - Get SubAccount List - Futures Balance(V2) - /api/v1/account-overview-all + add_sub_account + Add SubAccount + /api/v2/sub/user/created """ - data = "{\n \"code\": \"200000\",\n \"data\": {\n \"summary\": {\n \"accountEquityTotal\": 103.899081508,\n \"unrealisedPNLTotal\": 38.81075,\n \"marginBalanceTotal\": 65.336985668,\n \"positionMarginTotal\": 68.9588320683,\n \"orderMarginTotal\": 0,\n \"frozenFundsTotal\": 0,\n \"availableBalanceTotal\": 67.2492494397,\n \"currency\": \"USDT\"\n },\n \"accounts\": [\n {\n \"accountName\": \"Name1234567\",\n \"accountEquity\": 0,\n \"unrealisedPNL\": 0,\n \"marginBalance\": 0,\n \"positionMargin\": 0,\n \"orderMargin\": 0,\n \"frozenFunds\": 0,\n \"availableBalance\": 0,\n \"currency\": \"USDT\"\n },\n {\n \"accountName\": \"LTkucoin1491\",\n \"accountEquity\": 0,\n \"unrealisedPNL\": 0,\n \"marginBalance\": 0,\n \"positionMargin\": 0,\n \"orderMargin\": 0,\n \"frozenFunds\": 0,\n \"availableBalance\": 0,\n \"currency\": \"USDT\"\n },\n {\n \"accountName\": \"manage112233\",\n \"accountEquity\": 0,\n \"unrealisedPNL\": 0,\n \"marginBalance\": 0,\n \"positionMargin\": 0,\n \"orderMargin\": 0,\n \"frozenFunds\": 0,\n \"availableBalance\": 0,\n \"currency\": \"USDT\"\n },\n {\n \"accountName\": \"testapi6\",\n \"accountEquity\": 27.30545128,\n \"unrealisedPNL\": 22.549,\n \"marginBalance\": 4.75645128,\n \"positionMargin\": 24.1223749975,\n \"orderMargin\": 0,\n \"frozenFunds\": 0,\n \"availableBalance\": 25.7320762825,\n \"currency\": \"USDT\"\n },\n {\n \"accountName\": \"main\",\n \"accountEquity\": 76.593630228,\n \"unrealisedPNL\": 16.26175,\n \"marginBalance\": 60.580534388,\n \"positionMargin\": 44.8364570708,\n \"orderMargin\": 0,\n \"frozenFunds\": 0,\n \"availableBalance\": 41.5171731572,\n \"currency\": \"USDT\"\n }\n ]\n }\n}" + data = "{\n \"code\": \"200000\",\n \"data\": {\n \"currentPage\": 1,\n \"pageSize\": 10,\n \"totalNum\": 1,\n \"totalPage\": 1,\n \"items\": [\n {\n \"userId\": \"63743f07e0c5230001761d08\",\n \"uid\": 169579801,\n \"subName\": \"testapi6\",\n \"status\": 2,\n \"type\": 0,\n \"access\": \"All\",\n \"createdAt\": 1668562696000,\n \"remarks\": \"remarks\",\n \"tradeTypes\": [\n \"Spot\",\n \"Futures\",\n \"Margin\"\n ],\n \"openedTradeTypes\": [\n \"Spot\"\n ],\n \"hostedStatus\": null\n }\n ]\n }\n}" common_response = RestResponse.from_json(data) - resp = GetFuturesSubAccountListV2Resp.from_dict(common_response.data) + resp = AddSubAccountResp.from_dict(common_response.data) - def test_get_spot_sub_account_list_v1_req_model(self): + def test_add_sub_account_margin_permission_req_model(self): """ - get_spot_sub_account_list_v1 - Get SubAccount List - Spot Balance(V1) - /api/v1/sub-accounts + add_sub_account_margin_permission + Add SubAccount Margin Permission + /api/v3/sub/user/margin/enable + """ + data = "{\"uid\": \"169579801\"}" + req = AddSubAccountMarginPermissionReq.from_json(data) + + def test_add_sub_account_margin_permission_resp_model(self): + """ + add_sub_account_margin_permission + Add SubAccount Margin Permission + /api/v3/sub/user/margin/enable + """ + data = "{\n \"code\": \"200000\",\n \"data\": null\n}" + common_response = RestResponse.from_json(data) + resp = AddSubAccountMarginPermissionResp.from_dict( + common_response.data) + + def test_add_sub_account_futures_permission_req_model(self): + """ + add_sub_account_futures_permission + Add SubAccount Futures Permission + /api/v3/sub/user/futures/enable """ + data = "{\"uid\": \"169579801\"}" + req = AddSubAccountFuturesPermissionReq.from_json(data) - def test_get_spot_sub_account_list_v1_resp_model(self): + def test_add_sub_account_futures_permission_resp_model(self): """ - get_spot_sub_account_list_v1 - Get SubAccount List - Spot Balance(V1) - /api/v1/sub-accounts + add_sub_account_futures_permission + Add SubAccount Futures Permission + /api/v3/sub/user/futures/enable """ - data = "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"subUserId\": \"63743f07e0c5230001761d08\",\n \"subName\": \"testapi6\",\n \"mainAccounts\": [\n {\n \"currency\": \"USDT\",\n \"balance\": \"0.01\",\n \"available\": \"0.01\",\n \"holds\": \"0\",\n \"baseCurrency\": \"BTC\",\n \"baseCurrencyPrice\": \"62489.8\",\n \"baseAmount\": \"0.00000016\",\n \"tag\": \"DEFAULT\"\n }\n ],\n \"tradeAccounts\": [\n {\n \"currency\": \"USDT\",\n \"balance\": \"0.01\",\n \"available\": \"0.01\",\n \"holds\": \"0\",\n \"baseCurrency\": \"BTC\",\n \"baseCurrencyPrice\": \"62489.8\",\n \"baseAmount\": \"0.00000016\",\n \"tag\": \"DEFAULT\"\n }\n ],\n \"marginAccounts\": [\n {\n \"currency\": \"USDT\",\n \"balance\": \"0.01\",\n \"available\": \"0.01\",\n \"holds\": \"0\",\n \"baseCurrency\": \"BTC\",\n \"baseCurrencyPrice\": \"62489.8\",\n \"baseAmount\": \"0.00000016\",\n \"tag\": \"DEFAULT\"\n }\n ],\n \"tradeHFAccounts\": []\n },\n {\n \"subUserId\": \"670538a31037eb000115b076\",\n \"subName\": \"Name1234567\",\n \"mainAccounts\": [],\n \"tradeAccounts\": [],\n \"marginAccounts\": [],\n \"tradeHFAccounts\": []\n },\n {\n \"subUserId\": \"66b0c0905fc1480001c14c36\",\n \"subName\": \"LTkucoin1491\",\n \"mainAccounts\": [],\n \"tradeAccounts\": [],\n \"marginAccounts\": [],\n \"tradeHFAccounts\": []\n }\n ]\n}" + data = "{\n \"code\": \"200000\",\n \"data\": null\n}" common_response = RestResponse.from_json(data) - resp = GetSpotSubAccountListV1Resp.from_dict(common_response.data) + resp = AddSubAccountFuturesPermissionResp.from_dict( + common_response.data) + + def test_get_spot_sub_accounts_summary_v2_req_model(self): + """ + get_spot_sub_accounts_summary_v2 + Get SubAccount List - Summary Info + /api/v2/sub/user + """ + data = "{\"currentPage\": 1, \"pageSize\": 10}" + req = GetSpotSubAccountsSummaryV2Req.from_json(data) + + def test_get_spot_sub_accounts_summary_v2_resp_model(self): + """ + get_spot_sub_accounts_summary_v2 + Get SubAccount List - Summary Info + /api/v2/sub/user + """ + data = "{\n \"code\": \"200000\",\n \"data\": {\n \"currentPage\": 1,\n \"pageSize\": 10,\n \"totalNum\": 1,\n \"totalPage\": 1,\n \"items\": [\n {\n \"userId\": \"63743f07e0c5230001761d08\",\n \"uid\": 169579801,\n \"subName\": \"testapi6\",\n \"status\": 2,\n \"type\": 0,\n \"access\": \"All\",\n \"createdAt\": 1668562696000,\n \"remarks\": \"remarks\",\n \"tradeTypes\": [\n \"Spot\",\n \"Futures\",\n \"Margin\"\n ],\n \"openedTradeTypes\": [\n \"Spot\"\n ],\n \"hostedStatus\": null\n }\n ]\n }\n}" + common_response = RestResponse.from_json(data) + resp = GetSpotSubAccountsSummaryV2Resp.from_dict(common_response.data) def test_get_spot_sub_account_detail_req_model(self): """ @@ -84,43 +126,43 @@ def test_get_spot_sub_account_detail_resp_model(self): common_response = RestResponse.from_json(data) resp = GetSpotSubAccountDetailResp.from_dict(common_response.data) - def test_delete_sub_account_api_req_model(self): + def test_get_spot_sub_account_list_v2_req_model(self): """ - delete_sub_account_api - Delete SubAccount API - /api/v1/sub/api-key + get_spot_sub_account_list_v2 + Get SubAccount List - Spot Balance(V2) + /api/v2/sub-accounts """ - data = "{\"apiKey\": \"670621e3a25958000159c82f\", \"subName\": \"testapi6\", \"passphrase\": \"11223344\"}" - req = DeleteSubAccountApiReq.from_json(data) + data = "{\"currentPage\": 1, \"pageSize\": 10}" + req = GetSpotSubAccountListV2Req.from_json(data) - def test_delete_sub_account_api_resp_model(self): + def test_get_spot_sub_account_list_v2_resp_model(self): """ - delete_sub_account_api - Delete SubAccount API - /api/v1/sub/api-key + get_spot_sub_account_list_v2 + Get SubAccount List - Spot Balance(V2) + /api/v2/sub-accounts """ - data = "{\"code\":\"200000\",\"data\":{\"subName\":\"testapi6\",\"apiKey\":\"670621e3a25958000159c82f\"}}" + data = "{\n \"code\": \"200000\",\n \"data\": {\n \"currentPage\": 1,\n \"pageSize\": 10,\n \"totalNum\": 3,\n \"totalPage\": 1,\n \"items\": [\n {\n \"subUserId\": \"63743f07e0c5230001761d08\",\n \"subName\": \"testapi6\",\n \"mainAccounts\": [\n {\n \"currency\": \"USDT\",\n \"balance\": \"0.01\",\n \"available\": \"0.01\",\n \"holds\": \"0\",\n \"baseCurrency\": \"BTC\",\n \"baseCurrencyPrice\": \"62514.5\",\n \"baseAmount\": \"0.00000015\",\n \"tag\": \"DEFAULT\"\n }\n ],\n \"tradeAccounts\": [\n {\n \"currency\": \"USDT\",\n \"balance\": \"0.01\",\n \"available\": \"0.01\",\n \"holds\": \"0\",\n \"baseCurrency\": \"BTC\",\n \"baseCurrencyPrice\": \"62514.5\",\n \"baseAmount\": \"0.00000015\",\n \"tag\": \"DEFAULT\"\n }\n ],\n \"marginAccounts\": [\n {\n \"currency\": \"USDT\",\n \"balance\": \"0.01\",\n \"available\": \"0.01\",\n \"holds\": \"0\",\n \"baseCurrency\": \"BTC\",\n \"baseCurrencyPrice\": \"62514.5\",\n \"baseAmount\": \"0.00000015\",\n \"tag\": \"DEFAULT\"\n }\n ],\n \"tradeHFAccounts\": []\n },\n {\n \"subUserId\": \"670538a31037eb000115b076\",\n \"subName\": \"Name1234567\",\n \"mainAccounts\": [],\n \"tradeAccounts\": [],\n \"marginAccounts\": [],\n \"tradeHFAccounts\": []\n },\n {\n \"subUserId\": \"66b0c0905fc1480001c14c36\",\n \"subName\": \"LTkucoin1491\",\n \"mainAccounts\": [],\n \"tradeAccounts\": [],\n \"marginAccounts\": [],\n \"tradeHFAccounts\": []\n }\n ]\n }\n}" common_response = RestResponse.from_json(data) - resp = DeleteSubAccountApiResp.from_dict(common_response.data) + resp = GetSpotSubAccountListV2Resp.from_dict(common_response.data) - def test_get_sub_account_api_list_req_model(self): + def test_get_futures_sub_account_list_v2_req_model(self): """ - get_sub_account_api_list - Get SubAccount API List - /api/v1/sub/api-key + get_futures_sub_account_list_v2 + Get SubAccount List - Futures Balance(V2) + /api/v1/account-overview-all """ - data = "{\"apiKey\": \"example_string_default_value\", \"subName\": \"testapi6\"}" - req = GetSubAccountApiListReq.from_json(data) + data = "{\"currency\": \"USDT\"}" + req = GetFuturesSubAccountListV2Req.from_json(data) - def test_get_sub_account_api_list_resp_model(self): + def test_get_futures_sub_account_list_v2_resp_model(self): """ - get_sub_account_api_list - Get SubAccount API List - /api/v1/sub/api-key + get_futures_sub_account_list_v2 + Get SubAccount List - Futures Balance(V2) + /api/v1/account-overview-all """ - data = "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"subName\": \"apiSdkTest\",\n \"remark\": \"sdk_test_integration\",\n \"apiKey\": \"673eab2a955ebf000195d7e4\",\n \"apiVersion\": 3,\n \"permission\": \"General\",\n \"ipWhitelist\": \"10.**.1\",\n \"createdAt\": 1732160298000,\n \"uid\": 215112467,\n \"isMaster\": false\n }\n ]\n}" + data = "{\n \"code\": \"200000\",\n \"data\": {\n \"summary\": {\n \"accountEquityTotal\": 103.899081508,\n \"unrealisedPNLTotal\": 38.81075,\n \"marginBalanceTotal\": 65.336985668,\n \"positionMarginTotal\": 68.9588320683,\n \"orderMarginTotal\": 0,\n \"frozenFundsTotal\": 0,\n \"availableBalanceTotal\": 67.2492494397,\n \"currency\": \"USDT\"\n },\n \"accounts\": [\n {\n \"accountName\": \"Name1234567\",\n \"accountEquity\": 0,\n \"unrealisedPNL\": 0,\n \"marginBalance\": 0,\n \"positionMargin\": 0,\n \"orderMargin\": 0,\n \"frozenFunds\": 0,\n \"availableBalance\": 0,\n \"currency\": \"USDT\"\n },\n {\n \"accountName\": \"LTkucoin1491\",\n \"accountEquity\": 0,\n \"unrealisedPNL\": 0,\n \"marginBalance\": 0,\n \"positionMargin\": 0,\n \"orderMargin\": 0,\n \"frozenFunds\": 0,\n \"availableBalance\": 0,\n \"currency\": \"USDT\"\n },\n {\n \"accountName\": \"manage112233\",\n \"accountEquity\": 0,\n \"unrealisedPNL\": 0,\n \"marginBalance\": 0,\n \"positionMargin\": 0,\n \"orderMargin\": 0,\n \"frozenFunds\": 0,\n \"availableBalance\": 0,\n \"currency\": \"USDT\"\n },\n {\n \"accountName\": \"testapi6\",\n \"accountEquity\": 27.30545128,\n \"unrealisedPNL\": 22.549,\n \"marginBalance\": 4.75645128,\n \"positionMargin\": 24.1223749975,\n \"orderMargin\": 0,\n \"frozenFunds\": 0,\n \"availableBalance\": 25.7320762825,\n \"currency\": \"USDT\"\n },\n {\n \"accountName\": \"main\",\n \"accountEquity\": 76.593630228,\n \"unrealisedPNL\": 16.26175,\n \"marginBalance\": 60.580534388,\n \"positionMargin\": 44.8364570708,\n \"orderMargin\": 0,\n \"frozenFunds\": 0,\n \"availableBalance\": 41.5171731572,\n \"currency\": \"USDT\"\n }\n ]\n }\n}" common_response = RestResponse.from_json(data) - resp = GetSubAccountApiListResp.from_dict(common_response.data) + resp = GetFuturesSubAccountListV2Resp.from_dict(common_response.data) def test_add_sub_account_api_req_model(self): """ @@ -160,116 +202,74 @@ def test_modify_sub_account_api_resp_model(self): common_response = RestResponse.from_json(data) resp = ModifySubAccountApiResp.from_dict(common_response.data) - def test_get_spot_sub_accounts_summary_v1_req_model(self): - """ - get_spot_sub_accounts_summary_v1 - Get SubAccount List - Summary Info(V1) - /api/v1/sub/user - """ - - def test_get_spot_sub_accounts_summary_v1_resp_model(self): - """ - get_spot_sub_accounts_summary_v1 - Get SubAccount List - Summary Info(V1) - /api/v1/sub/user - """ - data = "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"userId\": \"63743f07e0c5230001761d08\",\n \"uid\": 169579801,\n \"subName\": \"testapi6\",\n \"type\": 0,\n \"remarks\": \"remarks\",\n \"access\": \"All\"\n },\n {\n \"userId\": \"670538a31037eb000115b076\",\n \"uid\": 225139445,\n \"subName\": \"Name1234567\",\n \"type\": 0,\n \"remarks\": \"TheRemark\",\n \"access\": \"All\"\n }\n ]\n}" - common_response = RestResponse.from_json(data) - resp = GetSpotSubAccountsSummaryV1Resp.from_dict(common_response.data) - - def test_get_spot_sub_account_list_v2_req_model(self): - """ - get_spot_sub_account_list_v2 - Get SubAccount List - Spot Balance(V2) - /api/v2/sub-accounts - """ - data = "{\"currentPage\": 1, \"pageSize\": 10}" - req = GetSpotSubAccountListV2Req.from_json(data) - - def test_get_spot_sub_account_list_v2_resp_model(self): - """ - get_spot_sub_account_list_v2 - Get SubAccount List - Spot Balance(V2) - /api/v2/sub-accounts - """ - data = "{\n \"code\": \"200000\",\n \"data\": {\n \"currentPage\": 1,\n \"pageSize\": 10,\n \"totalNum\": 3,\n \"totalPage\": 1,\n \"items\": [\n {\n \"subUserId\": \"63743f07e0c5230001761d08\",\n \"subName\": \"testapi6\",\n \"mainAccounts\": [\n {\n \"currency\": \"USDT\",\n \"balance\": \"0.01\",\n \"available\": \"0.01\",\n \"holds\": \"0\",\n \"baseCurrency\": \"BTC\",\n \"baseCurrencyPrice\": \"62514.5\",\n \"baseAmount\": \"0.00000015\",\n \"tag\": \"DEFAULT\"\n }\n ],\n \"tradeAccounts\": [\n {\n \"currency\": \"USDT\",\n \"balance\": \"0.01\",\n \"available\": \"0.01\",\n \"holds\": \"0\",\n \"baseCurrency\": \"BTC\",\n \"baseCurrencyPrice\": \"62514.5\",\n \"baseAmount\": \"0.00000015\",\n \"tag\": \"DEFAULT\"\n }\n ],\n \"marginAccounts\": [\n {\n \"currency\": \"USDT\",\n \"balance\": \"0.01\",\n \"available\": \"0.01\",\n \"holds\": \"0\",\n \"baseCurrency\": \"BTC\",\n \"baseCurrencyPrice\": \"62514.5\",\n \"baseAmount\": \"0.00000015\",\n \"tag\": \"DEFAULT\"\n }\n ],\n \"tradeHFAccounts\": []\n },\n {\n \"subUserId\": \"670538a31037eb000115b076\",\n \"subName\": \"Name1234567\",\n \"mainAccounts\": [],\n \"tradeAccounts\": [],\n \"marginAccounts\": [],\n \"tradeHFAccounts\": []\n },\n {\n \"subUserId\": \"66b0c0905fc1480001c14c36\",\n \"subName\": \"LTkucoin1491\",\n \"mainAccounts\": [],\n \"tradeAccounts\": [],\n \"marginAccounts\": [],\n \"tradeHFAccounts\": []\n }\n ]\n }\n}" - common_response = RestResponse.from_json(data) - resp = GetSpotSubAccountListV2Resp.from_dict(common_response.data) - - def test_add_sub_account_req_model(self): + def test_get_sub_account_api_list_req_model(self): """ - add_sub_account - Add SubAccount - /api/v2/sub/user/created + get_sub_account_api_list + Get SubAccount API List + /api/v1/sub/api-key """ - data = "{\"password\": \"1234567\", \"remarks\": \"TheRemark\", \"subName\": \"Name1234567\", \"access\": \"Spot\"}" - req = AddSubAccountReq.from_json(data) + data = "{\"apiKey\": \"example_string_default_value\", \"subName\": \"testapi6\"}" + req = GetSubAccountApiListReq.from_json(data) - def test_add_sub_account_resp_model(self): + def test_get_sub_account_api_list_resp_model(self): """ - add_sub_account - Add SubAccount - /api/v2/sub/user/created + get_sub_account_api_list + Get SubAccount API List + /api/v1/sub/api-key """ - data = "{\n \"code\": \"200000\",\n \"data\": {\n \"currentPage\": 1,\n \"pageSize\": 10,\n \"totalNum\": 1,\n \"totalPage\": 1,\n \"items\": [\n {\n \"userId\": \"63743f07e0c5230001761d08\",\n \"uid\": 169579801,\n \"subName\": \"testapi6\",\n \"status\": 2,\n \"type\": 0,\n \"access\": \"All\",\n \"createdAt\": 1668562696000,\n \"remarks\": \"remarks\",\n \"tradeTypes\": [\n \"Spot\",\n \"Futures\",\n \"Margin\"\n ],\n \"openedTradeTypes\": [\n \"Spot\"\n ],\n \"hostedStatus\": null\n }\n ]\n }\n}" + data = "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"subName\": \"apiSdkTest\",\n \"remark\": \"sdk_test_integration\",\n \"apiKey\": \"673eab2a955ebf000195d7e4\",\n \"apiVersion\": 3,\n \"permission\": \"General\",\n \"ipWhitelist\": \"10.**.1\",\n \"createdAt\": 1732160298000,\n \"uid\": 215112467,\n \"isMaster\": false\n }\n ]\n}" common_response = RestResponse.from_json(data) - resp = AddSubAccountResp.from_dict(common_response.data) + resp = GetSubAccountApiListResp.from_dict(common_response.data) - def test_get_spot_sub_accounts_summary_v2_req_model(self): + def test_delete_sub_account_api_req_model(self): """ - get_spot_sub_accounts_summary_v2 - Get SubAccount List - Summary Info - /api/v2/sub/user + delete_sub_account_api + Delete SubAccount API + /api/v1/sub/api-key """ - data = "{\"currentPage\": 1, \"pageSize\": 10}" - req = GetSpotSubAccountsSummaryV2Req.from_json(data) + data = "{\"apiKey\": \"670621e3a25958000159c82f\", \"subName\": \"testapi6\", \"passphrase\": \"11223344\"}" + req = DeleteSubAccountApiReq.from_json(data) - def test_get_spot_sub_accounts_summary_v2_resp_model(self): + def test_delete_sub_account_api_resp_model(self): """ - get_spot_sub_accounts_summary_v2 - Get SubAccount List - Summary Info - /api/v2/sub/user + delete_sub_account_api + Delete SubAccount API + /api/v1/sub/api-key """ - data = "{\n \"code\": \"200000\",\n \"data\": {\n \"currentPage\": 1,\n \"pageSize\": 10,\n \"totalNum\": 1,\n \"totalPage\": 1,\n \"items\": [\n {\n \"userId\": \"63743f07e0c5230001761d08\",\n \"uid\": 169579801,\n \"subName\": \"testapi6\",\n \"status\": 2,\n \"type\": 0,\n \"access\": \"All\",\n \"createdAt\": 1668562696000,\n \"remarks\": \"remarks\",\n \"tradeTypes\": [\n \"Spot\",\n \"Futures\",\n \"Margin\"\n ],\n \"openedTradeTypes\": [\n \"Spot\"\n ],\n \"hostedStatus\": null\n }\n ]\n }\n}" + data = "{\"code\":\"200000\",\"data\":{\"subName\":\"testapi6\",\"apiKey\":\"670621e3a25958000159c82f\"}}" common_response = RestResponse.from_json(data) - resp = GetSpotSubAccountsSummaryV2Resp.from_dict(common_response.data) + resp = DeleteSubAccountApiResp.from_dict(common_response.data) - def test_add_sub_account_futures_permission_req_model(self): + def test_get_spot_sub_accounts_summary_v1_req_model(self): """ - add_sub_account_futures_permission - Add SubAccount Futures Permission - /api/v3/sub/user/futures/enable + get_spot_sub_accounts_summary_v1 + Get SubAccount List - Summary Info(V1) + /api/v1/sub/user """ - data = "{\"uid\": \"169579801\"}" - req = AddSubAccountFuturesPermissionReq.from_json(data) - def test_add_sub_account_futures_permission_resp_model(self): + def test_get_spot_sub_accounts_summary_v1_resp_model(self): """ - add_sub_account_futures_permission - Add SubAccount Futures Permission - /api/v3/sub/user/futures/enable + get_spot_sub_accounts_summary_v1 + Get SubAccount List - Summary Info(V1) + /api/v1/sub/user """ - data = "{\n \"code\": \"200000\",\n \"data\": null\n}" + data = "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"userId\": \"63743f07e0c5230001761d08\",\n \"uid\": 169579801,\n \"subName\": \"testapi6\",\n \"type\": 0,\n \"remarks\": \"remarks\",\n \"access\": \"All\"\n },\n {\n \"userId\": \"670538a31037eb000115b076\",\n \"uid\": 225139445,\n \"subName\": \"Name1234567\",\n \"type\": 0,\n \"remarks\": \"TheRemark\",\n \"access\": \"All\"\n }\n ]\n}" common_response = RestResponse.from_json(data) - resp = AddSubAccountFuturesPermissionResp.from_dict( - common_response.data) + resp = GetSpotSubAccountsSummaryV1Resp.from_dict(common_response.data) - def test_add_sub_account_margin_permission_req_model(self): + def test_get_spot_sub_account_list_v1_req_model(self): """ - add_sub_account_margin_permission - Add SubAccount Margin Permission - /api/v3/sub/user/margin/enable + get_spot_sub_account_list_v1 + Get SubAccount List - Spot Balance(V1) + /api/v1/sub-accounts """ - data = "{\"uid\": \"169579801\"}" - req = AddSubAccountMarginPermissionReq.from_json(data) - def test_add_sub_account_margin_permission_resp_model(self): + def test_get_spot_sub_account_list_v1_resp_model(self): """ - add_sub_account_margin_permission - Add SubAccount Margin Permission - /api/v3/sub/user/margin/enable + get_spot_sub_account_list_v1 + Get SubAccount List - Spot Balance(V1) + /api/v1/sub-accounts """ - data = "{\n \"code\": \"200000\",\n \"data\": null\n}" + data = "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"subUserId\": \"63743f07e0c5230001761d08\",\n \"subName\": \"testapi6\",\n \"mainAccounts\": [\n {\n \"currency\": \"USDT\",\n \"balance\": \"0.01\",\n \"available\": \"0.01\",\n \"holds\": \"0\",\n \"baseCurrency\": \"BTC\",\n \"baseCurrencyPrice\": \"62489.8\",\n \"baseAmount\": \"0.00000016\",\n \"tag\": \"DEFAULT\"\n }\n ],\n \"tradeAccounts\": [\n {\n \"currency\": \"USDT\",\n \"balance\": \"0.01\",\n \"available\": \"0.01\",\n \"holds\": \"0\",\n \"baseCurrency\": \"BTC\",\n \"baseCurrencyPrice\": \"62489.8\",\n \"baseAmount\": \"0.00000016\",\n \"tag\": \"DEFAULT\"\n }\n ],\n \"marginAccounts\": [\n {\n \"currency\": \"USDT\",\n \"balance\": \"0.01\",\n \"available\": \"0.01\",\n \"holds\": \"0\",\n \"baseCurrency\": \"BTC\",\n \"baseCurrencyPrice\": \"62489.8\",\n \"baseAmount\": \"0.00000016\",\n \"tag\": \"DEFAULT\"\n }\n ],\n \"tradeHFAccounts\": []\n },\n {\n \"subUserId\": \"670538a31037eb000115b076\",\n \"subName\": \"Name1234567\",\n \"mainAccounts\": [],\n \"tradeAccounts\": [],\n \"marginAccounts\": [],\n \"tradeHFAccounts\": []\n },\n {\n \"subUserId\": \"66b0c0905fc1480001c14c36\",\n \"subName\": \"LTkucoin1491\",\n \"mainAccounts\": [],\n \"tradeAccounts\": [],\n \"marginAccounts\": [],\n \"tradeHFAccounts\": []\n }\n ]\n}" common_response = RestResponse.from_json(data) - resp = AddSubAccountMarginPermissionResp.from_dict( - common_response.data) + resp = GetSpotSubAccountListV1Resp.from_dict(common_response.data) diff --git a/sdk/python/kucoin_universal_sdk/generate/account/transfer/api_transfer.py b/sdk/python/kucoin_universal_sdk/generate/account/transfer/api_transfer.py index 7a565349..e63d4b44 100644 --- a/sdk/python/kucoin_universal_sdk/generate/account/transfer/api_transfer.py +++ b/sdk/python/kucoin_universal_sdk/generate/account/transfer/api_transfer.py @@ -42,43 +42,40 @@ def get_transfer_quotas(self, req: GetTransferQuotasReq, pass @abstractmethod - @deprecated('') - def futures_account_transfer_in( - self, req: FuturesAccountTransferInReq, - **kwargs: Any) -> FuturesAccountTransferInResp: + def flex_transfer(self, req: FlexTransferReq, + **kwargs: Any) -> FlexTransferResp: """ - summary: Futures Account Transfer In - description: The amount to be transferred will be deducted from the payAccount. Please ensure that you have sufficient funds in your payAccount Account, or the transfer will fail. - documentation: https://www.kucoin.com/docs-new/api-3470304 - +---------------------+------------+ - | Extra API Info | Value | - +---------------------+------------+ - | API-DOMAIN | FUTURES | - | API-CHANNEL | PRIVATE | - | API-PERMISSION | FUTURES | - | API-RATE-LIMIT-POOL | MANAGEMENT | - | API-RATE-LIMIT | 20 | - +---------------------+------------+ + summary: Flex Transfer + description: This interface can be used for transfers between master and sub accounts and inner transfers + documentation: https://www.kucoin.com/docs-new/api-3470147 + +---------------------+---------------+ + | Extra API Info | Value | + +---------------------+---------------+ + | API-DOMAIN | SPOT | + | API-CHANNEL | PRIVATE | + | API-PERMISSION | FLEXTRANSFERS | + | API-RATE-LIMIT-POOL | MANAGEMENT | + | API-RATE-LIMIT | 4 | + +---------------------+---------------+ """ pass @abstractmethod @deprecated('') - def get_futures_account_transfer_out_ledger( - self, req: GetFuturesAccountTransferOutLedgerReq, - **kwargs: Any) -> GetFuturesAccountTransferOutLedgerResp: + def sub_account_transfer(self, req: SubAccountTransferReq, + **kwargs: Any) -> SubAccountTransferResp: """ - summary: Get Futures Account Transfer Out Ledger - description: This endpoint can get futures account transfer out ledger - documentation: https://www.kucoin.com/docs-new/api-3470307 + summary: SubAccount Transfer + description: Funds in the main account, trading account and margin account of a Master Account can be transferred to the main account, trading account, futures account and margin account of its Sub-Account. The futures account of both the Master Account and Sub-Account can only accept funds transferred in from the main account, trading account and margin account and cannot transfer out to these accounts. + documentation: https://www.kucoin.com/docs-new/api-3470301 +---------------------+------------+ | Extra API Info | Value | +---------------------+------------+ - | API-DOMAIN | FUTURES | + | API-DOMAIN | SPOT | | API-CHANNEL | PRIVATE | - | API-PERMISSION | GENERAL | + | API-PERMISSION | SPOT | | API-RATE-LIMIT-POOL | MANAGEMENT | - | API-RATE-LIMIT | 20 | + | API-RATE-LIMIT | 30 | +---------------------+------------+ """ pass @@ -105,58 +102,61 @@ def inner_transfer(self, req: InnerTransferReq, @abstractmethod @deprecated('') - def sub_account_transfer(self, req: SubAccountTransferReq, - **kwargs: Any) -> SubAccountTransferResp: + def futures_account_transfer_out( + self, req: FuturesAccountTransferOutReq, + **kwargs: Any) -> FuturesAccountTransferOutResp: """ - summary: SubAccount Transfer - description: Funds in the main account, trading account and margin account of a Master Account can be transferred to the main account, trading account, futures account and margin account of its Sub-Account. The futures account of both the Master Account and Sub-Account can only accept funds transferred in from the main account, trading account and margin account and cannot transfer out to these accounts. - documentation: https://www.kucoin.com/docs-new/api-3470301 + summary: Futures Account Transfer Out + description: The amount to be transferred will be deducted from the KuCoin Futures Account. Please ensure that you have sufficient funds in your KuCoin Futures Account, or the transfer will fail. + documentation: https://www.kucoin.com/docs-new/api-3470303 +---------------------+------------+ | Extra API Info | Value | +---------------------+------------+ - | API-DOMAIN | SPOT | + | API-DOMAIN | FUTURES | | API-CHANNEL | PRIVATE | - | API-PERMISSION | SPOT | + | API-PERMISSION | FUTURES | | API-RATE-LIMIT-POOL | MANAGEMENT | - | API-RATE-LIMIT | 30 | + | API-RATE-LIMIT | 20 | +---------------------+------------+ """ pass @abstractmethod - def flex_transfer(self, req: FlexTransferReq, - **kwargs: Any) -> FlexTransferResp: + @deprecated('') + def futures_account_transfer_in( + self, req: FuturesAccountTransferInReq, + **kwargs: Any) -> FuturesAccountTransferInResp: """ - summary: Flex Transfer - description: This interface can be used for transfers between master and sub accounts and inner transfers - documentation: https://www.kucoin.com/docs-new/api-3470147 - +---------------------+---------------+ - | Extra API Info | Value | - +---------------------+---------------+ - | API-DOMAIN | SPOT | - | API-CHANNEL | PRIVATE | - | API-PERMISSION | FLEXTRANSFERS | - | API-RATE-LIMIT-POOL | MANAGEMENT | - | API-RATE-LIMIT | 4 | - +---------------------+---------------+ + summary: Futures Account Transfer In + description: The amount to be transferred will be deducted from the payAccount. Please ensure that you have sufficient funds in your payAccount Account, or the transfer will fail. + documentation: https://www.kucoin.com/docs-new/api-3470304 + +---------------------+------------+ + | Extra API Info | Value | + +---------------------+------------+ + | API-DOMAIN | FUTURES | + | API-CHANNEL | PRIVATE | + | API-PERMISSION | FUTURES | + | API-RATE-LIMIT-POOL | MANAGEMENT | + | API-RATE-LIMIT | 20 | + +---------------------+------------+ """ pass @abstractmethod @deprecated('') - def futures_account_transfer_out( - self, req: FuturesAccountTransferOutReq, - **kwargs: Any) -> FuturesAccountTransferOutResp: + def get_futures_account_transfer_out_ledger( + self, req: GetFuturesAccountTransferOutLedgerReq, + **kwargs: Any) -> GetFuturesAccountTransferOutLedgerResp: """ - summary: Futures Account Transfer Out - description: The amount to be transferred will be deducted from the KuCoin Futures Account. Please ensure that you have sufficient funds in your KuCoin Futures Account, or the transfer will fail. - documentation: https://www.kucoin.com/docs-new/api-3470303 + summary: Get Futures Account Transfer Out Ledger + description: This endpoint can get futures account transfer out ledger + documentation: https://www.kucoin.com/docs-new/api-3470307 +---------------------+------------+ | Extra API Info | Value | +---------------------+------------+ | API-DOMAIN | FUTURES | | API-CHANNEL | PRIVATE | - | API-PERMISSION | FUTURES | + | API-PERMISSION | GENERAL | | API-RATE-LIMIT-POOL | MANAGEMENT | | API-RATE-LIMIT | 20 | +---------------------+------------+ @@ -175,27 +175,11 @@ def get_transfer_quotas(self, req: GetTransferQuotasReq, "/api/v1/accounts/transferable", req, GetTransferQuotasResp(), False, **kwargs) - def futures_account_transfer_in( - self, req: FuturesAccountTransferInReq, - **kwargs: Any) -> FuturesAccountTransferInResp: - return self.transport.call("futures", False, "POST", - "/api/v1/transfer-in", req, - FuturesAccountTransferInResp(), False, - **kwargs) - - def get_futures_account_transfer_out_ledger( - self, req: GetFuturesAccountTransferOutLedgerReq, - **kwargs: Any) -> GetFuturesAccountTransferOutLedgerResp: - return self.transport.call("futures", False, "GET", - "/api/v1/transfer-list", req, - GetFuturesAccountTransferOutLedgerResp(), - False, **kwargs) - - def inner_transfer(self, req: InnerTransferReq, - **kwargs: Any) -> InnerTransferResp: + def flex_transfer(self, req: FlexTransferReq, + **kwargs: Any) -> FlexTransferResp: return self.transport.call("spot", False, "POST", - "/api/v2/accounts/inner-transfer", req, - InnerTransferResp(), False, **kwargs) + "/api/v3/accounts/universal-transfer", req, + FlexTransferResp(), False, **kwargs) def sub_account_transfer(self, req: SubAccountTransferReq, **kwargs: Any) -> SubAccountTransferResp: @@ -203,11 +187,11 @@ def sub_account_transfer(self, req: SubAccountTransferReq, "/api/v2/accounts/sub-transfer", req, SubAccountTransferResp(), False, **kwargs) - def flex_transfer(self, req: FlexTransferReq, - **kwargs: Any) -> FlexTransferResp: + def inner_transfer(self, req: InnerTransferReq, + **kwargs: Any) -> InnerTransferResp: return self.transport.call("spot", False, "POST", - "/api/v3/accounts/universal-transfer", req, - FlexTransferResp(), False, **kwargs) + "/api/v2/accounts/inner-transfer", req, + InnerTransferResp(), False, **kwargs) def futures_account_transfer_out( self, req: FuturesAccountTransferOutReq, @@ -216,3 +200,19 @@ def futures_account_transfer_out( "/api/v3/transfer-out", req, FuturesAccountTransferOutResp(), False, **kwargs) + + def futures_account_transfer_in( + self, req: FuturesAccountTransferInReq, + **kwargs: Any) -> FuturesAccountTransferInResp: + return self.transport.call("futures", False, "POST", + "/api/v1/transfer-in", req, + FuturesAccountTransferInResp(), False, + **kwargs) + + def get_futures_account_transfer_out_ledger( + self, req: GetFuturesAccountTransferOutLedgerReq, + **kwargs: Any) -> GetFuturesAccountTransferOutLedgerResp: + return self.transport.call("futures", False, "GET", + "/api/v1/transfer-list", req, + GetFuturesAccountTransferOutLedgerResp(), + False, **kwargs) diff --git a/sdk/python/kucoin_universal_sdk/generate/account/transfer/api_transfer.template b/sdk/python/kucoin_universal_sdk/generate/account/transfer/api_transfer.template index 34036852..1c746942 100644 --- a/sdk/python/kucoin_universal_sdk/generate/account/transfer/api_transfer.template +++ b/sdk/python/kucoin_universal_sdk/generate/account/transfer/api_transfer.template @@ -20,18 +20,18 @@ def test_get_transfer_quotas_req(self): print("error: ", e) raise e -def test_futures_account_transfer_in_req(self): +def test_flex_transfer_req(self): """ - futures_account_transfer_in - Futures Account Transfer In - /api/v1/transfer-in + flex_transfer + Flex Transfer + /api/v3/accounts/universal-transfer """ - builder = FuturesAccountTransferInReqBuilder() - builder.set_currency(?).set_amount(?).set_pay_account_type(?) + builder = FlexTransferReqBuilder() + builder.set_client_oid(?).set_currency(?).set_amount(?).set_from_user_id(?).set_from_account_type(?).set_from_account_tag(?).set_type(?).set_to_user_id(?).set_to_account_type(?).set_to_account_tag(?) req = builder.build() try: - resp = self.api.futures_account_transfer_in(req) + resp = self.api.flex_transfer(req) print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) @@ -39,18 +39,18 @@ def test_futures_account_transfer_in_req(self): print("error: ", e) raise e -def test_get_futures_account_transfer_out_ledger_req(self): +def test_sub_account_transfer_req(self): """ - get_futures_account_transfer_out_ledger - Get Futures Account Transfer Out Ledger - /api/v1/transfer-list + sub_account_transfer + SubAccount Transfer + /api/v2/accounts/sub-transfer """ - builder = GetFuturesAccountTransferOutLedgerReqBuilder() - builder.set_currency(?).set_type(?).set_tag(?).set_start_at(?).set_end_at(?).set_current_page(?).set_page_size(?) + builder = SubAccountTransferReqBuilder() + builder.set_client_oid(?).set_currency(?).set_amount(?).set_direction(?).set_account_type(?).set_sub_account_type(?).set_sub_user_id(?) req = builder.build() try: - resp = self.api.get_futures_account_transfer_out_ledger(req) + resp = self.api.sub_account_transfer(req) print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) @@ -77,18 +77,18 @@ def test_inner_transfer_req(self): print("error: ", e) raise e -def test_sub_account_transfer_req(self): +def test_futures_account_transfer_out_req(self): """ - sub_account_transfer - SubAccount Transfer - /api/v2/accounts/sub-transfer + futures_account_transfer_out + Futures Account Transfer Out + /api/v3/transfer-out """ - builder = SubAccountTransferReqBuilder() - builder.set_client_oid(?).set_currency(?).set_amount(?).set_direction(?).set_account_type(?).set_sub_account_type(?).set_sub_user_id(?) + builder = FuturesAccountTransferOutReqBuilder() + builder.set_currency(?).set_amount(?).set_rec_account_type(?) req = builder.build() try: - resp = self.api.sub_account_transfer(req) + resp = self.api.futures_account_transfer_out(req) print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) @@ -96,18 +96,18 @@ def test_sub_account_transfer_req(self): print("error: ", e) raise e -def test_flex_transfer_req(self): +def test_futures_account_transfer_in_req(self): """ - flex_transfer - Flex Transfer - /api/v3/accounts/universal-transfer + futures_account_transfer_in + Futures Account Transfer In + /api/v1/transfer-in """ - builder = FlexTransferReqBuilder() - builder.set_client_oid(?).set_currency(?).set_amount(?).set_from_user_id(?).set_from_account_type(?).set_from_account_tag(?).set_type(?).set_to_user_id(?).set_to_account_type(?).set_to_account_tag(?) + builder = FuturesAccountTransferInReqBuilder() + builder.set_currency(?).set_amount(?).set_pay_account_type(?) req = builder.build() try: - resp = self.api.flex_transfer(req) + resp = self.api.futures_account_transfer_in(req) print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) @@ -115,18 +115,18 @@ def test_flex_transfer_req(self): print("error: ", e) raise e -def test_futures_account_transfer_out_req(self): +def test_get_futures_account_transfer_out_ledger_req(self): """ - futures_account_transfer_out - Futures Account Transfer Out - /api/v3/transfer-out + get_futures_account_transfer_out_ledger + Get Futures Account Transfer Out Ledger + /api/v1/transfer-list """ - builder = FuturesAccountTransferOutReqBuilder() - builder.set_currency(?).set_amount(?).set_rec_account_type(?) + builder = GetFuturesAccountTransferOutLedgerReqBuilder() + builder.set_currency(?).set_type(?).set_tag(?).set_start_at(?).set_end_at(?).set_current_page(?).set_page_size(?) req = builder.build() try: - resp = self.api.futures_account_transfer_out(req) + resp = self.api.get_futures_account_transfer_out_ledger(req) print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) diff --git a/sdk/python/kucoin_universal_sdk/generate/account/transfer/api_transfer_test.py b/sdk/python/kucoin_universal_sdk/generate/account/transfer/api_transfer_test.py index 0546d8ad..a58f8595 100644 --- a/sdk/python/kucoin_universal_sdk/generate/account/transfer/api_transfer_test.py +++ b/sdk/python/kucoin_universal_sdk/generate/account/transfer/api_transfer_test.py @@ -38,44 +38,43 @@ def test_get_transfer_quotas_resp_model(self): common_response = RestResponse.from_json(data) resp = GetTransferQuotasResp.from_dict(common_response.data) - def test_futures_account_transfer_in_req_model(self): + def test_flex_transfer_req_model(self): """ - futures_account_transfer_in - Futures Account Transfer In - /api/v1/transfer-in + flex_transfer + Flex Transfer + /api/v3/accounts/universal-transfer """ - data = "{\"currency\": \"USDT\", \"amount\": 0.01, \"payAccountType\": \"MAIN\"}" - req = FuturesAccountTransferInReq.from_json(data) + data = "{\"clientOid\": \"64ccc0f164781800010d8c09\", \"type\": \"PARENT_TO_SUB\", \"currency\": \"USDT\", \"amount\": \"0.01\", \"fromAccountType\": \"TRADE\", \"toUserId\": \"63743f07e0c5230001761d08\", \"toAccountType\": \"TRADE\"}" + req = FlexTransferReq.from_json(data) - def test_futures_account_transfer_in_resp_model(self): + def test_flex_transfer_resp_model(self): """ - futures_account_transfer_in - Futures Account Transfer In - /api/v1/transfer-in + flex_transfer + Flex Transfer + /api/v3/accounts/universal-transfer """ - data = "{\"code\":\"200000\",\"data\":null}" + data = "{\n \"code\": \"200000\",\n \"data\": {\n \"orderId\": \"6705f7248c6954000733ecac\"\n }\n}" common_response = RestResponse.from_json(data) - resp = FuturesAccountTransferInResp.from_dict(common_response.data) + resp = FlexTransferResp.from_dict(common_response.data) - def test_get_futures_account_transfer_out_ledger_req_model(self): + def test_sub_account_transfer_req_model(self): """ - get_futures_account_transfer_out_ledger - Get Futures Account Transfer Out Ledger - /api/v1/transfer-list + sub_account_transfer + SubAccount Transfer + /api/v2/accounts/sub-transfer """ - data = "{\"currency\": \"XBT\", \"type\": \"MAIN\", \"tag\": [\"mock_a\", \"mock_b\"], \"startAt\": 1728663338000, \"endAt\": 1728692138000, \"currentPage\": 1, \"pageSize\": 50}" - req = GetFuturesAccountTransferOutLedgerReq.from_json(data) + data = "{\"clientOid\": \"64ccc0f164781800010d8c09\", \"currency\": \"USDT\", \"amount\": \"0.01\", \"direction\": \"OUT\", \"accountType\": \"MAIN\", \"subAccountType\": \"MAIN\", \"subUserId\": \"63743f07e0c5230001761d08\"}" + req = SubAccountTransferReq.from_json(data) - def test_get_futures_account_transfer_out_ledger_resp_model(self): + def test_sub_account_transfer_resp_model(self): """ - get_futures_account_transfer_out_ledger - Get Futures Account Transfer Out Ledger - /api/v1/transfer-list + sub_account_transfer + SubAccount Transfer + /api/v2/accounts/sub-transfer """ - data = "{\"code\":\"200000\",\"data\":{\"currentPage\":1,\"pageSize\":50,\"totalNum\":1,\"totalPage\":1,\"items\":[{\"applyId\":\"670bf84c577f6c00017a1c48\",\"currency\":\"USDT\",\"recRemark\":\"\",\"recSystem\":\"KUCOIN\",\"status\":\"SUCCESS\",\"amount\":\"0.01\",\"reason\":\"\",\"offset\":1519769124134806,\"createdAt\":1728837708000,\"remark\":\"\"}]}}" + data = "{\"code\":\"200000\",\"data\":{\"orderId\":\"670be6b0b1b9080007040a9b\"}}" common_response = RestResponse.from_json(data) - resp = GetFuturesAccountTransferOutLedgerResp.from_dict( - common_response.data) + resp = SubAccountTransferResp.from_dict(common_response.data) def test_inner_transfer_req_model(self): """ @@ -96,59 +95,60 @@ def test_inner_transfer_resp_model(self): common_response = RestResponse.from_json(data) resp = InnerTransferResp.from_dict(common_response.data) - def test_sub_account_transfer_req_model(self): + def test_futures_account_transfer_out_req_model(self): """ - sub_account_transfer - SubAccount Transfer - /api/v2/accounts/sub-transfer + futures_account_transfer_out + Futures Account Transfer Out + /api/v3/transfer-out """ - data = "{\"clientOid\": \"64ccc0f164781800010d8c09\", \"currency\": \"USDT\", \"amount\": \"0.01\", \"direction\": \"OUT\", \"accountType\": \"MAIN\", \"subAccountType\": \"MAIN\", \"subUserId\": \"63743f07e0c5230001761d08\"}" - req = SubAccountTransferReq.from_json(data) + data = "{\"currency\": \"USDT\", \"amount\": 0.01, \"recAccountType\": \"MAIN\"}" + req = FuturesAccountTransferOutReq.from_json(data) - def test_sub_account_transfer_resp_model(self): + def test_futures_account_transfer_out_resp_model(self): """ - sub_account_transfer - SubAccount Transfer - /api/v2/accounts/sub-transfer + futures_account_transfer_out + Futures Account Transfer Out + /api/v3/transfer-out """ - data = "{\"code\":\"200000\",\"data\":{\"orderId\":\"670be6b0b1b9080007040a9b\"}}" + data = "{\n \"code\": \"200000\",\n \"data\": {\n \"applyId\": \"670bf84c577f6c00017a1c48\",\n \"bizNo\": \"670bf84c577f6c00017a1c47\",\n \"payAccountType\": \"CONTRACT\",\n \"payTag\": \"DEFAULT\",\n \"remark\": \"\",\n \"recAccountType\": \"MAIN\",\n \"recTag\": \"DEFAULT\",\n \"recRemark\": \"\",\n \"recSystem\": \"KUCOIN\",\n \"status\": \"PROCESSING\",\n \"currency\": \"USDT\",\n \"amount\": \"0.01\",\n \"fee\": \"0\",\n \"sn\": 1519769124134806,\n \"reason\": \"\",\n \"createdAt\": 1728837708000,\n \"updatedAt\": 1728837708000\n }\n}" common_response = RestResponse.from_json(data) - resp = SubAccountTransferResp.from_dict(common_response.data) + resp = FuturesAccountTransferOutResp.from_dict(common_response.data) - def test_flex_transfer_req_model(self): + def test_futures_account_transfer_in_req_model(self): """ - flex_transfer - Flex Transfer - /api/v3/accounts/universal-transfer + futures_account_transfer_in + Futures Account Transfer In + /api/v1/transfer-in """ - data = "{\"clientOid\": \"64ccc0f164781800010d8c09\", \"type\": \"PARENT_TO_SUB\", \"currency\": \"USDT\", \"amount\": \"0.01\", \"fromAccountType\": \"TRADE\", \"toUserId\": \"63743f07e0c5230001761d08\", \"toAccountType\": \"TRADE\"}" - req = FlexTransferReq.from_json(data) + data = "{\"currency\": \"USDT\", \"amount\": 0.01, \"payAccountType\": \"MAIN\"}" + req = FuturesAccountTransferInReq.from_json(data) - def test_flex_transfer_resp_model(self): + def test_futures_account_transfer_in_resp_model(self): """ - flex_transfer - Flex Transfer - /api/v3/accounts/universal-transfer + futures_account_transfer_in + Futures Account Transfer In + /api/v1/transfer-in """ - data = "{\n \"code\": \"200000\",\n \"data\": {\n \"orderId\": \"6705f7248c6954000733ecac\"\n }\n}" + data = "{\"code\":\"200000\",\"data\":null}" common_response = RestResponse.from_json(data) - resp = FlexTransferResp.from_dict(common_response.data) + resp = FuturesAccountTransferInResp.from_dict(common_response.data) - def test_futures_account_transfer_out_req_model(self): + def test_get_futures_account_transfer_out_ledger_req_model(self): """ - futures_account_transfer_out - Futures Account Transfer Out - /api/v3/transfer-out + get_futures_account_transfer_out_ledger + Get Futures Account Transfer Out Ledger + /api/v1/transfer-list """ - data = "{\"currency\": \"USDT\", \"amount\": 0.01, \"recAccountType\": \"MAIN\"}" - req = FuturesAccountTransferOutReq.from_json(data) + data = "{\"currency\": \"XBT\", \"type\": \"MAIN\", \"tag\": [\"mock_a\", \"mock_b\"], \"startAt\": 1728663338000, \"endAt\": 1728692138000, \"currentPage\": 1, \"pageSize\": 50}" + req = GetFuturesAccountTransferOutLedgerReq.from_json(data) - def test_futures_account_transfer_out_resp_model(self): + def test_get_futures_account_transfer_out_ledger_resp_model(self): """ - futures_account_transfer_out - Futures Account Transfer Out - /api/v3/transfer-out + get_futures_account_transfer_out_ledger + Get Futures Account Transfer Out Ledger + /api/v1/transfer-list """ - data = "{\n \"code\": \"200000\",\n \"data\": {\n \"applyId\": \"670bf84c577f6c00017a1c48\",\n \"bizNo\": \"670bf84c577f6c00017a1c47\",\n \"payAccountType\": \"CONTRACT\",\n \"payTag\": \"DEFAULT\",\n \"remark\": \"\",\n \"recAccountType\": \"MAIN\",\n \"recTag\": \"DEFAULT\",\n \"recRemark\": \"\",\n \"recSystem\": \"KUCOIN\",\n \"status\": \"PROCESSING\",\n \"currency\": \"USDT\",\n \"amount\": \"0.01\",\n \"fee\": \"0\",\n \"sn\": 1519769124134806,\n \"reason\": \"\",\n \"createdAt\": 1728837708000,\n \"updatedAt\": 1728837708000\n }\n}" + data = "{\"code\":\"200000\",\"data\":{\"currentPage\":1,\"pageSize\":50,\"totalNum\":1,\"totalPage\":1,\"items\":[{\"applyId\":\"670bf84c577f6c00017a1c48\",\"currency\":\"USDT\",\"recRemark\":\"\",\"recSystem\":\"KUCOIN\",\"status\":\"SUCCESS\",\"amount\":\"0.01\",\"reason\":\"\",\"offset\":1519769124134806,\"createdAt\":1728837708000,\"remark\":\"\"}]}}" common_response = RestResponse.from_json(data) - resp = FuturesAccountTransferOutResp.from_dict(common_response.data) + resp = GetFuturesAccountTransferOutLedgerResp.from_dict( + common_response.data) diff --git a/sdk/python/kucoin_universal_sdk/generate/account/withdrawal/api_withdrawal.py b/sdk/python/kucoin_universal_sdk/generate/account/withdrawal/api_withdrawal.py index fd0f1e75..c3c43d0c 100644 --- a/sdk/python/kucoin_universal_sdk/generate/account/withdrawal/api_withdrawal.py +++ b/sdk/python/kucoin_universal_sdk/generate/account/withdrawal/api_withdrawal.py @@ -21,14 +21,12 @@ class WithdrawalAPI(ABC): @abstractmethod - @deprecated('') - def get_withdrawal_history_old( - self, req: GetWithdrawalHistoryOldReq, - **kwargs: Any) -> GetWithdrawalHistoryOldResp: + def get_withdrawal_quotas(self, req: GetWithdrawalQuotasReq, + **kwargs: Any) -> GetWithdrawalQuotasResp: """ - summary: Get Withdrawal History - Old - description: Request via this endpoint to get deposit list Items are paginated and sorted to show the latest first. See the Pagination section for retrieving additional entries after the first page. - documentation: https://www.kucoin.com/docs-new/api-3470308 + summary: Get Withdrawal Quotas + description: This interface can obtain the withdrawal quotas information of this currency. + documentation: https://www.kucoin.com/docs-new/api-3470143 +---------------------+------------+ | Extra API Info | Value | +---------------------+------------+ @@ -42,32 +40,31 @@ def get_withdrawal_history_old( pass @abstractmethod - def get_withdrawal_history(self, req: GetWithdrawalHistoryReq, - **kwargs: Any) -> GetWithdrawalHistoryResp: + def withdrawal_v3(self, req: WithdrawalV3Req, + **kwargs: Any) -> WithdrawalV3Resp: """ - summary: Get Withdrawal History - description: Request via this endpoint to get deposit list Items are paginated and sorted to show the latest first. See the Pagination section for retrieving additional entries after the first page. - documentation: https://www.kucoin.com/docs-new/api-3470145 + summary: Withdraw(V3) + description: Use this interface to withdraw the specified currency + documentation: https://www.kucoin.com/docs-new/api-3470146 +---------------------+------------+ | Extra API Info | Value | +---------------------+------------+ | API-DOMAIN | SPOT | | API-CHANNEL | PRIVATE | - | API-PERMISSION | GENERAL | + | API-PERMISSION | WITHDRAWAL | | API-RATE-LIMIT-POOL | MANAGEMENT | - | API-RATE-LIMIT | 20 | + | API-RATE-LIMIT | 5 | +---------------------+------------+ """ pass @abstractmethod - @deprecated('') - def withdrawal_v1(self, req: WithdrawalV1Req, - **kwargs: Any) -> WithdrawalV1Resp: + def cancel_withdrawal(self, req: CancelWithdrawalReq, + **kwargs: Any) -> CancelWithdrawalResp: """ - summary: Withdraw - V1 - description: Use this interface to withdraw the specified currency - documentation: https://www.kucoin.com/docs-new/api-3470310 + summary: Cancel Withdrawal + description: This interface can cancel the withdrawal, Only withdrawals requests of PROCESSING status could be canceled. + documentation: https://www.kucoin.com/docs-new/api-3470144 +---------------------+------------+ | Extra API Info | Value | +---------------------+------------+ @@ -75,18 +72,18 @@ def withdrawal_v1(self, req: WithdrawalV1Req, | API-CHANNEL | PRIVATE | | API-PERMISSION | WITHDRAWAL | | API-RATE-LIMIT-POOL | MANAGEMENT | - | API-RATE-LIMIT | 5 | + | API-RATE-LIMIT | 20 | +---------------------+------------+ """ pass @abstractmethod - def get_withdrawal_quotas(self, req: GetWithdrawalQuotasReq, - **kwargs: Any) -> GetWithdrawalQuotasResp: + def get_withdrawal_history(self, req: GetWithdrawalHistoryReq, + **kwargs: Any) -> GetWithdrawalHistoryResp: """ - summary: Get Withdrawal Quotas - description: This interface can obtain the withdrawal quotas information of this currency. - documentation: https://www.kucoin.com/docs-new/api-3470143 + summary: Get Withdrawal History + description: Request via this endpoint to get deposit list Items are paginated and sorted to show the latest first. See the Pagination section for retrieving additional entries after the first page. + documentation: https://www.kucoin.com/docs-new/api-3470145 +---------------------+------------+ | Extra API Info | Value | +---------------------+------------+ @@ -100,18 +97,20 @@ def get_withdrawal_quotas(self, req: GetWithdrawalQuotasReq, pass @abstractmethod - def cancel_withdrawal(self, req: CancelWithdrawalReq, - **kwargs: Any) -> CancelWithdrawalResp: + @deprecated('') + def get_withdrawal_history_old( + self, req: GetWithdrawalHistoryOldReq, + **kwargs: Any) -> GetWithdrawalHistoryOldResp: """ - summary: Cancel Withdrawal - description: This interface can cancel the withdrawal, Only withdrawals requests of PROCESSING status could be canceled. - documentation: https://www.kucoin.com/docs-new/api-3470144 + summary: Get Withdrawal History - Old + description: Request via this endpoint to get deposit list Items are paginated and sorted to show the latest first. See the Pagination section for retrieving additional entries after the first page. + documentation: https://www.kucoin.com/docs-new/api-3470308 +---------------------+------------+ | Extra API Info | Value | +---------------------+------------+ | API-DOMAIN | SPOT | | API-CHANNEL | PRIVATE | - | API-PERMISSION | WITHDRAWAL | + | API-PERMISSION | GENERAL | | API-RATE-LIMIT-POOL | MANAGEMENT | | API-RATE-LIMIT | 20 | +---------------------+------------+ @@ -119,12 +118,13 @@ def cancel_withdrawal(self, req: CancelWithdrawalReq, pass @abstractmethod - def withdrawal_v3(self, req: WithdrawalV3Req, - **kwargs: Any) -> WithdrawalV3Resp: + @deprecated('') + def withdrawal_v1(self, req: WithdrawalV1Req, + **kwargs: Any) -> WithdrawalV1Resp: """ - summary: Withdraw(V3) + summary: Withdraw - V1 description: Use this interface to withdraw the specified currency - documentation: https://www.kucoin.com/docs-new/api-3470146 + documentation: https://www.kucoin.com/docs-new/api-3470310 +---------------------+------------+ | Extra API Info | Value | +---------------------+------------+ @@ -143,40 +143,40 @@ class WithdrawalAPIImpl(WithdrawalAPI): def __init__(self, transport: Transport): self.transport = transport - def get_withdrawal_history_old( - self, req: GetWithdrawalHistoryOldReq, - **kwargs: Any) -> GetWithdrawalHistoryOldResp: - return self.transport.call("spot", False, "GET", - "/api/v1/hist-withdrawals", req, - GetWithdrawalHistoryOldResp(), False, - **kwargs) - - def get_withdrawal_history(self, req: GetWithdrawalHistoryReq, - **kwargs: Any) -> GetWithdrawalHistoryResp: - return self.transport.call("spot", False, "GET", - "/api/v1/withdrawals", req, - GetWithdrawalHistoryResp(), False, **kwargs) - - def withdrawal_v1(self, req: WithdrawalV1Req, - **kwargs: Any) -> WithdrawalV1Resp: - return self.transport.call("spot", False, "POST", - "/api/v1/withdrawals", req, - WithdrawalV1Resp(), False, **kwargs) - def get_withdrawal_quotas(self, req: GetWithdrawalQuotasReq, **kwargs: Any) -> GetWithdrawalQuotasResp: return self.transport.call("spot", False, "GET", "/api/v1/withdrawals/quotas", req, GetWithdrawalQuotasResp(), False, **kwargs) + def withdrawal_v3(self, req: WithdrawalV3Req, + **kwargs: Any) -> WithdrawalV3Resp: + return self.transport.call("spot", False, "POST", + "/api/v3/withdrawals", req, + WithdrawalV3Resp(), False, **kwargs) + def cancel_withdrawal(self, req: CancelWithdrawalReq, **kwargs: Any) -> CancelWithdrawalResp: return self.transport.call("spot", False, "DELETE", "/api/v1/withdrawals/{withdrawalId}", req, CancelWithdrawalResp(), False, **kwargs) - def withdrawal_v3(self, req: WithdrawalV3Req, - **kwargs: Any) -> WithdrawalV3Resp: + def get_withdrawal_history(self, req: GetWithdrawalHistoryReq, + **kwargs: Any) -> GetWithdrawalHistoryResp: + return self.transport.call("spot", False, "GET", + "/api/v1/withdrawals", req, + GetWithdrawalHistoryResp(), False, **kwargs) + + def get_withdrawal_history_old( + self, req: GetWithdrawalHistoryOldReq, + **kwargs: Any) -> GetWithdrawalHistoryOldResp: + return self.transport.call("spot", False, "GET", + "/api/v1/hist-withdrawals", req, + GetWithdrawalHistoryOldResp(), False, + **kwargs) + + def withdrawal_v1(self, req: WithdrawalV1Req, + **kwargs: Any) -> WithdrawalV1Resp: return self.transport.call("spot", False, "POST", - "/api/v3/withdrawals", req, - WithdrawalV3Resp(), False, **kwargs) + "/api/v1/withdrawals", req, + WithdrawalV1Resp(), False, **kwargs) diff --git a/sdk/python/kucoin_universal_sdk/generate/account/withdrawal/api_withdrawal.template b/sdk/python/kucoin_universal_sdk/generate/account/withdrawal/api_withdrawal.template index fc823944..89ca8487 100644 --- a/sdk/python/kucoin_universal_sdk/generate/account/withdrawal/api_withdrawal.template +++ b/sdk/python/kucoin_universal_sdk/generate/account/withdrawal/api_withdrawal.template @@ -1,18 +1,18 @@ # API FUNCTION TEMPLATE -def test_get_withdrawal_history_old_req(self): +def test_get_withdrawal_quotas_req(self): """ - get_withdrawal_history_old - Get Withdrawal History - Old - /api/v1/hist-withdrawals + get_withdrawal_quotas + Get Withdrawal Quotas + /api/v1/withdrawals/quotas """ - builder = GetWithdrawalHistoryOldReqBuilder() - builder.set_currency(?).set_status(?).set_start_at(?).set_end_at(?).set_current_page(?).set_page_size(?) + builder = GetWithdrawalQuotasReqBuilder() + builder.set_currency(?).set_chain(?) req = builder.build() try: - resp = self.api.get_withdrawal_history_old(req) + resp = self.api.get_withdrawal_quotas(req) print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) @@ -20,18 +20,18 @@ def test_get_withdrawal_history_old_req(self): print("error: ", e) raise e -def test_get_withdrawal_history_req(self): +def test_withdrawal_v3_req(self): """ - get_withdrawal_history - Get Withdrawal History - /api/v1/withdrawals + withdrawal_v3 + Withdraw(V3) + /api/v3/withdrawals """ - builder = GetWithdrawalHistoryReqBuilder() - builder.set_currency(?).set_status(?).set_start_at(?).set_end_at(?).set_current_page(?).set_page_size(?) + builder = WithdrawalV3ReqBuilder() + builder.set_currency(?).set_chain(?).set_amount(?).set_memo(?).set_is_inner(?).set_remark(?).set_fee_deduct_type(?).set_to_address(?).set_withdraw_type(?) req = builder.build() try: - resp = self.api.get_withdrawal_history(req) + resp = self.api.withdrawal_v3(req) print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) @@ -39,18 +39,18 @@ def test_get_withdrawal_history_req(self): print("error: ", e) raise e -def test_withdrawal_v1_req(self): +def test_cancel_withdrawal_req(self): """ - withdrawal_v1 - Withdraw - V1 - /api/v1/withdrawals + cancel_withdrawal + Cancel Withdrawal + /api/v1/withdrawals/{withdrawalId} """ - builder = WithdrawalV1ReqBuilder() - builder.set_currency(?).set_chain(?).set_address(?).set_amount(?).set_memo(?).set_is_inner(?).set_remark(?).set_fee_deduct_type(?) + builder = CancelWithdrawalReqBuilder() + builder.set_withdrawal_id(?) req = builder.build() try: - resp = self.api.withdrawal_v1(req) + resp = self.api.cancel_withdrawal(req) print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) @@ -58,18 +58,18 @@ def test_withdrawal_v1_req(self): print("error: ", e) raise e -def test_get_withdrawal_quotas_req(self): +def test_get_withdrawal_history_req(self): """ - get_withdrawal_quotas - Get Withdrawal Quotas - /api/v1/withdrawals/quotas + get_withdrawal_history + Get Withdrawal History + /api/v1/withdrawals """ - builder = GetWithdrawalQuotasReqBuilder() - builder.set_currency(?).set_chain(?) + builder = GetWithdrawalHistoryReqBuilder() + builder.set_currency(?).set_status(?).set_start_at(?).set_end_at(?).set_current_page(?).set_page_size(?) req = builder.build() try: - resp = self.api.get_withdrawal_quotas(req) + resp = self.api.get_withdrawal_history(req) print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) @@ -77,18 +77,18 @@ def test_get_withdrawal_quotas_req(self): print("error: ", e) raise e -def test_cancel_withdrawal_req(self): +def test_get_withdrawal_history_old_req(self): """ - cancel_withdrawal - Cancel Withdrawal - /api/v1/withdrawals/{withdrawalId} + get_withdrawal_history_old + Get Withdrawal History - Old + /api/v1/hist-withdrawals """ - builder = CancelWithdrawalReqBuilder() - builder.set_withdrawal_id(?) + builder = GetWithdrawalHistoryOldReqBuilder() + builder.set_currency(?).set_status(?).set_start_at(?).set_end_at(?).set_current_page(?).set_page_size(?) req = builder.build() try: - resp = self.api.cancel_withdrawal(req) + resp = self.api.get_withdrawal_history_old(req) print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) @@ -96,18 +96,18 @@ def test_cancel_withdrawal_req(self): print("error: ", e) raise e -def test_withdrawal_v3_req(self): +def test_withdrawal_v1_req(self): """ - withdrawal_v3 - Withdraw(V3) - /api/v3/withdrawals + withdrawal_v1 + Withdraw - V1 + /api/v1/withdrawals """ - builder = WithdrawalV3ReqBuilder() - builder.set_currency(?).set_chain(?).set_amount(?).set_memo(?).set_is_inner(?).set_remark(?).set_fee_deduct_type(?).set_to_address(?).set_withdraw_type(?) + builder = WithdrawalV1ReqBuilder() + builder.set_currency(?).set_chain(?).set_address(?).set_amount(?).set_memo(?).set_is_inner(?).set_remark(?).set_fee_deduct_type(?) req = builder.build() try: - resp = self.api.withdrawal_v3(req) + resp = self.api.withdrawal_v1(req) print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) diff --git a/sdk/python/kucoin_universal_sdk/generate/account/withdrawal/api_withdrawal_test.py b/sdk/python/kucoin_universal_sdk/generate/account/withdrawal/api_withdrawal_test.py index 5450d490..df40dd3e 100644 --- a/sdk/python/kucoin_universal_sdk/generate/account/withdrawal/api_withdrawal_test.py +++ b/sdk/python/kucoin_universal_sdk/generate/account/withdrawal/api_withdrawal_test.py @@ -17,63 +17,6 @@ class WithdrawalAPITest(unittest.TestCase): - def test_get_withdrawal_history_old_req_model(self): - """ - get_withdrawal_history_old - Get Withdrawal History - Old - /api/v1/hist-withdrawals - """ - data = "{\"currency\": \"BTC\", \"status\": \"SUCCESS\", \"startAt\": 1728663338000, \"endAt\": 1728692138000, \"currentPage\": 1, \"pageSize\": 50}" - req = GetWithdrawalHistoryOldReq.from_json(data) - - def test_get_withdrawal_history_old_resp_model(self): - """ - get_withdrawal_history_old - Get Withdrawal History - Old - /api/v1/hist-withdrawals - """ - data = "{\n \"code\": \"200000\",\n \"data\": {\n \"currentPage\": 1,\n \"pageSize\": 50,\n \"totalNum\": 1,\n \"totalPage\": 1,\n \"items\": [\n {\n \"currency\": \"BTC\",\n \"createAt\": 1526723468,\n \"amount\": \"0.534\",\n \"address\": \"33xW37ZSW4tQvg443Pc7NLCAs167Yc2XUV\",\n \"walletTxId\": \"aeacea864c020acf58e51606169240e96774838dcd4f7ce48acf38e3651323f4\",\n \"isInner\": false,\n \"status\": \"SUCCESS\"\n }\n ]\n }\n}" - common_response = RestResponse.from_json(data) - resp = GetWithdrawalHistoryOldResp.from_dict(common_response.data) - - def test_get_withdrawal_history_req_model(self): - """ - get_withdrawal_history - Get Withdrawal History - /api/v1/withdrawals - """ - data = "{\"currency\": \"BTC\", \"status\": \"SUCCESS\", \"startAt\": 1728663338000, \"endAt\": 1728692138000, \"currentPage\": 1, \"pageSize\": 50}" - req = GetWithdrawalHistoryReq.from_json(data) - - def test_get_withdrawal_history_resp_model(self): - """ - get_withdrawal_history - Get Withdrawal History - /api/v1/withdrawals - """ - data = "{\n \"code\": \"200000\",\n \"data\": {\n \"currentPage\": 1,\n \"pageSize\": 50,\n \"totalNum\": 5,\n \"totalPage\": 1,\n \"items\": [\n {\n \"currency\": \"USDT\",\n \"chain\": \"\",\n \"status\": \"SUCCESS\",\n \"address\": \"a435*****@gmail.com\",\n \"memo\": \"\",\n \"isInner\": true,\n \"amount\": \"1.00000000\",\n \"fee\": \"0.00000000\",\n \"walletTxId\": null,\n \"createdAt\": 1728555875000,\n \"updatedAt\": 1728555875000,\n \"remark\": \"\",\n \"arrears\": false\n },\n {\n \"currency\": \"USDT\",\n \"chain\": \"trx\",\n \"status\": \"SUCCESS\",\n \"address\": \"TSv3L1fS7******X4nLP6rqNxYz\",\n \"memo\": \"\",\n \"isInner\": true,\n \"amount\": \"6.00000000\",\n \"fee\": \"0.00000000\",\n \"walletTxId\": null,\n \"createdAt\": 1721730920000,\n \"updatedAt\": 1721730920000,\n \"remark\": \"\",\n \"arrears\": false\n }\n ]\n }\n}" - common_response = RestResponse.from_json(data) - resp = GetWithdrawalHistoryResp.from_dict(common_response.data) - - def test_withdrawal_v1_req_model(self): - """ - withdrawal_v1 - Withdraw - V1 - /api/v1/withdrawals - """ - data = "{\"currency\": \"USDT\", \"address\": \"TKFRQXSDc****16GmLrjJggwX8\", \"amount\": 3, \"chain\": \"trx\", \"isInner\": true}" - req = WithdrawalV1Req.from_json(data) - - def test_withdrawal_v1_resp_model(self): - """ - withdrawal_v1 - Withdraw - V1 - /api/v1/withdrawals - """ - data = "{\"code\":\"200000\",\"data\":{\"withdrawalId\":\"670a973cf07b3800070e216c\"}}" - common_response = RestResponse.from_json(data) - resp = WithdrawalV1Resp.from_dict(common_response.data) - def test_get_withdrawal_quotas_req_model(self): """ get_withdrawal_quotas @@ -93,6 +36,25 @@ def test_get_withdrawal_quotas_resp_model(self): common_response = RestResponse.from_json(data) resp = GetWithdrawalQuotasResp.from_dict(common_response.data) + def test_withdrawal_v3_req_model(self): + """ + withdrawal_v3 + Withdraw(V3) + /api/v3/withdrawals + """ + data = "{\"currency\": \"USDT\", \"toAddress\": \"TKFRQXSDcY****GmLrjJggwX8\", \"amount\": 3, \"withdrawType\": \"ADDRESS\", \"chain\": \"trx\", \"isInner\": true, \"remark\": \"this is Remark\"}" + req = WithdrawalV3Req.from_json(data) + + def test_withdrawal_v3_resp_model(self): + """ + withdrawal_v3 + Withdraw(V3) + /api/v3/withdrawals + """ + data = "{\"code\":\"200000\",\"data\":{\"withdrawalId\":\"670deec84d64da0007d7c946\"}}" + common_response = RestResponse.from_json(data) + resp = WithdrawalV3Resp.from_dict(common_response.data) + def test_cancel_withdrawal_req_model(self): """ cancel_withdrawal @@ -112,21 +74,59 @@ def test_cancel_withdrawal_resp_model(self): common_response = RestResponse.from_json(data) resp = CancelWithdrawalResp.from_dict(common_response.data) - def test_withdrawal_v3_req_model(self): + def test_get_withdrawal_history_req_model(self): """ - withdrawal_v3 - Withdraw(V3) - /api/v3/withdrawals + get_withdrawal_history + Get Withdrawal History + /api/v1/withdrawals """ - data = "{\"currency\": \"USDT\", \"toAddress\": \"TKFRQXSDcY****GmLrjJggwX8\", \"amount\": 3, \"withdrawType\": \"ADDRESS\", \"chain\": \"trx\", \"isInner\": true, \"remark\": \"this is Remark\"}" - req = WithdrawalV3Req.from_json(data) + data = "{\"currency\": \"BTC\", \"status\": \"SUCCESS\", \"startAt\": 1728663338000, \"endAt\": 1728692138000, \"currentPage\": 1, \"pageSize\": 50}" + req = GetWithdrawalHistoryReq.from_json(data) - def test_withdrawal_v3_resp_model(self): + def test_get_withdrawal_history_resp_model(self): """ - withdrawal_v3 - Withdraw(V3) - /api/v3/withdrawals + get_withdrawal_history + Get Withdrawal History + /api/v1/withdrawals """ - data = "{\"code\":\"200000\",\"data\":{\"withdrawalId\":\"670deec84d64da0007d7c946\"}}" + data = "{\n \"code\": \"200000\",\n \"data\": {\n \"currentPage\": 1,\n \"pageSize\": 50,\n \"totalNum\": 5,\n \"totalPage\": 1,\n \"items\": [\n {\n \"currency\": \"USDT\",\n \"chain\": \"\",\n \"status\": \"SUCCESS\",\n \"address\": \"a435*****@gmail.com\",\n \"memo\": \"\",\n \"isInner\": true,\n \"amount\": \"1.00000000\",\n \"fee\": \"0.00000000\",\n \"walletTxId\": null,\n \"createdAt\": 1728555875000,\n \"updatedAt\": 1728555875000,\n \"remark\": \"\",\n \"arrears\": false\n },\n {\n \"currency\": \"USDT\",\n \"chain\": \"trx\",\n \"status\": \"SUCCESS\",\n \"address\": \"TSv3L1fS7******X4nLP6rqNxYz\",\n \"memo\": \"\",\n \"isInner\": true,\n \"amount\": \"6.00000000\",\n \"fee\": \"0.00000000\",\n \"walletTxId\": null,\n \"createdAt\": 1721730920000,\n \"updatedAt\": 1721730920000,\n \"remark\": \"\",\n \"arrears\": false\n }\n ]\n }\n}" common_response = RestResponse.from_json(data) - resp = WithdrawalV3Resp.from_dict(common_response.data) + resp = GetWithdrawalHistoryResp.from_dict(common_response.data) + + def test_get_withdrawal_history_old_req_model(self): + """ + get_withdrawal_history_old + Get Withdrawal History - Old + /api/v1/hist-withdrawals + """ + data = "{\"currency\": \"BTC\", \"status\": \"SUCCESS\", \"startAt\": 1728663338000, \"endAt\": 1728692138000, \"currentPage\": 1, \"pageSize\": 50}" + req = GetWithdrawalHistoryOldReq.from_json(data) + + def test_get_withdrawal_history_old_resp_model(self): + """ + get_withdrawal_history_old + Get Withdrawal History - Old + /api/v1/hist-withdrawals + """ + data = "{\n \"code\": \"200000\",\n \"data\": {\n \"currentPage\": 1,\n \"pageSize\": 50,\n \"totalNum\": 1,\n \"totalPage\": 1,\n \"items\": [\n {\n \"currency\": \"BTC\",\n \"createAt\": 1526723468,\n \"amount\": \"0.534\",\n \"address\": \"33xW37ZSW4tQvg443Pc7NLCAs167Yc2XUV\",\n \"walletTxId\": \"aeacea864c020acf58e51606169240e96774838dcd4f7ce48acf38e3651323f4\",\n \"isInner\": false,\n \"status\": \"SUCCESS\"\n }\n ]\n }\n}" + common_response = RestResponse.from_json(data) + resp = GetWithdrawalHistoryOldResp.from_dict(common_response.data) + + def test_withdrawal_v1_req_model(self): + """ + withdrawal_v1 + Withdraw - V1 + /api/v1/withdrawals + """ + data = "{\"currency\": \"USDT\", \"address\": \"TKFRQXSDc****16GmLrjJggwX8\", \"amount\": 3, \"chain\": \"trx\", \"isInner\": true}" + req = WithdrawalV1Req.from_json(data) + + def test_withdrawal_v1_resp_model(self): + """ + withdrawal_v1 + Withdraw - V1 + /api/v1/withdrawals + """ + data = "{\"code\":\"200000\",\"data\":{\"withdrawalId\":\"670a973cf07b3800070e216c\"}}" + common_response = RestResponse.from_json(data) + resp = WithdrawalV1Resp.from_dict(common_response.data) diff --git a/sdk/python/kucoin_universal_sdk/generate/broker/ndbroker/api_nd_broker.py b/sdk/python/kucoin_universal_sdk/generate/broker/ndbroker/api_nd_broker.py index 809ea8c3..58d7f25a 100644 --- a/sdk/python/kucoin_universal_sdk/generate/broker/ndbroker/api_nd_broker.py +++ b/sdk/python/kucoin_universal_sdk/generate/broker/ndbroker/api_nd_broker.py @@ -34,12 +34,12 @@ class NDBrokerAPI(ABC): @abstractmethod - def get_deposit_list(self, req: GetDepositListReq, - **kwargs: Any) -> GetDepositListResp: + def get_broker_info(self, req: GetBrokerInfoReq, + **kwargs: Any) -> GetBrokerInfoResp: """ - summary: Get Deposit List - description: This endpoint can obtain the deposit records of each sub-account under the ND Broker. - documentation: https://www.kucoin.com/docs-new/api-3470285 + summary: Get Broker Info + description: This endpoint supports querying the basic information of the current Broker + documentation: https://www.kucoin.com/docs-new/api-3470282 +---------------------+---------+ | Extra API Info | Value | +---------------------+---------+ @@ -47,18 +47,18 @@ def get_deposit_list(self, req: GetDepositListReq, | API-CHANNEL | PRIVATE | | API-PERMISSION | GENERAL | | API-RATE-LIMIT-POOL | BROKER | - | API-RATE-LIMIT | 10 | + | API-RATE-LIMIT | 2 | +---------------------+---------+ """ pass @abstractmethod - def delete_sub_account_api(self, req: DeleteSubAccountApiReq, - **kwargs: Any) -> DeleteSubAccountApiResp: + def add_sub_account(self, req: AddSubAccountReq, + **kwargs: Any) -> AddSubAccountResp: """ - summary: Delete SubAccount API - description: This interface supports deleting Broker’s sub-account APIKEY - documentation: https://www.kucoin.com/docs-new/api-3470289 + summary: Add SubAccount + description: This endpoint supports Broker users to create sub-accounts + documentation: https://www.kucoin.com/docs-new/api-3470290 +---------------------+---------+ | Extra API Info | Value | +---------------------+---------+ @@ -72,12 +72,12 @@ def delete_sub_account_api(self, req: DeleteSubAccountApiReq, pass @abstractmethod - def get_sub_account_api(self, req: GetSubAccountApiReq, - **kwargs: Any) -> GetSubAccountApiResp: + def get_sub_account(self, req: GetSubAccountReq, + **kwargs: Any) -> GetSubAccountResp: """ - summary: Get SubAccount API - description: This interface supports querying the Broker’s sub-account APIKEY - documentation: https://www.kucoin.com/docs-new/api-3470284 + summary: Get SubAccount + description: This interface supports querying sub-accounts created by Broker + documentation: https://www.kucoin.com/docs-new/api-3470283 +---------------------+---------+ | Extra API Info | Value | +---------------------+---------+ @@ -110,12 +110,12 @@ def add_sub_account_api(self, req: AddSubAccountApiReq, pass @abstractmethod - def get_sub_account(self, req: GetSubAccountReq, - **kwargs: Any) -> GetSubAccountResp: + def get_sub_account_api(self, req: GetSubAccountApiReq, + **kwargs: Any) -> GetSubAccountApiResp: """ - summary: Get SubAccount - description: This interface supports querying sub-accounts created by Broker - documentation: https://www.kucoin.com/docs-new/api-3470283 + summary: Get SubAccount API + description: This interface supports querying the Broker’s sub-account APIKEY + documentation: https://www.kucoin.com/docs-new/api-3470284 +---------------------+---------+ | Extra API Info | Value | +---------------------+---------+ @@ -129,12 +129,12 @@ def get_sub_account(self, req: GetSubAccountReq, pass @abstractmethod - def add_sub_account(self, req: AddSubAccountReq, - **kwargs: Any) -> AddSubAccountResp: + def modify_sub_account_api(self, req: ModifySubAccountApiReq, + **kwargs: Any) -> ModifySubAccountApiResp: """ - summary: Add SubAccount - description: This endpoint supports Broker users to create sub-accounts - documentation: https://www.kucoin.com/docs-new/api-3470290 + summary: Modify SubAccount API + description: This interface supports modify the Broker’s sub-account APIKEY + documentation: https://www.kucoin.com/docs-new/api-3470292 +---------------------+---------+ | Extra API Info | Value | +---------------------+---------+ @@ -148,12 +148,12 @@ def add_sub_account(self, req: AddSubAccountReq, pass @abstractmethod - def modify_sub_account_api(self, req: ModifySubAccountApiReq, - **kwargs: Any) -> ModifySubAccountApiResp: + def delete_sub_account_api(self, req: DeleteSubAccountApiReq, + **kwargs: Any) -> DeleteSubAccountApiResp: """ - summary: Modify SubAccount API - description: This interface supports modify the Broker’s sub-account APIKEY - documentation: https://www.kucoin.com/docs-new/api-3470292 + summary: Delete SubAccount API + description: This interface supports deleting Broker’s sub-account APIKEY + documentation: https://www.kucoin.com/docs-new/api-3470289 +---------------------+---------+ | Extra API Info | Value | +---------------------+---------+ @@ -167,12 +167,11 @@ def modify_sub_account_api(self, req: ModifySubAccountApiReq, pass @abstractmethod - def get_broker_info(self, req: GetBrokerInfoReq, - **kwargs: Any) -> GetBrokerInfoResp: + def transfer(self, req: TransferReq, **kwargs: Any) -> TransferResp: """ - summary: Get Broker Info - description: This endpoint supports querying the basic information of the current Broker - documentation: https://www.kucoin.com/docs-new/api-3470282 + summary: Transfer + description: This endpoint supports fund transfer between Broker account and Broker sub-accounts. Please be aware that withdrawal from sub-account is not directly supported. Broker has to transfer funds from broker sub-account to broker account to initiate the withdrawals. + documentation: https://www.kucoin.com/docs-new/api-3470293 +---------------------+---------+ | Extra API Info | Value | +---------------------+---------+ @@ -180,17 +179,18 @@ def get_broker_info(self, req: GetBrokerInfoReq, | API-CHANNEL | PRIVATE | | API-PERMISSION | GENERAL | | API-RATE-LIMIT-POOL | BROKER | - | API-RATE-LIMIT | 2 | + | API-RATE-LIMIT | 1 | +---------------------+---------+ """ pass @abstractmethod - def get_rebase(self, req: GetRebaseReq, **kwargs: Any) -> GetRebaseResp: + def get_transfer_history(self, req: GetTransferHistoryReq, + **kwargs: Any) -> GetTransferHistoryResp: """ - summary: Get Broker Rebate - description: This interface supports downloading Broker rebate orders - documentation: https://www.kucoin.com/docs-new/api-3470281 + summary: Get Transfer History + description: This endpoint supports querying transfer records of the broker itself and its created sub-accounts. + documentation: https://www.kucoin.com/docs-new/api-3470286 +---------------------+---------+ | Extra API Info | Value | +---------------------+---------+ @@ -198,17 +198,18 @@ def get_rebase(self, req: GetRebaseReq, **kwargs: Any) -> GetRebaseResp: | API-CHANNEL | PRIVATE | | API-PERMISSION | GENERAL | | API-RATE-LIMIT-POOL | BROKER | - | API-RATE-LIMIT | 3 | + | API-RATE-LIMIT | 1 | +---------------------+---------+ """ pass @abstractmethod - def transfer(self, req: TransferReq, **kwargs: Any) -> TransferResp: + def get_deposit_list(self, req: GetDepositListReq, + **kwargs: Any) -> GetDepositListResp: """ - summary: Transfer - description: This endpoint supports fund transfer between Broker account and Broker sub-accounts. Please be aware that withdrawal from sub-account is not directly supported. Broker has to transfer funds from broker sub-account to broker account to initiate the withdrawals. - documentation: https://www.kucoin.com/docs-new/api-3470293 + summary: Get Deposit List + description: This endpoint can obtain the deposit records of each sub-account under the ND Broker. + documentation: https://www.kucoin.com/docs-new/api-3470285 +---------------------+---------+ | Extra API Info | Value | +---------------------+---------+ @@ -216,7 +217,7 @@ def transfer(self, req: TransferReq, **kwargs: Any) -> TransferResp: | API-CHANNEL | PRIVATE | | API-PERMISSION | GENERAL | | API-RATE-LIMIT-POOL | BROKER | - | API-RATE-LIMIT | 1 | + | API-RATE-LIMIT | 10 | +---------------------+---------+ """ pass @@ -241,12 +242,12 @@ def get_deposit_detail(self, req: GetDepositDetailReq, pass @abstractmethod - def get_transfer_history(self, req: GetTransferHistoryReq, - **kwargs: Any) -> GetTransferHistoryResp: + def get_withdraw_detail(self, req: GetWithdrawDetailReq, + **kwargs: Any) -> GetWithdrawDetailResp: """ - summary: Get Transfer History - description: This endpoint supports querying transfer records of the broker itself and its created sub-accounts. - documentation: https://www.kucoin.com/docs-new/api-3470286 + summary: Get Withdraw Detail + description: This endpoint supports querying the withdrawal records of sub-accounts created by a Broker (excluding main account of nd broker). + documentation: https://www.kucoin.com/docs-new/api-3470287 +---------------------+---------+ | Extra API Info | Value | +---------------------+---------+ @@ -260,12 +261,11 @@ def get_transfer_history(self, req: GetTransferHistoryReq, pass @abstractmethod - def get_withdraw_detail(self, req: GetWithdrawDetailReq, - **kwargs: Any) -> GetWithdrawDetailResp: + def get_rebase(self, req: GetRebaseReq, **kwargs: Any) -> GetRebaseResp: """ - summary: Get Withdraw Detail - description: This endpoint supports querying the withdrawal records of sub-accounts created by a Broker (excluding main account of nd broker). - documentation: https://www.kucoin.com/docs-new/api-3470287 + summary: Get Broker Rebate + description: This interface supports downloading Broker rebate orders + documentation: https://www.kucoin.com/docs-new/api-3470281 +---------------------+---------+ | Extra API Info | Value | +---------------------+---------+ @@ -273,7 +273,7 @@ def get_withdraw_detail(self, req: GetWithdrawDetailReq, | API-CHANNEL | PRIVATE | | API-PERMISSION | GENERAL | | API-RATE-LIMIT-POOL | BROKER | - | API-RATE-LIMIT | 1 | + | API-RATE-LIMIT | 3 | +---------------------+---------+ """ pass @@ -284,23 +284,23 @@ class NDBrokerAPIImpl(NDBrokerAPI): def __init__(self, transport: Transport): self.transport = transport - def get_deposit_list(self, req: GetDepositListReq, - **kwargs: Any) -> GetDepositListResp: + def get_broker_info(self, req: GetBrokerInfoReq, + **kwargs: Any) -> GetBrokerInfoResp: return self.transport.call("broker", True, "GET", - "/api/v1/asset/ndbroker/deposit/list", req, - GetDepositListResp(), False, **kwargs) + "/api/v1/broker/nd/info", req, + GetBrokerInfoResp(), False, **kwargs) - def delete_sub_account_api(self, req: DeleteSubAccountApiReq, - **kwargs: Any) -> DeleteSubAccountApiResp: - return self.transport.call("broker", True, "DELETE", - "/api/v1/broker/nd/account/apikey", req, - DeleteSubAccountApiResp(), False, **kwargs) + def add_sub_account(self, req: AddSubAccountReq, + **kwargs: Any) -> AddSubAccountResp: + return self.transport.call("broker", True, "POST", + "/api/v1/broker/nd/account", req, + AddSubAccountResp(), False, **kwargs) - def get_sub_account_api(self, req: GetSubAccountApiReq, - **kwargs: Any) -> GetSubAccountApiResp: + def get_sub_account(self, req: GetSubAccountReq, + **kwargs: Any) -> GetSubAccountResp: return self.transport.call("broker", True, "GET", - "/api/v1/broker/nd/account/apikey", req, - GetSubAccountApiResp(), False, **kwargs) + "/api/v1/broker/nd/account", req, + GetSubAccountResp(), False, **kwargs) def add_sub_account_api(self, req: AddSubAccountApiReq, **kwargs: Any) -> AddSubAccountApiResp: @@ -308,17 +308,11 @@ def add_sub_account_api(self, req: AddSubAccountApiReq, "/api/v1/broker/nd/account/apikey", req, AddSubAccountApiResp(), False, **kwargs) - def get_sub_account(self, req: GetSubAccountReq, - **kwargs: Any) -> GetSubAccountResp: + def get_sub_account_api(self, req: GetSubAccountApiReq, + **kwargs: Any) -> GetSubAccountApiResp: return self.transport.call("broker", True, "GET", - "/api/v1/broker/nd/account", req, - GetSubAccountResp(), False, **kwargs) - - def add_sub_account(self, req: AddSubAccountReq, - **kwargs: Any) -> AddSubAccountResp: - return self.transport.call("broker", True, "POST", - "/api/v1/broker/nd/account", req, - AddSubAccountResp(), False, **kwargs) + "/api/v1/broker/nd/account/apikey", req, + GetSubAccountApiResp(), False, **kwargs) def modify_sub_account_api(self, req: ModifySubAccountApiReq, **kwargs: Any) -> ModifySubAccountApiResp: @@ -327,36 +321,42 @@ def modify_sub_account_api(self, req: ModifySubAccountApiReq, req, ModifySubAccountApiResp(), False, **kwargs) - def get_broker_info(self, req: GetBrokerInfoReq, - **kwargs: Any) -> GetBrokerInfoResp: - return self.transport.call("broker", True, "GET", - "/api/v1/broker/nd/info", req, - GetBrokerInfoResp(), False, **kwargs) - - def get_rebase(self, req: GetRebaseReq, **kwargs: Any) -> GetRebaseResp: - return self.transport.call("broker", True, "GET", - "/api/v1/broker/nd/rebase/download", req, - GetRebaseResp(), False, **kwargs) + def delete_sub_account_api(self, req: DeleteSubAccountApiReq, + **kwargs: Any) -> DeleteSubAccountApiResp: + return self.transport.call("broker", True, "DELETE", + "/api/v1/broker/nd/account/apikey", req, + DeleteSubAccountApiResp(), False, **kwargs) def transfer(self, req: TransferReq, **kwargs: Any) -> TransferResp: return self.transport.call("broker", True, "POST", "/api/v1/broker/nd/transfer", req, TransferResp(), False, **kwargs) - def get_deposit_detail(self, req: GetDepositDetailReq, - **kwargs: Any) -> GetDepositDetailResp: - return self.transport.call("broker", True, "GET", - "/api/v3/broker/nd/deposit/detail", req, - GetDepositDetailResp(), False, **kwargs) - def get_transfer_history(self, req: GetTransferHistoryReq, **kwargs: Any) -> GetTransferHistoryResp: return self.transport.call("broker", True, "GET", "/api/v3/broker/nd/transfer/detail", req, GetTransferHistoryResp(), False, **kwargs) + def get_deposit_list(self, req: GetDepositListReq, + **kwargs: Any) -> GetDepositListResp: + return self.transport.call("broker", True, "GET", + "/api/v1/asset/ndbroker/deposit/list", req, + GetDepositListResp(), False, **kwargs) + + def get_deposit_detail(self, req: GetDepositDetailReq, + **kwargs: Any) -> GetDepositDetailResp: + return self.transport.call("broker", True, "GET", + "/api/v3/broker/nd/deposit/detail", req, + GetDepositDetailResp(), False, **kwargs) + def get_withdraw_detail(self, req: GetWithdrawDetailReq, **kwargs: Any) -> GetWithdrawDetailResp: return self.transport.call("broker", True, "GET", "/api/v3/broker/nd/withdraw/detail", req, GetWithdrawDetailResp(), False, **kwargs) + + def get_rebase(self, req: GetRebaseReq, **kwargs: Any) -> GetRebaseResp: + return self.transport.call("broker", True, "GET", + "/api/v1/broker/nd/rebase/download", req, + GetRebaseResp(), False, **kwargs) diff --git a/sdk/python/kucoin_universal_sdk/generate/broker/ndbroker/api_nd_broker.template b/sdk/python/kucoin_universal_sdk/generate/broker/ndbroker/api_nd_broker.template index abebfce5..16d1c564 100644 --- a/sdk/python/kucoin_universal_sdk/generate/broker/ndbroker/api_nd_broker.template +++ b/sdk/python/kucoin_universal_sdk/generate/broker/ndbroker/api_nd_broker.template @@ -1,18 +1,18 @@ # API FUNCTION TEMPLATE -def test_get_deposit_list_req(self): +def test_get_broker_info_req(self): """ - get_deposit_list - Get Deposit List - /api/v1/asset/ndbroker/deposit/list + get_broker_info + Get Broker Info + /api/v1/broker/nd/info """ - builder = GetDepositListReqBuilder() - builder.set_currency(?).set_status(?).set_hash(?).set_start_timestamp(?).set_end_timestamp(?).set_limit(?) + builder = GetBrokerInfoReqBuilder() + builder.set_begin(?).set_end(?).set_trade_type(?) req = builder.build() try: - resp = self.api.get_deposit_list(req) + resp = self.api.get_broker_info(req) print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) @@ -20,18 +20,18 @@ def test_get_deposit_list_req(self): print("error: ", e) raise e -def test_delete_sub_account_api_req(self): +def test_add_sub_account_req(self): """ - delete_sub_account_api - Delete SubAccount API - /api/v1/broker/nd/account/apikey + add_sub_account + Add SubAccount + /api/v1/broker/nd/account """ - builder = DeleteSubAccountApiReqBuilder() - builder.set_uid(?).set_api_key(?) + builder = AddSubAccountReqBuilder() + builder.set_account_name(?) req = builder.build() try: - resp = self.api.delete_sub_account_api(req) + resp = self.api.add_sub_account(req) print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) @@ -39,18 +39,18 @@ def test_delete_sub_account_api_req(self): print("error: ", e) raise e -def test_get_sub_account_api_req(self): +def test_get_sub_account_req(self): """ - get_sub_account_api - Get SubAccount API - /api/v1/broker/nd/account/apikey + get_sub_account + Get SubAccount + /api/v1/broker/nd/account """ - builder = GetSubAccountApiReqBuilder() - builder.set_uid(?).set_api_key(?) + builder = GetSubAccountReqBuilder() + builder.set_uid(?).set_current_page(?).set_page_size(?) req = builder.build() try: - resp = self.api.get_sub_account_api(req) + resp = self.api.get_sub_account(req) print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) @@ -77,18 +77,18 @@ def test_add_sub_account_api_req(self): print("error: ", e) raise e -def test_get_sub_account_req(self): +def test_get_sub_account_api_req(self): """ - get_sub_account - Get SubAccount - /api/v1/broker/nd/account + get_sub_account_api + Get SubAccount API + /api/v1/broker/nd/account/apikey """ - builder = GetSubAccountReqBuilder() - builder.set_uid(?).set_current_page(?).set_page_size(?) + builder = GetSubAccountApiReqBuilder() + builder.set_uid(?).set_api_key(?) req = builder.build() try: - resp = self.api.get_sub_account(req) + resp = self.api.get_sub_account_api(req) print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) @@ -96,18 +96,18 @@ def test_get_sub_account_req(self): print("error: ", e) raise e -def test_add_sub_account_req(self): +def test_modify_sub_account_api_req(self): """ - add_sub_account - Add SubAccount - /api/v1/broker/nd/account + modify_sub_account_api + Modify SubAccount API + /api/v1/broker/nd/account/update-apikey """ - builder = AddSubAccountReqBuilder() - builder.set_account_name(?) + builder = ModifySubAccountApiReqBuilder() + builder.set_uid(?).set_ip_whitelist(?).set_permissions(?).set_label(?).set_api_key(?) req = builder.build() try: - resp = self.api.add_sub_account(req) + resp = self.api.modify_sub_account_api(req) print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) @@ -115,18 +115,18 @@ def test_add_sub_account_req(self): print("error: ", e) raise e -def test_modify_sub_account_api_req(self): +def test_delete_sub_account_api_req(self): """ - modify_sub_account_api - Modify SubAccount API - /api/v1/broker/nd/account/update-apikey + delete_sub_account_api + Delete SubAccount API + /api/v1/broker/nd/account/apikey """ - builder = ModifySubAccountApiReqBuilder() - builder.set_uid(?).set_ip_whitelist(?).set_permissions(?).set_label(?).set_api_key(?) + builder = DeleteSubAccountApiReqBuilder() + builder.set_uid(?).set_api_key(?) req = builder.build() try: - resp = self.api.modify_sub_account_api(req) + resp = self.api.delete_sub_account_api(req) print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) @@ -134,18 +134,18 @@ def test_modify_sub_account_api_req(self): print("error: ", e) raise e -def test_get_broker_info_req(self): +def test_transfer_req(self): """ - get_broker_info - Get Broker Info - /api/v1/broker/nd/info + transfer + Transfer + /api/v1/broker/nd/transfer """ - builder = GetBrokerInfoReqBuilder() - builder.set_begin(?).set_end(?).set_trade_type(?) + builder = TransferReqBuilder() + builder.set_currency(?).set_amount(?).set_direction(?).set_account_type(?).set_special_uid(?).set_special_account_type(?).set_client_oid(?) req = builder.build() try: - resp = self.api.get_broker_info(req) + resp = self.api.transfer(req) print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) @@ -153,18 +153,18 @@ def test_get_broker_info_req(self): print("error: ", e) raise e -def test_get_rebase_req(self): +def test_get_transfer_history_req(self): """ - get_rebase - Get Broker Rebate - /api/v1/broker/nd/rebase/download + get_transfer_history + Get Transfer History + /api/v3/broker/nd/transfer/detail """ - builder = GetRebaseReqBuilder() - builder.set_begin(?).set_end(?).set_trade_type(?) + builder = GetTransferHistoryReqBuilder() + builder.set_order_id(?) req = builder.build() try: - resp = self.api.get_rebase(req) + resp = self.api.get_transfer_history(req) print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) @@ -172,18 +172,18 @@ def test_get_rebase_req(self): print("error: ", e) raise e -def test_transfer_req(self): +def test_get_deposit_list_req(self): """ - transfer - Transfer - /api/v1/broker/nd/transfer + get_deposit_list + Get Deposit List + /api/v1/asset/ndbroker/deposit/list """ - builder = TransferReqBuilder() - builder.set_currency(?).set_amount(?).set_direction(?).set_account_type(?).set_special_uid(?).set_special_account_type(?).set_client_oid(?) + builder = GetDepositListReqBuilder() + builder.set_currency(?).set_status(?).set_hash(?).set_start_timestamp(?).set_end_timestamp(?).set_limit(?) req = builder.build() try: - resp = self.api.transfer(req) + resp = self.api.get_deposit_list(req) print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) @@ -210,18 +210,18 @@ def test_get_deposit_detail_req(self): print("error: ", e) raise e -def test_get_transfer_history_req(self): +def test_get_withdraw_detail_req(self): """ - get_transfer_history - Get Transfer History - /api/v3/broker/nd/transfer/detail + get_withdraw_detail + Get Withdraw Detail + /api/v3/broker/nd/withdraw/detail """ - builder = GetTransferHistoryReqBuilder() - builder.set_order_id(?) + builder = GetWithdrawDetailReqBuilder() + builder.set_withdrawal_id(?) req = builder.build() try: - resp = self.api.get_transfer_history(req) + resp = self.api.get_withdraw_detail(req) print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) @@ -229,18 +229,18 @@ def test_get_transfer_history_req(self): print("error: ", e) raise e -def test_get_withdraw_detail_req(self): +def test_get_rebase_req(self): """ - get_withdraw_detail - Get Withdraw Detail - /api/v3/broker/nd/withdraw/detail + get_rebase + Get Broker Rebate + /api/v1/broker/nd/rebase/download """ - builder = GetWithdrawDetailReqBuilder() - builder.set_withdrawal_id(?) + builder = GetRebaseReqBuilder() + builder.set_begin(?).set_end(?).set_trade_type(?) req = builder.build() try: - resp = self.api.get_withdraw_detail(req) + resp = self.api.get_rebase(req) print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) diff --git a/sdk/python/kucoin_universal_sdk/generate/broker/ndbroker/api_nd_broker_test.py b/sdk/python/kucoin_universal_sdk/generate/broker/ndbroker/api_nd_broker_test.py index fbc58ac3..7d7e5802 100644 --- a/sdk/python/kucoin_universal_sdk/generate/broker/ndbroker/api_nd_broker_test.py +++ b/sdk/python/kucoin_universal_sdk/generate/broker/ndbroker/api_nd_broker_test.py @@ -30,62 +30,62 @@ class NDBrokerAPITest(unittest.TestCase): - def test_get_deposit_list_req_model(self): + def test_get_broker_info_req_model(self): """ - get_deposit_list - Get Deposit List - /api/v1/asset/ndbroker/deposit/list + get_broker_info + Get Broker Info + /api/v1/broker/nd/info """ - data = "{\"currency\": \"USDT\", \"status\": \"SUCCESS\", \"hash\": \"example_string_default_value\", \"startTimestamp\": 123456, \"endTimestamp\": 123456, \"limit\": 100}" - req = GetDepositListReq.from_json(data) + data = "{\"begin\": \"20240510\", \"end\": \"20241010\", \"tradeType\": \"1\"}" + req = GetBrokerInfoReq.from_json(data) - def test_get_deposit_list_resp_model(self): + def test_get_broker_info_resp_model(self): """ - get_deposit_list - Get Deposit List - /api/v1/asset/ndbroker/deposit/list + get_broker_info + Get Broker Info + /api/v1/broker/nd/info """ - data = "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"uid\": 165111215,\n \"hash\": \"6724e363a492800007ec602b\",\n \"address\": \"xxxxxxx@gmail.com\",\n \"memo\": \"\",\n \"amount\": \"3.0\",\n \"fee\": \"0.0\",\n \"currency\": \"USDT\",\n \"isInner\": true,\n \"walletTxId\": \"bbbbbbbbb\",\n \"status\": \"SUCCESS\",\n \"chain\": \"\",\n \"remark\": \"\",\n \"createdAt\": 1730470760000,\n \"updatedAt\": 1730470760000\n }\n ]\n}" + data = "{\n \"code\": \"200000\",\n \"data\": {\n \"accountSize\": 0,\n \"maxAccountSize\": null,\n \"level\": 0\n }\n}" common_response = RestResponse.from_json(data) - resp = GetDepositListResp.from_dict(common_response.data) + resp = GetBrokerInfoResp.from_dict(common_response.data) - def test_delete_sub_account_api_req_model(self): + def test_add_sub_account_req_model(self): """ - delete_sub_account_api - Delete SubAccount API - /api/v1/broker/nd/account/apikey + add_sub_account + Add SubAccount + /api/v1/broker/nd/account """ - data = "{\"uid\": \"226383154\", \"apiKey\": \"671afb36cee20f00015cfaf1\"}" - req = DeleteSubAccountApiReq.from_json(data) + data = "{\"accountName\": \"Account1\"}" + req = AddSubAccountReq.from_json(data) - def test_delete_sub_account_api_resp_model(self): + def test_add_sub_account_resp_model(self): """ - delete_sub_account_api - Delete SubAccount API - /api/v1/broker/nd/account/apikey + add_sub_account + Add SubAccount + /api/v1/broker/nd/account """ - data = "{\n \"code\": \"200000\",\n \"data\": true\n}" + data = "{\n \"code\": \"200000\",\n \"data\": {\n \"accountName\": \"Account15\",\n \"uid\": \"226383154\",\n \"createdAt\": 1729819381908,\n \"level\": 0\n }\n}" common_response = RestResponse.from_json(data) - resp = DeleteSubAccountApiResp.from_dict(common_response.data) + resp = AddSubAccountResp.from_dict(common_response.data) - def test_get_sub_account_api_req_model(self): + def test_get_sub_account_req_model(self): """ - get_sub_account_api - Get SubAccount API - /api/v1/broker/nd/account/apikey + get_sub_account + Get SubAccount + /api/v1/broker/nd/account """ - data = "{\"uid\": \"226383154\", \"apiKey\": \"671afb36cee20f00015cfaf1\"}" - req = GetSubAccountApiReq.from_json(data) + data = "{\"uid\": \"226383154\", \"currentPage\": 1, \"pageSize\": 20}" + req = GetSubAccountReq.from_json(data) - def test_get_sub_account_api_resp_model(self): + def test_get_sub_account_resp_model(self): """ - get_sub_account_api - Get SubAccount API - /api/v1/broker/nd/account/apikey + get_sub_account + Get SubAccount + /api/v1/broker/nd/account """ - data = "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"uid\": \"226383154\",\n \"label\": \"This is remarks\",\n \"apiKey\": \"671afb36cee20f00015cfaf1\",\n \"apiVersion\": 3,\n \"permissions\": [\n \"General\",\n \"Spot\"\n ],\n \"ipWhitelist\": [\n \"127.**.1\",\n \"203.**.154\"\n ],\n \"createdAt\": 1729821494000\n }\n ]\n}" + data = "{\n \"code\": \"200000\",\n \"data\": {\n \"currentPage\": 1,\n \"pageSize\": 20,\n \"totalNum\": 1,\n \"totalPage\": 1,\n \"items\": [\n {\n \"accountName\": \"Account15\",\n \"uid\": \"226383154\",\n \"createdAt\": 1729819382000,\n \"level\": 0\n }\n ]\n }\n}" common_response = RestResponse.from_json(data) - resp = GetSubAccountApiResp.from_dict(common_response.data) + resp = GetSubAccountResp.from_dict(common_response.data) def test_add_sub_account_api_req_model(self): """ @@ -106,43 +106,24 @@ def test_add_sub_account_api_resp_model(self): common_response = RestResponse.from_json(data) resp = AddSubAccountApiResp.from_dict(common_response.data) - def test_get_sub_account_req_model(self): - """ - get_sub_account - Get SubAccount - /api/v1/broker/nd/account - """ - data = "{\"uid\": \"226383154\", \"currentPage\": 1, \"pageSize\": 20}" - req = GetSubAccountReq.from_json(data) - - def test_get_sub_account_resp_model(self): - """ - get_sub_account - Get SubAccount - /api/v1/broker/nd/account - """ - data = "{\n \"code\": \"200000\",\n \"data\": {\n \"currentPage\": 1,\n \"pageSize\": 20,\n \"totalNum\": 1,\n \"totalPage\": 1,\n \"items\": [\n {\n \"accountName\": \"Account15\",\n \"uid\": \"226383154\",\n \"createdAt\": 1729819382000,\n \"level\": 0\n }\n ]\n }\n}" - common_response = RestResponse.from_json(data) - resp = GetSubAccountResp.from_dict(common_response.data) - - def test_add_sub_account_req_model(self): + def test_get_sub_account_api_req_model(self): """ - add_sub_account - Add SubAccount - /api/v1/broker/nd/account + get_sub_account_api + Get SubAccount API + /api/v1/broker/nd/account/apikey """ - data = "{\"accountName\": \"Account1\"}" - req = AddSubAccountReq.from_json(data) + data = "{\"uid\": \"226383154\", \"apiKey\": \"671afb36cee20f00015cfaf1\"}" + req = GetSubAccountApiReq.from_json(data) - def test_add_sub_account_resp_model(self): + def test_get_sub_account_api_resp_model(self): """ - add_sub_account - Add SubAccount - /api/v1/broker/nd/account + get_sub_account_api + Get SubAccount API + /api/v1/broker/nd/account/apikey """ - data = "{\n \"code\": \"200000\",\n \"data\": {\n \"accountName\": \"Account15\",\n \"uid\": \"226383154\",\n \"createdAt\": 1729819381908,\n \"level\": 0\n }\n}" + data = "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"uid\": \"226383154\",\n \"label\": \"This is remarks\",\n \"apiKey\": \"671afb36cee20f00015cfaf1\",\n \"apiVersion\": 3,\n \"permissions\": [\n \"General\",\n \"Spot\"\n ],\n \"ipWhitelist\": [\n \"127.**.1\",\n \"203.**.154\"\n ],\n \"createdAt\": 1729821494000\n }\n ]\n}" common_response = RestResponse.from_json(data) - resp = AddSubAccountResp.from_dict(common_response.data) + resp = GetSubAccountApiResp.from_dict(common_response.data) def test_modify_sub_account_api_req_model(self): """ @@ -163,43 +144,24 @@ def test_modify_sub_account_api_resp_model(self): common_response = RestResponse.from_json(data) resp = ModifySubAccountApiResp.from_dict(common_response.data) - def test_get_broker_info_req_model(self): - """ - get_broker_info - Get Broker Info - /api/v1/broker/nd/info - """ - data = "{\"begin\": \"20240510\", \"end\": \"20241010\", \"tradeType\": \"1\"}" - req = GetBrokerInfoReq.from_json(data) - - def test_get_broker_info_resp_model(self): - """ - get_broker_info - Get Broker Info - /api/v1/broker/nd/info - """ - data = "{\n \"code\": \"200000\",\n \"data\": {\n \"accountSize\": 0,\n \"maxAccountSize\": null,\n \"level\": 0\n }\n}" - common_response = RestResponse.from_json(data) - resp = GetBrokerInfoResp.from_dict(common_response.data) - - def test_get_rebase_req_model(self): + def test_delete_sub_account_api_req_model(self): """ - get_rebase - Get Broker Rebate - /api/v1/broker/nd/rebase/download + delete_sub_account_api + Delete SubAccount API + /api/v1/broker/nd/account/apikey """ - data = "{\"begin\": \"20240610\", \"end\": \"20241010\", \"tradeType\": \"1\"}" - req = GetRebaseReq.from_json(data) + data = "{\"uid\": \"226383154\", \"apiKey\": \"671afb36cee20f00015cfaf1\"}" + req = DeleteSubAccountApiReq.from_json(data) - def test_get_rebase_resp_model(self): + def test_delete_sub_account_api_resp_model(self): """ - get_rebase - Get Broker Rebate - /api/v1/broker/nd/rebase/download + delete_sub_account_api + Delete SubAccount API + /api/v1/broker/nd/account/apikey """ - data = "{\n \"code\": \"200000\",\n \"data\": {\n \"url\": \"https://kc-v2-promotion.s3.ap-northeast-1.amazonaws.com/broker/671aec522593f600019766d0_file.csv?X-Amz-Security-Token=IQo*********2cd90f14efb\"\n }\n}" + data = "{\n \"code\": \"200000\",\n \"data\": true\n}" common_response = RestResponse.from_json(data) - resp = GetRebaseResp.from_dict(common_response.data) + resp = DeleteSubAccountApiResp.from_dict(common_response.data) def test_transfer_req_model(self): """ @@ -220,25 +182,6 @@ def test_transfer_resp_model(self): common_response = RestResponse.from_json(data) resp = TransferResp.from_dict(common_response.data) - def test_get_deposit_detail_req_model(self): - """ - get_deposit_detail - Get Deposit Detail - /api/v3/broker/nd/deposit/detail - """ - data = "{\"currency\": \"USDT\", \"hash\": \"30bb0e0b***4156c5188\"}" - req = GetDepositDetailReq.from_json(data) - - def test_get_deposit_detail_resp_model(self): - """ - get_deposit_detail - Get Deposit Detail - /api/v3/broker/nd/deposit/detail - """ - data = "{\n \"data\" : {\n \"chain\" : \"trx\",\n \"hash\" : \"30bb0e0b***4156c5188\",\n \"walletTxId\" : \"30bb0***610d1030f\",\n \"uid\" : 201496341,\n \"updatedAt\" : 1713429174000,\n \"amount\" : \"8.5\",\n \"memo\" : \"\",\n \"fee\" : \"0.0\",\n \"address\" : \"THLPzUrbd1o***vP7d\",\n \"remark\" : \"Deposit\",\n \"isInner\" : false,\n \"currency\" : \"USDT\",\n \"status\" : \"SUCCESS\",\n \"createdAt\" : 1713429173000\n },\n \"code\" : \"200000\"\n}" - common_response = RestResponse.from_json(data) - resp = GetDepositDetailResp.from_dict(common_response.data) - def test_get_transfer_history_req_model(self): """ get_transfer_history @@ -258,6 +201,44 @@ def test_get_transfer_history_resp_model(self): common_response = RestResponse.from_json(data) resp = GetTransferHistoryResp.from_dict(common_response.data) + def test_get_deposit_list_req_model(self): + """ + get_deposit_list + Get Deposit List + /api/v1/asset/ndbroker/deposit/list + """ + data = "{\"currency\": \"USDT\", \"status\": \"SUCCESS\", \"hash\": \"example_string_default_value\", \"startTimestamp\": 123456, \"endTimestamp\": 123456, \"limit\": 100}" + req = GetDepositListReq.from_json(data) + + def test_get_deposit_list_resp_model(self): + """ + get_deposit_list + Get Deposit List + /api/v1/asset/ndbroker/deposit/list + """ + data = "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"uid\": 165111215,\n \"hash\": \"6724e363a492800007ec602b\",\n \"address\": \"xxxxxxx@gmail.com\",\n \"memo\": \"\",\n \"amount\": \"3.0\",\n \"fee\": \"0.0\",\n \"currency\": \"USDT\",\n \"isInner\": true,\n \"walletTxId\": \"bbbbbbbbb\",\n \"status\": \"SUCCESS\",\n \"chain\": \"\",\n \"remark\": \"\",\n \"createdAt\": 1730470760000,\n \"updatedAt\": 1730470760000\n }\n ]\n}" + common_response = RestResponse.from_json(data) + resp = GetDepositListResp.from_dict(common_response.data) + + def test_get_deposit_detail_req_model(self): + """ + get_deposit_detail + Get Deposit Detail + /api/v3/broker/nd/deposit/detail + """ + data = "{\"currency\": \"USDT\", \"hash\": \"30bb0e0b***4156c5188\"}" + req = GetDepositDetailReq.from_json(data) + + def test_get_deposit_detail_resp_model(self): + """ + get_deposit_detail + Get Deposit Detail + /api/v3/broker/nd/deposit/detail + """ + data = "{\n \"data\" : {\n \"chain\" : \"trx\",\n \"hash\" : \"30bb0e0b***4156c5188\",\n \"walletTxId\" : \"30bb0***610d1030f\",\n \"uid\" : 201496341,\n \"updatedAt\" : 1713429174000,\n \"amount\" : \"8.5\",\n \"memo\" : \"\",\n \"fee\" : \"0.0\",\n \"address\" : \"THLPzUrbd1o***vP7d\",\n \"remark\" : \"Deposit\",\n \"isInner\" : false,\n \"currency\" : \"USDT\",\n \"status\" : \"SUCCESS\",\n \"createdAt\" : 1713429173000\n },\n \"code\" : \"200000\"\n}" + common_response = RestResponse.from_json(data) + resp = GetDepositDetailResp.from_dict(common_response.data) + def test_get_withdraw_detail_req_model(self): """ get_withdraw_detail @@ -276,3 +257,22 @@ def test_get_withdraw_detail_resp_model(self): data = "{\n \"data\": {\n \"id\": \"66617a2***3c9a\",\n \"chain\": \"ton\",\n \"walletTxId\": \"AJ***eRI=\",\n \"uid\": 157267400,\n \"amount\": \"1.00000000\",\n \"memo\": \"7025734\",\n \"fee\": \"0.00000000\",\n \"address\": \"EQDn***dKbGzr\",\n \"remark\": \"\",\n \"isInner\": false,\n \"currency\": \"USDT\",\n \"status\": \"SUCCESS\",\n \"createdAt\": 1717664288000,\n \"updatedAt\": 1717664375000\n },\n \"code\": \"200000\"\n}" common_response = RestResponse.from_json(data) resp = GetWithdrawDetailResp.from_dict(common_response.data) + + def test_get_rebase_req_model(self): + """ + get_rebase + Get Broker Rebate + /api/v1/broker/nd/rebase/download + """ + data = "{\"begin\": \"20240610\", \"end\": \"20241010\", \"tradeType\": \"1\"}" + req = GetRebaseReq.from_json(data) + + def test_get_rebase_resp_model(self): + """ + get_rebase + Get Broker Rebate + /api/v1/broker/nd/rebase/download + """ + data = "{\n \"code\": \"200000\",\n \"data\": {\n \"url\": \"https://kc-v2-promotion.s3.ap-northeast-1.amazonaws.com/broker/671aec522593f600019766d0_file.csv?X-Amz-Security-Token=IQo*********2cd90f14efb\"\n }\n}" + common_response = RestResponse.from_json(data) + resp = GetRebaseResp.from_dict(common_response.data) diff --git a/sdk/python/kucoin_universal_sdk/generate/earn/earn/api_earn.py b/sdk/python/kucoin_universal_sdk/generate/earn/earn/api_earn.py index fbc8579e..62875daf 100644 --- a/sdk/python/kucoin_universal_sdk/generate/earn/earn/api_earn.py +++ b/sdk/python/kucoin_universal_sdk/generate/earn/earn/api_earn.py @@ -26,18 +26,17 @@ class EarnAPI(ABC): @abstractmethod - def get_eth_staking_products(self, req: GetEthStakingProductsReq, - **kwargs: Any) -> GetEthStakingProductsResp: + def purchase(self, req: PurchaseReq, **kwargs: Any) -> PurchaseResp: """ - summary: Get ETH Staking Products - description: This endpoint can get available ETH staking products. If no products are available, an empty list is returned. - documentation: https://www.kucoin.com/docs-new/api-3470276 + summary: purchase + description: This endpoint allows subscribing earn product + documentation: https://www.kucoin.com/docs-new/api-3470268 +---------------------+---------+ | Extra API Info | Value | +---------------------+---------+ | API-DOMAIN | SPOT | | API-CHANNEL | PRIVATE | - | API-PERMISSION | GENERAL | + | API-PERMISSION | EARN | | API-RATE-LIMIT-POOL | EARN | | API-RATE-LIMIT | 5 | +---------------------+---------+ @@ -45,18 +44,18 @@ def get_eth_staking_products(self, req: GetEthStakingProductsReq, pass @abstractmethod - def get_account_holding(self, req: GetAccountHoldingReq, - **kwargs: Any) -> GetAccountHoldingResp: + def get_redeem_preview(self, req: GetRedeemPreviewReq, + **kwargs: Any) -> GetRedeemPreviewResp: """ - summary: Get Account Holding - description: This endpoint can get current holding assets information. If no current holding assets are available, an empty list is returned. - documentation: https://www.kucoin.com/docs-new/api-3470273 + summary: Get Redeem Preview + description: This endpoint allows subscribing earn products + documentation: https://www.kucoin.com/docs-new/api-3470269 +---------------------+---------+ | Extra API Info | Value | +---------------------+---------+ | API-DOMAIN | SPOT | | API-CHANNEL | PRIVATE | - | API-PERMISSION | GENERAL | + | API-PERMISSION | EARN | | API-RATE-LIMIT-POOL | EARN | | API-RATE-LIMIT | 5 | +---------------------+---------+ @@ -64,18 +63,17 @@ def get_account_holding(self, req: GetAccountHoldingReq, pass @abstractmethod - def get_kcs_staking_products(self, req: GetKcsStakingProductsReq, - **kwargs: Any) -> GetKcsStakingProductsResp: + def redeem(self, req: RedeemReq, **kwargs: Any) -> RedeemResp: """ - summary: Get KCS Staking Products - description: This endpoint can get available KCS staking products. If no products are available, an empty list is returned. - documentation: https://www.kucoin.com/docs-new/api-3470275 + summary: Redeem + description: This endpoint allows initiating redemption by holding ID. If the current holding is fully redeemed or in the process of being redeemed, it indicates that the holding does not exist. + documentation: https://www.kucoin.com/docs-new/api-3470270 +---------------------+---------+ | Extra API Info | Value | +---------------------+---------+ | API-DOMAIN | SPOT | | API-CHANNEL | PRIVATE | - | API-PERMISSION | GENERAL | + | API-PERMISSION | EARN | | API-RATE-LIMIT-POOL | EARN | | API-RATE-LIMIT | 5 | +---------------------+---------+ @@ -83,17 +81,18 @@ def get_kcs_staking_products(self, req: GetKcsStakingProductsReq, pass @abstractmethod - def redeem(self, req: RedeemReq, **kwargs: Any) -> RedeemResp: + def get_savings_products(self, req: GetSavingsProductsReq, + **kwargs: Any) -> GetSavingsProductsResp: """ - summary: Redeem - description: This endpoint allows initiating redemption by holding ID. If the current holding is fully redeemed or in the process of being redeemed, it indicates that the holding does not exist. - documentation: https://www.kucoin.com/docs-new/api-3470270 + summary: Get Savings Products + description: This endpoint can get available savings products. If no products are available, an empty list is returned. + documentation: https://www.kucoin.com/docs-new/api-3470271 +---------------------+---------+ | Extra API Info | Value | +---------------------+---------+ | API-DOMAIN | SPOT | | API-CHANNEL | PRIVATE | - | API-PERMISSION | EARN | + | API-PERMISSION | GENERAL | | API-RATE-LIMIT-POOL | EARN | | API-RATE-LIMIT | 5 | +---------------------+---------+ @@ -101,17 +100,18 @@ def redeem(self, req: RedeemReq, **kwargs: Any) -> RedeemResp: pass @abstractmethod - def purchase(self, req: PurchaseReq, **kwargs: Any) -> PurchaseResp: + def get_promotion_products(self, req: GetPromotionProductsReq, + **kwargs: Any) -> GetPromotionProductsResp: """ - summary: purchase - description: This endpoint allows subscribing earn product - documentation: https://www.kucoin.com/docs-new/api-3470268 + summary: Get Promotion Products + description: This endpoint can get available limited-time promotion products. If no products are available, an empty list is returned. + documentation: https://www.kucoin.com/docs-new/api-3470272 +---------------------+---------+ | Extra API Info | Value | +---------------------+---------+ | API-DOMAIN | SPOT | | API-CHANNEL | PRIVATE | - | API-PERMISSION | EARN | + | API-PERMISSION | GENERAL | | API-RATE-LIMIT-POOL | EARN | | API-RATE-LIMIT | 5 | +---------------------+---------+ @@ -119,12 +119,12 @@ def purchase(self, req: PurchaseReq, **kwargs: Any) -> PurchaseResp: pass @abstractmethod - def get_promotion_products(self, req: GetPromotionProductsReq, - **kwargs: Any) -> GetPromotionProductsResp: + def get_account_holding(self, req: GetAccountHoldingReq, + **kwargs: Any) -> GetAccountHoldingResp: """ - summary: Get Promotion Products - description: This endpoint can get available limited-time promotion products. If no products are available, an empty list is returned. - documentation: https://www.kucoin.com/docs-new/api-3470272 + summary: Get Account Holding + description: This endpoint can get current holding assets information. If no current holding assets are available, an empty list is returned. + documentation: https://www.kucoin.com/docs-new/api-3470273 +---------------------+---------+ | Extra API Info | Value | +---------------------+---------+ @@ -138,18 +138,18 @@ def get_promotion_products(self, req: GetPromotionProductsReq, pass @abstractmethod - def get_redeem_preview(self, req: GetRedeemPreviewReq, - **kwargs: Any) -> GetRedeemPreviewResp: + def get_staking_products(self, req: GetStakingProductsReq, + **kwargs: Any) -> GetStakingProductsResp: """ - summary: Get Redeem Preview - description: This endpoint allows subscribing earn products - documentation: https://www.kucoin.com/docs-new/api-3470269 + summary: Get Staking Products + description: This endpoint can get available staking products. If no products are available, an empty list is returned. + documentation: https://www.kucoin.com/docs-new/api-3470274 +---------------------+---------+ | Extra API Info | Value | +---------------------+---------+ | API-DOMAIN | SPOT | | API-CHANNEL | PRIVATE | - | API-PERMISSION | EARN | + | API-PERMISSION | GENERAL | | API-RATE-LIMIT-POOL | EARN | | API-RATE-LIMIT | 5 | +---------------------+---------+ @@ -157,12 +157,12 @@ def get_redeem_preview(self, req: GetRedeemPreviewReq, pass @abstractmethod - def get_savings_products(self, req: GetSavingsProductsReq, - **kwargs: Any) -> GetSavingsProductsResp: + def get_kcs_staking_products(self, req: GetKcsStakingProductsReq, + **kwargs: Any) -> GetKcsStakingProductsResp: """ - summary: Get Savings Products - description: This endpoint can get available savings products. If no products are available, an empty list is returned. - documentation: https://www.kucoin.com/docs-new/api-3470271 + summary: Get KCS Staking Products + description: This endpoint can get available KCS staking products. If no products are available, an empty list is returned. + documentation: https://www.kucoin.com/docs-new/api-3470275 +---------------------+---------+ | Extra API Info | Value | +---------------------+---------+ @@ -176,12 +176,12 @@ def get_savings_products(self, req: GetSavingsProductsReq, pass @abstractmethod - def get_staking_products(self, req: GetStakingProductsReq, - **kwargs: Any) -> GetStakingProductsResp: + def get_eth_staking_products(self, req: GetEthStakingProductsReq, + **kwargs: Any) -> GetEthStakingProductsResp: """ - summary: Get Staking Products - description: This endpoint can get available staking products. If no products are available, an empty list is returned. - documentation: https://www.kucoin.com/docs-new/api-3470274 + summary: Get ETH Staking Products + description: This endpoint can get available ETH staking products. If no products are available, an empty list is returned. + documentation: https://www.kucoin.com/docs-new/api-3470276 +---------------------+---------+ | Extra API Info | Value | +---------------------+---------+ @@ -200,56 +200,56 @@ class EarnAPIImpl(EarnAPI): def __init__(self, transport: Transport): self.transport = transport - def get_eth_staking_products(self, req: GetEthStakingProductsReq, - **kwargs: Any) -> GetEthStakingProductsResp: - return self.transport.call("spot", False, "GET", - "/api/v1/earn/eth-staking/products", req, - GetEthStakingProductsResp(), False, - **kwargs) - - def get_account_holding(self, req: GetAccountHoldingReq, - **kwargs: Any) -> GetAccountHoldingResp: - return self.transport.call("spot", False, "GET", - "/api/v1/earn/hold-assets", req, - GetAccountHoldingResp(), False, **kwargs) - - def get_kcs_staking_products(self, req: GetKcsStakingProductsReq, - **kwargs: Any) -> GetKcsStakingProductsResp: - return self.transport.call("spot", False, "GET", - "/api/v1/earn/kcs-staking/products", req, - GetKcsStakingProductsResp(), False, - **kwargs) - - def redeem(self, req: RedeemReq, **kwargs: Any) -> RedeemResp: - return self.transport.call("spot", False, - "DELETE", "/api/v1/earn/orders", req, - RedeemResp(), False, **kwargs) - def purchase(self, req: PurchaseReq, **kwargs: Any) -> PurchaseResp: return self.transport.call("spot", False, "POST", "/api/v1/earn/orders", req, PurchaseResp(), False, **kwargs) - def get_promotion_products(self, req: GetPromotionProductsReq, - **kwargs: Any) -> GetPromotionProductsResp: - return self.transport.call("spot", False, "GET", - "/api/v1/earn/promotion/products", req, - GetPromotionProductsResp(), False, **kwargs) - def get_redeem_preview(self, req: GetRedeemPreviewReq, **kwargs: Any) -> GetRedeemPreviewResp: return self.transport.call("spot", False, "GET", "/api/v1/earn/redeem-preview", req, GetRedeemPreviewResp(), False, **kwargs) + def redeem(self, req: RedeemReq, **kwargs: Any) -> RedeemResp: + return self.transport.call("spot", False, + "DELETE", "/api/v1/earn/orders", req, + RedeemResp(), False, **kwargs) + def get_savings_products(self, req: GetSavingsProductsReq, **kwargs: Any) -> GetSavingsProductsResp: return self.transport.call("spot", False, "GET", "/api/v1/earn/saving/products", req, GetSavingsProductsResp(), False, **kwargs) + def get_promotion_products(self, req: GetPromotionProductsReq, + **kwargs: Any) -> GetPromotionProductsResp: + return self.transport.call("spot", False, "GET", + "/api/v1/earn/promotion/products", req, + GetPromotionProductsResp(), False, **kwargs) + + def get_account_holding(self, req: GetAccountHoldingReq, + **kwargs: Any) -> GetAccountHoldingResp: + return self.transport.call("spot", False, "GET", + "/api/v1/earn/hold-assets", req, + GetAccountHoldingResp(), False, **kwargs) + def get_staking_products(self, req: GetStakingProductsReq, **kwargs: Any) -> GetStakingProductsResp: return self.transport.call("spot", False, "GET", "/api/v1/earn/staking/products", req, GetStakingProductsResp(), False, **kwargs) + + def get_kcs_staking_products(self, req: GetKcsStakingProductsReq, + **kwargs: Any) -> GetKcsStakingProductsResp: + return self.transport.call("spot", False, "GET", + "/api/v1/earn/kcs-staking/products", req, + GetKcsStakingProductsResp(), False, + **kwargs) + + def get_eth_staking_products(self, req: GetEthStakingProductsReq, + **kwargs: Any) -> GetEthStakingProductsResp: + return self.transport.call("spot", False, "GET", + "/api/v1/earn/eth-staking/products", req, + GetEthStakingProductsResp(), False, + **kwargs) diff --git a/sdk/python/kucoin_universal_sdk/generate/earn/earn/api_earn.template b/sdk/python/kucoin_universal_sdk/generate/earn/earn/api_earn.template index 51c12528..b157e30a 100644 --- a/sdk/python/kucoin_universal_sdk/generate/earn/earn/api_earn.template +++ b/sdk/python/kucoin_universal_sdk/generate/earn/earn/api_earn.template @@ -1,37 +1,18 @@ # API FUNCTION TEMPLATE -def test_get_eth_staking_products_req(self): - """ - get_eth_staking_products - Get ETH Staking Products - /api/v1/earn/eth-staking/products - """ - - builder = GetEthStakingProductsReqBuilder() - builder.set_currency(?) - req = builder.build() - try: - resp = self.api.get_eth_staking_products(req) - print("code: ", resp.common_response.code) - print("msg: ", resp.common_response.message) - print("data: ", resp.to_json()) - except Exception as e: - print("error: ", e) - raise e - -def test_get_account_holding_req(self): +def test_purchase_req(self): """ - get_account_holding - Get Account Holding - /api/v1/earn/hold-assets + purchase + purchase + /api/v1/earn/orders """ - builder = GetAccountHoldingReqBuilder() - builder.set_currency(?).set_product_id(?).set_product_category(?).set_current_page(?).set_page_size(?) + builder = PurchaseReqBuilder() + builder.set_product_id(?).set_amount(?).set_account_type(?) req = builder.build() try: - resp = self.api.get_account_holding(req) + resp = self.api.purchase(req) print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) @@ -39,18 +20,18 @@ def test_get_account_holding_req(self): print("error: ", e) raise e -def test_get_kcs_staking_products_req(self): +def test_get_redeem_preview_req(self): """ - get_kcs_staking_products - Get KCS Staking Products - /api/v1/earn/kcs-staking/products + get_redeem_preview + Get Redeem Preview + /api/v1/earn/redeem-preview """ - builder = GetKcsStakingProductsReqBuilder() - builder.set_currency(?) + builder = GetRedeemPreviewReqBuilder() + builder.set_order_id(?).set_from_account_type(?) req = builder.build() try: - resp = self.api.get_kcs_staking_products(req) + resp = self.api.get_redeem_preview(req) print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) @@ -77,18 +58,18 @@ def test_redeem_req(self): print("error: ", e) raise e -def test_purchase_req(self): +def test_get_savings_products_req(self): """ - purchase - purchase - /api/v1/earn/orders + get_savings_products + Get Savings Products + /api/v1/earn/saving/products """ - builder = PurchaseReqBuilder() - builder.set_product_id(?).set_amount(?).set_account_type(?) + builder = GetSavingsProductsReqBuilder() + builder.set_currency(?) req = builder.build() try: - resp = self.api.purchase(req) + resp = self.api.get_savings_products(req) print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) @@ -115,18 +96,18 @@ def test_get_promotion_products_req(self): print("error: ", e) raise e -def test_get_redeem_preview_req(self): +def test_get_account_holding_req(self): """ - get_redeem_preview - Get Redeem Preview - /api/v1/earn/redeem-preview + get_account_holding + Get Account Holding + /api/v1/earn/hold-assets """ - builder = GetRedeemPreviewReqBuilder() - builder.set_order_id(?).set_from_account_type(?) + builder = GetAccountHoldingReqBuilder() + builder.set_currency(?).set_product_id(?).set_product_category(?).set_current_page(?).set_page_size(?) req = builder.build() try: - resp = self.api.get_redeem_preview(req) + resp = self.api.get_account_holding(req) print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) @@ -134,18 +115,18 @@ def test_get_redeem_preview_req(self): print("error: ", e) raise e -def test_get_savings_products_req(self): +def test_get_staking_products_req(self): """ - get_savings_products - Get Savings Products - /api/v1/earn/saving/products + get_staking_products + Get Staking Products + /api/v1/earn/staking/products """ - builder = GetSavingsProductsReqBuilder() + builder = GetStakingProductsReqBuilder() builder.set_currency(?) req = builder.build() try: - resp = self.api.get_savings_products(req) + resp = self.api.get_staking_products(req) print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) @@ -153,18 +134,37 @@ def test_get_savings_products_req(self): print("error: ", e) raise e -def test_get_staking_products_req(self): +def test_get_kcs_staking_products_req(self): """ - get_staking_products - Get Staking Products - /api/v1/earn/staking/products + get_kcs_staking_products + Get KCS Staking Products + /api/v1/earn/kcs-staking/products """ - builder = GetStakingProductsReqBuilder() + builder = GetKcsStakingProductsReqBuilder() builder.set_currency(?) req = builder.build() try: - resp = self.api.get_staking_products(req) + resp = self.api.get_kcs_staking_products(req) + print("code: ", resp.common_response.code) + print("msg: ", resp.common_response.message) + print("data: ", resp.to_json()) + except Exception as e: + print("error: ", e) + raise e + +def test_get_eth_staking_products_req(self): + """ + get_eth_staking_products + Get ETH Staking Products + /api/v1/earn/eth-staking/products + """ + + builder = GetEthStakingProductsReqBuilder() + builder.set_currency(?) + req = builder.build() + try: + resp = self.api.get_eth_staking_products(req) print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) diff --git a/sdk/python/kucoin_universal_sdk/generate/earn/earn/api_earn_test.py b/sdk/python/kucoin_universal_sdk/generate/earn/earn/api_earn_test.py index c505da0d..cee5db0c 100644 --- a/sdk/python/kucoin_universal_sdk/generate/earn/earn/api_earn_test.py +++ b/sdk/python/kucoin_universal_sdk/generate/earn/earn/api_earn_test.py @@ -22,62 +22,43 @@ class EarnAPITest(unittest.TestCase): - def test_get_eth_staking_products_req_model(self): - """ - get_eth_staking_products - Get ETH Staking Products - /api/v1/earn/eth-staking/products - """ - data = "{\"currency\": \"BTC\"}" - req = GetEthStakingProductsReq.from_json(data) - - def test_get_eth_staking_products_resp_model(self): - """ - get_eth_staking_products - Get ETH Staking Products - /api/v1/earn/eth-staking/products - """ - data = "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"id\": \"ETH2\",\n \"category\": \"ETH2\",\n \"type\": \"DEMAND\",\n \"precision\": 8,\n \"currency\": \"ETH\",\n \"incomeCurrency\": \"ETH2\",\n \"returnRate\": \"0.028\",\n \"userLowerLimit\": \"0.01\",\n \"userUpperLimit\": \"8557.3597075\",\n \"productUpperLimit\": \"8557.3597075\",\n \"productRemainAmount\": \"8557.3597075\",\n \"redeemPeriod\": 5,\n \"redeemType\": \"MANUAL\",\n \"incomeReleaseType\": \"DAILY\",\n \"applyStartTime\": 1729255485000,\n \"applyEndTime\": null,\n \"lockStartTime\": 1729255485000,\n \"lockEndTime\": null,\n \"interestDate\": 1729267200000,\n \"newUserOnly\": 0,\n \"earlyRedeemSupported\": 0,\n \"duration\": 0,\n \"status\": \"ONGOING\"\n }\n ]\n}" - common_response = RestResponse.from_json(data) - resp = GetEthStakingProductsResp.from_dict(common_response.data) - - def test_get_account_holding_req_model(self): + def test_purchase_req_model(self): """ - get_account_holding - Get Account Holding - /api/v1/earn/hold-assets + purchase + purchase + /api/v1/earn/orders """ - data = "{\"currency\": \"KCS\", \"productId\": \"example_string_default_value\", \"productCategory\": \"DEMAND\", \"currentPage\": 1, \"pageSize\": 10}" - req = GetAccountHoldingReq.from_json(data) + data = "{\"productId\": \"2611\", \"amount\": \"1\", \"accountType\": \"TRADE\"}" + req = PurchaseReq.from_json(data) - def test_get_account_holding_resp_model(self): + def test_purchase_resp_model(self): """ - get_account_holding - Get Account Holding - /api/v1/earn/hold-assets + purchase + purchase + /api/v1/earn/orders """ - data = "{\n \"code\": \"200000\",\n \"data\": {\n \"totalNum\": 1,\n \"totalPage\": 1,\n \"currentPage\": 1,\n \"pageSize\": 15,\n \"items\": [\n {\n \"orderId\": \"2767291\",\n \"productId\": \"2611\",\n \"productCategory\": \"KCS_STAKING\",\n \"productType\": \"DEMAND\",\n \"currency\": \"KCS\",\n \"incomeCurrency\": \"KCS\",\n \"returnRate\": \"0.03471727\",\n \"holdAmount\": \"1\",\n \"redeemedAmount\": \"0\",\n \"redeemingAmount\": \"1\",\n \"lockStartTime\": 1701252000000,\n \"lockEndTime\": null,\n \"purchaseTime\": 1729257513000,\n \"redeemPeriod\": 3,\n \"status\": \"REDEEMING\",\n \"earlyRedeemSupported\": 0\n }\n ]\n }\n}" + data = "{\n \"code\": \"200000\",\n \"data\": {\n \"orderId\": \"2767291\",\n \"orderTxId\": \"6603694\"\n }\n}" common_response = RestResponse.from_json(data) - resp = GetAccountHoldingResp.from_dict(common_response.data) + resp = PurchaseResp.from_dict(common_response.data) - def test_get_kcs_staking_products_req_model(self): + def test_get_redeem_preview_req_model(self): """ - get_kcs_staking_products - Get KCS Staking Products - /api/v1/earn/kcs-staking/products + get_redeem_preview + Get Redeem Preview + /api/v1/earn/redeem-preview """ - data = "{\"currency\": \"BTC\"}" - req = GetKcsStakingProductsReq.from_json(data) + data = "{\"orderId\": \"2767291\", \"fromAccountType\": \"MAIN\"}" + req = GetRedeemPreviewReq.from_json(data) - def test_get_kcs_staking_products_resp_model(self): + def test_get_redeem_preview_resp_model(self): """ - get_kcs_staking_products - Get KCS Staking Products - /api/v1/earn/kcs-staking/products + get_redeem_preview + Get Redeem Preview + /api/v1/earn/redeem-preview """ - data = "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"id\": \"2611\",\n \"currency\": \"KCS\",\n \"category\": \"KCS_STAKING\",\n \"type\": \"DEMAND\",\n \"precision\": 8,\n \"productUpperLimit\": \"100000000\",\n \"userUpperLimit\": \"100000000\",\n \"userLowerLimit\": \"1\",\n \"redeemPeriod\": 3,\n \"lockStartTime\": 1701252000000,\n \"lockEndTime\": null,\n \"applyStartTime\": 1701252000000,\n \"applyEndTime\": null,\n \"returnRate\": \"0.03471727\",\n \"incomeCurrency\": \"KCS\",\n \"earlyRedeemSupported\": 0,\n \"productRemainAmount\": \"58065850.54998251\",\n \"status\": \"ONGOING\",\n \"redeemType\": \"MANUAL\",\n \"incomeReleaseType\": \"DAILY\",\n \"interestDate\": 1729267200000,\n \"duration\": 0,\n \"newUserOnly\": 0\n }\n ]\n}" + data = "{\n \"code\": \"200000\",\n \"data\": {\n \"currency\": \"KCS\",\n \"redeemAmount\": \"1\",\n \"penaltyInterestAmount\": \"0\",\n \"redeemPeriod\": 3,\n \"deliverTime\": 1729518951000,\n \"manualRedeemable\": true,\n \"redeemAll\": false\n }\n}" common_response = RestResponse.from_json(data) - resp = GetKcsStakingProductsResp.from_dict(common_response.data) + resp = GetRedeemPreviewResp.from_dict(common_response.data) def test_redeem_req_model(self): """ @@ -98,24 +79,24 @@ def test_redeem_resp_model(self): common_response = RestResponse.from_json(data) resp = RedeemResp.from_dict(common_response.data) - def test_purchase_req_model(self): + def test_get_savings_products_req_model(self): """ - purchase - purchase - /api/v1/earn/orders + get_savings_products + Get Savings Products + /api/v1/earn/saving/products """ - data = "{\"productId\": \"2611\", \"amount\": \"1\", \"accountType\": \"TRADE\"}" - req = PurchaseReq.from_json(data) + data = "{\"currency\": \"BTC\"}" + req = GetSavingsProductsReq.from_json(data) - def test_purchase_resp_model(self): + def test_get_savings_products_resp_model(self): """ - purchase - purchase - /api/v1/earn/orders + get_savings_products + Get Savings Products + /api/v1/earn/saving/products """ - data = "{\n \"code\": \"200000\",\n \"data\": {\n \"orderId\": \"2767291\",\n \"orderTxId\": \"6603694\"\n }\n}" + data = "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"id\": \"2172\",\n \"currency\": \"BTC\",\n \"category\": \"DEMAND\",\n \"type\": \"DEMAND\",\n \"precision\": 8,\n \"productUpperLimit\": \"480\",\n \"productRemainAmount\": \"132.36153083\",\n \"userUpperLimit\": \"20\",\n \"userLowerLimit\": \"0.01\",\n \"redeemPeriod\": 0,\n \"lockStartTime\": 1644807600000,\n \"lockEndTime\": null,\n \"applyStartTime\": 1644807600000,\n \"applyEndTime\": null,\n \"returnRate\": \"0.00047208\",\n \"incomeCurrency\": \"BTC\",\n \"earlyRedeemSupported\": 0,\n \"status\": \"ONGOING\",\n \"redeemType\": \"MANUAL\",\n \"incomeReleaseType\": \"DAILY\",\n \"interestDate\": 1729267200000,\n \"duration\": 0,\n \"newUserOnly\": 0\n }\n ]\n}" common_response = RestResponse.from_json(data) - resp = PurchaseResp.from_dict(common_response.data) + resp = GetSavingsProductsResp.from_dict(common_response.data) def test_get_promotion_products_req_model(self): """ @@ -136,43 +117,24 @@ def test_get_promotion_products_resp_model(self): common_response = RestResponse.from_json(data) resp = GetPromotionProductsResp.from_dict(common_response.data) - def test_get_redeem_preview_req_model(self): - """ - get_redeem_preview - Get Redeem Preview - /api/v1/earn/redeem-preview - """ - data = "{\"orderId\": \"2767291\", \"fromAccountType\": \"MAIN\"}" - req = GetRedeemPreviewReq.from_json(data) - - def test_get_redeem_preview_resp_model(self): - """ - get_redeem_preview - Get Redeem Preview - /api/v1/earn/redeem-preview - """ - data = "{\n \"code\": \"200000\",\n \"data\": {\n \"currency\": \"KCS\",\n \"redeemAmount\": \"1\",\n \"penaltyInterestAmount\": \"0\",\n \"redeemPeriod\": 3,\n \"deliverTime\": 1729518951000,\n \"manualRedeemable\": true,\n \"redeemAll\": false\n }\n}" - common_response = RestResponse.from_json(data) - resp = GetRedeemPreviewResp.from_dict(common_response.data) - - def test_get_savings_products_req_model(self): + def test_get_account_holding_req_model(self): """ - get_savings_products - Get Savings Products - /api/v1/earn/saving/products + get_account_holding + Get Account Holding + /api/v1/earn/hold-assets """ - data = "{\"currency\": \"BTC\"}" - req = GetSavingsProductsReq.from_json(data) + data = "{\"currency\": \"KCS\", \"productId\": \"example_string_default_value\", \"productCategory\": \"DEMAND\", \"currentPage\": 1, \"pageSize\": 10}" + req = GetAccountHoldingReq.from_json(data) - def test_get_savings_products_resp_model(self): + def test_get_account_holding_resp_model(self): """ - get_savings_products - Get Savings Products - /api/v1/earn/saving/products + get_account_holding + Get Account Holding + /api/v1/earn/hold-assets """ - data = "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"id\": \"2172\",\n \"currency\": \"BTC\",\n \"category\": \"DEMAND\",\n \"type\": \"DEMAND\",\n \"precision\": 8,\n \"productUpperLimit\": \"480\",\n \"productRemainAmount\": \"132.36153083\",\n \"userUpperLimit\": \"20\",\n \"userLowerLimit\": \"0.01\",\n \"redeemPeriod\": 0,\n \"lockStartTime\": 1644807600000,\n \"lockEndTime\": null,\n \"applyStartTime\": 1644807600000,\n \"applyEndTime\": null,\n \"returnRate\": \"0.00047208\",\n \"incomeCurrency\": \"BTC\",\n \"earlyRedeemSupported\": 0,\n \"status\": \"ONGOING\",\n \"redeemType\": \"MANUAL\",\n \"incomeReleaseType\": \"DAILY\",\n \"interestDate\": 1729267200000,\n \"duration\": 0,\n \"newUserOnly\": 0\n }\n ]\n}" + data = "{\n \"code\": \"200000\",\n \"data\": {\n \"totalNum\": 1,\n \"totalPage\": 1,\n \"currentPage\": 1,\n \"pageSize\": 15,\n \"items\": [\n {\n \"orderId\": \"2767291\",\n \"productId\": \"2611\",\n \"productCategory\": \"KCS_STAKING\",\n \"productType\": \"DEMAND\",\n \"currency\": \"KCS\",\n \"incomeCurrency\": \"KCS\",\n \"returnRate\": \"0.03471727\",\n \"holdAmount\": \"1\",\n \"redeemedAmount\": \"0\",\n \"redeemingAmount\": \"1\",\n \"lockStartTime\": 1701252000000,\n \"lockEndTime\": null,\n \"purchaseTime\": 1729257513000,\n \"redeemPeriod\": 3,\n \"status\": \"REDEEMING\",\n \"earlyRedeemSupported\": 0\n }\n ]\n }\n}" common_response = RestResponse.from_json(data) - resp = GetSavingsProductsResp.from_dict(common_response.data) + resp = GetAccountHoldingResp.from_dict(common_response.data) def test_get_staking_products_req_model(self): """ @@ -192,3 +154,41 @@ def test_get_staking_products_resp_model(self): data = "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"id\": \"2535\",\n \"currency\": \"STX\",\n \"category\": \"STAKING\",\n \"type\": \"DEMAND\",\n \"precision\": 8,\n \"productUpperLimit\": \"1000000\",\n \"userUpperLimit\": \"10000\",\n \"userLowerLimit\": \"1\",\n \"redeemPeriod\": 14,\n \"lockStartTime\": 1688614514000,\n \"lockEndTime\": null,\n \"applyStartTime\": 1688614512000,\n \"applyEndTime\": null,\n \"returnRate\": \"0.045\",\n \"incomeCurrency\": \"BTC\",\n \"earlyRedeemSupported\": 0,\n \"productRemainAmount\": \"254032.90178701\",\n \"status\": \"ONGOING\",\n \"redeemType\": \"MANUAL\",\n \"incomeReleaseType\": \"DAILY\",\n \"interestDate\": 1729267200000,\n \"duration\": 0,\n \"newUserOnly\": 0\n }\n ]\n}" common_response = RestResponse.from_json(data) resp = GetStakingProductsResp.from_dict(common_response.data) + + def test_get_kcs_staking_products_req_model(self): + """ + get_kcs_staking_products + Get KCS Staking Products + /api/v1/earn/kcs-staking/products + """ + data = "{\"currency\": \"BTC\"}" + req = GetKcsStakingProductsReq.from_json(data) + + def test_get_kcs_staking_products_resp_model(self): + """ + get_kcs_staking_products + Get KCS Staking Products + /api/v1/earn/kcs-staking/products + """ + data = "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"id\": \"2611\",\n \"currency\": \"KCS\",\n \"category\": \"KCS_STAKING\",\n \"type\": \"DEMAND\",\n \"precision\": 8,\n \"productUpperLimit\": \"100000000\",\n \"userUpperLimit\": \"100000000\",\n \"userLowerLimit\": \"1\",\n \"redeemPeriod\": 3,\n \"lockStartTime\": 1701252000000,\n \"lockEndTime\": null,\n \"applyStartTime\": 1701252000000,\n \"applyEndTime\": null,\n \"returnRate\": \"0.03471727\",\n \"incomeCurrency\": \"KCS\",\n \"earlyRedeemSupported\": 0,\n \"productRemainAmount\": \"58065850.54998251\",\n \"status\": \"ONGOING\",\n \"redeemType\": \"MANUAL\",\n \"incomeReleaseType\": \"DAILY\",\n \"interestDate\": 1729267200000,\n \"duration\": 0,\n \"newUserOnly\": 0\n }\n ]\n}" + common_response = RestResponse.from_json(data) + resp = GetKcsStakingProductsResp.from_dict(common_response.data) + + def test_get_eth_staking_products_req_model(self): + """ + get_eth_staking_products + Get ETH Staking Products + /api/v1/earn/eth-staking/products + """ + data = "{\"currency\": \"BTC\"}" + req = GetEthStakingProductsReq.from_json(data) + + def test_get_eth_staking_products_resp_model(self): + """ + get_eth_staking_products + Get ETH Staking Products + /api/v1/earn/eth-staking/products + """ + data = "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"id\": \"ETH2\",\n \"category\": \"ETH2\",\n \"type\": \"DEMAND\",\n \"precision\": 8,\n \"currency\": \"ETH\",\n \"incomeCurrency\": \"ETH2\",\n \"returnRate\": \"0.028\",\n \"userLowerLimit\": \"0.01\",\n \"userUpperLimit\": \"8557.3597075\",\n \"productUpperLimit\": \"8557.3597075\",\n \"productRemainAmount\": \"8557.3597075\",\n \"redeemPeriod\": 5,\n \"redeemType\": \"MANUAL\",\n \"incomeReleaseType\": \"DAILY\",\n \"applyStartTime\": 1729255485000,\n \"applyEndTime\": null,\n \"lockStartTime\": 1729255485000,\n \"lockEndTime\": null,\n \"interestDate\": 1729267200000,\n \"newUserOnly\": 0,\n \"earlyRedeemSupported\": 0,\n \"duration\": 0,\n \"status\": \"ONGOING\"\n }\n ]\n}" + common_response = RestResponse.from_json(data) + resp = GetEthStakingProductsResp.from_dict(common_response.data) diff --git a/sdk/python/kucoin_universal_sdk/generate/futures/fundingfees/api_funding_fees.py b/sdk/python/kucoin_universal_sdk/generate/futures/fundingfees/api_funding_fees.py index d3f16126..687da818 100644 --- a/sdk/python/kucoin_universal_sdk/generate/futures/fundingfees/api_funding_fees.py +++ b/sdk/python/kucoin_universal_sdk/generate/futures/fundingfees/api_funding_fees.py @@ -13,6 +13,25 @@ class FundingFeesAPI(ABC): + @abstractmethod + def get_current_funding_rate(self, req: GetCurrentFundingRateReq, + **kwargs: Any) -> GetCurrentFundingRateResp: + """ + summary: Get Current Funding Rate + description: get Current Funding Rate + documentation: https://www.kucoin.com/docs-new/api-3470265 + +---------------------+---------+ + | Extra API Info | Value | + +---------------------+---------+ + | API-DOMAIN | FUTURES | + | API-CHANNEL | PRIVATE | + | API-PERMISSION | FUTURES | + | API-RATE-LIMIT-POOL | PUBLIC | + | API-RATE-LIMIT | 2 | + +---------------------+---------+ + """ + pass + @abstractmethod def get_public_funding_history( self, req: GetPublicFundingHistoryReq, @@ -53,31 +72,19 @@ def get_private_funding_history( """ pass - @abstractmethod - def get_current_funding_rate(self, req: GetCurrentFundingRateReq, - **kwargs: Any) -> GetCurrentFundingRateResp: - """ - summary: Get Current Funding Rate - description: get Current Funding Rate - documentation: https://www.kucoin.com/docs-new/api-3470265 - +---------------------+---------+ - | Extra API Info | Value | - +---------------------+---------+ - | API-DOMAIN | FUTURES | - | API-CHANNEL | PRIVATE | - | API-PERMISSION | FUTURES | - | API-RATE-LIMIT-POOL | PUBLIC | - | API-RATE-LIMIT | 2 | - +---------------------+---------+ - """ - pass - class FundingFeesAPIImpl(FundingFeesAPI): def __init__(self, transport: Transport): self.transport = transport + def get_current_funding_rate(self, req: GetCurrentFundingRateReq, + **kwargs: Any) -> GetCurrentFundingRateResp: + return self.transport.call("futures", False, "GET", + "/api/v1/funding-rate/{symbol}/current", + req, GetCurrentFundingRateResp(), False, + **kwargs) + def get_public_funding_history( self, req: GetPublicFundingHistoryReq, **kwargs: Any) -> GetPublicFundingHistoryResp: @@ -93,10 +100,3 @@ def get_private_funding_history( "/api/v1/funding-history", req, GetPrivateFundingHistoryResp(), False, **kwargs) - - def get_current_funding_rate(self, req: GetCurrentFundingRateReq, - **kwargs: Any) -> GetCurrentFundingRateResp: - return self.transport.call("futures", False, "GET", - "/api/v1/funding-rate/{symbol}/current", - req, GetCurrentFundingRateResp(), False, - **kwargs) diff --git a/sdk/python/kucoin_universal_sdk/generate/futures/fundingfees/api_funding_fees.template b/sdk/python/kucoin_universal_sdk/generate/futures/fundingfees/api_funding_fees.template index c61b1c98..5baf1c68 100644 --- a/sdk/python/kucoin_universal_sdk/generate/futures/fundingfees/api_funding_fees.template +++ b/sdk/python/kucoin_universal_sdk/generate/futures/fundingfees/api_funding_fees.template @@ -1,6 +1,25 @@ # API FUNCTION TEMPLATE +def test_get_current_funding_rate_req(self): + """ + get_current_funding_rate + Get Current Funding Rate + /api/v1/funding-rate/{symbol}/current + """ + + builder = GetCurrentFundingRateReqBuilder() + builder.set_symbol(?) + req = builder.build() + try: + resp = self.api.get_current_funding_rate(req) + print("code: ", resp.common_response.code) + print("msg: ", resp.common_response.message) + print("data: ", resp.to_json()) + except Exception as e: + print("error: ", e) + raise e + def test_get_public_funding_history_req(self): """ get_public_funding_history @@ -38,22 +57,3 @@ def test_get_private_funding_history_req(self): except Exception as e: print("error: ", e) raise e - -def test_get_current_funding_rate_req(self): - """ - get_current_funding_rate - Get Current Funding Rate - /api/v1/funding-rate/{symbol}/current - """ - - builder = GetCurrentFundingRateReqBuilder() - builder.set_symbol(?) - req = builder.build() - try: - resp = self.api.get_current_funding_rate(req) - print("code: ", resp.common_response.code) - print("msg: ", resp.common_response.message) - print("data: ", resp.to_json()) - except Exception as e: - print("error: ", e) - raise e diff --git a/sdk/python/kucoin_universal_sdk/generate/futures/fundingfees/api_funding_fees_test.py b/sdk/python/kucoin_universal_sdk/generate/futures/fundingfees/api_funding_fees_test.py index 3c62ea2e..c7d20048 100644 --- a/sdk/python/kucoin_universal_sdk/generate/futures/fundingfees/api_funding_fees_test.py +++ b/sdk/python/kucoin_universal_sdk/generate/futures/fundingfees/api_funding_fees_test.py @@ -10,6 +10,25 @@ class FundingFeesAPITest(unittest.TestCase): + def test_get_current_funding_rate_req_model(self): + """ + get_current_funding_rate + Get Current Funding Rate + /api/v1/funding-rate/{symbol}/current + """ + data = "{\"symbol\": \"XBTUSDTM\"}" + req = GetCurrentFundingRateReq.from_json(data) + + def test_get_current_funding_rate_resp_model(self): + """ + get_current_funding_rate + Get Current Funding Rate + /api/v1/funding-rate/{symbol}/current + """ + data = "{\n \"code\": \"200000\",\n \"data\": {\n \"symbol\": \".XBTUSDTMFPI8H\",\n \"granularity\": 28800000,\n \"timePoint\": 1731441600000,\n \"value\": 6.41E-4,\n \"predictedValue\": 5.2E-5,\n \"fundingRateCap\": 0.003,\n \"fundingRateFloor\": -0.003\n }\n}" + common_response = RestResponse.from_json(data) + resp = GetCurrentFundingRateResp.from_dict(common_response.data) + def test_get_public_funding_history_req_model(self): """ get_public_funding_history @@ -47,22 +66,3 @@ def test_get_private_funding_history_resp_model(self): data = "{\n \"code\": \"200000\",\n \"data\": {\n \"dataList\": [\n {\n \"id\": 1472387374042586,\n \"symbol\": \"XBTUSDTM\",\n \"timePoint\": 1731470400000,\n \"fundingRate\": 6.41E-4,\n \"markPrice\": 87139.92,\n \"positionQty\": 1,\n \"positionCost\": 87.13992,\n \"funding\": -0.05585669,\n \"settleCurrency\": \"USDT\",\n \"context\": \"{\\\"marginMode\\\": \\\"ISOLATED\\\", \\\"positionSide\\\": \\\"BOTH\\\"}\",\n \"marginMode\": \"ISOLATED\"\n }\n ],\n \"hasMore\": true\n }\n}" common_response = RestResponse.from_json(data) resp = GetPrivateFundingHistoryResp.from_dict(common_response.data) - - def test_get_current_funding_rate_req_model(self): - """ - get_current_funding_rate - Get Current Funding Rate - /api/v1/funding-rate/{symbol}/current - """ - data = "{\"symbol\": \"XBTUSDTM\"}" - req = GetCurrentFundingRateReq.from_json(data) - - def test_get_current_funding_rate_resp_model(self): - """ - get_current_funding_rate - Get Current Funding Rate - /api/v1/funding-rate/{symbol}/current - """ - data = "{\n \"code\": \"200000\",\n \"data\": {\n \"symbol\": \".XBTUSDTMFPI8H\",\n \"granularity\": 28800000,\n \"timePoint\": 1731441600000,\n \"value\": 6.41E-4,\n \"predictedValue\": 5.2E-5,\n \"fundingRateCap\": 0.003,\n \"fundingRateFloor\": -0.003\n }\n}" - common_response = RestResponse.from_json(data) - resp = GetCurrentFundingRateResp.from_dict(common_response.data) diff --git a/sdk/python/kucoin_universal_sdk/generate/futures/market/api_market.py b/sdk/python/kucoin_universal_sdk/generate/futures/market/api_market.py index 0862a934..3b405aea 100644 --- a/sdk/python/kucoin_universal_sdk/generate/futures/market/api_market.py +++ b/sdk/python/kucoin_universal_sdk/generate/futures/market/api_market.py @@ -35,11 +35,11 @@ class MarketAPI(ABC): @abstractmethod - def get_all_tickers(self, **kwargs: Any) -> GetAllTickersResp: + def get_symbol(self, req: GetSymbolReq, **kwargs: Any) -> GetSymbolResp: """ - summary: Get All Tickers - description: This endpoint returns \"last traded price/size\"、\"best bid/ask price/size\" etc. of a single symbol. These messages can also be obtained through Websocket. - documentation: https://www.kucoin.com/docs-new/api-3470223 + summary: Get Symbol + description: Get information of specified contracts that can be traded. This API will return a list of tradable contracts, including some key parameters of the contract such as the symbol name, tick size, mark price,etc. + documentation: https://www.kucoin.com/docs-new/api-3470221 +---------------------+---------+ | Extra API Info | Value | +---------------------+---------+ @@ -47,35 +47,35 @@ def get_all_tickers(self, **kwargs: Any) -> GetAllTickersResp: | API-CHANNEL | PUBLIC | | API-PERMISSION | NULL | | API-RATE-LIMIT-POOL | PUBLIC | - | API-RATE-LIMIT | 5 | + | API-RATE-LIMIT | 3 | +---------------------+---------+ """ pass @abstractmethod - def get_private_token(self, **kwargs: Any) -> GetPrivateTokenResp: + def get_all_symbols(self, **kwargs: Any) -> GetAllSymbolsResp: """ - summary: Get Private Token - Futures - description: This interface can obtain the token required for websocket to establish a Futures private connection. If you need use private channels(e.g. account balance notice), please make request as follows to obtain the server list and private token - documentation: https://www.kucoin.com/docs-new/api-3470296 + summary: Get All Symbols + description: Get detailed information of all contracts that can be traded. This API will return a list of tradable contracts, including some key parameters of the contract such as the symbol name, tick size, mark price,etc. + documentation: https://www.kucoin.com/docs-new/api-3470220 +---------------------+---------+ | Extra API Info | Value | +---------------------+---------+ | API-DOMAIN | FUTURES | - | API-CHANNEL | PRIVATE | - | API-PERMISSION | GENERAL | - | API-RATE-LIMIT-POOL | FUTURES | - | API-RATE-LIMIT | 10 | + | API-CHANNEL | PUBLIC | + | API-PERMISSION | NULL | + | API-RATE-LIMIT-POOL | PUBLIC | + | API-RATE-LIMIT | 3 | +---------------------+---------+ """ pass @abstractmethod - def get_public_token(self, **kwargs: Any) -> GetPublicTokenResp: + def get_ticker(self, req: GetTickerReq, **kwargs: Any) -> GetTickerResp: """ - summary: Get Public Token - Futures - description: This interface can obtain the token required for websocket to establish a Futures connection. If you need use public channels (e.g. all public market data), please make request as follows to obtain the server list and public token - documentation: https://www.kucoin.com/docs-new/api-3470297 + summary: Get Ticker + description: This endpoint returns \"last traded price/size\"、\"best bid/ask price/size\" etc. of a single symbol. These messages can also be obtained through Websocket. + documentation: https://www.kucoin.com/docs-new/api-3470222 +---------------------+---------+ | Extra API Info | Value | +---------------------+---------+ @@ -83,17 +83,17 @@ def get_public_token(self, **kwargs: Any) -> GetPublicTokenResp: | API-CHANNEL | PUBLIC | | API-PERMISSION | NULL | | API-RATE-LIMIT-POOL | PUBLIC | - | API-RATE-LIMIT | 10 | + | API-RATE-LIMIT | 2 | +---------------------+---------+ """ pass @abstractmethod - def get_all_symbols(self, **kwargs: Any) -> GetAllSymbolsResp: + def get_all_tickers(self, **kwargs: Any) -> GetAllTickersResp: """ - summary: Get All Symbols - description: Get detailed information of all contracts that can be traded. This API will return a list of tradable contracts, including some key parameters of the contract such as the symbol name, tick size, mark price,etc. - documentation: https://www.kucoin.com/docs-new/api-3470220 + summary: Get All Tickers + description: This endpoint returns \"last traded price/size\"、\"best bid/ask price/size\" etc. of a single symbol. These messages can also be obtained through Websocket. + documentation: https://www.kucoin.com/docs-new/api-3470223 +---------------------+---------+ | Extra API Info | Value | +---------------------+---------+ @@ -101,17 +101,18 @@ def get_all_symbols(self, **kwargs: Any) -> GetAllSymbolsResp: | API-CHANNEL | PUBLIC | | API-PERMISSION | NULL | | API-RATE-LIMIT-POOL | PUBLIC | - | API-RATE-LIMIT | 3 | + | API-RATE-LIMIT | 5 | +---------------------+---------+ """ pass @abstractmethod - def get_symbol(self, req: GetSymbolReq, **kwargs: Any) -> GetSymbolResp: + def get_full_order_book(self, req: GetFullOrderBookReq, + **kwargs: Any) -> GetFullOrderBookResp: """ - summary: Get Symbol - description: Get information of specified contracts that can be traded. This API will return a list of tradable contracts, including some key parameters of the contract such as the symbol name, tick size, mark price,etc. - documentation: https://www.kucoin.com/docs-new/api-3470221 + summary: Get Full OrderBook + description: Query for Full orderbook depth data. (aggregated by price) It is generally used by professional traders because it uses more server resources and traffic, and we have strict access rate limit control. To maintain up-to-date Order Book, please use Websocket incremental feed after retrieving the OrderBook. + documentation: https://www.kucoin.com/docs-new/api-3470224 +---------------------+---------+ | Extra API Info | Value | +---------------------+---------+ @@ -125,12 +126,12 @@ def get_symbol(self, req: GetSymbolReq, **kwargs: Any) -> GetSymbolResp: pass @abstractmethod - def get_spot_index_price(self, req: GetSpotIndexPriceReq, - **kwargs: Any) -> GetSpotIndexPriceResp: + def get_part_order_book(self, req: GetPartOrderBookReq, + **kwargs: Any) -> GetPartOrderBookResp: """ - summary: Get Spot Index Price - description: Get Spot Index Price - documentation: https://www.kucoin.com/docs-new/api-3470231 + summary: Get Part OrderBook + description: Query for part orderbook depth data. (aggregated by price) You are recommended to request via this endpoint as the system reponse would be faster and cosume less traffic. + documentation: https://www.kucoin.com/docs-new/api-3470225 +---------------------+---------+ | Extra API Info | Value | +---------------------+---------+ @@ -138,18 +139,18 @@ def get_spot_index_price(self, req: GetSpotIndexPriceReq, | API-CHANNEL | PUBLIC | | API-PERMISSION | NULL | | API-RATE-LIMIT-POOL | PUBLIC | - | API-RATE-LIMIT | 2 | + | API-RATE-LIMIT | 5 | +---------------------+---------+ """ pass @abstractmethod - def get_interest_rate_index(self, req: GetInterestRateIndexReq, - **kwargs: Any) -> GetInterestRateIndexResp: + def get_trade_history(self, req: GetTradeHistoryReq, + **kwargs: Any) -> GetTradeHistoryResp: """ - summary: Get Interest Rate Index - description: Get interest rate Index. - documentation: https://www.kucoin.com/docs-new/api-3470226 + summary: Get Trade History + description: Request via this endpoint to get the trade history of the specified symbol, the returned quantity is the last 100 transaction records. + documentation: https://www.kucoin.com/docs-new/api-3470232 +---------------------+---------+ | Extra API Info | Value | +---------------------+---------+ @@ -181,12 +182,12 @@ def get_klines(self, req: GetKlinesReq, **kwargs: Any) -> GetKlinesResp: pass @abstractmethod - def get_part_order_book(self, req: GetPartOrderBookReq, - **kwargs: Any) -> GetPartOrderBookResp: + def get_mark_price(self, req: GetMarkPriceReq, + **kwargs: Any) -> GetMarkPriceResp: """ - summary: Get Part OrderBook - description: Query for part orderbook depth data. (aggregated by price) You are recommended to request via this endpoint as the system reponse would be faster and cosume less traffic. - documentation: https://www.kucoin.com/docs-new/api-3470225 + summary: Get Mark Price + description: Get current mark price + documentation: https://www.kucoin.com/docs-new/api-3470233 +---------------------+---------+ | Extra API Info | Value | +---------------------+---------+ @@ -194,18 +195,18 @@ def get_part_order_book(self, req: GetPartOrderBookReq, | API-CHANNEL | PUBLIC | | API-PERMISSION | NULL | | API-RATE-LIMIT-POOL | PUBLIC | - | API-RATE-LIMIT | 5 | + | API-RATE-LIMIT | 3 | +---------------------+---------+ """ pass @abstractmethod - def get_full_order_book(self, req: GetFullOrderBookReq, - **kwargs: Any) -> GetFullOrderBookResp: + def get_spot_index_price(self, req: GetSpotIndexPriceReq, + **kwargs: Any) -> GetSpotIndexPriceResp: """ - summary: Get Full OrderBook - description: Query for Full orderbook depth data. (aggregated by price) It is generally used by professional traders because it uses more server resources and traffic, and we have strict access rate limit control. To maintain up-to-date Order Book, please use Websocket incremental feed after retrieving the OrderBook. - documentation: https://www.kucoin.com/docs-new/api-3470224 + summary: Get Spot Index Price + description: Get Spot Index Price + documentation: https://www.kucoin.com/docs-new/api-3470231 +---------------------+---------+ | Extra API Info | Value | +---------------------+---------+ @@ -213,18 +214,18 @@ def get_full_order_book(self, req: GetFullOrderBookReq, | API-CHANNEL | PUBLIC | | API-PERMISSION | NULL | | API-RATE-LIMIT-POOL | PUBLIC | - | API-RATE-LIMIT | 3 | + | API-RATE-LIMIT | 2 | +---------------------+---------+ """ pass @abstractmethod - def get_mark_price(self, req: GetMarkPriceReq, - **kwargs: Any) -> GetMarkPriceResp: + def get_interest_rate_index(self, req: GetInterestRateIndexReq, + **kwargs: Any) -> GetInterestRateIndexResp: """ - summary: Get Mark Price - description: Get current mark price - documentation: https://www.kucoin.com/docs-new/api-3470233 + summary: Get Interest Rate Index + description: Get interest rate Index. + documentation: https://www.kucoin.com/docs-new/api-3470226 +---------------------+---------+ | Extra API Info | Value | +---------------------+---------+ @@ -232,7 +233,7 @@ def get_mark_price(self, req: GetMarkPriceReq, | API-CHANNEL | PUBLIC | | API-PERMISSION | NULL | | API-RATE-LIMIT-POOL | PUBLIC | - | API-RATE-LIMIT | 3 | + | API-RATE-LIMIT | 5 | +---------------------+---------+ """ pass @@ -257,29 +258,29 @@ def get_premium_index(self, req: GetPremiumIndexReq, pass @abstractmethod - def get_service_status(self, **kwargs: Any) -> GetServiceStatusResp: + def get24hr_stats(self, **kwargs: Any) -> Get24hrStatsResp: """ - summary: Get Service Status - description: Get the service status. - documentation: https://www.kucoin.com/docs-new/api-3470230 + summary: Get 24hr Stats + description: Get the statistics of the platform futures trading volume in the last 24 hours. + documentation: https://www.kucoin.com/docs-new/api-3470228 +---------------------+---------+ | Extra API Info | Value | +---------------------+---------+ | API-DOMAIN | FUTURES | | API-CHANNEL | PUBLIC | | API-PERMISSION | NULL | - | API-RATE-LIMIT-POOL | PUBLIC | - | API-RATE-LIMIT | 4 | + | API-RATE-LIMIT-POOL | FUTURES | + | API-RATE-LIMIT | 3 | +---------------------+---------+ """ pass @abstractmethod - def get_ticker(self, req: GetTickerReq, **kwargs: Any) -> GetTickerResp: + def get_server_time(self, **kwargs: Any) -> GetServerTimeResp: """ - summary: Get Ticker - description: This endpoint returns \"last traded price/size\"、\"best bid/ask price/size\" etc. of a single symbol. These messages can also be obtained through Websocket. - documentation: https://www.kucoin.com/docs-new/api-3470222 + summary: Get Server Time + description: Get the API server time. This is the Unix timestamp. + documentation: https://www.kucoin.com/docs-new/api-3470229 +---------------------+---------+ | Extra API Info | Value | +---------------------+---------+ @@ -293,11 +294,11 @@ def get_ticker(self, req: GetTickerReq, **kwargs: Any) -> GetTickerResp: pass @abstractmethod - def get_server_time(self, **kwargs: Any) -> GetServerTimeResp: + def get_service_status(self, **kwargs: Any) -> GetServiceStatusResp: """ - summary: Get Server Time - description: Get the API server time. This is the Unix timestamp. - documentation: https://www.kucoin.com/docs-new/api-3470229 + summary: Get Service Status + description: Get the service status. + documentation: https://www.kucoin.com/docs-new/api-3470230 +---------------------+---------+ | Extra API Info | Value | +---------------------+---------+ @@ -305,18 +306,17 @@ def get_server_time(self, **kwargs: Any) -> GetServerTimeResp: | API-CHANNEL | PUBLIC | | API-PERMISSION | NULL | | API-RATE-LIMIT-POOL | PUBLIC | - | API-RATE-LIMIT | 2 | + | API-RATE-LIMIT | 4 | +---------------------+---------+ """ pass @abstractmethod - def get_trade_history(self, req: GetTradeHistoryReq, - **kwargs: Any) -> GetTradeHistoryResp: + def get_public_token(self, **kwargs: Any) -> GetPublicTokenResp: """ - summary: Get Trade History - description: Request via this endpoint to get the trade history of the specified symbol, the returned quantity is the last 100 transaction records. - documentation: https://www.kucoin.com/docs-new/api-3470232 + summary: Get Public Token - Futures + description: This interface can obtain the token required for websocket to establish a Futures connection. If you need use public channels (e.g. all public market data), please make request as follows to obtain the server list and public token + documentation: https://www.kucoin.com/docs-new/api-3470297 +---------------------+---------+ | Extra API Info | Value | +---------------------+---------+ @@ -324,25 +324,25 @@ def get_trade_history(self, req: GetTradeHistoryReq, | API-CHANNEL | PUBLIC | | API-PERMISSION | NULL | | API-RATE-LIMIT-POOL | PUBLIC | - | API-RATE-LIMIT | 5 | + | API-RATE-LIMIT | 10 | +---------------------+---------+ """ pass @abstractmethod - def get24hr_stats(self, **kwargs: Any) -> Get24hrStatsResp: + def get_private_token(self, **kwargs: Any) -> GetPrivateTokenResp: """ - summary: Get 24hr Stats - description: Get the statistics of the platform futures trading volume in the last 24 hours. - documentation: https://www.kucoin.com/docs-new/api-3470228 + summary: Get Private Token - Futures + description: This interface can obtain the token required for websocket to establish a Futures private connection. If you need use private channels(e.g. account balance notice), please make request as follows to obtain the server list and private token + documentation: https://www.kucoin.com/docs-new/api-3470296 +---------------------+---------+ | Extra API Info | Value | +---------------------+---------+ | API-DOMAIN | FUTURES | - | API-CHANNEL | PUBLIC | - | API-PERMISSION | NULL | + | API-CHANNEL | PRIVATE | + | API-PERMISSION | GENERAL | | API-RATE-LIMIT-POOL | FUTURES | - | API-RATE-LIMIT | 3 | + | API-RATE-LIMIT | 10 | +---------------------+---------+ """ pass @@ -353,47 +353,30 @@ class MarketAPIImpl(MarketAPI): def __init__(self, transport: Transport): self.transport = transport - def get_all_tickers(self, **kwargs: Any) -> GetAllTickersResp: + def get_symbol(self, req: GetSymbolReq, **kwargs: Any) -> GetSymbolResp: return self.transport.call("futures", False, "GET", - "/api/v1/allTickers", None, - GetAllTickersResp(), False, **kwargs) - - def get_private_token(self, **kwargs: Any) -> GetPrivateTokenResp: - return self.transport.call("futures", False, "POST", - "/api/v1/bullet-private", None, - GetPrivateTokenResp(), False, **kwargs) - - def get_public_token(self, **kwargs: Any) -> GetPublicTokenResp: - return self.transport.call("futures", False, "POST", - "/api/v1/bullet-public", None, - GetPublicTokenResp(), False, **kwargs) + "/api/v1/contracts/{symbol}", req, + GetSymbolResp(), False, **kwargs) def get_all_symbols(self, **kwargs: Any) -> GetAllSymbolsResp: return self.transport.call("futures", False, "GET", "/api/v1/contracts/active", None, GetAllSymbolsResp(), False, **kwargs) - def get_symbol(self, req: GetSymbolReq, **kwargs: Any) -> GetSymbolResp: - return self.transport.call("futures", False, "GET", - "/api/v1/contracts/{symbol}", req, - GetSymbolResp(), False, **kwargs) + def get_ticker(self, req: GetTickerReq, **kwargs: Any) -> GetTickerResp: + return self.transport.call("futures", False, "GET", "/api/v1/ticker", + req, GetTickerResp(), False, **kwargs) - def get_spot_index_price(self, req: GetSpotIndexPriceReq, - **kwargs: Any) -> GetSpotIndexPriceResp: + def get_all_tickers(self, **kwargs: Any) -> GetAllTickersResp: return self.transport.call("futures", False, "GET", - "/api/v1/index/query", req, - GetSpotIndexPriceResp(), False, **kwargs) + "/api/v1/allTickers", None, + GetAllTickersResp(), False, **kwargs) - def get_interest_rate_index(self, req: GetInterestRateIndexReq, - **kwargs: Any) -> GetInterestRateIndexResp: + def get_full_order_book(self, req: GetFullOrderBookReq, + **kwargs: Any) -> GetFullOrderBookResp: return self.transport.call("futures", False, "GET", - "/api/v1/interest/query", req, - GetInterestRateIndexResp(), False, **kwargs) - - def get_klines(self, req: GetKlinesReq, **kwargs: Any) -> GetKlinesResp: - return self.transport.call("futures", False, - "GET", "/api/v1/kline/query", req, - GetKlinesResp(), False, **kwargs) + "/api/v1/level2/snapshot", req, + GetFullOrderBookResp(), False, **kwargs) def get_part_order_book(self, req: GetPartOrderBookReq, **kwargs: Any) -> GetPartOrderBookResp: @@ -401,11 +384,16 @@ def get_part_order_book(self, req: GetPartOrderBookReq, "/api/v1/level2/depth{size}", req, GetPartOrderBookResp(), False, **kwargs) - def get_full_order_book(self, req: GetFullOrderBookReq, - **kwargs: Any) -> GetFullOrderBookResp: + def get_trade_history(self, req: GetTradeHistoryReq, + **kwargs: Any) -> GetTradeHistoryResp: return self.transport.call("futures", False, "GET", - "/api/v1/level2/snapshot", req, - GetFullOrderBookResp(), False, **kwargs) + "/api/v1/trade/history", req, + GetTradeHistoryResp(), False, **kwargs) + + def get_klines(self, req: GetKlinesReq, **kwargs: Any) -> GetKlinesResp: + return self.transport.call("futures", False, + "GET", "/api/v1/kline/query", req, + GetKlinesResp(), False, **kwargs) def get_mark_price(self, req: GetMarkPriceReq, **kwargs: Any) -> GetMarkPriceResp: @@ -413,33 +401,45 @@ def get_mark_price(self, req: GetMarkPriceReq, "/api/v1/mark-price/{symbol}/current", req, GetMarkPriceResp(), False, **kwargs) + def get_spot_index_price(self, req: GetSpotIndexPriceReq, + **kwargs: Any) -> GetSpotIndexPriceResp: + return self.transport.call("futures", False, "GET", + "/api/v1/index/query", req, + GetSpotIndexPriceResp(), False, **kwargs) + + def get_interest_rate_index(self, req: GetInterestRateIndexReq, + **kwargs: Any) -> GetInterestRateIndexResp: + return self.transport.call("futures", False, "GET", + "/api/v1/interest/query", req, + GetInterestRateIndexResp(), False, **kwargs) + def get_premium_index(self, req: GetPremiumIndexReq, **kwargs: Any) -> GetPremiumIndexResp: return self.transport.call("futures", False, "GET", "/api/v1/premium/query", req, GetPremiumIndexResp(), False, **kwargs) - def get_service_status(self, **kwargs: Any) -> GetServiceStatusResp: + def get24hr_stats(self, **kwargs: Any) -> Get24hrStatsResp: return self.transport.call("futures", False, "GET", - "/api/v1/status", None, - GetServiceStatusResp(), False, **kwargs) - - def get_ticker(self, req: GetTickerReq, **kwargs: Any) -> GetTickerResp: - return self.transport.call("futures", False, "GET", "/api/v1/ticker", - req, GetTickerResp(), False, **kwargs) + "/api/v1/trade-statistics", None, + Get24hrStatsResp(), False, **kwargs) def get_server_time(self, **kwargs: Any) -> GetServerTimeResp: return self.transport.call("futures", False, "GET", "/api/v1/timestamp", None, GetServerTimeResp(), False, **kwargs) - def get_trade_history(self, req: GetTradeHistoryReq, - **kwargs: Any) -> GetTradeHistoryResp: + def get_service_status(self, **kwargs: Any) -> GetServiceStatusResp: return self.transport.call("futures", False, "GET", - "/api/v1/trade/history", req, - GetTradeHistoryResp(), False, **kwargs) + "/api/v1/status", None, + GetServiceStatusResp(), False, **kwargs) - def get24hr_stats(self, **kwargs: Any) -> Get24hrStatsResp: - return self.transport.call("futures", False, "GET", - "/api/v1/trade-statistics", None, - Get24hrStatsResp(), False, **kwargs) + def get_public_token(self, **kwargs: Any) -> GetPublicTokenResp: + return self.transport.call("futures", False, "POST", + "/api/v1/bullet-public", None, + GetPublicTokenResp(), False, **kwargs) + + def get_private_token(self, **kwargs: Any) -> GetPrivateTokenResp: + return self.transport.call("futures", False, "POST", + "/api/v1/bullet-private", None, + GetPrivateTokenResp(), False, **kwargs) diff --git a/sdk/python/kucoin_universal_sdk/generate/futures/market/api_market.template b/sdk/python/kucoin_universal_sdk/generate/futures/market/api_market.template index 836a6fd4..e50a2eab 100644 --- a/sdk/python/kucoin_universal_sdk/generate/futures/market/api_market.template +++ b/sdk/python/kucoin_universal_sdk/generate/futures/market/api_market.template @@ -1,15 +1,18 @@ # API FUNCTION TEMPLATE -def test_get_all_tickers_req(self): +def test_get_symbol_req(self): """ - get_all_tickers - Get All Tickers - /api/v1/allTickers + get_symbol + Get Symbol + /api/v1/contracts/{symbol} """ + builder = GetSymbolReqBuilder() + builder.set_symbol(?) + req = builder.build() try: - resp = self.api.get_all_tickers() + resp = self.api.get_symbol(req) print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) @@ -17,15 +20,15 @@ def test_get_all_tickers_req(self): print("error: ", e) raise e -def test_get_private_token_req(self): +def test_get_all_symbols_req(self): """ - get_private_token - Get Private Token - Futures - /api/v1/bullet-private + get_all_symbols + Get All Symbols + /api/v1/contracts/active """ try: - resp = self.api.get_private_token() + resp = self.api.get_all_symbols() print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) @@ -33,15 +36,18 @@ def test_get_private_token_req(self): print("error: ", e) raise e -def test_get_public_token_req(self): +def test_get_ticker_req(self): """ - get_public_token - Get Public Token - Futures - /api/v1/bullet-public + get_ticker + Get Ticker + /api/v1/ticker """ + builder = GetTickerReqBuilder() + builder.set_symbol(?) + req = builder.build() try: - resp = self.api.get_public_token() + resp = self.api.get_ticker(req) print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) @@ -49,15 +55,15 @@ def test_get_public_token_req(self): print("error: ", e) raise e -def test_get_all_symbols_req(self): +def test_get_all_tickers_req(self): """ - get_all_symbols - Get All Symbols - /api/v1/contracts/active + get_all_tickers + Get All Tickers + /api/v1/allTickers """ try: - resp = self.api.get_all_symbols() + resp = self.api.get_all_tickers() print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) @@ -65,18 +71,18 @@ def test_get_all_symbols_req(self): print("error: ", e) raise e -def test_get_symbol_req(self): +def test_get_full_order_book_req(self): """ - get_symbol - Get Symbol - /api/v1/contracts/{symbol} + get_full_order_book + Get Full OrderBook + /api/v1/level2/snapshot """ - builder = GetSymbolReqBuilder() + builder = GetFullOrderBookReqBuilder() builder.set_symbol(?) req = builder.build() try: - resp = self.api.get_symbol(req) + resp = self.api.get_full_order_book(req) print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) @@ -84,18 +90,18 @@ def test_get_symbol_req(self): print("error: ", e) raise e -def test_get_spot_index_price_req(self): +def test_get_part_order_book_req(self): """ - get_spot_index_price - Get Spot Index Price - /api/v1/index/query + get_part_order_book + Get Part OrderBook + /api/v1/level2/depth{size} """ - builder = GetSpotIndexPriceReqBuilder() - builder.set_symbol(?).set_start_at(?).set_end_at(?).set_reverse(?).set_offset(?).set_forward(?).set_max_count(?) + builder = GetPartOrderBookReqBuilder() + builder.set_symbol(?).set_size(?) req = builder.build() try: - resp = self.api.get_spot_index_price(req) + resp = self.api.get_part_order_book(req) print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) @@ -103,18 +109,18 @@ def test_get_spot_index_price_req(self): print("error: ", e) raise e -def test_get_interest_rate_index_req(self): +def test_get_trade_history_req(self): """ - get_interest_rate_index - Get Interest Rate Index - /api/v1/interest/query + get_trade_history + Get Trade History + /api/v1/trade/history """ - builder = GetInterestRateIndexReqBuilder() - builder.set_symbol(?).set_start_at(?).set_end_at(?).set_reverse(?).set_offset(?).set_forward(?).set_max_count(?) + builder = GetTradeHistoryReqBuilder() + builder.set_symbol(?) req = builder.build() try: - resp = self.api.get_interest_rate_index(req) + resp = self.api.get_trade_history(req) print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) @@ -141,18 +147,18 @@ def test_get_klines_req(self): print("error: ", e) raise e -def test_get_part_order_book_req(self): +def test_get_mark_price_req(self): """ - get_part_order_book - Get Part OrderBook - /api/v1/level2/depth{size} + get_mark_price + Get Mark Price + /api/v1/mark-price/{symbol}/current """ - builder = GetPartOrderBookReqBuilder() - builder.set_symbol(?).set_size(?) + builder = GetMarkPriceReqBuilder() + builder.set_symbol(?) req = builder.build() try: - resp = self.api.get_part_order_book(req) + resp = self.api.get_mark_price(req) print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) @@ -160,18 +166,18 @@ def test_get_part_order_book_req(self): print("error: ", e) raise e -def test_get_full_order_book_req(self): +def test_get_spot_index_price_req(self): """ - get_full_order_book - Get Full OrderBook - /api/v1/level2/snapshot + get_spot_index_price + Get Spot Index Price + /api/v1/index/query """ - builder = GetFullOrderBookReqBuilder() - builder.set_symbol(?) + builder = GetSpotIndexPriceReqBuilder() + builder.set_symbol(?).set_start_at(?).set_end_at(?).set_reverse(?).set_offset(?).set_forward(?).set_max_count(?) req = builder.build() try: - resp = self.api.get_full_order_book(req) + resp = self.api.get_spot_index_price(req) print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) @@ -179,18 +185,18 @@ def test_get_full_order_book_req(self): print("error: ", e) raise e -def test_get_mark_price_req(self): +def test_get_interest_rate_index_req(self): """ - get_mark_price - Get Mark Price - /api/v1/mark-price/{symbol}/current + get_interest_rate_index + Get Interest Rate Index + /api/v1/interest/query """ - builder = GetMarkPriceReqBuilder() - builder.set_symbol(?) + builder = GetInterestRateIndexReqBuilder() + builder.set_symbol(?).set_start_at(?).set_end_at(?).set_reverse(?).set_offset(?).set_forward(?).set_max_count(?) req = builder.build() try: - resp = self.api.get_mark_price(req) + resp = self.api.get_interest_rate_index(req) print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) @@ -217,15 +223,15 @@ def test_get_premium_index_req(self): print("error: ", e) raise e -def test_get_service_status_req(self): +def test_get24hr_stats_req(self): """ - get_service_status - Get Service Status - /api/v1/status + get24hr_stats + Get 24hr Stats + /api/v1/trade-statistics """ try: - resp = self.api.get_service_status() + resp = self.api.get24hr_stats() print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) @@ -233,18 +239,15 @@ def test_get_service_status_req(self): print("error: ", e) raise e -def test_get_ticker_req(self): +def test_get_server_time_req(self): """ - get_ticker - Get Ticker - /api/v1/ticker + get_server_time + Get Server Time + /api/v1/timestamp """ - builder = GetTickerReqBuilder() - builder.set_symbol(?) - req = builder.build() try: - resp = self.api.get_ticker(req) + resp = self.api.get_server_time() print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) @@ -252,15 +255,15 @@ def test_get_ticker_req(self): print("error: ", e) raise e -def test_get_server_time_req(self): +def test_get_service_status_req(self): """ - get_server_time - Get Server Time - /api/v1/timestamp + get_service_status + Get Service Status + /api/v1/status """ try: - resp = self.api.get_server_time() + resp = self.api.get_service_status() print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) @@ -268,18 +271,15 @@ def test_get_server_time_req(self): print("error: ", e) raise e -def test_get_trade_history_req(self): +def test_get_public_token_req(self): """ - get_trade_history - Get Trade History - /api/v1/trade/history + get_public_token + Get Public Token - Futures + /api/v1/bullet-public """ - builder = GetTradeHistoryReqBuilder() - builder.set_symbol(?) - req = builder.build() try: - resp = self.api.get_trade_history(req) + resp = self.api.get_public_token() print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) @@ -287,15 +287,15 @@ def test_get_trade_history_req(self): print("error: ", e) raise e -def test_get24hr_stats_req(self): +def test_get_private_token_req(self): """ - get24hr_stats - Get 24hr Stats - /api/v1/trade-statistics + get_private_token + Get Private Token - Futures + /api/v1/bullet-private """ try: - resp = self.api.get24hr_stats() + resp = self.api.get_private_token() print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) diff --git a/sdk/python/kucoin_universal_sdk/generate/futures/market/api_market_test.py b/sdk/python/kucoin_universal_sdk/generate/futures/market/api_market_test.py index db034d47..1143c69d 100644 --- a/sdk/python/kucoin_universal_sdk/generate/futures/market/api_market_test.py +++ b/sdk/python/kucoin_universal_sdk/generate/futures/market/api_market_test.py @@ -31,56 +31,24 @@ class MarketAPITest(unittest.TestCase): - def test_get_all_tickers_req_model(self): - """ - get_all_tickers - Get All Tickers - /api/v1/allTickers - """ - - def test_get_all_tickers_resp_model(self): - """ - get_all_tickers - Get All Tickers - /api/v1/allTickers - """ - data = "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"sequence\": 1707992727046,\n \"symbol\": \"XBTUSDTM\",\n \"side\": \"sell\",\n \"size\": 21,\n \"tradeId\": \"1784299761369\",\n \"price\": \"67153\",\n \"bestBidPrice\": \"67153\",\n \"bestBidSize\": 2767,\n \"bestAskPrice\": \"67153.1\",\n \"bestAskSize\": 5368,\n \"ts\": 1729163466659000000\n },\n {\n \"sequence\": 1697895166299,\n \"symbol\": \"XBTUSDM\",\n \"side\": \"sell\",\n \"size\": 1956,\n \"tradeId\": \"1697901245065\",\n \"price\": \"67145.2\",\n \"bestBidPrice\": \"67135.3\",\n \"bestBidSize\": 1,\n \"bestAskPrice\": \"67135.8\",\n \"bestAskSize\": 3,\n \"ts\": 1729163445340000000\n }\n ]\n}" - common_response = RestResponse.from_json(data) - resp = GetAllTickersResp.from_dict(common_response.data) - - def test_get_private_token_req_model(self): - """ - get_private_token - Get Private Token - Futures - /api/v1/bullet-private - """ - - def test_get_private_token_resp_model(self): - """ - get_private_token - Get Private Token - Futures - /api/v1/bullet-private - """ - data = "{\n \"code\": \"200000\",\n \"data\": {\n \"token\": \"2neAiuYvAU737TOajb2U3uT8AEZqSWYe0fBD4LoHuXJDSC7gIzJiH4kNTWhCPISWo6nDpAe7aUaaHJ4fG8oRjFgMfUI2sM4IySWHrBceFocY8pKy2REU1HwZIngtMdMrjqPnP-biofFWbNaP1cl0X1pZc2SQ-33hDH1LgNP-yg8bktVoIG0dIxSN4m3uzO8u.ueCCihQ5_4GPpXKxWTDiFQ==\",\n \"instanceServers\": [\n {\n \"endpoint\": \"wss://ws-api-futures.kucoin.com/\",\n \"encrypt\": true,\n \"protocol\": \"websocket\",\n \"pingInterval\": 18000,\n \"pingTimeout\": 10000\n }\n ]\n }\n}" - common_response = RestResponse.from_json(data) - resp = GetPrivateTokenResp.from_dict(common_response.data) - - def test_get_public_token_req_model(self): + def test_get_symbol_req_model(self): """ - get_public_token - Get Public Token - Futures - /api/v1/bullet-public + get_symbol + Get Symbol + /api/v1/contracts/{symbol} """ + data = "{\"symbol\": \"XBTUSDTM\"}" + req = GetSymbolReq.from_json(data) - def test_get_public_token_resp_model(self): + def test_get_symbol_resp_model(self): """ - get_public_token - Get Public Token - Futures - /api/v1/bullet-public + get_symbol + Get Symbol + /api/v1/contracts/{symbol} """ - data = "{\"code\":\"200000\",\"data\":{\"token\":\"2neAiuYvAU61ZDXANAGAsiL4-iAExhsBXZxftpOeh_55i3Ysy2q2LEsEWU64mdzUOPusi34M_wGoSf7iNyEWJ6dACm4ny9vJtLTRq_YsRUlG5ADnAawegdiYB9J6i9GjsxUuhPw3Blq6rhZlGykT3Vp1phUafnulOOpts-MEmEF-3bpfetLOAjsMMBS5qwTWJBvJHl5Vs9Y=.gJEIAywPXFr_4L-WG10eug==\",\"instanceServers\":[{\"endpoint\":\"wss://ws-api-futures.kucoin.com/\",\"encrypt\":true,\"protocol\":\"websocket\",\"pingInterval\":18000,\"pingTimeout\":10000}]}}" + data = "{\n \"code\": \"200000\",\n \"data\": {\n \"symbol\": \"XBTUSDM\",\n \"rootSymbol\": \"XBT\",\n \"type\": \"FFWCSX\",\n \"firstOpenDate\": 1552638575000,\n \"expireDate\": null,\n \"settleDate\": null,\n \"baseCurrency\": \"XBT\",\n \"quoteCurrency\": \"USD\",\n \"settleCurrency\": \"XBT\",\n \"maxOrderQty\": 10000000,\n \"maxPrice\": 1000000.0,\n \"lotSize\": 1,\n \"tickSize\": 0.1,\n \"indexPriceTickSize\": 0.1,\n \"multiplier\": -1.0,\n \"initialMargin\": 0.014,\n \"maintainMargin\": 0.007,\n \"maxRiskLimit\": 1,\n \"minRiskLimit\": 1,\n \"riskStep\": 0,\n \"makerFeeRate\": 2.0E-4,\n \"takerFeeRate\": 6.0E-4,\n \"takerFixFee\": 0.0,\n \"makerFixFee\": 0.0,\n \"settlementFee\": null,\n \"isDeleverage\": true,\n \"isQuanto\": false,\n \"isInverse\": true,\n \"markMethod\": \"FairPrice\",\n \"fairMethod\": \"FundingRate\",\n \"fundingBaseSymbol\": \".XBTINT8H\",\n \"fundingQuoteSymbol\": \".USDINT8H\",\n \"fundingRateSymbol\": \".XBTUSDMFPI8H\",\n \"indexSymbol\": \".BXBT\",\n \"settlementSymbol\": null,\n \"status\": \"Open\",\n \"fundingFeeRate\": 1.75E-4,\n \"predictedFundingFeeRate\": 1.76E-4,\n \"fundingRateGranularity\": 28800000,\n \"openInterest\": \"61725904\",\n \"turnoverOf24h\": 209.56303473,\n \"volumeOf24h\": 1.4354731E7,\n \"markPrice\": 68336.7,\n \"indexPrice\": 68335.29,\n \"lastTradePrice\": 68349.3,\n \"nextFundingRateTime\": 17402942,\n \"maxLeverage\": 75,\n \"sourceExchanges\": [\n \"kraken\",\n \"bitstamp\",\n \"crypto\"\n ],\n \"premiumsSymbol1M\": \".XBTUSDMPI\",\n \"premiumsSymbol8H\": \".XBTUSDMPI8H\",\n \"fundingBaseSymbol1M\": \".XBTINT\",\n \"fundingQuoteSymbol1M\": \".USDINT\",\n \"lowPrice\": 67436.7,\n \"highPrice\": 69471.8,\n \"priceChgPct\": 0.0097,\n \"priceChg\": 658.7,\n \"k\": 2645000.0,\n \"m\": 1640000.0,\n \"f\": 1.3,\n \"mmrLimit\": 0.3,\n \"mmrLevConstant\": 75.0,\n \"supportCross\": true\n }\n}" common_response = RestResponse.from_json(data) - resp = GetPublicTokenResp.from_dict(common_response.data) + resp = GetSymbolResp.from_dict(common_response.data) def test_get_all_symbols_req_model(self): """ @@ -99,81 +67,60 @@ def test_get_all_symbols_resp_model(self): common_response = RestResponse.from_json(data) resp = GetAllSymbolsResp.from_dict(common_response.data) - def test_get_symbol_req_model(self): + def test_get_ticker_req_model(self): """ - get_symbol - Get Symbol - /api/v1/contracts/{symbol} + get_ticker + Get Ticker + /api/v1/ticker """ data = "{\"symbol\": \"XBTUSDTM\"}" - req = GetSymbolReq.from_json(data) - - def test_get_symbol_resp_model(self): - """ - get_symbol - Get Symbol - /api/v1/contracts/{symbol} - """ - data = "{\n \"code\": \"200000\",\n \"data\": {\n \"symbol\": \"XBTUSDM\",\n \"rootSymbol\": \"XBT\",\n \"type\": \"FFWCSX\",\n \"firstOpenDate\": 1552638575000,\n \"expireDate\": null,\n \"settleDate\": null,\n \"baseCurrency\": \"XBT\",\n \"quoteCurrency\": \"USD\",\n \"settleCurrency\": \"XBT\",\n \"maxOrderQty\": 10000000,\n \"maxPrice\": 1000000.0,\n \"lotSize\": 1,\n \"tickSize\": 0.1,\n \"indexPriceTickSize\": 0.1,\n \"multiplier\": -1.0,\n \"initialMargin\": 0.014,\n \"maintainMargin\": 0.007,\n \"maxRiskLimit\": 1,\n \"minRiskLimit\": 1,\n \"riskStep\": 0,\n \"makerFeeRate\": 2.0E-4,\n \"takerFeeRate\": 6.0E-4,\n \"takerFixFee\": 0.0,\n \"makerFixFee\": 0.0,\n \"settlementFee\": null,\n \"isDeleverage\": true,\n \"isQuanto\": false,\n \"isInverse\": true,\n \"markMethod\": \"FairPrice\",\n \"fairMethod\": \"FundingRate\",\n \"fundingBaseSymbol\": \".XBTINT8H\",\n \"fundingQuoteSymbol\": \".USDINT8H\",\n \"fundingRateSymbol\": \".XBTUSDMFPI8H\",\n \"indexSymbol\": \".BXBT\",\n \"settlementSymbol\": null,\n \"status\": \"Open\",\n \"fundingFeeRate\": 1.75E-4,\n \"predictedFundingFeeRate\": 1.76E-4,\n \"fundingRateGranularity\": 28800000,\n \"openInterest\": \"61725904\",\n \"turnoverOf24h\": 209.56303473,\n \"volumeOf24h\": 1.4354731E7,\n \"markPrice\": 68336.7,\n \"indexPrice\": 68335.29,\n \"lastTradePrice\": 68349.3,\n \"nextFundingRateTime\": 17402942,\n \"maxLeverage\": 75,\n \"sourceExchanges\": [\n \"kraken\",\n \"bitstamp\",\n \"crypto\"\n ],\n \"premiumsSymbol1M\": \".XBTUSDMPI\",\n \"premiumsSymbol8H\": \".XBTUSDMPI8H\",\n \"fundingBaseSymbol1M\": \".XBTINT\",\n \"fundingQuoteSymbol1M\": \".USDINT\",\n \"lowPrice\": 67436.7,\n \"highPrice\": 69471.8,\n \"priceChgPct\": 0.0097,\n \"priceChg\": 658.7,\n \"k\": 2645000.0,\n \"m\": 1640000.0,\n \"f\": 1.3,\n \"mmrLimit\": 0.3,\n \"mmrLevConstant\": 75.0,\n \"supportCross\": true\n }\n}" - common_response = RestResponse.from_json(data) - resp = GetSymbolResp.from_dict(common_response.data) - - def test_get_spot_index_price_req_model(self): - """ - get_spot_index_price - Get Spot Index Price - /api/v1/index/query - """ - data = "{\"symbol\": \".KXBTUSDT\", \"startAt\": 123456, \"endAt\": 123456, \"reverse\": true, \"offset\": 123456, \"forward\": true, \"maxCount\": 10}" - req = GetSpotIndexPriceReq.from_json(data) + req = GetTickerReq.from_json(data) - def test_get_spot_index_price_resp_model(self): + def test_get_ticker_resp_model(self): """ - get_spot_index_price - Get Spot Index Price - /api/v1/index/query + get_ticker + Get Ticker + /api/v1/ticker """ - data = "{\n \"code\": \"200000\",\n \"data\": {\n \"hasMore\": true,\n \"dataList\": [\n {\n \"symbol\": \".KXBTUSDT\",\n \"granularity\": 1000,\n \"timePoint\": 1730557515000,\n \"value\": 69202.94,\n \"decomposionList\": [\n {\n \"exchange\": \"gateio\",\n \"price\": 69209.27,\n \"weight\": 0.0533\n },\n {\n \"exchange\": \"bitmart\",\n \"price\": 69230.77,\n \"weight\": 0.0128\n },\n {\n \"exchange\": \"okex\",\n \"price\": 69195.34,\n \"weight\": 0.11\n },\n {\n \"exchange\": \"bybit\",\n \"price\": 69190.33,\n \"weight\": 0.0676\n },\n {\n \"exchange\": \"binance\",\n \"price\": 69204.55,\n \"weight\": 0.6195\n },\n {\n \"exchange\": \"kucoin\",\n \"price\": 69202.91,\n \"weight\": 0.1368\n }\n ]\n },\n {\n \"symbol\": \".KXBTUSDT\",\n \"granularity\": 1000,\n \"timePoint\": 1730557514000,\n \"value\": 69204.98,\n \"decomposionList\": [\n {\n \"exchange\": \"gateio\",\n \"price\": 69212.71,\n \"weight\": 0.0808\n },\n {\n \"exchange\": \"bitmart\",\n \"price\": 69230.77,\n \"weight\": 0.0134\n },\n {\n \"exchange\": \"okex\",\n \"price\": 69195.49,\n \"weight\": 0.0536\n },\n {\n \"exchange\": \"bybit\",\n \"price\": 69195.97,\n \"weight\": 0.0921\n },\n {\n \"exchange\": \"binance\",\n \"price\": 69204.56,\n \"weight\": 0.5476\n },\n {\n \"exchange\": \"kucoin\",\n \"price\": 69207.8,\n \"weight\": 0.2125\n }\n ]\n }\n ]\n }\n}" + data = "{\"code\":\"200000\",\"data\":{\"sequence\":1697895100310,\"symbol\":\"XBTUSDM\",\"side\":\"sell\",\"size\":2936,\"tradeId\":\"1697901180000\",\"price\":\"67158.4\",\"bestBidPrice\":\"67169.6\",\"bestBidSize\":32345,\"bestAskPrice\":\"67169.7\",\"bestAskSize\":7251,\"ts\":1729163001780000000}}" common_response = RestResponse.from_json(data) - resp = GetSpotIndexPriceResp.from_dict(common_response.data) + resp = GetTickerResp.from_dict(common_response.data) - def test_get_interest_rate_index_req_model(self): + def test_get_all_tickers_req_model(self): """ - get_interest_rate_index - Get Interest Rate Index - /api/v1/interest/query + get_all_tickers + Get All Tickers + /api/v1/allTickers """ - data = "{\"symbol\": \".XBTINT8H\", \"startAt\": 1728663338000, \"endAt\": 1728692138000, \"reverse\": true, \"offset\": 254062248624417, \"forward\": true, \"maxCount\": 10}" - req = GetInterestRateIndexReq.from_json(data) - def test_get_interest_rate_index_resp_model(self): + def test_get_all_tickers_resp_model(self): """ - get_interest_rate_index - Get Interest Rate Index - /api/v1/interest/query + get_all_tickers + Get All Tickers + /api/v1/allTickers """ - data = "{\n \"code\": \"200000\",\n \"data\": {\n \"dataList\": [\n {\n \"symbol\": \".XBTINT\",\n \"granularity\": 60000,\n \"timePoint\": 1728692100000,\n \"value\": 3.0E-4\n },\n {\n \"symbol\": \".XBTINT\",\n \"granularity\": 60000,\n \"timePoint\": 1728692040000,\n \"value\": 3.0E-4\n }\n ],\n \"hasMore\": true\n }\n}" + data = "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"sequence\": 1707992727046,\n \"symbol\": \"XBTUSDTM\",\n \"side\": \"sell\",\n \"size\": 21,\n \"tradeId\": \"1784299761369\",\n \"price\": \"67153\",\n \"bestBidPrice\": \"67153\",\n \"bestBidSize\": 2767,\n \"bestAskPrice\": \"67153.1\",\n \"bestAskSize\": 5368,\n \"ts\": 1729163466659000000\n },\n {\n \"sequence\": 1697895166299,\n \"symbol\": \"XBTUSDM\",\n \"side\": \"sell\",\n \"size\": 1956,\n \"tradeId\": \"1697901245065\",\n \"price\": \"67145.2\",\n \"bestBidPrice\": \"67135.3\",\n \"bestBidSize\": 1,\n \"bestAskPrice\": \"67135.8\",\n \"bestAskSize\": 3,\n \"ts\": 1729163445340000000\n }\n ]\n}" common_response = RestResponse.from_json(data) - resp = GetInterestRateIndexResp.from_dict(common_response.data) + resp = GetAllTickersResp.from_dict(common_response.data) - def test_get_klines_req_model(self): + def test_get_full_order_book_req_model(self): """ - get_klines - Get Klines - /api/v1/kline/query + get_full_order_book + Get Full OrderBook + /api/v1/level2/snapshot """ - data = "{\"symbol\": \"XBTUSDTM\", \"granularity\": 1, \"from\": 1728552342000, \"to\": 1729243542000}" - req = GetKlinesReq.from_json(data) + data = "{\"symbol\": \"XBTUSDM\"}" + req = GetFullOrderBookReq.from_json(data) - def test_get_klines_resp_model(self): + def test_get_full_order_book_resp_model(self): """ - get_klines - Get Klines - /api/v1/kline/query + get_full_order_book + Get Full OrderBook + /api/v1/level2/snapshot """ - data = "{\n \"code\": \"200000\",\n \"data\": [\n [\n 1728576000000,\n 60791.1,\n 61035,\n 58940,\n 60300,\n 5501167\n ],\n [\n 1728604800000,\n 60299.9,\n 60924.1,\n 60077.4,\n 60666.1,\n 1220980\n ],\n [\n 1728633600000,\n 60665.7,\n 62436.8,\n 60650.1,\n 62255.1,\n 3386359\n ]\n ]\n}" + data = "{\n \"code\": \"200000\",\n \"data\": {\n \"sequence\": 1697895963339,\n \"symbol\": \"XBTUSDM\",\n \"bids\": [\n [\n 66968,\n 2\n ],\n [\n 66964.8,\n 25596\n ]\n ],\n \"asks\": [\n [\n 66968.1,\n 13501\n ],\n [\n 66968.7,\n 2032\n ]\n ],\n \"ts\": 1729168101216000000\n }\n}" common_response = RestResponse.from_json(data) - resp = GetKlinesResp.from_dict(common_response.data) + resp = GetFullOrderBookResp.from_dict(common_response.data) def test_get_part_order_book_req_model(self): """ @@ -194,24 +141,43 @@ def test_get_part_order_book_resp_model(self): common_response = RestResponse.from_json(data) resp = GetPartOrderBookResp.from_dict(common_response.data) - def test_get_full_order_book_req_model(self): + def test_get_trade_history_req_model(self): """ - get_full_order_book - Get Full OrderBook - /api/v1/level2/snapshot + get_trade_history + Get Trade History + /api/v1/trade/history """ data = "{\"symbol\": \"XBTUSDM\"}" - req = GetFullOrderBookReq.from_json(data) + req = GetTradeHistoryReq.from_json(data) - def test_get_full_order_book_resp_model(self): + def test_get_trade_history_resp_model(self): """ - get_full_order_book - Get Full OrderBook - /api/v1/level2/snapshot + get_trade_history + Get Trade History + /api/v1/trade/history """ - data = "{\n \"code\": \"200000\",\n \"data\": {\n \"sequence\": 1697895963339,\n \"symbol\": \"XBTUSDM\",\n \"bids\": [\n [\n 66968,\n 2\n ],\n [\n 66964.8,\n 25596\n ]\n ],\n \"asks\": [\n [\n 66968.1,\n 13501\n ],\n [\n 66968.7,\n 2032\n ]\n ],\n \"ts\": 1729168101216000000\n }\n}" + data = "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"sequence\": 1697915257909,\n \"contractId\": 1,\n \"tradeId\": \"1697915257909\",\n \"makerOrderId\": \"236679665752801280\",\n \"takerOrderId\": \"236679667975745536\",\n \"ts\": 1729242032152000000,\n \"size\": 1,\n \"price\": \"67878\",\n \"side\": \"sell\"\n },\n {\n \"sequence\": 1697915257749,\n \"contractId\": 1,\n \"tradeId\": \"1697915257749\",\n \"makerOrderId\": \"236679660971245570\",\n \"takerOrderId\": \"236679665400492032\",\n \"ts\": 1729242031535000000,\n \"size\": 1,\n \"price\": \"67867.8\",\n \"side\": \"sell\"\n },\n {\n \"sequence\": 1697915257701,\n \"contractId\": 1,\n \"tradeId\": \"1697915257701\",\n \"makerOrderId\": \"236679660971245570\",\n \"takerOrderId\": \"236679661919211521\",\n \"ts\": 1729242030932000000,\n \"size\": 1,\n \"price\": \"67867.8\",\n \"side\": \"sell\"\n }\n ]\n}" common_response = RestResponse.from_json(data) - resp = GetFullOrderBookResp.from_dict(common_response.data) + resp = GetTradeHistoryResp.from_dict(common_response.data) + + def test_get_klines_req_model(self): + """ + get_klines + Get Klines + /api/v1/kline/query + """ + data = "{\"symbol\": \"XBTUSDTM\", \"granularity\": 1, \"from\": 1728552342000, \"to\": 1729243542000}" + req = GetKlinesReq.from_json(data) + + def test_get_klines_resp_model(self): + """ + get_klines + Get Klines + /api/v1/kline/query + """ + data = "{\n \"code\": \"200000\",\n \"data\": [\n [\n 1728576000000,\n 60791.1,\n 61035,\n 58940,\n 60300,\n 5501167\n ],\n [\n 1728604800000,\n 60299.9,\n 60924.1,\n 60077.4,\n 60666.1,\n 1220980\n ],\n [\n 1728633600000,\n 60665.7,\n 62436.8,\n 60650.1,\n 62255.1,\n 3386359\n ]\n ]\n}" + common_response = RestResponse.from_json(data) + resp = GetKlinesResp.from_dict(common_response.data) def test_get_mark_price_req_model(self): """ @@ -232,6 +198,44 @@ def test_get_mark_price_resp_model(self): common_response = RestResponse.from_json(data) resp = GetMarkPriceResp.from_dict(common_response.data) + def test_get_spot_index_price_req_model(self): + """ + get_spot_index_price + Get Spot Index Price + /api/v1/index/query + """ + data = "{\"symbol\": \".KXBTUSDT\", \"startAt\": 123456, \"endAt\": 123456, \"reverse\": true, \"offset\": 123456, \"forward\": true, \"maxCount\": 10}" + req = GetSpotIndexPriceReq.from_json(data) + + def test_get_spot_index_price_resp_model(self): + """ + get_spot_index_price + Get Spot Index Price + /api/v1/index/query + """ + data = "{\n \"code\": \"200000\",\n \"data\": {\n \"hasMore\": true,\n \"dataList\": [\n {\n \"symbol\": \".KXBTUSDT\",\n \"granularity\": 1000,\n \"timePoint\": 1730557515000,\n \"value\": 69202.94,\n \"decomposionList\": [\n {\n \"exchange\": \"gateio\",\n \"price\": 69209.27,\n \"weight\": 0.0533\n },\n {\n \"exchange\": \"bitmart\",\n \"price\": 69230.77,\n \"weight\": 0.0128\n },\n {\n \"exchange\": \"okex\",\n \"price\": 69195.34,\n \"weight\": 0.11\n },\n {\n \"exchange\": \"bybit\",\n \"price\": 69190.33,\n \"weight\": 0.0676\n },\n {\n \"exchange\": \"binance\",\n \"price\": 69204.55,\n \"weight\": 0.6195\n },\n {\n \"exchange\": \"kucoin\",\n \"price\": 69202.91,\n \"weight\": 0.1368\n }\n ]\n },\n {\n \"symbol\": \".KXBTUSDT\",\n \"granularity\": 1000,\n \"timePoint\": 1730557514000,\n \"value\": 69204.98,\n \"decomposionList\": [\n {\n \"exchange\": \"gateio\",\n \"price\": 69212.71,\n \"weight\": 0.0808\n },\n {\n \"exchange\": \"bitmart\",\n \"price\": 69230.77,\n \"weight\": 0.0134\n },\n {\n \"exchange\": \"okex\",\n \"price\": 69195.49,\n \"weight\": 0.0536\n },\n {\n \"exchange\": \"bybit\",\n \"price\": 69195.97,\n \"weight\": 0.0921\n },\n {\n \"exchange\": \"binance\",\n \"price\": 69204.56,\n \"weight\": 0.5476\n },\n {\n \"exchange\": \"kucoin\",\n \"price\": 69207.8,\n \"weight\": 0.2125\n }\n ]\n }\n ]\n }\n}" + common_response = RestResponse.from_json(data) + resp = GetSpotIndexPriceResp.from_dict(common_response.data) + + def test_get_interest_rate_index_req_model(self): + """ + get_interest_rate_index + Get Interest Rate Index + /api/v1/interest/query + """ + data = "{\"symbol\": \".XBTINT8H\", \"startAt\": 1728663338000, \"endAt\": 1728692138000, \"reverse\": true, \"offset\": 254062248624417, \"forward\": true, \"maxCount\": 10}" + req = GetInterestRateIndexReq.from_json(data) + + def test_get_interest_rate_index_resp_model(self): + """ + get_interest_rate_index + Get Interest Rate Index + /api/v1/interest/query + """ + data = "{\n \"code\": \"200000\",\n \"data\": {\n \"dataList\": [\n {\n \"symbol\": \".XBTINT\",\n \"granularity\": 60000,\n \"timePoint\": 1728692100000,\n \"value\": 3.0E-4\n },\n {\n \"symbol\": \".XBTINT\",\n \"granularity\": 60000,\n \"timePoint\": 1728692040000,\n \"value\": 3.0E-4\n }\n ],\n \"hasMore\": true\n }\n}" + common_response = RestResponse.from_json(data) + resp = GetInterestRateIndexResp.from_dict(common_response.data) + def test_get_premium_index_req_model(self): """ get_premium_index @@ -251,41 +255,22 @@ def test_get_premium_index_resp_model(self): common_response = RestResponse.from_json(data) resp = GetPremiumIndexResp.from_dict(common_response.data) - def test_get_service_status_req_model(self): - """ - get_service_status - Get Service Status - /api/v1/status - """ - - def test_get_service_status_resp_model(self): - """ - get_service_status - Get Service Status - /api/v1/status - """ - data = "{\"code\":\"200000\",\"data\":{\"msg\":\"\",\"status\":\"open\"}}" - common_response = RestResponse.from_json(data) - resp = GetServiceStatusResp.from_dict(common_response.data) - - def test_get_ticker_req_model(self): + def test_get24hr_stats_req_model(self): """ - get_ticker - Get Ticker - /api/v1/ticker + get24hr_stats + Get 24hr Stats + /api/v1/trade-statistics """ - data = "{\"symbol\": \"XBTUSDTM\"}" - req = GetTickerReq.from_json(data) - def test_get_ticker_resp_model(self): + def test_get24hr_stats_resp_model(self): """ - get_ticker - Get Ticker - /api/v1/ticker + get24hr_stats + Get 24hr Stats + /api/v1/trade-statistics """ - data = "{\"code\":\"200000\",\"data\":{\"sequence\":1697895100310,\"symbol\":\"XBTUSDM\",\"side\":\"sell\",\"size\":2936,\"tradeId\":\"1697901180000\",\"price\":\"67158.4\",\"bestBidPrice\":\"67169.6\",\"bestBidSize\":32345,\"bestAskPrice\":\"67169.7\",\"bestAskSize\":7251,\"ts\":1729163001780000000}}" + data = "{\"code\":\"200000\",\"data\":{\"turnoverOf24h\":1.1155733413273683E9}}" common_response = RestResponse.from_json(data) - resp = GetTickerResp.from_dict(common_response.data) + resp = Get24hrStatsResp.from_dict(common_response.data) def test_get_server_time_req_model(self): """ @@ -304,38 +289,53 @@ def test_get_server_time_resp_model(self): common_response = RestResponse.from_json(data) resp = GetServerTimeResp.from_dict(common_response.data) - def test_get_trade_history_req_model(self): + def test_get_service_status_req_model(self): """ - get_trade_history - Get Trade History - /api/v1/trade/history + get_service_status + Get Service Status + /api/v1/status """ - data = "{\"symbol\": \"XBTUSDM\"}" - req = GetTradeHistoryReq.from_json(data) - def test_get_trade_history_resp_model(self): + def test_get_service_status_resp_model(self): """ - get_trade_history - Get Trade History - /api/v1/trade/history + get_service_status + Get Service Status + /api/v1/status """ - data = "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"sequence\": 1697915257909,\n \"contractId\": 1,\n \"tradeId\": \"1697915257909\",\n \"makerOrderId\": \"236679665752801280\",\n \"takerOrderId\": \"236679667975745536\",\n \"ts\": 1729242032152000000,\n \"size\": 1,\n \"price\": \"67878\",\n \"side\": \"sell\"\n },\n {\n \"sequence\": 1697915257749,\n \"contractId\": 1,\n \"tradeId\": \"1697915257749\",\n \"makerOrderId\": \"236679660971245570\",\n \"takerOrderId\": \"236679665400492032\",\n \"ts\": 1729242031535000000,\n \"size\": 1,\n \"price\": \"67867.8\",\n \"side\": \"sell\"\n },\n {\n \"sequence\": 1697915257701,\n \"contractId\": 1,\n \"tradeId\": \"1697915257701\",\n \"makerOrderId\": \"236679660971245570\",\n \"takerOrderId\": \"236679661919211521\",\n \"ts\": 1729242030932000000,\n \"size\": 1,\n \"price\": \"67867.8\",\n \"side\": \"sell\"\n }\n ]\n}" + data = "{\"code\":\"200000\",\"data\":{\"msg\":\"\",\"status\":\"open\"}}" common_response = RestResponse.from_json(data) - resp = GetTradeHistoryResp.from_dict(common_response.data) + resp = GetServiceStatusResp.from_dict(common_response.data) - def test_get24hr_stats_req_model(self): + def test_get_public_token_req_model(self): """ - get24hr_stats - Get 24hr Stats - /api/v1/trade-statistics + get_public_token + Get Public Token - Futures + /api/v1/bullet-public """ - def test_get24hr_stats_resp_model(self): + def test_get_public_token_resp_model(self): """ - get24hr_stats - Get 24hr Stats - /api/v1/trade-statistics + get_public_token + Get Public Token - Futures + /api/v1/bullet-public """ - data = "{\"code\":\"200000\",\"data\":{\"turnoverOf24h\":1.1155733413273683E9}}" + data = "{\"code\":\"200000\",\"data\":{\"token\":\"2neAiuYvAU61ZDXANAGAsiL4-iAExhsBXZxftpOeh_55i3Ysy2q2LEsEWU64mdzUOPusi34M_wGoSf7iNyEWJ6dACm4ny9vJtLTRq_YsRUlG5ADnAawegdiYB9J6i9GjsxUuhPw3Blq6rhZlGykT3Vp1phUafnulOOpts-MEmEF-3bpfetLOAjsMMBS5qwTWJBvJHl5Vs9Y=.gJEIAywPXFr_4L-WG10eug==\",\"instanceServers\":[{\"endpoint\":\"wss://ws-api-futures.kucoin.com/\",\"encrypt\":true,\"protocol\":\"websocket\",\"pingInterval\":18000,\"pingTimeout\":10000}]}}" common_response = RestResponse.from_json(data) - resp = Get24hrStatsResp.from_dict(common_response.data) + resp = GetPublicTokenResp.from_dict(common_response.data) + + def test_get_private_token_req_model(self): + """ + get_private_token + Get Private Token - Futures + /api/v1/bullet-private + """ + + def test_get_private_token_resp_model(self): + """ + get_private_token + Get Private Token - Futures + /api/v1/bullet-private + """ + data = "{\n \"code\": \"200000\",\n \"data\": {\n \"token\": \"2neAiuYvAU737TOajb2U3uT8AEZqSWYe0fBD4LoHuXJDSC7gIzJiH4kNTWhCPISWo6nDpAe7aUaaHJ4fG8oRjFgMfUI2sM4IySWHrBceFocY8pKy2REU1HwZIngtMdMrjqPnP-biofFWbNaP1cl0X1pZc2SQ-33hDH1LgNP-yg8bktVoIG0dIxSN4m3uzO8u.ueCCihQ5_4GPpXKxWTDiFQ==\",\n \"instanceServers\": [\n {\n \"endpoint\": \"wss://ws-api-futures.kucoin.com/\",\n \"encrypt\": true,\n \"protocol\": \"websocket\",\n \"pingInterval\": 18000,\n \"pingTimeout\": 10000\n }\n ]\n }\n}" + common_response = RestResponse.from_json(data) + resp = GetPrivateTokenResp.from_dict(common_response.data) diff --git a/sdk/python/kucoin_universal_sdk/generate/futures/order/api_order.py b/sdk/python/kucoin_universal_sdk/generate/futures/order/api_order.py index c5d1aacb..f524436b 100644 --- a/sdk/python/kucoin_universal_sdk/generate/futures/order/api_order.py +++ b/sdk/python/kucoin_universal_sdk/generate/futures/order/api_order.py @@ -45,12 +45,11 @@ class OrderAPI(ABC): @abstractmethod - def get_trade_history(self, req: GetTradeHistoryReq, - **kwargs: Any) -> GetTradeHistoryResp: + def add_order(self, req: AddOrderReq, **kwargs: Any) -> AddOrderResp: """ - summary: Get Trade History - description: Get a list of recent fills. If you need to get your recent trade history with low latency, please query endpoint Get List of Orders Completed in 24h. The requested data is not real-time. - documentation: https://www.kucoin.com/docs-new/api-3470248 + summary: Add Order + description: Place order to the futures trading system, you can place two major types of orders: limit and market. Orders can only be placed if your account has sufficient funds. Once an order is placed, your funds will be put on hold for the duration of the order. The amount of funds on hold depends on the order type and parameters specified. + documentation: https://www.kucoin.com/docs-new/api-3470235 +---------------------+---------+ | Extra API Info | Value | +---------------------+---------+ @@ -58,18 +57,18 @@ def get_trade_history(self, req: GetTradeHistoryReq, | API-CHANNEL | PRIVATE | | API-PERMISSION | FUTURES | | API-RATE-LIMIT-POOL | FUTURES | - | API-RATE-LIMIT | 5 | + | API-RATE-LIMIT | 2 | +---------------------+---------+ """ pass @abstractmethod - def get_open_order_value(self, req: GetOpenOrderValueReq, - **kwargs: Any) -> GetOpenOrderValueResp: + def add_order_test(self, req: AddOrderTestReq, + **kwargs: Any) -> AddOrderTestResp: """ - summary: Get Open Order Value - description: You can query this endpoint to get the the total number and value of the all your active orders. - documentation: https://www.kucoin.com/docs-new/api-3470250 + summary: Add Order Test + description: Place order to the futures trading system just for validation + documentation: https://www.kucoin.com/docs-new/api-3470238 +---------------------+---------+ | Extra API Info | Value | +---------------------+---------+ @@ -77,38 +76,37 @@ def get_open_order_value(self, req: GetOpenOrderValueReq, | API-CHANNEL | PRIVATE | | API-PERMISSION | FUTURES | | API-RATE-LIMIT-POOL | FUTURES | - | API-RATE-LIMIT | 10 | + | API-RATE-LIMIT | 2 | +---------------------+---------+ """ pass @abstractmethod - def get_order_by_client_oid(self, req: GetOrderByClientOidReq, - **kwargs: Any) -> GetOrderByClientOidResp: + def batch_add_orders(self, req: BatchAddOrdersReq, + **kwargs: Any) -> BatchAddOrdersResp: """ - summary: Get Order By ClientOid - description: Get a single order by client order id (including a stop order). - documentation: https://www.kucoin.com/docs-new/api-3470352 + summary: Batch Add Orders + description: Place multiple order to the futures trading system, you can place two major types of orders: limit and market. Orders can only be placed if your account has sufficient funds. Once an order is placed, your funds will be put on hold for the duration of the order. The amount of funds on hold depends on the order type and parameters specified. You can place up to 20 orders at one time, including limit orders, market orders, and stop orders Please be noted that the system would hold the fees from the orders entered the orderbook in advance. + documentation: https://www.kucoin.com/docs-new/api-3470236 +---------------------+---------+ | Extra API Info | Value | +---------------------+---------+ | API-DOMAIN | FUTURES | | API-CHANNEL | PRIVATE | - | API-PERMISSION | GENERAL | + | API-PERMISSION | FUTURES | | API-RATE-LIMIT-POOL | FUTURES | - | API-RATE-LIMIT | 5 | + | API-RATE-LIMIT | 20 | +---------------------+---------+ """ pass @abstractmethod - def cancel_order_by_client_oid( - self, req: CancelOrderByClientOidReq, - **kwargs: Any) -> CancelOrderByClientOidResp: + def add_tpsl_order(self, req: AddTpslOrderReq, + **kwargs: Any) -> AddTpslOrderResp: """ - summary: Cancel Order By ClientOid - description: Cancel order by client defined orderId. - documentation: https://www.kucoin.com/docs-new/api-3470240 + summary: Add Take Profit And Stop Loss Order + description: Place take profit and stop loss order supports both take-profit and stop-loss functions, and other functions are exactly the same as the place order interface. + documentation: https://www.kucoin.com/docs-new/api-3470237 +---------------------+---------+ | Extra API Info | Value | +---------------------+---------+ @@ -116,19 +114,18 @@ def cancel_order_by_client_oid( | API-CHANNEL | PRIVATE | | API-PERMISSION | FUTURES | | API-RATE-LIMIT-POOL | FUTURES | - | API-RATE-LIMIT | 1 | + | API-RATE-LIMIT | 2 | +---------------------+---------+ """ pass @abstractmethod - @deprecated('') - def cancel_all_orders_v1(self, req: CancelAllOrdersV1Req, - **kwargs: Any) -> CancelAllOrdersV1Resp: + def cancel_order_by_id(self, req: CancelOrderByIdReq, + **kwargs: Any) -> CancelOrderByIdResp: """ - summary: Cancel All Orders - V1 - description: Cancel all open orders (excluding stop orders). The response is a list of orderIDs of the canceled orders. - documentation: https://www.kucoin.com/docs-new/api-3470362 + summary: Cancel Order By OrderId + description: Cancel order by system generated orderId. + documentation: https://www.kucoin.com/docs-new/api-3470239 +---------------------+---------+ | Extra API Info | Value | +---------------------+---------+ @@ -136,18 +133,19 @@ def cancel_all_orders_v1(self, req: CancelAllOrdersV1Req, | API-CHANNEL | PRIVATE | | API-PERMISSION | FUTURES | | API-RATE-LIMIT-POOL | FUTURES | - | API-RATE-LIMIT | 200 | + | API-RATE-LIMIT | 1 | +---------------------+---------+ """ pass @abstractmethod - def get_order_list(self, req: GetOrderListReq, - **kwargs: Any) -> GetOrderListResp: + def cancel_order_by_client_oid( + self, req: CancelOrderByClientOidReq, + **kwargs: Any) -> CancelOrderByClientOidResp: """ - summary: Get Order List - description: List your current orders. - documentation: https://www.kucoin.com/docs-new/api-3470244 + summary: Cancel Order By ClientOid + description: Cancel order by client defined orderId. + documentation: https://www.kucoin.com/docs-new/api-3470240 +---------------------+---------+ | Extra API Info | Value | +---------------------+---------+ @@ -155,7 +153,7 @@ def get_order_list(self, req: GetOrderListReq, | API-CHANNEL | PRIVATE | | API-PERMISSION | FUTURES | | API-RATE-LIMIT-POOL | FUTURES | - | API-RATE-LIMIT | 2 | + | API-RATE-LIMIT | 1 | +---------------------+---------+ """ pass @@ -180,12 +178,12 @@ def batch_cancel_orders(self, req: BatchCancelOrdersReq, pass @abstractmethod - def batch_add_orders(self, req: BatchAddOrdersReq, - **kwargs: Any) -> BatchAddOrdersResp: + def cancel_all_orders_v3(self, req: CancelAllOrdersV3Req, + **kwargs: Any) -> CancelAllOrdersV3Resp: """ - summary: Batch Add Orders - description: Place multiple order to the futures trading system, you can place two major types of orders: limit and market. Orders can only be placed if your account has sufficient funds. Once an order is placed, your funds will be put on hold for the duration of the order. The amount of funds on hold depends on the order type and parameters specified. You can place up to 20 orders at one time, including limit orders, market orders, and stop orders Please be noted that the system would hold the fees from the orders entered the orderbook in advance. - documentation: https://www.kucoin.com/docs-new/api-3470236 + summary: Cancel All Orders + description: Cancel all open orders (excluding stop orders). The response is a list of orderIDs of the canceled orders. + documentation: https://www.kucoin.com/docs-new/api-3470242 +---------------------+---------+ | Extra API Info | Value | +---------------------+---------+ @@ -193,18 +191,18 @@ def batch_add_orders(self, req: BatchAddOrdersReq, | API-CHANNEL | PRIVATE | | API-PERMISSION | FUTURES | | API-RATE-LIMIT-POOL | FUTURES | - | API-RATE-LIMIT | 20 | + | API-RATE-LIMIT | 10 | +---------------------+---------+ """ pass @abstractmethod - def cancel_order_by_id(self, req: CancelOrderByIdReq, - **kwargs: Any) -> CancelOrderByIdResp: + def cancel_all_stop_orders(self, req: CancelAllStopOrdersReq, + **kwargs: Any) -> CancelAllStopOrdersResp: """ - summary: Cancel Order By OrderId - description: Cancel order by system generated orderId. - documentation: https://www.kucoin.com/docs-new/api-3470239 + summary: Cancel All Stop orders + description: Cancel all untriggered stop orders. The response is a list of orderIDs of the canceled stop orders. To cancel triggered stop orders, please use 'Cancel Multiple Futures Limit orders'. + documentation: https://www.kucoin.com/docs-new/api-3470243 +---------------------+---------+ | Extra API Info | Value | +---------------------+---------+ @@ -212,7 +210,7 @@ def cancel_order_by_id(self, req: CancelOrderByIdReq, | API-CHANNEL | PRIVATE | | API-PERMISSION | FUTURES | | API-RATE-LIMIT-POOL | FUTURES | - | API-RATE-LIMIT | 1 | + | API-RATE-LIMIT | 15 | +---------------------+---------+ """ pass @@ -237,30 +235,31 @@ def get_order_by_order_id(self, req: GetOrderByOrderIdReq, pass @abstractmethod - def add_order(self, req: AddOrderReq, **kwargs: Any) -> AddOrderResp: + def get_order_by_client_oid(self, req: GetOrderByClientOidReq, + **kwargs: Any) -> GetOrderByClientOidResp: """ - summary: Add Order - description: Place order to the futures trading system, you can place two major types of orders: limit and market. Orders can only be placed if your account has sufficient funds. Once an order is placed, your funds will be put on hold for the duration of the order. The amount of funds on hold depends on the order type and parameters specified. - documentation: https://www.kucoin.com/docs-new/api-3470235 + summary: Get Order By ClientOid + description: Get a single order by client order id (including a stop order). + documentation: https://www.kucoin.com/docs-new/api-3470352 +---------------------+---------+ | Extra API Info | Value | +---------------------+---------+ | API-DOMAIN | FUTURES | | API-CHANNEL | PRIVATE | - | API-PERMISSION | FUTURES | + | API-PERMISSION | GENERAL | | API-RATE-LIMIT-POOL | FUTURES | - | API-RATE-LIMIT | 2 | + | API-RATE-LIMIT | 5 | +---------------------+---------+ """ pass @abstractmethod - def add_order_test(self, req: AddOrderTestReq, - **kwargs: Any) -> AddOrderTestResp: + def get_order_list(self, req: GetOrderListReq, + **kwargs: Any) -> GetOrderListResp: """ - summary: Add Order Test - description: Place order to the futures trading system just for validation - documentation: https://www.kucoin.com/docs-new/api-3470238 + summary: Get Order List + description: List your current orders. + documentation: https://www.kucoin.com/docs-new/api-3470244 +---------------------+---------+ | Extra API Info | Value | +---------------------+---------+ @@ -293,12 +292,12 @@ def get_recent_closed_orders(self, req: GetRecentClosedOrdersReq, pass @abstractmethod - def get_recent_trade_history(self, req: GetRecentTradeHistoryReq, - **kwargs: Any) -> GetRecentTradeHistoryResp: + def get_stop_order_list(self, req: GetStopOrderListReq, + **kwargs: Any) -> GetStopOrderListResp: """ - summary: Get Recent Trade History - description: Get a list of recent 1000 fills in the last 24 hours. If you need to get your recent traded order history with low latency, you may query this endpoint. - documentation: https://www.kucoin.com/docs-new/api-3470249 + summary: Get Stop Order List + description: Get the un-triggered stop orders list. Stop orders that have been triggered can be queried through the general order interface + documentation: https://www.kucoin.com/docs-new/api-3470247 +---------------------+---------+ | Extra API Info | Value | +---------------------+---------+ @@ -306,18 +305,18 @@ def get_recent_trade_history(self, req: GetRecentTradeHistoryReq, | API-CHANNEL | PRIVATE | | API-PERMISSION | FUTURES | | API-RATE-LIMIT-POOL | FUTURES | - | API-RATE-LIMIT | 3 | + | API-RATE-LIMIT | 6 | +---------------------+---------+ """ pass @abstractmethod - def add_tpsl_order(self, req: AddTpslOrderReq, - **kwargs: Any) -> AddTpslOrderResp: + def get_open_order_value(self, req: GetOpenOrderValueReq, + **kwargs: Any) -> GetOpenOrderValueResp: """ - summary: Add Take Profit And Stop Loss Order - description: Place take profit and stop loss order supports both take-profit and stop-loss functions, and other functions are exactly the same as the place order interface. - documentation: https://www.kucoin.com/docs-new/api-3470237 + summary: Get Open Order Value + description: You can query this endpoint to get the the total number and value of the all your active orders. + documentation: https://www.kucoin.com/docs-new/api-3470250 +---------------------+---------+ | Extra API Info | Value | +---------------------+---------+ @@ -325,18 +324,18 @@ def add_tpsl_order(self, req: AddTpslOrderReq, | API-CHANNEL | PRIVATE | | API-PERMISSION | FUTURES | | API-RATE-LIMIT-POOL | FUTURES | - | API-RATE-LIMIT | 2 | + | API-RATE-LIMIT | 10 | +---------------------+---------+ """ pass @abstractmethod - def cancel_all_stop_orders(self, req: CancelAllStopOrdersReq, - **kwargs: Any) -> CancelAllStopOrdersResp: + def get_recent_trade_history(self, req: GetRecentTradeHistoryReq, + **kwargs: Any) -> GetRecentTradeHistoryResp: """ - summary: Cancel All Stop orders - description: Cancel all untriggered stop orders. The response is a list of orderIDs of the canceled stop orders. To cancel triggered stop orders, please use 'Cancel Multiple Futures Limit orders'. - documentation: https://www.kucoin.com/docs-new/api-3470243 + summary: Get Recent Trade History + description: Get a list of recent 1000 fills in the last 24 hours. If you need to get your recent traded order history with low latency, you may query this endpoint. + documentation: https://www.kucoin.com/docs-new/api-3470249 +---------------------+---------+ | Extra API Info | Value | +---------------------+---------+ @@ -344,18 +343,18 @@ def cancel_all_stop_orders(self, req: CancelAllStopOrdersReq, | API-CHANNEL | PRIVATE | | API-PERMISSION | FUTURES | | API-RATE-LIMIT-POOL | FUTURES | - | API-RATE-LIMIT | 15 | + | API-RATE-LIMIT | 3 | +---------------------+---------+ """ pass @abstractmethod - def get_stop_order_list(self, req: GetStopOrderListReq, - **kwargs: Any) -> GetStopOrderListResp: + def get_trade_history(self, req: GetTradeHistoryReq, + **kwargs: Any) -> GetTradeHistoryResp: """ - summary: Get Stop Order List - description: Get the un-triggered stop orders list. Stop orders that have been triggered can be queried through the general order interface - documentation: https://www.kucoin.com/docs-new/api-3470247 + summary: Get Trade History + description: Get a list of recent fills. If you need to get your recent trade history with low latency, please query endpoint Get List of Orders Completed in 24h. The requested data is not real-time. + documentation: https://www.kucoin.com/docs-new/api-3470248 +---------------------+---------+ | Extra API Info | Value | +---------------------+---------+ @@ -363,18 +362,19 @@ def get_stop_order_list(self, req: GetStopOrderListReq, | API-CHANNEL | PRIVATE | | API-PERMISSION | FUTURES | | API-RATE-LIMIT-POOL | FUTURES | - | API-RATE-LIMIT | 6 | + | API-RATE-LIMIT | 5 | +---------------------+---------+ """ pass @abstractmethod - def cancel_all_orders_v3(self, req: CancelAllOrdersV3Req, - **kwargs: Any) -> CancelAllOrdersV3Resp: + @deprecated('') + def cancel_all_orders_v1(self, req: CancelAllOrdersV1Req, + **kwargs: Any) -> CancelAllOrdersV1Resp: """ - summary: Cancel All Orders + summary: Cancel All Orders - V1 description: Cancel all open orders (excluding stop orders). The response is a list of orderIDs of the canceled orders. - documentation: https://www.kucoin.com/docs-new/api-3470242 + documentation: https://www.kucoin.com/docs-new/api-3470362 +---------------------+---------+ | Extra API Info | Value | +---------------------+---------+ @@ -382,7 +382,7 @@ def cancel_all_orders_v3(self, req: CancelAllOrdersV3Req, | API-CHANNEL | PRIVATE | | API-PERMISSION | FUTURES | | API-RATE-LIMIT-POOL | FUTURES | - | API-RATE-LIMIT | 10 | + | API-RATE-LIMIT | 200 | +---------------------+---------+ """ pass @@ -393,22 +393,33 @@ class OrderAPIImpl(OrderAPI): def __init__(self, transport: Transport): self.transport = transport - def get_trade_history(self, req: GetTradeHistoryReq, - **kwargs: Any) -> GetTradeHistoryResp: - return self.transport.call("futures", False, "GET", "/api/v1/fills", - req, GetTradeHistoryResp(), False, **kwargs) + def add_order(self, req: AddOrderReq, **kwargs: Any) -> AddOrderResp: + return self.transport.call("futures", False, "POST", "/api/v1/orders", + req, AddOrderResp(), False, **kwargs) - def get_open_order_value(self, req: GetOpenOrderValueReq, - **kwargs: Any) -> GetOpenOrderValueResp: - return self.transport.call("futures", False, "GET", - "/api/v1/openOrderStatistics", req, - GetOpenOrderValueResp(), False, **kwargs) + def add_order_test(self, req: AddOrderTestReq, + **kwargs: Any) -> AddOrderTestResp: + return self.transport.call("futures", False, "POST", + "/api/v1/orders/test", req, + AddOrderTestResp(), False, **kwargs) - def get_order_by_client_oid(self, req: GetOrderByClientOidReq, - **kwargs: Any) -> GetOrderByClientOidResp: - return self.transport.call("futures", False, "GET", - "/api/v1/orders/byClientOid", req, - GetOrderByClientOidResp(), False, **kwargs) + def batch_add_orders(self, req: BatchAddOrdersReq, + **kwargs: Any) -> BatchAddOrdersResp: + return self.transport.call("futures", False, "POST", + "/api/v1/orders/multi", req, + BatchAddOrdersResp(), False, **kwargs) + + def add_tpsl_order(self, req: AddTpslOrderReq, + **kwargs: Any) -> AddTpslOrderResp: + return self.transport.call("futures", False, + "POST", "/api/v1/st-orders", req, + AddTpslOrderResp(), False, **kwargs) + + def cancel_order_by_id(self, req: CancelOrderByIdReq, + **kwargs: Any) -> CancelOrderByIdResp: + return self.transport.call("futures", False, "DELETE", + "/api/v1/orders/{orderId}", req, + CancelOrderByIdResp(), False, **kwargs) def cancel_order_by_client_oid( self, req: CancelOrderByClientOidReq, @@ -418,34 +429,23 @@ def cancel_order_by_client_oid( req, CancelOrderByClientOidResp(), False, **kwargs) - def cancel_all_orders_v1(self, req: CancelAllOrdersV1Req, - **kwargs: Any) -> CancelAllOrdersV1Resp: - return self.transport.call("futures", False, "DELETE", - "/api/v1/orders", req, - CancelAllOrdersV1Resp(), False, **kwargs) - - def get_order_list(self, req: GetOrderListReq, - **kwargs: Any) -> GetOrderListResp: - return self.transport.call("futures", False, "GET", "/api/v1/orders", - req, GetOrderListResp(), False, **kwargs) - def batch_cancel_orders(self, req: BatchCancelOrdersReq, **kwargs: Any) -> BatchCancelOrdersResp: return self.transport.call("futures", False, "DELETE", "/api/v1/orders/multi-cancel", req, BatchCancelOrdersResp(), True, **kwargs) - def batch_add_orders(self, req: BatchAddOrdersReq, - **kwargs: Any) -> BatchAddOrdersResp: - return self.transport.call("futures", False, "POST", - "/api/v1/orders/multi", req, - BatchAddOrdersResp(), False, **kwargs) + def cancel_all_orders_v3(self, req: CancelAllOrdersV3Req, + **kwargs: Any) -> CancelAllOrdersV3Resp: + return self.transport.call("futures", False, "DELETE", + "/api/v3/orders", req, + CancelAllOrdersV3Resp(), False, **kwargs) - def cancel_order_by_id(self, req: CancelOrderByIdReq, - **kwargs: Any) -> CancelOrderByIdResp: + def cancel_all_stop_orders(self, req: CancelAllStopOrdersReq, + **kwargs: Any) -> CancelAllStopOrdersResp: return self.transport.call("futures", False, "DELETE", - "/api/v1/orders/{orderId}", req, - CancelOrderByIdResp(), False, **kwargs) + "/api/v1/stopOrders", req, + CancelAllStopOrdersResp(), False, **kwargs) def get_order_by_order_id(self, req: GetOrderByOrderIdReq, **kwargs: Any) -> GetOrderByOrderIdResp: @@ -453,15 +453,16 @@ def get_order_by_order_id(self, req: GetOrderByOrderIdReq, "/api/v1/orders/{order-id}", req, GetOrderByOrderIdResp(), False, **kwargs) - def add_order(self, req: AddOrderReq, **kwargs: Any) -> AddOrderResp: - return self.transport.call("futures", False, "POST", "/api/v1/orders", - req, AddOrderResp(), False, **kwargs) + def get_order_by_client_oid(self, req: GetOrderByClientOidReq, + **kwargs: Any) -> GetOrderByClientOidResp: + return self.transport.call("futures", False, "GET", + "/api/v1/orders/byClientOid", req, + GetOrderByClientOidResp(), False, **kwargs) - def add_order_test(self, req: AddOrderTestReq, - **kwargs: Any) -> AddOrderTestResp: - return self.transport.call("futures", False, "POST", - "/api/v1/orders/test", req, - AddOrderTestResp(), False, **kwargs) + def get_order_list(self, req: GetOrderListReq, + **kwargs: Any) -> GetOrderListResp: + return self.transport.call("futures", False, "GET", "/api/v1/orders", + req, GetOrderListResp(), False, **kwargs) def get_recent_closed_orders(self, req: GetRecentClosedOrdersReq, **kwargs: Any) -> GetRecentClosedOrdersResp: @@ -470,6 +471,18 @@ def get_recent_closed_orders(self, req: GetRecentClosedOrdersReq, GetRecentClosedOrdersResp(), False, **kwargs) + def get_stop_order_list(self, req: GetStopOrderListReq, + **kwargs: Any) -> GetStopOrderListResp: + return self.transport.call("futures", False, "GET", + "/api/v1/stopOrders", req, + GetStopOrderListResp(), False, **kwargs) + + def get_open_order_value(self, req: GetOpenOrderValueReq, + **kwargs: Any) -> GetOpenOrderValueResp: + return self.transport.call("futures", False, "GET", + "/api/v1/openOrderStatistics", req, + GetOpenOrderValueResp(), False, **kwargs) + def get_recent_trade_history(self, req: GetRecentTradeHistoryReq, **kwargs: Any) -> GetRecentTradeHistoryResp: return self.transport.call("futures", False, "GET", @@ -477,26 +490,13 @@ def get_recent_trade_history(self, req: GetRecentTradeHistoryReq, GetRecentTradeHistoryResp(), False, **kwargs) - def add_tpsl_order(self, req: AddTpslOrderReq, - **kwargs: Any) -> AddTpslOrderResp: - return self.transport.call("futures", False, - "POST", "/api/v1/st-orders", req, - AddTpslOrderResp(), False, **kwargs) - - def cancel_all_stop_orders(self, req: CancelAllStopOrdersReq, - **kwargs: Any) -> CancelAllStopOrdersResp: - return self.transport.call("futures", False, "DELETE", - "/api/v1/stopOrders", req, - CancelAllStopOrdersResp(), False, **kwargs) - - def get_stop_order_list(self, req: GetStopOrderListReq, - **kwargs: Any) -> GetStopOrderListResp: - return self.transport.call("futures", False, "GET", - "/api/v1/stopOrders", req, - GetStopOrderListResp(), False, **kwargs) + def get_trade_history(self, req: GetTradeHistoryReq, + **kwargs: Any) -> GetTradeHistoryResp: + return self.transport.call("futures", False, "GET", "/api/v1/fills", + req, GetTradeHistoryResp(), False, **kwargs) - def cancel_all_orders_v3(self, req: CancelAllOrdersV3Req, - **kwargs: Any) -> CancelAllOrdersV3Resp: + def cancel_all_orders_v1(self, req: CancelAllOrdersV1Req, + **kwargs: Any) -> CancelAllOrdersV1Resp: return self.transport.call("futures", False, "DELETE", - "/api/v3/orders", req, - CancelAllOrdersV3Resp(), False, **kwargs) + "/api/v1/orders", req, + CancelAllOrdersV1Resp(), False, **kwargs) diff --git a/sdk/python/kucoin_universal_sdk/generate/futures/order/api_order.template b/sdk/python/kucoin_universal_sdk/generate/futures/order/api_order.template index 8d12b323..63e745e5 100644 --- a/sdk/python/kucoin_universal_sdk/generate/futures/order/api_order.template +++ b/sdk/python/kucoin_universal_sdk/generate/futures/order/api_order.template @@ -1,18 +1,18 @@ # API FUNCTION TEMPLATE -def test_get_trade_history_req(self): +def test_add_order_req(self): """ - get_trade_history - Get Trade History - /api/v1/fills + add_order + Add Order + /api/v1/orders """ - builder = GetTradeHistoryReqBuilder() - builder.set_order_id(?).set_symbol(?).set_side(?).set_type(?).set_trade_types(?).set_start_at(?).set_end_at(?).set_current_page(?).set_page_size(?) + builder = AddOrderReqBuilder() + builder.set_client_oid(?).set_side(?).set_symbol(?).set_leverage(?).set_type(?).set_remark(?).set_stop(?).set_stop_price_type(?).set_stop_price(?).set_reduce_only(?).set_close_order(?).set_force_hold(?).set_stp(?).set_margin_mode(?).set_price(?).set_size(?).set_time_in_force(?).set_post_only(?).set_hidden(?).set_iceberg(?).set_visible_size(?).set_qty(?).set_value_qty(?) req = builder.build() try: - resp = self.api.get_trade_history(req) + resp = self.api.add_order(req) print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) @@ -20,18 +20,18 @@ def test_get_trade_history_req(self): print("error: ", e) raise e -def test_get_open_order_value_req(self): +def test_add_order_test_req(self): """ - get_open_order_value - Get Open Order Value - /api/v1/openOrderStatistics + add_order_test + Add Order Test + /api/v1/orders/test """ - builder = GetOpenOrderValueReqBuilder() - builder.set_symbol(?) + builder = AddOrderTestReqBuilder() + builder.set_client_oid(?).set_side(?).set_symbol(?).set_leverage(?).set_type(?).set_remark(?).set_stop(?).set_stop_price_type(?).set_stop_price(?).set_reduce_only(?).set_close_order(?).set_force_hold(?).set_stp(?).set_margin_mode(?).set_price(?).set_size(?).set_time_in_force(?).set_post_only(?).set_hidden(?).set_iceberg(?).set_visible_size(?).set_qty(?).set_value_qty(?) req = builder.build() try: - resp = self.api.get_open_order_value(req) + resp = self.api.add_order_test(req) print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) @@ -39,18 +39,18 @@ def test_get_open_order_value_req(self): print("error: ", e) raise e -def test_get_order_by_client_oid_req(self): +def test_batch_add_orders_req(self): """ - get_order_by_client_oid - Get Order By ClientOid - /api/v1/orders/byClientOid + batch_add_orders + Batch Add Orders + /api/v1/orders/multi """ - builder = GetOrderByClientOidReqBuilder() - builder.set_client_oid(?) + builder = BatchAddOrdersReqBuilder() + builder.set_items(?) req = builder.build() try: - resp = self.api.get_order_by_client_oid(req) + resp = self.api.batch_add_orders(req) print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) @@ -58,18 +58,18 @@ def test_get_order_by_client_oid_req(self): print("error: ", e) raise e -def test_cancel_order_by_client_oid_req(self): +def test_add_tpsl_order_req(self): """ - cancel_order_by_client_oid - Cancel Order By ClientOid - /api/v1/orders/client-order/{clientOid} + add_tpsl_order + Add Take Profit And Stop Loss Order + /api/v1/st-orders """ - builder = CancelOrderByClientOidReqBuilder() - builder.set_symbol(?).set_client_oid(?) + builder = AddTpslOrderReqBuilder() + builder.set_client_oid(?).set_side(?).set_symbol(?).set_leverage(?).set_type(?).set_remark(?).set_stop_price_type(?).set_reduce_only(?).set_close_order(?).set_force_hold(?).set_stp(?).set_margin_mode(?).set_price(?).set_size(?).set_time_in_force(?).set_post_only(?).set_hidden(?).set_iceberg(?).set_visible_size(?).set_trigger_stop_up_price(?).set_trigger_stop_down_price(?).set_qty(?).set_value_qty(?) req = builder.build() try: - resp = self.api.cancel_order_by_client_oid(req) + resp = self.api.add_tpsl_order(req) print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) @@ -77,18 +77,18 @@ def test_cancel_order_by_client_oid_req(self): print("error: ", e) raise e -def test_cancel_all_orders_v1_req(self): +def test_cancel_order_by_id_req(self): """ - cancel_all_orders_v1 - Cancel All Orders - V1 - /api/v1/orders + cancel_order_by_id + Cancel Order By OrderId + /api/v1/orders/{orderId} """ - builder = CancelAllOrdersV1ReqBuilder() - builder.set_symbol(?) + builder = CancelOrderByIdReqBuilder() + builder.set_order_id(?) req = builder.build() try: - resp = self.api.cancel_all_orders_v1(req) + resp = self.api.cancel_order_by_id(req) print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) @@ -96,18 +96,18 @@ def test_cancel_all_orders_v1_req(self): print("error: ", e) raise e -def test_get_order_list_req(self): +def test_cancel_order_by_client_oid_req(self): """ - get_order_list - Get Order List - /api/v1/orders + cancel_order_by_client_oid + Cancel Order By ClientOid + /api/v1/orders/client-order/{clientOid} """ - builder = GetOrderListReqBuilder() - builder.set_status(?).set_symbol(?).set_side(?).set_type(?).set_start_at(?).set_end_at(?).set_current_page(?).set_page_size(?) + builder = CancelOrderByClientOidReqBuilder() + builder.set_symbol(?).set_client_oid(?) req = builder.build() try: - resp = self.api.get_order_list(req) + resp = self.api.cancel_order_by_client_oid(req) print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) @@ -134,18 +134,18 @@ def test_batch_cancel_orders_req(self): print("error: ", e) raise e -def test_batch_add_orders_req(self): +def test_cancel_all_orders_v3_req(self): """ - batch_add_orders - Batch Add Orders - /api/v1/orders/multi + cancel_all_orders_v3 + Cancel All Orders + /api/v3/orders """ - builder = BatchAddOrdersReqBuilder() - builder.set_items(?) + builder = CancelAllOrdersV3ReqBuilder() + builder.set_symbol(?) req = builder.build() try: - resp = self.api.batch_add_orders(req) + resp = self.api.cancel_all_orders_v3(req) print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) @@ -153,18 +153,18 @@ def test_batch_add_orders_req(self): print("error: ", e) raise e -def test_cancel_order_by_id_req(self): +def test_cancel_all_stop_orders_req(self): """ - cancel_order_by_id - Cancel Order By OrderId - /api/v1/orders/{orderId} + cancel_all_stop_orders + Cancel All Stop orders + /api/v1/stopOrders """ - builder = CancelOrderByIdReqBuilder() - builder.set_order_id(?) + builder = CancelAllStopOrdersReqBuilder() + builder.set_symbol(?) req = builder.build() try: - resp = self.api.cancel_order_by_id(req) + resp = self.api.cancel_all_stop_orders(req) print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) @@ -191,18 +191,18 @@ def test_get_order_by_order_id_req(self): print("error: ", e) raise e -def test_add_order_req(self): +def test_get_order_by_client_oid_req(self): """ - add_order - Add Order - /api/v1/orders + get_order_by_client_oid + Get Order By ClientOid + /api/v1/orders/byClientOid """ - builder = AddOrderReqBuilder() - builder.set_client_oid(?).set_side(?).set_symbol(?).set_leverage(?).set_type(?).set_remark(?).set_stop(?).set_stop_price_type(?).set_stop_price(?).set_reduce_only(?).set_close_order(?).set_force_hold(?).set_stp(?).set_margin_mode(?).set_price(?).set_size(?).set_time_in_force(?).set_post_only(?).set_hidden(?).set_iceberg(?).set_visible_size(?).set_qty(?).set_value_qty(?) + builder = GetOrderByClientOidReqBuilder() + builder.set_client_oid(?) req = builder.build() try: - resp = self.api.add_order(req) + resp = self.api.get_order_by_client_oid(req) print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) @@ -210,18 +210,18 @@ def test_add_order_req(self): print("error: ", e) raise e -def test_add_order_test_req(self): +def test_get_order_list_req(self): """ - add_order_test - Add Order Test - /api/v1/orders/test + get_order_list + Get Order List + /api/v1/orders """ - builder = AddOrderTestReqBuilder() - builder.set_client_oid(?).set_side(?).set_symbol(?).set_leverage(?).set_type(?).set_remark(?).set_stop(?).set_stop_price_type(?).set_stop_price(?).set_reduce_only(?).set_close_order(?).set_force_hold(?).set_stp(?).set_margin_mode(?).set_price(?).set_size(?).set_time_in_force(?).set_post_only(?).set_hidden(?).set_iceberg(?).set_visible_size(?).set_qty(?).set_value_qty(?) + builder = GetOrderListReqBuilder() + builder.set_status(?).set_symbol(?).set_side(?).set_type(?).set_start_at(?).set_end_at(?).set_current_page(?).set_page_size(?) req = builder.build() try: - resp = self.api.add_order_test(req) + resp = self.api.get_order_list(req) print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) @@ -248,18 +248,18 @@ def test_get_recent_closed_orders_req(self): print("error: ", e) raise e -def test_get_recent_trade_history_req(self): +def test_get_stop_order_list_req(self): """ - get_recent_trade_history - Get Recent Trade History - /api/v1/recentFills + get_stop_order_list + Get Stop Order List + /api/v1/stopOrders """ - builder = GetRecentTradeHistoryReqBuilder() - builder.set_symbol(?) + builder = GetStopOrderListReqBuilder() + builder.set_symbol(?).set_side(?).set_type(?).set_start_at(?).set_end_at(?).set_current_page(?).set_page_size(?) req = builder.build() try: - resp = self.api.get_recent_trade_history(req) + resp = self.api.get_stop_order_list(req) print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) @@ -267,18 +267,18 @@ def test_get_recent_trade_history_req(self): print("error: ", e) raise e -def test_add_tpsl_order_req(self): +def test_get_open_order_value_req(self): """ - add_tpsl_order - Add Take Profit And Stop Loss Order - /api/v1/st-orders + get_open_order_value + Get Open Order Value + /api/v1/openOrderStatistics """ - builder = AddTpslOrderReqBuilder() - builder.set_client_oid(?).set_side(?).set_symbol(?).set_leverage(?).set_type(?).set_remark(?).set_stop_price_type(?).set_reduce_only(?).set_close_order(?).set_force_hold(?).set_stp(?).set_margin_mode(?).set_price(?).set_size(?).set_time_in_force(?).set_post_only(?).set_hidden(?).set_iceberg(?).set_visible_size(?).set_trigger_stop_up_price(?).set_trigger_stop_down_price(?).set_qty(?).set_value_qty(?) + builder = GetOpenOrderValueReqBuilder() + builder.set_symbol(?) req = builder.build() try: - resp = self.api.add_tpsl_order(req) + resp = self.api.get_open_order_value(req) print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) @@ -286,18 +286,18 @@ def test_add_tpsl_order_req(self): print("error: ", e) raise e -def test_cancel_all_stop_orders_req(self): +def test_get_recent_trade_history_req(self): """ - cancel_all_stop_orders - Cancel All Stop orders - /api/v1/stopOrders + get_recent_trade_history + Get Recent Trade History + /api/v1/recentFills """ - builder = CancelAllStopOrdersReqBuilder() + builder = GetRecentTradeHistoryReqBuilder() builder.set_symbol(?) req = builder.build() try: - resp = self.api.cancel_all_stop_orders(req) + resp = self.api.get_recent_trade_history(req) print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) @@ -305,18 +305,18 @@ def test_cancel_all_stop_orders_req(self): print("error: ", e) raise e -def test_get_stop_order_list_req(self): +def test_get_trade_history_req(self): """ - get_stop_order_list - Get Stop Order List - /api/v1/stopOrders + get_trade_history + Get Trade History + /api/v1/fills """ - builder = GetStopOrderListReqBuilder() - builder.set_symbol(?).set_side(?).set_type(?).set_start_at(?).set_end_at(?).set_current_page(?).set_page_size(?) + builder = GetTradeHistoryReqBuilder() + builder.set_order_id(?).set_symbol(?).set_side(?).set_type(?).set_trade_types(?).set_start_at(?).set_end_at(?).set_current_page(?).set_page_size(?) req = builder.build() try: - resp = self.api.get_stop_order_list(req) + resp = self.api.get_trade_history(req) print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) @@ -324,18 +324,18 @@ def test_get_stop_order_list_req(self): print("error: ", e) raise e -def test_cancel_all_orders_v3_req(self): +def test_cancel_all_orders_v1_req(self): """ - cancel_all_orders_v3 - Cancel All Orders - /api/v3/orders + cancel_all_orders_v1 + Cancel All Orders - V1 + /api/v1/orders """ - builder = CancelAllOrdersV3ReqBuilder() + builder = CancelAllOrdersV1ReqBuilder() builder.set_symbol(?) req = builder.build() try: - resp = self.api.cancel_all_orders_v3(req) + resp = self.api.cancel_all_orders_v1(req) print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) diff --git a/sdk/python/kucoin_universal_sdk/generate/futures/order/api_order_test.py b/sdk/python/kucoin_universal_sdk/generate/futures/order/api_order_test.py index d2cdbbb7..086ec28d 100644 --- a/sdk/python/kucoin_universal_sdk/generate/futures/order/api_order_test.py +++ b/sdk/python/kucoin_universal_sdk/generate/futures/order/api_order_test.py @@ -41,119 +41,119 @@ class OrderAPITest(unittest.TestCase): - def test_get_trade_history_req_model(self): + def test_add_order_req_model(self): """ - get_trade_history - Get Trade History - /api/v1/fills + add_order + Add Order + /api/v1/orders """ - data = "{\"orderId\": \"236655147005071361\", \"symbol\": \"example_string_default_value\", \"side\": \"buy\", \"type\": \"limit\", \"tradeTypes\": \"trade\", \"startAt\": 123456, \"endAt\": 123456, \"currentPage\": 1, \"pageSize\": 50}" - req = GetTradeHistoryReq.from_json(data) + data = "{\"clientOid\": \"5c52e11203aa677f33e493fb\", \"side\": \"buy\", \"symbol\": \"XBTUSDTM\", \"leverage\": 3, \"type\": \"limit\", \"remark\": \"order remarks\", \"reduceOnly\": false, \"marginMode\": \"ISOLATED\", \"price\": \"0.1\", \"size\": 1, \"timeInForce\": \"GTC\"}" + req = AddOrderReq.from_json(data) - def test_get_trade_history_resp_model(self): + def test_add_order_resp_model(self): """ - get_trade_history - Get Trade History - /api/v1/fills + add_order + Add Order + /api/v1/orders """ - data = "{\n \"code\": \"200000\",\n \"data\": {\n \"currentPage\": 1,\n \"pageSize\": 50,\n \"totalNum\": 2,\n \"totalPage\": 1,\n \"items\": [\n {\n \"symbol\": \"XBTUSDTM\",\n \"tradeId\": \"1784277229880\",\n \"orderId\": \"236317213710184449\",\n \"side\": \"buy\",\n \"liquidity\": \"taker\",\n \"forceTaker\": false,\n \"price\": \"67430.9\",\n \"size\": 1,\n \"value\": \"67.4309\",\n \"openFeePay\": \"0.04045854\",\n \"closeFeePay\": \"0\",\n \"stop\": \"\",\n \"feeRate\": \"0.00060\",\n \"fixFee\": \"0\",\n \"feeCurrency\": \"USDT\",\n \"marginMode\": \"ISOLATED\",\n \"settleCurrency\": \"USDT\",\n \"fee\": \"0.04045854\",\n \"orderType\": \"market\",\n \"displayType\": \"market\",\n \"tradeType\": \"trade\",\n \"subTradeType\": null,\n \"tradeTime\": 1729155616320000000,\n \"createdAt\": 1729155616493\n },\n {\n \"symbol\": \"XBTUSDTM\",\n \"tradeId\": \"1784277132002\",\n \"orderId\": \"236317094436728832\",\n \"side\": \"buy\",\n \"liquidity\": \"taker\",\n \"forceTaker\": false,\n \"price\": \"67445\",\n \"size\": 1,\n \"value\": \"67.445\",\n \"openFeePay\": \"0\",\n \"closeFeePay\": \"0.040467\",\n \"stop\": \"\",\n \"feeRate\": \"0.00060\",\n \"fixFee\": \"0\",\n \"feeCurrency\": \"USDT\",\n \"marginMode\": \"ISOLATED\",\n \"settleCurrency\": \"USDT\",\n \"fee\": \"0.040467\",\n \"orderType\": \"market\",\n \"displayType\": \"market\",\n \"tradeType\": \"trade\",\n \"subTradeType\": null,\n \"tradeTime\": 1729155587944000000,\n \"createdAt\": 1729155588104\n }\n ]\n }\n}" + data = "{\n \"code\": \"200000\",\n \"data\": {\n \"orderId\": \"234125150956625920\",\n \"clientOid\": \"5c52e11203aa677f33e493fb\"\n }\n}" common_response = RestResponse.from_json(data) - resp = GetTradeHistoryResp.from_dict(common_response.data) + resp = AddOrderResp.from_dict(common_response.data) - def test_get_open_order_value_req_model(self): + def test_add_order_test_req_model(self): """ - get_open_order_value - Get Open Order Value - /api/v1/openOrderStatistics + add_order_test + Add Order Test + /api/v1/orders/test """ - data = "{\"symbol\": \"XBTUSDTM\"}" - req = GetOpenOrderValueReq.from_json(data) + data = "{\"clientOid\": \"5c52e11203aa677f33e493fb\", \"side\": \"buy\", \"symbol\": \"XBTUSDTM\", \"leverage\": 3, \"type\": \"limit\", \"remark\": \"order remarks\", \"reduceOnly\": false, \"marginMode\": \"ISOLATED\", \"price\": \"0.1\", \"size\": 1, \"timeInForce\": \"GTC\"}" + req = AddOrderTestReq.from_json(data) - def test_get_open_order_value_resp_model(self): + def test_add_order_test_resp_model(self): """ - get_open_order_value - Get Open Order Value - /api/v1/openOrderStatistics + add_order_test + Add Order Test + /api/v1/orders/test """ - data = "{\n \"code\": \"200000\",\n \"data\": {\n \"openOrderBuySize\": 1,\n \"openOrderSellSize\": 0,\n \"openOrderBuyCost\": \"0.0001\",\n \"openOrderSellCost\": \"0\",\n \"settleCurrency\": \"USDT\"\n }\n}" + data = "{\n \"code\": \"200000\",\n \"data\": {\n \"orderId\": \"234125150956625920\",\n \"clientOid\": \"5c52e11203aa677f33e493fb\"\n }\n}" common_response = RestResponse.from_json(data) - resp = GetOpenOrderValueResp.from_dict(common_response.data) + resp = AddOrderTestResp.from_dict(common_response.data) - def test_get_order_by_client_oid_req_model(self): + def test_batch_add_orders_req_model(self): """ - get_order_by_client_oid - Get Order By ClientOid - /api/v1/orders/byClientOid + batch_add_orders + Batch Add Orders + /api/v1/orders/multi """ - data = "{\"clientOid\": \"5c52e11203aa677f33e493fb\"}" - req = GetOrderByClientOidReq.from_json(data) + data = "[{\"clientOid\": \"5c52e11203aa677f33e493fb\", \"side\": \"buy\", \"symbol\": \"XBTUSDTM\", \"leverage\": 3, \"type\": \"limit\", \"remark\": \"order remarks\", \"reduceOnly\": false, \"marginMode\": \"ISOLATED\", \"price\": \"0.1\", \"size\": 1, \"timeInForce\": \"GTC\"}, {\"clientOid\": \"5c52e11203aa677f33e493fc\", \"side\": \"buy\", \"symbol\": \"XBTUSDTM\", \"leverage\": 3, \"type\": \"limit\", \"remark\": \"order remarks\", \"reduceOnly\": false, \"marginMode\": \"ISOLATED\", \"price\": \"0.1\", \"size\": 1, \"timeInForce\": \"GTC\"}]" + req = BatchAddOrdersReq.from_json(data) - def test_get_order_by_client_oid_resp_model(self): + def test_batch_add_orders_resp_model(self): """ - get_order_by_client_oid - Get Order By ClientOid - /api/v1/orders/byClientOid + batch_add_orders + Batch Add Orders + /api/v1/orders/multi """ - data = "{\n \"code\": \"200000\",\n \"data\": {\n \"id\": \"250444645610336256\",\n \"symbol\": \"XRPUSDTM\",\n \"type\": \"limit\",\n \"side\": \"buy\",\n \"price\": \"0.1\",\n \"size\": 1,\n \"value\": \"1\",\n \"dealValue\": \"0\",\n \"dealSize\": 0,\n \"stp\": \"\",\n \"stop\": \"\",\n \"stopPriceType\": \"\",\n \"stopTriggered\": false,\n \"stopPrice\": null,\n \"timeInForce\": \"GTC\",\n \"postOnly\": false,\n \"hidden\": false,\n \"iceberg\": false,\n \"leverage\": \"3\",\n \"forceHold\": false,\n \"closeOrder\": false,\n \"visibleSize\": 0,\n \"clientOid\": \"5c52e11203aa677f33e493fb\",\n \"remark\": null,\n \"tags\": \"\",\n \"isActive\": true,\n \"cancelExist\": false,\n \"createdAt\": 1732523858568,\n \"updatedAt\": 1732523858568,\n \"endAt\": null,\n \"orderTime\": 1732523858550892322,\n \"settleCurrency\": \"USDT\",\n \"marginMode\": \"ISOLATED\",\n \"avgDealPrice\": \"0\",\n \"filledSize\": 0,\n \"filledValue\": \"0\",\n \"status\": \"open\",\n \"reduceOnly\": false\n }\n}" + data = "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"orderId\": \"235919387779985408\",\n \"clientOid\": \"5c52e11203aa677f33e493fb\",\n \"symbol\": \"XBTUSDTM\",\n \"code\": \"200000\",\n \"msg\": \"success\"\n },\n {\n \"orderId\": \"235919387855482880\",\n \"clientOid\": \"5c52e11203aa677f33e493fc\",\n \"symbol\": \"XBTUSDTM\",\n \"code\": \"200000\",\n \"msg\": \"success\"\n }\n ]\n}" common_response = RestResponse.from_json(data) - resp = GetOrderByClientOidResp.from_dict(common_response.data) + resp = BatchAddOrdersResp.from_dict(common_response.data) - def test_cancel_order_by_client_oid_req_model(self): + def test_add_tpsl_order_req_model(self): """ - cancel_order_by_client_oid - Cancel Order By ClientOid - /api/v1/orders/client-order/{clientOid} + add_tpsl_order + Add Take Profit And Stop Loss Order + /api/v1/st-orders """ - data = "{\"symbol\": \"XBTUSDTM\", \"clientOid\": \"example_string_default_value\"}" - req = CancelOrderByClientOidReq.from_json(data) + data = "{\"clientOid\": \"5c52e11203aa677f33e493fb\", \"side\": \"buy\", \"symbol\": \"XBTUSDTM\", \"leverage\": 3, \"type\": \"limit\", \"remark\": \"order remarks\", \"reduceOnly\": false, \"marginMode\": \"ISOLATED\", \"price\": \"0.2\", \"size\": 1, \"timeInForce\": \"GTC\", \"triggerStopUpPrice\": \"0.3\", \"triggerStopDownPrice\": \"0.1\", \"stopPriceType\": \"TP\"}" + req = AddTpslOrderReq.from_json(data) - def test_cancel_order_by_client_oid_resp_model(self): + def test_add_tpsl_order_resp_model(self): """ - cancel_order_by_client_oid - Cancel Order By ClientOid - /api/v1/orders/client-order/{clientOid} + add_tpsl_order + Add Take Profit And Stop Loss Order + /api/v1/st-orders """ - data = "{\n \"code\": \"200000\",\n \"data\": {\n \"clientOid\": \"017485b0-2957-4681-8a14-5d46b35aee0d\"\n }\n}" + data = "{\n \"code\": \"200000\",\n \"data\": {\n \"orderId\": \"234125150956625920\",\n \"clientOid\": \"5c52e11203aa677f33e493fb\"\n }\n}" common_response = RestResponse.from_json(data) - resp = CancelOrderByClientOidResp.from_dict(common_response.data) + resp = AddTpslOrderResp.from_dict(common_response.data) - def test_cancel_all_orders_v1_req_model(self): + def test_cancel_order_by_id_req_model(self): """ - cancel_all_orders_v1 - Cancel All Orders - V1 - /api/v1/orders + cancel_order_by_id + Cancel Order By OrderId + /api/v1/orders/{orderId} """ - data = "{\"symbol\": \"XBTUSDTM\"}" - req = CancelAllOrdersV1Req.from_json(data) + data = "{\"orderId\": \"example_string_default_value\"}" + req = CancelOrderByIdReq.from_json(data) - def test_cancel_all_orders_v1_resp_model(self): + def test_cancel_order_by_id_resp_model(self): """ - cancel_all_orders_v1 - Cancel All Orders - V1 - /api/v1/orders + cancel_order_by_id + Cancel Order By OrderId + /api/v1/orders/{orderId} """ - data = "{\n \"code\": \"200000\",\n \"data\": {\n \"cancelledOrderIds\": [\n \"235919172150824960\",\n \"235919172150824961\"\n ]\n }\n}" + data = "{\n \"code\": \"200000\",\n \"data\": {\n \"cancelledOrderIds\": [\n \"235303670076489728\"\n ]\n }\n}" common_response = RestResponse.from_json(data) - resp = CancelAllOrdersV1Resp.from_dict(common_response.data) + resp = CancelOrderByIdResp.from_dict(common_response.data) - def test_get_order_list_req_model(self): + def test_cancel_order_by_client_oid_req_model(self): """ - get_order_list - Get Order List - /api/v1/orders + cancel_order_by_client_oid + Cancel Order By ClientOid + /api/v1/orders/client-order/{clientOid} """ - data = "{\"status\": \"done\", \"symbol\": \"example_string_default_value\", \"side\": \"buy\", \"type\": \"limit\", \"startAt\": 123456, \"endAt\": 123456, \"currentPage\": 123456, \"pageSize\": 123456}" - req = GetOrderListReq.from_json(data) + data = "{\"symbol\": \"XBTUSDTM\", \"clientOid\": \"example_string_default_value\"}" + req = CancelOrderByClientOidReq.from_json(data) - def test_get_order_list_resp_model(self): + def test_cancel_order_by_client_oid_resp_model(self): """ - get_order_list - Get Order List - /api/v1/orders + cancel_order_by_client_oid + Cancel Order By ClientOid + /api/v1/orders/client-order/{clientOid} """ - data = "{\n \"code\": \"200000\",\n \"data\": {\n \"currentPage\": 1,\n \"pageSize\": 50,\n \"totalNum\": 1,\n \"totalPage\": 1,\n \"items\": [\n {\n \"id\": \"230181737576050688\",\n \"symbol\": \"PEOPLEUSDTM\",\n \"type\": \"limit\",\n \"side\": \"buy\",\n \"price\": \"0.05\",\n \"size\": 10,\n \"value\": \"5\",\n \"dealValue\": \"0\",\n \"dealSize\": 0,\n \"stp\": \"\",\n \"stop\": \"\",\n \"stopPriceType\": \"\",\n \"stopTriggered\": false,\n \"stopPrice\": null,\n \"timeInForce\": \"GTC\",\n \"postOnly\": false,\n \"hidden\": false,\n \"iceberg\": false,\n \"leverage\": \"1\",\n \"forceHold\": false,\n \"closeOrder\": false,\n \"visibleSize\": 0,\n \"clientOid\": \"5a80bd847f1811ef8a7faa665a37b3d7\",\n \"remark\": null,\n \"tags\": \"\",\n \"isActive\": true,\n \"cancelExist\": false,\n \"createdAt\": 1727692804813,\n \"updatedAt\": 1727692804813,\n \"endAt\": null,\n \"orderTime\": 1727692804808418000,\n \"settleCurrency\": \"USDT\",\n \"marginMode\": \"ISOLATED\",\n \"avgDealPrice\": \"0\",\n \"filledSize\": 0,\n \"filledValue\": \"0\",\n \"status\": \"open\",\n \"reduceOnly\": false\n }\n ]\n }\n}" + data = "{\n \"code\": \"200000\",\n \"data\": {\n \"clientOid\": \"017485b0-2957-4681-8a14-5d46b35aee0d\"\n }\n}" common_response = RestResponse.from_json(data) - resp = GetOrderListResp.from_dict(common_response.data) + resp = CancelOrderByClientOidResp.from_dict(common_response.data) def test_batch_cancel_orders_req_model(self): """ @@ -174,43 +174,43 @@ def test_batch_cancel_orders_resp_model(self): common_response = RestResponse.from_json(data) resp = BatchCancelOrdersResp.from_dict(common_response.data) - def test_batch_add_orders_req_model(self): + def test_cancel_all_orders_v3_req_model(self): """ - batch_add_orders - Batch Add Orders - /api/v1/orders/multi + cancel_all_orders_v3 + Cancel All Orders + /api/v3/orders """ - data = "[{\"clientOid\": \"5c52e11203aa677f33e493fb\", \"side\": \"buy\", \"symbol\": \"XBTUSDTM\", \"leverage\": 3, \"type\": \"limit\", \"remark\": \"order remarks\", \"reduceOnly\": false, \"marginMode\": \"ISOLATED\", \"price\": \"0.1\", \"size\": 1, \"timeInForce\": \"GTC\"}, {\"clientOid\": \"5c52e11203aa677f33e493fc\", \"side\": \"buy\", \"symbol\": \"XBTUSDTM\", \"leverage\": 3, \"type\": \"limit\", \"remark\": \"order remarks\", \"reduceOnly\": false, \"marginMode\": \"ISOLATED\", \"price\": \"0.1\", \"size\": 1, \"timeInForce\": \"GTC\"}]" - req = BatchAddOrdersReq.from_json(data) + data = "{\"symbol\": \"XBTUSDTM\"}" + req = CancelAllOrdersV3Req.from_json(data) - def test_batch_add_orders_resp_model(self): + def test_cancel_all_orders_v3_resp_model(self): """ - batch_add_orders - Batch Add Orders - /api/v1/orders/multi + cancel_all_orders_v3 + Cancel All Orders + /api/v3/orders """ - data = "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"orderId\": \"235919387779985408\",\n \"clientOid\": \"5c52e11203aa677f33e493fb\",\n \"symbol\": \"XBTUSDTM\",\n \"code\": \"200000\",\n \"msg\": \"success\"\n },\n {\n \"orderId\": \"235919387855482880\",\n \"clientOid\": \"5c52e11203aa677f33e493fc\",\n \"symbol\": \"XBTUSDTM\",\n \"code\": \"200000\",\n \"msg\": \"success\"\n }\n ]\n}" + data = "{\n \"code\": \"200000\",\n \"data\": {\n \"cancelledOrderIds\": [\n \"235919172150824960\",\n \"235919172150824961\"\n ]\n }\n}" common_response = RestResponse.from_json(data) - resp = BatchAddOrdersResp.from_dict(common_response.data) + resp = CancelAllOrdersV3Resp.from_dict(common_response.data) - def test_cancel_order_by_id_req_model(self): + def test_cancel_all_stop_orders_req_model(self): """ - cancel_order_by_id - Cancel Order By OrderId - /api/v1/orders/{orderId} + cancel_all_stop_orders + Cancel All Stop orders + /api/v1/stopOrders """ - data = "{\"orderId\": \"example_string_default_value\"}" - req = CancelOrderByIdReq.from_json(data) + data = "{\"symbol\": \"XBTUSDTM\"}" + req = CancelAllStopOrdersReq.from_json(data) - def test_cancel_order_by_id_resp_model(self): + def test_cancel_all_stop_orders_resp_model(self): """ - cancel_order_by_id - Cancel Order By OrderId - /api/v1/orders/{orderId} + cancel_all_stop_orders + Cancel All Stop orders + /api/v1/stopOrders """ - data = "{\n \"code\": \"200000\",\n \"data\": {\n \"cancelledOrderIds\": [\n \"235303670076489728\"\n ]\n }\n}" + data = "{\n \"code\": \"200000\",\n \"data\": {\n \"cancelledOrderIds\": [\n \"235919172150824960\",\n \"235919172150824961\"\n ]\n }\n}" common_response = RestResponse.from_json(data) - resp = CancelOrderByIdResp.from_dict(common_response.data) + resp = CancelAllStopOrdersResp.from_dict(common_response.data) def test_get_order_by_order_id_req_model(self): """ @@ -231,43 +231,43 @@ def test_get_order_by_order_id_resp_model(self): common_response = RestResponse.from_json(data) resp = GetOrderByOrderIdResp.from_dict(common_response.data) - def test_add_order_req_model(self): + def test_get_order_by_client_oid_req_model(self): """ - add_order - Add Order - /api/v1/orders + get_order_by_client_oid + Get Order By ClientOid + /api/v1/orders/byClientOid """ - data = "{\"clientOid\": \"5c52e11203aa677f33e493fb\", \"side\": \"buy\", \"symbol\": \"XBTUSDTM\", \"leverage\": 3, \"type\": \"limit\", \"remark\": \"order remarks\", \"reduceOnly\": false, \"marginMode\": \"ISOLATED\", \"price\": \"0.1\", \"size\": 1, \"timeInForce\": \"GTC\"}" - req = AddOrderReq.from_json(data) + data = "{\"clientOid\": \"5c52e11203aa677f33e493fb\"}" + req = GetOrderByClientOidReq.from_json(data) - def test_add_order_resp_model(self): + def test_get_order_by_client_oid_resp_model(self): """ - add_order - Add Order - /api/v1/orders + get_order_by_client_oid + Get Order By ClientOid + /api/v1/orders/byClientOid """ - data = "{\n \"code\": \"200000\",\n \"data\": {\n \"orderId\": \"234125150956625920\",\n \"clientOid\": \"5c52e11203aa677f33e493fb\"\n }\n}" + data = "{\n \"code\": \"200000\",\n \"data\": {\n \"id\": \"250444645610336256\",\n \"symbol\": \"XRPUSDTM\",\n \"type\": \"limit\",\n \"side\": \"buy\",\n \"price\": \"0.1\",\n \"size\": 1,\n \"value\": \"1\",\n \"dealValue\": \"0\",\n \"dealSize\": 0,\n \"stp\": \"\",\n \"stop\": \"\",\n \"stopPriceType\": \"\",\n \"stopTriggered\": false,\n \"stopPrice\": null,\n \"timeInForce\": \"GTC\",\n \"postOnly\": false,\n \"hidden\": false,\n \"iceberg\": false,\n \"leverage\": \"3\",\n \"forceHold\": false,\n \"closeOrder\": false,\n \"visibleSize\": 0,\n \"clientOid\": \"5c52e11203aa677f33e493fb\",\n \"remark\": null,\n \"tags\": \"\",\n \"isActive\": true,\n \"cancelExist\": false,\n \"createdAt\": 1732523858568,\n \"updatedAt\": 1732523858568,\n \"endAt\": null,\n \"orderTime\": 1732523858550892322,\n \"settleCurrency\": \"USDT\",\n \"marginMode\": \"ISOLATED\",\n \"avgDealPrice\": \"0\",\n \"filledSize\": 0,\n \"filledValue\": \"0\",\n \"status\": \"open\",\n \"reduceOnly\": false\n }\n}" common_response = RestResponse.from_json(data) - resp = AddOrderResp.from_dict(common_response.data) + resp = GetOrderByClientOidResp.from_dict(common_response.data) - def test_add_order_test_req_model(self): + def test_get_order_list_req_model(self): """ - add_order_test - Add Order Test - /api/v1/orders/test + get_order_list + Get Order List + /api/v1/orders """ - data = "{\"clientOid\": \"5c52e11203aa677f33e493fb\", \"side\": \"buy\", \"symbol\": \"XBTUSDTM\", \"leverage\": 3, \"type\": \"limit\", \"remark\": \"order remarks\", \"reduceOnly\": false, \"marginMode\": \"ISOLATED\", \"price\": \"0.1\", \"size\": 1, \"timeInForce\": \"GTC\"}" - req = AddOrderTestReq.from_json(data) + data = "{\"status\": \"done\", \"symbol\": \"example_string_default_value\", \"side\": \"buy\", \"type\": \"limit\", \"startAt\": 123456, \"endAt\": 123456, \"currentPage\": 123456, \"pageSize\": 123456}" + req = GetOrderListReq.from_json(data) - def test_add_order_test_resp_model(self): + def test_get_order_list_resp_model(self): """ - add_order_test - Add Order Test - /api/v1/orders/test + get_order_list + Get Order List + /api/v1/orders """ - data = "{\n \"code\": \"200000\",\n \"data\": {\n \"orderId\": \"234125150956625920\",\n \"clientOid\": \"5c52e11203aa677f33e493fb\"\n }\n}" + data = "{\n \"code\": \"200000\",\n \"data\": {\n \"currentPage\": 1,\n \"pageSize\": 50,\n \"totalNum\": 1,\n \"totalPage\": 1,\n \"items\": [\n {\n \"id\": \"230181737576050688\",\n \"symbol\": \"PEOPLEUSDTM\",\n \"type\": \"limit\",\n \"side\": \"buy\",\n \"price\": \"0.05\",\n \"size\": 10,\n \"value\": \"5\",\n \"dealValue\": \"0\",\n \"dealSize\": 0,\n \"stp\": \"\",\n \"stop\": \"\",\n \"stopPriceType\": \"\",\n \"stopTriggered\": false,\n \"stopPrice\": null,\n \"timeInForce\": \"GTC\",\n \"postOnly\": false,\n \"hidden\": false,\n \"iceberg\": false,\n \"leverage\": \"1\",\n \"forceHold\": false,\n \"closeOrder\": false,\n \"visibleSize\": 0,\n \"clientOid\": \"5a80bd847f1811ef8a7faa665a37b3d7\",\n \"remark\": null,\n \"tags\": \"\",\n \"isActive\": true,\n \"cancelExist\": false,\n \"createdAt\": 1727692804813,\n \"updatedAt\": 1727692804813,\n \"endAt\": null,\n \"orderTime\": 1727692804808418000,\n \"settleCurrency\": \"USDT\",\n \"marginMode\": \"ISOLATED\",\n \"avgDealPrice\": \"0\",\n \"filledSize\": 0,\n \"filledValue\": \"0\",\n \"status\": \"open\",\n \"reduceOnly\": false\n }\n ]\n }\n}" common_response = RestResponse.from_json(data) - resp = AddOrderTestResp.from_dict(common_response.data) + resp = GetOrderListResp.from_dict(common_response.data) def test_get_recent_closed_orders_req_model(self): """ @@ -288,97 +288,97 @@ def test_get_recent_closed_orders_resp_model(self): common_response = RestResponse.from_json(data) resp = GetRecentClosedOrdersResp.from_dict(common_response.data) - def test_get_recent_trade_history_req_model(self): + def test_get_stop_order_list_req_model(self): """ - get_recent_trade_history - Get Recent Trade History - /api/v1/recentFills + get_stop_order_list + Get Stop Order List + /api/v1/stopOrders """ - data = "{\"symbol\": \"XBTUSDTM\"}" - req = GetRecentTradeHistoryReq.from_json(data) + data = "{\"symbol\": \"XBTUSDTM\", \"side\": \"buy\", \"type\": \"limit\", \"startAt\": 123456, \"endAt\": 123456, \"currentPage\": 123456, \"pageSize\": 50}" + req = GetStopOrderListReq.from_json(data) - def test_get_recent_trade_history_resp_model(self): + def test_get_stop_order_list_resp_model(self): """ - get_recent_trade_history - Get Recent Trade History - /api/v1/recentFills + get_stop_order_list + Get Stop Order List + /api/v1/stopOrders """ - data = "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"symbol\": \"XBTUSDTM\",\n \"tradeId\": \"1784277229880\",\n \"orderId\": \"236317213710184449\",\n \"side\": \"buy\",\n \"liquidity\": \"taker\",\n \"forceTaker\": false,\n \"price\": \"67430.9\",\n \"size\": 1,\n \"value\": \"67.4309\",\n \"openFeePay\": \"0.04045854\",\n \"closeFeePay\": \"0\",\n \"stop\": \"\",\n \"feeRate\": \"0.00060\",\n \"fixFee\": \"0\",\n \"feeCurrency\": \"USDT\",\n \"marginMode\": \"ISOLATED\",\n \"fee\": \"0.04045854\",\n \"settleCurrency\": \"USDT\",\n \"orderType\": \"market\",\n \"displayType\": \"market\",\n \"tradeType\": \"trade\",\n \"subTradeType\": null,\n \"tradeTime\": 1729155616320000000,\n \"createdAt\": 1729155616493\n },\n {\n \"symbol\": \"XBTUSDTM\",\n \"tradeId\": \"1784277132002\",\n \"orderId\": \"236317094436728832\",\n \"side\": \"buy\",\n \"liquidity\": \"taker\",\n \"forceTaker\": false,\n \"price\": \"67445\",\n \"size\": 1,\n \"value\": \"67.445\",\n \"openFeePay\": \"0\",\n \"closeFeePay\": \"0.040467\",\n \"stop\": \"\",\n \"feeRate\": \"0.00060\",\n \"fixFee\": \"0\",\n \"feeCurrency\": \"USDT\",\n \"marginMode\": \"ISOLATED\",\n \"fee\": \"0.040467\",\n \"settleCurrency\": \"USDT\",\n \"orderType\": \"market\",\n \"displayType\": \"market\",\n \"tradeType\": \"trade\",\n \"subTradeType\": null,\n \"tradeTime\": 1729155587944000000,\n \"createdAt\": 1729155588104\n }\n ]\n}" + data = "{\n \"code\": \"200000\",\n \"data\": {\n \"currentPage\": 1,\n \"pageSize\": 50,\n \"totalNum\": 1,\n \"totalPage\": 1,\n \"items\": [\n {\n \"id\": \"230181737576050688\",\n \"symbol\": \"PEOPLEUSDTM\",\n \"type\": \"limit\",\n \"side\": \"buy\",\n \"price\": \"0.05\",\n \"size\": 10,\n \"value\": \"5\",\n \"dealValue\": \"0\",\n \"dealSize\": 0,\n \"stp\": \"\",\n \"stop\": \"\",\n \"stopPriceType\": \"\",\n \"stopTriggered\": false,\n \"stopPrice\": null,\n \"timeInForce\": \"GTC\",\n \"postOnly\": false,\n \"hidden\": false,\n \"iceberg\": false,\n \"leverage\": \"1\",\n \"forceHold\": false,\n \"closeOrder\": false,\n \"visibleSize\": 0,\n \"clientOid\": \"5a80bd847f1811ef8a7faa665a37b3d7\",\n \"remark\": null,\n \"tags\": \"\",\n \"isActive\": true,\n \"cancelExist\": false,\n \"createdAt\": 1727692804813,\n \"updatedAt\": 1727692804813,\n \"endAt\": null,\n \"orderTime\": 1727692804808418000,\n \"settleCurrency\": \"USDT\",\n \"marginMode\": \"ISOLATED\",\n \"avgDealPrice\": \"0\",\n \"filledSize\": 0,\n \"filledValue\": \"0\",\n \"status\": \"open\",\n \"reduceOnly\": false\n }\n ]\n }\n}" common_response = RestResponse.from_json(data) - resp = GetRecentTradeHistoryResp.from_dict(common_response.data) + resp = GetStopOrderListResp.from_dict(common_response.data) - def test_add_tpsl_order_req_model(self): + def test_get_open_order_value_req_model(self): """ - add_tpsl_order - Add Take Profit And Stop Loss Order - /api/v1/st-orders + get_open_order_value + Get Open Order Value + /api/v1/openOrderStatistics """ - data = "{\"clientOid\": \"5c52e11203aa677f33e493fb\", \"side\": \"buy\", \"symbol\": \"XBTUSDTM\", \"leverage\": 3, \"type\": \"limit\", \"remark\": \"order remarks\", \"reduceOnly\": false, \"marginMode\": \"ISOLATED\", \"price\": \"0.2\", \"size\": 1, \"timeInForce\": \"GTC\", \"triggerStopUpPrice\": \"0.3\", \"triggerStopDownPrice\": \"0.1\", \"stopPriceType\": \"TP\"}" - req = AddTpslOrderReq.from_json(data) + data = "{\"symbol\": \"XBTUSDTM\"}" + req = GetOpenOrderValueReq.from_json(data) - def test_add_tpsl_order_resp_model(self): + def test_get_open_order_value_resp_model(self): """ - add_tpsl_order - Add Take Profit And Stop Loss Order - /api/v1/st-orders + get_open_order_value + Get Open Order Value + /api/v1/openOrderStatistics """ - data = "{\n \"code\": \"200000\",\n \"data\": {\n \"orderId\": \"234125150956625920\",\n \"clientOid\": \"5c52e11203aa677f33e493fb\"\n }\n}" + data = "{\n \"code\": \"200000\",\n \"data\": {\n \"openOrderBuySize\": 1,\n \"openOrderSellSize\": 0,\n \"openOrderBuyCost\": \"0.0001\",\n \"openOrderSellCost\": \"0\",\n \"settleCurrency\": \"USDT\"\n }\n}" common_response = RestResponse.from_json(data) - resp = AddTpslOrderResp.from_dict(common_response.data) + resp = GetOpenOrderValueResp.from_dict(common_response.data) - def test_cancel_all_stop_orders_req_model(self): + def test_get_recent_trade_history_req_model(self): """ - cancel_all_stop_orders - Cancel All Stop orders - /api/v1/stopOrders + get_recent_trade_history + Get Recent Trade History + /api/v1/recentFills """ data = "{\"symbol\": \"XBTUSDTM\"}" - req = CancelAllStopOrdersReq.from_json(data) + req = GetRecentTradeHistoryReq.from_json(data) - def test_cancel_all_stop_orders_resp_model(self): + def test_get_recent_trade_history_resp_model(self): """ - cancel_all_stop_orders - Cancel All Stop orders - /api/v1/stopOrders + get_recent_trade_history + Get Recent Trade History + /api/v1/recentFills """ - data = "{\n \"code\": \"200000\",\n \"data\": {\n \"cancelledOrderIds\": [\n \"235919172150824960\",\n \"235919172150824961\"\n ]\n }\n}" + data = "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"symbol\": \"XBTUSDTM\",\n \"tradeId\": \"1784277229880\",\n \"orderId\": \"236317213710184449\",\n \"side\": \"buy\",\n \"liquidity\": \"taker\",\n \"forceTaker\": false,\n \"price\": \"67430.9\",\n \"size\": 1,\n \"value\": \"67.4309\",\n \"openFeePay\": \"0.04045854\",\n \"closeFeePay\": \"0\",\n \"stop\": \"\",\n \"feeRate\": \"0.00060\",\n \"fixFee\": \"0\",\n \"feeCurrency\": \"USDT\",\n \"marginMode\": \"ISOLATED\",\n \"fee\": \"0.04045854\",\n \"settleCurrency\": \"USDT\",\n \"orderType\": \"market\",\n \"displayType\": \"market\",\n \"tradeType\": \"trade\",\n \"subTradeType\": null,\n \"tradeTime\": 1729155616320000000,\n \"createdAt\": 1729155616493\n },\n {\n \"symbol\": \"XBTUSDTM\",\n \"tradeId\": \"1784277132002\",\n \"orderId\": \"236317094436728832\",\n \"side\": \"buy\",\n \"liquidity\": \"taker\",\n \"forceTaker\": false,\n \"price\": \"67445\",\n \"size\": 1,\n \"value\": \"67.445\",\n \"openFeePay\": \"0\",\n \"closeFeePay\": \"0.040467\",\n \"stop\": \"\",\n \"feeRate\": \"0.00060\",\n \"fixFee\": \"0\",\n \"feeCurrency\": \"USDT\",\n \"marginMode\": \"ISOLATED\",\n \"fee\": \"0.040467\",\n \"settleCurrency\": \"USDT\",\n \"orderType\": \"market\",\n \"displayType\": \"market\",\n \"tradeType\": \"trade\",\n \"subTradeType\": null,\n \"tradeTime\": 1729155587944000000,\n \"createdAt\": 1729155588104\n }\n ]\n}" common_response = RestResponse.from_json(data) - resp = CancelAllStopOrdersResp.from_dict(common_response.data) + resp = GetRecentTradeHistoryResp.from_dict(common_response.data) - def test_get_stop_order_list_req_model(self): + def test_get_trade_history_req_model(self): """ - get_stop_order_list - Get Stop Order List - /api/v1/stopOrders + get_trade_history + Get Trade History + /api/v1/fills """ - data = "{\"symbol\": \"XBTUSDTM\", \"side\": \"buy\", \"type\": \"limit\", \"startAt\": 123456, \"endAt\": 123456, \"currentPage\": 123456, \"pageSize\": 50}" - req = GetStopOrderListReq.from_json(data) + data = "{\"orderId\": \"236655147005071361\", \"symbol\": \"example_string_default_value\", \"side\": \"buy\", \"type\": \"limit\", \"tradeTypes\": \"trade\", \"startAt\": 123456, \"endAt\": 123456, \"currentPage\": 1, \"pageSize\": 50}" + req = GetTradeHistoryReq.from_json(data) - def test_get_stop_order_list_resp_model(self): + def test_get_trade_history_resp_model(self): """ - get_stop_order_list - Get Stop Order List - /api/v1/stopOrders + get_trade_history + Get Trade History + /api/v1/fills """ - data = "{\n \"code\": \"200000\",\n \"data\": {\n \"currentPage\": 1,\n \"pageSize\": 50,\n \"totalNum\": 1,\n \"totalPage\": 1,\n \"items\": [\n {\n \"id\": \"230181737576050688\",\n \"symbol\": \"PEOPLEUSDTM\",\n \"type\": \"limit\",\n \"side\": \"buy\",\n \"price\": \"0.05\",\n \"size\": 10,\n \"value\": \"5\",\n \"dealValue\": \"0\",\n \"dealSize\": 0,\n \"stp\": \"\",\n \"stop\": \"\",\n \"stopPriceType\": \"\",\n \"stopTriggered\": false,\n \"stopPrice\": null,\n \"timeInForce\": \"GTC\",\n \"postOnly\": false,\n \"hidden\": false,\n \"iceberg\": false,\n \"leverage\": \"1\",\n \"forceHold\": false,\n \"closeOrder\": false,\n \"visibleSize\": 0,\n \"clientOid\": \"5a80bd847f1811ef8a7faa665a37b3d7\",\n \"remark\": null,\n \"tags\": \"\",\n \"isActive\": true,\n \"cancelExist\": false,\n \"createdAt\": 1727692804813,\n \"updatedAt\": 1727692804813,\n \"endAt\": null,\n \"orderTime\": 1727692804808418000,\n \"settleCurrency\": \"USDT\",\n \"marginMode\": \"ISOLATED\",\n \"avgDealPrice\": \"0\",\n \"filledSize\": 0,\n \"filledValue\": \"0\",\n \"status\": \"open\",\n \"reduceOnly\": false\n }\n ]\n }\n}" + data = "{\n \"code\": \"200000\",\n \"data\": {\n \"currentPage\": 1,\n \"pageSize\": 50,\n \"totalNum\": 2,\n \"totalPage\": 1,\n \"items\": [\n {\n \"symbol\": \"XBTUSDTM\",\n \"tradeId\": \"1784277229880\",\n \"orderId\": \"236317213710184449\",\n \"side\": \"buy\",\n \"liquidity\": \"taker\",\n \"forceTaker\": false,\n \"price\": \"67430.9\",\n \"size\": 1,\n \"value\": \"67.4309\",\n \"openFeePay\": \"0.04045854\",\n \"closeFeePay\": \"0\",\n \"stop\": \"\",\n \"feeRate\": \"0.00060\",\n \"fixFee\": \"0\",\n \"feeCurrency\": \"USDT\",\n \"marginMode\": \"ISOLATED\",\n \"settleCurrency\": \"USDT\",\n \"fee\": \"0.04045854\",\n \"orderType\": \"market\",\n \"displayType\": \"market\",\n \"tradeType\": \"trade\",\n \"subTradeType\": null,\n \"tradeTime\": 1729155616320000000,\n \"createdAt\": 1729155616493\n },\n {\n \"symbol\": \"XBTUSDTM\",\n \"tradeId\": \"1784277132002\",\n \"orderId\": \"236317094436728832\",\n \"side\": \"buy\",\n \"liquidity\": \"taker\",\n \"forceTaker\": false,\n \"price\": \"67445\",\n \"size\": 1,\n \"value\": \"67.445\",\n \"openFeePay\": \"0\",\n \"closeFeePay\": \"0.040467\",\n \"stop\": \"\",\n \"feeRate\": \"0.00060\",\n \"fixFee\": \"0\",\n \"feeCurrency\": \"USDT\",\n \"marginMode\": \"ISOLATED\",\n \"settleCurrency\": \"USDT\",\n \"fee\": \"0.040467\",\n \"orderType\": \"market\",\n \"displayType\": \"market\",\n \"tradeType\": \"trade\",\n \"subTradeType\": null,\n \"tradeTime\": 1729155587944000000,\n \"createdAt\": 1729155588104\n }\n ]\n }\n}" common_response = RestResponse.from_json(data) - resp = GetStopOrderListResp.from_dict(common_response.data) + resp = GetTradeHistoryResp.from_dict(common_response.data) - def test_cancel_all_orders_v3_req_model(self): + def test_cancel_all_orders_v1_req_model(self): """ - cancel_all_orders_v3 - Cancel All Orders - /api/v3/orders + cancel_all_orders_v1 + Cancel All Orders - V1 + /api/v1/orders """ data = "{\"symbol\": \"XBTUSDTM\"}" - req = CancelAllOrdersV3Req.from_json(data) + req = CancelAllOrdersV1Req.from_json(data) - def test_cancel_all_orders_v3_resp_model(self): + def test_cancel_all_orders_v1_resp_model(self): """ - cancel_all_orders_v3 - Cancel All Orders - /api/v3/orders + cancel_all_orders_v1 + Cancel All Orders - V1 + /api/v1/orders """ data = "{\n \"code\": \"200000\",\n \"data\": {\n \"cancelledOrderIds\": [\n \"235919172150824960\",\n \"235919172150824961\"\n ]\n }\n}" common_response = RestResponse.from_json(data) - resp = CancelAllOrdersV3Resp.from_dict(common_response.data) + resp = CancelAllOrdersV1Resp.from_dict(common_response.data) diff --git a/sdk/python/kucoin_universal_sdk/generate/futures/positions/api_positions.py b/sdk/python/kucoin_universal_sdk/generate/futures/positions/api_positions.py index 18883c74..468977c0 100644 --- a/sdk/python/kucoin_universal_sdk/generate/futures/positions/api_positions.py +++ b/sdk/python/kucoin_universal_sdk/generate/futures/positions/api_positions.py @@ -37,32 +37,31 @@ class PositionsAPI(ABC): @abstractmethod - def get_isolated_margin_risk_limit( - self, req: GetIsolatedMarginRiskLimitReq, - **kwargs: Any) -> GetIsolatedMarginRiskLimitResp: + def get_margin_mode(self, req: GetMarginModeReq, + **kwargs: Any) -> GetMarginModeResp: """ - summary: Get Isolated Margin Risk Limit - description: This interface can be used to obtain information about risk limit level of a specific contract(Only valid for isolated Margin). - documentation: https://www.kucoin.com/docs-new/api-3470263 + summary: Get Margin Mode + description: This interface can query the margin mode of the current symbol. + documentation: https://www.kucoin.com/docs-new/api-3470259 +---------------------+---------+ | Extra API Info | Value | +---------------------+---------+ | API-DOMAIN | FUTURES | | API-CHANNEL | PRIVATE | | API-PERMISSION | FUTURES | - | API-RATE-LIMIT-POOL | PUBLIC | - | API-RATE-LIMIT | 5 | + | API-RATE-LIMIT-POOL | FUTURES | + | API-RATE-LIMIT | 2 | +---------------------+---------+ """ pass @abstractmethod - def get_positions_history(self, req: GetPositionsHistoryReq, - **kwargs: Any) -> GetPositionsHistoryResp: + def switch_margin_mode(self, req: SwitchMarginModeReq, + **kwargs: Any) -> SwitchMarginModeResp: """ - summary: Get Positions History - description: This interface can query position history information records. - documentation: https://www.kucoin.com/docs-new/api-3470254 + summary: Switch Margin Mode + description: This interface can modify the margin mode of the current symbol. + documentation: https://www.kucoin.com/docs-new/api-3470262 +---------------------+---------+ | Extra API Info | Value | +---------------------+---------+ @@ -76,12 +75,12 @@ def get_positions_history(self, req: GetPositionsHistoryReq, pass @abstractmethod - def get_max_withdraw_margin(self, req: GetMaxWithdrawMarginReq, - **kwargs: Any) -> GetMaxWithdrawMarginResp: + def get_max_open_size(self, req: GetMaxOpenSizeReq, + **kwargs: Any) -> GetMaxOpenSizeResp: """ - summary: Get Max Withdraw Margin - description: This interface can query the maximum amount of margin that the current position supports withdrawal. - documentation: https://www.kucoin.com/docs-new/api-3470258 + summary: Get Max Open Size + description: Get Maximum Open Position Size. + documentation: https://www.kucoin.com/docs-new/api-3470251 +---------------------+---------+ | Extra API Info | Value | +---------------------+---------+ @@ -89,18 +88,18 @@ def get_max_withdraw_margin(self, req: GetMaxWithdrawMarginReq, | API-CHANNEL | PRIVATE | | API-PERMISSION | FUTURES | | API-RATE-LIMIT-POOL | FUTURES | - | API-RATE-LIMIT | 10 | + | API-RATE-LIMIT | 2 | +---------------------+---------+ """ pass @abstractmethod - def remove_isolated_margin(self, req: RemoveIsolatedMarginReq, - **kwargs: Any) -> RemoveIsolatedMarginResp: + def get_position_details(self, req: GetPositionDetailsReq, + **kwargs: Any) -> GetPositionDetailsResp: """ - summary: Remove Isolated Margin - description: Remove Isolated Margin Manually. - documentation: https://www.kucoin.com/docs-new/api-3470256 + summary: Get Position Details + description: Get the position details of a specified position. + documentation: https://www.kucoin.com/docs-new/api-3470252 +---------------------+---------+ | Extra API Info | Value | +---------------------+---------+ @@ -108,18 +107,18 @@ def remove_isolated_margin(self, req: RemoveIsolatedMarginReq, | API-CHANNEL | PRIVATE | | API-PERMISSION | FUTURES | | API-RATE-LIMIT-POOL | FUTURES | - | API-RATE-LIMIT | 10 | + | API-RATE-LIMIT | 2 | +---------------------+---------+ """ pass @abstractmethod - def get_position_details(self, req: GetPositionDetailsReq, - **kwargs: Any) -> GetPositionDetailsResp: + def get_position_list(self, req: GetPositionListReq, + **kwargs: Any) -> GetPositionListResp: """ - summary: Get Position Details + summary: Get Position List description: Get the position details of a specified position. - documentation: https://www.kucoin.com/docs-new/api-3470252 + documentation: https://www.kucoin.com/docs-new/api-3470253 +---------------------+---------+ | Extra API Info | Value | +---------------------+---------+ @@ -133,14 +132,12 @@ def get_position_details(self, req: GetPositionDetailsReq, pass @abstractmethod - @deprecated('') - def modify_auto_deposit_status( - self, req: ModifyAutoDepositStatusReq, - **kwargs: Any) -> ModifyAutoDepositStatusResp: + def get_positions_history(self, req: GetPositionsHistoryReq, + **kwargs: Any) -> GetPositionsHistoryResp: """ - summary: Modify Isolated Margin Auto-Deposit Status - description: This endpoint is only applicable to isolated margin and is no longer recommended. It is recommended to use cross margin instead. - documentation: https://www.kucoin.com/docs-new/api-3470255 + summary: Get Positions History + description: This interface can query position history information records. + documentation: https://www.kucoin.com/docs-new/api-3470254 +---------------------+---------+ | Extra API Info | Value | +---------------------+---------+ @@ -148,18 +145,18 @@ def modify_auto_deposit_status( | API-CHANNEL | PRIVATE | | API-PERMISSION | FUTURES | | API-RATE-LIMIT-POOL | FUTURES | - | API-RATE-LIMIT | 4 | + | API-RATE-LIMIT | 2 | +---------------------+---------+ """ pass @abstractmethod - def add_isolated_margin(self, req: AddIsolatedMarginReq, - **kwargs: Any) -> AddIsolatedMarginResp: + def get_max_withdraw_margin(self, req: GetMaxWithdrawMarginReq, + **kwargs: Any) -> GetMaxWithdrawMarginResp: """ - summary: Add Isolated Margin - description: Add Isolated Margin Manually. - documentation: https://www.kucoin.com/docs-new/api-3470257 + summary: Get Max Withdraw Margin + description: This interface can query the maximum amount of margin that the current position supports withdrawal. + documentation: https://www.kucoin.com/docs-new/api-3470258 +---------------------+---------+ | Extra API Info | Value | +---------------------+---------+ @@ -167,19 +164,18 @@ def add_isolated_margin(self, req: AddIsolatedMarginReq, | API-CHANNEL | PRIVATE | | API-PERMISSION | FUTURES | | API-RATE-LIMIT-POOL | FUTURES | - | API-RATE-LIMIT | 4 | + | API-RATE-LIMIT | 10 | +---------------------+---------+ """ pass @abstractmethod - def modify_isolated_margin_risk_limt( - self, req: ModifyIsolatedMarginRiskLimtReq, - **kwargs: Any) -> ModifyIsolatedMarginRiskLimtResp: + def get_cross_margin_leverage(self, req: GetCrossMarginLeverageReq, + **kwargs: Any) -> GetCrossMarginLeverageResp: """ - summary: Modify Isolated Margin Risk Limit - description: This interface can be used to obtain information about risk limit level of a specific contract(Only valid for isolated Margin). - documentation: https://www.kucoin.com/docs-new/api-3470264 + summary: Get Cross Margin Leverage + description: This interface can query the current symbol’s cross-margin leverage multiple. + documentation: https://www.kucoin.com/docs-new/api-3470260 +---------------------+---------+ | Extra API Info | Value | +---------------------+---------+ @@ -187,18 +183,18 @@ def modify_isolated_margin_risk_limt( | API-CHANNEL | PRIVATE | | API-PERMISSION | FUTURES | | API-RATE-LIMIT-POOL | FUTURES | - | API-RATE-LIMIT | 5 | + | API-RATE-LIMIT | 2 | +---------------------+---------+ """ pass @abstractmethod - def get_position_list(self, req: GetPositionListReq, - **kwargs: Any) -> GetPositionListResp: + def modify_margin_leverage(self, req: ModifyMarginLeverageReq, + **kwargs: Any) -> ModifyMarginLeverageResp: """ - summary: Get Position List - description: Get the position details of a specified position. - documentation: https://www.kucoin.com/docs-new/api-3470253 + summary: Modify Cross Margin Leverage + description: This interface can modify the current symbol’s cross-margin leverage multiple. + documentation: https://www.kucoin.com/docs-new/api-3470261 +---------------------+---------+ | Extra API Info | Value | +---------------------+---------+ @@ -212,12 +208,12 @@ def get_position_list(self, req: GetPositionListReq, pass @abstractmethod - def modify_margin_leverage(self, req: ModifyMarginLeverageReq, - **kwargs: Any) -> ModifyMarginLeverageResp: + def add_isolated_margin(self, req: AddIsolatedMarginReq, + **kwargs: Any) -> AddIsolatedMarginResp: """ - summary: Modify Cross Margin Leverage - description: This interface can modify the current symbol’s cross-margin leverage multiple. - documentation: https://www.kucoin.com/docs-new/api-3470261 + summary: Add Isolated Margin + description: Add Isolated Margin Manually. + documentation: https://www.kucoin.com/docs-new/api-3470257 +---------------------+---------+ | Extra API Info | Value | +---------------------+---------+ @@ -225,18 +221,18 @@ def modify_margin_leverage(self, req: ModifyMarginLeverageReq, | API-CHANNEL | PRIVATE | | API-PERMISSION | FUTURES | | API-RATE-LIMIT-POOL | FUTURES | - | API-RATE-LIMIT | 2 | + | API-RATE-LIMIT | 4 | +---------------------+---------+ """ pass @abstractmethod - def get_cross_margin_leverage(self, req: GetCrossMarginLeverageReq, - **kwargs: Any) -> GetCrossMarginLeverageResp: + def remove_isolated_margin(self, req: RemoveIsolatedMarginReq, + **kwargs: Any) -> RemoveIsolatedMarginResp: """ - summary: Get Cross Margin Leverage - description: This interface can query the current symbol’s cross-margin leverage multiple. - documentation: https://www.kucoin.com/docs-new/api-3470260 + summary: Remove Isolated Margin + description: Remove Isolated Margin Manually. + documentation: https://www.kucoin.com/docs-new/api-3470256 +---------------------+---------+ | Extra API Info | Value | +---------------------+---------+ @@ -244,37 +240,39 @@ def get_cross_margin_leverage(self, req: GetCrossMarginLeverageReq, | API-CHANNEL | PRIVATE | | API-PERMISSION | FUTURES | | API-RATE-LIMIT-POOL | FUTURES | - | API-RATE-LIMIT | 2 | + | API-RATE-LIMIT | 10 | +---------------------+---------+ """ pass @abstractmethod - def get_max_open_size(self, req: GetMaxOpenSizeReq, - **kwargs: Any) -> GetMaxOpenSizeResp: + def get_isolated_margin_risk_limit( + self, req: GetIsolatedMarginRiskLimitReq, + **kwargs: Any) -> GetIsolatedMarginRiskLimitResp: """ - summary: Get Max Open Size - description: Get Maximum Open Position Size. - documentation: https://www.kucoin.com/docs-new/api-3470251 + summary: Get Isolated Margin Risk Limit + description: This interface can be used to obtain information about risk limit level of a specific contract(Only valid for isolated Margin). + documentation: https://www.kucoin.com/docs-new/api-3470263 +---------------------+---------+ | Extra API Info | Value | +---------------------+---------+ | API-DOMAIN | FUTURES | | API-CHANNEL | PRIVATE | | API-PERMISSION | FUTURES | - | API-RATE-LIMIT-POOL | FUTURES | - | API-RATE-LIMIT | 2 | + | API-RATE-LIMIT-POOL | PUBLIC | + | API-RATE-LIMIT | 5 | +---------------------+---------+ """ pass @abstractmethod - def switch_margin_mode(self, req: SwitchMarginModeReq, - **kwargs: Any) -> SwitchMarginModeResp: + def modify_isolated_margin_risk_limt( + self, req: ModifyIsolatedMarginRiskLimtReq, + **kwargs: Any) -> ModifyIsolatedMarginRiskLimtResp: """ - summary: Switch Margin Mode - description: This interface can modify the margin mode of the current symbol. - documentation: https://www.kucoin.com/docs-new/api-3470262 + summary: Modify Isolated Margin Risk Limit + description: This interface can be used to obtain information about risk limit level of a specific contract(Only valid for isolated Margin). + documentation: https://www.kucoin.com/docs-new/api-3470264 +---------------------+---------+ | Extra API Info | Value | +---------------------+---------+ @@ -282,18 +280,20 @@ def switch_margin_mode(self, req: SwitchMarginModeReq, | API-CHANNEL | PRIVATE | | API-PERMISSION | FUTURES | | API-RATE-LIMIT-POOL | FUTURES | - | API-RATE-LIMIT | 2 | + | API-RATE-LIMIT | 5 | +---------------------+---------+ """ pass @abstractmethod - def get_margin_mode(self, req: GetMarginModeReq, - **kwargs: Any) -> GetMarginModeResp: + @deprecated('') + def modify_auto_deposit_status( + self, req: ModifyAutoDepositStatusReq, + **kwargs: Any) -> ModifyAutoDepositStatusResp: """ - summary: Get Margin Mode - description: This interface can query the margin mode of the current symbol. - documentation: https://www.kucoin.com/docs-new/api-3470259 + summary: Modify Isolated Margin Auto-Deposit Status + description: This endpoint is only applicable to isolated margin and is no longer recommended. It is recommended to use cross margin instead. + documentation: https://www.kucoin.com/docs-new/api-3470255 +---------------------+---------+ | Extra API Info | Value | +---------------------+---------+ @@ -301,7 +301,7 @@ def get_margin_mode(self, req: GetMarginModeReq, | API-CHANNEL | PRIVATE | | API-PERMISSION | FUTURES | | API-RATE-LIMIT-POOL | FUTURES | - | API-RATE-LIMIT | 2 | + | API-RATE-LIMIT | 4 | +---------------------+---------+ """ pass @@ -312,13 +312,35 @@ class PositionsAPIImpl(PositionsAPI): def __init__(self, transport: Transport): self.transport = transport - def get_isolated_margin_risk_limit( - self, req: GetIsolatedMarginRiskLimitReq, - **kwargs: Any) -> GetIsolatedMarginRiskLimitResp: + def get_margin_mode(self, req: GetMarginModeReq, + **kwargs: Any) -> GetMarginModeResp: return self.transport.call("futures", False, "GET", - "/api/v1/contracts/risk-limit/{symbol}", - req, GetIsolatedMarginRiskLimitResp(), - False, **kwargs) + "/api/v2/position/getMarginMode", req, + GetMarginModeResp(), False, **kwargs) + + def switch_margin_mode(self, req: SwitchMarginModeReq, + **kwargs: Any) -> SwitchMarginModeResp: + return self.transport.call("futures", False, "POST", + "/api/v2/position/changeMarginMode", req, + SwitchMarginModeResp(), False, **kwargs) + + def get_max_open_size(self, req: GetMaxOpenSizeReq, + **kwargs: Any) -> GetMaxOpenSizeResp: + return self.transport.call("futures", False, "GET", + "/api/v2/getMaxOpenSize", req, + GetMaxOpenSizeResp(), False, **kwargs) + + def get_position_details(self, req: GetPositionDetailsReq, + **kwargs: Any) -> GetPositionDetailsResp: + return self.transport.call("futures", False, "GET", + "/api/v1/position", req, + GetPositionDetailsResp(), False, **kwargs) + + def get_position_list(self, req: GetPositionListReq, + **kwargs: Any) -> GetPositionListResp: + return self.transport.call("futures", False, "GET", + "/api/v1/positions", req, + GetPositionListResp(), False, **kwargs) def get_positions_history(self, req: GetPositionsHistoryReq, **kwargs: Any) -> GetPositionsHistoryResp: @@ -332,25 +354,18 @@ def get_max_withdraw_margin(self, req: GetMaxWithdrawMarginReq, "/api/v1/margin/maxWithdrawMargin", req, GetMaxWithdrawMarginResp(), False, **kwargs) - def remove_isolated_margin(self, req: RemoveIsolatedMarginReq, - **kwargs: Any) -> RemoveIsolatedMarginResp: - return self.transport.call("futures", False, "POST", - "/api/v1/margin/withdrawMargin", req, - RemoveIsolatedMarginResp(), False, **kwargs) - - def get_position_details(self, req: GetPositionDetailsReq, - **kwargs: Any) -> GetPositionDetailsResp: + def get_cross_margin_leverage(self, req: GetCrossMarginLeverageReq, + **kwargs: Any) -> GetCrossMarginLeverageResp: return self.transport.call("futures", False, "GET", - "/api/v1/position", req, - GetPositionDetailsResp(), False, **kwargs) + "/api/v2/getCrossUserLeverage", req, + GetCrossMarginLeverageResp(), False, + **kwargs) - def modify_auto_deposit_status( - self, req: ModifyAutoDepositStatusReq, - **kwargs: Any) -> ModifyAutoDepositStatusResp: - return self.transport.call( - "futures", False, "POST", - "/api/v1/position/margin/auto-deposit-status", req, - ModifyAutoDepositStatusResp(), False, **kwargs) + def modify_margin_leverage(self, req: ModifyMarginLeverageReq, + **kwargs: Any) -> ModifyMarginLeverageResp: + return self.transport.call("futures", False, "POST", + "/api/v2/changeCrossUserLeverage", req, + ModifyMarginLeverageResp(), False, **kwargs) def add_isolated_margin(self, req: AddIsolatedMarginReq, **kwargs: Any) -> AddIsolatedMarginResp: @@ -359,6 +374,20 @@ def add_isolated_margin(self, req: AddIsolatedMarginReq, req, AddIsolatedMarginResp(), False, **kwargs) + def remove_isolated_margin(self, req: RemoveIsolatedMarginReq, + **kwargs: Any) -> RemoveIsolatedMarginResp: + return self.transport.call("futures", False, "POST", + "/api/v1/margin/withdrawMargin", req, + RemoveIsolatedMarginResp(), False, **kwargs) + + def get_isolated_margin_risk_limit( + self, req: GetIsolatedMarginRiskLimitReq, + **kwargs: Any) -> GetIsolatedMarginRiskLimitResp: + return self.transport.call("futures", False, "GET", + "/api/v1/contracts/risk-limit/{symbol}", + req, GetIsolatedMarginRiskLimitResp(), + False, **kwargs) + def modify_isolated_margin_risk_limt( self, req: ModifyIsolatedMarginRiskLimtReq, **kwargs: Any) -> ModifyIsolatedMarginRiskLimtResp: @@ -367,39 +396,10 @@ def modify_isolated_margin_risk_limt( req, ModifyIsolatedMarginRiskLimtResp(), False, **kwargs) - def get_position_list(self, req: GetPositionListReq, - **kwargs: Any) -> GetPositionListResp: - return self.transport.call("futures", False, "GET", - "/api/v1/positions", req, - GetPositionListResp(), False, **kwargs) - - def modify_margin_leverage(self, req: ModifyMarginLeverageReq, - **kwargs: Any) -> ModifyMarginLeverageResp: - return self.transport.call("futures", False, "POST", - "/api/v2/changeCrossUserLeverage", req, - ModifyMarginLeverageResp(), False, **kwargs) - - def get_cross_margin_leverage(self, req: GetCrossMarginLeverageReq, - **kwargs: Any) -> GetCrossMarginLeverageResp: - return self.transport.call("futures", False, "GET", - "/api/v2/getCrossUserLeverage", req, - GetCrossMarginLeverageResp(), False, - **kwargs) - - def get_max_open_size(self, req: GetMaxOpenSizeReq, - **kwargs: Any) -> GetMaxOpenSizeResp: - return self.transport.call("futures", False, "GET", - "/api/v2/getMaxOpenSize", req, - GetMaxOpenSizeResp(), False, **kwargs) - - def switch_margin_mode(self, req: SwitchMarginModeReq, - **kwargs: Any) -> SwitchMarginModeResp: - return self.transport.call("futures", False, "POST", - "/api/v2/position/changeMarginMode", req, - SwitchMarginModeResp(), False, **kwargs) - - def get_margin_mode(self, req: GetMarginModeReq, - **kwargs: Any) -> GetMarginModeResp: - return self.transport.call("futures", False, "GET", - "/api/v2/position/getMarginMode", req, - GetMarginModeResp(), False, **kwargs) + def modify_auto_deposit_status( + self, req: ModifyAutoDepositStatusReq, + **kwargs: Any) -> ModifyAutoDepositStatusResp: + return self.transport.call( + "futures", False, "POST", + "/api/v1/position/margin/auto-deposit-status", req, + ModifyAutoDepositStatusResp(), False, **kwargs) diff --git a/sdk/python/kucoin_universal_sdk/generate/futures/positions/api_positions.template b/sdk/python/kucoin_universal_sdk/generate/futures/positions/api_positions.template index 7072abdc..fadf66b5 100644 --- a/sdk/python/kucoin_universal_sdk/generate/futures/positions/api_positions.template +++ b/sdk/python/kucoin_universal_sdk/generate/futures/positions/api_positions.template @@ -1,37 +1,18 @@ # API FUNCTION TEMPLATE -def test_get_isolated_margin_risk_limit_req(self): +def test_get_margin_mode_req(self): """ - get_isolated_margin_risk_limit - Get Isolated Margin Risk Limit - /api/v1/contracts/risk-limit/{symbol} + get_margin_mode + Get Margin Mode + /api/v2/position/getMarginMode """ - builder = GetIsolatedMarginRiskLimitReqBuilder() + builder = GetMarginModeReqBuilder() builder.set_symbol(?) req = builder.build() try: - resp = self.api.get_isolated_margin_risk_limit(req) - print("code: ", resp.common_response.code) - print("msg: ", resp.common_response.message) - print("data: ", resp.to_json()) - except Exception as e: - print("error: ", e) - raise e - -def test_get_positions_history_req(self): - """ - get_positions_history - Get Positions History - /api/v1/history-positions - """ - - builder = GetPositionsHistoryReqBuilder() - builder.set_symbol(?).set_from_(?).set_to(?).set_limit(?).set_page_id(?) - req = builder.build() - try: - resp = self.api.get_positions_history(req) + resp = self.api.get_margin_mode(req) print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) @@ -39,18 +20,18 @@ def test_get_positions_history_req(self): print("error: ", e) raise e -def test_get_max_withdraw_margin_req(self): +def test_switch_margin_mode_req(self): """ - get_max_withdraw_margin - Get Max Withdraw Margin - /api/v1/margin/maxWithdrawMargin + switch_margin_mode + Switch Margin Mode + /api/v2/position/changeMarginMode """ - builder = GetMaxWithdrawMarginReqBuilder() - builder.set_symbol(?) + builder = SwitchMarginModeReqBuilder() + builder.set_symbol(?).set_margin_mode(?) req = builder.build() try: - resp = self.api.get_max_withdraw_margin(req) + resp = self.api.switch_margin_mode(req) print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) @@ -58,18 +39,18 @@ def test_get_max_withdraw_margin_req(self): print("error: ", e) raise e -def test_remove_isolated_margin_req(self): +def test_get_max_open_size_req(self): """ - remove_isolated_margin - Remove Isolated Margin - /api/v1/margin/withdrawMargin + get_max_open_size + Get Max Open Size + /api/v2/getMaxOpenSize """ - builder = RemoveIsolatedMarginReqBuilder() - builder.set_symbol(?).set_withdraw_amount(?) + builder = GetMaxOpenSizeReqBuilder() + builder.set_symbol(?).set_price(?).set_leverage(?) req = builder.build() try: - resp = self.api.remove_isolated_margin(req) + resp = self.api.get_max_open_size(req) print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) @@ -96,18 +77,18 @@ def test_get_position_details_req(self): print("error: ", e) raise e -def test_modify_auto_deposit_status_req(self): +def test_get_position_list_req(self): """ - modify_auto_deposit_status - Modify Isolated Margin Auto-Deposit Status - /api/v1/position/margin/auto-deposit-status + get_position_list + Get Position List + /api/v1/positions """ - builder = ModifyAutoDepositStatusReqBuilder() - builder.set_symbol(?).set_status(?) + builder = GetPositionListReqBuilder() + builder.set_currency(?) req = builder.build() try: - resp = self.api.modify_auto_deposit_status(req) + resp = self.api.get_position_list(req) print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) @@ -115,18 +96,18 @@ def test_modify_auto_deposit_status_req(self): print("error: ", e) raise e -def test_add_isolated_margin_req(self): +def test_get_positions_history_req(self): """ - add_isolated_margin - Add Isolated Margin - /api/v1/position/margin/deposit-margin + get_positions_history + Get Positions History + /api/v1/history-positions """ - builder = AddIsolatedMarginReqBuilder() - builder.set_symbol(?).set_margin(?).set_biz_no(?) + builder = GetPositionsHistoryReqBuilder() + builder.set_symbol(?).set_from_(?).set_to(?).set_limit(?).set_page_id(?) req = builder.build() try: - resp = self.api.add_isolated_margin(req) + resp = self.api.get_positions_history(req) print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) @@ -134,18 +115,18 @@ def test_add_isolated_margin_req(self): print("error: ", e) raise e -def test_modify_isolated_margin_risk_limt_req(self): +def test_get_max_withdraw_margin_req(self): """ - modify_isolated_margin_risk_limt - Modify Isolated Margin Risk Limit - /api/v1/position/risk-limit-level/change + get_max_withdraw_margin + Get Max Withdraw Margin + /api/v1/margin/maxWithdrawMargin """ - builder = ModifyIsolatedMarginRiskLimtReqBuilder() - builder.set_symbol(?).set_level(?) + builder = GetMaxWithdrawMarginReqBuilder() + builder.set_symbol(?) req = builder.build() try: - resp = self.api.modify_isolated_margin_risk_limt(req) + resp = self.api.get_max_withdraw_margin(req) print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) @@ -153,18 +134,18 @@ def test_modify_isolated_margin_risk_limt_req(self): print("error: ", e) raise e -def test_get_position_list_req(self): +def test_get_cross_margin_leverage_req(self): """ - get_position_list - Get Position List - /api/v1/positions + get_cross_margin_leverage + Get Cross Margin Leverage + /api/v2/getCrossUserLeverage """ - builder = GetPositionListReqBuilder() - builder.set_currency(?) + builder = GetCrossMarginLeverageReqBuilder() + builder.set_symbol(?) req = builder.build() try: - resp = self.api.get_position_list(req) + resp = self.api.get_cross_margin_leverage(req) print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) @@ -191,18 +172,18 @@ def test_modify_margin_leverage_req(self): print("error: ", e) raise e -def test_get_cross_margin_leverage_req(self): +def test_add_isolated_margin_req(self): """ - get_cross_margin_leverage - Get Cross Margin Leverage - /api/v2/getCrossUserLeverage + add_isolated_margin + Add Isolated Margin + /api/v1/position/margin/deposit-margin """ - builder = GetCrossMarginLeverageReqBuilder() - builder.set_symbol(?) + builder = AddIsolatedMarginReqBuilder() + builder.set_symbol(?).set_margin(?).set_biz_no(?) req = builder.build() try: - resp = self.api.get_cross_margin_leverage(req) + resp = self.api.add_isolated_margin(req) print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) @@ -210,18 +191,18 @@ def test_get_cross_margin_leverage_req(self): print("error: ", e) raise e -def test_get_max_open_size_req(self): +def test_remove_isolated_margin_req(self): """ - get_max_open_size - Get Max Open Size - /api/v2/getMaxOpenSize + remove_isolated_margin + Remove Isolated Margin + /api/v1/margin/withdrawMargin """ - builder = GetMaxOpenSizeReqBuilder() - builder.set_symbol(?).set_price(?).set_leverage(?) + builder = RemoveIsolatedMarginReqBuilder() + builder.set_symbol(?).set_withdraw_amount(?) req = builder.build() try: - resp = self.api.get_max_open_size(req) + resp = self.api.remove_isolated_margin(req) print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) @@ -229,18 +210,18 @@ def test_get_max_open_size_req(self): print("error: ", e) raise e -def test_switch_margin_mode_req(self): +def test_get_isolated_margin_risk_limit_req(self): """ - switch_margin_mode - Switch Margin Mode - /api/v2/position/changeMarginMode + get_isolated_margin_risk_limit + Get Isolated Margin Risk Limit + /api/v1/contracts/risk-limit/{symbol} """ - builder = SwitchMarginModeReqBuilder() - builder.set_symbol(?).set_margin_mode(?) + builder = GetIsolatedMarginRiskLimitReqBuilder() + builder.set_symbol(?) req = builder.build() try: - resp = self.api.switch_margin_mode(req) + resp = self.api.get_isolated_margin_risk_limit(req) print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) @@ -248,18 +229,37 @@ def test_switch_margin_mode_req(self): print("error: ", e) raise e -def test_get_margin_mode_req(self): +def test_modify_isolated_margin_risk_limt_req(self): """ - get_margin_mode - Get Margin Mode - /api/v2/position/getMarginMode + modify_isolated_margin_risk_limt + Modify Isolated Margin Risk Limit + /api/v1/position/risk-limit-level/change """ - builder = GetMarginModeReqBuilder() - builder.set_symbol(?) + builder = ModifyIsolatedMarginRiskLimtReqBuilder() + builder.set_symbol(?).set_level(?) req = builder.build() try: - resp = self.api.get_margin_mode(req) + resp = self.api.modify_isolated_margin_risk_limt(req) + print("code: ", resp.common_response.code) + print("msg: ", resp.common_response.message) + print("data: ", resp.to_json()) + except Exception as e: + print("error: ", e) + raise e + +def test_modify_auto_deposit_status_req(self): + """ + modify_auto_deposit_status + Modify Isolated Margin Auto-Deposit Status + /api/v1/position/margin/auto-deposit-status + """ + + builder = ModifyAutoDepositStatusReqBuilder() + builder.set_symbol(?).set_status(?) + req = builder.build() + try: + resp = self.api.modify_auto_deposit_status(req) print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) diff --git a/sdk/python/kucoin_universal_sdk/generate/futures/positions/api_positions_test.py b/sdk/python/kucoin_universal_sdk/generate/futures/positions/api_positions_test.py index 92ee5224..3d6e67ee 100644 --- a/sdk/python/kucoin_universal_sdk/generate/futures/positions/api_positions_test.py +++ b/sdk/python/kucoin_universal_sdk/generate/futures/positions/api_positions_test.py @@ -33,81 +33,62 @@ class PositionsAPITest(unittest.TestCase): - def test_get_isolated_margin_risk_limit_req_model(self): + def test_get_margin_mode_req_model(self): """ - get_isolated_margin_risk_limit - Get Isolated Margin Risk Limit - /api/v1/contracts/risk-limit/{symbol} + get_margin_mode + Get Margin Mode + /api/v2/position/getMarginMode """ data = "{\"symbol\": \"XBTUSDTM\"}" - req = GetIsolatedMarginRiskLimitReq.from_json(data) - - def test_get_isolated_margin_risk_limit_resp_model(self): - """ - get_isolated_margin_risk_limit - Get Isolated Margin Risk Limit - /api/v1/contracts/risk-limit/{symbol} - """ - data = "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"symbol\": \"XBTUSDTM\",\n \"level\": 1,\n \"maxRiskLimit\": 100000,\n \"minRiskLimit\": 0,\n \"maxLeverage\": 125,\n \"initialMargin\": 0.008,\n \"maintainMargin\": 0.004\n },\n {\n \"symbol\": \"XBTUSDTM\",\n \"level\": 2,\n \"maxRiskLimit\": 500000,\n \"minRiskLimit\": 100000,\n \"maxLeverage\": 100,\n \"initialMargin\": 0.01,\n \"maintainMargin\": 0.005\n },\n {\n \"symbol\": \"XBTUSDTM\",\n \"level\": 3,\n \"maxRiskLimit\": 1000000,\n \"minRiskLimit\": 500000,\n \"maxLeverage\": 75,\n \"initialMargin\": 0.014,\n \"maintainMargin\": 0.007\n },\n {\n \"symbol\": \"XBTUSDTM\",\n \"level\": 4,\n \"maxRiskLimit\": 2000000,\n \"minRiskLimit\": 1000000,\n \"maxLeverage\": 50,\n \"initialMargin\": 0.02,\n \"maintainMargin\": 0.01\n },\n {\n \"symbol\": \"XBTUSDTM\",\n \"level\": 5,\n \"maxRiskLimit\": 3000000,\n \"minRiskLimit\": 2000000,\n \"maxLeverage\": 30,\n \"initialMargin\": 0.034,\n \"maintainMargin\": 0.017\n },\n {\n \"symbol\": \"XBTUSDTM\",\n \"level\": 6,\n \"maxRiskLimit\": 5000000,\n \"minRiskLimit\": 3000000,\n \"maxLeverage\": 20,\n \"initialMargin\": 0.05,\n \"maintainMargin\": 0.025\n },\n {\n \"symbol\": \"XBTUSDTM\",\n \"level\": 7,\n \"maxRiskLimit\": 8000000,\n \"minRiskLimit\": 5000000,\n \"maxLeverage\": 10,\n \"initialMargin\": 0.1,\n \"maintainMargin\": 0.05\n },\n {\n \"symbol\": \"XBTUSDTM\",\n \"level\": 8,\n \"maxRiskLimit\": 12000000,\n \"minRiskLimit\": 8000000,\n \"maxLeverage\": 5,\n \"initialMargin\": 0.2,\n \"maintainMargin\": 0.1\n },\n {\n \"symbol\": \"XBTUSDTM\",\n \"level\": 9,\n \"maxRiskLimit\": 20000000,\n \"minRiskLimit\": 12000000,\n \"maxLeverage\": 4,\n \"initialMargin\": 0.25,\n \"maintainMargin\": 0.125\n },\n {\n \"symbol\": \"XBTUSDTM\",\n \"level\": 10,\n \"maxRiskLimit\": 30000000,\n \"minRiskLimit\": 20000000,\n \"maxLeverage\": 3,\n \"initialMargin\": 0.334,\n \"maintainMargin\": 0.167\n },\n {\n \"symbol\": \"XBTUSDTM\",\n \"level\": 11,\n \"maxRiskLimit\": 40000000,\n \"minRiskLimit\": 30000000,\n \"maxLeverage\": 2,\n \"initialMargin\": 0.5,\n \"maintainMargin\": 0.25\n },\n {\n \"symbol\": \"XBTUSDTM\",\n \"level\": 12,\n \"maxRiskLimit\": 50000000,\n \"minRiskLimit\": 40000000,\n \"maxLeverage\": 1,\n \"initialMargin\": 1.0,\n \"maintainMargin\": 0.5\n }\n ]\n}" - common_response = RestResponse.from_json(data) - resp = GetIsolatedMarginRiskLimitResp.from_dict(common_response.data) - - def test_get_positions_history_req_model(self): - """ - get_positions_history - Get Positions History - /api/v1/history-positions - """ - data = "{\"symbol\": \"example_string_default_value\", \"from\": 123456, \"to\": 123456, \"limit\": 10, \"pageId\": 1}" - req = GetPositionsHistoryReq.from_json(data) + req = GetMarginModeReq.from_json(data) - def test_get_positions_history_resp_model(self): + def test_get_margin_mode_resp_model(self): """ - get_positions_history - Get Positions History - /api/v1/history-positions + get_margin_mode + Get Margin Mode + /api/v2/position/getMarginMode """ - data = "{\n \"code\": \"200000\",\n \"data\": {\n \"currentPage\": 1,\n \"pageSize\": 10,\n \"totalNum\": 3,\n \"totalPage\": 1,\n \"items\": [\n {\n \"closeId\": \"500000000027312193\",\n \"userId\": \"633559791e1cbc0001f319bc\",\n \"symbol\": \"XBTUSDTM\",\n \"settleCurrency\": \"USDT\",\n \"leverage\": \"0.0\",\n \"type\": \"CLOSE_SHORT\",\n \"pnl\": \"-3.79237944\",\n \"realisedGrossCost\": \"3.795\",\n \"withdrawPnl\": \"0.0\",\n \"tradeFee\": \"0.078657\",\n \"fundingFee\": \"0.08127756\",\n \"openTime\": 1727073653603,\n \"closeTime\": 1729155587945,\n \"openPrice\": \"63650.0\",\n \"closePrice\": \"67445.0\",\n \"marginMode\": \"ISOLATED\"\n },\n {\n \"closeId\": \"500000000026809668\",\n \"userId\": \"633559791e1cbc0001f319bc\",\n \"symbol\": \"SUIUSDTM\",\n \"settleCurrency\": \"USDT\",\n \"leverage\": \"0.0\",\n \"type\": \"LIQUID_SHORT\",\n \"pnl\": \"-1.10919296\",\n \"realisedGrossCost\": \"1.11297635\",\n \"withdrawPnl\": \"0.0\",\n \"tradeFee\": \"0.00200295\",\n \"fundingFee\": \"0.00578634\",\n \"openTime\": 1726473389296,\n \"closeTime\": 1728738683541,\n \"openPrice\": \"1.1072\",\n \"closePrice\": \"2.22017635\",\n \"marginMode\": \"ISOLATED\"\n },\n {\n \"closeId\": \"500000000026819355\",\n \"userId\": \"633559791e1cbc0001f319bc\",\n \"symbol\": \"XBTUSDTM\",\n \"settleCurrency\": \"USDT\",\n \"leverage\": \"0.0\",\n \"type\": \"LIQUID_SHORT\",\n \"pnl\": \"-5.941896296\",\n \"realisedGrossCost\": \"5.86937042\",\n \"withdrawPnl\": \"0.0\",\n \"tradeFee\": \"0.074020096\",\n \"fundingFee\": \"0.00149422\",\n \"openTime\": 1726490775358,\n \"closeTime\": 1727061049859,\n \"openPrice\": \"58679.6\",\n \"closePrice\": \"64548.97042\",\n \"marginMode\": \"ISOLATED\"\n }\n ]\n }\n}" + data = "{\n \"code\": \"200000\",\n \"data\": {\n \"symbol\": \"XBTUSDTM\",\n \"marginMode\": \"ISOLATED\"\n }\n}" common_response = RestResponse.from_json(data) - resp = GetPositionsHistoryResp.from_dict(common_response.data) + resp = GetMarginModeResp.from_dict(common_response.data) - def test_get_max_withdraw_margin_req_model(self): + def test_switch_margin_mode_req_model(self): """ - get_max_withdraw_margin - Get Max Withdraw Margin - /api/v1/margin/maxWithdrawMargin + switch_margin_mode + Switch Margin Mode + /api/v2/position/changeMarginMode """ - data = "{\"symbol\": \"example_string_default_value\"}" - req = GetMaxWithdrawMarginReq.from_json(data) + data = "{\"symbol\": \"XBTUSDTM\", \"marginMode\": \"ISOLATED\"}" + req = SwitchMarginModeReq.from_json(data) - def test_get_max_withdraw_margin_resp_model(self): + def test_switch_margin_mode_resp_model(self): """ - get_max_withdraw_margin - Get Max Withdraw Margin - /api/v1/margin/maxWithdrawMargin + switch_margin_mode + Switch Margin Mode + /api/v2/position/changeMarginMode """ - data = "{\n \"code\": \"200000\",\n \"data\": \"21.1135719252\"\n}" + data = "{\n \"code\": \"200000\",\n \"data\": {\n \"symbol\": \"XBTUSDTM\",\n \"marginMode\": \"ISOLATED\"\n }\n}" common_response = RestResponse.from_json(data) - resp = GetMaxWithdrawMarginResp.from_dict(common_response.data) + resp = SwitchMarginModeResp.from_dict(common_response.data) - def test_remove_isolated_margin_req_model(self): + def test_get_max_open_size_req_model(self): """ - remove_isolated_margin - Remove Isolated Margin - /api/v1/margin/withdrawMargin + get_max_open_size + Get Max Open Size + /api/v2/getMaxOpenSize """ - data = "{\"symbol\": \"XBTUSDTM\", \"withdrawAmount\": \"0.0000001\"}" - req = RemoveIsolatedMarginReq.from_json(data) + data = "{\"symbol\": \"XBTUSDTM\", \"price\": \"example_string_default_value\", \"leverage\": 123456}" + req = GetMaxOpenSizeReq.from_json(data) - def test_remove_isolated_margin_resp_model(self): + def test_get_max_open_size_resp_model(self): """ - remove_isolated_margin - Remove Isolated Margin - /api/v1/margin/withdrawMargin + get_max_open_size + Get Max Open Size + /api/v2/getMaxOpenSize """ - data = "{\n \"code\": \"200000\",\n \"data\": \"0.1\"\n}" + data = "{\n \"code\": \"200000\",\n \"data\": {\n \"symbol\": \"XBTUSDTM\",\n \"maxBuyOpenSize\": 0,\n \"maxSellOpenSize\": 0\n }\n}" common_response = RestResponse.from_json(data) - resp = RemoveIsolatedMarginResp.from_dict(common_response.data) + resp = GetMaxOpenSizeResp.from_dict(common_response.data) def test_get_position_details_req_model(self): """ @@ -128,81 +109,81 @@ def test_get_position_details_resp_model(self): common_response = RestResponse.from_json(data) resp = GetPositionDetailsResp.from_dict(common_response.data) - def test_modify_auto_deposit_status_req_model(self): + def test_get_position_list_req_model(self): """ - modify_auto_deposit_status - Modify Isolated Margin Auto-Deposit Status - /api/v1/position/margin/auto-deposit-status + get_position_list + Get Position List + /api/v1/positions """ - data = "{\"symbol\": \"XBTUSDTM\", \"status\": true}" - req = ModifyAutoDepositStatusReq.from_json(data) + data = "{\"currency\": \"USDT\"}" + req = GetPositionListReq.from_json(data) - def test_modify_auto_deposit_status_resp_model(self): + def test_get_position_list_resp_model(self): """ - modify_auto_deposit_status - Modify Isolated Margin Auto-Deposit Status - /api/v1/position/margin/auto-deposit-status + get_position_list + Get Position List + /api/v1/positions """ - data = "{\n \"code\": \"200000\",\n \"data\": true\n}" + data = "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"id\": \"500000000001046430\",\n \"symbol\": \"ETHUSDM\",\n \"crossMode\": true,\n \"delevPercentage\": 0.71,\n \"openingTimestamp\": 1730635780702,\n \"currentTimestamp\": 1730636040926,\n \"currentQty\": 1,\n \"currentCost\": -4.069805E-4,\n \"currentComm\": 2.441E-7,\n \"unrealisedCost\": -4.069805E-4,\n \"realisedGrossCost\": 0.0,\n \"realisedCost\": 2.441E-7,\n \"isOpen\": true,\n \"markPrice\": 2454.12,\n \"markValue\": -4.07478E-4,\n \"posCost\": -4.069805E-4,\n \"posInit\": 4.06981E-5,\n \"posMargin\": 4.07478E-5,\n \"realisedGrossPnl\": 0.0,\n \"realisedPnl\": -2.441E-7,\n \"unrealisedPnl\": -4.975E-7,\n \"unrealisedPnlPcnt\": -0.0012,\n \"unrealisedRoePcnt\": -0.0122,\n \"avgEntryPrice\": 2457.12,\n \"liquidationPrice\": 1429.96,\n \"bankruptPrice\": 1414.96,\n \"settleCurrency\": \"ETH\",\n \"isInverse\": true,\n \"marginMode\": \"CROSS\",\n \"positionSide\": \"BOTH\",\n \"leverage\": 10\n },\n {\n \"id\": \"500000000000988255\",\n \"symbol\": \"XBTUSDTM\",\n \"autoDeposit\": true,\n \"crossMode\": false,\n \"maintMarginReq\": 0.005,\n \"riskLimit\": 500000,\n \"realLeverage\": 2.97,\n \"delevPercentage\": 0.5,\n \"openingTimestamp\": 1729155616322,\n \"currentTimestamp\": 1730636040926,\n \"currentQty\": 1,\n \"currentCost\": 67.4309,\n \"currentComm\": -0.15936162,\n \"unrealisedCost\": 67.4309,\n \"realisedGrossCost\": 0.0,\n \"realisedCost\": -0.15936162,\n \"isOpen\": true,\n \"markPrice\": 68323.06,\n \"markValue\": 68.32306,\n \"posCost\": 67.4309,\n \"posCross\": 0.06225152,\n \"posCrossMargin\": 0,\n \"posInit\": 22.2769666644,\n \"posComm\": 0.0539821899,\n \"posCommCommon\": 0.0539447199,\n \"posLoss\": 0.26210915,\n \"posMargin\": 22.1310912243,\n \"posFunding\": -0.19982016,\n \"posMaint\": 0.4046228699,\n \"maintMargin\": 23.0232512243,\n \"realisedGrossPnl\": 0.0,\n \"realisedPnl\": -0.2402787,\n \"unrealisedPnl\": 0.89216,\n \"unrealisedPnlPcnt\": 0.0132,\n \"unrealisedRoePcnt\": 0.04,\n \"avgEntryPrice\": 67430.9,\n \"liquidationPrice\": 45704.44,\n \"bankruptPrice\": 45353.8,\n \"settleCurrency\": \"USDT\",\n \"isInverse\": false,\n \"maintainMargin\": 0.005,\n \"marginMode\": \"ISOLATED\",\n \"positionSide\": \"BOTH\",\n \"leverage\": 2.97\n }\n ]\n}" common_response = RestResponse.from_json(data) - resp = ModifyAutoDepositStatusResp.from_dict(common_response.data) + resp = GetPositionListResp.from_dict(common_response.data) - def test_add_isolated_margin_req_model(self): + def test_get_positions_history_req_model(self): """ - add_isolated_margin - Add Isolated Margin - /api/v1/position/margin/deposit-margin + get_positions_history + Get Positions History + /api/v1/history-positions """ - data = "{\"symbol\": \"string\", \"margin\": 0, \"bizNo\": \"string\"}" - req = AddIsolatedMarginReq.from_json(data) + data = "{\"symbol\": \"example_string_default_value\", \"from\": 123456, \"to\": 123456, \"limit\": 10, \"pageId\": 1}" + req = GetPositionsHistoryReq.from_json(data) - def test_add_isolated_margin_resp_model(self): + def test_get_positions_history_resp_model(self): """ - add_isolated_margin - Add Isolated Margin - /api/v1/position/margin/deposit-margin + get_positions_history + Get Positions History + /api/v1/history-positions """ - data = "{\n \"code\": \"200000\",\n \"data\": {\n \"id\": \"6200c9b83aecfb000152ddcd\",\n \"symbol\": \"XBTUSDTM\",\n \"autoDeposit\": false,\n \"maintMarginReq\": 0.005,\n \"riskLimit\": 500000,\n \"realLeverage\": 18.72,\n \"crossMode\": false,\n \"delevPercentage\": 0.66,\n \"openingTimestamp\": 1646287090131,\n \"currentTimestamp\": 1646295055021,\n \"currentQty\": 1,\n \"currentCost\": 43.388,\n \"currentComm\": 0.0260328,\n \"unrealisedCost\": 43.388,\n \"realisedGrossCost\": 0,\n \"realisedCost\": 0.0260328,\n \"isOpen\": true,\n \"markPrice\": 43536.65,\n \"markValue\": 43.53665,\n \"posCost\": 43.388,\n \"posCross\": 0.000024985,\n \"posInit\": 2.1694,\n \"posComm\": 0.02733446,\n \"posLoss\": 0,\n \"posMargin\": 2.19675944,\n \"posMaint\": 0.24861326,\n \"maintMargin\": 2.34540944,\n \"realisedGrossPnl\": 0,\n \"realisedPnl\": -0.0260328,\n \"unrealisedPnl\": 0.14865,\n \"unrealisedPnlPcnt\": 0.0034,\n \"unrealisedRoePcnt\": 0.0685,\n \"avgEntryPrice\": 43388,\n \"liquidationPrice\": 41440,\n \"bankruptPrice\": 41218,\n \"userId\": 1234321123,\n \"settleCurrency\": \"USDT\"\n }\n}" + data = "{\n \"code\": \"200000\",\n \"data\": {\n \"currentPage\": 1,\n \"pageSize\": 10,\n \"totalNum\": 3,\n \"totalPage\": 1,\n \"items\": [\n {\n \"closeId\": \"500000000027312193\",\n \"userId\": \"633559791e1cbc0001f319bc\",\n \"symbol\": \"XBTUSDTM\",\n \"settleCurrency\": \"USDT\",\n \"leverage\": \"0.0\",\n \"type\": \"CLOSE_SHORT\",\n \"pnl\": \"-3.79237944\",\n \"realisedGrossCost\": \"3.795\",\n \"withdrawPnl\": \"0.0\",\n \"tradeFee\": \"0.078657\",\n \"fundingFee\": \"0.08127756\",\n \"openTime\": 1727073653603,\n \"closeTime\": 1729155587945,\n \"openPrice\": \"63650.0\",\n \"closePrice\": \"67445.0\",\n \"marginMode\": \"ISOLATED\"\n },\n {\n \"closeId\": \"500000000026809668\",\n \"userId\": \"633559791e1cbc0001f319bc\",\n \"symbol\": \"SUIUSDTM\",\n \"settleCurrency\": \"USDT\",\n \"leverage\": \"0.0\",\n \"type\": \"LIQUID_SHORT\",\n \"pnl\": \"-1.10919296\",\n \"realisedGrossCost\": \"1.11297635\",\n \"withdrawPnl\": \"0.0\",\n \"tradeFee\": \"0.00200295\",\n \"fundingFee\": \"0.00578634\",\n \"openTime\": 1726473389296,\n \"closeTime\": 1728738683541,\n \"openPrice\": \"1.1072\",\n \"closePrice\": \"2.22017635\",\n \"marginMode\": \"ISOLATED\"\n },\n {\n \"closeId\": \"500000000026819355\",\n \"userId\": \"633559791e1cbc0001f319bc\",\n \"symbol\": \"XBTUSDTM\",\n \"settleCurrency\": \"USDT\",\n \"leverage\": \"0.0\",\n \"type\": \"LIQUID_SHORT\",\n \"pnl\": \"-5.941896296\",\n \"realisedGrossCost\": \"5.86937042\",\n \"withdrawPnl\": \"0.0\",\n \"tradeFee\": \"0.074020096\",\n \"fundingFee\": \"0.00149422\",\n \"openTime\": 1726490775358,\n \"closeTime\": 1727061049859,\n \"openPrice\": \"58679.6\",\n \"closePrice\": \"64548.97042\",\n \"marginMode\": \"ISOLATED\"\n }\n ]\n }\n}" common_response = RestResponse.from_json(data) - resp = AddIsolatedMarginResp.from_dict(common_response.data) + resp = GetPositionsHistoryResp.from_dict(common_response.data) - def test_modify_isolated_margin_risk_limt_req_model(self): + def test_get_max_withdraw_margin_req_model(self): """ - modify_isolated_margin_risk_limt - Modify Isolated Margin Risk Limit - /api/v1/position/risk-limit-level/change + get_max_withdraw_margin + Get Max Withdraw Margin + /api/v1/margin/maxWithdrawMargin """ - data = "{\"symbol\": \"XBTUSDTM\", \"level\": 2}" - req = ModifyIsolatedMarginRiskLimtReq.from_json(data) + data = "{\"symbol\": \"example_string_default_value\"}" + req = GetMaxWithdrawMarginReq.from_json(data) - def test_modify_isolated_margin_risk_limt_resp_model(self): + def test_get_max_withdraw_margin_resp_model(self): """ - modify_isolated_margin_risk_limt - Modify Isolated Margin Risk Limit - /api/v1/position/risk-limit-level/change + get_max_withdraw_margin + Get Max Withdraw Margin + /api/v1/margin/maxWithdrawMargin """ - data = "{\n \"code\": \"200000\",\n \"data\": true\n}" + data = "{\n \"code\": \"200000\",\n \"data\": \"21.1135719252\"\n}" common_response = RestResponse.from_json(data) - resp = ModifyIsolatedMarginRiskLimtResp.from_dict(common_response.data) + resp = GetMaxWithdrawMarginResp.from_dict(common_response.data) - def test_get_position_list_req_model(self): + def test_get_cross_margin_leverage_req_model(self): """ - get_position_list - Get Position List - /api/v1/positions + get_cross_margin_leverage + Get Cross Margin Leverage + /api/v2/getCrossUserLeverage """ - data = "{\"currency\": \"USDT\"}" - req = GetPositionListReq.from_json(data) + data = "{\"symbol\": \"XBTUSDTM\"}" + req = GetCrossMarginLeverageReq.from_json(data) - def test_get_position_list_resp_model(self): + def test_get_cross_margin_leverage_resp_model(self): """ - get_position_list - Get Position List - /api/v1/positions + get_cross_margin_leverage + Get Cross Margin Leverage + /api/v2/getCrossUserLeverage """ - data = "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"id\": \"500000000001046430\",\n \"symbol\": \"ETHUSDM\",\n \"crossMode\": true,\n \"delevPercentage\": 0.71,\n \"openingTimestamp\": 1730635780702,\n \"currentTimestamp\": 1730636040926,\n \"currentQty\": 1,\n \"currentCost\": -4.069805E-4,\n \"currentComm\": 2.441E-7,\n \"unrealisedCost\": -4.069805E-4,\n \"realisedGrossCost\": 0.0,\n \"realisedCost\": 2.441E-7,\n \"isOpen\": true,\n \"markPrice\": 2454.12,\n \"markValue\": -4.07478E-4,\n \"posCost\": -4.069805E-4,\n \"posInit\": 4.06981E-5,\n \"posMargin\": 4.07478E-5,\n \"realisedGrossPnl\": 0.0,\n \"realisedPnl\": -2.441E-7,\n \"unrealisedPnl\": -4.975E-7,\n \"unrealisedPnlPcnt\": -0.0012,\n \"unrealisedRoePcnt\": -0.0122,\n \"avgEntryPrice\": 2457.12,\n \"liquidationPrice\": 1429.96,\n \"bankruptPrice\": 1414.96,\n \"settleCurrency\": \"ETH\",\n \"isInverse\": true,\n \"marginMode\": \"CROSS\",\n \"positionSide\": \"BOTH\",\n \"leverage\": 10\n },\n {\n \"id\": \"500000000000988255\",\n \"symbol\": \"XBTUSDTM\",\n \"autoDeposit\": true,\n \"crossMode\": false,\n \"maintMarginReq\": 0.005,\n \"riskLimit\": 500000,\n \"realLeverage\": 2.97,\n \"delevPercentage\": 0.5,\n \"openingTimestamp\": 1729155616322,\n \"currentTimestamp\": 1730636040926,\n \"currentQty\": 1,\n \"currentCost\": 67.4309,\n \"currentComm\": -0.15936162,\n \"unrealisedCost\": 67.4309,\n \"realisedGrossCost\": 0.0,\n \"realisedCost\": -0.15936162,\n \"isOpen\": true,\n \"markPrice\": 68323.06,\n \"markValue\": 68.32306,\n \"posCost\": 67.4309,\n \"posCross\": 0.06225152,\n \"posCrossMargin\": 0,\n \"posInit\": 22.2769666644,\n \"posComm\": 0.0539821899,\n \"posCommCommon\": 0.0539447199,\n \"posLoss\": 0.26210915,\n \"posMargin\": 22.1310912243,\n \"posFunding\": -0.19982016,\n \"posMaint\": 0.4046228699,\n \"maintMargin\": 23.0232512243,\n \"realisedGrossPnl\": 0.0,\n \"realisedPnl\": -0.2402787,\n \"unrealisedPnl\": 0.89216,\n \"unrealisedPnlPcnt\": 0.0132,\n \"unrealisedRoePcnt\": 0.04,\n \"avgEntryPrice\": 67430.9,\n \"liquidationPrice\": 45704.44,\n \"bankruptPrice\": 45353.8,\n \"settleCurrency\": \"USDT\",\n \"isInverse\": false,\n \"maintainMargin\": 0.005,\n \"marginMode\": \"ISOLATED\",\n \"positionSide\": \"BOTH\",\n \"leverage\": 2.97\n }\n ]\n}" + data = "{\n \"code\": \"200000\",\n \"data\": {\n \"symbol\": \"XBTUSDTM\",\n \"leverage\": \"3\"\n }\n}" common_response = RestResponse.from_json(data) - resp = GetPositionListResp.from_dict(common_response.data) + resp = GetCrossMarginLeverageResp.from_dict(common_response.data) def test_modify_margin_leverage_req_model(self): """ @@ -223,78 +204,97 @@ def test_modify_margin_leverage_resp_model(self): common_response = RestResponse.from_json(data) resp = ModifyMarginLeverageResp.from_dict(common_response.data) - def test_get_cross_margin_leverage_req_model(self): + def test_add_isolated_margin_req_model(self): """ - get_cross_margin_leverage - Get Cross Margin Leverage - /api/v2/getCrossUserLeverage + add_isolated_margin + Add Isolated Margin + /api/v1/position/margin/deposit-margin """ - data = "{\"symbol\": \"XBTUSDTM\"}" - req = GetCrossMarginLeverageReq.from_json(data) + data = "{\"symbol\": \"string\", \"margin\": 0, \"bizNo\": \"string\"}" + req = AddIsolatedMarginReq.from_json(data) - def test_get_cross_margin_leverage_resp_model(self): + def test_add_isolated_margin_resp_model(self): """ - get_cross_margin_leverage - Get Cross Margin Leverage - /api/v2/getCrossUserLeverage + add_isolated_margin + Add Isolated Margin + /api/v1/position/margin/deposit-margin """ - data = "{\n \"code\": \"200000\",\n \"data\": {\n \"symbol\": \"XBTUSDTM\",\n \"leverage\": \"3\"\n }\n}" + data = "{\n \"code\": \"200000\",\n \"data\": {\n \"id\": \"6200c9b83aecfb000152ddcd\",\n \"symbol\": \"XBTUSDTM\",\n \"autoDeposit\": false,\n \"maintMarginReq\": 0.005,\n \"riskLimit\": 500000,\n \"realLeverage\": 18.72,\n \"crossMode\": false,\n \"delevPercentage\": 0.66,\n \"openingTimestamp\": 1646287090131,\n \"currentTimestamp\": 1646295055021,\n \"currentQty\": 1,\n \"currentCost\": 43.388,\n \"currentComm\": 0.0260328,\n \"unrealisedCost\": 43.388,\n \"realisedGrossCost\": 0,\n \"realisedCost\": 0.0260328,\n \"isOpen\": true,\n \"markPrice\": 43536.65,\n \"markValue\": 43.53665,\n \"posCost\": 43.388,\n \"posCross\": 0.000024985,\n \"posInit\": 2.1694,\n \"posComm\": 0.02733446,\n \"posLoss\": 0,\n \"posMargin\": 2.19675944,\n \"posMaint\": 0.24861326,\n \"maintMargin\": 2.34540944,\n \"realisedGrossPnl\": 0,\n \"realisedPnl\": -0.0260328,\n \"unrealisedPnl\": 0.14865,\n \"unrealisedPnlPcnt\": 0.0034,\n \"unrealisedRoePcnt\": 0.0685,\n \"avgEntryPrice\": 43388,\n \"liquidationPrice\": 41440,\n \"bankruptPrice\": 41218,\n \"userId\": 1234321123,\n \"settleCurrency\": \"USDT\"\n }\n}" common_response = RestResponse.from_json(data) - resp = GetCrossMarginLeverageResp.from_dict(common_response.data) + resp = AddIsolatedMarginResp.from_dict(common_response.data) - def test_get_max_open_size_req_model(self): + def test_remove_isolated_margin_req_model(self): """ - get_max_open_size - Get Max Open Size - /api/v2/getMaxOpenSize + remove_isolated_margin + Remove Isolated Margin + /api/v1/margin/withdrawMargin """ - data = "{\"symbol\": \"XBTUSDTM\", \"price\": \"example_string_default_value\", \"leverage\": 123456}" - req = GetMaxOpenSizeReq.from_json(data) + data = "{\"symbol\": \"XBTUSDTM\", \"withdrawAmount\": \"0.0000001\"}" + req = RemoveIsolatedMarginReq.from_json(data) - def test_get_max_open_size_resp_model(self): + def test_remove_isolated_margin_resp_model(self): """ - get_max_open_size - Get Max Open Size - /api/v2/getMaxOpenSize + remove_isolated_margin + Remove Isolated Margin + /api/v1/margin/withdrawMargin """ - data = "{\n \"code\": \"200000\",\n \"data\": {\n \"symbol\": \"XBTUSDTM\",\n \"maxBuyOpenSize\": 0,\n \"maxSellOpenSize\": 0\n }\n}" + data = "{\n \"code\": \"200000\",\n \"data\": \"0.1\"\n}" common_response = RestResponse.from_json(data) - resp = GetMaxOpenSizeResp.from_dict(common_response.data) + resp = RemoveIsolatedMarginResp.from_dict(common_response.data) - def test_switch_margin_mode_req_model(self): + def test_get_isolated_margin_risk_limit_req_model(self): """ - switch_margin_mode - Switch Margin Mode - /api/v2/position/changeMarginMode + get_isolated_margin_risk_limit + Get Isolated Margin Risk Limit + /api/v1/contracts/risk-limit/{symbol} """ - data = "{\"symbol\": \"XBTUSDTM\", \"marginMode\": \"ISOLATED\"}" - req = SwitchMarginModeReq.from_json(data) + data = "{\"symbol\": \"XBTUSDTM\"}" + req = GetIsolatedMarginRiskLimitReq.from_json(data) - def test_switch_margin_mode_resp_model(self): + def test_get_isolated_margin_risk_limit_resp_model(self): """ - switch_margin_mode - Switch Margin Mode - /api/v2/position/changeMarginMode + get_isolated_margin_risk_limit + Get Isolated Margin Risk Limit + /api/v1/contracts/risk-limit/{symbol} """ - data = "{\n \"code\": \"200000\",\n \"data\": {\n \"symbol\": \"XBTUSDTM\",\n \"marginMode\": \"ISOLATED\"\n }\n}" + data = "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"symbol\": \"XBTUSDTM\",\n \"level\": 1,\n \"maxRiskLimit\": 100000,\n \"minRiskLimit\": 0,\n \"maxLeverage\": 125,\n \"initialMargin\": 0.008,\n \"maintainMargin\": 0.004\n },\n {\n \"symbol\": \"XBTUSDTM\",\n \"level\": 2,\n \"maxRiskLimit\": 500000,\n \"minRiskLimit\": 100000,\n \"maxLeverage\": 100,\n \"initialMargin\": 0.01,\n \"maintainMargin\": 0.005\n },\n {\n \"symbol\": \"XBTUSDTM\",\n \"level\": 3,\n \"maxRiskLimit\": 1000000,\n \"minRiskLimit\": 500000,\n \"maxLeverage\": 75,\n \"initialMargin\": 0.014,\n \"maintainMargin\": 0.007\n },\n {\n \"symbol\": \"XBTUSDTM\",\n \"level\": 4,\n \"maxRiskLimit\": 2000000,\n \"minRiskLimit\": 1000000,\n \"maxLeverage\": 50,\n \"initialMargin\": 0.02,\n \"maintainMargin\": 0.01\n },\n {\n \"symbol\": \"XBTUSDTM\",\n \"level\": 5,\n \"maxRiskLimit\": 3000000,\n \"minRiskLimit\": 2000000,\n \"maxLeverage\": 30,\n \"initialMargin\": 0.034,\n \"maintainMargin\": 0.017\n },\n {\n \"symbol\": \"XBTUSDTM\",\n \"level\": 6,\n \"maxRiskLimit\": 5000000,\n \"minRiskLimit\": 3000000,\n \"maxLeverage\": 20,\n \"initialMargin\": 0.05,\n \"maintainMargin\": 0.025\n },\n {\n \"symbol\": \"XBTUSDTM\",\n \"level\": 7,\n \"maxRiskLimit\": 8000000,\n \"minRiskLimit\": 5000000,\n \"maxLeverage\": 10,\n \"initialMargin\": 0.1,\n \"maintainMargin\": 0.05\n },\n {\n \"symbol\": \"XBTUSDTM\",\n \"level\": 8,\n \"maxRiskLimit\": 12000000,\n \"minRiskLimit\": 8000000,\n \"maxLeverage\": 5,\n \"initialMargin\": 0.2,\n \"maintainMargin\": 0.1\n },\n {\n \"symbol\": \"XBTUSDTM\",\n \"level\": 9,\n \"maxRiskLimit\": 20000000,\n \"minRiskLimit\": 12000000,\n \"maxLeverage\": 4,\n \"initialMargin\": 0.25,\n \"maintainMargin\": 0.125\n },\n {\n \"symbol\": \"XBTUSDTM\",\n \"level\": 10,\n \"maxRiskLimit\": 30000000,\n \"minRiskLimit\": 20000000,\n \"maxLeverage\": 3,\n \"initialMargin\": 0.334,\n \"maintainMargin\": 0.167\n },\n {\n \"symbol\": \"XBTUSDTM\",\n \"level\": 11,\n \"maxRiskLimit\": 40000000,\n \"minRiskLimit\": 30000000,\n \"maxLeverage\": 2,\n \"initialMargin\": 0.5,\n \"maintainMargin\": 0.25\n },\n {\n \"symbol\": \"XBTUSDTM\",\n \"level\": 12,\n \"maxRiskLimit\": 50000000,\n \"minRiskLimit\": 40000000,\n \"maxLeverage\": 1,\n \"initialMargin\": 1.0,\n \"maintainMargin\": 0.5\n }\n ]\n}" common_response = RestResponse.from_json(data) - resp = SwitchMarginModeResp.from_dict(common_response.data) + resp = GetIsolatedMarginRiskLimitResp.from_dict(common_response.data) - def test_get_margin_mode_req_model(self): + def test_modify_isolated_margin_risk_limt_req_model(self): """ - get_margin_mode - Get Margin Mode - /api/v2/position/getMarginMode + modify_isolated_margin_risk_limt + Modify Isolated Margin Risk Limit + /api/v1/position/risk-limit-level/change """ - data = "{\"symbol\": \"XBTUSDTM\"}" - req = GetMarginModeReq.from_json(data) + data = "{\"symbol\": \"XBTUSDTM\", \"level\": 2}" + req = ModifyIsolatedMarginRiskLimtReq.from_json(data) - def test_get_margin_mode_resp_model(self): + def test_modify_isolated_margin_risk_limt_resp_model(self): """ - get_margin_mode - Get Margin Mode - /api/v2/position/getMarginMode + modify_isolated_margin_risk_limt + Modify Isolated Margin Risk Limit + /api/v1/position/risk-limit-level/change """ - data = "{\n \"code\": \"200000\",\n \"data\": {\n \"symbol\": \"XBTUSDTM\",\n \"marginMode\": \"ISOLATED\"\n }\n}" + data = "{\n \"code\": \"200000\",\n \"data\": true\n}" common_response = RestResponse.from_json(data) - resp = GetMarginModeResp.from_dict(common_response.data) + resp = ModifyIsolatedMarginRiskLimtResp.from_dict(common_response.data) + + def test_modify_auto_deposit_status_req_model(self): + """ + modify_auto_deposit_status + Modify Isolated Margin Auto-Deposit Status + /api/v1/position/margin/auto-deposit-status + """ + data = "{\"symbol\": \"XBTUSDTM\", \"status\": true}" + req = ModifyAutoDepositStatusReq.from_json(data) + + def test_modify_auto_deposit_status_resp_model(self): + """ + modify_auto_deposit_status + Modify Isolated Margin Auto-Deposit Status + /api/v1/position/margin/auto-deposit-status + """ + data = "{\n \"code\": \"200000\",\n \"data\": true\n}" + common_response = RestResponse.from_json(data) + resp = ModifyAutoDepositStatusResp.from_dict(common_response.data) diff --git a/sdk/python/kucoin_universal_sdk/generate/margin/credit/api_credit.py b/sdk/python/kucoin_universal_sdk/generate/margin/credit/api_credit.py index 203878d4..0dccb386 100644 --- a/sdk/python/kucoin_universal_sdk/generate/margin/credit/api_credit.py +++ b/sdk/python/kucoin_universal_sdk/generate/margin/credit/api_credit.py @@ -21,25 +21,6 @@ class CreditAPI(ABC): - @abstractmethod - def modify_purchase(self, req: ModifyPurchaseReq, - **kwargs: Any) -> ModifyPurchaseResp: - """ - summary: Modify Purchase - description: This API endpoint is used to update the interest rates of subscription orders, which will take effect at the beginning of the next hour.,Please ensure that the funds are in the main(funding) account - documentation: https://www.kucoin.com/docs-new/api-3470217 - +---------------------+---------+ - | Extra API Info | Value | - +---------------------+---------+ - | API-DOMAIN | SPOT | - | API-CHANNEL | PRIVATE | - | API-PERMISSION | MARGIN | - | API-RATE-LIMIT-POOL | SPOT | - | API-RATE-LIMIT | 10 | - +---------------------+---------+ - """ - pass - @abstractmethod def get_loan_market(self, req: GetLoanMarketReq, **kwargs: Any) -> GetLoanMarketResp: @@ -80,30 +61,30 @@ def get_loan_market_interest_rate( pass @abstractmethod - def get_purchase_orders(self, req: GetPurchaseOrdersReq, - **kwargs: Any) -> GetPurchaseOrdersResp: + def purchase(self, req: PurchaseReq, **kwargs: Any) -> PurchaseResp: """ - summary: Get Purchase Orders - description: This API endpoint provides pagination query for the purchase orders. - documentation: https://www.kucoin.com/docs-new/api-3470213 + summary: Purchase + description: Invest credit in the market and earn interest + documentation: https://www.kucoin.com/docs-new/api-3470216 +---------------------+---------+ | Extra API Info | Value | +---------------------+---------+ | API-DOMAIN | SPOT | | API-CHANNEL | PRIVATE | - | API-PERMISSION | GENERAL | + | API-PERMISSION | MARGIN | | API-RATE-LIMIT-POOL | SPOT | - | API-RATE-LIMIT | 10 | + | API-RATE-LIMIT | 15 | +---------------------+---------+ """ pass @abstractmethod - def purchase(self, req: PurchaseReq, **kwargs: Any) -> PurchaseResp: + def modify_purchase(self, req: ModifyPurchaseReq, + **kwargs: Any) -> ModifyPurchaseResp: """ - summary: Purchase - description: Invest credit in the market and earn interest - documentation: https://www.kucoin.com/docs-new/api-3470216 + summary: Modify Purchase + description: This API endpoint is used to update the interest rates of subscription orders, which will take effect at the beginning of the next hour.,Please ensure that the funds are in the main(funding) account + documentation: https://www.kucoin.com/docs-new/api-3470217 +---------------------+---------+ | Extra API Info | Value | +---------------------+---------+ @@ -111,18 +92,18 @@ def purchase(self, req: PurchaseReq, **kwargs: Any) -> PurchaseResp: | API-CHANNEL | PRIVATE | | API-PERMISSION | MARGIN | | API-RATE-LIMIT-POOL | SPOT | - | API-RATE-LIMIT | 15 | + | API-RATE-LIMIT | 10 | +---------------------+---------+ """ pass @abstractmethod - def get_redeem_orders(self, req: GetRedeemOrdersReq, - **kwargs: Any) -> GetRedeemOrdersResp: + def get_purchase_orders(self, req: GetPurchaseOrdersReq, + **kwargs: Any) -> GetPurchaseOrdersResp: """ - summary: Get Redeem Orders - description: This API endpoint provides pagination query for the redeem orders. - documentation: https://www.kucoin.com/docs-new/api-3470214 + summary: Get Purchase Orders + description: This API endpoint provides pagination query for the purchase orders. + documentation: https://www.kucoin.com/docs-new/api-3470213 +---------------------+---------+ | Extra API Info | Value | +---------------------+---------+ @@ -153,18 +134,31 @@ def redeem(self, req: RedeemReq, **kwargs: Any) -> RedeemResp: """ pass + @abstractmethod + def get_redeem_orders(self, req: GetRedeemOrdersReq, + **kwargs: Any) -> GetRedeemOrdersResp: + """ + summary: Get Redeem Orders + description: This API endpoint provides pagination query for the redeem orders. + documentation: https://www.kucoin.com/docs-new/api-3470214 + +---------------------+---------+ + | Extra API Info | Value | + +---------------------+---------+ + | API-DOMAIN | SPOT | + | API-CHANNEL | PRIVATE | + | API-PERMISSION | GENERAL | + | API-RATE-LIMIT-POOL | SPOT | + | API-RATE-LIMIT | 10 | + +---------------------+---------+ + """ + pass + class CreditAPIImpl(CreditAPI): def __init__(self, transport: Transport): self.transport = transport - def modify_purchase(self, req: ModifyPurchaseReq, - **kwargs: Any) -> ModifyPurchaseResp: - return self.transport.call("spot", False, "POST", - "/api/v3/lend/purchase/update", req, - ModifyPurchaseResp(), False, **kwargs) - def get_loan_market(self, req: GetLoanMarketReq, **kwargs: Any) -> GetLoanMarketResp: return self.transport.call("spot", False, "GET", @@ -179,22 +173,28 @@ def get_loan_market_interest_rate( GetLoanMarketInterestRateResp(), False, **kwargs) + def purchase(self, req: PurchaseReq, **kwargs: Any) -> PurchaseResp: + return self.transport.call("spot", False, "POST", "/api/v3/purchase", + req, PurchaseResp(), False, **kwargs) + + def modify_purchase(self, req: ModifyPurchaseReq, + **kwargs: Any) -> ModifyPurchaseResp: + return self.transport.call("spot", False, "POST", + "/api/v3/lend/purchase/update", req, + ModifyPurchaseResp(), False, **kwargs) + def get_purchase_orders(self, req: GetPurchaseOrdersReq, **kwargs: Any) -> GetPurchaseOrdersResp: return self.transport.call("spot", False, "GET", "/api/v3/purchase/orders", req, GetPurchaseOrdersResp(), False, **kwargs) - def purchase(self, req: PurchaseReq, **kwargs: Any) -> PurchaseResp: - return self.transport.call("spot", False, "POST", "/api/v3/purchase", - req, PurchaseResp(), False, **kwargs) + def redeem(self, req: RedeemReq, **kwargs: Any) -> RedeemResp: + return self.transport.call("spot", False, "POST", "/api/v3/redeem", + req, RedeemResp(), False, **kwargs) def get_redeem_orders(self, req: GetRedeemOrdersReq, **kwargs: Any) -> GetRedeemOrdersResp: return self.transport.call("spot", False, "GET", "/api/v3/redeem/orders", req, GetRedeemOrdersResp(), False, **kwargs) - - def redeem(self, req: RedeemReq, **kwargs: Any) -> RedeemResp: - return self.transport.call("spot", False, "POST", "/api/v3/redeem", - req, RedeemResp(), False, **kwargs) diff --git a/sdk/python/kucoin_universal_sdk/generate/margin/credit/api_credit.template b/sdk/python/kucoin_universal_sdk/generate/margin/credit/api_credit.template index f3a42cce..291b685d 100644 --- a/sdk/python/kucoin_universal_sdk/generate/margin/credit/api_credit.template +++ b/sdk/python/kucoin_universal_sdk/generate/margin/credit/api_credit.template @@ -1,25 +1,6 @@ # API FUNCTION TEMPLATE -def test_modify_purchase_req(self): - """ - modify_purchase - Modify Purchase - /api/v3/lend/purchase/update - """ - - builder = ModifyPurchaseReqBuilder() - builder.set_currency(?).set_interest_rate(?).set_purchase_order_no(?) - req = builder.build() - try: - resp = self.api.modify_purchase(req) - print("code: ", resp.common_response.code) - print("msg: ", resp.common_response.message) - print("data: ", resp.to_json()) - except Exception as e: - print("error: ", e) - raise e - def test_get_loan_market_req(self): """ get_loan_market @@ -58,18 +39,18 @@ def test_get_loan_market_interest_rate_req(self): print("error: ", e) raise e -def test_get_purchase_orders_req(self): +def test_purchase_req(self): """ - get_purchase_orders - Get Purchase Orders - /api/v3/purchase/orders + purchase + Purchase + /api/v3/purchase """ - builder = GetPurchaseOrdersReqBuilder() - builder.set_currency(?).set_status(?).set_purchase_order_no(?).set_current_page(?).set_page_size(?) + builder = PurchaseReqBuilder() + builder.set_currency(?).set_size(?).set_interest_rate(?) req = builder.build() try: - resp = self.api.get_purchase_orders(req) + resp = self.api.purchase(req) print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) @@ -77,18 +58,18 @@ def test_get_purchase_orders_req(self): print("error: ", e) raise e -def test_purchase_req(self): +def test_modify_purchase_req(self): """ - purchase - Purchase - /api/v3/purchase + modify_purchase + Modify Purchase + /api/v3/lend/purchase/update """ - builder = PurchaseReqBuilder() - builder.set_currency(?).set_size(?).set_interest_rate(?) + builder = ModifyPurchaseReqBuilder() + builder.set_currency(?).set_interest_rate(?).set_purchase_order_no(?) req = builder.build() try: - resp = self.api.purchase(req) + resp = self.api.modify_purchase(req) print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) @@ -96,18 +77,18 @@ def test_purchase_req(self): print("error: ", e) raise e -def test_get_redeem_orders_req(self): +def test_get_purchase_orders_req(self): """ - get_redeem_orders - Get Redeem Orders - /api/v3/redeem/orders + get_purchase_orders + Get Purchase Orders + /api/v3/purchase/orders """ - builder = GetRedeemOrdersReqBuilder() - builder.set_currency(?).set_status(?).set_redeem_order_no(?).set_current_page(?).set_page_size(?) + builder = GetPurchaseOrdersReqBuilder() + builder.set_currency(?).set_status(?).set_purchase_order_no(?).set_current_page(?).set_page_size(?) req = builder.build() try: - resp = self.api.get_redeem_orders(req) + resp = self.api.get_purchase_orders(req) print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) @@ -133,3 +114,22 @@ def test_redeem_req(self): except Exception as e: print("error: ", e) raise e + +def test_get_redeem_orders_req(self): + """ + get_redeem_orders + Get Redeem Orders + /api/v3/redeem/orders + """ + + builder = GetRedeemOrdersReqBuilder() + builder.set_currency(?).set_status(?).set_redeem_order_no(?).set_current_page(?).set_page_size(?) + req = builder.build() + try: + resp = self.api.get_redeem_orders(req) + print("code: ", resp.common_response.code) + print("msg: ", resp.common_response.message) + print("data: ", resp.to_json()) + except Exception as e: + print("error: ", e) + raise e diff --git a/sdk/python/kucoin_universal_sdk/generate/margin/credit/api_credit_test.py b/sdk/python/kucoin_universal_sdk/generate/margin/credit/api_credit_test.py index cc8ee62f..2cbc356e 100644 --- a/sdk/python/kucoin_universal_sdk/generate/margin/credit/api_credit_test.py +++ b/sdk/python/kucoin_universal_sdk/generate/margin/credit/api_credit_test.py @@ -18,25 +18,6 @@ class CreditAPITest(unittest.TestCase): - def test_modify_purchase_req_model(self): - """ - modify_purchase - Modify Purchase - /api/v3/lend/purchase/update - """ - data = "{\"currency\": \"BTC\", \"purchaseOrderNo\": \"671bafa804c26d000773c533\", \"interestRate\": \"0.09\"}" - req = ModifyPurchaseReq.from_json(data) - - def test_modify_purchase_resp_model(self): - """ - modify_purchase - Modify Purchase - /api/v3/lend/purchase/update - """ - data = "{\n \"code\": \"200000\",\n \"data\": null\n}" - common_response = RestResponse.from_json(data) - resp = ModifyPurchaseResp.from_dict(common_response.data) - def test_get_loan_market_req_model(self): """ get_loan_market @@ -75,6 +56,44 @@ def test_get_loan_market_interest_rate_resp_model(self): common_response = RestResponse.from_json(data) resp = GetLoanMarketInterestRateResp.from_dict(common_response.data) + def test_purchase_req_model(self): + """ + purchase + Purchase + /api/v3/purchase + """ + data = "{\"currency\": \"BTC\", \"size\": \"0.001\", \"interestRate\": \"0.1\"}" + req = PurchaseReq.from_json(data) + + def test_purchase_resp_model(self): + """ + purchase + Purchase + /api/v3/purchase + """ + data = "{\n \"code\": \"200000\",\n \"data\": {\n \"orderNo\": \"671bafa804c26d000773c533\"\n }\n}" + common_response = RestResponse.from_json(data) + resp = PurchaseResp.from_dict(common_response.data) + + def test_modify_purchase_req_model(self): + """ + modify_purchase + Modify Purchase + /api/v3/lend/purchase/update + """ + data = "{\"currency\": \"BTC\", \"purchaseOrderNo\": \"671bafa804c26d000773c533\", \"interestRate\": \"0.09\"}" + req = ModifyPurchaseReq.from_json(data) + + def test_modify_purchase_resp_model(self): + """ + modify_purchase + Modify Purchase + /api/v3/lend/purchase/update + """ + data = "{\n \"code\": \"200000\",\n \"data\": null\n}" + common_response = RestResponse.from_json(data) + resp = ModifyPurchaseResp.from_dict(common_response.data) + def test_get_purchase_orders_req_model(self): """ get_purchase_orders @@ -94,24 +113,24 @@ def test_get_purchase_orders_resp_model(self): common_response = RestResponse.from_json(data) resp = GetPurchaseOrdersResp.from_dict(common_response.data) - def test_purchase_req_model(self): + def test_redeem_req_model(self): """ - purchase - Purchase - /api/v3/purchase + redeem + Redeem + /api/v3/redeem """ - data = "{\"currency\": \"BTC\", \"size\": \"0.001\", \"interestRate\": \"0.1\"}" - req = PurchaseReq.from_json(data) + data = "{\"currency\": \"BTC\", \"size\": \"0.001\", \"purchaseOrderNo\": \"671bafa804c26d000773c533\"}" + req = RedeemReq.from_json(data) - def test_purchase_resp_model(self): + def test_redeem_resp_model(self): """ - purchase - Purchase - /api/v3/purchase + redeem + Redeem + /api/v3/redeem """ data = "{\n \"code\": \"200000\",\n \"data\": {\n \"orderNo\": \"671bafa804c26d000773c533\"\n }\n}" common_response = RestResponse.from_json(data) - resp = PurchaseResp.from_dict(common_response.data) + resp = RedeemResp.from_dict(common_response.data) def test_get_redeem_orders_req_model(self): """ @@ -131,22 +150,3 @@ def test_get_redeem_orders_resp_model(self): data = "{\n \"code\": \"200000\",\n \"data\": {\n \"currentPage\": 1,\n \"pageSize\": 10,\n \"totalNum\": 1,\n \"totalPage\": 1,\n \"items\": [\n {\n \"currency\": \"BTC\",\n \"purchaseOrderNo\": \"671bafa804c26d000773c533\",\n \"redeemOrderNo\": \"671bb01004c26d000773c55c\",\n \"redeemSize\": \"0.001\",\n \"receiptSize\": \"0.001\",\n \"applyTime\": null,\n \"status\": \"DONE\"\n }\n ]\n }\n}" common_response = RestResponse.from_json(data) resp = GetRedeemOrdersResp.from_dict(common_response.data) - - def test_redeem_req_model(self): - """ - redeem - Redeem - /api/v3/redeem - """ - data = "{\"currency\": \"BTC\", \"size\": \"0.001\", \"purchaseOrderNo\": \"671bafa804c26d000773c533\"}" - req = RedeemReq.from_json(data) - - def test_redeem_resp_model(self): - """ - redeem - Redeem - /api/v3/redeem - """ - data = "{\n \"code\": \"200000\",\n \"data\": {\n \"orderNo\": \"671bafa804c26d000773c533\"\n }\n}" - common_response = RestResponse.from_json(data) - resp = RedeemResp.from_dict(common_response.data) diff --git a/sdk/python/kucoin_universal_sdk/generate/margin/debit/api_debit.py b/sdk/python/kucoin_universal_sdk/generate/margin/debit/api_debit.py index 3c3ba7d4..290bb5eb 100644 --- a/sdk/python/kucoin_universal_sdk/generate/margin/debit/api_debit.py +++ b/sdk/python/kucoin_universal_sdk/generate/margin/debit/api_debit.py @@ -20,12 +20,11 @@ class DebitAPI(ABC): @abstractmethod - def get_borrow_history(self, req: GetBorrowHistoryReq, - **kwargs: Any) -> GetBorrowHistoryResp: + def borrow(self, req: BorrowReq, **kwargs: Any) -> BorrowResp: """ - summary: Get Borrow History - description: This API endpoint is used to get the borrowing orders for cross and isolated margin accounts - documentation: https://www.kucoin.com/docs-new/api-3470207 + summary: Borrow + description: This API endpoint is used to initiate an application for cross or isolated margin borrowing. + documentation: https://www.kucoin.com/docs-new/api-3470206 +---------------------+---------+ | Extra API Info | Value | +---------------------+---------+ @@ -39,11 +38,12 @@ def get_borrow_history(self, req: GetBorrowHistoryReq, pass @abstractmethod - def borrow(self, req: BorrowReq, **kwargs: Any) -> BorrowResp: + def get_borrow_history(self, req: GetBorrowHistoryReq, + **kwargs: Any) -> GetBorrowHistoryResp: """ - summary: Borrow - description: This API endpoint is used to initiate an application for cross or isolated margin borrowing. - documentation: https://www.kucoin.com/docs-new/api-3470206 + summary: Get Borrow History + description: This API endpoint is used to get the borrowing orders for cross and isolated margin accounts + documentation: https://www.kucoin.com/docs-new/api-3470207 +---------------------+---------+ | Extra API Info | Value | +---------------------+---------+ @@ -57,12 +57,11 @@ def borrow(self, req: BorrowReq, **kwargs: Any) -> BorrowResp: pass @abstractmethod - def get_interest_history(self, req: GetInterestHistoryReq, - **kwargs: Any) -> GetInterestHistoryResp: + def repay(self, req: RepayReq, **kwargs: Any) -> RepayResp: """ - summary: Get Interest History - description: Request via this endpoint to get the interest records of the cross/isolated margin lending. - documentation: https://www.kucoin.com/docs-new/api-3470209 + summary: Repay + description: This API endpoint is used to initiate an application for cross or isolated margin repayment. + documentation: https://www.kucoin.com/docs-new/api-3470210 +---------------------+---------+ | Extra API Info | Value | +---------------------+---------+ @@ -70,7 +69,7 @@ def get_interest_history(self, req: GetInterestHistoryReq, | API-CHANNEL | PRIVATE | | API-PERMISSION | MARGIN | | API-RATE-LIMIT-POOL | SPOT | - | API-RATE-LIMIT | 20 | + | API-RATE-LIMIT | 10 | +---------------------+---------+ """ pass @@ -95,11 +94,12 @@ def get_repay_history(self, req: GetRepayHistoryReq, pass @abstractmethod - def repay(self, req: RepayReq, **kwargs: Any) -> RepayResp: + def get_interest_history(self, req: GetInterestHistoryReq, + **kwargs: Any) -> GetInterestHistoryResp: """ - summary: Repay - description: This API endpoint is used to initiate an application for cross or isolated margin repayment. - documentation: https://www.kucoin.com/docs-new/api-3470210 + summary: Get Interest History + description: Request via this endpoint to get the interest records of the cross/isolated margin lending. + documentation: https://www.kucoin.com/docs-new/api-3470209 +---------------------+---------+ | Extra API Info | Value | +---------------------+---------+ @@ -107,7 +107,7 @@ def repay(self, req: RepayReq, **kwargs: Any) -> RepayResp: | API-CHANNEL | PRIVATE | | API-PERMISSION | MARGIN | | API-RATE-LIMIT-POOL | SPOT | - | API-RATE-LIMIT | 10 | + | API-RATE-LIMIT | 20 | +---------------------+---------+ """ pass @@ -137,22 +137,21 @@ class DebitAPIImpl(DebitAPI): def __init__(self, transport: Transport): self.transport = transport + def borrow(self, req: BorrowReq, **kwargs: Any) -> BorrowResp: + return self.transport.call("spot", False, + "POST", "/api/v3/margin/borrow", req, + BorrowResp(), False, **kwargs) + def get_borrow_history(self, req: GetBorrowHistoryReq, **kwargs: Any) -> GetBorrowHistoryResp: return self.transport.call("spot", False, "GET", "/api/v3/margin/borrow", req, GetBorrowHistoryResp(), False, **kwargs) - def borrow(self, req: BorrowReq, **kwargs: Any) -> BorrowResp: + def repay(self, req: RepayReq, **kwargs: Any) -> RepayResp: return self.transport.call("spot", False, - "POST", "/api/v3/margin/borrow", req, - BorrowResp(), False, **kwargs) - - def get_interest_history(self, req: GetInterestHistoryReq, - **kwargs: Any) -> GetInterestHistoryResp: - return self.transport.call("spot", False, "GET", - "/api/v3/margin/interest", req, - GetInterestHistoryResp(), False, **kwargs) + "POST", "/api/v3/margin/repay", req, + RepayResp(), False, **kwargs) def get_repay_history(self, req: GetRepayHistoryReq, **kwargs: Any) -> GetRepayHistoryResp: @@ -160,10 +159,11 @@ def get_repay_history(self, req: GetRepayHistoryReq, "/api/v3/margin/repay", req, GetRepayHistoryResp(), False, **kwargs) - def repay(self, req: RepayReq, **kwargs: Any) -> RepayResp: - return self.transport.call("spot", False, - "POST", "/api/v3/margin/repay", req, - RepayResp(), False, **kwargs) + def get_interest_history(self, req: GetInterestHistoryReq, + **kwargs: Any) -> GetInterestHistoryResp: + return self.transport.call("spot", False, "GET", + "/api/v3/margin/interest", req, + GetInterestHistoryResp(), False, **kwargs) def modify_leverage(self, req: ModifyLeverageReq, **kwargs: Any) -> ModifyLeverageResp: diff --git a/sdk/python/kucoin_universal_sdk/generate/margin/debit/api_debit.template b/sdk/python/kucoin_universal_sdk/generate/margin/debit/api_debit.template index 8f92e976..5b376d73 100644 --- a/sdk/python/kucoin_universal_sdk/generate/margin/debit/api_debit.template +++ b/sdk/python/kucoin_universal_sdk/generate/margin/debit/api_debit.template @@ -1,18 +1,18 @@ # API FUNCTION TEMPLATE -def test_get_borrow_history_req(self): +def test_borrow_req(self): """ - get_borrow_history - Get Borrow History + borrow + Borrow /api/v3/margin/borrow """ - builder = GetBorrowHistoryReqBuilder() - builder.set_currency(?).set_is_isolated(?).set_symbol(?).set_order_no(?).set_start_time(?).set_end_time(?).set_current_page(?).set_page_size(?) + builder = BorrowReqBuilder() + builder.set_currency(?).set_size(?).set_time_in_force(?).set_symbol(?).set_is_isolated(?).set_is_hf(?) req = builder.build() try: - resp = self.api.get_borrow_history(req) + resp = self.api.borrow(req) print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) @@ -20,18 +20,18 @@ def test_get_borrow_history_req(self): print("error: ", e) raise e -def test_borrow_req(self): +def test_get_borrow_history_req(self): """ - borrow - Borrow + get_borrow_history + Get Borrow History /api/v3/margin/borrow """ - builder = BorrowReqBuilder() - builder.set_currency(?).set_size(?).set_time_in_force(?).set_symbol(?).set_is_isolated(?).set_is_hf(?) + builder = GetBorrowHistoryReqBuilder() + builder.set_currency(?).set_is_isolated(?).set_symbol(?).set_order_no(?).set_start_time(?).set_end_time(?).set_current_page(?).set_page_size(?) req = builder.build() try: - resp = self.api.borrow(req) + resp = self.api.get_borrow_history(req) print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) @@ -39,18 +39,18 @@ def test_borrow_req(self): print("error: ", e) raise e -def test_get_interest_history_req(self): +def test_repay_req(self): """ - get_interest_history - Get Interest History - /api/v3/margin/interest + repay + Repay + /api/v3/margin/repay """ - builder = GetInterestHistoryReqBuilder() - builder.set_currency(?).set_is_isolated(?).set_symbol(?).set_start_time(?).set_end_time(?).set_current_page(?).set_page_size(?) + builder = RepayReqBuilder() + builder.set_currency(?).set_size(?).set_symbol(?).set_is_isolated(?).set_is_hf(?) req = builder.build() try: - resp = self.api.get_interest_history(req) + resp = self.api.repay(req) print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) @@ -77,18 +77,18 @@ def test_get_repay_history_req(self): print("error: ", e) raise e -def test_repay_req(self): +def test_get_interest_history_req(self): """ - repay - Repay - /api/v3/margin/repay + get_interest_history + Get Interest History + /api/v3/margin/interest """ - builder = RepayReqBuilder() - builder.set_currency(?).set_size(?).set_symbol(?).set_is_isolated(?).set_is_hf(?) + builder = GetInterestHistoryReqBuilder() + builder.set_currency(?).set_is_isolated(?).set_symbol(?).set_start_time(?).set_end_time(?).set_current_page(?).set_page_size(?) req = builder.build() try: - resp = self.api.repay(req) + resp = self.api.get_interest_history(req) print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) diff --git a/sdk/python/kucoin_universal_sdk/generate/margin/debit/api_debit_test.py b/sdk/python/kucoin_universal_sdk/generate/margin/debit/api_debit_test.py index 4f10cd37..4ce5b409 100644 --- a/sdk/python/kucoin_universal_sdk/generate/margin/debit/api_debit_test.py +++ b/sdk/python/kucoin_universal_sdk/generate/margin/debit/api_debit_test.py @@ -16,25 +16,6 @@ class DebitAPITest(unittest.TestCase): - def test_get_borrow_history_req_model(self): - """ - get_borrow_history - Get Borrow History - /api/v3/margin/borrow - """ - data = "{\"currency\": \"BTC\", \"isIsolated\": true, \"symbol\": \"BTC-USDT\", \"orderNo\": \"example_string_default_value\", \"startTime\": 123456, \"endTime\": 123456, \"currentPage\": 1, \"pageSize\": 50}" - req = GetBorrowHistoryReq.from_json(data) - - def test_get_borrow_history_resp_model(self): - """ - get_borrow_history - Get Borrow History - /api/v3/margin/borrow - """ - data = "{\n \"code\": \"200000\",\n \"data\": {\n \"timestamp\": 1729657580449,\n \"currentPage\": 1,\n \"pageSize\": 50,\n \"totalNum\": 2,\n \"totalPage\": 1,\n \"items\": [\n {\n \"orderNo\": \"67187162c0d6990007717b15\",\n \"symbol\": null,\n \"currency\": \"USDT\",\n \"size\": \"10\",\n \"actualSize\": \"10\",\n \"status\": \"SUCCESS\",\n \"createdTime\": 1729655138000\n },\n {\n \"orderNo\": \"67187155b088e70007149585\",\n \"symbol\": null,\n \"currency\": \"USDT\",\n \"size\": \"0.1\",\n \"actualSize\": \"0\",\n \"status\": \"FAILED\",\n \"createdTime\": 1729655125000\n }\n ]\n }\n}" - common_response = RestResponse.from_json(data) - resp = GetBorrowHistoryResp.from_dict(common_response.data) - def test_borrow_req_model(self): """ borrow @@ -54,24 +35,43 @@ def test_borrow_resp_model(self): common_response = RestResponse.from_json(data) resp = BorrowResp.from_dict(common_response.data) - def test_get_interest_history_req_model(self): + def test_get_borrow_history_req_model(self): """ - get_interest_history - Get Interest History - /api/v3/margin/interest + get_borrow_history + Get Borrow History + /api/v3/margin/borrow """ - data = "{\"currency\": \"BTC\", \"isIsolated\": true, \"symbol\": \"BTC-USDT\", \"startTime\": 123456, \"endTime\": 123456, \"currentPage\": 1, \"pageSize\": 50}" - req = GetInterestHistoryReq.from_json(data) + data = "{\"currency\": \"BTC\", \"isIsolated\": true, \"symbol\": \"BTC-USDT\", \"orderNo\": \"example_string_default_value\", \"startTime\": 123456, \"endTime\": 123456, \"currentPage\": 1, \"pageSize\": 50}" + req = GetBorrowHistoryReq.from_json(data) - def test_get_interest_history_resp_model(self): + def test_get_borrow_history_resp_model(self): """ - get_interest_history - Get Interest History - /api/v3/margin/interest + get_borrow_history + Get Borrow History + /api/v3/margin/borrow """ - data = "{\"code\":\"200000\",\"data\":{\"timestamp\":1729665170701,\"currentPage\":1,\"pageSize\":50,\"totalNum\":3,\"totalPage\":1,\"items\":[{\"currency\":\"USDT\",\"dayRatio\":\"0.000296\",\"interestAmount\":\"0.00000001\",\"createdTime\":1729663213375},{\"currency\":\"USDT\",\"dayRatio\":\"0.000296\",\"interestAmount\":\"0.00000001\",\"createdTime\":1729659618802},{\"currency\":\"USDT\",\"dayRatio\":\"0.000296\",\"interestAmount\":\"0.00000001\",\"createdTime\":1729656028077}]}}" + data = "{\n \"code\": \"200000\",\n \"data\": {\n \"timestamp\": 1729657580449,\n \"currentPage\": 1,\n \"pageSize\": 50,\n \"totalNum\": 2,\n \"totalPage\": 1,\n \"items\": [\n {\n \"orderNo\": \"67187162c0d6990007717b15\",\n \"symbol\": null,\n \"currency\": \"USDT\",\n \"size\": \"10\",\n \"actualSize\": \"10\",\n \"status\": \"SUCCESS\",\n \"createdTime\": 1729655138000\n },\n {\n \"orderNo\": \"67187155b088e70007149585\",\n \"symbol\": null,\n \"currency\": \"USDT\",\n \"size\": \"0.1\",\n \"actualSize\": \"0\",\n \"status\": \"FAILED\",\n \"createdTime\": 1729655125000\n }\n ]\n }\n}" common_response = RestResponse.from_json(data) - resp = GetInterestHistoryResp.from_dict(common_response.data) + resp = GetBorrowHistoryResp.from_dict(common_response.data) + + def test_repay_req_model(self): + """ + repay + Repay + /api/v3/margin/repay + """ + data = "{\"currency\": \"USDT\", \"size\": 10}" + req = RepayReq.from_json(data) + + def test_repay_resp_model(self): + """ + repay + Repay + /api/v3/margin/repay + """ + data = "{\"code\":\"200000\",\"data\":{\"timestamp\":1729655606816,\"orderNo\":\"671873361d5bd400075096ad\",\"actualSize\":\"10\"}}" + common_response = RestResponse.from_json(data) + resp = RepayResp.from_dict(common_response.data) def test_get_repay_history_req_model(self): """ @@ -92,24 +92,24 @@ def test_get_repay_history_resp_model(self): common_response = RestResponse.from_json(data) resp = GetRepayHistoryResp.from_dict(common_response.data) - def test_repay_req_model(self): + def test_get_interest_history_req_model(self): """ - repay - Repay - /api/v3/margin/repay + get_interest_history + Get Interest History + /api/v3/margin/interest """ - data = "{\"currency\": \"USDT\", \"size\": 10}" - req = RepayReq.from_json(data) + data = "{\"currency\": \"BTC\", \"isIsolated\": true, \"symbol\": \"BTC-USDT\", \"startTime\": 123456, \"endTime\": 123456, \"currentPage\": 1, \"pageSize\": 50}" + req = GetInterestHistoryReq.from_json(data) - def test_repay_resp_model(self): + def test_get_interest_history_resp_model(self): """ - repay - Repay - /api/v3/margin/repay + get_interest_history + Get Interest History + /api/v3/margin/interest """ - data = "{\"code\":\"200000\",\"data\":{\"timestamp\":1729655606816,\"orderNo\":\"671873361d5bd400075096ad\",\"actualSize\":\"10\"}}" + data = "{\"code\":\"200000\",\"data\":{\"timestamp\":1729665170701,\"currentPage\":1,\"pageSize\":50,\"totalNum\":3,\"totalPage\":1,\"items\":[{\"currency\":\"USDT\",\"dayRatio\":\"0.000296\",\"interestAmount\":\"0.00000001\",\"createdTime\":1729663213375},{\"currency\":\"USDT\",\"dayRatio\":\"0.000296\",\"interestAmount\":\"0.00000001\",\"createdTime\":1729659618802},{\"currency\":\"USDT\",\"dayRatio\":\"0.000296\",\"interestAmount\":\"0.00000001\",\"createdTime\":1729656028077}]}}" common_response = RestResponse.from_json(data) - resp = RepayResp.from_dict(common_response.data) + resp = GetInterestHistoryResp.from_dict(common_response.data) def test_modify_leverage_req_model(self): """ diff --git a/sdk/python/kucoin_universal_sdk/generate/margin/market/api_market.py b/sdk/python/kucoin_universal_sdk/generate/margin/market/api_market.py index 8720352e..b90e2896 100644 --- a/sdk/python/kucoin_universal_sdk/generate/margin/market/api_market.py +++ b/sdk/python/kucoin_universal_sdk/generate/margin/market/api_market.py @@ -17,12 +17,12 @@ class MarketAPI(ABC): @abstractmethod - def get_isolated_margin_symbols( - self, **kwargs: Any) -> GetIsolatedMarginSymbolsResp: + def get_cross_margin_symbols(self, req: GetCrossMarginSymbolsReq, + **kwargs: Any) -> GetCrossMarginSymbolsResp: """ - summary: Get Symbols - Isolated Margin - description: This endpoint allows querying the configuration of isolated margin symbol. - documentation: https://www.kucoin.com/docs-new/api-3470194 + summary: Get Symbols - Cross Margin + description: This endpoint allows querying the configuration of cross margin symbol. + documentation: https://www.kucoin.com/docs-new/api-3470189 +---------------------+--------+ | Extra API Info | Value | +---------------------+--------+ @@ -54,12 +54,12 @@ def get_margin_config(self, **kwargs: Any) -> GetMarginConfigResp: pass @abstractmethod - def get_mark_price_detail(self, req: GetMarkPriceDetailReq, - **kwargs: Any) -> GetMarkPriceDetailResp: + def get_etf_info(self, req: GetEtfInfoReq, + **kwargs: Any) -> GetEtfInfoResp: """ - summary: Get Mark Price Detail - description: This endpoint returns the current Mark price for specified margin trading pairs. - documentation: https://www.kucoin.com/docs-new/api-3470193 + summary: Get ETF Info + description: This interface returns leveraged token information + documentation: https://www.kucoin.com/docs-new/api-3470191 +---------------------+--------+ | Extra API Info | Value | +---------------------+--------+ @@ -67,18 +67,17 @@ def get_mark_price_detail(self, req: GetMarkPriceDetailReq, | API-CHANNEL | PUBLIC | | API-PERMISSION | NULL | | API-RATE-LIMIT-POOL | PUBLIC | - | API-RATE-LIMIT | 2 | + | API-RATE-LIMIT | 3 | +---------------------+--------+ """ pass @abstractmethod - def get_etf_info(self, req: GetEtfInfoReq, - **kwargs: Any) -> GetEtfInfoResp: + def get_mark_price_list(self, **kwargs: Any) -> GetMarkPriceListResp: """ - summary: Get ETF Info - description: This interface returns leveraged token information - documentation: https://www.kucoin.com/docs-new/api-3470191 + summary: Get Mark Price List + description: This endpoint returns the current Mark price for all margin trading pairs. + documentation: https://www.kucoin.com/docs-new/api-3470192 +---------------------+--------+ | Extra API Info | Value | +---------------------+--------+ @@ -86,18 +85,18 @@ def get_etf_info(self, req: GetEtfInfoReq, | API-CHANNEL | PUBLIC | | API-PERMISSION | NULL | | API-RATE-LIMIT-POOL | PUBLIC | - | API-RATE-LIMIT | 3 | + | API-RATE-LIMIT | 10 | +---------------------+--------+ """ pass @abstractmethod - def get_cross_margin_symbols(self, req: GetCrossMarginSymbolsReq, - **kwargs: Any) -> GetCrossMarginSymbolsResp: + def get_mark_price_detail(self, req: GetMarkPriceDetailReq, + **kwargs: Any) -> GetMarkPriceDetailResp: """ - summary: Get Symbols - Cross Margin - description: This endpoint allows querying the configuration of cross margin symbol. - documentation: https://www.kucoin.com/docs-new/api-3470189 + summary: Get Mark Price Detail + description: This endpoint returns the current Mark price for specified margin trading pairs. + documentation: https://www.kucoin.com/docs-new/api-3470193 +---------------------+--------+ | Extra API Info | Value | +---------------------+--------+ @@ -105,17 +104,18 @@ def get_cross_margin_symbols(self, req: GetCrossMarginSymbolsReq, | API-CHANNEL | PUBLIC | | API-PERMISSION | NULL | | API-RATE-LIMIT-POOL | PUBLIC | - | API-RATE-LIMIT | 3 | + | API-RATE-LIMIT | 2 | +---------------------+--------+ """ pass @abstractmethod - def get_mark_price_list(self, **kwargs: Any) -> GetMarkPriceListResp: + def get_isolated_margin_symbols( + self, **kwargs: Any) -> GetIsolatedMarginSymbolsResp: """ - summary: Get Mark Price List - description: This endpoint returns the current Mark price for all margin trading pairs. - documentation: https://www.kucoin.com/docs-new/api-3470192 + summary: Get Symbols - Isolated Margin + description: This endpoint allows querying the configuration of isolated margin symbol. + documentation: https://www.kucoin.com/docs-new/api-3470194 +---------------------+--------+ | Extra API Info | Value | +---------------------+--------+ @@ -123,7 +123,7 @@ def get_mark_price_list(self, **kwargs: Any) -> GetMarkPriceListResp: | API-CHANNEL | PUBLIC | | API-PERMISSION | NULL | | API-RATE-LIMIT-POOL | PUBLIC | - | API-RATE-LIMIT | 10 | + | API-RATE-LIMIT | 3 | +---------------------+--------+ """ pass @@ -134,11 +134,11 @@ class MarketAPIImpl(MarketAPI): def __init__(self, transport: Transport): self.transport = transport - def get_isolated_margin_symbols( - self, **kwargs: Any) -> GetIsolatedMarginSymbolsResp: + def get_cross_margin_symbols(self, req: GetCrossMarginSymbolsReq, + **kwargs: Any) -> GetCrossMarginSymbolsResp: return self.transport.call("spot", False, "GET", - "/api/v1/isolated/symbols", None, - GetIsolatedMarginSymbolsResp(), False, + "/api/v3/margin/symbols", req, + GetCrossMarginSymbolsResp(), False, **kwargs) def get_margin_config(self, **kwargs: Any) -> GetMarginConfigResp: @@ -146,25 +146,25 @@ def get_margin_config(self, **kwargs: Any) -> GetMarginConfigResp: "/api/v1/margin/config", None, GetMarginConfigResp(), False, **kwargs) - def get_mark_price_detail(self, req: GetMarkPriceDetailReq, - **kwargs: Any) -> GetMarkPriceDetailResp: - return self.transport.call("spot", False, "GET", - "/api/v1/mark-price/{symbol}/current", req, - GetMarkPriceDetailResp(), False, **kwargs) - def get_etf_info(self, req: GetEtfInfoReq, **kwargs: Any) -> GetEtfInfoResp: return self.transport.call("spot", False, "GET", "/api/v3/etf/info", req, GetEtfInfoResp(), False, **kwargs) - def get_cross_margin_symbols(self, req: GetCrossMarginSymbolsReq, - **kwargs: Any) -> GetCrossMarginSymbolsResp: - return self.transport.call("spot", False, "GET", - "/api/v3/margin/symbols", req, - GetCrossMarginSymbolsResp(), False, - **kwargs) - def get_mark_price_list(self, **kwargs: Any) -> GetMarkPriceListResp: return self.transport.call("spot", False, "GET", "/api/v3/mark-price/all-symbols", None, GetMarkPriceListResp(), False, **kwargs) + + def get_mark_price_detail(self, req: GetMarkPriceDetailReq, + **kwargs: Any) -> GetMarkPriceDetailResp: + return self.transport.call("spot", False, "GET", + "/api/v1/mark-price/{symbol}/current", req, + GetMarkPriceDetailResp(), False, **kwargs) + + def get_isolated_margin_symbols( + self, **kwargs: Any) -> GetIsolatedMarginSymbolsResp: + return self.transport.call("spot", False, "GET", + "/api/v1/isolated/symbols", None, + GetIsolatedMarginSymbolsResp(), False, + **kwargs) diff --git a/sdk/python/kucoin_universal_sdk/generate/margin/market/api_market.template b/sdk/python/kucoin_universal_sdk/generate/margin/market/api_market.template index 2895f914..9c21fcf6 100644 --- a/sdk/python/kucoin_universal_sdk/generate/margin/market/api_market.template +++ b/sdk/python/kucoin_universal_sdk/generate/margin/market/api_market.template @@ -1,15 +1,18 @@ # API FUNCTION TEMPLATE -def test_get_isolated_margin_symbols_req(self): +def test_get_cross_margin_symbols_req(self): """ - get_isolated_margin_symbols - Get Symbols - Isolated Margin - /api/v1/isolated/symbols + get_cross_margin_symbols + Get Symbols - Cross Margin + /api/v3/margin/symbols """ + builder = GetCrossMarginSymbolsReqBuilder() + builder.set_symbol(?) + req = builder.build() try: - resp = self.api.get_isolated_margin_symbols() + resp = self.api.get_cross_margin_symbols(req) print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) @@ -33,18 +36,18 @@ def test_get_margin_config_req(self): print("error: ", e) raise e -def test_get_mark_price_detail_req(self): +def test_get_etf_info_req(self): """ - get_mark_price_detail - Get Mark Price Detail - /api/v1/mark-price/{symbol}/current + get_etf_info + Get ETF Info + /api/v3/etf/info """ - builder = GetMarkPriceDetailReqBuilder() - builder.set_symbol(?) + builder = GetEtfInfoReqBuilder() + builder.set_currency(?) req = builder.build() try: - resp = self.api.get_mark_price_detail(req) + resp = self.api.get_etf_info(req) print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) @@ -52,18 +55,15 @@ def test_get_mark_price_detail_req(self): print("error: ", e) raise e -def test_get_etf_info_req(self): +def test_get_mark_price_list_req(self): """ - get_etf_info - Get ETF Info - /api/v3/etf/info + get_mark_price_list + Get Mark Price List + /api/v3/mark-price/all-symbols """ - builder = GetEtfInfoReqBuilder() - builder.set_currency(?) - req = builder.build() try: - resp = self.api.get_etf_info(req) + resp = self.api.get_mark_price_list() print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) @@ -71,18 +71,18 @@ def test_get_etf_info_req(self): print("error: ", e) raise e -def test_get_cross_margin_symbols_req(self): +def test_get_mark_price_detail_req(self): """ - get_cross_margin_symbols - Get Symbols - Cross Margin - /api/v3/margin/symbols + get_mark_price_detail + Get Mark Price Detail + /api/v1/mark-price/{symbol}/current """ - builder = GetCrossMarginSymbolsReqBuilder() + builder = GetMarkPriceDetailReqBuilder() builder.set_symbol(?) req = builder.build() try: - resp = self.api.get_cross_margin_symbols(req) + resp = self.api.get_mark_price_detail(req) print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) @@ -90,15 +90,15 @@ def test_get_cross_margin_symbols_req(self): print("error: ", e) raise e -def test_get_mark_price_list_req(self): +def test_get_isolated_margin_symbols_req(self): """ - get_mark_price_list - Get Mark Price List - /api/v3/mark-price/all-symbols + get_isolated_margin_symbols + Get Symbols - Isolated Margin + /api/v1/isolated/symbols """ try: - resp = self.api.get_mark_price_list() + resp = self.api.get_isolated_margin_symbols() print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) diff --git a/sdk/python/kucoin_universal_sdk/generate/margin/market/api_market_test.py b/sdk/python/kucoin_universal_sdk/generate/margin/market/api_market_test.py index 2cfb820b..3810d9ec 100644 --- a/sdk/python/kucoin_universal_sdk/generate/margin/market/api_market_test.py +++ b/sdk/python/kucoin_universal_sdk/generate/margin/market/api_market_test.py @@ -13,22 +13,24 @@ class MarketAPITest(unittest.TestCase): - def test_get_isolated_margin_symbols_req_model(self): + def test_get_cross_margin_symbols_req_model(self): """ - get_isolated_margin_symbols - Get Symbols - Isolated Margin - /api/v1/isolated/symbols + get_cross_margin_symbols + Get Symbols - Cross Margin + /api/v3/margin/symbols """ + data = "{\"symbol\": \"BTC-USDT\"}" + req = GetCrossMarginSymbolsReq.from_json(data) - def test_get_isolated_margin_symbols_resp_model(self): + def test_get_cross_margin_symbols_resp_model(self): """ - get_isolated_margin_symbols - Get Symbols - Isolated Margin - /api/v1/isolated/symbols + get_cross_margin_symbols + Get Symbols - Cross Margin + /api/v3/margin/symbols """ - data = "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"symbol\": \"BTC-USDT\",\n \"symbolName\": \"BTC-USDT\",\n \"baseCurrency\": \"BTC\",\n \"quoteCurrency\": \"USDT\",\n \"maxLeverage\": 10,\n \"flDebtRatio\": \"0.97\",\n \"tradeEnable\": true,\n \"autoRenewMaxDebtRatio\": \"0.96\",\n \"baseBorrowEnable\": true,\n \"quoteBorrowEnable\": true,\n \"baseTransferInEnable\": true,\n \"quoteTransferInEnable\": true,\n \"baseBorrowCoefficient\": \"1\",\n \"quoteBorrowCoefficient\": \"1\"\n }\n ]\n}" + data = "{\n \"code\": \"200000\",\n \"data\": {\n \"timestamp\": 1729665839353,\n \"items\": [\n {\n \"symbol\": \"BTC-USDT\",\n \"name\": \"BTC-USDT\",\n \"enableTrading\": true,\n \"market\": \"USDS\",\n \"baseCurrency\": \"BTC\",\n \"quoteCurrency\": \"USDT\",\n \"baseIncrement\": \"0.00000001\",\n \"baseMinSize\": \"0.00001\",\n \"baseMaxSize\": \"10000000000\",\n \"quoteIncrement\": \"0.000001\",\n \"quoteMinSize\": \"0.1\",\n \"quoteMaxSize\": \"99999999\",\n \"priceIncrement\": \"0.1\",\n \"feeCurrency\": \"USDT\",\n \"priceLimitRate\": \"0.1\",\n \"minFunds\": \"0.1\"\n }\n ]\n }\n}" common_response = RestResponse.from_json(data) - resp = GetIsolatedMarginSymbolsResp.from_dict(common_response.data) + resp = GetCrossMarginSymbolsResp.from_dict(common_response.data) def test_get_margin_config_req_model(self): """ @@ -47,25 +49,6 @@ def test_get_margin_config_resp_model(self): common_response = RestResponse.from_json(data) resp = GetMarginConfigResp.from_dict(common_response.data) - def test_get_mark_price_detail_req_model(self): - """ - get_mark_price_detail - Get Mark Price Detail - /api/v1/mark-price/{symbol}/current - """ - data = "{\"symbol\": \"USDT-BTC\"}" - req = GetMarkPriceDetailReq.from_json(data) - - def test_get_mark_price_detail_resp_model(self): - """ - get_mark_price_detail - Get Mark Price Detail - /api/v1/mark-price/{symbol}/current - """ - data = "{\n \"code\": \"200000\",\n \"data\": {\n \"symbol\": \"USDT-BTC\",\n \"timePoint\": 1729676888000,\n \"value\": 1.5045E-5\n }\n}" - common_response = RestResponse.from_json(data) - resp = GetMarkPriceDetailResp.from_dict(common_response.data) - def test_get_etf_info_req_model(self): """ get_etf_info @@ -85,25 +68,6 @@ def test_get_etf_info_resp_model(self): common_response = RestResponse.from_json(data) resp = GetEtfInfoResp.from_dict(common_response.data) - def test_get_cross_margin_symbols_req_model(self): - """ - get_cross_margin_symbols - Get Symbols - Cross Margin - /api/v3/margin/symbols - """ - data = "{\"symbol\": \"BTC-USDT\"}" - req = GetCrossMarginSymbolsReq.from_json(data) - - def test_get_cross_margin_symbols_resp_model(self): - """ - get_cross_margin_symbols - Get Symbols - Cross Margin - /api/v3/margin/symbols - """ - data = "{\n \"code\": \"200000\",\n \"data\": {\n \"timestamp\": 1729665839353,\n \"items\": [\n {\n \"symbol\": \"BTC-USDT\",\n \"name\": \"BTC-USDT\",\n \"enableTrading\": true,\n \"market\": \"USDS\",\n \"baseCurrency\": \"BTC\",\n \"quoteCurrency\": \"USDT\",\n \"baseIncrement\": \"0.00000001\",\n \"baseMinSize\": \"0.00001\",\n \"baseMaxSize\": \"10000000000\",\n \"quoteIncrement\": \"0.000001\",\n \"quoteMinSize\": \"0.1\",\n \"quoteMaxSize\": \"99999999\",\n \"priceIncrement\": \"0.1\",\n \"feeCurrency\": \"USDT\",\n \"priceLimitRate\": \"0.1\",\n \"minFunds\": \"0.1\"\n }\n ]\n }\n}" - common_response = RestResponse.from_json(data) - resp = GetCrossMarginSymbolsResp.from_dict(common_response.data) - def test_get_mark_price_list_req_model(self): """ get_mark_price_list @@ -120,3 +84,39 @@ def test_get_mark_price_list_resp_model(self): data = "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"symbol\": \"USDT-BTC\",\n \"timePoint\": 1729676522000,\n \"value\": 1.504E-5\n },\n {\n \"symbol\": \"USDC-BTC\",\n \"timePoint\": 1729676522000,\n \"value\": 1.5049024E-5\n }\n ]\n}" common_response = RestResponse.from_json(data) resp = GetMarkPriceListResp.from_dict(common_response.data) + + def test_get_mark_price_detail_req_model(self): + """ + get_mark_price_detail + Get Mark Price Detail + /api/v1/mark-price/{symbol}/current + """ + data = "{\"symbol\": \"USDT-BTC\"}" + req = GetMarkPriceDetailReq.from_json(data) + + def test_get_mark_price_detail_resp_model(self): + """ + get_mark_price_detail + Get Mark Price Detail + /api/v1/mark-price/{symbol}/current + """ + data = "{\n \"code\": \"200000\",\n \"data\": {\n \"symbol\": \"USDT-BTC\",\n \"timePoint\": 1729676888000,\n \"value\": 1.5045E-5\n }\n}" + common_response = RestResponse.from_json(data) + resp = GetMarkPriceDetailResp.from_dict(common_response.data) + + def test_get_isolated_margin_symbols_req_model(self): + """ + get_isolated_margin_symbols + Get Symbols - Isolated Margin + /api/v1/isolated/symbols + """ + + def test_get_isolated_margin_symbols_resp_model(self): + """ + get_isolated_margin_symbols + Get Symbols - Isolated Margin + /api/v1/isolated/symbols + """ + data = "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"symbol\": \"BTC-USDT\",\n \"symbolName\": \"BTC-USDT\",\n \"baseCurrency\": \"BTC\",\n \"quoteCurrency\": \"USDT\",\n \"maxLeverage\": 10,\n \"flDebtRatio\": \"0.97\",\n \"tradeEnable\": true,\n \"autoRenewMaxDebtRatio\": \"0.96\",\n \"baseBorrowEnable\": true,\n \"quoteBorrowEnable\": true,\n \"baseTransferInEnable\": true,\n \"quoteTransferInEnable\": true,\n \"baseBorrowCoefficient\": \"1\",\n \"quoteBorrowCoefficient\": \"1\"\n }\n ]\n}" + common_response = RestResponse.from_json(data) + resp = GetIsolatedMarginSymbolsResp.from_dict(common_response.data) diff --git a/sdk/python/kucoin_universal_sdk/generate/margin/order/api_order.py b/sdk/python/kucoin_universal_sdk/generate/margin/order/api_order.py index 9a46736f..ca172385 100644 --- a/sdk/python/kucoin_universal_sdk/generate/margin/order/api_order.py +++ b/sdk/python/kucoin_universal_sdk/generate/margin/order/api_order.py @@ -35,13 +35,11 @@ class OrderAPI(ABC): @abstractmethod - @deprecated('') - def add_order_v1(self, req: AddOrderV1Req, - **kwargs: Any) -> AddOrderV1Resp: + def add_order(self, req: AddOrderReq, **kwargs: Any) -> AddOrderResp: """ - summary: Add Order - V1 + summary: Add Order description: Place order to the Cross-margin or Isolated-margin trading system, you can place two major types of orders: limit and market. Orders can only be placed if your account has sufficient funds. Once an order is placed, your funds will be put on hold for the duration of the order. The amount of funds on hold depends on the order type and parameters specified. - documentation: https://www.kucoin.com/docs-new/api-3470312 + documentation: https://www.kucoin.com/docs-new/api-3470204 +---------------------+---------+ | Extra API Info | Value | +---------------------+---------+ @@ -55,13 +53,12 @@ def add_order_v1(self, req: AddOrderV1Req, pass @abstractmethod - @deprecated('') - def add_order_test_v1(self, req: AddOrderTestV1Req, - **kwargs: Any) -> AddOrderTestV1Resp: + def add_order_test(self, req: AddOrderTestReq, + **kwargs: Any) -> AddOrderTestResp: """ - summary: Add Order Test - V1 - description: Order test endpoint, the request parameters and return parameters of this endpoint are exactly the same as the order endpoint, and can be used to verify whether the signature is correct and other operations. After placing an order, the order will not enter the matching system, and the order cannot be queried. - documentation: https://www.kucoin.com/docs-new/api-3470313 + summary: Add Order Test + description: Order test endpoint, the request parameters and return parameters of this endpoint are exactly the same as the order endpoint, and can be used to verify whether the signature is correct and other operations. After placing an order, the order will not enter the matching system, and the order cannot be queried. + documentation: https://www.kucoin.com/docs-new/api-3470205 +---------------------+---------+ | Extra API Info | Value | +---------------------+---------+ @@ -75,18 +72,18 @@ def add_order_test_v1(self, req: AddOrderTestV1Req, pass @abstractmethod - def get_trade_history(self, req: GetTradeHistoryReq, - **kwargs: Any) -> GetTradeHistoryResp: + def cancel_order_by_order_id(self, req: CancelOrderByOrderIdReq, + **kwargs: Any) -> CancelOrderByOrderIdResp: """ - summary: Get Trade History - description: This endpoint can be used to obtain a list of the latest Margin transaction details. The returned data is sorted in descending order according to the latest update time of the order. - documentation: https://www.kucoin.com/docs-new/api-3470200 + summary: Cancel Order By OrderId + description: This endpoint can be used to cancel a margin order by orderId. This endpoint only sends cancellation requests. The results of the requests must be obtained by checking the order status or subscribing to websocket. + documentation: https://www.kucoin.com/docs-new/api-3470195 +---------------------+---------+ | Extra API Info | Value | +---------------------+---------+ | API-DOMAIN | SPOT | | API-CHANNEL | PRIVATE | - | API-PERMISSION | GENERAL | + | API-PERMISSION | MARGIN | | API-RATE-LIMIT-POOL | SPOT | | API-RATE-LIMIT | 5 | +---------------------+---------+ @@ -94,13 +91,13 @@ def get_trade_history(self, req: GetTradeHistoryReq, pass @abstractmethod - def get_symbols_with_open_order( - self, req: GetSymbolsWithOpenOrderReq, - **kwargs: Any) -> GetSymbolsWithOpenOrderResp: + def cancel_order_by_client_oid( + self, req: CancelOrderByClientOidReq, + **kwargs: Any) -> CancelOrderByClientOidResp: """ - summary: Get Symbols With Open Order - description: This interface can query all Margin symbol that has active orders - documentation: https://www.kucoin.com/docs-new/api-3470196 + summary: Cancel Order By ClientOid + description: This endpoint can be used to cancel a margin order by clientOid. This endpoint only sends cancellation requests. The results of the requests must be obtained by checking the order status or subscribing to websocket. + documentation: https://www.kucoin.com/docs-new/api-3470201 +---------------------+---------+ | Extra API Info | Value | +---------------------+---------+ @@ -108,17 +105,19 @@ def get_symbols_with_open_order( | API-CHANNEL | PRIVATE | | API-PERMISSION | MARGIN | | API-RATE-LIMIT-POOL | SPOT | - | API-RATE-LIMIT | 2 | + | API-RATE-LIMIT | 5 | +---------------------+---------+ """ pass @abstractmethod - def add_order(self, req: AddOrderReq, **kwargs: Any) -> AddOrderResp: + def cancel_all_orders_by_symbol( + self, req: CancelAllOrdersBySymbolReq, + **kwargs: Any) -> CancelAllOrdersBySymbolResp: """ - summary: Add Order - description: Place order to the Cross-margin or Isolated-margin trading system, you can place two major types of orders: limit and market. Orders can only be placed if your account has sufficient funds. Once an order is placed, your funds will be put on hold for the duration of the order. The amount of funds on hold depends on the order type and parameters specified. - documentation: https://www.kucoin.com/docs-new/api-3470204 + summary: Cancel All Orders By Symbol + description: This interface can cancel all open Margin orders by symbol This endpoint only sends cancellation requests. The results of the requests must be obtained by checking the order status or subscribing to websocket. + documentation: https://www.kucoin.com/docs-new/api-3470197 +---------------------+---------+ | Extra API Info | Value | +---------------------+---------+ @@ -126,18 +125,19 @@ def add_order(self, req: AddOrderReq, **kwargs: Any) -> AddOrderResp: | API-CHANNEL | PRIVATE | | API-PERMISSION | MARGIN | | API-RATE-LIMIT-POOL | SPOT | - | API-RATE-LIMIT | 5 | + | API-RATE-LIMIT | 10 | +---------------------+---------+ """ pass @abstractmethod - def add_order_test(self, req: AddOrderTestReq, - **kwargs: Any) -> AddOrderTestResp: + def get_symbols_with_open_order( + self, req: GetSymbolsWithOpenOrderReq, + **kwargs: Any) -> GetSymbolsWithOpenOrderResp: """ - summary: Add Order Test - description: Order test endpoint, the request parameters and return parameters of this endpoint are exactly the same as the order endpoint, and can be used to verify whether the signature is correct and other operations. After placing an order, the order will not enter the matching system, and the order cannot be queried. - documentation: https://www.kucoin.com/docs-new/api-3470205 + summary: Get Symbols With Open Order + description: This interface can query all Margin symbol that has active orders + documentation: https://www.kucoin.com/docs-new/api-3470196 +---------------------+---------+ | Extra API Info | Value | +---------------------+---------+ @@ -145,7 +145,7 @@ def add_order_test(self, req: AddOrderTestReq, | API-CHANNEL | PRIVATE | | API-PERMISSION | MARGIN | | API-RATE-LIMIT-POOL | SPOT | - | API-RATE-LIMIT | 5 | + | API-RATE-LIMIT | 2 | +---------------------+---------+ """ pass @@ -170,32 +170,31 @@ def get_open_orders(self, req: GetOpenOrdersReq, pass @abstractmethod - def cancel_order_by_client_oid( - self, req: CancelOrderByClientOidReq, - **kwargs: Any) -> CancelOrderByClientOidResp: + def get_closed_orders(self, req: GetClosedOrdersReq, + **kwargs: Any) -> GetClosedOrdersResp: """ - summary: Cancel Order By ClientOid - description: This endpoint can be used to cancel a margin order by clientOid. This endpoint only sends cancellation requests. The results of the requests must be obtained by checking the order status or subscribing to websocket. - documentation: https://www.kucoin.com/docs-new/api-3470201 + summary: Get Closed Orders + description: This interface is to obtain all Margin closed order lists, and the return value of the active order interface is the paged data of all uncompleted order lists. The returned data is sorted in descending order according to the latest update time of the order. After the user successfully places an order, the order is in Active state, and the user can use inOrderBook to determine whether the order has entered the order. Canceled or fully filled orders are marked as completed Done status. + documentation: https://www.kucoin.com/docs-new/api-3470199 +---------------------+---------+ | Extra API Info | Value | +---------------------+---------+ | API-DOMAIN | SPOT | | API-CHANNEL | PRIVATE | - | API-PERMISSION | MARGIN | + | API-PERMISSION | GENERAL | | API-RATE-LIMIT-POOL | SPOT | - | API-RATE-LIMIT | 5 | + | API-RATE-LIMIT | 10 | +---------------------+---------+ """ pass @abstractmethod - def get_order_by_client_oid(self, req: GetOrderByClientOidReq, - **kwargs: Any) -> GetOrderByClientOidResp: + def get_trade_history(self, req: GetTradeHistoryReq, + **kwargs: Any) -> GetTradeHistoryResp: """ - summary: Get Order By ClientOid - description: This endpoint can be used to obtain information for a single Margin order using the client order id. After the user successfully places an order, the order is in Active state, and the user can use inOrderBook to determine whether the order has entered the order. Canceled or fully filled orders are marked as completed Done status. - documentation: https://www.kucoin.com/docs-new/api-3470203 + summary: Get Trade History + description: This endpoint can be used to obtain a list of the latest Margin transaction details. The returned data is sorted in descending order according to the latest update time of the order. + documentation: https://www.kucoin.com/docs-new/api-3470200 +---------------------+---------+ | Extra API Info | Value | +---------------------+---------+ @@ -209,32 +208,31 @@ def get_order_by_client_oid(self, req: GetOrderByClientOidReq, pass @abstractmethod - def cancel_all_orders_by_symbol( - self, req: CancelAllOrdersBySymbolReq, - **kwargs: Any) -> CancelAllOrdersBySymbolResp: + def get_order_by_order_id(self, req: GetOrderByOrderIdReq, + **kwargs: Any) -> GetOrderByOrderIdResp: """ - summary: Cancel All Orders By Symbol - description: This interface can cancel all open Margin orders by symbol This endpoint only sends cancellation requests. The results of the requests must be obtained by checking the order status or subscribing to websocket. - documentation: https://www.kucoin.com/docs-new/api-3470197 + summary: Get Order By OrderId + description: This endpoint can be used to obtain information for a single Margin order using the order id. After the user successfully places an order, the order is in Active state, and the user can use inOrderBook to determine whether the order has entered the order. Canceled or fully filled orders are marked as completed Done status. + documentation: https://www.kucoin.com/docs-new/api-3470202 +---------------------+---------+ | Extra API Info | Value | +---------------------+---------+ | API-DOMAIN | SPOT | | API-CHANNEL | PRIVATE | - | API-PERMISSION | MARGIN | + | API-PERMISSION | GENERAL | | API-RATE-LIMIT-POOL | SPOT | - | API-RATE-LIMIT | 10 | + | API-RATE-LIMIT | 5 | +---------------------+---------+ """ pass @abstractmethod - def get_closed_orders(self, req: GetClosedOrdersReq, - **kwargs: Any) -> GetClosedOrdersResp: + def get_order_by_client_oid(self, req: GetOrderByClientOidReq, + **kwargs: Any) -> GetOrderByClientOidResp: """ - summary: Get Closed Orders - description: This interface is to obtain all Margin closed order lists, and the return value of the active order interface is the paged data of all uncompleted order lists. The returned data is sorted in descending order according to the latest update time of the order. After the user successfully places an order, the order is in Active state, and the user can use inOrderBook to determine whether the order has entered the order. Canceled or fully filled orders are marked as completed Done status. - documentation: https://www.kucoin.com/docs-new/api-3470199 + summary: Get Order By ClientOid + description: This endpoint can be used to obtain information for a single Margin order using the client order id. After the user successfully places an order, the order is in Active state, and the user can use inOrderBook to determine whether the order has entered the order. Canceled or fully filled orders are marked as completed Done status. + documentation: https://www.kucoin.com/docs-new/api-3470203 +---------------------+---------+ | Extra API Info | Value | +---------------------+---------+ @@ -242,18 +240,19 @@ def get_closed_orders(self, req: GetClosedOrdersReq, | API-CHANNEL | PRIVATE | | API-PERMISSION | GENERAL | | API-RATE-LIMIT-POOL | SPOT | - | API-RATE-LIMIT | 10 | + | API-RATE-LIMIT | 5 | +---------------------+---------+ """ pass @abstractmethod - def cancel_order_by_order_id(self, req: CancelOrderByOrderIdReq, - **kwargs: Any) -> CancelOrderByOrderIdResp: + @deprecated('') + def add_order_v1(self, req: AddOrderV1Req, + **kwargs: Any) -> AddOrderV1Resp: """ - summary: Cancel Order By OrderId - description: This endpoint can be used to cancel a margin order by orderId. This endpoint only sends cancellation requests. The results of the requests must be obtained by checking the order status or subscribing to websocket. - documentation: https://www.kucoin.com/docs-new/api-3470195 + summary: Add Order - V1 + description: Place order to the Cross-margin or Isolated-margin trading system, you can place two major types of orders: limit and market. Orders can only be placed if your account has sufficient funds. Once an order is placed, your funds will be put on hold for the duration of the order. The amount of funds on hold depends on the order type and parameters specified. + documentation: https://www.kucoin.com/docs-new/api-3470312 +---------------------+---------+ | Extra API Info | Value | +---------------------+---------+ @@ -267,18 +266,19 @@ def cancel_order_by_order_id(self, req: CancelOrderByOrderIdReq, pass @abstractmethod - def get_order_by_order_id(self, req: GetOrderByOrderIdReq, - **kwargs: Any) -> GetOrderByOrderIdResp: + @deprecated('') + def add_order_test_v1(self, req: AddOrderTestV1Req, + **kwargs: Any) -> AddOrderTestV1Resp: """ - summary: Get Order By OrderId - description: This endpoint can be used to obtain information for a single Margin order using the order id. After the user successfully places an order, the order is in Active state, and the user can use inOrderBook to determine whether the order has entered the order. Canceled or fully filled orders are marked as completed Done status. - documentation: https://www.kucoin.com/docs-new/api-3470202 + summary: Add Order Test - V1 + description: Order test endpoint, the request parameters and return parameters of this endpoint are exactly the same as the order endpoint, and can be used to verify whether the signature is correct and other operations. After placing an order, the order will not enter the matching system, and the order cannot be queried. + documentation: https://www.kucoin.com/docs-new/api-3470313 +---------------------+---------+ | Extra API Info | Value | +---------------------+---------+ | API-DOMAIN | SPOT | | API-CHANNEL | PRIVATE | - | API-PERMISSION | GENERAL | + | API-PERMISSION | MARGIN | | API-RATE-LIMIT-POOL | SPOT | | API-RATE-LIMIT | 5 | +---------------------+---------+ @@ -291,32 +291,6 @@ class OrderAPIImpl(OrderAPI): def __init__(self, transport: Transport): self.transport = transport - def add_order_v1(self, req: AddOrderV1Req, - **kwargs: Any) -> AddOrderV1Resp: - return self.transport.call("spot", False, - "POST", "/api/v1/margin/order", req, - AddOrderV1Resp(), False, **kwargs) - - def add_order_test_v1(self, req: AddOrderTestV1Req, - **kwargs: Any) -> AddOrderTestV1Resp: - return self.transport.call("spot", False, "POST", - "/api/v1/margin/order/test", req, - AddOrderTestV1Resp(), False, **kwargs) - - def get_trade_history(self, req: GetTradeHistoryReq, - **kwargs: Any) -> GetTradeHistoryResp: - return self.transport.call("spot", False, "GET", - "/api/v3/hf/margin/fills", req, - GetTradeHistoryResp(), False, **kwargs) - - def get_symbols_with_open_order( - self, req: GetSymbolsWithOpenOrderReq, - **kwargs: Any) -> GetSymbolsWithOpenOrderResp: - return self.transport.call("spot", False, "GET", - "/api/v3/hf/margin/order/active/symbols", - req, GetSymbolsWithOpenOrderResp(), False, - **kwargs) - def add_order(self, req: AddOrderReq, **kwargs: Any) -> AddOrderResp: return self.transport.call("spot", False, "POST", "/api/v3/hf/margin/order", req, @@ -328,11 +302,11 @@ def add_order_test(self, req: AddOrderTestReq, "/api/v3/hf/margin/order/test", req, AddOrderTestResp(), False, **kwargs) - def get_open_orders(self, req: GetOpenOrdersReq, - **kwargs: Any) -> GetOpenOrdersResp: - return self.transport.call("spot", False, "GET", - "/api/v3/hf/margin/orders/active", req, - GetOpenOrdersResp(), False, **kwargs) + def cancel_order_by_order_id(self, req: CancelOrderByOrderIdReq, + **kwargs: Any) -> CancelOrderByOrderIdResp: + return self.transport.call("spot", False, "DELETE", + "/api/v3/hf/margin/orders/{orderId}", req, + CancelOrderByOrderIdResp(), False, **kwargs) def cancel_order_by_client_oid( self, req: CancelOrderByClientOidReq, @@ -342,13 +316,6 @@ def cancel_order_by_client_oid( "/api/v3/hf/margin/orders/client-order/{clientOid}", req, CancelOrderByClientOidResp(), False, **kwargs) - def get_order_by_client_oid(self, req: GetOrderByClientOidReq, - **kwargs: Any) -> GetOrderByClientOidResp: - return self.transport.call( - "spot", False, "GET", - "/api/v3/hf/margin/orders/client-order/{clientOid}", req, - GetOrderByClientOidResp(), False, **kwargs) - def cancel_all_orders_by_symbol( self, req: CancelAllOrdersBySymbolReq, **kwargs: Any) -> CancelAllOrdersBySymbolResp: @@ -357,20 +324,53 @@ def cancel_all_orders_by_symbol( CancelAllOrdersBySymbolResp(), False, **kwargs) + def get_symbols_with_open_order( + self, req: GetSymbolsWithOpenOrderReq, + **kwargs: Any) -> GetSymbolsWithOpenOrderResp: + return self.transport.call("spot", False, "GET", + "/api/v3/hf/margin/order/active/symbols", + req, GetSymbolsWithOpenOrderResp(), False, + **kwargs) + + def get_open_orders(self, req: GetOpenOrdersReq, + **kwargs: Any) -> GetOpenOrdersResp: + return self.transport.call("spot", False, "GET", + "/api/v3/hf/margin/orders/active", req, + GetOpenOrdersResp(), False, **kwargs) + def get_closed_orders(self, req: GetClosedOrdersReq, **kwargs: Any) -> GetClosedOrdersResp: return self.transport.call("spot", False, "GET", "/api/v3/hf/margin/orders/done", req, GetClosedOrdersResp(), False, **kwargs) - def cancel_order_by_order_id(self, req: CancelOrderByOrderIdReq, - **kwargs: Any) -> CancelOrderByOrderIdResp: - return self.transport.call("spot", False, "DELETE", - "/api/v3/hf/margin/orders/{orderId}", req, - CancelOrderByOrderIdResp(), False, **kwargs) + def get_trade_history(self, req: GetTradeHistoryReq, + **kwargs: Any) -> GetTradeHistoryResp: + return self.transport.call("spot", False, "GET", + "/api/v3/hf/margin/fills", req, + GetTradeHistoryResp(), False, **kwargs) def get_order_by_order_id(self, req: GetOrderByOrderIdReq, **kwargs: Any) -> GetOrderByOrderIdResp: return self.transport.call("spot", False, "GET", "/api/v3/hf/margin/orders/{orderId}", req, GetOrderByOrderIdResp(), False, **kwargs) + + def get_order_by_client_oid(self, req: GetOrderByClientOidReq, + **kwargs: Any) -> GetOrderByClientOidResp: + return self.transport.call( + "spot", False, "GET", + "/api/v3/hf/margin/orders/client-order/{clientOid}", req, + GetOrderByClientOidResp(), False, **kwargs) + + def add_order_v1(self, req: AddOrderV1Req, + **kwargs: Any) -> AddOrderV1Resp: + return self.transport.call("spot", False, + "POST", "/api/v1/margin/order", req, + AddOrderV1Resp(), False, **kwargs) + + def add_order_test_v1(self, req: AddOrderTestV1Req, + **kwargs: Any) -> AddOrderTestV1Resp: + return self.transport.call("spot", False, "POST", + "/api/v1/margin/order/test", req, + AddOrderTestV1Resp(), False, **kwargs) diff --git a/sdk/python/kucoin_universal_sdk/generate/margin/order/api_order.template b/sdk/python/kucoin_universal_sdk/generate/margin/order/api_order.template index db3003ae..a5f56078 100644 --- a/sdk/python/kucoin_universal_sdk/generate/margin/order/api_order.template +++ b/sdk/python/kucoin_universal_sdk/generate/margin/order/api_order.template @@ -1,18 +1,18 @@ # API FUNCTION TEMPLATE -def test_add_order_v1_req(self): +def test_add_order_req(self): """ - add_order_v1 - Add Order - V1 - /api/v1/margin/order + add_order + Add Order + /api/v3/hf/margin/order """ - builder = AddOrderV1ReqBuilder() - builder.set_client_oid(?).set_side(?).set_symbol(?).set_type(?).set_stp(?).set_price(?).set_size(?).set_time_in_force(?).set_post_only(?).set_hidden(?).set_iceberg(?).set_visible_size(?).set_cancel_after(?).set_funds(?).set_auto_borrow(?).set_auto_repay(?).set_margin_model(?) + builder = AddOrderReqBuilder() + builder.set_client_oid(?).set_side(?).set_symbol(?).set_type(?).set_stp(?).set_price(?).set_size(?).set_time_in_force(?).set_post_only(?).set_hidden(?).set_iceberg(?).set_visible_size(?).set_cancel_after(?).set_funds(?).set_is_isolated(?).set_auto_borrow(?).set_auto_repay(?) req = builder.build() try: - resp = self.api.add_order_v1(req) + resp = self.api.add_order(req) print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) @@ -20,18 +20,18 @@ def test_add_order_v1_req(self): print("error: ", e) raise e -def test_add_order_test_v1_req(self): +def test_add_order_test_req(self): """ - add_order_test_v1 - Add Order Test - V1 - /api/v1/margin/order/test + add_order_test + Add Order Test + /api/v3/hf/margin/order/test """ - builder = AddOrderTestV1ReqBuilder() - builder.set_client_oid(?).set_side(?).set_symbol(?).set_type(?).set_stp(?).set_price(?).set_size(?).set_time_in_force(?).set_post_only(?).set_hidden(?).set_iceberg(?).set_visible_size(?).set_cancel_after(?).set_funds(?).set_auto_borrow(?).set_auto_repay(?).set_margin_model(?) + builder = AddOrderTestReqBuilder() + builder.set_client_oid(?).set_side(?).set_symbol(?).set_type(?).set_stp(?).set_price(?).set_size(?).set_time_in_force(?).set_post_only(?).set_hidden(?).set_iceberg(?).set_visible_size(?).set_cancel_after(?).set_funds(?).set_is_isolated(?).set_auto_borrow(?).set_auto_repay(?) req = builder.build() try: - resp = self.api.add_order_test_v1(req) + resp = self.api.add_order_test(req) print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) @@ -39,18 +39,18 @@ def test_add_order_test_v1_req(self): print("error: ", e) raise e -def test_get_trade_history_req(self): +def test_cancel_order_by_order_id_req(self): """ - get_trade_history - Get Trade History - /api/v3/hf/margin/fills + cancel_order_by_order_id + Cancel Order By OrderId + /api/v3/hf/margin/orders/{orderId} """ - builder = GetTradeHistoryReqBuilder() - builder.set_symbol(?).set_trade_type(?).set_order_id(?).set_side(?).set_type(?).set_last_id(?).set_limit(?).set_start_at(?).set_end_at(?) + builder = CancelOrderByOrderIdReqBuilder() + builder.set_order_id(?).set_symbol(?) req = builder.build() try: - resp = self.api.get_trade_history(req) + resp = self.api.cancel_order_by_order_id(req) print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) @@ -58,18 +58,18 @@ def test_get_trade_history_req(self): print("error: ", e) raise e -def test_get_symbols_with_open_order_req(self): +def test_cancel_order_by_client_oid_req(self): """ - get_symbols_with_open_order - Get Symbols With Open Order - /api/v3/hf/margin/order/active/symbols + cancel_order_by_client_oid + Cancel Order By ClientOid + /api/v3/hf/margin/orders/client-order/{clientOid} """ - builder = GetSymbolsWithOpenOrderReqBuilder() - builder.set_trade_type(?) + builder = CancelOrderByClientOidReqBuilder() + builder.set_client_oid(?).set_symbol(?) req = builder.build() try: - resp = self.api.get_symbols_with_open_order(req) + resp = self.api.cancel_order_by_client_oid(req) print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) @@ -77,18 +77,18 @@ def test_get_symbols_with_open_order_req(self): print("error: ", e) raise e -def test_add_order_req(self): +def test_cancel_all_orders_by_symbol_req(self): """ - add_order - Add Order - /api/v3/hf/margin/order + cancel_all_orders_by_symbol + Cancel All Orders By Symbol + /api/v3/hf/margin/orders """ - builder = AddOrderReqBuilder() - builder.set_client_oid(?).set_side(?).set_symbol(?).set_type(?).set_stp(?).set_price(?).set_size(?).set_time_in_force(?).set_post_only(?).set_hidden(?).set_iceberg(?).set_visible_size(?).set_cancel_after(?).set_funds(?).set_is_isolated(?).set_auto_borrow(?).set_auto_repay(?) + builder = CancelAllOrdersBySymbolReqBuilder() + builder.set_symbol(?).set_trade_type(?) req = builder.build() try: - resp = self.api.add_order(req) + resp = self.api.cancel_all_orders_by_symbol(req) print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) @@ -96,18 +96,18 @@ def test_add_order_req(self): print("error: ", e) raise e -def test_add_order_test_req(self): +def test_get_symbols_with_open_order_req(self): """ - add_order_test - Add Order Test - /api/v3/hf/margin/order/test + get_symbols_with_open_order + Get Symbols With Open Order + /api/v3/hf/margin/order/active/symbols """ - builder = AddOrderTestReqBuilder() - builder.set_client_oid(?).set_side(?).set_symbol(?).set_type(?).set_stp(?).set_price(?).set_size(?).set_time_in_force(?).set_post_only(?).set_hidden(?).set_iceberg(?).set_visible_size(?).set_cancel_after(?).set_funds(?).set_is_isolated(?).set_auto_borrow(?).set_auto_repay(?) + builder = GetSymbolsWithOpenOrderReqBuilder() + builder.set_trade_type(?) req = builder.build() try: - resp = self.api.add_order_test(req) + resp = self.api.get_symbols_with_open_order(req) print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) @@ -134,18 +134,18 @@ def test_get_open_orders_req(self): print("error: ", e) raise e -def test_cancel_order_by_client_oid_req(self): +def test_get_closed_orders_req(self): """ - cancel_order_by_client_oid - Cancel Order By ClientOid - /api/v3/hf/margin/orders/client-order/{clientOid} + get_closed_orders + Get Closed Orders + /api/v3/hf/margin/orders/done """ - builder = CancelOrderByClientOidReqBuilder() - builder.set_client_oid(?).set_symbol(?) + builder = GetClosedOrdersReqBuilder() + builder.set_symbol(?).set_trade_type(?).set_side(?).set_type(?).set_last_id(?).set_limit(?).set_start_at(?).set_end_at(?) req = builder.build() try: - resp = self.api.cancel_order_by_client_oid(req) + resp = self.api.get_closed_orders(req) print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) @@ -153,18 +153,18 @@ def test_cancel_order_by_client_oid_req(self): print("error: ", e) raise e -def test_get_order_by_client_oid_req(self): +def test_get_trade_history_req(self): """ - get_order_by_client_oid - Get Order By ClientOid - /api/v3/hf/margin/orders/client-order/{clientOid} + get_trade_history + Get Trade History + /api/v3/hf/margin/fills """ - builder = GetOrderByClientOidReqBuilder() - builder.set_symbol(?).set_client_oid(?) + builder = GetTradeHistoryReqBuilder() + builder.set_symbol(?).set_trade_type(?).set_order_id(?).set_side(?).set_type(?).set_last_id(?).set_limit(?).set_start_at(?).set_end_at(?) req = builder.build() try: - resp = self.api.get_order_by_client_oid(req) + resp = self.api.get_trade_history(req) print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) @@ -172,18 +172,18 @@ def test_get_order_by_client_oid_req(self): print("error: ", e) raise e -def test_cancel_all_orders_by_symbol_req(self): +def test_get_order_by_order_id_req(self): """ - cancel_all_orders_by_symbol - Cancel All Orders By Symbol - /api/v3/hf/margin/orders + get_order_by_order_id + Get Order By OrderId + /api/v3/hf/margin/orders/{orderId} """ - builder = CancelAllOrdersBySymbolReqBuilder() - builder.set_symbol(?).set_trade_type(?) + builder = GetOrderByOrderIdReqBuilder() + builder.set_symbol(?).set_order_id(?) req = builder.build() try: - resp = self.api.cancel_all_orders_by_symbol(req) + resp = self.api.get_order_by_order_id(req) print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) @@ -191,18 +191,18 @@ def test_cancel_all_orders_by_symbol_req(self): print("error: ", e) raise e -def test_get_closed_orders_req(self): +def test_get_order_by_client_oid_req(self): """ - get_closed_orders - Get Closed Orders - /api/v3/hf/margin/orders/done + get_order_by_client_oid + Get Order By ClientOid + /api/v3/hf/margin/orders/client-order/{clientOid} """ - builder = GetClosedOrdersReqBuilder() - builder.set_symbol(?).set_trade_type(?).set_side(?).set_type(?).set_last_id(?).set_limit(?).set_start_at(?).set_end_at(?) + builder = GetOrderByClientOidReqBuilder() + builder.set_symbol(?).set_client_oid(?) req = builder.build() try: - resp = self.api.get_closed_orders(req) + resp = self.api.get_order_by_client_oid(req) print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) @@ -210,18 +210,18 @@ def test_get_closed_orders_req(self): print("error: ", e) raise e -def test_cancel_order_by_order_id_req(self): +def test_add_order_v1_req(self): """ - cancel_order_by_order_id - Cancel Order By OrderId - /api/v3/hf/margin/orders/{orderId} + add_order_v1 + Add Order - V1 + /api/v1/margin/order """ - builder = CancelOrderByOrderIdReqBuilder() - builder.set_order_id(?).set_symbol(?) + builder = AddOrderV1ReqBuilder() + builder.set_client_oid(?).set_side(?).set_symbol(?).set_type(?).set_stp(?).set_price(?).set_size(?).set_time_in_force(?).set_post_only(?).set_hidden(?).set_iceberg(?).set_visible_size(?).set_cancel_after(?).set_funds(?).set_auto_borrow(?).set_auto_repay(?).set_margin_model(?) req = builder.build() try: - resp = self.api.cancel_order_by_order_id(req) + resp = self.api.add_order_v1(req) print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) @@ -229,18 +229,18 @@ def test_cancel_order_by_order_id_req(self): print("error: ", e) raise e -def test_get_order_by_order_id_req(self): +def test_add_order_test_v1_req(self): """ - get_order_by_order_id - Get Order By OrderId - /api/v3/hf/margin/orders/{orderId} + add_order_test_v1 + Add Order Test - V1 + /api/v1/margin/order/test """ - builder = GetOrderByOrderIdReqBuilder() - builder.set_symbol(?).set_order_id(?) + builder = AddOrderTestV1ReqBuilder() + builder.set_client_oid(?).set_side(?).set_symbol(?).set_type(?).set_stp(?).set_price(?).set_size(?).set_time_in_force(?).set_post_only(?).set_hidden(?).set_iceberg(?).set_visible_size(?).set_cancel_after(?).set_funds(?).set_auto_borrow(?).set_auto_repay(?).set_margin_model(?) req = builder.build() try: - resp = self.api.get_order_by_order_id(req) + resp = self.api.add_order_test_v1(req) print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) diff --git a/sdk/python/kucoin_universal_sdk/generate/margin/order/api_order_test.py b/sdk/python/kucoin_universal_sdk/generate/margin/order/api_order_test.py index e7b0bbe5..62a5e47f 100644 --- a/sdk/python/kucoin_universal_sdk/generate/margin/order/api_order_test.py +++ b/sdk/python/kucoin_universal_sdk/generate/margin/order/api_order_test.py @@ -31,82 +31,6 @@ class OrderAPITest(unittest.TestCase): - def test_add_order_v1_req_model(self): - """ - add_order_v1 - Add Order - V1 - /api/v1/margin/order - """ - data = "{\"type\": \"limit\", \"symbol\": \"BTC-USDT\", \"side\": \"buy\", \"price\": \"50000\", \"size\": \"0.00001\", \"clientOid\": \"5c52e11203aa677f33e4193fb\", \"remark\": \"order remarks\"}" - req = AddOrderV1Req.from_json(data) - - def test_add_order_v1_resp_model(self): - """ - add_order_v1 - Add Order - V1 - /api/v1/margin/order - """ - data = "{\n \"code\": \"200000\",\n \"data\": {\n \"orderId\": \"671bb90194422f00073ff4f0\",\n \"loanApplyId\": null,\n \"borrowSize\": null,\n \"clientOid\": null\n }\n}" - common_response = RestResponse.from_json(data) - resp = AddOrderV1Resp.from_dict(common_response.data) - - def test_add_order_test_v1_req_model(self): - """ - add_order_test_v1 - Add Order Test - V1 - /api/v1/margin/order/test - """ - data = "{\"type\": \"limit\", \"symbol\": \"BTC-USDT\", \"side\": \"buy\", \"price\": \"50000\", \"size\": \"0.00001\", \"clientOid\": \"5c52e11203aa677f33e4193fb\", \"remark\": \"order remarks\"}" - req = AddOrderTestV1Req.from_json(data) - - def test_add_order_test_v1_resp_model(self): - """ - add_order_test_v1 - Add Order Test - V1 - /api/v1/margin/order/test - """ - data = "{\n \"code\": \"200000\",\n \"data\": {\n \"orderId\": \"671bb90194422f00073ff4f0\",\n \"loanApplyId\": null,\n \"borrowSize\": null,\n \"clientOid\": null\n }\n}" - common_response = RestResponse.from_json(data) - resp = AddOrderTestV1Resp.from_dict(common_response.data) - - def test_get_trade_history_req_model(self): - """ - get_trade_history - Get Trade History - /api/v3/hf/margin/fills - """ - data = "{\"symbol\": \"BTC-USDT\", \"tradeType\": \"MARGIN_TRADE\", \"orderId\": \"example_string_default_value\", \"side\": \"buy\", \"type\": \"limit\", \"lastId\": 254062248624417, \"limit\": 100, \"startAt\": 1728663338000, \"endAt\": 1728692138000}" - req = GetTradeHistoryReq.from_json(data) - - def test_get_trade_history_resp_model(self): - """ - get_trade_history - Get Trade History - /api/v3/hf/margin/fills - """ - data = "{\n \"code\": \"200000\",\n \"data\": {\n \"items\": [\n {\n \"id\": 137891621991,\n \"symbol\": \"BTC-USDT\",\n \"tradeId\": 11040911994273793,\n \"orderId\": \"671868085584bc0007d85f46\",\n \"counterOrderId\": \"67186805b7cbdf00071621f9\",\n \"side\": \"buy\",\n \"liquidity\": \"taker\",\n \"forceTaker\": false,\n \"price\": \"67141.6\",\n \"size\": \"0.00001\",\n \"funds\": \"0.671416\",\n \"fee\": \"0.000671416\",\n \"feeRate\": \"0.001\",\n \"feeCurrency\": \"USDT\",\n \"stop\": \"\",\n \"tradeType\": \"MARGIN_TRADE\",\n \"tax\": \"0\",\n \"taxRate\": \"0\",\n \"type\": \"limit\",\n \"createdAt\": 1729652744998\n }\n ],\n \"lastId\": 137891621991\n }\n}" - common_response = RestResponse.from_json(data) - resp = GetTradeHistoryResp.from_dict(common_response.data) - - def test_get_symbols_with_open_order_req_model(self): - """ - get_symbols_with_open_order - Get Symbols With Open Order - /api/v3/hf/margin/order/active/symbols - """ - data = "{\"tradeType\": \"MARGIN_TRADE\"}" - req = GetSymbolsWithOpenOrderReq.from_json(data) - - def test_get_symbols_with_open_order_resp_model(self): - """ - get_symbols_with_open_order - Get Symbols With Open Order - /api/v3/hf/margin/order/active/symbols - """ - data = "{\n \"code\": \"200000\",\n \"data\": {\n \"symbolSize\": 1,\n \"symbols\": [\n \"BTC-USDT\"\n ]\n }\n}" - common_response = RestResponse.from_json(data) - resp = GetSymbolsWithOpenOrderResp.from_dict(common_response.data) - def test_add_order_req_model(self): """ add_order @@ -145,24 +69,24 @@ def test_add_order_test_resp_model(self): common_response = RestResponse.from_json(data) resp = AddOrderTestResp.from_dict(common_response.data) - def test_get_open_orders_req_model(self): + def test_cancel_order_by_order_id_req_model(self): """ - get_open_orders - Get Open Orders - /api/v3/hf/margin/orders/active + cancel_order_by_order_id + Cancel Order By OrderId + /api/v3/hf/margin/orders/{orderId} """ - data = "{\"symbol\": \"BTC-USDT\", \"tradeType\": \"MARGIN_TRADE\"}" - req = GetOpenOrdersReq.from_json(data) + data = "{\"orderId\": \"671663e02188630007e21c9c\", \"symbol\": \"BTC-USDT\"}" + req = CancelOrderByOrderIdReq.from_json(data) - def test_get_open_orders_resp_model(self): + def test_cancel_order_by_order_id_resp_model(self): """ - get_open_orders - Get Open Orders - /api/v3/hf/margin/orders/active + cancel_order_by_order_id + Cancel Order By OrderId + /api/v3/hf/margin/orders/{orderId} """ - data = "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"id\": \"671667306afcdb000723107f\",\n \"clientOid\": \"5c52e11203aa677f33e493fb\",\n \"symbol\": \"BTC-USDT\",\n \"opType\": \"DEAL\",\n \"type\": \"limit\",\n \"side\": \"buy\",\n \"price\": \"50000\",\n \"size\": \"0.00001\",\n \"funds\": \"0.5\",\n \"dealSize\": \"0\",\n \"dealFunds\": \"0\",\n \"remainSize\": \"0.00001\",\n \"remainFunds\": \"0.5\",\n \"cancelledSize\": \"0\",\n \"cancelledFunds\": \"0\",\n \"fee\": \"0\",\n \"feeCurrency\": \"USDT\",\n \"stp\": null,\n \"stop\": null,\n \"stopTriggered\": false,\n \"stopPrice\": \"0\",\n \"timeInForce\": \"GTC\",\n \"postOnly\": false,\n \"hidden\": false,\n \"iceberg\": false,\n \"visibleSize\": \"0\",\n \"cancelAfter\": 0,\n \"channel\": \"API\",\n \"remark\": null,\n \"tags\": null,\n \"cancelExist\": false,\n \"tradeType\": \"MARGIN_TRADE\",\n \"inOrderBook\": true,\n \"active\": true,\n \"tax\": \"0\",\n \"createdAt\": 1729521456248,\n \"lastUpdatedAt\": 1729521460940\n }\n ]\n}" + data = "{\"code\":\"200000\",\"data\":{\"orderId\":\"671663e02188630007e21c9c\"}}" common_response = RestResponse.from_json(data) - resp = GetOpenOrdersResp.from_dict(common_response.data) + resp = CancelOrderByOrderIdResp.from_dict(common_response.data) def test_cancel_order_by_client_oid_req_model(self): """ @@ -183,25 +107,6 @@ def test_cancel_order_by_client_oid_resp_model(self): common_response = RestResponse.from_json(data) resp = CancelOrderByClientOidResp.from_dict(common_response.data) - def test_get_order_by_client_oid_req_model(self): - """ - get_order_by_client_oid - Get Order By ClientOid - /api/v3/hf/margin/orders/client-order/{clientOid} - """ - data = "{\"symbol\": \"BTC-USDT\", \"clientOid\": \"5c52e11203aa677f33e493fb\"}" - req = GetOrderByClientOidReq.from_json(data) - - def test_get_order_by_client_oid_resp_model(self): - """ - get_order_by_client_oid - Get Order By ClientOid - /api/v3/hf/margin/orders/client-order/{clientOid} - """ - data = "{\n \"code\": \"200000\",\n \"data\": {\n \"id\": \"671667306afcdb000723107f\",\n \"symbol\": \"BTC-USDT\",\n \"opType\": \"DEAL\",\n \"type\": \"limit\",\n \"side\": \"buy\",\n \"price\": \"50000\",\n \"size\": \"0.00001\",\n \"funds\": \"0.5\",\n \"dealSize\": \"0\",\n \"dealFunds\": \"0\",\n \"fee\": \"0\",\n \"feeCurrency\": \"USDT\",\n \"stp\": null,\n \"stop\": null,\n \"stopTriggered\": false,\n \"stopPrice\": \"0\",\n \"timeInForce\": \"GTC\",\n \"postOnly\": false,\n \"hidden\": false,\n \"iceberg\": false,\n \"visibleSize\": \"0\",\n \"cancelAfter\": 0,\n \"channel\": \"API\",\n \"clientOid\": \"5c52e11203aa677f33e493fb\",\n \"remark\": null,\n \"tags\": null,\n \"cancelExist\": false,\n \"createdAt\": 1729521456248,\n \"lastUpdatedAt\": 1729651011877,\n \"tradeType\": \"MARGIN_TRADE\",\n \"inOrderBook\": true,\n \"cancelledSize\": \"0\",\n \"cancelledFunds\": \"0\",\n \"remainSize\": \"0.00001\",\n \"remainFunds\": \"0.5\",\n \"tax\": \"0\",\n \"active\": true\n }\n}" - common_response = RestResponse.from_json(data) - resp = GetOrderByClientOidResp.from_dict(common_response.data) - def test_cancel_all_orders_by_symbol_req_model(self): """ cancel_all_orders_by_symbol @@ -221,6 +126,44 @@ def test_cancel_all_orders_by_symbol_resp_model(self): common_response = RestResponse.from_json(data) resp = CancelAllOrdersBySymbolResp.from_dict(common_response.data) + def test_get_symbols_with_open_order_req_model(self): + """ + get_symbols_with_open_order + Get Symbols With Open Order + /api/v3/hf/margin/order/active/symbols + """ + data = "{\"tradeType\": \"MARGIN_TRADE\"}" + req = GetSymbolsWithOpenOrderReq.from_json(data) + + def test_get_symbols_with_open_order_resp_model(self): + """ + get_symbols_with_open_order + Get Symbols With Open Order + /api/v3/hf/margin/order/active/symbols + """ + data = "{\n \"code\": \"200000\",\n \"data\": {\n \"symbolSize\": 1,\n \"symbols\": [\n \"BTC-USDT\"\n ]\n }\n}" + common_response = RestResponse.from_json(data) + resp = GetSymbolsWithOpenOrderResp.from_dict(common_response.data) + + def test_get_open_orders_req_model(self): + """ + get_open_orders + Get Open Orders + /api/v3/hf/margin/orders/active + """ + data = "{\"symbol\": \"BTC-USDT\", \"tradeType\": \"MARGIN_TRADE\"}" + req = GetOpenOrdersReq.from_json(data) + + def test_get_open_orders_resp_model(self): + """ + get_open_orders + Get Open Orders + /api/v3/hf/margin/orders/active + """ + data = "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"id\": \"671667306afcdb000723107f\",\n \"clientOid\": \"5c52e11203aa677f33e493fb\",\n \"symbol\": \"BTC-USDT\",\n \"opType\": \"DEAL\",\n \"type\": \"limit\",\n \"side\": \"buy\",\n \"price\": \"50000\",\n \"size\": \"0.00001\",\n \"funds\": \"0.5\",\n \"dealSize\": \"0\",\n \"dealFunds\": \"0\",\n \"remainSize\": \"0.00001\",\n \"remainFunds\": \"0.5\",\n \"cancelledSize\": \"0\",\n \"cancelledFunds\": \"0\",\n \"fee\": \"0\",\n \"feeCurrency\": \"USDT\",\n \"stp\": null,\n \"stop\": null,\n \"stopTriggered\": false,\n \"stopPrice\": \"0\",\n \"timeInForce\": \"GTC\",\n \"postOnly\": false,\n \"hidden\": false,\n \"iceberg\": false,\n \"visibleSize\": \"0\",\n \"cancelAfter\": 0,\n \"channel\": \"API\",\n \"remark\": null,\n \"tags\": null,\n \"cancelExist\": false,\n \"tradeType\": \"MARGIN_TRADE\",\n \"inOrderBook\": true,\n \"active\": true,\n \"tax\": \"0\",\n \"createdAt\": 1729521456248,\n \"lastUpdatedAt\": 1729521460940\n }\n ]\n}" + common_response = RestResponse.from_json(data) + resp = GetOpenOrdersResp.from_dict(common_response.data) + def test_get_closed_orders_req_model(self): """ get_closed_orders @@ -240,24 +183,24 @@ def test_get_closed_orders_resp_model(self): common_response = RestResponse.from_json(data) resp = GetClosedOrdersResp.from_dict(common_response.data) - def test_cancel_order_by_order_id_req_model(self): + def test_get_trade_history_req_model(self): """ - cancel_order_by_order_id - Cancel Order By OrderId - /api/v3/hf/margin/orders/{orderId} + get_trade_history + Get Trade History + /api/v3/hf/margin/fills """ - data = "{\"orderId\": \"671663e02188630007e21c9c\", \"symbol\": \"BTC-USDT\"}" - req = CancelOrderByOrderIdReq.from_json(data) + data = "{\"symbol\": \"BTC-USDT\", \"tradeType\": \"MARGIN_TRADE\", \"orderId\": \"example_string_default_value\", \"side\": \"buy\", \"type\": \"limit\", \"lastId\": 254062248624417, \"limit\": 100, \"startAt\": 1728663338000, \"endAt\": 1728692138000}" + req = GetTradeHistoryReq.from_json(data) - def test_cancel_order_by_order_id_resp_model(self): + def test_get_trade_history_resp_model(self): """ - cancel_order_by_order_id - Cancel Order By OrderId - /api/v3/hf/margin/orders/{orderId} + get_trade_history + Get Trade History + /api/v3/hf/margin/fills """ - data = "{\"code\":\"200000\",\"data\":{\"orderId\":\"671663e02188630007e21c9c\"}}" + data = "{\n \"code\": \"200000\",\n \"data\": {\n \"items\": [\n {\n \"id\": 137891621991,\n \"symbol\": \"BTC-USDT\",\n \"tradeId\": 11040911994273793,\n \"orderId\": \"671868085584bc0007d85f46\",\n \"counterOrderId\": \"67186805b7cbdf00071621f9\",\n \"side\": \"buy\",\n \"liquidity\": \"taker\",\n \"forceTaker\": false,\n \"price\": \"67141.6\",\n \"size\": \"0.00001\",\n \"funds\": \"0.671416\",\n \"fee\": \"0.000671416\",\n \"feeRate\": \"0.001\",\n \"feeCurrency\": \"USDT\",\n \"stop\": \"\",\n \"tradeType\": \"MARGIN_TRADE\",\n \"tax\": \"0\",\n \"taxRate\": \"0\",\n \"type\": \"limit\",\n \"createdAt\": 1729652744998\n }\n ],\n \"lastId\": 137891621991\n }\n}" common_response = RestResponse.from_json(data) - resp = CancelOrderByOrderIdResp.from_dict(common_response.data) + resp = GetTradeHistoryResp.from_dict(common_response.data) def test_get_order_by_order_id_req_model(self): """ @@ -277,3 +220,60 @@ def test_get_order_by_order_id_resp_model(self): data = "{\n \"code\": \"200000\",\n \"data\": {\n \"id\": \"671667306afcdb000723107f\",\n \"symbol\": \"BTC-USDT\",\n \"opType\": \"DEAL\",\n \"type\": \"limit\",\n \"side\": \"buy\",\n \"price\": \"50000\",\n \"size\": \"0.00001\",\n \"funds\": \"0.5\",\n \"dealSize\": \"0\",\n \"dealFunds\": \"0\",\n \"fee\": \"0\",\n \"feeCurrency\": \"USDT\",\n \"stp\": null,\n \"stop\": null,\n \"stopTriggered\": false,\n \"stopPrice\": \"0\",\n \"timeInForce\": \"GTC\",\n \"postOnly\": false,\n \"hidden\": false,\n \"iceberg\": false,\n \"visibleSize\": \"0\",\n \"cancelAfter\": 0,\n \"channel\": \"API\",\n \"clientOid\": \"5c52e11203aa677f33e493fb\",\n \"remark\": null,\n \"tags\": null,\n \"cancelExist\": false,\n \"createdAt\": 1729521456248,\n \"lastUpdatedAt\": 1729651011877,\n \"tradeType\": \"MARGIN_TRADE\",\n \"inOrderBook\": true,\n \"cancelledSize\": \"0\",\n \"cancelledFunds\": \"0\",\n \"remainSize\": \"0.00001\",\n \"remainFunds\": \"0.5\",\n \"tax\": \"0\",\n \"active\": true\n }\n}" common_response = RestResponse.from_json(data) resp = GetOrderByOrderIdResp.from_dict(common_response.data) + + def test_get_order_by_client_oid_req_model(self): + """ + get_order_by_client_oid + Get Order By ClientOid + /api/v3/hf/margin/orders/client-order/{clientOid} + """ + data = "{\"symbol\": \"BTC-USDT\", \"clientOid\": \"5c52e11203aa677f33e493fb\"}" + req = GetOrderByClientOidReq.from_json(data) + + def test_get_order_by_client_oid_resp_model(self): + """ + get_order_by_client_oid + Get Order By ClientOid + /api/v3/hf/margin/orders/client-order/{clientOid} + """ + data = "{\n \"code\": \"200000\",\n \"data\": {\n \"id\": \"671667306afcdb000723107f\",\n \"symbol\": \"BTC-USDT\",\n \"opType\": \"DEAL\",\n \"type\": \"limit\",\n \"side\": \"buy\",\n \"price\": \"50000\",\n \"size\": \"0.00001\",\n \"funds\": \"0.5\",\n \"dealSize\": \"0\",\n \"dealFunds\": \"0\",\n \"fee\": \"0\",\n \"feeCurrency\": \"USDT\",\n \"stp\": null,\n \"stop\": null,\n \"stopTriggered\": false,\n \"stopPrice\": \"0\",\n \"timeInForce\": \"GTC\",\n \"postOnly\": false,\n \"hidden\": false,\n \"iceberg\": false,\n \"visibleSize\": \"0\",\n \"cancelAfter\": 0,\n \"channel\": \"API\",\n \"clientOid\": \"5c52e11203aa677f33e493fb\",\n \"remark\": null,\n \"tags\": null,\n \"cancelExist\": false,\n \"createdAt\": 1729521456248,\n \"lastUpdatedAt\": 1729651011877,\n \"tradeType\": \"MARGIN_TRADE\",\n \"inOrderBook\": true,\n \"cancelledSize\": \"0\",\n \"cancelledFunds\": \"0\",\n \"remainSize\": \"0.00001\",\n \"remainFunds\": \"0.5\",\n \"tax\": \"0\",\n \"active\": true\n }\n}" + common_response = RestResponse.from_json(data) + resp = GetOrderByClientOidResp.from_dict(common_response.data) + + def test_add_order_v1_req_model(self): + """ + add_order_v1 + Add Order - V1 + /api/v1/margin/order + """ + data = "{\"type\": \"limit\", \"symbol\": \"BTC-USDT\", \"side\": \"buy\", \"price\": \"50000\", \"size\": \"0.00001\", \"clientOid\": \"5c52e11203aa677f33e4193fb\", \"remark\": \"order remarks\"}" + req = AddOrderV1Req.from_json(data) + + def test_add_order_v1_resp_model(self): + """ + add_order_v1 + Add Order - V1 + /api/v1/margin/order + """ + data = "{\n \"code\": \"200000\",\n \"data\": {\n \"orderId\": \"671bb90194422f00073ff4f0\",\n \"loanApplyId\": null,\n \"borrowSize\": null,\n \"clientOid\": null\n }\n}" + common_response = RestResponse.from_json(data) + resp = AddOrderV1Resp.from_dict(common_response.data) + + def test_add_order_test_v1_req_model(self): + """ + add_order_test_v1 + Add Order Test - V1 + /api/v1/margin/order/test + """ + data = "{\"type\": \"limit\", \"symbol\": \"BTC-USDT\", \"side\": \"buy\", \"price\": \"50000\", \"size\": \"0.00001\", \"clientOid\": \"5c52e11203aa677f33e4193fb\", \"remark\": \"order remarks\"}" + req = AddOrderTestV1Req.from_json(data) + + def test_add_order_test_v1_resp_model(self): + """ + add_order_test_v1 + Add Order Test - V1 + /api/v1/margin/order/test + """ + data = "{\n \"code\": \"200000\",\n \"data\": {\n \"orderId\": \"671bb90194422f00073ff4f0\",\n \"loanApplyId\": null,\n \"borrowSize\": null,\n \"clientOid\": null\n }\n}" + common_response = RestResponse.from_json(data) + resp = AddOrderTestV1Resp.from_dict(common_response.data) diff --git a/sdk/python/kucoin_universal_sdk/generate/spot/market/api_market.py b/sdk/python/kucoin_universal_sdk/generate/spot/market/api_market.py index 10b188f1..b2f71951 100644 --- a/sdk/python/kucoin_universal_sdk/generate/spot/market/api_market.py +++ b/sdk/python/kucoin_universal_sdk/generate/spot/market/api_market.py @@ -37,29 +37,12 @@ class MarketAPI(ABC): @abstractmethod - def get_private_token(self, **kwargs: Any) -> GetPrivateTokenResp: - """ - summary: Get Private Token - Spot/Margin - description: This interface can obtain the token required for websocket to establish a Spot/Margin private connection. If you need use private channels(e.g. account balance notice), please make request as follows to obtain the server list and private token - documentation: https://www.kucoin.com/docs-new/api-3470295 - +---------------------+---------+ - | Extra API Info | Value | - +---------------------+---------+ - | API-DOMAIN | SPOT | - | API-CHANNEL | PRIVATE | - | API-PERMISSION | GENERAL | - | API-RATE-LIMIT-POOL | SPOT | - | API-RATE-LIMIT | 10 | - +---------------------+---------+ - """ - pass - - @abstractmethod - def get_public_token(self, **kwargs: Any) -> GetPublicTokenResp: + def get_announcements(self, req: GetAnnouncementsReq, + **kwargs: Any) -> GetAnnouncementsResp: """ - summary: Get Public Token - Spot/Margin - description: This interface can obtain the token required for websocket to establish a Spot/Margin connection. If you need use public channels (e.g. all public market data), please make request as follows to obtain the server list and public token - documentation: https://www.kucoin.com/docs-new/api-3470294 + summary: Get Announcements + description: This interface can obtain the latest news announcements, and the default page search is for announcements within a month. + documentation: https://www.kucoin.com/docs-new/api-3470157 +---------------------+--------+ | Extra API Info | Value | +---------------------+--------+ @@ -67,17 +50,18 @@ def get_public_token(self, **kwargs: Any) -> GetPublicTokenResp: | API-CHANNEL | PUBLIC | | API-PERMISSION | NULL | | API-RATE-LIMIT-POOL | PUBLIC | - | API-RATE-LIMIT | 10 | + | API-RATE-LIMIT | 20 | +---------------------+--------+ """ pass @abstractmethod - def get_all_tickers(self, **kwargs: Any) -> GetAllTickersResp: + def get_currency(self, req: GetCurrencyReq, + **kwargs: Any) -> GetCurrencyResp: """ - summary: Get All Tickers - description: Request market tickers for all the trading pairs in the market (including 24h volume), takes a snapshot every 2 seconds. On the rare occasion that we will change the currency name, if you still want the changed symbol name, you can use the symbolName field instead of the symbol field via “Get all tickers” endpoint. - documentation: https://www.kucoin.com/docs-new/api-3470167 + summary: Get Currency + description: Request via this endpoint to get the currency details of a specified currency + documentation: https://www.kucoin.com/docs-new/api-3470155 +---------------------+--------+ | Extra API Info | Value | +---------------------+--------+ @@ -85,17 +69,17 @@ def get_all_tickers(self, **kwargs: Any) -> GetAllTickersResp: | API-CHANNEL | PUBLIC | | API-PERMISSION | NULL | | API-RATE-LIMIT-POOL | PUBLIC | - | API-RATE-LIMIT | 15 | + | API-RATE-LIMIT | 3 | +---------------------+--------+ """ pass @abstractmethod - def get_klines(self, req: GetKlinesReq, **kwargs: Any) -> GetKlinesResp: + def get_all_currencies(self, **kwargs: Any) -> GetAllCurrenciesResp: """ - summary: Get Klines - description: Get the Kline of the symbol. Data are returned in grouped buckets based on requested type. For each query, the system would return at most 1500 pieces of data. To obtain more data, please page the data by time. - documentation: https://www.kucoin.com/docs-new/api-3470163 + summary: Get All Currencies + description: Request via this endpoint to get the currency list.Not all currencies currently can be used for trading. + documentation: https://www.kucoin.com/docs-new/api-3470152 +---------------------+--------+ | Extra API Info | Value | +---------------------+--------+ @@ -109,12 +93,11 @@ def get_klines(self, req: GetKlinesReq, **kwargs: Any) -> GetKlinesResp: pass @abstractmethod - def get_trade_history(self, req: GetTradeHistoryReq, - **kwargs: Any) -> GetTradeHistoryResp: + def get_symbol(self, req: GetSymbolReq, **kwargs: Any) -> GetSymbolResp: """ - summary: Get Trade History - description: Request via this endpoint to get the trade history of the specified symbol, the returned quantity is the last 100 transaction records. - documentation: https://www.kucoin.com/docs-new/api-3470162 + summary: Get Symbol + description: Request via this endpoint to get detail currency pairs for trading. If you want to get the market information of the trading symbol, please use Get All Tickers. + documentation: https://www.kucoin.com/docs-new/api-3470159 +---------------------+--------+ | Extra API Info | Value | +---------------------+--------+ @@ -122,17 +105,18 @@ def get_trade_history(self, req: GetTradeHistoryReq, | API-CHANNEL | PUBLIC | | API-PERMISSION | NULL | | API-RATE-LIMIT-POOL | PUBLIC | - | API-RATE-LIMIT | 3 | + | API-RATE-LIMIT | 4 | +---------------------+--------+ """ pass @abstractmethod - def get_ticker(self, req: GetTickerReq, **kwargs: Any) -> GetTickerResp: + def get_all_symbols(self, req: GetAllSymbolsReq, + **kwargs: Any) -> GetAllSymbolsResp: """ - summary: Get Ticker - description: Request via this endpoint to get Level 1 Market Data. The returned value includes the best bid price and size, the best ask price and size as well as the last traded price and the last traded size. - documentation: https://www.kucoin.com/docs-new/api-3470160 + summary: Get All Symbols + description: Request via this endpoint to get a list of available currency pairs for trading. If you want to get the market information of the trading symbol, please use Get All Tickers. + documentation: https://www.kucoin.com/docs-new/api-3470154 +---------------------+--------+ | Extra API Info | Value | +---------------------+--------+ @@ -140,18 +124,17 @@ def get_ticker(self, req: GetTickerReq, **kwargs: Any) -> GetTickerResp: | API-CHANNEL | PUBLIC | | API-PERMISSION | NULL | | API-RATE-LIMIT-POOL | PUBLIC | - | API-RATE-LIMIT | 2 | + | API-RATE-LIMIT | 4 | +---------------------+--------+ """ pass @abstractmethod - def get_part_order_book(self, req: GetPartOrderBookReq, - **kwargs: Any) -> GetPartOrderBookResp: + def get_ticker(self, req: GetTickerReq, **kwargs: Any) -> GetTickerResp: """ - summary: Get Part OrderBook - description: Query for part orderbook depth data. (aggregated by price) You are recommended to request via this endpoint as the system reponse would be faster and cosume less traffic. - documentation: https://www.kucoin.com/docs-new/api-3470165 + summary: Get Ticker + description: Request via this endpoint to get Level 1 Market Data. The returned value includes the best bid price and size, the best ask price and size as well as the last traded price and the last traded size. + documentation: https://www.kucoin.com/docs-new/api-3470160 +---------------------+--------+ | Extra API Info | Value | +---------------------+--------+ @@ -165,12 +148,11 @@ def get_part_order_book(self, req: GetPartOrderBookReq, pass @abstractmethod - def get24hr_stats(self, req: Get24hrStatsReq, - **kwargs: Any) -> Get24hrStatsResp: + def get_all_tickers(self, **kwargs: Any) -> GetAllTickersResp: """ - summary: Get 24hr Stats - description: Request via this endpoint to get the statistics of the specified ticker in the last 24 hours. - documentation: https://www.kucoin.com/docs-new/api-3470161 + summary: Get All Tickers + description: Request market tickers for all the trading pairs in the market (including 24h volume), takes a snapshot every 2 seconds. On the rare occasion that we will change the currency name, if you still want the changed symbol name, you can use the symbolName field instead of the symbol field via “Get all tickers” endpoint. + documentation: https://www.kucoin.com/docs-new/api-3470167 +---------------------+--------+ | Extra API Info | Value | +---------------------+--------+ @@ -184,11 +166,12 @@ def get24hr_stats(self, req: Get24hrStatsReq, pass @abstractmethod - def get_market_list(self, **kwargs: Any) -> GetMarketListResp: + def get_trade_history(self, req: GetTradeHistoryReq, + **kwargs: Any) -> GetTradeHistoryResp: """ - summary: Get Market List - description: Request via this endpoint to get the transaction currency for the entire trading market. - documentation: https://www.kucoin.com/docs-new/api-3470166 + summary: Get Trade History + description: Request via this endpoint to get the trade history of the specified symbol, the returned quantity is the last 100 transaction records. + documentation: https://www.kucoin.com/docs-new/api-3470162 +---------------------+--------+ | Extra API Info | Value | +---------------------+--------+ @@ -202,12 +185,11 @@ def get_market_list(self, **kwargs: Any) -> GetMarketListResp: pass @abstractmethod - def get_fiat_price(self, req: GetFiatPriceReq, - **kwargs: Any) -> GetFiatPriceResp: + def get_klines(self, req: GetKlinesReq, **kwargs: Any) -> GetKlinesResp: """ - summary: Get Fiat Price - description: Request via this endpoint to get the fiat price of the currencies for the available trading pairs. - documentation: https://www.kucoin.com/docs-new/api-3470153 + summary: Get Klines + description: Get the Kline of the symbol. Data are returned in grouped buckets based on requested type. For each query, the system would return at most 1500 pieces of data. To obtain more data, please page the data by time. + documentation: https://www.kucoin.com/docs-new/api-3470163 +---------------------+--------+ | Extra API Info | Value | +---------------------+--------+ @@ -221,11 +203,12 @@ def get_fiat_price(self, req: GetFiatPriceReq, pass @abstractmethod - def get_service_status(self, **kwargs: Any) -> GetServiceStatusResp: + def get_part_order_book(self, req: GetPartOrderBookReq, + **kwargs: Any) -> GetPartOrderBookResp: """ - summary: Get Service Status - description: Get the service status - documentation: https://www.kucoin.com/docs-new/api-3470158 + summary: Get Part OrderBook + description: Query for part orderbook depth data. (aggregated by price) You are recommended to request via this endpoint as the system reponse would be faster and cosume less traffic. + documentation: https://www.kucoin.com/docs-new/api-3470165 +---------------------+--------+ | Extra API Info | Value | +---------------------+--------+ @@ -233,17 +216,37 @@ def get_service_status(self, **kwargs: Any) -> GetServiceStatusResp: | API-CHANNEL | PUBLIC | | API-PERMISSION | NULL | | API-RATE-LIMIT-POOL | PUBLIC | - | API-RATE-LIMIT | 3 | + | API-RATE-LIMIT | 2 | +---------------------+--------+ """ pass @abstractmethod - def get_server_time(self, **kwargs: Any) -> GetServerTimeResp: + def get_full_order_book(self, req: GetFullOrderBookReq, + **kwargs: Any) -> GetFullOrderBookResp: """ - summary: Get Server Time - description: Get the server time. - documentation: https://www.kucoin.com/docs-new/api-3470156 + summary: Get Full OrderBook + description: Query for Full orderbook depth data. (aggregated by price) It is generally used by professional traders because it uses more server resources and traffic, and we have strict access rate limit control. To maintain up-to-date Order Book, please use Websocket incremental feed after retrieving the OrderBook. + documentation: https://www.kucoin.com/docs-new/api-3470164 + +---------------------+---------+ + | Extra API Info | Value | + +---------------------+---------+ + | API-DOMAIN | SPOT | + | API-CHANNEL | PRIVATE | + | API-PERMISSION | GENERAL | + | API-RATE-LIMIT-POOL | SPOT | + | API-RATE-LIMIT | 3 | + +---------------------+---------+ + """ + pass + + @abstractmethod + def get_fiat_price(self, req: GetFiatPriceReq, + **kwargs: Any) -> GetFiatPriceResp: + """ + summary: Get Fiat Price + description: Request via this endpoint to get the fiat price of the currencies for the available trading pairs. + documentation: https://www.kucoin.com/docs-new/api-3470153 +---------------------+--------+ | Extra API Info | Value | +---------------------+--------+ @@ -257,12 +260,12 @@ def get_server_time(self, **kwargs: Any) -> GetServerTimeResp: pass @abstractmethod - def get_all_symbols(self, req: GetAllSymbolsReq, - **kwargs: Any) -> GetAllSymbolsResp: + def get24hr_stats(self, req: Get24hrStatsReq, + **kwargs: Any) -> Get24hrStatsResp: """ - summary: Get All Symbols - description: Request via this endpoint to get a list of available currency pairs for trading. If you want to get the market information of the trading symbol, please use Get All Tickers. - documentation: https://www.kucoin.com/docs-new/api-3470154 + summary: Get 24hr Stats + description: Request via this endpoint to get the statistics of the specified ticker in the last 24 hours. + documentation: https://www.kucoin.com/docs-new/api-3470161 +---------------------+--------+ | Extra API Info | Value | +---------------------+--------+ @@ -270,17 +273,17 @@ def get_all_symbols(self, req: GetAllSymbolsReq, | API-CHANNEL | PUBLIC | | API-PERMISSION | NULL | | API-RATE-LIMIT-POOL | PUBLIC | - | API-RATE-LIMIT | 4 | + | API-RATE-LIMIT | 15 | +---------------------+--------+ """ pass @abstractmethod - def get_symbol(self, req: GetSymbolReq, **kwargs: Any) -> GetSymbolResp: + def get_market_list(self, **kwargs: Any) -> GetMarketListResp: """ - summary: Get Symbol - description: Request via this endpoint to get detail currency pairs for trading. If you want to get the market information of the trading symbol, please use Get All Tickers. - documentation: https://www.kucoin.com/docs-new/api-3470159 + summary: Get Market List + description: Request via this endpoint to get the transaction currency for the entire trading market. + documentation: https://www.kucoin.com/docs-new/api-3470166 +---------------------+--------+ | Extra API Info | Value | +---------------------+--------+ @@ -288,18 +291,17 @@ def get_symbol(self, req: GetSymbolReq, **kwargs: Any) -> GetSymbolResp: | API-CHANNEL | PUBLIC | | API-PERMISSION | NULL | | API-RATE-LIMIT-POOL | PUBLIC | - | API-RATE-LIMIT | 4 | + | API-RATE-LIMIT | 3 | +---------------------+--------+ """ pass @abstractmethod - def get_announcements(self, req: GetAnnouncementsReq, - **kwargs: Any) -> GetAnnouncementsResp: + def get_server_time(self, **kwargs: Any) -> GetServerTimeResp: """ - summary: Get Announcements - description: This interface can obtain the latest news announcements, and the default page search is for announcements within a month. - documentation: https://www.kucoin.com/docs-new/api-3470157 + summary: Get Server Time + description: Get the server time. + documentation: https://www.kucoin.com/docs-new/api-3470156 +---------------------+--------+ | Extra API Info | Value | +---------------------+--------+ @@ -307,18 +309,17 @@ def get_announcements(self, req: GetAnnouncementsReq, | API-CHANNEL | PUBLIC | | API-PERMISSION | NULL | | API-RATE-LIMIT-POOL | PUBLIC | - | API-RATE-LIMIT | 20 | + | API-RATE-LIMIT | 3 | +---------------------+--------+ """ pass @abstractmethod - def get_currency(self, req: GetCurrencyReq, - **kwargs: Any) -> GetCurrencyResp: + def get_service_status(self, **kwargs: Any) -> GetServiceStatusResp: """ - summary: Get Currency - description: Request via this endpoint to get the currency details of a specified currency - documentation: https://www.kucoin.com/docs-new/api-3470155 + summary: Get Service Status + description: Get the service status + documentation: https://www.kucoin.com/docs-new/api-3470158 +---------------------+--------+ | Extra API Info | Value | +---------------------+--------+ @@ -332,11 +333,11 @@ def get_currency(self, req: GetCurrencyReq, pass @abstractmethod - def get_all_currencies(self, **kwargs: Any) -> GetAllCurrenciesResp: + def get_public_token(self, **kwargs: Any) -> GetPublicTokenResp: """ - summary: Get All Currencies - description: Request via this endpoint to get the currency list.Not all currencies currently can be used for trading. - documentation: https://www.kucoin.com/docs-new/api-3470152 + summary: Get Public Token - Spot/Margin + description: This interface can obtain the token required for websocket to establish a Spot/Margin connection. If you need use public channels (e.g. all public market data), please make request as follows to obtain the server list and public token + documentation: https://www.kucoin.com/docs-new/api-3470294 +---------------------+--------+ | Extra API Info | Value | +---------------------+--------+ @@ -344,18 +345,17 @@ def get_all_currencies(self, **kwargs: Any) -> GetAllCurrenciesResp: | API-CHANNEL | PUBLIC | | API-PERMISSION | NULL | | API-RATE-LIMIT-POOL | PUBLIC | - | API-RATE-LIMIT | 3 | + | API-RATE-LIMIT | 10 | +---------------------+--------+ """ pass @abstractmethod - def get_full_order_book(self, req: GetFullOrderBookReq, - **kwargs: Any) -> GetFullOrderBookResp: + def get_private_token(self, **kwargs: Any) -> GetPrivateTokenResp: """ - summary: Get Full OrderBook - description: Query for Full orderbook depth data. (aggregated by price) It is generally used by professional traders because it uses more server resources and traffic, and we have strict access rate limit control. To maintain up-to-date Order Book, please use Websocket incremental feed after retrieving the OrderBook. - documentation: https://www.kucoin.com/docs-new/api-3470164 + summary: Get Private Token - Spot/Margin + description: This interface can obtain the token required for websocket to establish a Spot/Margin private connection. If you need use private channels(e.g. account balance notice), please make request as follows to obtain the server list and private token + documentation: https://www.kucoin.com/docs-new/api-3470295 +---------------------+---------+ | Extra API Info | Value | +---------------------+---------+ @@ -363,7 +363,7 @@ def get_full_order_book(self, req: GetFullOrderBookReq, | API-CHANNEL | PRIVATE | | API-PERMISSION | GENERAL | | API-RATE-LIMIT-POOL | SPOT | - | API-RATE-LIMIT | 3 | + | API-RATE-LIMIT | 10 | +---------------------+---------+ """ pass @@ -374,36 +374,53 @@ class MarketAPIImpl(MarketAPI): def __init__(self, transport: Transport): self.transport = transport - def get_private_token(self, **kwargs: Any) -> GetPrivateTokenResp: - return self.transport.call("spot", False, "POST", - "/api/v1/bullet-private", None, - GetPrivateTokenResp(), False, **kwargs) + def get_announcements(self, req: GetAnnouncementsReq, + **kwargs: Any) -> GetAnnouncementsResp: + return self.transport.call("spot", False, "GET", + "/api/v3/announcements", req, + GetAnnouncementsResp(), False, **kwargs) - def get_public_token(self, **kwargs: Any) -> GetPublicTokenResp: - return self.transport.call("spot", False, "POST", - "/api/v1/bullet-public", None, - GetPublicTokenResp(), False, **kwargs) + def get_currency(self, req: GetCurrencyReq, + **kwargs: Any) -> GetCurrencyResp: + return self.transport.call("spot", False, "GET", + "/api/v3/currencies/{currency}", req, + GetCurrencyResp(), False, **kwargs) + + def get_all_currencies(self, **kwargs: Any) -> GetAllCurrenciesResp: + return self.transport.call("spot", False, "GET", + "/api/v3/currencies", None, + GetAllCurrenciesResp(), False, **kwargs) + + def get_symbol(self, req: GetSymbolReq, **kwargs: Any) -> GetSymbolResp: + return self.transport.call("spot", False, "GET", + "/api/v2/symbols/{symbol}", req, + GetSymbolResp(), False, **kwargs) + + def get_all_symbols(self, req: GetAllSymbolsReq, + **kwargs: Any) -> GetAllSymbolsResp: + return self.transport.call("spot", False, "GET", "/api/v2/symbols", + req, GetAllSymbolsResp(), False, **kwargs) + + def get_ticker(self, req: GetTickerReq, **kwargs: Any) -> GetTickerResp: + return self.transport.call("spot", False, "GET", + "/api/v1/market/orderbook/level1", req, + GetTickerResp(), False, **kwargs) def get_all_tickers(self, **kwargs: Any) -> GetAllTickersResp: return self.transport.call("spot", False, "GET", "/api/v1/market/allTickers", None, GetAllTickersResp(), False, **kwargs) - def get_klines(self, req: GetKlinesReq, **kwargs: Any) -> GetKlinesResp: - return self.transport.call("spot", False, "GET", - "/api/v1/market/candles", req, - GetKlinesResp(), False, **kwargs) - def get_trade_history(self, req: GetTradeHistoryReq, **kwargs: Any) -> GetTradeHistoryResp: return self.transport.call("spot", False, "GET", "/api/v1/market/histories", req, GetTradeHistoryResp(), False, **kwargs) - def get_ticker(self, req: GetTickerReq, **kwargs: Any) -> GetTickerResp: + def get_klines(self, req: GetKlinesReq, **kwargs: Any) -> GetKlinesResp: return self.transport.call("spot", False, "GET", - "/api/v1/market/orderbook/level1", req, - GetTickerResp(), False, **kwargs) + "/api/v1/market/candles", req, + GetKlinesResp(), False, **kwargs) def get_part_order_book(self, req: GetPartOrderBookReq, **kwargs: Any) -> GetPartOrderBookResp: @@ -412,6 +429,17 @@ def get_part_order_book(self, req: GetPartOrderBookReq, req, GetPartOrderBookResp(), False, **kwargs) + def get_full_order_book(self, req: GetFullOrderBookReq, + **kwargs: Any) -> GetFullOrderBookResp: + return self.transport.call("spot", False, "GET", + "/api/v3/market/orderbook/level2", req, + GetFullOrderBookResp(), False, **kwargs) + + def get_fiat_price(self, req: GetFiatPriceReq, + **kwargs: Any) -> GetFiatPriceResp: + return self.transport.call("spot", False, "GET", "/api/v1/prices", req, + GetFiatPriceResp(), False, **kwargs) + def get24hr_stats(self, req: Get24hrStatsReq, **kwargs: Any) -> Get24hrStatsResp: return self.transport.call("spot", False, "GET", @@ -422,49 +450,21 @@ def get_market_list(self, **kwargs: Any) -> GetMarketListResp: return self.transport.call("spot", False, "GET", "/api/v1/markets", None, GetMarketListResp(), False, **kwargs) - def get_fiat_price(self, req: GetFiatPriceReq, - **kwargs: Any) -> GetFiatPriceResp: - return self.transport.call("spot", False, "GET", "/api/v1/prices", req, - GetFiatPriceResp(), False, **kwargs) - - def get_service_status(self, **kwargs: Any) -> GetServiceStatusResp: - return self.transport.call("spot", False, "GET", - "/api/v1/status", None, - GetServiceStatusResp(), False, **kwargs) - def get_server_time(self, **kwargs: Any) -> GetServerTimeResp: return self.transport.call("spot", False, "GET", "/api/v1/timestamp", None, GetServerTimeResp(), False, **kwargs) - def get_all_symbols(self, req: GetAllSymbolsReq, - **kwargs: Any) -> GetAllSymbolsResp: - return self.transport.call("spot", False, "GET", "/api/v2/symbols", - req, GetAllSymbolsResp(), False, **kwargs) - - def get_symbol(self, req: GetSymbolReq, **kwargs: Any) -> GetSymbolResp: - return self.transport.call("spot", False, "GET", - "/api/v2/symbols/{symbol}", req, - GetSymbolResp(), False, **kwargs) - - def get_announcements(self, req: GetAnnouncementsReq, - **kwargs: Any) -> GetAnnouncementsResp: - return self.transport.call("spot", False, "GET", - "/api/v3/announcements", req, - GetAnnouncementsResp(), False, **kwargs) - - def get_currency(self, req: GetCurrencyReq, - **kwargs: Any) -> GetCurrencyResp: + def get_service_status(self, **kwargs: Any) -> GetServiceStatusResp: return self.transport.call("spot", False, "GET", - "/api/v3/currencies/{currency}", req, - GetCurrencyResp(), False, **kwargs) + "/api/v1/status", None, + GetServiceStatusResp(), False, **kwargs) - def get_all_currencies(self, **kwargs: Any) -> GetAllCurrenciesResp: - return self.transport.call("spot", False, "GET", - "/api/v3/currencies", None, - GetAllCurrenciesResp(), False, **kwargs) + def get_public_token(self, **kwargs: Any) -> GetPublicTokenResp: + return self.transport.call("spot", False, "POST", + "/api/v1/bullet-public", None, + GetPublicTokenResp(), False, **kwargs) - def get_full_order_book(self, req: GetFullOrderBookReq, - **kwargs: Any) -> GetFullOrderBookResp: - return self.transport.call("spot", False, "GET", - "/api/v3/market/orderbook/level2", req, - GetFullOrderBookResp(), False, **kwargs) + def get_private_token(self, **kwargs: Any) -> GetPrivateTokenResp: + return self.transport.call("spot", False, "POST", + "/api/v1/bullet-private", None, + GetPrivateTokenResp(), False, **kwargs) diff --git a/sdk/python/kucoin_universal_sdk/generate/spot/market/api_market.template b/sdk/python/kucoin_universal_sdk/generate/spot/market/api_market.template index 8d39c200..237b6ed2 100644 --- a/sdk/python/kucoin_universal_sdk/generate/spot/market/api_market.template +++ b/sdk/python/kucoin_universal_sdk/generate/spot/market/api_market.template @@ -1,15 +1,18 @@ # API FUNCTION TEMPLATE -def test_get_private_token_req(self): +def test_get_announcements_req(self): """ - get_private_token - Get Private Token - Spot/Margin - /api/v1/bullet-private + get_announcements + Get Announcements + /api/v3/announcements """ + builder = GetAnnouncementsReqBuilder() + builder.set_current_page(?).set_page_size(?).set_ann_type(?).set_lang(?).set_start_time(?).set_end_time(?) + req = builder.build() try: - resp = self.api.get_private_token() + resp = self.api.get_announcements(req) print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) @@ -17,15 +20,18 @@ def test_get_private_token_req(self): print("error: ", e) raise e -def test_get_public_token_req(self): +def test_get_currency_req(self): """ - get_public_token - Get Public Token - Spot/Margin - /api/v1/bullet-public + get_currency + Get Currency + /api/v3/currencies/{currency} """ + builder = GetCurrencyReqBuilder() + builder.set_currency(?).set_chain(?) + req = builder.build() try: - resp = self.api.get_public_token() + resp = self.api.get_currency(req) print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) @@ -33,15 +39,15 @@ def test_get_public_token_req(self): print("error: ", e) raise e -def test_get_all_tickers_req(self): +def test_get_all_currencies_req(self): """ - get_all_tickers - Get All Tickers - /api/v1/market/allTickers + get_all_currencies + Get All Currencies + /api/v3/currencies """ try: - resp = self.api.get_all_tickers() + resp = self.api.get_all_currencies() print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) @@ -49,18 +55,18 @@ def test_get_all_tickers_req(self): print("error: ", e) raise e -def test_get_klines_req(self): +def test_get_symbol_req(self): """ - get_klines - Get Klines - /api/v1/market/candles + get_symbol + Get Symbol + /api/v2/symbols/{symbol} """ - builder = GetKlinesReqBuilder() - builder.set_symbol(?).set_type(?).set_start_at(?).set_end_at(?) + builder = GetSymbolReqBuilder() + builder.set_symbol(?) req = builder.build() try: - resp = self.api.get_klines(req) + resp = self.api.get_symbol(req) print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) @@ -68,18 +74,18 @@ def test_get_klines_req(self): print("error: ", e) raise e -def test_get_trade_history_req(self): +def test_get_all_symbols_req(self): """ - get_trade_history - Get Trade History - /api/v1/market/histories + get_all_symbols + Get All Symbols + /api/v2/symbols """ - builder = GetTradeHistoryReqBuilder() - builder.set_symbol(?) + builder = GetAllSymbolsReqBuilder() + builder.set_market(?) req = builder.build() try: - resp = self.api.get_trade_history(req) + resp = self.api.get_all_symbols(req) print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) @@ -106,18 +112,15 @@ def test_get_ticker_req(self): print("error: ", e) raise e -def test_get_part_order_book_req(self): +def test_get_all_tickers_req(self): """ - get_part_order_book - Get Part OrderBook - /api/v1/market/orderbook/level2_{size} + get_all_tickers + Get All Tickers + /api/v1/market/allTickers """ - builder = GetPartOrderBookReqBuilder() - builder.set_symbol(?).set_size(?) - req = builder.build() try: - resp = self.api.get_part_order_book(req) + resp = self.api.get_all_tickers() print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) @@ -125,18 +128,18 @@ def test_get_part_order_book_req(self): print("error: ", e) raise e -def test_get24hr_stats_req(self): +def test_get_trade_history_req(self): """ - get24hr_stats - Get 24hr Stats - /api/v1/market/stats + get_trade_history + Get Trade History + /api/v1/market/histories """ - builder = Get24hrStatsReqBuilder() + builder = GetTradeHistoryReqBuilder() builder.set_symbol(?) req = builder.build() try: - resp = self.api.get24hr_stats(req) + resp = self.api.get_trade_history(req) print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) @@ -144,15 +147,18 @@ def test_get24hr_stats_req(self): print("error: ", e) raise e -def test_get_market_list_req(self): +def test_get_klines_req(self): """ - get_market_list - Get Market List - /api/v1/markets + get_klines + Get Klines + /api/v1/market/candles """ + builder = GetKlinesReqBuilder() + builder.set_symbol(?).set_type(?).set_start_at(?).set_end_at(?) + req = builder.build() try: - resp = self.api.get_market_list() + resp = self.api.get_klines(req) print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) @@ -160,18 +166,18 @@ def test_get_market_list_req(self): print("error: ", e) raise e -def test_get_fiat_price_req(self): +def test_get_part_order_book_req(self): """ - get_fiat_price - Get Fiat Price - /api/v1/prices + get_part_order_book + Get Part OrderBook + /api/v1/market/orderbook/level2_{size} """ - builder = GetFiatPriceReqBuilder() - builder.set_base(?).set_currencies(?) + builder = GetPartOrderBookReqBuilder() + builder.set_symbol(?).set_size(?) req = builder.build() try: - resp = self.api.get_fiat_price(req) + resp = self.api.get_part_order_book(req) print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) @@ -179,15 +185,18 @@ def test_get_fiat_price_req(self): print("error: ", e) raise e -def test_get_service_status_req(self): +def test_get_full_order_book_req(self): """ - get_service_status - Get Service Status - /api/v1/status + get_full_order_book + Get Full OrderBook + /api/v3/market/orderbook/level2 """ + builder = GetFullOrderBookReqBuilder() + builder.set_symbol(?) + req = builder.build() try: - resp = self.api.get_service_status() + resp = self.api.get_full_order_book(req) print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) @@ -195,15 +204,18 @@ def test_get_service_status_req(self): print("error: ", e) raise e -def test_get_server_time_req(self): +def test_get_fiat_price_req(self): """ - get_server_time - Get Server Time - /api/v1/timestamp + get_fiat_price + Get Fiat Price + /api/v1/prices """ + builder = GetFiatPriceReqBuilder() + builder.set_base(?).set_currencies(?) + req = builder.build() try: - resp = self.api.get_server_time() + resp = self.api.get_fiat_price(req) print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) @@ -211,18 +223,18 @@ def test_get_server_time_req(self): print("error: ", e) raise e -def test_get_all_symbols_req(self): +def test_get24hr_stats_req(self): """ - get_all_symbols - Get All Symbols - /api/v2/symbols + get24hr_stats + Get 24hr Stats + /api/v1/market/stats """ - builder = GetAllSymbolsReqBuilder() - builder.set_market(?) + builder = Get24hrStatsReqBuilder() + builder.set_symbol(?) req = builder.build() try: - resp = self.api.get_all_symbols(req) + resp = self.api.get24hr_stats(req) print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) @@ -230,18 +242,15 @@ def test_get_all_symbols_req(self): print("error: ", e) raise e -def test_get_symbol_req(self): +def test_get_market_list_req(self): """ - get_symbol - Get Symbol - /api/v2/symbols/{symbol} + get_market_list + Get Market List + /api/v1/markets """ - builder = GetSymbolReqBuilder() - builder.set_symbol(?) - req = builder.build() try: - resp = self.api.get_symbol(req) + resp = self.api.get_market_list() print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) @@ -249,18 +258,15 @@ def test_get_symbol_req(self): print("error: ", e) raise e -def test_get_announcements_req(self): +def test_get_server_time_req(self): """ - get_announcements - Get Announcements - /api/v3/announcements + get_server_time + Get Server Time + /api/v1/timestamp """ - builder = GetAnnouncementsReqBuilder() - builder.set_current_page(?).set_page_size(?).set_ann_type(?).set_lang(?).set_start_time(?).set_end_time(?) - req = builder.build() try: - resp = self.api.get_announcements(req) + resp = self.api.get_server_time() print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) @@ -268,18 +274,15 @@ def test_get_announcements_req(self): print("error: ", e) raise e -def test_get_currency_req(self): +def test_get_service_status_req(self): """ - get_currency - Get Currency - /api/v3/currencies/{currency} + get_service_status + Get Service Status + /api/v1/status """ - builder = GetCurrencyReqBuilder() - builder.set_currency(?).set_chain(?) - req = builder.build() try: - resp = self.api.get_currency(req) + resp = self.api.get_service_status() print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) @@ -287,15 +290,15 @@ def test_get_currency_req(self): print("error: ", e) raise e -def test_get_all_currencies_req(self): +def test_get_public_token_req(self): """ - get_all_currencies - Get All Currencies - /api/v3/currencies + get_public_token + Get Public Token - Spot/Margin + /api/v1/bullet-public """ try: - resp = self.api.get_all_currencies() + resp = self.api.get_public_token() print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) @@ -303,18 +306,15 @@ def test_get_all_currencies_req(self): print("error: ", e) raise e -def test_get_full_order_book_req(self): +def test_get_private_token_req(self): """ - get_full_order_book - Get Full OrderBook - /api/v3/market/orderbook/level2 + get_private_token + Get Private Token - Spot/Margin + /api/v1/bullet-private """ - builder = GetFullOrderBookReqBuilder() - builder.set_symbol(?) - req = builder.build() try: - resp = self.api.get_full_order_book(req) + resp = self.api.get_private_token() print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) diff --git a/sdk/python/kucoin_universal_sdk/generate/spot/market/api_market_test.py b/sdk/python/kucoin_universal_sdk/generate/spot/market/api_market_test.py index 5437f85d..53dd67ab 100644 --- a/sdk/python/kucoin_universal_sdk/generate/spot/market/api_market_test.py +++ b/sdk/python/kucoin_universal_sdk/generate/spot/market/api_market_test.py @@ -33,39 +33,117 @@ class MarketAPITest(unittest.TestCase): - def test_get_private_token_req_model(self): + def test_get_announcements_req_model(self): """ - get_private_token - Get Private Token - Spot/Margin - /api/v1/bullet-private + get_announcements + Get Announcements + /api/v3/announcements """ + data = "{\"currentPage\": 1, \"pageSize\": 50, \"annType\": \"latest-announcements\", \"lang\": \"en_US\", \"startTime\": 1729594043000, \"endTime\": 1729697729000}" + req = GetAnnouncementsReq.from_json(data) - def test_get_private_token_resp_model(self): + def test_get_announcements_resp_model(self): """ - get_private_token - Get Private Token - Spot/Margin - /api/v1/bullet-private + get_announcements + Get Announcements + /api/v3/announcements """ - data = "{\n \"code\": \"200000\",\n \"data\": {\n \"token\": \"2neAiuYvAU737TOajb2U3uT8AEZqSWYe0fBD4LoHuXJDSC7gIzJiH4kNTWhCPISWo6nDpAe7aUaaHJ4fG8oRjFgMfUI2sM4IySWHrBceFocY8pKy2REU1HwZIngtMdMrjqPnP-biofFWbNaP1cl0X1pZc2SQ-33hDH1LgNP-yg80ZJv_Ctaj8sAFhTOZ8m1L.jut4vBQxXAseWKxODdGVGg==\",\n \"instanceServers\": [\n {\n \"endpoint\": \"wss://ws-api-spot.kucoin.com/\",\n \"encrypt\": true,\n \"protocol\": \"websocket\",\n \"pingInterval\": 18000,\n \"pingTimeout\": 10000\n }\n ]\n }\n}" + data = "{\n \"code\": \"200000\",\n \"data\": {\n \"totalNum\": 195,\n \"totalPage\": 13,\n \"currentPage\": 1,\n \"pageSize\": 15,\n \"items\": [\n {\n \"annId\": 129045,\n \"annTitle\": \"KuCoin Isolated Margin Adds the Scroll (SCR) Trading Pair\",\n \"annType\": [\n \"latest-announcements\"\n ],\n \"annDesc\": \"To enrich the variety of assets available,\xa0KuCoin\u2019s Isolated Margin Trading platform has added the Scroll (SCR)\xa0asset and trading pair.\",\n \"cTime\": 1729594043000,\n \"language\": \"en_US\",\n \"annUrl\": \"https://www.kucoin.com/announcement/kucoin-isolated-margin-adds-scr?lang=en_US\"\n },\n {\n \"annId\": 129001,\n \"annTitle\": \"DAPP-30D Fixed Promotion, Enjoy an APR of 200%!\u200b\",\n \"annType\": [\n \"latest-announcements\",\n \"activities\"\n ],\n \"annDesc\": \"KuCoin Earn will be launching the DAPP Fixed Promotion at 10:00:00 on October 22, 2024 (UTC). The available product is \u201cDAPP-30D'' with an APR of 200%.\",\n \"cTime\": 1729588460000,\n \"language\": \"en_US\",\n \"annUrl\": \"https://www.kucoin.com/announcement/dapp-30d-fixed-promotion-enjoy?lang=en_US\"\n },\n {\n \"annId\": 128581,\n \"annTitle\": \"NAYM (NAYM) Gets Listed on KuCoin! World Premiere!\",\n \"annType\": [\n \"latest-announcements\",\n \"new-listings\"\n ],\n \"annDesc\": \"Trading:\xa011:00 on October 22, 2024 (UTC)\",\n \"cTime\": 1729497729000,\n \"language\": \"en_US\",\n \"annUrl\": \"https://www.kucoin.com/announcement/en-naym-naym-gets-listed-on-kucoin-world-premiere?lang=en_US\"\n }\n ]\n }\n}" common_response = RestResponse.from_json(data) - resp = GetPrivateTokenResp.from_dict(common_response.data) + resp = GetAnnouncementsResp.from_dict(common_response.data) - def test_get_public_token_req_model(self): + def test_get_currency_req_model(self): """ - get_public_token - Get Public Token - Spot/Margin - /api/v1/bullet-public + get_currency + Get Currency + /api/v3/currencies/{currency} """ + data = "{\"currency\": \"BTC\", \"chain\": \"eth\"}" + req = GetCurrencyReq.from_json(data) - def test_get_public_token_resp_model(self): + def test_get_currency_resp_model(self): """ - get_public_token - Get Public Token - Spot/Margin - /api/v1/bullet-public + get_currency + Get Currency + /api/v3/currencies/{currency} """ - data = "{\n \"code\": \"200000\",\n \"data\": {\n \"token\": \"2neAiuYvAU61ZDXANAGAsiL4-iAExhsBXZxftpOeh_55i3Ysy2q2LEsEWU64mdzUOPusi34M_wGoSf7iNyEWJ93g2WHl-j4M7tCZ_S21PuIByWXUJFDywtiYB9J6i9GjsxUuhPw3Blq6rhZlGykT3Vp1phUafnulOOpts-MEmEF-3bpfetLOAq79RbGaLlE4JBvJHl5Vs9Y=.ymP9jIr6v-vucrZr8761yA==\",\n \"instanceServers\": [\n {\n \"endpoint\": \"wss://ws-api-spot.kucoin.com/\",\n \"encrypt\": true,\n \"protocol\": \"websocket\",\n \"pingInterval\": 18000,\n \"pingTimeout\": 10000\n }\n ]\n }\n}" + data = "{\"code\":\"200000\",\"data\":{\"currency\":\"BTC\",\"name\":\"BTC\",\"fullName\":\"Bitcoin\",\"precision\":8,\"confirms\":null,\"contractAddress\":null,\"isMarginEnabled\":true,\"isDebitEnabled\":true,\"chains\":[{\"chainName\":\"BTC\",\"withdrawalMinSize\":\"0.001\",\"depositMinSize\":\"0.0002\",\"withdrawFeeRate\":\"0\",\"withdrawalMinFee\":\"0.0005\",\"isWithdrawEnabled\":true,\"isDepositEnabled\":true,\"confirms\":3,\"preConfirms\":1,\"contractAddress\":\"\",\"withdrawPrecision\":8,\"maxWithdraw\":null,\"maxDeposit\":null,\"needTag\":false,\"chainId\":\"btc\"},{\"chainName\":\"Lightning Network\",\"withdrawalMinSize\":\"0.00001\",\"depositMinSize\":\"0.00001\",\"withdrawFeeRate\":\"0\",\"withdrawalMinFee\":\"0.000015\",\"isWithdrawEnabled\":true,\"isDepositEnabled\":true,\"confirms\":1,\"preConfirms\":1,\"contractAddress\":\"\",\"withdrawPrecision\":8,\"maxWithdraw\":null,\"maxDeposit\":\"0.03\",\"needTag\":false,\"chainId\":\"btcln\"},{\"chainName\":\"KCC\",\"withdrawalMinSize\":\"0.0008\",\"depositMinSize\":null,\"withdrawFeeRate\":\"0\",\"withdrawalMinFee\":\"0.00002\",\"isWithdrawEnabled\":true,\"isDepositEnabled\":true,\"confirms\":20,\"preConfirms\":20,\"contractAddress\":\"0xfa93c12cd345c658bc4644d1d4e1b9615952258c\",\"withdrawPrecision\":8,\"maxWithdraw\":null,\"maxDeposit\":null,\"needTag\":false,\"chainId\":\"kcc\"},{\"chainName\":\"BTC-Segwit\",\"withdrawalMinSize\":\"0.0008\",\"depositMinSize\":\"0.0002\",\"withdrawFeeRate\":\"0\",\"withdrawalMinFee\":\"0.0005\",\"isWithdrawEnabled\":false,\"isDepositEnabled\":true,\"confirms\":2,\"preConfirms\":2,\"contractAddress\":\"\",\"withdrawPrecision\":8,\"maxWithdraw\":null,\"maxDeposit\":null,\"needTag\":false,\"chainId\":\"bech32\"}]}}" common_response = RestResponse.from_json(data) - resp = GetPublicTokenResp.from_dict(common_response.data) + resp = GetCurrencyResp.from_dict(common_response.data) + + def test_get_all_currencies_req_model(self): + """ + get_all_currencies + Get All Currencies + /api/v3/currencies + """ + + def test_get_all_currencies_resp_model(self): + """ + get_all_currencies + Get All Currencies + /api/v3/currencies + """ + data = "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"currency\": \"BTC\",\n \"name\": \"BTC\",\n \"fullName\": \"Bitcoin\",\n \"precision\": 8,\n \"confirms\": null,\n \"contractAddress\": null,\n \"isMarginEnabled\": true,\n \"isDebitEnabled\": true,\n \"chains\": [\n {\n \"chainName\": \"BTC\",\n \"withdrawalMinSize\": \"0.001\",\n \"depositMinSize\": \"0.0002\",\n \"withdrawFeeRate\": \"0\",\n \"withdrawalMinFee\": \"0.0005\",\n \"isWithdrawEnabled\": true,\n \"isDepositEnabled\": true,\n \"confirms\": 3,\n \"preConfirms\": 1,\n \"contractAddress\": \"\",\n \"withdrawPrecision\": 8,\n \"maxWithdraw\": null,\n \"maxDeposit\": null,\n \"needTag\": false,\n \"chainId\": \"btc\"\n },\n {\n \"chainName\": \"Lightning Network\",\n \"withdrawalMinSize\": \"0.00001\",\n \"depositMinSize\": \"0.00001\",\n \"withdrawFeeRate\": \"0\",\n \"withdrawalMinFee\": \"0.000015\",\n \"isWithdrawEnabled\": true,\n \"isDepositEnabled\": true,\n \"confirms\": 1,\n \"preConfirms\": 1,\n \"contractAddress\": \"\",\n \"withdrawPrecision\": 8,\n \"maxWithdraw\": null,\n \"maxDeposit\": \"0.03\",\n \"needTag\": false,\n \"chainId\": \"btcln\"\n },\n {\n \"chainName\": \"KCC\",\n \"withdrawalMinSize\": \"0.0008\",\n \"depositMinSize\": null,\n \"withdrawFeeRate\": \"0\",\n \"withdrawalMinFee\": \"0.00002\",\n \"isWithdrawEnabled\": true,\n \"isDepositEnabled\": true,\n \"confirms\": 20,\n \"preConfirms\": 20,\n \"contractAddress\": \"0xfa93c12cd345c658bc4644d1d4e1b9615952258c\",\n \"withdrawPrecision\": 8,\n \"maxWithdraw\": null,\n \"maxDeposit\": null,\n \"needTag\": false,\n \"chainId\": \"kcc\"\n },\n {\n \"chainName\": \"BTC-Segwit\",\n \"withdrawalMinSize\": \"0.0008\",\n \"depositMinSize\": \"0.0002\",\n \"withdrawFeeRate\": \"0\",\n \"withdrawalMinFee\": \"0.0005\",\n \"isWithdrawEnabled\": false,\n \"isDepositEnabled\": true,\n \"confirms\": 2,\n \"preConfirms\": 2,\n \"contractAddress\": \"\",\n \"withdrawPrecision\": 8,\n \"maxWithdraw\": null,\n \"maxDeposit\": null,\n \"needTag\": false,\n \"chainId\": \"bech32\"\n }\n ]\n },\n {\n \"currency\": \"BTCP\",\n \"name\": \"BTCP\",\n \"fullName\": \"Bitcoin Private\",\n \"precision\": 8,\n \"confirms\": null,\n \"contractAddress\": null,\n \"isMarginEnabled\": false,\n \"isDebitEnabled\": false,\n \"chains\": [\n {\n \"chainName\": \"BTCP\",\n \"withdrawalMinSize\": \"0.100000\",\n \"depositMinSize\": null,\n \"withdrawFeeRate\": \"0\",\n \"withdrawalMinFee\": \"0.010000\",\n \"isWithdrawEnabled\": false,\n \"isDepositEnabled\": false,\n \"confirms\": 6,\n \"preConfirms\": 6,\n \"contractAddress\": \"\",\n \"withdrawPrecision\": 8,\n \"maxWithdraw\": null,\n \"maxDeposit\": null,\n \"needTag\": false,\n \"chainId\": \"btcp\"\n }\n ]\n }\n ]\n}" + common_response = RestResponse.from_json(data) + resp = GetAllCurrenciesResp.from_dict(common_response.data) + + def test_get_symbol_req_model(self): + """ + get_symbol + Get Symbol + /api/v2/symbols/{symbol} + """ + data = "{\"symbol\": \"BTC-USDT\"}" + req = GetSymbolReq.from_json(data) + + def test_get_symbol_resp_model(self): + """ + get_symbol + Get Symbol + /api/v2/symbols/{symbol} + """ + data = "{\"code\":\"200000\",\"data\":{\"symbol\":\"BTC-USDT\",\"name\":\"BTC-USDT\",\"baseCurrency\":\"BTC\",\"quoteCurrency\":\"USDT\",\"feeCurrency\":\"USDT\",\"market\":\"USDS\",\"baseMinSize\":\"0.00001\",\"quoteMinSize\":\"0.1\",\"baseMaxSize\":\"10000000000\",\"quoteMaxSize\":\"99999999\",\"baseIncrement\":\"0.00000001\",\"quoteIncrement\":\"0.000001\",\"priceIncrement\":\"0.1\",\"priceLimitRate\":\"0.1\",\"minFunds\":\"0.1\",\"isMarginEnabled\":true,\"enableTrading\":true,\"feeCategory\":1,\"makerFeeCoefficient\":\"1.00\",\"takerFeeCoefficient\":\"1.00\",\"st\":false}}" + common_response = RestResponse.from_json(data) + resp = GetSymbolResp.from_dict(common_response.data) + + def test_get_all_symbols_req_model(self): + """ + get_all_symbols + Get All Symbols + /api/v2/symbols + """ + data = "{\"market\": \"ALTS\"}" + req = GetAllSymbolsReq.from_json(data) + + def test_get_all_symbols_resp_model(self): + """ + get_all_symbols + Get All Symbols + /api/v2/symbols + """ + data = "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"symbol\": \"BTC-USDT\",\n \"name\": \"BTC-USDT\",\n \"baseCurrency\": \"BTC\",\n \"quoteCurrency\": \"USDT\",\n \"feeCurrency\": \"USDT\",\n \"market\": \"USDS\",\n \"baseMinSize\": \"0.00001\",\n \"quoteMinSize\": \"0.1\",\n \"baseMaxSize\": \"10000000000\",\n \"quoteMaxSize\": \"99999999\",\n \"baseIncrement\": \"0.00000001\",\n \"quoteIncrement\": \"0.000001\",\n \"priceIncrement\": \"0.1\",\n \"priceLimitRate\": \"0.1\",\n \"minFunds\": \"0.1\",\n \"isMarginEnabled\": true,\n \"enableTrading\": true,\n \"feeCategory\": 1,\n \"makerFeeCoefficient\": \"1.00\",\n \"takerFeeCoefficient\": \"1.00\",\n \"st\": false\n }\n ]\n}" + common_response = RestResponse.from_json(data) + resp = GetAllSymbolsResp.from_dict(common_response.data) + + def test_get_ticker_req_model(self): + """ + get_ticker + Get Ticker + /api/v1/market/orderbook/level1 + """ + data = "{\"symbol\": \"BTC-USDT\"}" + req = GetTickerReq.from_json(data) + + def test_get_ticker_resp_model(self): + """ + get_ticker + Get Ticker + /api/v1/market/orderbook/level1 + """ + data = "{\"code\":\"200000\",\"data\":{\"time\":1729172965609,\"sequence\":\"14609309753\",\"price\":\"67269\",\"size\":\"0.000025\",\"bestBid\":\"67267.5\",\"bestBidSize\":\"0.000025\",\"bestAsk\":\"67267.6\",\"bestAskSize\":\"1.24808993\"}}" + common_response = RestResponse.from_json(data) + resp = GetTickerResp.from_dict(common_response.data) def test_get_all_tickers_req_model(self): """ @@ -84,25 +162,6 @@ def test_get_all_tickers_resp_model(self): common_response = RestResponse.from_json(data) resp = GetAllTickersResp.from_dict(common_response.data) - def test_get_klines_req_model(self): - """ - get_klines - Get Klines - /api/v1/market/candles - """ - data = "{\"symbol\": \"BTC-USDT\", \"type\": \"1min\", \"startAt\": 1566703297, \"endAt\": 1566789757}" - req = GetKlinesReq.from_json(data) - - def test_get_klines_resp_model(self): - """ - get_klines - Get Klines - /api/v1/market/candles - """ - data = "{\n \"code\": \"200000\",\n \"data\": [\n [\n \"1566789720\",\n \"10411.5\",\n \"10401.9\",\n \"10411.5\",\n \"10396.3\",\n \"29.11357276\",\n \"302889.301529914\"\n ],\n [\n \"1566789660\",\n \"10416\",\n \"10411.5\",\n \"10422.3\",\n \"10411.5\",\n \"15.61781842\",\n \"162703.708997029\"\n ],\n [\n \"1566789600\",\n \"10408.6\",\n \"10416\",\n \"10416\",\n \"10405.4\",\n \"12.45584973\",\n \"129666.51508559\"\n ]\n ]\n}" - common_response = RestResponse.from_json(data) - resp = GetKlinesResp.from_dict(common_response.data) - def test_get_trade_history_req_model(self): """ get_trade_history @@ -122,24 +181,24 @@ def test_get_trade_history_resp_model(self): common_response = RestResponse.from_json(data) resp = GetTradeHistoryResp.from_dict(common_response.data) - def test_get_ticker_req_model(self): + def test_get_klines_req_model(self): """ - get_ticker - Get Ticker - /api/v1/market/orderbook/level1 + get_klines + Get Klines + /api/v1/market/candles """ - data = "{\"symbol\": \"BTC-USDT\"}" - req = GetTickerReq.from_json(data) + data = "{\"symbol\": \"BTC-USDT\", \"type\": \"1min\", \"startAt\": 1566703297, \"endAt\": 1566789757}" + req = GetKlinesReq.from_json(data) - def test_get_ticker_resp_model(self): + def test_get_klines_resp_model(self): """ - get_ticker - Get Ticker - /api/v1/market/orderbook/level1 + get_klines + Get Klines + /api/v1/market/candles """ - data = "{\"code\":\"200000\",\"data\":{\"time\":1729172965609,\"sequence\":\"14609309753\",\"price\":\"67269\",\"size\":\"0.000025\",\"bestBid\":\"67267.5\",\"bestBidSize\":\"0.000025\",\"bestAsk\":\"67267.6\",\"bestAskSize\":\"1.24808993\"}}" + data = "{\n \"code\": \"200000\",\n \"data\": [\n [\n \"1566789720\",\n \"10411.5\",\n \"10401.9\",\n \"10411.5\",\n \"10396.3\",\n \"29.11357276\",\n \"302889.301529914\"\n ],\n [\n \"1566789660\",\n \"10416\",\n \"10411.5\",\n \"10422.3\",\n \"10411.5\",\n \"15.61781842\",\n \"162703.708997029\"\n ],\n [\n \"1566789600\",\n \"10408.6\",\n \"10416\",\n \"10416\",\n \"10405.4\",\n \"12.45584973\",\n \"129666.51508559\"\n ]\n ]\n}" common_response = RestResponse.from_json(data) - resp = GetTickerResp.from_dict(common_response.data) + resp = GetKlinesResp.from_dict(common_response.data) def test_get_part_order_book_req_model(self): """ @@ -160,6 +219,44 @@ def test_get_part_order_book_resp_model(self): common_response = RestResponse.from_json(data) resp = GetPartOrderBookResp.from_dict(common_response.data) + def test_get_full_order_book_req_model(self): + """ + get_full_order_book + Get Full OrderBook + /api/v3/market/orderbook/level2 + """ + data = "{\"symbol\": \"BTC-USDT\"}" + req = GetFullOrderBookReq.from_json(data) + + def test_get_full_order_book_resp_model(self): + """ + get_full_order_book + Get Full OrderBook + /api/v3/market/orderbook/level2 + """ + data = "{\n \"code\": \"200000\",\n \"data\": {\n \"time\": 1729176273859,\n \"sequence\": \"14610502970\",\n \"bids\": [\n [\n \"66976.4\",\n \"0.69109872\"\n ],\n [\n \"66976.3\",\n \"0.14377\"\n ]\n ],\n \"asks\": [\n [\n \"66976.5\",\n \"0.05408199\"\n ],\n [\n \"66976.8\",\n \"0.0005\"\n ]\n ]\n }\n}" + common_response = RestResponse.from_json(data) + resp = GetFullOrderBookResp.from_dict(common_response.data) + + def test_get_fiat_price_req_model(self): + """ + get_fiat_price + Get Fiat Price + /api/v1/prices + """ + data = "{\"base\": \"USD\", \"currencies\": \"example_string_default_value\"}" + req = GetFiatPriceReq.from_json(data) + + def test_get_fiat_price_resp_model(self): + """ + get_fiat_price + Get Fiat Price + /api/v1/prices + """ + data = "{\"code\":\"200000\",\"data\":{\"AGLD\":\"1.1174410000000001\",\"DFI\":\"0.0168915500000000\",\"PYTHUP\":\"0.0397880960000000\",\"ISLM\":\"0.0606196750000000\",\"NEAR\":\"4.7185395500000000\",\"AIOZ\":\"0.4862867350000000\",\"AUDIO\":\"0.1219390000000000\",\"BBL\":\"0.0067766100000000\",\"WLD\":\"2.2893547500000000\",\"HNT\":\"5.8990489999999984\",\"ETHFI\":\"1.5892050000000000\",\"DMAIL\":\"0.2726636000000000\",\"OPUP\":\"0.0986506500000000\",\"VET3S\":\"0.0003700448850000\",\"MANA3S\":\"0.0006056970000000\",\"TIDAL\":\"0.0001154422500000\",\"HALO\":\"0.0058270850000000\",\"OPUL\":\"0.0839480050000000\",\"MANA3L\":\"0.0029569407900000\",\"DGB\":\"0.0066556705000000\",\"AA\":\"0.2406796000000000\",\"BCH\":\"366.2167999999996484\",\"GMEE\":\"0.0113333305000000\",\"JST\":\"0.0302348750000000\",\"PBUX\":\"0.0208795550000000\",\"AR\":\"18.5457224999999909\",\"SEI\":\"0.4332832500000000\",\"PSTAKE\":\"0.0493153300000000\",\"LMWR\":\"0.1618190500000000\",\"UNFIDOWN\":\"0.0062058955000000\",\"BB\":\"0.3245376500000000\",\"JTO\":\"2.1239375000000002\",\"WEMIX\":\"0.7916040000000000\",\"G\":\"0.0324037900000000\",\"MARSH\":\"0.0617591050000000\",\"BN\":\"0.0036961510000000\",\"FLIP\":\"1.0976509000000000\",\"FLR\":\"0.0144827550000000\",\"BIGTIME\":\"0.1238780300000000\",\"FLY\":\"0.0005157420000000\",\"T\":\"0.0233483200000000\",\"W\":\"0.2865566500000000\",\"BDX\":\"0.0774012800000000\",\"BABYDOGE\":\"0.0000000029375305\",\"SFP\":\"0.7256370000000000\",\"DIA\":\"0.9179408000000000\",\"ISME\":\"0.0022388800000000\",\"LYM\":\"0.0010155919500000\",\"VET3L\":\"0.0000289755050000\",\"JUP\":\"0.8230882500000000\",\"LYX\":\"1.4501745500000001\",\"AIEPK\":\"0.0050094940000000\",\"SILLY\":\"0.0159420250000000\",\"SCPT\":\"0.0122038950000000\",\"WOO\":\"0.1796601250000000\",\"BLUR\":\"0.2462768000000000\",\"STRK\":\"0.3963117450000000\",\"BFC\":\"0.0383608100000000\",\"DC\":\"0.0003097450500000\",\"KARATE\":\"0.0007296350000000\",\"SUSHI3L\":\"0.5115441000000000\",\"NETVR\":\"0.0976111700000000\",\"WAVES\":\"1.0806594000000000\",\"LITH\":\"0.0001520239500000\",\"HAPI\":\"8.6533711499999987\",\"SUSHI3S\":\"1.2752620500000000\",\"CEEK\":\"0.0294852500000000\",\"FLOKI\":\"0.0001414292500000\",\"SHR\":\"0.0012463765000000\",\"SAND\":\"0.2566616050000000\",\"TURT\":\"0.0020889550000000\",\"UMA\":\"2.5207390000000000\",\"BEPRO\":\"0.0003955021500000\",\"SCRT\":\"0.1995002000000000\",\"TUSD\":\"0.9945025000000000\",\"COOKIE\":\"0.0220089900000000\",\"LRDS\":\"0.6218889000000000\",\"SIN\":\"0.0033633175000000\",\"OAS\":\"0.0331933950000000\",\"ROOT\":\"0.0183108400000000\",\"ADA3L\":\"0.0046396790000000\",\"TIAUP\":\"0.1228385500000000\",\"HTR\":\"0.0353023400000000\",\"UNB\":\"0.0003837080500000\",\"UNA\":\"0.0164917500000000\",\"HARD\":\"0.1087056200000000\",\"G3\":\"0.0502648550000000\",\"ADA3S\":\"0.0006191202850000\",\"MYRO\":\"0.1071863800000000\",\"HTX\":\"0.0000013693150000\",\"FT\":\"0.3585206500000000\",\"BTCDOWN\":\"0.1065467000000000\",\"UNI\":\"7.3571195999999993\",\"FX\":\"0.1379310000000000\",\"OBI\":\"0.0079030465000000\",\"UNO\":\"0.0137131400000000\",\"WRX\":\"0.1221389000000000\",\"TIADOWN\":\"0.0000914642450000\",\"ETHDOWN\":\"0.1306346500000000\",\"WELL\":\"0.0471244260000000\",\"SWFTC\":\"0.0028966509500000\",\"SKL\":\"0.0362418700000000\",\"UOS\":\"0.0867765900000000\",\"AIPAD\":\"0.0478660550000000\",\"BRETT\":\"0.1037481000000000\",\"SKY\":\"0.0520139800000000\",\"FRM\":\"0.0153123400000000\",\"VISION\":\"0.0014451770500000\",\"LENDS\":\"0.0047276350000000\",\"SLF\":\"0.3318340000000000\",\"BULL\":\"0.0023988000000000\",\"FLOW\":\"0.5372312500000000\",\"ODDZ\":\"0.0063368300000000\",\"SLN\":\"0.2804597000000000\",\"UPO\":\"0.0440779500000000\",\"SLP\":\"0.0023997995000000\",\"ID\":\"0.3718140000000000\",\"SLIM\":\"0.0906446550000000\",\"SPOT\":\"0.0021289350000000\",\"DOP\":\"0.0023028480000000\",\"ISSP\":\"0.0000874562500000\",\"UQC\":\"3.2339822000000003\",\"IO\":\"1.8185902499999999\",\"DOT\":\"4.2022978000000005\",\"1INCH\":\"0.2645676500000000\",\"SMH\":\"0.3448275000000000\",\"MAK\":\"0.0396701550000000\",\"TOKO\":\"0.0005923037000000\",\"TURBO\":\"0.0108085930000000\",\"UNFI\":\"2.8555714999999996\",\"MAN\":\"0.0210764565000000\",\"EVER\":\"0.0332733550000000\",\"FTM\":\"0.7259068650000000\",\"SHRAP\":\"0.0476361700000000\",\"MAV\":\"0.1738130500000000\",\"MAX\":\"0.2864966800000000\",\"DPR\":\"0.0018240875000000\",\"FTT\":\"2.0559715000000002\",\"ARKM\":\"1.7444273499999999\",\"ATOM\":\"4.2954512000000002\",\"PENDLE\":\"4.1554212500000007\",\"QUICK\":\"0.0365317250000000\",\"BLZ\":\"0.1217191100000000\",\"BOBA\":\"0.2014092450000000\",\"MBL\":\"0.0027856065000000\",\"OFN\":\"0.1252373500000000\",\"UNIO\":\"0.0025487250000000\",\"SNS\":\"0.0200899500000000\",\"SNX\":\"1.4282854999999999\",\"NXRA\":\"0.0272763550000000\",\"TAIKO\":\"1.4392800000000001\",\"AVAX3L\":\"0.1410875109550000\",\"L3\":\"0.0608395650000000\",\"API3\":\"1.3728132500000001\",\"XRP3S\":\"0.0028095945000000\",\"QKC\":\"0.0085157400000000\",\"AVAX3S\":\"0.5148424500000000\",\"ROSE\":\"0.0693453100000000\",\"SATS\":\"0.0000002701648500\",\"BMX\":\"0.3100449000000000\",\"PORTAL\":\"0.2811593500000000\",\"TOMI\":\"0.0309045400000000\",\"XRP3L\":\"2.1586201500000002\",\"SOL\":\"151.7250995000003583\",\"SON\":\"0.0002421788500000\",\"BNC\":\"0.1882058500000000\",\"SOCIAL\":\"0.0026486750000000\",\"CGPT\":\"0.1305147100000000\",\"CELR\":\"0.0127736100000000\",\"BNB\":\"591.0973035000118935\",\"OGN\":\"0.0852573500000000\",\"CELO\":\"0.7711142500000000\",\"AUCTION\":\"13.1634150000000014\",\"MANTA\":\"0.7564216000000000\",\"LAYER\":\"0.0372713550000000\",\"AERO\":\"1.3783104999999999\",\"CETUS\":\"0.1808295400000000\",\"LL\":\"0.0201199350000000\",\"SPA\":\"0.0067426270000000\",\"PYTHDOWN\":\"0.0011834080000000\",\"NEIROCTO\":\"0.0019964013000000\",\"UTK\":\"0.0365217300000000\",\"GMRX\":\"0.0007386305000000\",\"BOB\":\"0.0000380619595000\",\"HOTCROSS\":\"0.0056491740000000\",\"AERGO\":\"0.1007595950000000\",\"MOCA\":\"0.0783608000000000\",\"SQD\":\"0.0380809500000000\",\"MV\":\"0.0081359300000000\",\"BNB3L\":\"0.2761618500000000\",\"BNB3S\":\"0.0008545725000000\",\"GALAX3L\":\"0.0057571999600000\",\"KAI\":\"0.0020080954500000\",\"SQR\":\"0.0470764500000000\",\"GALAX3S\":\"0.1933033000000000\",\"EGLD\":\"25.5272299999999713\",\"ZBCN\":\"0.0010404795000000\",\"KAS\":\"0.1216691350000000\",\"MEW\":\"0.0086176890000000\",\"PUNDIX\":\"0.4130933500000000\",\"LOOKS\":\"0.0392803500000000\",\"FXS\":\"1.9060465000000000\",\"BOSON\":\"0.2732633000000000\",\"BRISE\":\"0.0000000860569500\",\"AEVO\":\"0.3388305000000000\",\"FLUX\":\"0.5276360500000000\",\"PRCL\":\"0.1969015000000000\",\"UNFIUP\":\"0.0011654170000000\",\"SEIDOWN\":\"0.0442778500000000\",\"DOAI\":\"0.0052363805000000\",\"QNT\":\"65.4312679999998206\",\"REDO\":\"0.2837580500000000\",\"STRIKE\":\"6.8225869999999997\",\"ETHW\":\"3.2418782499999998\",\"OM\":\"1.5396797750000000\",\"OP\":\"1.6911539999999999\",\"WHALE\":\"0.8134930500000000\",\"1CAT\":\"0.0018460765000000\",\"NEON\":\"0.4446775500000000\",\"GTAI\":\"0.7786105000000000\",\"SSV\":\"21.2393749999999841\",\"ETH2\":\"2601.6678843156403923\",\"KCS\":\"8.7646155000000020\",\"ARPA\":\"0.0393882960000000\",\"ARTFI\":\"0.0141029450000000\",\"BRL\":\"0.1742807323452485\",\"ALEX\":\"0.0924537500000000\",\"STG\":\"0.2943527500000000\",\"SHIB\":\"0.0000178060925000\",\"IOTX\":\"0.0394202800000000\",\"OLE\":\"0.0171414250000000\",\"KDA\":\"0.5653172000000000\",\"CERE\":\"0.0022548720000000\",\"DOCK\":\"0.0018990500000000\",\"STX\":\"1.8157916500000000\",\"OLT\":\"0.0007596200000000\",\"QI\":\"0.0131754090000000\",\"SDAO\":\"0.2748625000000000\",\"BLAST\":\"0.0087636160000000\",\"LINK3S\":\"0.0000702948350000\",\"IOST\":\"0.0049745115000000\",\"SUI\":\"2.0589700000000000\",\"CAKE\":\"1.7941024999999999\",\"BSW\":\"0.0586706500000000\",\"OMG\":\"0.2597700500000000\",\"VOLT\":\"0.0000002716641000\",\"LINK3L\":\"1.3408292499999999\",\"GEEQ\":\"0.0385607100000000\",\"PYUSD\":\"0.9988003500000000\",\"SUN\":\"0.0186106900000000\",\"TOWER\":\"0.0014812590000000\",\"BTC\":\"67133.4165000832051564\",\"IOTA\":\"0.1189405000000000\",\"REEF\":\"0.0019960015000000\",\"TRIAS\":\"3.3683149999999998\",\"KEY\":\"0.0037594713240047\",\"ETH3L\":\"0.0003305946200000\",\"BTT\":\"0.0000009117439000\",\"ONE\":\"0.0132003965000000\",\"RENDER\":\"5.2263854999999995\",\"ETH3S\":\"0.5517240000000000\",\"ANKR\":\"0.0264867500000000\",\"ALGO\":\"0.1188405500000000\",\"SYLO\":\"0.0007600198000000\",\"ZCX\":\"0.0784707450000000\",\"SD\":\"0.3851073500000000\",\"ONT\":\"0.1877960550000000\",\"MJT\":\"0.0132433750000000\",\"DYM\":\"1.6659666000000001\",\"DYP\":\"0.0205397250000000\",\"BAKEUP\":\"0.0389894955000000\",\"OOE\":\"0.0079360300000000\",\"ZELIX\":\"0.0000649675000000\",\"DOGE3L\":\"0.3837080500000000\",\"ARTY\":\"0.3980009000000000\",\"QORPO\":\"0.1204297550000000\",\"ICE\":\"0.0051504235000000\",\"NOTAI\":\"0.0000892753400000\",\"DOGE3S\":\"0.2291853500000000\",\"NAKA\":\"1.0695649500000000\",\"GALAX\":\"0.0212893500000000\",\"MKR\":\"1245.8767500000163833\",\"DODO\":\"0.1152423500000000\",\"ICP\":\"7.6731615000000027\",\"ZEC\":\"35.9400209999999543\",\"ZEE\":\"0.0065767100000000\",\"ICX\":\"0.1383308000000000\",\"KMNO\":\"0.0921499020000000\",\"TT\":\"0.0033883050000000\",\"DOT3L\":\"0.1454272500000000\",\"XAI\":\"0.2038980000000000\",\"ZEN\":\"8.0149905000000007\",\"DOGE\":\"0.1213093150000000\",\"ALPHA\":\"0.0567416150000000\",\"DUSK\":\"0.1964517250000000\",\"DOT3S\":\"0.0053613180000000\",\"SXP\":\"0.2538730000000000\",\"HBAR\":\"0.0510044850000000\",\"SYNT\":\"0.0467166300000000\",\"ZEX\":\"0.0571714000000000\",\"BONDLY\":\"0.0022208890000000\",\"MLK\":\"0.2080859050000000\",\"KICKS\":\"0.0001301249050000\",\"PEPE\":\"0.0000100249850000\",\"OUSD\":\"0.9982006500000000\",\"LUNCDOWN\":\"0.0000733333150000\",\"DOGS\":\"0.0007086455000000\",\"REV3L\":\"0.0094672640000000\",\"CTSI\":\"0.1257371000000000\",\"C98\":\"0.1219390000000000\",\"OSMO\":\"0.5370313500000000\",\"NTRN\":\"0.3869064500000000\",\"CFX2S\":\"0.0084757600000000\",\"SYN\":\"0.5636180500000000\",\"VIDT\":\"0.0308745550000000\",\"SYS\":\"0.0997501000000000\",\"GAS\":\"4.3029474500000008\",\"BOME\":\"0.0087336310000000\",\"COMBO\":\"0.4068964500000000\",\"XCH\":\"14.9825050000000010\",\"VR\":\"0.0063538215000000\",\"CFX2L\":\"0.0499660045000000\",\"VSYS\":\"0.0005201398000000\",\"PANDORA\":\"1629.2949450001102772\",\"THETA\":\"1.2461766000000000\",\"XCN\":\"0.0012699647000000\",\"NEXG\":\"0.0039180400000000\",\"MELOS\":\"0.0021244372500000\",\"XCV\":\"0.0013253370000000\",\"ORN\":\"0.8797599000000000\",\"WLKN\":\"0.0010624685000000\",\"AAVE\":\"154.2708259999996162\",\"MNT\":\"0.6168914000000000\",\"BONK\":\"0.0000227296295000\",\"PERP\":\"0.6037979500000000\",\"XDC\":\"0.0276361750000000\",\"MNW\":\"0.3681158500000000\",\"XDB\":\"0.0002578710000000\",\"BOND\":\"1.5662165000000000\",\"SUIA\":\"0.0809595000000000\",\"MOG\":\"0.0000019330330000\",\"SUTER\":\"0.0001840079500000\",\"TIME\":\"16.2648634999999969\",\"RACA\":\"0.0001949025000000\",\"BICO\":\"0.2021988500000000\",\"MON\":\"0.1066466500000000\",\"SWEAT\":\"0.0063718125000000\",\"MOXIE\":\"0.0022088950000000\",\"BABYBNB\":\"0.0289755050000000\",\"IGU\":\"0.0050674650000000\",\"HMSTR\":\"0.0037990995000000\",\"XEC\":\"0.0000354722550000\",\"MONI\":\"0.0058470750000000\",\"XR\":\"0.2374812000000000\",\"PEOPLE\":\"0.0796601500000000\",\"PUMLX\":\"0.0054572700000000\",\"ZIL\":\"0.0145927000000000\",\"WLDDOWN\":\"0.2089954500000000\",\"VAI\":\"0.0799999800000000\",\"XEN\":\"0.0000000839580000\",\"MPC\":\"0.1001499000000000\",\"XEM\":\"0.0176951480000000\",\"JASMY3S\":\"0.0019670160000000\",\"OTK\":\"0.0290464695000000\",\"TRAC\":\"0.4521738000000000\",\"DFYN\":\"0.0070664650000000\",\"BIDP\":\"0.0001939030000000\",\"JASMY3L\":\"0.0001653772700000\",\"INJDOWN\":\"0.0000194902500000\",\"KLV\":\"0.0019310340000000\",\"WAXL\":\"0.7858069000000000\",\"TRBDOWN\":\"0.0023138425000000\",\"BCH3L\":\"4.6390663064999996\",\"GMT3S\":\"0.0000457771000000\",\"KMD\":\"0.2493752500000000\",\"BCH3S\":\"0.9634180500000000\",\"ECOX\":\"0.0987506000000000\",\"AAVE3S\":\"0.0560719500000000\",\"GMT3L\":\"0.0053983694650000\",\"EPIK\":\"0.0045857060000000\",\"SUIP\":\"0.1067565950000000\",\"AAVE3L\":\"0.3638687346200000\",\"ZK\":\"0.1262368500000000\",\"ZKF\":\"0.0008595700000000\",\"OMNIA\":\"0.7624186000000000\",\"ZKJ\":\"1.1124435000000000\",\"ZKL\":\"0.1255372000000000\",\"GAFI\":\"3.0634675000000001\",\"CARV\":\"0.8703646000000000\",\"KNC\":\"0.4433782000000000\",\"CATS\":\"0.0000599700000000\",\"PROM\":\"5.2833570000000006\",\"ALEPH\":\"0.1756121500000000\",\"PONKE\":\"0.3958020000000000\",\"OVR\":\"0.1553223000000000\",\"CATI\":\"0.4105146400000000\",\"ORDER\":\"0.1183008200000000\",\"GFT\":\"0.0166616650000000\",\"BIFI\":\"0.0020489750000000\",\"GGC\":\"6.9965029985000000\",\"GGG\":\"0.0403798000000000\",\"DAPPX\":\"0.0043788095000000\",\"SUKU\":\"0.0618790450000000\",\"ULTI\":\"0.0168015950000000\",\"CREDI\":\"0.0192903500000000\",\"ERTHA\":\"0.0010014990000000\",\"FURY\":\"0.1405297000000000\",\"KARRAT\":\"0.5577210000000000\",\"MOBILE\":\"0.0009005495000000\",\"SIDUS\":\"0.0037671155000000\",\"NAVI\":\"0.1254672350000000\",\"TAO\":\"583.4081500000051807\",\"USDJ\":\"1.1386304000000001\",\"MTL\":\"0.9563216000000000\",\"VET\":\"0.0225387250000000\",\"FITFI\":\"0.0036421780000000\",\"USDT\":\"0.9995000000000000\",\"OXT\":\"0.0695652000000000\",\"CANDY\":\"0.0005597200000000\",\"USDP\":\"0.9932031500000000\",\"MTS\":\"0.0027516235000000\",\"TADA\":\"0.0283858000000000\",\"MTV\":\"0.0006559718500000\",\"NAVX\":\"0.1342228550000000\",\"ILV\":\"35.6771524999999671\",\"VINU\":\"0.0000000109045450\",\"GHX\":\"0.0903548000000000\",\"EDU\":\"0.5167415000000000\",\"HYVE\":\"0.0137331300000000\",\"BTC3L\":\"0.0058620675000000\",\"ANYONE\":\"0.9015490000000000\",\"BEAT\":\"0.0012593700000000\",\"KING\":\"0.0004821588000000\",\"CREAM\":\"15.6541689999999973\",\"CAS\":\"0.0038590695000000\",\"IMX\":\"1.4944524000000000\",\"CAT\":\"0.0000256981445000\",\"BTC3S\":\"0.0014142925000000\",\"USDE\":\"0.9985005000000000\",\"USDD\":\"1.0000997000000000\",\"CWAR\":\"0.0037981000000000\",\"USDC\":\"0.9997998500000000\",\"KRL\":\"0.3543127550000000\",\"INJ\":\"21.7691100000000194\",\"GAME\":\"0.0139630150000000\",\"TRIBL\":\"1.0994500000000000\",\"XLM\":\"0.0948525500000000\",\"TRBUP\":\"0.0012293850000000\",\"VRADOWN\":\"0.0013433280000000\",\"SUPER\":\"1.2853570000000000\",\"EIGEN\":\"3.1536223999999999\",\"IOI\":\"0.0146926500000000\",\"KSM\":\"17.5212350000000129\",\"CCD\":\"0.0034832575000000\",\"EGO\":\"0.0093553200000000\",\"EGP\":\"2.7946019999999998\",\"MXC\":\"0.0066866550000000\",\"TEL\":\"0.0014432780000000\",\"MOVR\":\"9.1340307000000027\",\"XMR\":\"155.5421899999990755\",\"MXM\":\"0.0092853550000000\",\"OORT\":\"0.1099949750000000\",\"GLM\":\"0.3231383500000000\",\"RAY\":\"2.0228880499999998\",\"XTAG\":\"0.0218190850000000\",\"GLQ\":\"0.0854572500000000\",\"CWEB\":\"0.0038480750000000\",\"REVU\":\"0.0105047450000000\",\"REVV\":\"0.0039760110000000\",\"ZRO\":\"3.7952014499999994\",\"XNL\":\"0.0093853050000000\",\"XNO\":\"0.8496749500000000\",\"SAROS\":\"0.0019290350000000\",\"KACE\":\"2.1165411999999998\",\"ZRX\":\"0.3186406000000000\",\"WLTH\":\"0.0374312750000000\",\"ATOM3L\":\"0.0321719060000000\",\"GMM\":\"0.0001497251000000\",\"BEER\":\"0.0000138670630000\",\"GMT\":\"0.1275362000000000\",\"HEART\":\"0.0159920000000000\",\"GMX\":\"22.7186349999999882\",\"ABBC\":\"0.0061769100000000\",\"OMNI\":\"8.9235359999999970\",\"ATOM3S\":\"0.0007945225400000\",\"IRL\":\"0.0099650150000000\",\"CFG\":\"0.3248375000000000\",\"WSDM\":\"0.0139830050000000\",\"GNS\":\"1.8390800000000001\",\"VANRY\":\"0.0809295150000000\",\"CFX\":\"0.1595202000000000\",\"GRAIL\":\"817.1212349999937891\",\"BEFI\":\"0.0175712100000000\",\"VELO\":\"0.0132043945000000\",\"XPR\":\"0.0008077959000000\",\"DOVI\":\"0.0584707500000000\",\"ACE\":\"0.0021349320000000\",\"ACH\":\"0.0190534685000000\",\"ISP\":\"0.0012161916000000\",\"XCAD\":\"0.2834582000000000\",\"MINA\":\"0.5630183500000000\",\"TIA\":\"5.9318325999999999\",\"DRIFT\":\"0.4350823500000000\",\"ACQ\":\"0.0056981495000000\",\"ACS\":\"0.0014917537500000\",\"MIND\":\"0.0018920535000000\",\"STORE\":\"0.0062358805000000\",\"REN\":\"0.0351224300000000\",\"ELA\":\"1.7282354500000000\",\"DREAMS\":\"0.0002498750000000\",\"ADA\":\"0.3463267500000000\",\"ELF\":\"0.3777110500000000\",\"REQ\":\"0.0959919800000000\",\"STORJ\":\"0.5662167500000000\",\"LADYS\":\"0.0000000837581000\",\"PAXG\":\"2697.9303600003123340\",\"REZ\":\"0.0409795000000000\",\"XRD\":\"0.0157821050000000\",\"CHO\":\"0.0205097400000000\",\"CHR\":\"0.1769115000000000\",\"ADS\":\"0.1889055000000000\",\"CHZ\":\"0.0738030800000000\",\"ADX\":\"0.1575212000000000\",\"XRP\":\"0.5525036100000000\",\"JASMY\":\"0.0188615645000000\",\"KAGI\":\"0.1834582250000000\",\"FIDA\":\"0.2282858000000000\",\"PBR\":\"0.0291953950000000\",\"AEG\":\"0.0093453250000000\",\"H2O\":\"0.1610194500000000\",\"CHMB\":\"0.0001715641750000\",\"SAND3L\":\"0.0015447972150000\",\"PBX\":\"0.0006879558500000\",\"SOLVE\":\"0.0084557700000000\",\"DECHAT\":\"0.1512243500000000\",\"GARI\":\"0.0076861550000000\",\"SHIB2L\":\"1.1996998499999999\",\"SHIB2S\":\"0.0240879500000000\",\"ENA\":\"0.3942028000000000\",\"VEMP\":\"0.0029335325000000\",\"ENJ\":\"0.1467266000000000\",\"AFG\":\"0.0072163900000000\",\"RATS\":\"0.0001211593900000\",\"GRT\":\"0.1646076550000000\",\"FORWARD\":\"0.0012873560000000\",\"TFUEL\":\"0.0598800450000000\",\"ENS\":\"17.0634640000000052\",\"KASDOWN\":\"0.0258770550000000\",\"XTM\":\"0.0251074400000000\",\"DEGEN\":\"0.0084857550000000\",\"TLM\":\"0.0100449750000000\",\"DYDXDOWN\":\"0.1042598440000000\",\"CKB\":\"0.0146026950000000\",\"LUNC\":\"0.0000889255150000\",\"AURORA\":\"0.1204397500000000\",\"LUNA\":\"0.3624187000000000\",\"XTZ\":\"0.6776610000000000\",\"ELON\":\"0.0000001410294500\",\"DMTR\":\"0.0891554000000000\",\"EOS\":\"0.4759619000000000\",\"GST\":\"0.0118940500000000\",\"FORT\":\"0.1155422000000000\",\"FLAME\":\"0.0247076400000000\",\"PATEX\":\"0.9605195000000000\",\"DEEP\":\"0.0328885475000000\",\"ID3L\":\"0.0016201895000000\",\"GTC\":\"0.6625685500000000\",\"ID3S\":\"0.0071674145000000\",\"RIO\":\"0.7616190000000000\",\"CLH\":\"0.0008555720000000\",\"BURGER\":\"0.4016990500000000\",\"VRA\":\"0.0029765110000000\",\"SUNDOG\":\"0.2173912500000000\",\"GTT\":\"0.0002038980000000\",\"INJUP\":\"0.2327835500000000\",\"CPOOL\":\"0.1557720750000000\",\"EPX\":\"0.0000740629500000\",\"CLV\":\"0.0329835000000000\",\"FEAR\":\"0.0560519600000000\",\"MEME\":\"0.0124847545000000\",\"ROOBEE\":\"0.0004520738500000\",\"DEFI\":\"0.0192903500000000\",\"TOKEN\":\"0.0477361200000000\",\"GRAPE\":\"0.0020599695000000\",\"KASUP\":\"0.3996001000000000\",\"XWG\":\"0.0003843077500000\",\"SKEY\":\"0.0621289200000000\",\"SFUND\":\"1.3243375000000000\",\"EQX\":\"0.0032823580000000\",\"ORDIUP\":\"0.0548315705000000\",\"TON\":\"5.1857058499999995\",\"DEGO\":\"2.2667660500000001\",\"IZI\":\"0.0088455750000000\",\"ERG\":\"0.6605695500000000\",\"ERN\":\"1.9255367500000001\",\"VENOM\":\"0.0817591000000000\",\"VOXEL\":\"0.1497251000000000\",\"RLC\":\"1.4649671500000000\",\"PHA\":\"0.1093453000000000\",\"DYDXUP\":\"0.0112573685000000\",\"APE3S\":\"0.0008475760000000\",\"ORBS\":\"0.0288955450000000\",\"OPDOWN\":\"0.6758619000000000\",\"ESE\":\"0.0139130400000000\",\"APE3L\":\"0.1339330000000000\",\"HMND\":\"0.0982208650000000\",\"COQ\":\"0.0000014432780000\",\"AURY\":\"0.3340329000000000\",\"CULT\":\"0.0000028025980000\",\"AKT\":\"2.4642672500000001\",\"GLMR\":\"0.1606196500000000\",\"XYM\":\"0.0142528700000000\",\"ORAI\":\"6.1769100000000012\",\"XYO\":\"0.0058680645000000\",\"ETC\":\"18.8458723500000169\",\"LAI\":\"0.0142828550000000\",\"PIP\":\"0.0178310800000000\",\"ETH\":\"2607.6655149998362673\",\"NEO\":\"10.3575186499999991\",\"RMV\":\"0.0081659150000000\",\"KLAY\":\"0.1251374000000000\",\"PIT\":\"0.0000000003268365\",\"TARA\":\"0.0043978000000000\",\"KALT\":\"0.1128735350000000\",\"PIX\":\"0.0001023687900000\",\"ETN\":\"0.0021579205000000\",\"CSIX\":\"0.0141729100000000\",\"TRADE\":\"0.4708644500000000\",\"MAVIA\":\"1.3592200500000001\",\"HIGH\":\"1.3043474999999999\",\"TRB\":\"62.5387150000000006\",\"ORDI\":\"35.7421200000000126\",\"TRVL\":\"0.0373643085000000\",\"AMB\":\"0.0059670150000000\",\"TRU\":\"0.0762018800000000\",\"LOGX\":\"0.0271963950000000\",\"FINC\":\"0.0362018900000000\",\"INFRA\":\"0.1978010500000000\",\"NATIX\":\"0.0008729633000000\",\"NFP\":\"0.2152923000000000\",\"TRY\":\"0.0292166033323590\",\"TRX\":\"0.1597201000000000\",\"LBP\":\"0.0001243378000000\",\"LBR\":\"0.0595702000000000\",\"EUL\":\"2.9735125000000000\",\"NFT\":\"0.0000004077960000\",\"SEIUP\":\"0.0478110825000000\",\"PUFFER\":\"0.3676161000000000\",\"EUR\":\"1.0811249323958897\",\"ORCA\":\"2.0664662499999999\",\"NEAR3L\":\"0.0117010765350000\",\"AMP\":\"0.0038330825000000\",\"XDEFI\":\"0.0472563600000000\",\"HIFI\":\"0.4947525000000000\",\"TRUF\":\"0.0459570100000000\",\"AITECH\":\"0.1045477000000000\",\"AMU\":\"0.0043978000000000\",\"USTC\":\"0.0214692600000000\",\"KNGL\":\"0.0499750000000000\",\"FOXY\":\"0.0102686631000000\",\"NGC\":\"0.0147935995000000\",\"TENET\":\"0.0043278350000000\",\"NEAR3S\":\"0.0072553705000000\",\"MAHA\":\"1.1904045000000000\",\"NGL\":\"0.0701748950000000\",\"TST\":\"0.0080359800000000\",\"HIPPO\":\"0.0104447750000000\",\"AXS3S\":\"0.0308705570000000\",\"CRO\":\"0.0781409100000000\",\"ZPAY\":\"0.0050574700000000\",\"MNDE\":\"0.1026786350000000\",\"CRV\":\"0.2534732000000000\",\"SWASH\":\"0.0056271850000000\",\"AXS3L\":\"0.0106388779000000\",\"VERSE\":\"0.0001803098000000\",\"RPK\":\"0.0049975000000000\",\"RPL\":\"10.9745099999999958\",\"AZERO\":\"0.3789104500000000\",\"SOUL\":\"0.0534332700000000\",\"VXV\":\"0.2619689500000000\",\"LDO\":\"1.0885554500000000\",\"MAGIC\":\"0.3390304000000000\",\"ALICE\":\"1.0324835000000000\",\"SEAM\":\"1.1933030499999999\",\"PLU\":\"1.9300345000000001\",\"AOG\":\"0.0031224380000000\",\"SMOLE\":\"0.0000387806000000\",\"EWT\":\"1.1094450000000000\",\"TSUGT\":\"0.0029185400000000\",\"PMG\":\"0.0800599500000000\",\"OPAI\":\"0.0006826585000000\",\"LOCUS\":\"0.0216591650000000\",\"CTA\":\"0.0825087250000000\",\"NIM\":\"0.0013673160000000\",\"CTC\":\"0.4033982000000000\",\"APE\":\"0.7035480500000000\",\"MERL\":\"0.2720639000000000\",\"JAM\":\"0.0004770613500000\",\"CTI\":\"0.0130314810000000\",\"APP\":\"0.0021989000000000\",\"APT\":\"9.9947001500000000\",\"WLDUP\":\"0.0093043455000000\",\"ZEND\":\"0.1280759300000000\",\"FIRE\":\"0.9113441000000000\",\"DENT\":\"0.0008630682500000\",\"PYTH\":\"0.3390603850000000\",\"LFT\":\"0.0155322300000000\",\"DPET\":\"0.0319040400000000\",\"ORDIDOWN\":\"0.3788105000000000\",\"KPOL\":\"0.0029175405000000\",\"ETHUP\":\"8.4971493000000032\",\"BAND\":\"1.0939527500000001\",\"POL\":\"0.3656171000000000\",\"ASTR\":\"0.0582608550000000\",\"NKN\":\"0.0691654000000000\",\"RSR\":\"0.0068055955000000\",\"DVPN\":\"0.0005979009000000\",\"TWT\":\"1.1119437500000000\",\"ARB\":\"0.5510243500000000\",\"CVC\":\"0.1409801746501747\",\"ARC\":\"0.0300849500000000\",\"XETA\":\"0.0022888550000000\",\"MTRG\":\"0.4007995000000000\",\"LOKA\":\"0.1867066000000000\",\"LPOOL\":\"0.0660069800000000\",\"TURBOS\":\"0.0034812585000000\",\"CVX\":\"1.7816087499999999\",\"ARX\":\"0.0007556220000000\",\"MPLX\":\"0.4355221300000000\",\"SUSHI\":\"0.7011492500000000\",\"NLK\":\"0.0114442750000000\",\"PEPE2\":\"0.0000000313843000\",\"WBTC\":\"66881.4425499645548419\",\"SUI3L\":\"0.0211204345000000\",\"CWS\":\"0.1927036000000000\",\"SUI3S\":\"0.0000579110300000\",\"INSP\":\"0.0264167850000000\",\"MANA\":\"0.2945026750000000\",\"VRTX\":\"0.0641679000000000\",\"CSPR\":\"0.0116441750000000\",\"ATA\":\"0.0785007300000000\",\"OPEN\":\"0.0080049955000000\",\"HAI\":\"0.0448275750000000\",\"NMR\":\"14.7436245000000072\",\"ATH\":\"0.0540929400000000\",\"LIT\":\"0.6282857000000000\",\"TLOS\":\"0.3263467450000000\",\"TNSR\":\"0.3662168000000000\",\"CXT\":\"0.0871364100000000\",\"POLYX\":\"0.2346826000000000\",\"ZERO\":\"0.0002507745500000\",\"ROUTE\":\"0.0610694500000000\",\"LOOM\":\"0.0580009850000000\",\"PRE\":\"0.0078680640000000\",\"VRAUP\":\"0.0134652640000000\",\"HBB\":\"0.0714742450000000\",\"RVN\":\"0.0165017450000000\",\"PRQ\":\"0.0715741950000000\",\"ONDO\":\"0.7134930750000000\",\"PEPEDOWN\":\"0.0000155022450000\",\"WOOP\":\"0.0020179905000000\",\"LUNCUP\":\"0.0168355780000000\",\"KAVA\":\"0.3522238000000000\",\"LKI\":\"0.0104187880000000\",\"AVA\":\"0.4857570000000000\",\"NOM\":\"0.0233883000000000\",\"MAPO\":\"0.0089015470000000\",\"PEPEUP\":\"0.0114252845000000\",\"STRAX\":\"0.0487156300000000\",\"NOT\":\"0.0078670645000000\",\"ZERC\":\"0.1108245600000000\",\"BCUT\":\"0.0255672100000000\",\"MASA\":\"0.0691354150000000\",\"WAN\":\"0.1785077544737212\",\"WAT\":\"0.0003273762300000\",\"WAX\":\"0.0327636100000000\",\"MASK\":\"2.2259864500000002\",\"EOS3L\":\"0.0002122138400000\",\"IDEA\":\"0.0005887055000000\",\"EOS3S\":\"0.0034472755000000\",\"YFI\":\"4919.4290549999908843\",\"MOODENG\":\"0.0774612500000000\",\"XCUR\":\"0.0048845565000000\",\"HYDRA\":\"0.2225886500000000\",\"POPCAT\":\"1.3382305500000000\",\"LQTY\":\"0.7848074000000000\",\"PIXEL\":\"0.1406596350000000\",\"LMR\":\"0.0145437245000000\",\"ZETA\":\"0.5997999500000000\",\"YGG\":\"0.4717640000000000\",\"AXS\":\"4.6006985000000006\",\"BCHSV\":\"49.8250749999999370\",\"NRN\":\"0.0395802000000000\",\"FTON\":\"0.0091954000000000\",\"COMP\":\"43.6581599999999881\",\"XPRT\":\"0.1819090000000000\",\"HFT\":\"0.1443278000000000\",\"UXLINK\":\"0.5085456000000000\",\"STAMP\":\"0.0335032400000000\",\"RUNE\":\"4.9233370999999996\",\"ZEUS\":\"0.2587705500000000\",\"LTC3L\":\"1.8294848000000001\",\"DAPP\":\"0.1763118000000000\",\"FORTH\":\"2.9508238500000004\",\"ALPINE\":\"1.5322335000000000\",\"SENSO\":\"0.0328835500000000\",\"LTC3S\":\"0.0006986505000000\",\"DEXE\":\"8.3795081500000028\",\"GOAL\":\"0.0175912000000000\",\"AVAX\":\"27.5602130000000058\",\"LISTA\":\"0.3782108000000000\",\"AMPL\":\"1.3743124999999999\",\"WORK\":\"0.1384307500000000\",\"BRWL\":\"0.0017391300000000\",\"BANANA\":\"57.1314200000001362\",\"PUSH\":\"0.0750624500000000\",\"WEN\":\"0.0001015492000000\",\"NEIRO\":\"0.0879560000000000\",\"BTCUP\":\"34.7711057499999789\",\"SOL3S\":\"0.0007816090000000\",\"BRAWL\":\"0.0004776610500000\",\"LAY3R\":\"0.2161918500000000\",\"LPT\":\"11.9304317999999945\",\"GODS\":\"0.1807096000000000\",\"SAND3S\":\"4.6152911999999992\",\"RDNT\":\"0.0640679500000000\",\"SOL3L\":\"1.8351913752850000\",\"NIBI\":\"0.0653772950000000\",\"NUM\":\"0.0436181800000000\",\"PYR\":\"2.5590198499999997\",\"DAG\":\"0.0226176855000000\",\"DAI\":\"0.9989006596042375\",\"HIP\":\"0.0034982500000000\",\"DAO\":\"0.2848575000000000\",\"AVAIL\":\"0.1300929210000000\",\"DAR\":\"0.1512243500000000\",\"FET\":\"1.3760116500000000\",\"FCON\":\"0.0001197600900000\",\"XAVA\":\"0.3789104500000000\",\"LRC\":\"0.1208395500000000\",\"UNI3S\":\"0.0000653573050000\",\"PZP\":\"0.0599600050000000\",\"POKT\":\"0.0424787500000000\",\"DASH\":\"23.6881500000000109\",\"BAKEDOWN\":\"0.0003324636850000\",\"POLC\":\"0.0061389290000000\",\"DBR\":\"0.0377671070000000\",\"CIRUS\":\"0.0055772100000000\",\"UNI3L\":\"0.0993921490650000\",\"NWC\":\"0.0681659000000000\",\"POLK\":\"0.0142628650000000\",\"LSD\":\"0.9420287500000000\",\"MARS4\":\"0.0005878059500000\",\"LSK\":\"0.8080957500000000\",\"BLOCK\":\"0.0261869000000000\",\"ANALOS\":\"0.0000446776500000\",\"SAFE\":\"0.8779608000000000\",\"DCK\":\"0.0234082900000000\",\"LSS\":\"0.0562718500000000\",\"DCR\":\"12.4337799999999929\",\"LIKE\":\"0.0559720000000000\",\"DATA\":\"0.0361819000000000\",\"WIF\":\"2.5696145499999999\",\"BLOK\":\"0.0006546725000000\",\"LTC\":\"71.6261690000000611\",\"METIS\":\"42.0289750000000612\",\"WIN\":\"0.0000868365600000\",\"HLG\":\"0.0018790600000000\",\"LTO\":\"0.1166116650000000\",\"DYDX\":\"0.9341327000000000\",\"ARB3S\":\"0.0509025360000000\",\"MUBI\":\"0.0303848000000000\",\"ARB3L\":\"0.0025917035000000\",\"RBTC1\":\"0.0000039480250000\",\"POND\":\"0.0118640650000000\",\"LINA\":\"0.0037771105000000\",\"MYRIA\":\"0.0025337325000000\",\"LINK\":\"11.0244849999999944\",\"QTUM\":\"2.4262016723130069\",\"TUNE\":\"0.0148025950000000\",\"UFO\":\"0.0000006479758500\",\"CYBER\":\"2.8755615000000001\",\"WILD\":\"0.2433782500000000\",\"POLS\":\"0.2809594500000000\",\"NYM\":\"0.0719640000000000\",\"FIL\":\"3.6786597500000005\",\"BAL\":\"2.0099945000000000\",\"SCA\":\"0.3999999000000000\",\"STND\":\"0.0133123405000000\",\"WMTX\":\"0.2138930000000000\",\"SCLP\":\"0.1545227000000000\",\"MANEKI\":\"0.0073963000000000\",\"BAT\":\"0.1721139000000000\",\"AKRO\":\"0.0042302838000000\",\"FTM3L\":\"8.2574692000000024\",\"BAX\":\"0.0000709645000000\",\"FTM3S\":\"0.0000255072400000\",\"COTI\":\"0.0951524000000000\"}}" + common_response = RestResponse.from_json(data) + resp = GetFiatPriceResp.from_dict(common_response.data) + def test_get24hr_stats_req_model(self): """ get24hr_stats @@ -196,42 +293,6 @@ def test_get_market_list_resp_model(self): common_response = RestResponse.from_json(data) resp = GetMarketListResp.from_dict(common_response.data) - def test_get_fiat_price_req_model(self): - """ - get_fiat_price - Get Fiat Price - /api/v1/prices - """ - data = "{\"base\": \"USD\", \"currencies\": \"example_string_default_value\"}" - req = GetFiatPriceReq.from_json(data) - - def test_get_fiat_price_resp_model(self): - """ - get_fiat_price - Get Fiat Price - /api/v1/prices - """ - data = "{\"code\":\"200000\",\"data\":{\"AGLD\":\"1.1174410000000001\",\"DFI\":\"0.0168915500000000\",\"PYTHUP\":\"0.0397880960000000\",\"ISLM\":\"0.0606196750000000\",\"NEAR\":\"4.7185395500000000\",\"AIOZ\":\"0.4862867350000000\",\"AUDIO\":\"0.1219390000000000\",\"BBL\":\"0.0067766100000000\",\"WLD\":\"2.2893547500000000\",\"HNT\":\"5.8990489999999984\",\"ETHFI\":\"1.5892050000000000\",\"DMAIL\":\"0.2726636000000000\",\"OPUP\":\"0.0986506500000000\",\"VET3S\":\"0.0003700448850000\",\"MANA3S\":\"0.0006056970000000\",\"TIDAL\":\"0.0001154422500000\",\"HALO\":\"0.0058270850000000\",\"OPUL\":\"0.0839480050000000\",\"MANA3L\":\"0.0029569407900000\",\"DGB\":\"0.0066556705000000\",\"AA\":\"0.2406796000000000\",\"BCH\":\"366.2167999999996484\",\"GMEE\":\"0.0113333305000000\",\"JST\":\"0.0302348750000000\",\"PBUX\":\"0.0208795550000000\",\"AR\":\"18.5457224999999909\",\"SEI\":\"0.4332832500000000\",\"PSTAKE\":\"0.0493153300000000\",\"LMWR\":\"0.1618190500000000\",\"UNFIDOWN\":\"0.0062058955000000\",\"BB\":\"0.3245376500000000\",\"JTO\":\"2.1239375000000002\",\"WEMIX\":\"0.7916040000000000\",\"G\":\"0.0324037900000000\",\"MARSH\":\"0.0617591050000000\",\"BN\":\"0.0036961510000000\",\"FLIP\":\"1.0976509000000000\",\"FLR\":\"0.0144827550000000\",\"BIGTIME\":\"0.1238780300000000\",\"FLY\":\"0.0005157420000000\",\"T\":\"0.0233483200000000\",\"W\":\"0.2865566500000000\",\"BDX\":\"0.0774012800000000\",\"BABYDOGE\":\"0.0000000029375305\",\"SFP\":\"0.7256370000000000\",\"DIA\":\"0.9179408000000000\",\"ISME\":\"0.0022388800000000\",\"LYM\":\"0.0010155919500000\",\"VET3L\":\"0.0000289755050000\",\"JUP\":\"0.8230882500000000\",\"LYX\":\"1.4501745500000001\",\"AIEPK\":\"0.0050094940000000\",\"SILLY\":\"0.0159420250000000\",\"SCPT\":\"0.0122038950000000\",\"WOO\":\"0.1796601250000000\",\"BLUR\":\"0.2462768000000000\",\"STRK\":\"0.3963117450000000\",\"BFC\":\"0.0383608100000000\",\"DC\":\"0.0003097450500000\",\"KARATE\":\"0.0007296350000000\",\"SUSHI3L\":\"0.5115441000000000\",\"NETVR\":\"0.0976111700000000\",\"WAVES\":\"1.0806594000000000\",\"LITH\":\"0.0001520239500000\",\"HAPI\":\"8.6533711499999987\",\"SUSHI3S\":\"1.2752620500000000\",\"CEEK\":\"0.0294852500000000\",\"FLOKI\":\"0.0001414292500000\",\"SHR\":\"0.0012463765000000\",\"SAND\":\"0.2566616050000000\",\"TURT\":\"0.0020889550000000\",\"UMA\":\"2.5207390000000000\",\"BEPRO\":\"0.0003955021500000\",\"SCRT\":\"0.1995002000000000\",\"TUSD\":\"0.9945025000000000\",\"COOKIE\":\"0.0220089900000000\",\"LRDS\":\"0.6218889000000000\",\"SIN\":\"0.0033633175000000\",\"OAS\":\"0.0331933950000000\",\"ROOT\":\"0.0183108400000000\",\"ADA3L\":\"0.0046396790000000\",\"TIAUP\":\"0.1228385500000000\",\"HTR\":\"0.0353023400000000\",\"UNB\":\"0.0003837080500000\",\"UNA\":\"0.0164917500000000\",\"HARD\":\"0.1087056200000000\",\"G3\":\"0.0502648550000000\",\"ADA3S\":\"0.0006191202850000\",\"MYRO\":\"0.1071863800000000\",\"HTX\":\"0.0000013693150000\",\"FT\":\"0.3585206500000000\",\"BTCDOWN\":\"0.1065467000000000\",\"UNI\":\"7.3571195999999993\",\"FX\":\"0.1379310000000000\",\"OBI\":\"0.0079030465000000\",\"UNO\":\"0.0137131400000000\",\"WRX\":\"0.1221389000000000\",\"TIADOWN\":\"0.0000914642450000\",\"ETHDOWN\":\"0.1306346500000000\",\"WELL\":\"0.0471244260000000\",\"SWFTC\":\"0.0028966509500000\",\"SKL\":\"0.0362418700000000\",\"UOS\":\"0.0867765900000000\",\"AIPAD\":\"0.0478660550000000\",\"BRETT\":\"0.1037481000000000\",\"SKY\":\"0.0520139800000000\",\"FRM\":\"0.0153123400000000\",\"VISION\":\"0.0014451770500000\",\"LENDS\":\"0.0047276350000000\",\"SLF\":\"0.3318340000000000\",\"BULL\":\"0.0023988000000000\",\"FLOW\":\"0.5372312500000000\",\"ODDZ\":\"0.0063368300000000\",\"SLN\":\"0.2804597000000000\",\"UPO\":\"0.0440779500000000\",\"SLP\":\"0.0023997995000000\",\"ID\":\"0.3718140000000000\",\"SLIM\":\"0.0906446550000000\",\"SPOT\":\"0.0021289350000000\",\"DOP\":\"0.0023028480000000\",\"ISSP\":\"0.0000874562500000\",\"UQC\":\"3.2339822000000003\",\"IO\":\"1.8185902499999999\",\"DOT\":\"4.2022978000000005\",\"1INCH\":\"0.2645676500000000\",\"SMH\":\"0.3448275000000000\",\"MAK\":\"0.0396701550000000\",\"TOKO\":\"0.0005923037000000\",\"TURBO\":\"0.0108085930000000\",\"UNFI\":\"2.8555714999999996\",\"MAN\":\"0.0210764565000000\",\"EVER\":\"0.0332733550000000\",\"FTM\":\"0.7259068650000000\",\"SHRAP\":\"0.0476361700000000\",\"MAV\":\"0.1738130500000000\",\"MAX\":\"0.2864966800000000\",\"DPR\":\"0.0018240875000000\",\"FTT\":\"2.0559715000000002\",\"ARKM\":\"1.7444273499999999\",\"ATOM\":\"4.2954512000000002\",\"PENDLE\":\"4.1554212500000007\",\"QUICK\":\"0.0365317250000000\",\"BLZ\":\"0.1217191100000000\",\"BOBA\":\"0.2014092450000000\",\"MBL\":\"0.0027856065000000\",\"OFN\":\"0.1252373500000000\",\"UNIO\":\"0.0025487250000000\",\"SNS\":\"0.0200899500000000\",\"SNX\":\"1.4282854999999999\",\"NXRA\":\"0.0272763550000000\",\"TAIKO\":\"1.4392800000000001\",\"AVAX3L\":\"0.1410875109550000\",\"L3\":\"0.0608395650000000\",\"API3\":\"1.3728132500000001\",\"XRP3S\":\"0.0028095945000000\",\"QKC\":\"0.0085157400000000\",\"AVAX3S\":\"0.5148424500000000\",\"ROSE\":\"0.0693453100000000\",\"SATS\":\"0.0000002701648500\",\"BMX\":\"0.3100449000000000\",\"PORTAL\":\"0.2811593500000000\",\"TOMI\":\"0.0309045400000000\",\"XRP3L\":\"2.1586201500000002\",\"SOL\":\"151.7250995000003583\",\"SON\":\"0.0002421788500000\",\"BNC\":\"0.1882058500000000\",\"SOCIAL\":\"0.0026486750000000\",\"CGPT\":\"0.1305147100000000\",\"CELR\":\"0.0127736100000000\",\"BNB\":\"591.0973035000118935\",\"OGN\":\"0.0852573500000000\",\"CELO\":\"0.7711142500000000\",\"AUCTION\":\"13.1634150000000014\",\"MANTA\":\"0.7564216000000000\",\"LAYER\":\"0.0372713550000000\",\"AERO\":\"1.3783104999999999\",\"CETUS\":\"0.1808295400000000\",\"LL\":\"0.0201199350000000\",\"SPA\":\"0.0067426270000000\",\"PYTHDOWN\":\"0.0011834080000000\",\"NEIROCTO\":\"0.0019964013000000\",\"UTK\":\"0.0365217300000000\",\"GMRX\":\"0.0007386305000000\",\"BOB\":\"0.0000380619595000\",\"HOTCROSS\":\"0.0056491740000000\",\"AERGO\":\"0.1007595950000000\",\"MOCA\":\"0.0783608000000000\",\"SQD\":\"0.0380809500000000\",\"MV\":\"0.0081359300000000\",\"BNB3L\":\"0.2761618500000000\",\"BNB3S\":\"0.0008545725000000\",\"GALAX3L\":\"0.0057571999600000\",\"KAI\":\"0.0020080954500000\",\"SQR\":\"0.0470764500000000\",\"GALAX3S\":\"0.1933033000000000\",\"EGLD\":\"25.5272299999999713\",\"ZBCN\":\"0.0010404795000000\",\"KAS\":\"0.1216691350000000\",\"MEW\":\"0.0086176890000000\",\"PUNDIX\":\"0.4130933500000000\",\"LOOKS\":\"0.0392803500000000\",\"FXS\":\"1.9060465000000000\",\"BOSON\":\"0.2732633000000000\",\"BRISE\":\"0.0000000860569500\",\"AEVO\":\"0.3388305000000000\",\"FLUX\":\"0.5276360500000000\",\"PRCL\":\"0.1969015000000000\",\"UNFIUP\":\"0.0011654170000000\",\"SEIDOWN\":\"0.0442778500000000\",\"DOAI\":\"0.0052363805000000\",\"QNT\":\"65.4312679999998206\",\"REDO\":\"0.2837580500000000\",\"STRIKE\":\"6.8225869999999997\",\"ETHW\":\"3.2418782499999998\",\"OM\":\"1.5396797750000000\",\"OP\":\"1.6911539999999999\",\"WHALE\":\"0.8134930500000000\",\"1CAT\":\"0.0018460765000000\",\"NEON\":\"0.4446775500000000\",\"GTAI\":\"0.7786105000000000\",\"SSV\":\"21.2393749999999841\",\"ETH2\":\"2601.6678843156403923\",\"KCS\":\"8.7646155000000020\",\"ARPA\":\"0.0393882960000000\",\"ARTFI\":\"0.0141029450000000\",\"BRL\":\"0.1742807323452485\",\"ALEX\":\"0.0924537500000000\",\"STG\":\"0.2943527500000000\",\"SHIB\":\"0.0000178060925000\",\"IOTX\":\"0.0394202800000000\",\"OLE\":\"0.0171414250000000\",\"KDA\":\"0.5653172000000000\",\"CERE\":\"0.0022548720000000\",\"DOCK\":\"0.0018990500000000\",\"STX\":\"1.8157916500000000\",\"OLT\":\"0.0007596200000000\",\"QI\":\"0.0131754090000000\",\"SDAO\":\"0.2748625000000000\",\"BLAST\":\"0.0087636160000000\",\"LINK3S\":\"0.0000702948350000\",\"IOST\":\"0.0049745115000000\",\"SUI\":\"2.0589700000000000\",\"CAKE\":\"1.7941024999999999\",\"BSW\":\"0.0586706500000000\",\"OMG\":\"0.2597700500000000\",\"VOLT\":\"0.0000002716641000\",\"LINK3L\":\"1.3408292499999999\",\"GEEQ\":\"0.0385607100000000\",\"PYUSD\":\"0.9988003500000000\",\"SUN\":\"0.0186106900000000\",\"TOWER\":\"0.0014812590000000\",\"BTC\":\"67133.4165000832051564\",\"IOTA\":\"0.1189405000000000\",\"REEF\":\"0.0019960015000000\",\"TRIAS\":\"3.3683149999999998\",\"KEY\":\"0.0037594713240047\",\"ETH3L\":\"0.0003305946200000\",\"BTT\":\"0.0000009117439000\",\"ONE\":\"0.0132003965000000\",\"RENDER\":\"5.2263854999999995\",\"ETH3S\":\"0.5517240000000000\",\"ANKR\":\"0.0264867500000000\",\"ALGO\":\"0.1188405500000000\",\"SYLO\":\"0.0007600198000000\",\"ZCX\":\"0.0784707450000000\",\"SD\":\"0.3851073500000000\",\"ONT\":\"0.1877960550000000\",\"MJT\":\"0.0132433750000000\",\"DYM\":\"1.6659666000000001\",\"DYP\":\"0.0205397250000000\",\"BAKEUP\":\"0.0389894955000000\",\"OOE\":\"0.0079360300000000\",\"ZELIX\":\"0.0000649675000000\",\"DOGE3L\":\"0.3837080500000000\",\"ARTY\":\"0.3980009000000000\",\"QORPO\":\"0.1204297550000000\",\"ICE\":\"0.0051504235000000\",\"NOTAI\":\"0.0000892753400000\",\"DOGE3S\":\"0.2291853500000000\",\"NAKA\":\"1.0695649500000000\",\"GALAX\":\"0.0212893500000000\",\"MKR\":\"1245.8767500000163833\",\"DODO\":\"0.1152423500000000\",\"ICP\":\"7.6731615000000027\",\"ZEC\":\"35.9400209999999543\",\"ZEE\":\"0.0065767100000000\",\"ICX\":\"0.1383308000000000\",\"KMNO\":\"0.0921499020000000\",\"TT\":\"0.0033883050000000\",\"DOT3L\":\"0.1454272500000000\",\"XAI\":\"0.2038980000000000\",\"ZEN\":\"8.0149905000000007\",\"DOGE\":\"0.1213093150000000\",\"ALPHA\":\"0.0567416150000000\",\"DUSK\":\"0.1964517250000000\",\"DOT3S\":\"0.0053613180000000\",\"SXP\":\"0.2538730000000000\",\"HBAR\":\"0.0510044850000000\",\"SYNT\":\"0.0467166300000000\",\"ZEX\":\"0.0571714000000000\",\"BONDLY\":\"0.0022208890000000\",\"MLK\":\"0.2080859050000000\",\"KICKS\":\"0.0001301249050000\",\"PEPE\":\"0.0000100249850000\",\"OUSD\":\"0.9982006500000000\",\"LUNCDOWN\":\"0.0000733333150000\",\"DOGS\":\"0.0007086455000000\",\"REV3L\":\"0.0094672640000000\",\"CTSI\":\"0.1257371000000000\",\"C98\":\"0.1219390000000000\",\"OSMO\":\"0.5370313500000000\",\"NTRN\":\"0.3869064500000000\",\"CFX2S\":\"0.0084757600000000\",\"SYN\":\"0.5636180500000000\",\"VIDT\":\"0.0308745550000000\",\"SYS\":\"0.0997501000000000\",\"GAS\":\"4.3029474500000008\",\"BOME\":\"0.0087336310000000\",\"COMBO\":\"0.4068964500000000\",\"XCH\":\"14.9825050000000010\",\"VR\":\"0.0063538215000000\",\"CFX2L\":\"0.0499660045000000\",\"VSYS\":\"0.0005201398000000\",\"PANDORA\":\"1629.2949450001102772\",\"THETA\":\"1.2461766000000000\",\"XCN\":\"0.0012699647000000\",\"NEXG\":\"0.0039180400000000\",\"MELOS\":\"0.0021244372500000\",\"XCV\":\"0.0013253370000000\",\"ORN\":\"0.8797599000000000\",\"WLKN\":\"0.0010624685000000\",\"AAVE\":\"154.2708259999996162\",\"MNT\":\"0.6168914000000000\",\"BONK\":\"0.0000227296295000\",\"PERP\":\"0.6037979500000000\",\"XDC\":\"0.0276361750000000\",\"MNW\":\"0.3681158500000000\",\"XDB\":\"0.0002578710000000\",\"BOND\":\"1.5662165000000000\",\"SUIA\":\"0.0809595000000000\",\"MOG\":\"0.0000019330330000\",\"SUTER\":\"0.0001840079500000\",\"TIME\":\"16.2648634999999969\",\"RACA\":\"0.0001949025000000\",\"BICO\":\"0.2021988500000000\",\"MON\":\"0.1066466500000000\",\"SWEAT\":\"0.0063718125000000\",\"MOXIE\":\"0.0022088950000000\",\"BABYBNB\":\"0.0289755050000000\",\"IGU\":\"0.0050674650000000\",\"HMSTR\":\"0.0037990995000000\",\"XEC\":\"0.0000354722550000\",\"MONI\":\"0.0058470750000000\",\"XR\":\"0.2374812000000000\",\"PEOPLE\":\"0.0796601500000000\",\"PUMLX\":\"0.0054572700000000\",\"ZIL\":\"0.0145927000000000\",\"WLDDOWN\":\"0.2089954500000000\",\"VAI\":\"0.0799999800000000\",\"XEN\":\"0.0000000839580000\",\"MPC\":\"0.1001499000000000\",\"XEM\":\"0.0176951480000000\",\"JASMY3S\":\"0.0019670160000000\",\"OTK\":\"0.0290464695000000\",\"TRAC\":\"0.4521738000000000\",\"DFYN\":\"0.0070664650000000\",\"BIDP\":\"0.0001939030000000\",\"JASMY3L\":\"0.0001653772700000\",\"INJDOWN\":\"0.0000194902500000\",\"KLV\":\"0.0019310340000000\",\"WAXL\":\"0.7858069000000000\",\"TRBDOWN\":\"0.0023138425000000\",\"BCH3L\":\"4.6390663064999996\",\"GMT3S\":\"0.0000457771000000\",\"KMD\":\"0.2493752500000000\",\"BCH3S\":\"0.9634180500000000\",\"ECOX\":\"0.0987506000000000\",\"AAVE3S\":\"0.0560719500000000\",\"GMT3L\":\"0.0053983694650000\",\"EPIK\":\"0.0045857060000000\",\"SUIP\":\"0.1067565950000000\",\"AAVE3L\":\"0.3638687346200000\",\"ZK\":\"0.1262368500000000\",\"ZKF\":\"0.0008595700000000\",\"OMNIA\":\"0.7624186000000000\",\"ZKJ\":\"1.1124435000000000\",\"ZKL\":\"0.1255372000000000\",\"GAFI\":\"3.0634675000000001\",\"CARV\":\"0.8703646000000000\",\"KNC\":\"0.4433782000000000\",\"CATS\":\"0.0000599700000000\",\"PROM\":\"5.2833570000000006\",\"ALEPH\":\"0.1756121500000000\",\"PONKE\":\"0.3958020000000000\",\"OVR\":\"0.1553223000000000\",\"CATI\":\"0.4105146400000000\",\"ORDER\":\"0.1183008200000000\",\"GFT\":\"0.0166616650000000\",\"BIFI\":\"0.0020489750000000\",\"GGC\":\"6.9965029985000000\",\"GGG\":\"0.0403798000000000\",\"DAPPX\":\"0.0043788095000000\",\"SUKU\":\"0.0618790450000000\",\"ULTI\":\"0.0168015950000000\",\"CREDI\":\"0.0192903500000000\",\"ERTHA\":\"0.0010014990000000\",\"FURY\":\"0.1405297000000000\",\"KARRAT\":\"0.5577210000000000\",\"MOBILE\":\"0.0009005495000000\",\"SIDUS\":\"0.0037671155000000\",\"NAVI\":\"0.1254672350000000\",\"TAO\":\"583.4081500000051807\",\"USDJ\":\"1.1386304000000001\",\"MTL\":\"0.9563216000000000\",\"VET\":\"0.0225387250000000\",\"FITFI\":\"0.0036421780000000\",\"USDT\":\"0.9995000000000000\",\"OXT\":\"0.0695652000000000\",\"CANDY\":\"0.0005597200000000\",\"USDP\":\"0.9932031500000000\",\"MTS\":\"0.0027516235000000\",\"TADA\":\"0.0283858000000000\",\"MTV\":\"0.0006559718500000\",\"NAVX\":\"0.1342228550000000\",\"ILV\":\"35.6771524999999671\",\"VINU\":\"0.0000000109045450\",\"GHX\":\"0.0903548000000000\",\"EDU\":\"0.5167415000000000\",\"HYVE\":\"0.0137331300000000\",\"BTC3L\":\"0.0058620675000000\",\"ANYONE\":\"0.9015490000000000\",\"BEAT\":\"0.0012593700000000\",\"KING\":\"0.0004821588000000\",\"CREAM\":\"15.6541689999999973\",\"CAS\":\"0.0038590695000000\",\"IMX\":\"1.4944524000000000\",\"CAT\":\"0.0000256981445000\",\"BTC3S\":\"0.0014142925000000\",\"USDE\":\"0.9985005000000000\",\"USDD\":\"1.0000997000000000\",\"CWAR\":\"0.0037981000000000\",\"USDC\":\"0.9997998500000000\",\"KRL\":\"0.3543127550000000\",\"INJ\":\"21.7691100000000194\",\"GAME\":\"0.0139630150000000\",\"TRIBL\":\"1.0994500000000000\",\"XLM\":\"0.0948525500000000\",\"TRBUP\":\"0.0012293850000000\",\"VRADOWN\":\"0.0013433280000000\",\"SUPER\":\"1.2853570000000000\",\"EIGEN\":\"3.1536223999999999\",\"IOI\":\"0.0146926500000000\",\"KSM\":\"17.5212350000000129\",\"CCD\":\"0.0034832575000000\",\"EGO\":\"0.0093553200000000\",\"EGP\":\"2.7946019999999998\",\"MXC\":\"0.0066866550000000\",\"TEL\":\"0.0014432780000000\",\"MOVR\":\"9.1340307000000027\",\"XMR\":\"155.5421899999990755\",\"MXM\":\"0.0092853550000000\",\"OORT\":\"0.1099949750000000\",\"GLM\":\"0.3231383500000000\",\"RAY\":\"2.0228880499999998\",\"XTAG\":\"0.0218190850000000\",\"GLQ\":\"0.0854572500000000\",\"CWEB\":\"0.0038480750000000\",\"REVU\":\"0.0105047450000000\",\"REVV\":\"0.0039760110000000\",\"ZRO\":\"3.7952014499999994\",\"XNL\":\"0.0093853050000000\",\"XNO\":\"0.8496749500000000\",\"SAROS\":\"0.0019290350000000\",\"KACE\":\"2.1165411999999998\",\"ZRX\":\"0.3186406000000000\",\"WLTH\":\"0.0374312750000000\",\"ATOM3L\":\"0.0321719060000000\",\"GMM\":\"0.0001497251000000\",\"BEER\":\"0.0000138670630000\",\"GMT\":\"0.1275362000000000\",\"HEART\":\"0.0159920000000000\",\"GMX\":\"22.7186349999999882\",\"ABBC\":\"0.0061769100000000\",\"OMNI\":\"8.9235359999999970\",\"ATOM3S\":\"0.0007945225400000\",\"IRL\":\"0.0099650150000000\",\"CFG\":\"0.3248375000000000\",\"WSDM\":\"0.0139830050000000\",\"GNS\":\"1.8390800000000001\",\"VANRY\":\"0.0809295150000000\",\"CFX\":\"0.1595202000000000\",\"GRAIL\":\"817.1212349999937891\",\"BEFI\":\"0.0175712100000000\",\"VELO\":\"0.0132043945000000\",\"XPR\":\"0.0008077959000000\",\"DOVI\":\"0.0584707500000000\",\"ACE\":\"0.0021349320000000\",\"ACH\":\"0.0190534685000000\",\"ISP\":\"0.0012161916000000\",\"XCAD\":\"0.2834582000000000\",\"MINA\":\"0.5630183500000000\",\"TIA\":\"5.9318325999999999\",\"DRIFT\":\"0.4350823500000000\",\"ACQ\":\"0.0056981495000000\",\"ACS\":\"0.0014917537500000\",\"MIND\":\"0.0018920535000000\",\"STORE\":\"0.0062358805000000\",\"REN\":\"0.0351224300000000\",\"ELA\":\"1.7282354500000000\",\"DREAMS\":\"0.0002498750000000\",\"ADA\":\"0.3463267500000000\",\"ELF\":\"0.3777110500000000\",\"REQ\":\"0.0959919800000000\",\"STORJ\":\"0.5662167500000000\",\"LADYS\":\"0.0000000837581000\",\"PAXG\":\"2697.9303600003123340\",\"REZ\":\"0.0409795000000000\",\"XRD\":\"0.0157821050000000\",\"CHO\":\"0.0205097400000000\",\"CHR\":\"0.1769115000000000\",\"ADS\":\"0.1889055000000000\",\"CHZ\":\"0.0738030800000000\",\"ADX\":\"0.1575212000000000\",\"XRP\":\"0.5525036100000000\",\"JASMY\":\"0.0188615645000000\",\"KAGI\":\"0.1834582250000000\",\"FIDA\":\"0.2282858000000000\",\"PBR\":\"0.0291953950000000\",\"AEG\":\"0.0093453250000000\",\"H2O\":\"0.1610194500000000\",\"CHMB\":\"0.0001715641750000\",\"SAND3L\":\"0.0015447972150000\",\"PBX\":\"0.0006879558500000\",\"SOLVE\":\"0.0084557700000000\",\"DECHAT\":\"0.1512243500000000\",\"GARI\":\"0.0076861550000000\",\"SHIB2L\":\"1.1996998499999999\",\"SHIB2S\":\"0.0240879500000000\",\"ENA\":\"0.3942028000000000\",\"VEMP\":\"0.0029335325000000\",\"ENJ\":\"0.1467266000000000\",\"AFG\":\"0.0072163900000000\",\"RATS\":\"0.0001211593900000\",\"GRT\":\"0.1646076550000000\",\"FORWARD\":\"0.0012873560000000\",\"TFUEL\":\"0.0598800450000000\",\"ENS\":\"17.0634640000000052\",\"KASDOWN\":\"0.0258770550000000\",\"XTM\":\"0.0251074400000000\",\"DEGEN\":\"0.0084857550000000\",\"TLM\":\"0.0100449750000000\",\"DYDXDOWN\":\"0.1042598440000000\",\"CKB\":\"0.0146026950000000\",\"LUNC\":\"0.0000889255150000\",\"AURORA\":\"0.1204397500000000\",\"LUNA\":\"0.3624187000000000\",\"XTZ\":\"0.6776610000000000\",\"ELON\":\"0.0000001410294500\",\"DMTR\":\"0.0891554000000000\",\"EOS\":\"0.4759619000000000\",\"GST\":\"0.0118940500000000\",\"FORT\":\"0.1155422000000000\",\"FLAME\":\"0.0247076400000000\",\"PATEX\":\"0.9605195000000000\",\"DEEP\":\"0.0328885475000000\",\"ID3L\":\"0.0016201895000000\",\"GTC\":\"0.6625685500000000\",\"ID3S\":\"0.0071674145000000\",\"RIO\":\"0.7616190000000000\",\"CLH\":\"0.0008555720000000\",\"BURGER\":\"0.4016990500000000\",\"VRA\":\"0.0029765110000000\",\"SUNDOG\":\"0.2173912500000000\",\"GTT\":\"0.0002038980000000\",\"INJUP\":\"0.2327835500000000\",\"CPOOL\":\"0.1557720750000000\",\"EPX\":\"0.0000740629500000\",\"CLV\":\"0.0329835000000000\",\"FEAR\":\"0.0560519600000000\",\"MEME\":\"0.0124847545000000\",\"ROOBEE\":\"0.0004520738500000\",\"DEFI\":\"0.0192903500000000\",\"TOKEN\":\"0.0477361200000000\",\"GRAPE\":\"0.0020599695000000\",\"KASUP\":\"0.3996001000000000\",\"XWG\":\"0.0003843077500000\",\"SKEY\":\"0.0621289200000000\",\"SFUND\":\"1.3243375000000000\",\"EQX\":\"0.0032823580000000\",\"ORDIUP\":\"0.0548315705000000\",\"TON\":\"5.1857058499999995\",\"DEGO\":\"2.2667660500000001\",\"IZI\":\"0.0088455750000000\",\"ERG\":\"0.6605695500000000\",\"ERN\":\"1.9255367500000001\",\"VENOM\":\"0.0817591000000000\",\"VOXEL\":\"0.1497251000000000\",\"RLC\":\"1.4649671500000000\",\"PHA\":\"0.1093453000000000\",\"DYDXUP\":\"0.0112573685000000\",\"APE3S\":\"0.0008475760000000\",\"ORBS\":\"0.0288955450000000\",\"OPDOWN\":\"0.6758619000000000\",\"ESE\":\"0.0139130400000000\",\"APE3L\":\"0.1339330000000000\",\"HMND\":\"0.0982208650000000\",\"COQ\":\"0.0000014432780000\",\"AURY\":\"0.3340329000000000\",\"CULT\":\"0.0000028025980000\",\"AKT\":\"2.4642672500000001\",\"GLMR\":\"0.1606196500000000\",\"XYM\":\"0.0142528700000000\",\"ORAI\":\"6.1769100000000012\",\"XYO\":\"0.0058680645000000\",\"ETC\":\"18.8458723500000169\",\"LAI\":\"0.0142828550000000\",\"PIP\":\"0.0178310800000000\",\"ETH\":\"2607.6655149998362673\",\"NEO\":\"10.3575186499999991\",\"RMV\":\"0.0081659150000000\",\"KLAY\":\"0.1251374000000000\",\"PIT\":\"0.0000000003268365\",\"TARA\":\"0.0043978000000000\",\"KALT\":\"0.1128735350000000\",\"PIX\":\"0.0001023687900000\",\"ETN\":\"0.0021579205000000\",\"CSIX\":\"0.0141729100000000\",\"TRADE\":\"0.4708644500000000\",\"MAVIA\":\"1.3592200500000001\",\"HIGH\":\"1.3043474999999999\",\"TRB\":\"62.5387150000000006\",\"ORDI\":\"35.7421200000000126\",\"TRVL\":\"0.0373643085000000\",\"AMB\":\"0.0059670150000000\",\"TRU\":\"0.0762018800000000\",\"LOGX\":\"0.0271963950000000\",\"FINC\":\"0.0362018900000000\",\"INFRA\":\"0.1978010500000000\",\"NATIX\":\"0.0008729633000000\",\"NFP\":\"0.2152923000000000\",\"TRY\":\"0.0292166033323590\",\"TRX\":\"0.1597201000000000\",\"LBP\":\"0.0001243378000000\",\"LBR\":\"0.0595702000000000\",\"EUL\":\"2.9735125000000000\",\"NFT\":\"0.0000004077960000\",\"SEIUP\":\"0.0478110825000000\",\"PUFFER\":\"0.3676161000000000\",\"EUR\":\"1.0811249323958897\",\"ORCA\":\"2.0664662499999999\",\"NEAR3L\":\"0.0117010765350000\",\"AMP\":\"0.0038330825000000\",\"XDEFI\":\"0.0472563600000000\",\"HIFI\":\"0.4947525000000000\",\"TRUF\":\"0.0459570100000000\",\"AITECH\":\"0.1045477000000000\",\"AMU\":\"0.0043978000000000\",\"USTC\":\"0.0214692600000000\",\"KNGL\":\"0.0499750000000000\",\"FOXY\":\"0.0102686631000000\",\"NGC\":\"0.0147935995000000\",\"TENET\":\"0.0043278350000000\",\"NEAR3S\":\"0.0072553705000000\",\"MAHA\":\"1.1904045000000000\",\"NGL\":\"0.0701748950000000\",\"TST\":\"0.0080359800000000\",\"HIPPO\":\"0.0104447750000000\",\"AXS3S\":\"0.0308705570000000\",\"CRO\":\"0.0781409100000000\",\"ZPAY\":\"0.0050574700000000\",\"MNDE\":\"0.1026786350000000\",\"CRV\":\"0.2534732000000000\",\"SWASH\":\"0.0056271850000000\",\"AXS3L\":\"0.0106388779000000\",\"VERSE\":\"0.0001803098000000\",\"RPK\":\"0.0049975000000000\",\"RPL\":\"10.9745099999999958\",\"AZERO\":\"0.3789104500000000\",\"SOUL\":\"0.0534332700000000\",\"VXV\":\"0.2619689500000000\",\"LDO\":\"1.0885554500000000\",\"MAGIC\":\"0.3390304000000000\",\"ALICE\":\"1.0324835000000000\",\"SEAM\":\"1.1933030499999999\",\"PLU\":\"1.9300345000000001\",\"AOG\":\"0.0031224380000000\",\"SMOLE\":\"0.0000387806000000\",\"EWT\":\"1.1094450000000000\",\"TSUGT\":\"0.0029185400000000\",\"PMG\":\"0.0800599500000000\",\"OPAI\":\"0.0006826585000000\",\"LOCUS\":\"0.0216591650000000\",\"CTA\":\"0.0825087250000000\",\"NIM\":\"0.0013673160000000\",\"CTC\":\"0.4033982000000000\",\"APE\":\"0.7035480500000000\",\"MERL\":\"0.2720639000000000\",\"JAM\":\"0.0004770613500000\",\"CTI\":\"0.0130314810000000\",\"APP\":\"0.0021989000000000\",\"APT\":\"9.9947001500000000\",\"WLDUP\":\"0.0093043455000000\",\"ZEND\":\"0.1280759300000000\",\"FIRE\":\"0.9113441000000000\",\"DENT\":\"0.0008630682500000\",\"PYTH\":\"0.3390603850000000\",\"LFT\":\"0.0155322300000000\",\"DPET\":\"0.0319040400000000\",\"ORDIDOWN\":\"0.3788105000000000\",\"KPOL\":\"0.0029175405000000\",\"ETHUP\":\"8.4971493000000032\",\"BAND\":\"1.0939527500000001\",\"POL\":\"0.3656171000000000\",\"ASTR\":\"0.0582608550000000\",\"NKN\":\"0.0691654000000000\",\"RSR\":\"0.0068055955000000\",\"DVPN\":\"0.0005979009000000\",\"TWT\":\"1.1119437500000000\",\"ARB\":\"0.5510243500000000\",\"CVC\":\"0.1409801746501747\",\"ARC\":\"0.0300849500000000\",\"XETA\":\"0.0022888550000000\",\"MTRG\":\"0.4007995000000000\",\"LOKA\":\"0.1867066000000000\",\"LPOOL\":\"0.0660069800000000\",\"TURBOS\":\"0.0034812585000000\",\"CVX\":\"1.7816087499999999\",\"ARX\":\"0.0007556220000000\",\"MPLX\":\"0.4355221300000000\",\"SUSHI\":\"0.7011492500000000\",\"NLK\":\"0.0114442750000000\",\"PEPE2\":\"0.0000000313843000\",\"WBTC\":\"66881.4425499645548419\",\"SUI3L\":\"0.0211204345000000\",\"CWS\":\"0.1927036000000000\",\"SUI3S\":\"0.0000579110300000\",\"INSP\":\"0.0264167850000000\",\"MANA\":\"0.2945026750000000\",\"VRTX\":\"0.0641679000000000\",\"CSPR\":\"0.0116441750000000\",\"ATA\":\"0.0785007300000000\",\"OPEN\":\"0.0080049955000000\",\"HAI\":\"0.0448275750000000\",\"NMR\":\"14.7436245000000072\",\"ATH\":\"0.0540929400000000\",\"LIT\":\"0.6282857000000000\",\"TLOS\":\"0.3263467450000000\",\"TNSR\":\"0.3662168000000000\",\"CXT\":\"0.0871364100000000\",\"POLYX\":\"0.2346826000000000\",\"ZERO\":\"0.0002507745500000\",\"ROUTE\":\"0.0610694500000000\",\"LOOM\":\"0.0580009850000000\",\"PRE\":\"0.0078680640000000\",\"VRAUP\":\"0.0134652640000000\",\"HBB\":\"0.0714742450000000\",\"RVN\":\"0.0165017450000000\",\"PRQ\":\"0.0715741950000000\",\"ONDO\":\"0.7134930750000000\",\"PEPEDOWN\":\"0.0000155022450000\",\"WOOP\":\"0.0020179905000000\",\"LUNCUP\":\"0.0168355780000000\",\"KAVA\":\"0.3522238000000000\",\"LKI\":\"0.0104187880000000\",\"AVA\":\"0.4857570000000000\",\"NOM\":\"0.0233883000000000\",\"MAPO\":\"0.0089015470000000\",\"PEPEUP\":\"0.0114252845000000\",\"STRAX\":\"0.0487156300000000\",\"NOT\":\"0.0078670645000000\",\"ZERC\":\"0.1108245600000000\",\"BCUT\":\"0.0255672100000000\",\"MASA\":\"0.0691354150000000\",\"WAN\":\"0.1785077544737212\",\"WAT\":\"0.0003273762300000\",\"WAX\":\"0.0327636100000000\",\"MASK\":\"2.2259864500000002\",\"EOS3L\":\"0.0002122138400000\",\"IDEA\":\"0.0005887055000000\",\"EOS3S\":\"0.0034472755000000\",\"YFI\":\"4919.4290549999908843\",\"MOODENG\":\"0.0774612500000000\",\"XCUR\":\"0.0048845565000000\",\"HYDRA\":\"0.2225886500000000\",\"POPCAT\":\"1.3382305500000000\",\"LQTY\":\"0.7848074000000000\",\"PIXEL\":\"0.1406596350000000\",\"LMR\":\"0.0145437245000000\",\"ZETA\":\"0.5997999500000000\",\"YGG\":\"0.4717640000000000\",\"AXS\":\"4.6006985000000006\",\"BCHSV\":\"49.8250749999999370\",\"NRN\":\"0.0395802000000000\",\"FTON\":\"0.0091954000000000\",\"COMP\":\"43.6581599999999881\",\"XPRT\":\"0.1819090000000000\",\"HFT\":\"0.1443278000000000\",\"UXLINK\":\"0.5085456000000000\",\"STAMP\":\"0.0335032400000000\",\"RUNE\":\"4.9233370999999996\",\"ZEUS\":\"0.2587705500000000\",\"LTC3L\":\"1.8294848000000001\",\"DAPP\":\"0.1763118000000000\",\"FORTH\":\"2.9508238500000004\",\"ALPINE\":\"1.5322335000000000\",\"SENSO\":\"0.0328835500000000\",\"LTC3S\":\"0.0006986505000000\",\"DEXE\":\"8.3795081500000028\",\"GOAL\":\"0.0175912000000000\",\"AVAX\":\"27.5602130000000058\",\"LISTA\":\"0.3782108000000000\",\"AMPL\":\"1.3743124999999999\",\"WORK\":\"0.1384307500000000\",\"BRWL\":\"0.0017391300000000\",\"BANANA\":\"57.1314200000001362\",\"PUSH\":\"0.0750624500000000\",\"WEN\":\"0.0001015492000000\",\"NEIRO\":\"0.0879560000000000\",\"BTCUP\":\"34.7711057499999789\",\"SOL3S\":\"0.0007816090000000\",\"BRAWL\":\"0.0004776610500000\",\"LAY3R\":\"0.2161918500000000\",\"LPT\":\"11.9304317999999945\",\"GODS\":\"0.1807096000000000\",\"SAND3S\":\"4.6152911999999992\",\"RDNT\":\"0.0640679500000000\",\"SOL3L\":\"1.8351913752850000\",\"NIBI\":\"0.0653772950000000\",\"NUM\":\"0.0436181800000000\",\"PYR\":\"2.5590198499999997\",\"DAG\":\"0.0226176855000000\",\"DAI\":\"0.9989006596042375\",\"HIP\":\"0.0034982500000000\",\"DAO\":\"0.2848575000000000\",\"AVAIL\":\"0.1300929210000000\",\"DAR\":\"0.1512243500000000\",\"FET\":\"1.3760116500000000\",\"FCON\":\"0.0001197600900000\",\"XAVA\":\"0.3789104500000000\",\"LRC\":\"0.1208395500000000\",\"UNI3S\":\"0.0000653573050000\",\"PZP\":\"0.0599600050000000\",\"POKT\":\"0.0424787500000000\",\"DASH\":\"23.6881500000000109\",\"BAKEDOWN\":\"0.0003324636850000\",\"POLC\":\"0.0061389290000000\",\"DBR\":\"0.0377671070000000\",\"CIRUS\":\"0.0055772100000000\",\"UNI3L\":\"0.0993921490650000\",\"NWC\":\"0.0681659000000000\",\"POLK\":\"0.0142628650000000\",\"LSD\":\"0.9420287500000000\",\"MARS4\":\"0.0005878059500000\",\"LSK\":\"0.8080957500000000\",\"BLOCK\":\"0.0261869000000000\",\"ANALOS\":\"0.0000446776500000\",\"SAFE\":\"0.8779608000000000\",\"DCK\":\"0.0234082900000000\",\"LSS\":\"0.0562718500000000\",\"DCR\":\"12.4337799999999929\",\"LIKE\":\"0.0559720000000000\",\"DATA\":\"0.0361819000000000\",\"WIF\":\"2.5696145499999999\",\"BLOK\":\"0.0006546725000000\",\"LTC\":\"71.6261690000000611\",\"METIS\":\"42.0289750000000612\",\"WIN\":\"0.0000868365600000\",\"HLG\":\"0.0018790600000000\",\"LTO\":\"0.1166116650000000\",\"DYDX\":\"0.9341327000000000\",\"ARB3S\":\"0.0509025360000000\",\"MUBI\":\"0.0303848000000000\",\"ARB3L\":\"0.0025917035000000\",\"RBTC1\":\"0.0000039480250000\",\"POND\":\"0.0118640650000000\",\"LINA\":\"0.0037771105000000\",\"MYRIA\":\"0.0025337325000000\",\"LINK\":\"11.0244849999999944\",\"QTUM\":\"2.4262016723130069\",\"TUNE\":\"0.0148025950000000\",\"UFO\":\"0.0000006479758500\",\"CYBER\":\"2.8755615000000001\",\"WILD\":\"0.2433782500000000\",\"POLS\":\"0.2809594500000000\",\"NYM\":\"0.0719640000000000\",\"FIL\":\"3.6786597500000005\",\"BAL\":\"2.0099945000000000\",\"SCA\":\"0.3999999000000000\",\"STND\":\"0.0133123405000000\",\"WMTX\":\"0.2138930000000000\",\"SCLP\":\"0.1545227000000000\",\"MANEKI\":\"0.0073963000000000\",\"BAT\":\"0.1721139000000000\",\"AKRO\":\"0.0042302838000000\",\"FTM3L\":\"8.2574692000000024\",\"BAX\":\"0.0000709645000000\",\"FTM3S\":\"0.0000255072400000\",\"COTI\":\"0.0951524000000000\"}}" - common_response = RestResponse.from_json(data) - resp = GetFiatPriceResp.from_dict(common_response.data) - - def test_get_service_status_req_model(self): - """ - get_service_status - Get Service Status - /api/v1/status - """ - - def test_get_service_status_resp_model(self): - """ - get_service_status - Get Service Status - /api/v1/status - """ - data = "{\"code\":\"200000\",\"data\":{\"status\":\"open\",\"msg\":\"\"}}" - common_response = RestResponse.from_json(data) - resp = GetServiceStatusResp.from_dict(common_response.data) - def test_get_server_time_req_model(self): """ get_server_time @@ -249,114 +310,53 @@ def test_get_server_time_resp_model(self): common_response = RestResponse.from_json(data) resp = GetServerTimeResp.from_dict(common_response.data) - def test_get_all_symbols_req_model(self): - """ - get_all_symbols - Get All Symbols - /api/v2/symbols - """ - data = "{\"market\": \"ALTS\"}" - req = GetAllSymbolsReq.from_json(data) - - def test_get_all_symbols_resp_model(self): - """ - get_all_symbols - Get All Symbols - /api/v2/symbols - """ - data = "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"symbol\": \"BTC-USDT\",\n \"name\": \"BTC-USDT\",\n \"baseCurrency\": \"BTC\",\n \"quoteCurrency\": \"USDT\",\n \"feeCurrency\": \"USDT\",\n \"market\": \"USDS\",\n \"baseMinSize\": \"0.00001\",\n \"quoteMinSize\": \"0.1\",\n \"baseMaxSize\": \"10000000000\",\n \"quoteMaxSize\": \"99999999\",\n \"baseIncrement\": \"0.00000001\",\n \"quoteIncrement\": \"0.000001\",\n \"priceIncrement\": \"0.1\",\n \"priceLimitRate\": \"0.1\",\n \"minFunds\": \"0.1\",\n \"isMarginEnabled\": true,\n \"enableTrading\": true,\n \"feeCategory\": 1,\n \"makerFeeCoefficient\": \"1.00\",\n \"takerFeeCoefficient\": \"1.00\",\n \"st\": false\n }\n ]\n}" - common_response = RestResponse.from_json(data) - resp = GetAllSymbolsResp.from_dict(common_response.data) - - def test_get_symbol_req_model(self): - """ - get_symbol - Get Symbol - /api/v2/symbols/{symbol} - """ - data = "{\"symbol\": \"BTC-USDT\"}" - req = GetSymbolReq.from_json(data) - - def test_get_symbol_resp_model(self): - """ - get_symbol - Get Symbol - /api/v2/symbols/{symbol} - """ - data = "{\"code\":\"200000\",\"data\":{\"symbol\":\"BTC-USDT\",\"name\":\"BTC-USDT\",\"baseCurrency\":\"BTC\",\"quoteCurrency\":\"USDT\",\"feeCurrency\":\"USDT\",\"market\":\"USDS\",\"baseMinSize\":\"0.00001\",\"quoteMinSize\":\"0.1\",\"baseMaxSize\":\"10000000000\",\"quoteMaxSize\":\"99999999\",\"baseIncrement\":\"0.00000001\",\"quoteIncrement\":\"0.000001\",\"priceIncrement\":\"0.1\",\"priceLimitRate\":\"0.1\",\"minFunds\":\"0.1\",\"isMarginEnabled\":true,\"enableTrading\":true,\"feeCategory\":1,\"makerFeeCoefficient\":\"1.00\",\"takerFeeCoefficient\":\"1.00\",\"st\":false}}" - common_response = RestResponse.from_json(data) - resp = GetSymbolResp.from_dict(common_response.data) - - def test_get_announcements_req_model(self): - """ - get_announcements - Get Announcements - /api/v3/announcements - """ - data = "{\"currentPage\": 1, \"pageSize\": 50, \"annType\": \"latest-announcements\", \"lang\": \"en_US\", \"startTime\": 1729594043000, \"endTime\": 1729697729000}" - req = GetAnnouncementsReq.from_json(data) - - def test_get_announcements_resp_model(self): - """ - get_announcements - Get Announcements - /api/v3/announcements - """ - data = "{\n \"code\": \"200000\",\n \"data\": {\n \"totalNum\": 195,\n \"totalPage\": 13,\n \"currentPage\": 1,\n \"pageSize\": 15,\n \"items\": [\n {\n \"annId\": 129045,\n \"annTitle\": \"KuCoin Isolated Margin Adds the Scroll (SCR) Trading Pair\",\n \"annType\": [\n \"latest-announcements\"\n ],\n \"annDesc\": \"To enrich the variety of assets available,\xa0KuCoin\u2019s Isolated Margin Trading platform has added the Scroll (SCR)\xa0asset and trading pair.\",\n \"cTime\": 1729594043000,\n \"language\": \"en_US\",\n \"annUrl\": \"https://www.kucoin.com/announcement/kucoin-isolated-margin-adds-scr?lang=en_US\"\n },\n {\n \"annId\": 129001,\n \"annTitle\": \"DAPP-30D Fixed Promotion, Enjoy an APR of 200%!\u200b\",\n \"annType\": [\n \"latest-announcements\",\n \"activities\"\n ],\n \"annDesc\": \"KuCoin Earn will be launching the DAPP Fixed Promotion at 10:00:00 on October 22, 2024 (UTC). The available product is \u201cDAPP-30D'' with an APR of 200%.\",\n \"cTime\": 1729588460000,\n \"language\": \"en_US\",\n \"annUrl\": \"https://www.kucoin.com/announcement/dapp-30d-fixed-promotion-enjoy?lang=en_US\"\n },\n {\n \"annId\": 128581,\n \"annTitle\": \"NAYM (NAYM) Gets Listed on KuCoin! World Premiere!\",\n \"annType\": [\n \"latest-announcements\",\n \"new-listings\"\n ],\n \"annDesc\": \"Trading:\xa011:00 on October 22, 2024 (UTC)\",\n \"cTime\": 1729497729000,\n \"language\": \"en_US\",\n \"annUrl\": \"https://www.kucoin.com/announcement/en-naym-naym-gets-listed-on-kucoin-world-premiere?lang=en_US\"\n }\n ]\n }\n}" - common_response = RestResponse.from_json(data) - resp = GetAnnouncementsResp.from_dict(common_response.data) - - def test_get_currency_req_model(self): + def test_get_service_status_req_model(self): """ - get_currency - Get Currency - /api/v3/currencies/{currency} + get_service_status + Get Service Status + /api/v1/status """ - data = "{\"currency\": \"BTC\", \"chain\": \"eth\"}" - req = GetCurrencyReq.from_json(data) - def test_get_currency_resp_model(self): + def test_get_service_status_resp_model(self): """ - get_currency - Get Currency - /api/v3/currencies/{currency} + get_service_status + Get Service Status + /api/v1/status """ - data = "{\"code\":\"200000\",\"data\":{\"currency\":\"BTC\",\"name\":\"BTC\",\"fullName\":\"Bitcoin\",\"precision\":8,\"confirms\":null,\"contractAddress\":null,\"isMarginEnabled\":true,\"isDebitEnabled\":true,\"chains\":[{\"chainName\":\"BTC\",\"withdrawalMinSize\":\"0.001\",\"depositMinSize\":\"0.0002\",\"withdrawFeeRate\":\"0\",\"withdrawalMinFee\":\"0.0005\",\"isWithdrawEnabled\":true,\"isDepositEnabled\":true,\"confirms\":3,\"preConfirms\":1,\"contractAddress\":\"\",\"withdrawPrecision\":8,\"maxWithdraw\":null,\"maxDeposit\":null,\"needTag\":false,\"chainId\":\"btc\"},{\"chainName\":\"Lightning Network\",\"withdrawalMinSize\":\"0.00001\",\"depositMinSize\":\"0.00001\",\"withdrawFeeRate\":\"0\",\"withdrawalMinFee\":\"0.000015\",\"isWithdrawEnabled\":true,\"isDepositEnabled\":true,\"confirms\":1,\"preConfirms\":1,\"contractAddress\":\"\",\"withdrawPrecision\":8,\"maxWithdraw\":null,\"maxDeposit\":\"0.03\",\"needTag\":false,\"chainId\":\"btcln\"},{\"chainName\":\"KCC\",\"withdrawalMinSize\":\"0.0008\",\"depositMinSize\":null,\"withdrawFeeRate\":\"0\",\"withdrawalMinFee\":\"0.00002\",\"isWithdrawEnabled\":true,\"isDepositEnabled\":true,\"confirms\":20,\"preConfirms\":20,\"contractAddress\":\"0xfa93c12cd345c658bc4644d1d4e1b9615952258c\",\"withdrawPrecision\":8,\"maxWithdraw\":null,\"maxDeposit\":null,\"needTag\":false,\"chainId\":\"kcc\"},{\"chainName\":\"BTC-Segwit\",\"withdrawalMinSize\":\"0.0008\",\"depositMinSize\":\"0.0002\",\"withdrawFeeRate\":\"0\",\"withdrawalMinFee\":\"0.0005\",\"isWithdrawEnabled\":false,\"isDepositEnabled\":true,\"confirms\":2,\"preConfirms\":2,\"contractAddress\":\"\",\"withdrawPrecision\":8,\"maxWithdraw\":null,\"maxDeposit\":null,\"needTag\":false,\"chainId\":\"bech32\"}]}}" + data = "{\"code\":\"200000\",\"data\":{\"status\":\"open\",\"msg\":\"\"}}" common_response = RestResponse.from_json(data) - resp = GetCurrencyResp.from_dict(common_response.data) + resp = GetServiceStatusResp.from_dict(common_response.data) - def test_get_all_currencies_req_model(self): + def test_get_public_token_req_model(self): """ - get_all_currencies - Get All Currencies - /api/v3/currencies + get_public_token + Get Public Token - Spot/Margin + /api/v1/bullet-public """ - def test_get_all_currencies_resp_model(self): + def test_get_public_token_resp_model(self): """ - get_all_currencies - Get All Currencies - /api/v3/currencies + get_public_token + Get Public Token - Spot/Margin + /api/v1/bullet-public """ - data = "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"currency\": \"BTC\",\n \"name\": \"BTC\",\n \"fullName\": \"Bitcoin\",\n \"precision\": 8,\n \"confirms\": null,\n \"contractAddress\": null,\n \"isMarginEnabled\": true,\n \"isDebitEnabled\": true,\n \"chains\": [\n {\n \"chainName\": \"BTC\",\n \"withdrawalMinSize\": \"0.001\",\n \"depositMinSize\": \"0.0002\",\n \"withdrawFeeRate\": \"0\",\n \"withdrawalMinFee\": \"0.0005\",\n \"isWithdrawEnabled\": true,\n \"isDepositEnabled\": true,\n \"confirms\": 3,\n \"preConfirms\": 1,\n \"contractAddress\": \"\",\n \"withdrawPrecision\": 8,\n \"maxWithdraw\": null,\n \"maxDeposit\": null,\n \"needTag\": false,\n \"chainId\": \"btc\"\n },\n {\n \"chainName\": \"Lightning Network\",\n \"withdrawalMinSize\": \"0.00001\",\n \"depositMinSize\": \"0.00001\",\n \"withdrawFeeRate\": \"0\",\n \"withdrawalMinFee\": \"0.000015\",\n \"isWithdrawEnabled\": true,\n \"isDepositEnabled\": true,\n \"confirms\": 1,\n \"preConfirms\": 1,\n \"contractAddress\": \"\",\n \"withdrawPrecision\": 8,\n \"maxWithdraw\": null,\n \"maxDeposit\": \"0.03\",\n \"needTag\": false,\n \"chainId\": \"btcln\"\n },\n {\n \"chainName\": \"KCC\",\n \"withdrawalMinSize\": \"0.0008\",\n \"depositMinSize\": null,\n \"withdrawFeeRate\": \"0\",\n \"withdrawalMinFee\": \"0.00002\",\n \"isWithdrawEnabled\": true,\n \"isDepositEnabled\": true,\n \"confirms\": 20,\n \"preConfirms\": 20,\n \"contractAddress\": \"0xfa93c12cd345c658bc4644d1d4e1b9615952258c\",\n \"withdrawPrecision\": 8,\n \"maxWithdraw\": null,\n \"maxDeposit\": null,\n \"needTag\": false,\n \"chainId\": \"kcc\"\n },\n {\n \"chainName\": \"BTC-Segwit\",\n \"withdrawalMinSize\": \"0.0008\",\n \"depositMinSize\": \"0.0002\",\n \"withdrawFeeRate\": \"0\",\n \"withdrawalMinFee\": \"0.0005\",\n \"isWithdrawEnabled\": false,\n \"isDepositEnabled\": true,\n \"confirms\": 2,\n \"preConfirms\": 2,\n \"contractAddress\": \"\",\n \"withdrawPrecision\": 8,\n \"maxWithdraw\": null,\n \"maxDeposit\": null,\n \"needTag\": false,\n \"chainId\": \"bech32\"\n }\n ]\n },\n {\n \"currency\": \"BTCP\",\n \"name\": \"BTCP\",\n \"fullName\": \"Bitcoin Private\",\n \"precision\": 8,\n \"confirms\": null,\n \"contractAddress\": null,\n \"isMarginEnabled\": false,\n \"isDebitEnabled\": false,\n \"chains\": [\n {\n \"chainName\": \"BTCP\",\n \"withdrawalMinSize\": \"0.100000\",\n \"depositMinSize\": null,\n \"withdrawFeeRate\": \"0\",\n \"withdrawalMinFee\": \"0.010000\",\n \"isWithdrawEnabled\": false,\n \"isDepositEnabled\": false,\n \"confirms\": 6,\n \"preConfirms\": 6,\n \"contractAddress\": \"\",\n \"withdrawPrecision\": 8,\n \"maxWithdraw\": null,\n \"maxDeposit\": null,\n \"needTag\": false,\n \"chainId\": \"btcp\"\n }\n ]\n }\n ]\n}" + data = "{\n \"code\": \"200000\",\n \"data\": {\n \"token\": \"2neAiuYvAU61ZDXANAGAsiL4-iAExhsBXZxftpOeh_55i3Ysy2q2LEsEWU64mdzUOPusi34M_wGoSf7iNyEWJ93g2WHl-j4M7tCZ_S21PuIByWXUJFDywtiYB9J6i9GjsxUuhPw3Blq6rhZlGykT3Vp1phUafnulOOpts-MEmEF-3bpfetLOAq79RbGaLlE4JBvJHl5Vs9Y=.ymP9jIr6v-vucrZr8761yA==\",\n \"instanceServers\": [\n {\n \"endpoint\": \"wss://ws-api-spot.kucoin.com/\",\n \"encrypt\": true,\n \"protocol\": \"websocket\",\n \"pingInterval\": 18000,\n \"pingTimeout\": 10000\n }\n ]\n }\n}" common_response = RestResponse.from_json(data) - resp = GetAllCurrenciesResp.from_dict(common_response.data) + resp = GetPublicTokenResp.from_dict(common_response.data) - def test_get_full_order_book_req_model(self): + def test_get_private_token_req_model(self): """ - get_full_order_book - Get Full OrderBook - /api/v3/market/orderbook/level2 + get_private_token + Get Private Token - Spot/Margin + /api/v1/bullet-private """ - data = "{\"symbol\": \"BTC-USDT\"}" - req = GetFullOrderBookReq.from_json(data) - def test_get_full_order_book_resp_model(self): + def test_get_private_token_resp_model(self): """ - get_full_order_book - Get Full OrderBook - /api/v3/market/orderbook/level2 + get_private_token + Get Private Token - Spot/Margin + /api/v1/bullet-private """ - data = "{\n \"code\": \"200000\",\n \"data\": {\n \"time\": 1729176273859,\n \"sequence\": \"14610502970\",\n \"bids\": [\n [\n \"66976.4\",\n \"0.69109872\"\n ],\n [\n \"66976.3\",\n \"0.14377\"\n ]\n ],\n \"asks\": [\n [\n \"66976.5\",\n \"0.05408199\"\n ],\n [\n \"66976.8\",\n \"0.0005\"\n ]\n ]\n }\n}" + data = "{\n \"code\": \"200000\",\n \"data\": {\n \"token\": \"2neAiuYvAU737TOajb2U3uT8AEZqSWYe0fBD4LoHuXJDSC7gIzJiH4kNTWhCPISWo6nDpAe7aUaaHJ4fG8oRjFgMfUI2sM4IySWHrBceFocY8pKy2REU1HwZIngtMdMrjqPnP-biofFWbNaP1cl0X1pZc2SQ-33hDH1LgNP-yg80ZJv_Ctaj8sAFhTOZ8m1L.jut4vBQxXAseWKxODdGVGg==\",\n \"instanceServers\": [\n {\n \"endpoint\": \"wss://ws-api-spot.kucoin.com/\",\n \"encrypt\": true,\n \"protocol\": \"websocket\",\n \"pingInterval\": 18000,\n \"pingTimeout\": 10000\n }\n ]\n }\n}" common_response = RestResponse.from_json(data) - resp = GetFullOrderBookResp.from_dict(common_response.data) + resp = GetPrivateTokenResp.from_dict(common_response.data) diff --git a/sdk/python/kucoin_universal_sdk/generate/spot/order/api_order.py b/sdk/python/kucoin_universal_sdk/generate/spot/order/api_order.py index 8f52688a..96d56796 100644 --- a/sdk/python/kucoin_universal_sdk/generate/spot/order/api_order.py +++ b/sdk/python/kucoin_universal_sdk/generate/spot/order/api_order.py @@ -102,70 +102,68 @@ class OrderAPI(ABC): @abstractmethod - @deprecated('') - def get_trade_history_old(self, req: GetTradeHistoryOldReq, - **kwargs: Any) -> GetTradeHistoryOldResp: + def add_order(self, req: AddOrderReq, **kwargs: Any) -> AddOrderResp: """ - summary: Get Trade History - Old - description: Request via this endpoint to get the recent fills. The return value is the data after Pagination, sorted in descending order according to time. - documentation: https://www.kucoin.com/docs-new/api-3470350 + summary: Add Order + description: Place order to the Spot trading system, you can place two major types of orders: limit and market. Orders can only be placed if your account has sufficient funds. Once an order is placed, your funds will be put on hold for the duration of the order. The amount of funds on hold depends on the order type and parameters specified. + documentation: https://www.kucoin.com/docs-new/api-3470188 +---------------------+---------+ | Extra API Info | Value | +---------------------+---------+ | API-DOMAIN | SPOT | | API-CHANNEL | PRIVATE | - | API-PERMISSION | GENERAL | + | API-PERMISSION | SPOT | | API-RATE-LIMIT-POOL | SPOT | - | API-RATE-LIMIT | 10 | + | API-RATE-LIMIT | 1 | +---------------------+---------+ """ pass @abstractmethod - def get_trade_history(self, req: GetTradeHistoryReq, - **kwargs: Any) -> GetTradeHistoryResp: + def add_order_sync(self, req: AddOrderSyncReq, + **kwargs: Any) -> AddOrderSyncResp: """ - summary: Get Trade History - description: This endpoint can be used to obtain a list of the latest Spot transaction details. The returned data is sorted in descending order according to the latest update time of the order. - documentation: https://www.kucoin.com/docs-new/api-3470180 + summary: Add Order Sync + description: Place order to the spot trading system The difference between this interface and \"Add order\" is that this interface will synchronously return the order information after the order matching is completed. For higher latency requirements, please select the \"Add order\" interface. If there is a requirement for returning data integrity, please select this interface + documentation: https://www.kucoin.com/docs-new/api-3470170 +---------------------+---------+ | Extra API Info | Value | +---------------------+---------+ | API-DOMAIN | SPOT | | API-CHANNEL | PRIVATE | - | API-PERMISSION | GENERAL | + | API-PERMISSION | SPOT | | API-RATE-LIMIT-POOL | SPOT | - | API-RATE-LIMIT | 2 | + | API-RATE-LIMIT | 1 | +---------------------+---------+ """ pass @abstractmethod - def get_open_orders(self, req: GetOpenOrdersReq, - **kwargs: Any) -> GetOpenOrdersResp: + def add_order_test(self, req: AddOrderTestReq, + **kwargs: Any) -> AddOrderTestResp: """ - summary: Get Open Orders - description: This interface is to obtain all Spot active order lists, and the return value of the active order interface is the paged data of all uncompleted order lists. The returned data is sorted in descending order according to the latest update time of the order. After the user successfully places an order, the order is in Active state, and the user can use inOrderBook to determine whether the order has entered the order. Canceled or fully filled orders are marked as completed Done status. - documentation: https://www.kucoin.com/docs-new/api-3470178 + summary: Add Order Test + description: Order test endpoint, the request parameters and return parameters of this endpoint are exactly the same as the order endpoint, and can be used to verify whether the signature is correct and other operations. After placing an order, the order will not enter the matching system, and the order cannot be queried. + documentation: https://www.kucoin.com/docs-new/api-3470187 +---------------------+---------+ | Extra API Info | Value | +---------------------+---------+ | API-DOMAIN | SPOT | | API-CHANNEL | PRIVATE | - | API-PERMISSION | GENERAL | + | API-PERMISSION | SPOT | | API-RATE-LIMIT-POOL | SPOT | - | API-RATE-LIMIT | 2 | + | API-RATE-LIMIT | 1 | +---------------------+---------+ """ pass @abstractmethod - def get_symbols_with_open_order( - self, **kwargs: Any) -> GetSymbolsWithOpenOrderResp: + def batch_add_orders(self, req: BatchAddOrdersReq, + **kwargs: Any) -> BatchAddOrdersResp: """ - summary: Get Symbols With Open Order - description: This interface can query all spot symbol that has active orders - documentation: https://www.kucoin.com/docs-new/api-3470177 + summary: Batch Add Orders + description: This endpoint supports sequential batch order placement from a single endpoint. A maximum of 5orders can be placed simultaneously. The order types must be limit orders of the same trading pair + documentation: https://www.kucoin.com/docs-new/api-3470168 +---------------------+---------+ | Extra API Info | Value | +---------------------+---------+ @@ -173,18 +171,18 @@ def get_symbols_with_open_order( | API-CHANNEL | PRIVATE | | API-PERMISSION | SPOT | | API-RATE-LIMIT-POOL | SPOT | - | API-RATE-LIMIT | 2 | + | API-RATE-LIMIT | 1 | +---------------------+---------+ """ pass @abstractmethod - def modify_order(self, req: ModifyOrderReq, - **kwargs: Any) -> ModifyOrderResp: + def batch_add_orders_sync(self, req: BatchAddOrdersSyncReq, + **kwargs: Any) -> BatchAddOrdersSyncResp: """ - summary: Modify Order - description: This interface can modify the price and quantity of the order according to orderId or clientOid. The implementation of this interface is: cancel the order and place a new order on the same trading pair, and return the modification result to the client synchronously When the quantity of the new order updated by the user is less than the filled quantity of this order, the order will be considered as completed, and the order will be cancelled, and no new order will be placed - documentation: https://www.kucoin.com/docs-new/api-3470171 + summary: Batch Add Orders Sync + description: This endpoint supports sequential batch order placement from a single endpoint. A maximum of 5orders can be placed simultaneously. The order types must be limit orders of the same trading pair + documentation: https://www.kucoin.com/docs-new/api-3470169 +---------------------+---------+ | Extra API Info | Value | +---------------------+---------+ @@ -192,17 +190,18 @@ def modify_order(self, req: ModifyOrderReq, | API-CHANNEL | PRIVATE | | API-PERMISSION | SPOT | | API-RATE-LIMIT-POOL | SPOT | - | API-RATE-LIMIT | 3 | + | API-RATE-LIMIT | 1 | +---------------------+---------+ """ pass @abstractmethod - def cancel_all_orders(self, **kwargs: Any) -> CancelAllOrdersResp: + def cancel_order_by_order_id(self, req: CancelOrderByOrderIdReq, + **kwargs: Any) -> CancelOrderByOrderIdResp: """ - summary: Cancel All Orders - description: This endpoint can cancel all spot orders for all symbol. This endpoint only sends cancellation requests. The results of the requests must be obtained by checking the order status or subscribing to websocket. - documentation: https://www.kucoin.com/docs-new/api-3470176 + summary: Cancel Order By OrderId + description: This endpoint can be used to cancel a spot order by orderId. This endpoint only sends cancellation requests. The results of the requests must be obtained by checking the order status or subscribing to websocket. + documentation: https://www.kucoin.com/docs-new/api-3470174 +---------------------+---------+ | Extra API Info | Value | +---------------------+---------+ @@ -210,18 +209,19 @@ def cancel_all_orders(self, **kwargs: Any) -> CancelAllOrdersResp: | API-CHANNEL | PRIVATE | | API-PERMISSION | SPOT | | API-RATE-LIMIT-POOL | SPOT | - | API-RATE-LIMIT | 30 | + | API-RATE-LIMIT | 1 | +---------------------+---------+ """ pass @abstractmethod - def cancel_partial_order(self, req: CancelPartialOrderReq, - **kwargs: Any) -> CancelPartialOrderResp: + def cancel_order_by_order_id_sync( + self, req: CancelOrderByOrderIdSyncReq, + **kwargs: Any) -> CancelOrderByOrderIdSyncResp: """ - summary: Cancel Partial Order - description: This interface can cancel the specified quantity of the order according to the orderId. The order execution order is: price first, time first, this interface will not change the queue order - documentation: https://www.kucoin.com/docs-new/api-3470183 + summary: Cancel Order By OrderId Sync + description: This endpoint can be used to cancel a spot order by orderId. + documentation: https://www.kucoin.com/docs-new/api-3470185 +---------------------+---------+ | Extra API Info | Value | +---------------------+---------+ @@ -229,7 +229,7 @@ def cancel_partial_order(self, req: CancelPartialOrderReq, | API-CHANNEL | PRIVATE | | API-PERMISSION | SPOT | | API-RATE-LIMIT-POOL | SPOT | - | API-RATE-LIMIT | 2 | + | API-RATE-LIMIT | 1 | +---------------------+---------+ """ pass @@ -255,30 +255,32 @@ def cancel_order_by_client_oid( pass @abstractmethod - def get_order_by_client_oid(self, req: GetOrderByClientOidReq, - **kwargs: Any) -> GetOrderByClientOidResp: + def cancel_order_by_client_oid_sync( + self, req: CancelOrderByClientOidSyncReq, + **kwargs: Any) -> CancelOrderByClientOidSyncResp: """ - summary: Get Order By ClientOid - description: This endpoint can be used to obtain information for a single Spot order using the client order id. After the user successfully places an order, the order is in Active state, and the user can use inOrderBook to determine whether the order has entered the order. Canceled or fully filled orders are marked as completed Done status. - documentation: https://www.kucoin.com/docs-new/api-3470182 + summary: Cancel Order By ClientOid Sync + description: This endpoint can be used to cancel a spot order by orderId. + documentation: https://www.kucoin.com/docs-new/api-3470186 +---------------------+---------+ | Extra API Info | Value | +---------------------+---------+ | API-DOMAIN | SPOT | | API-CHANNEL | PRIVATE | - | API-PERMISSION | GENERAL | + | API-PERMISSION | SPOT | | API-RATE-LIMIT-POOL | SPOT | - | API-RATE-LIMIT | 2 | + | API-RATE-LIMIT | 1 | +---------------------+---------+ """ pass @abstractmethod - def set_dcp(self, req: SetDcpReq, **kwargs: Any) -> SetDcpResp: + def cancel_partial_order(self, req: CancelPartialOrderReq, + **kwargs: Any) -> CancelPartialOrderResp: """ - summary: Set DCP - description: Set Disconnection Protect(Deadman Swich)Through this interface, Call this interface to automatically cancel all orders of the set trading pair after the specified time. If this interface is not called again for renewal or cancellation before the set time, the system will help the user to cancel the order of the corresponding trading pair. Otherwise it will not. - documentation: https://www.kucoin.com/docs-new/api-3470173 + summary: Cancel Partial Order + description: This interface can cancel the specified quantity of the order according to the orderId. The order execution order is: price first, time first, this interface will not change the queue order + documentation: https://www.kucoin.com/docs-new/api-3470183 +---------------------+---------+ | Extra API Info | Value | +---------------------+---------+ @@ -292,11 +294,13 @@ def set_dcp(self, req: SetDcpReq, **kwargs: Any) -> SetDcpResp: pass @abstractmethod - def get_dcp(self, **kwargs: Any) -> GetDcpResp: + def cancel_all_orders_by_symbol( + self, req: CancelAllOrdersBySymbolReq, + **kwargs: Any) -> CancelAllOrdersBySymbolResp: """ - summary: Get DCP - description: Get Disconnection Protect(Deadman Swich)Through this interface, you can query the settings of automatic order cancellation - documentation: https://www.kucoin.com/docs-new/api-3470172 + summary: Cancel All Orders By Symbol + description: This endpoint can cancel all spot orders for specific symbol. This endpoint only sends cancellation requests. The results of the requests must be obtained by checking the order status or subscribing to websocket. + documentation: https://www.kucoin.com/docs-new/api-3470175 +---------------------+---------+ | Extra API Info | Value | +---------------------+---------+ @@ -310,13 +314,11 @@ def get_dcp(self, **kwargs: Any) -> GetDcpResp: pass @abstractmethod - def cancel_all_orders_by_symbol( - self, req: CancelAllOrdersBySymbolReq, - **kwargs: Any) -> CancelAllOrdersBySymbolResp: + def cancel_all_orders(self, **kwargs: Any) -> CancelAllOrdersResp: """ - summary: Cancel All Orders By Symbol - description: This endpoint can cancel all spot orders for specific symbol. This endpoint only sends cancellation requests. The results of the requests must be obtained by checking the order status or subscribing to websocket. - documentation: https://www.kucoin.com/docs-new/api-3470175 + summary: Cancel All Orders + description: This endpoint can cancel all spot orders for all symbol. This endpoint only sends cancellation requests. The results of the requests must be obtained by checking the order status or subscribing to websocket. + documentation: https://www.kucoin.com/docs-new/api-3470176 +---------------------+---------+ | Extra API Info | Value | +---------------------+---------+ @@ -324,75 +326,75 @@ def cancel_all_orders_by_symbol( | API-CHANNEL | PRIVATE | | API-PERMISSION | SPOT | | API-RATE-LIMIT-POOL | SPOT | - | API-RATE-LIMIT | 2 | + | API-RATE-LIMIT | 30 | +---------------------+---------+ """ pass @abstractmethod - def get_closed_orders(self, req: GetClosedOrdersReq, - **kwargs: Any) -> GetClosedOrdersResp: + def modify_order(self, req: ModifyOrderReq, + **kwargs: Any) -> ModifyOrderResp: """ - summary: Get Closed Orders - description: This interface is to obtain all Spot closed order lists, and the return value of the active order interface is the paged data of all uncompleted order lists. The returned data is sorted in descending order according to the latest update time of the order. After the user successfully places an order, the order is in Active state, and the user can use inOrderBook to determine whether the order has entered the order. Canceled or fully filled orders are marked as completed Done status. - documentation: https://www.kucoin.com/docs-new/api-3470179 + summary: Modify Order + description: This interface can modify the price and quantity of the order according to orderId or clientOid. The implementation of this interface is: cancel the order and place a new order on the same trading pair, and return the modification result to the client synchronously When the quantity of the new order updated by the user is less than the filled quantity of this order, the order will be considered as completed, and the order will be cancelled, and no new order will be placed + documentation: https://www.kucoin.com/docs-new/api-3470171 +---------------------+---------+ | Extra API Info | Value | +---------------------+---------+ | API-DOMAIN | SPOT | | API-CHANNEL | PRIVATE | - | API-PERMISSION | GENERAL | + | API-PERMISSION | SPOT | | API-RATE-LIMIT-POOL | SPOT | - | API-RATE-LIMIT | 2 | + | API-RATE-LIMIT | 3 | +---------------------+---------+ """ pass @abstractmethod - def batch_add_orders(self, req: BatchAddOrdersReq, - **kwargs: Any) -> BatchAddOrdersResp: + def get_order_by_order_id(self, req: GetOrderByOrderIdReq, + **kwargs: Any) -> GetOrderByOrderIdResp: """ - summary: Batch Add Orders - description: This endpoint supports sequential batch order placement from a single endpoint. A maximum of 5orders can be placed simultaneously. The order types must be limit orders of the same trading pair - documentation: https://www.kucoin.com/docs-new/api-3470168 + summary: Get Order By OrderId + description: This endpoint can be used to obtain information for a single Spot order using the order id. After the user successfully places an order, the order is in Active state, and the user can use inOrderBook to determine whether the order has entered the order. Canceled or fully filled orders are marked as completed Done status. + documentation: https://www.kucoin.com/docs-new/api-3470181 +---------------------+---------+ | Extra API Info | Value | +---------------------+---------+ | API-DOMAIN | SPOT | | API-CHANNEL | PRIVATE | - | API-PERMISSION | SPOT | + | API-PERMISSION | GENERAL | | API-RATE-LIMIT-POOL | SPOT | - | API-RATE-LIMIT | 1 | + | API-RATE-LIMIT | 2 | +---------------------+---------+ """ pass @abstractmethod - def batch_add_orders_sync(self, req: BatchAddOrdersSyncReq, - **kwargs: Any) -> BatchAddOrdersSyncResp: + def get_order_by_client_oid(self, req: GetOrderByClientOidReq, + **kwargs: Any) -> GetOrderByClientOidResp: """ - summary: Batch Add Orders Sync - description: This endpoint supports sequential batch order placement from a single endpoint. A maximum of 5orders can be placed simultaneously. The order types must be limit orders of the same trading pair - documentation: https://www.kucoin.com/docs-new/api-3470169 + summary: Get Order By ClientOid + description: This endpoint can be used to obtain information for a single Spot order using the client order id. After the user successfully places an order, the order is in Active state, and the user can use inOrderBook to determine whether the order has entered the order. Canceled or fully filled orders are marked as completed Done status. + documentation: https://www.kucoin.com/docs-new/api-3470182 +---------------------+---------+ | Extra API Info | Value | +---------------------+---------+ | API-DOMAIN | SPOT | | API-CHANNEL | PRIVATE | - | API-PERMISSION | SPOT | + | API-PERMISSION | GENERAL | | API-RATE-LIMIT-POOL | SPOT | - | API-RATE-LIMIT | 1 | + | API-RATE-LIMIT | 2 | +---------------------+---------+ """ pass @abstractmethod - def cancel_order_by_order_id(self, req: CancelOrderByOrderIdReq, - **kwargs: Any) -> CancelOrderByOrderIdResp: + def get_symbols_with_open_order( + self, **kwargs: Any) -> GetSymbolsWithOpenOrderResp: """ - summary: Cancel Order By OrderId - description: This endpoint can be used to cancel a spot order by orderId. This endpoint only sends cancellation requests. The results of the requests must be obtained by checking the order status or subscribing to websocket. - documentation: https://www.kucoin.com/docs-new/api-3470174 + summary: Get Symbols With Open Order + description: This interface can query all spot symbol that has active orders + documentation: https://www.kucoin.com/docs-new/api-3470177 +---------------------+---------+ | Extra API Info | Value | +---------------------+---------+ @@ -400,18 +402,18 @@ def cancel_order_by_order_id(self, req: CancelOrderByOrderIdReq, | API-CHANNEL | PRIVATE | | API-PERMISSION | SPOT | | API-RATE-LIMIT-POOL | SPOT | - | API-RATE-LIMIT | 1 | + | API-RATE-LIMIT | 2 | +---------------------+---------+ """ pass @abstractmethod - def get_order_by_order_id(self, req: GetOrderByOrderIdReq, - **kwargs: Any) -> GetOrderByOrderIdResp: + def get_open_orders(self, req: GetOpenOrdersReq, + **kwargs: Any) -> GetOpenOrdersResp: """ - summary: Get Order By OrderId - description: This endpoint can be used to obtain information for a single Spot order using the order id. After the user successfully places an order, the order is in Active state, and the user can use inOrderBook to determine whether the order has entered the order. Canceled or fully filled orders are marked as completed Done status. - documentation: https://www.kucoin.com/docs-new/api-3470181 + summary: Get Open Orders + description: This interface is to obtain all Spot active order lists, and the return value of the active order interface is the paged data of all uncompleted order lists. The returned data is sorted in descending order according to the latest update time of the order. After the user successfully places an order, the order is in Active state, and the user can use inOrderBook to determine whether the order has entered the order. Canceled or fully filled orders are marked as completed Done status. + documentation: https://www.kucoin.com/docs-new/api-3470178 +---------------------+---------+ | Extra API Info | Value | +---------------------+---------+ @@ -425,51 +427,49 @@ def get_order_by_order_id(self, req: GetOrderByOrderIdReq, pass @abstractmethod - def add_order(self, req: AddOrderReq, **kwargs: Any) -> AddOrderResp: + def get_closed_orders(self, req: GetClosedOrdersReq, + **kwargs: Any) -> GetClosedOrdersResp: """ - summary: Add Order - description: Place order to the Spot trading system, you can place two major types of orders: limit and market. Orders can only be placed if your account has sufficient funds. Once an order is placed, your funds will be put on hold for the duration of the order. The amount of funds on hold depends on the order type and parameters specified. - documentation: https://www.kucoin.com/docs-new/api-3470188 + summary: Get Closed Orders + description: This interface is to obtain all Spot closed order lists, and the return value of the active order interface is the paged data of all uncompleted order lists. The returned data is sorted in descending order according to the latest update time of the order. After the user successfully places an order, the order is in Active state, and the user can use inOrderBook to determine whether the order has entered the order. Canceled or fully filled orders are marked as completed Done status. + documentation: https://www.kucoin.com/docs-new/api-3470179 +---------------------+---------+ | Extra API Info | Value | +---------------------+---------+ | API-DOMAIN | SPOT | | API-CHANNEL | PRIVATE | - | API-PERMISSION | SPOT | + | API-PERMISSION | GENERAL | | API-RATE-LIMIT-POOL | SPOT | - | API-RATE-LIMIT | 1 | + | API-RATE-LIMIT | 2 | +---------------------+---------+ """ pass @abstractmethod - def cancel_order_by_client_oid_sync( - self, req: CancelOrderByClientOidSyncReq, - **kwargs: Any) -> CancelOrderByClientOidSyncResp: + def get_trade_history(self, req: GetTradeHistoryReq, + **kwargs: Any) -> GetTradeHistoryResp: """ - summary: Cancel Order By ClientOid Sync - description: This endpoint can be used to cancel a spot order by orderId. - documentation: https://www.kucoin.com/docs-new/api-3470186 + summary: Get Trade History + description: This endpoint can be used to obtain a list of the latest Spot transaction details. The returned data is sorted in descending order according to the latest update time of the order. + documentation: https://www.kucoin.com/docs-new/api-3470180 +---------------------+---------+ | Extra API Info | Value | +---------------------+---------+ | API-DOMAIN | SPOT | | API-CHANNEL | PRIVATE | - | API-PERMISSION | SPOT | + | API-PERMISSION | GENERAL | | API-RATE-LIMIT-POOL | SPOT | - | API-RATE-LIMIT | 1 | + | API-RATE-LIMIT | 2 | +---------------------+---------+ """ pass @abstractmethod - def cancel_order_by_order_id_sync( - self, req: CancelOrderByOrderIdSyncReq, - **kwargs: Any) -> CancelOrderByOrderIdSyncResp: + def get_dcp(self, **kwargs: Any) -> GetDcpResp: """ - summary: Cancel Order By OrderId Sync - description: This endpoint can be used to cancel a spot order by orderId. - documentation: https://www.kucoin.com/docs-new/api-3470185 + summary: Get DCP + description: Get Disconnection Protect(Deadman Swich)Through this interface, you can query the settings of automatic order cancellation + documentation: https://www.kucoin.com/docs-new/api-3470172 +---------------------+---------+ | Extra API Info | Value | +---------------------+---------+ @@ -477,18 +477,17 @@ def cancel_order_by_order_id_sync( | API-CHANNEL | PRIVATE | | API-PERMISSION | SPOT | | API-RATE-LIMIT-POOL | SPOT | - | API-RATE-LIMIT | 1 | + | API-RATE-LIMIT | 2 | +---------------------+---------+ """ pass @abstractmethod - def add_order_sync(self, req: AddOrderSyncReq, - **kwargs: Any) -> AddOrderSyncResp: + def set_dcp(self, req: SetDcpReq, **kwargs: Any) -> SetDcpResp: """ - summary: Add Order Sync - description: Place order to the spot trading system The difference between this interface and \"Add order\" is that this interface will synchronously return the order information after the order matching is completed. For higher latency requirements, please select the \"Add order\" interface. If there is a requirement for returning data integrity, please select this interface - documentation: https://www.kucoin.com/docs-new/api-3470170 + summary: Set DCP + description: Set Disconnection Protect(Deadman Swich)Through this interface, Call this interface to automatically cancel all orders of the set trading pair after the specified time. If this interface is not called again for renewal or cancellation before the set time, the system will help the user to cancel the order of the corresponding trading pair. Otherwise it will not. + documentation: https://www.kucoin.com/docs-new/api-3470173 +---------------------+---------+ | Extra API Info | Value | +---------------------+---------+ @@ -496,18 +495,19 @@ def add_order_sync(self, req: AddOrderSyncReq, | API-CHANNEL | PRIVATE | | API-PERMISSION | SPOT | | API-RATE-LIMIT-POOL | SPOT | - | API-RATE-LIMIT | 1 | + | API-RATE-LIMIT | 2 | +---------------------+---------+ """ pass @abstractmethod - def add_order_test(self, req: AddOrderTestReq, - **kwargs: Any) -> AddOrderTestResp: + @deprecated('') + def add_stop_order(self, req: AddStopOrderReq, + **kwargs: Any) -> AddStopOrderResp: """ - summary: Add Order Test - description: Order test endpoint, the request parameters and return parameters of this endpoint are exactly the same as the order endpoint, and can be used to verify whether the signature is correct and other operations. After placing an order, the order will not enter the matching system, and the order cannot be queried. - documentation: https://www.kucoin.com/docs-new/api-3470187 + summary: Add Stop Order + description: Place stop order to the Spot trading system, you can place two major types of orders: limit and market. Orders can only be placed if your account has sufficient funds. Once an order is placed, your funds will be put on hold for the duration of the order. The amount of funds on hold depends on the order type and parameters specified. + documentation: https://www.kucoin.com/docs-new/api-3470334 +---------------------+---------+ | Extra API Info | Value | +---------------------+---------+ @@ -522,40 +522,40 @@ def add_order_test(self, req: AddOrderTestReq, @abstractmethod @deprecated('') - def get_recent_trade_history_old( - self, req: GetRecentTradeHistoryOldReq, - **kwargs: Any) -> GetRecentTradeHistoryOldResp: + def cancel_stop_order_by_client_oid( + self, req: CancelStopOrderByClientOidReq, + **kwargs: Any) -> CancelStopOrderByClientOidResp: """ - summary: Get Recent Trade History - Old - description: Request via this endpoint to get a list of 1000 fills in the last 24 hours. The return value is the data after Pagination, sorted in descending order according to time. - documentation: https://www.kucoin.com/docs-new/api-3470351 + summary: Cancel Stop Order By ClientOid + description: This endpoint can be used to cancel a spot stop order by clientOid. + documentation: https://www.kucoin.com/docs-new/api-3470336 +---------------------+---------+ | Extra API Info | Value | +---------------------+---------+ | API-DOMAIN | SPOT | | API-CHANNEL | PRIVATE | - | API-PERMISSION | GENERAL | + | API-PERMISSION | SPOT | | API-RATE-LIMIT-POOL | SPOT | - | API-RATE-LIMIT | 20 | + | API-RATE-LIMIT | 5 | +---------------------+---------+ """ pass @abstractmethod @deprecated('') - def get_recent_orders_list_old( - self, req: GetRecentOrdersListOldReq, - **kwargs: Any) -> GetRecentOrdersListOldResp: + def cancel_stop_order_by_order_id( + self, req: CancelStopOrderByOrderIdReq, + **kwargs: Any) -> CancelStopOrderByOrderIdResp: """ - summary: Get Recent Orders List - Old - description: Request via this endpoint to get your current order list. The return value is the data after Pagination, sorted in descending order according to time. - documentation: https://www.kucoin.com/docs-new/api-3470347 + summary: Cancel Stop Order By OrderId + description: This endpoint can be used to cancel a spot stop order by orderId. + documentation: https://www.kucoin.com/docs-new/api-3470335 +---------------------+---------+ | Extra API Info | Value | +---------------------+---------+ | API-DOMAIN | SPOT | | API-CHANNEL | PRIVATE | - | API-PERMISSION | GENERAL | + | API-PERMISSION | SPOT | | API-RATE-LIMIT-POOL | SPOT | | API-RATE-LIMIT | 3 | +---------------------+---------+ @@ -563,13 +563,12 @@ def get_recent_orders_list_old( pass @abstractmethod - def cancel_order_by_client_oid_old( - self, req: CancelOrderByClientOidOldReq, - **kwargs: Any) -> CancelOrderByClientOidOldResp: + def batch_cancel_stop_order(self, req: BatchCancelStopOrderReq, + **kwargs: Any) -> BatchCancelStopOrderResp: """ - summary: Cancel Order By ClientOid - Old - description: This endpoint can be used to cancel a spot order by clientOid. This endpoint only sends cancellation requests. The results of the requests must be obtained by checking the order status or subscribing to websocket. - documentation: https://www.kucoin.com/docs-new/api-3470344 + summary: Batch Cancel Stop Orders + description: This endpoint can be used to cancel a spot stop orders by batch. + documentation: https://www.kucoin.com/docs-new/api-3470337 +---------------------+---------+ | Extra API Info | Value | +---------------------+---------+ @@ -583,14 +582,12 @@ def cancel_order_by_client_oid_old( pass @abstractmethod - @deprecated('') - def get_order_by_client_oid_old( - self, req: GetOrderByClientOidOldReq, - **kwargs: Any) -> GetOrderByClientOidOldResp: + def get_stop_orders_list(self, req: GetStopOrdersListReq, + **kwargs: Any) -> GetStopOrdersListResp: """ - summary: Get Order By ClientOid - Old - description: Request via this interface to check the information of a single active order via clientOid. The system will prompt that the order does not exists if the order does not exist or has been settled. - documentation: https://www.kucoin.com/docs-new/api-3470349 + summary: Get Stop Orders List + description: This interface is to obtain all Spot active stop order lists + documentation: https://www.kucoin.com/docs-new/api-3470338 +---------------------+---------+ | Extra API Info | Value | +---------------------+---------+ @@ -598,39 +595,38 @@ def get_order_by_client_oid_old( | API-CHANNEL | PRIVATE | | API-PERMISSION | GENERAL | | API-RATE-LIMIT-POOL | SPOT | - | API-RATE-LIMIT | 3 | + | API-RATE-LIMIT | 8 | +---------------------+---------+ """ pass @abstractmethod - @deprecated('') - def batch_cancel_order_old(self, req: BatchCancelOrderOldReq, - **kwargs: Any) -> BatchCancelOrderOldResp: + def get_stop_order_by_order_id(self, req: GetStopOrderByOrderIdReq, + **kwargs: Any) -> GetStopOrderByOrderIdResp: """ - summary: Batch Cancel Order - Old - description: Request via this endpoint to cancel all open orders. The response is a list of ids of the canceled orders. - documentation: https://www.kucoin.com/docs-new/api-3470345 + summary: Get Stop Order By OrderId + description: This interface is to obtain Spot stop order details by orderId + documentation: https://www.kucoin.com/docs-new/api-3470339 +---------------------+---------+ | Extra API Info | Value | +---------------------+---------+ | API-DOMAIN | SPOT | | API-CHANNEL | PRIVATE | - | API-PERMISSION | SPOT | + | API-PERMISSION | GENERAL | | API-RATE-LIMIT-POOL | SPOT | - | API-RATE-LIMIT | 20 | + | API-RATE-LIMIT | 3 | +---------------------+---------+ """ pass @abstractmethod - @deprecated('') - def get_orders_list_old(self, req: GetOrdersListOldReq, - **kwargs: Any) -> GetOrdersListOldResp: + def get_stop_order_by_client_oid( + self, req: GetStopOrderByClientOidReq, + **kwargs: Any) -> GetStopOrderByClientOidResp: """ - summary: Get Orders List - Old - description: Request via this endpoint to get your current order list. The return value is the data after Pagination, sorted in descending order according to time. - documentation: https://www.kucoin.com/docs-new/api-3470346 + summary: Get Stop Order By ClientOid + description: This interface is to obtain Spot stop order details by orderId + documentation: https://www.kucoin.com/docs-new/api-3470340 +---------------------+---------+ | Extra API Info | Value | +---------------------+---------+ @@ -638,19 +634,19 @@ def get_orders_list_old(self, req: GetOrdersListOldReq, | API-CHANNEL | PRIVATE | | API-PERMISSION | GENERAL | | API-RATE-LIMIT-POOL | SPOT | - | API-RATE-LIMIT | 2 | + | API-RATE-LIMIT | 3 | +---------------------+---------+ """ pass @abstractmethod @deprecated('') - def batch_add_orders_old(self, req: BatchAddOrdersOldReq, - **kwargs: Any) -> BatchAddOrdersOldResp: + def add_oco_order(self, req: AddOcoOrderReq, + **kwargs: Any) -> AddOcoOrderResp: """ - summary: Batch Add Orders - Old - description: Request via this endpoint to place 5 orders at the same time. The order type must be a limit order of the same symbol. - documentation: https://www.kucoin.com/docs-new/api-3470342 + summary: Add OCO Order + description: Place OCO order to the Spot trading system + documentation: https://www.kucoin.com/docs-new/api-3470353 +---------------------+---------+ | Extra API Info | Value | +---------------------+---------+ @@ -658,20 +654,20 @@ def batch_add_orders_old(self, req: BatchAddOrdersOldReq, | API-CHANNEL | PRIVATE | | API-PERMISSION | SPOT | | API-RATE-LIMIT-POOL | SPOT | - | API-RATE-LIMIT | 3 | + | API-RATE-LIMIT | 2 | +---------------------+---------+ """ pass @abstractmethod @deprecated('') - def cancel_order_by_order_id_old( - self, req: CancelOrderByOrderIdOldReq, - **kwargs: Any) -> CancelOrderByOrderIdOldResp: + def cancel_oco_order_by_order_id( + self, req: CancelOcoOrderByOrderIdReq, + **kwargs: Any) -> CancelOcoOrderByOrderIdResp: """ - summary: Cancel Order By OrderId - Old + summary: Cancel OCO Order By OrderId description: This endpoint can be used to cancel a spot order by orderId. This endpoint only sends cancellation requests. The results of the requests must be obtained by checking the order status or subscribing to websocket. - documentation: https://www.kucoin.com/docs-new/api-3470343 + documentation: https://www.kucoin.com/docs-new/api-3470354 +---------------------+---------+ | Extra API Info | Value | +---------------------+---------+ @@ -686,32 +682,33 @@ def cancel_order_by_order_id_old( @abstractmethod @deprecated('') - def get_order_by_order_id_old(self, req: GetOrderByOrderIdOldReq, - **kwargs: Any) -> GetOrderByOrderIdOldResp: + def cancel_oco_order_by_client_oid( + self, req: CancelOcoOrderByClientOidReq, + **kwargs: Any) -> CancelOcoOrderByClientOidResp: """ - summary: Get Order By OrderId - Old - description: Request via this endpoint to get a single order info by order ID. - documentation: https://www.kucoin.com/docs-new/api-3470348 + summary: Cancel OCO Order By ClientOid + description: Request via this interface to cancel a stop order via the clientOid. You will receive cancelledOrderIds field once the system has received the cancellation request. The cancellation request will be processed by the matching engine in sequence. To know if the request is processed (successfully or not), you may check the order status or the update message from the pushes. + documentation: https://www.kucoin.com/docs-new/api-3470355 +---------------------+---------+ | Extra API Info | Value | +---------------------+---------+ | API-DOMAIN | SPOT | | API-CHANNEL | PRIVATE | - | API-PERMISSION | GENERAL | + | API-PERMISSION | SPOT | | API-RATE-LIMIT-POOL | SPOT | - | API-RATE-LIMIT | 2 | + | API-RATE-LIMIT | 3 | +---------------------+---------+ """ pass @abstractmethod @deprecated('') - def add_order_old(self, req: AddOrderOldReq, - **kwargs: Any) -> AddOrderOldResp: + def batch_cancel_oco_orders(self, req: BatchCancelOcoOrdersReq, + **kwargs: Any) -> BatchCancelOcoOrdersResp: """ - summary: Add Order - Old - description: Place order to the Spot trading system, you can place two major types of orders: limit and market. Orders can only be placed if your account has sufficient funds. Once an order is placed, your funds will be put on hold for the duration of the order. The amount of funds on hold depends on the order type and parameters specified. - documentation: https://www.kucoin.com/docs-new/api-3470333 + summary: Batch Cancel OCO Order + description: This interface can batch cancel OCO orders through orderIds. You will receive cancelledOrderIds field once the system has received the cancellation request. The cancellation request will be processed by the matching engine in sequence. To know if the request is processed (successfully or not), you may check the order status or the update message from the pushes. + documentation: https://www.kucoin.com/docs-new/api-3470356 +---------------------+---------+ | Extra API Info | Value | +---------------------+---------+ @@ -719,25 +716,25 @@ def add_order_old(self, req: AddOrderOldReq, | API-CHANNEL | PRIVATE | | API-PERMISSION | SPOT | | API-RATE-LIMIT-POOL | SPOT | - | API-RATE-LIMIT | 2 | + | API-RATE-LIMIT | 3 | +---------------------+---------+ """ pass @abstractmethod @deprecated('') - def add_order_test_old(self, req: AddOrderTestOldReq, - **kwargs: Any) -> AddOrderTestOldResp: + def get_oco_order_by_order_id(self, req: GetOcoOrderByOrderIdReq, + **kwargs: Any) -> GetOcoOrderByOrderIdResp: """ - summary: Add Order Test - Old - description: Order test endpoint, the request parameters and return parameters of this endpoint are exactly the same as the order endpoint, and can be used to verify whether the signature is correct and other operations. After placing an order, the order will not enter the matching system, and the order cannot be queried. - documentation: https://www.kucoin.com/docs-new/api-3470341 + summary: Get OCO Order By OrderId + description: Request via this interface to get a oco order information via the order ID. + documentation: https://www.kucoin.com/docs-new/api-3470357 +---------------------+---------+ | Extra API Info | Value | +---------------------+---------+ | API-DOMAIN | SPOT | | API-CHANNEL | PRIVATE | - | API-PERMISSION | SPOT | + | API-PERMISSION | GENERAL | | API-RATE-LIMIT-POOL | SPOT | | API-RATE-LIMIT | 2 | +---------------------+---------+ @@ -745,52 +742,55 @@ def add_order_test_old(self, req: AddOrderTestOldReq, pass @abstractmethod - def batch_cancel_stop_order(self, req: BatchCancelStopOrderReq, - **kwargs: Any) -> BatchCancelStopOrderResp: + @deprecated('') + def get_oco_order_by_client_oid( + self, req: GetOcoOrderByClientOidReq, + **kwargs: Any) -> GetOcoOrderByClientOidResp: """ - summary: Batch Cancel Stop Orders - description: This endpoint can be used to cancel a spot stop orders by batch. - documentation: https://www.kucoin.com/docs-new/api-3470337 + summary: Get OCO Order By ClientOid + description: Request via this interface to get a oco order information via the client order ID. + documentation: https://www.kucoin.com/docs-new/api-3470358 +---------------------+---------+ | Extra API Info | Value | +---------------------+---------+ | API-DOMAIN | SPOT | | API-CHANNEL | PRIVATE | - | API-PERMISSION | SPOT | + | API-PERMISSION | GENERAL | | API-RATE-LIMIT-POOL | SPOT | - | API-RATE-LIMIT | 3 | + | API-RATE-LIMIT | 2 | +---------------------+---------+ """ pass @abstractmethod @deprecated('') - def cancel_stop_order_by_client_oid( - self, req: CancelStopOrderByClientOidReq, - **kwargs: Any) -> CancelStopOrderByClientOidResp: + def get_oco_order_detail_by_order_id( + self, req: GetOcoOrderDetailByOrderIdReq, + **kwargs: Any) -> GetOcoOrderDetailByOrderIdResp: """ - summary: Cancel Stop Order By ClientOid - description: This endpoint can be used to cancel a spot stop order by clientOid. - documentation: https://www.kucoin.com/docs-new/api-3470336 + summary: Get OCO Order Detail By OrderId + description: Request via this interface to get a oco order detail via the order ID. + documentation: https://www.kucoin.com/docs-new/api-3470359 +---------------------+---------+ | Extra API Info | Value | +---------------------+---------+ | API-DOMAIN | SPOT | | API-CHANNEL | PRIVATE | - | API-PERMISSION | SPOT | + | API-PERMISSION | GENERAL | | API-RATE-LIMIT-POOL | SPOT | - | API-RATE-LIMIT | 5 | + | API-RATE-LIMIT | 2 | +---------------------+---------+ """ pass @abstractmethod - def get_stop_orders_list(self, req: GetStopOrdersListReq, - **kwargs: Any) -> GetStopOrdersListResp: + @deprecated('') + def get_oco_order_list(self, req: GetOcoOrderListReq, + **kwargs: Any) -> GetOcoOrderListResp: """ - summary: Get Stop Orders List - description: This interface is to obtain all Spot active stop order lists - documentation: https://www.kucoin.com/docs-new/api-3470338 + summary: Get OCO Order List + description: Request via this endpoint to get your current OCO order list. Items are paginated and sorted to show the latest first. See the Pagination section for retrieving additional entries after the first page. + documentation: https://www.kucoin.com/docs-new/api-3470360 +---------------------+---------+ | Extra API Info | Value | +---------------------+---------+ @@ -798,20 +798,19 @@ def get_stop_orders_list(self, req: GetStopOrdersListReq, | API-CHANNEL | PRIVATE | | API-PERMISSION | GENERAL | | API-RATE-LIMIT-POOL | SPOT | - | API-RATE-LIMIT | 8 | + | API-RATE-LIMIT | 2 | +---------------------+---------+ """ pass @abstractmethod @deprecated('') - def cancel_stop_order_by_order_id( - self, req: CancelStopOrderByOrderIdReq, - **kwargs: Any) -> CancelStopOrderByOrderIdResp: + def add_order_old(self, req: AddOrderOldReq, + **kwargs: Any) -> AddOrderOldResp: """ - summary: Cancel Stop Order By OrderId - description: This endpoint can be used to cancel a spot stop order by orderId. - documentation: https://www.kucoin.com/docs-new/api-3470335 + summary: Add Order - Old + description: Place order to the Spot trading system, you can place two major types of orders: limit and market. Orders can only be placed if your account has sufficient funds. Once an order is placed, your funds will be put on hold for the duration of the order. The amount of funds on hold depends on the order type and parameters specified. + documentation: https://www.kucoin.com/docs-new/api-3470333 +---------------------+---------+ | Extra API Info | Value | +---------------------+---------+ @@ -819,38 +818,39 @@ def cancel_stop_order_by_order_id( | API-CHANNEL | PRIVATE | | API-PERMISSION | SPOT | | API-RATE-LIMIT-POOL | SPOT | - | API-RATE-LIMIT | 3 | + | API-RATE-LIMIT | 2 | +---------------------+---------+ """ pass @abstractmethod - def get_stop_order_by_order_id(self, req: GetStopOrderByOrderIdReq, - **kwargs: Any) -> GetStopOrderByOrderIdResp: + @deprecated('') + def add_order_test_old(self, req: AddOrderTestOldReq, + **kwargs: Any) -> AddOrderTestOldResp: """ - summary: Get Stop Order By OrderId - description: This interface is to obtain Spot stop order details by orderId - documentation: https://www.kucoin.com/docs-new/api-3470339 + summary: Add Order Test - Old + description: Order test endpoint, the request parameters and return parameters of this endpoint are exactly the same as the order endpoint, and can be used to verify whether the signature is correct and other operations. After placing an order, the order will not enter the matching system, and the order cannot be queried. + documentation: https://www.kucoin.com/docs-new/api-3470341 +---------------------+---------+ | Extra API Info | Value | +---------------------+---------+ | API-DOMAIN | SPOT | | API-CHANNEL | PRIVATE | - | API-PERMISSION | GENERAL | + | API-PERMISSION | SPOT | | API-RATE-LIMIT-POOL | SPOT | - | API-RATE-LIMIT | 3 | + | API-RATE-LIMIT | 2 | +---------------------+---------+ """ pass @abstractmethod @deprecated('') - def add_stop_order(self, req: AddStopOrderReq, - **kwargs: Any) -> AddStopOrderResp: + def batch_add_orders_old(self, req: BatchAddOrdersOldReq, + **kwargs: Any) -> BatchAddOrdersOldResp: """ - summary: Add Stop Order - description: Place stop order to the Spot trading system, you can place two major types of orders: limit and market. Orders can only be placed if your account has sufficient funds. Once an order is placed, your funds will be put on hold for the duration of the order. The amount of funds on hold depends on the order type and parameters specified. - documentation: https://www.kucoin.com/docs-new/api-3470334 + summary: Batch Add Orders - Old + description: Request via this endpoint to place 5 orders at the same time. The order type must be a limit order of the same symbol. + documentation: https://www.kucoin.com/docs-new/api-3470342 +---------------------+---------+ | Extra API Info | Value | +---------------------+---------+ @@ -858,25 +858,26 @@ def add_stop_order(self, req: AddStopOrderReq, | API-CHANNEL | PRIVATE | | API-PERMISSION | SPOT | | API-RATE-LIMIT-POOL | SPOT | - | API-RATE-LIMIT | 1 | + | API-RATE-LIMIT | 3 | +---------------------+---------+ """ pass @abstractmethod - def get_stop_order_by_client_oid( - self, req: GetStopOrderByClientOidReq, - **kwargs: Any) -> GetStopOrderByClientOidResp: + @deprecated('') + def cancel_order_by_order_id_old( + self, req: CancelOrderByOrderIdOldReq, + **kwargs: Any) -> CancelOrderByOrderIdOldResp: """ - summary: Get Stop Order By ClientOid - description: This interface is to obtain Spot stop order details by orderId - documentation: https://www.kucoin.com/docs-new/api-3470340 + summary: Cancel Order By OrderId - Old + description: This endpoint can be used to cancel a spot order by orderId. This endpoint only sends cancellation requests. The results of the requests must be obtained by checking the order status or subscribing to websocket. + documentation: https://www.kucoin.com/docs-new/api-3470343 +---------------------+---------+ | Extra API Info | Value | +---------------------+---------+ | API-DOMAIN | SPOT | | API-CHANNEL | PRIVATE | - | API-PERMISSION | GENERAL | + | API-PERMISSION | SPOT | | API-RATE-LIMIT-POOL | SPOT | | API-RATE-LIMIT | 3 | +---------------------+---------+ @@ -884,14 +885,13 @@ def get_stop_order_by_client_oid( pass @abstractmethod - @deprecated('') - def cancel_oco_order_by_client_oid( - self, req: CancelOcoOrderByClientOidReq, - **kwargs: Any) -> CancelOcoOrderByClientOidResp: - """ - summary: Cancel OCO Order By ClientOid - description: Request via this interface to cancel a stop order via the clientOid. You will receive cancelledOrderIds field once the system has received the cancellation request. The cancellation request will be processed by the matching engine in sequence. To know if the request is processed (successfully or not), you may check the order status or the update message from the pushes. - documentation: https://www.kucoin.com/docs-new/api-3470355 + def cancel_order_by_client_oid_old( + self, req: CancelOrderByClientOidOldReq, + **kwargs: Any) -> CancelOrderByClientOidOldResp: + """ + summary: Cancel Order By ClientOid - Old + description: This endpoint can be used to cancel a spot order by clientOid. This endpoint only sends cancellation requests. The results of the requests must be obtained by checking the order status or subscribing to websocket. + documentation: https://www.kucoin.com/docs-new/api-3470344 +---------------------+---------+ | Extra API Info | Value | +---------------------+---------+ @@ -906,34 +906,32 @@ def cancel_oco_order_by_client_oid( @abstractmethod @deprecated('') - def get_oco_order_by_client_oid( - self, req: GetOcoOrderByClientOidReq, - **kwargs: Any) -> GetOcoOrderByClientOidResp: + def batch_cancel_order_old(self, req: BatchCancelOrderOldReq, + **kwargs: Any) -> BatchCancelOrderOldResp: """ - summary: Get OCO Order By ClientOid - description: Request via this interface to get a oco order information via the client order ID. - documentation: https://www.kucoin.com/docs-new/api-3470358 + summary: Batch Cancel Order - Old + description: Request via this endpoint to cancel all open orders. The response is a list of ids of the canceled orders. + documentation: https://www.kucoin.com/docs-new/api-3470345 +---------------------+---------+ | Extra API Info | Value | +---------------------+---------+ | API-DOMAIN | SPOT | | API-CHANNEL | PRIVATE | - | API-PERMISSION | GENERAL | + | API-PERMISSION | SPOT | | API-RATE-LIMIT-POOL | SPOT | - | API-RATE-LIMIT | 2 | + | API-RATE-LIMIT | 20 | +---------------------+---------+ """ pass @abstractmethod @deprecated('') - def get_oco_order_detail_by_order_id( - self, req: GetOcoOrderDetailByOrderIdReq, - **kwargs: Any) -> GetOcoOrderDetailByOrderIdResp: + def get_orders_list_old(self, req: GetOrdersListOldReq, + **kwargs: Any) -> GetOrdersListOldResp: """ - summary: Get OCO Order Detail By OrderId - description: Request via this interface to get a oco order detail via the order ID. - documentation: https://www.kucoin.com/docs-new/api-3470359 + summary: Get Orders List - Old + description: Request via this endpoint to get your current order list. The return value is the data after Pagination, sorted in descending order according to time. + documentation: https://www.kucoin.com/docs-new/api-3470346 +---------------------+---------+ | Extra API Info | Value | +---------------------+---------+ @@ -948,19 +946,19 @@ def get_oco_order_detail_by_order_id( @abstractmethod @deprecated('') - def cancel_oco_order_by_order_id( - self, req: CancelOcoOrderByOrderIdReq, - **kwargs: Any) -> CancelOcoOrderByOrderIdResp: + def get_recent_orders_list_old( + self, req: GetRecentOrdersListOldReq, + **kwargs: Any) -> GetRecentOrdersListOldResp: """ - summary: Cancel OCO Order By OrderId - description: This endpoint can be used to cancel a spot order by orderId. This endpoint only sends cancellation requests. The results of the requests must be obtained by checking the order status or subscribing to websocket. - documentation: https://www.kucoin.com/docs-new/api-3470354 + summary: Get Recent Orders List - Old + description: Request via this endpoint to get your current order list. The return value is the data after Pagination, sorted in descending order according to time. + documentation: https://www.kucoin.com/docs-new/api-3470347 +---------------------+---------+ | Extra API Info | Value | +---------------------+---------+ | API-DOMAIN | SPOT | | API-CHANNEL | PRIVATE | - | API-PERMISSION | SPOT | + | API-PERMISSION | GENERAL | | API-RATE-LIMIT-POOL | SPOT | | API-RATE-LIMIT | 3 | +---------------------+---------+ @@ -969,12 +967,12 @@ def cancel_oco_order_by_order_id( @abstractmethod @deprecated('') - def get_oco_order_by_order_id(self, req: GetOcoOrderByOrderIdReq, - **kwargs: Any) -> GetOcoOrderByOrderIdResp: + def get_order_by_order_id_old(self, req: GetOrderByOrderIdOldReq, + **kwargs: Any) -> GetOrderByOrderIdOldResp: """ - summary: Get OCO Order By OrderId - description: Request via this interface to get a oco order information via the order ID. - documentation: https://www.kucoin.com/docs-new/api-3470357 + summary: Get Order By OrderId - Old + description: Request via this endpoint to get a single order info by order ID. + documentation: https://www.kucoin.com/docs-new/api-3470348 +---------------------+---------+ | Extra API Info | Value | +---------------------+---------+ @@ -989,52 +987,54 @@ def get_oco_order_by_order_id(self, req: GetOcoOrderByOrderIdReq, @abstractmethod @deprecated('') - def add_oco_order(self, req: AddOcoOrderReq, - **kwargs: Any) -> AddOcoOrderResp: + def get_order_by_client_oid_old( + self, req: GetOrderByClientOidOldReq, + **kwargs: Any) -> GetOrderByClientOidOldResp: """ - summary: Add OCO Order - description: Place OCO order to the Spot trading system - documentation: https://www.kucoin.com/docs-new/api-3470353 + summary: Get Order By ClientOid - Old + description: Request via this interface to check the information of a single active order via clientOid. The system will prompt that the order does not exists if the order does not exist or has been settled. + documentation: https://www.kucoin.com/docs-new/api-3470349 +---------------------+---------+ | Extra API Info | Value | +---------------------+---------+ | API-DOMAIN | SPOT | | API-CHANNEL | PRIVATE | - | API-PERMISSION | SPOT | + | API-PERMISSION | GENERAL | | API-RATE-LIMIT-POOL | SPOT | - | API-RATE-LIMIT | 2 | + | API-RATE-LIMIT | 3 | +---------------------+---------+ """ pass @abstractmethod @deprecated('') - def batch_cancel_oco_orders(self, req: BatchCancelOcoOrdersReq, - **kwargs: Any) -> BatchCancelOcoOrdersResp: + def get_trade_history_old(self, req: GetTradeHistoryOldReq, + **kwargs: Any) -> GetTradeHistoryOldResp: """ - summary: Batch Cancel OCO Order - description: This interface can batch cancel OCO orders through orderIds. You will receive cancelledOrderIds field once the system has received the cancellation request. The cancellation request will be processed by the matching engine in sequence. To know if the request is processed (successfully or not), you may check the order status or the update message from the pushes. - documentation: https://www.kucoin.com/docs-new/api-3470356 + summary: Get Trade History - Old + description: Request via this endpoint to get the recent fills. The return value is the data after Pagination, sorted in descending order according to time. + documentation: https://www.kucoin.com/docs-new/api-3470350 +---------------------+---------+ | Extra API Info | Value | +---------------------+---------+ | API-DOMAIN | SPOT | | API-CHANNEL | PRIVATE | - | API-PERMISSION | SPOT | + | API-PERMISSION | GENERAL | | API-RATE-LIMIT-POOL | SPOT | - | API-RATE-LIMIT | 3 | + | API-RATE-LIMIT | 10 | +---------------------+---------+ """ pass @abstractmethod @deprecated('') - def get_oco_order_list(self, req: GetOcoOrderListReq, - **kwargs: Any) -> GetOcoOrderListResp: + def get_recent_trade_history_old( + self, req: GetRecentTradeHistoryOldReq, + **kwargs: Any) -> GetRecentTradeHistoryOldResp: """ - summary: Get OCO Order List - description: Request via this endpoint to get your current OCO order list. Items are paginated and sorted to show the latest first. See the Pagination section for retrieving additional entries after the first page. - documentation: https://www.kucoin.com/docs-new/api-3470360 + summary: Get Recent Trade History - Old + description: Request via this endpoint to get a list of 1000 fills in the last 24 hours. The return value is the data after Pagination, sorted in descending order according to time. + documentation: https://www.kucoin.com/docs-new/api-3470351 +---------------------+---------+ | Extra API Info | Value | +---------------------+---------+ @@ -1042,7 +1042,7 @@ def get_oco_order_list(self, req: GetOcoOrderListReq, | API-CHANNEL | PRIVATE | | API-PERMISSION | GENERAL | | API-RATE-LIMIT-POOL | SPOT | - | API-RATE-LIMIT | 2 | + | API-RATE-LIMIT | 20 | +---------------------+---------+ """ pass @@ -1053,83 +1053,21 @@ class OrderAPIImpl(OrderAPI): def __init__(self, transport: Transport): self.transport = transport - def get_trade_history_old(self, req: GetTradeHistoryOldReq, - **kwargs: Any) -> GetTradeHistoryOldResp: - return self.transport.call("spot", False, "GET", "/api/v1/fills", req, - GetTradeHistoryOldResp(), False, **kwargs) - - def get_trade_history(self, req: GetTradeHistoryReq, - **kwargs: Any) -> GetTradeHistoryResp: - return self.transport.call("spot", False, "GET", "/api/v1/hf/fills", - req, GetTradeHistoryResp(), False, **kwargs) - - def get_open_orders(self, req: GetOpenOrdersReq, - **kwargs: Any) -> GetOpenOrdersResp: - return self.transport.call("spot", False, "GET", - "/api/v1/hf/orders/active", req, - GetOpenOrdersResp(), False, **kwargs) - - def get_symbols_with_open_order( - self, **kwargs: Any) -> GetSymbolsWithOpenOrderResp: - return self.transport.call("spot", False, "GET", - "/api/v1/hf/orders/active/symbols", None, - GetSymbolsWithOpenOrderResp(), False, - **kwargs) + def add_order(self, req: AddOrderReq, **kwargs: Any) -> AddOrderResp: + return self.transport.call("spot", False, "POST", "/api/v1/hf/orders", + req, AddOrderResp(), False, **kwargs) - def modify_order(self, req: ModifyOrderReq, - **kwargs: Any) -> ModifyOrderResp: + def add_order_sync(self, req: AddOrderSyncReq, + **kwargs: Any) -> AddOrderSyncResp: return self.transport.call("spot", False, "POST", - "/api/v1/hf/orders/alter", req, - ModifyOrderResp(), False, **kwargs) - - def cancel_all_orders(self, **kwargs: Any) -> CancelAllOrdersResp: - return self.transport.call("spot", False, "DELETE", - "/api/v1/hf/orders/cancelAll", None, - CancelAllOrdersResp(), False, **kwargs) - - def cancel_partial_order(self, req: CancelPartialOrderReq, - **kwargs: Any) -> CancelPartialOrderResp: - return self.transport.call("spot", False, "DELETE", - "/api/v1/hf/orders/cancel/{orderId}", req, - CancelPartialOrderResp(), False, **kwargs) - - def cancel_order_by_client_oid( - self, req: CancelOrderByClientOidReq, - **kwargs: Any) -> CancelOrderByClientOidResp: - return self.transport.call( - "spot", False, "DELETE", - "/api/v1/hf/orders/client-order/{clientOid}", req, - CancelOrderByClientOidResp(), False, **kwargs) - - def get_order_by_client_oid(self, req: GetOrderByClientOidReq, - **kwargs: Any) -> GetOrderByClientOidResp: - return self.transport.call( - "spot", False, "GET", "/api/v1/hf/orders/client-order/{clientOid}", - req, GetOrderByClientOidResp(), False, **kwargs) + "/api/v1/hf/orders/sync", req, + AddOrderSyncResp(), False, **kwargs) - def set_dcp(self, req: SetDcpReq, **kwargs: Any) -> SetDcpResp: + def add_order_test(self, req: AddOrderTestReq, + **kwargs: Any) -> AddOrderTestResp: return self.transport.call("spot", False, "POST", - "/api/v1/hf/orders/dead-cancel-all", req, - SetDcpResp(), False, **kwargs) - - def get_dcp(self, **kwargs: Any) -> GetDcpResp: - return self.transport.call("spot", False, "GET", - "/api/v1/hf/orders/dead-cancel-all/query", - None, GetDcpResp(), False, **kwargs) - - def cancel_all_orders_by_symbol( - self, req: CancelAllOrdersBySymbolReq, - **kwargs: Any) -> CancelAllOrdersBySymbolResp: - return self.transport.call("spot", False, "DELETE", - "/api/v1/hf/orders", req, - CancelAllOrdersBySymbolResp(), False, - **kwargs) - - def get_closed_orders(self, req: GetClosedOrdersReq, - **kwargs: Any) -> GetClosedOrdersResp: - return self.transport.call("spot", False, "GET", - "/api/v1/hf/orders/done", req, - GetClosedOrdersResp(), False, **kwargs) + "/api/v1/hf/orders/test", req, + AddOrderTestResp(), False, **kwargs) def batch_add_orders(self, req: BatchAddOrdersReq, **kwargs: Any) -> BatchAddOrdersResp: @@ -1149,15 +1087,21 @@ def cancel_order_by_order_id(self, req: CancelOrderByOrderIdReq, "/api/v1/hf/orders/{orderId}", req, CancelOrderByOrderIdResp(), False, **kwargs) - def get_order_by_order_id(self, req: GetOrderByOrderIdReq, - **kwargs: Any) -> GetOrderByOrderIdResp: - return self.transport.call("spot", False, "GET", - "/api/v1/hf/orders/{orderId}", req, - GetOrderByOrderIdResp(), False, **kwargs) + def cancel_order_by_order_id_sync( + self, req: CancelOrderByOrderIdSyncReq, + **kwargs: Any) -> CancelOrderByOrderIdSyncResp: + return self.transport.call("spot", False, "DELETE", + "/api/v1/hf/orders/sync/{orderId}", req, + CancelOrderByOrderIdSyncResp(), False, + **kwargs) - def add_order(self, req: AddOrderReq, **kwargs: Any) -> AddOrderResp: - return self.transport.call("spot", False, "POST", "/api/v1/hf/orders", - req, AddOrderResp(), False, **kwargs) + def cancel_order_by_client_oid( + self, req: CancelOrderByClientOidReq, + **kwargs: Any) -> CancelOrderByClientOidResp: + return self.transport.call( + "spot", False, "DELETE", + "/api/v1/hf/orders/client-order/{clientOid}", req, + CancelOrderByClientOidResp(), False, **kwargs) def cancel_order_by_client_oid_sync( self, req: CancelOrderByClientOidSyncReq, @@ -1167,104 +1111,81 @@ def cancel_order_by_client_oid_sync( "/api/v1/hf/orders/sync/client-order/{clientOid}", req, CancelOrderByClientOidSyncResp(), False, **kwargs) - def cancel_order_by_order_id_sync( - self, req: CancelOrderByOrderIdSyncReq, - **kwargs: Any) -> CancelOrderByOrderIdSyncResp: + def cancel_partial_order(self, req: CancelPartialOrderReq, + **kwargs: Any) -> CancelPartialOrderResp: return self.transport.call("spot", False, "DELETE", - "/api/v1/hf/orders/sync/{orderId}", req, - CancelOrderByOrderIdSyncResp(), False, + "/api/v1/hf/orders/cancel/{orderId}", req, + CancelPartialOrderResp(), False, **kwargs) + + def cancel_all_orders_by_symbol( + self, req: CancelAllOrdersBySymbolReq, + **kwargs: Any) -> CancelAllOrdersBySymbolResp: + return self.transport.call("spot", False, "DELETE", + "/api/v1/hf/orders", req, + CancelAllOrdersBySymbolResp(), False, **kwargs) - def add_order_sync(self, req: AddOrderSyncReq, - **kwargs: Any) -> AddOrderSyncResp: - return self.transport.call("spot", False, "POST", - "/api/v1/hf/orders/sync", req, - AddOrderSyncResp(), False, **kwargs) + def cancel_all_orders(self, **kwargs: Any) -> CancelAllOrdersResp: + return self.transport.call("spot", False, "DELETE", + "/api/v1/hf/orders/cancelAll", None, + CancelAllOrdersResp(), False, **kwargs) - def add_order_test(self, req: AddOrderTestReq, - **kwargs: Any) -> AddOrderTestResp: + def modify_order(self, req: ModifyOrderReq, + **kwargs: Any) -> ModifyOrderResp: return self.transport.call("spot", False, "POST", - "/api/v1/hf/orders/test", req, - AddOrderTestResp(), False, **kwargs) - - def get_recent_trade_history_old( - self, req: GetRecentTradeHistoryOldReq, - **kwargs: Any) -> GetRecentTradeHistoryOldResp: - return self.transport.call("spot", False, "GET", "/api/v1/limit/fills", - req, GetRecentTradeHistoryOldResp(), False, - **kwargs) + "/api/v1/hf/orders/alter", req, + ModifyOrderResp(), False, **kwargs) - def get_recent_orders_list_old( - self, req: GetRecentOrdersListOldReq, - **kwargs: Any) -> GetRecentOrdersListOldResp: + def get_order_by_order_id(self, req: GetOrderByOrderIdReq, + **kwargs: Any) -> GetOrderByOrderIdResp: return self.transport.call("spot", False, "GET", - "/api/v1/limit/orders", req, - GetRecentOrdersListOldResp(), False, - **kwargs) + "/api/v1/hf/orders/{orderId}", req, + GetOrderByOrderIdResp(), False, **kwargs) - def cancel_order_by_client_oid_old( - self, req: CancelOrderByClientOidOldReq, - **kwargs: Any) -> CancelOrderByClientOidOldResp: - return self.transport.call("spot", False, "DELETE", - "/api/v1/order/client-order/{clientOid}", - req, CancelOrderByClientOidOldResp(), False, - **kwargs) + def get_order_by_client_oid(self, req: GetOrderByClientOidReq, + **kwargs: Any) -> GetOrderByClientOidResp: + return self.transport.call( + "spot", False, "GET", "/api/v1/hf/orders/client-order/{clientOid}", + req, GetOrderByClientOidResp(), False, **kwargs) - def get_order_by_client_oid_old( - self, req: GetOrderByClientOidOldReq, - **kwargs: Any) -> GetOrderByClientOidOldResp: + def get_symbols_with_open_order( + self, **kwargs: Any) -> GetSymbolsWithOpenOrderResp: return self.transport.call("spot", False, "GET", - "/api/v1/order/client-order/{clientOid}", - req, GetOrderByClientOidOldResp(), False, + "/api/v1/hf/orders/active/symbols", None, + GetSymbolsWithOpenOrderResp(), False, **kwargs) - def batch_cancel_order_old(self, req: BatchCancelOrderOldReq, - **kwargs: Any) -> BatchCancelOrderOldResp: - return self.transport.call("spot", False, "DELETE", - "/api/v1/orders", req, - BatchCancelOrderOldResp(), False, **kwargs) - - def get_orders_list_old(self, req: GetOrdersListOldReq, - **kwargs: Any) -> GetOrdersListOldResp: - return self.transport.call("spot", False, "GET", "/api/v1/orders", req, - GetOrdersListOldResp(), False, **kwargs) + def get_open_orders(self, req: GetOpenOrdersReq, + **kwargs: Any) -> GetOpenOrdersResp: + return self.transport.call("spot", False, "GET", + "/api/v1/hf/orders/active", req, + GetOpenOrdersResp(), False, **kwargs) - def batch_add_orders_old(self, req: BatchAddOrdersOldReq, - **kwargs: Any) -> BatchAddOrdersOldResp: - return self.transport.call("spot", False, "POST", - "/api/v1/orders/multi", req, - BatchAddOrdersOldResp(), False, **kwargs) + def get_closed_orders(self, req: GetClosedOrdersReq, + **kwargs: Any) -> GetClosedOrdersResp: + return self.transport.call("spot", False, "GET", + "/api/v1/hf/orders/done", req, + GetClosedOrdersResp(), False, **kwargs) - def cancel_order_by_order_id_old( - self, req: CancelOrderByOrderIdOldReq, - **kwargs: Any) -> CancelOrderByOrderIdOldResp: - return self.transport.call("spot", False, "DELETE", - "/api/v1/orders/{orderId}", req, - CancelOrderByOrderIdOldResp(), False, - **kwargs) + def get_trade_history(self, req: GetTradeHistoryReq, + **kwargs: Any) -> GetTradeHistoryResp: + return self.transport.call("spot", False, "GET", "/api/v1/hf/fills", + req, GetTradeHistoryResp(), False, **kwargs) - def get_order_by_order_id_old(self, req: GetOrderByOrderIdOldReq, - **kwargs: Any) -> GetOrderByOrderIdOldResp: + def get_dcp(self, **kwargs: Any) -> GetDcpResp: return self.transport.call("spot", False, "GET", - "/api/v1/orders/{orderId}", req, - GetOrderByOrderIdOldResp(), False, **kwargs) - - def add_order_old(self, req: AddOrderOldReq, - **kwargs: Any) -> AddOrderOldResp: - return self.transport.call("spot", False, "POST", "/api/v1/orders", - req, AddOrderOldResp(), False, **kwargs) + "/api/v1/hf/orders/dead-cancel-all/query", + None, GetDcpResp(), False, **kwargs) - def add_order_test_old(self, req: AddOrderTestOldReq, - **kwargs: Any) -> AddOrderTestOldResp: + def set_dcp(self, req: SetDcpReq, **kwargs: Any) -> SetDcpResp: return self.transport.call("spot", False, "POST", - "/api/v1/orders/test", req, - AddOrderTestOldResp(), False, **kwargs) + "/api/v1/hf/orders/dead-cancel-all", req, + SetDcpResp(), False, **kwargs) - def batch_cancel_stop_order(self, req: BatchCancelStopOrderReq, - **kwargs: Any) -> BatchCancelStopOrderResp: - return self.transport.call("spot", False, "DELETE", - "/api/v1/stop-order/cancel", req, - BatchCancelStopOrderResp(), False, **kwargs) + def add_stop_order(self, req: AddStopOrderReq, + **kwargs: Any) -> AddStopOrderResp: + return self.transport.call("spot", False, "POST", "/api/v1/stop-order", + req, AddStopOrderResp(), False, **kwargs) def cancel_stop_order_by_client_oid( self, req: CancelStopOrderByClientOidReq, @@ -1274,12 +1195,6 @@ def cancel_stop_order_by_client_oid( "/api/v1/stop-order/cancelOrderByClientOid", req, CancelStopOrderByClientOidResp(), False, **kwargs) - def get_stop_orders_list(self, req: GetStopOrdersListReq, - **kwargs: Any) -> GetStopOrdersListResp: - return self.transport.call("spot", False, "GET", - "/api/v1/stop-order", req, - GetStopOrdersListResp(), True, **kwargs) - def cancel_stop_order_by_order_id( self, req: CancelStopOrderByOrderIdReq, **kwargs: Any) -> CancelStopOrderByOrderIdResp: @@ -1288,6 +1203,18 @@ def cancel_stop_order_by_order_id( CancelStopOrderByOrderIdResp(), False, **kwargs) + def batch_cancel_stop_order(self, req: BatchCancelStopOrderReq, + **kwargs: Any) -> BatchCancelStopOrderResp: + return self.transport.call("spot", False, "DELETE", + "/api/v1/stop-order/cancel", req, + BatchCancelStopOrderResp(), False, **kwargs) + + def get_stop_orders_list(self, req: GetStopOrdersListReq, + **kwargs: Any) -> GetStopOrdersListResp: + return self.transport.call("spot", False, "GET", + "/api/v1/stop-order", req, + GetStopOrdersListResp(), True, **kwargs) + def get_stop_order_by_order_id(self, req: GetStopOrderByOrderIdReq, **kwargs: Any) -> GetStopOrderByOrderIdResp: return self.transport.call("spot", False, "GET", @@ -1295,11 +1222,6 @@ def get_stop_order_by_order_id(self, req: GetStopOrderByOrderIdReq, GetStopOrderByOrderIdResp(), False, **kwargs) - def add_stop_order(self, req: AddStopOrderReq, - **kwargs: Any) -> AddStopOrderResp: - return self.transport.call("spot", False, "POST", "/api/v1/stop-order", - req, AddStopOrderResp(), False, **kwargs) - def get_stop_order_by_client_oid( self, req: GetStopOrderByClientOidReq, **kwargs: Any) -> GetStopOrderByClientOidResp: @@ -1308,6 +1230,19 @@ def get_stop_order_by_client_oid( req, GetStopOrderByClientOidResp(), False, **kwargs) + def add_oco_order(self, req: AddOcoOrderReq, + **kwargs: Any) -> AddOcoOrderResp: + return self.transport.call("spot", False, "POST", "/api/v3/oco/order", + req, AddOcoOrderResp(), False, **kwargs) + + def cancel_oco_order_by_order_id( + self, req: CancelOcoOrderByOrderIdReq, + **kwargs: Any) -> CancelOcoOrderByOrderIdResp: + return self.transport.call("spot", False, "DELETE", + "/api/v3/oco/order/{orderId}", req, + CancelOcoOrderByOrderIdResp(), False, + **kwargs) + def cancel_oco_order_by_client_oid( self, req: CancelOcoOrderByClientOidReq, **kwargs: Any) -> CancelOcoOrderByClientOidResp: @@ -1316,6 +1251,18 @@ def cancel_oco_order_by_client_oid( CancelOcoOrderByClientOidResp(), False, **kwargs) + def batch_cancel_oco_orders(self, req: BatchCancelOcoOrdersReq, + **kwargs: Any) -> BatchCancelOcoOrdersResp: + return self.transport.call("spot", False, "DELETE", + "/api/v3/oco/orders", req, + BatchCancelOcoOrdersResp(), False, **kwargs) + + def get_oco_order_by_order_id(self, req: GetOcoOrderByOrderIdReq, + **kwargs: Any) -> GetOcoOrderByOrderIdResp: + return self.transport.call("spot", False, "GET", + "/api/v3/oco/order/{orderId}", req, + GetOcoOrderByOrderIdResp(), False, **kwargs) + def get_oco_order_by_client_oid( self, req: GetOcoOrderByClientOidReq, **kwargs: Any) -> GetOcoOrderByClientOidResp: @@ -1332,32 +1279,85 @@ def get_oco_order_detail_by_order_id( GetOcoOrderDetailByOrderIdResp(), False, **kwargs) - def cancel_oco_order_by_order_id( - self, req: CancelOcoOrderByOrderIdReq, - **kwargs: Any) -> CancelOcoOrderByOrderIdResp: + def get_oco_order_list(self, req: GetOcoOrderListReq, + **kwargs: Any) -> GetOcoOrderListResp: + return self.transport.call("spot", False, "GET", "/api/v3/oco/orders", + req, GetOcoOrderListResp(), False, **kwargs) + + def add_order_old(self, req: AddOrderOldReq, + **kwargs: Any) -> AddOrderOldResp: + return self.transport.call("spot", False, "POST", "/api/v1/orders", + req, AddOrderOldResp(), False, **kwargs) + + def add_order_test_old(self, req: AddOrderTestOldReq, + **kwargs: Any) -> AddOrderTestOldResp: + return self.transport.call("spot", False, "POST", + "/api/v1/orders/test", req, + AddOrderTestOldResp(), False, **kwargs) + + def batch_add_orders_old(self, req: BatchAddOrdersOldReq, + **kwargs: Any) -> BatchAddOrdersOldResp: + return self.transport.call("spot", False, "POST", + "/api/v1/orders/multi", req, + BatchAddOrdersOldResp(), False, **kwargs) + + def cancel_order_by_order_id_old( + self, req: CancelOrderByOrderIdOldReq, + **kwargs: Any) -> CancelOrderByOrderIdOldResp: return self.transport.call("spot", False, "DELETE", - "/api/v3/oco/order/{orderId}", req, - CancelOcoOrderByOrderIdResp(), False, + "/api/v1/orders/{orderId}", req, + CancelOrderByOrderIdOldResp(), False, **kwargs) - def get_oco_order_by_order_id(self, req: GetOcoOrderByOrderIdReq, - **kwargs: Any) -> GetOcoOrderByOrderIdResp: + def cancel_order_by_client_oid_old( + self, req: CancelOrderByClientOidOldReq, + **kwargs: Any) -> CancelOrderByClientOidOldResp: + return self.transport.call("spot", False, "DELETE", + "/api/v1/order/client-order/{clientOid}", + req, CancelOrderByClientOidOldResp(), False, + **kwargs) + + def batch_cancel_order_old(self, req: BatchCancelOrderOldReq, + **kwargs: Any) -> BatchCancelOrderOldResp: + return self.transport.call("spot", False, "DELETE", + "/api/v1/orders", req, + BatchCancelOrderOldResp(), False, **kwargs) + + def get_orders_list_old(self, req: GetOrdersListOldReq, + **kwargs: Any) -> GetOrdersListOldResp: + return self.transport.call("spot", False, "GET", "/api/v1/orders", req, + GetOrdersListOldResp(), False, **kwargs) + + def get_recent_orders_list_old( + self, req: GetRecentOrdersListOldReq, + **kwargs: Any) -> GetRecentOrdersListOldResp: return self.transport.call("spot", False, "GET", - "/api/v3/oco/order/{orderId}", req, - GetOcoOrderByOrderIdResp(), False, **kwargs) + "/api/v1/limit/orders", req, + GetRecentOrdersListOldResp(), False, + **kwargs) - def add_oco_order(self, req: AddOcoOrderReq, - **kwargs: Any) -> AddOcoOrderResp: - return self.transport.call("spot", False, "POST", "/api/v3/oco/order", - req, AddOcoOrderResp(), False, **kwargs) + def get_order_by_order_id_old(self, req: GetOrderByOrderIdOldReq, + **kwargs: Any) -> GetOrderByOrderIdOldResp: + return self.transport.call("spot", False, "GET", + "/api/v1/orders/{orderId}", req, + GetOrderByOrderIdOldResp(), False, **kwargs) - def batch_cancel_oco_orders(self, req: BatchCancelOcoOrdersReq, - **kwargs: Any) -> BatchCancelOcoOrdersResp: - return self.transport.call("spot", False, "DELETE", - "/api/v3/oco/orders", req, - BatchCancelOcoOrdersResp(), False, **kwargs) + def get_order_by_client_oid_old( + self, req: GetOrderByClientOidOldReq, + **kwargs: Any) -> GetOrderByClientOidOldResp: + return self.transport.call("spot", False, "GET", + "/api/v1/order/client-order/{clientOid}", + req, GetOrderByClientOidOldResp(), False, + **kwargs) - def get_oco_order_list(self, req: GetOcoOrderListReq, - **kwargs: Any) -> GetOcoOrderListResp: - return self.transport.call("spot", False, "GET", "/api/v3/oco/orders", - req, GetOcoOrderListResp(), False, **kwargs) + def get_trade_history_old(self, req: GetTradeHistoryOldReq, + **kwargs: Any) -> GetTradeHistoryOldResp: + return self.transport.call("spot", False, "GET", "/api/v1/fills", req, + GetTradeHistoryOldResp(), False, **kwargs) + + def get_recent_trade_history_old( + self, req: GetRecentTradeHistoryOldReq, + **kwargs: Any) -> GetRecentTradeHistoryOldResp: + return self.transport.call("spot", False, "GET", "/api/v1/limit/fills", + req, GetRecentTradeHistoryOldResp(), False, + **kwargs) diff --git a/sdk/python/kucoin_universal_sdk/generate/spot/order/api_order.template b/sdk/python/kucoin_universal_sdk/generate/spot/order/api_order.template index b69fc7ab..d4150bd4 100644 --- a/sdk/python/kucoin_universal_sdk/generate/spot/order/api_order.template +++ b/sdk/python/kucoin_universal_sdk/generate/spot/order/api_order.template @@ -1,18 +1,18 @@ # API FUNCTION TEMPLATE -def test_get_trade_history_old_req(self): +def test_add_order_req(self): """ - get_trade_history_old - Get Trade History - Old - /api/v1/fills + add_order + Add Order + /api/v1/hf/orders """ - builder = GetTradeHistoryOldReqBuilder() - builder.set_symbol(?).set_order_id(?).set_side(?).set_type(?).set_trade_type(?).set_start_at(?).set_end_at(?).set_current_page(?).set_page_size(?) + builder = AddOrderReqBuilder() + builder.set_client_oid(?).set_side(?).set_symbol(?).set_type(?).set_remark(?).set_stp(?).set_price(?).set_size(?).set_time_in_force(?).set_post_only(?).set_hidden(?).set_iceberg(?).set_visible_size(?).set_tags(?).set_cancel_after(?).set_funds(?) req = builder.build() try: - resp = self.api.get_trade_history_old(req) + resp = self.api.add_order(req) print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) @@ -20,18 +20,18 @@ def test_get_trade_history_old_req(self): print("error: ", e) raise e -def test_get_trade_history_req(self): +def test_add_order_sync_req(self): """ - get_trade_history - Get Trade History - /api/v1/hf/fills + add_order_sync + Add Order Sync + /api/v1/hf/orders/sync """ - builder = GetTradeHistoryReqBuilder() - builder.set_symbol(?).set_order_id(?).set_side(?).set_type(?).set_last_id(?).set_limit(?).set_start_at(?).set_end_at(?) + builder = AddOrderSyncReqBuilder() + builder.set_client_oid(?).set_side(?).set_symbol(?).set_type(?).set_remark(?).set_stp(?).set_price(?).set_size(?).set_time_in_force(?).set_post_only(?).set_hidden(?).set_iceberg(?).set_visible_size(?).set_tags(?).set_cancel_after(?).set_funds(?) req = builder.build() try: - resp = self.api.get_trade_history(req) + resp = self.api.add_order_sync(req) print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) @@ -39,18 +39,18 @@ def test_get_trade_history_req(self): print("error: ", e) raise e -def test_get_open_orders_req(self): +def test_add_order_test_req(self): """ - get_open_orders - Get Open Orders - /api/v1/hf/orders/active + add_order_test + Add Order Test + /api/v1/hf/orders/test """ - builder = GetOpenOrdersReqBuilder() - builder.set_symbol(?) + builder = AddOrderTestReqBuilder() + builder.set_client_oid(?).set_side(?).set_symbol(?).set_type(?).set_remark(?).set_stp(?).set_price(?).set_size(?).set_time_in_force(?).set_post_only(?).set_hidden(?).set_iceberg(?).set_visible_size(?).set_tags(?).set_cancel_after(?).set_funds(?) req = builder.build() try: - resp = self.api.get_open_orders(req) + resp = self.api.add_order_test(req) print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) @@ -58,15 +58,18 @@ def test_get_open_orders_req(self): print("error: ", e) raise e -def test_get_symbols_with_open_order_req(self): +def test_batch_add_orders_req(self): """ - get_symbols_with_open_order - Get Symbols With Open Order - /api/v1/hf/orders/active/symbols + batch_add_orders + Batch Add Orders + /api/v1/hf/orders/multi """ + builder = BatchAddOrdersReqBuilder() + builder.set_order_list(?) + req = builder.build() try: - resp = self.api.get_symbols_with_open_order() + resp = self.api.batch_add_orders(req) print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) @@ -74,18 +77,18 @@ def test_get_symbols_with_open_order_req(self): print("error: ", e) raise e -def test_modify_order_req(self): +def test_batch_add_orders_sync_req(self): """ - modify_order - Modify Order - /api/v1/hf/orders/alter + batch_add_orders_sync + Batch Add Orders Sync + /api/v1/hf/orders/multi/sync """ - builder = ModifyOrderReqBuilder() - builder.set_client_oid(?).set_symbol(?).set_order_id(?).set_new_price(?).set_new_size(?) + builder = BatchAddOrdersSyncReqBuilder() + builder.set_order_list(?) req = builder.build() try: - resp = self.api.modify_order(req) + resp = self.api.batch_add_orders_sync(req) print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) @@ -93,15 +96,18 @@ def test_modify_order_req(self): print("error: ", e) raise e -def test_cancel_all_orders_req(self): +def test_cancel_order_by_order_id_req(self): """ - cancel_all_orders - Cancel All Orders - /api/v1/hf/orders/cancelAll + cancel_order_by_order_id + Cancel Order By OrderId + /api/v1/hf/orders/{orderId} """ + builder = CancelOrderByOrderIdReqBuilder() + builder.set_order_id(?).set_symbol(?) + req = builder.build() try: - resp = self.api.cancel_all_orders() + resp = self.api.cancel_order_by_order_id(req) print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) @@ -109,18 +115,18 @@ def test_cancel_all_orders_req(self): print("error: ", e) raise e -def test_cancel_partial_order_req(self): +def test_cancel_order_by_order_id_sync_req(self): """ - cancel_partial_order - Cancel Partial Order - /api/v1/hf/orders/cancel/{orderId} + cancel_order_by_order_id_sync + Cancel Order By OrderId Sync + /api/v1/hf/orders/sync/{orderId} """ - builder = CancelPartialOrderReqBuilder() - builder.set_order_id(?).set_symbol(?).set_cancel_size(?) + builder = CancelOrderByOrderIdSyncReqBuilder() + builder.set_order_id(?).set_symbol(?) req = builder.build() try: - resp = self.api.cancel_partial_order(req) + resp = self.api.cancel_order_by_order_id_sync(req) print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) @@ -147,18 +153,18 @@ def test_cancel_order_by_client_oid_req(self): print("error: ", e) raise e -def test_get_order_by_client_oid_req(self): +def test_cancel_order_by_client_oid_sync_req(self): """ - get_order_by_client_oid - Get Order By ClientOid - /api/v1/hf/orders/client-order/{clientOid} + cancel_order_by_client_oid_sync + Cancel Order By ClientOid Sync + /api/v1/hf/orders/sync/client-order/{clientOid} """ - builder = GetOrderByClientOidReqBuilder() - builder.set_symbol(?).set_client_oid(?) + builder = CancelOrderByClientOidSyncReqBuilder() + builder.set_client_oid(?).set_symbol(?) req = builder.build() try: - resp = self.api.get_order_by_client_oid(req) + resp = self.api.cancel_order_by_client_oid_sync(req) print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) @@ -166,34 +172,18 @@ def test_get_order_by_client_oid_req(self): print("error: ", e) raise e -def test_set_dcp_req(self): +def test_cancel_partial_order_req(self): """ - set_dcp - Set DCP - /api/v1/hf/orders/dead-cancel-all + cancel_partial_order + Cancel Partial Order + /api/v1/hf/orders/cancel/{orderId} """ - builder = SetDcpReqBuilder() - builder.set_timeout(?).set_symbols(?) + builder = CancelPartialOrderReqBuilder() + builder.set_order_id(?).set_symbol(?).set_cancel_size(?) req = builder.build() try: - resp = self.api.set_dcp(req) - print("code: ", resp.common_response.code) - print("msg: ", resp.common_response.message) - print("data: ", resp.to_json()) - except Exception as e: - print("error: ", e) - raise e - -def test_get_dcp_req(self): - """ - get_dcp - Get DCP - /api/v1/hf/orders/dead-cancel-all/query - """ - - try: - resp = self.api.get_dcp() + resp = self.api.cancel_partial_order(req) print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) @@ -220,18 +210,15 @@ def test_cancel_all_orders_by_symbol_req(self): print("error: ", e) raise e -def test_get_closed_orders_req(self): +def test_cancel_all_orders_req(self): """ - get_closed_orders - Get Closed Orders - /api/v1/hf/orders/done + cancel_all_orders + Cancel All Orders + /api/v1/hf/orders/cancelAll """ - builder = GetClosedOrdersReqBuilder() - builder.set_symbol(?).set_side(?).set_type(?).set_last_id(?).set_limit(?).set_start_at(?).set_end_at(?) - req = builder.build() try: - resp = self.api.get_closed_orders(req) + resp = self.api.cancel_all_orders() print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) @@ -239,18 +226,18 @@ def test_get_closed_orders_req(self): print("error: ", e) raise e -def test_batch_add_orders_req(self): +def test_modify_order_req(self): """ - batch_add_orders - Batch Add Orders - /api/v1/hf/orders/multi + modify_order + Modify Order + /api/v1/hf/orders/alter """ - builder = BatchAddOrdersReqBuilder() - builder.set_order_list(?) + builder = ModifyOrderReqBuilder() + builder.set_client_oid(?).set_symbol(?).set_order_id(?).set_new_price(?).set_new_size(?) req = builder.build() try: - resp = self.api.batch_add_orders(req) + resp = self.api.modify_order(req) print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) @@ -258,18 +245,18 @@ def test_batch_add_orders_req(self): print("error: ", e) raise e -def test_batch_add_orders_sync_req(self): +def test_get_order_by_order_id_req(self): """ - batch_add_orders_sync - Batch Add Orders Sync - /api/v1/hf/orders/multi/sync + get_order_by_order_id + Get Order By OrderId + /api/v1/hf/orders/{orderId} """ - builder = BatchAddOrdersSyncReqBuilder() - builder.set_order_list(?) + builder = GetOrderByOrderIdReqBuilder() + builder.set_symbol(?).set_order_id(?) req = builder.build() try: - resp = self.api.batch_add_orders_sync(req) + resp = self.api.get_order_by_order_id(req) print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) @@ -277,18 +264,18 @@ def test_batch_add_orders_sync_req(self): print("error: ", e) raise e -def test_cancel_order_by_order_id_req(self): +def test_get_order_by_client_oid_req(self): """ - cancel_order_by_order_id - Cancel Order By OrderId - /api/v1/hf/orders/{orderId} + get_order_by_client_oid + Get Order By ClientOid + /api/v1/hf/orders/client-order/{clientOid} """ - builder = CancelOrderByOrderIdReqBuilder() - builder.set_order_id(?).set_symbol(?) + builder = GetOrderByClientOidReqBuilder() + builder.set_symbol(?).set_client_oid(?) req = builder.build() try: - resp = self.api.cancel_order_by_order_id(req) + resp = self.api.get_order_by_client_oid(req) print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) @@ -296,18 +283,15 @@ def test_cancel_order_by_order_id_req(self): print("error: ", e) raise e -def test_get_order_by_order_id_req(self): +def test_get_symbols_with_open_order_req(self): """ - get_order_by_order_id - Get Order By OrderId - /api/v1/hf/orders/{orderId} + get_symbols_with_open_order + Get Symbols With Open Order + /api/v1/hf/orders/active/symbols """ - builder = GetOrderByOrderIdReqBuilder() - builder.set_symbol(?).set_order_id(?) - req = builder.build() try: - resp = self.api.get_order_by_order_id(req) + resp = self.api.get_symbols_with_open_order() print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) @@ -315,18 +299,18 @@ def test_get_order_by_order_id_req(self): print("error: ", e) raise e -def test_add_order_req(self): +def test_get_open_orders_req(self): """ - add_order - Add Order - /api/v1/hf/orders + get_open_orders + Get Open Orders + /api/v1/hf/orders/active """ - builder = AddOrderReqBuilder() - builder.set_client_oid(?).set_side(?).set_symbol(?).set_type(?).set_remark(?).set_stp(?).set_price(?).set_size(?).set_time_in_force(?).set_post_only(?).set_hidden(?).set_iceberg(?).set_visible_size(?).set_tags(?).set_cancel_after(?).set_funds(?) + builder = GetOpenOrdersReqBuilder() + builder.set_symbol(?) req = builder.build() try: - resp = self.api.add_order(req) + resp = self.api.get_open_orders(req) print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) @@ -334,18 +318,18 @@ def test_add_order_req(self): print("error: ", e) raise e -def test_cancel_order_by_client_oid_sync_req(self): +def test_get_closed_orders_req(self): """ - cancel_order_by_client_oid_sync - Cancel Order By ClientOid Sync - /api/v1/hf/orders/sync/client-order/{clientOid} + get_closed_orders + Get Closed Orders + /api/v1/hf/orders/done """ - builder = CancelOrderByClientOidSyncReqBuilder() - builder.set_client_oid(?).set_symbol(?) + builder = GetClosedOrdersReqBuilder() + builder.set_symbol(?).set_side(?).set_type(?).set_last_id(?).set_limit(?).set_start_at(?).set_end_at(?) req = builder.build() try: - resp = self.api.cancel_order_by_client_oid_sync(req) + resp = self.api.get_closed_orders(req) print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) @@ -353,18 +337,18 @@ def test_cancel_order_by_client_oid_sync_req(self): print("error: ", e) raise e -def test_cancel_order_by_order_id_sync_req(self): +def test_get_trade_history_req(self): """ - cancel_order_by_order_id_sync - Cancel Order By OrderId Sync - /api/v1/hf/orders/sync/{orderId} + get_trade_history + Get Trade History + /api/v1/hf/fills """ - builder = CancelOrderByOrderIdSyncReqBuilder() - builder.set_order_id(?).set_symbol(?) + builder = GetTradeHistoryReqBuilder() + builder.set_symbol(?).set_order_id(?).set_side(?).set_type(?).set_last_id(?).set_limit(?).set_start_at(?).set_end_at(?) req = builder.build() try: - resp = self.api.cancel_order_by_order_id_sync(req) + resp = self.api.get_trade_history(req) print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) @@ -372,18 +356,15 @@ def test_cancel_order_by_order_id_sync_req(self): print("error: ", e) raise e -def test_add_order_sync_req(self): - """ - add_order_sync - Add Order Sync - /api/v1/hf/orders/sync +def test_get_dcp_req(self): + """ + get_dcp + Get DCP + /api/v1/hf/orders/dead-cancel-all/query """ - builder = AddOrderSyncReqBuilder() - builder.set_client_oid(?).set_side(?).set_symbol(?).set_type(?).set_remark(?).set_stp(?).set_price(?).set_size(?).set_time_in_force(?).set_post_only(?).set_hidden(?).set_iceberg(?).set_visible_size(?).set_tags(?).set_cancel_after(?).set_funds(?) - req = builder.build() try: - resp = self.api.add_order_sync(req) + resp = self.api.get_dcp() print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) @@ -391,18 +372,18 @@ def test_add_order_sync_req(self): print("error: ", e) raise e -def test_add_order_test_req(self): +def test_set_dcp_req(self): """ - add_order_test - Add Order Test - /api/v1/hf/orders/test + set_dcp + Set DCP + /api/v1/hf/orders/dead-cancel-all """ - builder = AddOrderTestReqBuilder() - builder.set_client_oid(?).set_side(?).set_symbol(?).set_type(?).set_remark(?).set_stp(?).set_price(?).set_size(?).set_time_in_force(?).set_post_only(?).set_hidden(?).set_iceberg(?).set_visible_size(?).set_tags(?).set_cancel_after(?).set_funds(?) + builder = SetDcpReqBuilder() + builder.set_timeout(?).set_symbols(?) req = builder.build() try: - resp = self.api.add_order_test(req) + resp = self.api.set_dcp(req) print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) @@ -410,18 +391,18 @@ def test_add_order_test_req(self): print("error: ", e) raise e -def test_get_recent_trade_history_old_req(self): +def test_add_stop_order_req(self): """ - get_recent_trade_history_old - Get Recent Trade History - Old - /api/v1/limit/fills + add_stop_order + Add Stop Order + /api/v1/stop-order """ - builder = GetRecentTradeHistoryOldReqBuilder() - builder.set_current_page(?).set_page_size(?) + builder = AddStopOrderReqBuilder() + builder.set_client_oid(?).set_side(?).set_symbol(?).set_type(?).set_remark(?).set_stp(?).set_price(?).set_size(?).set_time_in_force(?).set_post_only(?).set_hidden(?).set_iceberg(?).set_visible_size(?).set_cancel_after(?).set_funds(?).set_stop_price(?).set_trade_type(?) req = builder.build() try: - resp = self.api.get_recent_trade_history_old(req) + resp = self.api.add_stop_order(req) print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) @@ -429,18 +410,18 @@ def test_get_recent_trade_history_old_req(self): print("error: ", e) raise e -def test_get_recent_orders_list_old_req(self): +def test_cancel_stop_order_by_client_oid_req(self): """ - get_recent_orders_list_old - Get Recent Orders List - Old - /api/v1/limit/orders + cancel_stop_order_by_client_oid + Cancel Stop Order By ClientOid + /api/v1/stop-order/cancelOrderByClientOid """ - builder = GetRecentOrdersListOldReqBuilder() - builder.set_current_page(?).set_page_size(?) + builder = CancelStopOrderByClientOidReqBuilder() + builder.set_symbol(?).set_client_oid(?) req = builder.build() try: - resp = self.api.get_recent_orders_list_old(req) + resp = self.api.cancel_stop_order_by_client_oid(req) print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) @@ -448,18 +429,18 @@ def test_get_recent_orders_list_old_req(self): print("error: ", e) raise e -def test_cancel_order_by_client_oid_old_req(self): +def test_cancel_stop_order_by_order_id_req(self): """ - cancel_order_by_client_oid_old - Cancel Order By ClientOid - Old - /api/v1/order/client-order/{clientOid} + cancel_stop_order_by_order_id + Cancel Stop Order By OrderId + /api/v1/stop-order/{orderId} """ - builder = CancelOrderByClientOidOldReqBuilder() - builder.set_symbol(?).set_client_oid(?) + builder = CancelStopOrderByOrderIdReqBuilder() + builder.set_order_id(?) req = builder.build() try: - resp = self.api.cancel_order_by_client_oid_old(req) + resp = self.api.cancel_stop_order_by_order_id(req) print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) @@ -467,18 +448,18 @@ def test_cancel_order_by_client_oid_old_req(self): print("error: ", e) raise e -def test_get_order_by_client_oid_old_req(self): +def test_batch_cancel_stop_order_req(self): """ - get_order_by_client_oid_old - Get Order By ClientOid - Old - /api/v1/order/client-order/{clientOid} + batch_cancel_stop_order + Batch Cancel Stop Orders + /api/v1/stop-order/cancel """ - builder = GetOrderByClientOidOldReqBuilder() - builder.set_client_oid(?) + builder = BatchCancelStopOrderReqBuilder() + builder.set_symbol(?).set_trade_type(?).set_order_ids(?) req = builder.build() try: - resp = self.api.get_order_by_client_oid_old(req) + resp = self.api.batch_cancel_stop_order(req) print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) @@ -486,18 +467,18 @@ def test_get_order_by_client_oid_old_req(self): print("error: ", e) raise e -def test_batch_cancel_order_old_req(self): +def test_get_stop_orders_list_req(self): """ - batch_cancel_order_old - Batch Cancel Order - Old - /api/v1/orders + get_stop_orders_list + Get Stop Orders List + /api/v1/stop-order """ - builder = BatchCancelOrderOldReqBuilder() - builder.set_symbol(?).set_trade_type(?) + builder = GetStopOrdersListReqBuilder() + builder.set_symbol(?).set_side(?).set_type(?).set_trade_type(?).set_start_at(?).set_end_at(?).set_current_page(?).set_order_ids(?).set_page_size(?).set_stop(?) req = builder.build() try: - resp = self.api.batch_cancel_order_old(req) + resp = self.api.get_stop_orders_list(req) print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) @@ -505,18 +486,18 @@ def test_batch_cancel_order_old_req(self): print("error: ", e) raise e -def test_get_orders_list_old_req(self): +def test_get_stop_order_by_order_id_req(self): """ - get_orders_list_old - Get Orders List - Old - /api/v1/orders + get_stop_order_by_order_id + Get Stop Order By OrderId + /api/v1/stop-order/{orderId} """ - builder = GetOrdersListOldReqBuilder() - builder.set_symbol(?).set_status(?).set_side(?).set_type(?).set_trade_type(?).set_start_at(?).set_end_at(?).set_current_page(?).set_page_size(?) + builder = GetStopOrderByOrderIdReqBuilder() + builder.set_order_id(?) req = builder.build() try: - resp = self.api.get_orders_list_old(req) + resp = self.api.get_stop_order_by_order_id(req) print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) @@ -524,18 +505,18 @@ def test_get_orders_list_old_req(self): print("error: ", e) raise e -def test_batch_add_orders_old_req(self): +def test_get_stop_order_by_client_oid_req(self): """ - batch_add_orders_old - Batch Add Orders - Old - /api/v1/orders/multi + get_stop_order_by_client_oid + Get Stop Order By ClientOid + /api/v1/stop-order/queryOrderByClientOid """ - builder = BatchAddOrdersOldReqBuilder() - builder.set_order_list(?).set_symbol(?) + builder = GetStopOrderByClientOidReqBuilder() + builder.set_client_oid(?).set_symbol(?) req = builder.build() try: - resp = self.api.batch_add_orders_old(req) + resp = self.api.get_stop_order_by_client_oid(req) print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) @@ -543,18 +524,18 @@ def test_batch_add_orders_old_req(self): print("error: ", e) raise e -def test_cancel_order_by_order_id_old_req(self): +def test_add_oco_order_req(self): """ - cancel_order_by_order_id_old - Cancel Order By OrderId - Old - /api/v1/orders/{orderId} + add_oco_order + Add OCO Order + /api/v3/oco/order """ - builder = CancelOrderByOrderIdOldReqBuilder() - builder.set_symbol(?).set_order_id(?) + builder = AddOcoOrderReqBuilder() + builder.set_client_oid(?).set_side(?).set_symbol(?).set_remark(?).set_price(?).set_size(?).set_stop_price(?).set_limit_price(?).set_trade_type(?) req = builder.build() try: - resp = self.api.cancel_order_by_order_id_old(req) + resp = self.api.add_oco_order(req) print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) @@ -562,18 +543,18 @@ def test_cancel_order_by_order_id_old_req(self): print("error: ", e) raise e -def test_get_order_by_order_id_old_req(self): +def test_cancel_oco_order_by_order_id_req(self): """ - get_order_by_order_id_old - Get Order By OrderId - Old - /api/v1/orders/{orderId} + cancel_oco_order_by_order_id + Cancel OCO Order By OrderId + /api/v3/oco/order/{orderId} """ - builder = GetOrderByOrderIdOldReqBuilder() + builder = CancelOcoOrderByOrderIdReqBuilder() builder.set_order_id(?) req = builder.build() try: - resp = self.api.get_order_by_order_id_old(req) + resp = self.api.cancel_oco_order_by_order_id(req) print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) @@ -581,18 +562,18 @@ def test_get_order_by_order_id_old_req(self): print("error: ", e) raise e -def test_add_order_old_req(self): +def test_cancel_oco_order_by_client_oid_req(self): """ - add_order_old - Add Order - Old - /api/v1/orders + cancel_oco_order_by_client_oid + Cancel OCO Order By ClientOid + /api/v3/oco/client-order/{clientOid} """ - builder = AddOrderOldReqBuilder() - builder.set_client_oid(?).set_side(?).set_symbol(?).set_type(?).set_remark(?).set_stp(?).set_price(?).set_size(?).set_time_in_force(?).set_post_only(?).set_hidden(?).set_iceberg(?).set_visible_size(?).set_cancel_after(?).set_funds(?).set_trade_type(?) + builder = CancelOcoOrderByClientOidReqBuilder() + builder.set_client_oid(?) req = builder.build() try: - resp = self.api.add_order_old(req) + resp = self.api.cancel_oco_order_by_client_oid(req) print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) @@ -600,18 +581,18 @@ def test_add_order_old_req(self): print("error: ", e) raise e -def test_add_order_test_old_req(self): +def test_batch_cancel_oco_orders_req(self): """ - add_order_test_old - Add Order Test - Old - /api/v1/orders/test + batch_cancel_oco_orders + Batch Cancel OCO Order + /api/v3/oco/orders """ - builder = AddOrderTestOldReqBuilder() - builder.set_client_oid(?).set_side(?).set_symbol(?).set_type(?).set_remark(?).set_stp(?).set_price(?).set_size(?).set_time_in_force(?).set_post_only(?).set_hidden(?).set_iceberg(?).set_visible_size(?).set_cancel_after(?).set_funds(?).set_trade_type(?) + builder = BatchCancelOcoOrdersReqBuilder() + builder.set_order_ids(?).set_symbol(?) req = builder.build() try: - resp = self.api.add_order_test_old(req) + resp = self.api.batch_cancel_oco_orders(req) print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) @@ -619,18 +600,18 @@ def test_add_order_test_old_req(self): print("error: ", e) raise e -def test_batch_cancel_stop_order_req(self): +def test_get_oco_order_by_order_id_req(self): """ - batch_cancel_stop_order - Batch Cancel Stop Orders - /api/v1/stop-order/cancel + get_oco_order_by_order_id + Get OCO Order By OrderId + /api/v3/oco/order/{orderId} """ - builder = BatchCancelStopOrderReqBuilder() - builder.set_symbol(?).set_trade_type(?).set_order_ids(?) + builder = GetOcoOrderByOrderIdReqBuilder() + builder.set_order_id(?) req = builder.build() try: - resp = self.api.batch_cancel_stop_order(req) + resp = self.api.get_oco_order_by_order_id(req) print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) @@ -638,18 +619,18 @@ def test_batch_cancel_stop_order_req(self): print("error: ", e) raise e -def test_cancel_stop_order_by_client_oid_req(self): +def test_get_oco_order_by_client_oid_req(self): """ - cancel_stop_order_by_client_oid - Cancel Stop Order By ClientOid - /api/v1/stop-order/cancelOrderByClientOid + get_oco_order_by_client_oid + Get OCO Order By ClientOid + /api/v3/oco/client-order/{clientOid} """ - builder = CancelStopOrderByClientOidReqBuilder() - builder.set_symbol(?).set_client_oid(?) + builder = GetOcoOrderByClientOidReqBuilder() + builder.set_client_oid(?) req = builder.build() try: - resp = self.api.cancel_stop_order_by_client_oid(req) + resp = self.api.get_oco_order_by_client_oid(req) print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) @@ -657,18 +638,18 @@ def test_cancel_stop_order_by_client_oid_req(self): print("error: ", e) raise e -def test_get_stop_orders_list_req(self): +def test_get_oco_order_detail_by_order_id_req(self): """ - get_stop_orders_list - Get Stop Orders List - /api/v1/stop-order + get_oco_order_detail_by_order_id + Get OCO Order Detail By OrderId + /api/v3/oco/order/details/{orderId} """ - builder = GetStopOrdersListReqBuilder() - builder.set_symbol(?).set_side(?).set_type(?).set_trade_type(?).set_start_at(?).set_end_at(?).set_current_page(?).set_order_ids(?).set_page_size(?).set_stop(?) + builder = GetOcoOrderDetailByOrderIdReqBuilder() + builder.set_order_id(?) req = builder.build() try: - resp = self.api.get_stop_orders_list(req) + resp = self.api.get_oco_order_detail_by_order_id(req) print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) @@ -676,18 +657,18 @@ def test_get_stop_orders_list_req(self): print("error: ", e) raise e -def test_cancel_stop_order_by_order_id_req(self): +def test_get_oco_order_list_req(self): """ - cancel_stop_order_by_order_id - Cancel Stop Order By OrderId - /api/v1/stop-order/{orderId} + get_oco_order_list + Get OCO Order List + /api/v3/oco/orders """ - builder = CancelStopOrderByOrderIdReqBuilder() - builder.set_order_id(?) + builder = GetOcoOrderListReqBuilder() + builder.set_symbol(?).set_start_at(?).set_end_at(?).set_order_ids(?).set_page_size(?).set_current_page(?) req = builder.build() try: - resp = self.api.cancel_stop_order_by_order_id(req) + resp = self.api.get_oco_order_list(req) print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) @@ -695,18 +676,18 @@ def test_cancel_stop_order_by_order_id_req(self): print("error: ", e) raise e -def test_get_stop_order_by_order_id_req(self): +def test_add_order_old_req(self): """ - get_stop_order_by_order_id - Get Stop Order By OrderId - /api/v1/stop-order/{orderId} + add_order_old + Add Order - Old + /api/v1/orders """ - builder = GetStopOrderByOrderIdReqBuilder() - builder.set_order_id(?) + builder = AddOrderOldReqBuilder() + builder.set_client_oid(?).set_side(?).set_symbol(?).set_type(?).set_remark(?).set_stp(?).set_price(?).set_size(?).set_time_in_force(?).set_post_only(?).set_hidden(?).set_iceberg(?).set_visible_size(?).set_cancel_after(?).set_funds(?).set_trade_type(?) req = builder.build() try: - resp = self.api.get_stop_order_by_order_id(req) + resp = self.api.add_order_old(req) print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) @@ -714,18 +695,18 @@ def test_get_stop_order_by_order_id_req(self): print("error: ", e) raise e -def test_add_stop_order_req(self): +def test_add_order_test_old_req(self): """ - add_stop_order - Add Stop Order - /api/v1/stop-order + add_order_test_old + Add Order Test - Old + /api/v1/orders/test """ - builder = AddStopOrderReqBuilder() - builder.set_client_oid(?).set_side(?).set_symbol(?).set_type(?).set_remark(?).set_stp(?).set_price(?).set_size(?).set_time_in_force(?).set_post_only(?).set_hidden(?).set_iceberg(?).set_visible_size(?).set_cancel_after(?).set_funds(?).set_stop_price(?).set_trade_type(?) + builder = AddOrderTestOldReqBuilder() + builder.set_client_oid(?).set_side(?).set_symbol(?).set_type(?).set_remark(?).set_stp(?).set_price(?).set_size(?).set_time_in_force(?).set_post_only(?).set_hidden(?).set_iceberg(?).set_visible_size(?).set_cancel_after(?).set_funds(?).set_trade_type(?) req = builder.build() try: - resp = self.api.add_stop_order(req) + resp = self.api.add_order_test_old(req) print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) @@ -733,18 +714,18 @@ def test_add_stop_order_req(self): print("error: ", e) raise e -def test_get_stop_order_by_client_oid_req(self): +def test_batch_add_orders_old_req(self): """ - get_stop_order_by_client_oid - Get Stop Order By ClientOid - /api/v1/stop-order/queryOrderByClientOid + batch_add_orders_old + Batch Add Orders - Old + /api/v1/orders/multi """ - builder = GetStopOrderByClientOidReqBuilder() - builder.set_client_oid(?).set_symbol(?) + builder = BatchAddOrdersOldReqBuilder() + builder.set_order_list(?).set_symbol(?) req = builder.build() try: - resp = self.api.get_stop_order_by_client_oid(req) + resp = self.api.batch_add_orders_old(req) print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) @@ -752,18 +733,18 @@ def test_get_stop_order_by_client_oid_req(self): print("error: ", e) raise e -def test_cancel_oco_order_by_client_oid_req(self): +def test_cancel_order_by_order_id_old_req(self): """ - cancel_oco_order_by_client_oid - Cancel OCO Order By ClientOid - /api/v3/oco/client-order/{clientOid} + cancel_order_by_order_id_old + Cancel Order By OrderId - Old + /api/v1/orders/{orderId} """ - builder = CancelOcoOrderByClientOidReqBuilder() - builder.set_client_oid(?) + builder = CancelOrderByOrderIdOldReqBuilder() + builder.set_symbol(?).set_order_id(?) req = builder.build() try: - resp = self.api.cancel_oco_order_by_client_oid(req) + resp = self.api.cancel_order_by_order_id_old(req) print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) @@ -771,18 +752,18 @@ def test_cancel_oco_order_by_client_oid_req(self): print("error: ", e) raise e -def test_get_oco_order_by_client_oid_req(self): +def test_cancel_order_by_client_oid_old_req(self): """ - get_oco_order_by_client_oid - Get OCO Order By ClientOid - /api/v3/oco/client-order/{clientOid} + cancel_order_by_client_oid_old + Cancel Order By ClientOid - Old + /api/v1/order/client-order/{clientOid} """ - builder = GetOcoOrderByClientOidReqBuilder() - builder.set_client_oid(?) + builder = CancelOrderByClientOidOldReqBuilder() + builder.set_symbol(?).set_client_oid(?) req = builder.build() try: - resp = self.api.get_oco_order_by_client_oid(req) + resp = self.api.cancel_order_by_client_oid_old(req) print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) @@ -790,18 +771,18 @@ def test_get_oco_order_by_client_oid_req(self): print("error: ", e) raise e -def test_get_oco_order_detail_by_order_id_req(self): +def test_batch_cancel_order_old_req(self): """ - get_oco_order_detail_by_order_id - Get OCO Order Detail By OrderId - /api/v3/oco/order/details/{orderId} + batch_cancel_order_old + Batch Cancel Order - Old + /api/v1/orders """ - builder = GetOcoOrderDetailByOrderIdReqBuilder() - builder.set_order_id(?) + builder = BatchCancelOrderOldReqBuilder() + builder.set_symbol(?).set_trade_type(?) req = builder.build() try: - resp = self.api.get_oco_order_detail_by_order_id(req) + resp = self.api.batch_cancel_order_old(req) print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) @@ -809,18 +790,18 @@ def test_get_oco_order_detail_by_order_id_req(self): print("error: ", e) raise e -def test_cancel_oco_order_by_order_id_req(self): +def test_get_orders_list_old_req(self): """ - cancel_oco_order_by_order_id - Cancel OCO Order By OrderId - /api/v3/oco/order/{orderId} + get_orders_list_old + Get Orders List - Old + /api/v1/orders """ - builder = CancelOcoOrderByOrderIdReqBuilder() - builder.set_order_id(?) + builder = GetOrdersListOldReqBuilder() + builder.set_symbol(?).set_status(?).set_side(?).set_type(?).set_trade_type(?).set_start_at(?).set_end_at(?).set_current_page(?).set_page_size(?) req = builder.build() try: - resp = self.api.cancel_oco_order_by_order_id(req) + resp = self.api.get_orders_list_old(req) print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) @@ -828,18 +809,37 @@ def test_cancel_oco_order_by_order_id_req(self): print("error: ", e) raise e -def test_get_oco_order_by_order_id_req(self): +def test_get_recent_orders_list_old_req(self): """ - get_oco_order_by_order_id - Get OCO Order By OrderId - /api/v3/oco/order/{orderId} + get_recent_orders_list_old + Get Recent Orders List - Old + /api/v1/limit/orders """ - builder = GetOcoOrderByOrderIdReqBuilder() + builder = GetRecentOrdersListOldReqBuilder() + builder.set_current_page(?).set_page_size(?) + req = builder.build() + try: + resp = self.api.get_recent_orders_list_old(req) + print("code: ", resp.common_response.code) + print("msg: ", resp.common_response.message) + print("data: ", resp.to_json()) + except Exception as e: + print("error: ", e) + raise e + +def test_get_order_by_order_id_old_req(self): + """ + get_order_by_order_id_old + Get Order By OrderId - Old + /api/v1/orders/{orderId} + """ + + builder = GetOrderByOrderIdOldReqBuilder() builder.set_order_id(?) req = builder.build() try: - resp = self.api.get_oco_order_by_order_id(req) + resp = self.api.get_order_by_order_id_old(req) print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) @@ -847,18 +847,18 @@ def test_get_oco_order_by_order_id_req(self): print("error: ", e) raise e -def test_add_oco_order_req(self): +def test_get_order_by_client_oid_old_req(self): """ - add_oco_order - Add OCO Order - /api/v3/oco/order + get_order_by_client_oid_old + Get Order By ClientOid - Old + /api/v1/order/client-order/{clientOid} """ - builder = AddOcoOrderReqBuilder() - builder.set_client_oid(?).set_side(?).set_symbol(?).set_remark(?).set_price(?).set_size(?).set_stop_price(?).set_limit_price(?).set_trade_type(?) + builder = GetOrderByClientOidOldReqBuilder() + builder.set_client_oid(?) req = builder.build() try: - resp = self.api.add_oco_order(req) + resp = self.api.get_order_by_client_oid_old(req) print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) @@ -866,18 +866,18 @@ def test_add_oco_order_req(self): print("error: ", e) raise e -def test_batch_cancel_oco_orders_req(self): +def test_get_trade_history_old_req(self): """ - batch_cancel_oco_orders - Batch Cancel OCO Order - /api/v3/oco/orders + get_trade_history_old + Get Trade History - Old + /api/v1/fills """ - builder = BatchCancelOcoOrdersReqBuilder() - builder.set_order_ids(?).set_symbol(?) + builder = GetTradeHistoryOldReqBuilder() + builder.set_symbol(?).set_order_id(?).set_side(?).set_type(?).set_trade_type(?).set_start_at(?).set_end_at(?).set_current_page(?).set_page_size(?) req = builder.build() try: - resp = self.api.batch_cancel_oco_orders(req) + resp = self.api.get_trade_history_old(req) print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) @@ -885,18 +885,18 @@ def test_batch_cancel_oco_orders_req(self): print("error: ", e) raise e -def test_get_oco_order_list_req(self): +def test_get_recent_trade_history_old_req(self): """ - get_oco_order_list - Get OCO Order List - /api/v3/oco/orders + get_recent_trade_history_old + Get Recent Trade History - Old + /api/v1/limit/fills """ - builder = GetOcoOrderListReqBuilder() - builder.set_symbol(?).set_start_at(?).set_end_at(?).set_order_ids(?).set_page_size(?).set_current_page(?) + builder = GetRecentTradeHistoryOldReqBuilder() + builder.set_current_page(?).set_page_size(?) req = builder.build() try: - resp = self.api.get_oco_order_list(req) + resp = self.api.get_recent_trade_history_old(req) print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) diff --git a/sdk/python/kucoin_universal_sdk/generate/spot/order/api_order_test.py b/sdk/python/kucoin_universal_sdk/generate/spot/order/api_order_test.py index 7ed30ac8..b88897c2 100644 --- a/sdk/python/kucoin_universal_sdk/generate/spot/order/api_order_test.py +++ b/sdk/python/kucoin_universal_sdk/generate/spot/order/api_order_test.py @@ -98,134 +98,138 @@ class OrderAPITest(unittest.TestCase): - def test_get_trade_history_old_req_model(self): + def test_add_order_req_model(self): """ - get_trade_history_old - Get Trade History - Old - /api/v1/fills + add_order + Add Order + /api/v1/hf/orders """ - data = "{\"symbol\": \"BTC-USDT\", \"orderId\": \"example_string_default_value\", \"side\": \"buy\", \"type\": \"limit\", \"tradeType\": \"TRADE\", \"startAt\": 1728663338000, \"endAt\": 1728692138000, \"currentPage\": 1, \"pageSize\": 50}" - req = GetTradeHistoryOldReq.from_json(data) + data = "{\"type\": \"limit\", \"symbol\": \"BTC-USDT\", \"side\": \"buy\", \"price\": \"50000\", \"size\": \"0.00001\", \"clientOid\": \"5c52e11203aa677f33e493fb\", \"remark\": \"order remarks\"}" + req = AddOrderReq.from_json(data) - def test_get_trade_history_old_resp_model(self): + def test_add_order_resp_model(self): """ - get_trade_history_old - Get Trade History - Old - /api/v1/fills + add_order + Add Order + /api/v1/hf/orders """ - data = "{\n \"code\": \"200000\",\n \"data\": {\n \"currentPage\": 1,\n \"pageSize\": 50,\n \"totalNum\": 1,\n \"totalPage\": 1,\n \"items\": [\n {\n \"symbol\": \"DOGE-USDT\",\n \"tradeId\": \"10862827223795713\",\n \"orderId\": \"6745698ef4f1200007c561a8\",\n \"counterOrderId\": \"6745695ef15b270007ac5076\",\n \"side\": \"buy\",\n \"liquidity\": \"taker\",\n \"forceTaker\": false,\n \"price\": \"0.40739\",\n \"size\": \"10\",\n \"funds\": \"4.0739\",\n \"fee\": \"0.0040739\",\n \"feeRate\": \"0.001\",\n \"feeCurrency\": \"USDT\",\n \"stop\": \"\",\n \"tradeType\": \"TRADE\",\n \"type\": \"market\",\n \"createdAt\": 1732602254928\n }\n ]\n }\n}" + data = "{\"code\":\"200000\",\"data\":{\"orderId\":\"670fd33bf9406e0007ab3945\",\"clientOid\":\"5c52e11203aa677f33e493fb\"}}" common_response = RestResponse.from_json(data) - resp = GetTradeHistoryOldResp.from_dict(common_response.data) + resp = AddOrderResp.from_dict(common_response.data) - def test_get_trade_history_req_model(self): + def test_add_order_sync_req_model(self): """ - get_trade_history - Get Trade History - /api/v1/hf/fills + add_order_sync + Add Order Sync + /api/v1/hf/orders/sync """ - data = "{\"symbol\": \"BTC-USDT\", \"orderId\": \"example_string_default_value\", \"side\": \"buy\", \"type\": \"limit\", \"lastId\": 254062248624417, \"limit\": 100, \"startAt\": 1728663338000, \"endAt\": 1728692138000}" - req = GetTradeHistoryReq.from_json(data) + data = "{\"type\": \"limit\", \"symbol\": \"BTC-USDT\", \"side\": \"buy\", \"price\": \"50000\", \"size\": \"0.00001\", \"clientOid\": \"5c52e11203aa677f33e493f\", \"remark\": \"order remarks\"}" + req = AddOrderSyncReq.from_json(data) - def test_get_trade_history_resp_model(self): + def test_add_order_sync_resp_model(self): """ - get_trade_history - Get Trade History - /api/v1/hf/fills + add_order_sync + Add Order Sync + /api/v1/hf/orders/sync """ - data = "{\n \"code\": \"200000\",\n \"data\": {\n \"items\": [\n {\n \"id\": 19814995255305,\n \"orderId\": \"6717422bd51c29000775ea03\",\n \"counterOrderId\": \"67174228135f9e000709da8c\",\n \"tradeId\": 11029373945659392,\n \"symbol\": \"BTC-USDT\",\n \"side\": \"buy\",\n \"liquidity\": \"taker\",\n \"type\": \"limit\",\n \"forceTaker\": false,\n \"price\": \"67717.6\",\n \"size\": \"0.00001\",\n \"funds\": \"0.677176\",\n \"fee\": \"0.000677176\",\n \"feeRate\": \"0.001\",\n \"feeCurrency\": \"USDT\",\n \"stop\": \"\",\n \"tradeType\": \"TRADE\",\n \"taxRate\": \"0\",\n \"tax\": \"0\",\n \"createdAt\": 1729577515473\n }\n ],\n \"lastId\": 19814995255305\n }\n}" + data = "{\"code\":\"200000\",\"data\":{\"orderId\":\"67111a7cb7cbdf000703e1f6\",\"clientOid\":\"5c52e11203aa677f33e493f\",\"orderTime\":1729174140586,\"originSize\":\"0.00001\",\"dealSize\":\"0\",\"remainSize\":\"0.00001\",\"canceledSize\":\"0\",\"status\":\"open\",\"matchTime\":1729174140588}}" common_response = RestResponse.from_json(data) - resp = GetTradeHistoryResp.from_dict(common_response.data) + resp = AddOrderSyncResp.from_dict(common_response.data) - def test_get_open_orders_req_model(self): + def test_add_order_test_req_model(self): """ - get_open_orders - Get Open Orders - /api/v1/hf/orders/active + add_order_test + Add Order Test + /api/v1/hf/orders/test """ - data = "{\"symbol\": \"BTC-USDT\"}" - req = GetOpenOrdersReq.from_json(data) + data = "{\"type\": \"limit\", \"symbol\": \"BTC-USDT\", \"side\": \"buy\", \"price\": \"50000\", \"size\": \"0.00001\", \"clientOid\": \"5c52e11203aa677f33e493f\", \"remark\": \"order remarks\"}" + req = AddOrderTestReq.from_json(data) - def test_get_open_orders_resp_model(self): + def test_add_order_test_resp_model(self): """ - get_open_orders - Get Open Orders - /api/v1/hf/orders/active + add_order_test + Add Order Test + /api/v1/hf/orders/test """ - data = "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"id\": \"67120bbef094e200070976f6\",\n \"clientOid\": \"5c52e11203aa677f33e493fb\",\n \"symbol\": \"BTC-USDT\",\n \"opType\": \"DEAL\",\n \"type\": \"limit\",\n \"side\": \"buy\",\n \"price\": \"50000\",\n \"size\": \"0.00001\",\n \"funds\": \"0.5\",\n \"dealSize\": \"0\",\n \"dealFunds\": \"0\",\n \"fee\": \"0\",\n \"feeCurrency\": \"USDT\",\n \"stp\": null,\n \"timeInForce\": \"GTC\",\n \"postOnly\": false,\n \"hidden\": false,\n \"iceberg\": false,\n \"visibleSize\": \"0\",\n \"cancelAfter\": 0,\n \"channel\": \"API\",\n \"remark\": \"order remarks\",\n \"tags\": \"order tags\",\n \"cancelExist\": false,\n \"tradeType\": \"TRADE\",\n \"inOrderBook\": true,\n \"cancelledSize\": \"0\",\n \"cancelledFunds\": \"0\",\n \"remainSize\": \"0.00001\",\n \"remainFunds\": \"0.5\",\n \"tax\": \"0\",\n \"active\": true,\n \"createdAt\": 1729235902748,\n \"lastUpdatedAt\": 1729235909862\n }\n ]\n}" + data = "{\"code\":\"200000\",\"data\":{\"orderId\":\"670fd33bf9406e0007ab3945\",\"clientOid\":\"5c52e11203aa677f33e493fb\"}}" common_response = RestResponse.from_json(data) - resp = GetOpenOrdersResp.from_dict(common_response.data) + resp = AddOrderTestResp.from_dict(common_response.data) - def test_get_symbols_with_open_order_req_model(self): + def test_batch_add_orders_req_model(self): """ - get_symbols_with_open_order - Get Symbols With Open Order - /api/v1/hf/orders/active/symbols + batch_add_orders + Batch Add Orders + /api/v1/hf/orders/multi """ + data = "{\"orderList\": [{\"clientOid\": \"client order id 12\", \"symbol\": \"BTC-USDT\", \"type\": \"limit\", \"side\": \"buy\", \"price\": \"30000\", \"size\": \"0.00001\"}, {\"clientOid\": \"client order id 13\", \"symbol\": \"ETH-USDT\", \"type\": \"limit\", \"side\": \"sell\", \"price\": \"2000\", \"size\": \"0.00001\"}]}" + req = BatchAddOrdersReq.from_json(data) - def test_get_symbols_with_open_order_resp_model(self): + def test_batch_add_orders_resp_model(self): """ - get_symbols_with_open_order - Get Symbols With Open Order - /api/v1/hf/orders/active/symbols + batch_add_orders + Batch Add Orders + /api/v1/hf/orders/multi """ - data = "{\n \"code\": \"200000\",\n \"data\": {\n \"symbols\": [\n \"ETH-USDT\",\n \"BTC-USDT\"\n ]\n }\n}" + data = "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"orderId\": \"6710d8336afcdb0007319c27\",\n \"clientOid\": \"client order id 12\",\n \"success\": true\n },\n {\n \"success\": false,\n \"failMsg\": \"The order funds should more then 0.1 USDT.\"\n }\n ]\n}" common_response = RestResponse.from_json(data) - resp = GetSymbolsWithOpenOrderResp.from_dict(common_response.data) + resp = BatchAddOrdersResp.from_dict(common_response.data) - def test_modify_order_req_model(self): + def test_batch_add_orders_sync_req_model(self): """ - modify_order - Modify Order - /api/v1/hf/orders/alter + batch_add_orders_sync + Batch Add Orders Sync + /api/v1/hf/orders/multi/sync """ - data = "{\"symbol\": \"BTC-USDT\", \"orderId\": \"670fd33bf9406e0007ab3945\", \"newPrice\": \"30000\", \"newSize\": \"0.0001\"}" - req = ModifyOrderReq.from_json(data) + data = "{\"orderList\": [{\"clientOid\": \"client order id 13\", \"symbol\": \"BTC-USDT\", \"type\": \"limit\", \"side\": \"buy\", \"price\": \"30000\", \"size\": \"0.00001\"}, {\"clientOid\": \"client order id 14\", \"symbol\": \"ETH-USDT\", \"type\": \"limit\", \"side\": \"sell\", \"price\": \"2000\", \"size\": \"0.00001\"}]}" + req = BatchAddOrdersSyncReq.from_json(data) - def test_modify_order_resp_model(self): + def test_batch_add_orders_sync_resp_model(self): """ - modify_order - Modify Order - /api/v1/hf/orders/alter + batch_add_orders_sync + Batch Add Orders Sync + /api/v1/hf/orders/multi/sync """ - data = "{\"code\":\"200000\",\"data\":{\"newOrderId\":\"67112258f9406e0007408827\",\"clientOid\":\"client order id 12\"}}" + data = "{\"code\":\"200000\",\"data\":[{\"orderId\":\"6711195e5584bc0007bd5aef\",\"clientOid\":\"client order id 13\",\"orderTime\":1729173854299,\"originSize\":\"0.00001\",\"dealSize\":\"0\",\"remainSize\":\"0.00001\",\"canceledSize\":\"0\",\"status\":\"open\",\"matchTime\":1729173854326,\"success\":true},{\"success\":false,\"failMsg\":\"The order funds should more then 0.1 USDT.\"}]}" common_response = RestResponse.from_json(data) - resp = ModifyOrderResp.from_dict(common_response.data) + resp = BatchAddOrdersSyncResp.from_dict(common_response.data) - def test_cancel_all_orders_req_model(self): + def test_cancel_order_by_order_id_req_model(self): """ - cancel_all_orders - Cancel All Orders - /api/v1/hf/orders/cancelAll + cancel_order_by_order_id + Cancel Order By OrderId + /api/v1/hf/orders/{orderId} """ + data = "{\"orderId\": \"671124f9365ccb00073debd4\", \"symbol\": \"BTC-USDT\"}" + req = CancelOrderByOrderIdReq.from_json(data) - def test_cancel_all_orders_resp_model(self): + def test_cancel_order_by_order_id_resp_model(self): """ - cancel_all_orders - Cancel All Orders - /api/v1/hf/orders/cancelAll + cancel_order_by_order_id + Cancel Order By OrderId + /api/v1/hf/orders/{orderId} """ - data = "{\n \"code\": \"200000\",\n \"data\": {\n \"succeedSymbols\": [\n \"ETH-USDT\",\n \"BTC-USDT\"\n ],\n \"failedSymbols\": []\n }\n}" + data = "{\n \"code\": \"200000\",\n \"data\": {\n \"orderId\": \"671124f9365ccb00073debd4\"\n }\n}" common_response = RestResponse.from_json(data) - resp = CancelAllOrdersResp.from_dict(common_response.data) + resp = CancelOrderByOrderIdResp.from_dict(common_response.data) - def test_cancel_partial_order_req_model(self): + def test_cancel_order_by_order_id_sync_req_model(self): """ - cancel_partial_order - Cancel Partial Order - /api/v1/hf/orders/cancel/{orderId} + cancel_order_by_order_id_sync + Cancel Order By OrderId Sync + /api/v1/hf/orders/sync/{orderId} """ - data = "{\"orderId\": \"6711f73c1ef16c000717bb31\", \"symbol\": \"BTC-USDT\", \"cancelSize\": \"0.00001\"}" - req = CancelPartialOrderReq.from_json(data) + data = "{\"orderId\": \"671128ee365ccb0007534d45\", \"symbol\": \"BTC-USDT\"}" + req = CancelOrderByOrderIdSyncReq.from_json(data) - def test_cancel_partial_order_resp_model(self): + def test_cancel_order_by_order_id_sync_resp_model(self): """ - cancel_partial_order - Cancel Partial Order - /api/v1/hf/orders/cancel/{orderId} + cancel_order_by_order_id_sync + Cancel Order By OrderId Sync + /api/v1/hf/orders/sync/{orderId} """ - data = "{\n \"code\": \"200000\",\n \"data\": {\n \"orderId\": \"6711f73c1ef16c000717bb31\",\n \"cancelSize\": \"0.00001\"\n }\n}" + data = "{\n \"code\": \"200000\",\n \"data\": {\n \"orderId\": \"671128ee365ccb0007534d45\",\n \"originSize\": \"0.00001\",\n \"dealSize\": \"0\",\n \"remainSize\": \"0\",\n \"canceledSize\": \"0.00001\",\n \"status\": \"done\"\n }\n}" common_response = RestResponse.from_json(data) - resp = CancelPartialOrderResp.from_dict(common_response.data) + resp = CancelOrderByOrderIdSyncResp.from_dict(common_response.data) def test_cancel_order_by_client_oid_req_model(self): """ @@ -246,60 +250,43 @@ def test_cancel_order_by_client_oid_resp_model(self): common_response = RestResponse.from_json(data) resp = CancelOrderByClientOidResp.from_dict(common_response.data) - def test_get_order_by_client_oid_req_model(self): - """ - get_order_by_client_oid - Get Order By ClientOid - /api/v1/hf/orders/client-order/{clientOid} - """ - data = "{\"symbol\": \"BTC-USDT\", \"clientOid\": \"5c52e11203aa677f33e493fb\"}" - req = GetOrderByClientOidReq.from_json(data) - - def test_get_order_by_client_oid_resp_model(self): - """ - get_order_by_client_oid - Get Order By ClientOid - /api/v1/hf/orders/client-order/{clientOid} - """ - data = "{\n \"code\": \"200000\",\n \"data\": {\n \"id\": \"6717422bd51c29000775ea03\",\n \"clientOid\": \"5c52e11203aa677f33e493fb\",\n \"symbol\": \"BTC-USDT\",\n \"opType\": \"DEAL\",\n \"type\": \"limit\",\n \"side\": \"buy\",\n \"price\": \"70000\",\n \"size\": \"0.00001\",\n \"funds\": \"0.7\",\n \"dealSize\": \"0.00001\",\n \"dealFunds\": \"0.677176\",\n \"remainSize\": \"0\",\n \"remainFunds\": \"0.022824\",\n \"cancelledSize\": \"0\",\n \"cancelledFunds\": \"0\",\n \"fee\": \"0.000677176\",\n \"feeCurrency\": \"USDT\",\n \"stp\": null,\n \"timeInForce\": \"GTC\",\n \"postOnly\": false,\n \"hidden\": false,\n \"iceberg\": false,\n \"visibleSize\": \"0\",\n \"cancelAfter\": 0,\n \"channel\": \"API\",\n \"remark\": \"order remarks\",\n \"tags\": null,\n \"cancelExist\": false,\n \"tradeType\": \"TRADE\",\n \"inOrderBook\": false,\n \"active\": false,\n \"tax\": \"0\",\n \"createdAt\": 1729577515444,\n \"lastUpdatedAt\": 1729577515481\n }\n}" - common_response = RestResponse.from_json(data) - resp = GetOrderByClientOidResp.from_dict(common_response.data) - - def test_set_dcp_req_model(self): + def test_cancel_order_by_client_oid_sync_req_model(self): """ - set_dcp - Set DCP - /api/v1/hf/orders/dead-cancel-all + cancel_order_by_client_oid_sync + Cancel Order By ClientOid Sync + /api/v1/hf/orders/sync/client-order/{clientOid} """ - data = "{\"timeout\": 5, \"symbols\": \"BTC-USDT,ETH-USDT\"}" - req = SetDcpReq.from_json(data) + data = "{\"clientOid\": \"5c52e11203aa677f33e493fb\", \"symbol\": \"BTC-USDT\"}" + req = CancelOrderByClientOidSyncReq.from_json(data) - def test_set_dcp_resp_model(self): + def test_cancel_order_by_client_oid_sync_resp_model(self): """ - set_dcp - Set DCP - /api/v1/hf/orders/dead-cancel-all + cancel_order_by_client_oid_sync + Cancel Order By ClientOid Sync + /api/v1/hf/orders/sync/client-order/{clientOid} """ - data = "{\"code\":\"200000\",\"data\":{\"currentTime\":1729656588,\"triggerTime\":1729656593}}" + data = "{\n \"code\": \"200000\",\n \"data\": {\n \"clientOid\": \"5c52e11203aa677f33e493fb\",\n \"originSize\": \"0.00001\",\n \"dealSize\": \"0\",\n \"remainSize\": \"0\",\n \"canceledSize\": \"0.00001\",\n \"status\": \"done\"\n }\n}" common_response = RestResponse.from_json(data) - resp = SetDcpResp.from_dict(common_response.data) + resp = CancelOrderByClientOidSyncResp.from_dict(common_response.data) - def test_get_dcp_req_model(self): + def test_cancel_partial_order_req_model(self): """ - get_dcp - Get DCP - /api/v1/hf/orders/dead-cancel-all/query + cancel_partial_order + Cancel Partial Order + /api/v1/hf/orders/cancel/{orderId} """ + data = "{\"orderId\": \"6711f73c1ef16c000717bb31\", \"symbol\": \"BTC-USDT\", \"cancelSize\": \"0.00001\"}" + req = CancelPartialOrderReq.from_json(data) - def test_get_dcp_resp_model(self): + def test_cancel_partial_order_resp_model(self): """ - get_dcp - Get DCP - /api/v1/hf/orders/dead-cancel-all/query + cancel_partial_order + Cancel Partial Order + /api/v1/hf/orders/cancel/{orderId} """ - data = "{\n \"code\": \"200000\",\n \"data\": {\n \"timeout\": 5,\n \"symbols\": \"BTC-USDT,ETH-USDT\",\n \"currentTime\": 1729241305,\n \"triggerTime\": 1729241308\n }\n}" + data = "{\n \"code\": \"200000\",\n \"data\": {\n \"orderId\": \"6711f73c1ef16c000717bb31\",\n \"cancelSize\": \"0.00001\"\n }\n}" common_response = RestResponse.from_json(data) - resp = GetDcpResp.from_dict(common_response.data) + resp = CancelPartialOrderResp.from_dict(common_response.data) def test_cancel_all_orders_by_symbol_req_model(self): """ @@ -320,81 +307,41 @@ def test_cancel_all_orders_by_symbol_resp_model(self): common_response = RestResponse.from_json(data) resp = CancelAllOrdersBySymbolResp.from_dict(common_response.data) - def test_get_closed_orders_req_model(self): + def test_cancel_all_orders_req_model(self): """ - get_closed_orders - Get Closed Orders - /api/v1/hf/orders/done + cancel_all_orders + Cancel All Orders + /api/v1/hf/orders/cancelAll """ - data = "{\"symbol\": \"BTC-USDT\", \"side\": \"buy\", \"type\": \"limit\", \"lastId\": 254062248624417, \"limit\": 20, \"startAt\": 1728663338000, \"endAt\": 1728692138000}" - req = GetClosedOrdersReq.from_json(data) - def test_get_closed_orders_resp_model(self): + def test_cancel_all_orders_resp_model(self): """ - get_closed_orders - Get Closed Orders - /api/v1/hf/orders/done + cancel_all_orders + Cancel All Orders + /api/v1/hf/orders/cancelAll """ - data = "{\n \"code\": \"200000\",\n \"data\": {\n \"lastId\": 19814995255305,\n \"items\": [\n {\n \"id\": \"6717422bd51c29000775ea03\",\n \"clientOid\": \"5c52e11203aa677f33e493fb\",\n \"symbol\": \"BTC-USDT\",\n \"opType\": \"DEAL\",\n \"type\": \"limit\",\n \"side\": \"buy\",\n \"price\": \"70000\",\n \"size\": \"0.00001\",\n \"funds\": \"0.7\",\n \"dealSize\": \"0.00001\",\n \"dealFunds\": \"0.677176\",\n \"remainSize\": \"0\",\n \"remainFunds\": \"0.022824\",\n \"cancelledSize\": \"0\",\n \"cancelledFunds\": \"0\",\n \"fee\": \"0.000677176\",\n \"feeCurrency\": \"USDT\",\n \"stp\": null,\n \"timeInForce\": \"GTC\",\n \"postOnly\": false,\n \"hidden\": false,\n \"iceberg\": false,\n \"visibleSize\": \"0\",\n \"cancelAfter\": 0,\n \"channel\": \"API\",\n \"remark\": \"order remarks\",\n \"tags\": null,\n \"cancelExist\": false,\n \"tradeType\": \"TRADE\",\n \"inOrderBook\": false,\n \"active\": false,\n \"tax\": \"0\",\n \"createdAt\": 1729577515444,\n \"lastUpdatedAt\": 1729577515481\n }\n ]\n }\n}" + data = "{\n \"code\": \"200000\",\n \"data\": {\n \"succeedSymbols\": [\n \"ETH-USDT\",\n \"BTC-USDT\"\n ],\n \"failedSymbols\": []\n }\n}" common_response = RestResponse.from_json(data) - resp = GetClosedOrdersResp.from_dict(common_response.data) + resp = CancelAllOrdersResp.from_dict(common_response.data) - def test_batch_add_orders_req_model(self): + def test_modify_order_req_model(self): """ - batch_add_orders - Batch Add Orders - /api/v1/hf/orders/multi - """ - data = "{\"orderList\": [{\"clientOid\": \"client order id 12\", \"symbol\": \"BTC-USDT\", \"type\": \"limit\", \"side\": \"buy\", \"price\": \"30000\", \"size\": \"0.00001\"}, {\"clientOid\": \"client order id 13\", \"symbol\": \"ETH-USDT\", \"type\": \"limit\", \"side\": \"sell\", \"price\": \"2000\", \"size\": \"0.00001\"}]}" - req = BatchAddOrdersReq.from_json(data) - - def test_batch_add_orders_resp_model(self): - """ - batch_add_orders - Batch Add Orders - /api/v1/hf/orders/multi - """ - data = "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"orderId\": \"6710d8336afcdb0007319c27\",\n \"clientOid\": \"client order id 12\",\n \"success\": true\n },\n {\n \"success\": false,\n \"failMsg\": \"The order funds should more then 0.1 USDT.\"\n }\n ]\n}" - common_response = RestResponse.from_json(data) - resp = BatchAddOrdersResp.from_dict(common_response.data) - - def test_batch_add_orders_sync_req_model(self): - """ - batch_add_orders_sync - Batch Add Orders Sync - /api/v1/hf/orders/multi/sync - """ - data = "{\"orderList\": [{\"clientOid\": \"client order id 13\", \"symbol\": \"BTC-USDT\", \"type\": \"limit\", \"side\": \"buy\", \"price\": \"30000\", \"size\": \"0.00001\"}, {\"clientOid\": \"client order id 14\", \"symbol\": \"ETH-USDT\", \"type\": \"limit\", \"side\": \"sell\", \"price\": \"2000\", \"size\": \"0.00001\"}]}" - req = BatchAddOrdersSyncReq.from_json(data) - - def test_batch_add_orders_sync_resp_model(self): - """ - batch_add_orders_sync - Batch Add Orders Sync - /api/v1/hf/orders/multi/sync - """ - data = "{\"code\":\"200000\",\"data\":[{\"orderId\":\"6711195e5584bc0007bd5aef\",\"clientOid\":\"client order id 13\",\"orderTime\":1729173854299,\"originSize\":\"0.00001\",\"dealSize\":\"0\",\"remainSize\":\"0.00001\",\"canceledSize\":\"0\",\"status\":\"open\",\"matchTime\":1729173854326,\"success\":true},{\"success\":false,\"failMsg\":\"The order funds should more then 0.1 USDT.\"}]}" - common_response = RestResponse.from_json(data) - resp = BatchAddOrdersSyncResp.from_dict(common_response.data) - - def test_cancel_order_by_order_id_req_model(self): - """ - cancel_order_by_order_id - Cancel Order By OrderId - /api/v1/hf/orders/{orderId} + modify_order + Modify Order + /api/v1/hf/orders/alter """ - data = "{\"orderId\": \"671124f9365ccb00073debd4\", \"symbol\": \"BTC-USDT\"}" - req = CancelOrderByOrderIdReq.from_json(data) + data = "{\"symbol\": \"BTC-USDT\", \"orderId\": \"670fd33bf9406e0007ab3945\", \"newPrice\": \"30000\", \"newSize\": \"0.0001\"}" + req = ModifyOrderReq.from_json(data) - def test_cancel_order_by_order_id_resp_model(self): + def test_modify_order_resp_model(self): """ - cancel_order_by_order_id - Cancel Order By OrderId - /api/v1/hf/orders/{orderId} + modify_order + Modify Order + /api/v1/hf/orders/alter """ - data = "{\n \"code\": \"200000\",\n \"data\": {\n \"orderId\": \"671124f9365ccb00073debd4\"\n }\n}" + data = "{\"code\":\"200000\",\"data\":{\"newOrderId\":\"67112258f9406e0007408827\",\"clientOid\":\"client order id 12\"}}" common_response = RestResponse.from_json(data) - resp = CancelOrderByOrderIdResp.from_dict(common_response.data) + resp = ModifyOrderResp.from_dict(common_response.data) def test_get_order_by_order_id_req_model(self): """ @@ -415,309 +362,191 @@ def test_get_order_by_order_id_resp_model(self): common_response = RestResponse.from_json(data) resp = GetOrderByOrderIdResp.from_dict(common_response.data) - def test_add_order_req_model(self): + def test_get_order_by_client_oid_req_model(self): """ - add_order - Add Order - /api/v1/hf/orders + get_order_by_client_oid + Get Order By ClientOid + /api/v1/hf/orders/client-order/{clientOid} """ - data = "{\"type\": \"limit\", \"symbol\": \"BTC-USDT\", \"side\": \"buy\", \"price\": \"50000\", \"size\": \"0.00001\", \"clientOid\": \"5c52e11203aa677f33e493fb\", \"remark\": \"order remarks\"}" - req = AddOrderReq.from_json(data) + data = "{\"symbol\": \"BTC-USDT\", \"clientOid\": \"5c52e11203aa677f33e493fb\"}" + req = GetOrderByClientOidReq.from_json(data) - def test_add_order_resp_model(self): + def test_get_order_by_client_oid_resp_model(self): """ - add_order - Add Order - /api/v1/hf/orders + get_order_by_client_oid + Get Order By ClientOid + /api/v1/hf/orders/client-order/{clientOid} """ - data = "{\"code\":\"200000\",\"data\":{\"orderId\":\"670fd33bf9406e0007ab3945\",\"clientOid\":\"5c52e11203aa677f33e493fb\"}}" + data = "{\n \"code\": \"200000\",\n \"data\": {\n \"id\": \"6717422bd51c29000775ea03\",\n \"clientOid\": \"5c52e11203aa677f33e493fb\",\n \"symbol\": \"BTC-USDT\",\n \"opType\": \"DEAL\",\n \"type\": \"limit\",\n \"side\": \"buy\",\n \"price\": \"70000\",\n \"size\": \"0.00001\",\n \"funds\": \"0.7\",\n \"dealSize\": \"0.00001\",\n \"dealFunds\": \"0.677176\",\n \"remainSize\": \"0\",\n \"remainFunds\": \"0.022824\",\n \"cancelledSize\": \"0\",\n \"cancelledFunds\": \"0\",\n \"fee\": \"0.000677176\",\n \"feeCurrency\": \"USDT\",\n \"stp\": null,\n \"timeInForce\": \"GTC\",\n \"postOnly\": false,\n \"hidden\": false,\n \"iceberg\": false,\n \"visibleSize\": \"0\",\n \"cancelAfter\": 0,\n \"channel\": \"API\",\n \"remark\": \"order remarks\",\n \"tags\": null,\n \"cancelExist\": false,\n \"tradeType\": \"TRADE\",\n \"inOrderBook\": false,\n \"active\": false,\n \"tax\": \"0\",\n \"createdAt\": 1729577515444,\n \"lastUpdatedAt\": 1729577515481\n }\n}" common_response = RestResponse.from_json(data) - resp = AddOrderResp.from_dict(common_response.data) + resp = GetOrderByClientOidResp.from_dict(common_response.data) - def test_cancel_order_by_client_oid_sync_req_model(self): + def test_get_symbols_with_open_order_req_model(self): """ - cancel_order_by_client_oid_sync - Cancel Order By ClientOid Sync - /api/v1/hf/orders/sync/client-order/{clientOid} + get_symbols_with_open_order + Get Symbols With Open Order + /api/v1/hf/orders/active/symbols """ - data = "{\"clientOid\": \"5c52e11203aa677f33e493fb\", \"symbol\": \"BTC-USDT\"}" - req = CancelOrderByClientOidSyncReq.from_json(data) - def test_cancel_order_by_client_oid_sync_resp_model(self): + def test_get_symbols_with_open_order_resp_model(self): """ - cancel_order_by_client_oid_sync - Cancel Order By ClientOid Sync - /api/v1/hf/orders/sync/client-order/{clientOid} + get_symbols_with_open_order + Get Symbols With Open Order + /api/v1/hf/orders/active/symbols """ - data = "{\n \"code\": \"200000\",\n \"data\": {\n \"clientOid\": \"5c52e11203aa677f33e493fb\",\n \"originSize\": \"0.00001\",\n \"dealSize\": \"0\",\n \"remainSize\": \"0\",\n \"canceledSize\": \"0.00001\",\n \"status\": \"done\"\n }\n}" + data = "{\n \"code\": \"200000\",\n \"data\": {\n \"symbols\": [\n \"ETH-USDT\",\n \"BTC-USDT\"\n ]\n }\n}" common_response = RestResponse.from_json(data) - resp = CancelOrderByClientOidSyncResp.from_dict(common_response.data) + resp = GetSymbolsWithOpenOrderResp.from_dict(common_response.data) - def test_cancel_order_by_order_id_sync_req_model(self): + def test_get_open_orders_req_model(self): """ - cancel_order_by_order_id_sync - Cancel Order By OrderId Sync - /api/v1/hf/orders/sync/{orderId} + get_open_orders + Get Open Orders + /api/v1/hf/orders/active """ - data = "{\"orderId\": \"671128ee365ccb0007534d45\", \"symbol\": \"BTC-USDT\"}" - req = CancelOrderByOrderIdSyncReq.from_json(data) + data = "{\"symbol\": \"BTC-USDT\"}" + req = GetOpenOrdersReq.from_json(data) - def test_cancel_order_by_order_id_sync_resp_model(self): + def test_get_open_orders_resp_model(self): """ - cancel_order_by_order_id_sync - Cancel Order By OrderId Sync - /api/v1/hf/orders/sync/{orderId} + get_open_orders + Get Open Orders + /api/v1/hf/orders/active """ - data = "{\n \"code\": \"200000\",\n \"data\": {\n \"orderId\": \"671128ee365ccb0007534d45\",\n \"originSize\": \"0.00001\",\n \"dealSize\": \"0\",\n \"remainSize\": \"0\",\n \"canceledSize\": \"0.00001\",\n \"status\": \"done\"\n }\n}" + data = "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"id\": \"67120bbef094e200070976f6\",\n \"clientOid\": \"5c52e11203aa677f33e493fb\",\n \"symbol\": \"BTC-USDT\",\n \"opType\": \"DEAL\",\n \"type\": \"limit\",\n \"side\": \"buy\",\n \"price\": \"50000\",\n \"size\": \"0.00001\",\n \"funds\": \"0.5\",\n \"dealSize\": \"0\",\n \"dealFunds\": \"0\",\n \"fee\": \"0\",\n \"feeCurrency\": \"USDT\",\n \"stp\": null,\n \"timeInForce\": \"GTC\",\n \"postOnly\": false,\n \"hidden\": false,\n \"iceberg\": false,\n \"visibleSize\": \"0\",\n \"cancelAfter\": 0,\n \"channel\": \"API\",\n \"remark\": \"order remarks\",\n \"tags\": \"order tags\",\n \"cancelExist\": false,\n \"tradeType\": \"TRADE\",\n \"inOrderBook\": true,\n \"cancelledSize\": \"0\",\n \"cancelledFunds\": \"0\",\n \"remainSize\": \"0.00001\",\n \"remainFunds\": \"0.5\",\n \"tax\": \"0\",\n \"active\": true,\n \"createdAt\": 1729235902748,\n \"lastUpdatedAt\": 1729235909862\n }\n ]\n}" common_response = RestResponse.from_json(data) - resp = CancelOrderByOrderIdSyncResp.from_dict(common_response.data) + resp = GetOpenOrdersResp.from_dict(common_response.data) - def test_add_order_sync_req_model(self): + def test_get_closed_orders_req_model(self): """ - add_order_sync - Add Order Sync - /api/v1/hf/orders/sync + get_closed_orders + Get Closed Orders + /api/v1/hf/orders/done """ - data = "{\"type\": \"limit\", \"symbol\": \"BTC-USDT\", \"side\": \"buy\", \"price\": \"50000\", \"size\": \"0.00001\", \"clientOid\": \"5c52e11203aa677f33e493f\", \"remark\": \"order remarks\"}" - req = AddOrderSyncReq.from_json(data) + data = "{\"symbol\": \"BTC-USDT\", \"side\": \"buy\", \"type\": \"limit\", \"lastId\": 254062248624417, \"limit\": 20, \"startAt\": 1728663338000, \"endAt\": 1728692138000}" + req = GetClosedOrdersReq.from_json(data) - def test_add_order_sync_resp_model(self): + def test_get_closed_orders_resp_model(self): """ - add_order_sync - Add Order Sync - /api/v1/hf/orders/sync + get_closed_orders + Get Closed Orders + /api/v1/hf/orders/done """ - data = "{\"code\":\"200000\",\"data\":{\"orderId\":\"67111a7cb7cbdf000703e1f6\",\"clientOid\":\"5c52e11203aa677f33e493f\",\"orderTime\":1729174140586,\"originSize\":\"0.00001\",\"dealSize\":\"0\",\"remainSize\":\"0.00001\",\"canceledSize\":\"0\",\"status\":\"open\",\"matchTime\":1729174140588}}" + data = "{\n \"code\": \"200000\",\n \"data\": {\n \"lastId\": 19814995255305,\n \"items\": [\n {\n \"id\": \"6717422bd51c29000775ea03\",\n \"clientOid\": \"5c52e11203aa677f33e493fb\",\n \"symbol\": \"BTC-USDT\",\n \"opType\": \"DEAL\",\n \"type\": \"limit\",\n \"side\": \"buy\",\n \"price\": \"70000\",\n \"size\": \"0.00001\",\n \"funds\": \"0.7\",\n \"dealSize\": \"0.00001\",\n \"dealFunds\": \"0.677176\",\n \"remainSize\": \"0\",\n \"remainFunds\": \"0.022824\",\n \"cancelledSize\": \"0\",\n \"cancelledFunds\": \"0\",\n \"fee\": \"0.000677176\",\n \"feeCurrency\": \"USDT\",\n \"stp\": null,\n \"timeInForce\": \"GTC\",\n \"postOnly\": false,\n \"hidden\": false,\n \"iceberg\": false,\n \"visibleSize\": \"0\",\n \"cancelAfter\": 0,\n \"channel\": \"API\",\n \"remark\": \"order remarks\",\n \"tags\": null,\n \"cancelExist\": false,\n \"tradeType\": \"TRADE\",\n \"inOrderBook\": false,\n \"active\": false,\n \"tax\": \"0\",\n \"createdAt\": 1729577515444,\n \"lastUpdatedAt\": 1729577515481\n }\n ]\n }\n}" common_response = RestResponse.from_json(data) - resp = AddOrderSyncResp.from_dict(common_response.data) + resp = GetClosedOrdersResp.from_dict(common_response.data) - def test_add_order_test_req_model(self): + def test_get_trade_history_req_model(self): """ - add_order_test - Add Order Test - /api/v1/hf/orders/test + get_trade_history + Get Trade History + /api/v1/hf/fills """ - data = "{\"type\": \"limit\", \"symbol\": \"BTC-USDT\", \"side\": \"buy\", \"price\": \"50000\", \"size\": \"0.00001\", \"clientOid\": \"5c52e11203aa677f33e493f\", \"remark\": \"order remarks\"}" - req = AddOrderTestReq.from_json(data) + data = "{\"symbol\": \"BTC-USDT\", \"orderId\": \"example_string_default_value\", \"side\": \"buy\", \"type\": \"limit\", \"lastId\": 254062248624417, \"limit\": 100, \"startAt\": 1728663338000, \"endAt\": 1728692138000}" + req = GetTradeHistoryReq.from_json(data) - def test_add_order_test_resp_model(self): + def test_get_trade_history_resp_model(self): """ - add_order_test - Add Order Test - /api/v1/hf/orders/test + get_trade_history + Get Trade History + /api/v1/hf/fills """ - data = "{\"code\":\"200000\",\"data\":{\"orderId\":\"670fd33bf9406e0007ab3945\",\"clientOid\":\"5c52e11203aa677f33e493fb\"}}" + data = "{\n \"code\": \"200000\",\n \"data\": {\n \"items\": [\n {\n \"id\": 19814995255305,\n \"orderId\": \"6717422bd51c29000775ea03\",\n \"counterOrderId\": \"67174228135f9e000709da8c\",\n \"tradeId\": 11029373945659392,\n \"symbol\": \"BTC-USDT\",\n \"side\": \"buy\",\n \"liquidity\": \"taker\",\n \"type\": \"limit\",\n \"forceTaker\": false,\n \"price\": \"67717.6\",\n \"size\": \"0.00001\",\n \"funds\": \"0.677176\",\n \"fee\": \"0.000677176\",\n \"feeRate\": \"0.001\",\n \"feeCurrency\": \"USDT\",\n \"stop\": \"\",\n \"tradeType\": \"TRADE\",\n \"taxRate\": \"0\",\n \"tax\": \"0\",\n \"createdAt\": 1729577515473\n }\n ],\n \"lastId\": 19814995255305\n }\n}" common_response = RestResponse.from_json(data) - resp = AddOrderTestResp.from_dict(common_response.data) + resp = GetTradeHistoryResp.from_dict(common_response.data) - def test_get_recent_trade_history_old_req_model(self): + def test_get_dcp_req_model(self): """ - get_recent_trade_history_old - Get Recent Trade History - Old - /api/v1/limit/fills + get_dcp + Get DCP + /api/v1/hf/orders/dead-cancel-all/query """ - data = "{\"currentPage\": 1, \"pageSize\": 50}" - req = GetRecentTradeHistoryOldReq.from_json(data) - def test_get_recent_trade_history_old_resp_model(self): + def test_get_dcp_resp_model(self): """ - get_recent_trade_history_old - Get Recent Trade History - Old - /api/v1/limit/fills + get_dcp + Get DCP + /api/v1/hf/orders/dead-cancel-all/query """ - data = "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"symbol\": \"BTC-USDT\",\n \"tradeId\": \"11732720444522497\",\n \"orderId\": \"674aab24754b1e00077dbc69\",\n \"counterOrderId\": \"674aab1fb26bfb0007a18b67\",\n \"side\": \"buy\",\n \"liquidity\": \"taker\",\n \"forceTaker\": false,\n \"price\": \"96999.6\",\n \"size\": \"0.00001\",\n \"funds\": \"0.969996\",\n \"fee\": \"0.000969996\",\n \"feeRate\": \"0.001\",\n \"feeCurrency\": \"USDT\",\n \"stop\": \"\",\n \"tradeType\": \"TRADE\",\n \"type\": \"limit\",\n \"createdAt\": 1732946724082\n }\n ]\n}" + data = "{\n \"code\": \"200000\",\n \"data\": {\n \"timeout\": 5,\n \"symbols\": \"BTC-USDT,ETH-USDT\",\n \"currentTime\": 1729241305,\n \"triggerTime\": 1729241308\n }\n}" common_response = RestResponse.from_json(data) - resp = GetRecentTradeHistoryOldResp.from_dict(common_response.data) + resp = GetDcpResp.from_dict(common_response.data) - def test_get_recent_orders_list_old_req_model(self): + def test_set_dcp_req_model(self): """ - get_recent_orders_list_old - Get Recent Orders List - Old - /api/v1/limit/orders + set_dcp + Set DCP + /api/v1/hf/orders/dead-cancel-all """ - data = "{\"currentPage\": 1, \"pageSize\": 50}" - req = GetRecentOrdersListOldReq.from_json(data) + data = "{\"timeout\": 5, \"symbols\": \"BTC-USDT,ETH-USDT\"}" + req = SetDcpReq.from_json(data) - def test_get_recent_orders_list_old_resp_model(self): + def test_set_dcp_resp_model(self): """ - get_recent_orders_list_old - Get Recent Orders List - Old - /api/v1/limit/orders + set_dcp + Set DCP + /api/v1/hf/orders/dead-cancel-all """ - data = "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"id\": \"674a9a872033a50007e2790d\",\n \"symbol\": \"BTC-USDT\",\n \"opType\": \"DEAL\",\n \"type\": \"limit\",\n \"side\": \"buy\",\n \"price\": \"50000\",\n \"size\": \"0.00001\",\n \"funds\": \"0\",\n \"dealFunds\": \"0\",\n \"dealSize\": \"0\",\n \"fee\": \"0\",\n \"feeCurrency\": \"USDT\",\n \"stp\": \"\",\n \"stop\": \"\",\n \"stopTriggered\": false,\n \"stopPrice\": \"0\",\n \"timeInForce\": \"GTC\",\n \"postOnly\": false,\n \"hidden\": false,\n \"iceberg\": false,\n \"visibleSize\": \"0\",\n \"cancelAfter\": 0,\n \"channel\": \"API\",\n \"clientOid\": \"5c52e11203aa677f33e4923fb\",\n \"remark\": \"order remarks\",\n \"tags\": null,\n \"isActive\": false,\n \"cancelExist\": true,\n \"createdAt\": 1732942471752,\n \"tradeType\": \"TRADE\"\n }\n ]\n}" + data = "{\"code\":\"200000\",\"data\":{\"currentTime\":1729656588,\"triggerTime\":1729656593}}" common_response = RestResponse.from_json(data) - resp = GetRecentOrdersListOldResp.from_dict(common_response.data) + resp = SetDcpResp.from_dict(common_response.data) - def test_cancel_order_by_client_oid_old_req_model(self): + def test_add_stop_order_req_model(self): """ - cancel_order_by_client_oid_old - Cancel Order By ClientOid - Old - /api/v1/order/client-order/{clientOid} + add_stop_order + Add Stop Order + /api/v1/stop-order """ - data = "{\"symbol\": \"BTC-USDT\", \"clientOid\": \"5c52e11203aa677f33e4923fb\"}" - req = CancelOrderByClientOidOldReq.from_json(data) + data = "{\"type\": \"limit\", \"symbol\": \"BTC-USDT\", \"side\": \"buy\", \"price\": \"50000\", \"size\": \"0.00001\", \"clientOid\": \"5c52e11203aa677f33e493fb\", \"remark\": \"order remarks\"}" + req = AddStopOrderReq.from_json(data) - def test_cancel_order_by_client_oid_old_resp_model(self): + def test_add_stop_order_resp_model(self): """ - cancel_order_by_client_oid_old - Cancel Order By ClientOid - Old - /api/v1/order/client-order/{clientOid} + add_stop_order + Add Stop Order + /api/v1/stop-order """ - data = "{\n \"code\": \"200000\",\n \"data\": {\n \"cancelledOrderId\": \"674a9a872033a50007e2790d\",\n \"clientOid\": \"5c52e11203aa677f33e4923fb\",\n \"cancelledOcoOrderIds\": null\n }\n}" + data = "{\"code\":\"200000\",\"data\":{\"orderId\":\"670fd33bf9406e0007ab3945\",\"clientOid\":\"5c52e11203aa677f33e493fb\"}}" common_response = RestResponse.from_json(data) - resp = CancelOrderByClientOidOldResp.from_dict(common_response.data) + resp = AddStopOrderResp.from_dict(common_response.data) - def test_get_order_by_client_oid_old_req_model(self): + def test_cancel_stop_order_by_client_oid_req_model(self): """ - get_order_by_client_oid_old - Get Order By ClientOid - Old - /api/v1/order/client-order/{clientOid} + cancel_stop_order_by_client_oid + Cancel Stop Order By ClientOid + /api/v1/stop-order/cancelOrderByClientOid """ - data = "{\"clientOid\": \"3d07008668054da6b3cb12e432c2b13a\"}" - req = GetOrderByClientOidOldReq.from_json(data) - - def test_get_order_by_client_oid_old_resp_model(self): - """ - get_order_by_client_oid_old - Get Order By ClientOid - Old - /api/v1/order/client-order/{clientOid} - """ - data = "{\n \"code\": \"200000\",\n \"data\": {\n \"id\": \"674a97dfef434f0007efc431\",\n \"symbol\": \"BTC-USDT\",\n \"opType\": \"DEAL\",\n \"type\": \"limit\",\n \"side\": \"buy\",\n \"price\": \"50000\",\n \"size\": \"0.0001\",\n \"funds\": \"0\",\n \"dealFunds\": \"0\",\n \"dealSize\": \"0\",\n \"fee\": \"0\",\n \"feeCurrency\": \"USDT\",\n \"stp\": \"\",\n \"stop\": \"\",\n \"stopTriggered\": false,\n \"stopPrice\": \"0\",\n \"timeInForce\": \"GTC\",\n \"postOnly\": false,\n \"hidden\": false,\n \"iceberg\": false,\n \"visibleSize\": \"0\",\n \"cancelAfter\": 0,\n \"channel\": \"API\",\n \"clientOid\": \"3d07008668054da6b3cb12e432c2b13a\",\n \"remark\": null,\n \"tags\": null,\n \"isActive\": false,\n \"cancelExist\": true,\n \"createdAt\": 1732941791518,\n \"tradeType\": \"TRADE\"\n }\n}" - common_response = RestResponse.from_json(data) - resp = GetOrderByClientOidOldResp.from_dict(common_response.data) - - def test_batch_cancel_order_old_req_model(self): - """ - batch_cancel_order_old - Batch Cancel Order - Old - /api/v1/orders - """ - data = "{\"symbol\": \"BTC-USDT\", \"tradeType\": \"TRADE\"}" - req = BatchCancelOrderOldReq.from_json(data) - - def test_batch_cancel_order_old_resp_model(self): - """ - batch_cancel_order_old - Batch Cancel Order - Old - /api/v1/orders - """ - data = "{\n \"code\": \"200000\",\n \"data\": {\n \"cancelledOrderIds\": [\n \"674a8635b38d120007709c0f\",\n \"674a8630439c100007d3bce1\"\n ]\n }\n}" - common_response = RestResponse.from_json(data) - resp = BatchCancelOrderOldResp.from_dict(common_response.data) - - def test_get_orders_list_old_req_model(self): - """ - get_orders_list_old - Get Orders List - Old - /api/v1/orders - """ - data = "{\"symbol\": \"BTC-USDT\", \"status\": \"active\", \"side\": \"buy\", \"type\": \"limit\", \"tradeType\": \"TRADE\", \"startAt\": 123456, \"endAt\": 123456, \"currentPage\": 1, \"pageSize\": 50}" - req = GetOrdersListOldReq.from_json(data) - - def test_get_orders_list_old_resp_model(self): - """ - get_orders_list_old - Get Orders List - Old - /api/v1/orders - """ - data = "{\n \"code\": \"200000\",\n \"data\": {\n \"currentPage\": 1,\n \"pageSize\": 50,\n \"totalNum\": 1,\n \"totalPage\": 1,\n \"items\": [\n {\n \"id\": \"674a9a872033a50007e2790d\",\n \"symbol\": \"BTC-USDT\",\n \"opType\": \"DEAL\",\n \"type\": \"limit\",\n \"side\": \"buy\",\n \"price\": \"50000\",\n \"size\": \"0.00001\",\n \"funds\": \"0\",\n \"dealFunds\": \"0\",\n \"dealSize\": \"0\",\n \"fee\": \"0\",\n \"feeCurrency\": \"USDT\",\n \"stp\": \"\",\n \"stop\": \"\",\n \"stopTriggered\": false,\n \"stopPrice\": \"0\",\n \"timeInForce\": \"GTC\",\n \"postOnly\": false,\n \"hidden\": false,\n \"iceberg\": false,\n \"visibleSize\": \"0\",\n \"cancelAfter\": 0,\n \"channel\": \"API\",\n \"clientOid\": \"5c52e11203aa677f33e4923fb\",\n \"remark\": \"order remarks\",\n \"tags\": null,\n \"isActive\": false,\n \"cancelExist\": true,\n \"createdAt\": 1732942471752,\n \"tradeType\": \"TRADE\"\n }\n ]\n }\n}" - common_response = RestResponse.from_json(data) - resp = GetOrdersListOldResp.from_dict(common_response.data) - - def test_batch_add_orders_old_req_model(self): - """ - batch_add_orders_old - Batch Add Orders - Old - /api/v1/orders/multi - """ - data = "{\"symbol\": \"BTC-USDT\", \"orderList\": [{\"clientOid\": \"3d07008668054da6b3cb12e432c2b13a\", \"side\": \"buy\", \"type\": \"limit\", \"price\": \"50000\", \"size\": \"0.0001\"}, {\"clientOid\": \"37245dbe6e134b5c97732bfb36cd4a9d\", \"side\": \"buy\", \"type\": \"limit\", \"price\": \"49999\", \"size\": \"0.0001\"}]}" - req = BatchAddOrdersOldReq.from_json(data) - - def test_batch_add_orders_old_resp_model(self): - """ - batch_add_orders_old - Batch Add Orders - Old - /api/v1/orders/multi - """ - data = "{\n \"code\": \"200000\",\n \"data\": {\n \"data\": [\n {\n \"symbol\": \"BTC-USDT\",\n \"type\": \"limit\",\n \"side\": \"buy\",\n \"price\": \"50000\",\n \"size\": \"0.0001\",\n \"funds\": null,\n \"stp\": \"\",\n \"stop\": \"\",\n \"stopPrice\": null,\n \"timeInForce\": \"GTC\",\n \"cancelAfter\": 0,\n \"postOnly\": false,\n \"hidden\": false,\n \"iceberge\": false,\n \"iceberg\": false,\n \"visibleSize\": null,\n \"channel\": \"API\",\n \"id\": \"674a97dfef434f0007efc431\",\n \"status\": \"success\",\n \"failMsg\": null,\n \"clientOid\": \"3d07008668054da6b3cb12e432c2b13a\"\n },\n {\n \"symbol\": \"BTC-USDT\",\n \"type\": \"limit\",\n \"side\": \"buy\",\n \"price\": \"49999\",\n \"size\": \"0.0001\",\n \"funds\": null,\n \"stp\": \"\",\n \"stop\": \"\",\n \"stopPrice\": null,\n \"timeInForce\": \"GTC\",\n \"cancelAfter\": 0,\n \"postOnly\": false,\n \"hidden\": false,\n \"iceberge\": false,\n \"iceberg\": false,\n \"visibleSize\": null,\n \"channel\": \"API\",\n \"id\": \"674a97dffb378b00077b9c20\",\n \"status\": \"fail\",\n \"failMsg\": \"Balance insufficient!\",\n \"clientOid\": \"37245dbe6e134b5c97732bfb36cd4a9d\"\n }\n ]\n }\n}" - common_response = RestResponse.from_json(data) - resp = BatchAddOrdersOldResp.from_dict(common_response.data) - - def test_cancel_order_by_order_id_old_req_model(self): - """ - cancel_order_by_order_id_old - Cancel Order By OrderId - Old - /api/v1/orders/{orderId} - """ - data = "{\"symbol\": \"BTC-USDT\", \"orderId\": \"674a97dfef434f0007efc431\"}" - req = CancelOrderByOrderIdOldReq.from_json(data) - - def test_cancel_order_by_order_id_old_resp_model(self): - """ - cancel_order_by_order_id_old - Cancel Order By OrderId - Old - /api/v1/orders/{orderId} - """ - data = "{\n \"code\": \"200000\",\n \"data\": {\n \"cancelledOrderIds\": [\n \"674a97dfef434f0007efc431\"\n ]\n }\n}" - common_response = RestResponse.from_json(data) - resp = CancelOrderByOrderIdOldResp.from_dict(common_response.data) - - def test_get_order_by_order_id_old_req_model(self): - """ - get_order_by_order_id_old - Get Order By OrderId - Old - /api/v1/orders/{orderId} - """ - data = "{\"orderId\": \"674a97dfef434f0007efc431\"}" - req = GetOrderByOrderIdOldReq.from_json(data) - - def test_get_order_by_order_id_old_resp_model(self): - """ - get_order_by_order_id_old - Get Order By OrderId - Old - /api/v1/orders/{orderId} - """ - data = "{\n \"code\": \"200000\",\n \"data\": {\n \"id\": \"674a97dfef434f0007efc431\",\n \"symbol\": \"BTC-USDT\",\n \"opType\": \"DEAL\",\n \"type\": \"limit\",\n \"side\": \"buy\",\n \"price\": \"50000\",\n \"size\": \"0.0001\",\n \"funds\": \"0\",\n \"dealFunds\": \"0\",\n \"dealSize\": \"0\",\n \"fee\": \"0\",\n \"feeCurrency\": \"USDT\",\n \"stp\": \"\",\n \"stop\": \"\",\n \"stopTriggered\": false,\n \"stopPrice\": \"0\",\n \"timeInForce\": \"GTC\",\n \"postOnly\": false,\n \"hidden\": false,\n \"iceberg\": false,\n \"visibleSize\": \"0\",\n \"cancelAfter\": 0,\n \"channel\": \"API\",\n \"clientOid\": \"3d07008668054da6b3cb12e432c2b13a\",\n \"remark\": null,\n \"tags\": null,\n \"isActive\": false,\n \"cancelExist\": true,\n \"createdAt\": 1732941791518,\n \"tradeType\": \"TRADE\"\n }\n}" - common_response = RestResponse.from_json(data) - resp = GetOrderByOrderIdOldResp.from_dict(common_response.data) - - def test_add_order_old_req_model(self): - """ - add_order_old - Add Order - Old - /api/v1/orders - """ - data = "{\"type\": \"limit\", \"symbol\": \"BTC-USDT\", \"side\": \"buy\", \"price\": \"50000\", \"size\": \"0.00001\", \"clientOid\": \"5c52e11203aa677f33e493fb\", \"remark\": \"order remarks\"}" - req = AddOrderOldReq.from_json(data) + data = "{\"symbol\": \"BTC-USDT\", \"clientOid\": \"689ff597f4414061aa819cc414836abd\"}" + req = CancelStopOrderByClientOidReq.from_json(data) - def test_add_order_old_resp_model(self): + def test_cancel_stop_order_by_client_oid_resp_model(self): """ - add_order_old - Add Order - Old - /api/v1/orders + cancel_stop_order_by_client_oid + Cancel Stop Order By ClientOid + /api/v1/stop-order/cancelOrderByClientOid """ - data = "{\n \"code\": \"200000\",\n \"data\": {\n \"orderId\": \"674a8635b38d120007709c0f\"\n }\n}" + data = "{\n \"code\": \"200000\",\n \"data\": {\n \"cancelledOrderId\": \"vs8hoo8ksc8mario0035a74n\",\n \"clientOid\": \"689ff597f4414061aa819cc414836abd\"\n }\n}" common_response = RestResponse.from_json(data) - resp = AddOrderOldResp.from_dict(common_response.data) + resp = CancelStopOrderByClientOidResp.from_dict(common_response.data) - def test_add_order_test_old_req_model(self): + def test_cancel_stop_order_by_order_id_req_model(self): """ - add_order_test_old - Add Order Test - Old - /api/v1/orders/test + cancel_stop_order_by_order_id + Cancel Stop Order By OrderId + /api/v1/stop-order/{orderId} """ - data = "{\"type\": \"limit\", \"symbol\": \"BTC-USDT\", \"side\": \"buy\", \"price\": \"50000\", \"size\": \"0.00001\", \"clientOid\": \"5c52e11203aa677f33e493fb\", \"remark\": \"order remarks\"}" - req = AddOrderTestOldReq.from_json(data) + data = "{\"orderId\": \"671124f9365ccb00073debd4\"}" + req = CancelStopOrderByOrderIdReq.from_json(data) - def test_add_order_test_old_resp_model(self): + def test_cancel_stop_order_by_order_id_resp_model(self): """ - add_order_test_old - Add Order Test - Old - /api/v1/orders/test + cancel_stop_order_by_order_id + Cancel Stop Order By OrderId + /api/v1/stop-order/{orderId} """ - data = "{\n \"code\": \"200000\",\n \"data\": {\n \"orderId\": \"674a8776291d9e00074f1edf\"\n }\n}" + data = "{\n \"code\": \"200000\",\n \"data\": {\n \"cancelledOrderIds\": [\n \"671124f9365ccb00073debd4\"\n ]\n }\n}" common_response = RestResponse.from_json(data) - resp = AddOrderTestOldResp.from_dict(common_response.data) + resp = CancelStopOrderByOrderIdResp.from_dict(common_response.data) def test_batch_cancel_stop_order_req_model(self): """ @@ -738,25 +567,6 @@ def test_batch_cancel_stop_order_resp_model(self): common_response = RestResponse.from_json(data) resp = BatchCancelStopOrderResp.from_dict(common_response.data) - def test_cancel_stop_order_by_client_oid_req_model(self): - """ - cancel_stop_order_by_client_oid - Cancel Stop Order By ClientOid - /api/v1/stop-order/cancelOrderByClientOid - """ - data = "{\"symbol\": \"BTC-USDT\", \"clientOid\": \"689ff597f4414061aa819cc414836abd\"}" - req = CancelStopOrderByClientOidReq.from_json(data) - - def test_cancel_stop_order_by_client_oid_resp_model(self): - """ - cancel_stop_order_by_client_oid - Cancel Stop Order By ClientOid - /api/v1/stop-order/cancelOrderByClientOid - """ - data = "{\n \"code\": \"200000\",\n \"data\": {\n \"cancelledOrderId\": \"vs8hoo8ksc8mario0035a74n\",\n \"clientOid\": \"689ff597f4414061aa819cc414836abd\"\n }\n}" - common_response = RestResponse.from_json(data) - resp = CancelStopOrderByClientOidResp.from_dict(common_response.data) - def test_get_stop_orders_list_req_model(self): """ get_stop_orders_list @@ -776,25 +586,6 @@ def test_get_stop_orders_list_resp_model(self): common_response = RestResponse.from_json(data) resp = GetStopOrdersListResp.from_dict(common_response.data) - def test_cancel_stop_order_by_order_id_req_model(self): - """ - cancel_stop_order_by_order_id - Cancel Stop Order By OrderId - /api/v1/stop-order/{orderId} - """ - data = "{\"orderId\": \"671124f9365ccb00073debd4\"}" - req = CancelStopOrderByOrderIdReq.from_json(data) - - def test_cancel_stop_order_by_order_id_resp_model(self): - """ - cancel_stop_order_by_order_id - Cancel Stop Order By OrderId - /api/v1/stop-order/{orderId} - """ - data = "{\n \"code\": \"200000\",\n \"data\": {\n \"cancelledOrderIds\": [\n \"671124f9365ccb00073debd4\"\n ]\n }\n}" - common_response = RestResponse.from_json(data) - resp = CancelStopOrderByOrderIdResp.from_dict(common_response.data) - def test_get_stop_order_by_order_id_req_model(self): """ get_stop_order_by_order_id @@ -814,25 +605,6 @@ def test_get_stop_order_by_order_id_resp_model(self): common_response = RestResponse.from_json(data) resp = GetStopOrderByOrderIdResp.from_dict(common_response.data) - def test_add_stop_order_req_model(self): - """ - add_stop_order - Add Stop Order - /api/v1/stop-order - """ - data = "{\"type\": \"limit\", \"symbol\": \"BTC-USDT\", \"side\": \"buy\", \"price\": \"50000\", \"size\": \"0.00001\", \"clientOid\": \"5c52e11203aa677f33e493fb\", \"remark\": \"order remarks\"}" - req = AddStopOrderReq.from_json(data) - - def test_add_stop_order_resp_model(self): - """ - add_stop_order - Add Stop Order - /api/v1/stop-order - """ - data = "{\"code\":\"200000\",\"data\":{\"orderId\":\"670fd33bf9406e0007ab3945\",\"clientOid\":\"5c52e11203aa677f33e493fb\"}}" - common_response = RestResponse.from_json(data) - resp = AddStopOrderResp.from_dict(common_response.data) - def test_get_stop_order_by_client_oid_req_model(self): """ get_stop_order_by_client_oid @@ -852,6 +624,44 @@ def test_get_stop_order_by_client_oid_resp_model(self): common_response = RestResponse.from_json(data) resp = GetStopOrderByClientOidResp.from_dict(common_response.data) + def test_add_oco_order_req_model(self): + """ + add_oco_order + Add OCO Order + /api/v3/oco/order + """ + data = "{\"symbol\": \"BTC-USDT\", \"side\": \"buy\", \"price\": \"94000\", \"size\": \"0.1\", \"clientOid\": \"5c52e11203aa67f1e493fb\", \"stopPrice\": \"98000\", \"limitPrice\": \"96000\", \"remark\": \"this is remark\", \"tradeType\": \"TRADE\"}" + req = AddOcoOrderReq.from_json(data) + + def test_add_oco_order_resp_model(self): + """ + add_oco_order + Add OCO Order + /api/v3/oco/order + """ + data = "{\"code\":\"200000\",\"data\":{\"orderId\":\"674c316e688dea0007c7b986\"}}" + common_response = RestResponse.from_json(data) + resp = AddOcoOrderResp.from_dict(common_response.data) + + def test_cancel_oco_order_by_order_id_req_model(self): + """ + cancel_oco_order_by_order_id + Cancel OCO Order By OrderId + /api/v3/oco/order/{orderId} + """ + data = "{\"orderId\": \"674c316e688dea0007c7b986\"}" + req = CancelOcoOrderByOrderIdReq.from_json(data) + + def test_cancel_oco_order_by_order_id_resp_model(self): + """ + cancel_oco_order_by_order_id + Cancel OCO Order By OrderId + /api/v3/oco/order/{orderId} + """ + data = "{\n \"code\": \"200000\",\n \"data\": {\n \"cancelledOrderIds\": [\n \"vs93gpqc6kkmkk57003gok16\",\n \"vs93gpqc6kkmkk57003gok17\"\n ]\n }\n}" + common_response = RestResponse.from_json(data) + resp = CancelOcoOrderByOrderIdResp.from_dict(common_response.data) + def test_cancel_oco_order_by_client_oid_req_model(self): """ cancel_oco_order_by_client_oid @@ -871,14 +681,52 @@ def test_cancel_oco_order_by_client_oid_resp_model(self): common_response = RestResponse.from_json(data) resp = CancelOcoOrderByClientOidResp.from_dict(common_response.data) - def test_get_oco_order_by_client_oid_req_model(self): + def test_batch_cancel_oco_orders_req_model(self): """ - get_oco_order_by_client_oid - Get OCO Order By ClientOid - /api/v3/oco/client-order/{clientOid} + batch_cancel_oco_orders + Batch Cancel OCO Order + /api/v3/oco/orders """ - data = "{\"clientOid\": \"5c52e1203aa6f3g7f1e493fb\"}" - req = GetOcoOrderByClientOidReq.from_json(data) + data = "{\"orderIds\": \"674c388172cf2800072ee746,674c38bdfd8300000795167e\", \"symbol\": \"BTC-USDT\"}" + req = BatchCancelOcoOrdersReq.from_json(data) + + def test_batch_cancel_oco_orders_resp_model(self): + """ + batch_cancel_oco_orders + Batch Cancel OCO Order + /api/v3/oco/orders + """ + data = "{\n \"code\": \"200000\",\n \"data\": {\n \"cancelledOrderIds\": [\n \"vs93gpqc750mkk57003gok6i\",\n \"vs93gpqc750mkk57003gok6j\",\n \"vs93gpqc75c39p83003tnriu\",\n \"vs93gpqc75c39p83003tnriv\"\n ]\n }\n}" + common_response = RestResponse.from_json(data) + resp = BatchCancelOcoOrdersResp.from_dict(common_response.data) + + def test_get_oco_order_by_order_id_req_model(self): + """ + get_oco_order_by_order_id + Get OCO Order By OrderId + /api/v3/oco/order/{orderId} + """ + data = "{\"orderId\": \"674c3b6e688dea0007c7bab2\"}" + req = GetOcoOrderByOrderIdReq.from_json(data) + + def test_get_oco_order_by_order_id_resp_model(self): + """ + get_oco_order_by_order_id + Get OCO Order By OrderId + /api/v3/oco/order/{orderId} + """ + data = "{\n \"code\": \"200000\",\n \"data\": {\n \"orderId\": \"674c3b6e688dea0007c7bab2\",\n \"symbol\": \"BTC-USDT\",\n \"clientOid\": \"5c52e1203aa6f37f1e493fb\",\n \"orderTime\": 1733049198863,\n \"status\": \"NEW\"\n }\n}" + common_response = RestResponse.from_json(data) + resp = GetOcoOrderByOrderIdResp.from_dict(common_response.data) + + def test_get_oco_order_by_client_oid_req_model(self): + """ + get_oco_order_by_client_oid + Get OCO Order By ClientOid + /api/v3/oco/client-order/{clientOid} + """ + data = "{\"clientOid\": \"5c52e1203aa6f3g7f1e493fb\"}" + req = GetOcoOrderByClientOidReq.from_json(data) def test_get_oco_order_by_client_oid_resp_model(self): """ @@ -909,97 +757,249 @@ def test_get_oco_order_detail_by_order_id_resp_model(self): common_response = RestResponse.from_json(data) resp = GetOcoOrderDetailByOrderIdResp.from_dict(common_response.data) - def test_cancel_oco_order_by_order_id_req_model(self): + def test_get_oco_order_list_req_model(self): """ - cancel_oco_order_by_order_id - Cancel OCO Order By OrderId - /api/v3/oco/order/{orderId} + get_oco_order_list + Get OCO Order List + /api/v3/oco/orders """ - data = "{\"orderId\": \"674c316e688dea0007c7b986\"}" - req = CancelOcoOrderByOrderIdReq.from_json(data) + data = "{\"symbol\": \"BTC-USDT\", \"startAt\": 123456, \"endAt\": 123456, \"orderIds\": \"example_string_default_value\", \"pageSize\": 50, \"currentPage\": 1}" + req = GetOcoOrderListReq.from_json(data) - def test_cancel_oco_order_by_order_id_resp_model(self): + def test_get_oco_order_list_resp_model(self): """ - cancel_oco_order_by_order_id - Cancel OCO Order By OrderId - /api/v3/oco/order/{orderId} + get_oco_order_list + Get OCO Order List + /api/v3/oco/orders """ - data = "{\n \"code\": \"200000\",\n \"data\": {\n \"cancelledOrderIds\": [\n \"vs93gpqc6kkmkk57003gok16\",\n \"vs93gpqc6kkmkk57003gok17\"\n ]\n }\n}" + data = "{\n \"code\": \"200000\",\n \"data\": {\n \"currentPage\": 1,\n \"pageSize\": 50,\n \"totalNum\": 1,\n \"totalPage\": 1,\n \"items\": [\n {\n \"orderId\": \"674c3cfa72cf2800072ee7ce\",\n \"symbol\": \"BTC-USDT\",\n \"clientOid\": \"5c52e1203aa6f3g7f1e493fb\",\n \"orderTime\": 1733049594803,\n \"status\": \"NEW\"\n }\n ]\n }\n}" common_response = RestResponse.from_json(data) - resp = CancelOcoOrderByOrderIdResp.from_dict(common_response.data) + resp = GetOcoOrderListResp.from_dict(common_response.data) - def test_get_oco_order_by_order_id_req_model(self): + def test_add_order_old_req_model(self): """ - get_oco_order_by_order_id - Get OCO Order By OrderId - /api/v3/oco/order/{orderId} + add_order_old + Add Order - Old + /api/v1/orders """ - data = "{\"orderId\": \"674c3b6e688dea0007c7bab2\"}" - req = GetOcoOrderByOrderIdReq.from_json(data) + data = "{\"type\": \"limit\", \"symbol\": \"BTC-USDT\", \"side\": \"buy\", \"price\": \"50000\", \"size\": \"0.00001\", \"clientOid\": \"5c52e11203aa677f33e493fb\", \"remark\": \"order remarks\"}" + req = AddOrderOldReq.from_json(data) - def test_get_oco_order_by_order_id_resp_model(self): + def test_add_order_old_resp_model(self): """ - get_oco_order_by_order_id - Get OCO Order By OrderId - /api/v3/oco/order/{orderId} + add_order_old + Add Order - Old + /api/v1/orders """ - data = "{\n \"code\": \"200000\",\n \"data\": {\n \"orderId\": \"674c3b6e688dea0007c7bab2\",\n \"symbol\": \"BTC-USDT\",\n \"clientOid\": \"5c52e1203aa6f37f1e493fb\",\n \"orderTime\": 1733049198863,\n \"status\": \"NEW\"\n }\n}" + data = "{\n \"code\": \"200000\",\n \"data\": {\n \"orderId\": \"674a8635b38d120007709c0f\"\n }\n}" common_response = RestResponse.from_json(data) - resp = GetOcoOrderByOrderIdResp.from_dict(common_response.data) + resp = AddOrderOldResp.from_dict(common_response.data) - def test_add_oco_order_req_model(self): + def test_add_order_test_old_req_model(self): """ - add_oco_order - Add OCO Order - /api/v3/oco/order + add_order_test_old + Add Order Test - Old + /api/v1/orders/test """ - data = "{\"symbol\": \"BTC-USDT\", \"side\": \"buy\", \"price\": \"94000\", \"size\": \"0.1\", \"clientOid\": \"5c52e11203aa67f1e493fb\", \"stopPrice\": \"98000\", \"limitPrice\": \"96000\", \"remark\": \"this is remark\", \"tradeType\": \"TRADE\"}" - req = AddOcoOrderReq.from_json(data) + data = "{\"type\": \"limit\", \"symbol\": \"BTC-USDT\", \"side\": \"buy\", \"price\": \"50000\", \"size\": \"0.00001\", \"clientOid\": \"5c52e11203aa677f33e493fb\", \"remark\": \"order remarks\"}" + req = AddOrderTestOldReq.from_json(data) - def test_add_oco_order_resp_model(self): + def test_add_order_test_old_resp_model(self): """ - add_oco_order - Add OCO Order - /api/v3/oco/order + add_order_test_old + Add Order Test - Old + /api/v1/orders/test """ - data = "{\"code\":\"200000\",\"data\":{\"orderId\":\"674c316e688dea0007c7b986\"}}" + data = "{\n \"code\": \"200000\",\n \"data\": {\n \"orderId\": \"674a8776291d9e00074f1edf\"\n }\n}" common_response = RestResponse.from_json(data) - resp = AddOcoOrderResp.from_dict(common_response.data) + resp = AddOrderTestOldResp.from_dict(common_response.data) - def test_batch_cancel_oco_orders_req_model(self): + def test_batch_add_orders_old_req_model(self): """ - batch_cancel_oco_orders - Batch Cancel OCO Order - /api/v3/oco/orders + batch_add_orders_old + Batch Add Orders - Old + /api/v1/orders/multi """ - data = "{\"orderIds\": \"674c388172cf2800072ee746,674c38bdfd8300000795167e\", \"symbol\": \"BTC-USDT\"}" - req = BatchCancelOcoOrdersReq.from_json(data) + data = "{\"symbol\": \"BTC-USDT\", \"orderList\": [{\"clientOid\": \"3d07008668054da6b3cb12e432c2b13a\", \"side\": \"buy\", \"type\": \"limit\", \"price\": \"50000\", \"size\": \"0.0001\"}, {\"clientOid\": \"37245dbe6e134b5c97732bfb36cd4a9d\", \"side\": \"buy\", \"type\": \"limit\", \"price\": \"49999\", \"size\": \"0.0001\"}]}" + req = BatchAddOrdersOldReq.from_json(data) - def test_batch_cancel_oco_orders_resp_model(self): + def test_batch_add_orders_old_resp_model(self): """ - batch_cancel_oco_orders - Batch Cancel OCO Order - /api/v3/oco/orders + batch_add_orders_old + Batch Add Orders - Old + /api/v1/orders/multi """ - data = "{\n \"code\": \"200000\",\n \"data\": {\n \"cancelledOrderIds\": [\n \"vs93gpqc750mkk57003gok6i\",\n \"vs93gpqc750mkk57003gok6j\",\n \"vs93gpqc75c39p83003tnriu\",\n \"vs93gpqc75c39p83003tnriv\"\n ]\n }\n}" + data = "{\n \"code\": \"200000\",\n \"data\": {\n \"data\": [\n {\n \"symbol\": \"BTC-USDT\",\n \"type\": \"limit\",\n \"side\": \"buy\",\n \"price\": \"50000\",\n \"size\": \"0.0001\",\n \"funds\": null,\n \"stp\": \"\",\n \"stop\": \"\",\n \"stopPrice\": null,\n \"timeInForce\": \"GTC\",\n \"cancelAfter\": 0,\n \"postOnly\": false,\n \"hidden\": false,\n \"iceberge\": false,\n \"iceberg\": false,\n \"visibleSize\": null,\n \"channel\": \"API\",\n \"id\": \"674a97dfef434f0007efc431\",\n \"status\": \"success\",\n \"failMsg\": null,\n \"clientOid\": \"3d07008668054da6b3cb12e432c2b13a\"\n },\n {\n \"symbol\": \"BTC-USDT\",\n \"type\": \"limit\",\n \"side\": \"buy\",\n \"price\": \"49999\",\n \"size\": \"0.0001\",\n \"funds\": null,\n \"stp\": \"\",\n \"stop\": \"\",\n \"stopPrice\": null,\n \"timeInForce\": \"GTC\",\n \"cancelAfter\": 0,\n \"postOnly\": false,\n \"hidden\": false,\n \"iceberge\": false,\n \"iceberg\": false,\n \"visibleSize\": null,\n \"channel\": \"API\",\n \"id\": \"674a97dffb378b00077b9c20\",\n \"status\": \"fail\",\n \"failMsg\": \"Balance insufficient!\",\n \"clientOid\": \"37245dbe6e134b5c97732bfb36cd4a9d\"\n }\n ]\n }\n}" common_response = RestResponse.from_json(data) - resp = BatchCancelOcoOrdersResp.from_dict(common_response.data) + resp = BatchAddOrdersOldResp.from_dict(common_response.data) - def test_get_oco_order_list_req_model(self): + def test_cancel_order_by_order_id_old_req_model(self): """ - get_oco_order_list - Get OCO Order List - /api/v3/oco/orders + cancel_order_by_order_id_old + Cancel Order By OrderId - Old + /api/v1/orders/{orderId} """ - data = "{\"symbol\": \"BTC-USDT\", \"startAt\": 123456, \"endAt\": 123456, \"orderIds\": \"example_string_default_value\", \"pageSize\": 50, \"currentPage\": 1}" - req = GetOcoOrderListReq.from_json(data) + data = "{\"symbol\": \"BTC-USDT\", \"orderId\": \"674a97dfef434f0007efc431\"}" + req = CancelOrderByOrderIdOldReq.from_json(data) - def test_get_oco_order_list_resp_model(self): + def test_cancel_order_by_order_id_old_resp_model(self): """ - get_oco_order_list - Get OCO Order List - /api/v3/oco/orders + cancel_order_by_order_id_old + Cancel Order By OrderId - Old + /api/v1/orders/{orderId} """ - data = "{\n \"code\": \"200000\",\n \"data\": {\n \"currentPage\": 1,\n \"pageSize\": 50,\n \"totalNum\": 1,\n \"totalPage\": 1,\n \"items\": [\n {\n \"orderId\": \"674c3cfa72cf2800072ee7ce\",\n \"symbol\": \"BTC-USDT\",\n \"clientOid\": \"5c52e1203aa6f3g7f1e493fb\",\n \"orderTime\": 1733049594803,\n \"status\": \"NEW\"\n }\n ]\n }\n}" + data = "{\n \"code\": \"200000\",\n \"data\": {\n \"cancelledOrderIds\": [\n \"674a97dfef434f0007efc431\"\n ]\n }\n}" common_response = RestResponse.from_json(data) - resp = GetOcoOrderListResp.from_dict(common_response.data) + resp = CancelOrderByOrderIdOldResp.from_dict(common_response.data) + + def test_cancel_order_by_client_oid_old_req_model(self): + """ + cancel_order_by_client_oid_old + Cancel Order By ClientOid - Old + /api/v1/order/client-order/{clientOid} + """ + data = "{\"symbol\": \"BTC-USDT\", \"clientOid\": \"5c52e11203aa677f33e4923fb\"}" + req = CancelOrderByClientOidOldReq.from_json(data) + + def test_cancel_order_by_client_oid_old_resp_model(self): + """ + cancel_order_by_client_oid_old + Cancel Order By ClientOid - Old + /api/v1/order/client-order/{clientOid} + """ + data = "{\n \"code\": \"200000\",\n \"data\": {\n \"cancelledOrderId\": \"674a9a872033a50007e2790d\",\n \"clientOid\": \"5c52e11203aa677f33e4923fb\",\n \"cancelledOcoOrderIds\": null\n }\n}" + common_response = RestResponse.from_json(data) + resp = CancelOrderByClientOidOldResp.from_dict(common_response.data) + + def test_batch_cancel_order_old_req_model(self): + """ + batch_cancel_order_old + Batch Cancel Order - Old + /api/v1/orders + """ + data = "{\"symbol\": \"BTC-USDT\", \"tradeType\": \"TRADE\"}" + req = BatchCancelOrderOldReq.from_json(data) + + def test_batch_cancel_order_old_resp_model(self): + """ + batch_cancel_order_old + Batch Cancel Order - Old + /api/v1/orders + """ + data = "{\n \"code\": \"200000\",\n \"data\": {\n \"cancelledOrderIds\": [\n \"674a8635b38d120007709c0f\",\n \"674a8630439c100007d3bce1\"\n ]\n }\n}" + common_response = RestResponse.from_json(data) + resp = BatchCancelOrderOldResp.from_dict(common_response.data) + + def test_get_orders_list_old_req_model(self): + """ + get_orders_list_old + Get Orders List - Old + /api/v1/orders + """ + data = "{\"symbol\": \"BTC-USDT\", \"status\": \"active\", \"side\": \"buy\", \"type\": \"limit\", \"tradeType\": \"TRADE\", \"startAt\": 123456, \"endAt\": 123456, \"currentPage\": 1, \"pageSize\": 50}" + req = GetOrdersListOldReq.from_json(data) + + def test_get_orders_list_old_resp_model(self): + """ + get_orders_list_old + Get Orders List - Old + /api/v1/orders + """ + data = "{\n \"code\": \"200000\",\n \"data\": {\n \"currentPage\": 1,\n \"pageSize\": 50,\n \"totalNum\": 1,\n \"totalPage\": 1,\n \"items\": [\n {\n \"id\": \"674a9a872033a50007e2790d\",\n \"symbol\": \"BTC-USDT\",\n \"opType\": \"DEAL\",\n \"type\": \"limit\",\n \"side\": \"buy\",\n \"price\": \"50000\",\n \"size\": \"0.00001\",\n \"funds\": \"0\",\n \"dealFunds\": \"0\",\n \"dealSize\": \"0\",\n \"fee\": \"0\",\n \"feeCurrency\": \"USDT\",\n \"stp\": \"\",\n \"stop\": \"\",\n \"stopTriggered\": false,\n \"stopPrice\": \"0\",\n \"timeInForce\": \"GTC\",\n \"postOnly\": false,\n \"hidden\": false,\n \"iceberg\": false,\n \"visibleSize\": \"0\",\n \"cancelAfter\": 0,\n \"channel\": \"API\",\n \"clientOid\": \"5c52e11203aa677f33e4923fb\",\n \"remark\": \"order remarks\",\n \"tags\": null,\n \"isActive\": false,\n \"cancelExist\": true,\n \"createdAt\": 1732942471752,\n \"tradeType\": \"TRADE\"\n }\n ]\n }\n}" + common_response = RestResponse.from_json(data) + resp = GetOrdersListOldResp.from_dict(common_response.data) + + def test_get_recent_orders_list_old_req_model(self): + """ + get_recent_orders_list_old + Get Recent Orders List - Old + /api/v1/limit/orders + """ + data = "{\"currentPage\": 1, \"pageSize\": 50}" + req = GetRecentOrdersListOldReq.from_json(data) + + def test_get_recent_orders_list_old_resp_model(self): + """ + get_recent_orders_list_old + Get Recent Orders List - Old + /api/v1/limit/orders + """ + data = "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"id\": \"674a9a872033a50007e2790d\",\n \"symbol\": \"BTC-USDT\",\n \"opType\": \"DEAL\",\n \"type\": \"limit\",\n \"side\": \"buy\",\n \"price\": \"50000\",\n \"size\": \"0.00001\",\n \"funds\": \"0\",\n \"dealFunds\": \"0\",\n \"dealSize\": \"0\",\n \"fee\": \"0\",\n \"feeCurrency\": \"USDT\",\n \"stp\": \"\",\n \"stop\": \"\",\n \"stopTriggered\": false,\n \"stopPrice\": \"0\",\n \"timeInForce\": \"GTC\",\n \"postOnly\": false,\n \"hidden\": false,\n \"iceberg\": false,\n \"visibleSize\": \"0\",\n \"cancelAfter\": 0,\n \"channel\": \"API\",\n \"clientOid\": \"5c52e11203aa677f33e4923fb\",\n \"remark\": \"order remarks\",\n \"tags\": null,\n \"isActive\": false,\n \"cancelExist\": true,\n \"createdAt\": 1732942471752,\n \"tradeType\": \"TRADE\"\n }\n ]\n}" + common_response = RestResponse.from_json(data) + resp = GetRecentOrdersListOldResp.from_dict(common_response.data) + + def test_get_order_by_order_id_old_req_model(self): + """ + get_order_by_order_id_old + Get Order By OrderId - Old + /api/v1/orders/{orderId} + """ + data = "{\"orderId\": \"674a97dfef434f0007efc431\"}" + req = GetOrderByOrderIdOldReq.from_json(data) + + def test_get_order_by_order_id_old_resp_model(self): + """ + get_order_by_order_id_old + Get Order By OrderId - Old + /api/v1/orders/{orderId} + """ + data = "{\n \"code\": \"200000\",\n \"data\": {\n \"id\": \"674a97dfef434f0007efc431\",\n \"symbol\": \"BTC-USDT\",\n \"opType\": \"DEAL\",\n \"type\": \"limit\",\n \"side\": \"buy\",\n \"price\": \"50000\",\n \"size\": \"0.0001\",\n \"funds\": \"0\",\n \"dealFunds\": \"0\",\n \"dealSize\": \"0\",\n \"fee\": \"0\",\n \"feeCurrency\": \"USDT\",\n \"stp\": \"\",\n \"stop\": \"\",\n \"stopTriggered\": false,\n \"stopPrice\": \"0\",\n \"timeInForce\": \"GTC\",\n \"postOnly\": false,\n \"hidden\": false,\n \"iceberg\": false,\n \"visibleSize\": \"0\",\n \"cancelAfter\": 0,\n \"channel\": \"API\",\n \"clientOid\": \"3d07008668054da6b3cb12e432c2b13a\",\n \"remark\": null,\n \"tags\": null,\n \"isActive\": false,\n \"cancelExist\": true,\n \"createdAt\": 1732941791518,\n \"tradeType\": \"TRADE\"\n }\n}" + common_response = RestResponse.from_json(data) + resp = GetOrderByOrderIdOldResp.from_dict(common_response.data) + + def test_get_order_by_client_oid_old_req_model(self): + """ + get_order_by_client_oid_old + Get Order By ClientOid - Old + /api/v1/order/client-order/{clientOid} + """ + data = "{\"clientOid\": \"3d07008668054da6b3cb12e432c2b13a\"}" + req = GetOrderByClientOidOldReq.from_json(data) + + def test_get_order_by_client_oid_old_resp_model(self): + """ + get_order_by_client_oid_old + Get Order By ClientOid - Old + /api/v1/order/client-order/{clientOid} + """ + data = "{\n \"code\": \"200000\",\n \"data\": {\n \"id\": \"674a97dfef434f0007efc431\",\n \"symbol\": \"BTC-USDT\",\n \"opType\": \"DEAL\",\n \"type\": \"limit\",\n \"side\": \"buy\",\n \"price\": \"50000\",\n \"size\": \"0.0001\",\n \"funds\": \"0\",\n \"dealFunds\": \"0\",\n \"dealSize\": \"0\",\n \"fee\": \"0\",\n \"feeCurrency\": \"USDT\",\n \"stp\": \"\",\n \"stop\": \"\",\n \"stopTriggered\": false,\n \"stopPrice\": \"0\",\n \"timeInForce\": \"GTC\",\n \"postOnly\": false,\n \"hidden\": false,\n \"iceberg\": false,\n \"visibleSize\": \"0\",\n \"cancelAfter\": 0,\n \"channel\": \"API\",\n \"clientOid\": \"3d07008668054da6b3cb12e432c2b13a\",\n \"remark\": null,\n \"tags\": null,\n \"isActive\": false,\n \"cancelExist\": true,\n \"createdAt\": 1732941791518,\n \"tradeType\": \"TRADE\"\n }\n}" + common_response = RestResponse.from_json(data) + resp = GetOrderByClientOidOldResp.from_dict(common_response.data) + + def test_get_trade_history_old_req_model(self): + """ + get_trade_history_old + Get Trade History - Old + /api/v1/fills + """ + data = "{\"symbol\": \"BTC-USDT\", \"orderId\": \"example_string_default_value\", \"side\": \"buy\", \"type\": \"limit\", \"tradeType\": \"TRADE\", \"startAt\": 1728663338000, \"endAt\": 1728692138000, \"currentPage\": 1, \"pageSize\": 50}" + req = GetTradeHistoryOldReq.from_json(data) + + def test_get_trade_history_old_resp_model(self): + """ + get_trade_history_old + Get Trade History - Old + /api/v1/fills + """ + data = "{\n \"code\": \"200000\",\n \"data\": {\n \"currentPage\": 1,\n \"pageSize\": 50,\n \"totalNum\": 1,\n \"totalPage\": 1,\n \"items\": [\n {\n \"symbol\": \"DOGE-USDT\",\n \"tradeId\": \"10862827223795713\",\n \"orderId\": \"6745698ef4f1200007c561a8\",\n \"counterOrderId\": \"6745695ef15b270007ac5076\",\n \"side\": \"buy\",\n \"liquidity\": \"taker\",\n \"forceTaker\": false,\n \"price\": \"0.40739\",\n \"size\": \"10\",\n \"funds\": \"4.0739\",\n \"fee\": \"0.0040739\",\n \"feeRate\": \"0.001\",\n \"feeCurrency\": \"USDT\",\n \"stop\": \"\",\n \"tradeType\": \"TRADE\",\n \"type\": \"market\",\n \"createdAt\": 1732602254928\n }\n ]\n }\n}" + common_response = RestResponse.from_json(data) + resp = GetTradeHistoryOldResp.from_dict(common_response.data) + + def test_get_recent_trade_history_old_req_model(self): + """ + get_recent_trade_history_old + Get Recent Trade History - Old + /api/v1/limit/fills + """ + data = "{\"currentPage\": 1, \"pageSize\": 50}" + req = GetRecentTradeHistoryOldReq.from_json(data) + + def test_get_recent_trade_history_old_resp_model(self): + """ + get_recent_trade_history_old + Get Recent Trade History - Old + /api/v1/limit/fills + """ + data = "{\n \"code\": \"200000\",\n \"data\": [\n {\n \"symbol\": \"BTC-USDT\",\n \"tradeId\": \"11732720444522497\",\n \"orderId\": \"674aab24754b1e00077dbc69\",\n \"counterOrderId\": \"674aab1fb26bfb0007a18b67\",\n \"side\": \"buy\",\n \"liquidity\": \"taker\",\n \"forceTaker\": false,\n \"price\": \"96999.6\",\n \"size\": \"0.00001\",\n \"funds\": \"0.969996\",\n \"fee\": \"0.000969996\",\n \"feeRate\": \"0.001\",\n \"feeCurrency\": \"USDT\",\n \"stop\": \"\",\n \"tradeType\": \"TRADE\",\n \"type\": \"limit\",\n \"createdAt\": 1732946724082\n }\n ]\n}" + common_response = RestResponse.from_json(data) + resp = GetRecentTradeHistoryOldResp.from_dict(common_response.data) diff --git a/sdk/python/kucoin_universal_sdk/generate/viplending/viplending/api_vip_lending.py b/sdk/python/kucoin_universal_sdk/generate/viplending/viplending/api_vip_lending.py index cc089fba..f7d40d95 100644 --- a/sdk/python/kucoin_universal_sdk/generate/viplending/viplending/api_vip_lending.py +++ b/sdk/python/kucoin_universal_sdk/generate/viplending/viplending/api_vip_lending.py @@ -10,11 +10,11 @@ class VIPLendingAPI(ABC): @abstractmethod - def get_accounts(self, **kwargs: Any) -> GetAccountsResp: + def get_account_detail(self, **kwargs: Any) -> GetAccountDetailResp: """ - summary: Get Accounts - description: Accounts participating in OTC lending, This interface is only for querying accounts currently running OTC lending. - documentation: https://www.kucoin.com/docs-new/api-3470278 + summary: Get Account Detail + description: The following information is only applicable to loans. Get information on off-exchange funding and loans, This endpoint is only for querying accounts that are currently involved in loans. + documentation: https://www.kucoin.com/docs-new/api-3470277 +---------------------+------------+ | Extra API Info | Value | +---------------------+------------+ @@ -28,11 +28,11 @@ def get_accounts(self, **kwargs: Any) -> GetAccountsResp: pass @abstractmethod - def get_account_detail(self, **kwargs: Any) -> GetAccountDetailResp: + def get_accounts(self, **kwargs: Any) -> GetAccountsResp: """ - summary: Get Account Detail - description: The following information is only applicable to loans. Get information on off-exchange funding and loans, This endpoint is only for querying accounts that are currently involved in loans. - documentation: https://www.kucoin.com/docs-new/api-3470277 + summary: Get Accounts + description: Accounts participating in OTC lending, This interface is only for querying accounts currently running OTC lending. + documentation: https://www.kucoin.com/docs-new/api-3470278 +---------------------+------------+ | Extra API Info | Value | +---------------------+------------+ @@ -51,12 +51,12 @@ class VIPLendingAPIImpl(VIPLendingAPI): def __init__(self, transport: Transport): self.transport = transport - def get_accounts(self, **kwargs: Any) -> GetAccountsResp: - return self.transport.call("spot", False, "GET", - "/api/v1/otc-loan/accounts", None, - GetAccountsResp(), False, **kwargs) - def get_account_detail(self, **kwargs: Any) -> GetAccountDetailResp: return self.transport.call("spot", False, "GET", "/api/v1/otc-loan/loan", None, GetAccountDetailResp(), False, **kwargs) + + def get_accounts(self, **kwargs: Any) -> GetAccountsResp: + return self.transport.call("spot", False, "GET", + "/api/v1/otc-loan/accounts", None, + GetAccountsResp(), False, **kwargs) diff --git a/sdk/python/kucoin_universal_sdk/generate/viplending/viplending/api_vip_lending.template b/sdk/python/kucoin_universal_sdk/generate/viplending/viplending/api_vip_lending.template index 900db268..d8e4638f 100644 --- a/sdk/python/kucoin_universal_sdk/generate/viplending/viplending/api_vip_lending.template +++ b/sdk/python/kucoin_universal_sdk/generate/viplending/viplending/api_vip_lending.template @@ -1,15 +1,15 @@ # API FUNCTION TEMPLATE -def test_get_accounts_req(self): +def test_get_account_detail_req(self): """ - get_accounts - Get Accounts - /api/v1/otc-loan/accounts + get_account_detail + Get Account Detail + /api/v1/otc-loan/loan """ try: - resp = self.api.get_accounts() + resp = self.api.get_account_detail() print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) @@ -17,15 +17,15 @@ def test_get_accounts_req(self): print("error: ", e) raise e -def test_get_account_detail_req(self): +def test_get_accounts_req(self): """ - get_account_detail - Get Account Detail - /api/v1/otc-loan/loan + get_accounts + Get Accounts + /api/v1/otc-loan/accounts """ try: - resp = self.api.get_account_detail() + resp = self.api.get_accounts() print("code: ", resp.common_response.code) print("msg: ", resp.common_response.message) print("data: ", resp.to_json()) diff --git a/sdk/python/kucoin_universal_sdk/generate/viplending/viplending/api_vip_lending_test.py b/sdk/python/kucoin_universal_sdk/generate/viplending/viplending/api_vip_lending_test.py index 3ca043e9..48fb49b7 100644 --- a/sdk/python/kucoin_universal_sdk/generate/viplending/viplending/api_vip_lending_test.py +++ b/sdk/python/kucoin_universal_sdk/generate/viplending/viplending/api_vip_lending_test.py @@ -6,23 +6,6 @@ class VIPLendingAPITest(unittest.TestCase): - def test_get_accounts_req_model(self): - """ - get_accounts - Get Accounts - /api/v1/otc-loan/accounts - """ - - def test_get_accounts_resp_model(self): - """ - get_accounts - Get Accounts - /api/v1/otc-loan/accounts - """ - data = "\n{\n \"code\": \"200000\",\n \"data\": [{\n \"uid\": \"1260004199\",\n \"marginCcy\": \"USDT\",\n \"marginQty\": \"900\",\n \"marginFactor\": \"0.9000000000\",\n \"accountType\": \"TRADE\",\n \"isParent\": true\n }]\n}" - common_response = RestResponse.from_json(data) - resp = GetAccountsResp.from_dict(common_response.data) - def test_get_account_detail_req_model(self): """ get_account_detail @@ -39,3 +22,20 @@ def test_get_account_detail_resp_model(self): data = "{\n \"code\": \"200000\",\n \"data\": {\n \"parentUid\": \"1260004199\",\n \"orders\": [{\n \"orderId\": \"671a2be815f4140007a588e1\",\n \"principal\": \"100\",\n \"interest\": \"0\",\n \"currency\": \"USDT\"\n }],\n \"ltv\": {\n \"transferLtv\": \"0.6000\",\n \"onlyClosePosLtv\": \"0.7500\",\n \"delayedLiquidationLtv\": \"0.7500\",\n \"instantLiquidationLtv\": \"0.8000\",\n \"currentLtv\": \"0.1111\"\n },\n \"totalMarginAmount\": \"900.00000000\",\n \"transferMarginAmount\": \"166.66666666\",\n \"margins\": [{\n \"marginCcy\": \"USDT\",\n \"marginQty\": \"1000.00000000\",\n \"marginFactor\": \"0.9000000000\"\n }]\n }\n}" common_response = RestResponse.from_json(data) resp = GetAccountDetailResp.from_dict(common_response.data) + + def test_get_accounts_req_model(self): + """ + get_accounts + Get Accounts + /api/v1/otc-loan/accounts + """ + + def test_get_accounts_resp_model(self): + """ + get_accounts + Get Accounts + /api/v1/otc-loan/accounts + """ + data = "\n{\n \"code\": \"200000\",\n \"data\": [{\n \"uid\": \"1260004199\",\n \"marginCcy\": \"USDT\",\n \"marginQty\": \"900\",\n \"marginFactor\": \"0.9000000000\",\n \"accountType\": \"TRADE\",\n \"isParent\": true\n }]\n}" + common_response = RestResponse.from_json(data) + resp = GetAccountsResp.from_dict(common_response.data) diff --git a/spec/rest/api/openapi-account-account.json b/spec/rest/api/openapi-account-account.json index 3f31680c..81edc13e 100644 --- a/spec/rest/api/openapi-account-account.json +++ b/spec/rest/api/openapi-account-account.json @@ -113,7 +113,8 @@ "x-sdk-method-name": "getAccountInfo", "x-sdk-method-description": "This endpoint can be used to obtain account summary information.", "x-api-rate-limit": 20, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"level\\\": 0,\\n \\\"subQuantity\\\": 3,\\n \\\"spotSubQuantity\\\": 3,\\n \\\"marginSubQuantity\\\": 2,\\n \\\"futuresSubQuantity\\\": 2,\\n \\\"optionSubQuantity\\\": 0,\\n \\\"maxSubQuantity\\\": 5,\\n \\\"maxDefaultSubQuantity\\\": 5,\\n \\\"maxSpotSubQuantity\\\": 0,\\n \\\"maxMarginSubQuantity\\\": 0,\\n \\\"maxFuturesSubQuantity\\\": 0,\\n \\\"maxOptionSubQuantity\\\": 0\\n }\\n}" + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"level\\\": 0,\\n \\\"subQuantity\\\": 3,\\n \\\"spotSubQuantity\\\": 3,\\n \\\"marginSubQuantity\\\": 2,\\n \\\"futuresSubQuantity\\\": 2,\\n \\\"optionSubQuantity\\\": 0,\\n \\\"maxSubQuantity\\\": 5,\\n \\\"maxDefaultSubQuantity\\\": 5,\\n \\\"maxSpotSubQuantity\\\": 0,\\n \\\"maxMarginSubQuantity\\\": 0,\\n \\\"maxFuturesSubQuantity\\\": 0,\\n \\\"maxOptionSubQuantity\\\": 0\\n }\\n}", + "operationId": "001" } }, "/api/v1/user/api-key": { @@ -206,7 +207,8 @@ "x-sdk-method-name": "getApikeyInfo", "x-sdk-method-description": "Get the information of the api key. Use the api key pending to be checked to call the endpoint. Both master and sub user's api key are applicable.", "x-api-rate-limit": 20, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"remark\\\": \\\"account1\\\",\\n \\\"apiKey\\\": \\\"6705f5c311545b000157d3eb\\\",\\n \\\"apiVersion\\\": 3,\\n \\\"permission\\\": \\\"General,Futures,Spot,Earn,InnerTransfer,Transfer,Margin\\\",\\n \\\"ipWhitelist\\\": \\\"203.**.154,103.**.34\\\",\\n \\\"createdAt\\\": 1728443843000,\\n \\\"uid\\\": 165111215,\\n \\\"isMaster\\\": true\\n }\\n}" + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"remark\\\": \\\"account1\\\",\\n \\\"apiKey\\\": \\\"6705f5c311545b000157d3eb\\\",\\n \\\"apiVersion\\\": 3,\\n \\\"permission\\\": \\\"General,Futures,Spot,Earn,InnerTransfer,Transfer,Margin\\\",\\n \\\"ipWhitelist\\\": \\\"203.**.154,103.**.34\\\",\\n \\\"createdAt\\\": 1728443843000,\\n \\\"uid\\\": 165111215,\\n \\\"isMaster\\\": true\\n }\\n}", + "operationId": "002" } }, "/api/v1/hf/accounts/opened": { @@ -252,7 +254,8 @@ "x-sdk-method-name": "getSpotAccountType", "x-sdk-method-description": "This interface determines whether the current user is a spot high-frequency user or a spot low-frequency user.", "x-api-rate-limit": 30, - "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":false}" + "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":false}", + "operationId": "003" } }, "/api/v1/accounts": { @@ -386,7 +389,8 @@ "x-sdk-method-description": "Get a list of accounts. Please Deposit to the main account firstly, then transfer the funds to the trade account via Inner Transfer before transaction.", "x-api-rate-limit": 5, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": [\\n {\\n \\\"id\\\": \\\"548674591753\\\",\\n \\\"currency\\\": \\\"USDT\\\",\\n \\\"type\\\": \\\"trade\\\",\\n \\\"balance\\\": \\\"26.66759503\\\",\\n \\\"available\\\": \\\"26.66759503\\\",\\n \\\"holds\\\": \\\"0\\\"\\n },\\n {\\n \\\"id\\\": \\\"63355cd156298d0001b66e61\\\",\\n \\\"currency\\\": \\\"USDT\\\",\\n \\\"type\\\": \\\"main\\\",\\n \\\"balance\\\": \\\"0.01\\\",\\n \\\"available\\\": \\\"0.01\\\",\\n \\\"holds\\\": \\\"0\\\"\\n }\\n ]\\n}", - "x-request-example": "{\\\"currency\\\": \\\"USDT\\\", \\\"type\\\": \\\"main\\\"}" + "x-request-example": "{\\\"currency\\\": \\\"USDT\\\", \\\"type\\\": \\\"main\\\"}", + "operationId": "004" } }, "/api/v1/accounts/{accountId}": { @@ -466,7 +470,8 @@ "x-sdk-method-description": "get Information for a single spot account. Use this endpoint when you know the accountId.", "x-api-rate-limit": 5, "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"currency\\\":\\\"USDT\\\",\\\"balance\\\":\\\"26.66759503\\\",\\\"available\\\":\\\"26.66759503\\\",\\\"holds\\\":\\\"0\\\"}}", - "x-request-example": "{\\\"accountId\\\": \\\"548674591753\\\"}" + "x-request-example": "{\\\"accountId\\\": \\\"548674591753\\\"}", + "operationId": "005" } }, "/api/v3/margin/accounts": { @@ -687,7 +692,8 @@ "x-sdk-method-description": "Request via this endpoint to get the info of the cross margin account.", "x-api-rate-limit": 15, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"totalAssetOfQuoteCurrency\\\": \\\"0.02\\\",\\n \\\"totalLiabilityOfQuoteCurrency\\\": \\\"0\\\",\\n \\\"debtRatio\\\": \\\"0\\\",\\n \\\"status\\\": \\\"EFFECTIVE\\\",\\n \\\"accounts\\\": [\\n {\\n \\\"currency\\\": \\\"USDT\\\",\\n \\\"total\\\": \\\"0.02\\\",\\n \\\"available\\\": \\\"0.02\\\",\\n \\\"hold\\\": \\\"0\\\",\\n \\\"liability\\\": \\\"0\\\",\\n \\\"maxBorrowSize\\\": \\\"0\\\",\\n \\\"borrowEnabled\\\": true,\\n \\\"transferInEnabled\\\": true\\n }\\n ]\\n }\\n}", - "x-request-example": "{\\\"quoteCurrency\\\": \\\"USDT\\\", \\\"queryType\\\": \\\"MARGIN\\\"}" + "x-request-example": "{\\\"quoteCurrency\\\": \\\"USDT\\\", \\\"queryType\\\": \\\"MARGIN\\\"}", + "operationId": "006" } }, "/api/v3/isolated/accounts": { @@ -985,7 +991,8 @@ "x-sdk-method-description": "Request via this endpoint to get the info of the isolated margin account.", "x-api-rate-limit": 15, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"totalAssetOfQuoteCurrency\\\": \\\"0.01\\\",\\n \\\"totalLiabilityOfQuoteCurrency\\\": \\\"0\\\",\\n \\\"timestamp\\\": 1728725465994,\\n \\\"assets\\\": [\\n {\\n \\\"symbol\\\": \\\"BTC-USDT\\\",\\n \\\"status\\\": \\\"EFFECTIVE\\\",\\n \\\"debtRatio\\\": \\\"0\\\",\\n \\\"baseAsset\\\": {\\n \\\"currency\\\": \\\"BTC\\\",\\n \\\"borrowEnabled\\\": true,\\n \\\"transferInEnabled\\\": true,\\n \\\"liability\\\": \\\"0\\\",\\n \\\"total\\\": \\\"0\\\",\\n \\\"available\\\": \\\"0\\\",\\n \\\"hold\\\": \\\"0\\\",\\n \\\"maxBorrowSize\\\": \\\"0\\\"\\n },\\n \\\"quoteAsset\\\": {\\n \\\"currency\\\": \\\"USDT\\\",\\n \\\"borrowEnabled\\\": true,\\n \\\"transferInEnabled\\\": true,\\n \\\"liability\\\": \\\"0\\\",\\n \\\"total\\\": \\\"0.01\\\",\\n \\\"available\\\": \\\"0.01\\\",\\n \\\"hold\\\": \\\"0\\\",\\n \\\"maxBorrowSize\\\": \\\"0\\\"\\n }\\n }\\n ]\\n }\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"example_string_default_value\\\", \\\"quoteCurrency\\\": \\\"USDT\\\", \\\"queryType\\\": \\\"ISOLATED\\\"}" + "x-request-example": "{\\\"symbol\\\": \\\"example_string_default_value\\\", \\\"quoteCurrency\\\": \\\"USDT\\\", \\\"queryType\\\": \\\"ISOLATED\\\"}", + "operationId": "007" } }, "/api/v1/account-overview": { @@ -1100,7 +1107,8 @@ "x-sdk-method-description": "Request via this endpoint to get the info of the futures account.", "x-api-rate-limit": 5, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"currency\\\": \\\"USDT\\\",\\n \\\"accountEquity\\\": 48.921913718,\\n \\\"unrealisedPNL\\\": 1.59475,\\n \\\"marginBalance\\\": 47.548728628,\\n \\\"positionMargin\\\": 34.1577964733,\\n \\\"orderMargin\\\": 0,\\n \\\"frozenFunds\\\": 0,\\n \\\"availableBalance\\\": 14.7876172447,\\n \\\"riskRatio\\\": 0.0090285199\\n }\\n}", - "x-request-example": "{\\\"currency\\\": \\\"USDT\\\"}" + "x-request-example": "{\\\"currency\\\": \\\"USDT\\\"}", + "operationId": "008" } }, "/api/v1/accounts/ledgers": { @@ -1306,7 +1314,8 @@ "x-sdk-method-description": "This interface is for transaction records from all types of your accounts, supporting inquiry of various currencies. Items are paginated and sorted to show the latest first. See the Pagination section for retrieving additional entries after the first page.", "x-api-rate-limit": 2, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"currentPage\\\": 1,\\n \\\"pageSize\\\": 50,\\n \\\"totalNum\\\": 1,\\n \\\"totalPage\\\": 1,\\n \\\"items\\\": [\\n {\\n \\\"id\\\": \\\"265329987780896\\\",\\n \\\"currency\\\": \\\"USDT\\\",\\n \\\"amount\\\": \\\"0.01\\\",\\n \\\"fee\\\": \\\"0\\\",\\n \\\"balance\\\": \\\"0\\\",\\n \\\"accountType\\\": \\\"TRADE\\\",\\n \\\"bizType\\\": \\\"SUB_TRANSFER\\\",\\n \\\"direction\\\": \\\"out\\\",\\n \\\"createdAt\\\": 1728658481484,\\n \\\"context\\\": \\\"\\\"\\n }\\n ]\\n }\\n}", - "x-request-example": "{\\\"currency\\\": \\\"BTC\\\", \\\"direction\\\": \\\"in\\\", \\\"bizType\\\": \\\"TRANSFER\\\", \\\"startAt\\\": 1728663338000, \\\"endAt\\\": 1728692138000, \\\"currentPage\\\": 1, \\\"pageSize\\\": 50}" + "x-request-example": "{\\\"currency\\\": \\\"BTC\\\", \\\"direction\\\": \\\"in\\\", \\\"bizType\\\": \\\"TRANSFER\\\", \\\"startAt\\\": 1728663338000, \\\"endAt\\\": 1728692138000, \\\"currentPage\\\": 1, \\\"pageSize\\\": 50}", + "operationId": "009" } }, "/api/v1/hf/accounts/ledgers": { @@ -1531,7 +1540,8 @@ "x-sdk-method-description": "This API endpoint returns all transfer (in and out) records in high-frequency trading account and supports multi-coin queries. The query results are sorted in descending order by createdAt and id.", "x-api-rate-limit": 2, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": [\\n {\\n \\\"id\\\": \\\"254062248624417\\\",\\n \\\"currency\\\": \\\"USDT\\\",\\n \\\"amount\\\": \\\"1.59760080\\\",\\n \\\"fee\\\": \\\"0.00159920\\\",\\n \\\"tax\\\": \\\"0\\\",\\n \\\"balance\\\": \\\"26.73759503\\\",\\n \\\"accountType\\\": \\\"TRADE_HF\\\",\\n \\\"bizType\\\": \\\"TRADE_EXCHANGE\\\",\\n \\\"direction\\\": \\\"in\\\",\\n \\\"createdAt\\\": \\\"1728443957539\\\",\\n \\\"context\\\": \\\"{\\\\\\\"symbol\\\\\\\":\\\\\\\"KCS-USDT\\\\\\\",\\\\\\\"orderId\\\\\\\":\\\\\\\"6705f6350dc7210007d6a36d\\\\\\\",\\\\\\\"tradeId\\\\\\\":\\\\\\\"10046097631627265\\\\\\\"}\\\"\\n }\\n ]\\n}", - "x-request-example": "{\\\"currency\\\": \\\"BTC\\\", \\\"direction\\\": \\\"in\\\", \\\"bizType\\\": \\\"TRANSFER\\\", \\\"lastId\\\": 254062248624417, \\\"limit\\\": 100, \\\"startAt\\\": 1728663338000, \\\"endAt\\\": 1728692138000}" + "x-request-example": "{\\\"currency\\\": \\\"BTC\\\", \\\"direction\\\": \\\"in\\\", \\\"bizType\\\": \\\"TRANSFER\\\", \\\"lastId\\\": 254062248624417, \\\"limit\\\": 100, \\\"startAt\\\": 1728663338000, \\\"endAt\\\": 1728692138000}", + "operationId": "010" } }, "/api/v3/hf/margin/account/ledgers": { @@ -1712,7 +1722,8 @@ "x-sdk-method-description": "This API endpoint returns all transfer (in and out) records in high-frequency margin trading account and supports multi-coin queries. The query results are sorted in descending order by createdAt and id.", "x-api-rate-limit": 2, "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":[{\\\"id\\\":1949641706720,\\\"currency\\\":\\\"USDT\\\",\\\"amount\\\":\\\"0.01000000\\\",\\\"fee\\\":\\\"0.00000000\\\",\\\"balance\\\":\\\"0.01000000\\\",\\\"accountType\\\":\\\"MARGIN_V2\\\",\\\"bizType\\\":\\\"TRANSFER\\\",\\\"direction\\\":\\\"in\\\",\\\"createdAt\\\":1728664091208,\\\"context\\\":\\\"{}\\\",\\\"tax\\\":\\\"0.00000000\\\"}]}", - "x-request-example": "{\\\"currency\\\": \\\"BTC\\\", \\\"direction\\\": \\\"in\\\", \\\"bizType\\\": \\\"TRANSFER\\\", \\\"lastId\\\": 254062248624417, \\\"limit\\\": 100, \\\"startAt\\\": 1728663338000, \\\"endAt\\\": 1728692138000}" + "x-request-example": "{\\\"currency\\\": \\\"BTC\\\", \\\"direction\\\": \\\"in\\\", \\\"bizType\\\": \\\"TRANSFER\\\", \\\"lastId\\\": 254062248624417, \\\"limit\\\": 100, \\\"startAt\\\": 1728663338000, \\\"endAt\\\": 1728692138000}", + "operationId": "011" } }, "/api/v1/transaction-history": { @@ -1894,7 +1905,8 @@ "x-sdk-method-description": "This interface can query the ledger records of the futures business line", "x-api-rate-limit": 2, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"dataList\\\": [\\n {\\n \\\"time\\\": 1728665747000,\\n \\\"type\\\": \\\"TransferIn\\\",\\n \\\"amount\\\": 0.01,\\n \\\"fee\\\": 0.0,\\n \\\"accountEquity\\\": 14.02924938,\\n \\\"status\\\": \\\"Completed\\\",\\n \\\"remark\\\": \\\"Transferred from High-Frequency Trading Account\\\",\\n \\\"offset\\\": 51360793,\\n \\\"currency\\\": \\\"USDT\\\"\\n },\\n {\\n \\\"time\\\": 1728648000000,\\n \\\"type\\\": \\\"RealisedPNL\\\",\\n \\\"amount\\\": 0.00630042,\\n \\\"fee\\\": 0.0,\\n \\\"accountEquity\\\": 20.0,\\n \\\"status\\\": \\\"Completed\\\",\\n \\\"remark\\\": \\\"XBTUSDTM\\\",\\n \\\"offset\\\": 51352430,\\n \\\"currency\\\": \\\"USDT\\\"\\n }\\n ],\\n \\\"hasMore\\\": false\\n }\\n}", - "x-request-example": "{\\\"currency\\\": \\\"XBT\\\", \\\"type\\\": \\\"Transferin\\\", \\\"offset\\\": 254062248624417, \\\"forward\\\": true, \\\"maxCount\\\": 50, \\\"startAt\\\": 1728663338000, \\\"endAt\\\": 1728692138000}" + "x-request-example": "{\\\"currency\\\": \\\"XBT\\\", \\\"type\\\": \\\"Transferin\\\", \\\"offset\\\": 254062248624417, \\\"forward\\\": true, \\\"maxCount\\\": 50, \\\"startAt\\\": 1728663338000, \\\"endAt\\\": 1728692138000}", + "operationId": "012" } }, "/api/v1/margin/account": { @@ -1990,7 +2002,8 @@ "x-sdk-method-name": "getMarginAccountDetail", "x-sdk-method-description": "Request via this endpoint to get the info of the margin account.", "x-api-rate-limit": 40, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"debtRatio\\\": \\\"0\\\",\\n \\\"accounts\\\": [\\n {\\n \\\"currency\\\": \\\"USDT\\\",\\n \\\"totalBalance\\\": \\\"0.03\\\",\\n \\\"availableBalance\\\": \\\"0.02\\\",\\n \\\"holdBalance\\\": \\\"0.01\\\",\\n \\\"liability\\\": \\\"0\\\",\\n \\\"maxBorrowSize\\\": \\\"0\\\"\\n }\\n ]\\n }\\n}" + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"debtRatio\\\": \\\"0\\\",\\n \\\"accounts\\\": [\\n {\\n \\\"currency\\\": \\\"USDT\\\",\\n \\\"totalBalance\\\": \\\"0.03\\\",\\n \\\"availableBalance\\\": \\\"0.02\\\",\\n \\\"holdBalance\\\": \\\"0.01\\\",\\n \\\"liability\\\": \\\"0\\\",\\n \\\"maxBorrowSize\\\": \\\"0\\\"\\n }\\n ]\\n }\\n}", + "operationId": "013" } }, "/api/v1/isolated/accounts": { @@ -2240,7 +2253,8 @@ "x-sdk-method-description": "Request via this endpoint to get the info list of the isolated margin account.", "x-api-rate-limit": 50, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"totalConversionBalance\\\": \\\"0.01\\\",\\n \\\"liabilityConversionBalance\\\": \\\"0\\\",\\n \\\"assets\\\": [\\n {\\n \\\"symbol\\\": \\\"BTC-USDT\\\",\\n \\\"status\\\": \\\"CLEAR\\\",\\n \\\"debtRatio\\\": \\\"0\\\",\\n \\\"baseAsset\\\": {\\n \\\"currency\\\": \\\"BTC\\\",\\n \\\"totalBalance\\\": \\\"0\\\",\\n \\\"holdBalance\\\": \\\"0\\\",\\n \\\"availableBalance\\\": \\\"0\\\",\\n \\\"liability\\\": \\\"0\\\",\\n \\\"interest\\\": \\\"0\\\",\\n \\\"borrowableAmount\\\": \\\"0\\\"\\n },\\n \\\"quoteAsset\\\": {\\n \\\"currency\\\": \\\"USDT\\\",\\n \\\"totalBalance\\\": \\\"0.01\\\",\\n \\\"holdBalance\\\": \\\"0\\\",\\n \\\"availableBalance\\\": \\\"0.01\\\",\\n \\\"liability\\\": \\\"0\\\",\\n \\\"interest\\\": \\\"0\\\",\\n \\\"borrowableAmount\\\": \\\"0\\\"\\n }\\n }\\n ]\\n }\\n}", - "x-request-example": "{\\\"balanceCurrency\\\": \\\"USDT\\\"}" + "x-request-example": "{\\\"balanceCurrency\\\": \\\"USDT\\\"}", + "operationId": "014" } }, "/api/v1/isolated/account/{symbol}": { @@ -2445,7 +2459,8 @@ "x-sdk-method-description": "Request via this endpoint to get the info of the isolated margin account.", "x-api-rate-limit": 50, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"symbol\\\": \\\"BTC-USDT\\\",\\n \\\"status\\\": \\\"CLEAR\\\",\\n \\\"debtRatio\\\": \\\"0\\\",\\n \\\"baseAsset\\\": {\\n \\\"currency\\\": \\\"BTC\\\",\\n \\\"totalBalance\\\": \\\"0\\\",\\n \\\"holdBalance\\\": \\\"0\\\",\\n \\\"availableBalance\\\": \\\"0\\\",\\n \\\"liability\\\": \\\"0\\\",\\n \\\"interest\\\": \\\"0\\\",\\n \\\"borrowableAmount\\\": \\\"0\\\"\\n },\\n \\\"quoteAsset\\\": {\\n \\\"currency\\\": \\\"USDT\\\",\\n \\\"totalBalance\\\": \\\"0.01\\\",\\n \\\"holdBalance\\\": \\\"0\\\",\\n \\\"availableBalance\\\": \\\"0.01\\\",\\n \\\"liability\\\": \\\"0\\\",\\n \\\"interest\\\": \\\"0\\\",\\n \\\"borrowableAmount\\\": \\\"0\\\"\\n }\\n }\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"example_string_default_value\\\"}" + "x-request-example": "{\\\"symbol\\\": \\\"example_string_default_value\\\"}", + "operationId": "015" } } }, diff --git a/spec/rest/api/openapi-account-deposit.json b/spec/rest/api/openapi-account-deposit.json index 2a4c582f..3ab6649d 100644 --- a/spec/rest/api/openapi-account-deposit.json +++ b/spec/rest/api/openapi-account-deposit.json @@ -171,7 +171,8 @@ } }, "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"address\\\":\\\"EQCA1BI4QRZ8qYmskSRDzJmkucGodYRTZCf_b9hckjla6dZl\\\",\\\"memo\\\":\\\"2090821203\\\",\\\"chainId\\\":\\\"ton\\\",\\\"to\\\":\\\"TRADE\\\",\\\"expirationDate\\\":0,\\\"currency\\\":\\\"TON\\\",\\\"chainName\\\":\\\"TON\\\"}}", - "x-request-example": "{\\\"currency\\\": \\\"TON\\\", \\\"chain\\\": \\\"ton\\\", \\\"to\\\": \\\"trade\\\"}" + "x-request-example": "{\\\"currency\\\": \\\"TON\\\", \\\"chain\\\": \\\"ton\\\", \\\"to\\\": \\\"trade\\\"}", + "operationId": "001" } }, "/api/v3/deposit-addresses": { @@ -313,7 +314,8 @@ "x-sdk-method-description": "Get all deposit addresses for the currency you intend to deposit. If the returned data is empty, you may need to Add Deposit Address first.", "x-api-rate-limit": 5, "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":[{\\\"address\\\":\\\"TSv3L1fS7yA3SxzKD8c1qdX4nLP6rqNxYz\\\",\\\"memo\\\":\\\"\\\",\\\"chainId\\\":\\\"trx\\\",\\\"to\\\":\\\"TRADE\\\",\\\"expirationDate\\\":0,\\\"currency\\\":\\\"USDT\\\",\\\"contractAddress\\\":\\\"TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t\\\",\\\"chainName\\\":\\\"TRC20\\\"},{\\\"address\\\":\\\"0x551e823a3b36865e8c5dc6e6ac6cc0b00d98533e\\\",\\\"memo\\\":\\\"\\\",\\\"chainId\\\":\\\"kcc\\\",\\\"to\\\":\\\"TRADE\\\",\\\"expirationDate\\\":0,\\\"currency\\\":\\\"USDT\\\",\\\"contractAddress\\\":\\\"0x0039f574ee5cc39bdd162e9a88e3eb1f111baf48\\\",\\\"chainName\\\":\\\"KCC\\\"},{\\\"address\\\":\\\"EQCA1BI4QRZ8qYmskSRDzJmkucGodYRTZCf_b9hckjla6dZl\\\",\\\"memo\\\":\\\"2085202643\\\",\\\"chainId\\\":\\\"ton\\\",\\\"to\\\":\\\"TRADE\\\",\\\"expirationDate\\\":0,\\\"currency\\\":\\\"USDT\\\",\\\"contractAddress\\\":\\\"EQCxE6mUtQJKFnGfaROTKOt1lZbDiiX1kCixRv7Nw2Id_sDs\\\",\\\"chainName\\\":\\\"TON\\\"},{\\\"address\\\":\\\"0x0a2586d5a901c8e7e68f6b0dc83bfd8bd8600ff5\\\",\\\"memo\\\":\\\"\\\",\\\"chainId\\\":\\\"eth\\\",\\\"to\\\":\\\"MAIN\\\",\\\"expirationDate\\\":0,\\\"currency\\\":\\\"USDT\\\",\\\"contractAddress\\\":\\\"0xdac17f958d2ee523a2206206994597c13d831ec7\\\",\\\"chainName\\\":\\\"ERC20\\\"}]}", - "x-request-example": "{\\\"currency\\\": \\\"BTC\\\", \\\"amount\\\": \\\"example_string_default_value\\\", \\\"chain\\\": \\\"example_string_default_value\\\"}" + "x-request-example": "{\\\"currency\\\": \\\"BTC\\\", \\\"amount\\\": \\\"example_string_default_value\\\", \\\"chain\\\": \\\"example_string_default_value\\\"}", + "operationId": "002" } }, "/api/v1/deposits": { @@ -566,7 +568,8 @@ "x-sdk-method-description": "Request via this endpoint to get deposit list Items are paginated and sorted to show the latest first. See the Pagination section for retrieving additional entries after the first page.", "x-api-rate-limit": 5, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"currentPage\\\": 1,\\n \\\"pageSize\\\": 50,\\n \\\"totalNum\\\": 5,\\n \\\"totalPage\\\": 1,\\n \\\"items\\\": [\\n {\\n \\\"currency\\\": \\\"USDT\\\",\\n \\\"chain\\\": \\\"\\\",\\n \\\"status\\\": \\\"SUCCESS\\\",\\n \\\"address\\\": \\\"a435*****@gmail.com\\\",\\n \\\"memo\\\": \\\"\\\",\\n \\\"isInner\\\": true,\\n \\\"amount\\\": \\\"1.00000000\\\",\\n \\\"fee\\\": \\\"0.00000000\\\",\\n \\\"walletTxId\\\": null,\\n \\\"createdAt\\\": 1728555875000,\\n \\\"updatedAt\\\": 1728555875000,\\n \\\"remark\\\": \\\"\\\",\\n \\\"arrears\\\": false\\n },\\n {\\n \\\"currency\\\": \\\"USDT\\\",\\n \\\"chain\\\": \\\"trx\\\",\\n \\\"status\\\": \\\"SUCCESS\\\",\\n \\\"address\\\": \\\"TSv3L1fS7******X4nLP6rqNxYz\\\",\\n \\\"memo\\\": \\\"\\\",\\n \\\"isInner\\\": true,\\n \\\"amount\\\": \\\"6.00000000\\\",\\n \\\"fee\\\": \\\"0.00000000\\\",\\n \\\"walletTxId\\\": null,\\n \\\"createdAt\\\": 1721730920000,\\n \\\"updatedAt\\\": 1721730920000,\\n \\\"remark\\\": \\\"\\\",\\n \\\"arrears\\\": false\\n }\\n ]\\n }\\n}", - "x-request-example": "{\\\"currency\\\": \\\"BTC\\\", \\\"status\\\": \\\"SUCCESS\\\", \\\"startAt\\\": 1728663338000, \\\"endAt\\\": 1728692138000, \\\"currentPage\\\": 1, \\\"pageSize\\\": 50}" + "x-request-example": "{\\\"currency\\\": \\\"BTC\\\", \\\"status\\\": \\\"SUCCESS\\\", \\\"startAt\\\": 1728663338000, \\\"endAt\\\": 1728692138000, \\\"currentPage\\\": 1, \\\"pageSize\\\": 50}", + "operationId": "003" } }, "/api/v2/deposit-addresses": { @@ -703,7 +706,8 @@ "x-sdk-method-description": "Get all deposit addresses for the currency you intend to deposit. If the returned data is empty, you may need to Add Deposit Address first.", "x-api-rate-limit": 5, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": [\\n {\\n \\\"address\\\": \\\"0x02028456*****87ede7a73d7c\\\",\\n \\\"memo\\\": \\\"\\\",\\n \\\"chain\\\": \\\"ERC20\\\",\\n \\\"chainId\\\": \\\"eth\\\",\\n \\\"to\\\": \\\"MAIN\\\",\\n \\\"currency\\\": \\\"ETH\\\",\\n \\\"contractAddress\\\": \\\"\\\"\\n }\\n ]\\n}", - "x-request-example": "{\\\"currency\\\": \\\"BTC\\\"}" + "x-request-example": "{\\\"currency\\\": \\\"BTC\\\"}", + "operationId": "004" } }, "/api/v1/deposit-addresses": { @@ -858,7 +862,8 @@ "x-sdk-method-description": "Get all deposit addresses for the currency you intend to deposit. If the returned data is empty, you may need to Add Deposit Address first.", "x-api-rate-limit": 5, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"address\\\": \\\"0xea220bf61c3c2b0adc2cfa29fec3d2677745a379\\\",\\n \\\"memo\\\": \\\"\\\",\\n \\\"chain\\\": \\\"ERC20\\\",\\n \\\"chainId\\\": \\\"eth\\\",\\n \\\"to\\\": \\\"MAIN\\\",\\n \\\"currency\\\": \\\"USDT\\\"\\n }\\n}", - "x-request-example": "{\\\"currency\\\": \\\"BTC\\\", \\\"chain\\\": \\\"eth\\\"}" + "x-request-example": "{\\\"currency\\\": \\\"BTC\\\", \\\"chain\\\": \\\"eth\\\"}", + "operationId": "005" }, "post": { "summary": "Add Deposit Address - V1", @@ -1020,7 +1025,8 @@ } }, "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"address\\\":\\\"0x02028456f38e78609904e8a002c787ede7a73d7c\\\",\\\"memo\\\":null,\\\"chain\\\":\\\"ERC20\\\",\\\"chainId\\\":\\\"eth\\\",\\\"to\\\":\\\"MAIN\\\",\\\"currency\\\":\\\"ETH\\\"}}", - "x-request-example": "{\\\"currency\\\": \\\"ETH\\\", \\\"chain\\\": \\\"eth\\\"}" + "x-request-example": "{\\\"currency\\\": \\\"ETH\\\", \\\"chain\\\": \\\"eth\\\"}", + "operationId": "007" } }, "/api/v1/hist-deposits": { @@ -1210,7 +1216,8 @@ "x-sdk-method-description": "Request via this endpoint to get the V1 historical deposits list on KuCoin. The return value is the data after Pagination, sorted in descending order according to time.", "x-api-rate-limit": 5, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"currentPage\\\": 1,\\n \\\"pageSize\\\": 50,\\n \\\"totalNum\\\": 0,\\n \\\"totalPage\\\": 0,\\n \\\"items\\\": [\\n {\\n \\\"currency\\\": \\\"BTC\\\",\\n \\\"createAt\\\": 1528536998,\\n \\\"amount\\\": \\\"0.03266638\\\",\\n \\\"walletTxId\\\": \\\"55c643bc2c68d6f17266383ac1be9e454038864b929ae7cee0bc408cc5c869e8@12ffGWmMMD1zA1WbFm7Ho3JZ1w6NYXjpFk@234\\\",\\n \\\"isInner\\\": false,\\n \\\"status\\\": \\\"SUCCESS\\\"\\n }\\n ]\\n }\\n}", - "x-request-example": "{\\\"currency\\\": \\\"BTC\\\", \\\"status\\\": \\\"SUCCESS\\\", \\\"startAt\\\": 1728663338000, \\\"endAt\\\": 1728692138000}" + "x-request-example": "{\\\"currency\\\": \\\"BTC\\\", \\\"status\\\": \\\"SUCCESS\\\", \\\"startAt\\\": 1728663338000, \\\"endAt\\\": 1728692138000}", + "operationId": "006" } } }, diff --git a/spec/rest/api/openapi-account-fee.json b/spec/rest/api/openapi-account-fee.json index ea46adbb..c6f859bc 100644 --- a/spec/rest/api/openapi-account-fee.json +++ b/spec/rest/api/openapi-account-fee.json @@ -94,7 +94,8 @@ "x-sdk-method-description": "This interface is for the spot/margin basic fee rate of users", "x-api-rate-limit": 3, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"takerFeeRate\\\": \\\"0.001\\\",\\n \\\"makerFeeRate\\\": \\\"0.001\\\"\\n }\\n}", - "x-request-example": "{\\\"currencyType\\\": 1}" + "x-request-example": "{\\\"currencyType\\\": 1}", + "operationId": "001" } }, "/api/v1/trade-fees": { @@ -176,7 +177,8 @@ "x-sdk-method-description": "This interface is for the actual fee rate of the trading pair. You can inquire about fee rates of 10 trading pairs each time at most. The fee rate of your sub-account is the same as that of the master account.", "x-api-rate-limit": 3, "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":[{\\\"symbol\\\":\\\"BTC-USDT\\\",\\\"takerFeeRate\\\":\\\"0.001\\\",\\\"makerFeeRate\\\":\\\"0.001\\\"},{\\\"symbol\\\":\\\"ETH-USDT\\\",\\\"takerFeeRate\\\":\\\"0.001\\\",\\\"makerFeeRate\\\":\\\"0.001\\\"}]}", - "x-request-example": "{\\\"symbols\\\": \\\"BTC-USDT,ETH-USDT\\\"}" + "x-request-example": "{\\\"symbols\\\": \\\"BTC-USDT,ETH-USDT\\\"}", + "operationId": "002" }, "patch": { "summary": "Get Actual Fee - Futures", @@ -255,6 +257,7 @@ "x-api-rate-limit": 3, "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"symbol\\\":\\\"XBTUSDTM\\\",\\\"takerFeeRate\\\":\\\"0.0006\\\",\\\"makerFeeRate\\\":\\\"0.0002\\\"}}", "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDTM\\\"}", + "operationId": "003", "x-original-method": "get" } } diff --git a/spec/rest/api/openapi-account-subaccount.json b/spec/rest/api/openapi-account-subaccount.json index a0de5700..5535aabb 100644 --- a/spec/rest/api/openapi-account-subaccount.json +++ b/spec/rest/api/openapi-account-subaccount.json @@ -130,7 +130,8 @@ } }, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"currentPage\\\": 1,\\n \\\"pageSize\\\": 10,\\n \\\"totalNum\\\": 1,\\n \\\"totalPage\\\": 1,\\n \\\"items\\\": [\\n {\\n \\\"userId\\\": \\\"63743f07e0c5230001761d08\\\",\\n \\\"uid\\\": 169579801,\\n \\\"subName\\\": \\\"testapi6\\\",\\n \\\"status\\\": 2,\\n \\\"type\\\": 0,\\n \\\"access\\\": \\\"All\\\",\\n \\\"createdAt\\\": 1668562696000,\\n \\\"remarks\\\": \\\"remarks\\\",\\n \\\"tradeTypes\\\": [\\n \\\"Spot\\\",\\n \\\"Futures\\\",\\n \\\"Margin\\\"\\n ],\\n \\\"openedTradeTypes\\\": [\\n \\\"Spot\\\"\\n ],\\n \\\"hostedStatus\\\": null\\n }\\n ]\\n }\\n}", - "x-request-example": "{\\\"password\\\": \\\"1234567\\\", \\\"remarks\\\": \\\"TheRemark\\\", \\\"subName\\\": \\\"Name1234567\\\", \\\"access\\\": \\\"Spot\\\"}" + "x-request-example": "{\\\"password\\\": \\\"1234567\\\", \\\"remarks\\\": \\\"TheRemark\\\", \\\"subName\\\": \\\"Name1234567\\\", \\\"access\\\": \\\"Spot\\\"}", + "operationId": "001" } }, "/api/v3/sub/user/margin/enable": { @@ -196,7 +197,8 @@ } }, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": null\\n}", - "x-request-example": "{\\\"uid\\\": \\\"169579801\\\"}" + "x-request-example": "{\\\"uid\\\": \\\"169579801\\\"}", + "operationId": "002" } }, "/api/v3/sub/user/futures/enable": { @@ -262,7 +264,8 @@ } }, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": null\\n}", - "x-request-example": "{\\\"uid\\\": \\\"169579801\\\"}" + "x-request-example": "{\\\"uid\\\": \\\"169579801\\\"}", + "operationId": "003" } }, "/api/v2/sub/user": { @@ -470,7 +473,8 @@ "x-sdk-method-description": "This endpoint can be used to get a paginated list of sub-accounts. Pagination is required.", "x-api-rate-limit": 20, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"currentPage\\\": 1,\\n \\\"pageSize\\\": 10,\\n \\\"totalNum\\\": 1,\\n \\\"totalPage\\\": 1,\\n \\\"items\\\": [\\n {\\n \\\"userId\\\": \\\"63743f07e0c5230001761d08\\\",\\n \\\"uid\\\": 169579801,\\n \\\"subName\\\": \\\"testapi6\\\",\\n \\\"status\\\": 2,\\n \\\"type\\\": 0,\\n \\\"access\\\": \\\"All\\\",\\n \\\"createdAt\\\": 1668562696000,\\n \\\"remarks\\\": \\\"remarks\\\",\\n \\\"tradeTypes\\\": [\\n \\\"Spot\\\",\\n \\\"Futures\\\",\\n \\\"Margin\\\"\\n ],\\n \\\"openedTradeTypes\\\": [\\n \\\"Spot\\\"\\n ],\\n \\\"hostedStatus\\\": null\\n }\\n ]\\n }\\n}", - "x-request-example": "{\\\"currentPage\\\": 1, \\\"pageSize\\\": 10}" + "x-request-example": "{\\\"currentPage\\\": 1, \\\"pageSize\\\": 10}", + "operationId": "004" } }, "/api/v1/sub-accounts/{subUserId}": { @@ -680,7 +684,8 @@ "x-sdk-method-description": "This endpoint returns the account info of a sub-user specified by the subUserId.", "x-api-rate-limit": 15, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"subUserId\\\": \\\"63743f07e0c5230001761d08\\\",\\n \\\"subName\\\": \\\"testapi6\\\",\\n \\\"mainAccounts\\\": [\\n {\\n \\\"currency\\\": \\\"USDT\\\",\\n \\\"balance\\\": \\\"0.01\\\",\\n \\\"available\\\": \\\"0.01\\\",\\n \\\"holds\\\": \\\"0\\\",\\n \\\"baseCurrency\\\": \\\"BTC\\\",\\n \\\"baseCurrencyPrice\\\": \\\"62384.3\\\",\\n \\\"baseAmount\\\": \\\"0.00000016\\\",\\n \\\"tag\\\": \\\"DEFAULT\\\"\\n }\\n ],\\n \\\"tradeAccounts\\\": [\\n {\\n \\\"currency\\\": \\\"USDT\\\",\\n \\\"balance\\\": \\\"0.01\\\",\\n \\\"available\\\": \\\"0.01\\\",\\n \\\"holds\\\": \\\"0\\\",\\n \\\"baseCurrency\\\": \\\"BTC\\\",\\n \\\"baseCurrencyPrice\\\": \\\"62384.3\\\",\\n \\\"baseAmount\\\": \\\"0.00000016\\\",\\n \\\"tag\\\": \\\"DEFAULT\\\"\\n }\\n ],\\n \\\"marginAccounts\\\": [\\n {\\n \\\"currency\\\": \\\"USDT\\\",\\n \\\"balance\\\": \\\"0.01\\\",\\n \\\"available\\\": \\\"0.01\\\",\\n \\\"holds\\\": \\\"0\\\",\\n \\\"baseCurrency\\\": \\\"BTC\\\",\\n \\\"baseCurrencyPrice\\\": \\\"62384.3\\\",\\n \\\"baseAmount\\\": \\\"0.00000016\\\",\\n \\\"tag\\\": \\\"DEFAULT\\\"\\n }\\n ],\\n \\\"tradeHFAccounts\\\": []\\n }\\n}", - "x-request-example": "{\\\"subUserId\\\": \\\"63743f07e0c5230001761d08\\\", \\\"includeBaseAmount\\\": true}" + "x-request-example": "{\\\"subUserId\\\": \\\"63743f07e0c5230001761d08\\\", \\\"includeBaseAmount\\\": true}", + "operationId": "005" } }, "/api/v2/sub-accounts": { @@ -927,7 +932,8 @@ "x-sdk-method-description": "This endpoint can be used to get paginated Spot sub-account information. Pagination is required.", "x-api-rate-limit": 20, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"currentPage\\\": 1,\\n \\\"pageSize\\\": 10,\\n \\\"totalNum\\\": 3,\\n \\\"totalPage\\\": 1,\\n \\\"items\\\": [\\n {\\n \\\"subUserId\\\": \\\"63743f07e0c5230001761d08\\\",\\n \\\"subName\\\": \\\"testapi6\\\",\\n \\\"mainAccounts\\\": [\\n {\\n \\\"currency\\\": \\\"USDT\\\",\\n \\\"balance\\\": \\\"0.01\\\",\\n \\\"available\\\": \\\"0.01\\\",\\n \\\"holds\\\": \\\"0\\\",\\n \\\"baseCurrency\\\": \\\"BTC\\\",\\n \\\"baseCurrencyPrice\\\": \\\"62514.5\\\",\\n \\\"baseAmount\\\": \\\"0.00000015\\\",\\n \\\"tag\\\": \\\"DEFAULT\\\"\\n }\\n ],\\n \\\"tradeAccounts\\\": [\\n {\\n \\\"currency\\\": \\\"USDT\\\",\\n \\\"balance\\\": \\\"0.01\\\",\\n \\\"available\\\": \\\"0.01\\\",\\n \\\"holds\\\": \\\"0\\\",\\n \\\"baseCurrency\\\": \\\"BTC\\\",\\n \\\"baseCurrencyPrice\\\": \\\"62514.5\\\",\\n \\\"baseAmount\\\": \\\"0.00000015\\\",\\n \\\"tag\\\": \\\"DEFAULT\\\"\\n }\\n ],\\n \\\"marginAccounts\\\": [\\n {\\n \\\"currency\\\": \\\"USDT\\\",\\n \\\"balance\\\": \\\"0.01\\\",\\n \\\"available\\\": \\\"0.01\\\",\\n \\\"holds\\\": \\\"0\\\",\\n \\\"baseCurrency\\\": \\\"BTC\\\",\\n \\\"baseCurrencyPrice\\\": \\\"62514.5\\\",\\n \\\"baseAmount\\\": \\\"0.00000015\\\",\\n \\\"tag\\\": \\\"DEFAULT\\\"\\n }\\n ],\\n \\\"tradeHFAccounts\\\": []\\n },\\n {\\n \\\"subUserId\\\": \\\"670538a31037eb000115b076\\\",\\n \\\"subName\\\": \\\"Name1234567\\\",\\n \\\"mainAccounts\\\": [],\\n \\\"tradeAccounts\\\": [],\\n \\\"marginAccounts\\\": [],\\n \\\"tradeHFAccounts\\\": []\\n },\\n {\\n \\\"subUserId\\\": \\\"66b0c0905fc1480001c14c36\\\",\\n \\\"subName\\\": \\\"LTkucoin1491\\\",\\n \\\"mainAccounts\\\": [],\\n \\\"tradeAccounts\\\": [],\\n \\\"marginAccounts\\\": [],\\n \\\"tradeHFAccounts\\\": []\\n }\\n ]\\n }\\n}", - "x-request-example": "{\\\"currentPage\\\": 1, \\\"pageSize\\\": 10}" + "x-request-example": "{\\\"currentPage\\\": 1, \\\"pageSize\\\": 10}", + "operationId": "006" } }, "/api/v1/account-overview-all": { @@ -1091,7 +1097,8 @@ "x-sdk-method-description": "This endpoint can be used to get Futures sub-account information. ", "x-api-rate-limit": 6, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"summary\\\": {\\n \\\"accountEquityTotal\\\": 103.899081508,\\n \\\"unrealisedPNLTotal\\\": 38.81075,\\n \\\"marginBalanceTotal\\\": 65.336985668,\\n \\\"positionMarginTotal\\\": 68.9588320683,\\n \\\"orderMarginTotal\\\": 0,\\n \\\"frozenFundsTotal\\\": 0,\\n \\\"availableBalanceTotal\\\": 67.2492494397,\\n \\\"currency\\\": \\\"USDT\\\"\\n },\\n \\\"accounts\\\": [\\n {\\n \\\"accountName\\\": \\\"Name1234567\\\",\\n \\\"accountEquity\\\": 0,\\n \\\"unrealisedPNL\\\": 0,\\n \\\"marginBalance\\\": 0,\\n \\\"positionMargin\\\": 0,\\n \\\"orderMargin\\\": 0,\\n \\\"frozenFunds\\\": 0,\\n \\\"availableBalance\\\": 0,\\n \\\"currency\\\": \\\"USDT\\\"\\n },\\n {\\n \\\"accountName\\\": \\\"LTkucoin1491\\\",\\n \\\"accountEquity\\\": 0,\\n \\\"unrealisedPNL\\\": 0,\\n \\\"marginBalance\\\": 0,\\n \\\"positionMargin\\\": 0,\\n \\\"orderMargin\\\": 0,\\n \\\"frozenFunds\\\": 0,\\n \\\"availableBalance\\\": 0,\\n \\\"currency\\\": \\\"USDT\\\"\\n },\\n {\\n \\\"accountName\\\": \\\"manage112233\\\",\\n \\\"accountEquity\\\": 0,\\n \\\"unrealisedPNL\\\": 0,\\n \\\"marginBalance\\\": 0,\\n \\\"positionMargin\\\": 0,\\n \\\"orderMargin\\\": 0,\\n \\\"frozenFunds\\\": 0,\\n \\\"availableBalance\\\": 0,\\n \\\"currency\\\": \\\"USDT\\\"\\n },\\n {\\n \\\"accountName\\\": \\\"testapi6\\\",\\n \\\"accountEquity\\\": 27.30545128,\\n \\\"unrealisedPNL\\\": 22.549,\\n \\\"marginBalance\\\": 4.75645128,\\n \\\"positionMargin\\\": 24.1223749975,\\n \\\"orderMargin\\\": 0,\\n \\\"frozenFunds\\\": 0,\\n \\\"availableBalance\\\": 25.7320762825,\\n \\\"currency\\\": \\\"USDT\\\"\\n },\\n {\\n \\\"accountName\\\": \\\"main\\\",\\n \\\"accountEquity\\\": 76.593630228,\\n \\\"unrealisedPNL\\\": 16.26175,\\n \\\"marginBalance\\\": 60.580534388,\\n \\\"positionMargin\\\": 44.8364570708,\\n \\\"orderMargin\\\": 0,\\n \\\"frozenFunds\\\": 0,\\n \\\"availableBalance\\\": 41.5171731572,\\n \\\"currency\\\": \\\"USDT\\\"\\n }\\n ]\\n }\\n}", - "x-request-example": "{\\\"currency\\\": \\\"USDT\\\"}" + "x-request-example": "{\\\"currency\\\": \\\"USDT\\\"}", + "operationId": "007" } }, "/api/v1/sub/api-key": { @@ -1270,7 +1277,8 @@ } }, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"subName\\\": \\\"testapi6\\\",\\n \\\"remark\\\": \\\"TheRemark\\\",\\n \\\"apiKey\\\": \\\"670621e3a25958000159c82f\\\",\\n \\\"apiSecret\\\": \\\"46fd8974******896f005b2340\\\",\\n \\\"apiVersion\\\": 3,\\n \\\"passphrase\\\": \\\"11223344\\\",\\n \\\"permission\\\": \\\"General,Futures\\\",\\n \\\"createdAt\\\": 1728455139000\\n }\\n}", - "x-request-example": "{\\\"subName\\\": \\\"testapi6\\\", \\\"passphrase\\\": \\\"11223344\\\", \\\"remark\\\": \\\"TheRemark\\\", \\\"permission\\\": \\\"General,Spot,Futures\\\"}" + "x-request-example": "{\\\"subName\\\": \\\"testapi6\\\", \\\"passphrase\\\": \\\"11223344\\\", \\\"remark\\\": \\\"TheRemark\\\", \\\"permission\\\": \\\"General,Spot,Futures\\\"}", + "operationId": "008" }, "get": { "summary": "Get SubAccount API List", @@ -1375,7 +1383,8 @@ "x-sdk-method-description": "This endpoint can be used to obtain a list of APIs pertaining to a sub-account.(Not contain ND Broker Sub Account)", "x-api-rate-limit": 20, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": [\\n {\\n \\\"subName\\\": \\\"apiSdkTest\\\",\\n \\\"remark\\\": \\\"sdk_test_integration\\\",\\n \\\"apiKey\\\": \\\"673eab2a955ebf000195d7e4\\\",\\n \\\"apiVersion\\\": 3,\\n \\\"permission\\\": \\\"General\\\",\\n \\\"ipWhitelist\\\": \\\"10.**.1\\\",\\n \\\"createdAt\\\": 1732160298000,\\n \\\"uid\\\": 215112467,\\n \\\"isMaster\\\": false\\n }\\n ]\\n}", - "x-request-example": "{\\\"apiKey\\\": \\\"example_string_default_value\\\", \\\"subName\\\": \\\"testapi6\\\"}" + "x-request-example": "{\\\"apiKey\\\": \\\"example_string_default_value\\\", \\\"subName\\\": \\\"testapi6\\\"}", + "operationId": "010" }, "delete": { "summary": "Delete SubAccount API", @@ -1461,7 +1470,8 @@ "x-sdk-method-description": "This endpoint can be used to delete sub-account APIs.", "x-api-rate-limit": 30, "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"subName\\\":\\\"testapi6\\\",\\\"apiKey\\\":\\\"670621e3a25958000159c82f\\\"}}", - "x-request-example": "{\\\"apiKey\\\": \\\"670621e3a25958000159c82f\\\", \\\"subName\\\": \\\"testapi6\\\", \\\"passphrase\\\": \\\"11223344\\\"}" + "x-request-example": "{\\\"apiKey\\\": \\\"670621e3a25958000159c82f\\\", \\\"subName\\\": \\\"testapi6\\\", \\\"passphrase\\\": \\\"11223344\\\"}", + "operationId": "011" } }, "/api/v1/sub/api-key/update": { @@ -1614,7 +1624,8 @@ } }, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"subName\\\": \\\"testapi6\\\",\\n \\\"apiKey\\\": \\\"670621e3a25958000159c82f\\\",\\n \\\"permission\\\": \\\"General,Futures,Spot\\\"\\n }\\n}", - "x-request-example": "{\\\"subName\\\": \\\"testapi6\\\", \\\"apiKey\\\": \\\"670621e3a25958000159c82f\\\", \\\"passphrase\\\": \\\"11223344\\\", \\\"permission\\\": \\\"General,Spot,Futures\\\"}" + "x-request-example": "{\\\"subName\\\": \\\"testapi6\\\", \\\"apiKey\\\": \\\"670621e3a25958000159c82f\\\", \\\"passphrase\\\": \\\"11223344\\\", \\\"permission\\\": \\\"General,Spot,Futures\\\"}", + "operationId": "009" } }, "/api/v1/sub/user": { @@ -1691,7 +1702,8 @@ "x-sdk-method-name": "getSpotSubAccountsSummaryV1", "x-sdk-method-description": "You can get the user info of all sub-account via this interface It is recommended to use the GET /api/v2/sub/user interface for paging query", "x-api-rate-limit": 20, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": [\\n {\\n \\\"userId\\\": \\\"63743f07e0c5230001761d08\\\",\\n \\\"uid\\\": 169579801,\\n \\\"subName\\\": \\\"testapi6\\\",\\n \\\"type\\\": 0,\\n \\\"remarks\\\": \\\"remarks\\\",\\n \\\"access\\\": \\\"All\\\"\\n },\\n {\\n \\\"userId\\\": \\\"670538a31037eb000115b076\\\",\\n \\\"uid\\\": 225139445,\\n \\\"subName\\\": \\\"Name1234567\\\",\\n \\\"type\\\": 0,\\n \\\"remarks\\\": \\\"TheRemark\\\",\\n \\\"access\\\": \\\"All\\\"\\n }\\n ]\\n}" + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": [\\n {\\n \\\"userId\\\": \\\"63743f07e0c5230001761d08\\\",\\n \\\"uid\\\": 169579801,\\n \\\"subName\\\": \\\"testapi6\\\",\\n \\\"type\\\": 0,\\n \\\"remarks\\\": \\\"remarks\\\",\\n \\\"access\\\": \\\"All\\\"\\n },\\n {\\n \\\"userId\\\": \\\"670538a31037eb000115b076\\\",\\n \\\"uid\\\": 225139445,\\n \\\"subName\\\": \\\"Name1234567\\\",\\n \\\"type\\\": 0,\\n \\\"remarks\\\": \\\"TheRemark\\\",\\n \\\"access\\\": \\\"All\\\"\\n }\\n ]\\n}", + "operationId": "012" } }, "/api/v1/sub-accounts": { @@ -1884,7 +1896,8 @@ "x-sdk-method-name": "getSpotSubAccountListV1", "x-sdk-method-description": "This endpoint returns the account info of all sub-users.", "x-api-rate-limit": 20, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": [\\n {\\n \\\"subUserId\\\": \\\"63743f07e0c5230001761d08\\\",\\n \\\"subName\\\": \\\"testapi6\\\",\\n \\\"mainAccounts\\\": [\\n {\\n \\\"currency\\\": \\\"USDT\\\",\\n \\\"balance\\\": \\\"0.01\\\",\\n \\\"available\\\": \\\"0.01\\\",\\n \\\"holds\\\": \\\"0\\\",\\n \\\"baseCurrency\\\": \\\"BTC\\\",\\n \\\"baseCurrencyPrice\\\": \\\"62489.8\\\",\\n \\\"baseAmount\\\": \\\"0.00000016\\\",\\n \\\"tag\\\": \\\"DEFAULT\\\"\\n }\\n ],\\n \\\"tradeAccounts\\\": [\\n {\\n \\\"currency\\\": \\\"USDT\\\",\\n \\\"balance\\\": \\\"0.01\\\",\\n \\\"available\\\": \\\"0.01\\\",\\n \\\"holds\\\": \\\"0\\\",\\n \\\"baseCurrency\\\": \\\"BTC\\\",\\n \\\"baseCurrencyPrice\\\": \\\"62489.8\\\",\\n \\\"baseAmount\\\": \\\"0.00000016\\\",\\n \\\"tag\\\": \\\"DEFAULT\\\"\\n }\\n ],\\n \\\"marginAccounts\\\": [\\n {\\n \\\"currency\\\": \\\"USDT\\\",\\n \\\"balance\\\": \\\"0.01\\\",\\n \\\"available\\\": \\\"0.01\\\",\\n \\\"holds\\\": \\\"0\\\",\\n \\\"baseCurrency\\\": \\\"BTC\\\",\\n \\\"baseCurrencyPrice\\\": \\\"62489.8\\\",\\n \\\"baseAmount\\\": \\\"0.00000016\\\",\\n \\\"tag\\\": \\\"DEFAULT\\\"\\n }\\n ],\\n \\\"tradeHFAccounts\\\": []\\n },\\n {\\n \\\"subUserId\\\": \\\"670538a31037eb000115b076\\\",\\n \\\"subName\\\": \\\"Name1234567\\\",\\n \\\"mainAccounts\\\": [],\\n \\\"tradeAccounts\\\": [],\\n \\\"marginAccounts\\\": [],\\n \\\"tradeHFAccounts\\\": []\\n },\\n {\\n \\\"subUserId\\\": \\\"66b0c0905fc1480001c14c36\\\",\\n \\\"subName\\\": \\\"LTkucoin1491\\\",\\n \\\"mainAccounts\\\": [],\\n \\\"tradeAccounts\\\": [],\\n \\\"marginAccounts\\\": [],\\n \\\"tradeHFAccounts\\\": []\\n }\\n ]\\n}" + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": [\\n {\\n \\\"subUserId\\\": \\\"63743f07e0c5230001761d08\\\",\\n \\\"subName\\\": \\\"testapi6\\\",\\n \\\"mainAccounts\\\": [\\n {\\n \\\"currency\\\": \\\"USDT\\\",\\n \\\"balance\\\": \\\"0.01\\\",\\n \\\"available\\\": \\\"0.01\\\",\\n \\\"holds\\\": \\\"0\\\",\\n \\\"baseCurrency\\\": \\\"BTC\\\",\\n \\\"baseCurrencyPrice\\\": \\\"62489.8\\\",\\n \\\"baseAmount\\\": \\\"0.00000016\\\",\\n \\\"tag\\\": \\\"DEFAULT\\\"\\n }\\n ],\\n \\\"tradeAccounts\\\": [\\n {\\n \\\"currency\\\": \\\"USDT\\\",\\n \\\"balance\\\": \\\"0.01\\\",\\n \\\"available\\\": \\\"0.01\\\",\\n \\\"holds\\\": \\\"0\\\",\\n \\\"baseCurrency\\\": \\\"BTC\\\",\\n \\\"baseCurrencyPrice\\\": \\\"62489.8\\\",\\n \\\"baseAmount\\\": \\\"0.00000016\\\",\\n \\\"tag\\\": \\\"DEFAULT\\\"\\n }\\n ],\\n \\\"marginAccounts\\\": [\\n {\\n \\\"currency\\\": \\\"USDT\\\",\\n \\\"balance\\\": \\\"0.01\\\",\\n \\\"available\\\": \\\"0.01\\\",\\n \\\"holds\\\": \\\"0\\\",\\n \\\"baseCurrency\\\": \\\"BTC\\\",\\n \\\"baseCurrencyPrice\\\": \\\"62489.8\\\",\\n \\\"baseAmount\\\": \\\"0.00000016\\\",\\n \\\"tag\\\": \\\"DEFAULT\\\"\\n }\\n ],\\n \\\"tradeHFAccounts\\\": []\\n },\\n {\\n \\\"subUserId\\\": \\\"670538a31037eb000115b076\\\",\\n \\\"subName\\\": \\\"Name1234567\\\",\\n \\\"mainAccounts\\\": [],\\n \\\"tradeAccounts\\\": [],\\n \\\"marginAccounts\\\": [],\\n \\\"tradeHFAccounts\\\": []\\n },\\n {\\n \\\"subUserId\\\": \\\"66b0c0905fc1480001c14c36\\\",\\n \\\"subName\\\": \\\"LTkucoin1491\\\",\\n \\\"mainAccounts\\\": [],\\n \\\"tradeAccounts\\\": [],\\n \\\"marginAccounts\\\": [],\\n \\\"tradeHFAccounts\\\": []\\n }\\n ]\\n}", + "operationId": "013" } } }, diff --git a/spec/rest/api/openapi-account-transfer.json b/spec/rest/api/openapi-account-transfer.json index 75a39cfe..77166224 100644 --- a/spec/rest/api/openapi-account-transfer.json +++ b/spec/rest/api/openapi-account-transfer.json @@ -151,7 +151,8 @@ "x-sdk-method-description": "This endpoint returns the transferable balance of a specified account.", "x-api-rate-limit": 20, "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"currency\\\":\\\"USDT\\\",\\\"balance\\\":\\\"10.5\\\",\\\"available\\\":\\\"10.5\\\",\\\"holds\\\":\\\"0\\\",\\\"transferable\\\":\\\"10.5\\\"}}", - "x-request-example": "{\\\"currency\\\": \\\"BTC\\\", \\\"type\\\": \\\"MAIN\\\", \\\"tag\\\": \\\"ETH-USDT\\\"}" + "x-request-example": "{\\\"currency\\\": \\\"BTC\\\", \\\"type\\\": \\\"MAIN\\\", \\\"tag\\\": \\\"ETH-USDT\\\"}", + "operationId": "001" } }, "/api/v3/accounts/universal-transfer": { @@ -393,7 +394,8 @@ } }, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"orderId\\\": \\\"6705f7248c6954000733ecac\\\"\\n }\\n}", - "x-request-example": "{\\\"clientOid\\\": \\\"64ccc0f164781800010d8c09\\\", \\\"type\\\": \\\"PARENT_TO_SUB\\\", \\\"currency\\\": \\\"USDT\\\", \\\"amount\\\": \\\"0.01\\\", \\\"fromAccountType\\\": \\\"TRADE\\\", \\\"toUserId\\\": \\\"63743f07e0c5230001761d08\\\", \\\"toAccountType\\\": \\\"TRADE\\\"}" + "x-request-example": "{\\\"clientOid\\\": \\\"64ccc0f164781800010d8c09\\\", \\\"type\\\": \\\"PARENT_TO_SUB\\\", \\\"currency\\\": \\\"USDT\\\", \\\"amount\\\": \\\"0.01\\\", \\\"fromAccountType\\\": \\\"TRADE\\\", \\\"toUserId\\\": \\\"63743f07e0c5230001761d08\\\", \\\"toAccountType\\\": \\\"TRADE\\\"}", + "operationId": "002" } }, "/api/v2/accounts/sub-transfer": { @@ -575,7 +577,8 @@ } }, "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"orderId\\\":\\\"670be6b0b1b9080007040a9b\\\"}}", - "x-request-example": "{\\\"clientOid\\\": \\\"64ccc0f164781800010d8c09\\\", \\\"currency\\\": \\\"USDT\\\", \\\"amount\\\": \\\"0.01\\\", \\\"direction\\\": \\\"OUT\\\", \\\"accountType\\\": \\\"MAIN\\\", \\\"subAccountType\\\": \\\"MAIN\\\", \\\"subUserId\\\": \\\"63743f07e0c5230001761d08\\\"}" + "x-request-example": "{\\\"clientOid\\\": \\\"64ccc0f164781800010d8c09\\\", \\\"currency\\\": \\\"USDT\\\", \\\"amount\\\": \\\"0.01\\\", \\\"direction\\\": \\\"OUT\\\", \\\"accountType\\\": \\\"MAIN\\\", \\\"subAccountType\\\": \\\"MAIN\\\", \\\"subUserId\\\": \\\"63743f07e0c5230001761d08\\\"}", + "operationId": "003" } }, "/api/v2/accounts/inner-transfer": { @@ -770,7 +773,8 @@ } }, "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"orderId\\\":\\\"670beb3482a1bb0007dec644\\\"}}", - "x-request-example": "{\\\"clientOid\\\": \\\"64ccc0f164781800010d8c09\\\", \\\"currency\\\": \\\"USDT\\\", \\\"amount\\\": \\\"0.01\\\", \\\"from\\\": \\\"main\\\", \\\"to\\\": \\\"trade\\\"}" + "x-request-example": "{\\\"clientOid\\\": \\\"64ccc0f164781800010d8c09\\\", \\\"currency\\\": \\\"USDT\\\", \\\"amount\\\": \\\"0.01\\\", \\\"from\\\": \\\"main\\\", \\\"to\\\": \\\"trade\\\"}", + "operationId": "004" } }, "/api/v3/transfer-out": { @@ -960,7 +964,8 @@ } }, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"applyId\\\": \\\"670bf84c577f6c00017a1c48\\\",\\n \\\"bizNo\\\": \\\"670bf84c577f6c00017a1c47\\\",\\n \\\"payAccountType\\\": \\\"CONTRACT\\\",\\n \\\"payTag\\\": \\\"DEFAULT\\\",\\n \\\"remark\\\": \\\"\\\",\\n \\\"recAccountType\\\": \\\"MAIN\\\",\\n \\\"recTag\\\": \\\"DEFAULT\\\",\\n \\\"recRemark\\\": \\\"\\\",\\n \\\"recSystem\\\": \\\"KUCOIN\\\",\\n \\\"status\\\": \\\"PROCESSING\\\",\\n \\\"currency\\\": \\\"USDT\\\",\\n \\\"amount\\\": \\\"0.01\\\",\\n \\\"fee\\\": \\\"0\\\",\\n \\\"sn\\\": 1519769124134806,\\n \\\"reason\\\": \\\"\\\",\\n \\\"createdAt\\\": 1728837708000,\\n \\\"updatedAt\\\": 1728837708000\\n }\\n}", - "x-request-example": "{\\\"currency\\\": \\\"USDT\\\", \\\"amount\\\": 0.01, \\\"recAccountType\\\": \\\"MAIN\\\"}" + "x-request-example": "{\\\"currency\\\": \\\"USDT\\\", \\\"amount\\\": 0.01, \\\"recAccountType\\\": \\\"MAIN\\\"}", + "operationId": "005" } }, "/api/v1/transfer-in": { @@ -1057,7 +1062,8 @@ } }, "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":null}", - "x-request-example": "{\\\"currency\\\": \\\"USDT\\\", \\\"amount\\\": 0.01, \\\"payAccountType\\\": \\\"MAIN\\\"}" + "x-request-example": "{\\\"currency\\\": \\\"USDT\\\", \\\"amount\\\": 0.01, \\\"payAccountType\\\": \\\"MAIN\\\"}", + "operationId": "006" } }, "/api/v1/transfer-list": { @@ -1306,7 +1312,8 @@ "x-sdk-method-description": "This endpoint can get futures account transfer out ledger", "x-api-rate-limit": 20, "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"currentPage\\\":1,\\\"pageSize\\\":50,\\\"totalNum\\\":1,\\\"totalPage\\\":1,\\\"items\\\":[{\\\"applyId\\\":\\\"670bf84c577f6c00017a1c48\\\",\\\"currency\\\":\\\"USDT\\\",\\\"recRemark\\\":\\\"\\\",\\\"recSystem\\\":\\\"KUCOIN\\\",\\\"status\\\":\\\"SUCCESS\\\",\\\"amount\\\":\\\"0.01\\\",\\\"reason\\\":\\\"\\\",\\\"offset\\\":1519769124134806,\\\"createdAt\\\":1728837708000,\\\"remark\\\":\\\"\\\"}]}}", - "x-request-example": "{\\\"currency\\\": \\\"XBT\\\", \\\"type\\\": \\\"MAIN\\\", \\\"tag\\\": [\\\"mock_a\\\", \\\"mock_b\\\"], \\\"startAt\\\": 1728663338000, \\\"endAt\\\": 1728692138000, \\\"currentPage\\\": 1, \\\"pageSize\\\": 50}" + "x-request-example": "{\\\"currency\\\": \\\"XBT\\\", \\\"type\\\": \\\"MAIN\\\", \\\"tag\\\": [\\\"mock_a\\\", \\\"mock_b\\\"], \\\"startAt\\\": 1728663338000, \\\"endAt\\\": 1728692138000, \\\"currentPage\\\": 1, \\\"pageSize\\\": 50}", + "operationId": "007" } } }, diff --git a/spec/rest/api/openapi-account-withdrawal.json b/spec/rest/api/openapi-account-withdrawal.json index b1b88a10..78e08c4f 100644 --- a/spec/rest/api/openapi-account-withdrawal.json +++ b/spec/rest/api/openapi-account-withdrawal.json @@ -178,7 +178,8 @@ "x-sdk-method-description": "This interface can obtain the withdrawal quotas information of this currency.", "x-api-rate-limit": 20, "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"currency\\\":\\\"BTC\\\",\\\"limitBTCAmount\\\":\\\"15.79590095\\\",\\\"usedBTCAmount\\\":\\\"0.00000000\\\",\\\"quotaCurrency\\\":\\\"USDT\\\",\\\"limitQuotaCurrencyAmount\\\":\\\"999999.00000000\\\",\\\"usedQuotaCurrencyAmount\\\":\\\"0\\\",\\\"remainAmount\\\":\\\"15.79590095\\\",\\\"availableAmount\\\":\\\"0\\\",\\\"withdrawMinFee\\\":\\\"0.0005\\\",\\\"innerWithdrawMinFee\\\":\\\"0\\\",\\\"withdrawMinSize\\\":\\\"0.001\\\",\\\"isWithdrawEnabled\\\":true,\\\"precision\\\":8,\\\"chain\\\":\\\"BTC\\\",\\\"reason\\\":null,\\\"lockedAmount\\\":\\\"0\\\"}}", - "x-request-example": "{\\\"currency\\\": \\\"BTC\\\", \\\"chain\\\": \\\"eth\\\"}" + "x-request-example": "{\\\"currency\\\": \\\"BTC\\\", \\\"chain\\\": \\\"eth\\\"}", + "operationId": "001" } }, "/api/v3/withdrawals": { @@ -341,7 +342,8 @@ } }, "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"withdrawalId\\\":\\\"670deec84d64da0007d7c946\\\"}}", - "x-request-example": "{\\\"currency\\\": \\\"USDT\\\", \\\"toAddress\\\": \\\"TKFRQXSDcY****GmLrjJggwX8\\\", \\\"amount\\\": 3, \\\"withdrawType\\\": \\\"ADDRESS\\\", \\\"chain\\\": \\\"trx\\\", \\\"isInner\\\": true, \\\"remark\\\": \\\"this is Remark\\\"}" + "x-request-example": "{\\\"currency\\\": \\\"USDT\\\", \\\"toAddress\\\": \\\"TKFRQXSDcY****GmLrjJggwX8\\\", \\\"amount\\\": 3, \\\"withdrawType\\\": \\\"ADDRESS\\\", \\\"chain\\\": \\\"trx\\\", \\\"isInner\\\": true, \\\"remark\\\": \\\"this is Remark\\\"}", + "operationId": "002" } }, "/api/v1/withdrawals/{withdrawalId}": { @@ -397,7 +399,8 @@ "x-sdk-method-description": "This interface can cancel the withdrawal, Only withdrawals requests of PROCESSING status could be canceled.", "x-api-rate-limit": 20, "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":null}", - "x-request-example": "{\\\"withdrawalId\\\": \\\"670b891f7e0f440007730692\\\"}" + "x-request-example": "{\\\"withdrawalId\\\": \\\"670b891f7e0f440007730692\\\"}", + "operationId": "003" } }, "/api/v1/withdrawals": { @@ -663,7 +666,8 @@ "x-sdk-method-description": "Request via this endpoint to get deposit list Items are paginated and sorted to show the latest first. See the Pagination section for retrieving additional entries after the first page.", "x-api-rate-limit": 20, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"currentPage\\\": 1,\\n \\\"pageSize\\\": 50,\\n \\\"totalNum\\\": 5,\\n \\\"totalPage\\\": 1,\\n \\\"items\\\": [\\n {\\n \\\"currency\\\": \\\"USDT\\\",\\n \\\"chain\\\": \\\"\\\",\\n \\\"status\\\": \\\"SUCCESS\\\",\\n \\\"address\\\": \\\"a435*****@gmail.com\\\",\\n \\\"memo\\\": \\\"\\\",\\n \\\"isInner\\\": true,\\n \\\"amount\\\": \\\"1.00000000\\\",\\n \\\"fee\\\": \\\"0.00000000\\\",\\n \\\"walletTxId\\\": null,\\n \\\"createdAt\\\": 1728555875000,\\n \\\"updatedAt\\\": 1728555875000,\\n \\\"remark\\\": \\\"\\\",\\n \\\"arrears\\\": false\\n },\\n {\\n \\\"currency\\\": \\\"USDT\\\",\\n \\\"chain\\\": \\\"trx\\\",\\n \\\"status\\\": \\\"SUCCESS\\\",\\n \\\"address\\\": \\\"TSv3L1fS7******X4nLP6rqNxYz\\\",\\n \\\"memo\\\": \\\"\\\",\\n \\\"isInner\\\": true,\\n \\\"amount\\\": \\\"6.00000000\\\",\\n \\\"fee\\\": \\\"0.00000000\\\",\\n \\\"walletTxId\\\": null,\\n \\\"createdAt\\\": 1721730920000,\\n \\\"updatedAt\\\": 1721730920000,\\n \\\"remark\\\": \\\"\\\",\\n \\\"arrears\\\": false\\n }\\n ]\\n }\\n}", - "x-request-example": "{\\\"currency\\\": \\\"BTC\\\", \\\"status\\\": \\\"SUCCESS\\\", \\\"startAt\\\": 1728663338000, \\\"endAt\\\": 1728692138000, \\\"currentPage\\\": 1, \\\"pageSize\\\": 50}" + "x-request-example": "{\\\"currency\\\": \\\"BTC\\\", \\\"status\\\": \\\"SUCCESS\\\", \\\"startAt\\\": 1728663338000, \\\"endAt\\\": 1728692138000, \\\"currentPage\\\": 1, \\\"pageSize\\\": 50}", + "operationId": "004" }, "post": { "summary": "Withdraw - V1", @@ -785,7 +789,8 @@ } }, "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"withdrawalId\\\":\\\"670a973cf07b3800070e216c\\\"}}", - "x-request-example": "{\\\"currency\\\": \\\"USDT\\\", \\\"address\\\": \\\"TKFRQXSDc****16GmLrjJggwX8\\\", \\\"amount\\\": 3, \\\"chain\\\": \\\"trx\\\", \\\"isInner\\\": true}" + "x-request-example": "{\\\"currency\\\": \\\"USDT\\\", \\\"address\\\": \\\"TKFRQXSDc****16GmLrjJggwX8\\\", \\\"amount\\\": 3, \\\"chain\\\": \\\"trx\\\", \\\"isInner\\\": true}", + "operationId": "006" } }, "/api/v1/hist-withdrawals": { @@ -1002,7 +1007,8 @@ "x-sdk-method-description": "Request via this endpoint to get deposit list Items are paginated and sorted to show the latest first. See the Pagination section for retrieving additional entries after the first page.", "x-api-rate-limit": 20, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"currentPage\\\": 1,\\n \\\"pageSize\\\": 50,\\n \\\"totalNum\\\": 1,\\n \\\"totalPage\\\": 1,\\n \\\"items\\\": [\\n {\\n \\\"currency\\\": \\\"BTC\\\",\\n \\\"createAt\\\": 1526723468,\\n \\\"amount\\\": \\\"0.534\\\",\\n \\\"address\\\": \\\"33xW37ZSW4tQvg443Pc7NLCAs167Yc2XUV\\\",\\n \\\"walletTxId\\\": \\\"aeacea864c020acf58e51606169240e96774838dcd4f7ce48acf38e3651323f4\\\",\\n \\\"isInner\\\": false,\\n \\\"status\\\": \\\"SUCCESS\\\"\\n }\\n ]\\n }\\n}", - "x-request-example": "{\\\"currency\\\": \\\"BTC\\\", \\\"status\\\": \\\"SUCCESS\\\", \\\"startAt\\\": 1728663338000, \\\"endAt\\\": 1728692138000, \\\"currentPage\\\": 1, \\\"pageSize\\\": 50}" + "x-request-example": "{\\\"currency\\\": \\\"BTC\\\", \\\"status\\\": \\\"SUCCESS\\\", \\\"startAt\\\": 1728663338000, \\\"endAt\\\": 1728692138000, \\\"currentPage\\\": 1, \\\"pageSize\\\": 50}", + "operationId": "005" } } }, diff --git a/spec/rest/api/openapi-affiliate-affiliate.json b/spec/rest/api/openapi-affiliate-affiliate.json index 9241aa9b..4ff054c5 100644 --- a/spec/rest/api/openapi-affiliate-affiliate.json +++ b/spec/rest/api/openapi-affiliate-affiliate.json @@ -161,7 +161,8 @@ "x-sdk-method-name": "getAccount", "x-sdk-method-description": "This endpoint allows getting affiliate user rebate information.", "x-api-rate-limit": 30, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"parentUid\\\": \\\"1000000\\\",\\n \\\"orders\\\": [\\n {\\n \\\"orderId\\\": \\\"1668458892612980737\\\",\\n \\\"currency\\\": \\\"USDT\\\",\\n \\\"principal\\\": \\\"100\\\",\\n \\\"interest\\\": \\\"0\\\"\\n }\\n ],\\n \\\"ltv\\\": {\\n \\\"transferLtv\\\": \\\"0.6000\\\",\\n \\\"onlyClosePosLtv\\\": \\\"0.7500\\\",\\n \\\"delayedLiquidationLtv\\\": \\\"0.9000\\\",\\n \\\"instantLiquidationLtv\\\": \\\"0.9500\\\",\\n \\\"currentLtv\\\": \\\"0.0854\\\"\\n },\\n \\\"totalMarginAmount\\\": \\\"1170.36181573\\\",\\n \\\"transferMarginAmount\\\": \\\"166.66666666\\\",\\n \\\"margins\\\": [\\n {\\n \\\"marginCcy\\\": \\\"USDT\\\",\\n \\\"marginQty\\\": \\\"1170.36181573\\\",\\n \\\"marginFactor\\\": \\\"1.000000000000000000\\\"\\n }\\n ]\\n }\\n}" + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"parentUid\\\": \\\"1000000\\\",\\n \\\"orders\\\": [\\n {\\n \\\"orderId\\\": \\\"1668458892612980737\\\",\\n \\\"currency\\\": \\\"USDT\\\",\\n \\\"principal\\\": \\\"100\\\",\\n \\\"interest\\\": \\\"0\\\"\\n }\\n ],\\n \\\"ltv\\\": {\\n \\\"transferLtv\\\": \\\"0.6000\\\",\\n \\\"onlyClosePosLtv\\\": \\\"0.7500\\\",\\n \\\"delayedLiquidationLtv\\\": \\\"0.9000\\\",\\n \\\"instantLiquidationLtv\\\": \\\"0.9500\\\",\\n \\\"currentLtv\\\": \\\"0.0854\\\"\\n },\\n \\\"totalMarginAmount\\\": \\\"1170.36181573\\\",\\n \\\"transferMarginAmount\\\": \\\"166.66666666\\\",\\n \\\"margins\\\": [\\n {\\n \\\"marginCcy\\\": \\\"USDT\\\",\\n \\\"marginQty\\\": \\\"1170.36181573\\\",\\n \\\"marginFactor\\\": \\\"1.000000000000000000\\\"\\n }\\n ]\\n }\\n}", + "operationId": "001" } } }, diff --git a/spec/rest/api/openapi-broker-apibroker.json b/spec/rest/api/openapi-broker-apibroker.json index 04b15637..c9987a0b 100644 --- a/spec/rest/api/openapi-broker-apibroker.json +++ b/spec/rest/api/openapi-broker-apibroker.json @@ -103,7 +103,8 @@ "x-sdk-method-description": "This interface supports downloading Broker rebate orders", "x-api-rate-limit": 3, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"url\\\": \\\"https://kc-v2-promotion.s3.ap-northeast-1.amazonaws.com/broker/671aec522593f600019766d0_file.csv?X-Amz-Security-Token=IQo*********2cd90f14efb\\\"\\n }\\n}", - "x-request-example": "{\\\"begin\\\": \\\"20240610\\\", \\\"end\\\": \\\"20241010\\\", \\\"tradeType\\\": \\\"1\\\"}" + "x-request-example": "{\\\"begin\\\": \\\"20240610\\\", \\\"end\\\": \\\"20241010\\\", \\\"tradeType\\\": \\\"1\\\"}", + "operationId": "001" } } }, diff --git a/spec/rest/api/openapi-broker-ndbroker.json b/spec/rest/api/openapi-broker-ndbroker.json index f5276f48..a6e1edee 100644 --- a/spec/rest/api/openapi-broker-ndbroker.json +++ b/spec/rest/api/openapi-broker-ndbroker.json @@ -113,7 +113,8 @@ "x-sdk-method-description": "This endpoint supports querying the basic information of the current Broker", "x-api-rate-limit": 2, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"accountSize\\\": 0,\\n \\\"maxAccountSize\\\": null,\\n \\\"level\\\": 0\\n }\\n}", - "x-request-example": "{\\\"begin\\\": \\\"20240510\\\", \\\"end\\\": \\\"20241010\\\", \\\"tradeType\\\": \\\"1\\\"}" + "x-request-example": "{\\\"begin\\\": \\\"20240510\\\", \\\"end\\\": \\\"20241010\\\", \\\"tradeType\\\": \\\"1\\\"}", + "operationId": "001" } }, "/api/v1/broker/nd/account": { @@ -203,7 +204,8 @@ } }, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"accountName\\\": \\\"Account15\\\",\\n \\\"uid\\\": \\\"226383154\\\",\\n \\\"createdAt\\\": 1729819381908,\\n \\\"level\\\": 0\\n }\\n}", - "x-request-example": "{\\\"accountName\\\": \\\"Account1\\\"}" + "x-request-example": "{\\\"accountName\\\": \\\"Account1\\\"}", + "operationId": "002" }, "get": { "summary": "Get SubAccount", @@ -335,7 +337,8 @@ "x-sdk-method-description": "This interface supports querying sub-accounts created by Broker", "x-api-rate-limit": 2, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"currentPage\\\": 1,\\n \\\"pageSize\\\": 20,\\n \\\"totalNum\\\": 1,\\n \\\"totalPage\\\": 1,\\n \\\"items\\\": [\\n {\\n \\\"accountName\\\": \\\"Account15\\\",\\n \\\"uid\\\": \\\"226383154\\\",\\n \\\"createdAt\\\": 1729819382000,\\n \\\"level\\\": 0\\n }\\n ]\\n }\\n}", - "x-request-example": "{\\\"uid\\\": \\\"226383154\\\", \\\"currentPage\\\": 1, \\\"pageSize\\\": 20}" + "x-request-example": "{\\\"uid\\\": \\\"226383154\\\", \\\"currentPage\\\": 1, \\\"pageSize\\\": 20}", + "operationId": "003" } }, "/api/v1/broker/nd/account/apikey": { @@ -501,7 +504,8 @@ } }, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"uid\\\": \\\"226383154\\\",\\n \\\"label\\\": \\\"This is remarks\\\",\\n \\\"apiKey\\\": \\\"671afb36cee20f00015cfaf1\\\",\\n \\\"secretKey\\\": \\\"d694df2******5bae05b96\\\",\\n \\\"apiVersion\\\": 3,\\n \\\"permissions\\\": [\\n \\\"General\\\",\\n \\\"Spot\\\"\\n ],\\n \\\"ipWhitelist\\\": [\\n \\\"127.0.0.1\\\",\\n \\\"123.123.123.123\\\"\\n ],\\n \\\"createdAt\\\": 1729821494000\\n }\\n}", - "x-request-example": "{\\\"uid\\\": \\\"226383154\\\", \\\"passphrase\\\": \\\"11223344\\\", \\\"ipWhitelist\\\": [\\\"127.0.0.1\\\", \\\"123.123.123.123\\\"], \\\"permissions\\\": [\\\"general\\\", \\\"spot\\\"], \\\"label\\\": \\\"This is remarks\\\"}" + "x-request-example": "{\\\"uid\\\": \\\"226383154\\\", \\\"passphrase\\\": \\\"11223344\\\", \\\"ipWhitelist\\\": [\\\"127.0.0.1\\\", \\\"123.123.123.123\\\"], \\\"permissions\\\": [\\\"general\\\", \\\"spot\\\"], \\\"label\\\": \\\"This is remarks\\\"}", + "operationId": "004" }, "get": { "summary": "Get SubAccount API", @@ -635,7 +639,8 @@ "x-sdk-method-description": "This interface supports querying the Broker’s sub-account APIKEY", "x-api-rate-limit": 2, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": [\\n {\\n \\\"uid\\\": \\\"226383154\\\",\\n \\\"label\\\": \\\"This is remarks\\\",\\n \\\"apiKey\\\": \\\"671afb36cee20f00015cfaf1\\\",\\n \\\"apiVersion\\\": 3,\\n \\\"permissions\\\": [\\n \\\"General\\\",\\n \\\"Spot\\\"\\n ],\\n \\\"ipWhitelist\\\": [\\n \\\"127.**.1\\\",\\n \\\"203.**.154\\\"\\n ],\\n \\\"createdAt\\\": 1729821494000\\n }\\n ]\\n}", - "x-request-example": "{\\\"uid\\\": \\\"226383154\\\", \\\"apiKey\\\": \\\"671afb36cee20f00015cfaf1\\\"}" + "x-request-example": "{\\\"uid\\\": \\\"226383154\\\", \\\"apiKey\\\": \\\"671afb36cee20f00015cfaf1\\\"}", + "operationId": "005" }, "delete": { "summary": "Delete SubAccount API", @@ -698,7 +703,8 @@ "x-sdk-method-description": "This interface supports deleting Broker’s sub-account APIKEY", "x-api-rate-limit": 3, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": true\\n}", - "x-request-example": "{\\\"uid\\\": \\\"226383154\\\", \\\"apiKey\\\": \\\"671afb36cee20f00015cfaf1\\\"}" + "x-request-example": "{\\\"uid\\\": \\\"226383154\\\", \\\"apiKey\\\": \\\"671afb36cee20f00015cfaf1\\\"}", + "operationId": "007" } }, "/api/v1/broker/nd/account/update-apikey": { @@ -859,7 +865,8 @@ } }, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"uid\\\": \\\"226383154\\\",\\n \\\"label\\\": \\\"This is remarks\\\",\\n \\\"apiKey\\\": \\\"671afb36cee20f00015cfaf1\\\",\\n \\\"apiVersion\\\": 3,\\n \\\"permissions\\\": [\\n \\\"General\\\",\\n \\\"Spot\\\"\\n ],\\n \\\"ipWhitelist\\\": [\\n \\\"127.**.1\\\",\\n \\\"123.**.123\\\"\\n ],\\n \\\"createdAt\\\": 1729821494000\\n }\\n}", - "x-request-example": "{\\\"uid\\\": \\\"226383154\\\", \\\"apiKey\\\": \\\"671afb36cee20f00015cfaf1\\\", \\\"ipWhitelist\\\": [\\\"127.0.0.1\\\", \\\"123.123.123.123\\\"], \\\"permissions\\\": [\\\"general\\\", \\\"spot\\\"], \\\"label\\\": \\\"This is remarks\\\"}" + "x-request-example": "{\\\"uid\\\": \\\"226383154\\\", \\\"apiKey\\\": \\\"671afb36cee20f00015cfaf1\\\", \\\"ipWhitelist\\\": [\\\"127.0.0.1\\\", \\\"123.123.123.123\\\"], \\\"permissions\\\": [\\\"general\\\", \\\"spot\\\"], \\\"label\\\": \\\"This is remarks\\\"}", + "operationId": "006" } }, "/api/v1/broker/nd/transfer": { @@ -1011,7 +1018,8 @@ } }, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"orderId\\\": \\\"671b4600c1e3dd000726866d\\\"\\n }\\n}", - "x-request-example": "{\\\"currency\\\": \\\"USDT\\\", \\\"amount\\\": \\\"1\\\", \\\"clientOid\\\": \\\"e6c24d23-6bc2-401b-bf9e-55e2daddfbc1\\\", \\\"direction\\\": \\\"OUT\\\", \\\"accountType\\\": \\\"MAIN\\\", \\\"specialUid\\\": \\\"226383154\\\", \\\"specialAccountType\\\": \\\"MAIN\\\"}" + "x-request-example": "{\\\"currency\\\": \\\"USDT\\\", \\\"amount\\\": \\\"1\\\", \\\"clientOid\\\": \\\"e6c24d23-6bc2-401b-bf9e-55e2daddfbc1\\\", \\\"direction\\\": \\\"OUT\\\", \\\"accountType\\\": \\\"MAIN\\\", \\\"specialUid\\\": \\\"226383154\\\", \\\"specialAccountType\\\": \\\"MAIN\\\"}", + "operationId": "008" } }, "/api/v3/broker/nd/transfer/detail": { @@ -1232,7 +1240,8 @@ "x-sdk-method-description": "This endpoint supports querying transfer records of the broker itself and its created sub-accounts.", "x-api-rate-limit": 1, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"orderId\\\": \\\"671b4600c1e3dd000726866d\\\",\\n \\\"currency\\\": \\\"USDT\\\",\\n \\\"amount\\\": \\\"1\\\",\\n \\\"fromUid\\\": 165111215,\\n \\\"fromAccountType\\\": \\\"MAIN\\\",\\n \\\"fromAccountTag\\\": \\\"DEFAULT\\\",\\n \\\"toUid\\\": 226383154,\\n \\\"toAccountType\\\": \\\"MAIN\\\",\\n \\\"toAccountTag\\\": \\\"DEFAULT\\\",\\n \\\"status\\\": \\\"SUCCESS\\\",\\n \\\"reason\\\": null,\\n \\\"createdAt\\\": 1729840640000\\n }\\n}", - "x-request-example": "{\\\"orderId\\\": \\\"671b4600c1e3dd000726866d\\\"}" + "x-request-example": "{\\\"orderId\\\": \\\"671b4600c1e3dd000726866d\\\"}", + "operationId": "009" } }, "/api/v1/asset/ndbroker/deposit/list": { @@ -1450,7 +1459,8 @@ "x-sdk-method-description": "This endpoint can obtain the deposit records of each sub-account under the ND Broker.", "x-api-rate-limit": 10, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": [\\n {\\n \\\"uid\\\": 165111215,\\n \\\"hash\\\": \\\"6724e363a492800007ec602b\\\",\\n \\\"address\\\": \\\"xxxxxxx@gmail.com\\\",\\n \\\"memo\\\": \\\"\\\",\\n \\\"amount\\\": \\\"3.0\\\",\\n \\\"fee\\\": \\\"0.0\\\",\\n \\\"currency\\\": \\\"USDT\\\",\\n \\\"isInner\\\": true,\\n \\\"walletTxId\\\": \\\"bbbbbbbbb\\\",\\n \\\"status\\\": \\\"SUCCESS\\\",\\n \\\"chain\\\": \\\"\\\",\\n \\\"remark\\\": \\\"\\\",\\n \\\"createdAt\\\": 1730470760000,\\n \\\"updatedAt\\\": 1730470760000\\n }\\n ]\\n}", - "x-request-example": "{\\\"currency\\\": \\\"USDT\\\", \\\"status\\\": \\\"SUCCESS\\\", \\\"hash\\\": \\\"example_string_default_value\\\", \\\"startTimestamp\\\": 123456, \\\"endTimestamp\\\": 123456, \\\"limit\\\": 100}" + "x-request-example": "{\\\"currency\\\": \\\"USDT\\\", \\\"status\\\": \\\"SUCCESS\\\", \\\"hash\\\": \\\"example_string_default_value\\\", \\\"startTimestamp\\\": 123456, \\\"endTimestamp\\\": 123456, \\\"limit\\\": 100}", + "operationId": "010" } }, "/api/v3/broker/nd/deposit/detail": { @@ -1613,7 +1623,8 @@ "x-sdk-method-description": "This endpoint supports querying the deposit record of sub-accounts created by a Broker (excluding main account of nd broker)", "x-api-rate-limit": 1, "x-response-example": "{\\n \\\"data\\\" : {\\n \\\"chain\\\" : \\\"trx\\\",\\n \\\"hash\\\" : \\\"30bb0e0b***4156c5188\\\",\\n \\\"walletTxId\\\" : \\\"30bb0***610d1030f\\\",\\n \\\"uid\\\" : 201496341,\\n \\\"updatedAt\\\" : 1713429174000,\\n \\\"amount\\\" : \\\"8.5\\\",\\n \\\"memo\\\" : \\\"\\\",\\n \\\"fee\\\" : \\\"0.0\\\",\\n \\\"address\\\" : \\\"THLPzUrbd1o***vP7d\\\",\\n \\\"remark\\\" : \\\"Deposit\\\",\\n \\\"isInner\\\" : false,\\n \\\"currency\\\" : \\\"USDT\\\",\\n \\\"status\\\" : \\\"SUCCESS\\\",\\n \\\"createdAt\\\" : 1713429173000\\n },\\n \\\"code\\\" : \\\"200000\\\"\\n}", - "x-request-example": "{\\\"currency\\\": \\\"USDT\\\", \\\"hash\\\": \\\"30bb0e0b***4156c5188\\\"}" + "x-request-example": "{\\\"currency\\\": \\\"USDT\\\", \\\"hash\\\": \\\"30bb0e0b***4156c5188\\\"}", + "operationId": "011" } }, "/api/v3/broker/nd/withdraw/detail": { @@ -1779,7 +1790,8 @@ "x-sdk-method-description": "This endpoint supports querying the withdrawal records of sub-accounts created by a Broker (excluding main account of nd broker).", "x-api-rate-limit": 1, "x-response-example": "{\\n \\\"data\\\": {\\n \\\"id\\\": \\\"66617a2***3c9a\\\",\\n \\\"chain\\\": \\\"ton\\\",\\n \\\"walletTxId\\\": \\\"AJ***eRI=\\\",\\n \\\"uid\\\": 157267400,\\n \\\"amount\\\": \\\"1.00000000\\\",\\n \\\"memo\\\": \\\"7025734\\\",\\n \\\"fee\\\": \\\"0.00000000\\\",\\n \\\"address\\\": \\\"EQDn***dKbGzr\\\",\\n \\\"remark\\\": \\\"\\\",\\n \\\"isInner\\\": false,\\n \\\"currency\\\": \\\"USDT\\\",\\n \\\"status\\\": \\\"SUCCESS\\\",\\n \\\"createdAt\\\": 1717664288000,\\n \\\"updatedAt\\\": 1717664375000\\n },\\n \\\"code\\\": \\\"200000\\\"\\n}", - "x-request-example": "{\\\"withdrawalId\\\": \\\"66617a2***3c9a\\\"}" + "x-request-example": "{\\\"withdrawalId\\\": \\\"66617a2***3c9a\\\"}", + "operationId": "012" } }, "/api/v1/broker/nd/rebase/download": { @@ -1878,7 +1890,8 @@ "x-sdk-method-description": "This interface supports downloading Broker rebate orders", "x-api-rate-limit": 3, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"url\\\": \\\"https://kc-v2-promotion.s3.ap-northeast-1.amazonaws.com/broker/671aec522593f600019766d0_file.csv?X-Amz-Security-Token=IQo*********2cd90f14efb\\\"\\n }\\n}", - "x-request-example": "{\\\"begin\\\": \\\"20240610\\\", \\\"end\\\": \\\"20241010\\\", \\\"tradeType\\\": \\\"1\\\"}" + "x-request-example": "{\\\"begin\\\": \\\"20240610\\\", \\\"end\\\": \\\"20241010\\\", \\\"tradeType\\\": \\\"1\\\"}", + "operationId": "013" } } }, diff --git a/spec/rest/api/openapi-earn-earn.json b/spec/rest/api/openapi-earn-earn.json index 2619ec5f..eb9942b9 100644 --- a/spec/rest/api/openapi-earn-earn.json +++ b/spec/rest/api/openapi-earn-earn.json @@ -109,7 +109,8 @@ } }, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"orderId\\\": \\\"2767291\\\",\\n \\\"orderTxId\\\": \\\"6603694\\\"\\n }\\n}", - "x-request-example": "{\\\"productId\\\": \\\"2611\\\", \\\"amount\\\": \\\"1\\\", \\\"accountType\\\": \\\"TRADE\\\"}" + "x-request-example": "{\\\"productId\\\": \\\"2611\\\", \\\"amount\\\": \\\"1\\\", \\\"accountType\\\": \\\"TRADE\\\"}", + "operationId": "001" }, "delete": { "summary": "Redeem", @@ -250,7 +251,8 @@ "x-sdk-method-description": "This endpoint allows initiating redemption by holding ID. If the current holding is fully redeemed or in the process of being redeemed, it indicates that the holding does not exist.", "x-api-rate-limit": 5, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"orderTxId\\\": \\\"6603700\\\",\\n \\\"deliverTime\\\": 1729517805000,\\n \\\"status\\\": \\\"PENDING\\\",\\n \\\"amount\\\": \\\"1\\\"\\n }\\n}", - "x-request-example": "{\\\"orderId\\\": \\\"2767291\\\", \\\"amount\\\": \\\"example_string_default_value\\\", \\\"fromAccountType\\\": \\\"MAIN\\\", \\\"confirmPunishRedeem\\\": \\\"1\\\"}" + "x-request-example": "{\\\"orderId\\\": \\\"2767291\\\", \\\"amount\\\": \\\"example_string_default_value\\\", \\\"fromAccountType\\\": \\\"MAIN\\\", \\\"confirmPunishRedeem\\\": \\\"1\\\"}", + "operationId": "003" } }, "/api/v1/earn/redeem-preview": { @@ -376,7 +378,8 @@ "x-sdk-method-description": "This endpoint allows subscribing earn products", "x-api-rate-limit": 5, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"currency\\\": \\\"KCS\\\",\\n \\\"redeemAmount\\\": \\\"1\\\",\\n \\\"penaltyInterestAmount\\\": \\\"0\\\",\\n \\\"redeemPeriod\\\": 3,\\n \\\"deliverTime\\\": 1729518951000,\\n \\\"manualRedeemable\\\": true,\\n \\\"redeemAll\\\": false\\n }\\n}", - "x-request-example": "{\\\"orderId\\\": \\\"2767291\\\", \\\"fromAccountType\\\": \\\"MAIN\\\"}" + "x-request-example": "{\\\"orderId\\\": \\\"2767291\\\", \\\"fromAccountType\\\": \\\"MAIN\\\"}", + "operationId": "002" } }, "/api/v1/earn/saving/products": { @@ -698,7 +701,8 @@ "x-sdk-method-description": "This endpoint can get available savings products. If no products are available, an empty list is returned.", "x-api-rate-limit": 5, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": [\\n {\\n \\\"id\\\": \\\"2172\\\",\\n \\\"currency\\\": \\\"BTC\\\",\\n \\\"category\\\": \\\"DEMAND\\\",\\n \\\"type\\\": \\\"DEMAND\\\",\\n \\\"precision\\\": 8,\\n \\\"productUpperLimit\\\": \\\"480\\\",\\n \\\"productRemainAmount\\\": \\\"132.36153083\\\",\\n \\\"userUpperLimit\\\": \\\"20\\\",\\n \\\"userLowerLimit\\\": \\\"0.01\\\",\\n \\\"redeemPeriod\\\": 0,\\n \\\"lockStartTime\\\": 1644807600000,\\n \\\"lockEndTime\\\": null,\\n \\\"applyStartTime\\\": 1644807600000,\\n \\\"applyEndTime\\\": null,\\n \\\"returnRate\\\": \\\"0.00047208\\\",\\n \\\"incomeCurrency\\\": \\\"BTC\\\",\\n \\\"earlyRedeemSupported\\\": 0,\\n \\\"status\\\": \\\"ONGOING\\\",\\n \\\"redeemType\\\": \\\"MANUAL\\\",\\n \\\"incomeReleaseType\\\": \\\"DAILY\\\",\\n \\\"interestDate\\\": 1729267200000,\\n \\\"duration\\\": 0,\\n \\\"newUserOnly\\\": 0\\n }\\n ]\\n}", - "x-request-example": "{\\\"currency\\\": \\\"BTC\\\"}" + "x-request-example": "{\\\"currency\\\": \\\"BTC\\\"}", + "operationId": "004" } }, "/api/v1/earn/promotion/products": { @@ -1020,7 +1024,8 @@ "x-sdk-method-description": "This endpoint can get available limited-time promotion products. If no products are available, an empty list is returned.", "x-api-rate-limit": 5, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": [\\n {\\n \\\"id\\\": \\\"2685\\\",\\n \\\"currency\\\": \\\"BTC\\\",\\n \\\"category\\\": \\\"ACTIVITY\\\",\\n \\\"type\\\": \\\"TIME\\\",\\n \\\"precision\\\": 8,\\n \\\"productUpperLimit\\\": \\\"50\\\",\\n \\\"userUpperLimit\\\": \\\"1\\\",\\n \\\"userLowerLimit\\\": \\\"0.001\\\",\\n \\\"redeemPeriod\\\": 0,\\n \\\"lockStartTime\\\": 1702371601000,\\n \\\"lockEndTime\\\": 1729858405000,\\n \\\"applyStartTime\\\": 1702371600000,\\n \\\"applyEndTime\\\": null,\\n \\\"returnRate\\\": \\\"0.03\\\",\\n \\\"incomeCurrency\\\": \\\"BTC\\\",\\n \\\"earlyRedeemSupported\\\": 0,\\n \\\"productRemainAmount\\\": \\\"49.78203998\\\",\\n \\\"status\\\": \\\"ONGOING\\\",\\n \\\"redeemType\\\": \\\"TRANS_DEMAND\\\",\\n \\\"incomeReleaseType\\\": \\\"DAILY\\\",\\n \\\"interestDate\\\": 1729253605000,\\n \\\"duration\\\": 7,\\n \\\"newUserOnly\\\": 1\\n }\\n ]\\n}", - "x-request-example": "{\\\"currency\\\": \\\"BTC\\\"}" + "x-request-example": "{\\\"currency\\\": \\\"BTC\\\"}", + "operationId": "005" } }, "/api/v1/earn/hold-assets": { @@ -1309,7 +1314,8 @@ "x-sdk-method-description": "This endpoint can get current holding assets information. If no current holding assets are available, an empty list is returned.", "x-api-rate-limit": 5, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"totalNum\\\": 1,\\n \\\"totalPage\\\": 1,\\n \\\"currentPage\\\": 1,\\n \\\"pageSize\\\": 15,\\n \\\"items\\\": [\\n {\\n \\\"orderId\\\": \\\"2767291\\\",\\n \\\"productId\\\": \\\"2611\\\",\\n \\\"productCategory\\\": \\\"KCS_STAKING\\\",\\n \\\"productType\\\": \\\"DEMAND\\\",\\n \\\"currency\\\": \\\"KCS\\\",\\n \\\"incomeCurrency\\\": \\\"KCS\\\",\\n \\\"returnRate\\\": \\\"0.03471727\\\",\\n \\\"holdAmount\\\": \\\"1\\\",\\n \\\"redeemedAmount\\\": \\\"0\\\",\\n \\\"redeemingAmount\\\": \\\"1\\\",\\n \\\"lockStartTime\\\": 1701252000000,\\n \\\"lockEndTime\\\": null,\\n \\\"purchaseTime\\\": 1729257513000,\\n \\\"redeemPeriod\\\": 3,\\n \\\"status\\\": \\\"REDEEMING\\\",\\n \\\"earlyRedeemSupported\\\": 0\\n }\\n ]\\n }\\n}", - "x-request-example": "{\\\"currency\\\": \\\"KCS\\\", \\\"productId\\\": \\\"example_string_default_value\\\", \\\"productCategory\\\": \\\"DEMAND\\\", \\\"currentPage\\\": 1, \\\"pageSize\\\": 10}" + "x-request-example": "{\\\"currency\\\": \\\"KCS\\\", \\\"productId\\\": \\\"example_string_default_value\\\", \\\"productCategory\\\": \\\"DEMAND\\\", \\\"currentPage\\\": 1, \\\"pageSize\\\": 10}", + "operationId": "006" } }, "/api/v1/earn/staking/products": { @@ -1631,7 +1637,8 @@ "x-sdk-method-description": "This endpoint can get available staking products. If no products are available, an empty list is returned.", "x-api-rate-limit": 5, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": [\\n {\\n \\\"id\\\": \\\"2535\\\",\\n \\\"currency\\\": \\\"STX\\\",\\n \\\"category\\\": \\\"STAKING\\\",\\n \\\"type\\\": \\\"DEMAND\\\",\\n \\\"precision\\\": 8,\\n \\\"productUpperLimit\\\": \\\"1000000\\\",\\n \\\"userUpperLimit\\\": \\\"10000\\\",\\n \\\"userLowerLimit\\\": \\\"1\\\",\\n \\\"redeemPeriod\\\": 14,\\n \\\"lockStartTime\\\": 1688614514000,\\n \\\"lockEndTime\\\": null,\\n \\\"applyStartTime\\\": 1688614512000,\\n \\\"applyEndTime\\\": null,\\n \\\"returnRate\\\": \\\"0.045\\\",\\n \\\"incomeCurrency\\\": \\\"BTC\\\",\\n \\\"earlyRedeemSupported\\\": 0,\\n \\\"productRemainAmount\\\": \\\"254032.90178701\\\",\\n \\\"status\\\": \\\"ONGOING\\\",\\n \\\"redeemType\\\": \\\"MANUAL\\\",\\n \\\"incomeReleaseType\\\": \\\"DAILY\\\",\\n \\\"interestDate\\\": 1729267200000,\\n \\\"duration\\\": 0,\\n \\\"newUserOnly\\\": 0\\n }\\n ]\\n}", - "x-request-example": "{\\\"currency\\\": \\\"BTC\\\"}" + "x-request-example": "{\\\"currency\\\": \\\"BTC\\\"}", + "operationId": "007" } }, "/api/v1/earn/kcs-staking/products": { @@ -1951,7 +1958,8 @@ "x-sdk-method-description": "This endpoint can get available KCS staking products. If no products are available, an empty list is returned.", "x-api-rate-limit": 5, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": [\\n {\\n \\\"id\\\": \\\"2611\\\",\\n \\\"currency\\\": \\\"KCS\\\",\\n \\\"category\\\": \\\"KCS_STAKING\\\",\\n \\\"type\\\": \\\"DEMAND\\\",\\n \\\"precision\\\": 8,\\n \\\"productUpperLimit\\\": \\\"100000000\\\",\\n \\\"userUpperLimit\\\": \\\"100000000\\\",\\n \\\"userLowerLimit\\\": \\\"1\\\",\\n \\\"redeemPeriod\\\": 3,\\n \\\"lockStartTime\\\": 1701252000000,\\n \\\"lockEndTime\\\": null,\\n \\\"applyStartTime\\\": 1701252000000,\\n \\\"applyEndTime\\\": null,\\n \\\"returnRate\\\": \\\"0.03471727\\\",\\n \\\"incomeCurrency\\\": \\\"KCS\\\",\\n \\\"earlyRedeemSupported\\\": 0,\\n \\\"productRemainAmount\\\": \\\"58065850.54998251\\\",\\n \\\"status\\\": \\\"ONGOING\\\",\\n \\\"redeemType\\\": \\\"MANUAL\\\",\\n \\\"incomeReleaseType\\\": \\\"DAILY\\\",\\n \\\"interestDate\\\": 1729267200000,\\n \\\"duration\\\": 0,\\n \\\"newUserOnly\\\": 0\\n }\\n ]\\n}", - "x-request-example": "{\\\"currency\\\": \\\"BTC\\\"}" + "x-request-example": "{\\\"currency\\\": \\\"BTC\\\"}", + "operationId": "008" } }, "/api/v1/earn/eth-staking/products": { @@ -2263,7 +2271,8 @@ "x-sdk-method-description": "This endpoint can get available ETH staking products. If no products are available, an empty list is returned.", "x-api-rate-limit": 5, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": [\\n {\\n \\\"id\\\": \\\"ETH2\\\",\\n \\\"category\\\": \\\"ETH2\\\",\\n \\\"type\\\": \\\"DEMAND\\\",\\n \\\"precision\\\": 8,\\n \\\"currency\\\": \\\"ETH\\\",\\n \\\"incomeCurrency\\\": \\\"ETH2\\\",\\n \\\"returnRate\\\": \\\"0.028\\\",\\n \\\"userLowerLimit\\\": \\\"0.01\\\",\\n \\\"userUpperLimit\\\": \\\"8557.3597075\\\",\\n \\\"productUpperLimit\\\": \\\"8557.3597075\\\",\\n \\\"productRemainAmount\\\": \\\"8557.3597075\\\",\\n \\\"redeemPeriod\\\": 5,\\n \\\"redeemType\\\": \\\"MANUAL\\\",\\n \\\"incomeReleaseType\\\": \\\"DAILY\\\",\\n \\\"applyStartTime\\\": 1729255485000,\\n \\\"applyEndTime\\\": null,\\n \\\"lockStartTime\\\": 1729255485000,\\n \\\"lockEndTime\\\": null,\\n \\\"interestDate\\\": 1729267200000,\\n \\\"newUserOnly\\\": 0,\\n \\\"earlyRedeemSupported\\\": 0,\\n \\\"duration\\\": 0,\\n \\\"status\\\": \\\"ONGOING\\\"\\n }\\n ]\\n}", - "x-request-example": "{\\\"currency\\\": \\\"BTC\\\"}" + "x-request-example": "{\\\"currency\\\": \\\"BTC\\\"}", + "operationId": "009" } } }, diff --git a/spec/rest/api/openapi-futures-fundingfees.json b/spec/rest/api/openapi-futures-fundingfees.json index f8091bd6..4422324d 100644 --- a/spec/rest/api/openapi-futures-fundingfees.json +++ b/spec/rest/api/openapi-futures-fundingfees.json @@ -100,7 +100,8 @@ "x-sdk-method-description": "get Current Funding Rate", "x-api-rate-limit": 2, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"symbol\\\": \\\".XBTUSDTMFPI8H\\\",\\n \\\"granularity\\\": 28800000,\\n \\\"timePoint\\\": 1731441600000,\\n \\\"value\\\": 6.41E-4,\\n \\\"predictedValue\\\": 5.2E-5,\\n \\\"fundingRateCap\\\": 0.003,\\n \\\"fundingRateFloor\\\": -0.003\\n }\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDTM\\\"}" + "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDTM\\\"}", + "operationId": "001" } }, "/api/v1/contract/funding-rates": { @@ -199,7 +200,8 @@ "x-sdk-method-description": "Query the funding rate at each settlement time point within a certain time range of the corresponding contract", "x-api-rate-limit": 5, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": [\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"fundingRate\\\": 2.1E-4,\\n \\\"timepoint\\\": 1702296000000\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"fundingRate\\\": 3.47E-4,\\n \\\"timepoint\\\": 1702267200000\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"fundingRate\\\": 4.52E-4,\\n \\\"timepoint\\\": 1702238400000\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"fundingRate\\\": 5.13E-4,\\n \\\"timepoint\\\": 1702209600000\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"fundingRate\\\": 4.21E-4,\\n \\\"timepoint\\\": 1702180800000\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"fundingRate\\\": 5.06E-4,\\n \\\"timepoint\\\": 1702152000000\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"fundingRate\\\": 7.68E-4,\\n \\\"timepoint\\\": 1702123200000\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"fundingRate\\\": 4.82E-4,\\n \\\"timepoint\\\": 1702094400000\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"fundingRate\\\": 4.0E-4,\\n \\\"timepoint\\\": 1702065600000\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"fundingRate\\\": 5.46E-4,\\n \\\"timepoint\\\": 1702036800000\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"fundingRate\\\": 7.97E-4,\\n \\\"timepoint\\\": 1702008000000\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"fundingRate\\\": 5.76E-4,\\n \\\"timepoint\\\": 1701979200000\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"fundingRate\\\": 4.22E-4,\\n \\\"timepoint\\\": 1701950400000\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"fundingRate\\\": 3.92E-4,\\n \\\"timepoint\\\": 1701921600000\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"fundingRate\\\": 4.1E-4,\\n \\\"timepoint\\\": 1701892800000\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"fundingRate\\\": 4.48E-4,\\n \\\"timepoint\\\": 1701864000000\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"fundingRate\\\": 3.68E-4,\\n \\\"timepoint\\\": 1701835200000\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"fundingRate\\\": 3.51E-4,\\n \\\"timepoint\\\": 1701806400000\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"fundingRate\\\": 1.44E-4,\\n \\\"timepoint\\\": 1701777600000\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"fundingRate\\\": 4.25E-4,\\n \\\"timepoint\\\": 1701748800000\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"fundingRate\\\": -8.2E-5,\\n \\\"timepoint\\\": 1701720000000\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"fundingRate\\\": 4.64E-4,\\n \\\"timepoint\\\": 1701691200000\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"fundingRate\\\": 4.14E-4,\\n \\\"timepoint\\\": 1701662400000\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"fundingRate\\\": 2.44E-4,\\n \\\"timepoint\\\": 1701633600000\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"fundingRate\\\": 1.99E-4,\\n \\\"timepoint\\\": 1701604800000\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"fundingRate\\\": 1.79E-4,\\n \\\"timepoint\\\": 1701576000000\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"fundingRate\\\": 8.7E-5,\\n \\\"timepoint\\\": 1701547200000\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"fundingRate\\\": 1.6E-5,\\n \\\"timepoint\\\": 1701518400000\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"fundingRate\\\": -3.7E-5,\\n \\\"timepoint\\\": 1701489600000\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"fundingRate\\\": 1.5E-5,\\n \\\"timepoint\\\": 1701460800000\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"fundingRate\\\": 6.8E-5,\\n \\\"timepoint\\\": 1701432000000\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"fundingRate\\\": 7.2E-5,\\n \\\"timepoint\\\": 1701403200000\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"fundingRate\\\": 1.45E-4,\\n \\\"timepoint\\\": 1701374400000\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"fundingRate\\\": 1.41E-4,\\n \\\"timepoint\\\": 1701345600000\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"fundingRate\\\": 9.4E-5,\\n \\\"timepoint\\\": 1701316800000\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"fundingRate\\\": 1.08E-4,\\n \\\"timepoint\\\": 1701288000000\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"fundingRate\\\": 7.6E-5,\\n \\\"timepoint\\\": 1701259200000\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"fundingRate\\\": 1.0E-5,\\n \\\"timepoint\\\": 1701230400000\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"fundingRate\\\": 1.0E-5,\\n \\\"timepoint\\\": 1701201600000\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"fundingRate\\\": 1.16E-4,\\n \\\"timepoint\\\": 1701172800000\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"fundingRate\\\": 2.04E-4,\\n \\\"timepoint\\\": 1701144000000\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"fundingRate\\\": 2.3E-4,\\n \\\"timepoint\\\": 1701115200000\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"fundingRate\\\": 6.2E-5,\\n \\\"timepoint\\\": 1701086400000\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"fundingRate\\\": 1.33E-4,\\n \\\"timepoint\\\": 1701057600000\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"fundingRate\\\": 8.0E-5,\\n \\\"timepoint\\\": 1701028800000\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"fundingRate\\\": 1.11E-4,\\n \\\"timepoint\\\": 1701000000000\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"fundingRate\\\": 7.4E-5,\\n \\\"timepoint\\\": 1700971200000\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"fundingRate\\\": 1.01E-4,\\n \\\"timepoint\\\": 1700942400000\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"fundingRate\\\": 3.9E-5,\\n \\\"timepoint\\\": 1700913600000\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"fundingRate\\\": 1.1E-5,\\n \\\"timepoint\\\": 1700884800000\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"fundingRate\\\": 3.0E-6,\\n \\\"timepoint\\\": 1700856000000\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"fundingRate\\\": 1.03E-4,\\n \\\"timepoint\\\": 1700827200000\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"fundingRate\\\": 3.0E-6,\\n \\\"timepoint\\\": 1700798400000\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"fundingRate\\\": 6.7E-5,\\n \\\"timepoint\\\": 1700769600000\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"fundingRate\\\": 1.47E-4,\\n \\\"timepoint\\\": 1700740800000\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"fundingRate\\\": 7.8E-5,\\n \\\"timepoint\\\": 1700712000000\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"fundingRate\\\": 1.39E-4,\\n \\\"timepoint\\\": 1700683200000\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"fundingRate\\\": 7.5E-5,\\n \\\"timepoint\\\": 1700654400000\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"fundingRate\\\": 1.11E-4,\\n \\\"timepoint\\\": 1700625600000\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"fundingRate\\\": 9.8E-5,\\n \\\"timepoint\\\": 1700596800000\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"fundingRate\\\": 1.18E-4,\\n \\\"timepoint\\\": 1700568000000\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"fundingRate\\\": 1.16E-4,\\n \\\"timepoint\\\": 1700539200000\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"fundingRate\\\": 1.6E-4,\\n \\\"timepoint\\\": 1700510400000\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"fundingRate\\\": 1.92E-4,\\n \\\"timepoint\\\": 1700481600000\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"fundingRate\\\": 1.13E-4,\\n \\\"timepoint\\\": 1700452800000\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"fundingRate\\\": 2.47E-4,\\n \\\"timepoint\\\": 1700424000000\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"fundingRate\\\": 2.3E-4,\\n \\\"timepoint\\\": 1700395200000\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"fundingRate\\\": 2.63E-4,\\n \\\"timepoint\\\": 1700366400000\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"fundingRate\\\": 1.32E-4,\\n \\\"timepoint\\\": 1700337600000\\n }\\n ]\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDTM\\\", \\\"from\\\": 1700310700000, \\\"to\\\": 1702310700000}" + "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDTM\\\", \\\"from\\\": 1700310700000, \\\"to\\\": 1702310700000}", + "operationId": "002" } }, "/api/v1/funding-history": { @@ -404,7 +406,8 @@ "x-sdk-method-description": "Submit request to get the funding history.", "x-api-rate-limit": 5, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"dataList\\\": [\\n {\\n \\\"id\\\": 1472387374042586,\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"timePoint\\\": 1731470400000,\\n \\\"fundingRate\\\": 6.41E-4,\\n \\\"markPrice\\\": 87139.92,\\n \\\"positionQty\\\": 1,\\n \\\"positionCost\\\": 87.13992,\\n \\\"funding\\\": -0.05585669,\\n \\\"settleCurrency\\\": \\\"USDT\\\",\\n \\\"context\\\": \\\"{\\\\\\\"marginMode\\\\\\\": \\\\\\\"ISOLATED\\\\\\\", \\\\\\\"positionSide\\\\\\\": \\\\\\\"BOTH\\\\\\\"}\\\",\\n \\\"marginMode\\\": \\\"ISOLATED\\\"\\n }\\n ],\\n \\\"hasMore\\\": true\\n }\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDTM\\\", \\\"from\\\": 1700310700000, \\\"to\\\": 1702310700000, \\\"reverse\\\": true, \\\"offset\\\": 123456, \\\"forward\\\": true, \\\"maxCount\\\": 123456}" + "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDTM\\\", \\\"from\\\": 1700310700000, \\\"to\\\": 1702310700000, \\\"reverse\\\": true, \\\"offset\\\": 123456, \\\"forward\\\": true, \\\"maxCount\\\": 123456}", + "operationId": "003" } } }, diff --git a/spec/rest/api/openapi-futures-market.json b/spec/rest/api/openapi-futures-market.json index 77533044..5633d0a7 100644 --- a/spec/rest/api/openapi-futures-market.json +++ b/spec/rest/api/openapi-futures-market.json @@ -468,7 +468,8 @@ "x-sdk-method-description": "Get information of specified contracts that can be traded. This API will return a list of tradable contracts, including some key parameters of the contract such as the symbol name, tick size, mark price,etc.", "x-api-rate-limit": 3, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"symbol\\\": \\\"XBTUSDM\\\",\\n \\\"rootSymbol\\\": \\\"XBT\\\",\\n \\\"type\\\": \\\"FFWCSX\\\",\\n \\\"firstOpenDate\\\": 1552638575000,\\n \\\"expireDate\\\": null,\\n \\\"settleDate\\\": null,\\n \\\"baseCurrency\\\": \\\"XBT\\\",\\n \\\"quoteCurrency\\\": \\\"USD\\\",\\n \\\"settleCurrency\\\": \\\"XBT\\\",\\n \\\"maxOrderQty\\\": 10000000,\\n \\\"maxPrice\\\": 1000000.0,\\n \\\"lotSize\\\": 1,\\n \\\"tickSize\\\": 0.1,\\n \\\"indexPriceTickSize\\\": 0.1,\\n \\\"multiplier\\\": -1.0,\\n \\\"initialMargin\\\": 0.014,\\n \\\"maintainMargin\\\": 0.007,\\n \\\"maxRiskLimit\\\": 1,\\n \\\"minRiskLimit\\\": 1,\\n \\\"riskStep\\\": 0,\\n \\\"makerFeeRate\\\": 2.0E-4,\\n \\\"takerFeeRate\\\": 6.0E-4,\\n \\\"takerFixFee\\\": 0.0,\\n \\\"makerFixFee\\\": 0.0,\\n \\\"settlementFee\\\": null,\\n \\\"isDeleverage\\\": true,\\n \\\"isQuanto\\\": false,\\n \\\"isInverse\\\": true,\\n \\\"markMethod\\\": \\\"FairPrice\\\",\\n \\\"fairMethod\\\": \\\"FundingRate\\\",\\n \\\"fundingBaseSymbol\\\": \\\".XBTINT8H\\\",\\n \\\"fundingQuoteSymbol\\\": \\\".USDINT8H\\\",\\n \\\"fundingRateSymbol\\\": \\\".XBTUSDMFPI8H\\\",\\n \\\"indexSymbol\\\": \\\".BXBT\\\",\\n \\\"settlementSymbol\\\": null,\\n \\\"status\\\": \\\"Open\\\",\\n \\\"fundingFeeRate\\\": 1.75E-4,\\n \\\"predictedFundingFeeRate\\\": 1.76E-4,\\n \\\"fundingRateGranularity\\\": 28800000,\\n \\\"openInterest\\\": \\\"61725904\\\",\\n \\\"turnoverOf24h\\\": 209.56303473,\\n \\\"volumeOf24h\\\": 1.4354731E7,\\n \\\"markPrice\\\": 68336.7,\\n \\\"indexPrice\\\": 68335.29,\\n \\\"lastTradePrice\\\": 68349.3,\\n \\\"nextFundingRateTime\\\": 17402942,\\n \\\"maxLeverage\\\": 75,\\n \\\"sourceExchanges\\\": [\\n \\\"kraken\\\",\\n \\\"bitstamp\\\",\\n \\\"crypto\\\"\\n ],\\n \\\"premiumsSymbol1M\\\": \\\".XBTUSDMPI\\\",\\n \\\"premiumsSymbol8H\\\": \\\".XBTUSDMPI8H\\\",\\n \\\"fundingBaseSymbol1M\\\": \\\".XBTINT\\\",\\n \\\"fundingQuoteSymbol1M\\\": \\\".USDINT\\\",\\n \\\"lowPrice\\\": 67436.7,\\n \\\"highPrice\\\": 69471.8,\\n \\\"priceChgPct\\\": 0.0097,\\n \\\"priceChg\\\": 658.7,\\n \\\"k\\\": 2645000.0,\\n \\\"m\\\": 1640000.0,\\n \\\"f\\\": 1.3,\\n \\\"mmrLimit\\\": 0.3,\\n \\\"mmrLevConstant\\\": 75.0,\\n \\\"supportCross\\\": true\\n }\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDTM\\\"}" + "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDTM\\\"}", + "operationId": "001" } }, "/api/v1/contracts/active": { @@ -923,7 +924,8 @@ "x-sdk-method-name": "GetAllSymbols", "x-sdk-method-description": "Get detailed information of all contracts that can be traded. This API will return a list of tradable contracts, including some key parameters of the contract such as the symbol name, tick size, mark price,etc.", "x-api-rate-limit": 3, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": [\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"rootSymbol\\\": \\\"USDT\\\",\\n \\\"type\\\": \\\"FFWCSX\\\",\\n \\\"firstOpenDate\\\": 1585555200000,\\n \\\"expireDate\\\": null,\\n \\\"settleDate\\\": null,\\n \\\"baseCurrency\\\": \\\"XBT\\\",\\n \\\"quoteCurrency\\\": \\\"USDT\\\",\\n \\\"settleCurrency\\\": \\\"USDT\\\",\\n \\\"maxOrderQty\\\": 1000000,\\n \\\"maxPrice\\\": 1000000.0,\\n \\\"lotSize\\\": 1,\\n \\\"tickSize\\\": 0.1,\\n \\\"indexPriceTickSize\\\": 0.01,\\n \\\"multiplier\\\": 0.001,\\n \\\"initialMargin\\\": 0.008,\\n \\\"maintainMargin\\\": 0.004,\\n \\\"maxRiskLimit\\\": 100000,\\n \\\"minRiskLimit\\\": 100000,\\n \\\"riskStep\\\": 50000,\\n \\\"makerFeeRate\\\": 2.0E-4,\\n \\\"takerFeeRate\\\": 6.0E-4,\\n \\\"takerFixFee\\\": 0.0,\\n \\\"makerFixFee\\\": 0.0,\\n \\\"settlementFee\\\": null,\\n \\\"isDeleverage\\\": true,\\n \\\"isQuanto\\\": true,\\n \\\"isInverse\\\": false,\\n \\\"markMethod\\\": \\\"FairPrice\\\",\\n \\\"fairMethod\\\": \\\"FundingRate\\\",\\n \\\"fundingBaseSymbol\\\": \\\".XBTINT8H\\\",\\n \\\"fundingQuoteSymbol\\\": \\\".USDTINT8H\\\",\\n \\\"fundingRateSymbol\\\": \\\".XBTUSDTMFPI8H\\\",\\n \\\"indexSymbol\\\": \\\".KXBTUSDT\\\",\\n \\\"settlementSymbol\\\": \\\"\\\",\\n \\\"status\\\": \\\"Open\\\",\\n \\\"fundingFeeRate\\\": 1.53E-4,\\n \\\"predictedFundingFeeRate\\\": 8.0E-5,\\n \\\"fundingRateGranularity\\\": 28800000,\\n \\\"openInterest\\\": \\\"6384957\\\",\\n \\\"turnoverOf24h\\\": 5.788402220999069E8,\\n \\\"volumeOf24h\\\": 8274.432,\\n \\\"markPrice\\\": 69732.33,\\n \\\"indexPrice\\\": 69732.32,\\n \\\"lastTradePrice\\\": 69732,\\n \\\"nextFundingRateTime\\\": 21265941,\\n \\\"maxLeverage\\\": 125,\\n \\\"sourceExchanges\\\": [\\n \\\"okex\\\",\\n \\\"binance\\\",\\n \\\"kucoin\\\",\\n \\\"bybit\\\",\\n \\\"bitmart\\\",\\n \\\"gateio\\\"\\n ],\\n \\\"premiumsSymbol1M\\\": \\\".XBTUSDTMPI\\\",\\n \\\"premiumsSymbol8H\\\": \\\".XBTUSDTMPI8H\\\",\\n \\\"fundingBaseSymbol1M\\\": \\\".XBTINT\\\",\\n \\\"fundingQuoteSymbol1M\\\": \\\".USDTINT\\\",\\n \\\"lowPrice\\\": 68817.5,\\n \\\"highPrice\\\": 71615.8,\\n \\\"priceChgPct\\\": 6.0E-4,\\n \\\"priceChg\\\": 48.0,\\n \\\"k\\\": 490.0,\\n \\\"m\\\": 300.0,\\n \\\"f\\\": 1.3,\\n \\\"mmrLimit\\\": 0.3,\\n \\\"mmrLevConstant\\\": 125.0,\\n \\\"supportCross\\\": true\\n }\\n ]\\n}" + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": [\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"rootSymbol\\\": \\\"USDT\\\",\\n \\\"type\\\": \\\"FFWCSX\\\",\\n \\\"firstOpenDate\\\": 1585555200000,\\n \\\"expireDate\\\": null,\\n \\\"settleDate\\\": null,\\n \\\"baseCurrency\\\": \\\"XBT\\\",\\n \\\"quoteCurrency\\\": \\\"USDT\\\",\\n \\\"settleCurrency\\\": \\\"USDT\\\",\\n \\\"maxOrderQty\\\": 1000000,\\n \\\"maxPrice\\\": 1000000.0,\\n \\\"lotSize\\\": 1,\\n \\\"tickSize\\\": 0.1,\\n \\\"indexPriceTickSize\\\": 0.01,\\n \\\"multiplier\\\": 0.001,\\n \\\"initialMargin\\\": 0.008,\\n \\\"maintainMargin\\\": 0.004,\\n \\\"maxRiskLimit\\\": 100000,\\n \\\"minRiskLimit\\\": 100000,\\n \\\"riskStep\\\": 50000,\\n \\\"makerFeeRate\\\": 2.0E-4,\\n \\\"takerFeeRate\\\": 6.0E-4,\\n \\\"takerFixFee\\\": 0.0,\\n \\\"makerFixFee\\\": 0.0,\\n \\\"settlementFee\\\": null,\\n \\\"isDeleverage\\\": true,\\n \\\"isQuanto\\\": true,\\n \\\"isInverse\\\": false,\\n \\\"markMethod\\\": \\\"FairPrice\\\",\\n \\\"fairMethod\\\": \\\"FundingRate\\\",\\n \\\"fundingBaseSymbol\\\": \\\".XBTINT8H\\\",\\n \\\"fundingQuoteSymbol\\\": \\\".USDTINT8H\\\",\\n \\\"fundingRateSymbol\\\": \\\".XBTUSDTMFPI8H\\\",\\n \\\"indexSymbol\\\": \\\".KXBTUSDT\\\",\\n \\\"settlementSymbol\\\": \\\"\\\",\\n \\\"status\\\": \\\"Open\\\",\\n \\\"fundingFeeRate\\\": 1.53E-4,\\n \\\"predictedFundingFeeRate\\\": 8.0E-5,\\n \\\"fundingRateGranularity\\\": 28800000,\\n \\\"openInterest\\\": \\\"6384957\\\",\\n \\\"turnoverOf24h\\\": 5.788402220999069E8,\\n \\\"volumeOf24h\\\": 8274.432,\\n \\\"markPrice\\\": 69732.33,\\n \\\"indexPrice\\\": 69732.32,\\n \\\"lastTradePrice\\\": 69732,\\n \\\"nextFundingRateTime\\\": 21265941,\\n \\\"maxLeverage\\\": 125,\\n \\\"sourceExchanges\\\": [\\n \\\"okex\\\",\\n \\\"binance\\\",\\n \\\"kucoin\\\",\\n \\\"bybit\\\",\\n \\\"bitmart\\\",\\n \\\"gateio\\\"\\n ],\\n \\\"premiumsSymbol1M\\\": \\\".XBTUSDTMPI\\\",\\n \\\"premiumsSymbol8H\\\": \\\".XBTUSDTMPI8H\\\",\\n \\\"fundingBaseSymbol1M\\\": \\\".XBTINT\\\",\\n \\\"fundingQuoteSymbol1M\\\": \\\".USDTINT\\\",\\n \\\"lowPrice\\\": 68817.5,\\n \\\"highPrice\\\": 71615.8,\\n \\\"priceChgPct\\\": 6.0E-4,\\n \\\"priceChg\\\": 48.0,\\n \\\"k\\\": 490.0,\\n \\\"m\\\": 300.0,\\n \\\"f\\\": 1.3,\\n \\\"mmrLimit\\\": 0.3,\\n \\\"mmrLevConstant\\\": 125.0,\\n \\\"supportCross\\\": true\\n }\\n ]\\n}", + "operationId": "002" } }, "/api/v1/ticker": { @@ -1062,7 +1064,8 @@ "x-sdk-method-description": "This endpoint returns \"last traded price/size\"、\"best bid/ask price/size\" etc. of a single symbol. These messages can also be obtained through Websocket.", "x-api-rate-limit": 2, "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"sequence\\\":1697895100310,\\\"symbol\\\":\\\"XBTUSDM\\\",\\\"side\\\":\\\"sell\\\",\\\"size\\\":2936,\\\"tradeId\\\":\\\"1697901180000\\\",\\\"price\\\":\\\"67158.4\\\",\\\"bestBidPrice\\\":\\\"67169.6\\\",\\\"bestBidSize\\\":32345,\\\"bestAskPrice\\\":\\\"67169.7\\\",\\\"bestAskSize\\\":7251,\\\"ts\\\":1729163001780000000}}", - "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDTM\\\"}" + "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDTM\\\"}", + "operationId": "003" } }, "/api/v1/allTickers": { @@ -1188,7 +1191,8 @@ "x-sdk-method-name": "getAllTickers", "x-sdk-method-description": "This endpoint returns \"last traded price/size\"、\"best bid/ask price/size\" etc. of a single symbol. These messages can also be obtained through Websocket.", "x-api-rate-limit": 5, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": [\\n {\\n \\\"sequence\\\": 1707992727046,\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"side\\\": \\\"sell\\\",\\n \\\"size\\\": 21,\\n \\\"tradeId\\\": \\\"1784299761369\\\",\\n \\\"price\\\": \\\"67153\\\",\\n \\\"bestBidPrice\\\": \\\"67153\\\",\\n \\\"bestBidSize\\\": 2767,\\n \\\"bestAskPrice\\\": \\\"67153.1\\\",\\n \\\"bestAskSize\\\": 5368,\\n \\\"ts\\\": 1729163466659000000\\n },\\n {\\n \\\"sequence\\\": 1697895166299,\\n \\\"symbol\\\": \\\"XBTUSDM\\\",\\n \\\"side\\\": \\\"sell\\\",\\n \\\"size\\\": 1956,\\n \\\"tradeId\\\": \\\"1697901245065\\\",\\n \\\"price\\\": \\\"67145.2\\\",\\n \\\"bestBidPrice\\\": \\\"67135.3\\\",\\n \\\"bestBidSize\\\": 1,\\n \\\"bestAskPrice\\\": \\\"67135.8\\\",\\n \\\"bestAskSize\\\": 3,\\n \\\"ts\\\": 1729163445340000000\\n }\\n ]\\n}" + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": [\\n {\\n \\\"sequence\\\": 1707992727046,\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"side\\\": \\\"sell\\\",\\n \\\"size\\\": 21,\\n \\\"tradeId\\\": \\\"1784299761369\\\",\\n \\\"price\\\": \\\"67153\\\",\\n \\\"bestBidPrice\\\": \\\"67153\\\",\\n \\\"bestBidSize\\\": 2767,\\n \\\"bestAskPrice\\\": \\\"67153.1\\\",\\n \\\"bestAskSize\\\": 5368,\\n \\\"ts\\\": 1729163466659000000\\n },\\n {\\n \\\"sequence\\\": 1697895166299,\\n \\\"symbol\\\": \\\"XBTUSDM\\\",\\n \\\"side\\\": \\\"sell\\\",\\n \\\"size\\\": 1956,\\n \\\"tradeId\\\": \\\"1697901245065\\\",\\n \\\"price\\\": \\\"67145.2\\\",\\n \\\"bestBidPrice\\\": \\\"67135.3\\\",\\n \\\"bestBidSize\\\": 1,\\n \\\"bestAskPrice\\\": \\\"67135.8\\\",\\n \\\"bestAskSize\\\": 3,\\n \\\"ts\\\": 1729163445340000000\\n }\\n ]\\n}", + "operationId": "004" } }, "/api/v1/level2/snapshot": { @@ -1290,7 +1294,8 @@ "x-sdk-method-description": "Query for Full orderbook depth data. (aggregated by price) It is generally used by professional traders because it uses more server resources and traffic, and we have strict access rate limit control. To maintain up-to-date Order Book, please use Websocket incremental feed after retrieving the OrderBook.", "x-api-rate-limit": 3, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"sequence\\\": 1697895963339,\\n \\\"symbol\\\": \\\"XBTUSDM\\\",\\n \\\"bids\\\": [\\n [\\n 66968,\\n 2\\n ],\\n [\\n 66964.8,\\n 25596\\n ]\\n ],\\n \\\"asks\\\": [\\n [\\n 66968.1,\\n 13501\\n ],\\n [\\n 66968.7,\\n 2032\\n ]\\n ],\\n \\\"ts\\\": 1729168101216000000\\n }\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDM\\\"}" + "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDM\\\"}", + "operationId": "005" } }, "/api/v1/level2/depth{size}": { @@ -1400,7 +1405,8 @@ "x-sdk-method-description": "Query for part orderbook depth data. (aggregated by price) You are recommended to request via this endpoint as the system reponse would be faster and cosume less traffic.", "x-api-rate-limit": 5, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"sequence\\\": 1697895963339,\\n \\\"symbol\\\": \\\"XBTUSDM\\\",\\n \\\"bids\\\": [\\n [\\n 66968,\\n 2\\n ],\\n [\\n 66964.8,\\n 25596\\n ]\\n ],\\n \\\"asks\\\": [\\n [\\n 66968.1,\\n 13501\\n ],\\n [\\n 66968.7,\\n 2032\\n ]\\n ],\\n \\\"ts\\\": 1729168101216000000\\n }\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDM\\\", \\\"size\\\": \\\"20\\\"}" + "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDM\\\", \\\"size\\\": \\\"20\\\"}", + "operationId": "006" } }, "/api/v1/trade/history": { @@ -1526,7 +1532,8 @@ "x-sdk-method-description": "Request via this endpoint to get the trade history of the specified symbol, the returned quantity is the last 100 transaction records.", "x-api-rate-limit": 5, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": [\\n {\\n \\\"sequence\\\": 1697915257909,\\n \\\"contractId\\\": 1,\\n \\\"tradeId\\\": \\\"1697915257909\\\",\\n \\\"makerOrderId\\\": \\\"236679665752801280\\\",\\n \\\"takerOrderId\\\": \\\"236679667975745536\\\",\\n \\\"ts\\\": 1729242032152000000,\\n \\\"size\\\": 1,\\n \\\"price\\\": \\\"67878\\\",\\n \\\"side\\\": \\\"sell\\\"\\n },\\n {\\n \\\"sequence\\\": 1697915257749,\\n \\\"contractId\\\": 1,\\n \\\"tradeId\\\": \\\"1697915257749\\\",\\n \\\"makerOrderId\\\": \\\"236679660971245570\\\",\\n \\\"takerOrderId\\\": \\\"236679665400492032\\\",\\n \\\"ts\\\": 1729242031535000000,\\n \\\"size\\\": 1,\\n \\\"price\\\": \\\"67867.8\\\",\\n \\\"side\\\": \\\"sell\\\"\\n },\\n {\\n \\\"sequence\\\": 1697915257701,\\n \\\"contractId\\\": 1,\\n \\\"tradeId\\\": \\\"1697915257701\\\",\\n \\\"makerOrderId\\\": \\\"236679660971245570\\\",\\n \\\"takerOrderId\\\": \\\"236679661919211521\\\",\\n \\\"ts\\\": 1729242030932000000,\\n \\\"size\\\": 1,\\n \\\"price\\\": \\\"67867.8\\\",\\n \\\"side\\\": \\\"sell\\\"\\n }\\n ]\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDM\\\"}" + "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDM\\\"}", + "operationId": "007" } }, "/api/v1/kline/query": { @@ -1695,7 +1702,8 @@ "x-sdk-method-description": "Get the Kline of the symbol. Data are returned in grouped buckets based on requested type. For each query, the system would return at most 500 pieces of data. To obtain more data, please page the data by time.", "x-api-rate-limit": 3, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": [\\n [\\n 1728576000000,\\n 60791.1,\\n 61035,\\n 58940,\\n 60300,\\n 5501167\\n ],\\n [\\n 1728604800000,\\n 60299.9,\\n 60924.1,\\n 60077.4,\\n 60666.1,\\n 1220980\\n ],\\n [\\n 1728633600000,\\n 60665.7,\\n 62436.8,\\n 60650.1,\\n 62255.1,\\n 3386359\\n ]\\n ]\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDTM\\\", \\\"granularity\\\": 1, \\\"from\\\": 1728552342000, \\\"to\\\": 1729243542000}" + "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDTM\\\", \\\"granularity\\\": 1, \\\"from\\\": 1728552342000, \\\"to\\\": 1729243542000}", + "operationId": "008" } }, "/api/v1/mark-price/{symbol}/current": { @@ -1781,7 +1789,8 @@ "x-sdk-method-description": "Get current mark price", "x-api-rate-limit": 3, "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"symbol\\\":\\\"XBTUSDTM\\\",\\\"granularity\\\":1000,\\\"timePoint\\\":1729254307000,\\\"value\\\":67687.08,\\\"indexPrice\\\":67683.58}}", - "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDTM\\\"}" + "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDTM\\\"}", + "operationId": "009" } }, "/api/v1/index/query": { @@ -1971,7 +1980,8 @@ "x-sdk-method-description": "Get Spot Index Price", "x-api-rate-limit": 2, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"hasMore\\\": true,\\n \\\"dataList\\\": [\\n {\\n \\\"symbol\\\": \\\".KXBTUSDT\\\",\\n \\\"granularity\\\": 1000,\\n \\\"timePoint\\\": 1730557515000,\\n \\\"value\\\": 69202.94,\\n \\\"decomposionList\\\": [\\n {\\n \\\"exchange\\\": \\\"gateio\\\",\\n \\\"price\\\": 69209.27,\\n \\\"weight\\\": 0.0533\\n },\\n {\\n \\\"exchange\\\": \\\"bitmart\\\",\\n \\\"price\\\": 69230.77,\\n \\\"weight\\\": 0.0128\\n },\\n {\\n \\\"exchange\\\": \\\"okex\\\",\\n \\\"price\\\": 69195.34,\\n \\\"weight\\\": 0.11\\n },\\n {\\n \\\"exchange\\\": \\\"bybit\\\",\\n \\\"price\\\": 69190.33,\\n \\\"weight\\\": 0.0676\\n },\\n {\\n \\\"exchange\\\": \\\"binance\\\",\\n \\\"price\\\": 69204.55,\\n \\\"weight\\\": 0.6195\\n },\\n {\\n \\\"exchange\\\": \\\"kucoin\\\",\\n \\\"price\\\": 69202.91,\\n \\\"weight\\\": 0.1368\\n }\\n ]\\n },\\n {\\n \\\"symbol\\\": \\\".KXBTUSDT\\\",\\n \\\"granularity\\\": 1000,\\n \\\"timePoint\\\": 1730557514000,\\n \\\"value\\\": 69204.98,\\n \\\"decomposionList\\\": [\\n {\\n \\\"exchange\\\": \\\"gateio\\\",\\n \\\"price\\\": 69212.71,\\n \\\"weight\\\": 0.0808\\n },\\n {\\n \\\"exchange\\\": \\\"bitmart\\\",\\n \\\"price\\\": 69230.77,\\n \\\"weight\\\": 0.0134\\n },\\n {\\n \\\"exchange\\\": \\\"okex\\\",\\n \\\"price\\\": 69195.49,\\n \\\"weight\\\": 0.0536\\n },\\n {\\n \\\"exchange\\\": \\\"bybit\\\",\\n \\\"price\\\": 69195.97,\\n \\\"weight\\\": 0.0921\\n },\\n {\\n \\\"exchange\\\": \\\"binance\\\",\\n \\\"price\\\": 69204.56,\\n \\\"weight\\\": 0.5476\\n },\\n {\\n \\\"exchange\\\": \\\"kucoin\\\",\\n \\\"price\\\": 69207.8,\\n \\\"weight\\\": 0.2125\\n }\\n ]\\n }\\n ]\\n }\\n}", - "x-request-example": "{\\\"symbol\\\": \\\".KXBTUSDT\\\", \\\"startAt\\\": 123456, \\\"endAt\\\": 123456, \\\"reverse\\\": true, \\\"offset\\\": 123456, \\\"forward\\\": true, \\\"maxCount\\\": 10}" + "x-request-example": "{\\\"symbol\\\": \\\".KXBTUSDT\\\", \\\"startAt\\\": 123456, \\\"endAt\\\": 123456, \\\"reverse\\\": true, \\\"offset\\\": 123456, \\\"forward\\\": true, \\\"maxCount\\\": 10}", + "operationId": "010" } }, "/api/v1/interest/query": { @@ -2136,7 +2146,8 @@ "x-sdk-method-description": "Get interest rate Index.", "x-api-rate-limit": 5, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"dataList\\\": [\\n {\\n \\\"symbol\\\": \\\".XBTINT\\\",\\n \\\"granularity\\\": 60000,\\n \\\"timePoint\\\": 1728692100000,\\n \\\"value\\\": 3.0E-4\\n },\\n {\\n \\\"symbol\\\": \\\".XBTINT\\\",\\n \\\"granularity\\\": 60000,\\n \\\"timePoint\\\": 1728692040000,\\n \\\"value\\\": 3.0E-4\\n }\\n ],\\n \\\"hasMore\\\": true\\n }\\n}", - "x-request-example": "{\\\"symbol\\\": \\\".XBTINT8H\\\", \\\"startAt\\\": 1728663338000, \\\"endAt\\\": 1728692138000, \\\"reverse\\\": true, \\\"offset\\\": 254062248624417, \\\"forward\\\": true, \\\"maxCount\\\": 10}" + "x-request-example": "{\\\"symbol\\\": \\\".XBTINT8H\\\", \\\"startAt\\\": 1728663338000, \\\"endAt\\\": 1728692138000, \\\"reverse\\\": true, \\\"offset\\\": 254062248624417, \\\"forward\\\": true, \\\"maxCount\\\": 10}", + "operationId": "011" } }, "/api/v1/premium/query": { @@ -2299,7 +2310,8 @@ "x-sdk-method-description": "Submit request to get premium index.", "x-api-rate-limit": 3, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"hasMore\\\": true,\\n \\\"dataList\\\": [\\n {\\n \\\"symbol\\\": \\\".XBTUSDTMPI\\\",\\n \\\"granularity\\\": 60000,\\n \\\"timePoint\\\": 1730558040000,\\n \\\"value\\\": 0.00006\\n },\\n {\\n \\\"symbol\\\": \\\".XBTUSDTMPI\\\",\\n \\\"granularity\\\": 60000,\\n \\\"timePoint\\\": 1730557980000,\\n \\\"value\\\": -0.000025\\n }\\n ]\\n }\\n}", - "x-request-example": "{\\\"symbol\\\": \\\".XBTUSDTMPI\\\", \\\"startAt\\\": 1728663338000, \\\"endAt\\\": 1728692138000, \\\"reverse\\\": true, \\\"offset\\\": 254062248624417, \\\"forward\\\": true, \\\"maxCount\\\": 10}" + "x-request-example": "{\\\"symbol\\\": \\\".XBTUSDTMPI\\\", \\\"startAt\\\": 1728663338000, \\\"endAt\\\": 1728692138000, \\\"reverse\\\": true, \\\"offset\\\": 254062248624417, \\\"forward\\\": true, \\\"maxCount\\\": 10}", + "operationId": "012" } }, "/api/v1/trade-statistics": { @@ -2353,7 +2365,8 @@ "x-sdk-method-name": "get24hrStats", "x-sdk-method-description": "Get the statistics of the platform futures trading volume in the last 24 hours.", "x-api-rate-limit": 3, - "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"turnoverOf24h\\\":1.1155733413273683E9}}" + "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"turnoverOf24h\\\":1.1155733413273683E9}}", + "operationId": "013" } }, "/api/v1/timestamp": { @@ -2400,7 +2413,8 @@ "x-sdk-method-name": "getServerTime", "x-sdk-method-description": "Get the API server time. This is the Unix timestamp.", "x-api-rate-limit": 2, - "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":1729260030774}" + "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":1729260030774}", + "operationId": "014" } }, "/api/v1/status": { @@ -2480,7 +2494,8 @@ "x-sdk-method-name": "getServiceStatus", "x-sdk-method-description": "Get the service status.", "x-api-rate-limit": 4, - "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"msg\\\":\\\"\\\",\\\"status\\\":\\\"open\\\"}}" + "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"msg\\\":\\\"\\\",\\\"status\\\":\\\"open\\\"}}", + "operationId": "015" } }, "/api/v1/bullet-public": { @@ -2580,7 +2595,8 @@ "x-sdk-method-name": "getPublicToken", "x-sdk-method-description": "This interface can obtain the token required for websocket to establish a Futures connection. If you need use public channels (e.g. all public market data), please make request as follows to obtain the server list and public token", "x-api-rate-limit": 10, - "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"token\\\":\\\"2neAiuYvAU61ZDXANAGAsiL4-iAExhsBXZxftpOeh_55i3Ysy2q2LEsEWU64mdzUOPusi34M_wGoSf7iNyEWJ6dACm4ny9vJtLTRq_YsRUlG5ADnAawegdiYB9J6i9GjsxUuhPw3Blq6rhZlGykT3Vp1phUafnulOOpts-MEmEF-3bpfetLOAjsMMBS5qwTWJBvJHl5Vs9Y=.gJEIAywPXFr_4L-WG10eug==\\\",\\\"instanceServers\\\":[{\\\"endpoint\\\":\\\"wss://ws-api-futures.kucoin.com/\\\",\\\"encrypt\\\":true,\\\"protocol\\\":\\\"websocket\\\",\\\"pingInterval\\\":18000,\\\"pingTimeout\\\":10000}]}}" + "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"token\\\":\\\"2neAiuYvAU61ZDXANAGAsiL4-iAExhsBXZxftpOeh_55i3Ysy2q2LEsEWU64mdzUOPusi34M_wGoSf7iNyEWJ6dACm4ny9vJtLTRq_YsRUlG5ADnAawegdiYB9J6i9GjsxUuhPw3Blq6rhZlGykT3Vp1phUafnulOOpts-MEmEF-3bpfetLOAjsMMBS5qwTWJBvJHl5Vs9Y=.gJEIAywPXFr_4L-WG10eug==\\\",\\\"instanceServers\\\":[{\\\"endpoint\\\":\\\"wss://ws-api-futures.kucoin.com/\\\",\\\"encrypt\\\":true,\\\"protocol\\\":\\\"websocket\\\",\\\"pingInterval\\\":18000,\\\"pingTimeout\\\":10000}]}}", + "operationId": "016" } }, "/api/v1/bullet-private": { @@ -2680,7 +2696,8 @@ "x-sdk-method-name": "getPrivateToken", "x-sdk-method-description": "This interface can obtain the token required for websocket to establish a Futures private connection. If you need use private channels(e.g. account balance notice), please make request as follows to obtain the server list and private token", "x-api-rate-limit": 10, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"token\\\": \\\"2neAiuYvAU737TOajb2U3uT8AEZqSWYe0fBD4LoHuXJDSC7gIzJiH4kNTWhCPISWo6nDpAe7aUaaHJ4fG8oRjFgMfUI2sM4IySWHrBceFocY8pKy2REU1HwZIngtMdMrjqPnP-biofFWbNaP1cl0X1pZc2SQ-33hDH1LgNP-yg8bktVoIG0dIxSN4m3uzO8u.ueCCihQ5_4GPpXKxWTDiFQ==\\\",\\n \\\"instanceServers\\\": [\\n {\\n \\\"endpoint\\\": \\\"wss://ws-api-futures.kucoin.com/\\\",\\n \\\"encrypt\\\": true,\\n \\\"protocol\\\": \\\"websocket\\\",\\n \\\"pingInterval\\\": 18000,\\n \\\"pingTimeout\\\": 10000\\n }\\n ]\\n }\\n}" + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"token\\\": \\\"2neAiuYvAU737TOajb2U3uT8AEZqSWYe0fBD4LoHuXJDSC7gIzJiH4kNTWhCPISWo6nDpAe7aUaaHJ4fG8oRjFgMfUI2sM4IySWHrBceFocY8pKy2REU1HwZIngtMdMrjqPnP-biofFWbNaP1cl0X1pZc2SQ-33hDH1LgNP-yg8bktVoIG0dIxSN4m3uzO8u.ueCCihQ5_4GPpXKxWTDiFQ==\\\",\\n \\\"instanceServers\\\": [\\n {\\n \\\"endpoint\\\": \\\"wss://ws-api-futures.kucoin.com/\\\",\\n \\\"encrypt\\\": true,\\n \\\"protocol\\\": \\\"websocket\\\",\\n \\\"pingInterval\\\": 18000,\\n \\\"pingTimeout\\\": 10000\\n }\\n ]\\n }\\n}", + "operationId": "017" } } }, diff --git a/spec/rest/api/openapi-futures-order.json b/spec/rest/api/openapi-futures-order.json index 3afe0cb9..da57c940 100644 --- a/spec/rest/api/openapi-futures-order.json +++ b/spec/rest/api/openapi-futures-order.json @@ -325,7 +325,8 @@ } }, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"orderId\\\": \\\"234125150956625920\\\",\\n \\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\"\\n }\\n}", - "x-request-example": "{\\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\", \\\"side\\\": \\\"buy\\\", \\\"symbol\\\": \\\"XBTUSDTM\\\", \\\"leverage\\\": 3, \\\"type\\\": \\\"limit\\\", \\\"remark\\\": \\\"order remarks\\\", \\\"reduceOnly\\\": false, \\\"marginMode\\\": \\\"ISOLATED\\\", \\\"price\\\": \\\"0.1\\\", \\\"size\\\": 1, \\\"timeInForce\\\": \\\"GTC\\\"}" + "x-request-example": "{\\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\", \\\"side\\\": \\\"buy\\\", \\\"symbol\\\": \\\"XBTUSDTM\\\", \\\"leverage\\\": 3, \\\"type\\\": \\\"limit\\\", \\\"remark\\\": \\\"order remarks\\\", \\\"reduceOnly\\\": false, \\\"marginMode\\\": \\\"ISOLATED\\\", \\\"price\\\": \\\"0.1\\\", \\\"size\\\": 1, \\\"timeInForce\\\": \\\"GTC\\\"}", + "operationId": "001" }, "get": { "summary": "Get Order List", @@ -719,7 +720,8 @@ "x-sdk-method-description": "List your current orders.", "x-api-rate-limit": 2, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"currentPage\\\": 1,\\n \\\"pageSize\\\": 50,\\n \\\"totalNum\\\": 1,\\n \\\"totalPage\\\": 1,\\n \\\"items\\\": [\\n {\\n \\\"id\\\": \\\"230181737576050688\\\",\\n \\\"symbol\\\": \\\"PEOPLEUSDTM\\\",\\n \\\"type\\\": \\\"limit\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"price\\\": \\\"0.05\\\",\\n \\\"size\\\": 10,\\n \\\"value\\\": \\\"5\\\",\\n \\\"dealValue\\\": \\\"0\\\",\\n \\\"dealSize\\\": 0,\\n \\\"stp\\\": \\\"\\\",\\n \\\"stop\\\": \\\"\\\",\\n \\\"stopPriceType\\\": \\\"\\\",\\n \\\"stopTriggered\\\": false,\\n \\\"stopPrice\\\": null,\\n \\\"timeInForce\\\": \\\"GTC\\\",\\n \\\"postOnly\\\": false,\\n \\\"hidden\\\": false,\\n \\\"iceberg\\\": false,\\n \\\"leverage\\\": \\\"1\\\",\\n \\\"forceHold\\\": false,\\n \\\"closeOrder\\\": false,\\n \\\"visibleSize\\\": 0,\\n \\\"clientOid\\\": \\\"5a80bd847f1811ef8a7faa665a37b3d7\\\",\\n \\\"remark\\\": null,\\n \\\"tags\\\": \\\"\\\",\\n \\\"isActive\\\": true,\\n \\\"cancelExist\\\": false,\\n \\\"createdAt\\\": 1727692804813,\\n \\\"updatedAt\\\": 1727692804813,\\n \\\"endAt\\\": null,\\n \\\"orderTime\\\": 1727692804808418000,\\n \\\"settleCurrency\\\": \\\"USDT\\\",\\n \\\"marginMode\\\": \\\"ISOLATED\\\",\\n \\\"avgDealPrice\\\": \\\"0\\\",\\n \\\"filledSize\\\": 0,\\n \\\"filledValue\\\": \\\"0\\\",\\n \\\"status\\\": \\\"open\\\",\\n \\\"reduceOnly\\\": false\\n }\\n ]\\n }\\n}", - "x-request-example": "{\\\"status\\\": \\\"done\\\", \\\"symbol\\\": \\\"example_string_default_value\\\", \\\"side\\\": \\\"buy\\\", \\\"type\\\": \\\"limit\\\", \\\"startAt\\\": 123456, \\\"endAt\\\": 123456, \\\"currentPage\\\": 123456, \\\"pageSize\\\": 123456}" + "x-request-example": "{\\\"status\\\": \\\"done\\\", \\\"symbol\\\": \\\"example_string_default_value\\\", \\\"side\\\": \\\"buy\\\", \\\"type\\\": \\\"limit\\\", \\\"startAt\\\": 123456, \\\"endAt\\\": 123456, \\\"currentPage\\\": 123456, \\\"pageSize\\\": 123456}", + "operationId": "012" }, "delete": { "summary": "Cancel All Orders - V1", @@ -785,7 +787,8 @@ "x-sdk-method-description": "Cancel all open orders (excluding stop orders). The response is a list of orderIDs of the canceled orders.", "x-api-rate-limit": 200, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"cancelledOrderIds\\\": [\\n \\\"235919172150824960\\\",\\n \\\"235919172150824961\\\"\\n ]\\n }\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDTM\\\"}" + "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDTM\\\"}", + "operationId": "018" } }, "/api/v1/orders/test": { @@ -1107,7 +1110,8 @@ } }, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"orderId\\\": \\\"234125150956625920\\\",\\n \\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\"\\n }\\n}", - "x-request-example": "{\\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\", \\\"side\\\": \\\"buy\\\", \\\"symbol\\\": \\\"XBTUSDTM\\\", \\\"leverage\\\": 3, \\\"type\\\": \\\"limit\\\", \\\"remark\\\": \\\"order remarks\\\", \\\"reduceOnly\\\": false, \\\"marginMode\\\": \\\"ISOLATED\\\", \\\"price\\\": \\\"0.1\\\", \\\"size\\\": 1, \\\"timeInForce\\\": \\\"GTC\\\"}" + "x-request-example": "{\\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\", \\\"side\\\": \\\"buy\\\", \\\"symbol\\\": \\\"XBTUSDTM\\\", \\\"leverage\\\": 3, \\\"type\\\": \\\"limit\\\", \\\"remark\\\": \\\"order remarks\\\", \\\"reduceOnly\\\": false, \\\"marginMode\\\": \\\"ISOLATED\\\", \\\"price\\\": \\\"0.1\\\", \\\"size\\\": 1, \\\"timeInForce\\\": \\\"GTC\\\"}", + "operationId": "002" } }, "/api/v1/orders/multi": { @@ -1448,7 +1452,8 @@ } }, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": [\\n {\\n \\\"orderId\\\": \\\"235919387779985408\\\",\\n \\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\",\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"code\\\": \\\"200000\\\",\\n \\\"msg\\\": \\\"success\\\"\\n },\\n {\\n \\\"orderId\\\": \\\"235919387855482880\\\",\\n \\\"clientOid\\\": \\\"5c52e11203aa677f33e493fc\\\",\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"code\\\": \\\"200000\\\",\\n \\\"msg\\\": \\\"success\\\"\\n }\\n ]\\n}", - "x-request-example": "[{\\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\", \\\"side\\\": \\\"buy\\\", \\\"symbol\\\": \\\"XBTUSDTM\\\", \\\"leverage\\\": 3, \\\"type\\\": \\\"limit\\\", \\\"remark\\\": \\\"order remarks\\\", \\\"reduceOnly\\\": false, \\\"marginMode\\\": \\\"ISOLATED\\\", \\\"price\\\": \\\"0.1\\\", \\\"size\\\": 1, \\\"timeInForce\\\": \\\"GTC\\\"}, {\\\"clientOid\\\": \\\"5c52e11203aa677f33e493fc\\\", \\\"side\\\": \\\"buy\\\", \\\"symbol\\\": \\\"XBTUSDTM\\\", \\\"leverage\\\": 3, \\\"type\\\": \\\"limit\\\", \\\"remark\\\": \\\"order remarks\\\", \\\"reduceOnly\\\": false, \\\"marginMode\\\": \\\"ISOLATED\\\", \\\"price\\\": \\\"0.1\\\", \\\"size\\\": 1, \\\"timeInForce\\\": \\\"GTC\\\"}]" + "x-request-example": "[{\\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\", \\\"side\\\": \\\"buy\\\", \\\"symbol\\\": \\\"XBTUSDTM\\\", \\\"leverage\\\": 3, \\\"type\\\": \\\"limit\\\", \\\"remark\\\": \\\"order remarks\\\", \\\"reduceOnly\\\": false, \\\"marginMode\\\": \\\"ISOLATED\\\", \\\"price\\\": \\\"0.1\\\", \\\"size\\\": 1, \\\"timeInForce\\\": \\\"GTC\\\"}, {\\\"clientOid\\\": \\\"5c52e11203aa677f33e493fc\\\", \\\"side\\\": \\\"buy\\\", \\\"symbol\\\": \\\"XBTUSDTM\\\", \\\"leverage\\\": 3, \\\"type\\\": \\\"limit\\\", \\\"remark\\\": \\\"order remarks\\\", \\\"reduceOnly\\\": false, \\\"marginMode\\\": \\\"ISOLATED\\\", \\\"price\\\": \\\"0.1\\\", \\\"size\\\": 1, \\\"timeInForce\\\": \\\"GTC\\\"}]", + "operationId": "003" } }, "/api/v1/st-orders": { @@ -1754,7 +1759,8 @@ } }, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"orderId\\\": \\\"234125150956625920\\\",\\n \\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\"\\n }\\n}", - "x-request-example": "{\\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\", \\\"side\\\": \\\"buy\\\", \\\"symbol\\\": \\\"XBTUSDTM\\\", \\\"leverage\\\": 3, \\\"type\\\": \\\"limit\\\", \\\"remark\\\": \\\"order remarks\\\", \\\"reduceOnly\\\": false, \\\"marginMode\\\": \\\"ISOLATED\\\", \\\"price\\\": \\\"0.2\\\", \\\"size\\\": 1, \\\"timeInForce\\\": \\\"GTC\\\", \\\"triggerStopUpPrice\\\": \\\"0.3\\\", \\\"triggerStopDownPrice\\\": \\\"0.1\\\", \\\"stopPriceType\\\": \\\"TP\\\"}" + "x-request-example": "{\\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\", \\\"side\\\": \\\"buy\\\", \\\"symbol\\\": \\\"XBTUSDTM\\\", \\\"leverage\\\": 3, \\\"type\\\": \\\"limit\\\", \\\"remark\\\": \\\"order remarks\\\", \\\"reduceOnly\\\": false, \\\"marginMode\\\": \\\"ISOLATED\\\", \\\"price\\\": \\\"0.2\\\", \\\"size\\\": 1, \\\"timeInForce\\\": \\\"GTC\\\", \\\"triggerStopUpPrice\\\": \\\"0.3\\\", \\\"triggerStopDownPrice\\\": \\\"0.1\\\", \\\"stopPriceType\\\": \\\"TP\\\"}", + "operationId": "004" } }, "/api/v1/orders/{orderId}": { @@ -1822,7 +1828,8 @@ "x-sdk-method-description": "Cancel order by system generated orderId.", "x-api-rate-limit": 1, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"cancelledOrderIds\\\": [\\n \\\"235303670076489728\\\"\\n ]\\n }\\n}", - "x-request-example": "{\\\"orderId\\\": \\\"example_string_default_value\\\"}" + "x-request-example": "{\\\"orderId\\\": \\\"example_string_default_value\\\"}", + "operationId": "005" } }, "/api/v1/orders/client-order/{clientOid}": { @@ -1895,7 +1902,8 @@ "x-sdk-method-description": "Cancel order by client defined orderId.", "x-api-rate-limit": 1, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"clientOid\\\": \\\"017485b0-2957-4681-8a14-5d46b35aee0d\\\"\\n }\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDTM\\\", \\\"clientOid\\\": \\\"example_string_default_value\\\"}" + "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDTM\\\", \\\"clientOid\\\": \\\"example_string_default_value\\\"}", + "operationId": "006" } }, "/api/v1/orders/multi-cancel": { @@ -2008,7 +2016,8 @@ } }, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": [\\n {\\n \\\"orderId\\\": \\\"250445104152670209\\\",\\n \\\"clientOid\\\": null,\\n \\\"code\\\": \\\"200\\\",\\n \\\"msg\\\": \\\"success\\\"\\n },\\n {\\n \\\"orderId\\\": \\\"250445181751463936\\\",\\n \\\"clientOid\\\": null,\\n \\\"code\\\": \\\"200\\\",\\n \\\"msg\\\": \\\"success\\\"\\n }\\n ]\\n}\\n", - "x-request-example": "{\\\"orderIdsList\\\": [\\\"250445104152670209\\\", \\\"250445181751463936\\\"]}" + "x-request-example": "{\\\"orderIdsList\\\": [\\\"250445104152670209\\\", \\\"250445181751463936\\\"]}", + "operationId": "007" } }, "/api/v3/orders": { @@ -2076,7 +2085,8 @@ "x-sdk-method-description": "Cancel all open orders (excluding stop orders). The response is a list of orderIDs of the canceled orders.", "x-api-rate-limit": 10, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"cancelledOrderIds\\\": [\\n \\\"235919172150824960\\\",\\n \\\"235919172150824961\\\"\\n ]\\n }\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDTM\\\"}" + "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDTM\\\"}", + "operationId": "008" } }, "/api/v1/stopOrders": { @@ -2144,7 +2154,8 @@ "x-sdk-method-description": "Cancel all untriggered stop orders. The response is a list of orderIDs of the canceled stop orders. To cancel triggered stop orders, please use 'Cancel Multiple Futures Limit orders'.", "x-api-rate-limit": 15, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"cancelledOrderIds\\\": [\\n \\\"235919172150824960\\\",\\n \\\"235919172150824961\\\"\\n ]\\n }\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDTM\\\"}" + "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDTM\\\"}", + "operationId": "009" }, "get": { "summary": "Get Stop Order List", @@ -2515,7 +2526,8 @@ "x-sdk-method-description": "Get the un-triggered stop orders list. Stop orders that have been triggered can be queried through the general order interface", "x-api-rate-limit": 6, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"currentPage\\\": 1,\\n \\\"pageSize\\\": 50,\\n \\\"totalNum\\\": 1,\\n \\\"totalPage\\\": 1,\\n \\\"items\\\": [\\n {\\n \\\"id\\\": \\\"230181737576050688\\\",\\n \\\"symbol\\\": \\\"PEOPLEUSDTM\\\",\\n \\\"type\\\": \\\"limit\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"price\\\": \\\"0.05\\\",\\n \\\"size\\\": 10,\\n \\\"value\\\": \\\"5\\\",\\n \\\"dealValue\\\": \\\"0\\\",\\n \\\"dealSize\\\": 0,\\n \\\"stp\\\": \\\"\\\",\\n \\\"stop\\\": \\\"\\\",\\n \\\"stopPriceType\\\": \\\"\\\",\\n \\\"stopTriggered\\\": false,\\n \\\"stopPrice\\\": null,\\n \\\"timeInForce\\\": \\\"GTC\\\",\\n \\\"postOnly\\\": false,\\n \\\"hidden\\\": false,\\n \\\"iceberg\\\": false,\\n \\\"leverage\\\": \\\"1\\\",\\n \\\"forceHold\\\": false,\\n \\\"closeOrder\\\": false,\\n \\\"visibleSize\\\": 0,\\n \\\"clientOid\\\": \\\"5a80bd847f1811ef8a7faa665a37b3d7\\\",\\n \\\"remark\\\": null,\\n \\\"tags\\\": \\\"\\\",\\n \\\"isActive\\\": true,\\n \\\"cancelExist\\\": false,\\n \\\"createdAt\\\": 1727692804813,\\n \\\"updatedAt\\\": 1727692804813,\\n \\\"endAt\\\": null,\\n \\\"orderTime\\\": 1727692804808418000,\\n \\\"settleCurrency\\\": \\\"USDT\\\",\\n \\\"marginMode\\\": \\\"ISOLATED\\\",\\n \\\"avgDealPrice\\\": \\\"0\\\",\\n \\\"filledSize\\\": 0,\\n \\\"filledValue\\\": \\\"0\\\",\\n \\\"status\\\": \\\"open\\\",\\n \\\"reduceOnly\\\": false\\n }\\n ]\\n }\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDTM\\\", \\\"side\\\": \\\"buy\\\", \\\"type\\\": \\\"limit\\\", \\\"startAt\\\": 123456, \\\"endAt\\\": 123456, \\\"currentPage\\\": 123456, \\\"pageSize\\\": 50}" + "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDTM\\\", \\\"side\\\": \\\"buy\\\", \\\"type\\\": \\\"limit\\\", \\\"startAt\\\": 123456, \\\"endAt\\\": 123456, \\\"currentPage\\\": 123456, \\\"pageSize\\\": 50}", + "operationId": "014" } }, "/api/v1/orders/{order-id}": { @@ -2888,7 +2900,8 @@ "x-sdk-method-description": "Get a single order by order id (including a stop order).", "x-api-rate-limit": 5, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"id\\\": \\\"236655147005071361\\\",\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"type\\\": \\\"limit\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"price\\\": \\\"0.1\\\",\\n \\\"size\\\": 1,\\n \\\"value\\\": \\\"0.0001\\\",\\n \\\"dealValue\\\": \\\"0\\\",\\n \\\"dealSize\\\": 0,\\n \\\"stp\\\": \\\"\\\",\\n \\\"stop\\\": \\\"\\\",\\n \\\"stopPriceType\\\": \\\"\\\",\\n \\\"stopTriggered\\\": false,\\n \\\"stopPrice\\\": null,\\n \\\"timeInForce\\\": \\\"GTC\\\",\\n \\\"postOnly\\\": false,\\n \\\"hidden\\\": false,\\n \\\"iceberg\\\": false,\\n \\\"leverage\\\": \\\"3\\\",\\n \\\"forceHold\\\": false,\\n \\\"closeOrder\\\": false,\\n \\\"visibleSize\\\": 0,\\n \\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\",\\n \\\"remark\\\": null,\\n \\\"tags\\\": \\\"\\\",\\n \\\"isActive\\\": true,\\n \\\"cancelExist\\\": false,\\n \\\"createdAt\\\": 1729236185949,\\n \\\"updatedAt\\\": 1729236185949,\\n \\\"endAt\\\": null,\\n \\\"orderTime\\\": 1729236185885647952,\\n \\\"settleCurrency\\\": \\\"USDT\\\",\\n \\\"marginMode\\\": \\\"ISOLATED\\\",\\n \\\"avgDealPrice\\\": \\\"0\\\",\\n \\\"filledSize\\\": 0,\\n \\\"filledValue\\\": \\\"0\\\",\\n \\\"status\\\": \\\"open\\\",\\n \\\"reduceOnly\\\": false\\n }\\n}", - "x-request-example": "{\\\"order-id\\\": \\\"236655147005071361\\\"}" + "x-request-example": "{\\\"order-id\\\": \\\"236655147005071361\\\"}", + "operationId": "010" } }, "/api/v1/orders/byClientOid": { @@ -3262,7 +3275,8 @@ "x-sdk-method-description": "Get a single order by client order id (including a stop order).", "x-api-rate-limit": 5, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"id\\\": \\\"250444645610336256\\\",\\n \\\"symbol\\\": \\\"XRPUSDTM\\\",\\n \\\"type\\\": \\\"limit\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"price\\\": \\\"0.1\\\",\\n \\\"size\\\": 1,\\n \\\"value\\\": \\\"1\\\",\\n \\\"dealValue\\\": \\\"0\\\",\\n \\\"dealSize\\\": 0,\\n \\\"stp\\\": \\\"\\\",\\n \\\"stop\\\": \\\"\\\",\\n \\\"stopPriceType\\\": \\\"\\\",\\n \\\"stopTriggered\\\": false,\\n \\\"stopPrice\\\": null,\\n \\\"timeInForce\\\": \\\"GTC\\\",\\n \\\"postOnly\\\": false,\\n \\\"hidden\\\": false,\\n \\\"iceberg\\\": false,\\n \\\"leverage\\\": \\\"3\\\",\\n \\\"forceHold\\\": false,\\n \\\"closeOrder\\\": false,\\n \\\"visibleSize\\\": 0,\\n \\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\",\\n \\\"remark\\\": null,\\n \\\"tags\\\": \\\"\\\",\\n \\\"isActive\\\": true,\\n \\\"cancelExist\\\": false,\\n \\\"createdAt\\\": 1732523858568,\\n \\\"updatedAt\\\": 1732523858568,\\n \\\"endAt\\\": null,\\n \\\"orderTime\\\": 1732523858550892322,\\n \\\"settleCurrency\\\": \\\"USDT\\\",\\n \\\"marginMode\\\": \\\"ISOLATED\\\",\\n \\\"avgDealPrice\\\": \\\"0\\\",\\n \\\"filledSize\\\": 0,\\n \\\"filledValue\\\": \\\"0\\\",\\n \\\"status\\\": \\\"open\\\",\\n \\\"reduceOnly\\\": false\\n }\\n}", - "x-request-example": "{\\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\"}" + "x-request-example": "{\\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\"}", + "operationId": "011" } }, "/api/v1/recentDoneOrders": { @@ -3519,7 +3533,8 @@ "x-sdk-method-description": "Get a list of recent 1000 closed orders in the last 24 hours. If you need to get your recent traded order history with low latency, you may query this endpoint.", "x-api-rate-limit": 5, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": [\\n {\\n \\\"id\\\": \\\"236387137732231168\\\",\\n \\\"symbol\\\": \\\"XRPUSDTM\\\",\\n \\\"type\\\": \\\"market\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"price\\\": \\\"0\\\",\\n \\\"size\\\": 1,\\n \\\"value\\\": \\\"5.51\\\",\\n \\\"dealValue\\\": \\\"5.511\\\",\\n \\\"dealSize\\\": 1,\\n \\\"stp\\\": \\\"\\\",\\n \\\"stop\\\": \\\"\\\",\\n \\\"stopPriceType\\\": \\\"\\\",\\n \\\"stopTriggered\\\": false,\\n \\\"stopPrice\\\": null,\\n \\\"timeInForce\\\": \\\"GTC\\\",\\n \\\"postOnly\\\": false,\\n \\\"hidden\\\": false,\\n \\\"iceberg\\\": false,\\n \\\"leverage\\\": \\\"10.0\\\",\\n \\\"forceHold\\\": false,\\n \\\"closeOrder\\\": false,\\n \\\"visibleSize\\\": 0,\\n \\\"clientOid\\\": \\\"16698fe6-2746-4aeb-a7fa-61f633ab6090\\\",\\n \\\"remark\\\": null,\\n \\\"tags\\\": \\\"\\\",\\n \\\"isActive\\\": false,\\n \\\"cancelExist\\\": false,\\n \\\"createdAt\\\": 1729172287496,\\n \\\"updatedAt\\\": 1729172287568,\\n \\\"endAt\\\": 1729172287568,\\n \\\"orderTime\\\": 1729172287496950800,\\n \\\"settleCurrency\\\": \\\"USDT\\\",\\n \\\"marginMode\\\": \\\"ISOLATED\\\",\\n \\\"avgDealPrice\\\": \\\"0.5511\\\",\\n \\\"filledSize\\\": 1,\\n \\\"filledValue\\\": \\\"5.511\\\",\\n \\\"status\\\": \\\"done\\\",\\n \\\"reduceOnly\\\": false\\n },\\n {\\n \\\"id\\\": \\\"236317213710184449\\\",\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"type\\\": \\\"market\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"price\\\": \\\"0\\\",\\n \\\"size\\\": 1,\\n \\\"value\\\": \\\"67.4309\\\",\\n \\\"dealValue\\\": \\\"67.4309\\\",\\n \\\"dealSize\\\": 1,\\n \\\"stp\\\": \\\"\\\",\\n \\\"stop\\\": \\\"\\\",\\n \\\"stopPriceType\\\": \\\"\\\",\\n \\\"stopTriggered\\\": false,\\n \\\"stopPrice\\\": null,\\n \\\"timeInForce\\\": \\\"GTC\\\",\\n \\\"postOnly\\\": false,\\n \\\"hidden\\\": false,\\n \\\"iceberg\\\": false,\\n \\\"leverage\\\": \\\"3\\\",\\n \\\"forceHold\\\": false,\\n \\\"closeOrder\\\": false,\\n \\\"visibleSize\\\": 0,\\n \\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\",\\n \\\"remark\\\": null,\\n \\\"tags\\\": \\\"\\\",\\n \\\"isActive\\\": false,\\n \\\"cancelExist\\\": false,\\n \\\"createdAt\\\": 1729155616310,\\n \\\"updatedAt\\\": 1729155616324,\\n \\\"endAt\\\": 1729155616324,\\n \\\"orderTime\\\": 1729155616310180400,\\n \\\"settleCurrency\\\": \\\"USDT\\\",\\n \\\"marginMode\\\": \\\"ISOLATED\\\",\\n \\\"avgDealPrice\\\": \\\"67430.9\\\",\\n \\\"filledSize\\\": 1,\\n \\\"filledValue\\\": \\\"67.4309\\\",\\n \\\"status\\\": \\\"done\\\",\\n \\\"reduceOnly\\\": false\\n },\\n {\\n \\\"id\\\": \\\"236317094436728832\\\",\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"type\\\": \\\"market\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"price\\\": \\\"0\\\",\\n \\\"size\\\": 1,\\n \\\"value\\\": \\\"67.445\\\",\\n \\\"dealValue\\\": \\\"67.445\\\",\\n \\\"dealSize\\\": 1,\\n \\\"stp\\\": \\\"\\\",\\n \\\"stop\\\": \\\"\\\",\\n \\\"stopPriceType\\\": \\\"\\\",\\n \\\"stopTriggered\\\": false,\\n \\\"stopPrice\\\": null,\\n \\\"timeInForce\\\": \\\"GTC\\\",\\n \\\"postOnly\\\": false,\\n \\\"hidden\\\": false,\\n \\\"iceberg\\\": false,\\n \\\"leverage\\\": \\\"3\\\",\\n \\\"forceHold\\\": false,\\n \\\"closeOrder\\\": false,\\n \\\"visibleSize\\\": 0,\\n \\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\",\\n \\\"remark\\\": null,\\n \\\"tags\\\": \\\"\\\",\\n \\\"isActive\\\": false,\\n \\\"cancelExist\\\": false,\\n \\\"createdAt\\\": 1729155587873,\\n \\\"updatedAt\\\": 1729155587946,\\n \\\"endAt\\\": 1729155587946,\\n \\\"orderTime\\\": 1729155587873332000,\\n \\\"settleCurrency\\\": \\\"USDT\\\",\\n \\\"marginMode\\\": \\\"ISOLATED\\\",\\n \\\"avgDealPrice\\\": \\\"67445.0\\\",\\n \\\"filledSize\\\": 1,\\n \\\"filledValue\\\": \\\"67.445\\\",\\n \\\"status\\\": \\\"done\\\",\\n \\\"reduceOnly\\\": false\\n }\\n ]\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDTM\\\"}" + "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDTM\\\"}", + "operationId": "013" } }, "/api/v1/openOrderStatistics": { @@ -3604,7 +3619,8 @@ "x-sdk-method-description": "You can query this endpoint to get the the total number and value of the all your active orders.", "x-api-rate-limit": 10, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"openOrderBuySize\\\": 1,\\n \\\"openOrderSellSize\\\": 0,\\n \\\"openOrderBuyCost\\\": \\\"0.0001\\\",\\n \\\"openOrderSellCost\\\": \\\"0\\\",\\n \\\"settleCurrency\\\": \\\"USDT\\\"\\n }\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDTM\\\"}" + "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDTM\\\"}", + "operationId": "015" } }, "/api/v1/recentFills": { @@ -3915,7 +3931,8 @@ "x-sdk-method-description": "Get a list of recent 1000 fills in the last 24 hours. If you need to get your recent traded order history with low latency, you may query this endpoint.", "x-api-rate-limit": 3, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": [\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"tradeId\\\": \\\"1784277229880\\\",\\n \\\"orderId\\\": \\\"236317213710184449\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"liquidity\\\": \\\"taker\\\",\\n \\\"forceTaker\\\": false,\\n \\\"price\\\": \\\"67430.9\\\",\\n \\\"size\\\": 1,\\n \\\"value\\\": \\\"67.4309\\\",\\n \\\"openFeePay\\\": \\\"0.04045854\\\",\\n \\\"closeFeePay\\\": \\\"0\\\",\\n \\\"stop\\\": \\\"\\\",\\n \\\"feeRate\\\": \\\"0.00060\\\",\\n \\\"fixFee\\\": \\\"0\\\",\\n \\\"feeCurrency\\\": \\\"USDT\\\",\\n \\\"marginMode\\\": \\\"ISOLATED\\\",\\n \\\"fee\\\": \\\"0.04045854\\\",\\n \\\"settleCurrency\\\": \\\"USDT\\\",\\n \\\"orderType\\\": \\\"market\\\",\\n \\\"displayType\\\": \\\"market\\\",\\n \\\"tradeType\\\": \\\"trade\\\",\\n \\\"subTradeType\\\": null,\\n \\\"tradeTime\\\": 1729155616320000000,\\n \\\"createdAt\\\": 1729155616493\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"tradeId\\\": \\\"1784277132002\\\",\\n \\\"orderId\\\": \\\"236317094436728832\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"liquidity\\\": \\\"taker\\\",\\n \\\"forceTaker\\\": false,\\n \\\"price\\\": \\\"67445\\\",\\n \\\"size\\\": 1,\\n \\\"value\\\": \\\"67.445\\\",\\n \\\"openFeePay\\\": \\\"0\\\",\\n \\\"closeFeePay\\\": \\\"0.040467\\\",\\n \\\"stop\\\": \\\"\\\",\\n \\\"feeRate\\\": \\\"0.00060\\\",\\n \\\"fixFee\\\": \\\"0\\\",\\n \\\"feeCurrency\\\": \\\"USDT\\\",\\n \\\"marginMode\\\": \\\"ISOLATED\\\",\\n \\\"fee\\\": \\\"0.040467\\\",\\n \\\"settleCurrency\\\": \\\"USDT\\\",\\n \\\"orderType\\\": \\\"market\\\",\\n \\\"displayType\\\": \\\"market\\\",\\n \\\"tradeType\\\": \\\"trade\\\",\\n \\\"subTradeType\\\": null,\\n \\\"tradeTime\\\": 1729155587944000000,\\n \\\"createdAt\\\": 1729155588104\\n }\\n ]\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDTM\\\"}" + "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDTM\\\"}", + "operationId": "016" } }, "/api/v1/fills": { @@ -4371,7 +4388,8 @@ "x-sdk-method-description": "Get a list of recent fills. If you need to get your recent trade history with low latency, please query endpoint Get List of Orders Completed in 24h. The requested data is not real-time.", "x-api-rate-limit": 5, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"currentPage\\\": 1,\\n \\\"pageSize\\\": 50,\\n \\\"totalNum\\\": 2,\\n \\\"totalPage\\\": 1,\\n \\\"items\\\": [\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"tradeId\\\": \\\"1784277229880\\\",\\n \\\"orderId\\\": \\\"236317213710184449\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"liquidity\\\": \\\"taker\\\",\\n \\\"forceTaker\\\": false,\\n \\\"price\\\": \\\"67430.9\\\",\\n \\\"size\\\": 1,\\n \\\"value\\\": \\\"67.4309\\\",\\n \\\"openFeePay\\\": \\\"0.04045854\\\",\\n \\\"closeFeePay\\\": \\\"0\\\",\\n \\\"stop\\\": \\\"\\\",\\n \\\"feeRate\\\": \\\"0.00060\\\",\\n \\\"fixFee\\\": \\\"0\\\",\\n \\\"feeCurrency\\\": \\\"USDT\\\",\\n \\\"marginMode\\\": \\\"ISOLATED\\\",\\n \\\"settleCurrency\\\": \\\"USDT\\\",\\n \\\"fee\\\": \\\"0.04045854\\\",\\n \\\"orderType\\\": \\\"market\\\",\\n \\\"displayType\\\": \\\"market\\\",\\n \\\"tradeType\\\": \\\"trade\\\",\\n \\\"subTradeType\\\": null,\\n \\\"tradeTime\\\": 1729155616320000000,\\n \\\"createdAt\\\": 1729155616493\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"tradeId\\\": \\\"1784277132002\\\",\\n \\\"orderId\\\": \\\"236317094436728832\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"liquidity\\\": \\\"taker\\\",\\n \\\"forceTaker\\\": false,\\n \\\"price\\\": \\\"67445\\\",\\n \\\"size\\\": 1,\\n \\\"value\\\": \\\"67.445\\\",\\n \\\"openFeePay\\\": \\\"0\\\",\\n \\\"closeFeePay\\\": \\\"0.040467\\\",\\n \\\"stop\\\": \\\"\\\",\\n \\\"feeRate\\\": \\\"0.00060\\\",\\n \\\"fixFee\\\": \\\"0\\\",\\n \\\"feeCurrency\\\": \\\"USDT\\\",\\n \\\"marginMode\\\": \\\"ISOLATED\\\",\\n \\\"settleCurrency\\\": \\\"USDT\\\",\\n \\\"fee\\\": \\\"0.040467\\\",\\n \\\"orderType\\\": \\\"market\\\",\\n \\\"displayType\\\": \\\"market\\\",\\n \\\"tradeType\\\": \\\"trade\\\",\\n \\\"subTradeType\\\": null,\\n \\\"tradeTime\\\": 1729155587944000000,\\n \\\"createdAt\\\": 1729155588104\\n }\\n ]\\n }\\n}", - "x-request-example": "{\\\"orderId\\\": \\\"236655147005071361\\\", \\\"symbol\\\": \\\"example_string_default_value\\\", \\\"side\\\": \\\"buy\\\", \\\"type\\\": \\\"limit\\\", \\\"tradeTypes\\\": \\\"trade\\\", \\\"startAt\\\": 123456, \\\"endAt\\\": 123456, \\\"currentPage\\\": 1, \\\"pageSize\\\": 50}" + "x-request-example": "{\\\"orderId\\\": \\\"236655147005071361\\\", \\\"symbol\\\": \\\"example_string_default_value\\\", \\\"side\\\": \\\"buy\\\", \\\"type\\\": \\\"limit\\\", \\\"tradeTypes\\\": \\\"trade\\\", \\\"startAt\\\": 123456, \\\"endAt\\\": 123456, \\\"currentPage\\\": 1, \\\"pageSize\\\": 50}", + "operationId": "017" } } }, diff --git a/spec/rest/api/openapi-futures-positions.json b/spec/rest/api/openapi-futures-positions.json index 10c76653..8499988a 100644 --- a/spec/rest/api/openapi-futures-positions.json +++ b/spec/rest/api/openapi-futures-positions.json @@ -90,7 +90,8 @@ "x-sdk-method-description": "This interface can query the margin mode of the current symbol.", "x-api-rate-limit": 2, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"marginMode\\\": \\\"ISOLATED\\\"\\n }\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDTM\\\"}" + "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDTM\\\"}", + "operationId": "001" } }, "/api/v2/position/changeMarginMode": { @@ -211,7 +212,8 @@ } }, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"marginMode\\\": \\\"ISOLATED\\\"\\n }\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDTM\\\", \\\"marginMode\\\": \\\"ISOLATED\\\"}" + "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDTM\\\", \\\"marginMode\\\": \\\"ISOLATED\\\"}", + "operationId": "002" } }, "/api/v2/getMaxOpenSize": { @@ -309,7 +311,8 @@ "x-sdk-method-description": "Get Maximum Open Position Size.", "x-api-rate-limit": 2, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"maxBuyOpenSize\\\": 0,\\n \\\"maxSellOpenSize\\\": 0\\n }\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDTM\\\", \\\"price\\\": \\\"example_string_default_value\\\", \\\"leverage\\\": 123456}" + "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDTM\\\", \\\"price\\\": \\\"example_string_default_value\\\", \\\"leverage\\\": 123456}", + "operationId": "003" } }, "/api/v1/position": { @@ -609,7 +612,8 @@ "x-sdk-method-description": "Get the position details of a specified position.", "x-api-rate-limit": 2, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"id\\\": \\\"500000000000988255\\\",\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"autoDeposit\\\": false,\\n \\\"crossMode\\\": false,\\n \\\"maintMarginReq\\\": 0.005,\\n \\\"riskLimit\\\": 500000,\\n \\\"realLeverage\\\": 2.88,\\n \\\"delevPercentage\\\": 0.18,\\n \\\"openingTimestamp\\\": 1729155616322,\\n \\\"currentTimestamp\\\": 1729482542135,\\n \\\"currentQty\\\": 1,\\n \\\"currentCost\\\": 67.4309,\\n \\\"currentComm\\\": 0.01925174,\\n \\\"unrealisedCost\\\": 67.4309,\\n \\\"realisedGrossCost\\\": 0.0,\\n \\\"realisedCost\\\": 0.01925174,\\n \\\"isOpen\\\": true,\\n \\\"markPrice\\\": 68900.7,\\n \\\"markValue\\\": 68.9007,\\n \\\"posCost\\\": 67.4309,\\n \\\"posCross\\\": 0.01645214,\\n \\\"posCrossMargin\\\": 0,\\n \\\"posInit\\\": 22.4769666644,\\n \\\"posComm\\\": 0.0539546299,\\n \\\"posCommCommon\\\": 0.0539447199,\\n \\\"posLoss\\\": 0.03766885,\\n \\\"posMargin\\\": 22.5097045843,\\n \\\"posFunding\\\": -0.0212068,\\n \\\"posMaint\\\": 0.3931320569,\\n \\\"maintMargin\\\": 23.9795045843,\\n \\\"realisedGrossPnl\\\": 0.0,\\n \\\"realisedPnl\\\": -0.06166534,\\n \\\"unrealisedPnl\\\": 1.4698,\\n \\\"unrealisedPnlPcnt\\\": 0.0218,\\n \\\"unrealisedRoePcnt\\\": 0.0654,\\n \\\"avgEntryPrice\\\": 67430.9,\\n \\\"liquidationPrice\\\": 45314.33,\\n \\\"bankruptPrice\\\": 44975.16,\\n \\\"settleCurrency\\\": \\\"USDT\\\",\\n \\\"maintainMargin\\\": 0.005,\\n \\\"riskLimitLevel\\\": 2,\\n \\\"marginMode\\\": \\\"ISOLATED\\\",\\n \\\"positionSide\\\": \\\"BOTH\\\",\\n \\\"leverage\\\": 2.88\\n }\\n}\\n", - "x-request-example": "{\\\"symbol\\\": \\\"example_string_default_value\\\"}" + "x-request-example": "{\\\"symbol\\\": \\\"example_string_default_value\\\"}", + "operationId": "004" } }, "/api/v1/positions": { @@ -917,7 +921,8 @@ "x-sdk-method-description": "Get the position details of a specified position.", "x-api-rate-limit": 2, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": [\\n {\\n \\\"id\\\": \\\"500000000001046430\\\",\\n \\\"symbol\\\": \\\"ETHUSDM\\\",\\n \\\"crossMode\\\": true,\\n \\\"delevPercentage\\\": 0.71,\\n \\\"openingTimestamp\\\": 1730635780702,\\n \\\"currentTimestamp\\\": 1730636040926,\\n \\\"currentQty\\\": 1,\\n \\\"currentCost\\\": -4.069805E-4,\\n \\\"currentComm\\\": 2.441E-7,\\n \\\"unrealisedCost\\\": -4.069805E-4,\\n \\\"realisedGrossCost\\\": 0.0,\\n \\\"realisedCost\\\": 2.441E-7,\\n \\\"isOpen\\\": true,\\n \\\"markPrice\\\": 2454.12,\\n \\\"markValue\\\": -4.07478E-4,\\n \\\"posCost\\\": -4.069805E-4,\\n \\\"posInit\\\": 4.06981E-5,\\n \\\"posMargin\\\": 4.07478E-5,\\n \\\"realisedGrossPnl\\\": 0.0,\\n \\\"realisedPnl\\\": -2.441E-7,\\n \\\"unrealisedPnl\\\": -4.975E-7,\\n \\\"unrealisedPnlPcnt\\\": -0.0012,\\n \\\"unrealisedRoePcnt\\\": -0.0122,\\n \\\"avgEntryPrice\\\": 2457.12,\\n \\\"liquidationPrice\\\": 1429.96,\\n \\\"bankruptPrice\\\": 1414.96,\\n \\\"settleCurrency\\\": \\\"ETH\\\",\\n \\\"isInverse\\\": true,\\n \\\"marginMode\\\": \\\"CROSS\\\",\\n \\\"positionSide\\\": \\\"BOTH\\\",\\n \\\"leverage\\\": 10\\n },\\n {\\n \\\"id\\\": \\\"500000000000988255\\\",\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"autoDeposit\\\": true,\\n \\\"crossMode\\\": false,\\n \\\"maintMarginReq\\\": 0.005,\\n \\\"riskLimit\\\": 500000,\\n \\\"realLeverage\\\": 2.97,\\n \\\"delevPercentage\\\": 0.5,\\n \\\"openingTimestamp\\\": 1729155616322,\\n \\\"currentTimestamp\\\": 1730636040926,\\n \\\"currentQty\\\": 1,\\n \\\"currentCost\\\": 67.4309,\\n \\\"currentComm\\\": -0.15936162,\\n \\\"unrealisedCost\\\": 67.4309,\\n \\\"realisedGrossCost\\\": 0.0,\\n \\\"realisedCost\\\": -0.15936162,\\n \\\"isOpen\\\": true,\\n \\\"markPrice\\\": 68323.06,\\n \\\"markValue\\\": 68.32306,\\n \\\"posCost\\\": 67.4309,\\n \\\"posCross\\\": 0.06225152,\\n \\\"posCrossMargin\\\": 0,\\n \\\"posInit\\\": 22.2769666644,\\n \\\"posComm\\\": 0.0539821899,\\n \\\"posCommCommon\\\": 0.0539447199,\\n \\\"posLoss\\\": 0.26210915,\\n \\\"posMargin\\\": 22.1310912243,\\n \\\"posFunding\\\": -0.19982016,\\n \\\"posMaint\\\": 0.4046228699,\\n \\\"maintMargin\\\": 23.0232512243,\\n \\\"realisedGrossPnl\\\": 0.0,\\n \\\"realisedPnl\\\": -0.2402787,\\n \\\"unrealisedPnl\\\": 0.89216,\\n \\\"unrealisedPnlPcnt\\\": 0.0132,\\n \\\"unrealisedRoePcnt\\\": 0.04,\\n \\\"avgEntryPrice\\\": 67430.9,\\n \\\"liquidationPrice\\\": 45704.44,\\n \\\"bankruptPrice\\\": 45353.8,\\n \\\"settleCurrency\\\": \\\"USDT\\\",\\n \\\"isInverse\\\": false,\\n \\\"maintainMargin\\\": 0.005,\\n \\\"marginMode\\\": \\\"ISOLATED\\\",\\n \\\"positionSide\\\": \\\"BOTH\\\",\\n \\\"leverage\\\": 2.97\\n }\\n ]\\n}", - "x-request-example": "{\\\"currency\\\": \\\"USDT\\\"}" + "x-request-example": "{\\\"currency\\\": \\\"USDT\\\"}", + "operationId": "005" } }, "/api/v1/history-positions": { @@ -1147,7 +1152,8 @@ "x-sdk-method-description": "This interface can query position history information records.", "x-api-rate-limit": 2, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"currentPage\\\": 1,\\n \\\"pageSize\\\": 10,\\n \\\"totalNum\\\": 3,\\n \\\"totalPage\\\": 1,\\n \\\"items\\\": [\\n {\\n \\\"closeId\\\": \\\"500000000027312193\\\",\\n \\\"userId\\\": \\\"633559791e1cbc0001f319bc\\\",\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"settleCurrency\\\": \\\"USDT\\\",\\n \\\"leverage\\\": \\\"0.0\\\",\\n \\\"type\\\": \\\"CLOSE_SHORT\\\",\\n \\\"pnl\\\": \\\"-3.79237944\\\",\\n \\\"realisedGrossCost\\\": \\\"3.795\\\",\\n \\\"withdrawPnl\\\": \\\"0.0\\\",\\n \\\"tradeFee\\\": \\\"0.078657\\\",\\n \\\"fundingFee\\\": \\\"0.08127756\\\",\\n \\\"openTime\\\": 1727073653603,\\n \\\"closeTime\\\": 1729155587945,\\n \\\"openPrice\\\": \\\"63650.0\\\",\\n \\\"closePrice\\\": \\\"67445.0\\\",\\n \\\"marginMode\\\": \\\"ISOLATED\\\"\\n },\\n {\\n \\\"closeId\\\": \\\"500000000026809668\\\",\\n \\\"userId\\\": \\\"633559791e1cbc0001f319bc\\\",\\n \\\"symbol\\\": \\\"SUIUSDTM\\\",\\n \\\"settleCurrency\\\": \\\"USDT\\\",\\n \\\"leverage\\\": \\\"0.0\\\",\\n \\\"type\\\": \\\"LIQUID_SHORT\\\",\\n \\\"pnl\\\": \\\"-1.10919296\\\",\\n \\\"realisedGrossCost\\\": \\\"1.11297635\\\",\\n \\\"withdrawPnl\\\": \\\"0.0\\\",\\n \\\"tradeFee\\\": \\\"0.00200295\\\",\\n \\\"fundingFee\\\": \\\"0.00578634\\\",\\n \\\"openTime\\\": 1726473389296,\\n \\\"closeTime\\\": 1728738683541,\\n \\\"openPrice\\\": \\\"1.1072\\\",\\n \\\"closePrice\\\": \\\"2.22017635\\\",\\n \\\"marginMode\\\": \\\"ISOLATED\\\"\\n },\\n {\\n \\\"closeId\\\": \\\"500000000026819355\\\",\\n \\\"userId\\\": \\\"633559791e1cbc0001f319bc\\\",\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"settleCurrency\\\": \\\"USDT\\\",\\n \\\"leverage\\\": \\\"0.0\\\",\\n \\\"type\\\": \\\"LIQUID_SHORT\\\",\\n \\\"pnl\\\": \\\"-5.941896296\\\",\\n \\\"realisedGrossCost\\\": \\\"5.86937042\\\",\\n \\\"withdrawPnl\\\": \\\"0.0\\\",\\n \\\"tradeFee\\\": \\\"0.074020096\\\",\\n \\\"fundingFee\\\": \\\"0.00149422\\\",\\n \\\"openTime\\\": 1726490775358,\\n \\\"closeTime\\\": 1727061049859,\\n \\\"openPrice\\\": \\\"58679.6\\\",\\n \\\"closePrice\\\": \\\"64548.97042\\\",\\n \\\"marginMode\\\": \\\"ISOLATED\\\"\\n }\\n ]\\n }\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"example_string_default_value\\\", \\\"from\\\": 123456, \\\"to\\\": 123456, \\\"limit\\\": 10, \\\"pageId\\\": 1}" + "x-request-example": "{\\\"symbol\\\": \\\"example_string_default_value\\\", \\\"from\\\": 123456, \\\"to\\\": 123456, \\\"limit\\\": 10, \\\"pageId\\\": 1}", + "operationId": "006" } }, "/api/v1/margin/maxWithdrawMargin": { @@ -1204,7 +1210,8 @@ "x-sdk-method-description": "This interface can query the maximum amount of margin that the current position supports withdrawal.", "x-api-rate-limit": 10, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": \\\"21.1135719252\\\"\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"example_string_default_value\\\"}" + "x-request-example": "{\\\"symbol\\\": \\\"example_string_default_value\\\"}", + "operationId": "007" } }, "/api/v2/getCrossUserLeverage": { @@ -1274,7 +1281,8 @@ "x-sdk-method-description": "This interface can query the current symbol’s cross-margin leverage multiple.", "x-api-rate-limit": 2, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"leverage\\\": \\\"3\\\"\\n }\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDTM\\\"}" + "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDTM\\\"}", + "operationId": "008" } }, "/api/v2/changeCrossUserLeverage": { @@ -1356,7 +1364,8 @@ } }, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"leverage\\\": \\\"3\\\"\\n }\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDTM\\\", \\\"leverage\\\": \\\"10\\\"}" + "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDTM\\\", \\\"leverage\\\": \\\"10\\\"}", + "operationId": "009" } }, "/api/v1/position/margin/deposit-margin": { @@ -1622,7 +1631,8 @@ } }, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"id\\\": \\\"6200c9b83aecfb000152ddcd\\\",\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"autoDeposit\\\": false,\\n \\\"maintMarginReq\\\": 0.005,\\n \\\"riskLimit\\\": 500000,\\n \\\"realLeverage\\\": 18.72,\\n \\\"crossMode\\\": false,\\n \\\"delevPercentage\\\": 0.66,\\n \\\"openingTimestamp\\\": 1646287090131,\\n \\\"currentTimestamp\\\": 1646295055021,\\n \\\"currentQty\\\": 1,\\n \\\"currentCost\\\": 43.388,\\n \\\"currentComm\\\": 0.0260328,\\n \\\"unrealisedCost\\\": 43.388,\\n \\\"realisedGrossCost\\\": 0,\\n \\\"realisedCost\\\": 0.0260328,\\n \\\"isOpen\\\": true,\\n \\\"markPrice\\\": 43536.65,\\n \\\"markValue\\\": 43.53665,\\n \\\"posCost\\\": 43.388,\\n \\\"posCross\\\": 0.000024985,\\n \\\"posInit\\\": 2.1694,\\n \\\"posComm\\\": 0.02733446,\\n \\\"posLoss\\\": 0,\\n \\\"posMargin\\\": 2.19675944,\\n \\\"posMaint\\\": 0.24861326,\\n \\\"maintMargin\\\": 2.34540944,\\n \\\"realisedGrossPnl\\\": 0,\\n \\\"realisedPnl\\\": -0.0260328,\\n \\\"unrealisedPnl\\\": 0.14865,\\n \\\"unrealisedPnlPcnt\\\": 0.0034,\\n \\\"unrealisedRoePcnt\\\": 0.0685,\\n \\\"avgEntryPrice\\\": 43388,\\n \\\"liquidationPrice\\\": 41440,\\n \\\"bankruptPrice\\\": 41218,\\n \\\"userId\\\": 1234321123,\\n \\\"settleCurrency\\\": \\\"USDT\\\"\\n }\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"string\\\", \\\"margin\\\": 0, \\\"bizNo\\\": \\\"string\\\"}" + "x-request-example": "{\\\"symbol\\\": \\\"string\\\", \\\"margin\\\": 0, \\\"bizNo\\\": \\\"string\\\"}", + "operationId": "010" } }, "/api/v1/margin/withdrawMargin": { @@ -1693,7 +1703,8 @@ } }, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": \\\"0.1\\\"\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDTM\\\", \\\"withdrawAmount\\\": \\\"0.0000001\\\"}" + "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDTM\\\", \\\"withdrawAmount\\\": \\\"0.0000001\\\"}", + "operationId": "011" } }, "/api/v1/contracts/risk-limit/{symbol}": { @@ -1791,7 +1802,8 @@ "x-sdk-method-description": "This interface can be used to obtain information about risk limit level of a specific contract(Only valid for isolated Margin).", "x-api-rate-limit": 5, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": [\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"level\\\": 1,\\n \\\"maxRiskLimit\\\": 100000,\\n \\\"minRiskLimit\\\": 0,\\n \\\"maxLeverage\\\": 125,\\n \\\"initialMargin\\\": 0.008,\\n \\\"maintainMargin\\\": 0.004\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"level\\\": 2,\\n \\\"maxRiskLimit\\\": 500000,\\n \\\"minRiskLimit\\\": 100000,\\n \\\"maxLeverage\\\": 100,\\n \\\"initialMargin\\\": 0.01,\\n \\\"maintainMargin\\\": 0.005\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"level\\\": 3,\\n \\\"maxRiskLimit\\\": 1000000,\\n \\\"minRiskLimit\\\": 500000,\\n \\\"maxLeverage\\\": 75,\\n \\\"initialMargin\\\": 0.014,\\n \\\"maintainMargin\\\": 0.007\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"level\\\": 4,\\n \\\"maxRiskLimit\\\": 2000000,\\n \\\"minRiskLimit\\\": 1000000,\\n \\\"maxLeverage\\\": 50,\\n \\\"initialMargin\\\": 0.02,\\n \\\"maintainMargin\\\": 0.01\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"level\\\": 5,\\n \\\"maxRiskLimit\\\": 3000000,\\n \\\"minRiskLimit\\\": 2000000,\\n \\\"maxLeverage\\\": 30,\\n \\\"initialMargin\\\": 0.034,\\n \\\"maintainMargin\\\": 0.017\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"level\\\": 6,\\n \\\"maxRiskLimit\\\": 5000000,\\n \\\"minRiskLimit\\\": 3000000,\\n \\\"maxLeverage\\\": 20,\\n \\\"initialMargin\\\": 0.05,\\n \\\"maintainMargin\\\": 0.025\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"level\\\": 7,\\n \\\"maxRiskLimit\\\": 8000000,\\n \\\"minRiskLimit\\\": 5000000,\\n \\\"maxLeverage\\\": 10,\\n \\\"initialMargin\\\": 0.1,\\n \\\"maintainMargin\\\": 0.05\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"level\\\": 8,\\n \\\"maxRiskLimit\\\": 12000000,\\n \\\"minRiskLimit\\\": 8000000,\\n \\\"maxLeverage\\\": 5,\\n \\\"initialMargin\\\": 0.2,\\n \\\"maintainMargin\\\": 0.1\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"level\\\": 9,\\n \\\"maxRiskLimit\\\": 20000000,\\n \\\"minRiskLimit\\\": 12000000,\\n \\\"maxLeverage\\\": 4,\\n \\\"initialMargin\\\": 0.25,\\n \\\"maintainMargin\\\": 0.125\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"level\\\": 10,\\n \\\"maxRiskLimit\\\": 30000000,\\n \\\"minRiskLimit\\\": 20000000,\\n \\\"maxLeverage\\\": 3,\\n \\\"initialMargin\\\": 0.334,\\n \\\"maintainMargin\\\": 0.167\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"level\\\": 11,\\n \\\"maxRiskLimit\\\": 40000000,\\n \\\"minRiskLimit\\\": 30000000,\\n \\\"maxLeverage\\\": 2,\\n \\\"initialMargin\\\": 0.5,\\n \\\"maintainMargin\\\": 0.25\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"level\\\": 12,\\n \\\"maxRiskLimit\\\": 50000000,\\n \\\"minRiskLimit\\\": 40000000,\\n \\\"maxLeverage\\\": 1,\\n \\\"initialMargin\\\": 1.0,\\n \\\"maintainMargin\\\": 0.5\\n }\\n ]\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDTM\\\"}" + "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDTM\\\"}", + "operationId": "012" } }, "/api/v1/position/risk-limit-level/change": { @@ -1862,7 +1874,8 @@ } }, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": true\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDTM\\\", \\\"level\\\": 2}" + "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDTM\\\", \\\"level\\\": 2}", + "operationId": "013" } }, "/api/v1/position/margin/auto-deposit-status": { @@ -1936,7 +1949,8 @@ } }, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": true\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDTM\\\", \\\"status\\\": true}" + "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDTM\\\", \\\"status\\\": true}", + "operationId": "014" } } }, diff --git a/spec/rest/api/openapi-margin-credit.json b/spec/rest/api/openapi-margin-credit.json index 7693db37..8c2259fe 100644 --- a/spec/rest/api/openapi-margin-credit.json +++ b/spec/rest/api/openapi-margin-credit.json @@ -115,7 +115,8 @@ "x-sdk-method-description": "This API endpoint is used to get the information about the currencies available for lending.", "x-api-rate-limit": 10, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": [\\n {\\n \\\"currency\\\": \\\"BTC\\\",\\n \\\"purchaseEnable\\\": true,\\n \\\"redeemEnable\\\": true,\\n \\\"increment\\\": \\\"0.00000001\\\",\\n \\\"minPurchaseSize\\\": \\\"0.001\\\",\\n \\\"maxPurchaseSize\\\": \\\"40\\\",\\n \\\"interestIncrement\\\": \\\"0.0001\\\",\\n \\\"minInterestRate\\\": \\\"0.005\\\",\\n \\\"marketInterestRate\\\": \\\"0.005\\\",\\n \\\"maxInterestRate\\\": \\\"0.32\\\",\\n \\\"autoPurchaseEnable\\\": false\\n }\\n ]\\n}", - "x-request-example": "{\\\"currency\\\": \\\"BTC\\\"}" + "x-request-example": "{\\\"currency\\\": \\\"BTC\\\"}", + "operationId": "001" } }, "/api/v3/project/marketInterestRate": { @@ -193,7 +194,8 @@ "x-sdk-method-description": "This API endpoint is used to get the interest rates of the margin lending market over the past 7 days.", "x-api-rate-limit": 5, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": [\\n {\\n \\\"time\\\": \\\"202410170000\\\",\\n \\\"marketInterestRate\\\": \\\"0.005\\\"\\n },\\n {\\n \\\"time\\\": \\\"202410170100\\\",\\n \\\"marketInterestRate\\\": \\\"0.005\\\"\\n }\\n ]\\n}", - "x-request-example": "{\\\"currency\\\": \\\"BTC\\\"}" + "x-request-example": "{\\\"currency\\\": \\\"BTC\\\"}", + "operationId": "002" } }, "/api/v3/purchase": { @@ -282,7 +284,8 @@ } }, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"orderNo\\\": \\\"671bafa804c26d000773c533\\\"\\n }\\n}", - "x-request-example": "{\\\"currency\\\": \\\"BTC\\\", \\\"size\\\": \\\"0.001\\\", \\\"interestRate\\\": \\\"0.1\\\"}" + "x-request-example": "{\\\"currency\\\": \\\"BTC\\\", \\\"size\\\": \\\"0.001\\\", \\\"interestRate\\\": \\\"0.1\\\"}", + "operationId": "003" } }, "/api/v3/lend/purchase/update": { @@ -362,7 +365,8 @@ } }, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": null\\n}", - "x-request-example": "{\\\"currency\\\": \\\"BTC\\\", \\\"purchaseOrderNo\\\": \\\"671bafa804c26d000773c533\\\", \\\"interestRate\\\": \\\"0.09\\\"}" + "x-request-example": "{\\\"currency\\\": \\\"BTC\\\", \\\"purchaseOrderNo\\\": \\\"671bafa804c26d000773c533\\\", \\\"interestRate\\\": \\\"0.09\\\"}", + "operationId": "004" } }, "/api/v3/purchase/orders": { @@ -576,7 +580,8 @@ "x-sdk-method-description": "This API endpoint provides pagination query for the purchase orders.", "x-api-rate-limit": 10, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"currentPage\\\": 1,\\n \\\"pageSize\\\": 10,\\n \\\"totalNum\\\": 1,\\n \\\"totalPage\\\": 1,\\n \\\"items\\\": [\\n {\\n \\\"currency\\\": \\\"BTC\\\",\\n \\\"purchaseOrderNo\\\": \\\"671bb15a3b3f930007880bae\\\",\\n \\\"purchaseSize\\\": \\\"0.001\\\",\\n \\\"matchSize\\\": \\\"0\\\",\\n \\\"interestRate\\\": \\\"0.1\\\",\\n \\\"incomeSize\\\": \\\"0\\\",\\n \\\"applyTime\\\": 1729868122172,\\n \\\"status\\\": \\\"PENDING\\\"\\n }\\n ]\\n }\\n}", - "x-request-example": "{\\\"currency\\\": \\\"BTC\\\", \\\"status\\\": \\\"DONE\\\", \\\"purchaseOrderNo\\\": \\\"example_string_default_value\\\", \\\"currentPage\\\": 1, \\\"pageSize\\\": 50}" + "x-request-example": "{\\\"currency\\\": \\\"BTC\\\", \\\"status\\\": \\\"DONE\\\", \\\"purchaseOrderNo\\\": \\\"example_string_default_value\\\", \\\"currentPage\\\": 1, \\\"pageSize\\\": 50}", + "operationId": "005" } }, "/api/v3/redeem": { @@ -665,7 +670,8 @@ } }, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"orderNo\\\": \\\"671bafa804c26d000773c533\\\"\\n }\\n}", - "x-request-example": "{\\\"currency\\\": \\\"BTC\\\", \\\"size\\\": \\\"0.001\\\", \\\"purchaseOrderNo\\\": \\\"671bafa804c26d000773c533\\\"}" + "x-request-example": "{\\\"currency\\\": \\\"BTC\\\", \\\"size\\\": \\\"0.001\\\", \\\"purchaseOrderNo\\\": \\\"671bafa804c26d000773c533\\\"}", + "operationId": "006" } }, "/api/v3/redeem/orders": { @@ -857,7 +863,8 @@ "x-sdk-method-description": "This API endpoint provides pagination query for the redeem orders.", "x-api-rate-limit": 10, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"currentPage\\\": 1,\\n \\\"pageSize\\\": 10,\\n \\\"totalNum\\\": 1,\\n \\\"totalPage\\\": 1,\\n \\\"items\\\": [\\n {\\n \\\"currency\\\": \\\"BTC\\\",\\n \\\"purchaseOrderNo\\\": \\\"671bafa804c26d000773c533\\\",\\n \\\"redeemOrderNo\\\": \\\"671bb01004c26d000773c55c\\\",\\n \\\"redeemSize\\\": \\\"0.001\\\",\\n \\\"receiptSize\\\": \\\"0.001\\\",\\n \\\"applyTime\\\": null,\\n \\\"status\\\": \\\"DONE\\\"\\n }\\n ]\\n }\\n}", - "x-request-example": "{\\\"currency\\\": \\\"BTC\\\", \\\"status\\\": \\\"DONE\\\", \\\"redeemOrderNo\\\": \\\"example_string_default_value\\\", \\\"currentPage\\\": 1, \\\"pageSize\\\": 50}" + "x-request-example": "{\\\"currency\\\": \\\"BTC\\\", \\\"status\\\": \\\"DONE\\\", \\\"redeemOrderNo\\\": \\\"example_string_default_value\\\", \\\"currentPage\\\": 1, \\\"pageSize\\\": 50}", + "operationId": "007" } } }, diff --git a/spec/rest/api/openapi-margin-debit.json b/spec/rest/api/openapi-margin-debit.json index e190d2bc..66b45048 100644 --- a/spec/rest/api/openapi-margin-debit.json +++ b/spec/rest/api/openapi-margin-debit.json @@ -133,7 +133,8 @@ } }, "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"orderNo\\\":\\\"67187162c0d6990007717b15\\\",\\\"actualSize\\\":\\\"10\\\"}}", - "x-request-example": "{\\\"currency\\\": \\\"USDT\\\", \\\"size\\\": 10, \\\"timeInForce\\\": \\\"FOK\\\", \\\"isIsolated\\\": false, \\\"isHf\\\": false}" + "x-request-example": "{\\\"currency\\\": \\\"USDT\\\", \\\"size\\\": 10, \\\"timeInForce\\\": \\\"FOK\\\", \\\"isIsolated\\\": false, \\\"isHf\\\": false}", + "operationId": "001" }, "get": { "summary": "Get Borrow History", @@ -370,7 +371,8 @@ "x-sdk-method-description": "This API endpoint is used to get the borrowing orders for cross and isolated margin accounts", "x-api-rate-limit": 15, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"timestamp\\\": 1729657580449,\\n \\\"currentPage\\\": 1,\\n \\\"pageSize\\\": 50,\\n \\\"totalNum\\\": 2,\\n \\\"totalPage\\\": 1,\\n \\\"items\\\": [\\n {\\n \\\"orderNo\\\": \\\"67187162c0d6990007717b15\\\",\\n \\\"symbol\\\": null,\\n \\\"currency\\\": \\\"USDT\\\",\\n \\\"size\\\": \\\"10\\\",\\n \\\"actualSize\\\": \\\"10\\\",\\n \\\"status\\\": \\\"SUCCESS\\\",\\n \\\"createdTime\\\": 1729655138000\\n },\\n {\\n \\\"orderNo\\\": \\\"67187155b088e70007149585\\\",\\n \\\"symbol\\\": null,\\n \\\"currency\\\": \\\"USDT\\\",\\n \\\"size\\\": \\\"0.1\\\",\\n \\\"actualSize\\\": \\\"0\\\",\\n \\\"status\\\": \\\"FAILED\\\",\\n \\\"createdTime\\\": 1729655125000\\n }\\n ]\\n }\\n}", - "x-request-example": "{\\\"currency\\\": \\\"BTC\\\", \\\"isIsolated\\\": true, \\\"symbol\\\": \\\"BTC-USDT\\\", \\\"orderNo\\\": \\\"example_string_default_value\\\", \\\"startTime\\\": 123456, \\\"endTime\\\": 123456, \\\"currentPage\\\": 1, \\\"pageSize\\\": 50}" + "x-request-example": "{\\\"currency\\\": \\\"BTC\\\", \\\"isIsolated\\\": true, \\\"symbol\\\": \\\"BTC-USDT\\\", \\\"orderNo\\\": \\\"example_string_default_value\\\", \\\"startTime\\\": 123456, \\\"endTime\\\": 123456, \\\"currentPage\\\": 1, \\\"pageSize\\\": 50}", + "operationId": "002" } }, "/api/v3/margin/repay": { @@ -483,7 +485,8 @@ } }, "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"timestamp\\\":1729655606816,\\\"orderNo\\\":\\\"671873361d5bd400075096ad\\\",\\\"actualSize\\\":\\\"10\\\"}}", - "x-request-example": "{\\\"currency\\\": \\\"USDT\\\", \\\"size\\\": 10}" + "x-request-example": "{\\\"currency\\\": \\\"USDT\\\", \\\"size\\\": 10}", + "operationId": "003" }, "get": { "summary": "Get Repay History", @@ -720,7 +723,8 @@ "x-sdk-method-description": "This API endpoint is used to get the borrowing orders for cross and isolated margin accounts", "x-api-rate-limit": 15, "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"timestamp\\\":1729663471891,\\\"currentPage\\\":1,\\\"pageSize\\\":50,\\\"totalNum\\\":1,\\\"totalPage\\\":1,\\\"items\\\":[{\\\"orderNo\\\":\\\"671873361d5bd400075096ad\\\",\\\"symbol\\\":null,\\\"currency\\\":\\\"USDT\\\",\\\"size\\\":\\\"10\\\",\\\"principal\\\":\\\"9.99986518\\\",\\\"interest\\\":\\\"0.00013482\\\",\\\"status\\\":\\\"SUCCESS\\\",\\\"createdTime\\\":1729655606000}]}}", - "x-request-example": "{\\\"currency\\\": \\\"BTC\\\", \\\"isIsolated\\\": true, \\\"symbol\\\": \\\"BTC-USDT\\\", \\\"orderNo\\\": \\\"example_string_default_value\\\", \\\"startTime\\\": 123456, \\\"endTime\\\": 123456, \\\"currentPage\\\": 1, \\\"pageSize\\\": 50}" + "x-request-example": "{\\\"currency\\\": \\\"BTC\\\", \\\"isIsolated\\\": true, \\\"symbol\\\": \\\"BTC-USDT\\\", \\\"orderNo\\\": \\\"example_string_default_value\\\", \\\"startTime\\\": 123456, \\\"endTime\\\": 123456, \\\"currentPage\\\": 1, \\\"pageSize\\\": 50}", + "operationId": "004" } }, "/api/v3/margin/interest": { @@ -908,7 +912,8 @@ "x-sdk-method-description": "Request via this endpoint to get the interest records of the cross/isolated margin lending.", "x-api-rate-limit": 20, "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"timestamp\\\":1729665170701,\\\"currentPage\\\":1,\\\"pageSize\\\":50,\\\"totalNum\\\":3,\\\"totalPage\\\":1,\\\"items\\\":[{\\\"currency\\\":\\\"USDT\\\",\\\"dayRatio\\\":\\\"0.000296\\\",\\\"interestAmount\\\":\\\"0.00000001\\\",\\\"createdTime\\\":1729663213375},{\\\"currency\\\":\\\"USDT\\\",\\\"dayRatio\\\":\\\"0.000296\\\",\\\"interestAmount\\\":\\\"0.00000001\\\",\\\"createdTime\\\":1729659618802},{\\\"currency\\\":\\\"USDT\\\",\\\"dayRatio\\\":\\\"0.000296\\\",\\\"interestAmount\\\":\\\"0.00000001\\\",\\\"createdTime\\\":1729656028077}]}}", - "x-request-example": "{\\\"currency\\\": \\\"BTC\\\", \\\"isIsolated\\\": true, \\\"symbol\\\": \\\"BTC-USDT\\\", \\\"startTime\\\": 123456, \\\"endTime\\\": 123456, \\\"currentPage\\\": 1, \\\"pageSize\\\": 50}" + "x-request-example": "{\\\"currency\\\": \\\"BTC\\\", \\\"isIsolated\\\": true, \\\"symbol\\\": \\\"BTC-USDT\\\", \\\"startTime\\\": 123456, \\\"endTime\\\": 123456, \\\"currentPage\\\": 1, \\\"pageSize\\\": 50}", + "operationId": "005" } }, "/api/v3/position/update-user-leverage": { @@ -987,7 +992,8 @@ } }, "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":null}", - "x-request-example": "{\\\"leverage\\\": \\\"5\\\"}" + "x-request-example": "{\\\"leverage\\\": \\\"5\\\"}", + "operationId": "006" } } }, diff --git a/spec/rest/api/openapi-margin-market.json b/spec/rest/api/openapi-margin-market.json index ce43f522..2488745a 100644 --- a/spec/rest/api/openapi-margin-market.json +++ b/spec/rest/api/openapi-margin-market.json @@ -165,7 +165,8 @@ "x-sdk-method-description": "This endpoint allows querying the configuration of cross margin symbol.", "x-api-rate-limit": 3, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"timestamp\\\": 1729665839353,\\n \\\"items\\\": [\\n {\\n \\\"symbol\\\": \\\"BTC-USDT\\\",\\n \\\"name\\\": \\\"BTC-USDT\\\",\\n \\\"enableTrading\\\": true,\\n \\\"market\\\": \\\"USDS\\\",\\n \\\"baseCurrency\\\": \\\"BTC\\\",\\n \\\"quoteCurrency\\\": \\\"USDT\\\",\\n \\\"baseIncrement\\\": \\\"0.00000001\\\",\\n \\\"baseMinSize\\\": \\\"0.00001\\\",\\n \\\"baseMaxSize\\\": \\\"10000000000\\\",\\n \\\"quoteIncrement\\\": \\\"0.000001\\\",\\n \\\"quoteMinSize\\\": \\\"0.1\\\",\\n \\\"quoteMaxSize\\\": \\\"99999999\\\",\\n \\\"priceIncrement\\\": \\\"0.1\\\",\\n \\\"feeCurrency\\\": \\\"USDT\\\",\\n \\\"priceLimitRate\\\": \\\"0.1\\\",\\n \\\"minFunds\\\": \\\"0.1\\\"\\n }\\n ]\\n }\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\"}" + "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\"}", + "operationId": "001" } }, "/api/v1/margin/config": { @@ -237,7 +238,8 @@ "x-sdk-method-name": "getMarginConfig", "x-sdk-method-description": "Request via this endpoint to get the configure info of the cross margin.", "x-api-rate-limit": 25, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"maxLeverage\\\": 5,\\n \\\"warningDebtRatio\\\": \\\"0.95\\\",\\n \\\"liqDebtRatio\\\": \\\"0.97\\\",\\n \\\"currencyList\\\": [\\n \\\"VRA\\\",\\n \\\"APT\\\",\\n \\\"IOTX\\\",\\n \\\"SHIB\\\",\\n \\\"KDA\\\",\\n \\\"BCHSV\\\",\\n \\\"NEAR\\\",\\n \\\"CLV\\\",\\n \\\"AUDIO\\\",\\n \\\"AIOZ\\\",\\n \\\"FLOW\\\",\\n \\\"WLD\\\",\\n \\\"COMP\\\",\\n \\\"MEME\\\",\\n \\\"SLP\\\",\\n \\\"STX\\\",\\n \\\"ZRO\\\",\\n \\\"QI\\\",\\n \\\"PYTH\\\",\\n \\\"RUNE\\\",\\n \\\"DGB\\\",\\n \\\"IOST\\\",\\n \\\"SUI\\\",\\n \\\"BCH\\\",\\n \\\"CAKE\\\",\\n \\\"DOT\\\",\\n \\\"OMG\\\",\\n \\\"POL\\\",\\n \\\"GMT\\\",\\n \\\"1INCH\\\",\\n \\\"RSR\\\",\\n \\\"NKN\\\",\\n \\\"BTC\\\",\\n \\\"AR\\\",\\n \\\"ARB\\\",\\n \\\"TON\\\",\\n \\\"LISTA\\\",\\n \\\"AVAX\\\",\\n \\\"SEI\\\",\\n \\\"FTM\\\",\\n \\\"ERN\\\",\\n \\\"BB\\\",\\n \\\"BTT\\\",\\n \\\"JTO\\\",\\n \\\"ONE\\\",\\n \\\"RLC\\\",\\n \\\"ANKR\\\",\\n \\\"SUSHI\\\",\\n \\\"CATI\\\",\\n \\\"ALGO\\\",\\n \\\"PEPE2\\\",\\n \\\"ATOM\\\",\\n \\\"LPT\\\",\\n \\\"BIGTIME\\\",\\n \\\"CFX\\\",\\n \\\"DYM\\\",\\n \\\"VELO\\\",\\n \\\"XPR\\\",\\n \\\"SNX\\\",\\n \\\"JUP\\\",\\n \\\"MANA\\\",\\n \\\"API3\\\",\\n \\\"PYR\\\",\\n \\\"ROSE\\\",\\n \\\"GLMR\\\",\\n \\\"SATS\\\",\\n \\\"TIA\\\",\\n \\\"GALAX\\\",\\n \\\"SOL\\\",\\n \\\"DAO\\\",\\n \\\"FET\\\",\\n \\\"ETC\\\",\\n \\\"MKR\\\",\\n \\\"WOO\\\",\\n \\\"DODO\\\",\\n \\\"OGN\\\",\\n \\\"BNB\\\",\\n \\\"ICP\\\",\\n \\\"BLUR\\\",\\n \\\"ETH\\\",\\n \\\"ZEC\\\",\\n \\\"NEO\\\",\\n \\\"CELO\\\",\\n \\\"REN\\\",\\n \\\"MANTA\\\",\\n \\\"LRC\\\",\\n \\\"STRK\\\",\\n \\\"ADA\\\",\\n \\\"STORJ\\\",\\n \\\"REQ\\\",\\n \\\"TAO\\\",\\n \\\"VET\\\",\\n \\\"FITFI\\\",\\n \\\"USDT\\\",\\n \\\"DOGE\\\",\\n \\\"HBAR\\\",\\n \\\"SXP\\\",\\n \\\"NEIROCTO\\\",\\n \\\"CHR\\\",\\n \\\"ORDI\\\",\\n \\\"DASH\\\",\\n \\\"PEPE\\\",\\n \\\"ONDO\\\",\\n \\\"ILV\\\",\\n \\\"WAVES\\\",\\n \\\"CHZ\\\",\\n \\\"DOGS\\\",\\n \\\"XRP\\\",\\n \\\"CTSI\\\",\\n \\\"JASMY\\\",\\n \\\"FLOKI\\\",\\n \\\"TRX\\\",\\n \\\"KAVA\\\",\\n \\\"SAND\\\",\\n \\\"C98\\\",\\n \\\"UMA\\\",\\n \\\"NOT\\\",\\n \\\"IMX\\\",\\n \\\"WIF\\\",\\n \\\"ENA\\\",\\n \\\"EGLD\\\",\\n \\\"BOME\\\",\\n \\\"LTC\\\",\\n \\\"USDC\\\",\\n \\\"METIS\\\",\\n \\\"WIN\\\",\\n \\\"THETA\\\",\\n \\\"FXS\\\",\\n \\\"ENJ\\\",\\n \\\"CRO\\\",\\n \\\"AEVO\\\",\\n \\\"INJ\\\",\\n \\\"LTO\\\",\\n \\\"CRV\\\",\\n \\\"GRT\\\",\\n \\\"DYDX\\\",\\n \\\"FLUX\\\",\\n \\\"ENS\\\",\\n \\\"WAX\\\",\\n \\\"MASK\\\",\\n \\\"POND\\\",\\n \\\"UNI\\\",\\n \\\"AAVE\\\",\\n \\\"LINA\\\",\\n \\\"TLM\\\",\\n \\\"BONK\\\",\\n \\\"QNT\\\",\\n \\\"LDO\\\",\\n \\\"ALICE\\\",\\n \\\"XLM\\\",\\n \\\"LINK\\\",\\n \\\"CKB\\\",\\n \\\"LUNC\\\",\\n \\\"YFI\\\",\\n \\\"ETHW\\\",\\n \\\"XTZ\\\",\\n \\\"LUNA\\\",\\n \\\"OP\\\",\\n \\\"SUPER\\\",\\n \\\"EIGEN\\\",\\n \\\"KSM\\\",\\n \\\"ELON\\\",\\n \\\"EOS\\\",\\n \\\"FIL\\\",\\n \\\"ZETA\\\",\\n \\\"SKL\\\",\\n \\\"BAT\\\",\\n \\\"APE\\\",\\n \\\"HMSTR\\\",\\n \\\"YGG\\\",\\n \\\"MOVR\\\",\\n \\\"PEOPLE\\\",\\n \\\"KCS\\\",\\n \\\"AXS\\\",\\n \\\"ARPA\\\",\\n \\\"ZIL\\\"\\n ]\\n }\\n}" + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"maxLeverage\\\": 5,\\n \\\"warningDebtRatio\\\": \\\"0.95\\\",\\n \\\"liqDebtRatio\\\": \\\"0.97\\\",\\n \\\"currencyList\\\": [\\n \\\"VRA\\\",\\n \\\"APT\\\",\\n \\\"IOTX\\\",\\n \\\"SHIB\\\",\\n \\\"KDA\\\",\\n \\\"BCHSV\\\",\\n \\\"NEAR\\\",\\n \\\"CLV\\\",\\n \\\"AUDIO\\\",\\n \\\"AIOZ\\\",\\n \\\"FLOW\\\",\\n \\\"WLD\\\",\\n \\\"COMP\\\",\\n \\\"MEME\\\",\\n \\\"SLP\\\",\\n \\\"STX\\\",\\n \\\"ZRO\\\",\\n \\\"QI\\\",\\n \\\"PYTH\\\",\\n \\\"RUNE\\\",\\n \\\"DGB\\\",\\n \\\"IOST\\\",\\n \\\"SUI\\\",\\n \\\"BCH\\\",\\n \\\"CAKE\\\",\\n \\\"DOT\\\",\\n \\\"OMG\\\",\\n \\\"POL\\\",\\n \\\"GMT\\\",\\n \\\"1INCH\\\",\\n \\\"RSR\\\",\\n \\\"NKN\\\",\\n \\\"BTC\\\",\\n \\\"AR\\\",\\n \\\"ARB\\\",\\n \\\"TON\\\",\\n \\\"LISTA\\\",\\n \\\"AVAX\\\",\\n \\\"SEI\\\",\\n \\\"FTM\\\",\\n \\\"ERN\\\",\\n \\\"BB\\\",\\n \\\"BTT\\\",\\n \\\"JTO\\\",\\n \\\"ONE\\\",\\n \\\"RLC\\\",\\n \\\"ANKR\\\",\\n \\\"SUSHI\\\",\\n \\\"CATI\\\",\\n \\\"ALGO\\\",\\n \\\"PEPE2\\\",\\n \\\"ATOM\\\",\\n \\\"LPT\\\",\\n \\\"BIGTIME\\\",\\n \\\"CFX\\\",\\n \\\"DYM\\\",\\n \\\"VELO\\\",\\n \\\"XPR\\\",\\n \\\"SNX\\\",\\n \\\"JUP\\\",\\n \\\"MANA\\\",\\n \\\"API3\\\",\\n \\\"PYR\\\",\\n \\\"ROSE\\\",\\n \\\"GLMR\\\",\\n \\\"SATS\\\",\\n \\\"TIA\\\",\\n \\\"GALAX\\\",\\n \\\"SOL\\\",\\n \\\"DAO\\\",\\n \\\"FET\\\",\\n \\\"ETC\\\",\\n \\\"MKR\\\",\\n \\\"WOO\\\",\\n \\\"DODO\\\",\\n \\\"OGN\\\",\\n \\\"BNB\\\",\\n \\\"ICP\\\",\\n \\\"BLUR\\\",\\n \\\"ETH\\\",\\n \\\"ZEC\\\",\\n \\\"NEO\\\",\\n \\\"CELO\\\",\\n \\\"REN\\\",\\n \\\"MANTA\\\",\\n \\\"LRC\\\",\\n \\\"STRK\\\",\\n \\\"ADA\\\",\\n \\\"STORJ\\\",\\n \\\"REQ\\\",\\n \\\"TAO\\\",\\n \\\"VET\\\",\\n \\\"FITFI\\\",\\n \\\"USDT\\\",\\n \\\"DOGE\\\",\\n \\\"HBAR\\\",\\n \\\"SXP\\\",\\n \\\"NEIROCTO\\\",\\n \\\"CHR\\\",\\n \\\"ORDI\\\",\\n \\\"DASH\\\",\\n \\\"PEPE\\\",\\n \\\"ONDO\\\",\\n \\\"ILV\\\",\\n \\\"WAVES\\\",\\n \\\"CHZ\\\",\\n \\\"DOGS\\\",\\n \\\"XRP\\\",\\n \\\"CTSI\\\",\\n \\\"JASMY\\\",\\n \\\"FLOKI\\\",\\n \\\"TRX\\\",\\n \\\"KAVA\\\",\\n \\\"SAND\\\",\\n \\\"C98\\\",\\n \\\"UMA\\\",\\n \\\"NOT\\\",\\n \\\"IMX\\\",\\n \\\"WIF\\\",\\n \\\"ENA\\\",\\n \\\"EGLD\\\",\\n \\\"BOME\\\",\\n \\\"LTC\\\",\\n \\\"USDC\\\",\\n \\\"METIS\\\",\\n \\\"WIN\\\",\\n \\\"THETA\\\",\\n \\\"FXS\\\",\\n \\\"ENJ\\\",\\n \\\"CRO\\\",\\n \\\"AEVO\\\",\\n \\\"INJ\\\",\\n \\\"LTO\\\",\\n \\\"CRV\\\",\\n \\\"GRT\\\",\\n \\\"DYDX\\\",\\n \\\"FLUX\\\",\\n \\\"ENS\\\",\\n \\\"WAX\\\",\\n \\\"MASK\\\",\\n \\\"POND\\\",\\n \\\"UNI\\\",\\n \\\"AAVE\\\",\\n \\\"LINA\\\",\\n \\\"TLM\\\",\\n \\\"BONK\\\",\\n \\\"QNT\\\",\\n \\\"LDO\\\",\\n \\\"ALICE\\\",\\n \\\"XLM\\\",\\n \\\"LINK\\\",\\n \\\"CKB\\\",\\n \\\"LUNC\\\",\\n \\\"YFI\\\",\\n \\\"ETHW\\\",\\n \\\"XTZ\\\",\\n \\\"LUNA\\\",\\n \\\"OP\\\",\\n \\\"SUPER\\\",\\n \\\"EIGEN\\\",\\n \\\"KSM\\\",\\n \\\"ELON\\\",\\n \\\"EOS\\\",\\n \\\"FIL\\\",\\n \\\"ZETA\\\",\\n \\\"SKL\\\",\\n \\\"BAT\\\",\\n \\\"APE\\\",\\n \\\"HMSTR\\\",\\n \\\"YGG\\\",\\n \\\"MOVR\\\",\\n \\\"PEOPLE\\\",\\n \\\"KCS\\\",\\n \\\"AXS\\\",\\n \\\"ARPA\\\",\\n \\\"ZIL\\\"\\n ]\\n }\\n}", + "operationId": "002" } }, "/api/v3/etf/info": { @@ -330,7 +332,8 @@ "x-sdk-method-description": "This interface returns leveraged token information", "x-api-rate-limit": 3, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": [\\n {\\n \\\"currency\\\": \\\"BTCUP\\\",\\n \\\"netAsset\\\": \\\"33.846\\\",\\n \\\"targetLeverage\\\": \\\"2-4\\\",\\n \\\"actualLeverage\\\": \\\"2.1648\\\",\\n \\\"issuedSize\\\": \\\"107134.87655291\\\",\\n \\\"basket\\\": \\\"118.324559 XBTUSDTM\\\"\\n }\\n ]\\n}", - "x-request-example": "{\\\"currency\\\": \\\"BTCUP\\\"}" + "x-request-example": "{\\\"currency\\\": \\\"BTCUP\\\"}", + "operationId": "003" } }, "/api/v3/mark-price/all-symbols": { @@ -398,7 +401,8 @@ "x-sdk-method-name": "getMarkPriceList", "x-sdk-method-description": "This endpoint returns the current Mark price for all margin trading pairs.", "x-api-rate-limit": 10, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": [\\n {\\n \\\"symbol\\\": \\\"USDT-BTC\\\",\\n \\\"timePoint\\\": 1729676522000,\\n \\\"value\\\": 1.504E-5\\n },\\n {\\n \\\"symbol\\\": \\\"USDC-BTC\\\",\\n \\\"timePoint\\\": 1729676522000,\\n \\\"value\\\": 1.5049024E-5\\n }\\n ]\\n}" + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": [\\n {\\n \\\"symbol\\\": \\\"USDT-BTC\\\",\\n \\\"timePoint\\\": 1729676522000,\\n \\\"value\\\": 1.504E-5\\n },\\n {\\n \\\"symbol\\\": \\\"USDC-BTC\\\",\\n \\\"timePoint\\\": 1729676522000,\\n \\\"value\\\": 1.5049024E-5\\n }\\n ]\\n}", + "operationId": "004" } }, "/api/v1/mark-price/{symbol}/current": { @@ -474,7 +478,8 @@ "x-sdk-method-description": "This endpoint returns the current Mark price for specified margin trading pairs.", "x-api-rate-limit": 2, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"symbol\\\": \\\"USDT-BTC\\\",\\n \\\"timePoint\\\": 1729676888000,\\n \\\"value\\\": 1.5045E-5\\n }\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"USDT-BTC\\\"}" + "x-request-example": "{\\\"symbol\\\": \\\"USDT-BTC\\\"}", + "operationId": "005" } }, "/api/v1/isolated/symbols": { @@ -587,7 +592,8 @@ "x-sdk-method-name": "getIsolatedMarginSymbols", "x-sdk-method-description": "This endpoint allows querying the configuration of isolated margin symbol.", "x-api-rate-limit": 3, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": [\\n {\\n \\\"symbol\\\": \\\"BTC-USDT\\\",\\n \\\"symbolName\\\": \\\"BTC-USDT\\\",\\n \\\"baseCurrency\\\": \\\"BTC\\\",\\n \\\"quoteCurrency\\\": \\\"USDT\\\",\\n \\\"maxLeverage\\\": 10,\\n \\\"flDebtRatio\\\": \\\"0.97\\\",\\n \\\"tradeEnable\\\": true,\\n \\\"autoRenewMaxDebtRatio\\\": \\\"0.96\\\",\\n \\\"baseBorrowEnable\\\": true,\\n \\\"quoteBorrowEnable\\\": true,\\n \\\"baseTransferInEnable\\\": true,\\n \\\"quoteTransferInEnable\\\": true,\\n \\\"baseBorrowCoefficient\\\": \\\"1\\\",\\n \\\"quoteBorrowCoefficient\\\": \\\"1\\\"\\n }\\n ]\\n}" + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": [\\n {\\n \\\"symbol\\\": \\\"BTC-USDT\\\",\\n \\\"symbolName\\\": \\\"BTC-USDT\\\",\\n \\\"baseCurrency\\\": \\\"BTC\\\",\\n \\\"quoteCurrency\\\": \\\"USDT\\\",\\n \\\"maxLeverage\\\": 10,\\n \\\"flDebtRatio\\\": \\\"0.97\\\",\\n \\\"tradeEnable\\\": true,\\n \\\"autoRenewMaxDebtRatio\\\": \\\"0.96\\\",\\n \\\"baseBorrowEnable\\\": true,\\n \\\"quoteBorrowEnable\\\": true,\\n \\\"baseTransferInEnable\\\": true,\\n \\\"quoteTransferInEnable\\\": true,\\n \\\"baseBorrowCoefficient\\\": \\\"1\\\",\\n \\\"quoteBorrowCoefficient\\\": \\\"1\\\"\\n }\\n ]\\n}", + "operationId": "006" } } }, diff --git a/spec/rest/api/openapi-margin-order.json b/spec/rest/api/openapi-margin-order.json index 03d6d122..168e77ba 100644 --- a/spec/rest/api/openapi-margin-order.json +++ b/spec/rest/api/openapi-margin-order.json @@ -267,7 +267,8 @@ } }, "x-response-example": "{\\n \\\"success\\\": true,\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"orderId\\\": \\\"671663e02188630007e21c9c\\\",\\n \\\"clientOid\\\": \\\"5c52e11203aa677f33e1493fb\\\",\\n \\\"borrowSize\\\": \\\"10.2\\\",\\n \\\"loanApplyId\\\": \\\"600656d9a33ac90009de4f6f\\\"\\n }\\n}", - "x-request-example": "{\\\"type\\\": \\\"limit\\\", \\\"symbol\\\": \\\"BTC-USDT\\\", \\\"side\\\": \\\"buy\\\", \\\"price\\\": \\\"50000\\\", \\\"size\\\": \\\"0.00001\\\", \\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\", \\\"remark\\\": \\\"order remarks\\\"}" + "x-request-example": "{\\\"type\\\": \\\"limit\\\", \\\"symbol\\\": \\\"BTC-USDT\\\", \\\"side\\\": \\\"buy\\\", \\\"price\\\": \\\"50000\\\", \\\"size\\\": \\\"0.00001\\\", \\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\", \\\"remark\\\": \\\"order remarks\\\"}", + "operationId": "001" } }, "/api/v3/hf/margin/order/test": { @@ -530,7 +531,8 @@ } }, "x-response-example": "{\\n \\\"success\\\": true,\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"orderId\\\": \\\"5bd6e9286d99522a52e458de\\\",\\n \\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\",\\n \\\"borrowSize\\\": 10.2,\\n \\\"loanApplyId\\\": \\\"600656d9a33ac90009de4f6f\\\"\\n }\\n}", - "x-request-example": "{\\\"type\\\": \\\"limit\\\", \\\"symbol\\\": \\\"BTC-USDT\\\", \\\"side\\\": \\\"buy\\\", \\\"price\\\": \\\"50000\\\", \\\"size\\\": \\\"0.00001\\\", \\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\", \\\"remark\\\": \\\"order remarks\\\"}" + "x-request-example": "{\\\"type\\\": \\\"limit\\\", \\\"symbol\\\": \\\"BTC-USDT\\\", \\\"side\\\": \\\"buy\\\", \\\"price\\\": \\\"50000\\\", \\\"size\\\": \\\"0.00001\\\", \\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\", \\\"remark\\\": \\\"order remarks\\\"}", + "operationId": "002" } }, "/api/v3/hf/margin/orders/{orderId}": { @@ -609,7 +611,8 @@ "x-sdk-method-description": "This endpoint can be used to cancel a margin order by orderId. This endpoint only sends cancellation requests. The results of the requests must be obtained by checking the order status or subscribing to websocket.", "x-api-rate-limit": 5, "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"orderId\\\":\\\"671663e02188630007e21c9c\\\"}}", - "x-request-example": "{\\\"orderId\\\": \\\"671663e02188630007e21c9c\\\", \\\"symbol\\\": \\\"BTC-USDT\\\"}" + "x-request-example": "{\\\"orderId\\\": \\\"671663e02188630007e21c9c\\\", \\\"symbol\\\": \\\"BTC-USDT\\\"}", + "operationId": "003" }, "get": { "summary": "Get Order By OrderId", @@ -951,7 +954,8 @@ "x-sdk-method-description": "This endpoint can be used to obtain information for a single Margin order using the order id. After the user successfully places an order, the order is in Active state, and the user can use inOrderBook to determine whether the order has entered the order. Canceled or fully filled orders are marked as completed Done status.", "x-api-rate-limit": 5, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"id\\\": \\\"671667306afcdb000723107f\\\",\\n \\\"symbol\\\": \\\"BTC-USDT\\\",\\n \\\"opType\\\": \\\"DEAL\\\",\\n \\\"type\\\": \\\"limit\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"price\\\": \\\"50000\\\",\\n \\\"size\\\": \\\"0.00001\\\",\\n \\\"funds\\\": \\\"0.5\\\",\\n \\\"dealSize\\\": \\\"0\\\",\\n \\\"dealFunds\\\": \\\"0\\\",\\n \\\"fee\\\": \\\"0\\\",\\n \\\"feeCurrency\\\": \\\"USDT\\\",\\n \\\"stp\\\": null,\\n \\\"stop\\\": null,\\n \\\"stopTriggered\\\": false,\\n \\\"stopPrice\\\": \\\"0\\\",\\n \\\"timeInForce\\\": \\\"GTC\\\",\\n \\\"postOnly\\\": false,\\n \\\"hidden\\\": false,\\n \\\"iceberg\\\": false,\\n \\\"visibleSize\\\": \\\"0\\\",\\n \\\"cancelAfter\\\": 0,\\n \\\"channel\\\": \\\"API\\\",\\n \\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\",\\n \\\"remark\\\": null,\\n \\\"tags\\\": null,\\n \\\"cancelExist\\\": false,\\n \\\"createdAt\\\": 1729521456248,\\n \\\"lastUpdatedAt\\\": 1729651011877,\\n \\\"tradeType\\\": \\\"MARGIN_TRADE\\\",\\n \\\"inOrderBook\\\": true,\\n \\\"cancelledSize\\\": \\\"0\\\",\\n \\\"cancelledFunds\\\": \\\"0\\\",\\n \\\"remainSize\\\": \\\"0.00001\\\",\\n \\\"remainFunds\\\": \\\"0.5\\\",\\n \\\"tax\\\": \\\"0\\\",\\n \\\"active\\\": true\\n }\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"orderId\\\": \\\"671667306afcdb000723107f\\\"}" + "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"orderId\\\": \\\"671667306afcdb000723107f\\\"}", + "operationId": "010" } }, "/api/v3/hf/margin/orders/client-order/{clientOid}": { @@ -1030,7 +1034,8 @@ "x-sdk-method-description": "This endpoint can be used to cancel a margin order by clientOid. This endpoint only sends cancellation requests. The results of the requests must be obtained by checking the order status or subscribing to websocket.", "x-api-rate-limit": 5, "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"clientOid\\\":\\\"5c52e11203aa677f33e1493fb\\\"}}", - "x-request-example": "{\\\"clientOid\\\": \\\"5c52e11203aa677f33e1493fb\\\", \\\"symbol\\\": \\\"BTC-USDT\\\"}" + "x-request-example": "{\\\"clientOid\\\": \\\"5c52e11203aa677f33e1493fb\\\", \\\"symbol\\\": \\\"BTC-USDT\\\"}", + "operationId": "004" }, "get": { "summary": "Get Order By ClientOid", @@ -1371,7 +1376,8 @@ "x-sdk-method-description": "This endpoint can be used to obtain information for a single Margin order using the client order id. After the user successfully places an order, the order is in Active state, and the user can use inOrderBook to determine whether the order has entered the order. Canceled or fully filled orders are marked as completed Done status.", "x-api-rate-limit": 5, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"id\\\": \\\"671667306afcdb000723107f\\\",\\n \\\"symbol\\\": \\\"BTC-USDT\\\",\\n \\\"opType\\\": \\\"DEAL\\\",\\n \\\"type\\\": \\\"limit\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"price\\\": \\\"50000\\\",\\n \\\"size\\\": \\\"0.00001\\\",\\n \\\"funds\\\": \\\"0.5\\\",\\n \\\"dealSize\\\": \\\"0\\\",\\n \\\"dealFunds\\\": \\\"0\\\",\\n \\\"fee\\\": \\\"0\\\",\\n \\\"feeCurrency\\\": \\\"USDT\\\",\\n \\\"stp\\\": null,\\n \\\"stop\\\": null,\\n \\\"stopTriggered\\\": false,\\n \\\"stopPrice\\\": \\\"0\\\",\\n \\\"timeInForce\\\": \\\"GTC\\\",\\n \\\"postOnly\\\": false,\\n \\\"hidden\\\": false,\\n \\\"iceberg\\\": false,\\n \\\"visibleSize\\\": \\\"0\\\",\\n \\\"cancelAfter\\\": 0,\\n \\\"channel\\\": \\\"API\\\",\\n \\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\",\\n \\\"remark\\\": null,\\n \\\"tags\\\": null,\\n \\\"cancelExist\\\": false,\\n \\\"createdAt\\\": 1729521456248,\\n \\\"lastUpdatedAt\\\": 1729651011877,\\n \\\"tradeType\\\": \\\"MARGIN_TRADE\\\",\\n \\\"inOrderBook\\\": true,\\n \\\"cancelledSize\\\": \\\"0\\\",\\n \\\"cancelledFunds\\\": \\\"0\\\",\\n \\\"remainSize\\\": \\\"0.00001\\\",\\n \\\"remainFunds\\\": \\\"0.5\\\",\\n \\\"tax\\\": \\\"0\\\",\\n \\\"active\\\": true\\n }\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\"}" + "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\"}", + "operationId": "011" } }, "/api/v3/hf/margin/orders": { @@ -1457,7 +1463,8 @@ "x-sdk-method-description": "This interface can cancel all open Margin orders by symbol This endpoint only sends cancellation requests. The results of the requests must be obtained by checking the order status or subscribing to websocket.", "x-api-rate-limit": 10, "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":\\\"success\\\"}", - "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"tradeType\\\": \\\"MARGIN_TRADE\\\"}" + "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"tradeType\\\": \\\"MARGIN_TRADE\\\"}", + "operationId": "005" } }, "/api/v3/hf/margin/order/active/symbols": { @@ -1546,7 +1553,8 @@ "x-sdk-method-description": "This interface can query all Margin symbol that has active orders", "x-api-rate-limit": 2, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"symbolSize\\\": 1,\\n \\\"symbols\\\": [\\n \\\"BTC-USDT\\\"\\n ]\\n }\\n}", - "x-request-example": "{\\\"tradeType\\\": \\\"MARGIN_TRADE\\\"}" + "x-request-example": "{\\\"tradeType\\\": \\\"MARGIN_TRADE\\\"}", + "operationId": "006" } }, "/api/v3/hf/margin/orders/active": { @@ -1908,7 +1916,8 @@ "x-sdk-method-description": "This interface is to obtain all Margin active order lists, and the return value of the active order interface is the paged data of all uncompleted order lists. The returned data is sorted in descending order according to the latest update time of the order. After the user successfully places an order, the order is in Active state, and the user can use inOrderBook to determine whether the order has entered the order. Canceled or fully filled orders are marked as completed Done status.", "x-api-rate-limit": 4, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": [\\n {\\n \\\"id\\\": \\\"671667306afcdb000723107f\\\",\\n \\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\",\\n \\\"symbol\\\": \\\"BTC-USDT\\\",\\n \\\"opType\\\": \\\"DEAL\\\",\\n \\\"type\\\": \\\"limit\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"price\\\": \\\"50000\\\",\\n \\\"size\\\": \\\"0.00001\\\",\\n \\\"funds\\\": \\\"0.5\\\",\\n \\\"dealSize\\\": \\\"0\\\",\\n \\\"dealFunds\\\": \\\"0\\\",\\n \\\"remainSize\\\": \\\"0.00001\\\",\\n \\\"remainFunds\\\": \\\"0.5\\\",\\n \\\"cancelledSize\\\": \\\"0\\\",\\n \\\"cancelledFunds\\\": \\\"0\\\",\\n \\\"fee\\\": \\\"0\\\",\\n \\\"feeCurrency\\\": \\\"USDT\\\",\\n \\\"stp\\\": null,\\n \\\"stop\\\": null,\\n \\\"stopTriggered\\\": false,\\n \\\"stopPrice\\\": \\\"0\\\",\\n \\\"timeInForce\\\": \\\"GTC\\\",\\n \\\"postOnly\\\": false,\\n \\\"hidden\\\": false,\\n \\\"iceberg\\\": false,\\n \\\"visibleSize\\\": \\\"0\\\",\\n \\\"cancelAfter\\\": 0,\\n \\\"channel\\\": \\\"API\\\",\\n \\\"remark\\\": null,\\n \\\"tags\\\": null,\\n \\\"cancelExist\\\": false,\\n \\\"tradeType\\\": \\\"MARGIN_TRADE\\\",\\n \\\"inOrderBook\\\": true,\\n \\\"active\\\": true,\\n \\\"tax\\\": \\\"0\\\",\\n \\\"createdAt\\\": 1729521456248,\\n \\\"lastUpdatedAt\\\": 1729521460940\\n }\\n ]\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"tradeType\\\": \\\"MARGIN_TRADE\\\"}" + "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"tradeType\\\": \\\"MARGIN_TRADE\\\"}", + "operationId": "007" } }, "/api/v3/hf/margin/orders/done": { @@ -2360,7 +2369,8 @@ "x-sdk-method-description": "This interface is to obtain all Margin closed order lists, and the return value of the active order interface is the paged data of all uncompleted order lists. The returned data is sorted in descending order according to the latest update time of the order. After the user successfully places an order, the order is in Active state, and the user can use inOrderBook to determine whether the order has entered the order. Canceled or fully filled orders are marked as completed Done status.", "x-api-rate-limit": 10, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"lastId\\\": 136112949351,\\n \\\"items\\\": [\\n {\\n \\\"id\\\": \\\"6716491f6afcdb00078365c8\\\",\\n \\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\",\\n \\\"symbol\\\": \\\"BTC-USDT\\\",\\n \\\"opType\\\": \\\"DEAL\\\",\\n \\\"type\\\": \\\"limit\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"price\\\": \\\"50000\\\",\\n \\\"size\\\": \\\"0.00001\\\",\\n \\\"funds\\\": \\\"0.5\\\",\\n \\\"dealSize\\\": \\\"0\\\",\\n \\\"dealFunds\\\": \\\"0\\\",\\n \\\"remainSize\\\": \\\"0\\\",\\n \\\"remainFunds\\\": \\\"0\\\",\\n \\\"cancelledSize\\\": \\\"0.00001\\\",\\n \\\"cancelledFunds\\\": \\\"0.5\\\",\\n \\\"fee\\\": \\\"0\\\",\\n \\\"feeCurrency\\\": \\\"USDT\\\",\\n \\\"stp\\\": null,\\n \\\"stop\\\": null,\\n \\\"stopTriggered\\\": false,\\n \\\"stopPrice\\\": \\\"0\\\",\\n \\\"timeInForce\\\": \\\"GTC\\\",\\n \\\"postOnly\\\": false,\\n \\\"hidden\\\": false,\\n \\\"iceberg\\\": false,\\n \\\"visibleSize\\\": \\\"0\\\",\\n \\\"cancelAfter\\\": 0,\\n \\\"channel\\\": \\\"API\\\",\\n \\\"remark\\\": null,\\n \\\"tags\\\": null,\\n \\\"cancelExist\\\": true,\\n \\\"tradeType\\\": \\\"MARGIN_TRADE\\\",\\n \\\"inOrderBook\\\": false,\\n \\\"active\\\": false,\\n \\\"tax\\\": \\\"0\\\",\\n \\\"createdAt\\\": 1729513759162,\\n \\\"lastUpdatedAt\\\": 1729521126597\\n }\\n ]\\n }\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"tradeType\\\": \\\"MARGIN_TRADE\\\", \\\"side\\\": \\\"buy\\\", \\\"type\\\": \\\"limit\\\", \\\"lastId\\\": 254062248624417, \\\"limit\\\": 20, \\\"startAt\\\": 1728663338000, \\\"endAt\\\": 1728692138000}" + "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"tradeType\\\": \\\"MARGIN_TRADE\\\", \\\"side\\\": \\\"buy\\\", \\\"type\\\": \\\"limit\\\", \\\"lastId\\\": 254062248624417, \\\"limit\\\": 20, \\\"startAt\\\": 1728663338000, \\\"endAt\\\": 1728692138000}", + "operationId": "008" } }, "/api/v3/hf/margin/fills": { @@ -2722,7 +2732,8 @@ "x-sdk-method-description": "This endpoint can be used to obtain a list of the latest Margin transaction details. The returned data is sorted in descending order according to the latest update time of the order.", "x-api-rate-limit": 5, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"items\\\": [\\n {\\n \\\"id\\\": 137891621991,\\n \\\"symbol\\\": \\\"BTC-USDT\\\",\\n \\\"tradeId\\\": 11040911994273793,\\n \\\"orderId\\\": \\\"671868085584bc0007d85f46\\\",\\n \\\"counterOrderId\\\": \\\"67186805b7cbdf00071621f9\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"liquidity\\\": \\\"taker\\\",\\n \\\"forceTaker\\\": false,\\n \\\"price\\\": \\\"67141.6\\\",\\n \\\"size\\\": \\\"0.00001\\\",\\n \\\"funds\\\": \\\"0.671416\\\",\\n \\\"fee\\\": \\\"0.000671416\\\",\\n \\\"feeRate\\\": \\\"0.001\\\",\\n \\\"feeCurrency\\\": \\\"USDT\\\",\\n \\\"stop\\\": \\\"\\\",\\n \\\"tradeType\\\": \\\"MARGIN_TRADE\\\",\\n \\\"tax\\\": \\\"0\\\",\\n \\\"taxRate\\\": \\\"0\\\",\\n \\\"type\\\": \\\"limit\\\",\\n \\\"createdAt\\\": 1729652744998\\n }\\n ],\\n \\\"lastId\\\": 137891621991\\n }\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"tradeType\\\": \\\"MARGIN_TRADE\\\", \\\"orderId\\\": \\\"example_string_default_value\\\", \\\"side\\\": \\\"buy\\\", \\\"type\\\": \\\"limit\\\", \\\"lastId\\\": 254062248624417, \\\"limit\\\": 100, \\\"startAt\\\": 1728663338000, \\\"endAt\\\": 1728692138000}" + "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"tradeType\\\": \\\"MARGIN_TRADE\\\", \\\"orderId\\\": \\\"example_string_default_value\\\", \\\"side\\\": \\\"buy\\\", \\\"type\\\": \\\"limit\\\", \\\"lastId\\\": 254062248624417, \\\"limit\\\": 100, \\\"startAt\\\": 1728663338000, \\\"endAt\\\": 1728692138000}", + "operationId": "009" } }, "/api/v1/margin/order": { @@ -3001,7 +3012,8 @@ } }, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"orderId\\\": \\\"671bb90194422f00073ff4f0\\\",\\n \\\"loanApplyId\\\": null,\\n \\\"borrowSize\\\": null,\\n \\\"clientOid\\\": null\\n }\\n}", - "x-request-example": "{\\\"type\\\": \\\"limit\\\", \\\"symbol\\\": \\\"BTC-USDT\\\", \\\"side\\\": \\\"buy\\\", \\\"price\\\": \\\"50000\\\", \\\"size\\\": \\\"0.00001\\\", \\\"clientOid\\\": \\\"5c52e11203aa677f33e4193fb\\\", \\\"remark\\\": \\\"order remarks\\\"}" + "x-request-example": "{\\\"type\\\": \\\"limit\\\", \\\"symbol\\\": \\\"BTC-USDT\\\", \\\"side\\\": \\\"buy\\\", \\\"price\\\": \\\"50000\\\", \\\"size\\\": \\\"0.00001\\\", \\\"clientOid\\\": \\\"5c52e11203aa677f33e4193fb\\\", \\\"remark\\\": \\\"order remarks\\\"}", + "operationId": "012" } }, "/api/v1/margin/order/test": { @@ -3280,7 +3292,8 @@ } }, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"orderId\\\": \\\"671bb90194422f00073ff4f0\\\",\\n \\\"loanApplyId\\\": null,\\n \\\"borrowSize\\\": null,\\n \\\"clientOid\\\": null\\n }\\n}", - "x-request-example": "{\\\"type\\\": \\\"limit\\\", \\\"symbol\\\": \\\"BTC-USDT\\\", \\\"side\\\": \\\"buy\\\", \\\"price\\\": \\\"50000\\\", \\\"size\\\": \\\"0.00001\\\", \\\"clientOid\\\": \\\"5c52e11203aa677f33e4193fb\\\", \\\"remark\\\": \\\"order remarks\\\"}" + "x-request-example": "{\\\"type\\\": \\\"limit\\\", \\\"symbol\\\": \\\"BTC-USDT\\\", \\\"side\\\": \\\"buy\\\", \\\"price\\\": \\\"50000\\\", \\\"size\\\": \\\"0.00001\\\", \\\"clientOid\\\": \\\"5c52e11203aa677f33e4193fb\\\", \\\"remark\\\": \\\"order remarks\\\"}", + "operationId": "013" } } }, diff --git a/spec/rest/api/openapi-margin-risklimit.json b/spec/rest/api/openapi-margin-risklimit.json index 9bc6489a..f90eb6cc 100644 --- a/spec/rest/api/openapi-margin-risklimit.json +++ b/spec/rest/api/openapi-margin-risklimit.json @@ -209,7 +209,8 @@ "x-sdk-method-description": "Request via this endpoint to get the Configure and Risk limit info of the margin.", "x-api-rate-limit": 20, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": [\\n {\\n \\\"timestamp\\\": 1729678659275,\\n \\\"currency\\\": \\\"BTC\\\",\\n \\\"borrowMaxAmount\\\": \\\"75.15\\\",\\n \\\"buyMaxAmount\\\": \\\"217.12\\\",\\n \\\"holdMaxAmount\\\": \\\"217.12\\\",\\n \\\"borrowCoefficient\\\": \\\"1\\\",\\n \\\"marginCoefficient\\\": \\\"1\\\",\\n \\\"precision\\\": 8,\\n \\\"borrowMinAmount\\\": \\\"0.001\\\",\\n \\\"borrowMinUnit\\\": \\\"0.0001\\\",\\n \\\"borrowEnabled\\\": true\\n }\\n ]\\n}\\n", - "x-request-example": "{\\\"isIsolated\\\": true, \\\"currency\\\": \\\"BTC\\\", \\\"symbol\\\": \\\"BTC-USDT\\\"}" + "x-request-example": "{\\\"isIsolated\\\": true, \\\"currency\\\": \\\"BTC\\\", \\\"symbol\\\": \\\"BTC-USDT\\\"}", + "operationId": "001" } } }, diff --git a/spec/rest/api/openapi-spot-market.json b/spec/rest/api/openapi-spot-market.json index 6f4692a2..977560d5 100644 --- a/spec/rest/api/openapi-spot-market.json +++ b/spec/rest/api/openapi-spot-market.json @@ -379,7 +379,8 @@ "x-sdk-method-description": "This interface can obtain the latest news announcements, and the default page search is for announcements within a month.", "x-api-rate-limit": 20, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"totalNum\\\": 195,\\n \\\"totalPage\\\": 13,\\n \\\"currentPage\\\": 1,\\n \\\"pageSize\\\": 15,\\n \\\"items\\\": [\\n {\\n \\\"annId\\\": 129045,\\n \\\"annTitle\\\": \\\"KuCoin Isolated Margin Adds the Scroll (SCR) Trading Pair\\\",\\n \\\"annType\\\": [\\n \\\"latest-announcements\\\"\\n ],\\n \\\"annDesc\\\": \\\"To enrich the variety of assets available,\\xa0KuCoin\\u2019s Isolated Margin Trading platform has added the Scroll (SCR)\\xa0asset and trading pair.\\\",\\n \\\"cTime\\\": 1729594043000,\\n \\\"language\\\": \\\"en_US\\\",\\n \\\"annUrl\\\": \\\"https://www.kucoin.com/announcement/kucoin-isolated-margin-adds-scr?lang=en_US\\\"\\n },\\n {\\n \\\"annId\\\": 129001,\\n \\\"annTitle\\\": \\\"DAPP-30D Fixed Promotion, Enjoy an APR of 200%!\\u200b\\\",\\n \\\"annType\\\": [\\n \\\"latest-announcements\\\",\\n \\\"activities\\\"\\n ],\\n \\\"annDesc\\\": \\\"KuCoin Earn will be launching the DAPP Fixed Promotion at 10:00:00 on October 22, 2024 (UTC). The available product is \\u201cDAPP-30D'' with an APR of 200%.\\\",\\n \\\"cTime\\\": 1729588460000,\\n \\\"language\\\": \\\"en_US\\\",\\n \\\"annUrl\\\": \\\"https://www.kucoin.com/announcement/dapp-30d-fixed-promotion-enjoy?lang=en_US\\\"\\n },\\n {\\n \\\"annId\\\": 128581,\\n \\\"annTitle\\\": \\\"NAYM (NAYM) Gets Listed on KuCoin! World Premiere!\\\",\\n \\\"annType\\\": [\\n \\\"latest-announcements\\\",\\n \\\"new-listings\\\"\\n ],\\n \\\"annDesc\\\": \\\"Trading:\\xa011:00 on October 22, 2024 (UTC)\\\",\\n \\\"cTime\\\": 1729497729000,\\n \\\"language\\\": \\\"en_US\\\",\\n \\\"annUrl\\\": \\\"https://www.kucoin.com/announcement/en-naym-naym-gets-listed-on-kucoin-world-premiere?lang=en_US\\\"\\n }\\n ]\\n }\\n}", - "x-request-example": "{\\\"currentPage\\\": 1, \\\"pageSize\\\": 50, \\\"annType\\\": \\\"latest-announcements\\\", \\\"lang\\\": \\\"en_US\\\", \\\"startTime\\\": 1729594043000, \\\"endTime\\\": 1729697729000}" + "x-request-example": "{\\\"currentPage\\\": 1, \\\"pageSize\\\": 50, \\\"annType\\\": \\\"latest-announcements\\\", \\\"lang\\\": \\\"en_US\\\", \\\"startTime\\\": 1729594043000, \\\"endTime\\\": 1729697729000}", + "operationId": "001" } }, "/api/v3/currencies/{currency}": { @@ -586,7 +587,8 @@ "x-sdk-method-description": "Request via this endpoint to get the currency details of a specified currency", "x-api-rate-limit": 3, "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"currency\\\":\\\"BTC\\\",\\\"name\\\":\\\"BTC\\\",\\\"fullName\\\":\\\"Bitcoin\\\",\\\"precision\\\":8,\\\"confirms\\\":null,\\\"contractAddress\\\":null,\\\"isMarginEnabled\\\":true,\\\"isDebitEnabled\\\":true,\\\"chains\\\":[{\\\"chainName\\\":\\\"BTC\\\",\\\"withdrawalMinSize\\\":\\\"0.001\\\",\\\"depositMinSize\\\":\\\"0.0002\\\",\\\"withdrawFeeRate\\\":\\\"0\\\",\\\"withdrawalMinFee\\\":\\\"0.0005\\\",\\\"isWithdrawEnabled\\\":true,\\\"isDepositEnabled\\\":true,\\\"confirms\\\":3,\\\"preConfirms\\\":1,\\\"contractAddress\\\":\\\"\\\",\\\"withdrawPrecision\\\":8,\\\"maxWithdraw\\\":null,\\\"maxDeposit\\\":null,\\\"needTag\\\":false,\\\"chainId\\\":\\\"btc\\\"},{\\\"chainName\\\":\\\"Lightning Network\\\",\\\"withdrawalMinSize\\\":\\\"0.00001\\\",\\\"depositMinSize\\\":\\\"0.00001\\\",\\\"withdrawFeeRate\\\":\\\"0\\\",\\\"withdrawalMinFee\\\":\\\"0.000015\\\",\\\"isWithdrawEnabled\\\":true,\\\"isDepositEnabled\\\":true,\\\"confirms\\\":1,\\\"preConfirms\\\":1,\\\"contractAddress\\\":\\\"\\\",\\\"withdrawPrecision\\\":8,\\\"maxWithdraw\\\":null,\\\"maxDeposit\\\":\\\"0.03\\\",\\\"needTag\\\":false,\\\"chainId\\\":\\\"btcln\\\"},{\\\"chainName\\\":\\\"KCC\\\",\\\"withdrawalMinSize\\\":\\\"0.0008\\\",\\\"depositMinSize\\\":null,\\\"withdrawFeeRate\\\":\\\"0\\\",\\\"withdrawalMinFee\\\":\\\"0.00002\\\",\\\"isWithdrawEnabled\\\":true,\\\"isDepositEnabled\\\":true,\\\"confirms\\\":20,\\\"preConfirms\\\":20,\\\"contractAddress\\\":\\\"0xfa93c12cd345c658bc4644d1d4e1b9615952258c\\\",\\\"withdrawPrecision\\\":8,\\\"maxWithdraw\\\":null,\\\"maxDeposit\\\":null,\\\"needTag\\\":false,\\\"chainId\\\":\\\"kcc\\\"},{\\\"chainName\\\":\\\"BTC-Segwit\\\",\\\"withdrawalMinSize\\\":\\\"0.0008\\\",\\\"depositMinSize\\\":\\\"0.0002\\\",\\\"withdrawFeeRate\\\":\\\"0\\\",\\\"withdrawalMinFee\\\":\\\"0.0005\\\",\\\"isWithdrawEnabled\\\":false,\\\"isDepositEnabled\\\":true,\\\"confirms\\\":2,\\\"preConfirms\\\":2,\\\"contractAddress\\\":\\\"\\\",\\\"withdrawPrecision\\\":8,\\\"maxWithdraw\\\":null,\\\"maxDeposit\\\":null,\\\"needTag\\\":false,\\\"chainId\\\":\\\"bech32\\\"}]}}", - "x-request-example": "{\\\"currency\\\": \\\"BTC\\\", \\\"chain\\\": \\\"eth\\\"}" + "x-request-example": "{\\\"currency\\\": \\\"BTC\\\", \\\"chain\\\": \\\"eth\\\"}", + "operationId": "002" } }, "/api/v3/currencies": { @@ -776,7 +778,8 @@ "x-sdk-method-name": "getAllCurrencies", "x-sdk-method-description": "Request via this endpoint to get the currency list.Not all currencies currently can be used for trading.", "x-api-rate-limit": 3, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": [\\n {\\n \\\"currency\\\": \\\"BTC\\\",\\n \\\"name\\\": \\\"BTC\\\",\\n \\\"fullName\\\": \\\"Bitcoin\\\",\\n \\\"precision\\\": 8,\\n \\\"confirms\\\": null,\\n \\\"contractAddress\\\": null,\\n \\\"isMarginEnabled\\\": true,\\n \\\"isDebitEnabled\\\": true,\\n \\\"chains\\\": [\\n {\\n \\\"chainName\\\": \\\"BTC\\\",\\n \\\"withdrawalMinSize\\\": \\\"0.001\\\",\\n \\\"depositMinSize\\\": \\\"0.0002\\\",\\n \\\"withdrawFeeRate\\\": \\\"0\\\",\\n \\\"withdrawalMinFee\\\": \\\"0.0005\\\",\\n \\\"isWithdrawEnabled\\\": true,\\n \\\"isDepositEnabled\\\": true,\\n \\\"confirms\\\": 3,\\n \\\"preConfirms\\\": 1,\\n \\\"contractAddress\\\": \\\"\\\",\\n \\\"withdrawPrecision\\\": 8,\\n \\\"maxWithdraw\\\": null,\\n \\\"maxDeposit\\\": null,\\n \\\"needTag\\\": false,\\n \\\"chainId\\\": \\\"btc\\\"\\n },\\n {\\n \\\"chainName\\\": \\\"Lightning Network\\\",\\n \\\"withdrawalMinSize\\\": \\\"0.00001\\\",\\n \\\"depositMinSize\\\": \\\"0.00001\\\",\\n \\\"withdrawFeeRate\\\": \\\"0\\\",\\n \\\"withdrawalMinFee\\\": \\\"0.000015\\\",\\n \\\"isWithdrawEnabled\\\": true,\\n \\\"isDepositEnabled\\\": true,\\n \\\"confirms\\\": 1,\\n \\\"preConfirms\\\": 1,\\n \\\"contractAddress\\\": \\\"\\\",\\n \\\"withdrawPrecision\\\": 8,\\n \\\"maxWithdraw\\\": null,\\n \\\"maxDeposit\\\": \\\"0.03\\\",\\n \\\"needTag\\\": false,\\n \\\"chainId\\\": \\\"btcln\\\"\\n },\\n {\\n \\\"chainName\\\": \\\"KCC\\\",\\n \\\"withdrawalMinSize\\\": \\\"0.0008\\\",\\n \\\"depositMinSize\\\": null,\\n \\\"withdrawFeeRate\\\": \\\"0\\\",\\n \\\"withdrawalMinFee\\\": \\\"0.00002\\\",\\n \\\"isWithdrawEnabled\\\": true,\\n \\\"isDepositEnabled\\\": true,\\n \\\"confirms\\\": 20,\\n \\\"preConfirms\\\": 20,\\n \\\"contractAddress\\\": \\\"0xfa93c12cd345c658bc4644d1d4e1b9615952258c\\\",\\n \\\"withdrawPrecision\\\": 8,\\n \\\"maxWithdraw\\\": null,\\n \\\"maxDeposit\\\": null,\\n \\\"needTag\\\": false,\\n \\\"chainId\\\": \\\"kcc\\\"\\n },\\n {\\n \\\"chainName\\\": \\\"BTC-Segwit\\\",\\n \\\"withdrawalMinSize\\\": \\\"0.0008\\\",\\n \\\"depositMinSize\\\": \\\"0.0002\\\",\\n \\\"withdrawFeeRate\\\": \\\"0\\\",\\n \\\"withdrawalMinFee\\\": \\\"0.0005\\\",\\n \\\"isWithdrawEnabled\\\": false,\\n \\\"isDepositEnabled\\\": true,\\n \\\"confirms\\\": 2,\\n \\\"preConfirms\\\": 2,\\n \\\"contractAddress\\\": \\\"\\\",\\n \\\"withdrawPrecision\\\": 8,\\n \\\"maxWithdraw\\\": null,\\n \\\"maxDeposit\\\": null,\\n \\\"needTag\\\": false,\\n \\\"chainId\\\": \\\"bech32\\\"\\n }\\n ]\\n },\\n {\\n \\\"currency\\\": \\\"BTCP\\\",\\n \\\"name\\\": \\\"BTCP\\\",\\n \\\"fullName\\\": \\\"Bitcoin Private\\\",\\n \\\"precision\\\": 8,\\n \\\"confirms\\\": null,\\n \\\"contractAddress\\\": null,\\n \\\"isMarginEnabled\\\": false,\\n \\\"isDebitEnabled\\\": false,\\n \\\"chains\\\": [\\n {\\n \\\"chainName\\\": \\\"BTCP\\\",\\n \\\"withdrawalMinSize\\\": \\\"0.100000\\\",\\n \\\"depositMinSize\\\": null,\\n \\\"withdrawFeeRate\\\": \\\"0\\\",\\n \\\"withdrawalMinFee\\\": \\\"0.010000\\\",\\n \\\"isWithdrawEnabled\\\": false,\\n \\\"isDepositEnabled\\\": false,\\n \\\"confirms\\\": 6,\\n \\\"preConfirms\\\": 6,\\n \\\"contractAddress\\\": \\\"\\\",\\n \\\"withdrawPrecision\\\": 8,\\n \\\"maxWithdraw\\\": null,\\n \\\"maxDeposit\\\": null,\\n \\\"needTag\\\": false,\\n \\\"chainId\\\": \\\"btcp\\\"\\n }\\n ]\\n }\\n ]\\n}" + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": [\\n {\\n \\\"currency\\\": \\\"BTC\\\",\\n \\\"name\\\": \\\"BTC\\\",\\n \\\"fullName\\\": \\\"Bitcoin\\\",\\n \\\"precision\\\": 8,\\n \\\"confirms\\\": null,\\n \\\"contractAddress\\\": null,\\n \\\"isMarginEnabled\\\": true,\\n \\\"isDebitEnabled\\\": true,\\n \\\"chains\\\": [\\n {\\n \\\"chainName\\\": \\\"BTC\\\",\\n \\\"withdrawalMinSize\\\": \\\"0.001\\\",\\n \\\"depositMinSize\\\": \\\"0.0002\\\",\\n \\\"withdrawFeeRate\\\": \\\"0\\\",\\n \\\"withdrawalMinFee\\\": \\\"0.0005\\\",\\n \\\"isWithdrawEnabled\\\": true,\\n \\\"isDepositEnabled\\\": true,\\n \\\"confirms\\\": 3,\\n \\\"preConfirms\\\": 1,\\n \\\"contractAddress\\\": \\\"\\\",\\n \\\"withdrawPrecision\\\": 8,\\n \\\"maxWithdraw\\\": null,\\n \\\"maxDeposit\\\": null,\\n \\\"needTag\\\": false,\\n \\\"chainId\\\": \\\"btc\\\"\\n },\\n {\\n \\\"chainName\\\": \\\"Lightning Network\\\",\\n \\\"withdrawalMinSize\\\": \\\"0.00001\\\",\\n \\\"depositMinSize\\\": \\\"0.00001\\\",\\n \\\"withdrawFeeRate\\\": \\\"0\\\",\\n \\\"withdrawalMinFee\\\": \\\"0.000015\\\",\\n \\\"isWithdrawEnabled\\\": true,\\n \\\"isDepositEnabled\\\": true,\\n \\\"confirms\\\": 1,\\n \\\"preConfirms\\\": 1,\\n \\\"contractAddress\\\": \\\"\\\",\\n \\\"withdrawPrecision\\\": 8,\\n \\\"maxWithdraw\\\": null,\\n \\\"maxDeposit\\\": \\\"0.03\\\",\\n \\\"needTag\\\": false,\\n \\\"chainId\\\": \\\"btcln\\\"\\n },\\n {\\n \\\"chainName\\\": \\\"KCC\\\",\\n \\\"withdrawalMinSize\\\": \\\"0.0008\\\",\\n \\\"depositMinSize\\\": null,\\n \\\"withdrawFeeRate\\\": \\\"0\\\",\\n \\\"withdrawalMinFee\\\": \\\"0.00002\\\",\\n \\\"isWithdrawEnabled\\\": true,\\n \\\"isDepositEnabled\\\": true,\\n \\\"confirms\\\": 20,\\n \\\"preConfirms\\\": 20,\\n \\\"contractAddress\\\": \\\"0xfa93c12cd345c658bc4644d1d4e1b9615952258c\\\",\\n \\\"withdrawPrecision\\\": 8,\\n \\\"maxWithdraw\\\": null,\\n \\\"maxDeposit\\\": null,\\n \\\"needTag\\\": false,\\n \\\"chainId\\\": \\\"kcc\\\"\\n },\\n {\\n \\\"chainName\\\": \\\"BTC-Segwit\\\",\\n \\\"withdrawalMinSize\\\": \\\"0.0008\\\",\\n \\\"depositMinSize\\\": \\\"0.0002\\\",\\n \\\"withdrawFeeRate\\\": \\\"0\\\",\\n \\\"withdrawalMinFee\\\": \\\"0.0005\\\",\\n \\\"isWithdrawEnabled\\\": false,\\n \\\"isDepositEnabled\\\": true,\\n \\\"confirms\\\": 2,\\n \\\"preConfirms\\\": 2,\\n \\\"contractAddress\\\": \\\"\\\",\\n \\\"withdrawPrecision\\\": 8,\\n \\\"maxWithdraw\\\": null,\\n \\\"maxDeposit\\\": null,\\n \\\"needTag\\\": false,\\n \\\"chainId\\\": \\\"bech32\\\"\\n }\\n ]\\n },\\n {\\n \\\"currency\\\": \\\"BTCP\\\",\\n \\\"name\\\": \\\"BTCP\\\",\\n \\\"fullName\\\": \\\"Bitcoin Private\\\",\\n \\\"precision\\\": 8,\\n \\\"confirms\\\": null,\\n \\\"contractAddress\\\": null,\\n \\\"isMarginEnabled\\\": false,\\n \\\"isDebitEnabled\\\": false,\\n \\\"chains\\\": [\\n {\\n \\\"chainName\\\": \\\"BTCP\\\",\\n \\\"withdrawalMinSize\\\": \\\"0.100000\\\",\\n \\\"depositMinSize\\\": null,\\n \\\"withdrawFeeRate\\\": \\\"0\\\",\\n \\\"withdrawalMinFee\\\": \\\"0.010000\\\",\\n \\\"isWithdrawEnabled\\\": false,\\n \\\"isDepositEnabled\\\": false,\\n \\\"confirms\\\": 6,\\n \\\"preConfirms\\\": 6,\\n \\\"contractAddress\\\": \\\"\\\",\\n \\\"withdrawPrecision\\\": 8,\\n \\\"maxWithdraw\\\": null,\\n \\\"maxDeposit\\\": null,\\n \\\"needTag\\\": false,\\n \\\"chainId\\\": \\\"btcp\\\"\\n }\\n ]\\n }\\n ]\\n}", + "operationId": "003" } }, "/api/v2/symbols/{symbol}": { @@ -975,7 +978,8 @@ "x-sdk-method-description": "Request via this endpoint to get detail currency pairs for trading. If you want to get the market information of the trading symbol, please use Get All Tickers.", "x-api-rate-limit": 4, "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"symbol\\\":\\\"BTC-USDT\\\",\\\"name\\\":\\\"BTC-USDT\\\",\\\"baseCurrency\\\":\\\"BTC\\\",\\\"quoteCurrency\\\":\\\"USDT\\\",\\\"feeCurrency\\\":\\\"USDT\\\",\\\"market\\\":\\\"USDS\\\",\\\"baseMinSize\\\":\\\"0.00001\\\",\\\"quoteMinSize\\\":\\\"0.1\\\",\\\"baseMaxSize\\\":\\\"10000000000\\\",\\\"quoteMaxSize\\\":\\\"99999999\\\",\\\"baseIncrement\\\":\\\"0.00000001\\\",\\\"quoteIncrement\\\":\\\"0.000001\\\",\\\"priceIncrement\\\":\\\"0.1\\\",\\\"priceLimitRate\\\":\\\"0.1\\\",\\\"minFunds\\\":\\\"0.1\\\",\\\"isMarginEnabled\\\":true,\\\"enableTrading\\\":true,\\\"feeCategory\\\":1,\\\"makerFeeCoefficient\\\":\\\"1.00\\\",\\\"takerFeeCoefficient\\\":\\\"1.00\\\",\\\"st\\\":false}}", - "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\"}" + "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\"}", + "operationId": "004" } }, "/api/v2/symbols": { @@ -1183,7 +1187,8 @@ "x-sdk-method-description": "Request via this endpoint to get a list of available currency pairs for trading. If you want to get the market information of the trading symbol, please use Get All Tickers.", "x-api-rate-limit": 4, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": [\\n {\\n \\\"symbol\\\": \\\"BTC-USDT\\\",\\n \\\"name\\\": \\\"BTC-USDT\\\",\\n \\\"baseCurrency\\\": \\\"BTC\\\",\\n \\\"quoteCurrency\\\": \\\"USDT\\\",\\n \\\"feeCurrency\\\": \\\"USDT\\\",\\n \\\"market\\\": \\\"USDS\\\",\\n \\\"baseMinSize\\\": \\\"0.00001\\\",\\n \\\"quoteMinSize\\\": \\\"0.1\\\",\\n \\\"baseMaxSize\\\": \\\"10000000000\\\",\\n \\\"quoteMaxSize\\\": \\\"99999999\\\",\\n \\\"baseIncrement\\\": \\\"0.00000001\\\",\\n \\\"quoteIncrement\\\": \\\"0.000001\\\",\\n \\\"priceIncrement\\\": \\\"0.1\\\",\\n \\\"priceLimitRate\\\": \\\"0.1\\\",\\n \\\"minFunds\\\": \\\"0.1\\\",\\n \\\"isMarginEnabled\\\": true,\\n \\\"enableTrading\\\": true,\\n \\\"feeCategory\\\": 1,\\n \\\"makerFeeCoefficient\\\": \\\"1.00\\\",\\n \\\"takerFeeCoefficient\\\": \\\"1.00\\\",\\n \\\"st\\\": false\\n }\\n ]\\n}", - "x-request-example": "{\\\"market\\\": \\\"ALTS\\\"}" + "x-request-example": "{\\\"market\\\": \\\"ALTS\\\"}", + "operationId": "005" } }, "/api/v1/market/orderbook/level1": { @@ -1284,7 +1289,8 @@ "x-sdk-method-description": "Request via this endpoint to get Level 1 Market Data. The returned value includes the best bid price and size, the best ask price and size as well as the last traded price and the last traded size.", "x-api-rate-limit": 2, "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"time\\\":1729172965609,\\\"sequence\\\":\\\"14609309753\\\",\\\"price\\\":\\\"67269\\\",\\\"size\\\":\\\"0.000025\\\",\\\"bestBid\\\":\\\"67267.5\\\",\\\"bestBidSize\\\":\\\"0.000025\\\",\\\"bestAsk\\\":\\\"67267.6\\\",\\\"bestAskSize\\\":\\\"1.24808993\\\"}}", - "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\"}" + "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\"}", + "operationId": "006" } }, "/api/v1/market/allTickers": { @@ -1472,7 +1478,8 @@ "x-sdk-method-name": "getAllTickers", "x-sdk-method-description": "Request market tickers for all the trading pairs in the market (including 24h volume), takes a snapshot every 2 seconds. On the rare occasion that we will change the currency name, if you still want the changed symbol name, you can use the symbolName field instead of the symbol field via “Get all tickers” endpoint.", "x-api-rate-limit": 15, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"time\\\": 1729173207043,\\n \\\"ticker\\\": [\\n {\\n \\\"symbol\\\": \\\"BTC-USDT\\\",\\n \\\"symbolName\\\": \\\"BTC-USDT\\\",\\n \\\"buy\\\": \\\"67192.5\\\",\\n \\\"bestBidSize\\\": \\\"0.000025\\\",\\n \\\"sell\\\": \\\"67192.6\\\",\\n \\\"bestAskSize\\\": \\\"1.24949204\\\",\\n \\\"changeRate\\\": \\\"-0.0014\\\",\\n \\\"changePrice\\\": \\\"-98.5\\\",\\n \\\"high\\\": \\\"68321.4\\\",\\n \\\"low\\\": \\\"66683.3\\\",\\n \\\"vol\\\": \\\"1836.03034612\\\",\\n \\\"volValue\\\": \\\"124068431.06726933\\\",\\n \\\"last\\\": \\\"67193\\\",\\n \\\"averagePrice\\\": \\\"67281.21437289\\\",\\n \\\"takerFeeRate\\\": \\\"0.001\\\",\\n \\\"makerFeeRate\\\": \\\"0.001\\\",\\n \\\"takerCoefficient\\\": \\\"1\\\",\\n \\\"makerCoefficient\\\": \\\"1\\\"\\n }\\n ]\\n }\\n}" + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"time\\\": 1729173207043,\\n \\\"ticker\\\": [\\n {\\n \\\"symbol\\\": \\\"BTC-USDT\\\",\\n \\\"symbolName\\\": \\\"BTC-USDT\\\",\\n \\\"buy\\\": \\\"67192.5\\\",\\n \\\"bestBidSize\\\": \\\"0.000025\\\",\\n \\\"sell\\\": \\\"67192.6\\\",\\n \\\"bestAskSize\\\": \\\"1.24949204\\\",\\n \\\"changeRate\\\": \\\"-0.0014\\\",\\n \\\"changePrice\\\": \\\"-98.5\\\",\\n \\\"high\\\": \\\"68321.4\\\",\\n \\\"low\\\": \\\"66683.3\\\",\\n \\\"vol\\\": \\\"1836.03034612\\\",\\n \\\"volValue\\\": \\\"124068431.06726933\\\",\\n \\\"last\\\": \\\"67193\\\",\\n \\\"averagePrice\\\": \\\"67281.21437289\\\",\\n \\\"takerFeeRate\\\": \\\"0.001\\\",\\n \\\"makerFeeRate\\\": \\\"0.001\\\",\\n \\\"takerCoefficient\\\": \\\"1\\\",\\n \\\"makerCoefficient\\\": \\\"1\\\"\\n }\\n ]\\n }\\n}", + "operationId": "007" } }, "/api/v1/market/histories": { @@ -1577,7 +1584,8 @@ "x-sdk-method-description": "Request via this endpoint to get the trade history of the specified symbol, the returned quantity is the last 100 transaction records.", "x-api-rate-limit": 3, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": [\\n {\\n \\\"sequence\\\": \\\"10976028003549185\\\",\\n \\\"price\\\": \\\"67122\\\",\\n \\\"size\\\": \\\"0.000025\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"time\\\": 1729177117877000000\\n },\\n {\\n \\\"sequence\\\": \\\"10976028003549188\\\",\\n \\\"price\\\": \\\"67122\\\",\\n \\\"size\\\": \\\"0.01792257\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"time\\\": 1729177117877000000\\n },\\n {\\n \\\"sequence\\\": \\\"10976028003549191\\\",\\n \\\"price\\\": \\\"67122.9\\\",\\n \\\"size\\\": \\\"0.05654289\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"time\\\": 1729177117877000000\\n }\\n ]\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\"}" + "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\"}", + "operationId": "008" } }, "/api/v1/market/candles": { @@ -1759,7 +1767,8 @@ "x-sdk-method-description": "Get the Kline of the symbol. Data are returned in grouped buckets based on requested type. For each query, the system would return at most 1500 pieces of data. To obtain more data, please page the data by time.", "x-api-rate-limit": 3, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": [\\n [\\n \\\"1566789720\\\",\\n \\\"10411.5\\\",\\n \\\"10401.9\\\",\\n \\\"10411.5\\\",\\n \\\"10396.3\\\",\\n \\\"29.11357276\\\",\\n \\\"302889.301529914\\\"\\n ],\\n [\\n \\\"1566789660\\\",\\n \\\"10416\\\",\\n \\\"10411.5\\\",\\n \\\"10422.3\\\",\\n \\\"10411.5\\\",\\n \\\"15.61781842\\\",\\n \\\"162703.708997029\\\"\\n ],\\n [\\n \\\"1566789600\\\",\\n \\\"10408.6\\\",\\n \\\"10416\\\",\\n \\\"10416\\\",\\n \\\"10405.4\\\",\\n \\\"12.45584973\\\",\\n \\\"129666.51508559\\\"\\n ]\\n ]\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"type\\\": \\\"1min\\\", \\\"startAt\\\": 1566703297, \\\"endAt\\\": 1566789757}" + "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"type\\\": \\\"1min\\\", \\\"startAt\\\": 1566703297, \\\"endAt\\\": 1566789757}", + "operationId": "009" } }, "/api/v1/market/orderbook/level2_{size}": { @@ -1863,7 +1872,8 @@ "x-sdk-method-description": "Query for part orderbook depth data. (aggregated by price) You are recommended to request via this endpoint as the system reponse would be faster and cosume less traffic.", "x-api-rate-limit": 2, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"time\\\": 1729176273859,\\n \\\"sequence\\\": \\\"14610502970\\\",\\n \\\"bids\\\": [\\n [\\n \\\"66976.4\\\",\\n \\\"0.69109872\\\"\\n ],\\n [\\n \\\"66976.3\\\",\\n \\\"0.14377\\\"\\n ]\\n ],\\n \\\"asks\\\": [\\n [\\n \\\"66976.5\\\",\\n \\\"0.05408199\\\"\\n ],\\n [\\n \\\"66976.8\\\",\\n \\\"0.0005\\\"\\n ]\\n ]\\n }\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"size\\\": \\\"20\\\"}" + "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"size\\\": \\\"20\\\"}", + "operationId": "010" } }, "/api/v3/market/orderbook/level2": { @@ -1958,7 +1968,8 @@ "x-sdk-method-description": "Query for Full orderbook depth data. (aggregated by price) It is generally used by professional traders because it uses more server resources and traffic, and we have strict access rate limit control. To maintain up-to-date Order Book, please use Websocket incremental feed after retrieving the OrderBook.", "x-api-rate-limit": 3, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"time\\\": 1729176273859,\\n \\\"sequence\\\": \\\"14610502970\\\",\\n \\\"bids\\\": [\\n [\\n \\\"66976.4\\\",\\n \\\"0.69109872\\\"\\n ],\\n [\\n \\\"66976.3\\\",\\n \\\"0.14377\\\"\\n ]\\n ],\\n \\\"asks\\\": [\\n [\\n \\\"66976.5\\\",\\n \\\"0.05408199\\\"\\n ],\\n [\\n \\\"66976.8\\\",\\n \\\"0.0005\\\"\\n ]\\n ]\\n }\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\"}" + "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\"}", + "operationId": "011" } }, "/api/v1/prices": { @@ -5616,7 +5627,8 @@ "x-sdk-method-description": "Request via this endpoint to get the fiat price of the currencies for the available trading pairs.", "x-api-rate-limit": 3, "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"AGLD\\\":\\\"1.1174410000000001\\\",\\\"DFI\\\":\\\"0.0168915500000000\\\",\\\"PYTHUP\\\":\\\"0.0397880960000000\\\",\\\"ISLM\\\":\\\"0.0606196750000000\\\",\\\"NEAR\\\":\\\"4.7185395500000000\\\",\\\"AIOZ\\\":\\\"0.4862867350000000\\\",\\\"AUDIO\\\":\\\"0.1219390000000000\\\",\\\"BBL\\\":\\\"0.0067766100000000\\\",\\\"WLD\\\":\\\"2.2893547500000000\\\",\\\"HNT\\\":\\\"5.8990489999999984\\\",\\\"ETHFI\\\":\\\"1.5892050000000000\\\",\\\"DMAIL\\\":\\\"0.2726636000000000\\\",\\\"OPUP\\\":\\\"0.0986506500000000\\\",\\\"VET3S\\\":\\\"0.0003700448850000\\\",\\\"MANA3S\\\":\\\"0.0006056970000000\\\",\\\"TIDAL\\\":\\\"0.0001154422500000\\\",\\\"HALO\\\":\\\"0.0058270850000000\\\",\\\"OPUL\\\":\\\"0.0839480050000000\\\",\\\"MANA3L\\\":\\\"0.0029569407900000\\\",\\\"DGB\\\":\\\"0.0066556705000000\\\",\\\"AA\\\":\\\"0.2406796000000000\\\",\\\"BCH\\\":\\\"366.2167999999996484\\\",\\\"GMEE\\\":\\\"0.0113333305000000\\\",\\\"JST\\\":\\\"0.0302348750000000\\\",\\\"PBUX\\\":\\\"0.0208795550000000\\\",\\\"AR\\\":\\\"18.5457224999999909\\\",\\\"SEI\\\":\\\"0.4332832500000000\\\",\\\"PSTAKE\\\":\\\"0.0493153300000000\\\",\\\"LMWR\\\":\\\"0.1618190500000000\\\",\\\"UNFIDOWN\\\":\\\"0.0062058955000000\\\",\\\"BB\\\":\\\"0.3245376500000000\\\",\\\"JTO\\\":\\\"2.1239375000000002\\\",\\\"WEMIX\\\":\\\"0.7916040000000000\\\",\\\"G\\\":\\\"0.0324037900000000\\\",\\\"MARSH\\\":\\\"0.0617591050000000\\\",\\\"BN\\\":\\\"0.0036961510000000\\\",\\\"FLIP\\\":\\\"1.0976509000000000\\\",\\\"FLR\\\":\\\"0.0144827550000000\\\",\\\"BIGTIME\\\":\\\"0.1238780300000000\\\",\\\"FLY\\\":\\\"0.0005157420000000\\\",\\\"T\\\":\\\"0.0233483200000000\\\",\\\"W\\\":\\\"0.2865566500000000\\\",\\\"BDX\\\":\\\"0.0774012800000000\\\",\\\"BABYDOGE\\\":\\\"0.0000000029375305\\\",\\\"SFP\\\":\\\"0.7256370000000000\\\",\\\"DIA\\\":\\\"0.9179408000000000\\\",\\\"ISME\\\":\\\"0.0022388800000000\\\",\\\"LYM\\\":\\\"0.0010155919500000\\\",\\\"VET3L\\\":\\\"0.0000289755050000\\\",\\\"JUP\\\":\\\"0.8230882500000000\\\",\\\"LYX\\\":\\\"1.4501745500000001\\\",\\\"AIEPK\\\":\\\"0.0050094940000000\\\",\\\"SILLY\\\":\\\"0.0159420250000000\\\",\\\"SCPT\\\":\\\"0.0122038950000000\\\",\\\"WOO\\\":\\\"0.1796601250000000\\\",\\\"BLUR\\\":\\\"0.2462768000000000\\\",\\\"STRK\\\":\\\"0.3963117450000000\\\",\\\"BFC\\\":\\\"0.0383608100000000\\\",\\\"DC\\\":\\\"0.0003097450500000\\\",\\\"KARATE\\\":\\\"0.0007296350000000\\\",\\\"SUSHI3L\\\":\\\"0.5115441000000000\\\",\\\"NETVR\\\":\\\"0.0976111700000000\\\",\\\"WAVES\\\":\\\"1.0806594000000000\\\",\\\"LITH\\\":\\\"0.0001520239500000\\\",\\\"HAPI\\\":\\\"8.6533711499999987\\\",\\\"SUSHI3S\\\":\\\"1.2752620500000000\\\",\\\"CEEK\\\":\\\"0.0294852500000000\\\",\\\"FLOKI\\\":\\\"0.0001414292500000\\\",\\\"SHR\\\":\\\"0.0012463765000000\\\",\\\"SAND\\\":\\\"0.2566616050000000\\\",\\\"TURT\\\":\\\"0.0020889550000000\\\",\\\"UMA\\\":\\\"2.5207390000000000\\\",\\\"BEPRO\\\":\\\"0.0003955021500000\\\",\\\"SCRT\\\":\\\"0.1995002000000000\\\",\\\"TUSD\\\":\\\"0.9945025000000000\\\",\\\"COOKIE\\\":\\\"0.0220089900000000\\\",\\\"LRDS\\\":\\\"0.6218889000000000\\\",\\\"SIN\\\":\\\"0.0033633175000000\\\",\\\"OAS\\\":\\\"0.0331933950000000\\\",\\\"ROOT\\\":\\\"0.0183108400000000\\\",\\\"ADA3L\\\":\\\"0.0046396790000000\\\",\\\"TIAUP\\\":\\\"0.1228385500000000\\\",\\\"HTR\\\":\\\"0.0353023400000000\\\",\\\"UNB\\\":\\\"0.0003837080500000\\\",\\\"UNA\\\":\\\"0.0164917500000000\\\",\\\"HARD\\\":\\\"0.1087056200000000\\\",\\\"G3\\\":\\\"0.0502648550000000\\\",\\\"ADA3S\\\":\\\"0.0006191202850000\\\",\\\"MYRO\\\":\\\"0.1071863800000000\\\",\\\"HTX\\\":\\\"0.0000013693150000\\\",\\\"FT\\\":\\\"0.3585206500000000\\\",\\\"BTCDOWN\\\":\\\"0.1065467000000000\\\",\\\"UNI\\\":\\\"7.3571195999999993\\\",\\\"FX\\\":\\\"0.1379310000000000\\\",\\\"OBI\\\":\\\"0.0079030465000000\\\",\\\"UNO\\\":\\\"0.0137131400000000\\\",\\\"WRX\\\":\\\"0.1221389000000000\\\",\\\"TIADOWN\\\":\\\"0.0000914642450000\\\",\\\"ETHDOWN\\\":\\\"0.1306346500000000\\\",\\\"WELL\\\":\\\"0.0471244260000000\\\",\\\"SWFTC\\\":\\\"0.0028966509500000\\\",\\\"SKL\\\":\\\"0.0362418700000000\\\",\\\"UOS\\\":\\\"0.0867765900000000\\\",\\\"AIPAD\\\":\\\"0.0478660550000000\\\",\\\"BRETT\\\":\\\"0.1037481000000000\\\",\\\"SKY\\\":\\\"0.0520139800000000\\\",\\\"FRM\\\":\\\"0.0153123400000000\\\",\\\"VISION\\\":\\\"0.0014451770500000\\\",\\\"LENDS\\\":\\\"0.0047276350000000\\\",\\\"SLF\\\":\\\"0.3318340000000000\\\",\\\"BULL\\\":\\\"0.0023988000000000\\\",\\\"FLOW\\\":\\\"0.5372312500000000\\\",\\\"ODDZ\\\":\\\"0.0063368300000000\\\",\\\"SLN\\\":\\\"0.2804597000000000\\\",\\\"UPO\\\":\\\"0.0440779500000000\\\",\\\"SLP\\\":\\\"0.0023997995000000\\\",\\\"ID\\\":\\\"0.3718140000000000\\\",\\\"SLIM\\\":\\\"0.0906446550000000\\\",\\\"SPOT\\\":\\\"0.0021289350000000\\\",\\\"DOP\\\":\\\"0.0023028480000000\\\",\\\"ISSP\\\":\\\"0.0000874562500000\\\",\\\"UQC\\\":\\\"3.2339822000000003\\\",\\\"IO\\\":\\\"1.8185902499999999\\\",\\\"DOT\\\":\\\"4.2022978000000005\\\",\\\"1INCH\\\":\\\"0.2645676500000000\\\",\\\"SMH\\\":\\\"0.3448275000000000\\\",\\\"MAK\\\":\\\"0.0396701550000000\\\",\\\"TOKO\\\":\\\"0.0005923037000000\\\",\\\"TURBO\\\":\\\"0.0108085930000000\\\",\\\"UNFI\\\":\\\"2.8555714999999996\\\",\\\"MAN\\\":\\\"0.0210764565000000\\\",\\\"EVER\\\":\\\"0.0332733550000000\\\",\\\"FTM\\\":\\\"0.7259068650000000\\\",\\\"SHRAP\\\":\\\"0.0476361700000000\\\",\\\"MAV\\\":\\\"0.1738130500000000\\\",\\\"MAX\\\":\\\"0.2864966800000000\\\",\\\"DPR\\\":\\\"0.0018240875000000\\\",\\\"FTT\\\":\\\"2.0559715000000002\\\",\\\"ARKM\\\":\\\"1.7444273499999999\\\",\\\"ATOM\\\":\\\"4.2954512000000002\\\",\\\"PENDLE\\\":\\\"4.1554212500000007\\\",\\\"QUICK\\\":\\\"0.0365317250000000\\\",\\\"BLZ\\\":\\\"0.1217191100000000\\\",\\\"BOBA\\\":\\\"0.2014092450000000\\\",\\\"MBL\\\":\\\"0.0027856065000000\\\",\\\"OFN\\\":\\\"0.1252373500000000\\\",\\\"UNIO\\\":\\\"0.0025487250000000\\\",\\\"SNS\\\":\\\"0.0200899500000000\\\",\\\"SNX\\\":\\\"1.4282854999999999\\\",\\\"NXRA\\\":\\\"0.0272763550000000\\\",\\\"TAIKO\\\":\\\"1.4392800000000001\\\",\\\"AVAX3L\\\":\\\"0.1410875109550000\\\",\\\"L3\\\":\\\"0.0608395650000000\\\",\\\"API3\\\":\\\"1.3728132500000001\\\",\\\"XRP3S\\\":\\\"0.0028095945000000\\\",\\\"QKC\\\":\\\"0.0085157400000000\\\",\\\"AVAX3S\\\":\\\"0.5148424500000000\\\",\\\"ROSE\\\":\\\"0.0693453100000000\\\",\\\"SATS\\\":\\\"0.0000002701648500\\\",\\\"BMX\\\":\\\"0.3100449000000000\\\",\\\"PORTAL\\\":\\\"0.2811593500000000\\\",\\\"TOMI\\\":\\\"0.0309045400000000\\\",\\\"XRP3L\\\":\\\"2.1586201500000002\\\",\\\"SOL\\\":\\\"151.7250995000003583\\\",\\\"SON\\\":\\\"0.0002421788500000\\\",\\\"BNC\\\":\\\"0.1882058500000000\\\",\\\"SOCIAL\\\":\\\"0.0026486750000000\\\",\\\"CGPT\\\":\\\"0.1305147100000000\\\",\\\"CELR\\\":\\\"0.0127736100000000\\\",\\\"BNB\\\":\\\"591.0973035000118935\\\",\\\"OGN\\\":\\\"0.0852573500000000\\\",\\\"CELO\\\":\\\"0.7711142500000000\\\",\\\"AUCTION\\\":\\\"13.1634150000000014\\\",\\\"MANTA\\\":\\\"0.7564216000000000\\\",\\\"LAYER\\\":\\\"0.0372713550000000\\\",\\\"AERO\\\":\\\"1.3783104999999999\\\",\\\"CETUS\\\":\\\"0.1808295400000000\\\",\\\"LL\\\":\\\"0.0201199350000000\\\",\\\"SPA\\\":\\\"0.0067426270000000\\\",\\\"PYTHDOWN\\\":\\\"0.0011834080000000\\\",\\\"NEIROCTO\\\":\\\"0.0019964013000000\\\",\\\"UTK\\\":\\\"0.0365217300000000\\\",\\\"GMRX\\\":\\\"0.0007386305000000\\\",\\\"BOB\\\":\\\"0.0000380619595000\\\",\\\"HOTCROSS\\\":\\\"0.0056491740000000\\\",\\\"AERGO\\\":\\\"0.1007595950000000\\\",\\\"MOCA\\\":\\\"0.0783608000000000\\\",\\\"SQD\\\":\\\"0.0380809500000000\\\",\\\"MV\\\":\\\"0.0081359300000000\\\",\\\"BNB3L\\\":\\\"0.2761618500000000\\\",\\\"BNB3S\\\":\\\"0.0008545725000000\\\",\\\"GALAX3L\\\":\\\"0.0057571999600000\\\",\\\"KAI\\\":\\\"0.0020080954500000\\\",\\\"SQR\\\":\\\"0.0470764500000000\\\",\\\"GALAX3S\\\":\\\"0.1933033000000000\\\",\\\"EGLD\\\":\\\"25.5272299999999713\\\",\\\"ZBCN\\\":\\\"0.0010404795000000\\\",\\\"KAS\\\":\\\"0.1216691350000000\\\",\\\"MEW\\\":\\\"0.0086176890000000\\\",\\\"PUNDIX\\\":\\\"0.4130933500000000\\\",\\\"LOOKS\\\":\\\"0.0392803500000000\\\",\\\"FXS\\\":\\\"1.9060465000000000\\\",\\\"BOSON\\\":\\\"0.2732633000000000\\\",\\\"BRISE\\\":\\\"0.0000000860569500\\\",\\\"AEVO\\\":\\\"0.3388305000000000\\\",\\\"FLUX\\\":\\\"0.5276360500000000\\\",\\\"PRCL\\\":\\\"0.1969015000000000\\\",\\\"UNFIUP\\\":\\\"0.0011654170000000\\\",\\\"SEIDOWN\\\":\\\"0.0442778500000000\\\",\\\"DOAI\\\":\\\"0.0052363805000000\\\",\\\"QNT\\\":\\\"65.4312679999998206\\\",\\\"REDO\\\":\\\"0.2837580500000000\\\",\\\"STRIKE\\\":\\\"6.8225869999999997\\\",\\\"ETHW\\\":\\\"3.2418782499999998\\\",\\\"OM\\\":\\\"1.5396797750000000\\\",\\\"OP\\\":\\\"1.6911539999999999\\\",\\\"WHALE\\\":\\\"0.8134930500000000\\\",\\\"1CAT\\\":\\\"0.0018460765000000\\\",\\\"NEON\\\":\\\"0.4446775500000000\\\",\\\"GTAI\\\":\\\"0.7786105000000000\\\",\\\"SSV\\\":\\\"21.2393749999999841\\\",\\\"ETH2\\\":\\\"2601.6678843156403923\\\",\\\"KCS\\\":\\\"8.7646155000000020\\\",\\\"ARPA\\\":\\\"0.0393882960000000\\\",\\\"ARTFI\\\":\\\"0.0141029450000000\\\",\\\"BRL\\\":\\\"0.1742807323452485\\\",\\\"ALEX\\\":\\\"0.0924537500000000\\\",\\\"STG\\\":\\\"0.2943527500000000\\\",\\\"SHIB\\\":\\\"0.0000178060925000\\\",\\\"IOTX\\\":\\\"0.0394202800000000\\\",\\\"OLE\\\":\\\"0.0171414250000000\\\",\\\"KDA\\\":\\\"0.5653172000000000\\\",\\\"CERE\\\":\\\"0.0022548720000000\\\",\\\"DOCK\\\":\\\"0.0018990500000000\\\",\\\"STX\\\":\\\"1.8157916500000000\\\",\\\"OLT\\\":\\\"0.0007596200000000\\\",\\\"QI\\\":\\\"0.0131754090000000\\\",\\\"SDAO\\\":\\\"0.2748625000000000\\\",\\\"BLAST\\\":\\\"0.0087636160000000\\\",\\\"LINK3S\\\":\\\"0.0000702948350000\\\",\\\"IOST\\\":\\\"0.0049745115000000\\\",\\\"SUI\\\":\\\"2.0589700000000000\\\",\\\"CAKE\\\":\\\"1.7941024999999999\\\",\\\"BSW\\\":\\\"0.0586706500000000\\\",\\\"OMG\\\":\\\"0.2597700500000000\\\",\\\"VOLT\\\":\\\"0.0000002716641000\\\",\\\"LINK3L\\\":\\\"1.3408292499999999\\\",\\\"GEEQ\\\":\\\"0.0385607100000000\\\",\\\"PYUSD\\\":\\\"0.9988003500000000\\\",\\\"SUN\\\":\\\"0.0186106900000000\\\",\\\"TOWER\\\":\\\"0.0014812590000000\\\",\\\"BTC\\\":\\\"67133.4165000832051564\\\",\\\"IOTA\\\":\\\"0.1189405000000000\\\",\\\"REEF\\\":\\\"0.0019960015000000\\\",\\\"TRIAS\\\":\\\"3.3683149999999998\\\",\\\"KEY\\\":\\\"0.0037594713240047\\\",\\\"ETH3L\\\":\\\"0.0003305946200000\\\",\\\"BTT\\\":\\\"0.0000009117439000\\\",\\\"ONE\\\":\\\"0.0132003965000000\\\",\\\"RENDER\\\":\\\"5.2263854999999995\\\",\\\"ETH3S\\\":\\\"0.5517240000000000\\\",\\\"ANKR\\\":\\\"0.0264867500000000\\\",\\\"ALGO\\\":\\\"0.1188405500000000\\\",\\\"SYLO\\\":\\\"0.0007600198000000\\\",\\\"ZCX\\\":\\\"0.0784707450000000\\\",\\\"SD\\\":\\\"0.3851073500000000\\\",\\\"ONT\\\":\\\"0.1877960550000000\\\",\\\"MJT\\\":\\\"0.0132433750000000\\\",\\\"DYM\\\":\\\"1.6659666000000001\\\",\\\"DYP\\\":\\\"0.0205397250000000\\\",\\\"BAKEUP\\\":\\\"0.0389894955000000\\\",\\\"OOE\\\":\\\"0.0079360300000000\\\",\\\"ZELIX\\\":\\\"0.0000649675000000\\\",\\\"DOGE3L\\\":\\\"0.3837080500000000\\\",\\\"ARTY\\\":\\\"0.3980009000000000\\\",\\\"QORPO\\\":\\\"0.1204297550000000\\\",\\\"ICE\\\":\\\"0.0051504235000000\\\",\\\"NOTAI\\\":\\\"0.0000892753400000\\\",\\\"DOGE3S\\\":\\\"0.2291853500000000\\\",\\\"NAKA\\\":\\\"1.0695649500000000\\\",\\\"GALAX\\\":\\\"0.0212893500000000\\\",\\\"MKR\\\":\\\"1245.8767500000163833\\\",\\\"DODO\\\":\\\"0.1152423500000000\\\",\\\"ICP\\\":\\\"7.6731615000000027\\\",\\\"ZEC\\\":\\\"35.9400209999999543\\\",\\\"ZEE\\\":\\\"0.0065767100000000\\\",\\\"ICX\\\":\\\"0.1383308000000000\\\",\\\"KMNO\\\":\\\"0.0921499020000000\\\",\\\"TT\\\":\\\"0.0033883050000000\\\",\\\"DOT3L\\\":\\\"0.1454272500000000\\\",\\\"XAI\\\":\\\"0.2038980000000000\\\",\\\"ZEN\\\":\\\"8.0149905000000007\\\",\\\"DOGE\\\":\\\"0.1213093150000000\\\",\\\"ALPHA\\\":\\\"0.0567416150000000\\\",\\\"DUSK\\\":\\\"0.1964517250000000\\\",\\\"DOT3S\\\":\\\"0.0053613180000000\\\",\\\"SXP\\\":\\\"0.2538730000000000\\\",\\\"HBAR\\\":\\\"0.0510044850000000\\\",\\\"SYNT\\\":\\\"0.0467166300000000\\\",\\\"ZEX\\\":\\\"0.0571714000000000\\\",\\\"BONDLY\\\":\\\"0.0022208890000000\\\",\\\"MLK\\\":\\\"0.2080859050000000\\\",\\\"KICKS\\\":\\\"0.0001301249050000\\\",\\\"PEPE\\\":\\\"0.0000100249850000\\\",\\\"OUSD\\\":\\\"0.9982006500000000\\\",\\\"LUNCDOWN\\\":\\\"0.0000733333150000\\\",\\\"DOGS\\\":\\\"0.0007086455000000\\\",\\\"REV3L\\\":\\\"0.0094672640000000\\\",\\\"CTSI\\\":\\\"0.1257371000000000\\\",\\\"C98\\\":\\\"0.1219390000000000\\\",\\\"OSMO\\\":\\\"0.5370313500000000\\\",\\\"NTRN\\\":\\\"0.3869064500000000\\\",\\\"CFX2S\\\":\\\"0.0084757600000000\\\",\\\"SYN\\\":\\\"0.5636180500000000\\\",\\\"VIDT\\\":\\\"0.0308745550000000\\\",\\\"SYS\\\":\\\"0.0997501000000000\\\",\\\"GAS\\\":\\\"4.3029474500000008\\\",\\\"BOME\\\":\\\"0.0087336310000000\\\",\\\"COMBO\\\":\\\"0.4068964500000000\\\",\\\"XCH\\\":\\\"14.9825050000000010\\\",\\\"VR\\\":\\\"0.0063538215000000\\\",\\\"CFX2L\\\":\\\"0.0499660045000000\\\",\\\"VSYS\\\":\\\"0.0005201398000000\\\",\\\"PANDORA\\\":\\\"1629.2949450001102772\\\",\\\"THETA\\\":\\\"1.2461766000000000\\\",\\\"XCN\\\":\\\"0.0012699647000000\\\",\\\"NEXG\\\":\\\"0.0039180400000000\\\",\\\"MELOS\\\":\\\"0.0021244372500000\\\",\\\"XCV\\\":\\\"0.0013253370000000\\\",\\\"ORN\\\":\\\"0.8797599000000000\\\",\\\"WLKN\\\":\\\"0.0010624685000000\\\",\\\"AAVE\\\":\\\"154.2708259999996162\\\",\\\"MNT\\\":\\\"0.6168914000000000\\\",\\\"BONK\\\":\\\"0.0000227296295000\\\",\\\"PERP\\\":\\\"0.6037979500000000\\\",\\\"XDC\\\":\\\"0.0276361750000000\\\",\\\"MNW\\\":\\\"0.3681158500000000\\\",\\\"XDB\\\":\\\"0.0002578710000000\\\",\\\"BOND\\\":\\\"1.5662165000000000\\\",\\\"SUIA\\\":\\\"0.0809595000000000\\\",\\\"MOG\\\":\\\"0.0000019330330000\\\",\\\"SUTER\\\":\\\"0.0001840079500000\\\",\\\"TIME\\\":\\\"16.2648634999999969\\\",\\\"RACA\\\":\\\"0.0001949025000000\\\",\\\"BICO\\\":\\\"0.2021988500000000\\\",\\\"MON\\\":\\\"0.1066466500000000\\\",\\\"SWEAT\\\":\\\"0.0063718125000000\\\",\\\"MOXIE\\\":\\\"0.0022088950000000\\\",\\\"BABYBNB\\\":\\\"0.0289755050000000\\\",\\\"IGU\\\":\\\"0.0050674650000000\\\",\\\"HMSTR\\\":\\\"0.0037990995000000\\\",\\\"XEC\\\":\\\"0.0000354722550000\\\",\\\"MONI\\\":\\\"0.0058470750000000\\\",\\\"XR\\\":\\\"0.2374812000000000\\\",\\\"PEOPLE\\\":\\\"0.0796601500000000\\\",\\\"PUMLX\\\":\\\"0.0054572700000000\\\",\\\"ZIL\\\":\\\"0.0145927000000000\\\",\\\"WLDDOWN\\\":\\\"0.2089954500000000\\\",\\\"VAI\\\":\\\"0.0799999800000000\\\",\\\"XEN\\\":\\\"0.0000000839580000\\\",\\\"MPC\\\":\\\"0.1001499000000000\\\",\\\"XEM\\\":\\\"0.0176951480000000\\\",\\\"JASMY3S\\\":\\\"0.0019670160000000\\\",\\\"OTK\\\":\\\"0.0290464695000000\\\",\\\"TRAC\\\":\\\"0.4521738000000000\\\",\\\"DFYN\\\":\\\"0.0070664650000000\\\",\\\"BIDP\\\":\\\"0.0001939030000000\\\",\\\"JASMY3L\\\":\\\"0.0001653772700000\\\",\\\"INJDOWN\\\":\\\"0.0000194902500000\\\",\\\"KLV\\\":\\\"0.0019310340000000\\\",\\\"WAXL\\\":\\\"0.7858069000000000\\\",\\\"TRBDOWN\\\":\\\"0.0023138425000000\\\",\\\"BCH3L\\\":\\\"4.6390663064999996\\\",\\\"GMT3S\\\":\\\"0.0000457771000000\\\",\\\"KMD\\\":\\\"0.2493752500000000\\\",\\\"BCH3S\\\":\\\"0.9634180500000000\\\",\\\"ECOX\\\":\\\"0.0987506000000000\\\",\\\"AAVE3S\\\":\\\"0.0560719500000000\\\",\\\"GMT3L\\\":\\\"0.0053983694650000\\\",\\\"EPIK\\\":\\\"0.0045857060000000\\\",\\\"SUIP\\\":\\\"0.1067565950000000\\\",\\\"AAVE3L\\\":\\\"0.3638687346200000\\\",\\\"ZK\\\":\\\"0.1262368500000000\\\",\\\"ZKF\\\":\\\"0.0008595700000000\\\",\\\"OMNIA\\\":\\\"0.7624186000000000\\\",\\\"ZKJ\\\":\\\"1.1124435000000000\\\",\\\"ZKL\\\":\\\"0.1255372000000000\\\",\\\"GAFI\\\":\\\"3.0634675000000001\\\",\\\"CARV\\\":\\\"0.8703646000000000\\\",\\\"KNC\\\":\\\"0.4433782000000000\\\",\\\"CATS\\\":\\\"0.0000599700000000\\\",\\\"PROM\\\":\\\"5.2833570000000006\\\",\\\"ALEPH\\\":\\\"0.1756121500000000\\\",\\\"PONKE\\\":\\\"0.3958020000000000\\\",\\\"OVR\\\":\\\"0.1553223000000000\\\",\\\"CATI\\\":\\\"0.4105146400000000\\\",\\\"ORDER\\\":\\\"0.1183008200000000\\\",\\\"GFT\\\":\\\"0.0166616650000000\\\",\\\"BIFI\\\":\\\"0.0020489750000000\\\",\\\"GGC\\\":\\\"6.9965029985000000\\\",\\\"GGG\\\":\\\"0.0403798000000000\\\",\\\"DAPPX\\\":\\\"0.0043788095000000\\\",\\\"SUKU\\\":\\\"0.0618790450000000\\\",\\\"ULTI\\\":\\\"0.0168015950000000\\\",\\\"CREDI\\\":\\\"0.0192903500000000\\\",\\\"ERTHA\\\":\\\"0.0010014990000000\\\",\\\"FURY\\\":\\\"0.1405297000000000\\\",\\\"KARRAT\\\":\\\"0.5577210000000000\\\",\\\"MOBILE\\\":\\\"0.0009005495000000\\\",\\\"SIDUS\\\":\\\"0.0037671155000000\\\",\\\"NAVI\\\":\\\"0.1254672350000000\\\",\\\"TAO\\\":\\\"583.4081500000051807\\\",\\\"USDJ\\\":\\\"1.1386304000000001\\\",\\\"MTL\\\":\\\"0.9563216000000000\\\",\\\"VET\\\":\\\"0.0225387250000000\\\",\\\"FITFI\\\":\\\"0.0036421780000000\\\",\\\"USDT\\\":\\\"0.9995000000000000\\\",\\\"OXT\\\":\\\"0.0695652000000000\\\",\\\"CANDY\\\":\\\"0.0005597200000000\\\",\\\"USDP\\\":\\\"0.9932031500000000\\\",\\\"MTS\\\":\\\"0.0027516235000000\\\",\\\"TADA\\\":\\\"0.0283858000000000\\\",\\\"MTV\\\":\\\"0.0006559718500000\\\",\\\"NAVX\\\":\\\"0.1342228550000000\\\",\\\"ILV\\\":\\\"35.6771524999999671\\\",\\\"VINU\\\":\\\"0.0000000109045450\\\",\\\"GHX\\\":\\\"0.0903548000000000\\\",\\\"EDU\\\":\\\"0.5167415000000000\\\",\\\"HYVE\\\":\\\"0.0137331300000000\\\",\\\"BTC3L\\\":\\\"0.0058620675000000\\\",\\\"ANYONE\\\":\\\"0.9015490000000000\\\",\\\"BEAT\\\":\\\"0.0012593700000000\\\",\\\"KING\\\":\\\"0.0004821588000000\\\",\\\"CREAM\\\":\\\"15.6541689999999973\\\",\\\"CAS\\\":\\\"0.0038590695000000\\\",\\\"IMX\\\":\\\"1.4944524000000000\\\",\\\"CAT\\\":\\\"0.0000256981445000\\\",\\\"BTC3S\\\":\\\"0.0014142925000000\\\",\\\"USDE\\\":\\\"0.9985005000000000\\\",\\\"USDD\\\":\\\"1.0000997000000000\\\",\\\"CWAR\\\":\\\"0.0037981000000000\\\",\\\"USDC\\\":\\\"0.9997998500000000\\\",\\\"KRL\\\":\\\"0.3543127550000000\\\",\\\"INJ\\\":\\\"21.7691100000000194\\\",\\\"GAME\\\":\\\"0.0139630150000000\\\",\\\"TRIBL\\\":\\\"1.0994500000000000\\\",\\\"XLM\\\":\\\"0.0948525500000000\\\",\\\"TRBUP\\\":\\\"0.0012293850000000\\\",\\\"VRADOWN\\\":\\\"0.0013433280000000\\\",\\\"SUPER\\\":\\\"1.2853570000000000\\\",\\\"EIGEN\\\":\\\"3.1536223999999999\\\",\\\"IOI\\\":\\\"0.0146926500000000\\\",\\\"KSM\\\":\\\"17.5212350000000129\\\",\\\"CCD\\\":\\\"0.0034832575000000\\\",\\\"EGO\\\":\\\"0.0093553200000000\\\",\\\"EGP\\\":\\\"2.7946019999999998\\\",\\\"MXC\\\":\\\"0.0066866550000000\\\",\\\"TEL\\\":\\\"0.0014432780000000\\\",\\\"MOVR\\\":\\\"9.1340307000000027\\\",\\\"XMR\\\":\\\"155.5421899999990755\\\",\\\"MXM\\\":\\\"0.0092853550000000\\\",\\\"OORT\\\":\\\"0.1099949750000000\\\",\\\"GLM\\\":\\\"0.3231383500000000\\\",\\\"RAY\\\":\\\"2.0228880499999998\\\",\\\"XTAG\\\":\\\"0.0218190850000000\\\",\\\"GLQ\\\":\\\"0.0854572500000000\\\",\\\"CWEB\\\":\\\"0.0038480750000000\\\",\\\"REVU\\\":\\\"0.0105047450000000\\\",\\\"REVV\\\":\\\"0.0039760110000000\\\",\\\"ZRO\\\":\\\"3.7952014499999994\\\",\\\"XNL\\\":\\\"0.0093853050000000\\\",\\\"XNO\\\":\\\"0.8496749500000000\\\",\\\"SAROS\\\":\\\"0.0019290350000000\\\",\\\"KACE\\\":\\\"2.1165411999999998\\\",\\\"ZRX\\\":\\\"0.3186406000000000\\\",\\\"WLTH\\\":\\\"0.0374312750000000\\\",\\\"ATOM3L\\\":\\\"0.0321719060000000\\\",\\\"GMM\\\":\\\"0.0001497251000000\\\",\\\"BEER\\\":\\\"0.0000138670630000\\\",\\\"GMT\\\":\\\"0.1275362000000000\\\",\\\"HEART\\\":\\\"0.0159920000000000\\\",\\\"GMX\\\":\\\"22.7186349999999882\\\",\\\"ABBC\\\":\\\"0.0061769100000000\\\",\\\"OMNI\\\":\\\"8.9235359999999970\\\",\\\"ATOM3S\\\":\\\"0.0007945225400000\\\",\\\"IRL\\\":\\\"0.0099650150000000\\\",\\\"CFG\\\":\\\"0.3248375000000000\\\",\\\"WSDM\\\":\\\"0.0139830050000000\\\",\\\"GNS\\\":\\\"1.8390800000000001\\\",\\\"VANRY\\\":\\\"0.0809295150000000\\\",\\\"CFX\\\":\\\"0.1595202000000000\\\",\\\"GRAIL\\\":\\\"817.1212349999937891\\\",\\\"BEFI\\\":\\\"0.0175712100000000\\\",\\\"VELO\\\":\\\"0.0132043945000000\\\",\\\"XPR\\\":\\\"0.0008077959000000\\\",\\\"DOVI\\\":\\\"0.0584707500000000\\\",\\\"ACE\\\":\\\"0.0021349320000000\\\",\\\"ACH\\\":\\\"0.0190534685000000\\\",\\\"ISP\\\":\\\"0.0012161916000000\\\",\\\"XCAD\\\":\\\"0.2834582000000000\\\",\\\"MINA\\\":\\\"0.5630183500000000\\\",\\\"TIA\\\":\\\"5.9318325999999999\\\",\\\"DRIFT\\\":\\\"0.4350823500000000\\\",\\\"ACQ\\\":\\\"0.0056981495000000\\\",\\\"ACS\\\":\\\"0.0014917537500000\\\",\\\"MIND\\\":\\\"0.0018920535000000\\\",\\\"STORE\\\":\\\"0.0062358805000000\\\",\\\"REN\\\":\\\"0.0351224300000000\\\",\\\"ELA\\\":\\\"1.7282354500000000\\\",\\\"DREAMS\\\":\\\"0.0002498750000000\\\",\\\"ADA\\\":\\\"0.3463267500000000\\\",\\\"ELF\\\":\\\"0.3777110500000000\\\",\\\"REQ\\\":\\\"0.0959919800000000\\\",\\\"STORJ\\\":\\\"0.5662167500000000\\\",\\\"LADYS\\\":\\\"0.0000000837581000\\\",\\\"PAXG\\\":\\\"2697.9303600003123340\\\",\\\"REZ\\\":\\\"0.0409795000000000\\\",\\\"XRD\\\":\\\"0.0157821050000000\\\",\\\"CHO\\\":\\\"0.0205097400000000\\\",\\\"CHR\\\":\\\"0.1769115000000000\\\",\\\"ADS\\\":\\\"0.1889055000000000\\\",\\\"CHZ\\\":\\\"0.0738030800000000\\\",\\\"ADX\\\":\\\"0.1575212000000000\\\",\\\"XRP\\\":\\\"0.5525036100000000\\\",\\\"JASMY\\\":\\\"0.0188615645000000\\\",\\\"KAGI\\\":\\\"0.1834582250000000\\\",\\\"FIDA\\\":\\\"0.2282858000000000\\\",\\\"PBR\\\":\\\"0.0291953950000000\\\",\\\"AEG\\\":\\\"0.0093453250000000\\\",\\\"H2O\\\":\\\"0.1610194500000000\\\",\\\"CHMB\\\":\\\"0.0001715641750000\\\",\\\"SAND3L\\\":\\\"0.0015447972150000\\\",\\\"PBX\\\":\\\"0.0006879558500000\\\",\\\"SOLVE\\\":\\\"0.0084557700000000\\\",\\\"DECHAT\\\":\\\"0.1512243500000000\\\",\\\"GARI\\\":\\\"0.0076861550000000\\\",\\\"SHIB2L\\\":\\\"1.1996998499999999\\\",\\\"SHIB2S\\\":\\\"0.0240879500000000\\\",\\\"ENA\\\":\\\"0.3942028000000000\\\",\\\"VEMP\\\":\\\"0.0029335325000000\\\",\\\"ENJ\\\":\\\"0.1467266000000000\\\",\\\"AFG\\\":\\\"0.0072163900000000\\\",\\\"RATS\\\":\\\"0.0001211593900000\\\",\\\"GRT\\\":\\\"0.1646076550000000\\\",\\\"FORWARD\\\":\\\"0.0012873560000000\\\",\\\"TFUEL\\\":\\\"0.0598800450000000\\\",\\\"ENS\\\":\\\"17.0634640000000052\\\",\\\"KASDOWN\\\":\\\"0.0258770550000000\\\",\\\"XTM\\\":\\\"0.0251074400000000\\\",\\\"DEGEN\\\":\\\"0.0084857550000000\\\",\\\"TLM\\\":\\\"0.0100449750000000\\\",\\\"DYDXDOWN\\\":\\\"0.1042598440000000\\\",\\\"CKB\\\":\\\"0.0146026950000000\\\",\\\"LUNC\\\":\\\"0.0000889255150000\\\",\\\"AURORA\\\":\\\"0.1204397500000000\\\",\\\"LUNA\\\":\\\"0.3624187000000000\\\",\\\"XTZ\\\":\\\"0.6776610000000000\\\",\\\"ELON\\\":\\\"0.0000001410294500\\\",\\\"DMTR\\\":\\\"0.0891554000000000\\\",\\\"EOS\\\":\\\"0.4759619000000000\\\",\\\"GST\\\":\\\"0.0118940500000000\\\",\\\"FORT\\\":\\\"0.1155422000000000\\\",\\\"FLAME\\\":\\\"0.0247076400000000\\\",\\\"PATEX\\\":\\\"0.9605195000000000\\\",\\\"DEEP\\\":\\\"0.0328885475000000\\\",\\\"ID3L\\\":\\\"0.0016201895000000\\\",\\\"GTC\\\":\\\"0.6625685500000000\\\",\\\"ID3S\\\":\\\"0.0071674145000000\\\",\\\"RIO\\\":\\\"0.7616190000000000\\\",\\\"CLH\\\":\\\"0.0008555720000000\\\",\\\"BURGER\\\":\\\"0.4016990500000000\\\",\\\"VRA\\\":\\\"0.0029765110000000\\\",\\\"SUNDOG\\\":\\\"0.2173912500000000\\\",\\\"GTT\\\":\\\"0.0002038980000000\\\",\\\"INJUP\\\":\\\"0.2327835500000000\\\",\\\"CPOOL\\\":\\\"0.1557720750000000\\\",\\\"EPX\\\":\\\"0.0000740629500000\\\",\\\"CLV\\\":\\\"0.0329835000000000\\\",\\\"FEAR\\\":\\\"0.0560519600000000\\\",\\\"MEME\\\":\\\"0.0124847545000000\\\",\\\"ROOBEE\\\":\\\"0.0004520738500000\\\",\\\"DEFI\\\":\\\"0.0192903500000000\\\",\\\"TOKEN\\\":\\\"0.0477361200000000\\\",\\\"GRAPE\\\":\\\"0.0020599695000000\\\",\\\"KASUP\\\":\\\"0.3996001000000000\\\",\\\"XWG\\\":\\\"0.0003843077500000\\\",\\\"SKEY\\\":\\\"0.0621289200000000\\\",\\\"SFUND\\\":\\\"1.3243375000000000\\\",\\\"EQX\\\":\\\"0.0032823580000000\\\",\\\"ORDIUP\\\":\\\"0.0548315705000000\\\",\\\"TON\\\":\\\"5.1857058499999995\\\",\\\"DEGO\\\":\\\"2.2667660500000001\\\",\\\"IZI\\\":\\\"0.0088455750000000\\\",\\\"ERG\\\":\\\"0.6605695500000000\\\",\\\"ERN\\\":\\\"1.9255367500000001\\\",\\\"VENOM\\\":\\\"0.0817591000000000\\\",\\\"VOXEL\\\":\\\"0.1497251000000000\\\",\\\"RLC\\\":\\\"1.4649671500000000\\\",\\\"PHA\\\":\\\"0.1093453000000000\\\",\\\"DYDXUP\\\":\\\"0.0112573685000000\\\",\\\"APE3S\\\":\\\"0.0008475760000000\\\",\\\"ORBS\\\":\\\"0.0288955450000000\\\",\\\"OPDOWN\\\":\\\"0.6758619000000000\\\",\\\"ESE\\\":\\\"0.0139130400000000\\\",\\\"APE3L\\\":\\\"0.1339330000000000\\\",\\\"HMND\\\":\\\"0.0982208650000000\\\",\\\"COQ\\\":\\\"0.0000014432780000\\\",\\\"AURY\\\":\\\"0.3340329000000000\\\",\\\"CULT\\\":\\\"0.0000028025980000\\\",\\\"AKT\\\":\\\"2.4642672500000001\\\",\\\"GLMR\\\":\\\"0.1606196500000000\\\",\\\"XYM\\\":\\\"0.0142528700000000\\\",\\\"ORAI\\\":\\\"6.1769100000000012\\\",\\\"XYO\\\":\\\"0.0058680645000000\\\",\\\"ETC\\\":\\\"18.8458723500000169\\\",\\\"LAI\\\":\\\"0.0142828550000000\\\",\\\"PIP\\\":\\\"0.0178310800000000\\\",\\\"ETH\\\":\\\"2607.6655149998362673\\\",\\\"NEO\\\":\\\"10.3575186499999991\\\",\\\"RMV\\\":\\\"0.0081659150000000\\\",\\\"KLAY\\\":\\\"0.1251374000000000\\\",\\\"PIT\\\":\\\"0.0000000003268365\\\",\\\"TARA\\\":\\\"0.0043978000000000\\\",\\\"KALT\\\":\\\"0.1128735350000000\\\",\\\"PIX\\\":\\\"0.0001023687900000\\\",\\\"ETN\\\":\\\"0.0021579205000000\\\",\\\"CSIX\\\":\\\"0.0141729100000000\\\",\\\"TRADE\\\":\\\"0.4708644500000000\\\",\\\"MAVIA\\\":\\\"1.3592200500000001\\\",\\\"HIGH\\\":\\\"1.3043474999999999\\\",\\\"TRB\\\":\\\"62.5387150000000006\\\",\\\"ORDI\\\":\\\"35.7421200000000126\\\",\\\"TRVL\\\":\\\"0.0373643085000000\\\",\\\"AMB\\\":\\\"0.0059670150000000\\\",\\\"TRU\\\":\\\"0.0762018800000000\\\",\\\"LOGX\\\":\\\"0.0271963950000000\\\",\\\"FINC\\\":\\\"0.0362018900000000\\\",\\\"INFRA\\\":\\\"0.1978010500000000\\\",\\\"NATIX\\\":\\\"0.0008729633000000\\\",\\\"NFP\\\":\\\"0.2152923000000000\\\",\\\"TRY\\\":\\\"0.0292166033323590\\\",\\\"TRX\\\":\\\"0.1597201000000000\\\",\\\"LBP\\\":\\\"0.0001243378000000\\\",\\\"LBR\\\":\\\"0.0595702000000000\\\",\\\"EUL\\\":\\\"2.9735125000000000\\\",\\\"NFT\\\":\\\"0.0000004077960000\\\",\\\"SEIUP\\\":\\\"0.0478110825000000\\\",\\\"PUFFER\\\":\\\"0.3676161000000000\\\",\\\"EUR\\\":\\\"1.0811249323958897\\\",\\\"ORCA\\\":\\\"2.0664662499999999\\\",\\\"NEAR3L\\\":\\\"0.0117010765350000\\\",\\\"AMP\\\":\\\"0.0038330825000000\\\",\\\"XDEFI\\\":\\\"0.0472563600000000\\\",\\\"HIFI\\\":\\\"0.4947525000000000\\\",\\\"TRUF\\\":\\\"0.0459570100000000\\\",\\\"AITECH\\\":\\\"0.1045477000000000\\\",\\\"AMU\\\":\\\"0.0043978000000000\\\",\\\"USTC\\\":\\\"0.0214692600000000\\\",\\\"KNGL\\\":\\\"0.0499750000000000\\\",\\\"FOXY\\\":\\\"0.0102686631000000\\\",\\\"NGC\\\":\\\"0.0147935995000000\\\",\\\"TENET\\\":\\\"0.0043278350000000\\\",\\\"NEAR3S\\\":\\\"0.0072553705000000\\\",\\\"MAHA\\\":\\\"1.1904045000000000\\\",\\\"NGL\\\":\\\"0.0701748950000000\\\",\\\"TST\\\":\\\"0.0080359800000000\\\",\\\"HIPPO\\\":\\\"0.0104447750000000\\\",\\\"AXS3S\\\":\\\"0.0308705570000000\\\",\\\"CRO\\\":\\\"0.0781409100000000\\\",\\\"ZPAY\\\":\\\"0.0050574700000000\\\",\\\"MNDE\\\":\\\"0.1026786350000000\\\",\\\"CRV\\\":\\\"0.2534732000000000\\\",\\\"SWASH\\\":\\\"0.0056271850000000\\\",\\\"AXS3L\\\":\\\"0.0106388779000000\\\",\\\"VERSE\\\":\\\"0.0001803098000000\\\",\\\"RPK\\\":\\\"0.0049975000000000\\\",\\\"RPL\\\":\\\"10.9745099999999958\\\",\\\"AZERO\\\":\\\"0.3789104500000000\\\",\\\"SOUL\\\":\\\"0.0534332700000000\\\",\\\"VXV\\\":\\\"0.2619689500000000\\\",\\\"LDO\\\":\\\"1.0885554500000000\\\",\\\"MAGIC\\\":\\\"0.3390304000000000\\\",\\\"ALICE\\\":\\\"1.0324835000000000\\\",\\\"SEAM\\\":\\\"1.1933030499999999\\\",\\\"PLU\\\":\\\"1.9300345000000001\\\",\\\"AOG\\\":\\\"0.0031224380000000\\\",\\\"SMOLE\\\":\\\"0.0000387806000000\\\",\\\"EWT\\\":\\\"1.1094450000000000\\\",\\\"TSUGT\\\":\\\"0.0029185400000000\\\",\\\"PMG\\\":\\\"0.0800599500000000\\\",\\\"OPAI\\\":\\\"0.0006826585000000\\\",\\\"LOCUS\\\":\\\"0.0216591650000000\\\",\\\"CTA\\\":\\\"0.0825087250000000\\\",\\\"NIM\\\":\\\"0.0013673160000000\\\",\\\"CTC\\\":\\\"0.4033982000000000\\\",\\\"APE\\\":\\\"0.7035480500000000\\\",\\\"MERL\\\":\\\"0.2720639000000000\\\",\\\"JAM\\\":\\\"0.0004770613500000\\\",\\\"CTI\\\":\\\"0.0130314810000000\\\",\\\"APP\\\":\\\"0.0021989000000000\\\",\\\"APT\\\":\\\"9.9947001500000000\\\",\\\"WLDUP\\\":\\\"0.0093043455000000\\\",\\\"ZEND\\\":\\\"0.1280759300000000\\\",\\\"FIRE\\\":\\\"0.9113441000000000\\\",\\\"DENT\\\":\\\"0.0008630682500000\\\",\\\"PYTH\\\":\\\"0.3390603850000000\\\",\\\"LFT\\\":\\\"0.0155322300000000\\\",\\\"DPET\\\":\\\"0.0319040400000000\\\",\\\"ORDIDOWN\\\":\\\"0.3788105000000000\\\",\\\"KPOL\\\":\\\"0.0029175405000000\\\",\\\"ETHUP\\\":\\\"8.4971493000000032\\\",\\\"BAND\\\":\\\"1.0939527500000001\\\",\\\"POL\\\":\\\"0.3656171000000000\\\",\\\"ASTR\\\":\\\"0.0582608550000000\\\",\\\"NKN\\\":\\\"0.0691654000000000\\\",\\\"RSR\\\":\\\"0.0068055955000000\\\",\\\"DVPN\\\":\\\"0.0005979009000000\\\",\\\"TWT\\\":\\\"1.1119437500000000\\\",\\\"ARB\\\":\\\"0.5510243500000000\\\",\\\"CVC\\\":\\\"0.1409801746501747\\\",\\\"ARC\\\":\\\"0.0300849500000000\\\",\\\"XETA\\\":\\\"0.0022888550000000\\\",\\\"MTRG\\\":\\\"0.4007995000000000\\\",\\\"LOKA\\\":\\\"0.1867066000000000\\\",\\\"LPOOL\\\":\\\"0.0660069800000000\\\",\\\"TURBOS\\\":\\\"0.0034812585000000\\\",\\\"CVX\\\":\\\"1.7816087499999999\\\",\\\"ARX\\\":\\\"0.0007556220000000\\\",\\\"MPLX\\\":\\\"0.4355221300000000\\\",\\\"SUSHI\\\":\\\"0.7011492500000000\\\",\\\"NLK\\\":\\\"0.0114442750000000\\\",\\\"PEPE2\\\":\\\"0.0000000313843000\\\",\\\"WBTC\\\":\\\"66881.4425499645548419\\\",\\\"SUI3L\\\":\\\"0.0211204345000000\\\",\\\"CWS\\\":\\\"0.1927036000000000\\\",\\\"SUI3S\\\":\\\"0.0000579110300000\\\",\\\"INSP\\\":\\\"0.0264167850000000\\\",\\\"MANA\\\":\\\"0.2945026750000000\\\",\\\"VRTX\\\":\\\"0.0641679000000000\\\",\\\"CSPR\\\":\\\"0.0116441750000000\\\",\\\"ATA\\\":\\\"0.0785007300000000\\\",\\\"OPEN\\\":\\\"0.0080049955000000\\\",\\\"HAI\\\":\\\"0.0448275750000000\\\",\\\"NMR\\\":\\\"14.7436245000000072\\\",\\\"ATH\\\":\\\"0.0540929400000000\\\",\\\"LIT\\\":\\\"0.6282857000000000\\\",\\\"TLOS\\\":\\\"0.3263467450000000\\\",\\\"TNSR\\\":\\\"0.3662168000000000\\\",\\\"CXT\\\":\\\"0.0871364100000000\\\",\\\"POLYX\\\":\\\"0.2346826000000000\\\",\\\"ZERO\\\":\\\"0.0002507745500000\\\",\\\"ROUTE\\\":\\\"0.0610694500000000\\\",\\\"LOOM\\\":\\\"0.0580009850000000\\\",\\\"PRE\\\":\\\"0.0078680640000000\\\",\\\"VRAUP\\\":\\\"0.0134652640000000\\\",\\\"HBB\\\":\\\"0.0714742450000000\\\",\\\"RVN\\\":\\\"0.0165017450000000\\\",\\\"PRQ\\\":\\\"0.0715741950000000\\\",\\\"ONDO\\\":\\\"0.7134930750000000\\\",\\\"PEPEDOWN\\\":\\\"0.0000155022450000\\\",\\\"WOOP\\\":\\\"0.0020179905000000\\\",\\\"LUNCUP\\\":\\\"0.0168355780000000\\\",\\\"KAVA\\\":\\\"0.3522238000000000\\\",\\\"LKI\\\":\\\"0.0104187880000000\\\",\\\"AVA\\\":\\\"0.4857570000000000\\\",\\\"NOM\\\":\\\"0.0233883000000000\\\",\\\"MAPO\\\":\\\"0.0089015470000000\\\",\\\"PEPEUP\\\":\\\"0.0114252845000000\\\",\\\"STRAX\\\":\\\"0.0487156300000000\\\",\\\"NOT\\\":\\\"0.0078670645000000\\\",\\\"ZERC\\\":\\\"0.1108245600000000\\\",\\\"BCUT\\\":\\\"0.0255672100000000\\\",\\\"MASA\\\":\\\"0.0691354150000000\\\",\\\"WAN\\\":\\\"0.1785077544737212\\\",\\\"WAT\\\":\\\"0.0003273762300000\\\",\\\"WAX\\\":\\\"0.0327636100000000\\\",\\\"MASK\\\":\\\"2.2259864500000002\\\",\\\"EOS3L\\\":\\\"0.0002122138400000\\\",\\\"IDEA\\\":\\\"0.0005887055000000\\\",\\\"EOS3S\\\":\\\"0.0034472755000000\\\",\\\"YFI\\\":\\\"4919.4290549999908843\\\",\\\"MOODENG\\\":\\\"0.0774612500000000\\\",\\\"XCUR\\\":\\\"0.0048845565000000\\\",\\\"HYDRA\\\":\\\"0.2225886500000000\\\",\\\"POPCAT\\\":\\\"1.3382305500000000\\\",\\\"LQTY\\\":\\\"0.7848074000000000\\\",\\\"PIXEL\\\":\\\"0.1406596350000000\\\",\\\"LMR\\\":\\\"0.0145437245000000\\\",\\\"ZETA\\\":\\\"0.5997999500000000\\\",\\\"YGG\\\":\\\"0.4717640000000000\\\",\\\"AXS\\\":\\\"4.6006985000000006\\\",\\\"BCHSV\\\":\\\"49.8250749999999370\\\",\\\"NRN\\\":\\\"0.0395802000000000\\\",\\\"FTON\\\":\\\"0.0091954000000000\\\",\\\"COMP\\\":\\\"43.6581599999999881\\\",\\\"XPRT\\\":\\\"0.1819090000000000\\\",\\\"HFT\\\":\\\"0.1443278000000000\\\",\\\"UXLINK\\\":\\\"0.5085456000000000\\\",\\\"STAMP\\\":\\\"0.0335032400000000\\\",\\\"RUNE\\\":\\\"4.9233370999999996\\\",\\\"ZEUS\\\":\\\"0.2587705500000000\\\",\\\"LTC3L\\\":\\\"1.8294848000000001\\\",\\\"DAPP\\\":\\\"0.1763118000000000\\\",\\\"FORTH\\\":\\\"2.9508238500000004\\\",\\\"ALPINE\\\":\\\"1.5322335000000000\\\",\\\"SENSO\\\":\\\"0.0328835500000000\\\",\\\"LTC3S\\\":\\\"0.0006986505000000\\\",\\\"DEXE\\\":\\\"8.3795081500000028\\\",\\\"GOAL\\\":\\\"0.0175912000000000\\\",\\\"AVAX\\\":\\\"27.5602130000000058\\\",\\\"LISTA\\\":\\\"0.3782108000000000\\\",\\\"AMPL\\\":\\\"1.3743124999999999\\\",\\\"WORK\\\":\\\"0.1384307500000000\\\",\\\"BRWL\\\":\\\"0.0017391300000000\\\",\\\"BANANA\\\":\\\"57.1314200000001362\\\",\\\"PUSH\\\":\\\"0.0750624500000000\\\",\\\"WEN\\\":\\\"0.0001015492000000\\\",\\\"NEIRO\\\":\\\"0.0879560000000000\\\",\\\"BTCUP\\\":\\\"34.7711057499999789\\\",\\\"SOL3S\\\":\\\"0.0007816090000000\\\",\\\"BRAWL\\\":\\\"0.0004776610500000\\\",\\\"LAY3R\\\":\\\"0.2161918500000000\\\",\\\"LPT\\\":\\\"11.9304317999999945\\\",\\\"GODS\\\":\\\"0.1807096000000000\\\",\\\"SAND3S\\\":\\\"4.6152911999999992\\\",\\\"RDNT\\\":\\\"0.0640679500000000\\\",\\\"SOL3L\\\":\\\"1.8351913752850000\\\",\\\"NIBI\\\":\\\"0.0653772950000000\\\",\\\"NUM\\\":\\\"0.0436181800000000\\\",\\\"PYR\\\":\\\"2.5590198499999997\\\",\\\"DAG\\\":\\\"0.0226176855000000\\\",\\\"DAI\\\":\\\"0.9989006596042375\\\",\\\"HIP\\\":\\\"0.0034982500000000\\\",\\\"DAO\\\":\\\"0.2848575000000000\\\",\\\"AVAIL\\\":\\\"0.1300929210000000\\\",\\\"DAR\\\":\\\"0.1512243500000000\\\",\\\"FET\\\":\\\"1.3760116500000000\\\",\\\"FCON\\\":\\\"0.0001197600900000\\\",\\\"XAVA\\\":\\\"0.3789104500000000\\\",\\\"LRC\\\":\\\"0.1208395500000000\\\",\\\"UNI3S\\\":\\\"0.0000653573050000\\\",\\\"PZP\\\":\\\"0.0599600050000000\\\",\\\"POKT\\\":\\\"0.0424787500000000\\\",\\\"DASH\\\":\\\"23.6881500000000109\\\",\\\"BAKEDOWN\\\":\\\"0.0003324636850000\\\",\\\"POLC\\\":\\\"0.0061389290000000\\\",\\\"DBR\\\":\\\"0.0377671070000000\\\",\\\"CIRUS\\\":\\\"0.0055772100000000\\\",\\\"UNI3L\\\":\\\"0.0993921490650000\\\",\\\"NWC\\\":\\\"0.0681659000000000\\\",\\\"POLK\\\":\\\"0.0142628650000000\\\",\\\"LSD\\\":\\\"0.9420287500000000\\\",\\\"MARS4\\\":\\\"0.0005878059500000\\\",\\\"LSK\\\":\\\"0.8080957500000000\\\",\\\"BLOCK\\\":\\\"0.0261869000000000\\\",\\\"ANALOS\\\":\\\"0.0000446776500000\\\",\\\"SAFE\\\":\\\"0.8779608000000000\\\",\\\"DCK\\\":\\\"0.0234082900000000\\\",\\\"LSS\\\":\\\"0.0562718500000000\\\",\\\"DCR\\\":\\\"12.4337799999999929\\\",\\\"LIKE\\\":\\\"0.0559720000000000\\\",\\\"DATA\\\":\\\"0.0361819000000000\\\",\\\"WIF\\\":\\\"2.5696145499999999\\\",\\\"BLOK\\\":\\\"0.0006546725000000\\\",\\\"LTC\\\":\\\"71.6261690000000611\\\",\\\"METIS\\\":\\\"42.0289750000000612\\\",\\\"WIN\\\":\\\"0.0000868365600000\\\",\\\"HLG\\\":\\\"0.0018790600000000\\\",\\\"LTO\\\":\\\"0.1166116650000000\\\",\\\"DYDX\\\":\\\"0.9341327000000000\\\",\\\"ARB3S\\\":\\\"0.0509025360000000\\\",\\\"MUBI\\\":\\\"0.0303848000000000\\\",\\\"ARB3L\\\":\\\"0.0025917035000000\\\",\\\"RBTC1\\\":\\\"0.0000039480250000\\\",\\\"POND\\\":\\\"0.0118640650000000\\\",\\\"LINA\\\":\\\"0.0037771105000000\\\",\\\"MYRIA\\\":\\\"0.0025337325000000\\\",\\\"LINK\\\":\\\"11.0244849999999944\\\",\\\"QTUM\\\":\\\"2.4262016723130069\\\",\\\"TUNE\\\":\\\"0.0148025950000000\\\",\\\"UFO\\\":\\\"0.0000006479758500\\\",\\\"CYBER\\\":\\\"2.8755615000000001\\\",\\\"WILD\\\":\\\"0.2433782500000000\\\",\\\"POLS\\\":\\\"0.2809594500000000\\\",\\\"NYM\\\":\\\"0.0719640000000000\\\",\\\"FIL\\\":\\\"3.6786597500000005\\\",\\\"BAL\\\":\\\"2.0099945000000000\\\",\\\"SCA\\\":\\\"0.3999999000000000\\\",\\\"STND\\\":\\\"0.0133123405000000\\\",\\\"WMTX\\\":\\\"0.2138930000000000\\\",\\\"SCLP\\\":\\\"0.1545227000000000\\\",\\\"MANEKI\\\":\\\"0.0073963000000000\\\",\\\"BAT\\\":\\\"0.1721139000000000\\\",\\\"AKRO\\\":\\\"0.0042302838000000\\\",\\\"FTM3L\\\":\\\"8.2574692000000024\\\",\\\"BAX\\\":\\\"0.0000709645000000\\\",\\\"FTM3S\\\":\\\"0.0000255072400000\\\",\\\"COTI\\\":\\\"0.0951524000000000\\\"}}", - "x-request-example": "{\\\"base\\\": \\\"USD\\\", \\\"currencies\\\": \\\"example_string_default_value\\\"}" + "x-request-example": "{\\\"base\\\": \\\"USD\\\", \\\"currencies\\\": \\\"example_string_default_value\\\"}", + "operationId": "012" } }, "/api/v1/market/stats": { @@ -5757,7 +5769,8 @@ "x-sdk-method-description": "Request via this endpoint to get the statistics of the specified ticker in the last 24 hours.", "x-api-rate-limit": 15, "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"time\\\":1729175612158,\\\"symbol\\\":\\\"BTC-USDT\\\",\\\"buy\\\":\\\"66982.4\\\",\\\"sell\\\":\\\"66982.5\\\",\\\"changeRate\\\":\\\"-0.0114\\\",\\\"changePrice\\\":\\\"-778.1\\\",\\\"high\\\":\\\"68107.7\\\",\\\"low\\\":\\\"66683.3\\\",\\\"vol\\\":\\\"1738.02898182\\\",\\\"volValue\\\":\\\"117321982.415978333\\\",\\\"last\\\":\\\"66981.5\\\",\\\"averagePrice\\\":\\\"67281.21437289\\\",\\\"takerFeeRate\\\":\\\"0.001\\\",\\\"makerFeeRate\\\":\\\"0.001\\\",\\\"takerCoefficient\\\":\\\"1\\\",\\\"makerCoefficient\\\":\\\"1\\\"}}", - "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\"}" + "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\"}", + "operationId": "013" } }, "/api/v1/markets": { @@ -5805,7 +5818,8 @@ "x-sdk-method-name": "getMarketList", "x-sdk-method-description": "Request via this endpoint to get the transaction currency for the entire trading market.", "x-api-rate-limit": 3, - "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":[\\\"USDS\\\",\\\"TON\\\",\\\"AI\\\",\\\"DePIN\\\",\\\"PoW\\\",\\\"BRC-20\\\",\\\"ETF\\\",\\\"KCS\\\",\\\"Meme\\\",\\\"Solana\\\",\\\"FIAT\\\",\\\"VR&AR\\\",\\\"DeFi\\\",\\\"Polkadot\\\",\\\"BTC\\\",\\\"ALTS\\\",\\\"Layer 1\\\"]}" + "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":[\\\"USDS\\\",\\\"TON\\\",\\\"AI\\\",\\\"DePIN\\\",\\\"PoW\\\",\\\"BRC-20\\\",\\\"ETF\\\",\\\"KCS\\\",\\\"Meme\\\",\\\"Solana\\\",\\\"FIAT\\\",\\\"VR&AR\\\",\\\"DeFi\\\",\\\"Polkadot\\\",\\\"BTC\\\",\\\"ALTS\\\",\\\"Layer 1\\\"]}", + "operationId": "014" } }, "/api/v1/timestamp": { @@ -5852,7 +5866,8 @@ "x-sdk-method-name": "getServerTime", "x-sdk-method-description": "Get the server time.", "x-api-rate-limit": 3, - "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":1729100692873}" + "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":1729100692873}", + "operationId": "015" } }, "/api/v1/status": { @@ -5933,7 +5948,8 @@ "x-sdk-method-name": "getServiceStatus", "x-sdk-method-description": "Get the service status", "x-api-rate-limit": 3, - "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"status\\\":\\\"open\\\",\\\"msg\\\":\\\"\\\"}}" + "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"status\\\":\\\"open\\\",\\\"msg\\\":\\\"\\\"}}", + "operationId": "016" } }, "/api/v1/bullet-public": { @@ -6033,7 +6049,8 @@ "x-sdk-method-name": "getPublicToken", "x-sdk-method-description": "This interface can obtain the token required for websocket to establish a Spot/Margin connection. If you need use public channels (e.g. all public market data), please make request as follows to obtain the server list and public token", "x-api-rate-limit": 10, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"token\\\": \\\"2neAiuYvAU61ZDXANAGAsiL4-iAExhsBXZxftpOeh_55i3Ysy2q2LEsEWU64mdzUOPusi34M_wGoSf7iNyEWJ93g2WHl-j4M7tCZ_S21PuIByWXUJFDywtiYB9J6i9GjsxUuhPw3Blq6rhZlGykT3Vp1phUafnulOOpts-MEmEF-3bpfetLOAq79RbGaLlE4JBvJHl5Vs9Y=.ymP9jIr6v-vucrZr8761yA==\\\",\\n \\\"instanceServers\\\": [\\n {\\n \\\"endpoint\\\": \\\"wss://ws-api-spot.kucoin.com/\\\",\\n \\\"encrypt\\\": true,\\n \\\"protocol\\\": \\\"websocket\\\",\\n \\\"pingInterval\\\": 18000,\\n \\\"pingTimeout\\\": 10000\\n }\\n ]\\n }\\n}" + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"token\\\": \\\"2neAiuYvAU61ZDXANAGAsiL4-iAExhsBXZxftpOeh_55i3Ysy2q2LEsEWU64mdzUOPusi34M_wGoSf7iNyEWJ93g2WHl-j4M7tCZ_S21PuIByWXUJFDywtiYB9J6i9GjsxUuhPw3Blq6rhZlGykT3Vp1phUafnulOOpts-MEmEF-3bpfetLOAq79RbGaLlE4JBvJHl5Vs9Y=.ymP9jIr6v-vucrZr8761yA==\\\",\\n \\\"instanceServers\\\": [\\n {\\n \\\"endpoint\\\": \\\"wss://ws-api-spot.kucoin.com/\\\",\\n \\\"encrypt\\\": true,\\n \\\"protocol\\\": \\\"websocket\\\",\\n \\\"pingInterval\\\": 18000,\\n \\\"pingTimeout\\\": 10000\\n }\\n ]\\n }\\n}", + "operationId": "017" } }, "/api/v1/bullet-private": { @@ -6133,7 +6150,8 @@ "x-sdk-method-name": "getPrivateToken", "x-sdk-method-description": "This interface can obtain the token required for websocket to establish a Spot/Margin private connection. If you need use private channels(e.g. account balance notice), please make request as follows to obtain the server list and private token", "x-api-rate-limit": 10, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"token\\\": \\\"2neAiuYvAU737TOajb2U3uT8AEZqSWYe0fBD4LoHuXJDSC7gIzJiH4kNTWhCPISWo6nDpAe7aUaaHJ4fG8oRjFgMfUI2sM4IySWHrBceFocY8pKy2REU1HwZIngtMdMrjqPnP-biofFWbNaP1cl0X1pZc2SQ-33hDH1LgNP-yg80ZJv_Ctaj8sAFhTOZ8m1L.jut4vBQxXAseWKxODdGVGg==\\\",\\n \\\"instanceServers\\\": [\\n {\\n \\\"endpoint\\\": \\\"wss://ws-api-spot.kucoin.com/\\\",\\n \\\"encrypt\\\": true,\\n \\\"protocol\\\": \\\"websocket\\\",\\n \\\"pingInterval\\\": 18000,\\n \\\"pingTimeout\\\": 10000\\n }\\n ]\\n }\\n}" + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"token\\\": \\\"2neAiuYvAU737TOajb2U3uT8AEZqSWYe0fBD4LoHuXJDSC7gIzJiH4kNTWhCPISWo6nDpAe7aUaaHJ4fG8oRjFgMfUI2sM4IySWHrBceFocY8pKy2REU1HwZIngtMdMrjqPnP-biofFWbNaP1cl0X1pZc2SQ-33hDH1LgNP-yg80ZJv_Ctaj8sAFhTOZ8m1L.jut4vBQxXAseWKxODdGVGg==\\\",\\n \\\"instanceServers\\\": [\\n {\\n \\\"endpoint\\\": \\\"wss://ws-api-spot.kucoin.com/\\\",\\n \\\"encrypt\\\": true,\\n \\\"protocol\\\": \\\"websocket\\\",\\n \\\"pingInterval\\\": 18000,\\n \\\"pingTimeout\\\": 10000\\n }\\n ]\\n }\\n}", + "operationId": "018" } } }, diff --git a/spec/rest/api/openapi-spot-order.json b/spec/rest/api/openapi-spot-order.json index 688a3d33..bb4cec87 100644 --- a/spec/rest/api/openapi-spot-order.json +++ b/spec/rest/api/openapi-spot-order.json @@ -252,7 +252,8 @@ } }, "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"orderId\\\":\\\"670fd33bf9406e0007ab3945\\\",\\\"clientOid\\\":\\\"5c52e11203aa677f33e493fb\\\"}}", - "x-request-example": "{\\\"type\\\": \\\"limit\\\", \\\"symbol\\\": \\\"BTC-USDT\\\", \\\"side\\\": \\\"buy\\\", \\\"price\\\": \\\"50000\\\", \\\"size\\\": \\\"0.00001\\\", \\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\", \\\"remark\\\": \\\"order remarks\\\"}" + "x-request-example": "{\\\"type\\\": \\\"limit\\\", \\\"symbol\\\": \\\"BTC-USDT\\\", \\\"side\\\": \\\"buy\\\", \\\"price\\\": \\\"50000\\\", \\\"size\\\": \\\"0.00001\\\", \\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\", \\\"remark\\\": \\\"order remarks\\\"}", + "operationId": "001" }, "delete": { "summary": "Cancel All Orders By Symbol", @@ -311,7 +312,8 @@ "x-sdk-method-description": "This endpoint can cancel all spot orders for specific symbol. This endpoint only sends cancellation requests. The results of the requests must be obtained by checking the order status or subscribing to websocket.", "x-api-rate-limit": 2, "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":\\\"success\\\"}", - "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\"}" + "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\"}", + "operationId": "011" } }, "/api/v1/hf/orders/sync": { @@ -610,7 +612,8 @@ } }, "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"orderId\\\":\\\"67111a7cb7cbdf000703e1f6\\\",\\\"clientOid\\\":\\\"5c52e11203aa677f33e493f\\\",\\\"orderTime\\\":1729174140586,\\\"originSize\\\":\\\"0.00001\\\",\\\"dealSize\\\":\\\"0\\\",\\\"remainSize\\\":\\\"0.00001\\\",\\\"canceledSize\\\":\\\"0\\\",\\\"status\\\":\\\"open\\\",\\\"matchTime\\\":1729174140588}}", - "x-request-example": "{\\\"type\\\": \\\"limit\\\", \\\"symbol\\\": \\\"BTC-USDT\\\", \\\"side\\\": \\\"buy\\\", \\\"price\\\": \\\"50000\\\", \\\"size\\\": \\\"0.00001\\\", \\\"clientOid\\\": \\\"5c52e11203aa677f33e493f\\\", \\\"remark\\\": \\\"order remarks\\\"}" + "x-request-example": "{\\\"type\\\": \\\"limit\\\", \\\"symbol\\\": \\\"BTC-USDT\\\", \\\"side\\\": \\\"buy\\\", \\\"price\\\": \\\"50000\\\", \\\"size\\\": \\\"0.00001\\\", \\\"clientOid\\\": \\\"5c52e11203aa677f33e493f\\\", \\\"remark\\\": \\\"order remarks\\\"}", + "operationId": "002" } }, "/api/v1/hf/orders/test": { @@ -858,7 +861,8 @@ } }, "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"orderId\\\":\\\"670fd33bf9406e0007ab3945\\\",\\\"clientOid\\\":\\\"5c52e11203aa677f33e493fb\\\"}}", - "x-request-example": "{\\\"type\\\": \\\"limit\\\", \\\"symbol\\\": \\\"BTC-USDT\\\", \\\"side\\\": \\\"buy\\\", \\\"price\\\": \\\"50000\\\", \\\"size\\\": \\\"0.00001\\\", \\\"clientOid\\\": \\\"5c52e11203aa677f33e493f\\\", \\\"remark\\\": \\\"order remarks\\\"}" + "x-request-example": "{\\\"type\\\": \\\"limit\\\", \\\"symbol\\\": \\\"BTC-USDT\\\", \\\"side\\\": \\\"buy\\\", \\\"price\\\": \\\"50000\\\", \\\"size\\\": \\\"0.00001\\\", \\\"clientOid\\\": \\\"5c52e11203aa677f33e493f\\\", \\\"remark\\\": \\\"order remarks\\\"}", + "operationId": "003" } }, "/api/v1/hf/orders/multi": { @@ -1114,7 +1118,8 @@ } }, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": [\\n {\\n \\\"orderId\\\": \\\"6710d8336afcdb0007319c27\\\",\\n \\\"clientOid\\\": \\\"client order id 12\\\",\\n \\\"success\\\": true\\n },\\n {\\n \\\"success\\\": false,\\n \\\"failMsg\\\": \\\"The order funds should more then 0.1 USDT.\\\"\\n }\\n ]\\n}", - "x-request-example": "{\\\"orderList\\\": [{\\\"clientOid\\\": \\\"client order id 12\\\", \\\"symbol\\\": \\\"BTC-USDT\\\", \\\"type\\\": \\\"limit\\\", \\\"side\\\": \\\"buy\\\", \\\"price\\\": \\\"30000\\\", \\\"size\\\": \\\"0.00001\\\"}, {\\\"clientOid\\\": \\\"client order id 13\\\", \\\"symbol\\\": \\\"ETH-USDT\\\", \\\"type\\\": \\\"limit\\\", \\\"side\\\": \\\"sell\\\", \\\"price\\\": \\\"2000\\\", \\\"size\\\": \\\"0.00001\\\"}]}" + "x-request-example": "{\\\"orderList\\\": [{\\\"clientOid\\\": \\\"client order id 12\\\", \\\"symbol\\\": \\\"BTC-USDT\\\", \\\"type\\\": \\\"limit\\\", \\\"side\\\": \\\"buy\\\", \\\"price\\\": \\\"30000\\\", \\\"size\\\": \\\"0.00001\\\"}, {\\\"clientOid\\\": \\\"client order id 13\\\", \\\"symbol\\\": \\\"ETH-USDT\\\", \\\"type\\\": \\\"limit\\\", \\\"side\\\": \\\"sell\\\", \\\"price\\\": \\\"2000\\\", \\\"size\\\": \\\"0.00001\\\"}]}", + "operationId": "004" } }, "/api/v1/hf/orders/multi/sync": { @@ -1414,7 +1419,8 @@ } }, "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":[{\\\"orderId\\\":\\\"6711195e5584bc0007bd5aef\\\",\\\"clientOid\\\":\\\"client order id 13\\\",\\\"orderTime\\\":1729173854299,\\\"originSize\\\":\\\"0.00001\\\",\\\"dealSize\\\":\\\"0\\\",\\\"remainSize\\\":\\\"0.00001\\\",\\\"canceledSize\\\":\\\"0\\\",\\\"status\\\":\\\"open\\\",\\\"matchTime\\\":1729173854326,\\\"success\\\":true},{\\\"success\\\":false,\\\"failMsg\\\":\\\"The order funds should more then 0.1 USDT.\\\"}]}", - "x-request-example": "{\\\"orderList\\\": [{\\\"clientOid\\\": \\\"client order id 13\\\", \\\"symbol\\\": \\\"BTC-USDT\\\", \\\"type\\\": \\\"limit\\\", \\\"side\\\": \\\"buy\\\", \\\"price\\\": \\\"30000\\\", \\\"size\\\": \\\"0.00001\\\"}, {\\\"clientOid\\\": \\\"client order id 14\\\", \\\"symbol\\\": \\\"ETH-USDT\\\", \\\"type\\\": \\\"limit\\\", \\\"side\\\": \\\"sell\\\", \\\"price\\\": \\\"2000\\\", \\\"size\\\": \\\"0.00001\\\"}]}" + "x-request-example": "{\\\"orderList\\\": [{\\\"clientOid\\\": \\\"client order id 13\\\", \\\"symbol\\\": \\\"BTC-USDT\\\", \\\"type\\\": \\\"limit\\\", \\\"side\\\": \\\"buy\\\", \\\"price\\\": \\\"30000\\\", \\\"size\\\": \\\"0.00001\\\"}, {\\\"clientOid\\\": \\\"client order id 14\\\", \\\"symbol\\\": \\\"ETH-USDT\\\", \\\"type\\\": \\\"limit\\\", \\\"side\\\": \\\"sell\\\", \\\"price\\\": \\\"2000\\\", \\\"size\\\": \\\"0.00001\\\"}]}", + "operationId": "005" } }, "/api/v1/hf/orders/{orderId}": { @@ -1493,7 +1499,8 @@ "x-sdk-method-description": "This endpoint can be used to cancel a spot order by orderId. This endpoint only sends cancellation requests. The results of the requests must be obtained by checking the order status or subscribing to websocket.", "x-api-rate-limit": 1, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"orderId\\\": \\\"671124f9365ccb00073debd4\\\"\\n }\\n}", - "x-request-example": "{\\\"orderId\\\": \\\"671124f9365ccb00073debd4\\\", \\\"symbol\\\": \\\"BTC-USDT\\\"}" + "x-request-example": "{\\\"orderId\\\": \\\"671124f9365ccb00073debd4\\\", \\\"symbol\\\": \\\"BTC-USDT\\\"}", + "operationId": "006" }, "get": { "summary": "Get Order By OrderId", @@ -1823,7 +1830,8 @@ "x-sdk-method-description": "This endpoint can be used to obtain information for a single Spot order using the order id. After the user successfully places an order, the order is in Active state, and the user can use inOrderBook to determine whether the order has entered the order. Canceled or fully filled orders are marked as completed Done status.", "x-api-rate-limit": 2, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"id\\\": \\\"6717422bd51c29000775ea03\\\",\\n \\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\",\\n \\\"symbol\\\": \\\"BTC-USDT\\\",\\n \\\"opType\\\": \\\"DEAL\\\",\\n \\\"type\\\": \\\"limit\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"price\\\": \\\"70000\\\",\\n \\\"size\\\": \\\"0.00001\\\",\\n \\\"funds\\\": \\\"0.7\\\",\\n \\\"dealSize\\\": \\\"0.00001\\\",\\n \\\"dealFunds\\\": \\\"0.677176\\\",\\n \\\"remainSize\\\": \\\"0\\\",\\n \\\"remainFunds\\\": \\\"0.022824\\\",\\n \\\"cancelledSize\\\": \\\"0\\\",\\n \\\"cancelledFunds\\\": \\\"0\\\",\\n \\\"fee\\\": \\\"0.000677176\\\",\\n \\\"feeCurrency\\\": \\\"USDT\\\",\\n \\\"stp\\\": null,\\n \\\"timeInForce\\\": \\\"GTC\\\",\\n \\\"postOnly\\\": false,\\n \\\"hidden\\\": false,\\n \\\"iceberg\\\": false,\\n \\\"visibleSize\\\": \\\"0\\\",\\n \\\"cancelAfter\\\": 0,\\n \\\"channel\\\": \\\"API\\\",\\n \\\"remark\\\": \\\"order remarks\\\",\\n \\\"tags\\\": null,\\n \\\"cancelExist\\\": false,\\n \\\"tradeType\\\": \\\"TRADE\\\",\\n \\\"inOrderBook\\\": false,\\n \\\"active\\\": false,\\n \\\"tax\\\": \\\"0\\\",\\n \\\"createdAt\\\": 1729577515444,\\n \\\"lastUpdatedAt\\\": 1729577515481\\n }\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"orderId\\\": \\\"6717422bd51c29000775ea03\\\"}" + "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"orderId\\\": \\\"6717422bd51c29000775ea03\\\"}", + "operationId": "014" } }, "/api/v1/hf/orders/sync/{orderId}": { @@ -1943,7 +1951,8 @@ "x-sdk-method-description": "This endpoint can be used to cancel a spot order by orderId.", "x-api-rate-limit": 1, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"orderId\\\": \\\"671128ee365ccb0007534d45\\\",\\n \\\"originSize\\\": \\\"0.00001\\\",\\n \\\"dealSize\\\": \\\"0\\\",\\n \\\"remainSize\\\": \\\"0\\\",\\n \\\"canceledSize\\\": \\\"0.00001\\\",\\n \\\"status\\\": \\\"done\\\"\\n }\\n}", - "x-request-example": "{\\\"orderId\\\": \\\"671128ee365ccb0007534d45\\\", \\\"symbol\\\": \\\"BTC-USDT\\\"}" + "x-request-example": "{\\\"orderId\\\": \\\"671128ee365ccb0007534d45\\\", \\\"symbol\\\": \\\"BTC-USDT\\\"}", + "operationId": "007" } }, "/api/v1/hf/orders/client-order/{clientOid}": { @@ -2022,7 +2031,8 @@ "x-sdk-method-description": "This endpoint can be used to cancel a spot order by clientOid. This endpoint only sends cancellation requests. The results of the requests must be obtained by checking the order status or subscribing to websocket.", "x-api-rate-limit": 1, "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"clientOid\\\":\\\"5c52e11203aa677f33e493fb\\\"}}", - "x-request-example": "{\\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\", \\\"symbol\\\": \\\"BTC-USDT\\\"}" + "x-request-example": "{\\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\", \\\"symbol\\\": \\\"BTC-USDT\\\"}", + "operationId": "008" }, "get": { "summary": "Get Order By ClientOid", @@ -2352,7 +2362,8 @@ "x-sdk-method-description": "This endpoint can be used to obtain information for a single Spot order using the client order id. After the user successfully places an order, the order is in Active state, and the user can use inOrderBook to determine whether the order has entered the order. Canceled or fully filled orders are marked as completed Done status.", "x-api-rate-limit": 2, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"id\\\": \\\"6717422bd51c29000775ea03\\\",\\n \\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\",\\n \\\"symbol\\\": \\\"BTC-USDT\\\",\\n \\\"opType\\\": \\\"DEAL\\\",\\n \\\"type\\\": \\\"limit\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"price\\\": \\\"70000\\\",\\n \\\"size\\\": \\\"0.00001\\\",\\n \\\"funds\\\": \\\"0.7\\\",\\n \\\"dealSize\\\": \\\"0.00001\\\",\\n \\\"dealFunds\\\": \\\"0.677176\\\",\\n \\\"remainSize\\\": \\\"0\\\",\\n \\\"remainFunds\\\": \\\"0.022824\\\",\\n \\\"cancelledSize\\\": \\\"0\\\",\\n \\\"cancelledFunds\\\": \\\"0\\\",\\n \\\"fee\\\": \\\"0.000677176\\\",\\n \\\"feeCurrency\\\": \\\"USDT\\\",\\n \\\"stp\\\": null,\\n \\\"timeInForce\\\": \\\"GTC\\\",\\n \\\"postOnly\\\": false,\\n \\\"hidden\\\": false,\\n \\\"iceberg\\\": false,\\n \\\"visibleSize\\\": \\\"0\\\",\\n \\\"cancelAfter\\\": 0,\\n \\\"channel\\\": \\\"API\\\",\\n \\\"remark\\\": \\\"order remarks\\\",\\n \\\"tags\\\": null,\\n \\\"cancelExist\\\": false,\\n \\\"tradeType\\\": \\\"TRADE\\\",\\n \\\"inOrderBook\\\": false,\\n \\\"active\\\": false,\\n \\\"tax\\\": \\\"0\\\",\\n \\\"createdAt\\\": 1729577515444,\\n \\\"lastUpdatedAt\\\": 1729577515481\\n }\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\"}" + "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\"}", + "operationId": "015" } }, "/api/v1/hf/orders/sync/client-order/{clientOid}": { @@ -2472,7 +2483,8 @@ "x-sdk-method-description": "This endpoint can be used to cancel a spot order by orderId.", "x-api-rate-limit": 1, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\",\\n \\\"originSize\\\": \\\"0.00001\\\",\\n \\\"dealSize\\\": \\\"0\\\",\\n \\\"remainSize\\\": \\\"0\\\",\\n \\\"canceledSize\\\": \\\"0.00001\\\",\\n \\\"status\\\": \\\"done\\\"\\n }\\n}", - "x-request-example": "{\\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\", \\\"symbol\\\": \\\"BTC-USDT\\\"}" + "x-request-example": "{\\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\", \\\"symbol\\\": \\\"BTC-USDT\\\"}", + "operationId": "009" } }, "/api/v1/hf/orders/cancel/{orderId}": { @@ -2565,7 +2577,8 @@ "x-sdk-method-description": "This interface can cancel the specified quantity of the order according to the orderId. The order execution order is: price first, time first, this interface will not change the queue order", "x-api-rate-limit": 2, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"orderId\\\": \\\"6711f73c1ef16c000717bb31\\\",\\n \\\"cancelSize\\\": \\\"0.00001\\\"\\n }\\n}", - "x-request-example": "{\\\"orderId\\\": \\\"6711f73c1ef16c000717bb31\\\", \\\"symbol\\\": \\\"BTC-USDT\\\", \\\"cancelSize\\\": \\\"0.00001\\\"}" + "x-request-example": "{\\\"orderId\\\": \\\"6711f73c1ef16c000717bb31\\\", \\\"symbol\\\": \\\"BTC-USDT\\\", \\\"cancelSize\\\": \\\"0.00001\\\"}", + "operationId": "010" } }, "/api/v1/hf/orders/cancelAll": { @@ -2645,7 +2658,8 @@ "x-sdk-method-name": "cancelAllOrders", "x-sdk-method-description": "This endpoint can cancel all spot orders for all symbol. This endpoint only sends cancellation requests. The results of the requests must be obtained by checking the order status or subscribing to websocket.", "x-api-rate-limit": 30, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"succeedSymbols\\\": [\\n \\\"ETH-USDT\\\",\\n \\\"BTC-USDT\\\"\\n ],\\n \\\"failedSymbols\\\": []\\n }\\n}" + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"succeedSymbols\\\": [\\n \\\"ETH-USDT\\\",\\n \\\"BTC-USDT\\\"\\n ],\\n \\\"failedSymbols\\\": []\\n }\\n}", + "operationId": "012" } }, "/api/v1/hf/orders/alter": { @@ -2748,7 +2762,8 @@ } }, "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"newOrderId\\\":\\\"67112258f9406e0007408827\\\",\\\"clientOid\\\":\\\"client order id 12\\\"}}", - "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"orderId\\\": \\\"670fd33bf9406e0007ab3945\\\", \\\"newPrice\\\": \\\"30000\\\", \\\"newSize\\\": \\\"0.0001\\\"}" + "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"orderId\\\": \\\"670fd33bf9406e0007ab3945\\\", \\\"newPrice\\\": \\\"30000\\\", \\\"newSize\\\": \\\"0.0001\\\"}", + "operationId": "013" } }, "/api/v1/hf/orders/active/symbols": { @@ -2805,7 +2820,8 @@ "x-sdk-method-name": "getSymbolsWithOpenOrder", "x-sdk-method-description": "This interface can query all spot symbol that has active orders", "x-api-rate-limit": 2, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"symbols\\\": [\\n \\\"ETH-USDT\\\",\\n \\\"BTC-USDT\\\"\\n ]\\n }\\n}" + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"symbols\\\": [\\n \\\"ETH-USDT\\\",\\n \\\"BTC-USDT\\\"\\n ]\\n }\\n}", + "operationId": "016" } }, "/api/v1/hf/orders/active": { @@ -3131,7 +3147,8 @@ "x-sdk-method-description": "This interface is to obtain all Spot active order lists, and the return value of the active order interface is the paged data of all uncompleted order lists. The returned data is sorted in descending order according to the latest update time of the order. After the user successfully places an order, the order is in Active state, and the user can use inOrderBook to determine whether the order has entered the order. Canceled or fully filled orders are marked as completed Done status.", "x-api-rate-limit": 2, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": [\\n {\\n \\\"id\\\": \\\"67120bbef094e200070976f6\\\",\\n \\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\",\\n \\\"symbol\\\": \\\"BTC-USDT\\\",\\n \\\"opType\\\": \\\"DEAL\\\",\\n \\\"type\\\": \\\"limit\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"price\\\": \\\"50000\\\",\\n \\\"size\\\": \\\"0.00001\\\",\\n \\\"funds\\\": \\\"0.5\\\",\\n \\\"dealSize\\\": \\\"0\\\",\\n \\\"dealFunds\\\": \\\"0\\\",\\n \\\"fee\\\": \\\"0\\\",\\n \\\"feeCurrency\\\": \\\"USDT\\\",\\n \\\"stp\\\": null,\\n \\\"timeInForce\\\": \\\"GTC\\\",\\n \\\"postOnly\\\": false,\\n \\\"hidden\\\": false,\\n \\\"iceberg\\\": false,\\n \\\"visibleSize\\\": \\\"0\\\",\\n \\\"cancelAfter\\\": 0,\\n \\\"channel\\\": \\\"API\\\",\\n \\\"remark\\\": \\\"order remarks\\\",\\n \\\"tags\\\": \\\"order tags\\\",\\n \\\"cancelExist\\\": false,\\n \\\"tradeType\\\": \\\"TRADE\\\",\\n \\\"inOrderBook\\\": true,\\n \\\"cancelledSize\\\": \\\"0\\\",\\n \\\"cancelledFunds\\\": \\\"0\\\",\\n \\\"remainSize\\\": \\\"0.00001\\\",\\n \\\"remainFunds\\\": \\\"0.5\\\",\\n \\\"tax\\\": \\\"0\\\",\\n \\\"active\\\": true,\\n \\\"createdAt\\\": 1729235902748,\\n \\\"lastUpdatedAt\\\": 1729235909862\\n }\\n ]\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\"}" + "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\"}", + "operationId": "017" } }, "/api/v1/hf/orders/done": { @@ -3563,7 +3580,8 @@ "x-sdk-method-description": "This interface is to obtain all Spot closed order lists, and the return value of the active order interface is the paged data of all uncompleted order lists. The returned data is sorted in descending order according to the latest update time of the order. After the user successfully places an order, the order is in Active state, and the user can use inOrderBook to determine whether the order has entered the order. Canceled or fully filled orders are marked as completed Done status.", "x-api-rate-limit": 2, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"lastId\\\": 19814995255305,\\n \\\"items\\\": [\\n {\\n \\\"id\\\": \\\"6717422bd51c29000775ea03\\\",\\n \\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\",\\n \\\"symbol\\\": \\\"BTC-USDT\\\",\\n \\\"opType\\\": \\\"DEAL\\\",\\n \\\"type\\\": \\\"limit\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"price\\\": \\\"70000\\\",\\n \\\"size\\\": \\\"0.00001\\\",\\n \\\"funds\\\": \\\"0.7\\\",\\n \\\"dealSize\\\": \\\"0.00001\\\",\\n \\\"dealFunds\\\": \\\"0.677176\\\",\\n \\\"remainSize\\\": \\\"0\\\",\\n \\\"remainFunds\\\": \\\"0.022824\\\",\\n \\\"cancelledSize\\\": \\\"0\\\",\\n \\\"cancelledFunds\\\": \\\"0\\\",\\n \\\"fee\\\": \\\"0.000677176\\\",\\n \\\"feeCurrency\\\": \\\"USDT\\\",\\n \\\"stp\\\": null,\\n \\\"timeInForce\\\": \\\"GTC\\\",\\n \\\"postOnly\\\": false,\\n \\\"hidden\\\": false,\\n \\\"iceberg\\\": false,\\n \\\"visibleSize\\\": \\\"0\\\",\\n \\\"cancelAfter\\\": 0,\\n \\\"channel\\\": \\\"API\\\",\\n \\\"remark\\\": \\\"order remarks\\\",\\n \\\"tags\\\": null,\\n \\\"cancelExist\\\": false,\\n \\\"tradeType\\\": \\\"TRADE\\\",\\n \\\"inOrderBook\\\": false,\\n \\\"active\\\": false,\\n \\\"tax\\\": \\\"0\\\",\\n \\\"createdAt\\\": 1729577515444,\\n \\\"lastUpdatedAt\\\": 1729577515481\\n }\\n ]\\n }\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"side\\\": \\\"buy\\\", \\\"type\\\": \\\"limit\\\", \\\"lastId\\\": 254062248624417, \\\"limit\\\": 20, \\\"startAt\\\": 1728663338000, \\\"endAt\\\": 1728692138000}" + "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"side\\\": \\\"buy\\\", \\\"type\\\": \\\"limit\\\", \\\"lastId\\\": 254062248624417, \\\"limit\\\": 20, \\\"startAt\\\": 1728663338000, \\\"endAt\\\": 1728692138000}", + "operationId": "018" } }, "/api/v1/hf/fills": { @@ -3900,7 +3918,8 @@ "x-sdk-method-description": "This endpoint can be used to obtain a list of the latest Spot transaction details. The returned data is sorted in descending order according to the latest update time of the order.", "x-api-rate-limit": 2, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"items\\\": [\\n {\\n \\\"id\\\": 19814995255305,\\n \\\"orderId\\\": \\\"6717422bd51c29000775ea03\\\",\\n \\\"counterOrderId\\\": \\\"67174228135f9e000709da8c\\\",\\n \\\"tradeId\\\": 11029373945659392,\\n \\\"symbol\\\": \\\"BTC-USDT\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"liquidity\\\": \\\"taker\\\",\\n \\\"type\\\": \\\"limit\\\",\\n \\\"forceTaker\\\": false,\\n \\\"price\\\": \\\"67717.6\\\",\\n \\\"size\\\": \\\"0.00001\\\",\\n \\\"funds\\\": \\\"0.677176\\\",\\n \\\"fee\\\": \\\"0.000677176\\\",\\n \\\"feeRate\\\": \\\"0.001\\\",\\n \\\"feeCurrency\\\": \\\"USDT\\\",\\n \\\"stop\\\": \\\"\\\",\\n \\\"tradeType\\\": \\\"TRADE\\\",\\n \\\"taxRate\\\": \\\"0\\\",\\n \\\"tax\\\": \\\"0\\\",\\n \\\"createdAt\\\": 1729577515473\\n }\\n ],\\n \\\"lastId\\\": 19814995255305\\n }\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"orderId\\\": \\\"example_string_default_value\\\", \\\"side\\\": \\\"buy\\\", \\\"type\\\": \\\"limit\\\", \\\"lastId\\\": 254062248624417, \\\"limit\\\": 100, \\\"startAt\\\": 1728663338000, \\\"endAt\\\": 1728692138000}" + "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"orderId\\\": \\\"example_string_default_value\\\", \\\"side\\\": \\\"buy\\\", \\\"type\\\": \\\"limit\\\", \\\"lastId\\\": 254062248624417, \\\"limit\\\": 100, \\\"startAt\\\": 1728663338000, \\\"endAt\\\": 1728692138000}", + "operationId": "019" } }, "/api/v1/hf/orders/dead-cancel-all/query": { @@ -3965,7 +3984,8 @@ "x-sdk-method-name": "getDCP", "x-sdk-method-description": "Get Disconnection Protect(Deadman Swich)Through this interface, you can query the settings of automatic order cancellation", "x-api-rate-limit": 2, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"timeout\\\": 5,\\n \\\"symbols\\\": \\\"BTC-USDT,ETH-USDT\\\",\\n \\\"currentTime\\\": 1729241305,\\n \\\"triggerTime\\\": 1729241308\\n }\\n}" + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"timeout\\\": 5,\\n \\\"symbols\\\": \\\"BTC-USDT,ETH-USDT\\\",\\n \\\"currentTime\\\": 1729241305,\\n \\\"triggerTime\\\": 1729241308\\n }\\n}", + "operationId": "020" } }, "/api/v1/hf/orders/dead-cancel-all": { @@ -4052,7 +4072,8 @@ } }, "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"currentTime\\\":1729656588,\\\"triggerTime\\\":1729656593}}", - "x-request-example": "{\\\"timeout\\\": 5, \\\"symbols\\\": \\\"BTC-USDT,ETH-USDT\\\"}" + "x-request-example": "{\\\"timeout\\\": 5, \\\"symbols\\\": \\\"BTC-USDT,ETH-USDT\\\"}", + "operationId": "021" } }, "/api/v1/stop-order": { @@ -4305,7 +4326,8 @@ } }, "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"orderId\\\":\\\"670fd33bf9406e0007ab3945\\\",\\\"clientOid\\\":\\\"5c52e11203aa677f33e493fb\\\"}}", - "x-request-example": "{\\\"type\\\": \\\"limit\\\", \\\"symbol\\\": \\\"BTC-USDT\\\", \\\"side\\\": \\\"buy\\\", \\\"price\\\": \\\"50000\\\", \\\"size\\\": \\\"0.00001\\\", \\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\", \\\"remark\\\": \\\"order remarks\\\"}" + "x-request-example": "{\\\"type\\\": \\\"limit\\\", \\\"symbol\\\": \\\"BTC-USDT\\\", \\\"side\\\": \\\"buy\\\", \\\"price\\\": \\\"50000\\\", \\\"size\\\": \\\"0.00001\\\", \\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\", \\\"remark\\\": \\\"order remarks\\\"}", + "operationId": "022" }, "get": { "summary": "Get Stop Orders List", @@ -4619,7 +4641,8 @@ } }, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"currentPage\\\": 1,\\n \\\"pageSize\\\": 50,\\n \\\"totalNum\\\": 1,\\n \\\"totalPage\\\": 1,\\n \\\"items\\\": [\\n {\\n \\\"id\\\": \\\"vs8hoo8kqjnklv4m0038lrfq\\\",\\n \\\"symbol\\\": \\\"KCS-USDT\\\",\\n \\\"userId\\\": \\\"60fe4956c43cbc0006562c2c\\\",\\n \\\"status\\\": \\\"NEW\\\",\\n \\\"type\\\": \\\"limit\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"price\\\": \\\"0.01000000000000000000\\\",\\n \\\"size\\\": \\\"0.01000000000000000000\\\",\\n \\\"funds\\\": null,\\n \\\"stp\\\": null,\\n \\\"timeInForce\\\": \\\"GTC\\\",\\n \\\"cancelAfter\\\": -1,\\n \\\"postOnly\\\": false,\\n \\\"hidden\\\": false,\\n \\\"iceberg\\\": false,\\n \\\"visibleSize\\\": null,\\n \\\"channel\\\": \\\"API\\\",\\n \\\"clientOid\\\": \\\"404814a0fb4311eb9098acde48001122\\\",\\n \\\"remark\\\": null,\\n \\\"tags\\\": null,\\n \\\"orderTime\\\": 1628755183702150100,\\n \\\"domainId\\\": \\\"kucoin\\\",\\n \\\"tradeSource\\\": \\\"USER\\\",\\n \\\"tradeType\\\": \\\"TRADE\\\",\\n \\\"feeCurrency\\\": \\\"USDT\\\",\\n \\\"takerFeeRate\\\": \\\"0.00200000000000000000\\\",\\n \\\"makerFeeRate\\\": \\\"0.00200000000000000000\\\",\\n \\\"createdAt\\\": 1628755183704,\\n \\\"stop\\\": \\\"loss\\\",\\n \\\"stopTriggerTime\\\": null,\\n \\\"stopPrice\\\": \\\"10.00000000000000000000\\\"\\n }\\n ]\\n }\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"orderId\\\": \\\"670fd33bf9406e0007ab3945\\\", \\\"newPrice\\\": \\\"30000\\\", \\\"newSize\\\": \\\"0.0001\\\"}" + "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"orderId\\\": \\\"670fd33bf9406e0007ab3945\\\", \\\"newPrice\\\": \\\"30000\\\", \\\"newSize\\\": \\\"0.0001\\\"}", + "operationId": "026" } }, "/api/v1/stop-order/cancelOrderByClientOid": { @@ -4703,7 +4726,8 @@ "x-sdk-method-description": "This endpoint can be used to cancel a spot stop order by clientOid. ", "x-api-rate-limit": 5, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"cancelledOrderId\\\": \\\"vs8hoo8ksc8mario0035a74n\\\",\\n \\\"clientOid\\\": \\\"689ff597f4414061aa819cc414836abd\\\"\\n }\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"clientOid\\\": \\\"689ff597f4414061aa819cc414836abd\\\"}" + "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"clientOid\\\": \\\"689ff597f4414061aa819cc414836abd\\\"}", + "operationId": "023" } }, "/api/v1/stop-order/{orderId}": { @@ -4771,7 +4795,8 @@ "x-sdk-method-description": "This endpoint can be used to cancel a spot stop order by orderId. ", "x-api-rate-limit": 3, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"cancelledOrderIds\\\": [\\n \\\"671124f9365ccb00073debd4\\\"\\n ]\\n }\\n}", - "x-request-example": "{\\\"orderId\\\": \\\"671124f9365ccb00073debd4\\\"}" + "x-request-example": "{\\\"orderId\\\": \\\"671124f9365ccb00073debd4\\\"}", + "operationId": "024" }, "get": { "summary": "Get Stop Order By OrderId", @@ -4956,7 +4981,8 @@ "x-sdk-method-description": "This interface is to obtain Spot stop order details by orderId", "x-api-rate-limit": 3, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"id\\\": \\\"vs8hoo8q2ceshiue003b67c0\\\",\\n \\\"symbol\\\": \\\"KCS-USDT\\\",\\n \\\"userId\\\": \\\"60fe4956c43cbc0006562c2c\\\",\\n \\\"status\\\": \\\"NEW\\\",\\n \\\"type\\\": \\\"limit\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"price\\\": \\\"0.01000000000000000000\\\",\\n \\\"size\\\": \\\"0.01000000000000000000\\\",\\n \\\"funds\\\": null,\\n \\\"stp\\\": null,\\n \\\"timeInForce\\\": \\\"GTC\\\",\\n \\\"cancelAfter\\\": -1,\\n \\\"postOnly\\\": false,\\n \\\"hidden\\\": false,\\n \\\"iceberg\\\": false,\\n \\\"visibleSize\\\": null,\\n \\\"channel\\\": \\\"API\\\",\\n \\\"clientOid\\\": \\\"40e0eb9efe6311eb8e58acde48001122\\\",\\n \\\"remark\\\": null,\\n \\\"tags\\\": null,\\n \\\"orderTime\\\": 1629098781127530200,\\n \\\"domainId\\\": \\\"kucoin\\\",\\n \\\"tradeSource\\\": \\\"USER\\\",\\n \\\"tradeType\\\": \\\"TRADE\\\",\\n \\\"feeCurrency\\\": \\\"USDT\\\",\\n \\\"takerFeeRate\\\": \\\"0.00200000000000000000\\\",\\n \\\"makerFeeRate\\\": \\\"0.00200000000000000000\\\",\\n \\\"createdAt\\\": 1629098781128,\\n \\\"stop\\\": \\\"loss\\\",\\n \\\"stopTriggerTime\\\": null,\\n \\\"stopPrice\\\": \\\"10.00000000000000000000\\\"\\n }\\n}", - "x-request-example": "{\\\"orderId\\\": \\\"example_string_default_value\\\"}" + "x-request-example": "{\\\"orderId\\\": \\\"example_string_default_value\\\"}", + "operationId": "027" } }, "/api/v1/stop-order/cancel": { @@ -5042,7 +5068,8 @@ "x-sdk-method-description": "This endpoint can be used to cancel a spot stop orders by batch.", "x-api-rate-limit": 3, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"cancelledOrderIds\\\": [\\n \\\"671124f9365ccb00073debd4\\\"\\n ]\\n }\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"example_string_default_value\\\", \\\"tradeType\\\": \\\"example_string_default_value\\\", \\\"orderIds\\\": \\\"example_string_default_value\\\"}" + "x-request-example": "{\\\"symbol\\\": \\\"example_string_default_value\\\", \\\"tradeType\\\": \\\"example_string_default_value\\\", \\\"orderIds\\\": \\\"example_string_default_value\\\"}", + "operationId": "025" } }, "/api/v1/stop-order/queryOrderByClientOid": { @@ -5241,7 +5268,8 @@ "x-sdk-method-description": "This interface is to obtain Spot stop order details by orderId", "x-api-rate-limit": 3, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": [\\n {\\n \\\"id\\\": \\\"vs8hoo8os561f5np0032vngj\\\",\\n \\\"symbol\\\": \\\"KCS-USDT\\\",\\n \\\"userId\\\": \\\"60fe4956c43cbc0006562c2c\\\",\\n \\\"status\\\": \\\"NEW\\\",\\n \\\"type\\\": \\\"limit\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"price\\\": \\\"0.01000000000000000000\\\",\\n \\\"size\\\": \\\"0.01000000000000000000\\\",\\n \\\"funds\\\": null,\\n \\\"stp\\\": null,\\n \\\"timeInForce\\\": \\\"GTC\\\",\\n \\\"cancelAfter\\\": -1,\\n \\\"postOnly\\\": false,\\n \\\"hidden\\\": false,\\n \\\"iceberg\\\": false,\\n \\\"visibleSize\\\": null,\\n \\\"channel\\\": \\\"API\\\",\\n \\\"clientOid\\\": \\\"2b700942b5db41cebe578cff48960e09\\\",\\n \\\"remark\\\": null,\\n \\\"tags\\\": null,\\n \\\"orderTime\\\": 1629020492834532600,\\n \\\"domainId\\\": \\\"kucoin\\\",\\n \\\"tradeSource\\\": \\\"USER\\\",\\n \\\"tradeType\\\": \\\"TRADE\\\",\\n \\\"feeCurrency\\\": \\\"USDT\\\",\\n \\\"takerFeeRate\\\": \\\"0.00200000000000000000\\\",\\n \\\"makerFeeRate\\\": \\\"0.00200000000000000000\\\",\\n \\\"createdAt\\\": 1629020492837,\\n \\\"stop\\\": \\\"loss\\\",\\n \\\"stopTriggerTime\\\": null,\\n \\\"stopPrice\\\": \\\"1.00000000000000000000\\\"\\n }\\n ]\\n}", - "x-request-example": "{\\\"clientOid\\\": \\\"example_string_default_value\\\", \\\"symbol\\\": \\\"example_string_default_value\\\"}" + "x-request-example": "{\\\"clientOid\\\": \\\"example_string_default_value\\\", \\\"symbol\\\": \\\"example_string_default_value\\\"}", + "operationId": "028" } }, "/api/v3/oco/order": { @@ -5390,7 +5418,8 @@ } }, "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"orderId\\\":\\\"674c316e688dea0007c7b986\\\"}}", - "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"side\\\": \\\"buy\\\", \\\"price\\\": \\\"94000\\\", \\\"size\\\": \\\"0.1\\\", \\\"clientOid\\\": \\\"5c52e11203aa67f1e493fb\\\", \\\"stopPrice\\\": \\\"98000\\\", \\\"limitPrice\\\": \\\"96000\\\", \\\"remark\\\": \\\"this is remark\\\", \\\"tradeType\\\": \\\"TRADE\\\"}" + "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"side\\\": \\\"buy\\\", \\\"price\\\": \\\"94000\\\", \\\"size\\\": \\\"0.1\\\", \\\"clientOid\\\": \\\"5c52e11203aa67f1e493fb\\\", \\\"stopPrice\\\": \\\"98000\\\", \\\"limitPrice\\\": \\\"96000\\\", \\\"remark\\\": \\\"this is remark\\\", \\\"tradeType\\\": \\\"TRADE\\\"}", + "operationId": "029" } }, "/api/v3/oco/order/{orderId}": { @@ -5458,7 +5487,8 @@ "x-sdk-method-description": "This endpoint can be used to cancel a spot order by orderId. This endpoint only sends cancellation requests. The results of the requests must be obtained by checking the order status or subscribing to websocket.", "x-api-rate-limit": 3, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"cancelledOrderIds\\\": [\\n \\\"vs93gpqc6kkmkk57003gok16\\\",\\n \\\"vs93gpqc6kkmkk57003gok17\\\"\\n ]\\n }\\n}", - "x-request-example": "{\\\"orderId\\\": \\\"674c316e688dea0007c7b986\\\"}" + "x-request-example": "{\\\"orderId\\\": \\\"674c316e688dea0007c7b986\\\"}", + "operationId": "030" }, "get": { "summary": "Get OCO Order By OrderId", @@ -5570,7 +5600,8 @@ "x-sdk-method-description": "Request via this interface to get a oco order information via the order ID.", "x-api-rate-limit": 2, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"orderId\\\": \\\"674c3b6e688dea0007c7bab2\\\",\\n \\\"symbol\\\": \\\"BTC-USDT\\\",\\n \\\"clientOid\\\": \\\"5c52e1203aa6f37f1e493fb\\\",\\n \\\"orderTime\\\": 1733049198863,\\n \\\"status\\\": \\\"NEW\\\"\\n }\\n}", - "x-request-example": "{\\\"orderId\\\": \\\"674c3b6e688dea0007c7bab2\\\"}" + "x-request-example": "{\\\"orderId\\\": \\\"674c3b6e688dea0007c7bab2\\\"}", + "operationId": "033" } }, "/api/v3/oco/client-order/{clientOid}": { @@ -5638,7 +5669,8 @@ "x-sdk-method-description": "Request via this interface to cancel a stop order via the clientOid. You will receive cancelledOrderIds field once the system has received the cancellation request. The cancellation request will be processed by the matching engine in sequence. To know if the request is processed (successfully or not), you may check the order status or the update message from the pushes.", "x-api-rate-limit": 3, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"cancelledOrderIds\\\": [\\n \\\"vs93gpqc6r0mkk57003gok3h\\\",\\n \\\"vs93gpqc6r0mkk57003gok3i\\\"\\n ]\\n }\\n}", - "x-request-example": "{\\\"clientOid\\\": \\\"5c52e11203aa67f1e493fb\\\"}" + "x-request-example": "{\\\"clientOid\\\": \\\"5c52e11203aa67f1e493fb\\\"}", + "operationId": "031" }, "get": { "summary": "Get OCO Order By ClientOid", @@ -5722,7 +5754,8 @@ "x-sdk-method-description": "Request via this interface to get a oco order information via the client order ID.", "x-api-rate-limit": 2, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"orderId\\\": \\\"674c3cfa72cf2800072ee7ce\\\",\\n \\\"symbol\\\": \\\"BTC-USDT\\\",\\n \\\"clientOid\\\": \\\"5c52e1203aa6f3g7f1e493fb\\\",\\n \\\"orderTime\\\": 1733049594803,\\n \\\"status\\\": \\\"NEW\\\"\\n }\\n}", - "x-request-example": "{\\\"clientOid\\\": \\\"5c52e1203aa6f3g7f1e493fb\\\"}" + "x-request-example": "{\\\"clientOid\\\": \\\"5c52e1203aa6f3g7f1e493fb\\\"}", + "operationId": "034" } }, "/api/v3/oco/orders": { @@ -5799,7 +5832,8 @@ "x-sdk-method-description": "This interface can batch cancel OCO orders through orderIds. You will receive cancelledOrderIds field once the system has received the cancellation request. The cancellation request will be processed by the matching engine in sequence. To know if the request is processed (successfully or not), you may check the order status or the update message from the pushes.", "x-api-rate-limit": 3, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"cancelledOrderIds\\\": [\\n \\\"vs93gpqc750mkk57003gok6i\\\",\\n \\\"vs93gpqc750mkk57003gok6j\\\",\\n \\\"vs93gpqc75c39p83003tnriu\\\",\\n \\\"vs93gpqc75c39p83003tnriv\\\"\\n ]\\n }\\n}", - "x-request-example": "{\\\"orderIds\\\": \\\"674c388172cf2800072ee746,674c38bdfd8300000795167e\\\", \\\"symbol\\\": \\\"BTC-USDT\\\"}" + "x-request-example": "{\\\"orderIds\\\": \\\"674c388172cf2800072ee746,674c38bdfd8300000795167e\\\", \\\"symbol\\\": \\\"BTC-USDT\\\"}", + "operationId": "032" }, "get": { "summary": "Get OCO Order List", @@ -5994,7 +6028,8 @@ "x-sdk-method-description": "Request via this endpoint to get your current OCO order list. Items are paginated and sorted to show the latest first. See the Pagination section for retrieving additional entries after the first page.", "x-api-rate-limit": 2, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"currentPage\\\": 1,\\n \\\"pageSize\\\": 50,\\n \\\"totalNum\\\": 1,\\n \\\"totalPage\\\": 1,\\n \\\"items\\\": [\\n {\\n \\\"orderId\\\": \\\"674c3cfa72cf2800072ee7ce\\\",\\n \\\"symbol\\\": \\\"BTC-USDT\\\",\\n \\\"clientOid\\\": \\\"5c52e1203aa6f3g7f1e493fb\\\",\\n \\\"orderTime\\\": 1733049594803,\\n \\\"status\\\": \\\"NEW\\\"\\n }\\n ]\\n }\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"startAt\\\": 123456, \\\"endAt\\\": 123456, \\\"orderIds\\\": \\\"example_string_default_value\\\", \\\"pageSize\\\": 50, \\\"currentPage\\\": 1}" + "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"startAt\\\": 123456, \\\"endAt\\\": 123456, \\\"orderIds\\\": \\\"example_string_default_value\\\", \\\"pageSize\\\": 50, \\\"currentPage\\\": 1}", + "operationId": "036" } }, "/api/v3/oco/order/details/{orderId}": { @@ -6119,7 +6154,8 @@ "x-sdk-method-description": "Request via this interface to get a oco order detail via the order ID.", "x-api-rate-limit": 2, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"orderId\\\": \\\"674c3b6e688dea0007c7bab2\\\",\\n \\\"symbol\\\": \\\"BTC-USDT\\\",\\n \\\"clientOid\\\": \\\"5c52e1203aa6f37f1e493fb\\\",\\n \\\"orderTime\\\": 1733049198863,\\n \\\"status\\\": \\\"NEW\\\",\\n \\\"orders\\\": [\\n {\\n \\\"id\\\": \\\"vs93gpqc7dn6h3fa003sfelj\\\",\\n \\\"symbol\\\": \\\"BTC-USDT\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"price\\\": \\\"94000.00000000000000000000\\\",\\n \\\"stopPrice\\\": \\\"94000.00000000000000000000\\\",\\n \\\"size\\\": \\\"0.10000000000000000000\\\",\\n \\\"status\\\": \\\"NEW\\\"\\n },\\n {\\n \\\"id\\\": \\\"vs93gpqc7dn6h3fa003sfelk\\\",\\n \\\"symbol\\\": \\\"BTC-USDT\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"price\\\": \\\"96000.00000000000000000000\\\",\\n \\\"stopPrice\\\": \\\"98000.00000000000000000000\\\",\\n \\\"size\\\": \\\"0.10000000000000000000\\\",\\n \\\"status\\\": \\\"NEW\\\"\\n }\\n ]\\n }\\n}", - "x-request-example": "{\\\"orderId\\\": \\\"674c3b6e688dea0007c7bab2\\\"}" + "x-request-example": "{\\\"orderId\\\": \\\"674c3b6e688dea0007c7bab2\\\"}", + "operationId": "035" } }, "/api/v1/orders": { @@ -6377,7 +6413,8 @@ } }, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"orderId\\\": \\\"674a8635b38d120007709c0f\\\"\\n }\\n}", - "x-request-example": "{\\\"type\\\": \\\"limit\\\", \\\"symbol\\\": \\\"BTC-USDT\\\", \\\"side\\\": \\\"buy\\\", \\\"price\\\": \\\"50000\\\", \\\"size\\\": \\\"0.00001\\\", \\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\", \\\"remark\\\": \\\"order remarks\\\"}" + "x-request-example": "{\\\"type\\\": \\\"limit\\\", \\\"symbol\\\": \\\"BTC-USDT\\\", \\\"side\\\": \\\"buy\\\", \\\"price\\\": \\\"50000\\\", \\\"size\\\": \\\"0.00001\\\", \\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\", \\\"remark\\\": \\\"order remarks\\\"}", + "operationId": "037" }, "delete": { "summary": "Batch Cancel Order - Old", @@ -6479,7 +6516,8 @@ "x-sdk-method-description": "Request via this endpoint to cancel all open orders. The response is a list of ids of the canceled orders.", "x-api-rate-limit": 20, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"cancelledOrderIds\\\": [\\n \\\"674a8635b38d120007709c0f\\\",\\n \\\"674a8630439c100007d3bce1\\\"\\n ]\\n }\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"tradeType\\\": \\\"TRADE\\\"}" + "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"tradeType\\\": \\\"TRADE\\\"}", + "operationId": "042" }, "get": { "summary": "Get Orders List - Old", @@ -6852,7 +6890,8 @@ "x-sdk-method-description": "Request via this endpoint to get your current order list. The return value is the data after Pagination, sorted in descending order according to time.", "x-api-rate-limit": 2, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"currentPage\\\": 1,\\n \\\"pageSize\\\": 50,\\n \\\"totalNum\\\": 1,\\n \\\"totalPage\\\": 1,\\n \\\"items\\\": [\\n {\\n \\\"id\\\": \\\"674a9a872033a50007e2790d\\\",\\n \\\"symbol\\\": \\\"BTC-USDT\\\",\\n \\\"opType\\\": \\\"DEAL\\\",\\n \\\"type\\\": \\\"limit\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"price\\\": \\\"50000\\\",\\n \\\"size\\\": \\\"0.00001\\\",\\n \\\"funds\\\": \\\"0\\\",\\n \\\"dealFunds\\\": \\\"0\\\",\\n \\\"dealSize\\\": \\\"0\\\",\\n \\\"fee\\\": \\\"0\\\",\\n \\\"feeCurrency\\\": \\\"USDT\\\",\\n \\\"stp\\\": \\\"\\\",\\n \\\"stop\\\": \\\"\\\",\\n \\\"stopTriggered\\\": false,\\n \\\"stopPrice\\\": \\\"0\\\",\\n \\\"timeInForce\\\": \\\"GTC\\\",\\n \\\"postOnly\\\": false,\\n \\\"hidden\\\": false,\\n \\\"iceberg\\\": false,\\n \\\"visibleSize\\\": \\\"0\\\",\\n \\\"cancelAfter\\\": 0,\\n \\\"channel\\\": \\\"API\\\",\\n \\\"clientOid\\\": \\\"5c52e11203aa677f33e4923fb\\\",\\n \\\"remark\\\": \\\"order remarks\\\",\\n \\\"tags\\\": null,\\n \\\"isActive\\\": false,\\n \\\"cancelExist\\\": true,\\n \\\"createdAt\\\": 1732942471752,\\n \\\"tradeType\\\": \\\"TRADE\\\"\\n }\\n ]\\n }\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"status\\\": \\\"active\\\", \\\"side\\\": \\\"buy\\\", \\\"type\\\": \\\"limit\\\", \\\"tradeType\\\": \\\"TRADE\\\", \\\"startAt\\\": 123456, \\\"endAt\\\": 123456, \\\"currentPage\\\": 1, \\\"pageSize\\\": 50}" + "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"status\\\": \\\"active\\\", \\\"side\\\": \\\"buy\\\", \\\"type\\\": \\\"limit\\\", \\\"tradeType\\\": \\\"TRADE\\\", \\\"startAt\\\": 123456, \\\"endAt\\\": 123456, \\\"currentPage\\\": 1, \\\"pageSize\\\": 50}", + "operationId": "043" } }, "/api/v1/orders/test": { @@ -7110,7 +7149,8 @@ } }, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"orderId\\\": \\\"674a8776291d9e00074f1edf\\\"\\n }\\n}", - "x-request-example": "{\\\"type\\\": \\\"limit\\\", \\\"symbol\\\": \\\"BTC-USDT\\\", \\\"side\\\": \\\"buy\\\", \\\"price\\\": \\\"50000\\\", \\\"size\\\": \\\"0.00001\\\", \\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\", \\\"remark\\\": \\\"order remarks\\\"}" + "x-request-example": "{\\\"type\\\": \\\"limit\\\", \\\"symbol\\\": \\\"BTC-USDT\\\", \\\"side\\\": \\\"buy\\\", \\\"price\\\": \\\"50000\\\", \\\"size\\\": \\\"0.00001\\\", \\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\", \\\"remark\\\": \\\"order remarks\\\"}", + "operationId": "038" } }, "/api/v1/orders/multi": { @@ -7482,7 +7522,8 @@ } }, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"data\\\": [\\n {\\n \\\"symbol\\\": \\\"BTC-USDT\\\",\\n \\\"type\\\": \\\"limit\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"price\\\": \\\"50000\\\",\\n \\\"size\\\": \\\"0.0001\\\",\\n \\\"funds\\\": null,\\n \\\"stp\\\": \\\"\\\",\\n \\\"stop\\\": \\\"\\\",\\n \\\"stopPrice\\\": null,\\n \\\"timeInForce\\\": \\\"GTC\\\",\\n \\\"cancelAfter\\\": 0,\\n \\\"postOnly\\\": false,\\n \\\"hidden\\\": false,\\n \\\"iceberge\\\": false,\\n \\\"iceberg\\\": false,\\n \\\"visibleSize\\\": null,\\n \\\"channel\\\": \\\"API\\\",\\n \\\"id\\\": \\\"674a97dfef434f0007efc431\\\",\\n \\\"status\\\": \\\"success\\\",\\n \\\"failMsg\\\": null,\\n \\\"clientOid\\\": \\\"3d07008668054da6b3cb12e432c2b13a\\\"\\n },\\n {\\n \\\"symbol\\\": \\\"BTC-USDT\\\",\\n \\\"type\\\": \\\"limit\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"price\\\": \\\"49999\\\",\\n \\\"size\\\": \\\"0.0001\\\",\\n \\\"funds\\\": null,\\n \\\"stp\\\": \\\"\\\",\\n \\\"stop\\\": \\\"\\\",\\n \\\"stopPrice\\\": null,\\n \\\"timeInForce\\\": \\\"GTC\\\",\\n \\\"cancelAfter\\\": 0,\\n \\\"postOnly\\\": false,\\n \\\"hidden\\\": false,\\n \\\"iceberge\\\": false,\\n \\\"iceberg\\\": false,\\n \\\"visibleSize\\\": null,\\n \\\"channel\\\": \\\"API\\\",\\n \\\"id\\\": \\\"674a97dffb378b00077b9c20\\\",\\n \\\"status\\\": \\\"fail\\\",\\n \\\"failMsg\\\": \\\"Balance insufficient!\\\",\\n \\\"clientOid\\\": \\\"37245dbe6e134b5c97732bfb36cd4a9d\\\"\\n }\\n ]\\n }\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"orderList\\\": [{\\\"clientOid\\\": \\\"3d07008668054da6b3cb12e432c2b13a\\\", \\\"side\\\": \\\"buy\\\", \\\"type\\\": \\\"limit\\\", \\\"price\\\": \\\"50000\\\", \\\"size\\\": \\\"0.0001\\\"}, {\\\"clientOid\\\": \\\"37245dbe6e134b5c97732bfb36cd4a9d\\\", \\\"side\\\": \\\"buy\\\", \\\"type\\\": \\\"limit\\\", \\\"price\\\": \\\"49999\\\", \\\"size\\\": \\\"0.0001\\\"}]}" + "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"orderList\\\": [{\\\"clientOid\\\": \\\"3d07008668054da6b3cb12e432c2b13a\\\", \\\"side\\\": \\\"buy\\\", \\\"type\\\": \\\"limit\\\", \\\"price\\\": \\\"50000\\\", \\\"size\\\": \\\"0.0001\\\"}, {\\\"clientOid\\\": \\\"37245dbe6e134b5c97732bfb36cd4a9d\\\", \\\"side\\\": \\\"buy\\\", \\\"type\\\": \\\"limit\\\", \\\"price\\\": \\\"49999\\\", \\\"size\\\": \\\"0.0001\\\"}]}", + "operationId": "039" } }, "/api/v1/orders/{orderId}": { @@ -7563,7 +7604,8 @@ "x-sdk-method-description": "This endpoint can be used to cancel a spot order by orderId. This endpoint only sends cancellation requests. The results of the requests must be obtained by checking the order status or subscribing to websocket.", "x-api-rate-limit": 3, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"cancelledOrderIds\\\": [\\n \\\"674a97dfef434f0007efc431\\\"\\n ]\\n }\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"orderId\\\": \\\"674a97dfef434f0007efc431\\\"}" + "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"orderId\\\": \\\"674a97dfef434f0007efc431\\\"}", + "operationId": "040" }, "get": { "summary": "Get Order By OrderId - Old", @@ -7742,7 +7784,8 @@ "x-sdk-method-description": "Request via this endpoint to get a single order info by order ID.", "x-api-rate-limit": 2, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"id\\\": \\\"674a97dfef434f0007efc431\\\",\\n \\\"symbol\\\": \\\"BTC-USDT\\\",\\n \\\"opType\\\": \\\"DEAL\\\",\\n \\\"type\\\": \\\"limit\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"price\\\": \\\"50000\\\",\\n \\\"size\\\": \\\"0.0001\\\",\\n \\\"funds\\\": \\\"0\\\",\\n \\\"dealFunds\\\": \\\"0\\\",\\n \\\"dealSize\\\": \\\"0\\\",\\n \\\"fee\\\": \\\"0\\\",\\n \\\"feeCurrency\\\": \\\"USDT\\\",\\n \\\"stp\\\": \\\"\\\",\\n \\\"stop\\\": \\\"\\\",\\n \\\"stopTriggered\\\": false,\\n \\\"stopPrice\\\": \\\"0\\\",\\n \\\"timeInForce\\\": \\\"GTC\\\",\\n \\\"postOnly\\\": false,\\n \\\"hidden\\\": false,\\n \\\"iceberg\\\": false,\\n \\\"visibleSize\\\": \\\"0\\\",\\n \\\"cancelAfter\\\": 0,\\n \\\"channel\\\": \\\"API\\\",\\n \\\"clientOid\\\": \\\"3d07008668054da6b3cb12e432c2b13a\\\",\\n \\\"remark\\\": null,\\n \\\"tags\\\": null,\\n \\\"isActive\\\": false,\\n \\\"cancelExist\\\": true,\\n \\\"createdAt\\\": 1732941791518,\\n \\\"tradeType\\\": \\\"TRADE\\\"\\n }\\n}", - "x-request-example": "{\\\"orderId\\\": \\\"674a97dfef434f0007efc431\\\"}" + "x-request-example": "{\\\"orderId\\\": \\\"674a97dfef434f0007efc431\\\"}", + "operationId": "045" } }, "/api/v1/order/client-order/{clientOid}": { @@ -7829,7 +7872,8 @@ "x-sdk-method-description": "This endpoint can be used to cancel a spot order by clientOid. This endpoint only sends cancellation requests. The results of the requests must be obtained by checking the order status or subscribing to websocket.", "x-api-rate-limit": 3, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"cancelledOrderId\\\": \\\"674a9a872033a50007e2790d\\\",\\n \\\"clientOid\\\": \\\"5c52e11203aa677f33e4923fb\\\",\\n \\\"cancelledOcoOrderIds\\\": null\\n }\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"clientOid\\\": \\\"5c52e11203aa677f33e4923fb\\\"}" + "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"clientOid\\\": \\\"5c52e11203aa677f33e4923fb\\\"}", + "operationId": "041" }, "get": { "summary": "Get Order By ClientOid - Old", @@ -8008,7 +8052,8 @@ "x-sdk-method-description": "Request via this interface to check the information of a single active order via clientOid. The system will prompt that the order does not exists if the order does not exist or has been settled.", "x-api-rate-limit": 3, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"id\\\": \\\"674a97dfef434f0007efc431\\\",\\n \\\"symbol\\\": \\\"BTC-USDT\\\",\\n \\\"opType\\\": \\\"DEAL\\\",\\n \\\"type\\\": \\\"limit\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"price\\\": \\\"50000\\\",\\n \\\"size\\\": \\\"0.0001\\\",\\n \\\"funds\\\": \\\"0\\\",\\n \\\"dealFunds\\\": \\\"0\\\",\\n \\\"dealSize\\\": \\\"0\\\",\\n \\\"fee\\\": \\\"0\\\",\\n \\\"feeCurrency\\\": \\\"USDT\\\",\\n \\\"stp\\\": \\\"\\\",\\n \\\"stop\\\": \\\"\\\",\\n \\\"stopTriggered\\\": false,\\n \\\"stopPrice\\\": \\\"0\\\",\\n \\\"timeInForce\\\": \\\"GTC\\\",\\n \\\"postOnly\\\": false,\\n \\\"hidden\\\": false,\\n \\\"iceberg\\\": false,\\n \\\"visibleSize\\\": \\\"0\\\",\\n \\\"cancelAfter\\\": 0,\\n \\\"channel\\\": \\\"API\\\",\\n \\\"clientOid\\\": \\\"3d07008668054da6b3cb12e432c2b13a\\\",\\n \\\"remark\\\": null,\\n \\\"tags\\\": null,\\n \\\"isActive\\\": false,\\n \\\"cancelExist\\\": true,\\n \\\"createdAt\\\": 1732941791518,\\n \\\"tradeType\\\": \\\"TRADE\\\"\\n }\\n}", - "x-request-example": "{\\\"clientOid\\\": \\\"3d07008668054da6b3cb12e432c2b13a\\\"}" + "x-request-example": "{\\\"clientOid\\\": \\\"3d07008668054da6b3cb12e432c2b13a\\\"}", + "operationId": "046" } }, "/api/v1/limit/orders": { @@ -8205,7 +8250,8 @@ "x-sdk-method-description": "Request via this endpoint to get your current order list. The return value is the data after Pagination, sorted in descending order according to time.", "x-api-rate-limit": 3, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": [\\n {\\n \\\"id\\\": \\\"674a9a872033a50007e2790d\\\",\\n \\\"symbol\\\": \\\"BTC-USDT\\\",\\n \\\"opType\\\": \\\"DEAL\\\",\\n \\\"type\\\": \\\"limit\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"price\\\": \\\"50000\\\",\\n \\\"size\\\": \\\"0.00001\\\",\\n \\\"funds\\\": \\\"0\\\",\\n \\\"dealFunds\\\": \\\"0\\\",\\n \\\"dealSize\\\": \\\"0\\\",\\n \\\"fee\\\": \\\"0\\\",\\n \\\"feeCurrency\\\": \\\"USDT\\\",\\n \\\"stp\\\": \\\"\\\",\\n \\\"stop\\\": \\\"\\\",\\n \\\"stopTriggered\\\": false,\\n \\\"stopPrice\\\": \\\"0\\\",\\n \\\"timeInForce\\\": \\\"GTC\\\",\\n \\\"postOnly\\\": false,\\n \\\"hidden\\\": false,\\n \\\"iceberg\\\": false,\\n \\\"visibleSize\\\": \\\"0\\\",\\n \\\"cancelAfter\\\": 0,\\n \\\"channel\\\": \\\"API\\\",\\n \\\"clientOid\\\": \\\"5c52e11203aa677f33e4923fb\\\",\\n \\\"remark\\\": \\\"order remarks\\\",\\n \\\"tags\\\": null,\\n \\\"isActive\\\": false,\\n \\\"cancelExist\\\": true,\\n \\\"createdAt\\\": 1732942471752,\\n \\\"tradeType\\\": \\\"TRADE\\\"\\n }\\n ]\\n}", - "x-request-example": "{\\\"currentPage\\\": 1, \\\"pageSize\\\": 50}" + "x-request-example": "{\\\"currentPage\\\": 1, \\\"pageSize\\\": 50}", + "operationId": "044" } }, "/api/v1/fills": { @@ -8513,7 +8559,8 @@ "x-sdk-method-description": "Request via this endpoint to get the recent fills. The return value is the data after Pagination, sorted in descending order according to time.", "x-api-rate-limit": 10, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"currentPage\\\": 1,\\n \\\"pageSize\\\": 50,\\n \\\"totalNum\\\": 1,\\n \\\"totalPage\\\": 1,\\n \\\"items\\\": [\\n {\\n \\\"symbol\\\": \\\"DOGE-USDT\\\",\\n \\\"tradeId\\\": \\\"10862827223795713\\\",\\n \\\"orderId\\\": \\\"6745698ef4f1200007c561a8\\\",\\n \\\"counterOrderId\\\": \\\"6745695ef15b270007ac5076\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"liquidity\\\": \\\"taker\\\",\\n \\\"forceTaker\\\": false,\\n \\\"price\\\": \\\"0.40739\\\",\\n \\\"size\\\": \\\"10\\\",\\n \\\"funds\\\": \\\"4.0739\\\",\\n \\\"fee\\\": \\\"0.0040739\\\",\\n \\\"feeRate\\\": \\\"0.001\\\",\\n \\\"feeCurrency\\\": \\\"USDT\\\",\\n \\\"stop\\\": \\\"\\\",\\n \\\"tradeType\\\": \\\"TRADE\\\",\\n \\\"type\\\": \\\"market\\\",\\n \\\"createdAt\\\": 1732602254928\\n }\\n ]\\n }\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"orderId\\\": \\\"example_string_default_value\\\", \\\"side\\\": \\\"buy\\\", \\\"type\\\": \\\"limit\\\", \\\"tradeType\\\": \\\"TRADE\\\", \\\"startAt\\\": 1728663338000, \\\"endAt\\\": 1728692138000, \\\"currentPage\\\": 1, \\\"pageSize\\\": 50}" + "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"orderId\\\": \\\"example_string_default_value\\\", \\\"side\\\": \\\"buy\\\", \\\"type\\\": \\\"limit\\\", \\\"tradeType\\\": \\\"TRADE\\\", \\\"startAt\\\": 1728663338000, \\\"endAt\\\": 1728692138000, \\\"currentPage\\\": 1, \\\"pageSize\\\": 50}", + "operationId": "047" } }, "/api/v1/limit/fills": { @@ -8641,7 +8688,8 @@ "x-sdk-method-description": "Request via this endpoint to get a list of 1000 fills in the last 24 hours. The return value is the data after Pagination, sorted in descending order according to time.", "x-api-rate-limit": 20, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": [\\n {\\n \\\"symbol\\\": \\\"BTC-USDT\\\",\\n \\\"tradeId\\\": \\\"11732720444522497\\\",\\n \\\"orderId\\\": \\\"674aab24754b1e00077dbc69\\\",\\n \\\"counterOrderId\\\": \\\"674aab1fb26bfb0007a18b67\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"liquidity\\\": \\\"taker\\\",\\n \\\"forceTaker\\\": false,\\n \\\"price\\\": \\\"96999.6\\\",\\n \\\"size\\\": \\\"0.00001\\\",\\n \\\"funds\\\": \\\"0.969996\\\",\\n \\\"fee\\\": \\\"0.000969996\\\",\\n \\\"feeRate\\\": \\\"0.001\\\",\\n \\\"feeCurrency\\\": \\\"USDT\\\",\\n \\\"stop\\\": \\\"\\\",\\n \\\"tradeType\\\": \\\"TRADE\\\",\\n \\\"type\\\": \\\"limit\\\",\\n \\\"createdAt\\\": 1732946724082\\n }\\n ]\\n}", - "x-request-example": "{\\\"currentPage\\\": 1, \\\"pageSize\\\": 50}" + "x-request-example": "{\\\"currentPage\\\": 1, \\\"pageSize\\\": 50}", + "operationId": "048" } } }, diff --git a/spec/rest/api/openapi-viplending-viplending.json b/spec/rest/api/openapi-viplending-viplending.json index 1ef345f0..3181c192 100644 --- a/spec/rest/api/openapi-viplending-viplending.json +++ b/spec/rest/api/openapi-viplending-viplending.json @@ -160,7 +160,8 @@ "x-sdk-method-name": "getAccountDetail", "x-sdk-method-description": "The following information is only applicable to loans. Get information on off-exchange funding and loans, This endpoint is only for querying accounts that are currently involved in loans.", "x-api-rate-limit": 1, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"parentUid\\\": \\\"1260004199\\\",\\n \\\"orders\\\": [{\\n \\\"orderId\\\": \\\"671a2be815f4140007a588e1\\\",\\n \\\"principal\\\": \\\"100\\\",\\n \\\"interest\\\": \\\"0\\\",\\n \\\"currency\\\": \\\"USDT\\\"\\n }],\\n \\\"ltv\\\": {\\n \\\"transferLtv\\\": \\\"0.6000\\\",\\n \\\"onlyClosePosLtv\\\": \\\"0.7500\\\",\\n \\\"delayedLiquidationLtv\\\": \\\"0.7500\\\",\\n \\\"instantLiquidationLtv\\\": \\\"0.8000\\\",\\n \\\"currentLtv\\\": \\\"0.1111\\\"\\n },\\n \\\"totalMarginAmount\\\": \\\"900.00000000\\\",\\n \\\"transferMarginAmount\\\": \\\"166.66666666\\\",\\n \\\"margins\\\": [{\\n \\\"marginCcy\\\": \\\"USDT\\\",\\n \\\"marginQty\\\": \\\"1000.00000000\\\",\\n \\\"marginFactor\\\": \\\"0.9000000000\\\"\\n }]\\n }\\n}" + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"parentUid\\\": \\\"1260004199\\\",\\n \\\"orders\\\": [{\\n \\\"orderId\\\": \\\"671a2be815f4140007a588e1\\\",\\n \\\"principal\\\": \\\"100\\\",\\n \\\"interest\\\": \\\"0\\\",\\n \\\"currency\\\": \\\"USDT\\\"\\n }],\\n \\\"ltv\\\": {\\n \\\"transferLtv\\\": \\\"0.6000\\\",\\n \\\"onlyClosePosLtv\\\": \\\"0.7500\\\",\\n \\\"delayedLiquidationLtv\\\": \\\"0.7500\\\",\\n \\\"instantLiquidationLtv\\\": \\\"0.8000\\\",\\n \\\"currentLtv\\\": \\\"0.1111\\\"\\n },\\n \\\"totalMarginAmount\\\": \\\"900.00000000\\\",\\n \\\"transferMarginAmount\\\": \\\"166.66666666\\\",\\n \\\"margins\\\": [{\\n \\\"marginCcy\\\": \\\"USDT\\\",\\n \\\"marginQty\\\": \\\"1000.00000000\\\",\\n \\\"marginFactor\\\": \\\"0.9000000000\\\"\\n }]\\n }\\n}", + "operationId": "001" } }, "/api/v1/otc-loan/accounts": { @@ -242,7 +243,8 @@ "x-sdk-method-name": "getAccounts", "x-sdk-method-description": "Accounts participating in OTC lending, This interface is only for querying accounts currently running OTC lending.", "x-api-rate-limit": 1, - "x-response-example": "\\n{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": [{\\n \\\"uid\\\": \\\"1260004199\\\",\\n \\\"marginCcy\\\": \\\"USDT\\\",\\n \\\"marginQty\\\": \\\"900\\\",\\n \\\"marginFactor\\\": \\\"0.9000000000\\\",\\n \\\"accountType\\\": \\\"TRADE\\\",\\n \\\"isParent\\\": true\\n }]\\n}" + "x-response-example": "\\n{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": [{\\n \\\"uid\\\": \\\"1260004199\\\",\\n \\\"marginCcy\\\": \\\"USDT\\\",\\n \\\"marginQty\\\": \\\"900\\\",\\n \\\"marginFactor\\\": \\\"0.9000000000\\\",\\n \\\"accountType\\\": \\\"TRADE\\\",\\n \\\"isParent\\\": true\\n }]\\n}", + "operationId": "002" } } }, diff --git a/spec/rest/entry/openapi-account.json b/spec/rest/entry/openapi-account.json index 974ba12f..4199eb72 100644 --- a/spec/rest/entry/openapi-account.json +++ b/spec/rest/entry/openapi-account.json @@ -113,7 +113,8 @@ "x-sdk-method-name": "getAccountInfo", "x-sdk-method-description": "This endpoint can be used to obtain account summary information.", "x-api-rate-limit": 20, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"level\\\": 0,\\n \\\"subQuantity\\\": 3,\\n \\\"spotSubQuantity\\\": 3,\\n \\\"marginSubQuantity\\\": 2,\\n \\\"futuresSubQuantity\\\": 2,\\n \\\"optionSubQuantity\\\": 0,\\n \\\"maxSubQuantity\\\": 5,\\n \\\"maxDefaultSubQuantity\\\": 5,\\n \\\"maxSpotSubQuantity\\\": 0,\\n \\\"maxMarginSubQuantity\\\": 0,\\n \\\"maxFuturesSubQuantity\\\": 0,\\n \\\"maxOptionSubQuantity\\\": 0\\n }\\n}" + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"level\\\": 0,\\n \\\"subQuantity\\\": 3,\\n \\\"spotSubQuantity\\\": 3,\\n \\\"marginSubQuantity\\\": 2,\\n \\\"futuresSubQuantity\\\": 2,\\n \\\"optionSubQuantity\\\": 0,\\n \\\"maxSubQuantity\\\": 5,\\n \\\"maxDefaultSubQuantity\\\": 5,\\n \\\"maxSpotSubQuantity\\\": 0,\\n \\\"maxMarginSubQuantity\\\": 0,\\n \\\"maxFuturesSubQuantity\\\": 0,\\n \\\"maxOptionSubQuantity\\\": 0\\n }\\n}", + "operationId": "001" } }, "/api/v1/user/api-key": { @@ -206,7 +207,8 @@ "x-sdk-method-name": "getApikeyInfo", "x-sdk-method-description": "Get the information of the api key. Use the api key pending to be checked to call the endpoint. Both master and sub user's api key are applicable.", "x-api-rate-limit": 20, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"remark\\\": \\\"account1\\\",\\n \\\"apiKey\\\": \\\"6705f5c311545b000157d3eb\\\",\\n \\\"apiVersion\\\": 3,\\n \\\"permission\\\": \\\"General,Futures,Spot,Earn,InnerTransfer,Transfer,Margin\\\",\\n \\\"ipWhitelist\\\": \\\"203.**.154,103.**.34\\\",\\n \\\"createdAt\\\": 1728443843000,\\n \\\"uid\\\": 165111215,\\n \\\"isMaster\\\": true\\n }\\n}" + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"remark\\\": \\\"account1\\\",\\n \\\"apiKey\\\": \\\"6705f5c311545b000157d3eb\\\",\\n \\\"apiVersion\\\": 3,\\n \\\"permission\\\": \\\"General,Futures,Spot,Earn,InnerTransfer,Transfer,Margin\\\",\\n \\\"ipWhitelist\\\": \\\"203.**.154,103.**.34\\\",\\n \\\"createdAt\\\": 1728443843000,\\n \\\"uid\\\": 165111215,\\n \\\"isMaster\\\": true\\n }\\n}", + "operationId": "002" } }, "/api/v1/hf/accounts/opened": { @@ -252,7 +254,8 @@ "x-sdk-method-name": "getSpotAccountType", "x-sdk-method-description": "This interface determines whether the current user is a spot high-frequency user or a spot low-frequency user.", "x-api-rate-limit": 30, - "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":false}" + "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":false}", + "operationId": "003" } }, "/api/v1/accounts": { @@ -386,7 +389,8 @@ "x-sdk-method-description": "Get a list of accounts. Please Deposit to the main account firstly, then transfer the funds to the trade account via Inner Transfer before transaction.", "x-api-rate-limit": 5, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": [\\n {\\n \\\"id\\\": \\\"548674591753\\\",\\n \\\"currency\\\": \\\"USDT\\\",\\n \\\"type\\\": \\\"trade\\\",\\n \\\"balance\\\": \\\"26.66759503\\\",\\n \\\"available\\\": \\\"26.66759503\\\",\\n \\\"holds\\\": \\\"0\\\"\\n },\\n {\\n \\\"id\\\": \\\"63355cd156298d0001b66e61\\\",\\n \\\"currency\\\": \\\"USDT\\\",\\n \\\"type\\\": \\\"main\\\",\\n \\\"balance\\\": \\\"0.01\\\",\\n \\\"available\\\": \\\"0.01\\\",\\n \\\"holds\\\": \\\"0\\\"\\n }\\n ]\\n}", - "x-request-example": "{\\\"currency\\\": \\\"USDT\\\", \\\"type\\\": \\\"main\\\"}" + "x-request-example": "{\\\"currency\\\": \\\"USDT\\\", \\\"type\\\": \\\"main\\\"}", + "operationId": "004" } }, "/api/v1/accounts/{accountId}": { @@ -466,7 +470,8 @@ "x-sdk-method-description": "get Information for a single spot account. Use this endpoint when you know the accountId.", "x-api-rate-limit": 5, "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"currency\\\":\\\"USDT\\\",\\\"balance\\\":\\\"26.66759503\\\",\\\"available\\\":\\\"26.66759503\\\",\\\"holds\\\":\\\"0\\\"}}", - "x-request-example": "{\\\"accountId\\\": \\\"548674591753\\\"}" + "x-request-example": "{\\\"accountId\\\": \\\"548674591753\\\"}", + "operationId": "005" } }, "/api/v3/margin/accounts": { @@ -687,7 +692,8 @@ "x-sdk-method-description": "Request via this endpoint to get the info of the cross margin account.", "x-api-rate-limit": 15, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"totalAssetOfQuoteCurrency\\\": \\\"0.02\\\",\\n \\\"totalLiabilityOfQuoteCurrency\\\": \\\"0\\\",\\n \\\"debtRatio\\\": \\\"0\\\",\\n \\\"status\\\": \\\"EFFECTIVE\\\",\\n \\\"accounts\\\": [\\n {\\n \\\"currency\\\": \\\"USDT\\\",\\n \\\"total\\\": \\\"0.02\\\",\\n \\\"available\\\": \\\"0.02\\\",\\n \\\"hold\\\": \\\"0\\\",\\n \\\"liability\\\": \\\"0\\\",\\n \\\"maxBorrowSize\\\": \\\"0\\\",\\n \\\"borrowEnabled\\\": true,\\n \\\"transferInEnabled\\\": true\\n }\\n ]\\n }\\n}", - "x-request-example": "{\\\"quoteCurrency\\\": \\\"USDT\\\", \\\"queryType\\\": \\\"MARGIN\\\"}" + "x-request-example": "{\\\"quoteCurrency\\\": \\\"USDT\\\", \\\"queryType\\\": \\\"MARGIN\\\"}", + "operationId": "006" } }, "/api/v3/isolated/accounts": { @@ -985,7 +991,8 @@ "x-sdk-method-description": "Request via this endpoint to get the info of the isolated margin account.", "x-api-rate-limit": 15, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"totalAssetOfQuoteCurrency\\\": \\\"0.01\\\",\\n \\\"totalLiabilityOfQuoteCurrency\\\": \\\"0\\\",\\n \\\"timestamp\\\": 1728725465994,\\n \\\"assets\\\": [\\n {\\n \\\"symbol\\\": \\\"BTC-USDT\\\",\\n \\\"status\\\": \\\"EFFECTIVE\\\",\\n \\\"debtRatio\\\": \\\"0\\\",\\n \\\"baseAsset\\\": {\\n \\\"currency\\\": \\\"BTC\\\",\\n \\\"borrowEnabled\\\": true,\\n \\\"transferInEnabled\\\": true,\\n \\\"liability\\\": \\\"0\\\",\\n \\\"total\\\": \\\"0\\\",\\n \\\"available\\\": \\\"0\\\",\\n \\\"hold\\\": \\\"0\\\",\\n \\\"maxBorrowSize\\\": \\\"0\\\"\\n },\\n \\\"quoteAsset\\\": {\\n \\\"currency\\\": \\\"USDT\\\",\\n \\\"borrowEnabled\\\": true,\\n \\\"transferInEnabled\\\": true,\\n \\\"liability\\\": \\\"0\\\",\\n \\\"total\\\": \\\"0.01\\\",\\n \\\"available\\\": \\\"0.01\\\",\\n \\\"hold\\\": \\\"0\\\",\\n \\\"maxBorrowSize\\\": \\\"0\\\"\\n }\\n }\\n ]\\n }\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"example_string_default_value\\\", \\\"quoteCurrency\\\": \\\"USDT\\\", \\\"queryType\\\": \\\"ISOLATED\\\"}" + "x-request-example": "{\\\"symbol\\\": \\\"example_string_default_value\\\", \\\"quoteCurrency\\\": \\\"USDT\\\", \\\"queryType\\\": \\\"ISOLATED\\\"}", + "operationId": "007" } }, "/api/v1/account-overview": { @@ -1100,7 +1107,8 @@ "x-sdk-method-description": "Request via this endpoint to get the info of the futures account.", "x-api-rate-limit": 5, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"currency\\\": \\\"USDT\\\",\\n \\\"accountEquity\\\": 48.921913718,\\n \\\"unrealisedPNL\\\": 1.59475,\\n \\\"marginBalance\\\": 47.548728628,\\n \\\"positionMargin\\\": 34.1577964733,\\n \\\"orderMargin\\\": 0,\\n \\\"frozenFunds\\\": 0,\\n \\\"availableBalance\\\": 14.7876172447,\\n \\\"riskRatio\\\": 0.0090285199\\n }\\n}", - "x-request-example": "{\\\"currency\\\": \\\"USDT\\\"}" + "x-request-example": "{\\\"currency\\\": \\\"USDT\\\"}", + "operationId": "008" } }, "/api/v1/accounts/ledgers": { @@ -1306,7 +1314,8 @@ "x-sdk-method-description": "This interface is for transaction records from all types of your accounts, supporting inquiry of various currencies. Items are paginated and sorted to show the latest first. See the Pagination section for retrieving additional entries after the first page.", "x-api-rate-limit": 2, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"currentPage\\\": 1,\\n \\\"pageSize\\\": 50,\\n \\\"totalNum\\\": 1,\\n \\\"totalPage\\\": 1,\\n \\\"items\\\": [\\n {\\n \\\"id\\\": \\\"265329987780896\\\",\\n \\\"currency\\\": \\\"USDT\\\",\\n \\\"amount\\\": \\\"0.01\\\",\\n \\\"fee\\\": \\\"0\\\",\\n \\\"balance\\\": \\\"0\\\",\\n \\\"accountType\\\": \\\"TRADE\\\",\\n \\\"bizType\\\": \\\"SUB_TRANSFER\\\",\\n \\\"direction\\\": \\\"out\\\",\\n \\\"createdAt\\\": 1728658481484,\\n \\\"context\\\": \\\"\\\"\\n }\\n ]\\n }\\n}", - "x-request-example": "{\\\"currency\\\": \\\"BTC\\\", \\\"direction\\\": \\\"in\\\", \\\"bizType\\\": \\\"TRANSFER\\\", \\\"startAt\\\": 1728663338000, \\\"endAt\\\": 1728692138000, \\\"currentPage\\\": 1, \\\"pageSize\\\": 50}" + "x-request-example": "{\\\"currency\\\": \\\"BTC\\\", \\\"direction\\\": \\\"in\\\", \\\"bizType\\\": \\\"TRANSFER\\\", \\\"startAt\\\": 1728663338000, \\\"endAt\\\": 1728692138000, \\\"currentPage\\\": 1, \\\"pageSize\\\": 50}", + "operationId": "009" } }, "/api/v1/hf/accounts/ledgers": { @@ -1531,7 +1540,8 @@ "x-sdk-method-description": "This API endpoint returns all transfer (in and out) records in high-frequency trading account and supports multi-coin queries. The query results are sorted in descending order by createdAt and id.", "x-api-rate-limit": 2, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": [\\n {\\n \\\"id\\\": \\\"254062248624417\\\",\\n \\\"currency\\\": \\\"USDT\\\",\\n \\\"amount\\\": \\\"1.59760080\\\",\\n \\\"fee\\\": \\\"0.00159920\\\",\\n \\\"tax\\\": \\\"0\\\",\\n \\\"balance\\\": \\\"26.73759503\\\",\\n \\\"accountType\\\": \\\"TRADE_HF\\\",\\n \\\"bizType\\\": \\\"TRADE_EXCHANGE\\\",\\n \\\"direction\\\": \\\"in\\\",\\n \\\"createdAt\\\": \\\"1728443957539\\\",\\n \\\"context\\\": \\\"{\\\\\\\"symbol\\\\\\\":\\\\\\\"KCS-USDT\\\\\\\",\\\\\\\"orderId\\\\\\\":\\\\\\\"6705f6350dc7210007d6a36d\\\\\\\",\\\\\\\"tradeId\\\\\\\":\\\\\\\"10046097631627265\\\\\\\"}\\\"\\n }\\n ]\\n}", - "x-request-example": "{\\\"currency\\\": \\\"BTC\\\", \\\"direction\\\": \\\"in\\\", \\\"bizType\\\": \\\"TRANSFER\\\", \\\"lastId\\\": 254062248624417, \\\"limit\\\": 100, \\\"startAt\\\": 1728663338000, \\\"endAt\\\": 1728692138000}" + "x-request-example": "{\\\"currency\\\": \\\"BTC\\\", \\\"direction\\\": \\\"in\\\", \\\"bizType\\\": \\\"TRANSFER\\\", \\\"lastId\\\": 254062248624417, \\\"limit\\\": 100, \\\"startAt\\\": 1728663338000, \\\"endAt\\\": 1728692138000}", + "operationId": "010" } }, "/api/v3/hf/margin/account/ledgers": { @@ -1712,7 +1722,8 @@ "x-sdk-method-description": "This API endpoint returns all transfer (in and out) records in high-frequency margin trading account and supports multi-coin queries. The query results are sorted in descending order by createdAt and id.", "x-api-rate-limit": 2, "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":[{\\\"id\\\":1949641706720,\\\"currency\\\":\\\"USDT\\\",\\\"amount\\\":\\\"0.01000000\\\",\\\"fee\\\":\\\"0.00000000\\\",\\\"balance\\\":\\\"0.01000000\\\",\\\"accountType\\\":\\\"MARGIN_V2\\\",\\\"bizType\\\":\\\"TRANSFER\\\",\\\"direction\\\":\\\"in\\\",\\\"createdAt\\\":1728664091208,\\\"context\\\":\\\"{}\\\",\\\"tax\\\":\\\"0.00000000\\\"}]}", - "x-request-example": "{\\\"currency\\\": \\\"BTC\\\", \\\"direction\\\": \\\"in\\\", \\\"bizType\\\": \\\"TRANSFER\\\", \\\"lastId\\\": 254062248624417, \\\"limit\\\": 100, \\\"startAt\\\": 1728663338000, \\\"endAt\\\": 1728692138000}" + "x-request-example": "{\\\"currency\\\": \\\"BTC\\\", \\\"direction\\\": \\\"in\\\", \\\"bizType\\\": \\\"TRANSFER\\\", \\\"lastId\\\": 254062248624417, \\\"limit\\\": 100, \\\"startAt\\\": 1728663338000, \\\"endAt\\\": 1728692138000}", + "operationId": "011" } }, "/api/v1/transaction-history": { @@ -1894,7 +1905,8 @@ "x-sdk-method-description": "This interface can query the ledger records of the futures business line", "x-api-rate-limit": 2, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"dataList\\\": [\\n {\\n \\\"time\\\": 1728665747000,\\n \\\"type\\\": \\\"TransferIn\\\",\\n \\\"amount\\\": 0.01,\\n \\\"fee\\\": 0.0,\\n \\\"accountEquity\\\": 14.02924938,\\n \\\"status\\\": \\\"Completed\\\",\\n \\\"remark\\\": \\\"Transferred from High-Frequency Trading Account\\\",\\n \\\"offset\\\": 51360793,\\n \\\"currency\\\": \\\"USDT\\\"\\n },\\n {\\n \\\"time\\\": 1728648000000,\\n \\\"type\\\": \\\"RealisedPNL\\\",\\n \\\"amount\\\": 0.00630042,\\n \\\"fee\\\": 0.0,\\n \\\"accountEquity\\\": 20.0,\\n \\\"status\\\": \\\"Completed\\\",\\n \\\"remark\\\": \\\"XBTUSDTM\\\",\\n \\\"offset\\\": 51352430,\\n \\\"currency\\\": \\\"USDT\\\"\\n }\\n ],\\n \\\"hasMore\\\": false\\n }\\n}", - "x-request-example": "{\\\"currency\\\": \\\"XBT\\\", \\\"type\\\": \\\"Transferin\\\", \\\"offset\\\": 254062248624417, \\\"forward\\\": true, \\\"maxCount\\\": 50, \\\"startAt\\\": 1728663338000, \\\"endAt\\\": 1728692138000}" + "x-request-example": "{\\\"currency\\\": \\\"XBT\\\", \\\"type\\\": \\\"Transferin\\\", \\\"offset\\\": 254062248624417, \\\"forward\\\": true, \\\"maxCount\\\": 50, \\\"startAt\\\": 1728663338000, \\\"endAt\\\": 1728692138000}", + "operationId": "012" } }, "/api/v2/sub/user/created": { @@ -2020,7 +2032,8 @@ } }, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"currentPage\\\": 1,\\n \\\"pageSize\\\": 10,\\n \\\"totalNum\\\": 1,\\n \\\"totalPage\\\": 1,\\n \\\"items\\\": [\\n {\\n \\\"userId\\\": \\\"63743f07e0c5230001761d08\\\",\\n \\\"uid\\\": 169579801,\\n \\\"subName\\\": \\\"testapi6\\\",\\n \\\"status\\\": 2,\\n \\\"type\\\": 0,\\n \\\"access\\\": \\\"All\\\",\\n \\\"createdAt\\\": 1668562696000,\\n \\\"remarks\\\": \\\"remarks\\\",\\n \\\"tradeTypes\\\": [\\n \\\"Spot\\\",\\n \\\"Futures\\\",\\n \\\"Margin\\\"\\n ],\\n \\\"openedTradeTypes\\\": [\\n \\\"Spot\\\"\\n ],\\n \\\"hostedStatus\\\": null\\n }\\n ]\\n }\\n}", - "x-request-example": "{\\\"password\\\": \\\"1234567\\\", \\\"remarks\\\": \\\"TheRemark\\\", \\\"subName\\\": \\\"Name1234567\\\", \\\"access\\\": \\\"Spot\\\"}" + "x-request-example": "{\\\"password\\\": \\\"1234567\\\", \\\"remarks\\\": \\\"TheRemark\\\", \\\"subName\\\": \\\"Name1234567\\\", \\\"access\\\": \\\"Spot\\\"}", + "operationId": "013" } }, "/api/v3/sub/user/margin/enable": { @@ -2086,7 +2099,8 @@ } }, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": null\\n}", - "x-request-example": "{\\\"uid\\\": \\\"169579801\\\"}" + "x-request-example": "{\\\"uid\\\": \\\"169579801\\\"}", + "operationId": "014" } }, "/api/v3/sub/user/futures/enable": { @@ -2152,7 +2166,8 @@ } }, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": null\\n}", - "x-request-example": "{\\\"uid\\\": \\\"169579801\\\"}" + "x-request-example": "{\\\"uid\\\": \\\"169579801\\\"}", + "operationId": "015" } }, "/api/v2/sub/user": { @@ -2360,7 +2375,8 @@ "x-sdk-method-description": "This endpoint can be used to get a paginated list of sub-accounts. Pagination is required.", "x-api-rate-limit": 20, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"currentPage\\\": 1,\\n \\\"pageSize\\\": 10,\\n \\\"totalNum\\\": 1,\\n \\\"totalPage\\\": 1,\\n \\\"items\\\": [\\n {\\n \\\"userId\\\": \\\"63743f07e0c5230001761d08\\\",\\n \\\"uid\\\": 169579801,\\n \\\"subName\\\": \\\"testapi6\\\",\\n \\\"status\\\": 2,\\n \\\"type\\\": 0,\\n \\\"access\\\": \\\"All\\\",\\n \\\"createdAt\\\": 1668562696000,\\n \\\"remarks\\\": \\\"remarks\\\",\\n \\\"tradeTypes\\\": [\\n \\\"Spot\\\",\\n \\\"Futures\\\",\\n \\\"Margin\\\"\\n ],\\n \\\"openedTradeTypes\\\": [\\n \\\"Spot\\\"\\n ],\\n \\\"hostedStatus\\\": null\\n }\\n ]\\n }\\n}", - "x-request-example": "{\\\"currentPage\\\": 1, \\\"pageSize\\\": 10}" + "x-request-example": "{\\\"currentPage\\\": 1, \\\"pageSize\\\": 10}", + "operationId": "016" } }, "/api/v1/sub-accounts/{subUserId}": { @@ -2570,7 +2586,8 @@ "x-sdk-method-description": "This endpoint returns the account info of a sub-user specified by the subUserId.", "x-api-rate-limit": 15, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"subUserId\\\": \\\"63743f07e0c5230001761d08\\\",\\n \\\"subName\\\": \\\"testapi6\\\",\\n \\\"mainAccounts\\\": [\\n {\\n \\\"currency\\\": \\\"USDT\\\",\\n \\\"balance\\\": \\\"0.01\\\",\\n \\\"available\\\": \\\"0.01\\\",\\n \\\"holds\\\": \\\"0\\\",\\n \\\"baseCurrency\\\": \\\"BTC\\\",\\n \\\"baseCurrencyPrice\\\": \\\"62384.3\\\",\\n \\\"baseAmount\\\": \\\"0.00000016\\\",\\n \\\"tag\\\": \\\"DEFAULT\\\"\\n }\\n ],\\n \\\"tradeAccounts\\\": [\\n {\\n \\\"currency\\\": \\\"USDT\\\",\\n \\\"balance\\\": \\\"0.01\\\",\\n \\\"available\\\": \\\"0.01\\\",\\n \\\"holds\\\": \\\"0\\\",\\n \\\"baseCurrency\\\": \\\"BTC\\\",\\n \\\"baseCurrencyPrice\\\": \\\"62384.3\\\",\\n \\\"baseAmount\\\": \\\"0.00000016\\\",\\n \\\"tag\\\": \\\"DEFAULT\\\"\\n }\\n ],\\n \\\"marginAccounts\\\": [\\n {\\n \\\"currency\\\": \\\"USDT\\\",\\n \\\"balance\\\": \\\"0.01\\\",\\n \\\"available\\\": \\\"0.01\\\",\\n \\\"holds\\\": \\\"0\\\",\\n \\\"baseCurrency\\\": \\\"BTC\\\",\\n \\\"baseCurrencyPrice\\\": \\\"62384.3\\\",\\n \\\"baseAmount\\\": \\\"0.00000016\\\",\\n \\\"tag\\\": \\\"DEFAULT\\\"\\n }\\n ],\\n \\\"tradeHFAccounts\\\": []\\n }\\n}", - "x-request-example": "{\\\"subUserId\\\": \\\"63743f07e0c5230001761d08\\\", \\\"includeBaseAmount\\\": true}" + "x-request-example": "{\\\"subUserId\\\": \\\"63743f07e0c5230001761d08\\\", \\\"includeBaseAmount\\\": true}", + "operationId": "017" } }, "/api/v2/sub-accounts": { @@ -2817,7 +2834,8 @@ "x-sdk-method-description": "This endpoint can be used to get paginated Spot sub-account information. Pagination is required.", "x-api-rate-limit": 20, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"currentPage\\\": 1,\\n \\\"pageSize\\\": 10,\\n \\\"totalNum\\\": 3,\\n \\\"totalPage\\\": 1,\\n \\\"items\\\": [\\n {\\n \\\"subUserId\\\": \\\"63743f07e0c5230001761d08\\\",\\n \\\"subName\\\": \\\"testapi6\\\",\\n \\\"mainAccounts\\\": [\\n {\\n \\\"currency\\\": \\\"USDT\\\",\\n \\\"balance\\\": \\\"0.01\\\",\\n \\\"available\\\": \\\"0.01\\\",\\n \\\"holds\\\": \\\"0\\\",\\n \\\"baseCurrency\\\": \\\"BTC\\\",\\n \\\"baseCurrencyPrice\\\": \\\"62514.5\\\",\\n \\\"baseAmount\\\": \\\"0.00000015\\\",\\n \\\"tag\\\": \\\"DEFAULT\\\"\\n }\\n ],\\n \\\"tradeAccounts\\\": [\\n {\\n \\\"currency\\\": \\\"USDT\\\",\\n \\\"balance\\\": \\\"0.01\\\",\\n \\\"available\\\": \\\"0.01\\\",\\n \\\"holds\\\": \\\"0\\\",\\n \\\"baseCurrency\\\": \\\"BTC\\\",\\n \\\"baseCurrencyPrice\\\": \\\"62514.5\\\",\\n \\\"baseAmount\\\": \\\"0.00000015\\\",\\n \\\"tag\\\": \\\"DEFAULT\\\"\\n }\\n ],\\n \\\"marginAccounts\\\": [\\n {\\n \\\"currency\\\": \\\"USDT\\\",\\n \\\"balance\\\": \\\"0.01\\\",\\n \\\"available\\\": \\\"0.01\\\",\\n \\\"holds\\\": \\\"0\\\",\\n \\\"baseCurrency\\\": \\\"BTC\\\",\\n \\\"baseCurrencyPrice\\\": \\\"62514.5\\\",\\n \\\"baseAmount\\\": \\\"0.00000015\\\",\\n \\\"tag\\\": \\\"DEFAULT\\\"\\n }\\n ],\\n \\\"tradeHFAccounts\\\": []\\n },\\n {\\n \\\"subUserId\\\": \\\"670538a31037eb000115b076\\\",\\n \\\"subName\\\": \\\"Name1234567\\\",\\n \\\"mainAccounts\\\": [],\\n \\\"tradeAccounts\\\": [],\\n \\\"marginAccounts\\\": [],\\n \\\"tradeHFAccounts\\\": []\\n },\\n {\\n \\\"subUserId\\\": \\\"66b0c0905fc1480001c14c36\\\",\\n \\\"subName\\\": \\\"LTkucoin1491\\\",\\n \\\"mainAccounts\\\": [],\\n \\\"tradeAccounts\\\": [],\\n \\\"marginAccounts\\\": [],\\n \\\"tradeHFAccounts\\\": []\\n }\\n ]\\n }\\n}", - "x-request-example": "{\\\"currentPage\\\": 1, \\\"pageSize\\\": 10}" + "x-request-example": "{\\\"currentPage\\\": 1, \\\"pageSize\\\": 10}", + "operationId": "018" } }, "/api/v1/account-overview-all": { @@ -2981,7 +2999,8 @@ "x-sdk-method-description": "This endpoint can be used to get Futures sub-account information. ", "x-api-rate-limit": 6, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"summary\\\": {\\n \\\"accountEquityTotal\\\": 103.899081508,\\n \\\"unrealisedPNLTotal\\\": 38.81075,\\n \\\"marginBalanceTotal\\\": 65.336985668,\\n \\\"positionMarginTotal\\\": 68.9588320683,\\n \\\"orderMarginTotal\\\": 0,\\n \\\"frozenFundsTotal\\\": 0,\\n \\\"availableBalanceTotal\\\": 67.2492494397,\\n \\\"currency\\\": \\\"USDT\\\"\\n },\\n \\\"accounts\\\": [\\n {\\n \\\"accountName\\\": \\\"Name1234567\\\",\\n \\\"accountEquity\\\": 0,\\n \\\"unrealisedPNL\\\": 0,\\n \\\"marginBalance\\\": 0,\\n \\\"positionMargin\\\": 0,\\n \\\"orderMargin\\\": 0,\\n \\\"frozenFunds\\\": 0,\\n \\\"availableBalance\\\": 0,\\n \\\"currency\\\": \\\"USDT\\\"\\n },\\n {\\n \\\"accountName\\\": \\\"LTkucoin1491\\\",\\n \\\"accountEquity\\\": 0,\\n \\\"unrealisedPNL\\\": 0,\\n \\\"marginBalance\\\": 0,\\n \\\"positionMargin\\\": 0,\\n \\\"orderMargin\\\": 0,\\n \\\"frozenFunds\\\": 0,\\n \\\"availableBalance\\\": 0,\\n \\\"currency\\\": \\\"USDT\\\"\\n },\\n {\\n \\\"accountName\\\": \\\"manage112233\\\",\\n \\\"accountEquity\\\": 0,\\n \\\"unrealisedPNL\\\": 0,\\n \\\"marginBalance\\\": 0,\\n \\\"positionMargin\\\": 0,\\n \\\"orderMargin\\\": 0,\\n \\\"frozenFunds\\\": 0,\\n \\\"availableBalance\\\": 0,\\n \\\"currency\\\": \\\"USDT\\\"\\n },\\n {\\n \\\"accountName\\\": \\\"testapi6\\\",\\n \\\"accountEquity\\\": 27.30545128,\\n \\\"unrealisedPNL\\\": 22.549,\\n \\\"marginBalance\\\": 4.75645128,\\n \\\"positionMargin\\\": 24.1223749975,\\n \\\"orderMargin\\\": 0,\\n \\\"frozenFunds\\\": 0,\\n \\\"availableBalance\\\": 25.7320762825,\\n \\\"currency\\\": \\\"USDT\\\"\\n },\\n {\\n \\\"accountName\\\": \\\"main\\\",\\n \\\"accountEquity\\\": 76.593630228,\\n \\\"unrealisedPNL\\\": 16.26175,\\n \\\"marginBalance\\\": 60.580534388,\\n \\\"positionMargin\\\": 44.8364570708,\\n \\\"orderMargin\\\": 0,\\n \\\"frozenFunds\\\": 0,\\n \\\"availableBalance\\\": 41.5171731572,\\n \\\"currency\\\": \\\"USDT\\\"\\n }\\n ]\\n }\\n}", - "x-request-example": "{\\\"currency\\\": \\\"USDT\\\"}" + "x-request-example": "{\\\"currency\\\": \\\"USDT\\\"}", + "operationId": "019" } }, "/api/v1/sub/api-key": { @@ -3160,7 +3179,8 @@ } }, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"subName\\\": \\\"testapi6\\\",\\n \\\"remark\\\": \\\"TheRemark\\\",\\n \\\"apiKey\\\": \\\"670621e3a25958000159c82f\\\",\\n \\\"apiSecret\\\": \\\"46fd8974******896f005b2340\\\",\\n \\\"apiVersion\\\": 3,\\n \\\"passphrase\\\": \\\"11223344\\\",\\n \\\"permission\\\": \\\"General,Futures\\\",\\n \\\"createdAt\\\": 1728455139000\\n }\\n}", - "x-request-example": "{\\\"subName\\\": \\\"testapi6\\\", \\\"passphrase\\\": \\\"11223344\\\", \\\"remark\\\": \\\"TheRemark\\\", \\\"permission\\\": \\\"General,Spot,Futures\\\"}" + "x-request-example": "{\\\"subName\\\": \\\"testapi6\\\", \\\"passphrase\\\": \\\"11223344\\\", \\\"remark\\\": \\\"TheRemark\\\", \\\"permission\\\": \\\"General,Spot,Futures\\\"}", + "operationId": "020" }, "get": { "summary": "Get SubAccount API List", @@ -3265,7 +3285,8 @@ "x-sdk-method-description": "This endpoint can be used to obtain a list of APIs pertaining to a sub-account.(Not contain ND Broker Sub Account)", "x-api-rate-limit": 20, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": [\\n {\\n \\\"subName\\\": \\\"apiSdkTest\\\",\\n \\\"remark\\\": \\\"sdk_test_integration\\\",\\n \\\"apiKey\\\": \\\"673eab2a955ebf000195d7e4\\\",\\n \\\"apiVersion\\\": 3,\\n \\\"permission\\\": \\\"General\\\",\\n \\\"ipWhitelist\\\": \\\"10.**.1\\\",\\n \\\"createdAt\\\": 1732160298000,\\n \\\"uid\\\": 215112467,\\n \\\"isMaster\\\": false\\n }\\n ]\\n}", - "x-request-example": "{\\\"apiKey\\\": \\\"example_string_default_value\\\", \\\"subName\\\": \\\"testapi6\\\"}" + "x-request-example": "{\\\"apiKey\\\": \\\"example_string_default_value\\\", \\\"subName\\\": \\\"testapi6\\\"}", + "operationId": "022" }, "delete": { "summary": "Delete SubAccount API", @@ -3351,7 +3372,8 @@ "x-sdk-method-description": "This endpoint can be used to delete sub-account APIs.", "x-api-rate-limit": 30, "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"subName\\\":\\\"testapi6\\\",\\\"apiKey\\\":\\\"670621e3a25958000159c82f\\\"}}", - "x-request-example": "{\\\"apiKey\\\": \\\"670621e3a25958000159c82f\\\", \\\"subName\\\": \\\"testapi6\\\", \\\"passphrase\\\": \\\"11223344\\\"}" + "x-request-example": "{\\\"apiKey\\\": \\\"670621e3a25958000159c82f\\\", \\\"subName\\\": \\\"testapi6\\\", \\\"passphrase\\\": \\\"11223344\\\"}", + "operationId": "023" } }, "/api/v1/sub/api-key/update": { @@ -3504,7 +3526,8 @@ } }, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"subName\\\": \\\"testapi6\\\",\\n \\\"apiKey\\\": \\\"670621e3a25958000159c82f\\\",\\n \\\"permission\\\": \\\"General,Futures,Spot\\\"\\n }\\n}", - "x-request-example": "{\\\"subName\\\": \\\"testapi6\\\", \\\"apiKey\\\": \\\"670621e3a25958000159c82f\\\", \\\"passphrase\\\": \\\"11223344\\\", \\\"permission\\\": \\\"General,Spot,Futures\\\"}" + "x-request-example": "{\\\"subName\\\": \\\"testapi6\\\", \\\"apiKey\\\": \\\"670621e3a25958000159c82f\\\", \\\"passphrase\\\": \\\"11223344\\\", \\\"permission\\\": \\\"General,Spot,Futures\\\"}", + "operationId": "021" } }, "/api/v3/deposit-address/create": { @@ -3671,7 +3694,8 @@ } }, "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"address\\\":\\\"EQCA1BI4QRZ8qYmskSRDzJmkucGodYRTZCf_b9hckjla6dZl\\\",\\\"memo\\\":\\\"2090821203\\\",\\\"chainId\\\":\\\"ton\\\",\\\"to\\\":\\\"TRADE\\\",\\\"expirationDate\\\":0,\\\"currency\\\":\\\"TON\\\",\\\"chainName\\\":\\\"TON\\\"}}", - "x-request-example": "{\\\"currency\\\": \\\"TON\\\", \\\"chain\\\": \\\"ton\\\", \\\"to\\\": \\\"trade\\\"}" + "x-request-example": "{\\\"currency\\\": \\\"TON\\\", \\\"chain\\\": \\\"ton\\\", \\\"to\\\": \\\"trade\\\"}", + "operationId": "024" } }, "/api/v3/deposit-addresses": { @@ -3813,7 +3837,8 @@ "x-sdk-method-description": "Get all deposit addresses for the currency you intend to deposit. If the returned data is empty, you may need to Add Deposit Address first.", "x-api-rate-limit": 5, "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":[{\\\"address\\\":\\\"TSv3L1fS7yA3SxzKD8c1qdX4nLP6rqNxYz\\\",\\\"memo\\\":\\\"\\\",\\\"chainId\\\":\\\"trx\\\",\\\"to\\\":\\\"TRADE\\\",\\\"expirationDate\\\":0,\\\"currency\\\":\\\"USDT\\\",\\\"contractAddress\\\":\\\"TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t\\\",\\\"chainName\\\":\\\"TRC20\\\"},{\\\"address\\\":\\\"0x551e823a3b36865e8c5dc6e6ac6cc0b00d98533e\\\",\\\"memo\\\":\\\"\\\",\\\"chainId\\\":\\\"kcc\\\",\\\"to\\\":\\\"TRADE\\\",\\\"expirationDate\\\":0,\\\"currency\\\":\\\"USDT\\\",\\\"contractAddress\\\":\\\"0x0039f574ee5cc39bdd162e9a88e3eb1f111baf48\\\",\\\"chainName\\\":\\\"KCC\\\"},{\\\"address\\\":\\\"EQCA1BI4QRZ8qYmskSRDzJmkucGodYRTZCf_b9hckjla6dZl\\\",\\\"memo\\\":\\\"2085202643\\\",\\\"chainId\\\":\\\"ton\\\",\\\"to\\\":\\\"TRADE\\\",\\\"expirationDate\\\":0,\\\"currency\\\":\\\"USDT\\\",\\\"contractAddress\\\":\\\"EQCxE6mUtQJKFnGfaROTKOt1lZbDiiX1kCixRv7Nw2Id_sDs\\\",\\\"chainName\\\":\\\"TON\\\"},{\\\"address\\\":\\\"0x0a2586d5a901c8e7e68f6b0dc83bfd8bd8600ff5\\\",\\\"memo\\\":\\\"\\\",\\\"chainId\\\":\\\"eth\\\",\\\"to\\\":\\\"MAIN\\\",\\\"expirationDate\\\":0,\\\"currency\\\":\\\"USDT\\\",\\\"contractAddress\\\":\\\"0xdac17f958d2ee523a2206206994597c13d831ec7\\\",\\\"chainName\\\":\\\"ERC20\\\"}]}", - "x-request-example": "{\\\"currency\\\": \\\"BTC\\\", \\\"amount\\\": \\\"example_string_default_value\\\", \\\"chain\\\": \\\"example_string_default_value\\\"}" + "x-request-example": "{\\\"currency\\\": \\\"BTC\\\", \\\"amount\\\": \\\"example_string_default_value\\\", \\\"chain\\\": \\\"example_string_default_value\\\"}", + "operationId": "025" } }, "/api/v1/deposits": { @@ -4066,7 +4091,8 @@ "x-sdk-method-description": "Request via this endpoint to get deposit list Items are paginated and sorted to show the latest first. See the Pagination section for retrieving additional entries after the first page.", "x-api-rate-limit": 5, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"currentPage\\\": 1,\\n \\\"pageSize\\\": 50,\\n \\\"totalNum\\\": 5,\\n \\\"totalPage\\\": 1,\\n \\\"items\\\": [\\n {\\n \\\"currency\\\": \\\"USDT\\\",\\n \\\"chain\\\": \\\"\\\",\\n \\\"status\\\": \\\"SUCCESS\\\",\\n \\\"address\\\": \\\"a435*****@gmail.com\\\",\\n \\\"memo\\\": \\\"\\\",\\n \\\"isInner\\\": true,\\n \\\"amount\\\": \\\"1.00000000\\\",\\n \\\"fee\\\": \\\"0.00000000\\\",\\n \\\"walletTxId\\\": null,\\n \\\"createdAt\\\": 1728555875000,\\n \\\"updatedAt\\\": 1728555875000,\\n \\\"remark\\\": \\\"\\\",\\n \\\"arrears\\\": false\\n },\\n {\\n \\\"currency\\\": \\\"USDT\\\",\\n \\\"chain\\\": \\\"trx\\\",\\n \\\"status\\\": \\\"SUCCESS\\\",\\n \\\"address\\\": \\\"TSv3L1fS7******X4nLP6rqNxYz\\\",\\n \\\"memo\\\": \\\"\\\",\\n \\\"isInner\\\": true,\\n \\\"amount\\\": \\\"6.00000000\\\",\\n \\\"fee\\\": \\\"0.00000000\\\",\\n \\\"walletTxId\\\": null,\\n \\\"createdAt\\\": 1721730920000,\\n \\\"updatedAt\\\": 1721730920000,\\n \\\"remark\\\": \\\"\\\",\\n \\\"arrears\\\": false\\n }\\n ]\\n }\\n}", - "x-request-example": "{\\\"currency\\\": \\\"BTC\\\", \\\"status\\\": \\\"SUCCESS\\\", \\\"startAt\\\": 1728663338000, \\\"endAt\\\": 1728692138000, \\\"currentPage\\\": 1, \\\"pageSize\\\": 50}" + "x-request-example": "{\\\"currency\\\": \\\"BTC\\\", \\\"status\\\": \\\"SUCCESS\\\", \\\"startAt\\\": 1728663338000, \\\"endAt\\\": 1728692138000, \\\"currentPage\\\": 1, \\\"pageSize\\\": 50}", + "operationId": "026" } }, "/api/v1/withdrawals/quotas": { @@ -4240,7 +4266,8 @@ "x-sdk-method-description": "This interface can obtain the withdrawal quotas information of this currency.", "x-api-rate-limit": 20, "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"currency\\\":\\\"BTC\\\",\\\"limitBTCAmount\\\":\\\"15.79590095\\\",\\\"usedBTCAmount\\\":\\\"0.00000000\\\",\\\"quotaCurrency\\\":\\\"USDT\\\",\\\"limitQuotaCurrencyAmount\\\":\\\"999999.00000000\\\",\\\"usedQuotaCurrencyAmount\\\":\\\"0\\\",\\\"remainAmount\\\":\\\"15.79590095\\\",\\\"availableAmount\\\":\\\"0\\\",\\\"withdrawMinFee\\\":\\\"0.0005\\\",\\\"innerWithdrawMinFee\\\":\\\"0\\\",\\\"withdrawMinSize\\\":\\\"0.001\\\",\\\"isWithdrawEnabled\\\":true,\\\"precision\\\":8,\\\"chain\\\":\\\"BTC\\\",\\\"reason\\\":null,\\\"lockedAmount\\\":\\\"0\\\"}}", - "x-request-example": "{\\\"currency\\\": \\\"BTC\\\", \\\"chain\\\": \\\"eth\\\"}" + "x-request-example": "{\\\"currency\\\": \\\"BTC\\\", \\\"chain\\\": \\\"eth\\\"}", + "operationId": "027" } }, "/api/v3/withdrawals": { @@ -4403,7 +4430,8 @@ } }, "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"withdrawalId\\\":\\\"670deec84d64da0007d7c946\\\"}}", - "x-request-example": "{\\\"currency\\\": \\\"USDT\\\", \\\"toAddress\\\": \\\"TKFRQXSDcY****GmLrjJggwX8\\\", \\\"amount\\\": 3, \\\"withdrawType\\\": \\\"ADDRESS\\\", \\\"chain\\\": \\\"trx\\\", \\\"isInner\\\": true, \\\"remark\\\": \\\"this is Remark\\\"}" + "x-request-example": "{\\\"currency\\\": \\\"USDT\\\", \\\"toAddress\\\": \\\"TKFRQXSDcY****GmLrjJggwX8\\\", \\\"amount\\\": 3, \\\"withdrawType\\\": \\\"ADDRESS\\\", \\\"chain\\\": \\\"trx\\\", \\\"isInner\\\": true, \\\"remark\\\": \\\"this is Remark\\\"}", + "operationId": "028" } }, "/api/v1/withdrawals/{withdrawalId}": { @@ -4459,7 +4487,8 @@ "x-sdk-method-description": "This interface can cancel the withdrawal, Only withdrawals requests of PROCESSING status could be canceled.", "x-api-rate-limit": 20, "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":null}", - "x-request-example": "{\\\"withdrawalId\\\": \\\"670b891f7e0f440007730692\\\"}" + "x-request-example": "{\\\"withdrawalId\\\": \\\"670b891f7e0f440007730692\\\"}", + "operationId": "029" } }, "/api/v1/withdrawals": { @@ -4725,7 +4754,8 @@ "x-sdk-method-description": "Request via this endpoint to get deposit list Items are paginated and sorted to show the latest first. See the Pagination section for retrieving additional entries after the first page.", "x-api-rate-limit": 20, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"currentPage\\\": 1,\\n \\\"pageSize\\\": 50,\\n \\\"totalNum\\\": 5,\\n \\\"totalPage\\\": 1,\\n \\\"items\\\": [\\n {\\n \\\"currency\\\": \\\"USDT\\\",\\n \\\"chain\\\": \\\"\\\",\\n \\\"status\\\": \\\"SUCCESS\\\",\\n \\\"address\\\": \\\"a435*****@gmail.com\\\",\\n \\\"memo\\\": \\\"\\\",\\n \\\"isInner\\\": true,\\n \\\"amount\\\": \\\"1.00000000\\\",\\n \\\"fee\\\": \\\"0.00000000\\\",\\n \\\"walletTxId\\\": null,\\n \\\"createdAt\\\": 1728555875000,\\n \\\"updatedAt\\\": 1728555875000,\\n \\\"remark\\\": \\\"\\\",\\n \\\"arrears\\\": false\\n },\\n {\\n \\\"currency\\\": \\\"USDT\\\",\\n \\\"chain\\\": \\\"trx\\\",\\n \\\"status\\\": \\\"SUCCESS\\\",\\n \\\"address\\\": \\\"TSv3L1fS7******X4nLP6rqNxYz\\\",\\n \\\"memo\\\": \\\"\\\",\\n \\\"isInner\\\": true,\\n \\\"amount\\\": \\\"6.00000000\\\",\\n \\\"fee\\\": \\\"0.00000000\\\",\\n \\\"walletTxId\\\": null,\\n \\\"createdAt\\\": 1721730920000,\\n \\\"updatedAt\\\": 1721730920000,\\n \\\"remark\\\": \\\"\\\",\\n \\\"arrears\\\": false\\n }\\n ]\\n }\\n}", - "x-request-example": "{\\\"currency\\\": \\\"BTC\\\", \\\"status\\\": \\\"SUCCESS\\\", \\\"startAt\\\": 1728663338000, \\\"endAt\\\": 1728692138000, \\\"currentPage\\\": 1, \\\"pageSize\\\": 50}" + "x-request-example": "{\\\"currency\\\": \\\"BTC\\\", \\\"status\\\": \\\"SUCCESS\\\", \\\"startAt\\\": 1728663338000, \\\"endAt\\\": 1728692138000, \\\"currentPage\\\": 1, \\\"pageSize\\\": 50}", + "operationId": "030" }, "post": { "summary": "Withdraw - V1", @@ -4847,7 +4877,8 @@ } }, "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"withdrawalId\\\":\\\"670a973cf07b3800070e216c\\\"}}", - "x-request-example": "{\\\"currency\\\": \\\"USDT\\\", \\\"address\\\": \\\"TKFRQXSDc****16GmLrjJggwX8\\\", \\\"amount\\\": 3, \\\"chain\\\": \\\"trx\\\", \\\"isInner\\\": true}" + "x-request-example": "{\\\"currency\\\": \\\"USDT\\\", \\\"address\\\": \\\"TKFRQXSDc****16GmLrjJggwX8\\\", \\\"amount\\\": 3, \\\"chain\\\": \\\"trx\\\", \\\"isInner\\\": true}", + "operationId": "048" } }, "/api/v1/accounts/transferable": { @@ -4994,7 +5025,8 @@ "x-sdk-method-description": "This endpoint returns the transferable balance of a specified account.", "x-api-rate-limit": 20, "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"currency\\\":\\\"USDT\\\",\\\"balance\\\":\\\"10.5\\\",\\\"available\\\":\\\"10.5\\\",\\\"holds\\\":\\\"0\\\",\\\"transferable\\\":\\\"10.5\\\"}}", - "x-request-example": "{\\\"currency\\\": \\\"BTC\\\", \\\"type\\\": \\\"MAIN\\\", \\\"tag\\\": \\\"ETH-USDT\\\"}" + "x-request-example": "{\\\"currency\\\": \\\"BTC\\\", \\\"type\\\": \\\"MAIN\\\", \\\"tag\\\": \\\"ETH-USDT\\\"}", + "operationId": "031" } }, "/api/v3/accounts/universal-transfer": { @@ -5236,7 +5268,8 @@ } }, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"orderId\\\": \\\"6705f7248c6954000733ecac\\\"\\n }\\n}", - "x-request-example": "{\\\"clientOid\\\": \\\"64ccc0f164781800010d8c09\\\", \\\"type\\\": \\\"PARENT_TO_SUB\\\", \\\"currency\\\": \\\"USDT\\\", \\\"amount\\\": \\\"0.01\\\", \\\"fromAccountType\\\": \\\"TRADE\\\", \\\"toUserId\\\": \\\"63743f07e0c5230001761d08\\\", \\\"toAccountType\\\": \\\"TRADE\\\"}" + "x-request-example": "{\\\"clientOid\\\": \\\"64ccc0f164781800010d8c09\\\", \\\"type\\\": \\\"PARENT_TO_SUB\\\", \\\"currency\\\": \\\"USDT\\\", \\\"amount\\\": \\\"0.01\\\", \\\"fromAccountType\\\": \\\"TRADE\\\", \\\"toUserId\\\": \\\"63743f07e0c5230001761d08\\\", \\\"toAccountType\\\": \\\"TRADE\\\"}", + "operationId": "032" } }, "/api/v1/base-fee": { @@ -5326,7 +5359,8 @@ "x-sdk-method-description": "This interface is for the spot/margin basic fee rate of users", "x-api-rate-limit": 3, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"takerFeeRate\\\": \\\"0.001\\\",\\n \\\"makerFeeRate\\\": \\\"0.001\\\"\\n }\\n}", - "x-request-example": "{\\\"currencyType\\\": 1}" + "x-request-example": "{\\\"currencyType\\\": 1}", + "operationId": "033" } }, "/api/v1/trade-fees": { @@ -5408,7 +5442,8 @@ "x-sdk-method-description": "This interface is for the actual fee rate of the trading pair. You can inquire about fee rates of 10 trading pairs each time at most. The fee rate of your sub-account is the same as that of the master account.", "x-api-rate-limit": 3, "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":[{\\\"symbol\\\":\\\"BTC-USDT\\\",\\\"takerFeeRate\\\":\\\"0.001\\\",\\\"makerFeeRate\\\":\\\"0.001\\\"},{\\\"symbol\\\":\\\"ETH-USDT\\\",\\\"takerFeeRate\\\":\\\"0.001\\\",\\\"makerFeeRate\\\":\\\"0.001\\\"}]}", - "x-request-example": "{\\\"symbols\\\": \\\"BTC-USDT,ETH-USDT\\\"}" + "x-request-example": "{\\\"symbols\\\": \\\"BTC-USDT,ETH-USDT\\\"}", + "operationId": "034" }, "patch": { "summary": "Get Actual Fee - Futures", @@ -5487,6 +5522,7 @@ "x-api-rate-limit": 3, "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"symbol\\\":\\\"XBTUSDTM\\\",\\\"takerFeeRate\\\":\\\"0.0006\\\",\\\"makerFeeRate\\\":\\\"0.0002\\\"}}", "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDTM\\\"}", + "operationId": "035", "x-original-method": "get" } }, @@ -5564,7 +5600,8 @@ "x-sdk-method-name": "getSpotSubAccountsSummaryV1", "x-sdk-method-description": "You can get the user info of all sub-account via this interface It is recommended to use the GET /api/v2/sub/user interface for paging query", "x-api-rate-limit": 20, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": [\\n {\\n \\\"userId\\\": \\\"63743f07e0c5230001761d08\\\",\\n \\\"uid\\\": 169579801,\\n \\\"subName\\\": \\\"testapi6\\\",\\n \\\"type\\\": 0,\\n \\\"remarks\\\": \\\"remarks\\\",\\n \\\"access\\\": \\\"All\\\"\\n },\\n {\\n \\\"userId\\\": \\\"670538a31037eb000115b076\\\",\\n \\\"uid\\\": 225139445,\\n \\\"subName\\\": \\\"Name1234567\\\",\\n \\\"type\\\": 0,\\n \\\"remarks\\\": \\\"TheRemark\\\",\\n \\\"access\\\": \\\"All\\\"\\n }\\n ]\\n}" + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": [\\n {\\n \\\"userId\\\": \\\"63743f07e0c5230001761d08\\\",\\n \\\"uid\\\": 169579801,\\n \\\"subName\\\": \\\"testapi6\\\",\\n \\\"type\\\": 0,\\n \\\"remarks\\\": \\\"remarks\\\",\\n \\\"access\\\": \\\"All\\\"\\n },\\n {\\n \\\"userId\\\": \\\"670538a31037eb000115b076\\\",\\n \\\"uid\\\": 225139445,\\n \\\"subName\\\": \\\"Name1234567\\\",\\n \\\"type\\\": 0,\\n \\\"remarks\\\": \\\"TheRemark\\\",\\n \\\"access\\\": \\\"All\\\"\\n }\\n ]\\n}", + "operationId": "036" } }, "/api/v1/sub-accounts": { @@ -5757,7 +5794,8 @@ "x-sdk-method-name": "getSpotSubAccountListV1", "x-sdk-method-description": "This endpoint returns the account info of all sub-users.", "x-api-rate-limit": 20, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": [\\n {\\n \\\"subUserId\\\": \\\"63743f07e0c5230001761d08\\\",\\n \\\"subName\\\": \\\"testapi6\\\",\\n \\\"mainAccounts\\\": [\\n {\\n \\\"currency\\\": \\\"USDT\\\",\\n \\\"balance\\\": \\\"0.01\\\",\\n \\\"available\\\": \\\"0.01\\\",\\n \\\"holds\\\": \\\"0\\\",\\n \\\"baseCurrency\\\": \\\"BTC\\\",\\n \\\"baseCurrencyPrice\\\": \\\"62489.8\\\",\\n \\\"baseAmount\\\": \\\"0.00000016\\\",\\n \\\"tag\\\": \\\"DEFAULT\\\"\\n }\\n ],\\n \\\"tradeAccounts\\\": [\\n {\\n \\\"currency\\\": \\\"USDT\\\",\\n \\\"balance\\\": \\\"0.01\\\",\\n \\\"available\\\": \\\"0.01\\\",\\n \\\"holds\\\": \\\"0\\\",\\n \\\"baseCurrency\\\": \\\"BTC\\\",\\n \\\"baseCurrencyPrice\\\": \\\"62489.8\\\",\\n \\\"baseAmount\\\": \\\"0.00000016\\\",\\n \\\"tag\\\": \\\"DEFAULT\\\"\\n }\\n ],\\n \\\"marginAccounts\\\": [\\n {\\n \\\"currency\\\": \\\"USDT\\\",\\n \\\"balance\\\": \\\"0.01\\\",\\n \\\"available\\\": \\\"0.01\\\",\\n \\\"holds\\\": \\\"0\\\",\\n \\\"baseCurrency\\\": \\\"BTC\\\",\\n \\\"baseCurrencyPrice\\\": \\\"62489.8\\\",\\n \\\"baseAmount\\\": \\\"0.00000016\\\",\\n \\\"tag\\\": \\\"DEFAULT\\\"\\n }\\n ],\\n \\\"tradeHFAccounts\\\": []\\n },\\n {\\n \\\"subUserId\\\": \\\"670538a31037eb000115b076\\\",\\n \\\"subName\\\": \\\"Name1234567\\\",\\n \\\"mainAccounts\\\": [],\\n \\\"tradeAccounts\\\": [],\\n \\\"marginAccounts\\\": [],\\n \\\"tradeHFAccounts\\\": []\\n },\\n {\\n \\\"subUserId\\\": \\\"66b0c0905fc1480001c14c36\\\",\\n \\\"subName\\\": \\\"LTkucoin1491\\\",\\n \\\"mainAccounts\\\": [],\\n \\\"tradeAccounts\\\": [],\\n \\\"marginAccounts\\\": [],\\n \\\"tradeHFAccounts\\\": []\\n }\\n ]\\n}" + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": [\\n {\\n \\\"subUserId\\\": \\\"63743f07e0c5230001761d08\\\",\\n \\\"subName\\\": \\\"testapi6\\\",\\n \\\"mainAccounts\\\": [\\n {\\n \\\"currency\\\": \\\"USDT\\\",\\n \\\"balance\\\": \\\"0.01\\\",\\n \\\"available\\\": \\\"0.01\\\",\\n \\\"holds\\\": \\\"0\\\",\\n \\\"baseCurrency\\\": \\\"BTC\\\",\\n \\\"baseCurrencyPrice\\\": \\\"62489.8\\\",\\n \\\"baseAmount\\\": \\\"0.00000016\\\",\\n \\\"tag\\\": \\\"DEFAULT\\\"\\n }\\n ],\\n \\\"tradeAccounts\\\": [\\n {\\n \\\"currency\\\": \\\"USDT\\\",\\n \\\"balance\\\": \\\"0.01\\\",\\n \\\"available\\\": \\\"0.01\\\",\\n \\\"holds\\\": \\\"0\\\",\\n \\\"baseCurrency\\\": \\\"BTC\\\",\\n \\\"baseCurrencyPrice\\\": \\\"62489.8\\\",\\n \\\"baseAmount\\\": \\\"0.00000016\\\",\\n \\\"tag\\\": \\\"DEFAULT\\\"\\n }\\n ],\\n \\\"marginAccounts\\\": [\\n {\\n \\\"currency\\\": \\\"USDT\\\",\\n \\\"balance\\\": \\\"0.01\\\",\\n \\\"available\\\": \\\"0.01\\\",\\n \\\"holds\\\": \\\"0\\\",\\n \\\"baseCurrency\\\": \\\"BTC\\\",\\n \\\"baseCurrencyPrice\\\": \\\"62489.8\\\",\\n \\\"baseAmount\\\": \\\"0.00000016\\\",\\n \\\"tag\\\": \\\"DEFAULT\\\"\\n }\\n ],\\n \\\"tradeHFAccounts\\\": []\\n },\\n {\\n \\\"subUserId\\\": \\\"670538a31037eb000115b076\\\",\\n \\\"subName\\\": \\\"Name1234567\\\",\\n \\\"mainAccounts\\\": [],\\n \\\"tradeAccounts\\\": [],\\n \\\"marginAccounts\\\": [],\\n \\\"tradeHFAccounts\\\": []\\n },\\n {\\n \\\"subUserId\\\": \\\"66b0c0905fc1480001c14c36\\\",\\n \\\"subName\\\": \\\"LTkucoin1491\\\",\\n \\\"mainAccounts\\\": [],\\n \\\"tradeAccounts\\\": [],\\n \\\"marginAccounts\\\": [],\\n \\\"tradeHFAccounts\\\": []\\n }\\n ]\\n}", + "operationId": "037" } }, "/api/v2/deposit-addresses": { @@ -5894,7 +5932,8 @@ "x-sdk-method-description": "Get all deposit addresses for the currency you intend to deposit. If the returned data is empty, you may need to Add Deposit Address first.", "x-api-rate-limit": 5, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": [\\n {\\n \\\"address\\\": \\\"0x02028456*****87ede7a73d7c\\\",\\n \\\"memo\\\": \\\"\\\",\\n \\\"chain\\\": \\\"ERC20\\\",\\n \\\"chainId\\\": \\\"eth\\\",\\n \\\"to\\\": \\\"MAIN\\\",\\n \\\"currency\\\": \\\"ETH\\\",\\n \\\"contractAddress\\\": \\\"\\\"\\n }\\n ]\\n}", - "x-request-example": "{\\\"currency\\\": \\\"BTC\\\"}" + "x-request-example": "{\\\"currency\\\": \\\"BTC\\\"}", + "operationId": "038" } }, "/api/v2/accounts/sub-transfer": { @@ -6076,7 +6115,8 @@ } }, "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"orderId\\\":\\\"670be6b0b1b9080007040a9b\\\"}}", - "x-request-example": "{\\\"clientOid\\\": \\\"64ccc0f164781800010d8c09\\\", \\\"currency\\\": \\\"USDT\\\", \\\"amount\\\": \\\"0.01\\\", \\\"direction\\\": \\\"OUT\\\", \\\"accountType\\\": \\\"MAIN\\\", \\\"subAccountType\\\": \\\"MAIN\\\", \\\"subUserId\\\": \\\"63743f07e0c5230001761d08\\\"}" + "x-request-example": "{\\\"clientOid\\\": \\\"64ccc0f164781800010d8c09\\\", \\\"currency\\\": \\\"USDT\\\", \\\"amount\\\": \\\"0.01\\\", \\\"direction\\\": \\\"OUT\\\", \\\"accountType\\\": \\\"MAIN\\\", \\\"subAccountType\\\": \\\"MAIN\\\", \\\"subUserId\\\": \\\"63743f07e0c5230001761d08\\\"}", + "operationId": "039" } }, "/api/v2/accounts/inner-transfer": { @@ -6271,7 +6311,8 @@ } }, "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"orderId\\\":\\\"670beb3482a1bb0007dec644\\\"}}", - "x-request-example": "{\\\"clientOid\\\": \\\"64ccc0f164781800010d8c09\\\", \\\"currency\\\": \\\"USDT\\\", \\\"amount\\\": \\\"0.01\\\", \\\"from\\\": \\\"main\\\", \\\"to\\\": \\\"trade\\\"}" + "x-request-example": "{\\\"clientOid\\\": \\\"64ccc0f164781800010d8c09\\\", \\\"currency\\\": \\\"USDT\\\", \\\"amount\\\": \\\"0.01\\\", \\\"from\\\": \\\"main\\\", \\\"to\\\": \\\"trade\\\"}", + "operationId": "040" } }, "/api/v3/transfer-out": { @@ -6461,7 +6502,8 @@ } }, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"applyId\\\": \\\"670bf84c577f6c00017a1c48\\\",\\n \\\"bizNo\\\": \\\"670bf84c577f6c00017a1c47\\\",\\n \\\"payAccountType\\\": \\\"CONTRACT\\\",\\n \\\"payTag\\\": \\\"DEFAULT\\\",\\n \\\"remark\\\": \\\"\\\",\\n \\\"recAccountType\\\": \\\"MAIN\\\",\\n \\\"recTag\\\": \\\"DEFAULT\\\",\\n \\\"recRemark\\\": \\\"\\\",\\n \\\"recSystem\\\": \\\"KUCOIN\\\",\\n \\\"status\\\": \\\"PROCESSING\\\",\\n \\\"currency\\\": \\\"USDT\\\",\\n \\\"amount\\\": \\\"0.01\\\",\\n \\\"fee\\\": \\\"0\\\",\\n \\\"sn\\\": 1519769124134806,\\n \\\"reason\\\": \\\"\\\",\\n \\\"createdAt\\\": 1728837708000,\\n \\\"updatedAt\\\": 1728837708000\\n }\\n}", - "x-request-example": "{\\\"currency\\\": \\\"USDT\\\", \\\"amount\\\": 0.01, \\\"recAccountType\\\": \\\"MAIN\\\"}" + "x-request-example": "{\\\"currency\\\": \\\"USDT\\\", \\\"amount\\\": 0.01, \\\"recAccountType\\\": \\\"MAIN\\\"}", + "operationId": "041" } }, "/api/v1/transfer-in": { @@ -6558,7 +6600,8 @@ } }, "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":null}", - "x-request-example": "{\\\"currency\\\": \\\"USDT\\\", \\\"amount\\\": 0.01, \\\"payAccountType\\\": \\\"MAIN\\\"}" + "x-request-example": "{\\\"currency\\\": \\\"USDT\\\", \\\"amount\\\": 0.01, \\\"payAccountType\\\": \\\"MAIN\\\"}", + "operationId": "042" } }, "/api/v1/deposit-addresses": { @@ -6713,7 +6756,8 @@ "x-sdk-method-description": "Get all deposit addresses for the currency you intend to deposit. If the returned data is empty, you may need to Add Deposit Address first.", "x-api-rate-limit": 5, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"address\\\": \\\"0xea220bf61c3c2b0adc2cfa29fec3d2677745a379\\\",\\n \\\"memo\\\": \\\"\\\",\\n \\\"chain\\\": \\\"ERC20\\\",\\n \\\"chainId\\\": \\\"eth\\\",\\n \\\"to\\\": \\\"MAIN\\\",\\n \\\"currency\\\": \\\"USDT\\\"\\n }\\n}", - "x-request-example": "{\\\"currency\\\": \\\"BTC\\\", \\\"chain\\\": \\\"eth\\\"}" + "x-request-example": "{\\\"currency\\\": \\\"BTC\\\", \\\"chain\\\": \\\"eth\\\"}", + "operationId": "043" }, "post": { "summary": "Add Deposit Address - V1", @@ -6875,7 +6919,8 @@ } }, "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"address\\\":\\\"0x02028456f38e78609904e8a002c787ede7a73d7c\\\",\\\"memo\\\":null,\\\"chain\\\":\\\"ERC20\\\",\\\"chainId\\\":\\\"eth\\\",\\\"to\\\":\\\"MAIN\\\",\\\"currency\\\":\\\"ETH\\\"}}", - "x-request-example": "{\\\"currency\\\": \\\"ETH\\\", \\\"chain\\\": \\\"eth\\\"}" + "x-request-example": "{\\\"currency\\\": \\\"ETH\\\", \\\"chain\\\": \\\"eth\\\"}", + "operationId": "047" } }, "/api/v1/hist-deposits": { @@ -7065,7 +7110,8 @@ "x-sdk-method-description": "Request via this endpoint to get the V1 historical deposits list on KuCoin. The return value is the data after Pagination, sorted in descending order according to time.", "x-api-rate-limit": 5, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"currentPage\\\": 1,\\n \\\"pageSize\\\": 50,\\n \\\"totalNum\\\": 0,\\n \\\"totalPage\\\": 0,\\n \\\"items\\\": [\\n {\\n \\\"currency\\\": \\\"BTC\\\",\\n \\\"createAt\\\": 1528536998,\\n \\\"amount\\\": \\\"0.03266638\\\",\\n \\\"walletTxId\\\": \\\"55c643bc2c68d6f17266383ac1be9e454038864b929ae7cee0bc408cc5c869e8@12ffGWmMMD1zA1WbFm7Ho3JZ1w6NYXjpFk@234\\\",\\n \\\"isInner\\\": false,\\n \\\"status\\\": \\\"SUCCESS\\\"\\n }\\n ]\\n }\\n}", - "x-request-example": "{\\\"currency\\\": \\\"BTC\\\", \\\"status\\\": \\\"SUCCESS\\\", \\\"startAt\\\": 1728663338000, \\\"endAt\\\": 1728692138000}" + "x-request-example": "{\\\"currency\\\": \\\"BTC\\\", \\\"status\\\": \\\"SUCCESS\\\", \\\"startAt\\\": 1728663338000, \\\"endAt\\\": 1728692138000}", + "operationId": "044" } }, "/api/v1/transfer-list": { @@ -7314,7 +7360,8 @@ "x-sdk-method-description": "This endpoint can get futures account transfer out ledger", "x-api-rate-limit": 20, "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"currentPage\\\":1,\\\"pageSize\\\":50,\\\"totalNum\\\":1,\\\"totalPage\\\":1,\\\"items\\\":[{\\\"applyId\\\":\\\"670bf84c577f6c00017a1c48\\\",\\\"currency\\\":\\\"USDT\\\",\\\"recRemark\\\":\\\"\\\",\\\"recSystem\\\":\\\"KUCOIN\\\",\\\"status\\\":\\\"SUCCESS\\\",\\\"amount\\\":\\\"0.01\\\",\\\"reason\\\":\\\"\\\",\\\"offset\\\":1519769124134806,\\\"createdAt\\\":1728837708000,\\\"remark\\\":\\\"\\\"}]}}", - "x-request-example": "{\\\"currency\\\": \\\"XBT\\\", \\\"type\\\": \\\"MAIN\\\", \\\"tag\\\": [\\\"mock_a\\\", \\\"mock_b\\\"], \\\"startAt\\\": 1728663338000, \\\"endAt\\\": 1728692138000, \\\"currentPage\\\": 1, \\\"pageSize\\\": 50}" + "x-request-example": "{\\\"currency\\\": \\\"XBT\\\", \\\"type\\\": \\\"MAIN\\\", \\\"tag\\\": [\\\"mock_a\\\", \\\"mock_b\\\"], \\\"startAt\\\": 1728663338000, \\\"endAt\\\": 1728692138000, \\\"currentPage\\\": 1, \\\"pageSize\\\": 50}", + "operationId": "045" } }, "/api/v1/hist-withdrawals": { @@ -7531,7 +7578,8 @@ "x-sdk-method-description": "Request via this endpoint to get deposit list Items are paginated and sorted to show the latest first. See the Pagination section for retrieving additional entries after the first page.", "x-api-rate-limit": 20, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"currentPage\\\": 1,\\n \\\"pageSize\\\": 50,\\n \\\"totalNum\\\": 1,\\n \\\"totalPage\\\": 1,\\n \\\"items\\\": [\\n {\\n \\\"currency\\\": \\\"BTC\\\",\\n \\\"createAt\\\": 1526723468,\\n \\\"amount\\\": \\\"0.534\\\",\\n \\\"address\\\": \\\"33xW37ZSW4tQvg443Pc7NLCAs167Yc2XUV\\\",\\n \\\"walletTxId\\\": \\\"aeacea864c020acf58e51606169240e96774838dcd4f7ce48acf38e3651323f4\\\",\\n \\\"isInner\\\": false,\\n \\\"status\\\": \\\"SUCCESS\\\"\\n }\\n ]\\n }\\n}", - "x-request-example": "{\\\"currency\\\": \\\"BTC\\\", \\\"status\\\": \\\"SUCCESS\\\", \\\"startAt\\\": 1728663338000, \\\"endAt\\\": 1728692138000, \\\"currentPage\\\": 1, \\\"pageSize\\\": 50}" + "x-request-example": "{\\\"currency\\\": \\\"BTC\\\", \\\"status\\\": \\\"SUCCESS\\\", \\\"startAt\\\": 1728663338000, \\\"endAt\\\": 1728692138000, \\\"currentPage\\\": 1, \\\"pageSize\\\": 50}", + "operationId": "046" } }, "/api/v1/margin/account": { @@ -7627,7 +7675,8 @@ "x-sdk-method-name": "getMarginAccountDetail", "x-sdk-method-description": "Request via this endpoint to get the info of the margin account.", "x-api-rate-limit": 40, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"debtRatio\\\": \\\"0\\\",\\n \\\"accounts\\\": [\\n {\\n \\\"currency\\\": \\\"USDT\\\",\\n \\\"totalBalance\\\": \\\"0.03\\\",\\n \\\"availableBalance\\\": \\\"0.02\\\",\\n \\\"holdBalance\\\": \\\"0.01\\\",\\n \\\"liability\\\": \\\"0\\\",\\n \\\"maxBorrowSize\\\": \\\"0\\\"\\n }\\n ]\\n }\\n}" + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"debtRatio\\\": \\\"0\\\",\\n \\\"accounts\\\": [\\n {\\n \\\"currency\\\": \\\"USDT\\\",\\n \\\"totalBalance\\\": \\\"0.03\\\",\\n \\\"availableBalance\\\": \\\"0.02\\\",\\n \\\"holdBalance\\\": \\\"0.01\\\",\\n \\\"liability\\\": \\\"0\\\",\\n \\\"maxBorrowSize\\\": \\\"0\\\"\\n }\\n ]\\n }\\n}", + "operationId": "049" } }, "/api/v1/isolated/accounts": { @@ -7877,7 +7926,8 @@ "x-sdk-method-description": "Request via this endpoint to get the info list of the isolated margin account.", "x-api-rate-limit": 50, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"totalConversionBalance\\\": \\\"0.01\\\",\\n \\\"liabilityConversionBalance\\\": \\\"0\\\",\\n \\\"assets\\\": [\\n {\\n \\\"symbol\\\": \\\"BTC-USDT\\\",\\n \\\"status\\\": \\\"CLEAR\\\",\\n \\\"debtRatio\\\": \\\"0\\\",\\n \\\"baseAsset\\\": {\\n \\\"currency\\\": \\\"BTC\\\",\\n \\\"totalBalance\\\": \\\"0\\\",\\n \\\"holdBalance\\\": \\\"0\\\",\\n \\\"availableBalance\\\": \\\"0\\\",\\n \\\"liability\\\": \\\"0\\\",\\n \\\"interest\\\": \\\"0\\\",\\n \\\"borrowableAmount\\\": \\\"0\\\"\\n },\\n \\\"quoteAsset\\\": {\\n \\\"currency\\\": \\\"USDT\\\",\\n \\\"totalBalance\\\": \\\"0.01\\\",\\n \\\"holdBalance\\\": \\\"0\\\",\\n \\\"availableBalance\\\": \\\"0.01\\\",\\n \\\"liability\\\": \\\"0\\\",\\n \\\"interest\\\": \\\"0\\\",\\n \\\"borrowableAmount\\\": \\\"0\\\"\\n }\\n }\\n ]\\n }\\n}", - "x-request-example": "{\\\"balanceCurrency\\\": \\\"USDT\\\"}" + "x-request-example": "{\\\"balanceCurrency\\\": \\\"USDT\\\"}", + "operationId": "050" } }, "/api/v1/isolated/account/{symbol}": { @@ -8082,7 +8132,8 @@ "x-sdk-method-description": "Request via this endpoint to get the info of the isolated margin account.", "x-api-rate-limit": 50, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"symbol\\\": \\\"BTC-USDT\\\",\\n \\\"status\\\": \\\"CLEAR\\\",\\n \\\"debtRatio\\\": \\\"0\\\",\\n \\\"baseAsset\\\": {\\n \\\"currency\\\": \\\"BTC\\\",\\n \\\"totalBalance\\\": \\\"0\\\",\\n \\\"holdBalance\\\": \\\"0\\\",\\n \\\"availableBalance\\\": \\\"0\\\",\\n \\\"liability\\\": \\\"0\\\",\\n \\\"interest\\\": \\\"0\\\",\\n \\\"borrowableAmount\\\": \\\"0\\\"\\n },\\n \\\"quoteAsset\\\": {\\n \\\"currency\\\": \\\"USDT\\\",\\n \\\"totalBalance\\\": \\\"0.01\\\",\\n \\\"holdBalance\\\": \\\"0\\\",\\n \\\"availableBalance\\\": \\\"0.01\\\",\\n \\\"liability\\\": \\\"0\\\",\\n \\\"interest\\\": \\\"0\\\",\\n \\\"borrowableAmount\\\": \\\"0\\\"\\n }\\n }\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"example_string_default_value\\\"}" + "x-request-example": "{\\\"symbol\\\": \\\"example_string_default_value\\\"}", + "operationId": "051" } } }, diff --git a/spec/rest/entry/openapi-affiliate.json b/spec/rest/entry/openapi-affiliate.json index 552d6ce4..f67947e3 100644 --- a/spec/rest/entry/openapi-affiliate.json +++ b/spec/rest/entry/openapi-affiliate.json @@ -161,7 +161,8 @@ "x-sdk-method-name": "getAccount", "x-sdk-method-description": "This endpoint allows getting affiliate user rebate information.", "x-api-rate-limit": 30, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"parentUid\\\": \\\"1000000\\\",\\n \\\"orders\\\": [\\n {\\n \\\"orderId\\\": \\\"1668458892612980737\\\",\\n \\\"currency\\\": \\\"USDT\\\",\\n \\\"principal\\\": \\\"100\\\",\\n \\\"interest\\\": \\\"0\\\"\\n }\\n ],\\n \\\"ltv\\\": {\\n \\\"transferLtv\\\": \\\"0.6000\\\",\\n \\\"onlyClosePosLtv\\\": \\\"0.7500\\\",\\n \\\"delayedLiquidationLtv\\\": \\\"0.9000\\\",\\n \\\"instantLiquidationLtv\\\": \\\"0.9500\\\",\\n \\\"currentLtv\\\": \\\"0.0854\\\"\\n },\\n \\\"totalMarginAmount\\\": \\\"1170.36181573\\\",\\n \\\"transferMarginAmount\\\": \\\"166.66666666\\\",\\n \\\"margins\\\": [\\n {\\n \\\"marginCcy\\\": \\\"USDT\\\",\\n \\\"marginQty\\\": \\\"1170.36181573\\\",\\n \\\"marginFactor\\\": \\\"1.000000000000000000\\\"\\n }\\n ]\\n }\\n}" + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"parentUid\\\": \\\"1000000\\\",\\n \\\"orders\\\": [\\n {\\n \\\"orderId\\\": \\\"1668458892612980737\\\",\\n \\\"currency\\\": \\\"USDT\\\",\\n \\\"principal\\\": \\\"100\\\",\\n \\\"interest\\\": \\\"0\\\"\\n }\\n ],\\n \\\"ltv\\\": {\\n \\\"transferLtv\\\": \\\"0.6000\\\",\\n \\\"onlyClosePosLtv\\\": \\\"0.7500\\\",\\n \\\"delayedLiquidationLtv\\\": \\\"0.9000\\\",\\n \\\"instantLiquidationLtv\\\": \\\"0.9500\\\",\\n \\\"currentLtv\\\": \\\"0.0854\\\"\\n },\\n \\\"totalMarginAmount\\\": \\\"1170.36181573\\\",\\n \\\"transferMarginAmount\\\": \\\"166.66666666\\\",\\n \\\"margins\\\": [\\n {\\n \\\"marginCcy\\\": \\\"USDT\\\",\\n \\\"marginQty\\\": \\\"1170.36181573\\\",\\n \\\"marginFactor\\\": \\\"1.000000000000000000\\\"\\n }\\n ]\\n }\\n}", + "operationId": "001" } } }, diff --git a/spec/rest/entry/openapi-broker.json b/spec/rest/entry/openapi-broker.json index d006d117..320ecb8e 100644 --- a/spec/rest/entry/openapi-broker.json +++ b/spec/rest/entry/openapi-broker.json @@ -103,7 +103,8 @@ "x-sdk-method-description": "This interface supports downloading Broker rebate orders", "x-api-rate-limit": 3, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"url\\\": \\\"https://kc-v2-promotion.s3.ap-northeast-1.amazonaws.com/broker/671aec522593f600019766d0_file.csv?X-Amz-Security-Token=IQo*********2cd90f14efb\\\"\\n }\\n}", - "x-request-example": "{\\\"begin\\\": \\\"20240610\\\", \\\"end\\\": \\\"20241010\\\", \\\"tradeType\\\": \\\"1\\\"}" + "x-request-example": "{\\\"begin\\\": \\\"20240610\\\", \\\"end\\\": \\\"20241010\\\", \\\"tradeType\\\": \\\"1\\\"}", + "operationId": "001" } }, "/api/v1/broker/nd/info": { @@ -212,7 +213,8 @@ "x-sdk-method-description": "This endpoint supports querying the basic information of the current Broker", "x-api-rate-limit": 2, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"accountSize\\\": 0,\\n \\\"maxAccountSize\\\": null,\\n \\\"level\\\": 0\\n }\\n}", - "x-request-example": "{\\\"begin\\\": \\\"20240510\\\", \\\"end\\\": \\\"20241010\\\", \\\"tradeType\\\": \\\"1\\\"}" + "x-request-example": "{\\\"begin\\\": \\\"20240510\\\", \\\"end\\\": \\\"20241010\\\", \\\"tradeType\\\": \\\"1\\\"}", + "operationId": "002" } }, "/api/v1/broker/nd/account": { @@ -302,7 +304,8 @@ } }, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"accountName\\\": \\\"Account15\\\",\\n \\\"uid\\\": \\\"226383154\\\",\\n \\\"createdAt\\\": 1729819381908,\\n \\\"level\\\": 0\\n }\\n}", - "x-request-example": "{\\\"accountName\\\": \\\"Account1\\\"}" + "x-request-example": "{\\\"accountName\\\": \\\"Account1\\\"}", + "operationId": "003" }, "get": { "summary": "Get SubAccount", @@ -434,7 +437,8 @@ "x-sdk-method-description": "This interface supports querying sub-accounts created by Broker", "x-api-rate-limit": 2, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"currentPage\\\": 1,\\n \\\"pageSize\\\": 20,\\n \\\"totalNum\\\": 1,\\n \\\"totalPage\\\": 1,\\n \\\"items\\\": [\\n {\\n \\\"accountName\\\": \\\"Account15\\\",\\n \\\"uid\\\": \\\"226383154\\\",\\n \\\"createdAt\\\": 1729819382000,\\n \\\"level\\\": 0\\n }\\n ]\\n }\\n}", - "x-request-example": "{\\\"uid\\\": \\\"226383154\\\", \\\"currentPage\\\": 1, \\\"pageSize\\\": 20}" + "x-request-example": "{\\\"uid\\\": \\\"226383154\\\", \\\"currentPage\\\": 1, \\\"pageSize\\\": 20}", + "operationId": "004" } }, "/api/v1/broker/nd/account/apikey": { @@ -600,7 +604,8 @@ } }, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"uid\\\": \\\"226383154\\\",\\n \\\"label\\\": \\\"This is remarks\\\",\\n \\\"apiKey\\\": \\\"671afb36cee20f00015cfaf1\\\",\\n \\\"secretKey\\\": \\\"d694df2******5bae05b96\\\",\\n \\\"apiVersion\\\": 3,\\n \\\"permissions\\\": [\\n \\\"General\\\",\\n \\\"Spot\\\"\\n ],\\n \\\"ipWhitelist\\\": [\\n \\\"127.0.0.1\\\",\\n \\\"123.123.123.123\\\"\\n ],\\n \\\"createdAt\\\": 1729821494000\\n }\\n}", - "x-request-example": "{\\\"uid\\\": \\\"226383154\\\", \\\"passphrase\\\": \\\"11223344\\\", \\\"ipWhitelist\\\": [\\\"127.0.0.1\\\", \\\"123.123.123.123\\\"], \\\"permissions\\\": [\\\"general\\\", \\\"spot\\\"], \\\"label\\\": \\\"This is remarks\\\"}" + "x-request-example": "{\\\"uid\\\": \\\"226383154\\\", \\\"passphrase\\\": \\\"11223344\\\", \\\"ipWhitelist\\\": [\\\"127.0.0.1\\\", \\\"123.123.123.123\\\"], \\\"permissions\\\": [\\\"general\\\", \\\"spot\\\"], \\\"label\\\": \\\"This is remarks\\\"}", + "operationId": "005" }, "get": { "summary": "Get SubAccount API", @@ -734,7 +739,8 @@ "x-sdk-method-description": "This interface supports querying the Broker’s sub-account APIKEY", "x-api-rate-limit": 2, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": [\\n {\\n \\\"uid\\\": \\\"226383154\\\",\\n \\\"label\\\": \\\"This is remarks\\\",\\n \\\"apiKey\\\": \\\"671afb36cee20f00015cfaf1\\\",\\n \\\"apiVersion\\\": 3,\\n \\\"permissions\\\": [\\n \\\"General\\\",\\n \\\"Spot\\\"\\n ],\\n \\\"ipWhitelist\\\": [\\n \\\"127.**.1\\\",\\n \\\"203.**.154\\\"\\n ],\\n \\\"createdAt\\\": 1729821494000\\n }\\n ]\\n}", - "x-request-example": "{\\\"uid\\\": \\\"226383154\\\", \\\"apiKey\\\": \\\"671afb36cee20f00015cfaf1\\\"}" + "x-request-example": "{\\\"uid\\\": \\\"226383154\\\", \\\"apiKey\\\": \\\"671afb36cee20f00015cfaf1\\\"}", + "operationId": "006" }, "delete": { "summary": "Delete SubAccount API", @@ -797,7 +803,8 @@ "x-sdk-method-description": "This interface supports deleting Broker’s sub-account APIKEY", "x-api-rate-limit": 3, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": true\\n}", - "x-request-example": "{\\\"uid\\\": \\\"226383154\\\", \\\"apiKey\\\": \\\"671afb36cee20f00015cfaf1\\\"}" + "x-request-example": "{\\\"uid\\\": \\\"226383154\\\", \\\"apiKey\\\": \\\"671afb36cee20f00015cfaf1\\\"}", + "operationId": "008" } }, "/api/v1/broker/nd/account/update-apikey": { @@ -958,7 +965,8 @@ } }, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"uid\\\": \\\"226383154\\\",\\n \\\"label\\\": \\\"This is remarks\\\",\\n \\\"apiKey\\\": \\\"671afb36cee20f00015cfaf1\\\",\\n \\\"apiVersion\\\": 3,\\n \\\"permissions\\\": [\\n \\\"General\\\",\\n \\\"Spot\\\"\\n ],\\n \\\"ipWhitelist\\\": [\\n \\\"127.**.1\\\",\\n \\\"123.**.123\\\"\\n ],\\n \\\"createdAt\\\": 1729821494000\\n }\\n}", - "x-request-example": "{\\\"uid\\\": \\\"226383154\\\", \\\"apiKey\\\": \\\"671afb36cee20f00015cfaf1\\\", \\\"ipWhitelist\\\": [\\\"127.0.0.1\\\", \\\"123.123.123.123\\\"], \\\"permissions\\\": [\\\"general\\\", \\\"spot\\\"], \\\"label\\\": \\\"This is remarks\\\"}" + "x-request-example": "{\\\"uid\\\": \\\"226383154\\\", \\\"apiKey\\\": \\\"671afb36cee20f00015cfaf1\\\", \\\"ipWhitelist\\\": [\\\"127.0.0.1\\\", \\\"123.123.123.123\\\"], \\\"permissions\\\": [\\\"general\\\", \\\"spot\\\"], \\\"label\\\": \\\"This is remarks\\\"}", + "operationId": "007" } }, "/api/v1/broker/nd/transfer": { @@ -1110,7 +1118,8 @@ } }, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"orderId\\\": \\\"671b4600c1e3dd000726866d\\\"\\n }\\n}", - "x-request-example": "{\\\"currency\\\": \\\"USDT\\\", \\\"amount\\\": \\\"1\\\", \\\"clientOid\\\": \\\"e6c24d23-6bc2-401b-bf9e-55e2daddfbc1\\\", \\\"direction\\\": \\\"OUT\\\", \\\"accountType\\\": \\\"MAIN\\\", \\\"specialUid\\\": \\\"226383154\\\", \\\"specialAccountType\\\": \\\"MAIN\\\"}" + "x-request-example": "{\\\"currency\\\": \\\"USDT\\\", \\\"amount\\\": \\\"1\\\", \\\"clientOid\\\": \\\"e6c24d23-6bc2-401b-bf9e-55e2daddfbc1\\\", \\\"direction\\\": \\\"OUT\\\", \\\"accountType\\\": \\\"MAIN\\\", \\\"specialUid\\\": \\\"226383154\\\", \\\"specialAccountType\\\": \\\"MAIN\\\"}", + "operationId": "009" } }, "/api/v3/broker/nd/transfer/detail": { @@ -1331,7 +1340,8 @@ "x-sdk-method-description": "This endpoint supports querying transfer records of the broker itself and its created sub-accounts.", "x-api-rate-limit": 1, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"orderId\\\": \\\"671b4600c1e3dd000726866d\\\",\\n \\\"currency\\\": \\\"USDT\\\",\\n \\\"amount\\\": \\\"1\\\",\\n \\\"fromUid\\\": 165111215,\\n \\\"fromAccountType\\\": \\\"MAIN\\\",\\n \\\"fromAccountTag\\\": \\\"DEFAULT\\\",\\n \\\"toUid\\\": 226383154,\\n \\\"toAccountType\\\": \\\"MAIN\\\",\\n \\\"toAccountTag\\\": \\\"DEFAULT\\\",\\n \\\"status\\\": \\\"SUCCESS\\\",\\n \\\"reason\\\": null,\\n \\\"createdAt\\\": 1729840640000\\n }\\n}", - "x-request-example": "{\\\"orderId\\\": \\\"671b4600c1e3dd000726866d\\\"}" + "x-request-example": "{\\\"orderId\\\": \\\"671b4600c1e3dd000726866d\\\"}", + "operationId": "010" } }, "/api/v1/asset/ndbroker/deposit/list": { @@ -1549,7 +1559,8 @@ "x-sdk-method-description": "This endpoint can obtain the deposit records of each sub-account under the ND Broker.", "x-api-rate-limit": 10, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": [\\n {\\n \\\"uid\\\": 165111215,\\n \\\"hash\\\": \\\"6724e363a492800007ec602b\\\",\\n \\\"address\\\": \\\"xxxxxxx@gmail.com\\\",\\n \\\"memo\\\": \\\"\\\",\\n \\\"amount\\\": \\\"3.0\\\",\\n \\\"fee\\\": \\\"0.0\\\",\\n \\\"currency\\\": \\\"USDT\\\",\\n \\\"isInner\\\": true,\\n \\\"walletTxId\\\": \\\"bbbbbbbbb\\\",\\n \\\"status\\\": \\\"SUCCESS\\\",\\n \\\"chain\\\": \\\"\\\",\\n \\\"remark\\\": \\\"\\\",\\n \\\"createdAt\\\": 1730470760000,\\n \\\"updatedAt\\\": 1730470760000\\n }\\n ]\\n}", - "x-request-example": "{\\\"currency\\\": \\\"USDT\\\", \\\"status\\\": \\\"SUCCESS\\\", \\\"hash\\\": \\\"example_string_default_value\\\", \\\"startTimestamp\\\": 123456, \\\"endTimestamp\\\": 123456, \\\"limit\\\": 100}" + "x-request-example": "{\\\"currency\\\": \\\"USDT\\\", \\\"status\\\": \\\"SUCCESS\\\", \\\"hash\\\": \\\"example_string_default_value\\\", \\\"startTimestamp\\\": 123456, \\\"endTimestamp\\\": 123456, \\\"limit\\\": 100}", + "operationId": "011" } }, "/api/v3/broker/nd/deposit/detail": { @@ -1712,7 +1723,8 @@ "x-sdk-method-description": "This endpoint supports querying the deposit record of sub-accounts created by a Broker (excluding main account of nd broker)", "x-api-rate-limit": 1, "x-response-example": "{\\n \\\"data\\\" : {\\n \\\"chain\\\" : \\\"trx\\\",\\n \\\"hash\\\" : \\\"30bb0e0b***4156c5188\\\",\\n \\\"walletTxId\\\" : \\\"30bb0***610d1030f\\\",\\n \\\"uid\\\" : 201496341,\\n \\\"updatedAt\\\" : 1713429174000,\\n \\\"amount\\\" : \\\"8.5\\\",\\n \\\"memo\\\" : \\\"\\\",\\n \\\"fee\\\" : \\\"0.0\\\",\\n \\\"address\\\" : \\\"THLPzUrbd1o***vP7d\\\",\\n \\\"remark\\\" : \\\"Deposit\\\",\\n \\\"isInner\\\" : false,\\n \\\"currency\\\" : \\\"USDT\\\",\\n \\\"status\\\" : \\\"SUCCESS\\\",\\n \\\"createdAt\\\" : 1713429173000\\n },\\n \\\"code\\\" : \\\"200000\\\"\\n}", - "x-request-example": "{\\\"currency\\\": \\\"USDT\\\", \\\"hash\\\": \\\"30bb0e0b***4156c5188\\\"}" + "x-request-example": "{\\\"currency\\\": \\\"USDT\\\", \\\"hash\\\": \\\"30bb0e0b***4156c5188\\\"}", + "operationId": "012" } }, "/api/v3/broker/nd/withdraw/detail": { @@ -1878,7 +1890,8 @@ "x-sdk-method-description": "This endpoint supports querying the withdrawal records of sub-accounts created by a Broker (excluding main account of nd broker).", "x-api-rate-limit": 1, "x-response-example": "{\\n \\\"data\\\": {\\n \\\"id\\\": \\\"66617a2***3c9a\\\",\\n \\\"chain\\\": \\\"ton\\\",\\n \\\"walletTxId\\\": \\\"AJ***eRI=\\\",\\n \\\"uid\\\": 157267400,\\n \\\"amount\\\": \\\"1.00000000\\\",\\n \\\"memo\\\": \\\"7025734\\\",\\n \\\"fee\\\": \\\"0.00000000\\\",\\n \\\"address\\\": \\\"EQDn***dKbGzr\\\",\\n \\\"remark\\\": \\\"\\\",\\n \\\"isInner\\\": false,\\n \\\"currency\\\": \\\"USDT\\\",\\n \\\"status\\\": \\\"SUCCESS\\\",\\n \\\"createdAt\\\": 1717664288000,\\n \\\"updatedAt\\\": 1717664375000\\n },\\n \\\"code\\\": \\\"200000\\\"\\n}", - "x-request-example": "{\\\"withdrawalId\\\": \\\"66617a2***3c9a\\\"}" + "x-request-example": "{\\\"withdrawalId\\\": \\\"66617a2***3c9a\\\"}", + "operationId": "013" } }, "/api/v1/broker/nd/rebase/download": { @@ -1977,7 +1990,8 @@ "x-sdk-method-description": "This interface supports downloading Broker rebate orders", "x-api-rate-limit": 3, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"url\\\": \\\"https://kc-v2-promotion.s3.ap-northeast-1.amazonaws.com/broker/671aec522593f600019766d0_file.csv?X-Amz-Security-Token=IQo*********2cd90f14efb\\\"\\n }\\n}", - "x-request-example": "{\\\"begin\\\": \\\"20240610\\\", \\\"end\\\": \\\"20241010\\\", \\\"tradeType\\\": \\\"1\\\"}" + "x-request-example": "{\\\"begin\\\": \\\"20240610\\\", \\\"end\\\": \\\"20241010\\\", \\\"tradeType\\\": \\\"1\\\"}", + "operationId": "014" } } }, diff --git a/spec/rest/entry/openapi-earn.json b/spec/rest/entry/openapi-earn.json index f445a1de..aebf6a34 100644 --- a/spec/rest/entry/openapi-earn.json +++ b/spec/rest/entry/openapi-earn.json @@ -109,7 +109,8 @@ } }, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"orderId\\\": \\\"2767291\\\",\\n \\\"orderTxId\\\": \\\"6603694\\\"\\n }\\n}", - "x-request-example": "{\\\"productId\\\": \\\"2611\\\", \\\"amount\\\": \\\"1\\\", \\\"accountType\\\": \\\"TRADE\\\"}" + "x-request-example": "{\\\"productId\\\": \\\"2611\\\", \\\"amount\\\": \\\"1\\\", \\\"accountType\\\": \\\"TRADE\\\"}", + "operationId": "001" }, "delete": { "summary": "Redeem", @@ -250,7 +251,8 @@ "x-sdk-method-description": "This endpoint allows initiating redemption by holding ID. If the current holding is fully redeemed or in the process of being redeemed, it indicates that the holding does not exist.", "x-api-rate-limit": 5, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"orderTxId\\\": \\\"6603700\\\",\\n \\\"deliverTime\\\": 1729517805000,\\n \\\"status\\\": \\\"PENDING\\\",\\n \\\"amount\\\": \\\"1\\\"\\n }\\n}", - "x-request-example": "{\\\"orderId\\\": \\\"2767291\\\", \\\"amount\\\": \\\"example_string_default_value\\\", \\\"fromAccountType\\\": \\\"MAIN\\\", \\\"confirmPunishRedeem\\\": \\\"1\\\"}" + "x-request-example": "{\\\"orderId\\\": \\\"2767291\\\", \\\"amount\\\": \\\"example_string_default_value\\\", \\\"fromAccountType\\\": \\\"MAIN\\\", \\\"confirmPunishRedeem\\\": \\\"1\\\"}", + "operationId": "003" } }, "/api/v1/earn/redeem-preview": { @@ -376,7 +378,8 @@ "x-sdk-method-description": "This endpoint allows subscribing earn products", "x-api-rate-limit": 5, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"currency\\\": \\\"KCS\\\",\\n \\\"redeemAmount\\\": \\\"1\\\",\\n \\\"penaltyInterestAmount\\\": \\\"0\\\",\\n \\\"redeemPeriod\\\": 3,\\n \\\"deliverTime\\\": 1729518951000,\\n \\\"manualRedeemable\\\": true,\\n \\\"redeemAll\\\": false\\n }\\n}", - "x-request-example": "{\\\"orderId\\\": \\\"2767291\\\", \\\"fromAccountType\\\": \\\"MAIN\\\"}" + "x-request-example": "{\\\"orderId\\\": \\\"2767291\\\", \\\"fromAccountType\\\": \\\"MAIN\\\"}", + "operationId": "002" } }, "/api/v1/earn/saving/products": { @@ -698,7 +701,8 @@ "x-sdk-method-description": "This endpoint can get available savings products. If no products are available, an empty list is returned.", "x-api-rate-limit": 5, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": [\\n {\\n \\\"id\\\": \\\"2172\\\",\\n \\\"currency\\\": \\\"BTC\\\",\\n \\\"category\\\": \\\"DEMAND\\\",\\n \\\"type\\\": \\\"DEMAND\\\",\\n \\\"precision\\\": 8,\\n \\\"productUpperLimit\\\": \\\"480\\\",\\n \\\"productRemainAmount\\\": \\\"132.36153083\\\",\\n \\\"userUpperLimit\\\": \\\"20\\\",\\n \\\"userLowerLimit\\\": \\\"0.01\\\",\\n \\\"redeemPeriod\\\": 0,\\n \\\"lockStartTime\\\": 1644807600000,\\n \\\"lockEndTime\\\": null,\\n \\\"applyStartTime\\\": 1644807600000,\\n \\\"applyEndTime\\\": null,\\n \\\"returnRate\\\": \\\"0.00047208\\\",\\n \\\"incomeCurrency\\\": \\\"BTC\\\",\\n \\\"earlyRedeemSupported\\\": 0,\\n \\\"status\\\": \\\"ONGOING\\\",\\n \\\"redeemType\\\": \\\"MANUAL\\\",\\n \\\"incomeReleaseType\\\": \\\"DAILY\\\",\\n \\\"interestDate\\\": 1729267200000,\\n \\\"duration\\\": 0,\\n \\\"newUserOnly\\\": 0\\n }\\n ]\\n}", - "x-request-example": "{\\\"currency\\\": \\\"BTC\\\"}" + "x-request-example": "{\\\"currency\\\": \\\"BTC\\\"}", + "operationId": "004" } }, "/api/v1/earn/promotion/products": { @@ -1020,7 +1024,8 @@ "x-sdk-method-description": "This endpoint can get available limited-time promotion products. If no products are available, an empty list is returned.", "x-api-rate-limit": 5, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": [\\n {\\n \\\"id\\\": \\\"2685\\\",\\n \\\"currency\\\": \\\"BTC\\\",\\n \\\"category\\\": \\\"ACTIVITY\\\",\\n \\\"type\\\": \\\"TIME\\\",\\n \\\"precision\\\": 8,\\n \\\"productUpperLimit\\\": \\\"50\\\",\\n \\\"userUpperLimit\\\": \\\"1\\\",\\n \\\"userLowerLimit\\\": \\\"0.001\\\",\\n \\\"redeemPeriod\\\": 0,\\n \\\"lockStartTime\\\": 1702371601000,\\n \\\"lockEndTime\\\": 1729858405000,\\n \\\"applyStartTime\\\": 1702371600000,\\n \\\"applyEndTime\\\": null,\\n \\\"returnRate\\\": \\\"0.03\\\",\\n \\\"incomeCurrency\\\": \\\"BTC\\\",\\n \\\"earlyRedeemSupported\\\": 0,\\n \\\"productRemainAmount\\\": \\\"49.78203998\\\",\\n \\\"status\\\": \\\"ONGOING\\\",\\n \\\"redeemType\\\": \\\"TRANS_DEMAND\\\",\\n \\\"incomeReleaseType\\\": \\\"DAILY\\\",\\n \\\"interestDate\\\": 1729253605000,\\n \\\"duration\\\": 7,\\n \\\"newUserOnly\\\": 1\\n }\\n ]\\n}", - "x-request-example": "{\\\"currency\\\": \\\"BTC\\\"}" + "x-request-example": "{\\\"currency\\\": \\\"BTC\\\"}", + "operationId": "005" } }, "/api/v1/earn/hold-assets": { @@ -1309,7 +1314,8 @@ "x-sdk-method-description": "This endpoint can get current holding assets information. If no current holding assets are available, an empty list is returned.", "x-api-rate-limit": 5, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"totalNum\\\": 1,\\n \\\"totalPage\\\": 1,\\n \\\"currentPage\\\": 1,\\n \\\"pageSize\\\": 15,\\n \\\"items\\\": [\\n {\\n \\\"orderId\\\": \\\"2767291\\\",\\n \\\"productId\\\": \\\"2611\\\",\\n \\\"productCategory\\\": \\\"KCS_STAKING\\\",\\n \\\"productType\\\": \\\"DEMAND\\\",\\n \\\"currency\\\": \\\"KCS\\\",\\n \\\"incomeCurrency\\\": \\\"KCS\\\",\\n \\\"returnRate\\\": \\\"0.03471727\\\",\\n \\\"holdAmount\\\": \\\"1\\\",\\n \\\"redeemedAmount\\\": \\\"0\\\",\\n \\\"redeemingAmount\\\": \\\"1\\\",\\n \\\"lockStartTime\\\": 1701252000000,\\n \\\"lockEndTime\\\": null,\\n \\\"purchaseTime\\\": 1729257513000,\\n \\\"redeemPeriod\\\": 3,\\n \\\"status\\\": \\\"REDEEMING\\\",\\n \\\"earlyRedeemSupported\\\": 0\\n }\\n ]\\n }\\n}", - "x-request-example": "{\\\"currency\\\": \\\"KCS\\\", \\\"productId\\\": \\\"example_string_default_value\\\", \\\"productCategory\\\": \\\"DEMAND\\\", \\\"currentPage\\\": 1, \\\"pageSize\\\": 10}" + "x-request-example": "{\\\"currency\\\": \\\"KCS\\\", \\\"productId\\\": \\\"example_string_default_value\\\", \\\"productCategory\\\": \\\"DEMAND\\\", \\\"currentPage\\\": 1, \\\"pageSize\\\": 10}", + "operationId": "006" } }, "/api/v1/earn/staking/products": { @@ -1631,7 +1637,8 @@ "x-sdk-method-description": "This endpoint can get available staking products. If no products are available, an empty list is returned.", "x-api-rate-limit": 5, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": [\\n {\\n \\\"id\\\": \\\"2535\\\",\\n \\\"currency\\\": \\\"STX\\\",\\n \\\"category\\\": \\\"STAKING\\\",\\n \\\"type\\\": \\\"DEMAND\\\",\\n \\\"precision\\\": 8,\\n \\\"productUpperLimit\\\": \\\"1000000\\\",\\n \\\"userUpperLimit\\\": \\\"10000\\\",\\n \\\"userLowerLimit\\\": \\\"1\\\",\\n \\\"redeemPeriod\\\": 14,\\n \\\"lockStartTime\\\": 1688614514000,\\n \\\"lockEndTime\\\": null,\\n \\\"applyStartTime\\\": 1688614512000,\\n \\\"applyEndTime\\\": null,\\n \\\"returnRate\\\": \\\"0.045\\\",\\n \\\"incomeCurrency\\\": \\\"BTC\\\",\\n \\\"earlyRedeemSupported\\\": 0,\\n \\\"productRemainAmount\\\": \\\"254032.90178701\\\",\\n \\\"status\\\": \\\"ONGOING\\\",\\n \\\"redeemType\\\": \\\"MANUAL\\\",\\n \\\"incomeReleaseType\\\": \\\"DAILY\\\",\\n \\\"interestDate\\\": 1729267200000,\\n \\\"duration\\\": 0,\\n \\\"newUserOnly\\\": 0\\n }\\n ]\\n}", - "x-request-example": "{\\\"currency\\\": \\\"BTC\\\"}" + "x-request-example": "{\\\"currency\\\": \\\"BTC\\\"}", + "operationId": "007" } }, "/api/v1/earn/kcs-staking/products": { @@ -1951,7 +1958,8 @@ "x-sdk-method-description": "This endpoint can get available KCS staking products. If no products are available, an empty list is returned.", "x-api-rate-limit": 5, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": [\\n {\\n \\\"id\\\": \\\"2611\\\",\\n \\\"currency\\\": \\\"KCS\\\",\\n \\\"category\\\": \\\"KCS_STAKING\\\",\\n \\\"type\\\": \\\"DEMAND\\\",\\n \\\"precision\\\": 8,\\n \\\"productUpperLimit\\\": \\\"100000000\\\",\\n \\\"userUpperLimit\\\": \\\"100000000\\\",\\n \\\"userLowerLimit\\\": \\\"1\\\",\\n \\\"redeemPeriod\\\": 3,\\n \\\"lockStartTime\\\": 1701252000000,\\n \\\"lockEndTime\\\": null,\\n \\\"applyStartTime\\\": 1701252000000,\\n \\\"applyEndTime\\\": null,\\n \\\"returnRate\\\": \\\"0.03471727\\\",\\n \\\"incomeCurrency\\\": \\\"KCS\\\",\\n \\\"earlyRedeemSupported\\\": 0,\\n \\\"productRemainAmount\\\": \\\"58065850.54998251\\\",\\n \\\"status\\\": \\\"ONGOING\\\",\\n \\\"redeemType\\\": \\\"MANUAL\\\",\\n \\\"incomeReleaseType\\\": \\\"DAILY\\\",\\n \\\"interestDate\\\": 1729267200000,\\n \\\"duration\\\": 0,\\n \\\"newUserOnly\\\": 0\\n }\\n ]\\n}", - "x-request-example": "{\\\"currency\\\": \\\"BTC\\\"}" + "x-request-example": "{\\\"currency\\\": \\\"BTC\\\"}", + "operationId": "008" } }, "/api/v1/earn/eth-staking/products": { @@ -2263,7 +2271,8 @@ "x-sdk-method-description": "This endpoint can get available ETH staking products. If no products are available, an empty list is returned.", "x-api-rate-limit": 5, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": [\\n {\\n \\\"id\\\": \\\"ETH2\\\",\\n \\\"category\\\": \\\"ETH2\\\",\\n \\\"type\\\": \\\"DEMAND\\\",\\n \\\"precision\\\": 8,\\n \\\"currency\\\": \\\"ETH\\\",\\n \\\"incomeCurrency\\\": \\\"ETH2\\\",\\n \\\"returnRate\\\": \\\"0.028\\\",\\n \\\"userLowerLimit\\\": \\\"0.01\\\",\\n \\\"userUpperLimit\\\": \\\"8557.3597075\\\",\\n \\\"productUpperLimit\\\": \\\"8557.3597075\\\",\\n \\\"productRemainAmount\\\": \\\"8557.3597075\\\",\\n \\\"redeemPeriod\\\": 5,\\n \\\"redeemType\\\": \\\"MANUAL\\\",\\n \\\"incomeReleaseType\\\": \\\"DAILY\\\",\\n \\\"applyStartTime\\\": 1729255485000,\\n \\\"applyEndTime\\\": null,\\n \\\"lockStartTime\\\": 1729255485000,\\n \\\"lockEndTime\\\": null,\\n \\\"interestDate\\\": 1729267200000,\\n \\\"newUserOnly\\\": 0,\\n \\\"earlyRedeemSupported\\\": 0,\\n \\\"duration\\\": 0,\\n \\\"status\\\": \\\"ONGOING\\\"\\n }\\n ]\\n}", - "x-request-example": "{\\\"currency\\\": \\\"BTC\\\"}" + "x-request-example": "{\\\"currency\\\": \\\"BTC\\\"}", + "operationId": "009" } } }, diff --git a/spec/rest/entry/openapi-futures.json b/spec/rest/entry/openapi-futures.json index 44f65715..2e4393f7 100644 --- a/spec/rest/entry/openapi-futures.json +++ b/spec/rest/entry/openapi-futures.json @@ -468,7 +468,8 @@ "x-sdk-method-description": "Get information of specified contracts that can be traded. This API will return a list of tradable contracts, including some key parameters of the contract such as the symbol name, tick size, mark price,etc.", "x-api-rate-limit": 3, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"symbol\\\": \\\"XBTUSDM\\\",\\n \\\"rootSymbol\\\": \\\"XBT\\\",\\n \\\"type\\\": \\\"FFWCSX\\\",\\n \\\"firstOpenDate\\\": 1552638575000,\\n \\\"expireDate\\\": null,\\n \\\"settleDate\\\": null,\\n \\\"baseCurrency\\\": \\\"XBT\\\",\\n \\\"quoteCurrency\\\": \\\"USD\\\",\\n \\\"settleCurrency\\\": \\\"XBT\\\",\\n \\\"maxOrderQty\\\": 10000000,\\n \\\"maxPrice\\\": 1000000.0,\\n \\\"lotSize\\\": 1,\\n \\\"tickSize\\\": 0.1,\\n \\\"indexPriceTickSize\\\": 0.1,\\n \\\"multiplier\\\": -1.0,\\n \\\"initialMargin\\\": 0.014,\\n \\\"maintainMargin\\\": 0.007,\\n \\\"maxRiskLimit\\\": 1,\\n \\\"minRiskLimit\\\": 1,\\n \\\"riskStep\\\": 0,\\n \\\"makerFeeRate\\\": 2.0E-4,\\n \\\"takerFeeRate\\\": 6.0E-4,\\n \\\"takerFixFee\\\": 0.0,\\n \\\"makerFixFee\\\": 0.0,\\n \\\"settlementFee\\\": null,\\n \\\"isDeleverage\\\": true,\\n \\\"isQuanto\\\": false,\\n \\\"isInverse\\\": true,\\n \\\"markMethod\\\": \\\"FairPrice\\\",\\n \\\"fairMethod\\\": \\\"FundingRate\\\",\\n \\\"fundingBaseSymbol\\\": \\\".XBTINT8H\\\",\\n \\\"fundingQuoteSymbol\\\": \\\".USDINT8H\\\",\\n \\\"fundingRateSymbol\\\": \\\".XBTUSDMFPI8H\\\",\\n \\\"indexSymbol\\\": \\\".BXBT\\\",\\n \\\"settlementSymbol\\\": null,\\n \\\"status\\\": \\\"Open\\\",\\n \\\"fundingFeeRate\\\": 1.75E-4,\\n \\\"predictedFundingFeeRate\\\": 1.76E-4,\\n \\\"fundingRateGranularity\\\": 28800000,\\n \\\"openInterest\\\": \\\"61725904\\\",\\n \\\"turnoverOf24h\\\": 209.56303473,\\n \\\"volumeOf24h\\\": 1.4354731E7,\\n \\\"markPrice\\\": 68336.7,\\n \\\"indexPrice\\\": 68335.29,\\n \\\"lastTradePrice\\\": 68349.3,\\n \\\"nextFundingRateTime\\\": 17402942,\\n \\\"maxLeverage\\\": 75,\\n \\\"sourceExchanges\\\": [\\n \\\"kraken\\\",\\n \\\"bitstamp\\\",\\n \\\"crypto\\\"\\n ],\\n \\\"premiumsSymbol1M\\\": \\\".XBTUSDMPI\\\",\\n \\\"premiumsSymbol8H\\\": \\\".XBTUSDMPI8H\\\",\\n \\\"fundingBaseSymbol1M\\\": \\\".XBTINT\\\",\\n \\\"fundingQuoteSymbol1M\\\": \\\".USDINT\\\",\\n \\\"lowPrice\\\": 67436.7,\\n \\\"highPrice\\\": 69471.8,\\n \\\"priceChgPct\\\": 0.0097,\\n \\\"priceChg\\\": 658.7,\\n \\\"k\\\": 2645000.0,\\n \\\"m\\\": 1640000.0,\\n \\\"f\\\": 1.3,\\n \\\"mmrLimit\\\": 0.3,\\n \\\"mmrLevConstant\\\": 75.0,\\n \\\"supportCross\\\": true\\n }\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDTM\\\"}" + "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDTM\\\"}", + "operationId": "001" } }, "/api/v1/contracts/active": { @@ -923,7 +924,8 @@ "x-sdk-method-name": "GetAllSymbols", "x-sdk-method-description": "Get detailed information of all contracts that can be traded. This API will return a list of tradable contracts, including some key parameters of the contract such as the symbol name, tick size, mark price,etc.", "x-api-rate-limit": 3, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": [\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"rootSymbol\\\": \\\"USDT\\\",\\n \\\"type\\\": \\\"FFWCSX\\\",\\n \\\"firstOpenDate\\\": 1585555200000,\\n \\\"expireDate\\\": null,\\n \\\"settleDate\\\": null,\\n \\\"baseCurrency\\\": \\\"XBT\\\",\\n \\\"quoteCurrency\\\": \\\"USDT\\\",\\n \\\"settleCurrency\\\": \\\"USDT\\\",\\n \\\"maxOrderQty\\\": 1000000,\\n \\\"maxPrice\\\": 1000000.0,\\n \\\"lotSize\\\": 1,\\n \\\"tickSize\\\": 0.1,\\n \\\"indexPriceTickSize\\\": 0.01,\\n \\\"multiplier\\\": 0.001,\\n \\\"initialMargin\\\": 0.008,\\n \\\"maintainMargin\\\": 0.004,\\n \\\"maxRiskLimit\\\": 100000,\\n \\\"minRiskLimit\\\": 100000,\\n \\\"riskStep\\\": 50000,\\n \\\"makerFeeRate\\\": 2.0E-4,\\n \\\"takerFeeRate\\\": 6.0E-4,\\n \\\"takerFixFee\\\": 0.0,\\n \\\"makerFixFee\\\": 0.0,\\n \\\"settlementFee\\\": null,\\n \\\"isDeleverage\\\": true,\\n \\\"isQuanto\\\": true,\\n \\\"isInverse\\\": false,\\n \\\"markMethod\\\": \\\"FairPrice\\\",\\n \\\"fairMethod\\\": \\\"FundingRate\\\",\\n \\\"fundingBaseSymbol\\\": \\\".XBTINT8H\\\",\\n \\\"fundingQuoteSymbol\\\": \\\".USDTINT8H\\\",\\n \\\"fundingRateSymbol\\\": \\\".XBTUSDTMFPI8H\\\",\\n \\\"indexSymbol\\\": \\\".KXBTUSDT\\\",\\n \\\"settlementSymbol\\\": \\\"\\\",\\n \\\"status\\\": \\\"Open\\\",\\n \\\"fundingFeeRate\\\": 1.53E-4,\\n \\\"predictedFundingFeeRate\\\": 8.0E-5,\\n \\\"fundingRateGranularity\\\": 28800000,\\n \\\"openInterest\\\": \\\"6384957\\\",\\n \\\"turnoverOf24h\\\": 5.788402220999069E8,\\n \\\"volumeOf24h\\\": 8274.432,\\n \\\"markPrice\\\": 69732.33,\\n \\\"indexPrice\\\": 69732.32,\\n \\\"lastTradePrice\\\": 69732,\\n \\\"nextFundingRateTime\\\": 21265941,\\n \\\"maxLeverage\\\": 125,\\n \\\"sourceExchanges\\\": [\\n \\\"okex\\\",\\n \\\"binance\\\",\\n \\\"kucoin\\\",\\n \\\"bybit\\\",\\n \\\"bitmart\\\",\\n \\\"gateio\\\"\\n ],\\n \\\"premiumsSymbol1M\\\": \\\".XBTUSDTMPI\\\",\\n \\\"premiumsSymbol8H\\\": \\\".XBTUSDTMPI8H\\\",\\n \\\"fundingBaseSymbol1M\\\": \\\".XBTINT\\\",\\n \\\"fundingQuoteSymbol1M\\\": \\\".USDTINT\\\",\\n \\\"lowPrice\\\": 68817.5,\\n \\\"highPrice\\\": 71615.8,\\n \\\"priceChgPct\\\": 6.0E-4,\\n \\\"priceChg\\\": 48.0,\\n \\\"k\\\": 490.0,\\n \\\"m\\\": 300.0,\\n \\\"f\\\": 1.3,\\n \\\"mmrLimit\\\": 0.3,\\n \\\"mmrLevConstant\\\": 125.0,\\n \\\"supportCross\\\": true\\n }\\n ]\\n}" + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": [\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"rootSymbol\\\": \\\"USDT\\\",\\n \\\"type\\\": \\\"FFWCSX\\\",\\n \\\"firstOpenDate\\\": 1585555200000,\\n \\\"expireDate\\\": null,\\n \\\"settleDate\\\": null,\\n \\\"baseCurrency\\\": \\\"XBT\\\",\\n \\\"quoteCurrency\\\": \\\"USDT\\\",\\n \\\"settleCurrency\\\": \\\"USDT\\\",\\n \\\"maxOrderQty\\\": 1000000,\\n \\\"maxPrice\\\": 1000000.0,\\n \\\"lotSize\\\": 1,\\n \\\"tickSize\\\": 0.1,\\n \\\"indexPriceTickSize\\\": 0.01,\\n \\\"multiplier\\\": 0.001,\\n \\\"initialMargin\\\": 0.008,\\n \\\"maintainMargin\\\": 0.004,\\n \\\"maxRiskLimit\\\": 100000,\\n \\\"minRiskLimit\\\": 100000,\\n \\\"riskStep\\\": 50000,\\n \\\"makerFeeRate\\\": 2.0E-4,\\n \\\"takerFeeRate\\\": 6.0E-4,\\n \\\"takerFixFee\\\": 0.0,\\n \\\"makerFixFee\\\": 0.0,\\n \\\"settlementFee\\\": null,\\n \\\"isDeleverage\\\": true,\\n \\\"isQuanto\\\": true,\\n \\\"isInverse\\\": false,\\n \\\"markMethod\\\": \\\"FairPrice\\\",\\n \\\"fairMethod\\\": \\\"FundingRate\\\",\\n \\\"fundingBaseSymbol\\\": \\\".XBTINT8H\\\",\\n \\\"fundingQuoteSymbol\\\": \\\".USDTINT8H\\\",\\n \\\"fundingRateSymbol\\\": \\\".XBTUSDTMFPI8H\\\",\\n \\\"indexSymbol\\\": \\\".KXBTUSDT\\\",\\n \\\"settlementSymbol\\\": \\\"\\\",\\n \\\"status\\\": \\\"Open\\\",\\n \\\"fundingFeeRate\\\": 1.53E-4,\\n \\\"predictedFundingFeeRate\\\": 8.0E-5,\\n \\\"fundingRateGranularity\\\": 28800000,\\n \\\"openInterest\\\": \\\"6384957\\\",\\n \\\"turnoverOf24h\\\": 5.788402220999069E8,\\n \\\"volumeOf24h\\\": 8274.432,\\n \\\"markPrice\\\": 69732.33,\\n \\\"indexPrice\\\": 69732.32,\\n \\\"lastTradePrice\\\": 69732,\\n \\\"nextFundingRateTime\\\": 21265941,\\n \\\"maxLeverage\\\": 125,\\n \\\"sourceExchanges\\\": [\\n \\\"okex\\\",\\n \\\"binance\\\",\\n \\\"kucoin\\\",\\n \\\"bybit\\\",\\n \\\"bitmart\\\",\\n \\\"gateio\\\"\\n ],\\n \\\"premiumsSymbol1M\\\": \\\".XBTUSDTMPI\\\",\\n \\\"premiumsSymbol8H\\\": \\\".XBTUSDTMPI8H\\\",\\n \\\"fundingBaseSymbol1M\\\": \\\".XBTINT\\\",\\n \\\"fundingQuoteSymbol1M\\\": \\\".USDTINT\\\",\\n \\\"lowPrice\\\": 68817.5,\\n \\\"highPrice\\\": 71615.8,\\n \\\"priceChgPct\\\": 6.0E-4,\\n \\\"priceChg\\\": 48.0,\\n \\\"k\\\": 490.0,\\n \\\"m\\\": 300.0,\\n \\\"f\\\": 1.3,\\n \\\"mmrLimit\\\": 0.3,\\n \\\"mmrLevConstant\\\": 125.0,\\n \\\"supportCross\\\": true\\n }\\n ]\\n}", + "operationId": "002" } }, "/api/v1/ticker": { @@ -1062,7 +1064,8 @@ "x-sdk-method-description": "This endpoint returns \"last traded price/size\"、\"best bid/ask price/size\" etc. of a single symbol. These messages can also be obtained through Websocket.", "x-api-rate-limit": 2, "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"sequence\\\":1697895100310,\\\"symbol\\\":\\\"XBTUSDM\\\",\\\"side\\\":\\\"sell\\\",\\\"size\\\":2936,\\\"tradeId\\\":\\\"1697901180000\\\",\\\"price\\\":\\\"67158.4\\\",\\\"bestBidPrice\\\":\\\"67169.6\\\",\\\"bestBidSize\\\":32345,\\\"bestAskPrice\\\":\\\"67169.7\\\",\\\"bestAskSize\\\":7251,\\\"ts\\\":1729163001780000000}}", - "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDTM\\\"}" + "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDTM\\\"}", + "operationId": "003" } }, "/api/v1/allTickers": { @@ -1188,7 +1191,8 @@ "x-sdk-method-name": "getAllTickers", "x-sdk-method-description": "This endpoint returns \"last traded price/size\"、\"best bid/ask price/size\" etc. of a single symbol. These messages can also be obtained through Websocket.", "x-api-rate-limit": 5, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": [\\n {\\n \\\"sequence\\\": 1707992727046,\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"side\\\": \\\"sell\\\",\\n \\\"size\\\": 21,\\n \\\"tradeId\\\": \\\"1784299761369\\\",\\n \\\"price\\\": \\\"67153\\\",\\n \\\"bestBidPrice\\\": \\\"67153\\\",\\n \\\"bestBidSize\\\": 2767,\\n \\\"bestAskPrice\\\": \\\"67153.1\\\",\\n \\\"bestAskSize\\\": 5368,\\n \\\"ts\\\": 1729163466659000000\\n },\\n {\\n \\\"sequence\\\": 1697895166299,\\n \\\"symbol\\\": \\\"XBTUSDM\\\",\\n \\\"side\\\": \\\"sell\\\",\\n \\\"size\\\": 1956,\\n \\\"tradeId\\\": \\\"1697901245065\\\",\\n \\\"price\\\": \\\"67145.2\\\",\\n \\\"bestBidPrice\\\": \\\"67135.3\\\",\\n \\\"bestBidSize\\\": 1,\\n \\\"bestAskPrice\\\": \\\"67135.8\\\",\\n \\\"bestAskSize\\\": 3,\\n \\\"ts\\\": 1729163445340000000\\n }\\n ]\\n}" + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": [\\n {\\n \\\"sequence\\\": 1707992727046,\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"side\\\": \\\"sell\\\",\\n \\\"size\\\": 21,\\n \\\"tradeId\\\": \\\"1784299761369\\\",\\n \\\"price\\\": \\\"67153\\\",\\n \\\"bestBidPrice\\\": \\\"67153\\\",\\n \\\"bestBidSize\\\": 2767,\\n \\\"bestAskPrice\\\": \\\"67153.1\\\",\\n \\\"bestAskSize\\\": 5368,\\n \\\"ts\\\": 1729163466659000000\\n },\\n {\\n \\\"sequence\\\": 1697895166299,\\n \\\"symbol\\\": \\\"XBTUSDM\\\",\\n \\\"side\\\": \\\"sell\\\",\\n \\\"size\\\": 1956,\\n \\\"tradeId\\\": \\\"1697901245065\\\",\\n \\\"price\\\": \\\"67145.2\\\",\\n \\\"bestBidPrice\\\": \\\"67135.3\\\",\\n \\\"bestBidSize\\\": 1,\\n \\\"bestAskPrice\\\": \\\"67135.8\\\",\\n \\\"bestAskSize\\\": 3,\\n \\\"ts\\\": 1729163445340000000\\n }\\n ]\\n}", + "operationId": "004" } }, "/api/v1/level2/snapshot": { @@ -1290,7 +1294,8 @@ "x-sdk-method-description": "Query for Full orderbook depth data. (aggregated by price) It is generally used by professional traders because it uses more server resources and traffic, and we have strict access rate limit control. To maintain up-to-date Order Book, please use Websocket incremental feed after retrieving the OrderBook.", "x-api-rate-limit": 3, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"sequence\\\": 1697895963339,\\n \\\"symbol\\\": \\\"XBTUSDM\\\",\\n \\\"bids\\\": [\\n [\\n 66968,\\n 2\\n ],\\n [\\n 66964.8,\\n 25596\\n ]\\n ],\\n \\\"asks\\\": [\\n [\\n 66968.1,\\n 13501\\n ],\\n [\\n 66968.7,\\n 2032\\n ]\\n ],\\n \\\"ts\\\": 1729168101216000000\\n }\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDM\\\"}" + "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDM\\\"}", + "operationId": "005" } }, "/api/v1/level2/depth{size}": { @@ -1400,7 +1405,8 @@ "x-sdk-method-description": "Query for part orderbook depth data. (aggregated by price) You are recommended to request via this endpoint as the system reponse would be faster and cosume less traffic.", "x-api-rate-limit": 5, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"sequence\\\": 1697895963339,\\n \\\"symbol\\\": \\\"XBTUSDM\\\",\\n \\\"bids\\\": [\\n [\\n 66968,\\n 2\\n ],\\n [\\n 66964.8,\\n 25596\\n ]\\n ],\\n \\\"asks\\\": [\\n [\\n 66968.1,\\n 13501\\n ],\\n [\\n 66968.7,\\n 2032\\n ]\\n ],\\n \\\"ts\\\": 1729168101216000000\\n }\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDM\\\", \\\"size\\\": \\\"20\\\"}" + "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDM\\\", \\\"size\\\": \\\"20\\\"}", + "operationId": "006" } }, "/api/v1/trade/history": { @@ -1526,7 +1532,8 @@ "x-sdk-method-description": "Request via this endpoint to get the trade history of the specified symbol, the returned quantity is the last 100 transaction records.", "x-api-rate-limit": 5, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": [\\n {\\n \\\"sequence\\\": 1697915257909,\\n \\\"contractId\\\": 1,\\n \\\"tradeId\\\": \\\"1697915257909\\\",\\n \\\"makerOrderId\\\": \\\"236679665752801280\\\",\\n \\\"takerOrderId\\\": \\\"236679667975745536\\\",\\n \\\"ts\\\": 1729242032152000000,\\n \\\"size\\\": 1,\\n \\\"price\\\": \\\"67878\\\",\\n \\\"side\\\": \\\"sell\\\"\\n },\\n {\\n \\\"sequence\\\": 1697915257749,\\n \\\"contractId\\\": 1,\\n \\\"tradeId\\\": \\\"1697915257749\\\",\\n \\\"makerOrderId\\\": \\\"236679660971245570\\\",\\n \\\"takerOrderId\\\": \\\"236679665400492032\\\",\\n \\\"ts\\\": 1729242031535000000,\\n \\\"size\\\": 1,\\n \\\"price\\\": \\\"67867.8\\\",\\n \\\"side\\\": \\\"sell\\\"\\n },\\n {\\n \\\"sequence\\\": 1697915257701,\\n \\\"contractId\\\": 1,\\n \\\"tradeId\\\": \\\"1697915257701\\\",\\n \\\"makerOrderId\\\": \\\"236679660971245570\\\",\\n \\\"takerOrderId\\\": \\\"236679661919211521\\\",\\n \\\"ts\\\": 1729242030932000000,\\n \\\"size\\\": 1,\\n \\\"price\\\": \\\"67867.8\\\",\\n \\\"side\\\": \\\"sell\\\"\\n }\\n ]\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDM\\\"}" + "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDM\\\"}", + "operationId": "007" } }, "/api/v1/kline/query": { @@ -1695,7 +1702,8 @@ "x-sdk-method-description": "Get the Kline of the symbol. Data are returned in grouped buckets based on requested type. For each query, the system would return at most 500 pieces of data. To obtain more data, please page the data by time.", "x-api-rate-limit": 3, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": [\\n [\\n 1728576000000,\\n 60791.1,\\n 61035,\\n 58940,\\n 60300,\\n 5501167\\n ],\\n [\\n 1728604800000,\\n 60299.9,\\n 60924.1,\\n 60077.4,\\n 60666.1,\\n 1220980\\n ],\\n [\\n 1728633600000,\\n 60665.7,\\n 62436.8,\\n 60650.1,\\n 62255.1,\\n 3386359\\n ]\\n ]\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDTM\\\", \\\"granularity\\\": 1, \\\"from\\\": 1728552342000, \\\"to\\\": 1729243542000}" + "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDTM\\\", \\\"granularity\\\": 1, \\\"from\\\": 1728552342000, \\\"to\\\": 1729243542000}", + "operationId": "008" } }, "/api/v1/mark-price/{symbol}/current": { @@ -1781,7 +1789,8 @@ "x-sdk-method-description": "Get current mark price", "x-api-rate-limit": 3, "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"symbol\\\":\\\"XBTUSDTM\\\",\\\"granularity\\\":1000,\\\"timePoint\\\":1729254307000,\\\"value\\\":67687.08,\\\"indexPrice\\\":67683.58}}", - "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDTM\\\"}" + "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDTM\\\"}", + "operationId": "009" } }, "/api/v1/index/query": { @@ -1971,7 +1980,8 @@ "x-sdk-method-description": "Get Spot Index Price", "x-api-rate-limit": 2, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"hasMore\\\": true,\\n \\\"dataList\\\": [\\n {\\n \\\"symbol\\\": \\\".KXBTUSDT\\\",\\n \\\"granularity\\\": 1000,\\n \\\"timePoint\\\": 1730557515000,\\n \\\"value\\\": 69202.94,\\n \\\"decomposionList\\\": [\\n {\\n \\\"exchange\\\": \\\"gateio\\\",\\n \\\"price\\\": 69209.27,\\n \\\"weight\\\": 0.0533\\n },\\n {\\n \\\"exchange\\\": \\\"bitmart\\\",\\n \\\"price\\\": 69230.77,\\n \\\"weight\\\": 0.0128\\n },\\n {\\n \\\"exchange\\\": \\\"okex\\\",\\n \\\"price\\\": 69195.34,\\n \\\"weight\\\": 0.11\\n },\\n {\\n \\\"exchange\\\": \\\"bybit\\\",\\n \\\"price\\\": 69190.33,\\n \\\"weight\\\": 0.0676\\n },\\n {\\n \\\"exchange\\\": \\\"binance\\\",\\n \\\"price\\\": 69204.55,\\n \\\"weight\\\": 0.6195\\n },\\n {\\n \\\"exchange\\\": \\\"kucoin\\\",\\n \\\"price\\\": 69202.91,\\n \\\"weight\\\": 0.1368\\n }\\n ]\\n },\\n {\\n \\\"symbol\\\": \\\".KXBTUSDT\\\",\\n \\\"granularity\\\": 1000,\\n \\\"timePoint\\\": 1730557514000,\\n \\\"value\\\": 69204.98,\\n \\\"decomposionList\\\": [\\n {\\n \\\"exchange\\\": \\\"gateio\\\",\\n \\\"price\\\": 69212.71,\\n \\\"weight\\\": 0.0808\\n },\\n {\\n \\\"exchange\\\": \\\"bitmart\\\",\\n \\\"price\\\": 69230.77,\\n \\\"weight\\\": 0.0134\\n },\\n {\\n \\\"exchange\\\": \\\"okex\\\",\\n \\\"price\\\": 69195.49,\\n \\\"weight\\\": 0.0536\\n },\\n {\\n \\\"exchange\\\": \\\"bybit\\\",\\n \\\"price\\\": 69195.97,\\n \\\"weight\\\": 0.0921\\n },\\n {\\n \\\"exchange\\\": \\\"binance\\\",\\n \\\"price\\\": 69204.56,\\n \\\"weight\\\": 0.5476\\n },\\n {\\n \\\"exchange\\\": \\\"kucoin\\\",\\n \\\"price\\\": 69207.8,\\n \\\"weight\\\": 0.2125\\n }\\n ]\\n }\\n ]\\n }\\n}", - "x-request-example": "{\\\"symbol\\\": \\\".KXBTUSDT\\\", \\\"startAt\\\": 123456, \\\"endAt\\\": 123456, \\\"reverse\\\": true, \\\"offset\\\": 123456, \\\"forward\\\": true, \\\"maxCount\\\": 10}" + "x-request-example": "{\\\"symbol\\\": \\\".KXBTUSDT\\\", \\\"startAt\\\": 123456, \\\"endAt\\\": 123456, \\\"reverse\\\": true, \\\"offset\\\": 123456, \\\"forward\\\": true, \\\"maxCount\\\": 10}", + "operationId": "010" } }, "/api/v1/interest/query": { @@ -2136,7 +2146,8 @@ "x-sdk-method-description": "Get interest rate Index.", "x-api-rate-limit": 5, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"dataList\\\": [\\n {\\n \\\"symbol\\\": \\\".XBTINT\\\",\\n \\\"granularity\\\": 60000,\\n \\\"timePoint\\\": 1728692100000,\\n \\\"value\\\": 3.0E-4\\n },\\n {\\n \\\"symbol\\\": \\\".XBTINT\\\",\\n \\\"granularity\\\": 60000,\\n \\\"timePoint\\\": 1728692040000,\\n \\\"value\\\": 3.0E-4\\n }\\n ],\\n \\\"hasMore\\\": true\\n }\\n}", - "x-request-example": "{\\\"symbol\\\": \\\".XBTINT8H\\\", \\\"startAt\\\": 1728663338000, \\\"endAt\\\": 1728692138000, \\\"reverse\\\": true, \\\"offset\\\": 254062248624417, \\\"forward\\\": true, \\\"maxCount\\\": 10}" + "x-request-example": "{\\\"symbol\\\": \\\".XBTINT8H\\\", \\\"startAt\\\": 1728663338000, \\\"endAt\\\": 1728692138000, \\\"reverse\\\": true, \\\"offset\\\": 254062248624417, \\\"forward\\\": true, \\\"maxCount\\\": 10}", + "operationId": "011" } }, "/api/v1/premium/query": { @@ -2299,7 +2310,8 @@ "x-sdk-method-description": "Submit request to get premium index.", "x-api-rate-limit": 3, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"hasMore\\\": true,\\n \\\"dataList\\\": [\\n {\\n \\\"symbol\\\": \\\".XBTUSDTMPI\\\",\\n \\\"granularity\\\": 60000,\\n \\\"timePoint\\\": 1730558040000,\\n \\\"value\\\": 0.00006\\n },\\n {\\n \\\"symbol\\\": \\\".XBTUSDTMPI\\\",\\n \\\"granularity\\\": 60000,\\n \\\"timePoint\\\": 1730557980000,\\n \\\"value\\\": -0.000025\\n }\\n ]\\n }\\n}", - "x-request-example": "{\\\"symbol\\\": \\\".XBTUSDTMPI\\\", \\\"startAt\\\": 1728663338000, \\\"endAt\\\": 1728692138000, \\\"reverse\\\": true, \\\"offset\\\": 254062248624417, \\\"forward\\\": true, \\\"maxCount\\\": 10}" + "x-request-example": "{\\\"symbol\\\": \\\".XBTUSDTMPI\\\", \\\"startAt\\\": 1728663338000, \\\"endAt\\\": 1728692138000, \\\"reverse\\\": true, \\\"offset\\\": 254062248624417, \\\"forward\\\": true, \\\"maxCount\\\": 10}", + "operationId": "012" } }, "/api/v1/trade-statistics": { @@ -2353,7 +2365,8 @@ "x-sdk-method-name": "get24hrStats", "x-sdk-method-description": "Get the statistics of the platform futures trading volume in the last 24 hours.", "x-api-rate-limit": 3, - "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"turnoverOf24h\\\":1.1155733413273683E9}}" + "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"turnoverOf24h\\\":1.1155733413273683E9}}", + "operationId": "013" } }, "/api/v1/timestamp": { @@ -2400,7 +2413,8 @@ "x-sdk-method-name": "getServerTime", "x-sdk-method-description": "Get the API server time. This is the Unix timestamp.", "x-api-rate-limit": 2, - "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":1729260030774}" + "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":1729260030774}", + "operationId": "014" } }, "/api/v1/status": { @@ -2480,7 +2494,8 @@ "x-sdk-method-name": "getServiceStatus", "x-sdk-method-description": "Get the service status.", "x-api-rate-limit": 4, - "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"msg\\\":\\\"\\\",\\\"status\\\":\\\"open\\\"}}" + "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"msg\\\":\\\"\\\",\\\"status\\\":\\\"open\\\"}}", + "operationId": "015" } }, "/api/v1/orders": { @@ -2801,7 +2816,8 @@ } }, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"orderId\\\": \\\"234125150956625920\\\",\\n \\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\"\\n }\\n}", - "x-request-example": "{\\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\", \\\"side\\\": \\\"buy\\\", \\\"symbol\\\": \\\"XBTUSDTM\\\", \\\"leverage\\\": 3, \\\"type\\\": \\\"limit\\\", \\\"remark\\\": \\\"order remarks\\\", \\\"reduceOnly\\\": false, \\\"marginMode\\\": \\\"ISOLATED\\\", \\\"price\\\": \\\"0.1\\\", \\\"size\\\": 1, \\\"timeInForce\\\": \\\"GTC\\\"}" + "x-request-example": "{\\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\", \\\"side\\\": \\\"buy\\\", \\\"symbol\\\": \\\"XBTUSDTM\\\", \\\"leverage\\\": 3, \\\"type\\\": \\\"limit\\\", \\\"remark\\\": \\\"order remarks\\\", \\\"reduceOnly\\\": false, \\\"marginMode\\\": \\\"ISOLATED\\\", \\\"price\\\": \\\"0.1\\\", \\\"size\\\": 1, \\\"timeInForce\\\": \\\"GTC\\\"}", + "operationId": "016" }, "get": { "summary": "Get Order List", @@ -3195,7 +3211,8 @@ "x-sdk-method-description": "List your current orders.", "x-api-rate-limit": 2, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"currentPage\\\": 1,\\n \\\"pageSize\\\": 50,\\n \\\"totalNum\\\": 1,\\n \\\"totalPage\\\": 1,\\n \\\"items\\\": [\\n {\\n \\\"id\\\": \\\"230181737576050688\\\",\\n \\\"symbol\\\": \\\"PEOPLEUSDTM\\\",\\n \\\"type\\\": \\\"limit\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"price\\\": \\\"0.05\\\",\\n \\\"size\\\": 10,\\n \\\"value\\\": \\\"5\\\",\\n \\\"dealValue\\\": \\\"0\\\",\\n \\\"dealSize\\\": 0,\\n \\\"stp\\\": \\\"\\\",\\n \\\"stop\\\": \\\"\\\",\\n \\\"stopPriceType\\\": \\\"\\\",\\n \\\"stopTriggered\\\": false,\\n \\\"stopPrice\\\": null,\\n \\\"timeInForce\\\": \\\"GTC\\\",\\n \\\"postOnly\\\": false,\\n \\\"hidden\\\": false,\\n \\\"iceberg\\\": false,\\n \\\"leverage\\\": \\\"1\\\",\\n \\\"forceHold\\\": false,\\n \\\"closeOrder\\\": false,\\n \\\"visibleSize\\\": 0,\\n \\\"clientOid\\\": \\\"5a80bd847f1811ef8a7faa665a37b3d7\\\",\\n \\\"remark\\\": null,\\n \\\"tags\\\": \\\"\\\",\\n \\\"isActive\\\": true,\\n \\\"cancelExist\\\": false,\\n \\\"createdAt\\\": 1727692804813,\\n \\\"updatedAt\\\": 1727692804813,\\n \\\"endAt\\\": null,\\n \\\"orderTime\\\": 1727692804808418000,\\n \\\"settleCurrency\\\": \\\"USDT\\\",\\n \\\"marginMode\\\": \\\"ISOLATED\\\",\\n \\\"avgDealPrice\\\": \\\"0\\\",\\n \\\"filledSize\\\": 0,\\n \\\"filledValue\\\": \\\"0\\\",\\n \\\"status\\\": \\\"open\\\",\\n \\\"reduceOnly\\\": false\\n }\\n ]\\n }\\n}", - "x-request-example": "{\\\"status\\\": \\\"done\\\", \\\"symbol\\\": \\\"example_string_default_value\\\", \\\"side\\\": \\\"buy\\\", \\\"type\\\": \\\"limit\\\", \\\"startAt\\\": 123456, \\\"endAt\\\": 123456, \\\"currentPage\\\": 123456, \\\"pageSize\\\": 123456}" + "x-request-example": "{\\\"status\\\": \\\"done\\\", \\\"symbol\\\": \\\"example_string_default_value\\\", \\\"side\\\": \\\"buy\\\", \\\"type\\\": \\\"limit\\\", \\\"startAt\\\": 123456, \\\"endAt\\\": 123456, \\\"currentPage\\\": 123456, \\\"pageSize\\\": 123456}", + "operationId": "027" }, "delete": { "summary": "Cancel All Orders - V1", @@ -3261,7 +3278,8 @@ "x-sdk-method-description": "Cancel all open orders (excluding stop orders). The response is a list of orderIDs of the canceled orders.", "x-api-rate-limit": 200, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"cancelledOrderIds\\\": [\\n \\\"235919172150824960\\\",\\n \\\"235919172150824961\\\"\\n ]\\n }\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDTM\\\"}" + "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDTM\\\"}", + "operationId": "052" } }, "/api/v1/orders/test": { @@ -3583,7 +3601,8 @@ } }, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"orderId\\\": \\\"234125150956625920\\\",\\n \\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\"\\n }\\n}", - "x-request-example": "{\\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\", \\\"side\\\": \\\"buy\\\", \\\"symbol\\\": \\\"XBTUSDTM\\\", \\\"leverage\\\": 3, \\\"type\\\": \\\"limit\\\", \\\"remark\\\": \\\"order remarks\\\", \\\"reduceOnly\\\": false, \\\"marginMode\\\": \\\"ISOLATED\\\", \\\"price\\\": \\\"0.1\\\", \\\"size\\\": 1, \\\"timeInForce\\\": \\\"GTC\\\"}" + "x-request-example": "{\\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\", \\\"side\\\": \\\"buy\\\", \\\"symbol\\\": \\\"XBTUSDTM\\\", \\\"leverage\\\": 3, \\\"type\\\": \\\"limit\\\", \\\"remark\\\": \\\"order remarks\\\", \\\"reduceOnly\\\": false, \\\"marginMode\\\": \\\"ISOLATED\\\", \\\"price\\\": \\\"0.1\\\", \\\"size\\\": 1, \\\"timeInForce\\\": \\\"GTC\\\"}", + "operationId": "017" } }, "/api/v1/orders/multi": { @@ -3924,7 +3943,8 @@ } }, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": [\\n {\\n \\\"orderId\\\": \\\"235919387779985408\\\",\\n \\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\",\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"code\\\": \\\"200000\\\",\\n \\\"msg\\\": \\\"success\\\"\\n },\\n {\\n \\\"orderId\\\": \\\"235919387855482880\\\",\\n \\\"clientOid\\\": \\\"5c52e11203aa677f33e493fc\\\",\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"code\\\": \\\"200000\\\",\\n \\\"msg\\\": \\\"success\\\"\\n }\\n ]\\n}", - "x-request-example": "[{\\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\", \\\"side\\\": \\\"buy\\\", \\\"symbol\\\": \\\"XBTUSDTM\\\", \\\"leverage\\\": 3, \\\"type\\\": \\\"limit\\\", \\\"remark\\\": \\\"order remarks\\\", \\\"reduceOnly\\\": false, \\\"marginMode\\\": \\\"ISOLATED\\\", \\\"price\\\": \\\"0.1\\\", \\\"size\\\": 1, \\\"timeInForce\\\": \\\"GTC\\\"}, {\\\"clientOid\\\": \\\"5c52e11203aa677f33e493fc\\\", \\\"side\\\": \\\"buy\\\", \\\"symbol\\\": \\\"XBTUSDTM\\\", \\\"leverage\\\": 3, \\\"type\\\": \\\"limit\\\", \\\"remark\\\": \\\"order remarks\\\", \\\"reduceOnly\\\": false, \\\"marginMode\\\": \\\"ISOLATED\\\", \\\"price\\\": \\\"0.1\\\", \\\"size\\\": 1, \\\"timeInForce\\\": \\\"GTC\\\"}]" + "x-request-example": "[{\\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\", \\\"side\\\": \\\"buy\\\", \\\"symbol\\\": \\\"XBTUSDTM\\\", \\\"leverage\\\": 3, \\\"type\\\": \\\"limit\\\", \\\"remark\\\": \\\"order remarks\\\", \\\"reduceOnly\\\": false, \\\"marginMode\\\": \\\"ISOLATED\\\", \\\"price\\\": \\\"0.1\\\", \\\"size\\\": 1, \\\"timeInForce\\\": \\\"GTC\\\"}, {\\\"clientOid\\\": \\\"5c52e11203aa677f33e493fc\\\", \\\"side\\\": \\\"buy\\\", \\\"symbol\\\": \\\"XBTUSDTM\\\", \\\"leverage\\\": 3, \\\"type\\\": \\\"limit\\\", \\\"remark\\\": \\\"order remarks\\\", \\\"reduceOnly\\\": false, \\\"marginMode\\\": \\\"ISOLATED\\\", \\\"price\\\": \\\"0.1\\\", \\\"size\\\": 1, \\\"timeInForce\\\": \\\"GTC\\\"}]", + "operationId": "018" } }, "/api/v1/st-orders": { @@ -4230,7 +4250,8 @@ } }, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"orderId\\\": \\\"234125150956625920\\\",\\n \\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\"\\n }\\n}", - "x-request-example": "{\\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\", \\\"side\\\": \\\"buy\\\", \\\"symbol\\\": \\\"XBTUSDTM\\\", \\\"leverage\\\": 3, \\\"type\\\": \\\"limit\\\", \\\"remark\\\": \\\"order remarks\\\", \\\"reduceOnly\\\": false, \\\"marginMode\\\": \\\"ISOLATED\\\", \\\"price\\\": \\\"0.2\\\", \\\"size\\\": 1, \\\"timeInForce\\\": \\\"GTC\\\", \\\"triggerStopUpPrice\\\": \\\"0.3\\\", \\\"triggerStopDownPrice\\\": \\\"0.1\\\", \\\"stopPriceType\\\": \\\"TP\\\"}" + "x-request-example": "{\\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\", \\\"side\\\": \\\"buy\\\", \\\"symbol\\\": \\\"XBTUSDTM\\\", \\\"leverage\\\": 3, \\\"type\\\": \\\"limit\\\", \\\"remark\\\": \\\"order remarks\\\", \\\"reduceOnly\\\": false, \\\"marginMode\\\": \\\"ISOLATED\\\", \\\"price\\\": \\\"0.2\\\", \\\"size\\\": 1, \\\"timeInForce\\\": \\\"GTC\\\", \\\"triggerStopUpPrice\\\": \\\"0.3\\\", \\\"triggerStopDownPrice\\\": \\\"0.1\\\", \\\"stopPriceType\\\": \\\"TP\\\"}", + "operationId": "019" } }, "/api/v1/orders/{orderId}": { @@ -4298,7 +4319,8 @@ "x-sdk-method-description": "Cancel order by system generated orderId.", "x-api-rate-limit": 1, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"cancelledOrderIds\\\": [\\n \\\"235303670076489728\\\"\\n ]\\n }\\n}", - "x-request-example": "{\\\"orderId\\\": \\\"example_string_default_value\\\"}" + "x-request-example": "{\\\"orderId\\\": \\\"example_string_default_value\\\"}", + "operationId": "020" } }, "/api/v1/orders/client-order/{clientOid}": { @@ -4371,7 +4393,8 @@ "x-sdk-method-description": "Cancel order by client defined orderId.", "x-api-rate-limit": 1, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"clientOid\\\": \\\"017485b0-2957-4681-8a14-5d46b35aee0d\\\"\\n }\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDTM\\\", \\\"clientOid\\\": \\\"example_string_default_value\\\"}" + "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDTM\\\", \\\"clientOid\\\": \\\"example_string_default_value\\\"}", + "operationId": "021" } }, "/api/v1/orders/multi-cancel": { @@ -4484,7 +4507,8 @@ } }, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": [\\n {\\n \\\"orderId\\\": \\\"250445104152670209\\\",\\n \\\"clientOid\\\": null,\\n \\\"code\\\": \\\"200\\\",\\n \\\"msg\\\": \\\"success\\\"\\n },\\n {\\n \\\"orderId\\\": \\\"250445181751463936\\\",\\n \\\"clientOid\\\": null,\\n \\\"code\\\": \\\"200\\\",\\n \\\"msg\\\": \\\"success\\\"\\n }\\n ]\\n}\\n", - "x-request-example": "{\\\"orderIdsList\\\": [\\\"250445104152670209\\\", \\\"250445181751463936\\\"]}" + "x-request-example": "{\\\"orderIdsList\\\": [\\\"250445104152670209\\\", \\\"250445181751463936\\\"]}", + "operationId": "022" } }, "/api/v3/orders": { @@ -4552,7 +4576,8 @@ "x-sdk-method-description": "Cancel all open orders (excluding stop orders). The response is a list of orderIDs of the canceled orders.", "x-api-rate-limit": 10, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"cancelledOrderIds\\\": [\\n \\\"235919172150824960\\\",\\n \\\"235919172150824961\\\"\\n ]\\n }\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDTM\\\"}" + "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDTM\\\"}", + "operationId": "023" } }, "/api/v1/stopOrders": { @@ -4620,7 +4645,8 @@ "x-sdk-method-description": "Cancel all untriggered stop orders. The response is a list of orderIDs of the canceled stop orders. To cancel triggered stop orders, please use 'Cancel Multiple Futures Limit orders'.", "x-api-rate-limit": 15, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"cancelledOrderIds\\\": [\\n \\\"235919172150824960\\\",\\n \\\"235919172150824961\\\"\\n ]\\n }\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDTM\\\"}" + "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDTM\\\"}", + "operationId": "024" }, "get": { "summary": "Get Stop Order List", @@ -4991,7 +5017,8 @@ "x-sdk-method-description": "Get the un-triggered stop orders list. Stop orders that have been triggered can be queried through the general order interface", "x-api-rate-limit": 6, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"currentPage\\\": 1,\\n \\\"pageSize\\\": 50,\\n \\\"totalNum\\\": 1,\\n \\\"totalPage\\\": 1,\\n \\\"items\\\": [\\n {\\n \\\"id\\\": \\\"230181737576050688\\\",\\n \\\"symbol\\\": \\\"PEOPLEUSDTM\\\",\\n \\\"type\\\": \\\"limit\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"price\\\": \\\"0.05\\\",\\n \\\"size\\\": 10,\\n \\\"value\\\": \\\"5\\\",\\n \\\"dealValue\\\": \\\"0\\\",\\n \\\"dealSize\\\": 0,\\n \\\"stp\\\": \\\"\\\",\\n \\\"stop\\\": \\\"\\\",\\n \\\"stopPriceType\\\": \\\"\\\",\\n \\\"stopTriggered\\\": false,\\n \\\"stopPrice\\\": null,\\n \\\"timeInForce\\\": \\\"GTC\\\",\\n \\\"postOnly\\\": false,\\n \\\"hidden\\\": false,\\n \\\"iceberg\\\": false,\\n \\\"leverage\\\": \\\"1\\\",\\n \\\"forceHold\\\": false,\\n \\\"closeOrder\\\": false,\\n \\\"visibleSize\\\": 0,\\n \\\"clientOid\\\": \\\"5a80bd847f1811ef8a7faa665a37b3d7\\\",\\n \\\"remark\\\": null,\\n \\\"tags\\\": \\\"\\\",\\n \\\"isActive\\\": true,\\n \\\"cancelExist\\\": false,\\n \\\"createdAt\\\": 1727692804813,\\n \\\"updatedAt\\\": 1727692804813,\\n \\\"endAt\\\": null,\\n \\\"orderTime\\\": 1727692804808418000,\\n \\\"settleCurrency\\\": \\\"USDT\\\",\\n \\\"marginMode\\\": \\\"ISOLATED\\\",\\n \\\"avgDealPrice\\\": \\\"0\\\",\\n \\\"filledSize\\\": 0,\\n \\\"filledValue\\\": \\\"0\\\",\\n \\\"status\\\": \\\"open\\\",\\n \\\"reduceOnly\\\": false\\n }\\n ]\\n }\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDTM\\\", \\\"side\\\": \\\"buy\\\", \\\"type\\\": \\\"limit\\\", \\\"startAt\\\": 123456, \\\"endAt\\\": 123456, \\\"currentPage\\\": 123456, \\\"pageSize\\\": 50}" + "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDTM\\\", \\\"side\\\": \\\"buy\\\", \\\"type\\\": \\\"limit\\\", \\\"startAt\\\": 123456, \\\"endAt\\\": 123456, \\\"currentPage\\\": 123456, \\\"pageSize\\\": 50}", + "operationId": "029" } }, "/api/v1/orders/{order-id}": { @@ -5364,7 +5391,8 @@ "x-sdk-method-description": "Get a single order by order id (including a stop order).", "x-api-rate-limit": 5, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"id\\\": \\\"236655147005071361\\\",\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"type\\\": \\\"limit\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"price\\\": \\\"0.1\\\",\\n \\\"size\\\": 1,\\n \\\"value\\\": \\\"0.0001\\\",\\n \\\"dealValue\\\": \\\"0\\\",\\n \\\"dealSize\\\": 0,\\n \\\"stp\\\": \\\"\\\",\\n \\\"stop\\\": \\\"\\\",\\n \\\"stopPriceType\\\": \\\"\\\",\\n \\\"stopTriggered\\\": false,\\n \\\"stopPrice\\\": null,\\n \\\"timeInForce\\\": \\\"GTC\\\",\\n \\\"postOnly\\\": false,\\n \\\"hidden\\\": false,\\n \\\"iceberg\\\": false,\\n \\\"leverage\\\": \\\"3\\\",\\n \\\"forceHold\\\": false,\\n \\\"closeOrder\\\": false,\\n \\\"visibleSize\\\": 0,\\n \\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\",\\n \\\"remark\\\": null,\\n \\\"tags\\\": \\\"\\\",\\n \\\"isActive\\\": true,\\n \\\"cancelExist\\\": false,\\n \\\"createdAt\\\": 1729236185949,\\n \\\"updatedAt\\\": 1729236185949,\\n \\\"endAt\\\": null,\\n \\\"orderTime\\\": 1729236185885647952,\\n \\\"settleCurrency\\\": \\\"USDT\\\",\\n \\\"marginMode\\\": \\\"ISOLATED\\\",\\n \\\"avgDealPrice\\\": \\\"0\\\",\\n \\\"filledSize\\\": 0,\\n \\\"filledValue\\\": \\\"0\\\",\\n \\\"status\\\": \\\"open\\\",\\n \\\"reduceOnly\\\": false\\n }\\n}", - "x-request-example": "{\\\"order-id\\\": \\\"236655147005071361\\\"}" + "x-request-example": "{\\\"order-id\\\": \\\"236655147005071361\\\"}", + "operationId": "025" } }, "/api/v1/orders/byClientOid": { @@ -5738,7 +5766,8 @@ "x-sdk-method-description": "Get a single order by client order id (including a stop order).", "x-api-rate-limit": 5, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"id\\\": \\\"250444645610336256\\\",\\n \\\"symbol\\\": \\\"XRPUSDTM\\\",\\n \\\"type\\\": \\\"limit\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"price\\\": \\\"0.1\\\",\\n \\\"size\\\": 1,\\n \\\"value\\\": \\\"1\\\",\\n \\\"dealValue\\\": \\\"0\\\",\\n \\\"dealSize\\\": 0,\\n \\\"stp\\\": \\\"\\\",\\n \\\"stop\\\": \\\"\\\",\\n \\\"stopPriceType\\\": \\\"\\\",\\n \\\"stopTriggered\\\": false,\\n \\\"stopPrice\\\": null,\\n \\\"timeInForce\\\": \\\"GTC\\\",\\n \\\"postOnly\\\": false,\\n \\\"hidden\\\": false,\\n \\\"iceberg\\\": false,\\n \\\"leverage\\\": \\\"3\\\",\\n \\\"forceHold\\\": false,\\n \\\"closeOrder\\\": false,\\n \\\"visibleSize\\\": 0,\\n \\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\",\\n \\\"remark\\\": null,\\n \\\"tags\\\": \\\"\\\",\\n \\\"isActive\\\": true,\\n \\\"cancelExist\\\": false,\\n \\\"createdAt\\\": 1732523858568,\\n \\\"updatedAt\\\": 1732523858568,\\n \\\"endAt\\\": null,\\n \\\"orderTime\\\": 1732523858550892322,\\n \\\"settleCurrency\\\": \\\"USDT\\\",\\n \\\"marginMode\\\": \\\"ISOLATED\\\",\\n \\\"avgDealPrice\\\": \\\"0\\\",\\n \\\"filledSize\\\": 0,\\n \\\"filledValue\\\": \\\"0\\\",\\n \\\"status\\\": \\\"open\\\",\\n \\\"reduceOnly\\\": false\\n }\\n}", - "x-request-example": "{\\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\"}" + "x-request-example": "{\\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\"}", + "operationId": "026" } }, "/api/v1/recentDoneOrders": { @@ -5995,7 +6024,8 @@ "x-sdk-method-description": "Get a list of recent 1000 closed orders in the last 24 hours. If you need to get your recent traded order history with low latency, you may query this endpoint.", "x-api-rate-limit": 5, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": [\\n {\\n \\\"id\\\": \\\"236387137732231168\\\",\\n \\\"symbol\\\": \\\"XRPUSDTM\\\",\\n \\\"type\\\": \\\"market\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"price\\\": \\\"0\\\",\\n \\\"size\\\": 1,\\n \\\"value\\\": \\\"5.51\\\",\\n \\\"dealValue\\\": \\\"5.511\\\",\\n \\\"dealSize\\\": 1,\\n \\\"stp\\\": \\\"\\\",\\n \\\"stop\\\": \\\"\\\",\\n \\\"stopPriceType\\\": \\\"\\\",\\n \\\"stopTriggered\\\": false,\\n \\\"stopPrice\\\": null,\\n \\\"timeInForce\\\": \\\"GTC\\\",\\n \\\"postOnly\\\": false,\\n \\\"hidden\\\": false,\\n \\\"iceberg\\\": false,\\n \\\"leverage\\\": \\\"10.0\\\",\\n \\\"forceHold\\\": false,\\n \\\"closeOrder\\\": false,\\n \\\"visibleSize\\\": 0,\\n \\\"clientOid\\\": \\\"16698fe6-2746-4aeb-a7fa-61f633ab6090\\\",\\n \\\"remark\\\": null,\\n \\\"tags\\\": \\\"\\\",\\n \\\"isActive\\\": false,\\n \\\"cancelExist\\\": false,\\n \\\"createdAt\\\": 1729172287496,\\n \\\"updatedAt\\\": 1729172287568,\\n \\\"endAt\\\": 1729172287568,\\n \\\"orderTime\\\": 1729172287496950800,\\n \\\"settleCurrency\\\": \\\"USDT\\\",\\n \\\"marginMode\\\": \\\"ISOLATED\\\",\\n \\\"avgDealPrice\\\": \\\"0.5511\\\",\\n \\\"filledSize\\\": 1,\\n \\\"filledValue\\\": \\\"5.511\\\",\\n \\\"status\\\": \\\"done\\\",\\n \\\"reduceOnly\\\": false\\n },\\n {\\n \\\"id\\\": \\\"236317213710184449\\\",\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"type\\\": \\\"market\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"price\\\": \\\"0\\\",\\n \\\"size\\\": 1,\\n \\\"value\\\": \\\"67.4309\\\",\\n \\\"dealValue\\\": \\\"67.4309\\\",\\n \\\"dealSize\\\": 1,\\n \\\"stp\\\": \\\"\\\",\\n \\\"stop\\\": \\\"\\\",\\n \\\"stopPriceType\\\": \\\"\\\",\\n \\\"stopTriggered\\\": false,\\n \\\"stopPrice\\\": null,\\n \\\"timeInForce\\\": \\\"GTC\\\",\\n \\\"postOnly\\\": false,\\n \\\"hidden\\\": false,\\n \\\"iceberg\\\": false,\\n \\\"leverage\\\": \\\"3\\\",\\n \\\"forceHold\\\": false,\\n \\\"closeOrder\\\": false,\\n \\\"visibleSize\\\": 0,\\n \\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\",\\n \\\"remark\\\": null,\\n \\\"tags\\\": \\\"\\\",\\n \\\"isActive\\\": false,\\n \\\"cancelExist\\\": false,\\n \\\"createdAt\\\": 1729155616310,\\n \\\"updatedAt\\\": 1729155616324,\\n \\\"endAt\\\": 1729155616324,\\n \\\"orderTime\\\": 1729155616310180400,\\n \\\"settleCurrency\\\": \\\"USDT\\\",\\n \\\"marginMode\\\": \\\"ISOLATED\\\",\\n \\\"avgDealPrice\\\": \\\"67430.9\\\",\\n \\\"filledSize\\\": 1,\\n \\\"filledValue\\\": \\\"67.4309\\\",\\n \\\"status\\\": \\\"done\\\",\\n \\\"reduceOnly\\\": false\\n },\\n {\\n \\\"id\\\": \\\"236317094436728832\\\",\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"type\\\": \\\"market\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"price\\\": \\\"0\\\",\\n \\\"size\\\": 1,\\n \\\"value\\\": \\\"67.445\\\",\\n \\\"dealValue\\\": \\\"67.445\\\",\\n \\\"dealSize\\\": 1,\\n \\\"stp\\\": \\\"\\\",\\n \\\"stop\\\": \\\"\\\",\\n \\\"stopPriceType\\\": \\\"\\\",\\n \\\"stopTriggered\\\": false,\\n \\\"stopPrice\\\": null,\\n \\\"timeInForce\\\": \\\"GTC\\\",\\n \\\"postOnly\\\": false,\\n \\\"hidden\\\": false,\\n \\\"iceberg\\\": false,\\n \\\"leverage\\\": \\\"3\\\",\\n \\\"forceHold\\\": false,\\n \\\"closeOrder\\\": false,\\n \\\"visibleSize\\\": 0,\\n \\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\",\\n \\\"remark\\\": null,\\n \\\"tags\\\": \\\"\\\",\\n \\\"isActive\\\": false,\\n \\\"cancelExist\\\": false,\\n \\\"createdAt\\\": 1729155587873,\\n \\\"updatedAt\\\": 1729155587946,\\n \\\"endAt\\\": 1729155587946,\\n \\\"orderTime\\\": 1729155587873332000,\\n \\\"settleCurrency\\\": \\\"USDT\\\",\\n \\\"marginMode\\\": \\\"ISOLATED\\\",\\n \\\"avgDealPrice\\\": \\\"67445.0\\\",\\n \\\"filledSize\\\": 1,\\n \\\"filledValue\\\": \\\"67.445\\\",\\n \\\"status\\\": \\\"done\\\",\\n \\\"reduceOnly\\\": false\\n }\\n ]\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDTM\\\"}" + "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDTM\\\"}", + "operationId": "028" } }, "/api/v1/openOrderStatistics": { @@ -6080,7 +6110,8 @@ "x-sdk-method-description": "You can query this endpoint to get the the total number and value of the all your active orders.", "x-api-rate-limit": 10, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"openOrderBuySize\\\": 1,\\n \\\"openOrderSellSize\\\": 0,\\n \\\"openOrderBuyCost\\\": \\\"0.0001\\\",\\n \\\"openOrderSellCost\\\": \\\"0\\\",\\n \\\"settleCurrency\\\": \\\"USDT\\\"\\n }\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDTM\\\"}" + "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDTM\\\"}", + "operationId": "030" } }, "/api/v1/recentFills": { @@ -6391,7 +6422,8 @@ "x-sdk-method-description": "Get a list of recent 1000 fills in the last 24 hours. If you need to get your recent traded order history with low latency, you may query this endpoint.", "x-api-rate-limit": 3, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": [\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"tradeId\\\": \\\"1784277229880\\\",\\n \\\"orderId\\\": \\\"236317213710184449\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"liquidity\\\": \\\"taker\\\",\\n \\\"forceTaker\\\": false,\\n \\\"price\\\": \\\"67430.9\\\",\\n \\\"size\\\": 1,\\n \\\"value\\\": \\\"67.4309\\\",\\n \\\"openFeePay\\\": \\\"0.04045854\\\",\\n \\\"closeFeePay\\\": \\\"0\\\",\\n \\\"stop\\\": \\\"\\\",\\n \\\"feeRate\\\": \\\"0.00060\\\",\\n \\\"fixFee\\\": \\\"0\\\",\\n \\\"feeCurrency\\\": \\\"USDT\\\",\\n \\\"marginMode\\\": \\\"ISOLATED\\\",\\n \\\"fee\\\": \\\"0.04045854\\\",\\n \\\"settleCurrency\\\": \\\"USDT\\\",\\n \\\"orderType\\\": \\\"market\\\",\\n \\\"displayType\\\": \\\"market\\\",\\n \\\"tradeType\\\": \\\"trade\\\",\\n \\\"subTradeType\\\": null,\\n \\\"tradeTime\\\": 1729155616320000000,\\n \\\"createdAt\\\": 1729155616493\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"tradeId\\\": \\\"1784277132002\\\",\\n \\\"orderId\\\": \\\"236317094436728832\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"liquidity\\\": \\\"taker\\\",\\n \\\"forceTaker\\\": false,\\n \\\"price\\\": \\\"67445\\\",\\n \\\"size\\\": 1,\\n \\\"value\\\": \\\"67.445\\\",\\n \\\"openFeePay\\\": \\\"0\\\",\\n \\\"closeFeePay\\\": \\\"0.040467\\\",\\n \\\"stop\\\": \\\"\\\",\\n \\\"feeRate\\\": \\\"0.00060\\\",\\n \\\"fixFee\\\": \\\"0\\\",\\n \\\"feeCurrency\\\": \\\"USDT\\\",\\n \\\"marginMode\\\": \\\"ISOLATED\\\",\\n \\\"fee\\\": \\\"0.040467\\\",\\n \\\"settleCurrency\\\": \\\"USDT\\\",\\n \\\"orderType\\\": \\\"market\\\",\\n \\\"displayType\\\": \\\"market\\\",\\n \\\"tradeType\\\": \\\"trade\\\",\\n \\\"subTradeType\\\": null,\\n \\\"tradeTime\\\": 1729155587944000000,\\n \\\"createdAt\\\": 1729155588104\\n }\\n ]\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDTM\\\"}" + "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDTM\\\"}", + "operationId": "031" } }, "/api/v1/fills": { @@ -6847,7 +6879,8 @@ "x-sdk-method-description": "Get a list of recent fills. If you need to get your recent trade history with low latency, please query endpoint Get List of Orders Completed in 24h. The requested data is not real-time.", "x-api-rate-limit": 5, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"currentPage\\\": 1,\\n \\\"pageSize\\\": 50,\\n \\\"totalNum\\\": 2,\\n \\\"totalPage\\\": 1,\\n \\\"items\\\": [\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"tradeId\\\": \\\"1784277229880\\\",\\n \\\"orderId\\\": \\\"236317213710184449\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"liquidity\\\": \\\"taker\\\",\\n \\\"forceTaker\\\": false,\\n \\\"price\\\": \\\"67430.9\\\",\\n \\\"size\\\": 1,\\n \\\"value\\\": \\\"67.4309\\\",\\n \\\"openFeePay\\\": \\\"0.04045854\\\",\\n \\\"closeFeePay\\\": \\\"0\\\",\\n \\\"stop\\\": \\\"\\\",\\n \\\"feeRate\\\": \\\"0.00060\\\",\\n \\\"fixFee\\\": \\\"0\\\",\\n \\\"feeCurrency\\\": \\\"USDT\\\",\\n \\\"marginMode\\\": \\\"ISOLATED\\\",\\n \\\"settleCurrency\\\": \\\"USDT\\\",\\n \\\"fee\\\": \\\"0.04045854\\\",\\n \\\"orderType\\\": \\\"market\\\",\\n \\\"displayType\\\": \\\"market\\\",\\n \\\"tradeType\\\": \\\"trade\\\",\\n \\\"subTradeType\\\": null,\\n \\\"tradeTime\\\": 1729155616320000000,\\n \\\"createdAt\\\": 1729155616493\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"tradeId\\\": \\\"1784277132002\\\",\\n \\\"orderId\\\": \\\"236317094436728832\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"liquidity\\\": \\\"taker\\\",\\n \\\"forceTaker\\\": false,\\n \\\"price\\\": \\\"67445\\\",\\n \\\"size\\\": 1,\\n \\\"value\\\": \\\"67.445\\\",\\n \\\"openFeePay\\\": \\\"0\\\",\\n \\\"closeFeePay\\\": \\\"0.040467\\\",\\n \\\"stop\\\": \\\"\\\",\\n \\\"feeRate\\\": \\\"0.00060\\\",\\n \\\"fixFee\\\": \\\"0\\\",\\n \\\"feeCurrency\\\": \\\"USDT\\\",\\n \\\"marginMode\\\": \\\"ISOLATED\\\",\\n \\\"settleCurrency\\\": \\\"USDT\\\",\\n \\\"fee\\\": \\\"0.040467\\\",\\n \\\"orderType\\\": \\\"market\\\",\\n \\\"displayType\\\": \\\"market\\\",\\n \\\"tradeType\\\": \\\"trade\\\",\\n \\\"subTradeType\\\": null,\\n \\\"tradeTime\\\": 1729155587944000000,\\n \\\"createdAt\\\": 1729155588104\\n }\\n ]\\n }\\n}", - "x-request-example": "{\\\"orderId\\\": \\\"236655147005071361\\\", \\\"symbol\\\": \\\"example_string_default_value\\\", \\\"side\\\": \\\"buy\\\", \\\"type\\\": \\\"limit\\\", \\\"tradeTypes\\\": \\\"trade\\\", \\\"startAt\\\": 123456, \\\"endAt\\\": 123456, \\\"currentPage\\\": 1, \\\"pageSize\\\": 50}" + "x-request-example": "{\\\"orderId\\\": \\\"236655147005071361\\\", \\\"symbol\\\": \\\"example_string_default_value\\\", \\\"side\\\": \\\"buy\\\", \\\"type\\\": \\\"limit\\\", \\\"tradeTypes\\\": \\\"trade\\\", \\\"startAt\\\": 123456, \\\"endAt\\\": 123456, \\\"currentPage\\\": 1, \\\"pageSize\\\": 50}", + "operationId": "032" } }, "/api/v2/position/getMarginMode": { @@ -6933,7 +6966,8 @@ "x-sdk-method-description": "This interface can query the margin mode of the current symbol.", "x-api-rate-limit": 2, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"marginMode\\\": \\\"ISOLATED\\\"\\n }\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDTM\\\"}" + "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDTM\\\"}", + "operationId": "033" } }, "/api/v2/position/changeMarginMode": { @@ -7054,7 +7088,8 @@ } }, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"marginMode\\\": \\\"ISOLATED\\\"\\n }\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDTM\\\", \\\"marginMode\\\": \\\"ISOLATED\\\"}" + "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDTM\\\", \\\"marginMode\\\": \\\"ISOLATED\\\"}", + "operationId": "034" } }, "/api/v2/getMaxOpenSize": { @@ -7152,7 +7187,8 @@ "x-sdk-method-description": "Get Maximum Open Position Size.", "x-api-rate-limit": 2, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"maxBuyOpenSize\\\": 0,\\n \\\"maxSellOpenSize\\\": 0\\n }\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDTM\\\", \\\"price\\\": \\\"example_string_default_value\\\", \\\"leverage\\\": 123456}" + "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDTM\\\", \\\"price\\\": \\\"example_string_default_value\\\", \\\"leverage\\\": 123456}", + "operationId": "035" } }, "/api/v1/position": { @@ -7452,7 +7488,8 @@ "x-sdk-method-description": "Get the position details of a specified position.", "x-api-rate-limit": 2, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"id\\\": \\\"500000000000988255\\\",\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"autoDeposit\\\": false,\\n \\\"crossMode\\\": false,\\n \\\"maintMarginReq\\\": 0.005,\\n \\\"riskLimit\\\": 500000,\\n \\\"realLeverage\\\": 2.88,\\n \\\"delevPercentage\\\": 0.18,\\n \\\"openingTimestamp\\\": 1729155616322,\\n \\\"currentTimestamp\\\": 1729482542135,\\n \\\"currentQty\\\": 1,\\n \\\"currentCost\\\": 67.4309,\\n \\\"currentComm\\\": 0.01925174,\\n \\\"unrealisedCost\\\": 67.4309,\\n \\\"realisedGrossCost\\\": 0.0,\\n \\\"realisedCost\\\": 0.01925174,\\n \\\"isOpen\\\": true,\\n \\\"markPrice\\\": 68900.7,\\n \\\"markValue\\\": 68.9007,\\n \\\"posCost\\\": 67.4309,\\n \\\"posCross\\\": 0.01645214,\\n \\\"posCrossMargin\\\": 0,\\n \\\"posInit\\\": 22.4769666644,\\n \\\"posComm\\\": 0.0539546299,\\n \\\"posCommCommon\\\": 0.0539447199,\\n \\\"posLoss\\\": 0.03766885,\\n \\\"posMargin\\\": 22.5097045843,\\n \\\"posFunding\\\": -0.0212068,\\n \\\"posMaint\\\": 0.3931320569,\\n \\\"maintMargin\\\": 23.9795045843,\\n \\\"realisedGrossPnl\\\": 0.0,\\n \\\"realisedPnl\\\": -0.06166534,\\n \\\"unrealisedPnl\\\": 1.4698,\\n \\\"unrealisedPnlPcnt\\\": 0.0218,\\n \\\"unrealisedRoePcnt\\\": 0.0654,\\n \\\"avgEntryPrice\\\": 67430.9,\\n \\\"liquidationPrice\\\": 45314.33,\\n \\\"bankruptPrice\\\": 44975.16,\\n \\\"settleCurrency\\\": \\\"USDT\\\",\\n \\\"maintainMargin\\\": 0.005,\\n \\\"riskLimitLevel\\\": 2,\\n \\\"marginMode\\\": \\\"ISOLATED\\\",\\n \\\"positionSide\\\": \\\"BOTH\\\",\\n \\\"leverage\\\": 2.88\\n }\\n}\\n", - "x-request-example": "{\\\"symbol\\\": \\\"example_string_default_value\\\"}" + "x-request-example": "{\\\"symbol\\\": \\\"example_string_default_value\\\"}", + "operationId": "036" } }, "/api/v1/positions": { @@ -7760,7 +7797,8 @@ "x-sdk-method-description": "Get the position details of a specified position.", "x-api-rate-limit": 2, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": [\\n {\\n \\\"id\\\": \\\"500000000001046430\\\",\\n \\\"symbol\\\": \\\"ETHUSDM\\\",\\n \\\"crossMode\\\": true,\\n \\\"delevPercentage\\\": 0.71,\\n \\\"openingTimestamp\\\": 1730635780702,\\n \\\"currentTimestamp\\\": 1730636040926,\\n \\\"currentQty\\\": 1,\\n \\\"currentCost\\\": -4.069805E-4,\\n \\\"currentComm\\\": 2.441E-7,\\n \\\"unrealisedCost\\\": -4.069805E-4,\\n \\\"realisedGrossCost\\\": 0.0,\\n \\\"realisedCost\\\": 2.441E-7,\\n \\\"isOpen\\\": true,\\n \\\"markPrice\\\": 2454.12,\\n \\\"markValue\\\": -4.07478E-4,\\n \\\"posCost\\\": -4.069805E-4,\\n \\\"posInit\\\": 4.06981E-5,\\n \\\"posMargin\\\": 4.07478E-5,\\n \\\"realisedGrossPnl\\\": 0.0,\\n \\\"realisedPnl\\\": -2.441E-7,\\n \\\"unrealisedPnl\\\": -4.975E-7,\\n \\\"unrealisedPnlPcnt\\\": -0.0012,\\n \\\"unrealisedRoePcnt\\\": -0.0122,\\n \\\"avgEntryPrice\\\": 2457.12,\\n \\\"liquidationPrice\\\": 1429.96,\\n \\\"bankruptPrice\\\": 1414.96,\\n \\\"settleCurrency\\\": \\\"ETH\\\",\\n \\\"isInverse\\\": true,\\n \\\"marginMode\\\": \\\"CROSS\\\",\\n \\\"positionSide\\\": \\\"BOTH\\\",\\n \\\"leverage\\\": 10\\n },\\n {\\n \\\"id\\\": \\\"500000000000988255\\\",\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"autoDeposit\\\": true,\\n \\\"crossMode\\\": false,\\n \\\"maintMarginReq\\\": 0.005,\\n \\\"riskLimit\\\": 500000,\\n \\\"realLeverage\\\": 2.97,\\n \\\"delevPercentage\\\": 0.5,\\n \\\"openingTimestamp\\\": 1729155616322,\\n \\\"currentTimestamp\\\": 1730636040926,\\n \\\"currentQty\\\": 1,\\n \\\"currentCost\\\": 67.4309,\\n \\\"currentComm\\\": -0.15936162,\\n \\\"unrealisedCost\\\": 67.4309,\\n \\\"realisedGrossCost\\\": 0.0,\\n \\\"realisedCost\\\": -0.15936162,\\n \\\"isOpen\\\": true,\\n \\\"markPrice\\\": 68323.06,\\n \\\"markValue\\\": 68.32306,\\n \\\"posCost\\\": 67.4309,\\n \\\"posCross\\\": 0.06225152,\\n \\\"posCrossMargin\\\": 0,\\n \\\"posInit\\\": 22.2769666644,\\n \\\"posComm\\\": 0.0539821899,\\n \\\"posCommCommon\\\": 0.0539447199,\\n \\\"posLoss\\\": 0.26210915,\\n \\\"posMargin\\\": 22.1310912243,\\n \\\"posFunding\\\": -0.19982016,\\n \\\"posMaint\\\": 0.4046228699,\\n \\\"maintMargin\\\": 23.0232512243,\\n \\\"realisedGrossPnl\\\": 0.0,\\n \\\"realisedPnl\\\": -0.2402787,\\n \\\"unrealisedPnl\\\": 0.89216,\\n \\\"unrealisedPnlPcnt\\\": 0.0132,\\n \\\"unrealisedRoePcnt\\\": 0.04,\\n \\\"avgEntryPrice\\\": 67430.9,\\n \\\"liquidationPrice\\\": 45704.44,\\n \\\"bankruptPrice\\\": 45353.8,\\n \\\"settleCurrency\\\": \\\"USDT\\\",\\n \\\"isInverse\\\": false,\\n \\\"maintainMargin\\\": 0.005,\\n \\\"marginMode\\\": \\\"ISOLATED\\\",\\n \\\"positionSide\\\": \\\"BOTH\\\",\\n \\\"leverage\\\": 2.97\\n }\\n ]\\n}", - "x-request-example": "{\\\"currency\\\": \\\"USDT\\\"}" + "x-request-example": "{\\\"currency\\\": \\\"USDT\\\"}", + "operationId": "037" } }, "/api/v1/history-positions": { @@ -7990,7 +8028,8 @@ "x-sdk-method-description": "This interface can query position history information records.", "x-api-rate-limit": 2, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"currentPage\\\": 1,\\n \\\"pageSize\\\": 10,\\n \\\"totalNum\\\": 3,\\n \\\"totalPage\\\": 1,\\n \\\"items\\\": [\\n {\\n \\\"closeId\\\": \\\"500000000027312193\\\",\\n \\\"userId\\\": \\\"633559791e1cbc0001f319bc\\\",\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"settleCurrency\\\": \\\"USDT\\\",\\n \\\"leverage\\\": \\\"0.0\\\",\\n \\\"type\\\": \\\"CLOSE_SHORT\\\",\\n \\\"pnl\\\": \\\"-3.79237944\\\",\\n \\\"realisedGrossCost\\\": \\\"3.795\\\",\\n \\\"withdrawPnl\\\": \\\"0.0\\\",\\n \\\"tradeFee\\\": \\\"0.078657\\\",\\n \\\"fundingFee\\\": \\\"0.08127756\\\",\\n \\\"openTime\\\": 1727073653603,\\n \\\"closeTime\\\": 1729155587945,\\n \\\"openPrice\\\": \\\"63650.0\\\",\\n \\\"closePrice\\\": \\\"67445.0\\\",\\n \\\"marginMode\\\": \\\"ISOLATED\\\"\\n },\\n {\\n \\\"closeId\\\": \\\"500000000026809668\\\",\\n \\\"userId\\\": \\\"633559791e1cbc0001f319bc\\\",\\n \\\"symbol\\\": \\\"SUIUSDTM\\\",\\n \\\"settleCurrency\\\": \\\"USDT\\\",\\n \\\"leverage\\\": \\\"0.0\\\",\\n \\\"type\\\": \\\"LIQUID_SHORT\\\",\\n \\\"pnl\\\": \\\"-1.10919296\\\",\\n \\\"realisedGrossCost\\\": \\\"1.11297635\\\",\\n \\\"withdrawPnl\\\": \\\"0.0\\\",\\n \\\"tradeFee\\\": \\\"0.00200295\\\",\\n \\\"fundingFee\\\": \\\"0.00578634\\\",\\n \\\"openTime\\\": 1726473389296,\\n \\\"closeTime\\\": 1728738683541,\\n \\\"openPrice\\\": \\\"1.1072\\\",\\n \\\"closePrice\\\": \\\"2.22017635\\\",\\n \\\"marginMode\\\": \\\"ISOLATED\\\"\\n },\\n {\\n \\\"closeId\\\": \\\"500000000026819355\\\",\\n \\\"userId\\\": \\\"633559791e1cbc0001f319bc\\\",\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"settleCurrency\\\": \\\"USDT\\\",\\n \\\"leverage\\\": \\\"0.0\\\",\\n \\\"type\\\": \\\"LIQUID_SHORT\\\",\\n \\\"pnl\\\": \\\"-5.941896296\\\",\\n \\\"realisedGrossCost\\\": \\\"5.86937042\\\",\\n \\\"withdrawPnl\\\": \\\"0.0\\\",\\n \\\"tradeFee\\\": \\\"0.074020096\\\",\\n \\\"fundingFee\\\": \\\"0.00149422\\\",\\n \\\"openTime\\\": 1726490775358,\\n \\\"closeTime\\\": 1727061049859,\\n \\\"openPrice\\\": \\\"58679.6\\\",\\n \\\"closePrice\\\": \\\"64548.97042\\\",\\n \\\"marginMode\\\": \\\"ISOLATED\\\"\\n }\\n ]\\n }\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"example_string_default_value\\\", \\\"from\\\": 123456, \\\"to\\\": 123456, \\\"limit\\\": 10, \\\"pageId\\\": 1}" + "x-request-example": "{\\\"symbol\\\": \\\"example_string_default_value\\\", \\\"from\\\": 123456, \\\"to\\\": 123456, \\\"limit\\\": 10, \\\"pageId\\\": 1}", + "operationId": "038" } }, "/api/v1/margin/maxWithdrawMargin": { @@ -8047,7 +8086,8 @@ "x-sdk-method-description": "This interface can query the maximum amount of margin that the current position supports withdrawal.", "x-api-rate-limit": 10, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": \\\"21.1135719252\\\"\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"example_string_default_value\\\"}" + "x-request-example": "{\\\"symbol\\\": \\\"example_string_default_value\\\"}", + "operationId": "039" } }, "/api/v2/getCrossUserLeverage": { @@ -8117,7 +8157,8 @@ "x-sdk-method-description": "This interface can query the current symbol’s cross-margin leverage multiple.", "x-api-rate-limit": 2, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"leverage\\\": \\\"3\\\"\\n }\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDTM\\\"}" + "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDTM\\\"}", + "operationId": "040" } }, "/api/v2/changeCrossUserLeverage": { @@ -8199,7 +8240,8 @@ } }, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"leverage\\\": \\\"3\\\"\\n }\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDTM\\\", \\\"leverage\\\": \\\"10\\\"}" + "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDTM\\\", \\\"leverage\\\": \\\"10\\\"}", + "operationId": "041" } }, "/api/v1/position/margin/deposit-margin": { @@ -8465,7 +8507,8 @@ } }, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"id\\\": \\\"6200c9b83aecfb000152ddcd\\\",\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"autoDeposit\\\": false,\\n \\\"maintMarginReq\\\": 0.005,\\n \\\"riskLimit\\\": 500000,\\n \\\"realLeverage\\\": 18.72,\\n \\\"crossMode\\\": false,\\n \\\"delevPercentage\\\": 0.66,\\n \\\"openingTimestamp\\\": 1646287090131,\\n \\\"currentTimestamp\\\": 1646295055021,\\n \\\"currentQty\\\": 1,\\n \\\"currentCost\\\": 43.388,\\n \\\"currentComm\\\": 0.0260328,\\n \\\"unrealisedCost\\\": 43.388,\\n \\\"realisedGrossCost\\\": 0,\\n \\\"realisedCost\\\": 0.0260328,\\n \\\"isOpen\\\": true,\\n \\\"markPrice\\\": 43536.65,\\n \\\"markValue\\\": 43.53665,\\n \\\"posCost\\\": 43.388,\\n \\\"posCross\\\": 0.000024985,\\n \\\"posInit\\\": 2.1694,\\n \\\"posComm\\\": 0.02733446,\\n \\\"posLoss\\\": 0,\\n \\\"posMargin\\\": 2.19675944,\\n \\\"posMaint\\\": 0.24861326,\\n \\\"maintMargin\\\": 2.34540944,\\n \\\"realisedGrossPnl\\\": 0,\\n \\\"realisedPnl\\\": -0.0260328,\\n \\\"unrealisedPnl\\\": 0.14865,\\n \\\"unrealisedPnlPcnt\\\": 0.0034,\\n \\\"unrealisedRoePcnt\\\": 0.0685,\\n \\\"avgEntryPrice\\\": 43388,\\n \\\"liquidationPrice\\\": 41440,\\n \\\"bankruptPrice\\\": 41218,\\n \\\"userId\\\": 1234321123,\\n \\\"settleCurrency\\\": \\\"USDT\\\"\\n }\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"string\\\", \\\"margin\\\": 0, \\\"bizNo\\\": \\\"string\\\"}" + "x-request-example": "{\\\"symbol\\\": \\\"string\\\", \\\"margin\\\": 0, \\\"bizNo\\\": \\\"string\\\"}", + "operationId": "042" } }, "/api/v1/margin/withdrawMargin": { @@ -8536,7 +8579,8 @@ } }, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": \\\"0.1\\\"\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDTM\\\", \\\"withdrawAmount\\\": \\\"0.0000001\\\"}" + "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDTM\\\", \\\"withdrawAmount\\\": \\\"0.0000001\\\"}", + "operationId": "043" } }, "/api/v1/contracts/risk-limit/{symbol}": { @@ -8634,7 +8678,8 @@ "x-sdk-method-description": "This interface can be used to obtain information about risk limit level of a specific contract(Only valid for isolated Margin).", "x-api-rate-limit": 5, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": [\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"level\\\": 1,\\n \\\"maxRiskLimit\\\": 100000,\\n \\\"minRiskLimit\\\": 0,\\n \\\"maxLeverage\\\": 125,\\n \\\"initialMargin\\\": 0.008,\\n \\\"maintainMargin\\\": 0.004\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"level\\\": 2,\\n \\\"maxRiskLimit\\\": 500000,\\n \\\"minRiskLimit\\\": 100000,\\n \\\"maxLeverage\\\": 100,\\n \\\"initialMargin\\\": 0.01,\\n \\\"maintainMargin\\\": 0.005\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"level\\\": 3,\\n \\\"maxRiskLimit\\\": 1000000,\\n \\\"minRiskLimit\\\": 500000,\\n \\\"maxLeverage\\\": 75,\\n \\\"initialMargin\\\": 0.014,\\n \\\"maintainMargin\\\": 0.007\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"level\\\": 4,\\n \\\"maxRiskLimit\\\": 2000000,\\n \\\"minRiskLimit\\\": 1000000,\\n \\\"maxLeverage\\\": 50,\\n \\\"initialMargin\\\": 0.02,\\n \\\"maintainMargin\\\": 0.01\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"level\\\": 5,\\n \\\"maxRiskLimit\\\": 3000000,\\n \\\"minRiskLimit\\\": 2000000,\\n \\\"maxLeverage\\\": 30,\\n \\\"initialMargin\\\": 0.034,\\n \\\"maintainMargin\\\": 0.017\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"level\\\": 6,\\n \\\"maxRiskLimit\\\": 5000000,\\n \\\"minRiskLimit\\\": 3000000,\\n \\\"maxLeverage\\\": 20,\\n \\\"initialMargin\\\": 0.05,\\n \\\"maintainMargin\\\": 0.025\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"level\\\": 7,\\n \\\"maxRiskLimit\\\": 8000000,\\n \\\"minRiskLimit\\\": 5000000,\\n \\\"maxLeverage\\\": 10,\\n \\\"initialMargin\\\": 0.1,\\n \\\"maintainMargin\\\": 0.05\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"level\\\": 8,\\n \\\"maxRiskLimit\\\": 12000000,\\n \\\"minRiskLimit\\\": 8000000,\\n \\\"maxLeverage\\\": 5,\\n \\\"initialMargin\\\": 0.2,\\n \\\"maintainMargin\\\": 0.1\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"level\\\": 9,\\n \\\"maxRiskLimit\\\": 20000000,\\n \\\"minRiskLimit\\\": 12000000,\\n \\\"maxLeverage\\\": 4,\\n \\\"initialMargin\\\": 0.25,\\n \\\"maintainMargin\\\": 0.125\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"level\\\": 10,\\n \\\"maxRiskLimit\\\": 30000000,\\n \\\"minRiskLimit\\\": 20000000,\\n \\\"maxLeverage\\\": 3,\\n \\\"initialMargin\\\": 0.334,\\n \\\"maintainMargin\\\": 0.167\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"level\\\": 11,\\n \\\"maxRiskLimit\\\": 40000000,\\n \\\"minRiskLimit\\\": 30000000,\\n \\\"maxLeverage\\\": 2,\\n \\\"initialMargin\\\": 0.5,\\n \\\"maintainMargin\\\": 0.25\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"level\\\": 12,\\n \\\"maxRiskLimit\\\": 50000000,\\n \\\"minRiskLimit\\\": 40000000,\\n \\\"maxLeverage\\\": 1,\\n \\\"initialMargin\\\": 1.0,\\n \\\"maintainMargin\\\": 0.5\\n }\\n ]\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDTM\\\"}" + "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDTM\\\"}", + "operationId": "044" } }, "/api/v1/position/risk-limit-level/change": { @@ -8705,7 +8750,8 @@ } }, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": true\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDTM\\\", \\\"level\\\": 2}" + "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDTM\\\", \\\"level\\\": 2}", + "operationId": "045" } }, "/api/v1/funding-rate/{symbol}/current": { @@ -8801,7 +8847,8 @@ "x-sdk-method-description": "get Current Funding Rate", "x-api-rate-limit": 2, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"symbol\\\": \\\".XBTUSDTMFPI8H\\\",\\n \\\"granularity\\\": 28800000,\\n \\\"timePoint\\\": 1731441600000,\\n \\\"value\\\": 6.41E-4,\\n \\\"predictedValue\\\": 5.2E-5,\\n \\\"fundingRateCap\\\": 0.003,\\n \\\"fundingRateFloor\\\": -0.003\\n }\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDTM\\\"}" + "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDTM\\\"}", + "operationId": "046" } }, "/api/v1/contract/funding-rates": { @@ -8900,7 +8947,8 @@ "x-sdk-method-description": "Query the funding rate at each settlement time point within a certain time range of the corresponding contract", "x-api-rate-limit": 5, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": [\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"fundingRate\\\": 2.1E-4,\\n \\\"timepoint\\\": 1702296000000\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"fundingRate\\\": 3.47E-4,\\n \\\"timepoint\\\": 1702267200000\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"fundingRate\\\": 4.52E-4,\\n \\\"timepoint\\\": 1702238400000\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"fundingRate\\\": 5.13E-4,\\n \\\"timepoint\\\": 1702209600000\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"fundingRate\\\": 4.21E-4,\\n \\\"timepoint\\\": 1702180800000\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"fundingRate\\\": 5.06E-4,\\n \\\"timepoint\\\": 1702152000000\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"fundingRate\\\": 7.68E-4,\\n \\\"timepoint\\\": 1702123200000\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"fundingRate\\\": 4.82E-4,\\n \\\"timepoint\\\": 1702094400000\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"fundingRate\\\": 4.0E-4,\\n \\\"timepoint\\\": 1702065600000\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"fundingRate\\\": 5.46E-4,\\n \\\"timepoint\\\": 1702036800000\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"fundingRate\\\": 7.97E-4,\\n \\\"timepoint\\\": 1702008000000\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"fundingRate\\\": 5.76E-4,\\n \\\"timepoint\\\": 1701979200000\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"fundingRate\\\": 4.22E-4,\\n \\\"timepoint\\\": 1701950400000\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"fundingRate\\\": 3.92E-4,\\n \\\"timepoint\\\": 1701921600000\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"fundingRate\\\": 4.1E-4,\\n \\\"timepoint\\\": 1701892800000\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"fundingRate\\\": 4.48E-4,\\n \\\"timepoint\\\": 1701864000000\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"fundingRate\\\": 3.68E-4,\\n \\\"timepoint\\\": 1701835200000\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"fundingRate\\\": 3.51E-4,\\n \\\"timepoint\\\": 1701806400000\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"fundingRate\\\": 1.44E-4,\\n \\\"timepoint\\\": 1701777600000\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"fundingRate\\\": 4.25E-4,\\n \\\"timepoint\\\": 1701748800000\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"fundingRate\\\": -8.2E-5,\\n \\\"timepoint\\\": 1701720000000\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"fundingRate\\\": 4.64E-4,\\n \\\"timepoint\\\": 1701691200000\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"fundingRate\\\": 4.14E-4,\\n \\\"timepoint\\\": 1701662400000\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"fundingRate\\\": 2.44E-4,\\n \\\"timepoint\\\": 1701633600000\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"fundingRate\\\": 1.99E-4,\\n \\\"timepoint\\\": 1701604800000\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"fundingRate\\\": 1.79E-4,\\n \\\"timepoint\\\": 1701576000000\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"fundingRate\\\": 8.7E-5,\\n \\\"timepoint\\\": 1701547200000\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"fundingRate\\\": 1.6E-5,\\n \\\"timepoint\\\": 1701518400000\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"fundingRate\\\": -3.7E-5,\\n \\\"timepoint\\\": 1701489600000\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"fundingRate\\\": 1.5E-5,\\n \\\"timepoint\\\": 1701460800000\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"fundingRate\\\": 6.8E-5,\\n \\\"timepoint\\\": 1701432000000\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"fundingRate\\\": 7.2E-5,\\n \\\"timepoint\\\": 1701403200000\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"fundingRate\\\": 1.45E-4,\\n \\\"timepoint\\\": 1701374400000\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"fundingRate\\\": 1.41E-4,\\n \\\"timepoint\\\": 1701345600000\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"fundingRate\\\": 9.4E-5,\\n \\\"timepoint\\\": 1701316800000\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"fundingRate\\\": 1.08E-4,\\n \\\"timepoint\\\": 1701288000000\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"fundingRate\\\": 7.6E-5,\\n \\\"timepoint\\\": 1701259200000\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"fundingRate\\\": 1.0E-5,\\n \\\"timepoint\\\": 1701230400000\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"fundingRate\\\": 1.0E-5,\\n \\\"timepoint\\\": 1701201600000\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"fundingRate\\\": 1.16E-4,\\n \\\"timepoint\\\": 1701172800000\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"fundingRate\\\": 2.04E-4,\\n \\\"timepoint\\\": 1701144000000\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"fundingRate\\\": 2.3E-4,\\n \\\"timepoint\\\": 1701115200000\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"fundingRate\\\": 6.2E-5,\\n \\\"timepoint\\\": 1701086400000\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"fundingRate\\\": 1.33E-4,\\n \\\"timepoint\\\": 1701057600000\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"fundingRate\\\": 8.0E-5,\\n \\\"timepoint\\\": 1701028800000\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"fundingRate\\\": 1.11E-4,\\n \\\"timepoint\\\": 1701000000000\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"fundingRate\\\": 7.4E-5,\\n \\\"timepoint\\\": 1700971200000\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"fundingRate\\\": 1.01E-4,\\n \\\"timepoint\\\": 1700942400000\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"fundingRate\\\": 3.9E-5,\\n \\\"timepoint\\\": 1700913600000\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"fundingRate\\\": 1.1E-5,\\n \\\"timepoint\\\": 1700884800000\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"fundingRate\\\": 3.0E-6,\\n \\\"timepoint\\\": 1700856000000\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"fundingRate\\\": 1.03E-4,\\n \\\"timepoint\\\": 1700827200000\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"fundingRate\\\": 3.0E-6,\\n \\\"timepoint\\\": 1700798400000\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"fundingRate\\\": 6.7E-5,\\n \\\"timepoint\\\": 1700769600000\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"fundingRate\\\": 1.47E-4,\\n \\\"timepoint\\\": 1700740800000\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"fundingRate\\\": 7.8E-5,\\n \\\"timepoint\\\": 1700712000000\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"fundingRate\\\": 1.39E-4,\\n \\\"timepoint\\\": 1700683200000\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"fundingRate\\\": 7.5E-5,\\n \\\"timepoint\\\": 1700654400000\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"fundingRate\\\": 1.11E-4,\\n \\\"timepoint\\\": 1700625600000\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"fundingRate\\\": 9.8E-5,\\n \\\"timepoint\\\": 1700596800000\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"fundingRate\\\": 1.18E-4,\\n \\\"timepoint\\\": 1700568000000\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"fundingRate\\\": 1.16E-4,\\n \\\"timepoint\\\": 1700539200000\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"fundingRate\\\": 1.6E-4,\\n \\\"timepoint\\\": 1700510400000\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"fundingRate\\\": 1.92E-4,\\n \\\"timepoint\\\": 1700481600000\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"fundingRate\\\": 1.13E-4,\\n \\\"timepoint\\\": 1700452800000\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"fundingRate\\\": 2.47E-4,\\n \\\"timepoint\\\": 1700424000000\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"fundingRate\\\": 2.3E-4,\\n \\\"timepoint\\\": 1700395200000\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"fundingRate\\\": 2.63E-4,\\n \\\"timepoint\\\": 1700366400000\\n },\\n {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"fundingRate\\\": 1.32E-4,\\n \\\"timepoint\\\": 1700337600000\\n }\\n ]\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDTM\\\", \\\"from\\\": 1700310700000, \\\"to\\\": 1702310700000}" + "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDTM\\\", \\\"from\\\": 1700310700000, \\\"to\\\": 1702310700000}", + "operationId": "047" } }, "/api/v1/funding-history": { @@ -9105,7 +9153,8 @@ "x-sdk-method-description": "Submit request to get the funding history.", "x-api-rate-limit": 5, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"dataList\\\": [\\n {\\n \\\"id\\\": 1472387374042586,\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"timePoint\\\": 1731470400000,\\n \\\"fundingRate\\\": 6.41E-4,\\n \\\"markPrice\\\": 87139.92,\\n \\\"positionQty\\\": 1,\\n \\\"positionCost\\\": 87.13992,\\n \\\"funding\\\": -0.05585669,\\n \\\"settleCurrency\\\": \\\"USDT\\\",\\n \\\"context\\\": \\\"{\\\\\\\"marginMode\\\\\\\": \\\\\\\"ISOLATED\\\\\\\", \\\\\\\"positionSide\\\\\\\": \\\\\\\"BOTH\\\\\\\"}\\\",\\n \\\"marginMode\\\": \\\"ISOLATED\\\"\\n }\\n ],\\n \\\"hasMore\\\": true\\n }\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDTM\\\", \\\"from\\\": 1700310700000, \\\"to\\\": 1702310700000, \\\"reverse\\\": true, \\\"offset\\\": 123456, \\\"forward\\\": true, \\\"maxCount\\\": 123456}" + "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDTM\\\", \\\"from\\\": 1700310700000, \\\"to\\\": 1702310700000, \\\"reverse\\\": true, \\\"offset\\\": 123456, \\\"forward\\\": true, \\\"maxCount\\\": 123456}", + "operationId": "048" } }, "/api/v1/bullet-public": { @@ -9205,7 +9254,8 @@ "x-sdk-method-name": "getPublicToken", "x-sdk-method-description": "This interface can obtain the token required for websocket to establish a Futures connection. If you need use public channels (e.g. all public market data), please make request as follows to obtain the server list and public token", "x-api-rate-limit": 10, - "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"token\\\":\\\"2neAiuYvAU61ZDXANAGAsiL4-iAExhsBXZxftpOeh_55i3Ysy2q2LEsEWU64mdzUOPusi34M_wGoSf7iNyEWJ6dACm4ny9vJtLTRq_YsRUlG5ADnAawegdiYB9J6i9GjsxUuhPw3Blq6rhZlGykT3Vp1phUafnulOOpts-MEmEF-3bpfetLOAjsMMBS5qwTWJBvJHl5Vs9Y=.gJEIAywPXFr_4L-WG10eug==\\\",\\\"instanceServers\\\":[{\\\"endpoint\\\":\\\"wss://ws-api-futures.kucoin.com/\\\",\\\"encrypt\\\":true,\\\"protocol\\\":\\\"websocket\\\",\\\"pingInterval\\\":18000,\\\"pingTimeout\\\":10000}]}}" + "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"token\\\":\\\"2neAiuYvAU61ZDXANAGAsiL4-iAExhsBXZxftpOeh_55i3Ysy2q2LEsEWU64mdzUOPusi34M_wGoSf7iNyEWJ6dACm4ny9vJtLTRq_YsRUlG5ADnAawegdiYB9J6i9GjsxUuhPw3Blq6rhZlGykT3Vp1phUafnulOOpts-MEmEF-3bpfetLOAjsMMBS5qwTWJBvJHl5Vs9Y=.gJEIAywPXFr_4L-WG10eug==\\\",\\\"instanceServers\\\":[{\\\"endpoint\\\":\\\"wss://ws-api-futures.kucoin.com/\\\",\\\"encrypt\\\":true,\\\"protocol\\\":\\\"websocket\\\",\\\"pingInterval\\\":18000,\\\"pingTimeout\\\":10000}]}}", + "operationId": "049" } }, "/api/v1/bullet-private": { @@ -9305,7 +9355,8 @@ "x-sdk-method-name": "getPrivateToken", "x-sdk-method-description": "This interface can obtain the token required for websocket to establish a Futures private connection. If you need use private channels(e.g. account balance notice), please make request as follows to obtain the server list and private token", "x-api-rate-limit": 10, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"token\\\": \\\"2neAiuYvAU737TOajb2U3uT8AEZqSWYe0fBD4LoHuXJDSC7gIzJiH4kNTWhCPISWo6nDpAe7aUaaHJ4fG8oRjFgMfUI2sM4IySWHrBceFocY8pKy2REU1HwZIngtMdMrjqPnP-biofFWbNaP1cl0X1pZc2SQ-33hDH1LgNP-yg8bktVoIG0dIxSN4m3uzO8u.ueCCihQ5_4GPpXKxWTDiFQ==\\\",\\n \\\"instanceServers\\\": [\\n {\\n \\\"endpoint\\\": \\\"wss://ws-api-futures.kucoin.com/\\\",\\n \\\"encrypt\\\": true,\\n \\\"protocol\\\": \\\"websocket\\\",\\n \\\"pingInterval\\\": 18000,\\n \\\"pingTimeout\\\": 10000\\n }\\n ]\\n }\\n}" + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"token\\\": \\\"2neAiuYvAU737TOajb2U3uT8AEZqSWYe0fBD4LoHuXJDSC7gIzJiH4kNTWhCPISWo6nDpAe7aUaaHJ4fG8oRjFgMfUI2sM4IySWHrBceFocY8pKy2REU1HwZIngtMdMrjqPnP-biofFWbNaP1cl0X1pZc2SQ-33hDH1LgNP-yg8bktVoIG0dIxSN4m3uzO8u.ueCCihQ5_4GPpXKxWTDiFQ==\\\",\\n \\\"instanceServers\\\": [\\n {\\n \\\"endpoint\\\": \\\"wss://ws-api-futures.kucoin.com/\\\",\\n \\\"encrypt\\\": true,\\n \\\"protocol\\\": \\\"websocket\\\",\\n \\\"pingInterval\\\": 18000,\\n \\\"pingTimeout\\\": 10000\\n }\\n ]\\n }\\n}", + "operationId": "050" } }, "/api/v1/position/margin/auto-deposit-status": { @@ -9379,7 +9430,8 @@ } }, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": true\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDTM\\\", \\\"status\\\": true}" + "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDTM\\\", \\\"status\\\": true}", + "operationId": "051" } } }, diff --git a/spec/rest/entry/openapi-margin.json b/spec/rest/entry/openapi-margin.json index cc678f06..b2f502c5 100644 --- a/spec/rest/entry/openapi-margin.json +++ b/spec/rest/entry/openapi-margin.json @@ -165,7 +165,8 @@ "x-sdk-method-description": "This endpoint allows querying the configuration of cross margin symbol.", "x-api-rate-limit": 3, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"timestamp\\\": 1729665839353,\\n \\\"items\\\": [\\n {\\n \\\"symbol\\\": \\\"BTC-USDT\\\",\\n \\\"name\\\": \\\"BTC-USDT\\\",\\n \\\"enableTrading\\\": true,\\n \\\"market\\\": \\\"USDS\\\",\\n \\\"baseCurrency\\\": \\\"BTC\\\",\\n \\\"quoteCurrency\\\": \\\"USDT\\\",\\n \\\"baseIncrement\\\": \\\"0.00000001\\\",\\n \\\"baseMinSize\\\": \\\"0.00001\\\",\\n \\\"baseMaxSize\\\": \\\"10000000000\\\",\\n \\\"quoteIncrement\\\": \\\"0.000001\\\",\\n \\\"quoteMinSize\\\": \\\"0.1\\\",\\n \\\"quoteMaxSize\\\": \\\"99999999\\\",\\n \\\"priceIncrement\\\": \\\"0.1\\\",\\n \\\"feeCurrency\\\": \\\"USDT\\\",\\n \\\"priceLimitRate\\\": \\\"0.1\\\",\\n \\\"minFunds\\\": \\\"0.1\\\"\\n }\\n ]\\n }\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\"}" + "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\"}", + "operationId": "001" } }, "/api/v1/margin/config": { @@ -237,7 +238,8 @@ "x-sdk-method-name": "getMarginConfig", "x-sdk-method-description": "Request via this endpoint to get the configure info of the cross margin.", "x-api-rate-limit": 25, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"maxLeverage\\\": 5,\\n \\\"warningDebtRatio\\\": \\\"0.95\\\",\\n \\\"liqDebtRatio\\\": \\\"0.97\\\",\\n \\\"currencyList\\\": [\\n \\\"VRA\\\",\\n \\\"APT\\\",\\n \\\"IOTX\\\",\\n \\\"SHIB\\\",\\n \\\"KDA\\\",\\n \\\"BCHSV\\\",\\n \\\"NEAR\\\",\\n \\\"CLV\\\",\\n \\\"AUDIO\\\",\\n \\\"AIOZ\\\",\\n \\\"FLOW\\\",\\n \\\"WLD\\\",\\n \\\"COMP\\\",\\n \\\"MEME\\\",\\n \\\"SLP\\\",\\n \\\"STX\\\",\\n \\\"ZRO\\\",\\n \\\"QI\\\",\\n \\\"PYTH\\\",\\n \\\"RUNE\\\",\\n \\\"DGB\\\",\\n \\\"IOST\\\",\\n \\\"SUI\\\",\\n \\\"BCH\\\",\\n \\\"CAKE\\\",\\n \\\"DOT\\\",\\n \\\"OMG\\\",\\n \\\"POL\\\",\\n \\\"GMT\\\",\\n \\\"1INCH\\\",\\n \\\"RSR\\\",\\n \\\"NKN\\\",\\n \\\"BTC\\\",\\n \\\"AR\\\",\\n \\\"ARB\\\",\\n \\\"TON\\\",\\n \\\"LISTA\\\",\\n \\\"AVAX\\\",\\n \\\"SEI\\\",\\n \\\"FTM\\\",\\n \\\"ERN\\\",\\n \\\"BB\\\",\\n \\\"BTT\\\",\\n \\\"JTO\\\",\\n \\\"ONE\\\",\\n \\\"RLC\\\",\\n \\\"ANKR\\\",\\n \\\"SUSHI\\\",\\n \\\"CATI\\\",\\n \\\"ALGO\\\",\\n \\\"PEPE2\\\",\\n \\\"ATOM\\\",\\n \\\"LPT\\\",\\n \\\"BIGTIME\\\",\\n \\\"CFX\\\",\\n \\\"DYM\\\",\\n \\\"VELO\\\",\\n \\\"XPR\\\",\\n \\\"SNX\\\",\\n \\\"JUP\\\",\\n \\\"MANA\\\",\\n \\\"API3\\\",\\n \\\"PYR\\\",\\n \\\"ROSE\\\",\\n \\\"GLMR\\\",\\n \\\"SATS\\\",\\n \\\"TIA\\\",\\n \\\"GALAX\\\",\\n \\\"SOL\\\",\\n \\\"DAO\\\",\\n \\\"FET\\\",\\n \\\"ETC\\\",\\n \\\"MKR\\\",\\n \\\"WOO\\\",\\n \\\"DODO\\\",\\n \\\"OGN\\\",\\n \\\"BNB\\\",\\n \\\"ICP\\\",\\n \\\"BLUR\\\",\\n \\\"ETH\\\",\\n \\\"ZEC\\\",\\n \\\"NEO\\\",\\n \\\"CELO\\\",\\n \\\"REN\\\",\\n \\\"MANTA\\\",\\n \\\"LRC\\\",\\n \\\"STRK\\\",\\n \\\"ADA\\\",\\n \\\"STORJ\\\",\\n \\\"REQ\\\",\\n \\\"TAO\\\",\\n \\\"VET\\\",\\n \\\"FITFI\\\",\\n \\\"USDT\\\",\\n \\\"DOGE\\\",\\n \\\"HBAR\\\",\\n \\\"SXP\\\",\\n \\\"NEIROCTO\\\",\\n \\\"CHR\\\",\\n \\\"ORDI\\\",\\n \\\"DASH\\\",\\n \\\"PEPE\\\",\\n \\\"ONDO\\\",\\n \\\"ILV\\\",\\n \\\"WAVES\\\",\\n \\\"CHZ\\\",\\n \\\"DOGS\\\",\\n \\\"XRP\\\",\\n \\\"CTSI\\\",\\n \\\"JASMY\\\",\\n \\\"FLOKI\\\",\\n \\\"TRX\\\",\\n \\\"KAVA\\\",\\n \\\"SAND\\\",\\n \\\"C98\\\",\\n \\\"UMA\\\",\\n \\\"NOT\\\",\\n \\\"IMX\\\",\\n \\\"WIF\\\",\\n \\\"ENA\\\",\\n \\\"EGLD\\\",\\n \\\"BOME\\\",\\n \\\"LTC\\\",\\n \\\"USDC\\\",\\n \\\"METIS\\\",\\n \\\"WIN\\\",\\n \\\"THETA\\\",\\n \\\"FXS\\\",\\n \\\"ENJ\\\",\\n \\\"CRO\\\",\\n \\\"AEVO\\\",\\n \\\"INJ\\\",\\n \\\"LTO\\\",\\n \\\"CRV\\\",\\n \\\"GRT\\\",\\n \\\"DYDX\\\",\\n \\\"FLUX\\\",\\n \\\"ENS\\\",\\n \\\"WAX\\\",\\n \\\"MASK\\\",\\n \\\"POND\\\",\\n \\\"UNI\\\",\\n \\\"AAVE\\\",\\n \\\"LINA\\\",\\n \\\"TLM\\\",\\n \\\"BONK\\\",\\n \\\"QNT\\\",\\n \\\"LDO\\\",\\n \\\"ALICE\\\",\\n \\\"XLM\\\",\\n \\\"LINK\\\",\\n \\\"CKB\\\",\\n \\\"LUNC\\\",\\n \\\"YFI\\\",\\n \\\"ETHW\\\",\\n \\\"XTZ\\\",\\n \\\"LUNA\\\",\\n \\\"OP\\\",\\n \\\"SUPER\\\",\\n \\\"EIGEN\\\",\\n \\\"KSM\\\",\\n \\\"ELON\\\",\\n \\\"EOS\\\",\\n \\\"FIL\\\",\\n \\\"ZETA\\\",\\n \\\"SKL\\\",\\n \\\"BAT\\\",\\n \\\"APE\\\",\\n \\\"HMSTR\\\",\\n \\\"YGG\\\",\\n \\\"MOVR\\\",\\n \\\"PEOPLE\\\",\\n \\\"KCS\\\",\\n \\\"AXS\\\",\\n \\\"ARPA\\\",\\n \\\"ZIL\\\"\\n ]\\n }\\n}" + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"maxLeverage\\\": 5,\\n \\\"warningDebtRatio\\\": \\\"0.95\\\",\\n \\\"liqDebtRatio\\\": \\\"0.97\\\",\\n \\\"currencyList\\\": [\\n \\\"VRA\\\",\\n \\\"APT\\\",\\n \\\"IOTX\\\",\\n \\\"SHIB\\\",\\n \\\"KDA\\\",\\n \\\"BCHSV\\\",\\n \\\"NEAR\\\",\\n \\\"CLV\\\",\\n \\\"AUDIO\\\",\\n \\\"AIOZ\\\",\\n \\\"FLOW\\\",\\n \\\"WLD\\\",\\n \\\"COMP\\\",\\n \\\"MEME\\\",\\n \\\"SLP\\\",\\n \\\"STX\\\",\\n \\\"ZRO\\\",\\n \\\"QI\\\",\\n \\\"PYTH\\\",\\n \\\"RUNE\\\",\\n \\\"DGB\\\",\\n \\\"IOST\\\",\\n \\\"SUI\\\",\\n \\\"BCH\\\",\\n \\\"CAKE\\\",\\n \\\"DOT\\\",\\n \\\"OMG\\\",\\n \\\"POL\\\",\\n \\\"GMT\\\",\\n \\\"1INCH\\\",\\n \\\"RSR\\\",\\n \\\"NKN\\\",\\n \\\"BTC\\\",\\n \\\"AR\\\",\\n \\\"ARB\\\",\\n \\\"TON\\\",\\n \\\"LISTA\\\",\\n \\\"AVAX\\\",\\n \\\"SEI\\\",\\n \\\"FTM\\\",\\n \\\"ERN\\\",\\n \\\"BB\\\",\\n \\\"BTT\\\",\\n \\\"JTO\\\",\\n \\\"ONE\\\",\\n \\\"RLC\\\",\\n \\\"ANKR\\\",\\n \\\"SUSHI\\\",\\n \\\"CATI\\\",\\n \\\"ALGO\\\",\\n \\\"PEPE2\\\",\\n \\\"ATOM\\\",\\n \\\"LPT\\\",\\n \\\"BIGTIME\\\",\\n \\\"CFX\\\",\\n \\\"DYM\\\",\\n \\\"VELO\\\",\\n \\\"XPR\\\",\\n \\\"SNX\\\",\\n \\\"JUP\\\",\\n \\\"MANA\\\",\\n \\\"API3\\\",\\n \\\"PYR\\\",\\n \\\"ROSE\\\",\\n \\\"GLMR\\\",\\n \\\"SATS\\\",\\n \\\"TIA\\\",\\n \\\"GALAX\\\",\\n \\\"SOL\\\",\\n \\\"DAO\\\",\\n \\\"FET\\\",\\n \\\"ETC\\\",\\n \\\"MKR\\\",\\n \\\"WOO\\\",\\n \\\"DODO\\\",\\n \\\"OGN\\\",\\n \\\"BNB\\\",\\n \\\"ICP\\\",\\n \\\"BLUR\\\",\\n \\\"ETH\\\",\\n \\\"ZEC\\\",\\n \\\"NEO\\\",\\n \\\"CELO\\\",\\n \\\"REN\\\",\\n \\\"MANTA\\\",\\n \\\"LRC\\\",\\n \\\"STRK\\\",\\n \\\"ADA\\\",\\n \\\"STORJ\\\",\\n \\\"REQ\\\",\\n \\\"TAO\\\",\\n \\\"VET\\\",\\n \\\"FITFI\\\",\\n \\\"USDT\\\",\\n \\\"DOGE\\\",\\n \\\"HBAR\\\",\\n \\\"SXP\\\",\\n \\\"NEIROCTO\\\",\\n \\\"CHR\\\",\\n \\\"ORDI\\\",\\n \\\"DASH\\\",\\n \\\"PEPE\\\",\\n \\\"ONDO\\\",\\n \\\"ILV\\\",\\n \\\"WAVES\\\",\\n \\\"CHZ\\\",\\n \\\"DOGS\\\",\\n \\\"XRP\\\",\\n \\\"CTSI\\\",\\n \\\"JASMY\\\",\\n \\\"FLOKI\\\",\\n \\\"TRX\\\",\\n \\\"KAVA\\\",\\n \\\"SAND\\\",\\n \\\"C98\\\",\\n \\\"UMA\\\",\\n \\\"NOT\\\",\\n \\\"IMX\\\",\\n \\\"WIF\\\",\\n \\\"ENA\\\",\\n \\\"EGLD\\\",\\n \\\"BOME\\\",\\n \\\"LTC\\\",\\n \\\"USDC\\\",\\n \\\"METIS\\\",\\n \\\"WIN\\\",\\n \\\"THETA\\\",\\n \\\"FXS\\\",\\n \\\"ENJ\\\",\\n \\\"CRO\\\",\\n \\\"AEVO\\\",\\n \\\"INJ\\\",\\n \\\"LTO\\\",\\n \\\"CRV\\\",\\n \\\"GRT\\\",\\n \\\"DYDX\\\",\\n \\\"FLUX\\\",\\n \\\"ENS\\\",\\n \\\"WAX\\\",\\n \\\"MASK\\\",\\n \\\"POND\\\",\\n \\\"UNI\\\",\\n \\\"AAVE\\\",\\n \\\"LINA\\\",\\n \\\"TLM\\\",\\n \\\"BONK\\\",\\n \\\"QNT\\\",\\n \\\"LDO\\\",\\n \\\"ALICE\\\",\\n \\\"XLM\\\",\\n \\\"LINK\\\",\\n \\\"CKB\\\",\\n \\\"LUNC\\\",\\n \\\"YFI\\\",\\n \\\"ETHW\\\",\\n \\\"XTZ\\\",\\n \\\"LUNA\\\",\\n \\\"OP\\\",\\n \\\"SUPER\\\",\\n \\\"EIGEN\\\",\\n \\\"KSM\\\",\\n \\\"ELON\\\",\\n \\\"EOS\\\",\\n \\\"FIL\\\",\\n \\\"ZETA\\\",\\n \\\"SKL\\\",\\n \\\"BAT\\\",\\n \\\"APE\\\",\\n \\\"HMSTR\\\",\\n \\\"YGG\\\",\\n \\\"MOVR\\\",\\n \\\"PEOPLE\\\",\\n \\\"KCS\\\",\\n \\\"AXS\\\",\\n \\\"ARPA\\\",\\n \\\"ZIL\\\"\\n ]\\n }\\n}", + "operationId": "002" } }, "/api/v3/etf/info": { @@ -330,7 +332,8 @@ "x-sdk-method-description": "This interface returns leveraged token information", "x-api-rate-limit": 3, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": [\\n {\\n \\\"currency\\\": \\\"BTCUP\\\",\\n \\\"netAsset\\\": \\\"33.846\\\",\\n \\\"targetLeverage\\\": \\\"2-4\\\",\\n \\\"actualLeverage\\\": \\\"2.1648\\\",\\n \\\"issuedSize\\\": \\\"107134.87655291\\\",\\n \\\"basket\\\": \\\"118.324559 XBTUSDTM\\\"\\n }\\n ]\\n}", - "x-request-example": "{\\\"currency\\\": \\\"BTCUP\\\"}" + "x-request-example": "{\\\"currency\\\": \\\"BTCUP\\\"}", + "operationId": "003" } }, "/api/v3/mark-price/all-symbols": { @@ -398,7 +401,8 @@ "x-sdk-method-name": "getMarkPriceList", "x-sdk-method-description": "This endpoint returns the current Mark price for all margin trading pairs.", "x-api-rate-limit": 10, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": [\\n {\\n \\\"symbol\\\": \\\"USDT-BTC\\\",\\n \\\"timePoint\\\": 1729676522000,\\n \\\"value\\\": 1.504E-5\\n },\\n {\\n \\\"symbol\\\": \\\"USDC-BTC\\\",\\n \\\"timePoint\\\": 1729676522000,\\n \\\"value\\\": 1.5049024E-5\\n }\\n ]\\n}" + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": [\\n {\\n \\\"symbol\\\": \\\"USDT-BTC\\\",\\n \\\"timePoint\\\": 1729676522000,\\n \\\"value\\\": 1.504E-5\\n },\\n {\\n \\\"symbol\\\": \\\"USDC-BTC\\\",\\n \\\"timePoint\\\": 1729676522000,\\n \\\"value\\\": 1.5049024E-5\\n }\\n ]\\n}", + "operationId": "004" } }, "/api/v1/mark-price/{symbol}/current": { @@ -474,7 +478,8 @@ "x-sdk-method-description": "This endpoint returns the current Mark price for specified margin trading pairs.", "x-api-rate-limit": 2, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"symbol\\\": \\\"USDT-BTC\\\",\\n \\\"timePoint\\\": 1729676888000,\\n \\\"value\\\": 1.5045E-5\\n }\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"USDT-BTC\\\"}" + "x-request-example": "{\\\"symbol\\\": \\\"USDT-BTC\\\"}", + "operationId": "005" } }, "/api/v1/isolated/symbols": { @@ -587,7 +592,8 @@ "x-sdk-method-name": "getIsolatedMarginSymbols", "x-sdk-method-description": "This endpoint allows querying the configuration of isolated margin symbol.", "x-api-rate-limit": 3, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": [\\n {\\n \\\"symbol\\\": \\\"BTC-USDT\\\",\\n \\\"symbolName\\\": \\\"BTC-USDT\\\",\\n \\\"baseCurrency\\\": \\\"BTC\\\",\\n \\\"quoteCurrency\\\": \\\"USDT\\\",\\n \\\"maxLeverage\\\": 10,\\n \\\"flDebtRatio\\\": \\\"0.97\\\",\\n \\\"tradeEnable\\\": true,\\n \\\"autoRenewMaxDebtRatio\\\": \\\"0.96\\\",\\n \\\"baseBorrowEnable\\\": true,\\n \\\"quoteBorrowEnable\\\": true,\\n \\\"baseTransferInEnable\\\": true,\\n \\\"quoteTransferInEnable\\\": true,\\n \\\"baseBorrowCoefficient\\\": \\\"1\\\",\\n \\\"quoteBorrowCoefficient\\\": \\\"1\\\"\\n }\\n ]\\n}" + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": [\\n {\\n \\\"symbol\\\": \\\"BTC-USDT\\\",\\n \\\"symbolName\\\": \\\"BTC-USDT\\\",\\n \\\"baseCurrency\\\": \\\"BTC\\\",\\n \\\"quoteCurrency\\\": \\\"USDT\\\",\\n \\\"maxLeverage\\\": 10,\\n \\\"flDebtRatio\\\": \\\"0.97\\\",\\n \\\"tradeEnable\\\": true,\\n \\\"autoRenewMaxDebtRatio\\\": \\\"0.96\\\",\\n \\\"baseBorrowEnable\\\": true,\\n \\\"quoteBorrowEnable\\\": true,\\n \\\"baseTransferInEnable\\\": true,\\n \\\"quoteTransferInEnable\\\": true,\\n \\\"baseBorrowCoefficient\\\": \\\"1\\\",\\n \\\"quoteBorrowCoefficient\\\": \\\"1\\\"\\n }\\n ]\\n}", + "operationId": "006" } }, "/api/v3/hf/margin/order": { @@ -850,7 +856,8 @@ } }, "x-response-example": "{\\n \\\"success\\\": true,\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"orderId\\\": \\\"671663e02188630007e21c9c\\\",\\n \\\"clientOid\\\": \\\"5c52e11203aa677f33e1493fb\\\",\\n \\\"borrowSize\\\": \\\"10.2\\\",\\n \\\"loanApplyId\\\": \\\"600656d9a33ac90009de4f6f\\\"\\n }\\n}", - "x-request-example": "{\\\"type\\\": \\\"limit\\\", \\\"symbol\\\": \\\"BTC-USDT\\\", \\\"side\\\": \\\"buy\\\", \\\"price\\\": \\\"50000\\\", \\\"size\\\": \\\"0.00001\\\", \\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\", \\\"remark\\\": \\\"order remarks\\\"}" + "x-request-example": "{\\\"type\\\": \\\"limit\\\", \\\"symbol\\\": \\\"BTC-USDT\\\", \\\"side\\\": \\\"buy\\\", \\\"price\\\": \\\"50000\\\", \\\"size\\\": \\\"0.00001\\\", \\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\", \\\"remark\\\": \\\"order remarks\\\"}", + "operationId": "007" } }, "/api/v3/hf/margin/order/test": { @@ -1113,7 +1120,8 @@ } }, "x-response-example": "{\\n \\\"success\\\": true,\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"orderId\\\": \\\"5bd6e9286d99522a52e458de\\\",\\n \\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\",\\n \\\"borrowSize\\\": 10.2,\\n \\\"loanApplyId\\\": \\\"600656d9a33ac90009de4f6f\\\"\\n }\\n}", - "x-request-example": "{\\\"type\\\": \\\"limit\\\", \\\"symbol\\\": \\\"BTC-USDT\\\", \\\"side\\\": \\\"buy\\\", \\\"price\\\": \\\"50000\\\", \\\"size\\\": \\\"0.00001\\\", \\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\", \\\"remark\\\": \\\"order remarks\\\"}" + "x-request-example": "{\\\"type\\\": \\\"limit\\\", \\\"symbol\\\": \\\"BTC-USDT\\\", \\\"side\\\": \\\"buy\\\", \\\"price\\\": \\\"50000\\\", \\\"size\\\": \\\"0.00001\\\", \\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\", \\\"remark\\\": \\\"order remarks\\\"}", + "operationId": "008" } }, "/api/v3/hf/margin/orders/{orderId}": { @@ -1192,7 +1200,8 @@ "x-sdk-method-description": "This endpoint can be used to cancel a margin order by orderId. This endpoint only sends cancellation requests. The results of the requests must be obtained by checking the order status or subscribing to websocket.", "x-api-rate-limit": 5, "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"orderId\\\":\\\"671663e02188630007e21c9c\\\"}}", - "x-request-example": "{\\\"orderId\\\": \\\"671663e02188630007e21c9c\\\", \\\"symbol\\\": \\\"BTC-USDT\\\"}" + "x-request-example": "{\\\"orderId\\\": \\\"671663e02188630007e21c9c\\\", \\\"symbol\\\": \\\"BTC-USDT\\\"}", + "operationId": "009" }, "get": { "summary": "Get Order By OrderId", @@ -1534,7 +1543,8 @@ "x-sdk-method-description": "This endpoint can be used to obtain information for a single Margin order using the order id. After the user successfully places an order, the order is in Active state, and the user can use inOrderBook to determine whether the order has entered the order. Canceled or fully filled orders are marked as completed Done status.", "x-api-rate-limit": 5, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"id\\\": \\\"671667306afcdb000723107f\\\",\\n \\\"symbol\\\": \\\"BTC-USDT\\\",\\n \\\"opType\\\": \\\"DEAL\\\",\\n \\\"type\\\": \\\"limit\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"price\\\": \\\"50000\\\",\\n \\\"size\\\": \\\"0.00001\\\",\\n \\\"funds\\\": \\\"0.5\\\",\\n \\\"dealSize\\\": \\\"0\\\",\\n \\\"dealFunds\\\": \\\"0\\\",\\n \\\"fee\\\": \\\"0\\\",\\n \\\"feeCurrency\\\": \\\"USDT\\\",\\n \\\"stp\\\": null,\\n \\\"stop\\\": null,\\n \\\"stopTriggered\\\": false,\\n \\\"stopPrice\\\": \\\"0\\\",\\n \\\"timeInForce\\\": \\\"GTC\\\",\\n \\\"postOnly\\\": false,\\n \\\"hidden\\\": false,\\n \\\"iceberg\\\": false,\\n \\\"visibleSize\\\": \\\"0\\\",\\n \\\"cancelAfter\\\": 0,\\n \\\"channel\\\": \\\"API\\\",\\n \\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\",\\n \\\"remark\\\": null,\\n \\\"tags\\\": null,\\n \\\"cancelExist\\\": false,\\n \\\"createdAt\\\": 1729521456248,\\n \\\"lastUpdatedAt\\\": 1729651011877,\\n \\\"tradeType\\\": \\\"MARGIN_TRADE\\\",\\n \\\"inOrderBook\\\": true,\\n \\\"cancelledSize\\\": \\\"0\\\",\\n \\\"cancelledFunds\\\": \\\"0\\\",\\n \\\"remainSize\\\": \\\"0.00001\\\",\\n \\\"remainFunds\\\": \\\"0.5\\\",\\n \\\"tax\\\": \\\"0\\\",\\n \\\"active\\\": true\\n }\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"orderId\\\": \\\"671667306afcdb000723107f\\\"}" + "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"orderId\\\": \\\"671667306afcdb000723107f\\\"}", + "operationId": "016" } }, "/api/v3/hf/margin/orders/client-order/{clientOid}": { @@ -1613,7 +1623,8 @@ "x-sdk-method-description": "This endpoint can be used to cancel a margin order by clientOid. This endpoint only sends cancellation requests. The results of the requests must be obtained by checking the order status or subscribing to websocket.", "x-api-rate-limit": 5, "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"clientOid\\\":\\\"5c52e11203aa677f33e1493fb\\\"}}", - "x-request-example": "{\\\"clientOid\\\": \\\"5c52e11203aa677f33e1493fb\\\", \\\"symbol\\\": \\\"BTC-USDT\\\"}" + "x-request-example": "{\\\"clientOid\\\": \\\"5c52e11203aa677f33e1493fb\\\", \\\"symbol\\\": \\\"BTC-USDT\\\"}", + "operationId": "010" }, "get": { "summary": "Get Order By ClientOid", @@ -1954,7 +1965,8 @@ "x-sdk-method-description": "This endpoint can be used to obtain information for a single Margin order using the client order id. After the user successfully places an order, the order is in Active state, and the user can use inOrderBook to determine whether the order has entered the order. Canceled or fully filled orders are marked as completed Done status.", "x-api-rate-limit": 5, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"id\\\": \\\"671667306afcdb000723107f\\\",\\n \\\"symbol\\\": \\\"BTC-USDT\\\",\\n \\\"opType\\\": \\\"DEAL\\\",\\n \\\"type\\\": \\\"limit\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"price\\\": \\\"50000\\\",\\n \\\"size\\\": \\\"0.00001\\\",\\n \\\"funds\\\": \\\"0.5\\\",\\n \\\"dealSize\\\": \\\"0\\\",\\n \\\"dealFunds\\\": \\\"0\\\",\\n \\\"fee\\\": \\\"0\\\",\\n \\\"feeCurrency\\\": \\\"USDT\\\",\\n \\\"stp\\\": null,\\n \\\"stop\\\": null,\\n \\\"stopTriggered\\\": false,\\n \\\"stopPrice\\\": \\\"0\\\",\\n \\\"timeInForce\\\": \\\"GTC\\\",\\n \\\"postOnly\\\": false,\\n \\\"hidden\\\": false,\\n \\\"iceberg\\\": false,\\n \\\"visibleSize\\\": \\\"0\\\",\\n \\\"cancelAfter\\\": 0,\\n \\\"channel\\\": \\\"API\\\",\\n \\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\",\\n \\\"remark\\\": null,\\n \\\"tags\\\": null,\\n \\\"cancelExist\\\": false,\\n \\\"createdAt\\\": 1729521456248,\\n \\\"lastUpdatedAt\\\": 1729651011877,\\n \\\"tradeType\\\": \\\"MARGIN_TRADE\\\",\\n \\\"inOrderBook\\\": true,\\n \\\"cancelledSize\\\": \\\"0\\\",\\n \\\"cancelledFunds\\\": \\\"0\\\",\\n \\\"remainSize\\\": \\\"0.00001\\\",\\n \\\"remainFunds\\\": \\\"0.5\\\",\\n \\\"tax\\\": \\\"0\\\",\\n \\\"active\\\": true\\n }\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\"}" + "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\"}", + "operationId": "017" } }, "/api/v3/hf/margin/orders": { @@ -2040,7 +2052,8 @@ "x-sdk-method-description": "This interface can cancel all open Margin orders by symbol This endpoint only sends cancellation requests. The results of the requests must be obtained by checking the order status or subscribing to websocket.", "x-api-rate-limit": 10, "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":\\\"success\\\"}", - "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"tradeType\\\": \\\"MARGIN_TRADE\\\"}" + "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"tradeType\\\": \\\"MARGIN_TRADE\\\"}", + "operationId": "011" } }, "/api/v3/hf/margin/order/active/symbols": { @@ -2129,7 +2142,8 @@ "x-sdk-method-description": "This interface can query all Margin symbol that has active orders", "x-api-rate-limit": 2, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"symbolSize\\\": 1,\\n \\\"symbols\\\": [\\n \\\"BTC-USDT\\\"\\n ]\\n }\\n}", - "x-request-example": "{\\\"tradeType\\\": \\\"MARGIN_TRADE\\\"}" + "x-request-example": "{\\\"tradeType\\\": \\\"MARGIN_TRADE\\\"}", + "operationId": "012" } }, "/api/v3/hf/margin/orders/active": { @@ -2491,7 +2505,8 @@ "x-sdk-method-description": "This interface is to obtain all Margin active order lists, and the return value of the active order interface is the paged data of all uncompleted order lists. The returned data is sorted in descending order according to the latest update time of the order. After the user successfully places an order, the order is in Active state, and the user can use inOrderBook to determine whether the order has entered the order. Canceled or fully filled orders are marked as completed Done status.", "x-api-rate-limit": 4, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": [\\n {\\n \\\"id\\\": \\\"671667306afcdb000723107f\\\",\\n \\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\",\\n \\\"symbol\\\": \\\"BTC-USDT\\\",\\n \\\"opType\\\": \\\"DEAL\\\",\\n \\\"type\\\": \\\"limit\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"price\\\": \\\"50000\\\",\\n \\\"size\\\": \\\"0.00001\\\",\\n \\\"funds\\\": \\\"0.5\\\",\\n \\\"dealSize\\\": \\\"0\\\",\\n \\\"dealFunds\\\": \\\"0\\\",\\n \\\"remainSize\\\": \\\"0.00001\\\",\\n \\\"remainFunds\\\": \\\"0.5\\\",\\n \\\"cancelledSize\\\": \\\"0\\\",\\n \\\"cancelledFunds\\\": \\\"0\\\",\\n \\\"fee\\\": \\\"0\\\",\\n \\\"feeCurrency\\\": \\\"USDT\\\",\\n \\\"stp\\\": null,\\n \\\"stop\\\": null,\\n \\\"stopTriggered\\\": false,\\n \\\"stopPrice\\\": \\\"0\\\",\\n \\\"timeInForce\\\": \\\"GTC\\\",\\n \\\"postOnly\\\": false,\\n \\\"hidden\\\": false,\\n \\\"iceberg\\\": false,\\n \\\"visibleSize\\\": \\\"0\\\",\\n \\\"cancelAfter\\\": 0,\\n \\\"channel\\\": \\\"API\\\",\\n \\\"remark\\\": null,\\n \\\"tags\\\": null,\\n \\\"cancelExist\\\": false,\\n \\\"tradeType\\\": \\\"MARGIN_TRADE\\\",\\n \\\"inOrderBook\\\": true,\\n \\\"active\\\": true,\\n \\\"tax\\\": \\\"0\\\",\\n \\\"createdAt\\\": 1729521456248,\\n \\\"lastUpdatedAt\\\": 1729521460940\\n }\\n ]\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"tradeType\\\": \\\"MARGIN_TRADE\\\"}" + "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"tradeType\\\": \\\"MARGIN_TRADE\\\"}", + "operationId": "013" } }, "/api/v3/hf/margin/orders/done": { @@ -2943,7 +2958,8 @@ "x-sdk-method-description": "This interface is to obtain all Margin closed order lists, and the return value of the active order interface is the paged data of all uncompleted order lists. The returned data is sorted in descending order according to the latest update time of the order. After the user successfully places an order, the order is in Active state, and the user can use inOrderBook to determine whether the order has entered the order. Canceled or fully filled orders are marked as completed Done status.", "x-api-rate-limit": 10, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"lastId\\\": 136112949351,\\n \\\"items\\\": [\\n {\\n \\\"id\\\": \\\"6716491f6afcdb00078365c8\\\",\\n \\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\",\\n \\\"symbol\\\": \\\"BTC-USDT\\\",\\n \\\"opType\\\": \\\"DEAL\\\",\\n \\\"type\\\": \\\"limit\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"price\\\": \\\"50000\\\",\\n \\\"size\\\": \\\"0.00001\\\",\\n \\\"funds\\\": \\\"0.5\\\",\\n \\\"dealSize\\\": \\\"0\\\",\\n \\\"dealFunds\\\": \\\"0\\\",\\n \\\"remainSize\\\": \\\"0\\\",\\n \\\"remainFunds\\\": \\\"0\\\",\\n \\\"cancelledSize\\\": \\\"0.00001\\\",\\n \\\"cancelledFunds\\\": \\\"0.5\\\",\\n \\\"fee\\\": \\\"0\\\",\\n \\\"feeCurrency\\\": \\\"USDT\\\",\\n \\\"stp\\\": null,\\n \\\"stop\\\": null,\\n \\\"stopTriggered\\\": false,\\n \\\"stopPrice\\\": \\\"0\\\",\\n \\\"timeInForce\\\": \\\"GTC\\\",\\n \\\"postOnly\\\": false,\\n \\\"hidden\\\": false,\\n \\\"iceberg\\\": false,\\n \\\"visibleSize\\\": \\\"0\\\",\\n \\\"cancelAfter\\\": 0,\\n \\\"channel\\\": \\\"API\\\",\\n \\\"remark\\\": null,\\n \\\"tags\\\": null,\\n \\\"cancelExist\\\": true,\\n \\\"tradeType\\\": \\\"MARGIN_TRADE\\\",\\n \\\"inOrderBook\\\": false,\\n \\\"active\\\": false,\\n \\\"tax\\\": \\\"0\\\",\\n \\\"createdAt\\\": 1729513759162,\\n \\\"lastUpdatedAt\\\": 1729521126597\\n }\\n ]\\n }\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"tradeType\\\": \\\"MARGIN_TRADE\\\", \\\"side\\\": \\\"buy\\\", \\\"type\\\": \\\"limit\\\", \\\"lastId\\\": 254062248624417, \\\"limit\\\": 20, \\\"startAt\\\": 1728663338000, \\\"endAt\\\": 1728692138000}" + "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"tradeType\\\": \\\"MARGIN_TRADE\\\", \\\"side\\\": \\\"buy\\\", \\\"type\\\": \\\"limit\\\", \\\"lastId\\\": 254062248624417, \\\"limit\\\": 20, \\\"startAt\\\": 1728663338000, \\\"endAt\\\": 1728692138000}", + "operationId": "014" } }, "/api/v3/hf/margin/fills": { @@ -3305,7 +3321,8 @@ "x-sdk-method-description": "This endpoint can be used to obtain a list of the latest Margin transaction details. The returned data is sorted in descending order according to the latest update time of the order.", "x-api-rate-limit": 5, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"items\\\": [\\n {\\n \\\"id\\\": 137891621991,\\n \\\"symbol\\\": \\\"BTC-USDT\\\",\\n \\\"tradeId\\\": 11040911994273793,\\n \\\"orderId\\\": \\\"671868085584bc0007d85f46\\\",\\n \\\"counterOrderId\\\": \\\"67186805b7cbdf00071621f9\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"liquidity\\\": \\\"taker\\\",\\n \\\"forceTaker\\\": false,\\n \\\"price\\\": \\\"67141.6\\\",\\n \\\"size\\\": \\\"0.00001\\\",\\n \\\"funds\\\": \\\"0.671416\\\",\\n \\\"fee\\\": \\\"0.000671416\\\",\\n \\\"feeRate\\\": \\\"0.001\\\",\\n \\\"feeCurrency\\\": \\\"USDT\\\",\\n \\\"stop\\\": \\\"\\\",\\n \\\"tradeType\\\": \\\"MARGIN_TRADE\\\",\\n \\\"tax\\\": \\\"0\\\",\\n \\\"taxRate\\\": \\\"0\\\",\\n \\\"type\\\": \\\"limit\\\",\\n \\\"createdAt\\\": 1729652744998\\n }\\n ],\\n \\\"lastId\\\": 137891621991\\n }\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"tradeType\\\": \\\"MARGIN_TRADE\\\", \\\"orderId\\\": \\\"example_string_default_value\\\", \\\"side\\\": \\\"buy\\\", \\\"type\\\": \\\"limit\\\", \\\"lastId\\\": 254062248624417, \\\"limit\\\": 100, \\\"startAt\\\": 1728663338000, \\\"endAt\\\": 1728692138000}" + "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"tradeType\\\": \\\"MARGIN_TRADE\\\", \\\"orderId\\\": \\\"example_string_default_value\\\", \\\"side\\\": \\\"buy\\\", \\\"type\\\": \\\"limit\\\", \\\"lastId\\\": 254062248624417, \\\"limit\\\": 100, \\\"startAt\\\": 1728663338000, \\\"endAt\\\": 1728692138000}", + "operationId": "015" } }, "/api/v3/margin/borrow": { @@ -3434,7 +3451,8 @@ } }, "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"orderNo\\\":\\\"67187162c0d6990007717b15\\\",\\\"actualSize\\\":\\\"10\\\"}}", - "x-request-example": "{\\\"currency\\\": \\\"USDT\\\", \\\"size\\\": 10, \\\"timeInForce\\\": \\\"FOK\\\", \\\"isIsolated\\\": false, \\\"isHf\\\": false}" + "x-request-example": "{\\\"currency\\\": \\\"USDT\\\", \\\"size\\\": 10, \\\"timeInForce\\\": \\\"FOK\\\", \\\"isIsolated\\\": false, \\\"isHf\\\": false}", + "operationId": "018" }, "get": { "summary": "Get Borrow History", @@ -3671,7 +3689,8 @@ "x-sdk-method-description": "This API endpoint is used to get the borrowing orders for cross and isolated margin accounts", "x-api-rate-limit": 15, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"timestamp\\\": 1729657580449,\\n \\\"currentPage\\\": 1,\\n \\\"pageSize\\\": 50,\\n \\\"totalNum\\\": 2,\\n \\\"totalPage\\\": 1,\\n \\\"items\\\": [\\n {\\n \\\"orderNo\\\": \\\"67187162c0d6990007717b15\\\",\\n \\\"symbol\\\": null,\\n \\\"currency\\\": \\\"USDT\\\",\\n \\\"size\\\": \\\"10\\\",\\n \\\"actualSize\\\": \\\"10\\\",\\n \\\"status\\\": \\\"SUCCESS\\\",\\n \\\"createdTime\\\": 1729655138000\\n },\\n {\\n \\\"orderNo\\\": \\\"67187155b088e70007149585\\\",\\n \\\"symbol\\\": null,\\n \\\"currency\\\": \\\"USDT\\\",\\n \\\"size\\\": \\\"0.1\\\",\\n \\\"actualSize\\\": \\\"0\\\",\\n \\\"status\\\": \\\"FAILED\\\",\\n \\\"createdTime\\\": 1729655125000\\n }\\n ]\\n }\\n}", - "x-request-example": "{\\\"currency\\\": \\\"BTC\\\", \\\"isIsolated\\\": true, \\\"symbol\\\": \\\"BTC-USDT\\\", \\\"orderNo\\\": \\\"example_string_default_value\\\", \\\"startTime\\\": 123456, \\\"endTime\\\": 123456, \\\"currentPage\\\": 1, \\\"pageSize\\\": 50}" + "x-request-example": "{\\\"currency\\\": \\\"BTC\\\", \\\"isIsolated\\\": true, \\\"symbol\\\": \\\"BTC-USDT\\\", \\\"orderNo\\\": \\\"example_string_default_value\\\", \\\"startTime\\\": 123456, \\\"endTime\\\": 123456, \\\"currentPage\\\": 1, \\\"pageSize\\\": 50}", + "operationId": "019" } }, "/api/v3/margin/repay": { @@ -3784,7 +3803,8 @@ } }, "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"timestamp\\\":1729655606816,\\\"orderNo\\\":\\\"671873361d5bd400075096ad\\\",\\\"actualSize\\\":\\\"10\\\"}}", - "x-request-example": "{\\\"currency\\\": \\\"USDT\\\", \\\"size\\\": 10}" + "x-request-example": "{\\\"currency\\\": \\\"USDT\\\", \\\"size\\\": 10}", + "operationId": "020" }, "get": { "summary": "Get Repay History", @@ -4021,7 +4041,8 @@ "x-sdk-method-description": "This API endpoint is used to get the borrowing orders for cross and isolated margin accounts", "x-api-rate-limit": 15, "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"timestamp\\\":1729663471891,\\\"currentPage\\\":1,\\\"pageSize\\\":50,\\\"totalNum\\\":1,\\\"totalPage\\\":1,\\\"items\\\":[{\\\"orderNo\\\":\\\"671873361d5bd400075096ad\\\",\\\"symbol\\\":null,\\\"currency\\\":\\\"USDT\\\",\\\"size\\\":\\\"10\\\",\\\"principal\\\":\\\"9.99986518\\\",\\\"interest\\\":\\\"0.00013482\\\",\\\"status\\\":\\\"SUCCESS\\\",\\\"createdTime\\\":1729655606000}]}}", - "x-request-example": "{\\\"currency\\\": \\\"BTC\\\", \\\"isIsolated\\\": true, \\\"symbol\\\": \\\"BTC-USDT\\\", \\\"orderNo\\\": \\\"example_string_default_value\\\", \\\"startTime\\\": 123456, \\\"endTime\\\": 123456, \\\"currentPage\\\": 1, \\\"pageSize\\\": 50}" + "x-request-example": "{\\\"currency\\\": \\\"BTC\\\", \\\"isIsolated\\\": true, \\\"symbol\\\": \\\"BTC-USDT\\\", \\\"orderNo\\\": \\\"example_string_default_value\\\", \\\"startTime\\\": 123456, \\\"endTime\\\": 123456, \\\"currentPage\\\": 1, \\\"pageSize\\\": 50}", + "operationId": "021" } }, "/api/v3/margin/interest": { @@ -4209,7 +4230,8 @@ "x-sdk-method-description": "Request via this endpoint to get the interest records of the cross/isolated margin lending.", "x-api-rate-limit": 20, "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"timestamp\\\":1729665170701,\\\"currentPage\\\":1,\\\"pageSize\\\":50,\\\"totalNum\\\":3,\\\"totalPage\\\":1,\\\"items\\\":[{\\\"currency\\\":\\\"USDT\\\",\\\"dayRatio\\\":\\\"0.000296\\\",\\\"interestAmount\\\":\\\"0.00000001\\\",\\\"createdTime\\\":1729663213375},{\\\"currency\\\":\\\"USDT\\\",\\\"dayRatio\\\":\\\"0.000296\\\",\\\"interestAmount\\\":\\\"0.00000001\\\",\\\"createdTime\\\":1729659618802},{\\\"currency\\\":\\\"USDT\\\",\\\"dayRatio\\\":\\\"0.000296\\\",\\\"interestAmount\\\":\\\"0.00000001\\\",\\\"createdTime\\\":1729656028077}]}}", - "x-request-example": "{\\\"currency\\\": \\\"BTC\\\", \\\"isIsolated\\\": true, \\\"symbol\\\": \\\"BTC-USDT\\\", \\\"startTime\\\": 123456, \\\"endTime\\\": 123456, \\\"currentPage\\\": 1, \\\"pageSize\\\": 50}" + "x-request-example": "{\\\"currency\\\": \\\"BTC\\\", \\\"isIsolated\\\": true, \\\"symbol\\\": \\\"BTC-USDT\\\", \\\"startTime\\\": 123456, \\\"endTime\\\": 123456, \\\"currentPage\\\": 1, \\\"pageSize\\\": 50}", + "operationId": "022" } }, "/api/v3/position/update-user-leverage": { @@ -4288,7 +4310,8 @@ } }, "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":null}", - "x-request-example": "{\\\"leverage\\\": \\\"5\\\"}" + "x-request-example": "{\\\"leverage\\\": \\\"5\\\"}", + "operationId": "023" } }, "/api/v3/project/list": { @@ -4399,7 +4422,8 @@ "x-sdk-method-description": "This API endpoint is used to get the information about the currencies available for lending.", "x-api-rate-limit": 10, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": [\\n {\\n \\\"currency\\\": \\\"BTC\\\",\\n \\\"purchaseEnable\\\": true,\\n \\\"redeemEnable\\\": true,\\n \\\"increment\\\": \\\"0.00000001\\\",\\n \\\"minPurchaseSize\\\": \\\"0.001\\\",\\n \\\"maxPurchaseSize\\\": \\\"40\\\",\\n \\\"interestIncrement\\\": \\\"0.0001\\\",\\n \\\"minInterestRate\\\": \\\"0.005\\\",\\n \\\"marketInterestRate\\\": \\\"0.005\\\",\\n \\\"maxInterestRate\\\": \\\"0.32\\\",\\n \\\"autoPurchaseEnable\\\": false\\n }\\n ]\\n}", - "x-request-example": "{\\\"currency\\\": \\\"BTC\\\"}" + "x-request-example": "{\\\"currency\\\": \\\"BTC\\\"}", + "operationId": "024" } }, "/api/v3/project/marketInterestRate": { @@ -4477,7 +4501,8 @@ "x-sdk-method-description": "This API endpoint is used to get the interest rates of the margin lending market over the past 7 days.", "x-api-rate-limit": 5, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": [\\n {\\n \\\"time\\\": \\\"202410170000\\\",\\n \\\"marketInterestRate\\\": \\\"0.005\\\"\\n },\\n {\\n \\\"time\\\": \\\"202410170100\\\",\\n \\\"marketInterestRate\\\": \\\"0.005\\\"\\n }\\n ]\\n}", - "x-request-example": "{\\\"currency\\\": \\\"BTC\\\"}" + "x-request-example": "{\\\"currency\\\": \\\"BTC\\\"}", + "operationId": "025" } }, "/api/v3/purchase": { @@ -4566,7 +4591,8 @@ } }, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"orderNo\\\": \\\"671bafa804c26d000773c533\\\"\\n }\\n}", - "x-request-example": "{\\\"currency\\\": \\\"BTC\\\", \\\"size\\\": \\\"0.001\\\", \\\"interestRate\\\": \\\"0.1\\\"}" + "x-request-example": "{\\\"currency\\\": \\\"BTC\\\", \\\"size\\\": \\\"0.001\\\", \\\"interestRate\\\": \\\"0.1\\\"}", + "operationId": "026" } }, "/api/v3/lend/purchase/update": { @@ -4646,7 +4672,8 @@ } }, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": null\\n}", - "x-request-example": "{\\\"currency\\\": \\\"BTC\\\", \\\"purchaseOrderNo\\\": \\\"671bafa804c26d000773c533\\\", \\\"interestRate\\\": \\\"0.09\\\"}" + "x-request-example": "{\\\"currency\\\": \\\"BTC\\\", \\\"purchaseOrderNo\\\": \\\"671bafa804c26d000773c533\\\", \\\"interestRate\\\": \\\"0.09\\\"}", + "operationId": "027" } }, "/api/v3/purchase/orders": { @@ -4860,7 +4887,8 @@ "x-sdk-method-description": "This API endpoint provides pagination query for the purchase orders.", "x-api-rate-limit": 10, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"currentPage\\\": 1,\\n \\\"pageSize\\\": 10,\\n \\\"totalNum\\\": 1,\\n \\\"totalPage\\\": 1,\\n \\\"items\\\": [\\n {\\n \\\"currency\\\": \\\"BTC\\\",\\n \\\"purchaseOrderNo\\\": \\\"671bb15a3b3f930007880bae\\\",\\n \\\"purchaseSize\\\": \\\"0.001\\\",\\n \\\"matchSize\\\": \\\"0\\\",\\n \\\"interestRate\\\": \\\"0.1\\\",\\n \\\"incomeSize\\\": \\\"0\\\",\\n \\\"applyTime\\\": 1729868122172,\\n \\\"status\\\": \\\"PENDING\\\"\\n }\\n ]\\n }\\n}", - "x-request-example": "{\\\"currency\\\": \\\"BTC\\\", \\\"status\\\": \\\"DONE\\\", \\\"purchaseOrderNo\\\": \\\"example_string_default_value\\\", \\\"currentPage\\\": 1, \\\"pageSize\\\": 50}" + "x-request-example": "{\\\"currency\\\": \\\"BTC\\\", \\\"status\\\": \\\"DONE\\\", \\\"purchaseOrderNo\\\": \\\"example_string_default_value\\\", \\\"currentPage\\\": 1, \\\"pageSize\\\": 50}", + "operationId": "028" } }, "/api/v3/redeem": { @@ -4949,7 +4977,8 @@ } }, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"orderNo\\\": \\\"671bafa804c26d000773c533\\\"\\n }\\n}", - "x-request-example": "{\\\"currency\\\": \\\"BTC\\\", \\\"size\\\": \\\"0.001\\\", \\\"purchaseOrderNo\\\": \\\"671bafa804c26d000773c533\\\"}" + "x-request-example": "{\\\"currency\\\": \\\"BTC\\\", \\\"size\\\": \\\"0.001\\\", \\\"purchaseOrderNo\\\": \\\"671bafa804c26d000773c533\\\"}", + "operationId": "029" } }, "/api/v3/redeem/orders": { @@ -5141,7 +5170,8 @@ "x-sdk-method-description": "This API endpoint provides pagination query for the redeem orders.", "x-api-rate-limit": 10, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"currentPage\\\": 1,\\n \\\"pageSize\\\": 10,\\n \\\"totalNum\\\": 1,\\n \\\"totalPage\\\": 1,\\n \\\"items\\\": [\\n {\\n \\\"currency\\\": \\\"BTC\\\",\\n \\\"purchaseOrderNo\\\": \\\"671bafa804c26d000773c533\\\",\\n \\\"redeemOrderNo\\\": \\\"671bb01004c26d000773c55c\\\",\\n \\\"redeemSize\\\": \\\"0.001\\\",\\n \\\"receiptSize\\\": \\\"0.001\\\",\\n \\\"applyTime\\\": null,\\n \\\"status\\\": \\\"DONE\\\"\\n }\\n ]\\n }\\n}", - "x-request-example": "{\\\"currency\\\": \\\"BTC\\\", \\\"status\\\": \\\"DONE\\\", \\\"redeemOrderNo\\\": \\\"example_string_default_value\\\", \\\"currentPage\\\": 1, \\\"pageSize\\\": 50}" + "x-request-example": "{\\\"currency\\\": \\\"BTC\\\", \\\"status\\\": \\\"DONE\\\", \\\"redeemOrderNo\\\": \\\"example_string_default_value\\\", \\\"currentPage\\\": 1, \\\"pageSize\\\": 50}", + "operationId": "030" } }, "/api/v3/margin/currencies": { @@ -5346,7 +5376,8 @@ "x-sdk-method-description": "Request via this endpoint to get the Configure and Risk limit info of the margin.", "x-api-rate-limit": 20, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": [\\n {\\n \\\"timestamp\\\": 1729678659275,\\n \\\"currency\\\": \\\"BTC\\\",\\n \\\"borrowMaxAmount\\\": \\\"75.15\\\",\\n \\\"buyMaxAmount\\\": \\\"217.12\\\",\\n \\\"holdMaxAmount\\\": \\\"217.12\\\",\\n \\\"borrowCoefficient\\\": \\\"1\\\",\\n \\\"marginCoefficient\\\": \\\"1\\\",\\n \\\"precision\\\": 8,\\n \\\"borrowMinAmount\\\": \\\"0.001\\\",\\n \\\"borrowMinUnit\\\": \\\"0.0001\\\",\\n \\\"borrowEnabled\\\": true\\n }\\n ]\\n}\\n", - "x-request-example": "{\\\"isIsolated\\\": true, \\\"currency\\\": \\\"BTC\\\", \\\"symbol\\\": \\\"BTC-USDT\\\"}" + "x-request-example": "{\\\"isIsolated\\\": true, \\\"currency\\\": \\\"BTC\\\", \\\"symbol\\\": \\\"BTC-USDT\\\"}", + "operationId": "031" } }, "/api/v1/margin/order": { @@ -5625,7 +5656,8 @@ } }, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"orderId\\\": \\\"671bb90194422f00073ff4f0\\\",\\n \\\"loanApplyId\\\": null,\\n \\\"borrowSize\\\": null,\\n \\\"clientOid\\\": null\\n }\\n}", - "x-request-example": "{\\\"type\\\": \\\"limit\\\", \\\"symbol\\\": \\\"BTC-USDT\\\", \\\"side\\\": \\\"buy\\\", \\\"price\\\": \\\"50000\\\", \\\"size\\\": \\\"0.00001\\\", \\\"clientOid\\\": \\\"5c52e11203aa677f33e4193fb\\\", \\\"remark\\\": \\\"order remarks\\\"}" + "x-request-example": "{\\\"type\\\": \\\"limit\\\", \\\"symbol\\\": \\\"BTC-USDT\\\", \\\"side\\\": \\\"buy\\\", \\\"price\\\": \\\"50000\\\", \\\"size\\\": \\\"0.00001\\\", \\\"clientOid\\\": \\\"5c52e11203aa677f33e4193fb\\\", \\\"remark\\\": \\\"order remarks\\\"}", + "operationId": "032" } }, "/api/v1/margin/order/test": { @@ -5904,7 +5936,8 @@ } }, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"orderId\\\": \\\"671bb90194422f00073ff4f0\\\",\\n \\\"loanApplyId\\\": null,\\n \\\"borrowSize\\\": null,\\n \\\"clientOid\\\": null\\n }\\n}", - "x-request-example": "{\\\"type\\\": \\\"limit\\\", \\\"symbol\\\": \\\"BTC-USDT\\\", \\\"side\\\": \\\"buy\\\", \\\"price\\\": \\\"50000\\\", \\\"size\\\": \\\"0.00001\\\", \\\"clientOid\\\": \\\"5c52e11203aa677f33e4193fb\\\", \\\"remark\\\": \\\"order remarks\\\"}" + "x-request-example": "{\\\"type\\\": \\\"limit\\\", \\\"symbol\\\": \\\"BTC-USDT\\\", \\\"side\\\": \\\"buy\\\", \\\"price\\\": \\\"50000\\\", \\\"size\\\": \\\"0.00001\\\", \\\"clientOid\\\": \\\"5c52e11203aa677f33e4193fb\\\", \\\"remark\\\": \\\"order remarks\\\"}", + "operationId": "033" } } }, diff --git a/spec/rest/entry/openapi-spot.json b/spec/rest/entry/openapi-spot.json index 21c72ce2..8ed51c00 100644 --- a/spec/rest/entry/openapi-spot.json +++ b/spec/rest/entry/openapi-spot.json @@ -379,7 +379,8 @@ "x-sdk-method-description": "This interface can obtain the latest news announcements, and the default page search is for announcements within a month.", "x-api-rate-limit": 20, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"totalNum\\\": 195,\\n \\\"totalPage\\\": 13,\\n \\\"currentPage\\\": 1,\\n \\\"pageSize\\\": 15,\\n \\\"items\\\": [\\n {\\n \\\"annId\\\": 129045,\\n \\\"annTitle\\\": \\\"KuCoin Isolated Margin Adds the Scroll (SCR) Trading Pair\\\",\\n \\\"annType\\\": [\\n \\\"latest-announcements\\\"\\n ],\\n \\\"annDesc\\\": \\\"To enrich the variety of assets available,\\xa0KuCoin\\u2019s Isolated Margin Trading platform has added the Scroll (SCR)\\xa0asset and trading pair.\\\",\\n \\\"cTime\\\": 1729594043000,\\n \\\"language\\\": \\\"en_US\\\",\\n \\\"annUrl\\\": \\\"https://www.kucoin.com/announcement/kucoin-isolated-margin-adds-scr?lang=en_US\\\"\\n },\\n {\\n \\\"annId\\\": 129001,\\n \\\"annTitle\\\": \\\"DAPP-30D Fixed Promotion, Enjoy an APR of 200%!\\u200b\\\",\\n \\\"annType\\\": [\\n \\\"latest-announcements\\\",\\n \\\"activities\\\"\\n ],\\n \\\"annDesc\\\": \\\"KuCoin Earn will be launching the DAPP Fixed Promotion at 10:00:00 on October 22, 2024 (UTC). The available product is \\u201cDAPP-30D'' with an APR of 200%.\\\",\\n \\\"cTime\\\": 1729588460000,\\n \\\"language\\\": \\\"en_US\\\",\\n \\\"annUrl\\\": \\\"https://www.kucoin.com/announcement/dapp-30d-fixed-promotion-enjoy?lang=en_US\\\"\\n },\\n {\\n \\\"annId\\\": 128581,\\n \\\"annTitle\\\": \\\"NAYM (NAYM) Gets Listed on KuCoin! World Premiere!\\\",\\n \\\"annType\\\": [\\n \\\"latest-announcements\\\",\\n \\\"new-listings\\\"\\n ],\\n \\\"annDesc\\\": \\\"Trading:\\xa011:00 on October 22, 2024 (UTC)\\\",\\n \\\"cTime\\\": 1729497729000,\\n \\\"language\\\": \\\"en_US\\\",\\n \\\"annUrl\\\": \\\"https://www.kucoin.com/announcement/en-naym-naym-gets-listed-on-kucoin-world-premiere?lang=en_US\\\"\\n }\\n ]\\n }\\n}", - "x-request-example": "{\\\"currentPage\\\": 1, \\\"pageSize\\\": 50, \\\"annType\\\": \\\"latest-announcements\\\", \\\"lang\\\": \\\"en_US\\\", \\\"startTime\\\": 1729594043000, \\\"endTime\\\": 1729697729000}" + "x-request-example": "{\\\"currentPage\\\": 1, \\\"pageSize\\\": 50, \\\"annType\\\": \\\"latest-announcements\\\", \\\"lang\\\": \\\"en_US\\\", \\\"startTime\\\": 1729594043000, \\\"endTime\\\": 1729697729000}", + "operationId": "001" } }, "/api/v3/currencies/{currency}": { @@ -586,7 +587,8 @@ "x-sdk-method-description": "Request via this endpoint to get the currency details of a specified currency", "x-api-rate-limit": 3, "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"currency\\\":\\\"BTC\\\",\\\"name\\\":\\\"BTC\\\",\\\"fullName\\\":\\\"Bitcoin\\\",\\\"precision\\\":8,\\\"confirms\\\":null,\\\"contractAddress\\\":null,\\\"isMarginEnabled\\\":true,\\\"isDebitEnabled\\\":true,\\\"chains\\\":[{\\\"chainName\\\":\\\"BTC\\\",\\\"withdrawalMinSize\\\":\\\"0.001\\\",\\\"depositMinSize\\\":\\\"0.0002\\\",\\\"withdrawFeeRate\\\":\\\"0\\\",\\\"withdrawalMinFee\\\":\\\"0.0005\\\",\\\"isWithdrawEnabled\\\":true,\\\"isDepositEnabled\\\":true,\\\"confirms\\\":3,\\\"preConfirms\\\":1,\\\"contractAddress\\\":\\\"\\\",\\\"withdrawPrecision\\\":8,\\\"maxWithdraw\\\":null,\\\"maxDeposit\\\":null,\\\"needTag\\\":false,\\\"chainId\\\":\\\"btc\\\"},{\\\"chainName\\\":\\\"Lightning Network\\\",\\\"withdrawalMinSize\\\":\\\"0.00001\\\",\\\"depositMinSize\\\":\\\"0.00001\\\",\\\"withdrawFeeRate\\\":\\\"0\\\",\\\"withdrawalMinFee\\\":\\\"0.000015\\\",\\\"isWithdrawEnabled\\\":true,\\\"isDepositEnabled\\\":true,\\\"confirms\\\":1,\\\"preConfirms\\\":1,\\\"contractAddress\\\":\\\"\\\",\\\"withdrawPrecision\\\":8,\\\"maxWithdraw\\\":null,\\\"maxDeposit\\\":\\\"0.03\\\",\\\"needTag\\\":false,\\\"chainId\\\":\\\"btcln\\\"},{\\\"chainName\\\":\\\"KCC\\\",\\\"withdrawalMinSize\\\":\\\"0.0008\\\",\\\"depositMinSize\\\":null,\\\"withdrawFeeRate\\\":\\\"0\\\",\\\"withdrawalMinFee\\\":\\\"0.00002\\\",\\\"isWithdrawEnabled\\\":true,\\\"isDepositEnabled\\\":true,\\\"confirms\\\":20,\\\"preConfirms\\\":20,\\\"contractAddress\\\":\\\"0xfa93c12cd345c658bc4644d1d4e1b9615952258c\\\",\\\"withdrawPrecision\\\":8,\\\"maxWithdraw\\\":null,\\\"maxDeposit\\\":null,\\\"needTag\\\":false,\\\"chainId\\\":\\\"kcc\\\"},{\\\"chainName\\\":\\\"BTC-Segwit\\\",\\\"withdrawalMinSize\\\":\\\"0.0008\\\",\\\"depositMinSize\\\":\\\"0.0002\\\",\\\"withdrawFeeRate\\\":\\\"0\\\",\\\"withdrawalMinFee\\\":\\\"0.0005\\\",\\\"isWithdrawEnabled\\\":false,\\\"isDepositEnabled\\\":true,\\\"confirms\\\":2,\\\"preConfirms\\\":2,\\\"contractAddress\\\":\\\"\\\",\\\"withdrawPrecision\\\":8,\\\"maxWithdraw\\\":null,\\\"maxDeposit\\\":null,\\\"needTag\\\":false,\\\"chainId\\\":\\\"bech32\\\"}]}}", - "x-request-example": "{\\\"currency\\\": \\\"BTC\\\", \\\"chain\\\": \\\"eth\\\"}" + "x-request-example": "{\\\"currency\\\": \\\"BTC\\\", \\\"chain\\\": \\\"eth\\\"}", + "operationId": "002" } }, "/api/v3/currencies": { @@ -776,7 +778,8 @@ "x-sdk-method-name": "getAllCurrencies", "x-sdk-method-description": "Request via this endpoint to get the currency list.Not all currencies currently can be used for trading.", "x-api-rate-limit": 3, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": [\\n {\\n \\\"currency\\\": \\\"BTC\\\",\\n \\\"name\\\": \\\"BTC\\\",\\n \\\"fullName\\\": \\\"Bitcoin\\\",\\n \\\"precision\\\": 8,\\n \\\"confirms\\\": null,\\n \\\"contractAddress\\\": null,\\n \\\"isMarginEnabled\\\": true,\\n \\\"isDebitEnabled\\\": true,\\n \\\"chains\\\": [\\n {\\n \\\"chainName\\\": \\\"BTC\\\",\\n \\\"withdrawalMinSize\\\": \\\"0.001\\\",\\n \\\"depositMinSize\\\": \\\"0.0002\\\",\\n \\\"withdrawFeeRate\\\": \\\"0\\\",\\n \\\"withdrawalMinFee\\\": \\\"0.0005\\\",\\n \\\"isWithdrawEnabled\\\": true,\\n \\\"isDepositEnabled\\\": true,\\n \\\"confirms\\\": 3,\\n \\\"preConfirms\\\": 1,\\n \\\"contractAddress\\\": \\\"\\\",\\n \\\"withdrawPrecision\\\": 8,\\n \\\"maxWithdraw\\\": null,\\n \\\"maxDeposit\\\": null,\\n \\\"needTag\\\": false,\\n \\\"chainId\\\": \\\"btc\\\"\\n },\\n {\\n \\\"chainName\\\": \\\"Lightning Network\\\",\\n \\\"withdrawalMinSize\\\": \\\"0.00001\\\",\\n \\\"depositMinSize\\\": \\\"0.00001\\\",\\n \\\"withdrawFeeRate\\\": \\\"0\\\",\\n \\\"withdrawalMinFee\\\": \\\"0.000015\\\",\\n \\\"isWithdrawEnabled\\\": true,\\n \\\"isDepositEnabled\\\": true,\\n \\\"confirms\\\": 1,\\n \\\"preConfirms\\\": 1,\\n \\\"contractAddress\\\": \\\"\\\",\\n \\\"withdrawPrecision\\\": 8,\\n \\\"maxWithdraw\\\": null,\\n \\\"maxDeposit\\\": \\\"0.03\\\",\\n \\\"needTag\\\": false,\\n \\\"chainId\\\": \\\"btcln\\\"\\n },\\n {\\n \\\"chainName\\\": \\\"KCC\\\",\\n \\\"withdrawalMinSize\\\": \\\"0.0008\\\",\\n \\\"depositMinSize\\\": null,\\n \\\"withdrawFeeRate\\\": \\\"0\\\",\\n \\\"withdrawalMinFee\\\": \\\"0.00002\\\",\\n \\\"isWithdrawEnabled\\\": true,\\n \\\"isDepositEnabled\\\": true,\\n \\\"confirms\\\": 20,\\n \\\"preConfirms\\\": 20,\\n \\\"contractAddress\\\": \\\"0xfa93c12cd345c658bc4644d1d4e1b9615952258c\\\",\\n \\\"withdrawPrecision\\\": 8,\\n \\\"maxWithdraw\\\": null,\\n \\\"maxDeposit\\\": null,\\n \\\"needTag\\\": false,\\n \\\"chainId\\\": \\\"kcc\\\"\\n },\\n {\\n \\\"chainName\\\": \\\"BTC-Segwit\\\",\\n \\\"withdrawalMinSize\\\": \\\"0.0008\\\",\\n \\\"depositMinSize\\\": \\\"0.0002\\\",\\n \\\"withdrawFeeRate\\\": \\\"0\\\",\\n \\\"withdrawalMinFee\\\": \\\"0.0005\\\",\\n \\\"isWithdrawEnabled\\\": false,\\n \\\"isDepositEnabled\\\": true,\\n \\\"confirms\\\": 2,\\n \\\"preConfirms\\\": 2,\\n \\\"contractAddress\\\": \\\"\\\",\\n \\\"withdrawPrecision\\\": 8,\\n \\\"maxWithdraw\\\": null,\\n \\\"maxDeposit\\\": null,\\n \\\"needTag\\\": false,\\n \\\"chainId\\\": \\\"bech32\\\"\\n }\\n ]\\n },\\n {\\n \\\"currency\\\": \\\"BTCP\\\",\\n \\\"name\\\": \\\"BTCP\\\",\\n \\\"fullName\\\": \\\"Bitcoin Private\\\",\\n \\\"precision\\\": 8,\\n \\\"confirms\\\": null,\\n \\\"contractAddress\\\": null,\\n \\\"isMarginEnabled\\\": false,\\n \\\"isDebitEnabled\\\": false,\\n \\\"chains\\\": [\\n {\\n \\\"chainName\\\": \\\"BTCP\\\",\\n \\\"withdrawalMinSize\\\": \\\"0.100000\\\",\\n \\\"depositMinSize\\\": null,\\n \\\"withdrawFeeRate\\\": \\\"0\\\",\\n \\\"withdrawalMinFee\\\": \\\"0.010000\\\",\\n \\\"isWithdrawEnabled\\\": false,\\n \\\"isDepositEnabled\\\": false,\\n \\\"confirms\\\": 6,\\n \\\"preConfirms\\\": 6,\\n \\\"contractAddress\\\": \\\"\\\",\\n \\\"withdrawPrecision\\\": 8,\\n \\\"maxWithdraw\\\": null,\\n \\\"maxDeposit\\\": null,\\n \\\"needTag\\\": false,\\n \\\"chainId\\\": \\\"btcp\\\"\\n }\\n ]\\n }\\n ]\\n}" + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": [\\n {\\n \\\"currency\\\": \\\"BTC\\\",\\n \\\"name\\\": \\\"BTC\\\",\\n \\\"fullName\\\": \\\"Bitcoin\\\",\\n \\\"precision\\\": 8,\\n \\\"confirms\\\": null,\\n \\\"contractAddress\\\": null,\\n \\\"isMarginEnabled\\\": true,\\n \\\"isDebitEnabled\\\": true,\\n \\\"chains\\\": [\\n {\\n \\\"chainName\\\": \\\"BTC\\\",\\n \\\"withdrawalMinSize\\\": \\\"0.001\\\",\\n \\\"depositMinSize\\\": \\\"0.0002\\\",\\n \\\"withdrawFeeRate\\\": \\\"0\\\",\\n \\\"withdrawalMinFee\\\": \\\"0.0005\\\",\\n \\\"isWithdrawEnabled\\\": true,\\n \\\"isDepositEnabled\\\": true,\\n \\\"confirms\\\": 3,\\n \\\"preConfirms\\\": 1,\\n \\\"contractAddress\\\": \\\"\\\",\\n \\\"withdrawPrecision\\\": 8,\\n \\\"maxWithdraw\\\": null,\\n \\\"maxDeposit\\\": null,\\n \\\"needTag\\\": false,\\n \\\"chainId\\\": \\\"btc\\\"\\n },\\n {\\n \\\"chainName\\\": \\\"Lightning Network\\\",\\n \\\"withdrawalMinSize\\\": \\\"0.00001\\\",\\n \\\"depositMinSize\\\": \\\"0.00001\\\",\\n \\\"withdrawFeeRate\\\": \\\"0\\\",\\n \\\"withdrawalMinFee\\\": \\\"0.000015\\\",\\n \\\"isWithdrawEnabled\\\": true,\\n \\\"isDepositEnabled\\\": true,\\n \\\"confirms\\\": 1,\\n \\\"preConfirms\\\": 1,\\n \\\"contractAddress\\\": \\\"\\\",\\n \\\"withdrawPrecision\\\": 8,\\n \\\"maxWithdraw\\\": null,\\n \\\"maxDeposit\\\": \\\"0.03\\\",\\n \\\"needTag\\\": false,\\n \\\"chainId\\\": \\\"btcln\\\"\\n },\\n {\\n \\\"chainName\\\": \\\"KCC\\\",\\n \\\"withdrawalMinSize\\\": \\\"0.0008\\\",\\n \\\"depositMinSize\\\": null,\\n \\\"withdrawFeeRate\\\": \\\"0\\\",\\n \\\"withdrawalMinFee\\\": \\\"0.00002\\\",\\n \\\"isWithdrawEnabled\\\": true,\\n \\\"isDepositEnabled\\\": true,\\n \\\"confirms\\\": 20,\\n \\\"preConfirms\\\": 20,\\n \\\"contractAddress\\\": \\\"0xfa93c12cd345c658bc4644d1d4e1b9615952258c\\\",\\n \\\"withdrawPrecision\\\": 8,\\n \\\"maxWithdraw\\\": null,\\n \\\"maxDeposit\\\": null,\\n \\\"needTag\\\": false,\\n \\\"chainId\\\": \\\"kcc\\\"\\n },\\n {\\n \\\"chainName\\\": \\\"BTC-Segwit\\\",\\n \\\"withdrawalMinSize\\\": \\\"0.0008\\\",\\n \\\"depositMinSize\\\": \\\"0.0002\\\",\\n \\\"withdrawFeeRate\\\": \\\"0\\\",\\n \\\"withdrawalMinFee\\\": \\\"0.0005\\\",\\n \\\"isWithdrawEnabled\\\": false,\\n \\\"isDepositEnabled\\\": true,\\n \\\"confirms\\\": 2,\\n \\\"preConfirms\\\": 2,\\n \\\"contractAddress\\\": \\\"\\\",\\n \\\"withdrawPrecision\\\": 8,\\n \\\"maxWithdraw\\\": null,\\n \\\"maxDeposit\\\": null,\\n \\\"needTag\\\": false,\\n \\\"chainId\\\": \\\"bech32\\\"\\n }\\n ]\\n },\\n {\\n \\\"currency\\\": \\\"BTCP\\\",\\n \\\"name\\\": \\\"BTCP\\\",\\n \\\"fullName\\\": \\\"Bitcoin Private\\\",\\n \\\"precision\\\": 8,\\n \\\"confirms\\\": null,\\n \\\"contractAddress\\\": null,\\n \\\"isMarginEnabled\\\": false,\\n \\\"isDebitEnabled\\\": false,\\n \\\"chains\\\": [\\n {\\n \\\"chainName\\\": \\\"BTCP\\\",\\n \\\"withdrawalMinSize\\\": \\\"0.100000\\\",\\n \\\"depositMinSize\\\": null,\\n \\\"withdrawFeeRate\\\": \\\"0\\\",\\n \\\"withdrawalMinFee\\\": \\\"0.010000\\\",\\n \\\"isWithdrawEnabled\\\": false,\\n \\\"isDepositEnabled\\\": false,\\n \\\"confirms\\\": 6,\\n \\\"preConfirms\\\": 6,\\n \\\"contractAddress\\\": \\\"\\\",\\n \\\"withdrawPrecision\\\": 8,\\n \\\"maxWithdraw\\\": null,\\n \\\"maxDeposit\\\": null,\\n \\\"needTag\\\": false,\\n \\\"chainId\\\": \\\"btcp\\\"\\n }\\n ]\\n }\\n ]\\n}", + "operationId": "003" } }, "/api/v2/symbols/{symbol}": { @@ -975,7 +978,8 @@ "x-sdk-method-description": "Request via this endpoint to get detail currency pairs for trading. If you want to get the market information of the trading symbol, please use Get All Tickers.", "x-api-rate-limit": 4, "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"symbol\\\":\\\"BTC-USDT\\\",\\\"name\\\":\\\"BTC-USDT\\\",\\\"baseCurrency\\\":\\\"BTC\\\",\\\"quoteCurrency\\\":\\\"USDT\\\",\\\"feeCurrency\\\":\\\"USDT\\\",\\\"market\\\":\\\"USDS\\\",\\\"baseMinSize\\\":\\\"0.00001\\\",\\\"quoteMinSize\\\":\\\"0.1\\\",\\\"baseMaxSize\\\":\\\"10000000000\\\",\\\"quoteMaxSize\\\":\\\"99999999\\\",\\\"baseIncrement\\\":\\\"0.00000001\\\",\\\"quoteIncrement\\\":\\\"0.000001\\\",\\\"priceIncrement\\\":\\\"0.1\\\",\\\"priceLimitRate\\\":\\\"0.1\\\",\\\"minFunds\\\":\\\"0.1\\\",\\\"isMarginEnabled\\\":true,\\\"enableTrading\\\":true,\\\"feeCategory\\\":1,\\\"makerFeeCoefficient\\\":\\\"1.00\\\",\\\"takerFeeCoefficient\\\":\\\"1.00\\\",\\\"st\\\":false}}", - "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\"}" + "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\"}", + "operationId": "004" } }, "/api/v2/symbols": { @@ -1183,7 +1187,8 @@ "x-sdk-method-description": "Request via this endpoint to get a list of available currency pairs for trading. If you want to get the market information of the trading symbol, please use Get All Tickers.", "x-api-rate-limit": 4, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": [\\n {\\n \\\"symbol\\\": \\\"BTC-USDT\\\",\\n \\\"name\\\": \\\"BTC-USDT\\\",\\n \\\"baseCurrency\\\": \\\"BTC\\\",\\n \\\"quoteCurrency\\\": \\\"USDT\\\",\\n \\\"feeCurrency\\\": \\\"USDT\\\",\\n \\\"market\\\": \\\"USDS\\\",\\n \\\"baseMinSize\\\": \\\"0.00001\\\",\\n \\\"quoteMinSize\\\": \\\"0.1\\\",\\n \\\"baseMaxSize\\\": \\\"10000000000\\\",\\n \\\"quoteMaxSize\\\": \\\"99999999\\\",\\n \\\"baseIncrement\\\": \\\"0.00000001\\\",\\n \\\"quoteIncrement\\\": \\\"0.000001\\\",\\n \\\"priceIncrement\\\": \\\"0.1\\\",\\n \\\"priceLimitRate\\\": \\\"0.1\\\",\\n \\\"minFunds\\\": \\\"0.1\\\",\\n \\\"isMarginEnabled\\\": true,\\n \\\"enableTrading\\\": true,\\n \\\"feeCategory\\\": 1,\\n \\\"makerFeeCoefficient\\\": \\\"1.00\\\",\\n \\\"takerFeeCoefficient\\\": \\\"1.00\\\",\\n \\\"st\\\": false\\n }\\n ]\\n}", - "x-request-example": "{\\\"market\\\": \\\"ALTS\\\"}" + "x-request-example": "{\\\"market\\\": \\\"ALTS\\\"}", + "operationId": "005" } }, "/api/v1/market/orderbook/level1": { @@ -1284,7 +1289,8 @@ "x-sdk-method-description": "Request via this endpoint to get Level 1 Market Data. The returned value includes the best bid price and size, the best ask price and size as well as the last traded price and the last traded size.", "x-api-rate-limit": 2, "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"time\\\":1729172965609,\\\"sequence\\\":\\\"14609309753\\\",\\\"price\\\":\\\"67269\\\",\\\"size\\\":\\\"0.000025\\\",\\\"bestBid\\\":\\\"67267.5\\\",\\\"bestBidSize\\\":\\\"0.000025\\\",\\\"bestAsk\\\":\\\"67267.6\\\",\\\"bestAskSize\\\":\\\"1.24808993\\\"}}", - "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\"}" + "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\"}", + "operationId": "006" } }, "/api/v1/market/allTickers": { @@ -1472,7 +1478,8 @@ "x-sdk-method-name": "getAllTickers", "x-sdk-method-description": "Request market tickers for all the trading pairs in the market (including 24h volume), takes a snapshot every 2 seconds. On the rare occasion that we will change the currency name, if you still want the changed symbol name, you can use the symbolName field instead of the symbol field via “Get all tickers” endpoint.", "x-api-rate-limit": 15, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"time\\\": 1729173207043,\\n \\\"ticker\\\": [\\n {\\n \\\"symbol\\\": \\\"BTC-USDT\\\",\\n \\\"symbolName\\\": \\\"BTC-USDT\\\",\\n \\\"buy\\\": \\\"67192.5\\\",\\n \\\"bestBidSize\\\": \\\"0.000025\\\",\\n \\\"sell\\\": \\\"67192.6\\\",\\n \\\"bestAskSize\\\": \\\"1.24949204\\\",\\n \\\"changeRate\\\": \\\"-0.0014\\\",\\n \\\"changePrice\\\": \\\"-98.5\\\",\\n \\\"high\\\": \\\"68321.4\\\",\\n \\\"low\\\": \\\"66683.3\\\",\\n \\\"vol\\\": \\\"1836.03034612\\\",\\n \\\"volValue\\\": \\\"124068431.06726933\\\",\\n \\\"last\\\": \\\"67193\\\",\\n \\\"averagePrice\\\": \\\"67281.21437289\\\",\\n \\\"takerFeeRate\\\": \\\"0.001\\\",\\n \\\"makerFeeRate\\\": \\\"0.001\\\",\\n \\\"takerCoefficient\\\": \\\"1\\\",\\n \\\"makerCoefficient\\\": \\\"1\\\"\\n }\\n ]\\n }\\n}" + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"time\\\": 1729173207043,\\n \\\"ticker\\\": [\\n {\\n \\\"symbol\\\": \\\"BTC-USDT\\\",\\n \\\"symbolName\\\": \\\"BTC-USDT\\\",\\n \\\"buy\\\": \\\"67192.5\\\",\\n \\\"bestBidSize\\\": \\\"0.000025\\\",\\n \\\"sell\\\": \\\"67192.6\\\",\\n \\\"bestAskSize\\\": \\\"1.24949204\\\",\\n \\\"changeRate\\\": \\\"-0.0014\\\",\\n \\\"changePrice\\\": \\\"-98.5\\\",\\n \\\"high\\\": \\\"68321.4\\\",\\n \\\"low\\\": \\\"66683.3\\\",\\n \\\"vol\\\": \\\"1836.03034612\\\",\\n \\\"volValue\\\": \\\"124068431.06726933\\\",\\n \\\"last\\\": \\\"67193\\\",\\n \\\"averagePrice\\\": \\\"67281.21437289\\\",\\n \\\"takerFeeRate\\\": \\\"0.001\\\",\\n \\\"makerFeeRate\\\": \\\"0.001\\\",\\n \\\"takerCoefficient\\\": \\\"1\\\",\\n \\\"makerCoefficient\\\": \\\"1\\\"\\n }\\n ]\\n }\\n}", + "operationId": "007" } }, "/api/v1/market/histories": { @@ -1577,7 +1584,8 @@ "x-sdk-method-description": "Request via this endpoint to get the trade history of the specified symbol, the returned quantity is the last 100 transaction records.", "x-api-rate-limit": 3, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": [\\n {\\n \\\"sequence\\\": \\\"10976028003549185\\\",\\n \\\"price\\\": \\\"67122\\\",\\n \\\"size\\\": \\\"0.000025\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"time\\\": 1729177117877000000\\n },\\n {\\n \\\"sequence\\\": \\\"10976028003549188\\\",\\n \\\"price\\\": \\\"67122\\\",\\n \\\"size\\\": \\\"0.01792257\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"time\\\": 1729177117877000000\\n },\\n {\\n \\\"sequence\\\": \\\"10976028003549191\\\",\\n \\\"price\\\": \\\"67122.9\\\",\\n \\\"size\\\": \\\"0.05654289\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"time\\\": 1729177117877000000\\n }\\n ]\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\"}" + "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\"}", + "operationId": "008" } }, "/api/v1/market/candles": { @@ -1759,7 +1767,8 @@ "x-sdk-method-description": "Get the Kline of the symbol. Data are returned in grouped buckets based on requested type. For each query, the system would return at most 1500 pieces of data. To obtain more data, please page the data by time.", "x-api-rate-limit": 3, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": [\\n [\\n \\\"1566789720\\\",\\n \\\"10411.5\\\",\\n \\\"10401.9\\\",\\n \\\"10411.5\\\",\\n \\\"10396.3\\\",\\n \\\"29.11357276\\\",\\n \\\"302889.301529914\\\"\\n ],\\n [\\n \\\"1566789660\\\",\\n \\\"10416\\\",\\n \\\"10411.5\\\",\\n \\\"10422.3\\\",\\n \\\"10411.5\\\",\\n \\\"15.61781842\\\",\\n \\\"162703.708997029\\\"\\n ],\\n [\\n \\\"1566789600\\\",\\n \\\"10408.6\\\",\\n \\\"10416\\\",\\n \\\"10416\\\",\\n \\\"10405.4\\\",\\n \\\"12.45584973\\\",\\n \\\"129666.51508559\\\"\\n ]\\n ]\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"type\\\": \\\"1min\\\", \\\"startAt\\\": 1566703297, \\\"endAt\\\": 1566789757}" + "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"type\\\": \\\"1min\\\", \\\"startAt\\\": 1566703297, \\\"endAt\\\": 1566789757}", + "operationId": "009" } }, "/api/v1/market/orderbook/level2_{size}": { @@ -1863,7 +1872,8 @@ "x-sdk-method-description": "Query for part orderbook depth data. (aggregated by price) You are recommended to request via this endpoint as the system reponse would be faster and cosume less traffic.", "x-api-rate-limit": 2, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"time\\\": 1729176273859,\\n \\\"sequence\\\": \\\"14610502970\\\",\\n \\\"bids\\\": [\\n [\\n \\\"66976.4\\\",\\n \\\"0.69109872\\\"\\n ],\\n [\\n \\\"66976.3\\\",\\n \\\"0.14377\\\"\\n ]\\n ],\\n \\\"asks\\\": [\\n [\\n \\\"66976.5\\\",\\n \\\"0.05408199\\\"\\n ],\\n [\\n \\\"66976.8\\\",\\n \\\"0.0005\\\"\\n ]\\n ]\\n }\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"size\\\": \\\"20\\\"}" + "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"size\\\": \\\"20\\\"}", + "operationId": "010" } }, "/api/v3/market/orderbook/level2": { @@ -1958,7 +1968,8 @@ "x-sdk-method-description": "Query for Full orderbook depth data. (aggregated by price) It is generally used by professional traders because it uses more server resources and traffic, and we have strict access rate limit control. To maintain up-to-date Order Book, please use Websocket incremental feed after retrieving the OrderBook.", "x-api-rate-limit": 3, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"time\\\": 1729176273859,\\n \\\"sequence\\\": \\\"14610502970\\\",\\n \\\"bids\\\": [\\n [\\n \\\"66976.4\\\",\\n \\\"0.69109872\\\"\\n ],\\n [\\n \\\"66976.3\\\",\\n \\\"0.14377\\\"\\n ]\\n ],\\n \\\"asks\\\": [\\n [\\n \\\"66976.5\\\",\\n \\\"0.05408199\\\"\\n ],\\n [\\n \\\"66976.8\\\",\\n \\\"0.0005\\\"\\n ]\\n ]\\n }\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\"}" + "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\"}", + "operationId": "011" } }, "/api/v1/prices": { @@ -5616,7 +5627,8 @@ "x-sdk-method-description": "Request via this endpoint to get the fiat price of the currencies for the available trading pairs.", "x-api-rate-limit": 3, "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"AGLD\\\":\\\"1.1174410000000001\\\",\\\"DFI\\\":\\\"0.0168915500000000\\\",\\\"PYTHUP\\\":\\\"0.0397880960000000\\\",\\\"ISLM\\\":\\\"0.0606196750000000\\\",\\\"NEAR\\\":\\\"4.7185395500000000\\\",\\\"AIOZ\\\":\\\"0.4862867350000000\\\",\\\"AUDIO\\\":\\\"0.1219390000000000\\\",\\\"BBL\\\":\\\"0.0067766100000000\\\",\\\"WLD\\\":\\\"2.2893547500000000\\\",\\\"HNT\\\":\\\"5.8990489999999984\\\",\\\"ETHFI\\\":\\\"1.5892050000000000\\\",\\\"DMAIL\\\":\\\"0.2726636000000000\\\",\\\"OPUP\\\":\\\"0.0986506500000000\\\",\\\"VET3S\\\":\\\"0.0003700448850000\\\",\\\"MANA3S\\\":\\\"0.0006056970000000\\\",\\\"TIDAL\\\":\\\"0.0001154422500000\\\",\\\"HALO\\\":\\\"0.0058270850000000\\\",\\\"OPUL\\\":\\\"0.0839480050000000\\\",\\\"MANA3L\\\":\\\"0.0029569407900000\\\",\\\"DGB\\\":\\\"0.0066556705000000\\\",\\\"AA\\\":\\\"0.2406796000000000\\\",\\\"BCH\\\":\\\"366.2167999999996484\\\",\\\"GMEE\\\":\\\"0.0113333305000000\\\",\\\"JST\\\":\\\"0.0302348750000000\\\",\\\"PBUX\\\":\\\"0.0208795550000000\\\",\\\"AR\\\":\\\"18.5457224999999909\\\",\\\"SEI\\\":\\\"0.4332832500000000\\\",\\\"PSTAKE\\\":\\\"0.0493153300000000\\\",\\\"LMWR\\\":\\\"0.1618190500000000\\\",\\\"UNFIDOWN\\\":\\\"0.0062058955000000\\\",\\\"BB\\\":\\\"0.3245376500000000\\\",\\\"JTO\\\":\\\"2.1239375000000002\\\",\\\"WEMIX\\\":\\\"0.7916040000000000\\\",\\\"G\\\":\\\"0.0324037900000000\\\",\\\"MARSH\\\":\\\"0.0617591050000000\\\",\\\"BN\\\":\\\"0.0036961510000000\\\",\\\"FLIP\\\":\\\"1.0976509000000000\\\",\\\"FLR\\\":\\\"0.0144827550000000\\\",\\\"BIGTIME\\\":\\\"0.1238780300000000\\\",\\\"FLY\\\":\\\"0.0005157420000000\\\",\\\"T\\\":\\\"0.0233483200000000\\\",\\\"W\\\":\\\"0.2865566500000000\\\",\\\"BDX\\\":\\\"0.0774012800000000\\\",\\\"BABYDOGE\\\":\\\"0.0000000029375305\\\",\\\"SFP\\\":\\\"0.7256370000000000\\\",\\\"DIA\\\":\\\"0.9179408000000000\\\",\\\"ISME\\\":\\\"0.0022388800000000\\\",\\\"LYM\\\":\\\"0.0010155919500000\\\",\\\"VET3L\\\":\\\"0.0000289755050000\\\",\\\"JUP\\\":\\\"0.8230882500000000\\\",\\\"LYX\\\":\\\"1.4501745500000001\\\",\\\"AIEPK\\\":\\\"0.0050094940000000\\\",\\\"SILLY\\\":\\\"0.0159420250000000\\\",\\\"SCPT\\\":\\\"0.0122038950000000\\\",\\\"WOO\\\":\\\"0.1796601250000000\\\",\\\"BLUR\\\":\\\"0.2462768000000000\\\",\\\"STRK\\\":\\\"0.3963117450000000\\\",\\\"BFC\\\":\\\"0.0383608100000000\\\",\\\"DC\\\":\\\"0.0003097450500000\\\",\\\"KARATE\\\":\\\"0.0007296350000000\\\",\\\"SUSHI3L\\\":\\\"0.5115441000000000\\\",\\\"NETVR\\\":\\\"0.0976111700000000\\\",\\\"WAVES\\\":\\\"1.0806594000000000\\\",\\\"LITH\\\":\\\"0.0001520239500000\\\",\\\"HAPI\\\":\\\"8.6533711499999987\\\",\\\"SUSHI3S\\\":\\\"1.2752620500000000\\\",\\\"CEEK\\\":\\\"0.0294852500000000\\\",\\\"FLOKI\\\":\\\"0.0001414292500000\\\",\\\"SHR\\\":\\\"0.0012463765000000\\\",\\\"SAND\\\":\\\"0.2566616050000000\\\",\\\"TURT\\\":\\\"0.0020889550000000\\\",\\\"UMA\\\":\\\"2.5207390000000000\\\",\\\"BEPRO\\\":\\\"0.0003955021500000\\\",\\\"SCRT\\\":\\\"0.1995002000000000\\\",\\\"TUSD\\\":\\\"0.9945025000000000\\\",\\\"COOKIE\\\":\\\"0.0220089900000000\\\",\\\"LRDS\\\":\\\"0.6218889000000000\\\",\\\"SIN\\\":\\\"0.0033633175000000\\\",\\\"OAS\\\":\\\"0.0331933950000000\\\",\\\"ROOT\\\":\\\"0.0183108400000000\\\",\\\"ADA3L\\\":\\\"0.0046396790000000\\\",\\\"TIAUP\\\":\\\"0.1228385500000000\\\",\\\"HTR\\\":\\\"0.0353023400000000\\\",\\\"UNB\\\":\\\"0.0003837080500000\\\",\\\"UNA\\\":\\\"0.0164917500000000\\\",\\\"HARD\\\":\\\"0.1087056200000000\\\",\\\"G3\\\":\\\"0.0502648550000000\\\",\\\"ADA3S\\\":\\\"0.0006191202850000\\\",\\\"MYRO\\\":\\\"0.1071863800000000\\\",\\\"HTX\\\":\\\"0.0000013693150000\\\",\\\"FT\\\":\\\"0.3585206500000000\\\",\\\"BTCDOWN\\\":\\\"0.1065467000000000\\\",\\\"UNI\\\":\\\"7.3571195999999993\\\",\\\"FX\\\":\\\"0.1379310000000000\\\",\\\"OBI\\\":\\\"0.0079030465000000\\\",\\\"UNO\\\":\\\"0.0137131400000000\\\",\\\"WRX\\\":\\\"0.1221389000000000\\\",\\\"TIADOWN\\\":\\\"0.0000914642450000\\\",\\\"ETHDOWN\\\":\\\"0.1306346500000000\\\",\\\"WELL\\\":\\\"0.0471244260000000\\\",\\\"SWFTC\\\":\\\"0.0028966509500000\\\",\\\"SKL\\\":\\\"0.0362418700000000\\\",\\\"UOS\\\":\\\"0.0867765900000000\\\",\\\"AIPAD\\\":\\\"0.0478660550000000\\\",\\\"BRETT\\\":\\\"0.1037481000000000\\\",\\\"SKY\\\":\\\"0.0520139800000000\\\",\\\"FRM\\\":\\\"0.0153123400000000\\\",\\\"VISION\\\":\\\"0.0014451770500000\\\",\\\"LENDS\\\":\\\"0.0047276350000000\\\",\\\"SLF\\\":\\\"0.3318340000000000\\\",\\\"BULL\\\":\\\"0.0023988000000000\\\",\\\"FLOW\\\":\\\"0.5372312500000000\\\",\\\"ODDZ\\\":\\\"0.0063368300000000\\\",\\\"SLN\\\":\\\"0.2804597000000000\\\",\\\"UPO\\\":\\\"0.0440779500000000\\\",\\\"SLP\\\":\\\"0.0023997995000000\\\",\\\"ID\\\":\\\"0.3718140000000000\\\",\\\"SLIM\\\":\\\"0.0906446550000000\\\",\\\"SPOT\\\":\\\"0.0021289350000000\\\",\\\"DOP\\\":\\\"0.0023028480000000\\\",\\\"ISSP\\\":\\\"0.0000874562500000\\\",\\\"UQC\\\":\\\"3.2339822000000003\\\",\\\"IO\\\":\\\"1.8185902499999999\\\",\\\"DOT\\\":\\\"4.2022978000000005\\\",\\\"1INCH\\\":\\\"0.2645676500000000\\\",\\\"SMH\\\":\\\"0.3448275000000000\\\",\\\"MAK\\\":\\\"0.0396701550000000\\\",\\\"TOKO\\\":\\\"0.0005923037000000\\\",\\\"TURBO\\\":\\\"0.0108085930000000\\\",\\\"UNFI\\\":\\\"2.8555714999999996\\\",\\\"MAN\\\":\\\"0.0210764565000000\\\",\\\"EVER\\\":\\\"0.0332733550000000\\\",\\\"FTM\\\":\\\"0.7259068650000000\\\",\\\"SHRAP\\\":\\\"0.0476361700000000\\\",\\\"MAV\\\":\\\"0.1738130500000000\\\",\\\"MAX\\\":\\\"0.2864966800000000\\\",\\\"DPR\\\":\\\"0.0018240875000000\\\",\\\"FTT\\\":\\\"2.0559715000000002\\\",\\\"ARKM\\\":\\\"1.7444273499999999\\\",\\\"ATOM\\\":\\\"4.2954512000000002\\\",\\\"PENDLE\\\":\\\"4.1554212500000007\\\",\\\"QUICK\\\":\\\"0.0365317250000000\\\",\\\"BLZ\\\":\\\"0.1217191100000000\\\",\\\"BOBA\\\":\\\"0.2014092450000000\\\",\\\"MBL\\\":\\\"0.0027856065000000\\\",\\\"OFN\\\":\\\"0.1252373500000000\\\",\\\"UNIO\\\":\\\"0.0025487250000000\\\",\\\"SNS\\\":\\\"0.0200899500000000\\\",\\\"SNX\\\":\\\"1.4282854999999999\\\",\\\"NXRA\\\":\\\"0.0272763550000000\\\",\\\"TAIKO\\\":\\\"1.4392800000000001\\\",\\\"AVAX3L\\\":\\\"0.1410875109550000\\\",\\\"L3\\\":\\\"0.0608395650000000\\\",\\\"API3\\\":\\\"1.3728132500000001\\\",\\\"XRP3S\\\":\\\"0.0028095945000000\\\",\\\"QKC\\\":\\\"0.0085157400000000\\\",\\\"AVAX3S\\\":\\\"0.5148424500000000\\\",\\\"ROSE\\\":\\\"0.0693453100000000\\\",\\\"SATS\\\":\\\"0.0000002701648500\\\",\\\"BMX\\\":\\\"0.3100449000000000\\\",\\\"PORTAL\\\":\\\"0.2811593500000000\\\",\\\"TOMI\\\":\\\"0.0309045400000000\\\",\\\"XRP3L\\\":\\\"2.1586201500000002\\\",\\\"SOL\\\":\\\"151.7250995000003583\\\",\\\"SON\\\":\\\"0.0002421788500000\\\",\\\"BNC\\\":\\\"0.1882058500000000\\\",\\\"SOCIAL\\\":\\\"0.0026486750000000\\\",\\\"CGPT\\\":\\\"0.1305147100000000\\\",\\\"CELR\\\":\\\"0.0127736100000000\\\",\\\"BNB\\\":\\\"591.0973035000118935\\\",\\\"OGN\\\":\\\"0.0852573500000000\\\",\\\"CELO\\\":\\\"0.7711142500000000\\\",\\\"AUCTION\\\":\\\"13.1634150000000014\\\",\\\"MANTA\\\":\\\"0.7564216000000000\\\",\\\"LAYER\\\":\\\"0.0372713550000000\\\",\\\"AERO\\\":\\\"1.3783104999999999\\\",\\\"CETUS\\\":\\\"0.1808295400000000\\\",\\\"LL\\\":\\\"0.0201199350000000\\\",\\\"SPA\\\":\\\"0.0067426270000000\\\",\\\"PYTHDOWN\\\":\\\"0.0011834080000000\\\",\\\"NEIROCTO\\\":\\\"0.0019964013000000\\\",\\\"UTK\\\":\\\"0.0365217300000000\\\",\\\"GMRX\\\":\\\"0.0007386305000000\\\",\\\"BOB\\\":\\\"0.0000380619595000\\\",\\\"HOTCROSS\\\":\\\"0.0056491740000000\\\",\\\"AERGO\\\":\\\"0.1007595950000000\\\",\\\"MOCA\\\":\\\"0.0783608000000000\\\",\\\"SQD\\\":\\\"0.0380809500000000\\\",\\\"MV\\\":\\\"0.0081359300000000\\\",\\\"BNB3L\\\":\\\"0.2761618500000000\\\",\\\"BNB3S\\\":\\\"0.0008545725000000\\\",\\\"GALAX3L\\\":\\\"0.0057571999600000\\\",\\\"KAI\\\":\\\"0.0020080954500000\\\",\\\"SQR\\\":\\\"0.0470764500000000\\\",\\\"GALAX3S\\\":\\\"0.1933033000000000\\\",\\\"EGLD\\\":\\\"25.5272299999999713\\\",\\\"ZBCN\\\":\\\"0.0010404795000000\\\",\\\"KAS\\\":\\\"0.1216691350000000\\\",\\\"MEW\\\":\\\"0.0086176890000000\\\",\\\"PUNDIX\\\":\\\"0.4130933500000000\\\",\\\"LOOKS\\\":\\\"0.0392803500000000\\\",\\\"FXS\\\":\\\"1.9060465000000000\\\",\\\"BOSON\\\":\\\"0.2732633000000000\\\",\\\"BRISE\\\":\\\"0.0000000860569500\\\",\\\"AEVO\\\":\\\"0.3388305000000000\\\",\\\"FLUX\\\":\\\"0.5276360500000000\\\",\\\"PRCL\\\":\\\"0.1969015000000000\\\",\\\"UNFIUP\\\":\\\"0.0011654170000000\\\",\\\"SEIDOWN\\\":\\\"0.0442778500000000\\\",\\\"DOAI\\\":\\\"0.0052363805000000\\\",\\\"QNT\\\":\\\"65.4312679999998206\\\",\\\"REDO\\\":\\\"0.2837580500000000\\\",\\\"STRIKE\\\":\\\"6.8225869999999997\\\",\\\"ETHW\\\":\\\"3.2418782499999998\\\",\\\"OM\\\":\\\"1.5396797750000000\\\",\\\"OP\\\":\\\"1.6911539999999999\\\",\\\"WHALE\\\":\\\"0.8134930500000000\\\",\\\"1CAT\\\":\\\"0.0018460765000000\\\",\\\"NEON\\\":\\\"0.4446775500000000\\\",\\\"GTAI\\\":\\\"0.7786105000000000\\\",\\\"SSV\\\":\\\"21.2393749999999841\\\",\\\"ETH2\\\":\\\"2601.6678843156403923\\\",\\\"KCS\\\":\\\"8.7646155000000020\\\",\\\"ARPA\\\":\\\"0.0393882960000000\\\",\\\"ARTFI\\\":\\\"0.0141029450000000\\\",\\\"BRL\\\":\\\"0.1742807323452485\\\",\\\"ALEX\\\":\\\"0.0924537500000000\\\",\\\"STG\\\":\\\"0.2943527500000000\\\",\\\"SHIB\\\":\\\"0.0000178060925000\\\",\\\"IOTX\\\":\\\"0.0394202800000000\\\",\\\"OLE\\\":\\\"0.0171414250000000\\\",\\\"KDA\\\":\\\"0.5653172000000000\\\",\\\"CERE\\\":\\\"0.0022548720000000\\\",\\\"DOCK\\\":\\\"0.0018990500000000\\\",\\\"STX\\\":\\\"1.8157916500000000\\\",\\\"OLT\\\":\\\"0.0007596200000000\\\",\\\"QI\\\":\\\"0.0131754090000000\\\",\\\"SDAO\\\":\\\"0.2748625000000000\\\",\\\"BLAST\\\":\\\"0.0087636160000000\\\",\\\"LINK3S\\\":\\\"0.0000702948350000\\\",\\\"IOST\\\":\\\"0.0049745115000000\\\",\\\"SUI\\\":\\\"2.0589700000000000\\\",\\\"CAKE\\\":\\\"1.7941024999999999\\\",\\\"BSW\\\":\\\"0.0586706500000000\\\",\\\"OMG\\\":\\\"0.2597700500000000\\\",\\\"VOLT\\\":\\\"0.0000002716641000\\\",\\\"LINK3L\\\":\\\"1.3408292499999999\\\",\\\"GEEQ\\\":\\\"0.0385607100000000\\\",\\\"PYUSD\\\":\\\"0.9988003500000000\\\",\\\"SUN\\\":\\\"0.0186106900000000\\\",\\\"TOWER\\\":\\\"0.0014812590000000\\\",\\\"BTC\\\":\\\"67133.4165000832051564\\\",\\\"IOTA\\\":\\\"0.1189405000000000\\\",\\\"REEF\\\":\\\"0.0019960015000000\\\",\\\"TRIAS\\\":\\\"3.3683149999999998\\\",\\\"KEY\\\":\\\"0.0037594713240047\\\",\\\"ETH3L\\\":\\\"0.0003305946200000\\\",\\\"BTT\\\":\\\"0.0000009117439000\\\",\\\"ONE\\\":\\\"0.0132003965000000\\\",\\\"RENDER\\\":\\\"5.2263854999999995\\\",\\\"ETH3S\\\":\\\"0.5517240000000000\\\",\\\"ANKR\\\":\\\"0.0264867500000000\\\",\\\"ALGO\\\":\\\"0.1188405500000000\\\",\\\"SYLO\\\":\\\"0.0007600198000000\\\",\\\"ZCX\\\":\\\"0.0784707450000000\\\",\\\"SD\\\":\\\"0.3851073500000000\\\",\\\"ONT\\\":\\\"0.1877960550000000\\\",\\\"MJT\\\":\\\"0.0132433750000000\\\",\\\"DYM\\\":\\\"1.6659666000000001\\\",\\\"DYP\\\":\\\"0.0205397250000000\\\",\\\"BAKEUP\\\":\\\"0.0389894955000000\\\",\\\"OOE\\\":\\\"0.0079360300000000\\\",\\\"ZELIX\\\":\\\"0.0000649675000000\\\",\\\"DOGE3L\\\":\\\"0.3837080500000000\\\",\\\"ARTY\\\":\\\"0.3980009000000000\\\",\\\"QORPO\\\":\\\"0.1204297550000000\\\",\\\"ICE\\\":\\\"0.0051504235000000\\\",\\\"NOTAI\\\":\\\"0.0000892753400000\\\",\\\"DOGE3S\\\":\\\"0.2291853500000000\\\",\\\"NAKA\\\":\\\"1.0695649500000000\\\",\\\"GALAX\\\":\\\"0.0212893500000000\\\",\\\"MKR\\\":\\\"1245.8767500000163833\\\",\\\"DODO\\\":\\\"0.1152423500000000\\\",\\\"ICP\\\":\\\"7.6731615000000027\\\",\\\"ZEC\\\":\\\"35.9400209999999543\\\",\\\"ZEE\\\":\\\"0.0065767100000000\\\",\\\"ICX\\\":\\\"0.1383308000000000\\\",\\\"KMNO\\\":\\\"0.0921499020000000\\\",\\\"TT\\\":\\\"0.0033883050000000\\\",\\\"DOT3L\\\":\\\"0.1454272500000000\\\",\\\"XAI\\\":\\\"0.2038980000000000\\\",\\\"ZEN\\\":\\\"8.0149905000000007\\\",\\\"DOGE\\\":\\\"0.1213093150000000\\\",\\\"ALPHA\\\":\\\"0.0567416150000000\\\",\\\"DUSK\\\":\\\"0.1964517250000000\\\",\\\"DOT3S\\\":\\\"0.0053613180000000\\\",\\\"SXP\\\":\\\"0.2538730000000000\\\",\\\"HBAR\\\":\\\"0.0510044850000000\\\",\\\"SYNT\\\":\\\"0.0467166300000000\\\",\\\"ZEX\\\":\\\"0.0571714000000000\\\",\\\"BONDLY\\\":\\\"0.0022208890000000\\\",\\\"MLK\\\":\\\"0.2080859050000000\\\",\\\"KICKS\\\":\\\"0.0001301249050000\\\",\\\"PEPE\\\":\\\"0.0000100249850000\\\",\\\"OUSD\\\":\\\"0.9982006500000000\\\",\\\"LUNCDOWN\\\":\\\"0.0000733333150000\\\",\\\"DOGS\\\":\\\"0.0007086455000000\\\",\\\"REV3L\\\":\\\"0.0094672640000000\\\",\\\"CTSI\\\":\\\"0.1257371000000000\\\",\\\"C98\\\":\\\"0.1219390000000000\\\",\\\"OSMO\\\":\\\"0.5370313500000000\\\",\\\"NTRN\\\":\\\"0.3869064500000000\\\",\\\"CFX2S\\\":\\\"0.0084757600000000\\\",\\\"SYN\\\":\\\"0.5636180500000000\\\",\\\"VIDT\\\":\\\"0.0308745550000000\\\",\\\"SYS\\\":\\\"0.0997501000000000\\\",\\\"GAS\\\":\\\"4.3029474500000008\\\",\\\"BOME\\\":\\\"0.0087336310000000\\\",\\\"COMBO\\\":\\\"0.4068964500000000\\\",\\\"XCH\\\":\\\"14.9825050000000010\\\",\\\"VR\\\":\\\"0.0063538215000000\\\",\\\"CFX2L\\\":\\\"0.0499660045000000\\\",\\\"VSYS\\\":\\\"0.0005201398000000\\\",\\\"PANDORA\\\":\\\"1629.2949450001102772\\\",\\\"THETA\\\":\\\"1.2461766000000000\\\",\\\"XCN\\\":\\\"0.0012699647000000\\\",\\\"NEXG\\\":\\\"0.0039180400000000\\\",\\\"MELOS\\\":\\\"0.0021244372500000\\\",\\\"XCV\\\":\\\"0.0013253370000000\\\",\\\"ORN\\\":\\\"0.8797599000000000\\\",\\\"WLKN\\\":\\\"0.0010624685000000\\\",\\\"AAVE\\\":\\\"154.2708259999996162\\\",\\\"MNT\\\":\\\"0.6168914000000000\\\",\\\"BONK\\\":\\\"0.0000227296295000\\\",\\\"PERP\\\":\\\"0.6037979500000000\\\",\\\"XDC\\\":\\\"0.0276361750000000\\\",\\\"MNW\\\":\\\"0.3681158500000000\\\",\\\"XDB\\\":\\\"0.0002578710000000\\\",\\\"BOND\\\":\\\"1.5662165000000000\\\",\\\"SUIA\\\":\\\"0.0809595000000000\\\",\\\"MOG\\\":\\\"0.0000019330330000\\\",\\\"SUTER\\\":\\\"0.0001840079500000\\\",\\\"TIME\\\":\\\"16.2648634999999969\\\",\\\"RACA\\\":\\\"0.0001949025000000\\\",\\\"BICO\\\":\\\"0.2021988500000000\\\",\\\"MON\\\":\\\"0.1066466500000000\\\",\\\"SWEAT\\\":\\\"0.0063718125000000\\\",\\\"MOXIE\\\":\\\"0.0022088950000000\\\",\\\"BABYBNB\\\":\\\"0.0289755050000000\\\",\\\"IGU\\\":\\\"0.0050674650000000\\\",\\\"HMSTR\\\":\\\"0.0037990995000000\\\",\\\"XEC\\\":\\\"0.0000354722550000\\\",\\\"MONI\\\":\\\"0.0058470750000000\\\",\\\"XR\\\":\\\"0.2374812000000000\\\",\\\"PEOPLE\\\":\\\"0.0796601500000000\\\",\\\"PUMLX\\\":\\\"0.0054572700000000\\\",\\\"ZIL\\\":\\\"0.0145927000000000\\\",\\\"WLDDOWN\\\":\\\"0.2089954500000000\\\",\\\"VAI\\\":\\\"0.0799999800000000\\\",\\\"XEN\\\":\\\"0.0000000839580000\\\",\\\"MPC\\\":\\\"0.1001499000000000\\\",\\\"XEM\\\":\\\"0.0176951480000000\\\",\\\"JASMY3S\\\":\\\"0.0019670160000000\\\",\\\"OTK\\\":\\\"0.0290464695000000\\\",\\\"TRAC\\\":\\\"0.4521738000000000\\\",\\\"DFYN\\\":\\\"0.0070664650000000\\\",\\\"BIDP\\\":\\\"0.0001939030000000\\\",\\\"JASMY3L\\\":\\\"0.0001653772700000\\\",\\\"INJDOWN\\\":\\\"0.0000194902500000\\\",\\\"KLV\\\":\\\"0.0019310340000000\\\",\\\"WAXL\\\":\\\"0.7858069000000000\\\",\\\"TRBDOWN\\\":\\\"0.0023138425000000\\\",\\\"BCH3L\\\":\\\"4.6390663064999996\\\",\\\"GMT3S\\\":\\\"0.0000457771000000\\\",\\\"KMD\\\":\\\"0.2493752500000000\\\",\\\"BCH3S\\\":\\\"0.9634180500000000\\\",\\\"ECOX\\\":\\\"0.0987506000000000\\\",\\\"AAVE3S\\\":\\\"0.0560719500000000\\\",\\\"GMT3L\\\":\\\"0.0053983694650000\\\",\\\"EPIK\\\":\\\"0.0045857060000000\\\",\\\"SUIP\\\":\\\"0.1067565950000000\\\",\\\"AAVE3L\\\":\\\"0.3638687346200000\\\",\\\"ZK\\\":\\\"0.1262368500000000\\\",\\\"ZKF\\\":\\\"0.0008595700000000\\\",\\\"OMNIA\\\":\\\"0.7624186000000000\\\",\\\"ZKJ\\\":\\\"1.1124435000000000\\\",\\\"ZKL\\\":\\\"0.1255372000000000\\\",\\\"GAFI\\\":\\\"3.0634675000000001\\\",\\\"CARV\\\":\\\"0.8703646000000000\\\",\\\"KNC\\\":\\\"0.4433782000000000\\\",\\\"CATS\\\":\\\"0.0000599700000000\\\",\\\"PROM\\\":\\\"5.2833570000000006\\\",\\\"ALEPH\\\":\\\"0.1756121500000000\\\",\\\"PONKE\\\":\\\"0.3958020000000000\\\",\\\"OVR\\\":\\\"0.1553223000000000\\\",\\\"CATI\\\":\\\"0.4105146400000000\\\",\\\"ORDER\\\":\\\"0.1183008200000000\\\",\\\"GFT\\\":\\\"0.0166616650000000\\\",\\\"BIFI\\\":\\\"0.0020489750000000\\\",\\\"GGC\\\":\\\"6.9965029985000000\\\",\\\"GGG\\\":\\\"0.0403798000000000\\\",\\\"DAPPX\\\":\\\"0.0043788095000000\\\",\\\"SUKU\\\":\\\"0.0618790450000000\\\",\\\"ULTI\\\":\\\"0.0168015950000000\\\",\\\"CREDI\\\":\\\"0.0192903500000000\\\",\\\"ERTHA\\\":\\\"0.0010014990000000\\\",\\\"FURY\\\":\\\"0.1405297000000000\\\",\\\"KARRAT\\\":\\\"0.5577210000000000\\\",\\\"MOBILE\\\":\\\"0.0009005495000000\\\",\\\"SIDUS\\\":\\\"0.0037671155000000\\\",\\\"NAVI\\\":\\\"0.1254672350000000\\\",\\\"TAO\\\":\\\"583.4081500000051807\\\",\\\"USDJ\\\":\\\"1.1386304000000001\\\",\\\"MTL\\\":\\\"0.9563216000000000\\\",\\\"VET\\\":\\\"0.0225387250000000\\\",\\\"FITFI\\\":\\\"0.0036421780000000\\\",\\\"USDT\\\":\\\"0.9995000000000000\\\",\\\"OXT\\\":\\\"0.0695652000000000\\\",\\\"CANDY\\\":\\\"0.0005597200000000\\\",\\\"USDP\\\":\\\"0.9932031500000000\\\",\\\"MTS\\\":\\\"0.0027516235000000\\\",\\\"TADA\\\":\\\"0.0283858000000000\\\",\\\"MTV\\\":\\\"0.0006559718500000\\\",\\\"NAVX\\\":\\\"0.1342228550000000\\\",\\\"ILV\\\":\\\"35.6771524999999671\\\",\\\"VINU\\\":\\\"0.0000000109045450\\\",\\\"GHX\\\":\\\"0.0903548000000000\\\",\\\"EDU\\\":\\\"0.5167415000000000\\\",\\\"HYVE\\\":\\\"0.0137331300000000\\\",\\\"BTC3L\\\":\\\"0.0058620675000000\\\",\\\"ANYONE\\\":\\\"0.9015490000000000\\\",\\\"BEAT\\\":\\\"0.0012593700000000\\\",\\\"KING\\\":\\\"0.0004821588000000\\\",\\\"CREAM\\\":\\\"15.6541689999999973\\\",\\\"CAS\\\":\\\"0.0038590695000000\\\",\\\"IMX\\\":\\\"1.4944524000000000\\\",\\\"CAT\\\":\\\"0.0000256981445000\\\",\\\"BTC3S\\\":\\\"0.0014142925000000\\\",\\\"USDE\\\":\\\"0.9985005000000000\\\",\\\"USDD\\\":\\\"1.0000997000000000\\\",\\\"CWAR\\\":\\\"0.0037981000000000\\\",\\\"USDC\\\":\\\"0.9997998500000000\\\",\\\"KRL\\\":\\\"0.3543127550000000\\\",\\\"INJ\\\":\\\"21.7691100000000194\\\",\\\"GAME\\\":\\\"0.0139630150000000\\\",\\\"TRIBL\\\":\\\"1.0994500000000000\\\",\\\"XLM\\\":\\\"0.0948525500000000\\\",\\\"TRBUP\\\":\\\"0.0012293850000000\\\",\\\"VRADOWN\\\":\\\"0.0013433280000000\\\",\\\"SUPER\\\":\\\"1.2853570000000000\\\",\\\"EIGEN\\\":\\\"3.1536223999999999\\\",\\\"IOI\\\":\\\"0.0146926500000000\\\",\\\"KSM\\\":\\\"17.5212350000000129\\\",\\\"CCD\\\":\\\"0.0034832575000000\\\",\\\"EGO\\\":\\\"0.0093553200000000\\\",\\\"EGP\\\":\\\"2.7946019999999998\\\",\\\"MXC\\\":\\\"0.0066866550000000\\\",\\\"TEL\\\":\\\"0.0014432780000000\\\",\\\"MOVR\\\":\\\"9.1340307000000027\\\",\\\"XMR\\\":\\\"155.5421899999990755\\\",\\\"MXM\\\":\\\"0.0092853550000000\\\",\\\"OORT\\\":\\\"0.1099949750000000\\\",\\\"GLM\\\":\\\"0.3231383500000000\\\",\\\"RAY\\\":\\\"2.0228880499999998\\\",\\\"XTAG\\\":\\\"0.0218190850000000\\\",\\\"GLQ\\\":\\\"0.0854572500000000\\\",\\\"CWEB\\\":\\\"0.0038480750000000\\\",\\\"REVU\\\":\\\"0.0105047450000000\\\",\\\"REVV\\\":\\\"0.0039760110000000\\\",\\\"ZRO\\\":\\\"3.7952014499999994\\\",\\\"XNL\\\":\\\"0.0093853050000000\\\",\\\"XNO\\\":\\\"0.8496749500000000\\\",\\\"SAROS\\\":\\\"0.0019290350000000\\\",\\\"KACE\\\":\\\"2.1165411999999998\\\",\\\"ZRX\\\":\\\"0.3186406000000000\\\",\\\"WLTH\\\":\\\"0.0374312750000000\\\",\\\"ATOM3L\\\":\\\"0.0321719060000000\\\",\\\"GMM\\\":\\\"0.0001497251000000\\\",\\\"BEER\\\":\\\"0.0000138670630000\\\",\\\"GMT\\\":\\\"0.1275362000000000\\\",\\\"HEART\\\":\\\"0.0159920000000000\\\",\\\"GMX\\\":\\\"22.7186349999999882\\\",\\\"ABBC\\\":\\\"0.0061769100000000\\\",\\\"OMNI\\\":\\\"8.9235359999999970\\\",\\\"ATOM3S\\\":\\\"0.0007945225400000\\\",\\\"IRL\\\":\\\"0.0099650150000000\\\",\\\"CFG\\\":\\\"0.3248375000000000\\\",\\\"WSDM\\\":\\\"0.0139830050000000\\\",\\\"GNS\\\":\\\"1.8390800000000001\\\",\\\"VANRY\\\":\\\"0.0809295150000000\\\",\\\"CFX\\\":\\\"0.1595202000000000\\\",\\\"GRAIL\\\":\\\"817.1212349999937891\\\",\\\"BEFI\\\":\\\"0.0175712100000000\\\",\\\"VELO\\\":\\\"0.0132043945000000\\\",\\\"XPR\\\":\\\"0.0008077959000000\\\",\\\"DOVI\\\":\\\"0.0584707500000000\\\",\\\"ACE\\\":\\\"0.0021349320000000\\\",\\\"ACH\\\":\\\"0.0190534685000000\\\",\\\"ISP\\\":\\\"0.0012161916000000\\\",\\\"XCAD\\\":\\\"0.2834582000000000\\\",\\\"MINA\\\":\\\"0.5630183500000000\\\",\\\"TIA\\\":\\\"5.9318325999999999\\\",\\\"DRIFT\\\":\\\"0.4350823500000000\\\",\\\"ACQ\\\":\\\"0.0056981495000000\\\",\\\"ACS\\\":\\\"0.0014917537500000\\\",\\\"MIND\\\":\\\"0.0018920535000000\\\",\\\"STORE\\\":\\\"0.0062358805000000\\\",\\\"REN\\\":\\\"0.0351224300000000\\\",\\\"ELA\\\":\\\"1.7282354500000000\\\",\\\"DREAMS\\\":\\\"0.0002498750000000\\\",\\\"ADA\\\":\\\"0.3463267500000000\\\",\\\"ELF\\\":\\\"0.3777110500000000\\\",\\\"REQ\\\":\\\"0.0959919800000000\\\",\\\"STORJ\\\":\\\"0.5662167500000000\\\",\\\"LADYS\\\":\\\"0.0000000837581000\\\",\\\"PAXG\\\":\\\"2697.9303600003123340\\\",\\\"REZ\\\":\\\"0.0409795000000000\\\",\\\"XRD\\\":\\\"0.0157821050000000\\\",\\\"CHO\\\":\\\"0.0205097400000000\\\",\\\"CHR\\\":\\\"0.1769115000000000\\\",\\\"ADS\\\":\\\"0.1889055000000000\\\",\\\"CHZ\\\":\\\"0.0738030800000000\\\",\\\"ADX\\\":\\\"0.1575212000000000\\\",\\\"XRP\\\":\\\"0.5525036100000000\\\",\\\"JASMY\\\":\\\"0.0188615645000000\\\",\\\"KAGI\\\":\\\"0.1834582250000000\\\",\\\"FIDA\\\":\\\"0.2282858000000000\\\",\\\"PBR\\\":\\\"0.0291953950000000\\\",\\\"AEG\\\":\\\"0.0093453250000000\\\",\\\"H2O\\\":\\\"0.1610194500000000\\\",\\\"CHMB\\\":\\\"0.0001715641750000\\\",\\\"SAND3L\\\":\\\"0.0015447972150000\\\",\\\"PBX\\\":\\\"0.0006879558500000\\\",\\\"SOLVE\\\":\\\"0.0084557700000000\\\",\\\"DECHAT\\\":\\\"0.1512243500000000\\\",\\\"GARI\\\":\\\"0.0076861550000000\\\",\\\"SHIB2L\\\":\\\"1.1996998499999999\\\",\\\"SHIB2S\\\":\\\"0.0240879500000000\\\",\\\"ENA\\\":\\\"0.3942028000000000\\\",\\\"VEMP\\\":\\\"0.0029335325000000\\\",\\\"ENJ\\\":\\\"0.1467266000000000\\\",\\\"AFG\\\":\\\"0.0072163900000000\\\",\\\"RATS\\\":\\\"0.0001211593900000\\\",\\\"GRT\\\":\\\"0.1646076550000000\\\",\\\"FORWARD\\\":\\\"0.0012873560000000\\\",\\\"TFUEL\\\":\\\"0.0598800450000000\\\",\\\"ENS\\\":\\\"17.0634640000000052\\\",\\\"KASDOWN\\\":\\\"0.0258770550000000\\\",\\\"XTM\\\":\\\"0.0251074400000000\\\",\\\"DEGEN\\\":\\\"0.0084857550000000\\\",\\\"TLM\\\":\\\"0.0100449750000000\\\",\\\"DYDXDOWN\\\":\\\"0.1042598440000000\\\",\\\"CKB\\\":\\\"0.0146026950000000\\\",\\\"LUNC\\\":\\\"0.0000889255150000\\\",\\\"AURORA\\\":\\\"0.1204397500000000\\\",\\\"LUNA\\\":\\\"0.3624187000000000\\\",\\\"XTZ\\\":\\\"0.6776610000000000\\\",\\\"ELON\\\":\\\"0.0000001410294500\\\",\\\"DMTR\\\":\\\"0.0891554000000000\\\",\\\"EOS\\\":\\\"0.4759619000000000\\\",\\\"GST\\\":\\\"0.0118940500000000\\\",\\\"FORT\\\":\\\"0.1155422000000000\\\",\\\"FLAME\\\":\\\"0.0247076400000000\\\",\\\"PATEX\\\":\\\"0.9605195000000000\\\",\\\"DEEP\\\":\\\"0.0328885475000000\\\",\\\"ID3L\\\":\\\"0.0016201895000000\\\",\\\"GTC\\\":\\\"0.6625685500000000\\\",\\\"ID3S\\\":\\\"0.0071674145000000\\\",\\\"RIO\\\":\\\"0.7616190000000000\\\",\\\"CLH\\\":\\\"0.0008555720000000\\\",\\\"BURGER\\\":\\\"0.4016990500000000\\\",\\\"VRA\\\":\\\"0.0029765110000000\\\",\\\"SUNDOG\\\":\\\"0.2173912500000000\\\",\\\"GTT\\\":\\\"0.0002038980000000\\\",\\\"INJUP\\\":\\\"0.2327835500000000\\\",\\\"CPOOL\\\":\\\"0.1557720750000000\\\",\\\"EPX\\\":\\\"0.0000740629500000\\\",\\\"CLV\\\":\\\"0.0329835000000000\\\",\\\"FEAR\\\":\\\"0.0560519600000000\\\",\\\"MEME\\\":\\\"0.0124847545000000\\\",\\\"ROOBEE\\\":\\\"0.0004520738500000\\\",\\\"DEFI\\\":\\\"0.0192903500000000\\\",\\\"TOKEN\\\":\\\"0.0477361200000000\\\",\\\"GRAPE\\\":\\\"0.0020599695000000\\\",\\\"KASUP\\\":\\\"0.3996001000000000\\\",\\\"XWG\\\":\\\"0.0003843077500000\\\",\\\"SKEY\\\":\\\"0.0621289200000000\\\",\\\"SFUND\\\":\\\"1.3243375000000000\\\",\\\"EQX\\\":\\\"0.0032823580000000\\\",\\\"ORDIUP\\\":\\\"0.0548315705000000\\\",\\\"TON\\\":\\\"5.1857058499999995\\\",\\\"DEGO\\\":\\\"2.2667660500000001\\\",\\\"IZI\\\":\\\"0.0088455750000000\\\",\\\"ERG\\\":\\\"0.6605695500000000\\\",\\\"ERN\\\":\\\"1.9255367500000001\\\",\\\"VENOM\\\":\\\"0.0817591000000000\\\",\\\"VOXEL\\\":\\\"0.1497251000000000\\\",\\\"RLC\\\":\\\"1.4649671500000000\\\",\\\"PHA\\\":\\\"0.1093453000000000\\\",\\\"DYDXUP\\\":\\\"0.0112573685000000\\\",\\\"APE3S\\\":\\\"0.0008475760000000\\\",\\\"ORBS\\\":\\\"0.0288955450000000\\\",\\\"OPDOWN\\\":\\\"0.6758619000000000\\\",\\\"ESE\\\":\\\"0.0139130400000000\\\",\\\"APE3L\\\":\\\"0.1339330000000000\\\",\\\"HMND\\\":\\\"0.0982208650000000\\\",\\\"COQ\\\":\\\"0.0000014432780000\\\",\\\"AURY\\\":\\\"0.3340329000000000\\\",\\\"CULT\\\":\\\"0.0000028025980000\\\",\\\"AKT\\\":\\\"2.4642672500000001\\\",\\\"GLMR\\\":\\\"0.1606196500000000\\\",\\\"XYM\\\":\\\"0.0142528700000000\\\",\\\"ORAI\\\":\\\"6.1769100000000012\\\",\\\"XYO\\\":\\\"0.0058680645000000\\\",\\\"ETC\\\":\\\"18.8458723500000169\\\",\\\"LAI\\\":\\\"0.0142828550000000\\\",\\\"PIP\\\":\\\"0.0178310800000000\\\",\\\"ETH\\\":\\\"2607.6655149998362673\\\",\\\"NEO\\\":\\\"10.3575186499999991\\\",\\\"RMV\\\":\\\"0.0081659150000000\\\",\\\"KLAY\\\":\\\"0.1251374000000000\\\",\\\"PIT\\\":\\\"0.0000000003268365\\\",\\\"TARA\\\":\\\"0.0043978000000000\\\",\\\"KALT\\\":\\\"0.1128735350000000\\\",\\\"PIX\\\":\\\"0.0001023687900000\\\",\\\"ETN\\\":\\\"0.0021579205000000\\\",\\\"CSIX\\\":\\\"0.0141729100000000\\\",\\\"TRADE\\\":\\\"0.4708644500000000\\\",\\\"MAVIA\\\":\\\"1.3592200500000001\\\",\\\"HIGH\\\":\\\"1.3043474999999999\\\",\\\"TRB\\\":\\\"62.5387150000000006\\\",\\\"ORDI\\\":\\\"35.7421200000000126\\\",\\\"TRVL\\\":\\\"0.0373643085000000\\\",\\\"AMB\\\":\\\"0.0059670150000000\\\",\\\"TRU\\\":\\\"0.0762018800000000\\\",\\\"LOGX\\\":\\\"0.0271963950000000\\\",\\\"FINC\\\":\\\"0.0362018900000000\\\",\\\"INFRA\\\":\\\"0.1978010500000000\\\",\\\"NATIX\\\":\\\"0.0008729633000000\\\",\\\"NFP\\\":\\\"0.2152923000000000\\\",\\\"TRY\\\":\\\"0.0292166033323590\\\",\\\"TRX\\\":\\\"0.1597201000000000\\\",\\\"LBP\\\":\\\"0.0001243378000000\\\",\\\"LBR\\\":\\\"0.0595702000000000\\\",\\\"EUL\\\":\\\"2.9735125000000000\\\",\\\"NFT\\\":\\\"0.0000004077960000\\\",\\\"SEIUP\\\":\\\"0.0478110825000000\\\",\\\"PUFFER\\\":\\\"0.3676161000000000\\\",\\\"EUR\\\":\\\"1.0811249323958897\\\",\\\"ORCA\\\":\\\"2.0664662499999999\\\",\\\"NEAR3L\\\":\\\"0.0117010765350000\\\",\\\"AMP\\\":\\\"0.0038330825000000\\\",\\\"XDEFI\\\":\\\"0.0472563600000000\\\",\\\"HIFI\\\":\\\"0.4947525000000000\\\",\\\"TRUF\\\":\\\"0.0459570100000000\\\",\\\"AITECH\\\":\\\"0.1045477000000000\\\",\\\"AMU\\\":\\\"0.0043978000000000\\\",\\\"USTC\\\":\\\"0.0214692600000000\\\",\\\"KNGL\\\":\\\"0.0499750000000000\\\",\\\"FOXY\\\":\\\"0.0102686631000000\\\",\\\"NGC\\\":\\\"0.0147935995000000\\\",\\\"TENET\\\":\\\"0.0043278350000000\\\",\\\"NEAR3S\\\":\\\"0.0072553705000000\\\",\\\"MAHA\\\":\\\"1.1904045000000000\\\",\\\"NGL\\\":\\\"0.0701748950000000\\\",\\\"TST\\\":\\\"0.0080359800000000\\\",\\\"HIPPO\\\":\\\"0.0104447750000000\\\",\\\"AXS3S\\\":\\\"0.0308705570000000\\\",\\\"CRO\\\":\\\"0.0781409100000000\\\",\\\"ZPAY\\\":\\\"0.0050574700000000\\\",\\\"MNDE\\\":\\\"0.1026786350000000\\\",\\\"CRV\\\":\\\"0.2534732000000000\\\",\\\"SWASH\\\":\\\"0.0056271850000000\\\",\\\"AXS3L\\\":\\\"0.0106388779000000\\\",\\\"VERSE\\\":\\\"0.0001803098000000\\\",\\\"RPK\\\":\\\"0.0049975000000000\\\",\\\"RPL\\\":\\\"10.9745099999999958\\\",\\\"AZERO\\\":\\\"0.3789104500000000\\\",\\\"SOUL\\\":\\\"0.0534332700000000\\\",\\\"VXV\\\":\\\"0.2619689500000000\\\",\\\"LDO\\\":\\\"1.0885554500000000\\\",\\\"MAGIC\\\":\\\"0.3390304000000000\\\",\\\"ALICE\\\":\\\"1.0324835000000000\\\",\\\"SEAM\\\":\\\"1.1933030499999999\\\",\\\"PLU\\\":\\\"1.9300345000000001\\\",\\\"AOG\\\":\\\"0.0031224380000000\\\",\\\"SMOLE\\\":\\\"0.0000387806000000\\\",\\\"EWT\\\":\\\"1.1094450000000000\\\",\\\"TSUGT\\\":\\\"0.0029185400000000\\\",\\\"PMG\\\":\\\"0.0800599500000000\\\",\\\"OPAI\\\":\\\"0.0006826585000000\\\",\\\"LOCUS\\\":\\\"0.0216591650000000\\\",\\\"CTA\\\":\\\"0.0825087250000000\\\",\\\"NIM\\\":\\\"0.0013673160000000\\\",\\\"CTC\\\":\\\"0.4033982000000000\\\",\\\"APE\\\":\\\"0.7035480500000000\\\",\\\"MERL\\\":\\\"0.2720639000000000\\\",\\\"JAM\\\":\\\"0.0004770613500000\\\",\\\"CTI\\\":\\\"0.0130314810000000\\\",\\\"APP\\\":\\\"0.0021989000000000\\\",\\\"APT\\\":\\\"9.9947001500000000\\\",\\\"WLDUP\\\":\\\"0.0093043455000000\\\",\\\"ZEND\\\":\\\"0.1280759300000000\\\",\\\"FIRE\\\":\\\"0.9113441000000000\\\",\\\"DENT\\\":\\\"0.0008630682500000\\\",\\\"PYTH\\\":\\\"0.3390603850000000\\\",\\\"LFT\\\":\\\"0.0155322300000000\\\",\\\"DPET\\\":\\\"0.0319040400000000\\\",\\\"ORDIDOWN\\\":\\\"0.3788105000000000\\\",\\\"KPOL\\\":\\\"0.0029175405000000\\\",\\\"ETHUP\\\":\\\"8.4971493000000032\\\",\\\"BAND\\\":\\\"1.0939527500000001\\\",\\\"POL\\\":\\\"0.3656171000000000\\\",\\\"ASTR\\\":\\\"0.0582608550000000\\\",\\\"NKN\\\":\\\"0.0691654000000000\\\",\\\"RSR\\\":\\\"0.0068055955000000\\\",\\\"DVPN\\\":\\\"0.0005979009000000\\\",\\\"TWT\\\":\\\"1.1119437500000000\\\",\\\"ARB\\\":\\\"0.5510243500000000\\\",\\\"CVC\\\":\\\"0.1409801746501747\\\",\\\"ARC\\\":\\\"0.0300849500000000\\\",\\\"XETA\\\":\\\"0.0022888550000000\\\",\\\"MTRG\\\":\\\"0.4007995000000000\\\",\\\"LOKA\\\":\\\"0.1867066000000000\\\",\\\"LPOOL\\\":\\\"0.0660069800000000\\\",\\\"TURBOS\\\":\\\"0.0034812585000000\\\",\\\"CVX\\\":\\\"1.7816087499999999\\\",\\\"ARX\\\":\\\"0.0007556220000000\\\",\\\"MPLX\\\":\\\"0.4355221300000000\\\",\\\"SUSHI\\\":\\\"0.7011492500000000\\\",\\\"NLK\\\":\\\"0.0114442750000000\\\",\\\"PEPE2\\\":\\\"0.0000000313843000\\\",\\\"WBTC\\\":\\\"66881.4425499645548419\\\",\\\"SUI3L\\\":\\\"0.0211204345000000\\\",\\\"CWS\\\":\\\"0.1927036000000000\\\",\\\"SUI3S\\\":\\\"0.0000579110300000\\\",\\\"INSP\\\":\\\"0.0264167850000000\\\",\\\"MANA\\\":\\\"0.2945026750000000\\\",\\\"VRTX\\\":\\\"0.0641679000000000\\\",\\\"CSPR\\\":\\\"0.0116441750000000\\\",\\\"ATA\\\":\\\"0.0785007300000000\\\",\\\"OPEN\\\":\\\"0.0080049955000000\\\",\\\"HAI\\\":\\\"0.0448275750000000\\\",\\\"NMR\\\":\\\"14.7436245000000072\\\",\\\"ATH\\\":\\\"0.0540929400000000\\\",\\\"LIT\\\":\\\"0.6282857000000000\\\",\\\"TLOS\\\":\\\"0.3263467450000000\\\",\\\"TNSR\\\":\\\"0.3662168000000000\\\",\\\"CXT\\\":\\\"0.0871364100000000\\\",\\\"POLYX\\\":\\\"0.2346826000000000\\\",\\\"ZERO\\\":\\\"0.0002507745500000\\\",\\\"ROUTE\\\":\\\"0.0610694500000000\\\",\\\"LOOM\\\":\\\"0.0580009850000000\\\",\\\"PRE\\\":\\\"0.0078680640000000\\\",\\\"VRAUP\\\":\\\"0.0134652640000000\\\",\\\"HBB\\\":\\\"0.0714742450000000\\\",\\\"RVN\\\":\\\"0.0165017450000000\\\",\\\"PRQ\\\":\\\"0.0715741950000000\\\",\\\"ONDO\\\":\\\"0.7134930750000000\\\",\\\"PEPEDOWN\\\":\\\"0.0000155022450000\\\",\\\"WOOP\\\":\\\"0.0020179905000000\\\",\\\"LUNCUP\\\":\\\"0.0168355780000000\\\",\\\"KAVA\\\":\\\"0.3522238000000000\\\",\\\"LKI\\\":\\\"0.0104187880000000\\\",\\\"AVA\\\":\\\"0.4857570000000000\\\",\\\"NOM\\\":\\\"0.0233883000000000\\\",\\\"MAPO\\\":\\\"0.0089015470000000\\\",\\\"PEPEUP\\\":\\\"0.0114252845000000\\\",\\\"STRAX\\\":\\\"0.0487156300000000\\\",\\\"NOT\\\":\\\"0.0078670645000000\\\",\\\"ZERC\\\":\\\"0.1108245600000000\\\",\\\"BCUT\\\":\\\"0.0255672100000000\\\",\\\"MASA\\\":\\\"0.0691354150000000\\\",\\\"WAN\\\":\\\"0.1785077544737212\\\",\\\"WAT\\\":\\\"0.0003273762300000\\\",\\\"WAX\\\":\\\"0.0327636100000000\\\",\\\"MASK\\\":\\\"2.2259864500000002\\\",\\\"EOS3L\\\":\\\"0.0002122138400000\\\",\\\"IDEA\\\":\\\"0.0005887055000000\\\",\\\"EOS3S\\\":\\\"0.0034472755000000\\\",\\\"YFI\\\":\\\"4919.4290549999908843\\\",\\\"MOODENG\\\":\\\"0.0774612500000000\\\",\\\"XCUR\\\":\\\"0.0048845565000000\\\",\\\"HYDRA\\\":\\\"0.2225886500000000\\\",\\\"POPCAT\\\":\\\"1.3382305500000000\\\",\\\"LQTY\\\":\\\"0.7848074000000000\\\",\\\"PIXEL\\\":\\\"0.1406596350000000\\\",\\\"LMR\\\":\\\"0.0145437245000000\\\",\\\"ZETA\\\":\\\"0.5997999500000000\\\",\\\"YGG\\\":\\\"0.4717640000000000\\\",\\\"AXS\\\":\\\"4.6006985000000006\\\",\\\"BCHSV\\\":\\\"49.8250749999999370\\\",\\\"NRN\\\":\\\"0.0395802000000000\\\",\\\"FTON\\\":\\\"0.0091954000000000\\\",\\\"COMP\\\":\\\"43.6581599999999881\\\",\\\"XPRT\\\":\\\"0.1819090000000000\\\",\\\"HFT\\\":\\\"0.1443278000000000\\\",\\\"UXLINK\\\":\\\"0.5085456000000000\\\",\\\"STAMP\\\":\\\"0.0335032400000000\\\",\\\"RUNE\\\":\\\"4.9233370999999996\\\",\\\"ZEUS\\\":\\\"0.2587705500000000\\\",\\\"LTC3L\\\":\\\"1.8294848000000001\\\",\\\"DAPP\\\":\\\"0.1763118000000000\\\",\\\"FORTH\\\":\\\"2.9508238500000004\\\",\\\"ALPINE\\\":\\\"1.5322335000000000\\\",\\\"SENSO\\\":\\\"0.0328835500000000\\\",\\\"LTC3S\\\":\\\"0.0006986505000000\\\",\\\"DEXE\\\":\\\"8.3795081500000028\\\",\\\"GOAL\\\":\\\"0.0175912000000000\\\",\\\"AVAX\\\":\\\"27.5602130000000058\\\",\\\"LISTA\\\":\\\"0.3782108000000000\\\",\\\"AMPL\\\":\\\"1.3743124999999999\\\",\\\"WORK\\\":\\\"0.1384307500000000\\\",\\\"BRWL\\\":\\\"0.0017391300000000\\\",\\\"BANANA\\\":\\\"57.1314200000001362\\\",\\\"PUSH\\\":\\\"0.0750624500000000\\\",\\\"WEN\\\":\\\"0.0001015492000000\\\",\\\"NEIRO\\\":\\\"0.0879560000000000\\\",\\\"BTCUP\\\":\\\"34.7711057499999789\\\",\\\"SOL3S\\\":\\\"0.0007816090000000\\\",\\\"BRAWL\\\":\\\"0.0004776610500000\\\",\\\"LAY3R\\\":\\\"0.2161918500000000\\\",\\\"LPT\\\":\\\"11.9304317999999945\\\",\\\"GODS\\\":\\\"0.1807096000000000\\\",\\\"SAND3S\\\":\\\"4.6152911999999992\\\",\\\"RDNT\\\":\\\"0.0640679500000000\\\",\\\"SOL3L\\\":\\\"1.8351913752850000\\\",\\\"NIBI\\\":\\\"0.0653772950000000\\\",\\\"NUM\\\":\\\"0.0436181800000000\\\",\\\"PYR\\\":\\\"2.5590198499999997\\\",\\\"DAG\\\":\\\"0.0226176855000000\\\",\\\"DAI\\\":\\\"0.9989006596042375\\\",\\\"HIP\\\":\\\"0.0034982500000000\\\",\\\"DAO\\\":\\\"0.2848575000000000\\\",\\\"AVAIL\\\":\\\"0.1300929210000000\\\",\\\"DAR\\\":\\\"0.1512243500000000\\\",\\\"FET\\\":\\\"1.3760116500000000\\\",\\\"FCON\\\":\\\"0.0001197600900000\\\",\\\"XAVA\\\":\\\"0.3789104500000000\\\",\\\"LRC\\\":\\\"0.1208395500000000\\\",\\\"UNI3S\\\":\\\"0.0000653573050000\\\",\\\"PZP\\\":\\\"0.0599600050000000\\\",\\\"POKT\\\":\\\"0.0424787500000000\\\",\\\"DASH\\\":\\\"23.6881500000000109\\\",\\\"BAKEDOWN\\\":\\\"0.0003324636850000\\\",\\\"POLC\\\":\\\"0.0061389290000000\\\",\\\"DBR\\\":\\\"0.0377671070000000\\\",\\\"CIRUS\\\":\\\"0.0055772100000000\\\",\\\"UNI3L\\\":\\\"0.0993921490650000\\\",\\\"NWC\\\":\\\"0.0681659000000000\\\",\\\"POLK\\\":\\\"0.0142628650000000\\\",\\\"LSD\\\":\\\"0.9420287500000000\\\",\\\"MARS4\\\":\\\"0.0005878059500000\\\",\\\"LSK\\\":\\\"0.8080957500000000\\\",\\\"BLOCK\\\":\\\"0.0261869000000000\\\",\\\"ANALOS\\\":\\\"0.0000446776500000\\\",\\\"SAFE\\\":\\\"0.8779608000000000\\\",\\\"DCK\\\":\\\"0.0234082900000000\\\",\\\"LSS\\\":\\\"0.0562718500000000\\\",\\\"DCR\\\":\\\"12.4337799999999929\\\",\\\"LIKE\\\":\\\"0.0559720000000000\\\",\\\"DATA\\\":\\\"0.0361819000000000\\\",\\\"WIF\\\":\\\"2.5696145499999999\\\",\\\"BLOK\\\":\\\"0.0006546725000000\\\",\\\"LTC\\\":\\\"71.6261690000000611\\\",\\\"METIS\\\":\\\"42.0289750000000612\\\",\\\"WIN\\\":\\\"0.0000868365600000\\\",\\\"HLG\\\":\\\"0.0018790600000000\\\",\\\"LTO\\\":\\\"0.1166116650000000\\\",\\\"DYDX\\\":\\\"0.9341327000000000\\\",\\\"ARB3S\\\":\\\"0.0509025360000000\\\",\\\"MUBI\\\":\\\"0.0303848000000000\\\",\\\"ARB3L\\\":\\\"0.0025917035000000\\\",\\\"RBTC1\\\":\\\"0.0000039480250000\\\",\\\"POND\\\":\\\"0.0118640650000000\\\",\\\"LINA\\\":\\\"0.0037771105000000\\\",\\\"MYRIA\\\":\\\"0.0025337325000000\\\",\\\"LINK\\\":\\\"11.0244849999999944\\\",\\\"QTUM\\\":\\\"2.4262016723130069\\\",\\\"TUNE\\\":\\\"0.0148025950000000\\\",\\\"UFO\\\":\\\"0.0000006479758500\\\",\\\"CYBER\\\":\\\"2.8755615000000001\\\",\\\"WILD\\\":\\\"0.2433782500000000\\\",\\\"POLS\\\":\\\"0.2809594500000000\\\",\\\"NYM\\\":\\\"0.0719640000000000\\\",\\\"FIL\\\":\\\"3.6786597500000005\\\",\\\"BAL\\\":\\\"2.0099945000000000\\\",\\\"SCA\\\":\\\"0.3999999000000000\\\",\\\"STND\\\":\\\"0.0133123405000000\\\",\\\"WMTX\\\":\\\"0.2138930000000000\\\",\\\"SCLP\\\":\\\"0.1545227000000000\\\",\\\"MANEKI\\\":\\\"0.0073963000000000\\\",\\\"BAT\\\":\\\"0.1721139000000000\\\",\\\"AKRO\\\":\\\"0.0042302838000000\\\",\\\"FTM3L\\\":\\\"8.2574692000000024\\\",\\\"BAX\\\":\\\"0.0000709645000000\\\",\\\"FTM3S\\\":\\\"0.0000255072400000\\\",\\\"COTI\\\":\\\"0.0951524000000000\\\"}}", - "x-request-example": "{\\\"base\\\": \\\"USD\\\", \\\"currencies\\\": \\\"example_string_default_value\\\"}" + "x-request-example": "{\\\"base\\\": \\\"USD\\\", \\\"currencies\\\": \\\"example_string_default_value\\\"}", + "operationId": "012" } }, "/api/v1/market/stats": { @@ -5757,7 +5769,8 @@ "x-sdk-method-description": "Request via this endpoint to get the statistics of the specified ticker in the last 24 hours.", "x-api-rate-limit": 15, "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"time\\\":1729175612158,\\\"symbol\\\":\\\"BTC-USDT\\\",\\\"buy\\\":\\\"66982.4\\\",\\\"sell\\\":\\\"66982.5\\\",\\\"changeRate\\\":\\\"-0.0114\\\",\\\"changePrice\\\":\\\"-778.1\\\",\\\"high\\\":\\\"68107.7\\\",\\\"low\\\":\\\"66683.3\\\",\\\"vol\\\":\\\"1738.02898182\\\",\\\"volValue\\\":\\\"117321982.415978333\\\",\\\"last\\\":\\\"66981.5\\\",\\\"averagePrice\\\":\\\"67281.21437289\\\",\\\"takerFeeRate\\\":\\\"0.001\\\",\\\"makerFeeRate\\\":\\\"0.001\\\",\\\"takerCoefficient\\\":\\\"1\\\",\\\"makerCoefficient\\\":\\\"1\\\"}}", - "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\"}" + "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\"}", + "operationId": "013" } }, "/api/v1/markets": { @@ -5805,7 +5818,8 @@ "x-sdk-method-name": "getMarketList", "x-sdk-method-description": "Request via this endpoint to get the transaction currency for the entire trading market.", "x-api-rate-limit": 3, - "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":[\\\"USDS\\\",\\\"TON\\\",\\\"AI\\\",\\\"DePIN\\\",\\\"PoW\\\",\\\"BRC-20\\\",\\\"ETF\\\",\\\"KCS\\\",\\\"Meme\\\",\\\"Solana\\\",\\\"FIAT\\\",\\\"VR&AR\\\",\\\"DeFi\\\",\\\"Polkadot\\\",\\\"BTC\\\",\\\"ALTS\\\",\\\"Layer 1\\\"]}" + "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":[\\\"USDS\\\",\\\"TON\\\",\\\"AI\\\",\\\"DePIN\\\",\\\"PoW\\\",\\\"BRC-20\\\",\\\"ETF\\\",\\\"KCS\\\",\\\"Meme\\\",\\\"Solana\\\",\\\"FIAT\\\",\\\"VR&AR\\\",\\\"DeFi\\\",\\\"Polkadot\\\",\\\"BTC\\\",\\\"ALTS\\\",\\\"Layer 1\\\"]}", + "operationId": "014" } }, "/api/v1/timestamp": { @@ -5852,7 +5866,8 @@ "x-sdk-method-name": "getServerTime", "x-sdk-method-description": "Get the server time.", "x-api-rate-limit": 3, - "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":1729100692873}" + "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":1729100692873}", + "operationId": "015" } }, "/api/v1/status": { @@ -5933,7 +5948,8 @@ "x-sdk-method-name": "getServiceStatus", "x-sdk-method-description": "Get the service status", "x-api-rate-limit": 3, - "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"status\\\":\\\"open\\\",\\\"msg\\\":\\\"\\\"}}" + "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"status\\\":\\\"open\\\",\\\"msg\\\":\\\"\\\"}}", + "operationId": "016" } }, "/api/v1/hf/orders": { @@ -6181,7 +6197,8 @@ } }, "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"orderId\\\":\\\"670fd33bf9406e0007ab3945\\\",\\\"clientOid\\\":\\\"5c52e11203aa677f33e493fb\\\"}}", - "x-request-example": "{\\\"type\\\": \\\"limit\\\", \\\"symbol\\\": \\\"BTC-USDT\\\", \\\"side\\\": \\\"buy\\\", \\\"price\\\": \\\"50000\\\", \\\"size\\\": \\\"0.00001\\\", \\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\", \\\"remark\\\": \\\"order remarks\\\"}" + "x-request-example": "{\\\"type\\\": \\\"limit\\\", \\\"symbol\\\": \\\"BTC-USDT\\\", \\\"side\\\": \\\"buy\\\", \\\"price\\\": \\\"50000\\\", \\\"size\\\": \\\"0.00001\\\", \\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\", \\\"remark\\\": \\\"order remarks\\\"}", + "operationId": "017" }, "delete": { "summary": "Cancel All Orders By Symbol", @@ -6240,7 +6257,8 @@ "x-sdk-method-description": "This endpoint can cancel all spot orders for specific symbol. This endpoint only sends cancellation requests. The results of the requests must be obtained by checking the order status or subscribing to websocket.", "x-api-rate-limit": 2, "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":\\\"success\\\"}", - "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\"}" + "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\"}", + "operationId": "027" } }, "/api/v1/hf/orders/sync": { @@ -6539,7 +6557,8 @@ } }, "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"orderId\\\":\\\"67111a7cb7cbdf000703e1f6\\\",\\\"clientOid\\\":\\\"5c52e11203aa677f33e493f\\\",\\\"orderTime\\\":1729174140586,\\\"originSize\\\":\\\"0.00001\\\",\\\"dealSize\\\":\\\"0\\\",\\\"remainSize\\\":\\\"0.00001\\\",\\\"canceledSize\\\":\\\"0\\\",\\\"status\\\":\\\"open\\\",\\\"matchTime\\\":1729174140588}}", - "x-request-example": "{\\\"type\\\": \\\"limit\\\", \\\"symbol\\\": \\\"BTC-USDT\\\", \\\"side\\\": \\\"buy\\\", \\\"price\\\": \\\"50000\\\", \\\"size\\\": \\\"0.00001\\\", \\\"clientOid\\\": \\\"5c52e11203aa677f33e493f\\\", \\\"remark\\\": \\\"order remarks\\\"}" + "x-request-example": "{\\\"type\\\": \\\"limit\\\", \\\"symbol\\\": \\\"BTC-USDT\\\", \\\"side\\\": \\\"buy\\\", \\\"price\\\": \\\"50000\\\", \\\"size\\\": \\\"0.00001\\\", \\\"clientOid\\\": \\\"5c52e11203aa677f33e493f\\\", \\\"remark\\\": \\\"order remarks\\\"}", + "operationId": "018" } }, "/api/v1/hf/orders/test": { @@ -6787,7 +6806,8 @@ } }, "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"orderId\\\":\\\"670fd33bf9406e0007ab3945\\\",\\\"clientOid\\\":\\\"5c52e11203aa677f33e493fb\\\"}}", - "x-request-example": "{\\\"type\\\": \\\"limit\\\", \\\"symbol\\\": \\\"BTC-USDT\\\", \\\"side\\\": \\\"buy\\\", \\\"price\\\": \\\"50000\\\", \\\"size\\\": \\\"0.00001\\\", \\\"clientOid\\\": \\\"5c52e11203aa677f33e493f\\\", \\\"remark\\\": \\\"order remarks\\\"}" + "x-request-example": "{\\\"type\\\": \\\"limit\\\", \\\"symbol\\\": \\\"BTC-USDT\\\", \\\"side\\\": \\\"buy\\\", \\\"price\\\": \\\"50000\\\", \\\"size\\\": \\\"0.00001\\\", \\\"clientOid\\\": \\\"5c52e11203aa677f33e493f\\\", \\\"remark\\\": \\\"order remarks\\\"}", + "operationId": "019" } }, "/api/v1/hf/orders/multi": { @@ -7043,7 +7063,8 @@ } }, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": [\\n {\\n \\\"orderId\\\": \\\"6710d8336afcdb0007319c27\\\",\\n \\\"clientOid\\\": \\\"client order id 12\\\",\\n \\\"success\\\": true\\n },\\n {\\n \\\"success\\\": false,\\n \\\"failMsg\\\": \\\"The order funds should more then 0.1 USDT.\\\"\\n }\\n ]\\n}", - "x-request-example": "{\\\"orderList\\\": [{\\\"clientOid\\\": \\\"client order id 12\\\", \\\"symbol\\\": \\\"BTC-USDT\\\", \\\"type\\\": \\\"limit\\\", \\\"side\\\": \\\"buy\\\", \\\"price\\\": \\\"30000\\\", \\\"size\\\": \\\"0.00001\\\"}, {\\\"clientOid\\\": \\\"client order id 13\\\", \\\"symbol\\\": \\\"ETH-USDT\\\", \\\"type\\\": \\\"limit\\\", \\\"side\\\": \\\"sell\\\", \\\"price\\\": \\\"2000\\\", \\\"size\\\": \\\"0.00001\\\"}]}" + "x-request-example": "{\\\"orderList\\\": [{\\\"clientOid\\\": \\\"client order id 12\\\", \\\"symbol\\\": \\\"BTC-USDT\\\", \\\"type\\\": \\\"limit\\\", \\\"side\\\": \\\"buy\\\", \\\"price\\\": \\\"30000\\\", \\\"size\\\": \\\"0.00001\\\"}, {\\\"clientOid\\\": \\\"client order id 13\\\", \\\"symbol\\\": \\\"ETH-USDT\\\", \\\"type\\\": \\\"limit\\\", \\\"side\\\": \\\"sell\\\", \\\"price\\\": \\\"2000\\\", \\\"size\\\": \\\"0.00001\\\"}]}", + "operationId": "020" } }, "/api/v1/hf/orders/multi/sync": { @@ -7343,7 +7364,8 @@ } }, "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":[{\\\"orderId\\\":\\\"6711195e5584bc0007bd5aef\\\",\\\"clientOid\\\":\\\"client order id 13\\\",\\\"orderTime\\\":1729173854299,\\\"originSize\\\":\\\"0.00001\\\",\\\"dealSize\\\":\\\"0\\\",\\\"remainSize\\\":\\\"0.00001\\\",\\\"canceledSize\\\":\\\"0\\\",\\\"status\\\":\\\"open\\\",\\\"matchTime\\\":1729173854326,\\\"success\\\":true},{\\\"success\\\":false,\\\"failMsg\\\":\\\"The order funds should more then 0.1 USDT.\\\"}]}", - "x-request-example": "{\\\"orderList\\\": [{\\\"clientOid\\\": \\\"client order id 13\\\", \\\"symbol\\\": \\\"BTC-USDT\\\", \\\"type\\\": \\\"limit\\\", \\\"side\\\": \\\"buy\\\", \\\"price\\\": \\\"30000\\\", \\\"size\\\": \\\"0.00001\\\"}, {\\\"clientOid\\\": \\\"client order id 14\\\", \\\"symbol\\\": \\\"ETH-USDT\\\", \\\"type\\\": \\\"limit\\\", \\\"side\\\": \\\"sell\\\", \\\"price\\\": \\\"2000\\\", \\\"size\\\": \\\"0.00001\\\"}]}" + "x-request-example": "{\\\"orderList\\\": [{\\\"clientOid\\\": \\\"client order id 13\\\", \\\"symbol\\\": \\\"BTC-USDT\\\", \\\"type\\\": \\\"limit\\\", \\\"side\\\": \\\"buy\\\", \\\"price\\\": \\\"30000\\\", \\\"size\\\": \\\"0.00001\\\"}, {\\\"clientOid\\\": \\\"client order id 14\\\", \\\"symbol\\\": \\\"ETH-USDT\\\", \\\"type\\\": \\\"limit\\\", \\\"side\\\": \\\"sell\\\", \\\"price\\\": \\\"2000\\\", \\\"size\\\": \\\"0.00001\\\"}]}", + "operationId": "021" } }, "/api/v1/hf/orders/{orderId}": { @@ -7422,7 +7444,8 @@ "x-sdk-method-description": "This endpoint can be used to cancel a spot order by orderId. This endpoint only sends cancellation requests. The results of the requests must be obtained by checking the order status or subscribing to websocket.", "x-api-rate-limit": 1, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"orderId\\\": \\\"671124f9365ccb00073debd4\\\"\\n }\\n}", - "x-request-example": "{\\\"orderId\\\": \\\"671124f9365ccb00073debd4\\\", \\\"symbol\\\": \\\"BTC-USDT\\\"}" + "x-request-example": "{\\\"orderId\\\": \\\"671124f9365ccb00073debd4\\\", \\\"symbol\\\": \\\"BTC-USDT\\\"}", + "operationId": "022" }, "get": { "summary": "Get Order By OrderId", @@ -7752,7 +7775,8 @@ "x-sdk-method-description": "This endpoint can be used to obtain information for a single Spot order using the order id. After the user successfully places an order, the order is in Active state, and the user can use inOrderBook to determine whether the order has entered the order. Canceled or fully filled orders are marked as completed Done status.", "x-api-rate-limit": 2, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"id\\\": \\\"6717422bd51c29000775ea03\\\",\\n \\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\",\\n \\\"symbol\\\": \\\"BTC-USDT\\\",\\n \\\"opType\\\": \\\"DEAL\\\",\\n \\\"type\\\": \\\"limit\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"price\\\": \\\"70000\\\",\\n \\\"size\\\": \\\"0.00001\\\",\\n \\\"funds\\\": \\\"0.7\\\",\\n \\\"dealSize\\\": \\\"0.00001\\\",\\n \\\"dealFunds\\\": \\\"0.677176\\\",\\n \\\"remainSize\\\": \\\"0\\\",\\n \\\"remainFunds\\\": \\\"0.022824\\\",\\n \\\"cancelledSize\\\": \\\"0\\\",\\n \\\"cancelledFunds\\\": \\\"0\\\",\\n \\\"fee\\\": \\\"0.000677176\\\",\\n \\\"feeCurrency\\\": \\\"USDT\\\",\\n \\\"stp\\\": null,\\n \\\"timeInForce\\\": \\\"GTC\\\",\\n \\\"postOnly\\\": false,\\n \\\"hidden\\\": false,\\n \\\"iceberg\\\": false,\\n \\\"visibleSize\\\": \\\"0\\\",\\n \\\"cancelAfter\\\": 0,\\n \\\"channel\\\": \\\"API\\\",\\n \\\"remark\\\": \\\"order remarks\\\",\\n \\\"tags\\\": null,\\n \\\"cancelExist\\\": false,\\n \\\"tradeType\\\": \\\"TRADE\\\",\\n \\\"inOrderBook\\\": false,\\n \\\"active\\\": false,\\n \\\"tax\\\": \\\"0\\\",\\n \\\"createdAt\\\": 1729577515444,\\n \\\"lastUpdatedAt\\\": 1729577515481\\n }\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"orderId\\\": \\\"6717422bd51c29000775ea03\\\"}" + "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"orderId\\\": \\\"6717422bd51c29000775ea03\\\"}", + "operationId": "030" } }, "/api/v1/hf/orders/sync/{orderId}": { @@ -7872,7 +7896,8 @@ "x-sdk-method-description": "This endpoint can be used to cancel a spot order by orderId.", "x-api-rate-limit": 1, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"orderId\\\": \\\"671128ee365ccb0007534d45\\\",\\n \\\"originSize\\\": \\\"0.00001\\\",\\n \\\"dealSize\\\": \\\"0\\\",\\n \\\"remainSize\\\": \\\"0\\\",\\n \\\"canceledSize\\\": \\\"0.00001\\\",\\n \\\"status\\\": \\\"done\\\"\\n }\\n}", - "x-request-example": "{\\\"orderId\\\": \\\"671128ee365ccb0007534d45\\\", \\\"symbol\\\": \\\"BTC-USDT\\\"}" + "x-request-example": "{\\\"orderId\\\": \\\"671128ee365ccb0007534d45\\\", \\\"symbol\\\": \\\"BTC-USDT\\\"}", + "operationId": "023" } }, "/api/v1/hf/orders/client-order/{clientOid}": { @@ -7951,7 +7976,8 @@ "x-sdk-method-description": "This endpoint can be used to cancel a spot order by clientOid. This endpoint only sends cancellation requests. The results of the requests must be obtained by checking the order status or subscribing to websocket.", "x-api-rate-limit": 1, "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"clientOid\\\":\\\"5c52e11203aa677f33e493fb\\\"}}", - "x-request-example": "{\\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\", \\\"symbol\\\": \\\"BTC-USDT\\\"}" + "x-request-example": "{\\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\", \\\"symbol\\\": \\\"BTC-USDT\\\"}", + "operationId": "024" }, "get": { "summary": "Get Order By ClientOid", @@ -8281,7 +8307,8 @@ "x-sdk-method-description": "This endpoint can be used to obtain information for a single Spot order using the client order id. After the user successfully places an order, the order is in Active state, and the user can use inOrderBook to determine whether the order has entered the order. Canceled or fully filled orders are marked as completed Done status.", "x-api-rate-limit": 2, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"id\\\": \\\"6717422bd51c29000775ea03\\\",\\n \\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\",\\n \\\"symbol\\\": \\\"BTC-USDT\\\",\\n \\\"opType\\\": \\\"DEAL\\\",\\n \\\"type\\\": \\\"limit\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"price\\\": \\\"70000\\\",\\n \\\"size\\\": \\\"0.00001\\\",\\n \\\"funds\\\": \\\"0.7\\\",\\n \\\"dealSize\\\": \\\"0.00001\\\",\\n \\\"dealFunds\\\": \\\"0.677176\\\",\\n \\\"remainSize\\\": \\\"0\\\",\\n \\\"remainFunds\\\": \\\"0.022824\\\",\\n \\\"cancelledSize\\\": \\\"0\\\",\\n \\\"cancelledFunds\\\": \\\"0\\\",\\n \\\"fee\\\": \\\"0.000677176\\\",\\n \\\"feeCurrency\\\": \\\"USDT\\\",\\n \\\"stp\\\": null,\\n \\\"timeInForce\\\": \\\"GTC\\\",\\n \\\"postOnly\\\": false,\\n \\\"hidden\\\": false,\\n \\\"iceberg\\\": false,\\n \\\"visibleSize\\\": \\\"0\\\",\\n \\\"cancelAfter\\\": 0,\\n \\\"channel\\\": \\\"API\\\",\\n \\\"remark\\\": \\\"order remarks\\\",\\n \\\"tags\\\": null,\\n \\\"cancelExist\\\": false,\\n \\\"tradeType\\\": \\\"TRADE\\\",\\n \\\"inOrderBook\\\": false,\\n \\\"active\\\": false,\\n \\\"tax\\\": \\\"0\\\",\\n \\\"createdAt\\\": 1729577515444,\\n \\\"lastUpdatedAt\\\": 1729577515481\\n }\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\"}" + "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\"}", + "operationId": "031" } }, "/api/v1/hf/orders/sync/client-order/{clientOid}": { @@ -8401,7 +8428,8 @@ "x-sdk-method-description": "This endpoint can be used to cancel a spot order by orderId.", "x-api-rate-limit": 1, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\",\\n \\\"originSize\\\": \\\"0.00001\\\",\\n \\\"dealSize\\\": \\\"0\\\",\\n \\\"remainSize\\\": \\\"0\\\",\\n \\\"canceledSize\\\": \\\"0.00001\\\",\\n \\\"status\\\": \\\"done\\\"\\n }\\n}", - "x-request-example": "{\\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\", \\\"symbol\\\": \\\"BTC-USDT\\\"}" + "x-request-example": "{\\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\", \\\"symbol\\\": \\\"BTC-USDT\\\"}", + "operationId": "025" } }, "/api/v1/hf/orders/cancel/{orderId}": { @@ -8494,7 +8522,8 @@ "x-sdk-method-description": "This interface can cancel the specified quantity of the order according to the orderId. The order execution order is: price first, time first, this interface will not change the queue order", "x-api-rate-limit": 2, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"orderId\\\": \\\"6711f73c1ef16c000717bb31\\\",\\n \\\"cancelSize\\\": \\\"0.00001\\\"\\n }\\n}", - "x-request-example": "{\\\"orderId\\\": \\\"6711f73c1ef16c000717bb31\\\", \\\"symbol\\\": \\\"BTC-USDT\\\", \\\"cancelSize\\\": \\\"0.00001\\\"}" + "x-request-example": "{\\\"orderId\\\": \\\"6711f73c1ef16c000717bb31\\\", \\\"symbol\\\": \\\"BTC-USDT\\\", \\\"cancelSize\\\": \\\"0.00001\\\"}", + "operationId": "026" } }, "/api/v1/hf/orders/cancelAll": { @@ -8574,7 +8603,8 @@ "x-sdk-method-name": "cancelAllOrders", "x-sdk-method-description": "This endpoint can cancel all spot orders for all symbol. This endpoint only sends cancellation requests. The results of the requests must be obtained by checking the order status or subscribing to websocket.", "x-api-rate-limit": 30, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"succeedSymbols\\\": [\\n \\\"ETH-USDT\\\",\\n \\\"BTC-USDT\\\"\\n ],\\n \\\"failedSymbols\\\": []\\n }\\n}" + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"succeedSymbols\\\": [\\n \\\"ETH-USDT\\\",\\n \\\"BTC-USDT\\\"\\n ],\\n \\\"failedSymbols\\\": []\\n }\\n}", + "operationId": "028" } }, "/api/v1/hf/orders/alter": { @@ -8677,7 +8707,8 @@ } }, "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"newOrderId\\\":\\\"67112258f9406e0007408827\\\",\\\"clientOid\\\":\\\"client order id 12\\\"}}", - "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"orderId\\\": \\\"670fd33bf9406e0007ab3945\\\", \\\"newPrice\\\": \\\"30000\\\", \\\"newSize\\\": \\\"0.0001\\\"}" + "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"orderId\\\": \\\"670fd33bf9406e0007ab3945\\\", \\\"newPrice\\\": \\\"30000\\\", \\\"newSize\\\": \\\"0.0001\\\"}", + "operationId": "029" } }, "/api/v1/hf/orders/active/symbols": { @@ -8734,7 +8765,8 @@ "x-sdk-method-name": "getSymbolsWithOpenOrder", "x-sdk-method-description": "This interface can query all spot symbol that has active orders", "x-api-rate-limit": 2, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"symbols\\\": [\\n \\\"ETH-USDT\\\",\\n \\\"BTC-USDT\\\"\\n ]\\n }\\n}" + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"symbols\\\": [\\n \\\"ETH-USDT\\\",\\n \\\"BTC-USDT\\\"\\n ]\\n }\\n}", + "operationId": "032" } }, "/api/v1/hf/orders/active": { @@ -9060,7 +9092,8 @@ "x-sdk-method-description": "This interface is to obtain all Spot active order lists, and the return value of the active order interface is the paged data of all uncompleted order lists. The returned data is sorted in descending order according to the latest update time of the order. After the user successfully places an order, the order is in Active state, and the user can use inOrderBook to determine whether the order has entered the order. Canceled or fully filled orders are marked as completed Done status.", "x-api-rate-limit": 2, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": [\\n {\\n \\\"id\\\": \\\"67120bbef094e200070976f6\\\",\\n \\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\",\\n \\\"symbol\\\": \\\"BTC-USDT\\\",\\n \\\"opType\\\": \\\"DEAL\\\",\\n \\\"type\\\": \\\"limit\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"price\\\": \\\"50000\\\",\\n \\\"size\\\": \\\"0.00001\\\",\\n \\\"funds\\\": \\\"0.5\\\",\\n \\\"dealSize\\\": \\\"0\\\",\\n \\\"dealFunds\\\": \\\"0\\\",\\n \\\"fee\\\": \\\"0\\\",\\n \\\"feeCurrency\\\": \\\"USDT\\\",\\n \\\"stp\\\": null,\\n \\\"timeInForce\\\": \\\"GTC\\\",\\n \\\"postOnly\\\": false,\\n \\\"hidden\\\": false,\\n \\\"iceberg\\\": false,\\n \\\"visibleSize\\\": \\\"0\\\",\\n \\\"cancelAfter\\\": 0,\\n \\\"channel\\\": \\\"API\\\",\\n \\\"remark\\\": \\\"order remarks\\\",\\n \\\"tags\\\": \\\"order tags\\\",\\n \\\"cancelExist\\\": false,\\n \\\"tradeType\\\": \\\"TRADE\\\",\\n \\\"inOrderBook\\\": true,\\n \\\"cancelledSize\\\": \\\"0\\\",\\n \\\"cancelledFunds\\\": \\\"0\\\",\\n \\\"remainSize\\\": \\\"0.00001\\\",\\n \\\"remainFunds\\\": \\\"0.5\\\",\\n \\\"tax\\\": \\\"0\\\",\\n \\\"active\\\": true,\\n \\\"createdAt\\\": 1729235902748,\\n \\\"lastUpdatedAt\\\": 1729235909862\\n }\\n ]\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\"}" + "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\"}", + "operationId": "033" } }, "/api/v1/hf/orders/done": { @@ -9492,7 +9525,8 @@ "x-sdk-method-description": "This interface is to obtain all Spot closed order lists, and the return value of the active order interface is the paged data of all uncompleted order lists. The returned data is sorted in descending order according to the latest update time of the order. After the user successfully places an order, the order is in Active state, and the user can use inOrderBook to determine whether the order has entered the order. Canceled or fully filled orders are marked as completed Done status.", "x-api-rate-limit": 2, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"lastId\\\": 19814995255305,\\n \\\"items\\\": [\\n {\\n \\\"id\\\": \\\"6717422bd51c29000775ea03\\\",\\n \\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\",\\n \\\"symbol\\\": \\\"BTC-USDT\\\",\\n \\\"opType\\\": \\\"DEAL\\\",\\n \\\"type\\\": \\\"limit\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"price\\\": \\\"70000\\\",\\n \\\"size\\\": \\\"0.00001\\\",\\n \\\"funds\\\": \\\"0.7\\\",\\n \\\"dealSize\\\": \\\"0.00001\\\",\\n \\\"dealFunds\\\": \\\"0.677176\\\",\\n \\\"remainSize\\\": \\\"0\\\",\\n \\\"remainFunds\\\": \\\"0.022824\\\",\\n \\\"cancelledSize\\\": \\\"0\\\",\\n \\\"cancelledFunds\\\": \\\"0\\\",\\n \\\"fee\\\": \\\"0.000677176\\\",\\n \\\"feeCurrency\\\": \\\"USDT\\\",\\n \\\"stp\\\": null,\\n \\\"timeInForce\\\": \\\"GTC\\\",\\n \\\"postOnly\\\": false,\\n \\\"hidden\\\": false,\\n \\\"iceberg\\\": false,\\n \\\"visibleSize\\\": \\\"0\\\",\\n \\\"cancelAfter\\\": 0,\\n \\\"channel\\\": \\\"API\\\",\\n \\\"remark\\\": \\\"order remarks\\\",\\n \\\"tags\\\": null,\\n \\\"cancelExist\\\": false,\\n \\\"tradeType\\\": \\\"TRADE\\\",\\n \\\"inOrderBook\\\": false,\\n \\\"active\\\": false,\\n \\\"tax\\\": \\\"0\\\",\\n \\\"createdAt\\\": 1729577515444,\\n \\\"lastUpdatedAt\\\": 1729577515481\\n }\\n ]\\n }\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"side\\\": \\\"buy\\\", \\\"type\\\": \\\"limit\\\", \\\"lastId\\\": 254062248624417, \\\"limit\\\": 20, \\\"startAt\\\": 1728663338000, \\\"endAt\\\": 1728692138000}" + "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"side\\\": \\\"buy\\\", \\\"type\\\": \\\"limit\\\", \\\"lastId\\\": 254062248624417, \\\"limit\\\": 20, \\\"startAt\\\": 1728663338000, \\\"endAt\\\": 1728692138000}", + "operationId": "034" } }, "/api/v1/hf/fills": { @@ -9829,7 +9863,8 @@ "x-sdk-method-description": "This endpoint can be used to obtain a list of the latest Spot transaction details. The returned data is sorted in descending order according to the latest update time of the order.", "x-api-rate-limit": 2, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"items\\\": [\\n {\\n \\\"id\\\": 19814995255305,\\n \\\"orderId\\\": \\\"6717422bd51c29000775ea03\\\",\\n \\\"counterOrderId\\\": \\\"67174228135f9e000709da8c\\\",\\n \\\"tradeId\\\": 11029373945659392,\\n \\\"symbol\\\": \\\"BTC-USDT\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"liquidity\\\": \\\"taker\\\",\\n \\\"type\\\": \\\"limit\\\",\\n \\\"forceTaker\\\": false,\\n \\\"price\\\": \\\"67717.6\\\",\\n \\\"size\\\": \\\"0.00001\\\",\\n \\\"funds\\\": \\\"0.677176\\\",\\n \\\"fee\\\": \\\"0.000677176\\\",\\n \\\"feeRate\\\": \\\"0.001\\\",\\n \\\"feeCurrency\\\": \\\"USDT\\\",\\n \\\"stop\\\": \\\"\\\",\\n \\\"tradeType\\\": \\\"TRADE\\\",\\n \\\"taxRate\\\": \\\"0\\\",\\n \\\"tax\\\": \\\"0\\\",\\n \\\"createdAt\\\": 1729577515473\\n }\\n ],\\n \\\"lastId\\\": 19814995255305\\n }\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"orderId\\\": \\\"example_string_default_value\\\", \\\"side\\\": \\\"buy\\\", \\\"type\\\": \\\"limit\\\", \\\"lastId\\\": 254062248624417, \\\"limit\\\": 100, \\\"startAt\\\": 1728663338000, \\\"endAt\\\": 1728692138000}" + "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"orderId\\\": \\\"example_string_default_value\\\", \\\"side\\\": \\\"buy\\\", \\\"type\\\": \\\"limit\\\", \\\"lastId\\\": 254062248624417, \\\"limit\\\": 100, \\\"startAt\\\": 1728663338000, \\\"endAt\\\": 1728692138000}", + "operationId": "035" } }, "/api/v1/hf/orders/dead-cancel-all/query": { @@ -9894,7 +9929,8 @@ "x-sdk-method-name": "getDCP", "x-sdk-method-description": "Get Disconnection Protect(Deadman Swich)Through this interface, you can query the settings of automatic order cancellation", "x-api-rate-limit": 2, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"timeout\\\": 5,\\n \\\"symbols\\\": \\\"BTC-USDT,ETH-USDT\\\",\\n \\\"currentTime\\\": 1729241305,\\n \\\"triggerTime\\\": 1729241308\\n }\\n}" + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"timeout\\\": 5,\\n \\\"symbols\\\": \\\"BTC-USDT,ETH-USDT\\\",\\n \\\"currentTime\\\": 1729241305,\\n \\\"triggerTime\\\": 1729241308\\n }\\n}", + "operationId": "036" } }, "/api/v1/hf/orders/dead-cancel-all": { @@ -9981,7 +10017,8 @@ } }, "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"currentTime\\\":1729656588,\\\"triggerTime\\\":1729656593}}", - "x-request-example": "{\\\"timeout\\\": 5, \\\"symbols\\\": \\\"BTC-USDT,ETH-USDT\\\"}" + "x-request-example": "{\\\"timeout\\\": 5, \\\"symbols\\\": \\\"BTC-USDT,ETH-USDT\\\"}", + "operationId": "037" } }, "/api/v1/stop-order": { @@ -10234,7 +10271,8 @@ } }, "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"orderId\\\":\\\"670fd33bf9406e0007ab3945\\\",\\\"clientOid\\\":\\\"5c52e11203aa677f33e493fb\\\"}}", - "x-request-example": "{\\\"type\\\": \\\"limit\\\", \\\"symbol\\\": \\\"BTC-USDT\\\", \\\"side\\\": \\\"buy\\\", \\\"price\\\": \\\"50000\\\", \\\"size\\\": \\\"0.00001\\\", \\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\", \\\"remark\\\": \\\"order remarks\\\"}" + "x-request-example": "{\\\"type\\\": \\\"limit\\\", \\\"symbol\\\": \\\"BTC-USDT\\\", \\\"side\\\": \\\"buy\\\", \\\"price\\\": \\\"50000\\\", \\\"size\\\": \\\"0.00001\\\", \\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\", \\\"remark\\\": \\\"order remarks\\\"}", + "operationId": "038" }, "get": { "summary": "Get Stop Orders List", @@ -10548,7 +10586,8 @@ } }, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"currentPage\\\": 1,\\n \\\"pageSize\\\": 50,\\n \\\"totalNum\\\": 1,\\n \\\"totalPage\\\": 1,\\n \\\"items\\\": [\\n {\\n \\\"id\\\": \\\"vs8hoo8kqjnklv4m0038lrfq\\\",\\n \\\"symbol\\\": \\\"KCS-USDT\\\",\\n \\\"userId\\\": \\\"60fe4956c43cbc0006562c2c\\\",\\n \\\"status\\\": \\\"NEW\\\",\\n \\\"type\\\": \\\"limit\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"price\\\": \\\"0.01000000000000000000\\\",\\n \\\"size\\\": \\\"0.01000000000000000000\\\",\\n \\\"funds\\\": null,\\n \\\"stp\\\": null,\\n \\\"timeInForce\\\": \\\"GTC\\\",\\n \\\"cancelAfter\\\": -1,\\n \\\"postOnly\\\": false,\\n \\\"hidden\\\": false,\\n \\\"iceberg\\\": false,\\n \\\"visibleSize\\\": null,\\n \\\"channel\\\": \\\"API\\\",\\n \\\"clientOid\\\": \\\"404814a0fb4311eb9098acde48001122\\\",\\n \\\"remark\\\": null,\\n \\\"tags\\\": null,\\n \\\"orderTime\\\": 1628755183702150100,\\n \\\"domainId\\\": \\\"kucoin\\\",\\n \\\"tradeSource\\\": \\\"USER\\\",\\n \\\"tradeType\\\": \\\"TRADE\\\",\\n \\\"feeCurrency\\\": \\\"USDT\\\",\\n \\\"takerFeeRate\\\": \\\"0.00200000000000000000\\\",\\n \\\"makerFeeRate\\\": \\\"0.00200000000000000000\\\",\\n \\\"createdAt\\\": 1628755183704,\\n \\\"stop\\\": \\\"loss\\\",\\n \\\"stopTriggerTime\\\": null,\\n \\\"stopPrice\\\": \\\"10.00000000000000000000\\\"\\n }\\n ]\\n }\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"orderId\\\": \\\"670fd33bf9406e0007ab3945\\\", \\\"newPrice\\\": \\\"30000\\\", \\\"newSize\\\": \\\"0.0001\\\"}" + "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"orderId\\\": \\\"670fd33bf9406e0007ab3945\\\", \\\"newPrice\\\": \\\"30000\\\", \\\"newSize\\\": \\\"0.0001\\\"}", + "operationId": "042" } }, "/api/v1/stop-order/cancelOrderByClientOid": { @@ -10632,7 +10671,8 @@ "x-sdk-method-description": "This endpoint can be used to cancel a spot stop order by clientOid. ", "x-api-rate-limit": 5, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"cancelledOrderId\\\": \\\"vs8hoo8ksc8mario0035a74n\\\",\\n \\\"clientOid\\\": \\\"689ff597f4414061aa819cc414836abd\\\"\\n }\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"clientOid\\\": \\\"689ff597f4414061aa819cc414836abd\\\"}" + "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"clientOid\\\": \\\"689ff597f4414061aa819cc414836abd\\\"}", + "operationId": "039" } }, "/api/v1/stop-order/{orderId}": { @@ -10700,7 +10740,8 @@ "x-sdk-method-description": "This endpoint can be used to cancel a spot stop order by orderId. ", "x-api-rate-limit": 3, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"cancelledOrderIds\\\": [\\n \\\"671124f9365ccb00073debd4\\\"\\n ]\\n }\\n}", - "x-request-example": "{\\\"orderId\\\": \\\"671124f9365ccb00073debd4\\\"}" + "x-request-example": "{\\\"orderId\\\": \\\"671124f9365ccb00073debd4\\\"}", + "operationId": "040" }, "get": { "summary": "Get Stop Order By OrderId", @@ -10885,7 +10926,8 @@ "x-sdk-method-description": "This interface is to obtain Spot stop order details by orderId", "x-api-rate-limit": 3, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"id\\\": \\\"vs8hoo8q2ceshiue003b67c0\\\",\\n \\\"symbol\\\": \\\"KCS-USDT\\\",\\n \\\"userId\\\": \\\"60fe4956c43cbc0006562c2c\\\",\\n \\\"status\\\": \\\"NEW\\\",\\n \\\"type\\\": \\\"limit\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"price\\\": \\\"0.01000000000000000000\\\",\\n \\\"size\\\": \\\"0.01000000000000000000\\\",\\n \\\"funds\\\": null,\\n \\\"stp\\\": null,\\n \\\"timeInForce\\\": \\\"GTC\\\",\\n \\\"cancelAfter\\\": -1,\\n \\\"postOnly\\\": false,\\n \\\"hidden\\\": false,\\n \\\"iceberg\\\": false,\\n \\\"visibleSize\\\": null,\\n \\\"channel\\\": \\\"API\\\",\\n \\\"clientOid\\\": \\\"40e0eb9efe6311eb8e58acde48001122\\\",\\n \\\"remark\\\": null,\\n \\\"tags\\\": null,\\n \\\"orderTime\\\": 1629098781127530200,\\n \\\"domainId\\\": \\\"kucoin\\\",\\n \\\"tradeSource\\\": \\\"USER\\\",\\n \\\"tradeType\\\": \\\"TRADE\\\",\\n \\\"feeCurrency\\\": \\\"USDT\\\",\\n \\\"takerFeeRate\\\": \\\"0.00200000000000000000\\\",\\n \\\"makerFeeRate\\\": \\\"0.00200000000000000000\\\",\\n \\\"createdAt\\\": 1629098781128,\\n \\\"stop\\\": \\\"loss\\\",\\n \\\"stopTriggerTime\\\": null,\\n \\\"stopPrice\\\": \\\"10.00000000000000000000\\\"\\n }\\n}", - "x-request-example": "{\\\"orderId\\\": \\\"example_string_default_value\\\"}" + "x-request-example": "{\\\"orderId\\\": \\\"example_string_default_value\\\"}", + "operationId": "043" } }, "/api/v1/stop-order/cancel": { @@ -10971,7 +11013,8 @@ "x-sdk-method-description": "This endpoint can be used to cancel a spot stop orders by batch.", "x-api-rate-limit": 3, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"cancelledOrderIds\\\": [\\n \\\"671124f9365ccb00073debd4\\\"\\n ]\\n }\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"example_string_default_value\\\", \\\"tradeType\\\": \\\"example_string_default_value\\\", \\\"orderIds\\\": \\\"example_string_default_value\\\"}" + "x-request-example": "{\\\"symbol\\\": \\\"example_string_default_value\\\", \\\"tradeType\\\": \\\"example_string_default_value\\\", \\\"orderIds\\\": \\\"example_string_default_value\\\"}", + "operationId": "041" } }, "/api/v1/stop-order/queryOrderByClientOid": { @@ -11170,7 +11213,8 @@ "x-sdk-method-description": "This interface is to obtain Spot stop order details by orderId", "x-api-rate-limit": 3, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": [\\n {\\n \\\"id\\\": \\\"vs8hoo8os561f5np0032vngj\\\",\\n \\\"symbol\\\": \\\"KCS-USDT\\\",\\n \\\"userId\\\": \\\"60fe4956c43cbc0006562c2c\\\",\\n \\\"status\\\": \\\"NEW\\\",\\n \\\"type\\\": \\\"limit\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"price\\\": \\\"0.01000000000000000000\\\",\\n \\\"size\\\": \\\"0.01000000000000000000\\\",\\n \\\"funds\\\": null,\\n \\\"stp\\\": null,\\n \\\"timeInForce\\\": \\\"GTC\\\",\\n \\\"cancelAfter\\\": -1,\\n \\\"postOnly\\\": false,\\n \\\"hidden\\\": false,\\n \\\"iceberg\\\": false,\\n \\\"visibleSize\\\": null,\\n \\\"channel\\\": \\\"API\\\",\\n \\\"clientOid\\\": \\\"2b700942b5db41cebe578cff48960e09\\\",\\n \\\"remark\\\": null,\\n \\\"tags\\\": null,\\n \\\"orderTime\\\": 1629020492834532600,\\n \\\"domainId\\\": \\\"kucoin\\\",\\n \\\"tradeSource\\\": \\\"USER\\\",\\n \\\"tradeType\\\": \\\"TRADE\\\",\\n \\\"feeCurrency\\\": \\\"USDT\\\",\\n \\\"takerFeeRate\\\": \\\"0.00200000000000000000\\\",\\n \\\"makerFeeRate\\\": \\\"0.00200000000000000000\\\",\\n \\\"createdAt\\\": 1629020492837,\\n \\\"stop\\\": \\\"loss\\\",\\n \\\"stopTriggerTime\\\": null,\\n \\\"stopPrice\\\": \\\"1.00000000000000000000\\\"\\n }\\n ]\\n}", - "x-request-example": "{\\\"clientOid\\\": \\\"example_string_default_value\\\", \\\"symbol\\\": \\\"example_string_default_value\\\"}" + "x-request-example": "{\\\"clientOid\\\": \\\"example_string_default_value\\\", \\\"symbol\\\": \\\"example_string_default_value\\\"}", + "operationId": "044" } }, "/api/v3/oco/order": { @@ -11319,7 +11363,8 @@ } }, "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"orderId\\\":\\\"674c316e688dea0007c7b986\\\"}}", - "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"side\\\": \\\"buy\\\", \\\"price\\\": \\\"94000\\\", \\\"size\\\": \\\"0.1\\\", \\\"clientOid\\\": \\\"5c52e11203aa67f1e493fb\\\", \\\"stopPrice\\\": \\\"98000\\\", \\\"limitPrice\\\": \\\"96000\\\", \\\"remark\\\": \\\"this is remark\\\", \\\"tradeType\\\": \\\"TRADE\\\"}" + "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"side\\\": \\\"buy\\\", \\\"price\\\": \\\"94000\\\", \\\"size\\\": \\\"0.1\\\", \\\"clientOid\\\": \\\"5c52e11203aa67f1e493fb\\\", \\\"stopPrice\\\": \\\"98000\\\", \\\"limitPrice\\\": \\\"96000\\\", \\\"remark\\\": \\\"this is remark\\\", \\\"tradeType\\\": \\\"TRADE\\\"}", + "operationId": "045" } }, "/api/v3/oco/order/{orderId}": { @@ -11387,7 +11432,8 @@ "x-sdk-method-description": "This endpoint can be used to cancel a spot order by orderId. This endpoint only sends cancellation requests. The results of the requests must be obtained by checking the order status or subscribing to websocket.", "x-api-rate-limit": 3, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"cancelledOrderIds\\\": [\\n \\\"vs93gpqc6kkmkk57003gok16\\\",\\n \\\"vs93gpqc6kkmkk57003gok17\\\"\\n ]\\n }\\n}", - "x-request-example": "{\\\"orderId\\\": \\\"674c316e688dea0007c7b986\\\"}" + "x-request-example": "{\\\"orderId\\\": \\\"674c316e688dea0007c7b986\\\"}", + "operationId": "046" }, "get": { "summary": "Get OCO Order By OrderId", @@ -11499,7 +11545,8 @@ "x-sdk-method-description": "Request via this interface to get a oco order information via the order ID.", "x-api-rate-limit": 2, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"orderId\\\": \\\"674c3b6e688dea0007c7bab2\\\",\\n \\\"symbol\\\": \\\"BTC-USDT\\\",\\n \\\"clientOid\\\": \\\"5c52e1203aa6f37f1e493fb\\\",\\n \\\"orderTime\\\": 1733049198863,\\n \\\"status\\\": \\\"NEW\\\"\\n }\\n}", - "x-request-example": "{\\\"orderId\\\": \\\"674c3b6e688dea0007c7bab2\\\"}" + "x-request-example": "{\\\"orderId\\\": \\\"674c3b6e688dea0007c7bab2\\\"}", + "operationId": "049" } }, "/api/v3/oco/client-order/{clientOid}": { @@ -11567,7 +11614,8 @@ "x-sdk-method-description": "Request via this interface to cancel a stop order via the clientOid. You will receive cancelledOrderIds field once the system has received the cancellation request. The cancellation request will be processed by the matching engine in sequence. To know if the request is processed (successfully or not), you may check the order status or the update message from the pushes.", "x-api-rate-limit": 3, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"cancelledOrderIds\\\": [\\n \\\"vs93gpqc6r0mkk57003gok3h\\\",\\n \\\"vs93gpqc6r0mkk57003gok3i\\\"\\n ]\\n }\\n}", - "x-request-example": "{\\\"clientOid\\\": \\\"5c52e11203aa67f1e493fb\\\"}" + "x-request-example": "{\\\"clientOid\\\": \\\"5c52e11203aa67f1e493fb\\\"}", + "operationId": "047" }, "get": { "summary": "Get OCO Order By ClientOid", @@ -11651,7 +11699,8 @@ "x-sdk-method-description": "Request via this interface to get a oco order information via the client order ID.", "x-api-rate-limit": 2, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"orderId\\\": \\\"674c3cfa72cf2800072ee7ce\\\",\\n \\\"symbol\\\": \\\"BTC-USDT\\\",\\n \\\"clientOid\\\": \\\"5c52e1203aa6f3g7f1e493fb\\\",\\n \\\"orderTime\\\": 1733049594803,\\n \\\"status\\\": \\\"NEW\\\"\\n }\\n}", - "x-request-example": "{\\\"clientOid\\\": \\\"5c52e1203aa6f3g7f1e493fb\\\"}" + "x-request-example": "{\\\"clientOid\\\": \\\"5c52e1203aa6f3g7f1e493fb\\\"}", + "operationId": "050" } }, "/api/v3/oco/orders": { @@ -11728,7 +11777,8 @@ "x-sdk-method-description": "This interface can batch cancel OCO orders through orderIds. You will receive cancelledOrderIds field once the system has received the cancellation request. The cancellation request will be processed by the matching engine in sequence. To know if the request is processed (successfully or not), you may check the order status or the update message from the pushes.", "x-api-rate-limit": 3, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"cancelledOrderIds\\\": [\\n \\\"vs93gpqc750mkk57003gok6i\\\",\\n \\\"vs93gpqc750mkk57003gok6j\\\",\\n \\\"vs93gpqc75c39p83003tnriu\\\",\\n \\\"vs93gpqc75c39p83003tnriv\\\"\\n ]\\n }\\n}", - "x-request-example": "{\\\"orderIds\\\": \\\"674c388172cf2800072ee746,674c38bdfd8300000795167e\\\", \\\"symbol\\\": \\\"BTC-USDT\\\"}" + "x-request-example": "{\\\"orderIds\\\": \\\"674c388172cf2800072ee746,674c38bdfd8300000795167e\\\", \\\"symbol\\\": \\\"BTC-USDT\\\"}", + "operationId": "048" }, "get": { "summary": "Get OCO Order List", @@ -11923,7 +11973,8 @@ "x-sdk-method-description": "Request via this endpoint to get your current OCO order list. Items are paginated and sorted to show the latest first. See the Pagination section for retrieving additional entries after the first page.", "x-api-rate-limit": 2, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"currentPage\\\": 1,\\n \\\"pageSize\\\": 50,\\n \\\"totalNum\\\": 1,\\n \\\"totalPage\\\": 1,\\n \\\"items\\\": [\\n {\\n \\\"orderId\\\": \\\"674c3cfa72cf2800072ee7ce\\\",\\n \\\"symbol\\\": \\\"BTC-USDT\\\",\\n \\\"clientOid\\\": \\\"5c52e1203aa6f3g7f1e493fb\\\",\\n \\\"orderTime\\\": 1733049594803,\\n \\\"status\\\": \\\"NEW\\\"\\n }\\n ]\\n }\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"startAt\\\": 123456, \\\"endAt\\\": 123456, \\\"orderIds\\\": \\\"example_string_default_value\\\", \\\"pageSize\\\": 50, \\\"currentPage\\\": 1}" + "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"startAt\\\": 123456, \\\"endAt\\\": 123456, \\\"orderIds\\\": \\\"example_string_default_value\\\", \\\"pageSize\\\": 50, \\\"currentPage\\\": 1}", + "operationId": "052" } }, "/api/v3/oco/order/details/{orderId}": { @@ -12048,7 +12099,8 @@ "x-sdk-method-description": "Request via this interface to get a oco order detail via the order ID.", "x-api-rate-limit": 2, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"orderId\\\": \\\"674c3b6e688dea0007c7bab2\\\",\\n \\\"symbol\\\": \\\"BTC-USDT\\\",\\n \\\"clientOid\\\": \\\"5c52e1203aa6f37f1e493fb\\\",\\n \\\"orderTime\\\": 1733049198863,\\n \\\"status\\\": \\\"NEW\\\",\\n \\\"orders\\\": [\\n {\\n \\\"id\\\": \\\"vs93gpqc7dn6h3fa003sfelj\\\",\\n \\\"symbol\\\": \\\"BTC-USDT\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"price\\\": \\\"94000.00000000000000000000\\\",\\n \\\"stopPrice\\\": \\\"94000.00000000000000000000\\\",\\n \\\"size\\\": \\\"0.10000000000000000000\\\",\\n \\\"status\\\": \\\"NEW\\\"\\n },\\n {\\n \\\"id\\\": \\\"vs93gpqc7dn6h3fa003sfelk\\\",\\n \\\"symbol\\\": \\\"BTC-USDT\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"price\\\": \\\"96000.00000000000000000000\\\",\\n \\\"stopPrice\\\": \\\"98000.00000000000000000000\\\",\\n \\\"size\\\": \\\"0.10000000000000000000\\\",\\n \\\"status\\\": \\\"NEW\\\"\\n }\\n ]\\n }\\n}", - "x-request-example": "{\\\"orderId\\\": \\\"674c3b6e688dea0007c7bab2\\\"}" + "x-request-example": "{\\\"orderId\\\": \\\"674c3b6e688dea0007c7bab2\\\"}", + "operationId": "051" } }, "/api/v1/bullet-public": { @@ -12148,7 +12200,8 @@ "x-sdk-method-name": "getPublicToken", "x-sdk-method-description": "This interface can obtain the token required for websocket to establish a Spot/Margin connection. If you need use public channels (e.g. all public market data), please make request as follows to obtain the server list and public token", "x-api-rate-limit": 10, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"token\\\": \\\"2neAiuYvAU61ZDXANAGAsiL4-iAExhsBXZxftpOeh_55i3Ysy2q2LEsEWU64mdzUOPusi34M_wGoSf7iNyEWJ93g2WHl-j4M7tCZ_S21PuIByWXUJFDywtiYB9J6i9GjsxUuhPw3Blq6rhZlGykT3Vp1phUafnulOOpts-MEmEF-3bpfetLOAq79RbGaLlE4JBvJHl5Vs9Y=.ymP9jIr6v-vucrZr8761yA==\\\",\\n \\\"instanceServers\\\": [\\n {\\n \\\"endpoint\\\": \\\"wss://ws-api-spot.kucoin.com/\\\",\\n \\\"encrypt\\\": true,\\n \\\"protocol\\\": \\\"websocket\\\",\\n \\\"pingInterval\\\": 18000,\\n \\\"pingTimeout\\\": 10000\\n }\\n ]\\n }\\n}" + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"token\\\": \\\"2neAiuYvAU61ZDXANAGAsiL4-iAExhsBXZxftpOeh_55i3Ysy2q2LEsEWU64mdzUOPusi34M_wGoSf7iNyEWJ93g2WHl-j4M7tCZ_S21PuIByWXUJFDywtiYB9J6i9GjsxUuhPw3Blq6rhZlGykT3Vp1phUafnulOOpts-MEmEF-3bpfetLOAq79RbGaLlE4JBvJHl5Vs9Y=.ymP9jIr6v-vucrZr8761yA==\\\",\\n \\\"instanceServers\\\": [\\n {\\n \\\"endpoint\\\": \\\"wss://ws-api-spot.kucoin.com/\\\",\\n \\\"encrypt\\\": true,\\n \\\"protocol\\\": \\\"websocket\\\",\\n \\\"pingInterval\\\": 18000,\\n \\\"pingTimeout\\\": 10000\\n }\\n ]\\n }\\n}", + "operationId": "053" } }, "/api/v1/bullet-private": { @@ -12248,7 +12301,8 @@ "x-sdk-method-name": "getPrivateToken", "x-sdk-method-description": "This interface can obtain the token required for websocket to establish a Spot/Margin private connection. If you need use private channels(e.g. account balance notice), please make request as follows to obtain the server list and private token", "x-api-rate-limit": 10, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"token\\\": \\\"2neAiuYvAU737TOajb2U3uT8AEZqSWYe0fBD4LoHuXJDSC7gIzJiH4kNTWhCPISWo6nDpAe7aUaaHJ4fG8oRjFgMfUI2sM4IySWHrBceFocY8pKy2REU1HwZIngtMdMrjqPnP-biofFWbNaP1cl0X1pZc2SQ-33hDH1LgNP-yg80ZJv_Ctaj8sAFhTOZ8m1L.jut4vBQxXAseWKxODdGVGg==\\\",\\n \\\"instanceServers\\\": [\\n {\\n \\\"endpoint\\\": \\\"wss://ws-api-spot.kucoin.com/\\\",\\n \\\"encrypt\\\": true,\\n \\\"protocol\\\": \\\"websocket\\\",\\n \\\"pingInterval\\\": 18000,\\n \\\"pingTimeout\\\": 10000\\n }\\n ]\\n }\\n}" + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"token\\\": \\\"2neAiuYvAU737TOajb2U3uT8AEZqSWYe0fBD4LoHuXJDSC7gIzJiH4kNTWhCPISWo6nDpAe7aUaaHJ4fG8oRjFgMfUI2sM4IySWHrBceFocY8pKy2REU1HwZIngtMdMrjqPnP-biofFWbNaP1cl0X1pZc2SQ-33hDH1LgNP-yg80ZJv_Ctaj8sAFhTOZ8m1L.jut4vBQxXAseWKxODdGVGg==\\\",\\n \\\"instanceServers\\\": [\\n {\\n \\\"endpoint\\\": \\\"wss://ws-api-spot.kucoin.com/\\\",\\n \\\"encrypt\\\": true,\\n \\\"protocol\\\": \\\"websocket\\\",\\n \\\"pingInterval\\\": 18000,\\n \\\"pingTimeout\\\": 10000\\n }\\n ]\\n }\\n}", + "operationId": "054" } }, "/api/v1/orders": { @@ -12506,7 +12560,8 @@ } }, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"orderId\\\": \\\"674a8635b38d120007709c0f\\\"\\n }\\n}", - "x-request-example": "{\\\"type\\\": \\\"limit\\\", \\\"symbol\\\": \\\"BTC-USDT\\\", \\\"side\\\": \\\"buy\\\", \\\"price\\\": \\\"50000\\\", \\\"size\\\": \\\"0.00001\\\", \\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\", \\\"remark\\\": \\\"order remarks\\\"}" + "x-request-example": "{\\\"type\\\": \\\"limit\\\", \\\"symbol\\\": \\\"BTC-USDT\\\", \\\"side\\\": \\\"buy\\\", \\\"price\\\": \\\"50000\\\", \\\"size\\\": \\\"0.00001\\\", \\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\", \\\"remark\\\": \\\"order remarks\\\"}", + "operationId": "055" }, "delete": { "summary": "Batch Cancel Order - Old", @@ -12608,7 +12663,8 @@ "x-sdk-method-description": "Request via this endpoint to cancel all open orders. The response is a list of ids of the canceled orders.", "x-api-rate-limit": 20, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"cancelledOrderIds\\\": [\\n \\\"674a8635b38d120007709c0f\\\",\\n \\\"674a8630439c100007d3bce1\\\"\\n ]\\n }\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"tradeType\\\": \\\"TRADE\\\"}" + "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"tradeType\\\": \\\"TRADE\\\"}", + "operationId": "060" }, "get": { "summary": "Get Orders List - Old", @@ -12981,7 +13037,8 @@ "x-sdk-method-description": "Request via this endpoint to get your current order list. The return value is the data after Pagination, sorted in descending order according to time.", "x-api-rate-limit": 2, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"currentPage\\\": 1,\\n \\\"pageSize\\\": 50,\\n \\\"totalNum\\\": 1,\\n \\\"totalPage\\\": 1,\\n \\\"items\\\": [\\n {\\n \\\"id\\\": \\\"674a9a872033a50007e2790d\\\",\\n \\\"symbol\\\": \\\"BTC-USDT\\\",\\n \\\"opType\\\": \\\"DEAL\\\",\\n \\\"type\\\": \\\"limit\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"price\\\": \\\"50000\\\",\\n \\\"size\\\": \\\"0.00001\\\",\\n \\\"funds\\\": \\\"0\\\",\\n \\\"dealFunds\\\": \\\"0\\\",\\n \\\"dealSize\\\": \\\"0\\\",\\n \\\"fee\\\": \\\"0\\\",\\n \\\"feeCurrency\\\": \\\"USDT\\\",\\n \\\"stp\\\": \\\"\\\",\\n \\\"stop\\\": \\\"\\\",\\n \\\"stopTriggered\\\": false,\\n \\\"stopPrice\\\": \\\"0\\\",\\n \\\"timeInForce\\\": \\\"GTC\\\",\\n \\\"postOnly\\\": false,\\n \\\"hidden\\\": false,\\n \\\"iceberg\\\": false,\\n \\\"visibleSize\\\": \\\"0\\\",\\n \\\"cancelAfter\\\": 0,\\n \\\"channel\\\": \\\"API\\\",\\n \\\"clientOid\\\": \\\"5c52e11203aa677f33e4923fb\\\",\\n \\\"remark\\\": \\\"order remarks\\\",\\n \\\"tags\\\": null,\\n \\\"isActive\\\": false,\\n \\\"cancelExist\\\": true,\\n \\\"createdAt\\\": 1732942471752,\\n \\\"tradeType\\\": \\\"TRADE\\\"\\n }\\n ]\\n }\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"status\\\": \\\"active\\\", \\\"side\\\": \\\"buy\\\", \\\"type\\\": \\\"limit\\\", \\\"tradeType\\\": \\\"TRADE\\\", \\\"startAt\\\": 123456, \\\"endAt\\\": 123456, \\\"currentPage\\\": 1, \\\"pageSize\\\": 50}" + "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"status\\\": \\\"active\\\", \\\"side\\\": \\\"buy\\\", \\\"type\\\": \\\"limit\\\", \\\"tradeType\\\": \\\"TRADE\\\", \\\"startAt\\\": 123456, \\\"endAt\\\": 123456, \\\"currentPage\\\": 1, \\\"pageSize\\\": 50}", + "operationId": "061" } }, "/api/v1/orders/test": { @@ -13239,7 +13296,8 @@ } }, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"orderId\\\": \\\"674a8776291d9e00074f1edf\\\"\\n }\\n}", - "x-request-example": "{\\\"type\\\": \\\"limit\\\", \\\"symbol\\\": \\\"BTC-USDT\\\", \\\"side\\\": \\\"buy\\\", \\\"price\\\": \\\"50000\\\", \\\"size\\\": \\\"0.00001\\\", \\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\", \\\"remark\\\": \\\"order remarks\\\"}" + "x-request-example": "{\\\"type\\\": \\\"limit\\\", \\\"symbol\\\": \\\"BTC-USDT\\\", \\\"side\\\": \\\"buy\\\", \\\"price\\\": \\\"50000\\\", \\\"size\\\": \\\"0.00001\\\", \\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\", \\\"remark\\\": \\\"order remarks\\\"}", + "operationId": "056" } }, "/api/v1/orders/multi": { @@ -13611,7 +13669,8 @@ } }, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"data\\\": [\\n {\\n \\\"symbol\\\": \\\"BTC-USDT\\\",\\n \\\"type\\\": \\\"limit\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"price\\\": \\\"50000\\\",\\n \\\"size\\\": \\\"0.0001\\\",\\n \\\"funds\\\": null,\\n \\\"stp\\\": \\\"\\\",\\n \\\"stop\\\": \\\"\\\",\\n \\\"stopPrice\\\": null,\\n \\\"timeInForce\\\": \\\"GTC\\\",\\n \\\"cancelAfter\\\": 0,\\n \\\"postOnly\\\": false,\\n \\\"hidden\\\": false,\\n \\\"iceberge\\\": false,\\n \\\"iceberg\\\": false,\\n \\\"visibleSize\\\": null,\\n \\\"channel\\\": \\\"API\\\",\\n \\\"id\\\": \\\"674a97dfef434f0007efc431\\\",\\n \\\"status\\\": \\\"success\\\",\\n \\\"failMsg\\\": null,\\n \\\"clientOid\\\": \\\"3d07008668054da6b3cb12e432c2b13a\\\"\\n },\\n {\\n \\\"symbol\\\": \\\"BTC-USDT\\\",\\n \\\"type\\\": \\\"limit\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"price\\\": \\\"49999\\\",\\n \\\"size\\\": \\\"0.0001\\\",\\n \\\"funds\\\": null,\\n \\\"stp\\\": \\\"\\\",\\n \\\"stop\\\": \\\"\\\",\\n \\\"stopPrice\\\": null,\\n \\\"timeInForce\\\": \\\"GTC\\\",\\n \\\"cancelAfter\\\": 0,\\n \\\"postOnly\\\": false,\\n \\\"hidden\\\": false,\\n \\\"iceberge\\\": false,\\n \\\"iceberg\\\": false,\\n \\\"visibleSize\\\": null,\\n \\\"channel\\\": \\\"API\\\",\\n \\\"id\\\": \\\"674a97dffb378b00077b9c20\\\",\\n \\\"status\\\": \\\"fail\\\",\\n \\\"failMsg\\\": \\\"Balance insufficient!\\\",\\n \\\"clientOid\\\": \\\"37245dbe6e134b5c97732bfb36cd4a9d\\\"\\n }\\n ]\\n }\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"orderList\\\": [{\\\"clientOid\\\": \\\"3d07008668054da6b3cb12e432c2b13a\\\", \\\"side\\\": \\\"buy\\\", \\\"type\\\": \\\"limit\\\", \\\"price\\\": \\\"50000\\\", \\\"size\\\": \\\"0.0001\\\"}, {\\\"clientOid\\\": \\\"37245dbe6e134b5c97732bfb36cd4a9d\\\", \\\"side\\\": \\\"buy\\\", \\\"type\\\": \\\"limit\\\", \\\"price\\\": \\\"49999\\\", \\\"size\\\": \\\"0.0001\\\"}]}" + "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"orderList\\\": [{\\\"clientOid\\\": \\\"3d07008668054da6b3cb12e432c2b13a\\\", \\\"side\\\": \\\"buy\\\", \\\"type\\\": \\\"limit\\\", \\\"price\\\": \\\"50000\\\", \\\"size\\\": \\\"0.0001\\\"}, {\\\"clientOid\\\": \\\"37245dbe6e134b5c97732bfb36cd4a9d\\\", \\\"side\\\": \\\"buy\\\", \\\"type\\\": \\\"limit\\\", \\\"price\\\": \\\"49999\\\", \\\"size\\\": \\\"0.0001\\\"}]}", + "operationId": "057" } }, "/api/v1/orders/{orderId}": { @@ -13692,7 +13751,8 @@ "x-sdk-method-description": "This endpoint can be used to cancel a spot order by orderId. This endpoint only sends cancellation requests. The results of the requests must be obtained by checking the order status or subscribing to websocket.", "x-api-rate-limit": 3, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"cancelledOrderIds\\\": [\\n \\\"674a97dfef434f0007efc431\\\"\\n ]\\n }\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"orderId\\\": \\\"674a97dfef434f0007efc431\\\"}" + "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"orderId\\\": \\\"674a97dfef434f0007efc431\\\"}", + "operationId": "058" }, "get": { "summary": "Get Order By OrderId - Old", @@ -13871,7 +13931,8 @@ "x-sdk-method-description": "Request via this endpoint to get a single order info by order ID.", "x-api-rate-limit": 2, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"id\\\": \\\"674a97dfef434f0007efc431\\\",\\n \\\"symbol\\\": \\\"BTC-USDT\\\",\\n \\\"opType\\\": \\\"DEAL\\\",\\n \\\"type\\\": \\\"limit\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"price\\\": \\\"50000\\\",\\n \\\"size\\\": \\\"0.0001\\\",\\n \\\"funds\\\": \\\"0\\\",\\n \\\"dealFunds\\\": \\\"0\\\",\\n \\\"dealSize\\\": \\\"0\\\",\\n \\\"fee\\\": \\\"0\\\",\\n \\\"feeCurrency\\\": \\\"USDT\\\",\\n \\\"stp\\\": \\\"\\\",\\n \\\"stop\\\": \\\"\\\",\\n \\\"stopTriggered\\\": false,\\n \\\"stopPrice\\\": \\\"0\\\",\\n \\\"timeInForce\\\": \\\"GTC\\\",\\n \\\"postOnly\\\": false,\\n \\\"hidden\\\": false,\\n \\\"iceberg\\\": false,\\n \\\"visibleSize\\\": \\\"0\\\",\\n \\\"cancelAfter\\\": 0,\\n \\\"channel\\\": \\\"API\\\",\\n \\\"clientOid\\\": \\\"3d07008668054da6b3cb12e432c2b13a\\\",\\n \\\"remark\\\": null,\\n \\\"tags\\\": null,\\n \\\"isActive\\\": false,\\n \\\"cancelExist\\\": true,\\n \\\"createdAt\\\": 1732941791518,\\n \\\"tradeType\\\": \\\"TRADE\\\"\\n }\\n}", - "x-request-example": "{\\\"orderId\\\": \\\"674a97dfef434f0007efc431\\\"}" + "x-request-example": "{\\\"orderId\\\": \\\"674a97dfef434f0007efc431\\\"}", + "operationId": "063" } }, "/api/v1/order/client-order/{clientOid}": { @@ -13958,7 +14019,8 @@ "x-sdk-method-description": "This endpoint can be used to cancel a spot order by clientOid. This endpoint only sends cancellation requests. The results of the requests must be obtained by checking the order status or subscribing to websocket.", "x-api-rate-limit": 3, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"cancelledOrderId\\\": \\\"674a9a872033a50007e2790d\\\",\\n \\\"clientOid\\\": \\\"5c52e11203aa677f33e4923fb\\\",\\n \\\"cancelledOcoOrderIds\\\": null\\n }\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"clientOid\\\": \\\"5c52e11203aa677f33e4923fb\\\"}" + "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"clientOid\\\": \\\"5c52e11203aa677f33e4923fb\\\"}", + "operationId": "059" }, "get": { "summary": "Get Order By ClientOid - Old", @@ -14137,7 +14199,8 @@ "x-sdk-method-description": "Request via this interface to check the information of a single active order via clientOid. The system will prompt that the order does not exists if the order does not exist or has been settled.", "x-api-rate-limit": 3, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"id\\\": \\\"674a97dfef434f0007efc431\\\",\\n \\\"symbol\\\": \\\"BTC-USDT\\\",\\n \\\"opType\\\": \\\"DEAL\\\",\\n \\\"type\\\": \\\"limit\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"price\\\": \\\"50000\\\",\\n \\\"size\\\": \\\"0.0001\\\",\\n \\\"funds\\\": \\\"0\\\",\\n \\\"dealFunds\\\": \\\"0\\\",\\n \\\"dealSize\\\": \\\"0\\\",\\n \\\"fee\\\": \\\"0\\\",\\n \\\"feeCurrency\\\": \\\"USDT\\\",\\n \\\"stp\\\": \\\"\\\",\\n \\\"stop\\\": \\\"\\\",\\n \\\"stopTriggered\\\": false,\\n \\\"stopPrice\\\": \\\"0\\\",\\n \\\"timeInForce\\\": \\\"GTC\\\",\\n \\\"postOnly\\\": false,\\n \\\"hidden\\\": false,\\n \\\"iceberg\\\": false,\\n \\\"visibleSize\\\": \\\"0\\\",\\n \\\"cancelAfter\\\": 0,\\n \\\"channel\\\": \\\"API\\\",\\n \\\"clientOid\\\": \\\"3d07008668054da6b3cb12e432c2b13a\\\",\\n \\\"remark\\\": null,\\n \\\"tags\\\": null,\\n \\\"isActive\\\": false,\\n \\\"cancelExist\\\": true,\\n \\\"createdAt\\\": 1732941791518,\\n \\\"tradeType\\\": \\\"TRADE\\\"\\n }\\n}", - "x-request-example": "{\\\"clientOid\\\": \\\"3d07008668054da6b3cb12e432c2b13a\\\"}" + "x-request-example": "{\\\"clientOid\\\": \\\"3d07008668054da6b3cb12e432c2b13a\\\"}", + "operationId": "064" } }, "/api/v1/limit/orders": { @@ -14334,7 +14397,8 @@ "x-sdk-method-description": "Request via this endpoint to get your current order list. The return value is the data after Pagination, sorted in descending order according to time.", "x-api-rate-limit": 3, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": [\\n {\\n \\\"id\\\": \\\"674a9a872033a50007e2790d\\\",\\n \\\"symbol\\\": \\\"BTC-USDT\\\",\\n \\\"opType\\\": \\\"DEAL\\\",\\n \\\"type\\\": \\\"limit\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"price\\\": \\\"50000\\\",\\n \\\"size\\\": \\\"0.00001\\\",\\n \\\"funds\\\": \\\"0\\\",\\n \\\"dealFunds\\\": \\\"0\\\",\\n \\\"dealSize\\\": \\\"0\\\",\\n \\\"fee\\\": \\\"0\\\",\\n \\\"feeCurrency\\\": \\\"USDT\\\",\\n \\\"stp\\\": \\\"\\\",\\n \\\"stop\\\": \\\"\\\",\\n \\\"stopTriggered\\\": false,\\n \\\"stopPrice\\\": \\\"0\\\",\\n \\\"timeInForce\\\": \\\"GTC\\\",\\n \\\"postOnly\\\": false,\\n \\\"hidden\\\": false,\\n \\\"iceberg\\\": false,\\n \\\"visibleSize\\\": \\\"0\\\",\\n \\\"cancelAfter\\\": 0,\\n \\\"channel\\\": \\\"API\\\",\\n \\\"clientOid\\\": \\\"5c52e11203aa677f33e4923fb\\\",\\n \\\"remark\\\": \\\"order remarks\\\",\\n \\\"tags\\\": null,\\n \\\"isActive\\\": false,\\n \\\"cancelExist\\\": true,\\n \\\"createdAt\\\": 1732942471752,\\n \\\"tradeType\\\": \\\"TRADE\\\"\\n }\\n ]\\n}", - "x-request-example": "{\\\"currentPage\\\": 1, \\\"pageSize\\\": 50}" + "x-request-example": "{\\\"currentPage\\\": 1, \\\"pageSize\\\": 50}", + "operationId": "062" } }, "/api/v1/fills": { @@ -14642,7 +14706,8 @@ "x-sdk-method-description": "Request via this endpoint to get the recent fills. The return value is the data after Pagination, sorted in descending order according to time.", "x-api-rate-limit": 10, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"currentPage\\\": 1,\\n \\\"pageSize\\\": 50,\\n \\\"totalNum\\\": 1,\\n \\\"totalPage\\\": 1,\\n \\\"items\\\": [\\n {\\n \\\"symbol\\\": \\\"DOGE-USDT\\\",\\n \\\"tradeId\\\": \\\"10862827223795713\\\",\\n \\\"orderId\\\": \\\"6745698ef4f1200007c561a8\\\",\\n \\\"counterOrderId\\\": \\\"6745695ef15b270007ac5076\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"liquidity\\\": \\\"taker\\\",\\n \\\"forceTaker\\\": false,\\n \\\"price\\\": \\\"0.40739\\\",\\n \\\"size\\\": \\\"10\\\",\\n \\\"funds\\\": \\\"4.0739\\\",\\n \\\"fee\\\": \\\"0.0040739\\\",\\n \\\"feeRate\\\": \\\"0.001\\\",\\n \\\"feeCurrency\\\": \\\"USDT\\\",\\n \\\"stop\\\": \\\"\\\",\\n \\\"tradeType\\\": \\\"TRADE\\\",\\n \\\"type\\\": \\\"market\\\",\\n \\\"createdAt\\\": 1732602254928\\n }\\n ]\\n }\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"orderId\\\": \\\"example_string_default_value\\\", \\\"side\\\": \\\"buy\\\", \\\"type\\\": \\\"limit\\\", \\\"tradeType\\\": \\\"TRADE\\\", \\\"startAt\\\": 1728663338000, \\\"endAt\\\": 1728692138000, \\\"currentPage\\\": 1, \\\"pageSize\\\": 50}" + "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"orderId\\\": \\\"example_string_default_value\\\", \\\"side\\\": \\\"buy\\\", \\\"type\\\": \\\"limit\\\", \\\"tradeType\\\": \\\"TRADE\\\", \\\"startAt\\\": 1728663338000, \\\"endAt\\\": 1728692138000, \\\"currentPage\\\": 1, \\\"pageSize\\\": 50}", + "operationId": "065" } }, "/api/v1/limit/fills": { @@ -14770,7 +14835,8 @@ "x-sdk-method-description": "Request via this endpoint to get a list of 1000 fills in the last 24 hours. The return value is the data after Pagination, sorted in descending order according to time.", "x-api-rate-limit": 20, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": [\\n {\\n \\\"symbol\\\": \\\"BTC-USDT\\\",\\n \\\"tradeId\\\": \\\"11732720444522497\\\",\\n \\\"orderId\\\": \\\"674aab24754b1e00077dbc69\\\",\\n \\\"counterOrderId\\\": \\\"674aab1fb26bfb0007a18b67\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"liquidity\\\": \\\"taker\\\",\\n \\\"forceTaker\\\": false,\\n \\\"price\\\": \\\"96999.6\\\",\\n \\\"size\\\": \\\"0.00001\\\",\\n \\\"funds\\\": \\\"0.969996\\\",\\n \\\"fee\\\": \\\"0.000969996\\\",\\n \\\"feeRate\\\": \\\"0.001\\\",\\n \\\"feeCurrency\\\": \\\"USDT\\\",\\n \\\"stop\\\": \\\"\\\",\\n \\\"tradeType\\\": \\\"TRADE\\\",\\n \\\"type\\\": \\\"limit\\\",\\n \\\"createdAt\\\": 1732946724082\\n }\\n ]\\n}", - "x-request-example": "{\\\"currentPage\\\": 1, \\\"pageSize\\\": 50}" + "x-request-example": "{\\\"currentPage\\\": 1, \\\"pageSize\\\": 50}", + "operationId": "066" } } }, diff --git a/spec/rest/entry/openapi-viplending.json b/spec/rest/entry/openapi-viplending.json index 1be20aa7..f1dc5953 100644 --- a/spec/rest/entry/openapi-viplending.json +++ b/spec/rest/entry/openapi-viplending.json @@ -160,7 +160,8 @@ "x-sdk-method-name": "getAccountDetail", "x-sdk-method-description": "The following information is only applicable to loans. Get information on off-exchange funding and loans, This endpoint is only for querying accounts that are currently involved in loans.", "x-api-rate-limit": 1, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"parentUid\\\": \\\"1260004199\\\",\\n \\\"orders\\\": [{\\n \\\"orderId\\\": \\\"671a2be815f4140007a588e1\\\",\\n \\\"principal\\\": \\\"100\\\",\\n \\\"interest\\\": \\\"0\\\",\\n \\\"currency\\\": \\\"USDT\\\"\\n }],\\n \\\"ltv\\\": {\\n \\\"transferLtv\\\": \\\"0.6000\\\",\\n \\\"onlyClosePosLtv\\\": \\\"0.7500\\\",\\n \\\"delayedLiquidationLtv\\\": \\\"0.7500\\\",\\n \\\"instantLiquidationLtv\\\": \\\"0.8000\\\",\\n \\\"currentLtv\\\": \\\"0.1111\\\"\\n },\\n \\\"totalMarginAmount\\\": \\\"900.00000000\\\",\\n \\\"transferMarginAmount\\\": \\\"166.66666666\\\",\\n \\\"margins\\\": [{\\n \\\"marginCcy\\\": \\\"USDT\\\",\\n \\\"marginQty\\\": \\\"1000.00000000\\\",\\n \\\"marginFactor\\\": \\\"0.9000000000\\\"\\n }]\\n }\\n}" + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"parentUid\\\": \\\"1260004199\\\",\\n \\\"orders\\\": [{\\n \\\"orderId\\\": \\\"671a2be815f4140007a588e1\\\",\\n \\\"principal\\\": \\\"100\\\",\\n \\\"interest\\\": \\\"0\\\",\\n \\\"currency\\\": \\\"USDT\\\"\\n }],\\n \\\"ltv\\\": {\\n \\\"transferLtv\\\": \\\"0.6000\\\",\\n \\\"onlyClosePosLtv\\\": \\\"0.7500\\\",\\n \\\"delayedLiquidationLtv\\\": \\\"0.7500\\\",\\n \\\"instantLiquidationLtv\\\": \\\"0.8000\\\",\\n \\\"currentLtv\\\": \\\"0.1111\\\"\\n },\\n \\\"totalMarginAmount\\\": \\\"900.00000000\\\",\\n \\\"transferMarginAmount\\\": \\\"166.66666666\\\",\\n \\\"margins\\\": [{\\n \\\"marginCcy\\\": \\\"USDT\\\",\\n \\\"marginQty\\\": \\\"1000.00000000\\\",\\n \\\"marginFactor\\\": \\\"0.9000000000\\\"\\n }]\\n }\\n}", + "operationId": "001" } }, "/api/v1/otc-loan/accounts": { @@ -242,7 +243,8 @@ "x-sdk-method-name": "getAccounts", "x-sdk-method-description": "Accounts participating in OTC lending, This interface is only for querying accounts currently running OTC lending.", "x-api-rate-limit": 1, - "x-response-example": "\\n{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": [{\\n \\\"uid\\\": \\\"1260004199\\\",\\n \\\"marginCcy\\\": \\\"USDT\\\",\\n \\\"marginQty\\\": \\\"900\\\",\\n \\\"marginFactor\\\": \\\"0.9000000000\\\",\\n \\\"accountType\\\": \\\"TRADE\\\",\\n \\\"isParent\\\": true\\n }]\\n}" + "x-response-example": "\\n{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": [{\\n \\\"uid\\\": \\\"1260004199\\\",\\n \\\"marginCcy\\\": \\\"USDT\\\",\\n \\\"marginQty\\\": \\\"900\\\",\\n \\\"marginFactor\\\": \\\"0.9000000000\\\",\\n \\\"accountType\\\": \\\"TRADE\\\",\\n \\\"isParent\\\": true\\n }]\\n}", + "operationId": "002" } } }, From 683b110d23d858601025af0f82c968e1d4afc8e9 Mon Sep 17 00:00:00 2001 From: "Isaac.Tang" Date: Wed, 15 Jan 2025 15:11:09 +0800 Subject: [PATCH 3/6] feat(doc): update license and add CHANGELOG.md --- CHANGELOG.md | 10 ++++++++++ LICENSE | 2 +- Makefile | 4 ++++ README.md | 3 +++ sdk/golang/CHANGELOG.md | 11 +++++++++++ sdk/golang/LICENSE | 2 +- sdk/golang/README.md | 3 +++ sdk/postman/CHANGELOG.md | 10 ++++++++++ sdk/postman/LICENSE | 2 +- sdk/postman/README.md | 4 ++++ sdk/python/CHANGELOG.md | 11 +++++++++++ sdk/python/LICENSE | 2 +- sdk/python/README.md | 3 +++ 13 files changed, 63 insertions(+), 4 deletions(-) create mode 100644 CHANGELOG.md create mode 100644 sdk/golang/CHANGELOG.md create mode 100644 sdk/postman/CHANGELOG.md create mode 100644 sdk/python/CHANGELOG.md diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 00000000..7e58e0d5 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,10 @@ +# Changelog + +## 2025-01-16 +- Updated the API sequence to be consistent with the documentation. +- Updated the license. +- Added Copy Trading API. + +## 2024-12-31 + +- Released the official version 1.0.0. \ No newline at end of file diff --git a/LICENSE b/LICENSE index b894b056..2e995d25 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2024 KuCoin +Copyright (c) 2025 KuCoin Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/Makefile b/Makefile index b1188552..4842def5 100644 --- a/Makefile +++ b/Makefile @@ -65,6 +65,9 @@ define generate-code @echo "$(GREEN)lang: $(lang), clean...$(NC)" docker run --rm -v "${PWD}:/local" $(IMAGE_NAME):$(IMAGE_TAG) rm -rf $(outdir) + @echo "$(GREEN)lang: ${lang}, copy changelog...$(NC)" + docker run --rm -v "${PWD}:/local" $(IMAGE_NAME):$(IMAGE_TAG) cp /local/CHANGELOG.md /local/sdk/$(lang) + @make -f generate.mk generate lang=$(1) subdir=$(2) @echo "$(GREEN)lang: $(lang), clean...$(NC)" @@ -75,6 +78,7 @@ define generate-code endef define generate-postman + docker run --rm -v "${PWD}:/local" $(IMAGE_NAME):$(IMAGE_TAG) cp /local/CHANGELOG.md /local/sdk/postman @make -f generate.mk generate-postman endef diff --git a/README.md b/README.md index 15c764fe..ecc8c382 100644 --- a/README.md +++ b/README.md @@ -134,6 +134,9 @@ Find usage examples for your desired language by selecting the corresponding lin | Python | [sdk/python/examples/](sdk/python/example/)| | Go | [sdk/go/examples/](sdk/golang/example/) | +## 📋 Changelog + +For a detailed list of changes, see the [Changelog](./CHANGELOG.md). ## 🏗️ Technical Design diff --git a/sdk/golang/CHANGELOG.md b/sdk/golang/CHANGELOG.md new file mode 100644 index 00000000..7effce9b --- /dev/null +++ b/sdk/golang/CHANGELOG.md @@ -0,0 +1,11 @@ +# Changelog + +## 2025-01-16 + +- Updated the API sequence to be consistent with the documentation. +- Updated the license. +- Added Copy Trading API. + +## 2024-12-31 + +- Released the official version 1.0.0. \ No newline at end of file diff --git a/sdk/golang/LICENSE b/sdk/golang/LICENSE index b894b056..2e995d25 100644 --- a/sdk/golang/LICENSE +++ b/sdk/golang/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2024 KuCoin +Copyright (c) 2025 KuCoin Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/sdk/golang/README.md b/sdk/golang/README.md index 13e179b7..ce824f86 100644 --- a/sdk/golang/README.md +++ b/sdk/golang/README.md @@ -88,6 +88,9 @@ Official Documentation: [KuCoin API Docs](https://www.kucoin.com/docs-new) Explore more examples in the [example/](example/) directory for advanced usage. +## 📋 Changelog + +For a detailed list of changes, see the [Changelog](./CHANGELOG.md). ## 📌 Special Notes on APIs diff --git a/sdk/postman/CHANGELOG.md b/sdk/postman/CHANGELOG.md new file mode 100644 index 00000000..7e58e0d5 --- /dev/null +++ b/sdk/postman/CHANGELOG.md @@ -0,0 +1,10 @@ +# Changelog + +## 2025-01-16 +- Updated the API sequence to be consistent with the documentation. +- Updated the license. +- Added Copy Trading API. + +## 2024-12-31 + +- Released the official version 1.0.0. \ No newline at end of file diff --git a/sdk/postman/LICENSE b/sdk/postman/LICENSE index b894b056..2e995d25 100644 --- a/sdk/postman/LICENSE +++ b/sdk/postman/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2024 KuCoin +Copyright (c) 2025 KuCoin Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/sdk/postman/README.md b/sdk/postman/README.md index 2daf91c8..68bbcd6c 100644 --- a/sdk/postman/README.md +++ b/sdk/postman/README.md @@ -76,6 +76,10 @@ For detailed information about the API endpoints, refer to the official KuCoin A - [KuCoin API Docs](https://www.kucoin.com/docs-new) +## 📋 Changelog + +For a detailed list of changes, see the [Changelog](./CHANGELOG.md). + ## 📧 Contact Support If you encounter any issues or have questions, feel free to reach out through: diff --git a/sdk/python/CHANGELOG.md b/sdk/python/CHANGELOG.md new file mode 100644 index 00000000..7effce9b --- /dev/null +++ b/sdk/python/CHANGELOG.md @@ -0,0 +1,11 @@ +# Changelog + +## 2025-01-16 + +- Updated the API sequence to be consistent with the documentation. +- Updated the license. +- Added Copy Trading API. + +## 2024-12-31 + +- Released the official version 1.0.0. \ No newline at end of file diff --git a/sdk/python/LICENSE b/sdk/python/LICENSE index b894b056..2e995d25 100644 --- a/sdk/python/LICENSE +++ b/sdk/python/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2024 KuCoin +Copyright (c) 2025 KuCoin Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/sdk/python/README.md b/sdk/python/README.md index 5b97c19e..31a292ac 100644 --- a/sdk/python/README.md +++ b/sdk/python/README.md @@ -89,6 +89,9 @@ Official Documentation: [KuCoin API Docs](https://www.kucoin.com/docs-new) Explore more examples in the [example/](example/) directory for advanced usage. +## 📋 Changelog + +For a detailed list of changes, see the [Changelog](./CHANGELOG.md). ## 📌 Special Notes on APIs From 0e6f1592044df6ecb271cb6975aa0b39be5a7ddd Mon Sep 17 00:00:00 2001 From: "Isaac.Tang" Date: Wed, 15 Jan 2025 17:05:06 +0800 Subject: [PATCH 4/6] feat(sdk): add copy trading api --- sdk/golang/CHANGELOG.md | 1 - sdk/golang/internal/rest/default_rest_impl.go | 38 +- sdk/golang/pkg/api/api_rest.go | 4 + .../copytrading/futures/api_futures.go | 239 +++ .../copytrading/futures/api_futures.template | 255 +++ .../copytrading/futures/api_futures_test.go | 316 +++ .../futures/types_add_isolated_margin_req.go | 68 + .../futures/types_add_isolated_margin_resp.go | 184 ++ .../futures/types_add_order_req.go | 257 +++ .../futures/types_add_order_resp.go | 44 + .../futures/types_add_order_test_req.go | 258 +++ .../futures/types_add_order_test_resp.go | 44 + .../futures/types_add_tpsl_order_req.go | 258 +++ .../futures/types_add_tpsl_order_resp.go | 44 + .../types_cancel_order_by_client_oid_req.go | 56 + .../types_cancel_order_by_client_oid_resp.go | 39 + .../futures/types_cancel_order_by_id_req.go | 47 + .../futures/types_cancel_order_by_id_resp.go | 40 + .../futures/types_get_max_open_size_req.go | 65 + .../futures/types_get_max_open_size_resp.go | 48 + .../types_get_max_withdraw_margin_req.go | 47 + .../types_get_max_withdraw_margin_resp.go | 46 + .../types_modify_auto_deposit_status_req.go | 58 + .../types_modify_auto_deposit_status_resp.go | 45 + ...es_modify_isolated_margin_risk_limt_req.go | 58 + ...s_modify_isolated_margin_risk_limt_resp.go | 46 + .../types_remove_isolated_margin_req.go | 58 + .../types_remove_isolated_margin_resp.go | 46 + .../pkg/generate/service/copytrading_api.go | 28 + .../e2e/rest/copytrading_test/futures_test.go | 300 +++ sdk/postman/collection-REST.json | 1033 ++++++++++ sdk/python/CHANGELOG.md | 1 - .../kucoin_universal_sdk/api/api_rest.py | 6 + .../generate/copytrading/__init__.py | 0 .../generate/copytrading/futures/__init__.py | 0 .../copytrading/futures/api_futures.py | 322 ++++ .../copytrading/futures/api_futures.template | 211 ++ .../copytrading/futures/api_futures_test.py | 236 +++ .../futures/model_add_isolated_margin_req.py | 107 + .../futures/model_add_isolated_margin_resp.py | 308 +++ .../futures/model_add_order_req.py | 429 +++++ .../futures/model_add_order_resp.py | 77 + .../futures/model_add_order_test_req.py | 435 +++++ .../futures/model_add_order_test_resp.py | 77 + .../futures/model_add_tpsl_order_req.py | 424 ++++ .../futures/model_add_tpsl_order_resp.py | 77 + .../model_cancel_order_by_client_oid_req.py | 95 + .../model_cancel_order_by_client_oid_resp.py | 67 + .../futures/model_cancel_order_by_id_req.py | 77 + .../futures/model_cancel_order_by_id_resp.py | 70 + .../futures/model_get_max_open_size_req.py | 100 + .../futures/model_get_max_open_size_resp.py | 84 + .../model_get_max_withdraw_margin_req.py | 80 + .../model_get_max_withdraw_margin_resp.py | 74 + .../model_modify_auto_deposit_status_req.py | 89 + .../model_modify_auto_deposit_status_resp.py | 70 + ...el_modify_isolated_margin_risk_limt_req.py | 92 + ...l_modify_isolated_margin_risk_limt_resp.py | 74 + .../model_remove_isolated_margin_req.py | 97 + .../model_remove_isolated_margin_resp.py | 74 + .../generate/service/copytrading_api.py | 25 + .../internal/rest/default_rest_impl.py | 5 + .../copytrading_test/copytrading_futures.py | 282 +++ spec/apis.csv | 11 + spec/original/meta.json | 1714 +++++++++++++++++ .../rest/api/openapi-copytrading-futures.json | 1651 ++++++++++++++++ spec/rest/entry/openapi-copytrading.json | 1651 ++++++++++++++++ 67 files changed, 13244 insertions(+), 18 deletions(-) create mode 100644 sdk/golang/pkg/generate/copytrading/futures/api_futures.go create mode 100644 sdk/golang/pkg/generate/copytrading/futures/api_futures.template create mode 100644 sdk/golang/pkg/generate/copytrading/futures/api_futures_test.go create mode 100644 sdk/golang/pkg/generate/copytrading/futures/types_add_isolated_margin_req.go create mode 100644 sdk/golang/pkg/generate/copytrading/futures/types_add_isolated_margin_resp.go create mode 100644 sdk/golang/pkg/generate/copytrading/futures/types_add_order_req.go create mode 100644 sdk/golang/pkg/generate/copytrading/futures/types_add_order_resp.go create mode 100644 sdk/golang/pkg/generate/copytrading/futures/types_add_order_test_req.go create mode 100644 sdk/golang/pkg/generate/copytrading/futures/types_add_order_test_resp.go create mode 100644 sdk/golang/pkg/generate/copytrading/futures/types_add_tpsl_order_req.go create mode 100644 sdk/golang/pkg/generate/copytrading/futures/types_add_tpsl_order_resp.go create mode 100644 sdk/golang/pkg/generate/copytrading/futures/types_cancel_order_by_client_oid_req.go create mode 100644 sdk/golang/pkg/generate/copytrading/futures/types_cancel_order_by_client_oid_resp.go create mode 100644 sdk/golang/pkg/generate/copytrading/futures/types_cancel_order_by_id_req.go create mode 100644 sdk/golang/pkg/generate/copytrading/futures/types_cancel_order_by_id_resp.go create mode 100644 sdk/golang/pkg/generate/copytrading/futures/types_get_max_open_size_req.go create mode 100644 sdk/golang/pkg/generate/copytrading/futures/types_get_max_open_size_resp.go create mode 100644 sdk/golang/pkg/generate/copytrading/futures/types_get_max_withdraw_margin_req.go create mode 100644 sdk/golang/pkg/generate/copytrading/futures/types_get_max_withdraw_margin_resp.go create mode 100644 sdk/golang/pkg/generate/copytrading/futures/types_modify_auto_deposit_status_req.go create mode 100644 sdk/golang/pkg/generate/copytrading/futures/types_modify_auto_deposit_status_resp.go create mode 100644 sdk/golang/pkg/generate/copytrading/futures/types_modify_isolated_margin_risk_limt_req.go create mode 100644 sdk/golang/pkg/generate/copytrading/futures/types_modify_isolated_margin_risk_limt_resp.go create mode 100644 sdk/golang/pkg/generate/copytrading/futures/types_remove_isolated_margin_req.go create mode 100644 sdk/golang/pkg/generate/copytrading/futures/types_remove_isolated_margin_resp.go create mode 100644 sdk/golang/pkg/generate/service/copytrading_api.go create mode 100644 sdk/golang/tests/e2e/rest/copytrading_test/futures_test.go create mode 100644 sdk/python/kucoin_universal_sdk/generate/copytrading/__init__.py create mode 100644 sdk/python/kucoin_universal_sdk/generate/copytrading/futures/__init__.py create mode 100644 sdk/python/kucoin_universal_sdk/generate/copytrading/futures/api_futures.py create mode 100644 sdk/python/kucoin_universal_sdk/generate/copytrading/futures/api_futures.template create mode 100644 sdk/python/kucoin_universal_sdk/generate/copytrading/futures/api_futures_test.py create mode 100644 sdk/python/kucoin_universal_sdk/generate/copytrading/futures/model_add_isolated_margin_req.py create mode 100644 sdk/python/kucoin_universal_sdk/generate/copytrading/futures/model_add_isolated_margin_resp.py create mode 100644 sdk/python/kucoin_universal_sdk/generate/copytrading/futures/model_add_order_req.py create mode 100644 sdk/python/kucoin_universal_sdk/generate/copytrading/futures/model_add_order_resp.py create mode 100644 sdk/python/kucoin_universal_sdk/generate/copytrading/futures/model_add_order_test_req.py create mode 100644 sdk/python/kucoin_universal_sdk/generate/copytrading/futures/model_add_order_test_resp.py create mode 100644 sdk/python/kucoin_universal_sdk/generate/copytrading/futures/model_add_tpsl_order_req.py create mode 100644 sdk/python/kucoin_universal_sdk/generate/copytrading/futures/model_add_tpsl_order_resp.py create mode 100644 sdk/python/kucoin_universal_sdk/generate/copytrading/futures/model_cancel_order_by_client_oid_req.py create mode 100644 sdk/python/kucoin_universal_sdk/generate/copytrading/futures/model_cancel_order_by_client_oid_resp.py create mode 100644 sdk/python/kucoin_universal_sdk/generate/copytrading/futures/model_cancel_order_by_id_req.py create mode 100644 sdk/python/kucoin_universal_sdk/generate/copytrading/futures/model_cancel_order_by_id_resp.py create mode 100644 sdk/python/kucoin_universal_sdk/generate/copytrading/futures/model_get_max_open_size_req.py create mode 100644 sdk/python/kucoin_universal_sdk/generate/copytrading/futures/model_get_max_open_size_resp.py create mode 100644 sdk/python/kucoin_universal_sdk/generate/copytrading/futures/model_get_max_withdraw_margin_req.py create mode 100644 sdk/python/kucoin_universal_sdk/generate/copytrading/futures/model_get_max_withdraw_margin_resp.py create mode 100644 sdk/python/kucoin_universal_sdk/generate/copytrading/futures/model_modify_auto_deposit_status_req.py create mode 100644 sdk/python/kucoin_universal_sdk/generate/copytrading/futures/model_modify_auto_deposit_status_resp.py create mode 100644 sdk/python/kucoin_universal_sdk/generate/copytrading/futures/model_modify_isolated_margin_risk_limt_req.py create mode 100644 sdk/python/kucoin_universal_sdk/generate/copytrading/futures/model_modify_isolated_margin_risk_limt_resp.py create mode 100644 sdk/python/kucoin_universal_sdk/generate/copytrading/futures/model_remove_isolated_margin_req.py create mode 100644 sdk/python/kucoin_universal_sdk/generate/copytrading/futures/model_remove_isolated_margin_resp.py create mode 100644 sdk/python/kucoin_universal_sdk/generate/service/copytrading_api.py create mode 100644 sdk/python/test/e2e/rest/copytrading_test/copytrading_futures.py create mode 100644 spec/rest/api/openapi-copytrading-futures.json create mode 100644 spec/rest/entry/openapi-copytrading.json diff --git a/sdk/golang/CHANGELOG.md b/sdk/golang/CHANGELOG.md index 7effce9b..7e58e0d5 100644 --- a/sdk/golang/CHANGELOG.md +++ b/sdk/golang/CHANGELOG.md @@ -1,7 +1,6 @@ # Changelog ## 2025-01-16 - - Updated the API sequence to be consistent with the documentation. - Updated the license. - Added Copy Trading API. diff --git a/sdk/golang/internal/rest/default_rest_impl.go b/sdk/golang/internal/rest/default_rest_impl.go index 02ef37cf..e09526c4 100644 --- a/sdk/golang/internal/rest/default_rest_impl.go +++ b/sdk/golang/internal/rest/default_rest_impl.go @@ -9,14 +9,15 @@ import ( ) type KuCoinDefaultRestImpl struct { - accountService service.AccountService - affiliateService service.AffiliateService - brokerService service.BrokerService - earnService service.EarnService - futuresService service.FuturesService - marginService service.MarginService - spotService service.SpotService - vipLendingService service.ViplendingService + accountService service.AccountService + affiliateService service.AffiliateService + brokerService service.BrokerService + copytradingService service.CopytradingService + earnService service.EarnService + futuresService service.FuturesService + marginService service.MarginService + spotService service.SpotService + vipLendingService service.ViplendingService } func NewKuCoinDefaultRestImpl(op *types.ClientOption) *KuCoinDefaultRestImpl { @@ -29,14 +30,15 @@ func NewKuCoinDefaultRestImpl(op *types.ClientOption) *KuCoinDefaultRestImpl { transport := infra.NewDefaultTransport(op, generate.SdkVersion) return &KuCoinDefaultRestImpl{ - accountService: service.NewAccountService(transport), - affiliateService: service.NewAffiliateService(transport), - brokerService: service.NewBrokerService(transport), - earnService: service.NewEarnService(transport), - futuresService: service.NewFuturesService(transport), - marginService: service.NewMarginService(transport), - spotService: service.NewSpotService(transport), - vipLendingService: service.NewViplendingService(transport), + accountService: service.NewAccountService(transport), + affiliateService: service.NewAffiliateService(transport), + brokerService: service.NewBrokerService(transport), + copytradingService: service.NewCopytradingService(transport), + earnService: service.NewEarnService(transport), + futuresService: service.NewFuturesService(transport), + marginService: service.NewMarginService(transport), + spotService: service.NewSpotService(transport), + vipLendingService: service.NewViplendingService(transport), } } @@ -52,6 +54,10 @@ func (impl *KuCoinDefaultRestImpl) GetBrokerService() service.BrokerService { return impl.brokerService } +func (impl *KuCoinDefaultRestImpl) GetCopytradingService() service.CopytradingService { + return impl.copytradingService +} + func (impl *KuCoinDefaultRestImpl) GetEarnService() service.EarnService { return impl.earnService } diff --git a/sdk/golang/pkg/api/api_rest.go b/sdk/golang/pkg/api/api_rest.go index 18fb3732..25ba24d3 100644 --- a/sdk/golang/pkg/api/api_rest.go +++ b/sdk/golang/pkg/api/api_rest.go @@ -17,6 +17,10 @@ type KucoinRestService interface { // BrokerService provides functions to access and manage broker-related data. GetBrokerService() service.BrokerService + // GetCopytradingService + // Provides functions to access and manage copy trading-related data + GetCopytradingService() service.CopytradingService + // GetEarnService // EarnService provides functions to access and manage earn-related data. GetEarnService() service.EarnService diff --git a/sdk/golang/pkg/generate/copytrading/futures/api_futures.go b/sdk/golang/pkg/generate/copytrading/futures/api_futures.go new file mode 100644 index 00000000..a75ebbd8 --- /dev/null +++ b/sdk/golang/pkg/generate/copytrading/futures/api_futures.go @@ -0,0 +1,239 @@ +// Code generated by Kucoin Universal SDK Generator; DO NOT EDIT. + +package futures + +import ( + "context" + "github.com/Kucoin/kucoin-universal-sdk/sdk/golang/internal/interfaces" +) + +type FuturesAPI interface { + + // AddOrder Add Order + // Description: Place order to the futures trading system, you can place two major types of orders: limit and market. Orders can only be placed if your account has sufficient funds. Once an order is placed, your funds will be put on hold for the duration of the order. The amount of funds on hold depends on the order type and parameters specified. + // Documentation: https://www.kucoin.com/docs-new/api-3470363 + // +---------------------+------------------+ + // | Extra API Info | Value | + // +---------------------+------------------+ + // | API-DOMAIN | FUTURES | + // | API-CHANNEL | PRIVATE | + // | API-PERMISSION | LEADTRADEFUTURES | + // | API-RATE-LIMIT-POOL | COPYTRADING | + // | API-RATE-LIMIT | 2 | + // +---------------------+------------------+ + AddOrder(req *AddOrderReq, ctx context.Context) (*AddOrderResp, error) + + // AddOrderTest Add Order Test + // Description: Place order to the futures trading system just for validation + // Documentation: https://www.kucoin.com/docs-new/api-3470618 + // +---------------------+-------------+ + // | Extra API Info | Value | + // +---------------------+-------------+ + // | API-DOMAIN | FUTURES | + // | API-CHANNEL | PRIVATE | + // | API-PERMISSION | FUTURES | + // | API-RATE-LIMIT-POOL | COPYTRADING | + // | API-RATE-LIMIT | 2 | + // +---------------------+-------------+ + AddOrderTest(req *AddOrderTestReq, ctx context.Context) (*AddOrderTestResp, error) + + // AddTPSLOrder Add Take Profit And Stop Loss Order + // Description: Place take profit and stop loss order supports both take-profit and stop-loss functions, and other functions are exactly the same as the place order interface. + // Documentation: https://www.kucoin.com/docs-new/api-3470619 + // +---------------------+-------------+ + // | Extra API Info | Value | + // +---------------------+-------------+ + // | API-DOMAIN | FUTURES | + // | API-CHANNEL | PRIVATE | + // | API-PERMISSION | FUTURES | + // | API-RATE-LIMIT-POOL | COPYTRADING | + // | API-RATE-LIMIT | 2 | + // +---------------------+-------------+ + AddTPSLOrder(req *AddTPSLOrderReq, ctx context.Context) (*AddTPSLOrderResp, error) + + // CancelOrderById Cancel Order By OrderId + // Description: Cancel order by system generated orderId. + // Documentation: https://www.kucoin.com/docs-new/api-3470620 + // +---------------------+-------------+ + // | Extra API Info | Value | + // +---------------------+-------------+ + // | API-DOMAIN | FUTURES | + // | API-CHANNEL | PRIVATE | + // | API-PERMISSION | FUTURES | + // | API-RATE-LIMIT-POOL | COPYTRADING | + // | API-RATE-LIMIT | 1 | + // +---------------------+-------------+ + CancelOrderById(req *CancelOrderByIdReq, ctx context.Context) (*CancelOrderByIdResp, error) + + // CancelOrderByClientOid Cancel Order By ClientOid + // Description: Cancel order by client defined orderId. + // Documentation: https://www.kucoin.com/docs-new/api-3470621 + // +---------------------+-------------+ + // | Extra API Info | Value | + // +---------------------+-------------+ + // | API-DOMAIN | FUTURES | + // | API-CHANNEL | PRIVATE | + // | API-PERMISSION | FUTURES | + // | API-RATE-LIMIT-POOL | COPYTRADING | + // | API-RATE-LIMIT | 1 | + // +---------------------+-------------+ + CancelOrderByClientOid(req *CancelOrderByClientOidReq, ctx context.Context) (*CancelOrderByClientOidResp, error) + + // GetMaxOpenSize Get Max Open Size + // Description: Get Maximum Open Position Size. + // Documentation: https://www.kucoin.com/docs-new/api-3470612 + // +---------------------+-------------+ + // | Extra API Info | Value | + // +---------------------+-------------+ + // | API-DOMAIN | FUTURES | + // | API-CHANNEL | PRIVATE | + // | API-PERMISSION | FUTURES | + // | API-RATE-LIMIT-POOL | COPYTRADING | + // | API-RATE-LIMIT | 2 | + // +---------------------+-------------+ + GetMaxOpenSize(req *GetMaxOpenSizeReq, ctx context.Context) (*GetMaxOpenSizeResp, error) + + // GetMaxWithdrawMargin Get Max Withdraw Margin + // Description: This interface can query the maximum amount of margin that the current position supports withdrawal. + // Documentation: https://www.kucoin.com/docs-new/api-3470616 + // +---------------------+-------------+ + // | Extra API Info | Value | + // +---------------------+-------------+ + // | API-DOMAIN | FUTURES | + // | API-CHANNEL | PRIVATE | + // | API-PERMISSION | FUTURES | + // | API-RATE-LIMIT-POOL | COPYTRADING | + // | API-RATE-LIMIT | 10 | + // +---------------------+-------------+ + GetMaxWithdrawMargin(req *GetMaxWithdrawMarginReq, ctx context.Context) (*GetMaxWithdrawMarginResp, error) + + // AddIsolatedMargin Add Isolated Margin + // Description: Add Isolated Margin Manually. + // Documentation: https://www.kucoin.com/docs-new/api-3470614 + // +---------------------+-------------+ + // | Extra API Info | Value | + // +---------------------+-------------+ + // | API-DOMAIN | FUTURES | + // | API-CHANNEL | PRIVATE | + // | API-PERMISSION | FUTURES | + // | API-RATE-LIMIT-POOL | COPYTRADING | + // | API-RATE-LIMIT | 4 | + // +---------------------+-------------+ + AddIsolatedMargin(req *AddIsolatedMarginReq, ctx context.Context) (*AddIsolatedMarginResp, error) + + // RemoveIsolatedMargin Remove Isolated Margin + // Description: Remove Isolated Margin Manually. + // Documentation: https://www.kucoin.com/docs-new/api-3470615 + // +---------------------+-------------+ + // | Extra API Info | Value | + // +---------------------+-------------+ + // | API-DOMAIN | FUTURES | + // | API-CHANNEL | PRIVATE | + // | API-PERMISSION | FUTURES | + // | API-RATE-LIMIT-POOL | COPYTRADING | + // | API-RATE-LIMIT | 10 | + // +---------------------+-------------+ + RemoveIsolatedMargin(req *RemoveIsolatedMarginReq, ctx context.Context) (*RemoveIsolatedMarginResp, error) + + // ModifyIsolatedMarginRiskLimt Modify Isolated Margin Risk Limit + // Description: This interface can be used to obtain information about risk limit level of a specific contract(Only valid for isolated Margin). + // Documentation: https://www.kucoin.com/docs-new/api-3470613 + // +---------------------+-------------+ + // | Extra API Info | Value | + // +---------------------+-------------+ + // | API-DOMAIN | FUTURES | + // | API-CHANNEL | PRIVATE | + // | API-PERMISSION | FUTURES | + // | API-RATE-LIMIT-POOL | COPYTRADING | + // | API-RATE-LIMIT | 4 | + // +---------------------+-------------+ + ModifyIsolatedMarginRiskLimt(req *ModifyIsolatedMarginRiskLimtReq, ctx context.Context) (*ModifyIsolatedMarginRiskLimtResp, error) + + // ModifyAutoDepositStatus Modify Isolated Margin Auto-Deposit Status + // Description: This endpoint is only applicable to isolated margin and is no longer recommended. It is recommended to use cross margin instead. + // Documentation: https://www.kucoin.com/docs-new/api-3470617 + // +---------------------+-------------+ + // | Extra API Info | Value | + // +---------------------+-------------+ + // | API-DOMAIN | FUTURES | + // | API-CHANNEL | PRIVATE | + // | API-PERMISSION | FUTURES | + // | API-RATE-LIMIT-POOL | COPYTRADING | + // | API-RATE-LIMIT | 4 | + // +---------------------+-------------+ + ModifyAutoDepositStatus(req *ModifyAutoDepositStatusReq, ctx context.Context) (*ModifyAutoDepositStatusResp, error) +} + +type FuturesAPIImpl struct { + transport interfaces.Transport +} + +func NewFuturesAPIImp(transport interfaces.Transport) *FuturesAPIImpl { + return &FuturesAPIImpl{transport: transport} +} + +func (impl *FuturesAPIImpl) AddOrder(req *AddOrderReq, ctx context.Context) (*AddOrderResp, error) { + resp := &AddOrderResp{} + err := impl.transport.Call(ctx, "futures", false, "Post", "/api/v1/copy-trade/futures/orders", req, resp, false) + return resp, err +} + +func (impl *FuturesAPIImpl) AddOrderTest(req *AddOrderTestReq, ctx context.Context) (*AddOrderTestResp, error) { + resp := &AddOrderTestResp{} + err := impl.transport.Call(ctx, "futures", false, "Post", "/api/v1/copy-trade/futures/orders/test", req, resp, false) + return resp, err +} + +func (impl *FuturesAPIImpl) AddTPSLOrder(req *AddTPSLOrderReq, ctx context.Context) (*AddTPSLOrderResp, error) { + resp := &AddTPSLOrderResp{} + err := impl.transport.Call(ctx, "futures", false, "Post", "/api/v1/copy-trade/futures/st-orders", req, resp, false) + return resp, err +} + +func (impl *FuturesAPIImpl) CancelOrderById(req *CancelOrderByIdReq, ctx context.Context) (*CancelOrderByIdResp, error) { + resp := &CancelOrderByIdResp{} + err := impl.transport.Call(ctx, "futures", false, "Delete", "/api/v1/copy-trade/futures/orders", req, resp, false) + return resp, err +} + +func (impl *FuturesAPIImpl) CancelOrderByClientOid(req *CancelOrderByClientOidReq, ctx context.Context) (*CancelOrderByClientOidResp, error) { + resp := &CancelOrderByClientOidResp{} + err := impl.transport.Call(ctx, "futures", false, "Delete", "/api/v1/copy-trade/futures/orders/client-order", req, resp, false) + return resp, err +} + +func (impl *FuturesAPIImpl) GetMaxOpenSize(req *GetMaxOpenSizeReq, ctx context.Context) (*GetMaxOpenSizeResp, error) { + resp := &GetMaxOpenSizeResp{} + err := impl.transport.Call(ctx, "futures", false, "Get", "/api/v1/copy-trade/futures/get-max-open-size", req, resp, false) + return resp, err +} + +func (impl *FuturesAPIImpl) GetMaxWithdrawMargin(req *GetMaxWithdrawMarginReq, ctx context.Context) (*GetMaxWithdrawMarginResp, error) { + resp := &GetMaxWithdrawMarginResp{} + err := impl.transport.Call(ctx, "futures", false, "Get", "/api/v1/copy-trade/futures/position/margin/max-withdraw-margin", req, resp, false) + return resp, err +} + +func (impl *FuturesAPIImpl) AddIsolatedMargin(req *AddIsolatedMarginReq, ctx context.Context) (*AddIsolatedMarginResp, error) { + resp := &AddIsolatedMarginResp{} + err := impl.transport.Call(ctx, "futures", false, "Post", "/api/v1/copy-trade/futures/position/margin/deposit-margin", req, resp, false) + return resp, err +} + +func (impl *FuturesAPIImpl) RemoveIsolatedMargin(req *RemoveIsolatedMarginReq, ctx context.Context) (*RemoveIsolatedMarginResp, error) { + resp := &RemoveIsolatedMarginResp{} + err := impl.transport.Call(ctx, "futures", false, "Post", "/api/v1/copy-trade/futures/position/margin/withdraw-margin", req, resp, false) + return resp, err +} + +func (impl *FuturesAPIImpl) ModifyIsolatedMarginRiskLimt(req *ModifyIsolatedMarginRiskLimtReq, ctx context.Context) (*ModifyIsolatedMarginRiskLimtResp, error) { + resp := &ModifyIsolatedMarginRiskLimtResp{} + err := impl.transport.Call(ctx, "futures", false, "Post", "/api/v1/copy-trade/futures/position/risk-limit-level/change", req, resp, false) + return resp, err +} + +func (impl *FuturesAPIImpl) ModifyAutoDepositStatus(req *ModifyAutoDepositStatusReq, ctx context.Context) (*ModifyAutoDepositStatusResp, error) { + resp := &ModifyAutoDepositStatusResp{} + err := impl.transport.Call(ctx, "futures", false, "Post", "/api/v1/copy-trade/futures/position/margin/auto-deposit-status", req, resp, false) + return resp, err +} diff --git a/sdk/golang/pkg/generate/copytrading/futures/api_futures.template b/sdk/golang/pkg/generate/copytrading/futures/api_futures.template new file mode 100644 index 00000000..7d3e6d64 --- /dev/null +++ b/sdk/golang/pkg/generate/copytrading/futures/api_futures.template @@ -0,0 +1,255 @@ +# API FUNCTION TEMPLATE + + +func TestFuturesAddOrderReq(t *testing.T) { + // AddOrder + // Add Order + // /api/v1/copy-trade/futures/orders + + builder := futures.NewAddOrderReqBuilder() + builder.SetClientOid(?).SetSide(?).SetSymbol(?).SetLeverage(?).SetType(?).SetRemark(?).SetStop(?).SetStopPriceType(?).SetStopPrice(?).SetReduceOnly(?).SetCloseOrder(?).SetForceHold(?).SetMarginMode(?).SetPrice(?).SetSize(?).SetTimeInForce(?).SetPostOnly(?).SetHidden(?).SetIceberg(?).SetVisibleSize(?) + req := builder.Build() + + resp, err := futuresApi.AddOrder(req, context.TODO()) + if err != nil { + panic(err) + } + data, err := json.Marshal(resp.ToMap()) + if err != nil { + panic(err) + } + fmt.Println("code:", resp.CommonResponse.Code) + fmt.Println("message:", resp.CommonResponse.Message) + fmt.Println("data:", string(data)) +} + + +func TestFuturesAddOrderTestReq(t *testing.T) { + // AddOrderTest + // Add Order Test + // /api/v1/copy-trade/futures/orders/test + + builder := futures.NewAddOrderTestReqBuilder() + builder.SetClientOid(?).SetSide(?).SetSymbol(?).SetLeverage(?).SetType(?).SetRemark(?).SetStop(?).SetStopPriceType(?).SetStopPrice(?).SetReduceOnly(?).SetCloseOrder(?).SetForceHold(?).SetMarginMode(?).SetPrice(?).SetSize(?).SetTimeInForce(?).SetPostOnly(?).SetHidden(?).SetIceberg(?).SetVisibleSize(?) + req := builder.Build() + + resp, err := futuresApi.AddOrderTest(req, context.TODO()) + if err != nil { + panic(err) + } + data, err := json.Marshal(resp.ToMap()) + if err != nil { + panic(err) + } + fmt.Println("code:", resp.CommonResponse.Code) + fmt.Println("message:", resp.CommonResponse.Message) + fmt.Println("data:", string(data)) +} + + +func TestFuturesAddTPSLOrderReq(t *testing.T) { + // AddTPSLOrder + // Add Take Profit And Stop Loss Order + // /api/v1/copy-trade/futures/st-orders + + builder := futures.NewAddTPSLOrderReqBuilder() + builder.SetClientOid(?).SetSide(?).SetSymbol(?).SetLeverage(?).SetType(?).SetRemark(?).SetStopPriceType(?).SetReduceOnly(?).SetCloseOrder(?).SetForceHold(?).SetMarginMode(?).SetPrice(?).SetSize(?).SetTimeInForce(?).SetPostOnly(?).SetHidden(?).SetIceberg(?).SetVisibleSize(?).SetTriggerStopUpPrice(?).SetTriggerStopDownPrice(?) + req := builder.Build() + + resp, err := futuresApi.AddTPSLOrder(req, context.TODO()) + if err != nil { + panic(err) + } + data, err := json.Marshal(resp.ToMap()) + if err != nil { + panic(err) + } + fmt.Println("code:", resp.CommonResponse.Code) + fmt.Println("message:", resp.CommonResponse.Message) + fmt.Println("data:", string(data)) +} + + +func TestFuturesCancelOrderByIdReq(t *testing.T) { + // CancelOrderById + // Cancel Order By OrderId + // /api/v1/copy-trade/futures/orders + + builder := futures.NewCancelOrderByIdReqBuilder() + builder.SetOrderId(?) + req := builder.Build() + + resp, err := futuresApi.CancelOrderById(req, context.TODO()) + if err != nil { + panic(err) + } + data, err := json.Marshal(resp.ToMap()) + if err != nil { + panic(err) + } + fmt.Println("code:", resp.CommonResponse.Code) + fmt.Println("message:", resp.CommonResponse.Message) + fmt.Println("data:", string(data)) +} + + +func TestFuturesCancelOrderByClientOidReq(t *testing.T) { + // CancelOrderByClientOid + // Cancel Order By ClientOid + // /api/v1/copy-trade/futures/orders/client-order + + builder := futures.NewCancelOrderByClientOidReqBuilder() + builder.SetSymbol(?).SetClientOid(?) + req := builder.Build() + + resp, err := futuresApi.CancelOrderByClientOid(req, context.TODO()) + if err != nil { + panic(err) + } + data, err := json.Marshal(resp.ToMap()) + if err != nil { + panic(err) + } + fmt.Println("code:", resp.CommonResponse.Code) + fmt.Println("message:", resp.CommonResponse.Message) + fmt.Println("data:", string(data)) +} + + +func TestFuturesGetMaxOpenSizeReq(t *testing.T) { + // GetMaxOpenSize + // Get Max Open Size + // /api/v1/copy-trade/futures/get-max-open-size + + builder := futures.NewGetMaxOpenSizeReqBuilder() + builder.SetSymbol(?).SetPrice(?).SetLeverage(?) + req := builder.Build() + + resp, err := futuresApi.GetMaxOpenSize(req, context.TODO()) + if err != nil { + panic(err) + } + data, err := json.Marshal(resp.ToMap()) + if err != nil { + panic(err) + } + fmt.Println("code:", resp.CommonResponse.Code) + fmt.Println("message:", resp.CommonResponse.Message) + fmt.Println("data:", string(data)) +} + + +func TestFuturesGetMaxWithdrawMarginReq(t *testing.T) { + // GetMaxWithdrawMargin + // Get Max Withdraw Margin + // /api/v1/copy-trade/futures/position/margin/max-withdraw-margin + + builder := futures.NewGetMaxWithdrawMarginReqBuilder() + builder.SetSymbol(?) + req := builder.Build() + + resp, err := futuresApi.GetMaxWithdrawMargin(req, context.TODO()) + if err != nil { + panic(err) + } + data, err := json.Marshal(resp.ToMap()) + if err != nil { + panic(err) + } + fmt.Println("code:", resp.CommonResponse.Code) + fmt.Println("message:", resp.CommonResponse.Message) + fmt.Println("data:", string(data)) +} + + +func TestFuturesAddIsolatedMarginReq(t *testing.T) { + // AddIsolatedMargin + // Add Isolated Margin + // /api/v1/copy-trade/futures/position/margin/deposit-margin + + builder := futures.NewAddIsolatedMarginReqBuilder() + builder.SetSymbol(?).SetMargin(?).SetBizNo(?) + req := builder.Build() + + resp, err := futuresApi.AddIsolatedMargin(req, context.TODO()) + if err != nil { + panic(err) + } + data, err := json.Marshal(resp.ToMap()) + if err != nil { + panic(err) + } + fmt.Println("code:", resp.CommonResponse.Code) + fmt.Println("message:", resp.CommonResponse.Message) + fmt.Println("data:", string(data)) +} + + +func TestFuturesRemoveIsolatedMarginReq(t *testing.T) { + // RemoveIsolatedMargin + // Remove Isolated Margin + // /api/v1/copy-trade/futures/position/margin/withdraw-margin + + builder := futures.NewRemoveIsolatedMarginReqBuilder() + builder.SetSymbol(?).SetWithdrawAmount(?) + req := builder.Build() + + resp, err := futuresApi.RemoveIsolatedMargin(req, context.TODO()) + if err != nil { + panic(err) + } + data, err := json.Marshal(resp.ToMap()) + if err != nil { + panic(err) + } + fmt.Println("code:", resp.CommonResponse.Code) + fmt.Println("message:", resp.CommonResponse.Message) + fmt.Println("data:", string(data)) +} + + +func TestFuturesModifyIsolatedMarginRiskLimtReq(t *testing.T) { + // ModifyIsolatedMarginRiskLimt + // Modify Isolated Margin Risk Limit + // /api/v1/copy-trade/futures/position/risk-limit-level/change + + builder := futures.NewModifyIsolatedMarginRiskLimtReqBuilder() + builder.SetSymbol(?).SetLevel(?) + req := builder.Build() + + resp, err := futuresApi.ModifyIsolatedMarginRiskLimt(req, context.TODO()) + if err != nil { + panic(err) + } + data, err := json.Marshal(resp.ToMap()) + if err != nil { + panic(err) + } + fmt.Println("code:", resp.CommonResponse.Code) + fmt.Println("message:", resp.CommonResponse.Message) + fmt.Println("data:", string(data)) +} + + +func TestFuturesModifyAutoDepositStatusReq(t *testing.T) { + // ModifyAutoDepositStatus + // Modify Isolated Margin Auto-Deposit Status + // /api/v1/copy-trade/futures/position/margin/auto-deposit-status + + builder := futures.NewModifyAutoDepositStatusReqBuilder() + builder.SetSymbol(?).SetStatus(?) + req := builder.Build() + + resp, err := futuresApi.ModifyAutoDepositStatus(req, context.TODO()) + if err != nil { + panic(err) + } + data, err := json.Marshal(resp.ToMap()) + if err != nil { + panic(err) + } + fmt.Println("code:", resp.CommonResponse.Code) + fmt.Println("message:", resp.CommonResponse.Message) + fmt.Println("data:", string(data)) +} + diff --git a/sdk/golang/pkg/generate/copytrading/futures/api_futures_test.go b/sdk/golang/pkg/generate/copytrading/futures/api_futures_test.go new file mode 100644 index 00000000..75f04ccd --- /dev/null +++ b/sdk/golang/pkg/generate/copytrading/futures/api_futures_test.go @@ -0,0 +1,316 @@ +package futures + +import ( + "encoding/json" + "github.com/Kucoin/kucoin-universal-sdk/sdk/golang/pkg/types" + "github.com/stretchr/testify/assert" + "testing" +) + +func TestFuturesAddOrderReqModel(t *testing.T) { + // AddOrder + // Add Order + // /api/v1/copy-trade/futures/orders + + data := "{\"clientOid\": \"5c52e11203aa677f33e493fb\", \"side\": \"buy\", \"symbol\": \"XBTUSDTM\", \"leverage\": 3, \"type\": \"limit\", \"remark\": \"order remarks\", \"reduceOnly\": false, \"marginMode\": \"ISOLATED\", \"price\": \"0.1\", \"size\": 1, \"timeInForce\": \"GTC\"}" + req := &AddOrderReq{} + err := json.Unmarshal([]byte(data), req) + req.ToMap() + assert.Nil(t, err) +} + +func TestFuturesAddOrderRespModel(t *testing.T) { + // AddOrder + // Add Order + // /api/v1/copy-trade/futures/orders + + data := "{\n \"code\": \"200000\",\n \"data\": {\n \"orderId\": \"263485113055133696\",\n \"clientOid\": \"5c52e11203aa677f331e493fb\"\n }\n}" + commonResp := &types.RestResponse{} + err := json.Unmarshal([]byte(data), commonResp) + assert.Nil(t, err) + assert.NotNil(t, commonResp.Data) + resp := &AddOrderResp{} + err = json.Unmarshal([]byte(commonResp.Data), resp) + resp.ToMap() + assert.Nil(t, err) +} + +func TestFuturesAddOrderTestReqModel(t *testing.T) { + // AddOrderTest + // Add Order Test + // /api/v1/copy-trade/futures/orders/test + + data := "{\"clientOid\": \"5c52e11203aa677f33e493fb\", \"side\": \"buy\", \"symbol\": \"XBTUSDTM\", \"leverage\": 3, \"type\": \"limit\", \"remark\": \"order remarks\", \"reduceOnly\": false, \"marginMode\": \"ISOLATED\", \"price\": \"0.1\", \"size\": 1, \"timeInForce\": \"GTC\"}" + req := &AddOrderTestReq{} + err := json.Unmarshal([]byte(data), req) + req.ToMap() + assert.Nil(t, err) +} + +func TestFuturesAddOrderTestRespModel(t *testing.T) { + // AddOrderTest + // Add Order Test + // /api/v1/copy-trade/futures/orders/test + + data := "{\n \"code\": \"200000\",\n \"data\": {\n \"orderId\": \"234125150956625920\",\n \"clientOid\": \"5c52e11203aa677f33e493fb\"\n }\n}" + commonResp := &types.RestResponse{} + err := json.Unmarshal([]byte(data), commonResp) + assert.Nil(t, err) + assert.NotNil(t, commonResp.Data) + resp := &AddOrderTestResp{} + err = json.Unmarshal([]byte(commonResp.Data), resp) + resp.ToMap() + assert.Nil(t, err) +} + +func TestFuturesAddTPSLOrderReqModel(t *testing.T) { + // AddTPSLOrder + // Add Take Profit And Stop Loss Order + // /api/v1/copy-trade/futures/st-orders + + data := "{\"clientOid\": \"5c52e11203aa677f33e493fb\", \"side\": \"buy\", \"symbol\": \"XBTUSDTM\", \"leverage\": 3, \"type\": \"limit\", \"remark\": \"order remarks\", \"reduceOnly\": false, \"marginMode\": \"ISOLATED\", \"price\": \"0.2\", \"size\": 1, \"timeInForce\": \"GTC\", \"triggerStopUpPrice\": \"0.3\", \"triggerStopDownPrice\": \"0.1\", \"stopPriceType\": \"TP\"}" + req := &AddTPSLOrderReq{} + err := json.Unmarshal([]byte(data), req) + req.ToMap() + assert.Nil(t, err) +} + +func TestFuturesAddTPSLOrderRespModel(t *testing.T) { + // AddTPSLOrder + // Add Take Profit And Stop Loss Order + // /api/v1/copy-trade/futures/st-orders + + data := "{\n \"code\": \"200000\",\n \"data\": {\n \"orderId\": \"234125150956625920\",\n \"clientOid\": \"5c52e11203aa677f33e493fb\"\n }\n}" + commonResp := &types.RestResponse{} + err := json.Unmarshal([]byte(data), commonResp) + assert.Nil(t, err) + assert.NotNil(t, commonResp.Data) + resp := &AddTPSLOrderResp{} + err = json.Unmarshal([]byte(commonResp.Data), resp) + resp.ToMap() + assert.Nil(t, err) +} + +func TestFuturesCancelOrderByIdReqModel(t *testing.T) { + // CancelOrderById + // Cancel Order By OrderId + // /api/v1/copy-trade/futures/orders + + data := "{\"orderId\": \"263485113055133696\"}" + req := &CancelOrderByIdReq{} + err := json.Unmarshal([]byte(data), req) + req.ToMap() + assert.Nil(t, err) +} + +func TestFuturesCancelOrderByIdRespModel(t *testing.T) { + // CancelOrderById + // Cancel Order By OrderId + // /api/v1/copy-trade/futures/orders + + data := "{\n \"code\": \"200000\",\n \"data\": {\n \"cancelledOrderIds\": [\n \"263485113055133696\"\n ]\n }\n}" + commonResp := &types.RestResponse{} + err := json.Unmarshal([]byte(data), commonResp) + assert.Nil(t, err) + assert.NotNil(t, commonResp.Data) + resp := &CancelOrderByIdResp{} + err = json.Unmarshal([]byte(commonResp.Data), resp) + resp.ToMap() + assert.Nil(t, err) +} + +func TestFuturesCancelOrderByClientOidReqModel(t *testing.T) { + // CancelOrderByClientOid + // Cancel Order By ClientOid + // /api/v1/copy-trade/futures/orders/client-order + + data := "{\"symbol\": \"XBTUSDTM\", \"clientOid\": \"5c52e11203aa677f331e493fb\"}" + req := &CancelOrderByClientOidReq{} + err := json.Unmarshal([]byte(data), req) + req.ToMap() + assert.Nil(t, err) +} + +func TestFuturesCancelOrderByClientOidRespModel(t *testing.T) { + // CancelOrderByClientOid + // Cancel Order By ClientOid + // /api/v1/copy-trade/futures/orders/client-order + + data := "{\n \"code\": \"200000\",\n \"data\": {\n \"clientOid\": \"5c52e11203aa677f331e4913fb\"\n }\n}" + commonResp := &types.RestResponse{} + err := json.Unmarshal([]byte(data), commonResp) + assert.Nil(t, err) + assert.NotNil(t, commonResp.Data) + resp := &CancelOrderByClientOidResp{} + err = json.Unmarshal([]byte(commonResp.Data), resp) + resp.ToMap() + assert.Nil(t, err) +} + +func TestFuturesGetMaxOpenSizeReqModel(t *testing.T) { + // GetMaxOpenSize + // Get Max Open Size + // /api/v1/copy-trade/futures/get-max-open-size + + data := "{\"symbol\": \"XBTUSDTM\", \"price\": \"example_string_default_value\", \"leverage\": 123456}" + req := &GetMaxOpenSizeReq{} + err := json.Unmarshal([]byte(data), req) + req.ToMap() + assert.Nil(t, err) +} + +func TestFuturesGetMaxOpenSizeRespModel(t *testing.T) { + // GetMaxOpenSize + // Get Max Open Size + // /api/v1/copy-trade/futures/get-max-open-size + + data := "{\n \"code\": \"200000\",\n \"data\": {\n \"symbol\": \"XBTUSDTM\",\n \"maxBuyOpenSize\": 8,\n \"maxSellOpenSize\": 5\n }\n}" + commonResp := &types.RestResponse{} + err := json.Unmarshal([]byte(data), commonResp) + assert.Nil(t, err) + assert.NotNil(t, commonResp.Data) + resp := &GetMaxOpenSizeResp{} + err = json.Unmarshal([]byte(commonResp.Data), resp) + resp.ToMap() + assert.Nil(t, err) +} + +func TestFuturesGetMaxWithdrawMarginReqModel(t *testing.T) { + // GetMaxWithdrawMargin + // Get Max Withdraw Margin + // /api/v1/copy-trade/futures/position/margin/max-withdraw-margin + + data := "{\"symbol\": \"example_string_default_value\"}" + req := &GetMaxWithdrawMarginReq{} + err := json.Unmarshal([]byte(data), req) + req.ToMap() + assert.Nil(t, err) +} + +func TestFuturesGetMaxWithdrawMarginRespModel(t *testing.T) { + // GetMaxWithdrawMargin + // Get Max Withdraw Margin + // /api/v1/copy-trade/futures/position/margin/max-withdraw-margin + + data := "{\n \"code\": \"200000\",\n \"data\": \"21.1135719252\"\n}" + commonResp := &types.RestResponse{} + err := json.Unmarshal([]byte(data), commonResp) + assert.Nil(t, err) + assert.NotNil(t, commonResp.Data) + resp := &GetMaxWithdrawMarginResp{} + err = json.Unmarshal([]byte(commonResp.Data), resp) + resp.ToMap() + assert.Nil(t, err) +} + +func TestFuturesAddIsolatedMarginReqModel(t *testing.T) { + // AddIsolatedMargin + // Add Isolated Margin + // /api/v1/copy-trade/futures/position/margin/deposit-margin + + data := "{\"symbol\": \"string\", \"margin\": 0, \"bizNo\": \"string\"}" + req := &AddIsolatedMarginReq{} + err := json.Unmarshal([]byte(data), req) + req.ToMap() + assert.Nil(t, err) +} + +func TestFuturesAddIsolatedMarginRespModel(t *testing.T) { + // AddIsolatedMargin + // Add Isolated Margin + // /api/v1/copy-trade/futures/position/margin/deposit-margin + + data := "{\n \"code\": \"200000\",\n \"data\": {\n \"id\": \"6200c9b83aecfb000152ddcd\",\n \"symbol\": \"XBTUSDTM\",\n \"autoDeposit\": false,\n \"maintMarginReq\": 0.005,\n \"riskLimit\": 500000,\n \"realLeverage\": 18.72,\n \"crossMode\": false,\n \"delevPercentage\": 0.66,\n \"openingTimestamp\": 1646287090131,\n \"currentTimestamp\": 1646295055021,\n \"currentQty\": 1,\n \"currentCost\": 43.388,\n \"currentComm\": 0.0260328,\n \"unrealisedCost\": 43.388,\n \"realisedGrossCost\": 0,\n \"realisedCost\": 0.0260328,\n \"isOpen\": true,\n \"markPrice\": 43536.65,\n \"markValue\": 43.53665,\n \"posCost\": 43.388,\n \"posCross\": 0.000024985,\n \"posInit\": 2.1694,\n \"posComm\": 0.02733446,\n \"posLoss\": 0,\n \"posMargin\": 2.19675944,\n \"posMaint\": 0.24861326,\n \"maintMargin\": 2.34540944,\n \"realisedGrossPnl\": 0,\n \"realisedPnl\": -0.0260328,\n \"unrealisedPnl\": 0.14865,\n \"unrealisedPnlPcnt\": 0.0034,\n \"unrealisedRoePcnt\": 0.0685,\n \"avgEntryPrice\": 43388,\n \"liquidationPrice\": 41440,\n \"bankruptPrice\": 41218,\n \"userId\": 1234321123,\n \"settleCurrency\": \"USDT\"\n }\n}" + commonResp := &types.RestResponse{} + err := json.Unmarshal([]byte(data), commonResp) + assert.Nil(t, err) + assert.NotNil(t, commonResp.Data) + resp := &AddIsolatedMarginResp{} + err = json.Unmarshal([]byte(commonResp.Data), resp) + resp.ToMap() + assert.Nil(t, err) +} + +func TestFuturesRemoveIsolatedMarginReqModel(t *testing.T) { + // RemoveIsolatedMargin + // Remove Isolated Margin + // /api/v1/copy-trade/futures/position/margin/withdraw-margin + + data := "{\"symbol\": \"XBTUSDTM\", \"withdrawAmount\": \"0.0000001\"}" + req := &RemoveIsolatedMarginReq{} + err := json.Unmarshal([]byte(data), req) + req.ToMap() + assert.Nil(t, err) +} + +func TestFuturesRemoveIsolatedMarginRespModel(t *testing.T) { + // RemoveIsolatedMargin + // Remove Isolated Margin + // /api/v1/copy-trade/futures/position/margin/withdraw-margin + + data := "{\n \"code\": \"200000\",\n \"data\": \"0.1\"\n}" + commonResp := &types.RestResponse{} + err := json.Unmarshal([]byte(data), commonResp) + assert.Nil(t, err) + assert.NotNil(t, commonResp.Data) + resp := &RemoveIsolatedMarginResp{} + err = json.Unmarshal([]byte(commonResp.Data), resp) + resp.ToMap() + assert.Nil(t, err) +} + +func TestFuturesModifyIsolatedMarginRiskLimtReqModel(t *testing.T) { + // ModifyIsolatedMarginRiskLimt + // Modify Isolated Margin Risk Limit + // /api/v1/copy-trade/futures/position/risk-limit-level/change + + data := "{\"symbol\": \"XBTUSDTM\", \"level\": 1}" + req := &ModifyIsolatedMarginRiskLimtReq{} + err := json.Unmarshal([]byte(data), req) + req.ToMap() + assert.Nil(t, err) +} + +func TestFuturesModifyIsolatedMarginRiskLimtRespModel(t *testing.T) { + // ModifyIsolatedMarginRiskLimt + // Modify Isolated Margin Risk Limit + // /api/v1/copy-trade/futures/position/risk-limit-level/change + + data := "{\n \"code\": \"200000\",\n \"data\": true\n}" + commonResp := &types.RestResponse{} + err := json.Unmarshal([]byte(data), commonResp) + assert.Nil(t, err) + assert.NotNil(t, commonResp.Data) + resp := &ModifyIsolatedMarginRiskLimtResp{} + err = json.Unmarshal([]byte(commonResp.Data), resp) + resp.ToMap() + assert.Nil(t, err) +} + +func TestFuturesModifyAutoDepositStatusReqModel(t *testing.T) { + // ModifyAutoDepositStatus + // Modify Isolated Margin Auto-Deposit Status + // /api/v1/copy-trade/futures/position/margin/auto-deposit-status + + data := "{\"symbol\": \"XBTUSDTM\", \"status\": true}" + req := &ModifyAutoDepositStatusReq{} + err := json.Unmarshal([]byte(data), req) + req.ToMap() + assert.Nil(t, err) +} + +func TestFuturesModifyAutoDepositStatusRespModel(t *testing.T) { + // ModifyAutoDepositStatus + // Modify Isolated Margin Auto-Deposit Status + // /api/v1/copy-trade/futures/position/margin/auto-deposit-status + + data := "{\n \"code\": \"200000\",\n \"data\": true\n}" + commonResp := &types.RestResponse{} + err := json.Unmarshal([]byte(data), commonResp) + assert.Nil(t, err) + assert.NotNil(t, commonResp.Data) + resp := &ModifyAutoDepositStatusResp{} + err = json.Unmarshal([]byte(commonResp.Data), resp) + resp.ToMap() + assert.Nil(t, err) +} diff --git a/sdk/golang/pkg/generate/copytrading/futures/types_add_isolated_margin_req.go b/sdk/golang/pkg/generate/copytrading/futures/types_add_isolated_margin_req.go new file mode 100644 index 00000000..011ad561 --- /dev/null +++ b/sdk/golang/pkg/generate/copytrading/futures/types_add_isolated_margin_req.go @@ -0,0 +1,68 @@ +// Code generated by Kucoin Universal SDK Generator; DO NOT EDIT. + +package futures + +// AddIsolatedMarginReq struct for AddIsolatedMarginReq +type AddIsolatedMarginReq struct { + // Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) + Symbol string `json:"symbol,omitempty"` + // Margin amount (min. margin amount≥0.00001667XBT) + Margin float32 `json:"margin,omitempty"` + // A unique ID generated by the user, to ensure the operation is processed by the system only once, The maximum length cannot exceed 36 + BizNo string `json:"bizNo,omitempty"` +} + +// NewAddIsolatedMarginReq instantiates a new AddIsolatedMarginReq object +// This constructor will assign default values to properties that have it defined +func NewAddIsolatedMarginReq(symbol string, margin float32, bizNo string) *AddIsolatedMarginReq { + this := AddIsolatedMarginReq{} + this.Symbol = symbol + this.Margin = margin + this.BizNo = bizNo + return &this +} + +// NewAddIsolatedMarginReqWithDefaults instantiates a new AddIsolatedMarginReq object +// This constructor will only assign default values to properties that have it defined, +func NewAddIsolatedMarginReqWithDefaults() *AddIsolatedMarginReq { + this := AddIsolatedMarginReq{} + return &this +} + +func (o *AddIsolatedMarginReq) ToMap() map[string]interface{} { + toSerialize := map[string]interface{}{} + toSerialize["symbol"] = o.Symbol + toSerialize["margin"] = o.Margin + toSerialize["bizNo"] = o.BizNo + return toSerialize +} + +type AddIsolatedMarginReqBuilder struct { + obj *AddIsolatedMarginReq +} + +func NewAddIsolatedMarginReqBuilder() *AddIsolatedMarginReqBuilder { + return &AddIsolatedMarginReqBuilder{obj: NewAddIsolatedMarginReqWithDefaults()} +} + +// Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) +func (builder *AddIsolatedMarginReqBuilder) SetSymbol(value string) *AddIsolatedMarginReqBuilder { + builder.obj.Symbol = value + return builder +} + +// Margin amount (min. margin amount≥0.00001667XBT) +func (builder *AddIsolatedMarginReqBuilder) SetMargin(value float32) *AddIsolatedMarginReqBuilder { + builder.obj.Margin = value + return builder +} + +// A unique ID generated by the user, to ensure the operation is processed by the system only once, The maximum length cannot exceed 36 +func (builder *AddIsolatedMarginReqBuilder) SetBizNo(value string) *AddIsolatedMarginReqBuilder { + builder.obj.BizNo = value + return builder +} + +func (builder *AddIsolatedMarginReqBuilder) Build() *AddIsolatedMarginReq { + return builder.obj +} diff --git a/sdk/golang/pkg/generate/copytrading/futures/types_add_isolated_margin_resp.go b/sdk/golang/pkg/generate/copytrading/futures/types_add_isolated_margin_resp.go new file mode 100644 index 00000000..02f81cad --- /dev/null +++ b/sdk/golang/pkg/generate/copytrading/futures/types_add_isolated_margin_resp.go @@ -0,0 +1,184 @@ +// Code generated by Kucoin Universal SDK Generator; DO NOT EDIT. + +package futures + +import ( + "github.com/Kucoin/kucoin-universal-sdk/sdk/golang/pkg/types" +) + +// AddIsolatedMarginResp struct for AddIsolatedMarginResp +type AddIsolatedMarginResp struct { + // common response + CommonResponse *types.RestResponse + // Position ID + Id string `json:"id,omitempty"` + // Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) + Symbol string `json:"symbol,omitempty"` + // Auto deposit margin or not + AutoDeposit bool `json:"autoDeposit,omitempty"` + // Maintenance margin requirement + MaintMarginReq float32 `json:"maintMarginReq,omitempty"` + // Risk limit + RiskLimit int32 `json:"riskLimit,omitempty"` + // Leverage o the order + RealLeverage float32 `json:"realLeverage,omitempty"` + // Cross mode or not + CrossMode bool `json:"crossMode,omitempty"` + // ADL ranking percentile + DelevPercentage float32 `json:"delevPercentage,omitempty"` + // Open time + OpeningTimestamp int64 `json:"openingTimestamp,omitempty"` + // Current timestamp + CurrentTimestamp int64 `json:"currentTimestamp,omitempty"` + // Current postion quantity + CurrentQty int32 `json:"currentQty,omitempty"` + // Current postion value + CurrentCost float32 `json:"currentCost,omitempty"` + // Current commission + CurrentComm float32 `json:"currentComm,omitempty"` + // Unrealised value + UnrealisedCost float32 `json:"unrealisedCost,omitempty"` + // Accumulated realised gross profit value + RealisedGrossCost float32 `json:"realisedGrossCost,omitempty"` + // Current realised position value + RealisedCost float32 `json:"realisedCost,omitempty"` + // Opened position or not + IsOpen bool `json:"isOpen,omitempty"` + // Mark price + MarkPrice float32 `json:"markPrice,omitempty"` + // Mark value + MarkValue float32 `json:"markValue,omitempty"` + // Position value + PosCost float32 `json:"posCost,omitempty"` + // added margin + PosCross float32 `json:"posCross,omitempty"` + // Leverage margin + PosInit float32 `json:"posInit,omitempty"` + // Bankruptcy cost + PosComm float32 `json:"posComm,omitempty"` + // Funding fees paid out + PosLoss float32 `json:"posLoss,omitempty"` + // Position margin + PosMargin float32 `json:"posMargin,omitempty"` + // Maintenance margin + PosMaint float32 `json:"posMaint,omitempty"` + // Position margin + MaintMargin float32 `json:"maintMargin,omitempty"` + // Accumulated realised gross profit value + RealisedGrossPnl float32 `json:"realisedGrossPnl,omitempty"` + // Realised profit and loss + RealisedPnl float32 `json:"realisedPnl,omitempty"` + // Unrealised profit and loss + UnrealisedPnl float32 `json:"unrealisedPnl,omitempty"` + // Profit-loss ratio of the position + UnrealisedPnlPcnt float32 `json:"unrealisedPnlPcnt,omitempty"` + // Rate of return on investment + UnrealisedRoePcnt float32 `json:"unrealisedRoePcnt,omitempty"` + // Average entry price + AvgEntryPrice float32 `json:"avgEntryPrice,omitempty"` + // Liquidation price + LiquidationPrice float32 `json:"liquidationPrice,omitempty"` + // Bankruptcy price + BankruptPrice float32 `json:"bankruptPrice,omitempty"` + // userId + UserId int32 `json:"userId,omitempty"` + // Currency used to clear and settle the trades + SettleCurrency string `json:"settleCurrency,omitempty"` +} + +// NewAddIsolatedMarginResp instantiates a new AddIsolatedMarginResp object +// This constructor will assign default values to properties that have it defined +func NewAddIsolatedMarginResp(id string, symbol string, autoDeposit bool, maintMarginReq float32, riskLimit int32, realLeverage float32, crossMode bool, delevPercentage float32, openingTimestamp int64, currentTimestamp int64, currentQty int32, currentCost float32, currentComm float32, unrealisedCost float32, realisedGrossCost float32, realisedCost float32, isOpen bool, markPrice float32, markValue float32, posCost float32, posCross float32, posInit float32, posComm float32, posLoss float32, posMargin float32, posMaint float32, maintMargin float32, realisedGrossPnl float32, realisedPnl float32, unrealisedPnl float32, unrealisedPnlPcnt float32, unrealisedRoePcnt float32, avgEntryPrice float32, liquidationPrice float32, bankruptPrice float32, userId int32, settleCurrency string) *AddIsolatedMarginResp { + this := AddIsolatedMarginResp{} + this.Id = id + this.Symbol = symbol + this.AutoDeposit = autoDeposit + this.MaintMarginReq = maintMarginReq + this.RiskLimit = riskLimit + this.RealLeverage = realLeverage + this.CrossMode = crossMode + this.DelevPercentage = delevPercentage + this.OpeningTimestamp = openingTimestamp + this.CurrentTimestamp = currentTimestamp + this.CurrentQty = currentQty + this.CurrentCost = currentCost + this.CurrentComm = currentComm + this.UnrealisedCost = unrealisedCost + this.RealisedGrossCost = realisedGrossCost + this.RealisedCost = realisedCost + this.IsOpen = isOpen + this.MarkPrice = markPrice + this.MarkValue = markValue + this.PosCost = posCost + this.PosCross = posCross + this.PosInit = posInit + this.PosComm = posComm + this.PosLoss = posLoss + this.PosMargin = posMargin + this.PosMaint = posMaint + this.MaintMargin = maintMargin + this.RealisedGrossPnl = realisedGrossPnl + this.RealisedPnl = realisedPnl + this.UnrealisedPnl = unrealisedPnl + this.UnrealisedPnlPcnt = unrealisedPnlPcnt + this.UnrealisedRoePcnt = unrealisedRoePcnt + this.AvgEntryPrice = avgEntryPrice + this.LiquidationPrice = liquidationPrice + this.BankruptPrice = bankruptPrice + this.UserId = userId + this.SettleCurrency = settleCurrency + return &this +} + +// NewAddIsolatedMarginRespWithDefaults instantiates a new AddIsolatedMarginResp object +// This constructor will only assign default values to properties that have it defined, +func NewAddIsolatedMarginRespWithDefaults() *AddIsolatedMarginResp { + this := AddIsolatedMarginResp{} + return &this +} + +func (o *AddIsolatedMarginResp) ToMap() map[string]interface{} { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["symbol"] = o.Symbol + toSerialize["autoDeposit"] = o.AutoDeposit + toSerialize["maintMarginReq"] = o.MaintMarginReq + toSerialize["riskLimit"] = o.RiskLimit + toSerialize["realLeverage"] = o.RealLeverage + toSerialize["crossMode"] = o.CrossMode + toSerialize["delevPercentage"] = o.DelevPercentage + toSerialize["openingTimestamp"] = o.OpeningTimestamp + toSerialize["currentTimestamp"] = o.CurrentTimestamp + toSerialize["currentQty"] = o.CurrentQty + toSerialize["currentCost"] = o.CurrentCost + toSerialize["currentComm"] = o.CurrentComm + toSerialize["unrealisedCost"] = o.UnrealisedCost + toSerialize["realisedGrossCost"] = o.RealisedGrossCost + toSerialize["realisedCost"] = o.RealisedCost + toSerialize["isOpen"] = o.IsOpen + toSerialize["markPrice"] = o.MarkPrice + toSerialize["markValue"] = o.MarkValue + toSerialize["posCost"] = o.PosCost + toSerialize["posCross"] = o.PosCross + toSerialize["posInit"] = o.PosInit + toSerialize["posComm"] = o.PosComm + toSerialize["posLoss"] = o.PosLoss + toSerialize["posMargin"] = o.PosMargin + toSerialize["posMaint"] = o.PosMaint + toSerialize["maintMargin"] = o.MaintMargin + toSerialize["realisedGrossPnl"] = o.RealisedGrossPnl + toSerialize["realisedPnl"] = o.RealisedPnl + toSerialize["unrealisedPnl"] = o.UnrealisedPnl + toSerialize["unrealisedPnlPcnt"] = o.UnrealisedPnlPcnt + toSerialize["unrealisedRoePcnt"] = o.UnrealisedRoePcnt + toSerialize["avgEntryPrice"] = o.AvgEntryPrice + toSerialize["liquidationPrice"] = o.LiquidationPrice + toSerialize["bankruptPrice"] = o.BankruptPrice + toSerialize["userId"] = o.UserId + toSerialize["settleCurrency"] = o.SettleCurrency + return toSerialize +} + +func (o *AddIsolatedMarginResp) SetCommonResponse(response *types.RestResponse) { + o.CommonResponse = response +} diff --git a/sdk/golang/pkg/generate/copytrading/futures/types_add_order_req.go b/sdk/golang/pkg/generate/copytrading/futures/types_add_order_req.go new file mode 100644 index 00000000..001671cf --- /dev/null +++ b/sdk/golang/pkg/generate/copytrading/futures/types_add_order_req.go @@ -0,0 +1,257 @@ +// Code generated by Kucoin Universal SDK Generator; DO NOT EDIT. + +package futures + +// AddOrderReq struct for AddOrderReq +type AddOrderReq struct { + // Unique order id created by users to identify their orders, the maximum length cannot exceed 40, e.g. UUID, Only allows numbers, characters, underline(_), and separator(-) + ClientOid string `json:"clientOid,omitempty"` + // specify if the order is to 'buy' or 'sell' + Side string `json:"side,omitempty"` + // Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) + Symbol string `json:"symbol,omitempty"` + // Used to calculate the margin to be frozen for the order. If you are to close the position, this parameter is not required. + Leverage *int32 `json:"leverage,omitempty"` + // specify if the order is an 'limit' order or 'market' order + Type string `json:"type,omitempty"` + // remark for the order, length cannot exceed 100 utf8 characters + Remark *string `json:"remark,omitempty"` + // Either 'down' or 'up'. If stop is used,parameter stopPrice and stopPriceType also need to be provieded. + Stop *string `json:"stop,omitempty"` + // Either 'TP', 'IP' or 'MP', Need to be defined if stop is specified. + StopPriceType *string `json:"stopPriceType,omitempty"` + // Need to be defined if stop is specified. + StopPrice *string `json:"stopPrice,omitempty"` + // A mark to reduce the position size only. Set to false by default. Need to set the position size when reduceOnly is true. If set to true, only the orders reducing the position size will be executed. If the reduce-only order size exceeds the position size, the extra size will be canceled. + ReduceOnly *bool `json:"reduceOnly,omitempty"` + // A mark to close the position. Set to false by default. If closeOrder is set to true, the system will close the position and the position size will become 0. Side, Size and Leverage fields can be left empty and the system will determine the side and size automatically. + CloseOrder *bool `json:"closeOrder,omitempty"` + // A mark to forcely hold the funds for an order, even though it's an order to reduce the position size. This helps the order stay on the order book and not get canceled when the position size changes. Set to false by default. The system will forcely freeze certain amount of funds for this order, including orders whose direction is opposite to the current positions. This feature is to ensure that the order won’t be canceled by the matching engine in such a circumstance that not enough funds are frozen for the order. + ForceHold *bool `json:"forceHold,omitempty"` + // Margin mode: ISOLATED, CROSS, default: ISOLATED + MarginMode *string `json:"marginMode,omitempty"` + // Required for type is 'limit' order, indicating the operating price + Price *string `json:"price,omitempty"` + // Order size (Lot), must be a positive integer. The quantity unit of coin-swap contracts is size(lot), and other units are not supported. + Size int32 `json:"size,omitempty"` + // Optional for type is 'limit' order, [Time in force](https://www.kucoin.com/docs-new/doc-338146) is a special strategy used during trading, default is GTC + TimeInForce *string `json:"timeInForce,omitempty"` + // Optional for type is 'limit' order, post only flag, invalid when timeInForce is IOC. When postOnly is true, not allowed choose hidden or iceberg. The post-only flag ensures that the trader always pays the maker fee and provides liquidity to the order book. If any part of the order is going to pay taker fee, the order will be fully rejected. + PostOnly *bool `json:"postOnly,omitempty"` + // Optional for type is 'limit' order, orders not displaying in order book. When hidden chose, not allowed choose postOnly. + Hidden *bool `json:"hidden,omitempty"` + // Optional for type is 'limit' order, Only visible portion of the order is displayed in the order book. When iceberg chose, not allowed choose postOnly. + Iceberg *bool `json:"iceberg,omitempty"` + // Optional for type is 'limit' order, The maximum visible size of an iceberg order. please place order in size (lots), The units of qty (base currency) and valueQty (value) are not supported. + VisibleSize *string `json:"visibleSize,omitempty"` +} + +// NewAddOrderReq instantiates a new AddOrderReq object +// This constructor will assign default values to properties that have it defined +func NewAddOrderReq(clientOid string, side string, symbol string, Type_ string, size int32) *AddOrderReq { + this := AddOrderReq{} + this.ClientOid = clientOid + this.Side = side + this.Symbol = symbol + this.Type = Type_ + var reduceOnly bool = false + this.ReduceOnly = &reduceOnly + var closeOrder bool = false + this.CloseOrder = &closeOrder + var forceHold bool = false + this.ForceHold = &forceHold + var marginMode string = "ISOLATED" + this.MarginMode = &marginMode + this.Size = size + var timeInForce string = "GTC" + this.TimeInForce = &timeInForce + var postOnly bool = false + this.PostOnly = &postOnly + var hidden bool = false + this.Hidden = &hidden + var iceberg bool = false + this.Iceberg = &iceberg + return &this +} + +// NewAddOrderReqWithDefaults instantiates a new AddOrderReq object +// This constructor will only assign default values to properties that have it defined, +func NewAddOrderReqWithDefaults() *AddOrderReq { + this := AddOrderReq{} + var Type_ string = "limit" + this.Type = Type_ + var reduceOnly bool = false + this.ReduceOnly = &reduceOnly + var closeOrder bool = false + this.CloseOrder = &closeOrder + var forceHold bool = false + this.ForceHold = &forceHold + var marginMode string = "ISOLATED" + this.MarginMode = &marginMode + var timeInForce string = "GTC" + this.TimeInForce = &timeInForce + var postOnly bool = false + this.PostOnly = &postOnly + var hidden bool = false + this.Hidden = &hidden + var iceberg bool = false + this.Iceberg = &iceberg + return &this +} + +func (o *AddOrderReq) ToMap() map[string]interface{} { + toSerialize := map[string]interface{}{} + toSerialize["clientOid"] = o.ClientOid + toSerialize["side"] = o.Side + toSerialize["symbol"] = o.Symbol + toSerialize["leverage"] = o.Leverage + toSerialize["type"] = o.Type + toSerialize["remark"] = o.Remark + toSerialize["stop"] = o.Stop + toSerialize["stopPriceType"] = o.StopPriceType + toSerialize["stopPrice"] = o.StopPrice + toSerialize["reduceOnly"] = o.ReduceOnly + toSerialize["closeOrder"] = o.CloseOrder + toSerialize["forceHold"] = o.ForceHold + toSerialize["marginMode"] = o.MarginMode + toSerialize["price"] = o.Price + toSerialize["size"] = o.Size + toSerialize["timeInForce"] = o.TimeInForce + toSerialize["postOnly"] = o.PostOnly + toSerialize["hidden"] = o.Hidden + toSerialize["iceberg"] = o.Iceberg + toSerialize["visibleSize"] = o.VisibleSize + return toSerialize +} + +type AddOrderReqBuilder struct { + obj *AddOrderReq +} + +func NewAddOrderReqBuilder() *AddOrderReqBuilder { + return &AddOrderReqBuilder{obj: NewAddOrderReqWithDefaults()} +} + +// Unique order id created by users to identify their orders, the maximum length cannot exceed 40, e.g. UUID, Only allows numbers, characters, underline(_), and separator(-) +func (builder *AddOrderReqBuilder) SetClientOid(value string) *AddOrderReqBuilder { + builder.obj.ClientOid = value + return builder +} + +// specify if the order is to 'buy' or 'sell' +func (builder *AddOrderReqBuilder) SetSide(value string) *AddOrderReqBuilder { + builder.obj.Side = value + return builder +} + +// Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) +func (builder *AddOrderReqBuilder) SetSymbol(value string) *AddOrderReqBuilder { + builder.obj.Symbol = value + return builder +} + +// Used to calculate the margin to be frozen for the order. If you are to close the position, this parameter is not required. +func (builder *AddOrderReqBuilder) SetLeverage(value int32) *AddOrderReqBuilder { + builder.obj.Leverage = &value + return builder +} + +// specify if the order is an 'limit' order or 'market' order +func (builder *AddOrderReqBuilder) SetType(value string) *AddOrderReqBuilder { + builder.obj.Type = value + return builder +} + +// remark for the order, length cannot exceed 100 utf8 characters +func (builder *AddOrderReqBuilder) SetRemark(value string) *AddOrderReqBuilder { + builder.obj.Remark = &value + return builder +} + +// Either 'down' or 'up'. If stop is used,parameter stopPrice and stopPriceType also need to be provieded. +func (builder *AddOrderReqBuilder) SetStop(value string) *AddOrderReqBuilder { + builder.obj.Stop = &value + return builder +} + +// Either 'TP', 'IP' or 'MP', Need to be defined if stop is specified. +func (builder *AddOrderReqBuilder) SetStopPriceType(value string) *AddOrderReqBuilder { + builder.obj.StopPriceType = &value + return builder +} + +// Need to be defined if stop is specified. +func (builder *AddOrderReqBuilder) SetStopPrice(value string) *AddOrderReqBuilder { + builder.obj.StopPrice = &value + return builder +} + +// A mark to reduce the position size only. Set to false by default. Need to set the position size when reduceOnly is true. If set to true, only the orders reducing the position size will be executed. If the reduce-only order size exceeds the position size, the extra size will be canceled. +func (builder *AddOrderReqBuilder) SetReduceOnly(value bool) *AddOrderReqBuilder { + builder.obj.ReduceOnly = &value + return builder +} + +// A mark to close the position. Set to false by default. If closeOrder is set to true, the system will close the position and the position size will become 0. Side, Size and Leverage fields can be left empty and the system will determine the side and size automatically. +func (builder *AddOrderReqBuilder) SetCloseOrder(value bool) *AddOrderReqBuilder { + builder.obj.CloseOrder = &value + return builder +} + +// A mark to forcely hold the funds for an order, even though it's an order to reduce the position size. This helps the order stay on the order book and not get canceled when the position size changes. Set to false by default. The system will forcely freeze certain amount of funds for this order, including orders whose direction is opposite to the current positions. This feature is to ensure that the order won’t be canceled by the matching engine in such a circumstance that not enough funds are frozen for the order. +func (builder *AddOrderReqBuilder) SetForceHold(value bool) *AddOrderReqBuilder { + builder.obj.ForceHold = &value + return builder +} + +// Margin mode: ISOLATED, CROSS, default: ISOLATED +func (builder *AddOrderReqBuilder) SetMarginMode(value string) *AddOrderReqBuilder { + builder.obj.MarginMode = &value + return builder +} + +// Required for type is 'limit' order, indicating the operating price +func (builder *AddOrderReqBuilder) SetPrice(value string) *AddOrderReqBuilder { + builder.obj.Price = &value + return builder +} + +// Order size (Lot), must be a positive integer. The quantity unit of coin-swap contracts is size(lot), and other units are not supported. +func (builder *AddOrderReqBuilder) SetSize(value int32) *AddOrderReqBuilder { + builder.obj.Size = value + return builder +} + +// Optional for type is 'limit' order, [Time in force](https://www.kucoin.com/docs-new/doc-338146) is a special strategy used during trading, default is GTC +func (builder *AddOrderReqBuilder) SetTimeInForce(value string) *AddOrderReqBuilder { + builder.obj.TimeInForce = &value + return builder +} + +// Optional for type is 'limit' order, post only flag, invalid when timeInForce is IOC. When postOnly is true, not allowed choose hidden or iceberg. The post-only flag ensures that the trader always pays the maker fee and provides liquidity to the order book. If any part of the order is going to pay taker fee, the order will be fully rejected. +func (builder *AddOrderReqBuilder) SetPostOnly(value bool) *AddOrderReqBuilder { + builder.obj.PostOnly = &value + return builder +} + +// Optional for type is 'limit' order, orders not displaying in order book. When hidden chose, not allowed choose postOnly. +func (builder *AddOrderReqBuilder) SetHidden(value bool) *AddOrderReqBuilder { + builder.obj.Hidden = &value + return builder +} + +// Optional for type is 'limit' order, Only visible portion of the order is displayed in the order book. When iceberg chose, not allowed choose postOnly. +func (builder *AddOrderReqBuilder) SetIceberg(value bool) *AddOrderReqBuilder { + builder.obj.Iceberg = &value + return builder +} + +// Optional for type is 'limit' order, The maximum visible size of an iceberg order. please place order in size (lots), The units of qty (base currency) and valueQty (value) are not supported. +func (builder *AddOrderReqBuilder) SetVisibleSize(value string) *AddOrderReqBuilder { + builder.obj.VisibleSize = &value + return builder +} + +func (builder *AddOrderReqBuilder) Build() *AddOrderReq { + return builder.obj +} diff --git a/sdk/golang/pkg/generate/copytrading/futures/types_add_order_resp.go b/sdk/golang/pkg/generate/copytrading/futures/types_add_order_resp.go new file mode 100644 index 00000000..ba5f5f89 --- /dev/null +++ b/sdk/golang/pkg/generate/copytrading/futures/types_add_order_resp.go @@ -0,0 +1,44 @@ +// Code generated by Kucoin Universal SDK Generator; DO NOT EDIT. + +package futures + +import ( + "github.com/Kucoin/kucoin-universal-sdk/sdk/golang/pkg/types" +) + +// AddOrderResp struct for AddOrderResp +type AddOrderResp struct { + // common response + CommonResponse *types.RestResponse + // The unique order id generated by the trading system,which can be used later for further actions such as canceling the order. + OrderId string `json:"orderId,omitempty"` + // The user self-defined order id. + ClientOid string `json:"clientOid,omitempty"` +} + +// NewAddOrderResp instantiates a new AddOrderResp object +// This constructor will assign default values to properties that have it defined +func NewAddOrderResp(orderId string, clientOid string) *AddOrderResp { + this := AddOrderResp{} + this.OrderId = orderId + this.ClientOid = clientOid + return &this +} + +// NewAddOrderRespWithDefaults instantiates a new AddOrderResp object +// This constructor will only assign default values to properties that have it defined, +func NewAddOrderRespWithDefaults() *AddOrderResp { + this := AddOrderResp{} + return &this +} + +func (o *AddOrderResp) ToMap() map[string]interface{} { + toSerialize := map[string]interface{}{} + toSerialize["orderId"] = o.OrderId + toSerialize["clientOid"] = o.ClientOid + return toSerialize +} + +func (o *AddOrderResp) SetCommonResponse(response *types.RestResponse) { + o.CommonResponse = response +} diff --git a/sdk/golang/pkg/generate/copytrading/futures/types_add_order_test_req.go b/sdk/golang/pkg/generate/copytrading/futures/types_add_order_test_req.go new file mode 100644 index 00000000..b26a7ee8 --- /dev/null +++ b/sdk/golang/pkg/generate/copytrading/futures/types_add_order_test_req.go @@ -0,0 +1,258 @@ +// Code generated by Kucoin Universal SDK Generator; DO NOT EDIT. + +package futures + +// AddOrderTestReq struct for AddOrderTestReq +type AddOrderTestReq struct { + // Unique order id created by users to identify their orders, the maximum length cannot exceed 40, e.g. UUID, Only allows numbers, characters, underline(_), and separator(-) + ClientOid string `json:"clientOid,omitempty"` + // specify if the order is to 'buy' or 'sell' + Side string `json:"side,omitempty"` + // Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) + Symbol string `json:"symbol,omitempty"` + // Used to calculate the margin to be frozen for the order. If you are to close the position, this parameter is not required. + Leverage int32 `json:"leverage,omitempty"` + // specify if the order is an 'limit' order or 'market' order + Type string `json:"type,omitempty"` + // remark for the order, length cannot exceed 100 utf8 characters + Remark *string `json:"remark,omitempty"` + // Either 'down' or 'up'. If stop is used,parameter stopPrice and stopPriceType also need to be provieded. + Stop *string `json:"stop,omitempty"` + // Either 'TP', 'IP' or 'MP', Need to be defined if stop is specified. + StopPriceType *string `json:"stopPriceType,omitempty"` + // Need to be defined if stop is specified. + StopPrice *string `json:"stopPrice,omitempty"` + // A mark to reduce the position size only. Set to false by default. Need to set the position size when reduceOnly is true. If set to true, only the orders reducing the position size will be executed. If the reduce-only order size exceeds the position size, the extra size will be canceled. + ReduceOnly *bool `json:"reduceOnly,omitempty"` + // A mark to close the position. Set to false by default. If closeOrder is set to true, the system will close the position and the position size will become 0. Side, Size and Leverage fields can be left empty and the system will determine the side and size automatically. + CloseOrder *bool `json:"closeOrder,omitempty"` + // A mark to forcely hold the funds for an order, even though it's an order to reduce the position size. This helps the order stay on the order book and not get canceled when the position size changes. Set to false by default. The system will forcely freeze certain amount of funds for this order, including orders whose direction is opposite to the current positions. This feature is to ensure that the order won’t be canceled by the matching engine in such a circumstance that not enough funds are frozen for the order. + ForceHold *bool `json:"forceHold,omitempty"` + // Margin mode: ISOLATED, CROSS, default: ISOLATED + MarginMode *string `json:"marginMode,omitempty"` + // Required for type is 'limit' order, indicating the operating price + Price *string `json:"price,omitempty"` + // Order size (Lot), must be a positive integer. The quantity unit of coin-swap contracts is size(lot), and other units are not supported. + Size int32 `json:"size,omitempty"` + // Optional for type is 'limit' order, [Time in force](https://www.kucoin.com/docs-new/doc-338146) is a special strategy used during trading, default is GTC + TimeInForce *string `json:"timeInForce,omitempty"` + // Optional for type is 'limit' order, post only flag, invalid when timeInForce is IOC. When postOnly is true, not allowed choose hidden or iceberg. The post-only flag ensures that the trader always pays the maker fee and provides liquidity to the order book. If any part of the order is going to pay taker fee, the order will be fully rejected. + PostOnly *bool `json:"postOnly,omitempty"` + // Optional for type is 'limit' order, orders not displaying in order book. When hidden chose, not allowed choose postOnly. + Hidden *bool `json:"hidden,omitempty"` + // Optional for type is 'limit' order, Only visible portion of the order is displayed in the order book. When iceberg chose, not allowed choose postOnly. + Iceberg *bool `json:"iceberg,omitempty"` + // Optional for type is 'limit' order, The maximum visible size of an iceberg order. please place order in size (lots), The units of qty (base currency) and valueQty (value) are not supported. + VisibleSize *string `json:"visibleSize,omitempty"` +} + +// NewAddOrderTestReq instantiates a new AddOrderTestReq object +// This constructor will assign default values to properties that have it defined +func NewAddOrderTestReq(clientOid string, side string, symbol string, leverage int32, Type_ string, size int32) *AddOrderTestReq { + this := AddOrderTestReq{} + this.ClientOid = clientOid + this.Side = side + this.Symbol = symbol + this.Leverage = leverage + this.Type = Type_ + var reduceOnly bool = false + this.ReduceOnly = &reduceOnly + var closeOrder bool = false + this.CloseOrder = &closeOrder + var forceHold bool = false + this.ForceHold = &forceHold + var marginMode string = "ISOLATED" + this.MarginMode = &marginMode + this.Size = size + var timeInForce string = "GTC" + this.TimeInForce = &timeInForce + var postOnly bool = false + this.PostOnly = &postOnly + var hidden bool = false + this.Hidden = &hidden + var iceberg bool = false + this.Iceberg = &iceberg + return &this +} + +// NewAddOrderTestReqWithDefaults instantiates a new AddOrderTestReq object +// This constructor will only assign default values to properties that have it defined, +func NewAddOrderTestReqWithDefaults() *AddOrderTestReq { + this := AddOrderTestReq{} + var Type_ string = "limit" + this.Type = Type_ + var reduceOnly bool = false + this.ReduceOnly = &reduceOnly + var closeOrder bool = false + this.CloseOrder = &closeOrder + var forceHold bool = false + this.ForceHold = &forceHold + var marginMode string = "ISOLATED" + this.MarginMode = &marginMode + var timeInForce string = "GTC" + this.TimeInForce = &timeInForce + var postOnly bool = false + this.PostOnly = &postOnly + var hidden bool = false + this.Hidden = &hidden + var iceberg bool = false + this.Iceberg = &iceberg + return &this +} + +func (o *AddOrderTestReq) ToMap() map[string]interface{} { + toSerialize := map[string]interface{}{} + toSerialize["clientOid"] = o.ClientOid + toSerialize["side"] = o.Side + toSerialize["symbol"] = o.Symbol + toSerialize["leverage"] = o.Leverage + toSerialize["type"] = o.Type + toSerialize["remark"] = o.Remark + toSerialize["stop"] = o.Stop + toSerialize["stopPriceType"] = o.StopPriceType + toSerialize["stopPrice"] = o.StopPrice + toSerialize["reduceOnly"] = o.ReduceOnly + toSerialize["closeOrder"] = o.CloseOrder + toSerialize["forceHold"] = o.ForceHold + toSerialize["marginMode"] = o.MarginMode + toSerialize["price"] = o.Price + toSerialize["size"] = o.Size + toSerialize["timeInForce"] = o.TimeInForce + toSerialize["postOnly"] = o.PostOnly + toSerialize["hidden"] = o.Hidden + toSerialize["iceberg"] = o.Iceberg + toSerialize["visibleSize"] = o.VisibleSize + return toSerialize +} + +type AddOrderTestReqBuilder struct { + obj *AddOrderTestReq +} + +func NewAddOrderTestReqBuilder() *AddOrderTestReqBuilder { + return &AddOrderTestReqBuilder{obj: NewAddOrderTestReqWithDefaults()} +} + +// Unique order id created by users to identify their orders, the maximum length cannot exceed 40, e.g. UUID, Only allows numbers, characters, underline(_), and separator(-) +func (builder *AddOrderTestReqBuilder) SetClientOid(value string) *AddOrderTestReqBuilder { + builder.obj.ClientOid = value + return builder +} + +// specify if the order is to 'buy' or 'sell' +func (builder *AddOrderTestReqBuilder) SetSide(value string) *AddOrderTestReqBuilder { + builder.obj.Side = value + return builder +} + +// Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) +func (builder *AddOrderTestReqBuilder) SetSymbol(value string) *AddOrderTestReqBuilder { + builder.obj.Symbol = value + return builder +} + +// Used to calculate the margin to be frozen for the order. If you are to close the position, this parameter is not required. +func (builder *AddOrderTestReqBuilder) SetLeverage(value int32) *AddOrderTestReqBuilder { + builder.obj.Leverage = value + return builder +} + +// specify if the order is an 'limit' order or 'market' order +func (builder *AddOrderTestReqBuilder) SetType(value string) *AddOrderTestReqBuilder { + builder.obj.Type = value + return builder +} + +// remark for the order, length cannot exceed 100 utf8 characters +func (builder *AddOrderTestReqBuilder) SetRemark(value string) *AddOrderTestReqBuilder { + builder.obj.Remark = &value + return builder +} + +// Either 'down' or 'up'. If stop is used,parameter stopPrice and stopPriceType also need to be provieded. +func (builder *AddOrderTestReqBuilder) SetStop(value string) *AddOrderTestReqBuilder { + builder.obj.Stop = &value + return builder +} + +// Either 'TP', 'IP' or 'MP', Need to be defined if stop is specified. +func (builder *AddOrderTestReqBuilder) SetStopPriceType(value string) *AddOrderTestReqBuilder { + builder.obj.StopPriceType = &value + return builder +} + +// Need to be defined if stop is specified. +func (builder *AddOrderTestReqBuilder) SetStopPrice(value string) *AddOrderTestReqBuilder { + builder.obj.StopPrice = &value + return builder +} + +// A mark to reduce the position size only. Set to false by default. Need to set the position size when reduceOnly is true. If set to true, only the orders reducing the position size will be executed. If the reduce-only order size exceeds the position size, the extra size will be canceled. +func (builder *AddOrderTestReqBuilder) SetReduceOnly(value bool) *AddOrderTestReqBuilder { + builder.obj.ReduceOnly = &value + return builder +} + +// A mark to close the position. Set to false by default. If closeOrder is set to true, the system will close the position and the position size will become 0. Side, Size and Leverage fields can be left empty and the system will determine the side and size automatically. +func (builder *AddOrderTestReqBuilder) SetCloseOrder(value bool) *AddOrderTestReqBuilder { + builder.obj.CloseOrder = &value + return builder +} + +// A mark to forcely hold the funds for an order, even though it's an order to reduce the position size. This helps the order stay on the order book and not get canceled when the position size changes. Set to false by default. The system will forcely freeze certain amount of funds for this order, including orders whose direction is opposite to the current positions. This feature is to ensure that the order won’t be canceled by the matching engine in such a circumstance that not enough funds are frozen for the order. +func (builder *AddOrderTestReqBuilder) SetForceHold(value bool) *AddOrderTestReqBuilder { + builder.obj.ForceHold = &value + return builder +} + +// Margin mode: ISOLATED, CROSS, default: ISOLATED +func (builder *AddOrderTestReqBuilder) SetMarginMode(value string) *AddOrderTestReqBuilder { + builder.obj.MarginMode = &value + return builder +} + +// Required for type is 'limit' order, indicating the operating price +func (builder *AddOrderTestReqBuilder) SetPrice(value string) *AddOrderTestReqBuilder { + builder.obj.Price = &value + return builder +} + +// Order size (Lot), must be a positive integer. The quantity unit of coin-swap contracts is size(lot), and other units are not supported. +func (builder *AddOrderTestReqBuilder) SetSize(value int32) *AddOrderTestReqBuilder { + builder.obj.Size = value + return builder +} + +// Optional for type is 'limit' order, [Time in force](https://www.kucoin.com/docs-new/doc-338146) is a special strategy used during trading, default is GTC +func (builder *AddOrderTestReqBuilder) SetTimeInForce(value string) *AddOrderTestReqBuilder { + builder.obj.TimeInForce = &value + return builder +} + +// Optional for type is 'limit' order, post only flag, invalid when timeInForce is IOC. When postOnly is true, not allowed choose hidden or iceberg. The post-only flag ensures that the trader always pays the maker fee and provides liquidity to the order book. If any part of the order is going to pay taker fee, the order will be fully rejected. +func (builder *AddOrderTestReqBuilder) SetPostOnly(value bool) *AddOrderTestReqBuilder { + builder.obj.PostOnly = &value + return builder +} + +// Optional for type is 'limit' order, orders not displaying in order book. When hidden chose, not allowed choose postOnly. +func (builder *AddOrderTestReqBuilder) SetHidden(value bool) *AddOrderTestReqBuilder { + builder.obj.Hidden = &value + return builder +} + +// Optional for type is 'limit' order, Only visible portion of the order is displayed in the order book. When iceberg chose, not allowed choose postOnly. +func (builder *AddOrderTestReqBuilder) SetIceberg(value bool) *AddOrderTestReqBuilder { + builder.obj.Iceberg = &value + return builder +} + +// Optional for type is 'limit' order, The maximum visible size of an iceberg order. please place order in size (lots), The units of qty (base currency) and valueQty (value) are not supported. +func (builder *AddOrderTestReqBuilder) SetVisibleSize(value string) *AddOrderTestReqBuilder { + builder.obj.VisibleSize = &value + return builder +} + +func (builder *AddOrderTestReqBuilder) Build() *AddOrderTestReq { + return builder.obj +} diff --git a/sdk/golang/pkg/generate/copytrading/futures/types_add_order_test_resp.go b/sdk/golang/pkg/generate/copytrading/futures/types_add_order_test_resp.go new file mode 100644 index 00000000..fa77f5dd --- /dev/null +++ b/sdk/golang/pkg/generate/copytrading/futures/types_add_order_test_resp.go @@ -0,0 +1,44 @@ +// Code generated by Kucoin Universal SDK Generator; DO NOT EDIT. + +package futures + +import ( + "github.com/Kucoin/kucoin-universal-sdk/sdk/golang/pkg/types" +) + +// AddOrderTestResp struct for AddOrderTestResp +type AddOrderTestResp struct { + // common response + CommonResponse *types.RestResponse + // The unique order id generated by the trading system,which can be used later for further actions such as canceling the order. + OrderId string `json:"orderId,omitempty"` + // The user self-defined order id. + ClientOid string `json:"clientOid,omitempty"` +} + +// NewAddOrderTestResp instantiates a new AddOrderTestResp object +// This constructor will assign default values to properties that have it defined +func NewAddOrderTestResp(orderId string, clientOid string) *AddOrderTestResp { + this := AddOrderTestResp{} + this.OrderId = orderId + this.ClientOid = clientOid + return &this +} + +// NewAddOrderTestRespWithDefaults instantiates a new AddOrderTestResp object +// This constructor will only assign default values to properties that have it defined, +func NewAddOrderTestRespWithDefaults() *AddOrderTestResp { + this := AddOrderTestResp{} + return &this +} + +func (o *AddOrderTestResp) ToMap() map[string]interface{} { + toSerialize := map[string]interface{}{} + toSerialize["orderId"] = o.OrderId + toSerialize["clientOid"] = o.ClientOid + return toSerialize +} + +func (o *AddOrderTestResp) SetCommonResponse(response *types.RestResponse) { + o.CommonResponse = response +} diff --git a/sdk/golang/pkg/generate/copytrading/futures/types_add_tpsl_order_req.go b/sdk/golang/pkg/generate/copytrading/futures/types_add_tpsl_order_req.go new file mode 100644 index 00000000..b6733543 --- /dev/null +++ b/sdk/golang/pkg/generate/copytrading/futures/types_add_tpsl_order_req.go @@ -0,0 +1,258 @@ +// Code generated by Kucoin Universal SDK Generator; DO NOT EDIT. + +package futures + +// AddTPSLOrderReq struct for AddTPSLOrderReq +type AddTPSLOrderReq struct { + // Unique order id created by users to identify their orders, the maximum length cannot exceed 40, e.g. UUID, Only allows numbers, characters, underline(_), and separator(-) + ClientOid string `json:"clientOid,omitempty"` + // specify if the order is to 'buy' or 'sell' + Side string `json:"side,omitempty"` + // Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) + Symbol string `json:"symbol,omitempty"` + // Used to calculate the margin to be frozen for the order. If you are to close the position, this parameter is not required. + Leverage int32 `json:"leverage,omitempty"` + // specify if the order is an 'limit' order or 'market' order + Type string `json:"type,omitempty"` + // remark for the order, length cannot exceed 100 utf8 characters + Remark *string `json:"remark,omitempty"` + // Either 'TP', 'IP' or 'MP' + StopPriceType *string `json:"stopPriceType,omitempty"` + // A mark to reduce the position size only. Set to false by default. Need to set the position size when reduceOnly is true. If set to true, only the orders reducing the position size will be executed. If the reduce-only order size exceeds the position size, the extra size will be canceled. + ReduceOnly *bool `json:"reduceOnly,omitempty"` + // A mark to close the position. Set to false by default. If closeOrder is set to true, the system will close the position and the position size will become 0. Side, Size and Leverage fields can be left empty and the system will determine the side and size automatically. + CloseOrder *bool `json:"closeOrder,omitempty"` + // A mark to forcely hold the funds for an order, even though it's an order to reduce the position size. This helps the order stay on the order book and not get canceled when the position size changes. Set to false by default. The system will forcely freeze certain amount of funds for this order, including orders whose direction is opposite to the current positions. This feature is to ensure that the order won’t be canceled by the matching engine in such a circumstance that not enough funds are frozen for the order. + ForceHold *bool `json:"forceHold,omitempty"` + // Margin mode: ISOLATED, CROSS, default: ISOLATED + MarginMode *string `json:"marginMode,omitempty"` + // Required for type is 'limit' order, indicating the operating price + Price *string `json:"price,omitempty"` + // Order size (Lot), must be a positive integer. The quantity unit of coin-swap contracts is size(lot), and other units are not supported. + Size int32 `json:"size,omitempty"` + // Optional for type is 'limit' order, [Time in force](https://www.kucoin.com/docs-new/doc-338146) is a special strategy used during trading, default is GTC + TimeInForce *string `json:"timeInForce,omitempty"` + // Optional for type is 'limit' order, post only flag, invalid when timeInForce is IOC. When postOnly is true, not allowed choose hidden or iceberg. The post-only flag ensures that the trader always pays the maker fee and provides liquidity to the order book. If any part of the order is going to pay taker fee, the order will be fully rejected. + PostOnly *bool `json:"postOnly,omitempty"` + // Optional for type is 'limit' order, orders not displaying in order book. When hidden chose, not allowed choose postOnly. + Hidden *bool `json:"hidden,omitempty"` + // Optional for type is 'limit' order, Only visible portion of the order is displayed in the order book. When iceberg chose, not allowed choose postOnly. + Iceberg *bool `json:"iceberg,omitempty"` + // Optional for type is 'limit' order, The maximum visible size of an iceberg order. please place order in size (lots), The units of qty (base currency) and valueQty (value) are not supported. + VisibleSize *string `json:"visibleSize,omitempty"` + // Take profit price + TriggerStopUpPrice *string `json:"triggerStopUpPrice,omitempty"` + // Stop loss price + TriggerStopDownPrice *string `json:"triggerStopDownPrice,omitempty"` +} + +// NewAddTPSLOrderReq instantiates a new AddTPSLOrderReq object +// This constructor will assign default values to properties that have it defined +func NewAddTPSLOrderReq(clientOid string, side string, symbol string, leverage int32, Type_ string, size int32) *AddTPSLOrderReq { + this := AddTPSLOrderReq{} + this.ClientOid = clientOid + this.Side = side + this.Symbol = symbol + this.Leverage = leverage + this.Type = Type_ + var reduceOnly bool = false + this.ReduceOnly = &reduceOnly + var closeOrder bool = false + this.CloseOrder = &closeOrder + var forceHold bool = false + this.ForceHold = &forceHold + var marginMode string = "ISOLATED" + this.MarginMode = &marginMode + this.Size = size + var timeInForce string = "GTC" + this.TimeInForce = &timeInForce + var postOnly bool = false + this.PostOnly = &postOnly + var hidden bool = false + this.Hidden = &hidden + var iceberg bool = false + this.Iceberg = &iceberg + return &this +} + +// NewAddTPSLOrderReqWithDefaults instantiates a new AddTPSLOrderReq object +// This constructor will only assign default values to properties that have it defined, +func NewAddTPSLOrderReqWithDefaults() *AddTPSLOrderReq { + this := AddTPSLOrderReq{} + var Type_ string = "limit" + this.Type = Type_ + var reduceOnly bool = false + this.ReduceOnly = &reduceOnly + var closeOrder bool = false + this.CloseOrder = &closeOrder + var forceHold bool = false + this.ForceHold = &forceHold + var marginMode string = "ISOLATED" + this.MarginMode = &marginMode + var timeInForce string = "GTC" + this.TimeInForce = &timeInForce + var postOnly bool = false + this.PostOnly = &postOnly + var hidden bool = false + this.Hidden = &hidden + var iceberg bool = false + this.Iceberg = &iceberg + return &this +} + +func (o *AddTPSLOrderReq) ToMap() map[string]interface{} { + toSerialize := map[string]interface{}{} + toSerialize["clientOid"] = o.ClientOid + toSerialize["side"] = o.Side + toSerialize["symbol"] = o.Symbol + toSerialize["leverage"] = o.Leverage + toSerialize["type"] = o.Type + toSerialize["remark"] = o.Remark + toSerialize["stopPriceType"] = o.StopPriceType + toSerialize["reduceOnly"] = o.ReduceOnly + toSerialize["closeOrder"] = o.CloseOrder + toSerialize["forceHold"] = o.ForceHold + toSerialize["marginMode"] = o.MarginMode + toSerialize["price"] = o.Price + toSerialize["size"] = o.Size + toSerialize["timeInForce"] = o.TimeInForce + toSerialize["postOnly"] = o.PostOnly + toSerialize["hidden"] = o.Hidden + toSerialize["iceberg"] = o.Iceberg + toSerialize["visibleSize"] = o.VisibleSize + toSerialize["triggerStopUpPrice"] = o.TriggerStopUpPrice + toSerialize["triggerStopDownPrice"] = o.TriggerStopDownPrice + return toSerialize +} + +type AddTPSLOrderReqBuilder struct { + obj *AddTPSLOrderReq +} + +func NewAddTPSLOrderReqBuilder() *AddTPSLOrderReqBuilder { + return &AddTPSLOrderReqBuilder{obj: NewAddTPSLOrderReqWithDefaults()} +} + +// Unique order id created by users to identify their orders, the maximum length cannot exceed 40, e.g. UUID, Only allows numbers, characters, underline(_), and separator(-) +func (builder *AddTPSLOrderReqBuilder) SetClientOid(value string) *AddTPSLOrderReqBuilder { + builder.obj.ClientOid = value + return builder +} + +// specify if the order is to 'buy' or 'sell' +func (builder *AddTPSLOrderReqBuilder) SetSide(value string) *AddTPSLOrderReqBuilder { + builder.obj.Side = value + return builder +} + +// Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) +func (builder *AddTPSLOrderReqBuilder) SetSymbol(value string) *AddTPSLOrderReqBuilder { + builder.obj.Symbol = value + return builder +} + +// Used to calculate the margin to be frozen for the order. If you are to close the position, this parameter is not required. +func (builder *AddTPSLOrderReqBuilder) SetLeverage(value int32) *AddTPSLOrderReqBuilder { + builder.obj.Leverage = value + return builder +} + +// specify if the order is an 'limit' order or 'market' order +func (builder *AddTPSLOrderReqBuilder) SetType(value string) *AddTPSLOrderReqBuilder { + builder.obj.Type = value + return builder +} + +// remark for the order, length cannot exceed 100 utf8 characters +func (builder *AddTPSLOrderReqBuilder) SetRemark(value string) *AddTPSLOrderReqBuilder { + builder.obj.Remark = &value + return builder +} + +// Either 'TP', 'IP' or 'MP' +func (builder *AddTPSLOrderReqBuilder) SetStopPriceType(value string) *AddTPSLOrderReqBuilder { + builder.obj.StopPriceType = &value + return builder +} + +// A mark to reduce the position size only. Set to false by default. Need to set the position size when reduceOnly is true. If set to true, only the orders reducing the position size will be executed. If the reduce-only order size exceeds the position size, the extra size will be canceled. +func (builder *AddTPSLOrderReqBuilder) SetReduceOnly(value bool) *AddTPSLOrderReqBuilder { + builder.obj.ReduceOnly = &value + return builder +} + +// A mark to close the position. Set to false by default. If closeOrder is set to true, the system will close the position and the position size will become 0. Side, Size and Leverage fields can be left empty and the system will determine the side and size automatically. +func (builder *AddTPSLOrderReqBuilder) SetCloseOrder(value bool) *AddTPSLOrderReqBuilder { + builder.obj.CloseOrder = &value + return builder +} + +// A mark to forcely hold the funds for an order, even though it's an order to reduce the position size. This helps the order stay on the order book and not get canceled when the position size changes. Set to false by default. The system will forcely freeze certain amount of funds for this order, including orders whose direction is opposite to the current positions. This feature is to ensure that the order won’t be canceled by the matching engine in such a circumstance that not enough funds are frozen for the order. +func (builder *AddTPSLOrderReqBuilder) SetForceHold(value bool) *AddTPSLOrderReqBuilder { + builder.obj.ForceHold = &value + return builder +} + +// Margin mode: ISOLATED, CROSS, default: ISOLATED +func (builder *AddTPSLOrderReqBuilder) SetMarginMode(value string) *AddTPSLOrderReqBuilder { + builder.obj.MarginMode = &value + return builder +} + +// Required for type is 'limit' order, indicating the operating price +func (builder *AddTPSLOrderReqBuilder) SetPrice(value string) *AddTPSLOrderReqBuilder { + builder.obj.Price = &value + return builder +} + +// Order size (Lot), must be a positive integer. The quantity unit of coin-swap contracts is size(lot), and other units are not supported. +func (builder *AddTPSLOrderReqBuilder) SetSize(value int32) *AddTPSLOrderReqBuilder { + builder.obj.Size = value + return builder +} + +// Optional for type is 'limit' order, [Time in force](https://www.kucoin.com/docs-new/doc-338146) is a special strategy used during trading, default is GTC +func (builder *AddTPSLOrderReqBuilder) SetTimeInForce(value string) *AddTPSLOrderReqBuilder { + builder.obj.TimeInForce = &value + return builder +} + +// Optional for type is 'limit' order, post only flag, invalid when timeInForce is IOC. When postOnly is true, not allowed choose hidden or iceberg. The post-only flag ensures that the trader always pays the maker fee and provides liquidity to the order book. If any part of the order is going to pay taker fee, the order will be fully rejected. +func (builder *AddTPSLOrderReqBuilder) SetPostOnly(value bool) *AddTPSLOrderReqBuilder { + builder.obj.PostOnly = &value + return builder +} + +// Optional for type is 'limit' order, orders not displaying in order book. When hidden chose, not allowed choose postOnly. +func (builder *AddTPSLOrderReqBuilder) SetHidden(value bool) *AddTPSLOrderReqBuilder { + builder.obj.Hidden = &value + return builder +} + +// Optional for type is 'limit' order, Only visible portion of the order is displayed in the order book. When iceberg chose, not allowed choose postOnly. +func (builder *AddTPSLOrderReqBuilder) SetIceberg(value bool) *AddTPSLOrderReqBuilder { + builder.obj.Iceberg = &value + return builder +} + +// Optional for type is 'limit' order, The maximum visible size of an iceberg order. please place order in size (lots), The units of qty (base currency) and valueQty (value) are not supported. +func (builder *AddTPSLOrderReqBuilder) SetVisibleSize(value string) *AddTPSLOrderReqBuilder { + builder.obj.VisibleSize = &value + return builder +} + +// Take profit price +func (builder *AddTPSLOrderReqBuilder) SetTriggerStopUpPrice(value string) *AddTPSLOrderReqBuilder { + builder.obj.TriggerStopUpPrice = &value + return builder +} + +// Stop loss price +func (builder *AddTPSLOrderReqBuilder) SetTriggerStopDownPrice(value string) *AddTPSLOrderReqBuilder { + builder.obj.TriggerStopDownPrice = &value + return builder +} + +func (builder *AddTPSLOrderReqBuilder) Build() *AddTPSLOrderReq { + return builder.obj +} diff --git a/sdk/golang/pkg/generate/copytrading/futures/types_add_tpsl_order_resp.go b/sdk/golang/pkg/generate/copytrading/futures/types_add_tpsl_order_resp.go new file mode 100644 index 00000000..72594f92 --- /dev/null +++ b/sdk/golang/pkg/generate/copytrading/futures/types_add_tpsl_order_resp.go @@ -0,0 +1,44 @@ +// Code generated by Kucoin Universal SDK Generator; DO NOT EDIT. + +package futures + +import ( + "github.com/Kucoin/kucoin-universal-sdk/sdk/golang/pkg/types" +) + +// AddTPSLOrderResp struct for AddTPSLOrderResp +type AddTPSLOrderResp struct { + // common response + CommonResponse *types.RestResponse + // The unique order id generated by the trading system,which can be used later for further actions such as canceling the order. + OrderId string `json:"orderId,omitempty"` + // The user self-defined order id. + ClientOid string `json:"clientOid,omitempty"` +} + +// NewAddTPSLOrderResp instantiates a new AddTPSLOrderResp object +// This constructor will assign default values to properties that have it defined +func NewAddTPSLOrderResp(orderId string, clientOid string) *AddTPSLOrderResp { + this := AddTPSLOrderResp{} + this.OrderId = orderId + this.ClientOid = clientOid + return &this +} + +// NewAddTPSLOrderRespWithDefaults instantiates a new AddTPSLOrderResp object +// This constructor will only assign default values to properties that have it defined, +func NewAddTPSLOrderRespWithDefaults() *AddTPSLOrderResp { + this := AddTPSLOrderResp{} + return &this +} + +func (o *AddTPSLOrderResp) ToMap() map[string]interface{} { + toSerialize := map[string]interface{}{} + toSerialize["orderId"] = o.OrderId + toSerialize["clientOid"] = o.ClientOid + return toSerialize +} + +func (o *AddTPSLOrderResp) SetCommonResponse(response *types.RestResponse) { + o.CommonResponse = response +} diff --git a/sdk/golang/pkg/generate/copytrading/futures/types_cancel_order_by_client_oid_req.go b/sdk/golang/pkg/generate/copytrading/futures/types_cancel_order_by_client_oid_req.go new file mode 100644 index 00000000..172da43f --- /dev/null +++ b/sdk/golang/pkg/generate/copytrading/futures/types_cancel_order_by_client_oid_req.go @@ -0,0 +1,56 @@ +// Code generated by Kucoin Universal SDK Generator; DO NOT EDIT. + +package futures + +// CancelOrderByClientOidReq struct for CancelOrderByClientOidReq +type CancelOrderByClientOidReq struct { + // Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) + Symbol *string `json:"symbol,omitempty" url:"symbol,omitempty"` + // The user self-defined order id. + ClientOid *string `json:"clientOid,omitempty" url:"clientOid,omitempty"` +} + +// NewCancelOrderByClientOidReq instantiates a new CancelOrderByClientOidReq object +// This constructor will assign default values to properties that have it defined +func NewCancelOrderByClientOidReq() *CancelOrderByClientOidReq { + this := CancelOrderByClientOidReq{} + return &this +} + +// NewCancelOrderByClientOidReqWithDefaults instantiates a new CancelOrderByClientOidReq object +// This constructor will only assign default values to properties that have it defined, +func NewCancelOrderByClientOidReqWithDefaults() *CancelOrderByClientOidReq { + this := CancelOrderByClientOidReq{} + return &this +} + +func (o *CancelOrderByClientOidReq) ToMap() map[string]interface{} { + toSerialize := map[string]interface{}{} + toSerialize["symbol"] = o.Symbol + toSerialize["clientOid"] = o.ClientOid + return toSerialize +} + +type CancelOrderByClientOidReqBuilder struct { + obj *CancelOrderByClientOidReq +} + +func NewCancelOrderByClientOidReqBuilder() *CancelOrderByClientOidReqBuilder { + return &CancelOrderByClientOidReqBuilder{obj: NewCancelOrderByClientOidReqWithDefaults()} +} + +// Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) +func (builder *CancelOrderByClientOidReqBuilder) SetSymbol(value string) *CancelOrderByClientOidReqBuilder { + builder.obj.Symbol = &value + return builder +} + +// The user self-defined order id. +func (builder *CancelOrderByClientOidReqBuilder) SetClientOid(value string) *CancelOrderByClientOidReqBuilder { + builder.obj.ClientOid = &value + return builder +} + +func (builder *CancelOrderByClientOidReqBuilder) Build() *CancelOrderByClientOidReq { + return builder.obj +} diff --git a/sdk/golang/pkg/generate/copytrading/futures/types_cancel_order_by_client_oid_resp.go b/sdk/golang/pkg/generate/copytrading/futures/types_cancel_order_by_client_oid_resp.go new file mode 100644 index 00000000..7c066f8c --- /dev/null +++ b/sdk/golang/pkg/generate/copytrading/futures/types_cancel_order_by_client_oid_resp.go @@ -0,0 +1,39 @@ +// Code generated by Kucoin Universal SDK Generator; DO NOT EDIT. + +package futures + +import ( + "github.com/Kucoin/kucoin-universal-sdk/sdk/golang/pkg/types" +) + +// CancelOrderByClientOidResp struct for CancelOrderByClientOidResp +type CancelOrderByClientOidResp struct { + // common response + CommonResponse *types.RestResponse + ClientOid string `json:"clientOid,omitempty"` +} + +// NewCancelOrderByClientOidResp instantiates a new CancelOrderByClientOidResp object +// This constructor will assign default values to properties that have it defined +func NewCancelOrderByClientOidResp(clientOid string) *CancelOrderByClientOidResp { + this := CancelOrderByClientOidResp{} + this.ClientOid = clientOid + return &this +} + +// NewCancelOrderByClientOidRespWithDefaults instantiates a new CancelOrderByClientOidResp object +// This constructor will only assign default values to properties that have it defined, +func NewCancelOrderByClientOidRespWithDefaults() *CancelOrderByClientOidResp { + this := CancelOrderByClientOidResp{} + return &this +} + +func (o *CancelOrderByClientOidResp) ToMap() map[string]interface{} { + toSerialize := map[string]interface{}{} + toSerialize["clientOid"] = o.ClientOid + return toSerialize +} + +func (o *CancelOrderByClientOidResp) SetCommonResponse(response *types.RestResponse) { + o.CommonResponse = response +} diff --git a/sdk/golang/pkg/generate/copytrading/futures/types_cancel_order_by_id_req.go b/sdk/golang/pkg/generate/copytrading/futures/types_cancel_order_by_id_req.go new file mode 100644 index 00000000..6e9c6a56 --- /dev/null +++ b/sdk/golang/pkg/generate/copytrading/futures/types_cancel_order_by_id_req.go @@ -0,0 +1,47 @@ +// Code generated by Kucoin Universal SDK Generator; DO NOT EDIT. + +package futures + +// CancelOrderByIdReq struct for CancelOrderByIdReq +type CancelOrderByIdReq struct { + // Order id + OrderId *string `json:"orderId,omitempty" url:"orderId,omitempty"` +} + +// NewCancelOrderByIdReq instantiates a new CancelOrderByIdReq object +// This constructor will assign default values to properties that have it defined +func NewCancelOrderByIdReq() *CancelOrderByIdReq { + this := CancelOrderByIdReq{} + return &this +} + +// NewCancelOrderByIdReqWithDefaults instantiates a new CancelOrderByIdReq object +// This constructor will only assign default values to properties that have it defined, +func NewCancelOrderByIdReqWithDefaults() *CancelOrderByIdReq { + this := CancelOrderByIdReq{} + return &this +} + +func (o *CancelOrderByIdReq) ToMap() map[string]interface{} { + toSerialize := map[string]interface{}{} + toSerialize["orderId"] = o.OrderId + return toSerialize +} + +type CancelOrderByIdReqBuilder struct { + obj *CancelOrderByIdReq +} + +func NewCancelOrderByIdReqBuilder() *CancelOrderByIdReqBuilder { + return &CancelOrderByIdReqBuilder{obj: NewCancelOrderByIdReqWithDefaults()} +} + +// Order id +func (builder *CancelOrderByIdReqBuilder) SetOrderId(value string) *CancelOrderByIdReqBuilder { + builder.obj.OrderId = &value + return builder +} + +func (builder *CancelOrderByIdReqBuilder) Build() *CancelOrderByIdReq { + return builder.obj +} diff --git a/sdk/golang/pkg/generate/copytrading/futures/types_cancel_order_by_id_resp.go b/sdk/golang/pkg/generate/copytrading/futures/types_cancel_order_by_id_resp.go new file mode 100644 index 00000000..bb2f05c3 --- /dev/null +++ b/sdk/golang/pkg/generate/copytrading/futures/types_cancel_order_by_id_resp.go @@ -0,0 +1,40 @@ +// Code generated by Kucoin Universal SDK Generator; DO NOT EDIT. + +package futures + +import ( + "github.com/Kucoin/kucoin-universal-sdk/sdk/golang/pkg/types" +) + +// CancelOrderByIdResp struct for CancelOrderByIdResp +type CancelOrderByIdResp struct { + // common response + CommonResponse *types.RestResponse + // The orderId that is to be canceled + CancelledOrderIds []string `json:"cancelledOrderIds,omitempty"` +} + +// NewCancelOrderByIdResp instantiates a new CancelOrderByIdResp object +// This constructor will assign default values to properties that have it defined +func NewCancelOrderByIdResp(cancelledOrderIds []string) *CancelOrderByIdResp { + this := CancelOrderByIdResp{} + this.CancelledOrderIds = cancelledOrderIds + return &this +} + +// NewCancelOrderByIdRespWithDefaults instantiates a new CancelOrderByIdResp object +// This constructor will only assign default values to properties that have it defined, +func NewCancelOrderByIdRespWithDefaults() *CancelOrderByIdResp { + this := CancelOrderByIdResp{} + return &this +} + +func (o *CancelOrderByIdResp) ToMap() map[string]interface{} { + toSerialize := map[string]interface{}{} + toSerialize["cancelledOrderIds"] = o.CancelledOrderIds + return toSerialize +} + +func (o *CancelOrderByIdResp) SetCommonResponse(response *types.RestResponse) { + o.CommonResponse = response +} diff --git a/sdk/golang/pkg/generate/copytrading/futures/types_get_max_open_size_req.go b/sdk/golang/pkg/generate/copytrading/futures/types_get_max_open_size_req.go new file mode 100644 index 00000000..5587a44d --- /dev/null +++ b/sdk/golang/pkg/generate/copytrading/futures/types_get_max_open_size_req.go @@ -0,0 +1,65 @@ +// Code generated by Kucoin Universal SDK Generator; DO NOT EDIT. + +package futures + +// GetMaxOpenSizeReq struct for GetMaxOpenSizeReq +type GetMaxOpenSizeReq struct { + // Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) + Symbol *string `json:"symbol,omitempty" url:"symbol,omitempty"` + // Order price + Price *string `json:"price,omitempty" url:"price,omitempty"` + // Leverage + Leverage *int32 `json:"leverage,omitempty" url:"leverage,omitempty"` +} + +// NewGetMaxOpenSizeReq instantiates a new GetMaxOpenSizeReq object +// This constructor will assign default values to properties that have it defined +func NewGetMaxOpenSizeReq() *GetMaxOpenSizeReq { + this := GetMaxOpenSizeReq{} + return &this +} + +// NewGetMaxOpenSizeReqWithDefaults instantiates a new GetMaxOpenSizeReq object +// This constructor will only assign default values to properties that have it defined, +func NewGetMaxOpenSizeReqWithDefaults() *GetMaxOpenSizeReq { + this := GetMaxOpenSizeReq{} + return &this +} + +func (o *GetMaxOpenSizeReq) ToMap() map[string]interface{} { + toSerialize := map[string]interface{}{} + toSerialize["symbol"] = o.Symbol + toSerialize["price"] = o.Price + toSerialize["leverage"] = o.Leverage + return toSerialize +} + +type GetMaxOpenSizeReqBuilder struct { + obj *GetMaxOpenSizeReq +} + +func NewGetMaxOpenSizeReqBuilder() *GetMaxOpenSizeReqBuilder { + return &GetMaxOpenSizeReqBuilder{obj: NewGetMaxOpenSizeReqWithDefaults()} +} + +// Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) +func (builder *GetMaxOpenSizeReqBuilder) SetSymbol(value string) *GetMaxOpenSizeReqBuilder { + builder.obj.Symbol = &value + return builder +} + +// Order price +func (builder *GetMaxOpenSizeReqBuilder) SetPrice(value string) *GetMaxOpenSizeReqBuilder { + builder.obj.Price = &value + return builder +} + +// Leverage +func (builder *GetMaxOpenSizeReqBuilder) SetLeverage(value int32) *GetMaxOpenSizeReqBuilder { + builder.obj.Leverage = &value + return builder +} + +func (builder *GetMaxOpenSizeReqBuilder) Build() *GetMaxOpenSizeReq { + return builder.obj +} diff --git a/sdk/golang/pkg/generate/copytrading/futures/types_get_max_open_size_resp.go b/sdk/golang/pkg/generate/copytrading/futures/types_get_max_open_size_resp.go new file mode 100644 index 00000000..97108bd0 --- /dev/null +++ b/sdk/golang/pkg/generate/copytrading/futures/types_get_max_open_size_resp.go @@ -0,0 +1,48 @@ +// Code generated by Kucoin Universal SDK Generator; DO NOT EDIT. + +package futures + +import ( + "github.com/Kucoin/kucoin-universal-sdk/sdk/golang/pkg/types" +) + +// GetMaxOpenSizeResp struct for GetMaxOpenSizeResp +type GetMaxOpenSizeResp struct { + // common response + CommonResponse *types.RestResponse + // Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) + Symbol string `json:"symbol,omitempty"` + // Maximum buy size + MaxBuyOpenSize int32 `json:"maxBuyOpenSize,omitempty"` + // Maximum buy size + MaxSellOpenSize int32 `json:"maxSellOpenSize,omitempty"` +} + +// NewGetMaxOpenSizeResp instantiates a new GetMaxOpenSizeResp object +// This constructor will assign default values to properties that have it defined +func NewGetMaxOpenSizeResp(symbol string, maxBuyOpenSize int32, maxSellOpenSize int32) *GetMaxOpenSizeResp { + this := GetMaxOpenSizeResp{} + this.Symbol = symbol + this.MaxBuyOpenSize = maxBuyOpenSize + this.MaxSellOpenSize = maxSellOpenSize + return &this +} + +// NewGetMaxOpenSizeRespWithDefaults instantiates a new GetMaxOpenSizeResp object +// This constructor will only assign default values to properties that have it defined, +func NewGetMaxOpenSizeRespWithDefaults() *GetMaxOpenSizeResp { + this := GetMaxOpenSizeResp{} + return &this +} + +func (o *GetMaxOpenSizeResp) ToMap() map[string]interface{} { + toSerialize := map[string]interface{}{} + toSerialize["symbol"] = o.Symbol + toSerialize["maxBuyOpenSize"] = o.MaxBuyOpenSize + toSerialize["maxSellOpenSize"] = o.MaxSellOpenSize + return toSerialize +} + +func (o *GetMaxOpenSizeResp) SetCommonResponse(response *types.RestResponse) { + o.CommonResponse = response +} diff --git a/sdk/golang/pkg/generate/copytrading/futures/types_get_max_withdraw_margin_req.go b/sdk/golang/pkg/generate/copytrading/futures/types_get_max_withdraw_margin_req.go new file mode 100644 index 00000000..5568d624 --- /dev/null +++ b/sdk/golang/pkg/generate/copytrading/futures/types_get_max_withdraw_margin_req.go @@ -0,0 +1,47 @@ +// Code generated by Kucoin Universal SDK Generator; DO NOT EDIT. + +package futures + +// GetMaxWithdrawMarginReq struct for GetMaxWithdrawMarginReq +type GetMaxWithdrawMarginReq struct { + // Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) + Symbol *string `json:"symbol,omitempty" url:"symbol,omitempty"` +} + +// NewGetMaxWithdrawMarginReq instantiates a new GetMaxWithdrawMarginReq object +// This constructor will assign default values to properties that have it defined +func NewGetMaxWithdrawMarginReq() *GetMaxWithdrawMarginReq { + this := GetMaxWithdrawMarginReq{} + return &this +} + +// NewGetMaxWithdrawMarginReqWithDefaults instantiates a new GetMaxWithdrawMarginReq object +// This constructor will only assign default values to properties that have it defined, +func NewGetMaxWithdrawMarginReqWithDefaults() *GetMaxWithdrawMarginReq { + this := GetMaxWithdrawMarginReq{} + return &this +} + +func (o *GetMaxWithdrawMarginReq) ToMap() map[string]interface{} { + toSerialize := map[string]interface{}{} + toSerialize["symbol"] = o.Symbol + return toSerialize +} + +type GetMaxWithdrawMarginReqBuilder struct { + obj *GetMaxWithdrawMarginReq +} + +func NewGetMaxWithdrawMarginReqBuilder() *GetMaxWithdrawMarginReqBuilder { + return &GetMaxWithdrawMarginReqBuilder{obj: NewGetMaxWithdrawMarginReqWithDefaults()} +} + +// Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) +func (builder *GetMaxWithdrawMarginReqBuilder) SetSymbol(value string) *GetMaxWithdrawMarginReqBuilder { + builder.obj.Symbol = &value + return builder +} + +func (builder *GetMaxWithdrawMarginReqBuilder) Build() *GetMaxWithdrawMarginReq { + return builder.obj +} diff --git a/sdk/golang/pkg/generate/copytrading/futures/types_get_max_withdraw_margin_resp.go b/sdk/golang/pkg/generate/copytrading/futures/types_get_max_withdraw_margin_resp.go new file mode 100644 index 00000000..7a614f25 --- /dev/null +++ b/sdk/golang/pkg/generate/copytrading/futures/types_get_max_withdraw_margin_resp.go @@ -0,0 +1,46 @@ +// Code generated by Kucoin Universal SDK Generator; DO NOT EDIT. + +package futures + +import ( + "encoding/json" + "github.com/Kucoin/kucoin-universal-sdk/sdk/golang/pkg/types" +) + +// GetMaxWithdrawMarginResp struct for GetMaxWithdrawMarginResp +type GetMaxWithdrawMarginResp struct { + // common response + CommonResponse *types.RestResponse + // The size of the position that can be deposited. If it is USDT-margin, it represents the amount of USDT. If it is coin-margin, this value represents the number of coins + Data string `json:"data,omitempty"` +} + +// NewGetMaxWithdrawMarginResp instantiates a new GetMaxWithdrawMarginResp object +// This constructor will assign default values to properties that have it defined +func NewGetMaxWithdrawMarginResp(data string) *GetMaxWithdrawMarginResp { + this := GetMaxWithdrawMarginResp{} + this.Data = data + return &this +} + +// NewGetMaxWithdrawMarginRespWithDefaults instantiates a new GetMaxWithdrawMarginResp object +// This constructor will only assign default values to properties that have it defined, +func NewGetMaxWithdrawMarginRespWithDefaults() *GetMaxWithdrawMarginResp { + this := GetMaxWithdrawMarginResp{} + return &this +} + +func (o *GetMaxWithdrawMarginResp) ToMap() map[string]interface{} { + toSerialize := map[string]interface{}{} + toSerialize["data"] = o.Data + return toSerialize +} + +func (o *GetMaxWithdrawMarginResp) UnmarshalJSON(b []byte) error { + err := json.Unmarshal(b, &o.Data) + return err +} + +func (o *GetMaxWithdrawMarginResp) SetCommonResponse(response *types.RestResponse) { + o.CommonResponse = response +} diff --git a/sdk/golang/pkg/generate/copytrading/futures/types_modify_auto_deposit_status_req.go b/sdk/golang/pkg/generate/copytrading/futures/types_modify_auto_deposit_status_req.go new file mode 100644 index 00000000..5b08f29f --- /dev/null +++ b/sdk/golang/pkg/generate/copytrading/futures/types_modify_auto_deposit_status_req.go @@ -0,0 +1,58 @@ +// Code generated by Kucoin Universal SDK Generator; DO NOT EDIT. + +package futures + +// ModifyAutoDepositStatusReq struct for ModifyAutoDepositStatusReq +type ModifyAutoDepositStatusReq struct { + // Symbol of the contract + Symbol string `json:"symbol,omitempty"` + // Status + Status bool `json:"status,omitempty"` +} + +// NewModifyAutoDepositStatusReq instantiates a new ModifyAutoDepositStatusReq object +// This constructor will assign default values to properties that have it defined +func NewModifyAutoDepositStatusReq(symbol string, status bool) *ModifyAutoDepositStatusReq { + this := ModifyAutoDepositStatusReq{} + this.Symbol = symbol + this.Status = status + return &this +} + +// NewModifyAutoDepositStatusReqWithDefaults instantiates a new ModifyAutoDepositStatusReq object +// This constructor will only assign default values to properties that have it defined, +func NewModifyAutoDepositStatusReqWithDefaults() *ModifyAutoDepositStatusReq { + this := ModifyAutoDepositStatusReq{} + return &this +} + +func (o *ModifyAutoDepositStatusReq) ToMap() map[string]interface{} { + toSerialize := map[string]interface{}{} + toSerialize["symbol"] = o.Symbol + toSerialize["status"] = o.Status + return toSerialize +} + +type ModifyAutoDepositStatusReqBuilder struct { + obj *ModifyAutoDepositStatusReq +} + +func NewModifyAutoDepositStatusReqBuilder() *ModifyAutoDepositStatusReqBuilder { + return &ModifyAutoDepositStatusReqBuilder{obj: NewModifyAutoDepositStatusReqWithDefaults()} +} + +// Symbol of the contract +func (builder *ModifyAutoDepositStatusReqBuilder) SetSymbol(value string) *ModifyAutoDepositStatusReqBuilder { + builder.obj.Symbol = value + return builder +} + +// Status +func (builder *ModifyAutoDepositStatusReqBuilder) SetStatus(value bool) *ModifyAutoDepositStatusReqBuilder { + builder.obj.Status = value + return builder +} + +func (builder *ModifyAutoDepositStatusReqBuilder) Build() *ModifyAutoDepositStatusReq { + return builder.obj +} diff --git a/sdk/golang/pkg/generate/copytrading/futures/types_modify_auto_deposit_status_resp.go b/sdk/golang/pkg/generate/copytrading/futures/types_modify_auto_deposit_status_resp.go new file mode 100644 index 00000000..372e4e4a --- /dev/null +++ b/sdk/golang/pkg/generate/copytrading/futures/types_modify_auto_deposit_status_resp.go @@ -0,0 +1,45 @@ +// Code generated by Kucoin Universal SDK Generator; DO NOT EDIT. + +package futures + +import ( + "encoding/json" + "github.com/Kucoin/kucoin-universal-sdk/sdk/golang/pkg/types" +) + +// ModifyAutoDepositStatusResp struct for ModifyAutoDepositStatusResp +type ModifyAutoDepositStatusResp struct { + // common response + CommonResponse *types.RestResponse + Data bool `json:"data,omitempty"` +} + +// NewModifyAutoDepositStatusResp instantiates a new ModifyAutoDepositStatusResp object +// This constructor will assign default values to properties that have it defined +func NewModifyAutoDepositStatusResp(data bool) *ModifyAutoDepositStatusResp { + this := ModifyAutoDepositStatusResp{} + this.Data = data + return &this +} + +// NewModifyAutoDepositStatusRespWithDefaults instantiates a new ModifyAutoDepositStatusResp object +// This constructor will only assign default values to properties that have it defined, +func NewModifyAutoDepositStatusRespWithDefaults() *ModifyAutoDepositStatusResp { + this := ModifyAutoDepositStatusResp{} + return &this +} + +func (o *ModifyAutoDepositStatusResp) ToMap() map[string]interface{} { + toSerialize := map[string]interface{}{} + toSerialize["data"] = o.Data + return toSerialize +} + +func (o *ModifyAutoDepositStatusResp) UnmarshalJSON(b []byte) error { + err := json.Unmarshal(b, &o.Data) + return err +} + +func (o *ModifyAutoDepositStatusResp) SetCommonResponse(response *types.RestResponse) { + o.CommonResponse = response +} diff --git a/sdk/golang/pkg/generate/copytrading/futures/types_modify_isolated_margin_risk_limt_req.go b/sdk/golang/pkg/generate/copytrading/futures/types_modify_isolated_margin_risk_limt_req.go new file mode 100644 index 00000000..be44ced4 --- /dev/null +++ b/sdk/golang/pkg/generate/copytrading/futures/types_modify_isolated_margin_risk_limt_req.go @@ -0,0 +1,58 @@ +// Code generated by Kucoin Universal SDK Generator; DO NOT EDIT. + +package futures + +// ModifyIsolatedMarginRiskLimtReq struct for ModifyIsolatedMarginRiskLimtReq +type ModifyIsolatedMarginRiskLimtReq struct { + // Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) + Symbol string `json:"symbol,omitempty"` + // level + Level int32 `json:"level,omitempty"` +} + +// NewModifyIsolatedMarginRiskLimtReq instantiates a new ModifyIsolatedMarginRiskLimtReq object +// This constructor will assign default values to properties that have it defined +func NewModifyIsolatedMarginRiskLimtReq(symbol string, level int32) *ModifyIsolatedMarginRiskLimtReq { + this := ModifyIsolatedMarginRiskLimtReq{} + this.Symbol = symbol + this.Level = level + return &this +} + +// NewModifyIsolatedMarginRiskLimtReqWithDefaults instantiates a new ModifyIsolatedMarginRiskLimtReq object +// This constructor will only assign default values to properties that have it defined, +func NewModifyIsolatedMarginRiskLimtReqWithDefaults() *ModifyIsolatedMarginRiskLimtReq { + this := ModifyIsolatedMarginRiskLimtReq{} + return &this +} + +func (o *ModifyIsolatedMarginRiskLimtReq) ToMap() map[string]interface{} { + toSerialize := map[string]interface{}{} + toSerialize["symbol"] = o.Symbol + toSerialize["level"] = o.Level + return toSerialize +} + +type ModifyIsolatedMarginRiskLimtReqBuilder struct { + obj *ModifyIsolatedMarginRiskLimtReq +} + +func NewModifyIsolatedMarginRiskLimtReqBuilder() *ModifyIsolatedMarginRiskLimtReqBuilder { + return &ModifyIsolatedMarginRiskLimtReqBuilder{obj: NewModifyIsolatedMarginRiskLimtReqWithDefaults()} +} + +// Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) +func (builder *ModifyIsolatedMarginRiskLimtReqBuilder) SetSymbol(value string) *ModifyIsolatedMarginRiskLimtReqBuilder { + builder.obj.Symbol = value + return builder +} + +// level +func (builder *ModifyIsolatedMarginRiskLimtReqBuilder) SetLevel(value int32) *ModifyIsolatedMarginRiskLimtReqBuilder { + builder.obj.Level = value + return builder +} + +func (builder *ModifyIsolatedMarginRiskLimtReqBuilder) Build() *ModifyIsolatedMarginRiskLimtReq { + return builder.obj +} diff --git a/sdk/golang/pkg/generate/copytrading/futures/types_modify_isolated_margin_risk_limt_resp.go b/sdk/golang/pkg/generate/copytrading/futures/types_modify_isolated_margin_risk_limt_resp.go new file mode 100644 index 00000000..14d57f30 --- /dev/null +++ b/sdk/golang/pkg/generate/copytrading/futures/types_modify_isolated_margin_risk_limt_resp.go @@ -0,0 +1,46 @@ +// Code generated by Kucoin Universal SDK Generator; DO NOT EDIT. + +package futures + +import ( + "encoding/json" + "github.com/Kucoin/kucoin-universal-sdk/sdk/golang/pkg/types" +) + +// ModifyIsolatedMarginRiskLimtResp struct for ModifyIsolatedMarginRiskLimtResp +type ModifyIsolatedMarginRiskLimtResp struct { + // common response + CommonResponse *types.RestResponse + // To adjust the level will cancel the open order, the response can only indicate whether the submit of the adjustment request is successful or not. + Data bool `json:"data,omitempty"` +} + +// NewModifyIsolatedMarginRiskLimtResp instantiates a new ModifyIsolatedMarginRiskLimtResp object +// This constructor will assign default values to properties that have it defined +func NewModifyIsolatedMarginRiskLimtResp(data bool) *ModifyIsolatedMarginRiskLimtResp { + this := ModifyIsolatedMarginRiskLimtResp{} + this.Data = data + return &this +} + +// NewModifyIsolatedMarginRiskLimtRespWithDefaults instantiates a new ModifyIsolatedMarginRiskLimtResp object +// This constructor will only assign default values to properties that have it defined, +func NewModifyIsolatedMarginRiskLimtRespWithDefaults() *ModifyIsolatedMarginRiskLimtResp { + this := ModifyIsolatedMarginRiskLimtResp{} + return &this +} + +func (o *ModifyIsolatedMarginRiskLimtResp) ToMap() map[string]interface{} { + toSerialize := map[string]interface{}{} + toSerialize["data"] = o.Data + return toSerialize +} + +func (o *ModifyIsolatedMarginRiskLimtResp) UnmarshalJSON(b []byte) error { + err := json.Unmarshal(b, &o.Data) + return err +} + +func (o *ModifyIsolatedMarginRiskLimtResp) SetCommonResponse(response *types.RestResponse) { + o.CommonResponse = response +} diff --git a/sdk/golang/pkg/generate/copytrading/futures/types_remove_isolated_margin_req.go b/sdk/golang/pkg/generate/copytrading/futures/types_remove_isolated_margin_req.go new file mode 100644 index 00000000..cdd77c36 --- /dev/null +++ b/sdk/golang/pkg/generate/copytrading/futures/types_remove_isolated_margin_req.go @@ -0,0 +1,58 @@ +// Code generated by Kucoin Universal SDK Generator; DO NOT EDIT. + +package futures + +// RemoveIsolatedMarginReq struct for RemoveIsolatedMarginReq +type RemoveIsolatedMarginReq struct { + // Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) + Symbol string `json:"symbol,omitempty"` + // The size of the position that can be deposited. If it is USDT-margin, it represents the amount of USDT. If it is coin-margin, this value represents the number of coins + WithdrawAmount string `json:"withdrawAmount,omitempty"` +} + +// NewRemoveIsolatedMarginReq instantiates a new RemoveIsolatedMarginReq object +// This constructor will assign default values to properties that have it defined +func NewRemoveIsolatedMarginReq(symbol string, withdrawAmount string) *RemoveIsolatedMarginReq { + this := RemoveIsolatedMarginReq{} + this.Symbol = symbol + this.WithdrawAmount = withdrawAmount + return &this +} + +// NewRemoveIsolatedMarginReqWithDefaults instantiates a new RemoveIsolatedMarginReq object +// This constructor will only assign default values to properties that have it defined, +func NewRemoveIsolatedMarginReqWithDefaults() *RemoveIsolatedMarginReq { + this := RemoveIsolatedMarginReq{} + return &this +} + +func (o *RemoveIsolatedMarginReq) ToMap() map[string]interface{} { + toSerialize := map[string]interface{}{} + toSerialize["symbol"] = o.Symbol + toSerialize["withdrawAmount"] = o.WithdrawAmount + return toSerialize +} + +type RemoveIsolatedMarginReqBuilder struct { + obj *RemoveIsolatedMarginReq +} + +func NewRemoveIsolatedMarginReqBuilder() *RemoveIsolatedMarginReqBuilder { + return &RemoveIsolatedMarginReqBuilder{obj: NewRemoveIsolatedMarginReqWithDefaults()} +} + +// Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) +func (builder *RemoveIsolatedMarginReqBuilder) SetSymbol(value string) *RemoveIsolatedMarginReqBuilder { + builder.obj.Symbol = value + return builder +} + +// The size of the position that can be deposited. If it is USDT-margin, it represents the amount of USDT. If it is coin-margin, this value represents the number of coins +func (builder *RemoveIsolatedMarginReqBuilder) SetWithdrawAmount(value string) *RemoveIsolatedMarginReqBuilder { + builder.obj.WithdrawAmount = value + return builder +} + +func (builder *RemoveIsolatedMarginReqBuilder) Build() *RemoveIsolatedMarginReq { + return builder.obj +} diff --git a/sdk/golang/pkg/generate/copytrading/futures/types_remove_isolated_margin_resp.go b/sdk/golang/pkg/generate/copytrading/futures/types_remove_isolated_margin_resp.go new file mode 100644 index 00000000..6bcee3cf --- /dev/null +++ b/sdk/golang/pkg/generate/copytrading/futures/types_remove_isolated_margin_resp.go @@ -0,0 +1,46 @@ +// Code generated by Kucoin Universal SDK Generator; DO NOT EDIT. + +package futures + +import ( + "encoding/json" + "github.com/Kucoin/kucoin-universal-sdk/sdk/golang/pkg/types" +) + +// RemoveIsolatedMarginResp struct for RemoveIsolatedMarginResp +type RemoveIsolatedMarginResp struct { + // common response + CommonResponse *types.RestResponse + // The size of the position deposited. If it is USDT-margin, it represents the amount of USDT. If it is coin-margin, this value represents the number of coins + Data string `json:"data,omitempty"` +} + +// NewRemoveIsolatedMarginResp instantiates a new RemoveIsolatedMarginResp object +// This constructor will assign default values to properties that have it defined +func NewRemoveIsolatedMarginResp(data string) *RemoveIsolatedMarginResp { + this := RemoveIsolatedMarginResp{} + this.Data = data + return &this +} + +// NewRemoveIsolatedMarginRespWithDefaults instantiates a new RemoveIsolatedMarginResp object +// This constructor will only assign default values to properties that have it defined, +func NewRemoveIsolatedMarginRespWithDefaults() *RemoveIsolatedMarginResp { + this := RemoveIsolatedMarginResp{} + return &this +} + +func (o *RemoveIsolatedMarginResp) ToMap() map[string]interface{} { + toSerialize := map[string]interface{}{} + toSerialize["data"] = o.Data + return toSerialize +} + +func (o *RemoveIsolatedMarginResp) UnmarshalJSON(b []byte) error { + err := json.Unmarshal(b, &o.Data) + return err +} + +func (o *RemoveIsolatedMarginResp) SetCommonResponse(response *types.RestResponse) { + o.CommonResponse = response +} diff --git a/sdk/golang/pkg/generate/service/copytrading_api.go b/sdk/golang/pkg/generate/service/copytrading_api.go new file mode 100644 index 00000000..8698b047 --- /dev/null +++ b/sdk/golang/pkg/generate/service/copytrading_api.go @@ -0,0 +1,28 @@ +// Code generated by Kucoin Universal SDK Generator; DO NOT EDIT. + +package service + +import ( + "github.com/Kucoin/kucoin-universal-sdk/sdk/golang/internal/interfaces" + "github.com/Kucoin/kucoin-universal-sdk/sdk/golang/pkg/generate/copytrading/futures" +) + +type CopytradingService interface { + + // Get FuturesAPI API + GetFuturesAPI() futures.FuturesAPI +} + +type CopytradingServiceImpl struct { + FuturesAPI futures.FuturesAPI +} + +func NewCopytradingService(transport interfaces.Transport) CopytradingService { + api := &CopytradingServiceImpl{} + api.FuturesAPI = futures.NewFuturesAPIImp(transport) + return api +} + +func (impl *CopytradingServiceImpl) GetFuturesAPI() futures.FuturesAPI { + return impl.FuturesAPI +} diff --git a/sdk/golang/tests/e2e/rest/copytrading_test/futures_test.go b/sdk/golang/tests/e2e/rest/copytrading_test/futures_test.go new file mode 100644 index 00000000..4d3ff8f8 --- /dev/null +++ b/sdk/golang/tests/e2e/rest/copytrading_test/futures_test.go @@ -0,0 +1,300 @@ +package copytrading_test + +import ( + "context" + "encoding/json" + "fmt" + "github.com/Kucoin/kucoin-universal-sdk/sdk/golang/extension/interceptor" + "github.com/Kucoin/kucoin-universal-sdk/sdk/golang/pkg/api" + "github.com/Kucoin/kucoin-universal-sdk/sdk/golang/pkg/common/logger" + "github.com/Kucoin/kucoin-universal-sdk/sdk/golang/pkg/generate/copytrading/futures" + "github.com/Kucoin/kucoin-universal-sdk/sdk/golang/pkg/types" + "github.com/google/uuid" + "os" + "testing" +) + +var futuresApi futures.FuturesAPI + +func init() { + key := os.Getenv("API_KEY") + secret := os.Getenv("API_SECRET") + passphrase := os.Getenv("API_PASSPHRASE") + + brokerName := os.Getenv("BROKER_NAME") + brokerKey := os.Getenv("BROKER_KEY") + brokerPartner := os.Getenv("BROKER_PARTNER") + + defaultLogger := logger.NewDefaultLogger() + logger.SetLogger(defaultLogger) + + httpOptionBuilder := types.NewTransportOptionBuilder(). + SetKeepAlive(true). + AddInterceptors(interceptor.NewLoggingInterceptor(false, defaultLogger)) + + option := types.NewClientOptionBuilder(). + WithKey(key). + WithSecret(secret). + WithPassphrase(passphrase). + WithBrokerName(brokerName). + WithBrokerPartner(brokerPartner). + WithBrokerKey(brokerKey). + WithSpotEndpoint(types.GlobalApiEndpoint). + WithFuturesEndpoint(types.GlobalFuturesApiEndpoint). + WithBrokerEndpoint(types.GlobalBrokerApiEndpoint). + WithTransportOption(httpOptionBuilder.Build()). + Build() + + client := api.NewClient(option) + + futuresApi = client.RestService().GetCopytradingService().GetFuturesAPI() +} + +func TestFuturesAddOrderReq(t *testing.T) { + // AddOrder + // Add Order + // /api/v1/copy-trade/futures/orders + + builder := futures.NewAddOrderReqBuilder() + builder.SetClientOid(uuid.NewString()).SetSide("buy").SetSymbol("XBTUSDTM"). + SetLeverage(3).SetType("limit").SetRemark("order remarks").SetReduceOnly(false). + SetMarginMode("ISOLATED").SetPrice("0.1").SetSize(1).SetTimeInForce("GTC") + req := builder.Build() + + resp, err := futuresApi.AddOrder(req, context.TODO()) + if err != nil { + panic(err) + } + data, err := json.Marshal(resp.ToMap()) + if err != nil { + panic(err) + } + fmt.Println("code:", resp.CommonResponse.Code) + fmt.Println("message:", resp.CommonResponse.Message) + fmt.Println("data:", string(data)) +} + +func TestFuturesAddOrderTestReq(t *testing.T) { + // AddOrderTest + // Add Order Test + // /api/v1/copy-trade/futures/orders/test + + builder := futures.NewAddOrderTestReqBuilder() + builder.SetClientOid(uuid.NewString()).SetSide("buy").SetSymbol("XBTUSDTM"). + SetLeverage(3).SetType("limit").SetRemark("order remarks").SetReduceOnly(false). + SetMarginMode("ISOLATED").SetPrice("0.1").SetSize(1).SetTimeInForce("GTC") + req := builder.Build() + + resp, err := futuresApi.AddOrderTest(req, context.TODO()) + if err != nil { + panic(err) + } + data, err := json.Marshal(resp.ToMap()) + if err != nil { + panic(err) + } + fmt.Println("code:", resp.CommonResponse.Code) + fmt.Println("message:", resp.CommonResponse.Message) + fmt.Println("data:", string(data)) +} + +func TestFuturesAddTPSLOrderReq(t *testing.T) { + // AddTPSLOrder + // Add Take Profit And Stop Loss Order + // /api/v1/copy-trade/futures/st-orders + + builder := futures.NewAddTPSLOrderReqBuilder() + builder.SetClientOid(uuid.NewString()).SetSide("buy").SetSymbol("XBTUSDTM"). + SetLeverage(3).SetType("limit").SetRemark("order remarks").SetReduceOnly(false). + SetMarginMode("ISOLATED").SetPrice("0.1").SetSize(1).SetTimeInForce("GTC"). + SetTriggerStopUpPrice("0.3").SetTriggerStopDownPrice("0.1").SetStopPriceType("TP") + req := builder.Build() + + resp, err := futuresApi.AddTPSLOrder(req, context.TODO()) + if err != nil { + panic(err) + } + data, err := json.Marshal(resp.ToMap()) + if err != nil { + panic(err) + } + fmt.Println("code:", resp.CommonResponse.Code) + fmt.Println("message:", resp.CommonResponse.Message) + fmt.Println("data:", string(data)) +} + +func TestFuturesCancelOrderByIdReq(t *testing.T) { + // CancelOrderById + // Cancel Order By OrderId + // /api/v1/copy-trade/futures/orders + + builder := futures.NewCancelOrderByIdReqBuilder() + builder.SetOrderId("268931241925947392") + req := builder.Build() + + resp, err := futuresApi.CancelOrderById(req, context.TODO()) + if err != nil { + panic(err) + } + data, err := json.Marshal(resp.ToMap()) + if err != nil { + panic(err) + } + fmt.Println("code:", resp.CommonResponse.Code) + fmt.Println("message:", resp.CommonResponse.Message) + fmt.Println("data:", string(data)) +} + +func TestFuturesCancelOrderByClientOidReq(t *testing.T) { + // CancelOrderByClientOid + // Cancel Order By ClientOid + // /api/v1/copy-trade/futures/orders/client-order + + builder := futures.NewCancelOrderByClientOidReqBuilder() + builder.SetSymbol("XBTUSDTM").SetClientOid("d4edf98a-c896-41d4-b80c-dde6812912fd") + req := builder.Build() + + resp, err := futuresApi.CancelOrderByClientOid(req, context.TODO()) + if err != nil { + panic(err) + } + data, err := json.Marshal(resp.ToMap()) + if err != nil { + panic(err) + } + fmt.Println("code:", resp.CommonResponse.Code) + fmt.Println("message:", resp.CommonResponse.Message) + fmt.Println("data:", string(data)) +} + +func TestFuturesGetMaxOpenSizeReq(t *testing.T) { + // TODO + // GetMaxOpenSize + // Get Max Open Size + // /api/v1/copy-trade/futures/get-max-open-size + + builder := futures.NewGetMaxOpenSizeReqBuilder() + builder.SetSymbol("XBTUSDTM").SetPrice("0.1").SetLeverage(10) + req := builder.Build() + + resp, err := futuresApi.GetMaxOpenSize(req, context.TODO()) + if err != nil { + panic(err) + } + data, err := json.Marshal(resp.ToMap()) + if err != nil { + panic(err) + } + fmt.Println("code:", resp.CommonResponse.Code) + fmt.Println("message:", resp.CommonResponse.Message) + fmt.Println("data:", string(data)) +} + +func TestFuturesGetMaxWithdrawMarginReq(t *testing.T) { + // GetMaxWithdrawMargin + // Get Max Withdraw Margin + // /api/v1/copy-trade/futures/position/margin/max-withdraw-margin + + builder := futures.NewGetMaxWithdrawMarginReqBuilder() + builder.SetSymbol("XBTUSDTM") + req := builder.Build() + + resp, err := futuresApi.GetMaxWithdrawMargin(req, context.TODO()) + if err != nil { + panic(err) + } + data, err := json.Marshal(resp.ToMap()) + if err != nil { + panic(err) + } + fmt.Println("code:", resp.CommonResponse.Code) + fmt.Println("message:", resp.CommonResponse.Message) + fmt.Println("data:", string(data)) +} + +// func TestFuturesAddIsolatedMarginReq(t *testing.T) { +// // AddIsolatedMargin +// // Add Isolated Margin +// // /api/v1/copy-trade/futures/position/margin/deposit-margin +// +// builder := futures.NewAddIsolatedMarginReqBuilder() +// builder.SetSymbol("XBTUSDTM").SetMargin(1).SetBizNo("123e4567-e89b-12d3-a456-426614174000") +// req := builder.Build() +// +// resp, err := futuresApi.AddIsolatedMargin(req, context.TODO()) +// if err != nil { +// panic(err) +// } +// data, err := json.Marshal(resp.ToMap()) +// if err != nil { +// panic(err) +// } +// fmt.Println("code:", resp.CommonResponse.Code) +// fmt.Println("message:", resp.CommonResponse.Message) +// fmt.Println("data:", string(data)) +// } +// +// func TestFuturesRemoveIsolatedMarginReq(t *testing.T) { +// // RemoveIsolatedMargin +// // Remove Isolated Margin +// // /api/v1/copy-trade/futures/position/margin/withdraw-margin +// +// builder := futures.NewRemoveIsolatedMarginReqBuilder() +// builder.SetSymbol("XBTUSDTM").SetWithdrawAmount("0.0000001") +// req := builder.Build() +// +// resp, err := futuresApi.RemoveIsolatedMargin(req, context.TODO()) +// if err != nil { +// panic(err) +// } +// data, err := json.Marshal(resp.ToMap()) +// if err != nil { +// panic(err) +// } +// fmt.Println("code:", resp.CommonResponse.Code) +// fmt.Println("message:", resp.CommonResponse.Message) +// fmt.Println("data:", string(data)) +// } +func TestFuturesModifyIsolatedMarginRiskLimtReq(t *testing.T) { + // ModifyIsolatedMarginRiskLimt + // Modify Isolated Margin Risk Limit + // /api/v1/copy-trade/futures/position/risk-limit-level/change + + builder := futures.NewModifyIsolatedMarginRiskLimtReqBuilder() + builder.SetSymbol("XBTUSDTM").SetLevel(1) + req := builder.Build() + + resp, err := futuresApi.ModifyIsolatedMarginRiskLimt(req, context.TODO()) + if err != nil { + panic(err) + } + data, err := json.Marshal(resp.ToMap()) + if err != nil { + panic(err) + } + fmt.Println("code:", resp.CommonResponse.Code) + fmt.Println("message:", resp.CommonResponse.Message) + fmt.Println("data:", string(data)) +} + +func TestFuturesModifyAutoDepositStatusReq(t *testing.T) { + // ModifyAutoDepositStatus + // Modify Isolated Margin Auto-Deposit Status + // /api/v1/copy-trade/futures/position/margin/auto-deposit-status + + builder := futures.NewModifyAutoDepositStatusReqBuilder() + builder.SetSymbol("XBTUSDTM").SetStatus(true) + req := builder.Build() + + resp, err := futuresApi.ModifyAutoDepositStatus(req, context.TODO()) + if err != nil { + panic(err) + } + data, err := json.Marshal(resp.ToMap()) + if err != nil { + panic(err) + } + fmt.Println("code:", resp.CommonResponse.Code) + fmt.Println("message:", resp.CommonResponse.Message) + fmt.Println("data:", string(data)) +} diff --git a/sdk/postman/collection-REST.json b/sdk/postman/collection-REST.json index e74e73f6..294e62d5 100644 --- a/sdk/postman/collection-REST.json +++ b/sdk/postman/collection-REST.json @@ -18851,6 +18851,1039 @@ } } ] + }, + { + "name": "Copy Trading", + "item": [ + { + "name": "Add Order", + "request": { + "method": "POST", + "header": [], + "url": { + "raw": "", + "protocol": "https", + "host": [ + "{{futures_endpoint}}" + ], + "path": [ + "api", + "v1", + "copy-trade", + "futures", + "orders" + ], + "query": [] + }, + "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470363)\n\n:::info[Description]\nPlace order to the futures trading system, you can place two major types of orders: limit and market. Orders can only be placed if your account has sufficient funds. Once an order is placed, your funds will be put on hold for the duration of the order. The amount of funds on hold depends on the order type and parameters specified.\n:::\n\n:::tip[Tips]\nThe maximum limit orders for a single contract is 100 per account, and the maximum stop orders for a single contract is 200 per account.\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| clientOid | string | Unique order id created by users to identify their orders, the maximum length cannot exceed 40, e.g. UUID, Only allows numbers, characters, underline(_), and separator(-) |\n| side | string | specify if the order is to 'buy' or 'sell' |\n| symbol | string | Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) |\n| leverage | integer | Used to calculate the margin to be frozen for the order. If you are to close the position, this parameter is not required. |\n| type | string | specify if the order is an 'limit' order or 'market' order |\n| remark | string | remark for the order, length cannot exceed 100 utf8 characters |\n| stop | string | Either 'down' or 'up'. If stop is used,parameter stopPrice and stopPriceType also need to be provieded. |\n| stopPriceType | string | Either 'TP', 'IP' or 'MP', Need to be defined if stop is specified. |\n| stopPrice | string | Need to be defined if stop is specified. |\n| reduceOnly | boolean | A mark to reduce the position size only. Set to false by default. Need to set the position size when reduceOnly is true. If set to true, only the orders reducing the position size will be executed. If the reduce-only order size exceeds the position size, the extra size will be canceled. |\n| closeOrder | boolean | A mark to close the position. Set to false by default. If closeOrder is set to true, the system will close the position and the position size will become 0. Side, Size and Leverage fields can be left empty and the system will determine the side and size automatically. |\n| forceHold | boolean | A mark to forcely hold the funds for an order, even though it's an order to reduce the position size. This helps the order stay on the order book and not get canceled when the position size changes. Set to false by default. The system will forcely freeze certain amount of funds for this order, including orders whose direction is opposite to the current positions. This feature is to ensure that the order won’t be canceled by the matching engine in such a circumstance that not enough funds are frozen for the order. |\n| marginMode | string | Margin mode: ISOLATED, CROSS, default: ISOLATED |\n| price | string | Required for type is 'limit' order, indicating the operating price |\n| size | integer | Order size (Lot), must be a positive integer. The quantity unit of coin-swap contracts is size(lot), and other units are not supported. |\n| timeInForce | string | Optional for type is 'limit' order, [Time in force](https://www.kucoin.com/docs-new/doc-338146) is a special strategy used during trading, default is GTC |\n| postOnly | boolean | Optional for type is 'limit' order, post only flag, invalid when timeInForce is IOC. When postOnly is true, not allowed choose hidden or iceberg. The post-only flag ensures that the trader always pays the maker fee and provides liquidity to the order book. If any part of the order is going to pay taker fee, the order will be fully rejected. |\n| hidden | boolean | Optional for type is 'limit' order, orders not displaying in order book. When hidden chose, not allowed choose postOnly. |\n| iceberg | boolean | Optional for type is 'limit' order, Only visible portion of the order is displayed in the order book. When iceberg chose, not allowed choose postOnly. |\n| visibleSize | string | Optional for type is 'limit' order, The maximum visible size of an iceberg order. please place order in size (lots), The units of qty (base currency) and valueQty (value) are not supported. |\n\n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| orderId | string | The unique order id generated by the trading system,which can be used later for further actions such as canceling the order. |\n| clientOid | string | The user self-defined order id. |\n\n---\n", + "body": { + "mode": "raw", + "raw": "{\n \"clientOid\": \"5c52e11203aa677f33e493fb\",\n \"side\": \"buy\",\n \"symbol\": \"XBTUSDTM\",\n \"leverage\": 3,\n \"type\": \"limit\",\n \"remark\": \"order remarks\",\n \"reduceOnly\": false,\n \"marginMode\": \"ISOLATED\",\n \"price\": \"0.1\",\n \"size\": 1,\n \"timeInForce\": \"GTC\"\n}", + "options": { + "raw": { + "language": "json" + } + } + } + }, + "response": [ + { + "name": "Successful Response", + "originalRequest": { + "method": "POST", + "header": [], + "url": { + "raw": "", + "protocol": "https", + "host": [ + "{{futures_endpoint}}" + ], + "path": [ + "api", + "v1", + "copy-trade", + "futures", + "orders" + ], + "query": [] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json", + "name": "Content-Type", + "description": { + "content": "", + "type": "text/plain" + } + }, + { + "key": "gw-ratelimit-remaining", + "value": 1997, + "name": "gw-ratelimit-remaining" + }, + { + "key": "gw-ratelimit-limit", + "value": 2000, + "name": "gw-ratelimit-limit" + }, + { + "key": "gw-ratelimit-reset", + "value": 29990, + "name": "gw-ratelimit-reset" + } + ], + "cookie": [], + "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"orderId\": \"263485113055133696\",\n \"clientOid\": \"5c52e11203aa677f331e493fb\"\n }\n}" + } + ] + }, + { + "name": "Add Order Test", + "request": { + "method": "POST", + "header": [], + "url": { + "raw": "", + "protocol": "https", + "host": [ + "{{futures_endpoint}}" + ], + "path": [ + "api", + "v1", + "copy-trade", + "futures", + "orders", + "test" + ], + "query": [] + }, + "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470618)\n\n:::info[Description]\nOrder test endpoint, the request parameters and return parameters of this endpoint are exactly the same as the order endpoint, and can be used to verify whether the signature is correct and other operations. After placing an order, the order will not enter the matching system, and the order cannot be queried.\n:::\n\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| clientOid | string | Unique order id created by users to identify their orders, the maximum length cannot exceed 40, e.g. UUID, Only allows numbers, characters, underline(_), and separator(-) |\n| side | string | specify if the order is to 'buy' or 'sell' |\n| symbol | string | Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) |\n| leverage | integer | Used to calculate the margin to be frozen for the order. If you are to close the position, this parameter is not required. |\n| type | string | specify if the order is an 'limit' order or 'market' order |\n| remark | string | remark for the order, length cannot exceed 100 utf8 characters |\n| stop | string | Either 'down' or 'up'. If stop is used,parameter stopPrice and stopPriceType also need to be provieded. |\n| stopPriceType | string | Either 'TP', 'IP' or 'MP', Need to be defined if stop is specified. |\n| stopPrice | string | Need to be defined if stop is specified. |\n| reduceOnly | boolean | A mark to reduce the position size only. Set to false by default. Need to set the position size when reduceOnly is true. If set to true, only the orders reducing the position size will be executed. If the reduce-only order size exceeds the position size, the extra size will be canceled. |\n| closeOrder | boolean | A mark to close the position. Set to false by default. If closeOrder is set to true, the system will close the position and the position size will become 0. Side, Size and Leverage fields can be left empty and the system will determine the side and size automatically. |\n| forceHold | boolean | A mark to forcely hold the funds for an order, even though it's an order to reduce the position size. This helps the order stay on the order book and not get canceled when the position size changes. Set to false by default. The system will forcely freeze certain amount of funds for this order, including orders whose direction is opposite to the current positions. This feature is to ensure that the order won’t be canceled by the matching engine in such a circumstance that not enough funds are frozen for the order. |\n| marginMode | string | Margin mode: ISOLATED, CROSS, default: ISOLATED |\n| price | string | Required for type is 'limit' order, indicating the operating price |\n| size | integer | Order size (Lot), must be a positive integer. The quantity unit of coin-swap contracts is size(lot), and other units are not supported. |\n| timeInForce | string | Optional for type is 'limit' order, [Time in force](https://www.kucoin.com/docs-new/doc-338146) is a special strategy used during trading, default is GTC |\n| postOnly | boolean | Optional for type is 'limit' order, post only flag, invalid when timeInForce is IOC. When postOnly is true, not allowed choose hidden or iceberg. The post-only flag ensures that the trader always pays the maker fee and provides liquidity to the order book. If any part of the order is going to pay taker fee, the order will be fully rejected. |\n| hidden | boolean | Optional for type is 'limit' order, orders not displaying in order book. When hidden chose, not allowed choose postOnly. |\n| iceberg | boolean | Optional for type is 'limit' order, Only visible portion of the order is displayed in the order book. When iceberg chose, not allowed choose postOnly. |\n| visibleSize | string | Optional for type is 'limit' order, The maximum visible size of an iceberg order. please place order in size (lots), The units of qty (base currency) and valueQty (value) are not supported. |\n\n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| orderId | string | The unique order id generated by the trading system,which can be used later for further actions such as canceling the order. |\n| clientOid | string | The user self-defined order id. |\n\n---\n", + "body": { + "mode": "raw", + "raw": "{\n \"clientOid\": \"5c52e11203aa677f33e493fb\",\n \"side\": \"buy\",\n \"symbol\": \"XBTUSDTM\",\n \"leverage\": 3,\n \"type\": \"limit\",\n \"remark\": \"order remarks\",\n \"reduceOnly\": false,\n \"marginMode\": \"ISOLATED\",\n \"price\": \"0.1\",\n \"size\": 1,\n \"timeInForce\": \"GTC\"\n}", + "options": { + "raw": { + "language": "json" + } + } + } + }, + "response": [ + { + "name": "Successful Response", + "originalRequest": { + "method": "POST", + "header": [], + "url": { + "raw": "", + "protocol": "https", + "host": [ + "{{futures_endpoint}}" + ], + "path": [ + "api", + "v1", + "copy-trade", + "futures", + "orders", + "test" + ], + "query": [] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json", + "name": "Content-Type", + "description": { + "content": "", + "type": "text/plain" + } + }, + { + "key": "gw-ratelimit-remaining", + "value": 1997, + "name": "gw-ratelimit-remaining" + }, + { + "key": "gw-ratelimit-limit", + "value": 2000, + "name": "gw-ratelimit-limit" + }, + { + "key": "gw-ratelimit-reset", + "value": 29990, + "name": "gw-ratelimit-reset" + } + ], + "cookie": [], + "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"orderId\": \"234125150956625920\",\n \"clientOid\": \"5c52e11203aa677f33e493fb\"\n }\n}" + } + ] + }, + { + "name": "Add Take Profit And Stop Loss Order", + "request": { + "method": "POST", + "header": [], + "url": { + "raw": "", + "protocol": "https", + "host": [ + "{{futures_endpoint}}" + ], + "path": [ + "api", + "v1", + "copy-trade", + "futures", + "st-orders" + ], + "query": [] + }, + "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470619)\n\n:::info[Description]\nPlace take profit and stop loss order supports both take-profit and stop-loss functions, and other functions are exactly the same as the place order interface.\n\nYou can place two types of orders: limit and market. Orders can only be placed if your account has sufficient funds. Once an order is placed, your funds will be put on hold for the duration of the order. The amount of funds on hold depends on the order type and parameters specified.\n\nPlease be noted that the system would hold the fees from the orders entered the orderbook in advance. \n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| clientOid | string | Unique order id created by users to identify their orders, the maximum length cannot exceed 40, e.g. UUID, Only allows numbers, characters, underline(_), and separator(-) |\n| side | string | specify if the order is to 'buy' or 'sell' |\n| symbol | string | Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) |\n| leverage | integer | Used to calculate the margin to be frozen for the order. If you are to close the position, this parameter is not required. |\n| type | string | specify if the order is an 'limit' order or 'market' order |\n| remark | string | remark for the order, length cannot exceed 100 utf8 characters |\n| stopPriceType | string | Either 'TP', 'IP' or 'MP' |\n| reduceOnly | boolean | A mark to reduce the position size only. Set to false by default. Need to set the position size when reduceOnly is true. If set to true, only the orders reducing the position size will be executed. If the reduce-only order size exceeds the position size, the extra size will be canceled. |\n| closeOrder | boolean | A mark to close the position. Set to false by default. If closeOrder is set to true, the system will close the position and the position size will become 0. Side, Size and Leverage fields can be left empty and the system will determine the side and size automatically. |\n| forceHold | boolean | A mark to forcely hold the funds for an order, even though it's an order to reduce the position size. This helps the order stay on the order book and not get canceled when the position size changes. Set to false by default. The system will forcely freeze certain amount of funds for this order, including orders whose direction is opposite to the current positions. This feature is to ensure that the order won’t be canceled by the matching engine in such a circumstance that not enough funds are frozen for the order. |\n| marginMode | string | Margin mode: ISOLATED, CROSS, default: ISOLATED |\n| price | string | Required for type is 'limit' order, indicating the operating price |\n| size | integer | Order size (Lot), must be a positive integer. The quantity unit of coin-swap contracts is size(lot), and other units are not supported. |\n| timeInForce | string | Optional for type is 'limit' order, [Time in force](https://www.kucoin.com/docs-new/doc-338146) is a special strategy used during trading, default is GTC |\n| postOnly | boolean | Optional for type is 'limit' order, post only flag, invalid when timeInForce is IOC. When postOnly is true, not allowed choose hidden or iceberg. The post-only flag ensures that the trader always pays the maker fee and provides liquidity to the order book. If any part of the order is going to pay taker fee, the order will be fully rejected. |\n| hidden | boolean | Optional for type is 'limit' order, orders not displaying in order book. When hidden chose, not allowed choose postOnly. |\n| iceberg | boolean | Optional for type is 'limit' order, Only visible portion of the order is displayed in the order book. When iceberg chose, not allowed choose postOnly. |\n| visibleSize | string | Optional for type is 'limit' order, The maximum visible size of an iceberg order. please place order in size (lots), The units of qty (base currency) and valueQty (value) are not supported. |\n| triggerStopUpPrice | string | Take profit price |\n| triggerStopDownPrice | string | Stop loss price |\n\n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| orderId | string | The unique order id generated by the trading system,which can be used later for further actions such as canceling the order. |\n| clientOid | string | The user self-defined order id. |\n\n---\n", + "body": { + "mode": "raw", + "raw": "{\n \"clientOid\": \"5c52e11203aa677f33e493fb\",\n \"side\": \"buy\",\n \"symbol\": \"XBTUSDTM\",\n \"leverage\": 3,\n \"type\": \"limit\",\n \"remark\": \"order remarks\",\n \"reduceOnly\": false,\n \"marginMode\": \"ISOLATED\",\n \"price\": \"0.2\",\n \"size\": 1,\n \"timeInForce\": \"GTC\",\n \"triggerStopUpPrice\": \"0.3\",\n \"triggerStopDownPrice\": \"0.1\",\n \"stopPriceType\": \"TP\"\n}", + "options": { + "raw": { + "language": "json" + } + } + } + }, + "response": [ + { + "name": "Successful Response", + "originalRequest": { + "method": "POST", + "header": [], + "url": { + "raw": "", + "protocol": "https", + "host": [ + "{{futures_endpoint}}" + ], + "path": [ + "api", + "v1", + "copy-trade", + "futures", + "st-orders" + ], + "query": [] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json", + "name": "Content-Type", + "description": { + "content": "", + "type": "text/plain" + } + }, + { + "key": "gw-ratelimit-remaining", + "value": 1997, + "name": "gw-ratelimit-remaining" + }, + { + "key": "gw-ratelimit-limit", + "value": 2000, + "name": "gw-ratelimit-limit" + }, + { + "key": "gw-ratelimit-reset", + "value": 29990, + "name": "gw-ratelimit-reset" + } + ], + "cookie": [], + "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"orderId\": \"234125150956625920\",\n \"clientOid\": \"5c52e11203aa677f33e493fb\"\n }\n}" + } + ] + }, + { + "name": "Cancel Order By OrderId", + "request": { + "method": "DELETE", + "header": [], + "url": { + "raw": "", + "protocol": "https", + "host": [ + "{{futures_endpoint}}" + ], + "path": [ + "api", + "v1", + "copy-trade", + "futures", + "orders" + ], + "query": [ + { + "key": "orderId", + "value": "263485113055133696", + "description": "Order id" + } + ] + }, + "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470620)\n\n:::info[Description]\nCancel an order (including a stop order).\n\nYou will receive success message once the system has received the cancellation request. The cancellation request will be processed by matching engine in sequence. To know if the request has been processed, you may check the order status or update message from the websocket pushes.\n\nThe `orderId` is the server-assigned order id, not the specified clientOid.\n\nIf the order can not be canceled (already filled or previously canceled, etc), then an error response will indicate the reason in the message field.\n:::\n\n**API KEY PERMISSIONS**\nThis endpoint requires the Futures Trading permission.\n\n**REQUEST URL**\nThis endpoint support Futures URL\n\n**REQUEST RATE LIMIT**\nFutures weight:1\n\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| cancelledOrderIds | array | Refer to the schema section of cancelledOrderIds |\n\n---\n", + "body": {} + }, + "response": [ + { + "name": "Successful Response", + "originalRequest": { + "method": "DELETE", + "header": [], + "url": { + "raw": "", + "protocol": "https", + "host": [ + "{{futures_endpoint}}" + ], + "path": [ + "api", + "v1", + "copy-trade", + "futures", + "orders" + ], + "query": [ + { + "key": "orderId", + "value": "263485113055133696", + "description": "Order id" + } + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json", + "name": "Content-Type", + "description": { + "content": "", + "type": "text/plain" + } + }, + { + "key": "gw-ratelimit-remaining", + "value": 1997, + "name": "gw-ratelimit-remaining" + }, + { + "key": "gw-ratelimit-limit", + "value": 2000, + "name": "gw-ratelimit-limit" + }, + { + "key": "gw-ratelimit-reset", + "value": 29990, + "name": "gw-ratelimit-reset" + } + ], + "cookie": [], + "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"cancelledOrderIds\": [\n \"263485113055133696\"\n ]\n }\n}" + } + ] + }, + { + "name": "Cancel Order By ClientOid", + "request": { + "method": "DELETE", + "header": [], + "url": { + "raw": "", + "protocol": "https", + "host": [ + "{{futures_endpoint}}" + ], + "path": [ + "api", + "v1", + "copy-trade", + "futures", + "orders", + "client-order" + ], + "query": [ + { + "key": "symbol", + "value": "XBTUSDTM", + "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) " + }, + { + "key": "clientOid", + "value": "5c52e11203aa677f331e493fb", + "description": "The user self-defined order id." + } + ] + }, + "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470621)\n\n:::info[Description]\nCancel an order (including a stop order).\n\nYou will receive success message once the system has received the cancellation request. The cancellation request will be processed by matching engine in sequence. To know if the request has been processed, you may check the order status or update message from the pushes.\n\nResponse the ID created by the client (clientOid).\n\nIf the order can not be canceled (already filled or previously canceled, etc), then an error response will indicate the reason in the message field.\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| clientOid | string | |\n\n---\n", + "body": {} + }, + "response": [ + { + "name": "Successful Response", + "originalRequest": { + "method": "DELETE", + "header": [], + "url": { + "raw": "", + "protocol": "https", + "host": [ + "{{futures_endpoint}}" + ], + "path": [ + "api", + "v1", + "copy-trade", + "futures", + "orders", + "client-order" + ], + "query": [ + { + "key": "symbol", + "value": "XBTUSDTM", + "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) " + }, + { + "key": "clientOid", + "value": "5c52e11203aa677f331e493fb", + "description": "The user self-defined order id." + } + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json", + "name": "Content-Type", + "description": { + "content": "", + "type": "text/plain" + } + }, + { + "key": "gw-ratelimit-remaining", + "value": 1997, + "name": "gw-ratelimit-remaining" + }, + { + "key": "gw-ratelimit-limit", + "value": 2000, + "name": "gw-ratelimit-limit" + }, + { + "key": "gw-ratelimit-reset", + "value": 29990, + "name": "gw-ratelimit-reset" + } + ], + "cookie": [], + "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"clientOid\": \"5c52e11203aa677f331e4913fb\"\n }\n}" + } + ] + }, + { + "name": "Get Max Open Size", + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "", + "protocol": "https", + "host": [ + "{{futures_endpoint}}" + ], + "path": [ + "api", + "v1", + "copy-trade", + "futures", + "get-max-open-size" + ], + "query": [ + { + "key": "symbol", + "value": null, + "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) " + }, + { + "key": "price", + "value": null, + "description": "Order price\n" + }, + { + "key": "leverage", + "value": null, + "description": "Leverage\n" + } + ] + }, + "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470612)\n\n:::info[Description]\nGet Maximum Open Position Size.\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| symbol | string | Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) |\n| maxBuyOpenSize | integer | Maximum buy size
|\n| maxSellOpenSize | integer | Maximum buy size
|\n\n---\n", + "body": {} + }, + "response": [ + { + "name": "Successful Response", + "originalRequest": { + "method": "GET", + "header": [], + "url": { + "raw": "", + "protocol": "https", + "host": [ + "{{futures_endpoint}}" + ], + "path": [ + "api", + "v1", + "copy-trade", + "futures", + "get-max-open-size" + ], + "query": [ + { + "key": "symbol", + "value": null, + "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) " + }, + { + "key": "price", + "value": null, + "description": "Order price\n" + }, + { + "key": "leverage", + "value": null, + "description": "Leverage\n" + } + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json", + "name": "Content-Type", + "description": { + "content": "", + "type": "text/plain" + } + }, + { + "key": "gw-ratelimit-remaining", + "value": 1997, + "name": "gw-ratelimit-remaining" + }, + { + "key": "gw-ratelimit-limit", + "value": 2000, + "name": "gw-ratelimit-limit" + }, + { + "key": "gw-ratelimit-reset", + "value": 29990, + "name": "gw-ratelimit-reset" + } + ], + "cookie": [], + "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"symbol\": \"XBTUSDTM\",\n \"maxBuyOpenSize\": 8,\n \"maxSellOpenSize\": 5\n }\n}" + } + ] + }, + { + "name": "Get Max Withdraw Margin", + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "", + "protocol": "https", + "host": [ + "{{futures_endpoint}}" + ], + "path": [ + "api", + "v1", + "copy-trade", + "futures", + "position", + "margin", + "max-withdraw-margin" + ], + "query": [ + { + "key": "symbol", + "value": null, + "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) " + } + ] + }, + "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470616)\n\n:::info[Description]\nThis interface can query the maximum amount of margin that the current position supports withdrawal.\n:::\n\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | string | The size of the position that can be deposited. If it is USDT-margin, it represents the amount of USDT. If it is coin-margin, this value represents the number of coins
|\n\n---\n", + "body": {} + }, + "response": [ + { + "name": "Successful Response", + "originalRequest": { + "method": "GET", + "header": [], + "url": { + "raw": "", + "protocol": "https", + "host": [ + "{{futures_endpoint}}" + ], + "path": [ + "api", + "v1", + "copy-trade", + "futures", + "position", + "margin", + "max-withdraw-margin" + ], + "query": [ + { + "key": "symbol", + "value": null, + "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) " + } + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json", + "name": "Content-Type", + "description": { + "content": "", + "type": "text/plain" + } + }, + { + "key": "gw-ratelimit-remaining", + "value": 1997, + "name": "gw-ratelimit-remaining" + }, + { + "key": "gw-ratelimit-limit", + "value": 2000, + "name": "gw-ratelimit-limit" + }, + { + "key": "gw-ratelimit-reset", + "value": 29990, + "name": "gw-ratelimit-reset" + } + ], + "cookie": [], + "body": "{\n \"code\": \"200000\",\n \"data\": \"21.1135719252\"\n}" + } + ] + }, + { + "name": "Add Isolated Margin", + "request": { + "method": "POST", + "header": [], + "url": { + "raw": "", + "protocol": "https", + "host": [ + "{{futures_endpoint}}" + ], + "path": [ + "api", + "v1", + "copy-trade", + "futures", + "position", + "margin", + "deposit-margin" + ], + "query": [] + }, + "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470614)\n\n:::info[Description]\nAdd Isolated Margin Manually.\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| symbol | string | Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) |\n| margin | number | Margin amount (min. margin amount≥0.00001667XBT) |\n| bizNo | string | A unique ID generated by the user, to ensure the operation is processed by the system only once, The maximum length cannot exceed 36 |\n\n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| id | string | Position ID |\n| symbol | string | Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) |\n| autoDeposit | boolean | Auto deposit margin or not |\n| maintMarginReq | number | Maintenance margin requirement

|\n| riskLimit | integer | Risk limit
|\n| realLeverage | number | Leverage o the order |\n| crossMode | boolean | Cross mode or not |\n| delevPercentage | number | ADL ranking percentile |\n| openingTimestamp | integer | Open time |\n| currentTimestamp | integer | Current timestamp
|\n| currentQty | integer | Current postion quantity |\n| currentCost | number | Current postion value |\n| currentComm | number | Current commission |\n| unrealisedCost | number | Unrealised value |\n| realisedGrossCost | number | Accumulated realised gross profit value |\n| realisedCost | number | Current realised position value |\n| isOpen | boolean | Opened position or not |\n| markPrice | number | Mark price |\n| markValue | number | Mark value
|\n| posCost | number | Position value |\n| posCross | number | added margin |\n| posInit | number | Leverage margin |\n| posComm | number | Bankruptcy cost |\n| posLoss | number | Funding fees paid out |\n| posMargin | number | Position margin |\n| posMaint | number | Maintenance margin |\n| maintMargin | number | Position margin |\n| realisedGrossPnl | number | Accumulated realised gross profit value |\n| realisedPnl | number | Realised profit and loss |\n| unrealisedPnl | number | Unrealised profit and loss |\n| unrealisedPnlPcnt | number | Profit-loss ratio of the position |\n| unrealisedRoePcnt | number | Rate of return on investment |\n| avgEntryPrice | number | Average entry price |\n| liquidationPrice | number | Liquidation price |\n| bankruptPrice | number | Bankruptcy price |\n| userId | integer | userId |\n| settleCurrency | string | Currency used to clear and settle the trades |\n\n---\n", + "body": { + "mode": "raw", + "raw": "{\n \"symbol\": \"string\",\n \"margin\": 0,\n \"bizNo\": \"string\"\n}", + "options": { + "raw": { + "language": "json" + } + } + } + }, + "response": [ + { + "name": "Successful Response", + "originalRequest": { + "method": "POST", + "header": [], + "url": { + "raw": "", + "protocol": "https", + "host": [ + "{{futures_endpoint}}" + ], + "path": [ + "api", + "v1", + "copy-trade", + "futures", + "position", + "margin", + "deposit-margin" + ], + "query": [] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json", + "name": "Content-Type", + "description": { + "content": "", + "type": "text/plain" + } + }, + { + "key": "gw-ratelimit-remaining", + "value": 1997, + "name": "gw-ratelimit-remaining" + }, + { + "key": "gw-ratelimit-limit", + "value": 2000, + "name": "gw-ratelimit-limit" + }, + { + "key": "gw-ratelimit-reset", + "value": 29990, + "name": "gw-ratelimit-reset" + } + ], + "cookie": [], + "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"id\": \"6200c9b83aecfb000152ddcd\",\n \"symbol\": \"XBTUSDTM\",\n \"autoDeposit\": false,\n \"maintMarginReq\": 0.005,\n \"riskLimit\": 500000,\n \"realLeverage\": 18.72,\n \"crossMode\": false,\n \"delevPercentage\": 0.66,\n \"openingTimestamp\": 1646287090131,\n \"currentTimestamp\": 1646295055021,\n \"currentQty\": 1,\n \"currentCost\": 43.388,\n \"currentComm\": 0.0260328,\n \"unrealisedCost\": 43.388,\n \"realisedGrossCost\": 0,\n \"realisedCost\": 0.0260328,\n \"isOpen\": true,\n \"markPrice\": 43536.65,\n \"markValue\": 43.53665,\n \"posCost\": 43.388,\n \"posCross\": 2.4985e-05,\n \"posInit\": 2.1694,\n \"posComm\": 0.02733446,\n \"posLoss\": 0,\n \"posMargin\": 2.19675944,\n \"posMaint\": 0.24861326,\n \"maintMargin\": 2.34540944,\n \"realisedGrossPnl\": 0,\n \"realisedPnl\": -0.0260328,\n \"unrealisedPnl\": 0.14865,\n \"unrealisedPnlPcnt\": 0.0034,\n \"unrealisedRoePcnt\": 0.0685,\n \"avgEntryPrice\": 43388,\n \"liquidationPrice\": 41440,\n \"bankruptPrice\": 41218,\n \"userId\": 1234321123,\n \"settleCurrency\": \"USDT\"\n }\n}" + } + ] + }, + { + "name": "Remove Isolated Margin", + "request": { + "method": "POST", + "header": [], + "url": { + "raw": "", + "protocol": "https", + "host": [ + "{{futures_endpoint}}" + ], + "path": [ + "api", + "v1", + "copy-trade", + "futures", + "position", + "margin", + "withdraw-margin" + ], + "query": [] + }, + "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470615)\n\n:::info[Description]\nRemove Isolated Margin Manually.\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| symbol | string | Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) |\n| withdrawAmount | string | The size of the position that can be deposited. If it is USDT-margin, it represents the amount of USDT. If it is coin-margin, this value represents the number of coins
|\n\n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | string | The size of the position deposited. If it is USDT-margin, it represents the amount of USDT. If it is coin-margin, this value represents the number of coins
|\n\n---\n", + "body": { + "mode": "raw", + "raw": "{\n \"symbol\": \"XBTUSDTM\",\n \"withdrawAmount\": \"0.0000001\"\n}", + "options": { + "raw": { + "language": "json" + } + } + } + }, + "response": [ + { + "name": "Successful Response", + "originalRequest": { + "method": "POST", + "header": [], + "url": { + "raw": "", + "protocol": "https", + "host": [ + "{{futures_endpoint}}" + ], + "path": [ + "api", + "v1", + "copy-trade", + "futures", + "position", + "margin", + "withdraw-margin" + ], + "query": [] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json", + "name": "Content-Type", + "description": { + "content": "", + "type": "text/plain" + } + }, + { + "key": "gw-ratelimit-remaining", + "value": 1997, + "name": "gw-ratelimit-remaining" + }, + { + "key": "gw-ratelimit-limit", + "value": 2000, + "name": "gw-ratelimit-limit" + }, + { + "key": "gw-ratelimit-reset", + "value": 29990, + "name": "gw-ratelimit-reset" + } + ], + "cookie": [], + "body": "{\n \"code\": \"200000\",\n \"data\": \"0.1\"\n}" + } + ] + }, + { + "name": "Modify Isolated Margin Risk Limit", + "request": { + "method": "POST", + "header": [], + "url": { + "raw": "", + "protocol": "https", + "host": [ + "{{futures_endpoint}}" + ], + "path": [ + "api", + "v1", + "copy-trade", + "futures", + "position", + "risk-limit-level", + "change" + ], + "query": [] + }, + "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470613)\n\n:::info[Description]\nThis interface is for the adjustment of the risk limit level(Only valid for isolated Margin). To adjust the level will cancel the open order, the response can only indicate whether the submit of the adjustment request is successful or not. The result of the adjustment can be achieved by WebSocket information: Position Change Events\n:::\n\n\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| symbol | string | Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) |\n| level | integer | level |\n\n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | boolean | To adjust the level will cancel the open order, the response can only indicate whether the submit of the adjustment request is successful or not.
|\n\n---\n", + "body": { + "mode": "raw", + "raw": "{\n \"symbol\" : \"XBTUSDTM\",\n \"level\" : 1\n}", + "options": { + "raw": { + "language": "json" + } + } + } + }, + "response": [ + { + "name": "Successful Response", + "originalRequest": { + "method": "POST", + "header": [], + "url": { + "raw": "", + "protocol": "https", + "host": [ + "{{futures_endpoint}}" + ], + "path": [ + "api", + "v1", + "copy-trade", + "futures", + "position", + "risk-limit-level", + "change" + ], + "query": [] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json", + "name": "Content-Type", + "description": { + "content": "", + "type": "text/plain" + } + }, + { + "key": "gw-ratelimit-remaining", + "value": 1997, + "name": "gw-ratelimit-remaining" + }, + { + "key": "gw-ratelimit-limit", + "value": 2000, + "name": "gw-ratelimit-limit" + }, + { + "key": "gw-ratelimit-reset", + "value": 29990, + "name": "gw-ratelimit-reset" + } + ], + "cookie": [], + "body": "{\n \"code\": \"200000\",\n \"data\": true\n}" + } + ] + }, + { + "name": "Modify Isolated Margin Auto-Deposit Status", + "request": { + "method": "POST", + "header": [], + "url": { + "raw": "", + "protocol": "https", + "host": [ + "{{futures_endpoint}}" + ], + "path": [ + "api", + "v1", + "copy-trade", + "futures", + "position", + "margin", + "auto-deposit-status" + ], + "query": [] + }, + "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470617)\n\n:::info[Description]\nThis endpoint is only applicable to isolated margin and is no longer recommended. It is recommended to use cross margin instead.\n:::\n\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| symbol | string | Symbol of the contract
|\n| status | boolean | Status |\n\n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | boolean | |\n\n---\n", + "body": { + "mode": "raw", + "raw": "{\n \"symbol\": \"XBTUSDTM\",\n \"status\": true\n}", + "options": { + "raw": { + "language": "json" + } + } + } + }, + "response": [ + { + "name": "Successful Response", + "originalRequest": { + "method": "POST", + "header": [], + "url": { + "raw": "", + "protocol": "https", + "host": [ + "{{futures_endpoint}}" + ], + "path": [ + "api", + "v1", + "copy-trade", + "futures", + "position", + "margin", + "auto-deposit-status" + ], + "query": [] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json", + "name": "Content-Type", + "description": { + "content": "", + "type": "text/plain" + } + }, + { + "key": "gw-ratelimit-remaining", + "value": 1997, + "name": "gw-ratelimit-remaining" + }, + { + "key": "gw-ratelimit-limit", + "value": 2000, + "name": "gw-ratelimit-limit" + }, + { + "key": "gw-ratelimit-reset", + "value": 29990, + "name": "gw-ratelimit-reset" + } + ], + "cookie": [], + "body": "{\n \"code\": \"200000\",\n \"data\": true\n}" + } + ] + } + ], + "description": "" } ], "variable": [ diff --git a/sdk/python/CHANGELOG.md b/sdk/python/CHANGELOG.md index 7effce9b..7e58e0d5 100644 --- a/sdk/python/CHANGELOG.md +++ b/sdk/python/CHANGELOG.md @@ -1,7 +1,6 @@ # Changelog ## 2025-01-16 - - Updated the API sequence to be consistent with the documentation. - Updated the license. - Added Copy Trading API. diff --git a/sdk/python/kucoin_universal_sdk/api/api_rest.py b/sdk/python/kucoin_universal_sdk/api/api_rest.py index dfbcb546..7c8f9f99 100644 --- a/sdk/python/kucoin_universal_sdk/api/api_rest.py +++ b/sdk/python/kucoin_universal_sdk/api/api_rest.py @@ -3,6 +3,7 @@ from kucoin_universal_sdk.generate.service.account_api import AccountService from kucoin_universal_sdk.generate.service.affiliate_api import AffiliateService from kucoin_universal_sdk.generate.service.broker_api import BrokerService +from kucoin_universal_sdk.generate.service.copytrading_api import CopyTradingService from kucoin_universal_sdk.generate.service.earn_api import EarnService from kucoin_universal_sdk.generate.service.futures_api import FuturesService from kucoin_universal_sdk.generate.service.margin_api import MarginService @@ -27,6 +28,11 @@ def get_broker_service(self) -> BrokerService: """Provides functions to access and manage broker-related data.""" pass + @abstractmethod + def get_copytrading_service(self) -> CopyTradingService: + """Provides functions to access and manage copy trading-related data.""" + pass + @abstractmethod def get_earn_service(self) -> EarnService: """Provides functions to access and manage earn-related data.""" diff --git a/sdk/python/kucoin_universal_sdk/generate/copytrading/__init__.py b/sdk/python/kucoin_universal_sdk/generate/copytrading/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/sdk/python/kucoin_universal_sdk/generate/copytrading/futures/__init__.py b/sdk/python/kucoin_universal_sdk/generate/copytrading/futures/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/sdk/python/kucoin_universal_sdk/generate/copytrading/futures/api_futures.py b/sdk/python/kucoin_universal_sdk/generate/copytrading/futures/api_futures.py new file mode 100644 index 00000000..49a3e84e --- /dev/null +++ b/sdk/python/kucoin_universal_sdk/generate/copytrading/futures/api_futures.py @@ -0,0 +1,322 @@ +# Code generated by Kucoin Universal SDK Generator; DO NOT EDIT. + +from abc import ABC, abstractmethod +from typing import Any +from kucoin_universal_sdk.internal.interfaces.transport import Transport +from .model_add_isolated_margin_req import AddIsolatedMarginReq +from .model_add_isolated_margin_resp import AddIsolatedMarginResp +from .model_add_order_req import AddOrderReq +from .model_add_order_resp import AddOrderResp +from .model_add_order_test_req import AddOrderTestReq +from .model_add_order_test_resp import AddOrderTestResp +from .model_add_tpsl_order_req import AddTpslOrderReq +from .model_add_tpsl_order_resp import AddTpslOrderResp +from .model_cancel_order_by_client_oid_req import CancelOrderByClientOidReq +from .model_cancel_order_by_client_oid_resp import CancelOrderByClientOidResp +from .model_cancel_order_by_id_req import CancelOrderByIdReq +from .model_cancel_order_by_id_resp import CancelOrderByIdResp +from .model_get_max_open_size_req import GetMaxOpenSizeReq +from .model_get_max_open_size_resp import GetMaxOpenSizeResp +from .model_get_max_withdraw_margin_req import GetMaxWithdrawMarginReq +from .model_get_max_withdraw_margin_resp import GetMaxWithdrawMarginResp +from .model_modify_auto_deposit_status_req import ModifyAutoDepositStatusReq +from .model_modify_auto_deposit_status_resp import ModifyAutoDepositStatusResp +from .model_modify_isolated_margin_risk_limt_req import ModifyIsolatedMarginRiskLimtReq +from .model_modify_isolated_margin_risk_limt_resp import ModifyIsolatedMarginRiskLimtResp +from .model_remove_isolated_margin_req import RemoveIsolatedMarginReq +from .model_remove_isolated_margin_resp import RemoveIsolatedMarginResp + + +class FuturesAPI(ABC): + + @abstractmethod + def add_order(self, req: AddOrderReq, **kwargs: Any) -> AddOrderResp: + """ + summary: Add Order + description: Place order to the futures trading system, you can place two major types of orders: limit and market. Orders can only be placed if your account has sufficient funds. Once an order is placed, your funds will be put on hold for the duration of the order. The amount of funds on hold depends on the order type and parameters specified. + documentation: https://www.kucoin.com/docs-new/api-3470363 + +---------------------+------------------+ + | Extra API Info | Value | + +---------------------+------------------+ + | API-DOMAIN | FUTURES | + | API-CHANNEL | PRIVATE | + | API-PERMISSION | LEADTRADEFUTURES | + | API-RATE-LIMIT-POOL | COPYTRADING | + | API-RATE-LIMIT | 2 | + +---------------------+------------------+ + """ + pass + + @abstractmethod + def add_order_test(self, req: AddOrderTestReq, + **kwargs: Any) -> AddOrderTestResp: + """ + summary: Add Order Test + description: Place order to the futures trading system just for validation + documentation: https://www.kucoin.com/docs-new/api-3470618 + +---------------------+-------------+ + | Extra API Info | Value | + +---------------------+-------------+ + | API-DOMAIN | FUTURES | + | API-CHANNEL | PRIVATE | + | API-PERMISSION | FUTURES | + | API-RATE-LIMIT-POOL | COPYTRADING | + | API-RATE-LIMIT | 2 | + +---------------------+-------------+ + """ + pass + + @abstractmethod + def add_tpsl_order(self, req: AddTpslOrderReq, + **kwargs: Any) -> AddTpslOrderResp: + """ + summary: Add Take Profit And Stop Loss Order + description: Place take profit and stop loss order supports both take-profit and stop-loss functions, and other functions are exactly the same as the place order interface. + documentation: https://www.kucoin.com/docs-new/api-3470619 + +---------------------+-------------+ + | Extra API Info | Value | + +---------------------+-------------+ + | API-DOMAIN | FUTURES | + | API-CHANNEL | PRIVATE | + | API-PERMISSION | FUTURES | + | API-RATE-LIMIT-POOL | COPYTRADING | + | API-RATE-LIMIT | 2 | + +---------------------+-------------+ + """ + pass + + @abstractmethod + def cancel_order_by_id(self, req: CancelOrderByIdReq, + **kwargs: Any) -> CancelOrderByIdResp: + """ + summary: Cancel Order By OrderId + description: Cancel order by system generated orderId. + documentation: https://www.kucoin.com/docs-new/api-3470620 + +---------------------+-------------+ + | Extra API Info | Value | + +---------------------+-------------+ + | API-DOMAIN | FUTURES | + | API-CHANNEL | PRIVATE | + | API-PERMISSION | FUTURES | + | API-RATE-LIMIT-POOL | COPYTRADING | + | API-RATE-LIMIT | 1 | + +---------------------+-------------+ + """ + pass + + @abstractmethod + def cancel_order_by_client_oid( + self, req: CancelOrderByClientOidReq, + **kwargs: Any) -> CancelOrderByClientOidResp: + """ + summary: Cancel Order By ClientOid + description: Cancel order by client defined orderId. + documentation: https://www.kucoin.com/docs-new/api-3470621 + +---------------------+-------------+ + | Extra API Info | Value | + +---------------------+-------------+ + | API-DOMAIN | FUTURES | + | API-CHANNEL | PRIVATE | + | API-PERMISSION | FUTURES | + | API-RATE-LIMIT-POOL | COPYTRADING | + | API-RATE-LIMIT | 1 | + +---------------------+-------------+ + """ + pass + + @abstractmethod + def get_max_open_size(self, req: GetMaxOpenSizeReq, + **kwargs: Any) -> GetMaxOpenSizeResp: + """ + summary: Get Max Open Size + description: Get Maximum Open Position Size. + documentation: https://www.kucoin.com/docs-new/api-3470612 + +---------------------+-------------+ + | Extra API Info | Value | + +---------------------+-------------+ + | API-DOMAIN | FUTURES | + | API-CHANNEL | PRIVATE | + | API-PERMISSION | FUTURES | + | API-RATE-LIMIT-POOL | COPYTRADING | + | API-RATE-LIMIT | 2 | + +---------------------+-------------+ + """ + pass + + @abstractmethod + def get_max_withdraw_margin(self, req: GetMaxWithdrawMarginReq, + **kwargs: Any) -> GetMaxWithdrawMarginResp: + """ + summary: Get Max Withdraw Margin + description: This interface can query the maximum amount of margin that the current position supports withdrawal. + documentation: https://www.kucoin.com/docs-new/api-3470616 + +---------------------+-------------+ + | Extra API Info | Value | + +---------------------+-------------+ + | API-DOMAIN | FUTURES | + | API-CHANNEL | PRIVATE | + | API-PERMISSION | FUTURES | + | API-RATE-LIMIT-POOL | COPYTRADING | + | API-RATE-LIMIT | 10 | + +---------------------+-------------+ + """ + pass + + @abstractmethod + def add_isolated_margin(self, req: AddIsolatedMarginReq, + **kwargs: Any) -> AddIsolatedMarginResp: + """ + summary: Add Isolated Margin + description: Add Isolated Margin Manually. + documentation: https://www.kucoin.com/docs-new/api-3470614 + +---------------------+-------------+ + | Extra API Info | Value | + +---------------------+-------------+ + | API-DOMAIN | FUTURES | + | API-CHANNEL | PRIVATE | + | API-PERMISSION | FUTURES | + | API-RATE-LIMIT-POOL | COPYTRADING | + | API-RATE-LIMIT | 4 | + +---------------------+-------------+ + """ + pass + + @abstractmethod + def remove_isolated_margin(self, req: RemoveIsolatedMarginReq, + **kwargs: Any) -> RemoveIsolatedMarginResp: + """ + summary: Remove Isolated Margin + description: Remove Isolated Margin Manually. + documentation: https://www.kucoin.com/docs-new/api-3470615 + +---------------------+-------------+ + | Extra API Info | Value | + +---------------------+-------------+ + | API-DOMAIN | FUTURES | + | API-CHANNEL | PRIVATE | + | API-PERMISSION | FUTURES | + | API-RATE-LIMIT-POOL | COPYTRADING | + | API-RATE-LIMIT | 10 | + +---------------------+-------------+ + """ + pass + + @abstractmethod + def modify_isolated_margin_risk_limt( + self, req: ModifyIsolatedMarginRiskLimtReq, + **kwargs: Any) -> ModifyIsolatedMarginRiskLimtResp: + """ + summary: Modify Isolated Margin Risk Limit + description: This interface can be used to obtain information about risk limit level of a specific contract(Only valid for isolated Margin). + documentation: https://www.kucoin.com/docs-new/api-3470613 + +---------------------+-------------+ + | Extra API Info | Value | + +---------------------+-------------+ + | API-DOMAIN | FUTURES | + | API-CHANNEL | PRIVATE | + | API-PERMISSION | FUTURES | + | API-RATE-LIMIT-POOL | COPYTRADING | + | API-RATE-LIMIT | 4 | + +---------------------+-------------+ + """ + pass + + @abstractmethod + def modify_auto_deposit_status( + self, req: ModifyAutoDepositStatusReq, + **kwargs: Any) -> ModifyAutoDepositStatusResp: + """ + summary: Modify Isolated Margin Auto-Deposit Status + description: This endpoint is only applicable to isolated margin and is no longer recommended. It is recommended to use cross margin instead. + documentation: https://www.kucoin.com/docs-new/api-3470617 + +---------------------+-------------+ + | Extra API Info | Value | + +---------------------+-------------+ + | API-DOMAIN | FUTURES | + | API-CHANNEL | PRIVATE | + | API-PERMISSION | FUTURES | + | API-RATE-LIMIT-POOL | COPYTRADING | + | API-RATE-LIMIT | 4 | + +---------------------+-------------+ + """ + pass + + +class FuturesAPIImpl(FuturesAPI): + + def __init__(self, transport: Transport): + self.transport = transport + + def add_order(self, req: AddOrderReq, **kwargs: Any) -> AddOrderResp: + return self.transport.call("futures", False, "POST", + "/api/v1/copy-trade/futures/orders", req, + AddOrderResp(), False, **kwargs) + + def add_order_test(self, req: AddOrderTestReq, + **kwargs: Any) -> AddOrderTestResp: + return self.transport.call("futures", False, "POST", + "/api/v1/copy-trade/futures/orders/test", + req, AddOrderTestResp(), False, **kwargs) + + def add_tpsl_order(self, req: AddTpslOrderReq, + **kwargs: Any) -> AddTpslOrderResp: + return self.transport.call("futures", False, "POST", + "/api/v1/copy-trade/futures/st-orders", req, + AddTpslOrderResp(), False, **kwargs) + + def cancel_order_by_id(self, req: CancelOrderByIdReq, + **kwargs: Any) -> CancelOrderByIdResp: + return self.transport.call("futures", False, "DELETE", + "/api/v1/copy-trade/futures/orders", req, + CancelOrderByIdResp(), False, **kwargs) + + def cancel_order_by_client_oid( + self, req: CancelOrderByClientOidReq, + **kwargs: Any) -> CancelOrderByClientOidResp: + return self.transport.call( + "futures", False, "DELETE", + "/api/v1/copy-trade/futures/orders/client-order", req, + CancelOrderByClientOidResp(), False, **kwargs) + + def get_max_open_size(self, req: GetMaxOpenSizeReq, + **kwargs: Any) -> GetMaxOpenSizeResp: + return self.transport.call( + "futures", False, "GET", + "/api/v1/copy-trade/futures/get-max-open-size", req, + GetMaxOpenSizeResp(), False, **kwargs) + + def get_max_withdraw_margin(self, req: GetMaxWithdrawMarginReq, + **kwargs: Any) -> GetMaxWithdrawMarginResp: + return self.transport.call( + "futures", False, "GET", + "/api/v1/copy-trade/futures/position/margin/max-withdraw-margin", + req, GetMaxWithdrawMarginResp(), False, **kwargs) + + def add_isolated_margin(self, req: AddIsolatedMarginReq, + **kwargs: Any) -> AddIsolatedMarginResp: + return self.transport.call( + "futures", False, "POST", + "/api/v1/copy-trade/futures/position/margin/deposit-margin", req, + AddIsolatedMarginResp(), False, **kwargs) + + def remove_isolated_margin(self, req: RemoveIsolatedMarginReq, + **kwargs: Any) -> RemoveIsolatedMarginResp: + return self.transport.call( + "futures", False, "POST", + "/api/v1/copy-trade/futures/position/margin/withdraw-margin", req, + RemoveIsolatedMarginResp(), False, **kwargs) + + def modify_isolated_margin_risk_limt( + self, req: ModifyIsolatedMarginRiskLimtReq, + **kwargs: Any) -> ModifyIsolatedMarginRiskLimtResp: + return self.transport.call( + "futures", False, "POST", + "/api/v1/copy-trade/futures/position/risk-limit-level/change", req, + ModifyIsolatedMarginRiskLimtResp(), False, **kwargs) + + def modify_auto_deposit_status( + self, req: ModifyAutoDepositStatusReq, + **kwargs: Any) -> ModifyAutoDepositStatusResp: + return self.transport.call( + "futures", False, "POST", + "/api/v1/copy-trade/futures/position/margin/auto-deposit-status", + req, ModifyAutoDepositStatusResp(), False, **kwargs) diff --git a/sdk/python/kucoin_universal_sdk/generate/copytrading/futures/api_futures.template b/sdk/python/kucoin_universal_sdk/generate/copytrading/futures/api_futures.template new file mode 100644 index 00000000..4a0038d4 --- /dev/null +++ b/sdk/python/kucoin_universal_sdk/generate/copytrading/futures/api_futures.template @@ -0,0 +1,211 @@ +# API FUNCTION TEMPLATE + + +def test_add_order_req(self): + """ + add_order + Add Order + /api/v1/copy-trade/futures/orders + """ + + builder = AddOrderReqBuilder() + builder.set_client_oid(?).set_side(?).set_symbol(?).set_leverage(?).set_type(?).set_remark(?).set_stop(?).set_stop_price_type(?).set_stop_price(?).set_reduce_only(?).set_close_order(?).set_force_hold(?).set_margin_mode(?).set_price(?).set_size(?).set_time_in_force(?).set_post_only(?).set_hidden(?).set_iceberg(?).set_visible_size(?) + req = builder.build() + try: + resp = self.api.add_order(req) + print("code: ", resp.common_response.code) + print("msg: ", resp.common_response.message) + print("data: ", resp.to_json()) + except Exception as e: + print("error: ", e) + raise e + +def test_add_order_test_req(self): + """ + add_order_test + Add Order Test + /api/v1/copy-trade/futures/orders/test + """ + + builder = AddOrderTestReqBuilder() + builder.set_client_oid(?).set_side(?).set_symbol(?).set_leverage(?).set_type(?).set_remark(?).set_stop(?).set_stop_price_type(?).set_stop_price(?).set_reduce_only(?).set_close_order(?).set_force_hold(?).set_margin_mode(?).set_price(?).set_size(?).set_time_in_force(?).set_post_only(?).set_hidden(?).set_iceberg(?).set_visible_size(?) + req = builder.build() + try: + resp = self.api.add_order_test(req) + print("code: ", resp.common_response.code) + print("msg: ", resp.common_response.message) + print("data: ", resp.to_json()) + except Exception as e: + print("error: ", e) + raise e + +def test_add_tpsl_order_req(self): + """ + add_tpsl_order + Add Take Profit And Stop Loss Order + /api/v1/copy-trade/futures/st-orders + """ + + builder = AddTpslOrderReqBuilder() + builder.set_client_oid(?).set_side(?).set_symbol(?).set_leverage(?).set_type(?).set_remark(?).set_stop_price_type(?).set_reduce_only(?).set_close_order(?).set_force_hold(?).set_margin_mode(?).set_price(?).set_size(?).set_time_in_force(?).set_post_only(?).set_hidden(?).set_iceberg(?).set_visible_size(?).set_trigger_stop_up_price(?).set_trigger_stop_down_price(?) + req = builder.build() + try: + resp = self.api.add_tpsl_order(req) + print("code: ", resp.common_response.code) + print("msg: ", resp.common_response.message) + print("data: ", resp.to_json()) + except Exception as e: + print("error: ", e) + raise e + +def test_cancel_order_by_id_req(self): + """ + cancel_order_by_id + Cancel Order By OrderId + /api/v1/copy-trade/futures/orders + """ + + builder = CancelOrderByIdReqBuilder() + builder.set_order_id(?) + req = builder.build() + try: + resp = self.api.cancel_order_by_id(req) + print("code: ", resp.common_response.code) + print("msg: ", resp.common_response.message) + print("data: ", resp.to_json()) + except Exception as e: + print("error: ", e) + raise e + +def test_cancel_order_by_client_oid_req(self): + """ + cancel_order_by_client_oid + Cancel Order By ClientOid + /api/v1/copy-trade/futures/orders/client-order + """ + + builder = CancelOrderByClientOidReqBuilder() + builder.set_symbol(?).set_client_oid(?) + req = builder.build() + try: + resp = self.api.cancel_order_by_client_oid(req) + print("code: ", resp.common_response.code) + print("msg: ", resp.common_response.message) + print("data: ", resp.to_json()) + except Exception as e: + print("error: ", e) + raise e + +def test_get_max_open_size_req(self): + """ + get_max_open_size + Get Max Open Size + /api/v1/copy-trade/futures/get-max-open-size + """ + + builder = GetMaxOpenSizeReqBuilder() + builder.set_symbol(?).set_price(?).set_leverage(?) + req = builder.build() + try: + resp = self.api.get_max_open_size(req) + print("code: ", resp.common_response.code) + print("msg: ", resp.common_response.message) + print("data: ", resp.to_json()) + except Exception as e: + print("error: ", e) + raise e + +def test_get_max_withdraw_margin_req(self): + """ + get_max_withdraw_margin + Get Max Withdraw Margin + /api/v1/copy-trade/futures/position/margin/max-withdraw-margin + """ + + builder = GetMaxWithdrawMarginReqBuilder() + builder.set_symbol(?) + req = builder.build() + try: + resp = self.api.get_max_withdraw_margin(req) + print("code: ", resp.common_response.code) + print("msg: ", resp.common_response.message) + print("data: ", resp.to_json()) + except Exception as e: + print("error: ", e) + raise e + +def test_add_isolated_margin_req(self): + """ + add_isolated_margin + Add Isolated Margin + /api/v1/copy-trade/futures/position/margin/deposit-margin + """ + + builder = AddIsolatedMarginReqBuilder() + builder.set_symbol(?).set_margin(?).set_biz_no(?) + req = builder.build() + try: + resp = self.api.add_isolated_margin(req) + print("code: ", resp.common_response.code) + print("msg: ", resp.common_response.message) + print("data: ", resp.to_json()) + except Exception as e: + print("error: ", e) + raise e + +def test_remove_isolated_margin_req(self): + """ + remove_isolated_margin + Remove Isolated Margin + /api/v1/copy-trade/futures/position/margin/withdraw-margin + """ + + builder = RemoveIsolatedMarginReqBuilder() + builder.set_symbol(?).set_withdraw_amount(?) + req = builder.build() + try: + resp = self.api.remove_isolated_margin(req) + print("code: ", resp.common_response.code) + print("msg: ", resp.common_response.message) + print("data: ", resp.to_json()) + except Exception as e: + print("error: ", e) + raise e + +def test_modify_isolated_margin_risk_limt_req(self): + """ + modify_isolated_margin_risk_limt + Modify Isolated Margin Risk Limit + /api/v1/copy-trade/futures/position/risk-limit-level/change + """ + + builder = ModifyIsolatedMarginRiskLimtReqBuilder() + builder.set_symbol(?).set_level(?) + req = builder.build() + try: + resp = self.api.modify_isolated_margin_risk_limt(req) + print("code: ", resp.common_response.code) + print("msg: ", resp.common_response.message) + print("data: ", resp.to_json()) + except Exception as e: + print("error: ", e) + raise e + +def test_modify_auto_deposit_status_req(self): + """ + modify_auto_deposit_status + Modify Isolated Margin Auto-Deposit Status + /api/v1/copy-trade/futures/position/margin/auto-deposit-status + """ + + builder = ModifyAutoDepositStatusReqBuilder() + builder.set_symbol(?).set_status(?) + req = builder.build() + try: + resp = self.api.modify_auto_deposit_status(req) + print("code: ", resp.common_response.code) + print("msg: ", resp.common_response.message) + print("data: ", resp.to_json()) + except Exception as e: + print("error: ", e) + raise e diff --git a/sdk/python/kucoin_universal_sdk/generate/copytrading/futures/api_futures_test.py b/sdk/python/kucoin_universal_sdk/generate/copytrading/futures/api_futures_test.py new file mode 100644 index 00000000..b8edf2c1 --- /dev/null +++ b/sdk/python/kucoin_universal_sdk/generate/copytrading/futures/api_futures_test.py @@ -0,0 +1,236 @@ +import unittest +from .model_add_isolated_margin_req import AddIsolatedMarginReq +from .model_add_isolated_margin_resp import AddIsolatedMarginResp +from .model_add_order_req import AddOrderReq +from .model_add_order_resp import AddOrderResp +from .model_add_order_test_req import AddOrderTestReq +from .model_add_order_test_resp import AddOrderTestResp +from .model_add_tpsl_order_req import AddTpslOrderReq +from .model_add_tpsl_order_resp import AddTpslOrderResp +from .model_cancel_order_by_client_oid_req import CancelOrderByClientOidReq +from .model_cancel_order_by_client_oid_resp import CancelOrderByClientOidResp +from .model_cancel_order_by_id_req import CancelOrderByIdReq +from .model_cancel_order_by_id_resp import CancelOrderByIdResp +from .model_get_max_open_size_req import GetMaxOpenSizeReq +from .model_get_max_open_size_resp import GetMaxOpenSizeResp +from .model_get_max_withdraw_margin_req import GetMaxWithdrawMarginReq +from .model_get_max_withdraw_margin_resp import GetMaxWithdrawMarginResp +from .model_modify_auto_deposit_status_req import ModifyAutoDepositStatusReq +from .model_modify_auto_deposit_status_resp import ModifyAutoDepositStatusResp +from .model_modify_isolated_margin_risk_limt_req import ModifyIsolatedMarginRiskLimtReq +from .model_modify_isolated_margin_risk_limt_resp import ModifyIsolatedMarginRiskLimtResp +from .model_remove_isolated_margin_req import RemoveIsolatedMarginReq +from .model_remove_isolated_margin_resp import RemoveIsolatedMarginResp +from kucoin_universal_sdk.model.common import RestResponse + + +class FuturesAPITest(unittest.TestCase): + + def test_add_order_req_model(self): + """ + add_order + Add Order + /api/v1/copy-trade/futures/orders + """ + data = "{\"clientOid\": \"5c52e11203aa677f33e493fb\", \"side\": \"buy\", \"symbol\": \"XBTUSDTM\", \"leverage\": 3, \"type\": \"limit\", \"remark\": \"order remarks\", \"reduceOnly\": false, \"marginMode\": \"ISOLATED\", \"price\": \"0.1\", \"size\": 1, \"timeInForce\": \"GTC\"}" + req = AddOrderReq.from_json(data) + + def test_add_order_resp_model(self): + """ + add_order + Add Order + /api/v1/copy-trade/futures/orders + """ + data = "{\n \"code\": \"200000\",\n \"data\": {\n \"orderId\": \"263485113055133696\",\n \"clientOid\": \"5c52e11203aa677f331e493fb\"\n }\n}" + common_response = RestResponse.from_json(data) + resp = AddOrderResp.from_dict(common_response.data) + + def test_add_order_test_req_model(self): + """ + add_order_test + Add Order Test + /api/v1/copy-trade/futures/orders/test + """ + data = "{\"clientOid\": \"5c52e11203aa677f33e493fb\", \"side\": \"buy\", \"symbol\": \"XBTUSDTM\", \"leverage\": 3, \"type\": \"limit\", \"remark\": \"order remarks\", \"reduceOnly\": false, \"marginMode\": \"ISOLATED\", \"price\": \"0.1\", \"size\": 1, \"timeInForce\": \"GTC\"}" + req = AddOrderTestReq.from_json(data) + + def test_add_order_test_resp_model(self): + """ + add_order_test + Add Order Test + /api/v1/copy-trade/futures/orders/test + """ + data = "{\n \"code\": \"200000\",\n \"data\": {\n \"orderId\": \"234125150956625920\",\n \"clientOid\": \"5c52e11203aa677f33e493fb\"\n }\n}" + common_response = RestResponse.from_json(data) + resp = AddOrderTestResp.from_dict(common_response.data) + + def test_add_tpsl_order_req_model(self): + """ + add_tpsl_order + Add Take Profit And Stop Loss Order + /api/v1/copy-trade/futures/st-orders + """ + data = "{\"clientOid\": \"5c52e11203aa677f33e493fb\", \"side\": \"buy\", \"symbol\": \"XBTUSDTM\", \"leverage\": 3, \"type\": \"limit\", \"remark\": \"order remarks\", \"reduceOnly\": false, \"marginMode\": \"ISOLATED\", \"price\": \"0.2\", \"size\": 1, \"timeInForce\": \"GTC\", \"triggerStopUpPrice\": \"0.3\", \"triggerStopDownPrice\": \"0.1\", \"stopPriceType\": \"TP\"}" + req = AddTpslOrderReq.from_json(data) + + def test_add_tpsl_order_resp_model(self): + """ + add_tpsl_order + Add Take Profit And Stop Loss Order + /api/v1/copy-trade/futures/st-orders + """ + data = "{\n \"code\": \"200000\",\n \"data\": {\n \"orderId\": \"234125150956625920\",\n \"clientOid\": \"5c52e11203aa677f33e493fb\"\n }\n}" + common_response = RestResponse.from_json(data) + resp = AddTpslOrderResp.from_dict(common_response.data) + + def test_cancel_order_by_id_req_model(self): + """ + cancel_order_by_id + Cancel Order By OrderId + /api/v1/copy-trade/futures/orders + """ + data = "{\"orderId\": \"263485113055133696\"}" + req = CancelOrderByIdReq.from_json(data) + + def test_cancel_order_by_id_resp_model(self): + """ + cancel_order_by_id + Cancel Order By OrderId + /api/v1/copy-trade/futures/orders + """ + data = "{\n \"code\": \"200000\",\n \"data\": {\n \"cancelledOrderIds\": [\n \"263485113055133696\"\n ]\n }\n}" + common_response = RestResponse.from_json(data) + resp = CancelOrderByIdResp.from_dict(common_response.data) + + def test_cancel_order_by_client_oid_req_model(self): + """ + cancel_order_by_client_oid + Cancel Order By ClientOid + /api/v1/copy-trade/futures/orders/client-order + """ + data = "{\"symbol\": \"XBTUSDTM\", \"clientOid\": \"5c52e11203aa677f331e493fb\"}" + req = CancelOrderByClientOidReq.from_json(data) + + def test_cancel_order_by_client_oid_resp_model(self): + """ + cancel_order_by_client_oid + Cancel Order By ClientOid + /api/v1/copy-trade/futures/orders/client-order + """ + data = "{\n \"code\": \"200000\",\n \"data\": {\n \"clientOid\": \"5c52e11203aa677f331e4913fb\"\n }\n}" + common_response = RestResponse.from_json(data) + resp = CancelOrderByClientOidResp.from_dict(common_response.data) + + def test_get_max_open_size_req_model(self): + """ + get_max_open_size + Get Max Open Size + /api/v1/copy-trade/futures/get-max-open-size + """ + data = "{\"symbol\": \"XBTUSDTM\", \"price\": \"example_string_default_value\", \"leverage\": 123456}" + req = GetMaxOpenSizeReq.from_json(data) + + def test_get_max_open_size_resp_model(self): + """ + get_max_open_size + Get Max Open Size + /api/v1/copy-trade/futures/get-max-open-size + """ + data = "{\n \"code\": \"200000\",\n \"data\": {\n \"symbol\": \"XBTUSDTM\",\n \"maxBuyOpenSize\": 8,\n \"maxSellOpenSize\": 5\n }\n}" + common_response = RestResponse.from_json(data) + resp = GetMaxOpenSizeResp.from_dict(common_response.data) + + def test_get_max_withdraw_margin_req_model(self): + """ + get_max_withdraw_margin + Get Max Withdraw Margin + /api/v1/copy-trade/futures/position/margin/max-withdraw-margin + """ + data = "{\"symbol\": \"example_string_default_value\"}" + req = GetMaxWithdrawMarginReq.from_json(data) + + def test_get_max_withdraw_margin_resp_model(self): + """ + get_max_withdraw_margin + Get Max Withdraw Margin + /api/v1/copy-trade/futures/position/margin/max-withdraw-margin + """ + data = "{\n \"code\": \"200000\",\n \"data\": \"21.1135719252\"\n}" + common_response = RestResponse.from_json(data) + resp = GetMaxWithdrawMarginResp.from_dict(common_response.data) + + def test_add_isolated_margin_req_model(self): + """ + add_isolated_margin + Add Isolated Margin + /api/v1/copy-trade/futures/position/margin/deposit-margin + """ + data = "{\"symbol\": \"string\", \"margin\": 0, \"bizNo\": \"string\"}" + req = AddIsolatedMarginReq.from_json(data) + + def test_add_isolated_margin_resp_model(self): + """ + add_isolated_margin + Add Isolated Margin + /api/v1/copy-trade/futures/position/margin/deposit-margin + """ + data = "{\n \"code\": \"200000\",\n \"data\": {\n \"id\": \"6200c9b83aecfb000152ddcd\",\n \"symbol\": \"XBTUSDTM\",\n \"autoDeposit\": false,\n \"maintMarginReq\": 0.005,\n \"riskLimit\": 500000,\n \"realLeverage\": 18.72,\n \"crossMode\": false,\n \"delevPercentage\": 0.66,\n \"openingTimestamp\": 1646287090131,\n \"currentTimestamp\": 1646295055021,\n \"currentQty\": 1,\n \"currentCost\": 43.388,\n \"currentComm\": 0.0260328,\n \"unrealisedCost\": 43.388,\n \"realisedGrossCost\": 0,\n \"realisedCost\": 0.0260328,\n \"isOpen\": true,\n \"markPrice\": 43536.65,\n \"markValue\": 43.53665,\n \"posCost\": 43.388,\n \"posCross\": 0.000024985,\n \"posInit\": 2.1694,\n \"posComm\": 0.02733446,\n \"posLoss\": 0,\n \"posMargin\": 2.19675944,\n \"posMaint\": 0.24861326,\n \"maintMargin\": 2.34540944,\n \"realisedGrossPnl\": 0,\n \"realisedPnl\": -0.0260328,\n \"unrealisedPnl\": 0.14865,\n \"unrealisedPnlPcnt\": 0.0034,\n \"unrealisedRoePcnt\": 0.0685,\n \"avgEntryPrice\": 43388,\n \"liquidationPrice\": 41440,\n \"bankruptPrice\": 41218,\n \"userId\": 1234321123,\n \"settleCurrency\": \"USDT\"\n }\n}" + common_response = RestResponse.from_json(data) + resp = AddIsolatedMarginResp.from_dict(common_response.data) + + def test_remove_isolated_margin_req_model(self): + """ + remove_isolated_margin + Remove Isolated Margin + /api/v1/copy-trade/futures/position/margin/withdraw-margin + """ + data = "{\"symbol\": \"XBTUSDTM\", \"withdrawAmount\": \"0.0000001\"}" + req = RemoveIsolatedMarginReq.from_json(data) + + def test_remove_isolated_margin_resp_model(self): + """ + remove_isolated_margin + Remove Isolated Margin + /api/v1/copy-trade/futures/position/margin/withdraw-margin + """ + data = "{\n \"code\": \"200000\",\n \"data\": \"0.1\"\n}" + common_response = RestResponse.from_json(data) + resp = RemoveIsolatedMarginResp.from_dict(common_response.data) + + def test_modify_isolated_margin_risk_limt_req_model(self): + """ + modify_isolated_margin_risk_limt + Modify Isolated Margin Risk Limit + /api/v1/copy-trade/futures/position/risk-limit-level/change + """ + data = "{\"symbol\": \"XBTUSDTM\", \"level\": 1}" + req = ModifyIsolatedMarginRiskLimtReq.from_json(data) + + def test_modify_isolated_margin_risk_limt_resp_model(self): + """ + modify_isolated_margin_risk_limt + Modify Isolated Margin Risk Limit + /api/v1/copy-trade/futures/position/risk-limit-level/change + """ + data = "{\n \"code\": \"200000\",\n \"data\": true\n}" + common_response = RestResponse.from_json(data) + resp = ModifyIsolatedMarginRiskLimtResp.from_dict(common_response.data) + + def test_modify_auto_deposit_status_req_model(self): + """ + modify_auto_deposit_status + Modify Isolated Margin Auto-Deposit Status + /api/v1/copy-trade/futures/position/margin/auto-deposit-status + """ + data = "{\"symbol\": \"XBTUSDTM\", \"status\": true}" + req = ModifyAutoDepositStatusReq.from_json(data) + + def test_modify_auto_deposit_status_resp_model(self): + """ + modify_auto_deposit_status + Modify Isolated Margin Auto-Deposit Status + /api/v1/copy-trade/futures/position/margin/auto-deposit-status + """ + data = "{\n \"code\": \"200000\",\n \"data\": true\n}" + common_response = RestResponse.from_json(data) + resp = ModifyAutoDepositStatusResp.from_dict(common_response.data) diff --git a/sdk/python/kucoin_universal_sdk/generate/copytrading/futures/model_add_isolated_margin_req.py b/sdk/python/kucoin_universal_sdk/generate/copytrading/futures/model_add_isolated_margin_req.py new file mode 100644 index 00000000..91bac857 --- /dev/null +++ b/sdk/python/kucoin_universal_sdk/generate/copytrading/futures/model_add_isolated_margin_req.py @@ -0,0 +1,107 @@ +# coding: utf-8 + +# Code generated by Kucoin Universal SDK Generator; DO NOT EDIT. + +from __future__ import annotations +import pprint +import json + +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional + + +class AddIsolatedMarginReq(BaseModel): + """ + AddIsolatedMarginReq + + Attributes: + symbol (str): Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) + margin (float): Margin amount (min. margin amount≥0.00001667XBT) + biz_no (str): A unique ID generated by the user, to ensure the operation is processed by the system only once, The maximum length cannot exceed 36 + """ + + symbol: Optional[str] = Field( + default=None, + description= + "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) " + ) + margin: Optional[float] = Field( + default=None, + description="Margin amount (min. margin amount≥0.00001667XBT)") + biz_no: Optional[str] = Field( + default=None, + description= + "A unique ID generated by the user, to ensure the operation is processed by the system only once, The maximum length cannot exceed 36", + alias="bizNo") + + __properties: ClassVar[List[str]] = ["symbol", "margin", "bizNo"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=False, + protected_namespaces=(), + ) + + def to_str(self) -> str: + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + return self.model_dump_json(by_alias=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[AddIsolatedMarginReq]: + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + _dict = self.model_dump( + by_alias=True, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict( + cls, obj: Optional[Dict[str, + Any]]) -> Optional[AddIsolatedMarginReq]: + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "symbol": obj.get("symbol"), + "margin": obj.get("margin"), + "bizNo": obj.get("bizNo") + }) + return _obj + + +class AddIsolatedMarginReqBuilder: + + def __init__(self): + self.obj = {} + + def set_symbol(self, value: str) -> AddIsolatedMarginReqBuilder: + """ + Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) + """ + self.obj['symbol'] = value + return self + + def set_margin(self, value: float) -> AddIsolatedMarginReqBuilder: + """ + Margin amount (min. margin amount≥0.00001667XBT) + """ + self.obj['margin'] = value + return self + + def set_biz_no(self, value: str) -> AddIsolatedMarginReqBuilder: + """ + A unique ID generated by the user, to ensure the operation is processed by the system only once, The maximum length cannot exceed 36 + """ + self.obj['bizNo'] = value + return self + + def build(self) -> AddIsolatedMarginReq: + return AddIsolatedMarginReq(**self.obj) diff --git a/sdk/python/kucoin_universal_sdk/generate/copytrading/futures/model_add_isolated_margin_resp.py b/sdk/python/kucoin_universal_sdk/generate/copytrading/futures/model_add_isolated_margin_resp.py new file mode 100644 index 00000000..54ea9a91 --- /dev/null +++ b/sdk/python/kucoin_universal_sdk/generate/copytrading/futures/model_add_isolated_margin_resp.py @@ -0,0 +1,308 @@ +# coding: utf-8 + +# Code generated by Kucoin Universal SDK Generator; DO NOT EDIT. + +from __future__ import annotations +import pprint +import json + +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from kucoin_universal_sdk.internal.interfaces.response import Response +from kucoin_universal_sdk.model.common import RestResponse + + +class AddIsolatedMarginResp(BaseModel, Response): + """ + AddIsolatedMarginResp + + Attributes: + id (str): Position ID + symbol (str): Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) + auto_deposit (bool): Auto deposit margin or not + maint_margin_req (float): Maintenance margin requirement + risk_limit (int): Risk limit + real_leverage (float): Leverage o the order + cross_mode (bool): Cross mode or not + delev_percentage (float): ADL ranking percentile + opening_timestamp (int): Open time + current_timestamp (int): Current timestamp + current_qty (int): Current postion quantity + current_cost (float): Current postion value + current_comm (float): Current commission + unrealised_cost (float): Unrealised value + realised_gross_cost (float): Accumulated realised gross profit value + realised_cost (float): Current realised position value + is_open (bool): Opened position or not + mark_price (float): Mark price + mark_value (float): Mark value + pos_cost (float): Position value + pos_cross (float): added margin + pos_init (float): Leverage margin + pos_comm (float): Bankruptcy cost + pos_loss (float): Funding fees paid out + pos_margin (float): Position margin + pos_maint (float): Maintenance margin + maint_margin (float): Position margin + realised_gross_pnl (float): Accumulated realised gross profit value + realised_pnl (float): Realised profit and loss + unrealised_pnl (float): Unrealised profit and loss + unrealised_pnl_pcnt (float): Profit-loss ratio of the position + unrealised_roe_pcnt (float): Rate of return on investment + avg_entry_price (float): Average entry price + liquidation_price (float): Liquidation price + bankrupt_price (float): Bankruptcy price + user_id (int): userId + settle_currency (str): Currency used to clear and settle the trades + """ + + common_response: Optional[RestResponse] = Field( + default=None, description="Common response") + id: Optional[str] = Field(default=None, description="Position ID") + symbol: Optional[str] = Field( + default=None, + description= + "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) " + ) + auto_deposit: Optional[bool] = Field( + default=None, + description="Auto deposit margin or not", + alias="autoDeposit") + maint_margin_req: Optional[float] = Field( + default=None, + description="Maintenance margin requirement ", + alias="maintMarginReq") + risk_limit: Optional[int] = Field(default=None, + description="Risk limit ", + alias="riskLimit") + real_leverage: Optional[float] = Field(default=None, + description="Leverage o the order", + alias="realLeverage") + cross_mode: Optional[bool] = Field(default=None, + description="Cross mode or not", + alias="crossMode") + delev_percentage: Optional[float] = Field( + default=None, + description="ADL ranking percentile", + alias="delevPercentage") + opening_timestamp: Optional[int] = Field(default=None, + description="Open time", + alias="openingTimestamp") + current_timestamp: Optional[int] = Field(default=None, + description="Current timestamp ", + alias="currentTimestamp") + current_qty: Optional[int] = Field(default=None, + description="Current postion quantity", + alias="currentQty") + current_cost: Optional[float] = Field(default=None, + description="Current postion value", + alias="currentCost") + current_comm: Optional[float] = Field(default=None, + description="Current commission", + alias="currentComm") + unrealised_cost: Optional[float] = Field(default=None, + description="Unrealised value", + alias="unrealisedCost") + realised_gross_cost: Optional[float] = Field( + default=None, + description="Accumulated realised gross profit value", + alias="realisedGrossCost") + realised_cost: Optional[float] = Field( + default=None, + description="Current realised position value", + alias="realisedCost") + is_open: Optional[bool] = Field(default=None, + description="Opened position or not", + alias="isOpen") + mark_price: Optional[float] = Field(default=None, + description="Mark price", + alias="markPrice") + mark_value: Optional[float] = Field(default=None, + description="Mark value ", + alias="markValue") + pos_cost: Optional[float] = Field(default=None, + description="Position value", + alias="posCost") + pos_cross: Optional[float] = Field(default=None, + description="added margin", + alias="posCross") + pos_init: Optional[float] = Field(default=None, + description="Leverage margin", + alias="posInit") + pos_comm: Optional[float] = Field(default=None, + description="Bankruptcy cost", + alias="posComm") + pos_loss: Optional[float] = Field(default=None, + description="Funding fees paid out", + alias="posLoss") + pos_margin: Optional[float] = Field(default=None, + description="Position margin", + alias="posMargin") + pos_maint: Optional[float] = Field(default=None, + description="Maintenance margin", + alias="posMaint") + maint_margin: Optional[float] = Field(default=None, + description="Position margin", + alias="maintMargin") + realised_gross_pnl: Optional[float] = Field( + default=None, + description="Accumulated realised gross profit value", + alias="realisedGrossPnl") + realised_pnl: Optional[float] = Field( + default=None, + description="Realised profit and loss", + alias="realisedPnl") + unrealised_pnl: Optional[float] = Field( + default=None, + description="Unrealised profit and loss", + alias="unrealisedPnl") + unrealised_pnl_pcnt: Optional[float] = Field( + default=None, + description="Profit-loss ratio of the position", + alias="unrealisedPnlPcnt") + unrealised_roe_pcnt: Optional[float] = Field( + default=None, + description="Rate of return on investment", + alias="unrealisedRoePcnt") + avg_entry_price: Optional[float] = Field(default=None, + description="Average entry price", + alias="avgEntryPrice") + liquidation_price: Optional[float] = Field(default=None, + description="Liquidation price", + alias="liquidationPrice") + bankrupt_price: Optional[float] = Field(default=None, + description="Bankruptcy price", + alias="bankruptPrice") + user_id: Optional[int] = Field(default=None, + description="userId", + alias="userId") + settle_currency: Optional[str] = Field( + default=None, + description="Currency used to clear and settle the trades", + alias="settleCurrency") + + __properties: ClassVar[List[str]] = [ + "id", "symbol", "autoDeposit", "maintMarginReq", "riskLimit", + "realLeverage", "crossMode", "delevPercentage", "openingTimestamp", + "currentTimestamp", "currentQty", "currentCost", "currentComm", + "unrealisedCost", "realisedGrossCost", "realisedCost", "isOpen", + "markPrice", "markValue", "posCost", "posCross", "posInit", "posComm", + "posLoss", "posMargin", "posMaint", "maintMargin", "realisedGrossPnl", + "realisedPnl", "unrealisedPnl", "unrealisedPnlPcnt", + "unrealisedRoePcnt", "avgEntryPrice", "liquidationPrice", + "bankruptPrice", "userId", "settleCurrency" + ] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=False, + protected_namespaces=(), + ) + + def to_str(self) -> str: + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + return self.model_dump_json(by_alias=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[AddIsolatedMarginResp]: + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + _dict = self.model_dump( + by_alias=True, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict( + cls, obj: Optional[Dict[str, + Any]]) -> Optional[AddIsolatedMarginResp]: + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": + obj.get("id"), + "symbol": + obj.get("symbol"), + "autoDeposit": + obj.get("autoDeposit"), + "maintMarginReq": + obj.get("maintMarginReq"), + "riskLimit": + obj.get("riskLimit"), + "realLeverage": + obj.get("realLeverage"), + "crossMode": + obj.get("crossMode"), + "delevPercentage": + obj.get("delevPercentage"), + "openingTimestamp": + obj.get("openingTimestamp"), + "currentTimestamp": + obj.get("currentTimestamp"), + "currentQty": + obj.get("currentQty"), + "currentCost": + obj.get("currentCost"), + "currentComm": + obj.get("currentComm"), + "unrealisedCost": + obj.get("unrealisedCost"), + "realisedGrossCost": + obj.get("realisedGrossCost"), + "realisedCost": + obj.get("realisedCost"), + "isOpen": + obj.get("isOpen"), + "markPrice": + obj.get("markPrice"), + "markValue": + obj.get("markValue"), + "posCost": + obj.get("posCost"), + "posCross": + obj.get("posCross"), + "posInit": + obj.get("posInit"), + "posComm": + obj.get("posComm"), + "posLoss": + obj.get("posLoss"), + "posMargin": + obj.get("posMargin"), + "posMaint": + obj.get("posMaint"), + "maintMargin": + obj.get("maintMargin"), + "realisedGrossPnl": + obj.get("realisedGrossPnl"), + "realisedPnl": + obj.get("realisedPnl"), + "unrealisedPnl": + obj.get("unrealisedPnl"), + "unrealisedPnlPcnt": + obj.get("unrealisedPnlPcnt"), + "unrealisedRoePcnt": + obj.get("unrealisedRoePcnt"), + "avgEntryPrice": + obj.get("avgEntryPrice"), + "liquidationPrice": + obj.get("liquidationPrice"), + "bankruptPrice": + obj.get("bankruptPrice"), + "userId": + obj.get("userId"), + "settleCurrency": + obj.get("settleCurrency") + }) + return _obj + + def set_common_response(self, response: RestResponse): + self.common_response = response diff --git a/sdk/python/kucoin_universal_sdk/generate/copytrading/futures/model_add_order_req.py b/sdk/python/kucoin_universal_sdk/generate/copytrading/futures/model_add_order_req.py new file mode 100644 index 00000000..10bb68e7 --- /dev/null +++ b/sdk/python/kucoin_universal_sdk/generate/copytrading/futures/model_add_order_req.py @@ -0,0 +1,429 @@ +# coding: utf-8 + +# Code generated by Kucoin Universal SDK Generator; DO NOT EDIT. + +from __future__ import annotations +import pprint +import json + +from enum import Enum +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional + + +class AddOrderReq(BaseModel): + """ + AddOrderReq + + Attributes: + client_oid (str): Unique order id created by users to identify their orders, the maximum length cannot exceed 40, e.g. UUID, Only allows numbers, characters, underline(_), and separator(-) + side (SideEnum): specify if the order is to 'buy' or 'sell' + symbol (str): Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) + leverage (int): Used to calculate the margin to be frozen for the order. If you are to close the position, this parameter is not required. + type (TypeEnum): specify if the order is an 'limit' order or 'market' order + remark (str): remark for the order, length cannot exceed 100 utf8 characters + stop (StopEnum): Either 'down' or 'up'. If stop is used,parameter stopPrice and stopPriceType also need to be provieded. + stop_price_type (StopPriceTypeEnum): Either 'TP', 'IP' or 'MP', Need to be defined if stop is specified. + stop_price (str): Need to be defined if stop is specified. + reduce_only (bool): A mark to reduce the position size only. Set to false by default. Need to set the position size when reduceOnly is true. If set to true, only the orders reducing the position size will be executed. If the reduce-only order size exceeds the position size, the extra size will be canceled. + close_order (bool): A mark to close the position. Set to false by default. If closeOrder is set to true, the system will close the position and the position size will become 0. Side, Size and Leverage fields can be left empty and the system will determine the side and size automatically. + force_hold (bool): A mark to forcely hold the funds for an order, even though it's an order to reduce the position size. This helps the order stay on the order book and not get canceled when the position size changes. Set to false by default. The system will forcely freeze certain amount of funds for this order, including orders whose direction is opposite to the current positions. This feature is to ensure that the order won’t be canceled by the matching engine in such a circumstance that not enough funds are frozen for the order. + margin_mode (MarginModeEnum): Margin mode: ISOLATED, CROSS, default: ISOLATED + price (str): Required for type is 'limit' order, indicating the operating price + size (int): Order size (Lot), must be a positive integer. The quantity unit of coin-swap contracts is size(lot), and other units are not supported. + time_in_force (TimeInForceEnum): Optional for type is 'limit' order, [Time in force](https://www.kucoin.com/docs-new/doc-338146) is a special strategy used during trading, default is GTC + post_only (bool): Optional for type is 'limit' order, post only flag, invalid when timeInForce is IOC. When postOnly is true, not allowed choose hidden or iceberg. The post-only flag ensures that the trader always pays the maker fee and provides liquidity to the order book. If any part of the order is going to pay taker fee, the order will be fully rejected. + hidden (bool): Optional for type is 'limit' order, orders not displaying in order book. When hidden chose, not allowed choose postOnly. + iceberg (bool): Optional for type is 'limit' order, Only visible portion of the order is displayed in the order book. When iceberg chose, not allowed choose postOnly. + visible_size (str): Optional for type is 'limit' order, The maximum visible size of an iceberg order. please place order in size (lots), The units of qty (base currency) and valueQty (value) are not supported. + """ + + class SideEnum(Enum): + """ + Attributes: + BUY: + SELL: + """ + BUY = 'buy' + SELL = 'sell' + + class TypeEnum(Enum): + """ + Attributes: + LIMIT: + MARKET: + """ + LIMIT = 'limit' + MARKET = 'market' + + class StopEnum(Enum): + """ + Attributes: + DOWN: Triggers when the price reaches or goes below the stopPrice. + UP: Triggers when the price reaches or goes above the stopPrice + """ + DOWN = 'down' + UP = 'up' + + class StopPriceTypeEnum(Enum): + """ + Attributes: + TRADE_PRICE: TP for trade price, The last trade price is the last price at which an order was filled. This price can be found in the latest match message. + MARK_PRICE: MP for mark price, The mark price can be obtained through relevant OPEN API for index services + INDEX_PRICE: IP for index price, The index price can be obtained through relevant OPEN API for index services + """ + TRADE_PRICE = 'TP' + MARK_PRICE = 'MP' + INDEX_PRICE = 'IP' + + class MarginModeEnum(Enum): + """ + Attributes: + ISOLATED: Isolated Margin + CROSS: Cross Margin + """ + ISOLATED = 'ISOLATED' + CROSS = 'CROSS' + + class TimeInForceEnum(Enum): + """ + Attributes: + GOOD_TILL_CANCELED: order remains open on the order book until canceled. This is the default type if the field is left empty. + IMMEDIATE_OR_CANCEL: being matched or not, the remaining size of the order will be instantly canceled instead of entering the order book. + """ + GOOD_TILL_CANCELED = 'GTC' + IMMEDIATE_OR_CANCEL = 'IOC' + + client_oid: Optional[str] = Field( + default=None, + description= + "Unique order id created by users to identify their orders, the maximum length cannot exceed 40, e.g. UUID, Only allows numbers, characters, underline(_), and separator(-)", + alias="clientOid") + side: Optional[SideEnum] = Field( + default=None, + description="specify if the order is to 'buy' or 'sell' ") + symbol: Optional[str] = Field( + default=None, + description= + "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) " + ) + leverage: Optional[int] = Field( + default=None, + description= + "Used to calculate the margin to be frozen for the order. If you are to close the position, this parameter is not required." + ) + type: Optional[TypeEnum] = Field( + default=TypeEnum.LIMIT, + description="specify if the order is an 'limit' order or 'market' order" + ) + remark: Optional[str] = Field( + default=None, + description= + "remark for the order, length cannot exceed 100 utf8 characters") + stop: Optional[StopEnum] = Field( + default=None, + description= + "Either 'down' or 'up'. If stop is used,parameter stopPrice and stopPriceType also need to be provieded." + ) + stop_price_type: Optional[StopPriceTypeEnum] = Field( + default=None, + description= + "Either 'TP', 'IP' or 'MP', Need to be defined if stop is specified.", + alias="stopPriceType") + stop_price: Optional[str] = Field( + default=None, + description="Need to be defined if stop is specified. ", + alias="stopPrice") + reduce_only: Optional[bool] = Field( + default=False, + description= + "A mark to reduce the position size only. Set to false by default. Need to set the position size when reduceOnly is true. If set to true, only the orders reducing the position size will be executed. If the reduce-only order size exceeds the position size, the extra size will be canceled.", + alias="reduceOnly") + close_order: Optional[bool] = Field( + default=False, + description= + "A mark to close the position. Set to false by default. If closeOrder is set to true, the system will close the position and the position size will become 0. Side, Size and Leverage fields can be left empty and the system will determine the side and size automatically.", + alias="closeOrder") + force_hold: Optional[bool] = Field( + default=False, + description= + "A mark to forcely hold the funds for an order, even though it's an order to reduce the position size. This helps the order stay on the order book and not get canceled when the position size changes. Set to false by default. The system will forcely freeze certain amount of funds for this order, including orders whose direction is opposite to the current positions. This feature is to ensure that the order won’t be canceled by the matching engine in such a circumstance that not enough funds are frozen for the order.", + alias="forceHold") + margin_mode: Optional[MarginModeEnum] = Field( + default=MarginModeEnum.ISOLATED, + description="Margin mode: ISOLATED, CROSS, default: ISOLATED", + alias="marginMode") + price: Optional[str] = Field( + default=None, + description= + "Required for type is 'limit' order, indicating the operating price") + size: Optional[int] = Field( + default=None, + description= + "Order size (Lot), must be a positive integer. The quantity unit of coin-swap contracts is size(lot), and other units are not supported." + ) + time_in_force: Optional[TimeInForceEnum] = Field( + default=TimeInForceEnum.GOOD_TILL_CANCELED, + description= + "Optional for type is 'limit' order, [Time in force](https://www.kucoin.com/docs-new/doc-338146) is a special strategy used during trading, default is GTC", + alias="timeInForce") + post_only: Optional[bool] = Field( + default=False, + description= + "Optional for type is 'limit' order, post only flag, invalid when timeInForce is IOC. When postOnly is true, not allowed choose hidden or iceberg. The post-only flag ensures that the trader always pays the maker fee and provides liquidity to the order book. If any part of the order is going to pay taker fee, the order will be fully rejected.", + alias="postOnly") + hidden: Optional[bool] = Field( + default=False, + description= + "Optional for type is 'limit' order, orders not displaying in order book. When hidden chose, not allowed choose postOnly." + ) + iceberg: Optional[bool] = Field( + default=False, + description= + "Optional for type is 'limit' order, Only visible portion of the order is displayed in the order book. When iceberg chose, not allowed choose postOnly." + ) + visible_size: Optional[str] = Field( + default=None, + description= + "Optional for type is 'limit' order, The maximum visible size of an iceberg order. please place order in size (lots), The units of qty (base currency) and valueQty (value) are not supported.", + alias="visibleSize") + + __properties: ClassVar[List[str]] = [ + "clientOid", "side", "symbol", "leverage", "type", "remark", "stop", + "stopPriceType", "stopPrice", "reduceOnly", "closeOrder", "forceHold", + "marginMode", "price", "size", "timeInForce", "postOnly", "hidden", + "iceberg", "visibleSize" + ] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=False, + protected_namespaces=(), + ) + + def to_str(self) -> str: + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + return self.model_dump_json(by_alias=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[AddOrderReq]: + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + _dict = self.model_dump( + by_alias=True, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[AddOrderReq]: + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "clientOid": + obj.get("clientOid"), + "side": + obj.get("side"), + "symbol": + obj.get("symbol"), + "leverage": + obj.get("leverage"), + "type": + obj.get("type") + if obj.get("type") is not None else AddOrderReq.TypeEnum.LIMIT, + "remark": + obj.get("remark"), + "stop": + obj.get("stop"), + "stopPriceType": + obj.get("stopPriceType"), + "stopPrice": + obj.get("stopPrice"), + "reduceOnly": + obj.get("reduceOnly") + if obj.get("reduceOnly") is not None else False, + "closeOrder": + obj.get("closeOrder") + if obj.get("closeOrder") is not None else False, + "forceHold": + obj.get("forceHold") + if obj.get("forceHold") is not None else False, + "marginMode": + obj.get("marginMode") if obj.get("marginMode") is not None else + AddOrderReq.MarginModeEnum.ISOLATED, + "price": + obj.get("price"), + "size": + obj.get("size"), + "timeInForce": + obj.get("timeInForce") if obj.get("timeInForce") is not None else + AddOrderReq.TimeInForceEnum.GOOD_TILL_CANCELED, + "postOnly": + obj.get("postOnly") if obj.get("postOnly") is not None else False, + "hidden": + obj.get("hidden") if obj.get("hidden") is not None else False, + "iceberg": + obj.get("iceberg") if obj.get("iceberg") is not None else False, + "visibleSize": + obj.get("visibleSize") + }) + return _obj + + +class AddOrderReqBuilder: + + def __init__(self): + self.obj = {} + + def set_client_oid(self, value: str) -> AddOrderReqBuilder: + """ + Unique order id created by users to identify their orders, the maximum length cannot exceed 40, e.g. UUID, Only allows numbers, characters, underline(_), and separator(-) + """ + self.obj['clientOid'] = value + return self + + def set_side(self, value: AddOrderReq.SideEnum) -> AddOrderReqBuilder: + """ + specify if the order is to 'buy' or 'sell' + """ + self.obj['side'] = value + return self + + def set_symbol(self, value: str) -> AddOrderReqBuilder: + """ + Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) + """ + self.obj['symbol'] = value + return self + + def set_leverage(self, value: int) -> AddOrderReqBuilder: + """ + Used to calculate the margin to be frozen for the order. If you are to close the position, this parameter is not required. + """ + self.obj['leverage'] = value + return self + + def set_type(self, value: AddOrderReq.TypeEnum) -> AddOrderReqBuilder: + """ + specify if the order is an 'limit' order or 'market' order + """ + self.obj['type'] = value + return self + + def set_remark(self, value: str) -> AddOrderReqBuilder: + """ + remark for the order, length cannot exceed 100 utf8 characters + """ + self.obj['remark'] = value + return self + + def set_stop(self, value: AddOrderReq.StopEnum) -> AddOrderReqBuilder: + """ + Either 'down' or 'up'. If stop is used,parameter stopPrice and stopPriceType also need to be provieded. + """ + self.obj['stop'] = value + return self + + def set_stop_price_type( + self, value: AddOrderReq.StopPriceTypeEnum) -> AddOrderReqBuilder: + """ + Either 'TP', 'IP' or 'MP', Need to be defined if stop is specified. + """ + self.obj['stopPriceType'] = value + return self + + def set_stop_price(self, value: str) -> AddOrderReqBuilder: + """ + Need to be defined if stop is specified. + """ + self.obj['stopPrice'] = value + return self + + def set_reduce_only(self, value: bool) -> AddOrderReqBuilder: + """ + A mark to reduce the position size only. Set to false by default. Need to set the position size when reduceOnly is true. If set to true, only the orders reducing the position size will be executed. If the reduce-only order size exceeds the position size, the extra size will be canceled. + """ + self.obj['reduceOnly'] = value + return self + + def set_close_order(self, value: bool) -> AddOrderReqBuilder: + """ + A mark to close the position. Set to false by default. If closeOrder is set to true, the system will close the position and the position size will become 0. Side, Size and Leverage fields can be left empty and the system will determine the side and size automatically. + """ + self.obj['closeOrder'] = value + return self + + def set_force_hold(self, value: bool) -> AddOrderReqBuilder: + """ + A mark to forcely hold the funds for an order, even though it's an order to reduce the position size. This helps the order stay on the order book and not get canceled when the position size changes. Set to false by default. The system will forcely freeze certain amount of funds for this order, including orders whose direction is opposite to the current positions. This feature is to ensure that the order won’t be canceled by the matching engine in such a circumstance that not enough funds are frozen for the order. + """ + self.obj['forceHold'] = value + return self + + def set_margin_mode( + self, value: AddOrderReq.MarginModeEnum) -> AddOrderReqBuilder: + """ + Margin mode: ISOLATED, CROSS, default: ISOLATED + """ + self.obj['marginMode'] = value + return self + + def set_price(self, value: str) -> AddOrderReqBuilder: + """ + Required for type is 'limit' order, indicating the operating price + """ + self.obj['price'] = value + return self + + def set_size(self, value: int) -> AddOrderReqBuilder: + """ + Order size (Lot), must be a positive integer. The quantity unit of coin-swap contracts is size(lot), and other units are not supported. + """ + self.obj['size'] = value + return self + + def set_time_in_force( + self, value: AddOrderReq.TimeInForceEnum) -> AddOrderReqBuilder: + """ + Optional for type is 'limit' order, [Time in force](https://www.kucoin.com/docs-new/doc-338146) is a special strategy used during trading, default is GTC + """ + self.obj['timeInForce'] = value + return self + + def set_post_only(self, value: bool) -> AddOrderReqBuilder: + """ + Optional for type is 'limit' order, post only flag, invalid when timeInForce is IOC. When postOnly is true, not allowed choose hidden or iceberg. The post-only flag ensures that the trader always pays the maker fee and provides liquidity to the order book. If any part of the order is going to pay taker fee, the order will be fully rejected. + """ + self.obj['postOnly'] = value + return self + + def set_hidden(self, value: bool) -> AddOrderReqBuilder: + """ + Optional for type is 'limit' order, orders not displaying in order book. When hidden chose, not allowed choose postOnly. + """ + self.obj['hidden'] = value + return self + + def set_iceberg(self, value: bool) -> AddOrderReqBuilder: + """ + Optional for type is 'limit' order, Only visible portion of the order is displayed in the order book. When iceberg chose, not allowed choose postOnly. + """ + self.obj['iceberg'] = value + return self + + def set_visible_size(self, value: str) -> AddOrderReqBuilder: + """ + Optional for type is 'limit' order, The maximum visible size of an iceberg order. please place order in size (lots), The units of qty (base currency) and valueQty (value) are not supported. + """ + self.obj['visibleSize'] = value + return self + + def build(self) -> AddOrderReq: + return AddOrderReq(**self.obj) diff --git a/sdk/python/kucoin_universal_sdk/generate/copytrading/futures/model_add_order_resp.py b/sdk/python/kucoin_universal_sdk/generate/copytrading/futures/model_add_order_resp.py new file mode 100644 index 00000000..abc916dd --- /dev/null +++ b/sdk/python/kucoin_universal_sdk/generate/copytrading/futures/model_add_order_resp.py @@ -0,0 +1,77 @@ +# coding: utf-8 + +# Code generated by Kucoin Universal SDK Generator; DO NOT EDIT. + +from __future__ import annotations +import pprint +import json + +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from kucoin_universal_sdk.internal.interfaces.response import Response +from kucoin_universal_sdk.model.common import RestResponse + + +class AddOrderResp(BaseModel, Response): + """ + AddOrderResp + + Attributes: + order_id (str): The unique order id generated by the trading system,which can be used later for further actions such as canceling the order. + client_oid (str): The user self-defined order id. + """ + + common_response: Optional[RestResponse] = Field( + default=None, description="Common response") + order_id: Optional[str] = Field( + default=None, + description= + "The unique order id generated by the trading system,which can be used later for further actions such as canceling the order.", + alias="orderId") + client_oid: Optional[str] = Field( + default=None, + description="The user self-defined order id.", + alias="clientOid") + + __properties: ClassVar[List[str]] = ["orderId", "clientOid"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=False, + protected_namespaces=(), + ) + + def to_str(self) -> str: + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + return self.model_dump_json(by_alias=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[AddOrderResp]: + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + _dict = self.model_dump( + by_alias=True, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, + Any]]) -> Optional[AddOrderResp]: + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "orderId": obj.get("orderId"), + "clientOid": obj.get("clientOid") + }) + return _obj + + def set_common_response(self, response: RestResponse): + self.common_response = response diff --git a/sdk/python/kucoin_universal_sdk/generate/copytrading/futures/model_add_order_test_req.py b/sdk/python/kucoin_universal_sdk/generate/copytrading/futures/model_add_order_test_req.py new file mode 100644 index 00000000..c09dea7a --- /dev/null +++ b/sdk/python/kucoin_universal_sdk/generate/copytrading/futures/model_add_order_test_req.py @@ -0,0 +1,435 @@ +# coding: utf-8 + +# Code generated by Kucoin Universal SDK Generator; DO NOT EDIT. + +from __future__ import annotations +import pprint +import json + +from enum import Enum +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional + + +class AddOrderTestReq(BaseModel): + """ + AddOrderTestReq + + Attributes: + client_oid (str): Unique order id created by users to identify their orders, the maximum length cannot exceed 40, e.g. UUID, Only allows numbers, characters, underline(_), and separator(-) + side (SideEnum): specify if the order is to 'buy' or 'sell' + symbol (str): Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) + leverage (int): Used to calculate the margin to be frozen for the order. If you are to close the position, this parameter is not required. + type (TypeEnum): specify if the order is an 'limit' order or 'market' order + remark (str): remark for the order, length cannot exceed 100 utf8 characters + stop (StopEnum): Either 'down' or 'up'. If stop is used,parameter stopPrice and stopPriceType also need to be provieded. + stop_price_type (StopPriceTypeEnum): Either 'TP', 'IP' or 'MP', Need to be defined if stop is specified. + stop_price (str): Need to be defined if stop is specified. + reduce_only (bool): A mark to reduce the position size only. Set to false by default. Need to set the position size when reduceOnly is true. If set to true, only the orders reducing the position size will be executed. If the reduce-only order size exceeds the position size, the extra size will be canceled. + close_order (bool): A mark to close the position. Set to false by default. If closeOrder is set to true, the system will close the position and the position size will become 0. Side, Size and Leverage fields can be left empty and the system will determine the side and size automatically. + force_hold (bool): A mark to forcely hold the funds for an order, even though it's an order to reduce the position size. This helps the order stay on the order book and not get canceled when the position size changes. Set to false by default. The system will forcely freeze certain amount of funds for this order, including orders whose direction is opposite to the current positions. This feature is to ensure that the order won’t be canceled by the matching engine in such a circumstance that not enough funds are frozen for the order. + margin_mode (MarginModeEnum): Margin mode: ISOLATED, CROSS, default: ISOLATED + price (str): Required for type is 'limit' order, indicating the operating price + size (int): Order size (Lot), must be a positive integer. The quantity unit of coin-swap contracts is size(lot), and other units are not supported. + time_in_force (TimeInForceEnum): Optional for type is 'limit' order, [Time in force](https://www.kucoin.com/docs-new/doc-338146) is a special strategy used during trading, default is GTC + post_only (bool): Optional for type is 'limit' order, post only flag, invalid when timeInForce is IOC. When postOnly is true, not allowed choose hidden or iceberg. The post-only flag ensures that the trader always pays the maker fee and provides liquidity to the order book. If any part of the order is going to pay taker fee, the order will be fully rejected. + hidden (bool): Optional for type is 'limit' order, orders not displaying in order book. When hidden chose, not allowed choose postOnly. + iceberg (bool): Optional for type is 'limit' order, Only visible portion of the order is displayed in the order book. When iceberg chose, not allowed choose postOnly. + visible_size (str): Optional for type is 'limit' order, The maximum visible size of an iceberg order. please place order in size (lots), The units of qty (base currency) and valueQty (value) are not supported. + """ + + class SideEnum(Enum): + """ + Attributes: + BUY: + SELL: + """ + BUY = 'buy' + SELL = 'sell' + + class TypeEnum(Enum): + """ + Attributes: + LIMIT: + MARKET: + """ + LIMIT = 'limit' + MARKET = 'market' + + class StopEnum(Enum): + """ + Attributes: + DOWN: Triggers when the price reaches or goes below the stopPrice. + UP: Triggers when the price reaches or goes above the stopPrice + """ + DOWN = 'down' + UP = 'up' + + class StopPriceTypeEnum(Enum): + """ + Attributes: + TRADE_PRICE: TP for trade price, The last trade price is the last price at which an order was filled. This price can be found in the latest match message. + MARK_PRICE: MP for mark price, The mark price can be obtained through relevant OPEN API for index services + INDEX_PRICE: IP for index price, The index price can be obtained through relevant OPEN API for index services + """ + TRADE_PRICE = 'TP' + MARK_PRICE = 'MP' + INDEX_PRICE = 'IP' + + class MarginModeEnum(Enum): + """ + Attributes: + ISOLATED: + CROSS: + """ + ISOLATED = 'ISOLATED' + CROSS = 'CROSS' + + class TimeInForceEnum(Enum): + """ + Attributes: + GOOD_TILL_CANCELED: order remains open on the order book until canceled. This is the default type if the field is left empty. + IMMEDIATE_OR_CANCEL: being matched or not, the remaining size of the order will be instantly canceled instead of entering the order book. + """ + GOOD_TILL_CANCELED = 'GTC' + IMMEDIATE_OR_CANCEL = 'IOC' + + client_oid: Optional[str] = Field( + default=None, + description= + "Unique order id created by users to identify their orders, the maximum length cannot exceed 40, e.g. UUID, Only allows numbers, characters, underline(_), and separator(-)", + alias="clientOid") + side: Optional[SideEnum] = Field( + default=None, description="specify if the order is to 'buy' or 'sell'") + symbol: Optional[str] = Field( + default=None, + description= + "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) " + ) + leverage: Optional[int] = Field( + default=None, + description= + "Used to calculate the margin to be frozen for the order. If you are to close the position, this parameter is not required." + ) + type: Optional[TypeEnum] = Field( + default=TypeEnum.LIMIT, + description="specify if the order is an 'limit' order or 'market' order" + ) + remark: Optional[str] = Field( + default=None, + description= + "remark for the order, length cannot exceed 100 utf8 characters") + stop: Optional[StopEnum] = Field( + default=None, + description= + "Either 'down' or 'up'. If stop is used,parameter stopPrice and stopPriceType also need to be provieded." + ) + stop_price_type: Optional[StopPriceTypeEnum] = Field( + default=None, + description= + "Either 'TP', 'IP' or 'MP', Need to be defined if stop is specified.", + alias="stopPriceType") + stop_price: Optional[str] = Field( + default=None, + description="Need to be defined if stop is specified. ", + alias="stopPrice") + reduce_only: Optional[bool] = Field( + default=False, + description= + "A mark to reduce the position size only. Set to false by default. Need to set the position size when reduceOnly is true. If set to true, only the orders reducing the position size will be executed. If the reduce-only order size exceeds the position size, the extra size will be canceled.", + alias="reduceOnly") + close_order: Optional[bool] = Field( + default=False, + description= + "A mark to close the position. Set to false by default. If closeOrder is set to true, the system will close the position and the position size will become 0. Side, Size and Leverage fields can be left empty and the system will determine the side and size automatically.", + alias="closeOrder") + force_hold: Optional[bool] = Field( + default=False, + description= + "A mark to forcely hold the funds for an order, even though it's an order to reduce the position size. This helps the order stay on the order book and not get canceled when the position size changes. Set to false by default. The system will forcely freeze certain amount of funds for this order, including orders whose direction is opposite to the current positions. This feature is to ensure that the order won’t be canceled by the matching engine in such a circumstance that not enough funds are frozen for the order.", + alias="forceHold") + margin_mode: Optional[MarginModeEnum] = Field( + default=MarginModeEnum.ISOLATED, + description="Margin mode: ISOLATED, CROSS, default: ISOLATED", + alias="marginMode") + price: Optional[str] = Field( + default=None, + description= + "Required for type is 'limit' order, indicating the operating price") + size: Optional[int] = Field( + default=None, + description= + "Order size (Lot), must be a positive integer. The quantity unit of coin-swap contracts is size(lot), and other units are not supported." + ) + time_in_force: Optional[TimeInForceEnum] = Field( + default=TimeInForceEnum.GOOD_TILL_CANCELED, + description= + "Optional for type is 'limit' order, [Time in force](https://www.kucoin.com/docs-new/doc-338146) is a special strategy used during trading, default is GTC", + alias="timeInForce") + post_only: Optional[bool] = Field( + default=False, + description= + "Optional for type is 'limit' order, post only flag, invalid when timeInForce is IOC. When postOnly is true, not allowed choose hidden or iceberg. The post-only flag ensures that the trader always pays the maker fee and provides liquidity to the order book. If any part of the order is going to pay taker fee, the order will be fully rejected.", + alias="postOnly") + hidden: Optional[bool] = Field( + default=False, + description= + "Optional for type is 'limit' order, orders not displaying in order book. When hidden chose, not allowed choose postOnly." + ) + iceberg: Optional[bool] = Field( + default=False, + description= + "Optional for type is 'limit' order, Only visible portion of the order is displayed in the order book. When iceberg chose, not allowed choose postOnly." + ) + visible_size: Optional[str] = Field( + default=None, + description= + "Optional for type is 'limit' order, The maximum visible size of an iceberg order. please place order in size (lots), The units of qty (base currency) and valueQty (value) are not supported.", + alias="visibleSize") + + __properties: ClassVar[List[str]] = [ + "clientOid", "side", "symbol", "leverage", "type", "remark", "stop", + "stopPriceType", "stopPrice", "reduceOnly", "closeOrder", "forceHold", + "marginMode", "price", "size", "timeInForce", "postOnly", "hidden", + "iceberg", "visibleSize" + ] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=False, + protected_namespaces=(), + ) + + def to_str(self) -> str: + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + return self.model_dump_json(by_alias=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[AddOrderTestReq]: + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + _dict = self.model_dump( + by_alias=True, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, + Any]]) -> Optional[AddOrderTestReq]: + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "clientOid": + obj.get("clientOid"), + "side": + obj.get("side"), + "symbol": + obj.get("symbol"), + "leverage": + obj.get("leverage"), + "type": + obj.get("type") + if obj.get("type") is not None else AddOrderTestReq.TypeEnum.LIMIT, + "remark": + obj.get("remark"), + "stop": + obj.get("stop"), + "stopPriceType": + obj.get("stopPriceType"), + "stopPrice": + obj.get("stopPrice"), + "reduceOnly": + obj.get("reduceOnly") + if obj.get("reduceOnly") is not None else False, + "closeOrder": + obj.get("closeOrder") + if obj.get("closeOrder") is not None else False, + "forceHold": + obj.get("forceHold") + if obj.get("forceHold") is not None else False, + "marginMode": + obj.get("marginMode") if obj.get("marginMode") is not None else + AddOrderTestReq.MarginModeEnum.ISOLATED, + "price": + obj.get("price"), + "size": + obj.get("size"), + "timeInForce": + obj.get("timeInForce") if obj.get("timeInForce") is not None else + AddOrderTestReq.TimeInForceEnum.GOOD_TILL_CANCELED, + "postOnly": + obj.get("postOnly") if obj.get("postOnly") is not None else False, + "hidden": + obj.get("hidden") if obj.get("hidden") is not None else False, + "iceberg": + obj.get("iceberg") if obj.get("iceberg") is not None else False, + "visibleSize": + obj.get("visibleSize") + }) + return _obj + + +class AddOrderTestReqBuilder: + + def __init__(self): + self.obj = {} + + def set_client_oid(self, value: str) -> AddOrderTestReqBuilder: + """ + Unique order id created by users to identify their orders, the maximum length cannot exceed 40, e.g. UUID, Only allows numbers, characters, underline(_), and separator(-) + """ + self.obj['clientOid'] = value + return self + + def set_side(self, + value: AddOrderTestReq.SideEnum) -> AddOrderTestReqBuilder: + """ + specify if the order is to 'buy' or 'sell' + """ + self.obj['side'] = value + return self + + def set_symbol(self, value: str) -> AddOrderTestReqBuilder: + """ + Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) + """ + self.obj['symbol'] = value + return self + + def set_leverage(self, value: int) -> AddOrderTestReqBuilder: + """ + Used to calculate the margin to be frozen for the order. If you are to close the position, this parameter is not required. + """ + self.obj['leverage'] = value + return self + + def set_type(self, + value: AddOrderTestReq.TypeEnum) -> AddOrderTestReqBuilder: + """ + specify if the order is an 'limit' order or 'market' order + """ + self.obj['type'] = value + return self + + def set_remark(self, value: str) -> AddOrderTestReqBuilder: + """ + remark for the order, length cannot exceed 100 utf8 characters + """ + self.obj['remark'] = value + return self + + def set_stop(self, + value: AddOrderTestReq.StopEnum) -> AddOrderTestReqBuilder: + """ + Either 'down' or 'up'. If stop is used,parameter stopPrice and stopPriceType also need to be provieded. + """ + self.obj['stop'] = value + return self + + def set_stop_price_type( + self, value: AddOrderTestReq.StopPriceTypeEnum + ) -> AddOrderTestReqBuilder: + """ + Either 'TP', 'IP' or 'MP', Need to be defined if stop is specified. + """ + self.obj['stopPriceType'] = value + return self + + def set_stop_price(self, value: str) -> AddOrderTestReqBuilder: + """ + Need to be defined if stop is specified. + """ + self.obj['stopPrice'] = value + return self + + def set_reduce_only(self, value: bool) -> AddOrderTestReqBuilder: + """ + A mark to reduce the position size only. Set to false by default. Need to set the position size when reduceOnly is true. If set to true, only the orders reducing the position size will be executed. If the reduce-only order size exceeds the position size, the extra size will be canceled. + """ + self.obj['reduceOnly'] = value + return self + + def set_close_order(self, value: bool) -> AddOrderTestReqBuilder: + """ + A mark to close the position. Set to false by default. If closeOrder is set to true, the system will close the position and the position size will become 0. Side, Size and Leverage fields can be left empty and the system will determine the side and size automatically. + """ + self.obj['closeOrder'] = value + return self + + def set_force_hold(self, value: bool) -> AddOrderTestReqBuilder: + """ + A mark to forcely hold the funds for an order, even though it's an order to reduce the position size. This helps the order stay on the order book and not get canceled when the position size changes. Set to false by default. The system will forcely freeze certain amount of funds for this order, including orders whose direction is opposite to the current positions. This feature is to ensure that the order won’t be canceled by the matching engine in such a circumstance that not enough funds are frozen for the order. + """ + self.obj['forceHold'] = value + return self + + def set_margin_mode( + self, + value: AddOrderTestReq.MarginModeEnum) -> AddOrderTestReqBuilder: + """ + Margin mode: ISOLATED, CROSS, default: ISOLATED + """ + self.obj['marginMode'] = value + return self + + def set_price(self, value: str) -> AddOrderTestReqBuilder: + """ + Required for type is 'limit' order, indicating the operating price + """ + self.obj['price'] = value + return self + + def set_size(self, value: int) -> AddOrderTestReqBuilder: + """ + Order size (Lot), must be a positive integer. The quantity unit of coin-swap contracts is size(lot), and other units are not supported. + """ + self.obj['size'] = value + return self + + def set_time_in_force( + self, + value: AddOrderTestReq.TimeInForceEnum) -> AddOrderTestReqBuilder: + """ + Optional for type is 'limit' order, [Time in force](https://www.kucoin.com/docs-new/doc-338146) is a special strategy used during trading, default is GTC + """ + self.obj['timeInForce'] = value + return self + + def set_post_only(self, value: bool) -> AddOrderTestReqBuilder: + """ + Optional for type is 'limit' order, post only flag, invalid when timeInForce is IOC. When postOnly is true, not allowed choose hidden or iceberg. The post-only flag ensures that the trader always pays the maker fee and provides liquidity to the order book. If any part of the order is going to pay taker fee, the order will be fully rejected. + """ + self.obj['postOnly'] = value + return self + + def set_hidden(self, value: bool) -> AddOrderTestReqBuilder: + """ + Optional for type is 'limit' order, orders not displaying in order book. When hidden chose, not allowed choose postOnly. + """ + self.obj['hidden'] = value + return self + + def set_iceberg(self, value: bool) -> AddOrderTestReqBuilder: + """ + Optional for type is 'limit' order, Only visible portion of the order is displayed in the order book. When iceberg chose, not allowed choose postOnly. + """ + self.obj['iceberg'] = value + return self + + def set_visible_size(self, value: str) -> AddOrderTestReqBuilder: + """ + Optional for type is 'limit' order, The maximum visible size of an iceberg order. please place order in size (lots), The units of qty (base currency) and valueQty (value) are not supported. + """ + self.obj['visibleSize'] = value + return self + + def build(self) -> AddOrderTestReq: + return AddOrderTestReq(**self.obj) diff --git a/sdk/python/kucoin_universal_sdk/generate/copytrading/futures/model_add_order_test_resp.py b/sdk/python/kucoin_universal_sdk/generate/copytrading/futures/model_add_order_test_resp.py new file mode 100644 index 00000000..b58acedd --- /dev/null +++ b/sdk/python/kucoin_universal_sdk/generate/copytrading/futures/model_add_order_test_resp.py @@ -0,0 +1,77 @@ +# coding: utf-8 + +# Code generated by Kucoin Universal SDK Generator; DO NOT EDIT. + +from __future__ import annotations +import pprint +import json + +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from kucoin_universal_sdk.internal.interfaces.response import Response +from kucoin_universal_sdk.model.common import RestResponse + + +class AddOrderTestResp(BaseModel, Response): + """ + AddOrderTestResp + + Attributes: + order_id (str): The unique order id generated by the trading system,which can be used later for further actions such as canceling the order. + client_oid (str): The user self-defined order id. + """ + + common_response: Optional[RestResponse] = Field( + default=None, description="Common response") + order_id: Optional[str] = Field( + default=None, + description= + "The unique order id generated by the trading system,which can be used later for further actions such as canceling the order.", + alias="orderId") + client_oid: Optional[str] = Field( + default=None, + description="The user self-defined order id.", + alias="clientOid") + + __properties: ClassVar[List[str]] = ["orderId", "clientOid"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=False, + protected_namespaces=(), + ) + + def to_str(self) -> str: + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + return self.model_dump_json(by_alias=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[AddOrderTestResp]: + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + _dict = self.model_dump( + by_alias=True, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, + Any]]) -> Optional[AddOrderTestResp]: + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "orderId": obj.get("orderId"), + "clientOid": obj.get("clientOid") + }) + return _obj + + def set_common_response(self, response: RestResponse): + self.common_response = response diff --git a/sdk/python/kucoin_universal_sdk/generate/copytrading/futures/model_add_tpsl_order_req.py b/sdk/python/kucoin_universal_sdk/generate/copytrading/futures/model_add_tpsl_order_req.py new file mode 100644 index 00000000..44d4fd97 --- /dev/null +++ b/sdk/python/kucoin_universal_sdk/generate/copytrading/futures/model_add_tpsl_order_req.py @@ -0,0 +1,424 @@ +# coding: utf-8 + +# Code generated by Kucoin Universal SDK Generator; DO NOT EDIT. + +from __future__ import annotations +import pprint +import json + +from enum import Enum +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional + + +class AddTpslOrderReq(BaseModel): + """ + AddTpslOrderReq + + Attributes: + client_oid (str): Unique order id created by users to identify their orders, the maximum length cannot exceed 40, e.g. UUID, Only allows numbers, characters, underline(_), and separator(-) + side (SideEnum): specify if the order is to 'buy' or 'sell' + symbol (str): Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) + leverage (int): Used to calculate the margin to be frozen for the order. If you are to close the position, this parameter is not required. + type (TypeEnum): specify if the order is an 'limit' order or 'market' order + remark (str): remark for the order, length cannot exceed 100 utf8 characters + stop_price_type (StopPriceTypeEnum): Either 'TP', 'IP' or 'MP' + reduce_only (bool): A mark to reduce the position size only. Set to false by default. Need to set the position size when reduceOnly is true. If set to true, only the orders reducing the position size will be executed. If the reduce-only order size exceeds the position size, the extra size will be canceled. + close_order (bool): A mark to close the position. Set to false by default. If closeOrder is set to true, the system will close the position and the position size will become 0. Side, Size and Leverage fields can be left empty and the system will determine the side and size automatically. + force_hold (bool): A mark to forcely hold the funds for an order, even though it's an order to reduce the position size. This helps the order stay on the order book and not get canceled when the position size changes. Set to false by default. The system will forcely freeze certain amount of funds for this order, including orders whose direction is opposite to the current positions. This feature is to ensure that the order won’t be canceled by the matching engine in such a circumstance that not enough funds are frozen for the order. + margin_mode (MarginModeEnum): Margin mode: ISOLATED, CROSS, default: ISOLATED + price (str): Required for type is 'limit' order, indicating the operating price + size (int): Order size (Lot), must be a positive integer. The quantity unit of coin-swap contracts is size(lot), and other units are not supported. + time_in_force (TimeInForceEnum): Optional for type is 'limit' order, [Time in force](https://www.kucoin.com/docs-new/doc-338146) is a special strategy used during trading, default is GTC + post_only (bool): Optional for type is 'limit' order, post only flag, invalid when timeInForce is IOC. When postOnly is true, not allowed choose hidden or iceberg. The post-only flag ensures that the trader always pays the maker fee and provides liquidity to the order book. If any part of the order is going to pay taker fee, the order will be fully rejected. + hidden (bool): Optional for type is 'limit' order, orders not displaying in order book. When hidden chose, not allowed choose postOnly. + iceberg (bool): Optional for type is 'limit' order, Only visible portion of the order is displayed in the order book. When iceberg chose, not allowed choose postOnly. + visible_size (str): Optional for type is 'limit' order, The maximum visible size of an iceberg order. please place order in size (lots), The units of qty (base currency) and valueQty (value) are not supported. + trigger_stop_up_price (str): Take profit price + trigger_stop_down_price (str): Stop loss price + """ + + class SideEnum(Enum): + """ + Attributes: + BUY: + SELL: + """ + BUY = 'buy' + SELL = 'sell' + + class TypeEnum(Enum): + """ + Attributes: + LIMIT: limit order + MARKET: market order + """ + LIMIT = 'limit' + MARKET = 'market' + + class StopPriceTypeEnum(Enum): + """ + Attributes: + TRADE_PRICE: TP for trade price, The last trade price is the last price at which an order was filled. This price can be found in the latest match message. + MARK_PRICE: MP for mark price, The mark price can be obtained through relevant OPEN API for index services + INDEX_PRICE: IP for index price, The index price can be obtained through relevant OPEN API for index services + """ + TRADE_PRICE = 'TP' + MARK_PRICE = 'MP' + INDEX_PRICE = 'IP' + + class MarginModeEnum(Enum): + """ + Attributes: + ISOLATED: + CROSS: + """ + ISOLATED = 'ISOLATED' + CROSS = 'CROSS' + + class TimeInForceEnum(Enum): + """ + Attributes: + GOOD_TILL_CANCELED: order remains open on the order book until canceled. This is the default type if the field is left empty. + IMMEDIATE_OR_CANCEL: being matched or not, the remaining size of the order will be instantly canceled instead of entering the order book. + """ + GOOD_TILL_CANCELED = 'GTC' + IMMEDIATE_OR_CANCEL = 'IOC' + + client_oid: Optional[str] = Field( + default=None, + description= + "Unique order id created by users to identify their orders, the maximum length cannot exceed 40, e.g. UUID, Only allows numbers, characters, underline(_), and separator(-)", + alias="clientOid") + side: Optional[SideEnum] = Field( + default=None, description="specify if the order is to 'buy' or 'sell'") + symbol: Optional[str] = Field( + default=None, + description= + "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) " + ) + leverage: Optional[int] = Field( + default=None, + description= + "Used to calculate the margin to be frozen for the order. If you are to close the position, this parameter is not required." + ) + type: Optional[TypeEnum] = Field( + default=TypeEnum.LIMIT, + description="specify if the order is an 'limit' order or 'market' order" + ) + remark: Optional[str] = Field( + default=None, + description= + "remark for the order, length cannot exceed 100 utf8 characters") + stop_price_type: Optional[StopPriceTypeEnum] = Field( + default=None, + description="Either 'TP', 'IP' or 'MP'", + alias="stopPriceType") + reduce_only: Optional[bool] = Field( + default=False, + description= + "A mark to reduce the position size only. Set to false by default. Need to set the position size when reduceOnly is true. If set to true, only the orders reducing the position size will be executed. If the reduce-only order size exceeds the position size, the extra size will be canceled.", + alias="reduceOnly") + close_order: Optional[bool] = Field( + default=False, + description= + "A mark to close the position. Set to false by default. If closeOrder is set to true, the system will close the position and the position size will become 0. Side, Size and Leverage fields can be left empty and the system will determine the side and size automatically.", + alias="closeOrder") + force_hold: Optional[bool] = Field( + default=False, + description= + "A mark to forcely hold the funds for an order, even though it's an order to reduce the position size. This helps the order stay on the order book and not get canceled when the position size changes. Set to false by default. The system will forcely freeze certain amount of funds for this order, including orders whose direction is opposite to the current positions. This feature is to ensure that the order won’t be canceled by the matching engine in such a circumstance that not enough funds are frozen for the order.", + alias="forceHold") + margin_mode: Optional[MarginModeEnum] = Field( + default=MarginModeEnum.ISOLATED, + description="Margin mode: ISOLATED, CROSS, default: ISOLATED", + alias="marginMode") + price: Optional[str] = Field( + default=None, + description= + "Required for type is 'limit' order, indicating the operating price") + size: Optional[int] = Field( + default=None, + description= + "Order size (Lot), must be a positive integer. The quantity unit of coin-swap contracts is size(lot), and other units are not supported." + ) + time_in_force: Optional[TimeInForceEnum] = Field( + default=TimeInForceEnum.GOOD_TILL_CANCELED, + description= + "Optional for type is 'limit' order, [Time in force](https://www.kucoin.com/docs-new/doc-338146) is a special strategy used during trading, default is GTC", + alias="timeInForce") + post_only: Optional[bool] = Field( + default=False, + description= + "Optional for type is 'limit' order, post only flag, invalid when timeInForce is IOC. When postOnly is true, not allowed choose hidden or iceberg. The post-only flag ensures that the trader always pays the maker fee and provides liquidity to the order book. If any part of the order is going to pay taker fee, the order will be fully rejected.", + alias="postOnly") + hidden: Optional[bool] = Field( + default=False, + description= + "Optional for type is 'limit' order, orders not displaying in order book. When hidden chose, not allowed choose postOnly." + ) + iceberg: Optional[bool] = Field( + default=False, + description= + "Optional for type is 'limit' order, Only visible portion of the order is displayed in the order book. When iceberg chose, not allowed choose postOnly." + ) + visible_size: Optional[str] = Field( + default=None, + description= + "Optional for type is 'limit' order, The maximum visible size of an iceberg order. please place order in size (lots), The units of qty (base currency) and valueQty (value) are not supported.", + alias="visibleSize") + trigger_stop_up_price: Optional[str] = Field( + default=None, + description="Take profit price", + alias="triggerStopUpPrice") + trigger_stop_down_price: Optional[str] = Field( + default=None, + description="Stop loss price", + alias="triggerStopDownPrice") + + __properties: ClassVar[List[str]] = [ + "clientOid", "side", "symbol", "leverage", "type", "remark", + "stopPriceType", "reduceOnly", "closeOrder", "forceHold", "marginMode", + "price", "size", "timeInForce", "postOnly", "hidden", "iceberg", + "visibleSize", "triggerStopUpPrice", "triggerStopDownPrice" + ] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=False, + protected_namespaces=(), + ) + + def to_str(self) -> str: + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + return self.model_dump_json(by_alias=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[AddTpslOrderReq]: + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + _dict = self.model_dump( + by_alias=True, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, + Any]]) -> Optional[AddTpslOrderReq]: + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "clientOid": + obj.get("clientOid"), + "side": + obj.get("side"), + "symbol": + obj.get("symbol"), + "leverage": + obj.get("leverage"), + "type": + obj.get("type") + if obj.get("type") is not None else AddTpslOrderReq.TypeEnum.LIMIT, + "remark": + obj.get("remark"), + "stopPriceType": + obj.get("stopPriceType"), + "reduceOnly": + obj.get("reduceOnly") + if obj.get("reduceOnly") is not None else False, + "closeOrder": + obj.get("closeOrder") + if obj.get("closeOrder") is not None else False, + "forceHold": + obj.get("forceHold") + if obj.get("forceHold") is not None else False, + "marginMode": + obj.get("marginMode") if obj.get("marginMode") is not None else + AddTpslOrderReq.MarginModeEnum.ISOLATED, + "price": + obj.get("price"), + "size": + obj.get("size"), + "timeInForce": + obj.get("timeInForce") if obj.get("timeInForce") is not None else + AddTpslOrderReq.TimeInForceEnum.GOOD_TILL_CANCELED, + "postOnly": + obj.get("postOnly") if obj.get("postOnly") is not None else False, + "hidden": + obj.get("hidden") if obj.get("hidden") is not None else False, + "iceberg": + obj.get("iceberg") if obj.get("iceberg") is not None else False, + "visibleSize": + obj.get("visibleSize"), + "triggerStopUpPrice": + obj.get("triggerStopUpPrice"), + "triggerStopDownPrice": + obj.get("triggerStopDownPrice") + }) + return _obj + + +class AddTpslOrderReqBuilder: + + def __init__(self): + self.obj = {} + + def set_client_oid(self, value: str) -> AddTpslOrderReqBuilder: + """ + Unique order id created by users to identify their orders, the maximum length cannot exceed 40, e.g. UUID, Only allows numbers, characters, underline(_), and separator(-) + """ + self.obj['clientOid'] = value + return self + + def set_side(self, + value: AddTpslOrderReq.SideEnum) -> AddTpslOrderReqBuilder: + """ + specify if the order is to 'buy' or 'sell' + """ + self.obj['side'] = value + return self + + def set_symbol(self, value: str) -> AddTpslOrderReqBuilder: + """ + Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) + """ + self.obj['symbol'] = value + return self + + def set_leverage(self, value: int) -> AddTpslOrderReqBuilder: + """ + Used to calculate the margin to be frozen for the order. If you are to close the position, this parameter is not required. + """ + self.obj['leverage'] = value + return self + + def set_type(self, + value: AddTpslOrderReq.TypeEnum) -> AddTpslOrderReqBuilder: + """ + specify if the order is an 'limit' order or 'market' order + """ + self.obj['type'] = value + return self + + def set_remark(self, value: str) -> AddTpslOrderReqBuilder: + """ + remark for the order, length cannot exceed 100 utf8 characters + """ + self.obj['remark'] = value + return self + + def set_stop_price_type( + self, value: AddTpslOrderReq.StopPriceTypeEnum + ) -> AddTpslOrderReqBuilder: + """ + Either 'TP', 'IP' or 'MP' + """ + self.obj['stopPriceType'] = value + return self + + def set_reduce_only(self, value: bool) -> AddTpslOrderReqBuilder: + """ + A mark to reduce the position size only. Set to false by default. Need to set the position size when reduceOnly is true. If set to true, only the orders reducing the position size will be executed. If the reduce-only order size exceeds the position size, the extra size will be canceled. + """ + self.obj['reduceOnly'] = value + return self + + def set_close_order(self, value: bool) -> AddTpslOrderReqBuilder: + """ + A mark to close the position. Set to false by default. If closeOrder is set to true, the system will close the position and the position size will become 0. Side, Size and Leverage fields can be left empty and the system will determine the side and size automatically. + """ + self.obj['closeOrder'] = value + return self + + def set_force_hold(self, value: bool) -> AddTpslOrderReqBuilder: + """ + A mark to forcely hold the funds for an order, even though it's an order to reduce the position size. This helps the order stay on the order book and not get canceled when the position size changes. Set to false by default. The system will forcely freeze certain amount of funds for this order, including orders whose direction is opposite to the current positions. This feature is to ensure that the order won’t be canceled by the matching engine in such a circumstance that not enough funds are frozen for the order. + """ + self.obj['forceHold'] = value + return self + + def set_margin_mode( + self, + value: AddTpslOrderReq.MarginModeEnum) -> AddTpslOrderReqBuilder: + """ + Margin mode: ISOLATED, CROSS, default: ISOLATED + """ + self.obj['marginMode'] = value + return self + + def set_price(self, value: str) -> AddTpslOrderReqBuilder: + """ + Required for type is 'limit' order, indicating the operating price + """ + self.obj['price'] = value + return self + + def set_size(self, value: int) -> AddTpslOrderReqBuilder: + """ + Order size (Lot), must be a positive integer. The quantity unit of coin-swap contracts is size(lot), and other units are not supported. + """ + self.obj['size'] = value + return self + + def set_time_in_force( + self, + value: AddTpslOrderReq.TimeInForceEnum) -> AddTpslOrderReqBuilder: + """ + Optional for type is 'limit' order, [Time in force](https://www.kucoin.com/docs-new/doc-338146) is a special strategy used during trading, default is GTC + """ + self.obj['timeInForce'] = value + return self + + def set_post_only(self, value: bool) -> AddTpslOrderReqBuilder: + """ + Optional for type is 'limit' order, post only flag, invalid when timeInForce is IOC. When postOnly is true, not allowed choose hidden or iceberg. The post-only flag ensures that the trader always pays the maker fee and provides liquidity to the order book. If any part of the order is going to pay taker fee, the order will be fully rejected. + """ + self.obj['postOnly'] = value + return self + + def set_hidden(self, value: bool) -> AddTpslOrderReqBuilder: + """ + Optional for type is 'limit' order, orders not displaying in order book. When hidden chose, not allowed choose postOnly. + """ + self.obj['hidden'] = value + return self + + def set_iceberg(self, value: bool) -> AddTpslOrderReqBuilder: + """ + Optional for type is 'limit' order, Only visible portion of the order is displayed in the order book. When iceberg chose, not allowed choose postOnly. + """ + self.obj['iceberg'] = value + return self + + def set_visible_size(self, value: str) -> AddTpslOrderReqBuilder: + """ + Optional for type is 'limit' order, The maximum visible size of an iceberg order. please place order in size (lots), The units of qty (base currency) and valueQty (value) are not supported. + """ + self.obj['visibleSize'] = value + return self + + def set_trigger_stop_up_price(self, value: str) -> AddTpslOrderReqBuilder: + """ + Take profit price + """ + self.obj['triggerStopUpPrice'] = value + return self + + def set_trigger_stop_down_price(self, + value: str) -> AddTpslOrderReqBuilder: + """ + Stop loss price + """ + self.obj['triggerStopDownPrice'] = value + return self + + def build(self) -> AddTpslOrderReq: + return AddTpslOrderReq(**self.obj) diff --git a/sdk/python/kucoin_universal_sdk/generate/copytrading/futures/model_add_tpsl_order_resp.py b/sdk/python/kucoin_universal_sdk/generate/copytrading/futures/model_add_tpsl_order_resp.py new file mode 100644 index 00000000..9f07a021 --- /dev/null +++ b/sdk/python/kucoin_universal_sdk/generate/copytrading/futures/model_add_tpsl_order_resp.py @@ -0,0 +1,77 @@ +# coding: utf-8 + +# Code generated by Kucoin Universal SDK Generator; DO NOT EDIT. + +from __future__ import annotations +import pprint +import json + +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from kucoin_universal_sdk.internal.interfaces.response import Response +from kucoin_universal_sdk.model.common import RestResponse + + +class AddTpslOrderResp(BaseModel, Response): + """ + AddTpslOrderResp + + Attributes: + order_id (str): The unique order id generated by the trading system,which can be used later for further actions such as canceling the order. + client_oid (str): The user self-defined order id. + """ + + common_response: Optional[RestResponse] = Field( + default=None, description="Common response") + order_id: Optional[str] = Field( + default=None, + description= + "The unique order id generated by the trading system,which can be used later for further actions such as canceling the order.", + alias="orderId") + client_oid: Optional[str] = Field( + default=None, + description="The user self-defined order id.", + alias="clientOid") + + __properties: ClassVar[List[str]] = ["orderId", "clientOid"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=False, + protected_namespaces=(), + ) + + def to_str(self) -> str: + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + return self.model_dump_json(by_alias=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[AddTpslOrderResp]: + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + _dict = self.model_dump( + by_alias=True, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, + Any]]) -> Optional[AddTpslOrderResp]: + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "orderId": obj.get("orderId"), + "clientOid": obj.get("clientOid") + }) + return _obj + + def set_common_response(self, response: RestResponse): + self.common_response = response diff --git a/sdk/python/kucoin_universal_sdk/generate/copytrading/futures/model_cancel_order_by_client_oid_req.py b/sdk/python/kucoin_universal_sdk/generate/copytrading/futures/model_cancel_order_by_client_oid_req.py new file mode 100644 index 00000000..311189e4 --- /dev/null +++ b/sdk/python/kucoin_universal_sdk/generate/copytrading/futures/model_cancel_order_by_client_oid_req.py @@ -0,0 +1,95 @@ +# coding: utf-8 + +# Code generated by Kucoin Universal SDK Generator; DO NOT EDIT. + +from __future__ import annotations +import pprint +import json + +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional + + +class CancelOrderByClientOidReq(BaseModel): + """ + CancelOrderByClientOidReq + + Attributes: + symbol (str): Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) + client_oid (str): The user self-defined order id. + """ + + symbol: Optional[str] = Field( + default=None, + description= + "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) " + ) + client_oid: Optional[str] = Field( + default=None, + description="The user self-defined order id.", + alias="clientOid") + + __properties: ClassVar[List[str]] = ["symbol", "clientOid"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=False, + protected_namespaces=(), + ) + + def to_str(self) -> str: + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + return self.model_dump_json(by_alias=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[CancelOrderByClientOidReq]: + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + _dict = self.model_dump( + by_alias=True, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict( + cls, + obj: Optional[Dict[str, + Any]]) -> Optional[CancelOrderByClientOidReq]: + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "symbol": obj.get("symbol"), + "clientOid": obj.get("clientOid") + }) + return _obj + + +class CancelOrderByClientOidReqBuilder: + + def __init__(self): + self.obj = {} + + def set_symbol(self, value: str) -> CancelOrderByClientOidReqBuilder: + """ + Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) + """ + self.obj['symbol'] = value + return self + + def set_client_oid(self, value: str) -> CancelOrderByClientOidReqBuilder: + """ + The user self-defined order id. + """ + self.obj['clientOid'] = value + return self + + def build(self) -> CancelOrderByClientOidReq: + return CancelOrderByClientOidReq(**self.obj) diff --git a/sdk/python/kucoin_universal_sdk/generate/copytrading/futures/model_cancel_order_by_client_oid_resp.py b/sdk/python/kucoin_universal_sdk/generate/copytrading/futures/model_cancel_order_by_client_oid_resp.py new file mode 100644 index 00000000..8ff82b10 --- /dev/null +++ b/sdk/python/kucoin_universal_sdk/generate/copytrading/futures/model_cancel_order_by_client_oid_resp.py @@ -0,0 +1,67 @@ +# coding: utf-8 + +# Code generated by Kucoin Universal SDK Generator; DO NOT EDIT. + +from __future__ import annotations +import pprint +import json + +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from kucoin_universal_sdk.internal.interfaces.response import Response +from kucoin_universal_sdk.model.common import RestResponse + + +class CancelOrderByClientOidResp(BaseModel, Response): + """ + CancelOrderByClientOidResp + + Attributes: + client_oid (str): + """ + + common_response: Optional[RestResponse] = Field( + default=None, description="Common response") + client_oid: Optional[str] = Field(default=None, alias="clientOid") + + __properties: ClassVar[List[str]] = ["clientOid"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=False, + protected_namespaces=(), + ) + + def to_str(self) -> str: + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + return self.model_dump_json(by_alias=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[CancelOrderByClientOidResp]: + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + _dict = self.model_dump( + by_alias=True, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict( + cls, + obj: Optional[Dict[str, + Any]]) -> Optional[CancelOrderByClientOidResp]: + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({"clientOid": obj.get("clientOid")}) + return _obj + + def set_common_response(self, response: RestResponse): + self.common_response = response diff --git a/sdk/python/kucoin_universal_sdk/generate/copytrading/futures/model_cancel_order_by_id_req.py b/sdk/python/kucoin_universal_sdk/generate/copytrading/futures/model_cancel_order_by_id_req.py new file mode 100644 index 00000000..911202de --- /dev/null +++ b/sdk/python/kucoin_universal_sdk/generate/copytrading/futures/model_cancel_order_by_id_req.py @@ -0,0 +1,77 @@ +# coding: utf-8 + +# Code generated by Kucoin Universal SDK Generator; DO NOT EDIT. + +from __future__ import annotations +import pprint +import json + +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional + + +class CancelOrderByIdReq(BaseModel): + """ + CancelOrderByIdReq + + Attributes: + order_id (str): Order id + """ + + order_id: Optional[str] = Field(default=None, + description="Order id", + alias="orderId") + + __properties: ClassVar[List[str]] = ["orderId"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=False, + protected_namespaces=(), + ) + + def to_str(self) -> str: + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + return self.model_dump_json(by_alias=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[CancelOrderByIdReq]: + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + _dict = self.model_dump( + by_alias=True, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict( + cls, obj: Optional[Dict[str, + Any]]) -> Optional[CancelOrderByIdReq]: + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({"orderId": obj.get("orderId")}) + return _obj + + +class CancelOrderByIdReqBuilder: + + def __init__(self): + self.obj = {} + + def set_order_id(self, value: str) -> CancelOrderByIdReqBuilder: + """ + Order id + """ + self.obj['orderId'] = value + return self + + def build(self) -> CancelOrderByIdReq: + return CancelOrderByIdReq(**self.obj) diff --git a/sdk/python/kucoin_universal_sdk/generate/copytrading/futures/model_cancel_order_by_id_resp.py b/sdk/python/kucoin_universal_sdk/generate/copytrading/futures/model_cancel_order_by_id_resp.py new file mode 100644 index 00000000..77592e1a --- /dev/null +++ b/sdk/python/kucoin_universal_sdk/generate/copytrading/futures/model_cancel_order_by_id_resp.py @@ -0,0 +1,70 @@ +# coding: utf-8 + +# Code generated by Kucoin Universal SDK Generator; DO NOT EDIT. + +from __future__ import annotations +import pprint +import json + +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from kucoin_universal_sdk.internal.interfaces.response import Response +from kucoin_universal_sdk.model.common import RestResponse + + +class CancelOrderByIdResp(BaseModel, Response): + """ + CancelOrderByIdResp + + Attributes: + cancelled_order_ids (list[str]): The orderId that is to be canceled + """ + + common_response: Optional[RestResponse] = Field( + default=None, description="Common response") + cancelled_order_ids: Optional[List[str]] = Field( + default=None, + description="The orderId that is to be canceled", + alias="cancelledOrderIds") + + __properties: ClassVar[List[str]] = ["cancelledOrderIds"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=False, + protected_namespaces=(), + ) + + def to_str(self) -> str: + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + return self.model_dump_json(by_alias=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[CancelOrderByIdResp]: + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + _dict = self.model_dump( + by_alias=True, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict( + cls, obj: Optional[Dict[str, + Any]]) -> Optional[CancelOrderByIdResp]: + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + {"cancelledOrderIds": obj.get("cancelledOrderIds")}) + return _obj + + def set_common_response(self, response: RestResponse): + self.common_response = response diff --git a/sdk/python/kucoin_universal_sdk/generate/copytrading/futures/model_get_max_open_size_req.py b/sdk/python/kucoin_universal_sdk/generate/copytrading/futures/model_get_max_open_size_req.py new file mode 100644 index 00000000..54838ed4 --- /dev/null +++ b/sdk/python/kucoin_universal_sdk/generate/copytrading/futures/model_get_max_open_size_req.py @@ -0,0 +1,100 @@ +# coding: utf-8 + +# Code generated by Kucoin Universal SDK Generator; DO NOT EDIT. + +from __future__ import annotations +import pprint +import json + +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional + + +class GetMaxOpenSizeReq(BaseModel): + """ + GetMaxOpenSizeReq + + Attributes: + symbol (str): Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) + price (str): Order price + leverage (int): Leverage + """ + + symbol: Optional[str] = Field( + default=None, + description= + "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) " + ) + price: Optional[str] = Field(default=None, description="Order price ") + leverage: Optional[int] = Field(default=None, description="Leverage ") + + __properties: ClassVar[List[str]] = ["symbol", "price", "leverage"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=False, + protected_namespaces=(), + ) + + def to_str(self) -> str: + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + return self.model_dump_json(by_alias=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[GetMaxOpenSizeReq]: + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + _dict = self.model_dump( + by_alias=True, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict( + cls, obj: Optional[Dict[str, Any]]) -> Optional[GetMaxOpenSizeReq]: + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "symbol": obj.get("symbol"), + "price": obj.get("price"), + "leverage": obj.get("leverage") + }) + return _obj + + +class GetMaxOpenSizeReqBuilder: + + def __init__(self): + self.obj = {} + + def set_symbol(self, value: str) -> GetMaxOpenSizeReqBuilder: + """ + Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) + """ + self.obj['symbol'] = value + return self + + def set_price(self, value: str) -> GetMaxOpenSizeReqBuilder: + """ + Order price + """ + self.obj['price'] = value + return self + + def set_leverage(self, value: int) -> GetMaxOpenSizeReqBuilder: + """ + Leverage + """ + self.obj['leverage'] = value + return self + + def build(self) -> GetMaxOpenSizeReq: + return GetMaxOpenSizeReq(**self.obj) diff --git a/sdk/python/kucoin_universal_sdk/generate/copytrading/futures/model_get_max_open_size_resp.py b/sdk/python/kucoin_universal_sdk/generate/copytrading/futures/model_get_max_open_size_resp.py new file mode 100644 index 00000000..41e34a3a --- /dev/null +++ b/sdk/python/kucoin_universal_sdk/generate/copytrading/futures/model_get_max_open_size_resp.py @@ -0,0 +1,84 @@ +# coding: utf-8 + +# Code generated by Kucoin Universal SDK Generator; DO NOT EDIT. + +from __future__ import annotations +import pprint +import json + +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from kucoin_universal_sdk.internal.interfaces.response import Response +from kucoin_universal_sdk.model.common import RestResponse + + +class GetMaxOpenSizeResp(BaseModel, Response): + """ + GetMaxOpenSizeResp + + Attributes: + symbol (str): Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) + max_buy_open_size (int): Maximum buy size + max_sell_open_size (int): Maximum buy size + """ + + common_response: Optional[RestResponse] = Field( + default=None, description="Common response") + symbol: Optional[str] = Field( + default=None, + description= + "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) " + ) + max_buy_open_size: Optional[int] = Field(default=None, + description="Maximum buy size ", + alias="maxBuyOpenSize") + max_sell_open_size: Optional[int] = Field(default=None, + description="Maximum buy size ", + alias="maxSellOpenSize") + + __properties: ClassVar[List[str]] = [ + "symbol", "maxBuyOpenSize", "maxSellOpenSize" + ] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=False, + protected_namespaces=(), + ) + + def to_str(self) -> str: + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + return self.model_dump_json(by_alias=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[GetMaxOpenSizeResp]: + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + _dict = self.model_dump( + by_alias=True, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict( + cls, obj: Optional[Dict[str, + Any]]) -> Optional[GetMaxOpenSizeResp]: + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "symbol": obj.get("symbol"), + "maxBuyOpenSize": obj.get("maxBuyOpenSize"), + "maxSellOpenSize": obj.get("maxSellOpenSize") + }) + return _obj + + def set_common_response(self, response: RestResponse): + self.common_response = response diff --git a/sdk/python/kucoin_universal_sdk/generate/copytrading/futures/model_get_max_withdraw_margin_req.py b/sdk/python/kucoin_universal_sdk/generate/copytrading/futures/model_get_max_withdraw_margin_req.py new file mode 100644 index 00000000..9621fcd7 --- /dev/null +++ b/sdk/python/kucoin_universal_sdk/generate/copytrading/futures/model_get_max_withdraw_margin_req.py @@ -0,0 +1,80 @@ +# coding: utf-8 + +# Code generated by Kucoin Universal SDK Generator; DO NOT EDIT. + +from __future__ import annotations +import pprint +import json + +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional + + +class GetMaxWithdrawMarginReq(BaseModel): + """ + GetMaxWithdrawMarginReq + + Attributes: + symbol (str): Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) + """ + + symbol: Optional[str] = Field( + default=None, + description= + "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) " + ) + + __properties: ClassVar[List[str]] = ["symbol"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=False, + protected_namespaces=(), + ) + + def to_str(self) -> str: + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + return self.model_dump_json(by_alias=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[GetMaxWithdrawMarginReq]: + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + _dict = self.model_dump( + by_alias=True, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict( + cls, + obj: Optional[Dict[str, + Any]]) -> Optional[GetMaxWithdrawMarginReq]: + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({"symbol": obj.get("symbol")}) + return _obj + + +class GetMaxWithdrawMarginReqBuilder: + + def __init__(self): + self.obj = {} + + def set_symbol(self, value: str) -> GetMaxWithdrawMarginReqBuilder: + """ + Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) + """ + self.obj['symbol'] = value + return self + + def build(self) -> GetMaxWithdrawMarginReq: + return GetMaxWithdrawMarginReq(**self.obj) diff --git a/sdk/python/kucoin_universal_sdk/generate/copytrading/futures/model_get_max_withdraw_margin_resp.py b/sdk/python/kucoin_universal_sdk/generate/copytrading/futures/model_get_max_withdraw_margin_resp.py new file mode 100644 index 00000000..541fe53c --- /dev/null +++ b/sdk/python/kucoin_universal_sdk/generate/copytrading/futures/model_get_max_withdraw_margin_resp.py @@ -0,0 +1,74 @@ +# coding: utf-8 + +# Code generated by Kucoin Universal SDK Generator; DO NOT EDIT. + +from __future__ import annotations +import pprint +import json + +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from kucoin_universal_sdk.internal.interfaces.response import Response +from kucoin_universal_sdk.model.common import RestResponse + + +class GetMaxWithdrawMarginResp(BaseModel, Response): + """ + GetMaxWithdrawMarginResp + + Attributes: + data (str): The size of the position that can be deposited. If it is USDT-margin, it represents the amount of USDT. If it is coin-margin, this value represents the number of coins + """ + + common_response: Optional[RestResponse] = Field( + default=None, description="Common response") + data: Optional[str] = Field( + default=None, + description= + "The size of the position that can be deposited. If it is USDT-margin, it represents the amount of USDT. If it is coin-margin, this value represents the number of coins " + ) + + __properties: ClassVar[List[str]] = ["data"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=False, + protected_namespaces=(), + ) + + def to_str(self) -> str: + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + return self.model_dump_json(by_alias=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[GetMaxWithdrawMarginResp]: + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + _dict = self.model_dump( + by_alias=True, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict( + cls, + obj: Optional[Dict[str, + Any]]) -> Optional[GetMaxWithdrawMarginResp]: + if obj is None: + return None + + # original response + obj = {'data': obj} + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({"data": obj.get("data")}) + return _obj + + def set_common_response(self, response: RestResponse): + self.common_response = response diff --git a/sdk/python/kucoin_universal_sdk/generate/copytrading/futures/model_modify_auto_deposit_status_req.py b/sdk/python/kucoin_universal_sdk/generate/copytrading/futures/model_modify_auto_deposit_status_req.py new file mode 100644 index 00000000..fbba4cb5 --- /dev/null +++ b/sdk/python/kucoin_universal_sdk/generate/copytrading/futures/model_modify_auto_deposit_status_req.py @@ -0,0 +1,89 @@ +# coding: utf-8 + +# Code generated by Kucoin Universal SDK Generator; DO NOT EDIT. + +from __future__ import annotations +import pprint +import json + +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional + + +class ModifyAutoDepositStatusReq(BaseModel): + """ + ModifyAutoDepositStatusReq + + Attributes: + symbol (str): Symbol of the contract + status (bool): Status + """ + + symbol: Optional[str] = Field(default=None, + description="Symbol of the contract ") + status: Optional[bool] = Field(default=None, description="Status") + + __properties: ClassVar[List[str]] = ["symbol", "status"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=False, + protected_namespaces=(), + ) + + def to_str(self) -> str: + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + return self.model_dump_json(by_alias=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[ModifyAutoDepositStatusReq]: + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + _dict = self.model_dump( + by_alias=True, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict( + cls, + obj: Optional[Dict[str, + Any]]) -> Optional[ModifyAutoDepositStatusReq]: + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "symbol": obj.get("symbol"), + "status": obj.get("status") + }) + return _obj + + +class ModifyAutoDepositStatusReqBuilder: + + def __init__(self): + self.obj = {} + + def set_symbol(self, value: str) -> ModifyAutoDepositStatusReqBuilder: + """ + Symbol of the contract + """ + self.obj['symbol'] = value + return self + + def set_status(self, value: bool) -> ModifyAutoDepositStatusReqBuilder: + """ + Status + """ + self.obj['status'] = value + return self + + def build(self) -> ModifyAutoDepositStatusReq: + return ModifyAutoDepositStatusReq(**self.obj) diff --git a/sdk/python/kucoin_universal_sdk/generate/copytrading/futures/model_modify_auto_deposit_status_resp.py b/sdk/python/kucoin_universal_sdk/generate/copytrading/futures/model_modify_auto_deposit_status_resp.py new file mode 100644 index 00000000..77d07b68 --- /dev/null +++ b/sdk/python/kucoin_universal_sdk/generate/copytrading/futures/model_modify_auto_deposit_status_resp.py @@ -0,0 +1,70 @@ +# coding: utf-8 + +# Code generated by Kucoin Universal SDK Generator; DO NOT EDIT. + +from __future__ import annotations +import pprint +import json + +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from kucoin_universal_sdk.internal.interfaces.response import Response +from kucoin_universal_sdk.model.common import RestResponse + + +class ModifyAutoDepositStatusResp(BaseModel, Response): + """ + ModifyAutoDepositStatusResp + + Attributes: + data (bool): + """ + + common_response: Optional[RestResponse] = Field( + default=None, description="Common response") + data: Optional[bool] = None + + __properties: ClassVar[List[str]] = ["data"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=False, + protected_namespaces=(), + ) + + def to_str(self) -> str: + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + return self.model_dump_json(by_alias=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[ModifyAutoDepositStatusResp]: + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + _dict = self.model_dump( + by_alias=True, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict( + cls, + obj: Optional[Dict[str, + Any]]) -> Optional[ModifyAutoDepositStatusResp]: + if obj is None: + return None + + # original response + obj = {'data': obj} + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({"data": obj.get("data")}) + return _obj + + def set_common_response(self, response: RestResponse): + self.common_response = response diff --git a/sdk/python/kucoin_universal_sdk/generate/copytrading/futures/model_modify_isolated_margin_risk_limt_req.py b/sdk/python/kucoin_universal_sdk/generate/copytrading/futures/model_modify_isolated_margin_risk_limt_req.py new file mode 100644 index 00000000..81608975 --- /dev/null +++ b/sdk/python/kucoin_universal_sdk/generate/copytrading/futures/model_modify_isolated_margin_risk_limt_req.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +# Code generated by Kucoin Universal SDK Generator; DO NOT EDIT. + +from __future__ import annotations +import pprint +import json + +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional + + +class ModifyIsolatedMarginRiskLimtReq(BaseModel): + """ + ModifyIsolatedMarginRiskLimtReq + + Attributes: + symbol (str): Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) + level (int): level + """ + + symbol: Optional[str] = Field( + default=None, + description= + "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) " + ) + level: Optional[int] = Field(default=None, description="level") + + __properties: ClassVar[List[str]] = ["symbol", "level"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=False, + protected_namespaces=(), + ) + + def to_str(self) -> str: + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + return self.model_dump_json(by_alias=True, exclude_none=True) + + @classmethod + def from_json(cls, + json_str: str) -> Optional[ModifyIsolatedMarginRiskLimtReq]: + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + _dict = self.model_dump( + by_alias=True, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict( + cls, obj: Optional[Dict[str, Any]] + ) -> Optional[ModifyIsolatedMarginRiskLimtReq]: + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "symbol": obj.get("symbol"), + "level": obj.get("level") + }) + return _obj + + +class ModifyIsolatedMarginRiskLimtReqBuilder: + + def __init__(self): + self.obj = {} + + def set_symbol(self, value: str) -> ModifyIsolatedMarginRiskLimtReqBuilder: + """ + Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) + """ + self.obj['symbol'] = value + return self + + def set_level(self, value: int) -> ModifyIsolatedMarginRiskLimtReqBuilder: + """ + level + """ + self.obj['level'] = value + return self + + def build(self) -> ModifyIsolatedMarginRiskLimtReq: + return ModifyIsolatedMarginRiskLimtReq(**self.obj) diff --git a/sdk/python/kucoin_universal_sdk/generate/copytrading/futures/model_modify_isolated_margin_risk_limt_resp.py b/sdk/python/kucoin_universal_sdk/generate/copytrading/futures/model_modify_isolated_margin_risk_limt_resp.py new file mode 100644 index 00000000..d5c23666 --- /dev/null +++ b/sdk/python/kucoin_universal_sdk/generate/copytrading/futures/model_modify_isolated_margin_risk_limt_resp.py @@ -0,0 +1,74 @@ +# coding: utf-8 + +# Code generated by Kucoin Universal SDK Generator; DO NOT EDIT. + +from __future__ import annotations +import pprint +import json + +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from kucoin_universal_sdk.internal.interfaces.response import Response +from kucoin_universal_sdk.model.common import RestResponse + + +class ModifyIsolatedMarginRiskLimtResp(BaseModel, Response): + """ + ModifyIsolatedMarginRiskLimtResp + + Attributes: + data (bool): To adjust the level will cancel the open order, the response can only indicate whether the submit of the adjustment request is successful or not. + """ + + common_response: Optional[RestResponse] = Field( + default=None, description="Common response") + data: Optional[bool] = Field( + default=None, + description= + "To adjust the level will cancel the open order, the response can only indicate whether the submit of the adjustment request is successful or not. " + ) + + __properties: ClassVar[List[str]] = ["data"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=False, + protected_namespaces=(), + ) + + def to_str(self) -> str: + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + return self.model_dump_json(by_alias=True, exclude_none=True) + + @classmethod + def from_json(cls, + json_str: str) -> Optional[ModifyIsolatedMarginRiskLimtResp]: + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + _dict = self.model_dump( + by_alias=True, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict( + cls, obj: Optional[Dict[str, Any]] + ) -> Optional[ModifyIsolatedMarginRiskLimtResp]: + if obj is None: + return None + + # original response + obj = {'data': obj} + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({"data": obj.get("data")}) + return _obj + + def set_common_response(self, response: RestResponse): + self.common_response = response diff --git a/sdk/python/kucoin_universal_sdk/generate/copytrading/futures/model_remove_isolated_margin_req.py b/sdk/python/kucoin_universal_sdk/generate/copytrading/futures/model_remove_isolated_margin_req.py new file mode 100644 index 00000000..f6d5edd1 --- /dev/null +++ b/sdk/python/kucoin_universal_sdk/generate/copytrading/futures/model_remove_isolated_margin_req.py @@ -0,0 +1,97 @@ +# coding: utf-8 + +# Code generated by Kucoin Universal SDK Generator; DO NOT EDIT. + +from __future__ import annotations +import pprint +import json + +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional + + +class RemoveIsolatedMarginReq(BaseModel): + """ + RemoveIsolatedMarginReq + + Attributes: + symbol (str): Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) + withdraw_amount (str): The size of the position that can be deposited. If it is USDT-margin, it represents the amount of USDT. If it is coin-margin, this value represents the number of coins + """ + + symbol: Optional[str] = Field( + default=None, + description= + "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) " + ) + withdraw_amount: Optional[str] = Field( + default=None, + description= + "The size of the position that can be deposited. If it is USDT-margin, it represents the amount of USDT. If it is coin-margin, this value represents the number of coins ", + alias="withdrawAmount") + + __properties: ClassVar[List[str]] = ["symbol", "withdrawAmount"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=False, + protected_namespaces=(), + ) + + def to_str(self) -> str: + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + return self.model_dump_json(by_alias=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[RemoveIsolatedMarginReq]: + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + _dict = self.model_dump( + by_alias=True, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict( + cls, + obj: Optional[Dict[str, + Any]]) -> Optional[RemoveIsolatedMarginReq]: + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "symbol": obj.get("symbol"), + "withdrawAmount": obj.get("withdrawAmount") + }) + return _obj + + +class RemoveIsolatedMarginReqBuilder: + + def __init__(self): + self.obj = {} + + def set_symbol(self, value: str) -> RemoveIsolatedMarginReqBuilder: + """ + Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) + """ + self.obj['symbol'] = value + return self + + def set_withdraw_amount(self, + value: str) -> RemoveIsolatedMarginReqBuilder: + """ + The size of the position that can be deposited. If it is USDT-margin, it represents the amount of USDT. If it is coin-margin, this value represents the number of coins + """ + self.obj['withdrawAmount'] = value + return self + + def build(self) -> RemoveIsolatedMarginReq: + return RemoveIsolatedMarginReq(**self.obj) diff --git a/sdk/python/kucoin_universal_sdk/generate/copytrading/futures/model_remove_isolated_margin_resp.py b/sdk/python/kucoin_universal_sdk/generate/copytrading/futures/model_remove_isolated_margin_resp.py new file mode 100644 index 00000000..8ba5b6df --- /dev/null +++ b/sdk/python/kucoin_universal_sdk/generate/copytrading/futures/model_remove_isolated_margin_resp.py @@ -0,0 +1,74 @@ +# coding: utf-8 + +# Code generated by Kucoin Universal SDK Generator; DO NOT EDIT. + +from __future__ import annotations +import pprint +import json + +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from kucoin_universal_sdk.internal.interfaces.response import Response +from kucoin_universal_sdk.model.common import RestResponse + + +class RemoveIsolatedMarginResp(BaseModel, Response): + """ + RemoveIsolatedMarginResp + + Attributes: + data (str): The size of the position deposited. If it is USDT-margin, it represents the amount of USDT. If it is coin-margin, this value represents the number of coins + """ + + common_response: Optional[RestResponse] = Field( + default=None, description="Common response") + data: Optional[str] = Field( + default=None, + description= + "The size of the position deposited. If it is USDT-margin, it represents the amount of USDT. If it is coin-margin, this value represents the number of coins " + ) + + __properties: ClassVar[List[str]] = ["data"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=False, + protected_namespaces=(), + ) + + def to_str(self) -> str: + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + return self.model_dump_json(by_alias=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[RemoveIsolatedMarginResp]: + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + _dict = self.model_dump( + by_alias=True, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict( + cls, + obj: Optional[Dict[str, + Any]]) -> Optional[RemoveIsolatedMarginResp]: + if obj is None: + return None + + # original response + obj = {'data': obj} + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({"data": obj.get("data")}) + return _obj + + def set_common_response(self, response: RestResponse): + self.common_response = response diff --git a/sdk/python/kucoin_universal_sdk/generate/service/copytrading_api.py b/sdk/python/kucoin_universal_sdk/generate/service/copytrading_api.py new file mode 100644 index 00000000..322beb8e --- /dev/null +++ b/sdk/python/kucoin_universal_sdk/generate/service/copytrading_api.py @@ -0,0 +1,25 @@ +# Code generated by Kucoin Universal SDK Generator; DO NOT EDIT. + +from abc import ABC, abstractmethod +from kucoin_universal_sdk.internal.interfaces.transport import Transport +from kucoin_universal_sdk.generate.copytrading.futures.api_futures import FuturesAPI, FuturesAPIImpl + + +class CopyTradingService(ABC): + + @abstractmethod + def get_futures_api(self) -> FuturesAPI: + """ + get FuturesAPI + """ + pass + + +class CopyTradingServiceImpl(CopyTradingService): + + def __init__(self, transport: Transport): + self.transport = transport + self.futures = FuturesAPIImpl(transport) + + def get_futures_api(self) -> FuturesAPI: + return self.futures diff --git a/sdk/python/kucoin_universal_sdk/internal/rest/default_rest_impl.py b/sdk/python/kucoin_universal_sdk/internal/rest/default_rest_impl.py index 1b412866..1e2d7126 100644 --- a/sdk/python/kucoin_universal_sdk/internal/rest/default_rest_impl.py +++ b/sdk/python/kucoin_universal_sdk/internal/rest/default_rest_impl.py @@ -4,6 +4,7 @@ from kucoin_universal_sdk.generate.service.account_api import AccountService, AccountServiceImpl from kucoin_universal_sdk.generate.service.affiliate_api import AffiliateService, AffiliateServiceImpl from kucoin_universal_sdk.generate.service.broker_api import BrokerService, BrokerServiceImpl +from kucoin_universal_sdk.generate.service.copytrading_api import CopyTradingService, CopyTradingServiceImpl from kucoin_universal_sdk.generate.service.earn_api import EarnService, EarnServiceImpl from kucoin_universal_sdk.generate.service.futures_api import FuturesService, FuturesServiceImpl from kucoin_universal_sdk.generate.service.margin_api import MarginService, MarginServiceImpl @@ -26,6 +27,7 @@ def __init__(self, options: ClientOption): self.account_service = AccountServiceImpl(transport) self.affiliate_service = AffiliateServiceImpl(transport) self.broker_service = BrokerServiceImpl(transport) + self.copytrading_service = CopyTradingServiceImpl(transport) self.earn_service = EarnServiceImpl(transport) self.futures_service = FuturesServiceImpl(transport) self.margin_service = MarginServiceImpl(transport) @@ -41,6 +43,9 @@ def get_affiliate_service(self) -> AffiliateService: def get_broker_service(self) -> BrokerService: return self.broker_service + def get_copytrading_service(self) -> CopyTradingService: + return self.copytrading_service + def get_earn_service(self) -> EarnService: return self.earn_service diff --git a/sdk/python/test/e2e/rest/copytrading_test/copytrading_futures.py b/sdk/python/test/e2e/rest/copytrading_test/copytrading_futures.py new file mode 100644 index 00000000..a7a9c67a --- /dev/null +++ b/sdk/python/test/e2e/rest/copytrading_test/copytrading_futures.py @@ -0,0 +1,282 @@ +import os +import unittest +import uuid + +from kucoin_universal_sdk.api.client import DefaultClient +from kucoin_universal_sdk.extension.interceptor.logging import LoggingInterceptor +from kucoin_universal_sdk.generate.copytrading.futures.model_add_isolated_margin_req import AddIsolatedMarginReqBuilder +from kucoin_universal_sdk.generate.copytrading.futures.model_add_order_req import AddOrderReqBuilder, AddOrderReq +from kucoin_universal_sdk.generate.copytrading.futures.model_add_order_test_req import AddOrderTestReqBuilder, \ + AddOrderTestReq +from kucoin_universal_sdk.generate.copytrading.futures.model_add_tpsl_order_req import AddTpslOrderReqBuilder, \ + AddTpslOrderReq +from kucoin_universal_sdk.generate.copytrading.futures.model_cancel_order_by_client_oid_req import \ + CancelOrderByClientOidReqBuilder +from kucoin_universal_sdk.generate.copytrading.futures.model_cancel_order_by_id_req import CancelOrderByIdReqBuilder +from kucoin_universal_sdk.generate.copytrading.futures.model_get_max_open_size_req import GetMaxOpenSizeReqBuilder +from kucoin_universal_sdk.generate.copytrading.futures.model_get_max_withdraw_margin_req import \ + GetMaxWithdrawMarginReqBuilder +from kucoin_universal_sdk.generate.copytrading.futures.model_modify_auto_deposit_status_req import \ + ModifyAutoDepositStatusReqBuilder +from kucoin_universal_sdk.generate.copytrading.futures.model_modify_isolated_margin_risk_limt_req import \ + ModifyIsolatedMarginRiskLimtReqBuilder +from kucoin_universal_sdk.generate.copytrading.futures.model_remove_isolated_margin_req import \ + RemoveIsolatedMarginReqBuilder +from kucoin_universal_sdk.model.client_option import ClientOptionBuilder +from kucoin_universal_sdk.model.constants import GLOBAL_API_ENDPOINT, GLOBAL_FUTURES_API_ENDPOINT, \ + GLOBAL_BROKER_API_ENDPOINT +from kucoin_universal_sdk.model.transport_option import TransportOptionBuilder + + +class FuturesApiTest(unittest.TestCase): + def setUp(self): + key = os.getenv("API_KEY") + secret = os.getenv("API_SECRET") + passphrase = os.getenv("API_PASSPHRASE") + + # create http transport option + http_transport_option = ( + TransportOptionBuilder() + .set_interceptors([LoggingInterceptor()]) + .build() + ) + + # create client option + client_option = ( + ClientOptionBuilder() + .set_key(key) + .set_secret(secret) + .set_passphrase(passphrase) + .set_spot_endpoint(GLOBAL_API_ENDPOINT) + .set_futures_endpoint(GLOBAL_FUTURES_API_ENDPOINT) + .set_broker_endpoint(GLOBAL_BROKER_API_ENDPOINT) + .set_transport_option(http_transport_option) + .build() + ) + + # create API client + client = DefaultClient(client_option) + kucoin_rest_api = client.rest_service() + self.api = kucoin_rest_api.get_copytrading_service().get_futures_api() + + def test_add_order_req(self): + """ + add_order + Add Order + /api/v1/copy-trade/futures/orders + """ + + builder = AddOrderReqBuilder() + builder.set_client_oid(uuid.uuid4().__str__()).set_side(AddOrderReq.SideEnum.BUY).set_symbol( + 'XBTUSDTM').set_leverage(3).set_type(AddOrderReq.TypeEnum.LIMIT).set_remark( + 'order remarks').set_reduce_only(False).set_margin_mode(AddOrderReq.MarginModeEnum.ISOLATED).set_price( + '0.1').set_size(1).set_time_in_force(AddOrderReq.TimeInForceEnum.GOOD_TILL_CANCELED) + req = builder.build() + try: + resp = self.api.add_order(req) + print("code: ", resp.common_response.code) + print("msg: ", resp.common_response.message) + print("data: ", resp.to_json()) + except Exception as e: + print("error: ", e) + raise e + + def test_add_order_test_req(self): + """ + add_order_test + Add Order Test + /api/v1/copy-trade/futures/orders/test + """ + + builder = AddOrderTestReqBuilder() + builder.set_client_oid(uuid.uuid4().__str__()).set_side(AddOrderTestReq.SideEnum.BUY).set_symbol( + 'XBTUSDTM').set_leverage(3).set_type(AddOrderTestReq.TypeEnum.LIMIT).set_remark( + 'order remarks').set_reduce_only(False).set_margin_mode(AddOrderTestReq.MarginModeEnum.ISOLATED).set_price( + '0.1').set_size(1).set_time_in_force(AddOrderTestReq.TimeInForceEnum.GOOD_TILL_CANCELED) + req = builder.build() + try: + resp = self.api.add_order_test(req) + print("code: ", resp.common_response.code) + print("msg: ", resp.common_response.message) + print("data: ", resp.to_json()) + except Exception as e: + print("error: ", e) + raise e + + def test_add_tpsl_order_req(self): + """ + add_tpsl_order + Add Take Profit And Stop Loss Order + /api/v1/copy-trade/futures/st-orders + """ + + builder = AddTpslOrderReqBuilder() + builder.set_client_oid(uuid.uuid4().__str__()).set_side(AddTpslOrderReq.SideEnum.BUY).set_symbol( + 'XBTUSDTM').set_leverage(3).set_type(AddTpslOrderReq.TypeEnum.LIMIT).set_remark( + 'order remarks').set_reduce_only(False).set_margin_mode(AddTpslOrderReq.MarginModeEnum.ISOLATED).set_price( + '0.1').set_size(1).set_time_in_force( + AddTpslOrderReq.TimeInForceEnum.GOOD_TILL_CANCELED).set_trigger_stop_up_price( + '0.3').set_trigger_stop_down_price('0.1').set_stop_price_type(AddTpslOrderReq.StopPriceTypeEnum.TRADE_PRICE) + req = builder.build() + try: + resp = self.api.add_tpsl_order(req) + print("code: ", resp.common_response.code) + print("msg: ", resp.common_response.message) + print("data: ", resp.to_json()) + except Exception as e: + print("error: ", e) + raise e + + def test_cancel_order_by_id_req(self): + """ + cancel_order_by_id + Cancel Order By OrderId + /api/v1/copy-trade/futures/orders + """ + + builder = CancelOrderByIdReqBuilder() + builder.set_order_id("268924170417500160") + req = builder.build() + try: + resp = self.api.cancel_order_by_id(req) + print("code: ", resp.common_response.code) + print("msg: ", resp.common_response.message) + print("data: ", resp.to_json()) + except Exception as e: + print("error: ", e) + raise e + + def test_cancel_order_by_client_oid_req(self): + """ + cancel_order_by_client_oid + Cancel Order By ClientOid + /api/v1/copy-trade/futures/orders/client-order + """ + + builder = CancelOrderByClientOidReqBuilder() + builder.set_symbol('XBTUSDTM').set_client_oid('2603cb0a-c227-4522-9652-701eb77237bb') + req = builder.build() + try: + resp = self.api.cancel_order_by_client_oid(req) + print("code: ", resp.common_response.code) + print("msg: ", resp.common_response.message) + print("data: ", resp.to_json()) + except Exception as e: + print("error: ", e) + raise e + + def test_get_max_open_size_req(self): + """ + get_max_open_size + Get Max Open Size + /api/v1/copy-trade/futures/get-max-open-size + """ + + builder = GetMaxOpenSizeReqBuilder() + builder.set_symbol('XBTUSDTM').set_price('0.1').set_leverage(10) + req = builder.build() + try: + resp = self.api.get_max_open_size(req) + print("code: ", resp.common_response.code) + print("msg: ", resp.common_response.message) + print("data: ", resp.to_json()) + except Exception as e: + print("error: ", e) + raise e + + def test_get_max_withdraw_margin_req(self): + """ + get_max_withdraw_margin + Get Max Withdraw Margin + /api/v1/copy-trade/futures/position/margin/max-withdraw-margin + """ + + builder = GetMaxWithdrawMarginReqBuilder() + builder.set_symbol('XBTUSDTM') + req = builder.build() + try: + resp = self.api.get_max_withdraw_margin(req) + print("code: ", resp.common_response.code) + print("msg: ", resp.common_response.message) + print("data: ", resp.to_json()) + except Exception as e: + print("error: ", e) + raise e + + # TODO + def test_add_isolated_margin_req(self): + """ + add_isolated_margin + Add Isolated Margin + /api/v1/copy-trade/futures/position/margin/deposit-margin + """ + + builder = AddIsolatedMarginReqBuilder() + builder.set_symbol("XBTUSDTM").set_margin(1).set_biz_no(uuid.uuid4().__str__()) + req = builder.build() + try: + resp = self.api.add_isolated_margin(req) + print("code: ", resp.common_response.code) + print("msg: ", resp.common_response.message) + print("data: ", resp.to_json()) + except Exception as e: + print("error: ", e) + raise e + + # TODO + def test_remove_isolated_margin_req(self): + """ + remove_isolated_margin + Remove Isolated Margin + /api/v1/copy-trade/futures/position/margin/withdraw-margin + """ + + builder = RemoveIsolatedMarginReqBuilder() + builder.set_symbol('XBTUSDTM').set_withdraw_amount('0.0000001') + req = builder.build() + try: + resp = self.api.remove_isolated_margin(req) + print("code: ", resp.common_response.code) + print("msg: ", resp.common_response.message) + print("data: ", resp.to_json()) + except Exception as e: + print("error: ", e) + raise e + + def test_modify_isolated_margin_risk_limt_req(self): + """ + modify_isolated_margin_risk_limt + Modify Isolated Margin Risk Limit + /api/v1/copy-trade/futures/position/risk-limit-level/change + """ + + builder = ModifyIsolatedMarginRiskLimtReqBuilder() + builder.set_symbol('XBTUSDTM').set_level(1) + req = builder.build() + try: + resp = self.api.modify_isolated_margin_risk_limt(req) + print("code: ", resp.common_response.code) + print("msg: ", resp.common_response.message) + print("data: ", resp.to_json()) + except Exception as e: + print("error: ", e) + raise e + + def test_modify_auto_deposit_status_req(self): + """ + modify_auto_deposit_status + Modify Isolated Margin Auto-Deposit Status + /api/v1/copy-trade/futures/position/margin/auto-deposit-status + """ + + builder = ModifyAutoDepositStatusReqBuilder() + builder.set_symbol("XBTUSDTM").set_status(True) + req = builder.build() + try: + resp = self.api.modify_auto_deposit_status(req) + print("code: ", resp.common_response.code) + print("msg: ", resp.common_response.message) + print("data: ", resp.to_json()) + except Exception as e: + print("error: ", e) + raise e diff --git a/spec/apis.csv b/spec/apis.csv index 7c98119e..24dd148b 100644 --- a/spec/apis.csv +++ b/spec/apis.csv @@ -227,3 +227,14 @@ broker,ndbroker,/api/v1/asset/ndbroker/deposit/list,get,Get Deposit List broker,ndbroker,/api/v3/broker/nd/deposit/detail,get,Get Deposit Detail broker,ndbroker,/api/v3/broker/nd/withdraw/detail,get,Get Withdraw Detail broker,ndbroker,/api/v1/broker/nd/rebase/download,get,Get Broker Rebate +copytrading,futures,/api/v1/copy-trade/futures/orders,post,Add Order +copytrading,futures,/api/v1/copy-trade/futures/orders/test,post,Add Order Test +copytrading,futures,/api/v1/copy-trade/futures/st-orders,post,Add Take Profit And Stop Loss Order +copytrading,futures,/api/v1/copy-trade/futures/orders,delete,Cancel Order By OrderId +copytrading,futures,/api/v1/copy-trade/futures/orders/client-order,delete,Cancel Order By ClientOid +copytrading,futures,/api/v1/copy-trade/futures/get-max-open-size,get,Get Max Open Size +copytrading,futures,/api/v1/copy-trade/futures/position/margin/max-withdraw-margin,get,Get Max Withdraw Margin +copytrading,futures,/api/v1/copy-trade/futures/position/margin/deposit-margin,post,Add Isolated Margin +copytrading,futures,/api/v1/copy-trade/futures/position/margin/withdraw-margin,post,Remove Isolated Margin +copytrading,futures,/api/v1/copy-trade/futures/position/risk-limit-level/change,post,Modify Isolated Margin Risk Limit +copytrading,futures,/api/v1/copy-trade/futures/position/margin/auto-deposit-status,post,Modify Isolated Margin Auto-Deposit Status diff --git a/spec/original/meta.json b/spec/original/meta.json index f674d8a1..41508c35 100644 --- a/spec/original/meta.json +++ b/spec/original/meta.json @@ -39649,6 +39649,1720 @@ ] } ] + }, + { + "name": "Copy Trading", + "id": 348199, + "description": "", + "items": [ + { + "name": "Add Order", + "api": { + "id": "3470363", + "method": "post", + "path": "/api/v1/copy-trade/futures/orders", + "parameters": { + "query": [], + "path": [], + "cookie": [], + "header": [] + }, + "responses": [ + { + "id": "10751", + "code": 200, + "name": "成功", + "headers": [], + "jsonSchema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "object", + "properties": { + "orderId": { + "type": "string", + "description": "The unique order id generated by the trading system,which can be used later for further actions such as canceling the order." + }, + "clientOid": { + "type": "string", + "description": "The user self-defined order id." + } + }, + "required": [ + "orderId", + "clientOid" + ] + } + }, + "required": [ + "code", + "data" + ] + }, + "description": "", + "contentType": "json", + "mediaType": "" + } + ], + "responseExamples": [ + { + "name": "Success", + "data": "{\r\n \"code\": \"200000\",\r\n \"data\": {\r\n \"orderId\": \"263485113055133696\",\r\n \"clientOid\": \"5c52e11203aa677f331e493fb\"\r\n }\r\n}", + "responseId": 10751, + "ordering": 1 + } + ], + "requestBody": { + "type": "application/json", + "parameters": [], + "jsonSchema": { + "type": "object", + "properties": { + "clientOid": { + "type": "string", + "description": "Unique order id created by users to identify their orders, the maximum length cannot exceed 40, e.g. UUID, Only allows numbers, characters, underline(_), and separator(-)", + "examples": [ + "5c52e11203aa677f33e493fb" + ] + }, + "side": { + "type": "string", + "description": "specify if the order is to 'buy' or 'sell' ", + "enum": [ + "buy", + "sell" + ], + "examples": [ + "buy" + ], + "x-api-enum": [ + { + "value": "buy", + "name": "", + "description": "" + }, + { + "value": "sell", + "name": "", + "description": "" + } + ] + }, + "symbol": { + "type": "string", + "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](apidog://link/endpoint/3470220) ", + "examples": [ + "XBTUSDTM" + ] + }, + "leverage": { + "type": "integer", + "description": "Used to calculate the margin to be frozen for the order. If you are to close the position, this parameter is not required.", + "examples": [ + 3 + ] + }, + "type": { + "type": "string", + "description": "specify if the order is an 'limit' order or 'market' order", + "enum": [ + "limit", + "market" + ], + "examples": [ + "limit" + ], + "default": "limit", + "x-api-enum": [ + { + "value": "limit", + "name": "", + "description": "" + }, + { + "value": "market", + "name": "", + "description": "" + } + ] + }, + "remark": { + "type": "string", + "description": "remark for the order, length cannot exceed 100 utf8 characters" + }, + "stop": { + "type": "string", + "description": "Either 'down' or 'up'. If stop is used,parameter stopPrice and stopPriceType also need to be provieded.", + "enum": [ + "down", + "up" + ], + "x-api-enum": [ + { + "value": "down", + "name": "down", + "description": "Triggers when the price reaches or goes below the stopPrice." + }, + { + "value": "up", + "name": "up", + "description": "Triggers when the price reaches or goes above the stopPrice" + } + ] + }, + "stopPriceType": { + "type": "string", + "description": "Either 'TP', 'IP' or 'MP', Need to be defined if stop is specified.", + "enum": [ + "TP", + "MP", + "IP" + ], + "x-api-enum": [ + { + "value": "TP", + "name": "trade price", + "description": "TP for trade price, The last trade price is the last price at which an order was filled. This price can be found in the latest match message." + }, + { + "value": "MP", + "name": "mark price", + "description": "MP for mark price, The mark price can be obtained through relevant OPEN API for index services" + }, + { + "value": "IP", + "name": "index price", + "description": "IP for index price, The index price can be obtained through relevant OPEN API for index services" + } + ] + }, + "stopPrice": { + "type": "string", + "description": "Need to be defined if stop is specified. " + }, + "reduceOnly": { + "type": "boolean", + "description": "A mark to reduce the position size only. Set to false by default. Need to set the position size when reduceOnly is true. If set to true, only the orders reducing the position size will be executed. If the reduce-only order size exceeds the position size, the extra size will be canceled.", + "default": false + }, + "closeOrder": { + "type": "boolean", + "description": "A mark to close the position. Set to false by default. If closeOrder is set to true, the system will close the position and the position size will become 0. Side, Size and Leverage fields can be left empty and the system will determine the side and size automatically.", + "default": false + }, + "forceHold": { + "type": "boolean", + "description": "A mark to forcely hold the funds for an order, even though it's an order to reduce the position size. This helps the order stay on the order book and not get canceled when the position size changes. Set to false by default. The system will forcely freeze certain amount of funds for this order, including orders whose direction is opposite to the current positions. This feature is to ensure that the order won’t be canceled by the matching engine in such a circumstance that not enough funds are frozen for the order.", + "default": false + }, + "marginMode": { + "type": "string", + "description": "Margin mode: ISOLATED, CROSS, default: ISOLATED", + "enum": [ + "ISOLATED", + "CROSS" + ], + "default": "ISOLATED", + "x-api-enum": [ + { + "value": "ISOLATED", + "name": "ISOLATED", + "description": "Isolated Margin" + }, + { + "value": "CROSS", + "name": "CROSS", + "description": "Cross Margin" + } + ] + }, + "price": { + "type": "string", + "description": "Required for type is 'limit' order, indicating the operating price", + "examples": [ + "0.1" + ] + }, + "size": { + "type": "integer", + "description": "Order size (Lot), must be a positive integer. The quantity unit of coin-swap contracts is size(lot), and other units are not supported." + }, + "timeInForce": { + "type": "string", + "description": "Optional for type is 'limit' order, [Time in force](apidog://link/pages/338146) is a special strategy used during trading, default is GTC", + "enum": [ + "GTC", + "IOC" + ], + "default": "GTC", + "x-api-enum": [ + { + "value": "GTC", + "name": "Good Till Canceled", + "description": "order remains open on the order book until canceled. This is the default type if the field is left empty." + }, + { + "value": "IOC", + "name": "Immediate Or Cancel", + "description": "being matched or not, the remaining size of the order will be instantly canceled instead of entering the order book." + } + ] + }, + "postOnly": { + "type": "boolean", + "description": "Optional for type is 'limit' order, post only flag, invalid when timeInForce is IOC. When postOnly is true, not allowed choose hidden or iceberg. The post-only flag ensures that the trader always pays the maker fee and provides liquidity to the order book. If any part of the order is going to pay taker fee, the order will be fully rejected.", + "default": false + }, + "hidden": { + "type": "boolean", + "description": "Optional for type is 'limit' order, orders not displaying in order book. When hidden chose, not allowed choose postOnly.", + "default": false + }, + "iceberg": { + "type": "boolean", + "description": "Optional for type is 'limit' order, Only visible portion of the order is displayed in the order book. When iceberg chose, not allowed choose postOnly.", + "default": false + }, + "visibleSize": { + "type": "string", + "description": "Optional for type is 'limit' order, The maximum visible size of an iceberg order. please place order in size (lots), The units of qty (base currency) and valueQty (value) are not supported." + } + }, + "required": [ + "clientOid", + "symbol", + "side", + "type", + "size" + ] + }, + "example": "{\n \"clientOid\": \"5c52e11203aa677f33e493fb\",\n \"side\": \"buy\",\n \"symbol\": \"XBTUSDTM\",\n \"leverage\": 3,\n \"type\": \"limit\",\n \"remark\": \"order remarks\",\n \"reduceOnly\": false,\n \"marginMode\": \"ISOLATED\",\n \"price\": \"0.1\",\n \"size\": 1,\n \"timeInForce\": \"GTC\"\n}", + "mediaType": "" + }, + "description": ":::info[Description]\nPlace order to the futures trading system, you can place two major types of orders: limit and market. Orders can only be placed if your account has sufficient funds. Once an order is placed, your funds will be put on hold for the duration of the order. The amount of funds on hold depends on the order type and parameters specified.\n:::\n\n:::tip[Tips]\nThe maximum limit orders for a single contract is 100 per account, and the maximum stop orders for a single contract is 200 per account.\n:::", + "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Futures\",\"api-channel\":\"Private\",\"api-permission\":\"LeadtradeFutures\",\"api-rate-limit-pool\":\"CopyTrading\",\"sdk-service\":\"CopyTrading\",\"sdk-sub-service\":\"Futures\",\"sdk-method-name\":\"addOrder\",\"sdk-method-description\":\"Place order to the futures trading system, you can place two major types of orders: limit and market. Orders can only be placed if your account has sufficient funds. Once an order is placed, your funds will be put on hold for the duration of the order. The amount of funds on hold depends on the order type and parameters specified.\",\"api-rate-limit\":2}" + } + }, + { + "name": "Add Order Test", + "api": { + "id": "3470618", + "method": "post", + "path": "/api/v1/copy-trade/futures/orders/test", + "parameters": { + "query": [], + "path": [], + "cookie": [], + "header": [] + }, + "responses": [ + { + "id": "11166", + "code": 200, + "name": "成功", + "headers": [], + "jsonSchema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "object", + "properties": { + "orderId": { + "type": "string", + "description": "The unique order id generated by the trading system,which can be used later for further actions such as canceling the order." + }, + "clientOid": { + "type": "string", + "description": "The user self-defined order id." + } + }, + "required": [ + "orderId", + "clientOid" + ] + } + }, + "required": [ + "code", + "data" + ] + }, + "description": "", + "contentType": "json", + "mediaType": "" + } + ], + "responseExamples": [ + { + "name": "Success", + "data": "{\n \"code\": \"200000\",\n \"data\": {\n \"orderId\": \"234125150956625920\",\n \"clientOid\": \"5c52e11203aa677f33e493fb\"\n }\n}", + "responseId": 11166, + "ordering": 1 + } + ], + "requestBody": { + "type": "application/json", + "parameters": [], + "jsonSchema": { + "type": "object", + "properties": { + "clientOid": { + "type": "string", + "description": "Unique order id created by users to identify their orders, the maximum length cannot exceed 40, e.g. UUID, Only allows numbers, characters, underline(_), and separator(-)", + "examples": [ + "5c52e11203aa677f33e493fb" + ] + }, + "side": { + "type": "string", + "description": "specify if the order is to 'buy' or 'sell'", + "enum": [ + "buy", + "sell" + ], + "examples": [ + "buy" + ], + "x-api-enum": [ + { + "value": "buy", + "name": "", + "description": "" + }, + { + "value": "sell", + "name": "", + "description": "" + } + ] + }, + "symbol": { + "type": "string", + "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](apidog://link/endpoint/3470220) ", + "examples": [ + "XBTUSDTM" + ] + }, + "leverage": { + "type": "integer", + "description": "Used to calculate the margin to be frozen for the order. If you are to close the position, this parameter is not required.", + "examples": [ + 3 + ] + }, + "type": { + "type": "string", + "description": "specify if the order is an 'limit' order or 'market' order", + "enum": [ + "limit", + "market" + ], + "examples": [ + "limit" + ], + "default": "limit", + "x-api-enum": [ + { + "value": "limit", + "name": "", + "description": "" + }, + { + "value": "market", + "name": "", + "description": "" + } + ] + }, + "remark": { + "type": "string", + "description": "remark for the order, length cannot exceed 100 utf8 characters" + }, + "stop": { + "type": "string", + "description": "Either 'down' or 'up'. If stop is used,parameter stopPrice and stopPriceType also need to be provieded.", + "enum": [ + "down", + "up" + ], + "x-api-enum": [ + { + "value": "down", + "name": "down", + "description": "Triggers when the price reaches or goes below the stopPrice." + }, + { + "value": "up", + "name": "up", + "description": "Triggers when the price reaches or goes above the stopPrice" + } + ] + }, + "stopPriceType": { + "type": "string", + "description": "Either 'TP', 'IP' or 'MP', Need to be defined if stop is specified.", + "enum": [ + "TP", + "MP", + "IP" + ], + "x-api-enum": [ + { + "value": "TP", + "name": "trade price", + "description": "TP for trade price, The last trade price is the last price at which an order was filled. This price can be found in the latest match message." + }, + { + "value": "MP", + "name": "mark price", + "description": "MP for mark price, The mark price can be obtained through relevant OPEN API for index services" + }, + { + "value": "IP", + "name": "index price", + "description": "IP for index price, The index price can be obtained through relevant OPEN API for index services" + } + ] + }, + "stopPrice": { + "type": "string", + "description": "Need to be defined if stop is specified. " + }, + "reduceOnly": { + "type": "boolean", + "description": "A mark to reduce the position size only. Set to false by default. Need to set the position size when reduceOnly is true. If set to true, only the orders reducing the position size will be executed. If the reduce-only order size exceeds the position size, the extra size will be canceled.", + "default": false + }, + "closeOrder": { + "type": "boolean", + "description": "A mark to close the position. Set to false by default. If closeOrder is set to true, the system will close the position and the position size will become 0. Side, Size and Leverage fields can be left empty and the system will determine the side and size automatically.", + "default": false + }, + "forceHold": { + "type": "boolean", + "description": "A mark to forcely hold the funds for an order, even though it's an order to reduce the position size. This helps the order stay on the order book and not get canceled when the position size changes. Set to false by default. The system will forcely freeze certain amount of funds for this order, including orders whose direction is opposite to the current positions. This feature is to ensure that the order won’t be canceled by the matching engine in such a circumstance that not enough funds are frozen for the order.", + "default": false + }, + "marginMode": { + "type": "string", + "description": "Margin mode: ISOLATED, CROSS, default: ISOLATED", + "enum": [ + "ISOLATED", + "CROSS" + ], + "default": "ISOLATED", + "x-api-enum": [ + { + "value": "ISOLATED", + "name": "", + "description": "" + }, + { + "value": "CROSS", + "name": "", + "description": "" + } + ] + }, + "price": { + "type": "string", + "description": "Required for type is 'limit' order, indicating the operating price", + "examples": [ + "0.1" + ] + }, + "size": { + "type": "integer", + "description": "Order size (Lot), must be a positive integer. The quantity unit of coin-swap contracts is size(lot), and other units are not supported." + }, + "timeInForce": { + "type": "string", + "description": "Optional for type is 'limit' order, [Time in force](apidog://link/pages/338146) is a special strategy used during trading, default is GTC", + "enum": [ + "GTC", + "IOC" + ], + "default": "GTC", + "x-api-enum": [ + { + "value": "GTC", + "name": "Good Till Canceled", + "description": "order remains open on the order book until canceled. This is the default type if the field is left empty." + }, + { + "value": "IOC", + "name": "Immediate Or Cancel", + "description": "being matched or not, the remaining size of the order will be instantly canceled instead of entering the order book." + } + ] + }, + "postOnly": { + "type": "boolean", + "description": "Optional for type is 'limit' order, post only flag, invalid when timeInForce is IOC. When postOnly is true, not allowed choose hidden or iceberg. The post-only flag ensures that the trader always pays the maker fee and provides liquidity to the order book. If any part of the order is going to pay taker fee, the order will be fully rejected.", + "default": false + }, + "hidden": { + "type": "boolean", + "description": "Optional for type is 'limit' order, orders not displaying in order book. When hidden chose, not allowed choose postOnly.", + "default": false + }, + "iceberg": { + "type": "boolean", + "description": "Optional for type is 'limit' order, Only visible portion of the order is displayed in the order book. When iceberg chose, not allowed choose postOnly.", + "default": false + }, + "visibleSize": { + "type": "string", + "description": "Optional for type is 'limit' order, The maximum visible size of an iceberg order. please place order in size (lots), The units of qty (base currency) and valueQty (value) are not supported." + } + }, + "required": [ + "clientOid", + "symbol", + "type", + "side", + "leverage", + "size" + ] + }, + "example": "{\n \"clientOid\": \"5c52e11203aa677f33e493fb\",\n \"side\": \"buy\",\n \"symbol\": \"XBTUSDTM\",\n \"leverage\": 3,\n \"type\": \"limit\",\n \"remark\": \"order remarks\",\n \"reduceOnly\": false,\n \"marginMode\": \"ISOLATED\",\n \"price\": \"0.1\",\n \"size\": 1,\n \"timeInForce\": \"GTC\"\n}", + "mediaType": "" + }, + "description": ":::info[Description]\nOrder test endpoint, the request parameters and return parameters of this endpoint are exactly the same as the order endpoint, and can be used to verify whether the signature is correct and other operations. After placing an order, the order will not enter the matching system, and the order cannot be queried.\n:::\n", + "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Futures\",\"api-channel\":\"Private\",\"api-permission\":\"Futures\",\"api-rate-limit-pool\":\"CopyTrading\",\"sdk-service\":\"CopyTrading\",\"sdk-sub-service\":\"Futures\",\"sdk-method-name\":\"addOrderTest\",\"sdk-method-description\":\"Place order to the futures trading system just for validation\",\"api-rate-limit\":2}" + } + }, + { + "name": "Add Take Profit And Stop Loss Order", + "api": { + "id": "3470619", + "method": "post", + "path": "/api/v1/copy-trade/futures/st-orders", + "parameters": { + "query": [], + "path": [], + "cookie": [], + "header": [] + }, + "responses": [ + { + "id": "11167", + "code": 200, + "name": "成功", + "headers": [], + "jsonSchema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "object", + "properties": { + "orderId": { + "type": "string", + "description": "The unique order id generated by the trading system,which can be used later for further actions such as canceling the order." + }, + "clientOid": { + "type": "string", + "description": "The user self-defined order id." + } + }, + "required": [ + "orderId", + "clientOid" + ] + } + }, + "required": [ + "code", + "data" + ] + }, + "description": "", + "contentType": "json", + "mediaType": "" + } + ], + "responseExamples": [ + { + "name": "Success", + "data": "{\n \"code\": \"200000\",\n \"data\": {\n \"orderId\": \"234125150956625920\",\n \"clientOid\": \"5c52e11203aa677f33e493fb\"\n }\n}", + "responseId": 11167, + "ordering": 1 + } + ], + "requestBody": { + "type": "application/json", + "parameters": [], + "jsonSchema": { + "type": "object", + "properties": { + "clientOid": { + "type": "string", + "description": "Unique order id created by users to identify their orders, the maximum length cannot exceed 40, e.g. UUID, Only allows numbers, characters, underline(_), and separator(-)", + "examples": [ + "5c52e11203aa677f33e493fb" + ] + }, + "side": { + "type": "string", + "description": "specify if the order is to 'buy' or 'sell'", + "enum": [ + "buy", + "sell" + ], + "examples": [ + "buy" + ], + "x-api-enum": [ + { + "value": "buy", + "name": "", + "description": "" + }, + { + "value": "sell", + "name": "", + "description": "" + } + ] + }, + "symbol": { + "type": "string", + "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](apidog://link/endpoint/3470220) ", + "examples": [ + "XBTUSDTM" + ] + }, + "leverage": { + "type": "integer", + "description": "Used to calculate the margin to be frozen for the order. If you are to close the position, this parameter is not required.", + "examples": [ + 3 + ] + }, + "type": { + "type": "string", + "description": "specify if the order is an 'limit' order or 'market' order", + "enum": [ + "limit", + "market" + ], + "examples": [ + "limit" + ], + "default": "limit", + "x-api-enum": [ + { + "value": "limit", + "name": "limit", + "description": "limit order" + }, + { + "value": "market", + "name": "market", + "description": "market order" + } + ] + }, + "remark": { + "type": "string", + "description": "remark for the order, length cannot exceed 100 utf8 characters" + }, + "stopPriceType": { + "type": "string", + "description": "Either 'TP', 'IP' or 'MP'", + "enum": [ + "TP", + "MP", + "IP" + ], + "x-api-enum": [ + { + "value": "TP", + "name": "trade price", + "description": "TP for trade price, The last trade price is the last price at which an order was filled. This price can be found in the latest match message." + }, + { + "value": "MP", + "name": "mark price", + "description": "MP for mark price, The mark price can be obtained through relevant OPEN API for index services" + }, + { + "value": "IP", + "name": "index price", + "description": "IP for index price, The index price can be obtained through relevant OPEN API for index services" + } + ] + }, + "reduceOnly": { + "type": "boolean", + "description": "A mark to reduce the position size only. Set to false by default. Need to set the position size when reduceOnly is true. If set to true, only the orders reducing the position size will be executed. If the reduce-only order size exceeds the position size, the extra size will be canceled.", + "default": false + }, + "closeOrder": { + "type": "boolean", + "description": "A mark to close the position. Set to false by default. If closeOrder is set to true, the system will close the position and the position size will become 0. Side, Size and Leverage fields can be left empty and the system will determine the side and size automatically.", + "default": false + }, + "forceHold": { + "type": "boolean", + "description": "A mark to forcely hold the funds for an order, even though it's an order to reduce the position size. This helps the order stay on the order book and not get canceled when the position size changes. Set to false by default. The system will forcely freeze certain amount of funds for this order, including orders whose direction is opposite to the current positions. This feature is to ensure that the order won’t be canceled by the matching engine in such a circumstance that not enough funds are frozen for the order.", + "default": false + }, + "marginMode": { + "type": "string", + "description": "Margin mode: ISOLATED, CROSS, default: ISOLATED", + "enum": [ + "ISOLATED", + "CROSS" + ], + "default": "ISOLATED", + "x-api-enum": [ + { + "value": "ISOLATED", + "name": "", + "description": "" + }, + { + "value": "CROSS", + "name": "", + "description": "" + } + ] + }, + "price": { + "type": "string", + "description": "Required for type is 'limit' order, indicating the operating price", + "examples": [ + "0.1" + ] + }, + "size": { + "type": "integer", + "description": "Order size (Lot), must be a positive integer. The quantity unit of coin-swap contracts is size(lot), and other units are not supported." + }, + "timeInForce": { + "type": "string", + "description": "Optional for type is 'limit' order, [Time in force](apidog://link/pages/338146) is a special strategy used during trading, default is GTC", + "enum": [ + "GTC", + "IOC" + ], + "default": "GTC", + "x-api-enum": [ + { + "value": "GTC", + "name": "Good Till Canceled", + "description": "order remains open on the order book until canceled. This is the default type if the field is left empty." + }, + { + "value": "IOC", + "name": "Immediate Or Cancel", + "description": "being matched or not, the remaining size of the order will be instantly canceled instead of entering the order book." + } + ] + }, + "postOnly": { + "type": "boolean", + "description": "Optional for type is 'limit' order, post only flag, invalid when timeInForce is IOC. When postOnly is true, not allowed choose hidden or iceberg. The post-only flag ensures that the trader always pays the maker fee and provides liquidity to the order book. If any part of the order is going to pay taker fee, the order will be fully rejected.", + "default": false + }, + "hidden": { + "type": "boolean", + "description": "Optional for type is 'limit' order, orders not displaying in order book. When hidden chose, not allowed choose postOnly.", + "default": false + }, + "iceberg": { + "type": "boolean", + "description": "Optional for type is 'limit' order, Only visible portion of the order is displayed in the order book. When iceberg chose, not allowed choose postOnly.", + "default": false + }, + "visibleSize": { + "type": "string", + "description": "Optional for type is 'limit' order, The maximum visible size of an iceberg order. please place order in size (lots), The units of qty (base currency) and valueQty (value) are not supported." + }, + "triggerStopUpPrice": { + "type": "string", + "description": "Take profit price" + }, + "triggerStopDownPrice": { + "type": "string", + "description": "Stop loss price" + } + }, + "required": [ + "clientOid", + "symbol", + "type", + "side", + "leverage", + "size" + ] + }, + "example": "{\n \"clientOid\": \"5c52e11203aa677f33e493fb\",\n \"side\": \"buy\",\n \"symbol\": \"XBTUSDTM\",\n \"leverage\": 3,\n \"type\": \"limit\",\n \"remark\": \"order remarks\",\n \"reduceOnly\": false,\n \"marginMode\": \"ISOLATED\",\n \"price\": \"0.2\",\n \"size\": 1,\n \"timeInForce\": \"GTC\",\n \"triggerStopUpPrice\": \"0.3\",\n \"triggerStopDownPrice\": \"0.1\",\n \"stopPriceType\": \"TP\"\n}", + "mediaType": "" + }, + "description": ":::info[Description]\nPlace take profit and stop loss order supports both take-profit and stop-loss functions, and other functions are exactly the same as the place order interface.\n\nYou can place two types of orders: limit and market. Orders can only be placed if your account has sufficient funds. Once an order is placed, your funds will be put on hold for the duration of the order. The amount of funds on hold depends on the order type and parameters specified.\n\nPlease be noted that the system would hold the fees from the orders entered the orderbook in advance. \n:::", + "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Futures\",\"api-channel\":\"Private\",\"api-permission\":\"Futures\",\"api-rate-limit-pool\":\"CopyTrading\",\"sdk-service\":\"CopyTrading\",\"sdk-sub-service\":\"Futures\",\"sdk-method-name\":\"addTPSLOrder\",\"sdk-method-description\":\"Place take profit and stop loss order supports both take-profit and stop-loss functions, and other functions are exactly the same as the place order interface.\",\"api-rate-limit\":2}" + } + }, + { + "name": "Cancel Order By OrderId", + "api": { + "id": "3470620", + "method": "delete", + "path": "/api/v1/copy-trade/futures/orders", + "parameters": { + "query": [ + { + "required": false, + "description": "Order id", + "type": "string", + "id": "ZNVXAOhlFL", + "enable": true, + "name": "orderId", + "example": "263485113055133696" + } + ], + "path": [], + "cookie": [], + "header": [] + }, + "responses": [ + { + "id": "11168", + "code": 200, + "name": "成功", + "headers": [], + "jsonSchema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "object", + "properties": { + "cancelledOrderIds": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The orderId that is to be canceled" + } + }, + "required": [ + "cancelledOrderIds" + ] + } + }, + "required": [ + "code", + "data" + ] + }, + "description": "", + "contentType": "json", + "mediaType": "" + } + ], + "responseExamples": [ + { + "name": "Success", + "data": "{\r\n \"code\": \"200000\",\r\n \"data\": {\r\n \"cancelledOrderIds\": [\r\n \"263485113055133696\"\r\n ]\r\n }\r\n}", + "responseId": 11168, + "ordering": 1 + } + ], + "requestBody": { + "type": "none", + "parameters": [], + "jsonSchema": { + "type": "object", + "properties": {} + }, + "example": "", + "mediaType": "" + }, + "description": ":::info[Description]\nCancel an order (including a stop order).\n\nYou will receive success message once the system has received the cancellation request. The cancellation request will be processed by matching engine in sequence. To know if the request has been processed, you may check the order status or update message from the websocket pushes.\n\nThe `orderId` is the server-assigned order id, not the specified clientOid.\n\nIf the order can not be canceled (already filled or previously canceled, etc), then an error response will indicate the reason in the message field.\n:::\n\n**API KEY PERMISSIONS**\nThis endpoint requires the Futures Trading permission.\n\n**REQUEST URL**\nThis endpoint support Futures URL\n\n**REQUEST RATE LIMIT**\nFutures weight:1\n", + "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Futures\",\"api-channel\":\"Private\",\"api-permission\":\"Futures\",\"api-rate-limit-pool\":\"CopyTrading\",\"sdk-service\":\"CopyTrading\",\"sdk-sub-service\":\"Futures\",\"sdk-method-name\":\"cancelOrderById\",\"sdk-method-description\":\"Cancel order by system generated orderId.\",\"api-rate-limit\":1}" + } + }, + { + "name": "Cancel Order By ClientOid", + "api": { + "id": "3470621", + "method": "delete", + "path": "/api/v1/copy-trade/futures/orders/client-order", + "parameters": { + "query": [ + { + "id": "3ERfnDiWhq", + "name": "symbol", + "required": true, + "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](apidog://link/endpoint/3470220) ", + "example": "XBTUSDTM", + "type": "string", + "enable": true + }, + { + "required": false, + "description": "The user self-defined order id.", + "type": "string", + "id": "OpFty922sI", + "enable": true, + "name": "clientOid", + "example": "5c52e11203aa677f331e493fb" + } + ], + "path": [], + "cookie": [], + "header": [] + }, + "responses": [ + { + "id": "11169", + "code": 200, + "name": "成功", + "headers": [], + "jsonSchema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "object", + "properties": { + "clientOid": { + "type": "string" + } + }, + "required": [ + "clientOid" + ] + } + }, + "required": [ + "code", + "data" + ] + }, + "description": "", + "contentType": "json", + "mediaType": "" + } + ], + "responseExamples": [ + { + "name": "Success", + "data": "{\r\n \"code\": \"200000\",\r\n \"data\": {\r\n \"clientOid\": \"5c52e11203aa677f331e4913fb\"\r\n }\r\n}", + "responseId": 11169, + "ordering": 1 + } + ], + "requestBody": { + "type": "none", + "parameters": [], + "jsonSchema": { + "type": "object", + "properties": {} + }, + "example": "", + "mediaType": "" + }, + "description": ":::info[Description]\nCancel an order (including a stop order).\n\nYou will receive success message once the system has received the cancellation request. The cancellation request will be processed by matching engine in sequence. To know if the request has been processed, you may check the order status or update message from the pushes.\n\nResponse the ID created by the client (clientOid).\n\nIf the order can not be canceled (already filled or previously canceled, etc), then an error response will indicate the reason in the message field.\n:::", + "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Futures\",\"api-channel\":\"Private\",\"api-permission\":\"Futures\",\"api-rate-limit-pool\":\"CopyTrading\",\"sdk-service\":\"CopyTrading\",\"sdk-sub-service\":\"Futures\",\"sdk-method-name\":\"cancelOrderByClientOid\",\"sdk-method-description\":\"Cancel order by client defined orderId.\",\"api-rate-limit\":1}" + } + }, + { + "name": "Get Max Open Size", + "api": { + "id": "3470612", + "method": "get", + "path": "/api/v1/copy-trade/futures/get-max-open-size", + "parameters": { + "query": [ + { + "id": "4wXlXiQszi", + "name": "symbol", + "required": true, + "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](apidog://link/endpoint/3470220) ", + "type": "string", + "schema": { + "type": "string", + "examples": [ + "XBTUSDTM", + "XBTUSDM", + "ETHUSDTM" + ] + }, + "enable": true + }, + { + "id": "uaSHeFQTjq", + "name": "price", + "required": true, + "description": "Order price\n", + "type": "string", + "enable": true + }, + { + "id": "WUcubn1a2F", + "name": "leverage", + "required": true, + "description": "Leverage\n", + "type": "integer", + "schema": { + "type": "integer" + }, + "enable": true + } + ], + "path": [], + "cookie": [], + "header": [] + }, + "responses": [ + { + "id": "11102", + "code": 200, + "name": "成功", + "headers": [], + "jsonSchema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "object", + "properties": { + "symbol": { + "type": "string", + "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](apidog://link/endpoint/3470220) " + }, + "maxBuyOpenSize": { + "type": "integer", + "description": "Maximum buy size\n" + }, + "maxSellOpenSize": { + "type": "integer", + "description": "Maximum buy size\n" + } + }, + "required": [ + "symbol", + "maxBuyOpenSize", + "maxSellOpenSize" + ] + } + }, + "required": [ + "code", + "data" + ] + }, + "description": "", + "contentType": "json", + "mediaType": "" + } + ], + "responseExamples": [ + { + "name": "Success", + "data": "{\r\n \"code\": \"200000\",\r\n \"data\": {\r\n \"symbol\": \"XBTUSDTM\",\r\n \"maxBuyOpenSize\": 8,\r\n \"maxSellOpenSize\": 5\r\n }\r\n}", + "responseId": 11102, + "ordering": 1 + } + ], + "requestBody": { + "type": "none", + "parameters": [], + "jsonSchema": { + "type": "object", + "properties": {} + }, + "example": "", + "mediaType": "" + }, + "description": ":::info[Description]\nGet Maximum Open Position Size.\n:::", + "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Futures\",\"api-channel\":\"Private\",\"api-permission\":\"Futures\",\"api-rate-limit-pool\":\"CopyTrading\",\"sdk-service\":\"CopyTrading\",\"sdk-sub-service\":\"Futures\",\"sdk-method-name\":\"GetMaxOpenSize\",\"sdk-method-description\":\"Get Maximum Open Position Size.\",\"api-rate-limit\":2}" + } + }, + { + "name": "Get Max Withdraw Margin", + "api": { + "id": "3470616", + "method": "get", + "path": "/api/v1/copy-trade/futures/position/margin/max-withdraw-margin", + "parameters": { + "query": [ + { + "id": "1BH2JPcdrO", + "name": "symbol", + "required": true, + "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](apidog://link/endpoint/3470220) ", + "type": "string", + "enable": true + } + ], + "path": [], + "cookie": [], + "header": [] + }, + "responses": [ + { + "id": "11079", + "code": 200, + "name": "成功", + "headers": [], + "jsonSchema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "string", + "description": "The size of the position that can be deposited. If it is USDT-margin, it represents the amount of USDT. If it is coin-margin, this value represents the number of coins\n" + } + }, + "required": [ + "code", + "data" + ] + }, + "description": "", + "contentType": "json", + "mediaType": "" + } + ], + "responseExamples": [ + { + "name": "Success", + "data": "{\n \"code\": \"200000\",\n \"data\": \"21.1135719252\"\n}", + "responseId": 11079, + "ordering": 1 + } + ], + "requestBody": { + "type": "none", + "parameters": [], + "jsonSchema": { + "type": "object", + "properties": {} + }, + "example": "", + "mediaType": "" + }, + "description": ":::info[Description]\nThis interface can query the maximum amount of margin that the current position supports withdrawal.\n:::\n", + "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Futures\",\"api-channel\":\"Private\",\"api-permission\":\"Futures\",\"api-rate-limit-pool\":\"CopyTrading\",\"sdk-service\":\"CopyTrading\",\"sdk-sub-service\":\"Futures\",\"sdk-method-name\":\"GetMaxWithdrawMargin\",\"sdk-method-description\":\"This interface can query the maximum amount of margin that the current position supports withdrawal.\",\"api-rate-limit\":10}" + } + }, + { + "name": "Add Isolated Margin", + "api": { + "id": "3470614", + "method": "post", + "path": "/api/v1/copy-trade/futures/position/margin/deposit-margin", + "parameters": { + "query": [], + "path": [], + "cookie": [], + "header": [] + }, + "responses": [ + { + "id": "11163", + "code": 200, + "name": "成功", + "headers": [], + "jsonSchema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Position ID" + }, + "symbol": { + "type": "string", + "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](apidog://link/endpoint/3470220) " + }, + "autoDeposit": { + "type": "boolean", + "description": "Auto deposit margin or not" + }, + "maintMarginReq": { + "type": "number", + "description": "Maintenance margin requirement\n\n" + }, + "riskLimit": { + "type": "integer", + "description": "Risk limit\n" + }, + "realLeverage": { + "type": "number", + "description": "Leverage o the order" + }, + "crossMode": { + "type": "boolean", + "description": "Cross mode or not" + }, + "delevPercentage": { + "type": "number", + "description": "ADL ranking percentile" + }, + "openingTimestamp": { + "type": "integer", + "description": "Open time", + "format": "int64" + }, + "currentTimestamp": { + "type": "integer", + "format": "int64", + "description": "Current timestamp\n" + }, + "currentQty": { + "type": "integer", + "description": "Current postion quantity" + }, + "currentCost": { + "type": "number", + "description": "Current postion value" + }, + "currentComm": { + "type": "number", + "description": "Current commission" + }, + "unrealisedCost": { + "type": "number", + "description": "Unrealised value" + }, + "realisedGrossCost": { + "type": "number", + "description": "Accumulated realised gross profit value" + }, + "realisedCost": { + "type": "number", + "description": "Current realised position value" + }, + "isOpen": { + "type": "boolean", + "description": "Opened position or not" + }, + "markPrice": { + "type": "number", + "description": "Mark price" + }, + "markValue": { + "type": "number", + "description": "Mark value\n" + }, + "posCost": { + "type": "number", + "description": "Position value" + }, + "posCross": { + "type": "number", + "description": "added margin" + }, + "posInit": { + "type": "number", + "description": "Leverage margin" + }, + "posComm": { + "type": "number", + "description": "Bankruptcy cost" + }, + "posLoss": { + "type": "number", + "description": "Funding fees paid out" + }, + "posMargin": { + "type": "number", + "description": "Position margin" + }, + "posMaint": { + "type": "number", + "description": "Maintenance margin" + }, + "maintMargin": { + "type": "number", + "description": "Position margin" + }, + "realisedGrossPnl": { + "type": "number", + "description": "Accumulated realised gross profit value" + }, + "realisedPnl": { + "type": "number", + "description": "Realised profit and loss" + }, + "unrealisedPnl": { + "type": "number", + "description": "Unrealised profit and loss" + }, + "unrealisedPnlPcnt": { + "type": "number", + "description": "Profit-loss ratio of the position" + }, + "unrealisedRoePcnt": { + "type": "number", + "description": "Rate of return on investment" + }, + "avgEntryPrice": { + "type": "number", + "description": "Average entry price" + }, + "liquidationPrice": { + "type": "number", + "description": "Liquidation price" + }, + "bankruptPrice": { + "type": "number", + "description": "Bankruptcy price" + }, + "userId": { + "type": "integer", + "description": "userId" + }, + "settleCurrency": { + "type": "string", + "description": "Currency used to clear and settle the trades" + } + }, + "required": [ + "id", + "symbol", + "autoDeposit", + "maintMarginReq", + "riskLimit", + "realLeverage", + "crossMode", + "delevPercentage", + "openingTimestamp", + "currentTimestamp", + "currentQty", + "currentCost", + "currentComm", + "unrealisedCost", + "realisedGrossCost", + "realisedCost", + "isOpen", + "markPrice", + "markValue", + "posCost", + "posCross", + "posInit", + "posComm", + "posLoss", + "posMargin", + "posMaint", + "maintMargin", + "realisedGrossPnl", + "realisedPnl", + "unrealisedPnl", + "unrealisedPnlPcnt", + "unrealisedRoePcnt", + "avgEntryPrice", + "liquidationPrice", + "bankruptPrice", + "userId", + "settleCurrency" + ] + } + }, + "required": [ + "code", + "data" + ] + }, + "description": "", + "contentType": "json", + "mediaType": "" + } + ], + "responseExamples": [ + { + "name": "Success", + "data": "{\n \"code\": \"200000\",\n \"data\": {\n \"id\": \"6200c9b83aecfb000152ddcd\",\n \"symbol\": \"XBTUSDTM\",\n \"autoDeposit\": false,\n \"maintMarginReq\": 0.005,\n \"riskLimit\": 500000,\n \"realLeverage\": 18.72,\n \"crossMode\": false,\n \"delevPercentage\": 0.66,\n \"openingTimestamp\": 1646287090131,\n \"currentTimestamp\": 1646295055021,\n \"currentQty\": 1,\n \"currentCost\": 43.388,\n \"currentComm\": 0.0260328,\n \"unrealisedCost\": 43.388,\n \"realisedGrossCost\": 0,\n \"realisedCost\": 0.0260328,\n \"isOpen\": true,\n \"markPrice\": 43536.65,\n \"markValue\": 43.53665,\n \"posCost\": 43.388,\n \"posCross\": 0.000024985,\n \"posInit\": 2.1694,\n \"posComm\": 0.02733446,\n \"posLoss\": 0,\n \"posMargin\": 2.19675944,\n \"posMaint\": 0.24861326,\n \"maintMargin\": 2.34540944,\n \"realisedGrossPnl\": 0,\n \"realisedPnl\": -0.0260328,\n \"unrealisedPnl\": 0.14865,\n \"unrealisedPnlPcnt\": 0.0034,\n \"unrealisedRoePcnt\": 0.0685,\n \"avgEntryPrice\": 43388,\n \"liquidationPrice\": 41440,\n \"bankruptPrice\": 41218,\n \"userId\": 1234321123,\n \"settleCurrency\": \"USDT\"\n }\n}", + "responseId": 11163, + "ordering": 1 + } + ], + "requestBody": { + "type": "application/json", + "parameters": [], + "jsonSchema": { + "type": "object", + "properties": { + "symbol": { + "type": "string", + "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](apidog://link/endpoint/3470220) " + }, + "margin": { + "type": "number", + "description": "Margin amount (min. margin amount≥0.00001667XBT)" + }, + "bizNo": { + "type": "string", + "description": "A unique ID generated by the user, to ensure the operation is processed by the system only once, The maximum length cannot exceed 36" + } + }, + "required": [ + "symbol", + "margin", + "bizNo" + ] + }, + "example": "{\n \"symbol\": \"string\",\n \"margin\": 0,\n \"bizNo\": \"string\"\n}", + "mediaType": "" + }, + "description": ":::info[Description]\nAdd Isolated Margin Manually.\n:::", + "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Futures\",\"api-channel\":\"Private\",\"api-permission\":\"Futures\",\"api-rate-limit-pool\":\"CopyTrading\",\"sdk-service\":\"CopyTrading\",\"sdk-sub-service\":\"Futures\",\"sdk-method-name\":\"AddIsolatedMargin\",\"sdk-method-description\":\"Add Isolated Margin Manually.\",\"api-rate-limit\":4}" + } + }, + { + "name": "Remove Isolated Margin", + "api": { + "id": "3470615", + "method": "post", + "path": "/api/v1/copy-trade/futures/position/margin/withdraw-margin", + "parameters": { + "query": [], + "path": [], + "cookie": [], + "header": [] + }, + "responses": [ + { + "id": "11164", + "code": 200, + "name": "成功", + "headers": [], + "jsonSchema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "string", + "description": "The size of the position deposited. If it is USDT-margin, it represents the amount of USDT. If it is coin-margin, this value represents the number of coins\n" + } + }, + "required": [ + "code", + "data" + ] + }, + "description": "", + "contentType": "json", + "mediaType": "" + } + ], + "responseExamples": [ + { + "name": "Success", + "data": "{\n \"code\": \"200000\",\n \"data\": \"0.1\"\n}", + "responseId": 11164, + "ordering": 1 + } + ], + "requestBody": { + "type": "application/json", + "parameters": [], + "jsonSchema": { + "type": "object", + "properties": { + "symbol": { + "type": "string", + "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](apidog://link/endpoint/3470220) " + }, + "withdrawAmount": { + "type": "string", + "description": "The size of the position that can be deposited. If it is USDT-margin, it represents the amount of USDT. If it is coin-margin, this value represents the number of coins\n" + } + }, + "required": [ + "symbol", + "withdrawAmount" + ] + }, + "example": "{\n \"symbol\": \"XBTUSDTM\",\n \"withdrawAmount\": \"0.0000001\"\n}", + "mediaType": "" + }, + "description": ":::info[Description]\nRemove Isolated Margin Manually.\n:::", + "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Futures\",\"api-channel\":\"Private\",\"api-permission\":\"Futures\",\"api-rate-limit-pool\":\"CopyTrading\",\"sdk-service\":\"CopyTrading\",\"sdk-sub-service\":\"Futures\",\"sdk-method-name\":\"RemoveIsolatedMargin\",\"sdk-method-description\":\"Remove Isolated Margin Manually.\",\"api-rate-limit\":10}" + } + }, + { + "name": "Modify Isolated Margin Risk Limit", + "api": { + "id": "3470613", + "method": "post", + "path": "/api/v1/copy-trade/futures/position/risk-limit-level/change", + "parameters": { + "query": [], + "path": [], + "cookie": [], + "header": [] + }, + "responses": [ + { + "id": "11103", + "code": 200, + "name": "成功", + "headers": [], + "jsonSchema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "boolean", + "description": "To adjust the level will cancel the open order, the response can only indicate whether the submit of the adjustment request is successful or not.\n" + } + }, + "required": [ + "code", + "data" + ] + }, + "description": "", + "contentType": "json", + "mediaType": "" + } + ], + "responseExamples": [ + { + "name": "Success", + "data": "{\r\n \"code\": \"200000\",\r\n \"data\": true\r\n}", + "responseId": 11103, + "ordering": 1 + } + ], + "requestBody": { + "type": "application/json", + "parameters": [], + "jsonSchema": { + "type": "object", + "properties": { + "symbol": { + "type": "string", + "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](apidog://link/endpoint/3470220) " + }, + "level": { + "type": "integer", + "description": "level" + } + }, + "required": [ + "symbol", + "level" + ] + }, + "example": "{\n \"symbol\" : \"XBTUSDTM\",\n \"level\" : 1\n}", + "mediaType": "" + }, + "description": ":::info[Description]\nThis interface is for the adjustment of the risk limit level(Only valid for isolated Margin). To adjust the level will cancel the open order, the response can only indicate whether the submit of the adjustment request is successful or not. The result of the adjustment can be achieved by WebSocket information: Position Change Events\n:::\n\n", + "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Futures\",\"api-channel\":\"Private\",\"api-permission\":\"Futures\",\"api-rate-limit-pool\":\"CopyTrading\",\"sdk-service\":\"CopyTrading\",\"sdk-sub-service\":\"Futures\",\"sdk-method-name\":\"modifyIsolatedMarginRiskLimt\",\"sdk-method-description\":\"This interface can be used to obtain information about risk limit level of a specific contract(Only valid for isolated Margin).\",\"api-rate-limit\":4}" + } + }, + { + "name": "Modify Isolated Margin Auto-Deposit Status", + "api": { + "id": "3470617", + "method": "post", + "path": "/api/v1/copy-trade/futures/position/margin/auto-deposit-status", + "parameters": { + "query": [], + "path": [], + "cookie": [], + "header": [] + }, + "responses": [ + { + "id": "11165", + "code": 200, + "name": "成功", + "headers": [], + "jsonSchema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "boolean" + } + }, + "required": [ + "code", + "data" + ] + }, + "description": "", + "contentType": "json", + "mediaType": "" + } + ], + "responseExamples": [ + { + "name": "Success", + "data": "{\n \"code\": \"200000\",\n \"data\": true\n}", + "responseId": 11165, + "ordering": 1 + } + ], + "requestBody": { + "type": "application/json", + "parameters": [], + "jsonSchema": { + "type": "object", + "properties": { + "symbol": { + "type": "string", + "description": "Symbol of the contract\n", + "examples": [ + "XBTUSDTM", + "ETHUSDTM" + ] + }, + "status": { + "type": "boolean", + "description": "Status" + } + }, + "required": [ + "symbol", + "status" + ] + }, + "example": "{\n \"symbol\": \"XBTUSDTM\",\n \"status\": true\n}", + "mediaType": "" + }, + "description": ":::info[Description]\nThis endpoint is only applicable to isolated margin and is no longer recommended. It is recommended to use cross margin instead.\n:::\n", + "customApiFields": "{\"abandon\":\"normal\",\"domain\":\"Futures\",\"api-channel\":\"Private\",\"api-permission\":\"Futures\",\"api-rate-limit-pool\":\"CopyTrading\",\"sdk-service\":\"CopyTrading\",\"sdk-sub-service\":\"Futures\",\"sdk-method-name\":\"modifyAutoDepositStatus\",\"sdk-method-description\":\"This endpoint is only applicable to isolated margin and is no longer recommended. It is recommended to use cross margin instead.\",\"api-rate-limit\":4}" + } + } + ] } ] }, diff --git a/spec/rest/api/openapi-copytrading-futures.json b/spec/rest/api/openapi-copytrading-futures.json new file mode 100644 index 00000000..4539d752 --- /dev/null +++ b/spec/rest/api/openapi-copytrading-futures.json @@ -0,0 +1,1651 @@ +{ + "openapi": "3.0.1", + "info": { + "title": "copytrading", + "description": "futures", + "version": "1.0.0" + }, + "tags": [], + "paths": { + "/api/v1/copy-trade/futures/orders": { + "post": { + "summary": "Add Order", + "deprecated": false, + "description": "Place order to the futures trading system, you can place two major types of orders: limit and market. Orders can only be placed if your account has sufficient funds. Once an order is placed, your funds will be put on hold for the duration of the order. The amount of funds on hold depends on the order type and parameters specified.", + "tags": [], + "parameters": [], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "object", + "properties": { + "orderId": { + "type": "string", + "description": "The unique order id generated by the trading system,which can be used later for further actions such as canceling the order." + }, + "clientOid": { + "type": "string", + "description": "The user self-defined order id." + } + }, + "required": [ + "orderId", + "clientOid" + ] + } + }, + "required": [ + "code", + "data" + ] + } + } + } + } + }, + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470363", + "x-abandon": "normal", + "x-domain": "Futures", + "x-api-channel": "Private", + "x-api-permission": "LeadtradeFutures", + "x-api-rate-limit-pool": "CopyTrading", + "x-sdk-service": "CopyTrading", + "x-sdk-sub-service": "Futures", + "x-sdk-method-name": "addOrder", + "x-sdk-method-description": "Place order to the futures trading system, you can place two major types of orders: limit and market. Orders can only be placed if your account has sufficient funds. Once an order is placed, your funds will be put on hold for the duration of the order. The amount of funds on hold depends on the order type and parameters specified.", + "x-api-rate-limit": 2, + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "clientOid": { + "type": "string", + "description": "Unique order id created by users to identify their orders, the maximum length cannot exceed 40, e.g. UUID, Only allows numbers, characters, underline(_), and separator(-)", + "example": [ + "5c52e11203aa677f33e493fb" + ] + }, + "side": { + "type": "string", + "description": "specify if the order is to 'buy' or 'sell' ", + "enum": [ + "buy", + "sell" + ], + "x-api-enum": [ + { + "value": "buy", + "name": "", + "description": "" + }, + { + "value": "sell", + "name": "", + "description": "" + } + ], + "example": [ + "buy" + ] + }, + "symbol": { + "type": "string", + "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) ", + "example": [ + "XBTUSDTM" + ] + }, + "leverage": { + "type": "integer", + "description": "Used to calculate the margin to be frozen for the order. If you are to close the position, this parameter is not required.", + "example": [ + 3 + ] + }, + "type": { + "type": "string", + "description": "specify if the order is an 'limit' order or 'market' order", + "enum": [ + "limit", + "market" + ], + "default": "limit", + "x-api-enum": [ + { + "value": "limit", + "name": "", + "description": "" + }, + { + "value": "market", + "name": "", + "description": "" + } + ], + "example": [ + "limit" + ] + }, + "remark": { + "type": "string", + "description": "remark for the order, length cannot exceed 100 utf8 characters" + }, + "stop": { + "type": "string", + "description": "Either 'down' or 'up'. If stop is used,parameter stopPrice and stopPriceType also need to be provieded.", + "enum": [ + "down", + "up" + ], + "x-api-enum": [ + { + "value": "down", + "name": "down", + "description": "Triggers when the price reaches or goes below the stopPrice." + }, + { + "value": "up", + "name": "up", + "description": "Triggers when the price reaches or goes above the stopPrice" + } + ] + }, + "stopPriceType": { + "type": "string", + "description": "Either 'TP', 'IP' or 'MP', Need to be defined if stop is specified.", + "enum": [ + "TP", + "MP", + "IP" + ], + "x-api-enum": [ + { + "value": "TP", + "name": "trade price", + "description": "TP for trade price, The last trade price is the last price at which an order was filled. This price can be found in the latest match message." + }, + { + "value": "MP", + "name": "mark price", + "description": "MP for mark price, The mark price can be obtained through relevant OPEN API for index services" + }, + { + "value": "IP", + "name": "index price", + "description": "IP for index price, The index price can be obtained through relevant OPEN API for index services" + } + ] + }, + "stopPrice": { + "type": "string", + "description": "Need to be defined if stop is specified. " + }, + "reduceOnly": { + "type": "boolean", + "description": "A mark to reduce the position size only. Set to false by default. Need to set the position size when reduceOnly is true. If set to true, only the orders reducing the position size will be executed. If the reduce-only order size exceeds the position size, the extra size will be canceled.", + "default": false + }, + "closeOrder": { + "type": "boolean", + "description": "A mark to close the position. Set to false by default. If closeOrder is set to true, the system will close the position and the position size will become 0. Side, Size and Leverage fields can be left empty and the system will determine the side and size automatically.", + "default": false + }, + "forceHold": { + "type": "boolean", + "description": "A mark to forcely hold the funds for an order, even though it's an order to reduce the position size. This helps the order stay on the order book and not get canceled when the position size changes. Set to false by default. The system will forcely freeze certain amount of funds for this order, including orders whose direction is opposite to the current positions. This feature is to ensure that the order won’t be canceled by the matching engine in such a circumstance that not enough funds are frozen for the order.", + "default": false + }, + "marginMode": { + "type": "string", + "description": "Margin mode: ISOLATED, CROSS, default: ISOLATED", + "enum": [ + "ISOLATED", + "CROSS" + ], + "default": "ISOLATED", + "x-api-enum": [ + { + "value": "ISOLATED", + "name": "ISOLATED", + "description": "Isolated Margin" + }, + { + "value": "CROSS", + "name": "CROSS", + "description": "Cross Margin" + } + ] + }, + "price": { + "type": "string", + "description": "Required for type is 'limit' order, indicating the operating price", + "example": [ + "0.1" + ] + }, + "size": { + "type": "integer", + "description": "Order size (Lot), must be a positive integer. The quantity unit of coin-swap contracts is size(lot), and other units are not supported." + }, + "timeInForce": { + "type": "string", + "description": "Optional for type is 'limit' order, [Time in force](https://www.kucoin.com/docs-new/doc-338146) is a special strategy used during trading, default is GTC", + "enum": [ + "GTC", + "IOC" + ], + "default": "GTC", + "x-api-enum": [ + { + "value": "GTC", + "name": "Good Till Canceled", + "description": "order remains open on the order book until canceled. This is the default type if the field is left empty." + }, + { + "value": "IOC", + "name": "Immediate Or Cancel", + "description": "being matched or not, the remaining size of the order will be instantly canceled instead of entering the order book." + } + ] + }, + "postOnly": { + "type": "boolean", + "description": "Optional for type is 'limit' order, post only flag, invalid when timeInForce is IOC. When postOnly is true, not allowed choose hidden or iceberg. The post-only flag ensures that the trader always pays the maker fee and provides liquidity to the order book. If any part of the order is going to pay taker fee, the order will be fully rejected.", + "default": false + }, + "hidden": { + "type": "boolean", + "description": "Optional for type is 'limit' order, orders not displaying in order book. When hidden chose, not allowed choose postOnly.", + "default": false + }, + "iceberg": { + "type": "boolean", + "description": "Optional for type is 'limit' order, Only visible portion of the order is displayed in the order book. When iceberg chose, not allowed choose postOnly.", + "default": false + }, + "visibleSize": { + "type": "string", + "description": "Optional for type is 'limit' order, The maximum visible size of an iceberg order. please place order in size (lots), The units of qty (base currency) and valueQty (value) are not supported." + } + }, + "required": [ + "clientOid", + "symbol", + "side", + "type", + "size" + ] + }, + "example": "{\n \"clientOid\": \"5c52e11203aa677f33e493fb\",\n \"side\": \"buy\",\n \"symbol\": \"XBTUSDTM\",\n \"leverage\": 3,\n \"type\": \"limit\",\n \"remark\": \"order remarks\",\n \"reduceOnly\": false,\n \"marginMode\": \"ISOLATED\",\n \"price\": \"0.1\",\n \"size\": 1,\n \"timeInForce\": \"GTC\"\n}" + } + } + }, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"orderId\\\": \\\"263485113055133696\\\",\\n \\\"clientOid\\\": \\\"5c52e11203aa677f331e493fb\\\"\\n }\\n}", + "x-request-example": "{\\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\", \\\"side\\\": \\\"buy\\\", \\\"symbol\\\": \\\"XBTUSDTM\\\", \\\"leverage\\\": 3, \\\"type\\\": \\\"limit\\\", \\\"remark\\\": \\\"order remarks\\\", \\\"reduceOnly\\\": false, \\\"marginMode\\\": \\\"ISOLATED\\\", \\\"price\\\": \\\"0.1\\\", \\\"size\\\": 1, \\\"timeInForce\\\": \\\"GTC\\\"}", + "operationId": "001" + }, + "delete": { + "summary": "Cancel Order By OrderId", + "deprecated": false, + "description": "Cancel order by system generated orderId.", + "tags": [], + "parameters": [ + { + "name": "orderId", + "in": "query", + "description": "Order id", + "required": false, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "object", + "properties": { + "cancelledOrderIds": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The orderId that is to be canceled" + } + }, + "required": [ + "cancelledOrderIds" + ] + } + }, + "required": [ + "code", + "data" + ] + } + } + } + } + }, + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470620", + "x-abandon": "normal", + "x-domain": "Futures", + "x-api-channel": "Private", + "x-api-permission": "Futures", + "x-api-rate-limit-pool": "CopyTrading", + "x-sdk-service": "CopyTrading", + "x-sdk-sub-service": "Futures", + "x-sdk-method-name": "cancelOrderById", + "x-sdk-method-description": "Cancel order by system generated orderId.", + "x-api-rate-limit": 1, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"cancelledOrderIds\\\": [\\n \\\"263485113055133696\\\"\\n ]\\n }\\n}", + "x-request-example": "{\\\"orderId\\\": \\\"263485113055133696\\\"}", + "operationId": "004" + } + }, + "/api/v1/copy-trade/futures/orders/test": { + "post": { + "summary": "Add Order Test", + "deprecated": false, + "description": "Place order to the futures trading system just for validation", + "tags": [], + "parameters": [], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "object", + "properties": { + "orderId": { + "type": "string", + "description": "The unique order id generated by the trading system,which can be used later for further actions such as canceling the order." + }, + "clientOid": { + "type": "string", + "description": "The user self-defined order id." + } + }, + "required": [ + "orderId", + "clientOid" + ] + } + }, + "required": [ + "code", + "data" + ] + } + } + } + } + }, + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470618", + "x-abandon": "normal", + "x-domain": "Futures", + "x-api-channel": "Private", + "x-api-permission": "Futures", + "x-api-rate-limit-pool": "CopyTrading", + "x-sdk-service": "CopyTrading", + "x-sdk-sub-service": "Futures", + "x-sdk-method-name": "addOrderTest", + "x-sdk-method-description": "Place order to the futures trading system just for validation", + "x-api-rate-limit": 2, + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "clientOid": { + "type": "string", + "description": "Unique order id created by users to identify their orders, the maximum length cannot exceed 40, e.g. UUID, Only allows numbers, characters, underline(_), and separator(-)", + "example": [ + "5c52e11203aa677f33e493fb" + ] + }, + "side": { + "type": "string", + "description": "specify if the order is to 'buy' or 'sell'", + "enum": [ + "buy", + "sell" + ], + "x-api-enum": [ + { + "value": "buy", + "name": "", + "description": "" + }, + { + "value": "sell", + "name": "", + "description": "" + } + ], + "example": [ + "buy" + ] + }, + "symbol": { + "type": "string", + "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) ", + "example": [ + "XBTUSDTM" + ] + }, + "leverage": { + "type": "integer", + "description": "Used to calculate the margin to be frozen for the order. If you are to close the position, this parameter is not required.", + "example": [ + 3 + ] + }, + "type": { + "type": "string", + "description": "specify if the order is an 'limit' order or 'market' order", + "enum": [ + "limit", + "market" + ], + "default": "limit", + "x-api-enum": [ + { + "value": "limit", + "name": "", + "description": "" + }, + { + "value": "market", + "name": "", + "description": "" + } + ], + "example": [ + "limit" + ] + }, + "remark": { + "type": "string", + "description": "remark for the order, length cannot exceed 100 utf8 characters" + }, + "stop": { + "type": "string", + "description": "Either 'down' or 'up'. If stop is used,parameter stopPrice and stopPriceType also need to be provieded.", + "enum": [ + "down", + "up" + ], + "x-api-enum": [ + { + "value": "down", + "name": "down", + "description": "Triggers when the price reaches or goes below the stopPrice." + }, + { + "value": "up", + "name": "up", + "description": "Triggers when the price reaches or goes above the stopPrice" + } + ] + }, + "stopPriceType": { + "type": "string", + "description": "Either 'TP', 'IP' or 'MP', Need to be defined if stop is specified.", + "enum": [ + "TP", + "MP", + "IP" + ], + "x-api-enum": [ + { + "value": "TP", + "name": "trade price", + "description": "TP for trade price, The last trade price is the last price at which an order was filled. This price can be found in the latest match message." + }, + { + "value": "MP", + "name": "mark price", + "description": "MP for mark price, The mark price can be obtained through relevant OPEN API for index services" + }, + { + "value": "IP", + "name": "index price", + "description": "IP for index price, The index price can be obtained through relevant OPEN API for index services" + } + ] + }, + "stopPrice": { + "type": "string", + "description": "Need to be defined if stop is specified. " + }, + "reduceOnly": { + "type": "boolean", + "description": "A mark to reduce the position size only. Set to false by default. Need to set the position size when reduceOnly is true. If set to true, only the orders reducing the position size will be executed. If the reduce-only order size exceeds the position size, the extra size will be canceled.", + "default": false + }, + "closeOrder": { + "type": "boolean", + "description": "A mark to close the position. Set to false by default. If closeOrder is set to true, the system will close the position and the position size will become 0. Side, Size and Leverage fields can be left empty and the system will determine the side and size automatically.", + "default": false + }, + "forceHold": { + "type": "boolean", + "description": "A mark to forcely hold the funds for an order, even though it's an order to reduce the position size. This helps the order stay on the order book and not get canceled when the position size changes. Set to false by default. The system will forcely freeze certain amount of funds for this order, including orders whose direction is opposite to the current positions. This feature is to ensure that the order won’t be canceled by the matching engine in such a circumstance that not enough funds are frozen for the order.", + "default": false + }, + "marginMode": { + "type": "string", + "description": "Margin mode: ISOLATED, CROSS, default: ISOLATED", + "enum": [ + "ISOLATED", + "CROSS" + ], + "default": "ISOLATED", + "x-api-enum": [ + { + "value": "ISOLATED", + "name": "", + "description": "" + }, + { + "value": "CROSS", + "name": "", + "description": "" + } + ] + }, + "price": { + "type": "string", + "description": "Required for type is 'limit' order, indicating the operating price", + "example": [ + "0.1" + ] + }, + "size": { + "type": "integer", + "description": "Order size (Lot), must be a positive integer. The quantity unit of coin-swap contracts is size(lot), and other units are not supported." + }, + "timeInForce": { + "type": "string", + "description": "Optional for type is 'limit' order, [Time in force](https://www.kucoin.com/docs-new/doc-338146) is a special strategy used during trading, default is GTC", + "enum": [ + "GTC", + "IOC" + ], + "default": "GTC", + "x-api-enum": [ + { + "value": "GTC", + "name": "Good Till Canceled", + "description": "order remains open on the order book until canceled. This is the default type if the field is left empty." + }, + { + "value": "IOC", + "name": "Immediate Or Cancel", + "description": "being matched or not, the remaining size of the order will be instantly canceled instead of entering the order book." + } + ] + }, + "postOnly": { + "type": "boolean", + "description": "Optional for type is 'limit' order, post only flag, invalid when timeInForce is IOC. When postOnly is true, not allowed choose hidden or iceberg. The post-only flag ensures that the trader always pays the maker fee and provides liquidity to the order book. If any part of the order is going to pay taker fee, the order will be fully rejected.", + "default": false + }, + "hidden": { + "type": "boolean", + "description": "Optional for type is 'limit' order, orders not displaying in order book. When hidden chose, not allowed choose postOnly.", + "default": false + }, + "iceberg": { + "type": "boolean", + "description": "Optional for type is 'limit' order, Only visible portion of the order is displayed in the order book. When iceberg chose, not allowed choose postOnly.", + "default": false + }, + "visibleSize": { + "type": "string", + "description": "Optional for type is 'limit' order, The maximum visible size of an iceberg order. please place order in size (lots), The units of qty (base currency) and valueQty (value) are not supported." + } + }, + "required": [ + "clientOid", + "symbol", + "type", + "side", + "leverage", + "size" + ] + }, + "example": "{\n \"clientOid\": \"5c52e11203aa677f33e493fb\",\n \"side\": \"buy\",\n \"symbol\": \"XBTUSDTM\",\n \"leverage\": 3,\n \"type\": \"limit\",\n \"remark\": \"order remarks\",\n \"reduceOnly\": false,\n \"marginMode\": \"ISOLATED\",\n \"price\": \"0.1\",\n \"size\": 1,\n \"timeInForce\": \"GTC\"\n}" + } + } + }, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"orderId\\\": \\\"234125150956625920\\\",\\n \\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\"\\n }\\n}", + "x-request-example": "{\\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\", \\\"side\\\": \\\"buy\\\", \\\"symbol\\\": \\\"XBTUSDTM\\\", \\\"leverage\\\": 3, \\\"type\\\": \\\"limit\\\", \\\"remark\\\": \\\"order remarks\\\", \\\"reduceOnly\\\": false, \\\"marginMode\\\": \\\"ISOLATED\\\", \\\"price\\\": \\\"0.1\\\", \\\"size\\\": 1, \\\"timeInForce\\\": \\\"GTC\\\"}", + "operationId": "002" + } + }, + "/api/v1/copy-trade/futures/st-orders": { + "post": { + "summary": "Add Take Profit And Stop Loss Order", + "deprecated": false, + "description": "Place take profit and stop loss order supports both take-profit and stop-loss functions, and other functions are exactly the same as the place order interface.", + "tags": [], + "parameters": [], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "object", + "properties": { + "orderId": { + "type": "string", + "description": "The unique order id generated by the trading system,which can be used later for further actions such as canceling the order." + }, + "clientOid": { + "type": "string", + "description": "The user self-defined order id." + } + }, + "required": [ + "orderId", + "clientOid" + ] + } + }, + "required": [ + "code", + "data" + ] + } + } + } + } + }, + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470619", + "x-abandon": "normal", + "x-domain": "Futures", + "x-api-channel": "Private", + "x-api-permission": "Futures", + "x-api-rate-limit-pool": "CopyTrading", + "x-sdk-service": "CopyTrading", + "x-sdk-sub-service": "Futures", + "x-sdk-method-name": "addTPSLOrder", + "x-sdk-method-description": "Place take profit and stop loss order supports both take-profit and stop-loss functions, and other functions are exactly the same as the place order interface.", + "x-api-rate-limit": 2, + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "clientOid": { + "type": "string", + "description": "Unique order id created by users to identify their orders, the maximum length cannot exceed 40, e.g. UUID, Only allows numbers, characters, underline(_), and separator(-)", + "example": [ + "5c52e11203aa677f33e493fb" + ] + }, + "side": { + "type": "string", + "description": "specify if the order is to 'buy' or 'sell'", + "enum": [ + "buy", + "sell" + ], + "x-api-enum": [ + { + "value": "buy", + "name": "", + "description": "" + }, + { + "value": "sell", + "name": "", + "description": "" + } + ], + "example": [ + "buy" + ] + }, + "symbol": { + "type": "string", + "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) ", + "example": [ + "XBTUSDTM" + ] + }, + "leverage": { + "type": "integer", + "description": "Used to calculate the margin to be frozen for the order. If you are to close the position, this parameter is not required.", + "example": [ + 3 + ] + }, + "type": { + "type": "string", + "description": "specify if the order is an 'limit' order or 'market' order", + "enum": [ + "limit", + "market" + ], + "default": "limit", + "x-api-enum": [ + { + "value": "limit", + "name": "limit", + "description": "limit order" + }, + { + "value": "market", + "name": "market", + "description": "market order" + } + ], + "example": [ + "limit" + ] + }, + "remark": { + "type": "string", + "description": "remark for the order, length cannot exceed 100 utf8 characters" + }, + "stopPriceType": { + "type": "string", + "description": "Either 'TP', 'IP' or 'MP'", + "enum": [ + "TP", + "MP", + "IP" + ], + "x-api-enum": [ + { + "value": "TP", + "name": "trade price", + "description": "TP for trade price, The last trade price is the last price at which an order was filled. This price can be found in the latest match message." + }, + { + "value": "MP", + "name": "mark price", + "description": "MP for mark price, The mark price can be obtained through relevant OPEN API for index services" + }, + { + "value": "IP", + "name": "index price", + "description": "IP for index price, The index price can be obtained through relevant OPEN API for index services" + } + ] + }, + "reduceOnly": { + "type": "boolean", + "description": "A mark to reduce the position size only. Set to false by default. Need to set the position size when reduceOnly is true. If set to true, only the orders reducing the position size will be executed. If the reduce-only order size exceeds the position size, the extra size will be canceled.", + "default": false + }, + "closeOrder": { + "type": "boolean", + "description": "A mark to close the position. Set to false by default. If closeOrder is set to true, the system will close the position and the position size will become 0. Side, Size and Leverage fields can be left empty and the system will determine the side and size automatically.", + "default": false + }, + "forceHold": { + "type": "boolean", + "description": "A mark to forcely hold the funds for an order, even though it's an order to reduce the position size. This helps the order stay on the order book and not get canceled when the position size changes. Set to false by default. The system will forcely freeze certain amount of funds for this order, including orders whose direction is opposite to the current positions. This feature is to ensure that the order won’t be canceled by the matching engine in such a circumstance that not enough funds are frozen for the order.", + "default": false + }, + "marginMode": { + "type": "string", + "description": "Margin mode: ISOLATED, CROSS, default: ISOLATED", + "enum": [ + "ISOLATED", + "CROSS" + ], + "default": "ISOLATED", + "x-api-enum": [ + { + "value": "ISOLATED", + "name": "", + "description": "" + }, + { + "value": "CROSS", + "name": "", + "description": "" + } + ] + }, + "price": { + "type": "string", + "description": "Required for type is 'limit' order, indicating the operating price", + "example": [ + "0.1" + ] + }, + "size": { + "type": "integer", + "description": "Order size (Lot), must be a positive integer. The quantity unit of coin-swap contracts is size(lot), and other units are not supported." + }, + "timeInForce": { + "type": "string", + "description": "Optional for type is 'limit' order, [Time in force](https://www.kucoin.com/docs-new/doc-338146) is a special strategy used during trading, default is GTC", + "enum": [ + "GTC", + "IOC" + ], + "default": "GTC", + "x-api-enum": [ + { + "value": "GTC", + "name": "Good Till Canceled", + "description": "order remains open on the order book until canceled. This is the default type if the field is left empty." + }, + { + "value": "IOC", + "name": "Immediate Or Cancel", + "description": "being matched or not, the remaining size of the order will be instantly canceled instead of entering the order book." + } + ] + }, + "postOnly": { + "type": "boolean", + "description": "Optional for type is 'limit' order, post only flag, invalid when timeInForce is IOC. When postOnly is true, not allowed choose hidden or iceberg. The post-only flag ensures that the trader always pays the maker fee and provides liquidity to the order book. If any part of the order is going to pay taker fee, the order will be fully rejected.", + "default": false + }, + "hidden": { + "type": "boolean", + "description": "Optional for type is 'limit' order, orders not displaying in order book. When hidden chose, not allowed choose postOnly.", + "default": false + }, + "iceberg": { + "type": "boolean", + "description": "Optional for type is 'limit' order, Only visible portion of the order is displayed in the order book. When iceberg chose, not allowed choose postOnly.", + "default": false + }, + "visibleSize": { + "type": "string", + "description": "Optional for type is 'limit' order, The maximum visible size of an iceberg order. please place order in size (lots), The units of qty (base currency) and valueQty (value) are not supported." + }, + "triggerStopUpPrice": { + "type": "string", + "description": "Take profit price" + }, + "triggerStopDownPrice": { + "type": "string", + "description": "Stop loss price" + } + }, + "required": [ + "clientOid", + "symbol", + "type", + "side", + "leverage", + "size" + ] + }, + "example": "{\n \"clientOid\": \"5c52e11203aa677f33e493fb\",\n \"side\": \"buy\",\n \"symbol\": \"XBTUSDTM\",\n \"leverage\": 3,\n \"type\": \"limit\",\n \"remark\": \"order remarks\",\n \"reduceOnly\": false,\n \"marginMode\": \"ISOLATED\",\n \"price\": \"0.2\",\n \"size\": 1,\n \"timeInForce\": \"GTC\",\n \"triggerStopUpPrice\": \"0.3\",\n \"triggerStopDownPrice\": \"0.1\",\n \"stopPriceType\": \"TP\"\n}" + } + } + }, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"orderId\\\": \\\"234125150956625920\\\",\\n \\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\"\\n }\\n}", + "x-request-example": "{\\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\", \\\"side\\\": \\\"buy\\\", \\\"symbol\\\": \\\"XBTUSDTM\\\", \\\"leverage\\\": 3, \\\"type\\\": \\\"limit\\\", \\\"remark\\\": \\\"order remarks\\\", \\\"reduceOnly\\\": false, \\\"marginMode\\\": \\\"ISOLATED\\\", \\\"price\\\": \\\"0.2\\\", \\\"size\\\": 1, \\\"timeInForce\\\": \\\"GTC\\\", \\\"triggerStopUpPrice\\\": \\\"0.3\\\", \\\"triggerStopDownPrice\\\": \\\"0.1\\\", \\\"stopPriceType\\\": \\\"TP\\\"}", + "operationId": "003" + } + }, + "/api/v1/copy-trade/futures/orders/client-order": { + "delete": { + "summary": "Cancel Order By ClientOid", + "deprecated": false, + "description": "Cancel order by client defined orderId.", + "tags": [], + "parameters": [ + { + "name": "symbol", + "in": "query", + "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) ", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "clientOid", + "in": "query", + "description": "The user self-defined order id.", + "required": false, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "object", + "properties": { + "clientOid": { + "type": "string" + } + }, + "required": [ + "clientOid" + ] + } + }, + "required": [ + "code", + "data" + ] + } + } + } + } + }, + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470621", + "x-abandon": "normal", + "x-domain": "Futures", + "x-api-channel": "Private", + "x-api-permission": "Futures", + "x-api-rate-limit-pool": "CopyTrading", + "x-sdk-service": "CopyTrading", + "x-sdk-sub-service": "Futures", + "x-sdk-method-name": "cancelOrderByClientOid", + "x-sdk-method-description": "Cancel order by client defined orderId.", + "x-api-rate-limit": 1, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"clientOid\\\": \\\"5c52e11203aa677f331e4913fb\\\"\\n }\\n}", + "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDTM\\\", \\\"clientOid\\\": \\\"5c52e11203aa677f331e493fb\\\"}", + "operationId": "005" + } + }, + "/api/v1/copy-trade/futures/get-max-open-size": { + "get": { + "summary": "Get Max Open Size", + "deprecated": false, + "description": "Get Maximum Open Position Size.", + "tags": [], + "parameters": [ + { + "name": "symbol", + "in": "query", + "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) ", + "required": true, + "schema": { + "type": "string", + "example": [ + "XBTUSDTM", + "XBTUSDM", + "ETHUSDTM" + ] + } + }, + { + "name": "price", + "in": "query", + "description": "Order price\n", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "leverage", + "in": "query", + "description": "Leverage\n", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "object", + "properties": { + "symbol": { + "type": "string", + "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) " + }, + "maxBuyOpenSize": { + "type": "integer", + "description": "Maximum buy size\n" + }, + "maxSellOpenSize": { + "type": "integer", + "description": "Maximum buy size\n" + } + }, + "required": [ + "symbol", + "maxBuyOpenSize", + "maxSellOpenSize" + ] + } + }, + "required": [ + "code", + "data" + ] + } + } + } + } + }, + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470612", + "x-abandon": "normal", + "x-domain": "Futures", + "x-api-channel": "Private", + "x-api-permission": "Futures", + "x-api-rate-limit-pool": "CopyTrading", + "x-sdk-service": "CopyTrading", + "x-sdk-sub-service": "Futures", + "x-sdk-method-name": "GetMaxOpenSize", + "x-sdk-method-description": "Get Maximum Open Position Size.", + "x-api-rate-limit": 2, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"maxBuyOpenSize\\\": 8,\\n \\\"maxSellOpenSize\\\": 5\\n }\\n}", + "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDTM\\\", \\\"price\\\": \\\"example_string_default_value\\\", \\\"leverage\\\": 123456}", + "operationId": "006" + } + }, + "/api/v1/copy-trade/futures/position/margin/max-withdraw-margin": { + "get": { + "summary": "Get Max Withdraw Margin", + "deprecated": false, + "description": "This interface can query the maximum amount of margin that the current position supports withdrawal.", + "tags": [], + "parameters": [ + { + "name": "symbol", + "in": "query", + "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) ", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "string", + "description": "The size of the position that can be deposited. If it is USDT-margin, it represents the amount of USDT. If it is coin-margin, this value represents the number of coins\n" + } + }, + "required": [ + "code", + "data" + ] + } + } + } + } + }, + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470616", + "x-abandon": "normal", + "x-domain": "Futures", + "x-api-channel": "Private", + "x-api-permission": "Futures", + "x-api-rate-limit-pool": "CopyTrading", + "x-sdk-service": "CopyTrading", + "x-sdk-sub-service": "Futures", + "x-sdk-method-name": "GetMaxWithdrawMargin", + "x-sdk-method-description": "This interface can query the maximum amount of margin that the current position supports withdrawal.", + "x-api-rate-limit": 10, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": \\\"21.1135719252\\\"\\n}", + "x-request-example": "{\\\"symbol\\\": \\\"example_string_default_value\\\"}", + "operationId": "007" + } + }, + "/api/v1/copy-trade/futures/position/margin/deposit-margin": { + "post": { + "summary": "Add Isolated Margin", + "deprecated": false, + "description": "Add Isolated Margin Manually.", + "tags": [], + "parameters": [], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Position ID" + }, + "symbol": { + "type": "string", + "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) " + }, + "autoDeposit": { + "type": "boolean", + "description": "Auto deposit margin or not" + }, + "maintMarginReq": { + "type": "number", + "description": "Maintenance margin requirement\n\n" + }, + "riskLimit": { + "type": "integer", + "description": "Risk limit\n" + }, + "realLeverage": { + "type": "number", + "description": "Leverage o the order" + }, + "crossMode": { + "type": "boolean", + "description": "Cross mode or not" + }, + "delevPercentage": { + "type": "number", + "description": "ADL ranking percentile" + }, + "openingTimestamp": { + "type": "integer", + "description": "Open time", + "format": "int64" + }, + "currentTimestamp": { + "type": "integer", + "format": "int64", + "description": "Current timestamp\n" + }, + "currentQty": { + "type": "integer", + "description": "Current postion quantity" + }, + "currentCost": { + "type": "number", + "description": "Current postion value" + }, + "currentComm": { + "type": "number", + "description": "Current commission" + }, + "unrealisedCost": { + "type": "number", + "description": "Unrealised value" + }, + "realisedGrossCost": { + "type": "number", + "description": "Accumulated realised gross profit value" + }, + "realisedCost": { + "type": "number", + "description": "Current realised position value" + }, + "isOpen": { + "type": "boolean", + "description": "Opened position or not" + }, + "markPrice": { + "type": "number", + "description": "Mark price" + }, + "markValue": { + "type": "number", + "description": "Mark value\n" + }, + "posCost": { + "type": "number", + "description": "Position value" + }, + "posCross": { + "type": "number", + "description": "added margin" + }, + "posInit": { + "type": "number", + "description": "Leverage margin" + }, + "posComm": { + "type": "number", + "description": "Bankruptcy cost" + }, + "posLoss": { + "type": "number", + "description": "Funding fees paid out" + }, + "posMargin": { + "type": "number", + "description": "Position margin" + }, + "posMaint": { + "type": "number", + "description": "Maintenance margin" + }, + "maintMargin": { + "type": "number", + "description": "Position margin" + }, + "realisedGrossPnl": { + "type": "number", + "description": "Accumulated realised gross profit value" + }, + "realisedPnl": { + "type": "number", + "description": "Realised profit and loss" + }, + "unrealisedPnl": { + "type": "number", + "description": "Unrealised profit and loss" + }, + "unrealisedPnlPcnt": { + "type": "number", + "description": "Profit-loss ratio of the position" + }, + "unrealisedRoePcnt": { + "type": "number", + "description": "Rate of return on investment" + }, + "avgEntryPrice": { + "type": "number", + "description": "Average entry price" + }, + "liquidationPrice": { + "type": "number", + "description": "Liquidation price" + }, + "bankruptPrice": { + "type": "number", + "description": "Bankruptcy price" + }, + "userId": { + "type": "integer", + "description": "userId" + }, + "settleCurrency": { + "type": "string", + "description": "Currency used to clear and settle the trades" + } + }, + "required": [ + "id", + "symbol", + "autoDeposit", + "maintMarginReq", + "riskLimit", + "realLeverage", + "crossMode", + "delevPercentage", + "openingTimestamp", + "currentTimestamp", + "currentQty", + "currentCost", + "currentComm", + "unrealisedCost", + "realisedGrossCost", + "realisedCost", + "isOpen", + "markPrice", + "markValue", + "posCost", + "posCross", + "posInit", + "posComm", + "posLoss", + "posMargin", + "posMaint", + "maintMargin", + "realisedGrossPnl", + "realisedPnl", + "unrealisedPnl", + "unrealisedPnlPcnt", + "unrealisedRoePcnt", + "avgEntryPrice", + "liquidationPrice", + "bankruptPrice", + "userId", + "settleCurrency" + ] + } + }, + "required": [ + "code", + "data" + ] + } + } + } + } + }, + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470614", + "x-abandon": "normal", + "x-domain": "Futures", + "x-api-channel": "Private", + "x-api-permission": "Futures", + "x-api-rate-limit-pool": "CopyTrading", + "x-sdk-service": "CopyTrading", + "x-sdk-sub-service": "Futures", + "x-sdk-method-name": "AddIsolatedMargin", + "x-sdk-method-description": "Add Isolated Margin Manually.", + "x-api-rate-limit": 4, + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "symbol": { + "type": "string", + "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) " + }, + "margin": { + "type": "number", + "description": "Margin amount (min. margin amount≥0.00001667XBT)" + }, + "bizNo": { + "type": "string", + "description": "A unique ID generated by the user, to ensure the operation is processed by the system only once, The maximum length cannot exceed 36" + } + }, + "required": [ + "symbol", + "margin", + "bizNo" + ] + }, + "example": "{\n \"symbol\": \"string\",\n \"margin\": 0,\n \"bizNo\": \"string\"\n}" + } + } + }, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"id\\\": \\\"6200c9b83aecfb000152ddcd\\\",\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"autoDeposit\\\": false,\\n \\\"maintMarginReq\\\": 0.005,\\n \\\"riskLimit\\\": 500000,\\n \\\"realLeverage\\\": 18.72,\\n \\\"crossMode\\\": false,\\n \\\"delevPercentage\\\": 0.66,\\n \\\"openingTimestamp\\\": 1646287090131,\\n \\\"currentTimestamp\\\": 1646295055021,\\n \\\"currentQty\\\": 1,\\n \\\"currentCost\\\": 43.388,\\n \\\"currentComm\\\": 0.0260328,\\n \\\"unrealisedCost\\\": 43.388,\\n \\\"realisedGrossCost\\\": 0,\\n \\\"realisedCost\\\": 0.0260328,\\n \\\"isOpen\\\": true,\\n \\\"markPrice\\\": 43536.65,\\n \\\"markValue\\\": 43.53665,\\n \\\"posCost\\\": 43.388,\\n \\\"posCross\\\": 0.000024985,\\n \\\"posInit\\\": 2.1694,\\n \\\"posComm\\\": 0.02733446,\\n \\\"posLoss\\\": 0,\\n \\\"posMargin\\\": 2.19675944,\\n \\\"posMaint\\\": 0.24861326,\\n \\\"maintMargin\\\": 2.34540944,\\n \\\"realisedGrossPnl\\\": 0,\\n \\\"realisedPnl\\\": -0.0260328,\\n \\\"unrealisedPnl\\\": 0.14865,\\n \\\"unrealisedPnlPcnt\\\": 0.0034,\\n \\\"unrealisedRoePcnt\\\": 0.0685,\\n \\\"avgEntryPrice\\\": 43388,\\n \\\"liquidationPrice\\\": 41440,\\n \\\"bankruptPrice\\\": 41218,\\n \\\"userId\\\": 1234321123,\\n \\\"settleCurrency\\\": \\\"USDT\\\"\\n }\\n}", + "x-request-example": "{\\\"symbol\\\": \\\"string\\\", \\\"margin\\\": 0, \\\"bizNo\\\": \\\"string\\\"}", + "operationId": "008" + } + }, + "/api/v1/copy-trade/futures/position/margin/withdraw-margin": { + "post": { + "summary": "Remove Isolated Margin", + "deprecated": false, + "description": "Remove Isolated Margin Manually.", + "tags": [], + "parameters": [], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "string", + "description": "The size of the position deposited. If it is USDT-margin, it represents the amount of USDT. If it is coin-margin, this value represents the number of coins\n" + } + }, + "required": [ + "code", + "data" + ] + } + } + } + } + }, + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470615", + "x-abandon": "normal", + "x-domain": "Futures", + "x-api-channel": "Private", + "x-api-permission": "Futures", + "x-api-rate-limit-pool": "CopyTrading", + "x-sdk-service": "CopyTrading", + "x-sdk-sub-service": "Futures", + "x-sdk-method-name": "RemoveIsolatedMargin", + "x-sdk-method-description": "Remove Isolated Margin Manually.", + "x-api-rate-limit": 10, + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "symbol": { + "type": "string", + "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) " + }, + "withdrawAmount": { + "type": "string", + "description": "The size of the position that can be deposited. If it is USDT-margin, it represents the amount of USDT. If it is coin-margin, this value represents the number of coins\n" + } + }, + "required": [ + "symbol", + "withdrawAmount" + ] + }, + "example": "{\n \"symbol\": \"XBTUSDTM\",\n \"withdrawAmount\": \"0.0000001\"\n}" + } + } + }, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": \\\"0.1\\\"\\n}", + "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDTM\\\", \\\"withdrawAmount\\\": \\\"0.0000001\\\"}", + "operationId": "009" + } + }, + "/api/v1/copy-trade/futures/position/risk-limit-level/change": { + "post": { + "summary": "Modify Isolated Margin Risk Limit", + "deprecated": false, + "description": "This interface can be used to obtain information about risk limit level of a specific contract(Only valid for isolated Margin).", + "tags": [], + "parameters": [], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "boolean", + "description": "To adjust the level will cancel the open order, the response can only indicate whether the submit of the adjustment request is successful or not.\n" + } + }, + "required": [ + "code", + "data" + ] + } + } + } + } + }, + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470613", + "x-abandon": "normal", + "x-domain": "Futures", + "x-api-channel": "Private", + "x-api-permission": "Futures", + "x-api-rate-limit-pool": "CopyTrading", + "x-sdk-service": "CopyTrading", + "x-sdk-sub-service": "Futures", + "x-sdk-method-name": "modifyIsolatedMarginRiskLimt", + "x-sdk-method-description": "This interface can be used to obtain information about risk limit level of a specific contract(Only valid for isolated Margin).", + "x-api-rate-limit": 4, + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "symbol": { + "type": "string", + "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) " + }, + "level": { + "type": "integer", + "description": "level" + } + }, + "required": [ + "symbol", + "level" + ] + }, + "example": "{\n \"symbol\" : \"XBTUSDTM\",\n \"level\" : 1\n}" + } + } + }, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": true\\n}", + "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDTM\\\", \\\"level\\\": 1}", + "operationId": "010" + } + }, + "/api/v1/copy-trade/futures/position/margin/auto-deposit-status": { + "post": { + "summary": "Modify Isolated Margin Auto-Deposit Status", + "deprecated": false, + "description": "This endpoint is only applicable to isolated margin and is no longer recommended. It is recommended to use cross margin instead.", + "tags": [], + "parameters": [], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "boolean" + } + }, + "required": [ + "code", + "data" + ] + } + } + } + } + }, + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470617", + "x-abandon": "normal", + "x-domain": "Futures", + "x-api-channel": "Private", + "x-api-permission": "Futures", + "x-api-rate-limit-pool": "CopyTrading", + "x-sdk-service": "CopyTrading", + "x-sdk-sub-service": "Futures", + "x-sdk-method-name": "modifyAutoDepositStatus", + "x-sdk-method-description": "This endpoint is only applicable to isolated margin and is no longer recommended. It is recommended to use cross margin instead.", + "x-api-rate-limit": 4, + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "symbol": { + "type": "string", + "description": "Symbol of the contract\n", + "example": [ + "XBTUSDTM", + "ETHUSDTM" + ] + }, + "status": { + "type": "boolean", + "description": "Status" + } + }, + "required": [ + "symbol", + "status" + ] + }, + "example": "{\n \"symbol\": \"XBTUSDTM\",\n \"status\": true\n}" + } + } + }, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": true\\n}", + "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDTM\\\", \\\"status\\\": true}", + "operationId": "011" + } + } + }, + "components": { + "schemas": {} + } +} \ No newline at end of file diff --git a/spec/rest/entry/openapi-copytrading.json b/spec/rest/entry/openapi-copytrading.json new file mode 100644 index 00000000..55e1ffbf --- /dev/null +++ b/spec/rest/entry/openapi-copytrading.json @@ -0,0 +1,1651 @@ +{ + "openapi": "3.0.1", + "info": { + "title": "copytrading", + "description": "", + "version": "1.0.0" + }, + "tags": [], + "paths": { + "/api/v1/copy-trade/futures/orders": { + "post": { + "summary": "Add Order", + "deprecated": false, + "description": "Place order to the futures trading system, you can place two major types of orders: limit and market. Orders can only be placed if your account has sufficient funds. Once an order is placed, your funds will be put on hold for the duration of the order. The amount of funds on hold depends on the order type and parameters specified.", + "tags": [], + "parameters": [], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "object", + "properties": { + "orderId": { + "type": "string", + "description": "The unique order id generated by the trading system,which can be used later for further actions such as canceling the order." + }, + "clientOid": { + "type": "string", + "description": "The user self-defined order id." + } + }, + "required": [ + "orderId", + "clientOid" + ] + } + }, + "required": [ + "code", + "data" + ] + } + } + } + } + }, + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470363", + "x-abandon": "normal", + "x-domain": "Futures", + "x-api-channel": "Private", + "x-api-permission": "LeadtradeFutures", + "x-api-rate-limit-pool": "CopyTrading", + "x-sdk-service": "CopyTrading", + "x-sdk-sub-service": "Futures", + "x-sdk-method-name": "addOrder", + "x-sdk-method-description": "Place order to the futures trading system, you can place two major types of orders: limit and market. Orders can only be placed if your account has sufficient funds. Once an order is placed, your funds will be put on hold for the duration of the order. The amount of funds on hold depends on the order type and parameters specified.", + "x-api-rate-limit": 2, + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "clientOid": { + "type": "string", + "description": "Unique order id created by users to identify their orders, the maximum length cannot exceed 40, e.g. UUID, Only allows numbers, characters, underline(_), and separator(-)", + "example": [ + "5c52e11203aa677f33e493fb" + ] + }, + "side": { + "type": "string", + "description": "specify if the order is to 'buy' or 'sell' ", + "enum": [ + "buy", + "sell" + ], + "x-api-enum": [ + { + "value": "buy", + "name": "", + "description": "" + }, + { + "value": "sell", + "name": "", + "description": "" + } + ], + "example": [ + "buy" + ] + }, + "symbol": { + "type": "string", + "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) ", + "example": [ + "XBTUSDTM" + ] + }, + "leverage": { + "type": "integer", + "description": "Used to calculate the margin to be frozen for the order. If you are to close the position, this parameter is not required.", + "example": [ + 3 + ] + }, + "type": { + "type": "string", + "description": "specify if the order is an 'limit' order or 'market' order", + "enum": [ + "limit", + "market" + ], + "default": "limit", + "x-api-enum": [ + { + "value": "limit", + "name": "", + "description": "" + }, + { + "value": "market", + "name": "", + "description": "" + } + ], + "example": [ + "limit" + ] + }, + "remark": { + "type": "string", + "description": "remark for the order, length cannot exceed 100 utf8 characters" + }, + "stop": { + "type": "string", + "description": "Either 'down' or 'up'. If stop is used,parameter stopPrice and stopPriceType also need to be provieded.", + "enum": [ + "down", + "up" + ], + "x-api-enum": [ + { + "value": "down", + "name": "down", + "description": "Triggers when the price reaches or goes below the stopPrice." + }, + { + "value": "up", + "name": "up", + "description": "Triggers when the price reaches or goes above the stopPrice" + } + ] + }, + "stopPriceType": { + "type": "string", + "description": "Either 'TP', 'IP' or 'MP', Need to be defined if stop is specified.", + "enum": [ + "TP", + "MP", + "IP" + ], + "x-api-enum": [ + { + "value": "TP", + "name": "trade price", + "description": "TP for trade price, The last trade price is the last price at which an order was filled. This price can be found in the latest match message." + }, + { + "value": "MP", + "name": "mark price", + "description": "MP for mark price, The mark price can be obtained through relevant OPEN API for index services" + }, + { + "value": "IP", + "name": "index price", + "description": "IP for index price, The index price can be obtained through relevant OPEN API for index services" + } + ] + }, + "stopPrice": { + "type": "string", + "description": "Need to be defined if stop is specified. " + }, + "reduceOnly": { + "type": "boolean", + "description": "A mark to reduce the position size only. Set to false by default. Need to set the position size when reduceOnly is true. If set to true, only the orders reducing the position size will be executed. If the reduce-only order size exceeds the position size, the extra size will be canceled.", + "default": false + }, + "closeOrder": { + "type": "boolean", + "description": "A mark to close the position. Set to false by default. If closeOrder is set to true, the system will close the position and the position size will become 0. Side, Size and Leverage fields can be left empty and the system will determine the side and size automatically.", + "default": false + }, + "forceHold": { + "type": "boolean", + "description": "A mark to forcely hold the funds for an order, even though it's an order to reduce the position size. This helps the order stay on the order book and not get canceled when the position size changes. Set to false by default. The system will forcely freeze certain amount of funds for this order, including orders whose direction is opposite to the current positions. This feature is to ensure that the order won’t be canceled by the matching engine in such a circumstance that not enough funds are frozen for the order.", + "default": false + }, + "marginMode": { + "type": "string", + "description": "Margin mode: ISOLATED, CROSS, default: ISOLATED", + "enum": [ + "ISOLATED", + "CROSS" + ], + "default": "ISOLATED", + "x-api-enum": [ + { + "value": "ISOLATED", + "name": "ISOLATED", + "description": "Isolated Margin" + }, + { + "value": "CROSS", + "name": "CROSS", + "description": "Cross Margin" + } + ] + }, + "price": { + "type": "string", + "description": "Required for type is 'limit' order, indicating the operating price", + "example": [ + "0.1" + ] + }, + "size": { + "type": "integer", + "description": "Order size (Lot), must be a positive integer. The quantity unit of coin-swap contracts is size(lot), and other units are not supported." + }, + "timeInForce": { + "type": "string", + "description": "Optional for type is 'limit' order, [Time in force](https://www.kucoin.com/docs-new/doc-338146) is a special strategy used during trading, default is GTC", + "enum": [ + "GTC", + "IOC" + ], + "default": "GTC", + "x-api-enum": [ + { + "value": "GTC", + "name": "Good Till Canceled", + "description": "order remains open on the order book until canceled. This is the default type if the field is left empty." + }, + { + "value": "IOC", + "name": "Immediate Or Cancel", + "description": "being matched or not, the remaining size of the order will be instantly canceled instead of entering the order book." + } + ] + }, + "postOnly": { + "type": "boolean", + "description": "Optional for type is 'limit' order, post only flag, invalid when timeInForce is IOC. When postOnly is true, not allowed choose hidden or iceberg. The post-only flag ensures that the trader always pays the maker fee and provides liquidity to the order book. If any part of the order is going to pay taker fee, the order will be fully rejected.", + "default": false + }, + "hidden": { + "type": "boolean", + "description": "Optional for type is 'limit' order, orders not displaying in order book. When hidden chose, not allowed choose postOnly.", + "default": false + }, + "iceberg": { + "type": "boolean", + "description": "Optional for type is 'limit' order, Only visible portion of the order is displayed in the order book. When iceberg chose, not allowed choose postOnly.", + "default": false + }, + "visibleSize": { + "type": "string", + "description": "Optional for type is 'limit' order, The maximum visible size of an iceberg order. please place order in size (lots), The units of qty (base currency) and valueQty (value) are not supported." + } + }, + "required": [ + "clientOid", + "symbol", + "side", + "type", + "size" + ] + }, + "example": "{\n \"clientOid\": \"5c52e11203aa677f33e493fb\",\n \"side\": \"buy\",\n \"symbol\": \"XBTUSDTM\",\n \"leverage\": 3,\n \"type\": \"limit\",\n \"remark\": \"order remarks\",\n \"reduceOnly\": false,\n \"marginMode\": \"ISOLATED\",\n \"price\": \"0.1\",\n \"size\": 1,\n \"timeInForce\": \"GTC\"\n}" + } + } + }, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"orderId\\\": \\\"263485113055133696\\\",\\n \\\"clientOid\\\": \\\"5c52e11203aa677f331e493fb\\\"\\n }\\n}", + "x-request-example": "{\\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\", \\\"side\\\": \\\"buy\\\", \\\"symbol\\\": \\\"XBTUSDTM\\\", \\\"leverage\\\": 3, \\\"type\\\": \\\"limit\\\", \\\"remark\\\": \\\"order remarks\\\", \\\"reduceOnly\\\": false, \\\"marginMode\\\": \\\"ISOLATED\\\", \\\"price\\\": \\\"0.1\\\", \\\"size\\\": 1, \\\"timeInForce\\\": \\\"GTC\\\"}", + "operationId": "001" + }, + "delete": { + "summary": "Cancel Order By OrderId", + "deprecated": false, + "description": "Cancel order by system generated orderId.", + "tags": [], + "parameters": [ + { + "name": "orderId", + "in": "query", + "description": "Order id", + "required": false, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "object", + "properties": { + "cancelledOrderIds": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The orderId that is to be canceled" + } + }, + "required": [ + "cancelledOrderIds" + ] + } + }, + "required": [ + "code", + "data" + ] + } + } + } + } + }, + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470620", + "x-abandon": "normal", + "x-domain": "Futures", + "x-api-channel": "Private", + "x-api-permission": "Futures", + "x-api-rate-limit-pool": "CopyTrading", + "x-sdk-service": "CopyTrading", + "x-sdk-sub-service": "Futures", + "x-sdk-method-name": "cancelOrderById", + "x-sdk-method-description": "Cancel order by system generated orderId.", + "x-api-rate-limit": 1, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"cancelledOrderIds\\\": [\\n \\\"263485113055133696\\\"\\n ]\\n }\\n}", + "x-request-example": "{\\\"orderId\\\": \\\"263485113055133696\\\"}", + "operationId": "004" + } + }, + "/api/v1/copy-trade/futures/orders/test": { + "post": { + "summary": "Add Order Test", + "deprecated": false, + "description": "Place order to the futures trading system just for validation", + "tags": [], + "parameters": [], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "object", + "properties": { + "orderId": { + "type": "string", + "description": "The unique order id generated by the trading system,which can be used later for further actions such as canceling the order." + }, + "clientOid": { + "type": "string", + "description": "The user self-defined order id." + } + }, + "required": [ + "orderId", + "clientOid" + ] + } + }, + "required": [ + "code", + "data" + ] + } + } + } + } + }, + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470618", + "x-abandon": "normal", + "x-domain": "Futures", + "x-api-channel": "Private", + "x-api-permission": "Futures", + "x-api-rate-limit-pool": "CopyTrading", + "x-sdk-service": "CopyTrading", + "x-sdk-sub-service": "Futures", + "x-sdk-method-name": "addOrderTest", + "x-sdk-method-description": "Place order to the futures trading system just for validation", + "x-api-rate-limit": 2, + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "clientOid": { + "type": "string", + "description": "Unique order id created by users to identify their orders, the maximum length cannot exceed 40, e.g. UUID, Only allows numbers, characters, underline(_), and separator(-)", + "example": [ + "5c52e11203aa677f33e493fb" + ] + }, + "side": { + "type": "string", + "description": "specify if the order is to 'buy' or 'sell'", + "enum": [ + "buy", + "sell" + ], + "x-api-enum": [ + { + "value": "buy", + "name": "", + "description": "" + }, + { + "value": "sell", + "name": "", + "description": "" + } + ], + "example": [ + "buy" + ] + }, + "symbol": { + "type": "string", + "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) ", + "example": [ + "XBTUSDTM" + ] + }, + "leverage": { + "type": "integer", + "description": "Used to calculate the margin to be frozen for the order. If you are to close the position, this parameter is not required.", + "example": [ + 3 + ] + }, + "type": { + "type": "string", + "description": "specify if the order is an 'limit' order or 'market' order", + "enum": [ + "limit", + "market" + ], + "default": "limit", + "x-api-enum": [ + { + "value": "limit", + "name": "", + "description": "" + }, + { + "value": "market", + "name": "", + "description": "" + } + ], + "example": [ + "limit" + ] + }, + "remark": { + "type": "string", + "description": "remark for the order, length cannot exceed 100 utf8 characters" + }, + "stop": { + "type": "string", + "description": "Either 'down' or 'up'. If stop is used,parameter stopPrice and stopPriceType also need to be provieded.", + "enum": [ + "down", + "up" + ], + "x-api-enum": [ + { + "value": "down", + "name": "down", + "description": "Triggers when the price reaches or goes below the stopPrice." + }, + { + "value": "up", + "name": "up", + "description": "Triggers when the price reaches or goes above the stopPrice" + } + ] + }, + "stopPriceType": { + "type": "string", + "description": "Either 'TP', 'IP' or 'MP', Need to be defined if stop is specified.", + "enum": [ + "TP", + "MP", + "IP" + ], + "x-api-enum": [ + { + "value": "TP", + "name": "trade price", + "description": "TP for trade price, The last trade price is the last price at which an order was filled. This price can be found in the latest match message." + }, + { + "value": "MP", + "name": "mark price", + "description": "MP for mark price, The mark price can be obtained through relevant OPEN API for index services" + }, + { + "value": "IP", + "name": "index price", + "description": "IP for index price, The index price can be obtained through relevant OPEN API for index services" + } + ] + }, + "stopPrice": { + "type": "string", + "description": "Need to be defined if stop is specified. " + }, + "reduceOnly": { + "type": "boolean", + "description": "A mark to reduce the position size only. Set to false by default. Need to set the position size when reduceOnly is true. If set to true, only the orders reducing the position size will be executed. If the reduce-only order size exceeds the position size, the extra size will be canceled.", + "default": false + }, + "closeOrder": { + "type": "boolean", + "description": "A mark to close the position. Set to false by default. If closeOrder is set to true, the system will close the position and the position size will become 0. Side, Size and Leverage fields can be left empty and the system will determine the side and size automatically.", + "default": false + }, + "forceHold": { + "type": "boolean", + "description": "A mark to forcely hold the funds for an order, even though it's an order to reduce the position size. This helps the order stay on the order book and not get canceled when the position size changes. Set to false by default. The system will forcely freeze certain amount of funds for this order, including orders whose direction is opposite to the current positions. This feature is to ensure that the order won’t be canceled by the matching engine in such a circumstance that not enough funds are frozen for the order.", + "default": false + }, + "marginMode": { + "type": "string", + "description": "Margin mode: ISOLATED, CROSS, default: ISOLATED", + "enum": [ + "ISOLATED", + "CROSS" + ], + "default": "ISOLATED", + "x-api-enum": [ + { + "value": "ISOLATED", + "name": "", + "description": "" + }, + { + "value": "CROSS", + "name": "", + "description": "" + } + ] + }, + "price": { + "type": "string", + "description": "Required for type is 'limit' order, indicating the operating price", + "example": [ + "0.1" + ] + }, + "size": { + "type": "integer", + "description": "Order size (Lot), must be a positive integer. The quantity unit of coin-swap contracts is size(lot), and other units are not supported." + }, + "timeInForce": { + "type": "string", + "description": "Optional for type is 'limit' order, [Time in force](https://www.kucoin.com/docs-new/doc-338146) is a special strategy used during trading, default is GTC", + "enum": [ + "GTC", + "IOC" + ], + "default": "GTC", + "x-api-enum": [ + { + "value": "GTC", + "name": "Good Till Canceled", + "description": "order remains open on the order book until canceled. This is the default type if the field is left empty." + }, + { + "value": "IOC", + "name": "Immediate Or Cancel", + "description": "being matched or not, the remaining size of the order will be instantly canceled instead of entering the order book." + } + ] + }, + "postOnly": { + "type": "boolean", + "description": "Optional for type is 'limit' order, post only flag, invalid when timeInForce is IOC. When postOnly is true, not allowed choose hidden or iceberg. The post-only flag ensures that the trader always pays the maker fee and provides liquidity to the order book. If any part of the order is going to pay taker fee, the order will be fully rejected.", + "default": false + }, + "hidden": { + "type": "boolean", + "description": "Optional for type is 'limit' order, orders not displaying in order book. When hidden chose, not allowed choose postOnly.", + "default": false + }, + "iceberg": { + "type": "boolean", + "description": "Optional for type is 'limit' order, Only visible portion of the order is displayed in the order book. When iceberg chose, not allowed choose postOnly.", + "default": false + }, + "visibleSize": { + "type": "string", + "description": "Optional for type is 'limit' order, The maximum visible size of an iceberg order. please place order in size (lots), The units of qty (base currency) and valueQty (value) are not supported." + } + }, + "required": [ + "clientOid", + "symbol", + "type", + "side", + "leverage", + "size" + ] + }, + "example": "{\n \"clientOid\": \"5c52e11203aa677f33e493fb\",\n \"side\": \"buy\",\n \"symbol\": \"XBTUSDTM\",\n \"leverage\": 3,\n \"type\": \"limit\",\n \"remark\": \"order remarks\",\n \"reduceOnly\": false,\n \"marginMode\": \"ISOLATED\",\n \"price\": \"0.1\",\n \"size\": 1,\n \"timeInForce\": \"GTC\"\n}" + } + } + }, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"orderId\\\": \\\"234125150956625920\\\",\\n \\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\"\\n }\\n}", + "x-request-example": "{\\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\", \\\"side\\\": \\\"buy\\\", \\\"symbol\\\": \\\"XBTUSDTM\\\", \\\"leverage\\\": 3, \\\"type\\\": \\\"limit\\\", \\\"remark\\\": \\\"order remarks\\\", \\\"reduceOnly\\\": false, \\\"marginMode\\\": \\\"ISOLATED\\\", \\\"price\\\": \\\"0.1\\\", \\\"size\\\": 1, \\\"timeInForce\\\": \\\"GTC\\\"}", + "operationId": "002" + } + }, + "/api/v1/copy-trade/futures/st-orders": { + "post": { + "summary": "Add Take Profit And Stop Loss Order", + "deprecated": false, + "description": "Place take profit and stop loss order supports both take-profit and stop-loss functions, and other functions are exactly the same as the place order interface.", + "tags": [], + "parameters": [], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "object", + "properties": { + "orderId": { + "type": "string", + "description": "The unique order id generated by the trading system,which can be used later for further actions such as canceling the order." + }, + "clientOid": { + "type": "string", + "description": "The user self-defined order id." + } + }, + "required": [ + "orderId", + "clientOid" + ] + } + }, + "required": [ + "code", + "data" + ] + } + } + } + } + }, + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470619", + "x-abandon": "normal", + "x-domain": "Futures", + "x-api-channel": "Private", + "x-api-permission": "Futures", + "x-api-rate-limit-pool": "CopyTrading", + "x-sdk-service": "CopyTrading", + "x-sdk-sub-service": "Futures", + "x-sdk-method-name": "addTPSLOrder", + "x-sdk-method-description": "Place take profit and stop loss order supports both take-profit and stop-loss functions, and other functions are exactly the same as the place order interface.", + "x-api-rate-limit": 2, + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "clientOid": { + "type": "string", + "description": "Unique order id created by users to identify their orders, the maximum length cannot exceed 40, e.g. UUID, Only allows numbers, characters, underline(_), and separator(-)", + "example": [ + "5c52e11203aa677f33e493fb" + ] + }, + "side": { + "type": "string", + "description": "specify if the order is to 'buy' or 'sell'", + "enum": [ + "buy", + "sell" + ], + "x-api-enum": [ + { + "value": "buy", + "name": "", + "description": "" + }, + { + "value": "sell", + "name": "", + "description": "" + } + ], + "example": [ + "buy" + ] + }, + "symbol": { + "type": "string", + "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) ", + "example": [ + "XBTUSDTM" + ] + }, + "leverage": { + "type": "integer", + "description": "Used to calculate the margin to be frozen for the order. If you are to close the position, this parameter is not required.", + "example": [ + 3 + ] + }, + "type": { + "type": "string", + "description": "specify if the order is an 'limit' order or 'market' order", + "enum": [ + "limit", + "market" + ], + "default": "limit", + "x-api-enum": [ + { + "value": "limit", + "name": "limit", + "description": "limit order" + }, + { + "value": "market", + "name": "market", + "description": "market order" + } + ], + "example": [ + "limit" + ] + }, + "remark": { + "type": "string", + "description": "remark for the order, length cannot exceed 100 utf8 characters" + }, + "stopPriceType": { + "type": "string", + "description": "Either 'TP', 'IP' or 'MP'", + "enum": [ + "TP", + "MP", + "IP" + ], + "x-api-enum": [ + { + "value": "TP", + "name": "trade price", + "description": "TP for trade price, The last trade price is the last price at which an order was filled. This price can be found in the latest match message." + }, + { + "value": "MP", + "name": "mark price", + "description": "MP for mark price, The mark price can be obtained through relevant OPEN API for index services" + }, + { + "value": "IP", + "name": "index price", + "description": "IP for index price, The index price can be obtained through relevant OPEN API for index services" + } + ] + }, + "reduceOnly": { + "type": "boolean", + "description": "A mark to reduce the position size only. Set to false by default. Need to set the position size when reduceOnly is true. If set to true, only the orders reducing the position size will be executed. If the reduce-only order size exceeds the position size, the extra size will be canceled.", + "default": false + }, + "closeOrder": { + "type": "boolean", + "description": "A mark to close the position. Set to false by default. If closeOrder is set to true, the system will close the position and the position size will become 0. Side, Size and Leverage fields can be left empty and the system will determine the side and size automatically.", + "default": false + }, + "forceHold": { + "type": "boolean", + "description": "A mark to forcely hold the funds for an order, even though it's an order to reduce the position size. This helps the order stay on the order book and not get canceled when the position size changes. Set to false by default. The system will forcely freeze certain amount of funds for this order, including orders whose direction is opposite to the current positions. This feature is to ensure that the order won’t be canceled by the matching engine in such a circumstance that not enough funds are frozen for the order.", + "default": false + }, + "marginMode": { + "type": "string", + "description": "Margin mode: ISOLATED, CROSS, default: ISOLATED", + "enum": [ + "ISOLATED", + "CROSS" + ], + "default": "ISOLATED", + "x-api-enum": [ + { + "value": "ISOLATED", + "name": "", + "description": "" + }, + { + "value": "CROSS", + "name": "", + "description": "" + } + ] + }, + "price": { + "type": "string", + "description": "Required for type is 'limit' order, indicating the operating price", + "example": [ + "0.1" + ] + }, + "size": { + "type": "integer", + "description": "Order size (Lot), must be a positive integer. The quantity unit of coin-swap contracts is size(lot), and other units are not supported." + }, + "timeInForce": { + "type": "string", + "description": "Optional for type is 'limit' order, [Time in force](https://www.kucoin.com/docs-new/doc-338146) is a special strategy used during trading, default is GTC", + "enum": [ + "GTC", + "IOC" + ], + "default": "GTC", + "x-api-enum": [ + { + "value": "GTC", + "name": "Good Till Canceled", + "description": "order remains open on the order book until canceled. This is the default type if the field is left empty." + }, + { + "value": "IOC", + "name": "Immediate Or Cancel", + "description": "being matched or not, the remaining size of the order will be instantly canceled instead of entering the order book." + } + ] + }, + "postOnly": { + "type": "boolean", + "description": "Optional for type is 'limit' order, post only flag, invalid when timeInForce is IOC. When postOnly is true, not allowed choose hidden or iceberg. The post-only flag ensures that the trader always pays the maker fee and provides liquidity to the order book. If any part of the order is going to pay taker fee, the order will be fully rejected.", + "default": false + }, + "hidden": { + "type": "boolean", + "description": "Optional for type is 'limit' order, orders not displaying in order book. When hidden chose, not allowed choose postOnly.", + "default": false + }, + "iceberg": { + "type": "boolean", + "description": "Optional for type is 'limit' order, Only visible portion of the order is displayed in the order book. When iceberg chose, not allowed choose postOnly.", + "default": false + }, + "visibleSize": { + "type": "string", + "description": "Optional for type is 'limit' order, The maximum visible size of an iceberg order. please place order in size (lots), The units of qty (base currency) and valueQty (value) are not supported." + }, + "triggerStopUpPrice": { + "type": "string", + "description": "Take profit price" + }, + "triggerStopDownPrice": { + "type": "string", + "description": "Stop loss price" + } + }, + "required": [ + "clientOid", + "symbol", + "type", + "side", + "leverage", + "size" + ] + }, + "example": "{\n \"clientOid\": \"5c52e11203aa677f33e493fb\",\n \"side\": \"buy\",\n \"symbol\": \"XBTUSDTM\",\n \"leverage\": 3,\n \"type\": \"limit\",\n \"remark\": \"order remarks\",\n \"reduceOnly\": false,\n \"marginMode\": \"ISOLATED\",\n \"price\": \"0.2\",\n \"size\": 1,\n \"timeInForce\": \"GTC\",\n \"triggerStopUpPrice\": \"0.3\",\n \"triggerStopDownPrice\": \"0.1\",\n \"stopPriceType\": \"TP\"\n}" + } + } + }, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"orderId\\\": \\\"234125150956625920\\\",\\n \\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\"\\n }\\n}", + "x-request-example": "{\\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\", \\\"side\\\": \\\"buy\\\", \\\"symbol\\\": \\\"XBTUSDTM\\\", \\\"leverage\\\": 3, \\\"type\\\": \\\"limit\\\", \\\"remark\\\": \\\"order remarks\\\", \\\"reduceOnly\\\": false, \\\"marginMode\\\": \\\"ISOLATED\\\", \\\"price\\\": \\\"0.2\\\", \\\"size\\\": 1, \\\"timeInForce\\\": \\\"GTC\\\", \\\"triggerStopUpPrice\\\": \\\"0.3\\\", \\\"triggerStopDownPrice\\\": \\\"0.1\\\", \\\"stopPriceType\\\": \\\"TP\\\"}", + "operationId": "003" + } + }, + "/api/v1/copy-trade/futures/orders/client-order": { + "delete": { + "summary": "Cancel Order By ClientOid", + "deprecated": false, + "description": "Cancel order by client defined orderId.", + "tags": [], + "parameters": [ + { + "name": "symbol", + "in": "query", + "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) ", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "clientOid", + "in": "query", + "description": "The user self-defined order id.", + "required": false, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "object", + "properties": { + "clientOid": { + "type": "string" + } + }, + "required": [ + "clientOid" + ] + } + }, + "required": [ + "code", + "data" + ] + } + } + } + } + }, + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470621", + "x-abandon": "normal", + "x-domain": "Futures", + "x-api-channel": "Private", + "x-api-permission": "Futures", + "x-api-rate-limit-pool": "CopyTrading", + "x-sdk-service": "CopyTrading", + "x-sdk-sub-service": "Futures", + "x-sdk-method-name": "cancelOrderByClientOid", + "x-sdk-method-description": "Cancel order by client defined orderId.", + "x-api-rate-limit": 1, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"clientOid\\\": \\\"5c52e11203aa677f331e4913fb\\\"\\n }\\n}", + "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDTM\\\", \\\"clientOid\\\": \\\"5c52e11203aa677f331e493fb\\\"}", + "operationId": "005" + } + }, + "/api/v1/copy-trade/futures/get-max-open-size": { + "get": { + "summary": "Get Max Open Size", + "deprecated": false, + "description": "Get Maximum Open Position Size.", + "tags": [], + "parameters": [ + { + "name": "symbol", + "in": "query", + "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) ", + "required": true, + "schema": { + "type": "string", + "example": [ + "XBTUSDTM", + "XBTUSDM", + "ETHUSDTM" + ] + } + }, + { + "name": "price", + "in": "query", + "description": "Order price\n", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "leverage", + "in": "query", + "description": "Leverage\n", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "object", + "properties": { + "symbol": { + "type": "string", + "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) " + }, + "maxBuyOpenSize": { + "type": "integer", + "description": "Maximum buy size\n" + }, + "maxSellOpenSize": { + "type": "integer", + "description": "Maximum buy size\n" + } + }, + "required": [ + "symbol", + "maxBuyOpenSize", + "maxSellOpenSize" + ] + } + }, + "required": [ + "code", + "data" + ] + } + } + } + } + }, + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470612", + "x-abandon": "normal", + "x-domain": "Futures", + "x-api-channel": "Private", + "x-api-permission": "Futures", + "x-api-rate-limit-pool": "CopyTrading", + "x-sdk-service": "CopyTrading", + "x-sdk-sub-service": "Futures", + "x-sdk-method-name": "GetMaxOpenSize", + "x-sdk-method-description": "Get Maximum Open Position Size.", + "x-api-rate-limit": 2, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"maxBuyOpenSize\\\": 8,\\n \\\"maxSellOpenSize\\\": 5\\n }\\n}", + "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDTM\\\", \\\"price\\\": \\\"example_string_default_value\\\", \\\"leverage\\\": 123456}", + "operationId": "006" + } + }, + "/api/v1/copy-trade/futures/position/margin/max-withdraw-margin": { + "get": { + "summary": "Get Max Withdraw Margin", + "deprecated": false, + "description": "This interface can query the maximum amount of margin that the current position supports withdrawal.", + "tags": [], + "parameters": [ + { + "name": "symbol", + "in": "query", + "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) ", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "string", + "description": "The size of the position that can be deposited. If it is USDT-margin, it represents the amount of USDT. If it is coin-margin, this value represents the number of coins\n" + } + }, + "required": [ + "code", + "data" + ] + } + } + } + } + }, + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470616", + "x-abandon": "normal", + "x-domain": "Futures", + "x-api-channel": "Private", + "x-api-permission": "Futures", + "x-api-rate-limit-pool": "CopyTrading", + "x-sdk-service": "CopyTrading", + "x-sdk-sub-service": "Futures", + "x-sdk-method-name": "GetMaxWithdrawMargin", + "x-sdk-method-description": "This interface can query the maximum amount of margin that the current position supports withdrawal.", + "x-api-rate-limit": 10, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": \\\"21.1135719252\\\"\\n}", + "x-request-example": "{\\\"symbol\\\": \\\"example_string_default_value\\\"}", + "operationId": "007" + } + }, + "/api/v1/copy-trade/futures/position/margin/deposit-margin": { + "post": { + "summary": "Add Isolated Margin", + "deprecated": false, + "description": "Add Isolated Margin Manually.", + "tags": [], + "parameters": [], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Position ID" + }, + "symbol": { + "type": "string", + "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) " + }, + "autoDeposit": { + "type": "boolean", + "description": "Auto deposit margin or not" + }, + "maintMarginReq": { + "type": "number", + "description": "Maintenance margin requirement\n\n" + }, + "riskLimit": { + "type": "integer", + "description": "Risk limit\n" + }, + "realLeverage": { + "type": "number", + "description": "Leverage o the order" + }, + "crossMode": { + "type": "boolean", + "description": "Cross mode or not" + }, + "delevPercentage": { + "type": "number", + "description": "ADL ranking percentile" + }, + "openingTimestamp": { + "type": "integer", + "description": "Open time", + "format": "int64" + }, + "currentTimestamp": { + "type": "integer", + "format": "int64", + "description": "Current timestamp\n" + }, + "currentQty": { + "type": "integer", + "description": "Current postion quantity" + }, + "currentCost": { + "type": "number", + "description": "Current postion value" + }, + "currentComm": { + "type": "number", + "description": "Current commission" + }, + "unrealisedCost": { + "type": "number", + "description": "Unrealised value" + }, + "realisedGrossCost": { + "type": "number", + "description": "Accumulated realised gross profit value" + }, + "realisedCost": { + "type": "number", + "description": "Current realised position value" + }, + "isOpen": { + "type": "boolean", + "description": "Opened position or not" + }, + "markPrice": { + "type": "number", + "description": "Mark price" + }, + "markValue": { + "type": "number", + "description": "Mark value\n" + }, + "posCost": { + "type": "number", + "description": "Position value" + }, + "posCross": { + "type": "number", + "description": "added margin" + }, + "posInit": { + "type": "number", + "description": "Leverage margin" + }, + "posComm": { + "type": "number", + "description": "Bankruptcy cost" + }, + "posLoss": { + "type": "number", + "description": "Funding fees paid out" + }, + "posMargin": { + "type": "number", + "description": "Position margin" + }, + "posMaint": { + "type": "number", + "description": "Maintenance margin" + }, + "maintMargin": { + "type": "number", + "description": "Position margin" + }, + "realisedGrossPnl": { + "type": "number", + "description": "Accumulated realised gross profit value" + }, + "realisedPnl": { + "type": "number", + "description": "Realised profit and loss" + }, + "unrealisedPnl": { + "type": "number", + "description": "Unrealised profit and loss" + }, + "unrealisedPnlPcnt": { + "type": "number", + "description": "Profit-loss ratio of the position" + }, + "unrealisedRoePcnt": { + "type": "number", + "description": "Rate of return on investment" + }, + "avgEntryPrice": { + "type": "number", + "description": "Average entry price" + }, + "liquidationPrice": { + "type": "number", + "description": "Liquidation price" + }, + "bankruptPrice": { + "type": "number", + "description": "Bankruptcy price" + }, + "userId": { + "type": "integer", + "description": "userId" + }, + "settleCurrency": { + "type": "string", + "description": "Currency used to clear and settle the trades" + } + }, + "required": [ + "id", + "symbol", + "autoDeposit", + "maintMarginReq", + "riskLimit", + "realLeverage", + "crossMode", + "delevPercentage", + "openingTimestamp", + "currentTimestamp", + "currentQty", + "currentCost", + "currentComm", + "unrealisedCost", + "realisedGrossCost", + "realisedCost", + "isOpen", + "markPrice", + "markValue", + "posCost", + "posCross", + "posInit", + "posComm", + "posLoss", + "posMargin", + "posMaint", + "maintMargin", + "realisedGrossPnl", + "realisedPnl", + "unrealisedPnl", + "unrealisedPnlPcnt", + "unrealisedRoePcnt", + "avgEntryPrice", + "liquidationPrice", + "bankruptPrice", + "userId", + "settleCurrency" + ] + } + }, + "required": [ + "code", + "data" + ] + } + } + } + } + }, + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470614", + "x-abandon": "normal", + "x-domain": "Futures", + "x-api-channel": "Private", + "x-api-permission": "Futures", + "x-api-rate-limit-pool": "CopyTrading", + "x-sdk-service": "CopyTrading", + "x-sdk-sub-service": "Futures", + "x-sdk-method-name": "AddIsolatedMargin", + "x-sdk-method-description": "Add Isolated Margin Manually.", + "x-api-rate-limit": 4, + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "symbol": { + "type": "string", + "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) " + }, + "margin": { + "type": "number", + "description": "Margin amount (min. margin amount≥0.00001667XBT)" + }, + "bizNo": { + "type": "string", + "description": "A unique ID generated by the user, to ensure the operation is processed by the system only once, The maximum length cannot exceed 36" + } + }, + "required": [ + "symbol", + "margin", + "bizNo" + ] + }, + "example": "{\n \"symbol\": \"string\",\n \"margin\": 0,\n \"bizNo\": \"string\"\n}" + } + } + }, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"id\\\": \\\"6200c9b83aecfb000152ddcd\\\",\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"autoDeposit\\\": false,\\n \\\"maintMarginReq\\\": 0.005,\\n \\\"riskLimit\\\": 500000,\\n \\\"realLeverage\\\": 18.72,\\n \\\"crossMode\\\": false,\\n \\\"delevPercentage\\\": 0.66,\\n \\\"openingTimestamp\\\": 1646287090131,\\n \\\"currentTimestamp\\\": 1646295055021,\\n \\\"currentQty\\\": 1,\\n \\\"currentCost\\\": 43.388,\\n \\\"currentComm\\\": 0.0260328,\\n \\\"unrealisedCost\\\": 43.388,\\n \\\"realisedGrossCost\\\": 0,\\n \\\"realisedCost\\\": 0.0260328,\\n \\\"isOpen\\\": true,\\n \\\"markPrice\\\": 43536.65,\\n \\\"markValue\\\": 43.53665,\\n \\\"posCost\\\": 43.388,\\n \\\"posCross\\\": 0.000024985,\\n \\\"posInit\\\": 2.1694,\\n \\\"posComm\\\": 0.02733446,\\n \\\"posLoss\\\": 0,\\n \\\"posMargin\\\": 2.19675944,\\n \\\"posMaint\\\": 0.24861326,\\n \\\"maintMargin\\\": 2.34540944,\\n \\\"realisedGrossPnl\\\": 0,\\n \\\"realisedPnl\\\": -0.0260328,\\n \\\"unrealisedPnl\\\": 0.14865,\\n \\\"unrealisedPnlPcnt\\\": 0.0034,\\n \\\"unrealisedRoePcnt\\\": 0.0685,\\n \\\"avgEntryPrice\\\": 43388,\\n \\\"liquidationPrice\\\": 41440,\\n \\\"bankruptPrice\\\": 41218,\\n \\\"userId\\\": 1234321123,\\n \\\"settleCurrency\\\": \\\"USDT\\\"\\n }\\n}", + "x-request-example": "{\\\"symbol\\\": \\\"string\\\", \\\"margin\\\": 0, \\\"bizNo\\\": \\\"string\\\"}", + "operationId": "008" + } + }, + "/api/v1/copy-trade/futures/position/margin/withdraw-margin": { + "post": { + "summary": "Remove Isolated Margin", + "deprecated": false, + "description": "Remove Isolated Margin Manually.", + "tags": [], + "parameters": [], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "string", + "description": "The size of the position deposited. If it is USDT-margin, it represents the amount of USDT. If it is coin-margin, this value represents the number of coins\n" + } + }, + "required": [ + "code", + "data" + ] + } + } + } + } + }, + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470615", + "x-abandon": "normal", + "x-domain": "Futures", + "x-api-channel": "Private", + "x-api-permission": "Futures", + "x-api-rate-limit-pool": "CopyTrading", + "x-sdk-service": "CopyTrading", + "x-sdk-sub-service": "Futures", + "x-sdk-method-name": "RemoveIsolatedMargin", + "x-sdk-method-description": "Remove Isolated Margin Manually.", + "x-api-rate-limit": 10, + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "symbol": { + "type": "string", + "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) " + }, + "withdrawAmount": { + "type": "string", + "description": "The size of the position that can be deposited. If it is USDT-margin, it represents the amount of USDT. If it is coin-margin, this value represents the number of coins\n" + } + }, + "required": [ + "symbol", + "withdrawAmount" + ] + }, + "example": "{\n \"symbol\": \"XBTUSDTM\",\n \"withdrawAmount\": \"0.0000001\"\n}" + } + } + }, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": \\\"0.1\\\"\\n}", + "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDTM\\\", \\\"withdrawAmount\\\": \\\"0.0000001\\\"}", + "operationId": "009" + } + }, + "/api/v1/copy-trade/futures/position/risk-limit-level/change": { + "post": { + "summary": "Modify Isolated Margin Risk Limit", + "deprecated": false, + "description": "This interface can be used to obtain information about risk limit level of a specific contract(Only valid for isolated Margin).", + "tags": [], + "parameters": [], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "boolean", + "description": "To adjust the level will cancel the open order, the response can only indicate whether the submit of the adjustment request is successful or not.\n" + } + }, + "required": [ + "code", + "data" + ] + } + } + } + } + }, + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470613", + "x-abandon": "normal", + "x-domain": "Futures", + "x-api-channel": "Private", + "x-api-permission": "Futures", + "x-api-rate-limit-pool": "CopyTrading", + "x-sdk-service": "CopyTrading", + "x-sdk-sub-service": "Futures", + "x-sdk-method-name": "modifyIsolatedMarginRiskLimt", + "x-sdk-method-description": "This interface can be used to obtain information about risk limit level of a specific contract(Only valid for isolated Margin).", + "x-api-rate-limit": 4, + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "symbol": { + "type": "string", + "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) " + }, + "level": { + "type": "integer", + "description": "level" + } + }, + "required": [ + "symbol", + "level" + ] + }, + "example": "{\n \"symbol\" : \"XBTUSDTM\",\n \"level\" : 1\n}" + } + } + }, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": true\\n}", + "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDTM\\\", \\\"level\\\": 1}", + "operationId": "010" + } + }, + "/api/v1/copy-trade/futures/position/margin/auto-deposit-status": { + "post": { + "summary": "Modify Isolated Margin Auto-Deposit Status", + "deprecated": false, + "description": "This endpoint is only applicable to isolated margin and is no longer recommended. It is recommended to use cross margin instead.", + "tags": [], + "parameters": [], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "boolean" + } + }, + "required": [ + "code", + "data" + ] + } + } + } + } + }, + "x-api-doc": "https://www.kucoin.com/docs-new/api-3470617", + "x-abandon": "normal", + "x-domain": "Futures", + "x-api-channel": "Private", + "x-api-permission": "Futures", + "x-api-rate-limit-pool": "CopyTrading", + "x-sdk-service": "CopyTrading", + "x-sdk-sub-service": "Futures", + "x-sdk-method-name": "modifyAutoDepositStatus", + "x-sdk-method-description": "This endpoint is only applicable to isolated margin and is no longer recommended. It is recommended to use cross margin instead.", + "x-api-rate-limit": 4, + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "symbol": { + "type": "string", + "description": "Symbol of the contract\n", + "example": [ + "XBTUSDTM", + "ETHUSDTM" + ] + }, + "status": { + "type": "boolean", + "description": "Status" + } + }, + "required": [ + "symbol", + "status" + ] + }, + "example": "{\n \"symbol\": \"XBTUSDTM\",\n \"status\": true\n}" + } + } + }, + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": true\\n}", + "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDTM\\\", \\\"status\\\": true}", + "operationId": "011" + } + } + }, + "components": { + "schemas": {} + } +} \ No newline at end of file From 5a4674da473a9fa69cbf701f16c36a6fac6037dd Mon Sep 17 00:00:00 2001 From: "Isaac.Tang" Date: Thu, 16 Jan 2025 10:07:07 +0800 Subject: [PATCH 5/6] feat(sdk): fix copy trading types --- .../copytrading/futures/api_futures_test.go | 6 +- .../futures/types_add_isolated_margin_resp.go | 56 +++--- .../futures/types_get_max_open_size_resp.go | 6 +- .../e2e/rest/copytrading_test/futures_test.go | 88 ++++----- sdk/postman/collection-REST.json | 10 +- .../copytrading/futures/api_futures_test.py | 6 +- .../futures/model_add_isolated_margin_resp.py | 179 +++++++++--------- .../futures/model_get_max_open_size_resp.py | 8 +- .../copytrading_test/copytrading_futures.py | 9 +- spec/original/meta.json | 65 +++---- .../rest/api/openapi-copytrading-futures.json | 67 +++---- spec/rest/entry/openapi-copytrading.json | 67 +++---- 12 files changed, 269 insertions(+), 298 deletions(-) diff --git a/sdk/golang/pkg/generate/copytrading/futures/api_futures_test.go b/sdk/golang/pkg/generate/copytrading/futures/api_futures_test.go index 75f04ccd..7ef84f3d 100644 --- a/sdk/golang/pkg/generate/copytrading/futures/api_futures_test.go +++ b/sdk/golang/pkg/generate/copytrading/futures/api_futures_test.go @@ -164,7 +164,7 @@ func TestFuturesGetMaxOpenSizeRespModel(t *testing.T) { // Get Max Open Size // /api/v1/copy-trade/futures/get-max-open-size - data := "{\n \"code\": \"200000\",\n \"data\": {\n \"symbol\": \"XBTUSDTM\",\n \"maxBuyOpenSize\": 8,\n \"maxSellOpenSize\": 5\n }\n}" + data := "{\n \"code\": \"200000\",\n \"data\": {\n \"symbol\": \"XBTUSDTM\",\n \"maxBuyOpenSize\": \"8\",\n \"maxSellOpenSize\": \"5\"\n }\n}" commonResp := &types.RestResponse{} err := json.Unmarshal([]byte(data), commonResp) assert.Nil(t, err) @@ -208,7 +208,7 @@ func TestFuturesAddIsolatedMarginReqModel(t *testing.T) { // Add Isolated Margin // /api/v1/copy-trade/futures/position/margin/deposit-margin - data := "{\"symbol\": \"string\", \"margin\": 0, \"bizNo\": \"string\"}" + data := "{\"symbol\": \"XBTUSDTM\", \"margin\": 3, \"bizNo\": \"112233\"}" req := &AddIsolatedMarginReq{} err := json.Unmarshal([]byte(data), req) req.ToMap() @@ -220,7 +220,7 @@ func TestFuturesAddIsolatedMarginRespModel(t *testing.T) { // Add Isolated Margin // /api/v1/copy-trade/futures/position/margin/deposit-margin - data := "{\n \"code\": \"200000\",\n \"data\": {\n \"id\": \"6200c9b83aecfb000152ddcd\",\n \"symbol\": \"XBTUSDTM\",\n \"autoDeposit\": false,\n \"maintMarginReq\": 0.005,\n \"riskLimit\": 500000,\n \"realLeverage\": 18.72,\n \"crossMode\": false,\n \"delevPercentage\": 0.66,\n \"openingTimestamp\": 1646287090131,\n \"currentTimestamp\": 1646295055021,\n \"currentQty\": 1,\n \"currentCost\": 43.388,\n \"currentComm\": 0.0260328,\n \"unrealisedCost\": 43.388,\n \"realisedGrossCost\": 0,\n \"realisedCost\": 0.0260328,\n \"isOpen\": true,\n \"markPrice\": 43536.65,\n \"markValue\": 43.53665,\n \"posCost\": 43.388,\n \"posCross\": 0.000024985,\n \"posInit\": 2.1694,\n \"posComm\": 0.02733446,\n \"posLoss\": 0,\n \"posMargin\": 2.19675944,\n \"posMaint\": 0.24861326,\n \"maintMargin\": 2.34540944,\n \"realisedGrossPnl\": 0,\n \"realisedPnl\": -0.0260328,\n \"unrealisedPnl\": 0.14865,\n \"unrealisedPnlPcnt\": 0.0034,\n \"unrealisedRoePcnt\": 0.0685,\n \"avgEntryPrice\": 43388,\n \"liquidationPrice\": 41440,\n \"bankruptPrice\": 41218,\n \"userId\": 1234321123,\n \"settleCurrency\": \"USDT\"\n }\n}" + data := "{\n \"code\": \"200000\",\n \"data\": {\n \"id\": \"400000000000974886\",\n \"symbol\": \"XBTUSDTM\",\n \"autoDeposit\": true,\n \"maintMarginReq\": \"0.004\",\n \"riskLimit\": 100000,\n \"realLeverage\": \"1.83\",\n \"crossMode\": false,\n \"marginMode\": \"\",\n \"positionSide\": \"\",\n \"leverage\": \"1.83\",\n \"delevPercentage\": 0.2,\n \"openingTimestamp\": 1736932881164,\n \"currentTimestamp\": 1736933530230,\n \"currentQty\": 1,\n \"currentCost\": \"97.302\",\n \"currentComm\": \"0.0583812\",\n \"unrealisedCost\": \"97.302\",\n \"realisedGrossCost\": \"0.0000000000\",\n \"realisedCost\": \"0.0583812000\",\n \"isOpen\": true,\n \"markPrice\": \"96939.98\",\n \"markValue\": \"96.9399800000\",\n \"posCost\": \"97.302\",\n \"posCross\": \"20.9874\",\n \"posInit\": \"32.4339999967\",\n \"posComm\": \"0.0904415999\",\n \"posLoss\": \"0\",\n \"posMargin\": \"53.5118415966\",\n \"posMaint\": \"0.4796495999\",\n \"maintMargin\": \"53.1498215966\",\n \"realisedGrossPnl\": \"0.0000000000\",\n \"realisedPnl\": \"-0.0583812000\",\n \"unrealisedPnl\": \"-0.3620200000\",\n \"unrealisedPnlPcnt\": \"-0.0037\",\n \"unrealisedRoePcnt\": \"-0.0112\",\n \"avgEntryPrice\": \"97302.00\",\n \"liquidationPrice\": \"44269.81\",\n \"bankruptPrice\": \"43880.61\",\n \"settleCurrency\": \"USDT\"\n }\n}" commonResp := &types.RestResponse{} err := json.Unmarshal([]byte(data), commonResp) assert.Nil(t, err) diff --git a/sdk/golang/pkg/generate/copytrading/futures/types_add_isolated_margin_resp.go b/sdk/golang/pkg/generate/copytrading/futures/types_add_isolated_margin_resp.go index 02f81cad..7962a89c 100644 --- a/sdk/golang/pkg/generate/copytrading/futures/types_add_isolated_margin_resp.go +++ b/sdk/golang/pkg/generate/copytrading/futures/types_add_isolated_margin_resp.go @@ -17,11 +17,11 @@ type AddIsolatedMarginResp struct { // Auto deposit margin or not AutoDeposit bool `json:"autoDeposit,omitempty"` // Maintenance margin requirement - MaintMarginReq float32 `json:"maintMarginReq,omitempty"` + MaintMarginReq string `json:"maintMarginReq,omitempty"` // Risk limit RiskLimit int32 `json:"riskLimit,omitempty"` // Leverage o the order - RealLeverage float32 `json:"realLeverage,omitempty"` + RealLeverage string `json:"realLeverage,omitempty"` // Cross mode or not CrossMode bool `json:"crossMode,omitempty"` // ADL ranking percentile @@ -33,62 +33,60 @@ type AddIsolatedMarginResp struct { // Current postion quantity CurrentQty int32 `json:"currentQty,omitempty"` // Current postion value - CurrentCost float32 `json:"currentCost,omitempty"` + CurrentCost string `json:"currentCost,omitempty"` // Current commission - CurrentComm float32 `json:"currentComm,omitempty"` + CurrentComm string `json:"currentComm,omitempty"` // Unrealised value - UnrealisedCost float32 `json:"unrealisedCost,omitempty"` + UnrealisedCost string `json:"unrealisedCost,omitempty"` // Accumulated realised gross profit value - RealisedGrossCost float32 `json:"realisedGrossCost,omitempty"` + RealisedGrossCost string `json:"realisedGrossCost,omitempty"` // Current realised position value - RealisedCost float32 `json:"realisedCost,omitempty"` + RealisedCost string `json:"realisedCost,omitempty"` // Opened position or not IsOpen bool `json:"isOpen,omitempty"` // Mark price - MarkPrice float32 `json:"markPrice,omitempty"` + MarkPrice string `json:"markPrice,omitempty"` // Mark value - MarkValue float32 `json:"markValue,omitempty"` + MarkValue string `json:"markValue,omitempty"` // Position value - PosCost float32 `json:"posCost,omitempty"` + PosCost string `json:"posCost,omitempty"` // added margin - PosCross float32 `json:"posCross,omitempty"` + PosCross string `json:"posCross,omitempty"` // Leverage margin - PosInit float32 `json:"posInit,omitempty"` + PosInit string `json:"posInit,omitempty"` // Bankruptcy cost - PosComm float32 `json:"posComm,omitempty"` + PosComm string `json:"posComm,omitempty"` // Funding fees paid out - PosLoss float32 `json:"posLoss,omitempty"` + PosLoss string `json:"posLoss,omitempty"` // Position margin - PosMargin float32 `json:"posMargin,omitempty"` + PosMargin string `json:"posMargin,omitempty"` // Maintenance margin - PosMaint float32 `json:"posMaint,omitempty"` + PosMaint string `json:"posMaint,omitempty"` // Position margin - MaintMargin float32 `json:"maintMargin,omitempty"` + MaintMargin string `json:"maintMargin,omitempty"` // Accumulated realised gross profit value - RealisedGrossPnl float32 `json:"realisedGrossPnl,omitempty"` + RealisedGrossPnl string `json:"realisedGrossPnl,omitempty"` // Realised profit and loss - RealisedPnl float32 `json:"realisedPnl,omitempty"` + RealisedPnl string `json:"realisedPnl,omitempty"` // Unrealised profit and loss - UnrealisedPnl float32 `json:"unrealisedPnl,omitempty"` + UnrealisedPnl string `json:"unrealisedPnl,omitempty"` // Profit-loss ratio of the position - UnrealisedPnlPcnt float32 `json:"unrealisedPnlPcnt,omitempty"` + UnrealisedPnlPcnt string `json:"unrealisedPnlPcnt,omitempty"` // Rate of return on investment - UnrealisedRoePcnt float32 `json:"unrealisedRoePcnt,omitempty"` + UnrealisedRoePcnt string `json:"unrealisedRoePcnt,omitempty"` // Average entry price - AvgEntryPrice float32 `json:"avgEntryPrice,omitempty"` + AvgEntryPrice string `json:"avgEntryPrice,omitempty"` // Liquidation price - LiquidationPrice float32 `json:"liquidationPrice,omitempty"` + LiquidationPrice string `json:"liquidationPrice,omitempty"` // Bankruptcy price - BankruptPrice float32 `json:"bankruptPrice,omitempty"` - // userId - UserId int32 `json:"userId,omitempty"` + BankruptPrice string `json:"bankruptPrice,omitempty"` // Currency used to clear and settle the trades SettleCurrency string `json:"settleCurrency,omitempty"` } // NewAddIsolatedMarginResp instantiates a new AddIsolatedMarginResp object // This constructor will assign default values to properties that have it defined -func NewAddIsolatedMarginResp(id string, symbol string, autoDeposit bool, maintMarginReq float32, riskLimit int32, realLeverage float32, crossMode bool, delevPercentage float32, openingTimestamp int64, currentTimestamp int64, currentQty int32, currentCost float32, currentComm float32, unrealisedCost float32, realisedGrossCost float32, realisedCost float32, isOpen bool, markPrice float32, markValue float32, posCost float32, posCross float32, posInit float32, posComm float32, posLoss float32, posMargin float32, posMaint float32, maintMargin float32, realisedGrossPnl float32, realisedPnl float32, unrealisedPnl float32, unrealisedPnlPcnt float32, unrealisedRoePcnt float32, avgEntryPrice float32, liquidationPrice float32, bankruptPrice float32, userId int32, settleCurrency string) *AddIsolatedMarginResp { +func NewAddIsolatedMarginResp(id string, symbol string, autoDeposit bool, maintMarginReq string, riskLimit int32, realLeverage string, crossMode bool, delevPercentage float32, openingTimestamp int64, currentTimestamp int64, currentQty int32, currentCost string, currentComm string, unrealisedCost string, realisedGrossCost string, realisedCost string, isOpen bool, markPrice string, markValue string, posCost string, posCross string, posInit string, posComm string, posLoss string, posMargin string, posMaint string, maintMargin string, realisedGrossPnl string, realisedPnl string, unrealisedPnl string, unrealisedPnlPcnt string, unrealisedRoePcnt string, avgEntryPrice string, liquidationPrice string, bankruptPrice string, settleCurrency string) *AddIsolatedMarginResp { this := AddIsolatedMarginResp{} this.Id = id this.Symbol = symbol @@ -125,7 +123,6 @@ func NewAddIsolatedMarginResp(id string, symbol string, autoDeposit bool, maintM this.AvgEntryPrice = avgEntryPrice this.LiquidationPrice = liquidationPrice this.BankruptPrice = bankruptPrice - this.UserId = userId this.SettleCurrency = settleCurrency return &this } @@ -174,7 +171,6 @@ func (o *AddIsolatedMarginResp) ToMap() map[string]interface{} { toSerialize["avgEntryPrice"] = o.AvgEntryPrice toSerialize["liquidationPrice"] = o.LiquidationPrice toSerialize["bankruptPrice"] = o.BankruptPrice - toSerialize["userId"] = o.UserId toSerialize["settleCurrency"] = o.SettleCurrency return toSerialize } diff --git a/sdk/golang/pkg/generate/copytrading/futures/types_get_max_open_size_resp.go b/sdk/golang/pkg/generate/copytrading/futures/types_get_max_open_size_resp.go index 97108bd0..80992d49 100644 --- a/sdk/golang/pkg/generate/copytrading/futures/types_get_max_open_size_resp.go +++ b/sdk/golang/pkg/generate/copytrading/futures/types_get_max_open_size_resp.go @@ -13,14 +13,14 @@ type GetMaxOpenSizeResp struct { // Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) Symbol string `json:"symbol,omitempty"` // Maximum buy size - MaxBuyOpenSize int32 `json:"maxBuyOpenSize,omitempty"` + MaxBuyOpenSize string `json:"maxBuyOpenSize,omitempty"` // Maximum buy size - MaxSellOpenSize int32 `json:"maxSellOpenSize,omitempty"` + MaxSellOpenSize string `json:"maxSellOpenSize,omitempty"` } // NewGetMaxOpenSizeResp instantiates a new GetMaxOpenSizeResp object // This constructor will assign default values to properties that have it defined -func NewGetMaxOpenSizeResp(symbol string, maxBuyOpenSize int32, maxSellOpenSize int32) *GetMaxOpenSizeResp { +func NewGetMaxOpenSizeResp(symbol string, maxBuyOpenSize string, maxSellOpenSize string) *GetMaxOpenSizeResp { this := GetMaxOpenSizeResp{} this.Symbol = symbol this.MaxBuyOpenSize = maxBuyOpenSize diff --git a/sdk/golang/tests/e2e/rest/copytrading_test/futures_test.go b/sdk/golang/tests/e2e/rest/copytrading_test/futures_test.go index 4d3ff8f8..65cf1442 100644 --- a/sdk/golang/tests/e2e/rest/copytrading_test/futures_test.go +++ b/sdk/golang/tests/e2e/rest/copytrading_test/futures_test.go @@ -168,7 +168,6 @@ func TestFuturesCancelOrderByClientOidReq(t *testing.T) { } func TestFuturesGetMaxOpenSizeReq(t *testing.T) { - // TODO // GetMaxOpenSize // Get Max Open Size // /api/v1/copy-trade/futures/get-max-open-size @@ -212,49 +211,50 @@ func TestFuturesGetMaxWithdrawMarginReq(t *testing.T) { fmt.Println("data:", string(data)) } -// func TestFuturesAddIsolatedMarginReq(t *testing.T) { -// // AddIsolatedMargin -// // Add Isolated Margin -// // /api/v1/copy-trade/futures/position/margin/deposit-margin -// -// builder := futures.NewAddIsolatedMarginReqBuilder() -// builder.SetSymbol("XBTUSDTM").SetMargin(1).SetBizNo("123e4567-e89b-12d3-a456-426614174000") -// req := builder.Build() -// -// resp, err := futuresApi.AddIsolatedMargin(req, context.TODO()) -// if err != nil { -// panic(err) -// } -// data, err := json.Marshal(resp.ToMap()) -// if err != nil { -// panic(err) -// } -// fmt.Println("code:", resp.CommonResponse.Code) -// fmt.Println("message:", resp.CommonResponse.Message) -// fmt.Println("data:", string(data)) -// } -// -// func TestFuturesRemoveIsolatedMarginReq(t *testing.T) { -// // RemoveIsolatedMargin -// // Remove Isolated Margin -// // /api/v1/copy-trade/futures/position/margin/withdraw-margin -// -// builder := futures.NewRemoveIsolatedMarginReqBuilder() -// builder.SetSymbol("XBTUSDTM").SetWithdrawAmount("0.0000001") -// req := builder.Build() -// -// resp, err := futuresApi.RemoveIsolatedMargin(req, context.TODO()) -// if err != nil { -// panic(err) -// } -// data, err := json.Marshal(resp.ToMap()) -// if err != nil { -// panic(err) -// } -// fmt.Println("code:", resp.CommonResponse.Code) -// fmt.Println("message:", resp.CommonResponse.Message) -// fmt.Println("data:", string(data)) -// } +func TestFuturesAddIsolatedMarginReq(t *testing.T) { + // AddIsolatedMargin + // Add Isolated Margin + // /api/v1/copy-trade/futures/position/margin/deposit-margin + + builder := futures.NewAddIsolatedMarginReqBuilder() + builder.SetSymbol("XBTUSDTM").SetMargin(3).SetBizNo(uuid.NewString()) + req := builder.Build() + + resp, err := futuresApi.AddIsolatedMargin(req, context.TODO()) + if err != nil { + panic(err) + } + data, err := json.Marshal(resp.ToMap()) + if err != nil { + panic(err) + } + fmt.Println("code:", resp.CommonResponse.Code) + fmt.Println("message:", resp.CommonResponse.Message) + fmt.Println("data:", string(data)) +} + +func TestFuturesRemoveIsolatedMarginReq(t *testing.T) { + // RemoveIsolatedMargin + // Remove Isolated Margin + // /api/v1/copy-trade/futures/position/margin/withdraw-margin + + builder := futures.NewRemoveIsolatedMarginReqBuilder() + builder.SetSymbol("XBTUSDTM").SetWithdrawAmount("0.0000001") + req := builder.Build() + + resp, err := futuresApi.RemoveIsolatedMargin(req, context.TODO()) + if err != nil { + panic(err) + } + data, err := json.Marshal(resp.ToMap()) + if err != nil { + panic(err) + } + fmt.Println("code:", resp.CommonResponse.Code) + fmt.Println("message:", resp.CommonResponse.Message) + fmt.Println("data:", string(data)) +} + func TestFuturesModifyIsolatedMarginRiskLimtReq(t *testing.T) { // ModifyIsolatedMarginRiskLimt // Modify Isolated Margin Risk Limit diff --git a/sdk/postman/collection-REST.json b/sdk/postman/collection-REST.json index 294e62d5..b9b61342 100644 --- a/sdk/postman/collection-REST.json +++ b/sdk/postman/collection-REST.json @@ -19348,7 +19348,7 @@ } ] }, - "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470612)\n\n:::info[Description]\nGet Maximum Open Position Size.\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| symbol | string | Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) |\n| maxBuyOpenSize | integer | Maximum buy size
|\n| maxSellOpenSize | integer | Maximum buy size
|\n\n---\n", + "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470612)\n\n:::info[Description]\nGet Maximum Open Position Size.\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n **None** \n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| symbol | string | Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) |\n| maxBuyOpenSize | string | Maximum buy size
|\n| maxSellOpenSize | string | Maximum buy size
|\n\n---\n", "body": {} }, "response": [ @@ -19419,7 +19419,7 @@ } ], "cookie": [], - "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"symbol\": \"XBTUSDTM\",\n \"maxBuyOpenSize\": 8,\n \"maxSellOpenSize\": 5\n }\n}" + "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"symbol\": \"XBTUSDTM\",\n \"maxBuyOpenSize\": \"8\",\n \"maxSellOpenSize\": \"5\"\n }\n}" } ] }, @@ -19540,10 +19540,10 @@ ], "query": [] }, - "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470614)\n\n:::info[Description]\nAdd Isolated Margin Manually.\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| symbol | string | Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) |\n| margin | number | Margin amount (min. margin amount≥0.00001667XBT) |\n| bizNo | string | A unique ID generated by the user, to ensure the operation is processed by the system only once, The maximum length cannot exceed 36 |\n\n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| id | string | Position ID |\n| symbol | string | Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) |\n| autoDeposit | boolean | Auto deposit margin or not |\n| maintMarginReq | number | Maintenance margin requirement

|\n| riskLimit | integer | Risk limit
|\n| realLeverage | number | Leverage o the order |\n| crossMode | boolean | Cross mode or not |\n| delevPercentage | number | ADL ranking percentile |\n| openingTimestamp | integer | Open time |\n| currentTimestamp | integer | Current timestamp
|\n| currentQty | integer | Current postion quantity |\n| currentCost | number | Current postion value |\n| currentComm | number | Current commission |\n| unrealisedCost | number | Unrealised value |\n| realisedGrossCost | number | Accumulated realised gross profit value |\n| realisedCost | number | Current realised position value |\n| isOpen | boolean | Opened position or not |\n| markPrice | number | Mark price |\n| markValue | number | Mark value
|\n| posCost | number | Position value |\n| posCross | number | added margin |\n| posInit | number | Leverage margin |\n| posComm | number | Bankruptcy cost |\n| posLoss | number | Funding fees paid out |\n| posMargin | number | Position margin |\n| posMaint | number | Maintenance margin |\n| maintMargin | number | Position margin |\n| realisedGrossPnl | number | Accumulated realised gross profit value |\n| realisedPnl | number | Realised profit and loss |\n| unrealisedPnl | number | Unrealised profit and loss |\n| unrealisedPnlPcnt | number | Profit-loss ratio of the position |\n| unrealisedRoePcnt | number | Rate of return on investment |\n| avgEntryPrice | number | Average entry price |\n| liquidationPrice | number | Liquidation price |\n| bankruptPrice | number | Bankruptcy price |\n| userId | integer | userId |\n| settleCurrency | string | Currency used to clear and settle the trades |\n\n---\n", + "description": "# API Description\n\nFor the complete API documentation, please refer to [doc](https://www.kucoin.com/docs-new/api-3470614)\n\n:::info[Description]\nAdd Isolated Margin Manually.\n:::\n# API Schema\n\n## Request Schema\n\n\n**Request Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| symbol | string | Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) |\n| margin | number | Margin amount (min. margin amount≥0.00001667XBT) |\n| bizNo | string | A unique ID generated by the user, to ensure the operation is processed by the system only once, The maximum length cannot exceed 36 |\n\n---\n## Response Schema\n\n\n**Response Body**\n\n---\n**root Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| code | string | |\n| data | object | Refer to the schema section of data |\n\n**root.data Schema**\n\n| name | type | description |\n| --- | --- | --- |\n| id | string | Position ID |\n| symbol | string | Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) |\n| autoDeposit | boolean | Auto deposit margin or not |\n| maintMarginReq | string | Maintenance margin requirement

|\n| riskLimit | integer | Risk limit
|\n| realLeverage | string | Leverage o the order |\n| crossMode | boolean | Cross mode or not |\n| delevPercentage | number | ADL ranking percentile |\n| openingTimestamp | integer | Open time |\n| currentTimestamp | integer | Current timestamp
|\n| currentQty | integer | Current postion quantity |\n| currentCost | string | Current postion value |\n| currentComm | string | Current commission |\n| unrealisedCost | string | Unrealised value |\n| realisedGrossCost | string | Accumulated realised gross profit value |\n| realisedCost | string | Current realised position value |\n| isOpen | boolean | Opened position or not |\n| markPrice | string | Mark price |\n| markValue | string | Mark value
|\n| posCost | string | Position value |\n| posCross | string | added margin |\n| posInit | string | Leverage margin |\n| posComm | string | Bankruptcy cost |\n| posLoss | string | Funding fees paid out |\n| posMargin | string | Position margin |\n| posMaint | string | Maintenance margin |\n| maintMargin | string | Position margin |\n| realisedGrossPnl | string | Accumulated realised gross profit value |\n| realisedPnl | string | Realised profit and loss |\n| unrealisedPnl | string | Unrealised profit and loss |\n| unrealisedPnlPcnt | string | Profit-loss ratio of the position |\n| unrealisedRoePcnt | string | Rate of return on investment |\n| avgEntryPrice | string | Average entry price |\n| liquidationPrice | string | Liquidation price |\n| bankruptPrice | string | Bankruptcy price |\n| settleCurrency | string | Currency used to clear and settle the trades |\n\n---\n", "body": { "mode": "raw", - "raw": "{\n \"symbol\": \"string\",\n \"margin\": 0,\n \"bizNo\": \"string\"\n}", + "raw": "{\n \"symbol\": \"XBTUSDTM\",\n \"margin\": 3,\n \"bizNo\": \"112233\"\n}", "options": { "raw": { "language": "json" @@ -19605,7 +19605,7 @@ } ], "cookie": [], - "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"id\": \"6200c9b83aecfb000152ddcd\",\n \"symbol\": \"XBTUSDTM\",\n \"autoDeposit\": false,\n \"maintMarginReq\": 0.005,\n \"riskLimit\": 500000,\n \"realLeverage\": 18.72,\n \"crossMode\": false,\n \"delevPercentage\": 0.66,\n \"openingTimestamp\": 1646287090131,\n \"currentTimestamp\": 1646295055021,\n \"currentQty\": 1,\n \"currentCost\": 43.388,\n \"currentComm\": 0.0260328,\n \"unrealisedCost\": 43.388,\n \"realisedGrossCost\": 0,\n \"realisedCost\": 0.0260328,\n \"isOpen\": true,\n \"markPrice\": 43536.65,\n \"markValue\": 43.53665,\n \"posCost\": 43.388,\n \"posCross\": 2.4985e-05,\n \"posInit\": 2.1694,\n \"posComm\": 0.02733446,\n \"posLoss\": 0,\n \"posMargin\": 2.19675944,\n \"posMaint\": 0.24861326,\n \"maintMargin\": 2.34540944,\n \"realisedGrossPnl\": 0,\n \"realisedPnl\": -0.0260328,\n \"unrealisedPnl\": 0.14865,\n \"unrealisedPnlPcnt\": 0.0034,\n \"unrealisedRoePcnt\": 0.0685,\n \"avgEntryPrice\": 43388,\n \"liquidationPrice\": 41440,\n \"bankruptPrice\": 41218,\n \"userId\": 1234321123,\n \"settleCurrency\": \"USDT\"\n }\n}" + "body": "{\n \"code\": \"200000\",\n \"data\": {\n \"id\": \"400000000000974886\",\n \"symbol\": \"XBTUSDTM\",\n \"autoDeposit\": true,\n \"maintMarginReq\": \"0.004\",\n \"riskLimit\": 100000,\n \"realLeverage\": \"1.83\",\n \"crossMode\": false,\n \"marginMode\": \"\",\n \"positionSide\": \"\",\n \"leverage\": \"1.83\",\n \"delevPercentage\": 0.2,\n \"openingTimestamp\": 1736932881164,\n \"currentTimestamp\": 1736933530230,\n \"currentQty\": 1,\n \"currentCost\": \"97.302\",\n \"currentComm\": \"0.0583812\",\n \"unrealisedCost\": \"97.302\",\n \"realisedGrossCost\": \"0.0000000000\",\n \"realisedCost\": \"0.0583812000\",\n \"isOpen\": true,\n \"markPrice\": \"96939.98\",\n \"markValue\": \"96.9399800000\",\n \"posCost\": \"97.302\",\n \"posCross\": \"20.9874\",\n \"posInit\": \"32.4339999967\",\n \"posComm\": \"0.0904415999\",\n \"posLoss\": \"0\",\n \"posMargin\": \"53.5118415966\",\n \"posMaint\": \"0.4796495999\",\n \"maintMargin\": \"53.1498215966\",\n \"realisedGrossPnl\": \"0.0000000000\",\n \"realisedPnl\": \"-0.0583812000\",\n \"unrealisedPnl\": \"-0.3620200000\",\n \"unrealisedPnlPcnt\": \"-0.0037\",\n \"unrealisedRoePcnt\": \"-0.0112\",\n \"avgEntryPrice\": \"97302.00\",\n \"liquidationPrice\": \"44269.81\",\n \"bankruptPrice\": \"43880.61\",\n \"settleCurrency\": \"USDT\"\n }\n}" } ] }, diff --git a/sdk/python/kucoin_universal_sdk/generate/copytrading/futures/api_futures_test.py b/sdk/python/kucoin_universal_sdk/generate/copytrading/futures/api_futures_test.py index b8edf2c1..773ac4b7 100644 --- a/sdk/python/kucoin_universal_sdk/generate/copytrading/futures/api_futures_test.py +++ b/sdk/python/kucoin_universal_sdk/generate/copytrading/futures/api_futures_test.py @@ -136,7 +136,7 @@ def test_get_max_open_size_resp_model(self): Get Max Open Size /api/v1/copy-trade/futures/get-max-open-size """ - data = "{\n \"code\": \"200000\",\n \"data\": {\n \"symbol\": \"XBTUSDTM\",\n \"maxBuyOpenSize\": 8,\n \"maxSellOpenSize\": 5\n }\n}" + data = "{\n \"code\": \"200000\",\n \"data\": {\n \"symbol\": \"XBTUSDTM\",\n \"maxBuyOpenSize\": \"8\",\n \"maxSellOpenSize\": \"5\"\n }\n}" common_response = RestResponse.from_json(data) resp = GetMaxOpenSizeResp.from_dict(common_response.data) @@ -165,7 +165,7 @@ def test_add_isolated_margin_req_model(self): Add Isolated Margin /api/v1/copy-trade/futures/position/margin/deposit-margin """ - data = "{\"symbol\": \"string\", \"margin\": 0, \"bizNo\": \"string\"}" + data = "{\"symbol\": \"XBTUSDTM\", \"margin\": 3, \"bizNo\": \"112233\"}" req = AddIsolatedMarginReq.from_json(data) def test_add_isolated_margin_resp_model(self): @@ -174,7 +174,7 @@ def test_add_isolated_margin_resp_model(self): Add Isolated Margin /api/v1/copy-trade/futures/position/margin/deposit-margin """ - data = "{\n \"code\": \"200000\",\n \"data\": {\n \"id\": \"6200c9b83aecfb000152ddcd\",\n \"symbol\": \"XBTUSDTM\",\n \"autoDeposit\": false,\n \"maintMarginReq\": 0.005,\n \"riskLimit\": 500000,\n \"realLeverage\": 18.72,\n \"crossMode\": false,\n \"delevPercentage\": 0.66,\n \"openingTimestamp\": 1646287090131,\n \"currentTimestamp\": 1646295055021,\n \"currentQty\": 1,\n \"currentCost\": 43.388,\n \"currentComm\": 0.0260328,\n \"unrealisedCost\": 43.388,\n \"realisedGrossCost\": 0,\n \"realisedCost\": 0.0260328,\n \"isOpen\": true,\n \"markPrice\": 43536.65,\n \"markValue\": 43.53665,\n \"posCost\": 43.388,\n \"posCross\": 0.000024985,\n \"posInit\": 2.1694,\n \"posComm\": 0.02733446,\n \"posLoss\": 0,\n \"posMargin\": 2.19675944,\n \"posMaint\": 0.24861326,\n \"maintMargin\": 2.34540944,\n \"realisedGrossPnl\": 0,\n \"realisedPnl\": -0.0260328,\n \"unrealisedPnl\": 0.14865,\n \"unrealisedPnlPcnt\": 0.0034,\n \"unrealisedRoePcnt\": 0.0685,\n \"avgEntryPrice\": 43388,\n \"liquidationPrice\": 41440,\n \"bankruptPrice\": 41218,\n \"userId\": 1234321123,\n \"settleCurrency\": \"USDT\"\n }\n}" + data = "{\n \"code\": \"200000\",\n \"data\": {\n \"id\": \"400000000000974886\",\n \"symbol\": \"XBTUSDTM\",\n \"autoDeposit\": true,\n \"maintMarginReq\": \"0.004\",\n \"riskLimit\": 100000,\n \"realLeverage\": \"1.83\",\n \"crossMode\": false,\n \"marginMode\": \"\",\n \"positionSide\": \"\",\n \"leverage\": \"1.83\",\n \"delevPercentage\": 0.2,\n \"openingTimestamp\": 1736932881164,\n \"currentTimestamp\": 1736933530230,\n \"currentQty\": 1,\n \"currentCost\": \"97.302\",\n \"currentComm\": \"0.0583812\",\n \"unrealisedCost\": \"97.302\",\n \"realisedGrossCost\": \"0.0000000000\",\n \"realisedCost\": \"0.0583812000\",\n \"isOpen\": true,\n \"markPrice\": \"96939.98\",\n \"markValue\": \"96.9399800000\",\n \"posCost\": \"97.302\",\n \"posCross\": \"20.9874\",\n \"posInit\": \"32.4339999967\",\n \"posComm\": \"0.0904415999\",\n \"posLoss\": \"0\",\n \"posMargin\": \"53.5118415966\",\n \"posMaint\": \"0.4796495999\",\n \"maintMargin\": \"53.1498215966\",\n \"realisedGrossPnl\": \"0.0000000000\",\n \"realisedPnl\": \"-0.0583812000\",\n \"unrealisedPnl\": \"-0.3620200000\",\n \"unrealisedPnlPcnt\": \"-0.0037\",\n \"unrealisedRoePcnt\": \"-0.0112\",\n \"avgEntryPrice\": \"97302.00\",\n \"liquidationPrice\": \"44269.81\",\n \"bankruptPrice\": \"43880.61\",\n \"settleCurrency\": \"USDT\"\n }\n}" common_response = RestResponse.from_json(data) resp = AddIsolatedMarginResp.from_dict(common_response.data) diff --git a/sdk/python/kucoin_universal_sdk/generate/copytrading/futures/model_add_isolated_margin_resp.py b/sdk/python/kucoin_universal_sdk/generate/copytrading/futures/model_add_isolated_margin_resp.py index 54ea9a91..2a3804fd 100644 --- a/sdk/python/kucoin_universal_sdk/generate/copytrading/futures/model_add_isolated_margin_resp.py +++ b/sdk/python/kucoin_universal_sdk/generate/copytrading/futures/model_add_isolated_margin_resp.py @@ -20,39 +20,38 @@ class AddIsolatedMarginResp(BaseModel, Response): id (str): Position ID symbol (str): Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) auto_deposit (bool): Auto deposit margin or not - maint_margin_req (float): Maintenance margin requirement + maint_margin_req (str): Maintenance margin requirement risk_limit (int): Risk limit - real_leverage (float): Leverage o the order + real_leverage (str): Leverage o the order cross_mode (bool): Cross mode or not delev_percentage (float): ADL ranking percentile opening_timestamp (int): Open time current_timestamp (int): Current timestamp current_qty (int): Current postion quantity - current_cost (float): Current postion value - current_comm (float): Current commission - unrealised_cost (float): Unrealised value - realised_gross_cost (float): Accumulated realised gross profit value - realised_cost (float): Current realised position value + current_cost (str): Current postion value + current_comm (str): Current commission + unrealised_cost (str): Unrealised value + realised_gross_cost (str): Accumulated realised gross profit value + realised_cost (str): Current realised position value is_open (bool): Opened position or not - mark_price (float): Mark price - mark_value (float): Mark value - pos_cost (float): Position value - pos_cross (float): added margin - pos_init (float): Leverage margin - pos_comm (float): Bankruptcy cost - pos_loss (float): Funding fees paid out - pos_margin (float): Position margin - pos_maint (float): Maintenance margin - maint_margin (float): Position margin - realised_gross_pnl (float): Accumulated realised gross profit value - realised_pnl (float): Realised profit and loss - unrealised_pnl (float): Unrealised profit and loss - unrealised_pnl_pcnt (float): Profit-loss ratio of the position - unrealised_roe_pcnt (float): Rate of return on investment - avg_entry_price (float): Average entry price - liquidation_price (float): Liquidation price - bankrupt_price (float): Bankruptcy price - user_id (int): userId + mark_price (str): Mark price + mark_value (str): Mark value + pos_cost (str): Position value + pos_cross (str): added margin + pos_init (str): Leverage margin + pos_comm (str): Bankruptcy cost + pos_loss (str): Funding fees paid out + pos_margin (str): Position margin + pos_maint (str): Maintenance margin + maint_margin (str): Position margin + realised_gross_pnl (str): Accumulated realised gross profit value + realised_pnl (str): Realised profit and loss + unrealised_pnl (str): Unrealised profit and loss + unrealised_pnl_pcnt (str): Profit-loss ratio of the position + unrealised_roe_pcnt (str): Rate of return on investment + avg_entry_price (str): Average entry price + liquidation_price (str): Liquidation price + bankrupt_price (str): Bankruptcy price settle_currency (str): Currency used to clear and settle the trades """ @@ -68,16 +67,16 @@ class AddIsolatedMarginResp(BaseModel, Response): default=None, description="Auto deposit margin or not", alias="autoDeposit") - maint_margin_req: Optional[float] = Field( + maint_margin_req: Optional[str] = Field( default=None, description="Maintenance margin requirement ", alias="maintMarginReq") risk_limit: Optional[int] = Field(default=None, description="Risk limit ", alias="riskLimit") - real_leverage: Optional[float] = Field(default=None, - description="Leverage o the order", - alias="realLeverage") + real_leverage: Optional[str] = Field(default=None, + description="Leverage o the order", + alias="realLeverage") cross_mode: Optional[bool] = Field(default=None, description="Cross mode or not", alias="crossMode") @@ -94,88 +93,84 @@ class AddIsolatedMarginResp(BaseModel, Response): current_qty: Optional[int] = Field(default=None, description="Current postion quantity", alias="currentQty") - current_cost: Optional[float] = Field(default=None, - description="Current postion value", - alias="currentCost") - current_comm: Optional[float] = Field(default=None, - description="Current commission", - alias="currentComm") - unrealised_cost: Optional[float] = Field(default=None, - description="Unrealised value", - alias="unrealisedCost") - realised_gross_cost: Optional[float] = Field( + current_cost: Optional[str] = Field(default=None, + description="Current postion value", + alias="currentCost") + current_comm: Optional[str] = Field(default=None, + description="Current commission", + alias="currentComm") + unrealised_cost: Optional[str] = Field(default=None, + description="Unrealised value", + alias="unrealisedCost") + realised_gross_cost: Optional[str] = Field( default=None, description="Accumulated realised gross profit value", alias="realisedGrossCost") - realised_cost: Optional[float] = Field( + realised_cost: Optional[str] = Field( default=None, description="Current realised position value", alias="realisedCost") is_open: Optional[bool] = Field(default=None, description="Opened position or not", alias="isOpen") - mark_price: Optional[float] = Field(default=None, - description="Mark price", - alias="markPrice") - mark_value: Optional[float] = Field(default=None, - description="Mark value ", - alias="markValue") - pos_cost: Optional[float] = Field(default=None, - description="Position value", - alias="posCost") - pos_cross: Optional[float] = Field(default=None, - description="added margin", - alias="posCross") - pos_init: Optional[float] = Field(default=None, - description="Leverage margin", - alias="posInit") - pos_comm: Optional[float] = Field(default=None, - description="Bankruptcy cost", - alias="posComm") - pos_loss: Optional[float] = Field(default=None, - description="Funding fees paid out", - alias="posLoss") - pos_margin: Optional[float] = Field(default=None, + mark_price: Optional[str] = Field(default=None, + description="Mark price", + alias="markPrice") + mark_value: Optional[str] = Field(default=None, + description="Mark value ", + alias="markValue") + pos_cost: Optional[str] = Field(default=None, + description="Position value", + alias="posCost") + pos_cross: Optional[str] = Field(default=None, + description="added margin", + alias="posCross") + pos_init: Optional[str] = Field(default=None, + description="Leverage margin", + alias="posInit") + pos_comm: Optional[str] = Field(default=None, + description="Bankruptcy cost", + alias="posComm") + pos_loss: Optional[str] = Field(default=None, + description="Funding fees paid out", + alias="posLoss") + pos_margin: Optional[str] = Field(default=None, + description="Position margin", + alias="posMargin") + pos_maint: Optional[str] = Field(default=None, + description="Maintenance margin", + alias="posMaint") + maint_margin: Optional[str] = Field(default=None, description="Position margin", - alias="posMargin") - pos_maint: Optional[float] = Field(default=None, - description="Maintenance margin", - alias="posMaint") - maint_margin: Optional[float] = Field(default=None, - description="Position margin", - alias="maintMargin") - realised_gross_pnl: Optional[float] = Field( + alias="maintMargin") + realised_gross_pnl: Optional[str] = Field( default=None, description="Accumulated realised gross profit value", alias="realisedGrossPnl") - realised_pnl: Optional[float] = Field( - default=None, - description="Realised profit and loss", - alias="realisedPnl") - unrealised_pnl: Optional[float] = Field( + realised_pnl: Optional[str] = Field(default=None, + description="Realised profit and loss", + alias="realisedPnl") + unrealised_pnl: Optional[str] = Field( default=None, description="Unrealised profit and loss", alias="unrealisedPnl") - unrealised_pnl_pcnt: Optional[float] = Field( + unrealised_pnl_pcnt: Optional[str] = Field( default=None, description="Profit-loss ratio of the position", alias="unrealisedPnlPcnt") - unrealised_roe_pcnt: Optional[float] = Field( + unrealised_roe_pcnt: Optional[str] = Field( default=None, description="Rate of return on investment", alias="unrealisedRoePcnt") - avg_entry_price: Optional[float] = Field(default=None, - description="Average entry price", - alias="avgEntryPrice") - liquidation_price: Optional[float] = Field(default=None, - description="Liquidation price", - alias="liquidationPrice") - bankrupt_price: Optional[float] = Field(default=None, - description="Bankruptcy price", - alias="bankruptPrice") - user_id: Optional[int] = Field(default=None, - description="userId", - alias="userId") + avg_entry_price: Optional[str] = Field(default=None, + description="Average entry price", + alias="avgEntryPrice") + liquidation_price: Optional[str] = Field(default=None, + description="Liquidation price", + alias="liquidationPrice") + bankrupt_price: Optional[str] = Field(default=None, + description="Bankruptcy price", + alias="bankruptPrice") settle_currency: Optional[str] = Field( default=None, description="Currency used to clear and settle the trades", @@ -190,7 +185,7 @@ class AddIsolatedMarginResp(BaseModel, Response): "posLoss", "posMargin", "posMaint", "maintMargin", "realisedGrossPnl", "realisedPnl", "unrealisedPnl", "unrealisedPnlPcnt", "unrealisedRoePcnt", "avgEntryPrice", "liquidationPrice", - "bankruptPrice", "userId", "settleCurrency" + "bankruptPrice", "settleCurrency" ] model_config = ConfigDict( @@ -297,8 +292,6 @@ def from_dict( obj.get("liquidationPrice"), "bankruptPrice": obj.get("bankruptPrice"), - "userId": - obj.get("userId"), "settleCurrency": obj.get("settleCurrency") }) diff --git a/sdk/python/kucoin_universal_sdk/generate/copytrading/futures/model_get_max_open_size_resp.py b/sdk/python/kucoin_universal_sdk/generate/copytrading/futures/model_get_max_open_size_resp.py index 41e34a3a..e446b6e6 100644 --- a/sdk/python/kucoin_universal_sdk/generate/copytrading/futures/model_get_max_open_size_resp.py +++ b/sdk/python/kucoin_universal_sdk/generate/copytrading/futures/model_get_max_open_size_resp.py @@ -18,8 +18,8 @@ class GetMaxOpenSizeResp(BaseModel, Response): Attributes: symbol (str): Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) - max_buy_open_size (int): Maximum buy size - max_sell_open_size (int): Maximum buy size + max_buy_open_size (str): Maximum buy size + max_sell_open_size (str): Maximum buy size """ common_response: Optional[RestResponse] = Field( @@ -29,10 +29,10 @@ class GetMaxOpenSizeResp(BaseModel, Response): description= "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) " ) - max_buy_open_size: Optional[int] = Field(default=None, + max_buy_open_size: Optional[str] = Field(default=None, description="Maximum buy size ", alias="maxBuyOpenSize") - max_sell_open_size: Optional[int] = Field(default=None, + max_sell_open_size: Optional[str] = Field(default=None, description="Maximum buy size ", alias="maxSellOpenSize") diff --git a/sdk/python/test/e2e/rest/copytrading_test/copytrading_futures.py b/sdk/python/test/e2e/rest/copytrading_test/copytrading_futures.py index a7a9c67a..4d050fae 100644 --- a/sdk/python/test/e2e/rest/copytrading_test/copytrading_futures.py +++ b/sdk/python/test/e2e/rest/copytrading_test/copytrading_futures.py @@ -68,9 +68,8 @@ def test_add_order_req(self): builder = AddOrderReqBuilder() builder.set_client_oid(uuid.uuid4().__str__()).set_side(AddOrderReq.SideEnum.BUY).set_symbol( - 'XBTUSDTM').set_leverage(3).set_type(AddOrderReq.TypeEnum.LIMIT).set_remark( - 'order remarks').set_reduce_only(False).set_margin_mode(AddOrderReq.MarginModeEnum.ISOLATED).set_price( - '0.1').set_size(1).set_time_in_force(AddOrderReq.TimeInForceEnum.GOOD_TILL_CANCELED) + 'XBTUSDTM').set_leverage(3).set_type(AddOrderReq.TypeEnum.MARKET).set_remark( + 'order remarks').set_size(1) req = builder.build() try: resp = self.api.add_order(req) @@ -203,7 +202,6 @@ def test_get_max_withdraw_margin_req(self): print("error: ", e) raise e - # TODO def test_add_isolated_margin_req(self): """ add_isolated_margin @@ -212,7 +210,7 @@ def test_add_isolated_margin_req(self): """ builder = AddIsolatedMarginReqBuilder() - builder.set_symbol("XBTUSDTM").set_margin(1).set_biz_no(uuid.uuid4().__str__()) + builder.set_symbol("XBTUSDTM").set_margin(3).set_biz_no(uuid.uuid4().__str__()) req = builder.build() try: resp = self.api.add_isolated_margin(req) @@ -223,7 +221,6 @@ def test_add_isolated_margin_req(self): print("error: ", e) raise e - # TODO def test_remove_isolated_margin_req(self): """ remove_isolated_margin diff --git a/spec/original/meta.json b/spec/original/meta.json index 41508c35..c22b0515 100644 --- a/spec/original/meta.json +++ b/spec/original/meta.json @@ -40751,11 +40751,11 @@ "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](apidog://link/endpoint/3470220) " }, "maxBuyOpenSize": { - "type": "integer", + "type": "string", "description": "Maximum buy size\n" }, "maxSellOpenSize": { - "type": "integer", + "type": "string", "description": "Maximum buy size\n" } }, @@ -40779,7 +40779,7 @@ "responseExamples": [ { "name": "Success", - "data": "{\r\n \"code\": \"200000\",\r\n \"data\": {\r\n \"symbol\": \"XBTUSDTM\",\r\n \"maxBuyOpenSize\": 8,\r\n \"maxSellOpenSize\": 5\r\n }\r\n}", + "data": "{\n \"code\": \"200000\",\n \"data\": {\n \"symbol\": \"XBTUSDTM\",\n \"maxBuyOpenSize\": \"8\",\n \"maxSellOpenSize\": \"5\"\n }\n}", "responseId": 11102, "ordering": 1 } @@ -40908,7 +40908,7 @@ "description": "Auto deposit margin or not" }, "maintMarginReq": { - "type": "number", + "type": "string", "description": "Maintenance margin requirement\n\n" }, "riskLimit": { @@ -40916,7 +40916,7 @@ "description": "Risk limit\n" }, "realLeverage": { - "type": "number", + "type": "string", "description": "Leverage o the order" }, "crossMode": { @@ -40942,23 +40942,23 @@ "description": "Current postion quantity" }, "currentCost": { - "type": "number", + "type": "string", "description": "Current postion value" }, "currentComm": { - "type": "number", + "type": "string", "description": "Current commission" }, "unrealisedCost": { - "type": "number", + "type": "string", "description": "Unrealised value" }, "realisedGrossCost": { - "type": "number", + "type": "string", "description": "Accumulated realised gross profit value" }, "realisedCost": { - "type": "number", + "type": "string", "description": "Current realised position value" }, "isOpen": { @@ -40966,81 +40966,77 @@ "description": "Opened position or not" }, "markPrice": { - "type": "number", + "type": "string", "description": "Mark price" }, "markValue": { - "type": "number", + "type": "string", "description": "Mark value\n" }, "posCost": { - "type": "number", + "type": "string", "description": "Position value" }, "posCross": { - "type": "number", + "type": "string", "description": "added margin" }, "posInit": { - "type": "number", + "type": "string", "description": "Leverage margin" }, "posComm": { - "type": "number", + "type": "string", "description": "Bankruptcy cost" }, "posLoss": { - "type": "number", + "type": "string", "description": "Funding fees paid out" }, "posMargin": { - "type": "number", + "type": "string", "description": "Position margin" }, "posMaint": { - "type": "number", + "type": "string", "description": "Maintenance margin" }, "maintMargin": { - "type": "number", + "type": "string", "description": "Position margin" }, "realisedGrossPnl": { - "type": "number", + "type": "string", "description": "Accumulated realised gross profit value" }, "realisedPnl": { - "type": "number", + "type": "string", "description": "Realised profit and loss" }, "unrealisedPnl": { - "type": "number", + "type": "string", "description": "Unrealised profit and loss" }, "unrealisedPnlPcnt": { - "type": "number", + "type": "string", "description": "Profit-loss ratio of the position" }, "unrealisedRoePcnt": { - "type": "number", + "type": "string", "description": "Rate of return on investment" }, "avgEntryPrice": { - "type": "number", + "type": "string", "description": "Average entry price" }, "liquidationPrice": { - "type": "number", + "type": "string", "description": "Liquidation price" }, "bankruptPrice": { - "type": "number", + "type": "string", "description": "Bankruptcy price" }, - "userId": { - "type": "integer", - "description": "userId" - }, "settleCurrency": { "type": "string", "description": "Currency used to clear and settle the trades" @@ -41082,7 +41078,6 @@ "avgEntryPrice", "liquidationPrice", "bankruptPrice", - "userId", "settleCurrency" ] } @@ -41100,7 +41095,7 @@ "responseExamples": [ { "name": "Success", - "data": "{\n \"code\": \"200000\",\n \"data\": {\n \"id\": \"6200c9b83aecfb000152ddcd\",\n \"symbol\": \"XBTUSDTM\",\n \"autoDeposit\": false,\n \"maintMarginReq\": 0.005,\n \"riskLimit\": 500000,\n \"realLeverage\": 18.72,\n \"crossMode\": false,\n \"delevPercentage\": 0.66,\n \"openingTimestamp\": 1646287090131,\n \"currentTimestamp\": 1646295055021,\n \"currentQty\": 1,\n \"currentCost\": 43.388,\n \"currentComm\": 0.0260328,\n \"unrealisedCost\": 43.388,\n \"realisedGrossCost\": 0,\n \"realisedCost\": 0.0260328,\n \"isOpen\": true,\n \"markPrice\": 43536.65,\n \"markValue\": 43.53665,\n \"posCost\": 43.388,\n \"posCross\": 0.000024985,\n \"posInit\": 2.1694,\n \"posComm\": 0.02733446,\n \"posLoss\": 0,\n \"posMargin\": 2.19675944,\n \"posMaint\": 0.24861326,\n \"maintMargin\": 2.34540944,\n \"realisedGrossPnl\": 0,\n \"realisedPnl\": -0.0260328,\n \"unrealisedPnl\": 0.14865,\n \"unrealisedPnlPcnt\": 0.0034,\n \"unrealisedRoePcnt\": 0.0685,\n \"avgEntryPrice\": 43388,\n \"liquidationPrice\": 41440,\n \"bankruptPrice\": 41218,\n \"userId\": 1234321123,\n \"settleCurrency\": \"USDT\"\n }\n}", + "data": "{\n \"code\": \"200000\",\n \"data\": {\n \"id\": \"400000000000974886\",\n \"symbol\": \"XBTUSDTM\",\n \"autoDeposit\": true,\n \"maintMarginReq\": \"0.004\",\n \"riskLimit\": 100000,\n \"realLeverage\": \"1.83\",\n \"crossMode\": false,\n \"marginMode\": \"\",\n \"positionSide\": \"\",\n \"leverage\": \"1.83\",\n \"delevPercentage\": 0.2,\n \"openingTimestamp\": 1736932881164,\n \"currentTimestamp\": 1736933530230,\n \"currentQty\": 1,\n \"currentCost\": \"97.302\",\n \"currentComm\": \"0.0583812\",\n \"unrealisedCost\": \"97.302\",\n \"realisedGrossCost\": \"0.0000000000\",\n \"realisedCost\": \"0.0583812000\",\n \"isOpen\": true,\n \"markPrice\": \"96939.98\",\n \"markValue\": \"96.9399800000\",\n \"posCost\": \"97.302\",\n \"posCross\": \"20.9874\",\n \"posInit\": \"32.4339999967\",\n \"posComm\": \"0.0904415999\",\n \"posLoss\": \"0\",\n \"posMargin\": \"53.5118415966\",\n \"posMaint\": \"0.4796495999\",\n \"maintMargin\": \"53.1498215966\",\n \"realisedGrossPnl\": \"0.0000000000\",\n \"realisedPnl\": \"-0.0583812000\",\n \"unrealisedPnl\": \"-0.3620200000\",\n \"unrealisedPnlPcnt\": \"-0.0037\",\n \"unrealisedRoePcnt\": \"-0.0112\",\n \"avgEntryPrice\": \"97302.00\",\n \"liquidationPrice\": \"44269.81\",\n \"bankruptPrice\": \"43880.61\",\n \"settleCurrency\": \"USDT\"\n }\n}", "responseId": 11163, "ordering": 1 } @@ -41130,7 +41125,7 @@ "bizNo" ] }, - "example": "{\n \"symbol\": \"string\",\n \"margin\": 0,\n \"bizNo\": \"string\"\n}", + "example": "{\n \"symbol\": \"XBTUSDTM\",\n \"margin\": 3,\n \"bizNo\": \"112233\"\n}", "mediaType": "" }, "description": ":::info[Description]\nAdd Isolated Margin Manually.\n:::", diff --git a/spec/rest/api/openapi-copytrading-futures.json b/spec/rest/api/openapi-copytrading-futures.json index 4539d752..e816d910 100644 --- a/spec/rest/api/openapi-copytrading-futures.json +++ b/spec/rest/api/openapi-copytrading-futures.json @@ -1060,11 +1060,11 @@ "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) " }, "maxBuyOpenSize": { - "type": "integer", + "type": "string", "description": "Maximum buy size\n" }, "maxSellOpenSize": { - "type": "integer", + "type": "string", "description": "Maximum buy size\n" } }, @@ -1095,7 +1095,7 @@ "x-sdk-method-name": "GetMaxOpenSize", "x-sdk-method-description": "Get Maximum Open Position Size.", "x-api-rate-limit": 2, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"maxBuyOpenSize\\\": 8,\\n \\\"maxSellOpenSize\\\": 5\\n }\\n}", + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"maxBuyOpenSize\\\": \\\"8\\\",\\n \\\"maxSellOpenSize\\\": \\\"5\\\"\\n }\\n}", "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDTM\\\", \\\"price\\\": \\\"example_string_default_value\\\", \\\"leverage\\\": 123456}", "operationId": "006" } @@ -1192,7 +1192,7 @@ "description": "Auto deposit margin or not" }, "maintMarginReq": { - "type": "number", + "type": "string", "description": "Maintenance margin requirement\n\n" }, "riskLimit": { @@ -1200,7 +1200,7 @@ "description": "Risk limit\n" }, "realLeverage": { - "type": "number", + "type": "string", "description": "Leverage o the order" }, "crossMode": { @@ -1226,23 +1226,23 @@ "description": "Current postion quantity" }, "currentCost": { - "type": "number", + "type": "string", "description": "Current postion value" }, "currentComm": { - "type": "number", + "type": "string", "description": "Current commission" }, "unrealisedCost": { - "type": "number", + "type": "string", "description": "Unrealised value" }, "realisedGrossCost": { - "type": "number", + "type": "string", "description": "Accumulated realised gross profit value" }, "realisedCost": { - "type": "number", + "type": "string", "description": "Current realised position value" }, "isOpen": { @@ -1250,81 +1250,77 @@ "description": "Opened position or not" }, "markPrice": { - "type": "number", + "type": "string", "description": "Mark price" }, "markValue": { - "type": "number", + "type": "string", "description": "Mark value\n" }, "posCost": { - "type": "number", + "type": "string", "description": "Position value" }, "posCross": { - "type": "number", + "type": "string", "description": "added margin" }, "posInit": { - "type": "number", + "type": "string", "description": "Leverage margin" }, "posComm": { - "type": "number", + "type": "string", "description": "Bankruptcy cost" }, "posLoss": { - "type": "number", + "type": "string", "description": "Funding fees paid out" }, "posMargin": { - "type": "number", + "type": "string", "description": "Position margin" }, "posMaint": { - "type": "number", + "type": "string", "description": "Maintenance margin" }, "maintMargin": { - "type": "number", + "type": "string", "description": "Position margin" }, "realisedGrossPnl": { - "type": "number", + "type": "string", "description": "Accumulated realised gross profit value" }, "realisedPnl": { - "type": "number", + "type": "string", "description": "Realised profit and loss" }, "unrealisedPnl": { - "type": "number", + "type": "string", "description": "Unrealised profit and loss" }, "unrealisedPnlPcnt": { - "type": "number", + "type": "string", "description": "Profit-loss ratio of the position" }, "unrealisedRoePcnt": { - "type": "number", + "type": "string", "description": "Rate of return on investment" }, "avgEntryPrice": { - "type": "number", + "type": "string", "description": "Average entry price" }, "liquidationPrice": { - "type": "number", + "type": "string", "description": "Liquidation price" }, "bankruptPrice": { - "type": "number", + "type": "string", "description": "Bankruptcy price" }, - "userId": { - "type": "integer", - "description": "userId" - }, "settleCurrency": { "type": "string", "description": "Currency used to clear and settle the trades" @@ -1366,7 +1362,6 @@ "avgEntryPrice", "liquidationPrice", "bankruptPrice", - "userId", "settleCurrency" ] } @@ -1416,12 +1411,12 @@ "bizNo" ] }, - "example": "{\n \"symbol\": \"string\",\n \"margin\": 0,\n \"bizNo\": \"string\"\n}" + "example": "{\n \"symbol\": \"XBTUSDTM\",\n \"margin\": 3,\n \"bizNo\": \"112233\"\n}" } } }, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"id\\\": \\\"6200c9b83aecfb000152ddcd\\\",\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"autoDeposit\\\": false,\\n \\\"maintMarginReq\\\": 0.005,\\n \\\"riskLimit\\\": 500000,\\n \\\"realLeverage\\\": 18.72,\\n \\\"crossMode\\\": false,\\n \\\"delevPercentage\\\": 0.66,\\n \\\"openingTimestamp\\\": 1646287090131,\\n \\\"currentTimestamp\\\": 1646295055021,\\n \\\"currentQty\\\": 1,\\n \\\"currentCost\\\": 43.388,\\n \\\"currentComm\\\": 0.0260328,\\n \\\"unrealisedCost\\\": 43.388,\\n \\\"realisedGrossCost\\\": 0,\\n \\\"realisedCost\\\": 0.0260328,\\n \\\"isOpen\\\": true,\\n \\\"markPrice\\\": 43536.65,\\n \\\"markValue\\\": 43.53665,\\n \\\"posCost\\\": 43.388,\\n \\\"posCross\\\": 0.000024985,\\n \\\"posInit\\\": 2.1694,\\n \\\"posComm\\\": 0.02733446,\\n \\\"posLoss\\\": 0,\\n \\\"posMargin\\\": 2.19675944,\\n \\\"posMaint\\\": 0.24861326,\\n \\\"maintMargin\\\": 2.34540944,\\n \\\"realisedGrossPnl\\\": 0,\\n \\\"realisedPnl\\\": -0.0260328,\\n \\\"unrealisedPnl\\\": 0.14865,\\n \\\"unrealisedPnlPcnt\\\": 0.0034,\\n \\\"unrealisedRoePcnt\\\": 0.0685,\\n \\\"avgEntryPrice\\\": 43388,\\n \\\"liquidationPrice\\\": 41440,\\n \\\"bankruptPrice\\\": 41218,\\n \\\"userId\\\": 1234321123,\\n \\\"settleCurrency\\\": \\\"USDT\\\"\\n }\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"string\\\", \\\"margin\\\": 0, \\\"bizNo\\\": \\\"string\\\"}", + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"id\\\": \\\"400000000000974886\\\",\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"autoDeposit\\\": true,\\n \\\"maintMarginReq\\\": \\\"0.004\\\",\\n \\\"riskLimit\\\": 100000,\\n \\\"realLeverage\\\": \\\"1.83\\\",\\n \\\"crossMode\\\": false,\\n \\\"marginMode\\\": \\\"\\\",\\n \\\"positionSide\\\": \\\"\\\",\\n \\\"leverage\\\": \\\"1.83\\\",\\n \\\"delevPercentage\\\": 0.2,\\n \\\"openingTimestamp\\\": 1736932881164,\\n \\\"currentTimestamp\\\": 1736933530230,\\n \\\"currentQty\\\": 1,\\n \\\"currentCost\\\": \\\"97.302\\\",\\n \\\"currentComm\\\": \\\"0.0583812\\\",\\n \\\"unrealisedCost\\\": \\\"97.302\\\",\\n \\\"realisedGrossCost\\\": \\\"0.0000000000\\\",\\n \\\"realisedCost\\\": \\\"0.0583812000\\\",\\n \\\"isOpen\\\": true,\\n \\\"markPrice\\\": \\\"96939.98\\\",\\n \\\"markValue\\\": \\\"96.9399800000\\\",\\n \\\"posCost\\\": \\\"97.302\\\",\\n \\\"posCross\\\": \\\"20.9874\\\",\\n \\\"posInit\\\": \\\"32.4339999967\\\",\\n \\\"posComm\\\": \\\"0.0904415999\\\",\\n \\\"posLoss\\\": \\\"0\\\",\\n \\\"posMargin\\\": \\\"53.5118415966\\\",\\n \\\"posMaint\\\": \\\"0.4796495999\\\",\\n \\\"maintMargin\\\": \\\"53.1498215966\\\",\\n \\\"realisedGrossPnl\\\": \\\"0.0000000000\\\",\\n \\\"realisedPnl\\\": \\\"-0.0583812000\\\",\\n \\\"unrealisedPnl\\\": \\\"-0.3620200000\\\",\\n \\\"unrealisedPnlPcnt\\\": \\\"-0.0037\\\",\\n \\\"unrealisedRoePcnt\\\": \\\"-0.0112\\\",\\n \\\"avgEntryPrice\\\": \\\"97302.00\\\",\\n \\\"liquidationPrice\\\": \\\"44269.81\\\",\\n \\\"bankruptPrice\\\": \\\"43880.61\\\",\\n \\\"settleCurrency\\\": \\\"USDT\\\"\\n }\\n}", + "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDTM\\\", \\\"margin\\\": 3, \\\"bizNo\\\": \\\"112233\\\"}", "operationId": "008" } }, diff --git a/spec/rest/entry/openapi-copytrading.json b/spec/rest/entry/openapi-copytrading.json index 55e1ffbf..6e4ceb20 100644 --- a/spec/rest/entry/openapi-copytrading.json +++ b/spec/rest/entry/openapi-copytrading.json @@ -1060,11 +1060,11 @@ "description": "Symbol of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) " }, "maxBuyOpenSize": { - "type": "integer", + "type": "string", "description": "Maximum buy size\n" }, "maxSellOpenSize": { - "type": "integer", + "type": "string", "description": "Maximum buy size\n" } }, @@ -1095,7 +1095,7 @@ "x-sdk-method-name": "GetMaxOpenSize", "x-sdk-method-description": "Get Maximum Open Position Size.", "x-api-rate-limit": 2, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"maxBuyOpenSize\\\": 8,\\n \\\"maxSellOpenSize\\\": 5\\n }\\n}", + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"maxBuyOpenSize\\\": \\\"8\\\",\\n \\\"maxSellOpenSize\\\": \\\"5\\\"\\n }\\n}", "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDTM\\\", \\\"price\\\": \\\"example_string_default_value\\\", \\\"leverage\\\": 123456}", "operationId": "006" } @@ -1192,7 +1192,7 @@ "description": "Auto deposit margin or not" }, "maintMarginReq": { - "type": "number", + "type": "string", "description": "Maintenance margin requirement\n\n" }, "riskLimit": { @@ -1200,7 +1200,7 @@ "description": "Risk limit\n" }, "realLeverage": { - "type": "number", + "type": "string", "description": "Leverage o the order" }, "crossMode": { @@ -1226,23 +1226,23 @@ "description": "Current postion quantity" }, "currentCost": { - "type": "number", + "type": "string", "description": "Current postion value" }, "currentComm": { - "type": "number", + "type": "string", "description": "Current commission" }, "unrealisedCost": { - "type": "number", + "type": "string", "description": "Unrealised value" }, "realisedGrossCost": { - "type": "number", + "type": "string", "description": "Accumulated realised gross profit value" }, "realisedCost": { - "type": "number", + "type": "string", "description": "Current realised position value" }, "isOpen": { @@ -1250,81 +1250,77 @@ "description": "Opened position or not" }, "markPrice": { - "type": "number", + "type": "string", "description": "Mark price" }, "markValue": { - "type": "number", + "type": "string", "description": "Mark value\n" }, "posCost": { - "type": "number", + "type": "string", "description": "Position value" }, "posCross": { - "type": "number", + "type": "string", "description": "added margin" }, "posInit": { - "type": "number", + "type": "string", "description": "Leverage margin" }, "posComm": { - "type": "number", + "type": "string", "description": "Bankruptcy cost" }, "posLoss": { - "type": "number", + "type": "string", "description": "Funding fees paid out" }, "posMargin": { - "type": "number", + "type": "string", "description": "Position margin" }, "posMaint": { - "type": "number", + "type": "string", "description": "Maintenance margin" }, "maintMargin": { - "type": "number", + "type": "string", "description": "Position margin" }, "realisedGrossPnl": { - "type": "number", + "type": "string", "description": "Accumulated realised gross profit value" }, "realisedPnl": { - "type": "number", + "type": "string", "description": "Realised profit and loss" }, "unrealisedPnl": { - "type": "number", + "type": "string", "description": "Unrealised profit and loss" }, "unrealisedPnlPcnt": { - "type": "number", + "type": "string", "description": "Profit-loss ratio of the position" }, "unrealisedRoePcnt": { - "type": "number", + "type": "string", "description": "Rate of return on investment" }, "avgEntryPrice": { - "type": "number", + "type": "string", "description": "Average entry price" }, "liquidationPrice": { - "type": "number", + "type": "string", "description": "Liquidation price" }, "bankruptPrice": { - "type": "number", + "type": "string", "description": "Bankruptcy price" }, - "userId": { - "type": "integer", - "description": "userId" - }, "settleCurrency": { "type": "string", "description": "Currency used to clear and settle the trades" @@ -1366,7 +1362,6 @@ "avgEntryPrice", "liquidationPrice", "bankruptPrice", - "userId", "settleCurrency" ] } @@ -1416,12 +1411,12 @@ "bizNo" ] }, - "example": "{\n \"symbol\": \"string\",\n \"margin\": 0,\n \"bizNo\": \"string\"\n}" + "example": "{\n \"symbol\": \"XBTUSDTM\",\n \"margin\": 3,\n \"bizNo\": \"112233\"\n}" } } }, - "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"id\\\": \\\"6200c9b83aecfb000152ddcd\\\",\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"autoDeposit\\\": false,\\n \\\"maintMarginReq\\\": 0.005,\\n \\\"riskLimit\\\": 500000,\\n \\\"realLeverage\\\": 18.72,\\n \\\"crossMode\\\": false,\\n \\\"delevPercentage\\\": 0.66,\\n \\\"openingTimestamp\\\": 1646287090131,\\n \\\"currentTimestamp\\\": 1646295055021,\\n \\\"currentQty\\\": 1,\\n \\\"currentCost\\\": 43.388,\\n \\\"currentComm\\\": 0.0260328,\\n \\\"unrealisedCost\\\": 43.388,\\n \\\"realisedGrossCost\\\": 0,\\n \\\"realisedCost\\\": 0.0260328,\\n \\\"isOpen\\\": true,\\n \\\"markPrice\\\": 43536.65,\\n \\\"markValue\\\": 43.53665,\\n \\\"posCost\\\": 43.388,\\n \\\"posCross\\\": 0.000024985,\\n \\\"posInit\\\": 2.1694,\\n \\\"posComm\\\": 0.02733446,\\n \\\"posLoss\\\": 0,\\n \\\"posMargin\\\": 2.19675944,\\n \\\"posMaint\\\": 0.24861326,\\n \\\"maintMargin\\\": 2.34540944,\\n \\\"realisedGrossPnl\\\": 0,\\n \\\"realisedPnl\\\": -0.0260328,\\n \\\"unrealisedPnl\\\": 0.14865,\\n \\\"unrealisedPnlPcnt\\\": 0.0034,\\n \\\"unrealisedRoePcnt\\\": 0.0685,\\n \\\"avgEntryPrice\\\": 43388,\\n \\\"liquidationPrice\\\": 41440,\\n \\\"bankruptPrice\\\": 41218,\\n \\\"userId\\\": 1234321123,\\n \\\"settleCurrency\\\": \\\"USDT\\\"\\n }\\n}", - "x-request-example": "{\\\"symbol\\\": \\\"string\\\", \\\"margin\\\": 0, \\\"bizNo\\\": \\\"string\\\"}", + "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"id\\\": \\\"400000000000974886\\\",\\n \\\"symbol\\\": \\\"XBTUSDTM\\\",\\n \\\"autoDeposit\\\": true,\\n \\\"maintMarginReq\\\": \\\"0.004\\\",\\n \\\"riskLimit\\\": 100000,\\n \\\"realLeverage\\\": \\\"1.83\\\",\\n \\\"crossMode\\\": false,\\n \\\"marginMode\\\": \\\"\\\",\\n \\\"positionSide\\\": \\\"\\\",\\n \\\"leverage\\\": \\\"1.83\\\",\\n \\\"delevPercentage\\\": 0.2,\\n \\\"openingTimestamp\\\": 1736932881164,\\n \\\"currentTimestamp\\\": 1736933530230,\\n \\\"currentQty\\\": 1,\\n \\\"currentCost\\\": \\\"97.302\\\",\\n \\\"currentComm\\\": \\\"0.0583812\\\",\\n \\\"unrealisedCost\\\": \\\"97.302\\\",\\n \\\"realisedGrossCost\\\": \\\"0.0000000000\\\",\\n \\\"realisedCost\\\": \\\"0.0583812000\\\",\\n \\\"isOpen\\\": true,\\n \\\"markPrice\\\": \\\"96939.98\\\",\\n \\\"markValue\\\": \\\"96.9399800000\\\",\\n \\\"posCost\\\": \\\"97.302\\\",\\n \\\"posCross\\\": \\\"20.9874\\\",\\n \\\"posInit\\\": \\\"32.4339999967\\\",\\n \\\"posComm\\\": \\\"0.0904415999\\\",\\n \\\"posLoss\\\": \\\"0\\\",\\n \\\"posMargin\\\": \\\"53.5118415966\\\",\\n \\\"posMaint\\\": \\\"0.4796495999\\\",\\n \\\"maintMargin\\\": \\\"53.1498215966\\\",\\n \\\"realisedGrossPnl\\\": \\\"0.0000000000\\\",\\n \\\"realisedPnl\\\": \\\"-0.0583812000\\\",\\n \\\"unrealisedPnl\\\": \\\"-0.3620200000\\\",\\n \\\"unrealisedPnlPcnt\\\": \\\"-0.0037\\\",\\n \\\"unrealisedRoePcnt\\\": \\\"-0.0112\\\",\\n \\\"avgEntryPrice\\\": \\\"97302.00\\\",\\n \\\"liquidationPrice\\\": \\\"44269.81\\\",\\n \\\"bankruptPrice\\\": \\\"43880.61\\\",\\n \\\"settleCurrency\\\": \\\"USDT\\\"\\n }\\n}", + "x-request-example": "{\\\"symbol\\\": \\\"XBTUSDTM\\\", \\\"margin\\\": 3, \\\"bizNo\\\": \\\"112233\\\"}", "operationId": "008" } }, From e147199642964031504d97b918a87462cbdabaae Mon Sep 17 00:00:00 2001 From: "Isaac.Tang" Date: Thu, 16 Jan 2025 10:41:07 +0800 Subject: [PATCH 6/6] feat(sdk): update version to 1.1.0 --- CHANGELOG.md | 4 ++-- CONTRIBUTING.md | 3 +++ README.md | 2 +- VERSION | 2 +- sdk/golang/CHANGELOG.md | 4 ++-- sdk/golang/README.md | 2 +- sdk/golang/pkg/generate/version.go | 4 ++-- sdk/postman/CHANGELOG.md | 4 ++-- sdk/postman/collection-Abandoned Endpoints.json | 2 +- sdk/postman/collection-REST.json | 4 ++-- sdk/python/CHANGELOG.md | 4 ++-- sdk/python/README.md | 2 +- sdk/python/kucoin_universal_sdk/generate/version.py | 4 ++-- sdk/python/setup.py | 2 +- 14 files changed, 23 insertions(+), 20 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7e58e0d5..b078f665 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,10 +1,10 @@ # Changelog -## 2025-01-16 +## 2025-01-16(1.1.0) - Updated the API sequence to be consistent with the documentation. - Updated the license. - Added Copy Trading API. -## 2024-12-31 +## 2024-12-31(1.0.0) - Released the official version 1.0.0. \ No newline at end of file diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 319d684e..21aa23b4 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -66,5 +66,8 @@ When making changes to the version of the SDK, ensure the following files are up ```bash pip install kucoin-universal-sdk==1.0.1 ``` + +4. **CHANGELOG File** + - Add release notes to the CHANGELOG Ensure all version updates are consistent across these files before committing changes. diff --git a/README.md b/README.md index ecc8c382..e5f8c0b0 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,7 @@ The **KuCoin Universal SDK** is the official SDK provided by KuCoin, offering a ## 🛠️ Installation -### Latest Version: `1.0.0` +### Latest Version: `1.1.0` ### Python Installation diff --git a/VERSION b/VERSION index 60453e69..992977ad 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -v1.0.0 \ No newline at end of file +v1.1.0 \ No newline at end of file diff --git a/sdk/golang/CHANGELOG.md b/sdk/golang/CHANGELOG.md index 7e58e0d5..b078f665 100644 --- a/sdk/golang/CHANGELOG.md +++ b/sdk/golang/CHANGELOG.md @@ -1,10 +1,10 @@ # Changelog -## 2025-01-16 +## 2025-01-16(1.1.0) - Updated the API sequence to be consistent with the documentation. - Updated the license. - Added Copy Trading API. -## 2024-12-31 +## 2024-12-31(1.0.0) - Released the official version 1.0.0. \ No newline at end of file diff --git a/sdk/golang/README.md b/sdk/golang/README.md index ce824f86..976973aa 100644 --- a/sdk/golang/README.md +++ b/sdk/golang/README.md @@ -9,7 +9,7 @@ For an overview of the project and SDKs in other languages, refer to the [Main R ## 📦 Installation -### Latest Version: `1.0.0` +### Latest Version: `1.1.0` Install the Golang SDK using `go get`: ```bash diff --git a/sdk/golang/pkg/generate/version.go b/sdk/golang/pkg/generate/version.go index 8eff68e3..aab2ad74 100644 --- a/sdk/golang/pkg/generate/version.go +++ b/sdk/golang/pkg/generate/version.go @@ -1,6 +1,6 @@ package generate const ( - SdkVersion = "v1.0.0" - SdkGenerateDate = "2025-01-15" + SdkVersion = "v1.1.0" + SdkGenerateDate = "2025-01-16" ) diff --git a/sdk/postman/CHANGELOG.md b/sdk/postman/CHANGELOG.md index 7e58e0d5..b078f665 100644 --- a/sdk/postman/CHANGELOG.md +++ b/sdk/postman/CHANGELOG.md @@ -1,10 +1,10 @@ # Changelog -## 2025-01-16 +## 2025-01-16(1.1.0) - Updated the API sequence to be consistent with the documentation. - Updated the license. - Added Copy Trading API. -## 2024-12-31 +## 2024-12-31(1.0.0) - Released the official version 1.0.0. \ No newline at end of file diff --git a/sdk/postman/collection-Abandoned Endpoints.json b/sdk/postman/collection-Abandoned Endpoints.json index 30997643..e756381e 100644 --- a/sdk/postman/collection-Abandoned Endpoints.json +++ b/sdk/postman/collection-Abandoned Endpoints.json @@ -3106,7 +3106,7 @@ "type": "text/javascript", "packages": {}, "exec": [ - "function extractPathVariable(str) {\n const regex = /^\\{\\{(.+?)\\}\\}$/;\n const match = str.match(regex);\n if (match) {\n return match[1];\n }\n return null;\n}\n\nfunction hasAnyFieldEmpty(obj) {\n for (const key in obj) {\n if (obj[key] === \"\" || obj[key] === null || obj[key] === undefined) {\n return true;\n }\n }\n return false;\n}\n\nfunction sign(text, secret) {\n const hash = CryptoJS.HmacSHA256(text, secret);\n return CryptoJS.enc.Base64.stringify(hash)\n}\n\nfunction auth(apiKey, method, url, data) {\n if (hasAnyFieldEmpty(apiKey)) {\n console.warn('The API key-related information is not configured; only the public channel API is accessible.')\n return {'User-Agent': `Kucoin-Universal-Postman-SDK/v1.0.0`}\n }\n\n const timestamp = Date.now();\n const text = timestamp + method.toUpperCase() + url + data;\n const signature = sign(text, apiKey.secret);\n return {\n 'KC-API-KEY': apiKey.key,\n 'KC-API-SIGN': signature,\n 'KC-API-TIMESTAMP': timestamp.toString(),\n 'KC-API-PASSPHRASE': sign(apiKey.passphrase || '', apiKey.secret),\n 'Content-Type': 'application/json',\n 'User-Agent': `Kucoin-Universal-Postman-SDK/v1.0.0`,\n 'KC-API-KEY-VERSION': 2,\n };\n}\n\nlet key = pm.environment.get('API_KEY')\nlet secret = pm.environment.get('API_SECRET')\nlet passphrase = pm.environment.get('API_PASSPHRASE')\n\nlet url = pm.request.url.getPathWithQuery()\nlet method = pm.request.method\nlet body = pm.request.body ? pm.request.body.toString() : ''\n\nfor (const index in pm.request.url.path) {\n path = pm.request.url.path[index]\n pathVar = extractPathVariable(path)\n if (pathVar != null) {\n let collectionVariable = pm.collectionVariables.get(pathVar);\n if (collectionVariable != null) {\n url = url.replace(path, collectionVariable)\n } else {\n console.warn('no path variable set: ' + path)\n }\n }\n}\n\nheader = auth({ key: key, passphrase: passphrase, secret: secret }, method, url, body)\n\nfor (const [headerName, headerValue] of Object.entries(header)) {\n pm.request.headers.add({ key: headerName, value: headerValue })\n}" + "function extractPathVariable(str) {\n const regex = /^\\{\\{(.+?)\\}\\}$/;\n const match = str.match(regex);\n if (match) {\n return match[1];\n }\n return null;\n}\n\nfunction hasAnyFieldEmpty(obj) {\n for (const key in obj) {\n if (obj[key] === \"\" || obj[key] === null || obj[key] === undefined) {\n return true;\n }\n }\n return false;\n}\n\nfunction sign(text, secret) {\n const hash = CryptoJS.HmacSHA256(text, secret);\n return CryptoJS.enc.Base64.stringify(hash)\n}\n\nfunction auth(apiKey, method, url, data) {\n if (hasAnyFieldEmpty(apiKey)) {\n console.warn('The API key-related information is not configured; only the public channel API is accessible.')\n return {'User-Agent': `Kucoin-Universal-Postman-SDK/v1.1.0`}\n }\n\n const timestamp = Date.now();\n const text = timestamp + method.toUpperCase() + url + data;\n const signature = sign(text, apiKey.secret);\n return {\n 'KC-API-KEY': apiKey.key,\n 'KC-API-SIGN': signature,\n 'KC-API-TIMESTAMP': timestamp.toString(),\n 'KC-API-PASSPHRASE': sign(apiKey.passphrase || '', apiKey.secret),\n 'Content-Type': 'application/json',\n 'User-Agent': `Kucoin-Universal-Postman-SDK/v1.1.0`,\n 'KC-API-KEY-VERSION': 2,\n };\n}\n\nlet key = pm.environment.get('API_KEY')\nlet secret = pm.environment.get('API_SECRET')\nlet passphrase = pm.environment.get('API_PASSPHRASE')\n\nlet url = pm.request.url.getPathWithQuery()\nlet method = pm.request.method\nlet body = pm.request.body ? pm.request.body.toString() : ''\n\nfor (const index in pm.request.url.path) {\n path = pm.request.url.path[index]\n pathVar = extractPathVariable(path)\n if (pathVar != null) {\n let collectionVariable = pm.collectionVariables.get(pathVar);\n if (collectionVariable != null) {\n url = url.replace(path, collectionVariable)\n } else {\n console.warn('no path variable set: ' + path)\n }\n }\n}\n\nheader = auth({ key: key, passphrase: passphrase, secret: secret }, method, url, body)\n\nfor (const [headerName, headerValue] of Object.entries(header)) {\n pm.request.headers.add({ key: headerName, value: headerValue })\n}" ] } }, diff --git a/sdk/postman/collection-REST.json b/sdk/postman/collection-REST.json index b9b61342..64ae26d6 100644 --- a/sdk/postman/collection-REST.json +++ b/sdk/postman/collection-REST.json @@ -18836,7 +18836,7 @@ "type": "text/javascript", "packages": {}, "exec": [ - "\nfunction extractPathVariable(str) {\n const regex = /^\\{\\{(.+?)\\}\\}$/;\n const match = str.match(regex);\n if (match) {\n return match[1];\n }\n return null;\n}\n\nfunction hasAnyFieldEmpty(obj) {\n for (const key in obj) {\n if (obj[key] === \"\" || obj[key] === null || obj[key] === undefined) {\n return true;\n }\n }\n return false;\n}\n\nfunction sign(text, secret) {\n const hash = CryptoJS.HmacSHA256(text, secret);\n return CryptoJS.enc.Base64.stringify(hash)\n}\n\nfunction auth(apiKey, method, url, data) {\n if (hasAnyFieldEmpty(apiKey)) {\n console.warn('The API key-related (or broker-related) information is not configured. Please check the fields in the environment variables.')\n return {'User-Agent': `Kucoin-Universal-Postman-SDK/v1.0.0`}\n }\n\n\n const timestamp = Date.now();\n const text = timestamp + method.toUpperCase() + url + data;\n const signature = sign(text, apiKey.secret);\n const brokerText = timestamp + apiKey.partner + apiKey.key;\n const brokerSignature = sign(brokerText, apiKey.brokerKey);\n return {\n 'KC-API-KEY': apiKey.key,\n 'KC-API-SIGN': signature,\n 'KC-API-TIMESTAMP': timestamp.toString(),\n 'KC-API-PASSPHRASE': sign(apiKey.passphrase || '', apiKey.secret),\n 'Content-Type': 'application/json',\n 'User-Agent': `Kucoin-Universal-Postman-SDK/v1.0.0`,\n 'KC-API-KEY-VERSION': 2,\n 'KC-API-PARTNER': apiKey.partner,\n 'KC-BROKER-NAME': apiKey.brokerName,\n 'KC-API-PARTNER-VERIFY': 'true',\n 'KC-API-PARTNER-SIGN': brokerSignature,\n };\n}\n\nlet key = pm.environment.get('API_KEY')\nlet secret = pm.environment.get('API_SECRET')\nlet passphrase = pm.environment.get('API_PASSPHRASE')\n\nlet brokerName = pm.environment.get('BROKER_NAME')\nlet partner = pm.environment.get('BROKER_PARTNER')\nlet brokerKey = pm.environment.get('BROKER_KEY')\n\nlet url = pm.request.url.getPathWithQuery()\nlet method = pm.request.method\nlet body = pm.request.body ? pm.request.body.toString() : ''\n\nfor (const index in pm.request.url.path) {\n path = pm.request.url.path[index]\n pathVar = extractPathVariable(path)\n if (pathVar != null) {\n let collectionVariable = pm.collectionVariables.get(pathVar);\n if (collectionVariable != null) {\n url = url.replace(path, collectionVariable)\n } else {\n console.warn('no path variable set: ' + path)\n }\n }\n}\n\nheader = auth({\n key: key, passphrase: passphrase, secret: secret, brokerName: brokerName, partner: partner, brokerKey: brokerKey\n}, method, url, body)\n\nfor (const [headerName, headerValue] of Object.entries(header)) {\n pm.request.headers.add({ key: headerName, value: headerValue })\n}" + "\nfunction extractPathVariable(str) {\n const regex = /^\\{\\{(.+?)\\}\\}$/;\n const match = str.match(regex);\n if (match) {\n return match[1];\n }\n return null;\n}\n\nfunction hasAnyFieldEmpty(obj) {\n for (const key in obj) {\n if (obj[key] === \"\" || obj[key] === null || obj[key] === undefined) {\n return true;\n }\n }\n return false;\n}\n\nfunction sign(text, secret) {\n const hash = CryptoJS.HmacSHA256(text, secret);\n return CryptoJS.enc.Base64.stringify(hash)\n}\n\nfunction auth(apiKey, method, url, data) {\n if (hasAnyFieldEmpty(apiKey)) {\n console.warn('The API key-related (or broker-related) information is not configured. Please check the fields in the environment variables.')\n return {'User-Agent': `Kucoin-Universal-Postman-SDK/v1.1.0`}\n }\n\n\n const timestamp = Date.now();\n const text = timestamp + method.toUpperCase() + url + data;\n const signature = sign(text, apiKey.secret);\n const brokerText = timestamp + apiKey.partner + apiKey.key;\n const brokerSignature = sign(brokerText, apiKey.brokerKey);\n return {\n 'KC-API-KEY': apiKey.key,\n 'KC-API-SIGN': signature,\n 'KC-API-TIMESTAMP': timestamp.toString(),\n 'KC-API-PASSPHRASE': sign(apiKey.passphrase || '', apiKey.secret),\n 'Content-Type': 'application/json',\n 'User-Agent': `Kucoin-Universal-Postman-SDK/v1.1.0`,\n 'KC-API-KEY-VERSION': 2,\n 'KC-API-PARTNER': apiKey.partner,\n 'KC-BROKER-NAME': apiKey.brokerName,\n 'KC-API-PARTNER-VERIFY': 'true',\n 'KC-API-PARTNER-SIGN': brokerSignature,\n };\n}\n\nlet key = pm.environment.get('API_KEY')\nlet secret = pm.environment.get('API_SECRET')\nlet passphrase = pm.environment.get('API_PASSPHRASE')\n\nlet brokerName = pm.environment.get('BROKER_NAME')\nlet partner = pm.environment.get('BROKER_PARTNER')\nlet brokerKey = pm.environment.get('BROKER_KEY')\n\nlet url = pm.request.url.getPathWithQuery()\nlet method = pm.request.method\nlet body = pm.request.body ? pm.request.body.toString() : ''\n\nfor (const index in pm.request.url.path) {\n path = pm.request.url.path[index]\n pathVar = extractPathVariable(path)\n if (pathVar != null) {\n let collectionVariable = pm.collectionVariables.get(pathVar);\n if (collectionVariable != null) {\n url = url.replace(path, collectionVariable)\n } else {\n console.warn('no path variable set: ' + path)\n }\n }\n}\n\nheader = auth({\n key: key, passphrase: passphrase, secret: secret, brokerName: brokerName, partner: partner, brokerKey: brokerKey\n}, method, url, body)\n\nfor (const [headerName, headerValue] of Object.entries(header)) {\n pm.request.headers.add({ key: headerName, value: headerValue })\n}" ] } }, @@ -19931,7 +19931,7 @@ "type": "text/javascript", "packages": {}, "exec": [ - "function extractPathVariable(str) {\n const regex = /^\\{\\{(.+?)\\}\\}$/;\n const match = str.match(regex);\n if (match) {\n return match[1];\n }\n return null;\n}\n\nfunction hasAnyFieldEmpty(obj) {\n for (const key in obj) {\n if (obj[key] === \"\" || obj[key] === null || obj[key] === undefined) {\n return true;\n }\n }\n return false;\n}\n\nfunction sign(text, secret) {\n const hash = CryptoJS.HmacSHA256(text, secret);\n return CryptoJS.enc.Base64.stringify(hash)\n}\n\nfunction auth(apiKey, method, url, data) {\n if (hasAnyFieldEmpty(apiKey)) {\n console.warn('The API key-related information is not configured; only the public channel API is accessible.')\n return {'User-Agent': `Kucoin-Universal-Postman-SDK/v1.0.0`}\n }\n\n const timestamp = Date.now();\n const text = timestamp + method.toUpperCase() + url + data;\n const signature = sign(text, apiKey.secret);\n return {\n 'KC-API-KEY': apiKey.key,\n 'KC-API-SIGN': signature,\n 'KC-API-TIMESTAMP': timestamp.toString(),\n 'KC-API-PASSPHRASE': sign(apiKey.passphrase || '', apiKey.secret),\n 'Content-Type': 'application/json',\n 'User-Agent': `Kucoin-Universal-Postman-SDK/v1.0.0`,\n 'KC-API-KEY-VERSION': 2,\n };\n}\n\nlet key = pm.environment.get('API_KEY')\nlet secret = pm.environment.get('API_SECRET')\nlet passphrase = pm.environment.get('API_PASSPHRASE')\n\nlet url = pm.request.url.getPathWithQuery()\nlet method = pm.request.method\nlet body = pm.request.body ? pm.request.body.toString() : ''\n\nfor (const index in pm.request.url.path) {\n path = pm.request.url.path[index]\n pathVar = extractPathVariable(path)\n if (pathVar != null) {\n let collectionVariable = pm.collectionVariables.get(pathVar);\n if (collectionVariable != null) {\n url = url.replace(path, collectionVariable)\n } else {\n console.warn('no path variable set: ' + path)\n }\n }\n}\n\nheader = auth({ key: key, passphrase: passphrase, secret: secret }, method, url, body)\n\nfor (const [headerName, headerValue] of Object.entries(header)) {\n pm.request.headers.add({ key: headerName, value: headerValue })\n}" + "function extractPathVariable(str) {\n const regex = /^\\{\\{(.+?)\\}\\}$/;\n const match = str.match(regex);\n if (match) {\n return match[1];\n }\n return null;\n}\n\nfunction hasAnyFieldEmpty(obj) {\n for (const key in obj) {\n if (obj[key] === \"\" || obj[key] === null || obj[key] === undefined) {\n return true;\n }\n }\n return false;\n}\n\nfunction sign(text, secret) {\n const hash = CryptoJS.HmacSHA256(text, secret);\n return CryptoJS.enc.Base64.stringify(hash)\n}\n\nfunction auth(apiKey, method, url, data) {\n if (hasAnyFieldEmpty(apiKey)) {\n console.warn('The API key-related information is not configured; only the public channel API is accessible.')\n return {'User-Agent': `Kucoin-Universal-Postman-SDK/v1.1.0`}\n }\n\n const timestamp = Date.now();\n const text = timestamp + method.toUpperCase() + url + data;\n const signature = sign(text, apiKey.secret);\n return {\n 'KC-API-KEY': apiKey.key,\n 'KC-API-SIGN': signature,\n 'KC-API-TIMESTAMP': timestamp.toString(),\n 'KC-API-PASSPHRASE': sign(apiKey.passphrase || '', apiKey.secret),\n 'Content-Type': 'application/json',\n 'User-Agent': `Kucoin-Universal-Postman-SDK/v1.1.0`,\n 'KC-API-KEY-VERSION': 2,\n };\n}\n\nlet key = pm.environment.get('API_KEY')\nlet secret = pm.environment.get('API_SECRET')\nlet passphrase = pm.environment.get('API_PASSPHRASE')\n\nlet url = pm.request.url.getPathWithQuery()\nlet method = pm.request.method\nlet body = pm.request.body ? pm.request.body.toString() : ''\n\nfor (const index in pm.request.url.path) {\n path = pm.request.url.path[index]\n pathVar = extractPathVariable(path)\n if (pathVar != null) {\n let collectionVariable = pm.collectionVariables.get(pathVar);\n if (collectionVariable != null) {\n url = url.replace(path, collectionVariable)\n } else {\n console.warn('no path variable set: ' + path)\n }\n }\n}\n\nheader = auth({ key: key, passphrase: passphrase, secret: secret }, method, url, body)\n\nfor (const [headerName, headerValue] of Object.entries(header)) {\n pm.request.headers.add({ key: headerName, value: headerValue })\n}" ] } }, diff --git a/sdk/python/CHANGELOG.md b/sdk/python/CHANGELOG.md index 7e58e0d5..b078f665 100644 --- a/sdk/python/CHANGELOG.md +++ b/sdk/python/CHANGELOG.md @@ -1,10 +1,10 @@ # Changelog -## 2025-01-16 +## 2025-01-16(1.1.0) - Updated the API sequence to be consistent with the documentation. - Updated the license. - Added Copy Trading API. -## 2024-12-31 +## 2024-12-31(1.0.0) - Released the official version 1.0.0. \ No newline at end of file diff --git a/sdk/python/README.md b/sdk/python/README.md index 31a292ac..67ab1a37 100644 --- a/sdk/python/README.md +++ b/sdk/python/README.md @@ -8,7 +8,7 @@ For an overview of the project and SDKs in other languages, refer to the [Main R ## 📦 Installation -### Latest Version: `1.0.0` +### Latest Version: `1.1.0` Install the Python SDK using `pip`: ```bash diff --git a/sdk/python/kucoin_universal_sdk/generate/version.py b/sdk/python/kucoin_universal_sdk/generate/version.py index 162e5f47..84b7d04e 100644 --- a/sdk/python/kucoin_universal_sdk/generate/version.py +++ b/sdk/python/kucoin_universal_sdk/generate/version.py @@ -1,2 +1,2 @@ -sdk_version = "v1.0.0" -sdk_generate_date = "2025-01-15" +sdk_version = "v1.1.0" +sdk_generate_date = "2025-01-16" diff --git a/sdk/python/setup.py b/sdk/python/setup.py index aed9d180..fc967b4f 100644 --- a/sdk/python/setup.py +++ b/sdk/python/setup.py @@ -2,7 +2,7 @@ setup( name="kucoin-universal-sdk", - version="1.0.0", + version="1.1.0", description="Official KuCoin Universal SDK", author="KuCoin", author_email="api@kucoin.com",