StableTechnologies / TezFin

The first decentralized lending and borrowing platform on Tezos blockchain.
https://tezos.finance
0 stars 0 forks source link

Error state for when users don't have enough XTZ to cover transaction fee #91

Closed navi-arneja closed 2 years ago

navi-arneja commented 2 years ago

Designs: TBD

vgaudis commented 2 years ago

Figma to use https://www.figma.com/file/UY7Jcg9gZpbgKiQ7kEXWqM/TezFin?node-id=613%3A9825 Error message should be: "There is no enough XTZ in your wallet to cover the transaction fee"

vgaudis commented 2 years ago

Here is an example of the issue we want to warn users ->

If you only have XTZ and a small amount of XTZ in your wallet the issue will not happen as instead it will trigger a msg "Insufficient funds" meaning you do not have enough XTZ to do something with it. But the first case could happen when you trade like crazy other asset than XTZ and at some point you use all your XTZ and cannot pay for the next transaction.

This error message should show on the different modals (supply/borrow/repay) whenever it detects that there is not enough XTZ for the transaction to be completed.

vgaudis commented 2 years ago

So I understand from past discussions that currently we manage to trigger Error messages based on certain conditions even before the Construction Failed happened by anticipating the error (we apply consistency check) but not because we interpret the error by listening conseil or check external sources. So how can we find out if there is enough XTZ to pay the gas fee and process an operation before the error happens if we cannot interpret Conseil messages? Can we instead check on tzkt / Conseil or somewhere the current amount of XTZ needed to process an operation and compare to the user balance or something around those lines? @gdsoumya @vishakh

vgaudis commented 2 years ago

Lowering the importance of this ticket. With the current tools, we cannot capture the information before the "Construction Failed" error. Instead we will add a warning message on any popup modal (Supply/Borrow/Repay) that warn users when their XTZ balance is very low (like <0.5 XTZ) to let them know that they may not be able to process more operations if they don't add some XTZ to their wallet. We can do this by checking their balance before any transaction. The warning message will display but will not prevent them to proceed. "Your XTZ balance is low. You may soon not be able to process any new operation if you don't add XTZ to your wallet".

vgaudis commented 2 years ago

PR #180 deployed.