Unit Zero LabsClaim Stats By ENA Claimed copy
Updated 2024-04-24
999
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
›
⌄
-- forked from kida / Claim Stats By ENA Claimed @ https://flipsidecrypto.xyz/kida/q/TgbCX4NLUzIq/claim-stats-by-ena-claimed
with claims as (
select
decoded_log:to as claimer,
sum(decoded_log:value) / 1e18 as claimed_amount
from ethereum.core.ez_decoded_event_logs
where contract_address = lower('0x57e114B691Db790C35207b2e685D4A43181e6061')
and origin_function_signature = '0x8132b321'
group by 1
),
liquidity_actions as (
select
claimer,
claimed_amount,
sum(
iff(
action = 'INCREASE_LIQUIDITY',
case when token0_address = lower('0x57e114B691Db790C35207b2e685D4A43181e6061')
then amount0_adjusted
else amount1_adjusted
end,
0
)
) as ena_added,
sum(
iff(
action = 'DECREASE_LIQUIDITY',
case when token0_address = lower('0x57e114B691Db790C35207b2e685D4A43181e6061')
then amount0_adjusted
else amount1_adjusted
end,
0
)
) as ena_removed,
QueryRunArchived: QueryRun has been archived