Risk Tape v1 — Metric Computation
All metric functions are stateless and pure: arrays in, single values out.
Source: src/modules/riskTape/metrics.ts
Revenue aggregation
Monthly revenue is aggregated across all connected platforms. Each platform
provides a monthly_revenue: number[] array where the last element
corresponds to the as_of_date month. Earlier elements count backwards.
The aggregated array is sorted chronologically (oldest first) and labelled
as YYYY-MM.
income_30d
Sum of the last 1 month's gross amounts (monthly granularity).
Returns null if no data.
income_90d
Sum of the last 3 months' gross amounts.
Returns null if no data.
avg_monthly_revenue
Arithmetic mean of the last 12 months' gross amounts.
avg = sum(last_12) / count(last_12)
Returns null if no months available.
median_monthly_revenue
Standard median of the last 12 months' gross amounts.
- For even-length arrays: average of the two middle values
- Returns
nullif no months available
volatility_cv_12m
Coefficient of Variation over the last 12 months:
CV = σ / μ
Where σ is the population standard deviation (divides by N, not N−1).
Cap: If μ < 100, CV is capped at 5.0 to prevent extreme values
for very small creators.
Returns null if empty or mean is zero.
Interpretation for lenders
| CV range | Meaning |
|---|---|
| 0.00 – 0.25 | Low volatility (stable, predictable revenue) |
| 0.25 – 0.50 | Moderate volatility |
| 0.50+ | High volatility (seasonal or irregular income) |
max_drawdown_pct_36m
Peak-to-trough algorithm over up to 36 months:
For each month i:
running_peak = max(amounts[0..i])
drawdown_i = (running_peak - amounts[i]) / running_peak
Result = max(drawdown_i), clamped to [0, 1]
Returns null if fewer than 2 months of data.
Interpretation for lenders
| Drawdown | Meaning |
|---|---|
| 0.00 – 0.20 | Minimal decline — strong resilience |
| 0.20 – 0.40 | Moderate decline — acceptable for prime |
| 0.40 – 0.60 | Significant decline — standard tier |
| 0.60+ | Severe decline — likely subprime or ineligible |
platform_concentration_index (HHI)
Herfindahl-Hirschman Index of revenue concentration:
HHI = Σ(share_i²)
Where share_i = platform_revenue_i / total_revenue.
1.0= all revenue from one platform0.5= two equally-weighted platforms- Lower = more diversified
Returns null if no platforms or zero total revenue.
top_platform_share
Revenue share of the highest-earning platform:
share = platform_with_max_revenue / total_revenue
Returns { platform, share } or null.
The boolean flag platform_dependency_flag is set to true when
top_platform_share ≥ 0.7.