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

AMM support for selling enough to repay a debt, or everything if there isn't enough #4321

Closed
Chris-Hibbert opened this issue Jan 18, 2022 · 1 comment
Assignees
Labels
AMM Core Economy OBSOLETE in favor of INTER-protocol enhancement New feature or request Inter-protocol Overarching Inter Protocol needs-design

Comments

@Chris-Hibbert
Copy link
Contributor

What is the Problem Being Solved?

When a Vault is in default, the liquidation contract currently makes two calls to the AMM in some cases. The request should be handled in a single call.

Description of the Design

See #2267. To satisfy offer safety, we start by trying to sell exactly enough to resolve the debt. If the balance of the collateral isn't enough to repay the debt, that transaction fails, and we make another call to sell everything. We should add a new method that relies on privateArgs to allow the caller to specify these requirements.

Security Considerations

Not a security issue.

Test Plan

Verify that the trade can succeed either by selling just enough and returning the excess, or by selling everything.
Eventually the RUN protocol will have to notice the shortfall and replace the lost funds, but we don't have a design for that yet.

@Chris-Hibbert Chris-Hibbert added enhancement New feature or request Core Economy OBSOLETE in favor of INTER-protocol Inter-protocol Overarching Inter Protocol AMM labels Jan 18, 2022
@Chris-Hibbert Chris-Hibbert added this to the Mainnet: Phase 1 - RUN Protocol milestone Jan 18, 2022
@Chris-Hibbert Chris-Hibbert self-assigned this Jan 18, 2022
@Chris-Hibbert Chris-Hibbert mentioned this issue Jan 18, 2022
12 tasks
@Tartuffo Tartuffo added MN-1 restival to be done before RUN Protocol Purple Team festival labels Jan 21, 2022
@dtribble dtribble removed MN-1 restival to be done before RUN Protocol Purple Team festival labels Jan 24, 2022
@dtribble dtribble removed this from the Mainnet: Phase 1 - RUN Protocol milestone Jan 24, 2022
@Tartuffo Tartuffo added MN-1 and removed MN-1 labels Jan 26, 2022
@dtribble dtribble self-assigned this Mar 18, 2022
@Chris-Hibbert
Copy link
Contributor Author

resolved by #5125

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
AMM Core Economy OBSOLETE in favor of INTER-protocol enhancement New feature or request Inter-protocol Overarching Inter Protocol needs-design
Projects
None yet
Development

No branches or pull requests

3 participants