diff --git a/indexer/services/ender/src/scripts/handlers/dydx_update_perpetual_v2_handler.sql b/indexer/services/ender/src/scripts/handlers/dydx_update_perpetual_v2_handler.sql index df54fbeb39..efe4088713 100644 --- a/indexer/services/ender/src/scripts/handlers/dydx_update_perpetual_v2_handler.sql +++ b/indexer/services/ender/src/scripts/handlers/dydx_update_perpetual_v2_handler.sql @@ -24,7 +24,7 @@ BEGIN /* For backwards compatibility, handle the case where defaultFundingPpm is not present */ CASE /* Convert defaultFundingPpm from parts-per-million to a rate */ - WHEN event_data ? 'defaultFunding8hrPpm' THEN dydx_trim_scale( + WHEN (event_data->>'defaultFunding8hrPpm') IS NOT NULL THEN dydx_trim_scale( power(10, PPM_EXPONENT) / FUNDING_RATE_FROM_PROTOCOL_IN_HOURS * (event_data->'defaultFunding8hrPpm')::numeric)