From aacd89e001ffc85397fa6c13f465e5c0973c8637 Mon Sep 17 00:00:00 2001 From: GitHub Actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 28 May 2025 08:58:58 +0000 Subject: [PATCH 1/8] Bumping drift-common to 00a0b05f125cfd4f8d125560e469df2387bbc716 --- drift-common | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drift-common b/drift-common index e13a163..00a0b05 160000 --- a/drift-common +++ b/drift-common @@ -1 +1 @@ -Subproject commit e13a163ff2f4fc1737559fc25a51f000d2482d2e +Subproject commit 00a0b05f125cfd4f8d125560e469df2387bbc716 From 9d1d146a3da492cc917a82e6c1a9b89aaabf27e2 Mon Sep 17 00:00:00 2001 From: GitHub Actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 28 May 2025 12:08:11 +0000 Subject: [PATCH 2/8] Bumping drift-common to 47f8a674fb31cf42e5f8aa4137a3f62c33c03b00 --- drift-common | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drift-common b/drift-common index 00a0b05..47f8a67 160000 --- a/drift-common +++ b/drift-common @@ -1 +1 @@ -Subproject commit 00a0b05f125cfd4f8d125560e469df2387bbc716 +Subproject commit 47f8a674fb31cf42e5f8aa4137a3f62c33c03b00 From a7fad9469b646849c25d4feea1b3964407a6279d Mon Sep 17 00:00:00 2001 From: GitHub Actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 28 May 2025 13:58:31 +0000 Subject: [PATCH 3/8] Bumping drift-common to 8e388c77fadf87c49de91b1a087dbd65844d6eea --- drift-common | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drift-common b/drift-common index 47f8a67..8e388c7 160000 --- a/drift-common +++ b/drift-common @@ -1 +1 @@ -Subproject commit 47f8a674fb31cf42e5f8aa4137a3f62c33c03b00 +Subproject commit 8e388c77fadf87c49de91b1a087dbd65844d6eea From 4d3f990782ed1866cff9be912091ef43a00e94c9 Mon Sep 17 00:00:00 2001 From: Nick Caradonna Date: Wed, 28 May 2025 14:29:25 -0400 Subject: [PATCH 4/8] add internal auth bypass to new endpoints --- src/index.ts | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/index.ts b/src/index.ts index 7a44f52..352e8b4 100644 --- a/src/index.ts +++ b/src/index.ts @@ -788,7 +788,12 @@ const main = async (): Promise => { const origin = req.get('Origin') || req.get('Referer'); const allowedOrigins = ['https://app.drift.trade', 'https://beta.drift.trade']; - if (!origin || !allowedOrigins.some(allowed => origin.startsWith(allowed))) { + const hasAuth = ( + (req.headers.Authorization || req.headers.authorization) === + process.env.INTERNAL_SECRET + ) + + if (!hasAuth && (!origin || !allowedOrigins.some(allowed => origin.startsWith(allowed)))) { res.status(403).json({ error: 'Forbidden: Invalid origin' }); return; } @@ -843,9 +848,14 @@ const main = async (): Promise => { try { // Check origin validation const origin = req.get('Origin') || req.get('Referer'); - const allowedOrigins = ['https://app.drift.trade', 'https://beta.drift.trade']; + const allowedOrigins = ['https://app.drift.trade', 'https://beta.drift.trade']; - if (!origin || !allowedOrigins.some(allowed => origin.startsWith(allowed))) { + const hasAuth = ( + (req.headers.Authorization || req.headers.authorization) === + process.env.INTERNAL_SECRET + ) + + if (!hasAuth && (!origin || !allowedOrigins.some(allowed => origin.startsWith(allowed)))) { res.status(403).json({ error: 'Forbidden: Invalid origin' }); return; } From 213ab30972192c08c87f85e9edb7d69f12bbf27b Mon Sep 17 00:00:00 2001 From: GitHub Actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 28 May 2025 20:33:33 +0000 Subject: [PATCH 5/8] Bumping drift-common to 9b38fbbaf5d17a362cc2af3d8ebdddb4ae369d87 --- drift-common | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drift-common b/drift-common index 8e388c7..9b38fbb 160000 --- a/drift-common +++ b/drift-common @@ -1 +1 @@ -Subproject commit 8e388c77fadf87c49de91b1a087dbd65844d6eea +Subproject commit 9b38fbbaf5d17a362cc2af3d8ebdddb4ae369d87 From 5b54d65dd80c9c12d42d13c656de8ac0617e9dd0 Mon Sep 17 00:00:00 2001 From: GitHub Actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 28 May 2025 20:43:08 +0000 Subject: [PATCH 6/8] Bumping drift-common to fc0fb4d2bd37ede822008c6f57a6e7dbb2b9cb39 --- drift-common | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drift-common b/drift-common index 9b38fbb..fc0fb4d 160000 --- a/drift-common +++ b/drift-common @@ -1 +1 @@ -Subproject commit 9b38fbbaf5d17a362cc2af3d8ebdddb4ae369d87 +Subproject commit fc0fb4d2bd37ede822008c6f57a6e7dbb2b9cb39 From c77766790772d22af172a7a596a0bb5f2febf038 Mon Sep 17 00:00:00 2001 From: Nour Alharithi Date: Thu, 29 May 2025 14:13:30 -0700 Subject: [PATCH 7/8] forEach to for loop for indicative quotes --- src/dlob-subscriber/DLOBSubscriberIO.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/dlob-subscriber/DLOBSubscriberIO.ts b/src/dlob-subscriber/DLOBSubscriberIO.ts index b978097..ad5ac28 100644 --- a/src/dlob-subscriber/DLOBSubscriberIO.ts +++ b/src/dlob-subscriber/DLOBSubscriberIO.ts @@ -153,7 +153,7 @@ export class DLOBSubscriberIO extends DLOBSubscriber { ); const nowMinus1000Ms = Date.now() - 1000; - mmQuotes.forEach((quote) => { + for (const quote of mmQuotes) { if (Number(quote['ts']) > nowMinus1000Ms) { const indicativeBaseOrder: Order = { status: OrderStatus.OPEN, @@ -233,7 +233,7 @@ export class DLOBSubscriberIO extends DLOBSubscriber { ); } } - }); + } } this.getL2AndSendMsg(marketArgs); this.getL3AndSendMsg(marketArgs); From 2595d475fd85fe3beedab2a3bb556cd25d8cd308 Mon Sep 17 00:00:00 2001 From: wphan Date: Thu, 29 May 2025 14:05:00 -0700 Subject: [PATCH 8/8] disable pmm view for indicative publisher --- src/publishers/dlobPublisher.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/publishers/dlobPublisher.ts b/src/publishers/dlobPublisher.ts index 5b1077a..2432be0 100644 --- a/src/publishers/dlobPublisher.ts +++ b/src/publishers/dlobPublisher.ts @@ -520,7 +520,7 @@ const main = async () => { perpMarketInfos, spotMarketInfos, killSwitchSlotDiffThreshold: KILLSWITCH_SLOT_DIFF_THRESHOLD, - protectedMakerView: true, + protectedMakerView: false, indicativeQuotesRedisClient: indicativeRedisClient, }); await dlobSubscriberIndicative.subscribe();