# Market Microstructure — fintech-algorithms > 29 algorithms in 5 families, sliced out of the > fintech-algorithms reference. Zero-dependency TypeScript: plain arrays and objects in, > plain values out. This file covers D11 only. D11 · 29 topics · 5 families · 0 verified Install: npm install fintech-algorithms Agent skill (install it rather than re-deriving this file): npx skills add IslamBaraka90/Fintech-Algorithms-Library what it is: https://docs.thefintechbuilder.com/guides/agent-skill/ Source: fintech-algorithms@0.12.0 · payload schema 2.0.0 Reference payload: https://docs.thefintechbuilder.com/reference/payload.json Version endpoint: https://docs.thefintechbuilder.com/version.json Domain page: https://docs.thefintechbuilder.com/market-microstructure/ Full index (324 topics across 13 domains): https://docs.thefintechbuilder.com/llms.txt Verification tiers: - verified — the worked example is the figure published in the algorithm's article, replayed and asserted by the test suite on every run. The arithmetic cannot drift without the build failing. Treat the numbers as reproducible. - contract — the module loads, the entry point is callable and its declared signature matches the compiled code. The example is real captured output, but no independently published figure asserts it. Treat the shape as reliable and the numbers as unattested. Full explanation: https://docs.thefintechbuilder.com/guides/verification/ Each entry: name — signature — archetype — verification tier — docs URL From the docs URL, mechanically: import subpath — swap the https://docs.thefintechbuilder.com/ prefix for fintech-algorithms/ and drop the trailing slash markdown page — append index.md; same contract as the HTML page, a fraction of the bytes ## D11-F01 — Trade Classification https://docs.thefintechbuilder.com/market-microstructure/trade-classification/ - Tick Test — `tickTest(data, config)` — record-transform — contract — https://docs.thefintechbuilder.com/market-microstructure/trade-classification/tick-test/ - Quote Test — `quoteTest(data, config)` — record-transform — contract — https://docs.thefintechbuilder.com/market-microstructure/trade-classification/quote-test/ - Lee-Ready Trade Signing — `leeReady(data, config)` — record-transform — contract — https://docs.thefintechbuilder.com/market-microstructure/trade-classification/lee-ready-trade-signing/ - Bulk Volume Classification — `bulkVolumeClassification(data, config)` — record-transform — contract — https://docs.thefintechbuilder.com/market-microstructure/trade-classification/bulk-volume-classification/ ## D11-F02 — Liquidity and Spreads https://docs.thefintechbuilder.com/market-microstructure/liquidity-and-spreads/ - Quoted Spread — `quotedSpread(bid, ask)` — record-transform — contract — https://docs.thefintechbuilder.com/market-microstructure/liquidity-and-spreads/quoted-spread/ - Effective Spread — `effectiveSpread(bid, ask, tradePrice, side)` — record-transform — contract — https://docs.thefintechbuilder.com/market-microstructure/liquidity-and-spreads/effective-spread/ - Realized Spread — `realizedSpread(bidAtTrade, askAtTrade, tradePrice, side, bidAfter, askAfter, horizonSeconds)` — record-transform — contract — https://docs.thefintechbuilder.com/market-microstructure/liquidity-and-spreads/realized-spread/ - Roll Spread Estimator — `rollSpread(prices)` — record-transform — contract — https://docs.thefintechbuilder.com/market-microstructure/liquidity-and-spreads/roll-spread-estimator/ - Amihud Illiquidity Ratio — `amihudIlliquidity(closes, dollarVolumes, scale)` — record-transform — contract — https://docs.thefintechbuilder.com/market-microstructure/liquidity-and-spreads/amihud-illiquidity-ratio/ - Corwin-Schultz Spread Estimator — `corwinSchultzSpread(highDay1, lowDay1, highDay2, lowDay2, clipNegative)` — record-transform — contract — https://docs.thefintechbuilder.com/market-microstructure/liquidity-and-spreads/corwin-schultz-spread-estimator/ ## D11-F03 — Order-Flow and Impact https://docs.thefintechbuilder.com/market-microstructure/order-flow-and-impact/ - Order Flow Imbalance — `orderFlowImbalance(inputRows, resetOnSession, normalizeByDepth)` — record-transform — contract — https://docs.thefintechbuilder.com/market-microstructure/order-flow-and-impact/order-flow-imbalance/ - Queue Imbalance — `queueImbalance(inputRows, levels, decay)` — record-transform — contract — https://docs.thefintechbuilder.com/market-microstructure/order-flow-and-impact/queue-imbalance/ - Kyle Lambda — `kyleLambda(inputRows, volumeTransform, intercept)` — record-transform — contract — https://docs.thefintechbuilder.com/market-microstructure/order-flow-and-impact/kyle-lambda/ - Hasbrouck Price Impact — `hasbrouckPriceImpact(inputRows, horizon)` — record-transform — contract — https://docs.thefintechbuilder.com/market-microstructure/order-flow-and-impact/hasbrouck-price-impact/ - PIN — `pin(inputRows, starts, balancedNoise, iterations)` — record-transform — contract — https://docs.thefintechbuilder.com/market-microstructure/order-flow-and-impact/pin/ - VPIN — `vpin(inputRows, bucketVolume, windowBuckets, includePartial)` — record-transform — contract — https://docs.thefintechbuilder.com/market-microstructure/order-flow-and-impact/vpin/ ## D11-F04 — Order-Book Dynamics https://docs.thefintechbuilder.com/market-microstructure/order-book-dynamics/ - Order-Book Slope — `orderBookSlope(bidPrices, bidSizes, askPrices, askSizes)` — record-transform — contract — https://docs.thefintechbuilder.com/market-microstructure/order-book-dynamics/order-book-slope/ - Depth-Weighted Midprice — `depthWeightedMidprice(bidPrices, bidSizes, askPrices, askSizes)` — record-transform — contract — https://docs.thefintechbuilder.com/market-microstructure/order-book-dynamics/depth-weighted-midprice/ - Microprice — `microprice(bid, bidSize, ask, askSize)` — record-transform — contract — https://docs.thefintechbuilder.com/market-microstructure/order-book-dynamics/microprice/ - Order-Book Resiliency — `orderBookResiliency(timesSeconds, displacementBps, forecastSeconds)` — record-transform — contract — https://docs.thefintechbuilder.com/market-microstructure/order-book-dynamics/order-book-resiliency/ - Hawkes Order-Arrival Model — `hawkesOrderArrival(eventTimesSeconds, baselineIntensity, excitationJump, decayRate, evaluationTimeSeconds, horizonSeconds)` — record-transform — contract — https://docs.thefintechbuilder.com/market-microstructure/order-book-dynamics/hawkes-order-arrival-model/ ## D11-F05 — Market-Depth Analytics https://docs.thefintechbuilder.com/market-microstructure/market-depth-analytics/ - Cumulative Bid/Ask Depth — `cumulativeDepth(bidsRaw, asksRaw, tickRaw)` — record-transform — contract — https://docs.thefintechbuilder.com/market-microstructure/market-depth-analytics/cumulative-bid-ask-depth/ - Top-N Depth Imbalance — `topNDepthImbalance(bidsRaw, asksRaw, nRaw, thresholdRaw)` — record-transform — contract — https://docs.thefintechbuilder.com/market-microstructure/market-depth-analytics/top-n-depth-imbalance/ - Depth-at-Distance Profile — `depthAtDistanceProfile(bidsRaw, asksRaw, tickRaw, maxRaw)` — record-transform — contract — https://docs.thefintechbuilder.com/market-microstructure/market-depth-analytics/depth-at-distance-profile/ - Expected Market-Order Fill Price — `expectedFillPrice(bids, asks, side, quantity, limitPrice)` — record-transform — contract — https://docs.thefintechbuilder.com/market-microstructure/market-depth-analytics/expected-market-order-fill-price/ - Multi-Level Sweep Cost and Slippage — `sweepCostAndSlippage(bids, asks, side, quantity, benchmarkRaw, benchmarkPriceRaw, limitPrice)` — record-transform — contract — https://docs.thefintechbuilder.com/market-microstructure/market-depth-analytics/multi-level-sweep-cost-and-slippage/ - Liquidity-Wall and Concentration Detection — `liquidityWallConcentration(levelsRaw, multipleRaw, minShareRaw, thresholdRaw)` — record-transform — contract — https://docs.thefintechbuilder.com/market-microstructure/market-depth-analytics/liquidity-wall-and-concentration-detection/ - Depth Depletion and Replenishment — `depthDepletionReplenishment(seriesRaw)` — record-transform — contract — https://docs.thefintechbuilder.com/market-microstructure/market-depth-analytics/depth-depletion-and-replenishment/ - Market-Depth Heatmap Aggregation — `marketDepthHeatmap(snapshotsRaw, tickRaw, binRaw, maxRaw)` — record-transform — contract — https://docs.thefintechbuilder.com/market-microstructure/market-depth-analytics/market-depth-heatmap-aggregation/