Query editor
withraw_airdrop_allocation_by_account as (select*fromquery_5571165), airdrop_allocation_general_stats as (select*fromquery_5571246), airdrop_allocation_account_stats as (withtbl1 as (selectr.datetime, r.block_number, r.account_address, r.raw_allocation_amount, r.raw_allocation_amount / 1e18 as allocation_amount, row_number() over (order by r.raw_allocation_amount asc, r.account_address asc) as rn_asc_allocation_amount -- order by "raw_allocation_amount" or "allocation_amount", row_number() over (order by r.raw_allocation_amount desc, r.account_address desc) as rn_desc_allocation_amount -- order by "raw_allocation_amount" or "allocation_amount"fromraw_airdrop_allocation_by_account r), tbl2 as (selectt.*, sum(t.raw_allocation_amount) over (order by rn_asc_allocation_amount asc rows between unbounded preceding and current row) as cumsum_rn_asc_raw_allocation_amount, sum(t.raw_allocation_amount) over (order by rn_desc_allocation_amount asc rows between unbounded preceding and current row) as cumsum_rn_desc_raw_allocation_amount, t.allocation_amount / g.total_allocation_amount as ratio_allocation_amount, cast(rn_asc_allocation_amount as double) / g.account_count as ratio_rn_asc_allocation_amount, cast(rn_desc_allocation_amount as double) / g.account_count as ratio_rn_desc_allocation_amountfromtbl1 as tcross joinairdrop_allocation_general_stats as g), tbl3 as (select*, cumsum_rn_asc_raw_allocation_amount / 1e18 as cumsum_rn_asc_allocation_amount