Market Microstructure
29 algorithms · 5 families · D11
Reading this with a program?
market-microstructure/llms.txt lists all
29 algorithms here — signature, shape and verification tier, one line each.
Every reference page below also exists as markdown at <page URL>index.md.
Trade Classification#
-
Tick Test
contract
tickTest(data, config) -
Quote Test
contract
quoteTest(data, config) -
Lee-Ready Trade Signing
contract
leeReady(data, config) -
Bulk Volume Classification
contract
bulkVolumeClassification(data, config)
Liquidity and Spreads#
-
Quoted Spread
verified
quotedSpread(bid, ask) -
Effective Spread
verified
effectiveSpread(bid, ask, tradePrice, side) -
Realized Spread
verified
realizedSpread(bidAtTrade, askAtTrade, tradePrice, side, bidAfter, askAfter, horizonSeconds) -
Roll Spread Estimator
verified
rollSpread(prices) -
Amihud Illiquidity Ratio
verified
amihudIlliquidity(closes, dollarVolumes, scale) -
Corwin-Schultz Spread Estimator
verified
corwinSchultzSpread(highDay1, lowDay1, highDay2, lowDay2, clipNegative)
Order-Flow and Impact#
-
Order Flow Imbalance
contract
orderFlowImbalance(inputRows, resetOnSession, normalizeByDepth) -
Queue Imbalance
contract
queueImbalance(inputRows, levels, decay) -
Kyle Lambda
contract
kyleLambda(inputRows, volumeTransform, intercept) -
Hasbrouck Price Impact
contract
hasbrouckPriceImpact(inputRows, horizon) -
PIN
contract
pin(inputRows, starts, balancedNoise, iterations) -
VPIN
contract
vpin(inputRows, bucketVolume, windowBuckets, includePartial)
Order-Book Dynamics#
-
Order-Book Slope
verified
orderBookSlope(bidPrices, bidSizes, askPrices, askSizes) -
Depth-Weighted Midprice
verified
depthWeightedMidprice(bidPrices, bidSizes, askPrices, askSizes) -
Microprice
verified
microprice(bid, bidSize, ask, askSize) -
Order-Book Resiliency
verified
orderBookResiliency(timesSeconds, displacementBps, forecastSeconds) -
Hawkes Order-Arrival Model
verified
hawkesOrderArrival(eventTimesSeconds, baselineIntensity, excitationJump, decayRate, evaluationTimeSeconds, horizonSeconds)
Market-Depth Analytics#
-
Cumulative Bid/Ask Depth
verified
cumulativeDepth(bidsRaw, asksRaw, tickRaw) -
Top-N Depth Imbalance
verified
topNDepthImbalance(bidsRaw, asksRaw, nRaw, thresholdRaw) -
Depth-at-Distance Profile
verified
depthAtDistanceProfile(bidsRaw, asksRaw, tickRaw, maxRaw) -
Expected Market-Order Fill Price
verified
expectedFillPrice(bids, asks, side, quantity, limitPrice) -
Multi-Level Sweep Cost and Slippage
verified
sweepCostAndSlippage(bids, asks, side, quantity, benchmarkRaw, benchmarkPriceRaw, limitPrice) -
Liquidity-Wall and Concentration Detection
verified
liquidityWallConcentration(levelsRaw, multipleRaw, minShareRaw, thresholdRaw) -
Depth Depletion and Replenishment
verified
depthDepletionReplenishment(seriesRaw) -
Market-Depth Heatmap Aggregation
verified
marketDepthHeatmap(snapshotsRaw, tickRaw, binRaw, maxRaw)