A quantitative study correlating the Crypto Fear & Greed Index with live trader behavior on the Hyperliquid exchange — and a data-driven strategy that improved per-trade profitability by 57.4%.
- Overview
- Key Results
- Dataset
- Strategy Logic
- Analysis Highlights
- Repository Structure
- Getting Started
- Visualizations
- Methodology
- Future Work
This project explores a fundamental question in crypto trading: does market sentiment measurably affect trader profitability, and can we exploit that relationship?
By merging 211,000+ trade records from the Hyperliquid perpetuals exchange with daily Fear & Greed Index readings, this analysis uncovers clear behavioral patterns across sentiment regimes — and engineers a filtering strategy that systematically avoids low-signal environments.
| Metric | Value |
|---|---|
| Total Trades Analyzed | 211,000+ |
| Baseline Avg. Closed PnL | $48.55 |
| Strategy Avg. Closed PnL | $76.43 |
| Performance Lift | +57.4% |
| Worst Sentiment Regime | Neutral ($34.31 avg PnL) |
Bottom line: Traders who avoid "Neutral" sentiment windows and align direction with extreme sentiment phases capture significantly higher per-trade returns.
| Source | Description |
|---|---|
historical_data.csv |
Raw trade records from Hyperliquid — includes timestamp, direction, size, and Closed PnL |
fear_greed_index.csv |
Daily Fear & Greed Index readings (0–100) with categorical labels |
submission_results.csv |
Merged and enriched output with sentiment classifications per trade |
Sentiment categories used: Extreme Fear · Fear · Neutral · Greed · Extreme Greed
The Smart Sentiment Engine applies three counter-cyclical rules derived from the data:
1. BUY → Prioritized during [ Extreme Fear ] and [ Fear ]
Contrarian accumulation when the crowd panic-sells.
2. SELL → Prioritized during [ Extreme Greed ]
Profit realization ahead of potential mean reversion.
3. SKIP → All activity filtered out during [ Neutral ]
Noise reduction — Neutral regimes show the lowest
signal-to-noise ratio across all sentiment bands.
This is a signal filter, not a standalone trading system. It is designed to be layered on top of any existing directional strategy to improve regime-adjusted performance.
| Sentiment | Avg Closed PnL | Signal Quality |
|---|---|---|
| Extreme Fear | High | ✅ Strong |
| Fear | Above Average | ✅ Good |
| Neutral | $34.31 | ❌ Weak |
| Greed | Above Average | ✅ Good |
| Extreme Greed | High | ✅ Strong (SELL bias) |
Neutral sentiment is not a safe middle ground — it produces the lowest average PnL of any category. This is attributed to elevated market noise and indecisive price action, resulting in a higher rate of marginal or losing trades. The strategy's single highest-impact rule is simply: stop trading when nobody has conviction.
.
├── solutions.py # Core processing script and strategy simulation
├── submission_results.csv # Merged dataset with sentiment classifications
├── pnl_sentiment.png # PnL distribution across sentiment categories
├── historical_data.csv # (Required) Raw Hyperliquid trade records
├── fear_greed_index.csv # (Required) Daily Fear & Greed Index data
└── README.md
- Python 3.8+
pandas,matplotlib,seaborn
pip install pandas matplotlib seabornPlace the following files in the project root before running:
historical_data.csv
fear_greed_index.csv
python solutions.pyThe script will:
- Load and merge both data sources on normalized timestamps
- Classify each trade by its corresponding sentiment regime
- Compute baseline vs. strategy-filtered PnL statistics
- Output
submission_results.csvandpnl_sentiment.png
pnl_sentiment.png — Distribution of average Closed PnL across each sentiment category, highlighting the performance gap between high-signal (Extreme Fear / Extreme Greed) and low-signal (Neutral) regimes.
| Step | Detail |
|---|---|
| Data Merging | Timestamp normalization to daily granularity via pandas; left-join on trade date |
| Sentiment Binning | Fear & Greed Index mapped to 5 standard categories per Alternative.me classification |
| Baseline | Mean Closed PnL across all 211K+ unfiltered trades |
| Strategy Filter | Subset trades matching directional + sentiment criteria; exclude Neutral regime entirely |
| Evaluation Metric | Mean Closed PnL per trade (strategy vs. baseline) |
- Intraday sentiment granularity — Hourly Fear & Greed proxies (funding rates, CVD) for sub-daily filtering
- Per-asset breakdown — Sentiment effectiveness may vary across BTC, ETH, and altcoin pairs
- Position sizing overlay — Scale size proportionally to sentiment extremity, not just binary on/off
- Backtested equity curve — Convert per-trade PnL lift into a time-series P&L curve with drawdown analysis
- Live signal integration — API hook to Alternative.me for real-time regime classification
This project is for research and educational purposes only. Past performance of any trading strategy does not guarantee future results. Nothing in this repository constitutes financial advice.