Query editor
withraw_airdrop_allocation_by_account as (select*fromquery_5571165), calls as (selectc.call_block_time as datetime, c.call_block_number as block_number, t."from" as account_address, c.percent as stake_percent, c.output_0 as token_idfromblackhole_avalanche_c.blackclaims_call_claimandstakereward cinner joinavalanche_c.traces tontrueand c.call_block_number = t.block_numberand c.call_tx_index = t.tx_indexand c.call_trace_address = t.trace_addresswheretrueand call_success), raw_airdrop_claim_by_account as (withtbl1 as (selectc.*, a.raw_allocation_amount, if(c.stake_percent = 100, raw_allocation_amount, raw_allocation_amount * 100 / 110) as raw_credit_amountfromcalls cinner joinraw_airdrop_allocation_by_account aontrueand c.account_address = a.account_address), tbl2 as (select*, raw_allocation_amount - raw_credit_amount as raw_forfeit_amount, if(stake_percent = 100, raw_credit_amount, raw_credit_amount * stake_percent / 100) as raw_stake_amount