StangFAST02 - tokens
    Updated 2023-08-28
    -- forked from 01 - overview [ number ] @ https://flipsidecrypto.xyz/edit/queries/85742e4c-9565-45bb-b18b-7d77ef424361

    with

    token_price AS
    (
    SELECT
    date_trunc( 'day' , a.recorded_hour ) AS date
    , avg( a.close ) AS price
    , a.token_address AS id
    , a.symbol AS token
    FROM
    solana.core.ez_token_prices_hourly a
    GROUP BY 1 , 3 , 4
    )
    ,
    raw_one AS
    (
    SELECT
    a.block_timestamp AS date_time
    , a.tx_id AS tx_id
    , a.signers[0] AS user
    FROM
    solana.core.fact_events a
    WHERE
    a.block_timestamp >= dateadd( 'day' , -{{number_of_days}} , current_date )
    AND a.program_id = 'unpXTU2Ndrc7WWNyEhQWe4udTzSibLPi25SXv2xbCHQ'
    AND a.succeeded = 'true'
    )
    ,
    raw_tx AS
    (
    SELECT
    a.block_timestamp AS date_time
    , a.tx_id AS tx_id
    , b.user AS user
    Run a query to Download Data