Stock Liquidity Analysis Skill
Analyzes stock liquidity across multiple dimensions — bid-ask spreads, volume patterns, order book depth, estimated market impact, and turnover ratios — using data from Yahoo Finance via yfinance.
Liquidity matters because it determines the real cost of trading. The quoted price is not what you actually pay — spreads, slippage, and market impact all eat into returns, especially for larger positions or less liquid names.
Important: This is for research and educational purposes only. Not financial advice. yfinance is not affiliated with Yahoo, Inc.
Step 1: Ensure Dependencies Are Available
Current environment status:
If DEPS_MISSING, install required packages:
If already installed, skip and proceed.
Step 2: Route to the Correct Sub-Skill
Classify the user's request and jump to the matching section. If the user asks for a general liquidity assessment without specifying a particular metric, run Sub-Skill A (Liquidity Dashboard) which computes all key metrics together.
Defaults
Sub-Skill A: Liquidity Dashboard
Goal: Produce a comprehensive liquidity snapshot combining all key metrics for one or more tickers.
A1: Fetch data and compute all metrics
A2: Interpret and present
Present as a summary card. For the Amihud illiquidity ratio, multiply by 1e9 for readability (standard convention).
Liquidity grade (use these rough thresholds for US equities):
When comparing multiple tickers, show a side-by-side table and highlight which is more liquid and why.
Sub-Skill B: Spread Analysis
Goal: Detailed bid-ask spread analysis including current spread, historical context from options data, and effective spread estimates.
B1: Current spread from quote
B2: Options spread context
Options data from yfinance includes bid/ask for each strike, which gives a sense of derivatives liquidity. Use the nearest expiration, extract near-the-money calls and puts, and compute spread and spread percentage for each.
See references/liquidity_reference.md § "Options Spread Analysis" for the full code template.
B3: Present results
Show:
- Current quoted spread (absolute, relative %, basis points)
- Bid/ask sizes if available
- Near-the-money options spreads for context
- How the spread compares to typical ranges for this market cap tier
Sub-Skill C: Volume Analysis
Goal: Analyze trading volume patterns — averages, trends, relative volume, and dollar volume.
C1: Compute volume metrics
C2: Present results
Show:
- Average daily volume (shares and dollar) with median for comparison
- Relative volume (RVOL) — today's volume vs. the average. RVOL > 1.5 is elevated; RVOL < 0.5 is unusually quiet
- Volume trend — is trading activity increasing or declining?
- Day-of-week pattern (if meaningful variation exists)
- Top 5 highest-volume days with context (earnings? news?)
Sub-Skill D: Order Book Depth
Goal: Estimate order book depth using available bid/ask data from the equity quote and options chain.
Yahoo Finance does not provide full Level 2 / order book data. Be upfront about this limitation. What we can do:
- Equity quote: bid, ask, bid size, ask size (top of book only)
- Options chain: bid/ask and open interest across strikes give a proxy for derivatives depth
- Intraday volume distribution: how volume is distributed within the day suggests how deep the continuous market is
D1: Gather available depth data
Collect three data points:
- Top of book — bid, ask, bidSize, askSize from
ticker.info - Intraday volume distribution — 5-min bars over the last 5 days, grouped by time-of-day and normalized to percentage of daily volume
- Options open interest — total call/put OI and volume from the nearest expiration as a derivatives depth proxy
See references/liquidity_reference.md § "Order Book Depth Proxy" for the full code template.
D2: Present results
Show:
- Top of book: current bid/ask with sizes
- Intraday volume shape: where volume concentrates (open/close vs. midday)
- Options depth: total open interest and volume as a proxy for derivatives liquidity
- Honest limitation: "Yahoo Finance provides top-of-book only. For full Level 2 depth, a direct market data feed (e.g., NYSE OpenBook, NASDAQ TotalView) is needed."
Sub-Skill E: Market Impact
Goal: Estimate how much a given order size would move the price, using the square-root market impact model.
The standard model in practice is: Impact (%) = σ × √(Q / V) where σ is daily volatility, Q is order size in shares, and V is average daily volume. This is a simplified version of the Almgren-Chriss framework used by institutional traders.
E1: Compute market impact estimate
E2: Present results
Show:
- The estimated impact for the user's specific order size
- An impact curve table showing how cost scales with order size
- Context: "This uses the square-root market impact model, a standard institutional estimate. Actual impact depends on execution strategy (VWAP, TWAP, etc.), time of day, and current market conditions."
- Above ~25 bps, note that the order is large for the stock's liquidity; above ~50 bps, flag it clearly and suggest the user consider algorithmic execution or splitting the order across days
Sub-Skill F: Turnover Ratio
Goal: Measure how actively a stock trades relative to its shares outstanding and free float.
F1: Compute turnover metrics
F2: Present results
Show:
- Daily and annualized turnover ratios (vs. outstanding and float)
- "Days to trade the float" — how many days at average volume to turn over the entire free float
- Turnover trend — is the stock becoming more or less actively traded?
- Context:
Step 3: Respond to the User
After running the appropriate sub-skill:
Always include
- The lookback period used for historical metrics
- The data timestamp — spreads and quotes are snapshots, not real-time
- Any tickers that returned empty data (invalid symbol, delisted, etc.)
Always caveat
- Yahoo Finance quote data has a 15-minute delay for most exchanges — spreads shown may not reflect the current live market
- Full order book (Level 2) data is not available through Yahoo Finance
- Market impact estimates are models, not guarantees — actual execution costs depend on strategy, timing, and market conditions
- Liquidity can change rapidly — a stock that's liquid today may not be tomorrow (especially around events, halts, or during extended hours)
Practical guidance (mention when relevant)
- Position sizing: If estimated impact exceeds ~25 bps, the position may be too large for the stock's liquidity (see the thresholds in Sub-Skill E)
- Small/micro-cap warning: Stocks with < $1M daily dollar volume require careful execution
- Spread costs compound: A 0.10% spread on a round-trip (buy + sell) costs 0.20% — this adds up for active strategies
- Illiquidity premium: Less liquid stocks historically earn higher returns as compensation — but the transaction costs can eat this premium
Present liquidity data and let the user make their own decisions; don't recommend specific trades.
Reference Files
references/liquidity_reference.md— Detailed formulas, extended code templates, metric interpretation guides, and academic references for all liquidity measures
Read the reference file when you need exact formulas, edge case handling, or deeper background on liquidity metrics.
