NavidCopy of Copy of Copy of Untitled Query
Updated 2022-11-07
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,
symbol,
avg(PRICE) as price_usd
from
optimism.core.fact_hourly_token_prices
group by
day,
TOKEN_ADDRESS, symbol
), buys as (
select
date(BLOCK_TIMESTAMP) as day,
ORIGIN_TO_ADDRESS as buyer,
CONTRACT_ADDRESS as token,
sum(RAW_AMOUNT) as amount
from
optimism.core.fact_token_transfers
group by
1, 2, 3
), sells as (
select
date(BLOCK_TIMESTAMP) as day,
ORIGIN_FROM_ADDRESS as seller,
CONTRACT_ADDRESS as token,
sum(RAW_AMOUNT) as amount
from
optimism.core.fact_token_transfers
group by
1, 2, 3
), assets as (
select
day,
buyer as wallet,
token,
Run a query to Download Data