sarathsolend demographics 4
    Updated 2022-08-04
    select
    date ,
    sum(blc_aftr) ,
    sum(blc_aftr_USD) ,
    count (distinct users) as wallets
    from
    (with pc as (select
    date(block_timestamp) as date1,
    avg ( swap_to_amount / swap_from_amount ) as price_sol
    from
    solana.fact_swaps
    where
    swap_from_mint = 'So11111111111111111111111111111111111111112'
    and
    swap_to_mint = 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v'
    and
    swap_to_amount > 0
    and
    swap_from_amount > 0
    and
    succeeded = TRUE
    group by date1 order by date1)
    ,t1 as
    (select
    date(block_timestamp) as days,
    INSTRUCTION:accounts[9] as wallets,
    tx_id
    from solana.core.fact_events
    where 1=1
    and
    instruction:programId = 'So1endDq2YkqhipRh3WViPa8hdiSpxWy6z3Z6tMCpAo'
    and
    instruction:accounts[2] = '8PbodeaosQP19SjYFx855UMqWxH2HynZLdBXmsrbac36'
    and
    instruction:accounts[3] = '8UviNr47S8eL6J3WfDxMRa3hvLta1VDJwNWqsDgtN3Cv'
    Run a query to Download Data