StangFASTauto pool
    Updated 2023-06-11
    -- forked from auto pool @ https://flipsidecrypto.xyz/edit/queries/1221ca5f-3fb9-46ba-ab46-c47e2e8d2c12

    with

    avax_price AS
    (
    SELECT
    date_trunc( 'day' , a.hour ) AS day
    , avg( a.price ) AS price
    , a.symbol AS symbol
    FROM
    avalanche.core.fact_hourly_token_prices a
    WHERE
    a.symbol = 'WAVAX'
    GROUP BY
    1 , 3
    ORDER BY
    1 DESC
    )
    ,
    tx_d AS
    (
    SELECT
    a.tx_hash
    FROM
    avalanche.core.ez_decoded_event_logs a
    LEFT OUTER JOIN
    avalanche.core.fact_transactions c
    ON a.tx_hash = c.tx_hash
    WHERE
    a.contract_address = lower( '0x32833a12ed3fd5120429fb01564c98ce3c60fc1d' )
    AND a.origin_function_signature = '0x5a5757f9'
    )
    -- ,
    -- tab_d AS
    -- (
    Run a query to Download Data