Make use of Flashloan from DY/DX to earn more from Compouond.
- Node Version Manager - node version manager
- Yarn - Alternative package manager to NPM
- Truffle - development framework
- Solidity - ethereum smart contract language
- Ganache - local blockchain development
- Web3 - library interact with ethereum nodes
- JavaScript - logic front end and testing smart contracts
- Infura - connection to ethereum networks
- Flashloan - Flashloans allow you to borrow lots of funds for a very small fee without need for collateral do anything else with funds as long as repayments happens in same transaction.
- Metamask Wallet - You need to install Metamask Wallet
- ERC20 - ERC20 Token standards
- Compound Protocol - supply or borrow tokens and earn cTokens
- Flashloan Providers
- DY/DX - Decentralized Exchange offering flashloans with cheap feess; that is used on this example code
Alternative Flashloan Providers that can be used or to investigate
- UniswapV2 Flashswaps - access temporary funds
- Example Uniswap FlashSwap can be found here
- Aave Flashloan - uncollaterized loan that must be returned in same transaction
- Binance Smart Chain - Pancake Swap - PancakeSwap as a fork of Uniswap deployed on Binance Smart Chain has the same functionality for Flashloan using e.g ..pancakeCall vs UniswapV2Cal when considering version2 Uniswap
- Kollateral - a liquidity aggregator
- UniLend - UniLend Flashloans
- UniswapV2 Flashswaps - access temporary funds
- DY/DX - Decentralized Exchange offering flashloans with cheap feess; that is used on this example code
Alternative Flashloan Providers that can be used or to investigate
- Augement your profits with trading bot - TradingBot Masterclass
- Uses of Flashloans
- Arbitrage - use the vast funds to make profits from price discrepencies e.g on Exchange See SimpleArb.sol
- Leverage - increase exposure e.g earn more with Yield Farmin on protocols like Compound. See FlashloanLeveragedYieldFarm project
- FlashloanLeveragedYieldFarm
- flats
- migrations
- node_modules
- src
- abis
- contracts
- test
- flatten.sh
- truffle.js
- package.json
- .gitignore
- README.md
- yarn.lock
- You will need nvm if not laready installed; so you can use specific version node version 14 and above
$ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash
Restart your terminal
- Install node v12.0.0 or versions above e.g node v14.16.0
$ nvm install 14.16.0
$ nvm alias default 14.16.0
$ nvm use default
- Install truffle globally if not installed. Check if installed using
truffle version
If not installed install with below
$ npm install -g truffle
- Ignore if either installed already! If opting to use ganache-cli vs Ganache GUI, install ganache-cli globally. Note that ganache-cli rus on port 8545 and ganache-gui runs on port 7545 as placced in truffle-config.js. Check if ganache-cli installed first with
ganache --version
If not installed install with below
$ npm install -g ganache
$ ganache
Run ganache-cli in different terminal and keep running when compiling, testing, migrating, running app, etc.
- Enter project directory and install dependancies
$ cd flashloan_masterclass
$ npm install
- Run Ganache Fork
$ ganache -p 7545 -f
- Run the test that will show example flashloan and leveraged yield farming compound and repay Open a new terminal and run
$ truffle test
If you have problems with test e.g archived state, rpc etc, you may need to restart your ganache running fork To reset and run again, you will need to restart the terminal with ganache and rerun the fork