bisq icon indicating copy to clipboard operation
bisq copied to clipboard

BSQ balance after swap doesn't reconcile properly

Open pmartincalvo opened this issue 2 years ago • 3 comments

Description

After executing a BSQ Swap (I buy BSQ, sell BTC) on a daemon with a clean transaction history, the BSQ balance doesn't add up to the purchased BSQ.

Version

1.9.4 daemon + cli

Steps to reproduce


Note

bisq_cli is an alias for java -jar cli.jar --password=mypassword.


I checked available offers with bisq_cli getoffers --direction=BUY --currency-code=BSQ. I decided to pick the following one:

Buy/Sell            Price in BTC for 1 BSQ           BTC(min - max)    BSQ(min - max)  Payment Method  Creation Date (UTC)   ID
Sell BSQ (Buy BTC)              0.00004680               0.00060000             12.82  BSQ Swap        2022-07-20T20:49:31Z  PJNjEX-0461e540-c6ed-49f7-b1f7-8584f8aefb69-192  

Took it successfully. I'm paying the trade fee with BTC since I have no BSQ:

bisq_cli takeoffer --offer-id=PJNjEX-0461e540-c6ed-49f7-b1f7-8584f8aefb69-192 --fee-currency=BTC

trade PJNjEX-0461e540-c6ed-49f7-b1f7-8584f8aefb69-192 successfully taken

After the trade is finished, I go and check my BSQ balance

bisq_cli getbalance --currency-code=bsq

Available Confirmed Balance  Unverified Balance  Unconfirmed Change Balance  Locked For Voting Balance  Lockup Bonds Balance  Unlocking Bonds Balance
                      12.74                0.00                        0.00                       0.00                  0.00                     0.00

And here is the surprise. If I took a trade to buy 12.82, why do I only have 12.74?

Note that this is the only trade this wallet has executed.

Expected behaviour

Obtaining 12.82 BSQ after the trade.

Actual behaviour

Obtaining 12.74 BSQ after the trade.

Screenshots

NA

Device or machine

Debian 11 on a VPS.

Additional info

NA

pmartincalvo avatar Sep 10 '22 06:09 pmartincalvo

Trading fees are paid from the BSQ purchase.
Current taker fees are 126.02 BSQ per BTC traded. 0.0006 * 126.02 = 0.08 BSQ

In the GUI the fee is shown before committing to the trade.

ghost avatar Sep 10 '22 13:09 ghost

Thanks for your comment. I still don't fully understand how this works:

  • I had 0 BSQ when I took the offer. Who can the trading fee of a BSQ swap be paid with BSQ that is still not in my possession?
  • I specified --fee-currency=BTC in the takeoffer method. Isn't this supposed to specify that I want to pay the trading fee with BTC?

pmartincalvo avatar Sep 10 '22 14:09 pmartincalvo

What @jmacxx said is right. Your BSQ balance is correct. 0.08 BSQ was deducted from your BSQ payout for the trade fee.

  • This issue flushed out an API bug: showing an incorrect trade fee of 0.00 BSQ in API clients for the BSQ buyer side (yours). Instead of showing you 0.00 BSQ in the Trade Fee column of the gettrade(s) console output, it should have displayed 0.08 BSQ. Fixed in new PR https://github.com/bisq-network/bisq/pull/6357.

  • It also flushed out a documentation problem, and a takeoffer request param validation problem -- misleading you into trying the --fee-currency=BTC param in your takeoffer request. That request param is ignored for BSQ swaps -- BSQ swap trade fees are always paid in BSQ.
    Fixed in new PR https://github.com/bisq-network/bisq/pull/6356.
    Documented now in the API reference's takeoffer request doc. And documented in the CLI's takeoffer man-page. (If/when 6356 is merged, this change will be deleted with its branch, but available in the master branch.)

ghubstan avatar Sep 11 '22 19:09 ghubstan

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

github-actions[bot] avatar Aug 24 '23 00:08 github-actions[bot]

This issue has been automatically closed because of inactivity. Feel free to reopen it if you think it is still relevant.

github-actions[bot] avatar Aug 31 '23 00:08 github-actions[bot]