kasadeghUntitled Query
    Updated 2022-10-16
    with sol_defi_tx_stats_before as (
    select label as name,
    count(distinct tx_id) as tx_count ,
    count(distinct instruction:accounts[0]) as users_count
    from solana.core.fact_events inner join solana.core.dim_labels
    on program_id = address
    where SUCCEEDED='TRUE' and
    label_type in( 'dex', 'defi', 'dapp') and
    label_type != 'pyth' and
    block_timestamp::date >='2022-10-7' and block_timestamp::date< '2022-10-10'
    group by 1
    order by 1
    )
    , sol_defi_tx_stats_after as (
    select label as name,
    count(distinct tx_id) as tx_count ,
    count(distinct instruction:accounts[0]) as users_count
    from solana.core.fact_events inner join solana.core.dim_labels
    on program_id = address
    where SUCCEEDED='TRUE' and
    label_type in( 'dex', 'defi') and
    label_type != 'pyth' and
    block_timestamp::date >='2022-10-12' and block_timestamp::date< '2022-10-16'
    group by 1
    order by 1
    )

    select a.name,
    ((a.tx_count-b.tx_count)/b.tx_count)*100 as change_percentage
    from sol_defi_tx_stats_before as b join sol_defi_tx_stats_after as a
    on b.name=a.name
    where change_percentage>0
    order by change_percentage desc
    limit 15

    Run a query to Download Data