api - Binance get quantity got from trade

api – Binance get quantity got from trade


I’m working with the Binance API. I can’t find a way to calculate how much amount of a certain asset I get from a trade after commissions.

E.g. if I spend 100 USDT to buy BTC worth say $200 each since an order isn’t always filled in full, I can query the executed quantity, which is for example 50 USDT. Now, the commission is calculated on the amount of base asset: I get the relative quantity before commission which is 50/200 = 0.25 BTC so the quantity of BTC I get into my account after commission should be in (0.25*percent_commission/100)–0.25.

Since it’s a buy order, I should use the values for maker commissions.
I don’t know if others’ fees/commissions are applied on the spot order if so please point it out.

Source link

Leave a Comment

Your email address will not be published.