BlackBot icon indicating copy to clipboard operation
BlackBot copied to clipboard

The bot doesn't work with the new fee structure.

Open kinbitz opened this issue 3 years ago • 2 comments

Need to add the wxFeeCalculator = pw.WXFeeCalculator() function to calculate the new fee.

kinbitz avatar Feb 22 '22 09:02 kinbitz

The Code of that bot would need quite a bit of tweaking to work properly again. We are using it mostly to learn about PyWaves and WavesExchange. It is educational material for us, and we'd love to see it work properly.

@kinbitz, I like your contribution, however, we will have a problem with line 50 of your fork:

if sell_balance > tranche_size: o = BLACKBOT.sell(PAIR, tranche_size, price, maxLifetime=ORDER_LIFETIME, matcherFee=ORDER_FEE)

It still grabs an old ORDER_FEE config and on the attempt of creating a sell order in the grid, it throws an error. I tried to fix it but haven't managed yet.

In the example of the WX-USDN pair, I changed line 47 a little to pay a fee in WX instead of USDN: (placing a buy grid order works fine)

Replaced: matcherFeeAssetId=priceAssetID

To: matcherFeeAssetId=amountAssetID

Are you able to help fix the fee calculation for the sale orders in your fork? Thanks

hansklepitko avatar Apr 09 '22 08:04 hansklepitko

I am using it on the WAVES-USDN pair and it somehow works, not sure why. Perhaps try to calculate the correct fee using matcher_Fee = wxFeeCalculator.calculatePercentDiscountedBuyingFee(priceAssetID, price, tranche_size).

kinbitz avatar Jun 24 '22 09:06 kinbitz