SkillAgentSearch skills...

stock-liquidity

Analyze how liquid a stock is using Yahoo Finance data (yfinance): bid-ask spreads, volume and dollar volume (ADTV), top-of-book and options depth, square-root market impact and slippage estimates, turnover ratio, and Amihud illiquidity, rolled into a liquidity grade.

Install / Use

npx skills add himself65/finance-skills --skill stock-liquidity

Installs into whichever agent you are using.

About this skill
๐Ÿ“„

SKILL.md

Installable skill definition

Quality Score

95/100

Category

Marketing

Supported Platforms

Universal

Tags

Our assessment of stock-liquidity

stock-liquidity scores 95/100 on our quality scale, 83rd of 642 Marketing skills we index (top 13%).

Its SKILL.md is 19 KB long, well organised into 28 sections with 7 code examples: a thorough specification that gives an agent plenty to work with.

With 3,348 GitHub stars, it is one of the more widely adopted skills in the catalogue.

Substance
30/30
Structure
20/20
Description
15/15
Adoption
15/20
Freshness
15/15

Maintenance, license and trust

  • The repository was last updated about 3 months ago, so stock-liquidity is actively maintained.
  • Our last check on 2026-11-16 found the source still online.
  • It is released under the MIT license, a permissive license that allows use, modification and commercial use with attribution.
  • Its trust signals score 100/100, with no cautions. These come from repository metadata, not a code audit โ€” read the skill file before letting an agent act on it.

Safety scan

No issues found

Our scan of the whole file found no instruction hijacking, hidden characters, credential access, data exfiltration or destructive commands. An AI review of the same text found nothing harmful.

AI review by kimi-k2.7-code on 2026-10-02. Automated pattern scan on 2026-10-02. It catches known dangerous patterns, not every risk โ€” read a skill before letting an agent act on it.

stock-liquidity compared with similar skills

All 4 of these similar skills score higher than stock-liquidity; compare them before choosing.

SkillScoreStarsUpdatedFormat
stock-liquidity (this skill)by himself65953.3k3mo agoSKILL.md
x402by browser-use100121.0k3d agoSKILL.md
algorithmic-artby anthropics100177.9k55d agoSKILL.md
pptxby anthropics100177.9k55d agoSKILL.md
designby nextlevelbuilder100149.0k6d agoSKILL.md

Frequently asked questions

How do I install stock-liquidity?
Run npx skills add himself65/finance-skills --skill stock-liquidity. The install tabs above show the steps for each supported agent.
Which AI agents does stock-liquidity work with?
It is written for Universal, as a SKILL.md file. Other agents that read the same format can often use it too.
Is stock-liquidity safe to use?
Our scan of the whole file found no instruction hijacking, hidden characters, credential access, data exfiltration or destructive commands. An AI review of the same text found nothing harmful. It is MIT-licensed and scores 100/100 on trust signals. Skills are instructions an agent will follow, so read the file before installing it and do not approve commands you do not understand.
Is stock-liquidity still maintained?
The repository was last updated about 3 months ago, so stock-liquidity is actively maintained.

name: stock-liquidity description: > Analyze how liquid a stock is using Yahoo Finance data (yfinance): bid-ask spreads, volume and dollar volume (ADTV), top-of-book and options depth, square-root market impact and slippage estimates, turnover ratio, and Amihud illiquidity, rolled into a liquidity grade. Use this skill whenever the user asks about liquidity or trading costs โ€” how easily a position can be entered or exited, what a large order would do to the price, spread or execution-cost estimates, order book depth, volume patterns, or liquidity comparisons โ€” especially for small caps, penny stocks, and thinly traded names.

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:

!`python3 -c "exec('try:\n import yfinance, pandas, numpy\n print(f\'yfinance={yfinance.__version__} pandas={pandas.__version__} numpy={numpy.__version__}\')\nexcept Exception:\n print(\'DEPS_MISSING\')')"`

If DEPS_MISSING, install required packages:

import subprocess, sys
subprocess.check_call([sys.executable, "-m", "pip", "install", "-q", "yfinance", "pandas", "numpy"])

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.

