Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

📈 price-watcher

Real-time crypto price stream engine — built from raw WebSockets, zero libraries for core logic.

Status JavaScript Node

What this is

A live price-watching pipeline built entirely from scratch — no ethers.js-style abstraction, no event-library crutch. Every core piece (event bus, queue, worker) is hand-built to actually understand what's happening under the hood, not just import a solution.

Streams live BTC/USDT trades from Binance's public WebSocket API, decouples ingestion from processing via a custom pub/sub system, and (soon) fires alerts on configurable price thresholds.

Architecture

  • ws-client.js — raw WebSocket connection, zero SDK
  • event-bus.js — hand-rolled pub/sub (on/emit), no EventEmitter import
  • queue.js — buffering layer for incoming trades
  • worker.js — pulls from queue, processes at controlled pace
  • alert-engine.js — threshold-based alerting

Status

  • [done] WebSocket client — live connection, parsing raw trade data
  • [done] Event bus — decoupled pub/sub working end to end
  • [done ] Queue — buffering layer
  • [done ] Worker — controlled processing loop
  • [done ] Alert engine — configurable price thresholds

Run it

npm install
node src/index.js

Why

Built to actually understand async iteration, closures, event-driven architecture, and backpressure handling — not to ship a product. Every piece here could be replaced by a library in five minutes; the point is knowing exactly what that library would be doing.


About

Build a program that watches live crypto prices in real time and reacts when something interesting happens (like "alert me if BTC crosses $110k") — without using any pre-built libraries for the core logic. You're building the plumbing yourself to learn how real systems work under the hood.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages