This project is a Streamlit-based web application that calculates and visualizes matching results for Quadratic Funding (QF) rounds. It compares standard Quadratic Funding with Connection-Oriented Cluster Matching (COCM) to provide insights into fund distribution.
- Load and process round data from various blockchain networks
- Apply Sybil defense mechanisms using Passport scores
- Calculate and compare matching results using QF and COCM algorithms
- Visualize crowdfunding statistics and donation distributions
- Generate downloadable matching distributions and round summaries
- Filter out specific wallets or projects from calculations
-
Clone the repository:
git clone [repository-url] cd [repository-name] -
Install the required packages:
pip install -r requirements.txt
This is the lightweight, compute-only workflow intended for admins to upload a v6 donation export CSV, run QF or COCM, see visualizations, and download results as CSV for re-upload to v6.
Run:
streamlit run V6_CSV_Calculator.py
How it works:
- Upload: your v6 QF Donation Export CSV
- Map columns: pick which CSV columns correspond to donor address, project name/id, amount, etc.
- Set round params: matching pool size, cap %, minimum donation threshold, and engine (QF/COCM)
- Compute + visualize: matching distributions and top projects
- Download:
v6_matching_results.csv
Notes:
- No writes back to v6: this tool is read-only + compute-only.
- No external dependencies required: it does not call indexer APIs, databases, or price feeds. If your donation amounts are not USD, you can provide a token price to convert to USD for calculations/export.
Run:
streamlit run Home.py
-
Access the app through your web browser, typically at
http://localhost:8501 -
(Optional) Provide the
round_idandchain_idas URL parameters:http://localhost:8501/?round_id=[ROUND_ID]&chain_id=[CHAIN_ID]
- The app uses environment variables for database connections and API keys. Ensure these are set up in a
secrets.tomlfile or your environment.
Home.py: Main Streamlit application filefundingutils.py: Contains functions for QF calculationsutils.py: Utility functions for data loading and processingrequirements.txt: List of Python package dependenciesqueries/: SQL query files for data retrieval
- streamlit
- pandas
- numpy
- plotly
- psycopg2-binary
This project is configured for deployment on Fly.io. Here are the steps to deploy:
-
Install the Fly CLI: Follow the instructions at https://fly.io/docs/hands-on/install-flyctl/
-
Login to Fly:
fly auth login -
Navigate to your project directory and initialize the Fly app:
fly launch -
Deploy the app:
fly deploy -
Once deployed, you can access your app at
https://qf-calculator.fly.dev
Remember to set up your environment variables and secrets in the Fly.io dashboard or using the Fly CLI before deployment.
For more detailed information on deploying Streamlit apps on Fly.io, refer to their documentation: https://fly.io/docs/app-guides/streamlit/