ain icon indicating copy to clipboard operation
ain copied to clipboard

Loan payback during stock split fails

Open kuegi opened this issue 3 years ago • 5 comments

What happened:

During a stocksplit the corresponding pool is deactivated and the vaults are frozen. Normally in a frozen vault you can payback the loan (to prevent liquidation after reactivation due to dropping collateral). Paying the loan back during the stocksplit fails with message "PaybackLoanTx: Pool currently disabled due to locked token (code 16)" I assume that the payback works, but swapping the interest to DUSD fails and therefore the whole thing fails.

What you expected to happen:

payback of loans should always be possible. in this case the interest should not be swapped to DUSD (cause its not possible) but be burned directly.

How to reproduce it (as minimally and precisely as possible):

try to payback a loan of a locked token.

kuegi avatar Aug 25 '22 13:08 kuegi

@kuegi: 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 Aug 25 '22 13:08 defichain-bot

Thanks for reporting this. ~~If this is the case, definitely sounds like a bug. Trying to reproduce.~~

/triage accepted

prasannavl avatar Aug 25 '22 13:08 prasannavl

also depositing DUSD to a vault with TSLA loan right now is not possible Test DepositToVaultTx execution failed: Fixed interval price currently disabled due to locked token But this should also work right?

kuegi avatar Aug 25 '22 14:08 kuegi

Hi @kuegi - Just looked at this again. Apologies for the earlier comment. It is indeed the expected scenario.

Token lock is a global lock on tokens as an exception event. Currently, stock splits are the only feature that use it for safety. Over time, making these locks granular could be one desired approach.

However, in the near term, I wonder if enabling DUSD for collateral deposits into vaults at all points in time is a safe alternative since that is fixed and is not subject to price changes.

On the subject of payback, should we enable burns without DUSD and it's consequences is a different subject entirely. Or perhaps, have a special cased burn only during locked events.

prasannavl avatar Aug 26 '22 01:08 prasannavl

Thx @prasannavl for the feedback. I understand that a locked token puts a break on everything, but imho the possibility to reduce risk must be a main focus.

regarding the deposits: IMHO the oracle price of any token (no matter if its the used one or any other token in the vault) does not change the decision if a deposit is correct or not. Adding coins is always allowed, so neither should the inavailability of an oracle price change this decision.

For the payback I understand the technical reason, but again the focus should be on the possibility to reduce risk. Thats the reason why payback is allowed even when oracles are offline. So the technical reason (swap of interest to DUSD not possible) should not prevent that IMHO.

Should I make feature-request issues for both topics or better change this issue to a feature request for the payback and I create one for the deposit case?

kuegi avatar Aug 26 '22 06:08 kuegi

Closing outdated / stale issues.

prasannavl avatar Jul 15 '24 19:07 prasannavl