Ali3NDistribution of Days by Failure Rates
Updated 2022-10-02Copy 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 sushipools as (select distinct pool_address from ethereum.core.dim_dex_liquidity_pools where platform ilike 'sushiswap'),
sushiswaps as (select distinct origin_function_signature from ethereum.sushi.ez_swaps),
sushilends as (select distinct origin_function_signature from ethereum.sushi.ez_lending),
sushiborrows as (select distinct origin_function_signature from ethereum.sushi.ez_borrowing),
Swapt as (
select 'Swap' as Action_Type,
block_timestamp::date as date,
count (case when STATUS != 'SUCCESS' then 1 end) as Failed_TX,
count (case when STATUS = 'SUCCESS' then 1 end) as Success_TX,
(Failed_TX / (Success_TX + Failed_TX)) * 100 as Failure_Rate
from ethereum.core.fact_transactions
where origin_function_signature in (select origin_function_signature from sushiswaps)
group by 1,2),
Lendingt as (
select 'Lending' as Action_Type,
block_timestamp::date as date,
count (case when STATUS != 'SUCCESS' then 1 end) as Failed_TX,
count (case when STATUS = 'SUCCESS' then 1 end) as Success_TX,
(Failed_TX / (Success_TX + Failed_TX)) * 100 as Failure_Rate
from ethereum.core.fact_transactions
where origin_function_signature in (select origin_function_signature from sushilends)
group by 1,2),
Borrowt as (
select 'Borrow' as Action_Type,
block_timestamp::date as date,
count (case when STATUS != 'SUCCESS' then 1 end) as Failed_TX,
count (case when STATUS = 'SUCCESS' then 1 end) as Success_TX,
(Failed_TX / (Success_TX + Failed_TX)) * 100 as Failure_Rate
from ethereum.core.fact_transactions
where origin_function_signature in (select origin_function_signature from sushiborrows)
Run a query to Download Data