datavortexfees POL
    Updated 2025-04-17

    WITH PolygonClassifiedSwaps AS (
    SELECT
    tx_hash
    FROM polygon.core.ez_decoded_event_logs
    WHERE
    contract_address IN (
    '0x2f3c540b426ee34afaf6597d8e3575f54bd08ea8',
    '0x3c7271a4e0f9221605017fbb021926944ab8b6fb',
    '0x11bcc5b9fbcd882952fec8ae95214036a981797b' -- SOIL/USDT
    )
    AND event_name = 'Swap'
    ),
    PolygonTxFees AS (
    SELECT
    t.tx_fee AS tx_fee_polygon
    FROM PolygonClassifiedSwaps s
    LEFT JOIN polygon.core.fact_transactions t
    ON s.tx_hash = t.tx_hash
    WHERE t.tx_fee IS NOT NULL
    )
    SELECT
    SUM(tx_fee_polygon) AS "Total Fees (POL)",
    AVG(tx_fee_polygon) AS "Average Fee (POL)"
    FROM PolygonTxFees;








    /*
    WITH PolygonClassifiedSwaps AS (
    SELECT
    Last run: about 1 month ago
    Total Fees (POL)
    Average Fee (POL)
    1
    7039.2541026440.05400810286
    1
    32B
    511s