This project analyzes historical trader data from Hyperliquid and the Bitcoin Fear & Greed Index to explore how trader behavior aligns with market sentiment. The goal is to uncover actionable patterns that can lead to smarter, data-driven trading strategies.
- Two primary datasets were used:
- Hyperliquid trader data (PnL, leverage, side, execution details, etc.)
- Bitcoin Fear & Greed Index (daily sentiment classification and scores)
- Dates were standardized to daily granularity to enable accurate merging.
- The
Timestamp ISTfield in the trader dataset was converted to date-only format. - Both datasets were merged using this date field as a key.
- Numerical fields like
Closed PnLandFeewere cleaned and converted to appropriate types.
- Visualization: Line chart of the sentiment score over time.
- Insight: Shows how market emotions evolved over the observed period. Peaks and dips indicate shifts in market psychology.
- Visualization: Scatterplot of sentiment scores color-coded by classification.
- Insight: Highlights distinct sentiment phases and their frequency over time.
- Visualization: Bar chart showing the count of each sentiment type.
- Insight: Fear and Extreme Fear dominate the dataset, indicating a market frequently in pessimistic phases.
- Visualization: Bar chart of average
Closed PnLby sentiment classification. - Insight:
- Traders tend to perform better during 'Fear' and 'Extreme Fear'.
- Performance significantly drops during Greed phases.
- Visualization: Bar chart of average trading fees by sentiment.
- Insight:
- Higher fees are observed during Greed and Extreme Greed, indicating increased trading activity and possibly emotional, FOMO-driven trades.
- Visualization: Grouped bar chart comparing Buy vs. Sell performance across sentiments.
- Insight:
- Buy orders during Fear are consistently profitable.
- Sell orders during Greed outperform buy orders.
- Validates a contrarian strategy: "Buy the Fear, Sell the Greed."
- Visualization: Bar chart of the number of trades executed under each sentiment.
- Insight:
- Trading activity spikes during both Extreme Fear and Extreme Greed.
- Traders are most active during emotional extremes, often when markets are most volatile.
- Traders tend to perform better on average during Fear periods, especially with Buy orders.
- Fees and risk appetite increase significantly during Greed, indicating heightened emotional trading.
- A Contrarian Strategy (Buy during Fear, Sell during Greed) statistically yields better performance.
- Trader activity clusters around emotional extremes, where market participants are most active and potentially most vulnerable.
This analysis demonstrates that market psychology directly affects trader behavior and profitability. Incorporating sentiment-aware strategies can significantly improve risk-adjusted returns.
- Contrarian Signal Model: Focus on buying in "Extreme Fear" and taking profits or short positions in "Extreme Greed."
- Dynamic Leverage Management: Advise traders to reduce leverage in greedy markets to minimize exposure.
- Trader Education: Use sentiment-driven insights to help traders avoid FOMO and emotional decision-making.
historical_trader_data.csv– Raw trader datafear_greed_index.csv– Bitcoin sentiment datatrader_sentiment_analysis_full.ipynb– Full analysis notebookvisual_1_fear_greed_over_time.pngvisual_2_sentiment_classifications.pngvisual_3_sentiment_distribution.pngvisual_4_avg_pnl_by_sentiment.pngvisual_5_trader_activity_by_sentiment.png📄 Download Full Analysis Report (PDF)
Ayush Raj
Data Science Project: Trader Behavior and Market Sentiment