MoDeFiNI - withdraw data
    Updated 2025-03-23
    with tokens_list as (
    select * from $query('e248c535-501e-445c-9bd6-0492715972ba')),

    near_intents_withdraw_address as (
    select tx_hash, replace(ACTION_DATA:args:memo,'WITHDRAW_TO:','') as withdraw_address
    from near.core.ez_actions
    where ACTION_DATA:method_name='ft_transfer'
    and TX_SUCCEEDED=TRUE
    and BLOCK_TIMESTAMP>='2024-11-05'
    and TX_RECEIVER='intents.near'
    and withdraw_address is not null),

    near_tokens_price as
    (select hour, b.symbol, price
    from near.price.ez_prices_hourly a
    left join tokens_list b
    on contract=TOKEN_ADDRESS
    where contract is not null and a.symbol!='NEAR'
    and hour>='2024-11-01'),

    tokens_price as (
    select hour, a.symbol, price
    from crosschain.price.ez_prices_hourly a
    left join tokens_list
    on contract ilike '%'||a.TOKEN_ADDRESS||'%' and initcap(BLOCKCHAIN)=chain
    where contract is not null
    and chain!='Near'
    and a.symbol not in (select symbol from near_tokens_price)
    and hour>='2024-11-01'
    union
    select hour, 'ETH' as symbol, price
    from crosschain.price.ez_prices_hourly
    where symbol='WETH' and BLOCKCHAIN='ethereum'
    and hour>='2024-11-01'
    union
    select hour, symbol, price
    Auto-refreshes every 3 hours
    QueryRunArchived: QueryRun has been archived