BlockTrackersuperswap daily metrics
    Updated 2025-03-06
    -- forked from superswap main @ https://flipsidecrypto.xyz/studio/queries/7c6a8e1c-ba56-4695-addc-76ae17fa158d

    with main as (
    select
    block_timestamp,
    tx_hash,
    origin_from_address,
    origin_to_address,
    decoded_log:amountIn as amount_in_raw,
    decoded_log:amountOut as amount_out_raw,
    decoded_log:amountOutMin as amountOutMin_raw,
    decoded_log:tokenIn as token_in,
    decoded_log:tokenOut as token_out,
    decoded_log:"from" as swapper
    from ink.core.ez_decoded_event_logs
    where contract_address = lower('0x5839389261D1F38aac7c8E91DcDa85646bEcB414')
    and TX_SUCCEEDED
    and event_name = 'Route'
    )

    ,
    token_info as (
    select
    address as token,
    symbol,
    name ,
    decimals as decimal
    from ink.core.dim_contracts
    )
    ,
    prices as (

    select
    date_trunc('hour', hour) as date,
    token_address,
    symbol,
    QueryRunArchived: QueryRun has been archived