โ† ะะฐะทะฐะด

Futures Screener ๐Ÿ“Š

Fast visual screener for order book densities on Binance Futures (USDT-M). Shows large limit levels near current mark price, sorts and highlights "MM" (market maker) levels with high liquidity strength.

Features

Architecture

Quick Start

cd /home/app/futures-screener
pm2 delete futures-screener 2>/dev/null || true
PORT=3200 pm2 start npm --name "futures-screener" -- run dev
pm2 logs futures-screener

Open http://127.0.0.1:3200 in your browser.

API Endpoints

Method Path Description
GET /health Health check
GET /symbols All USDT-PERP symbols
GET /depth/:symbol Order book depth
GET /densities/simple Main endpoint โ€” densities with MM flag
GET /_cache/stats Server cache stats

/densities/simple Parameters

Param Default Description
symbols (all) Comma-separated (e.g. BTCUSDT,ETHUSDT)
minNotional 0 Minimum notional (price ร— qty)
depthLimit 100 Max levels to return
windowPct 5.0 Window around price (ยฑ%)
concurrency 5 Parallel requests to Binance
xFilter 0 Filter by x multiplier (0 = no filter)
natrFilter 0 Filter by NATR (0 = no filter)
mmMode false Show only MM levels
mmMultiplier 4 MM candidate multiplier

Response Structure

{
  "count": 200,
  "minNotional": 0,
  "depthLimit": 100,
  "concurrency": 5,
  "mmMode": false,
  "windowPct": 5.0,
  "xFilter": 0,
  "natrFilter": 0,
  "data": [
    {
      "symbol": "BTCUSDT",
      "side": "bid",
      "price": 72500.00,
      "qty": 10.5,
      "notional": 761250,
      "distancePct": 0.15,
      "x": 2.35,
      "mmCount": 3,
      "score": 4.1234,
      "vol1": 1500000,
      "vol2": 1200000,
      "vol3": 980000,
      "natr": 0.45,
      "mmBaseBid": 350000,
      "mmBaseAsk": 380000
    }
  ]
}

Scoring Formula

score = log10(1 + notional) ร— exp(-distancePct / 0.45) ร— (isMM ? 1.8 : 1)

MM Detection Logic

  1. Base calculation: 70th percentile of notionals (filtered by base ร— 2)
  2. MM candidate: level.notional โ‰ฅ base ร— mmMultiplier (default 4x)
  3. Clustering: Group levels within 0.2% gap, min 2 levels, min 20k total notional
  4. mmBase: 50th percentile of cluster totals (if โ‰ฅ 3 clusters)
  5. x multiplier: level.notional / mmBase

Project Structure

futures-screener/
โ”œโ”€โ”€ server/
โ”‚   โ””โ”€โ”€ index.js       # Fastify API
โ”œโ”€โ”€ app/
โ”‚   โ”œโ”€โ”€ index.html     # Main HTML
โ”‚   โ”œโ”€โ”€ app.js         # UI logic
โ”‚   โ””โ”€โ”€ styles.css     # Tailwind styles
โ”œโ”€โ”€ docs/
โ”‚   โ”œโ”€โ”€ VISION.md      # Long-term goals
โ”‚   โ”œโ”€โ”€ ROADMAP.md     # Development stages
โ”‚   โ””โ”€โ”€ UI-SPEC.md     # UI specification
โ”œโ”€โ”€ package.json
โ”œโ”€โ”€ README.md          # This file
โ”œโ”€โ”€ CRITICAL_ISSUES.md # Bug fixes history
โ””โ”€โ”€ MEMORY.md          # Long-term memory

Current Status

Tech Stack

Deployment

Systemd Service

sudo cp futures-screener.service /etc/systemd/system/
sudo systemctl daemon-reload
sudo systemctl enable futures-screener
sudo systemctl start futures-screener

Nginx Proxy (with SSL)

server {
    listen 443 ssl http2;
    server_name futures-screener.szhub.space;

    ssl_certificate /path/to/cert.pem;
    ssl_certificate_key /path/to/key.pem;

    location / {
        proxy_pass http://127.0.0.1:3200;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection 'upgrade';
        proxy_set_header Host $host;
        proxy_cache_bypass $http_upgrade;
    }
}

Configuration

Environment Variables

Variable Default Description
PORT 3200 Server port
MM_SEED_MULTIPLIER 2.0 MM candidate multiplier (initial)
SERVICE_NAME futures-screener Service name for healthcheck

Binance API

No API key required โ€” public endpoints only.

Development

# Run locally (no PM2)
cd server
node index.js

# Run tests (if added)
npm test

# Type check (if migrated to TS)
npm run type-check

Links

Author

Created for OpenClaw by Morty ๐Ÿฆž

License

MIT