From b20d6358f82872cfcb034811c8f78a476e16f528 Mon Sep 17 00:00:00 2001 From: jsy1218 <91580504+jsy1218@users.noreply.github.com> Date: Mon, 9 Dec 2024 15:01:43 -0500 Subject: [PATCH] update routing-api sim status --- lib/handlers/quote/quote.ts | 3 +++ lib/handlers/quote/util/simulation.ts | 3 +++ 2 files changed, 6 insertions(+) diff --git a/lib/handlers/quote/quote.ts b/lib/handlers/quote/quote.ts index d489c20cde..26952bbe32 100644 --- a/lib/handlers/quote/quote.ts +++ b/lib/handlers/quote/quote.ts @@ -515,6 +515,9 @@ export class QuoteHandler extends APIGLambdaHandler< } else if (simulationStatus == SimulationStatus.SystemDown) { metric.putMetric('SimulationSystemDown', 1, MetricLoggerUnit.Count) metric.putMetric(`SimulationSystemDownChainId${chainId}`, 1, MetricLoggerUnit.Count) + } else if (simulationStatus == SimulationStatus.SlippageTooLow) { + metric.putMetric('SlippageTooLow', 1, MetricLoggerUnit.Count) + metric.putMetric(`SlippageTooLowChainId${chainId}`, 1, MetricLoggerUnit.Count) } const routeResponse: Array = [] diff --git a/lib/handlers/quote/util/simulation.ts b/lib/handlers/quote/util/simulation.ts index 41cd5e243a..9bde88b353 100644 --- a/lib/handlers/quote/util/simulation.ts +++ b/lib/handlers/quote/util/simulation.ts @@ -9,6 +9,7 @@ export enum RoutingApiSimulationStatus { NOT_SUPPORTED = 'NOT_SUPPORTED', NOT_APPROVED = 'NOT_APPROVED', SYSTEM_DOWN = 'SYSTEM_DOWN', + SLIPPAGE_TOO_LOW = 'SLIPPAGE_TOO_LOW', UNKNOWN = '', } @@ -31,6 +32,8 @@ export const simulationStatusTranslation = ( return RoutingApiSimulationStatus.NOT_APPROVED case SimulationStatus.SystemDown: return RoutingApiSimulationStatus.SYSTEM_DOWN + case SimulationStatus.SlippageTooLow: + return RoutingApiSimulationStatus.SLIPPAGE_TOO_LOW default: log.error(`Unknown simulation status ${simulationStatus}`) return RoutingApiSimulationStatus.UNKNOWN