binhachonStablecoin Swappers - #1
Updated 2022-07-04
99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
›
⌄
select
date_trunc('week', block_timestamp) as time,
case
when pool_name = 'BNB.BUSD-BD1' and (from_asset like '%/%' or to_asset like '%/%') then 'BUSD - synth'
when pool_name = 'BNB.BUSD-BD1' then 'BUSD'
when (from_asset like '%/%' or to_asset like '%/%') then 'USDC - synth'
else 'USDC' end
as asset,
sum(from_amount_usd + to_amount_usd) / 2 as volume,
count(*) as number_of_swaps,
avg(from_amount_usd + to_amount_usd) / 2 as swap_size
from thorchain.swaps
where pool_name in ('BNB.BUSD-BD1', 'ETH.USDC-0XA0B86991C6218B36C1D19D4A2E9EB0CE3606EB48')
and time >= getdate() - interval'6 months'
group by 1, 2
Run a query to Download Data