Flash Loan Arbitrage | Aave Flash Loan Tutorial

Published: 02 October 2022
on channel: Block Explorer
153,021
4k

Create an Aave Flash Loan arbitrage smart contract from scratch in this comprehensive flash loan tutorial. In this step-by-step DeFi tutorial we use the Aave v3 protocol to build a flash loan receiver smart contract. We'll then use a mock DEX contract to simulate a flash loan arbitrage.

Project repo:
https://github.com/jspruance/aave-fla...

Aave v3 Flash Loan documentation:
https://docs.aave.com/developers/guid...
https://docs.aave.com/developers/depl...

DAI-TestnetMintableERC20-Aave token (Goerli):
0xDF1742fE5b0bFc12331D8EAec6b478DfDbD31464

USDC-TestnetMintableERC20-Aave token(Goerli):
0xA2025B15a1757311bfD68cb14eaeFCc237AF5b43

AAVE PoolAddressProvider (Goerli):
0x5E52dEc931FFb32f609681B8438A51c675cc232d

Get Goerli test Eth here:
https://faucets.chain.link/

Get test ERC20 tokens here:
https://staging.aave.com/faucet/?mark...

Remix imports:
import {FlashLoanSimpleReceiverBase} from "https://github.com/aave/aave-v3-core/...";
import {IPoolAddressesProvider} from "https://github.com/aave/aave-v3-core/...";
import {IERC20} from "https://github.com/aave/aave-v3-core/...";

Dex.sol deployed (Goerli):
0xD6e8c479B6B62d8Ce985C0f686D39e96af9424df

Add liquidity:
USDC 1500
DAI 1500

Approve:
USDC 1000000000
DAI 1200000000000000000000

Request Loan - USDC (6 decimal):
0xA2025B15a1757311bfD68cb14eaeFCc237AF5b43,1000000000 // 1,000 USDC
0xA2025B15a1757311bfD68cb14eaeFCc237AF5b43,1000000 // 1 USDC


Watch video Flash Loan Arbitrage | Aave Flash Loan Tutorial online without registration, duration hours minute second in high quality. This video was added by user Block Explorer 02 October 2022, don't forget to share it with your friends and acquaintances, it has been viewed on our site 153,02 once and liked it 4 thousand people.