Skip to content

Index per-round delegator and orchestrator stake and earnings via cumulative factors #238

Description

@rickstaa

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementIncremental improvement to existing functionality.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions