iboo-jbj2MVthe average sales price of Balloonsville NFTs on Magic Eden
    Updated 2022-02-23
    with balloonsville_addresses as (
    SELECT address from solana.labels
    where label = 'balloonsville'
    group by 1
    ),
    balloonsville_price as (
    select tx_id , (iff(inner_instruction:instructions[0]:parsed:info:lamports/1e9 is null , 0 ,inner_instruction:instructions[0]:parsed:info:lamports/1e9) +
    iff(inner_instruction:instructions[1]:parsed:info:lamports/1e9 is null , 0 ,inner_instruction:instructions[1]:parsed:info:lamports/1e9) +
    iff(inner_instruction:instructions[2]:parsed:info:lamports/1e9 is null , 0 ,inner_instruction:instructions[2]:parsed:info:lamports/1e9) +
    iff(inner_instruction:instructions[3]:parsed:info:lamports/1e9 is null , 0 ,inner_instruction:instructions[3]:parsed:info:lamports/1e9)+
    iff(inner_instruction:instructions[4]:parsed:info:lamports/1e9 is null , 0 ,inner_instruction:instructions[4]:parsed:info:lamports/1e9)+
    iff(inner_instruction:instructions[5]:parsed:info:lamports/1e9 is null , 0 ,inner_instruction:instructions[5]:parsed:info:lamports/1e9)
    ) as price
    from solana.nfts join balloonsville_addresses
    on lower(mint) =lower(balloonsville_addresses.address)
    where array_size(inner_instruction:instructions) > 4
    and INSTRUCTION:programId = 'MEisE1HzehtrDpAAT8PnLHjpSSkRYakotTuJRPjTpo8'
    and succeeded = true
    and block_timestamp ::date >='2022-02-05'
    group by 1,2
    )
    select block_timestamp ::date as date , count(DISTINCT solana.nfts.tx_id) as volume , avg(price) as average_of_price
    from solana.nfts join balloonsville_price
    on solana.nfts.tx_id =balloonsville_price.tx_id
    group by 1
    Run a query to Download Data