defichain-wallet icon indicating copy to clipboard operation
defichain-wallet copied to clipboard

`e2e` - `Loans` - User able to borrow token even if vault share <50%

Open izzycsy opened this issue 3 years ago • 4 comments

https://user-images.githubusercontent.com/65014479/161752501-a845d949-9817-49f4-9e39-491d06898364.mov

What would you like to be added:

• If vault share <50% DFI and/or DUSD, user is still able to borrow loan token even, so long as user has sufficient DFI to cover half the of the potentially borrowed token • Same applies to BORROW MORE

IMG_1458 IMG_1459

• In screenshot example above, user will be able to borrow 0.007 DUSD more, but unable to proceed to borrow more when input is 0.008 DUSD

Why is this needed:

• Current understanding is that vault share req. is strictly >50% DFI and/or DUSD before user is able to borrow / borrow more token in vault • This ticket is to re-test the scenario for vault share & borrowing of token

izzycsy avatar Apr 05 '22 12:04 izzycsy

@izzycsy: Thanks for opening an issue, it is currently awaiting triage.

The triage/accepted label can be added by foundation members by writing /triage accepted in a comment.

Details

I am a bot created to help the DeFiCh developers manage community feedback and contributions. You can check out my manifest file to understand my behavior and what I can do. If you want to use this for your project, you can check out the DeFiCh/oss-governance-bot repository.

defichain-bot avatar Apr 05 '22 12:04 defichain-bot

@izzycsy: Thanks for opening an issue, an appropriate priority will be added soon.

The priority labels can be added by foundation members by writing /priority [type] in a comment.

Details

I am a bot created to help the DeFiCh developers manage community feedback and contributions. You can check out my manifest file to understand my behavior and what I can do. If you want to use this for your project, you can check out the DeFiCh/oss-governance-bot repository.

defichain-bot avatar Apr 05 '22 12:04 defichain-bot

Not a bug, just need to have automated tests for this

thedoublejay avatar Apr 06 '22 00:04 thedoublejay

New conditions when borrowing loan token:

  • vault col ratio >= min col ratio (unchanged)
  • 50% of total loan value * min col ratio <= total DFI in collateral Post Fort Canning Road hardfork: 50% of total loan value * min col ratio <= total DFI and/or DUSD in collateral

Example Vault:

  • min col ratio: 150%
  • collateral: $100 DFI (29%) + $250 dBTC (71%)
  • Max loan value can be taken with new calculation = 2 * DFI in collateral / min col ratio = 2 * $100 / 1.5 = $133.33

kyleleow avatar Apr 07 '22 06:04 kyleleow