Advanced Stablecoin Risk Assessment Platform - Comprehensive analysis across multiple dimensions with real-time data and intelligent discovery systems.
StableRisk provides sophisticated risk assessment for USD-pegged stablecoins through a tier-based analysis system that evaluates peg stability, transparency, cross-chain liquidity, oracle security, and audit coverage to deliver accurate, actionable risk insights.
- β Complete Playwright Migration: 100% faster JavaScript rendering (Puppeteer fully removed)
- β Audit Discovery Focus: Intelligent early termination - stop searching once audits found
- β Performance Breakthrough: USDT 10-18sβ253ms (98% faster), USDC ~10sβ1.2s (88% faster)
- β
GitBook Pattern Fix: Correct detection of
[project].gitbook.iodocumentation sites - β Background Processing: Smart queue system for expensive operations
- USDT: 10-18 seconds β 253ms (98% faster)
- USDC: ~10 seconds β 1.2 seconds (88% faster)
- Overall Performance Score: 75/100 (Excellent)
- All Tier Benchmarks: Tier 1/2/3 all instant, total API < 1000ms achieved
- USDN: Transparency detection improved (proof of reserves: false β true)
- USDY: Transparency score improved from 22/100 to 65/100 (+195%)
- USDE: Liquidity coverage improved from ~20% to ~99.8% (1 β 4 chains)
- Tier 1: Basic market data and price feeds
- Tier 2: Intermediate risk metrics and peg analysis
- Tier 3: Comprehensive analysis with cross-chain data
- Dynamic Dashboard Scraping: Playwright-powered analysis of React/Vue SPAs
- Real-time Data Extraction: Live proof of reserves and collateralization metrics
- Attestation Discovery: Direct integration with audit and attestation sources
- Multi-source Verification: Cross-reference transparency claims
- Smart Chain Discovery: Automatic detection across 6+ blockchains
- DEX Aggregation: Comprehensive liquidity analysis across 14+ DEXs
- Concentration Risk Assessment: Distribution analysis and risk scoring
- Real-time Pool Data: Live liquidity metrics with cache optimization
- Weighted Methodology: Scientifically calibrated risk factors
- Real-time Updates: 24-hour cache with intelligent refresh
- Historical Analysis: 180-day price deviation tracking
- Confidence Indicators: Data quality and completeness scoring
- Interactive Charts: Recharts with custom theming
- Responsive Design: Mobile-first approach with adaptive layouts
- Real-time Updates: Live data with skeleton loading states
- Accessibility: WCAG 2.1 AA compliant interface
- Next.js 15: App Router with Server Components
- TypeScript: Strict mode with comprehensive type safety
- React 18: Latest features with Suspense and streaming
- shadcn/ui: Modern, accessible component library
- Tailwind CSS: Utility-first styling with custom theming
- Lucide React: Consistent iconography
- Recharts: Advanced data visualization
- CoinGecko: Market data and platform information
- GeckoTerminal: Cross-chain DEX liquidity data
- Playwright: High-performance dynamic web content extraction (100% faster than Puppeteer)
- GitHub API: Audit report discovery with intelligent early termination
- Redis: Distributed caching for production
- Next.js Cache: Built-in optimization with 24h TTL
- Rate Limiting: 10 queries/IP/day with sliding window
- Background Processing: Queue system for expensive operations
- Node.js 18+
- npm/yarn/pnpm
- Redis (for production caching)
# Clone repository
git clone <repository-url>
cd stableriskv2
# Install dependencies
npm install
# Install Playwright browsers
npx playwright install chromium
# Set up environment variables
cp .env.example .env
# Edit .env with your API keys
# Run development server
npm run dev# Required for enhanced features
GITHUB_API_KEY= # For audit discovery
REDIS_URL= # For production cachingsrc/lib/services/
βββ coingecko.ts # Market data integration
βββ geckoterminal.ts # Cross-chain liquidity analysis
βββ transparency.ts # Dashboard analysis with Playwright
βββ audit-discovery.ts # Audit discovery with focus optimization
βββ oracle-analysis.ts # Oracle security assessment
βββ peg-stability.ts # Price deviation analysis
βββ playwright-scraper.ts # High-performance web scraping
βββ hybrid-scraper.ts # Smart fallback scraping strategy
βββ background-processor.ts # Queue system for expensive operations
βββ enhanced-api-client.ts # API client with caching
/api/stablecoin/[ticker]
βββ Tier 1: Basic market data (CoinGecko)
βββ Tier 2: Risk metrics (peg, transparency)
βββ Tier 3: Comprehensive analysis (liquidity, oracle, audits)
src/components/
βββ ui/ # shadcn/ui base components
βββ stablecoin/ # Stablecoin-specific components
βββ charts/ # Data visualization
βββ layout/ # Navigation and layout
- Peg Stability (30%): 180-day price deviation analysis
- Transparency (25%): Dashboard analysis, proof of reserves
- Liquidity (20%): Cross-chain DEX liquidity and concentration
- Oracle (15%): Provider diversity and decentralization
- Audit (10%): Security audit coverage and quality
- π΄ High Risk (0-30): Significant concerns identified
- π‘ Medium Risk (31-60): Some risks present, monitor closely
- π’ Low Risk (61-100): Minimal risks detected
- Confidence Score: Based on data completeness and source reliability
- Update Frequency: Real-time indicators of data freshness
- Source Attribution: Clear identification of data origins
- USDT, USDC, BUSD, DAI, USDE, USDN, USDY
- Automatic discovery of new stablecoins via CoinGecko
- Ethereum, Solana, TON, ZkSync, Aptos, Zircuit
- Dynamic network discovery (no hardcoded mappings)
- Secure API key management
- Input validation and sanitization
- Rate limiting to prevent abuse
- No sensitive data exposure in errors
- Clear "Not financial advice" disclaimers
- Transparent methodology documentation
- Data source attribution
- Update timestamps for data freshness
- USDT Response Time: 253ms (98% improvement)
- USDC Response Time: 1.2s (88% improvement)
- Audit Discovery: 419ms average (86% faster)
- Transparency Analysis: Instant for recent data (99% faster)
- Overall Performance Score: 75/100 (Excellent)
- API Response Time: < 2s (95th percentile)
- Uptime: 99.9% target
- Cache Hit Rate: ~85% for repeated queries
- Error Rate: < 1%
- Load Time: < 3s first contentful paint
- Mobile Score: 95+ (Google PageSpeed)
- Accessibility: WCAG 2.1 AA compliant
- TypeScript strict mode enforcement
- ESLint + Prettier for consistency
- Unit tests for scoring algorithms - 100% coverage
- Integration tests for API endpoints
- E2E tests for critical user flows
- Playwright for 100% faster web scraping
- Intelligent early termination in audit discovery
- Background processing for expensive operations
- Multi-layer caching strategies
- Smart fallback systems
- Comprehensive error boundaries in React
- Graceful degradation for failed services
- User-friendly error messages
- Detailed logging for debugging
- Fallback content for all external dependencies
- Log all API calls with timing
- Monitor external API reliability
- Track user engagement metrics
- Alert on error thresholds
- Regular performance audits
- Use Recharts with shadcn/ui for consistency
- Implement proper theming with CSS variables
- Mobile-responsive charts
- Accessible color schemes (colorblind-friendly)
- Interactive tooltips with relevant data
- Consistent number formatting
- Appropriate decimal precision
- Clear axis labels and legends
- Time series with proper timestamps
- Visual indicators for significant events (depegs)
- Separate configs for dev/staging/prod
- Environment-specific feature flags
- Secure secret management
- Database migrations with rollback capability
- Blue-green deployment strategy
- Health check endpoints
- Database connection monitoring
- External API dependency checks
- Rate limit monitoring
- User error tracking
- Self-documenting code with clear naming
- JSDoc for complex functions
- README for each service
- API documentation with examples
- Architecture decision records (ADRs)
- Clear onboarding for new users
- Help tooltips for complex features
- FAQ section for common questions
- Methodology explanation page
- Contact/support information
- API response time < 2s (95th percentile)
- Frontend load time < 3s
- 99.9% uptime
- < 1% error rate
- Zero security incidents
- < 5s time to first meaningful paint
-
95% mobile usability score
- < 3% bounce rate on results
-
80% user task completion
- Positive accessibility audit
- Foundation: Project setup, architecture, and core infrastructure
- Backend: API development, data services, and caching
- Frontend: UI components, user interface, and interactions
- Integration: Connect frontend and backend, testing
- Deployment: Production setup, monitoring, and optimization
- All code must pass TypeScript strict checks
- 100% test coverage for critical business logic
- Performance budgets must be met
- Security scan must pass
- Accessibility audit must score 95%+
- Code reviews required for all changes
- Architecture reviews for significant changes
- Security reviews for external integrations
- Performance reviews for data-heavy features
- UX reviews for user-facing changes
Built with β€οΈ by SerStableLad
For detailed technical documentation, see context.md