ROA calculation

I try to calculate the ROA of our Pool based on the Pool Data I get from the blockfrost Pool History Endpoint:<poolID>/history/
But I’am not sure my calculation is right.
The Basic calculation looks like this:

let allIncome = rewards + fees;
let fixedFee = 340;

if (allIncome < fixedFee) 
  { fixedFee = allIncome }

allIncome = allIncome - fixedFee
const distributedrewards = allIncome - allIncome * margin_cost

const ROI = (distributedrewards / (activeStake - activePledge)) * epochsPerYear * 100

Am I doing it right ?

1 Like

Have look at this Cardano Reward Calculator - Dynamic Strategies

1 Like

thnx @tomdx that’s a great resource.
But from what I understand it’s primary meant to calculate the prjected future rewards.
What I try is to simple calculate ROI based on historic Data from previous Epochs.

1 Like

I think there is one mistake in your script. Pledge is also awarded with rewards. So you dont need to substract it from the active stake. Besides of that i think it looks good.


If you want a historical ROI to date rather than a projection you could simply query Cardano DB sync for all the blocks (UTXO) that produced rewards from your pool and sum them?

Something like this maybe:

  sum(reward.amount) as total_lovelace
from reward 
  inner join pool_hash on reward.pool_id = <your pool hash id here>
where reward.epoch_no > 239 -- 240 was first epoch of 2021

Cool thnx - that was uncertain about that point.

1 Like