### Get Historical Delivery Prices (XRP/USDT) Source: https://www.pionex.com/docs/api-docs/earn-api/dual This example demonstrates fetching historical delivery prices for a Dual Investment pair where the base currency is XRP and the quote currency is USDT. For most base currencies other than BTC/ETH, `USDT` is the recommended quote currency. ```http GET /api/v1/earn/dual/deliveryPrices?base=XRP"e=USDT ``` -------------------------------- ### Complete Auth Message Example Source: https://www.pionex.com/docs/api-docs/futures-websocket/general-info/authentication-private-stream This is a complete example of an authentication message including a sample API key, timestamp, and the corresponding generated signature. ```json {"op": "auth", "args": ["OElNn5D_Frnf5MR0ChjYdG7PunK0AOgHTvevwzWS", 1655896754515, "3e901247350e744353f4a7a479fd67181184a627b119352ec1b7a432925e772c"]} ``` -------------------------------- ### GET /uapi/v1/trade/openOrders Source: https://www.pionex.com/docs/api-docs/futures-api/general-info/authentication Get open orders. Requires 'Enable reading' permission. ```APIDOC ## GET /uapi/v1/trade/openOrders ### Description Get open orders. ### Method GET ### Endpoint /uapi/v1/trade/openOrders ### Parameters #### Query Parameters - **timestamp** (integer) - Required - Current time in milliseconds. - **symbol** (string) - Optional - Trading pair. #### Request Body None ### Response #### Success Response (200) - **data** (array) - List of open orders (each object has the same structure as GET /uapi/v1/trade/order). #### Response Example ```json { "code": "0", "msg": "Success", "data": [ { "orderId": 123456789, "clientOrderId": "my_order_1", "symbol": "BTCUSDT", "price": "50000.00", "origQty": "0.001", "executedQty": "0.0000", "status": "NEW", "type": "LIMIT", "side": "BUY", "stopPrice": "0.00000000", "icebergQty": "0.00000000", "timeInForce": "GTC", "createTime": 1678886400000, "updateTime": 1678886400000, "isWorking": true, "origQuoteOrderQty": "25.00" } ] } ``` ``` -------------------------------- ### Success Response Example Source: https://www.pionex.com/docs/api-docs/partner-api/general-info/basic-info This is an example of a successful API response, indicating the 'result' is true and providing business data in the 'data' object. ```json {"result": true, "data": {"total": 100, "list": [...]}, "timestamp": 1566691672311} ``` -------------------------------- ### Successful Response for Get Underlying Index Price Source: https://www.pionex.com/docs/api-docs/earn-api/dual This is an example of a successful response when retrieving the underlying index price. It includes the index price, base and quote currencies, and update timestamps. ```json { "result": true, "data": { "index": "69142.6", "base": "BTC", "quote": "USDXO", "updateTime": 1775025942486 }, "timestamp": 1775025942754 } ``` -------------------------------- ### List Open Dual Investment Products (XRP) Source: https://www.pionex.com/docs/api-docs/earn-api/dual This example shows how to query for open Dual Investment products for a different base currency like XRP. Note the different quote currency rules that apply. ```http GET /api/v1/earn/dual/openProducts?base=XRP"e=USDT¤cy=USDT&type=DUAL_BASE ``` -------------------------------- ### Example Response for Open Dual Investment Products Source: https://www.pionex.com/docs/api-docs/earn-api/dual This is a sample JSON response when successfully querying for open Dual Investment products. It includes details such as product ID, currency pair, type, and expiry information. ```json { "result": true, "data": { "products": [ { "productId": "BTC-USDXO-260401-69000-C-USDT", "base": "BTC", "quote": "USDXO", "currency": "USDT", "type": "DUAL_BASE", "createTime": 1774686600000, "expireTime": 1775030400000, "strike": "69000", "expired": false } ] }, "timestamp": 1775025855477 } ``` -------------------------------- ### GET /uapi/v1/trade/fills Source: https://www.pionex.com/docs/api-docs/futures-api/general-info/authentication Get fills. Requires 'Enable reading' permission. ```APIDOC ## GET /uapi/v1/trade/fills ### Description Get fills. ### Method GET ### Endpoint /uapi/v1/trade/fills ### Parameters #### Query Parameters - **timestamp** (integer) - Required - Current time in milliseconds. - **symbol** (string) - Optional - Trading pair. - **startTime** (integer) - Optional - Start time in milliseconds. - **endTime** (integer) - Optional - End time in milliseconds. - **limit** (integer) - Optional - Maximum number of records to return (default 500). #### Request Body None ### Response #### Success Response (200) - **data** (array) - List of fills. - **symbol** (string) - The trading pair. - **orderId** (integer) - The order ID. - **tradeId** (integer) - The trade ID. - **price** (string) - The price of the fill. - **qty** (string) - The quantity of the fill. - **commission** (string) - The commission paid. - **commissionAsset** (string) - The asset of the commission. - **time** (integer) - The time of the fill. - **isBuyer** (boolean) - Whether the user was the buyer. - **isMaker** (boolean) - Whether the user was the maker. #### Response Example ```json { "code": "0", "msg": "Success", "data": [ { "symbol": "BTCUSDT", "orderId": 123456789, "tradeId": 987654321, "price": "50500.00", "qty": "0.0005", "commission": "0.000000025", "commissionAsset": "USDT", "time": 1678887000000, "isBuyer": true, "isMaker": false } ] } ``` ``` -------------------------------- ### GET /api/v1/assets/transfers Source: https://www.pionex.com/docs/api-docs/futures-api/general-info/authentication Get transfer records. Requires 'Enable reading' permission. ```APIDOC ## GET /api/v1/assets/transfers ### Description Get transfer records. ### Method GET ### Endpoint /api/v1/assets/transfers ### Parameters #### Query Parameters - **timestamp** (integer) - Required - Current time in milliseconds. - **startTime** (integer) - Optional - Start time in milliseconds. - **endTime** (integer) - Optional - End time in milliseconds. - **limit** (integer) - Optional - Maximum number of records to return (default 500). #### Request Body None ### Response #### Success Response (200) - **data** (array) - List of transfer records (each object has the same structure as GET /api/v1/assets/transfer). #### Response Example ```json { "code": "0", "msg": "Success", "data": [ { "transferId": "t123456789", "amount": "100.00", "currency": "USDT", "fromAccount": "SPOT", "toAccount": "CONTRACT", "status": "SUCCESS", "createTime": 1678886400000 }, { "transferId": "t987654321", "amount": "50.00", "currency": "BTC", "fromAccount": "CONTRACT", "toAccount": "SPOT", "status": "SUCCESS", "createTime": 1678887000000 } ] } ``` ``` -------------------------------- ### POST /uapi/v1/trade/massOrder Source: https://www.pionex.com/docs/api-docs/futures-api/general-info/authentication Batch place orders. Requires 'Enable trading' permission. ```APIDOC ## POST /uapi/v1/trade/massOrder ### Description Batch place orders. ### Method POST ### Endpoint /uapi/v1/trade/massOrder ### Parameters #### Query Parameters - **timestamp** (integer) - Required - Current time in milliseconds. #### Request Body - **symbol** (string) - Required - Trading pair. - **side** (string) - Required - Order side (BUY or SELL). - **type** (string) - Required - Order type (e.g., LIMIT, MARKET). - **quantity** (string) - Required if type is LIMIT - The order quantity. - **price** (string) - Required if type is LIMIT - The order price. - **newClientOrderId** (string) - Optional - A unique identifier for the order. - **stopPrice** (string) - Optional - For stop orders. - **icebergQty** (string) - Optional - For iceberg orders. - **timeInForce** (string) - Optional - Time in force (e.g., GTC, IOC, FOK). - **orders** (array) - Required - An array of order objects. Each object should contain: - **symbol** (string) - Trading pair. - **side** (string) - Order side (BUY or SELL). - **type** (string) - Order type (e.g., LIMIT, MARKET). - **quantity** (string) - Order quantity. - **price** (string) - Order price (if type is LIMIT). - **newClientOrderId** (string) - Optional - Unique identifier for the order. ### Request Example ```json { "symbol": "BTCUSDT", "side": "BUY", "type": "LIMIT", "quantity": "0.001", "price": "50000.00", "orders": [ { "symbol": "BTCUSDT", "side": "BUY", "type": "LIMIT", "quantity": "0.001", "price": "50000.00", "newClientOrderId": "batch_order_1" }, { "symbol": "BTCUSDT", "side": "SELL", "type": "LIMIT", "quantity": "0.002", "price": "51000.00", "newClientOrderId": "batch_order_2" } ] } ``` ### Response #### Success Response (200) - **data** (array) - List of results for each placed order. Each object contains: - **orderId** (integer) - The order ID. - **clientOrderId** (string) - The client order ID. - **symbol** (string) - The trading pair. - **status** (string) - The status of the order. #### Response Example ```json { "code": "0", "msg": "Success", "data": [ { "orderId": 123456790, "clientOrderId": "batch_order_1", "symbol": "BTCUSDT", "status": "NEW" }, { "orderId": 123456791, "clientOrderId": "batch_order_2", "symbol": "BTCUSDT", "status": "NEW" } ] } ``` ``` -------------------------------- ### Ask a Question via Documentation Index Source: https://www.pionex.com/docs/api-docs Use this GET request to query the documentation index with a specific question. The response includes a direct answer and relevant excerpts. ```http GET https://www.pionex.com/docs/readme.md?ask= ``` -------------------------------- ### GET /uapi/v1/trade/historyOrders Source: https://www.pionex.com/docs/api-docs/futures-api/general-info/authentication Get history orders. Requires 'Enable reading' permission. ```APIDOC ## GET /uapi/v1/trade/historyOrders ### Description Get history orders. ### Method GET ### Endpoint /uapi/v1/trade/historyOrders ### Parameters #### Query Parameters - **timestamp** (integer) - Required - Current time in milliseconds. - **symbol** (string) - Optional - Trading pair. - **start_time** (integer) - Optional - Start time in milliseconds. - **end_time** (integer) - Optional - End time in milliseconds. - **limit** (integer) - Optional - Maximum number of records to return (default 500). #### Request Body None ### Response #### Success Response (200) - **data** (array) - List of history orders (each object has the same structure as GET /uapi/v1/trade/order, but status might include FILLED, CANCELED). #### Response Example ```json { "code": "0", "msg": "Success", "data": [ { "orderId": 123456789, "clientOrderId": "my_order_1", "symbol": "BTCUSDT", "price": "50000.00", "origQty": "0.001", "executedQty": "0.001", "status": "FILLED", "type": "LIMIT", "side": "BUY", "stopPrice": "0.00000000", "icebergQty": "0.00000000", "timeInForce": "GTC", "createTime": 1678886400000, "updateTime": 1678887000000, "isWorking": false, "origQuoteOrderQty": "25.00" } ] } ``` ``` -------------------------------- ### GET /uapi/v1/trade/isolatedMode Source: https://www.pionex.com/docs/api-docs/futures-api/general-info/authentication Get margin mode. Requires 'Enable reading' permission. ```APIDOC ## GET /uapi/v1/trade/isolatedMode ### Description Get margin mode. ### Method GET ### Endpoint /uapi/v1/trade/isolatedMode ### Parameters #### Query Parameters - **timestamp** (integer) - Required - Current time in milliseconds. #### Request Body None ### Response #### Success Response (200) - **data** (object) - Margin mode details. - **symbol** (string) - The trading pair. - **marginMode** (string) - The margin mode (e.g., ISOLATED, CROSS). #### Response Example ```json { "code": "0", "msg": "Success", "data": { "symbol": "BTCUSDT", "marginMode": "ISOLATED" } } ``` ``` -------------------------------- ### Dual Investment Product Prices Response Source: https://www.pionex.com/docs/api-docs/earn-api/dual Example response structure for Dual Investment product prices. Includes product ID, investability status, profit rate, base size, and update time. If `canInvest` is false, `profit` and `baseSize` will be empty. ```JSON { "result": true, "data": { "products": [ { "productId": "LRC-USDT-260410-0.02-C-USDT", "canInvest": true, "profit": "0.01242", "baseSize": "8000000", "updateTime": 1775026225630 }, { "productId": "LRC-USDT-260410-0.03-C-USDT", "canInvest": false, "profit": "0", "baseSize": "", "updateTime": 0 } ] }, "timestamp": 1775026244892 } ``` -------------------------------- ### Query Account and Order Information (CLI) Source: https://www.pionex.com/docs/api-docs/references/api-key-permissions Command-line interface commands for querying account balances and order information. These mirror the functionality of the API endpoints. ```bash pionex-trade-cli account balance ``` ```bash pionex-trade-cli orders get ``` ```bash pionex-trade-cli orders open ``` ```bash pionex-trade-cli orders all ``` ```bash pionex-trade-cli orders fills ``` -------------------------------- ### GET /uapi/v1/account/positionMode Source: https://www.pionex.com/docs/api-docs/futures-api/general-info/authentication Get position mode. Requires 'Enable reading' permission. ```APIDOC ## GET /uapi/v1/account/positionMode ### Description Get position mode. ### Method GET ### Endpoint /uapi/v1/account/positionMode ### Parameters #### Query Parameters - **timestamp** (integer) - Required - Current time in milliseconds. #### Request Body None ### Response #### Success Response (200) - **data** (object) - Position mode details. - **symbol** (string) - The trading pair. - **dualSidePosition** (boolean) - Whether dual-side position is enabled. #### Response Example ```json { "code": "0", "msg": "Success", "data": { "symbol": "BTCUSDT", "dualSidePosition": false } } ``` ``` -------------------------------- ### Bot Order Information (CLI) Source: https://www.pionex.com/docs/api-docs/references/api-key-permissions Command-line interface commands for querying various bot order types, including futures grid, spot grid, and smart copy orders. ```bash pionex-trade-cli bot order_list ``` ```bash pionex-trade-cli bot futures_grid get ``` ```bash pionex-trade-cli bot spot_grid get ``` ```bash pionex-trade-cli bot spot_grid get_ai_strategy ``` ```bash pionex-trade-cli bot smart_copy get ``` -------------------------------- ### GET /uapi/v1/account/leverage Source: https://www.pionex.com/docs/api-docs/futures-api/general-info/authentication Get current leverage. Requires 'Enable reading' permission. ```APIDOC ## GET /uapi/v1/account/leverage ### Description Get current leverage. ### Method GET ### Endpoint /uapi/v1/account/leverage ### Parameters #### Query Parameters - **timestamp** (integer) - Required - Current time in milliseconds. - **symbol** (string) - Optional - Trading pair. #### Request Body None ### Response #### Success Response (200) - **data** (object) - Leverage details. - **symbol** (string) - The trading pair. - **leverage** (integer) - The current leverage. - **maxLeverage** (integer) - The maximum allowed leverage. - **marginType** (string) - The margin type (e.g., ISOLATED, CROSS). - **isolatedMargin** (string) - The isolated margin amount. - **isAutoAddMargin** (boolean) - Whether auto-add margin is enabled. - **positionSide** (string) - The side of the position (e.g., BOTH, LONG, SHORT). #### Response Example ```json { "code": "0", "msg": "Success", "data": { "symbol": "BTCUSDT", "leverage": 10, "maxLeverage": 20, "marginType": "ISOLATED", "isolatedMargin": "50.00", "isAutoAddMargin": true, "positionSide": "BOTH" } } ``` ``` -------------------------------- ### Place and Cancel Orders (CLI) Source: https://www.pionex.com/docs/api-docs/references/api-key-permissions Command-line interface commands for placing new orders, canceling specific orders, and canceling all open orders. ```bash pionex-trade-cli orders new ``` ```bash pionex-trade-cli orders cancel ``` ```bash pionex-trade-cli orders cancel_all ``` -------------------------------- ### GET /uapi/v1/account/detail Source: https://www.pionex.com/docs/api-docs/futures-api/general-info/authentication Get account detail. Requires 'Enable reading' permission. ```APIDOC ## GET /uapi/v1/account/detail ### Description Get account detail. ### Method GET ### Endpoint /uapi/v1/account/detail ### Parameters #### Query Parameters - **timestamp** (integer) - Required - Current time in milliseconds. #### Request Body None ### Response #### Success Response (200) - **data** (object) - Account details. - **makerCommission** (integer) - Maker commission rate. - **takerCommission** (integer) - Taker commission rate. - **buyerCommission** (integer) - Buyer commission rate. - **sellerCommission** (integer) - Seller commission rate. - **canTrade** (boolean) - Whether trading is enabled. - **canWithdraw** (boolean) - Whether withdrawal is enabled. - **canDeposit** (boolean) - Whether deposit is enabled. #### Response Example ```json { "code": "0", "msg": "Success", "data": { "makerCommission": 10, "takerCommission": 10, "buyerCommission": 0, "sellerCommission": 0, "canTrade": true, "canWithdraw": true, "canDeposit": true } } ``` ``` -------------------------------- ### GET /uapi/v1/account/historyPositions Source: https://www.pionex.com/docs/api-docs/futures-api/general-info/authentication Get history positions. Requires 'Enable reading' permission. ```APIDOC ## GET /uapi/v1/account/historyPositions ### Description Get history positions. ### Method GET ### Endpoint /uapi/v1/account/historyPositions ### Parameters #### Query Parameters - **timestamp** (integer) - Required - Current time in milliseconds. - **symbol** (string) - Optional - Trading pair. - **start_time** (integer) - Optional - Start time in milliseconds. - **end_time** (integer) - Optional - End time in milliseconds. - **limit** (integer) - Optional - Maximum number of records to return (default 500). #### Request Body None ### Response #### Success Response (200) - **data** (object) - History position details. - **symbol** (string) - The trading pair. - **open_time** (integer) - The time the position was opened. - **close_time** (integer) - The time the position was closed. - **position_amt** (string) - The amount of the position. - **entry_price** (string) - The entry price of the position. - **exit_price** (string) - The exit price of the position. - **unrealized_profit** (string) - The unrealized profit or loss. - **realized_profit** (string) - The realized profit or loss. - **side** (string) - The side of the position (e.g., LONG, SHORT). #### Response Example ```json { "code": "0", "msg": "Success", "data": [ { "symbol": "BTCUSDT", "open_time": 1678886400000, "close_time": 1678890000000, "position_amt": "0.001", "entry_price": "50000.00", "exit_price": "51000.00", "unrealized_profit": "1.00", "realized_profit": "1.00", "side": "LONG" } ] } ``` ``` -------------------------------- ### POST /uapi/v1/trade/order Source: https://www.pionex.com/docs/api-docs/futures-api/general-info/authentication Place an order. Requires 'Enable trading' permission. ```APIDOC ## POST /uapi/v1/trade/order ### Description Place an order. ### Method POST ### Endpoint /uapi/v1/trade/order ### Parameters #### Query Parameters - **timestamp** (integer) - Required - Current time in milliseconds. #### Request Body - **symbol** (string) - Required - Trading pair. - **side** (string) - Required - Order side (BUY or SELL). - **type** (string) - Required - Order type (e.g., LIMIT, MARKET). - **timeInForce** (string) - Optional - Time in force (e.g., GTC, IOC, FOK). - **quantity** (string) - Required if type is LIMIT - The order quantity. - **quoteOrderQty** (string) - Required if type is MARKET - The quote order quantity. - **price** (string) - Required if type is LIMIT - The order price. - **newClientOrderId** (string) - Optional - A unique identifier for the order. - **stopPrice** (string) - Optional - For stop orders. - **icebergQty** (string) - Optional - For iceberg orders. - **recvWindow** (integer) - Optional - The number of milliseconds the server has to respond. ### Request Example ```json { "symbol": "BTCUSDT", "side": "BUY", "type": "LIMIT", "timeInForce": "GTC", "quantity": "0.001", "price": "50000.00" } ``` ### Response #### Success Response (200) - **data** (object) - Order details (same structure as GET /uapi/v1/trade/order). #### Response Example ```json { "code": "0", "msg": "Success", "data": { "orderId": 123456790, "clientOrderId": "my_new_order_1", "symbol": "BTCUSDT", "price": "50000.00", "origQty": "0.001", "executedQty": "0.0000", "status": "NEW", "type": "LIMIT", "side": "BUY", "stopPrice": "0.00000000", "icebergQty": "0.00000000", "timeInForce": "GTC", "createTime": 1678887000000, "updateTime": 1678887000000, "isWorking": true, "origQuoteOrderQty": "25.00" } } ``` ``` -------------------------------- ### GET /uapi/v1/account/positions Source: https://www.pionex.com/docs/api-docs/futures-api/general-info/authentication Get current positions. Requires 'Enable reading' permission. ```APIDOC ## GET /uapi/v1/account/positions ### Description Get current positions. ### Method GET ### Endpoint /uapi/v1/account/positions ### Parameters #### Query Parameters - **timestamp** (integer) - Required - Current time in milliseconds. #### Request Body None ### Response #### Success Response (200) - **data** (object) - Position details. - **symbol** (string) - The trading pair. - **positionAmt** (string) - The amount of the position. - **entryPrice** (string) - The entry price of the position. - **markPrice** (string) - The current mark price. - **unRealizedProfit** (string) - The unrealized profit or loss. - **liquidationPrice** (string) - The liquidation price. - **leverage** (string) - The leverage applied to the position. - **isolatedMargin** (string) - The isolated margin for the position. - **isAutoAddMargin** (boolean) - Whether auto-add margin is enabled. - **positionSide** (string) - The side of the position (e.g., LONG, SHORT). #### Response Example ```json { "code": "0", "msg": "Success", "data": [ { "symbol": "BTCUSDT", "positionAmt": "0.001", "entryPrice": "50000.00", "markPrice": "51000.00", "unRealizedProfit": "1.00", "liquidationPrice": "48000.00", "leverage": "10", "isolatedMargin": "50.00", "isAutoAddMargin": true, "positionSide": "LONG" } ] } ``` ``` -------------------------------- ### Authentication Guide Source: https://www.pionex.com/docs/api-docs/earn-api/general-info/authentication Details on how to authenticate requests to private endpoints using API Keys and HMAC SHA256 signatures. ```APIDOC ## Authentication Private endpoints require HMAC SHA256 signature authentication. **Required headers:** * `PIONEX-KEY`: Your API Key * `PIONEX-SIGNATURE`: HMAC SHA256 hex signature **Required query parameter:** * `timestamp`: Current time in milliseconds (valid within +/-20 seconds) See [API Key Guide](https://www.pionex.com/docs/api-docs/references/api-key-guide) for more details. ``` -------------------------------- ### Spot Grid Parameter Check Source: https://www.pionex.com/docs/api-docs/bot-api/models This section describes the `CheckParamsResponse` object, which provides the results of checking parameters for a spot grid strategy. It includes details on minimum investment, maximum investment, slippage, and estimated values when parameters are valid, and specific fields when parameters are invalid. ```APIDOC ## CheckParamsResponse Object ### Description Spot grid parameter check result data. **When result=true**: All fields are populated. **When result=false with data (FailedWithData)**: Only `min_investment`, `max_investment`, and `slippage` are valid; all other estimate fields are empty. This occurs when `message` is one of: `"grid price duplicated: reduce row or widen range"`, `"quote_total_investment not match quote precision: max {N} decimal places"`, or `"less than min investment"`. ### Properties - **min_investment** (string) - Minimum investment amount in quote currency - **max_investment** (string) - Maximum investment amount in quote currency - **slippage** (string) - Recommended opening slippage (e.g. `"0.01"` = 1%) - **estimate_per_volume** (string) - Estimated per-grid buy/sell quantity. - **estimate_fee** (string) - Estimated opening trading fee. ``` -------------------------------- ### GET /uapi/v1/account/balances Source: https://www.pionex.com/docs/api-docs/futures-api/general-info/authentication Get account balances. Requires 'Enable reading' permission. ```APIDOC ## GET /uapi/v1/account/balances ### Description Get account balances. ### Method GET ### Endpoint /uapi/v1/account/balances ### Parameters #### Query Parameters - **timestamp** (integer) - Required - Current time in milliseconds. #### Request Body None ### Response #### Success Response (200) - **data** (object) - Account balance details. - **asset** (string) - The asset type. - **free** (string) - The available amount of the asset. - **locked** (string) - The locked amount of the asset. #### Response Example ```json { "code": "0", "msg": "Success", "data": [ { "asset": "USDT", "free": "100.00000000", "locked": "0.00000000" } ] } ``` ``` -------------------------------- ### CreateSpotGridOrderData Object Source: https://www.pionex.com/docs/api-docs/bot-api/models Defines the parameters required to create a spot grid order. ```APIDOC ## CreateSpotGridOrderData Object ### Description This object defines the parameters for creating a spot grid order. ### Fields - **top** (string) - Required - Grid upper price. - **bottom** (string) - Required - Grid lower price. - **row** (integer) - Required - Number of grid levels (2–200). - **gridType** (string) - Required - Grid spacing type: `arithmetic` (equal difference) or `geometric` (equal ratio). - **quoteTotalInvestment** (string) - Required - Quote currency investment amount. - **lossStopType** (string) - Optional - Stop loss mode: `price`, `profit_amount`, or `profit_ratio`. - **lossStop** (string) - Optional - Stop loss threshold. Interpretation depends on `lossStopType`. - **lossStopDelay** (integer) - Optional - Seconds to wait after stop loss condition is first met before executing. - **profitStopType** (string) - Optional - Take profit mode: `price`, `profit_amount`, or `profit_ratio`. - **profitStop** (string) - Optional - Take profit threshold. Interpretation depends on `profitStopType`. - **profitStopDelay** (integer) - Optional - Seconds to wait after take profit condition is first met before executing. - **condition** (string) - Optional - Trigger price — bot starts only when price crosses this level. - **conditionDirection** (string) - Optional - Trigger direction: `"-1"` price drops below condition, `"1"` price rises above condition. - **slippage** (string) - Optional - Open position slippage tolerance (e.g. "0.01" = 1%). - **closeSellModel** (string) - Optional - Close sell mode on cancellation: `NOT_SELL`, `TO_QUOTE`, or `TO_USDT` (default: `NOT_SELL`). ### Example ```json { "top": "50000", "bottom": "40000", "row": 10, "gridType": "arithmetic", "quoteTotalInvestment": "1000", "lossStopType": "profit_ratio", "lossStop": "-0.1", "profitStopType": "profit_ratio", "profitStop": "0.1", "condition": "45000", "conditionDirection": "1", "slippage": "0.005", "closeSellModel": "TO_QUOTE" } ``` ``` -------------------------------- ### GET /api/v1/assets/transfer Source: https://www.pionex.com/docs/api-docs/futures-api/general-info/authentication Get a single transfer record. Requires 'Enable reading' permission. ```APIDOC ## GET /api/v1/assets/transfer ### Description Get a single transfer record. ### Method GET ### Endpoint /api/v1/assets/transfer ### Parameters #### Query Parameters - **timestamp** (integer) - Required - Current time in milliseconds. - **transferId** (string) - Required - The ID of the transfer. #### Request Body None ### Response #### Success Response (200) - **data** (object) - Transfer record details. - **transferId** (string) - The ID of the transfer. - **amount** (string) - The amount transferred. - **currency** (string) - The currency of the transfer. - **fromAccount** (string) - The source account. - **toAccount** (string) - The destination account. - **status** (string) - The status of the transfer (e.g., SUCCESS, PENDING, FAILED). - **createTime** (integer) - The creation time of the transfer. #### Response Example ```json { "code": "0", "msg": "Success", "data": { "transferId": "t123456789", "amount": "100.00", "currency": "USDT", "fromAccount": "SPOT", "toAccount": "CONTRACT", "status": "SUCCESS", "createTime": 1678886400000 } } ``` ``` -------------------------------- ### List Open Dual Investment Products (BTC) Source: https://www.pionex.com/docs/api-docs/earn-api/dual Use this endpoint to retrieve open Dual Investment products for a specific trading pair and type. Ensure correct base, quote, and type parameters are used according to the defined rules. ```http GET /api/v1/earn/dual/openProducts?base=BTC"e=USDXO¤cy=USDT&type=DUAL_BASE ``` -------------------------------- ### GET /uapi/v1/trade/fundingFee Source: https://www.pionex.com/docs/api-docs/futures-api/general-info/authentication Get funding fee records. Requires 'Enable reading' permission. ```APIDOC ## GET /uapi/v1/trade/fundingFee ### Description Get funding fee records. ### Method GET ### Endpoint /uapi/v1/trade/fundingFee ### Parameters #### Query Parameters - **timestamp** (integer) - Required - Current time in milliseconds. - **symbol** (string) - Optional - Trading pair. - **start_time** (integer) - Optional - Start time in milliseconds. - **end_time** (integer) - Optional - End time in milliseconds. - **limit** (integer) - Optional - Maximum number of records to return (default 500). #### Request Body None ### Response #### Success Response (200) - **data** (array) - List of funding fee records. - **symbol** (string) - The trading pair. - **fundingTime** (integer) - The time the funding fee was applied. - **fundingRate** (string) - The funding rate. - **fee** (string) - The funding fee amount. #### Response Example ```json { "code": "0", "msg": "Success", "data": [ { "symbol": "BTCUSDT", "fundingTime": 1678886400000, "fundingRate": "0.0001", "fee": "-0.00005" } ] } ``` ``` -------------------------------- ### GET /uapi/v1/trade/fillsByOrderId Source: https://www.pionex.com/docs/api-docs/futures-api/general-info/authentication Get fills by order ID. Requires 'Enable reading' permission. ```APIDOC ## GET /uapi/v1/trade/fillsByOrderId ### Description Get fills by order ID. ### Method GET ### Endpoint /uapi/v1/trade/fillsByOrderId ### Parameters #### Query Parameters - **timestamp** (integer) - Required - Current time in milliseconds. - **symbol** (string) - Required - Trading pair. - **orderId** (integer) - Required - Order ID. #### Request Body None ### Response #### Success Response (200) - **data** (array) - List of fills for the specified order (each object has the same structure as GET /uapi/v1/trade/fills). #### Response Example ```json { "code": "0", "msg": "Success", "data": [ { "symbol": "BTCUSDT", "orderId": 123456789, "tradeId": 987654321, "price": "50500.00", "qty": "0.0005", "commission": "0.000000025", "commissionAsset": "USDT", "time": 1678887000000, "isBuyer": true, "isMaker": false } ] } ``` ``` -------------------------------- ### GET /uapi/v1/trade/order Source: https://www.pionex.com/docs/api-docs/futures-api/general-info/authentication Get single order details. Requires 'Enable reading' permission. ```APIDOC ## GET /uapi/v1/trade/order ### Description Get single order details. ### Method GET ### Endpoint /uapi/v1/trade/order ### Parameters #### Query Parameters - **timestamp** (integer) - Required - Current time in milliseconds. - **symbol** (string) - Required - Trading pair. - **orderId** (integer) - Optional - Order ID. - **origClientOrderId** (string) - Optional - Original client order ID. #### Request Body None ### Response #### Success Response (200) - **data** (object) - Order details. - **orderId** (integer) - The order ID. - **clientOrderId** (string) - The client order ID. - **symbol** (string) - The trading pair. - **price** (string) - The order price. - **origQty** (string) - The original order quantity. - **executedQty** (string) - The executed quantity. - **status** (string) - The order status (e.g., NEW, PARTIALLY_FILLED, FILLED, CANCELED). - **type** (string) - The order type (e.g., LIMIT, MARKET). - **side** (string) - The order side (e.g., BUY, SELL). - **stopPrice** (string) - The stop price for stop orders. - **icebergQty** (string) - The iceberg quantity. - **timeInForce** (string) - The time in force (e.g., GTC, IOC, FOK). - **createTime** (integer) - The creation time of the order. - **updateTime** (integer) - The update time of the order. - **isWorking** (boolean) - Whether the order is working. - **origQuoteOrderQty** (string) - The original quote order quantity. #### Response Example ```json { "code": "0", "msg": "Success", "data": { "orderId": 123456789, "clientOrderId": "my_order_1", "symbol": "BTCUSDT", "price": "50000.00", "origQty": "0.001", "executedQty": "0.0005", "status": "PARTIALLY_FILLED", "type": "LIMIT", "side": "BUY", "stopPrice": "0.00000000", "icebergQty": "0.00000000", "timeInForce": "GTC", "createTime": 1678886400000, "updateTime": 1678887000000, "isWorking": true, "origQuoteOrderQty": "25.00" } } ``` ``` -------------------------------- ### POST /uapi/v1/account/leverage Source: https://www.pionex.com/docs/api-docs/futures-api/general-info/authentication Update leverage. Requires 'Enable trading' permission. ```APIDOC ## POST /uapi/v1/account/leverage ### Description Update leverage. ### Method POST ### Endpoint /uapi/v1/account/leverage ### Parameters #### Query Parameters - **timestamp** (integer) - Required - Current time in milliseconds. #### Request Body - **symbol** (string) - Required - Trading pair. - **leverage** (integer) - Required - The new leverage value. - **positionSide** (string) - Optional - The side of the position (e.g., BOTH, LONG, SHORT). Defaults to BOTH. ### Request Example ```json { "symbol": "BTCUSDT", "leverage": 20, "positionSide": "BOTH" } ``` ### Response #### Success Response (200) - **data** (object) - Updated leverage details (same structure as GET /uapi/v1/account/leverage). #### Response Example ```json { "code": "0", "msg": "Success", "data": { "symbol": "BTCUSDT", "leverage": 20, "maxLeverage": 20, "marginType": "ISOLATED", "isolatedMargin": "50.00", "isAutoAddMargin": true, "positionSide": "BOTH" } } ``` ``` -------------------------------- ### Place Order (API) Source: https://www.pionex.com/docs/api-docs/references/api-key-permissions Submit a new order to the trading system. Ensure all required parameters are correctly formatted. ```http POST /api/v1/trade/order ``` -------------------------------- ### GET /uapi/v1/trade/orderByClientOrderId Source: https://www.pionex.com/docs/api-docs/futures-api/general-info/authentication Get order by client order ID. Requires 'Enable reading' permission. ```APIDOC ## GET /uapi/v1/trade/orderByClientOrderId ### Description Get order by client order ID. ### Method GET ### Endpoint /uapi/v1/trade/orderByClientOrderId ### Parameters #### Query Parameters - **timestamp** (integer) - Required - Current time in milliseconds. - **symbol** (string) - Required - Trading pair. - **origClientOrderId** (string) - Required - Original client order ID. #### Request Body None ### Response #### Success Response (200) - **data** (object) - Order details (same structure as GET /uapi/v1/trade/order). #### Response Example ```json { "code": "0", "msg": "Success", "data": { "orderId": 123456789, "clientOrderId": "my_order_1", "symbol": "BTCUSDT", "price": "50000.00", "origQty": "0.001", "executedQty": "0.0005", "status": "PARTIALLY_FILLED", "type": "LIMIT", "side": "BUY", "stopPrice": "0.00000000", "icebergQty": "0.00000000", "timeInForce": "GTC", "createTime": 1678886400000, "updateTime": 1678887000000, "isWorking": true, "origQuoteOrderQty": "25.00" } } ``` ``` -------------------------------- ### Failure Response Example Source: https://www.pionex.com/docs/api-docs/trade-api/general-info/basic-info This is an example of a failed API response, indicating the `result` is false and providing an error `code` and `message`. ```json {"result": false, "code": "TRADE_INVAILD_SYMBOL", "message": "Invalid symbol", "timestamp": 1566691672311} ```