vulpemventures / marina

Liquid Wallet browser extension
MIT License
37 stars 19 forks source link

Withdraw amount not correct #483

Closed Janaka-Steph closed 1 year ago

Janaka-Steph commented 1 year ago

I notice that the amount in withdraws is not correct. Most likely that example tx sent 0.001 lbtc including fees. It seems that the amount is adding fees twice.

Screenshot 2023-06-14 at 21 58 41 Screenshot 2023-06-14 at 21 59 12
tiero commented 1 year ago

@louisinger

louisinger commented 1 year ago

The tx is sending 0.0001 + fees isn't it ? The unblinded output in explorer screenshot is the change and you have two inputs (I guess two 0.0001 faucet from testnet). if you sent that tx using the UI without send max button, it's the expected behaviour.

Janaka-Steph commented 1 year ago

@tiero @louisinger Ok yes your interpretation is correct. The fee is not counted twice in the send amount.

However, should we add the fee to the send amount? Here I withdraw 0.00005 LBTC from Green mobile IMAGE 2023-06-19 12:09:21 IMAGE 2023-06-19 12:09:26 On transaction list screen the fee is added to the amount. But clicking to tx detail it shows send amount and fees separately. I think it's the best approach.

In Marina the transaction list is correct, but Outbound amount should be the send amount without fee. What do you think?

louisinger commented 1 year ago

but Outbound amount should be the send amount without fee. What do you think?

Yes u're right, I'll detuct the fee amount from withdraw. However, it should be done only if we own all the inputs, in others cases how do we know if we pay the fees? I'm thinking about swaps for instance: maybe I'm swapping 1 L-BTC for 10 shitcoins without paying the tx fees. In such case, deducting the fees will show swaps as 1 - fees <=> 10 shitcoins

Janaka-Steph commented 1 year ago

Yes, it's relevant only for withdraws