@0xBenniee: 币安 @binancezh 开发的聪明钱看板非常好用,国产野庄经常用这个数据来拉盘,通过观察聪明钱的平均持仓成本可以更容易找到二段进场点位。 开源了一个smart-money数据,npm install之后直用,可以拿到所有的聪明钱数据,…
摘要
作者开源了一个用于获取币安聪明钱数据的工具,可通过npm安装使用,提供包括鲸鱼平均持仓成本等在内的专业数据。
查看缓存全文
缓存时间: 2026/05/25 20:57
币安 @binancezh 开发的聪明钱看板非常好用,国产野庄经常用这个数据来拉盘,通过观察聪明钱的平均持仓成本可以更容易找到二段进场点位。
开源了一个smart-money数据,npm install之后直用,可以拿到所有的聪明钱数据,喂给自己的agent。
http://github.com/0xBennie/binance-smart-money-tracker…
这一条数据好的话,下一篇就分享一下怎么一个月20u搭建一个个性化的Database。
0xBennie/binance-smart-money-tracker
Source: https://github.com/0xBennie/binance-smart-money-tracker
binance-smart-money-tracker
Production-grade scraper for Binance Smart Signal (the “Smart Money” tab on
binance.com Futures) — pulls the full 17-field whale overview that the public
fapi API does not expose, with a 7-layer defense against 418 / 429 / 403
rate-limit bans.
This is the URL that binance.com/zh-CN/smart-money/signal/<symbol> calls
behind the scenes:
https://www.binance.com/bapi/futures/v1/public/future/smart-money/signal/overview?symbol=BTCUSDT
No API key required. No proxy required (works directly from most VPS regions).
But Binance enforces an undocumented per-IP weight budget, and a single careless
burst can cost you a 4-hour Retry-After. This repo solves that.
What you get vs. public fapi
| Field | Public fapi/data | This repo |
|---|---|---|
longShortRatio | ✅ via topLongShortPositionRatio | ✅ |
| Top 20% account/position long-short ratios | ✅ | ✅ (bonus: also pulled) |
| Taker buy/sell ratio | ✅ | ✅ (bonus: also pulled) |
| Total Open Interest (USD) + 5m/15m/1h/4h velocity | ✅ | ✅ (bonus: also pulled) |
longWhalesAvgEntryPrice / shortWhalesAvgEntryPrice | ❌ | ✅ |
longProfitTraders / shortProfitTraders (in-profit count) | ❌ | ✅ |
longProfitWhales / shortProfitWhales | ❌ | ✅ |
| Smart Money’s share of total market OI (derived) | ❌ | ✅ |
The four ★ fields are what makes Smart Signal useful — they tell you not just
which side has more positions, but which side is actually making money right
now, and at what average entry. Public fapi can’t tell you any of that.
Example interpretation
Symbol Long Profit% Short Profit% Whale Avg L/S Verdict
1000RATSUSDT 5% 92% 0.034 / 0.042 🔴 shorts winning big (price has dropped)
1000LUNCUSDT 71% 41% 0.085 / 0.092 🟢 longs winning big (price has run)
When Short Whale Avg Entry > Long Whale Avg Entry by >5%, it usually means
shorts entered too late and are about to get squeezed.
Architecture
┌─────────────────┐ ┌──────────────────────────────┐
│ smart-money-tick│ cron 60m├──► binance bapi smart-money │
└────────┬────────┘ └──────────────────────────────┘
│ │
│ writes ob_smart_money_snapshots│
▼ ▼
┌─────────────────────────────────────────────┐
│ sqlite (data/snapshots.db) │
│ ob_smart_money_snapshots (21 columns) │
│ ob_top_trader_snapshots (12 columns) │
└────────────────────┬─────────────────────────┘
│ read-only
▼
┌──────────────────┐
│ Express dashboard │ http://your-host:3001/
│ + JSON API │
└──────────────────┘
┌─────────────────┐ ┌──────────────────────────────┐
│ top-trader-tick │ cron 30m├──► binance fapi/futures/data │
└─────────────────┘ └──────────────────────────────┘
- One sqlite file, two tables, 30-day retention
- One Express dashboard with server-side rendering (no JS framework)
- Two cron entry points (smart-money 60min, top-trader 30min) — staggered
- Library mode:
import { getSmartMoneyOverview } from 'binance-smart-money-tracker'
7 layers of 418/429 protection
The Smart Signal endpoint lives on Binance’s web bapi gateway, which is more
aggressive than fapi. A single uncoordinated burst can earn a 3.85-hour
Retry-After (verified empirically). All seven layers below are wired up
by default:
- Real
Retry-Afterparsing — uses the exact seconds Binance returns, not a guess.parseInt(response.headers['retry-after']). - Weight budget tracker — reads
X-MBX-USED-WEIGHT-1Mfrom every fapi response; when utilization > 70%, the next call sleeps to the next minute window before firing. - Pre-flight ping — every cron entry pings
/fapi/v1/pingonce before the batch; on 418/403 it aborts immediately, no further requests fired. - Jittered spacing — smart-money batches use 12s ± 3s, top-trader uses 1s ± 200ms. Avoids forming a predictable cadence that WAFs flag.
- Exponential backoff — consecutive soft hits within 1 hour escalate the cooldown 5min → 15min → 60min.
- Process-wide circuit breaker —
isBinanceApiBlocked()short-circuits all downstream calls in the same process;getSmartMoneyOverview()andgetTopTraderSnapshot()return cached or null without firing. - Memory cache — 10min for smart-money, 5min for top-trader. Repeated calls to the same symbol within the window don’t hit Binance at all.
There is no retry-on-failure path that ignores Retry-After. That is
intentional. The single fastest way to escalate a 5-minute soft block into a
multi-hour hard block is to retry-loop a 418 — don’t.
Quick start
git clone https://github.com/0xBennie/binance-smart-money-tracker.git
cd binance-smart-money-tracker
npm install
# 1. One-shot pull (writes to data/snapshots.db)
npx tsx src/scripts/smart-money-tick.ts
# 2. Start the dashboard (reads from the same db)
PORT=3001 npx tsx src/scripts/smart-money-dashboard.ts
# → http://localhost:3001/
# 3. Optional: also pull top-trader supplement (Taker ratio + 5min LSR)
npx tsx src/scripts/top-trader-tick.ts
Env vars
| Var | Default | What |
|---|---|---|
SMART_MONEY_POOL_MAX | 0 | Cap of symbols. 0 = all USDT-PERPETUAL (~500). Set to e.g. 100 to limit |
SMART_MONEY_SHARD_INDEX | 0 | 0-based shard index when sharding (see below) |
SMART_MONEY_SHARD_TOTAL | 1 | Total shards. 1 = no sharding |
TOP_TRADER_POOL_MAX / _SHARD_INDEX / _SHARD_TOTAL | same | Same semantics for top-trader cron |
OI_POOL_MAX / _SHARD_INDEX / _SHARD_TOTAL | same | Same for open-interest cron |
SMART_MONEY_DASHBOARD_PORT / PORT | 3001 | Dashboard listen port |
As a library
import {
getSmartMoneyOverview,
getTopTraderSnapshot,
getOpenInterest,
smartMoneyNotionalUsd,
smartMoneyShareOfOI,
} from 'binance-smart-money-tracker';
const sym = 'BTCUSDT';
const [sm, tt, oi] = await Promise.all([
getSmartMoneyOverview(sym), // 17 whale fields
getTopTraderSnapshot(sym, '5m'), // top-account/position LSR + Taker BSR
getOpenInterest(sym), // total market OI + 5m/15m/1h/4h velocity
]);
if (sm && oi) {
console.log(`${sm.longWhales} long whales @ avg ${sm.longWhalesAvgEntryPrice}`);
console.log(`${sm.longProfitTraders}/${sm.longTraders} longs in profit`);
console.log(`Total OI: $${(oi.oiNowUsd / 1e6).toFixed(2)}M, 4h chg ${oi.oiChg4h.toFixed(2)}%`);
// Smart Money USD notional, derived from qty × avg-entry (NOT from the
// undocumented `totalPositions` field whose unit is inconsistent).
const smUsd = smartMoneyNotionalUsd(sm);
const share = smartMoneyShareOfOI(sm, oi.oiNowUsd);
console.log(`Smart Money notional: $${(smUsd / 1e6).toFixed(2)}M`);
console.log(`Smart Money share of total OI: ${share == null ? 'n/a' : (share * 100).toFixed(1) + '%'}`);
}
Why a helper? Binance’s undocumented
totalPositionsfield has inconsistent units across symbols (sometimes base-coin units, sometimes USD).smartMoneyNotionalUsd(sm)computes it deterministically fromlongTradersQty × longTradersAvgEntryPrice + shortTradersQty × shortTradersAvgEntryPrice— both fields have known units (base-coin × USD = USD). Don’t dividetotalPositionsby anything; use the helper.
The library re-exports all rate-limit helpers
(isBinanceApiBlocked, preflightBinanceFapi, waitForBinanceWeightHeadroom)
so you can integrate the same circuit breaker into your other Binance calls
and share one weight budget across modules.
Pool sizing & cron cadence
Default behavior is all USDT-PERPETUAL symbols (~500 contracts as of 2026). Pick a deployment mode that matches your tolerance for data freshness:
| Mode | Symbols | smart-money cron | top-trader cron | OI cron | Sharding |
|---|---|---|---|---|---|
| Light | 100 cap | 7 * * * * (1×/h) | */30 * * * * | 15,45 * * * * | None |
| Standard | 200 cap | 7 * * * * (1×/h) | */30 * * * * | 15,45 * * * * | None |
| Full, 2h refresh | ~500 all | 0 */2 * * * (1×/2h) | */30 * * * * | 15,45 * * * * | None |
| Full, 1h refresh | ~500 all | 7,37 * * * * (2×/h, each does half) | */30 * * * * | 15,45 * * * * | 2 shards |
Read “1h refresh” as every symbol gets a fresh snapshot within 1h, achieved
by two cron entries at :07 and :37 each pulling half (shard 0/2 and 1/2).
The math: smart-money runs at 12s ± 3s spacing (web bapi is rate-sensitive). 500 symbols ≈ 100 min, so it cannot finish inside an hour without sharding. Top-trader and OI both use fapi/data at 1s spacing — 500 symbols ≈ 8 min, fits anywhere.
Sharding
Symbols are split deterministically by index % SHARD_TOTAL == SHARD_INDEX,
so each shard always pulls the same set (good for cache locality, and means
shards don’t collide on the same symbol within a window).
Data Retention
The sqlite tables (ob_smart_money_snapshots, ob_top_trader_snapshots,
ob_oi_snapshots) are pruned to 30 days by the storage.cleanup() call
that runs at the end of every smart-money-tick execution. If you need
longer history, increase RETENTION_DAYS in src/storage.ts and rebuild,
or back the table up before the daily cron runs.
Disk usage estimate at default cadence (500 symbols, hourly smart-money + 30min top-trader + 30min OI): roughly 30–80 MB / month with WAL enabled.
Production deployment (pm2)
A. Standard — cap at 200, hourly
// ecosystem.config.js
module.exports = {
apps: [
{
name: 'smart-money-tick',
script: 'node_modules/.bin/tsx',
args: 'src/scripts/smart-money-tick.ts',
cron_restart: '7 * * * *', // :07 every hour
autorestart: false,
env: { SMART_MONEY_POOL_MAX: '200' },
},
{
name: 'top-trader-tick',
script: 'node_modules/.bin/tsx',
args: 'src/scripts/top-trader-tick.ts 5m',
cron_restart: '*/30 * * * *',
autorestart: false,
},
{
name: 'oi-tick',
script: 'node_modules/.bin/tsx',
args: 'src/scripts/oi-tick.ts',
cron_restart: '15,45 * * * *', // offset from top-trader
autorestart: false,
},
{
name: 'smart-money-dashboard',
script: 'node_modules/.bin/tsx',
args: 'src/scripts/smart-money-dashboard.ts',
autorestart: true,
env: { PORT: '3001' },
},
],
};
B. Full coverage with 1h refresh — 2-way sharding
Two pm2 entries, each pulls half the symbols at staggered times:
module.exports = {
apps: [
{
name: 'smart-money-tick-a',
script: 'node_modules/.bin/tsx',
args: 'src/scripts/smart-money-tick.ts',
cron_restart: '7 * * * *', // :07
autorestart: false,
env: { SMART_MONEY_SHARD_INDEX: '0', SMART_MONEY_SHARD_TOTAL: '2' },
},
{
name: 'smart-money-tick-b',
script: 'node_modules/.bin/tsx',
args: 'src/scripts/smart-money-tick.ts',
cron_restart: '37 * * * *', // :37 — 30 min offset from A
autorestart: false,
env: { SMART_MONEY_SHARD_INDEX: '1', SMART_MONEY_SHARD_TOTAL: '2' },
},
// ... top-trader-tick and dashboard same as Mode A
],
};
C. Full coverage, slower refresh — 2-hour cron, no sharding
Cheapest option if hourly freshness isn’t required:
{
name: 'smart-money-tick',
args: 'src/scripts/smart-money-tick.ts',
cron_restart: '0 */2 * * *', // every 2 hours
autorestart: false,
// no env vars needed — defaults to all symbols
}
Why staggering matters
The circuit breaker lives in per-process module state. Two cron processes
running simultaneously cannot share isBinanceApiBlocked() state directly,
but each one ping-tests via preflightBinanceFapi() before issuing any
data requests — so if process A just got a 418, process B’s preflight will
catch it and abort cleanly. Stagger the times anyway to give the IP weight
window time to drain between bursts.
What’s not in this repo
- ❌ No trading. This is data only.
- ❌ No proxy. If your IP gets a hard 403 (CloudFront WAF), the only fix is to wait it out or change IP. The whole point of the protection layers is to never get there.
- ❌ No on-chain data, no order book, no aggregated trades. For that, see the projects in Credits.
Credits
- andychien555/binance-smart-money-tracker
— original reverse-engineering of the
bapi/futures/v1/public/future/smart-money/signal/overviewendpoint. Their version is built on Cloudflare Workers + R2 with a static SPA frontend; this repo is the Node + sqlite + express version with stronger rate-limit protection. Different architecture, same source insight. - y18929284608-byte/BNSmartMoneyMonitor and 6551Team/opentrade — parallel implementations that confirmed the endpoint contract.
License
MIT — see LICENSE.
Arya@羊姐社区🦅 (@Arya_web3): 上一篇帖子把 $UB $BILL 放在一起对比是对的 ,庄的操盘手法和K线走势、洗盘方式都极为相似
$UB 和 $BILL 都开启了二段
$UB 我是在下跌过程中接的,事实证明这种建仓方式非常不健康,接的是飞刀,会比较难受,索性现在也回本了
玩二段币,还是要在右侧趋势的时候去追比较好
相似文章
@_zheergen: 兄弟们!又挖到一个 Python 股票全能工具 —— InStock myhhub/stock 这个仓库把 A 股量化分析做得挺全的,数据抓取、指标计算、选股、回测、自动交易一条龙。 核心功能我挑重点说下: 实时抓取 A 股数据 + 30…
介绍了开源 Python 工具 InStock (myhhub/stock),用于 A 股量化分析,支持数据抓取、技术指标、选股、回测、自动交易等功能,可 Docker 部署。
@eastweb3eth: Github 美股量化合集----聪明人必用的工具 自从有了 Github,普通人也能玩量化了。但是别一上来就自己吭哧吭哧写回测引擎,真的,大部分人写的还不如 GitHub 上一个三年前的仓库抗造。 虽然仓库很多,我已经帮你筛选好了,这4…
推荐4个开源量化交易工具/框架(VeighNa、AI-Trader、StockSharp、QuantDinger),强调它们适合普通用户进行美股量化交易,帮助解放双手、将交易交给模型。
@spicycandy00: 付费彭博终端:$24,000 一年。GitHub 平替:Star 29k,免费。 四个最猛的,按 Star 排。 daily_stock_analysis | 58k Star http://github.com/ZhuLinsen/da…
该推文推荐了四个高Star开源金融分析工具,可替代彭博终端,覆盖每日简报、专业终端、算法交易和深度研究,均基于GitHub免费部署。
@waveking1314: 这个项目我建议所有做投资研究的人都收藏 GitHub 上有个开源金融数据项目叫 OpenBB,已经接近 7w Star 它最狠的地方不是又做了一个行情工具 而是把过去只有机构和专业投研团队才方便用的数据,拆成了普通人也能用的开源工作流 股…
OpenBB 是一个接近 7 万 Star 的开源金融数据平台,整合了股票、期权、加密货币、宏观经济等多种数据,支持 AI 集成和自部署,帮助个人投资者和小团队降低金融研究的数据门槛。
@WY_mask: 想要玩美股的兄弟强烈建议去安装一下,github高达4w收藏。基于 AI 大模型的 A股/港股/美股自选股智能分析系统,每日自动分析并推送决策仪表盘 分析市场走势 整理重要资讯 跟踪个股表现 自动生成投资分析报告 https://gith…
推荐一个基于AI大模型的开源股票智能分析系统,支持A股、港股、美股,每日自动分析并推送决策仪表盘,GitHub已获4万收藏。