Price & Lot Size
In the QuBit API, all order prices (px) and sizes (sz) must adhere to their specific precision requirements. These precision rules are defined by two core parameters: tickSize and lotSize.
You can retrieve the specific tickSize and lotSize values for each product via the Get Instruments (GET /api/v1/common/instruments) endpoint.
tickSize - Price Precision (The minimum price increment)
tickSize - Price Precision (The minimum price increment)tickSize defines the smallest valid unit for an order's price (px). All submitted order prices must be an integer multiple of the tickSize.
Rule:
(px / tickSize)must be an integer.Examples:
Assume the
tickSizeforBTC-USDTis"0.01".Valid prices:
"68000.00","68000.50","68001.23"Invalid prices:
"68000.001"(too precise),"68000.123"(not an integer multiple of 0.01)
Assume the
tickSizeforSOMECOIN-USDTis"0.0005".Valid prices:
"1.2500","1.2505","1.2510"Invalid prices:
"1.2501"(not an integer multiple of 0.0005)
lotSize - Size Precision (The minimum size increment)
lotSize - Size Precision (The minimum size increment)lotSize defines the smallest valid unit for an order's quantity. All submitted order quantities must be an integer multiple of the lotSize.
Important Note: The order size
szin the QuBit API is uniformly denominated in USDT. The system will automatically calculate the corresponding base currency amount or contract quantity based on thesz(USDT value) andpx(price) you submit. This calculated final execution quantity is subject to thelotSizeconstraint, and the system will automatically round it down to the nearest integer multiple oflotSize. For optimal execution, we recommend that the combination ofszandpxyou submit results in an execution quantity that meets thelotSizerequirement.Rule:
(execution_quantity / lotSize)must be an integer.Examples:
Assume the
lotSizeforBTC-USDTis"0.00001"(in BTC).If you submit a limit buy order with
px: "50000"andsz: "100"(USDT), the system calculates an execution quantity of100 / 50000 = 0.002BTC. Since0.002is an integer multiple of0.00001, this is a valid order.If you submit a limit buy order with
px: "60000"andsz: "100"(USDT), the calculated execution quantity is100 / 60000 ≈ 0.00166666...BTC. The system will automatically round this down to0.00166BTC to satisfy thelotSize.
Assume the
lotSizeforBTC-USDT-SWAPis"1"(in contracts).If you submit an order with
sz: "500"(USDT), and assuming at the current price one contract is worth 50 USDT, the system will calculate a quantity of500 / 50 = 10contracts. Since10is an integer multiple of1, the order is valid.
💡 Numerical Handling
All fields related to price, size, and amount in the QuBit API are transmitted as strings to avoid floating-point precision issues. We strongly recommend using high-precision math libraries (such as
Decimalin Python orBigDecimalin Java) in your own applications when handling these values.
Last updated