SalehFlow_staking_date
    Updated 2024-12-28
    with lst_flow_price as (
    SELECT
    date_trunc(day,hour) as avg_date,
    avg(price) as avg_price
    from flow.price.ez_prices_hourly
    where symbol = 'FLOW'
    -- and avg_date>='2024-01-01'
    group by 1
    )
    ,lst_flow_price_one_day as (
    select top 1
    date_trunc(day,hour) as avg_date,
    avg(price) as avg_price
    from flow.price.ez_prices_hourly
    where symbol = 'FLOW'
    -- and avg_date>='2024-01-01'
    group by 1
    order by avg_date desc
    )
    ,lst_stake as (
    select
    block_timestamp::date as date
    ,tx_id
    ,delegator as staker
    ,amount as amount
    from flow.gov.ez_staking_actions
    where (action ='DelegatorTokensCommitted' or action='TokensCommitted')
    and TX_SUCCEEDED=true
    -- and node_id not in ('fcb55c2d1fb2737b159704b5a30b194b8a8ddfb4691d55692af597ac6e236201','7133b78ac9e788c428a354f2f96b5cc8109123425a88cc75d729bf5adfd0a25d')
    )
    ,lst_unstake as (
    select
    block_timestamp::date as date
    ,tx_id
    ,delegator as staker
    QueryRunArchived: QueryRun has been archived