misaghlbSeasons in the City
Updated 2022-10-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
›
⌄
WITH NEAR_TRANSFERS AS (
SELECT
date_trunc('day', block_timestamp) as date,
count(distinct tx_hash) as "Transfer Count",
sum(deposit/pow(10,24)) as amount,
max(deposit/pow(10,24)) as max_amount,-- max transfer amount
round(max_amount/amount*100,2) as max_percent,
avg(deposit/pow(10,24)) as avg_amount
FROM near.core.fact_transfers
WHERE status = TRUE
GROUP BY 1
),
BTC_PRICE AS (
SELECT
date(hour) as date_btc,
avg(price) as "BTC (USD)"
FROM ethereum.core.fact_hourly_token_prices
WHERE hour > '2021-10-01'
AND symbol IN ('WBTC')
GROUP BY 1
),
NEAR_PRICE AS (
SELECT
date(timestamp) as date_price,
avg(price_usd) as "NEAR (USD)"
FROM near.core.fact_prices
WHERE symbol = 'wNEAR'
GROUP BY 1
ORDER BY 1
)
SELECT
*,
amount as "NEAR Volume",
amount*"NEAR (USD)" as "NEAR USD Volume"
FROM NEAR_TRANSFERS
LEFT JOIN NEAR_PRICE ON date = date_price
Run a query to Download Data