Skip to content

Add option to flash loan for unlooping MM position #1392

@DuriSK

Description

@DuriSK

Description:

Use flash loan to cover all user debt in money market, and repay this loan with his supplied asset.
We will use this feature for unlooping MM positions.
This position will be created on proxy account (adding just for context if it would change any decision)

Scenario

Users position on proxy account is as follows:
MM: 300 PRIME supplied, 205.78 HOLLAR borrowed
WALLET: 300 aPRIME, 205.78 HOLLAR

Step 1: Flash Loan the exact debt amount
Borrow 205.78 HOLLAR from the flash loan provider (no collateral needed, must repay within same transaction)

Step 2: Repay entire HOLLAR debt
Use the flash loaned HOLLAR to clear money market debt completely

Step 3: Withdraw all PRIME
With 0 debt, there are no HF constraints — user can withdraw everything

Step 4: Swap just enough PRIME to cover the flash loan

Step 5: Repay flash loan

With this process, user will end up with clear money market, without any supply or debt

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions