agiprolabs/claude-trading-skills/market-microstructure
Claude Code and agent skill by agiprolabs/claude-trading-skills
- community
Checking that the SKILL.md file is still in the repository.
DEX orderflow analysis, trade classification, buyer/seller pressure, and microstructure signals for Solana tokens
Install
npx vskill@latest install agiprolabs/claude-trading-skills/market-microstructureSKILL.md
The same SKILL.md was published earlier as serennity007/claude-trading-skills-67/market-microstructure.
Market Microstructure — DEX Orderflow Analysis
Overview
Market microstructure on Solana DEXes differs fundamentally from traditional finance. There are no orderbooks on AMMs — every trade is a swap against a liquidity pool. Yet trade flow analysis remains powerful: the sequence, size, and direction of swaps reveal accumulation, distribution, whale activity, and wash trading patterns.
This skill covers:
- Trade classification — identifying buys vs sells from swap direction
- Volume profiles — time-based and size-based breakdowns
- Buyer/seller pressure — ratio metrics, net flow, trade count asymmetry
- Trade size distribution — whale detection, retail vs institutional flow
- Flow momentum signals — acceleration, volume spikes, composite scores
- Token velocity — turnover rate as a sentiment proxy
- Wash trading detection — spotting fake volume and bot patterns
Why Microstructure Matters on DEXes
On CEXes, microstructure means orderbook depth, bid-ask spread, and queue position. On AMMs, liquidity sits in pool curves — there is no spread or queue. But the trade tape (the chronological list of swaps) contains rich signal:
- Who is trading? — Whale wallets vs retail, smart money vs bots
- How are they trading? — Large single swaps vs DCA-style splits
- When are they trading? — Volume clustering around events or time zones
- What direction? — Net buy vs sell pressure over sliding windows
These signals feed into entry/exit timing, position sizing, and token quality scoring.
Trade Classification
Buy vs Sell Identification
On Solana DEXes, every swap has an input token and output token:
| Swap Direction | Classification | Meaning | |
|---|---|---|---|
| SOL → Token | Buy | Trader spending SOL to acquire token | |
| USDC → Token | Buy | Trader spending stables to acquire token | |
| Token → SOL | Sell | Trader converting token back to SOL | |
| Token → USDC | Sell | Trader converting token to stables | |
| Token A → Token B | Context-dependent | Classify based on which token you're analyzing |
From API Data Sources
Birdeye Trade History (/defi/txs/token):
- Returns
sidefield:"buy"or"sell" - Includes
from(input token) andto(output token) amounts
DexScreener Pair Trades:
- Returns
typefield indicating swap direction relative to the pair
Helius Parsed Transactions:
- Parse swap instructions to extract input/output mints and amounts
- Classify based on which mint matches your target token
See references/trade_classification.md for detailed classification logic and size buckets.
Volume Profiles
Time-Based Profiles
Aggregate trade volume into fixed time buckets to identify patterns:
Key metrics from time profiles:
- Peak hours — when is the token most actively traded?
- Volume trend — is volume increasing, decreasing, or stable?
- Volume anomalies — spikes exceeding 3x the rolling average
Size-Based Profiles
Classify trades into size buckets to separate whale activity from retail:
| Bucket | SOL Range | Typical Actor | |
|---|---|---|---|
| Micro | < 0.1 SOL | Dust / test trades | |
| Small | 0.1 – 1 SOL | Retail traders | |
| Medium | 1 – 10 SOL | Active traders | |
| Large | 10 – 50 SOL | Serious positions | |
| Whale | 50+ SOL | Whales / institutions |
Buyer/Seller Pressure Metrics
Core Ratios
Signal Interpretation
| Metric | Bullish | Neutral | Bearish | |
|---|---|---|---|---|
| Buy Volume % | > 60% | 40–60% | < 40% | |
| Net Flow | Positive, increasing | Near zero | Negative, increasing | |
| Trade Count Ratio | > 0.55 | 0.45–0.55 | < 0.45 | |
| Large Trade Ratio | High buy-side | Balanced | High sell-side |
See references/flow_signals.md for the full signal catalog and composite scoring.
Trade Size Distribution
Analyzing the distribution of trade sizes reveals market structure:
Interpreting skew: A skew_indicator (mean/median) well above 1.0 indicates a fat-tailed distribution — a few large trades dominate. This is normal for tokens with whale interest but can also signal manipulation.
Momentum Signals from Trade Flow
Volume Acceleration
Compare current period volume to the previous period:
- acceleration > 2.0 — volume surge, potential breakout or dump
- acceleration 0.8–1.2 — stable activity
- acceleration < 0.5 — dying interest
Buy Pressure Acceleration
Track how the buy ratio changes over time:
Positive buy_momentum with increasing volume is a strong accumulation signal.
Token Velocity
Token velocity measures how frequently tokens change hands:
| Velocity | Interpretation | |
|---|---|---|
| < 0.01 | Low activity, illiquid, or strong holders | |
| 0.01–0.05 | Normal trading activity | |
| 0.05–0.20 | Active trading, possible speculation | |
| > 0.20 | Very high turnover, potential wash trading |
High velocity combined with low unique trader count is a wash trading red flag.
Wash Trading Detection
Wash trading inflates volume to make a token appear more active than it truly is. Key detection signals:
- Low unique trader ratio —
unique_wallets / trade_count < 0.3 - Volume/TVL anomaly —
daily_volume / tvl > 10(volume vastly exceeds liquidity) - Uniform trade sizes — low entropy in trade size distribution
- Self-trading — same wallet on both sides within short windows
- Funded-together clusters — multiple wallets funded from the same source
See references/wash_trading.md for detailed detection methods and scoring.
Data Sources
Birdeye API
Primary source for trade history on Solana tokens:
GET /defi/txs/token— recent trades for a tokenGET /defi/ohlcv— candle data with volumeGET /defi/price/volume— aggregated volume data
Requires API key. See the birdeye-api skill for endpoint details.
DexScreener API
Free, no-auth alternative for pair-level data:
GET /latest/dex/tokens/{address}— token pairs with volumeGET /latest/dex/pairs/solana/{pairAddress}— pair details
Helius API
For wallet-level trade analysis and parsed transactions:
- Parse swap transactions to extract trade details
- Attribute trades to specific wallets
- See the
helius-apiskill for transaction parsing.
Composite Momentum Score
Combine multiple flow signals into a single score (range: -100 to +100):
| Score Range | Interpretation | |
|---|---|---|
| +60 to +100 | Strong accumulation — heavy buy pressure | |
| +20 to +60 | Moderate buying — cautious accumulation | |
| -20 to +20 | Neutral / balanced flow | |
| -60 to -20 | Moderate selling — distribution underway | |
| -100 to -60 | Strong distribution — heavy sell pressure |
Integration with Other Skills
| Skill | How It Connects | |
|---|---|---|
birdeye-api | Primary data source for trade history and volume | |
helius-api | Wallet-attributed trade data from parsed transactions | |
liquidity-analysis | Volume/TVL ratios, liquidity context for flow signals | |
whale-tracking | Identify whale wallets for large trade attribution | |
token-holder-analysis | Supply distribution context for velocity metrics | |
position-sizing | Use flow signals to adjust entry sizing | |
regime-detection | Combine flow momentum with regime classification |
Files
References
references/trade_classification.md— Buy/sell classification logic, size buckets, aggregationreferences/flow_signals.md— Complete signal catalog with formulas and interpretationreferences/wash_trading.md— Detection methods, metrics, and risk scoring
Scripts
scripts/trade_flow_analysis.py— Fetch trades, classify, compute flow signals and momentumscripts/volume_profile.py— Hourly volume profiles, trend detection, anomaly identification
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/market-microstructure/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/agiprolabs/claude-trading-skills/market-microstructure)