This repository is designed to manage and automate SQL queries for AVAIL token analysis on Uniswap V3 using Dune Analytics. It provides comprehensive trading analytics including volume metrics, holder analysis, and automated data management tools.
avail-dune-analytics/
├── .env # Environment variables (e.g., DUNE_API_KEY)
├── queries.yml # Query metadata (IDs and file paths)
├── queries/ # SQL queries
├── scripts/ # Python automation scripts
├── uploads/ # CSV files for Dune table uploads
└── requirements.txt # Python dependencies
-
Clone the Repository
git clone https://github.com/AlwaysUbaid/avail-dune-analytics.git cd avail-dune-analytics -
Install Dependencies
pip install -r requirements.txt
-
Add Your Dune API Key
- Create a
.envfile in the root directory:DUNE_API_KEY=your_dune_api_key
- Create a
-
Prepare Your Queries
- Add your SQL files in the
queries/directory. - Update
queries.ymlwith the corresponding query IDs and file paths.
- Add your SQL files in the
-
Pull Queries from Dune
- Download queries from Dune to your local
queries/folder:python scripts/pull_from_dune.py
- Download queries from Dune to your local
-
Preview Query Results
- Preview the first 20 rows of a query:
python scripts/preview_query.py <query_id>
- Preview the first 20 rows of a query:
-
Push Queries to Dune
- Sync local queries to Dune:
python scripts/push_to_dune.py
- Sync local queries to Dune:
-
Upload CSV Files
- Add CSV files to the
uploads/folder and run:python scripts/upload_to_dune.py
- Add CSV files to the
- Query IDs: Ensure your query IDs in
queries.ymlmatch those on Dune. - CSV Uploads: Only
.csvfiles in theuploads/folder will be processed.
Feel free to fork this repo and contribute improvements via pull requests.
This project is open-source and licensed under the MIT License.
You’re ready to manage and visualize your data with Dune Analytics! 🎉