CryptoIcicleOsmo-8.Burn the House Down
    Updated 2022-06-04
    -- Burn the House Down
    -- Payout 55.15 OSMO
    -- Grand Prize 165.44 OSMO
    -- Level Intermediate

    -- Q8. Find the week that the largest volume of OSMO burning happened. What caused this event?
    -- Show some of the events that this burning had on the Osmosis ecosystem.
    -- Hint: Look at the msg_types of transactions to determine when Osmosis is being burnt.

    with burn_txns as (
    select
    RIGHT(attribute_value, LENGTH(attribute_value) - LENGTH(SPLIT_PART(TRIM(REGEXP_REPLACE(attribute_value, '[^[:digit:]]', ' ')), ' ', 0))) AS currency,
    SPLIT_PART(TRIM(REGEXP_REPLACE(
    attribute_value,
    '[^[:digit:]]',
    ' ')), ' ', 0) AS amount,
    *
    from osmosis.core.fact_msg_attributes
    where msg_type = 'burn'
    and attribute_key = 'amount'
    and currency ilike '%osmo%'
    )

    select
    distinct currency
    -- date_trunc('week',block_timestamp) as date,
    -- sum(amount) as amount_burnt
    from burn_txns
    -- group by date
    limit 1000
    Run a query to Download Data