hess2024-06-27 02:58 AM
    Updated 2024-06-27
    with token_bonk_i as ( Select VALUE:"DECIMAL" as decimal,
    value:"TOKEN_ADDRESS" as token_address,
    value:"TOKEN_NAME" as token_name
    from (
    SELECT livequery.live.udf_api(
    'https://flipsidecrypto.xyz/api/v1/queries/afb49a72-5616-4521-bc64-019467ed698b/data/latest') as resp
    )
    ,LATERAL FLATTEN (input => resp:data))
    ,
    base as (select trunc(block_timestamp,'hour') as hourly,
    case when origin_from_address = '0x74cae0ecc47b02ed9b9d32e000fd70b9417970c5' then 'Hyperlane'
    when origin_from_address = '0xd99ac0681b904991169a4f398b9043781adbe0c3' then 'Symbiosis'
    when origin_from_address = '0xe93685f3bba03016f02bd1828badd6195988d950' then 'LayerZero' end as platform,
    tx_hash,
    to_address,
    case when symbol ilike '%eth%' then 'WETH' else symbol end as token_name,
    amount
    from sei.core_evm.ez_token_transfers
    where origin_from_address in
    ('0x74cae0ecc47b02ed9b9d32e000fd70b9417970c5',
    '0xd99ac0681b904991169a4f398b9043781adbe0c3',
    '0xe93685f3bba03016f02bd1828badd6195988d950')
    and origin_to_address != to_address
    and to_address not in (lower('0xcE8f24A58D85eD5c5A6824f7be1F8d4711A0eb4C'),
    lower('0xa4cF2F53D1195aDDdE9e4D3aCa54f556895712f2'),
    lower('0xC75C669a62A7eCe0C8d37904b747970467432ad3'),
    lower('0x8C7Ba8F245aEF3216698087461e05B85483F791f'),
    lower('0x8D5261cFF8d63E71C772574EbA63E64E6726EE06'),
    lower('0xe7FEf2854AC5B89f116D1d8E93AD8506d85d8f31')))
    ,
    price as ( select hour,
    token_address,
    symbol,
    price
    from ethereum.price.ez_prices_hourly
    where symbol not in ('USDC','USDT','axlUSDC')
    QueryRunArchived: QueryRun has been archived