This repository contains the data science assignment analyzing the relationship between Bitcoin market sentiment (Fear & Greed Index) and historical trader performance from the Hyperliquid perpetual DEX.
The analysis is based on a 2-year overlapping dataset (May 1, 2023 – May 1, 2025) comprising 211,224 trade executions across 246 assets (with asset-specific focus on BTC).
git clone https://github.com/Yashm2610/PrimeTrade.ai.git
cd PrimeTrade.aiMake sure you have Python installed, then run:
pip install pandas numpy matplotlib seaborn scipy streamlitRun the downloader script to fetch the Hyperliquid trader history and Bitcoin Fear & Greed dataset from Google Drive:
python download_data.pyRun the core analysis script. This script cleans and aligns the timestamps (using Timestamp IST to fix the CSV scientific notation precision loss), computes Pearson correlations, runs One-way ANOVA tests, saves statistics to analysis_output.txt, and generates static plots in the charts/ directory:
python analysis.pyRun the Streamlit application to open the interactive, glassmorphic analytics dashboard in your browser:
streamlit run app.pyThe dashboard allows filtering by target asset (Overall vs. BTC-only), adjusting the Fear & Greed range on the fly, rendering real-time KPI metrics, showing dynamic ANOVA/correlation tests, and exploring/downloading the data.
- Profitability is Counter-Cyclical: Daily trader profits (Closed PnL) are negatively correlated with sentiment. Traders make the most during Extreme Fear ($52.8k/day average) and the least during Greed ($11.1k/day average).
-
Volatility Spikes Trading Activity: Daily trade count and volume are strongly negatively correlated with sentiment (
$p < 0.001$ ). Trading counts during Extreme Fear are 4.4x higher than during Greed. - Traders are Contrarians: Hyperliquid traders actively buy the dip in Fear (Long Open Ratio rises to 66.7% overall, and 78.2% for BTC-only) and short/hedge in Greed (Long Open Ratio falls to 49.2% in Extreme Greed).
- Win Rate vs. PnL Asymmetry: In Extreme Fear, traders show their lowest win rate (65.4%) but highest daily PnL ($52.8k). This implies that they take multiple small losses attempting to catch bottoms, but their winning trades yield massive, outsized returns.
-
download_data.py: Programmatic downloader script for Google Drive hosted datasets. -
analysis.py: Main processing script that runs the statistical tests and generates static charts. -
app.py: Streamlit-based interactive web dashboard with custom dark-theme glassmorphism. -
report.md: Deep-dive executive analysis report detailing findings, tables, and recommendations. -
analysis_output.txt: Captured numeric logs and statistical test outputs of the run. -
charts/: Folder containing saved visualization figures. -
bitcoin_market_sentiment.csv: The processed Bitcoin Fear & Greed index historical data. -
Added dynamic charts and statistical testing features