Nige7777Burn bLuna
    Updated 2022-07-07

    --%%%%%%%%%%%%%%%%%%%%%%%%%%%%% the two burns

    with cte_instantburn as (
    Select
    -- msg_value:execute_msg:swap:offer_asset:info:native_token:denom::string
    'InstantBurn' as BurnType ,
    SUM(msg_value:execute_msg:send:amount / POW(10,6)) as Amount,
    count(*) as BurnCount,
    --msg_value:sender::string,
    date_trunc('day', block_timestamp) Day

    from terra.msgs
    WHERE 1=1
    --and msg_value:contract = 'terra1jxazgm67et0ce260kvrpfv50acuushpjsz2y0p' -- instant burn
    and block_timestamp >= CURRENT_DATE -30
    and msg_value:contract::string = 'terra1kc87mu460fwkqte29rquh4hc20m54fxwtsx7gp' -- bLuna contract
    and msg_value:execute_msg:send:contract::string = 'terra1jxazgm67et0ce260kvrpfv50acuushpjsz2y0p' -- bluna-luna pool
    and msg_value:execute_msg:send:msg:swap is not null
    -- from terra.msgs
    -- WHERE msg_value:contract =
    -- 'terra1jxazgm67et0ce260kvrpfv50acuushpjsz2y0p' -- instant burn
    -- and block_timestamp >= CURRENT_DATE -30
    -- and msg_value:execute_msg:swap:offer_asset:info:native_token:denom::string = 'uluna'
    group by
    BurnType,
    Day
    )
    ,

    cte_slowburn as
    (

    select
    'SlowBurn' as BurnType,
    Run a query to Download Data