How chencore/accumulation_radar works
1. Project purpose
- This is a Python command-line radar for Binance perpetual contracts.
- It detects “accumulation” setups by combining range-bound price behavior, open interest anomalies, funding rate behavior, market cap, and trend heat, then ranks candidates and alerts via Telegram.
2. Top-level execution modes
- accumulation_radar.__main__ is the orchestration entrypoint.
- It supports three workflows: pool (daily universe scan), oi (hourly opportunity scan), and full (both).
- The repo is therefore organized as a batch analytics pipeline, not a long-running service.
3. Data acquisition layer
- api.py is the Binance API wrapper and enforces thread-safe rate limiting.
- market.py aggregates market-facing data: K-lines, 24h stats, funding rates, open interest history, circulating-market-cap estimates, and CoinGecko trending data.
- External inputs are primarily Binance futures/spot public APIs plus CoinGecko trending; no API key is required.
4. Universe selection / accumulation pool
- scanner.py contains the first-stage screen that finds range-bound “accumulation” coins.
- The README describes this as scanning all USDT perpetuals, applying sideways-range detection over a long lookback, and writing results into a candidate pool.
- This pool is the boundary between broad market discovery and targeted signal ranking.
5. Second-stage signal scanning
- The hourly oi workflow uses the pool plus Binance top markets to look for OI anomalies.
- The scan focuses on how OI changes relative to price, because “OI up + price flat” is treated as the strongest accumulation clue.
- This stage narrows the universe from “all contracts” to “interesting contracts only.”
6. Scoring engine
- strategy.py implements the repo’s main analytical logic.
- It produces three ranking views:
- a short-term squeeze-following strategy,
- a balanced composite score,
- a mid/long-term accumulation score.
- The scoring is continuous rather than threshold-based, so rank ordering changes smoothly instead of jumping at fixed cutoffs.
7. Signal composition and cross-effects
- The scoring model is not just additive; it includes interaction bonuses such as negative funding plus rising OI, or hot trending names overlapping with the accumulation pool.
- OI direction matters explicitly: rising OI is treated as stronger than falling OI.
- The architecture is therefore “feature extraction → weighted scoring → cross-signal enhancement.”
8. Persistence boundary
- db.py is the storage layer, using SQLite.
- It likely persists the pool and any scan state or cached results so the daily pool and hourly OI runs can operate independently.
- This is the only durable local state in the system; the rest is computed from live APIs each run.
9. Reporting and output
- report.py turns ranked candidates into a human-readable report.
- The output is structured into sections like hotness, squeeze-following, composite ranking, accumulation ranking, and “worth watching” notes.
- Reports can go to stdout or be formatted for Telegram delivery.
10. Notification boundary
- notify.py handles Telegram push notifications when TG_BOT_TOKEN and TG_CHAT_ID are configured.
- If not configured, the system still functions and prints reports locally.
- This keeps alert delivery decoupled from signal generation.
11. Configuration and runtime environment
- config.py centralizes constants, environment variables, and logging setup.
- The repo is a lightweight Python 3.8+ application with requests as its only material dependency.
- .env.example suggests simple file-based configuration for optional notifications.
12. End-to-end data flow
- Live market data enters through Binance/CoinGecko APIs.
- scanner.py and market.py transform raw data into candidate sets and features.
- strategy.py scores those candidates.
- report.py formats the result.
- notify.py optionally pushes it to Telegram, while db.py preserves the pool between runs.
Main entry points: __main__.py CLI entry · strategy.py Scoring engine · config.py Config · scanner.py Universe scan
Components 10
Pipeline
Core batch analytics flow from scan to score to report.
- CLI entry · Dispatches pool, oi, and full workflows.
accumulation_radar/__main__.py - Universe scan · Finds range-bound accumulation candidates across USDT perpetuals.
accumulation_radar/scanner.py - Market features · Aggregates K-lines, stats, funding, OI history, market cap, and trending signals.
accumulation_radar/market.py - Scoring engine · Computes squeeze, composite, and accumulation scores with interaction bonuses.
accumulation_radar/strategy.py - Report builder · Turns ranked candidates into human-readable sections and notes.
accumulation_radar/report.py - Telegram alert · Pushes reports to Telegram when configured, otherwise stays local.
accumulation_radar/notify.py
Support
Shared infrastructure for data access, persistence, config, and delivery.
- Binance API · Thread-safe wrapper for Binance public market data and rate limiting.
accumulation_radar/api.py - SQLite store · Persists pool and run state between daily and hourly scans.
accumulation_radar/db.py - Config · Loads constants, environment variables, and logging setup.
accumulation_radar/config.py - Package init · Defines the application package boundary.
accumulation_radar/__init__.py
Connections 15
- CLI entry → Universe scan: pool workflow · Runs the daily accumulation universe scan.
- CLI entry → Market features: oi workflow · Collects market features for the hourly signal scan.
- CLI entry → Scoring engine: score candidates · Ranks scanned candidates into strategy views.
- CLI entry → Report builder: format output · Builds the final report from ranked results.
- CLI entry → Telegram alert: optional alert · Sends the report to Telegram when configured.
- Universe scan → Binance API: fetch markets · Pulls Binance data needed for universe screening.
- Universe scan → SQLite store: store pool · Writes accumulation candidates for later hourly scans.
- Market features → Binance API: fetch data · Reads Binance public data and related market inputs.
- Scoring engine → Market features: features · Consumes market-derived features for scoring.
- Scoring engine → SQLite store: pool state · Uses persisted pool and scan state as ranking context.
- Report builder → Scoring engine: rankings · Formats the strategy outputs into report sections.
- Telegram alert → Report builder: payload · Delivers the generated report text.
- Config → CLI entry: runtime · Provides workflow selection and logging configuration.
- Config → Binance API: limits · Supplies shared settings such as rate-limit behavior.
- Config → Telegram alert: env vars · Provides optional Telegram credentials.