andurilRoyalty Payers
    Updated 2022-12-12
    with sol_price as
    (
    select
    date(recorded_hour) as date,
    avg(close) as price
    from
    solana.core.fact_token_prices_hourly
    where
    date >= '2022-10-01' and
    symbol = 'SOL'
    group by date
    ),

    magic_eden_txs as (
    select
    distinct tx_id
    from solana.core.fact_events
    where
    date(block_timestamp) >= '2022-10-01'
    and succeeded = 'TRUE'
    and program_id = 'M2mx93ekt1fmXSVkTrUL9xVFHkmME8HTUi5Cyc5aF7K' --magic eden v2
    )

    select
    distinct tx_from as wallet
    from
    solana.core.fact_transfers t
    inner join magic_eden_txs
    using (tx_id)
    inner join sol_price s
    on date(t.block_timestamp) = s.date
    where
    --tx_id = '3UphPZXD8JCZBWzDqJBFZ63n4bYbJVQRahdyKZaVG9dR5gcC2NhcyjNLzsPyi1GP14ma9MroGF5nqB9ZM5mV9Yvh'
    t.tx_to = '9uBX3ASjxWvNBAD1xjbVaKA74mWGZys3RGSF7DdeDD3F' -- smb creator address
    and t.mint = 'So11111111111111111111111111111111111111112'

    Run a query to Download Data