kiacryptodaily metrics of zed collections
    Updated 2022-10-30
    with --price as (
    -- select
    -- date_trunc('day',hour) as day,
    -- avg(price) as eth_price
    -- from ethereum.core.fact_hourly_token_prices
    -- where token_address = '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2' -- WETH contract
    -- group by 1
    -- ),
    base as (
    select
    e.block_timestamp,
    e.tx_hash,
    event_inputs:to as buyer,
    event_inputs:from as seller,
    event_inputs:tokenId as id--,
    -- raw_amount/pow (10,18) as amount_in_eth,
    -- amount_in_eth * eth_price as amount_in_usd
    from polygon.core.fact_event_logs e --join polygon.core.fact_token_transfers t on e.tx_hash = t.tx_hash and e.block_timestamp::date = t.block_timestamp::date join price on day = e.block_timestamp::date
    where
    e.block_timestamp::date >= '2022-09-01' and
    event_name ='Transfer' and
    tx_status = 'SUCCESS' and
    event_inputs:from != '0x0000000000000000000000000000000000000000' and
    e.contract_address = '0xa5f1ea7df861952863df2e8d1312f7305dabf215'-- and
    -- event_inputs:tokenId is not null
    ),
    info as (
    select
    date_trunc('day', block_timestamp) as date,

    -- periodly
    -- sum(amount_in_usd) as sales_volume_usd,
    -- avg(amount_in_usd) as avg_nft_price_usd,
    count(distinct tx_hash) as sales_count,
    count(distinct buyer) as unique_buyer,
    Run a query to Download Data