Moesupf 3
    Updated 2022-12-20
    with base as (
    select
    BLOCK_TIMESTAMP,DELEGATOR_ADDRESS,
    split(CURRENCY,'/')[2] as pool_id ,
    VALIDATOR_ADDRESS,
    action,
    AMOUNT from
    osmosis.core.fact_superfluid_staking
    where
    CURRENCY is not null
    and
    VALIDATOR_ADDRESS is not null
    and
    AMOUNT is not null )


    select
    BLOCK_TIMESTAMP::date date ,
    count (distinct DELEGATOR_ADDRESS) as DELEGATORs,
    count (distinct VALIDATOR_ADDRESS) as VALIDATORs,
    sum( AMOUNT/1e18) as osmo_amount,
    sum( AMOUNT/1e18) as osmo_amount,
    sum( AMOUNT/1e18) as osmo_amount,
    avg( AMOUNT/1e18) as avg_osmo_amount,
    median( AMOUNT/1e18) as median_osmo_amount,
    max( AMOUNT/1e18) as max_osmo_amount
    from base
    where action = 'delegate'
    and pool_id = '{{pool_id}}'
    group by 1
    --1,678,704,712,674,722,9,604,497,812,584,3,481,42,463,15)

    Run a query to Download Data