angel09-SK3z3aDaily DEFI Staked Users
    Updated 2022-10-15
    with defi_users_tbl as (select distinct instruction:accounts[0] as defi_users , label as dex_name
    from solana.core.fact_events LEFT outer JOIN solana.core.dim_labels
    on program_id = address
    where SUCCEEDED='TRUE' and label_type in( 'dex', 'defi') and block_timestamp::date >='2022-10-11'
    )

    SELECT count(distinct signers[0]) as staked_users , dex_name , block_timestamp::date as stake_date
    FROM solana.core.fact_staking_lp_actions inner join defi_users_tbl
    on defi_users=signers[0]
    where SUCCEEDED='TRUE' and block_timestamp::date >='2022-10-11'
    group by dex_name,stake_date
    Run a query to Download Data