| User Request | Route To | Examples | |---|---|---| | General liquidity check, "how liquid is X" | Sub-Skill A: Liquidity Dashboard | "how liquid is AAPL", "liquidity analysis for TSLA", "is this stock liquid enough" | | Bid-ask spread, trading costs, effective spread | Sub-Skill B: Spread Analysis | "bid-ask spread for AMD", "what's the spread on NVDA options", "trading cost estimate" | | Volume, ADTV, dollar volume, volume profile | Sub-Skill C: Volume Analysis | "volume analysis MSFT", "average daily volume", "volume profile for SPY" | | Order book depth, market depth, level 2 | Sub-Skill D: Order Book Depth | "order book depth for AAPL", "market depth", "show me the book" | | Market impact, slippage, execution cost for large orders | Sub-Skill E: Market Impact | "how much would 50k shares move the price", "slippage estimate", "market impact of $1M order" | | Turnover ratio, trading activity relative to float | Sub-Skill F: Turnover Ratio | "turnover ratio for GME", "float turnover", "how actively traded is this" | | Compare liquidity across multiple stocks | Sub-Skill A (multi-ticker mode) | "compare liquidity AAPL vs TSLA", "which is more liquid AMD or INTC" |

Defaults

| Parameter | Default | |---|---| | Lookback period | 3mo (3 months) | | Data interval | 1d (daily) | | Market impact model | Square-root model | | Intraday interval (when needed) | 5m |


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

import yfinance as yf
import pandas as pd
import numpy as np

def liquidity_dashboard(ticker_symbol, period="3mo"):
    ticker = yf.Ticker(ticker_symbol)
    info = ticker.info
    hist = ticker.history(period=period)

    if hist.empty:
        return None

    # --- Spread metrics (from current quote) ---
    bid = info.get("bid", None)
    ask = info.get("ask", None)
    current_price = info.get("currentPrice") or info.get("regularMarketPrice") or hist["Close"].iloc[-1]

    spread = None
    spread_pct = None
    if bid and ask and bid > 0 and ask > 0:
        spread = round(ask - bid, 4)
        midpoint = (ask + bid) / 2
        spread_pct = round((spread / midpoint) * 100, 4)

    # --- Volume metrics ---
    avg_volume = hist["Volume"].mean()
    median_volume = hist["Volume"].median()
    avg_dollar_volume = (hist["Close"] * hist["Volume"]).mean()
    volume_std = hist["Volume"].std()
    volume_cv = volume_std / avg_volume if avg_volume > 0 else None  # coefficient of variation

    # --- Turnover ratio ---
    shares_outstanding = info.get("sharesOutstanding", None)
    float_shares = info.get("floatShares", None)
    base_shares = float_shares or shares_outstanding
    turnover_ratio = round(avg_volume / base_shares, 6) if base_shares else None

    # --- Amihud illiquidity ratio ---
    # Average of |daily return| / daily dollar volume
    returns = hist["Close"].pct_change().dropna()
    dollar_volume = (hist["Close"] * hist["Volume"]).iloc[1:]  # align with returns
    amihud_values = returns.abs() / dollar_volume
    amihud = amihud_values[amihud_values.replace([np.inf, -np.inf], np.nan).notna()].mean()

    # --- Market impact estimate (square-root model) ---
    # For a hypothetical order of 1% of ADV
    adv = avg_volume
    order_size = adv * 0.01
    daily_volatility = returns.std()
    sigma = daily_volatility
    participation_rate = order_size / adv if adv > 0 else 0
    impact_bps = sigma * np.sqrt(participation_rate) * 10000  # in basis points

    return {
        "ticker": ticker_symbol,
        "current_price": round(current_price, 2),
        "bid": bid,
        "ask": ask,
        "spread": spread,
        "spread_pct": spread_pct,
        "avg_daily_volume": int(avg_volume),
        "median_daily_volume": int(median_volume),
        "avg_dollar_volume": round(avg_dollar_volume, 0),
        "volume_cv": round(volume_cv, 3) if volume_cv else None,
        "shares_outstanding": shares_outstanding,
        "float_shares": float_shares,
        "turnover_ratio": turnover_ratio,
        "amihud_illiquidity": round(amihud * 1e9, 4) if not np.isnan(amihud) else None,
        "daily_volatility": round(daily_volatility * 100, 2),
        "impact_1pct_adv_bps": round(impact_bps, 2),
        "observations": len(hist),
    }

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):

