LTirrell2022-02-25_solana_stepn-transfers
    Updated 2022-03-01
    with gst_tx as (
    select
    tx_id
    from
    solana.transactions
    where
    succeeded = 'TRUE'
    AND block_timestamp :: date >= '2022-01-01'
    and (
    pre_mint = 'AFbX8oGjGpmVFywbVouvhQSRmiW2aR1mohfahi4Y2AdB'
    or post_mint = 'AFbX8oGjGpmVFywbVouvhQSRmiW2aR1mohfahi4Y2AdB'
    )
    )
    select
    date_trunc('day', block_timestamp) as datetime,
    count(gst_tx.tx_id) as transfer_count,
    sum(t.amount / 1000) as total_transfer_amount,
    avg(t.amount / 1000) as avg_transfer_amount,
    count(distinct t.source) as unique_source,
    count(distinct t.destination) as distinct_dest,
    mode(t.source) as most_common_source,
    mode(t.destination) as most_common_dest
    from
    solana.transfers t
    inner JOIN gst_tx on t.tx_id = gst_tx.tx_id
    where
    t.succeeded = 'TRUE'
    AND t.block_timestamp :: date >= '2022-01-01'
    and t.event_type = 'transfer'
    group by
    datetime


    Run a query to Download Data