mu-tafaUntitled Query
Updated 2022-07-04Copy Reference Fork
99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
›
⌄
with tab1 as(SELECT
date_trunc(day,block_timestamp) as date,
count(DISTINCT tx_id) as tx_count
from flipside_prod_db.thorchain.swaps
where date>='2022-01-1'
and not from_asset like '%USDC%'
group by date),
tab2 as
(SELECT
date_trunc(day,block_timestamp) as date,
count(DISTINCT tx_id) as usdc_tx_count
from flipside_prod_db.thorchain.swaps
where date>='2022-01-1'
and from_asset like '%USDC%'
group by date)
SELECT
a.date,
usdc_tx_count/tx_count*100 as USDC_SWAP_RATE
from tab1 a left join tab2 b on a.date=b.date
Run a query to Download Data