Query editor
-- THE BEST FEE MONTH OF EVERY YEAR - the peak sustained 30-day fee share in each calendar year,-- with the date that window ended. One row per year on purpose: a naive top-10 of overlapping-- windows returns ten views of the same fortnight and reads as ten separate events.-- Sits beside the fee multiple: what fees would have to reach, against the best they have managed.with d as (select date_trunc('day', time) as day,sum(mint_reward) as subsidy, sum(total_fees) as feesfrom bitcoin.blocksgroup by 1),w as (select day,100.0 * sum(fees) over (order by day rows between 29 preceding and current row)/ nullif(sum(fees + subsidy) over (order by day rows between 29 preceding and current row), 0) as fs30from d),ranked as (select year(day) as yr, day, fs30,row_number() over (partition by year(day) order by fs30 desc) as rnfrom wwhere fs30 is not null)select cast(yr as varchar) as "Year",round(fs30, 2) as "Best 30-day fee share %",cast(day as varchar) as "window ended"from rankedwhere rn = 1order by yr