Estimated Tradable Quantity
This endpoint calculates the maximum quantity of a specific product that can be bought or sold based on the user’s available funds or holdings, using a specified ratio. This is useful for strategy allocation, risk control, or UI hints for user trade input.
HTTP Request
bash
POST /trade/v1/orders/quantityRequest Parameters
| Name | Type | Required | Description |
|---|---|---|---|
market | ENUM | Yes | Market code (refer to supported market enum values) |
symbol | STRING | Yes | Product symbol/code |
order_side | ENUM | Yes | Order direction: buy or sell (refer to order_side enum definition) |
price | DECIMAL | No | Trade price (required when order_side is buy) |
ratio | DECIMAL | Yes | Ratio of funds or position to allocate (less than 1, e.g., 0.5) |
Example cURL Request
bash
curl --location --request POST '{$base_url}/trade/v1/orders/quantity' \
--header 'X-API-Key: YOUR_API_KEY' \
--header 'X-API-Signature: YOUR_GENERATED_SIGNATURE' \
--header 'X-API-Timestamp: 1746774142003' \
--header 'Content-Type: application/json' \
--data-raw '{
"market": "hkex",
"symbol": "00700",
"order_side": "buy",
"price": 438.30,
"ratio": 0.5
}'Successful Response Format
| Field | Type | Description |
|---|---|---|
qty | DECIMAL | Maximum quantity that can trade |
Successful Response Example
json
{
"code": 0,
"data": {
"qty": 20000
}
}Error Response Example
json
{
"code": 500,
"message": "Internal Service Error",
"details": ""
}For more details on possible error codes and their meanings, please refer to the Error Code Reference.

