# orderbook-microstructure-analysis

> Analyze limit order books: imbalance, OFI, microprice, queue fills, VPIN toxicity, spoofing signs, and venue structure.

orderbook-microstructure-analysis is a paid AI agent skill on Agensi by BanditXBT. It loads into your AI agent through the Agensi MCP server, always in its latest approved version.

- Price: $29 (one-time purchase)
- Creator: [BanditXBT](https://www.agensi.io/creators/banditxbt)
- Version: 1.0
- Last updated: 2026-11-21
- Security: scan passed (2026-11-21); every new listing is also reviewed by a person
- Listing: https://www.agensi.io/skills/orderbook-microstructure-analysis
- Tags: trading-investing, web3-crypto, research-analysis

## About this skill

Goal: extract short-horizon information from LOB data without confusing it with artifacts of data quality, latency, or venue rules.

- Know the feed: L1, L2 (aggregated by price), L3 (per-order, with IDs). Queue position and cancel-vs-trade attribution need L3 or inference.
- Reconstruct the book from snapshot + incremental updates; verify sequence numbers, handle gaps/resyncs, and crossed/locked books. Use exchange timestamps and measure feed-vs-receive skew. Misaligned timestamps between book and trades create fake "predictive" signals.
- Equities: SIP vs. direct feeds differ in latency. Crypto: per-venue books, no consolidated tape; depth channels may be truncated or throttled.

- **Spread, depth, imbalance:** `I = (Qb - Qa)/(Qb + Qa)` at top-k levels. Weight levels by distance. Top-of-book imbalance is commonly reported to predict the next mid move over very short horizons, with an edge that decays fast and often does not survive spread and fees; test it.
- **Microprice (Stoikov 2018, "The micro-price: a high-frequency estimator of future prices", Quantitative Finance 18(12)):** martingale-based estimator of fair price conditioned on imbalance and spread; the common simple form is `(Pb*Qa + Pa*Qb)/(Qa+Qb)` (an approximation, not the full estimator).
- **Order flow imbalance, OFI (Cont, Kukanov, Stoikov 2014):** signed net of best-quote size changes; mid-price changes are approximately linear in OFI, with slope inversely related to depth. Prefer OFI over static imbalance for returns regressions.
- **Trade sign:** Lee-Ready is a classic inference on quote-trade data; in crypto use the venue's aggressor flag when given.
- Realized spread vs. effective spread vs. price impact: `effective = 2*s*(P - M0)/M0`, `realized = 2*s*(P - M_{t+Δ})/M0`, `impact = effective - realized`. Negative realized spread for a maker = adverse selection.

- Price-time priority: position = shares ahead at your price. Estimate fill probability from queue ahead, arrival rate of marketable orders, and cancel rates ahead of you (cancels ahead move you up). Pro-rata or size-priority venues (some futures) change this logic.
- Backtests that assume fill at touch ignore queue and overstate maker PnL. Model with a simulator calibrated on L3 or at least discount fills by queue-ahead/fill-rate.

## Requires

- Python 3
- L2/L3 order book data

## Known limitations

Educational analysis, not investment advice. Does not supply market data; regulatory dates should be re-checked.

## How to use this skill

1. Connect your AI agent to Agensi once: add the MCP server https://mcp.agensi.io/mcp/auth and sign in with your Agensi account (OAuth, no API key). Steps for Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and other agents: https://www.agensi.io/docs/mcp-setup
2. Ask your agent: "Use the orderbook-microstructure-analysis skill from Agensi" and describe your task.
3. Buy it on the listing or let your agent ask you first; your agent then loads it from Agensi when it needs it. Every paid skill has a money-back guarantee: https://www.agensi.io/docs/money-back-guarantee

## Frequently asked questions

### What does orderbook-microstructure-analysis do?

Analyze limit order books: imbalance, OFI, microprice, queue fills, VPIN toxicity, spoofing signs, and venue structure.

### Which AI agents support orderbook-microstructure-analysis?

This skill uses the open SKILL.md standard. Use it through an MCP-compatible agent connected to Agensi, and check the compatibility information on this page for confirmed agents and required capabilities.

### How do I use orderbook-microstructure-analysis?

Connect your AI agent to Agensi through MCP, then ask it to use orderbook-microstructure-analysis on your task. Your agent loads the latest approved version each time. Paid skills require a purchase or active subscription. Skill files are not available for download; your licence does not allow you to save, copy or export any part of a skill.

---

Source: [Agensi](https://www.agensi.io), the marketplace of skills for AI agents. Any MCP-compatible agent (Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and more) connects at https://mcp.agensi.io/mcp/auth and signs in with an Agensi account; setup for every agent: https://www.agensi.io/docs/mcp-setup. Append .md to any skill, guide or docs address on agensi.io for its markdown version.
