How to get correct price/quantity precision for symbol?

Hi,

I’ve tried using https://api.binance.com/api/v3/exchangeInfo to retrieve (for each Symbol) price and quantity precisions (i.e. field baseAssetPrecision and quoteAssetPrecision).

But it seems they are always “8”? :open_mouth:
For example, it returns 8 for both field on BTCUSDT, but in fact they aren’t (mostly like 2 and 5).

How can I get real values for a symbol?

Thanks

qty = quoteQty / price
(quantity-minQty) % stepSize == 0
price % tickSize == 0

So for quantity (baseAsset) the precision will be stepSize.
And for quoteQty (quoteAsset) it will be stepSize * tickSize, but no more than quoteAssetPrecision.

I don’t see any of those info from the api Binance API Documentation

stepSize? tickSize? I don’t have any order yet… I need an interface to accomplish them (i.e. on a next step)…

The stepSize and tickSize are returned in the exchangeInfo endpoint. Both values may vary for different symbols.

1 Like

@markzzz sorry, rigth answer would be:

for quantity (baseAsset) the precision will be stepSize.
for quoteQty (quoteAsset) it will be tickSize.

The Asset Precision field means the amount of crypto that the exchange can handle (balance, commissions, etc.).


THIS IS THE DATA STRUCTURE THAT RETURNS YOU EXCHANGE INFO FOR THE BTCUSDT PAIR THERE YOU WILL FIND THOSE VALUES THAT MENTION YOU IN THE FILTERS FIELD

1 Like

So for quantity is LOT_SIZE’s stepSize and for price is PRICE_FILTER’s tickSize, correct?

Why @Chill said stepSize * tickSize?

Also, any fancy trick to trasform (for example) 25464.8778 in 25464.87 having only 0.01 :slight_smile:

Except doing log(1/0.01) and than truncate…

See my reply in the first thread.