Afonso_DiazOvertime
    Updated 2025-01-15
    with

    pricet as (
    select
    hour::date as date,
    avg(price) as token_price_usd
    from
    crosschain.price.ez_prices_hourly
    where
    blockchain = 'ethereum'
    and token_address = '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2'
    group by 1
    ),

    main as (
    select
    tx_hash,
    block_timestamp,
    origin_from_address as user,
    value as amount,
    utils.udf_hex_to_string(substring(data, 129)) AS domain_name
    from
    ink.core.fact_event_logs
    join
    ink.core.fact_transactions using (tx_hash, block_timestamp)
    where
    tx_succeeded
    and topics[0] = '0x53946bf984072f5888fcb2d7d2b0587c8efeb9187d958f21809711cf00b4b4a5'
    and origin_to_address = '0xfb2cd41a8aec89efbb19575c6c48d872ce97a0a5'
    ),

    final as (
    select
    main.*,
    amount * token_price_usd as amount_usd
    from
    QueryRunArchived: QueryRun has been archived