Specterpolygon total amount trend
    Updated 2024-10-16
    -- forked from Blast total amount trend @ https://flipsidecrypto.xyz/studio/queries/e82eaada-93a7-4bfe-b021-d54299635dfd

    -- forked from total amount trend @ https://flipsidecrypto.xyz/studio/queries/d97b915d-777f-4de2-a3ab-1e70fc27b6bd

    WITH ChainV AS (
    SELECT Date_trunc('day', block_timestamp) AS date, 'blast' AS chain,
    tx_hash, to_address, amount_usd
    FROM blast.core.ez_native_transfers
    WHERE from_address = '0x59b9ac688e39a14b938ac8c3269db66d8adb9af6'

    UNION ALL

    SELECT Date_trunc('day', block_timestamp) AS date, 'bsc' AS chain,
    tx_hash, to_address, amount_usd
    FROM bsc.core.ez_native_transfers
    WHERE from_address = '0x7e2cf06f092c9f5cf5972ef021635b6c8e1c5bb2'

    UNION ALL

    SELECT Date_trunc('day', block_timestamp) AS date, 'polygon' AS chain,
    tx_hash, to_address, amount_usd
    FROM polygon.core.ez_native_transfers
    WHERE from_address = '0x8ccd9c0a9c084412416a85fd748c7f1e9b86442d'
    )

    SELECT date,
    sum(amount_usd) AS total_amount
    FROM ChainV
    where chain ='polygon'
    GROUP BY date, chain
    ORDER BY Date DESC


    QueryRunArchived: QueryRun has been archived