MoDeFi#solana Flash Bounty- Saga 1
    Updated 2022-06-24
    with pre_orders as
    (select date_trunc('hour',BLOCK_TIMESTAMP) as date, INNER_INSTRUCTIONS[0]:instructions[1]:parsed:info:mint as token,
    INNER_INSTRUCTIONS[1]:instructions[0]:parsed:info:owner as owner,
    INNER_INSTRUCTIONS[1]:instructions[1]:parsed:info:amount/1e6 as amount,
    INNER_INSTRUCTIONS[1]:instructions[1]:parsed:info:authority as user,
    TX_ID
    from solana.core.fact_transactions
    where --TX_ID='4jBq7eb7cjeX98AiPB6aN66TB8oFUdUxmEDEzAG5mG9QMz5WiSnp7MSCKJMtyztMdwQFcahnqRDeT2xUWuZfEn4X' --PROGRAM_ID='781wH11JGQgEoBkBzuc8uoQLtp8KxeHk1yZiS1JhFYKy' and SUCCEEDED=TRUE
    token='EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v' and owner='781wH11JGQgEoBkBzuc8uoQLtp8KxeHk1yZiS1JhFYKy' and SUCCEEDED=TRUE
    and BLOCK_TIMESTAMP::date>='2022-06-22'
    )

    select *,
    sum(user_count) over (order by date) as total_user_count,
    (select count(distinct user) from pre_orders) as total_users
    from
    (select date, count(distinct user) as user_count
    from pre_orders
    group by date)
    Run a query to Download Data