yasminDESTINATION_CHAIN
    Updated 2024-03-13

    -- SELECT * from avalanche.defi.ez_bridge_activity LIMIT 1

    WITH bridge_activity AS (
    SELECT
    BLOCK_TIMESTAMP,
    ORIGIN_FROM_ADDRESS,
    ORIGIN_TO_ADDRESS,
    ORIGIN_FUNCTION_SIGNATURE,
    TX_HASH,
    EVENT_INDEX,
    BRIDGE_ADDRESS,
    EVENT_NAME,
    PLATFORM,
    SENDER,
    RECEIVER,
    DESTINATION_CHAIN,
    DESTINATION_CHAIN_ID,
    TOKEN_ADDRESS,
    TOKEN_SYMBOL,
    ROUND(AMOUNT_USD, 0) AS AMOUNT_USD_rounded
    FROM
    avalanche.defi.ez_bridge_activity
    WHERE
    BLOCK_TIMESTAMP :: date > '{{date}}'
    )
    SELECT
    DATE_TRUNC('Day', BLOCK_TIMESTAMP) AS "date",
    DESTINATION_CHAIN,
    COUNT(DISTINCT TX_HASH) AS "txs",
    COUNT(DISTINCT ORIGIN_FROM_ADDRESS) AS "users",
    SUM(AMOUNT_USD_rounded) AS "bridge volume usd"
    FROM
    bridge_activity
    GROUP BY 1,2