Skip to main content

Price & Quantity Precision

A market consists of two assets, namely base asset and quote asset. For instance, the BTCUSD market has BTC as base asset and USD as quote asset. The price of a market is denominated in the quote asset, while the quantity is denominated in the base asset. For instance, the price in BTCUSD market is in USD while the quantity is in BTC. Each asset has its own precision. For this, the below asset APIs can be queried.

The precision of an asset is the number of decimal places used to express its value in. For instance, the quantity in the market BTCUSD is in BTC. As BTC has a precision of 8, the quantity in BTCUSD has 8 decimal places. It follows that in order to express a quantity of 1 BTC in BTCUSD market, it has to be 1.00000000 BTC.

Alternatively, the below market APIs can also be queried to obtain the price and quantity precisions for different markets.

Following the logic outlined above,

  • The precision for quantity is defined by the basePrecision
  • The precision for price is defined by quotePrecision