Discussion Details

None of these
Type
ACTIVE

Rewards Calculation Service (RCS) for Cardano

4 comments
Submitted: 15 Apr 2025, 09:19 UTC (Epoch 552)
Updated: 15 Apr 2025, 13:14 UTC (Epoch 552)
ID:422
em

emurgo

Budget$1,031,600 (2,063,200 ADA)
ADA Rate$0.5
Preferred CurrencyUnited States Dollar (USD)
Contract TypeMilestone Based Fixed Price

Description

The Rewards Calculation Service (RCS) is a standalone solution designed to compute Cardano staking rewards—along with treasury, reserves, deposits, and fees—from genesis to the current epoch.

RCS provides:

  • Real-Time Calculation of current epoch rewards, derived directly from ledger state transitions.
  • Permanent Historical Storage of rewards accessible for any stake pool at any epoch.
  • Lightweight Infrastructure that does not rely on Cardano-db-sync, significantly reducing sync and query times.

Beyond rewards tracking, RCS can be scaled into a more comprehensive indexer that tracks not only what each block contains but also the evolving internal state of the Cardano ledger at every moment in time. This would provide a deeper level of insight for dApps, advanced analytics platforms, and other Cardano services seeking to leverage complete ledger state.

Problem Statement

Currently, the Cardano blockchain does not store staking rewards, reserves, or treasury history on-chain in a directly accessible form. Instead, these data points are derived from complex calculations built into the node and ledger code. Consequently, tools such as Cardano-db-sync have become the primary source for retrieving historical staking rewards data. However, this approach comes with several challenges:

Long Sync Times and Slow Queries Cardano-db-sync requires extensive synchronization and querying processes, which can be time-consuming and resource-intensive.

Suboptimal Data Schema for Certain Queries The PostgreSQL data schema used in this context is not always optimized for the specific query patterns required, leading to inefficiencies in data retrieval.

Complex Modifications Adjusting or modifying Cardano-db-sync is further complicated by the fact that the service interacting with PostgreSQL is implemented in Haskell, making alterations more challenging, particularly for developers who are not proficient in that language.

These factors combine to create a single point of inefficiency, making it difficult for developers, stake pool operators, and other ecosystem participants to access staking rewards history quickly and reliably.

Proposal Benefit

Who benefits and how?

Developers: Gain access to a real-time and historical rewards calculation API with optimized indexing and faster queries—no reliance on the bulky db-sync approach.

Stake Pool Operators (SPOs): Easily track staking rewards at each epoch without using db-sync or third party API’s. Delegators: Able to access transparent, reliable reward data for their stake pool delegations, promoting trust and engagement.

Cardano Ecosystem: Gains greater decentralization and diversity of infrastructure solutions, reducing dependency on a single tool.

By providing a lightweight reward calculation service, this proposal lowers infrastructure costs, simplifies reward querying, and accelerates data availability. Overall, it aims to enhance developer productivity, reduce operational complexity, and strengthen transparency in Cardano’s staking mechanism.

Moreover, there is a significant opportunity for scaling this service to evolve into a comprehensive indexer in the future. Such an indexer could track not only block contents but also the internal ledger state of a Cardano node at each point in time, thereby providing a richer dataset for dApps, analytics, and advanced tools built on Cardano.

Key Proposal Deliverables

Investigation & Analysis Researching and documenting Cardano’s reward formulas, ledger transitions logic. Deliver a summary document with pseudo-code.

Core Development & Architecture Implementation Developing the project skeleton, i.e. creating docker compose file for local development and setting up the service. Develop core backend functions for block processing, reward updates, and epoch transitions. Integrate with database to persist historical data.

Testing, Optimization, and Deployment Cross-verifying reward calculations with db-sync to ensure accuracy. Implementing restart and rollback handling mechanisms. Developing an API for retrieving rewards history. Deploying and testing.

Milestones:

Milestone 1: Research Successful completion of research from the beginning of rewards up to Conway updates.

Milestone 2: Planning & Design Design and implementation plans have been successfully delivered for the execution.

Milestone 3: Coding Successful delivery of the coded Indexer, transition states, and aggregator implementations.

Milestone 4: Writing Docs Successful delivery of the calculations against the current implementations on DB-Synch and the update of the documentation.

Milestone 5: Testing / Docs Beta version of the rewards calculation project has been successfully launched.

Milestone 6: Beta version Final release of the Rewards Calculation Service has been successfully launched.

Cost Breakdown

Budget Items:

