DeFi Analytics Dashboard API

Complete REST API for DeFi persona and engagement analytics with user authentication

18 Endpoints Public Analytics JWT Auth Available User Management
Persona Analytics

Track user personas, overlaps, and engagement patterns across your DeFi platform.

  • Persona distribution
  • Overlap analysis
  • Engagement rates
Engagement Metrics

Monitor daily, weekly, and monthly active users with retention analytics.

  • DAU/WAU/MAU tracking
  • Retention curves
  • Stickiness index
Advanced Analytics

Deep insights into churn risk, LTV, funnels, and behavioral correlations.

  • Churn risk scoring
  • Lifetime value analysis
  • Onboarding funnels

API Endpoints

POST /auth/login

User login endpoint - authenticate with email and password

Request: {"email": "your@email.com", "password": "yourpassword"}
POST /auth/register

User registration endpoint - create new user accounts

Request: {"email": "your@email.com", "password": "yourpassword", "name": "Your Name", "role": "User"}
GET /auth/verify

Verify JWT token and get user information

Requires: Authorization: Bearer [JWT_TOKEN]

GET /personas

Main persona distribution data for pie chart visualization

Returns persona distribution with percentages, counts, and colors
GET /personas/overlaps

Persona overlap matrix showing user intersections

Matrix data for persona overlap analysis
GET /personas/engagement

Engagement rates by persona type

Engaged vs not engaged percentages by persona

GET /engagement/metrics?days=30

Daily engagement metrics over time (DAU, WAU, MAU)

Query param: days (1-365, default: 30)
GET /analytics/engagement-density

Engagement density by hour (48-hour cycle)

Hourly activity patterns for different personas

GET /analytics/churn-risk

Churn risk scores by persona

GET /analytics/ltv

Lifetime value analysis by persona

GET /analytics/retention

Retention curves by persona (1d, 3d, 7d, 30d)

GET /analytics/funnel

Onboarding funnel conversion stages

GET /analytics/correlations

Correlation matrix between personas and metrics

GET /analytics/cumulative-deposits

Cumulative deposits over time by persona

GET /analytics/daily-activity

Daily activity sparklines by persona

GET /experiments/ab-tests

A/B test results by persona

GET /alerts/persona-actions

Action alerts and recommendations for personas

GET /analytics/intervention-flow

Sankey diagram data for intervention flows

Business Analytics Endpoints (9)

Advanced business intelligence and financial metrics

GET /analytics/tvl-metrics

TVL metrics across protocols ($2.991B total)

GET /analytics/volume-metrics

Trading and transaction volume analytics

GET /analytics/transaction-metrics

Transaction counts and frequency patterns

GET /analytics/revenue-metrics

ARPU, AVPU, and revenue trend analysis

GET /analytics/user-actions

User action analytics with filtering

Params: action_type, days, persona, min_amount
GET /analytics/action-sequences

Common user journey patterns and sequences

GET /analytics/action-retention

Retention rates by first action type

GET /analytics/sticky-actions

Actions driving highest user loyalty

GET /analytics/executive-summary

Executive Summary - Key business insights and strategic recommendations

Authentication

API Key Required

All API endpoints require authentication using a Bearer token in the Authorization header:

Authorization: Bearer YOUR_API_TOKEN
Content-Type: application/json

Available Tokens:
  • defi-analytics-token-2025 - Full Access
  • demo-token-123 - Demo Access
  • ZmqMOfxViKVH7tkma7BPgdHImWyIXKTcaSt4moUpuIDl9A38wZcD1OQPFBljvfRa - Custom Access
Authentication Errors:
  • 401 Missing or invalid token
  • 401 Invalid Bearer format

Response Format

Success Response
{
  "success": true,
  "data": [...], // Your actual data
  "message": "Optional success message"
}
Error Response
{
  "success": false,
  "error": "Error message here",
  "code": "ERROR_CODE"
}