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

Vault creation fee uses current creation fee for refund instead of creation fee paid #1707

Open
shohamc1 opened this issue Jan 26, 2023 · 0 comments
Assignees

Comments

@shohamc1
Copy link
Contributor

When a user closes their vault, it should refund 50% of the creation fee. At the moment, the 50% of the current creation fee is refunded.

auto feeBack = consensus.vaultCreationFee / 2;

This means that if the creation fee is changed, then users may be refunded more/less than 50% of the creation fee that they paid.

Scenario 1

  • User A creates vault with 2 DFI
  • Creation fee is increased to 4 DFI
  • User A closes vault, receives $\frac{4}{2}$ = 2 DFI as refund, but should have received 1 DFI

Scenario 2

  • User A creates vault with 2 DFI
  • Creation fee is decreased to 0 DFI
  • User A closes vault, receives $\frac{0}{2}$ = 0 DFI as refund, but should have received 1 DFI

The node should keep track of the creation fee paid for the vault, and return 50% of the fee paid instead.

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

No branches or pull requests

3 participants