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 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 tickSize for BTC-USDT is "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 tickSize for SOMECOIN-USDT is "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 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 sz in the QuBit API is uniformly denominated in USDT. The system will automatically calculate the corresponding base currency amount or contract quantity based on the sz (USDT value) and px (price) you submit. This calculated final execution quantity is subject to the lotSize constraint, and the system will automatically round it down to the nearest integer multiple of lotSize. For optimal execution, we recommend that the combination of sz and px you submit results in an execution quantity that meets the lotSize requirement.

  • Rule: (execution_quantity / lotSize) must be an integer.

  • Examples:

    • Assume the lotSize for BTC-USDT is "0.00001" (in BTC).

      • If you submit a limit buy order with px: "50000" and sz: "100" (USDT), the system calculates an execution quantity of 100 / 50000 = 0.002 BTC. Since 0.002 is an integer multiple of 0.00001, this is a valid order.

      • If you submit a limit buy order with px: "60000" and sz: "100" (USDT), the calculated execution quantity is 100 / 60000 ≈ 0.00166666... BTC. The system will automatically round this down to 0.00166 BTC to satisfy the lotSize.

    • Assume the lotSize for BTC-USDT-SWAP is "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 of 500 / 50 = 10 contracts. Since 10 is an integer multiple of 1, 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 Decimal in Python or BigDecimal in Java) in your own applications when handling these values.


Last updated