MLDZMNtrade1
    Updated 2023-01-11
    select
    date_trunc('day',BLOCK_TIMESTAMP) as date,
    'From LUNA' as swap_type,
    count(distinct tx_id) as no_txn,
    count(distinct TRADER) as no_users,
    sum(FROM_AMOUNT/1e6) as volume,
    avg(FROM_AMOUNT/1e6) as avg_volume
    from terra.core.ez_swaps
    where block_timestamp>='2022-12-25' and FROM_CURRENCY='uluna' and TX_SUCCEEDED='TRUE'
    group by 1
    union all
    select
    date_trunc('day',BLOCK_TIMESTAMP) as date,
    'To LUNA' as swap_type,
    count(distinct tx_id) as no_txn,
    count(distinct TRADER) as no_users,
    sum(TO_AMOUNT/1e6) as volume,
    avg(TO_AMOUNT/1e6) as avg_volume
    from terra.core.ez_swaps
    where block_timestamp>='2022-12-25' and to_CURRENCY='uluna' and TX_SUCCEEDED='TRUE'
    group by 1
    Run a query to Download Data