Skip to content

Commit

Permalink
update routing-api sim status
Browse files Browse the repository at this point in the history
  • Loading branch information
jsy1218 committed Dec 9, 2024
1 parent 008c671 commit b20d635
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/handlers/quote/quote.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<SupportedPoolInRoute[]> = []
Expand Down
3 changes: 3 additions & 0 deletions lib/handlers/quote/util/simulation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 = '',
}

Expand All @@ -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
Expand Down

0 comments on commit b20d635

Please sign in to comment.