elenahooAnchor instant mint per Luna
    Updated 2022-01-03
    with mint as (
    -- mint bLuna on Anchor
    select block_timestamp
    , tx_id
    , EVENT_ATTRIBUTES['0_offer_asset']::string as offer_asset
    , EVENT_ATTRIBUTES['0_offer_amount']::decimal as offer_amount
    , EVENT_ATTRIBUTES['1_ask_asset']::string as ask_asset
    , EVENT_ATTRIBUTES['1_return_amount']::string as return_amount
    , EVENT_ATTRIBUTES['1_return_amount']::string / EVENT_ATTRIBUTES['0_offer_amount']::decimal as luna_bluna_rate
    from terra.msg_events
    where EVENT_TYPE = 'wasm'
    and ask_asset = 'terra1kc87mu460fwkqte29rquh4hc20m54fxwtsx7gp' --bluna address
    and EVENT_ATTRIBUTES['0_offer_asset']::string = 'uluna'
    and EVENT_ATTRIBUTES['0_action']::string = 'swap'
    --and tx_id = 'FDD7CF067E8CEE0D5A90F1FC5826E00E2590FC74FBBB8DF899FDBCC7F0232B47'
    )

    select date_trunc('hour', block_timestamp) as time_h
    , avg(luna_bluna_rate) as avg_luna_bluna
    from mint
    group by 1
    order by time_h asc







    Run a query to Download Data