A Python application that optimizes curation signals using TheGraph API and Supabase for data storage.
- Python 3.x
- pip (Python package installer)
- Access to TheGraph API
- Access to Supabase database
- Clone the repository:
git clone https://github.com/yourusername/curation_signal_optimizer.git
cd curation_signal_optimizer
- Install Python dependencies:
cd python_app
pip install -r requirements.txt
- Create a
.env
file in the root directory using the provided.env.example
as a template:
cp .env.example .env
- Update the
.env
file with your credentials:
THEGRAPH_API_KEY
: Your TheGraph API keySUPABASE_USERNAME
: Your Supabase usernameSUPABASE_PASSWORD
: Your Supabase password
- Start the Streamlit application:
cd python_app
streamlit run streamlit_curation.py
- The application will open in your default web browser.
cd python_app/tests
pip install -r requirements.txt
pytest
The application requires the following Supabase table structure:
Tracks query volume and fees for subgraphs on an hourly basis.
Column | Type | Description |
---|---|---|
subgraph_deployment_ipfs_hash | text | IPFS hash of the subgraph deployment |
total_query_fees | numeric | Total fees collected for queries |
query_count | integer | Number of queries in the time period |
end_epoch | timestamp | End time of the hourly period |
- Primary Key: Composite key of (subgraph_deployment_ipfs_hash, end_epoch)
- Index on end_epoch for time-based queries
api/
: API integrations for TheGraph and Supabasemodels/
: Core business logic and optimization algorithmsui/tabs/
: Streamlit UI componentsutils/
: Utility functions and configurationtests/
: Unit tests
- Query volume analysis
- Curation signal optimization
- Subgraph list management
- Summary statistics and reporting