to find total validators on eth , i am using below logics :
SELECT sum(amount_staked) FROM staking_ethereum.deposits as a,
SELECT sum(amount)/1e9 FROM ethereum.withdrawals as b
and my output is (a-b)/32
, am i making a mistake ?
I saw some query where hildobby did
CASE WHEN amount/1e9 BETWEEN 20 AND 32 THEN amount/1e9
WHEN amount/1e9 > 32 THEN 32
END AS amount_full_withdrawn
so instead of subtracting amount I calculated above, he subtracted amount_full_withdrawn
But I am unable to understand this logic.