Query editor
with grants_approved as (selectcast(cgp_id as int) as cgp_id, proposal, from_hex(substring(address, 3)) as recipient, sum(amount_cusd) as amount_approvedfrom query_5089228where address like '0x%' and length(address) = 42group by 1,2,3), grants_claimed as (selectt."to" as recipient, sum(amount) as total_claimedfrom tokens.transfers twhere t.contract_address = from_hex('765DE816845861e75A25fCA122bb6898B8B1282a')and t."from" = from_hex('d533ca259b330c7a88f74e000a3faea2d63b7972')AND t."to" NOT IN (from_hex('9cF769BcCE5e750534D88b251FB5B58Da9776190'))group by 1union allselectfrom_hex(substring(address, 3)) as recipient, amount_cusd as total_claimedfrom query_5193995),allocations as (selectg.cgp_id, g.proposal, g.recipient, g.amount_approved, c.total_claimed, sum(g.amount_approved) over (partition by g.recipient order by g.cgp_idrows between unbounded preceding and 1 preceding) as approvals_before, least(g.amount_approved,greatest(c.total_claimed - coalesce(sum(g.amount_approved)over(partition by g.recipient order by g.cgp_id rows between unbounded preceding and 1 preceding), 0), 0)) as allocation_claimedfrom grants_approved gleft join grants_claimed con g.recipient = c.recipient)selectcgp_id, proposal, recipient, amount_approved, total_claimed, round(allocation_claimed,2) as allocation_claimed, round((allocation_claimed / amount_approved),2) * 100 as claim_progressfrom allocationsgroup by 1,2,3,4,5,6,7order by 7