Skip to content

Commit

Permalink
Remove open interest handler (backport #2319) (#2321)
Browse files Browse the repository at this point in the history
Co-authored-by: dydxwill <119354122+dydxwill@users.noreply.github.com>
Co-authored-by: Will Liu <will@dydx.exchange>
  • Loading branch information
3 people authored Sep 23, 2024
1 parent 7535c2f commit 2820ac2
Show file tree
Hide file tree
Showing 9 changed files with 0 additions and 291 deletions.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ const HANDLER_SCRIPTS: string[] = [
'dydx_market_create_handler.sql',
'dydx_market_modify_handler.sql',
'dydx_market_price_update_handler.sql',
'dydx_open_interest_update_handler.sql',
'dydx_perpetual_market_v1_handler.sql',
'dydx_perpetual_market_v2_handler.sql',
'dydx_stateful_order_handler.sql',
Expand Down
2 changes: 0 additions & 2 deletions indexer/services/ender/src/lib/block-processor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import { DeleveragingValidator } from '../validators/deleveraging-validator';
import { FundingValidator } from '../validators/funding-validator';
import { LiquidityTierValidatorV2, LiquidityTierValidator } from '../validators/liquidity-tier-validator';
import { MarketValidator } from '../validators/market-validator';
import { OpenInterestUpdateValidator } from '../validators/open-interest-update-validator';
import { OrderFillValidator } from '../validators/order-fill-validator';
import { PerpetualMarketValidator } from '../validators/perpetual-market-validator';
import { StatefulOrderValidator } from '../validators/stateful-order-validator';
Expand Down Expand Up @@ -59,7 +58,6 @@ const BLOCK_EVENT_SUBTYPE_VERSION_TO_VALIDATOR_MAPPING: Record<string, Validator
[serializeSubtypeAndVersion(DydxIndexerSubtypes.FUNDING.toString(), 1)]: FundingValidator,
[serializeSubtypeAndVersion(DydxIndexerSubtypes.TRADING_REWARD.toString(), 1)]: TradingRewardsValidator,
[serializeSubtypeAndVersion(DydxIndexerSubtypes.STATEFUL_ORDER.toString(), 1)]: StatefulOrderValidator,
[serializeSubtypeAndVersion(DydxIndexerSubtypes.OPEN_INTEREST_UPDATE.toString(), 1)]: OpenInterestUpdateValidator,
};

function serializeSubtypeAndVersion(
Expand Down
10 changes: 0 additions & 10 deletions indexer/services/ender/src/lib/helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import {
UpdateClobPairEventV1,
SubaccountMessage,
DeleveragingEventV1,
OpenInterestUpdateEventV1,
TradingRewardsEventV1,
} from '@dydxprotocol-indexer/v4-protos';
import Big from 'big.js';
Expand Down Expand Up @@ -232,15 +231,6 @@ export function indexerTendermintEventToEventProtoWithType(
blockEventIndex,
};
}
case (DydxIndexerSubtypes.OPEN_INTEREST_UPDATE.toString()): {
return {
type: DydxIndexerSubtypes.OPEN_INTEREST_UPDATE,
eventProto: OpenInterestUpdateEventV1.decode(eventDataBinary),
indexerTendermintEvent: event,
version,
blockEventIndex,
};
}
default: {
const message: string = `Unable to parse event subtype: ${event.subtype}`;
logger.error({
Expand Down
8 changes: 0 additions & 8 deletions indexer/services/ender/src/lib/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ import {
UpdateClobPairEventV1,
DeleveragingEventV1,
TradingRewardsEventV1,
OpenInterestUpdateEventV1,
BlockHeightMessage,
} from '@dydxprotocol-indexer/v4-protos';
import { IHeaders } from 'kafkajs';
Expand All @@ -56,7 +55,6 @@ export enum DydxIndexerSubtypes {
UPDATE_CLOB_PAIR = 'update_clob_pair',
DELEVERAGING = 'deleveraging',
TRADING_REWARD = 'trading_reward',
OPEN_INTEREST_UPDATE = 'open_interest_update',
}

// Generic interface used for creating the Handler objects
Expand Down Expand Up @@ -159,12 +157,6 @@ export type EventProtoWithTypeAndVersion = {
indexerTendermintEvent: IndexerTendermintEvent,
version: number,
blockEventIndex: number,
} | {
type: DydxIndexerSubtypes.OPEN_INTEREST_UPDATE,
eventProto: OpenInterestUpdateEventV1,
indexerTendermintEvent: IndexerTendermintEvent,
version: number,
blockEventIndex: number,
});

// Events grouped into events block events and events for each transactionIndex
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,6 @@ BEGIN
rval[i] = dydx_update_clob_pair_handler(event_data);
WHEN '"funding_values"'::jsonb THEN
rval[i] = dydx_funding_handler(block_height, block_time, event_data, event_index, transaction_index);
WHEN '"open_interest_update"'::jsonb THEN
rval[i] = dydx_open_interest_update_handler(event_data);
ELSE
NULL;
END CASE;
Expand Down

This file was deleted.

This file was deleted.

0 comments on commit 2820ac2

Please sign in to comment.