Popex404#1 Sei Stake growth
    Updated 2023-10-29

    With cte as (
    SELECT Month as "Week",
    case
    when Previous_Month<1 then Null else
    ((Monthly_Transactions/Previous_Month)-1) *100 end as "WoW Growth Rates", Monthly_Transactions as "Weekly Transactions"
    FROM(
    SELECT
    date_trunc('week', block_timestamp) as Month
    ,COUNT(DISTINCT tx_id) as Monthly_Transactions
    ,lag(Monthly_Transactions) OVER (ORDER BY Month) as Previous_Month
    FROM sei.gov.fact_staking
    where block_timestamp >= '2023-08-15'
    GROUP BY Month
    ORDER BY Month ASC
    )
    )

    select
    case
    when "WoW Growth Rates" is Null then 'Start'
    when "WoW Growth Rates" > 0 Then 'Growth' else 'Decay' end as type,
    *
    from cte


    Run a query to Download Data