leo-lZzln2Untitled Query
    Updated 2022-11-11
    with maintable as (
    select block_timestamp::date as date,
    validator_name,
    count (distinct tx_id) as TX_Count,
    count (distinct signers[0]) as Users_Count,
    abs (sum ((post_tx_staked_balance - pre_tx_staked_balance)/1e9)) as Total_Volume,
    abs (avg ((post_tx_staked_balance - pre_tx_staked_balance)/1e9)) as Average_Volume
    from solana.core.ez_staking_lp_actions
    where succeeded = 'TRUE'
    and block_timestamp >= CURRENT_DATE - 10
    and event_type in ('delegate','activate')
    and node_pubkey is not null
    group by 1,2),

    finaltable as (
    select *,
    row_number() over (partition by date order by TX_Count desc) as RN
    from maintable)

    select * from finaltable
    where RN <= 10
    order by date
    Run a query to Download Data