How to set fees asset?
On Binance, for instance, the fees are not necessarily paid with the one of the currencies the trade is made with. For instance, if I buy BTC with USDT, I can pay the fees in BNB.
This information is passed in the user data stream websocket (https://github.com/binance-exchange/binance-official-api-docs/blob/master/user-data-stream.md#order-update).
When I receive the order update notification, I can read the fee amount (field "n") and the fee asset (field "N").
However, the org.knowm.xchange.dto.Order class, can only store the fee amount, not its currency. Is there a way to store this piece of information?
no. either we can add it to Order or you can use the Binance Trade service *Raw class to get the Binance DTO.
I don't know if other exchanges have the same way of working, so it depends.
I would prefer this to be added to Order, because that's the object I'm passing in my program, so it can be used on any exchange.
It would be great to have a feeCurrency field along the fee field on the Order DTO.
| It would be great to have a feeCurrency field along the fee field on the Order DTO.
I have run up against that too
Isn't it very dangerous to only have fee and not the fee currency ? This let the developer guess what is the fee currency and that can lead to errors no ?
yes, it would be a good idea to add that to Order just like in UserTrade:
/** The currency in which the fee was charged. */
private final Currency feeCurrency;