Skip to content

feat: add /provider-rewards endpoint - #29

Merged
nimrod-teich merged 1 commit into
mainfrom
feat/provider-rewards
Apr 16, 2026
Merged

nimrod-teich merged 1 commit into
mainfrom
feat/provider-rewards

Conversation

@nimrod-teich

@nimrod-teich nimrod-teich commented Apr 15, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • New GET /provider-rewards?from=YYYY-MM-DD&to=YYYY-MM-DD endpoint that combines adjusted rewards + LAVA/USD price into a single response with per-provider reward shares and USD values. Replaces gen_provider_rewards.py and the lava-ops Job 2 orchestration.
  • Slimmed down /adjusted-rewards response — removed QoS breakdown fields (avgLatency, avgAvailability, avgSync, avgLatencyExc, avgAvailabilityExc, avgSyncExc, qosCus). Only relays, cus, and adjustedRewards remain.

Response shape:

{
  "meta": { "from", "to", "lavaUsdPrice", "totalAdjustedRewards" },
  "data": [
    { "provider", "moniker", "relays", "cus", "adjustedRewards", "rewardShare", "estimatedRewardsUsd" },
    ...
  ]
}

Test plan

  • Provider rewards: distribution with USD, shares sum to 1, cross-spec aggregation, historical price, empty data, validation
  • Adjusted rewards: updated tests confirm removed fields are absent
  • TypeScript type-check passes
  • Manual test: curl /provider-rewards?from=2025-03-17&to=2025-04-17

New /provider-rewards endpoint combines adjusted rewards from indexed
relay data with LAVA/USD price (current or historical via CoinGecko)
to return per-provider reward distributions with shares and USD values.
Replaces gen_provider_rewards.py + lava-ops Job 2 orchestration.

Removes superseded /adjusted-rewards, /lava/price, and historical
?timestamp= support from /supply/total. CoinGecko price gracefully
degrades to null on failure.
@nimrod-teich
nimrod-teich force-pushed the feat/provider-rewards branch from 6bf2f29 to 56af600 Compare April 16, 2026 11:08
@nimrod-teich
nimrod-teich merged commit d6ee557 into main Apr 16, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant