Config File Reference
Top-Level Fields
kind
- Type:
"evm"
(string literal) - Purpose: Determines the chain architecture. Currently only
"evm"
is supported. - Example:
"evm"
indexerId
- Type:
string
- Purpose: A unique ID used to namespace Redis keys and sink outputs.
- Example:
"univ2-indexer"
flushMs
- Type:
number
(milliseconds) - Purpose: The time window size for Time-Weighted Balance (TWB) calculations.
- Constraints: Must be at least
3600000
(1 hour). - Example:
259200000
(3 days)
redisUrl
- Type:
string
(URL) - Purpose: Connection string for Redis.
- Must start with:
redis://
orrediss://
- Example:
"redis://localhost:6379"
Network Configuration (network
)
Field | Type | Description | Example |
---|---|---|---|
chainId | number | EVM chain ID (validated) | 43111 |
gatewayUrl | string | Subsquid archive gateway URL | "https://v2.archive.subsquid.io/network/hemi-mainnet" |
rpcUrl | string | RPC endpoint used for live calls | "https://rpc.hemi.network/rpc" |
finality | number | Optional confirmations before block is final | 75 (default if omitted) |
Block Range (range
)
Field | Type | Description | Example |
---|---|---|---|
fromBlock | number | Starting block (inclusive) | 1451314 |
toBlock | number | Ending block (inclusive, optional) | 2481775 |
Pricing Range (pricingRange
)
Block-based Configuration
Block-Based
{
"type": "block",
"fromBlock": 30000000
}
Timestamp-based Configuration
Timestamp-Based
{
"type": "timestamp",
"fromTimestamp": 1700000000000
}
Sink Configuration (sinkConfig
)
Supported Sink Types
📤 stdout
Console Output
{ "sinkType": "stdout", "json": false }
Prints output to console (JSON if json: true
).
📊 csv
CSV Export
{ "sinkType": "csv", "path": "output.csv" }
Writes rows to a CSV file.
🌐 absinthe
Multiple Sinks Example
Multiple Outputs
{
"sinks": [
{ "sinkType": "stdout" },
{ "sinkType": "csv", "path": "univ2swaps.csv" }
]
}
Adapter Configuration (adapterConfig
)
Field | Type | Description |
---|---|---|
adapterId | string | Adapter name (must be registered) |
params | object | Adapter-specific parameters |
Example Configuration
Adapter Setup
{
"adapterId": "uniswap-v2",
"params": {
"poolAddress": "0x0621bae969de9c153835680f158f481424c0720a",
"trackSwaps": true
}
}
Asset Feed Configuration (assetFeedConfig
)
Understanding Match Rules
Each rule contains:
match
: Which assets it applies to (by key or labels)config
: How to price those assets
Match Criteria
🔑 By Asset Key
Exact Match
"match": { "key": "0xAA40c0c7644e0b2B224509571e10ad20d9C4ef28" }
🏷️ By Labels
Label Matching
"match": {
"matchLabels": {
"protocol": "uniswap",
"version": "v2"
}
}
🔍 Advanced Expressions
Complex Matching
"match": {
"matchExpressions": [
{
"key": "chain",
"operator": "In",
"values": ["ethereum", "polygon"]
}
]
}
Asset Configuration
Field | Type | Description |
---|---|---|
assetType | "erc20" | "erc721" | "spl" | Asset type |
priceFeed | FeedSelector | How to price this asset |
Price Feed Types
Coingecko Feed
{
"kind": "coingecko",
"id": "bitcoin"
}
Complete Asset Configuration Example
Asset Feed Example
{
"match": {
"key": "0xad11a8BEb98bbf61dbb1aa0F6d6F2ECD87b35afA"
},
"config": {
"assetType": "erc20",
"priceFeed": {
"kind": "pegged",
"usdPegValue": 1
}
}
}