A SQL-like language for querying EVM chains with minimal boilerplate.
EQL provides a declarative way to query Ethereum Virtual Machine (EVM) chains. It enables developers and researchers to fetch blockchain data using familiar SQL-like syntax, eliminating the need for complex boilerplate code.
# Fetch Vitalik's balance across multiple chains
GET balance, balance FROM account vitalik.eth ON eth, base, arbitrum
Querying EVM chain data traditionally requires:
- Writing extensive boilerplate code
- Managing multiple RPC provider connections
- Handling rate limits and retries
- Dealing with different response formats
EQL abstracts away the complexity by:
- Providing a simple, SQL-like syntax
- Managing RPC connections under the hood
- Handling data formatting automatically
- Supporting cross-chain queries in a single line
EQL uses a two-phase interpreter to transform your queries into RPC calls:
-
Frontend Phase
- Tokenizes and parses your query
- Validates syntax and semantics
- Builds an Abstract Syntax Tree (AST)
-
Backend Phase
- Maps AST to appropriate JSON-RPC methods
- Manages concurrent RPC requests
- Formats responses into consistent structures
For example, this query:
GET balance, nonce FROM account vitalik.eth ON eth
Gets transformed into:
- ENS resolution for "vitalik.eth"
eth_getBalance
RPC calleth_getTransactionCount
RPC call- Results formatting into a structured response
# Install EQL version manager
curl https://raw.githubusercontent.com/iankressin/eql/main/eqlup/install.sh | sh
# Install latest EQL version
eqlup
# Run a query file
eql run query.eql
# Interactive REPL
eql repl
# Cargo.toml
[dependencies]
eql_core = "0.1"
use eql_core::interpreter::Interpreter;
async fn main() {
let query = "GET balance FROM account vitalik.eth ON eth";
let result = Interpreter::run_program(query).await?;
}
- Accounts
- Blocks
- Transactions
- Logs
- GET: Query entity data
- Filtering: WHERE clauses for precise queries
- Cross-chain: Query multiple chains in one go
- Data Export: CSV, JSON, Parquet formats
For detailed documentation on queries and installation:
See our detailed Roadmap for upcoming features.
We welcome contributions! See our Contributing Guide for details.
MIT License - see LICENSE for details