nitsNew Users GMX vs GNS
    Updated 2022-11-06
    with gns as
    (SELECT date(first_use) as day, count(DISTINCT users) as total_users , 'gns' as type
    from
    (SELECT event_inputs:to as users, min(block_timestamp) as first_use from polygon.core.fact_event_logs
    where contract_address ilike '0xE5417Af564e4bFDA1c483642db72007871397896' and event_name = 'Transfer'
    GROUP by 1)
    where day >= CURRENT_DATE -183
    GROUP by 1 ) ,
    gmx as
    (SELECT date(first_use) as day, count(DISTINCT users) as total_users, 'gmx' as type
    from
    (SELECT event_inputs:to as users, min(block_timestamp) as first_use from arbitrum.core.fact_event_logs
    where contract_address ilike '0xfc5a1a6eb076a2c7ad06ed22c90d7e710e35ad0a' and event_name = 'Transfer'
    GROUP by 1)
    where day >= CURRENT_DATE -183
    GROUP by 1 )

    SELECT *, sum(total_users) over (partition by type order by day) as cum_users
    from
    (SELECT * from gmx
    UNION ALL
    SELECT * FROM gns)
    Run a query to Download Data