Index per-round delegator and orchestrator stake and earnings via cumulative factors
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 5
- Forks
- 7
- Avg merge
- 4h 1m
- Merged PRs (30d)
- 6
Description
Problem
The subgraph cannot compute a delegator's actual current or historical stake. The bondedAmount field only reflects the value at the last claim and does not include rewards earned since. To get current stake, clients must call the contract's pendingStake() directly, and for historical stake at a past round there is no solution. Computing an orchestrator's full pending stake (including unclaimed commission) or lifetime earnings requires fetching and summing every pool since the last claim.
This blocks time series delegator stake charts, per round reward breakdowns, orchestrator yield, and income and tax reporting for delegators and orchestrators.
Proposed solution
Introduce cumulative reward and fee factors plus per delegator shares so stake and earnings can be computed in O(1) at any round, without iterating pools or calling the contract. Implemented in #217.
Scope
- Per round delegator stake, current and historical, including rewards since last claim
- Orchestrator pending stake including unclaimed commission
- Orchestrator lifetime earnings
- Cumulative reward and fee factors enabling O(1) computation
- Foundation for delegator and orchestrator income and tax reporting
Out of scope
- UI surfaces, which are consumed by the Explorer and dashboard
- Data domains beyond stake and earnings
Related
- Implemented by #217
- Supersedes #158 (pendingstake tracking), #185 (cumulative fee factor)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with #217, which the issue identifies as the implementation, and inspect the subgraph changes there. Confirm that per-round delegator and orchestrator stake, earnings, and cumulative factors support historical and O(1) queries without pool iteration; the issue names no files or tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- backend, data
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100