AephiaGolden tickets 2024
    Updated 2025-04-19
    WITH token_prices AS (
    SELECT
    hour::DATE AS DATE,
    ---AVG(close) AS atlas_price
    AVG(case when token_address = 'ATLASXmbPQxBUYbxPsV97usA3fPQYEqzQBUHgiFCUsXx'
    then price end) as atlas_price,
    AVG(case when token_address = 'So11111111111111111111111111111111111111112'
    then price end) as sol_price


    FROM
    SOLANA.price.ez_prices_hourly
    WHERE
    hour::DATE >= current_date-120 --'2022-07-22'

    GROUP BY ALL
    --order by 1 desc
    )


    ,sage_volumes AS (
    select
    --*
    date_trunc('day', block_timestamp::date) as date,
    ----------------------------------------------------
    sum(case when inner_instruction:instructions[2]:parsed:info:mint::string = 'ARCoQ9dndpg6wE2rRexzfwgJR3NoWWhpcww3xQcQLukg' then inner_instruction:instructions[2]:parsed:info:tokenAmount:uiAmount when inner_instruction:instructions[1]:parsed:info:mint::string = 'ARCoQ9dndpg6wE2rRexzfwgJR3NoWWhpcww3xQcQLukg' then inner_instruction:instructions[1]:parsed:info:tokenAmount:uiAmount
    end) AS ARCO_amount,
    sum(case when inner_instruction:instructions[2]:parsed:info:mint::string = 'ARCoQ9dndpg6wE2rRexzfwgJR3NoWWhpcww3xQcQLukg' AND inner_instruction:instructions[1]:parsed:info:mint::string = 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v' then (inner_instruction:instructions[0]:parsed:info:tokenAmount:uiAmount + inner_instruction:instructions[1]:parsed:info:tokenAmount:uiAmount) when inner_instruction:instructions[1]:parsed:info:mint::string = 'ARCoQ9dndpg6wE2rRexzfwgJR3NoWWhpcww3xQcQLukg' AND inner_instruction:instructions[2]:parsed:info:mint::string = 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v' then (inner_instruction:instructions[0]:parsed:info:tokenAmount:uiAmount + inner_instruction:instructions[2]:parsed:info:tokenAmount:uiAmount)
    end) AS ARCO_usdc_amount,
    sum(case when inner_instruction:instructions[2]:parsed:info:mint::string = 'ARCoQ9dndpg6wE2rRexzfwgJR3NoWWhpcww3xQcQLukg' AND inner_instruction:instructions[1]:parsed:info:mint::string = 'ATLASXmbPQxBUYbxPsV97usA3fPQYEqzQBUHgiFCUsXx' then (inner_instruction:instructions[0]:parsed:info:tokenAmount:uiAmount + inner_instruction:instructions[1]:parsed:info:tokenAmount:uiAmount) when inner_instruction:instructions[1]:parsed:info:mint::string = 'ARCoQ9dndpg6wE2rRexzfwgJR3NoWWhpcww3xQcQLukg' AND inner_instruction:instructions[2]:parsed:info:mint::string = 'ATLASXmbPQxBUYbxPsV97usA3fPQYEqzQBUHgiFCUsXx' then (inner_instruction:instructions[0]:parsed:info:tokenAmount:uiAmount + inner_instruction:instructions[2]:parsed:info:tokenAmount:uiAmount)
    end) AS ARCO_atlas_amount,
    sum(case when inner_instruction:instructions[2]:parsed:info:mint::string = 'MASS9GqtJz6ABisAxcUn3FeR4phMqH1XfG6LPKJePog' then inner_instruction:instructions[2]:parsed:info:tokenAmount:uiAmount when inner_instruction:instructions[1]:parsed:info:mint::string = 'MASS9GqtJz6ABisAxcUn3FeR4phMqH1XfG6LPKJePog' then inner_instruction:instructions[1]:parsed:info:tokenAmount:uiAmount
    end) AS BIOMASS_amount,
    sum(case when inner_instruction:instructions[2]:parsed:info:mint::string = 'MASS9GqtJz6ABisAxcUn3FeR4phMqH1XfG6LPKJePog' AND inner_instruction:instructions[1]:parsed:info:mint::string = 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v' then (inner_instruction:instructions[0]:parsed:info:tokenAmount:uiAmount + inner_instruction:instructions[1]:parsed:info:tokenAmount:uiAmount) when inner_instruction:instructions[1]:parsed:info:mint::string = 'MASS9GqtJz6ABisAxcUn3FeR4phMqH1XfG6LPKJePog' AND inner_instruction:instructions[2]:parsed:info:mint::string = 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v' then (inner_instruction:instructions[0]:parsed:info:tokenAmount:uiAmount + inner_instruction:instructions[2]:parsed:info:tokenAmount:uiAmount)
    end) AS BIOMASS_usdc_amount,
    sum(case when inner_instruction:instructions[2]:parsed:info:mint::string = 'MASS9GqtJz6ABisAxcUn3FeR4phMqH1XfG6LPKJePog' AND inner_instruction:instructions[1]:parsed:info:mint::string = 'ATLASXmbPQxBUYbxPsV97usA3fPQYEqzQBUHgiFCUsXx' then (inner_instruction:instructions[0]:parsed:info:tokenAmount:uiAmount + inner_instruction:instructions[1]:parsed:info:tokenAmount:uiAmount) when inner_instruction:instructions[1]:parsed:info:mint::string = 'MASS9GqtJz6ABisAxcUn3FeR4phMqH1XfG6LPKJePog' AND inner_instruction:instructions[2]:parsed:info:mint::string = 'ATLASXmbPQxBUYbxPsV97usA3fPQYEqzQBUHgiFCUsXx' then (inner_instruction:instructions[0]:parsed:info:tokenAmount:uiAmount + inner_instruction:instructions[2]:parsed:info:tokenAmount:uiAmount)
    Last run: 19 days agoAuto-refreshes every 6 hours
    DATE
    GT_COSTS_COMP
    GT_COSTS_RAW
    1
    2025-04-18 00:00:00.0004.033.03
    2
    2025-04-17 00:00:00.0003.982.95
    3
    2025-04-16 00:00:00.0003.832.95
    4
    2025-04-15 00:00:00.0004.022.89
    5
    2025-04-14 00:00:00.0003.992.81
    6
    2025-04-13 00:00:00.0003.893.06
    7
    2025-04-12 00:00:00.0003.963.01
    8
    2025-04-11 00:00:00.0004.052.87
    9
    2025-04-10 00:00:00.0003.982.86
    10
    2025-04-09 00:00:00.0003.792.9
    11
    2025-04-08 00:00:00.0003.743
    12
    2025-04-07 00:00:00.0003.682.78
    13
    2025-04-06 00:00:00.0003.872.76
    14
    2025-04-05 00:00:00.0003.952.82
    15
    2025-04-04 00:00:00.0003.942.81
    16
    2025-04-03 00:00:00.0003.952.73
    17
    2025-04-02 00:00:00.00042.8
    18
    2025-04-01 00:00:00.0003.983
    19
    2025-03-31 00:00:00.0004.093.05
    20
    2025-03-30 00:00:00.0004.032.92
    ...
    120
    4KB
    15s