maybeyonasnft_paper_hands_eth
    Updated 2021-11-10
    with nft_sales as (
    select
    block_timestamp,
    tx_id,
    contract_address ||' - '|| token_id::string as token,
    event_from,
    event_to,
    price,
    price_usd
    from ethereum.nft_events
    where
    event_type = 'sale'
    and token_id <= 1000000
    and price is not null
    and tx_currency in ('ETH','WETH')
    -- and block_timestamp >= getdate() - interval '60 days'
    -- order by contract_address,token_id,block_timestamp
    ),
    atleast_two as (
    select token from (
    select
    token,
    count(block_timestamp) as no_sales
    from nft_sales
    group by 1
    )
    where no_sales > 1
    ),
    mul_nft_sales as (
    select * from nft_sales
    where
    token in (select token from atleast_two)
    order by token,block_timestamp
    ),
    prev_sale as (
    select
    Run a query to Download Data