Updated 2022-03-26
    select
    block_timestamp::date as dt,
    count(distinct tx_id) as no_trans,
    event_attributes:order:order:maker_asset:info:nft:"contract_addr" as cnt,
    case when event_attributes:order:order:taker_asset:info:native_token:"denom" = 'uusd' then event_attributes:order:order:taker_asset:"amount"/pow(10,6)
    when event_attributes:order:order:taker_asset:info:native_token:"denom" = 'uluna' then event_attributes:order:order:taker_asset:"amount"/pow(10,6)
    else '0'
    end as price,
    avg(event_attributes:order:order:taker_asset:"amount"/pow(10,6)) as avg_price,
    event_attributes:order:order:taker_asset:info:native_token:"denom" as currency
    from terra.msg_events
    where dt >= '2022-01-01'
    and event_type = 'from_contract'
    and event_attributes:"contract_address" = 'terra1eek0ymmhyzja60830xhzm7k7jkrk99a60q2z2t'
    and event_attributes:order:order:maker_asset:info:nft:"contract_addr" IS NOT NULL
    and event_attributes:"action" = 'execute_orders'
    group by 1,3,4,6
    Run a query to Download Data