nitsOpenSea vs MagicEden Sales
    Updated 2022-10-17
    with os as
    (SELECT inner_instruction:instructions[0]:parsed:info:source as src ,
    case when inner_instruction:instructions[4]:parsed:info:lamports is not NULL then
    (inner_instruction:instructions[0]:parsed:info:lamports+
    inner_instruction:instructions[1]:parsed:info:lamports
    +inner_instruction:instructions[2]:parsed:info:lamports
    +inner_instruction:instructions[3]:parsed:info:lamports
    +inner_instruction:instructions[4]:parsed:info:lamports
    )/pow(10,9)
    when inner_instruction:instructions[3]:parsed:info:lamports is not NULL then
    (inner_instruction:instructions[0]:parsed:info:lamports+
    inner_instruction:instructions[1]:parsed:info:lamports
    +inner_instruction:instructions[2]:parsed:info:lamports
    +inner_instruction:instructions[3]:parsed:info:lamports
    )/pow(10,9)
    when inner_instruction:instructions[2]:parsed:info:lamports is not NULL then
    (inner_instruction:instructions[0]:parsed:info:lamports+
    inner_instruction:instructions[1]:parsed:info:lamports
    +inner_instruction:instructions[2]:parsed:info:lamports
    )/pow(10,9)
    when inner_instruction:instructions[1]:parsed:info:lamports is not NULL then
    (inner_instruction:instructions[0]:parsed:info:lamports+
    inner_instruction:instructions[1]:parsed:info:lamports
    )/pow(10,9)
    when inner_instruction:instructions[0]:parsed:info:lamports is not NULL then
    (inner_instruction:instructions[0]:parsed:info:lamports
    )/pow(10,9)
    end as amt ,* from solana.fact_events
    where program_id = 'hausS13jsjafwWwGqZTUQRmWyvyxn9EQpqMwV1PBBmk'
    AND INDEX = '7' ),
    os_vol as
    (SELECT date(block_timestamp) as day , sum(amt) as total_vol,'opensea' as platform
    from os
    where day >= '2022-05-09'
    GROUP by 1 ),
    Run a query to Download Data