Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Gopher

go-crypto-tracker

Terminal app that streams live price data from Binance and renders it as an UTF-8 chart.

What it does

Connects to the Binance websocket kline stream for a configured symbol and interval, backfills recent history over REST on startup, keeps a rolling window of closing prices in memory, and redraws an ASCII line chart in the terminal twice a second. Reconnects automatically on dropped connections.

Screenshot

Candlestick chart

Requirements

  • Go 1.25+

Configuration

Includes a custom .env parser and validator (no third-party dependency) that loads and validates configuration on startup.

Set values in .env, or as environment variables — those take precedence:

SYMBOL="ETHUSDT"
INTERVAL="1m"
BACKFILL="100"
Variable Description Accepted values
SYMBOL Trading pair e.g. ETHUSDT
INTERVAL Kline interval 1m 3m 5m 15m 30m 1h 2h 4h 6h 8h 12h 1d 3d 1w 1M
BACKFILL Historical candles fetched on startup 01000

Usage

make tracker

Or directly:

go run ./cmd/tracker

Press Ctrl+C to stop.

Testing

make test

Coverage report:

make cover

Layout

cmd/tracker       entry point
cmd/config        .env loading and validation
internal          ASCII chart rendering
internal/binance  REST backfill and websocket client
internal/market   kline model and ring buffer store
internal/tracker  orchestrates the transport and serves snapshots

Releases

Packages

Contributors

Languages