Skip to content

feat: add reward & fee cut history charts to orchestrator page#625

Open
rickstaa wants to merge 1 commit intolivepeer:mainfrom
rickstaa:feat/reward-cut-history
Open

feat: add reward & fee cut history charts to orchestrator page#625
rickstaa wants to merge 1 commit intolivepeer:mainfrom
rickstaa:feat/reward-cut-history

Conversation

@rickstaa
Copy link
Copy Markdown
Member

@rickstaa rickstaa commented Apr 13, 2026

Summary

Adds historical charts for an orchestrator's reward cut and fee cut to the orchestrator page. Delegators can now see how a given orchestrator has changed their cuts over time before delegating.

  • New OrchestratorCutHistory component renders two step-line charts (reward cut and fee cut) via ExplorerChart
  • New useOrchestratorCutHistory hook fetches historical TranscoderUpdateEvents from the subgraph and prepares chart-ready data, with two anchor points for edge cases:
    • a "now" anchor so the line extends to the present day when the last on-chain update is older than 24h
    • an "activation" anchor synthesized from the current on-chain cut values at activationTimestamp when the orchestrator has no TranscoderUpdateEvents at all (activated with cuts they've never changed), so the chart renders a flat line from activation → now instead of hanging on an empty skeleton
  • Chart is hidden entirely when there's nothing to plot (e.g. never-activated accounts) rather than showing an empty panel
  • ExplorerChart gains a lineCurve prop (monotone / stepAfter / linear) so cut charts render with the correct step-style line
  • ExplorerChart tooltip prop widened to ReactNode. The hardcoded "estimation methodology was updated on 8/21/23" note — previously leaked onto every chart as a default prop via fix: update usage to use new API endpoint #227 — is removed and passed inline only from the Estimated Usage chart, which is the only chart the forum post actually describes (the post explicitly points to Fees Paid as the unaffected alternative)
  • Charts sit below the Treasury Governance Participation card; the stats masonry layout is preserved

Note: this is the first of two PRs. A follow-up PR will add a bait-and-switch warning system (detection + UI) on top of the hook introduced here.

Test plan

  • Visit /accounts/<orchestrator-id>/orchestrating for an orchestrator with TranscoderUpdateEvent history and confirm both charts render the step curve at the actual on-chain change points
  • Visit /accounts/<orchestrator-id>/orchestrating for an orchestrator without any TranscoderUpdateEvents (never changed their cuts — e.g. 0x41239fb65360981316fcb4a8548320d305f9496d) and confirm a flat line renders from activationTimestamp to the current day
  • Confirm the "now" anchor extends the line to the current day when the last update is older than 24h
  • Confirm the charts are hidden entirely (not stuck on skeleton) for an account that is not an active orchestrator
  • Confirm axis labels are not clipped on mobile (Y-axis '100%' label)
  • Confirm loading skeletons show while data is fetching
  • Confirm layout is unchanged elsewhere on the page
  • Confirm the estimation methodology note appears only on the Estimated Usage chart on the homepage, not on Fees Paid / Participation Rate / Inflation Rate / Delegators / Orchestrators
  • Confirm the reward/fee cut tooltips do not show the estimation methodology note

@rickstaa rickstaa requested a review from ECWireless as a code owner April 13, 2026 20:00
Copilot AI review requested due to automatic review settings April 13, 2026 20:00
@vercel
Copy link
Copy Markdown
Contributor

vercel bot commented Apr 13, 2026

@rickstaa is attempting to deploy a commit to the Livepeer Foundation Team on Vercel.

A member of the Team first needs to authorize it.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds orchestrator reward cut / fee cut history visualization to the orchestrator “Orchestrating” page by fetching TranscoderUpdateEvents from the subgraph and rendering step-line charts via ExplorerChart.

Changes:

  • Add a new subgraph query (transcoderUpdateEvents) and Apollo hook generation to fetch historical cut updates.
  • Introduce useRewardCutHistory to transform update events into chart-ready series (including an optional “now” anchor).
  • Extend ExplorerChart to support an optional tooltipNote and configurable line curve (for step-style charts), and render the new RewardCutHistory section on the orchestrator page.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
queries/transcoderUpdateEvents.graphql Adds a query to fetch historical transcoder update events (rewardCut/feeShare/timestamp).
apollo/subgraph.ts Generated Apollo types/hooks for the new query.
hooks/useRewardCutHistory.tsx New hook to fetch and map update events into percent-decimal chart series.
components/RewardCutHistory/index.tsx New UI component rendering Reward Cut + Fee Cut step-line charts.
components/OrchestratingView/index.tsx Places the new history charts under the governance participation card; preserves masonry above.
components/ExplorerChart/index.tsx Adds tooltipNote override + lineCurve prop and tweaks Y-axis width for percent labels.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@vercel
Copy link
Copy Markdown
Contributor

vercel bot commented Apr 14, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
explorer-arbitrum-one Ready Ready Preview, Comment Apr 14, 2026 10:35am

Request Review

Delegators can now see how an orchestrator has changed their reward
and fee cuts over time before delegating.

- New OrchestratorCutHistory component renders two step-line charts
  (reward cut and fee cut) via ExplorerChart, placed above the stats
  masonry on the orchestrator page
- New useOrchestratorCutHistory hook fetches historical
  TranscoderUpdateEvents from the subgraph and prepares chart-ready
  data, with two anchor points for edge cases:
    - a "now" anchor so the line extends to the present day when the
      last on-chain update is older than 24h
    - an "activation" anchor synthesized from the current on-chain
      cut values at `activationTimestamp` when the orchestrator has
      no TranscoderUpdateEvents at all (activated with cuts they've
      never changed), so the chart still renders a flat line from
      activation → now instead of hanging on a loading skeleton
- Chart is hidden when there's nothing to plot (never-activated
  accounts) rather than showing an empty panel
- ExplorerChart gains a lineCurve prop (monotone / stepAfter / linear)
  so cut charts render with the correct step-style line
- ExplorerChart tooltip widened to ReactNode; the hardcoded estimation
  methodology note is removed from the default and passed inline from
  the Estimated Usage chart (the only chart it applies to, per the
  forum post)
@rickstaa rickstaa force-pushed the feat/reward-cut-history branch from c7ace99 to b62fb19 Compare April 14, 2026 13:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Triage

Development

Successfully merging this pull request may close these issues.

2 participants