Development Unit: 5 FTE Cost: USD 140,000 Total: USD 700,000

Testing and Support Unit: 3 FTE Cost: USD 80,000 Total: USD 240,000

Infrastructure Unit: 12 Infra Cost: USD 1,800 Total: USD 21,600

Scrum Master Unit: 0.5 FTE Cost: USD 140,000 Total: USD 70,000

Total Cost: USD 1,031,600

Resourcing & Duration

Team Composition: · 1-2 Senior Software Developers experienced with Cardano internals. · 1 DevOps Engineer. · 1 QA Engineer · 1 Lead Developer to coordinate tasks and oversee.

Timeline: · Investigation & Analysis – 3 months · Core Development & Architecture Implementation – 9 months · Testing, Optimization, and Deployment – 3 months

Deliverables:

Milestone 1: Research (USD 171,933) Successful completion of research from the beginning of rewards up to Conway updates.

Milestone 2: Planning & Design (USD 171,933) Design and implementation plans have been successfully delivered for the execution.

Milestone 3: Coding (USD 171,933) Successful delivery of the coded Indexer, transition states, and aggregator implementations.

Milestone 4: Writing Docs (USD 171,933) Successful delivery of the calculations against the current implementations on DB-Synch and the update of the documentation.

Milestone 5: Testing / Docs (USD 171,933) Beta version of the rewards calculation project has been successfully launched.

Milestone 6: Beta version (USD 171,933) Final release of the Rewards Calculation Service has been successfully launched.

Experience

EMURGO is one of the founding entities of the Cardano blockchain and has been developing tools and projects related to the protocol since the very beginning. Between maintaining low-level libraries for dealing directly with the protocol, developing client side wallet applications handling blockchain events, developing Plutus solutions, and running custom backend services for light wallets and numerous dApps aggregating chain data we have a decent understanding of the technical specifics of the ecosystem.

Maintenance & Support

EMURGO will maintain the Rewards Calculation Service (RCS) in the same manner as other EMURGO-led Cardano projects. After the initial development phase, ongoing updates, bug fixes, and feature enhancements will be handled through pull requests—both from internal EMURGO teams and the broader open-source community.

All code changes will undergo review and testing to ensure quality and compatibility with Cardano’s evolving protocols. As with CSL, RCS improvements—including updated calculations, database optimizations, or compatibility with future eras—will be added incrementally to align with Cardano’s roadmap. Regular version releases and release notes will keep developers informed, and any critical issues will be addressed promptly.

Supplementary Endorsement

The Cardano community has repeatedly voiced challenges regarding the speed and complexity of existing solutions (e.g., db-sync). Additionally, internal teams at EMURGO have observed that building or scaling reward-related services around db-sync is time-consuming and often overkill for retrieving historical rewards. A more optimized approach is needed.

Roadmap Alignment

Does your proposal align with any of the Intersect Committees?

Open Source Committee

Does this proposal align to the Product Roadmap and Roadmap Goals?

Developer / User Experience

Administration and Auditing

Would you like Intersect to be your named Administrator, including acting as the auditor, as per the Cardano Constitution?

Yes

Ownership Information

Submitted On Behalf Of

Company

Social Handles

https://x.com/emurgo_io

Key Dependencies

There is no existing dependencies

Created:4/15/2025
Last updated:4/15/2025
ID:422

Cast Your Vote

Coming Soon!

Comments (4)

Apr 15, 2025, 09:19 AM UTC

Voted No. This isn't a priority in my opinion, and similar tooling already exists.

Apr 15, 2025, 09:19 AM UTC

Is this open source software and under which license will you release it?

Apr 15, 2025, 09:19 AM UTC

Understanding Differentiation and Intended Use How does this tool differ from the existing tools provided by the Cardano Foundation?

Just to clarify, is it correct to understand this as an API rather than an explorer interface?

Given that tools like PoolTool already allow SPOs and delegators to quickly and easily access staking rewards and related data, is the primary target audience for this tool developers who would integrate it into their own applications or services?

If developers are indeed the primary target audience for this tool, could you name any specific developers or teams who have already expressed interest in using it?

Having examples of real potential users would help validate the demand and practical utility of the tool — is there any such feedback or commitment so far?

homerj
Apr 15, 2025, 09:19 AM UTC

Can you please provide a couple of sample data queries that someone might have trouble retrieving the data for currently, that your 2.x million Ada solution will allow them to answer? thanks.

Governance Space on Cardano Blockchain

Are You Ready to Participate?

Building Together to Drive Cardano Forward.