WOOF! developed Migrator – a tool for seamless migration of lend or borrow position from AAVE, Morpho, or Spark to Compound v3.
Migrator is available here. We also urge you to check the demo first.
This project was developed under the Compound Grants Program.
Overview
The migration is available from the three protocols: Aave, Spark, and Morpho. Migrator supports cross-isolated margin and free collateral migration. An advanced technical decision includes multi-protocol support implementation, the customized Uniswap router, a token proxy-conversion mechanism, protection from liquidation via Health Factor logic, and an administrative solution for scalability. The approach makes migration fully transparent and safe, the swaps are provided on the most beneficial conditions.
Useful links
- App
- Demo
- Smart contracts
- Research document
- Comparison: Original vs Final Scope
- Grant application on CGP
Core features
Seamless Multi-Protocol Migration Support
Our solution enables simultaneous migration from Aave, Spark, and Morpho, providing full support for three distinct lending protocols with completely isolated logic. This ensures maximum flexibility for users when managing their positions across different platforms.
Six Specialized Adapters (Two Per Protocol)
-
Dedicated adapters for networks with USDS-based markets (e.g., Ethereum), featuring a DAI proxy mechanism for enhanced support.
-
Allows dynamic mode switching based on available liquidity—without the need to redeploy contracts.
Flexible Position Migration with Partial Asset Selection
-
Users can migrate specific collaterals or debts instead of transferring their entire portfolio.
-
Built-in health factor checks ensure safe asset withdrawals.
Debt-Free Migration (No Flash Loans Needed)
- If a user has no debt, the migration proceeds without a flash loan, reducing gas costs and simplifying the process.
Uniswap V3 Swap Integration
-
Swap parameters can be customized for each individual position (collaterals and debts).
-
The frontend provides full control over swap routes.
Smart Swap Pathfinding with Custom Contract
-
A dedicated UniswapV3PathFinder contract optimizes swap routes:
-
Supports single-hop and multi-hop swaps.
-
Allows exclusion of specific pools to prevent reuse.
-
Directly supports USDS ⇄ DAI swaps without additional queries.
-
-
Reduces frontend complexity while improving user experience.
Dynamic Migration Behavior
-
If the base asset is deposited, it is automatically used to repay the flash loan.
-
If only collaterals are deposited, the system initiates a debt to close the loan.
-
If the token balance is insufficient, the system automatically covers the difference with new debt.
-
This ensures a smooth, risk-minimized migration process.
DAI ⇄ USDS Proxy Conversion
-
Enhances liquidity flexibility by reducing reliance on USDS markets.
-
Supports Compound markets with non-standard base tokens without degrading UX.
Scalable & Admin-Friendly Architecture
-
Easily add or remove adapters as needed.
-
Configure flash loan parameters for optimized efficiency.
-
Scale to new markets without modifying the core contract.
Our migrator is fully compatible with all recently deployed markets and chains, providing a future-proof and efficient migration experience.
Next steps
- Community feedback.
- Scheduling a security audit with OpenZeppelin.
- Front-end deployment.