Query editor
with claims as (select-- row_number() over(order by evt_block_time desc) as row_number,to as address, ens.name, cast(value as double)/pow(10, 18) as token_amount, round((value*price)/pow(10,18), 2) as usd_amount, evt_block_time as timefrom erc20_optimism.evt_Transfer trleft join prices.usd pon p.minute = date_trunc('minute', evt_block_time)and p.blockchain = 'optimism'and p.symbol = 'OP'left join labels.ens ens -- joining the ens to get the domain names from the userson ens.address = tr.to -- which domain has the user for whom the transaction was sentwhere"from" = 0xfb4d5a94b516df77fbdbcf3cfeb262baaf7d4db7),thresholds as (select(100 * (t.n - 1)) + 1 as lower_limit,(100 * t.n) as upper_limitfrom(SELECT ROW_NUMBER() OVER (ORDER BY 1) AS n FROM claims) AS t),claims_by_threshold as (selectupper_limit, count(*) as claims_count, sum(usd_amount) as usd_total_amountfrom claimsjoin thresholds on claims.token_amountbetween thresholds.lower_limit and thresholds.upper_limitgroup bylower_limit, upper_limitorder by upper_limit asc)selectupper_limit, claims_count, sum(usd_total_amount) over (order by upper_limit rows between unbounded preceding and current row) as cumulative_usd_countfrom claims_by_threshold