# Aave Migrate Source: https://github.com/SBIP-Migration/contracts ## Summary Aave Migrate is a tool that moves a user's entire lending and borrowing positions on Aave, including debts, from one wallet to another the user owns with a single click, without needing funds to repay the debt upfront. The smart contract uses an Aave flashloan to repay existing debts in the original wallet, transfers the aTokens to the destination wallet, reborrows the debts there, and then repays the flashloan with its fee. The project is described as deployed on Goerli, with Aave V2 and V3 contract addresses, a frontend repository, and a video demo. The article presents it as a way to avoid the liquidation risk and time pressure of manual transfers, especially when a wallet has been hacked. ## Article Migrate your lending & borrowing positions on Aave to another wallet Motivation 1) Bad user experience when doing asset migration manually from 1 wallet address to another Numerous Steps required to execute manual transfer: i) Debt from sender wallet needs to be payed back in order for deposited collateral to be retrieved ii) Deposited collateral needs to be retrieved iii) Sometimes users will borrow from recipient wallet first to pay back Step (1). Users risk liquidation if price moves drastically against them during the manual transfer process. 2) A more serious problem when mitigating a hack (Time sensitive) Assuming a user's wallet gets hacked, the user will be competing against the hacker and only has a very brief period of time to migrate their funds to their new wallet. Speed of asset transfer is critical to saving victim's funds. What is this? This tool is meant to make the transfer of lending and borrowed assets much smoother,simpler and faster from their current wallet to another wallet that they own. With a click of a button, users can migrate their entire positions on Aave (including debts) without having the funds to repay their debt at that moment. The smart contract uses Aave flashloan to help out transfer their positions by injecting external liquidity. Deployments Deployed on Goerli Aave V3: https://goerli.etherscan.io/address/0x5b5c27bda785970d5207fb5a9ed0dcdd19bd018e Aave V2: https://goerli.etherscan.io/address/0xb139b3508d637cce06a160666348ebaf24b77fd7#code Frontend Repo: https://github.com/SBIP-Migration/client Website Demo: https://client-five-psi.vercel.app/ Video Demo of OmniTransfer App: https://drive.google.com/file/d/1WIFqMQwiWuUlb_ROBJCHrQ1tS90UnOnC/view?usp=share_link How does it work? It is a 5 step process: Take flashloan from Aave Lending Pool Use flashloan funds to repay all existing debts in original wallet Transfer lending positions (aTokens) from the original wallet to destination wallet Reborrow previous debt positions in destination wallet Repay flashloan with an additional flashloan fee Architecture Fees The cost incurred for the users to migrate their positions are as follows: approve each of the lending positions to the contract approveDelegation each of the previous debts in the "original" wallet, to allow the contract to borrow on behalf of the "destination" wallet Transaction cost for the smart contract call to migrate their positions Flash loan fee that is determined by Aave DAO when we borrowed the flash loan Stretch Goals We could propose this tool for AAVE to enhance user experience. Allow this function for users to send to their whitelisted addresses only ( Mitigate hacks and increase user satisfaction) To offer these services to other lending and borrowing protocols like Compound ## Comments **macbudkowski.eth**: Seems like it's just a demo deployed on Goerli, wondering if Aave is going to fund something like this because TIL that you can't move the loans easily. **timdaub.eth**: There are sites like summer.fi and DeFiSaver. Have you checked those? **macbudkowski.eth**: Haven't tried them, thanks for the recommendation!