- Swap ETH to WETH
- Deposit the resulting WETH to Aave
- Borrow some asset with the ETH collateral
- Extra - Sell the borrowed asset (short selling)
- Repay everything back
The logic of working with Aave within this codebase is similar to how to work with DEXes like Paraswap, Uniswap etc.
Testing: Integration test: Rinkeby Unit tests: Mainnet-fork since we don't need to deploy any mocks
Aave mechanics notes:
- When we deposit funds (e.g. ETH), Aave swaps ETH for WETH (ERC-20 version of ETH) using the WETHGateway contract. Then, resulting WETH is stored in the Aave protocol