Updated 2025-04-13
    with

    main as (
    select
    tx_hash,
    block_timestamp,
    a.old_owner_id as swapper,
    a.amount_raw as amount_in_unadj,
    b.amount_raw as amount_out_unadj,
    trim(replace(replace(replace(replace(replace(a.token_id, 'nep141:'), 'eth-'), 'arb-'), 'base-'), '.omft.near')) as token_in_contract,
    trim(replace(replace(replace(replace(replace(b.token_id, 'nep141:'), 'eth-'), 'arb-'), 'base-'), '.omft.near')) as token_out_contract
    from
    near.defi.fact_intents a
    join
    near.defi.fact_intents b using (tx_hash, log_event)
    where
    log_event = 'mt_transfer'
    and not a.old_owner_id ilike any ('solver-%.near', 'intents.near', 'intents.sputnik-dao.near', 'defuse-relay.near')
    and b.old_owner_id ilike any ('solver-%.near', 'intents.near', 'intents.sputnik-dao.near', 'defuse-relay.near')
    AND token_in_contract <> token_out_contract
    ),

    pricet as (
    select
    hour::date as date,
    decimals,
    token_address,
    symbol,
    avg(price) as price_usd
    from
    crosschain.price.ez_prices_hourly
    where
    token_address in (
    '0xfc5a1a6eb076a2c7ad06ed22c90d7e710e35ad0a',
    '0xfc5a1a6eb076a2c7ad06ed22c90d7e710e35ad0a',
    '0xaf88d065e77c8cc2239327c5edb3a432268e5831',
    Last run: 13 days ago
    SWAPS
    SWAPPERS
    VOLUME_USD
    AVERAGE_AMOUNT_USD
    DAILY_AVERAGE_SWAPS
    DAILY_AVERAGE_SWAPPERS
    1
    30963339832993087.1931442314.840563713194.73584921.371069
    1
    66B
    21s