About Market Sentiment
What is Market Sentiment?
Market Sentiment is a real-time DeFi analytics platform that measures on-chain activity to provide directional sentiment analysis for Ethereum and Base chains. Unlike traditional volume trackers, we analyze the intent behind transactions to determine if the market is bullish or bearish.
Architecture Overview
Data Source
Enterprise Indexing Pipeline
- Real-time blockchain event streaming
- Uniswap V3 swaps
- Aave V3 liquidity changes & liquidations
- Sub-second latency
Backend (Rust)
Axum + LibSQL
- Webhook Handler: Receives real-time blockchain events
- USD Estimation: Calculates swap values from token amounts
- Sentiment Engine: Directional scoring algorithm
- WebSocket Broadcaster: Pushes updates to clients
- Database: LibSQL (Turso) for time-series aggregations
Frontend (SvelteKit)
Real-time Dashboard
- WebSocket Client: Receives live sentiment updates
- Chart.js: Visualizes sentiment over time
- Dark Mode: System preference detection
- Responsive: Mobile-optimized UI
How Sentiment is Calculated
1. Event Processing
Every blockchain event is processed through our sentiment engine:
Swap Events (Directional)
- Buying: Swapping ETH/USDC → Token = Bullish
- Selling: Swapping Token → ETH/USDC = Bearish
- Formula:
(amount_usd / 1,000,000) * direction
Whale Activity (>$1M trades)
- Large transactions indicate institutional interest
- Directional based on buy/sell
- Formula:
(amount_usd / 10,000,000) * direction
DeFi Score
- Liquidity Additions: Positive
- Liquidations: Negative
- Withdrawals: Negative
NFT Score
- Based on NFT sale volumes
- Indicates ecosystem engagement
- Formula:
(price_usd / 100,000)
2. Aggregation
Events are aggregated across multiple timeframes (1H, 4H, 1D, 1W, 1M, 1Y, All) using time-aligned buckets. This allows for historical comparison and trend analysis.
3. Weighted Scoring
(Volume × 30%) + (Whale × 30%) + (DeFi × 30%) + (NFT × 10%)The result is normalized to a -100 to +100 scale, where:
- +100: Maximum bullish sentiment
- 0: Neutral / balanced market
- -100: Maximum bearish sentiment
Technology Stack
Backend
- Rust + Axum
- LibSQL (Turso)
- WebSocket (real-time)
- Custom indexing pipeline
Frontend
- SvelteKit 5
- Chart.js
- TypeScript
- Vercel (hosting)
Data Sources
- Uniswap V3
- Aave V3
- Ethereum
- Base
Infrastructure
- VPS (backend)
- Vercel (frontend)
- Turso (database)
- Custom indexing infrastructure
Data Flow
- Event Occurs: User swaps tokens on Uniswap V3
- Event Detection: Indexing pipeline captures the swap event
- Webhook Sent: Event data sent to our backend via HTTP POST (<1s latency)
- Backend Processes:
- Parses event data
- Estimates USD value from token amounts
- Determines direction (buy/sell based on base tokens)
- Calculates sentiment impact
- Updates aggregations in database
- WebSocket Broadcast: Sends sentiment update to all connected clients
- Frontend Updates: Chart updates in real-time with new data point
Why Directional Sentiment?
Traditional DEX analytics only show trading volume, which doesn't tell you if people are buying or selling. Our directional approach analyzes token flow:
- Buying Pressure: When users swap stablecoins/ETH for tokens, it indicates confidence and bullish sentiment
- Selling Pressure: When users swap tokens back to stablecoins/ETH, it indicates fear or profit-taking (bearish)
This gives traders actionable insights: Is money flowing IN or OUT?
Support the Project
Market Sentiment is free to use and open for the community. If you find it useful, consider supporting development:
Donation Address (EVM):
0xbFE1B2729479724c3AaDaAd8dfDe32D0F1e687fD