h4wkAVAX inflow and outflow CEX
Updated 2023-04-17
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
›
⌄
-- forked from AVAX inflow and outflow @ https://flipsidecrypto.xyz/edit/queries/f3a52f4d-26f3-4b39-9e0c-654ac98dcd06
with cex_address as (
select address
from crosschain.core.address_labels
where blockchain = 'avalanche'
and label_type = 'cex'
),
avax_price as (
select hour::date as price_date,
avg(price) as avax_price
from avalanche.core.fact_hourly_token_prices
where symbol = 'WAVAX'
group by 1
),
inflow as (
select *, eth_to_address as user_address from avalanche.core.ez_avax_transfers
where eth_from_address in (select address from cex_address)
),
outflow as (
select *, eth_from_address as user_address from avalanche.core.ez_avax_transfers
where eth_to_address in (select address from cex_address)
)
, base as (
select *, 'Inflow' as type from inflow
UNION
select *, 'Outflow' as type from outflow
)
select
type,
count(distinct user_address) as total_address,
Run a query to Download Data