adriaparcerisasSushi reward program for farmers 3
Updated 2022-05-09
99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
›
⌄
with
datas as(
SELECT distinct EVENT_INPUTS:account::string as users
from ethereum_core.fact_event_logs
where CONTRACT_ADDRESS=lower('0x1026cbed7b7E851426b959BC69dcC1bf5876512d')
and EVENT_NAME='Claimed'
UNION ALL
SELECT distinct ADDRESS as users
from ethereum_sushi.dim_distributor_reward_schedule
where ADDRESS not in (SELECT distinct EVENT_INPUTS:account::string from ethereum_core.fact_event_logs where CONTRACT_ADDRESS=lower('0x1026cbed7b7E851426b959BC69dcC1bf5876512d') and EVENT_NAME='Claimed') and MERKLE_ROOT=lower('0x015e6c2cd1a4d6fa77aa1884c436b2435aae4beab5c9a091f18fd0c00dc7e577')
)
SELECT
case when users in (SELECT FROM_ADDRESS from ethereum_core.fact_transactions group by 1 having max(BLOCK_TIMESTAMP)>=CURRENT_DATE-90) then 'Non-dead wallets'
else 'Dead wallets' end as type_of_wallet,
count(distinct users) as users
from datas
group by 1
Run a query to Download Data