feat: add reward & fee cut history charts to orchestrator page#625
Open
rickstaa wants to merge 1 commit intolivepeer:mainfrom
Open
feat: add reward & fee cut history charts to orchestrator page#625rickstaa wants to merge 1 commit intolivepeer:mainfrom
rickstaa wants to merge 1 commit intolivepeer:mainfrom
Conversation
Contributor
|
@rickstaa is attempting to deploy a commit to the Livepeer Foundation Team on Vercel. A member of the Team first needs to authorize it. |
Contributor
There was a problem hiding this comment.
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
useRewardCutHistoryto transform update events into chart-ready series (including an optional “now” anchor). - Extend
ExplorerChartto support an optionaltooltipNoteand configurable line curve (for step-style charts), and render the newRewardCutHistorysection 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.
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
b654862 to
c7ace99
Compare
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)
c7ace99 to
b62fb19
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.
OrchestratorCutHistorycomponent renders two step-line charts (reward cut and fee cut) viaExplorerChartuseOrchestratorCutHistoryhook fetches historicalTranscoderUpdateEvents from the subgraph and prepares chart-ready data, with two anchor points for edge cases:activationTimestampwhen the orchestrator has noTranscoderUpdateEvents 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 skeletonExplorerChartgains alineCurveprop (monotone/stepAfter/linear) so cut charts render with the correct step-style lineExplorerCharttooltipprop widened toReactNode. 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)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
/accounts/<orchestrator-id>/orchestratingfor an orchestrator withTranscoderUpdateEventhistory and confirm both charts render the step curve at the actual on-chain change points/accounts/<orchestrator-id>/orchestratingfor an orchestrator without anyTranscoderUpdateEvents (never changed their cuts — e.g.0x41239fb65360981316fcb4a8548320d305f9496d) and confirm a flat line renders fromactivationTimestampto the current day