Skip to content
Skills Library
Finance & accounting · Analysis

lob-microstructure

/lob-microstructure

Analyze limit-order-book mechanics, spread and depth dynamics, order-flow imbalance, microprice, short-horizon price impact, and adverse selection. Use for exchange microstructure research, LOB feature design, liquidity studies, and interpretation of book events; not for generic OHLCV chart analysis.

Licence
Apache-2.0
Last repository change
11.11.2026

Assessment and security

90/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content25 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
1
Scripts
0
HTML comments
0
URLs in SKILL.md
3
Deprecation

No signals detected. Repository changed on 11.11.2026, without references to retired models or APIs.

Licence

Apache-2.0, otwarta: można używać i zmieniać, z zachowaniem licencji i informacji o zmianach.

What it does and when to use it

Analyze limit-order-book mechanics, spread and depth dynamics, order-flow imbalance, microprice, short-horizon price impact, and adverse selection. Use for exchange microstructure research, LOB feature design, liquidity studies, and interpretation of book events; not for generic OHLCV chart analysis.

Original author description

Analyze limit-order-book mechanics, spread and depth dynamics, order-flow imbalance, microprice, short-horizon price impact, and adverse selection. Use for exchange microstructure research, LOB feature design, liquidity studies, and interpretation of book events; not for generic OHLCV chart analysis.

How it works

  1. Required context
  2. Workflow
  3. Guardrails
  4. Deliverable
  5. Further reading
Original SKILL.md headings · 36 lines, 469 words
SKILL.md preview
---
name: lob-microstructure
description: Analyze limit-order-book mechanics, spread and depth dynamics, order-flow imbalance, microprice, short-horizon price impact, and adverse selection. Use for exchange microstructure research, LOB feature design, liquidity studies, and interpretation of book events; not for generic OHLCV chart analysis.
---
# Limit Order Book Microstructure

Act as a quantitative market-microstructure researcher. Ground every conclusion in the venue's matching rules, the available message granularity, and the exact observation horizon. Do not treat a book feature as a universal trading signal.

## Required context

Establish the instrument, venue, session, tick and lot sizes, matching priority (price-time, pro-rata, hybrid, or venue-specific), auction/continuous state, book depth (L1/L2/MBO), event timestamps, and whether feeds are complete or sampled. Ask for missing details only when they change the analysis; otherwise state explicit assumptions.

## Workflow

1. **Define the question and horizon.** Separate descriptive liquidity measurement, short-horizon prediction, execution-cost estimation, and causal price-impact analysis. State the target horizon and sampling clock (event time or wall-clock time).
2. **Audit the feed first.** Check sequence gaps, duplicates, crossed/locked states, timestamp ordering, stale quotes, session boundaries, and whether the feed is market-by-order or aggregated market-by-price. Do not derive market-by-order facts from an L2 feed.
3. **Reconstruct the state.** Identify best bid/ask, spread in ticks and basis points, depth by level, book slope, and depth-weighted mid. Keep units and sign conventions explicit.
4. **Compute features with definitions.** For best-level sizes `Qb` and `Qa`, a common queue-imbalance feature is `(Qb-Qa)/(Qb+Qa)` when the denominator is nonzero. A common microprice is `(ask*Qb + bid*Qa)/(Qb+Qa)`. For event-based order-flow imbalance (OFI), use the chosen event definition consistently; document how best-price moves, additions, cancellations, and executions contribute. The Cont–Kukanov–Stoikov formulation is an event-level construction, not simply a snapshot size difference.
5. **Measure response, not just correlation.** Analyze mid-price changes and markouts across multiple horizons. Segment by spread, depth, volatility, time of day, venue state, and trade aggressor side. Estimate uncertainty with clustered or block-aware methods suitable for dependent event data.
6. **Quantify adverse selection.** For passive fills, measure signed post-fill markouts at fixed horizons, compare maker revenue with fees/rebates and inventory/hedging costs, and distinguish realized spread from effective spread.
7. **Stress interpretation.** Check whether the relationship survives alternate sampling, quote staleness filters, event definitions, tick regimes, and out-of-sample periods.

## Guardrails

- Queue imbalance is conditional information, not a guaranteed next-tick direction.
- A strong contemporaneous OFI/price relationship is not, by itself, a deployable alpha estimate.
- Do not mix exchange timestamps and local receive timestamps without a clock and latency model.
- Do not compare venues until tick sizes, priority rules, auction mechanics, and fee schedules are normalized.
- Report sample counts, coverage, missingness, confidence intervals, and the exact horizon beside every metric.

## Deliverable

Return (a) venue/mechanics assumptions, (b) data-quality verdict, (c) feature definitions and units, (d) descriptive results, (e) markout/adverse-selection analysis, (f) robustness checks, and (g) unresolved limitations. Separate empirical results from interpretation.

## Further reading

- Cont, Kukanov & Stoikov, *The Price Impact of Order Book Events* (2014): https://doi.org/10.1093/jjfinec/nbt003
- Gould et al., *Limit order books* (2013): https://arxiv.org/abs/1012.0349
- Nasdaq TotalView-ITCH specification: https://nasdaqtrader.com/content/technicalsupport/specifications/dataproducts/NQTVITCHspecification.pdf

Versions

The database has no other skills named lob-microstructure.

Database snapshot: 13.11.2026 · package version 86287ea0cea5 (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 90order-book-microstructure-signal-research
    Use when testing whether a top-of-book signal genuinely leads the mid-price, computing order flow imbalance to the published definition including both queue-depletion branches. A windowed research audit, not a live generator.
  • 100fin-stock-liquidity
    Analyze stock liquidity — full dashboard, bid-ask spread, volume, order-book depth, market-impact estimates, and turnover ratio, with practical execution guidance. Use when the user asks for stock liquidity analysis work, or mentions fin, stock, liquidity.
  • 100execution-microstructure
    Trade with the cost measured and the market structure understood, the way an electronic execution or market making desk does. Use when the user asks how to execute a large order, what a trade will cost, how to measure slippage or implementation shortfall, how to choose between…
  • 90order-book-depth-processing-l2-l3
    Use when maintaining a local L2 or L3 book from an already-sequenced depth feed, and reading top-of-book, weighted mid-price and depth imbalance off it under thread-safe mutation, with crossed and locked book detection.
  • 100lob-webhooks
    Receive and verify Lob webhooks. Use when setting up Lob print-and-mail webhook handlers, debugging Lob-Signature verification, or handling events like postcard.delivered, letter.mailed, check.in_transit, and self_mailer.rendered_thumbnails.
  • 80domain-fintech:trading-systems
    Guides trading system design: order matching engines (price-time priority, pro-rata), market data feeds (WebSocket, FIX protocol), order types (market, limit, stop, stop-limit), position management, P&L calculation, risk limits, low-latency architecture, and market…

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.