Skip to content

Implement flash loan + liquidation combo integration tests #490

Description

@Smartdevs17

Context

Flash loans combined with liquidations are complex attack vectors and legitimate use cases. Integrated testing ensures both paths work correctly.

Current Limitation/Problem

Flash loans and liquidations are only tested in isolation. Their interaction may reveal unexpected behavior.

Expected Outcome

Integration tests that verify flash loan + liquidation combos work correctly and without exploitable interleaving.

Acceptance Criteria

  • Test: flash loan → borrow → liquidate → repay flash loan (profitable)
  • Test: flash loan → manipulate price → liquidate → repay (circuit breaker stops)
  • Test: multiple flash loans in same transaction cascade
  • Test: flash loan liquidation when position is at boundary health factor
  • Test: liquidation with flash-loaned funds across multiple positions
  • Verify: protocol fee is correctly collected in flash-loan liquidations
  • Verify: liquidation cannot be griefed via flash loan sandwich
  • Gas benchmark: flash loan liquidation vs standard liquidation
  • Edge cases: partial liquidation with flash loan, empty flash loan

Technical Scope

  • Files: tests/integration/flash-loan-liquidation/
  • Contracts: flash-loan, liquidation-engine, lending-pool
  • Test scenarios: profitable, unprofitable, boundary conditions

Metadata

Metadata

Assignees

No one assigned

    Labels

    200-points200 point issuedrips-waveDrips Wave project taskhighHigh priority issue

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions