misaghlbMonkeDAO Vote - smb holders voted
    Updated 2022-04-06
    with monkes as (
    select mint from solana.dim_nft_metadata
    where contract_address = '9uBX3ASjxWvNBAD1xjbVaKA74mWGZys3RGSF7DdeDD3F'
    ),
    transfred_in as (
    SELECT
    instruction:parsed:info:wallet::string as wallet,
    count(DISTINCT tx_id) as counter
    from solana.fact_events
    where instruction:parsed:info:mint::string in (SELECT * from monkes)
    and instruction:parsed:info:wallet::string is not NULL
    GROUP By wallet
    ),
    buys as (
    select
    NF.purchaser::string as wallet,
    count(DISTINCT fe.tx_id) as counter
    from solana.fact_nft_sales NF
    join solana.fact_events fe on NF.tx_id = fe.tx_id

    where NF.mint in ( SELECT * from monkes)
    AND (NF.program_id = 'MEisE1HzehtrDpAAT8PnLHjpSSkRYakotTuJRPjTpo8' or NF.program_id = 'M2mx93ekt1fmXSVkTrUL9xVFHkmME8HTUi5Cyc5aF7K' or NF.program_id = 'J7RagMKwSD5zJSbRQZU56ypHUtux8LRDkUpAPSKH4WPp')
    GROUP By wallet
    ),
    sells as (
    select
    fe.instruction:accounts[3]::string as wallet,
    count(DISTINCT fe.tx_id) * -1 as counter
    from solana.fact_nft_sales NF
    join solana.fact_events fe on NF.tx_id = fe.tx_id
    AND (NF.program_id = 'MEisE1HzehtrDpAAT8PnLHjpSSkRYakotTuJRPjTpo8' or NF.program_id = 'M2mx93ekt1fmXSVkTrUL9xVFHkmME8HTUi5Cyc5aF7K' or NF.program_id = 'J7RagMKwSD5zJSbRQZU56ypHUtux8LRDkUpAPSKH4WPp')
    and NF.mint in ( SELECT * from monkes)
    and array_size(fe.inner_instruction:instructions) > 4
    GROUP By wallet
    ),
    Run a query to Download Data