AephiaUSTUR Starbases upkeep
    Updated 2024-06-01
    WITH days AS (
    SELECT
    current_date - 3 as date_begin
    ,datediff(day, date_begin, current_date) as days
    )

    ,upkeep AS (
    select
    hour(block_timestamp) as hour
    ,days
    -----------
    ,103 * 60 * 60 as food_t1
    ,154 * 60 * 60 as food_t2
    ,206 * 60 * 60 as food_t3
    ,258 * 60 * 60 as food_t4
    ,309 * 60 * 60 as food_t5
    ,361 * 60 * 60 as food_t6

    ,77 * 60 * 60 as tool_t1
    ,116 * 60 * 60 as tool_t2
    ,154 * 60 * 60 as tool_t3
    ,193 * 60 * 60 as tool_t4


    ---UST-1---
    ,count(case when value:parsed:info:mint::string = 'foodQJAztMzX1DKpLaiounNe2BDMds5RNuPC6jsNrDG'
    AND instruction:accounts[1] = '94LdKdSHuG3Na6H1YhkgJsq1caYVxUNeBRm7rLB6hd8k'
    AND value:parsed:type = 'burn'
    then signers[0] end) as UST_1_wallets_food
    ,sum(case when value:parsed:info:mint::string = 'foodQJAztMzX1DKpLaiounNe2BDMds5RNuPC6jsNrDG'
    AND instruction:accounts[1] = '94LdKdSHuG3Na6H1YhkgJsq1caYVxUNeBRm7rLB6hd8k'
    AND value:parsed:type = 'burn'
    then value:parsed:info:amount
    end) / days as UST_1_FOOD_burn
    ,-food_t6 as UST_1_food_upkeep
    QueryRunArchived: QueryRun has been archived