block-dx
block-dx copied to clipboard
wallets with a low number of utxos cannot place orders (balance shown as zero)
tl;dr new wallets will have a problem placing more than a small number of orders on the DX due to the low number of utxos in a typical newly-funded wallet. To work around this, fund the wallet with a bunch of small transactions instead of one big one. Consider including a UI indicator for how many utxos a wallet has if it is approaching the number of orders a user has open, and a button to help resolve this. example: (orders avail: 3 | [split UTXOs] )
Additionally, there should be a clear indication of what a user's balance is vs how much of that balance is able to be used to create an order. Recommend adding additional collumn next to "Available Balance" that reports "Total Balance" to avoid new user confusion or panic when the UI says all of their coins are gone.
Blocknet Wallet version: 4.0.2 BlockDX: 1.6.0 DIVI: Daemon 1.0.7.0 (client 1.6.4) BTC Core: 0.19.0.1 All wallets fully synced All wallets encrypted and unlocked
Complaint: When creating new orders on the BTC/DIVI pairing, DIVI balance drops to zero after placing two orders, preventing further use of the DX.
- Steps to reproduce
- launch DX environment (as documented at the top)
- Place BUY order for BTC, paying with DIVI
- Place another BUY order
- DIVI balance drops to zero
- Place 3rd order
- Error code 1019, API dxMakeOrder, message says:
- "Error: Unable to create order due to insufficient funds...[etc]"
- Workarounds attempted (unsuccessfully)
- restart BlockDX [no change]
- restart DIVI wallet [no change]
- Note: BlockDX does properly disconnect and reconnect to the DIVI wallet when I close and reopen it, but still says balance=0
- downgrade to 1.0.4 and reconfigure [no change]
- make sure the two orders are not identical, cancel and change the price for order #2 [no change]
- notable notices
- If I cancel one of the the two orders then refresh my balances, Divi shows proper balance again. Creating a second order reduced balance to zero again.
- Workaround, cause, and solution
- After going through the above, it dawned on me that this behavior isn't a bug at all and is actually working as designed. When placing an order, BlockDX reserves the entire UTXO(s) that it's going to be funding the transaction with. In my case, I had exactly two utxos in my Divi wallet because this is a fresh environment with newly funded wallets. When the first order was created, it reserved an entire utxo and decremented it's balance in the UI. When I placed the second order, it decremented the remaining balance and displayed 0.000000
- to get around this problem, a user can send themselves a bunch of smaller transactions to force a plitting up of the utxos. After these are verified, they can be used in BlockDX and you can create as many orders as there are utxos in your wallet.
- recommended solution
- This will confuse a new user, but it also isn't broken. What's needed are two things:
- something in the UI that correlates to how many utxos are in each wallet (probably in the balances area)
- Some sort of code that can implement the above workaround automatically for the user. A button, for example, that says "split utxos" or something less lingo-ridden.
- This will confuse a new user, but it also isn't broken. What's needed are two things:
Hey @dis7ant thanks for the comment (and sorry for the delay).
This will confuse a new user, but it also isn't broken. What's needed are two things: something
- in the UI that correlates to how many utxos are in each wallet (probably in the balances area)
- Some sort of code that can implement the above workaround automatically for the user. A button, for example, that says "split utxos" or something less lingo-ridden.
Agreed it can be confusing to newcomers. To resolve this we plan to:
- Update the balance panel to show both the total balance and available balance
- Add the ability to view your inputs
- Add support for splitting inputs when creating orders
- Add support for partial orders
At the moment partial orders are currently under development.