An open-source analytics dashboard for Stellar DeFi protocols. Track liquidity pools, DEX volumes, lending protocols, and more with real-time data visualization.
Documentation site: Stellar DeFi Analytics field guide
Prototype status: account-balance reads can use Horizon, but TVL and asset prices currently use placeholders, portfolio results use sample trades, and the price stream is not live. A hosted interactive demo is not currently available; run the app locally using the instructions below. Do not rely on current output for investment, tax, or accounting decisions.
Version: 0.1.0 | Changelog | API Docs
Stellar DeFi Analytics provides comprehensive insights into the Stellar DeFi ecosystem:
- Real-time Metrics: Live data from Stellar DeFi protocols
- Liquidity Tracking: Monitor liquidity pools and LP positions
- DEX Analytics: Trade volumes, prices, and market depth
- Protocol Metrics: TVL, user counts, transaction volumes
- Historical Data: Charts and trends over time
- Portfolio Tracking: Track your DeFi positions across protocols
- π Interactive Charts - Powered by Recharts with responsive design
- π Real-time Updates - Live data with automatic refresh
- π¨ Modern UI - Built with Next.js 14 and Tailwind CSS
- π± Responsive - Works seamlessly on desktop and mobile
- π Multi-Protocol Support - Aggregates data from multiple Stellar DeFi protocols
- πΎ Data Export - Export analytics data to CSV/JSON
- π Search & Filter - Find specific pools, tokens, or protocols quickly
- π― Custom Dashboards - Create personalized views
# Clone the repository
git clone https://github.com/HyperDevTools/stellar-defi-analytics.git
cd stellar-defi-analytics
# Install dependencies
npm install
# or
yarn install
# or
pnpm install
# Run development server
npm run devOpen http://localhost:3000 to view the dashboard.
Create a .env.local file in the root directory:
# Stellar Network
NEXT_PUBLIC_STELLAR_NETWORK=testnet
NEXT_PUBLIC_HORIZON_URL=https://horizon-testnet.stellar.org
# Optional: RPC endpoints for faster data access
NEXT_PUBLIC_SOROBAN_RPC_URL=https://soroban-testnet.stellar.org
# Analytics Configuration
NEXT_PUBLIC_REFRESH_INTERVAL=30000
NEXT_PUBLIC_HISTORICAL_DAYS=30The main dashboard provides:
- Total Value Locked (TVL) across all protocols
- 24h trading volumes
- Top performing tokens
- Recent transactions
- Protocol breakdowns
View and analyze liquidity pools:
import { useLiquidityPools } from '@/hooks/useLiquidityPools';
export default function PoolsPage() {
const { pools, isLoading } = useLiquidityPools();
return (
<div>
{pools.map(pool => (
<PoolCard key={pool.id} pool={pool} />
))}
</div>
);
}Track DEX trading activity:
import { useDexVolume } from '@/hooks/useDexVolume';
export default function DexPage() {
const { volume, history } = useDexVolume('24h');
return (
<VolumeChart data={history} totalVolume={volume} />
);
}Monitor your DeFi positions:
import { usePortfolio } from '@/hooks/usePortfolio';
export default function Portfolio() {
const { positions, totalValue } = usePortfolio(walletAddress);
return (
<PortfolioSummary positions={positions} total={totalValue} />
);
}stellar-defi-analytics/
βββ app/ # Next.js app directory
β βββ layout.tsx # Root layout
β βββ page.tsx # Home page
β βββ pools/ # Liquidity pools pages
β βββ dex/ # DEX analytics pages
β βββ portfolio/ # Portfolio tracking pages
βββ components/ # React components
β βββ charts/ # Chart components
β βββ cards/ # Card components
β βββ layout/ # Layout components
βββ hooks/ # Custom React hooks
β βββ useLiquidityPools.ts
β βββ useDexVolume.ts
β βββ usePortfolio.ts
βββ lib/ # Utility libraries
β βββ stellar.ts # Stellar SDK utilities
β βββ api.ts # API client
β βββ formatters.ts # Data formatters
βββ services/ # Data services
β βββ horizon.ts # Horizon API service
β βββ soroban.ts # Soroban RPC service
β βββ protocols/ # Protocol-specific services
βββ types/ # TypeScript types
βββ pool.ts
βββ token.ts
βββ transaction.ts
# Run tests
npm test
# Run tests in watch mode
npm run test:watch
# Type checking
npm run type-checknpm run devThe app will be available at http://localhost:3000
# Build for production
npm run build
# Start production server
npm startThis project uses GitHub Actions for continuous integration:
- Automated Testing: Runs on every push and pull request
- Multi-Version Testing: Tests against Node.js 18.x and 20.x
- Type Checking: Ensures TypeScript correctness
- Linting: Enforces code quality standards
- Security Scanning: Checks for vulnerabilities with npm audit
- Build Verification: Ensures the app builds successfully
View the CI configuration for details.
- Create a new service in
services/protocols/:
// services/protocols/myprotocol.ts
export class MyProtocolService {
async getTVL(): Promise<number> {
// Fetch TVL data
}
async getPools(): Promise<Pool[]> {
// Fetch pools
}
}- Register the protocol in
lib/protocols.ts:
import { MyProtocolService } from '@/services/protocols/myprotocol';
export const protocols = {
myprotocol: new MyProtocolService(),
// ... other protocols
};Create custom charts using Recharts:
import { LineChart, Line, XAxis, YAxis } from 'recharts';
export function CustomChart({ data }) {
return (
<LineChart data={data}>
<XAxis dataKey="time" />
<YAxis />
<Line type="monotone" dataKey="value" stroke="#8884d8" />
</LineChart>
);
}We welcome contributions! Please see CONTRIBUTING.md for details.
- Fork the repository
- Create a feature branch
- Make your changes
- Write/update tests
- Run linter and tests
- Submit a pull request
- Lending protocol analytics
- Yield farming metrics
- Token price alerts
- Advanced charting (candlesticks, depth charts)
- Historical data export
- Mobile app
- Multi-chain support
- Social features (shared dashboards)
- API for third-party integrations
- All data is read-only from public blockchain sources
- No private keys are stored or transmitted
- Wallet connections use standard Stellar wallet adapters
- Security audits welcome - please report issues responsibly
MIT License - see LICENSE for details
- Open an issue for bug reports or feature requests
- Join our community discussions
- Contribute to the codebase
- Star the repo if you find it useful!
Built with:
Made with β€οΈ by HyperDevTools