brian-terraMeteors vs Dust vs Eggs RandomEarth Total Volume
    Updated 2022-07-07
    WITH orders AS
    (select msg_value:execute_msg:execute_order:order:order:maker_asset:info:nft:contract_addr::string AS contract,
    sum(msg_value:execute_msg:execute_order:order:order:taker_asset:amount::decimal/pow(10,6)) AS amount
    from terra.msgs
    where msg_value:contract::string = 'terra1eek0ymmhyzja60830xhzm7k7jkrk99a60q2z2t'
    --and msg_value:execute_msg:execute_order:order:order:maker_asset:info:nft:contract_addr::string = 'terra103z9cnqm8psy0nyxqtugg6m7xnwvlkqdzm4s4k'
    and tx_status = 'SUCCEEDED'
    and msg_value:execute_msg:execute_order is not null
    and contract is not null
    group by 1
    ),
    Lorders AS
    (select msg_value:execute_msg:ledger_proxy:msg:execute_order:order:order:maker_asset:info:nft:contract_addr::string AS contract,
    sum(msg_value:execute_msg:ledger_proxy:msg:execute_order:order:order:taker_asset:amount::decimal/pow(10,6)) AS lamount
    from terra.msgs
    where msg_value:contract::string = 'terra1eek0ymmhyzja60830xhzm7k7jkrk99a60q2z2t'
    --and msg_value:execute_msg:ledger_proxy:msg:execute_order:order:order:maker_asset:info:nft:contract_addr::string = 'terra103z9cnqm8psy0nyxqtugg6m7xnwvlkqdzm4s4k'
    and tx_status = 'SUCCEEDED'
    and msg_value:execute_msg:ledger_proxy:msg:execute_order is not null
    and contract is not null
    group by 1
    ),
    qmain AS (select NVL(orders.contract,lorders.contract) AS project,
    NVL(amount,0) + nvl(lamount,0) AS amountt
    from orders FULL OUTER JOIN lorders
    ON orders.contract = lorders.contract)

    select CASE WHEN project = 'terra1chrdxaef0y2feynkpq63mve0sqeg09acjnp55v' THEN 'Levana Dragons: Meteors'
    WHEN project = 'terra1p70x7jkqhf37qa7qm4v23g4u4g8ka4ktxudxa7' THEN 'Levana Dragons: Meteor Dust'
    WHEN project = 'terra1k0y373yxqne22pc9g7jvnr4qclpsxtafevtrpg' THEN 'Levana Dragons: Eggs'
    ELSE '**NO NAME**' END AS "Project Name",
    project as "Contract Address",
    round(amountt,2) as "Total Volume (LUNA)"
    from qmain
    where project IN ('terra1chrdxaef0y2feynkpq63mve0sqeg09acjnp55v',
    'terra1p70x7jkqhf37qa7qm4v23g4u4g8ka4ktxudxa7',
    Run a query to Download Data