Skip to content

Commit

Permalink
Account for eth in contracts being returned as eth directly now and n…
Browse files Browse the repository at this point in the history
…ot including staking contract anymore (ultrasoundmoney#327)
  • Loading branch information
ckoopmann authored May 3, 2024
1 parent cf8c040 commit 04a118b
Showing 1 changed file with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -238,14 +238,12 @@ const SupplyChart: FC<Props> = ({
stakingSupply === undefined ? v : v - stakingSupply;

// Calculate contract vs address split
const inContractsPercent =
const inContractsValue =
contractByDate[timestamp] || lastInContractsIterValue;

if (inContractsPercent !== undefined) {
lastInContractsIterValue = inContractsPercent;
// Glassnode's ETH in contract data includes staked ETH, so we need
// to subtract staked ETH here since we render it as its own series
const inContractsValue = inContractsPercent * v - (stakingSupply ?? 0);
if (inContractsValue !== undefined) {
lastInContractsIterValue = inContractsValue;

contractSeriesData.push([dateMillis, inContractsValue]);

const inAddressesValue = (nonStakingSupply ?? v) - inContractsValue;
Expand Down

0 comments on commit 04a118b

Please sign in to comment.