cheeyoung-kekToken distribution in tornado
Updated 2022-08-10Copy 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 tornado_address as(
select
address,
address_name,
project_name
from flipside_prod_db.crosschain.address_labels
where project_name like 'tornado cash' and blockchain = 'ethereum'
) ,
prices as (
select hour as day, avg(price) as price, symbol
from ethereum.core.fact_hourly_token_prices
group by 1,3
),
token_tx as(
select
a.block_timestamp as day,
from_address,
to_address,
a.amount as amount,
(a.amount*b.price) as USD,
a.symbol
from ethereum.core.ez_token_transfers a
join prices b on date_trunc('hour', a.block_timestamp)=b.day and a.symbol=b.symbol
join ethereum.core.fact_hourly_token_prices c
on date_trunc('hour', a.block_timestamp)=c.hour
and a.contract_address = c.token_address
where block_timestamp::date <= current_date - 1
and b.symbol is not null
and amount > 0
and USD > 0)
select
Run a query to Download Data