EVM-focused UDFs for ClickHouse – Accelerate Ethereum & EVM-compatible blockchain analytics
clickhouse-evm is a collection of high-performance user-defined functions (UDFs) that extend ClickHouse with capabilities tailored for Ethereum Virtual Machine (EVM) data processing.
Whether you're building blockchain explorers, indexing on-chain data, or running deep analytics on Ethereum or other EVM-compatible chains, this project brings native decoding, parsing, and querying support into your ClickHouse workflows.
- 🧠 Decode EVM calldata, logs and transactions directly within ClickHouse
- 🔄 Keccak-256 hashing UDF for topic and selector lookups (and many more)
- 🧱 Utility functions for working with EVM
0x-prefixedhex encoding - Utility functions for working with EVM
ABIdocuments, event and function signatures - ⚡ Fast, optimized RPC calls to EVM-compatible nodes directly from ClickHouse queries
- 🚀 Speeds up on-chain data analysis by reducing external parsing overhead
- Quickly extract function parameters from calldata in a ClickHouse query
- Filter and parse smart contract events by ABI signature
- Analyze token transfers, contract interactions, or DeFi protocol data at scale
- Query live on-chain data through efficient RPC calls from within ClickHouse
- Integrate with your existing ClickHouse-based blockchain indexing pipeline
The output of the build process is distributed as a compressed archive called a bundle. This bundle includes everything needed to deploy and use the UDFs in ClickHouse.
Each bundle contains:
- 🧩 Standalone binary implementing the native UDFs (compiled with ClickHouse compatibility)
- ⚙️ ClickHouse configuration files (
.xml) to register each native UDF - 📝 SQL files for SQL-based UDFs (used for lightweight functions where SQL outperforms compiled code)
make bundle # Build for native execution
GOOS=linux make bundle # Cross-compile for use in Docker (Linux target)This will:
- Generate the bundle directory at
tmp/bundle/ - Create a compressed archive at
tmp/bundle.tar.gz
The internal file structure of the bundle reflects the default layout of a basic ClickHouse installation.
As a result, decompressing the archive at the root of a ClickHouse server filesystem should "just work" with no additional path configuration.
clickhouse local \
--log-level=debug \
--path tmp/clickhouse \
-- \
--user_scripts_path="./tmp/bundle/var/lib/clickhouse/user_scripts" \
--user_defined_executable_functions_config="./tmp/bundle/etc/clickhouse-server/*_function.*ml" \
--user_defined_path="./tmp/bundle/var/lib/clickhouse/user_defined"This runs ClickHouse in local mode using the provided config and a temporary storage path.
docker compose up -dThis launches a ClickHouse server inside a Docker container using the configuration and UDFs from the bundle.
🐳 Run in production mode with clickhouse-server in Docker (bundle fetched from latest release on GitHub)
docker compose -f docker-compose.prod.yaml up -d