Abbas_ra21Buy/sell Total 3
    Updated 2023-05-09
    select
    case when
    LOWER(SYMBOL_in)>LOWER(SYMBOL_OUT)
    then concat(SYMBOL_OUT,'/',SYMBOL_in)
    else
    concat(SYMBOL_in,'/',SYMBOL_OUT)
    end AS pair,
    sum(case when TOKEN_OUT=lower('0x13E7bceFddE72492E656f3fa58baE6029708e673') then AMount_OUT*Price else AMount_IN*Price end) AS "Swap Volume (USD)"
    from avalanche.core.ez_dex_swaps inner join avalanche.core.fact_hourly_token_prices on
    HOUR=Date_trunc('HOUR',BLOCK_TIMESTAMP) and TOKEN_ADDRESS=lower('0x13E7bceFddE72492E656f3fa58baE6029708e673')
    where TOKEN_OUT=lower('0x13E7bceFddE72492E656f3fa58baE6029708e673') or TOKEN_IN=lower('0x13E7bceFddE72492E656f3fa58baE6029708e673') group by 1



    Run a query to Download Data