datavortexVolume by Sender and Destination Chain ID
    Updated 2024-09-17

    WITH total_volume AS (
    SELECT
    SUM(amount_usd) AS grand_total
    FROM
    avalanche.defi.ez_bridge_activity
    WHERE
    amount_usd IS NOT NULL
    ),
    chain_volume AS (
    SELECT
    destination_chain AS chain,
    SUM(amount_usd) AS total_volume
    FROM
    avalanche.defi.ez_bridge_activity
    WHERE
    amount_usd IS NOT NULL
    GROUP BY
    destination_chain
    )
    SELECT
    cv.chain,
    cv.total_volume,
    (cv.total_volume / tv.grand_total) * 100 AS percentage_of_total
    FROM
    chain_volume cv
    JOIN
    total_volume tv
    ON
    1=1
    ORDER BY
    percentage_of_total DESC;

    QueryRunArchived: QueryRun has been archived