rajsOdyssey NFT Sales
    Updated 2022-09-06
    with nft_sales as
    (
    SELECT
    -- *
    '0x' || substr(topics[1],27,40) as seller,
    '0x' || substr(topics[2],27,40) as buyer,
    tokenflow_eth.hextoint(topics[3])::integer as token_id,
    tx_hash,
    block_timestamp
    from arbitrum.core.fact_event_logs
    where contract_address = '0xfae39ec09730ca0f14262a636d2d7c5539353752'
    and topics[0] = '0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef'
    and topics[1] <> topics[2]
    and topics[1] <> '0x0000000000000000000000000000000000000000000000000000000000000000'
    )
    ,

    txs_value as
    (
    SELECT
    s.*,
    eth_value as amount
    from nft_sales s
    inner join arbitrum.core.fact_transactions t
    on s.tx_hash = t.tx_hash
    )

    SELECT
    -- date_trunc('day', block_timestamp) as date,
    sum(amount) as total_amount,
    max(amount) as max_amount,
    min(amount) as min_amount,
    avg(amount) as avg_amount,
    count(*) as no_of_txs,
    count(distinct token_id) as no_of_tokens
    from txs_value
    Run a query to Download Data