bergStablecoins Pool on Uniswap Netflow during last month
Updated 2022-12-23Copy Reference Fork
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 today as (
select
pool_name,
sum (token0_balance_usd + token1_balance_usd) as today_balance_usd
from ethereum.uniswapv3.ez_pool_stats
where block_timestamp::date = '2022-12-08'
and token0_symbol in ('USDT', 'USDC', 'BUSD', 'DAI', 'USDP', 'TUSD', 'USDD', 'USDN', 'GUSD', 'FEI', 'FRAX', 'LUSD', 'SUSD')
and token1_symbol in ('USDT', 'USDC', 'BUSD', 'DAI', 'USDP', 'TUSD', 'USDD', 'USDN', 'GUSD', 'FEI', 'FRAX', 'LUSD', 'SUSD')
group by 1
having today_balance_usd > 0
),
past as (
select
pool_name,
sum (token0_balance_usd + token1_balance_usd) as past_balance_usd
from ethereum.uniswapv3.ez_pool_stats
where block_timestamp::date = '2022-11-08'
and token0_symbol in ('USDT', 'USDC', 'BUSD', 'DAI', 'USDP', 'TUSD', 'USDD', 'USDN', 'GUSD', 'FEI', 'FRAX', 'LUSD', 'SUSD')
and token1_symbol in ('USDT', 'USDC', 'BUSD', 'DAI', 'USDP', 'TUSD', 'USDD', 'USDN', 'GUSD', 'FEI', 'FRAX', 'LUSD', 'SUSD')
group by 1
having past_balance_usd > 0
)
select pool_name, today_balance_usd - past_balance_usd as netflow
from today join past using(pool_name)
group by 1, today_balance_usd, past_balance_usd
Run a query to Download Data