Analyze how Bitcoin market sentiment, measured by the Fear/Greed Index, relates to Hyperliquid trader behavior and performance.
.
├── analyze_trader_sentiment.py
├── data/
│ ├── fear_greed_index.csv
│ └── historical_data.csv
├── charts/
│ ├── avg_daily_pnl_by_sentiment.svg
│ ├── trade_frequency_by_sentiment.svg
│ ├── segment_pnl_per_trade.svg
│ └── daily_total_pnl.svg
├── outputs/
│ ├── data_profile.csv
│ ├── sentiment_performance_summary.csv
│ ├── segment_summary.csv
│ ├── daily_account_metrics.csv
│ ├── daily_market_metrics.csv
│ ├── account_segments.csv
│ └── top_accounts_by_pnl.csv
└── REPORT.md
- Install dependencies:
pip install pandas numpy- Place the two source CSV files in
data/:
data/fear_greed_index.csv
data/historical_data.csv
- Run the analysis:
python analyze_trader_sentiment.pyThe script regenerates all tables in outputs/, charts in charts/, and the written summary in REPORT.md.
- Standardized raw column names and parsed trader timestamps from
Timestamp IST. - Created a daily
datekey and joined trades to the Bitcoin Fear/Greed dataset by date. - Aggregated trade-level data to account-day level to reduce bias from very active accounts.
- Created performance metrics:
- daily PnL
- win rate
- PnL per trade
- PnL per $1k traded volume
- downside-PnL drawdown proxy
- Created behavior metrics:
- trades per account-day
- average trade size
- long/short share
- average position exposure proxy
- The source trader dataset does not contain an explicit leverage column, so
abs(start_position) * execution_priceis used as an exposure proxy.
- Average daily account PnL was highest on
Feardays and weakest onGreeddays. - Fear-side days had materially higher trade frequency than Greed-side days.
- Greed-side days had a higher average win rate, but lower average PnL than Fear-side days.
- The raw sentiment score has weak direct correlation with daily PnL, so it is better used as a risk-regime feature than as a standalone signal.
- Segmenting traders improves the story: infrequent traders had better PnL per trade than frequent traders, and consistent winners had better PnL per trade than inconsistent traders.
- Use sentiment as a risk filter. In weaker-performing regimes, especially
Greedin this sample, reduce exposure and require stronger confirmation before increasing trade frequency. - Apply segment-specific allocation. Prioritize trader archetypes with better PnL per trade, especially infrequent traders and consistent winners, while monitoring whether the advantage persists across sentiment regimes.
REPORT.md: concise written summary for submission.outputs/sentiment_performance_summary.csv: performance and behavior by sentiment classification.outputs/segment_summary.csv: account segment comparison.charts/avg_daily_pnl_by_sentiment.svg: core performance chart.charts/trade_frequency_by_sentiment.svg: behavior shift chart.charts/segment_pnl_per_trade.svg: segment comparison chart.