XChange icon indicating copy to clipboard operation
XChange copied to clipboard

How to set fees asset?

Open bthiebault opened this issue 6 years ago • 6 comments

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?

bthiebault avatar May 05 '20 09:05 bthiebault

no. either we can add it to Order or you can use the Binance Trade service *Raw class to get the Binance DTO.

timmolter avatar May 05 '20 16:05 timmolter

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.

bthiebault avatar May 05 '20 16:05 bthiebault

It would be great to have a feeCurrency field along the fee field on the Order DTO.

nielsdraaisma avatar May 28 '20 09:05 nielsdraaisma

| It would be great to have a feeCurrency field along the fee field on the Order DTO.

I have run up against that too

mdvx avatar May 28 '20 16:05 mdvx

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 ?

straumat avatar Dec 24 '20 10:12 straumat

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;

timmolter avatar Dec 25 '20 15:12 timmolter