-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(ui-ux): allow dusd loops in vaults #4114
Conversation
DFC-394 DUSD Loops in Vaults
Summary Based on: **What happened based on **[Issue #4034](https://Allow DUSD loops in Vault in changi network #4034) "DVM: Enable DUSD loops in vaults #1971 was integrated in June in a beta release for changi. Now I want test it in the Lightwallet with a new vault and DUSD as collateral. But the Lightwallet does not allow it: Continue Button is disabled with message: 'Insuffucient DFI in vault. Add more to borrow DUSD" What you expected to happen:Allow borrowing of DUSD in a Vault with DUSD collateral. How to reproduce it (as minimally and precisely as possible):
|
Missing Translations ReportThe following translations are missing for this pull request. {
"missingLanguageItems": {
"zh-Hans": {
"missingCount": 0,
"labels": {},
"totalCount": 2029,
"allLabels": "{}"
},
"zh-Hant": {
"missingCount": 0,
"labels": {},
"totalCount": 2029,
"allLabels": "{}"
},
"fr": {
"missingCount": 0,
"labels": {},
"totalCount": 2029,
"allLabels": "{}"
},
"es": {
"missingCount": 0,
"labels": {},
"totalCount": 2029,
"allLabels": "{}"
},
"it": {
"missingCount": 0,
"labels": {},
"totalCount": 2029,
"allLabels": "{}"
}
},
"totalMissingCount": 0
} |
Build preview for DeFiChain Wallet is ready! Built with commit 6a7c145 https://expo.io/@defichain/wallet?release-channel=pr-preview-4114 |
Codecov Report
@@ Coverage Diff @@
## main #4114 +/- ##
===========================================
- Coverage 56.13% 36.87% -19.26%
===========================================
Files 438 438
Lines 12312 12352 +40
Branches 4069 4089 +20
===========================================
- Hits 6911 4555 -2356
- Misses 5317 7746 +2429
+ Partials 84 51 -33
... and 141 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
mobile-app/app/screens/AppNavigator/screens/Loans/screens/AddOrRemoveCollateralScreen.tsx
Show resolved
Hide resolved
One thing came to my mind regarding your comment about my PR. You absolutely correct that adding/removing collateral was missing. I found one case, where it was especially needed. If you have a vault with DFI + DUSD as collateral and DUSD as loan. If you then try to remove all the DFI while still having enough DUSD to cover the loan, it should be possible to take out the DFI. As before the 50% DFI requirement was valid and afterwards the 100% DUSD. I added a comment to the PR, where I think this check is missing. As it is not working on your current feature branch. I have tested a few of my tests, which all passed. |
Thanks for checking! You are correct, I updated the PR to enable the removal of all DFI in the presence of only DUSD. |
mobile-app/app/screens/AppNavigator/screens/Loans/hooks/ValidateDUSDLoanAndCollateral.ts
Outdated
Show resolved
Hide resolved
mobile-app/app/screens/AppNavigator/screens/Loans/hooks/ValidateLoanAndCollateral.ts
Show resolved
Hide resolved
* | ||
* Note: DUSD loops in vaults are now allowed - https://github.com/DeFiCh/ain/pull/1971 | ||
* | ||
* @returns |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* @returns | |
* @param props - An object containing the collateral and loan information. | |
* @returns { isLoanAllowed: boolean } - Indicates whether the loan is allowed. |
What this PR does / why we need it:
In line with ain changes (DeFiCh/ain#1971), DUSD loops in vaults should now be allowed
Which issue(s) does this PR fixes?:
Fixes #4034, DFC-394
Additional comments?:
When testing this PR, please check the following scenarios:
Users should be able to take a DUSD loan when their vault has the following collaterals:
Users should NOT be able to take a DUSD loan when their vault has the following collaterals:
Users should NOT be able to take a non-DUSD loan when their vault has the following collaterals:
Others:
Developer Checklist: