DocumentationapiAnalytics API

Analytics API

Endpoints for governance statistics and analytics.

Get Overview Stats

Get overall DAO statistics.

GET /api/analytics/overview

Response

{
  "totalMembers": 600,
  "activeMembers": 487,
  "totalProposals": 45,
  "activeProposals": 2,
  "totalVotingPower": 1350000,
  "participationRate": 72,
  "avgFairScore": 58,
  "totalDelegations": 148
}

Get Tier Distribution

Get member distribution across tiers.

GET /api/analytics/tiers

Response

{
  "tiers": [
    {
      "tier": "platinum",
      "count": 12,
      "percentage": 2,
      "avgScore": 91,
      "avgVotingPower": 37500
    },
    {
      "tier": "gold",
      "count": 85,
      "percentage": 14,
      "avgScore": 77,
      "avgVotingPower": 4500
    },
    {
      "tier": "silver",
      "count": 210,
      "percentage": 35,
      "avgScore": 62,
      "avgVotingPower": 1800
    },
    {
      "tier": "bronze",
      "count": 180,
      "percentage": 30,
      "avgScore": 42,
      "avgVotingPower": 800
    },
    {
      "tier": "unscored",
      "count": 113,
      "percentage": 19,
      "avgScore": 0,
      "avgVotingPower": 350
    }
  ]
}

Get Proposal Stats

Get proposal outcome statistics.

GET /api/analytics/proposals

Response

{
  "total": 45,
  "byState": {
    "voting": 2,
    "succeeded": 28,
    "defeated": 15,
    "executed": 25
  },
  "byType": {
    "standard": 38,
    "expedited": 5,
    "emergency": 2
  },
  "passRate": 65,
  "avgParticipation": 68,
  "avgQuorum": 72
}

Get Voting Activity

Get voting activity over time.

GET /api/analytics/voting-activity

Query Parameters

Time period: 7d, 30d, 90d, 1y.

Response

{
  "period": "30d",
  "daily": [
    {
      "date": "2024-02-01",
      "votes": 45,
      "voters": 32,
      "votingPower": 125000
    }
  ],
  "totals": {
    "votes": 1250,
    "uniqueVoters": 287,
    "totalVotingPower": 3500000
  }
}

Get Top Voters

Get most active voters.

GET /api/analytics/top-voters

Query Parameters

Maximum results.

Time period.

Response

{
  "voters": [
    {
      "address": "7xKXtg2C...",
      "votes": 42,
      "votingPower": 15000,
      "participation": 95,
      "tier": "platinum"
    }
  ]
}

Get Score Distribution

Get FairScore distribution histogram.

GET /api/analytics/score-distribution

Response

{
  "buckets": [
    { "range": "0-10", "count": 25 },
    { "range": "10-20", "count": 35 },
    { "range": "20-30", "count": 53 },
    { "range": "30-40", "count": 78 },
    { "range": "40-50", "count": 102 },
    { "range": "50-60", "count": 98 },
    { "range": "60-70", "count": 85 },
    { "range": "70-80", "count": 72 },
    { "range": "80-90", "count": 38 },
    { "range": "90-100", "count": 14 }
  ],
  "mean": 58,
  "median": 55,
  "stdDev": 22
}