From 235fab50745168396434fcefe767523241400538 Mon Sep 17 00:00:00 2001 From: GitHub Actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 20 Jul 2025 23:09:02 +0000 Subject: [PATCH 1/5] Bumping drift-common to 2066865081aba3d717c58e04a77a2054a6a6946b --- drift-common | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drift-common b/drift-common index 0c261cd..2066865 160000 --- a/drift-common +++ b/drift-common @@ -1 +1 @@ -Subproject commit 0c261cd0bf6061c93085b54f57c78f03f36d8da8 +Subproject commit 2066865081aba3d717c58e04a77a2054a6a6946b From 472cbdfec0d02a51466eef6d62a7d0916cc99ae4 Mon Sep 17 00:00:00 2001 From: GitHub Actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 21 Jul 2025 01:36:19 +0000 Subject: [PATCH 2/5] Bumping drift-common to e3011f8b0f5bd63a8332c9b1b13a1a042fd8e280 --- drift-common | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drift-common b/drift-common index 2066865..e3011f8 160000 --- a/drift-common +++ b/drift-common @@ -1 +1 @@ -Subproject commit 2066865081aba3d717c58e04a77a2054a6a6946b +Subproject commit e3011f8b0f5bd63a8332c9b1b13a1a042fd8e280 From 396d24a49ec4d35646b35216a2e40b6deb54f169 Mon Sep 17 00:00:00 2001 From: GitHub Actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 21 Jul 2025 04:19:57 +0000 Subject: [PATCH 3/5] Bumping drift-common to 951c5dd158ea77acc3fc71b559facbed4a1ade7f --- drift-common | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drift-common b/drift-common index e3011f8..951c5dd 160000 --- a/drift-common +++ b/drift-common @@ -1 +1 @@ -Subproject commit e3011f8b0f5bd63a8332c9b1b13a1a042fd8e280 +Subproject commit 951c5dd158ea77acc3fc71b559facbed4a1ade7f From b585fb4c9916c2c3765eedee611154b9f40b9d12 Mon Sep 17 00:00:00 2001 From: GitHub Actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 21 Jul 2025 18:14:18 +0000 Subject: [PATCH 4/5] Bumping drift-common to 05cc04b114ca561618332df60a4298f121895aa1 --- drift-common | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drift-common b/drift-common index 951c5dd..05cc04b 160000 --- a/drift-common +++ b/drift-common @@ -1 +1 @@ -Subproject commit 951c5dd158ea77acc3fc71b559facbed4a1ade7f +Subproject commit 05cc04b114ca561618332df60a4298f121895aa1 From ee71d64e8a8a5c4b2b451162853413f3074f888f Mon Sep 17 00:00:00 2001 From: Jack Waller Date: Tue, 22 Jul 2025 12:35:01 +1000 Subject: [PATCH 5/5] chore: test out a dlob ignore list --- .../OrderSubscriberFiltered.ts | 35 +++++++++++++++++++ src/publishers/dlobPublisher.ts | 4 ++- 2 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 src/dlob-subscriber/OrderSubscriberFiltered.ts diff --git a/src/dlob-subscriber/OrderSubscriberFiltered.ts b/src/dlob-subscriber/OrderSubscriberFiltered.ts new file mode 100644 index 0000000..a69cfca --- /dev/null +++ b/src/dlob-subscriber/OrderSubscriberFiltered.ts @@ -0,0 +1,35 @@ +import { + OrderSubscriber, + OrderSubscriberConfig, + UserAccount, +} from '@drift-labs/sdk'; + +export class OrderSubscriberFiltered extends OrderSubscriber { + public ignoreList: string[]; + + constructor( + config: OrderSubscriberConfig & { + ignoreList?: string[]; + } + ) { + super(config); + this.ignoreList = config.ignoreList ?? []; + } + + override async tryUpdateUserAccount( + key: string, + dataType: 'raw' | 'decoded' | 'buffer', + data: string[] | UserAccount | Buffer, + slot: number + ) { + if (!this.mostRecentSlot || slot > this.mostRecentSlot) { + this.mostRecentSlot = slot; + } + + if (this.ignoreList.includes(key)) { + return; + } + + super.tryUpdateUserAccount(key, dataType, data, slot); + } +} diff --git a/src/publishers/dlobPublisher.ts b/src/publishers/dlobPublisher.ts index 4bee76a..0a4281f 100644 --- a/src/publishers/dlobPublisher.ts +++ b/src/publishers/dlobPublisher.ts @@ -47,6 +47,7 @@ import express, { Response, Request } from 'express'; import { handleHealthCheck } from '../core/middleware'; import { setGlobalDispatcher, Agent } from 'undici'; import { Metrics } from '../core/metricsV2'; +import { OrderSubscriberFiltered } from '../dlob-subscriber/OrderSubscriberFiltered'; setGlobalDispatcher( new Agent({ @@ -474,9 +475,10 @@ const main = async () => { }; } - const orderSubscriber = new OrderSubscriber({ + const orderSubscriber = new OrderSubscriberFiltered({ driftClient, subscriptionConfig, + ignoreList: ['5N1AcdftujhXWZdBaqfciaKtXn6uVBKjmgwf6aQxR1vW'] }); dlobProvider = getDLOBProviderFromOrderSubscriber(orderSubscriber);