maybeyonasthor_synth_net_asset
Updated 2022-04-29
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
28
29
30
31
32
33
34
35
36
›
⌄
with
mints as (
select
block_timestamp,
'mint' as event,
tx_id,
split(pool_name,'-')[0]::string as asset,
to_amount as amt_minted,
to_amount_usd as amt_minted_usd
from thorchain.swaps
where to_asset like '%%/%%'
),
burns as (
select
block_timestamp,
'burn' as event,
tx_id,
split(pool_name,'-')[0]::string as asset,
from_amount as amt_minted,
from_amount_usd as amt_minted_usd
from thorchain.swaps
where from_asset like '%%/%%'
)
select
date(block_timestamp) as date,
-- event,
asset,
-- count(distinct tx_id) as txs,
sum(
case when event = 'mint' then amt_minted_usd else -amt_minted_usd end
) as net_mint_vol
from (
select * from mints
union all
select * from burns
Run a query to Download Data