adriaparcerisasGMX overview 2
    Updated 2022-09-18
    WITH tab1 as (
    SELECT trunc(block_timestamp,'day')as day,
    'Stake' as action,
    tx_hash,
    ORIGIN_FROM_ADDRESS,
    RAW_AMOUNT / POW(10,18) as cantidad
    from arbitrum.core.fact_token_transfers
    where contract_address = lower('0x908C4D94D34924765f1eDc22A1DD098397c59dD4') and ORIGIN_FUNCTION_SIGNATURE = '0xf3daeacc'
    UNION
    SELECT trunc(block_timestamp,'day')as day,
    'Unstake' as action,
    tx_hash,
    ORIGIN_FROM_ADDRESS,
    RAW_AMOUNT / POW(10,18) as cantidad
    from arbitrum.core.fact_token_transfers
    where contract_address = lower('0x908C4D94D34924765f1eDc22A1DD098397c59dD4') and ORIGIN_FUNCTION_SIGNATURE = '0x078580d2'
    )

    SELECT day, action,
    SUM(cantidad) as volume,
    SUM(volume) OVER (PARTITION BY action ORDER BY day ASC) as cumulative_amount,
    COUNT(DISTINCT tx_hash) as tx,
    SUM(tx) OVER (PARTITION BY action ORDER BY day ASC) as cumulative_tx,
    COUNT(DISTINCT ORIGIN_FROM_ADDRESS) as users,
    sum(users) over (partition by action order by day) as cum_users
    FROM tab1
    WHERE day > CURRENT_DATE-INTERVAL '3 MONTHS'
    GROUP BY 1, 2
    ORDER BY 1, 2 ASC
    Run a query to Download Data