Eman-RazAXL Swap on Osmosis
    Updated 2025-02-02
    with overview as (with tab1 as (select date_trunc('hour',block_timestamp) as date, tx_id, trader, case
    when from_currency='ibc/903A61A498756EA560B85A85132D3AEE21B5DEDD41213725D22ABF276EA6945E' then from_amount/pow(10,6)
    when to_currency='ibc/903A61A498756EA560B85A85132D3AEE21B5DEDD41213725D22ABF276EA6945E' then to_amount/pow(10,6)
    end as amount, case
    when from_currency='ibc/903A61A498756EA560B85A85132D3AEE21B5DEDD41213725D22ABF276EA6945E' then 'Seller'
    when to_currency='ibc/903A61A498756EA560B85A85132D3AEE21B5DEDD41213725D22ABF276EA6945E' then 'Buyer'
    end as trader_type, case
    when from_currency='ibc/903A61A498756EA560B85A85132D3AEE21B5DEDD41213725D22ABF276EA6945E' then 'Sell'
    when to_currency='ibc/903A61A498756EA560B85A85132D3AEE21B5DEDD41213725D22ABF276EA6945E' then 'Buy'
    end as trade_type, from_currency, to_currency
    from osmosis.defi.fact_swaps
    where (from_currency='ibc/903A61A498756EA560B85A85132D3AEE21B5DEDD41213725D22ABF276EA6945E' or
    to_currency='ibc/903A61A498756EA560B85A85132D3AEE21B5DEDD41213725D22ABF276EA6945E') and tx_succeeded='TRUE'),

    tab2 as (select hour, price
    from ethereum.price.ez_prices_hourly
    where token_address = lower('0x467719ad09025fcc6cf6f8311755809d45a5e5f3'))

    select date, tx_id, trader, amount, amount*price as amount_usd, trader_type, trade_type, from_currency, to_currency
    from tab1 left join tab2 on tab1.date = tab2.hour)

    select date_trunc('{{Time_Frame}}',date) as "Date", round(sum(amount),2) as "Swap Volume ($AXL)",
    round(sum(amount_usd),2) as "Swap Volume ($USD)", count(distinct tx_id) as "Swap Count",
    count(distinct trader) as "Swapper count"
    from overview
    where date>='{{Start_Date}}' and date<='{{End_Date}}'
    group by 1
    order by 1





    Last run: 3 months ago
    Date
    Swap Volume ($AXL)
    Swap Volume ($USD)
    Swap Count
    Swapper count
    1
    2022-09-01 00:00:00.0005131643.613752910.4961161875
    2
    2022-10-01 00:00:00.0007704548.176665374.93179934019
    3
    2022-11-01 00:00:00.0006569252.154187615.8697482878
    4
    2022-12-01 00:00:00.0007412213.733574733.31160803894
    5
    2023-01-01 00:00:00.0005798647.123257331.81142752745
    6
    2023-02-01 00:00:00.0009784230.177316862.89314902975
    7
    2023-03-01 00:00:00.0005567934.733642699.58239682767
    8
    2023-04-01 00:00:00.0007477422.273984138.22231852780
    9
    2023-05-01 00:00:00.0007161317.023742498.92288037933
    10
    2023-06-01 00:00:00.0006822214.062789770.54248913370
    11
    2023-07-01 00:00:00.00011708227.824405779.75182843080
    12
    2023-08-01 00:00:00.0004844367.251799665.9793251917
    13
    2023-09-01 00:00:00.00019088942.516572893.2303751765
    14
    2023-10-01 00:00:00.0008435684.862770952.02227511839
    15
    2023-11-01 00:00:00.00013002900.346901948.32260723138
    16
    2023-12-01 00:00:00.00023399227.121177821.51491865143
    17
    2024-01-01 00:00:00.00010329327.2110881617.15297935337
    18
    2024-02-01 00:00:00.0007945058.59631025.55436664480
    19
    2024-03-01 00:00:00.00019353749.3639551271.743367455205
    20
    2024-04-01 00:00:00.00013675700.617969235.613106282812
    30
    2KB
    10s