Yousefi_1994Optimistic Bears - Daily Swaps
Updated 2022-11-09
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 sushi_swap_transactions as (
select
block_timestamp,
tx_hash,
origin_from_address,
amount_in_usd
from optimism.sushi.ez_swaps
where block_timestamp::date >= '2022-07-01' and block_timestamp::date <= '2022-07-31'
and amount_in_usd is not null
and amount_in_usd > 0
),
velodrome_swap_transactions as (
select
block_timestamp,
tx_hash,
origin_from_address,
amount_in_usd
from optimism.velodrome.ez_swaps
where block_timestamp::date >= '2022-07-01' and block_timestamp::date <= '2022-07-31'
and amount_in_usd is not null
and amount_in_usd > 0
),
all_swap_transactions as (
select *, 'Sushiswap' as dex from sushi_swap_transactions
union all
select *, 'Velodrome' as dex from velodrome_swap_transactions
),
op_token_price as (
select
hour::date as "Days",
avg(price) as "OP Price"
from optimism.core.fact_hourly_token_prices
where hour::date >= '2022-07-01' and hour::date <= '2022-07-31'
and token_address = '0x4200000000000000000000000000000000000042'
group by "Days"
),
Run a query to Download Data