Sandeshphase 1 dumpers
    Updated 2023-02-24
    with trades as
    (
    select
    block_timestamp ,
    tx_id,
    signers[0] as user,
    parse_json(post_token_balances[0]):"mint" as nft,
    log_messages[1] as act,
    case when block_timestamp::date <= '2023-02-06' then 'phase 1'
    when block_timestamp::date >= '2023-02-13' then 'phase 2'
    else 'other'
    end as phase
    from solana.core.fact_transactions
    where 1=1
    -- and tx_id='3H6vcnwGKyJgkALQy2oTnwk6TmJ3pXXip33vv5GzUa7y9C4NR55xYNBwronw19PAQbEcwqS5hJ4KpRmD6uSqHQrG'
    and instructions[0]:"programId"='8NvmvWEAw89HnE8Gjo4kHhbHy2PGyeuU9y9QJ1HKiLoR'
    -- and block_timestamp::date between '2022-01-25' and '2022-02-20'
    and block_timestamp > CURRENT_DATE - interval ' 1 month'
    and act='Program log: Instruction: SellNftForBond'
    ),
    phase_1 AS
    ( select user from trades where phase='phase 1'),
    top_dest as (
    select
    tx_to,
    sum(amount) as amt
    from
    solana.core.fact_transfers
    where
    mint = 'BWXrrYFhT7bMHmNBFoQFWdsSgA3yXoAnMhDK6Fn1eSEn'
    and tx_from in ( select distinct user from phase_1)
    group by
    1
    order by
    2 desc
    limit
    Run a query to Download Data