Question about calculating the fee before the order is made

Hello! I’m a developer building a POC app using Binance API of spot trading. One of the mandatory things I need to provide to users of the app is the information about fees BEFORE the order was made. Can you please tell me if I can get this info from the API?
I see there are commission data here Binance API Documentation - is it already relative and updated corresponding to the account making the request?
Here Fee Rate I see that one of the things the fee would depend on is BNB balance. Are the commissions returned by account-information-user_data endpoint already take in account the BNB balance of whoever is making the request?
And yet another question: trade-fee-user_data this endpoint also gives me commission data but per trading pairs. Why do I need this info if the fees are calculated in percentages relative to the currency I receive (right?) ? Are those different from what I get from account-information-user_data endpoint and are they relative and updated corresponding to the account making the request?
Thank you very much in advance! I really need you help for my POC!

Can you please tell me if I can get this info from the API?

https://binance-docs.github.io/apidocs/spot/en/#trade-fee-user_data

I see there are commission data here Binance API Documentation - is it already relative and updated corresponding to the account making the request?

Yes, however promotional discounts and BNB burn discount is not taken into consideration. Therefore, it would be recommended to use the BNB Burn status endpoint to check if the user is eligible for the 25% discount.

https://binance-docs.github.io/apidocs/spot/en/#get-bnb-burn-status-user_data

Here Fee Rate I see that one of the things the fee would depend on is BNB balance. Are the commissions returned by account-information-user_data endpoint already take in account the BNB balance of whoever is making the request?

Yes, however the Trade Fee endpoint mentioned previously is more ideal as the payload is smaller than the payload of the account information endpoint.

And yet another question: trade-fee-user_data this endpoint also gives me commission data but per trading pairs. Why do I need this info if the fees are calculated in percentages relative to the currency I receive (right?) ? Are those different from what I get from account-information-user_data endpoint and are they relative and updated corresponding to the account making the request?

The Trade Fee is the recommended endpoint as commission is determined on the base asset of the symbol. Therefore, if in future changes a symbol has a different commission rate it will be visible in the Trade Fee endpoint. The Trade Fee endpoint values are the commission percentage as an absolute value (percentage / 100)

1 Like