mohammadhop ➡️ eth
Updated 2022-11-01
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 A as (select
block_timestamp,
TX_HASH,
ORIGIN_FROM_ADDRESS,
AMOUNT,
SYMBOL
from ethereum.core.ez_token_transfers
where ORIGIN_TO_ADDRESS = lower('0x25ace71c97b33cc4729cf772ae268934f7ab5fa1')
and SYMBOL IN ('USDC' , 'USDT', 'LUSD', 'TUSD')
union all
select
block_timestamp,
TX_HASH,
ORIGIN_FROM_ADDRESS,
AMOUNT_USD as amount,
'ETH' as SYMBOL
from ethereum.core.ez_eth_transfers
where ORIGIN_TO_ADDRESS = lower('0x25ace71c97b33cc4729cf772ae268934f7ab5fa1'))
select
count(distinct TX_HASH) as withdrawn_tx,
sum(AMOUNT) as withdrawn_amount,
count(distinct ORIGIN_FROM_ADDRESS) as withdrawn_users,
date_trunc('week',block_timestamp) as block_week,
sum(withdrawn_amount) over (partition by SYMBOL order by block_week) as cum_withdrawn_amount,
sum(withdrawn_tx) over (partition by SYMBOL order by block_week) as cum_withdrawn_tx,
sum(withdrawn_users) over (partition by SYMBOL order by block_week) as cum_withdrawn_user,
avg(withdrawn_amount) over (order by block_week rows between 30 preceding and 1 preceding) as "30week_moving_avg_amount",
avg(withdrawn_tx) over (order by block_week rows between 30 preceding and 1 preceding) as "30week_moving_avg_tx",
avg(withdrawn_users) over (order by block_week rows between 30 preceding and 1 preceding) as "30week_moving_avg_user",
SYMBOL
from A
group by block_week,SYMBOL
Run a query to Download Data