Open Dashboard is a fully open source DeFi analytics platform that aggregates real-time data from multiple blockchain data sources to provide comprehensive protocol metrics. Teams can easily fork, customize, and deploy their own version with their preferred protocols and metrics.
This project is designed to be completely customizable and community-driven:
- β Fork-friendly: Clone and customize for your specific protocols
- β Protocol agnostic: Add any ERC-20 protocol with governance tokens
- β Data source flexible: Integrate with your preferred APIs
- β UI customizable: Modify layouts, colors, and metrics
- β Self-hostable: Deploy on your own infrastructure
- β No vendor lock-in: Full control over your analytics stack
open-dashboard/
βββ src/
β βββ config/
β β βββ protocols.js # π§ MAIN CUSTOMIZATION FILE
β βββ components/
β β βββ DeFiDashboard.jsx # ποΈ Main dashboard component
β β βββ Header.jsx # Navigation header
β β βββ Footer.jsx # Footer component
β βββ hooks/ # Data fetching hooks
β β βββ useCoinGecko.js # CoinGecko API integration
β β βββ useDefiLlama.js # DeFiLlama API integration
β β βββ useUniswap.js # Uniswap subgraph data
β β βββ useCurve.js # Curve protocol data
β β βββ useBalancer.js # Balancer protocol data
β β βββ useSushiSwap.js # SushiSwap protocol data
β β βββ useFraxswap.js # Fraxswap protocol data
β β βββ useEthereum.js # Ethereum on-chain data
β βββ services/
β β βββ cache-client.js # Caching and API management
β βββ assets/ # Static assets
βββ cache-service/ # Backend caching service
βββ public/ # Public assets
βββ dist/ # Production build
βββ .github/ # GitHub workflows
βββ docker-compose.yml # Docker setup
βββ Dockerfile # Container configuration
βββ deploy.sh # Deployment script
βββ package.json # Dependencies and scripts
This is the main file you'll customize to add your protocols:
export const protocols = [
{
ticker: "YOUR_TOKEN", // Token symbol (e.g., "UNI", "AAVE")
name: "Your Protocol Name", // Full protocol name
govContractAddress: "0x...", // Governance token contract address
coingeckoId: "your-token-id", // CoinGecko API ID
defiLlamaSlug: "your-protocol", // DeFiLlama protocol slug
blockchain: "ethereum", // Blockchain network
mainnetLaunch: "2024-01-01", // Launch date (YYYY-MM-DD)
openStatus: "current", // "current" or "proposed"
nextEmissions: 1000000, // Upcoming token emissions
emissionsCatalyst: "Description" // Emissions description
},
// Add more protocols here...
];Customize the dashboard display, metrics, and calculations:
- Add new columns: Extend the table with custom metrics
- Modify calculations: Change ratio formulas and thresholds
- Customize styling: Update colors, layouts, and responsive design
- Add data sources: Integrate new APIs or on-chain data
- Docker and Docker Compose
- Git
# Clone the repository
git clone https://github.com/your-username/open-dashboard.git
cd open-dashboard
# Create environment file
cp .env.example .env
# Edit .env with your API keys and configuration
# Start development environment
./scripts/dev.shThe dashboard will be available at http://localhost:3000
- Open
src/config/protocols.js - Add your protocol to the
protocolsarray:
{
ticker: "MYTOKEN",
name: "My DeFi Protocol",
govContractAddress: "0x1234567890123456789012345678901234567890",
coingeckoId: "my-token",
defiLlamaSlug: "my-protocol",
blockchain: "ethereum",
mainnetLaunch: "2024-01-01",
openStatus: "current",
nextEmissions: 500000,
emissionsCatalyst: "Liquidity mining rewards"
}- Save and the dashboard will automatically update!
The dashboard integrates with multiple APIs to provide comprehensive metrics:
| Data Source | Usage | Configuration |
|---|---|---|
| CoinGecko API | Market data, prices, volumes | coingeckoId in protocols.js |
| DeFiLlama API | Protocol TVL data | defiLlamaSlug in protocols.js |
| Uniswap Subgraph | DEX liquidity and volume | govContractAddress for token lookups |
| Curve API | Curve pool data | Auto-detected by token address |
| Balancer Subgraph | Balancer pool metrics | Auto-detected by token address |
| SushiSwap Subgraph | Sushi pool data | Auto-detected by token address |
| Fraxswap API | Frax DEX data | Auto-detected by token address |
- Extend the protocol data structure in
protocols.js:
{
// ... existing fields
customMetric: 1000000, // Your new field
}- Add the column header in
DeFiDashboard.jsx:
<SortableHeader
column="customMetric"
currentSort={sortConfig}
onSort={handleSort}
dataSource="Custom"
>
Your Metric
</SortableHeader>- Add the data cell in the
ProtocolRowcomponent:
<Td>
<Text fontSize="sm">{protocol.customMetric}</Text>
</Td>Update the getColorForMetric function in DeFiDashboard.jsx:
case 'yourMetric':
return getColorScale(value, {
low: 10, // Red threshold
medium: 50, // Yellow threshold
high: 100 // Green threshold
}, false); // false = higher is betterHandle special cases for specific protocols:
// Special handling for your protocol
if (protocol.ticker === 'MYTOKEN') {
// Custom calculation logic
const customValue = (marketCap * specialMultiplier) / totalSupply;
// Use in your metrics
}The Open Dashboard provides separate Docker configurations for development and production environments.
For local development with external Redis and API proxy:
# Option 1: Use helper script (recommended)
./scripts/dev.sh
# Option 2: Manual setup
docker-compose -f docker-compose.dev.yml up -d --buildDevelopment Environment Features:
- Uses
Dockerfile.devandnginx.dev.conf - Nginx proxy routes API calls to cache-service
- External Redis connection
- Accessible at: http://localhost:3000
- API Health: http://localhost:3000/api/health
For production deployment (e.g., Digital Ocean App Platform):
# Option 1: Use helper script (recommended)
./scripts/prod.sh
# Option 2: Manual setup
docker-compose up -d --buildProduction Environment Features:
- Uses
Dockerfileandnginx.conf - API routing handled by platform (Digital Ocean App Platform)
- External Redis connection
- Optimized for production deployment
Create a .env file in the root directory:
# Cache Service Configuration
PORT=4000
REDIS_URL=redis://your-redis-host:6379
# API Keys (secure backend-only)
COINGECKO_API_KEY=your_coingecko_api_key
THE_GRAPH_API_KEY=your_thegraph_api_key
# Ethereum RPC URLs
ETH_RPC_URL=https://mainnet.infura.io/v3/your_key
ETH_RPC_URL_FALLBACK=https://rpc.ankr.com/eth
# The Graph Subgraph IDs
UNISWAP_V3_SUBGRAPH_ID=5zvR82QoaXuFYDNKBfRU5N3q
UNISWAP_V2_SUBGRAPH_ID=ELUcwgpm14LKPLrBRuVvPvNKHQ9HvwmtKgKSH6123456
SUSHI_SUBGRAPH_ID=4bb7e6e1-b60d-4e1e-9f0d-123456789abc
SUSHI_V2_SUBGRAPH_ID=0x4bb7e6e1-b60d-4e1e-9f0d-123456789abc
CURVE_SUBGRAPH_ID=3C5-qE3-wVf-6Pw-dS2-aB8-x9K-mN4
FRAXSWAP_SUBGRAPH_ID=8H2-nF9-sW3-7Qs-eR5-cD6-y1L-mK8
BALANCER_V2_SUBGRAPH_ID=C4ayEZP2yTXRAB8Tf0h8bKaLqrβββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
β Frontend β β Cache Service β β External APIs β
β (React/Vite) βββββΊβ (Node.js) βββββΊβ (CoinGecko, β
β Port: 3000 β β Port: 4000 β β DeFiLlama, β
βββββββββββββββββββ βββββββββββββββββββ β The Graph) β
β β βββββββββββββββββββ
βΌ βΌ
βββββββββββββββββββ βββββββββββββββββββ
β Nginx β β Redis β
β (Proxy/CDN) β β (Cache) β
βββββββββββββββββββ βββββββββββββββββββ
Monitor your deployment:
# Check application status
curl http://localhost:3000/api/health
# Check Redis connection
curl http://localhost:3000/api/admin/redis-info
# View container logs
docker-compose logs -f app
docker-compose logs -f cache-service# Pull latest changes
git pull origin main
# Rebuild and restart (development)
docker-compose -f docker-compose.dev.yml down
./scripts/dev.sh
# Rebuild and restart (production)
docker-compose down
./scripts/prod.shgraph LR
A[protocols.js] --> B[DeFiDashboard.jsx]
B --> C[Custom Hooks]
C --> D[API Services]
D --> E[Cache Layer]
E --> F[External APIs]
F --> G[Dashboard Display]
- Configuration loaded from
protocols.js - Dashboard component processes protocol list
- Custom hooks fetch data for each protocol
- Cache service optimizes API calls
- External APIs provide real-time data
- UI components display formatted results
Add your own data sources by creating new hooks:
// src/hooks/useCustomAPI.js
export function useCustomAPI(protocolAddress, options = {}) {
return useQuery({
queryKey: ['customAPI', protocolAddress],
queryFn: () => fetchCustomData(protocolAddress),
...options
});
}Create specialized components for unique protocols:
// Handle special protocols
if (protocol.ticker === 'SPECIAL') {
return <SpecialProtocolRow protocol={protocol} />;
}Modify themes in the main app or component files:
const customTheme = {
colors: {
brand: {
primary: '#your-color',
secondary: '#your-color'
}
}
};- Staggered Loading: Protocols load incrementally to prevent API rate limits
- Caching Layer: Reduces redundant API calls with intelligent caching
- Lazy Loading: Components load data only when needed
- Memoization: Expensive calculations are cached
- Virtual Scrolling: Handles large protocol lists efficiently
We welcome contributions! This project thrives on community involvement:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- π Additional metrics (governance participation, yield farming)
- π¨ UI improvements (charts, graphs, mobile optimization)
- π API integrations (new data sources, real-time price feeds)
- π§ͺ Testing (unit tests, integration tests)
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Documentation: This README and inline code comments
- Examples: Check the
examples/directory for common customizations
This project is maintained by the community for the community. Star β the repo if you find it useful!