hmxinternOpen interest
    Updated 2024-09-16
    with decreasePosition as (
    SELECT
    cast(DECODED_LOG ['size'] as int) as size,
    cast(DECODED_LOG ['decreasedSize'] as int) as decreasedSize,
    BLOCK_NUMBER as evt_block_number,
    BLOCK_TIMESTAMP as evt_block_time
    from
    blast.core.fact_decoded_event_logs
    where
    CONTRACT_ADDRESS = lower('0x0a8D9c0A4a039dDe3Cb825fF4c2f063f8B54313A')
    and EVENT_NAME = 'LogDecreasePosition'
    ),
    increasePosition as (
    SELECT
    cast(DECODED_LOG ['size'] as int) as size,
    cast(DECODED_LOG ['increasedSize'] as int) as increasedSize,
    BLOCK_NUMBER as evt_block_number,
    BLOCK_TIMESTAMP as evt_block_time
    from
    blast.core.fact_decoded_event_logs
    where
    CONTRACT_ADDRESS = lower('0x0a8D9c0A4a039dDe3Cb825fF4c2f063f8B54313A')
    and EVENT_NAME = 'LogIncreasePosition'
    ),
    liquidatePosition as (
    -- SELECT
    -- cast(DECODED_LOG ['size'] as int) as size,
    -- BLOCK_NUMBER as evt_block_number,
    -- BLOCK_TIMESTAMP as evt_block_time
    -- from
    -- blast.core.fact_decoded_event_logs
    -- where
    -- CONTRACT_ADDRESS = lower('0x963Cbe4cFcDC58795869be74b80A328b022DE00C')
    -- and EVENT_NAME like '%LogLiquidationPosition%'
    select BLOCK_NUMBER as evt_block_number,
    ethereum.public.udf_hex_to_int('s2c',concat('0x', substring(data, 131, 64)))::int as size,
    QueryRunArchived: QueryRun has been archived