ArioOptimism-USDC Swap Volume
Updated 2023-04-15
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
›
⌄
with Swap as (
select
date_trunc(day, BLOCK_TIMESTAMP)::date as date,
sum(AMOUNT_OUT_USD) as "Swap Volume (USD)"
from optimism.core.ez_dex_swaps
where EVENT_NAME = 'Swap'
and SYMBOL_IN = 'USDC'
and SYMBOL_OUT = 'OP'
and BLOCK_TIMESTAMP >= Current_date - 60
and BLOCK_TIMESTAMP < Current_date
group by 1
),
price as (
select
date_trunc(day, hour)::date as date,
avg(price) as price
from optimism.core.fact_hourly_token_prices
where symbol = 'OP'
and hour >= Current_date - 60
and hour < Current_date
group by 1
)
select
a.*,
b.price
from swap a join price b on a.date = b.date
Run a query to Download Data