nitsGNS vs GMX Volume
    Updated 2022-11-06
    with gns as
    (SELECT date(block_timestamp) as day, sum(amt) as total_amt, count(DISTINCT tx_hash) as total_txs , 'gns' as type
    from
    (SELECT block_timestamp,tx_hash, event_inputs:value /pow(10,18) as amt from polygon.core.fact_event_logs
    where contract_address ilike '0xE5417Af564e4bFDA1c483642db72007871397896' and event_name = 'Transfer'
    GROUP by 1,2,3)
    where day >= CURRENT_DATE -183
    GROUP by 1 ) ,
    gmx as
    (SELECT date(block_timestamp) as day, sum(amt) as total_amt, count(DISTINCT tx_hash) as total_txs, 'gmx' as type
    from
    (SELECT block_timestamp,tx_hash, event_inputs:value /pow(10,18) as amt from arbitrum.core.fact_event_logs
    where contract_address ilike '0xfc5a1a6eb076a2c7ad06ed22c90d7e710e35ad0a' and event_name = 'Transfer'
    GROUP by 1,2,3)
    where day >= CURRENT_DATE -183
    GROUP by 1 ),

    gns_price as
    (SELECT date(recorded_hour) as day_, avg(high+ low)/2 as avg_price
    from crosschain.core.fact_hourly_prices
    where id = 'gains-network' and day_ >= CURRENT_DATE - 183
    GROUP by 1),
    gmx_price as
    (SELECT date(recorded_hour) as day_, avg(high+ low)/2 as avg_price
    from crosschain.core.fact_hourly_prices
    where id = 'gmx' and day_ >= CURRENT_DATE - 183
    GROUP by 1) ,
    gns_vol as
    ( SELECT day, total_txs, type, total_amt*avg_price as total_vol_usd from gns
    inner join gns_price
    on day = day_
    ),
    gmx_vol as
    ( SELECT day, total_txs, type, total_amt*avg_price as total_vol_usd from gmx
    inner join gmx_price
    Run a query to Download Data