Eman-Raz🏢Swap Stats By Platform
    Updated 2024-08-15
    with final_table as (with near as (select block_timestamp, tx_hash,
    amount_in_usd as amount_usd, trader as swapper,
    symbol_in || '➡' || symbol_out as token_pair,
    platform, 'Near' as chain
    from near.defi.ez_dex_swaps
    where (token_in_contract='{{Memecoin_Address}}' or token_out_contract='{{Memecoin_Address}}')
    and block_timestamp::date between '{{Start_Date}}' and '{{End_Date}}'),

    aptos as (select block_timestamp, tx_hash,
    amount_in_usd as amount_usd, swapper,
    symbol_in || '➡' || symbol_out as token_pair,
    platform, 'Aptos' as chain
    from aptos.defi.ez_dex_swaps
    where (token_in='{{Memecoin_Address}}' or token_out='{{Memecoin_Address}}')
    and block_timestamp::date between '{{Start_Date}}' and '{{End_Date}}' ),

    arbitrum as (select block_timestamp, tx_hash,
    amount_in_usd as amount_usd, origin_from_address as swapper,
    symbol_in || '➡' || symbol_out as token_pair,
    platform, 'Arbitrum' as chain
    from arbitrum.defi.ez_dex_swaps
    where (token_in=lower('{{Memecoin_Address}}') or token_out=lower('{{Memecoin_Address}}'))
    and block_timestamp::date between '{{Start_Date}}' and '{{End_Date}}' ),

    avalanche as (select block_timestamp, tx_hash,
    amount_in_usd as amount_usd, origin_from_address as swapper,
    symbol_in || '➡' || symbol_out as token_pair,
    platform, 'Avalanche' as chain
    from avalanche.defi.ez_dex_swaps
    where (token_in=lower('{{Memecoin_Address}}') or token_out=lower('{{Memecoin_Address}}'))
    and block_timestamp::date between '{{Start_Date}}' and '{{End_Date}}' ),

    base as (select block_timestamp, tx_hash,
    amount_in_usd as amount_usd, origin_from_address as swapper,
    symbol_in || '➡' || symbol_out as token_pair,
    platform, 'Base' as chain
    QueryRunArchived: QueryRun has been archived