AzinOptimism2
Updated 2023-03-17Copy Reference Fork
99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
›
⌄
select
date_trunc('day',BLOCK_TIMESTAMP) as date,
sum
(case
when (SYMBOL_IN in ('USDT','USDC','TUSD','BUSD','DAI','USDD','USDN') and SYMBOL_OUT not in ('USDT','USDC','TUSD','BUSD','DAI','USDD','USDN')) then AMOUNT_IN else null end )as inflow,
sum
(case
when (SYMBOL_IN not in ('USDT','USDC','TUSD','BUSD','DAI','USDD','USDN') and SYMBOL_OUT in ('USDT','USDC','TUSD','BUSD','DAI','USDD','USDN')) then AMOUNT_OUT else null end )as outflow,
inflow-outflow as flow ,
sum(flow) over (order by date) as cflow
from
optimism.sushi.ez_swaps
where
(SYMBOL_IN in ('USDT','USDC','TUSD','BUSD','DAI','USDD','USDN') or SYMBOL_OUT in ('USDT','USDC','TUSD','BUSD','DAI','USDD','USDN'))
group by date
Run a query to Download Data