# ๐Ÿช™ coinexplorer ### The self-hosted, zero-API-key explorer for stablecoins & major crypto **Live at [www.coinexplorer.io](https://www.coinexplorer.io)** [![Live](https://img.shields.io/website?url=https%3A%2F%2Fwww.coinexplorer.io&label=coinexplorer.io&up_message=live&up_color=1baf7a&down_message=down)](https://www.coinexplorer.io) [![BTC](https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fwww.coinexplorer.io%2Fv1%2Fprices&query=%24.BTC.usd&label=BTC&prefix=%24&color=f7931a)](https://www.coinexplorer.io/v1/prices) [![ETH](https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fwww.coinexplorer.io%2Fv1%2Fprices&query=%24.ETH.usd&label=ETH&prefix=%24&color=627eea)](https://www.coinexplorer.io/v1/prices) [![Chains](https://img.shields.io/badge/chains-24_live_%2B_13_configured-2a78d6)](https://www.coinexplorer.io/status.html) [![Assets](https://img.shields.io/badge/assets-34_verified_on--chain-2a78d6)](https://www.coinexplorer.io/v1/tokens) [![API keys](https://img.shields.io/badge/API_keys-0-1baf7a)](#-free-rpc-philosophy) [![Python](https://img.shields.io/badge/python-3.12%2B-3776ab?logo=python&logoColor=white)](https://www.python.org) [![FastAPI](https://img.shields.io/badge/FastAPI-REST_%2B_WebSocket-009688?logo=fastapi&logoColor=white)](https://www.coinexplorer.io/api.html) [![Tests](https://img.shields.io/badge/tests-4_suites_ยท_19_checks-1baf7a)](tests/) [![License](https://img.shields.io/badge/license-MIT-blue)](LICENSE) *The BTC/ETH badges above are rendered from this platform's own live API.* coinexplorer market overview
--- ## What is this? A **complete blockchain explorer platform built from scratch** โ€” indexer, API, and dashboard โ€” that reads **raw JSON-RPC/REST from free public endpoints only**. No Etherscan keys, no Infura, no paid data vendors. Point it at the internet and it indexes: - ๐Ÿ’ต **11 stablecoins** โ€” USDT, USDC, DAI/USDS, USDe, FDUSD, PYUSD, RLUSD, USDG, TUSD, USDB โ€” across every chain they live on - ๐Ÿš€ **Major crypto** โ€” WETH, WBTC, LINK, UNI, AAVE, SHIB, PEPE, ARB, OP, BONK, JUP, WIF and more, valued at live prices - ๐Ÿ‹ **Native-coin whales** โ€” large BTC, ETH, BNB, AVAX, POL, TRX and SOL transfers, straight from full blocks **Four chain families, one canonical event:** | Family | Chains | How transfers are read | |---|---|---| | **EVM** | Ethereum, Base, Arbitrum, Optimism, Polygon, BSC, Avalanche, Celo, Kaia, Ink, Scroll, Linea, Mantle, Gnosis, ZKsync, Blast, Unichain, World Chain, Sonic, Sei, HyperEVM | `eth_getLogs` + hand-rolled ABI decoding | | **Tron** | Tron | block tx-infos + Base58Check codec written from scratch | | **Solana** | Solana | pre/post token-balance diffs (covers Token-2022 & CPIs) | | **Bitcoin** | Bitcoin | esplora REST, UTXO whale outputs | Everything lands in one schema: `{chain, block, tx_hash, timestamp, token, from, to, amount, decimals}` โ€” so the API, WebSocket stream, and dashboard are chain-agnostic. ## ๐Ÿ“Š The numbers | Metric | Value | |---|---| | Chains indexing live | **24** (13 more configured & verified, awaiting adapters) | | Verified asset deployments | **94** โ€” every EVM address checked on-chain (`symbol()` + `decimals()`) before indexing | | Transfers indexed (production instance) | **20M+ and growing** | | Hot API endpoints | **< 200 ms** at any index size (precomputed aggregates) | | Whale detection floor | $100K, incremental โ€” a $72M BTC move was caught minutes after boot | | Price refresh | 40 symbols / 5 min, one keyless CoinGecko call | | Paid API keys required | **0** | ## โœจ The platform
API documentation
- **8-page responsive app** (desktop โ†’ smartphone): market overview, per-token analytics, per-chain explorer, transfer browser, whale watch, issuance flows, address & tx views, infra status - **Real charts** โ€” hand-rolled SVG line charts with crosshair tooltips, diverging issuance columns, magnitude bars; colorblind-validated palette, native dark mode - **Crypto icons everywhere** โ€” real logos with brand-colored generated fallbacks (no broken images, no tracking) - **Live WebSocket feed** โ€” `wss://โ€ฆ/v1/stream/transfers` pushes every transfer above your USD floor - **[Interactive API docs](https://www.coinexplorer.io/api.html)** โ€” 22 endpoints with in-page *Try it* consoles that execute against the live instance, plus OpenAPI at `/docs` - **Signals stablecoin holders actually want**: net issuance (mints โˆ’ burns) per token, on-chain supply history per chain, native vs bridged tagging, discontinued-asset flags, whale rankings ## ๐Ÿ— Architecture ```mermaid flowchart LR subgraph rpcs [Free public RPCs โ€” no keys] EVM[21 EVM chains] TRON[TronGrid] SOL[Solana] BTC[esplora REST] end subgraph indexer [Indexer โ€” one watchdogged thread per chain] POOL[RpcPool / RestPool
token bucket ยท health EMA ยท failover] AD[4 family adapters
canonical event out] WORK[Workers: prices ยท supply
whale extraction ยท rolling aggregates] end DB[(SQLite WAL / PostgreSQL
one codebase, both engines)] subgraph api [FastAPI] REST[REST /v1] WS[WebSocket stream] MET[Prometheus /metrics] UI[dashboard + API docs] end rpcs --> POOL --> AD --> DB POOL --> WORK --> DB DB --> REST & WS & MET & UI ``` ### Built for hostile (free) infrastructure - **Per-endpoint token buckets** โ€” respect documented limits (toncenter 1 rps, Solana ~10 rps/IPโ€ฆ) *before* getting 429'd - **Health-scored failover** โ€” success-rate EMA + exponential cooldowns; rate limits disguised as JSON-RPC errors are detected and routed around; *"query too big"* errors trigger adaptive range halving instead - **Reorg safety** โ€” parent-hash chain-linking on every cursor advance + chain-specific confirmation depths, with automatic rollback - **Two-cursor design** โ€” head-tailing always has priority; history grows *backwards* one slice per cycle (`EXPLORER_BACKFILL_DAYS`) - **Watchdog supervisor** โ€” any dead worker thread is rebuilt within 30 s - **Scale-proof reads** โ€” whale extraction and volume/series aggregates are maintained incrementally by background workers, so no UI query ever rescans the transfers table (26 s โ†’ 2 ms, measured) ## ๐Ÿš€ Quickstart ```bash git clone https://github.com/spboucher-ai/coinexplorer && cd coinexplorer # Docker โ€” one command cp .env.example .env && docker compose up -d --build open http://localhost:8080 # Or bare metal python3 -m venv .venv && .venv/bin/pip install -r requirements.txt .venv/bin/python scripts/verify_tokens.py # never index an unverified address .venv/bin/python run_indexer.py # Ctrl-C safe, resumes from cursors .venv/bin/uvicorn api.main:app --port 8080 ``` ## ๐Ÿ”Œ API in 30 seconds Full interactive reference: **[coinexplorer.io/api.html](https://www.coinexplorer.io/api.html)** ```bash # largest transfers of the last 24h, any asset, any chain curl "https://www.coinexplorer.io/v1/stablecoins/whales?window=24h&min_usd=10000000" # USDC net issuance (mints โˆ’ burns), bucketed curl "https://www.coinexplorer.io/v1/stablecoins/flows?token=USDC&window=7d" # resolve anything: tx hash, address, symbol, chain curl "https://www.coinexplorer.io/v1/search?q=TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t" # live feed websocat "wss://www.coinexplorer.io/v1/stream/transfers?min_usd=100000" ``` ## โž• Add a chain in < 30 lines (EVM: config only) ```yaml # config/chains.yaml mynewchain: family: evm chain_id: 12345 block_time: 2 confirmations: 10 max_range: 150 start_offset: 1800 rpcs: [https://rpc.mynewchain.org] ``` Add its tokens to `config/tokens.yaml`, run `scripts/verify_tokens.py` (it refuses wrong addresses and chain-ids), restart. Non-EVM families are ~150-line adapters โ€” see `indexer/adapters/tron.py` as the template. **13 more chains** (XRPL, Stellar, Noble, TON, Aptos, Sui, Algorand, Near, Tezos, Hedera, Starknet, Polkadot, EOS) are already configured with verified identifiers, waiting for their adapters. ## ๐Ÿงช Tests ```bash for t in tests/test_*.py; do .venv/bin/python "$t"; done ``` Four suites, 19 checks: token-bucket pacing, failover classification, getLogs range-halving contiguity, reorg rollback, Base58Check vectors, TRC-20/SPL decoding, Bitcoin UTXO whale semantics, EVM native extraction, price upserts. ## โš–๏ธ Data honesty Supply figures use on-chain `totalSupply()` (bridged wrappers double-count their locked collateral โ€” the `native` flag lets you de-duplicate). Solana multi-sender transfers keep exact amounts with `from: null`. Volume uses face value ร— live price over the indexed window only. Aggregates use float casts โ€” dashboards, not accounting. **Nothing here is financial advice.** ---
## Author **Simon-Pierre Boucher** ๐Ÿ“ง [contact@spboucher.ai](mailto:contact@spboucher.ai) Built from scratch โ€” every decoder, every adapter, every chart. ๐ŸŒ **[www.coinexplorer.io](https://www.coinexplorer.io)** [MIT License](LICENSE)