Tutorials
Examples of how to use web3.py and Web-Ethereum-Defi library.
Examples include
Reading live trades of different DEXes
Performing ERC-20 token transfers
Making swaps on Uniswap, Pancakeswap, others
Creating your own price feeds for ERC-20 tokens
Data research with Jupyter Notebooks and Pandas
Integrating DeFi protocols for backend and data research pipeline
For any questions please join to Discord chat.
Prerequisites
Command line: You need to know UNIX command line basics, like how to use environment variables. Microsoft Windows is fine, but we do not test or write any instructions for it, so please consult your local Windows expert for any Windows specific questions.
Python package management: Make sure you know how to install packages (pip, poetry) and use Python virtual environments. See Github README for details.
Jupyter notebook: For data science examples you need to know the basics of Jupyter notebooks
Tutorials and examples
- ERC-20 token transfer with web3.py
- Swap tokens on Uniswap v3
- Swap tokens on Uniswap v2 compatible DEXes
- Chainlink price feed reading
- Chainlink reading blockchain native token price
- Uniswap v3 price (minimal)
- Uniswap v3 price impact estimation
- Uniswap v2 live price with web3.py
- Uniswap v3 liquidity analysis
- Uniswap v3 OHCLV candle price analysis
- Uniswap v3 historical price estimation
- Uniswap v2 historical swaps and pairs event reading
- Uniswap v2 reading swaps real-time (minimal)
- Uniswap v2 reading real-time swaps and new pairs
- PancakeSwap follow live trades programmatically
- Aave V3 Interest Analysis
- Aave V3 liquidations
- GMX: swap tokens
- GMX Price Analysis Using
eth_defi’s nativeGMXIntegration - Lagoon and CowSwap integration
- ERC-4626: current APY of a vault
- ERC-4626: historical APY of a vault
- ERC-4626: scanning vault data
- ERC-4626: vaults across all chains
- ERC-4626: examine vault historical performance
- ERC-4626: best performing stablecoin vaults
- ERC-4626: vault report for blog posts
- ERC-4626: all vaults on Arbitrum
- ERC-4626: all vaults on Mantle
- ERC-4626: analyse performance of individual vaults
- ERC-4626: analyse performance of individual vaults
- Fija vault analysis
- ERC-4626 deposit and redeem
- Vault historical data reading
- Setting up
- ERC-4626: list all vaults
- Hyperliquid Vault PnL Analysis
- Enzyme reading all vaults on a blockchain
- Enzyme vault deployment
- JSON-RPC node integrity verifier for EVM blockchains
- Multicall3: Doing fast chain data reading with Web3.py
- Solidity event high-speed multithread reading
- MEV protection and multiple JSON-RPCs configuration
For more examples, browse tests folder on Github. You can also search function names in the repository using Github search.