Query editor
with wallets_to_lock_funds_for_airdrops as (select distinct contract_address, wallet_address from (select * from (select *,min(number_of_transaction_for_amount) over (partition by wallet_address) as min_number_of_transaction_for_amount,min(number_of_transaction_for_amount) over (partition by wallet_address, value) as min_number_of_transaction_for_amount_per_wallet,count(value) over (partition by wallet_address) as count_of_distinct_values_from_walletfrom (select distinct"from" as wallet_address,contract_address,value,count(value) as number_of_transaction_for_amountfrom erc20_base.evt_transferwhere value > 0and contract_address = {{token_ address}}--and "from" = 0x614f39ef7c65Dc491F7F2bf49839fDd388aA026bgroup by 1,2,3) ) where min_number_of_transaction_for_amount > 50 or (min_number_of_transaction_for_amount_per_wallet > 50 and count_of_distinct_values_from_wallet < 10)) order by 1),wallets_that_recived_airdrops as (selecttr.contract_address,tr.evt_tx_hash,tr.to airdrop_receiverfrom erc20_base.evt_transfer trleft join wallets_to_lock_funds_for_airdrops won w.wallet_address = tr."from"-- where tr.contract_address = {{token_ address}}and w.wallet_address is not null),number_of_token_transactions_per_wallet as (select *,count( distinct evt_tx_hash) count_of_tx_from_walletfrom wallets_that_recived_airdropsgroup by 1,2,3)select *,case when count_of_tx_from_wallet = 1 then true else false end as airdrop_receiver_no_tradesfrom number_of_token_transactions_per_wallet