Guide · Agent skill
How to use the Market Microstructure Analysis agent skill
Updated · written with AI from the project's own documentation and checked against our catalogue data
The market-microstructure skill is a reference file that teaches an AI agent how prices form in financial markets: how wide bid-ask spreads are, how much a large order moves the price, how liquid a stock is, and whether informed traders may be active. It is for quantitative researchers, traders planning large orders, and students of market microstructure. After this guide you will know how to install the skill, how to phrase requests so the agent uses it, and what data and caveats to keep in mind.
Quick start
- 1Download the ZIP. Download the market-microstructure ZIP from this page.
- 2Unzip the folder. Extract it so the market-microstructure folder containing SKILL.md is in ~/.claude/skills/ or a project's .claude/skills/ folder.
- 3Or upload in the Claude apps. In the Claude apps, open Settings, go to Capabilities and upload the skill under Skills.
- 4Gather your data. Prepare trade, quote or daily volume data for the instrument and period you are studying.
- 5Ask a trading-cost question. Describe the task in microstructure terms, such as estimating spread or price impact for a specific order size.
- 6Check the assumptions. Review the coefficients, volatility and thresholds the agent used before relying on the result.
What is an agent skill, and what does this one make the agent do?
An agent skill is a folder containing a SKILL.md file with instructions and reference knowledge that an AI agent loads when a task matches it. This skill, named market-microstructure, is a reference of formulas and rules of thumb rather than a live data feed. It does not itself pull market data.
Once installed, the agent can use these methods when you ask about trading costs or execution: quoted, effective and realized spreads; VPIN and Kyle's lambda for order-flow toxicity; Amihud and Roll measures for liquidity; a power-law and square-root price-impact model; limit-order-book depth and imbalance; and China A-share specifics such as call auctions and block trades. The aim is to replace a flat fee assumption with a more realistic cost estimate.
- Estimate transaction costs for a backtest instead of assuming a flat 0.1% fee
- Plan how to split a large order using TWAP, VWAP or implementation shortfall (IS)
- Flag time windows where order flow may be dominated by informed traders
- Measure liquidity risk and warning signs of a flash crash
Install the market-microstructure skill
Download the ZIP for this skill from this page. Unzip it so that the market-microstructure folder, containing SKILL.md, ends up in one of two places: ~/.claude/skills/ to make it available across your projects, or a project's .claude/skills/ folder to limit it to that project.
If you use the Claude apps instead, open Settings, go to Capabilities, and upload the skill under Skills.
- Personal install: place the folder in ~/.claude/skills/
- Project install: place the folder in the project's .claude/skills/ folder
- Claude apps: Settings → Capabilities → Skills, then upload
Trigger the skill with natural requests
You do not need a special command. Describe the task in trading terms and mention the metric or situation you care about. The skill's description covers bid-ask spreads, VPIN, Kyle lambda, Amihud and Roll measures, price impact, limit-order-book analysis, and China A-share call auction and block trade mechanics, so requests that use these terms are the most likely to match.
Give the agent the data you have. The calculations need trade, quote or daily volume data, which the skill does not supply.
- "Estimate the round-trip cost for my backtest on 000001.SZ using a spread-based model."
- "How much would selling 100,000 shares of a small-cap stock move its price, given 500,000 shares average daily volume and 3% daily volatility?"
- "Compute the Amihud illiquidity measure for these monthly daily returns and volumes."
- "Suggest a TWAP versus VWAP plan to sell this position over three days."
- "Explain what VPIN measures and how to calculate it from my tick data."
Worked example: price impact of a large order
The skill gives a power-law impact formula, impact = η × σ × (Q / V)^0.6, where η is an impact coefficient (about 0.5 to 1.5 for China A-shares), σ is daily volatility, Q is the traded quantity and V is average daily volume. The source's example sells 100,000 shares of a large-cap stock with 5,000,000 shares average daily volume and 1.8% daily volatility, giving roughly 1.5 basis points of impact. The same 100,000 shares in a small-cap stock with 500,000 shares average daily volume and 3.0% volatility gives about 23 basis points, which the source says should be executed in slices.
A square-root model, impact = σ × √(Q / (ADV × T)), is listed for large trades where Q/ADV is above 5%.
impact = 1.0 × 0.018 × (100000/5000000)^0.6 = 0.015% (1.5bp)
impact = 1.0 × 0.03 × (100000/500000)^0.6 = 0.23% (23bp)Requirements and what you must supply
The skill lists no required software or tools. It runs no scripts and uses no network access. What it does need is data from you: for example, trade and quote data for VPIN or spread measures, and daily prices and volumes for Amihud, Roll or the impact formulas. The source's impact section names a tested implementation, src.quantlib.impact.sqrt_impact, in the wider repository, but this skill file itself is formulas and text.
- Required tools or software: none listed
- Scripts: none run by the skill
- Network: none used by the skill
- Your input: trade, quote or daily volume data for the calculations
Safety notes before you rely on the output
The thresholds in the file are simplified heuristics. For example, it says a VPIN above 0.5 means major news is about to be released, and the skill itself gives no evidence those cutoffs are reliable. Do not use them to make real trading decisions on their own. The order-book imbalance signal is also noted as needing filtering, because large orders are often added and canceled in China A-shares.
The skill does not implement a full Almgren-Chriss optimal execution. It gives no trading trajectory and no risk-aversion parameter. Treat outputs as estimates to check against your own data and assumptions.
- Do not treat VPIN, OIR or ILLIQ cutoffs as validated predictions
- Check any execution plan against your own data before trading
- The skill is not designed for production high-frequency systems
Tips for better results
Name the instrument, market and time window, and say which data you have. Specify whether you need a quick estimate or a calculation you can reproduce. Ask the agent to state its assumptions, such as the impact coefficient or the volatility figure it used, so you can change them.
- Always give the stock code and the period covered by your data
- Provide the exact inputs (volume, volatility, quantity) rather than rough descriptions
- Ask the agent to show the formula it applied and the numbers it substituted
- Compare results across a few impact coefficients, since the source gives a range rather than one value
What people use it for
- Replacing a flat fee assumption with spread and impact-based costs in a quantitative backtest
- Planning how to split a large sell order over several days using TWAP, VWAP or implementation shortfall
- Assessing whether a small-cap stock has enough liquidity using the Amihud illiquidity measure
- Studying how Kyle's lambda and VPIN are defined and calculated for coursework
- Reviewing a China A-share stock's order book depth across the trading day
Frequently asked questions
How do I install the market-microstructure agent skill?
Download the ZIP from this page and unzip it so the market-microstructure folder with SKILL.md sits in ~/.claude/skills/ or a project's .claude/skills/ folder. In the Claude apps, you can instead upload it under Settings → Capabilities → Skills.
Does this skill require any software, scripts or internet access?
The listing shows no required tools, no scripts run and no network use. The skill is a reference file of formulas and rules, so you must supply your own trade, quote or volume data.
Is the market-microstructure skill free to use?
The source repository is licensed under MIT. This page does not state any price, so check the licence text in the repository for the terms that apply.
Does the skill pull live market data for me?
No. The file describes formulas and says it does not itself pull live market data. You need to provide the data the calculations require.
Can I use VPIN above 0.5 as a signal to trade?
The file says VPIN above 0.5 means high probability that major information is about to be released, but these cutoffs are simplified heuristics and the skill gives no evidence they are reliable. Do not make real trading decisions on that basis alone.
How does this compare with a simple flat-fee assumption or a full execution optimiser?
A flat fee ignores market conditions, while this skill adds spread, impact and liquidity estimates based on your data. It does not implement full Almgren-Chriss optimal execution, which needs a trading trajectory and risk-aversion parameter that this skill does not compute.
New agent skills, repos and AI tools — every week
The best new skills and open-source projects, the fastest-growing repos, and one free prompt. Five minutes to read. Unsubscribe anytime.
Our verdict
Use this skill if you are a quantitative researcher or trader who wants more realistic transaction-cost and execution estimates, or a student learning VPIN, Kyle's lambda and the Amihud measure. Pick something else if you need investment advice, live market data, or verified production code for high-frequency execution, since this file is formulas and heuristics that you must check against your own data.
Download the skill