boomer77lunabulls-RE
    Updated 2021-12-20
    with re as (select msg_value,
    date(block_timestamp) as dates,
    msg_value:execute_msg:ledger_proxy:msg:execute_order:order:order:maker_asset:info:nft:contract_addr::string as nft_maker,
    msg_value:execute_msg:ledger_proxy:msg:execute_order:order:order:taker_asset:info:nft:contract_addr::string as nft_taker, case
    when nft_maker is not null then nft_maker
    when nft_maker is null then nft_taker end as nft_collections,
    (msg_value:execute_msg:ledger_proxy:msg:execute_order:order:order:taker_asset:amount::int)/1000000 as amount
    from terra.msgs
    where msg_value:contract::string = 'terra1eek0ymmhyzja60830xhzm7k7jkrk99a60q2z2t'
    and tx_status = 'SUCCEEDED'
    and (msg_value:execute_msg:execute_order is not null or msg_value:execute_msg:ledger_proxy:msg:execute_order is not null)
    )

    select
    date_trunc('day', dates) as dt, min(amount) as floor_sale, max(amount) as ceiling_sale, avg(amount) as average_sale,
    sum(round(amount,2)) as Total_sale_Volume, SUM(Total_sale_Volume) OVER(ORDER BY dt ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) as cumulative_sales
    from re
    where nft_collections = 'terra1trn7mhgc9e2wfkm5mhr65p3eu7a2lc526uwny2' and amount > 0.1 and dates > '2021-11-01'
    group by 1
    order by 1 desc
    Run a query to Download Data