mhmTotal success rate
Updated 2022-10-03Copy Reference Fork
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 swap_data as (
select 'Swap' as tx_type,count(tx_hash) as total_txs,
count(CASE WHEN status = 'SUCCESS' THEN 1 end) as success,
count(CASE WHEN status = 'FAIL' THEN 1 end) as fail,
(success/total_txs)*100 as success_rate
from ethereum.core.fact_transactions s
where ORIGIN_FUNCTION_SIGNATURE in (select ORIGIN_FUNCTION_SIGNATURE from ethereum.sushi.ez_swaps)
group by 1
),
lend_data as (
select 'Lend' as tx_type, count(tx_hash) as total_txs,
count(CASE WHEN status = 'SUCCESS' THEN 1 end) as success,
count(CASE WHEN status = 'FAIL' THEN 1 end) as fail,
(success/total_txs)*100 as success_rate
from ethereum.core.fact_transactions L
where ORIGIN_FUNCTION_SIGNATURE in (select ORIGIN_FUNCTION_SIGNATURE from ethereum.sushi.ez_lending)
group by 1
),
borrow_data as (
select 'Borrow' as tx_type, count(tx_hash) as total_txs,
count(CASE WHEN status = 'SUCCESS' THEN 1 end) as success,
count(CASE WHEN status = 'FAIL' THEN 1 end) as fail,
(success/total_txs)*100 as success_rate
from ethereum.core.fact_transactions B
where ORIGIN_FUNCTION_SIGNATURE in (select ORIGIN_FUNCTION_SIGNATURE from ethereum.sushi.ez_borrowing)
group by 1
),
liquidity_data as (
select 'add or remove liquidity' as tx_type, count(tx_hash) as total_txs,
count(CASE WHEN status = 'SUCCESS' THEN 1 end) as success,
count(CASE WHEN status = 'FAIL' THEN 1 end) as fail,
(success/total_txs)*100 as success_rate
from ethereum.core.fact_transactions A
Run a query to Download Data