mucryptoS3 Q10
    Updated 2023-01-24
    with top5 as
    (select
    -- count(tx_hash) as n_txs,
    -- count(distinct tx_hash) as n_distinct_txs,
    currency_symbol,
    tx_hash
    -- avg(price_usd) as avg_price
    from ethereum.core.ez_nft_sales
    where date_trunc('month',block_timestamp) = '2022-12-01'
    and currency_symbol is not NULL
    and price_usd is not null),
    -- group by currency_symbol
    -- order by n_distinct_txs desc),

    prices as
    (select symbol,
    -- hour::DATE as _date,
    price
    from ethereum.core.fact_hourly_token_prices
    where date_trunc('month',hour) = '2022-12-01'
    -- group by symbol, price
    )

    select
    CASE
    when currency_symbol = 'ETH' then currency_symbol
    when currency_symbol = 'WETH' then currency_symbol
    when currency_symbol = 'GALA' then currency_symbol
    when currency_symbol = 'nftx_token' then currency_symbol
    when currency_symbol = 'USDC' then currency_symbol
    else 'Other'
    end as "Currency_symbol",
    count(tx_hash) as n_txs,
    count(distinct tx_hash) as n_distinct_txs,
    -- n_distinct_txs,
    currency_symbol,
    Run a query to Download Data