| Grade | Avg Dollar Volume | Spread (%) | Amihud (ร—10โน) | |---|---|---|---| | Very High | > $500M/day | < 0.03% | < 0.01 | | High | $50Mโ€“$500M/day | 0.03โ€“0.10% | 0.01โ€“0.1 | | Moderate | $5Mโ€“$50M/day | 0.10โ€“0.50% | 0.1โ€“1.0 | | Low | $500Kโ€“$5M/day | 0.50โ€“2.00% | 1.0โ€“10 | | Very Low | < $500K/day | > 2.00% | > 10 |

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

import yfinance as yf

def spread_analysis(ticker_symbol):
    ticker = yf.Ticker(ticker_symbol)
    info = ticker.info

    bid = info.get("bid", 0)
    ask = info.get("ask", 0)
    bid_size = info.get("bidSize", None)
    ask_size = info.get("askSize", None)
    current_price = info.get("currentPrice") or info.get("regularMarketPrice", 0)

    result = {"bid": bid, "ask": ask, "bid_size": bid_size, "ask_size": ask_size}

    if bid > 0 and ask > 0:
        midpoint = (bid + ask) / 2
        result["absolute_spread"] = round(ask - bid, 4)
        result["relative_spread_pct"] = round((ask - bid) / midpoint * 100, 4)
        result["relative_spread_bps"] = round((ask - bid) / midpoint * 10000, 2)
    return result

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

import yfinance as yf
import pandas as pd
import numpy as np

def volume_analysis(ticker_symbol, period="3mo"):
    ticker = yf.Ticker(ticker_symbol)
    hist = ticker.history(period=period)

    if hist.empty:
        return None

    vol = hist["Volume"]
    close = hist["Close"]
    dollar_vol = vol * close

    # Relative volume (today vs average)
    rvol = vol.iloc[-1] / vol.mean() if vol.mean() > 0 else None

    # Volume trend (linear regression slope over the period)
    x = np.arange(len(vol))
    slope, _ = np.polyfit(x, vol.values, 1) if len(vol) > 1 else (0, 0)
    trend_pct = (slope * len(vol)) / vol.mean() * 100  # % change over period

    # Volume profile by day of week
    hist_copy = hist.copy()
    hist_copy["DayOfWeek"] = hist_copy.index.dayofweek
    day_names = {0: "Mon", 1: "Tue", 2: "Wed", 3: "Thu", 4: "Fri"}
    vol_by_day = hist_copy.groupby("DayOfWeek")["Volume"].mean()
    vol_by_day.index = vol_by_day.index.map(day_names)

    # High/low volume days
    high_vol_days = hist.nlargest(5, "Volume")[["Close", "Volume"]]
    low_vol_days = hist.nsmallest(5, "Volume")[["Close", "Volume"]]

    return {
        "avg_volume": int(vol.mean()),
        "median_volume": int(vol.median()),
        "avg_dollar_volume": round(dollar_vol.mean(), 0),
        "current_volume": int(vol.iloc[-1]),
        "relative_volume": round(rvol, 2) if rvol else None,
        "volume_trend_pct": round(trend_pct, 1),
        "volume_by_day": vol_by_day.to_dict(),
        "high_vol_days": high_vol_days,
        "low_vol_days": low_vol_days,
        "max_volume": int(vol.max()),
        "min_volume": int(vol.min()),
    }

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:

  1. Equity quote: bid, ask, bid size, ask size (top of book only)
  2. Options chain: bid/ask and open interest across strikes give a proxy for derivatives depth
  3. 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:

  1. Top of book โ€” bid, ask, bidSize, askSize from ticker.info
  2. Intraday volume distribution โ€” 5-min bars over the last 5 days, grouped by time-of-day and normalized to percentage of daily volume
  3. 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:

  • **To

Truncated for display โ€” read the full file on GitHub.

Related Skills

View on GitHub
GitHub Stars3.3k
CategoryMarketing
Updated2mo ago
Forks381

Languages

JavaScript

Trust signals

100/100

From repository metadata: license, adoption, age and documentation. Not a code audit โ€” see the Safety scan above for what the skill file itself contains.

No cautions
stock-liquidity โ€” Universal Skill: Install & Safety Check | SkillAgent