CryptoIcicleMetamask-2.Most Common Transactions - Platforms Swaps
    Updated 2022-06-25
    -- Payout 75 USDC
    -- Grand Prize 225 USDC
    -- Level Intermediate
    -- Q2. What are the most common transactions for Metamask users?
    -- Create an analysis that shows the most common wallet activities and the most common platforms for those activities.

    with wallets as (
    select
    distinct origin_from_address as wallet
    from ethereum.core.fact_event_logs
    where contract_address = lower('0x881D40237659C251811CEC9c364ef91dC08D300C')
    )

    select
    date_trunc('week',block_timestamp) as date,
    platform as type,
    count(distinct tx_hash) as n_txns
    from ethereum.core.ez_dex_swaps e join wallets w on e.origin_from_address = w.wallet
    where platform is not null
    and block_timestamp >= CURRENT_DATE - 90
    group by date, type
    Run a query to Download Data