This project analyzes the relationship between Bitcoin market sentiment (Fear vs Greed) and trader behavior and performance on Hyperliquid.
The objective is to identify patterns that could help design better trading strategies based on market sentiment.
This work was completed as part of the Data Science / Analytics Intern – Round 0 Assignment for Primetrade.ai.
Trader-Sentiment-Analysis
trader_sentiment_analysis.ipynb → Data analysis notebook
dashboard.py → Streamlit dashboard
processed_trader_sentiment_data.csv → Cleaned merged dataset
fear_greed_index.csv → Market sentiment dataset
historical_trader_data.csv → Hyperliquid trading dataset
requirements.txt → Python dependencies
README.md → Project documentation
Columns:
- Date
- Classification (Fear / Greed)
This dataset represents the overall Bitcoin market sentiment for each day.
Fields include:
- account
- symbol
- execution price
- size
- side
- time
- leverage
- closedPnL
This dataset represents historical trading activity on Hyperliquid.
Steps performed during preprocessing:
- Loaded both datasets using pandas
- Checked dataset shape (rows and columns)
- Checked for missing values and duplicates
- Converted timestamps to datetime format
- Extracted date values from trade timestamps
- Aggregated trading data to daily level
- Merged trader dataset with sentiment dataset using the Date column
The following metrics were calculated to analyze trader behavior:
- Daily PnL
- Win rate
- Average trade size
- Leverage distribution
- Number of trades per day
- Long/Short ratio
These metrics help evaluate both trader performance and behavior patterns.
The analysis focuses on answering the following questions:
- Does trader performance differ between Fear vs Greed days?
- Do traders change behavior based on market sentiment?
- Can traders be segmented into meaningful behavioral groups?
Traders were segmented into behavioral groups such as:
- High leverage vs Low leverage traders
- Frequent vs Infrequent traders
- Consistent vs Inconsistent performers
These segments were analyzed across different sentiment conditions to understand how behavior changes with market sentiment.
During Greed sentiment, traders tend to:
- Increase leverage
- Trade more frequently
- Open larger position sizes
However, this behavior also increases PnL volatility and potential losses.
During Fear sentiment, traders tend to:
- Reduce leverage
- Open smaller positions
- Trade less frequently
This indicates risk-averse behavior during uncertain markets.
High-leverage traders show:
- Larger swings in PnL
- Higher risk exposure
- Less consistent profitability
This highlights the importance of risk management strategies.
During Fear sentiment:
- Reduce leverage exposure
- Trade smaller position sizes
- Focus on capital preservation
This helps reduce risk during uncertain market conditions.
During Greed sentiment:
- Trade frequency can increase moderately
- Opportunities may be higher
- However leverage should remain controlled
The goal is to capture opportunities without excessive risk.
Due to GitHub file size limits, the datasets are not included in the repository.
Download them here:
Bitcoin Fear/Greed Dataset
https://drive.google.com/file/d/1PgQC0tO8XN-wqkNyghWc_-mnrYv_nhSf/view
Historical Trader Data
https://drive.google.com/file/d/1IAfLZwu6rJzyWKgBToqwSmmVYU6VbjVs/view
A lightweight interactive dashboard was built using Streamlit to explore:
- Market sentiment distribution
- PnL performance trends
- Leverage patterns
- Trade frequency
- Trader behavior metrics
Run the dashboard locally using:
streamlit run dashboard.py
Clone the repository:
git clone https://github.com/explorer1905/trader-sentiment-analysis.git
Navigate to the project folder:
cd trader-sentiment-analysis
Install dependencies:
pip install -r requirements.txt
Run the analysis notebook:
jupyter notebook trader_sentiment_analysis.ipynb
Run the dashboard:
streamlit run dashboard.py
- Python
- pandas
- numpy
- matplotlib
- seaborn
- Streamlit
- scikit-learn
Shravani Chavan