boomer77rune bonded
Updated 2022-05-11
99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
›
⌄
with bp as (select date_trunc('day', block_timestamp) as dt, sum(e8/1e8) as rune_bond, count(distinct from_address) as address_count_bond
from thorchain.bond_events
where bond_type = 'bond_paid'
group by 1),
br as (select date_trunc('day', block_timestamp) as dt, sum(e8/1e8) as rune_return, count(distinct from_address) as address_count_return
from thorchain.bond_events
where bond_type = 'bond_returned'
group by 1)
select a.dt, a.rune_bond, a.address_count_bond,
b.rune_return, case
when b.rune_return is null then 0
else b.rune_return end as rune_returned,
b.address_count_return, (a.rune_bond - rune_returned) as nett_bonding,
SUM(nett_bonding) OVER(ORDER BY a.dt asc ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) AS cumulative_rune
from bp a
left join br b on a.dt = b.dt
Run a query to Download Data