StangFASTMost expensive sold for ever
    Updated 2023-12-12
    --- Sausagers

    with

    tab0 AS
    (
    SELECT
    date_trunc( '{{period}}' , a.hour ) AS date
    , avg( a.price ) AS price
    , a.decimals AS decimal
    , a.symbol AS symbol
    FROM
    avalanche.price.ez_hourly_token_prices a
    WHERE
    a.token_address = '0xb31f66aa3c1e785363f0875a1b74e27b85fd66c7'
    GROUP BY 1 , 3 , 4
    ORDER BY 1 DESC
    )
    -- ,
    -- tab1 AS
    -- (
    SELECT
    a.block_timestamp::date AS "date"
    , a.tx_hash AS "tx hash"
    , a.origin_from_address AS "buyers"
    , a.to_address AS "sellers"
    , ( ( a.raw_amount_precise / power( 10 , c.decimal ) ) * c.price ) AS "sold price in $"
    , b.project_name AS "collections"
    , b.tokenid AS "token id"
    , case
    when a.origin_to_address = '0x398baa6ffc99126671ab6be565856105a6118a40' then 'Hyperspace'
    when a.origin_to_address = '0xae079eda901f7727d0715aff8f82ba8295719977' then 'Joepegs'
    end
    AS "marketplaces"
    FROM
    avalanche.core.fact_token_transfers a
    Run a query to Download Data