Avalanche DeFiGMX v1 Open Interest
    Updated 5 hours ago
    with
    v1_oi as (
    select
    date(block_timestamp) as day,
    event_name,
    case when event_name in ('LiquidatePosition') then decoded_log:size*pow(10,-30)*(-1)
    when event_name in ('DecreasePosition') then decoded_log:sizeDelta*pow(10,-30)*(-1)
    else decoded_log:sizeDelta*pow(10,-30) end as delta,
    case when decoded_log:isLong ilike 'TRUE' then 'LONG' else 'SHORT' end as direction,
    decoded_log:indexToken as market
    from
    avalanche.core.ez_decoded_event_logs
    where
    contract_address='0x9ab2de34a33fb459b538c43f251eb825645e8595'
    and event_name in ('DecreasePosition','IncreasePosition','LiquidatePosition')
    order by
    block_timestamp DESC
    )

    select
    *
    from (
    select
    day,
    market,
    direction,
    sum(delta) as daily_changes,
    sum(daily_changes) over (partition by market, direction order by day asc) as total_oi
    from (
    select day, market, direction, delta
    from v1_oi
    )
    group by
    day,
    market,
    direction
    Last run: about 5 hours agoAuto-refreshes every 6 hours
    DAY
    MARKET
    DIRECTION
    DAILY_CHANGES
    TOTAL_OI
    1
    2025-04-27 00:00:00.000
    0xb31f66aa3c1e785363f0875a1b74e27b85fd66c7
    SHORT38081.17164240838465.728029065
    2
    2025-04-27 00:00:00.000
    0xb31f66aa3c1e785363f0875a1b74e27b85fd66c7
    LONG5309.7766971153548.16085128
    3
    2025-04-26 00:00:00.000
    0xb31f66aa3c1e785363f0875a1b74e27b85fd66c7
    SHORT0384.556386657
    4
    2025-04-26 00:00:00.000
    0x49d5c2bdffac6ce2bfdb6640f4f80f226bc10bab
    LONG1796.4049750485635.44131488
    5
    2025-04-26 00:00:00.000
    0xb31f66aa3c1e785363f0875a1b74e27b85fd66c7
    LONG-16787.78587971848238.384154171
    6
    2025-04-25 00:00:00.000
    0xb31f66aa3c1e785363f0875a1b74e27b85fd66c7
    SHORT0384.556386657
    7
    2025-04-25 00:00:00.000
    0xb31f66aa3c1e785363f0875a1b74e27b85fd66c7
    LONG-390733.44779723865026.170033889
    8
    2025-04-24 00:00:00.000
    0xb31f66aa3c1e785363f0875a1b74e27b85fd66c7
    LONG109480.61369421455759.617831127
    9
    2025-04-24 00:00:00.000
    0xb31f66aa3c1e785363f0875a1b74e27b85fd66c7
    SHORT-3.637978807e-12384.556386657
    10
    2025-04-23 00:00:00.000
    0x50b7545627a5162f82a992c33b87adc75187b218
    LONG-11.51101920.33537574
    11
    2025-04-23 00:00:00.000
    0xb31f66aa3c1e785363f0875a1b74e27b85fd66c7
    SHORT-23841.236804647384.556386657
    12
    2025-04-23 00:00:00.000
    0xb31f66aa3c1e785363f0875a1b74e27b85fd66c7
    LONG311649.60770407346279.004136917
    13
    2025-04-22 00:00:00.000
    0xb31f66aa3c1e785363f0875a1b74e27b85fd66c7
    LONG-115435.63035717634629.396432847
    14
    2025-04-22 00:00:00.000
    0x49d5c2bdffac6ce2bfdb6640f4f80f226bc10bab
    LONG3824.6012109353839.036339832
    15
    2025-04-22 00:00:00.000
    0x152b9d0fdc40c096757f570a51e494bd4b943e50
    SHORT-31.897662163-1.32009248e-9
    16
    2025-04-22 00:00:00.000
    0xb31f66aa3c1e785363f0875a1b74e27b85fd66c7
    SHORT-8328.8086953424225.793191304
    17
    2025-04-21 00:00:00.000
    0xb31f66aa3c1e785363f0875a1b74e27b85fd66c7
    SHORT31807.26957217532554.601886644
    18
    2025-04-21 00:00:00.000
    0xb31f66aa3c1e785363f0875a1b74e27b85fd66c7
    LONG107860.862260928150065.026790023
    19
    2025-04-20 00:00:00.000
    0x49d5c2bdffac6ce2bfdb6640f4f80f226bc10bab
    LONG-10174.02174937914.435128897
    20
    2025-04-20 00:00:00.000
    0xb31f66aa3c1e785363f0875a1b74e27b85fd66c7
    LONG-106615.77305434442204.164529095
    ...
    1585
    172KB
    250s