Tutorials for building smart contracts using DeFi on Ethereum

This selection of tutorials will guide you on how to build smart contracts that interacts with the most popular decentralized finance (DeFi) protocols.

ERC20 Tokens

Understand the ERC20 token smart contract

Interact with ERC20 tokens with your Solidity smart contract: building a simple DEX/ICO

Reading the balance and making transfers of ERC20 tokens in JS

Reading Chainlink Oracles for currency prices using JavaScript.


Decentralized exchanges

Trading and Arbitrage on Ethereum DEXes: Get the rates for a token swap (part 1)

Trading and Arbitrage on Ethereum DEXes: Execute a trade on-chain using 1inch DEX aggregator (part 2)

Making flash loans to access Ether or ERC20 inside of your transactions


Testing

Fork the Ethereum mainnet to test your code with live protocols


Data

Using The Graph to query indexed Ethereum application data