Query editor
-------total count of common shib and bubble (non-staked) hodler----WITH bubble_holders AS (SELECTb.address AS bubble_addy,b.balance AS bubble_bal,ROW_NUMBER() OVER (PARTITION BY b.day ORDER BY b.balance DESC) AS rankFROM tokens_ethereum.balances_daily AS bWHEREb.token_address = 0xe9689028eDE16c2FDFE3D11855D28f8E3fC452a3AND b.day = DATE_TRUNC('day', CURRENT_DATE)),shib_holders AS (SELECTb.address AS shib_addy,b.balance AS shib_bal,ROW_NUMBER() OVER (PARTITION BY b.day ORDER BY b.balance DESC) AS rankFROM tokens_ethereum.balances_daily AS bWHEREb.token_address = 0x95aD61b0a150d79219dCF64E1E6Cc01f0B64C4cEAND b.day = DATE_TRUNC('day', CURRENT_DATE)),Common_holders as (SELECTbubble_holders.bubble_addy AS common_address,bubble_holders.bubble_bal as bubble_amount,shib_holders.shib_bal as shib_amountFROM bubble_holdersINNER JOIN shib_holdersON bubble_holders.bubble_addy = shib_holders.shib_addy),lot as (select common_address, bubble_amount,bubble_amount/200 as bubble_lot, shib_amount, shib_amount/100000 as shib_lot from common_holders),final_numbers as (selectcommon_address,bubble_amount,bubble_lot,shib_amount,shib_lot,CASEWHEN bubble_lot>shib_lot THEN shib_lotWHEN shib_lot>bubble_lot THEN bubble_lotEND AS final_lot from lot),ranking as (selectcommon_address,bubble_amount,bubble_lot,shib_amount,shib_lot,CASEWHEN bubble_lot>shib_lot THEN shib_lotWHEN shib_lot>bubble_lot THEN bubble_lotEND AS final_lot from lot),count_lot as (select common_address,ROW_NUMBER() OVER (ORDER BY final_lot DESC) AS ranking,final_lot,bubble_amount,bubble_lot,shib_amount,shib_lot from ranking)-------TOTAL LOTS------SELECT sum(final_lot) as Total_lots from count_lot;