Updated 2023-03-30
    WITH
    ETH AS (
    SELECT
    date_trunc('year', s.BLOCK_TIMESTAMP) as date,
    ct.name,
    ct.symbol,
    ct.address,
    s.nft_address,
    'ethereum' as type,
    COUNT(DISTINCT s.tx_hash) as num_tx,
    sum(s.price) as volume,
    sum(s.price_usd) as usd_volume,
    sum(s.tx_fee_usd) as fees_usd,
    sum(s.tx_fee) as fees_eth
    FROM
    ethereum.core.ez_nft_sales s
    JOIN ethereum.core.dim_contracts ct ON s.nft_address = ct.address
    WHERE
    date >= '2020-01-01' AND date < '2021-01-01'
    GROUP BY
    1,
    2,
    3,
    4,
    5,
    6
    ORDER BY
    num_tx DESC
    LIMIT
    10
    ),
    OP AS (
    SELECT
    date_trunc('year', s.BLOCK_TIMESTAMP) as date,
    ct.name,
    ct.symbol,
    Run a query to Download Data