jackguySolend Liquidation Battle
    Updated 2022-07-07
    WITH tab1 as (
    SELECT
    trunc(block_timestamp,'day') as date,
    sum(1) as txs
    from solana.core.fact_events
    where event_type is not null
    group by 1
    ), tab0 as (
    SELECT *
    FROM (VALUES
    ('Whale Liquidity', 184.29), ('Other Liquidity', 6.93)
    )
    ), tab2 as (
    SELECT
    trunc(block_timestamp,'day') as date,
    sum(1) as txs
    from solana.core.fact_events
    where event_type LIKE 'delegate'
    group by 1
    ), tab3 as (
    SELECT
    tab2.date,
    tab1.txs as total_txs,
    sum(total_txs) over (order by tab1.date) as cum_txs,
    tab2.txs as staked_txs,
    sum(staked_txs) over (order by tab1.date) as cum_staked_txs,
    (staked_txs/total_txs)*100 as pcg_staking_txs,
    100-pcg_staking_txs as pcg_non_staking_txs
    from tab1, tab2 where tab1.date = tab1.date
    )
    SELECT * from tab0
    Run a query to Download Data