MasiTOTAL DAILY NUMBER OF USERS, Transactions, Volume
Updated 2022-09-20Copy 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 token_data as (
select * from (
VALUES ( '0x9D575a9bF57a5e24a99D29724B86ca021A2b0435', 'ETH' , 18),
('0x2f2a2543b76a4166549f7aab2e75bef0aefc5b0f','WBTC',8),
('0xda10009cbd5d07dd0cecc66161fc93d7c9000da1','DAI',18),
('0xff970a61a04b1ca14834a43f5de4533ebddb5cc8','USDC',6),
('0xf97f4df75117a78c1a5a0dbb814af92458539fb4','LINK',18),
('0xfa7f8980b0f1e64a2062791cc3b0871572f1f7f0','UNI',18),
('0x17fc002b466eec40dae837fc4be5c67993ddbd6f','FRAX',18),
('0x82af49447d8a07e3bd95bd0d56f35241523fbab1','WETH',18))
AS X(address,symbol,decimal))
,
token_price as ( select trunc(hour,'day') as price_day ,
symbol,
avg(price) as prices
from ethereum.core.fact_hourly_token_prices
where symbol in ( select symbol from token_data)
group by 1,2)
,
Swap_data as ( select trunc(BLOCK_TIMESTAMP,'day') as day,
ORIGIN_FROM_ADDRESS as user,
tx_hash,
EVENT_INPUTS:inputToken as token0,
EVENT_INPUTS:inputValue as amount0,
EVENT_INPUTS:outputToken as token1,
EVENT_INPUTS:outputValue as amount1
from arbitrum.core.fact_event_logs
where EVENT_NAME = 'Swap' and
contract_address = lower('0xabbc5f99639c9b6bcb58544ddf04efa6802f4064')
and origin_from_address = EVENT_INPUTS:sender::string),
tb1 as ( select day ,
user,
tx_hash,
token0,
b.symbol as token_name0,
Run a query to Download Data