vendettaUntitled Query
Updated 2022-07-20
9
1
2
3
4
5
6
7
8
9
›
⌄
with AB as (select case when tx_receipt[0]:outcome:status:Failure is not NULL THEN 'fail'
else 'sucess' end as type, TXN_HASH, BLOCK_TIMESTAMP
from flipside_prod_db.mdao_near.transactions ----I US IN DATA TABEL
where BLOCK_TIMESTAMP::date >= '2022-01-01'),
W as (SELECT BLOCK_TIMESTAMP::date as date, type, count(DISTINCT TXN_HASH) as tx_counts from AB GROUP by 1,2 order by 1,2),
c as (SELECT date, sum(tx_counts) as daily_tx from W GROUP by 1 order by 1),
R as (select DATE, tx_counts as daily_fail from W where TYPE = 'fail')
SELECT c.date, daily_fail/daily_tx as fail_rate
from c join R on c.date = R.date order by 1optimismoptimism
Run a query to Download Data