From f2754f159b5bdf5afbb14c09ae7659ce184d06fb Mon Sep 17 00:00:00 2001 From: Teddy Ding Date: Wed, 8 Jan 2025 16:37:06 -0500 Subject: [PATCH] fix sql script --- .../src/scripts/handlers/dydx_update_perpetual_v2_handler.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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)