diff --git a/drift-common b/drift-common index 05cc04b..6ae9e65 160000 --- a/drift-common +++ b/drift-common @@ -1 +1 @@ -Subproject commit 05cc04b114ca561618332df60a4298f121895aa1 +Subproject commit 6ae9e6541b336e9777e48ac517bc0705ae3d5fcf diff --git a/src/core/healthCheck.ts b/src/core/healthCheck.ts index 1761524..fd54f48 100644 --- a/src/core/healthCheck.ts +++ b/src/core/healthCheck.ts @@ -46,6 +46,14 @@ function evaluateHealth(currentSlot: number): { return { isHealthy: true }; } + const currentHealthStatus = getHealthStatus(); + if (currentHealthStatus !== HEALTH_STATUS.Ok) { + return { + isHealthy: false, + reason: `Unhealthy state: ${currentHealthStatus}`, + }; + } + const timeDelta = now - globalHealthState.lastSlotTimestamp; const slotDelta = currentSlot - globalHealthState.lastSlot; diff --git a/src/index.ts b/src/index.ts index 0b40565..660e65f 100644 --- a/src/index.ts +++ b/src/index.ts @@ -937,6 +937,7 @@ const main = async (): Promise => { auctionEndPriceOffsetFrom, additionalEndPriceBuffer, userOrderId, + forceUpToSlippage, } = req.query; // Validate required parameters @@ -1001,6 +1002,7 @@ const main = async (): Promise => { auctionEndPriceOffsetFrom: auctionEndPriceOffsetFrom as any, additionalEndPriceBuffer: additionalEndPriceBuffer as string, userOrderId: parseNumber(userOrderId as string), + forceUpToSlippage: parseBoolean(forceUpToSlippage as string), }; // Only add non-undefined values diff --git a/src/publishers/dlobPublisher.ts b/src/publishers/dlobPublisher.ts index 0a4281f..c2bad22 100644 --- a/src/publishers/dlobPublisher.ts +++ b/src/publishers/dlobPublisher.ts @@ -128,6 +128,9 @@ const SPOT_MARKETS_TO_LOAD = : undefined; const enableOffloadQueue = process.env.ENABLE_OFFLOAD === 'true'; +const ignoreList = process.env.IGNORE_LIST?.split(',') || [ + '5N1AcdftujhXWZdBaqfciaKtXn6uVBKjmgwf6aQxR1vW', +]; logger.info(`RPC endpoint: ${endpoint}`); logger.info(`WS endpoint: ${wsEndpoint}`); @@ -478,7 +481,7 @@ const main = async () => { const orderSubscriber = new OrderSubscriberFiltered({ driftClient, subscriptionConfig, - ignoreList: ['5N1AcdftujhXWZdBaqfciaKtXn6uVBKjmgwf6aQxR1vW'] + ignoreList, }); dlobProvider = getDLOBProviderFromOrderSubscriber(orderSubscriber); diff --git a/src/utils/types.ts b/src/utils/types.ts index c836a98..239f575 100644 --- a/src/utils/types.ts +++ b/src/utils/types.ts @@ -21,4 +21,5 @@ export type AuctionParamArgs = { auctionEndPriceOffsetFrom?: TradeOffsetPrice; additionalEndPriceBuffer?: string; userOrderId?: number; + forceUpToSlippage?: boolean; }; diff --git a/src/utils/utils.ts b/src/utils/utils.ts index 98ba139..351e140 100644 --- a/src/utils/utils.ts +++ b/src/utils/utils.ts @@ -985,7 +985,7 @@ export const mapToMarketOrderParams = async ( slippageTolerance: processedSlippageTolerance, isOracleOrder: params.isOracleOrder, additionalEndPriceBuffer, - forceUpToSlippage: true, + forceUpToSlippage: params.forceUpToSlippage, userOrderId: params.userOrderId, }, estimatedPrices,