A Graph Protocol subgraph for indexing DTF portfolios, governance systems, and vote-locked tokens across multiple blockchain networks.
The DTF Index Subgraph tracks and indexes:
- DTF portfolio deployments and configurations
- Portfolio rebalancing events and auction mechanisms
- Governance proposals, voting, and timelock operations
- Vote-locked token (stDAO) delegation and unlocking
- ERC20 token transfers and holder analytics
- Ethereum Mainnet (
mainnet
) - Base (
base
) - Binance Smart Chain (
bsc
)
This subgraph uses a Mustache-based template system to generate network-specific configurations:
- Template File:
subgraph.yaml.mustache
contains the base configuration with placeholders - Network Configuration:
networks.json
stores deployment addresses and block numbers for each network - Parser Script:
scripts/parse-template.js
generates the finalsubgraph.yaml
The template parsing process:
- Takes a network argument (e.g., "mainnet", "base", "bsc")
- Loads network-specific addresses and block numbers from
networks.json
- Handles multiple protocol versions (1.0.0, 2.0.0, 4.0.0) with different deployer contracts
- Generates
subgraph.yaml
with all network-specific values filled in
# Generate configuration for Ethereum Mainnet
npm run parse:mainnet
# Generate configuration for Base
npm run parse:base
# Generate configuration for BSC
npm run parse:bsc
# Then build the subgraph
npm run codegen
npm run build
- DTF: Represents an index DTF with configuration, fees, and governance settings
- Rebalance/Auction: Tracks index rebalancing events and auction bids
- Token: ERC20 tokens with transfer history and holder analytics
- Governance: Proposals, votes, delegates, and timelock operations
- VoteLockedToken: stDAO tokens with delegation and vote-locking mechanisms
The subgraph supports multiple protocol versions:
- Version 1.0.0: Initial protocol deployment
- Version 2.0.0: Enhanced features and updated contracts
- Version 4.0.0: Latest version with advanced functionality
Each version has its own deployer contracts (FolioDeployer and GovernanceDeployer) at different addresses across networks.