High-Frequency Data Analysis — Processing Tick-Level Market Data

High-frequency trading in crypto operates at millisecond/microsecond timescales. Processing millions of ticks per day, handling bursty data flows, and extracting microstructure signals separates professional traders from the rest. This guide walks through tick-level data management and real-time analytics that power Smart Money API's 5-minute refresh cycles.

Key insight: Whales don't move markets instantly. Their block trades create detectable signatures in order book imbalance, bid-ask spreads, and taker volume ratios. Smart Money API captures these signatures in real-time.

Tick Data Collection and Storage

Data Sources

For crypto, tick data comes from:

Efficient Tick Storage with Parquet

Store compressed columnar data for fast queries:

Python — Tick data pipeline
import pandas as pd
import pyarrow.parquet as pq
# Real-time tick buffer (accumulate for 1h, then save)
tick_buffer = []
def on_tick(exchange, symbol, price, size, side, timestamp):
tick_buffer.append({
"timestamp": timestamp,
"exchange": exchange,
"symbol": symbol,
"price": price,
"size": size,
"side": side # "buy" or "sell"
})
# Every hour, compress and save
if len(tick_buffer) > 1_000_000:
df = pd.DataFrame(tick_buffer)
pq.write_table(
pa.Table.from_pandas(df),
f"ticks/{symbol}_{timestamp:%Y%m%d_%H}.parquet",
compression="snappy"
)
tick_buffer = []

Order Book Analysis

Level 2 Order Book Snapshots

Capture the full order book every 100-500ms:

Python — Order book processing
class OrderBook:
def __init__(self):
self.bids = {} # price -> size
self.asks = {} # price -> size
def update(self, side, price, size):
if side == "bid":
if size == 0: del self.bids[price]
else: self.bids[price] = size
else:
if size == 0: del self.asks[price]
else: self.asks[price] = size
def get_imbalance(self, depth=10):
# Get best 10 bids and asks
top_bids = sorted(self.bids.items(), reverse=True)[:depth]
top_asks = sorted(self.asks.items())[:depth]
bid_volume = sum(size for _, size in top_bids)
ask_volume = sum(size for _, size in top_asks)
# Imbalance: >1 = bullish (more buy pressure)
return bid_volume / ask_volume if ask_volume > 0 else 1.0
def get_spread(self):
best_bid = max(self.bids.keys())
best_ask = min(self.asks.keys())
return (best_ask - best_bid) / best_bid # percentage spread

Microstructure Signals

Extract actionable signals from order book structure:

Market Microstructure Metrics

Volume-Weighted Average Price (VWAP)

Better execution benchmark than simple close price:

Python — VWAP calculation
def calculate_vwap(ticks):
# ticks: list of (price, volume) tuples
numerator = sum(price * volume for price, volume in ticks)
denominator = sum(volume for _, volume in ticks)
return numerator / denominator

Taker Buy/Sell Ratio

Identify which side is being aggressive:

Python — Taker analysis
def get_taker_direction(tick):
# If trade price = bid, then seller was aggressive (supply)
# If trade price = ask, then buyer was aggressive (demand)
if abs(tick.price - best_bid) < tick.price_step:
return "sell"
elif abs(tick.price - best_ask) < tick.price_step:
return "buy"
else:
return "mid" # Inside spread, possibly dark pool
buy_volume = sum(t.size for t in ticks if get_taker_direction(t) == "buy")
sell_volume = sum(t.size for t in ticks if get_taker_direction(t) == "sell")
return buy_volume / (buy_volume + sell_volume) # % buy

Real-Time Pipeline Architecture

WebSocket Stream Processing

Connect to Bybit/Binance/Hyperliquid WebSocket for live data:

Python — Live stream handler
import asyncio
import websockets
async def connect_bybit_ticks(symbol):
url = f"wss://stream.bybit.com/v5/public/spot"
async with websockets.connect(url) as ws:
# Subscribe to trade stream
await ws.send(json.dumps({
"op": "subscribe",
"args": [f"publicTrade.{symbol}"]
}))
async for message in ws:
data = json.loads(message)
for trade in data["data"]:
on_tick(
exchange="bybit",
symbol=symbol,
price=float(trade["price"]),
size=float(trade["size"]),
side=trade["side"],
timestamp=int(trade["time"])
)

Distributed Processing with Redis Streams

Handle millions of ticks per day with message queuing:

Python — Redis stream processing
import redis
r = redis.Redis(host='localhost', port=6379)
# Producer: push ticks to stream
def publish_tick(exchange, symbol, tick):
stream_key = f"ticks:{exchange}:{symbol}"
r.xadd(stream_key, {
"price": tick.price,
"size": tick.size,
"side": tick.side,
"ts": tick.timestamp
})
# Consumer group reads with lag tracking
r.xgroup_create(stream_key, "analytics", id="$", mkstream=True)

Add real-time signals to your analytics

Smart Money API aggregates tick data from 3 exchanges and 250+ whale wallets. Use our pre-computed microstructure signals to enhance your own real-time analysis.

Start Free Today →