Sandeshosmo prive v unstakes
    Updated 2022-07-18
    with unstakes as
    (
    (
    select
    block_timestamp,
    TX_ID,currency,
    decimal,
    DELEGATOR_ADDRESS,
    VALIDATOR_ADDRESS,
    'normal_unstake' as "stake"
    from
    osmosis.core.fact_staking
    where
    action='undelegate'
    and TX_STATUS='SUCCEEDED'
    )
    union
    (
    select
    block_timestamp,
    TX_ID,currency,
    decimal,
    DELEGATOR_ADDRESS,
    VALIDATOR_ADDRESS,
    'super_unstake' as "stake"
    from osmosis.core.fact_superfluid_staking
    where action='Superfluiddelegate'
    )
    )
    select
    price.RECORDED_AT::date as "date",
    avg(price.price) as price,
    count(distinct unstakes.tx_id) as "number of unstakes"
    from osmosis.core.dim_prices price
    Run a query to Download Data