Skip to content
Dune Analytics

@tianqi / tBTC Accumulative Amount

tBTC Accumulative Amount

Loading
 

About queries and results

Dune Analytics lets you explore, create, and share Ethereum analytics. You can find an endless amount of great queries and dashboards on Dune.

We have decoded Ethereum smart contract data so you can do powerful analysis with simple SQL queries and visualise the query results into beautiful graphs.

Dune Analytics is free for everyone forever. If you want extra features like private queries, export your results and more check out our Pro plan.

SQL query results

Loading
 

SQL query

1with burn_tbtc as
2(select date_trunc('day',evt_block_time) as d_date,'burnt_tbtc' as tbtc_catogary ,sum(t.value/1e18) tbtc from keep_v110."TBTCToken_evt_Transfer" t where t."to" = '\x0000000000000000000000000000000000000000'
3group by 1),
4
5ever_minted_tbtc as
6(select date_trunc('day',evt_block_time) as d_date,'ever_minted_tbtc' as tbtc_catogary ,sum(t.value/1e18) tbtc from keep_v110."TBTCToken_evt_Transfer" t where t."from" = '\x0000000000000000000000000000000000000000'
7group by 1),
8
9current_tbtc as (
10select a.d_date,'current_tbtc' as tbtc_catogary ,case when b.tbtc is null then a.tbtc else (a.tbtc-b.tbtc) end as tbtc from ever_minted_tbtc a left join burn_tbtc b on b.d_date= a.d_date
11),
12
13accu_burn_tbtc as 
14(
15select t.d_date,t.tbtc_catogary,sum(a.tbtc) as tbtc from burn_tbtc t inner join burn_tbtc a on a.d_date <= t.d_date
16group by 1,2
17),
18
19accu_ever_minted_tbtc as 
20(
21select t.d_date,t.tbtc_catogary,sum(a.tbtc) as tbtc from ever_minted_tbtc t inner join ever_minted_tbtc a on a.d_date <= t.d_date
22group by 1,2
23),
24
25accu_current_tbtc as ...