brian-terraopensea sale summary - collections
    Updated 2021-09-01
    WITH ABsales AS (
    select DISTINCT
    m.token_name,
    e.token_id,
    m.token_metadata:curation_status::string AS collection,
    e.price,
    e.platform_fee,
    e.creator_fee
    from ethereum.nft_events E, ethereum.nft_metadata M
    where e.block_timestamp between '2021-07-01' and '2021-08-01'
    AND e.event_platform = 'art_blocks'
    AND e.event_type = 'sale'
    AND e.token_id = m.token_id
    ),
    OSsales AS (
    select DISTINCT
    m.token_name,
    e.token_id,
    m.token_metadata:curation_status::string AS collection,
    e.price,
    e.platform_fee,
    e.creator_fee
    from ethereum.nft_events E, ethereum.nft_metadata M, ABsales AB
    where e.block_timestamp > '2021-08-01'
    AND e.event_platform = 'opensea'
    AND e.event_type = 'sale'
    AND e.token_id = m.token_id
    AND ab.token_id = e.token_id
    ),
    Osum AS (
    select collection,
    count(distinct o.token_name) AS TotalSold,
    round(avg(o.price),3) AS AvgPriceETH,
    sum(o.price) AS totalETHspent
    from ossales o
    Run a query to Download Data