ML6BUSD Volume over time(swap)
Updated 2022-07-02Copy 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
›
⌄
with swap_USDC as (select case
when from_asset like '%USDC%' then from_amount_usd
when to_asset like '%USDC%' then to_amount_usd end as amount
,to_date(block_timestamp) as swap_date
from flipside_prod_db.thorchain.swaps
where from_asset like '%USDC%' or to_asset like '%USDC%')
,swap_BUSD as (select case
when from_asset like '%BUSD%' then from_amount_usd
when to_asset like '%BUSD%' then to_amount_usd end as amount
,to_date(block_timestamp) as swap_date
from flipside_prod_db.thorchain.swaps
where from_asset like '%BUSD%' or to_asset like '%BUSD%')
, total_swap as (select count(*) as cnt,to_date(block_timestamp) as swap_date from flipside_prod_db.thorchain.swaps
group by 2)
, swap_count_USDC as (select count(*) as cnt, swap_date from swap_USDC
group by 2)
, swap_count_BUSD as (select count(*) as cnt, swap_date from swap_BUSD
group by 2)
select sum(amount), swap_date from swap_BUSD
group by 2
Run a query to Download Data