I try to calculate the ROA of our Pool based on the Pool Data I get from the blockfrost Pool History Endpoint: `https://cardano-mainnet.blockfrost.io/api/v0/pools/<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 ?