dannerBGAN Metadata, Holder, Last Price
    Updated 2023-04-04
    with sales as
    (
    -- get sales
    select
    buyer_address,
    seller_address,
    tx_hash as s_tx_hash,
    tokenid as s_tokenid,
    price as s_price,
    price_usd as s_price_usd,
    block_timestamp as s_block_timestamp
    from
    ethereum.core.ez_nft_sales
    where
    nft_address = lower('0x31385d3520bced94f77aae104b406994d8f2168c')
    QUALIFY RANK() OVER (PARTITION BY tokenid ORDER BY block_number DESC) = 1
    ),
    transfers as
    (
    -- get transfers
    select
    nft_to_address,
    nft_from_address,
    tx_hash as t_tx_hash,
    tokenid as t_tokenid,
    null as t_price,
    null as t_price_usd,
    block_timestamp as t_block_timestamp
    from
    ethereum.core.ez_nft_transfers
    where
    nft_address = lower('0x31385d3520bced94f77aae104b406994d8f2168c')
    -- and nft_from_address != lower('0x0000000000000000000000000000000000000000')
    QUALIFY RANK() OVER (PARTITION BY tokenid ORDER BY block_number DESC) = 1
    ),
    bgan_metadata as
    Run a query to Download Data