adshao / go-binance

A Go SDK for Binance API
MIT License
1.48k stars 662 forks source link

[info] how to increase precision #562

Closed MushiTheMoshi closed 1 week ago

MushiTheMoshi commented 1 month ago

Hi there,

Greatly appreciated all work done here.

Wondering how to increase asset precision on futures.WsKlineServe, I can only see 2 decimals, I would like to see the full number decimal available, I read about the precision but unsure how to set up from the lib.

Hope you can help me.

Regards, Julio

xyq-c-cpp commented 1 week ago

what you mean, can you give a example? @MushiTheMoshi

MushiTheMoshi commented 1 week ago

if I want to buy 0.000015 BTC (which is 200 usd) I can't because the precision is set to only 2 decimals meaning that I can only buy min 0.01 BTC, is there a way to update this value to be able to buy 0.000015?

MushiTheMoshi commented 1 week ago

if precision it's not the correct route, I'd appreciate if you can point me in the right direction... thanks

xyq-c-cpp commented 1 week ago

if I want to buy 0.000015 BTC (which is 200 usd) I can't because the precision is set to only 2 decimals meaning that I can only buy min 0.01 BTC, is there a way to update this value to be able to buy 0.000015?

which place said there's only 2 decimals? you can't create order with 0.000015BTC by the rest api interface?

MushiTheMoshi commented 1 week ago

I can't create an order with this size '0.000015BTC' with the futures - rest api, that's correct. I can only see 2 decimals when reading the data via kline websocket...

xyq-c-cpp commented 1 week ago

I can't create an order with this size '0.000015BTC' with the futures - rest api, that's correct. I can only see 2 decimals when reading the data via kline websocket...

Show me your wsklineserve data print

xyq-c-cpp commented 1 week ago

I can't create an order with this size '0.000015BTC' with the futures - rest api, that's correct. I can only see 2 decimals when reading the data via kline websocket...

yeah, actually the data is returned by binance. the precision of create order is not determined by this. you can get a target precision from exchange info interface that's described in binance docs.

xyq-c-cpp commented 1 week ago

completed, close this issue.