Skip to content
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

Allow payback of DUSD with vault's collateral #1451

Merged
merged 10 commits into from
Sep 11, 2022

Conversation

Jouzo
Copy link
Collaborator

@Jouzo Jouzo commented Sep 8, 2022

What kind of PR is this?:

/kind feature

What this PR does / why we need it:

Allow payback of DUSD with vault's collateral

@prasannavl
Copy link
Member

TODO:

  • After the paying back with collateral, add checks if the vault will enter liquidation in the post change state. If it does, TX should be rejected.
  • Add interest burn as another gov var. If it's active, it burns/discards negative interests, otherwise, it reduces that from collateral as well. So, this becomes a governance option than hard coded.
  • [Pending] Payback TX.

Looks good otherwise.

return Res::Err("tx must have at least one input from token owner");

if (!IsVaultPriceValid(mnview, obj.vaultId, height))
return Res::Err("Cannot payback vault with collateral while any of the asset's price is invalid");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not? we can always payback loans with same coin, cause no oracle price needed.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let me answer this on the main comments for better visibility later.

src/masternodes/mn_checks.cpp Outdated Show resolved Hide resolved
src/masternodes/mn_checks.cpp Outdated Show resolved Hide resolved
@prasannavl prasannavl merged commit d9a26cf into master Sep 11, 2022
@prasannavl prasannavl deleted the feature/payback_with_collateral branch September 11, 2022 07:02
@sambP
Copy link

sambP commented Oct 23, 2022

It's currently not possible to get some information over the RPC about what's really happening in the vault, right? It would be nice to get an entry in the listvaulthistory.

Is this what @prasannavl means with:

[Pending] Payback TX.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants