elsinaOP trade info vs Price
Updated 2022-10-05
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 sell_velodrome as (
select BLOCK_TIMESTAMP::date as "Day",sum(AMOUNT_IN) as "Amount"
from optimism.velodrome.ez_swaps
where SYMBOL_IN = 'OP' and "Day" >= '2022-05-29'
group by "Day"
),buy_velodrome as (
select BLOCK_TIMESTAMP::date as "Day",sum(AMOUNT_IN) as "Amount"
from optimism.velodrome.ez_swaps
where SYMBOL_out = 'OP' and "Day" >= '2022-05-29'
group by "Day"
),sell_sushi as (
select BLOCK_TIMESTAMP::date as "Day",sum(AMOUNT_IN) as "Amount"
from optimism.sushi.ez_swaps
where SYMBOL_IN = 'OP' and "Day" >= '2022-05-29'
group by "Day"
),buy_sushi as (
select BLOCK_TIMESTAMP::date as "Day",sum(AMOUNT_IN) as "Amount"
from optimism.sushi.ez_swaps
where SYMBOL_out = 'OP' and "Day" >= '2022-05-29'
group by "Day"
) , op_price as (
select HOUR::date as "Day",avg(PRICE) as "Daily Price" from optimism.core.fact_hourly_token_prices where SYMBOL = 'OP' group by "Day"
)
select
sv."Day" as "Day",
sv."Amount" as "Sell V",
bv."Amount" as "Buy V",
ss."Amount" as "Sell S",
bs."Amount" as "Buy S",
"Buy V"+"Sell V" as "Velodrome Volume",
"Buy S"+"Sell S" as "Sushi Volume",
"Buy V"+"Buy S" as "Total Buy",
"Sell V"+"Sell S" as "Total Sell",
"Total Buy"+"Total Sell" as "Daily Volume",
Run a query to Download Data