API

Revenue & on-chain

Creator-fee revenue as booked by the engine, and live reads of the Phase 1 contracts.

GET /revenue

Creator fees as the harvest strategy books them. Needs the database. Cache: 10 s.

ts
interface RevenueView {
  totals: { accruedHype: number; claimedHype: number; usd: number; toTreasuryHype: number; toPrizesHype: number };
  last24h: { hype: number; usd: number };
  items: Array<{ id: number; time: string; kind: string; source: string; amountHype: number; usd: number;
                 toTreasuryHype: number; toPrizesHype: number; txHash: string | null; paper: boolean }>;
  daily: Array<{ day: string; hype: number; usd: number }>;
}
  • kind is accrued (fees seen growing in the hook) or claimed (an on-chain FeeSplitter.claim() in live mode, with its txHash).
  • Totals sum every row: accrued amounts for HYPE, USD and the split; claimed amounts for claimedHype.
  • items is the latest 100 rows; daily is accrued revenue per UTC day for the last 60 days, oldest first.
  • Before launch, source reads montra:creator-fees (stand-in pool).

GET /onchain

Live reads of the Treasury, FeeSplitter and PrizePool in one multicall. Works without a database. Cache: 10 s.

ts
interface OnchainView {
  block: string;
  hypeUsd: number | null;
  treasury: {
    address: string; hype: number; usdc: number; whype: number; motion: number | null; paused: boolean;
    totalHypeReceived: number; maxHypePerCall: number; dailyHypeLimit: number; spentToday: number;
  };
  feeSplitter: {
    address: string; poolId: string | null; wired: boolean;
    totalSplit: number; totalToTreasury: number; totalToPrizes: number;
    pendingCreatorHype: number | null;   // fees waiting in the Montra hook
    recipientOk: boolean | null;         // the hook really pays this splitter for that pool
  };
  prizePool: {
    address: string; hype: number; available: number; totalFunded: number; totalPaid: number;
    roundsPaid: number; lastRoundId: number; roundSeconds: number;
    pending: { roundId: number; pot: number; readyAt: number } | null;
  };
}
  • wired is false while the splitter's poolId is zero (before setPoolId).
  • pendingCreatorHype and recipientOk use MOTION's pool if MOTION_TOKEN is set, else the splitter's wired pool, else they are null.
  • treasury.motion is only filled once MOTION_TOKEN is set. prizePool.pending is null when no round is pending.
bash
curl https://<your-site>/api/v1/onchain