hessUsers Breakdown based on total swaps on Arbitrum
Updated 2022-10-16Copy Reference Fork
99
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
›
⌄
with tx as ( select *
from polygon.core.fact_event_logs
where event_name = 'Swap'
and block_timestamp::date >= CURRENT_DATE - 180)
,
label as (
select ADDRESS as token, PROJECT_NAME
from polygon.core.dim_labels
where label_type = 'dex' and project_name ilike '%uniswap%'
)
,
swaps as ( select date(BLOCK_TIMESTAMP) as date , tx_hash as tx , origin_from_address as swapper, PROJECT_NAME as project
from polygon.core.fact_event_logs a join label b on a.ORIGIN_TO_ADDRESS = b.token
where tx_hash in ( select tx_hash from tx) and origin_from_address = EVENT_INPUTS:from
UNION
select date(block_timestamp) as date, tx_hash as tx , origin_from_address as swapper, 'Sushiswap' as project
from polygon.sushi.ez_swaps
where block_timestamp::date >= CURRENT_DATE - 180
)
,
arbi_tx as ( select *
from arbitrum.core.fact_event_logs
where event_name = 'Swap'
and block_timestamp::date >= CURRENT_DATE - 180)
,
arbi_label as (
select ADDRESS as token, PROJECT_NAME
from arbitrum.core.dim_labels
where label_type = 'dex' and project_name ilike '%uniswap%'
)
,
arbi_swaps as ( select date(BLOCK_TIMESTAMP) as date , tx_hash as tx , origin_from_address as swapper, PROJECT_NAME as project
from arbitrum.core.fact_event_logs a join arbi_label b on a.ORIGIN_TO_ADDRESS = b.token
where tx_hash in ( select tx_hash from arbi_tx) and origin_from_address = EVENT_INPUTS:from
UNION
select date(block_timestamp) as date, tx_hash as tx , origin_from_address as swapper, 'Sushiswap' as project
Run a query to Download Data