LI.FIMain-LiFiSpark
    Updated 2024-08-19
    -- forked from Main @ https://flipsidecrypto.xyz/edit/queries/886bfe32-77c3-4923-9a2c-710277762a25
    -- tx_example on gnosis: 0x10bf2b7c681007b3441b135ec256ea48f2dab42a05063e9260a114d9648f56fb


    WITH prices as (
    SELECT
    hour,
    price,
    decimals,
    symbol,
    iff(
    is_native,
    '0x0000000000000000000000000000000000000000',
    token_address
    ) as token_address,
    'ethereum' AS chain
    FROM
    ethereum.price.ez_prices_hourly
    UNION
    SELECT
    hour,
    price,
    decimals,
    symbol,
    iff(
    is_native AND (symbol = 'XDAI'),
    '0x0000000000000000000000000000000000000000',
    token_address
    ) as token_address,
    'gnosis' AS chain
    FROM
    gnosis.price.ez_prices_hourly
    ),
    ethereum_txns AS (
    SELECT
    date_trunc('d', a.block_timestamp) AS date,
    QueryRunArchived: QueryRun has been archived