StangFAST02 - activity
Updated 2023-05-20
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 01 - CEX to DEX @ https://flipsidecrypto.xyz/edit/queries/fdc02176-5bc7-496e-9316-ad5821921bd4
--- outflow use origin_to_address
--- inflow user origin_from_address
with
eth_price AS
(
SELECT
date_trunc( 'day' , a.hour ) AS day
, avg( a.price ) AS price_usd
FROM
ethereum.core.fact_hourly_token_prices a
WHERE
a.symbol = 'WETH'
GROUP BY
1
ORDER BY
1
)
,
--- in_flow ---
from_cex AS
(
SELECT
date_trunc( 'month' , a.block_timestamp ) AS date
, count( DISTINCT a.tx_hash ) AS transactions
, count( DISTINCT a.origin_from_address ) AS users
, sum( a.amount_usd ) AS usd_volumes
, sum( b.tx_fee * d.price_usd ) AS fees
FROM
ethereum.core.ez_token_transfers a
JOIN
Run a query to Download Data