adriaparcerisasMetamask vs. Other Platforms 3
    Updated 2022-06-23
    -- How many users are swapping via MetaMask vs other platforms?
    -- How much volume have these users done?
    -- Chart a comparison between the two, and show the following metrics over a time period of your choosing: transaction volume, average amount swapped, and a comparison of fees

    WITH
    metamask_wallets as (
    SELECT
    distinct origin_from_address as metamask_wallets
    from ethereum.core.fact_event_logs
    where contract_address=lower('0x881D40237659C251811CEC9c364ef91dC08D300C')
    ),
    ins as (
    select
    case when origin_from_address in (select * from metamask_wallets) then 'Metamask'
    else 'Others' end as platform,
    sum(amount_in_usd) as volume_in
    from ethereum.core.ez_dex_swaps where amount_in_usd <1e9
    group by 1
    ),
    outs as (
    select
    case when origin_from_address in (select * from metamask_wallets) then 'Metamask'
    else 'Others' end as platform,
    sum(amount_out_usd) as volume_out
    from ethereum.core.ez_dex_swaps where amount_out_usd <1e9
    group by 1
    )
    SELECT
    ins.platform,
    volume_in,
    volume_out,
    volume_in-volume_out as net_volume
    from ins,outs where ins.platform=outs.platform
    --group by 1
    Run a query to Download Data