yasminSWAP copy
    Updated 4 days ago
    WITH swaps AS (
    SELECT
    DATE_TRUNC('WEEK', block_timestamp)::date AS swap_date,
    'RON_TO_USDC' AS swap_type,
    TX_HASH,
    ORIGIN_FROM_ADDRESS AS swapper_address,
    DECODED_LOG :_amount1In / POWER(10, 18) AS ron_amount,
    DECODED_LOG :_amount0Out / POWER(10, 6) AS usdc_amount
    FROM ronin.core.ez_decoded_event_logs
    WHERE
    CONTRACT_ADDRESS = '0x4f7687affc10857fccd0938ecda0947de7ad3812'
    AND EVENT_NAME = 'Swap'
    AND TOPIC_0 = '0xd78ad95fa46c994b6551d0da85fc275fe613ce37657fb8d5e3d130840159d822'
    AND DECODED_LOG :_amount1In > 0
    AND DECODED_LOG :_amount0Out > 0
    UNION ALL
    --------------------------
    SELECT
    DATE_TRUNC('WEEK', block_timestamp)::date AS swap_date,
    'USDC_TO_RON' AS swap_type,
    TX_HASH,
    ORIGIN_FROM_ADDRESS AS swapper_address,
    DECODED_LOG :_amount1Out / POWER(10, 18) AS ron_amount,
    DECODED_LOG :_amount0In / POWER(10, 6) AS usdc_amount
    FROM
    ronin.core.ez_decoded_event_logs
    WHERE
    CONTRACT_ADDRESS = '0x4f7687affc10857fccd0938ecda0947de7ad3812'
    AND EVENT_NAME = 'Swap'
    AND TOPIC_0 = '0xd78ad95fa46c994b6551d0da85fc275fe613ce37657fb8d5e3d130840159d822'
    AND DECODED_LOG :_amount0In > 0
    AND DECODED_LOG :_amount1Out > 0
    ), daily_prices AS (
    SELECT
    hour :: date AS date_price,
    AVG(price) AS ron_price
    Last run: 4 days ago
    Date
    Swap Type
    Total Volume (USD)
    Number of Swaps
    Unique Swappers
    Average Swap Size (USD)
    Daily Volume Share (%)
    1
    2025-05-26 00:00:00.000RON_TO_USDC1020015.729211746512887219.31105766849.406150308
    2
    2025-05-26 00:00:00.000USDC_TO_RON1044536.40215785001226122.88663554850.593849692
    3
    2025-05-19 00:00:00.000RON_TO_USDC2506167.05723688117156650213.92804585947.773011372
    4
    2025-05-19 00:00:00.000USDC_TO_RON2739822.226787104301670262.68669480252.226988628
    5
    2025-05-12 00:00:00.000RON_TO_USDC3009924.19213947119195213252.53160434151.093535945
    6
    2025-05-12 00:00:00.000USDC_TO_RON2881083.616329168821758170.66008863548.906464055
    7
    2025-05-05 00:00:00.000RON_TO_USDC2246605.18990888131985345170.22315425941.807224612
    8
    2025-05-05 00:00:00.000USDC_TO_RON3127119.59269544633171170.06294877558.192775388
    9
    2025-04-28 00:00:00.000RON_TO_USDC1332071.4928428635788739137.2211772952.072332668
    10
    2025-04-28 00:00:00.000USDC_TO_RON1226046.0805480869142515.1608908347.927667332
    11
    2025-04-21 00:00:00.000RON_TO_USDC1933176.09405864191035997101.19751316945.917120991
    12
    2025-04-21 00:00:00.000USDC_TO_RON2276966.11944425484180389.34885102254.082879009
    13
    2025-04-14 00:00:00.000RON_TO_USDC2518524.68404919108574504231.97243106351.482050212
    14
    2025-04-14 00:00:00.000USDC_TO_RON2373519.579277115571693205.37506093948.517949788
    15
    2025-04-07 00:00:00.000RON_TO_USDC3667909.48671102167678619218.75764816151.698177184
    16
    2025-04-07 00:00:00.000USDC_TO_RON3426943.149331157401904217.72192816648.301822816
    17
    2025-03-31 00:00:00.000RON_TO_USDC4271101.125384981381141218130.9244618654.022609413
    18
    2025-03-31 00:00:00.000USDC_TO_RON3635035.16047344510308881.6678310645.977390587
    19
    2025-03-24 00:00:00.000RON_TO_USDC2245913.0357887597285688230.87099463355.502399931
    20
    2025-03-24 00:00:00.000USDC_TO_RON1800602.13936333112214654.37914168244.497600069
    70
    7KB
    19s