Tony_IntelveJoe staking
    select
    --sum(volume) over (partition by action order by date) as cumulative_volume,
    sum(amount) over (partition by action order by date) as cumulative_amount,
    date,
    action
    from (
    select
    sum(amount) as amount,
    action,
    date
    from (
    select
    --sum(case when s.origin_function_signature = '0x2e1a7d4d' then (-s.amount/pow(10,18)*p.price)
    --when s.origin_function_signature = '0xb6b55f25' then (s.amount/pow(10,18)*p.price) end) as volume,
    sum(case when s.from_address = '0x25d85e17dd9e544f6e9f8d44f99602dbf5a97341' then (-s.RAW_AMOUNT/pow(10,18))
    when s.to_address = '0x25d85e17dd9e544f6e9f8d44f99602dbf5a97341' then (s.RAW_AMOUNT/pow(10,18)) end) as amount,
    case when s.from_address = '0x25d85e17dd9e544f6e9f8d44f99602dbf5a97341' then 'unstaking'
    when s.to_address = '0x25d85e17dd9e544f6e9f8d44f99602dbf5a97341' then 'staking' end as action,
    date_trunc('day', s.block_timestamp) as date
    from avalanche.core.fact_token_transfers s
    --join avalanche.core.fact_hourly_token_prices p
    --on s.contract_address = p.token_address
    --and date_trunc('hour', s.block_timestamp) = p.hour
    where s.contract_address = lower('0x6e84a6216eA6dACC71eE8E6b0a5B7322EEbC0fDd')
    and s.block_timestamp::date >= '2022-02-24'
    group by 2, 3

    union all

    select
    0 as amount,
    'staking' as action,
    date_trunc('day', block_timestamp) as date
    from avalanche.core.fact_token_transfers
    where block_timestamp::date >= '2022-02-24'

    Run a query to Download Data