A command-line tool that extracts and displays Total Value Locked (TVL) data from multiple DeFi protocols.
- Track TVL across multiple DeFi protocols
- Filter by specific pools, token pairs, or chains
- Support for multiple data providers
- Output in different formats (table, JSON, CSV)
- Extensible architecture for adding new protocols and providers
- Python 3.7+
- pipenv
- Clone the repository:
git clone harmony-one/defi-protocol-tvl-tracker
cd defi-protocol-tvl-tracker
- Install dependencies using pipenv:
pipenv install
Activate the virtual environment:
pipenv shell
Then run the tracker directly:
python tracker.py [options]
View supported protocols:
python tracker.py --supported
Get TVL for a specific protocol:
python tracker.py --protocol silo
Filter by chain:
python tracker.py --protocol silo --chain sonic
Filter by token pair:
python tracker.py --protocol silo --pool S-USDC.e
Output as a table (default):
python tracker.py --protocol silo --output table
Output as JSON:
python tracker.py --protocol silo --output json
Disable caching to get fresh data:
python tracker.py --protocol silo --no-cache
defi-tvl-tracker/
├── README.md
├── Pipfile
├── tracker.py # Main entry point
├── src/
│ ├── __init__.py # Package definition
│ ├── cli.py # Command-line interface
│ ├── config.py # Configuration settings
│ ├── providers/ # Data providers
│ │ ├── __init__.py # Provider registry
│ │ ├── defillama.py # DefiLlama API provider
│ │ └── ... # Other providers implementations
│ ├── protocols/ # Protocol implementations
│ │ ├── __init__.py # Protocol registry
│ │ ├── protocol_base.py # Base protocol class
│ │ ├── silo.py # Silo Finance protocol
│ │ ├── aave.py # Aave protocol
│ │ └── ... # Other protocol implementations
│ └── utils/
│ ├── __init__.py
│ └── formatter.py # Output formatting utilities
To add a new protocol:
- Create a new file in
src/protocols/
(e.g.,new_protocol.py
) - Implement a class inheriting from
ProtocolBase
- Add the protocol configuration to
config.py
The protocol will be automatically discovered and registered.
To add a new data provider:
- Create a new file in
src/providers/
(e.g.,new_provider.py
) - Implement the provider interface
- Register the provider in
src/providers/__init__.py
This project is licensed under the MIT License - see the LICENSE file for details.