A template for managing Dune Analytics queries with version control and automated deployment. All data stays in Dune - no external warehouse needed!
# 1. Set up environment
cp .env.example .env # Add your DUNE_API_KEY
# 2. Add your query ID to queries.yml
query_ids:
- 5526654 # Your Vesu balances query
# 3. Pull existing query to sync locally
python3 scripts/pull_from_dune.py
# 4. Make changes and deploy
vim queries/vesu_daily_user_balances___5526654.sql
python3 scripts/deploy_and_run.py
-
All Data Stays in Dune
- Queries run in Dune's environment
- Results are cached by Dune
- No external warehouse needed
-
Version Control Benefits
- Track query changes
- Collaborate with team
- Roll back if needed
-
Automated Deployment
- Push changes to Dune
- Trigger refreshes
- No manual copy/paste
Command | Purpose |
---|---|
python3 scripts/deploy_and_run.py |
Update query in Dune + run |
python3 scripts/run_query_simple.py <id> |
Just run the query |
queries/
└── vesu_daily_user_balances___5526654.sql # Your query
- Queries run in Dune's environment
- Uses Dune's native caching
- No additional materialization costs
The repository includes automated workflows that:
- Push query changes to Dune when you commit
- Run queries on schedule if needed
- Notify on failures
- Add your queries to
queries.yml
- Use git for version control
- Let GitHub Actions handle deployment
Need help? Check the docs or open an issue!