StangFAST04 - inout
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 04 - inout @ https://flipsidecrypto.xyz/edit/queries/3da63dd4-b507-40c2-a269-5f7c555d3ed4
-- forked from 02 - inout @ https://flipsidecrypto.xyz/edit/queries/9ec91613-6266-4361-86eb-75a688e1f76e
-- forked from 02 - activity @ https://flipsidecrypto.xyz/edit/queries/a76e08de-ed30-4746-a309-3aac942009a8
-- forked from 01 - CEX to cex @ 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
)
,
--- Outflow ---
from_cex AS
(
SELECT
count( DISTINCT a.tx_hash ) AS transactions
, count( DISTINCT a.origin_from_address ) AS users
, sum( a.amount_usd ) AS usd_volumes
Run a query to Download Data