Stock LiquiditySAFE
A collection of skills for AI financial analysis.
Overview
From the repository's own README, as read at the audited commit. Badges and raw HTML are left out.
Analyze stock liquidity across multiple dimensions using Yahoo Finance data — bid-ask spreads, volume profiles, order book depth estimates, market impact modeling, and turnover ratios.
Triggers
- "how liquid is AAPL"
- "bid-ask spread for TSLA"
- "volume analysis for MSFT"
- "order book depth"
- "how much would 50k shares move the price"
- "market impact of a $1M order"
- "turnover ratio for GME"
- "slippage estimate"
- "compare liquidity between stocks"
- "is this stock liquid enough to trade"
- "Amihud illiquidity ratio"
- "average daily dollar volume"
Platform
All platforms (CLI + Claude.ai with code execution enabled)
Prerequisites
- Python 3.8+
yfinance,pandas,numpy(auto-installed if missing)
Sub-Skills
Reference Files
references/liquidity_reference.md— Detailed formulas, code templates, metric interpretation guides, edge cases, and yfinance field reference
317cbce031f1OBSERVED · 2026-10-08What it tells the agent
The instruction file, verbatim from the audited commit — this is the text the model reads, and the surface the audit's instruction layer examines. Quoted here so you can judge it without cloning anything.
---
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](https://github.com/ranaroussi/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:
```python
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
```python
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_voTrust audit
SAFEgrade B · trust 89/100 Nothing in the source contradicts what it says it does. Grade A is reserved for packages that have also passed the behavioural sandbox.
| Layer | What it checks | Result |
|---|---|---|
| L0 | Provenance & inventory | PASS |
| L1 | Static analysis of the code | NA |
| L2 | Instruction surface (what it tells the agent) | PASS |
| L3 | Class-specific surface | PASS |
| L4 | Behavioural (sandbox) | SKIPPED |
What the source does
- Filesystem
- none-observed
- Network
- none-observed
- Shell
- none-observed
- Dependencies
- pinned
- Secrets in source
- none-found
Findings (0)
No findings outside the package's declared scope.
Gates applied: no_behavioural_pass.
317cbce031f1full audit observations/trust-audit/skill/himself65__stock-liquidity.json · Report an issue / request a re-scanAudit history
Every audit this skill has had.
| Date | Source | Verdict | Grade | Score | Change |
|---|---|---|---|---|---|
| 2026-10-08 | 317cbce031f1 | SAFE | B | 89 | first audit |
Questions
What does the Stock Liquidity skill do?
A collection of skills for AI financial analysis.
Is Stock Liquidity safe to install?
The audit found nothing in the source that contradicts what it says it does, and graded it B (89/100). Grade A is held back for packages that have also passed a sandboxed behavioural run, which is why a clean skill reads B.
What can Stock Liquidity access on my machine?
The audit observed no filesystem, network or shell use at all in its source.
How current is this page?
The grade is for one exact copy of the source (317cbce031f1), read on 2026-10-08. The repository is watched, and a new audit runs when it changes — this is the first audit.