NavidCopy of Copy of Copy of untitled
Updated 2022-11-08Copy Reference Fork
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 prices as (
select
date(hour) as day,
TOKEN_ADDRESS,
avg(price) as price_usd
from
ethereum.core.fact_hourly_token_prices
where
hour > CURRENT_DATE-30
group by 1,2
), ftx_addresses as (
select
address
from
ethereum.core.dim_labels
where
(LABEL_TYPE='cex' and LABEL ilike 'ftx') or ADDRESS_NAME ilike '%Alameda%'
), out_transfers as (
select
date_trunc('day', block_timestamp) as dt,
TX_HASH,
RAW_AMOUNT/pow(10,18)*p.price_usd as price,
case
when l.label ilike '%binance%' then 'Binance'
when l.label ilike '%kucoin%' then 'KuCoin'
when l.label ilike '%coinbase%' then 'CoinBase'
when l.label ilike '%kraken%' then 'Kraken'
when l.label ilike '%gate%' then 'Gate.IO'
when l.label ilike '%huobi%' then 'Huobi'
when l.label ilike '%bitfinex%' then 'BitFinex'
when l.label ilike '%bitstamp%' then 'BitStamp'
when l.label ilike '%bybit%' then 'ByBit'
when l.label ilike '%okx%' then 'OKX'
when l.label ilike '%gemini%' then 'Gemini'
when l.label ilike '%coincheck%' then 'CoinCheck'
when l.label ilike '%bithumb%' then 'Bithumb'
Run a query to Download Data