lanoCapybara Assets Locked copy
    Updated 2024-06-23
    -- forked from Capybara Assets Locked @ https://flipsidecrypto.xyz/edit/queries/1d106a06-ef95-4e44-964e-8e303ee93a1e

    with mk as (
    select
    block_timestamp,
    TX_HASH,
    '0x' || substr(topics[1],27) AS from_address,
    '0x' || substr(topics[2],27) AS to_address,
    (ethereum.public.udf_hex_to_int(data))::int/1e18 as amount,
    data
    from kaia.core.fact_event_logs
    where contract_address='0x8a5562d2a17488647381c1a0e9cf527a01b6f3bd'
    and topics[0]='0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef'
    and TX_SUCCEEDED='TRUE'
    ),

    mu as (
    select
    block_timestamp,
    TX_HASH,
    '0x' || substr(topics[1],27) AS from_address,
    '0x' || substr(topics[2],27) AS to_address,
    (ethereum.public.udf_hex_to_int(data))::int/1e18 as amount,
    data
    from kaia.core.fact_event_logs
    where contract_address='0xa856b5da8e85b23395c17783954edda010317fce'
    and topics[0]='0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef'
    and TX_SUCCEEDED='TRUE'
    ),

    mw as (
    select
    block_timestamp,
    TX_HASH,
    '0x' || substr(topics[1],27) AS from_address,
    '0x' || substr(topics[2],27) AS to_address,
    QueryRunArchived: QueryRun has been archived