question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[dex] DEX-locked funds awareness

See original GitHub issue

That might be something that was already mentioned/discussed somewhere, but I didn’t find and decided it is worth mentioning,

When I’m placing an order on DEX-window through Decrediton (on testnet), it isn’t reflected in Decrediton itself (an order is already booked, locked balance in Decrediton = 0):

image

that results in a bit of confusion when using same wallet for other things like sending transactions, because it shows all the funds on my “Balance” when I’m trying to send one:

image

but when I try to fill in all the info I get the error below, and I can only guess that it happens because I have 60 DCR locked in an order on DEX out of 119.something shown on screenshot above in my mixed acc1 (canceling DEX order removes this issue, that’s why I’m pretty confident it is the root cause for Insufficient funds error I’m seeing; specifying lower amount to send also removes the error):

image

Issue Analytics

  • State:open
  • Created 10 months ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
chappjccommented, Nov 28, 2022

Maybe messaging for this could be improved in Decrediton itself: when Decrediton wallet is started and there are open orders on Decrediton-embedded-DEX it could prompt the user to login directly transferring him onto DEX login page, any reason for not to do so ?

Broadly speaking, Decrediton has no clue what DEX is doing, except indirectly by observing the affects on dcrwallet, which include balance and locked UTXO changes. For Decrediton to figure out if there are active orders, it presently requires logging into DEX (and updating the core adapter with a method to get the exchange map with orders, the easy part). We can probably make some changes to client/core.Core to make this info available to consumers like Decrediton prior to logging in. We can look at that after https://github.com/decred/dcrdex/pull/1903

0reactions
norwndcommented, Nov 24, 2022

In the above case, this is all working as intended except for Decrediton messaging and locked balance display, as you say. Decrediton can be changed to check listunspent and listlockunspent (frequently) to discern the correct locked balance amount.

Yeah, messaging is what I think could be improved there.

Only when you log back into DEX will it re-lock the coins. I think there’s ample messaging not to do this, and if you do, to log back in immediately or orders may fail.

Maybe messaging for this could be improved in Decrediton itself: when Decrediton wallet is started and there are open orders on Decrediton-embedded-DEX it could prompt the user to login directly transferring him onto DEX login page, any reason for not to do so ?

Read more comments on GitHub >

github_iconTop Results From Across the Web

What are decentralized exchanges, and how do DEXs work?
DEX aggregators and wallet extensions fueled the growth of decentralized ... These exchanges are often ranked according to the amount of funds locked...
Read more >
Cross-Chain DEX Rubic Loses Over $1M in Funds ... - CoinDesk
Cross-Chain DEX Rubic Loses Over $1M in Funds After Hackers Gain Access to Private Keys. Developers suspect the attackers accessed the admin ...
Read more >
What is a DEX? | Coinbase
A decentralized exchange (or DEX) is a peer-to-peer marketplace where ... investors lock funds in exchange for interest-like rewards — to facilitate trades....
Read more >
DEX - Decentralized Exchange - Guide - Genius Academy
A decentralized exchange (DEX) is a peer-to-peer marketplace where transactions can happen between crypto traders with no intermediary.
Read more >
Understanding Decentralized Exchange (DEX) - RSK Labs
Now, one might argue that DEXs lock up funds in smart contracts and that's tantamount to being custodial. Such claims would be misinformed...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found