-
Notifications
You must be signed in to change notification settings - Fork 1
📊 Add Analytics Dashboard with Real Market Data #38
Copy link
Copy link
Open
Labels
Description
Description
Create an analytics page to display platform statistics, trending markets, and user insights. The recharts library is already installed but underutilized.
Current State
rechartsis in package.json but not used- No analytics page exists
- Scripts folder has
analytics-report.tsbut no frontend visualization
Proposed Features
1. Platform Overview
- Total markets created
- Total volume traded (STX)
- Active users count
- Total fees collected
2. Market Statistics
- Most active markets
- Largest pools
- Resolution accuracy
- Average market duration
3. Charts (using recharts)
- Volume over time (line chart)
- Market categories distribution (pie chart)
- Daily active users (bar chart)
- Yes/No distribution per market (stacked bar)
4. User Analytics (when connected)
- Personal P&L
- Win/loss ratio
- Favorite categories
- Position history
UI Mockup
┌─ Analytics Dashboard ────────────────────┐
│ │
│ ┌────────┐ ┌────────┐ ┌────────┐ │
│ │ 156 │ │ 45.2K │ │ 1,247 │ │
│ │ Markets│ │ STX Vol│ │ Users │ │
│ └────────┘ └────────┘ └────────┘ │
│ │
│ ┌─ Volume Over Time ─────────────────┐ │
│ │ 📈 Line Chart │ │
│ └────────────────────────────────────┘ │
│ │
│ ┌─ Top Markets ──────────────────────┐ │
│ │ 1. BTC $100k - 245 STX pool │ │
│ │ 2. ETH Flip BTC - 180 STX pool │ │
│ └────────────────────────────────────┘ │
└──────────────────────────────────────────┘
Data Sources
- On-chain data from market contracts
- Hiro API for transaction history
- Derived metrics from market data
Files to Create
frontend/src/pages/AnalyticsPage.tsxfrontend/src/hooks/useAnalytics.tsfrontend/src/components/charts/VolumeChart.tsxfrontend/src/components/charts/CategoryPieChart.tsxfrontend/src/components/StatsCard.tsx- Add route in
App.tsx
Priority
🟢 Low - Nice to have for platform insights
Reactions are currently unavailable