Skip to content

hyena-labs/evm-kit

Repository files navigation

evm-kit · hyena

Rust CLI toolkit for indexing, querying, and monitoring EVM chains — Ethereum and Base, out of the box.

Rust 1.85+ License: MIT CI

Index blocks into SQLite, query logs by address/topic/range, classify addresses with on-chain heuristics, and run live watches with stdout or webhook delivery — all from a single binary (hyena or evm-kit).

evm-kit terminal demo


Features

Command group What it does
index sync Backfill blocks, transactions, and logs into SQLite
index logs Query indexed logs by address, topic, and block range
index status Show indexing cursor and storage stats
analyze address Build an on-chain activity profile for any address
analyze classify Heuristic classification — whale, DEX bot, high-frequency, etc.
analyze pnl FIFO P&L estimate from indexed ERC-20 swap activity
watch address Alert on large inflows / outflows from an address
watch contract Alert on any transaction to/from a contract
watch event Alert on specific log topics
watch run Run all watchers defined in hyena.toml

Quick Start

Requirements: Rust 1.85+, a JSON-RPC endpoint for Ethereum and/or Base.

# 1. Clone and configure
git clone https://github.com/hyena-labs/evm-kit.git && cd evm-kit
cp hyena.toml.example hyena.toml
# Edit hyena.toml — fill in your RPC URLs

# 2. Build
cargo build -p hyena-cli --release

# 3. Verify
cargo test

hyena.toml is git-ignored; your RPC keys and webhook URLs stay local.

No config file? Pass --rpc-url directly for ad-hoc runs:

hyena --chain ethereum --rpc-url https://your-rpc.example \
  analyze classify \
  --address 0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045

Usage Examples

All examples use 0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045 (vitalik.eth).

Index blocks

hyena index sync \
  --chain ethereum \
  --from-block 21950000 \
  --to-block 21950100

Add --follow to keep syncing new blocks as they arrive (Ctrl-C to stop):

hyena index sync --chain ethereum --follow

Query logs

hyena index logs \
  --chain ethereum \
  --address 0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045 \
  --from-block 21950000 \
  --to-block 21950100 \
  --limit 20

Filter by event topic:

hyena index logs \
  --chain ethereum \
  --topic0 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef \
  --from-block 21950000 --to-block 21950100

Classify an address

hyena analyze classify \
  --chain ethereum \
  --address 0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045

Output fields: address, chain, labels (whale / high-frequency / dex-bot-candidate), reasons, transaction_count, unique_counterparties, dex_swap_count.

P&L estimate

hyena analyze pnl \
  --chain ethereum \
  --address 0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045

Coverage note: analyze pnl is an estimate, not an accounting engine. It infers trades from ERC-20 Transfer logs and uses FIFO cost-basis matching. Native sell proceeds are only captured when internal traces are indexed. Unsupported and partial transactions are counted and surfaced explicitly.

Live watch (ad-hoc)

# Alert when address receives ≥ 1 ETH — run once against indexed blocks
hyena watch address \
  --chain ethereum \
  --address 0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045 \
  --min-value-wei 1000000000000000000

# Add --follow to poll for new blocks continuously (Ctrl-C to stop)
hyena watch address \
  --chain ethereum \
  --address 0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045 \
  --min-value-wei 1000000000000000000 \
  --follow

Persistent watchers from config

# Run all watchers defined in hyena.toml (once)
hyena watch run

# Run a specific watcher and keep following new blocks
hyena watch run --id base-whale --follow

JSON output

Append --format json to any command for machine-readable output:

hyena analyze classify \
  --chain ethereum \
  --address 0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045 \
  --format json

Configuration (hyena.toml)

[storage]
sqlite_path = "./data/hyena.sqlite"

[chains.ethereum]
rpc_url = "https://eth-mainnet.example"

[chains.base]
rpc_url = "https://base-mainnet.example"

[[watchers]]
id            = "base-whale"
chain         = "base"
kind          = "address"
address       = "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"
min_value_wei = "1000000000000000000"

  [[watchers.sinks]]
  kind = "stdout"

  [[watchers.sinks]]
  kind = "webhook"
  url  = "https://example.com/alerts"

See hyena.toml.example for the full reference including classification thresholds and chain confirmations.


Crates

Crate Role
hyena-cli CLI entrypoint — hyena and evm-kit binaries
evm-core Shared types, config, RPC access, SQLite storage, runtime
index Block / tx / log indexing
analyze Address profiling, classification, P&L
watch Live monitoring, alert dispatch

Documentation

Doc Contents
docs/classify-rules.md Classification rule logic, thresholds, and how to add custom rules
docs/webhook-payload.md Full AlertEvent JSON schema and sink configuration
hyena.toml.example Annotated config reference
CONTRIBUTING.md Development guide, PR conventions, how to add rules and commands

Development

cargo fmt --all --check
cargo clippy --all-targets -- -D warnings
cargo test

All crates are covered by unit and integration tests; cargo test is the source of truth.


License

MIT

About

Rust CLI for indexing EVM blocks into SQLite, querying logs, classifying addresses, and running live on-chain watches. Supports Ethereum and Base.

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages