Afonso_Diaz2023-08-30 05:26 PM
    Updated 2023-08-30
    with

    t1 as (
    select
    recorded_hour::date as date,
    median(close) as price_usd
    from solana.core.ez_token_prices_hourly
    where token_address = 'So11111111111111111111111111111111111111112'
    group by 1
    ),

    t2 as (
    select
    tx_id,
    block_timestamp,
    signers[0] as user,
    mint,
    index,
    amount
    from solana.core.fact_transfers
    join solana.core.fact_events
    using(tx_id, block_timestamp)
    where program_id = 'stkitrT1Uoy18Dk1fTrgPw8W6MVzoCfYoAFT4MLsmhq'
    and block_timestamp::date >= current_date - 90
    ),

    t3 as (
    select
    tx_id,
    min(index) as min_index,
    max(index) as max_index
    from t2
    group by 1
    ),

    t4 as (
    Run a query to Download Data